@ironsource/shared-ui 2.1.12-rc.48 → 2.1.12-rc.49

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/ColumnConfigurator.vue_vue_type_style_index_0_scoped_c13770d4_lang.css +1 -0
  2. package/DataGrid.vue_vue_type_style_index_0_scoped_ef67c78e_lang.css +1 -0
  3. package/DataGridContainer.vue_vue_type_style_index_0_scoped_9a30b10c_lang.css +1 -0
  4. package/Link.vue_vue_type_style_index_0_scoped_1a766750_lang.css +1 -0
  5. package/LoaderBars.vue_vue_type_style_index_0_scoped_d976ec65_lang.css +1 -0
  6. package/SectionDropdown.vue_vue_type_style_index_0_scoped_cfad60a8_lang.css +1 -0
  7. package/SectionHeaderText.vue_vue_type_style_index_0_scoped_0b8d3d79_lang.css +1 -0
  8. package/ShowMoreLink.vue_vue_type_style_index_0_scoped_9fc3bc1b_lang.css +1 -0
  9. package/SortableItem.vue_vue_type_style_index_0_scoped_c72be7ed_lang.css +1 -0
  10. package/SortableList.vue_vue_type_style_index_0_scoped_9aec4e9b_lang.css +1 -0
  11. package/SortableSelectableList.vue_vue_type_style_index_0_scoped_40b0a4de_lang.css +1 -0
  12. package/components/columnConfigurator/ColumnConfigurator.types.d.ts +12 -0
  13. package/components/columnConfigurator/ColumnConfigurator.vue.d.ts +61 -0
  14. package/components/columnConfigurator/ColumnConfigurator.vue.js +7 -0
  15. package/components/columnConfigurator/ColumnConfigurator.vue2.js +113 -0
  16. package/components/columnConfigurator/SectionDropdown.vue.d.ts +39 -0
  17. package/components/columnConfigurator/SectionDropdown.vue.js +7 -0
  18. package/components/columnConfigurator/SectionDropdown.vue2.js +57 -0
  19. package/components/columnConfigurator/SectionHeaderText.vue.d.ts +34 -0
  20. package/components/columnConfigurator/SectionHeaderText.vue.js +7 -0
  21. package/components/columnConfigurator/SectionHeaderText.vue2.js +22 -0
  22. package/components/columnConfigurator/ShowMoreLink.vue.d.ts +33 -0
  23. package/components/columnConfigurator/ShowMoreLink.vue.js +7 -0
  24. package/components/columnConfigurator/ShowMoreLink.vue2.js +41 -0
  25. package/components/columnConfigurator/consts.d.ts +1 -0
  26. package/components/columnConfigurator/consts.js +4 -0
  27. package/components/columnConfigurator/index.d.ts +72 -0
  28. package/components/columnConfigurator/index.js +6 -0
  29. package/components/columnConfigurator/mockData.d.ts +30 -0
  30. package/components/columnConfigurator/utils.d.ts +2 -0
  31. package/components/columnConfigurator/utils.js +18 -0
  32. package/components/columnPicker/ColumnPicker.vue.d.ts +1 -1
  33. package/components/columnPicker/index.d.ts +20 -20
  34. package/components/link/Link.vue.d.ts +5 -0
  35. package/components/link/Link.vue.js +3 -3
  36. package/components/link/Link.vue2.js +36 -28
  37. package/components/link/index.d.ts +20 -1
  38. package/components/sortableList/LoaderBars.vue.d.ts +34 -0
  39. package/components/sortableList/LoaderBars.vue.js +7 -0
  40. package/components/sortableList/LoaderBars.vue2.js +25 -0
  41. package/components/sortableList/SortableItem.vue.js +4 -4
  42. package/components/sortableList/SortableItem.vue2.js +3 -3
  43. package/components/sortableList/SortableList.vue.d.ts +2 -2
  44. package/components/sortableList/SortableList.vue.js +5 -5
  45. package/components/sortableList/SortableList.vue2.js +96 -106
  46. package/components/sortableList/SortableSelectableList.vue.d.ts +107 -0
  47. package/components/sortableList/SortableSelectableList.vue.js +7 -0
  48. package/components/sortableList/SortableSelectableList.vue2.js +128 -0
  49. package/components/sortableList/composables/useDraggableHelpers.d.ts +5 -0
  50. package/components/sortableList/composables/useDraggableHelpers.js +20 -0
  51. package/components/sortableList/consts.d.ts +2 -0
  52. package/components/sortableList/consts.js +4 -2
  53. package/components/sortableList/index.d.ts +39 -39
  54. package/components/table/v4/DataGrid.vue.d.ts +4 -3
  55. package/components/table/v4/DataGrid.vue.js +5 -5
  56. package/components/table/v4/DataGrid.vue2.js +349 -331
  57. package/components/table/v4/DataGridContainer.vue.d.ts +10 -0
  58. package/components/table/v4/DataGridContainer.vue.js +7 -0
  59. package/components/table/v4/DataGridContainer.vue2.js +19 -0
  60. package/components/table/v4/DataGridHeader.vue.d.ts +1 -1
  61. package/components/table/v4/MultipleDataGrid.vue.d.ts +2 -2
  62. package/components/table/v4/index.d.ts +104 -103
  63. package/index.d.ts +287 -284
  64. package/index.js +82 -78
  65. package/package.json +5 -1
  66. package/testids/index.d.ts +8 -0
  67. package/testids/index.js +34 -33
  68. package/utils/object.d.ts +2 -0
  69. package/utils/object.js +9 -5
  70. package/utils/search.js +1 -1
  71. package/DataGrid.vue_vue_type_style_index_0_scoped_da7631e0_lang.css +0 -1
  72. package/Link.vue_vue_type_style_index_0_scoped_b10e2439_lang.css +0 -1
  73. package/SortableItem.vue_vue_type_style_index_0_scoped_800cd503_lang.css +0 -1
  74. package/SortableList.vue_vue_type_style_index_0_scoped_84dc8525_lang.css +0 -1
