@gsc-basic/components 1.0.1 → 1.0.3
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/README.md +59 -0
- package/dist/es/index.js +48 -30
- package/dist/es/node_modules/@codemirror/autocomplete/dist/index.js +15 -15
- package/dist/es/node_modules/@codemirror/commands/dist/index.js +31 -25
- package/dist/es/node_modules/@codemirror/lang-java/dist/index.js +3 -3
- package/dist/es/node_modules/@codemirror/lang-javascript/dist/index.js +8 -8
- package/dist/es/node_modules/@codemirror/lang-json/dist/index.js +1 -1
- package/dist/es/node_modules/@codemirror/lang-python/dist/index.js +1 -1
- package/dist/es/node_modules/@codemirror/lang-sql/dist/index.js +6 -6
- package/dist/es/node_modules/@codemirror/lang-xml/dist/index.js +3 -3
- package/dist/es/node_modules/@codemirror/lang-yaml/dist/index.js +1 -1
- package/dist/es/node_modules/@codemirror/language/dist/index.js +77 -77
- package/dist/es/node_modules/@codemirror/lint/dist/index.js +7 -7
- package/dist/es/node_modules/@codemirror/search/dist/index.js +432 -465
- package/dist/es/node_modules/@codemirror/state/dist/index.js +272 -268
- package/dist/es/node_modules/@codemirror/view/dist/index.js +1732 -1647
- package/dist/es/node_modules/@lezer/common/dist/index.js +191 -190
- package/dist/es/node_modules/@lezer/lr/dist/index.js +5 -3
- package/dist/es/node_modules/@tanstack/devtools-event-client/dist/esm/plugin.js +178 -0
- package/dist/es/node_modules/@tanstack/form-core/dist/esm/EventClient.js +13 -0
- package/dist/es/node_modules/@tanstack/form-core/dist/esm/FieldApi.js +406 -0
- package/dist/es/node_modules/@tanstack/form-core/dist/esm/FormApi.js +772 -0
- package/dist/es/node_modules/@tanstack/form-core/dist/esm/ValidationLogic.js +55 -0
- package/dist/es/node_modules/@tanstack/form-core/dist/esm/metaHelper.js +109 -0
- package/dist/es/node_modules/@tanstack/form-core/dist/esm/standardSchemaValidator.js +45 -0
- package/dist/es/node_modules/@tanstack/form-core/dist/esm/utils.js +213 -0
- package/dist/es/node_modules/@tanstack/pacer-lite/dist/lite-throttler.js +29 -0
- package/dist/es/node_modules/@tanstack/store/dist/esm/derived.js +74 -0
- package/dist/es/node_modules/@tanstack/store/dist/esm/scheduler.js +79 -0
- package/dist/es/node_modules/@tanstack/store/dist/esm/store.js +21 -0
- package/dist/es/node_modules/@tanstack/store/dist/esm/types.js +6 -0
- package/dist/es/node_modules/@tanstack/table-core/build/lib/index.js +1885 -0
- package/dist/es/node_modules/@tanstack/vue-form/dist/esm/useField.js +38 -0
- package/dist/es/node_modules/@tanstack/vue-form/dist/esm/useForm.js +33 -0
- package/dist/es/node_modules/@tanstack/vue-store/dist/esm/index.js +48 -0
- package/dist/es/node_modules/@tanstack/vue-table/build/lib/index.js +159 -0
- package/dist/es/node_modules/@vueuse/core/dist/index.js +1 -1
- package/dist/es/node_modules/codemirror/dist/index.js +3 -3
- package/dist/es/src/Button/index.js +6 -0
- package/dist/es/src/Button/src/Button.css +1 -0
- package/dist/es/src/Button/src/Button.vue.js +41 -0
- package/dist/es/src/Button/src/Button2.css +1 -0
- package/dist/es/src/CodeEditor/src/index.css +1 -1
- package/dist/es/src/CodeEditor/src/index.vue.js +54 -51
- package/dist/es/src/CodeEditor/src/index2.css +1 -1
- package/dist/es/src/ConfigProvider/index.js +1 -2
- package/dist/es/src/ConfigProvider/src/useGlobalConfig.js +9 -9
- package/dist/es/src/Form/index.js +6 -0
- package/dist/es/src/Form/src/Form.css +1 -0
- package/dist/es/src/Form/src/Form.vue.js +208 -0
- package/dist/es/src/Form/src/styles/form.css +1 -0
- package/dist/es/src/Grid/index.js +6 -0
- package/dist/es/src/Grid/src/Grid.css +1 -0
- package/dist/es/src/Grid/src/Grid.vue.js +180 -0
- package/dist/es/src/Grid/src/components/ActionBar.css +1 -0
- package/dist/es/src/Grid/src/components/ActionBar.vue.js +65 -0
- package/dist/es/src/Grid/src/components/CellEditor.css +1 -0
- package/dist/es/src/Grid/src/components/CellEditor.vue.js +132 -0
- package/dist/es/src/Grid/src/components/CellEditor2.css +1 -0
- package/dist/es/src/Grid/src/components/ColumnFilter.css +1 -0
- package/dist/es/src/Grid/src/components/ColumnFilter.vue.js +72 -0
- package/dist/es/src/Grid/src/components/ColumnSettings.css +1 -0
- package/dist/es/src/Grid/src/components/ColumnSettings.vue.js +109 -0
- package/dist/es/src/Grid/src/components/DataTable.css +1 -0
- package/dist/es/src/Grid/src/components/DataTable.vue.js +556 -0
- package/dist/es/src/Grid/src/components/Pager.css +1 -0
- package/dist/es/src/Grid/src/components/Pager.vue.js +64 -0
- package/dist/es/src/Grid/src/components/QueryBar.css +1 -0
- package/dist/es/src/Grid/src/components/QueryBar.vue.js +156 -0
- package/dist/es/src/Grid/src/composables/useCellEditor.js +20 -0
- package/dist/es/src/Grid/src/composables/useGridTable.js +213 -0
- package/dist/es/src/Grid/src/styles/table.css +1 -0
- package/dist/es/src/Overlay/index.js +61 -0
- package/dist/es/src/Overlay/src/Message.css +1 -0
- package/dist/es/src/Overlay/src/Message.vue.js +36 -0
- package/dist/es/src/Overlay/src/Message2.css +1 -0
- package/dist/es/src/Overlay/src/Modal.css +1 -0
- package/dist/es/src/Overlay/src/Modal.vue.js +67 -0
- package/dist/es/src/Overlay/src/Modal2.css +1 -0
- package/dist/es/src/Overlay/src/Notice.css +1 -0
- package/dist/es/src/Overlay/src/Notice.vue.js +37 -0
- package/dist/es/src/Overlay/src/Notice2.css +1 -0
- package/dist/es/src/ScaleScreen/src/index.vue.js +2 -2
- package/dist/es/src/VideoBackground/src/index.vue.js +8 -8
- package/dist/es/src/index.js +35 -19
- package/dist/es/src/locale/lang/en-US.js +40 -0
- package/dist/es/src/locale/lang/ja-JP.js +42 -2
- package/dist/es/src/locale/lang/zh-CN.js +42 -2
- package/dist/es/src/styles/tokens.css +1 -1
- package/dist/lib/index.js +1 -1
- package/dist/lib/node_modules/@codemirror/commands/dist/index.js +1 -1
- package/dist/lib/node_modules/@codemirror/language/dist/index.js +1 -1
- package/dist/lib/node_modules/@codemirror/search/dist/index.js +2 -2
- package/dist/lib/node_modules/@codemirror/state/dist/index.js +4 -4
- package/dist/lib/node_modules/@codemirror/view/dist/index.js +5 -5
- package/dist/lib/node_modules/@lezer/common/dist/index.js +1 -1
- package/dist/lib/node_modules/@lezer/lr/dist/index.js +1 -1
- package/dist/lib/node_modules/@tanstack/devtools-event-client/dist/esm/plugin.js +1 -0
- package/dist/lib/node_modules/@tanstack/form-core/dist/esm/EventClient.js +1 -0
- package/dist/lib/node_modules/@tanstack/form-core/dist/esm/FieldApi.js +1 -0
- package/dist/lib/node_modules/@tanstack/form-core/dist/esm/FormApi.js +1 -0
- package/dist/lib/node_modules/@tanstack/form-core/dist/esm/ValidationLogic.js +1 -0
- package/dist/lib/node_modules/@tanstack/form-core/dist/esm/metaHelper.js +1 -0
- package/dist/lib/node_modules/@tanstack/form-core/dist/esm/standardSchemaValidator.js +1 -0
- package/dist/lib/node_modules/@tanstack/form-core/dist/esm/utils.js +1 -0
- package/dist/lib/node_modules/@tanstack/pacer-lite/dist/lite-throttler.js +1 -0
- package/dist/lib/node_modules/@tanstack/store/dist/esm/derived.js +1 -0
- package/dist/lib/node_modules/@tanstack/store/dist/esm/scheduler.js +1 -0
- package/dist/lib/node_modules/@tanstack/store/dist/esm/store.js +1 -0
- package/dist/lib/node_modules/@tanstack/store/dist/esm/types.js +1 -0
- package/dist/lib/node_modules/@tanstack/table-core/build/lib/index.js +4 -0
- package/dist/lib/node_modules/@tanstack/vue-form/dist/esm/useField.js +1 -0
- package/dist/lib/node_modules/@tanstack/vue-form/dist/esm/useForm.js +1 -0
- package/dist/lib/node_modules/@tanstack/vue-store/dist/esm/index.js +1 -0
- package/dist/lib/node_modules/@tanstack/vue-table/build/lib/index.js +1 -0
- package/dist/lib/src/Button/index.js +1 -0
- package/dist/lib/src/Button/src/Button.css +1 -0
- package/dist/lib/src/Button/src/Button.vue.js +1 -0
- package/dist/lib/src/Button/src/Button2.css +1 -0
- package/dist/lib/src/CodeEditor/src/index.css +1 -1
- package/dist/lib/src/CodeEditor/src/index.vue.js +1 -1
- package/dist/lib/src/CodeEditor/src/index2.css +1 -1
- package/dist/lib/src/ConfigProvider/index.js +1 -1
- package/dist/lib/src/Form/index.js +1 -0
- package/dist/lib/src/Form/src/Form.css +1 -0
- package/dist/lib/src/Form/src/Form.vue.js +1 -0
- package/dist/lib/src/Form/src/styles/form.css +1 -0
- package/dist/lib/src/Grid/index.js +1 -0
- package/dist/lib/src/Grid/src/Grid.css +1 -0
- package/dist/lib/src/Grid/src/Grid.vue.js +1 -0
- package/dist/lib/src/Grid/src/components/ActionBar.css +1 -0
- package/dist/lib/src/Grid/src/components/ActionBar.vue.js +1 -0
- package/dist/lib/src/Grid/src/components/CellEditor.css +1 -0
- package/dist/lib/src/Grid/src/components/CellEditor.vue.js +1 -0
- package/dist/lib/src/Grid/src/components/CellEditor2.css +1 -0
- package/dist/lib/src/Grid/src/components/ColumnFilter.css +1 -0
- package/dist/lib/src/Grid/src/components/ColumnFilter.vue.js +1 -0
- package/dist/lib/src/Grid/src/components/ColumnSettings.css +1 -0
- package/dist/lib/src/Grid/src/components/ColumnSettings.vue.js +1 -0
- package/dist/lib/src/Grid/src/components/DataTable.css +1 -0
- package/dist/lib/src/Grid/src/components/DataTable.vue.js +1 -0
- package/dist/lib/src/Grid/src/components/Pager.css +1 -0
- package/dist/lib/src/Grid/src/components/Pager.vue.js +1 -0
- package/dist/lib/src/Grid/src/components/QueryBar.css +1 -0
- package/dist/lib/src/Grid/src/components/QueryBar.vue.js +1 -0
- package/dist/lib/src/Grid/src/composables/useCellEditor.js +1 -0
- package/dist/lib/src/Grid/src/composables/useGridTable.js +1 -0
- package/dist/lib/src/Grid/src/styles/table.css +1 -0
- package/dist/lib/src/Overlay/index.js +1 -0
- package/dist/lib/src/Overlay/src/Message.css +1 -0
- package/dist/lib/src/Overlay/src/Message.vue.js +1 -0
- package/dist/lib/src/Overlay/src/Message2.css +1 -0
- package/dist/lib/src/Overlay/src/Modal.css +1 -0
- package/dist/lib/src/Overlay/src/Modal.vue.js +1 -0
- package/dist/lib/src/Overlay/src/Modal2.css +1 -0
- package/dist/lib/src/Overlay/src/Notice.css +1 -0
- package/dist/lib/src/Overlay/src/Notice.vue.js +1 -0
- package/dist/lib/src/Overlay/src/Notice2.css +1 -0
- package/dist/lib/src/index.js +1 -1
- package/dist/lib/src/locale/lang/en-US.js +1 -1
- package/dist/lib/src/locale/lang/ja-JP.js +1 -1
- package/dist/lib/src/locale/lang/zh-CN.js +1 -1
- package/dist/lib/src/styles/tokens.css +1 -1
- package/package.json +11 -8
|
@@ -0,0 +1,556 @@
|
|
|
1
|
+
import { computed as m, ref as A, reactive as Se, onMounted as Te, onBeforeUnmount as Oe, watch as Pe, openBlock as i, createElementBlock as s, normalizeStyle as p, createElementVNode as c, Fragment as x, renderList as b, createCommentVNode as u, withModifiers as k, normalizeClass as _e, unref as a, createBlock as h, toDisplayString as M, withCtx as H, renderSlot as Ae, createVNode as we, createTextVNode as He } from "vue";
|
|
2
|
+
import { FlexRender as V } from "../../../../node_modules/@tanstack/vue-table/build/lib/index.js";
|
|
3
|
+
import De from "./ColumnFilter.vue.js";
|
|
4
|
+
import $e from "./CellEditor.vue.js";
|
|
5
|
+
import { useLocale as Be } from "../../../hooks/useLocale.js";
|
|
6
|
+
import { GscButton as B } from "../../../Button/index.js";
|
|
7
|
+
import './DataTable.css';/* empty css */
|
|
8
|
+
import Le from "../../../../_virtual/_plugin-vue_export-helper.js";
|
|
9
|
+
const Ue = { class: "w-full" }, Ge = { class: "gsc-table" }, Ne = { class: "gsc-thead sticky top-0 z-10" }, We = ["checked", ".indeterminate"], Ke = ["onDrop"], je = { class: "flex items-center gap-2 min-w-0" }, qe = ["onClick"], Je = ["title", "onDragstart"], Qe = { class: "truncate" }, Xe = {
|
|
10
|
+
key: 0,
|
|
11
|
+
class: "text-[rgba(0,0,0,0.45)] text-xs"
|
|
12
|
+
}, Ye = ["onMousedown"], Ze = ["checked", "onChange"], et = ["onDblclick"], tt = {
|
|
13
|
+
key: 1,
|
|
14
|
+
class: "flex items-start gap-2"
|
|
15
|
+
}, nt = { class: "min-w-0 flex-1" }, ot = {
|
|
16
|
+
key: 1,
|
|
17
|
+
class: "break-words"
|
|
18
|
+
}, lt = { key: 0 }, it = ["colspan"], st = {
|
|
19
|
+
key: 1,
|
|
20
|
+
class: "w-full"
|
|
21
|
+
}, ct = { class: "gsc-table" }, rt = { class: "gsc-thead sticky top-0 z-10" }, ut = ["checked", ".indeterminate"], at = ["onDrop"], dt = { class: "flex items-center gap-2 min-w-0" }, gt = ["onClick"], mt = ["title", "onDragstart"], pt = { class: "truncate" }, ft = {
|
|
22
|
+
key: 0,
|
|
23
|
+
class: "text-[rgba(0,0,0,0.45)] text-xs"
|
|
24
|
+
}, vt = ["onMousedown"], yt = { class: "gsc-table" }, ht = ["checked", "onChange"], xt = ["onDblclick"], bt = {
|
|
25
|
+
key: 1,
|
|
26
|
+
class: "break-words"
|
|
27
|
+
}, kt = { key: 0 }, Ct = ["colspan"], R = 44, St = 6, _t = {
|
|
28
|
+
__name: "DataTable",
|
|
29
|
+
props: {
|
|
30
|
+
table: { type: Object, required: !0 },
|
|
31
|
+
mode: { type: String, default: "server" },
|
|
32
|
+
loading: { type: Boolean, default: !1 },
|
|
33
|
+
virtual: { type: Boolean, default: !1 },
|
|
34
|
+
height: { type: [Number, String], default: 400 },
|
|
35
|
+
rowHeight: { type: Number, default: 40 },
|
|
36
|
+
enableRowSelection: { type: Boolean, default: !1 }
|
|
37
|
+
},
|
|
38
|
+
emits: [
|
|
39
|
+
"selection-change",
|
|
40
|
+
"cell-change",
|
|
41
|
+
"server-filter-change"
|
|
42
|
+
],
|
|
43
|
+
setup(f, { emit: Re }) {
|
|
44
|
+
const d = f, I = Re, { t: v } = Be(), g = m(() => d.table), L = m(() => {
|
|
45
|
+
try {
|
|
46
|
+
return g.value.getHeaderGroups?.() || [];
|
|
47
|
+
} catch {
|
|
48
|
+
return [];
|
|
49
|
+
}
|
|
50
|
+
}), z = m(() => {
|
|
51
|
+
try {
|
|
52
|
+
return g.value.getRowModel?.().rows || [];
|
|
53
|
+
} catch {
|
|
54
|
+
return [];
|
|
55
|
+
}
|
|
56
|
+
}), U = m(() => (g.value.getVisibleLeafColumns?.() || []).length + (d.enableRowSelection ? 1 : 0));
|
|
57
|
+
function G(t) {
|
|
58
|
+
const n = t.getIsSorted?.();
|
|
59
|
+
return n === "asc" ? "↑" : n === "desc" ? "↓" : "";
|
|
60
|
+
}
|
|
61
|
+
function N(t, n) {
|
|
62
|
+
const o = n.column;
|
|
63
|
+
if (!o.getCanSort?.())
|
|
64
|
+
return;
|
|
65
|
+
const e = !!t?.shiftKey;
|
|
66
|
+
o.toggleSorting?.(void 0, e);
|
|
67
|
+
}
|
|
68
|
+
const C = A(null);
|
|
69
|
+
function W(t, n) {
|
|
70
|
+
C.value = n?.id ?? null;
|
|
71
|
+
try {
|
|
72
|
+
t.dataTransfer.effectAllowed = "move", t.dataTransfer.setData("text/plain", String(n?.id ?? ""));
|
|
73
|
+
} catch {
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
function $(t) {
|
|
77
|
+
const n = t?.getIsPinned?.();
|
|
78
|
+
return n === "left" ? "left" : n === "right" ? "right" : "center";
|
|
79
|
+
}
|
|
80
|
+
function E(t, n, o) {
|
|
81
|
+
const e = t.indexOf(n), l = t.indexOf(o);
|
|
82
|
+
if (e === -1 || l === -1 || e === l)
|
|
83
|
+
return t;
|
|
84
|
+
const D = t.slice();
|
|
85
|
+
return D.splice(e, 1), D.splice(l, 0, n), D;
|
|
86
|
+
}
|
|
87
|
+
function K(t, n) {
|
|
88
|
+
const o = n?.id;
|
|
89
|
+
let e = C.value;
|
|
90
|
+
try {
|
|
91
|
+
const r = t.dataTransfer.getData("text/plain");
|
|
92
|
+
r && (e = r);
|
|
93
|
+
} catch {
|
|
94
|
+
}
|
|
95
|
+
if (!e || !o || e === o) {
|
|
96
|
+
C.value = null;
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
const l = (g.value.getAllLeafColumns?.() || []).filter(Boolean), D = l.find((r) => r.id === e), ve = l.find((r) => r.id === o);
|
|
100
|
+
if (!D || !ve) {
|
|
101
|
+
C.value = null;
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
const P = $(D), Fe = $(ve);
|
|
105
|
+
if (P !== Fe) {
|
|
106
|
+
C.value = null;
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
const ye = l.filter((r) => $(r) === "left").map((r) => r.id), he = l.filter((r) => $(r) === "center").map((r) => r.id), xe = l.filter((r) => $(r) === "right").map((r) => r.id);
|
|
110
|
+
let be = ye, ke = he, Ce = xe;
|
|
111
|
+
P === "left" ? be = E(ye, e, o) : P === "right" ? Ce = E(xe, e, o) : ke = E(he, e, o), g.value.setColumnOrder?.([...be, ...ke, ...Ce]), C.value = null;
|
|
112
|
+
}
|
|
113
|
+
function j(t) {
|
|
114
|
+
const n = t.getIsPinned?.();
|
|
115
|
+
return n === "left" ? { position: "sticky", left: `${(t.getStart?.("left") ?? 0) + (d.enableRowSelection ? R : 0)}px`, zIndex: 2 } : n === "right" ? { position: "sticky", right: `${t.getAfter?.("right") ?? 0}px`, zIndex: 2 } : {};
|
|
116
|
+
}
|
|
117
|
+
const q = m(() => d.enableRowSelection ? {
|
|
118
|
+
width: `${R}px`,
|
|
119
|
+
minWidth: `${R}px`,
|
|
120
|
+
position: "sticky",
|
|
121
|
+
left: "0px",
|
|
122
|
+
zIndex: 4
|
|
123
|
+
} : {}), J = m(() => d.enableRowSelection ? {
|
|
124
|
+
width: `${R}px`,
|
|
125
|
+
minWidth: `${R}px`,
|
|
126
|
+
position: "sticky",
|
|
127
|
+
left: "0px",
|
|
128
|
+
zIndex: 3
|
|
129
|
+
} : {}), Ie = m(() => {
|
|
130
|
+
if (d.virtual)
|
|
131
|
+
return {};
|
|
132
|
+
const t = d.height;
|
|
133
|
+
return t == null || t === "" ? {} : typeof t == "number" ? { height: `${t}px`, overflow: "auto" } : t === "auto" || t === "100%" ? { height: "100%", overflow: "auto" } : { height: String(t), overflow: "auto" };
|
|
134
|
+
});
|
|
135
|
+
function Q(t) {
|
|
136
|
+
const n = t.column, o = t.getSize?.();
|
|
137
|
+
return {
|
|
138
|
+
width: o ? `${o}px` : void 0,
|
|
139
|
+
minWidth: n.columnDef?.minSize ? `${n.columnDef.minSize}px` : void 0,
|
|
140
|
+
position: "relative",
|
|
141
|
+
...j(n)
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
function X(t) {
|
|
145
|
+
const n = t.column, o = n.getSize?.();
|
|
146
|
+
return {
|
|
147
|
+
width: o ? `${o}px` : void 0,
|
|
148
|
+
minWidth: n.columnDef?.minSize ? `${n.columnDef.minSize}px` : void 0,
|
|
149
|
+
...j(n)
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
const y = A(null), S = Se({});
|
|
153
|
+
function Y(t) {
|
|
154
|
+
const n = t?.columnDef?.meta?.col;
|
|
155
|
+
return !!(n?.filterable || n?.filterType || n?.filterOptions);
|
|
156
|
+
}
|
|
157
|
+
function Z(t) {
|
|
158
|
+
return t?.columnDef?.meta?.col?.filterType || "text";
|
|
159
|
+
}
|
|
160
|
+
function ee(t) {
|
|
161
|
+
return t?.columnDef?.meta?.col?.filterOptions || [];
|
|
162
|
+
}
|
|
163
|
+
function te(t) {
|
|
164
|
+
y.value = y.value === t ? null : t;
|
|
165
|
+
}
|
|
166
|
+
function ne(t, n) {
|
|
167
|
+
S[t] = n;
|
|
168
|
+
}
|
|
169
|
+
function oe(t) {
|
|
170
|
+
if (d.mode === "server") {
|
|
171
|
+
I("server-filter-change", { key: t, value: S[t] }), y.value = null;
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
g.value.getColumn?.(t)?.setFilterValue?.(S[t]), y.value = null;
|
|
175
|
+
}
|
|
176
|
+
function le(t) {
|
|
177
|
+
if (S[t] = "", d.mode === "server") {
|
|
178
|
+
I("server-filter-change", { key: t, value: "" }), y.value = null;
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
g.value.getColumn?.(t)?.setFilterValue?.(""), y.value = null;
|
|
182
|
+
}
|
|
183
|
+
function ie() {
|
|
184
|
+
y.value = null;
|
|
185
|
+
}
|
|
186
|
+
Te(() => {
|
|
187
|
+
document.addEventListener("click", ie);
|
|
188
|
+
}), Oe(() => {
|
|
189
|
+
document.removeEventListener("click", ie);
|
|
190
|
+
}), Pe(
|
|
191
|
+
() => g.value.getState?.().rowSelection,
|
|
192
|
+
() => {
|
|
193
|
+
if (d.enableRowSelection)
|
|
194
|
+
try {
|
|
195
|
+
const t = g.value.getSelectedRowModel?.().rows || [];
|
|
196
|
+
I("selection-change", t.map((n) => n.original));
|
|
197
|
+
} catch {
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
{ deep: !0 }
|
|
201
|
+
);
|
|
202
|
+
const _ = Se({});
|
|
203
|
+
function w(t, n) {
|
|
204
|
+
return `${t.id}::${n.id}`;
|
|
205
|
+
}
|
|
206
|
+
function se(t) {
|
|
207
|
+
return !!t?.columnDef?.meta?.col?.editor;
|
|
208
|
+
}
|
|
209
|
+
function ce(t) {
|
|
210
|
+
const n = t?.columnDef?.meta?.col;
|
|
211
|
+
return !n?.editor || n.editor === "input" ? "text" : n.editor;
|
|
212
|
+
}
|
|
213
|
+
function re(t) {
|
|
214
|
+
return t?.columnDef?.meta?.col?.options || [];
|
|
215
|
+
}
|
|
216
|
+
function F(t, n) {
|
|
217
|
+
if (!se(n))
|
|
218
|
+
return;
|
|
219
|
+
const o = w(t, n);
|
|
220
|
+
_[o] = t.original?.[n.id];
|
|
221
|
+
}
|
|
222
|
+
function T(t, n) {
|
|
223
|
+
const o = w(t, n);
|
|
224
|
+
return Object.prototype.hasOwnProperty.call(_, o);
|
|
225
|
+
}
|
|
226
|
+
function ue(t, n) {
|
|
227
|
+
const o = w(t, n);
|
|
228
|
+
return _[o];
|
|
229
|
+
}
|
|
230
|
+
function ae(t, n, o) {
|
|
231
|
+
const e = w(t, n);
|
|
232
|
+
_[e] = o;
|
|
233
|
+
}
|
|
234
|
+
function de(t, n) {
|
|
235
|
+
const o = w(t, n);
|
|
236
|
+
delete _[o];
|
|
237
|
+
}
|
|
238
|
+
function ge(t, n, o) {
|
|
239
|
+
const e = w(t, n);
|
|
240
|
+
try {
|
|
241
|
+
t.original[n.id] = o;
|
|
242
|
+
} catch {
|
|
243
|
+
}
|
|
244
|
+
I("cell-change", { row: t.original, rowId: t.id, column: n.id, value: o }), delete _[e];
|
|
245
|
+
}
|
|
246
|
+
const me = A(0);
|
|
247
|
+
function ze(t) {
|
|
248
|
+
me.value = t.target.scrollTop || 0;
|
|
249
|
+
}
|
|
250
|
+
const Me = m(() => Math.ceil(d.height / d.rowHeight) + St), O = m(() => Math.max(0, Math.floor((me.value || 0) / d.rowHeight))), pe = m(() => O.value + Me.value), fe = m(() => z.value.slice(O.value, pe.value)), Ve = m(() => O.value * d.rowHeight), Ee = m(() => Math.max(0, (z.value.length - pe.value) * d.rowHeight));
|
|
251
|
+
return (t, n) => (i(), s("div", Ue, [
|
|
252
|
+
f.virtual ? (i(), s("div", st, [
|
|
253
|
+
c("table", ct, [
|
|
254
|
+
c("thead", rt, [
|
|
255
|
+
(i(!0), s(x, null, b(L.value, (o) => (i(), s("tr", {
|
|
256
|
+
key: o.id
|
|
257
|
+
}, [
|
|
258
|
+
f.enableRowSelection ? (i(), s("th", {
|
|
259
|
+
key: 0,
|
|
260
|
+
class: "gsc-th text-center",
|
|
261
|
+
style: p(q.value)
|
|
262
|
+
}, [
|
|
263
|
+
c("input", {
|
|
264
|
+
type: "checkbox",
|
|
265
|
+
class: "gsc-checkbox",
|
|
266
|
+
checked: g.value.getIsAllPageRowsSelected?.(),
|
|
267
|
+
".indeterminate": g.value.getIsSomePageRowsSelected?.(),
|
|
268
|
+
onChange: n[2] || (n[2] = (e) => g.value.toggleAllPageRowsSelected?.(!!e.target.checked))
|
|
269
|
+
}, null, 40, ut)
|
|
270
|
+
], 4)) : u("", !0),
|
|
271
|
+
(i(!0), s(x, null, b(o.headers, (e) => (i(), s("th", {
|
|
272
|
+
key: e.id,
|
|
273
|
+
class: "gsc-th",
|
|
274
|
+
style: p(Q(e)),
|
|
275
|
+
onDragover: n[3] || (n[3] = k(() => {
|
|
276
|
+
}, ["prevent"])),
|
|
277
|
+
onDrop: (l) => K(l, e.column)
|
|
278
|
+
}, [
|
|
279
|
+
c("div", dt, [
|
|
280
|
+
c("div", {
|
|
281
|
+
class: _e(["flex items-center gap-1 min-w-0", e.column.getCanSort?.() ? "cursor-pointer" : ""]),
|
|
282
|
+
onClick: (l) => N(l, e)
|
|
283
|
+
}, [
|
|
284
|
+
c("span", {
|
|
285
|
+
class: "text-[rgba(0,0,0,0.25)] hover:text-[rgba(0,0,0,0.45)] cursor-grab select-none",
|
|
286
|
+
title: a(v)("gsc.grid.table.dragReorder"),
|
|
287
|
+
draggable: "true",
|
|
288
|
+
onDragstart: (l) => W(l, e.column)
|
|
289
|
+
}, " ⋮⋮ ", 40, mt),
|
|
290
|
+
c("span", pt, [
|
|
291
|
+
e.isPlaceholder ? u("", !0) : (i(), h(a(V), {
|
|
292
|
+
key: 0,
|
|
293
|
+
render: e.column.columnDef.header,
|
|
294
|
+
props: e.getContext()
|
|
295
|
+
}, null, 8, ["render", "props"]))
|
|
296
|
+
]),
|
|
297
|
+
e.column.getCanSort?.() ? (i(), s("span", ft, M(G(e.column)), 1)) : u("", !0)
|
|
298
|
+
], 10, gt),
|
|
299
|
+
Y(e.column) ? (i(), h(a(B), {
|
|
300
|
+
key: 0,
|
|
301
|
+
type: "button",
|
|
302
|
+
variant: "text",
|
|
303
|
+
size: "icon",
|
|
304
|
+
class: "ml-auto gsc-btn-icon-sm",
|
|
305
|
+
title: a(v)("gsc.grid.table.filter"),
|
|
306
|
+
"aria-label": a(v)("gsc.grid.table.filter"),
|
|
307
|
+
onClick: k((l) => te(e.column.id), ["stop"])
|
|
308
|
+
}, {
|
|
309
|
+
default: H(() => [...n[6] || (n[6] = [
|
|
310
|
+
c("i", {
|
|
311
|
+
class: "i-material-symbols:filter-alt-outline",
|
|
312
|
+
"aria-hidden": "true"
|
|
313
|
+
}, null, -1)
|
|
314
|
+
])]),
|
|
315
|
+
_: 1
|
|
316
|
+
}, 8, ["title", "aria-label", "onClick"])) : u("", !0)
|
|
317
|
+
]),
|
|
318
|
+
y.value === e.column.id ? (i(), h(De, {
|
|
319
|
+
key: 0,
|
|
320
|
+
value: S[e.column.id],
|
|
321
|
+
type: Z(e.column),
|
|
322
|
+
options: ee(e.column),
|
|
323
|
+
"onUpdate:value": (l) => ne(e.column.id, l),
|
|
324
|
+
onApply: (l) => oe(e.column.id),
|
|
325
|
+
onClear: (l) => le(e.column.id)
|
|
326
|
+
}, null, 8, ["value", "type", "options", "onUpdate:value", "onApply", "onClear"])) : u("", !0),
|
|
327
|
+
e.column.getCanResize?.() ? (i(), s("div", {
|
|
328
|
+
key: 1,
|
|
329
|
+
class: "absolute right-0 top-0 h-full w-2 cursor-col-resize",
|
|
330
|
+
onMousedown: k((l) => e.getResizeHandler?.()(l), ["prevent"])
|
|
331
|
+
}, null, 40, vt)) : u("", !0)
|
|
332
|
+
], 44, at))), 128))
|
|
333
|
+
]))), 128))
|
|
334
|
+
])
|
|
335
|
+
]),
|
|
336
|
+
c("div", {
|
|
337
|
+
class: "overflow-auto",
|
|
338
|
+
style: p({ height: `${f.height}px` }),
|
|
339
|
+
onScroll: ze
|
|
340
|
+
}, [
|
|
341
|
+
c("div", {
|
|
342
|
+
style: p({ height: `${Ve.value}px` })
|
|
343
|
+
}, null, 4),
|
|
344
|
+
c("table", yt, [
|
|
345
|
+
c("tbody", null, [
|
|
346
|
+
(i(!0), s(x, null, b(fe.value, (o) => (i(), s("tr", {
|
|
347
|
+
key: o.id,
|
|
348
|
+
class: "gsc-tr",
|
|
349
|
+
style: p({ height: `${f.rowHeight}px` })
|
|
350
|
+
}, [
|
|
351
|
+
f.enableRowSelection ? (i(), s("td", {
|
|
352
|
+
key: 0,
|
|
353
|
+
class: "gsc-td text-center",
|
|
354
|
+
style: p(J.value)
|
|
355
|
+
}, [
|
|
356
|
+
c("input", {
|
|
357
|
+
type: "checkbox",
|
|
358
|
+
class: "gsc-checkbox",
|
|
359
|
+
checked: o.getIsSelected?.(),
|
|
360
|
+
onChange: (e) => o.toggleSelected?.(!!e.target.checked)
|
|
361
|
+
}, null, 40, ht)
|
|
362
|
+
], 4)) : u("", !0),
|
|
363
|
+
(i(!0), s(x, null, b(o.getVisibleCells(), (e) => (i(), s("td", {
|
|
364
|
+
key: e.id,
|
|
365
|
+
class: "gsc-td align-top",
|
|
366
|
+
style: p(X(e)),
|
|
367
|
+
onDblclick: (l) => F(o, e.column)
|
|
368
|
+
}, [
|
|
369
|
+
T(o, e.column) ? (i(), h($e, {
|
|
370
|
+
key: 0,
|
|
371
|
+
"model-value": ue(o, e.column),
|
|
372
|
+
type: ce(e.column),
|
|
373
|
+
options: re(e.column),
|
|
374
|
+
onUpdateModelValue: (l) => ae(o, e.column, l),
|
|
375
|
+
onCommit: (l) => ge(o, e.column, l),
|
|
376
|
+
onCancel: (l) => de(o, e.column)
|
|
377
|
+
}, null, 8, ["model-value", "type", "options", "onUpdateModelValue", "onCommit", "onCancel"])) : (i(), s("span", bt, [
|
|
378
|
+
we(a(V), {
|
|
379
|
+
render: e.column.columnDef.cell,
|
|
380
|
+
props: e.getContext()
|
|
381
|
+
}, null, 8, ["render", "props"])
|
|
382
|
+
]))
|
|
383
|
+
], 44, xt))), 128))
|
|
384
|
+
], 4))), 128)),
|
|
385
|
+
fe.value.length === 0 ? (i(), s("tr", kt, [
|
|
386
|
+
c("td", {
|
|
387
|
+
colspan: U.value,
|
|
388
|
+
class: "px-3 py-10 text-center text-sm text-[rgba(0,0,0,0.45)]"
|
|
389
|
+
}, M(f.loading ? a(v)("gsc.grid.table.loading") : a(v)("gsc.grid.table.empty")), 9, Ct)
|
|
390
|
+
])) : u("", !0)
|
|
391
|
+
])
|
|
392
|
+
]),
|
|
393
|
+
c("div", {
|
|
394
|
+
style: p({ height: `${Ee.value}px` })
|
|
395
|
+
}, null, 4)
|
|
396
|
+
], 36)
|
|
397
|
+
])) : (i(), s("div", {
|
|
398
|
+
key: 0,
|
|
399
|
+
class: "overflow-auto",
|
|
400
|
+
style: p(Ie.value)
|
|
401
|
+
}, [
|
|
402
|
+
c("table", Ge, [
|
|
403
|
+
c("thead", Ne, [
|
|
404
|
+
(i(!0), s(x, null, b(L.value, (o) => (i(), s("tr", {
|
|
405
|
+
key: o.id
|
|
406
|
+
}, [
|
|
407
|
+
f.enableRowSelection ? (i(), s("th", {
|
|
408
|
+
key: 0,
|
|
409
|
+
class: "gsc-th text-center",
|
|
410
|
+
style: p(q.value)
|
|
411
|
+
}, [
|
|
412
|
+
c("input", {
|
|
413
|
+
type: "checkbox",
|
|
414
|
+
class: "gsc-checkbox",
|
|
415
|
+
checked: g.value.getIsAllPageRowsSelected?.(),
|
|
416
|
+
".indeterminate": g.value.getIsSomePageRowsSelected?.(),
|
|
417
|
+
onChange: n[0] || (n[0] = (e) => g.value.toggleAllPageRowsSelected?.(!!e.target.checked))
|
|
418
|
+
}, null, 40, We)
|
|
419
|
+
], 4)) : u("", !0),
|
|
420
|
+
(i(!0), s(x, null, b(o.headers, (e) => (i(), s("th", {
|
|
421
|
+
key: e.id,
|
|
422
|
+
class: "gsc-th",
|
|
423
|
+
style: p(Q(e)),
|
|
424
|
+
onDragover: n[1] || (n[1] = k(() => {
|
|
425
|
+
}, ["prevent"])),
|
|
426
|
+
onDrop: (l) => K(l, e.column)
|
|
427
|
+
}, [
|
|
428
|
+
c("div", je, [
|
|
429
|
+
c("div", {
|
|
430
|
+
class: _e(["flex items-center gap-1 min-w-0", e.column.getCanSort?.() ? "cursor-pointer" : ""]),
|
|
431
|
+
onClick: (l) => N(l, e)
|
|
432
|
+
}, [
|
|
433
|
+
c("span", {
|
|
434
|
+
class: "text-[rgba(0,0,0,0.25)] hover:text-[rgba(0,0,0,0.45)] cursor-grab select-none",
|
|
435
|
+
title: a(v)("gsc.grid.table.dragReorder"),
|
|
436
|
+
draggable: "true",
|
|
437
|
+
onDragstart: (l) => W(l, e.column)
|
|
438
|
+
}, " ⋮⋮ ", 40, Je),
|
|
439
|
+
c("span", Qe, [
|
|
440
|
+
e.isPlaceholder ? u("", !0) : (i(), h(a(V), {
|
|
441
|
+
key: 0,
|
|
442
|
+
render: e.column.columnDef.header,
|
|
443
|
+
props: e.getContext()
|
|
444
|
+
}, null, 8, ["render", "props"]))
|
|
445
|
+
]),
|
|
446
|
+
e.column.getCanSort?.() ? (i(), s("span", Xe, M(G(e.column)), 1)) : u("", !0)
|
|
447
|
+
], 10, qe),
|
|
448
|
+
Y(e.column) ? (i(), h(a(B), {
|
|
449
|
+
key: 0,
|
|
450
|
+
type: "button",
|
|
451
|
+
variant: "text",
|
|
452
|
+
size: "icon",
|
|
453
|
+
class: "ml-auto gsc-btn-icon-sm",
|
|
454
|
+
title: a(v)("gsc.grid.table.filter"),
|
|
455
|
+
"aria-label": a(v)("gsc.grid.table.filter"),
|
|
456
|
+
onClick: k((l) => te(e.column.id), ["stop"])
|
|
457
|
+
}, {
|
|
458
|
+
default: H(() => [...n[4] || (n[4] = [
|
|
459
|
+
c("i", {
|
|
460
|
+
class: "i-material-symbols:filter-alt-outline",
|
|
461
|
+
"aria-hidden": "true"
|
|
462
|
+
}, null, -1)
|
|
463
|
+
])]),
|
|
464
|
+
_: 1
|
|
465
|
+
}, 8, ["title", "aria-label", "onClick"])) : u("", !0)
|
|
466
|
+
]),
|
|
467
|
+
y.value === e.column.id ? (i(), h(De, {
|
|
468
|
+
key: 0,
|
|
469
|
+
value: S[e.column.id],
|
|
470
|
+
type: Z(e.column),
|
|
471
|
+
options: ee(e.column),
|
|
472
|
+
"onUpdate:value": (l) => ne(e.column.id, l),
|
|
473
|
+
onApply: (l) => oe(e.column.id),
|
|
474
|
+
onClear: (l) => le(e.column.id)
|
|
475
|
+
}, null, 8, ["value", "type", "options", "onUpdate:value", "onApply", "onClear"])) : u("", !0),
|
|
476
|
+
e.column.getCanResize?.() ? (i(), s("div", {
|
|
477
|
+
key: 1,
|
|
478
|
+
class: "absolute right-0 top-0 h-full w-2 cursor-col-resize",
|
|
479
|
+
onMousedown: k((l) => e.getResizeHandler?.()(l), ["prevent"])
|
|
480
|
+
}, null, 40, Ye)) : u("", !0)
|
|
481
|
+
], 44, Ke))), 128))
|
|
482
|
+
]))), 128))
|
|
483
|
+
]),
|
|
484
|
+
c("tbody", null, [
|
|
485
|
+
(i(!0), s(x, null, b(z.value, (o) => (i(), s("tr", {
|
|
486
|
+
key: o.id,
|
|
487
|
+
class: "gsc-tr"
|
|
488
|
+
}, [
|
|
489
|
+
f.enableRowSelection ? (i(), s("td", {
|
|
490
|
+
key: 0,
|
|
491
|
+
class: "gsc-td text-center",
|
|
492
|
+
style: p(J.value)
|
|
493
|
+
}, [
|
|
494
|
+
c("input", {
|
|
495
|
+
type: "checkbox",
|
|
496
|
+
class: "gsc-checkbox",
|
|
497
|
+
checked: o.getIsSelected?.(),
|
|
498
|
+
onChange: (e) => o.toggleSelected?.(!!e.target.checked)
|
|
499
|
+
}, null, 40, Ze)
|
|
500
|
+
], 4)) : u("", !0),
|
|
501
|
+
(i(!0), s(x, null, b(o.getVisibleCells(), (e) => (i(), s("td", {
|
|
502
|
+
key: e.id,
|
|
503
|
+
class: "gsc-td align-top",
|
|
504
|
+
style: p(X(e)),
|
|
505
|
+
onDblclick: (l) => F(o, e.column)
|
|
506
|
+
}, [
|
|
507
|
+
t.$slots[`cell-${e.column.id}`] ? Ae(t.$slots, `cell-${e.column.id}`, {
|
|
508
|
+
key: 0,
|
|
509
|
+
value: e.getValue(),
|
|
510
|
+
row: o.original
|
|
511
|
+
}, void 0, !0) : (i(), s("div", tt, [
|
|
512
|
+
c("div", nt, [
|
|
513
|
+
T(o, e.column) ? (i(), h($e, {
|
|
514
|
+
key: 0,
|
|
515
|
+
"model-value": ue(o, e.column),
|
|
516
|
+
type: ce(e.column),
|
|
517
|
+
options: re(e.column),
|
|
518
|
+
onUpdateModelValue: (l) => ae(o, e.column, l),
|
|
519
|
+
onCommit: (l) => ge(o, e.column, l),
|
|
520
|
+
onCancel: (l) => de(o, e.column)
|
|
521
|
+
}, null, 8, ["model-value", "type", "options", "onUpdateModelValue", "onCommit", "onCancel"])) : (i(), s("span", ot, [
|
|
522
|
+
we(a(V), {
|
|
523
|
+
render: e.column.columnDef.cell,
|
|
524
|
+
props: e.getContext()
|
|
525
|
+
}, null, 8, ["render", "props"])
|
|
526
|
+
]))
|
|
527
|
+
]),
|
|
528
|
+
se(e.column) && !T(o, e.column) ? (i(), h(a(B), {
|
|
529
|
+
key: 0,
|
|
530
|
+
variant: "default",
|
|
531
|
+
class: "shrink-0 mt-0.5 px-2 h-6 text-xs",
|
|
532
|
+
onClick: k((l) => F(o, e.column), ["stop"])
|
|
533
|
+
}, {
|
|
534
|
+
default: H(() => [...n[5] || (n[5] = [
|
|
535
|
+
He(" ✎ ", -1)
|
|
536
|
+
])]),
|
|
537
|
+
_: 1
|
|
538
|
+
}, 8, ["onClick"])) : u("", !0)
|
|
539
|
+
]))
|
|
540
|
+
], 44, et))), 128))
|
|
541
|
+
]))), 128)),
|
|
542
|
+
z.value.length === 0 ? (i(), s("tr", lt, [
|
|
543
|
+
c("td", {
|
|
544
|
+
colspan: U.value,
|
|
545
|
+
class: "px-3 py-10 text-center text-sm text-[rgba(0,0,0,0.45)]"
|
|
546
|
+
}, M(f.loading ? a(v)("gsc.grid.table.loading") : a(v)("gsc.grid.table.empty")), 9, it)
|
|
547
|
+
])) : u("", !0)
|
|
548
|
+
])
|
|
549
|
+
])
|
|
550
|
+
], 4))
|
|
551
|
+
]));
|
|
552
|
+
}
|
|
553
|
+
}, Et = /* @__PURE__ */ Le(_t, [["__scopeId", "data-v-506c5c98"]]);
|
|
554
|
+
export {
|
|
555
|
+
Et as default
|
|
556
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[data-v-729972d8],[data-v-729972d8]:before,[data-v-729972d8]:after{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }[data-v-729972d8]::backdrop{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }.text-sm[data-v-729972d8]{font-size:.875rem;line-height:1.25rem}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { computed as v, openBlock as n, createElementBlock as l, createElementVNode as o, toDisplayString as r, unref as i, Fragment as f, renderList as z, createVNode as p, withCtx as c } from "vue";
|
|
2
|
+
import { useLocale as b } from "../../../hooks/useLocale.js";
|
|
3
|
+
import { GscButton as m } from "../../../Button/index.js";
|
|
4
|
+
import './Pager.css';/* empty css */
|
|
5
|
+
import y from "../../../../_virtual/_plugin-vue_export-helper.js";
|
|
6
|
+
const S = { class: "gsc-pager" }, N = { class: "text-sm gsc-text-secondary" }, $ = ["value"], k = ["value"], x = { class: "gsc-pager-jumper text-sm" }, C = ["value"], h = { class: "gsc-text-secondary" }, B = {
|
|
7
|
+
__name: "Pager",
|
|
8
|
+
props: {
|
|
9
|
+
page: { type: Number, default: 1 },
|
|
10
|
+
pageSize: { type: Number, default: 10 },
|
|
11
|
+
total: { type: Number, default: 0 },
|
|
12
|
+
pageSizeOptions: { type: Array, default: () => [10, 20, 50, 100] }
|
|
13
|
+
},
|
|
14
|
+
emits: ["update:page", "update:pageSize"],
|
|
15
|
+
setup(t) {
|
|
16
|
+
const d = t, { t: u } = b(), g = v(() => Math.max(1, Math.ceil((d.total || 0) / (d.pageSize || 1))));
|
|
17
|
+
return (s, e) => (n(), l("div", S, [
|
|
18
|
+
o("div", N, r(i(u)("gsc.grid.pager.total", { total: t.total })), 1),
|
|
19
|
+
o("select", {
|
|
20
|
+
class: "gsc-control gsc-control-auto",
|
|
21
|
+
value: t.pageSize,
|
|
22
|
+
onChange: e[0] || (e[0] = (a) => s.$emit("update:pageSize", Number(a.target.value)))
|
|
23
|
+
}, [
|
|
24
|
+
(n(!0), l(f, null, z(t.pageSizeOptions, (a) => (n(), l("option", {
|
|
25
|
+
key: a,
|
|
26
|
+
value: a
|
|
27
|
+
}, r(i(u)("gsc.grid.pager.pageSize", { size: a })), 9, k))), 128))
|
|
28
|
+
], 40, $),
|
|
29
|
+
p(i(m), {
|
|
30
|
+
variant: "default",
|
|
31
|
+
size: "icon",
|
|
32
|
+
disabled: t.page <= 1,
|
|
33
|
+
onClick: e[1] || (e[1] = (a) => s.$emit("update:page", t.page - 1))
|
|
34
|
+
}, {
|
|
35
|
+
default: c(() => [...e[4] || (e[4] = [
|
|
36
|
+
o("span", { "aria-hidden": "true" }, "‹", -1)
|
|
37
|
+
])]),
|
|
38
|
+
_: 1
|
|
39
|
+
}, 8, ["disabled"]),
|
|
40
|
+
o("div", x, [
|
|
41
|
+
o("input", {
|
|
42
|
+
class: "gsc-control gsc-control-page gsc-control-center",
|
|
43
|
+
value: t.page,
|
|
44
|
+
onChange: e[2] || (e[2] = (a) => s.$emit("update:page", Number(a.target.value || 1)))
|
|
45
|
+
}, null, 40, C),
|
|
46
|
+
o("span", h, "/ " + r(g.value), 1)
|
|
47
|
+
]),
|
|
48
|
+
p(i(m), {
|
|
49
|
+
variant: "default",
|
|
50
|
+
size: "icon",
|
|
51
|
+
disabled: t.page >= g.value,
|
|
52
|
+
onClick: e[3] || (e[3] = (a) => s.$emit("update:page", t.page + 1))
|
|
53
|
+
}, {
|
|
54
|
+
default: c(() => [...e[5] || (e[5] = [
|
|
55
|
+
o("span", { "aria-hidden": "true" }, "›", -1)
|
|
56
|
+
])]),
|
|
57
|
+
_: 1
|
|
58
|
+
}, 8, ["disabled"])
|
|
59
|
+
]));
|
|
60
|
+
}
|
|
61
|
+
}, V = /* @__PURE__ */ y(B, [["__scopeId", "data-v-729972d8"]]);
|
|
62
|
+
export {
|
|
63
|
+
V as default
|
|
64
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[data-v-366b3fad],[data-v-366b3fad]:before,[data-v-366b3fad]:after{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }[data-v-366b3fad]::backdrop{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }.container[data-v-366b3fad]{width:100%}@media(min-width:576px){.container[data-v-366b3fad]{max-width:576px}}@media(min-width:768px){.container[data-v-366b3fad]{max-width:768px}}@media(min-width:992px){.container[data-v-366b3fad]{max-width:992px}}@media(min-width:1200px){.container[data-v-366b3fad]{max-width:1200px}}@media(min-width:1600px){.container[data-v-366b3fad]{max-width:1600px}}@media(min-width:2000px){.container[data-v-366b3fad]{max-width:2000px}}.flex[data-v-366b3fad]{display:flex}.resize[data-v-366b3fad]{resize:both}.items-center[data-v-366b3fad]{align-items:center}.gap-2[data-v-366b3fad]{gap:.5rem}
|