@ironsource/shared-ui 2.1.12-rc.0 → 2.1.12-rc.10

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 (91) hide show
  1. package/ButtonFilterDropdownTrigger.vue_vue_type_style_index_0_scoped_0198fee8_lang.css +1 -0
  2. package/Chart.vue_vue_type_style_index_0_scoped_78d3f5a8_lang.css +1 -0
  3. package/ChartHeader.vue_vue_type_style_index_0_scoped_32001725_lang.css +1 -0
  4. package/ChartHeaderTrend.vue_vue_type_style_index_0_scoped_e4c673e7_lang.css +1 -0
  5. package/ChartLegend.vue_vue_type_style_index_0_scoped_532f23bc_lang.css +1 -0
  6. package/ChartPlane.vue_vue_type_style_index_0_scoped_4396faf6_lang.css +1 -0
  7. package/ChartTooltip.vue_vue_type_style_index_0_scoped_25d0e129_lang.css +1 -0
  8. package/ConditionalDropdown.vue_vue_type_style_index_0_scoped_8d5521da_lang.css +1 -0
  9. package/DataGrid.vue_vue_type_style_index_0_scoped_86ea5d2a_lang.css +1 -0
  10. package/DateRangeV4.vue_vue_type_style_index_0_scoped_a849128a_lang.css +1 -0
  11. package/DefaultDropdownTrigger.vue_vue_type_style_index_0_scoped_64ae80dd_lang.css +1 -0
  12. package/DropdownV4.vue_vue_type_style_index_0_scoped_d154c5da_lang.css +1 -0
  13. package/DropdownV4.vue_vue_type_style_index_1_lang.css +1 -1
  14. package/TreeDropdown.vue_vue_type_style_index_0_scoped_4ba9e4bd_lang.css +1 -0
  15. package/components/chart/Chart.vue.d.ts +57 -39
  16. package/components/chart/Chart.vue.js +3 -3
  17. package/components/chart/Chart.vue2.js +98 -297
  18. package/components/chart/ChartHeader.vue.d.ts +20 -10
  19. package/components/chart/ChartHeader.vue.js +2 -2
  20. package/components/chart/ChartHeader.vue2.js +74 -52
  21. package/components/chart/ChartHeaderTrend.vue.d.ts +34 -0
  22. package/components/chart/ChartHeaderTrend.vue.js +7 -0
  23. package/components/chart/ChartHeaderTrend.vue2.js +32 -0
  24. package/components/chart/ChartLegend.vue.js +2 -2
  25. package/components/chart/ChartLegend.vue2.js +36 -35
  26. package/components/chart/ChartPlane.vue.d.ts +143 -0
  27. package/components/chart/ChartPlane.vue.js +7 -0
  28. package/components/chart/ChartPlane.vue2.js +306 -0
  29. package/components/chart/ChartStoryArgs.d.ts +135 -0
  30. package/components/chart/ChartTooltip.vue.js +2 -2
  31. package/components/chart/ChartTooltip.vue2.js +36 -35
  32. package/components/chart/composables/useChartHeight.d.ts +5 -0
  33. package/components/chart/composables/useChartHeight.js +22 -0
  34. package/components/chart/composables/useColorsMap.d.ts +10 -0
  35. package/components/chart/composables/useColorsMap.js +17 -0
  36. package/components/chart/composables/useTooltipPosition.d.ts +1 -1
  37. package/components/chart/composables/useTooltipPosition.js +11 -15
  38. package/components/chart/consts.d.ts +5 -0
  39. package/components/chart/consts.js +20 -15
  40. package/components/chart/index.d.ts +189 -113
  41. package/components/chart/mockData.d.ts +27 -1
  42. package/components/chart/types.d.ts +4 -0
  43. package/components/chart/utils/formatNumber.d.ts +0 -1
  44. package/components/chart/utils/utils.js +5 -5
  45. package/components/dateRange/v4/DateRangeV4.vue.js +2 -2
  46. package/components/dateRange/v4/DateRangeV4.vue2.js +1 -1
  47. package/components/dropdown/common/Dropdown.common.js +208 -200
  48. package/components/dropdown/common/useGroupedOptions.d.ts +1 -0
  49. package/components/dropdown/common/useGroupedOptions.js +40 -39
  50. package/components/dropdown/v4/ButtonFilterDropdownTrigger.vue.js +3 -3
  51. package/components/dropdown/v4/ButtonFilterDropdownTrigger.vue2.js +10 -7
  52. package/components/dropdown/v4/ConditionalDropdown.vue.js +4 -4
  53. package/components/dropdown/v4/ConditionalDropdown.vue2.js +80 -80
  54. package/components/dropdown/v4/DefaultDropdownTrigger.vue.js +3 -3
  55. package/components/dropdown/v4/DefaultDropdownTrigger.vue2.js +3 -3
  56. package/components/dropdown/v4/DropdownV4.vue.d.ts +5 -0
  57. package/components/dropdown/v4/DropdownV4.vue.js +3 -3
  58. package/components/dropdown/v4/DropdownV4.vue2.js +97 -86
  59. package/components/dropdown/v4/TreeDropdown.vue.js +2 -2
  60. package/components/dropdown/v4/TreeDropdown.vue2.js +68 -73
  61. package/components/dropdown/v4/dropdownStoryArgs.d.ts +30 -0
  62. package/components/dropdown/v4/index.d.ts +20 -1
  63. package/components/emptyState/v4/EmptyStateV4.vue.d.ts +3 -3
  64. package/components/emptyState/v4/index.d.ts +7 -7
  65. package/components/table/v4/DataGrid.vue.d.ts +4 -3
  66. package/components/table/v4/DataGrid.vue.js +3 -3
  67. package/components/table/v4/DataGrid.vue2.js +152 -142
  68. package/components/table/v4/MultipleDataGrid.vue.d.ts +3 -3
  69. package/components/table/v4/index.d.ts +15 -14
  70. package/composables/useFullPageHeight.d.ts +10 -0
  71. package/composables/useFullPageHeight.js +15 -0
  72. package/index.d.ts +88 -44
  73. package/index.js +102 -100
  74. package/package.json +1 -1
  75. package/testids/index.d.ts +2 -1
  76. package/testids/index.js +10 -10
  77. package/utils/formatNumbers.d.ts +1 -1
  78. package/utils/formatNumbers.js +18 -5
  79. package/utils/index.js +7 -0
  80. package/ButtonFilterDropdownTrigger.vue_vue_type_style_index_0_scoped_1aa6df01_lang.css +0 -1
  81. package/Chart.vue_vue_type_style_index_0_scoped_026d82c5_lang.css +0 -1
  82. package/ChartHeader.vue_vue_type_style_index_0_scoped_b8213498_lang.css +0 -1
  83. package/ChartLegend.vue_vue_type_style_index_0_scoped_4fe1c7d1_lang.css +0 -1
  84. package/ChartTooltip.vue_vue_type_style_index_0_scoped_6744325c_lang.css +0 -1
  85. package/ConditionalDropdown.vue_vue_type_style_index_0_scoped_8e026669_lang.css +0 -1
  86. package/DataGrid.vue_vue_type_style_index_0_scoped_26488faf_lang.css +0 -1
  87. package/DateRangeV4.vue_vue_type_style_index_0_scoped_8a2714eb_lang.css +0 -1
  88. package/DefaultDropdownTrigger.vue_vue_type_style_index_0_scoped_73bf9b5b_lang.css +0 -1
  89. package/DropdownV4.vue_vue_type_style_index_0_scoped_75002075_lang.css +0 -1
  90. package/TreeDropdown.vue_vue_type_style_index_0_scoped_b883d1fa_lang.css +0 -1
  91. package/components/chart/utils/formatNumber.js +0 -11
