@ironsource/shared-ui 2.1.6-rc.4 → 2.1.6-rc.40

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 (149) hide show
  1. package/Alert.vue_vue_type_style_index_0_scoped_a9f0dfcc_lang.css +1 -0
  2. package/AppDropdownTrigger.vue_vue_type_style_index_0_scoped_858cefbf_lang.css +1 -0
  3. package/AppHeader.vue_vue_type_style_index_0_scoped_538ccdc6_lang.css +1 -0
  4. package/Autocomplete.vue_vue_type_style_index_0_scoped_a7bfd237_lang.css +1 -0
  5. package/ChipDropdownTrigger.vue_vue_type_style_index_0_scoped_a8fdae89_lang.css +1 -0
  6. package/ChipV4.vue_vue_type_style_index_0_scoped_12c0f396_lang.css +1 -0
  7. package/DataGrid.vue_vue_type_style_index_0_scoped_057abdf5_lang.css +1 -0
  8. package/DefaultDropdownTrigger.vue_vue_type_style_index_0_scoped_0345d6b1_lang.css +1 -0
  9. package/DialogV4.vue_vue_type_style_index_0_scoped_09c488cf_lang.css +1 -0
  10. package/Dropdown.vue_vue_type_style_index_0_scoped_aaa8c4bb_lang.css +1 -0
  11. package/DropdownV4.vue_vue_type_style_index_0_scoped_7af4f288_lang.css +1 -0
  12. package/FieldLabel.vue_vue_type_style_index_0_scoped_96ee1c98_lang.css +1 -0
  13. package/FoldableSection.vue_vue_type_style_index_0_scoped_1a5f0e2e_lang.css +1 -0
  14. package/{FormCard.vue_vue_type_style_index_0_scoped_ef8b4e81_lang.css → FormCard.vue_vue_type_style_index_0_scoped_52ade67c_lang.css} +1 -1
  15. package/HelpIcon.vue_vue_type_style_index_0_scoped_06fce2e3_lang.css +1 -0
  16. package/IconV4.vue_vue_type_style_index_0_scoped_9d3c9cda_lang.css +1 -0
  17. package/InlineCopy.vue_vue_type_style_index_0_scoped_893a203c_lang.css +1 -0
  18. package/OptionV4.vue_vue_type_style_index_0_scoped_9db0f796_lang.css +1 -0
  19. package/TextAreaV4.vue_vue_type_style_index_0_scoped_f3b2c01d_lang.css +1 -0
  20. package/TextField.vue_vue_type_style_index_0_scoped_a6457440_lang.css +1 -0
  21. package/ToggleV4.vue_vue_type_style_index_0_scoped_a4aa32fb_lang.css +1 -0
  22. package/TooltipV4.vue_vue_type_style_index_0_scoped_fcdb9d02_lang.css +1 -0
  23. package/TreeDropdown.vue_vue_type_style_index_0_scoped_142eab98_lang.css +1 -0
  24. package/components/alert/Alert.vue.d.ts +7 -0
  25. package/components/alert/Alert.vue.js +3 -3
  26. package/components/alert/Alert.vue2.js +44 -40
  27. package/components/alert/index.d.ts +27 -2
  28. package/components/appHeader/AppHeader.vue.d.ts +6 -2
  29. package/components/appHeader/AppHeader.vue.js +2 -2
  30. package/components/appHeader/AppHeader.vue2.js +30 -28
  31. package/components/appHeader/index.d.ts +6 -2
  32. package/components/autocomplete/Autocomplete.vue.d.ts +6 -0
  33. package/components/autocomplete/Autocomplete.vue.js +2 -2
  34. package/components/autocomplete/Autocomplete.vue2.js +45 -37
  35. package/components/autocomplete/index.d.ts +21 -1
  36. package/components/button/v4/ButtonV4.vue.d.ts +7 -7
  37. package/components/button/v4/IconButtonV4.vue.d.ts +4 -4
  38. package/components/button/v4/index.d.ts +61 -61
  39. package/components/chip/v4/Chip.types.d.ts +6 -0
  40. package/components/chip/v4/ChipV4.vue.d.ts +28 -35
  41. package/components/chip/v4/ChipV4.vue.js +3 -3
  42. package/components/chip/v4/ChipV4.vue2.js +28 -59
  43. package/components/chip/v4/index.d.ts +45 -148
  44. package/components/dialog/v3/Dialog.vue.d.ts +1 -1
  45. package/components/dialog/v3/index.d.ts +20 -20
  46. package/components/dialog/v4/DialogV4.vue.js +3 -3
  47. package/components/dialog/v4/DialogV4.vue2.js +67 -62
  48. package/components/dropdown/common/Dropdown.common.js +74 -69
  49. package/components/dropdown/common/Option.common.d.ts +1 -1
  50. package/components/dropdown/common/Option.common.js +9 -9
  51. package/components/dropdown/composables/useChildOptions.d.ts +7 -0
  52. package/components/dropdown/composables/useChildOptions.js +14 -0
  53. package/components/dropdown/v3/Dropdown.vue.d.ts +4 -0
  54. package/components/dropdown/v3/Dropdown.vue.js +4 -4
  55. package/components/dropdown/v3/Dropdown.vue2.js +32 -32
  56. package/components/dropdown/v3/index.d.ts +13 -1
  57. package/components/dropdown/v4/AppDropdownTrigger.vue.d.ts +16 -3
  58. package/components/dropdown/v4/AppDropdownTrigger.vue.js +3 -3
  59. package/components/dropdown/v4/AppDropdownTrigger.vue2.js +102 -61
  60. package/components/dropdown/v4/ChipDropdownTrigger.vue.js +2 -2
  61. package/components/dropdown/v4/ChipDropdownTrigger.vue2.js +1 -1
  62. package/components/dropdown/v4/DefaultDropdownTrigger.vue.d.ts +8 -3
  63. package/components/dropdown/v4/DefaultDropdownTrigger.vue.js +2 -2
  64. package/components/dropdown/v4/DefaultDropdownTrigger.vue2.js +22 -21
  65. package/components/dropdown/v4/DropdownV4.vue.d.ts +35 -3
  66. package/components/dropdown/v4/DropdownV4.vue.js +2 -2
  67. package/components/dropdown/v4/DropdownV4.vue2.js +127 -114
  68. package/components/dropdown/v4/OptionV4.vue.d.ts +14 -3
  69. package/components/dropdown/v4/OptionV4.vue.js +2 -2
  70. package/components/dropdown/v4/OptionV4.vue2.js +79 -56
  71. package/components/dropdown/v4/TreeDropdown.vue.d.ts +112 -0
  72. package/components/dropdown/v4/TreeDropdown.vue.js +7 -0
  73. package/components/dropdown/v4/TreeDropdown.vue2.js +122 -0
  74. package/components/dropdown/v4/dropdownStoryArgs.d.ts +1 -1
  75. package/components/dropdown/v4/index.d.ts +422 -38
  76. package/components/dropdown/v4/index.js +7 -4
  77. package/components/emptyState/v3/EmptyState.vue.d.ts +2 -2
  78. package/components/emptyState/v3/index.d.ts +47 -47
  79. package/components/emptyState/v4/EmptyStateV4.vue.d.ts +3 -3
  80. package/components/emptyState/v4/index.d.ts +7 -7
  81. package/components/forms/FormCard.vue.js +2 -2
  82. package/components/forms/FormCard.vue2.js +9 -9
  83. package/components/icon/v4/Icon.types.d.ts +1 -1
  84. package/components/icon/v4/IconV4.vue.d.ts +16 -6
  85. package/components/icon/v4/IconV4.vue.js +4 -4
  86. package/components/icon/v4/IconV4.vue2.js +36 -33
  87. package/components/icon/v4/index.d.ts +53 -15
  88. package/components/inlineCopy/InlineCopy.vue.d.ts +6 -2
  89. package/components/inlineCopy/InlineCopy.vue.js +3 -3
  90. package/components/inlineCopy/InlineCopy.vue2.js +23 -22
  91. package/components/inlineCopy/index.d.ts +6 -2
  92. package/components/input/v4/TextField.vue.d.ts +5 -0
  93. package/components/input/v4/TextField.vue.js +3 -3
  94. package/components/input/v4/TextField.vue2.js +24 -21
  95. package/components/input/v4/index.d.ts +20 -1
  96. package/components/layout/FoldableSection.vue.js +5 -5
  97. package/components/layout/FoldableSection.vue2.js +1 -1
  98. package/components/multibar/MultiBarMenu.vue2.js +12 -11
  99. package/components/shared/FieldLabel.vue.js +3 -3
  100. package/components/shared/FieldLabel.vue2.js +9 -9
  101. package/components/snackbar/v4/SnackbarV4.vue.d.ts +20 -20
  102. package/components/table/common/Table.common.d.ts +1 -0
  103. package/components/table/common/Table.common.js +65 -61
  104. package/components/table/v4/DataGrid.vue.d.ts +9 -1
  105. package/components/table/v4/DataGrid.vue.js +3 -3
  106. package/components/table/v4/DataGrid.vue2.js +180 -176
  107. package/components/table/v4/DataGridMenu.vue2.js +3 -2
  108. package/components/table/v4/HelpIcon.vue.js +5 -5
  109. package/components/table/v4/HelpIcon.vue2.js +5 -5
  110. package/components/table/v4/index.d.ts +29 -5
  111. package/components/textArea/v4/TextAreaV4.vue.js +3 -3
  112. package/components/textArea/v4/TextAreaV4.vue2.js +1 -1
  113. package/components/toggle/v4/ToggleV4.vue.d.ts +1 -1
  114. package/components/toggle/v4/ToggleV4.vue.js +3 -3
  115. package/components/toggle/v4/ToggleV4.vue2.js +12 -12
  116. package/components/toggle/v4/index.d.ts +20 -20
  117. package/components/tooltip/v4/TooltipV4.vue.d.ts +6 -2
  118. package/components/tooltip/v4/TooltipV4.vue.js +2 -2
  119. package/components/tooltip/v4/TooltipV4.vue2.js +21 -19
  120. package/components/tooltip/v4/index.d.ts +17 -5
  121. package/composables/useFormValidation.js +19 -13
  122. package/design-foundation.stories/icons/iconsData.d.ts +5 -1
  123. package/index.d.ts +1451 -688
  124. package/mocks/apps.d.ts +1 -0
  125. package/mocks/options.d.ts +12 -0
  126. package/package.json +1 -1
  127. package/utils/text.d.ts +1 -0
  128. package/utils/text.js +9 -0
  129. package/Alert.vue_vue_type_style_index_0_scoped_d6680a72_lang.css +0 -1
  130. package/AppDropdownTrigger.vue_vue_type_style_index_0_scoped_0267d003_lang.css +0 -1
  131. package/AppHeader.vue_vue_type_style_index_0_scoped_c148fc7a_lang.css +0 -1
  132. package/Autocomplete.vue_vue_type_style_index_0_scoped_62faa8e0_lang.css +0 -1
  133. package/ChipDropdownTrigger.vue_vue_type_style_index_0_scoped_889042cf_lang.css +0 -1
  134. package/ChipV4.vue_vue_type_style_index_0_scoped_78d7c9c0_lang.css +0 -1
  135. package/DataGrid.vue_vue_type_style_index_0_scoped_c96fba2c_lang.css +0 -1
  136. package/DefaultDropdownTrigger.vue_vue_type_style_index_0_scoped_c9783327_lang.css +0 -1
  137. package/DialogV4.vue_vue_type_style_index_0_scoped_c3004ba3_lang.css +0 -1
  138. package/Dropdown.vue_vue_type_style_index_0_scoped_d4f8e790_lang.css +0 -1
  139. package/DropdownV4.vue_vue_type_style_index_0_scoped_0968078f_lang.css +0 -1
  140. package/FieldLabel.vue_vue_type_style_index_0_scoped_72ab1f25_lang.css +0 -1
  141. package/FoldableSection.vue_vue_type_style_index_0_scoped_8d0fd203_lang.css +0 -1
  142. package/HelpIcon.vue_vue_type_style_index_0_scoped_7a611779_lang.css +0 -1
  143. package/IconV4.vue_vue_type_style_index_0_scoped_a78f8a3e_lang.css +0 -1
  144. package/InlineCopy.vue_vue_type_style_index_0_scoped_ff9f4a0f_lang.css +0 -1
  145. package/OptionV4.vue_vue_type_style_index_0_scoped_b8375219_lang.css +0 -1
  146. package/TextAreaV4.vue_vue_type_style_index_0_scoped_8199b662_lang.css +0 -1
  147. package/TextField.vue_vue_type_style_index_0_scoped_07687bcc_lang.css +0 -1
  148. package/ToggleV4.vue_vue_type_style_index_0_scoped_ad231e8c_lang.css +0 -1
  149. package/TooltipV4.vue_vue_type_style_index_0_scoped_25809092_lang.css +0 -1
