admins-components 9.0.52 → 9.0.54
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/dist/admins-components65.js +44 -36
- package/dist/admins-components65.js.map +1 -1
- package/dist/admins-components67.js.map +1 -1
- package/dist/admins-components68.js +69 -60
- package/dist/admins-components68.js.map +1 -1
- package/dist/admins-components70.js.map +1 -1
- package/dist/admins-components80.js +41 -47
- package/dist/admins-components80.js.map +1 -1
- package/dist/admins-components82.js.map +1 -1
- package/dist/src/components/data-table/DataSort.vue.d.ts +0 -1
- package/dist/src/styles/components/data-table/data-cards.scss_vue_type_style_index_0_src_true_lang.css +1 -1
- package/dist/src/styles/components/data-table/data-table.scss_vue_type_style_index_0_src_true_lang.css +1 -1
- package/package.json +1 -1
|
@@ -4,9 +4,9 @@ import { useSelection as n } from "./admins-components57.js";
|
|
|
4
4
|
import { dataTableSettingsDefaults as r } from "./admins-components58.js";
|
|
5
5
|
import i from "./admins-components62.js";
|
|
6
6
|
import a from "./admins-components64.js";
|
|
7
|
-
import { Fragment as o, computed as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createTextVNode as d, createVNode as f, defineComponent as p,
|
|
7
|
+
import { Fragment as o, computed as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createTextVNode as d, createVNode as f, defineComponent as p, nextTick as m, normalizeClass as h, normalizeStyle as g, onMounted as _, openBlock as v, ref as y, renderList as b, toDisplayString as x, unref as S, watch as C, withModifiers as w } from "vue";
|
|
8
8
|
//#region src/components/data-table/DataTable.vue?vue&type=script&setup=true&lang.ts
|
|
9
|
-
var
|
|
9
|
+
var T = { class: "ac-component" }, E = { key: 0 }, D = ["title", "onClick"], O = {
|
|
10
10
|
key: 1,
|
|
11
11
|
class: "c-actions-header"
|
|
12
12
|
}, k = { key: 0 }, A = ["onClick"], j = {
|
|
@@ -30,8 +30,15 @@ var w = { class: "ac-component" }, T = { class: "c-table-wrapper list-table-view
|
|
|
30
30
|
},
|
|
31
31
|
emits: ["selection-change", "sort-change"],
|
|
32
32
|
setup(r, { emit: p }) {
|
|
33
|
-
let R = r, z = p, B =
|
|
34
|
-
|
|
33
|
+
let R = r, z = p, B = y(null), V = y(null);
|
|
34
|
+
C(() => R.loading, async (e) => {
|
|
35
|
+
e && (await m(), V.value?.scrollTo({
|
|
36
|
+
top: 0,
|
|
37
|
+
behavior: "smooth"
|
|
38
|
+
}));
|
|
39
|
+
});
|
|
40
|
+
let { selectedKeys: H, allSelected: U, toggle: W, toggleAll: G } = n(() => R.items, () => R.config.selectableAttr, (e) => z("selection-change", e)), K = s(() => R.config.columns.filter((e) => e.visible !== !1));
|
|
41
|
+
function q(e) {
|
|
35
42
|
let t = e.property, n = B.value?.key === t && B.value.direction === "asc" ? "desc" : "asc";
|
|
36
43
|
B.value = {
|
|
37
44
|
key: t,
|
|
@@ -41,7 +48,7 @@ var w = { class: "ac-component" }, T = { class: "c-table-wrapper list-table-view
|
|
|
41
48
|
direction: n
|
|
42
49
|
});
|
|
43
50
|
}
|
|
44
|
-
function
|
|
51
|
+
function J(e) {
|
|
45
52
|
if (!e) {
|
|
46
53
|
B.value !== null && (B.value = null);
|
|
47
54
|
return;
|
|
@@ -55,7 +62,7 @@ var w = { class: "ac-component" }, T = { class: "c-table-wrapper list-table-view
|
|
|
55
62
|
direction: e.direction
|
|
56
63
|
})));
|
|
57
64
|
}
|
|
58
|
-
return
|
|
65
|
+
return _(() => J(R.initialSort)), C(() => R.initialSort, (e) => {
|
|
59
66
|
if (!e) {
|
|
60
67
|
B.value !== null && (B.value = null);
|
|
61
68
|
return;
|
|
@@ -64,29 +71,30 @@ var w = { class: "ac-component" }, T = { class: "c-table-wrapper list-table-view
|
|
|
64
71
|
key: e.key,
|
|
65
72
|
direction: e.direction
|
|
66
73
|
}));
|
|
67
|
-
}), (n, s) => (
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
74
|
+
}), (n, s) => (v(), l("div", T, [u("div", {
|
|
75
|
+
ref_key: "tableWrapperRef",
|
|
76
|
+
ref: V,
|
|
77
|
+
class: h(["c-table-wrapper list-table-view", { "is-loading": r.loading }])
|
|
78
|
+
}, [u("table", {
|
|
79
|
+
class: h(["c-table", { "is-compact": r.settings.compact }]),
|
|
80
|
+
style: g({ "--action-count": r.config.actions?.length ?? 0 })
|
|
73
81
|
}, [u("thead", null, [u("tr", null, [
|
|
74
|
-
r.config.selectableAttr ? (
|
|
75
|
-
"model-value":
|
|
76
|
-
"onUpdate:modelValue":
|
|
82
|
+
r.config.selectableAttr ? (v(), l("th", E, [f(e, {
|
|
83
|
+
"model-value": S(U),
|
|
84
|
+
"onUpdate:modelValue": S(G)
|
|
77
85
|
}, null, 8, ["model-value", "onUpdate:modelValue"])])) : c("", !0),
|
|
78
|
-
(
|
|
86
|
+
(v(!0), l(o, null, b(K.value, (e) => (v(), l("th", {
|
|
79
87
|
key: e.property,
|
|
80
|
-
class:
|
|
88
|
+
class: h([{
|
|
81
89
|
"c-sortable": e.sort,
|
|
82
90
|
"c-sortable--sorted": B.value?.key === e.property,
|
|
83
91
|
"primary-col": e.primary
|
|
84
92
|
}, e.headerClass]),
|
|
85
93
|
title: e.sort ? `Sorrendezés ${e.label} alapján` : void 0,
|
|
86
|
-
onClick: (t) => e.sort ?
|
|
87
|
-
}, [d(
|
|
94
|
+
onClick: (t) => e.sort ? q(e) : void 0
|
|
95
|
+
}, [d(x(e.hideHeader ? "" : e.label) + " ", 1), e.sort ? (v(), l("span", {
|
|
88
96
|
key: 0,
|
|
89
|
-
class:
|
|
97
|
+
class: h(["c-sort-icon fa-solid", {
|
|
90
98
|
"fa-sort": B.value?.key !== e.property,
|
|
91
99
|
"fa-sort-down": B.value?.key === e.property && B.value.direction === "desc",
|
|
92
100
|
"fa-sort-up": B.value?.key === e.property && B.value.direction === "asc",
|
|
@@ -95,26 +103,26 @@ var w = { class: "ac-component" }, T = { class: "c-table-wrapper list-table-view
|
|
|
95
103
|
"is-desc": B.value?.key === e.property && B.value.direction === "desc"
|
|
96
104
|
}])
|
|
97
105
|
}, null, 2)) : c("", !0)], 10, D))), 128)),
|
|
98
|
-
r.config.actions ? (
|
|
99
|
-
])]), !r.loading || r.items.length > 0 ? (
|
|
106
|
+
r.config.actions ? (v(), l("th", O, x(r.config.actionHeader ?? ""), 1)) : c("", !0)
|
|
107
|
+
])]), !r.loading || r.items.length > 0 ? (v(), l("tbody", k, [(v(!0), l(o, null, b(r.items, (t, n) => (v(), l("tr", {
|
|
100
108
|
key: n,
|
|
101
|
-
class:
|
|
102
|
-
"is-selected": r.config.selectableAttr &&
|
|
109
|
+
class: h({
|
|
110
|
+
"is-selected": r.config.selectableAttr && S(H).has(t[r.config.selectableAttr]),
|
|
103
111
|
"is-striped": r.settings.striped && n % 2 == 1
|
|
104
112
|
})
|
|
105
113
|
}, [
|
|
106
|
-
r.config.selectableAttr ? (
|
|
114
|
+
r.config.selectableAttr ? (v(), l("td", {
|
|
107
115
|
key: 0,
|
|
108
116
|
class: "pointer",
|
|
109
|
-
onClick:
|
|
117
|
+
onClick: w((e) => S(W)(t), ["stop"])
|
|
110
118
|
}, [f(e, {
|
|
111
|
-
"model-value": !!
|
|
112
|
-
"onUpdate:modelValue": (e) =>
|
|
113
|
-
onClick: s[0] ||=
|
|
119
|
+
"model-value": !!S(H).has(t[r.config.selectableAttr]),
|
|
120
|
+
"onUpdate:modelValue": (e) => S(W)(t),
|
|
121
|
+
onClick: s[0] ||= w(() => {}, ["stop"])
|
|
114
122
|
}, null, 8, ["model-value", "onUpdate:modelValue"])], 8, A)) : c("", !0),
|
|
115
|
-
(
|
|
123
|
+
(v(!0), l(o, null, b(K.value, (e) => (v(), l("td", {
|
|
116
124
|
key: e.property,
|
|
117
|
-
class:
|
|
125
|
+
class: h(["c-table__cell", [e.class, { "primary-col": e.primary }]])
|
|
118
126
|
}, [f(i, {
|
|
119
127
|
item: t,
|
|
120
128
|
col: e,
|
|
@@ -124,20 +132,20 @@ var w = { class: "ac-component" }, T = { class: "c-table-wrapper list-table-view
|
|
|
124
132
|
"col",
|
|
125
133
|
"copy"
|
|
126
134
|
])], 2))), 128)),
|
|
127
|
-
r.config.actions ? (
|
|
135
|
+
r.config.actions ? (v(), l("td", j, [u("div", M, [f(a, {
|
|
128
136
|
actions: r.config.actions,
|
|
129
137
|
item: t
|
|
130
138
|
}, null, 8, ["actions", "item"])])])) : c("", !0)
|
|
131
|
-
], 2))), 128))])) : (
|
|
132
|
-
colspan:
|
|
139
|
+
], 2))), 128))])) : (v(), l("tbody", N, [u("tr", P, [u("td", {
|
|
140
|
+
colspan: K.value.length + +!!r.config.selectableAttr + +!!r.config.actions,
|
|
133
141
|
class: "c-table__loading-cell"
|
|
134
142
|
}, [u("div", I, [f(t, {
|
|
135
143
|
loading: !0,
|
|
136
144
|
size: "2.5rem"
|
|
137
|
-
})])], 8, F)])]))], 6), r.loading && r.items.length > 0 ? (
|
|
145
|
+
})])], 8, F)])]))], 6), r.loading && r.items.length > 0 ? (v(), l("div", L, [f(t, {
|
|
138
146
|
loading: !0,
|
|
139
147
|
size: "2.5rem"
|
|
140
|
-
})])) : c("", !0)])]));
|
|
148
|
+
})])) : c("", !0)], 2)]));
|
|
141
149
|
}
|
|
142
150
|
});
|
|
143
151
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admins-components65.js","names":[],"sources":["../src/components/data-table/DataTable.vue"],"sourcesContent":["<script lang=\"ts\">\nexport type {\n LayoutMode,\n DataListConfig,\n DataListSettings,\n DataTableSettings,\n DataCardsSettings,\n Column,\n Sort,\n Action,\n ActionGroup,\n FilterConfig,\n FilterValue,\n} from '@/types/data-list'\n\nexport {\n dataTableSettingsDefaults,\n dataCardsSettingsDefaults,\n dataListSettingsDefaults,\n} from '@/types/data-list'\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, ref, onMounted, watch } from 'vue'\nimport Checkbox from '@/components/Checkbox.vue'\nimport { useSelection } from '@/composables/useSelection'\nimport { dataTableSettingsDefaults } from '@/types/data-list'\nimport type { Column, DataListConfig, DataTableSettings } from '@/types/data-list'\nimport Loader from '@/components/Loader.vue'\nimport DataCell from './DataCell.vue'\nimport DataListActions from './DataListActions.vue'\n\ntype SortDirection = 'asc' | 'desc'\n\nconst props = withDefaults(\n defineProps<{\n config: DataListConfig\n items: Record<string, unknown>[]\n settings?: DataTableSettings\n loading?: boolean\n initialSort?: { key: string; direction: SortDirection } | null\n }>(),\n {\n settings: () => ({ ...dataTableSettingsDefaults }),\n loading: false,\n initialSort: null,\n },\n)\n\nconst emit = defineEmits<{\n 'selection-change': [selected: unknown[]]\n 'sort-change': [sort: { key: string; direction: SortDirection }]\n}>()\n\n//const CHARACTER_BREAKPOINT = 20\n\nconst activeSort = ref<{\n key: string\n direction: SortDirection\n} | null>(null)\n\nconst {\n selectedKeys,\n allSelected,\n toggle: toggleRow,\n toggleAll,\n} = useSelection(\n () => props.items,\n () => props.config.selectableAttr,\n (s) => emit('selection-change', s),\n)\n\nconst visibleColumns = computed(() => props.config.columns.filter((c) => c.visible !== false))\n\nfunction handleSort(col: Column) {\n const key = col.property\n const direction: SortDirection =\n activeSort.value?.key === key && activeSort.value.direction === 'asc' ? 'desc' : 'asc'\n\n activeSort.value = { key, direction }\n col.sort?.callback?.(key, direction)\n\n emit('sort-change', { key, direction })\n}\n\nfunction applyInitialSort(sort: { key: string; direction: SortDirection } | null | undefined) {\n if (!sort) {\n if (activeSort.value !== null) activeSort.value = null\n return\n }\n const col = props.config.columns.find((c) => c.property === sort.key)\n if (!col) return\n if (activeSort.value?.key === sort.key && activeSort.value.direction === sort.direction) return\n activeSort.value = { key: sort.key, direction: sort.direction }\n col.sort?.callback?.(sort.key, sort.direction)\n emit('sort-change', { key: sort.key, direction: sort.direction })\n}\n\nonMounted(() => applyInitialSort(props.initialSort))\nwatch(\n () => props.initialSort,\n (s) => {\n // When initialSort changes, sync the visual indicator only.\n // Don't re-emit sort-change — that would cause an infinite loop with\n // parents that re-assign the prop from the emitted value.\n if (!s) {\n if (activeSort.value !== null) activeSort.value = null\n return\n }\n const col = props.config.columns.find((c) => c.property === s.key)\n if (!col) return\n if (activeSort.value?.key === s.key && activeSort.value.direction === s.direction) return\n activeSort.value = { key: s.key, direction: s.direction }\n },\n)\n</script>\n\n<template>\n <div class=\"ac-component\">\n <div class=\"c-table-wrapper list-table-view\">\n <table\n class=\"c-table\"\n :class=\"{ 'is-compact': settings.compact, 'is-loading': loading }\"\n :style=\"{ '--action-count': config.actions?.length ?? 0 }\"\n >\n <thead>\n <tr>\n <th v-if=\"config.selectableAttr\">\n <Checkbox :model-value=\"allSelected\" @update:model-value=\"toggleAll\" />\n </th>\n\n <th\n v-for=\"col in visibleColumns\"\n :key=\"col.property\"\n :class=\"[\n {\n 'c-sortable': col.sort,\n 'c-sortable--sorted': activeSort?.key === col.property,\n 'primary-col': col.primary,\n },\n col.headerClass,\n ]\"\n :title=\"col.sort ? `Sorrendezés ${col.label} alapján` : undefined\"\n @click=\"col.sort ? handleSort(col) : undefined\"\n >\n {{ !col.hideHeader ? col.label : '' }}\n\n <span\n v-if=\"col.sort\"\n class=\"c-sort-icon fa-solid\"\n :class=\"{\n 'fa-sort': activeSort?.key !== col.property,\n 'fa-sort-down':\n activeSort?.key === col.property && activeSort.direction === 'desc',\n 'fa-sort-up': activeSort?.key === col.property && activeSort.direction === 'asc',\n 'c-sort-icon--active': activeSort?.key === col.property,\n 'is-asc': activeSort?.key === col.property && activeSort.direction === 'asc',\n 'is-desc': activeSort?.key === col.property && activeSort.direction === 'desc',\n }\"\n ></span>\n </th>\n\n <th v-if=\"config.actions\" class=\"c-actions-header\">\n {{ config.actionHeader ?? '' }}\n </th>\n </tr>\n </thead>\n\n <tbody v-if=\"!loading || items.length > 0\">\n <tr\n v-for=\"(item, index) in items\"\n :key=\"index\"\n :class=\"{\n 'is-selected': config.selectableAttr && selectedKeys.has(item[config.selectableAttr]),\n 'is-striped': settings.striped && index % 2 === 1,\n }\"\n >\n <td v-if=\"config.selectableAttr\" class=\"pointer\" @click.stop=\"toggleRow(item)\">\n <Checkbox\n :model-value=\"!!selectedKeys.has(item[config.selectableAttr])\"\n @update:model-value=\"toggleRow(item)\"\n @click.stop\n />\n </td>\n\n <td\n v-for=\"col in visibleColumns\"\n :key=\"col.property\"\n class=\"c-table__cell\"\n :class=\"[\n col.class,\n { 'primary-col': col.primary },\n /* { 'is-nowrap': String(getColumnValue(item, col) ?? '').length < CHARACTER_BREAKPOINT}, */\n ]\"\n >\n <DataCell :item=\"item\" :col=\"col\" :copy=\"!col.hideCopyToClipboard\" />\n </td>\n\n <td v-if=\"config.actions\" class=\"c-actions-cell\">\n <div class=\"c-actions-wrap\">\n <DataListActions :actions=\"config.actions\" :item=\"item\" />\n </div>\n </td>\n </tr>\n </tbody>\n <tbody v-else>\n <tr class=\"c-table__loading-row\">\n <td\n :colspan=\"\n visibleColumns.length + (config.selectableAttr ? 1 : 0) + (config.actions ? 1 : 0)\n \"\n class=\"c-table__loading-cell\"\n >\n <div class=\"c-table__loading-wrap\">\n <Loader :loading=\"true\" size=\"2.5rem\" />\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n <div v-if=\"loading && items.length > 0\" class=\"c-table__backdrop\" aria-hidden=\"true\">\n <Loader :loading=\"true\" size=\"2.5rem\" />\n </div>\n </div>\n </div>\n</template>\n\n<style lang=\"scss\" src=\"@/styles/components/data-table/data-table.scss\"></style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkCA,IAAM,IAAQ,GAeR,IAAO,GAOP,IAAa,EAGT,IAAI,GAER,EACJ,iBACA,gBACA,QAAQ,GACR,iBACE,QACI,EAAM,aACN,EAAM,OAAO,iBAClB,MAAM,EAAK,oBAAoB,CAAC,CACnC,GAEM,IAAiB,QAAe,EAAM,OAAO,QAAQ,QAAQ,MAAM,EAAE,YAAY,EAAK,CAAC;EAE7F,SAAS,EAAW,GAAa;GAC/B,IAAM,IAAM,EAAI,UACV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type {\n LayoutMode,\n DataListConfig,\n DataListSettings,\n DataTableSettings,\n DataCardsSettings,\n Column,\n Sort,\n Action,\n ActionGroup,\n FilterConfig,\n FilterValue,\n} from '@/types/data-list'\n\nexport {\n dataTableSettingsDefaults,\n dataCardsSettingsDefaults,\n dataListSettingsDefaults,\n} from '@/types/data-list'\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, ref, onMounted, watch, nextTick } from 'vue'\nimport Checkbox from '@/components/Checkbox.vue'\nimport { useSelection } from '@/composables/useSelection'\nimport { dataTableSettingsDefaults } from '@/types/data-list'\nimport type { Column, DataListConfig, DataTableSettings } from '@/types/data-list'\nimport Loader from '@/components/Loader.vue'\nimport DataCell from './DataCell.vue'\nimport DataListActions from './DataListActions.vue'\n\ntype SortDirection = 'asc' | 'desc'\n\nconst props = withDefaults(\n defineProps<{\n config: DataListConfig\n items: Record<string, unknown>[]\n settings?: DataTableSettings\n loading?: boolean\n initialSort?: { key: string; direction: SortDirection } | null\n }>(),\n {\n settings: () => ({ ...dataTableSettingsDefaults }),\n loading: false,\n initialSort: null,\n },\n)\n\nconst emit = defineEmits<{\n 'selection-change': [selected: unknown[]]\n 'sort-change': [sort: { key: string; direction: SortDirection }]\n}>()\n\n//const CHARACTER_BREAKPOINT = 20\n\nconst activeSort = ref<{\n key: string\n direction: SortDirection\n} | null>(null)\n\nconst tableWrapperRef = ref<HTMLElement | null>(null)\n\nwatch(\n () => props.loading,\n async (isLoading) => {\n if (isLoading) {\n await nextTick()\n tableWrapperRef.value?.scrollTo({ top: 0, behavior: 'smooth' })\n }\n },\n)\n\nconst {\n selectedKeys,\n allSelected,\n toggle: toggleRow,\n toggleAll,\n} = useSelection(\n () => props.items,\n () => props.config.selectableAttr,\n (s) => emit('selection-change', s),\n)\n\nconst visibleColumns = computed(() => props.config.columns.filter((c) => c.visible !== false))\n\nfunction handleSort(col: Column) {\n const key = col.property\n const direction: SortDirection =\n activeSort.value?.key === key && activeSort.value.direction === 'asc' ? 'desc' : 'asc'\n\n activeSort.value = { key, direction }\n col.sort?.callback?.(key, direction)\n\n emit('sort-change', { key, direction })\n}\n\nfunction applyInitialSort(sort: { key: string; direction: SortDirection } | null | undefined) {\n if (!sort) {\n if (activeSort.value !== null) activeSort.value = null\n return\n }\n const col = props.config.columns.find((c) => c.property === sort.key)\n if (!col) return\n if (activeSort.value?.key === sort.key && activeSort.value.direction === sort.direction) return\n activeSort.value = { key: sort.key, direction: sort.direction }\n col.sort?.callback?.(sort.key, sort.direction)\n emit('sort-change', { key: sort.key, direction: sort.direction })\n}\n\nonMounted(() => applyInitialSort(props.initialSort))\nwatch(\n () => props.initialSort,\n (s) => {\n // When initialSort changes, sync the visual indicator only.\n // Don't re-emit sort-change — that would cause an infinite loop with\n // parents that re-assign the prop from the emitted value.\n if (!s) {\n if (activeSort.value !== null) activeSort.value = null\n return\n }\n const col = props.config.columns.find((c) => c.property === s.key)\n if (!col) return\n if (activeSort.value?.key === s.key && activeSort.value.direction === s.direction) return\n activeSort.value = { key: s.key, direction: s.direction }\n },\n)\n</script>\n\n<template>\n <div class=\"ac-component\">\n <div\n ref=\"tableWrapperRef\"\n class=\"c-table-wrapper list-table-view\"\n :class=\"{ 'is-loading': loading }\"\n >\n <table\n class=\"c-table\"\n :class=\"{ 'is-compact': settings.compact }\"\n :style=\"{ '--action-count': config.actions?.length ?? 0 }\"\n >\n <thead>\n <tr>\n <th v-if=\"config.selectableAttr\">\n <Checkbox :model-value=\"allSelected\" @update:model-value=\"toggleAll\" />\n </th>\n\n <th\n v-for=\"col in visibleColumns\"\n :key=\"col.property\"\n :class=\"[\n {\n 'c-sortable': col.sort,\n 'c-sortable--sorted': activeSort?.key === col.property,\n 'primary-col': col.primary,\n },\n col.headerClass,\n ]\"\n :title=\"col.sort ? `Sorrendezés ${col.label} alapján` : undefined\"\n @click=\"col.sort ? handleSort(col) : undefined\"\n >\n {{ !col.hideHeader ? col.label : '' }}\n\n <span\n v-if=\"col.sort\"\n class=\"c-sort-icon fa-solid\"\n :class=\"{\n 'fa-sort': activeSort?.key !== col.property,\n 'fa-sort-down':\n activeSort?.key === col.property && activeSort.direction === 'desc',\n 'fa-sort-up': activeSort?.key === col.property && activeSort.direction === 'asc',\n 'c-sort-icon--active': activeSort?.key === col.property,\n 'is-asc': activeSort?.key === col.property && activeSort.direction === 'asc',\n 'is-desc': activeSort?.key === col.property && activeSort.direction === 'desc',\n }\"\n ></span>\n </th>\n\n <th v-if=\"config.actions\" class=\"c-actions-header\">\n {{ config.actionHeader ?? '' }}\n </th>\n </tr>\n </thead>\n\n <tbody v-if=\"!loading || items.length > 0\">\n <tr\n v-for=\"(item, index) in items\"\n :key=\"index\"\n :class=\"{\n 'is-selected': config.selectableAttr && selectedKeys.has(item[config.selectableAttr]),\n 'is-striped': settings.striped && index % 2 === 1,\n }\"\n >\n <td v-if=\"config.selectableAttr\" class=\"pointer\" @click.stop=\"toggleRow(item)\">\n <Checkbox\n :model-value=\"!!selectedKeys.has(item[config.selectableAttr])\"\n @update:model-value=\"toggleRow(item)\"\n @click.stop\n />\n </td>\n\n <td\n v-for=\"col in visibleColumns\"\n :key=\"col.property\"\n class=\"c-table__cell\"\n :class=\"[\n col.class,\n { 'primary-col': col.primary },\n /* { 'is-nowrap': String(getColumnValue(item, col) ?? '').length < CHARACTER_BREAKPOINT}, */\n ]\"\n >\n <DataCell :item=\"item\" :col=\"col\" :copy=\"!col.hideCopyToClipboard\" />\n </td>\n\n <td v-if=\"config.actions\" class=\"c-actions-cell\">\n <div class=\"c-actions-wrap\">\n <DataListActions :actions=\"config.actions\" :item=\"item\" />\n </div>\n </td>\n </tr>\n </tbody>\n <tbody v-else>\n <tr class=\"c-table__loading-row\">\n <td\n :colspan=\"\n visibleColumns.length + (config.selectableAttr ? 1 : 0) + (config.actions ? 1 : 0)\n \"\n class=\"c-table__loading-cell\"\n >\n <div class=\"c-table__loading-wrap\">\n <Loader :loading=\"true\" size=\"2.5rem\" />\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n <div v-if=\"loading && items.length > 0\" class=\"c-table__backdrop\" aria-hidden=\"true\">\n <Loader :loading=\"true\" size=\"2.5rem\" />\n </div>\n </div>\n </div>\n</template>\n\n<style lang=\"scss\" src=\"@/styles/components/data-table/data-table.scss\"></style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkCA,IAAM,IAAQ,GAeR,IAAO,GAOP,IAAa,EAGT,IAAI,GAER,IAAkB,EAAwB,IAAI;EAEpD,QACQ,EAAM,SACZ,OAAO,MAAc;GACnB,AAAI,MACF,MAAM,EAAS,GACf,EAAgB,OAAO,SAAS;IAAE,KAAK;IAAG,UAAU;GAAS,CAAC;EAElE,CACF;EAEA,IAAM,EACJ,iBACA,gBACA,QAAQ,GACR,iBACE,QACI,EAAM,aACN,EAAM,OAAO,iBAClB,MAAM,EAAK,oBAAoB,CAAC,CACnC,GAEM,IAAiB,QAAe,EAAM,OAAO,QAAQ,QAAQ,MAAM,EAAE,YAAY,EAAK,CAAC;EAE7F,SAAS,EAAW,GAAa;GAC/B,IAAM,IAAM,EAAI,UACV,IACJ,EAAW,OAAO,QAAQ,KAAO,EAAW,MAAM,cAAc,QAAQ,SAAS;GAKnF,AAHA,EAAW,QAAQ;IAAE;IAAK;GAAU,GACpC,EAAI,MAAM,WAAW,GAAK,CAAS,GAEnC,EAAK,eAAe;IAAE;IAAK;GAAU,CAAC;EACxC;EAEA,SAAS,EAAiB,GAAoE;GAC5F,IAAI,CAAC,GAAM;IACT,AAAI,EAAW,UAAU,SAAM,EAAW,QAAQ;IAClD;GACF;GACA,IAAM,IAAM,EAAM,OAAO,QAAQ,MAAM,MAAM,EAAE,aAAa,EAAK,GAAG;GAC/D,MACD,EAAW,OAAO,QAAQ,EAAK,OAAO,EAAW,MAAM,cAAc,EAAK,cAC9E,EAAW,QAAQ;IAAE,KAAK,EAAK;IAAK,WAAW,EAAK;GAAU,GAC9D,EAAI,MAAM,WAAW,EAAK,KAAK,EAAK,SAAS,GAC7C,EA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,KAAK,EAAI;IACV,OAAK,EAAA,CAAC,iBAAe,CACK,EAAI,OAAA,EAAA,eAAwC,EAAI,QAAO,CAAA,CAAA,CAAA;OAMjF,EAAqE,GAAA;IAApD;IAAY;IAAM,MAAI,CAAG,EAAI;;;;;;GAGtC,EAAA,OAAO,WAAA,EAAA,GAAjB,EAIK,MAJL,GAIK,CAHH,EAEM,OAFN,GAEM,CADJ,EAA0D,GAAA;IAAxC,SAAS,EAAA,OAAO;IAAgB;;4BAK1D,EAaQ,SAAA,GAAA,CAZN,EAWK,MAXL,GAWK,CAVH,EASK,MAAA;GARF,SAA0B,EAAA,MAAe,SAAU,KAAA,OAAO,iBAA2B,KAAA,OAAO;GAG7F,OAAM;MAEN,EAEM,OAFN,GAEM,CADJ,EAAwC,GAAA;GAA/B,SAAS;GAAM,MAAK;0BAM5B,EAAA,WAAW,EAAA,MAAM,SAAM,KAAA,EAAA,GAAlC,EAEM,OAFN,GAEM,CADJ,EAAwC,GAAA;GAA/B,SAAS;GAAM,MAAK"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admins-components67.js","names":[],"sources":["../src/components/data-table/DataTable.vue"],"sourcesContent":["<script lang=\"ts\">\nexport type {\n LayoutMode,\n DataListConfig,\n DataListSettings,\n DataTableSettings,\n DataCardsSettings,\n Column,\n Sort,\n Action,\n ActionGroup,\n FilterConfig,\n FilterValue,\n} from '@/types/data-list'\n\nexport {\n dataTableSettingsDefaults,\n dataCardsSettingsDefaults,\n dataListSettingsDefaults,\n} from '@/types/data-list'\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, ref, onMounted, watch } from 'vue'\nimport Checkbox from '@/components/Checkbox.vue'\nimport { useSelection } from '@/composables/useSelection'\nimport { dataTableSettingsDefaults } from '@/types/data-list'\nimport type { Column, DataListConfig, DataTableSettings } from '@/types/data-list'\nimport Loader from '@/components/Loader.vue'\nimport DataCell from './DataCell.vue'\nimport DataListActions from './DataListActions.vue'\n\ntype SortDirection = 'asc' | 'desc'\n\nconst props = withDefaults(\n defineProps<{\n config: DataListConfig\n items: Record<string, unknown>[]\n settings?: DataTableSettings\n loading?: boolean\n initialSort?: { key: string; direction: SortDirection } | null\n }>(),\n {\n settings: () => ({ ...dataTableSettingsDefaults }),\n loading: false,\n initialSort: null,\n },\n)\n\nconst emit = defineEmits<{\n 'selection-change': [selected: unknown[]]\n 'sort-change': [sort: { key: string; direction: SortDirection }]\n}>()\n\n//const CHARACTER_BREAKPOINT = 20\n\nconst activeSort = ref<{\n key: string\n direction: SortDirection\n} | null>(null)\n\nconst {\n selectedKeys,\n allSelected,\n toggle: toggleRow,\n toggleAll,\n} = useSelection(\n () => props.items,\n () => props.config.selectableAttr,\n (s) => emit('selection-change', s),\n)\n\nconst visibleColumns = computed(() => props.config.columns.filter((c) => c.visible !== false))\n\nfunction handleSort(col: Column) {\n const key = col.property\n const direction: SortDirection =\n activeSort.value?.key === key && activeSort.value.direction === 'asc' ? 'desc' : 'asc'\n\n activeSort.value = { key, direction }\n col.sort?.callback?.(key, direction)\n\n emit('sort-change', { key, direction })\n}\n\nfunction applyInitialSort(sort: { key: string; direction: SortDirection } | null | undefined) {\n if (!sort) {\n if (activeSort.value !== null) activeSort.value = null\n return\n }\n const col = props.config.columns.find((c) => c.property === sort.key)\n if (!col) return\n if (activeSort.value?.key === sort.key && activeSort.value.direction === sort.direction) return\n activeSort.value = { key: sort.key, direction: sort.direction }\n col.sort?.callback?.(sort.key, sort.direction)\n emit('sort-change', { key: sort.key, direction: sort.direction })\n}\n\nonMounted(() => applyInitialSort(props.initialSort))\nwatch(\n () => props.initialSort,\n (s) => {\n // When initialSort changes, sync the visual indicator only.\n // Don't re-emit sort-change — that would cause an infinite loop with\n // parents that re-assign the prop from the emitted value.\n if (!s) {\n if (activeSort.value !== null) activeSort.value = null\n return\n }\n const col = props.config.columns.find((c) => c.property === s.key)\n if (!col) return\n if (activeSort.value?.key === s.key && activeSort.value.direction === s.direction) return\n activeSort.value = { key: s.key, direction: s.direction }\n },\n)\n</script>\n\n<template>\n <div class=\"ac-component\">\n <div
|
|
1
|
+
{"version":3,"file":"admins-components67.js","names":[],"sources":["../src/components/data-table/DataTable.vue"],"sourcesContent":["<script lang=\"ts\">\nexport type {\n LayoutMode,\n DataListConfig,\n DataListSettings,\n DataTableSettings,\n DataCardsSettings,\n Column,\n Sort,\n Action,\n ActionGroup,\n FilterConfig,\n FilterValue,\n} from '@/types/data-list'\n\nexport {\n dataTableSettingsDefaults,\n dataCardsSettingsDefaults,\n dataListSettingsDefaults,\n} from '@/types/data-list'\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, ref, onMounted, watch, nextTick } from 'vue'\nimport Checkbox from '@/components/Checkbox.vue'\nimport { useSelection } from '@/composables/useSelection'\nimport { dataTableSettingsDefaults } from '@/types/data-list'\nimport type { Column, DataListConfig, DataTableSettings } from '@/types/data-list'\nimport Loader from '@/components/Loader.vue'\nimport DataCell from './DataCell.vue'\nimport DataListActions from './DataListActions.vue'\n\ntype SortDirection = 'asc' | 'desc'\n\nconst props = withDefaults(\n defineProps<{\n config: DataListConfig\n items: Record<string, unknown>[]\n settings?: DataTableSettings\n loading?: boolean\n initialSort?: { key: string; direction: SortDirection } | null\n }>(),\n {\n settings: () => ({ ...dataTableSettingsDefaults }),\n loading: false,\n initialSort: null,\n },\n)\n\nconst emit = defineEmits<{\n 'selection-change': [selected: unknown[]]\n 'sort-change': [sort: { key: string; direction: SortDirection }]\n}>()\n\n//const CHARACTER_BREAKPOINT = 20\n\nconst activeSort = ref<{\n key: string\n direction: SortDirection\n} | null>(null)\n\nconst tableWrapperRef = ref<HTMLElement | null>(null)\n\nwatch(\n () => props.loading,\n async (isLoading) => {\n if (isLoading) {\n await nextTick()\n tableWrapperRef.value?.scrollTo({ top: 0, behavior: 'smooth' })\n }\n },\n)\n\nconst {\n selectedKeys,\n allSelected,\n toggle: toggleRow,\n toggleAll,\n} = useSelection(\n () => props.items,\n () => props.config.selectableAttr,\n (s) => emit('selection-change', s),\n)\n\nconst visibleColumns = computed(() => props.config.columns.filter((c) => c.visible !== false))\n\nfunction handleSort(col: Column) {\n const key = col.property\n const direction: SortDirection =\n activeSort.value?.key === key && activeSort.value.direction === 'asc' ? 'desc' : 'asc'\n\n activeSort.value = { key, direction }\n col.sort?.callback?.(key, direction)\n\n emit('sort-change', { key, direction })\n}\n\nfunction applyInitialSort(sort: { key: string; direction: SortDirection } | null | undefined) {\n if (!sort) {\n if (activeSort.value !== null) activeSort.value = null\n return\n }\n const col = props.config.columns.find((c) => c.property === sort.key)\n if (!col) return\n if (activeSort.value?.key === sort.key && activeSort.value.direction === sort.direction) return\n activeSort.value = { key: sort.key, direction: sort.direction }\n col.sort?.callback?.(sort.key, sort.direction)\n emit('sort-change', { key: sort.key, direction: sort.direction })\n}\n\nonMounted(() => applyInitialSort(props.initialSort))\nwatch(\n () => props.initialSort,\n (s) => {\n // When initialSort changes, sync the visual indicator only.\n // Don't re-emit sort-change — that would cause an infinite loop with\n // parents that re-assign the prop from the emitted value.\n if (!s) {\n if (activeSort.value !== null) activeSort.value = null\n return\n }\n const col = props.config.columns.find((c) => c.property === s.key)\n if (!col) return\n if (activeSort.value?.key === s.key && activeSort.value.direction === s.direction) return\n activeSort.value = { key: s.key, direction: s.direction }\n },\n)\n</script>\n\n<template>\n <div class=\"ac-component\">\n <div\n ref=\"tableWrapperRef\"\n class=\"c-table-wrapper list-table-view\"\n :class=\"{ 'is-loading': loading }\"\n >\n <table\n class=\"c-table\"\n :class=\"{ 'is-compact': settings.compact }\"\n :style=\"{ '--action-count': config.actions?.length ?? 0 }\"\n >\n <thead>\n <tr>\n <th v-if=\"config.selectableAttr\">\n <Checkbox :model-value=\"allSelected\" @update:model-value=\"toggleAll\" />\n </th>\n\n <th\n v-for=\"col in visibleColumns\"\n :key=\"col.property\"\n :class=\"[\n {\n 'c-sortable': col.sort,\n 'c-sortable--sorted': activeSort?.key === col.property,\n 'primary-col': col.primary,\n },\n col.headerClass,\n ]\"\n :title=\"col.sort ? `Sorrendezés ${col.label} alapján` : undefined\"\n @click=\"col.sort ? handleSort(col) : undefined\"\n >\n {{ !col.hideHeader ? col.label : '' }}\n\n <span\n v-if=\"col.sort\"\n class=\"c-sort-icon fa-solid\"\n :class=\"{\n 'fa-sort': activeSort?.key !== col.property,\n 'fa-sort-down':\n activeSort?.key === col.property && activeSort.direction === 'desc',\n 'fa-sort-up': activeSort?.key === col.property && activeSort.direction === 'asc',\n 'c-sort-icon--active': activeSort?.key === col.property,\n 'is-asc': activeSort?.key === col.property && activeSort.direction === 'asc',\n 'is-desc': activeSort?.key === col.property && activeSort.direction === 'desc',\n }\"\n ></span>\n </th>\n\n <th v-if=\"config.actions\" class=\"c-actions-header\">\n {{ config.actionHeader ?? '' }}\n </th>\n </tr>\n </thead>\n\n <tbody v-if=\"!loading || items.length > 0\">\n <tr\n v-for=\"(item, index) in items\"\n :key=\"index\"\n :class=\"{\n 'is-selected': config.selectableAttr && selectedKeys.has(item[config.selectableAttr]),\n 'is-striped': settings.striped && index % 2 === 1,\n }\"\n >\n <td v-if=\"config.selectableAttr\" class=\"pointer\" @click.stop=\"toggleRow(item)\">\n <Checkbox\n :model-value=\"!!selectedKeys.has(item[config.selectableAttr])\"\n @update:model-value=\"toggleRow(item)\"\n @click.stop\n />\n </td>\n\n <td\n v-for=\"col in visibleColumns\"\n :key=\"col.property\"\n class=\"c-table__cell\"\n :class=\"[\n col.class,\n { 'primary-col': col.primary },\n /* { 'is-nowrap': String(getColumnValue(item, col) ?? '').length < CHARACTER_BREAKPOINT}, */\n ]\"\n >\n <DataCell :item=\"item\" :col=\"col\" :copy=\"!col.hideCopyToClipboard\" />\n </td>\n\n <td v-if=\"config.actions\" class=\"c-actions-cell\">\n <div class=\"c-actions-wrap\">\n <DataListActions :actions=\"config.actions\" :item=\"item\" />\n </div>\n </td>\n </tr>\n </tbody>\n <tbody v-else>\n <tr class=\"c-table__loading-row\">\n <td\n :colspan=\"\n visibleColumns.length + (config.selectableAttr ? 1 : 0) + (config.actions ? 1 : 0)\n \"\n class=\"c-table__loading-cell\"\n >\n <div class=\"c-table__loading-wrap\">\n <Loader :loading=\"true\" size=\"2.5rem\" />\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n <div v-if=\"loading && items.length > 0\" class=\"c-table__backdrop\" aria-hidden=\"true\">\n <Loader :loading=\"true\" size=\"2.5rem\" />\n </div>\n </div>\n </div>\n</template>\n\n<style lang=\"scss\" src=\"@/styles/components/data-table/data-table.scss\"></style>\n"],"mappings":""}
|
|
@@ -7,16 +7,16 @@ import { getColumnValue as a } from "./admins-components59.js";
|
|
|
7
7
|
import { shortUuid as o } from "./admins-components60.js";
|
|
8
8
|
import s from "./admins-components62.js";
|
|
9
9
|
import c from "./admins-components64.js";
|
|
10
|
-
import { Fragment as l, computed as u, createBlock as d, createCommentVNode as f, createElementBlock as p, createElementVNode as m, createVNode as h, defineComponent as g, isVNode as _,
|
|
10
|
+
import { Fragment as l, computed as u, createBlock as d, createCommentVNode as f, createElementBlock as p, createElementVNode as m, createVNode as h, defineComponent as g, isVNode as _, nextTick as v, normalizeClass as y, openBlock as b, ref as x, renderList as S, resolveDirective as C, resolveDynamicComponent as w, toDisplayString as T, unref as E, vShow as D, watch as O, withDirectives as k, withModifiers as A } from "vue";
|
|
11
11
|
//#region src/components/data-table/DataCards.vue?vue&type=script&setup=true&lang.ts
|
|
12
|
-
var
|
|
12
|
+
var j = { class: "ac-component" }, M = ["onClick", "onPointerdown"], N = ["onClick"], P = { class: "c-card__heading" }, F = { class: "c-card__label" }, I = ["innerHTML"], L = ["innerHTML"], R = { class: "c-card__body" }, z = { class: "c-card__field-label" }, B = {
|
|
13
13
|
key: 1,
|
|
14
14
|
class: "c-cards__loading-wrap"
|
|
15
|
-
},
|
|
15
|
+
}, V = {
|
|
16
16
|
key: 2,
|
|
17
17
|
class: "c-cards__backdrop",
|
|
18
18
|
"aria-hidden": "true"
|
|
19
|
-
},
|
|
19
|
+
}, H = /* @__PURE__ */ g({
|
|
20
20
|
__name: "DataCards",
|
|
21
21
|
props: {
|
|
22
22
|
config: {},
|
|
@@ -29,14 +29,19 @@ var A = { class: "ac-component" }, j = ["onClick", "onPointerdown"], M = ["onCli
|
|
|
29
29
|
},
|
|
30
30
|
emits: ["selection-change"],
|
|
31
31
|
setup(i, { emit: g }) {
|
|
32
|
-
let
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
let H = i, U = g, { selectedKeys: W, toggle: G } = r(() => H.items, () => H.config.selectableAttr, (e) => U("selection-change", e)), K = x(/* @__PURE__ */ new Set()), q = x(null);
|
|
33
|
+
O(() => H.loading, async (e) => {
|
|
34
|
+
e && (await v(), q.value?.scrollTo({
|
|
35
|
+
top: 0,
|
|
36
|
+
behavior: "smooth"
|
|
37
|
+
}));
|
|
38
|
+
}), O(() => H.items, () => {
|
|
39
|
+
K.value = /* @__PURE__ */ new Set();
|
|
35
40
|
});
|
|
36
|
-
let
|
|
37
|
-
let e =
|
|
41
|
+
let J = u(() => H.config.columns.filter((e) => e.visible !== !1)), Y = u(() => {
|
|
42
|
+
let e = H.settings;
|
|
38
43
|
if (e?.cardHeaderColumns) {
|
|
39
|
-
let t =
|
|
44
|
+
let t = J.value.filter((t) => e.cardHeaderColumns[t.property]);
|
|
40
45
|
if (t.length > 0) {
|
|
41
46
|
if (e.cardHeaderOrder) {
|
|
42
47
|
let n = e.cardHeaderOrder;
|
|
@@ -48,100 +53,104 @@ var A = { class: "ac-component" }, j = ["onClick", "onPointerdown"], M = ["onCli
|
|
|
48
53
|
return t;
|
|
49
54
|
}
|
|
50
55
|
}
|
|
51
|
-
let t =
|
|
52
|
-
return t.length > 0 ? t :
|
|
53
|
-
}),
|
|
54
|
-
function
|
|
55
|
-
|
|
56
|
-
|
|
56
|
+
let t = J.value.filter((e) => e.primary);
|
|
57
|
+
return t.length > 0 ? t : J.value.slice(0, 1);
|
|
58
|
+
}), X = null, Z = !1;
|
|
59
|
+
function Q(e, t) {
|
|
60
|
+
H.config.selectableAttr && e.button === 0 && (Z = !1, X = setTimeout(() => {
|
|
61
|
+
Z = !0, G(t);
|
|
57
62
|
}, 500));
|
|
58
63
|
}
|
|
59
|
-
function
|
|
60
|
-
|
|
64
|
+
function $() {
|
|
65
|
+
X &&= (clearTimeout(X), null);
|
|
61
66
|
}
|
|
62
|
-
function
|
|
63
|
-
|
|
67
|
+
function ee(e) {
|
|
68
|
+
Z && e.preventDefault();
|
|
64
69
|
}
|
|
65
|
-
function
|
|
66
|
-
if (
|
|
67
|
-
|
|
70
|
+
function te(e) {
|
|
71
|
+
if (Z) {
|
|
72
|
+
Z = !1;
|
|
68
73
|
return;
|
|
69
74
|
}
|
|
70
|
-
|
|
75
|
+
ne(e);
|
|
71
76
|
}
|
|
72
|
-
function
|
|
73
|
-
|
|
77
|
+
function ne(e) {
|
|
78
|
+
K.value.has(e) ? K.value.delete(e) : K.value.add(e), K.value = new Set(K.value);
|
|
74
79
|
}
|
|
75
80
|
return (r, u) => {
|
|
76
|
-
let g =
|
|
77
|
-
return
|
|
81
|
+
let g = C("tooltip");
|
|
82
|
+
return b(), p("div", j, [m("div", {
|
|
83
|
+
ref_key: "cardsWrapperRef",
|
|
84
|
+
ref: q,
|
|
85
|
+
class: y(["c-cards-wrapper list-card-view", { "is-loading": i.loading }])
|
|
86
|
+
}, [!i.loading || i.items.length > 0 ? (b(), p("div", {
|
|
78
87
|
key: 0,
|
|
79
|
-
class:
|
|
80
|
-
}, [(
|
|
88
|
+
class: y(["c-cards", { "is-compact": i.settings.compact }])
|
|
89
|
+
}, [(b(!0), p(l, null, S(i.items, (t, r) => (b(), p("div", {
|
|
81
90
|
key: r,
|
|
82
|
-
class:
|
|
83
|
-
"is-open":
|
|
84
|
-
"is-selected": i.config.selectableAttr &&
|
|
91
|
+
class: y(["c-card", {
|
|
92
|
+
"is-open": K.value.has(r),
|
|
93
|
+
"is-selected": i.config.selectableAttr && E(W).has(t[i.config.selectableAttr])
|
|
85
94
|
}])
|
|
86
95
|
}, [m("button", {
|
|
87
96
|
type: "button",
|
|
88
97
|
class: "c-card__header",
|
|
89
|
-
onClick: (e) =>
|
|
90
|
-
onPointerdown: (e) =>
|
|
91
|
-
onPointerup: u[1] ||= (e) =>
|
|
92
|
-
onPointerleave: u[2] ||= (e) =>
|
|
93
|
-
onContextmenu:
|
|
98
|
+
onClick: (e) => te(r),
|
|
99
|
+
onPointerdown: (e) => Q(e, t),
|
|
100
|
+
onPointerup: u[1] ||= (e) => $(),
|
|
101
|
+
onPointerleave: u[2] ||= (e) => $(),
|
|
102
|
+
onContextmenu: ee
|
|
94
103
|
}, [
|
|
95
|
-
i.config.selectableAttr ? (
|
|
104
|
+
i.config.selectableAttr ? (b(), p("span", {
|
|
96
105
|
key: 0,
|
|
97
106
|
class: "c-card__check-zone",
|
|
98
|
-
onClick:
|
|
107
|
+
onClick: A((e) => E(G)(t), ["stop"])
|
|
99
108
|
}, [h(e, {
|
|
100
|
-
"model-value": !!
|
|
101
|
-
"onUpdate:modelValue": (e) =>
|
|
102
|
-
onClick: u[0] ||=
|
|
103
|
-
}, null, 8, ["model-value", "onUpdate:modelValue"])], 8,
|
|
104
|
-
m("span",
|
|
109
|
+
"model-value": !!E(W).has(t[i.config.selectableAttr]),
|
|
110
|
+
"onUpdate:modelValue": (e) => E(G)(t),
|
|
111
|
+
onClick: u[0] ||= A(() => {}, ["stop"])
|
|
112
|
+
}, null, 8, ["model-value", "onUpdate:modelValue"])], 8, N)) : f("", !0),
|
|
113
|
+
m("span", P, [(b(!0), p(l, null, S(Y.value, (e, n) => (b(), p("span", {
|
|
105
114
|
key: e.property,
|
|
106
|
-
class:
|
|
107
|
-
}, [m("span",
|
|
115
|
+
class: y(["c-card__heading-item", [{ primary: e.primary }, e.headerClass]])
|
|
116
|
+
}, [m("span", F, T(e.hideHeader ? "" : e.label), 1), m("span", { class: y(["c-card__title", { "c-truncate": i.settings.compact && n === 0 }]) }, [_(E(a)(t, e)) ? (b(), d(w(E(a)(t, e)), { key: 0 })) : e.type === "uuid" ? k((b(), p("span", {
|
|
108
117
|
key: 1,
|
|
109
|
-
innerHTML:
|
|
110
|
-
}, null, 8,
|
|
118
|
+
innerHTML: E(o)()(E(a)(t, e))
|
|
119
|
+
}, null, 8, I)), [[g, E(a)(t, e)]]) : (b(), p("span", {
|
|
111
120
|
key: 2,
|
|
112
|
-
innerHTML:
|
|
113
|
-
}, null, 8,
|
|
121
|
+
innerHTML: E(a)(t, e)
|
|
122
|
+
}, null, 8, L))], 2)], 2))), 128))]),
|
|
114
123
|
u[4] ||= m("span", {
|
|
115
124
|
class: "c-card__icon",
|
|
116
125
|
"aria-hidden": "true"
|
|
117
126
|
}, [m("i", { class: "fa-solid fa-chevron-down" })], -1)
|
|
118
|
-
], 40,
|
|
127
|
+
], 40, M), k(m("div", R, [(b(!0), p(l, null, S(J.value, (e) => (b(), p("div", {
|
|
119
128
|
key: e.property,
|
|
120
129
|
class: "c-card__field"
|
|
121
130
|
}, [
|
|
122
|
-
m("span",
|
|
131
|
+
m("span", z, T(e.label), 1),
|
|
123
132
|
h(s, {
|
|
124
133
|
item: t,
|
|
125
134
|
col: e,
|
|
126
135
|
class: "c-card__field-value",
|
|
127
136
|
copy: !1
|
|
128
137
|
}, null, 8, ["item", "col"]),
|
|
129
|
-
|
|
138
|
+
E(a)(t, e) && !e.hideCopyToClipboard ? (b(), d(n, {
|
|
130
139
|
key: 0,
|
|
131
140
|
class: "c-card__field-copy click-expand",
|
|
132
|
-
value:
|
|
141
|
+
value: E(a)(t, e)
|
|
133
142
|
}, null, 8, ["value"])) : f("", !0)
|
|
134
|
-
]))), 128)), i.config.actions ? (
|
|
143
|
+
]))), 128)), i.config.actions ? (b(), p("div", {
|
|
135
144
|
key: 0,
|
|
136
145
|
class: "c-card__actions",
|
|
137
|
-
onClick: u[3] ||=
|
|
146
|
+
onClick: u[3] ||= A(() => {}, ["stop"])
|
|
138
147
|
}, [h(c, {
|
|
139
148
|
actions: i.config.actions,
|
|
140
149
|
item: t
|
|
141
|
-
}, null, 8, ["actions", "item"])])) : f("", !0)], 512), [[
|
|
150
|
+
}, null, 8, ["actions", "item"])])) : f("", !0)], 512), [[D, K.value.has(r)]])], 2))), 128))], 2)) : (b(), p("div", B, [h(t, {
|
|
142
151
|
loading: !0,
|
|
143
152
|
size: "2.5rem"
|
|
144
|
-
})])), i.loading && i.items.length > 0 ? (
|
|
153
|
+
})])), i.loading && i.items.length > 0 ? (b(), p("div", V, [h(t, {
|
|
145
154
|
loading: !0,
|
|
146
155
|
size: "2.5rem"
|
|
147
156
|
})])) : f("", !0)], 2)]);
|
|
@@ -149,4 +158,4 @@ var A = { class: "ac-component" }, j = ["onClick", "onPointerdown"], M = ["onCli
|
|
|
149
158
|
}
|
|
150
159
|
});
|
|
151
160
|
//#endregion
|
|
152
|
-
export {
|
|
161
|
+
export { H as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admins-components68.js","names":[],"sources":["../src/components/data-table/DataCards.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { DataListConfig, DataCardsSettings, DataListSettings } from '@/types/data-list'\nimport DataCell from './DataCell.vue'\nimport DataListActions from './DataListActions.vue'\nexport { dataCardsSettingsDefaults } from '@/types/data-list'\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, ref, watch, isVNode } from 'vue'\nimport Checkbox from '@/components/Checkbox.vue'\nimport CopyToClipboard from '@/components/CopyToClipboard.vue'\nimport Loader from '@/components/Loader.vue'\nimport { useSelection } from '@/composables/useSelection'\nimport { dataCardsSettingsDefaults } from '@/types/data-list'\nimport { getColumnValue } from '@/utils/dataList'\nimport { shortUuid } from '@/utils/dataListConverters'\n\nconst props = withDefaults(\n defineProps<{\n config: DataListConfig\n items: Record<string, unknown>[]\n settings?: DataCardsSettings | DataListSettings\n loading?: boolean\n }>(),\n {\n settings: () => ({ ...dataCardsSettingsDefaults }),\n loading: false,\n },\n)\n\nconst emit = defineEmits<{\n 'selection-change': [selected: unknown[]]\n}>()\n\nconst { selectedKeys, toggle: toggleRow } = useSelection(\n () => props.items,\n () => props.config.selectableAttr,\n (s) => emit('selection-change', s),\n)\n\nconst openRowIndexes = ref<Set<number>>(new Set())\n\nwatch(\n () => props.items,\n () => {\n openRowIndexes.value = new Set()\n },\n)\n\nconst visibleColumns = computed(() => props.config.columns.filter((c) => c.visible !== false))\n\nconst cardHeaderColumns = computed(() => {\n const s = props.settings as any\n if (s?.cardHeaderColumns) {\n const cols = visibleColumns.value.filter((c) => s.cardHeaderColumns[c.property])\n if (cols.length > 0) {\n if (s.cardHeaderOrder) {\n const order = s.cardHeaderOrder as string[]\n return [...cols].sort((a, b) => {\n const ai = order.indexOf(a.property)\n const bi = order.indexOf(b.property)\n return (ai === -1 ? 999 : ai) - (bi === -1 ? 999 : bi)\n })\n }\n return cols\n }\n }\n const primary = visibleColumns.value.filter((c) => c.primary)\n if (primary.length > 0) return primary\n\n return visibleColumns.value.slice(0, 1)\n})\n\nlet longPressTimer: ReturnType<typeof setTimeout> | null = null\nlet longPressTriggered = false\n\nfunction onPointerDown(e: PointerEvent, item: Record<string, unknown>) {\n if (!props.config.selectableAttr) return\n if (e.button !== 0) return\n longPressTriggered = false\n longPressTimer = setTimeout(() => {\n longPressTriggered = true\n toggleRow(item)\n }, 500)\n}\n\nfunction onPointerUp() {\n if (longPressTimer) {\n clearTimeout(longPressTimer)\n longPressTimer = null\n }\n}\n\nfunction onContextMenu(e: MouseEvent) {\n if (longPressTriggered) {\n e.preventDefault()\n }\n}\n\nfunction onHeaderClick(index: number) {\n if (longPressTriggered) {\n longPressTriggered = false\n return\n }\n toggleAccordion(index)\n}\n\nfunction toggleAccordion(index: number) {\n if (openRowIndexes.value.has(index)) {\n openRowIndexes.value.delete(index)\n } else {\n openRowIndexes.value.add(index)\n }\n openRowIndexes.value = new Set(openRowIndexes.value)\n}\n\n/* function isCardHeaderVNode(value: unknown): boolean {\n return isVNode(value)\n} */\n</script>\n\n<template>\n <div class=\"ac-component\">\n <div class=\"c-cards-wrapper list-card-view\" :class=\"{ 'is-loading': loading }\">\n <div\n v-if=\"!loading || items.length > 0\"\n class=\"c-cards\"\n :class=\"{ 'is-compact': settings.compact }\"\n >\n <div\n v-for=\"(item, index) in items\"\n :key=\"index\"\n class=\"c-card\"\n :class=\"{\n 'is-open': openRowIndexes.has(index),\n 'is-selected': config.selectableAttr && selectedKeys.has(item[config.selectableAttr]),\n }\"\n >\n <button\n type=\"button\"\n class=\"c-card__header\"\n @click=\"onHeaderClick(index)\"\n @pointerdown=\"onPointerDown($event, item)\"\n @pointerup=\"onPointerUp()\"\n @pointerleave=\"onPointerUp()\"\n @contextmenu=\"onContextMenu\"\n >\n <span\n v-if=\"config.selectableAttr\"\n class=\"c-card__check-zone\"\n @click.stop=\"toggleRow(item)\"\n >\n <Checkbox\n :model-value=\"!!selectedKeys.has(item[config.selectableAttr])\"\n @update:model-value=\"toggleRow(item)\"\n @click.stop\n />\n </span>\n <span class=\"c-card__heading\">\n <span\n v-for=\"(col, i) in cardHeaderColumns\"\n :key=\"col.property\"\n class=\"c-card__heading-item\"\n :class=\"[{ primary: col.primary }, col.headerClass]\"\n >\n <span class=\"c-card__label\">{{ !col.hideHeader ? col.label : '' }}</span>\n <span class=\"c-card__title\" :class=\"{ 'c-truncate': settings.compact && i === 0 }\">\n <component\n v-if=\"isVNode(getColumnValue(item, col))\"\n :is=\"getColumnValue(item, col)\"\n />\n <span\n v-else-if=\"col.type === 'uuid'\"\n v-tooltip=\"getColumnValue(item, col)\"\n v-html=\"shortUuid()(getColumnValue(item, col) as string)\"\n ></span>\n <span v-else v-html=\"getColumnValue(item, col)\"></span>\n </span>\n </span>\n </span>\n <span class=\"c-card__icon\" aria-hidden=\"true\"\n ><i class=\"fa-solid fa-chevron-down\"></i\n ></span>\n </button>\n\n <div v-show=\"openRowIndexes.has(index)\" class=\"c-card__body\">\n <div v-for=\"col in visibleColumns\" :key=\"col.property\" class=\"c-card__field\">\n <span class=\"c-card__field-label\">{{ col.label }}</span>\n <DataCell :item=\"item\" :col=\"col\" class=\"c-card__field-value\" :copy=\"false\" />\n\n <CopyToClipboard\n v-if=\"getColumnValue(item, col) && !col.hideCopyToClipboard\"\n class=\"c-card__field-copy click-expand\"\n :value=\"getColumnValue(item, col)\"\n />\n </div>\n\n <div v-if=\"config.actions\" class=\"c-card__actions\" @click.stop>\n <DataListActions :actions=\"config.actions\" :item=\"item\" />\n </div>\n </div>\n </div>\n </div>\n <div v-else class=\"c-cards__loading-wrap\">\n <Loader :loading=\"true\" size=\"2.5rem\" />\n </div>\n <div v-if=\"loading && items.length > 0\" class=\"c-cards__backdrop\" aria-hidden=\"true\">\n <Loader :loading=\"true\" size=\"2.5rem\" />\n </div>\n </div>\n </div>\n</template>\n\n<style lang=\"scss\" src=\"@/styles/components/data-table/data-cards.scss\"></style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiBA,IAAM,IAAQ,GAaR,IAAO,GAIP,EAAE,iBAAc,QAAQ,MAAc,QACpC,EAAM,aACN,EAAM,OAAO,iBAClB,MAAM,EAAK,oBAAoB,CAAC,CACnC,GAEM,IAAiB,kBAAiB,IAAI,IAAI,CAAC;EAEjD,QACQ,EAAM,aACN;GACJ,EAAe,wBAAQ,IAAI,IAAI;EACjC,CACF;EAEA,IAAM,IAAiB,QAAe,EAAM,OAAO,QAAQ,QAAQ,MAAM,EAAE,YAAY,EAAK,CAAC,GAEvF,IAAoB,QAAe;GACvC,IAAM,IAAI,EAAM;GAChB,IAAI,GAAG,mBAAmB;IACxB,IAAM,IAAO,EAAe,MAAM,QAAQ,MAAM,EAAE,kBAAkB,EAAE,SAAS;IAC/E,IAAI,EAAK,SAAS,GAAG;KACnB,IAAI,EAAE,iBAAiB;MACrB,IAAM,IAAQ,EAAE;MAChB,OAAO,CAAC,GAAG,CAAI,EAAE,MAAM,GAAG,MAAM;OAC9B,IAAM,IAAK,EAAM,QAAQ,EAAE,QAAQ,GAC7B,IAAK,EAAM,QAAQ,EAAE,QAAQ;OACnC,QAAQ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cesContent":["<script lang=\"ts\">\nimport type { DataListConfig, DataCardsSettings, DataListSettings } from '@/types/data-list'\nimport DataCell from './DataCell.vue'\nimport DataListActions from './DataListActions.vue'\nexport { dataCardsSettingsDefaults } from '@/types/data-list'\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, ref, watch, isVNode, nextTick } from 'vue'\nimport Checkbox from '@/components/Checkbox.vue'\nimport CopyToClipboard from '@/components/CopyToClipboard.vue'\nimport Loader from '@/components/Loader.vue'\nimport { useSelection } from '@/composables/useSelection'\nimport { dataCardsSettingsDefaults } from '@/types/data-list'\nimport { getColumnValue } from '@/utils/dataList'\nimport { shortUuid } from '@/utils/dataListConverters'\n\nconst props = withDefaults(\n defineProps<{\n config: DataListConfig\n items: Record<string, unknown>[]\n settings?: DataCardsSettings | DataListSettings\n loading?: boolean\n }>(),\n {\n settings: () => ({ ...dataCardsSettingsDefaults }),\n loading: false,\n },\n)\n\nconst emit = defineEmits<{\n 'selection-change': [selected: unknown[]]\n}>()\n\nconst { selectedKeys, toggle: toggleRow } = useSelection(\n () => props.items,\n () => props.config.selectableAttr,\n (s) => emit('selection-change', s),\n)\n\nconst openRowIndexes = ref<Set<number>>(new Set())\n\nconst cardsWrapperRef = ref<HTMLElement | null>(null)\n\nwatch(\n () => props.loading,\n async (isLoading) => {\n if (isLoading) {\n await nextTick()\n cardsWrapperRef.value?.scrollTo({ top: 0, behavior: 'smooth' })\n }\n },\n)\n\nwatch(\n () => props.items,\n () => {\n openRowIndexes.value = new Set()\n },\n)\n\nconst visibleColumns = computed(() => props.config.columns.filter((c) => c.visible !== false))\n\nconst cardHeaderColumns = computed(() => {\n const s = props.settings as any\n if (s?.cardHeaderColumns) {\n const cols = visibleColumns.value.filter((c) => s.cardHeaderColumns[c.property])\n if (cols.length > 0) {\n if (s.cardHeaderOrder) {\n const order = s.cardHeaderOrder as string[]\n return [...cols].sort((a, b) => {\n const ai = order.indexOf(a.property)\n const bi = order.indexOf(b.property)\n return (ai === -1 ? 999 : ai) - (bi === -1 ? 999 : bi)\n })\n }\n return cols\n }\n }\n const primary = visibleColumns.value.filter((c) => c.primary)\n if (primary.length > 0) return primary\n\n return visibleColumns.value.slice(0, 1)\n})\n\nlet longPressTimer: ReturnType<typeof setTimeout> | null = null\nlet longPressTriggered = false\n\nfunction onPointerDown(e: PointerEvent, item: Record<string, unknown>) {\n if (!props.config.selectableAttr) return\n if (e.button !== 0) return\n longPressTriggered = false\n longPressTimer = setTimeout(() => {\n longPressTriggered = true\n toggleRow(item)\n }, 500)\n}\n\nfunction onPointerUp() {\n if (longPressTimer) {\n clearTimeout(longPressTimer)\n longPressTimer = null\n }\n}\n\nfunction onContextMenu(e: MouseEvent) {\n if (longPressTriggered) {\n e.preventDefault()\n }\n}\n\nfunction onHeaderClick(index: number) {\n if (longPressTriggered) {\n longPressTriggered = false\n return\n }\n toggleAccordion(index)\n}\n\nfunction toggleAccordion(index: number) {\n if (openRowIndexes.value.has(index)) {\n openRowIndexes.value.delete(index)\n } else {\n openRowIndexes.value.add(index)\n }\n openRowIndexes.value = new Set(openRowIndexes.value)\n}\n\n/* function isCardHeaderVNode(value: unknown): boolean {\n return isVNode(value)\n} */\n</script>\n\n<template>\n <div class=\"ac-component\">\n <div\n ref=\"cardsWrapperRef\"\n class=\"c-cards-wrapper list-card-view\"\n :class=\"{ 'is-loading': loading }\"\n >\n <div\n v-if=\"!loading || items.length > 0\"\n class=\"c-cards\"\n :class=\"{ 'is-compact': settings.compact }\"\n >\n <div\n v-for=\"(item, index) in items\"\n :key=\"index\"\n class=\"c-card\"\n :class=\"{\n 'is-open': openRowIndexes.has(index),\n 'is-selected': config.selectableAttr && selectedKeys.has(item[config.selectableAttr]),\n }\"\n >\n <button\n type=\"button\"\n class=\"c-card__header\"\n @click=\"onHeaderClick(index)\"\n @pointerdown=\"onPointerDown($event, item)\"\n @pointerup=\"onPointerUp()\"\n @pointerleave=\"onPointerUp()\"\n @contextmenu=\"onContextMenu\"\n >\n <span\n v-if=\"config.selectableAttr\"\n class=\"c-card__check-zone\"\n @click.stop=\"toggleRow(item)\"\n >\n <Checkbox\n :model-value=\"!!selectedKeys.has(item[config.selectableAttr])\"\n @update:model-value=\"toggleRow(item)\"\n @click.stop\n />\n </span>\n <span class=\"c-card__heading\">\n <span\n v-for=\"(col, i) in cardHeaderColumns\"\n :key=\"col.property\"\n class=\"c-card__heading-item\"\n :class=\"[{ primary: col.primary }, col.headerClass]\"\n >\n <span class=\"c-card__label\">{{ !col.hideHeader ? col.label : '' }}</span>\n <span class=\"c-card__title\" :class=\"{ 'c-truncate': settings.compact && i === 0 }\">\n <component\n v-if=\"isVNode(getColumnValue(item, col))\"\n :is=\"getColumnValue(item, col)\"\n />\n <span\n v-else-if=\"col.type === 'uuid'\"\n v-tooltip=\"getColumnValue(item, col)\"\n v-html=\"shortUuid()(getColumnValue(item, col) as string)\"\n ></span>\n <span v-else v-html=\"getColumnValue(item, col)\"></span>\n </span>\n </span>\n </span>\n <span class=\"c-card__icon\" aria-hidden=\"true\"\n ><i class=\"fa-solid fa-chevron-down\"></i\n ></span>\n </button>\n\n <div v-show=\"openRowIndexes.has(index)\" class=\"c-card__body\">\n <div v-for=\"col in visibleColumns\" :key=\"col.property\" class=\"c-card__field\">\n <span class=\"c-card__field-label\">{{ col.label }}</span>\n <DataCell :item=\"item\" :col=\"col\" class=\"c-card__field-value\" :copy=\"false\" />\n\n <CopyToClipboard\n v-if=\"getColumnValue(item, col) && !col.hideCopyToClipboard\"\n class=\"c-card__field-copy click-expand\"\n :value=\"getColumnValue(item, col)\"\n />\n </div>\n\n <div v-if=\"config.actions\" class=\"c-card__actions\" @click.stop>\n <DataListActions :actions=\"config.actions\" :item=\"item\" />\n </div>\n </div>\n </div>\n </div>\n <div v-else class=\"c-cards__loading-wrap\">\n <Loader :loading=\"true\" size=\"2.5rem\" />\n </div>\n <div v-if=\"loading && items.length > 0\" class=\"c-cards__backdrop\" aria-hidden=\"true\">\n <Loader :loading=\"true\" size=\"2.5rem\" />\n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e,eAAY;QACpC,EACF,KAAA,EADK,OAAM,2BAA0B,CAAA,CAAA,GAAA,EAAA;gBAIxC,EAeM,OAfN,GAeM,EAAA,EAAA,EAAA,GAdJ,EASM,GAAA,MAAA,EATa,EAAA,QAAP,YAAZ,EASM,OAAA;IAT8B,KAAK,EAAI;IAAU,OAAM;;IAC3D,EAAwD,QAAxD,GAAwD,EAAnB,EAAI,KAAK,GAAA,CAAA;IAC9C,EAA8E,GAAA;KAA7D;KAAY;KAAK,OAAM;KAAuB,MAAM;;IAG7D,EAAA,CAAA,EAAe,GAAM,CAAG,KAAA,CAAM,EAAI,uBAAA,EAAA,GAD1C,EAIE,GAAA;;KAFA,OAAM;KACL,OAAO,EAAA,CAAA,EAAe,GAAM,CAAG;;gBAIzB,EAAA,OAAO,WAAA,EAAA,GAAlB,EAEM,OAAA;;IAFqB,OAAM;IAAmB,SAAK,AAAA,EAAA,OAAA,QAAN,CAAA,GAAW,CAAA,MAAA,CAAA;OAC5D,EAA0D,GAAA;IAAxC,SAAS,EAAA,OAAO;IAAgB;gEAbzC,EAAA,MAAe,IAAI,CAAK,CAAA,CAAA,CAAA,CAAA,GAAA,CAAA,yBAkBzC,EAEM,OAFN,GAEM,CADJ,EAAwC,GAAA;IAA/B,SAAS;IAAM,MAAK;UAEpB,EAAA,WAAW,EAAA,MAAM,SAAM,KAAA,EAAA,GAAlC,EAEM,OAFN,GAEM,CADJ,EAAwC,GAAA;IAA/B,SAAS;IAAM,MAAK"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admins-components70.js","names":[],"sources":["../src/components/data-table/DataCards.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { DataListConfig, DataCardsSettings, DataListSettings } from '@/types/data-list'\nimport DataCell from './DataCell.vue'\nimport DataListActions from './DataListActions.vue'\nexport { dataCardsSettingsDefaults } from '@/types/data-list'\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, ref, watch, isVNode } from 'vue'\nimport Checkbox from '@/components/Checkbox.vue'\nimport CopyToClipboard from '@/components/CopyToClipboard.vue'\nimport Loader from '@/components/Loader.vue'\nimport { useSelection } from '@/composables/useSelection'\nimport { dataCardsSettingsDefaults } from '@/types/data-list'\nimport { getColumnValue } from '@/utils/dataList'\nimport { shortUuid } from '@/utils/dataListConverters'\n\nconst props = withDefaults(\n defineProps<{\n config: DataListConfig\n items: Record<string, unknown>[]\n settings?: DataCardsSettings | DataListSettings\n loading?: boolean\n }>(),\n {\n settings: () => ({ ...dataCardsSettingsDefaults }),\n loading: false,\n },\n)\n\nconst emit = defineEmits<{\n 'selection-change': [selected: unknown[]]\n}>()\n\nconst { selectedKeys, toggle: toggleRow } = useSelection(\n () => props.items,\n () => props.config.selectableAttr,\n (s) => emit('selection-change', s),\n)\n\nconst openRowIndexes = ref<Set<number>>(new Set())\n\nwatch(\n () => props.items,\n () => {\n openRowIndexes.value = new Set()\n },\n)\n\nconst visibleColumns = computed(() => props.config.columns.filter((c) => c.visible !== false))\n\nconst cardHeaderColumns = computed(() => {\n const s = props.settings as any\n if (s?.cardHeaderColumns) {\n const cols = visibleColumns.value.filter((c) => s.cardHeaderColumns[c.property])\n if (cols.length > 0) {\n if (s.cardHeaderOrder) {\n const order = s.cardHeaderOrder as string[]\n return [...cols].sort((a, b) => {\n const ai = order.indexOf(a.property)\n const bi = order.indexOf(b.property)\n return (ai === -1 ? 999 : ai) - (bi === -1 ? 999 : bi)\n })\n }\n return cols\n }\n }\n const primary = visibleColumns.value.filter((c) => c.primary)\n if (primary.length > 0) return primary\n\n return visibleColumns.value.slice(0, 1)\n})\n\nlet longPressTimer: ReturnType<typeof setTimeout> | null = null\nlet longPressTriggered = false\n\nfunction onPointerDown(e: PointerEvent, item: Record<string, unknown>) {\n if (!props.config.selectableAttr) return\n if (e.button !== 0) return\n longPressTriggered = false\n longPressTimer = setTimeout(() => {\n longPressTriggered = true\n toggleRow(item)\n }, 500)\n}\n\nfunction onPointerUp() {\n if (longPressTimer) {\n clearTimeout(longPressTimer)\n longPressTimer = null\n }\n}\n\nfunction onContextMenu(e: MouseEvent) {\n if (longPressTriggered) {\n e.preventDefault()\n }\n}\n\nfunction onHeaderClick(index: number) {\n if (longPressTriggered) {\n longPressTriggered = false\n return\n }\n toggleAccordion(index)\n}\n\nfunction toggleAccordion(index: number) {\n if (openRowIndexes.value.has(index)) {\n openRowIndexes.value.delete(index)\n } else {\n openRowIndexes.value.add(index)\n }\n openRowIndexes.value = new Set(openRowIndexes.value)\n}\n\n/* function isCardHeaderVNode(value: unknown): boolean {\n return isVNode(value)\n} */\n</script>\n\n<template>\n <div class=\"ac-component\">\n <div
|
|
1
|
+
{"version":3,"file":"admins-components70.js","names":[],"sources":["../src/components/data-table/DataCards.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { DataListConfig, DataCardsSettings, DataListSettings } from '@/types/data-list'\nimport DataCell from './DataCell.vue'\nimport DataListActions from './DataListActions.vue'\nexport { dataCardsSettingsDefaults } from '@/types/data-list'\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, ref, watch, isVNode, nextTick } from 'vue'\nimport Checkbox from '@/components/Checkbox.vue'\nimport CopyToClipboard from '@/components/CopyToClipboard.vue'\nimport Loader from '@/components/Loader.vue'\nimport { useSelection } from '@/composables/useSelection'\nimport { dataCardsSettingsDefaults } from '@/types/data-list'\nimport { getColumnValue } from '@/utils/dataList'\nimport { shortUuid } from '@/utils/dataListConverters'\n\nconst props = withDefaults(\n defineProps<{\n config: DataListConfig\n items: Record<string, unknown>[]\n settings?: DataCardsSettings | DataListSettings\n loading?: boolean\n }>(),\n {\n settings: () => ({ ...dataCardsSettingsDefaults }),\n loading: false,\n },\n)\n\nconst emit = defineEmits<{\n 'selection-change': [selected: unknown[]]\n}>()\n\nconst { selectedKeys, toggle: toggleRow } = useSelection(\n () => props.items,\n () => props.config.selectableAttr,\n (s) => emit('selection-change', s),\n)\n\nconst openRowIndexes = ref<Set<number>>(new Set())\n\nconst cardsWrapperRef = ref<HTMLElement | null>(null)\n\nwatch(\n () => props.loading,\n async (isLoading) => {\n if (isLoading) {\n await nextTick()\n cardsWrapperRef.value?.scrollTo({ top: 0, behavior: 'smooth' })\n }\n },\n)\n\nwatch(\n () => props.items,\n () => {\n openRowIndexes.value = new Set()\n },\n)\n\nconst visibleColumns = computed(() => props.config.columns.filter((c) => c.visible !== false))\n\nconst cardHeaderColumns = computed(() => {\n const s = props.settings as any\n if (s?.cardHeaderColumns) {\n const cols = visibleColumns.value.filter((c) => s.cardHeaderColumns[c.property])\n if (cols.length > 0) {\n if (s.cardHeaderOrder) {\n const order = s.cardHeaderOrder as string[]\n return [...cols].sort((a, b) => {\n const ai = order.indexOf(a.property)\n const bi = order.indexOf(b.property)\n return (ai === -1 ? 999 : ai) - (bi === -1 ? 999 : bi)\n })\n }\n return cols\n }\n }\n const primary = visibleColumns.value.filter((c) => c.primary)\n if (primary.length > 0) return primary\n\n return visibleColumns.value.slice(0, 1)\n})\n\nlet longPressTimer: ReturnType<typeof setTimeout> | null = null\nlet longPressTriggered = false\n\nfunction onPointerDown(e: PointerEvent, item: Record<string, unknown>) {\n if (!props.config.selectableAttr) return\n if (e.button !== 0) return\n longPressTriggered = false\n longPressTimer = setTimeout(() => {\n longPressTriggered = true\n toggleRow(item)\n }, 500)\n}\n\nfunction onPointerUp() {\n if (longPressTimer) {\n clearTimeout(longPressTimer)\n longPressTimer = null\n }\n}\n\nfunction onContextMenu(e: MouseEvent) {\n if (longPressTriggered) {\n e.preventDefault()\n }\n}\n\nfunction onHeaderClick(index: number) {\n if (longPressTriggered) {\n longPressTriggered = false\n return\n }\n toggleAccordion(index)\n}\n\nfunction toggleAccordion(index: number) {\n if (openRowIndexes.value.has(index)) {\n openRowIndexes.value.delete(index)\n } else {\n openRowIndexes.value.add(index)\n }\n openRowIndexes.value = new Set(openRowIndexes.value)\n}\n\n/* function isCardHeaderVNode(value: unknown): boolean {\n return isVNode(value)\n} */\n</script>\n\n<template>\n <div class=\"ac-component\">\n <div\n ref=\"cardsWrapperRef\"\n class=\"c-cards-wrapper list-card-view\"\n :class=\"{ 'is-loading': loading }\"\n >\n <div\n v-if=\"!loading || items.length > 0\"\n class=\"c-cards\"\n :class=\"{ 'is-compact': settings.compact }\"\n >\n <div\n v-for=\"(item, index) in items\"\n :key=\"index\"\n class=\"c-card\"\n :class=\"{\n 'is-open': openRowIndexes.has(index),\n 'is-selected': config.selectableAttr && selectedKeys.has(item[config.selectableAttr]),\n }\"\n >\n <button\n type=\"button\"\n class=\"c-card__header\"\n @click=\"onHeaderClick(index)\"\n @pointerdown=\"onPointerDown($event, item)\"\n @pointerup=\"onPointerUp()\"\n @pointerleave=\"onPointerUp()\"\n @contextmenu=\"onContextMenu\"\n >\n <span\n v-if=\"config.selectableAttr\"\n class=\"c-card__check-zone\"\n @click.stop=\"toggleRow(item)\"\n >\n <Checkbox\n :model-value=\"!!selectedKeys.has(item[config.selectableAttr])\"\n @update:model-value=\"toggleRow(item)\"\n @click.stop\n />\n </span>\n <span class=\"c-card__heading\">\n <span\n v-for=\"(col, i) in cardHeaderColumns\"\n :key=\"col.property\"\n class=\"c-card__heading-item\"\n :class=\"[{ primary: col.primary }, col.headerClass]\"\n >\n <span class=\"c-card__label\">{{ !col.hideHeader ? col.label : '' }}</span>\n <span class=\"c-card__title\" :class=\"{ 'c-truncate': settings.compact && i === 0 }\">\n <component\n v-if=\"isVNode(getColumnValue(item, col))\"\n :is=\"getColumnValue(item, col)\"\n />\n <span\n v-else-if=\"col.type === 'uuid'\"\n v-tooltip=\"getColumnValue(item, col)\"\n v-html=\"shortUuid()(getColumnValue(item, col) as string)\"\n ></span>\n <span v-else v-html=\"getColumnValue(item, col)\"></span>\n </span>\n </span>\n </span>\n <span class=\"c-card__icon\" aria-hidden=\"true\"\n ><i class=\"fa-solid fa-chevron-down\"></i\n ></span>\n </button>\n\n <div v-show=\"openRowIndexes.has(index)\" class=\"c-card__body\">\n <div v-for=\"col in visibleColumns\" :key=\"col.property\" class=\"c-card__field\">\n <span class=\"c-card__field-label\">{{ col.label }}</span>\n <DataCell :item=\"item\" :col=\"col\" class=\"c-card__field-value\" :copy=\"false\" />\n\n <CopyToClipboard\n v-if=\"getColumnValue(item, col) && !col.hideCopyToClipboard\"\n class=\"c-card__field-copy click-expand\"\n :value=\"getColumnValue(item, col)\"\n />\n </div>\n\n <div v-if=\"config.actions\" class=\"c-card__actions\" @click.stop>\n <DataListActions :actions=\"config.actions\" :item=\"item\" />\n </div>\n </div>\n </div>\n </div>\n <div v-else class=\"c-cards__loading-wrap\">\n <Loader :loading=\"true\" size=\"2.5rem\" />\n </div>\n <div v-if=\"loading && items.length > 0\" class=\"c-cards__backdrop\" aria-hidden=\"true\">\n <Loader :loading=\"true\" size=\"2.5rem\" />\n </div>\n </div>\n </div>\n</template>\n\n<style lang=\"scss\" src=\"@/styles/components/data-table/data-cards.scss\"></style>\n"],"mappings":""}
|
|
@@ -17,17 +17,11 @@ function A() {
|
|
|
17
17
|
direction: n
|
|
18
18
|
} : null;
|
|
19
19
|
}
|
|
20
|
-
var j =
|
|
21
|
-
value: "foo",
|
|
22
|
-
label: "foo"
|
|
23
|
-
}, {
|
|
24
|
-
value: "foo2",
|
|
25
|
-
label: "foo2"
|
|
26
|
-
}], M = /* @__PURE__ */ d({
|
|
20
|
+
var j = /* @__PURE__ */ d({
|
|
27
21
|
__name: "DataSort",
|
|
28
22
|
props: {
|
|
29
23
|
modelValue: {},
|
|
30
|
-
options: {
|
|
24
|
+
options: {},
|
|
31
25
|
placeholder: { default: "Rendezés..." },
|
|
32
26
|
handleUrl: {
|
|
33
27
|
type: Boolean,
|
|
@@ -39,25 +33,25 @@ var j = [{
|
|
|
39
33
|
}
|
|
40
34
|
},
|
|
41
35
|
emits: ["update:modelValue", "sort-change"],
|
|
42
|
-
setup(d, { emit:
|
|
43
|
-
let
|
|
36
|
+
setup(d, { emit: j }) {
|
|
37
|
+
let M = d, N = j, P = h(null), F = h(null), { isOpen: I, dropdownStyle: L } = t(P, F, {
|
|
44
38
|
extraStyle: (e) => ({ minWidth: `${Math.max(e.width, 240)}px` }),
|
|
45
39
|
closeOnScroll: !0
|
|
46
|
-
}),
|
|
47
|
-
get: () =>
|
|
40
|
+
}), R = a({
|
|
41
|
+
get: () => M.modelValue?.key ?? null,
|
|
48
42
|
set: (e) => {
|
|
49
|
-
Array.isArray(e) ||
|
|
43
|
+
Array.isArray(e) || V(e, M.modelValue?.direction ?? "asc");
|
|
50
44
|
}
|
|
51
|
-
}),
|
|
52
|
-
get: () =>
|
|
53
|
-
set: (e) =>
|
|
54
|
-
}),
|
|
55
|
-
function
|
|
45
|
+
}), z = a({
|
|
46
|
+
get: () => M.modelValue?.direction ?? "asc",
|
|
47
|
+
set: (e) => V(M.modelValue?.key ?? null, e)
|
|
48
|
+
}), B = a(() => M.modelValue ? `${M.options.find((e) => e.value === M.modelValue.key)?.label ?? M.modelValue.key} (${M.modelValue.direction === "asc" ? "növekvő" : "csökkenő"})` : M.placeholder);
|
|
49
|
+
function V(e, t) {
|
|
56
50
|
if (e == null) {
|
|
57
|
-
|
|
51
|
+
M.handleUrl && (r("sortBy", null, { handleUrl: !0 }), r("sortDir", null, { handleUrl: !0 })), N("update:modelValue", null), N("sort-change", null);
|
|
58
52
|
return;
|
|
59
53
|
}
|
|
60
|
-
|
|
54
|
+
M.handleUrl && (r("sortBy", e, { handleUrl: !0 }), r("sortDir", t, {
|
|
61
55
|
handleUrl: !0,
|
|
62
56
|
default: "asc"
|
|
63
57
|
}));
|
|
@@ -65,79 +59,79 @@ var j = [{
|
|
|
65
59
|
key: e,
|
|
66
60
|
direction: t
|
|
67
61
|
};
|
|
68
|
-
|
|
62
|
+
N("update:modelValue", n), N("sort-change", n);
|
|
69
63
|
}
|
|
70
|
-
function
|
|
71
|
-
|
|
64
|
+
function H() {
|
|
65
|
+
V(null, "asc"), I.value = !1;
|
|
72
66
|
}
|
|
73
|
-
return v(
|
|
74
|
-
if (!e || !
|
|
67
|
+
return v(I, (e) => {
|
|
68
|
+
if (!e || !M.handleUrl || M.modelValue) return;
|
|
75
69
|
let t = A();
|
|
76
|
-
t &&
|
|
70
|
+
t && V(t.key, t.direction);
|
|
77
71
|
}, { immediate: !0 }), (t, r) => (m(), c("div", b, [l("div", {
|
|
78
72
|
ref_key: "wrapperRef",
|
|
79
|
-
ref:
|
|
73
|
+
ref: P,
|
|
80
74
|
class: "ds-sort-wrapper"
|
|
81
75
|
}, [l("button", {
|
|
82
76
|
type: "button",
|
|
83
77
|
class: f(["c-btn ds-sort-trigger lh-1", [
|
|
84
78
|
d.modelValue && "is-active",
|
|
85
79
|
d.disabled && "is-disabled",
|
|
86
|
-
_(
|
|
80
|
+
_(I) && "is-open"
|
|
87
81
|
]]),
|
|
88
82
|
disabled: d.disabled,
|
|
89
|
-
"aria-label": `Rendezés: ${
|
|
90
|
-
onClick: r[0] ||= (e) =>
|
|
83
|
+
"aria-label": `Rendezés: ${B.value}`,
|
|
84
|
+
onClick: r[0] ||= (e) => I.value = !_(I)
|
|
91
85
|
}, [
|
|
92
86
|
l("i", { class: f(["fa-solid fa-fw", !d.modelValue || d.modelValue.direction === "asc" ? "fa-arrow-up-wide-short" : "fa-arrow-down-wide-short"]) }, null, 2),
|
|
93
|
-
l("span", S, g(
|
|
87
|
+
l("span", S, g(B.value), 1),
|
|
94
88
|
d.modelValue ? (m(), c("button", {
|
|
95
89
|
key: 0,
|
|
96
90
|
type: "button",
|
|
97
91
|
class: "c-icon-btn c-icon-btn--clear ds-sort-clear",
|
|
98
92
|
"aria-label": "Rendezés törlése",
|
|
99
93
|
title: "Rendezés törlése",
|
|
100
|
-
onClick: y(
|
|
94
|
+
onClick: y(H, ["stop"])
|
|
101
95
|
}, [...r[5] ||= [l("i", { class: "fa-solid fa-fw fa-xmark" }, null, -1)]])) : s("", !0),
|
|
102
|
-
l("span", { class: f(["c-icon-btn c-icon-btn--chevron", { "c-icon-btn--chevron-open": _(
|
|
103
|
-
], 10, x), (m(), o(i, { to: "body" }, [l("div", C, [_(
|
|
96
|
+
l("span", { class: f(["c-icon-btn c-icon-btn--chevron", { "c-icon-btn--chevron-open": _(I) }]) }, [...r[6] ||= [l("i", { class: "fa-solid fa-fw fa-chevron-down" }, null, -1)]], 2)
|
|
97
|
+
], 10, x), (m(), o(i, { to: "body" }, [l("div", C, [_(I) ? (m(), c("div", {
|
|
104
98
|
key: 0,
|
|
105
99
|
ref_key: "dropdownRef",
|
|
106
|
-
ref:
|
|
100
|
+
ref: F,
|
|
107
101
|
class: "ds-sort-panel",
|
|
108
|
-
style: p(_(
|
|
102
|
+
style: p(_(L))
|
|
109
103
|
}, [
|
|
110
104
|
l("div", w, [r[7] ||= l("label", { class: "ds-sort-panel__label" }, "Oszlop", -1), u(n, {
|
|
111
|
-
"model-value":
|
|
112
|
-
options:
|
|
105
|
+
"model-value": R.value,
|
|
106
|
+
options: d.options,
|
|
113
107
|
config: {
|
|
114
108
|
clearable: !1,
|
|
115
109
|
placeholder: "Válassz oszlopot...",
|
|
116
110
|
filterable: !1
|
|
117
111
|
},
|
|
118
|
-
"onUpdate:modelValue": r[1] ||= (e) =>
|
|
112
|
+
"onUpdate:modelValue": r[1] ||= (e) => R.value = e
|
|
119
113
|
}, null, 8, ["model-value", "options"])]),
|
|
120
114
|
l("div", T, [r[10] ||= l("span", { class: "ds-sort-panel__label" }, "Irány", -1), l("div", E, [l("button", {
|
|
121
115
|
type: "button",
|
|
122
|
-
class: f(["ds-sort-direction__btn", { "is-active":
|
|
123
|
-
"aria-pressed":
|
|
116
|
+
class: f(["ds-sort-direction__btn", { "is-active": z.value === "asc" }]),
|
|
117
|
+
"aria-pressed": z.value === "asc",
|
|
124
118
|
"aria-label": "Növekvő",
|
|
125
|
-
onClick: r[2] ||= (e) =>
|
|
119
|
+
onClick: r[2] ||= (e) => z.value = "asc"
|
|
126
120
|
}, [...r[8] ||= [l("i", { class: "fa-solid fa-fw fa-arrow-up-wide-short" }, null, -1), l("span", null, "Növekvő", -1)]], 10, D), l("button", {
|
|
127
121
|
type: "button",
|
|
128
|
-
class: f(["ds-sort-direction__btn dir-desc", { "is-active":
|
|
129
|
-
"aria-pressed":
|
|
122
|
+
class: f(["ds-sort-direction__btn dir-desc", { "is-active": z.value === "desc" }]),
|
|
123
|
+
"aria-pressed": z.value === "desc",
|
|
130
124
|
"aria-label": "Csökkenő",
|
|
131
|
-
onClick: r[3] ||= (e) =>
|
|
125
|
+
onClick: r[3] ||= (e) => z.value = "desc"
|
|
132
126
|
}, [...r[9] ||= [l("i", { class: "fa-solid fa-fw fa-arrow-down-wide-short" }, null, -1), l("span", null, "Csökkenő", -1)]], 10, O)])]),
|
|
133
127
|
l("div", k, [u(e, {
|
|
134
128
|
label: "Rendben",
|
|
135
129
|
outline: "",
|
|
136
130
|
size: "small",
|
|
137
|
-
onClick: r[4] ||= (e) =>
|
|
131
|
+
onClick: r[4] ||= (e) => I.value = !1
|
|
138
132
|
})])
|
|
139
133
|
], 4)) : s("", !0)])]))], 512)]));
|
|
140
134
|
}
|
|
141
135
|
});
|
|
142
136
|
//#endregion
|
|
143
|
-
export {
|
|
137
|
+
export { j as default, A as getDefaultSort };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admins-components80.js","names":[],"sources":["../src/components/data-table/DataSort.vue"],"sourcesContent":["<script lang=\"ts\">\nexport type SortDirection = 'asc' | 'desc'\n\nexport interface DataSortOption {\n value: string\n label: string\n icon?: string\n}\n\nexport interface DataSortProps {\n modelValue: { key: string; direction: SortDirection } | null\n options: DataSortOption[]\n placeholder?: string\n handleUrl?: boolean\n disabled?: boolean\n}\n\n/**\n * Resolve the initial sort state from the URL.\n * URL is the only source — there is no localStorage fallback for sort.\n * Returns `null` if no valid `sortBy` + `sortDir` pair is present in the URL.\n */\nexport function getDefaultSort(): { key: string; direction: SortDirection } | null {\n if (typeof window === 'undefined') return null\n const params = new URLSearchParams(window.location.search)\n const key = params.get('sortBy')\n const dir = params.get('sortDir')\n if (key && (dir === 'asc' || dir === 'desc')) {\n return { key, direction: dir }\n }\n return null\n}\n\nconst dummyItems: DataSortOption[] = [\n { value: 'foo', label: 'foo' },\n { value: 'foo2', label: 'foo2' },\n]\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, ref, watch } from 'vue'\nimport DropdownSelect from '@/components/DropdownSelect.vue'\nimport { useDropdownAnchor } from '@/composables/useDropdownAnchor'\nimport { writeUrlOrRemove } from '@/utils/url'\nimport Button from '../Button.vue'\n\nconst props = withDefaults(defineProps<DataSortProps>(), {\n placeholder: 'Rendezés...',\n handleUrl: false,\n disabled: false,\n options: () => dummyItems,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [sort: { key: string; direction: SortDirection } | null]\n 'sort-change': [sort: { key: string; direction: SortDirection } | null]\n}>()\n\nconst sortOptions = computed(() => (props.options.length ? props.options : dummyItems))\n\nconst wrapperRef = ref<HTMLElement | null>(null)\nconst dropdownRef = ref<HTMLElement | null>(null)\nconst { isOpen, dropdownStyle } = useDropdownAnchor(wrapperRef, dropdownRef, {\n extraStyle: (rect) => ({ minWidth: `${Math.max(rect.width, 240)}px` }),\n closeOnScroll: true,\n})\n\nconst sortBy = computed<string | string[] | null>({\n get: () => props.modelValue?.key ?? null,\n set: (v) => {\n if (Array.isArray(v)) return\n emitChange(v, props.modelValue?.direction ?? 'asc')\n },\n})\n\nconst direction = computed<SortDirection>({\n get: () => props.modelValue?.direction ?? 'asc',\n set: (d) => emitChange(props.modelValue?.key ?? null, d),\n})\n\nconst activeLabel = computed(() => {\n if (!props.modelValue) return props.placeholder\n const opt = sortOptions.value.find((o) => o.value === props.modelValue!.key)\n const label = opt?.label ?? props.modelValue.key\n return `${label} (${props.modelValue.direction === 'asc' ? 'növekvő' : 'csökkenő'})`\n})\n\nfunction emitChange(key: string | null, dir: SortDirection) {\n if (key == null) {\n if (props.handleUrl) {\n writeUrlOrRemove('sortBy', null, { handleUrl: true })\n writeUrlOrRemove('sortDir', null, { handleUrl: true })\n }\n emit('update:modelValue', null)\n emit('sort-change', null)\n return\n }\n if (props.handleUrl) {\n writeUrlOrRemove('sortBy', key, { handleUrl: true })\n writeUrlOrRemove('sortDir', dir, { handleUrl: true, default: 'asc' })\n }\n const next = { key, direction: dir }\n emit('update:modelValue', next)\n emit('sort-change', next)\n}\n\nfunction clear() {\n emitChange(null, 'asc')\n isOpen.value = false\n}\n\n// Read initial state from URL on mount when handleUrl is true and modelValue is empty.\nwatch(\n isOpen,\n (open) => {\n if (!open || !props.handleUrl || props.modelValue) return\n const sort = getDefaultSort()\n if (sort) emitChange(sort.key, sort.direction)\n },\n { immediate: true },\n)\n</script>\n\n<template>\n <div class=\"ac-component\">\n <div ref=\"wrapperRef\" class=\"ds-sort-wrapper\">\n <button\n type=\"button\"\n class=\"c-btn ds-sort-trigger lh-1\"\n :class=\"[modelValue && 'is-active', disabled && 'is-disabled', isOpen && 'is-open']\"\n :disabled=\"disabled\"\n :aria-label=\"`Rendezés: ${activeLabel}`\"\n @click=\"isOpen = !isOpen\"\n >\n <i\n class=\"fa-solid fa-fw\"\n :class=\"\n !modelValue || modelValue.direction === 'asc'\n ? 'fa-arrow-up-wide-short'\n : 'fa-arrow-down-wide-short'\n \"\n ></i>\n <span class=\"ds-sort-label c-truncate\">{{ activeLabel }}</span>\n <button\n v-if=\"modelValue\"\n type=\"button\"\n class=\"c-icon-btn c-icon-btn--clear ds-sort-clear\"\n aria-label=\"Rendezés törlése\"\n title=\"Rendezés törlése\"\n @click.stop=\"clear\"\n >\n <i class=\"fa-solid fa-fw fa-xmark\"></i>\n </button>\n <span\n class=\"c-icon-btn c-icon-btn--chevron\"\n :class=\"{ 'c-icon-btn--chevron-open': isOpen }\"\n >\n <i class=\"fa-solid fa-fw fa-chevron-down\"></i>\n </span>\n </button>\n\n <Teleport to=\"body\">\n <div class=\"ac-component\">\n <div v-if=\"isOpen\" ref=\"dropdownRef\" class=\"ds-sort-panel\" :style=\"dropdownStyle\">\n\n <div class=\"ds-sort-panel__row\">\n <label class=\"ds-sort-panel__label\">Oszlop</label>\n <DropdownSelect\n :model-value=\"sortBy\"\n :options=\"sortOptions\"\n :config=\"{\n clearable: false,\n placeholder: 'Válassz oszlopot...',\n filterable: false,\n }\"\n @update:model-value=\"(v) => (sortBy = v)\"\n />\n </div>\n\n <div class=\"ds-sort-panel__row\">\n <span class=\"ds-sort-panel__label\">Irány</span>\n <div class=\"ds-sort-direction\" role=\"group\" aria-label=\"Rendezés iránya\">\n <button\n type=\"button\"\n class=\"ds-sort-direction__btn\"\n :class=\"{ 'is-active': direction === 'asc' }\"\n :aria-pressed=\"direction === 'asc'\"\n aria-label=\"Növekvő\"\n @click=\"direction = 'asc'\"\n >\n <i class=\"fa-solid fa-fw fa-arrow-up-wide-short\"></i>\n <span>Növekvő</span>\n </button>\n <button\n type=\"button\"\n class=\"ds-sort-direction__btn dir-desc\"\n :class=\"{ 'is-active': direction === 'desc' }\"\n :aria-pressed=\"direction === 'desc'\"\n aria-label=\"Csökkenő\"\n @click=\"direction = 'desc'\"\n >\n <i class=\"fa-solid fa-fw fa-arrow-down-wide-short\"></i>\n <span>Csökkenő</span>\n </button>\n </div>\n </div>\n\n <div class=\"ds-sort-panel__footer\">\n <Button label=\"Rendben\" outline size=\"small\" @click=\"isOpen = false\" />\n </div>\n </div>\n </div>\n </Teleport>\n </div>\n </div>\n</template>\n\n<style lang=\"scss\" src=\"@/styles/components/data-table/data-sort.scss\"></style>\n"],"mappings":";;;;;;;;;;;AAsBA,SAAgB,IAAmE;CACjF,IAAI,OAAO,SAAW,KAAa,OAAO;CAC1C,IAAM,IAAS,IAAI,gBAAgB,OAAO,SAAS,MAAM,GACnD,IAAM,EAAO,IAAI,QAAQ,GACzB,IAAM,EAAO,IAAI,SAAS;CAIhC,OAHI,MAAQ,MAAQ,SAAS,MAAQ,UAC5B;EAAE;EAAK,WAAW;CAAI,IAExB;AACT;AAEA,IAAM,IAA+B,CACnC;CAAE,OAAO;CAAO,OAAO;AAAM,GAC7B;CAAE,OAAO;CAAQ,OAAO;AAAO,CACjC;;;;;;;;;;;;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AEM,CADJ,EAAuE,GAAA;IAA/D,OAAM;IAAU,SAAA;IAAQ,MAAK;IAAS,SAAK,AAAA,EAAA,QAAA,MAAE,EAAA,QAAM"}
|
|
1
|
+
{"version":3,"file":"admins-components80.js","names":[],"sources":["../src/components/data-table/DataSort.vue"],"sourcesContent":["<script lang=\"ts\">\nexport type SortDirection = 'asc' | 'desc'\n\nexport interface DataSortOption {\n value: string\n label: string\n icon?: string\n}\n\nexport interface DataSortProps {\n modelValue: { key: string; direction: SortDirection } | null\n options: DataSortOption[]\n placeholder?: string\n handleUrl?: boolean\n disabled?: boolean\n}\n\n/**\n * Resolve the initial sort state from the URL.\n * URL is the only source — there is no localStorage fallback for sort.\n * Returns `null` if no valid `sortBy` + `sortDir` pair is present in the URL.\n */\nexport function getDefaultSort(): { key: string; direction: SortDirection } | null {\n if (typeof window === 'undefined') return null\n const params = new URLSearchParams(window.location.search)\n const key = params.get('sortBy')\n const dir = params.get('sortDir')\n if (key && (dir === 'asc' || dir === 'desc')) {\n return { key, direction: dir }\n }\n return null\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, ref, watch } from 'vue'\nimport DropdownSelect from '@/components/DropdownSelect.vue'\nimport { useDropdownAnchor } from '@/composables/useDropdownAnchor'\nimport { writeUrlOrRemove } from '@/utils/url'\nimport Button from '../Button.vue'\n\nconst props = withDefaults(defineProps<DataSortProps>(), {\n placeholder: 'Rendezés...',\n handleUrl: false,\n disabled: false\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [sort: { key: string; direction: SortDirection } | null]\n 'sort-change': [sort: { key: string; direction: SortDirection } | null]\n}>()\n\nconst wrapperRef = ref<HTMLElement | null>(null)\nconst dropdownRef = ref<HTMLElement | null>(null)\nconst { isOpen, dropdownStyle } = useDropdownAnchor(wrapperRef, dropdownRef, {\n extraStyle: (rect) => ({ minWidth: `${Math.max(rect.width, 240)}px` }),\n closeOnScroll: true,\n})\n\nconst sortBy = computed<string | string[] | null>({\n get: () => props.modelValue?.key ?? null,\n set: (v) => {\n if (Array.isArray(v)) return\n emitChange(v, props.modelValue?.direction ?? 'asc')\n },\n})\n\nconst direction = computed<SortDirection>({\n get: () => props.modelValue?.direction ?? 'asc',\n set: (d) => emitChange(props.modelValue?.key ?? null, d),\n})\n\nconst activeLabel = computed(() => {\n if (!props.modelValue) return props.placeholder\n const opt = props.options.find((o) => o.value === props.modelValue!.key)\n const label = opt?.label ?? props.modelValue.key\n return `${label} (${props.modelValue.direction === 'asc' ? 'növekvő' : 'csökkenő'})`\n})\n\nfunction emitChange(key: string | null, dir: SortDirection) {\n if (key == null) {\n if (props.handleUrl) {\n writeUrlOrRemove('sortBy', null, { handleUrl: true })\n writeUrlOrRemove('sortDir', null, { handleUrl: true })\n }\n emit('update:modelValue', null)\n emit('sort-change', null)\n return\n }\n if (props.handleUrl) {\n writeUrlOrRemove('sortBy', key, { handleUrl: true })\n writeUrlOrRemove('sortDir', dir, { handleUrl: true, default: 'asc' })\n }\n const next = { key, direction: dir }\n emit('update:modelValue', next)\n emit('sort-change', next)\n}\n\nfunction clear() {\n emitChange(null, 'asc')\n isOpen.value = false\n}\n\n// Read initial state from URL on mount when handleUrl is true and modelValue is empty.\nwatch(\n isOpen,\n (open) => {\n if (!open || !props.handleUrl || props.modelValue) return\n const sort = getDefaultSort()\n if (sort) emitChange(sort.key, sort.direction)\n },\n { immediate: true },\n)\n</script>\n\n<template>\n <div class=\"ac-component\">\n <div ref=\"wrapperRef\" class=\"ds-sort-wrapper\">\n <button\n type=\"button\"\n class=\"c-btn ds-sort-trigger lh-1\"\n :class=\"[modelValue && 'is-active', disabled && 'is-disabled', isOpen && 'is-open']\"\n :disabled=\"disabled\"\n :aria-label=\"`Rendezés: ${activeLabel}`\"\n @click=\"isOpen = !isOpen\"\n >\n <i\n class=\"fa-solid fa-fw\"\n :class=\"\n !modelValue || modelValue.direction === 'asc'\n ? 'fa-arrow-up-wide-short'\n : 'fa-arrow-down-wide-short'\n \"\n ></i>\n <span class=\"ds-sort-label c-truncate\">{{ activeLabel }}</span>\n <button\n v-if=\"modelValue\"\n type=\"button\"\n class=\"c-icon-btn c-icon-btn--clear ds-sort-clear\"\n aria-label=\"Rendezés törlése\"\n title=\"Rendezés törlése\"\n @click.stop=\"clear\"\n >\n <i class=\"fa-solid fa-fw fa-xmark\"></i>\n </button>\n <span\n class=\"c-icon-btn c-icon-btn--chevron\"\n :class=\"{ 'c-icon-btn--chevron-open': isOpen }\"\n >\n <i class=\"fa-solid fa-fw fa-chevron-down\"></i>\n </span>\n </button>\n\n <Teleport to=\"body\">\n <div class=\"ac-component\">\n <div v-if=\"isOpen\" ref=\"dropdownRef\" class=\"ds-sort-panel\" :style=\"dropdownStyle\">\n\n <div class=\"ds-sort-panel__row\">\n <label class=\"ds-sort-panel__label\">Oszlop</label>\n <DropdownSelect\n :model-value=\"sortBy\"\n :options=\"options\"\n :config=\"{\n clearable: false,\n placeholder: 'Válassz oszlopot...',\n filterable: false,\n }\"\n @update:model-value=\"(v) => (sortBy = v)\"\n />\n </div>\n\n <div class=\"ds-sort-panel__row\">\n <span class=\"ds-sort-panel__label\">Irány</span>\n <div class=\"ds-sort-direction\" role=\"group\" aria-label=\"Rendezés iránya\">\n <button\n type=\"button\"\n class=\"ds-sort-direction__btn\"\n :class=\"{ 'is-active': direction === 'asc' }\"\n :aria-pressed=\"direction === 'asc'\"\n aria-label=\"Növekvő\"\n @click=\"direction = 'asc'\"\n >\n <i class=\"fa-solid fa-fw fa-arrow-up-wide-short\"></i>\n <span>Növekvő</span>\n </button>\n <button\n type=\"button\"\n class=\"ds-sort-direction__btn dir-desc\"\n :class=\"{ 'is-active': direction === 'desc' }\"\n :aria-pressed=\"direction === 'desc'\"\n aria-label=\"Csökkenő\"\n @click=\"direction = 'desc'\"\n >\n <i class=\"fa-solid fa-fw fa-arrow-down-wide-short\"></i>\n <span>Csökkenő</span>\n </button>\n </div>\n </div>\n\n <div class=\"ds-sort-panel__footer\">\n <Button label=\"Rendben\" outline size=\"small\" @click=\"isOpen = false\" />\n </div>\n </div>\n </div>\n </Teleport>\n </div>\n </div>\n</template>\n\n<style lang=\"scss\" src=\"@/styles/components/data-table/data-sort.scss\"></style>\n"],"mappings":";;;;;;;;;;;AAsBA,SAAgB,IAAmE;CACjF,IAAI,OAAO,SAAW,KAAa,OAAO;CAC1C,IAAM,IAAS,IAAI,gBAAgB,OAAO,SAAS,MAAM,GACnD,IAAM,EAAO,IAAI,QAAQ,GACzB,IAAM,EAAO,IAAI,SAAS;CAIhC,OAHI,MAAQ,MAAQ,SAAS,MAAQ,UAC5B;EAAE;EAAK,WAAW;CAAI,IAExB;AACT;;;;;;;;;;;;;;;;;;EAUA,IAAM,IAAQ,GAMR,IAAO,GAKP,IAAa,EAAwB,IAAI,GACzC,IAAc,EAAwB,IAAI,GAC1C,EAAE,WAAQ,qBAAkB,EAAkB,GAAY,GAAa;GAC3E,aAAa,OAAU,EAAE,UAAU,GAAG,KAAK,IAAI,EAAK,OAAO,GAAG,EAAE,IAAI;GACpE,eAAe;EACjB,CAAC,GAEK,IAAS,EAAmC;GAChD,WAAW,EAAM,YAAY,OAAO;GACpC,MAAM,MAAM;IACN,MAAM,QAAQ,CAAC,KACnB,EAAW,GAAG,EAAM,YAAY,aAAa,KAAK;GACpD;EACF,CAAC,GAEK,IAAY,EAAwB;GACxC,WAAW,EAAM,YAAY,aAAa;GAC1C,MAAM,MAAM,EAAW,EAAM,YAAY,OAAO,MAAM,CAAC;EACzD,CAAC,GAEK,IAAc,QACb,EAAM,aAGJ,GAFK,EAAM,QAAQ,MAAM,MAAM,EAAE,UAAU,EAAM,WAAY,GACtD,GAAK,SAAS,EAAM,WAAW,IAC7B,IAAI,EAAM,WAAW,cAAc,QAAQ,YAAY,WAAW,KAHpD,EAAM,WAIrC;EAED,SAAS,EAAW,GAAoB,GAAoB;GAC1D,IAAI,KAAO,MAAM;IAMf,AALI,EAAM,cACR,EAAiB,UAAU,MAAM,EAAE,WAAW,GAAK,CAAC,GACpD,EAAiB,WA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;IATP,MAAK;IACL,OAAK,EAAA,CAAC,mCAAiC,EAAA,aAChB,EAAA,UAAS,OAAA,CAAA,CAAA;IAC/B,gBAAc,EAAA,UAAS;IACxB,cAAW;IACV,SAAK,AAAA,EAAA,QAAA,MAAE,EAAA,QAAS;oBAEjB,EAAuD,KAAA,EAApD,OAAM,0CAAyC,GAAA,MAAA,EAAA,GAClD,EAAqB,QAAA,MAAf,YAAQ,EAAA,CAAA,CAAA,GAAA,IAAA,CAAA,CAAA,CAAA,CAAA,CAAA;GAKpB,EAEM,OAFN,GAEM,CADJ,EAAuE,GAAA;IAA/D,OAAM;IAAU,SAAA;IAAQ,MAAK;IAAS,SAAK,AAAA,EAAA,QAAA,MAAE,EAAA,QAAM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admins-components82.js","names":[],"sources":["../src/components/data-table/DataSort.vue"],"sourcesContent":["<script lang=\"ts\">\nexport type SortDirection = 'asc' | 'desc'\n\nexport interface DataSortOption {\n value: string\n label: string\n icon?: string\n}\n\nexport interface DataSortProps {\n modelValue: { key: string; direction: SortDirection } | null\n options: DataSortOption[]\n placeholder?: string\n handleUrl?: boolean\n disabled?: boolean\n}\n\n/**\n * Resolve the initial sort state from the URL.\n * URL is the only source — there is no localStorage fallback for sort.\n * Returns `null` if no valid `sortBy` + `sortDir` pair is present in the URL.\n */\nexport function getDefaultSort(): { key: string; direction: SortDirection } | null {\n if (typeof window === 'undefined') return null\n const params = new URLSearchParams(window.location.search)\n const key = params.get('sortBy')\n const dir = params.get('sortDir')\n if (key && (dir === 'asc' || dir === 'desc')) {\n return { key, direction: dir }\n }\n return null\n}\n
|
|
1
|
+
{"version":3,"file":"admins-components82.js","names":[],"sources":["../src/components/data-table/DataSort.vue"],"sourcesContent":["<script lang=\"ts\">\nexport type SortDirection = 'asc' | 'desc'\n\nexport interface DataSortOption {\n value: string\n label: string\n icon?: string\n}\n\nexport interface DataSortProps {\n modelValue: { key: string; direction: SortDirection } | null\n options: DataSortOption[]\n placeholder?: string\n handleUrl?: boolean\n disabled?: boolean\n}\n\n/**\n * Resolve the initial sort state from the URL.\n * URL is the only source — there is no localStorage fallback for sort.\n * Returns `null` if no valid `sortBy` + `sortDir` pair is present in the URL.\n */\nexport function getDefaultSort(): { key: string; direction: SortDirection } | null {\n if (typeof window === 'undefined') return null\n const params = new URLSearchParams(window.location.search)\n const key = params.get('sortBy')\n const dir = params.get('sortDir')\n if (key && (dir === 'asc' || dir === 'desc')) {\n return { key, direction: dir }\n }\n return null\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, ref, watch } from 'vue'\nimport DropdownSelect from '@/components/DropdownSelect.vue'\nimport { useDropdownAnchor } from '@/composables/useDropdownAnchor'\nimport { writeUrlOrRemove } from '@/utils/url'\nimport Button from '../Button.vue'\n\nconst props = withDefaults(defineProps<DataSortProps>(), {\n placeholder: 'Rendezés...',\n handleUrl: false,\n disabled: false\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [sort: { key: string; direction: SortDirection } | null]\n 'sort-change': [sort: { key: string; direction: SortDirection } | null]\n}>()\n\nconst wrapperRef = ref<HTMLElement | null>(null)\nconst dropdownRef = ref<HTMLElement | null>(null)\nconst { isOpen, dropdownStyle } = useDropdownAnchor(wrapperRef, dropdownRef, {\n extraStyle: (rect) => ({ minWidth: `${Math.max(rect.width, 240)}px` }),\n closeOnScroll: true,\n})\n\nconst sortBy = computed<string | string[] | null>({\n get: () => props.modelValue?.key ?? null,\n set: (v) => {\n if (Array.isArray(v)) return\n emitChange(v, props.modelValue?.direction ?? 'asc')\n },\n})\n\nconst direction = computed<SortDirection>({\n get: () => props.modelValue?.direction ?? 'asc',\n set: (d) => emitChange(props.modelValue?.key ?? null, d),\n})\n\nconst activeLabel = computed(() => {\n if (!props.modelValue) return props.placeholder\n const opt = props.options.find((o) => o.value === props.modelValue!.key)\n const label = opt?.label ?? props.modelValue.key\n return `${label} (${props.modelValue.direction === 'asc' ? 'növekvő' : 'csökkenő'})`\n})\n\nfunction emitChange(key: string | null, dir: SortDirection) {\n if (key == null) {\n if (props.handleUrl) {\n writeUrlOrRemove('sortBy', null, { handleUrl: true })\n writeUrlOrRemove('sortDir', null, { handleUrl: true })\n }\n emit('update:modelValue', null)\n emit('sort-change', null)\n return\n }\n if (props.handleUrl) {\n writeUrlOrRemove('sortBy', key, { handleUrl: true })\n writeUrlOrRemove('sortDir', dir, { handleUrl: true, default: 'asc' })\n }\n const next = { key, direction: dir }\n emit('update:modelValue', next)\n emit('sort-change', next)\n}\n\nfunction clear() {\n emitChange(null, 'asc')\n isOpen.value = false\n}\n\n// Read initial state from URL on mount when handleUrl is true and modelValue is empty.\nwatch(\n isOpen,\n (open) => {\n if (!open || !props.handleUrl || props.modelValue) return\n const sort = getDefaultSort()\n if (sort) emitChange(sort.key, sort.direction)\n },\n { immediate: true },\n)\n</script>\n\n<template>\n <div class=\"ac-component\">\n <div ref=\"wrapperRef\" class=\"ds-sort-wrapper\">\n <button\n type=\"button\"\n class=\"c-btn ds-sort-trigger lh-1\"\n :class=\"[modelValue && 'is-active', disabled && 'is-disabled', isOpen && 'is-open']\"\n :disabled=\"disabled\"\n :aria-label=\"`Rendezés: ${activeLabel}`\"\n @click=\"isOpen = !isOpen\"\n >\n <i\n class=\"fa-solid fa-fw\"\n :class=\"\n !modelValue || modelValue.direction === 'asc'\n ? 'fa-arrow-up-wide-short'\n : 'fa-arrow-down-wide-short'\n \"\n ></i>\n <span class=\"ds-sort-label c-truncate\">{{ activeLabel }}</span>\n <button\n v-if=\"modelValue\"\n type=\"button\"\n class=\"c-icon-btn c-icon-btn--clear ds-sort-clear\"\n aria-label=\"Rendezés törlése\"\n title=\"Rendezés törlése\"\n @click.stop=\"clear\"\n >\n <i class=\"fa-solid fa-fw fa-xmark\"></i>\n </button>\n <span\n class=\"c-icon-btn c-icon-btn--chevron\"\n :class=\"{ 'c-icon-btn--chevron-open': isOpen }\"\n >\n <i class=\"fa-solid fa-fw fa-chevron-down\"></i>\n </span>\n </button>\n\n <Teleport to=\"body\">\n <div class=\"ac-component\">\n <div v-if=\"isOpen\" ref=\"dropdownRef\" class=\"ds-sort-panel\" :style=\"dropdownStyle\">\n\n <div class=\"ds-sort-panel__row\">\n <label class=\"ds-sort-panel__label\">Oszlop</label>\n <DropdownSelect\n :model-value=\"sortBy\"\n :options=\"options\"\n :config=\"{\n clearable: false,\n placeholder: 'Válassz oszlopot...',\n filterable: false,\n }\"\n @update:model-value=\"(v) => (sortBy = v)\"\n />\n </div>\n\n <div class=\"ds-sort-panel__row\">\n <span class=\"ds-sort-panel__label\">Irány</span>\n <div class=\"ds-sort-direction\" role=\"group\" aria-label=\"Rendezés iránya\">\n <button\n type=\"button\"\n class=\"ds-sort-direction__btn\"\n :class=\"{ 'is-active': direction === 'asc' }\"\n :aria-pressed=\"direction === 'asc'\"\n aria-label=\"Növekvő\"\n @click=\"direction = 'asc'\"\n >\n <i class=\"fa-solid fa-fw fa-arrow-up-wide-short\"></i>\n <span>Növekvő</span>\n </button>\n <button\n type=\"button\"\n class=\"ds-sort-direction__btn dir-desc\"\n :class=\"{ 'is-active': direction === 'desc' }\"\n :aria-pressed=\"direction === 'desc'\"\n aria-label=\"Csökkenő\"\n @click=\"direction = 'desc'\"\n >\n <i class=\"fa-solid fa-fw fa-arrow-down-wide-short\"></i>\n <span>Csökkenő</span>\n </button>\n </div>\n </div>\n\n <div class=\"ds-sort-panel__footer\">\n <Button label=\"Rendben\" outline size=\"small\" @click=\"isOpen = false\" />\n </div>\n </div>\n </div>\n </Teleport>\n </div>\n </div>\n</template>\n\n<style lang=\"scss\" src=\"@/styles/components/data-table/data-sort.scss\"></style>\n"],"mappings":""}
|
|
@@ -46,6 +46,5 @@ declare const __VLS_export: import('vue').DefineComponent<DataSortProps, {}, {},
|
|
|
46
46
|
}>, {
|
|
47
47
|
disabled: boolean;
|
|
48
48
|
placeholder: string;
|
|
49
|
-
options: DataSortOption[];
|
|
50
49
|
handleUrl: boolean;
|
|
51
50
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.ac-component .c-cards-wrapper{max-height:var(--data-list-max-height,75dvh);-webkit-overflow-scrolling:touch;position:relative;overflow:auto}.ac-component .c-cards-wrapper.is-loading .c-cards{opacity:.45;transition:opacity .15s ease-out}.ac-component .c-cards-wrapper .c-cards{border-top:2px solid var(--neutral-200);border-bottom:2px solid var(--neutral-200);flex-direction:column;gap:.5rem;padding:.5rem 0;font-size:.875rem;display:flex}.ac-component .c-cards-wrapper .c-cards.is-compact{gap:.25rem}.ac-component .c-cards-wrapper .c-cards.is-compact .c-card__header{--header-padding-y:.375rem}.ac-component .c-cards-wrapper .c-cards.is-compact .c-card__label{font-size:.6rem}.ac-component .c-cards-wrapper .c-cards.is-compact .c-card__field{min-height:unset;padding-top:.5rem;padding-bottom:.375rem}.ac-component .c-cards-wrapper .c-cards.is-compact .c-card__body{row-gap:.5rem;padding-bottom:.5rem}.ac-component .c-cards-wrapper .c-cards.is-compact .c-card__actions{padding-top:0}.ac-component .c-cards-wrapper .c-cards__loading-wrap{border-top:2px solid var(--neutral-200);border-bottom:2px solid var(--neutral-200);justify-content:center;align-items:center;width:100%;padding:2rem;display:flex}.ac-component .c-cards-wrapper .c-cards__backdrop{z-index:1;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);pointer-events:none;background:#fff9;justify-content:center;align-items:center;animation:.15s ease-out c-cards-backdrop-in;display:flex;position:absolute;inset:0}.ac-component .c-cards-wrapper .c-card{border:1px solid var(--neutral-200);background:var(--neutral-0);border-radius:.75rem;transition:border-color .15s,box-shadow .15s}.ac-component .c-cards-wrapper .c-card.is-open{border-color:var(--premium-500)}.ac-component .c-cards-wrapper .c-card.is-open .c-card__header{background:var(--premium-50)}.ac-component .c-cards-wrapper .c-card.is-open .c-card__header:hover{background:var(--premium-100)}.ac-component .c-cards-wrapper .c-card.is-open .c-card__icon{transform:rotate(180deg)}.ac-component .c-cards-wrapper .c-card.is-selected{border-color:var(--premium-400);box-shadow:0 0 0 1px var(--premium-200)}.ac-component .c-cards-wrapper .c-card.is-selected .c-card__header{background:var(--site-100)}.ac-component .c-cards-wrapper .c-card.is-selected .c-card__header:hover{background:var(--site-200)}.ac-component .c-cards-wrapper .c-card__header{--header-padding-y:.75rem;--header-padding-x:.75rem;width:100%;padding:var(--header-padding-y) var(--header-padding-x);border-radius:inherit;background:var(--neutral-50);color:inherit;text-align:left;cursor:pointer;border:0;align-items:center;gap:.5rem;line-height:1.2;transition:background-color .15s;display:flex}.ac-component .c-cards-wrapper .c-card__header:hover{background:var(--premium-100)}.ac-component .c-cards-wrapper .c-card__check-zone{padding:0 .5rem 0 var(--header-padding-x);margin:calc(-1 * var(--header-padding-y)) -.5rem calc(-1 * var(--header-padding-y)) calc(-1 * var(--header-padding-x));align-self:stretch;align-items:center;display:flex}.ac-component .c-cards-wrapper .c-card__check-zone .c-checkbox{width:1.25rem;height:1.25rem}.ac-component .c-cards-wrapper .c-card__heading{flex-direction:row;flex:auto;gap:.5rem;min-width:0;display:flex}.ac-component .c-cards-wrapper .c-card__heading-item{flex-direction:column;flex:1 1 0;min-width:0;display:flex}.ac-component .c-cards-wrapper .c-card__heading-item.primary{flex:2 1 0}.ac-component .c-cards-wrapper .c-card__label{color:var(--neutral-600);text-transform:uppercase;letter-spacing:.03em;font-size:.675rem;font-weight:700}.ac-component .c-cards-wrapper .c-card__title{color:var(--neutral-800);font-size:.85rem;font-weight:600}.ac-component .c-cards-wrapper .c-card__icon{color:var(--neutral-700);font-size:.9rem;transition:transform .2s}.ac-component .c-cards-wrapper .c-card__body{--field-gap-x:.375rem;gap:.75rem var(--field-gap-x);flex-wrap:wrap;padding:.625rem;display:flex;container-type:inline-size}.ac-component .c-cards-wrapper .c-card__field{flex:1 1 calc(50% - .5 * var(--field-gap-x));border:1px solid var(--neutral-200);border-radius:8px;align-items:center;min-height:2.5rem;padding:.5rem;display:flex;position:relative}.ac-component .c-cards-wrapper .c-card__field:hover .c-copy-btn{opacity:1}.ac-component .c-cards-wrapper .c-card__field-value{overflow-wrap:break-word;word-break:break-word;flex:1;font-size:.875rem}.ac-component .c-cards-wrapper .c-card__field-label{letter-spacing:.02em;background:var(--neutral-0);color:var(--neutral-600);padding:0 .125rem;font-size:.7rem;font-weight:700;position:absolute;top:-.5lh;left:.5rem}.ac-component .c-cards-wrapper .c-card__field .c-copy-btn{opacity:0}.ac-component .c-cards-wrapper .c-card__field-copy{background:var(--neutral-0);padding:.125rem;position:absolute;top:-.625lh;right:.375rem}.ac-component .c-cards-wrapper .c-card__field-copy:hover{color:var(--premium-600);background:var(--background-100)}@media (hover:none),(pointer:coarse){.ac-component .c-cards-wrapper .c-card__field:focus-within,.ac-component .c-cards-wrapper .c-card__field:hover{border-color:var(--neutral-300)}.ac-component .c-cards-wrapper .c-card__field:focus-within .c-card__field-copy,.ac-component .c-cards-wrapper .c-card__field:hover .c-card__field-copy{opacity:1}}.ac-component .c-cards-wrapper .c-card__actions{flex-wrap:wrap;flex:100%;justify-content:space-around;align-items:center;gap:.5rem;padding-top:.25rem;display:flex}@keyframes c-cards-backdrop-in{0%{opacity:0}to{opacity:1}}@container (width<=526px){.ac-component .c-cards-wrapper .c-card__field{flex-basis:100%}}
|
|
1
|
+
.ac-component .c-cards-wrapper{max-height:var(--data-list-max-height,75dvh);-webkit-overflow-scrolling:touch;position:relative;overflow:auto}.ac-component .c-cards-wrapper.is-loading{touch-action:none;overflow:hidden}.ac-component .c-cards-wrapper.is-loading .c-cards{opacity:.45;transition:opacity .15s ease-out}.ac-component .c-cards-wrapper .c-cards{border-top:2px solid var(--neutral-200);border-bottom:2px solid var(--neutral-200);flex-direction:column;gap:.5rem;padding:.5rem 0;font-size:.875rem;display:flex}.ac-component .c-cards-wrapper .c-cards.is-compact{gap:.25rem}.ac-component .c-cards-wrapper .c-cards.is-compact .c-card__header{--header-padding-y:.375rem}.ac-component .c-cards-wrapper .c-cards.is-compact .c-card__label{font-size:.6rem}.ac-component .c-cards-wrapper .c-cards.is-compact .c-card__field{min-height:unset;padding-top:.5rem;padding-bottom:.375rem}.ac-component .c-cards-wrapper .c-cards.is-compact .c-card__body{row-gap:.5rem;padding-bottom:.5rem}.ac-component .c-cards-wrapper .c-cards.is-compact .c-card__actions{padding-top:0}.ac-component .c-cards-wrapper .c-cards__loading-wrap{border-top:2px solid var(--neutral-200);border-bottom:2px solid var(--neutral-200);justify-content:center;align-items:center;width:100%;padding:2rem;display:flex}.ac-component .c-cards-wrapper .c-cards__backdrop{z-index:1;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);pointer-events:none;background:#fff9;justify-content:center;align-items:center;animation:.15s ease-out c-cards-backdrop-in;display:flex;position:absolute;inset:0}.ac-component .c-cards-wrapper .c-card{border:1px solid var(--neutral-200);background:var(--neutral-0);border-radius:.75rem;transition:border-color .15s,box-shadow .15s}.ac-component .c-cards-wrapper .c-card.is-open{border-color:var(--premium-500)}.ac-component .c-cards-wrapper .c-card.is-open .c-card__header{background:var(--premium-50)}.ac-component .c-cards-wrapper .c-card.is-open .c-card__header:hover{background:var(--premium-100)}.ac-component .c-cards-wrapper .c-card.is-open .c-card__icon{transform:rotate(180deg)}.ac-component .c-cards-wrapper .c-card.is-selected{border-color:var(--premium-400);box-shadow:0 0 0 1px var(--premium-200)}.ac-component .c-cards-wrapper .c-card.is-selected .c-card__header{background:var(--site-100)}.ac-component .c-cards-wrapper .c-card.is-selected .c-card__header:hover{background:var(--site-200)}.ac-component .c-cards-wrapper .c-card__header{--header-padding-y:.75rem;--header-padding-x:.75rem;width:100%;padding:var(--header-padding-y) var(--header-padding-x);border-radius:inherit;background:var(--neutral-50);color:inherit;text-align:left;cursor:pointer;border:0;align-items:center;gap:.5rem;line-height:1.2;transition:background-color .15s;display:flex}.ac-component .c-cards-wrapper .c-card__header:hover{background:var(--premium-100)}.ac-component .c-cards-wrapper .c-card__check-zone{padding:0 .5rem 0 var(--header-padding-x);margin:calc(-1 * var(--header-padding-y)) -.5rem calc(-1 * var(--header-padding-y)) calc(-1 * var(--header-padding-x));align-self:stretch;align-items:center;display:flex}.ac-component .c-cards-wrapper .c-card__check-zone .c-checkbox{width:1.25rem;height:1.25rem}.ac-component .c-cards-wrapper .c-card__heading{flex-direction:row;flex:auto;gap:.5rem;min-width:0;display:flex}.ac-component .c-cards-wrapper .c-card__heading-item{flex-direction:column;flex:1 1 0;min-width:0;display:flex}.ac-component .c-cards-wrapper .c-card__heading-item.primary{flex:2 1 0}.ac-component .c-cards-wrapper .c-card__label{color:var(--neutral-600);text-transform:uppercase;letter-spacing:.03em;font-size:.675rem;font-weight:700}.ac-component .c-cards-wrapper .c-card__title{color:var(--neutral-800);font-size:.85rem;font-weight:600}.ac-component .c-cards-wrapper .c-card__icon{color:var(--neutral-700);font-size:.9rem;transition:transform .2s}.ac-component .c-cards-wrapper .c-card__body{--field-gap-x:.375rem;gap:.75rem var(--field-gap-x);flex-wrap:wrap;padding:.625rem;display:flex;container-type:inline-size}.ac-component .c-cards-wrapper .c-card__field{flex:1 1 calc(50% - .5 * var(--field-gap-x));border:1px solid var(--neutral-200);border-radius:8px;align-items:center;min-height:2.5rem;padding:.5rem;display:flex;position:relative}.ac-component .c-cards-wrapper .c-card__field:hover .c-copy-btn{opacity:1}.ac-component .c-cards-wrapper .c-card__field-value{overflow-wrap:break-word;word-break:break-word;flex:1;font-size:.875rem}.ac-component .c-cards-wrapper .c-card__field-label{letter-spacing:.02em;background:var(--neutral-0);color:var(--neutral-600);padding:0 .125rem;font-size:.7rem;font-weight:700;position:absolute;top:-.5lh;left:.5rem}.ac-component .c-cards-wrapper .c-card__field .c-copy-btn{opacity:0}.ac-component .c-cards-wrapper .c-card__field-copy{background:var(--neutral-0);padding:.125rem;position:absolute;top:-.625lh;right:.375rem}.ac-component .c-cards-wrapper .c-card__field-copy:hover{color:var(--premium-600);background:var(--background-100)}@media (hover:none),(pointer:coarse){.ac-component .c-cards-wrapper .c-card__field:focus-within,.ac-component .c-cards-wrapper .c-card__field:hover{border-color:var(--neutral-300)}.ac-component .c-cards-wrapper .c-card__field:focus-within .c-card__field-copy,.ac-component .c-cards-wrapper .c-card__field:hover .c-card__field-copy{opacity:1}}.ac-component .c-cards-wrapper .c-card__actions{flex-wrap:wrap;flex:100%;justify-content:space-around;align-items:center;gap:.5rem;padding-top:.25rem;display:flex}@keyframes c-cards-backdrop-in{0%{opacity:0}to{opacity:1}}@container (width<=526px){.ac-component .c-cards-wrapper .c-card__field{flex-basis:100%}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.c-table-wrapper{max-height:var(--data-list-max-height,75dvh);-webkit-overflow-scrolling:touch;position:relative;overflow:auto}.c-table-wrapper .c-table{--cell-padding:.375rem;--action-count:0;border-collapse:collapse;width:100%;min-width:48rem;font-size:.875rem}.c-table-wrapper .c-table thead{z-index:2;background-color:var(--neutral-150);position:sticky;top:0;box-shadow:0 2px 5px -1px #32325d40,0 1px 3px -1px #0000004d}.c-table-wrapper .c-table th,.c-table-wrapper .c-table td{padding:var(--cell-padding);text-align:left;border-bottom:1px solid var(--neutral-200);overflow-wrap:break-word}.c-table-wrapper .c-table .primary-col{
|
|
1
|
+
.c-table-wrapper{--table-col-max-width:clamp(12rem, 10vw, 22rem);--table-primary-col-min-width:clamp(14rem, 33vw, 20rem);--table-primary-col-max-width:clamp(14rem, 28vw, 28rem);max-height:var(--data-list-max-height,75dvh);-webkit-overflow-scrolling:touch;position:relative;overflow:auto}.c-table-wrapper .c-table{--cell-padding:.375rem;--action-count:0;border-collapse:collapse;width:100%;min-width:48rem;font-size:.875rem}.c-table-wrapper .c-table thead{z-index:2;background-color:var(--neutral-150);position:sticky;top:0;box-shadow:0 2px 5px -1px #32325d40,0 1px 3px -1px #0000004d}.c-table-wrapper .c-table th,.c-table-wrapper .c-table td{padding:var(--cell-padding);text-align:left;border-bottom:1px solid var(--neutral-200);overflow-wrap:break-word}.c-table-wrapper .c-table .primary-col{min-width:var(--table-primary-col-min-width);max-width:var(--table-primary-col-max-width);overflow-wrap:anywhere;word-break:break-word}.c-table-wrapper .c-table th.c-sortable{cursor:pointer;-webkit-user-select:none;user-select:none;white-space:nowrap}.c-table-wrapper .c-table th.c-sortable--sorted{color:var(--premium-500)}.c-table-wrapper .c-table th.c-sortable:hover{color:#1e2627}.c-table-wrapper .c-table th .c-sort-icon{color:var(--neutral-400);margin-left:.25rem;transition:color .15s}.c-table-wrapper .c-table th .c-sort-icon--active{color:var(--premium-500)}.c-table-wrapper .c-table td{max-width:var(--table-col-max-width)}.c-table-wrapper .c-table td.is-nowrap{white-space:nowrap}.c-table-wrapper .c-table.is-compact th{padding-top:.5rem;padding-bottom:.5rem}.c-table-wrapper .c-table.is-compact td{padding-top:.1875rem;padding-bottom:.1875rem}.c-table-wrapper .c-table tbody tr.is-striped{background-color:var(--neutral-50)}.c-table-wrapper .c-table tbody tr.is-selected,.c-table-wrapper .c-table tbody tr.is-striped.is-selected{background-color:var(--premium-200)}.c-table-wrapper .c-table tbody .c-table__loading-row,.c-table-wrapper .c-table tbody .c-table__loading-row:hover{background-color:#0000}.c-table-wrapper .c-table tbody .c-table__loading-cell{text-align:center;border-bottom:1px solid var(--neutral-200);padding:2rem}.c-table-wrapper .c-table tbody .c-table__loading-wrap{justify-content:center;align-items:center;width:100%;display:flex}@media (hover:hover) and (pointer:fine){.c-table-wrapper .c-table th.c-sortable:hover .c-sort-icon{color:var(--neutral-700)}.c-table-wrapper .c-table tbody tr:hover,.c-table-wrapper .c-table tbody tr.is-striped:hover{background-color:var(--premium-100)}.c-table-wrapper .c-table tbody tr:hover td,.c-table-wrapper .c-table tbody tr.is-striped:hover td{border-color:var(--premium-400)}.c-table-wrapper .c-table tbody tr.is-selected:hover,.c-table-wrapper .c-table tbody tr.is-striped.is-selected:hover{background-color:var(--premium-300)}}.c-table-wrapper .c-table .c-actions-header{text-align:center}.c-table-wrapper .c-table .c-actions-cell .c-actions-wrap{flex-wrap:wrap;justify-content:center;align-items:baseline;gap:.25rem;display:flex}.c-table-wrapper .c-table__cell{position:relative}@media (hover:none),(pointer:coarse){.c-table-wrapper .c-table__cell{transition:background-color .15s}.c-table-wrapper .c-table__cell:focus-within,.c-table-wrapper .c-table__cell:hover{background-color:#dfefef80}}.c-table-wrapper .c-table__cell .c-copy-btn{opacity:0;position:absolute;top:0;right:0}.c-table-wrapper .c-table__cell:hover .c-copy-btn,.c-table-wrapper .c-table__cell:focus-within .c-copy-btn{opacity:1}.c-table-wrapper .c-table__backdrop{z-index:1;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);pointer-events:none;background:#fff9;justify-content:center;align-items:center;padding-top:3rem;animation:.15s ease-out c-table-backdrop-in;display:flex;position:absolute;inset:0}.c-table-wrapper.is-loading{touch-action:none;overflow:hidden}.c-table-wrapper.is-loading .c-table tbody{opacity:.45;transition:opacity .15s ease-out}@keyframes c-table-backdrop-in{0%{opacity:0}to{opacity:1}}
|