@ironsource/shared-ui 2.1.7-rc.9 → 2.1.7-test.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 (74) hide show
  1. package/DataGrid.vue_vue_type_style_index_0_scoped_706b324e_lang.css +1 -0
  2. package/DefaultDropdownTrigger.vue_vue_type_style_index_0_scoped_98819e5a_lang.css +1 -0
  3. package/DropdownV4.vue_vue_type_style_index_0_scoped_00ccab6b_lang.css +1 -0
  4. package/EditableV4.vue_vue_type_style_index_0_scoped_e0c047b4_lang.css +1 -0
  5. package/IconV4.vue_vue_type_style_index_0_scoped_dc433d48_lang.css +1 -0
  6. package/MultipleDataGrid.vue_vue_type_style_index_0_scoped_82ba0e12_lang.css +1 -0
  7. package/OptionV4.vue_vue_type_style_index_0_scoped_77509f61_lang.css +1 -0
  8. package/README.md +1 -1
  9. package/SortableList.vue_vue_type_style_index_0_scoped_e9cd63b8_lang.css +1 -0
  10. package/TabsV4.vue_vue_type_style_index_0_scoped_f9433b11_lang.css +1 -0
  11. package/TextField.vue_vue_type_style_index_0_scoped_4d9bf5b2_lang.css +1 -0
  12. package/ThemeWrapper.vue_vue_type_style_index_0_scoped_66bd448a_lang.css +1 -0
  13. package/TreeDropdown.vue_vue_type_style_index_0_scoped_dbd80d49_lang.css +1 -0
  14. package/components/ThemeWrapper/ThemeWrapper.vue.js +2 -2
  15. package/components/ThemeWrapper/ThemeWrapper.vue2.js +5 -5
  16. package/components/appHeader/AppHeader.vue.d.ts +1 -1
  17. package/components/appHeader/index.d.ts +9 -9
  18. package/components/dropdown/common/Dropdown.common.js +89 -89
  19. package/components/dropdown/v4/DefaultDropdownTrigger.vue.d.ts +1 -0
  20. package/components/dropdown/v4/DefaultDropdownTrigger.vue.js +2 -2
  21. package/components/dropdown/v4/DefaultDropdownTrigger.vue2.js +32 -29
  22. package/components/dropdown/v4/DropdownV4.vue.d.ts +29 -0
  23. package/components/dropdown/v4/DropdownV4.vue.js +4 -4
  24. package/components/dropdown/v4/DropdownV4.vue2.js +186 -158
  25. package/components/dropdown/v4/OptionV4.vue.d.ts +26 -2
  26. package/components/dropdown/v4/OptionV4.vue.js +2 -2
  27. package/components/dropdown/v4/OptionV4.vue2.js +94 -71
  28. package/components/dropdown/v4/TreeDropdown.vue.d.ts +21 -16
  29. package/components/dropdown/v4/TreeDropdown.vue.js +3 -3
  30. package/components/dropdown/v4/TreeDropdown.vue2.js +170 -74
  31. package/components/dropdown/v4/index.d.ts +451 -82
  32. package/components/icon/v4/IconV4.vue.d.ts +5 -0
  33. package/components/icon/v4/IconV4.vue.js +4 -4
  34. package/components/icon/v4/IconV4.vue2.js +29 -26
  35. package/components/icon/v4/index.d.ts +20 -1
  36. package/components/input/v4/TextField.vue.js +3 -3
  37. package/components/input/v4/TextField.vue2.js +1 -1
  38. package/components/sortableList/SortableList.vue.d.ts +25 -0
  39. package/components/sortableList/SortableList.vue.js +4 -4
  40. package/components/sortableList/SortableList.vue2.js +129 -89
  41. package/components/sortableList/index.d.ts +88 -2
  42. package/components/table/v3/Table.vue.d.ts +2 -2
  43. package/components/table/v3/index.d.ts +39 -39
  44. package/components/table/v4/DataGrid.vue.d.ts +6 -2
  45. package/components/table/v4/DataGrid.vue.js +4 -4
  46. package/components/table/v4/DataGrid.vue2.js +131 -122
  47. package/components/table/v4/MultipleDataGrid.vue.d.ts +16 -3
  48. package/components/table/v4/MultipleDataGrid.vue.js +5 -5
  49. package/components/table/v4/MultipleDataGrid.vue2.js +112 -69
  50. package/components/table/v4/index.d.ts +92 -75
  51. package/components/table-cells/common/Editable.common.js +37 -26
  52. package/components/table-cells/common/EditableContext.d.ts +1 -0
  53. package/components/table-cells/v4/EditableV4.vue.d.ts +5 -0
  54. package/components/table-cells/v4/EditableV4.vue.js +5 -5
  55. package/components/table-cells/v4/EditableV4.vue2.js +18 -17
  56. package/components/table-cells/v4/index.d.ts +20 -1
  57. package/components/tabs/v4/TabsV4.vue.js +4 -4
  58. package/components/tabs/v4/TabsV4.vue2.js +37 -40
  59. package/design-foundation.stories/icons/iconsData.d.ts +6 -2
  60. package/index.d.ts +1694 -674
  61. package/mocks/options.d.ts +12 -0
  62. package/package.json +1 -1
  63. package/DataGrid.vue_vue_type_style_index_0_scoped_63aaf3be_lang.css +0 -1
  64. package/DefaultDropdownTrigger.vue_vue_type_style_index_0_scoped_0345d6b1_lang.css +0 -1
  65. package/DropdownV4.vue_vue_type_style_index_0_scoped_938772ee_lang.css +0 -1
  66. package/EditableV4.vue_vue_type_style_index_0_scoped_31bfb722_lang.css +0 -1
  67. package/IconV4.vue_vue_type_style_index_0_scoped_1eea7671_lang.css +0 -1
  68. package/MultipleDataGrid.vue_vue_type_style_index_0_scoped_1bdca43d_lang.css +0 -1
  69. package/OptionV4.vue_vue_type_style_index_0_scoped_b6a06f00_lang.css +0 -1
  70. package/SortableList.vue_vue_type_style_index_0_scoped_21842d59_lang.css +0 -1
  71. package/TabsV4.vue_vue_type_style_index_0_scoped_bab40cfe_lang.css +0 -1
  72. package/TextField.vue_vue_type_style_index_0_scoped_eb472aa3_lang.css +0 -1
  73. package/ThemeWrapper.vue_vue_type_style_index_0_scoped_b62ee695_lang.css +0 -1
  74. package/TreeDropdown.vue_vue_type_style_index_0_scoped_142eab98_lang.css +0 -1
