@limetech/lime-elements 39.25.0 → 39.27.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.
Files changed (103) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/README.md +1 -1
  3. package/dist/cjs/lime-elements.cjs.js +1 -1
  4. package/dist/cjs/limel-action-bar_3.cjs.entry.js +1 -1
  5. package/dist/cjs/limel-ai-avatar.cjs.entry.js +1 -1
  6. package/dist/cjs/limel-callout.cjs.entry.js +1 -1
  7. package/dist/cjs/limel-chart.cjs.entry.js +1 -1
  8. package/dist/cjs/limel-chip-set.cjs.entry.js +21 -3
  9. package/dist/cjs/limel-chip_2.cjs.entry.js +1 -1
  10. package/dist/cjs/limel-code-diff.cjs.entry.js +1 -1
  11. package/dist/cjs/limel-code-editor.cjs.entry.js +1 -1
  12. package/dist/cjs/limel-collapsible-section.cjs.entry.js +1 -1
  13. package/dist/cjs/limel-drag-handle.cjs.entry.js +1 -1
  14. package/dist/cjs/limel-email-viewer.cjs.entry.js +1 -1
  15. package/dist/cjs/limel-file-viewer.cjs.entry.js +1 -1
  16. package/dist/cjs/limel-file.cjs.entry.js +1 -1
  17. package/dist/cjs/limel-flatpickr-adapter.cjs.entry.js +1 -1
  18. package/dist/cjs/limel-list-item.cjs.entry.js +1 -1
  19. package/dist/cjs/limel-picker.cjs.entry.js +112 -41
  20. package/dist/cjs/limel-profile-picture.cjs.entry.js +1 -1
  21. package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js +1 -1
  22. package/dist/cjs/limel-snackbar.cjs.entry.js +1 -1
  23. package/dist/cjs/limel-table.cjs.entry.js +1 -1
  24. package/dist/cjs/limel-text-editor-link-menu.cjs.entry.js +1 -1
  25. package/dist/cjs/loader.cjs.js +1 -1
  26. package/dist/cjs/{translations-D4j_eojG.js → translations-BCHv7JrI.js} +16 -0
  27. package/dist/collection/components/chip-set/chip-set.js +40 -2
  28. package/dist/collection/components/picker/picker-item.types.js +1 -0
  29. package/dist/collection/components/picker/picker.js +167 -103
  30. package/dist/collection/interface.js +1 -0
  31. package/dist/collection/translations/da.js +2 -0
  32. package/dist/collection/translations/de.js +2 -0
  33. package/dist/collection/translations/en.js +2 -0
  34. package/dist/collection/translations/fi.js +2 -0
  35. package/dist/collection/translations/fr.js +2 -0
  36. package/dist/collection/translations/nl.js +2 -0
  37. package/dist/collection/translations/no.js +2 -0
  38. package/dist/collection/translations/sv.js +2 -0
  39. package/dist/esm/lime-elements.js +1 -1
  40. package/dist/esm/limel-action-bar_3.entry.js +1 -1
  41. package/dist/esm/limel-ai-avatar.entry.js +1 -1
  42. package/dist/esm/limel-callout.entry.js +1 -1
  43. package/dist/esm/limel-chart.entry.js +1 -1
  44. package/dist/esm/limel-chip-set.entry.js +21 -3
  45. package/dist/esm/limel-chip_2.entry.js +1 -1
  46. package/dist/esm/limel-code-diff.entry.js +1 -1
  47. package/dist/esm/limel-code-editor.entry.js +1 -1
  48. package/dist/esm/limel-collapsible-section.entry.js +1 -1
  49. package/dist/esm/limel-drag-handle.entry.js +1 -1
  50. package/dist/esm/limel-email-viewer.entry.js +1 -1
  51. package/dist/esm/limel-file-viewer.entry.js +1 -1
  52. package/dist/esm/limel-file.entry.js +1 -1
  53. package/dist/esm/limel-flatpickr-adapter.entry.js +1 -1
  54. package/dist/esm/limel-list-item.entry.js +1 -1
  55. package/dist/esm/limel-picker.entry.js +113 -42
  56. package/dist/esm/limel-profile-picture.entry.js +1 -1
  57. package/dist/esm/limel-prosemirror-adapter.entry.js +1 -1
  58. package/dist/esm/limel-snackbar.entry.js +1 -1
  59. package/dist/esm/limel-table.entry.js +1 -1
  60. package/dist/esm/limel-text-editor-link-menu.entry.js +1 -1
  61. package/dist/esm/loader.js +1 -1
  62. package/dist/esm/{translations-Dv3YcsA7.js → translations-PPDjFxtV.js} +16 -0
  63. package/dist/lime-elements/lime-elements.esm.js +1 -1
  64. package/dist/lime-elements/{p-5eadcd4a.entry.js → p-0e24eb2b.entry.js} +1 -1
  65. package/dist/lime-elements/{p-80162ba0.entry.js → p-1f0d571e.entry.js} +1 -1
  66. package/dist/lime-elements/{p-c8eabc9d.entry.js → p-25aa2667.entry.js} +1 -1
  67. package/dist/lime-elements/{p-067a13bb.entry.js → p-2eea146d.entry.js} +1 -1
  68. package/dist/lime-elements/{p-eff0a330.entry.js → p-32e893de.entry.js} +1 -1
  69. package/dist/lime-elements/{p-b1645d2d.entry.js → p-3364b078.entry.js} +1 -1
  70. package/dist/lime-elements/{p-60327283.entry.js → p-3c09f58b.entry.js} +1 -1
  71. package/dist/lime-elements/{p-01651634.entry.js → p-3c79f422.entry.js} +1 -1
  72. package/dist/lime-elements/p-4acb7438.entry.js +1 -0
  73. package/dist/lime-elements/{p-9caeca33.entry.js → p-87c1d5f0.entry.js} +1 -1
  74. package/dist/lime-elements/{p-512b2e14.entry.js → p-8b2f5ef5.entry.js} +1 -1
  75. package/dist/lime-elements/p-8dc61e1b.entry.js +1 -0
  76. package/dist/lime-elements/{p-504dcdb6.entry.js → p-9e35468c.entry.js} +1 -1
  77. package/dist/lime-elements/p-PPDjFxtV.js +1 -0
  78. package/dist/lime-elements/{p-42b9b57a.entry.js → p-a49c1c48.entry.js} +1 -1
  79. package/dist/lime-elements/{p-95ac0387.entry.js → p-abd1fde1.entry.js} +1 -1
  80. package/dist/lime-elements/{p-05d533b5.entry.js → p-cb10df74.entry.js} +1 -1
  81. package/dist/lime-elements/{p-104d0fb3.entry.js → p-cd85d670.entry.js} +1 -1
  82. package/dist/lime-elements/{p-f867b424.entry.js → p-db022b46.entry.js} +1 -1
  83. package/dist/lime-elements/{p-5cc370fe.entry.js → p-e6b2b277.entry.js} +1 -1
  84. package/dist/lime-elements/{p-e5c7cac0.entry.js → p-ea3c3dfd.entry.js} +1 -1
  85. package/dist/lime-elements/{p-7436490f.entry.js → p-eece0f01.entry.js} +1 -1
  86. package/dist/types/components/chip-set/chip-set.d.ts +16 -0
  87. package/dist/types/components/picker/picker-item.types.d.ts +28 -0
  88. package/dist/types/components/picker/picker.d.ts +38 -9
  89. package/dist/types/components/picker/searcher.types.d.ts +3 -3
  90. package/dist/types/components.d.ts +42 -12
  91. package/dist/types/interface.d.ts +1 -0
  92. package/dist/types/translations/da.d.ts +2 -0
  93. package/dist/types/translations/de.d.ts +2 -0
  94. package/dist/types/translations/en.d.ts +2 -0
  95. package/dist/types/translations/fi.d.ts +2 -0
  96. package/dist/types/translations/fr.d.ts +2 -0
  97. package/dist/types/translations/nl.d.ts +2 -0
  98. package/dist/types/translations/no.d.ts +2 -0
  99. package/dist/types/translations/sv.d.ts +2 -0
  100. package/package.json +1 -1
  101. package/dist/lime-elements/p-51734986.entry.js +0 -1
  102. package/dist/lime-elements/p-Dv3YcsA7.js +0 -1
  103. package/dist/lime-elements/p-cba2dbb6.entry.js +0 -1
