@milaboratories/uikit 2.3.13 → 2.3.15
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 +53 -40
- package/.turbo/turbo-type-check.log +1 -1
- package/CHANGELOG.md +17 -0
- package/dist/components/DataTable/TableComponent.vue.js +23 -23
- package/dist/components/PlAccordion/{ExpandTransition.vue2.js → ExpandTransition.vue.js} +1 -1
- package/dist/components/PlAccordion/ExpandTransition.vue.js.map +1 -0
- package/dist/components/PlAccordion/ExpandTransition.vue3.js +1 -1
- package/dist/components/PlAccordion/PlAccordionSection.vue2.js +1 -1
- package/dist/components/PlAutocomplete/PlAutocomplete.vue.js +1 -1
- package/dist/components/PlBtnGhost/PlBtnGhost.vue.js +1 -1
- package/dist/components/PlConfirmDialog.vue.d.ts +22 -0
- package/dist/components/PlConfirmDialog.vue.d.ts.map +1 -0
- package/dist/components/PlConfirmDialog.vue.js +63 -0
- package/dist/components/PlConfirmDialog.vue.js.map +1 -0
- package/dist/components/PlConfirmDialog.vue2.js +5 -0
- package/dist/components/PlConfirmDialog.vue2.js.map +1 -0
- package/dist/components/PlDialogModal/PlDialogModal.vue.d.ts +8 -4
- package/dist/components/PlDialogModal/PlDialogModal.vue.d.ts.map +1 -1
- package/dist/components/PlDialogModal/PlDialogModal.vue.js +38 -38
- package/dist/components/PlDialogModal/PlDialogModal.vue.js.map +1 -1
- package/dist/components/PlDropdown/PlDropdown.vue.js +1 -1
- package/dist/components/PlDropdownLegacy/PlDropdownLegacy.vue.js +1 -1
- package/dist/components/PlDropdownLine/PlDropdownLine.vue.d.ts +1 -1
- package/dist/components/PlDropdownLine/PlDropdownLine.vue.d.ts.map +1 -1
- package/dist/components/PlDropdownMulti/PlDropdownMulti.vue.js +1 -1
- package/dist/components/PlDropdownRef/PlDropdownRef.vue.d.ts +1 -1
- package/dist/components/PlDropdownRef/PlDropdownRef.vue.d.ts.map +1 -1
- package/dist/components/PlEditableTitle/PlEditableTitle.vue.d.ts +4 -0
- package/dist/components/PlEditableTitle/PlEditableTitle.vue.d.ts.map +1 -1
- package/dist/components/PlEditableTitle/PlEditableTitle.vue.js +47 -43
- package/dist/components/PlEditableTitle/PlEditableTitle.vue.js.map +1 -1
- package/dist/components/PlElementList/PlElementList.vue.d.ts.map +1 -1
- package/dist/components/PlElementList/PlElementList.vue2.js +20 -16
- package/dist/components/PlElementList/PlElementList.vue2.js.map +1 -1
- package/dist/components/PlElementList/PlElementListItem.vue.d.ts.map +1 -1
- package/dist/components/PlElementList/PlElementListItem.vue2.js +10 -9
- package/dist/components/PlElementList/PlElementListItem.vue2.js.map +1 -1
- package/dist/components/PlElementList/PlElementListItem.vue3.js +29 -29
- package/dist/components/PlElementList/utils.d.ts.map +1 -1
- package/dist/components/PlElementList/utils.js +4 -3
- package/dist/components/PlElementList/utils.js.map +1 -1
- package/dist/components/PlFileInput/PlFileInput.vue.js +1 -1
- package/dist/components/PlSidebar/PlSidebarGroup.vue.d.ts +20 -0
- package/dist/components/PlSidebar/PlSidebarGroup.vue.d.ts.map +1 -0
- package/dist/components/PlSidebar/PlSidebarGroup.vue.js +10 -0
- package/dist/components/PlSidebar/PlSidebarGroup.vue.js.map +1 -0
- package/dist/components/PlSidebar/PlSidebarGroup.vue2.js +21 -0
- package/dist/components/PlSidebar/PlSidebarGroup.vue2.js.map +1 -0
- package/dist/components/PlSidebar/PlSidebarGroup.vue3.js +11 -0
- package/dist/components/PlSidebar/PlSidebarGroup.vue3.js.map +1 -0
- package/dist/components/PlSidebar/PlSidebarItem.vue.d.ts +30 -0
- package/dist/components/PlSidebar/PlSidebarItem.vue.d.ts.map +1 -0
- package/dist/components/PlSidebar/PlSidebarItem.vue.js +10 -0
- package/dist/components/PlSidebar/PlSidebarItem.vue.js.map +1 -0
- package/dist/components/PlSidebar/PlSidebarItem.vue2.js +39 -0
- package/dist/components/PlSidebar/PlSidebarItem.vue2.js.map +1 -0
- package/dist/components/PlSidebar/PlSidebarItem.vue3.js +17 -0
- package/dist/components/PlSidebar/PlSidebarItem.vue3.js.map +1 -0
- package/dist/components/PlSidebar/index.d.ts +3 -0
- package/dist/components/PlSidebar/index.d.ts.map +1 -0
- package/dist/components/PlSlideModal/PlPureSlideModal.vue.d.ts +22 -0
- package/dist/components/PlSlideModal/PlPureSlideModal.vue.d.ts.map +1 -0
- package/dist/components/PlSlideModal/PlPureSlideModal.vue.js +150 -0
- package/dist/components/PlSlideModal/PlPureSlideModal.vue.js.map +1 -0
- package/dist/components/PlSlideModal/PlPureSlideModal.vue2.js +5 -0
- package/dist/components/PlSlideModal/PlPureSlideModal.vue2.js.map +1 -0
- package/dist/components/PlSlideModal/PlSlideModal.vue.d.ts +3 -42
- package/dist/components/PlSlideModal/PlSlideModal.vue.d.ts.map +1 -1
- package/dist/components/PlSlideModal/PlSlideModal.vue.js +7 -162
- package/dist/components/PlSlideModal/PlSlideModal.vue.js.map +1 -1
- package/dist/components/PlSlideModal/PlSlideModal.vue2.js +45 -2
- package/dist/components/PlSlideModal/PlSlideModal.vue2.js.map +1 -1
- package/dist/components/PlSlideModal/PlSlideModal.vue3.js +9 -0
- package/dist/components/PlSlideModal/PlSlideModal.vue3.js.map +1 -0
- package/dist/components/PlSlideModal/index.d.ts +1 -0
- package/dist/components/PlSlideModal/index.d.ts.map +1 -1
- package/dist/components/PlSlideModal/props.d.ts +20 -0
- package/dist/components/PlSlideModal/props.d.ts.map +1 -0
- package/dist/components/PlSlideModal/props.js +10 -0
- package/dist/components/PlSlideModal/props.js.map +1 -0
- package/dist/components/PlTextArea/PlTextArea.vue.js +1 -1
- package/dist/components/PlTextField/PlTextField.vue.js +1 -1
- package/dist/composition/useConfirm.d.ts +8 -0
- package/dist/composition/useConfirm.d.ts.map +1 -0
- package/dist/composition/useConfirm.js +23 -0
- package/dist/composition/useConfirm.js.map +1 -0
- package/dist/generated/components/svg/images/{SvgRequired.vue.js → SvgRequired.vue2.js} +1 -1
- package/dist/generated/components/svg/images/SvgRequired.vue2.js.map +1 -0
- package/dist/index.d.ts +49 -47
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +202 -194
- package/dist/index.js.map +1 -1
- package/dist/lib/model/common/dist/index.js +10 -10
- package/dist/node_modules/.pnpm/@vueuse_core@13.3.0_vue@3.5.13_typescript@5.6.3_/node_modules/@vueuse/core/index.js +1 -1
- package/dist/node_modules/.pnpm/@vueuse_shared@13.3.0_vue@3.5.13_typescript@5.6.3_/node_modules/@vueuse/shared/index.js +3 -3
- package/dist/sdk/model/dist/index.js +113 -113
- package/dist/sdk/model/dist/index.js.map +1 -1
- package/package.json +4 -3
- package/src/assets/variables.scss +4 -1
- package/src/components/PlBtnGhost/pl-btn-ghost.scss +0 -7
- package/src/components/PlConfirmDialog.vue +55 -0
- package/src/components/PlDialogModal/PlDialogModal.vue +6 -2
- package/src/components/PlEditableTitle/PlEditableTitle.vue +13 -2
- package/src/components/PlElementList/PlElementList.vue +14 -6
- package/src/components/PlElementList/PlElementListItem.vue +6 -4
- package/src/components/PlElementList/utils.ts +2 -0
- package/src/components/PlSidebar/PlSidebarGroup.vue +35 -0
- package/src/components/PlSidebar/PlSidebarItem.vue +59 -0
- package/src/components/PlSidebar/index.ts +2 -0
- package/src/components/PlSlideModal/PlPureSlideModal.vue +57 -0
- package/src/components/PlSlideModal/PlSlideModal.vue +31 -75
- package/src/components/PlSlideModal/index.ts +1 -0
- package/src/components/PlSlideModal/pl-slide-modal.scss +5 -4
- package/src/components/PlSlideModal/props.ts +25 -0
- package/src/composition/useConfirm.ts +35 -0
- package/src/index.ts +51 -47
- package/dist/components/PlAccordion/ExpandTransition.vue2.js.map +0 -1
- package/dist/generated/components/svg/images/SvgRequired.vue.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlElementList.vue.d.ts","sourceRoot":"","sources":["../../../src/components/PlElementList/PlElementList.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PlElementList.vue.d.ts","sourceRoot":"","s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,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as ae, mergeModels as Q, useModel as ne, useSlots as oe, computed as u, shallowRef as R, watch as se, createElementBlock as y, openBlock as f, normalizeClass as d, createElementVNode as re, createCommentVNode as ue, Fragment as W, renderList as X, createBlock as Y, createSlots as Z, withCtx as E, renderSlot as h } from "vue";
|
|
2
2
|
import { shallowHash as P, isFunction as g } from "../../lib/util/helpers/dist/index.js";
|
|
3
|
-
import { useSortable as
|
|
4
|
-
import
|
|
5
|
-
import _ from "./
|
|
6
|
-
const
|
|
3
|
+
import { useSortable as ce } 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 x from "./PlElementListItem.vue.js";
|
|
5
|
+
import { moveElements as _ } from "./utils.js";
|
|
6
|
+
const be = /* @__PURE__ */ ae({
|
|
7
7
|
__name: "PlElementList",
|
|
8
8
|
props: /* @__PURE__ */ Q({
|
|
9
9
|
getItemKey: { type: Function, default: (m) => JSON.stringify(m) },
|
|
@@ -34,7 +34,7 @@ const ve = /* @__PURE__ */ le({
|
|
|
34
34
|
}),
|
|
35
35
|
emits: /* @__PURE__ */ Q(["itemClick"], ["update:items"]),
|
|
36
36
|
setup(m, { emit: I }) {
|
|
37
|
-
const c =
|
|
37
|
+
const c = ne(m, "items"), t = m, T = I, F = oe(), k = u(() => t.disableDragging !== !0), s = u(() => c.value.filter(N)), p = u(() => s.value.length > 0), v = u(() => c.value.filter((i, l) => !N(i, l))), C = u(() => v.value.length > 0), b = R(), D = R(), S = R(), w = (i, l) => `${ie.value}-${t.getItemKey(i, l)}`, ee = u(() => s.value.map(w)), te = u(() => v.value.map(w)), ie = u((i) => {
|
|
38
38
|
const l = c.value.map(t.getItemKey);
|
|
39
39
|
if (b.value === void 0) return i ?? P(...l);
|
|
40
40
|
if (l.length !== b.value.length) return P(...l);
|
|
@@ -46,7 +46,7 @@ const ve = /* @__PURE__ */ le({
|
|
|
46
46
|
});
|
|
47
47
|
$(p, D, s, () => 0), $(C, S, v, () => s.value.length);
|
|
48
48
|
function $(i, l, e, a) {
|
|
49
|
-
const n =
|
|
49
|
+
const n = ce(l, e, {
|
|
50
50
|
handle: '[data-draggable="true"]',
|
|
51
51
|
animation: 150,
|
|
52
52
|
forceFallback: !0,
|
|
@@ -60,14 +60,18 @@ const ve = /* @__PURE__ */ le({
|
|
|
60
60
|
((r = t.onDragEnd) == null ? void 0 : r.call(t, o.oldIndex, o.newIndex)) !== !1 && K(a() + o.oldIndex, a() + o.newIndex, !0);
|
|
61
61
|
}
|
|
62
62
|
});
|
|
63
|
-
return
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
return se(
|
|
64
|
+
[l, () => t.disableDragging, i],
|
|
65
|
+
([o, r, le]) => {
|
|
66
|
+
!o || r || !le ? n.stop() : n.start();
|
|
67
|
+
},
|
|
68
|
+
{ immediate: !0 }
|
|
69
|
+
), n;
|
|
66
70
|
}
|
|
67
71
|
function K(i, l, e) {
|
|
68
72
|
var n;
|
|
69
73
|
if (i === l) return;
|
|
70
|
-
e && (b.value =
|
|
74
|
+
e && (b.value = _(c.value.slice(), i, l)), ((n = t.onSort) == null ? void 0 : n.call(t, i, l)) === !1 || _(c.value, i, l);
|
|
71
75
|
}
|
|
72
76
|
function A(i, l) {
|
|
73
77
|
var e;
|
|
@@ -128,12 +132,12 @@ const ve = /* @__PURE__ */ le({
|
|
|
128
132
|
return (i, l) => (f(), y("div", {
|
|
129
133
|
class: d(i.$style.root)
|
|
130
134
|
}, [
|
|
131
|
-
|
|
135
|
+
re("div", {
|
|
132
136
|
ref_key: "pinnedContainerRef",
|
|
133
137
|
ref: D,
|
|
134
138
|
class: d(i.$style.list)
|
|
135
139
|
}, [
|
|
136
|
-
(f(!0), y(W, null, X(s.value, (e, a) => (f(), Y(
|
|
140
|
+
(f(!0), y(W, null, X(s.value, (e, a) => (f(), Y(x, {
|
|
137
141
|
key: ee.value[a],
|
|
138
142
|
class: d([i.$style.item, G(e, a)]),
|
|
139
143
|
index: a,
|
|
@@ -182,7 +186,7 @@ const ve = /* @__PURE__ */ le({
|
|
|
182
186
|
}, [
|
|
183
187
|
(f(!0), y(W, null, X(v.value, (e, a) => {
|
|
184
188
|
var n;
|
|
185
|
-
return f(), Y(
|
|
189
|
+
return f(), Y(x, {
|
|
186
190
|
key: te.value[a],
|
|
187
191
|
class: d([i.$style.item, G(e, a)]),
|
|
188
192
|
index: a + (((n = s.value) == null ? void 0 : n.length) ?? 0),
|
|
@@ -223,11 +227,11 @@ const ve = /* @__PURE__ */ le({
|
|
|
223
227
|
} : void 0
|
|
224
228
|
]), 1032, ["class", "index", "item", "showDragHandle", "isActive", "isDraggable", "isRemovable", "isToggable", "isToggled", "isPinnable", "isExpandable", "isExpanded", "onClick"]);
|
|
225
229
|
}), 128))
|
|
226
|
-
], 2)) :
|
|
230
|
+
], 2)) : ue("", !0)
|
|
227
231
|
], 2));
|
|
228
232
|
}
|
|
229
233
|
});
|
|
230
234
|
export {
|
|
231
|
-
|
|
235
|
+
be as default
|
|
232
236
|
};
|
|
233
237
|
//# sourceMappingURL=PlElementList.vue2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlElementList.vue2.js","sources":["../../../src/components/PlElementList/PlElementList.vue"],"sourcesContent":["<script generic=\"T extends unknown = unknown, K extends number | string = number | string\" lang=\"ts\" setup>\nimport type { ShallowRef } from 'vue';\nimport { computed, shallowRef, watch } from 'vue';\nimport { isFunction, shallowHash } from '@milaboratories/helpers';\nimport { useSortable } from '@vueuse/integrations/useSortable';\nimport { type SortableEvent } from 'sortablejs';\nimport { moveElements } from './utils.ts';\nimport PlElementListItem from './PlElementListItem.vue';\n\nconst itemsRef = defineModel<T[]>('items', { required: true });\n\nconst props = withDefaults(\n defineProps<{\n getItemKey?: (item: T, index: number) => K;\n\n itemClass?: string | string[] | ((item: T, index: number) => string | string[]);\n isActive?: (item: T, index: number) => boolean;\n\n disableDragging?: boolean;\n isDraggable?: (item: T, index: number) => boolean;\n onDragEnd?: (oldIndex: number, newIndex: number) => void | boolean;\n onSort?: (oldIndex: number, newIndex: number) => void | boolean;\n\n disableRemoving?: boolean;\n isRemovable?: (item: T, index: number) => boolean;\n onRemove?: (item: T, index: number) => void | boolean;\n\n disableExpanding?: boolean;\n isExpandable?: (item: T, index: number) => boolean;\n isExpanded?: (item: T, index: number) => boolean;\n onExpand?: (item: T, index: number) => unknown;\n\n disableToggling?: boolean;\n isToggable?: (item: T, index: number) => boolean;\n isToggled?: (item: T, index: number) => boolean;\n onToggle?: (item: T, index: number) => unknown;\n\n disablePinning?: boolean;\n isPinnable?: (item: T, index: number) => boolean;\n isPinned?: (item: T, index: number) => boolean;\n onPin?: (item: T, index: number) => void | boolean;\n }>(), {\n getItemKey: (item: T) => JSON.stringify(item) as K,\n\n itemClass: undefined,\n isActive: undefined,\n\n disableDragging: undefined,\n isDraggable: undefined,\n onDragEnd: undefined,\n onSort: undefined,\n\n disableRemoving: undefined,\n isRemovable: undefined,\n onRemove: undefined,\n\n disableExpanding: undefined,\n isExpandable: undefined,\n isExpanded: undefined,\n onExpand: undefined,\n\n disableToggling: undefined,\n isToggable: undefined,\n isToggled: undefined,\n onToggle: undefined,\n\n disablePinning: undefined,\n isPinnable: undefined,\n isPinned: undefined,\n onPin: undefined,\n },\n);\n\nconst emits = defineEmits<{\n (e: 'itemClick', item: T): void;\n}>();\n\nconst slots = defineSlots<{\n ['item-title']: (props: { item: T; index: number }) => unknown;\n ['item-content']?: (props: { item: T; index: number }) => unknown;\n}>();\n\nconst dndSortingEnabled = computed((): boolean => {\n return props.disableDragging !== true;\n});\n\nconst pinnedItemsRef = computed(() => itemsRef.value.filter(isPinnedItem));\nconst hasPinnedItems = computed(() => pinnedItemsRef.value.length > 0);\n\nconst unpinnedItemsRef = computed(() => itemsRef.value.filter((item, index) => !isPinnedItem(item, index)));\nconst hasUnpinnedItems = computed(() => unpinnedItemsRef.value.length > 0);\n\nconst domProjectionItemsRef = shallowRef<undefined | T[]>();\nconst pinnedContainerRef = shallowRef<HTMLElement>();\nconst unpinnedContainerRef = shallowRef<HTMLElement>();\n\n// version fix problem with sync between data and rendered values\nconst getKey = (item: T, index: number) => {\n return `${versionRef.value}-${props.getItemKey(item, index)}`;\n};\nconst pinnedKeysRef = computed(() => pinnedItemsRef.value.map(getKey));\nconst unpinnedKeysRef = computed(() => unpinnedItemsRef.value.map(getKey));\n\n// version fix problem with sync between data and rendered values when items have been changed\nconst versionRef = computed<number>((oldVersion) => {\n const currentKeys = itemsRef.value.map(props.getItemKey);\n\n if (domProjectionItemsRef.value === undefined) return oldVersion ?? shallowHash(...currentKeys);\n if (currentKeys.length !== domProjectionItemsRef.value.length) return shallowHash(...currentKeys);\n\n const domProjectionKeys = domProjectionItemsRef.value.map(props.getItemKey);\n const domProjectionKeysSet = new Set(domProjectionKeys);\n\n for (let i = 0; i < currentKeys.length; i++) {\n const hasInconsistentPosition = domProjectionKeysSet.has(currentKeys[i]) && domProjectionKeys[i] !== currentKeys[i];\n\n if (hasInconsistentPosition) {\n return shallowHash(...currentKeys);\n }\n }\n\n return oldVersion ?? shallowHash(...currentKeys);\n});\n\ncreateSortable(hasPinnedItems, pinnedContainerRef, pinnedItemsRef, () => 0);\ncreateSortable(hasUnpinnedItems, unpinnedContainerRef, unpinnedItemsRef, () => pinnedItemsRef.value.length);\n\nfunction createSortable(toggler: ShallowRef<boolean>, elRef: ShallowRef<undefined | HTMLElement>, itemsRef: ShallowRef<T[]>, getOffset: () => number) {\n const sortable = useSortable(elRef, itemsRef, {\n handle: `[data-draggable=\"true\"]`,\n animation: 150,\n forceFallback: true,\n fallbackOnBody: true,\n scrollSensitivity: 80,\n forceAutoScrollFallback: true,\n onUpdate: (evt: SortableEvent) => {\n if (evt.oldIndex == null || evt.newIndex == null) {\n throw new Error('Sortable event has no index');\n }\n if (props.onDragEnd?.(evt.oldIndex, evt.newIndex) !== false) {\n moveItems(getOffset() + evt.oldIndex, getOffset() + evt.newIndex, true);\n }\n },\n });\n watch([() => props.disableDragging, toggler], ([disabled, on]) => disabled || !on ? sortable.stop() : sortable.start(), {\n immediate: true,\n });\n\n return sortable;\n}\n\nfunction moveItems(oldIndex: number, newIndex: number, afterUpdateDom: boolean) {\n if (oldIndex === newIndex) return;\n\n if (afterUpdateDom) {\n domProjectionItemsRef.value = moveElements(itemsRef.value.slice(), oldIndex, newIndex);\n }\n\n const preventDefault = props.onSort?.(oldIndex, newIndex) === false;\n\n if (!preventDefault) {\n moveElements(itemsRef.value, oldIndex, newIndex);\n }\n}\n\nfunction isActiveItem(item: T, index: number): boolean {\n return props.isActive?.(item, index) ?? false;\n}\n\nfunction isDraggableItem(item: T, index: number): boolean {\n if (props.disableDragging === true) return false;\n return (props.isDraggable?.(item, index) ?? true);\n}\n\nfunction isRemovableItem(item: T, index: number): boolean {\n if (props.disableRemoving === true) return false;\n return (props.isRemovable?.(item, index) ?? true);\n}\n\nfunction isToggableItem(item: T, index: number): boolean {\n if (props.disableToggling === true) return false;\n return (props.isToggable?.(item, index) ?? (isFunction(props.isToggled) || isFunction(props.onToggle)));\n}\n\nfunction isToggledItem(item: T, index: number): boolean {\n return props.isToggled?.(item, index) ?? false;\n}\n\nfunction isPinnableItem(item: T, index: number): boolean {\n if (props.disablePinning === true) return false;\n return (props.isPinnable?.(item, index) ?? (isFunction(props.isPinned) || isFunction(props.onPin)));\n}\n\nfunction isPinnedItem(item: T, index: number): boolean {\n return props.isPinned?.(item, index) ?? false;\n}\n\nfunction isExpandableItem(item: T, index: number): boolean {\n if (props.disableExpanding === true) return false;\n return (props.isExpandable?.(item, index) ?? (isFunction(props.isExpanded) || isFunction(props.onExpand)));\n}\n\nfunction isExpandedItem(item: T, index: number): boolean {\n return props.isExpanded?.(item, index) ?? false;\n}\n\nfunction handleExpand(item: T, index: number) {\n props.onExpand?.(item, index);\n}\n\nfunction handleToggle(item: T, index: number) {\n props.onToggle?.(item, index);\n}\n\nfunction handlePin(item: T, index: number) {\n if (index === -1) {\n throw new Error('Pinnable item not found');\n }\n\n const alreadyPinned = pinnedItemsRef.value.includes(item);\n\n if (props.onPin?.(item, index) === false) return;\n\n moveItems(index, pinnedItemsRef.value.length + (alreadyPinned ? 0 : -1), false);\n}\n\nfunction handleRemove(item: T, index: number) {\n if (props.onRemove?.(item, index) === false) return;\n itemsRef.value.splice(index, 1);\n}\n\nconst getItemClass = (item: T, index: number): null | string | string[] => {\n if (typeof props.itemClass === 'function') {\n return props.itemClass(item, index);\n }\n return props.itemClass ?? null;\n};\n\n</script>\n\n<template>\n <div :class=\"$style.root\">\n <div ref=\"pinnedContainerRef\" :class=\"$style.list\">\n <PlElementListItem\n v-for=\"(pinnedItem, pinnedIndex) in pinnedItemsRef\" :key=\"pinnedKeysRef[pinnedIndex]\"\n :class=\"[$style.item, getItemClass(pinnedItem, pinnedIndex)]\"\n\n :index=\"pinnedIndex\"\n :item=\"pinnedItem\"\n :showDragHandle=\"dndSortingEnabled\"\n :isActive=\"isActiveItem(pinnedItem, pinnedIndex)\"\n :isDraggable=\"isDraggableItem(pinnedItem, pinnedIndex)\"\n :isRemovable=\"isRemovableItem(pinnedItem, pinnedIndex)\"\n :isToggable=\"isToggableItem(pinnedItem, pinnedIndex)\"\n :isToggled=\"isToggledItem(pinnedItem, pinnedIndex)\"\n :isPinnable=\"isPinnableItem(pinnedItem, pinnedIndex)\"\n :isPinned=\"true\"\n :isExpandable=\"isExpandableItem(pinnedItem, pinnedIndex)\"\n :isExpanded=\"isExpandedItem(pinnedItem, pinnedIndex)\"\n\n @click=\"emits('itemClick', pinnedItem)\"\n @remove=\"handleRemove\"\n @toggle=\"handleToggle\"\n @pin=\"handlePin\"\n @expand=\"handleExpand\"\n >\n <template #title=\"{ item, index }\">\n <slot :index=\"index\" :item=\"item\" name=\"item-title\" />\n </template>\n <template v-if=\"slots['item-content']\" #content=\"{ item, index }\">\n <slot :index=\"index\" :item=\"item\" name=\"item-content\" />\n </template>\n </PlElementListItem>\n </div>\n <div v-if=\"hasUnpinnedItems\" ref=\"unpinnedContainerRef\" :class=\"$style.list\">\n <PlElementListItem\n v-for=\"(unpinnedItem, unpinnedIndex) in unpinnedItemsRef\" :key=\"unpinnedKeysRef[unpinnedIndex]\"\n :class=\"[$style.item, getItemClass(unpinnedItem, unpinnedIndex)]\"\n\n :index=\"unpinnedIndex + (pinnedItemsRef?.length ?? 0)\"\n :item=\"unpinnedItem\"\n :showDragHandle=\"dndSortingEnabled\"\n :isActive=\"isActiveItem(unpinnedItem, unpinnedIndex)\"\n :isDraggable=\"isDraggableItem(unpinnedItem, unpinnedIndex)\"\n :isRemovable=\"isRemovableItem(unpinnedItem, unpinnedIndex)\"\n :isToggable=\"isToggableItem(unpinnedItem, unpinnedIndex)\"\n :isToggled=\"isToggledItem(unpinnedItem, unpinnedIndex)\"\n :isPinnable=\"isPinnableItem(unpinnedItem, unpinnedIndex)\"\n :isPinned=\"false\"\n :isExpandable=\"isExpandableItem(unpinnedItem, unpinnedIndex)\"\n :isExpanded=\"isExpandedItem(unpinnedItem, unpinnedIndex)\"\n\n @click=\"emits('itemClick', unpinnedItem)\"\n @remove=\"handleRemove\"\n @toggle=\"handleToggle\"\n @pin=\"handlePin\"\n @expand=\"handleExpand\"\n >\n <template #title=\"{ item, index }\">\n <slot :index=\"index\" :item=\"item\" name=\"item-title\" />\n </template>\n <template v-if=\"slots['item-content']\" #content=\"{ item, index }\">\n <slot :index=\"index\" :item=\"item\" name=\"item-content\" />\n </template>\n </PlElementListItem>\n </div>\n </div>\n</template>\n\n<style module>\n.root, .list {\n display: flex;\n flex-direction: column;\n gap: 8px;\n min-width: 180px;\n}\n\n.item {\n width: 100%;\n}\n\n:global(.sortable-ghost) {\n visibility: hidden;\n}\n:global(.sortable-drag) {\n opacity: 1;\n}\n</style>\n"],"names":["itemsRef","_useModel","__props","props","emits","__emit","slots","_useSlots","dndSortingEnabled","computed","pinnedItemsRef","isPinnedItem","hasPinnedItems","unpinnedItemsRef","item","index","hasUnpinnedItems","domProjectionItemsRef","shallowRef","pinnedContainerRef","unpinnedContainerRef","getKey","versionRef","pinnedKeysRef","unpinnedKeysRef","oldVersion","currentKeys","shallowHash","domProjectionKeys","domProjectionKeysSet","i","createSortable","toggler","elRef","getOffset","sortable","useSortable","evt","_a","moveItems","watch","disabled","on","oldIndex","newIndex","afterUpdateDom","moveElements","isActiveItem","isDraggableItem","isRemovableItem","isToggableItem","isFunction","isToggledItem","isPinnableItem","isExpandableItem","isExpandedItem","handleExpand","handleToggle","handlePin","alreadyPinned","handleRemove","getItemClass"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASM,UAAAA,IAAWC,GAAgBC,GAAC,OAA2B,GAEvDC,IAAQD,GA8DRE,IAAQC,GAIRC,IAAQC,GAGV,GAEEC,IAAoBC,EAAS,MAC1BN,EAAM,oBAAoB,EAClC,GAEKO,IAAiBD,EAAS,MAAMT,EAAS,MAAM,OAAOW,CAAY,CAAC,GACnEC,IAAiBH,EAAS,MAAMC,EAAe,MAAM,SAAS,CAAC,GAE/DG,IAAmBJ,EAAS,MAAMT,EAAS,MAAM,OAAO,CAACc,GAAMC,MAAU,CAACJ,EAAaG,GAAMC,CAAK,CAAC,CAAC,GACpGC,IAAmBP,EAAS,MAAMI,EAAiB,MAAM,SAAS,CAAC,GAEnEI,IAAwBC,EAA4B,GACpDC,IAAqBD,EAAwB,GAC7CE,IAAuBF,EAAwB,GAG/CG,IAAS,CAACP,GAASC,MAChB,GAAGO,GAAW,KAAK,IAAInB,EAAM,WAAWW,GAAMC,CAAK,CAAC,IAEvDQ,KAAgBd,EAAS,MAAMC,EAAe,MAAM,IAAIW,CAAM,CAAC,GAC/DG,KAAkBf,EAAS,MAAMI,EAAiB,MAAM,IAAIQ,CAA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vE,aAAAC,EAAa9C,GAASC,GAAe;;AAC5C,QAAIuB,IAAAnC,EAAM,aAAN,gBAAAmC,EAAA,KAAAnC,GAAiBW,GAAMC,QAAW,MAC7Bf,EAAA,MAAM,OAAOe,GAAO,CAAC;AAAA,IAAA;AAG1B,UAAA8C,IAAe,CAAC/C,GAASC,MACzB,OAAOZ,EAAM,aAAc,aACtBA,EAAM,UAAUW,GAAMC,CAAK,IAE7BZ,EAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"PlElementList.vue2.js","sources":["../../../src/components/PlElementList/PlElementList.vue"],"sourcesContent":["<script generic=\"T extends unknown = unknown, K extends number | string = number | string\" lang=\"ts\" setup>\nimport { isFunction, shallowHash } from '@milaboratories/helpers';\nimport { useSortable } from '@vueuse/integrations/useSortable';\nimport { type SortableEvent } from 'sortablejs';\nimport type { ShallowRef } from 'vue';\nimport { computed, shallowRef, watch } from 'vue';\nimport PlElementListItem from './PlElementListItem.vue';\nimport { moveElements } from './utils.ts';\n\nconst itemsRef = defineModel<T[]>('items', { required: true });\n\nconst props = withDefaults(\n defineProps<{\n getItemKey?: (item: T, index: number) => K;\n\n itemClass?: string | string[] | ((item: T, index: number) => string | string[]);\n isActive?: (item: T, index: number) => boolean;\n\n disableDragging?: boolean;\n isDraggable?: (item: T, index: number) => boolean;\n onDragEnd?: (oldIndex: number, newIndex: number) => void | boolean;\n onSort?: (oldIndex: number, newIndex: number) => void | boolean;\n\n disableRemoving?: boolean;\n isRemovable?: (item: T, index: number) => boolean;\n onRemove?: (item: T, index: number) => void | boolean;\n\n disableExpanding?: boolean;\n isExpandable?: (item: T, index: number) => boolean;\n isExpanded?: (item: T, index: number) => boolean;\n onExpand?: (item: T, index: number) => unknown;\n\n disableToggling?: boolean;\n isToggable?: (item: T, index: number) => boolean;\n isToggled?: (item: T, index: number) => boolean;\n onToggle?: (item: T, index: number) => unknown;\n\n disablePinning?: boolean;\n isPinnable?: (item: T, index: number) => boolean;\n isPinned?: (item: T, index: number) => boolean;\n onPin?: (item: T, index: number) => void | boolean;\n }>(), {\n getItemKey: (item: T) => JSON.stringify(item) as K,\n\n itemClass: undefined,\n isActive: undefined,\n\n disableDragging: undefined,\n isDraggable: undefined,\n onDragEnd: undefined,\n onSort: undefined,\n\n disableRemoving: undefined,\n isRemovable: undefined,\n onRemove: undefined,\n\n disableExpanding: undefined,\n isExpandable: undefined,\n isExpanded: undefined,\n onExpand: undefined,\n\n disableToggling: undefined,\n isToggable: undefined,\n isToggled: undefined,\n onToggle: undefined,\n\n disablePinning: undefined,\n isPinnable: undefined,\n isPinned: undefined,\n onPin: undefined,\n },\n);\n\nconst emits = defineEmits<{\n (e: 'itemClick', item: T): void;\n}>();\n\nconst slots = defineSlots<{\n ['item-title']: (props: { item: T; index: number }) => unknown;\n ['item-content']?: (props: { item: T; index: number }) => unknown;\n}>();\n\nconst dndSortingEnabled = computed((): boolean => {\n return props.disableDragging !== true;\n});\n\nconst pinnedItemsRef = computed(() => itemsRef.value.filter(isPinnedItem));\nconst hasPinnedItems = computed(() => pinnedItemsRef.value.length > 0);\n\nconst unpinnedItemsRef = computed(() => itemsRef.value.filter((item, index) => !isPinnedItem(item, index)));\nconst hasUnpinnedItems = computed(() => unpinnedItemsRef.value.length > 0);\n\nconst domProjectionItemsRef = shallowRef<undefined | T[]>();\nconst pinnedContainerRef = shallowRef<HTMLElement>();\nconst unpinnedContainerRef = shallowRef<HTMLElement>();\n\n// version fix problem with sync between data and rendered values\nconst getKey = (item: T, index: number) => {\n return `${versionRef.value}-${props.getItemKey(item, index)}`;\n};\nconst pinnedKeysRef = computed(() => pinnedItemsRef.value.map(getKey));\nconst unpinnedKeysRef = computed(() => unpinnedItemsRef.value.map(getKey));\n\n// version fix problem with sync between data and rendered values when items have been changed\nconst versionRef = computed<number>((oldVersion) => {\n const currentKeys = itemsRef.value.map(props.getItemKey);\n\n if (domProjectionItemsRef.value === undefined) return oldVersion ?? shallowHash(...currentKeys);\n if (currentKeys.length !== domProjectionItemsRef.value.length) return shallowHash(...currentKeys);\n\n const domProjectionKeys = domProjectionItemsRef.value.map(props.getItemKey);\n const domProjectionKeysSet = new Set(domProjectionKeys);\n\n for (let i = 0; i < currentKeys.length; i++) {\n const hasInconsistentPosition = domProjectionKeysSet.has(currentKeys[i]) && domProjectionKeys[i] !== currentKeys[i];\n\n if (hasInconsistentPosition) {\n return shallowHash(...currentKeys);\n }\n }\n\n return oldVersion ?? shallowHash(...currentKeys);\n});\n\ncreateSortable(hasPinnedItems, pinnedContainerRef, pinnedItemsRef, () => 0);\ncreateSortable(hasUnpinnedItems, unpinnedContainerRef, unpinnedItemsRef, () => pinnedItemsRef.value.length);\n\nfunction createSortable(toggler: ShallowRef<boolean>, elRef: ShallowRef<undefined | HTMLElement>, itemsRef: ShallowRef<T[]>, getOffset: () => number) {\n const sortable = useSortable(elRef, itemsRef, {\n handle: `[data-draggable=\"true\"]`,\n animation: 150,\n forceFallback: true,\n fallbackOnBody: true,\n scrollSensitivity: 80,\n forceAutoScrollFallback: true,\n onUpdate: (evt: SortableEvent) => {\n if (evt.oldIndex == null || evt.newIndex == null) {\n throw new Error('Sortable event has no index');\n }\n if (props.onDragEnd?.(evt.oldIndex, evt.newIndex) !== false) {\n moveItems(getOffset() + evt.oldIndex, getOffset() + evt.newIndex, true);\n }\n },\n });\n watch(\n [elRef, () => props.disableDragging, toggler],\n ([elRef, disabled, on]) => {\n if (!elRef || disabled || !on) {\n sortable.stop();\n } else {\n sortable.start();\n }\n },\n { immediate: true },\n );\n\n return sortable;\n}\n\nfunction moveItems(oldIndex: number, newIndex: number, afterUpdateDom: boolean) {\n if (oldIndex === newIndex) return;\n\n if (afterUpdateDom) {\n domProjectionItemsRef.value = moveElements(itemsRef.value.slice(), oldIndex, newIndex);\n }\n\n const preventDefault = props.onSort?.(oldIndex, newIndex) === false;\n\n if (!preventDefault) {\n moveElements(itemsRef.value, oldIndex, newIndex);\n }\n}\n\nfunction isActiveItem(item: T, index: number): boolean {\n return props.isActive?.(item, index) ?? false;\n}\n\nfunction isDraggableItem(item: T, index: number): boolean {\n if (props.disableDragging === true) return false;\n return (props.isDraggable?.(item, index) ?? true);\n}\n\nfunction isRemovableItem(item: T, index: number): boolean {\n if (props.disableRemoving === true) return false;\n return (props.isRemovable?.(item, index) ?? true);\n}\n\nfunction isToggableItem(item: T, index: number): boolean {\n if (props.disableToggling === true) return false;\n return (props.isToggable?.(item, index) ?? (isFunction(props.isToggled) || isFunction(props.onToggle)));\n}\n\nfunction isToggledItem(item: T, index: number): boolean {\n return props.isToggled?.(item, index) ?? false;\n}\n\nfunction isPinnableItem(item: T, index: number): boolean {\n if (props.disablePinning === true) return false;\n return (props.isPinnable?.(item, index) ?? (isFunction(props.isPinned) || isFunction(props.onPin)));\n}\n\nfunction isPinnedItem(item: T, index: number): boolean {\n return props.isPinned?.(item, index) ?? false;\n}\n\nfunction isExpandableItem(item: T, index: number): boolean {\n if (props.disableExpanding === true) return false;\n return (props.isExpandable?.(item, index) ?? (isFunction(props.isExpanded) || isFunction(props.onExpand)));\n}\n\nfunction isExpandedItem(item: T, index: number): boolean {\n return props.isExpanded?.(item, index) ?? false;\n}\n\nfunction handleExpand(item: T, index: number) {\n props.onExpand?.(item, index);\n}\n\nfunction handleToggle(item: T, index: number) {\n props.onToggle?.(item, index);\n}\n\nfunction handlePin(item: T, index: number) {\n if (index === -1) {\n throw new Error('Pinnable item not found');\n }\n\n const alreadyPinned = pinnedItemsRef.value.includes(item);\n\n if (props.onPin?.(item, index) === false) return;\n\n moveItems(index, pinnedItemsRef.value.length + (alreadyPinned ? 0 : -1), false);\n}\n\nfunction handleRemove(item: T, index: number) {\n if (props.onRemove?.(item, index) === false) return;\n itemsRef.value.splice(index, 1);\n}\n\nconst getItemClass = (item: T, index: number): null | string | string[] => {\n if (typeof props.itemClass === 'function') {\n return props.itemClass(item, index);\n }\n return props.itemClass ?? null;\n};\n\n</script>\n\n<template>\n <div :class=\"$style.root\">\n <div ref=\"pinnedContainerRef\" :class=\"$style.list\">\n <PlElementListItem\n v-for=\"(pinnedItem, pinnedIndex) in pinnedItemsRef\" :key=\"pinnedKeysRef[pinnedIndex]\"\n :class=\"[$style.item, getItemClass(pinnedItem, pinnedIndex)]\"\n\n :index=\"pinnedIndex\"\n :item=\"pinnedItem\"\n :showDragHandle=\"dndSortingEnabled\"\n :isActive=\"isActiveItem(pinnedItem, pinnedIndex)\"\n :isDraggable=\"isDraggableItem(pinnedItem, pinnedIndex)\"\n :isRemovable=\"isRemovableItem(pinnedItem, pinnedIndex)\"\n :isToggable=\"isToggableItem(pinnedItem, pinnedIndex)\"\n :isToggled=\"isToggledItem(pinnedItem, pinnedIndex)\"\n :isPinnable=\"isPinnableItem(pinnedItem, pinnedIndex)\"\n :isPinned=\"true\"\n :isExpandable=\"isExpandableItem(pinnedItem, pinnedIndex)\"\n :isExpanded=\"isExpandedItem(pinnedItem, pinnedIndex)\"\n\n @click=\"emits('itemClick', pinnedItem)\"\n @remove=\"handleRemove\"\n @toggle=\"handleToggle\"\n @pin=\"handlePin\"\n @expand=\"handleExpand\"\n >\n <template #title=\"{ item, index }\">\n <slot :index=\"index\" :item=\"item\" name=\"item-title\" />\n </template>\n <template v-if=\"slots['item-content']\" #content=\"{ item, index }\">\n <slot :index=\"index\" :item=\"item\" name=\"item-content\" />\n </template>\n </PlElementListItem>\n </div>\n <div v-if=\"hasUnpinnedItems\" ref=\"unpinnedContainerRef\" :class=\"$style.list\">\n <PlElementListItem\n v-for=\"(unpinnedItem, unpinnedIndex) in unpinnedItemsRef\" :key=\"unpinnedKeysRef[unpinnedIndex]\"\n :class=\"[$style.item, getItemClass(unpinnedItem, unpinnedIndex)]\"\n\n :index=\"unpinnedIndex + (pinnedItemsRef?.length ?? 0)\"\n :item=\"unpinnedItem\"\n :showDragHandle=\"dndSortingEnabled\"\n :isActive=\"isActiveItem(unpinnedItem, unpinnedIndex)\"\n :isDraggable=\"isDraggableItem(unpinnedItem, unpinnedIndex)\"\n :isRemovable=\"isRemovableItem(unpinnedItem, unpinnedIndex)\"\n :isToggable=\"isToggableItem(unpinnedItem, unpinnedIndex)\"\n :isToggled=\"isToggledItem(unpinnedItem, unpinnedIndex)\"\n :isPinnable=\"isPinnableItem(unpinnedItem, unpinnedIndex)\"\n :isPinned=\"false\"\n :isExpandable=\"isExpandableItem(unpinnedItem, unpinnedIndex)\"\n :isExpanded=\"isExpandedItem(unpinnedItem, unpinnedIndex)\"\n\n @click=\"emits('itemClick', unpinnedItem)\"\n @remove=\"handleRemove\"\n @toggle=\"handleToggle\"\n @pin=\"handlePin\"\n @expand=\"handleExpand\"\n >\n <template #title=\"{ item, index }\">\n <slot :index=\"index\" :item=\"item\" name=\"item-title\" />\n </template>\n <template v-if=\"slots['item-content']\" #content=\"{ item, index }\">\n <slot :index=\"index\" :item=\"item\" name=\"item-content\" />\n </template>\n </PlElementListItem>\n </div>\n </div>\n</template>\n\n<style module>\n.root, .list {\n display: flex;\n flex-direction: column;\n gap: 8px;\n min-width: 180px;\n}\n\n.item {\n width: 100%;\n}\n\n:global(.sortable-ghost) {\n visibility: hidden;\n}\n:global(.sortable-drag) {\n opacity: 1;\n}\n</style>\n"],"names":["itemsRef","_useModel","__props","props","emits","__emit","slots","_useSlots","dndSortingEnabled","computed","pinnedItemsRef","isPinnedItem","hasPinnedItems","unpinnedItemsRef","item","index","hasUnpinnedItems","domProjectionItemsRef","shallowRef","pinnedContainerRef","unpinnedContainerRef","getKey","versionRef","pinnedKeysRef","unpinnedKeysRef","oldVersion","currentKeys","shallowHash","domProjectionKeys","domProjectionKeysSet","i","createSortable","toggler","elRef","getOffset","sortable","useSortable","evt","_a","moveItems","watch","disabled","on","oldIndex","newIndex","afterUpdateDom","moveElements","isActiveItem","isDraggableItem","isRemovableItem","isToggableItem","isFunction","isToggledItem","isPinnableItem","is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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlElementListItem.vue.d.ts","sourceRoot":"","sources":["../../../src/components/PlElementList/PlElementListItem.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PlElementListItem.vue.d.ts","sourceRoot":"","sources":["../../../src/components/PlElementList/PlElementListItem.vue"],"names":[],"mappings":"yBAgQiB,CAAC,SAAS,OAAO,yBACpB,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,cAClD,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,iBAC5F,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC;WA2M1D,mBAAmB,CAAC;;;;;;cAxMpB,CAAC;eACA,MAAM;wBACG,OAAO;kBACb,OAAO;qBACJ,OAAO;qBACP,OAAO;sBACN,OAAO;oBACT,OAAO;oBACP,OAAO;mBACR,OAAO;oBACN,OAAO;kBACT,OAAO;mBA6L2E,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI;WAClD,GAAG;;eA1LF,CAAC,KAAK,EAAE;YAAE,IAAI,EAAE,CAAC,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,KAAK,OAAO;kBAC3C,CAAC,KAAK,EAAE;YAAE,IAAI,EAAE,CAAC,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,KAAK,OAAO;;eADjD,CAAC,KAAK,EAAE;YAAE,IAAI,EAAE,CAAC,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,KAAK,OAAO;kBAC3C,CAAC,KAAK,EAAE;YAAE,IAAI,EAAE,CAAC,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,KAAK,OAAO;;;YAKpD,QAAQ,QAAQ,CAAC,SAAS,MAAM,GAAG,IAAI;YACvC,QAAQ,QAAQ,CAAC,SAAS,MAAM,GAAG,IAAI;YACvC,KAAK,QAAQ,CAAC,SAAS,MAAM,GAAG,IAAI;YACpC,QAAQ,QAAQ,CAAC,SAAS,MAAM,GAAG,IAAI;;;;;YAsLD,OAAO,CAAC,OAAO,WAAW,CAAC;;AArNvE,wBAqN4E;AA2B5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as c, useSlots as E, computed as C, createElementBlock as o, openBlock as n, normalizeClass as l, createElementVNode as p, createCommentVNode as t, createBlock as P, createVNode as r, unref as a, renderSlot as v, withModifiers as m } from "vue";
|
|
2
2
|
import g from "../PlIcon16/PlIcon16.vue.js";
|
|
3
3
|
import b from "../PlIcon24/PlIcon24.vue.js";
|
|
4
|
-
const f = ["data-draggable"], h = /* @__PURE__ */
|
|
4
|
+
const f = ["data-draggable"], h = /* @__PURE__ */ c({
|
|
5
5
|
__name: "PlElementListItem",
|
|
6
6
|
props: {
|
|
7
7
|
item: {},
|
|
@@ -19,15 +19,16 @@ const f = ["data-draggable"], h = /* @__PURE__ */ B({
|
|
|
19
19
|
},
|
|
20
20
|
emits: ["expand", "toggle", "pin", "remove"],
|
|
21
21
|
setup(k, { emit: u }) {
|
|
22
|
-
const s = k,
|
|
22
|
+
const s = k, B = E(), $ = C(() => B.content !== void 0), d = u;
|
|
23
23
|
return (e, i) => (n(), o("div", {
|
|
24
24
|
class: l([e.$style.root, {
|
|
25
25
|
[e.$style.active]: s.isActive,
|
|
26
26
|
[e.$style.pinned]: s.isPinned,
|
|
27
|
+
[e.$style.opened]: s.isExpanded,
|
|
27
28
|
[e.$style.disabled]: s.isToggled
|
|
28
29
|
}])
|
|
29
30
|
}, [
|
|
30
|
-
|
|
31
|
+
p("div", {
|
|
31
32
|
class: l([e.$style.head, {
|
|
32
33
|
[e.$style.clickable]: $.value
|
|
33
34
|
}]),
|
|
@@ -45,7 +46,7 @@ const f = ["data-draggable"], h = /* @__PURE__ */ B({
|
|
|
45
46
|
class: l([e.$style.contentChevron, { [e.$style.opened]: s.isExpanded }]),
|
|
46
47
|
name: "chevron-down"
|
|
47
48
|
}, null, 8, ["class"])) : t("", !0),
|
|
48
|
-
|
|
49
|
+
p("div", {
|
|
49
50
|
class: l(e.$style.title)
|
|
50
51
|
}, [
|
|
51
52
|
v(e.$slots, "title", {
|
|
@@ -53,13 +54,13 @@ const f = ["data-draggable"], h = /* @__PURE__ */ B({
|
|
|
53
54
|
index: s.index
|
|
54
55
|
})
|
|
55
56
|
], 2),
|
|
56
|
-
|
|
57
|
+
p("div", {
|
|
57
58
|
class: l([e.$style.actions, e.$style.showOnHover])
|
|
58
59
|
}, [
|
|
59
60
|
s.isToggable ? (n(), o("div", {
|
|
60
61
|
key: 0,
|
|
61
62
|
class: l([e.$style.action, e.$style.clickable, { [e.$style.disable]: !s.isToggable }]),
|
|
62
|
-
onClick: i[0] || (i[0] =
|
|
63
|
+
onClick: i[0] || (i[0] = m((y) => d("toggle", s.item, s.index), ["stop"]))
|
|
63
64
|
}, [
|
|
64
65
|
r(a(b), {
|
|
65
66
|
name: s.isToggled === !0 ? "view-hide" : "view-show",
|
|
@@ -72,7 +73,7 @@ const f = ["data-draggable"], h = /* @__PURE__ */ B({
|
|
|
72
73
|
[e.$style.disable]: !s.isPinnable,
|
|
73
74
|
[e.$style.activated]: s.isPinned
|
|
74
75
|
}]),
|
|
75
|
-
onClick: i[1] || (i[1] =
|
|
76
|
+
onClick: i[1] || (i[1] = m((y) => d("pin", s.item, s.index), ["stop"]))
|
|
76
77
|
}, [
|
|
77
78
|
r(a(b), {
|
|
78
79
|
name: "pin",
|
|
@@ -82,7 +83,7 @@ const f = ["data-draggable"], h = /* @__PURE__ */ B({
|
|
|
82
83
|
s.isRemovable ? (n(), o("div", {
|
|
83
84
|
key: 2,
|
|
84
85
|
class: l([e.$style.action, e.$style.clickable]),
|
|
85
|
-
onClick: i[2] || (i[2] =
|
|
86
|
+
onClick: i[2] || (i[2] = m((y) => d("remove", s.item, s.index), ["stop"]))
|
|
86
87
|
}, [
|
|
87
88
|
r(a(g), { name: "close" })
|
|
88
89
|
], 2)) : t("", !0)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlElementListItem.vue2.js","sources":["../../../src/components/PlElementList/PlElementListItem.vue"],"sourcesContent":["<script generic=\"T extends unknown = unknown\" lang=\"ts\" setup>\nimport { computed } from 'vue';\nimport { PlIcon16 } from '../PlIcon16';\nimport { PlIcon24 } from '../PlIcon24';\n\nconst props = defineProps<{\n item: T;\n index: number;\n showDragHandle: boolean;\n isActive: boolean;\n isDraggable: boolean;\n isRemovable: boolean;\n isExpandable: boolean;\n isExpanded: boolean;\n isToggable: boolean;\n isToggled: boolean;\n isPinnable: boolean;\n isPinned: boolean;\n}>();\n\nconst slots = defineSlots<{\n title: (props: { item: T; index: number }) => unknown;\n content?: (props: { item: T; index: number }) => unknown;\n}>();\nconst hasContentSlot = computed(() => slots['content'] !== undefined);\n\nconst emit = defineEmits<{\n (e: 'expand', item: T, index: number): void;\n (e: 'toggle', item: T, index: number): void;\n (e: 'pin', item: T, index: number): void;\n (e: 'remove', item: T, index: number): void;\n}>();\n</script>\n\n<template>\n <div\n :class=\"[$style.root, {\n [$style.active]: props.isActive,\n [$style.pinned]: props.isPinned,\n [$style.disabled]: props.isToggled,\n }]\"\n >\n <div\n :class=\"[$style.head, {\n [$style.clickable]: hasContentSlot,\n }]\"\n @click=\"isExpandable && emit('expand', props.item, props.index)\"\n >\n <div\n v-if=\"props.showDragHandle\"\n :class=\"[$style.action, $style.draggable, { [$style.disable]: !props.isDraggable } ]\"\n :data-draggable=\"props.isDraggable\"\n >\n <PlIcon16 name=\"drag-dots\" />\n </div>\n <PlIcon16 v-if=\"isExpandable\" :class=\"[$style.contentChevron, { [$style.opened]: props.isExpanded }]\" name=\"chevron-down\" />\n\n <div :class=\"$style.title\">\n <slot name=\"title\" :item=\"props.item\" :index=\"props.index\" />\n </div>\n\n <div :class=\"[$style.actions, $style.showOnHover]\">\n <div\n v-if=\"props.isToggable\"\n :class=\"[$style.action, $style.clickable, { [$style.disable]: !props.isToggable }]\"\n @click.stop=\"emit('toggle', props.item, props.index)\"\n >\n <PlIcon24 :name=\"props.isToggled === true ? 'view-hide' : 'view-show'\" size=\"16\" />\n </div>\n <div\n v-if=\"props.isPinnable\"\n :class=\"[$style.action, $style.clickable, {\n [$style.disable]: !props.isPinnable,\n [$style.activated]: props.isPinned,\n }]\"\n @click.stop=\"emit('pin', props.item, props.index)\"\n >\n <PlIcon24 name=\"pin\" size=\"16\" />\n </div>\n <div\n v-if=\"props.isRemovable\"\n :class=\"[$style.action, $style.clickable]\"\n @click.stop=\"emit('remove', props.item, props.index)\"\n >\n <PlIcon16 name=\"close\" />\n </div>\n </div>\n </div>\n <div\n v-if=\"hasContentSlot && props.isExpanded\"\n :class=\"[$style.body, { [$style.disabled]: props.isToggled }]\"\n >\n <slot name=\"content\" :item=\"props.item\" :index=\"props.index\" />\n </div>\n </div>\n</template>\n\n<style module>\n@use '../../assets/variables.scss' as *;\n\n.root {\n --background: rgba(255, 255, 255, 0.8);\n --border-color: var(--color-div-grey);\n --head-background: unset;\n --box-shadow: none;\n --box-shadow-active: 0 0 0 4px color-mix(in srgb, var(--border-color-focus) 50%, transparent);\n\n &:global(.sortable-drag),\n &:global(.sortable-chosen) {\n --head-background: var(--gradient-light-lime);\n --border-color: var(--border-color-focus);\n --box-shadow: var(--box-shadow-active)\n }\n}\n.root {\n display: flex;\n flex-direction: column;\n justify-content: center;\n border-radius: var(--border-radius);\n border: 1px solid var(--border-color);\n background-color: var(--background);\n transition: box-shadow 0.15s;\n box-shadow: var(--box-shadow);;\n overflow: hidden;\n\n &:hover {\n --border-color: var(--border-color-focus);\n }\n\n &.disabled {\n --icon-color: var(--ic-02);\n --border-color: var(--border-color-div-grey);\n color: var(--txt-03);\n filter: grayscale(1);\n }\n\n &.pinned {\n --background: var(--bg-base-light);\n }\n\n &.active {\n --border-color: var(--border-color-focus);\n --head-background: var(--btn-accent-positive-500);\n }\n}\n\n.head {\n position: relative;\n display: flex;\n align-items: center;\n padding: 8px;\n min-height: 40px;\n border-radius: var(--border-radius) var(--border-radius) 0 0;\n background: var(--head-background);\n
|
|
1
|
+
{"version":3,"file":"PlElementListItem.vue2.js","sources":["../../../src/components/PlElementList/PlElementListItem.vue"],"sourcesContent":["<script generic=\"T extends unknown = unknown\" lang=\"ts\" setup>\nimport { computed } from 'vue';\nimport { PlIcon16 } from '../PlIcon16';\nimport { PlIcon24 } from '../PlIcon24';\n\nconst props = defineProps<{\n item: T;\n index: number;\n showDragHandle: boolean;\n isActive: boolean;\n isDraggable: boolean;\n isRemovable: boolean;\n isExpandable: boolean;\n isExpanded: boolean;\n isToggable: boolean;\n isToggled: boolean;\n isPinnable: boolean;\n isPinned: boolean;\n}>();\n\nconst slots = defineSlots<{\n title: (props: { item: T; index: number }) => unknown;\n content?: (props: { item: T; index: number }) => unknown;\n}>();\nconst hasContentSlot = computed(() => slots['content'] !== undefined);\n\nconst emit = defineEmits<{\n (e: 'expand', item: T, index: number): void;\n (e: 'toggle', item: T, index: number): void;\n (e: 'pin', item: T, index: number): void;\n (e: 'remove', item: T, index: number): void;\n}>();\n</script>\n\n<template>\n <div\n :class=\"[$style.root, {\n [$style.active]: props.isActive,\n [$style.pinned]: props.isPinned,\n [$style.opened]: props.isExpanded,\n [$style.disabled]: props.isToggled,\n }]\"\n >\n <div\n :class=\"[$style.head, {\n [$style.clickable]: hasContentSlot,\n }]\"\n @click=\"isExpandable && emit('expand', props.item, props.index)\"\n >\n <div\n v-if=\"props.showDragHandle\"\n :class=\"[$style.action, $style.draggable, { [$style.disable]: !props.isDraggable } ]\"\n :data-draggable=\"props.isDraggable\"\n >\n <PlIcon16 name=\"drag-dots\" />\n </div>\n <PlIcon16 v-if=\"isExpandable\" :class=\"[$style.contentChevron, { [$style.opened]: props.isExpanded }]\" name=\"chevron-down\" />\n\n <div :class=\"$style.title\">\n <slot name=\"title\" :item=\"props.item\" :index=\"props.index\" />\n </div>\n\n <div :class=\"[$style.actions, $style.showOnHover]\">\n <div\n v-if=\"props.isToggable\"\n :class=\"[$style.action, $style.clickable, { [$style.disable]: !props.isToggable }]\"\n @click.stop=\"emit('toggle', props.item, props.index)\"\n >\n <PlIcon24 :name=\"props.isToggled === true ? 'view-hide' : 'view-show'\" size=\"16\" />\n </div>\n <div\n v-if=\"props.isPinnable\"\n :class=\"[$style.action, $style.clickable, {\n [$style.disable]: !props.isPinnable,\n [$style.activated]: props.isPinned,\n }]\"\n @click.stop=\"emit('pin', props.item, props.index)\"\n >\n <PlIcon24 name=\"pin\" size=\"16\" />\n </div>\n <div\n v-if=\"props.isRemovable\"\n :class=\"[$style.action, $style.clickable]\"\n @click.stop=\"emit('remove', props.item, props.index)\"\n >\n <PlIcon16 name=\"close\" />\n </div>\n </div>\n </div>\n <div\n v-if=\"hasContentSlot && props.isExpanded\"\n :class=\"[$style.body, { [$style.disabled]: props.isToggled }]\"\n >\n <slot name=\"content\" :item=\"props.item\" :index=\"props.index\" />\n </div>\n </div>\n</template>\n\n<style module>\n@use '../../assets/variables.scss' as *;\n\n.root {\n --background: rgba(255, 255, 255, 0.8);\n --border-color: var(--color-div-grey);\n --head-background: unset;\n --box-shadow: none;\n --box-shadow-active: 0 0 0 4px color-mix(in srgb, var(--border-color-focus) 50%, transparent);\n\n &:global(.sortable-drag),\n &:global(.sortable-chosen) {\n --head-background: var(--gradient-light-lime);\n --border-color: var(--border-color-focus);\n --box-shadow: var(--box-shadow-active)\n }\n}\n.root {\n display: flex;\n flex-direction: column;\n justify-content: center;\n border-radius: var(--border-radius);\n border: 1px solid var(--border-color);\n background-color: var(--background);\n transition: box-shadow 0.15s;\n box-shadow: var(--box-shadow);;\n overflow: hidden;\n\n &:hover {\n --border-color: var(--border-color-focus);\n --head-background: var(--gradient-light-lime);\n }\n\n &.opened {\n --head-background: var(--gradient-light-lime);\n }\n\n &.disabled {\n --icon-color: var(--ic-02);\n --border-color: var(--border-color-div-grey);\n color: var(--txt-03);\n filter: grayscale(1);\n }\n\n &.pinned {\n --background: var(--bg-base-light);\n }\n\n &.active {\n --border-color: var(--border-color-focus);\n --head-background: var(--btn-accent-positive-500);\n }\n}\n\n.head {\n position: relative;\n display: flex;\n align-items: center;\n padding: 8px;\n min-height: 40px;\n border-radius: var(--border-radius) var(--border-radius) 0 0;\n background: var(--head-background);\n}\n\n.contentChevron {\n display: block;\n width: 16px;\n height: 16px;\n margin-right: 4px;\n transform: rotate(-90deg);\n transition: transform 0.15s;\n\n &.opened {\n transform: rotate(0deg);\n }\n}\n\n.title {\n display: flex;\n flex-direction: row;\n flex: 1 1 0;\n gap: 8px;\n text-overflow: ellipsis;\n}\n\n.body {\n display: flex;\n flex-direction: column;\n gap: 12px;\n padding: 24px;\n border-radius: 0 0 var(--border-radius) var(--border-radius);\n\n &.disabled {\n pointer-events: none;\n }\n}\n\n.actions {\n position: absolute;\n top: 8px;\n right: 8px;\n display: flex;\n align-items: center;\n background-color: var(--background);\n border-radius: var(--border-radius);\n}\n\n.action {\n width: 24px;\n height: 24px;\n padding: 4px; /* use padding instead of gap on parent, for better accessibility */\n opacity: 0.6;\n border-radius: var(--border-radius);\n transition: all 0.15s;\n\n svg {\n width: 16px;\n height: 16px;\n }\n\n &:hover {\n opacity: 1;\n background-color: var(--bg-elevated-02);\n }\n\n &.activated {\n opacity: 0.8;\n }\n\n &.disable {\n cursor: not-allowed;\n opacity: 0.4;\n }\n}\n\n.clickable {\n cursor: pointer;\n}\n\n.draggable {\n cursor: grab;\n}\n\n.showOnHover {\n opacity: 0;\n transition: opacity 0.15s;\n}\n\n.root:hover .showOnHover {\n opacity: 1;\n}\n</style>\n"],"names":["props","__props","slots","_useSlots","hasContentSlot","computed","emit","__emit"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAKA,UAAMA,IAAQC,GAeRC,IAAQC,EAGV,GACEC,IAAiBC,EAAS,MAAMH,EAAM,YAAe,MAAS,GAE9DI,IAAOC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode('@use "../../assets/variables.scss" as *;.
|
|
2
|
-
const
|
|
3
|
-
root:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
contentChevron:
|
|
10
|
-
title:
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode('@use "../../assets/variables.scss" as *;._root_102m7_4{--background: rgba(255, 255, 255, .8);--border-color: var(--color-div-grey);--head-background: unset;--box-shadow: none;--box-shadow-active: 0 0 0 4px color-mix(in srgb, var(--border-color-focus) 50%, transparent)}._root_102m7_4.sortable-drag,._root_102m7_4.sortable-chosen{--head-background: var(--gradient-light-lime);--border-color: var(--border-color-focus);--box-shadow: var(--box-shadow-active) }._root_102m7_4{display:flex;flex-direction:column;justify-content:center;border-radius:var(--border-radius);border:1px solid var(--border-color);background-color:var(--background);transition:box-shadow .15s;box-shadow:var(--box-shadow);overflow:hidden}._root_102m7_4:hover{--border-color: var(--border-color-focus);--head-background: var(--gradient-light-lime)}._root_102m7_4._opened_102m7_34{--head-background: var(--gradient-light-lime)}._root_102m7_4._disabled_102m7_38{--icon-color: var(--ic-02);--border-color: var(--border-color-div-grey);color:var(--txt-03);filter:grayscale(1)}._root_102m7_4._pinned_102m7_45{--background: var(--bg-base-light)}._root_102m7_4._active_102m7_49{--border-color: var(--border-color-focus);--head-background: var(--btn-accent-positive-500)}._head_102m7_55{position:relative;display:flex;align-items:center;padding:8px;min-height:40px;border-radius:var(--border-radius) var(--border-radius) 0 0;background:var(--head-background)}._contentChevron_102m7_65{display:block;width:16px;height:16px;margin-right:4px;transform:rotate(-90deg);transition:transform .15s}._contentChevron_102m7_65._opened_102m7_34{transform:rotate(0)}._title_102m7_78{display:flex;flex-direction:row;flex:1 1 0;gap:8px;text-overflow:ellipsis}._body_102m7_86{display:flex;flex-direction:column;gap:12px;padding:24px;border-radius:0 0 var(--border-radius) var(--border-radius)}._body_102m7_86._disabled_102m7_38{pointer-events:none}._actions_102m7_98{position:absolute;top:8px;right:8px;display:flex;align-items:center;background-color:var(--background);border-radius:var(--border-radius)}._action_102m7_98{width:24px;height:24px;padding:4px;opacity:.6;border-radius:var(--border-radius);transition:all .15s}._action_102m7_98 svg{width:16px;height:16px}._action_102m7_98:hover{opacity:1;background-color:var(--bg-elevated-02)}._action_102m7_98._activated_102m7_126{opacity:.8}._action_102m7_98._disable_102m7_38{cursor:not-allowed;opacity:.4}._clickable_102m7_136{cursor:pointer}._draggable_102m7_140{cursor:grab}._showOnHover_102m7_144{opacity:0;transition:opacity .15s}._root_102m7_4:hover ._showOnHover_102m7_144{opacity:1}')),document.head.appendChild(r)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
|
|
2
|
+
const t = "_root_102m7_4", o = "_opened_102m7_34", _ = "_disabled_102m7_38", e = "_pinned_102m7_45", n = "_active_102m7_49", c = "_head_102m7_55", a = "_contentChevron_102m7_65", s = "_title_102m7_78", d = "_body_102m7_86", i = "_actions_102m7_98", l = "_action_102m7_98", m = "_activated_102m7_126", b = "_disable_102m7_38", r = "_clickable_102m7_136", v = "_draggable_102m7_140", h = "_showOnHover_102m7_144", p = {
|
|
3
|
+
root: t,
|
|
4
|
+
opened: o,
|
|
5
|
+
disabled: _,
|
|
6
|
+
pinned: e,
|
|
7
|
+
active: n,
|
|
8
|
+
head: c,
|
|
9
|
+
contentChevron: a,
|
|
10
|
+
title: s,
|
|
11
11
|
body: d,
|
|
12
12
|
actions: i,
|
|
13
13
|
action: l,
|
|
14
|
-
activated:
|
|
15
|
-
disable:
|
|
16
|
-
clickable:
|
|
17
|
-
draggable:
|
|
18
|
-
showOnHover:
|
|
14
|
+
activated: m,
|
|
15
|
+
disable: b,
|
|
16
|
+
clickable: r,
|
|
17
|
+
draggable: v,
|
|
18
|
+
showOnHover: h
|
|
19
19
|
};
|
|
20
20
|
export {
|
|
21
21
|
l as action,
|
|
22
22
|
i as actions,
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
m as activated,
|
|
24
|
+
n as active,
|
|
25
25
|
d as body,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
26
|
+
r as clickable,
|
|
27
|
+
a as contentChevron,
|
|
28
|
+
p as default,
|
|
29
|
+
b as disable,
|
|
30
|
+
_ as disabled,
|
|
31
|
+
v as draggable,
|
|
32
|
+
c as head,
|
|
33
|
+
o as opened,
|
|
34
|
+
e as pinned,
|
|
35
|
+
t as root,
|
|
36
|
+
h as showOnHover,
|
|
37
|
+
s as title
|
|
38
38
|
};
|
|
39
39
|
//# sourceMappingURL=PlElementListItem.vue3.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/PlElementList/utils.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,GAAI,CAAC,SAAS,CAAC,EAAE,QAAQ,MAAM,MAAM,MAAM,KAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/PlElementList/utils.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,GAAI,CAAC,SAAS,CAAC,EAAE,QAAQ,MAAM,MAAM,MAAM,KAAG,CAAC,EASvE,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
const t = (e, l, n) => {
|
|
2
2
|
if (n >= 0 && n < e.length) {
|
|
3
|
-
const
|
|
4
|
-
e.splice(n, 0,
|
|
5
|
-
}
|
|
3
|
+
const o = e.splice(l, 1)[0];
|
|
4
|
+
e.splice(n, 0, o);
|
|
5
|
+
} else
|
|
6
|
+
console.warn(`Invalid move operation: from ${l} to ${n} in array of length ${e.length}`);
|
|
6
7
|
return e;
|
|
7
8
|
};
|
|
8
9
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../../src/components/PlElementList/utils.ts"],"sourcesContent":["export const moveElements = <T>(array: T[], from: number, to: number): T[] => {\n if (to >= 0 && to < array.length) {\n const element = array.splice(from, 1)[0];\n array.splice(to, 0, element);\n }\n\n return array;\n};\n"],"names":["moveElements","array","from","to","element"],"mappings":"AAAO,MAAMA,IAAe,CAAIC,GAAYC,GAAcC,MAAoB;AAC5E,MAAIA,KAAM,KAAKA,IAAKF,EAAM,QAAQ;AAChC,UAAMG,IAAUH,EAAM,OAAOC,GAAM,CAAC,EAAE,CAAC;AACjC,IAAAD,EAAA,OAAOE,GAAI,GAAGC,CAAO;AAAA,EAAA;
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../../src/components/PlElementList/utils.ts"],"sourcesContent":["export const moveElements = <T>(array: T[], from: number, to: number): T[] => {\n if (to >= 0 && to < array.length) {\n const element = array.splice(from, 1)[0];\n array.splice(to, 0, element);\n } else {\n console.warn(`Invalid move operation: from ${from} to ${to} in array of length ${array.length}`);\n }\n\n return array;\n};\n"],"names":["moveElements","array","from","to","element"],"mappings":"AAAO,MAAMA,IAAe,CAAIC,GAAYC,GAAcC,MAAoB;AAC5E,MAAIA,KAAM,KAAKA,IAAKF,EAAM,QAAQ;AAChC,UAAMG,IAAUH,EAAM,OAAOC,GAAM,CAAC,EAAE,CAAC;AACjC,IAAAD,EAAA,OAAOE,GAAI,GAAGC,CAAO;AAAA,EAAA;AAEnB,YAAA,KAAK,gCAAgCF,CAAI,OAAOC,CAAE,uBAAuBF,EAAM,MAAM,EAAE;AAG1F,SAAAA;AACT;"}
|
|
@@ -8,7 +8,7 @@ import "../../sdk/model/dist/index.js";
|
|
|
8
8
|
import Q from "../../utils/DoubleContour.vue.js";
|
|
9
9
|
import { useLabelNotch as W } from "../../utils/useLabelNotch.js";
|
|
10
10
|
import { prettyBytes as y } from "../../lib/util/helpers/dist/index.js";
|
|
11
|
-
import X from "../../generated/components/svg/images/SvgRequired.
|
|
11
|
+
import X from "../../generated/components/svg/images/SvgRequired.vue2.js";
|
|
12
12
|
import { getErrorMessage as Y } from "../../helpers/error.js";
|
|
13
13
|
import { getFileNameFromHandle as Z, getFilePathFromHandle as x } from "../../lib/model/common/dist/index.js";
|
|
14
14
|
const ee = {
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
declare function __VLS_template(): {
|
|
2
|
+
attrs: Partial<{}>;
|
|
3
|
+
slots: Readonly<{
|
|
4
|
+
[x: `item-${number}`]: () => unknown;
|
|
5
|
+
}> & {
|
|
6
|
+
[x: `item-${number}`]: () => unknown;
|
|
7
|
+
};
|
|
8
|
+
refs: {};
|
|
9
|
+
rootEl: HTMLDivElement;
|
|
10
|
+
};
|
|
11
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
12
|
+
declare const __VLS_component: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
13
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
14
|
+
export default _default;
|
|
15
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
16
|
+
new (): {
|
|
17
|
+
$slots: S;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=PlSidebarGroup.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlSidebarGroup.vue.d.ts","sourceRoot":"","sources":["../../../src/components/PlSidebar/PlSidebarGroup.vue"],"names":[],"mappings":"AA2CA,iBAAS,cAAc;WA8BT,OAAO,IAA6B;;qCAnCjB,OAAO;;qCAAP,OAAO;;;;EAwCvC;AAOD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe,0RAMnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAOpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import o from "./PlSidebarGroup.vue2.js";
|
|
2
|
+
import s from "./PlSidebarGroup.vue3.js";
|
|
3
|
+
import r from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const t = {
|
|
5
|
+
$style: s
|
|
6
|
+
}, f = /* @__PURE__ */ r(o, [["__cssModules", t]]);
|
|
7
|
+
export {
|
|
8
|
+
f as default
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=PlSidebarGroup.vue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlSidebarGroup.vue.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { defineComponent as n, useSlots as a, createElementBlock as s, openBlock as t, normalizeClass as o, Fragment as c, renderList as i, renderSlot as u } from "vue";
|
|
2
|
+
const _ = /* @__PURE__ */ n({
|
|
3
|
+
__name: "PlSidebarGroup",
|
|
4
|
+
setup(m) {
|
|
5
|
+
const l = a();
|
|
6
|
+
return (e, p) => (t(), s("div", {
|
|
7
|
+
class: o(e.$style.root)
|
|
8
|
+
}, [
|
|
9
|
+
(t(!0), s(c, null, i(Object.keys(l), (r) => (t(), s("div", {
|
|
10
|
+
key: r,
|
|
11
|
+
class: o(e.$style.item)
|
|
12
|
+
}, [
|
|
13
|
+
u(e.$slots, r)
|
|
14
|
+
], 2))), 128))
|
|
15
|
+
], 2));
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
export {
|
|
19
|
+
_ as default
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=PlSidebarGroup.vue2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlSidebarGroup.vue2.js","sources":["../../../src/components/PlSidebar/PlSidebarGroup.vue"],"sourcesContent":["<script setup lang=\"ts\">\nconst slots = defineSlots<{\n [K in `item-${number}`]: () => unknown;\n}>();\n</script>\n\n<template>\n <div :class=\"$style.root\">\n <template v-for=\"name in Object.keys(slots) as `item-${number}`[]\" :key=\"name\" >\n <div :class=\"$style.item\">\n <slot :name=\"name\" />\n </div>\n </template>\n </div>\n</template>\n\n<style lang=\"scss\" module>\n@use '../../assets/variables.scss';\n\n.root {\n position: relative;\n display: flex;\n flex-direction: row;\n}\n\n.item {\n width: 1000%;\n height: 100%;\n border-right: 1px solid var(--border-color-div-grey);\n\n &:last-child {\n border-right: none;\n }\n}\n</style>\n"],"names":["slots","_useSlots"],"mappings":";;;;AACA,UAAMA,IAAQC,EAEV;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(":root{--txt-00: #ffffff;--txt-01: light-dark(#110529, #ffffff);--txt-02: #231842;--txt-03: #9d9eae;--txt-mask: #cfd1db;--txt-focus: #07ad3e;--txt-error: #f1222f;--txt-link: #5f31cc;--ic-00: #ffffff;--ic-01: #110529;--ic-02: #cfd1db;--ic-accent: #07ad3e;--border-color-default: #110529;--border-color-hover: #231842;--border-color-focus: #49cc49;--border-color-error: #ff5c5c;--border-color-div-grey: #e1e3eb;--border-color-div-bw: #ffffff;--btn-accent-default: #845cff;--btn-accent-hover: #9470ff;--btn-accent-press: #6f4dd6;--btn-primary-default: #110529;--btn-primary-hover: #231842;--btn-primary-press: #080214;--btn-sec-hover-white: rgba(255, 255, 255, .5);--btn-sec-hover-grey: light-dark(rgba(155, 171, 204, .16), rgba(131, 131, 163, .16));--btn-sec-press-grey: rgba(155, 171, 204, .24);--btn-active-select: rgba(99, 224, 36, .24);--btn-switcher: linear-gradient(180deg, #a1e59c 0%, #d0f5b0 100%);--btn-accent-positive-500: #ECFBE5;--dis-00: #ffffff;--dis-01: light-dark(#cfd1db, #3d3d42);--bg-base-dark: #110529;--bg-base-light: #f7f8fa;--bg-elevated-01: #ffffff;--bg-elevated-02: #e1e3eb;--bg-error: #FFF5F5;--filled-V-BG: #d0f0c0;--filled-D-BG: #ffcecc;--filled-N-BG: #faf5aa;--filled-J-BG: #dedbff;--notification-neutral: linear-gradient(90deg, #d6d9ff 0%, #fff 100%);--notification-success: linear-gradient(90deg, #c9f0b6 0%, #fff 100%);--notification-warning: linear-gradient(90deg, #fee0a3 0%, #fff 100%);--notification-error: linear-gradient(90deg, #ffb8b8 0%, #fff 100%);--gradient-blue-green: linear-gradient(0deg, #478063 0%, #2e4652 45.93%, #24223d 91.63%);--gradient-green-lime: linear-gradient(180deg, #a1e59c 0%, #d0f5b0 100%);--gradient-blue-violet: linear-gradient(180deg, #adb8ff 0%, #d6e9ff 100%);--gradient-blue-clear: linear-gradient(180deg, #85beff 0%, #cef 100%);--gradient-orange: linear-gradient(180deg, #ffb766 0%, #ffeaa3 100%);--gradient-mint: linear-gradient(180deg, #7dd1d1 0%, #c8fae9 100%);--gradient-lime: linear-gradient(180deg, #bfe062 0%, #e4ffad 100%);--gradient-rose: linear-gradient(0deg, #ffddd6 0%, #ff99c9 100%);--gradient-red: linear-gradient(0deg, #ffd5cc 0%, #ff9494 100%);--gradient-violet: linear-gradient(180deg, #bca3ff 0%, #e5e5ff 100%);--TT-gradient-violet: linear-gradient(180deg, #bca3ff 0%, #e5e5ff 100%);--gradient-light-lime: linear-gradient(180deg, #EBFFEB 0%, transparent 100%);--shadow-l: 0px 8px 16px -4px rgba(15, 36, 77, .16), 0px 12px 32px -4px rgba(15, 36, 77, .16);--main-spacing: 24px;--gap-v: 24px;--gap-h: 12px;--border-radius: 6px;--z-splash: 50;--z-slide-shadow: 80;--z-slide-dialog: 81;--z-dialog: 100;--z-dropdown-options: 110;--z-tooltip: 120;--z-context-menu: 1001;--scrollbar-width: 6px}[data-theme=dark]{--txt-00: #ffffff;--txt-01: #FFFFFF;--txt-02: #adaeb8;--txt-03: #60616b;--txt-mask: #3D3D42;--txt-focus: #87e087;--txt-error: #ff5c5c;--txt-link: #9470ff;--ic-00: #ffffff;--ic-01: #FFFFFF;--ic-02: #60616b;--ic-accent: #87e087;--border-color-default: #60616b;--border-color-hover: #adaeb8;--border-color-focus: #49cc49;--border-color-error: #ff5c5c;--border-color-div-grey: #232329;--border-color-div-bw: #000000;--btn-accent-default: #5f31cc;--btn-accent-hover: #5f31cc;--btn-accent-press: #5f31cc;--btn-primary-default: #5f31cc;--btn-primary-hover: #6d3ddb;--btn-primary-press: #5328b8;--btn-sec-hover-white: rgba(131, 131, 163, .16);--btn-sec-hover-grey: rgba(131, 131, 163, .16);--btn-sec-press-grey: rgba(131, 131, 163, .24);--btn-active-select: rgba(99, 224, 36, .24);--btn-switcher: #5e5e70;--dis-00: #65656b;--dis-01: #3D3D42;--bg-base-dark: #0d0d0f;--bg-base-light: #0d0d0f;--bg-elevated-01: #1b1b1f;--bg-elevated-02: #2d2d33;--bg-error: #FFF5F5;--filled-V-BG: rgba(66, 184, 66, .4);--filled-D-BG: rgba(229, 83, 229, .4);--filled-N-BG: rgba(83, 82, 102, .4);--filled-J-BG: rgba(132, 92, 255, .4);--notification-neutral: linear-gradient(90deg, #4d4d8f 0%, #292933 100%);--notification-success: linear-gradient(90deg, #305c3e 0%, #292933 100%);--notification-warning: linear-gradient(90deg, #754f2d 0%, #292933 100%);--notification-error: linear-gradient(90deg, #8f3343 0%, #292933 100%);--gradient-blue-green: linear-gradient(0deg, #478063 0%, #2e4652 45.93%, #24223d 91.63%);--gradient-green-lime: linear-gradient(0deg, #478063 0%, #2e4652 45.93%, #24223d 91.63%);--gradient-blue-violet: linear-gradient(0deg, #478063 0%, #2e4652 45.93%, #24223d 91.63%);--gradient-blue-clear: linear-gradient(0deg, #478063 0%, #2e4652 45.93%, #24223d 91.63%);--gradient-orange: linear-gradient(0deg, #478063 0%, #2e4652 45.93%, #24223d 91.63%);--gradient-mint: linear-gradient(0deg, #478063 0%, #2e4652 45.93%, #24223d 91.63%);--gradient-lime: linear-gradient(0deg, #478063 0%, #2e4652 45.93%, #24223d 91.63%);--gradient-rose: linear-gradient(0deg, #478063 0%, #2e4652 45.93%, #24223d 91.63%);--gradient-red: linear-gradient(0deg, #478063 0%, #2e4652 45.93%, #24223d 91.63%);--gradient-violet: linear-gradient(0deg, #478063 0%, #2e4652 45.93%, #24223d 91.63%)}._root_adhhl_131{position:relative;display:flex;flex-direction:row}._item_adhhl_137{width:1000%;height:100%;border-right:1px solid var(--border-color-div-grey)}._item_adhhl_137:last-child{border-right:none}")),document.head.appendChild(e)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
|
|
2
|
+
const t = "_root_adhhl_131", o = "_item_adhhl_137", e = {
|
|
3
|
+
root: t,
|
|
4
|
+
item: o
|
|
5
|
+
};
|
|
6
|
+
export {
|
|
7
|
+
e as default,
|
|
8
|
+
o as item,
|
|
9
|
+
t as root
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=PlSidebarGroup.vue3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlSidebarGroup.vue3.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
declare function __VLS_template(): {
|
|
2
|
+
attrs: Partial<{}>;
|
|
3
|
+
slots: Readonly<{
|
|
4
|
+
header?: () => unknown;
|
|
5
|
+
'header-content'?: () => unknown;
|
|
6
|
+
body?: () => unknown;
|
|
7
|
+
'body-content'?: () => unknown;
|
|
8
|
+
footer?: () => unknown;
|
|
9
|
+
'footer-content'?: () => unknown;
|
|
10
|
+
}> & {
|
|
11
|
+
header?: () => unknown;
|
|
12
|
+
'header-content'?: () => unknown;
|
|
13
|
+
body?: () => unknown;
|
|
14
|
+
'body-content'?: () => unknown;
|
|
15
|
+
footer?: () => unknown;
|
|
16
|
+
'footer-content'?: () => unknown;
|
|
17
|
+
};
|
|
18
|
+
refs: {};
|
|
19
|
+
rootEl: HTMLDivElement;
|
|
20
|
+
};
|
|
21
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
22
|
+
declare const __VLS_component: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
23
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
24
|
+
export default _default;
|
|
25
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
26
|
+
new (): {
|
|
27
|
+
$slots: S;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=PlSidebarItem.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlSidebarItem.vue.d.ts","sourceRoot":"","sources":["../../../src/components/PlSidebar/PlSidebarItem.vue"],"names":[],"mappings":"AAwEA,iBAAS,cAAc;WAkDT,OAAO,IAA6B;;iBA5DrC,MAAM,OAAO;2BACL,MAAM,OAAO;eACvB,MAAM,OAAO;yBACL,MAAM,OAAO;iBACnB,MAAM,OAAO;2BACL,MAAM,OAAO;;iBALrB,MAAM,OAAO;2BACL,MAAM,OAAO;eACvB,MAAM,OAAO;yBACL,MAAM,OAAO;iBACnB,MAAM,OAAO;2BACL,MAAM,OAAO;;;;EA4DjC;AAOD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe,0RAMnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAUpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import s from "./PlSidebarItem.vue2.js";
|
|
2
|
+
import o from "./PlSidebarItem.vue3.js";
|
|
3
|
+
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const e = {
|
|
5
|
+
$style: o
|
|
6
|
+
}, f = /* @__PURE__ */ t(s, [["__cssModules", e]]);
|
|
7
|
+
export {
|
|
8
|
+
f as default
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=PlSidebarItem.vue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlSidebarItem.vue.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
|