@@ -1,18 +1,19 @@
1
- import "../../../TreeDropdown.vue_vue_type_style_index_0_scoped_142eab98_lang.css"; import { defineComponent as w, ref as S, watch as T, openBlock as u, createBlock as f, unref as o, withCtx as E, createVNode as N, withModifiers as k, createElementBlock as h, Fragment as B, renderList as x, createCommentVNode as z } from "vue";
2
- import V from "./DropdownV4.vue.js";
3
- import "./DefaultDropdownTrigger.vue.js";
1
+ import "../../../TreeDropdown.vue_vue_type_style_index_0_scoped_dbd80d49_lang.css"; import { defineComponent as $, provide as j, ref as r, watch as v, onMounted as F, openBlock as m, createBlock as T, unref as a, withCtx as K, createVNode as k, normalizeProps as J, guardReactiveProps as R, renderSlot as G, withModifiers as U, createElementBlock as N, withDirectives as H, createElementVNode as Q, Fragment as W, renderList as X, vShow as Y, createCommentVNode as Z } from "vue";
2
+ import _ from "./DropdownV4.vue.js";
3
+ import ee from "./DefaultDropdownTrigger.vue.js";
4
4
  import "./IconButtonDropdownTrigger.vue.js";
5
5
  import "./ChipDropdownTrigger.vue.js";
6
6
  import "./AppDropdownTrigger.vue.js";
7
7
  import "./ButtonDropdownTrigger.vue.js";
8
8
  import "./ButtonFilterDropdownTrigger.vue.js";
9
9
  import "./TreeDropdown.vue.js";
