@platforma-sdk/ui-vue 1.37.7 → 1.37.11
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.
- package/.turbo/turbo-build.log +868 -868
- package/.turbo/turbo-type-check.log +1 -1
- package/CHANGELOG.md +16 -0
- package/dist/lib/ui/uikit/dist/components/DataTable/BaseCellComponent.vue.js +2 -2
- package/dist/lib/ui/uikit/dist/components/DataTable/TdCell.vue.js +2 -2
- package/dist/lib/ui/uikit/dist/components/DataTable/composition/useResize.js +2 -2
- package/dist/lib/ui/uikit/dist/components/DataTable/composition/useTableColumns.js +6 -6
- package/dist/lib/ui/uikit/dist/components/DataTable/state.js +12 -12
- package/dist/lib/ui/uikit/dist/components/PlAutocomplete/PlAutocomplete.vue.js +12 -12
- package/dist/lib/ui/uikit/dist/components/PlBtnSplit/PlBtnSplit.vue.js +10 -10
- package/dist/lib/ui/uikit/dist/components/PlBtnSplit/PlBtnSplit.vue.js.map +1 -1
- package/dist/lib/ui/uikit/dist/components/PlElementList/PlElementList.vue.js +10 -0
- package/dist/lib/ui/uikit/dist/components/PlElementList/PlElementList.vue2.js +239 -0
- package/dist/lib/ui/uikit/dist/components/PlElementList/PlElementList.vue2.js.map +1 -0
- package/dist/lib/ui/uikit/dist/components/PlElementList/PlElementList.vue3.js +22 -0
- package/dist/{components → lib/ui/uikit/dist/components}/PlElementList/PlElementList.vue3.js.map +1 -1
- package/dist/lib/ui/uikit/dist/components/PlElementList/PlElementListItem.vue.js +10 -0
- package/dist/lib/ui/uikit/dist/components/PlElementList/PlElementListItem.vue2.js +106 -0
- package/dist/lib/ui/uikit/dist/components/PlElementList/PlElementListItem.vue2.js.map +1 -0
- package/dist/lib/ui/uikit/dist/components/PlElementList/PlElementListItem.vue3.js +48 -0
- package/dist/lib/ui/uikit/dist/components/PlElementList/PlElementListItem.vue3.js.map +1 -0
- package/dist/lib/ui/uikit/dist/components/PlElementList/utils.js +17 -0
- package/dist/lib/ui/uikit/dist/components/PlElementList/utils.js.map +1 -0
- package/dist/lib/ui/uikit/dist/components/PlErrorBoundary/PlErrorBoundary.vue.js +5 -5
- package/dist/lib/ui/uikit/dist/components/PlFileDialog/PlFileDialog.vue.js +14 -14
- package/dist/lib/ui/uikit/dist/components/PlFileDialog/Remote.vue.js +8 -8
- package/dist/lib/ui/uikit/dist/components/PlFileDialog/utils.js +9 -9
- package/dist/lib/ui/uikit/dist/components/PlLogView/PlLogView.vue.js +9 -9
- package/dist/lib/ui/uikit/dist/composition/useFormState.js +5 -5
- package/dist/lib/ui/uikit/dist/composition/useQuery.js +12 -12
- package/dist/lib/ui/uikit/dist/composition/useWatchFetch.js +4 -4
- package/dist/lib/ui/uikit/dist/index.js +81 -78
- package/dist/lib/ui/uikit/dist/index.js.map +1 -1
- package/dist/lib/ui/uikit/dist/lib/util/helpers/dist/index.js +156 -127
- package/dist/lib/ui/uikit/dist/lib/util/helpers/dist/index.js.map +1 -1
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/@vueuse_core@13.3.0_vue@3.5.13_typescript@5.6.3_/node_modules/@vueuse/core/index.js +53 -43
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/@vueuse_core@13.3.0_vue@3.5.13_typescript@5.6.3_/node_modules/@vueuse/core/index.js.map +1 -1
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/@vueuse_integrations@13.3.0_axios@1.8.1_focus-trap@7.6.0_sortablejs@1.15.6_vue@3.5.13_typescript@5.6.3_/node_modules/@vueuse/integrations/useSortable.js +51 -0
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/@vueuse_integrations@13.3.0_axios@1.8.1_focus-trap@7.6.0_sortablejs@1.15.6_vue@3.5.13_typescript@5.6.3_/node_modules/@vueuse/integrations/useSortable.js.map +1 -0
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/@vueuse_shared@13.3.0_vue@3.5.13_typescript@5.6.3_/node_modules/@vueuse/shared/index.js +70 -62
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/@vueuse_shared@13.3.0_vue@3.5.13_typescript@5.6.3_/node_modules/@vueuse/shared/index.js.map +1 -1
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/sortablejs@1.15.6/node_modules/sortablejs/modular/sortable.esm.js +1262 -0
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/sortablejs@1.15.6/node_modules/sortablejs/modular/sortable.esm.js.map +1 -0
- package/dist/lib/ui/uikit/dist/sdk/model/dist/index.js +1 -1
- package/dist/lib/ui/uikit/dist/sdk/model/dist/index.js.map +1 -1
- package/dist/lib/ui/uikit/dist/utils/DropdownOverlay/DropdownOverlay.vue.js +2 -2
- package/dist/lib/util/helpers/dist/index.js +43 -85
- package/dist/lib/util/helpers/dist/index.js.map +1 -1
- package/dist/lib.d.ts +0 -1
- package/dist/lib.d.ts.map +1 -1
- package/dist/lib.js +105 -105
- package/dist/node_modules/.pnpm/@vueuse_core@13.3.0_vue@3.5.13_typescript@5.5.4_/node_modules/@vueuse/core/index.js +30 -31
- package/dist/node_modules/.pnpm/@vueuse_core@13.3.0_vue@3.5.13_typescript@5.5.4_/node_modules/@vueuse/core/index.js.map +1 -1
- package/dist/sdk/model/dist/index.js +1 -1
- package/dist/sdk/model/dist/index.js.map +1 -1
- package/package.json +5 -5
- package/src/lib.ts +0 -2
- package/dist/components/PlElementList/PlElementList.vue.d.ts +0 -61
- package/dist/components/PlElementList/PlElementList.vue.d.ts.map +0 -1
- package/dist/components/PlElementList/PlElementList.vue.js +0 -10
- package/dist/components/PlElementList/PlElementList.vue2.js +0 -214
- package/dist/components/PlElementList/PlElementList.vue2.js.map +0 -1
- package/dist/components/PlElementList/PlElementList.vue3.js +0 -13
- package/dist/components/PlElementList/PlElementListItem.vue.d.ts +0 -55
- package/dist/components/PlElementList/PlElementListItem.vue.d.ts.map +0 -1
- package/dist/components/PlElementList/PlElementListItem.vue.js +0 -10
- package/dist/components/PlElementList/PlElementListItem.vue2.js +0 -103
- package/dist/components/PlElementList/PlElementListItem.vue2.js.map +0 -1
- package/dist/components/PlElementList/PlElementListItem.vue3.js +0 -37
- package/dist/components/PlElementList/PlElementListItem.vue3.js.map +0 -1
- package/dist/components/PlElementList/index.d.ts +0 -2
- package/dist/components/PlElementList/index.d.ts.map +0 -1
- package/dist/components/PlElementList/utils.d.ts +0 -3
- package/dist/components/PlElementList/utils.d.ts.map +0 -1
- package/dist/components/PlElementList/utils.js +0 -17
- package/dist/components/PlElementList/utils.js.map +0 -1
- package/dist/node_modules/.pnpm/@vueuse_integrations@13.3.0_axios@1.8.1_focus-trap@7.6.0_sortablejs@1.15.6_vue@3.5.13_typescript@5.5.4_/node_modules/@vueuse/integrations/useSortable.js +0 -51
- package/dist/node_modules/.pnpm/@vueuse_integrations@13.3.0_axios@1.8.1_focus-trap@7.6.0_sortablejs@1.15.6_vue@3.5.13_typescript@5.5.4_/node_modules/@vueuse/integrations/useSortable.js.map +0 -1
- package/dist/node_modules/.pnpm/sortablejs@1.15.6/node_modules/sortablejs/modular/sortable.esm.js +0 -1262
- package/dist/node_modules/.pnpm/sortablejs@1.15.6/node_modules/sortablejs/modular/sortable.esm.js.map +0 -1
- package/src/components/PlElementList/PlElementList.vue +0 -287
- package/src/components/PlElementList/PlElementListItem.vue +0 -222
- package/src/components/PlElementList/README.md +0 -123
- package/src/components/PlElementList/index.ts +0 -1
- package/src/components/PlElementList/utils.ts +0 -17
- /package/dist/{components → lib/ui/uikit/dist/components}/PlElementList/PlElementList.vue.js.map +0 -0
- /package/dist/{components → lib/ui/uikit/dist/components}/PlElementList/PlElementListItem.vue.js.map +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
WARN Issue while reading "/home/runner/_work/platforma/platforma/.npmrc". Failed to replace env in config: ${NPMJS_TOKEN}
|
|
2
2
|
|
|
3
|
-
> @platforma-sdk/ui-vue@1.37.
|
|
3
|
+
> @platforma-sdk/ui-vue@1.37.11 type-check /home/runner/_work/platforma/platforma/sdk/ui-vue
|
|
4
4
|
> vue-tsc --noEmit --project ./tsconfig.json
|
|
5
5
|
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @platforma-sdk/ui-vue
|
|
2
2
|
|
|
3
|
+
## 1.37.11
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [10e5841]
|
|
8
|
+
- @platforma-sdk/model@1.37.11
|
|
9
|
+
- @milaboratories/uikit@2.2.94
|
|
10
|
+
|
|
11
|
+
## 1.37.10
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- c6b4dd2: Extend interface for PlElementList
|
|
16
|
+
- Updated dependencies [c6b4dd2]
|
|
17
|
+
- @milaboratories/uikit@2.2.93
|
|
18
|
+
|
|
3
19
|
## 1.37.7
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as y, reactive as b, computed as k, ref as C, createElementBlock as o, openBlock as u, normalizeClass as V, toDisplayString as _, unref as g } from "vue";
|
|
2
2
|
import { call as B } from "../../lib/util/helpers/dist/index.js";
|
|
3
|
-
const F = ["value"], T = { key: 1 },
|
|
3
|
+
const F = ["value"], T = { key: 1 }, R = /* @__PURE__ */ y({
|
|
4
4
|
__name: "BaseCellComponent",
|
|
5
5
|
props: {
|
|
6
6
|
modelValue: {},
|
|
@@ -37,6 +37,6 @@ const F = ["value"], T = { key: 1 }, S = /* @__PURE__ */ y({
|
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
39
|
export {
|
|
40
|
-
|
|
40
|
+
R as default
|
|
41
41
|
};
|
|
42
42
|
//# sourceMappingURL=BaseCellComponent.vue.js.map
|
|
@@ -6,7 +6,7 @@ import D from "./BaseCellComponent.vue.js";
|
|
|
6
6
|
const U = ["^data-row-index"], T = {
|
|
7
7
|
key: 0,
|
|
8
8
|
class: "control-cell"
|
|
9
|
-
},
|
|
9
|
+
}, F = /* @__PURE__ */ R({
|
|
10
10
|
__name: "TdCell",
|
|
11
11
|
props: {
|
|
12
12
|
cell: {}
|
|
@@ -70,6 +70,6 @@ const U = ["^data-row-index"], T = {
|
|
|
70
70
|
}
|
|
71
71
|
});
|
|
72
72
|
export {
|
|
73
|
-
|
|
73
|
+
F as default
|
|
74
74
|
};
|
|
75
75
|
//# sourceMappingURL=TdCell.vue.js.map
|
|
@@ -17,7 +17,7 @@ function I(i) {
|
|
|
17
17
|
});
|
|
18
18
|
}).slice(0, s.length - 1);
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function A(i, o) {
|
|
21
21
|
const s = y(), r = w(o, {}), { data: e } = i, n = h(
|
|
22
22
|
(t) => {
|
|
23
23
|
a(e.resizeTh, (c) => {
|
|
@@ -49,6 +49,6 @@ function _(i, o) {
|
|
|
49
49
|
}
|
|
50
50
|
export {
|
|
51
51
|
I as getColumnPositions,
|
|
52
|
-
|
|
52
|
+
A as useResize
|
|
53
53
|
};
|
|
54
54
|
//# sourceMappingURL=useResize.js.map
|
|
@@ -12,12 +12,12 @@ function b(l) {
|
|
|
12
12
|
frozen: !0
|
|
13
13
|
})
|
|
14
14
|
);
|
|
15
|
-
let
|
|
16
|
-
const
|
|
17
|
-
const c = { ...o, offset:
|
|
18
|
-
return
|
|
19
|
-
}), u =
|
|
20
|
-
return p(
|
|
15
|
+
let n = 0;
|
|
16
|
+
const r = s.map((o) => {
|
|
17
|
+
const c = { ...o, offset: n };
|
|
18
|
+
return n += o.width + w, c;
|
|
19
|
+
}), u = r.filter((o) => o.frozen);
|
|
20
|
+
return p(r, (o) => o.frozen ? !1 : t < o.offset + o.width && o.offset < a + t).concat(u).map((o) => ({
|
|
21
21
|
...o,
|
|
22
22
|
style: {
|
|
23
23
|
left: o.frozen ? `${o.offset}px` : `${o.offset - e.scrollLeft}px`,
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { reactive as W, watch as u, computed as a, provide as v } from "vue";
|
|
2
|
-
import { deepClone as h, tap as p, clamp as m, deepEqual as
|
|
2
|
+
import { deepClone as h, tap as p, clamp as m, deepEqual as R, resolveAwaited as S, delay as C } from "../../lib/util/helpers/dist/index.js";
|
|
3
3
|
import { stateKey as L } from "./keys.js";
|
|
4
|
-
import { useTableColumns as
|
|
5
|
-
import { useTableRows as
|
|
4
|
+
import { useTableColumns as j } from "./composition/useTableColumns.js";
|
|
5
|
+
import { useTableRows as A } from "./composition/useTableRows.js";
|
|
6
6
|
import { GAP as w, WINDOW_DELTA as g } from "./constants.js";
|
|
7
|
-
const
|
|
7
|
+
const B = async (l, t) => {
|
|
8
8
|
const { scrollTop: r, bodyHeight: i } = l;
|
|
9
|
-
return await
|
|
9
|
+
return await C(0), S({
|
|
10
10
|
rows: t.getRows(r, i),
|
|
11
11
|
dataWindow: l
|
|
12
12
|
});
|
|
13
13
|
};
|
|
14
|
-
function
|
|
14
|
+
function K(l) {
|
|
15
15
|
const t = W({
|
|
16
16
|
rowIndex: -1,
|
|
17
17
|
columns: [],
|
|
@@ -41,14 +41,14 @@ function I(l) {
|
|
|
41
41
|
bodyHeight: t.bodyHeight,
|
|
42
42
|
scrollTop: t.scrollTop,
|
|
43
43
|
current: t.currentWindow
|
|
44
|
-
})), n =
|
|
44
|
+
})), n = j({
|
|
45
45
|
data: t,
|
|
46
46
|
settings: r
|
|
47
|
-
}),
|
|
47
|
+
}), H = A(t, n), d = {
|
|
48
48
|
data: t,
|
|
49
49
|
settings: r,
|
|
50
50
|
tableColumns: n,
|
|
51
|
-
tableRows:
|
|
51
|
+
tableRows: H,
|
|
52
52
|
adjustWidth: () => {
|
|
53
53
|
const e = t.columns.reduce((s, c) => s + c.width + w, 0), o = t.bodyWidth + t.scrollLeft;
|
|
54
54
|
if (e < o) {
|
|
@@ -98,14 +98,14 @@ function I(l) {
|
|
|
98
98
|
(!s || e.scrollTop < s.scrollTop || e.scrollTop + e.bodyHeight > s.bodyHeight + s.scrollTop) && (t.currentWindow = {
|
|
99
99
|
scrollTop: e.scrollTop - g,
|
|
100
100
|
bodyHeight: e.bodyHeight + g * 2
|
|
101
|
-
},
|
|
102
|
-
|
|
101
|
+
}, B(h(t.currentWindow), r.value.dataSource).then(({ rows: c, dataWindow: T }) => {
|
|
102
|
+
R(t.currentWindow, T) && (t.rows = c);
|
|
103
103
|
}));
|
|
104
104
|
},
|
|
105
105
|
{ deep: !0, immediate: !0 }
|
|
106
106
|
), v(L, d), d;
|
|
107
107
|
}
|
|
108
108
|
export {
|
|
109
|
-
|
|
109
|
+
K as createState
|
|
110
110
|
};
|
|
111
111
|
//# sourceMappingURL=state.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as ne, mergeModels as pe, useModel as ce, useSlots as se, ref as m, useTemplateRef as ue, reactive as de, computed as u, unref as h, watch as x, watchPostEffect as ve, createElementBlock as n, openBlock as r, withModifiers as L, createElementVNode as g, createCommentVNode as s, normalizeClass as M, createBlock as _, createVNode as
|
|
1
|
+
import { defineComponent as ne, mergeModels as pe, useModel as ce, useSlots as se, ref as m, useTemplateRef as ue, reactive as de, computed as u, unref as h, watch as x, watchPostEffect as ve, createElementBlock as n, openBlock as r, withModifiers as L, createElementVNode as g, createCommentVNode as s, normalizeClass as M, createBlock as _, createVNode as O, withDirectives as fe, vModelText as me, withCtx as D, createTextVNode as he, toDisplayString as k, renderSlot as R, Fragment as xe, renderList as ge } from "vue";
|
|
2
2
|
import { tap as we } from "../../helpers/functions.js";
|
|
3
3
|
import be from "../PlTooltip/PlTooltip.vue.js";
|
|
4
4
|
import _e from "../../utils/DoubleContour.vue.js";
|
|
@@ -6,7 +6,7 @@ import { useLabelNotch as ke } from "../../utils/useLabelNotch.js";
|
|
|
6
6
|
import { deepEqual as y } from "../../helpers/objects.js";
|
|
7
7
|
import ye from "../DropdownListItem.vue.js";
|
|
8
8
|
import ze from "../LongText.vue.js";
|
|
9
|
-
import { normalizeListOptions as
|
|
9
|
+
import { normalizeListOptions as H } from "../../helpers/utils.js";
|
|
10
10
|
import Le from "../PlIcon16/PlIcon16.vue.js";
|
|
11
11
|
import Se from "../PlIcon24/PlIcon24.vue.js";
|
|
12
12
|
import $e from "../../utils/DropdownOverlay/DropdownOverlay.vue.js";
|
|
@@ -34,13 +34,13 @@ const Be = ["tabindex"], Ve = { class: "pl-autocomplete__container" }, Ae = { cl
|
|
|
34
34
|
}, Te = { key: 0 }, qe = {
|
|
35
35
|
key: 0,
|
|
36
36
|
class: "nothing-found"
|
|
37
|
-
},
|
|
37
|
+
}, Oe = {
|
|
38
38
|
key: 0,
|
|
39
39
|
class: "pl-autocomplete__error"
|
|
40
|
-
},
|
|
40
|
+
}, Re = {
|
|
41
41
|
key: 1,
|
|
42
42
|
class: "pl-autocomplete__helper"
|
|
43
|
-
},
|
|
43
|
+
}, He = {
|
|
44
44
|
key: 2,
|
|
45
45
|
class: "pl-autocomplete__helper"
|
|
46
46
|
}, Ue = {
|
|
@@ -74,7 +74,7 @@ const Be = ["tabindex"], Ve = { class: "pl-autocomplete__container" }, Ae = { cl
|
|
|
74
74
|
}), P = () => we(
|
|
75
75
|
b.value.findIndex((e) => y(e.value, a.value)),
|
|
76
76
|
(e) => e < 0 ? 0 : e
|
|
77
|
-
), W = () => t.activeIndex = P(), $ = m([]), w = m(), b = u(() =>
|
|
77
|
+
), W = () => t.activeIndex = P(), $ = m([]), w = m(), b = u(() => H($.value).map((e, o) => ({
|
|
78
78
|
...e,
|
|
79
79
|
index: o,
|
|
80
80
|
isSelected: o === Y.value,
|
|
@@ -145,7 +145,7 @@ const Be = ["tabindex"], Ve = { class: "pl-autocomplete__container" }, Ae = { cl
|
|
|
145
145
|
return x(() => B.value, (e) => {
|
|
146
146
|
e && ($.value = e, p.value !== null && (I.value = !1));
|
|
147
147
|
}), x(() => q.value, (e) => {
|
|
148
|
-
e && (w.value =
|
|
148
|
+
e && (w.value = H([e])[0]);
|
|
149
149
|
}), x(() => B.error, (e) => {
|
|
150
150
|
e && (I.value = !!e);
|
|
151
151
|
}), x(() => B.loading || q.loading, (e) => {
|
|
@@ -179,7 +179,7 @@ const Be = ["tabindex"], Ve = { class: "pl-autocomplete__container" }, Ae = { cl
|
|
|
179
179
|
[me, p.value]
|
|
180
180
|
]),
|
|
181
181
|
t.open ? s("", !0) : (r(), n("div", De, [
|
|
182
|
-
|
|
182
|
+
O(ze, null, {
|
|
183
183
|
default: D(() => [
|
|
184
184
|
he(k(F.value), 1)
|
|
185
185
|
]),
|
|
@@ -197,7 +197,7 @@ const Be = ["tabindex"], Ve = { class: "pl-autocomplete__container" }, Ae = { cl
|
|
|
197
197
|
name: "delete-clear",
|
|
198
198
|
onClick: L(J, ["stop"])
|
|
199
199
|
})) : s("", !0),
|
|
200
|
-
|
|
200
|
+
R(e.$slots, "append"),
|
|
201
201
|
g("div", {
|
|
202
202
|
class: "pl-autocomplete__arrow-wrapper",
|
|
203
203
|
onClick: L(X, ["stop"])
|
|
@@ -221,7 +221,7 @@ const Be = ["tabindex"], Ve = { class: "pl-autocomplete__container" }, Ae = { cl
|
|
|
221
221
|
position: "top"
|
|
222
222
|
}, {
|
|
223
223
|
tooltip: D(() => [
|
|
224
|
-
|
|
224
|
+
R(e.$slots, "tooltip")
|
|
225
225
|
]),
|
|
226
226
|
_: 3
|
|
227
227
|
})) : s("", !0)
|
|
@@ -247,10 +247,10 @@ const Be = ["tabindex"], Ve = { class: "pl-autocomplete__container" }, Ae = { cl
|
|
|
247
247
|
]),
|
|
248
248
|
_: 1
|
|
249
249
|
}, 8, ["root"])) : s("", !0),
|
|
250
|
-
|
|
250
|
+
O(_e, { class: "pl-autocomplete__contour" })
|
|
251
251
|
])
|
|
252
252
|
], 42, Be),
|
|
253
|
-
C.value ? (r(), n("div",
|
|
253
|
+
C.value ? (r(), n("div", Oe, k(C.value), 1)) : z.value && e.loadingOptionsHelper ? (r(), n("div", Re, k(e.loadingOptionsHelper), 1)) : e.helper ? (r(), n("div", He, k(e.helper), 1)) : s("", !0)
|
|
254
254
|
]));
|
|
255
255
|
}
|
|
256
256
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as U, mergeModels as z, useModel as O, ref as u, reactive as I, watch as R, computed as d, createElementBlock as y, openBlock as r, normalizeClass as D, createElementVNode as w, createBlock as E, createCommentVNode as W, withKeys as G, withModifiers as H, toDisplayString as J, unref as M, Teleport as Q, normalizeStyle as X, Fragment as Y, renderList as Z } from "vue";
|
|
2
2
|
import ee from "../DropdownListItem.vue.js";
|
|
3
3
|
import { useElementPosition as oe } from "../../composition/usePosition.js";
|
|
4
4
|
import { normalizeListOptions as te } from "../../helpers/utils.js";
|
|
@@ -14,7 +14,7 @@ import ne from "../PlIcon16/PlIcon16.vue.js";
|
|
|
14
14
|
console.error("vite-plugin-css-injected-by-js", v);
|
|
15
15
|
}
|
|
16
16
|
})();
|
|
17
|
-
const ie = ["onKeyup"], ce = /* @__PURE__ */
|
|
17
|
+
const ie = ["onKeyup"], ce = /* @__PURE__ */ U({
|
|
18
18
|
__name: "PlBtnSplit",
|
|
19
19
|
props: /* @__PURE__ */ z({
|
|
20
20
|
options: {},
|
|
@@ -56,7 +56,7 @@ const ie = ["onKeyup"], ce = /* @__PURE__ */ $({
|
|
|
56
56
|
isSelected: o === N.value,
|
|
57
57
|
isActive: o === t.activeIndex
|
|
58
58
|
}))
|
|
59
|
-
), x = d(() => a.loading || a.options === void 0),
|
|
59
|
+
), x = d(() => a.loading || a.options === void 0), T = d(() => {
|
|
60
60
|
var e;
|
|
61
61
|
return ((e = c.value.find((o) => S(o.value, b.value))) == null ? void 0 : e.label) ?? (a.options === void 0 ? "..." : "");
|
|
62
62
|
});
|
|
@@ -71,7 +71,7 @@ const ie = ["onKeyup"], ce = /* @__PURE__ */ $({
|
|
|
71
71
|
function m() {
|
|
72
72
|
j("click");
|
|
73
73
|
}
|
|
74
|
-
const
|
|
74
|
+
const F = (e) => {
|
|
75
75
|
var o, n;
|
|
76
76
|
if (["ArrowDown", "ArrowUp", "Enter", "Escape"].includes(e.code))
|
|
77
77
|
e.preventDefault();
|
|
@@ -91,9 +91,9 @@ const ie = ["onKeyup"], ce = /* @__PURE__ */ $({
|
|
|
91
91
|
if (!_)
|
|
92
92
|
return;
|
|
93
93
|
e.code === "Enter" && B((n = h.find((k) => k.index === g)) == null ? void 0 : n.value);
|
|
94
|
-
const
|
|
95
|
-
t.activeIndex = c.value[
|
|
96
|
-
},
|
|
94
|
+
const P = h.findIndex((k) => k.index === g) ?? -1, $ = e.code === "ArrowDown" ? 1 : e.code === "ArrowUp" ? -1 : 0, q = Math.abs(P + $ + _) % _;
|
|
95
|
+
t.activeIndex = c.value[q].index ?? -1;
|
|
96
|
+
}, L = (e) => {
|
|
97
97
|
var o, n;
|
|
98
98
|
const l = e.relatedTarget;
|
|
99
99
|
!((o = i.value) != null && o.contains(l)) && !((n = f.value) != null && n.contains(l)) && (t.open = !1);
|
|
@@ -102,8 +102,8 @@ const ie = ["onKeyup"], ce = /* @__PURE__ */ $({
|
|
|
102
102
|
ref_key: "root",
|
|
103
103
|
ref: i,
|
|
104
104
|
class: D([{ disabled: e.disabled || x.value, loading: x.value }, "pl-btn-split d-flex"]),
|
|
105
|
-
onFocusout:
|
|
106
|
-
onKeydown:
|
|
105
|
+
onFocusout: L,
|
|
106
|
+
onKeydown: F
|
|
107
107
|
}, [
|
|
108
108
|
w("div", {
|
|
109
109
|
ref_key: "buttonAction",
|
|
@@ -112,7 +112,7 @@ const ie = ["onKeyup"], ce = /* @__PURE__ */ $({
|
|
|
112
112
|
tabindex: "0",
|
|
113
113
|
onClick: m,
|
|
114
114
|
onKeyup: G(H(m, ["stop"]), ["enter"])
|
|
115
|
-
}, J(
|
|
115
|
+
}, J(T.value), 41, ie),
|
|
116
116
|
w("div", {
|
|
117
117
|
ref_key: "menuActivator",
|
|
118
118
|
ref: C,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlBtnSplit.vue.js","sources":["../../../../../../../../../lib/ui/uikit/src/components/PlBtnSplit/PlBtnSplit.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"M = unknown\">\nimport { computed, reactive, ref, unref, watch } from 'vue';\nimport './pl-btn-split.scss';\nimport DropdownListItem from '../DropdownListItem.vue';\nimport type { ListOption } from '../../types';\nimport { useElementPosition } from '../../composition/usePosition';\nimport { normalizeListOptions } from '../../helpers/utils';\nimport { deepEqual } from '@milaboratories/helpers';\nimport { PlMaskIcon16 } from '../PlMaskIcon16';\n\nconst props = defineProps<{\n /**\n * List of available options for the dropdown menu\n */\n options?: Readonly<ListOption<M>[]>;\n\n /**\n * If `true`, the dropdown component is disabled and cannot be interacted with.\n */\n disabled?: boolean;\n\n /**\n * If `true,` the button is disabled, cannot be interacted with, and shows a special 'loading' icon.\n */\n loading?: boolean;\n}>();\n\nconst emits = defineEmits(['click']);\n\nconst model = defineModel<M>({ required: true });\n\nconst root = ref<HTMLElement | undefined>();\nconst list = ref<HTMLElement | undefined>();\nconst menuActivator = ref<HTMLElement | undefined>();\nconst buttonAction = ref<HTMLElement | undefined>();\n\nconst data = reactive({\n open: false,\n optionsHeight: 0,\n activeIndex: -1,\n});\n\ndefineExpose({\n data,\n});\n\nconst optionsStyle = reactive({\n top: '0px',\n left: '0px',\n width: '0px',\n});\n\nwatch(\n list,\n (el) => {\n if (el) {\n const rect = el.getBoundingClientRect();\n data.optionsHeight = rect.height;\n window.dispatchEvent(new CustomEvent('adjust'));\n }\n },\n { immediate: true },\n);\n\nconst iconState = computed(() => (data.open ? 'mask-24 mask-chevron-up' : 'mask-24 mask-chevron-down'));\n\nconst selectedIndex = computed(() => {\n return (props.options ?? []).findIndex((o) => deepEqual(o.value, model.value));\n});\n\nconst items = computed(() =>\n normalizeListOptions(props.options ?? []).map((opt, index) => ({\n ...opt,\n index,\n isSelected: index === selectedIndex.value,\n isActive: index === data.activeIndex,\n })),\n);\n\nconst isLoadingOptions = computed(() => props.loading || props.options === undefined);\n\nconst actionName = computed(() => items.value.find((o) => deepEqual(o.value, model.value))?.label ?? (props.options === undefined ? '...' : ''));\n\nuseElementPosition(root, (pos) => {\n const focusWidth = 3;\n\n const downTopOffset = pos.top + pos.height + focusWidth;\n\n if (downTopOffset + data.optionsHeight > pos.clientHeight) {\n optionsStyle.top = pos.top - data.optionsHeight - focusWidth + 'px';\n } else {\n optionsStyle.top = downTopOffset + 'px';\n }\n\n optionsStyle.left = pos.left + 'px';\n optionsStyle.width = pos.width + 'px';\n});\n\nconst selectOption = (v: M | undefined) => {\n model.value = v!;\n data.open = false;\n root?.value?.focus();\n};\n\nfunction emitEnter() {\n emits('click');\n}\n\nconst handleKeydown = (e: { code: string; preventDefault(): void; stopPropagation(): void; target: EventTarget | null }) => {\n if (!['ArrowDown', 'ArrowUp', 'Enter', 'Escape'].includes(e.code)) {\n return;\n } else {\n e.preventDefault();\n }\n\n if (e.target === buttonAction.value && e.code === 'Enter') {\n emitEnter();\n return;\n }\n\n const { open, activeIndex } = data;\n\n if (!open && e.target === menuActivator.value) {\n if (e.code === 'Enter') {\n data.open = true;\n }\n return;\n }\n\n if (e.code === 'Escape') {\n data.open = false;\n root.value?.focus();\n }\n\n const filtered = unref(items);\n\n const { length } = filtered;\n\n if (!length) {\n return;\n }\n\n if (e.code === 'Enter') {\n selectOption(filtered.find((it) => it.index === activeIndex)?.value);\n }\n\n const localIndex = filtered.findIndex((it) => it.index === activeIndex) ?? -1;\n\n const delta = e.code === 'ArrowDown' ? 1 : e.code === 'ArrowUp' ? -1 : 0;\n\n const newIndex = Math.abs(localIndex + delta + length) % length;\n\n data.activeIndex = items.value[newIndex].index ?? -1;\n};\n\nconst onFocusOut = (event: FocusEvent) => {\n const relatedTarget = event.relatedTarget as Node | null;\n\n if (!root.value?.contains(relatedTarget) && !list.value?.contains(relatedTarget)) {\n data.open = false;\n }\n};\n</script>\n<template>\n <div\n ref=\"root\"\n :class=\"{ disabled: disabled || isLoadingOptions, loading: isLoadingOptions }\"\n class=\"pl-btn-split d-flex\"\n @focusout=\"onFocusOut\"\n @keydown=\"handleKeydown\"\n >\n <div\n ref=\"buttonAction\"\n class=\"pl-btn-split__title flex-grow-1 d-flex align-center text-s-btn\"\n tabindex=\"0\"\n @click=\"emitEnter\"\n @keyup.stop.enter=\"emitEnter\"\n >\n {{ actionName }}\n </div>\n <div ref=\"menuActivator\" class=\"pl-btn-split__icon-container d-flex align-center justify-center\" tabindex=\"0\" @click=\"data.open = !data.open\">\n <PlMaskIcon16 v-if=\"isLoadingOptions\" name=\"loading\" />\n <div v-else :class=\"iconState\" class=\"pl-btn-split__icon\" />\n </div>\n\n <Teleport v-if=\"data.open\" to=\"body\">\n <div ref=\"list\" class=\"pl-dropdown__options\" :style=\"optionsStyle\" tabindex=\"-1\">\n <DropdownListItem\n v-for=\"(item, index) in items\"\n :key=\"index\"\n :option=\"item\"\n :is-selected=\"item.isSelected\"\n :is-hovered=\"item.isActive\"\n :size=\"'medium'\"\n @click.stop=\"selectOption(item.value)\"\n />\n </div>\n </Teleport>\n </div>\n</template>\n"],"names":["props","__emit","model","y","z","f","q","s","u","m","_","b","o","B","O","c","watch","list","rect","data","t","iconState","D","T","r","K","d","opt","index","computed","useElementPosition","te","pos","downTopOffset","n","selectOption","x","A","open","items","length","filtered","p","localIndex","E","it","h","newIndex","W","$","
|
|
1
|
+
{"version":3,"file":"PlBtnSplit.vue.js","sources":["../../../../../../../../../lib/ui/uikit/src/components/PlBtnSplit/PlBtnSplit.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"M = unknown\">\nimport { computed, reactive, ref, unref, watch } from 'vue';\nimport './pl-btn-split.scss';\nimport DropdownListItem from '../DropdownListItem.vue';\nimport type { ListOption } from '../../types';\nimport { useElementPosition } from '../../composition/usePosition';\nimport { normalizeListOptions } from '../../helpers/utils';\nimport { deepEqual } from '@milaboratories/helpers';\nimport { PlMaskIcon16 } from '../PlMaskIcon16';\n\nconst props = defineProps<{\n /**\n * List of available options for the dropdown menu\n */\n options?: Readonly<ListOption<M>[]>;\n\n /**\n * If `true`, the dropdown component is disabled and cannot be interacted with.\n */\n disabled?: boolean;\n\n /**\n * If `true,` the button is disabled, cannot be interacted with, and shows a special 'loading' icon.\n */\n loading?: boolean;\n}>();\n\nconst emits = defineEmits(['click']);\n\nconst model = defineModel<M>({ required: true });\n\nconst root = ref<HTMLElement | undefined>();\nconst list = ref<HTMLElement | undefined>();\nconst menuActivator = ref<HTMLElement | undefined>();\nconst buttonAction = ref<HTMLElement | undefined>();\n\nconst data = reactive({\n open: false,\n optionsHeight: 0,\n activeIndex: -1,\n});\n\ndefineExpose({\n data,\n});\n\nconst optionsStyle = reactive({\n top: '0px',\n left: '0px',\n width: '0px',\n});\n\nwatch(\n list,\n (el) => {\n if (el) {\n const rect = el.getBoundingClientRect();\n data.optionsHeight = rect.height;\n window.dispatchEvent(new CustomEvent('adjust'));\n }\n },\n { immediate: true },\n);\n\nconst iconState = computed(() => (data.open ? 'mask-24 mask-chevron-up' : 'mask-24 mask-chevron-down'));\n\nconst selectedIndex = computed(() => {\n return (props.options ?? []).findIndex((o) => deepEqual(o.value, model.value));\n});\n\nconst items = computed(() =>\n normalizeListOptions(props.options ?? []).map((opt, index) => ({\n ...opt,\n index,\n isSelected: index === selectedIndex.value,\n isActive: index === data.activeIndex,\n })),\n);\n\nconst isLoadingOptions = computed(() => props.loading || props.options === undefined);\n\nconst actionName = computed(() => items.value.find((o) => deepEqual(o.value, model.value))?.label ?? (props.options === undefined ? '...' : ''));\n\nuseElementPosition(root, (pos) => {\n const focusWidth = 3;\n\n const downTopOffset = pos.top + pos.height + focusWidth;\n\n if (downTopOffset + data.optionsHeight > pos.clientHeight) {\n optionsStyle.top = pos.top - data.optionsHeight - focusWidth + 'px';\n } else {\n optionsStyle.top = downTopOffset + 'px';\n }\n\n optionsStyle.left = pos.left + 'px';\n optionsStyle.width = pos.width + 'px';\n});\n\nconst selectOption = (v: M | undefined) => {\n model.value = v!;\n data.open = false;\n root?.value?.focus();\n};\n\nfunction emitEnter() {\n emits('click');\n}\n\nconst handleKeydown = (e: { code: string; preventDefault(): void; stopPropagation(): void; target: EventTarget | null }) => {\n if (!['ArrowDown', 'ArrowUp', 'Enter', 'Escape'].includes(e.code)) {\n return;\n } else {\n e.preventDefault();\n }\n\n if (e.target === buttonAction.value && e.code === 'Enter') {\n emitEnter();\n return;\n }\n\n const { open, activeIndex } = data;\n\n if (!open && e.target === menuActivator.value) {\n if (e.code === 'Enter') {\n data.open = true;\n }\n return;\n }\n\n if (e.code === 'Escape') {\n data.open = false;\n root.value?.focus();\n }\n\n const filtered = unref(items);\n\n const { length } = filtered;\n\n if (!length) {\n return;\n }\n\n if (e.code === 'Enter') {\n selectOption(filtered.find((it) => it.index === activeIndex)?.value);\n }\n\n const localIndex = filtered.findIndex((it) => it.index === activeIndex) ?? -1;\n\n const delta = e.code === 'ArrowDown' ? 1 : e.code === 'ArrowUp' ? -1 : 0;\n\n const newIndex = Math.abs(localIndex + delta + length) % length;\n\n data.activeIndex = items.value[newIndex].index ?? -1;\n};\n\nconst onFocusOut = (event: FocusEvent) => {\n const relatedTarget = event.relatedTarget as Node | null;\n\n if (!root.value?.contains(relatedTarget) && !list.value?.contains(relatedTarget)) {\n data.open = false;\n }\n};\n</script>\n<template>\n <div\n ref=\"root\"\n :class=\"{ disabled: disabled || isLoadingOptions, loading: isLoadingOptions }\"\n class=\"pl-btn-split d-flex\"\n @focusout=\"onFocusOut\"\n @keydown=\"handleKeydown\"\n >\n <div\n ref=\"buttonAction\"\n class=\"pl-btn-split__title flex-grow-1 d-flex align-center text-s-btn\"\n tabindex=\"0\"\n @click=\"emitEnter\"\n @keyup.stop.enter=\"emitEnter\"\n >\n {{ actionName }}\n </div>\n <div ref=\"menuActivator\" class=\"pl-btn-split__icon-container d-flex align-center justify-center\" tabindex=\"0\" @click=\"data.open = !data.open\">\n <PlMaskIcon16 v-if=\"isLoadingOptions\" name=\"loading\" />\n <div v-else :class=\"iconState\" class=\"pl-btn-split__icon\" />\n </div>\n\n <Teleport v-if=\"data.open\" to=\"body\">\n <div ref=\"list\" class=\"pl-dropdown__options\" :style=\"optionsStyle\" tabindex=\"-1\">\n <DropdownListItem\n v-for=\"(item, index) in items\"\n :key=\"index\"\n :option=\"item\"\n :is-selected=\"item.isSelected\"\n :is-hovered=\"item.isActive\"\n :size=\"'medium'\"\n @click.stop=\"selectOption(item.value)\"\n />\n </div>\n </Teleport>\n </div>\n</template>\n"],"names":["props","__emit","model","y","z","f","q","s","u","m","_","b","o","B","O","c","watch","list","rect","data","t","iconState","D","T","r","K","d","opt","index","computed","useElementPosition","te","pos","downTopOffset","n","selectOption","x","A","open","items","length","filtered","p","localIndex","E","it","h","newIndex","W","$","root","i"],"mappings":"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"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import o from "./PlElementList.vue2.js";
|
|
2
|
+
import s from "./PlElementList.vue3.js";
|
|
3
|
+
import r from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const t = {
|
|
5
|
+
$style: s
|
|
6
|
+
}, p = /* @__PURE__ */ r(o, [["__cssModules", t]]);
|
|
7
|
+
export {
|
|
8
|
+
p as default
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=PlElementList.vue.js.map
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
import { defineComponent as fe, mergeModels as W, useModel as u, useSlots as ge, computed as m, shallowRef as w, watch as ce, createElementBlock as E, openBlock as p, normalizeClass as x, createElementVNode as pe, createCommentVNode as be, Fragment as X, renderList as Y, createBlock as Z, createSlots as ee, withCtx as k, renderSlot as $ } from "vue";
|
|
2
|
+
import { isNil as f, shallowHash as ne } from "../../lib/util/helpers/dist/index.js";
|
|
3
|
+
import { useSortable as Ie } from "../../node_modules/.pnpm/@vueuse_integrations@13.3.0_axios@1.8.1_focus-trap@7.6.0_sortablejs@1.15.6_vue@3.5.13_typescript@5.6.3_/node_modules/@vueuse/integrations/useSortable.js";
|
|
4
|
+
import { optionalUpdateRef as g, moveElements as le } from "./utils.js";
|
|
5
|
+
import te from "./PlElementListItem.vue.js";
|
|
6
|
+
const $e = /* @__PURE__ */ fe({
|
|
7
|
+
__name: "PlElementList",
|
|
8
|
+
props: /* @__PURE__ */ W({
|
|
9
|
+
itemClass: { type: [String, Array, Function], default: void 0 },
|
|
10
|
+
activeItems: { default: void 0 },
|
|
11
|
+
enableDragging: { type: Boolean, default: void 0 },
|
|
12
|
+
getItemKey: { type: Function, default: void 0 },
|
|
13
|
+
onDragEnd: { type: Function, default: void 0 },
|
|
14
|
+
onSort: { type: Function, default: void 0 },
|
|
15
|
+
enableExpanding: { type: Boolean, default: void 0 },
|
|
16
|
+
onExpand: { type: Function, default: void 0 },
|
|
17
|
+
enableRemoving: { type: Boolean, default: void 0 },
|
|
18
|
+
onRemove: { type: Function, default: void 0 },
|
|
19
|
+
enableToggling: { type: Boolean, default: void 0 },
|
|
20
|
+
onToggle: { type: Function, default: void 0 },
|
|
21
|
+
enablePinning: { type: Boolean, default: void 0 },
|
|
22
|
+
onPin: { type: Function, default: void 0 }
|
|
23
|
+
}, {
|
|
24
|
+
items: { required: !0 },
|
|
25
|
+
itemsModifiers: {},
|
|
26
|
+
draggableItems: {},
|
|
27
|
+
draggableItemsModifiers: {},
|
|
28
|
+
removableItems: {},
|
|
29
|
+
removableItemsModifiers: {},
|
|
30
|
+
expandableItems: {},
|
|
31
|
+
expandableItemsModifiers: {},
|
|
32
|
+
expandedItems: {},
|
|
33
|
+
expandedItemsModifiers: {},
|
|
34
|
+
pinnableItems: {},
|
|
35
|
+
pinnableItemsModifiers: {},
|
|
36
|
+
pinnedItems: {},
|
|
37
|
+
pinnedItemsModifiers: {},
|
|
38
|
+
toggableItems: {},
|
|
39
|
+
toggableItemsModifiers: {},
|
|
40
|
+
toggledItems: {},
|
|
41
|
+
toggledItemsModifiers: {}
|
|
42
|
+
}),
|
|
43
|
+
emits: /* @__PURE__ */ W(["itemClick"], ["update:items", "update:draggableItems", "update:removableItems", "update:expandableItems", "update:expandedItems", "update:pinnableItems", "update:pinnedItems", "update:toggableItems", "update:toggledItems"]),
|
|
44
|
+
setup(s, { emit: ae }) {
|
|
45
|
+
const r = u(s, "items"), ie = u(s, "draggableItems"), oe = u(s, "removableItems"), se = u(s, "expandableItems"), b = u(s, "expandedItems"), de = u(s, "pinnableItems"), d = u(s, "pinnedItems"), ue = u(s, "toggableItems"), v = u(s, "toggledItems"), a = s, P = ae, R = ge(), D = m(() => a.enableDragging !== !1 && !f(a.getItemKey)), I = m(() => r.value.filter(h)), re = m(() => I.value.length > 0), y = m(() => r.value.filter((e) => !h(e))), T = m(() => y.value.length > 0), C = w(), F = w(), M = w(), B = m((e) => {
|
|
46
|
+
const n = ne(...r.value);
|
|
47
|
+
if (C.value === void 0) return e ?? n;
|
|
48
|
+
const l = ne(...C.value);
|
|
49
|
+
return n === l ? e ?? n : e !== n ? n : l;
|
|
50
|
+
});
|
|
51
|
+
S(re, F, I, () => 0), S(T, M, y, () => I.value.length);
|
|
52
|
+
function S(e, n, l, t) {
|
|
53
|
+
const i = Ie(n, l, {
|
|
54
|
+
handle: '[data-draggable="true"]',
|
|
55
|
+
animation: 150,
|
|
56
|
+
forceFallback: !0,
|
|
57
|
+
fallbackOnBody: !0,
|
|
58
|
+
scrollSensitivity: 80,
|
|
59
|
+
forceAutoScrollFallback: !0,
|
|
60
|
+
onUpdate: (o) => {
|
|
61
|
+
var c;
|
|
62
|
+
if (o.oldIndex == null || o.newIndex == null)
|
|
63
|
+
throw new Error("Sortable event has no index");
|
|
64
|
+
((c = a.onDragEnd) == null ? void 0 : c.call(a, o.oldIndex, o.newIndex)) !== !1 && A(t() + o.oldIndex, t() + o.newIndex, !0);
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
return ce(e, (o) => o ? i.start() : i.stop()), i;
|
|
68
|
+
}
|
|
69
|
+
function A(e, n, l) {
|
|
70
|
+
var t;
|
|
71
|
+
e !== n && (l && (C.value = le(r.value.slice(), e, n)), ((t = a.onSort) == null ? void 0 : t.call(a, e, n)) === !1 || (le(r.value, e, n), g(r)));
|
|
72
|
+
}
|
|
73
|
+
function H(e) {
|
|
74
|
+
var n;
|
|
75
|
+
return ((n = a.activeItems) == null ? void 0 : n.has(e)) ?? !1;
|
|
76
|
+
}
|
|
77
|
+
function _(e) {
|
|
78
|
+
var n;
|
|
79
|
+
return a.enableDragging === !1 ? !1 : ((n = ie.value) == null ? void 0 : n.has(e)) ?? !0;
|
|
80
|
+
}
|
|
81
|
+
function K(e) {
|
|
82
|
+
var n;
|
|
83
|
+
return a.enableToggling === !1 ? !1 : !f(v.value) && (((n = ue.value) == null ? void 0 : n.has(e)) ?? !0);
|
|
84
|
+
}
|
|
85
|
+
function z(e) {
|
|
86
|
+
var n;
|
|
87
|
+
return ((n = v.value) == null ? void 0 : n.has(e)) ?? !1;
|
|
88
|
+
}
|
|
89
|
+
function N(e) {
|
|
90
|
+
var n;
|
|
91
|
+
return a.enablePinning === !1 ? !1 : !f(d.value) && (((n = de.value) == null ? void 0 : n.has(e)) ?? !0);
|
|
92
|
+
}
|
|
93
|
+
function h(e) {
|
|
94
|
+
var n;
|
|
95
|
+
return ((n = d.value) == null ? void 0 : n.has(e)) ?? !1;
|
|
96
|
+
}
|
|
97
|
+
function L(e) {
|
|
98
|
+
var n;
|
|
99
|
+
return a.enableExpanding === !1 ? !1 : !f(b.value) && (((n = se.value) == null ? void 0 : n.has(e)) ?? !0);
|
|
100
|
+
}
|
|
101
|
+
function U(e) {
|
|
102
|
+
var n;
|
|
103
|
+
return ((n = b.value) == null ? void 0 : n.has(e)) ?? !1;
|
|
104
|
+
}
|
|
105
|
+
function V(e) {
|
|
106
|
+
var n;
|
|
107
|
+
return a.enableRemoving === !1 || ((n = oe.value) == null ? void 0 : n.has(e)) === !1 ? !1 : a.enableRemoving === !0 || typeof a.onRemove == "function";
|
|
108
|
+
}
|
|
109
|
+
function q(e, n) {
|
|
110
|
+
var l;
|
|
111
|
+
if (((l = a.onExpand) == null ? void 0 : l.call(a, e, n)) === !1 || f(b.value)) return;
|
|
112
|
+
const t = b.value;
|
|
113
|
+
t.has(e) ? t.delete(e) : t.add(e), g(b);
|
|
114
|
+
}
|
|
115
|
+
function O(e, n) {
|
|
116
|
+
var l;
|
|
117
|
+
if (((l = a.onToggle) == null ? void 0 : l.call(a, e, n)) === !1 || f(v.value)) return;
|
|
118
|
+
const t = v.value;
|
|
119
|
+
t.has(e) ? t.delete(e) : t.add(e), g(v);
|
|
120
|
+
}
|
|
121
|
+
function j(e, n) {
|
|
122
|
+
var l;
|
|
123
|
+
if (n === -1)
|
|
124
|
+
throw new Error("Pinnable item not found");
|
|
125
|
+
if (((l = a.onPin) == null ? void 0 : l.call(a, e, n)) === !1 || f(d.value)) return;
|
|
126
|
+
const t = d.value, i = t.has(e);
|
|
127
|
+
i ? t.delete(e) : t.add(e), g(d), A(n, t.size + (i ? 0 : -1), !1);
|
|
128
|
+
}
|
|
129
|
+
function G(e, n) {
|
|
130
|
+
var l, t, i;
|
|
131
|
+
((l = a.onRemove) == null ? void 0 : l.call(a, e, n)) !== !1 && (r.value.splice(n, 1), g(r), (t = d.value) != null && t.has(e) && (d.value.delete(e), g(d)), (i = v.value) != null && i.has(e) && (v.value.delete(e), g(v)));
|
|
132
|
+
}
|
|
133
|
+
const J = (e, n) => f(a.getItemKey) ? `${B.value}-${n}` : `${B.value}-${a.getItemKey(e)}`, ve = m(() => I.value.map(J)), me = m(() => y.value.map(J)), Q = (e, n) => typeof a.itemClass == "function" ? a.itemClass(e, n) : a.itemClass ?? null;
|
|
134
|
+
return (e, n) => (p(), E("div", {
|
|
135
|
+
class: x(e.$style.root)
|
|
136
|
+
}, [
|
|
137
|
+
pe("div", {
|
|
138
|
+
ref_key: "pinnedContainerRef",
|
|
139
|
+
ref: F,
|
|
140
|
+
class: x(e.$style.list)
|
|
141
|
+
}, [
|
|
142
|
+
(p(!0), E(X, null, Y(I.value, (l, t) => (p(), Z(te, {
|
|
143
|
+
key: ve.value[t],
|
|
144
|
+
class: x([e.$style.item, Q(l, t)]),
|
|
145
|
+
index: t,
|
|
146
|
+
item: l,
|
|
147
|
+
showDragHandle: D.value,
|
|
148
|
+
isActive: H(l),
|
|
149
|
+
isDraggable: _(l),
|
|
150
|
+
isRemovable: V(l),
|
|
151
|
+
isToggable: K(l),
|
|
152
|
+
isToggled: z(l),
|
|
153
|
+
isPinnable: N(l),
|
|
154
|
+
isPinned: h(l),
|
|
155
|
+
isExpandable: L(l),
|
|
156
|
+
isExpanded: U(l),
|
|
157
|
+
onClick: (i) => P("itemClick", l),
|
|
158
|
+
onRemove: G,
|
|
159
|
+
onToggle: O,
|
|
160
|
+
onPin: j,
|
|
161
|
+
onExpand: q
|
|
162
|
+
}, ee({
|
|
163
|
+
title: k(({ item: i, index: o }) => [
|
|
164
|
+
$(e.$slots, "item-title", {
|
|
165
|
+
index: o,
|
|
166
|
+
item: i
|
|
167
|
+
})
|
|
168
|
+
]),
|
|
169
|
+
_: 2
|
|
170
|
+
}, [
|
|
171
|
+
R["item-content"] ? {
|
|
172
|
+
name: "content",
|
|
173
|
+
fn: k(({ item: i, index: o }) => [
|
|
174
|
+
$(e.$slots, "item-content", {
|
|
175
|
+
index: o,
|
|
176
|
+
item: i
|
|
177
|
+
})
|
|
178
|
+
]),
|
|
179
|
+
key: "0"
|
|
180
|
+
} : void 0
|
|
181
|
+
]), 1032, ["class", "index", "item", "showDragHandle", "isActive", "isDraggable", "isRemovable", "isToggable", "isToggled", "isPinnable", "isPinned", "isExpandable", "isExpanded", "onClick"]))), 128))
|
|
182
|
+
], 2),
|
|
183
|
+
T.value ? (p(), E("div", {
|
|
184
|
+
key: 0,
|
|
185
|
+
ref_key: "unpinnedContainerRef",
|
|
186
|
+
ref: M,
|
|
187
|
+
class: x(e.$style.list)
|
|
188
|
+
}, [
|
|
189
|
+
(p(!0), E(X, null, Y(y.value, (l, t) => {
|
|
190
|
+
var i;
|
|
191
|
+
return p(), Z(te, {
|
|
192
|
+
key: me.value[t],
|
|
193
|
+
class: x([e.$style.item, Q(l, t)]),
|
|
194
|
+
index: t + (((i = d.value) == null ? void 0 : i.size) ?? 0),
|
|
195
|
+
item: l,
|
|
196
|
+
showDragHandle: D.value,
|
|
197
|
+
isActive: H(l),
|
|
198
|
+
isDraggable: _(l),
|
|
199
|
+
isRemovable: V(l),
|
|
200
|
+
isToggable: K(l),
|
|
201
|
+
isToggled: z(l),
|
|
202
|
+
isPinnable: N(l),
|
|
203
|
+
isPinned: h(l),
|
|
204
|
+
isExpandable: L(l),
|
|
205
|
+
isExpanded: U(l),
|
|
206
|
+
onClick: (o) => P("itemClick", l),
|
|
207
|
+
onRemove: G,
|
|
208
|
+
onToggle: O,
|
|
209
|
+
onPin: j,
|
|
210
|
+
onExpand: q
|
|
211
|
+
}, ee({
|
|
212
|
+
title: k(({ item: o, index: c }) => [
|
|
213
|
+
$(e.$slots, "item-title", {
|
|
214
|
+
index: c,
|
|
215
|
+
item: o
|
|
216
|
+
})
|
|
217
|
+
]),
|
|
218
|
+
_: 2
|
|
219
|
+
}, [
|
|
220
|
+
R["item-content"] ? {
|
|
221
|
+
name: "content",
|
|
222
|
+
fn: k(({ item: o, index: c }) => [
|
|
223
|
+
$(e.$slots, "item-content", {
|
|
224
|
+
index: c,
|
|
225
|
+
item: o
|
|
226
|
+
})
|
|
227
|
+
]),
|
|
228
|
+
key: "0"
|
|
229
|
+
} : void 0
|
|
230
|
+
]), 1032, ["class", "index", "item", "showDragHandle", "isActive", "isDraggable", "isRemovable", "isToggable", "isToggled", "isPinnable", "isPinned", "isExpandable", "isExpanded", "onClick"]);
|
|
231
|
+
}), 128))
|
|
232
|
+
], 2)) : be("", !0)
|
|
233
|
+
], 2));
|
|
234
|
+
}
|
|
235
|
+
});
|
|
236
|
+
export {
|
|
237
|
+
$e as default
|
|
238
|
+
};
|
|
239
|
+
//# sourceMappingURL=PlElementList.vue2.js.map
|