From 6037f6e2a6e95bf9958f93d576589c91bca97969 Mon Sep 17 00:00:00 2001 From: Stefan Dietz Date: Fri, 27 Oct 2023 08:19:29 +0200 Subject: [PATCH] Remove accessKey from initial states and make sure they're not required --- packages/components/src/components/button/component.tsx | 1 - packages/components/src/components/span/component.tsx | 1 - packages/components/src/components/tooltip/component.tsx | 1 - packages/components/src/components/tooltip/test/html.mock.ts | 1 - packages/components/src/components/tooltip/types.ts | 2 +- 5 files changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/components/src/components/button/component.tsx b/packages/components/src/components/button/component.tsx index 4f06a64ab5..2121482695 100644 --- a/packages/components/src/components/button/component.tsx +++ b/packages/components/src/components/button/component.tsx @@ -229,7 +229,6 @@ export class KolButtonWc implements API { _on: {}, _type: 'button', // ⚠ required _variant: 'normal', // ⚠ required - _accessKey: '', }; public constructor() { diff --git a/packages/components/src/components/span/component.tsx b/packages/components/src/components/span/component.tsx index a25d84c02c..972f85ea18 100644 --- a/packages/components/src/components/span/component.tsx +++ b/packages/components/src/components/span/component.tsx @@ -93,7 +93,6 @@ export class KolSpanWc implements API { _hideLabel: false, _icons: {}, _label: '', // ⚠ required - _accessKey: '', }; @Watch('_accessKey') diff --git a/packages/components/src/components/tooltip/component.tsx b/packages/components/src/components/tooltip/component.tsx index dcce0c9ba9..7becbf09ee 100644 --- a/packages/components/src/components/tooltip/component.tsx +++ b/packages/components/src/components/tooltip/component.tsx @@ -169,7 +169,6 @@ export class KolTooltip implements API { @Prop() public _label!: LabelPropType; @State() public state: States = { - _accessKey: '', _align: 'top', _id: nonce(), _label: '…', // ⚠ required diff --git a/packages/components/src/components/tooltip/test/html.mock.ts b/packages/components/src/components/tooltip/test/html.mock.ts index 0910c198a7..16adc9f230 100644 --- a/packages/components/src/components/tooltip/test/html.mock.ts +++ b/packages/components/src/components/tooltip/test/html.mock.ts @@ -7,7 +7,6 @@ import { Props, States } from '../types'; export const getTooltipHtml = (props: Props, additionalAttrs = ''): string => { const state: States = mixMembers( { - _accessKey: '', _align: 'top', _id: nonce(), _label: '…', // ⚠ required diff --git a/packages/components/src/components/tooltip/types.ts b/packages/components/src/components/tooltip/types.ts index 54c956bd5a..8b85823912 100644 --- a/packages/components/src/components/tooltip/types.ts +++ b/packages/components/src/components/tooltip/types.ts @@ -9,7 +9,7 @@ type RequiredProps = PropLabel; type OptionalProps = PropAlign & PropId & PropAccessKey; export type Props = Generic.Element.Members; -type RequiredStates = RequiredProps & OptionalProps; +type RequiredStates = RequiredProps & PropAlign & PropId; type OptionalStates = NonNullable; export type States = Generic.Element.Members;