10
- import v from "./OptionV4.vue.js";
11
- import { useChildOptions as D } from "../composables/useChildOptions.js";
12
- const P = {
10
+ import q from "./OptionV4.vue.js";
11
+ import { useChildOptions as ne } from "../composables/useChildOptions.js";
12
+ import le from "../../search/v4/SearchV4.vue.js";
13
+ const oe = {
13
14
  key: 0,
14
15
  class: "child-options"
15
- }, Q = /* @__PURE__ */ w({
16
+ }, ve = /* @__PURE__ */ $({
16
17
  __name: "TreeDropdown",
17
18
  props: {
18
19
  options: null,
@@ -32,91 +33,186 @@ const P = {
32
33
  optionEndIconType: { default: null },
33
34
  valueToCopy: { default: null },
34
35
  disabledOptionKey: { default: "disabled" },
35
- optionChildrenKey: { default: "" }
36
+ optionChildrenKey: null,
37
+ optionUniqueIdKey: null
36
38
  },
37
39
  emits: ["update:selected", "update:isOpen"],
38
- setup(e, { emit: y }) {
39
- const a = e, l = S(a.selected);
40
- T(
41
- () => a.selected,
40
+ setup(o, { emit: I }) {
41
+ const l = o;
42
+ j("isTreeDropdown", !0);
43
+ const f = r([]), h = r([]), w = r({}), O = r(!1), i = r([...l.selected]), u = r("");
44
+ v(
45
+ i,
42
46
  () => {
43
- l.value = [...a.selected];
47
+ console.log("localSelection updated", JSON.stringify(i.value));
48
+ },
49
+ {
50
+ immediate: !0
51
+ }
52
+ ), F(() => {
53
+ O.value || (l.options.forEach((n) => {
54
+ n[l.optionChildrenKey] && n[l.optionChildrenKey].length && (w.value[n[l.optionUniqueIdKey]] = [
55
+ ...n[l.optionChildrenKey]
56
+ ]);
57
+ }), f.value = [...l.options], h.value = [...l.options], O.value = !0);
58
+ }), v(
59
+ () => l.selected,
60
+ () => {
61
+ i.value = [...l.selected];
44
62
  }
45
63
  );
46
- const { hasChildren: c, getChildren: d, allChildrenSelected: r, someChildrenSelected: K } = D(l, a.optionChildrenKey), p = (n) => {
47
- if (c(n)) {
48
- r(n) ? l.value = l.value.filter(
49
- (i) => !d(n).includes(i)
50
- ) : l.value = [
51
- ...l.value.filter((i) => !d(n).includes(i)),
52
- ...d(n)
64
+ const { hasChildren: p, getChildren: y, allChildrenSelected: g, someChildrenSelected: V } = ne(i, l.optionChildrenKey), S = (n) => {
65
+ if (p(n)) {
66
+ g(n) ? i.value = i.value.filter(
67
+ (t) => !y(n).includes(t)
68
+ ) : i.value = [
69
+ ...i.value.filter((t) => !y(n).includes(t)),
70
+ ...y(n)
53
71
  ];
54
72
  return;
55
73
  }
56
- l.value.includes(n) ? l.value = l.value.filter(
57
- (i) => i !== n
58
- ) : l.value = [...l.value, n];
59
- }, m = (n) => l.value.includes(n), C = (n) => 1 + (c(n) ? d(n).length : 0), I = () => {
60
- y("update:selected", l.value);
61
- }, g = () => {
62
- l.value = [];
74
+ i.value.includes(n) ? i.value = i.value.filter(
75
+ (t) => t !== n
76
+ ) : i.value = [...i.value, n];
77
+ }, b = (n) => i.value.includes(n), z = (n) => 1 + (p(n) ? y(n).length : 0), D = () => {
78
+ I("update:selected", i.value);
79
+ }, x = () => {
80
+ i.value = [];
81
+ }, B = () => {
82
+ const n = /* @__PURE__ */ new Set([]);
83
+ h.value.forEach((e) => {
84
+ if (l.selected?.includes(e))
85
+ n.add(e);
86
+ else if (e[l.optionChildrenKey] && e[l.optionChildrenKey].length) {
87
+ for (const s of e[l.optionChildrenKey])
88
+ if (l.selected?.includes(s)) {
89
+ n.add(e);
90
+ break;
91
+ }
92
+ }
93
+ });
94
+ const t = Array.from(n);
95
+ return h.value.forEach((e) => {
96
+ !l.selected.includes(e) && !n.has(e) && t.push(e);
97
+ }), t;
98
+ };
99
+ v(
100
+ () => l.isOpen,
101
+ () => {
102
+ l.isOpen ? f.value = B() : (i.value = [...l.selected], u.value = "");
103
+ }
104
+ );
105
+ const d = r({}), M = (n) => {
106
+ d.value[n[l.optionUniqueIdKey]] ? delete d.value[n[l.optionUniqueIdKey]] : d.value[n[l.optionUniqueIdKey]] = 1;
63
107
  };
64
- return (n, i) => (u(), f(o(V), {
108
+ function P(n, t) {
109
+ const e = n.toLowerCase(), s = [];
110
+ return t.value.forEach((c) => {
111
+ const C = c[l.optionNameKey].toLowerCase().includes(e), E = w.value[c[l.optionUniqueIdKey]]?.filter(
112
+ (L) => L[l.optionNameKey].toLowerCase().includes(e)
113
+ ) || [];
114
+ (C || E.length > 0) && (c[l.optionChildrenKey] = E, s.push(c));
115
+ }), s;
116
+ }
117
+ const A = (n) => {
118
+ const t = P(n, h);
119
+ n && (Object.keys(d.value).forEach((e) => {
120
+ delete d.value[e];
121
+ }), t.forEach((e) => {
122
+ Array.isArray(e[l.optionChildrenKey]) && e[l.optionChildrenKey].length && (d.value[e[l.optionUniqueIdKey]] = 1);
123
+ })), f.value = t;
124
+ };
125
+ return v(
126
+ () => u.value,
127
+ () => {
128
+ A(u.value);
129
+ }
130
+ ), (n, t) => (m(), T(a(_), {
65
131
  multi: "",
66
132
  class: "tree-dropdown",
67
133
  "show-select-all": !1,
68
- "is-open": e.isOpen,
69
- options: e.options,
70
- selected: e.selected,
71
- "display-value": e.displayValue,
72
- placeholder: e.placeholder,
73
- "inline-search-placeholder": e.inlineSearchPlaceholder,
74
- "option-name-key": e.optionNameKey,
75
- size: e.size,
76
- "test-id": e.testId,
77
- disabled: e.disabled,
134
+ "is-open": o.isOpen,
135
+ options: f.value,
136
+ selected: o.selected,
137
+ "display-value": o.displayValue,
138
+ placeholder: o.placeholder,
139
+ "inline-search": "",
140
+ "inline-search-placeholder": o.inlineSearchPlaceholder,
141
+ "option-name-key": o.optionNameKey,
142
+ size: o.size,
143
+ "test-id": o.testId,
144
+ disabled: o.disabled,
78
145
  "disable-virtual-scroll": "",
79
- "override-option-count-calculation": C,
146
+ "override-option-count-calculation": z,
80
147
  "trigger-show-all-selected-text": !1,
81
- "onUpdate:selected": i[0] || (i[0] = (t) => y("update:selected", t)),
82
- "onUpdate:isOpen": i[1] || (i[1] = (t) => y("update:isOpen", t)),
83
- onApply: I,
84
- onClear: g
148
+ "predefined-trigger": "default",
149
+ "onUpdate:isOpen": t[1] || (t[1] = (e) => I("update:isOpen", e)),
150
+ onApply: D,
151
+ onClear: x
85
152
  }, {
86
- default: E(({ option: t, index: b }) => [
87
- N(o(v), {
88
- option: t,
89
- "selected-prop": o(c)(t) ? o(r)(t) : m(t),
90
- "is-indeterminate": !o(r)(t) && o(K)(t),
91
- disabled: t[e.disabledOptionKey],
92
- "name-key": e.optionNameKey,
93
- "image-key": e.optionImageKey,
94
- "icon-key": e.optionIconKey,
95
- "icon-type": e.optionIconType,
96
- "end-icon-key": e.optionEndIconKey,
97
- "end-icon-type": e.optionEndIconType,
98
- onClick: k(() => p(t), ["stop"])
99
- }, null, 8, ["option", "selected-prop", "is-indeterminate", "disabled", "name-key", "image-key", "icon-key", "icon-type", "end-icon-key", "end-icon-type", "onClick"]),
100
- o(c)(t) ? (u(), h("div", P, [
101
- (u(!0), h(B, null, x(o(d)(t), (s, O) => (u(), f(o(v), {
102
- key: `${b}-${O}`,
103
- option: s,
104
- "selected-prop": m(s),
105
- disabled: s[e.disabledOptionKey],
106
- "name-key": e.optionNameKey,
107
- "image-key": e.optionImageKey,
108
- "icon-key": e.optionIconKey,
109
- "icon-type": e.optionIconType,
110
- "end-icon-key": e.optionEndIconKey,
111
- "end-icon-type": e.optionEndIconType,
112
- onClick: k(() => p(s), ["stop"])
113
- }, null, 8, ["option", "selected-prop", "disabled", "name-key", "image-key", "icon-key", "icon-type", "end-icon-key", "end-icon-type", "onClick"]))), 128))
114
- ])) : z("", !0)
153
+ "dropdown-trigger": K(({ defaultTriggerProps: e }) => [
154
+ k(a(ee), J(R(e)), {
155
+ "end-icon": K(() => [
156
+ G(n.$slots, "trigger-end-icon", {}, void 0, !0)
157
+ ]),
158
+ _: 2
159
+ }, 1040)
160
+ ]),
161
+ "inline-search": K(() => [
162
+ k(a(le), {
163
+ modelValue: u.value,
164
+ "onUpdate:modelValue": t[0] || (t[0] = (e) => u.value = e),
165
+ placeholder: o.inlineSearchPlaceholder,
166
+ variant: "transparent",
167
+ size: "md",
168
+ "auto-focus": "",
169
+ "test-id": o.testId
170
+ }, null, 8, ["modelValue", "placeholder", "test-id"])
171
+ ]),
172
+ default: K(({ option: e, index: s }) => [
173
+ k(a(q), {
174
+ option: e,
175
+ "selected-prop": a(p)(e) ? a(g)(e) : b(e),
176
+ "is-indeterminate": !a(g)(e) && a(V)(e),
177
+ disabled: e[o.disabledOptionKey],
178
+ "name-key": o.optionNameKey,
179
+ "image-key": o.optionImageKey,
180
+ "icon-key": o.optionIconKey,
181
+ "icon-type": o.optionIconType,
182
+ "end-icon-key": o.optionEndIconKey,
183
+ "end-icon-type": o.optionEndIconType,
184
+ "tree-main-option": a(p)(e),
185
+ "tree-main-option-expanded": d.value[e[o.optionUniqueIdKey]],
186
+ "stop-option-click-event-propagation": "",
187
+ onClick: U(() => S(e), ["stop"]),
188
+ onToggleTreeCollapse: M
189
+ }, null, 8, ["option", "selected-prop", "is-indeterminate", "disabled", "name-key", "image-key", "icon-key", "icon-type", "end-icon-key", "end-icon-type", "tree-main-option", "tree-main-option-expanded", "onClick"]),
190
+ a(p)(e) ? (m(), N("div", oe, [
191
+ H(Q("div", null, [
192
+ (m(!0), N(W, null, X(a(y)(e), (c, C) => (m(), T(a(q), {
193
+ key: `${s}-${C}`,
194
+ option: c,
195
+ "selected-prop": b(c),
196
+ disabled: c[o.disabledOptionKey],
197
+ "name-key": o.optionNameKey,
198
+ "image-key": o.optionImageKey,
199
+ "icon-key": o.optionIconKey,
200
+ "icon-type": o.optionIconType,
201
+ "end-icon-key": o.optionEndIconKey,
202
+ "end-icon-type": o.optionEndIconType,
203
+ "tree-child-shown": d.value[e[o.optionUniqueIdKey]],
204
+ "stop-option-click-event-propagation": "",
205
+ onClick: U(() => S(c), ["stop"])
206
+ }, null, 8, ["option", "selected-prop", "disabled", "name-key", "image-key", "icon-key", "icon-type", "end-icon-key", "end-icon-type", "tree-child-shown", "onClick"]))), 128))
207
+ ], 512), [
208
+ [Y, d.value[e[o.optionUniqueIdKey]]]
209
+ ])
210
+ ])) : Z("", !0)
115
211
  ]),
116
- _: 1
212
+ _: 3
117
213
  }, 8, ["is-open", "options", "selected", "display-value", "placeholder", "inline-search-placeholder", "option-name-key", "size", "test-id", "disabled"]));
118
214
  }
119
215
  });
120
216
  export {
121
- Q as default
217
+ ve as default
122
218
  };