@limetech/lime-elements 37.12.1 → 37.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/dist/cjs/{checkbox.template-e7aa89b5.js → checkbox.template-02070306.js} +15 -2
- package/dist/cjs/checkbox.template-02070306.js.map +1 -0
- package/dist/cjs/dom-ee8ee17d.js +244 -0
- package/dist/cjs/dom-ee8ee17d.js.map +1 -0
- package/dist/cjs/lime-elements.cjs.js +1 -1
- package/dist/cjs/limel-breadcrumbs_3.cjs.entry.js +1 -1
- package/dist/cjs/limel-breadcrumbs_3.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-checkbox.cjs.entry.js +7 -3
- package/dist/cjs/limel-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/{limel-helper-line.cjs.entry.js → limel-dynamic-label_2.cjs.entry.js} +47 -1
- package/dist/cjs/limel-dynamic-label_2.cjs.entry.js.map +1 -0
- package/dist/cjs/limel-flatpickr-adapter.cjs.entry.js +5 -1
- package/dist/cjs/limel-flatpickr-adapter.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-form.cjs.entry.js +6 -3
- package/dist/cjs/limel-form.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-input-field_3.cjs.entry.js +6 -212
- package/dist/cjs/limel-input-field_3.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-picker.cjs.entry.js +23 -237
- package/dist/cjs/limel-picker.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-switch.cjs.entry.js +24 -7
- package/dist/cjs/limel-switch.cjs.entry.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/checkbox/checkbox.css +0 -24
- package/dist/collection/components/checkbox/checkbox.js +33 -1
- package/dist/collection/components/checkbox/checkbox.js.map +1 -1
- package/dist/collection/components/checkbox/checkbox.template.js +14 -1
- package/dist/collection/components/checkbox/checkbox.template.js.map +1 -1
- package/dist/collection/components/dynamic-label/dynamic-label.css +84 -0
- package/dist/collection/components/dynamic-label/dynamic-label.js +142 -0
- package/dist/collection/components/dynamic-label/dynamic-label.js.map +1 -0
- package/dist/collection/components/dynamic-label/label.types.js +2 -0
- package/dist/collection/components/dynamic-label/label.types.js.map +1 -0
- package/dist/collection/components/form/widgets/checkbox.js +6 -3
- package/dist/collection/components/form/widgets/checkbox.js.map +1 -1
- package/dist/collection/components/list/list.css +0 -48
- package/dist/collection/components/menu-list/menu-list.css +0 -52
- package/dist/collection/components/picker/picker.js +18 -21
- package/dist/collection/components/picker/picker.js.map +1 -1
- package/dist/collection/components/switch/switch.css +0 -14
- package/dist/collection/components/switch/switch.js +52 -7
- package/dist/collection/components/switch/switch.js.map +1 -1
- package/dist/collection/interface.js +2 -0
- package/dist/collection/interface.js.map +1 -1
- package/dist/esm/{checkbox.template-50268c7d.js → checkbox.template-10fda4a9.js} +15 -2
- package/dist/esm/checkbox.template-10fda4a9.js.map +1 -0
- package/dist/esm/dom-ae531ebc.js +241 -0
- package/dist/esm/dom-ae531ebc.js.map +1 -0
- package/dist/esm/lime-elements.js +1 -1
- package/dist/esm/limel-breadcrumbs_3.entry.js +1 -1
- package/dist/esm/limel-breadcrumbs_3.entry.js.map +1 -1
- package/dist/esm/limel-checkbox.entry.js +7 -3
- package/dist/esm/limel-checkbox.entry.js.map +1 -1
- package/dist/esm/{limel-helper-line.entry.js → limel-dynamic-label_2.entry.js} +47 -2
- package/dist/esm/limel-dynamic-label_2.entry.js.map +1 -0
- package/dist/esm/limel-flatpickr-adapter.entry.js +5 -1
- package/dist/esm/limel-flatpickr-adapter.entry.js.map +1 -1
- package/dist/esm/limel-form.entry.js +6 -3
- package/dist/esm/limel-form.entry.js.map +1 -1
- package/dist/esm/limel-input-field_3.entry.js +5 -211
- package/dist/esm/limel-input-field_3.entry.js.map +1 -1
- package/dist/esm/limel-picker.entry.js +23 -237
- package/dist/esm/limel-picker.entry.js.map +1 -1
- package/dist/esm/limel-switch.entry.js +25 -8
- package/dist/esm/limel-switch.entry.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/lime-elements/lime-elements.esm.js +1 -1
- package/dist/lime-elements/lime-elements.esm.js.map +1 -1
- package/dist/lime-elements/{p-e5ca6c0c.entry.js → p-20d26cdf.entry.js} +6 -6
- package/dist/lime-elements/p-20d26cdf.entry.js.map +1 -0
- package/dist/lime-elements/p-714d6937.js +2 -0
- package/dist/lime-elements/p-714d6937.js.map +1 -0
- package/dist/lime-elements/{p-fb44db4d.entry.js → p-77a07224.entry.js} +2 -2
- package/dist/lime-elements/{p-fb44db4d.entry.js.map → p-77a07224.entry.js.map} +1 -1
- package/dist/lime-elements/{p-1b4d3901.entry.js → p-932185ef.entry.js} +2 -2
- package/dist/lime-elements/{p-1b4d3901.entry.js.map → p-932185ef.entry.js.map} +1 -1
- package/dist/lime-elements/p-9468b1b8.entry.js +2 -0
- package/dist/lime-elements/p-9468b1b8.entry.js.map +1 -0
- package/dist/lime-elements/p-9fd032ca.entry.js +2 -0
- package/dist/lime-elements/p-9fd032ca.entry.js.map +1 -0
- package/dist/lime-elements/p-a98c3ea7.entry.js +2 -0
- package/dist/lime-elements/p-a98c3ea7.entry.js.map +1 -0
- package/dist/lime-elements/{p-386d1c5a.entry.js → p-aa8befcd.entry.js} +7 -7
- package/dist/lime-elements/p-aa8befcd.entry.js.map +1 -0
- package/dist/lime-elements/p-d35e5b2f.js +2 -0
- package/dist/lime-elements/p-d35e5b2f.js.map +1 -0
- package/dist/lime-elements/p-ffe1fc16.entry.js +68 -0
- package/dist/lime-elements/{p-885274d9.entry.js.map → p-ffe1fc16.entry.js.map} +1 -1
- package/dist/types/components/checkbox/checkbox.d.ts +8 -0
- package/dist/types/components/checkbox/checkbox.template.d.ts +2 -0
- package/dist/types/components/dynamic-label/dynamic-label.d.ts +43 -0
- package/dist/types/components/dynamic-label/label.types.d.ts +20 -0
- package/dist/types/components/picker/picker.d.ts +1 -1
- package/dist/types/components/switch/switch.d.ts +9 -1
- package/dist/types/components.d.ts +123 -0
- package/dist/types/interface.d.ts +3 -1
- package/package.json +9 -10
- package/dist/cjs/checkbox.template-e7aa89b5.js.map +0 -1
- package/dist/cjs/dom-81eaa633.js +0 -34
- package/dist/cjs/dom-81eaa633.js.map +0 -1
- package/dist/cjs/limel-helper-line.cjs.entry.js.map +0 -1
- package/dist/esm/checkbox.template-50268c7d.js.map +0 -1
- package/dist/esm/dom-0b0170a0.js +0 -32
- package/dist/esm/dom-0b0170a0.js.map +0 -1
- package/dist/esm/limel-helper-line.entry.js.map +0 -1
- package/dist/lime-elements/p-042e5620.entry.js +0 -16
- package/dist/lime-elements/p-042e5620.entry.js.map +0 -1
- package/dist/lime-elements/p-27330d1d.entry.js +0 -2
- package/dist/lime-elements/p-27330d1d.entry.js.map +0 -1
- package/dist/lime-elements/p-386d1c5a.entry.js.map +0 -1
- package/dist/lime-elements/p-4015e8e9.entry.js +0 -2
- package/dist/lime-elements/p-4015e8e9.entry.js.map +0 -1
- package/dist/lime-elements/p-5e7b7b03.js +0 -2
- package/dist/lime-elements/p-5e7b7b03.js.map +0 -1
- package/dist/lime-elements/p-61aa37de.js +0 -2
- package/dist/lime-elements/p-61aa37de.js.map +0 -1
- package/dist/lime-elements/p-885274d9.entry.js +0 -68
- package/dist/lime-elements/p-e5ca6c0c.entry.js.map +0 -1
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Label, LabelValue } from './label.types';
|
|
2
|
+
/**
|
|
3
|
+
* This components displays a different label depending on the current given
|
|
4
|
+
* value. A label can consist of a text and an optional icon. If no matching
|
|
5
|
+
* label is found among the given `labels`, the `defaultLabel` will be displayed.
|
|
6
|
+
*
|
|
7
|
+
* One use case of the component is to enhance the visualization of a `boolean`
|
|
8
|
+
* field like a checkbox or switch in a `readonly` state.
|
|
9
|
+
*
|
|
10
|
+
* The reason we offer this component is that the default styling
|
|
11
|
+
* of the Checkbox or Toggle switch in the `readonly` state may not always
|
|
12
|
+
* provide the best way of _visualizing information_, potentially leading to
|
|
13
|
+
* confusion and negatively affecting the end-users' experience.
|
|
14
|
+
*
|
|
15
|
+
* @exampleComponent limel-example-dynamic-label
|
|
16
|
+
* @exampleComponent limel-example-dynamic-label-readonly-boolean
|
|
17
|
+
* @beta
|
|
18
|
+
*/
|
|
19
|
+
export declare class DynamicLabel {
|
|
20
|
+
/**
|
|
21
|
+
* The current value of the component which is used to match with the given
|
|
22
|
+
* `labels` to determine what label to display.
|
|
23
|
+
*
|
|
24
|
+
* If not matching label is found, the `defaultLabel` is displayed.
|
|
25
|
+
*/
|
|
26
|
+
value: LabelValue;
|
|
27
|
+
/**
|
|
28
|
+
* The label to display when no matching value is found in the `labels`
|
|
29
|
+
* array. This is a fallback label that ensures there's always a label
|
|
30
|
+
* displayed for the component.
|
|
31
|
+
*/
|
|
32
|
+
defaultLabel: Omit<Label, 'value'>;
|
|
33
|
+
/**
|
|
34
|
+
* A list of available labels. Each label has a corresponding value that
|
|
35
|
+
* will be matched with the current `value` of the component to determine
|
|
36
|
+
* what label to display.
|
|
37
|
+
*/
|
|
38
|
+
labels: Label[];
|
|
39
|
+
render(): any[];
|
|
40
|
+
private renderIcon;
|
|
41
|
+
private renderLabel;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=dynamic-label.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Icon } from '../../interface';
|
|
2
|
+
export type LabelValue = string | number | boolean | null | undefined;
|
|
3
|
+
/**
|
|
4
|
+
* @beta
|
|
5
|
+
*/
|
|
6
|
+
export interface Label<T = LabelValue> {
|
|
7
|
+
/**
|
|
8
|
+
* The value of the label
|
|
9
|
+
*/
|
|
10
|
+
value: T;
|
|
11
|
+
/**
|
|
12
|
+
* Text to display when the label is active
|
|
13
|
+
*/
|
|
14
|
+
text?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Icon to display when the label is active
|
|
17
|
+
*/
|
|
18
|
+
icon?: string | Icon;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=label.types.d.ts.map
|
|
@@ -121,7 +121,6 @@ export declare class Picker {
|
|
|
121
121
|
componentWillUpdate(): Promise<void>;
|
|
122
122
|
render(): any[];
|
|
123
123
|
protected onChangeValue(): void;
|
|
124
|
-
protected createDebouncedSearcher(newValue: Searcher): void;
|
|
125
124
|
private renderDelimiter;
|
|
126
125
|
private getValueId;
|
|
127
126
|
private createChips;
|
|
@@ -159,6 +158,7 @@ export declare class Picker {
|
|
|
159
158
|
* @param event - event
|
|
160
159
|
*/
|
|
161
160
|
private handleTextInput;
|
|
161
|
+
private search;
|
|
162
162
|
/**
|
|
163
163
|
* Change handler for the list
|
|
164
164
|
*
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Label } from '../dynamic-label/label.types';
|
|
1
2
|
/**
|
|
2
3
|
* The Switch component is a fundamental element in UI design that serves as a toggle switch
|
|
3
4
|
* to control the state of a specific setting or option in an application or website.
|
|
@@ -14,6 +15,7 @@
|
|
|
14
15
|
*
|
|
15
16
|
* @exampleComponent limel-example-switch
|
|
16
17
|
* @exampleComponent limel-example-switch-helper-text
|
|
18
|
+
* @exampleComponent limel-example-switch-readonly
|
|
17
19
|
*/
|
|
18
20
|
export declare class Switch {
|
|
19
21
|
/**
|
|
@@ -45,6 +47,12 @@ export declare class Switch {
|
|
|
45
47
|
* Optional helper text to display below the switch
|
|
46
48
|
*/
|
|
47
49
|
helperText: string;
|
|
50
|
+
/**
|
|
51
|
+
* The labels to use to clarify what kind of data is being visualized,
|
|
52
|
+
* when the component is `readonly`.
|
|
53
|
+
* @beta
|
|
54
|
+
*/
|
|
55
|
+
readonlyLabels?: Array<Label<boolean>>;
|
|
48
56
|
/**
|
|
49
57
|
* Emitted when the value has changed
|
|
50
58
|
*/
|
|
@@ -58,7 +66,7 @@ export declare class Switch {
|
|
|
58
66
|
componentDidLoad(): void;
|
|
59
67
|
private initialize;
|
|
60
68
|
disconnectedCallback(): void;
|
|
61
|
-
render(): any;
|
|
69
|
+
render(): any[];
|
|
62
70
|
protected valueWatcher(newValue: boolean): void;
|
|
63
71
|
private renderHelperLine;
|
|
64
72
|
private hasHelperText;
|
|
@@ -12,6 +12,7 @@ import { BreadcrumbsItem } from "./components/breadcrumbs/breadcrumbs.types";
|
|
|
12
12
|
import { Button } from "./components/button/button.types";
|
|
13
13
|
import { CalloutType } from "./components/callout/callout.types";
|
|
14
14
|
import { DateType, Languages } from "./components/date-picker/date.types";
|
|
15
|
+
import { Label, LabelValue } from "./components/dynamic-label/label.types";
|
|
15
16
|
import { Icon } from "./global/shared-types/icon.types";
|
|
16
17
|
import { Link } from "./global/shared-types/link.types";
|
|
17
18
|
import { Chip, ChipType } from "./components/chip-set/chip.types";
|
|
@@ -46,6 +47,7 @@ export { BreadcrumbsItem } from "./components/breadcrumbs/breadcrumbs.types";
|
|
|
46
47
|
export { Button } from "./components/button/button.types";
|
|
47
48
|
export { CalloutType } from "./components/callout/callout.types";
|
|
48
49
|
export { DateType, Languages } from "./components/date-picker/date.types";
|
|
50
|
+
export { Label, LabelValue } from "./components/dynamic-label/label.types";
|
|
49
51
|
export { Icon } from "./global/shared-types/icon.types";
|
|
50
52
|
export { Link } from "./global/shared-types/link.types";
|
|
51
53
|
export { Chip, ChipType } from "./components/chip-set/chip.types";
|
|
@@ -348,6 +350,7 @@ export namespace Components {
|
|
|
348
350
|
* [Switch vs. Checkbox](/#/DesignGuidelines/switch-vs-checkbox.md/).
|
|
349
351
|
* @exampleComponent limel-example-checkbox
|
|
350
352
|
* @exampleComponent limel-example-checkbox-helper-text
|
|
353
|
+
* @exampleComponent limel-example-checkbox-readonly
|
|
351
354
|
*/
|
|
352
355
|
interface LimelCheckbox {
|
|
353
356
|
/**
|
|
@@ -378,6 +381,11 @@ export namespace Components {
|
|
|
378
381
|
* Disables the checkbox when `true`. This visualizes the checkbox slightly differently. But shows no visual sign indicating that the checkbox is disabled or can ever become interactable.
|
|
379
382
|
*/
|
|
380
383
|
"readonly": boolean;
|
|
384
|
+
/**
|
|
385
|
+
* The labels to use to clarify what kind of data is being visualized, when the component is `readonly`.
|
|
386
|
+
* @beta
|
|
387
|
+
*/
|
|
388
|
+
"readonlyLabels"?: Array<Label<boolean>>;
|
|
381
389
|
/**
|
|
382
390
|
* Set to `true` to indicate that the checkbox must be checked.
|
|
383
391
|
*/
|
|
@@ -932,6 +940,34 @@ export namespace Components {
|
|
|
932
940
|
*/
|
|
933
941
|
"useMobileLayout"?: boolean;
|
|
934
942
|
}
|
|
943
|
+
/**
|
|
944
|
+
* This components displays a different label depending on the current given
|
|
945
|
+
* value. A label can consist of a text and an optional icon. If no matching
|
|
946
|
+
* label is found among the given `labels`, the `defaultLabel` will be displayed.
|
|
947
|
+
* One use case of the component is to enhance the visualization of a `boolean`
|
|
948
|
+
* field like a checkbox or switch in a `readonly` state.
|
|
949
|
+
* The reason we offer this component is that the default styling
|
|
950
|
+
* of the Checkbox or Toggle switch in the `readonly` state may not always
|
|
951
|
+
* provide the best way of _visualizing information_, potentially leading to
|
|
952
|
+
* confusion and negatively affecting the end-users' experience.
|
|
953
|
+
* @exampleComponent limel-example-dynamic-label
|
|
954
|
+
* @exampleComponent limel-example-dynamic-label-readonly-boolean
|
|
955
|
+
* @beta
|
|
956
|
+
*/
|
|
957
|
+
interface LimelDynamicLabel {
|
|
958
|
+
/**
|
|
959
|
+
* The label to display when no matching value is found in the `labels` array. This is a fallback label that ensures there's always a label displayed for the component.
|
|
960
|
+
*/
|
|
961
|
+
"defaultLabel": Omit<Label, 'value'>;
|
|
962
|
+
/**
|
|
963
|
+
* A list of available labels. Each label has a corresponding value that will be matched with the current `value` of the component to determine what label to display.
|
|
964
|
+
*/
|
|
965
|
+
"labels": Label[];
|
|
966
|
+
/**
|
|
967
|
+
* The current value of the component which is used to match with the given `labels` to determine what label to display. If not matching label is found, the `defaultLabel` is displayed.
|
|
968
|
+
*/
|
|
969
|
+
"value": LabelValue;
|
|
970
|
+
}
|
|
935
971
|
/**
|
|
936
972
|
* This component lets end-users select a *single* file from their device
|
|
937
973
|
* storage. Regardless of the user's device or operating system, this component
|
|
@@ -2263,6 +2299,7 @@ export namespace Components {
|
|
|
2263
2299
|
* [Switch vs. Checkbox](/#/DesignGuidelines/switch-vs-checkbox.md/).
|
|
2264
2300
|
* @exampleComponent limel-example-switch
|
|
2265
2301
|
* @exampleComponent limel-example-switch-helper-text
|
|
2302
|
+
* @exampleComponent limel-example-switch-readonly
|
|
2266
2303
|
*/
|
|
2267
2304
|
interface LimelSwitch {
|
|
2268
2305
|
/**
|
|
@@ -2285,6 +2322,11 @@ export namespace Components {
|
|
|
2285
2322
|
* Disables the switch when `true`. This visualizes the switch slightly differently. But shows no visual sign indicating that the switch is disabled or can ever become interactable.
|
|
2286
2323
|
*/
|
|
2287
2324
|
"readonly": boolean;
|
|
2325
|
+
/**
|
|
2326
|
+
* The labels to use to clarify what kind of data is being visualized, when the component is `readonly`.
|
|
2327
|
+
* @beta
|
|
2328
|
+
*/
|
|
2329
|
+
"readonlyLabels"?: Array<Label<boolean>>;
|
|
2288
2330
|
/**
|
|
2289
2331
|
* The value of the switch
|
|
2290
2332
|
*/
|
|
@@ -2849,6 +2891,7 @@ declare global {
|
|
|
2849
2891
|
* [Switch vs. Checkbox](/#/DesignGuidelines/switch-vs-checkbox.md/).
|
|
2850
2892
|
* @exampleComponent limel-example-checkbox
|
|
2851
2893
|
* @exampleComponent limel-example-checkbox-helper-text
|
|
2894
|
+
* @exampleComponent limel-example-checkbox-readonly
|
|
2852
2895
|
*/
|
|
2853
2896
|
interface HTMLLimelCheckboxElement extends Components.LimelCheckbox, HTMLStencilElement {
|
|
2854
2897
|
}
|
|
@@ -3108,6 +3151,26 @@ declare global {
|
|
|
3108
3151
|
prototype: HTMLLimelDockButtonElement;
|
|
3109
3152
|
new (): HTMLLimelDockButtonElement;
|
|
3110
3153
|
};
|
|
3154
|
+
/**
|
|
3155
|
+
* This components displays a different label depending on the current given
|
|
3156
|
+
* value. A label can consist of a text and an optional icon. If no matching
|
|
3157
|
+
* label is found among the given `labels`, the `defaultLabel` will be displayed.
|
|
3158
|
+
* One use case of the component is to enhance the visualization of a `boolean`
|
|
3159
|
+
* field like a checkbox or switch in a `readonly` state.
|
|
3160
|
+
* The reason we offer this component is that the default styling
|
|
3161
|
+
* of the Checkbox or Toggle switch in the `readonly` state may not always
|
|
3162
|
+
* provide the best way of _visualizing information_, potentially leading to
|
|
3163
|
+
* confusion and negatively affecting the end-users' experience.
|
|
3164
|
+
* @exampleComponent limel-example-dynamic-label
|
|
3165
|
+
* @exampleComponent limel-example-dynamic-label-readonly-boolean
|
|
3166
|
+
* @beta
|
|
3167
|
+
*/
|
|
3168
|
+
interface HTMLLimelDynamicLabelElement extends Components.LimelDynamicLabel, HTMLStencilElement {
|
|
3169
|
+
}
|
|
3170
|
+
var HTMLLimelDynamicLabelElement: {
|
|
3171
|
+
prototype: HTMLLimelDynamicLabelElement;
|
|
3172
|
+
new (): HTMLLimelDynamicLabelElement;
|
|
3173
|
+
};
|
|
3111
3174
|
/**
|
|
3112
3175
|
* This component lets end-users select a *single* file from their device
|
|
3113
3176
|
* storage. Regardless of the user's device or operating system, this component
|
|
@@ -3794,6 +3857,7 @@ declare global {
|
|
|
3794
3857
|
* [Switch vs. Checkbox](/#/DesignGuidelines/switch-vs-checkbox.md/).
|
|
3795
3858
|
* @exampleComponent limel-example-switch
|
|
3796
3859
|
* @exampleComponent limel-example-switch-helper-text
|
|
3860
|
+
* @exampleComponent limel-example-switch-readonly
|
|
3797
3861
|
*/
|
|
3798
3862
|
interface HTMLLimelSwitchElement extends Components.LimelSwitch, HTMLStencilElement {
|
|
3799
3863
|
}
|
|
@@ -3947,6 +4011,7 @@ declare global {
|
|
|
3947
4011
|
"limel-dialog": HTMLLimelDialogElement;
|
|
3948
4012
|
"limel-dock": HTMLLimelDockElement;
|
|
3949
4013
|
"limel-dock-button": HTMLLimelDockButtonElement;
|
|
4014
|
+
"limel-dynamic-label": HTMLLimelDynamicLabelElement;
|
|
3950
4015
|
"limel-file": HTMLLimelFileElement;
|
|
3951
4016
|
"limel-file-dropzone": HTMLLimelFileDropzoneElement;
|
|
3952
4017
|
"limel-file-input": HTMLLimelFileInputElement;
|
|
@@ -4279,6 +4344,7 @@ declare namespace LocalJSX {
|
|
|
4279
4344
|
* [Switch vs. Checkbox](/#/DesignGuidelines/switch-vs-checkbox.md/).
|
|
4280
4345
|
* @exampleComponent limel-example-checkbox
|
|
4281
4346
|
* @exampleComponent limel-example-checkbox-helper-text
|
|
4347
|
+
* @exampleComponent limel-example-checkbox-readonly
|
|
4282
4348
|
*/
|
|
4283
4349
|
interface LimelCheckbox {
|
|
4284
4350
|
/**
|
|
@@ -4313,6 +4379,11 @@ declare namespace LocalJSX {
|
|
|
4313
4379
|
* Disables the checkbox when `true`. This visualizes the checkbox slightly differently. But shows no visual sign indicating that the checkbox is disabled or can ever become interactable.
|
|
4314
4380
|
*/
|
|
4315
4381
|
"readonly"?: boolean;
|
|
4382
|
+
/**
|
|
4383
|
+
* The labels to use to clarify what kind of data is being visualized, when the component is `readonly`.
|
|
4384
|
+
* @beta
|
|
4385
|
+
*/
|
|
4386
|
+
"readonlyLabels"?: Array<Label<boolean>>;
|
|
4316
4387
|
/**
|
|
4317
4388
|
* Set to `true` to indicate that the checkbox must be checked.
|
|
4318
4389
|
*/
|
|
@@ -4939,6 +5010,34 @@ declare namespace LocalJSX {
|
|
|
4939
5010
|
*/
|
|
4940
5011
|
"useMobileLayout"?: boolean;
|
|
4941
5012
|
}
|
|
5013
|
+
/**
|
|
5014
|
+
* This components displays a different label depending on the current given
|
|
5015
|
+
* value. A label can consist of a text and an optional icon. If no matching
|
|
5016
|
+
* label is found among the given `labels`, the `defaultLabel` will be displayed.
|
|
5017
|
+
* One use case of the component is to enhance the visualization of a `boolean`
|
|
5018
|
+
* field like a checkbox or switch in a `readonly` state.
|
|
5019
|
+
* The reason we offer this component is that the default styling
|
|
5020
|
+
* of the Checkbox or Toggle switch in the `readonly` state may not always
|
|
5021
|
+
* provide the best way of _visualizing information_, potentially leading to
|
|
5022
|
+
* confusion and negatively affecting the end-users' experience.
|
|
5023
|
+
* @exampleComponent limel-example-dynamic-label
|
|
5024
|
+
* @exampleComponent limel-example-dynamic-label-readonly-boolean
|
|
5025
|
+
* @beta
|
|
5026
|
+
*/
|
|
5027
|
+
interface LimelDynamicLabel {
|
|
5028
|
+
/**
|
|
5029
|
+
* The label to display when no matching value is found in the `labels` array. This is a fallback label that ensures there's always a label displayed for the component.
|
|
5030
|
+
*/
|
|
5031
|
+
"defaultLabel"?: Omit<Label, 'value'>;
|
|
5032
|
+
/**
|
|
5033
|
+
* A list of available labels. Each label has a corresponding value that will be matched with the current `value` of the component to determine what label to display.
|
|
5034
|
+
*/
|
|
5035
|
+
"labels"?: Label[];
|
|
5036
|
+
/**
|
|
5037
|
+
* The current value of the component which is used to match with the given `labels` to determine what label to display. If not matching label is found, the `defaultLabel` is displayed.
|
|
5038
|
+
*/
|
|
5039
|
+
"value"?: LabelValue;
|
|
5040
|
+
}
|
|
4942
5041
|
/**
|
|
4943
5042
|
* This component lets end-users select a *single* file from their device
|
|
4944
5043
|
* storage. Regardless of the user's device or operating system, this component
|
|
@@ -6375,6 +6474,7 @@ declare namespace LocalJSX {
|
|
|
6375
6474
|
* [Switch vs. Checkbox](/#/DesignGuidelines/switch-vs-checkbox.md/).
|
|
6376
6475
|
* @exampleComponent limel-example-switch
|
|
6377
6476
|
* @exampleComponent limel-example-switch-helper-text
|
|
6477
|
+
* @exampleComponent limel-example-switch-readonly
|
|
6378
6478
|
*/
|
|
6379
6479
|
interface LimelSwitch {
|
|
6380
6480
|
/**
|
|
@@ -6401,6 +6501,11 @@ declare namespace LocalJSX {
|
|
|
6401
6501
|
* Disables the switch when `true`. This visualizes the switch slightly differently. But shows no visual sign indicating that the switch is disabled or can ever become interactable.
|
|
6402
6502
|
*/
|
|
6403
6503
|
"readonly"?: boolean;
|
|
6504
|
+
/**
|
|
6505
|
+
* The labels to use to clarify what kind of data is being visualized, when the component is `readonly`.
|
|
6506
|
+
* @beta
|
|
6507
|
+
*/
|
|
6508
|
+
"readonlyLabels"?: Array<Label<boolean>>;
|
|
6404
6509
|
/**
|
|
6405
6510
|
* The value of the switch
|
|
6406
6511
|
*/
|
|
@@ -6668,6 +6773,7 @@ declare namespace LocalJSX {
|
|
|
6668
6773
|
"limel-dialog": LimelDialog;
|
|
6669
6774
|
"limel-dock": LimelDock;
|
|
6670
6775
|
"limel-dock-button": LimelDockButton;
|
|
6776
|
+
"limel-dynamic-label": LimelDynamicLabel;
|
|
6671
6777
|
"limel-file": LimelFile;
|
|
6672
6778
|
"limel-file-dropzone": LimelFileDropzone;
|
|
6673
6779
|
"limel-file-input": LimelFileInput;
|
|
@@ -6867,6 +6973,7 @@ declare module "@stencil/core" {
|
|
|
6867
6973
|
* [Switch vs. Checkbox](/#/DesignGuidelines/switch-vs-checkbox.md/).
|
|
6868
6974
|
* @exampleComponent limel-example-checkbox
|
|
6869
6975
|
* @exampleComponent limel-example-checkbox-helper-text
|
|
6976
|
+
* @exampleComponent limel-example-checkbox-readonly
|
|
6870
6977
|
*/
|
|
6871
6978
|
"limel-checkbox": LocalJSX.LimelCheckbox & JSXBase.HTMLAttributes<HTMLLimelCheckboxElement>;
|
|
6872
6979
|
/**
|
|
@@ -7061,6 +7168,21 @@ declare module "@stencil/core" {
|
|
|
7061
7168
|
* @private
|
|
7062
7169
|
*/
|
|
7063
7170
|
"limel-dock-button": LocalJSX.LimelDockButton & JSXBase.HTMLAttributes<HTMLLimelDockButtonElement>;
|
|
7171
|
+
/**
|
|
7172
|
+
* This components displays a different label depending on the current given
|
|
7173
|
+
* value. A label can consist of a text and an optional icon. If no matching
|
|
7174
|
+
* label is found among the given `labels`, the `defaultLabel` will be displayed.
|
|
7175
|
+
* One use case of the component is to enhance the visualization of a `boolean`
|
|
7176
|
+
* field like a checkbox or switch in a `readonly` state.
|
|
7177
|
+
* The reason we offer this component is that the default styling
|
|
7178
|
+
* of the Checkbox or Toggle switch in the `readonly` state may not always
|
|
7179
|
+
* provide the best way of _visualizing information_, potentially leading to
|
|
7180
|
+
* confusion and negatively affecting the end-users' experience.
|
|
7181
|
+
* @exampleComponent limel-example-dynamic-label
|
|
7182
|
+
* @exampleComponent limel-example-dynamic-label-readonly-boolean
|
|
7183
|
+
* @beta
|
|
7184
|
+
*/
|
|
7185
|
+
"limel-dynamic-label": LocalJSX.LimelDynamicLabel & JSXBase.HTMLAttributes<HTMLLimelDynamicLabelElement>;
|
|
7064
7186
|
/**
|
|
7065
7187
|
* This component lets end-users select a *single* file from their device
|
|
7066
7188
|
* storage. Regardless of the user's device or operating system, this component
|
|
@@ -7577,6 +7699,7 @@ declare module "@stencil/core" {
|
|
|
7577
7699
|
* [Switch vs. Checkbox](/#/DesignGuidelines/switch-vs-checkbox.md/).
|
|
7578
7700
|
* @exampleComponent limel-example-switch
|
|
7579
7701
|
* @exampleComponent limel-example-switch-helper-text
|
|
7702
|
+
* @exampleComponent limel-example-switch-readonly
|
|
7580
7703
|
*/
|
|
7581
7704
|
"limel-switch": LocalJSX.LimelSwitch & JSXBase.HTMLAttributes<HTMLLimelSwitchElement>;
|
|
7582
7705
|
/**
|
|
@@ -16,7 +16,8 @@ export * from './components/help/help.types';
|
|
|
16
16
|
export * from './components/icon/icon.types';
|
|
17
17
|
export * from './components/info-tile/info-tile.types';
|
|
18
18
|
export * from './components/input-field/input-field.types';
|
|
19
|
-
export { ListComponent } from './components/list/list-item.types';
|
|
19
|
+
export { ListComponent, ListSeparator, } from './components/list/list-item.types';
|
|
20
|
+
export * from './components/dynamic-label/label.types';
|
|
20
21
|
export * from './components/list/list.types';
|
|
21
22
|
export * from './components/menu/menu.types';
|
|
22
23
|
export * from './components/menu-list/menu-list.types';
|
|
@@ -28,4 +29,5 @@ export * from './components/spinner/spinner.types';
|
|
|
28
29
|
export * from './components/tab-panel/tab-panel.types';
|
|
29
30
|
export * from './components/table/table.types';
|
|
30
31
|
export * from './global/shared-types/separator.types';
|
|
32
|
+
export * from './global/shared-types/icon.types';
|
|
31
33
|
//# sourceMappingURL=interface.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@limetech/lime-elements",
|
|
3
|
-
"version": "37.
|
|
3
|
+
"version": "37.13.0",
|
|
4
4
|
"description": "Lime Elements",
|
|
5
5
|
"author": "Lime Technologies",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -49,17 +49,16 @@
|
|
|
49
49
|
"@rjsf/core": "^2.4.2",
|
|
50
50
|
"@rollup/plugin-node-resolve": "^13.3.0",
|
|
51
51
|
"@stencil/core": "^3.4.1",
|
|
52
|
-
"@stencil/sass": "^3.0.
|
|
52
|
+
"@stencil/sass": "^3.0.11",
|
|
53
53
|
"@types/codemirror": "^5.60.2",
|
|
54
54
|
"@types/html-escaper": "^3.0.2",
|
|
55
55
|
"@types/jest": "^27.4.0",
|
|
56
56
|
"@types/lodash-es": "^4.17.12",
|
|
57
|
-
"@types/react": "^18.2.
|
|
58
|
-
"@types/react-dom": "^18.2.
|
|
57
|
+
"@types/react": "^18.2.73",
|
|
58
|
+
"@types/react-dom": "^18.2.23",
|
|
59
59
|
"@types/tabulator-tables": "^4.9.4",
|
|
60
|
-
"@typescript-eslint/eslint-plugin": "^7.
|
|
61
|
-
"@typescript-eslint/parser": "^7.
|
|
62
|
-
"awesome-debounce-promise": "^2.1.0",
|
|
60
|
+
"@typescript-eslint/eslint-plugin": "^7.4.0",
|
|
61
|
+
"@typescript-eslint/parser": "^7.4.0",
|
|
63
62
|
"codemirror": "^5.65.9",
|
|
64
63
|
"cross-env": "^7.0.3",
|
|
65
64
|
"dayjs": "^1.11.10",
|
|
@@ -69,15 +68,15 @@
|
|
|
69
68
|
"eslint-plugin-prefer-arrow": "^1.2.3",
|
|
70
69
|
"eslint-plugin-prettier": "^5.1.3",
|
|
71
70
|
"eslint-plugin-react": "^7.34.1",
|
|
72
|
-
"eslint-plugin-sonarjs": "^0.
|
|
71
|
+
"eslint-plugin-sonarjs": "^0.25.0",
|
|
73
72
|
"eslint-plugin-tsdoc": "^0.2.17",
|
|
74
73
|
"flatpickr": "^4.6.13",
|
|
75
74
|
"html-escaper": "^3.0.3",
|
|
76
75
|
"jest": "^27.5.1",
|
|
77
76
|
"jest-cli": "^27.5.1",
|
|
78
77
|
"jsonlint-mod": "^1.7.6",
|
|
79
|
-
"jsx-dom": "^8.1.
|
|
80
|
-
"kompendium": "^0.14.
|
|
78
|
+
"jsx-dom": "^8.1.4",
|
|
79
|
+
"kompendium": "^0.14.2",
|
|
81
80
|
"lodash-es": "^4.17.21",
|
|
82
81
|
"material-components-web": "^13.0.0",
|
|
83
82
|
"moment": "^2.30.1",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"file":"checkbox.template-e7aa89b5.js","mappings":";;;;MAgBa,gBAAgB,GAA+C,CACxE,KAAK;EAEL,MAAM,UAAU,GAAG,EAAE,CAAC;EACtB,IAAI,KAAK,CAAC,aAAa,EAAE;IACrB,UAAU,CAAC,oBAAoB,CAAC,GAAG,MAAM,CAAC;GAC7C;EAED,OAAO;IACHA,iBAAK,KAAK,EAAC,iBAAiB;MACxBA,iBACI,KAAK,EAAE;UACH,cAAc,EAAE,IAAI;UACpB,uBAAuB,EAAE,KAAK,CAAC,OAAO;UACtC,wBAAwB,EAAE,KAAK,CAAC,QAAQ;UACxC,wBAAwB,EAAE,KAAK,CAAC,QAAQ;UACxC,6BAA6B,EAAE,KAAK,CAAC,aAAa;UAClD,yBAAyB,EAAE,KAAK,CAAC,QAAQ;SAC5C;QAEDA,iCACI,IAAI,EAAC,UAAU,EACf,KAAK,EAAC,8BAA8B,EACpC,EAAE,EAAE,KAAK,CAAC,EAAE,EACZ,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,QAAQ,EAAE,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,QAAQ,EAC1C,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,QAAQ,EAAE,KAAK,CAAC,QAAQ,mBACT,KAAK,CAAC,YAAY,sBACf,KAAK,CAAC,YAAY,IAChC,UAAU,EAChB;QACFA,iBAAK,KAAK,EAAC,0BAA0B;UACjCA,iBAAK,KAAK,EAAC,yBAAyB,EAAC,OAAO,EAAC,WAAW;YACpDA,kBACI,KAAK,EAAC,8BAA8B,EACpC,IAAI,EAAC,MAAM,EACX,CAAC,EAAC,kCAAkC,GACtC,CACA;UACNA,iBAAK,KAAK,EAAC,yBAAyB,GAAG,CACrC,CACJ;MACNA,mBACI,KAAK,EAAE;UACH,uBAAuB,EAAE,KAAK,CAAC,OAAO;UACtC,wBAAwB,EAAE,KAAK,CAAC,QAAQ;UACxC,wBAAwB,EAAE,KAAK,CAAC,QAAQ;UACxC,6BAA6B,EAAE,KAAK,CAAC,aAAa;UAClD,yBAAyB,EAAE,KAAK,CAAC,QAAQ;SAC5C,EACD,OAAO,EAAE,KAAK,CAAC,EAAE,IAEhB,KAAK,CAAC,KAAK,CACR,CACN;IACNA,QAAC,UAAU,IACP,IAAI,EAAE,KAAK,CAAC,UAAU,EACtB,YAAY,EAAE,KAAK,CAAC,YAAY,GAClC;GACL,CAAC;AACN,EAAE;AAEF,MAAM,UAAU,GAIX,CAAC,KAAK;EACP,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE;IAChC,OAAO;GACV;EAED,QACIA,+BACI,UAAU,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,EAC7B,YAAY,EAAE,KAAK,CAAC,YAAY,EAChC,OAAO,EAAE,KAAK,CAAC,OAAO,GACxB,EACJ;AACN,CAAC;;;;","names":["h"],"sources":["./src/components/checkbox/checkbox.template.tsx"],"sourcesContent":["import { FunctionalComponent, h } from '@stencil/core';\n\ninterface CheckboxTemplateProps {\n disabled?: boolean;\n id: string;\n checked?: boolean;\n readonly?: boolean;\n indeterminate?: boolean;\n required?: boolean;\n invalid?: boolean;\n onChange?: (event: Event) => void;\n label?: string;\n helperText?: string;\n helperTextId?: string;\n}\n\nexport const CheckboxTemplate: FunctionalComponent<CheckboxTemplateProps> = (\n props,\n) => {\n const inputProps = {};\n if (props.indeterminate) {\n inputProps['data-indeterminate'] = 'true';\n }\n\n return [\n <div class=\"mdc-form-field \">\n <div\n class={{\n 'mdc-checkbox': true,\n 'mdc-checkbox--invalid': props.invalid,\n 'mdc-checkbox--disabled': props.disabled,\n 'mdc-checkbox--required': props.required,\n 'mdc-checkbox--indeterminate': props.indeterminate,\n 'lime-checkbox--readonly': props.readonly,\n }}\n >\n <input\n type=\"checkbox\"\n class=\"mdc-checkbox__native-control\"\n id={props.id}\n checked={props.checked}\n disabled={props.disabled || props.readonly}\n required={props.required}\n onChange={props.onChange}\n aria-controls={props.helperTextId}\n aria-describedby={props.helperTextId}\n {...inputProps}\n />\n <div class=\"mdc-checkbox__background\">\n <svg class=\"mdc-checkbox__checkmark\" viewBox=\"0 0 24 24\">\n <path\n class=\"mdc-checkbox__checkmark-path\"\n fill=\"none\"\n d=\"M1.73,12.91 8.1,19.28 22.79,4.59\"\n />\n </svg>\n <div class=\"mdc-checkbox__mixedmark\" />\n </div>\n </div>\n <label\n class={{\n 'mdc-checkbox--invalid': props.invalid,\n 'mdc-checkbox--disabled': props.disabled,\n 'mdc-checkbox--required': props.required,\n 'mdc-checkbox--indeterminate': props.indeterminate,\n 'lime-checkbox--readonly': props.readonly,\n }}\n htmlFor={props.id}\n >\n {props.label}\n </label>\n </div>,\n <HelperText\n text={props.helperText}\n helperTextId={props.helperTextId}\n />,\n ];\n};\n\nconst HelperText: FunctionalComponent<{\n helperTextId: string;\n text: string;\n invalid?: boolean;\n}> = (props) => {\n if (typeof props.text !== 'string') {\n return;\n }\n\n return (\n <limel-helper-line\n helperText={props.text.trim()}\n helperTextId={props.helperTextId}\n invalid={props.invalid}\n />\n );\n};\n"],"version":3}
|
package/dist/cjs/dom-81eaa633.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Check if an element is a descendant of another, even if it is located within a shadow root
|
|
5
|
-
*
|
|
6
|
-
* @param element - The element to check
|
|
7
|
-
* @param parent - The parent element
|
|
8
|
-
* @returns True if the element is a descendant of the parent element, false otherwise
|
|
9
|
-
*/
|
|
10
|
-
function isDescendant(element, parent) {
|
|
11
|
-
if (!parent) {
|
|
12
|
-
return false;
|
|
13
|
-
}
|
|
14
|
-
if (parent.contains(element)) {
|
|
15
|
-
return true;
|
|
16
|
-
}
|
|
17
|
-
let currentNode = element;
|
|
18
|
-
let i = 0; // Just in case something weird happens, let's not crash the browser…
|
|
19
|
-
const DEPTH = 1000; // Max depth to search.
|
|
20
|
-
while (i < DEPTH &&
|
|
21
|
-
currentNode &&
|
|
22
|
-
currentNode.getRootNode().nodeName === '#document-fragment') {
|
|
23
|
-
currentNode = currentNode.getRootNode().host;
|
|
24
|
-
if (parent.contains(currentNode)) {
|
|
25
|
-
return true;
|
|
26
|
-
}
|
|
27
|
-
i += 1;
|
|
28
|
-
}
|
|
29
|
-
return parent.contains(currentNode);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
exports.isDescendant = isDescendant;
|
|
33
|
-
|
|
34
|
-
//# sourceMappingURL=dom-81eaa633.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"file":"dom-81eaa633.js","mappings":";;AAAA;;;;;;;SAOgB,YAAY,CAAC,OAAa,EAAE,MAAY;EACpD,IAAI,CAAC,MAAM,EAAE;IACT,OAAO,KAAK,CAAC;GAChB;EAED,IAAI,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;IAC1B,OAAO,IAAI,CAAC;GACf;EAED,IAAI,WAAW,GAAS,OAAO,CAAC;EAChC,IAAI,CAAC,GAAG,CAAC,CAAC;EACV,MAAM,KAAK,GAAG,IAAI,CAAC;EAEnB,OACI,CAAC,GAAG,KAAK;IACT,WAAW;IACX,WAAW,CAAC,WAAW,EAAE,CAAC,QAAQ,KAAK,oBAAoB,EAC7D;IACE,WAAW,GAAI,WAAW,CAAC,WAAW,EAAU,CAAC,IAAI,CAAC;IACtD,IAAI,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE;MAC9B,OAAO,IAAI,CAAC;KACf;IAED,CAAC,IAAI,CAAC,CAAC;GACV;EAED,OAAO,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;AACxC;;;;","names":[],"sources":["./src/util/dom.ts"],"sourcesContent":["/**\n * Check if an element is a descendant of another, even if it is located within a shadow root\n *\n * @param element - The element to check\n * @param parent - The parent element\n * @returns True if the element is a descendant of the parent element, false otherwise\n */\nexport function isDescendant(element: Node, parent: Node): boolean {\n if (!parent) {\n return false;\n }\n\n if (parent.contains(element)) {\n return true;\n }\n\n let currentNode: Node = element;\n let i = 0; // Just in case something weird happens, let's not crash the browser…\n const DEPTH = 1000; // Max depth to search.\n\n while (\n i < DEPTH &&\n currentNode &&\n currentNode.getRootNode().nodeName === '#document-fragment'\n ) {\n currentNode = (currentNode.getRootNode() as any).host;\n if (parent.contains(currentNode)) {\n return true;\n }\n\n i += 1;\n }\n\n return parent.contains(currentNode);\n}\n"],"version":3}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"file":"limel-helper-line.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,aAAa,GAAG,+yBAA+yB;;MC2BxzB,UAAU;;;IAqDX,eAAU,GAAG;MACjB,OAAO,CAAC,EACJ,IAAI,CAAC,SAAS,GAAG,CAAC;SACjB,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAClD,CAAC;KACL,CAAC;IAEM,qBAAgB,GAAG;MACvB,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;QAClB,OAAO;OACV;MAED,QACIA,kBAAM,KAAK,EAAC,aAAa,EAAC,EAAE,EAAE,IAAI,CAAC,YAAY,IAC1C,IAAI,CAAC,UAAU,CACb,EACT;KACL,CAAC;IAEM,2BAAsB,GAAG;MAC7B,MAAM,OAAO,GAAG,GAAG,IAAI,CAAC,MAAM,MAAM,IAAI,CAAC,SAAS,EAAE,CAAC;MAErD,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;QACjB,OAAO;OACV;MAED,OAAOA,kBAAM,KAAK,EAAC,SAAS,IAAE,OAAO,CAAQ,CAAC;KACjD,CAAC;;;;mBArDyB,KAAK;;;EAQzB,MAAM;IACT,QACIA,QAACC,UAAI,IACD,QAAQ,EAAE,CAAC,CAAC,EACZ,KAAK,EAAE;QACH,OAAO,EAAE,IAAI,CAAC,OAAO;OACxB,EACD,KAAK,EAAE,CAAC,IAAI,CAAC,UAAU,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,iBACvC,CAAC,IAAI,CAAC,UAAU,EAAE,IAE/BD,qBACK,IAAI,CAAC,gBAAgB,EAAE,EACvB,IAAI,CAAC,sBAAsB,EAAE,CAC5B,CACH,EACT;GACL;;;;;;","names":["h","Host"],"sources":["./src/components/helper-line/helper-line.scss?tag=limel-helper-line&encapsulation=shadow","./src/components/helper-line/helper-line.tsx"],"sourcesContent":[":host(limel-helper-line) {\n transition: opacity 0.2s ease;\n\n box-sizing: border-box;\n display: grid;\n\n min-width: 0; // prevents overflowing, if component is placed in flex containers\n\n -moz-osx-font-smoothing: grayscale;\n -webkit-font-smoothing: antialiased;\n font-size: 0.6875rem;\n line-height: normal;\n\n color: rgb(var(--contrast-1200));\n}\n\ndiv {\n display: flex;\n justify-content: space-between;\n gap: 0.75rem;\n overflow: hidden;\n padding: 0 1rem;\n}\n\n:host(limel-helper-line.invalid) {\n .helper-text {\n color: var(--mdc-theme-error);\n }\n}\n\n.counter {\n flex-shrink: 0;\n margin-left: auto;\n}\n\n.helper-text,\n.counter {\n padding-top: 0.125rem;\n}\n\n// This animates height of the helper line, from `0` to `auto`.\n// To get this animation effect, the consumer component should\n// add `hide` classed accordingly.\n:host(limel-helper-line) {\n transition: grid-template-rows\n var(--limel-h-l-grid-template-rows-transition-speed, 0.46s)\n cubic-bezier(1, 0.09, 0, 0.89);\n grid-template-rows: var(--limel-h-l-grid-template-rows, 1fr);\n}\n\n:host(limel-helper-line.hide) {\n --limel-h-l-grid-template-rows-transition-speed: 0.3s;\n --limel-h-l-grid-template-rows: 0fr;\n}\n// End: animating height\n","import { Component, Host, Prop, h } from '@stencil/core';\n\n/**\n * This is an internal and private component that many input fields\n * use to display a helper text, along with a character counter below the\n * input field.\n *\n * We created this to keep the visual styles the same everywhere\n * and to avoid importing styles separately.\n *\n * Also this enables us to open the helper line in limel-portal,\n * more easily without having to send the styles to the portal.\n *\n * @exampleComponent limel-example-helper-line\n * @exampleComponent limel-example-helper-line-invalid\n * @exampleComponent limel-example-helper-line-long-text\n * @exampleComponent limel-example-helper-line-long-text-no-counter\n * @exampleComponent limel-example-helper-line-character-counter\n * @exampleComponent limel-example-helper-line-empty\n * @exampleComponent limel-example-helper-line-animation\n * @private\n */\n@Component({\n tag: 'limel-helper-line',\n shadow: true,\n styleUrl: 'helper-line.scss',\n})\nexport class HelperLine {\n /**\n * The helper text that is displayed on the left side.\n */\n @Prop({ reflect: true })\n public helperText?: string;\n\n /**\n * Length of the current input value, coming from the parent component.\n * Used in the character counter section on the right side.\n */\n @Prop({ reflect: true })\n public length?: number;\n\n /**\n * Maximum length of the characters, defined on the parent component.\n * Used in the character counter section on the right side.\n */\n @Prop({ reflect: true })\n public maxLength?: number;\n\n /**\n * Turns `true`, when the parent component is invalid.\n * For example, when the parent component is `required` but is left empty.\n * Or when the input format is invalid.\n */\n @Prop({ reflect: true })\n public invalid?: boolean = false;\n\n /**\n * Used by `aria-controls` and `aria-describedby` in the parent component.\n */\n @Prop({ reflect: true })\n public helperTextId?: string;\n\n public render() {\n return (\n <Host\n tabIndex={-1}\n class={{\n invalid: this.invalid,\n }}\n style={!this.hasContent() ? { display: 'none' } : {}}\n aria-hidden={!this.hasContent()}\n >\n <div>\n {this.renderHelperText()}\n {this.renderCharacterCounter()}\n </div>\n </Host>\n );\n }\n\n private hasContent = () => {\n return !!(\n this.maxLength > 0 ||\n (this.helperText && this.helperText.length > 0)\n );\n };\n\n private renderHelperText = () => {\n if (!this.helperText) {\n return;\n }\n\n return (\n <span class=\"helper-text\" id={this.helperTextId}>\n {this.helperText}\n </span>\n );\n };\n\n private renderCharacterCounter = () => {\n const counter = `${this.length} / ${this.maxLength}`;\n\n if (!this.maxLength) {\n return;\n }\n\n return <span class=\"counter\">{counter}</span>;\n };\n}\n"],"version":3}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"file":"checkbox.template-50268c7d.js","mappings":";;MAgBa,gBAAgB,GAA+C,CACxE,KAAK;EAEL,MAAM,UAAU,GAAG,EAAE,CAAC;EACtB,IAAI,KAAK,CAAC,aAAa,EAAE;IACrB,UAAU,CAAC,oBAAoB,CAAC,GAAG,MAAM,CAAC;GAC7C;EAED,OAAO;IACH,WAAK,KAAK,EAAC,iBAAiB;MACxB,WACI,KAAK,EAAE;UACH,cAAc,EAAE,IAAI;UACpB,uBAAuB,EAAE,KAAK,CAAC,OAAO;UACtC,wBAAwB,EAAE,KAAK,CAAC,QAAQ;UACxC,wBAAwB,EAAE,KAAK,CAAC,QAAQ;UACxC,6BAA6B,EAAE,KAAK,CAAC,aAAa;UAClD,yBAAyB,EAAE,KAAK,CAAC,QAAQ;SAC5C;QAED,2BACI,IAAI,EAAC,UAAU,EACf,KAAK,EAAC,8BAA8B,EACpC,EAAE,EAAE,KAAK,CAAC,EAAE,EACZ,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,QAAQ,EAAE,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,QAAQ,EAC1C,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,QAAQ,EAAE,KAAK,CAAC,QAAQ,mBACT,KAAK,CAAC,YAAY,sBACf,KAAK,CAAC,YAAY,IAChC,UAAU,EAChB;QACF,WAAK,KAAK,EAAC,0BAA0B;UACjC,WAAK,KAAK,EAAC,yBAAyB,EAAC,OAAO,EAAC,WAAW;YACpD,YACI,KAAK,EAAC,8BAA8B,EACpC,IAAI,EAAC,MAAM,EACX,CAAC,EAAC,kCAAkC,GACtC,CACA;UACN,WAAK,KAAK,EAAC,yBAAyB,GAAG,CACrC,CACJ;MACN,aACI,KAAK,EAAE;UACH,uBAAuB,EAAE,KAAK,CAAC,OAAO;UACtC,wBAAwB,EAAE,KAAK,CAAC,QAAQ;UACxC,wBAAwB,EAAE,KAAK,CAAC,QAAQ;UACxC,6BAA6B,EAAE,KAAK,CAAC,aAAa;UAClD,yBAAyB,EAAE,KAAK,CAAC,QAAQ;SAC5C,EACD,OAAO,EAAE,KAAK,CAAC,EAAE,IAEhB,KAAK,CAAC,KAAK,CACR,CACN;IACN,EAAC,UAAU,IACP,IAAI,EAAE,KAAK,CAAC,UAAU,EACtB,YAAY,EAAE,KAAK,CAAC,YAAY,GAClC;GACL,CAAC;AACN,EAAE;AAEF,MAAM,UAAU,GAIX,CAAC,KAAK;EACP,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE;IAChC,OAAO;GACV;EAED,QACI,yBACI,UAAU,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,EAC7B,YAAY,EAAE,KAAK,CAAC,YAAY,EAChC,OAAO,EAAE,KAAK,CAAC,OAAO,GACxB,EACJ;AACN,CAAC;;;;","names":[],"sources":["./src/components/checkbox/checkbox.template.tsx"],"sourcesContent":["import { FunctionalComponent, h } from '@stencil/core';\n\ninterface CheckboxTemplateProps {\n disabled?: boolean;\n id: string;\n checked?: boolean;\n readonly?: boolean;\n indeterminate?: boolean;\n required?: boolean;\n invalid?: boolean;\n onChange?: (event: Event) => void;\n label?: string;\n helperText?: string;\n helperTextId?: string;\n}\n\nexport const CheckboxTemplate: FunctionalComponent<CheckboxTemplateProps> = (\n props,\n) => {\n const inputProps = {};\n if (props.indeterminate) {\n inputProps['data-indeterminate'] = 'true';\n }\n\n return [\n <div class=\"mdc-form-field \">\n <div\n class={{\n 'mdc-checkbox': true,\n 'mdc-checkbox--invalid': props.invalid,\n 'mdc-checkbox--disabled': props.disabled,\n 'mdc-checkbox--required': props.required,\n 'mdc-checkbox--indeterminate': props.indeterminate,\n 'lime-checkbox--readonly': props.readonly,\n }}\n >\n <input\n type=\"checkbox\"\n class=\"mdc-checkbox__native-control\"\n id={props.id}\n checked={props.checked}\n disabled={props.disabled || props.readonly}\n required={props.required}\n onChange={props.onChange}\n aria-controls={props.helperTextId}\n aria-describedby={props.helperTextId}\n {...inputProps}\n />\n <div class=\"mdc-checkbox__background\">\n <svg class=\"mdc-checkbox__checkmark\" viewBox=\"0 0 24 24\">\n <path\n class=\"mdc-checkbox__checkmark-path\"\n fill=\"none\"\n d=\"M1.73,12.91 8.1,19.28 22.79,4.59\"\n />\n </svg>\n <div class=\"mdc-checkbox__mixedmark\" />\n </div>\n </div>\n <label\n class={{\n 'mdc-checkbox--invalid': props.invalid,\n 'mdc-checkbox--disabled': props.disabled,\n 'mdc-checkbox--required': props.required,\n 'mdc-checkbox--indeterminate': props.indeterminate,\n 'lime-checkbox--readonly': props.readonly,\n }}\n htmlFor={props.id}\n >\n {props.label}\n </label>\n </div>,\n <HelperText\n text={props.helperText}\n helperTextId={props.helperTextId}\n />,\n ];\n};\n\nconst HelperText: FunctionalComponent<{\n helperTextId: string;\n text: string;\n invalid?: boolean;\n}> = (props) => {\n if (typeof props.text !== 'string') {\n return;\n }\n\n return (\n <limel-helper-line\n helperText={props.text.trim()}\n helperTextId={props.helperTextId}\n invalid={props.invalid}\n />\n );\n};\n"],"version":3}
|
package/dist/esm/dom-0b0170a0.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Check if an element is a descendant of another, even if it is located within a shadow root
|
|
3
|
-
*
|
|
4
|
-
* @param element - The element to check
|
|
5
|
-
* @param parent - The parent element
|
|
6
|
-
* @returns True if the element is a descendant of the parent element, false otherwise
|
|
7
|
-
*/
|
|
8
|
-
function isDescendant(element, parent) {
|
|
9
|
-
if (!parent) {
|
|
10
|
-
return false;
|
|
11
|
-
}
|
|
12
|
-
if (parent.contains(element)) {
|
|
13
|
-
return true;
|
|
14
|
-
}
|
|
15
|
-
let currentNode = element;
|
|
16
|
-
let i = 0; // Just in case something weird happens, let's not crash the browser…
|
|
17
|
-
const DEPTH = 1000; // Max depth to search.
|
|
18
|
-
while (i < DEPTH &&
|
|
19
|
-
currentNode &&
|
|
20
|
-
currentNode.getRootNode().nodeName === '#document-fragment') {
|
|
21
|
-
currentNode = currentNode.getRootNode().host;
|
|
22
|
-
if (parent.contains(currentNode)) {
|
|
23
|
-
return true;
|
|
24
|
-
}
|
|
25
|
-
i += 1;
|
|
26
|
-
}
|
|
27
|
-
return parent.contains(currentNode);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export { isDescendant as i };
|
|
31
|
-
|
|
32
|
-
//# sourceMappingURL=dom-0b0170a0.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"file":"dom-0b0170a0.js","mappings":"AAAA;;;;;;;SAOgB,YAAY,CAAC,OAAa,EAAE,MAAY;EACpD,IAAI,CAAC,MAAM,EAAE;IACT,OAAO,KAAK,CAAC;GAChB;EAED,IAAI,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;IAC1B,OAAO,IAAI,CAAC;GACf;EAED,IAAI,WAAW,GAAS,OAAO,CAAC;EAChC,IAAI,CAAC,GAAG,CAAC,CAAC;EACV,MAAM,KAAK,GAAG,IAAI,CAAC;EAEnB,OACI,CAAC,GAAG,KAAK;IACT,WAAW;IACX,WAAW,CAAC,WAAW,EAAE,CAAC,QAAQ,KAAK,oBAAoB,EAC7D;IACE,WAAW,GAAI,WAAW,CAAC,WAAW,EAAU,CAAC,IAAI,CAAC;IACtD,IAAI,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE;MAC9B,OAAO,IAAI,CAAC;KACf;IAED,CAAC,IAAI,CAAC,CAAC;GACV;EAED,OAAO,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;AACxC;;;;","names":[],"sources":["./src/util/dom.ts"],"sourcesContent":["/**\n * Check if an element is a descendant of another, even if it is located within a shadow root\n *\n * @param element - The element to check\n * @param parent - The parent element\n * @returns True if the element is a descendant of the parent element, false otherwise\n */\nexport function isDescendant(element: Node, parent: Node): boolean {\n if (!parent) {\n return false;\n }\n\n if (parent.contains(element)) {\n return true;\n }\n\n let currentNode: Node = element;\n let i = 0; // Just in case something weird happens, let's not crash the browser…\n const DEPTH = 1000; // Max depth to search.\n\n while (\n i < DEPTH &&\n currentNode &&\n currentNode.getRootNode().nodeName === '#document-fragment'\n ) {\n currentNode = (currentNode.getRootNode() as any).host;\n if (parent.contains(currentNode)) {\n return true;\n }\n\n i += 1;\n }\n\n return parent.contains(currentNode);\n}\n"],"version":3}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"file":"limel-helper-line.entry.js","mappings":";;AAAA,MAAM,aAAa,GAAG,+yBAA+yB;;MC2BxzB,UAAU;;;IAqDX,eAAU,GAAG;MACjB,OAAO,CAAC,EACJ,IAAI,CAAC,SAAS,GAAG,CAAC;SACjB,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAClD,CAAC;KACL,CAAC;IAEM,qBAAgB,GAAG;MACvB,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;QAClB,OAAO;OACV;MAED,QACI,YAAM,KAAK,EAAC,aAAa,EAAC,EAAE,EAAE,IAAI,CAAC,YAAY,IAC1C,IAAI,CAAC,UAAU,CACb,EACT;KACL,CAAC;IAEM,2BAAsB,GAAG;MAC7B,MAAM,OAAO,GAAG,GAAG,IAAI,CAAC,MAAM,MAAM,IAAI,CAAC,SAAS,EAAE,CAAC;MAErD,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;QACjB,OAAO;OACV;MAED,OAAO,YAAM,KAAK,EAAC,SAAS,IAAE,OAAO,CAAQ,CAAC;KACjD,CAAC;;;;mBArDyB,KAAK;;;EAQzB,MAAM;IACT,QACI,EAAC,IAAI,IACD,QAAQ,EAAE,CAAC,CAAC,EACZ,KAAK,EAAE;QACH,OAAO,EAAE,IAAI,CAAC,OAAO;OACxB,EACD,KAAK,EAAE,CAAC,IAAI,CAAC,UAAU,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,iBACvC,CAAC,IAAI,CAAC,UAAU,EAAE,IAE/B,eACK,IAAI,CAAC,gBAAgB,EAAE,EACvB,IAAI,CAAC,sBAAsB,EAAE,CAC5B,CACH,EACT;GACL;;;;;;","names":[],"sources":["./src/components/helper-line/helper-line.scss?tag=limel-helper-line&encapsulation=shadow","./src/components/helper-line/helper-line.tsx"],"sourcesContent":[":host(limel-helper-line) {\n transition: opacity 0.2s ease;\n\n box-sizing: border-box;\n display: grid;\n\n min-width: 0; // prevents overflowing, if component is placed in flex containers\n\n -moz-osx-font-smoothing: grayscale;\n -webkit-font-smoothing: antialiased;\n font-size: 0.6875rem;\n line-height: normal;\n\n color: rgb(var(--contrast-1200));\n}\n\ndiv {\n display: flex;\n justify-content: space-between;\n gap: 0.75rem;\n overflow: hidden;\n padding: 0 1rem;\n}\n\n:host(limel-helper-line.invalid) {\n .helper-text {\n color: var(--mdc-theme-error);\n }\n}\n\n.counter {\n flex-shrink: 0;\n margin-left: auto;\n}\n\n.helper-text,\n.counter {\n padding-top: 0.125rem;\n}\n\n// This animates height of the helper line, from `0` to `auto`.\n// To get this animation effect, the consumer component should\n// add `hide` classed accordingly.\n:host(limel-helper-line) {\n transition: grid-template-rows\n var(--limel-h-l-grid-template-rows-transition-speed, 0.46s)\n cubic-bezier(1, 0.09, 0, 0.89);\n grid-template-rows: var(--limel-h-l-grid-template-rows, 1fr);\n}\n\n:host(limel-helper-line.hide) {\n --limel-h-l-grid-template-rows-transition-speed: 0.3s;\n --limel-h-l-grid-template-rows: 0fr;\n}\n// End: animating height\n","import { Component, Host, Prop, h } from '@stencil/core';\n\n/**\n * This is an internal and private component that many input fields\n * use to display a helper text, along with a character counter below the\n * input field.\n *\n * We created this to keep the visual styles the same everywhere\n * and to avoid importing styles separately.\n *\n * Also this enables us to open the helper line in limel-portal,\n * more easily without having to send the styles to the portal.\n *\n * @exampleComponent limel-example-helper-line\n * @exampleComponent limel-example-helper-line-invalid\n * @exampleComponent limel-example-helper-line-long-text\n * @exampleComponent limel-example-helper-line-long-text-no-counter\n * @exampleComponent limel-example-helper-line-character-counter\n * @exampleComponent limel-example-helper-line-empty\n * @exampleComponent limel-example-helper-line-animation\n * @private\n */\n@Component({\n tag: 'limel-helper-line',\n shadow: true,\n styleUrl: 'helper-line.scss',\n})\nexport class HelperLine {\n /**\n * The helper text that is displayed on the left side.\n */\n @Prop({ reflect: true })\n public helperText?: string;\n\n /**\n * Length of the current input value, coming from the parent component.\n * Used in the character counter section on the right side.\n */\n @Prop({ reflect: true })\n public length?: number;\n\n /**\n * Maximum length of the characters, defined on the parent component.\n * Used in the character counter section on the right side.\n */\n @Prop({ reflect: true })\n public maxLength?: number;\n\n /**\n * Turns `true`, when the parent component is invalid.\n * For example, when the parent component is `required` but is left empty.\n * Or when the input format is invalid.\n */\n @Prop({ reflect: true })\n public invalid?: boolean = false;\n\n /**\n * Used by `aria-controls` and `aria-describedby` in the parent component.\n */\n @Prop({ reflect: true })\n public helperTextId?: string;\n\n public render() {\n return (\n <Host\n tabIndex={-1}\n class={{\n invalid: this.invalid,\n }}\n style={!this.hasContent() ? { display: 'none' } : {}}\n aria-hidden={!this.hasContent()}\n >\n <div>\n {this.renderHelperText()}\n {this.renderCharacterCounter()}\n </div>\n </Host>\n );\n }\n\n private hasContent = () => {\n return !!(\n this.maxLength > 0 ||\n (this.helperText && this.helperText.length > 0)\n );\n };\n\n private renderHelperText = () => {\n if (!this.helperText) {\n return;\n }\n\n return (\n <span class=\"helper-text\" id={this.helperTextId}>\n {this.helperText}\n </span>\n );\n };\n\n private renderCharacterCounter = () => {\n const counter = `${this.length} / ${this.maxLength}`;\n\n if (!this.maxLength) {\n return;\n }\n\n return <span class=\"counter\">{counter}</span>;\n };\n}\n"],"version":3}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import{r as t,c as i,h as s,g as e}from"./p-3075aa67.js";import{i as n}from"./p-5e7b7b03.js";import{T as r,E as h,a as o,b as a,c as u,d as l,A as c,e as f,f as d,g as m}from"./p-e03dfe70.js";import{c as p}from"./p-3ccdc4a3.js";import{g as v,c as y}from"./p-2f777fdb.js";var b=function t(i){var s=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var n=void 0;var r=void 0;var h=void 0;var o=[];return function t(){var u=g(s);var l=(new Date).getTime();var c=!n||l-n>u;n=l;for(var f=arguments.length,d=Array(f),m=0;m<f;m++){d[m]=arguments[m]}if(c&&e.leading){return e.accumulate?Promise.resolve(i.call(this,[d])).then((function(t){return t[0]})):Promise.resolve(i.call.apply(i,[this].concat(d)))}if(r){clearTimeout(h)}else{r=w()}o.push(d);h=setTimeout(a.bind(this),u);if(e.accumulate){var p=o.length-1;return r.promise.then((function(t){return t[p]}))}return r.promise};function a(){var t=r;clearTimeout(h);Promise.resolve(e.accumulate?i.call(this,o):i.apply(this,o[o.length-1])).then(t.resolve,t.reject);o=[];r=null}};function g(t){return typeof t==="function"?t():t}function w(){var t={};t.promise=new Promise((function(i,s){t.resolve=i;t.reject=s}));return t}function D(t){var i=null;var s=null;var e=new Promise((function(t,e){i=t;s=e}));t&&t.then((function(t){i&&i(t)}),(function(t){s&&s(t)}));return{promise:e,resolve:function(t){i&&i(t)},reject:function(t){s&&s(t)},cancel:function(){i=null;s=null}}}function C(t){var i=null;var s=function(){var s=[];for(var e=0;e<arguments.length;e++){s[e]=arguments[e]}i&&i();var n=t.apply(void 0,s);var r=D(n),h=r.promise,o=r.cancel;i=o;return h};return s}
|
|
2
|
-
/*! *****************************************************************************
|
|
3
|
-
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
|
-
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
5
|
-
this file except in compliance with the License. You may obtain a copy of the
|
|
6
|
-
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
|
|
8
|
-
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
9
|
-
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
10
|
-
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
11
|
-
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
12
|
-
|
|
13
|
-
See the Apache Version 2.0 License for specific language governing permissions
|
|
14
|
-
and limitations under the License.
|
|
15
|
-
***************************************************************************** */var j=function(){j=Object.assign||function t(i){for(var s,e=1,n=arguments.length;e<n;e++){s=arguments[e];for(var r in s)if(Object.prototype.hasOwnProperty.call(s,r))i[r]=s[r]}return i};return j.apply(this,arguments)};var I={key:function(){var t=[];for(var i=0;i<arguments.length;i++){t[i]=arguments[i]}return null},onlyResolvesLast:true};var x=function(){function t(t){this.config=t;this.debounceSingleton=null;this.debounceCache={}}t.prototype._createDebouncedFunction=function(){var t=b(this.config.func,this.config.wait,this.config.options);if(this.config.options.onlyResolvesLast){t=C(t)}return{func:t}};t.prototype.getDebouncedFunction=function(t){var i;var s=(i=this.config.options).key.apply(i,t);if(s===null||typeof s==="undefined"){if(!this.debounceSingleton){this.debounceSingleton=this._createDebouncedFunction()}return this.debounceSingleton}else{if(!this.debounceCache[s]){this.debounceCache[s]=this._createDebouncedFunction()}return this.debounceCache[s]}};return t}();function S(t,i,s){var e=j({},I,s);var n=new x({func:t,wait:i,options:e});var r=function(){var t=[];for(var i=0;i<arguments.length;i++){t[i]=arguments[i]}var s=n.getDebouncedFunction(t).func;return s.apply(void 0,t)};return r}const L=":host{position:relative;display:block}:host([hidden]){display:none}";const P=500;const k="limel-chip-set";const A=class{constructor(s){t(this,s);this.change=i(this,"change",7);this.interact=i(this,"interact",7);this.action=i(this,"action",7);this.chipSetEditMode=false;this.getValueId=t=>{const i=t.value;if(!!i&&typeof i==="object"){return i.id}return i};this.createChips=t=>{if(!t){return[]}if(this.multiple){const i=t;return i.map(this.createChip)}const i=t;return[this.createChip(i)]};this.createChip=t=>{const i=v(t.icon);const s=y(t.icon,t.iconColor);const e=this.getValueId(t);return{id:`${e}`,text:t.text,removable:true,icon:i?{name:i,color:s}:undefined,value:t}};this.disabled=false;this.readonly=false;this.label=undefined;this.searchLabel=undefined;this.helperText=undefined;this.leadingIcon=undefined;this.emptyResultMessage=undefined;this.required=false;this.invalid=false;this.value=undefined;this.searcher=undefined;this.multiple=false;this.delimiter=null;this.actions=[];this.actionPosition="bottom";this.actionScrollBehavior="sticky";this.badgeIcons=false;this.items=undefined;this.textValue="";this.loading=false;this.chips=[];this.handleTextInput=this.handleTextInput.bind(this);this.handleInputKeyDown=this.handleInputKeyDown.bind(this);this.handleDropdownKeyDown=this.handleDropdownKeyDown.bind(this);this.handleInputFieldFocus=this.handleInputFieldFocus.bind(this);this.handleChange=this.handleChange.bind(this);this.handleInteract=this.handleInteract.bind(this);this.handleListChange=this.handleListChange.bind(this);this.handleActionListChange=this.handleActionListChange.bind(this);this.handleStopEditAndBlur=this.handleStopEditAndBlur.bind(this);this.createDebouncedSearcher=this.createDebouncedSearcher.bind(this);this.handleCloseMenu=this.handleCloseMenu.bind(this);this.onListKeyDown=this.onListKeyDown.bind(this);this.portalId=p()}componentWillLoad(){this.chips=this.createChips(this.value)}componentDidLoad(){this.createDebouncedSearcher(this.searcher);this.chipSet=this.host.shadowRoot.querySelector(k)}async componentWillUpdate(){this.chipSetEditMode=false;if(this.chipSet){this.chipSetEditMode=await this.chipSet.getEditMode()}}render(){const t={};if(!this.multiple){t.maxItems=1}return[s("limel-chip-set",Object.assign({type:"input",inputType:"search",label:this.label,helperText:this.helperText,leadingIcon:this.leadingIcon,value:this.chips,disabled:this.disabled,invalid:this.invalid,delimiter:this.renderDelimiter(),readonly:this.readonly,required:this.required,searchLabel:this.searchLabel,onInput:this.handleTextInput,onKeyDown:this.handleInputKeyDown,onChange:this.handleChange,onInteract:this.handleInteract,onStartEdit:this.handleInputFieldFocus,onStopEdit:this.handleStopEditAndBlur,emptyInputOnBlur:false,clearAllButton:this.multiple&&!this.chipSetEditMode},t)),this.renderDropdown()]}onChangeValue(){this.chips=this.createChips(this.value)}createDebouncedSearcher(t){if(typeof t!=="function"){return}this.debouncedSearch=S(t,P)}renderDelimiter(){if(this.multiple){return this.delimiter}return null}renderDropdown(){const t=this.getDropdownContent();const i=[];if(this.shouldShowDropDownContent()){const s=this.getActionContent();if(this.actionPosition==="top"){i.push(s)}if(t){i.push(t)}if(this.actionPosition==="bottom"){i.push(s)}}return this.renderPortal(i)}getActionContent(){var t,i;const e=(i=(t=this.actions)===null||t===void 0?void 0:t.length)!==null&&i!==void 0?i:0;if(e===0){return null}return[s("limel-list",{class:{"static-actions-list":true,"is-on-top":this.actionPosition==="top","is-at-bottom":this.actionPosition==="bottom","has-position-sticky":this.actionScrollBehavior==="sticky"},badgeIcons:true,type:"selectable",onChange:this.handleActionListChange,items:this.actions.map(this.removeUnusedPropertiesOnAction)})]}removeUnusedPropertiesOnAction(t){return Object.assign(Object.assign({},t),{actions:[]})}shouldShowDropDownContent(){if(this.isFull()){return false}return!!this.chipSetEditMode}getDropdownContent(){if(!this.shouldShowDropDownContent()){return}if(this.loading){return this.renderSpinner()}if(!this.items||!this.items.length){return this.renderEmptyMessage()}return this.renderListResult()}isFull(){return!this.multiple&&!!this.value}renderSpinner(){return s("div",{style:{width:"100%",display:"flex","align-items":"center","justify-content":"center",padding:"1rem 0"}},s("limel-spinner",{limeBranded:false}))}renderEmptyMessage(){if(!this.emptyResultMessage){return}const t={color:"rgb(var(--contrast-1100))","text-align":"center",margin:"0.5rem 1rem"};return s("p",{style:t},this.emptyResultMessage)}renderListResult(){return s("limel-list",{badgeIcons:this.badgeIcons,onChange:this.handleListChange,onKeyDown:this.onListKeyDown,type:"selectable",items:this.items})}onListKeyDown(t){const i=[r,h,o].includes(t.key);const s=[a,u,l].includes(t.keyCode);if(i||s){this.chipSet.setFocus()}}renderPortal(t=[]){const i=getComputedStyle(this.host).getPropertyValue("--dropdown-z-index");return s("limel-portal",{visible:t.length>0,containerId:this.portalId,inheritParentWidth:true,containerStyle:{"z-index":i}},s("limel-menu-surface",{open:t.length>0,allowClicksElement:this.host,style:{"--mdc-menu-min-width":"100%","max-height":"inherit",display:"flex"},onDismiss:this.handleCloseMenu},t))}handleStopEditAndBlur(){const t=this.host.shadowRoot.activeElement||document.activeElement;const i=document.querySelector(`#${this.portalId}`);if(n(t,this.host)||n(t,i)){return}this.clearInputField()}async handleTextInput(t){t.stopPropagation();const i=t.detail;this.textValue=i;this.loading=true;const s=i===""?this.searcher:this.debouncedSearch;const e=await s(i);this.handleSearchResult(i,e)}handleListChange(t){var i;t.stopPropagation();if(!this.value||this.value!==t.detail){let i=t.detail;if(this.multiple){i=[...this.value,t.detail]}this.change.emit(i);this.items=[]}if(this.multiple){(i=this.chipSet)===null||i===void 0?void 0:i.setFocus(true)}}handleActionListChange(t){t.stopPropagation();if(!t.detail){return}this.action.emit(t.detail.value);this.items=[]}async handleInputFieldFocus(){this.loading=true;const t=this.textValue;const i=await this.searcher(t);this.handleSearchResult(t,i)}handleChange(t){t.stopPropagation();let i=null;if(this.multiple){const s=t.detail;i=s.map((t=>this.value.find((i=>{const s=this.getValueId(i);return`${s}`===t.id}))))}this.change.emit(i)}handleInteract(t){t.stopPropagation();this.interact.emit(t.detail?t.detail.value:t.detail)}handleInputKeyDown(t){const i=(t.key===r||t.keyCode===a)&&!t.altKey&&!t.metaKey&&!t.shiftKey;const s=t.key===c||t.keyCode===f;const e=t.key===d||t.keyCode===m;if(!i&&!s&&!e){return}const n=document.querySelector(` #${this.portalId} limel-list`);if(!n){return}t.preventDefault();if(i||e){const t=n.shadowRoot.querySelector(".mdc-deprecated-list-item:first-child");t.focus();return}if(s){const t=n.shadowRoot.querySelector(".mdc-deprecated-list-item:last-child");t.focus()}}handleDropdownKeyDown(t){const i=t.key===h||t.keyCode===u;if(i){t.preventDefault();this.textValue="";this.chipSet.setFocus(true)}}handleSearchResult(t,i){if(t===this.textValue){this.items=i;if(this.multiple){const t=this.value;this.items=i.filter((i=>!t.includes(i)))}this.loading=false}}handleCloseMenu(){if(this.items.length>0){return}this.clearInputField()}clearInputField(){this.chipSet.emptyInput();this.textValue="";this.handleSearchResult("",[])}get host(){return e(this)}static get watchers(){return{value:["onChangeValue"],searcher:["createDebouncedSearcher"]}}};A.style=L;export{A as limel_picker};
|
|
16
|
-
//# sourceMappingURL=p-042e5620.entry.js.map
|