Skip to content

Commit afd25eb

Browse files
committed
Merge branch 'release/2' of https://github.com/public-ui/kolibri into 7460-v2
2 parents 95f133d + 63b9b3d commit afd25eb

File tree

59 files changed

+304
-260
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+304
-260
lines changed

packages/components/src/components/@deprecated/input/controller-icon.ts

Lines changed: 4 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,12 @@
11
import type { Generic } from 'adopted-style-sheets';
22

3-
import type { KoliBriHorizontalIcons, Stringified } from '../../../schema';
4-
import { isIcon, isString, objectObjectHandler, parseJson, watchValidator } from '../../../schema';
3+
import type { IconsHorizontalPropType } from '../../../schema';
4+
import { validateIcons } from '../../../schema';
55

66
import { InputController } from './controller';
77

88
import type { Props, Watches } from './types-icon';
99

10-
const beforePatchIcons = (value: unknown, nextState: Map<string, unknown>): void => {
11-
const icons = value as KoliBriHorizontalIcons;
12-
if (typeof icons === 'object' && icons !== null) {
13-
if (isString(icons.right, 1)) {
14-
icons.right = { icon: icons.right as string };
15-
}
16-
if (isString(icons.left, 1)) {
17-
icons.left = { icon: icons.left as string };
18-
}
19-
nextState.set('_icons', icons);
20-
}
21-
};
22-
2310
export class InputIconController extends InputController implements Watches {
2411
protected readonly component: Generic.Element.Component & Props;
2512

@@ -28,32 +15,8 @@ export class InputIconController extends InputController implements Watches {
2815
this.component = component;
2916
}
3017

31-
public validateIcons(value?: Stringified<KoliBriHorizontalIcons>): void {
32-
objectObjectHandler(value, () => {
33-
try {
34-
value = parseJson<KoliBriHorizontalIcons>(value as string);
35-
// eslint-disable-next-line no-empty
36-
} catch (e) {
37-
// value behält den ursprünglichen Wert
38-
}
39-
watchValidator(
40-
this.component,
41-
'_icons',
42-
(value): boolean => {
43-
return (
44-
typeof value === 'object' && value !== null && (isString(value.left, 1) || isIcon(value.left) || isString(value.right, 1) || isIcon(value.right))
45-
);
46-
},
47-
new Set(['KoliBriHorizontalIcon']),
48-
value,
49-
{
50-
hooks: {
51-
beforePatch: beforePatchIcons,
52-
},
53-
required: true,
54-
},
55-
);
56-
});
18+
public validateIcons(value?: IconsHorizontalPropType): void {
19+
validateIcons(this.component, value);
5720
}
5821

5922
public componentWillLoad(): void {
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
import type { KoliBriHorizontalIcons, PropLabelWithExpertSlot, Stringified } from '../../../schema';
21
import type { Generic } from 'adopted-style-sheets';
2+
import type { PropHorizontalIcons, PropLabelWithExpertSlot } from '../../../schema';
33

44
type RequiredProps = NonNullable<unknown>;
5-
type OptionalProps = PropLabelWithExpertSlot & {
6-
icons: Stringified<KoliBriHorizontalIcons>;
7-
};
5+
type OptionalProps = PropLabelWithExpertSlot & PropHorizontalIcons;
86
export type Props = Generic.Element.Members<RequiredProps, OptionalProps>;
97
export type Watches = Generic.Element.Watchers<RequiredProps, OptionalProps>;

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
import type { JSX } from '@stencil/core';
2+
import { Component, Element, Fragment, h, Host, Listen, Method, Prop, State, Watch } from '@stencil/core';
13
import type {
24
ComboboxAPI,
35
ComboboxStates,
46
HideErrorPropType,
7+
IconsHorizontalPropType,
58
IdPropType,
69
InputTypeOnDefault,
7-
KoliBriHorizontalIcons,
810
LabelWithExpertSlotPropType,
911
MsgPropType,
1012
NamePropType,
@@ -16,17 +18,15 @@ import type {
1618
W3CInputValue,
1719
} from '../../schema';
1820
import { buildBadgeTextString, showExpertSlot } from '../../schema';
19-
import type { JSX } from '@stencil/core';
20-
import { Component, Element, Fragment, h, Host, Listen, Method, Prop, State, Watch } from '@stencil/core';
2121

22+
import clsx from 'clsx';
23+
import { KolIconTag, KolInputTag } from '../../core/component-names';
24+
import { translate } from '../../i18n';
2225
import { nonce } from '../../utils/dev.utils';
2326
import { stopPropagation, tryToDispatchKoliBriEvent } from '../../utils/events';
24-
import { ComboboxController } from './controller';
25-
import { KolIconTag, KolInputTag } from '../../core/component-names';
26-
import { InternalUnderlinedBadgeText } from '../span/InternalUnderlinedBadgeText';
2727
import { getRenderStates } from '../input/controller';
28-
import { translate } from '../../i18n';
29-
import clsx from 'clsx';
28+
import { InternalUnderlinedBadgeText } from '../span/InternalUnderlinedBadgeText';
29+
import { ComboboxController } from './controller';
3030

3131
/**
3232
* @slot - Die Beschriftung des Eingabefeldes.
@@ -408,7 +408,7 @@ export class KolCombobox implements ComboboxAPI {
408408
/**
409409
* Defines the icon classnames (e.g. `_icons="fa-solid fa-user"`).
410410
*/
411-
@Prop() public _icons?: Stringified<KoliBriHorizontalIcons>;
411+
@Prop() public _icons?: IconsHorizontalPropType;
412412

413413
/**
414414
* Defines the internal ID of the primary component element.
@@ -537,7 +537,7 @@ export class KolCombobox implements ComboboxAPI {
537537
}
538538

539539
@Watch('_icons')
540-
public validateIcons(value?: Stringified<KoliBriHorizontalIcons>): void {
540+
public validateIcons(value?: IconsHorizontalPropType): void {
541541
this.controller.validateIcons(value);
542542
}
543543

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1+
import type { JSX } from '@stencil/core';
2+
import { Component, Element, Fragment, h, Host, Method, Prop, State, Watch } from '@stencil/core';
13
import type {
24
ButtonProps,
35
FocusableElement,
46
HideErrorPropType,
7+
IconsHorizontalPropType,
58
IdPropType,
69
InputColorAPI,
710
InputColorStates,
811
InputTypeOnDefault,
912
InputTypeOnOff,
10-
KoliBriHorizontalIcons,
1113
LabelWithExpertSlotPropType,
1214
MsgPropType,
1315
NamePropType,
@@ -18,14 +20,12 @@ import type {
1820
TooltipAlignPropType,
1921
} from '../../schema';
2022
import { buildBadgeTextString, showExpertSlot } from '../../schema';
21-
import type { JSX } from '@stencil/core';
22-
import { Component, Element, Fragment, h, Host, Method, Prop, State, Watch } from '@stencil/core';
2323

24+
import { KolInputTag } from '../../core/component-names';
2425
import { nonce } from '../../utils/dev.utils';
2526
import { getRenderStates } from '../input/controller';
2627
import { InternalUnderlinedBadgeText } from '../span/InternalUnderlinedBadgeText';
2728
import { InputColorController } from './controller';
28-
import { KolInputTag } from '../../core/component-names';
2929

3030
/**
3131
* @slot - Die Beschriftung des Eingabefeldes.
@@ -195,7 +195,7 @@ export class KolInputColor implements InputColorAPI, FocusableElement {
195195
/**
196196
* Defines the icon classnames (e.g. `_icons="fa-solid fa-user"`).
197197
*/
198-
@Prop() public _icons?: Stringified<KoliBriHorizontalIcons>;
198+
@Prop() public _icons?: IconsHorizontalPropType;
199199

200200
/**
201201
* Defines the internal ID of the primary component element.
@@ -326,7 +326,7 @@ export class KolInputColor implements InputColorAPI, FocusableElement {
326326
}
327327

328328
@Watch('_icons')
329-
public validateIcons(value?: Stringified<KoliBriHorizontalIcons>): void {
329+
public validateIcons(value?: IconsHorizontalPropType): void {
330330
this.controller.validateIcons(value);
331331
}
332332

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ import type {
44
ButtonProps,
55
FocusableElement,
66
HideErrorPropType,
7+
IconsHorizontalPropType,
78
IdPropType,
89
InputDateAPI,
910
InputDateStates,
1011
InputDateType,
1112
InputTypeOnDefault,
1213
InputTypeOnOff,
1314
Iso8601,
14-
KoliBriHorizontalIcons,
1515
LabelWithExpertSlotPropType,
1616
MsgPropType,
1717
NamePropType,
@@ -24,12 +24,12 @@ import type {
2424
} from '../../schema';
2525
import { buildBadgeTextString, deprecatedHint, showExpertSlot } from '../../schema';
2626

27+
import { KolInputTag } from '../../core/component-names';
2728
import { nonce } from '../../utils/dev.utils';
2829
import { propagateSubmitEventToForm } from '../form/controller';
2930
import { getRenderStates } from '../input/controller';
3031
import { InternalUnderlinedBadgeText } from '../span/InternalUnderlinedBadgeText';
3132
import { InputDateController } from './controller';
32-
import { KolInputTag } from '../../core/component-names';
3333

3434
/**
3535
* @slot - Die Beschriftung des Eingabefeldes.
@@ -258,7 +258,7 @@ export class KolInputDate implements InputDateAPI, FocusableElement {
258258
/**
259259
* Defines the icon classnames (e.g. `_icons="fa-solid fa-user"`).
260260
*/
261-
@Prop() public _icons?: Stringified<KoliBriHorizontalIcons>;
261+
@Prop() public _icons?: IconsHorizontalPropType;
262262

263263
/**
264264
* Defines the internal ID of the primary component element.
@@ -423,7 +423,7 @@ export class KolInputDate implements InputDateAPI, FocusableElement {
423423
}
424424

425425
@Watch('_icons')
426-
public validateIcons(value?: Stringified<KoliBriHorizontalIcons>): void {
426+
public validateIcons(value?: IconsHorizontalPropType): void {
427427
this.controller.validateIcons(value);
428428
}
429429

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1+
import type { JSX } from '@stencil/core';
2+
import { Component, Element, Fragment, h, Host, Method, Prop, State, Watch } from '@stencil/core';
13
import type {
24
ButtonProps,
35
FocusableElement,
46
HideErrorPropType,
7+
IconsHorizontalPropType,
58
IdPropType,
69
InputEmailAPI,
710
InputEmailStates,
811
InputTypeOnDefault,
912
InputTypeOnOff,
10-
KoliBriHorizontalIcons,
1113
LabelWithExpertSlotPropType,
1214
MsgPropType,
1315
MultiplePropType,
@@ -19,15 +21,13 @@ import type {
1921
TooltipAlignPropType,
2022
} from '../../schema';
2123
import { buildBadgeTextString, setState, showExpertSlot } from '../../schema';
22-
import type { JSX } from '@stencil/core';
23-
import { Component, Element, Fragment, h, Host, Method, Prop, State, Watch } from '@stencil/core';
2424

25+
import { KolInputTag } from '../../core/component-names';
2526
import { nonce } from '../../utils/dev.utils';
2627
import { propagateSubmitEventToForm } from '../form/controller';
2728
import { getRenderStates } from '../input/controller';
2829
import { InternalUnderlinedBadgeText } from '../span/InternalUnderlinedBadgeText';
2930
import { InputEmailController } from './controller';
30-
import { KolInputTag } from '../../core/component-names';
3131

3232
/**
3333
* @slot - Die Beschriftung des Eingabefeldes.
@@ -230,7 +230,7 @@ export class KolInputEmail implements InputEmailAPI, FocusableElement {
230230
/**
231231
* Defines the icon classnames (e.g. `_icons="fa-solid fa-user"`).
232232
*/
233-
@Prop() public _icons?: Stringified<KoliBriHorizontalIcons>;
233+
@Prop() public _icons?: IconsHorizontalPropType;
234234

235235
/**
236236
* Defines the internal ID of the primary component element.
@@ -401,7 +401,7 @@ export class KolInputEmail implements InputEmailAPI, FocusableElement {
401401
}
402402

403403
@Watch('_icons')
404-
public validateIcons(value?: Stringified<KoliBriHorizontalIcons>): void {
404+
public validateIcons(value?: IconsHorizontalPropType): void {
405405
this.controller.validateIcons(value);
406406
}
407407

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1+
import type { JSX } from '@stencil/core';
2+
import { Component, Element, Fragment, h, Host, Method, Prop, State, Watch } from '@stencil/core';
13
import type {
24
ButtonProps,
35
FocusableElement,
46
HideErrorPropType,
7+
IconsHorizontalPropType,
58
IdPropType,
69
InputFileAPI,
710
InputFileStates,
811
InputTypeOnDefault,
9-
KoliBriHorizontalIcons,
1012
LabelWithExpertSlotPropType,
1113
MsgPropType,
1214
NamePropType,
@@ -16,14 +18,12 @@ import type {
1618
TooltipAlignPropType,
1719
} from '../../schema';
1820
import { buildBadgeTextString, showExpertSlot } from '../../schema';
19-
import type { JSX } from '@stencil/core';
20-
import { Component, Element, Fragment, h, Host, Method, Prop, State, Watch } from '@stencil/core';
2121

22+
import { KolInputTag } from '../../core/component-names';
2223
import { nonce } from '../../utils/dev.utils';
2324
import { getRenderStates } from '../input/controller';
2425
import { InternalUnderlinedBadgeText } from '../span/InternalUnderlinedBadgeText';
2526
import { InputFileController } from './controller';
26-
import { KolInputTag } from '../../core/component-names';
2727

2828
/**
2929
* @slot - Die Beschriftung des Eingabefeldes.
@@ -194,7 +194,7 @@ export class KolInputFile implements InputFileAPI, FocusableElement {
194194
/**
195195
* Defines the icon classnames (e.g. `_icons="fa-solid fa-user"`).
196196
*/
197-
@Prop() public _icons?: Stringified<KoliBriHorizontalIcons>;
197+
@Prop() public _icons?: IconsHorizontalPropType;
198198

199199
/**
200200
* Defines the internal ID of the primary component element.
@@ -330,7 +330,7 @@ export class KolInputFile implements InputFileAPI, FocusableElement {
330330
}
331331

332332
@Watch('_icons')
333-
public validateIcons(value?: Stringified<KoliBriHorizontalIcons>): void {
333+
public validateIcons(value?: IconsHorizontalPropType): void {
334334
this.controller.validateIcons(value);
335335
}
336336

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1+
import type { JSX } from '@stencil/core';
2+
import { Component, Element, Fragment, h, Host, Method, Prop, State, Watch } from '@stencil/core';
13
import type {
24
ButtonProps,
35
FocusableElement,
46
HideErrorPropType,
7+
IconsHorizontalPropType,
58
IdPropType,
69
InputNumberAPI,
710
InputNumberStates,
811
InputTypeOnDefault,
912
InputTypeOnOff,
1013
Iso8601,
11-
KoliBriHorizontalIcons,
1214
LabelWithExpertSlotPropType,
1315
MsgPropType,
1416
NamePropType,
@@ -19,15 +21,13 @@ import type {
1921
TooltipAlignPropType,
2022
} from '../../schema';
2123
import { buildBadgeTextString, showExpertSlot } from '../../schema';
22-
import type { JSX } from '@stencil/core';
23-
import { Component, Element, Fragment, h, Host, Method, Prop, State, Watch } from '@stencil/core';
2424

25+
import { KolInputTag } from '../../core/component-names';
2526
import { nonce } from '../../utils/dev.utils';
2627
import { propagateSubmitEventToForm } from '../form/controller';
2728
import { getRenderStates } from '../input/controller';
2829
import { InternalUnderlinedBadgeText } from '../span/InternalUnderlinedBadgeText';
2930
import { InputNumberController } from './controller';
30-
import { KolInputTag } from '../../core/component-names';
3131

3232
/**
3333
* @slot - Die Beschriftung des Eingabefeldes.
@@ -217,7 +217,7 @@ export class KolInputNumber implements InputNumberAPI, FocusableElement {
217217
/**
218218
* Defines the icon classnames (e.g. `_icons="fa-solid fa-user"`).
219219
*/
220-
@Prop() public _icons?: Stringified<KoliBriHorizontalIcons>;
220+
@Prop() public _icons?: IconsHorizontalPropType;
221221

222222
/**
223223
* Defines the internal ID of the primary component element.
@@ -381,7 +381,7 @@ export class KolInputNumber implements InputNumberAPI, FocusableElement {
381381
}
382382

383383
@Watch('_icons')
384-
public validateIcons(value?: Stringified<KoliBriHorizontalIcons>): void {
384+
public validateIcons(value?: IconsHorizontalPropType): void {
385385
this.controller.validateIcons(value);
386386
}
387387

0 commit comments

Comments
 (0)