@@ -1,25 +1,25 @@
1
- import { useToggle as me } from "../../../composables/useToggle.js";
2
- import { ref as n, computed as r, watch as m, useSlots as Pe, toRaw as A, nextTick as D, provide as Te, onMounted as we } from "vue";
1
+ import { useToggle as we } from "../../../composables/useToggle.js";
2
+ import { ref as n, computed as r, watch as m, useSlots as Ie, toRaw as O, nextTick as C, provide as xe, onMounted as De } from "vue";
3
3
  import { isObjectInArray as W } from "../../../utils/array.js";
4
- import { objectsEqual as xe } from "../../../utils/object.js";
5
- import { useClamp as Ie, useVirtualList as De, onClickOutside as Y } from "@vueuse/core";
6
- import { Mode as O, Type as _, DropdownContext as Ne } from "./DropdownContext.js";
7
- import { pxToRem as Re } from "../../../utils/style.js";
8
- import { useEditableContext as Ee } from "../../table-cells/common/EditableContext.js";
9
- const Ue = (l, P, b) => {
10
- const Z = (e, t) => l.multi ? W(e, t) : A(e) === t;
11
- let k;
4
+ import { objectsEqual as Ce } from "../../../utils/object.js";
5
+ import { useClamp as Ne, useVirtualList as Re, onClickOutside as Y } from "@vueuse/core";
6
+ import { Mode as P, Type as V, DropdownContext as Ee } from "./DropdownContext.js";
7
+ import { pxToRem as Me } from "../../../utils/style.js";
8
+ import { useEditableContext as Ve } from "../../table-cells/common/EditableContext.js";
9
+ const Ke = (l, A, b) => {
10
+ const Z = (e, t) => l.multi ? W(e, t) : O(e) === t;
11
+ let _;
12
12
  ((e) => {
13
13
  e[e.None = 0] = "None", e[e.Next = 1] = "Next", e[e.Previous = -1] = "Previous", e[e.NextPage = 10] = "NextPage", e[e.PrevPage = -10] = "PrevPage";
14
- })(k || (k = {}));
14
+ })(_ || (_ = {}));
15
15
  const a = n(
16
16
  l.selected
17
- ), N = Ee(), u = r({
17
+ ), N = Ve(), u = r({
18
18
  get() {
19
19
  return N?.value?.value ?? a.value;
20
20
  },
21
21
  set(e) {
22
- N.onChange?.(e), N.onClose?.(), P("update:selected", e);
22
+ N.onChange?.(e), N.onClose?.(), A("update:selected", e);
23
23
  }
24
24
  });
25
25
  m(
@@ -28,7 +28,7 @@ const Ue = (l, P, b) => {
28
28
  a.value = l.selected, v.value = l.selected;
29
29
  }
30
30
  );
31
- const p = Pe(), T = n(null), g = n(null), V = n(null), R = n(null), H = n(null), w = n(null), F = n(), B = n(null), L = n(null), U = n(null), ee = 8, le = r(() => w.value ? w.value.getBoundingClientRect().height + ee + l.distance : 0), c = n([]), x = n(-1), I = n(""), v = n([]), q = () => w.value?.focus(), [d, te, ae] = me({
31
+ const F = Ie(), w = n(null), g = n(null), k = n(null), R = n(null), H = n(null), I = n(null), p = n(), B = n(null), L = n(null), U = n(null), ee = 8, le = r(() => I.value ? I.value.getBoundingClientRect().height + ee + l.distance : 0), c = n([]), x = n(-1), T = n(""), v = n(l.selected || []), q = () => I.value?.focus(), [d, te, ae] = we({
32
32
  disabled: l.disabled,
33
33
  initialValue: l.defaultOpen
34
34
  });
@@ -45,9 +45,9 @@ const Ue = (l, P, b) => {
45
45
  return l.isOpen;
46
46
  },
47
47
  set(e) {
48
- P("update:isOpen", e);
48
+ A("update:isOpen", e);
49
49
  }
50
- }), ne = r(() => s.value.length - 1), o = Ie(0, 0, ne), K = r(() => u.value ? l.displayValue(u.value) : ""), ie = (e) => {
50
+ }), ne = r(() => s.value.length - 1), o = Ne(0, 0, ne), K = r(() => u.value ? l.displayValue(u.value) : ""), ie = (e) => {
51
51
  if (!e.value.length && !l.multiOptionsPlaceholderPrefix && !l.multiOptionsPlaceholderSuffix)
52
52
  return l.placeholder;
53
53
  const t = !l.multiOptionsPlaceholderPrefix && !l.multiOptionsPlaceholderSuffix ? `${e.value.length} selected` : `${l.multiOptionsPlaceholderPrefix ?? ""}${e.value.length ?? "0"}${l.multiOptionsPlaceholderSuffix ?? ""}`;
@@ -61,29 +61,29 @@ const Ue = (l, P, b) => {
61
61
  if (Array.isArray(a.value))
62
62
  return a.value.length === s.value.length;
63
63
  }), oe = r(() => !l.multi || !Array.isArray(a.value) ? !1 : a.value.length > 0 && a.value.length < s.value.length), E = (e) => {
64
- I.value = e;
64
+ T.value = e;
65
65
  }, se = r(() => {
66
- const e = A(v.value), t = {
66
+ const e = O(v.value), t = {
67
67
  selected: [],
68
68
  notSelected: []
69
69
  };
70
- return A(l.options).forEach((y) => {
70
+ return O(l.options).forEach((y) => {
71
71
  const f = e.includes(y) ? "selected" : "notSelected";
72
72
  t[f].push(y);
73
73
  }), [].concat(t.selected, t.notSelected);
74
74
  }), s = r(() => {
75
75
  const e = Array.isArray(v.value) && l.multi && b.VERSION === 4 ? se.value : l.options;
76
- return l.onSearch ? e.filter((t) => l.onSearch(t, I.value)) : e;
77
- }), ce = r(() => c.value[0]?.hasSubtitle), X = r(() => i.mode === O.Multi), j = r(
76
+ return l.onSearch ? e.filter((t) => l.onSearch(t, T.value)) : e;
77
+ }), ce = r(() => c.value[0]?.hasSubtitle), X = r(() => i.mode === P.Multi), j = r(
78
78
  () => ce.value ? b.MULTILINE_LIST_HEIGHT : b.LIST_HEIGHT
79
79
  ), {
80
80
  list: z,
81
81
  containerProps: J,
82
82
  wrapperProps: ve,
83
- scrollTo: M
84
- } = De(s, {
83
+ scrollTo: D
84
+ } = Re(s, {
85
85
  itemHeight: j.value,
86
- overscan: 2
86
+ overscan: l.disableVirtualScroll ? 1 / 0 : 2
87
87
  });
88
88
  m(
89
89
  () => l.isOpen,
@@ -91,25 +91,27 @@ const Ue = (l, P, b) => {
91
91
  G(e);
92
92
  }
93
93
  ), m([x], async () => {
94
- await D();
94
+ await C();
95
95
  }), m(
96
96
  [d, o, x],
97
97
  async ([e], [t]) => {
98
- d.value && (await D(), x.value !== -1 && e !== t && setTimeout(() => {
99
- l.multi && b.VERSION === 4 || M(x.value);
98
+ d.value && (await C(), x.value !== -1 && e !== t && setTimeout(() => {
99
+ l.multi && b.VERSION === 4 || D(x.value);
100
100
  }), o.value && setTimeout(() => {
101
- M(o.value);
101
+ D(o.value);
102
102
  }));
103
103
  }
104
- );
104
+ ), m(T, () => {
105
+ D(0);
106
+ });
105
107
  const h = (e, t = !1) => {
106
- l.disabled || (G(e), D(() => {
107
- d.value && P("opened"), d.value || P("closed"), T.value && t && T.value.focus();
108
+ l.disabled || (G(e), C(() => {
109
+ d.value && A("opened"), d.value || A("closed"), w.value && t && w.value.focus();
108
110
  }));
109
111
  };
110
112
  m(d, (e) => {
111
113
  if (e) {
112
- X.value && Array.isArray(u.value) && (v.value = A(u.value).slice());
114
+ X.value && Array.isArray(u.value) && (v.value = O(u.value).slice());
113
115
  return;
114
116
  }
115
117
  q();
@@ -124,29 +126,29 @@ const Ue = (l, P, b) => {
124
126
  a.value = [];
125
127
  return;
126
128
  }
127
- a.value = s.value;
129
+ a.value = s.value, A("selectAll");
128
130
  }
129
131
  }, fe = () => {
130
132
  de(), b.VERSION !== 4 && (u.value = a.value);
131
133
  }, ge = (e = !0) => {
132
- a.value = [], e && (u.value = [], v.value = []);
133
- }, C = (e, t) => {
134
- if (e = A(e), c.value[t]?.disabled)
134
+ a.value = [], e && (u.value = [], v.value = []), A("clear");
135
+ }, M = (e, t) => {
136
+ if (e = O(e), c.value[t]?.disabled)
135
137
  return;
136
- if (x.value = t, i.mode !== O.Multi) {
138
+ if (x.value = t, i.mode !== P.Multi) {
137
139
  l.keepOpen || h(!1), i.goToOption(
138
140
  0
139
141
  /* None */
140
- ), u.value = e, E(""), q(), i.type === _.Search && g.value && (g.value.value = l.displayValue(e));
142
+ ), u.value = e, E(""), q(), i.type === V.Search && g.value && (g.value.value = l.displayValue(e));
141
143
  return;
142
144
  }
143
145
  if (!Array.isArray(a.value))
144
146
  return;
145
147
  g.value?.focus();
146
- const S = A(a.value);
148
+ const S = O(a.value);
147
149
  if (W(S, e)) {
148
150
  a.value = S.filter(
149
- (f) => !xe(f, e)
151
+ (f) => !Ce(f, e)
150
152
  );
151
153
  return;
152
154
  } else {
@@ -159,11 +161,11 @@ const Ue = (l, P, b) => {
159
161
  selectedOption: u,
160
162
  labelRef: H,
161
163
  activeOption: R,
162
- listRef: T,
164
+ listRef: w,
163
165
  clearable: l.clearable,
164
- type: p.input ? _.Search : _.Dropdown,
165
- mode: l.multi ? O.Multi : O.Single,
166
- query: I,
166
+ type: F.input ? V.Search : V.Dropdown,
167
+ mode: l.multi ? P.Multi : P.Single,
168
+ query: T,
167
169
  selectedValue: K,
168
170
  toggle: h,
169
171
  disabled: l.disabled,
@@ -171,9 +173,9 @@ const Ue = (l, P, b) => {
171
173
  mandatory: l.mandatory,
172
174
  size: l.size,
173
175
  placeholder: l.placeholder,
174
- select: C,
176
+ select: M,
175
177
  clearSelection: () => {
176
- E(""), u.value = i.mode === O.Single ? null : [], v.value = i.mode === O.Single ? null : [], g.value && (g.value.value = "");
178
+ E(""), u.value = i.mode === P.Single ? null : [], v.value = i.mode === P.Single ? null : [], g.value && (g.value.value = "");
177
179
  },
178
180
  search: E,
179
181
  goToOption: async (e) => {
@@ -204,14 +206,14 @@ const Ue = (l, P, b) => {
204
206
  c.value = c.value.filter((t) => t.id !== e);
205
207
  }
206
208
  };
207
- Te(Ne, i), Y(
208
- T,
209
+ xe(Ee, i), Y(
210
+ w,
209
211
  () => {
210
212
  d.value && Q();
211
213
  },
212
214
  {
213
215
  ignore: [
214
- w,
216
+ I,
215
217
  B,
216
218
  L,
217
219
  U,
@@ -223,15 +225,15 @@ const Ue = (l, P, b) => {
223
225
  const ye = () => {
224
226
  g.value && (g.value.value = i.query.value = "");
225
227
  };
226
- we(async () => {
227
- l.autoFocus && (await D(), setTimeout(() => {
228
- V.value.focus();
228
+ De(async () => {
229
+ l.autoFocus && (await C(), setTimeout(() => {
230
+ k.value.focus();
229
231
  })), i.goToOption(0);
230
232
  });
231
233
  const Se = () => {
232
- u.value = a.value, Array.isArray(u.value) && (v.value = A(u.value).slice()), P("apply", u.value), h(!1), ye();
234
+ u.value = a.value, Array.isArray(u.value) && (v.value = O(u.value).slice()), A("apply", u.value), h(!1), ye();
233
235
  }, Q = () => {
234
- X.value && Array.isArray(v.value) && (u.value = A(v.value).slice()), I.value = "", h(!1);
236
+ X.value && Array.isArray(v.value) && (u.value = O(v.value).slice()), T.value = "", h(!1);
235
237
  }, be = (e) => {
236
238
  if (!l.disableKeyboardEvents)
237
239
  switch (e.key) {
@@ -241,7 +243,7 @@ const Ue = (l, P, b) => {
241
243
  case "ArrowDown":
242
244
  h(!0), e.preventDefault();
243
245
  }
244
- }, Ae = (e) => {
246
+ }, Oe = (e) => {
245
247
  if (!l.disableKeyboardEvents)
246
248
  switch (e.key) {
247
249
  case "ArrowUp": {
@@ -281,28 +283,31 @@ const Ue = (l, P, b) => {
281
283
  h(!0);
282
284
  return;
283
285
  }
284
- C(s.value[o.value], o.value), i.mode === O.Single && !l.keepOpen && h(!1), e.preventDefault();
286
+ M(s.value[o.value], o.value), i.mode === P.Single && !l.keepOpen && h(!1), e.preventDefault();
285
287
  break;
286
288
  }
287
289
  }
288
- }, Oe = r(() => {
289
- const e = z.value.length, t = l.multi && l.showSelectAll ? 1 : 0, y = e > b.MAX_NUMBER_OF_OPTIONS, S = e + t;
290
+ }, Ae = r(() => {
291
+ const e = z.value.reduce((me, Pe) => {
292
+ const Te = l.overrideOptionCountCalculation ? l.overrideOptionCountCalculation(Pe.data) : 1;
293
+ return me + Te;
294
+ }, 0), t = l.multi && l.showSelectAll ? 1 : 0, y = e > b.MAX_NUMBER_OF_OPTIONS, S = e + t;
290
295
  let f = y ? b.MAX_NUMBER_OF_OPTIONS + 0.1 : S;
291
- return l.noResultsText && f === 0 && (f = f + 1), Re(
296
+ return l.noResultsText && f === 0 && (f = f + 1), Me(
292
297
  f * j.value + b.PADDING_PX
293
298
  );
294
299
  });
295
300
  return {
296
- onKeydown: Ae,
301
+ onKeydown: Oe,
297
302
  location: le,
298
303
  open: d,
299
304
  toggleMenu: h,
300
305
  onButtonKeydown: be,
301
306
  displayedValue: re,
302
307
  labelRef: H,
303
- query: I,
308
+ query: T,
304
309
  containerProps: J,
305
- calculateTableHeight: Oe,
310
+ calculateTableHeight: Ae,
306
311
  wrapperProps: ve,
307
312
  filteredOptions: s,
308
313
  allSelected: $,
@@ -313,22 +318,22 @@ const Ue = (l, P, b) => {
313
318
  selectedOption: u,
314
319
  selectedOptionPrevious: v,
315
320
  selectedValue: K,
316
- onSelect: C,
321
+ onSelect: M,
317
322
  activeIndex: o,
318
323
  onCancel: Q,
319
324
  onApply: Se,
320
- scrollTo: M,
325
+ scrollTo: D,
321
326
  onClickOutside: Y,
322
- listRef: T,
323
- buttonRef: w,
327
+ listRef: w,
328
+ buttonRef: I,
324
329
  apply: B,
325
330
  cancel: L,
326
- el: V,
327
- triggerRef: F,
331
+ el: k,
332
+ triggerRef: p,
328
333
  clearAll: U,
329
334
  onClearAllSelections: ge
330
335
  };
331
336
  };
332
337
  export {
333
- Ue as dropdownCommon
338
+ Ke as dropdownCommon
334
339
  };
@@ -1,5 +1,5 @@
1
1
  export declare const optionCommon: (props: any) => {
2
- selected: import("vue").ComputedRef<boolean>;
2
+ selected: import("vue").ComputedRef<any>;
3
3
  isMulti: import("vue").ComputedRef<boolean>;
4
4
  id: string;
5
5
  onClick: (event: Event) => void;
@@ -1,22 +1,22 @@
1
1
  import { ref as s, onMounted as m, onUnmounted as v, computed as o, toRaw as i } from "vue";
2
2
  import { useId as f } from "../../../composables/useId.js";
3
3
  import { useDropdownContext as O, Mode as l } from "./DropdownContext.js";
4
- const A = (t) => {
5
- const e = O("Option"), n = f().value, u = s(null), c = (d) => {
6
- t.selectAllOption ? d.stopPropagation() : e.select(t.option);
4
+ const A = (e) => {
5
+ const t = O("Option"), n = f().value, u = s(null), c = (a) => {
6
+ e.selectAllOption ? a.stopPropagation() : t.select(e.option);
7
7
  };
8
- m(() => e.registerOption(n, t.disabled, !!t.subtitle)), v(() => {
9
- e.unRegisterOption(n);
8
+ m(() => t.registerOption(n, e.disabled, !!e.subtitle)), v(() => {
9
+ t.unRegisterOption(n);
10
10
  });
11
- const r = o(() => e.mode === l.Multi), a = o(() => t.active !== null ? t.active : e.activeIndex.value !== null ? e.activeOption.value === t.option : !1);
11
+ const r = o(() => t.mode === l.Multi), d = o(() => e.active !== null ? e.active : t.activeIndex.value !== null ? t.activeOption.value === e.option : !1);
12
12
  return {
13
- selected: o(() => t.selectedProp ? !0 : e.mode === l.Multi && Array.isArray(e.selectedOption.value) ? i(e.selectedOption.value.includes(t.option)) : i(e.selectedOption.value) === i(t.option)),
13
+ selected: o(() => e.selectedProp !== null ? e.selectedProp : t.mode === l.Multi && Array.isArray(t.selectedOption.value) ? i(t.selectedOption.value.includes(e.option)) : i(t.selectedOption.value) === i(e.option)),
14
14
  isMulti: r,
15
15
  id: n,
16
16
  onClick: c,
17
- api: e,
17
+ api: t,
18
18
  el: u,
19
- active: a
19
+ active: d
20
20
  };
21
21
  };
22
22
  export {
@@ -0,0 +1,7 @@
1
+ import { Ref } from 'vue';
2
+ export declare const useChildOptions: (selection: Ref<unknown[]>, childrenKey: string) => {
3
+ hasChildren: (option: unknown) => boolean;
4
+ getChildren: (option: unknown) => unknown[];
5
+ someChildrenSelected: (option: any) => boolean;
6
+ allChildrenSelected: (option: unknown) => boolean;
7
+ };
@@ -0,0 +1,14 @@
1
+ const c = (s, t) => {
2
+ const l = (e) => e && e[t] ? e[t] : [], r = (e) => l(e)?.length > 0;
3
+ return {
4
+ hasChildren: r,
5
+ getChildren: l,
6
+ someChildrenSelected: (e) => r(e) ? l(e).some((n) => s.value.includes(n)) : !1,
7
+ allChildrenSelected: (e) => r(e) ? l(e).every(
8
+ (n) => s.value.includes(n)
9
+ ) : !1
10
+ };
11
+ };
12
+ export {
13
+ c as useChildOptions
14
+ };
@@ -84,6 +84,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
84
84
  closed: () => void;
85
85
  opened: () => void;
86
86
  apply: (value: unknown) => void;
87
+ selectAll: () => void;
88
+ clear: () => void;
87
89
  }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
88
90
  modelValue?: unknown;
89
91
  placeholder?: string;
@@ -161,7 +163,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
161
163
  darkTheme: boolean;
162
164
  valueToCopy: string;
163
165
  }>>> & {
166
+ onClear?: () => any;
164
167
  onApply?: (value: unknown) => any;
168
+ onSelectAll?: () => any;
165
169
  "onUpdate:selected"?: (value: unknown) => any;
166
170
  "onUpdate:isOpen"?: (value: unknown) => any;
167
171
  onOpened?: () => any;
@@ -1,8 +1,8 @@
1
1
  import o from "./Dropdown.vue2.js";
2
- /* empty css *//* empty css */import e from "../../../_virtual/_plugin-vue_export-helper.js";
3
- // import "../../../Dropdown.vue_vue_type_style_index_0_scoped_d4f8e790_lang.css"; //*');
2
+ /* empty css *//* empty css */import _ from "../../../_virtual/_plugin-vue_export-helper.js";
3
+ // import "../../../Dropdown.vue_vue_type_style_index_0_scoped_aaa8c4bb_lang.css"; //*');
4
4
  // import "../../../Dropdown.vue_vue_type_style_index_1_lang.css"; //');
5
- const r = /* @__PURE__ */ e(o, [["__scopeId", "data-v-d4f8e790"]]);
5
+ const a = /* @__PURE__ */ _(o, [["__scopeId", "data-v-aaa8c4bb"]]);
6
6
  export {
7
- r as default
7
+ a as default
8
8
  };
@@ -1,16 +1,16 @@
1
- import "../../../Dropdown.vue_vue_type_style_index_0_scoped_d4f8e790_lang.css"; import "../../../Dropdown.vue_vue_type_style_index_1_lang.css"; import { defineComponent as le, openBlock as a, createElementBlock as i, normalizeClass as T, unref as e, renderSlot as b, createVNode as s, withCtx as n, Transition as ae, createTextVNode as r, toDisplayString as h, createCommentVNode as o, createBlock as I, isRef as de, createElementVNode as m, mergeProps as P, withModifiers as N, Fragment as oe, renderList as ie, toRaw as $, pushScopeId as ne, popScopeId as se } from "vue";
2
- import x from "../../button/v3/Button.vue.js";
1
+ import "../../../Dropdown.vue_vue_type_style_index_0_scoped_aaa8c4bb_lang.css"; import "../../../Dropdown.vue_vue_type_style_index_1_lang.css"; import { defineComponent as le, openBlock as a, createElementBlock as i, normalizeClass as T, unref as e, renderSlot as b, createVNode as s, withCtx as n, Transition as ae, createTextVNode as r, toDisplayString as h, createCommentVNode as o, createBlock as I, isRef as de, createElementVNode as m, mergeProps as P, withModifiers as A, Fragment as oe, renderList as ie, toRaw as $, pushScopeId as ne, popScopeId as se } from "vue";
2
+ import N from "../../button/v3/Button.vue.js";
3
3
  import "../../button/v3/IconButton.vue.js";
4
4
  import "../../button/v3/ScrollButton.vue.js";
5
5
  import re from "./Option.vue.js";
6
- import A from "../../icon/v3/Icon.vue.js";
6
+ import x from "../../icon/v3/Icon.vue.js";
7
7
  import ue from "../../search/v3/Search.vue.js";
8
8
  import "../../typography/Heading.vue.js";
9
9
  import y from "../../typography/Text.vue.js";
10
- import { Dropdown as fe } from "floating-vue";
10
+ import { Dropdown as ce } from "floating-vue";
11
11
  import { DropdownTestIdModifiers as u } from "../../../testids/index.js";
12
- import { dropdownCommon as ce } from "../common/Dropdown.common.js";
13
- const me = (t) => (ne("data-v-d4f8e790"), t = t(), se(), t), ye = ["tabindex", "data-testid"], pe = ["disabled", "aria-expanded", "aria-labelledby", "aria-disabled"], be = {
12
+ import { dropdownCommon as fe } from "../common/Dropdown.common.js";
13
+ const me = (t) => (ne("data-v-aaa8c4bb"), t = t(), se(), t), ye = ["tabindex", "data-testid"], pe = ["disabled", "aria-expanded", "aria-labelledby", "aria-disabled"], be = {
14
14
  key: 0,
15
15
  class: "image-slot"
16
16
  }, he = { class: "angle-down" }, ke = {
@@ -91,7 +91,7 @@ const me = (t) => (ne("data-v-d4f8e790"), t = t(), se(), t), ye = ["tabindex", "
91
91
  darkTheme: { type: Boolean, default: !0 },
92
92
  valueToCopy: { default: "" }
93
93
  },
94
- emits: ["update:selected", "update:isOpen", "closed", "opened", "apply"],
94
+ emits: ["update:selected", "update:isOpen", "closed", "opened", "apply", "selectAll", "clear"],
95
95
  setup(t, { expose: L, emit: V }) {
96
96
  const K = t, H = {
97
97
  MULTILINE_LIST_HEIGHT: 48,
@@ -101,7 +101,7 @@ const me = (t) => (ne("data-v-d4f8e790"), t = t(), se(), t), ye = ["tabindex", "
101
101
  }, {
102
102
  onKeydown: p,
103
103
  location: D,
104
- open: f,
104
+ open: c,
105
105
  toggleMenu: g,
106
106
  onButtonKeydown: k,
107
107
  displayedValue: C,
@@ -127,11 +127,11 @@ const me = (t) => (ne("data-v-d4f8e790"), t = t(), se(), t), ye = ["tabindex", "
127
127
  cancel: ee,
128
128
  el: te,
129
129
  buttonRef: z
130
- } = ce(K, V, H);
130
+ } = fe(K, V, H);
131
131
  return L({
132
132
  selectItem: E,
133
133
  scrollTo: Q
134
- }), (c, d) => (a(), i("div", {
134
+ }), (f, d) => (a(), i("div", {
135
135
  ref_key: "el",
136
136
  ref: te,
137
137
  class: T(["dropdown", { "dropdown--disabled": t.disabled }]),
@@ -140,8 +140,8 @@ const me = (t) => (ne("data-v-d4f8e790"), t = t(), se(), t), ye = ["tabindex", "
140
140
  onKeydown: d[7] || (d[7] = //@ts-ignore
141
141
  (...l) => e(p) && e(p)(...l))
142
142
  }, [
143
- b(c.$slots, "label", {}, void 0, !0),
144
- s(e(fe), {
143
+ b(f.$slots, "label", {}, void 0, !0),
144
+ s(e(ce), {
145
145
  theme: t.theme,
146
146
  "popper-class": [
147
147
  t.popperClass,
@@ -152,7 +152,7 @@ const me = (t) => (ne("data-v-d4f8e790"), t = t(), se(), t), ye = ["tabindex", "
152
152
  distance: t.isOnTop ? -e(D) : t.distance,
153
153
  flip: t.flip,
154
154
  triggers: [],
155
- shown: !!e(f),
155
+ shown: !!e(c),
156
156
  "auto-hide": !1,
157
157
  container: t.container,
158
158
  "auto-size": t.autoSize,
@@ -161,7 +161,7 @@ const me = (t) => (ne("data-v-d4f8e790"), t = t(), se(), t), ye = ["tabindex", "
161
161
  popper: n(() => [
162
162
  s(ae, null, {
163
163
  default: n(() => [
164
- e(f) ? (a(), i("div", {
164
+ e(c) ? (a(), i("div", {
165
165
  key: 0,
166
166
  ref_key: "listRef",
167
167
  ref: Z,
@@ -192,13 +192,13 @@ const me = (t) => (ne("data-v-d4f8e790"), t = t(), se(), t), ye = ["tabindex", "
192
192
  onKeydown: e(p)
193
193
  }, null, 8, ["modelValue", "placeholder", "test-id", "onKeydown"])) : o("", !0)
194
194
  ])) : o("", !0),
195
- e(f) ? (a(), i("div", {
195
+ e(c) ? (a(), i("div", {
196
196
  key: 1,
197
197
  class: "dropdown",
198
198
  onKeydown: d[6] || (d[6] = //@ts-ignore
199
199
  (...l) => e(p) && e(p)(...l))
200
200
  }, [
201
- b(c.$slots, "input-list", { open: e(f) }, void 0, !0),
201
+ b(f.$slots, "input-list", { open: e(c) }, void 0, !0),
202
202
  m("div", P(e(G), {
203
203
  class: ["list-container", { "list-container--multi": t.multi }],
204
204
  style: { height: `${e(F)}rem` },
@@ -220,7 +220,7 @@ const me = (t) => (ne("data-v-d4f8e790"), t = t(), se(), t), ye = ["tabindex", "
220
220
  })
221
221
  ])) : o("", !0),
222
222
  t.loading ? (a(), i("li", Ie, [
223
- s(e(A), {
223
+ s(e(x), {
224
224
  "font-size": "md",
225
225
  class: "loader-icon"
226
226
  }, {
@@ -243,7 +243,7 @@ const me = (t) => (ne("data-v-d4f8e790"), t = t(), se(), t), ye = ["tabindex", "
243
243
  "selected-prop": e(S),
244
244
  "is-indeterminate": e(q),
245
245
  "select-all-option": "",
246
- onClick: d[5] || (d[5] = N((l) => e(W)(), ["stop"]))
246
+ onClick: d[5] || (d[5] = A((l) => e(W)(), ["stop"]))
247
247
  }, {
248
248
  default: n(() => [
249
249
  r("Select all ")
@@ -255,9 +255,9 @@ const me = (t) => (ne("data-v-d4f8e790"), t = t(), se(), t), ye = ["tabindex", "
255
255
  key: w,
256
256
  "aria-selected": e(O)($(e(R)), l),
257
257
  "aria-disabled": !!t.disabled,
258
- onClick: N(() => e(E)(l, w), ["stop"])
258
+ onClick: A(() => e(E)(l, w), ["stop"])
259
259
  }, [
260
- b(c.$slots, "default", {
260
+ b(f.$slots, "default", {
261
261
  option: l,
262
262
  selected: e(O)($(e(R)), l),
263
263
  active: $(e(Y)) === w
@@ -266,7 +266,7 @@ const me = (t) => (ne("data-v-d4f8e790"), t = t(), se(), t), ye = ["tabindex", "
266
266
  ], 16)
267
267
  ], 16, we),
268
268
  t.multi ? (a(), i("div", Se, [
269
- s(e(x), {
269
+ s(e(N), {
270
270
  ref_key: "cancel",
271
271
  ref: ee,
272
272
  size: "sm",
@@ -280,7 +280,7 @@ const me = (t) => (ne("data-v-d4f8e790"), t = t(), se(), t), ye = ["tabindex", "
280
280
  ]),
281
281
  _: 1
282
282
  }, 8, ["test-id", "onClick"]),
283
- s(e(x), {
283
+ s(e(N), {
284
284
  ref_key: "apply",
285
285
  ref: _,
286
286
  "data-testid": "mutli-apply",
@@ -304,12 +304,12 @@ const me = (t) => (ne("data-v-d4f8e790"), t = t(), se(), t), ye = ["tabindex", "
304
304
  default: n(() => [
305
305
  m("div", {
306
306
  class: T(["button__container", {
307
- "button__container--open": !!e(f),
307
+ "button__container--open": !!e(c),
308
308
  [`button__container--${t.size}`]: !0,
309
309
  "button__container--disabled": t.disabled
310
310
  }])
311
311
  }, [
312
- c.$slots.input ? (a(), i("div", {
312
+ f.$slots.input ? (a(), i("div", {
313
313
  key: 0,
314
314
  ref_key: "buttonRef",
315
315
  ref: z,
@@ -317,23 +317,23 @@ const me = (t) => (ne("data-v-d4f8e790"), t = t(), se(), t), ye = ["tabindex", "
317
317
  onKeydown: d[1] || (d[1] = //@ts-ignore
318
318
  (...l) => e(k) && e(k)(...l))
319
319
  }, [
320
- b(c.$slots, "input", {
321
- open: e(f),
320
+ b(f.$slots, "input", {
321
+ open: e(c),
322
322
  value: e(C),
323
323
  disabled: t.disabled
324
324
  }, void 0, !0)
325
325
  ], 544)) : o("", !0),
326
- c.$slots.input ? o("", !0) : (a(), i("button", {
326
+ f.$slots.input ? o("", !0) : (a(), i("button", {
327
327
  key: 1,
328
328
  ref_key: "buttonRef",
329
329
  ref: z,
330
330
  disabled: t.disabled,
331
331
  "aria-haspopup": !0,
332
- "aria-expanded": !!e(f),
332
+ "aria-expanded": !!e(c),
333
333
  "aria-labelledby": e(M)?.id,
334
334
  "aria-disabled": t.disabled,
335
335
  class: T([{
336
- "button--open": !!e(f),
336
+ "button--open": !!e(c),
337
337
  [`button--${t.size}`]: !0,
338
338
  "button--disabled": t.disabled
339
339
  }, "button"]),
@@ -341,8 +341,8 @@ const me = (t) => (ne("data-v-d4f8e790"), t = t(), se(), t), ye = ["tabindex", "
341
341
  (...l) => e(k) && e(k)(...l)),
342
342
  onClick: d[3] || (d[3] = (l) => e(g)())
343
343
  }, [
344
- c.$slots.image ? (a(), i("div", be, [
345
- b(c.$slots, "image", {}, void 0, !0)
344
+ f.$slots.image ? (a(), i("div", be, [
345
+ b(f.$slots, "image", {}, void 0, !0)
346
346
  ])) : o("", !0),
347
347
  s(e(y), {
348
348
  size: "sm",
@@ -354,7 +354,7 @@ const me = (t) => (ne("data-v-d4f8e790"), t = t(), se(), t), ye = ["tabindex", "
354
354
  _: 1
355
355
  }),
356
356
  m("div", he, [
357
- s(e(A), {
357
+ s(e(x), {
358
358
  name: "angle-down",
359
359
  "font-size": "sm"
360
360
  })