@@ -1,12 +1,12 @@
1
1
  import { format as n } from "date-fns";
2
- import { formatNumber as d } from "./formatNumber.js";
3
- const p = (r, t, e) => {
2
+ import { nFormatter as d } from "../../../utils/formatNumbers.js";
3
+ const M = (r, t, e) => {
4
4
  if (e === 0)
5
5
  return 0;
6
6
  const f = t - r, o = f / e * 0.4;
7
7
  return (f + o) / e;
8
- }, M = (r, t) => t === "day" ? n(new Date(r), "EEEE") : t === "number" ? d(r) : t === "date" ? n(new Date(r), "MMM dd") : t === "dateLong" ? n(new Date(r), "MMM dd, yyyy") : String(r);
8
+ }, c = (r, t) => t === "day" ? n(new Date(r), "EEEE") : t === "number" ? d(r) : t === "date" ? n(new Date(r), "MMM dd") : t === "dateLong" ? n(new Date(r), "MMM dd, yyyy") : String(r);
9
9
  export {
10
- p as calcStepSize,
11
- M as formatValue
10
+ M as calcStepSize,
11
+ c as formatValue
12
12
  };
@@ -1,7 +1,7 @@
1
1
  import e from "./DateRangeV4.vue2.js";
2
2
  /* empty css */import o from "../../../_virtual/_plugin-vue_export-helper.js";
3
- // import "../../../DateRangeV4.vue_vue_type_style_index_0_scoped_8a2714eb_lang.css"; //*');
4
- const s = /* @__PURE__ */ o(e, [["__scopeId", "data-v-8a2714eb"]]);
3
+ // import "../../../DateRangeV4.vue_vue_type_style_index_0_scoped_a849128a_lang.css"; //*');
4
+ const s = /* @__PURE__ */ o(e, [["__scopeId", "data-v-a849128a"]]);
5
5
  export {
6
6
  s as default
7
7
  };
@@ -1,4 +1,4 @@
1
- import "../../../DateRangeV4.vue_vue_type_style_index_0_scoped_8a2714eb_lang.css"; import { defineComponent as J, watch as Q, openBlock as n, createElementBlock as s, unref as e, normalizeClass as r, createElementVNode as d, renderSlot as x, createVNode as i, withDirectives as v, Fragment as k, renderList as C, withCtx as l, createTextVNode as m, toDisplayString as g, createCommentVNode as E, vShow as $, normalizeStyle as X, setBlockTracking as R } from "vue";
1
+ import "../../../DateRangeV4.vue_vue_type_style_index_0_scoped_a849128a_lang.css"; import { defineComponent as J, watch as Q, openBlock as n, createElementBlock as s, unref as e, normalizeClass as r, createElementVNode as d, renderSlot as x, createVNode as i, withDirectives as v, Fragment as k, renderList as C, withCtx as l, createTextVNode as m, toDisplayString as g, createCommentVNode as E, vShow as $, normalizeStyle as X, setBlockTracking as R } from "vue";
2
2
  import Z from "./CalendarMonthV4.vue.js";