@@ -1 +1 @@
1
- import{r as o,h as r,H as t}from"./p-DBTJNfo7.js";import{t as e}from"./p-Dv3YcsA7.js";const l={note:"info",important:"exclamation_mark",tip:"idea",caution:"high_priority",warning:"error"};function a(o,r="note"){var t;return o||(null!==(t=l[r])&&void 0!==t?t:l.note)}const i=class{constructor(r){o(this,r),this.type="note",this.language="en"}render(){return r(t,{key:"9af3d9dc95f93714f7f334695d64f7f02b8b52e2"},r("div",{key:"014e90ead94b3c88f33dcb40de1a56d6b85c4c9b",class:"side",role:"presentation"},r("limel-icon",{key:"042773fb922877be2b6ef77c276a4b24c48517e2",name:a(this.icon,this.type)})),r("div",{key:"b211a6f7eb0d2680ef96adbbb5b4646c44e8d147",class:"main"},r("h1",{key:"7e4f4d05a54cc719b51144a21b28cfc1b1024a52",class:"heading"},function(o,r="note",t="en"){if(o)return o;const l=`callout.${r}`;try{return e.get(l,t)}catch(o){return e.get(l,"en")}}(this.heading,this.type,this.language)),r("slot",{key:"d1f333b26662b75cd403e3048229e6926e4279ed"})))}};i.style='*,*::before,*::after{box-sizing:border-box;min-height:0;min-width:0}:host(limel-callout){box-sizing:border-box;display:flex;border-radius:0.5rem;overflow:hidden;--limel-callout-tint-color:var( --callout-color, rgb(var(--color-contrast-100)) );color:var(--callout-text-color, rgb(var(--contrast-1100)));font-size:var(--limel-theme-default-font-size)}:host([type=note]){--limel-callout-tint-color:var( --callout-color, rgb(var(--color-gray-default)) )}:host([type=important]){--limel-callout-tint-color:var( --callout-color, rgb(var(--color-sky-default)) )}:host([type=tip]){--limel-callout-tint-color:var( --callout-color, rgb(var(--color-green-default)) )}:host([type=caution]){--limel-callout-tint-color:var( --callout-color, rgb(var(--color-orange-light)) )}:host([type=warning]){--limel-callout-tint-color:var( --callout-color, rgb(var(--color-red-dark)) )}.side{padding:0.25rem;position:relative}.side:before{content:"";position:absolute;inset:0;opacity:0.2;background-color:var(--limel-callout-tint-color)}.side limel-icon{width:1.5rem;color:var(--limel-callout-tint-color);margin-top:0.0625rem}.main{display:flex;flex:1;flex-direction:column;gap:0.5rem;padding:0.25rem 0.5rem 0.5rem 0.5rem;background-color:var(--callout-background-color, rgb(var(--contrast-300)))}.heading{margin:0;font-size:1rem;font-weight:600}';export{i as limel_callout}
1
+ import{r as o,h as t,H as r}from"./p-DBTJNfo7.js";import{t as e}from"./p-PPDjFxtV.js";const l={note:"info",important:"exclamation_mark",tip:"idea",caution:"high_priority",warning:"error"};function a(o,t="note"){var r;return o||(null!==(r=l[t])&&void 0!==r?r:l.note)}const i=class{constructor(t){o(this,t),this.type="note",this.language="en"}render(){return t(r,{key:"9af3d9dc95f93714f7f334695d64f7f02b8b52e2"},t("div",{key:"014e90ead94b3c88f33dcb40de1a56d6b85c4c9b",class:"side",role:"presentation"},t("limel-icon",{key:"042773fb922877be2b6ef77c276a4b24c48517e2",name:a(this.icon,this.type)})),t("div",{key:"b211a6f7eb0d2680ef96adbbb5b4646c44e8d147",class:"main"},t("h1",{key:"7e4f4d05a54cc719b51144a21b28cfc1b1024a52",class:"heading"},function(o,t="note",r="en"){if(o)return o;const l=`callout.${t}`;try{return e.get(l,r)}catch(o){return e.get(l,"en")}}(this.heading,this.type,this.language)),t("slot",{key:"d1f333b26662b75cd403e3048229e6926e4279ed"})))}};i.style='*,*::before,*::after{box-sizing:border-box;min-height:0;min-width:0}:host(limel-callout){box-sizing:border-box;display:flex;border-radius:0.5rem;overflow:hidden;--limel-callout-tint-color:var( --callout-color, rgb(var(--color-contrast-100)) );color:var(--callout-text-color, rgb(var(--contrast-1100)));font-size:var(--limel-theme-default-font-size)}:host([type=note]){--limel-callout-tint-color:var( --callout-color, rgb(var(--color-gray-default)) )}:host([type=important]){--limel-callout-tint-color:var( --callout-color, rgb(var(--color-sky-default)) )}:host([type=tip]){--limel-callout-tint-color:var( --callout-color, rgb(var(--color-green-default)) )}:host([type=caution]){--limel-callout-tint-color:var( --callout-color, rgb(var(--color-orange-light)) )}:host([type=warning]){--limel-callout-tint-color:var( --callout-color, rgb(var(--color-red-dark)) )}.side{padding:0.25rem;position:relative}.side:before{content:"";position:absolute;inset:0;opacity:0.2;background-color:var(--limel-callout-tint-color)}.side limel-icon{width:1.5rem;color:var(--limel-callout-tint-color);margin-top:0.0625rem}.main{display:flex;flex:1;flex-direction:column;gap:0.5rem;padding:0.25rem 0.5rem 0.5rem 0.5rem;background-color:var(--callout-background-color, rgb(var(--contrast-300)))}.heading{margin:0;font-size:1rem;font-weight:600}';export{i as limel_callout}
@@ -112,6 +112,22 @@ export declare class ChipSet {
112
112
  * Whether the input field should be emptied when the chip-set loses focus.
113
113
  */
114
114
  emptyInputOnBlur: boolean;
115
+ /**
116
+ * Whether the input field should be emptied when the set of chips
117
+ * changes (i.e. when the `value` prop is updated — a chip is added,
118
+ * removed, or the array is replaced).
119
+ *
120
+ * Defaults to `true`, which is the right behavior for a standalone
121
+ * input chip-set where the typed text *becomes* the next chip on
122
+ * <kbd>Enter</kbd>. The input is then cleared to make room for the
123
+ * next chip, and help user type a new keyword from scratch.
124
+ *
125
+ * Set to `false` when the input represents a search query over an
126
+ * external suggestion list (as in `limel-picker`), so the typed keyword
127
+ * survives while chips are added or removed (when user selects items from
128
+ * the search results list, while it is open).
129
+ */
130
+ emptyInputOnChange: boolean;
115
131
  /**
116
132
  * Whether the "Clear all" buttons should be shown
117
133
  */
@@ -0,0 +1,28 @@
1
+ import { ListItem } from '../list-item/list-item.types';
2
+ import { PickerValue } from './value.types';
3
+ /**
4
+ * An item that can be picked by `limel-picker`.
5
+ *
6
+ * Extends `ListItem` with picker-specific flags that only make sense
7
+ * once the item has been selected and rendered as a chip.
8
+ *
9
+ * @public
10
+ */
11
+ export interface PickerItem<T = PickerValue> extends ListItem<T> {
12
+ /**
13
+ * Whether the item should be removable once it has been picked
14
+ * and rendered as a chip. Most useful when `multiple={true}`,
15
+ * but also locks the single chip when `multiple={false}`.
16
+ *
17
+ * Picked items are removable by default. Set this to `false` to
18
+ * "lock" an individual item so that the user cannot remove it —
19
+ * neither via the remove button, nor with Backspace/Delete, nor
20
+ * by the "Clear all" button. Locked items remain fully interactive
21
+ * (clicks still emit `interact` events).
22
+ *
23
+ * If the entire picker is `disabled` or `readonly`, the remove
24
+ * button is hidden on all chips regardless of this flag.
25
+ */
26
+ removable?: boolean;
27
+ }
28
+ //# sourceMappingURL=picker-item.types.d.ts.map
@@ -1,17 +1,20 @@
1
1
  import { Action } from '../collapsible-section/action';
2
2
  import { ActionPosition, ActionScrollBehavior } from '../picker/actions.types';
3
+ import { Languages } from '../date-picker/date.types';
3
4
  import { ListItem } from '../list-item/list-item.types';
5
+ import { PickerItem } from '../picker/picker-item.types';
4
6
  import { Searcher } from '../picker/searcher.types';
5
- import { PickerValue } from './value.types';
6
7
  import { IconName } from '../../global/shared-types/icon.types';
7
8
  /**
8
9
  * @exampleComponent limel-example-picker-basic
9
10
  * @exampleComponent limel-example-picker-multiple
11
+ * @exampleComponent limel-example-picker-non-removable
10
12
  * @exampleComponent limel-example-picker-icons
11
13
  * @exampleComponent limel-example-picker-pictures
12
14
  * @exampleComponent limel-example-picker-value-as-object
13
15
  * @exampleComponent limel-example-picker-value-as-object-with-actions
14
16
  * @exampleComponent limel-example-picker-empty-suggestions
17
+ * @exampleComponent limel-example-picker-empty-result-message
15
18
  * @exampleComponent limel-example-picker-leading-icon
16
19
  * @exampleComponent limel-example-picker-static-actions
17
20
  * @exampleComponent limel-example-picker-sections
@@ -44,9 +47,22 @@ export declare class Picker {
44
47
  */
45
48
  leadingIcon: IconName;
46
49
  /**
47
- * A message to display when the search returned an empty result
50
+ * A message to display when the search returned an empty result.
51
+ *
52
+ * If unset (or set to an empty string), the picker shows a
53
+ * default translated message (`No results matching "X"` in
54
+ * English, where `X` is the current query) chosen by the
55
+ * `language` prop. Set this to override the default with custom
56
+ * text — for example, when the picker's domain calls for more
57
+ * specific wording like "No matching participants found".
48
58
  */
49
59
  emptyResultMessage: string;
60
+ /**
61
+ * Defines the language for translations. Affects the labels
62
+ * rendered by the picker itself, such as the "Results matching"
63
+ * header shown above the suggestion list while the user is typing.
64
+ */
65
+ language: Languages;
50
66
  /**
51
67
  * True if the control requires a value
52
68
  */
@@ -59,7 +75,7 @@ export declare class Picker {
59
75
  /**
60
76
  * Currently selected value or values. Where the value can be an object.
61
77
  */
62
- value: ListItem<PickerValue> | Array<ListItem<PickerValue>>;
78
+ value: PickerItem | PickerItem[];
63
79
  /**
64
80
  * A search function that takes a search-string as an argument,
65
81
  * and returns a promise that will eventually be resolved with
@@ -79,7 +95,7 @@ export declare class Picker {
79
95
  * than 20 items, but if there are more than 20 items, the rest can be
80
96
  * found by typing more characters in the search field.
81
97
  */
82
- allItems?: Array<ListItem<PickerValue>>;
98
+ allItems?: PickerItem[];
83
99
  /**
84
100
  * True if multiple values are allowed
85
101
  */
@@ -204,14 +220,27 @@ export declare class Picker {
204
220
  * @param event - event
205
221
  */
206
222
  private handleInputKeyDown;
223
+ private handleSearchResult;
224
+ private hasPickableItems;
225
+ private prependSearchHeader;
226
+ private handleCloseMenu;
207
227
  /**
208
- * Key handler for the dropdown
228
+ * Shared prelude for any flow that ends the current search session:
229
+ * wipe the chip-set's visible text, reset the picker's `textValue`,
230
+ * and cancel any in-flight debounced search.
209
231
  *
210
- * @param event - event
232
+ * Used by `clearInputField` (which then drops the dropdown
233
+ * entirely) and `resetSearchToDefault` (which re-runs the searcher
234
+ * with an empty query to repopulate the dropdown with defaults).
211
235
  */
212
- private handleDropdownKeyDown;
213
- private handleSearchResult;
214
- private handleCloseMenu;
236
+ private clearTextValue;
215
237
  private clearInputField;
238
+ private resetSearchToDefault;
239
+ /**
240
+ * Two-stage Esc: first press clears the typed query but keeps the
241
+ * dropdown open showing the default suggestions; a second press
242
+ * (with the query already empty) closes the dropdown.
243
+ */
244
+ private handleEscape;
216
245
  }
217
246
  //# sourceMappingURL=picker.d.ts.map
@@ -1,13 +1,13 @@
1
- import { ListItem } from '../list-item/list-item.types';
2
1
  import { ListSeparator } from '../../global/shared-types/separator.types';
2
+ import { PickerItem } from './picker-item.types';
3
3
  /**
4
4
  * A search function that takes a search-string as an argument, and returns
5
- * a promise that will eventually be resolved with an array of `ListItem`:s.
5
+ * a promise that will eventually be resolved with an array of `PickerItem`:s.
6
6
  *
7
7
  * @param query - A search query. Typically what the user has written
8
8
  * in the input field of a limel-picker.
9
9
  * @returns The search result.
10
10
  * @public
11
11
  */
12
- export type Searcher = (query: string) => Promise<Array<ListItem | ListSeparator>>;
12
+ export type Searcher = (query: string) => Promise<Array<PickerItem | ListSeparator>>;
13
13
  //# sourceMappingURL=searcher.types.d.ts.map
@@ -36,7 +36,7 @@ import { InfoTileProgress } from "./components/info-tile/info-tile.types";
36
36
  import { InputType } from "./components/input-field/input-field.types";
37
37
  import { ListType } from "./components/list/list.types";
38
38
  import { CustomElementDefinition } from "./global/shared-types/custom-element.types";
39
- import { PickerValue } from "./components/picker/value.types";
39
+ import { PickerItem } from "./components/picker/picker-item.types";
40
40
  import { Searcher } from "./components/picker/searcher.types";
41
41
  import { ActionPosition, ActionScrollBehavior } from "./components/picker/actions.types";
42
42
  import { ResizeOptions } from "./util/image-resize";
@@ -80,7 +80,7 @@ export { InfoTileProgress } from "./components/info-tile/info-tile.types";
80
80
  export { InputType } from "./components/input-field/input-field.types";
81
81
  export { ListType } from "./components/list/list.types";
82
82
  export { CustomElementDefinition } from "./global/shared-types/custom-element.types";
83
- export { PickerValue } from "./components/picker/value.types";
83
+ export { PickerItem } from "./components/picker/picker-item.types";
84
84
  export { Searcher } from "./components/picker/searcher.types";
85
85
  export { ActionPosition, ActionScrollBehavior } from "./components/picker/actions.types";
86
86
  export { ResizeOptions } from "./util/image-resize";
@@ -845,6 +845,11 @@ export namespace Components {
845
845
  * @default true
846
846
  */
847
847
  "emptyInputOnBlur": boolean;
848
+ /**
849
+ * Whether the input field should be emptied when the set of chips changes (i.e. when the `value` prop is updated — a chip is added, removed, or the array is replaced). Defaults to `true`, which is the right behavior for a standalone input chip-set where the typed text *becomes* the next chip on <kbd>Enter</kbd>. The input is then cleared to make room for the next chip, and help user type a new keyword from scratch. Set to `false` when the input represents a search query over an external suggestion list (as in `limel-picker`), so the typed keyword survives while chips are added or removed (when user selects items from the search results list, while it is open).
850
+ * @default true
851
+ */
852
+ "emptyInputOnChange": boolean;
848
853
  /**
849
854
  * Used to find out whether the chip-set is in edit mode.
850
855
  * @returns `true` if the chip-set is in edit mode, `false` otherwise.
@@ -2750,11 +2755,13 @@ export namespace Components {
2750
2755
  /**
2751
2756
  * @exampleComponent limel-example-picker-basic
2752
2757
  * @exampleComponent limel-example-picker-multiple
2758
+ * @exampleComponent limel-example-picker-non-removable
2753
2759
  * @exampleComponent limel-example-picker-icons
2754
2760
  * @exampleComponent limel-example-picker-pictures
2755
2761
  * @exampleComponent limel-example-picker-value-as-object
2756
2762
  * @exampleComponent limel-example-picker-value-as-object-with-actions
2757
2763
  * @exampleComponent limel-example-picker-empty-suggestions
2764
+ * @exampleComponent limel-example-picker-empty-result-message
2758
2765
  * @exampleComponent limel-example-picker-leading-icon
2759
2766
  * @exampleComponent limel-example-picker-static-actions
2760
2767
  * @exampleComponent limel-example-picker-sections
@@ -2780,7 +2787,7 @@ export namespace Components {
2780
2787
  * Only used if no `searcher` is provided. The picker will then use a default search function that filters the `allItems` based on the `text` and `secondaryText` properties of the items. This way, custom search functions are typically only needed when the search is done on the server. For performance reasons, the default searcher will never return more than 20 items, but if there are more than 20 items, the rest can be found by typing more characters in the search field.
2781
2788
  * @default []
2782
2789
  */
2783
- "allItems"?: Array<ListItem<PickerValue>>;
2790
+ "allItems"?: PickerItem[];
2784
2791
  /**
2785
2792
  * Whether badge icons should be used in the result list or not
2786
2793
  * @default false
@@ -2797,7 +2804,7 @@ export namespace Components {
2797
2804
  */
2798
2805
  "disabled": boolean;
2799
2806
  /**
2800
- * A message to display when the search returned an empty result
2807
+ * A message to display when the search returned an empty result. If unset (or set to an empty string), the picker shows a default translated message (`No results matching "X"` in English, where `X` is the current query) chosen by the `language` prop. Set this to override the default with custom text — for example, when the picker's domain calls for more specific wording like "No matching participants found".
2801
2808
  */
2802
2809
  "emptyResultMessage": string;
2803
2810
  /**
@@ -2813,6 +2820,11 @@ export namespace Components {
2813
2820
  * Text to display for the input field of the picker
2814
2821
  */
2815
2822
  "label": string;
2823
+ /**
2824
+ * Defines the language for translations. Affects the labels rendered by the picker itself, such as the "Results matching" header shown above the suggestion list while the user is typing.
2825
+ * @default 'en'
2826
+ */
2827
+ "language": Languages;
2816
2828
  /**
2817
2829
  * Leading icon to show to the far left in the text field
2818
2830
  */
@@ -2843,7 +2855,7 @@ export namespace Components {
2843
2855
  /**
2844
2856
  * Currently selected value or values. Where the value can be an object.
2845
2857
  */
2846
- "value": ListItem<PickerValue> | Array<ListItem<PickerValue>>;
2858
+ "value": PickerItem | PickerItem[];
2847
2859
  }
2848
2860
  /**
2849
2861
  * A popover is an impermanent layer that is displayed on top of other content
@@ -5703,18 +5715,20 @@ declare global {
5703
5715
  new (): HTMLLimelNotchedOutlineElement;
5704
5716
  };
5705
5717
  interface HTMLLimelPickerElementEventMap {
5706
- "change": ListItem<PickerValue> | Array<ListItem<PickerValue>>;
5707
- "interact": ListItem<PickerValue>;
5718
+ "change": PickerItem | PickerItem[];
5719
+ "interact": PickerItem;
5708
5720
  "action": Action;
5709
5721
  }
5710
5722
  /**
5711
5723
  * @exampleComponent limel-example-picker-basic
5712
5724
  * @exampleComponent limel-example-picker-multiple
5725
+ * @exampleComponent limel-example-picker-non-removable
5713
5726
  * @exampleComponent limel-example-picker-icons
5714
5727
  * @exampleComponent limel-example-picker-pictures
5715
5728
  * @exampleComponent limel-example-picker-value-as-object
5716
5729
  * @exampleComponent limel-example-picker-value-as-object-with-actions
5717
5730
  * @exampleComponent limel-example-picker-empty-suggestions
5731
+ * @exampleComponent limel-example-picker-empty-result-message
5718
5732
  * @exampleComponent limel-example-picker-leading-icon
5719
5733
  * @exampleComponent limel-example-picker-static-actions
5720
5734
  * @exampleComponent limel-example-picker-sections
@@ -7287,6 +7301,11 @@ declare namespace LocalJSX {
7287
7301
  * @default true
7288
7302
  */
7289
7303
  "emptyInputOnBlur"?: boolean;
7304
+ /**
7305
+ * Whether the input field should be emptied when the set of chips changes (i.e. when the `value` prop is updated — a chip is added, removed, or the array is replaced). Defaults to `true`, which is the right behavior for a standalone input chip-set where the typed text *becomes* the next chip on <kbd>Enter</kbd>. The input is then cleared to make room for the next chip, and help user type a new keyword from scratch. Set to `false` when the input represents a search query over an external suggestion list (as in `limel-picker`), so the typed keyword survives while chips are added or removed (when user selects items from the search results list, while it is open).
7306
+ * @default true
7307
+ */
7308
+ "emptyInputOnChange"?: boolean;
7290
7309
  /**
7291
7310
  * Optional helper text to display below the chipset. When type is `input`, the helper text is displayed below the input field when it has focus. When type is not `input`, the helper text is always displayed if the device is touch screen; otherwise it is shown when chip-set is hovered or focused using keyboard navigation.
7292
7311
  */
@@ -9325,11 +9344,13 @@ declare namespace LocalJSX {
9325
9344
  /**
9326
9345
  * @exampleComponent limel-example-picker-basic
9327
9346
  * @exampleComponent limel-example-picker-multiple
9347
+ * @exampleComponent limel-example-picker-non-removable
9328
9348
  * @exampleComponent limel-example-picker-icons
9329
9349
  * @exampleComponent limel-example-picker-pictures
9330
9350
  * @exampleComponent limel-example-picker-value-as-object
9331
9351
  * @exampleComponent limel-example-picker-value-as-object-with-actions
9332
9352
  * @exampleComponent limel-example-picker-empty-suggestions
9353
+ * @exampleComponent limel-example-picker-empty-result-message
9333
9354
  * @exampleComponent limel-example-picker-leading-icon
9334
9355
  * @exampleComponent limel-example-picker-static-actions
9335
9356
  * @exampleComponent limel-example-picker-sections
@@ -9355,7 +9376,7 @@ declare namespace LocalJSX {
9355
9376
  * Only used if no `searcher` is provided. The picker will then use a default search function that filters the `allItems` based on the `text` and `secondaryText` properties of the items. This way, custom search functions are typically only needed when the search is done on the server. For performance reasons, the default searcher will never return more than 20 items, but if there are more than 20 items, the rest can be found by typing more characters in the search field.
9356
9377
  * @default []
9357
9378
  */
9358
- "allItems"?: Array<ListItem<PickerValue>>;
9379
+ "allItems"?: PickerItem[];
9359
9380
  /**
9360
9381
  * Whether badge icons should be used in the result list or not
9361
9382
  * @default false
@@ -9372,7 +9393,7 @@ declare namespace LocalJSX {
9372
9393
  */
9373
9394
  "disabled"?: boolean;
9374
9395
  /**
9375
- * A message to display when the search returned an empty result
9396
+ * A message to display when the search returned an empty result. If unset (or set to an empty string), the picker shows a default translated message (`No results matching "X"` in English, where `X` is the current query) chosen by the `language` prop. Set this to override the default with custom text — for example, when the picker's domain calls for more specific wording like "No matching participants found".
9376
9397
  */
9377
9398
  "emptyResultMessage"?: string;
9378
9399
  /**
@@ -9388,6 +9409,11 @@ declare namespace LocalJSX {
9388
9409
  * Text to display for the input field of the picker
9389
9410
  */
9390
9411
  "label"?: string;
9412
+ /**
9413
+ * Defines the language for translations. Affects the labels rendered by the picker itself, such as the "Results matching" header shown above the suggestion list while the user is typing.
9414
+ * @default 'en'
9415
+ */
9416
+ "language"?: Languages;
9391
9417
  /**
9392
9418
  * Leading icon to show to the far left in the text field
9393
9419
  */
@@ -9404,11 +9430,11 @@ declare namespace LocalJSX {
9404
9430
  /**
9405
9431
  * Fired when a new value has been selected from the picker
9406
9432
  */
9407
- "onChange"?: (event: LimelPickerCustomEvent<ListItem<PickerValue> | Array<ListItem<PickerValue>>>) => void;
9433
+ "onChange"?: (event: LimelPickerCustomEvent<PickerItem | PickerItem[]>) => void;
9408
9434
  /**
9409
9435
  * Fired when clicking on a selected value
9410
9436
  */
9411
- "onInteract"?: (event: LimelPickerCustomEvent<ListItem<PickerValue>>) => void;
9437
+ "onInteract"?: (event: LimelPickerCustomEvent<PickerItem>) => void;
9412
9438
  /**
9413
9439
  * Set to `true` to disable adding and removing items, but allow interaction with existing items.
9414
9440
  * @default false
@@ -9430,7 +9456,7 @@ declare namespace LocalJSX {
9430
9456
  /**
9431
9457
  * Currently selected value or values. Where the value can be an object.
9432
9458
  */
9433
- "value"?: ListItem<PickerValue> | Array<ListItem<PickerValue>>;
9459
+ "value"?: PickerItem | PickerItem[];
9434
9460
  }
9435
9461
  /**
9436
9462
  * A popover is an impermanent layer that is displayed on top of other content
@@ -10784,6 +10810,7 @@ declare namespace LocalJSX {
10784
10810
  "required": boolean;
10785
10811
  "searchLabel": string;
10786
10812
  "emptyInputOnBlur": boolean;
10813
+ "emptyInputOnChange": boolean;
10787
10814
  "clearAllButton": boolean;
10788
10815
  "leadingIcon": IconName;
10789
10816
  "delimiter": string;
@@ -11091,6 +11118,7 @@ declare namespace LocalJSX {
11091
11118
  "helperText": string;
11092
11119
  "leadingIcon": IconName;
11093
11120
  "emptyResultMessage": string;
11121
+ "language": Languages;
11094
11122
  "required": boolean;
11095
11123
  "invalid": boolean;
11096
11124
  "multiple": boolean;
@@ -12302,11 +12330,13 @@ declare module "@stencil/core" {
12302
12330
  /**
12303
12331
  * @exampleComponent limel-example-picker-basic
12304
12332
  * @exampleComponent limel-example-picker-multiple
12333
+ * @exampleComponent limel-example-picker-non-removable
12305
12334
  * @exampleComponent limel-example-picker-icons
12306
12335
  * @exampleComponent limel-example-picker-pictures
12307
12336
  * @exampleComponent limel-example-picker-value-as-object
12308
12337
  * @exampleComponent limel-example-picker-value-as-object-with-actions
12309
12338
  * @exampleComponent limel-example-picker-empty-suggestions
12339
+ * @exampleComponent limel-example-picker-empty-result-message
12310
12340
  * @exampleComponent limel-example-picker-leading-icon
12311
12341
  * @exampleComponent limel-example-picker-static-actions
12312
12342
  * @exampleComponent limel-example-picker-sections
@@ -28,6 +28,7 @@ export * from './components/dynamic-label/label.types';
28
28
  export * from './components/list/list.types';
29
29
  export * from './components/menu/menu.types';
30
30
  export * from './components/picker/actions.types';
31
+ export * from './components/picker/picker-item.types';
31
32
  export * from './components/picker/searcher.types';
32
33
  export * from './components/picker/value.types';
33
34
  export * from './components/progress-flow/progress-flow.types';
@@ -102,6 +102,8 @@ declare const _default: {
102
102
  'profile-picture.remove': string;
103
103
  'profile-picture.unsupported-preview.title': string;
104
104
  'profile-picture.unsupported-preview.description': string;
105
+ 'picker.results-matching': string;
106
+ 'picker.no-matching-results': string;
105
107
  };
106
108
  export default _default;
107
109
  //# sourceMappingURL=da.d.ts.map
@@ -102,6 +102,8 @@ declare const _default: {
102
102
  'profile-picture.remove': string;
103
103
  'profile-picture.unsupported-preview.title': string;
104
104
  'profile-picture.unsupported-preview.description': string;
105
+ 'picker.results-matching': string;
106
+ 'picker.no-matching-results': string;
105
107
  };
106
108
  export default _default;
107
109
  //# sourceMappingURL=de.d.ts.map
@@ -102,6 +102,8 @@ declare const _default: {
102
102
  'profile-picture.remove': string;
103
103
  'profile-picture.unsupported-preview.title': string;
104
104
  'profile-picture.unsupported-preview.description': string;
105
+ 'picker.results-matching': string;
106
+ 'picker.no-matching-results': string;
105
107
  };
106
108
  export default _default;
107
109
  //# sourceMappingURL=en.d.ts.map
@@ -102,6 +102,8 @@ declare const _default: {
102
102
  'profile-picture.remove': string;
103
103
  'profile-picture.unsupported-preview.title': string;
104
104
  'profile-picture.unsupported-preview.description': string;
105
+ 'picker.results-matching': string;
106
+ 'picker.no-matching-results': string;
105
107
  };
106
108
  export default _default;
107
109
  //# sourceMappingURL=fi.d.ts.map
@@ -102,6 +102,8 @@ declare const _default: {
102
102
  'profile-picture.remove': string;
103
103
  'profile-picture.unsupported-preview.title': string;
104
104
  'profile-picture.unsupported-preview.description': string;
105
+ 'picker.results-matching': string;
106
+ 'picker.no-matching-results': string;
105
107
  };
106
108
  export default _default;
107
109
  //# sourceMappingURL=fr.d.ts.map
@@ -102,6 +102,8 @@ declare const _default: {
102
102
  'profile-picture.remove': string;
103
103
  'profile-picture.unsupported-preview.title': string;
104
104
  'profile-picture.unsupported-preview.description': string;
105
+ 'picker.results-matching': string;
106
+ 'picker.no-matching-results': string;
105
107
  };
106
108
  export default _default;
107
109
  //# sourceMappingURL=nl.d.ts.map
@@ -102,6 +102,8 @@ declare const _default: {
102
102
  'profile-picture.remove': string;
103
103
  'profile-picture.unsupported-preview.title': string;
104
104
  'profile-picture.unsupported-preview.description': string;
105
+ 'picker.results-matching': string;
106
+ 'picker.no-matching-results': string;
105
107
  };
106
108
  export default _default;
107
109
  //# sourceMappingURL=no.d.ts.map
@@ -102,6 +102,8 @@ declare const _default: {
102
102
  'profile-picture.remove': string;
103
103
  'profile-picture.unsupported-preview.title': string;
104
104
  'profile-picture.unsupported-preview.description': string;
105
+ 'picker.results-matching': string;
106
+ 'picker.no-matching-results': string;
105
107
  };
106
108
  export default _default;
107
109
  //# sourceMappingURL=sv.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@limetech/lime-elements",
3
- "version": "39.25.0",
3
+ "version": "39.27.0",
4
4
  "description": "Lime Elements",
5
5
  "author": "Lime Technologies",
6
6
  "license": "Apache-2.0",
@@ -1 +0,0 @@
1
- import{r as t,c as i,h as s,a as e}from"./p-DBTJNfo7.js";import{i as h}from"./p-B9Ofc5RB.js";import{T as n,E as o,a as r,A as l,b as a}from"./p-rI0IeKpx.js";import{c}from"./p-JbKhhoXs.js";import{a as d,g as p}from"./p-CgNJbSP4.js";import{d as u}from"./p-BviYUVSD.js";import"./p-BJQylLSL.js";import"./p-D6dCQvwl.js";import"./p-BOEi1C7r.js";import"./p-oiMYqRQ0.js";const m=class{constructor(s){t(this,s),this.change=i(this,"change"),this.interact=i(this,"interact"),this.action=i(this,"action"),this.disabled=!1,this.readonly=!1,this.required=!1,this.invalid=!1,this.allItems=[],this.multiple=!1,this.delimiter=null,this.actions=[],this.actionPosition="bottom",this.actionScrollBehavior="sticky",this.badgeIcons=!1,this.textValue="",this.loading=!1,this.chips=[],this.chipSetEditMode=!1,this.getValueId=t=>{const i=t.value;return i&&"object"==typeof i?i.id:i},this.createChips=t=>t?this.multiple?t.map(this.createChip):[this.createChip(t)]:[],this.createChip=t=>{const i=p(t.icon),s=d(t.icon,t.iconColor);return{id:`${this.getValueId(t)}`,text:t.text,removable:!0,icon:i?{name:i,color:s}:void 0,image:t.image,value:t,menuItems:t.actions}},this.search=async t=>{const i=setTimeout((()=>{this.loading=!0})),s=this.searcher||this.defaultSearcher,e=await s(this.textValue);clearTimeout(i),this.handleSearchResult(t,e)},this.defaultSearcher=async t=>""===t?this.allItems.slice(0,20):this.allItems.filter((i=>{let s=i.text.toLowerCase();return i.secondaryText&&(s=s+" "+i.secondaryText.toLowerCase()),s.includes(t.toLowerCase())})).slice(0,20),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.handleCloseMenu=this.handleCloseMenu.bind(this),this.onListKeyDown=this.onListKeyDown.bind(this),this.portalId=c(),this.debouncedSearch=u(this.search,300)}componentWillLoad(){this.chips=this.createChips(this.value)}componentDidLoad(){this.chipSet=this.host.shadowRoot.querySelector("limel-chip-set"),this.updateTabIndex()}disconnectedCallback(){this.debouncedSearch.cancel()}onDisabledChange(){this.updateTabIndex()}updateTabIndex(){this.host.setAttribute("tabindex",this.disabled||this.readonly?"-1":"0")}async componentWillUpdate(){this.chipSetEditMode=!1,this.chipSet&&(this.chipSetEditMode=await this.chipSet.getEditMode())}render(){const t={};return this.multiple||(t.maxItems=1),[s("limel-chip-set",Object.assign({key:"92d3884770f8e3ce3c747044ab9e6061bc595b1a",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:!1,clearAllButton:this.multiple&&!this.chipSetEditMode},t)),this.renderDropdown()]}onChangeValue(){this.chips=this.createChips(this.value)}renderDelimiter(){return this.multiple?this.delimiter:null}renderDropdown(){const t=this.getDropdownContent(),i=[];if(this.shouldShowDropDownContent()){const s=this.getActionContent();"top"===this.actionPosition&&i.push(s),t&&i.push(t),"bottom"===this.actionPosition&&i.push(s)}return this.renderPortal(i)}getActionContent(){var t,i;return 0===(null!==(i=null===(t=this.actions)||void 0===t?void 0:t.length)&&void 0!==i?i:0)?null:[s("limel-list",{class:{"static-actions-list":!0,"is-on-top":"top"===this.actionPosition,"is-at-bottom":"bottom"===this.actionPosition,"has-position-sticky":"sticky"===this.actionScrollBehavior},badgeIcons:!0,type:"selectable",onChange:this.handleActionListChange,items:this.actions.map(this.removeUnusedPropertiesOnAction)})]}removeUnusedPropertiesOnAction(t){return Object.assign(Object.assign({},t),{actions:[]})}shouldShowDropDownContent(){return!this.isFull()&&!!this.chipSetEditMode}getDropdownContent(){var t;if(this.shouldShowDropDownContent())return this.loading?this.renderSpinner():(null===(t=this.items)||void 0===t?void 0:t.length)?this.renderListResult():this.renderEmptyMessage()}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:!1}))}renderEmptyMessage(){if(this.emptyResultMessage)return s("p",{style:{color:"rgb(var(--contrast-1100))","text-align":"center",margin:"0.5rem 1rem"}},this.emptyResultMessage)}renderListResult(){return s("limel-list",{badgeIcons:this.badgeIcons,onChange:this.handleListChange,onKeyDown:this.onListKeyDown,type:"selectable",items:this.items})}onListKeyDown(t){[n,o,r].includes(t.key)&&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:!0,containerStyle:{"z-index":i}},s("limel-menu-surface",{open:t.length>0,allowClicksElement:this.host,style:{"--menu-surface-width":"100%","max-height":"inherit",display:"flex"},onDismiss:this.handleCloseMenu},t))}handleStopEditAndBlur(){const t=this.host.shadowRoot.activeElement||document.activeElement,i=document.querySelector(`#${this.portalId}`);h(t,this.host)||h(t,i)||this.clearInputField()}async handleTextInput(t){t.stopPropagation();const i=t.detail;this.textValue=i,this.debouncedSearch(i),""===i&&this.debouncedSearch.flush()}handleListChange(t){var i;if(t.stopPropagation(),!this.value||this.value!==t.detail){let i=t.detail;this.multiple&&(i=[...this.value,t.detail]),this.change.emit(i),this.items=[]}this.multiple&&(this.textValue="",null===(i=this.chipSet)||void 0===i||i.setFocus(!0))}handleActionListChange(t){t.stopPropagation(),t.detail&&(this.action.emit(t.detail.value),this.items=[])}handleInputFieldFocus(){this.debouncedSearch(this.textValue)}handleChange(t){t.stopPropagation(),this.textValue="";let i=null;this.multiple&&(i=t.detail.map((t=>this.value.find((i=>`${this.getValueId(i)}`===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===n&&!t.altKey&&!t.metaKey&&!t.shiftKey,s=t.key===l,e=t.key===a;if(!i&&!s&&!e)return;const h=document.querySelector(` #${this.portalId} limel-list`);if(h){if(i||e){const i=h.shadowRoot.querySelector(".mdc-deprecated-list-item");if(!i)return;return t.preventDefault(),void i.focus()}if(s){const i=[...h.shadowRoot.querySelectorAll(".mdc-deprecated-list-item")].at(-1);if(!i)return;t.preventDefault(),i.focus()}}}handleDropdownKeyDown(t){t.key===o&&(t.preventDefault(),this.textValue="",this.chipSet.setFocus(!0))}handleSearchResult(t,i){if(t===this.textValue){if(this.items=i,this.multiple){const t=this.value;this.items=i.filter((i=>!t.includes(i)))}this.loading=!1}}handleCloseMenu(){this.items.length>0||this.clearInputField()}clearInputField(){this.chipSet.emptyInput(),this.textValue="",this.handleSearchResult("",[]),this.debouncedSearch.cancel()}static get delegatesFocus(){return!0}get host(){return e(this)}static get watchers(){return{disabled:[{onDisabledChange:0}],value:[{onChangeValue:0}]}}};m.style=":host{position:relative;display:block}:host([hidden]){display:none}";export{m as limel_picker}