@@ -1,21 +1,22 @@
1
- import "../../SortableList.vue_vue_type_style_index_0_scoped_84dc8525_lang.css"; import { defineComponent as z, useCssVars as G, useSlots as U, computed as f, ref as K, openBlock as s, createElementBlock as i, mergeProps as V, unref as l, normalizeClass as Q, renderSlot as y, createCommentVNode as h, createBlock as S, isRef as $, withCtx as I, Fragment as x, renderList as B, createSlots as w, createElementVNode as j, createVNode as E, createTextVNode as J, toDisplayString as W } from "vue";
2
- import { VueDraggable as X } from "vue-draggable-plus";
3
- import N from "./SortableItem.vue.js";
4
- import Y from "../search/v4/SearchV4.vue.js";
5
- import Z from "../typography/v4/Typography.vue.js";
6
- import _ from "../skeleton/v4/SkeletonV4.vue.js";
7
- import { useVModel as ee } from "@vueuse/core";
8
- import { matchString as q } from "../../utils/search.js";
9
- import { useTestIdAttrs as te } from "../../utils/testIds.js";
10
- import { SortableListTestIdModifiers as p } from "../../testids/index.js";
11
- import { DRAG_CURSOR_CSS_CLASS as O } from "./consts.js";
12
- const le = {
1
+ import "../../SortableList.vue_vue_type_style_index_0_scoped_9aec4e9b_lang.css"; import { defineComponent as M, useCssVars as P, useSlots as z, computed as g, openBlock as s, createElementBlock as u, mergeProps as T, unref as t, normalizeClass as U, renderSlot as f, createCommentVNode as c, createBlock as S, isRef as x, withCtx as p, Fragment as D, renderList as H, createSlots as R, createVNode as w, createTextVNode as K, toDisplayString as Q } from "vue";
2
+ import { VueDraggable as j } from "vue-draggable-plus";
3
+ import $ from "./SortableItem.vue.js";
4
+ import J from "./LoaderBars.vue.js";
5
+ import W from "../search/v4/SearchV4.vue.js";
6
+ import X from "../typography/v4/Typography.vue.js";
7
+ import { useVModel as Y } from "@vueuse/core";
8
+ import { matchString as N } from "../../utils/search.js";
9
+ import { useTestIdAttrs as Z } from "../../utils/testIds.js";
10
+ import { SortableListTestIdModifiers as I } from "../../testids/index.js";
11
+ import { useDraggableHelpers as _ } from "./composables/useDraggableHelpers.js";
12
+ import { DRAGGABLE_HANDLE_SELECTOR as ee, DRAGGABLE_AREA_SELECTOR as le } from "./consts.js";
13
+ const te = {
13
14
  key: 1,
14
15
  class: "sortable-list-container"
15
- }, ae = { class: "loader-bars" }, de = {
16
+ }, ae = {
16
17
  key: 3,
17
18
  class: "empty-state-title"
18
- }, me = /* @__PURE__ */ z({
19
+ }, me = /* @__PURE__ */ M({
19
20
  __name: "SortableList",
20
21
  props: {
21
22
  items: { default: () => [] },
@@ -38,147 +39,136 @@ const le = {
38
39
  testId: { default: "" }
39
40
  },
40
41
  emits: ["sortableItemDragged", "update:items", "update:openId", "update:selectedId", "update:selectedChildId", "update:search", "clearSearch"],
41
- setup(a, { emit: r }) {
42
- const o = a;
43
- G((t) => ({
44
- dbaa7dcc: a.zIndexBase
42
+ setup(a, { emit: n }) {
43
+ const r = a;
44
+ P((l) => ({
45
+ "0d58eb02": a.zIndexBase
45
46
  }));
46
- const m = U(), u = ee(o, "search", r), b = f(() => !!u.value?.trim()), k = f(() => b.value ? o.items.filter((t) => {
47
- const d = t.children || [], e = u.value;
48
- return o.searchHandler ? o.searchHandler(t, e) : q(t.displayText, e) || // match parent item
49
- d.some((n) => q(n.displayText, e));
50
- }) : o.items), g = f({
47
+ const y = z(), i = Y(r, "search", n), b = g(() => !!i.value?.trim()), C = g(() => b.value ? r.items.filter((l) => {
48
+ const d = l.children || [], e = i.value;
49
+ return r.searchHandler ? r.searchHandler(l, e) : N(l.displayText, e) || // match parent item
50
+ d.some((o) => N(o.displayText, e));
51
+ }) : r.items), h = g({
51
52
  get() {
52
- return k.value.filter((t) => !t.isLocked);
53
+ return C.value.filter((l) => !l.isLocked);
53
54
  },
54
- set(t) {
55
- r("update:items", [...t, ...C.value]);
55
+ set(l) {
56
+ n("update:items", [...l, ...k.value]);
56
57
  }
57
- }), C = f(
58
- () => k.value.filter((t) => t.isLocked)
59
- ), F = f(
60
- () => o.draggableArea === "handle" ? ".draggable-handle" : ".handle-area"
61
- ), L = K(!1), M = (t) => {
62
- L.value = !0, setTimeout(() => t.target.classList.add(O), 50);
63
- }, P = (t) => {
64
- const { target: d, item: e, newIndex: n } = t;
65
- L.value = !1, d.classList.remove(O);
66
- const c = e.attributes["data-id"]?.value;
67
- r("sortableItemDragged", { id: c, newIndex: n });
68
- }, A = (t) => (b.value || t.id === o.openId) && !L.value, D = (t, d) => {
69
- d ? r("update:openId", t.id) : r("update:openId", null);
70
- }, v = (t) => t.id === o.selectedId, H = (t) => {
71
- r("update:selectedId", t.id), r("update:selectedChildId", null);
72
- }, R = (t, d) => {
73
- r("update:selectedChildId", t.id), r("update:selectedId", d.id), r("update:openId", d.id);
74
- }, T = te(o.testId, p);
75
- return (t, d) => (s(), i("div", V({ class: "sortable-list-and-header-container" }, l(T)[l(p).CONTAINER]), [
76
- l(m).header || a.showSearch ? (s(), i("div", {
58
+ }), k = g(
59
+ () => C.value.filter((l) => l.isLocked)
60
+ ), G = g(
61
+ () => r.draggableArea === "handle" ? ee : le
62
+ ), { onDragStart: O, onDragEnd: q, draggingInProgress: F } = _(n), A = (l) => (b.value || l.id === r.openId) && !F.value, E = (l, d) => {
63
+ d ? n("update:openId", l.id) : n("update:openId", null);
64
+ }, m = (l) => l.id === r.selectedId, V = (l) => {
65
+ n("update:selectedId", l.id), n("update:selectedChildId", null);
66
+ }, B = (l, d) => {
67
+ n("update:selectedChildId", l.id), n("update:selectedId", d.id), n("update:openId", d.id);
68
+ }, L = Z(r.testId, I);
69
+ return (l, d) => (s(), u("div", T({ class: "sortable-list-and-header-container" }, t(L)[t(I).CONTAINER]), [
70
+ t(y).header || a.showSearch ? (s(), u("div", {
77
71
  key: 0,
78
- class: Q(["header-container", { sticky: a.isSticky }])
72
+ class: U(["header-container", { sticky: a.isSticky }])
79
73
  }, [
80
- l(m).header ? y(t.$slots, "header", { key: 0 }, void 0, !0) : h("", !0),
81
- a.showSearch ? (s(), S(l(Y), {
74
+ t(y).header ? f(l.$slots, "header", { key: 0 }, void 0, !0) : c("", !0),
75
+ a.showSearch ? (s(), S(t(W), {
82
76
  key: 1,
83
- modelValue: l(u),
84
- "onUpdate:modelValue": d[0] || (d[0] = (e) => $(u) ? u.value = e : null),
77
+ modelValue: t(i),
78
+ "onUpdate:modelValue": d[0] || (d[0] = (e) => x(i) ? i.value = e : null),
85
79
  placeholder: a.searchPlaceholder,
86
80
  "test-id": a.testId,
87
- onOnClear: d[1] || (d[1] = (e) => r("clearSearch"))
88
- }, null, 8, ["modelValue", "placeholder", "test-id"])) : h("", !0)
89
- ], 2)) : h("", !0),
90
- a.isLoading ? y(t.$slots, "loader", { key: 2 }, () => [
91
- j("div", ae, [
92
- (s(!0), i(x, null, B(a.loadingRowCount, (e) => (s(), i("div", { key: e }, [
93
- E(l(_), {
94
- round: "",
95
- class: "loader-bar"
96
- })
97
- ]))), 128))
98
- ])
99
- ], !0) : (s(), i("div", le, [
100
- l(g).length ? (s(), S(l(X), V({
81
+ onOnClear: d[1] || (d[1] = (e) => n("clearSearch"))
82
+ }, null, 8, ["modelValue", "placeholder", "test-id"])) : c("", !0)
83
+ ], 2)) : c("", !0),
84
+ a.isLoading ? f(l.$slots, "loader", { key: 2 }, () => [
85
+ w(J, {
86
+ "loading-row-count": a.loadingRowCount,
87
+ variant: a.variant
88
+ }, null, 8, ["loading-row-count", "variant"])
89
+ ], !0) : (s(), u("div", te, [
90
+ t(h).length ? (s(), S(t(j), T({
101
91
  key: 0,
102
- modelValue: l(g),
103
- "onUpdate:modelValue": d[2] || (d[2] = (e) => $(g) ? g.value = e : null),
92
+ modelValue: t(h),
93
+ "onUpdate:modelValue": d[2] || (d[2] = (e) => x(h) ? h.value = e : null),
104
94
  class: "sortable-list",
105
95
  filter: ".expand-icon",
106
96
  animation: 150,
107
- handle: l(F),
108
- disabled: l(b)
109
- }, l(T)[l(p).DRAGGABLE_LIST], {
110
- onStart: M,
111
- onEnd: P
97
+ handle: t(G),
98
+ disabled: t(b)
99
+ }, t(L)[t(I).DRAGGABLE_LIST], {
100
+ onStart: t(O),
101
+ onEnd: t(q)
112
102
  }), {
113
- default: I(() => [
114
- (s(!0), i(x, null, B(l(g), (e, n) => (s(), S(N, {
103
+ default: p(() => [
104
+ (s(!0), u(D, null, H(t(h), (e, o) => (s(), S($, {
115
105
  key: e.id,
116
106
  "data-id": e.id,
117
107
  item: e,
118
- index: n,
108
+ index: o,
119
109
  "is-open": A(e),
120
- "is-selected": v(e),
110
+ "is-selected": m(e),
121
111
  "is-disabled": !!e.isDisabled,
122
- "selected-child-id": v(e) ? a.selectedChildId : null,
112
+ "selected-child-id": m(e) ? a.selectedChildId : null,
123
113
  "display-value": a.displayValue,
124
- "search-query": l(u),
114
+ "search-query": t(i),
125
115
  "search-handler": a.searchHandler,
126
116
  variant: a.variant,
127
117
  "draggable-area": a.draggableArea,
128
- onToggle: (c) => D(e, c),
129
- onSelect: (c) => H(e),
130
- onSelectChild: (c) => R(c, e)
131
- }, w({ _: 2 }, [
132
- l(m).menu ? {
118
+ onToggle: (v) => E(e, v),
119
+ onSelect: (v) => V(e),
120
+ onSelectChild: (v) => B(v, e)
121
+ }, R({ _: 2 }, [
122
+ t(y).menu ? {
133
123
  name: "menu",
134
- fn: I(() => [
135
- y(t.$slots, "menu", { item: e }, void 0, !0)
124
+ fn: p(() => [
125
+ f(l.$slots, "menu", { item: e }, void 0, !0)
136
126
  ]),
137
127
  key: "0"
138
128
  } : void 0
139
129
  ]), 1032, ["data-id", "item", "index", "is-open", "is-selected", "is-disabled", "selected-child-id", "display-value", "search-query", "search-handler", "variant", "draggable-area", "onToggle", "onSelect", "onSelectChild"]))), 128))
140
130
  ]),
141
131
  _: 3
142
- }, 16, ["modelValue", "handle", "disabled"])) : h("", !0),
143
- l(C).length ? (s(), i("div", V({
132
+ }, 16, ["modelValue", "handle", "disabled", "onStart", "onEnd"])) : c("", !0),
133
+ t(k).length ? (s(), u("div", T({
144
134
  key: 1,
145
135
  class: "locked-list"
146
- }, l(T)[l(p).LOCKED_LIST]), [
147
- (s(!0), i(x, null, B(l(C), (e) => (s(), S(N, {
136
+ }, t(L)[t(I).LOCKED_LIST]), [
137
+ (s(!0), u(D, null, H(t(k), (e) => (s(), S($, {
148
138
  key: e.id,
149
139
  item: e,
150
140
  "is-open": A(e),
151
- "is-selected": v(e),
152
- "selected-child-id": v(e) ? a.selectedChildId : null,
141
+ "is-selected": m(e),
142
+ "selected-child-id": m(e) ? a.selectedChildId : null,
153
143
  "display-value": a.displayValue,
154
- "search-query": l(u),
144
+ "search-query": t(i),
155
145
  "on-search": a.searchHandler,
156
146
  "child-list-max-height": a.childListMaxHeight,
157
147
  variant: a.variant,
158
- onToggle: (n) => D(e, n),
159
- onSelect: (n) => H(e),
160
- onSelectChild: (n) => R(n, e)
161
- }, w({ _: 2 }, [
162
- l(m).menu ? {
148
+ onToggle: (o) => E(e, o),
149
+ onSelect: (o) => V(e),
150
+ onSelectChild: (o) => B(o, e)
151
+ }, R({ _: 2 }, [
152
+ t(y).menu ? {
163
153
  name: "menu",
164
- fn: I(() => [
165
- y(t.$slots, "menu", { item: e }, void 0, !0)
154
+ fn: p(() => [
155
+ f(l.$slots, "menu", { item: e }, void 0, !0)
166
156
  ]),
167
157
  key: "0"
168
158
  } : void 0
169
159
  ]), 1032, ["item", "is-open", "is-selected", "selected-child-id", "display-value", "search-query", "on-search", "child-list-max-height", "variant", "onToggle", "onSelect", "onSelectChild"]))), 128))
170
- ], 16)) : h("", !0)
160
+ ], 16)) : c("", !0)
171
161
  ])),
172
- !l(k).length && !a.isLoading ? (s(), i("div", de, [
173
- y(t.$slots, "empty-state", {}, () => [
174
- E(l(Z), { variant: "body2" }, {
175
- default: I(() => [
176
- J(W(a.emptyStateTitle), 1)
162
+ !t(C).length && !a.isLoading ? (s(), u("div", ae, [
163
+ f(l.$slots, "empty-state", {}, () => [
164
+ w(t(X), { variant: "body2" }, {
165
+ default: p(() => [
166
+ K(Q(a.emptyStateTitle), 1)
177
167
  ]),
178
168
  _: 1
179
169
  })
180
170
  ], !0)
181
- ])) : h("", !0)
171
+ ])) : c("", !0)
182
172
  ], 16));
183
173
  }
184
174
  });
@@ -0,0 +1,107 @@
1
+ import { SortableListItem } from '@/components/sortableList/SortableList.types';
2
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
3
+ items: SortableListItem[];
4
+ displayValue?: (item: SortableListItem) => string;
5
+ openId?: string | number;
6
+ selectedChildPerItem?: Record<string | number, string | number>;
7
+ variant?: "default" | "compact";
8
+ draggableArea?: "handle" | "full";
9
+ isLoading?: boolean;
10
+ loadingRowCount?: number;
11
+ alwaysVisibleCount?: number;
12
+ zIndexBase?: number;
13
+ testId?: string;
14
+ }>, {
15
+ items: () => any[];
16
+ displayValue: (item: SortableListItem) => string;
17
+ openId: any;
18
+ selectedChildPerItem: () => {};
19
+ alwaysVisibleCount: any;
20
+ variant: string;
21
+ draggableArea: string;
22
+ isLoading: boolean;
23
+ loadingRowCount: number;
24
+ zIndexBase: number;
25
+ testId: string;
26
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
27
+ sortableItemDragged: (event: {
28
+ id: string;
29
+ newIndex: number;
30
+ }) => void;
31
+ "update:items": (items: SortableListItem[]) => void;
32
+ "update:openId": (id: string | number) => void;
33
+ "update:selectedChildPerItem": (value: Record<string | number, string | number>) => void;
34
+ }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
35
+ items: SortableListItem[];
36
+ displayValue?: (item: SortableListItem) => string;
37
+ openId?: string | number;
38
+ selectedChildPerItem?: Record<string | number, string | number>;
39
+ variant?: "default" | "compact";
40
+ draggableArea?: "handle" | "full";
41
+ isLoading?: boolean;
42
+ loadingRowCount?: number;
43
+ alwaysVisibleCount?: number;
44
+ zIndexBase?: number;
45
+ testId?: string;
46
+ }>, {
47
+ items: () => any[];
48
+ displayValue: (item: SortableListItem) => string;
49
+ openId: any;
50
+ selectedChildPerItem: () => {};
51
+ alwaysVisibleCount: any;
52
+ variant: string;
53
+ draggableArea: string;
54
+ isLoading: boolean;
55
+ loadingRowCount: number;
56
+ zIndexBase: number;
57
+ testId: string;
58
+ }>>> & {
59
+ onSortableItemDragged?: (event: {
60
+ id: string;
61
+ newIndex: number;
62
+ }) => any;
63
+ "onUpdate:items"?: (items: SortableListItem[]) => any;
64
+ "onUpdate:openId"?: (id: string | number) => any;
65
+ "onUpdate:selectedChildPerItem"?: (value: Record<string | number, string | number>) => any;
66
+ }, {
67
+ testId: string;
68
+ variant: "default" | "compact";
69
+ isLoading: boolean;
70
+ displayValue: (item: SortableListItem) => string;
71
+ items: SortableListItem[];
72
+ draggableArea: "handle" | "full";
73
+ loadingRowCount: number;
74
+ openId: string | number;
75
+ selectedChildPerItem: Record<string | number, string | number>;
76
+ alwaysVisibleCount: number;
77
+ zIndexBase: number;
78
+ }>, {
79
+ header?(_: {}): any;
80
+ menu?(_: {
81
+ item: SortableListItem;
82
+ }): any;
83
+ loader?(_: {}): any;
84
+ }>;
85
+ export default _default;
86
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
87
+ type __VLS_TypePropsToRuntimeProps<T> = {
88
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
89
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
90
+ } : {
91
+ type: import('vue').PropType<T[K]>;
92
+ required: true;
93
+ };
94
+ };
95
+ type __VLS_WithDefaults<P, D> = {
96
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
97
+ default: D[K];
98
+ }> : P[K];
99
+ };
100
+ type __VLS_Prettify<T> = {
101
+ [K in keyof T]: T[K];
102
+ } & {};
103
+ type __VLS_WithTemplateSlots<T, S> = T & {
104
+ new (): {
105
+ $slots: S;
106
+ };
107
+ };
@@ -0,0 +1,7 @@
1
+ import e from "./SortableSelectableList.vue2.js";
2
+ /* empty css */import o from "../../_virtual/_plugin-vue_export-helper.js";
3
+ // import "../../SortableSelectableList.vue_vue_type_style_index_0_scoped_40b0a4de_lang.css"; //*');
4
+ const a = /* @__PURE__ */ o(e, [["__scopeId", "data-v-40b0a4de"]]);
5
+ export {
6
+ a as default
7
+ };
@@ -0,0 +1,128 @@
1
+ import "../../SortableSelectableList.vue_vue_type_style_index_0_scoped_40b0a4de_lang.css"; import { defineComponent as x, useCssVars as G, useSlots as N, ref as O, computed as u, watch as H, openBlock as s, createElementBlock as g, mergeProps as w, unref as l, renderSlot as b, createCommentVNode as c, createBlock as C, isRef as S, withCtx as V, Fragment as $, renderList as z, createSlots as F, createVNode as M } from "vue";
2
+ import { VueDraggable as U } from "vue-draggable-plus";
3
+ import j from "./SortableItem.vue.js";
4
+ import { useTestIdAttrs as q } from "../../utils/testIds.js";
5
+ import { SortableListTestIdModifiers as I } from "../../testids/index.js";
6
+ import { useDraggableHelpers as J } from "./composables/useDraggableHelpers.js";
7
+ import K from "./LoaderBars.vue.js";
8
+ import Q from "../columnConfigurator/ShowMoreLink.vue.js";
9
+ import { DRAGGABLE_HANDLE_SELECTOR as W, DRAGGABLE_AREA_SELECTOR as X } from "./consts.js";
10
+ const Y = {
11
+ key: 0,
12
+ class: "header-container"
13
+ }, Z = {
14
+ key: 1,
15
+ class: "sortable-list-container"
16
+ }, re = /* @__PURE__ */ x({
17
+ __name: "SortableSelectableList",
18
+ props: {
19
+ items: { default: () => [] },
20
+ displayValue: { type: Function, default: (n) => n.displayText || n.toString() },
21
+ openId: { default: null },
22
+ selectedChildPerItem: { default: () => ({}) },
23
+ variant: { default: "default" },
24
+ draggableArea: { default: "handle" },
25
+ isLoading: { type: Boolean, default: !1 },
26
+ loadingRowCount: { default: 3 },
27
+ alwaysVisibleCount: { default: null },
28
+ zIndexBase: { default: 100 },
29
+ testId: { default: "" }
30
+ },
31
+ emits: ["sortableItemDragged", "update:items", "update:openId", "update:selectedChildPerItem"],
32
+ setup(n, { emit: o }) {
33
+ const t = n;
34
+ G((e) => ({
35
+ "3cf7ee9d": n.zIndexBase
36
+ }));
37
+ const f = N(), L = (e) => {
38
+ if (!e.children)
39
+ return t.displayValue(e);
40
+ const d = t.selectedChildPerItem[e.id] ?? null, a = e.children.find((h) => h.id === d);
41
+ return a ? t.displayValue(a) : t.displayValue(e);
42
+ }, i = O(!1), m = u({
43
+ get: () => !i.value,
44
+ set: (e) => i.value = !e
45
+ }), y = u(() => {
46
+ const e = t.alwaysVisibleCount ?? 0;
47
+ return t.items?.length > e;
48
+ });
49
+ H(y, (e, d) => {
50
+ d === !0 && e === !1 && (i.value = !1);
51
+ });
52
+ const r = u({
53
+ get() {
54
+ return i.value && t.alwaysVisibleCount ? t.items.slice(0, t.alwaysVisibleCount) : t.items;
55
+ },
56
+ set(e) {
57
+ o("update:items", [...e, ...A.value]);
58
+ }
59
+ }), A = u(() => i.value ? t.alwaysVisibleCount ? t.items.slice(t.alwaysVisibleCount) : [] : []), E = u(
60
+ () => t.draggableArea === "handle" ? W : X
61
+ ), { onDragStart: k, onDragEnd: B, draggingInProgress: T } = J(o), D = (e) => e.id === t.openId && !T.value, R = (e, d) => {
62
+ d ? o("update:openId", e.id) : o("update:openId", null);
63
+ }, P = (e, d) => {
64
+ o("update:selectedChildPerItem", {
65
+ ...t.selectedChildPerItem,
66
+ [d.id]: e.id
67
+ }), o("update:openId", d.id);
68
+ }, v = q(t.testId, I);
69
+ return (e, d) => (s(), g("div", w({ class: "sortable-selectable-list" }, l(v)[l(I).CONTAINER]), [
70
+ l(f).header ? (s(), g("div", Y, [
71
+ l(f).header ? b(e.$slots, "header", { key: 0 }, void 0, !0) : c("", !0)
72
+ ])) : c("", !0),
73
+ l(r).length && !n.isLoading ? (s(), g("div", Z, [
74
+ l(r).length ? (s(), C(l(U), w({
75
+ key: 0,
76
+ modelValue: l(r),
77
+ "onUpdate:modelValue": d[0] || (d[0] = (a) => S(r) ? r.value = a : null),
78
+ class: "sortable-list",
79
+ filter: ".expand-icon",
80
+ animation: 150,
81
+ handle: l(E)
82
+ }, l(v)[l(I).DRAGGABLE_LIST], {
83
+ onStart: l(k),
84
+ onEnd: l(B)
85
+ }), {
86
+ default: V(() => [
87
+ (s(!0), g($, null, z(l(r), (a, h) => (s(), C(j, {
88
+ key: a.id,
89
+ "data-id": a.id,
90
+ item: a,
91
+ index: h,
92
+ "is-open": D(a),
93
+ "is-disabled": !!a.isDisabled,
94
+ "selected-child-id": n.selectedChildPerItem[a.id] ?? null,
95
+ "display-value": L,
96
+ variant: n.variant,
97
+ "draggable-area": n.draggableArea,
98
+ onToggle: (p) => R(a, p),
99
+ onSelectChild: (p) => P(p, a)
100
+ }, F({ _: 2 }, [
101
+ l(f).menu ? {
102
+ name: "menu",
103
+ fn: V(() => [
104
+ b(e.$slots, "menu", { item: a }, void 0, !0)
105
+ ]),
106
+ key: "0"
107
+ } : void 0
108
+ ]), 1032, ["data-id", "item", "index", "is-open", "is-disabled", "selected-child-id", "variant", "draggable-area", "onToggle", "onSelectChild"]))), 128))
109
+ ]),
110
+ _: 3
111
+ }, 16, ["modelValue", "handle", "onStart", "onEnd"])) : c("", !0),
112
+ l(y) ? (s(), C(Q, {
113
+ key: 1,
114
+ "all-shown": l(m),
115
+ "onUpdate:all-shown": d[1] || (d[1] = (a) => S(m) ? m.value = a : null)
116
+ }, null, 8, ["all-shown"])) : c("", !0)
117
+ ])) : n.isLoading ? b(e.$slots, "loader", { key: 2 }, () => [
118
+ M(K, {
119
+ "loading-row-count": n.loadingRowCount,
120
+ variant: n.variant
121
+ }, null, 8, ["loading-row-count", "variant"])
122
+ ], !0) : c("", !0)
123
+ ], 16));
124
+ }
125
+ });
126
+ export {
127
+ re as default
128
+ };
@@ -0,0 +1,5 @@
1
+ export declare const useDraggableHelpers: (emit: any) => {
2
+ onDragStart: (e: any) => void;
3
+ onDragEnd: (e: any) => void;
4
+ draggingInProgress: import("vue").Ref<boolean>;
5
+ };
@@ -0,0 +1,20 @@
1
+ import { ref as d } from "vue";
2
+ import { DRAG_CURSOR_CSS_CLASS as r } from "../consts.js";
3
+ const u = (a) => {
4
+ const t = d(!1);
5
+ return {
6
+ onDragStart: (e) => {
7
+ t.value = !0, setTimeout(() => e.target.classList.add(r), 50);
8
+ },
9
+ onDragEnd: (e) => {
10
+ const { target: s, item: o, newIndex: n } = e;
11
+ t.value = !1, s.classList.remove(r);
12
+ const g = o.attributes["data-id"]?.value;
13
+ a("sortableItemDragged", { id: g, newIndex: n });
14
+ },
15
+ draggingInProgress: t
16
+ };
17
+ };
18
+ export {
19
+ u as useDraggableHelpers
20
+ };
@@ -1 +1,3 @@
1
1
  export declare const DRAG_CURSOR_CSS_CLASS = "force-grabbing-cursor";
2
+ export declare const DRAGGABLE_HANDLE_SELECTOR = ".draggable-handle";
3
+ export declare const DRAGGABLE_AREA_SELECTOR = ".handle-area";
@@ -1,4 +1,6 @@
1
- const r = "force-grabbing-cursor";
1
+ const A = "force-grabbing-cursor", E = ".draggable-handle", R = ".handle-area";
2
2
  export {
3
- r as DRAG_CURSOR_CSS_CLASS
3
+ R as DRAGGABLE_AREA_SELECTOR,
4
+ E as DRAGGABLE_HANDLE_SELECTOR,
5
+ A as DRAG_CURSOR_CSS_CLASS
4
6
  };