3
3
  import { typeToName as _, messagePerType as ee } from "../common/consts.common.js";
4
4
  import A from "../../button/v4/ButtonV4.vue.js";
@@ -1,155 +1,163 @@
1
- import { useToggle as _e } from "../../../composables/useToggle.js";
2
- import { inject as Ve, ref as r, computed as c, watch as b, useSlots as ke, toRaw as P, nextTick as K, provide as Ge, onMounted as Le } from "vue";
1
+ import { useToggle as Ve } from "../../../composables/useToggle.js";
2
+ import { inject as ke, ref as r, computed as c, watch as b, useSlots as Ge, toRaw as I, nextTick as N, provide as Le, onMounted as Ue } from "vue";
3
3
  import { isObjectInArray as ae } from "../../../utils/array.js";
4
- import { objectsEqual as Ue } from "../../../utils/object.js";
5
- import { useClamp as Be, useVirtualList as He, onClickOutside as ne, useInfiniteScroll as qe } from "@vueuse/core";
6
- import { Mode as T, Type as U, DropdownContext as Xe } from "./DropdownContext.js";
7
- import { pxToRem as $e } from "../../../utils/style.js";
8
- import { useEditableContext as je } from "../../table-cells/common/EditableContext.js";
9
- import { useGroupedOptions as ze } from "./useGroupedOptions.js";
10
- const tl = (l, v, g) => {
11
- const B = Ve("isTreeDropdown", !1), {
4
+ import { objectsEqual as Be } from "../../../utils/object.js";
5
+ import { useClamp as He, useVirtualList as qe, onClickOutside as ne, useInfiniteScroll as Xe } from "@vueuse/core";
6
+ import { Mode as w, Type as U, DropdownContext as $e } from "./DropdownContext.js";
7
+ import { pxToRem as je } from "../../../utils/style.js";
8
+ import { useEditableContext as ze } from "../../table-cells/common/EditableContext.js";
9
+ import { useGroupedOptions as We } from "./useGroupedOptions.js";
10
+ const al = (e, d, y) => {
11
+ const B = ke("isTreeDropdown", !1), {
12
12
  sortOutGroups: H,
13
13
  flattenAndMarkGroupOptions: ue,
14
14
  isGroup: q,
15
15
  selectAllWithGroups: ie,
16
16
  isIndeterminateGrouped: re,
17
17
  allSelectedGrouped: X,
18
- areAllPreviousSelected: oe
19
- } = ze(l), ce = (e, t) => l.multi && Array.isArray(e) ? l.comparingKey ? e?.findIndex(
20
- (i) => i[l.comparingKey] === t[l.comparingKey]
21
- ) > -1 : ae(e, t) : l.comparingKey ? e?.[l.comparingKey] === t[l.comparingKey] : e === t;
18
+ areAllPreviousSelected: oe,
19
+ groupedChildOptionsLength: ce
20
+ } = We(e), se = (l, t) => e.multi && Array.isArray(l) ? e.comparingKey ? l?.findIndex(
21
+ (i) => i[e.comparingKey] === t[e.comparingKey]
22
+ ) > -1 : ae(l, t) : e.comparingKey ? l?.[e.comparingKey] === t[e.comparingKey] : l === t;
22
23
  let $;
23
- ((e) => {
24
- 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";
24
+ ((l) => {
25
+ l[l.None = 0] = "None", l[l.Next = 1] = "Next", l[l.Previous = -1] = "Previous", l[l.NextPage = 10] = "NextPage", l[l.PrevPage = -10] = "PrevPage";
25
26
  })($ || ($ = {}));
26
27
  const a = r(
27
- l.selected
28
- ), R = je(), u = c({
28
+ e.selected
29
+ ), K = ze(), n = c({
29
30
  get() {
30
- return R?.value?.value ?? a.value;
31
+ return K?.value?.value ?? a.value;
31
32
  },
32
- set(e) {
33
- R.onChange?.(e), R.onClose?.(), v("update:selected", e);
33
+ set(l) {
34
+ K.onChange?.(l), K.onClose?.(), d("update:selected", l);
34
35
  }
35
36
  });
36
37
  b(
37
- () => l.selected,
38
+ () => e.selected,
38
39
  () => {
39
- a.value = l.selected, d.value = l.selected;
40
+ a.value = e.selected, v.value = e.selected;
40
41
  }
41
42
  );
42
- const se = ke(), w = r(null), m = r(null), j = r(null), E = r(null), z = r(null), I = r(null), de = r(), W = r(null), J = r(null), Q = r(null), ve = 8, fe = c(() => I.value ? I.value.getBoundingClientRect().height + ve + l.distance : 0), D = r(!1), y = r([]), x = r(-1), h = r(""), d = r(l.selected || []), Y = () => I.value?.focus(), [O, ge, ye] = _e({
43
- disabled: l.disabled,
44
- initialValue: l.defaultOpen
43
+ const de = Ge(), x = r(null), m = r(null), j = r(null), R = r(null), z = r(null), D = r(null), ve = r(), W = r(null), J = r(null), Q = r(null), fe = 8, ge = c(() => D.value ? D.value.getBoundingClientRect().height + fe + e.distance : 0), C = r(!1), h = r([]), T = r(-1), O = r(""), v = r(e.selected || []), Y = () => D.value?.focus(), [S, ye, he] = Ve({
44
+ disabled: e.disabled,
45
+ initialValue: e.defaultOpen
45
46
  });
46
47
  b(
47
- () => l.disabled,
48
- (e) => {
49
- e !== void 0 && ye(e);
48
+ () => e.disabled,
49
+ (l) => {
50
+ l !== void 0 && he(l);
50
51
  }
51
52
  );
52
- const Z = (e) => {
53
- he.value = ge(e);
54
- }, he = c({
53
+ const Z = (l) => {
54
+ Oe.value = ye(l);
55
+ }, Oe = c({
55
56
  get() {
56
- return l.isOpen;
57
+ return e.isOpen;
57
58
  },
58
- set(e) {
59
- v("update:isOpen", e);
59
+ set(l) {
60
+ d("update:isOpen", l);
60
61
  }
61
- }), Oe = c(() => o.value.length - 1), f = Be(0, 0, Oe), F = c(() => u.value ? l.displayValue(u.value) : ""), Se = (e) => {
62
- if (!e.value.length && !l.multiOptionsPlaceholderPrefix && !l.multiOptionsPlaceholderSuffix)
63
- return l.placeholder;
64
- const t = !l.multiOptionsPlaceholderPrefix && !l.multiOptionsPlaceholderSuffix ? `${e.value.length} selected` : `${l.multiOptionsPlaceholderPrefix ?? ""}${e.value.length ?? "0"}${l.multiOptionsPlaceholderSuffix ?? ""}`;
65
- return e.value.length == 1 && l.displayValue ? l.displayValue(e.value[0]) : t;
66
- }, me = c(() => {
67
- if (!l.multi)
68
- return u.value ? l.displayValue(u.value) : l.placeholder;
62
+ }), Se = c(() => o.value.length - 1), g = He(0, 0, Se), F = c(() => n.value ? e.displayValue(n.value) : ""), me = (l) => {
63
+ if (!l.value.length && !e.multiOptionsPlaceholderPrefix && !e.multiOptionsPlaceholderSuffix)
64
+ return e.placeholder;
65
+ const t = !e.multiOptionsPlaceholderPrefix && !e.multiOptionsPlaceholderSuffix ? `${l.value.length} selected` : `${e.multiOptionsPlaceholderPrefix ?? ""}${l.value.length ?? "0"}${e.multiOptionsPlaceholderSuffix ?? ""}`;
66
+ return l.value.length == 1 && e.displayValue ? e.displayValue(l.value[0]) : t;
67
+ }, Ae = c(() => {
68
+ if (!e.multi)
69
+ return n.value ? e.displayValue(n.value) : e.placeholder;
69
70
  if (Array.isArray(a.value))
70
- return Se(a);
71
- }), M = c(() => {
71
+ return me(a);
72
+ }), E = c(() => {
72
73
  if (Array.isArray(a.value))
73
- return l.groupedOptions ? X(o, a) : a.value.length === o.value.length;
74
- }), Ae = c(() => !l.multi || !Array.isArray(a.value) ? !1 : l.groupedOptions ? re(
74
+ return e.groupedOptions ? X(o, a) : a.value.length === o.value.length;
75
+ }), be = c(() => !e.multi || !Array.isArray(a.value) ? !1 : e.groupedOptions ? re(
75
76
  o,
76
77
  a
77
- ) : a.value.length > 0 && a.value.length < o.value.length), _ = (e) => {
78
- h.value = e;
79
- }, N = c(() => l.groupedOptions ? ue(l.options) : l.options), be = c(() => {
78
+ ) : a.value.length > 0 && a.value.length < o.value.length), _ = (l) => {
79
+ O.value = l;
80
+ }, M = c(() => e.groupedOptions ? ue(e.options) : e.options), Te = c(() => {
80
81
  if (oe(
81
- N,
82
- d
82
+ M,
83
+ v
83
84
  ))
84
- return N.value;
85
- const e = {
85
+ return M.value;
86
+ const l = {
86
87
  selected: [],
87
88
  notSelected: []
88
89
  };
89
- P(N).value.forEach((i) => {
90
- const n = (l.comparingKey ? d.value.findIndex(
91
- (L) => L[l.comparingKey] === i[l.comparingKey]
92
- ) > -1 : d.value.includes(i)) ? "selected" : "notSelected";
93
- e[n].push(i);
90
+ I(M).value.forEach((i) => {
91
+ const u = (e.comparingKey ? v.value.findIndex(
92
+ (L) => L[e.comparingKey] === i[e.comparingKey]
93
+ ) > -1 : v.value.includes(i)) ? "selected" : "notSelected";
94
+ l[u].push(i);
94
95
  });
95
- const t = l.groupedOptions ? H(e.notSelected) : e.notSelected;
96
- return [].concat(e.selected, t);
96
+ const t = e.groupedOptions ? H(l.notSelected) : l.notSelected;
97
+ return [].concat(l.selected, t);
97
98
  }), o = c(() => {
98
- const e = Array.isArray(d.value) && l.multi && g.VERSION === 4 && !B ? be.value : N.value;
99
- if (l.onSearch) {
100
- const t = e.filter((i) => l.groupedOptions && q(i) ? i : l.onSearch(i, h.value));
101
- return l.groupedOptions ? H(t) : t;
99
+ const l = Array.isArray(v.value) && e.multi && y.VERSION === 4 && !B ? Te.value : M.value;
100
+ if (e.onSearch) {
101
+ const t = l.filter((i) => e.groupedOptions && q(i) ? i : e.onSearch(i, O.value));
102
+ return e.groupedOptions ? H(t) : t;
102
103
  } else
103
- return e;
104
- }), Pe = c(() => y.value[0]?.hasSubtitle), p = c(() => s.mode === T.Multi), ee = c(
105
- () => Pe.value ? g.MULTILINE_LIST_HEIGHT : g.LIST_HEIGHT
104
+ return l;
105
+ }), Pe = c(() => h.value[0]?.hasSubtitle), p = c(() => s.mode === w.Multi), ee = c(
106
+ () => Pe.value ? y.MULTILINE_LIST_HEIGHT : y.LIST_HEIGHT
106
107
  ), {
107
108
  list: V,
108
109
  containerProps: k,
109
- wrapperProps: Te,
110
- scrollTo: C
111
- } = He(o, {
110
+ wrapperProps: Ie,
111
+ scrollTo: P
112
+ } = qe(o, {
112
113
  itemHeight: ee.value,
113
- overscan: l.disableVirtualScroll ? 1 / 0 : 2
114
+ overscan: e.disableVirtualScroll ? 1 / 0 : 2
114
115
  });
115
116
  b(
116
- () => l.isOpen,
117
- (e) => {
118
- Z(e);
117
+ () => e.isOpen,
118
+ (l) => {
119
+ Z(l);
119
120
  }
120
- ), b([x], async () => {
121
- await K();
121
+ ), b([T], async () => {
122
+ await N();
122
123
  }), b(
123
- [O, f, x],
124
- async ([e], [t]) => {
125
- O.value && (await K(), x.value !== -1 && e !== t && setTimeout(() => {
126
- l.multi && g.VERSION === 4 || C(x.value);
127
- }), f.value && setTimeout(() => {
128
- C(f.value);
124
+ [S, g, T],
125
+ async ([l], [t]) => {
126
+ S.value && (await N(), T.value !== -1 && l !== t && setTimeout(() => {
127
+ if (!(e.multi && y.VERSION === 4))
128
+ if (P(T.value), e.groupedOptions) {
129
+ const i = M.value.findIndex(
130
+ (f) => f === n.value
131
+ );
132
+ P(i);
133
+ } else
134
+ P(T.value);
135
+ }), g.value && setTimeout(() => {
136
+ P(g.value);
129
137
  }));
130
138
  }
131
- ), b(h, () => {
132
- v("onsearch", h.value), C(0);
139
+ ), b(O, () => {
140
+ d("onsearch", O.value), P(0);
133
141
  });
134
- const A = (e, t = !1) => {
135
- l.disabled || (Z(e), K(() => {
136
- O.value && v("opened"), O.value || v("closed"), w.value && t && w.value.focus();
142
+ const A = (l, t = !1) => {
143
+ e.disabled || (Z(l), N(() => {
144
+ S.value && d("opened"), S.value || d("closed"), x.value && t && x.value.focus();
137
145
  }));
138
146
  };
139
- b(O, (e) => {
140
- if (e) {
141
- h.value = "", p.value && Array.isArray(u.value) && (d.value = P(u.value).slice());
147
+ b(S, (l) => {
148
+ if (l) {
149
+ O.value = "", p.value && Array.isArray(n.value) && (v.value = I(n.value).slice());
142
150
  return;
143
151
  }
144
152
  Y();
145
153
  });
146
154
  const we = () => {
147
- if (M.value) {
155
+ if (E.value) {
148
156
  a.value = [];
149
157
  return;
150
158
  }
151
159
  if (Array.isArray(a.value)) {
152
- if (l.groupedOptions)
160
+ if (e.groupedOptions)
153
161
  ie(o, a);
154
162
  else {
155
163
  if (a.value.length === o.value.length) {
@@ -158,94 +166,94 @@ const tl = (l, v, g) => {
158
166
  }
159
167
  a.value = o.value;
160
168
  }
161
- v("selectAll");
169
+ d("selectAll");
162
170
  }
163
- }, Ie = () => {
164
- we(), g.VERSION !== 4 && (u.value = a.value);
165
- }, xe = (e = !0) => {
166
- a.value = [], e && (u.value = [], d.value = []), v("clear");
167
- }, G = (e, t) => {
168
- if (e = P(e), g.VERSION === 4 ? e[l.disabledOptionKey] : y.value[t]?.disabled)
171
+ }, xe = () => {
172
+ we(), y.VERSION !== 4 && (n.value = a.value);
173
+ }, De = (l = !0) => {
174
+ a.value = [], l ? (n.value = [], v.value = [], d("clear")) : e.dynamicFilterMode || d("clear");
175
+ }, G = (l, t) => {
176
+ if (l = I(l), y.VERSION === 4 ? l[e.disabledOptionKey] : h.value[t]?.disabled)
169
177
  return;
170
- if (x.value = t, !l.multi) {
171
- l.keepOpen || A(!1), s.goToOption(
178
+ if (T.value = t, !e.multi) {
179
+ e.keepOpen || A(!1), s.goToOption(
172
180
  0
173
181
  /* None */
174
- ), u.value = e, _(""), Y(), s.type === U.Search && m.value && (m.value.value = l.displayValue(e)), le();
182
+ ), n.value = l, _(""), Y(), s.type === U.Search && m.value && (m.value.value = e.displayValue(l)), le();
175
183
  return;
176
184
  }
177
185
  if (!Array.isArray(a.value))
178
186
  return;
179
187
  m.value?.focus();
180
- const S = P(a.value);
181
- if (ae(S, e) || l.comparingKey && S.findIndex(
182
- (n) => n[l.comparingKey] === e[l.comparingKey]
188
+ const f = I(a.value);
189
+ if (ae(f, l) || e.comparingKey && f.findIndex(
190
+ (u) => u[e.comparingKey] === l[e.comparingKey]
183
191
  ) > -1) {
184
- a.value = S.filter((n) => l.comparingKey ? n[l.comparingKey] !== e[l.comparingKey] : !Ue(n, e));
192
+ a.value = f.filter((u) => e.comparingKey ? u[e.comparingKey] !== l[e.comparingKey] : !Be(u, l));
185
193
  return;
186
194
  } else {
187
- a.value = [...S, e];
195
+ a.value = [...f, l];
188
196
  return;
189
197
  }
190
- }, De = (e) => y.value[e]?.disabled, s = {
191
- activeIndex: f,
192
- options: y,
193
- selectedOption: u,
198
+ }, Me = (l) => h.value[l]?.disabled, s = {
199
+ activeIndex: g,
200
+ options: h,
201
+ selectedOption: n,
194
202
  labelRef: z,
195
- activeOption: E,
196
- listRef: w,
197
- clearable: l.clearable,
198
- type: se.input ? U.Search : U.Dropdown,
199
- mode: l.multi ? T.Multi : T.Single,
200
- query: h,
203
+ activeOption: R,
204
+ listRef: x,
205
+ clearable: e.clearable,
206
+ type: de.input ? U.Search : U.Dropdown,
207
+ mode: e.multi ? w.Multi : w.Single,
208
+ query: O,
201
209
  selectedValue: F,
202
210
  toggle: A,
203
- disabled: l.disabled,
204
- open: O,
205
- mandatory: l.mandatory,
206
- size: l.size,
207
- placeholder: l.placeholder,
211
+ disabled: e.disabled,
212
+ open: S,
213
+ mandatory: e.mandatory,
214
+ size: e.size,
215
+ placeholder: e.placeholder,
208
216
  select: G,
209
217
  clearSelection: () => {
210
- _(""), u.value = s.mode === T.Single ? null : [], d.value = s.mode === T.Single ? null : [], m.value && (m.value.value = "");
218
+ _(""), n.value = s.mode === w.Single ? null : [], v.value = s.mode === w.Single ? null : [], m.value && (m.value.value = "");
211
219
  },
212
220
  search: _,
213
- goToOption: async (e) => {
214
- if (!O.value)
221
+ goToOption: async (l) => {
222
+ if (!S.value)
215
223
  return;
216
- let t = f.value + e;
217
- const i = y.value.filter(
218
- (n) => n.disabled
219
- ).length, S = o.value.length - i;
220
- for (t > S && (t = S + 1); ; ) {
221
- if (!y.value[t]?.disabled) {
222
- E.value = o.value[t], f.value = t;
224
+ let t = g.value + l;
225
+ const i = h.value.filter(
226
+ (u) => u.disabled
227
+ ).length, f = o.value.length - i;
228
+ for (t > f && (t = f + 1); ; ) {
229
+ if (!h.value[t]?.disabled) {
230
+ R.value = o.value[t], g.value = t;
223
231
  return;
224
232
  }
225
- if ((e === 1 || e === 10) && (t = t + 1), (e === -1 || e === -10) && (t = t + -1), !!De(f.value)) {
226
- E.value = o.value[t], f.value = t;
233
+ if ((l === 1 || l === 10) && (t = t + 1), (l === -1 || l === -10) && (t = t + -1), !!Me(g.value)) {
234
+ R.value = o.value[t], g.value = t;
227
235
  return;
228
236
  }
229
237
  }
230
238
  },
231
- registerInput: (e) => {
232
- m.value = e.value;
239
+ registerInput: (l) => {
240
+ m.value = l.value;
233
241
  },
234
- registerOption: (e, t, i) => {
235
- y.value = [...y.value, { id: e, disabled: t, hasSubtitle: i }];
242
+ registerOption: (l, t, i) => {
243
+ h.value = [...h.value, { id: l, disabled: t, hasSubtitle: i }];
236
244
  },
237
- unRegisterOption(e) {
238
- y.value = y.value.filter((t) => t.id !== e);
245
+ unRegisterOption(l) {
246
+ h.value = h.value.filter((t) => t.id !== l);
239
247
  }
240
248
  };
241
- Ge(Xe, s), ne(
242
- w,
249
+ Le($e, s), ne(
250
+ x,
243
251
  () => {
244
- O.value && te();
252
+ S.value && te();
245
253
  },
246
254
  {
247
255
  ignore: [
248
- I,
256
+ D,
249
257
  W,
250
258
  J,
251
259
  Q,
@@ -254,133 +262,133 @@ const tl = (l, v, g) => {
254
262
  ]
255
263
  }
256
264
  );
257
- const Me = () => {
265
+ const Ce = () => {
258
266
  m.value && (m.value.value = s.query.value = "");
259
267
  };
260
- Le(async () => {
261
- l.autoFocus && (await K(), setTimeout(() => {
268
+ Ue(async () => {
269
+ e.autoFocus && (await N(), setTimeout(() => {
262
270
  j.value.focus();
263
- })), s.goToOption(0), l.multi && !B && (l.groupedOptions ? D.value = X(
271
+ })), s.goToOption(0), e.multi && !B && (e.groupedOptions ? C.value = X(
264
272
  o,
265
273
  a
266
- ) : D.value = l.options.length === l.selected.length);
274
+ ) : C.value = e.options.length === e.selected.length);
267
275
  });
268
276
  const le = () => {
269
- l.multi && (D.value = M.value, u.value = a.value, Array.isArray(u.value) && (d.value = P(u.value).slice())), v("apply", u.value), v("allSelectedChanged", M.value), A(!1), Me();
277
+ e.multi && (n.value = a.value, Array.isArray(n.value) && (v.value = I(n.value).slice(), C.value = e.groupedOptions ? ce(e.options) === n.value.length : e.options.length === n.value.length)), d("apply", n.value), d("allSelectedChanged", E.value), A(!1), Ce();
270
278
  }, te = () => {
271
- p.value && Array.isArray(d.value) && (u.value = P(d.value).slice()), h.value = "", A(!1);
272
- }, Ne = (e) => {
273
- if (!l.disableKeyboardEvents)
274
- switch (e.key) {
279
+ p.value && Array.isArray(v.value) && (n.value = I(v.value).slice()), O.value = "", A(!1);
280
+ }, Ne = (l) => {
281
+ if (!e.disableKeyboardEvents)
282
+ switch (l.key) {
275
283
  case "Space":
276
284
  case "Enter":
277
285
  case "ArrowUp":
278
286
  case "ArrowDown":
279
- A(!0), e.preventDefault();
287
+ A(!0), l.preventDefault();
280
288
  }
281
- }, Ce = (e) => {
282
- if (!l.disableKeyboardEvents)
283
- switch (e.key) {
289
+ }, Ke = (l) => {
290
+ if (!e.disableKeyboardEvents)
291
+ switch (l.key) {
284
292
  case "ArrowUp": {
285
293
  s.goToOption(
286
294
  -1
287
295
  /* Previous */
288
- ), e.preventDefault(), e.stopPropagation();
296
+ ), l.preventDefault(), l.stopPropagation();
289
297
  break;
290
298
  }
291
299
  case "ArrowDown": {
292
300
  s.goToOption(
293
301
  1
294
302
  /* Next */
295
- ), e.preventDefault(), e.stopPropagation();
303
+ ), l.preventDefault(), l.stopPropagation();
296
304
  break;
297
305
  }
298
306
  case "Escape": {
299
- A(!1), e.preventDefault();
307
+ A(!1), l.preventDefault();
300
308
  break;
301
309
  }
302
310
  case "PageUp": {
303
311
  s.goToOption(
304
312
  10
305
313
  /* NextPage */
306
- ), e.preventDefault();
314
+ ), l.preventDefault();
307
315
  break;
308
316
  }
309
317
  case "PageDown": {
310
318
  s.goToOption(
311
319
  -10
312
320
  /* PrevPage */
313
- ), e.preventDefault();
321
+ ), l.preventDefault();
314
322
  break;
315
323
  }
316
324
  case "Enter": {
317
- if (!O.value) {
325
+ if (!S.value) {
318
326
  A(!0);
319
327
  return;
320
328
  }
321
- G(o.value[f.value], f.value), s.mode === T.Single && !l.keepOpen && A(!1), e.preventDefault();
329
+ G(o.value[g.value], g.value), s.mode === w.Single && !e.keepOpen && A(!1), l.preventDefault();
322
330
  break;
323
331
  }
324
332
  }
325
- }, Ke = c(() => {
326
- if (l.loading)
333
+ }, Re = c(() => {
334
+ if (e.loading)
327
335
  return 8.5;
328
- const e = l.loadMoreLoading && g.MAX_NUMBER_OF_OPTIONS || l.customNumberOfDisplayedOptions || V.value.reduce((L, Re) => {
329
- const Ee = l.overrideOptionCountCalculation ? l.overrideOptionCountCalculation(Re.data) : 1;
330
- return L + Ee;
331
- }, 0), t = l.multi && l.showSelectAll && !h.value ? 1 : 0, i = e > g.MAX_NUMBER_OF_OPTIONS, S = e + t;
332
- let n = i ? g.MAX_NUMBER_OF_OPTIONS + 0.1 : S;
333
- return l.loadMoreLoading && l.multi && (V.value.length ? n = n + 0.1 : n = n - 0.9), l.noResultsText && n === 0 && (n = n + 1), l.withConditions && h.value && (n = n + 1), $e(
334
- n * ee.value + g.PADDING_PX
336
+ const l = e.loadMoreLoading && y.MAX_NUMBER_OF_OPTIONS || e.customNumberOfDisplayedOptions || V.value.reduce((L, Ee) => {
337
+ const _e = e.overrideOptionCountCalculation ? e.overrideOptionCountCalculation(Ee.data) : 1;
338
+ return L + _e;
339
+ }, 0), t = e.multi && e.showSelectAll && !O.value ? 1 : 0, i = l > y.MAX_NUMBER_OF_OPTIONS, f = l + t;
340
+ let u = i ? y.MAX_NUMBER_OF_OPTIONS + 0.1 : f;
341
+ return e.loadMoreLoading && e.multi && (V.value.length ? u = u + 0.1 : u = u - 0.9), e.noResultsText && u === 0 && (u = u + 1), e.withConditions && O.value && (u = u + 1), je(
342
+ u * ee.value + y.PADDING_PX
335
343
  );
336
344
  });
337
- return qe(
345
+ return Xe(
338
346
  k.ref,
339
347
  () => {
340
- !l.loadMoreLoading && l.infiniteLoading && v("loadMore");
348
+ !e.loadMoreLoading && e.infiniteLoading && d("loadMore");
341
349
  },
342
- { distance: l.infiniteScrollThreshold }
350
+ { distance: e.infiniteScrollThreshold }
343
351
  ), b(a, () => {
344
- v("unsavedSelectionUpdate", a.value);
352
+ d("unsavedSelectionUpdate", a.value);
345
353
  }), {
346
- onKeydown: Ce,
347
- location: fe,
348
- open: O,
354
+ onKeydown: Ke,
355
+ location: ge,
356
+ open: S,
349
357
  toggleMenu: A,
350
358
  onButtonKeydown: Ne,
351
- displayedValue: me,
359
+ displayedValue: Ae,
352
360
  labelRef: z,
353
- query: h,
361
+ query: O,
354
362
  containerProps: k,
355
- calculateTableHeight: Ke,
356
- wrapperProps: Te,
363
+ calculateTableHeight: Re,
364
+ wrapperProps: Ie,
357
365
  filteredOptions: o,
358
- allSelected: M,
359
- allSelectedApplied: D,
360
- isIndeterminate: Ae,
361
- onSelectAll: Ie,
366
+ allSelected: E,
367
+ allSelectedApplied: C,
368
+ isIndeterminate: be,
369
+ onSelectAll: xe,
362
370
  virtualOptions: V,
363
- isSelected: ce,
364
- selectedOption: u,
365
- selectedOptionPrevious: d,
371
+ isSelected: se,
372
+ selectedOption: n,
373
+ selectedOptionPrevious: v,
366
374
  selectedValue: F,
367
375
  onSelect: G,
368
- activeIndex: f,
376
+ activeIndex: g,
369
377
  onCancel: te,
370
378
  onApply: le,
371
- scrollTo: C,
379
+ scrollTo: P,
372
380
  onClickOutside: ne,
373
- listRef: w,
374
- buttonRef: I,
381
+ listRef: x,
382
+ buttonRef: D,
375
383
  apply: W,
376
384
  cancel: J,
377
385
  el: j,
378
- triggerRef: de,
386
+ triggerRef: ve,
379
387
  clearAll: Q,
380
- onClearAllSelections: xe,
388
+ onClearAllSelections: De,
381
389
  isGroup: q
382
390
  };
383
391
  };
384
392
  export {
385
- tl as dropdownCommon
393
+ al as dropdownCommon
386
394
  };
@@ -7,4 +7,5 @@ export declare const useGroupedOptions: (props: any) => {
7
7
  isIndeterminateGrouped: (filteredOptions: any, selectedOptionRef: Ref<unknown[]>) => boolean;
8
8
  allSelectedGrouped: (filteredOptions: any, selectedOptionRef: Ref<unknown[]>) => boolean;
9
9
  areAllPreviousSelected: (flatOptions: Ref<unknown[]>, selectedOptionPrevious: Ref<unknown[]>) => boolean;
10
+ groupedChildOptionsLength: (options: any) => number;
10
11
  };