Skip to content

Commit 5e6dde9

Browse files
committed
refactor: rename propagateFocus to delegateFocus for clarity and consistency
1 parent 4d57b98 commit 5e6dde9

File tree

18 files changed

+36
-36
lines changed

18 files changed

+36
-36
lines changed

packages/components/src/components/button/component.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ import { SpanFC } from '../../internal/functional-components/span/component';
5555
import type { AriaHasPopupPropType } from '../../schema/props/aria-has-popup';
5656
import { validateAccessAndShortKey } from '../../schema/validators/access-and-short-key';
5757
import clsx from '../../utils/clsx';
58-
import { propagateFocus } from '../../utils/element-focus';
58+
import { delegateFocus } from '../../utils/element-focus';
5959
import { dispatchDomEvent, KolEvent } from '../../utils/events';
6060
import { propagateResetEventToForm, propagateSubmitEventToForm } from '../form/controller';
6161
import { AssociatedInputController } from '../input-adapter-leanup/associated.controller';
@@ -77,7 +77,7 @@ export class KolButtonWc implements ButtonAPI {
7777
*/
7878
@Method()
7979
public async focus(host: HTMLElement): Promise<void> {
80-
await propagateFocus(host, this.buttonRef);
80+
await delegateFocus(host, this.buttonRef);
8181
}
8282

8383
private readonly hideTooltip = () => {

packages/components/src/components/combobox/shadow.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import type {
3535
import type { EventDetail } from '../../schema/interfaces/EventDetail';
3636
import clsx from '../../utils/clsx';
3737
import { nonce } from '../../utils/dev.utils';
38-
import { propagateFocus } from '../../utils/element-focus';
38+
import { delegateFocus } from '../../utils/element-focus';
3939
import { ComboboxController } from './controller';
4040

4141
/**
@@ -69,7 +69,7 @@ export class KolCombobox implements ComboboxAPI, FocusableElement {
6969
*/
7070
@Method()
7171
public async focus() {
72-
await propagateFocus(this.host, this.refInput);
72+
await delegateFocus(this.host, this.refInput);
7373
}
7474

7575
private toggleListbox = () => {

packages/components/src/components/input-checkbox/shadow.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import type {
2727
} from '../../schema';
2828

2929
import { nonce } from '../../utils/dev.utils';
30-
import { propagateFocus } from '../../utils/element-focus';
30+
import { delegateFocus } from '../../utils/element-focus';
3131
import { InputCheckboxController } from './controller';
3232

3333
import KolCheckboxStateWrapperFc, { type CheckboxStateWrapperProps } from '../../functional-component-wrappers/CheckboxStateWrapper/CheckboxStateWrapper';
@@ -76,7 +76,7 @@ export class KolInputCheckbox implements InputCheckboxAPI, FocusableElement {
7676
*/
7777
@Method()
7878
public async focus() {
79-
await propagateFocus(this.host, this.inputRef);
79+
await delegateFocus(this.host, this.inputRef);
8080
}
8181

8282
private getFormFieldProps(): FormFieldStateWrapperProps {

packages/components/src/components/input-color/shadow.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import KolFormFieldStateWrapperFc, { type FormFieldStateWrapperProps } from '../
2626
import KolInputContainerFc from '../../functional-component-wrappers/InputContainerStateWrapper/InputContainerStateWrapper';
2727
import KolInputStateWrapperFc, { type InputStateWrapperProps } from '../../functional-component-wrappers/InputStateWrapper/InputStateWrapper';
2828
import { nonce } from '../../utils/dev.utils';
29-
import { propagateFocus } from '../../utils/element-focus';
29+
import { delegateFocus } from '../../utils/element-focus';
3030
import { InputColorController } from './controller';
3131

3232
/**
@@ -97,7 +97,7 @@ export class KolInputColor implements InputColorAPI, FocusableElement {
9797
*/
9898
@Method()
9999
public async focus() {
100-
await propagateFocus(this.host, this.refInputText);
100+
await delegateFocus(this.host, this.refInputText);
101101
}
102102

103103
private get hasSuggestions(): boolean {

packages/components/src/components/input-date/shadow.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import KolFormFieldStateWrapperFc, { type FormFieldStateWrapperProps } from '../
3434
import KolInputContainerFc from '../../functional-component-wrappers/InputContainerStateWrapper/InputContainerStateWrapper';
3535
import KolInputStateWrapperFc, { type InputStateWrapperProps } from '../../functional-component-wrappers/InputStateWrapper/InputStateWrapper';
3636
import { nonce } from '../../utils/dev.utils';
37-
import { propagateFocus } from '../../utils/element-focus';
37+
import { delegateFocus } from '../../utils/element-focus';
3838
import { propagateSubmitEventToForm } from '../form/controller';
3939
import { InputDateController } from './controller';
4040

@@ -74,7 +74,7 @@ export class KolInputDate implements InputDateAPI, FocusableElement {
7474
*/
7575
@Method()
7676
public async focus() {
77-
await propagateFocus(this.host, this.inputRef);
77+
await delegateFocus(this.host, this.inputRef);
7878
}
7979

8080
/**

packages/components/src/components/input-email/shadow.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import KolFormFieldStateWrapperFc, { type FormFieldStateWrapperProps } from '../
3434
import KolInputContainerFc from '../../functional-component-wrappers/InputContainerStateWrapper/InputContainerStateWrapper';
3535
import KolInputStateWrapperFc, { type InputStateWrapperProps } from '../../functional-component-wrappers/InputStateWrapper/InputStateWrapper';
3636
import { nonce } from '../../utils/dev.utils';
37-
import { propagateFocus } from '../../utils/element-focus';
37+
import { delegateFocus } from '../../utils/element-focus';
3838
import { propagateSubmitEventToForm } from '../form/controller';
3939
import { InputEmailController } from './controller';
4040

@@ -72,7 +72,7 @@ export class KolInputEmail implements InputEmailAPI, FocusableElement {
7272
*/
7373
@Method()
7474
public async focus() {
75-
await propagateFocus(this.host, this.inputRef);
75+
await delegateFocus(this.host, this.inputRef);
7676
}
7777

7878
private readonly onKeyDown = (event: KeyboardEvent) => {

packages/components/src/components/input-file/shadow.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import KolInputContainerFc from '../../functional-component-wrappers/InputContai
3131
import KolInputStateWrapperFc, { type InputStateWrapperProps } from '../../functional-component-wrappers/InputStateWrapper/InputStateWrapper';
3232
import { translate } from '../../i18n';
3333
import { nonce } from '../../utils/dev.utils';
34-
import { propagateFocus } from '../../utils/element-focus';
34+
import { delegateFocus } from '../../utils/element-focus';
3535
import { InputFileController } from './controller';
3636

3737
/**
@@ -71,7 +71,7 @@ export class KolInputFile implements InputFileAPI, FocusableElement {
7171
*/
7272
@Method()
7373
public async focus() {
74-
await propagateFocus(this.host, this.inputRef);
74+
await delegateFocus(this.host, this.inputRef);
7575
}
7676

7777
/**

packages/components/src/components/input-number/shadow.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import KolInputContainerFc from '../../functional-component-wrappers/InputContai
3333
import KolInputStateWrapperFc, { type InputStateWrapperProps } from '../../functional-component-wrappers/InputStateWrapper/InputStateWrapper';
3434
import { IconFC } from '../../internal/functional-components/icon/component';
3535
import { nonce } from '../../utils/dev.utils';
36-
import { propagateFocus } from '../../utils/element-focus';
36+
import { delegateFocus } from '../../utils/element-focus';
3737
import { propagateSubmitEventToForm } from '../form/controller';
3838
import { InputNumberController } from './controller';
3939

@@ -71,7 +71,7 @@ export class KolInputNumber implements InputNumberAPI, FocusableElement {
7171
*/
7272
@Method()
7373
public async focus() {
74-
await propagateFocus(this.host, this.inputRef);
74+
await delegateFocus(this.host, this.inputRef);
7575
}
7676

7777
private setInitialValueType(value?: number | NumberString | null) {

packages/components/src/components/input-password/shadow.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ import KolIconButtonFc from '../../functional-components/IconButton';
3636
import { translate } from '../../i18n';
3737
import type { PasswordVariantPropType } from '../../schema/props/variant/password-variant';
3838
import { nonce } from '../../utils/dev.utils';
39-
import { propagateFocus } from '../../utils/element-focus';
39+
import { delegateFocus } from '../../utils/element-focus';
4040
import { propagateSubmitEventToForm } from '../form/controller';
4141
import { InputPasswordController } from './controller';
4242

@@ -77,7 +77,7 @@ export class KolInputPassword implements InputPasswordAPI, FocusableElement {
7777
*/
7878
@Method()
7979
public async focus() {
80-
await propagateFocus(this.host, this.inputRef);
80+
await delegateFocus(this.host, this.inputRef);
8181
}
8282

8383
private readonly onKeyDown = (event: KeyboardEvent) => {

packages/components/src/components/input-radio/shadow.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import type {
2424
} from '../../schema';
2525

2626
import { nonce } from '../../utils/dev.utils';
27-
import { propagateFocus } from '../../utils/element-focus';
27+
import { delegateFocus } from '../../utils/element-focus';
2828
import { propagateSubmitEventToForm } from '../form/controller';
2929
import { InputRadioController } from './controller';
3030

@@ -78,7 +78,7 @@ export class KolInputRadio implements InputRadioAPI, FocusableElement {
7878
*/
7979
@Method()
8080
public async focus() {
81-
await propagateFocus(this.host, this.getFocusableInput());
81+
await delegateFocus(this.host, this.getFocusableInput());
8282
}
8383

8484
private getFocusableInput(): HTMLInputElement | undefined {

0 commit comments

Comments
 (0)