@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,208 @@
|
|
|
1
|
+
import { computed as b, watch as V, openBlock as n, createElementBlock as o, normalizeClass as x, Fragment as m, renderList as v, createElementVNode as u, toDisplayString as i, createBlock as z, resolveDynamicComponent as D, unref as C, withCtx as R, renderSlot as T } from "vue";
|
|
2
|
+
import { useForm as q } from "../../../node_modules/@tanstack/vue-form/dist/esm/useForm.js";
|
|
3
|
+
import { useLocale as $ } from "../../hooks/useLocale.js";
|
|
4
|
+
import './Form.css';import './styles/form.css';/* empty css */
|
|
5
|
+
/* empty css */
|
|
6
|
+
import G from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
7
|
+
const H = ["title"], J = { class: "gsc-form-control w-full text-left" }, M = ["value", "onChange"], P = { value: "" }, Q = ["value"], U = ["placeholder", "value", "rows", "onInput"], W = ["step", "placeholder", "value", "onInput"], X = { key: 3 }, Y = ["name", "value", "checked", "onChange"], Z = { class: "ml-2" }, ee = { key: 4 }, le = ["value", "checked", "onChange"], te = { class: "ml-2" }, ae = {
|
|
8
|
+
key: 1,
|
|
9
|
+
class: "inline-flex items-center"
|
|
10
|
+
}, ne = ["checked", "onChange"], oe = { class: "ml-2" }, se = ["placeholder", "value", "onInput"], ue = {
|
|
11
|
+
class: "gsc-form-actions-unified",
|
|
12
|
+
style: { gridColumn: "1 / -1", display: "flex", justifyContent: "flex-end", gap: "8px" }
|
|
13
|
+
}, ce = {
|
|
14
|
+
__name: "Form",
|
|
15
|
+
props: {
|
|
16
|
+
schema: { type: Array, default: () => [] },
|
|
17
|
+
modelValue: { type: Object, default: () => ({}) },
|
|
18
|
+
showActions: { type: Boolean, default: !0 }
|
|
19
|
+
},
|
|
20
|
+
emits: ["update:modelValue", "submit", "reset", "change"],
|
|
21
|
+
setup(w, { expose: F, emit: I }) {
|
|
22
|
+
const y = w, c = I, { t: N } = $();
|
|
23
|
+
function S(l = []) {
|
|
24
|
+
return (l || []).filter(Boolean).map((e) => ({
|
|
25
|
+
key: e.key,
|
|
26
|
+
label: e.label ?? e.title ?? e.key,
|
|
27
|
+
type: e.type ?? "text",
|
|
28
|
+
placeholder: e.placeholder,
|
|
29
|
+
options: e.options,
|
|
30
|
+
span: e.span,
|
|
31
|
+
startKey: e.startKey,
|
|
32
|
+
endKey: e.endKey,
|
|
33
|
+
showTime: e.showTime || e.withTime || !1,
|
|
34
|
+
defaultValue: e.defaultValue
|
|
35
|
+
})).filter((e) => !!e.key);
|
|
36
|
+
}
|
|
37
|
+
const g = b(() => S(y.schema));
|
|
38
|
+
function _() {
|
|
39
|
+
const l = {};
|
|
40
|
+
return g.value.forEach((e) => {
|
|
41
|
+
l[e.key] = y.modelValue?.[e.key] ?? e.defaultValue ?? "";
|
|
42
|
+
}), l;
|
|
43
|
+
}
|
|
44
|
+
const d = q({
|
|
45
|
+
defaultValues: _(),
|
|
46
|
+
onSubmit: ({ value: l }) => {
|
|
47
|
+
c("update:modelValue", l || {}), c("submit", l || {});
|
|
48
|
+
}
|
|
49
|
+
}), f = d.useStore((l) => l.values);
|
|
50
|
+
V(f, (l) => {
|
|
51
|
+
c("update:modelValue", l || {}), c("change", l || {});
|
|
52
|
+
}, { deep: !0 }), V(
|
|
53
|
+
() => y.modelValue,
|
|
54
|
+
(l) => {
|
|
55
|
+
const e = l || {};
|
|
56
|
+
Object.keys(e).forEach((a) => {
|
|
57
|
+
try {
|
|
58
|
+
d.setFieldValue(a, e[a], { dontValidate: !0, dontRunListeners: !0 });
|
|
59
|
+
} catch {
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
},
|
|
63
|
+
{ deep: !0 }
|
|
64
|
+
);
|
|
65
|
+
function A() {
|
|
66
|
+
try {
|
|
67
|
+
d.handleSubmit();
|
|
68
|
+
} catch {
|
|
69
|
+
c("submit", f.value || {});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
function B() {
|
|
73
|
+
const l = _();
|
|
74
|
+
Object.keys(l).forEach((e) => {
|
|
75
|
+
try {
|
|
76
|
+
d.setFieldValue(e, l[e], { dontValidate: !0, dontRunListeners: !0 });
|
|
77
|
+
} catch {
|
|
78
|
+
}
|
|
79
|
+
}), c("update:modelValue", l), c("reset", l);
|
|
80
|
+
}
|
|
81
|
+
function E() {
|
|
82
|
+
return f.value || {};
|
|
83
|
+
}
|
|
84
|
+
function j(l = {}) {
|
|
85
|
+
Object.keys(l).forEach((e) => {
|
|
86
|
+
try {
|
|
87
|
+
d.setFieldValue(e, l[e], { dontValidate: !0, dontRunListeners: !0 });
|
|
88
|
+
} catch {
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
const K = b(() => "grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4");
|
|
93
|
+
function L(l) {
|
|
94
|
+
const e = Number(l?.span || 0);
|
|
95
|
+
return e === 2 ? "lg:col-span-2" : e === 3 ? "lg:col-span-3" : e === 4 ? "lg:col-span-4" : "";
|
|
96
|
+
}
|
|
97
|
+
function O(l) {
|
|
98
|
+
return l.key;
|
|
99
|
+
}
|
|
100
|
+
return F({ submit: A, reset: B, getValues: E, setValues: j }), (l, e) => (n(), o("div", {
|
|
101
|
+
class: x(["gsc-form gap-2", K.value])
|
|
102
|
+
}, [
|
|
103
|
+
(n(!0), o(m, null, v(g.value, (a) => (n(), o("div", {
|
|
104
|
+
key: O(a),
|
|
105
|
+
class: x(["gsc-form-item gsc-form-item--vertical gap-1", L(a)])
|
|
106
|
+
}, [
|
|
107
|
+
u("div", {
|
|
108
|
+
class: "gsc-form-label mb-0.5",
|
|
109
|
+
title: a.label
|
|
110
|
+
}, i(a.label), 9, H),
|
|
111
|
+
u("div", J, [
|
|
112
|
+
(n(), z(D(C(d).Field), {
|
|
113
|
+
name: a.key
|
|
114
|
+
}, {
|
|
115
|
+
default: R(({ field: r, state: s }) => [
|
|
116
|
+
a.type === "select" ? (n(), o("select", {
|
|
117
|
+
key: 0,
|
|
118
|
+
class: "gsc-control",
|
|
119
|
+
value: s.value ?? "",
|
|
120
|
+
onChange: (t) => r.setValue(t.target.value)
|
|
121
|
+
}, [
|
|
122
|
+
u("option", P, i(a.placeholder || C(N)("gsc.grid.queryBar.placeholder.select")), 1),
|
|
123
|
+
(n(!0), o(m, null, v(a.options || [], (t) => (n(), o("option", {
|
|
124
|
+
key: t.value,
|
|
125
|
+
value: t.value
|
|
126
|
+
}, i(t.label), 9, Q))), 128))
|
|
127
|
+
], 40, M)) : a.type === "textarea" ? (n(), o("textarea", {
|
|
128
|
+
key: 1,
|
|
129
|
+
class: "gsc-textarea",
|
|
130
|
+
placeholder: a.placeholder || "",
|
|
131
|
+
value: s.value ?? "",
|
|
132
|
+
rows: a.rows,
|
|
133
|
+
onInput: (t) => r.setValue(t.target.value)
|
|
134
|
+
}, null, 40, U)) : a.type === "inputNumber" ? (n(), o("input", {
|
|
135
|
+
key: 2,
|
|
136
|
+
type: "number",
|
|
137
|
+
class: "gsc-control",
|
|
138
|
+
step: a.step ?? 1,
|
|
139
|
+
placeholder: a.placeholder || "",
|
|
140
|
+
value: s.value ?? "",
|
|
141
|
+
onInput: (t) => {
|
|
142
|
+
const p = t.target.value === "" ? "" : Number(t.target.value);
|
|
143
|
+
r.setValue(Number.isNaN(p) ? "" : p);
|
|
144
|
+
}
|
|
145
|
+
}, null, 40, W)) : a.type === "radio" ? (n(), o("div", X, [
|
|
146
|
+
(n(!0), o(m, null, v(a.options || [], (t) => (n(), o("label", {
|
|
147
|
+
key: t.value,
|
|
148
|
+
class: "inline-flex items-center mr-3"
|
|
149
|
+
}, [
|
|
150
|
+
u("input", {
|
|
151
|
+
type: "radio",
|
|
152
|
+
name: a.key,
|
|
153
|
+
value: t.value,
|
|
154
|
+
checked: s.value === t.value,
|
|
155
|
+
onChange: () => r.setValue(t.value)
|
|
156
|
+
}, null, 40, Y),
|
|
157
|
+
u("span", Z, i(t.label), 1)
|
|
158
|
+
]))), 128))
|
|
159
|
+
])) : a.type === "checkbox" ? (n(), o("div", ee, [
|
|
160
|
+
(a.options || []).length ? (n(!0), o(m, { key: 0 }, v(a.options || [], (t) => (n(), o("label", {
|
|
161
|
+
key: t.value,
|
|
162
|
+
class: "inline-flex items-center mr-3"
|
|
163
|
+
}, [
|
|
164
|
+
u("input", {
|
|
165
|
+
type: "checkbox",
|
|
166
|
+
value: t.value,
|
|
167
|
+
checked: Array.isArray(s.value) && s.value.includes(t.value),
|
|
168
|
+
onChange: (p) => {
|
|
169
|
+
const h = Array.isArray(s.value) ? [...s.value] : [];
|
|
170
|
+
if (p.target.checked)
|
|
171
|
+
h.push(t.value);
|
|
172
|
+
else {
|
|
173
|
+
const k = h.indexOf(t.value);
|
|
174
|
+
k > -1 && h.splice(k, 1);
|
|
175
|
+
}
|
|
176
|
+
r.setValue(h);
|
|
177
|
+
}
|
|
178
|
+
}, null, 40, le),
|
|
179
|
+
u("span", te, i(t.label), 1)
|
|
180
|
+
]))), 128)) : (n(), o("label", ae, [
|
|
181
|
+
u("input", {
|
|
182
|
+
type: "checkbox",
|
|
183
|
+
checked: !!s.value,
|
|
184
|
+
onChange: (t) => r.setValue(t.target.checked)
|
|
185
|
+
}, null, 40, ne),
|
|
186
|
+
u("span", oe, i(a.placeholder || a.label), 1)
|
|
187
|
+
]))
|
|
188
|
+
])) : (n(), o("input", {
|
|
189
|
+
key: 5,
|
|
190
|
+
class: "gsc-control",
|
|
191
|
+
placeholder: a.placeholder || "",
|
|
192
|
+
value: s.value ?? "",
|
|
193
|
+
onInput: (t) => r.setValue(t.target.value)
|
|
194
|
+
}, null, 40, se))
|
|
195
|
+
]),
|
|
196
|
+
_: 2
|
|
197
|
+
}, 1032, ["name"]))
|
|
198
|
+
])
|
|
199
|
+
], 2))), 128)),
|
|
200
|
+
u("div", ue, [
|
|
201
|
+
T(l.$slots, "actions", {}, void 0, !0)
|
|
202
|
+
])
|
|
203
|
+
], 2));
|
|
204
|
+
}
|
|
205
|
+
}, ve = /* @__PURE__ */ G(ce, [["__scopeId", "data-v-86e89bcb"]]);
|
|
206
|
+
export {
|
|
207
|
+
ve as default
|
|
208
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.gsc-form{display:grid;grid-gap:12px 16px;gap:12px 16px}.gsc-form .gsc-form-item{display:flex;align-items:center;gap:8px;min-width:0}.gsc-form .gsc-form-label{width:96px;flex:0 0 auto;text-align:right;font-weight:600;font-size:14px;line-height:32px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.gsc-form .gsc-form-item--vertical{flex-direction:column;align-items:flex-start;gap:6px}.gsc-form .gsc-form-item--vertical .gsc-form-label{width:auto;text-align:left;line-height:1.2;margin-bottom:4px}.gsc-form .gsc-form-control{flex:1 1 auto;min-width:0}.gsc-form .gsc-form-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px}.gsc-form .gsc-range{display:flex;align-items:center;gap:8px;min-width:0}.gsc-form .gsc-range .gsc-control{width:auto;flex:1 1 0;min-width:0}.gsc-form .gsc-range-sep{flex:0 0 auto;color:#9ca3af}.gsc-form .gsc-control{box-sizing:border-box;width:100%;height:32px;padding:4px 11px;border:1px solid var(--gsc-basic-border);border-radius:6px;background:var(--gsc-basic-bg);color:var(--gsc-basic-text-primary);font-size:14px;line-height:22px;transition:border-color .2s,box-shadow .2s;outline:none}.gsc-form .gsc-control::-moz-placeholder{color:var(--gsc-basic-text-placeholder)}.gsc-form .gsc-control::placeholder{color:var(--gsc-basic-text-placeholder)}.gsc-form .gsc-control:hover{border-color:var(--gsc-basic-primary-hover)}.gsc-form .gsc-control:focus{border-color:var(--gsc-basic-primary);box-shadow:var(--gsc-basic-focus-shadow)}.gsc-form select.gsc-control{-moz-appearance:none;appearance:none;-webkit-appearance:none;background-image:linear-gradient(45deg,transparent 50%,var(--gsc-basic-text-placeholder) 50%),linear-gradient(135deg,var(--gsc-basic-text-placeholder) 50%,transparent 50%);background-position:calc(100% - 16px) 50%,calc(100% - 11px) 50%;background-size:5px 5px,5px 5px;background-repeat:no-repeat;padding-right:28px;color:var(--gsc-basic-text-primary)}.gsc-form select.gsc-control option[value=""]{color:var(--gsc-basic-text-placeholder)}.gsc-form .gsc-textarea{box-sizing:border-box;display:inline-block;width:100%;max-width:100%;padding:8px 11px;border:1px solid var(--gsc-basic-border);border-radius:6px;background:var(--gsc-basic-bg);color:var(--gsc-basic-text-primary);font-size:14px;line-height:1.5715;transition:border-color .2s,box-shadow .2s;outline:none;resize:none}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[data-v-9ebe45ca],[data-v-9ebe45ca]:before,[data-v-9ebe45ca]: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-9ebe45ca]::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: }.space-y-3[data-v-9ebe45ca]>:not([hidden])~:not([hidden]){--un-space-y-reverse:0;margin-top:.75rem;margin-top:calc(.75rem * calc(1 - var(--un-space-y-reverse)));margin-bottom:0rem;margin-bottom:calc(.75rem * var(--un-space-y-reverse))}.px-4[data-v-9ebe45ca]{padding-left:1rem;padding-right:1rem}.py-3[data-v-9ebe45ca]{padding-top:.75rem;padding-bottom:.75rem}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { computed as l, watch as d, openBlock as i, createElementBlock as b, unref as s, createBlock as C, createCommentVNode as u, createElementVNode as A, createVNode as g, createSlots as q, withCtx as p, renderSlot as m, renderList as G } from "vue";
|
|
2
|
+
import O from "./components/QueryBar.vue.js";
|
|
3
|
+
import U from "./components/ActionBar.vue.js";
|
|
4
|
+
import E from "./components/Pager.vue.js";
|
|
5
|
+
import H from "./components/DataTable.vue.js";
|
|
6
|
+
import I from "./components/ColumnSettings.vue.js";
|
|
7
|
+
import { useGridTable as L } from "./composables/useGridTable.js";
|
|
8
|
+
import './Grid.css';import './styles/table.css';/* empty css */
|
|
9
|
+
/* empty css */
|
|
10
|
+
import T from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
11
|
+
const x = { class: "gsc-grid space-y-3" }, M = { class: "gsc-card gsc-card-pad" }, J = { class: "gsc-card" }, P = {
|
|
12
|
+
key: 0,
|
|
13
|
+
class: "px-4 py-3 gsc-divider-top"
|
|
14
|
+
}, W = {
|
|
15
|
+
__name: "Grid",
|
|
16
|
+
props: {
|
|
17
|
+
data: { type: Array, default: () => [] },
|
|
18
|
+
request: { type: Function },
|
|
19
|
+
mode: { type: String, default: "server" },
|
|
20
|
+
// 'server' | 'client'
|
|
21
|
+
columns: { type: Array, default: () => [] },
|
|
22
|
+
pagination: { type: [Boolean, Object], default: () => ({ page: 1, pageSize: 10 }) },
|
|
23
|
+
query: { type: Object, default: () => ({}) },
|
|
24
|
+
filterSchema: { type: Array, default: () => [] },
|
|
25
|
+
// ActionBar config (optional). Example: { left: [{ key:'export', text:'导出' }], right: [{ key:'refresh', text:'刷新' }], showColumnSettings: true }
|
|
26
|
+
actions: { type: Object, default: () => ({}) },
|
|
27
|
+
rowKey: { type: String, default: "id" },
|
|
28
|
+
rowSelection: { type: Boolean, default: !1 },
|
|
29
|
+
virtual: { type: Boolean, default: !1 },
|
|
30
|
+
rowHeight: { type: Number, default: 40 },
|
|
31
|
+
height: { type: Number, default: 400 }
|
|
32
|
+
},
|
|
33
|
+
emits: ["update:query", "selection-change", "load", "cell-change", "update:modelValue", "info"],
|
|
34
|
+
setup(k, { emit: B }) {
|
|
35
|
+
const t = k, r = B, f = t.filterSchema || [], $ = l(() => t.columns || []), y = l(() => !!t.rowSelection), z = l(() => t.pagination !== !1), Q = l(() => {
|
|
36
|
+
const e = t.actions || {}, a = e.left || e.leftActions || [];
|
|
37
|
+
return Array.isArray(a) ? a : [];
|
|
38
|
+
}), V = l(() => {
|
|
39
|
+
const e = t.actions || {}, a = e.right || e.rightActions || [];
|
|
40
|
+
return Array.isArray(a) ? a : [];
|
|
41
|
+
}), _ = l(() => (t.actions || {}).showColumnSettings !== !1), o = L({
|
|
42
|
+
data: t.data,
|
|
43
|
+
request: t.request,
|
|
44
|
+
mode: t.mode,
|
|
45
|
+
pageSize: t.pagination && t.pagination.pageSize || 10,
|
|
46
|
+
initialQuery: t.query,
|
|
47
|
+
columns: t.columns,
|
|
48
|
+
rowKey: t.rowKey,
|
|
49
|
+
enableRowSelection: y.value
|
|
50
|
+
}), c = l(() => !!o.loading.value), v = l({
|
|
51
|
+
get() {
|
|
52
|
+
return o.query.value || {};
|
|
53
|
+
},
|
|
54
|
+
set(e) {
|
|
55
|
+
o.setQuery(e || {});
|
|
56
|
+
}
|
|
57
|
+
}), h = l({
|
|
58
|
+
get() {
|
|
59
|
+
return o.page.value;
|
|
60
|
+
},
|
|
61
|
+
set(e) {
|
|
62
|
+
o.page.value = e;
|
|
63
|
+
}
|
|
64
|
+
}), S = l({
|
|
65
|
+
get() {
|
|
66
|
+
return o.pageSize.value;
|
|
67
|
+
},
|
|
68
|
+
set(e) {
|
|
69
|
+
o.pageSize.value = e;
|
|
70
|
+
}
|
|
71
|
+
}), K = l(() => o.total.value || 0);
|
|
72
|
+
function N(e) {
|
|
73
|
+
const a = e || {};
|
|
74
|
+
o.setQuery(a), o.load();
|
|
75
|
+
}
|
|
76
|
+
function R(e) {
|
|
77
|
+
const a = e || {};
|
|
78
|
+
o.setQuery(a), o.load();
|
|
79
|
+
}
|
|
80
|
+
function j({ key: e, value: a }) {
|
|
81
|
+
const n = { ...o.query.value || {} };
|
|
82
|
+
a != null && a !== "" ? n[e] = a : delete n[e], o.setQuery(n), o.load();
|
|
83
|
+
}
|
|
84
|
+
function D(e) {
|
|
85
|
+
r("selection-change", e || []);
|
|
86
|
+
}
|
|
87
|
+
function F(e) {
|
|
88
|
+
t.mode === "client" ? o.setData((o.rows.value || []).slice()) : r("cell-change", {
|
|
89
|
+
rowKey: e?.row?.[t.rowKey],
|
|
90
|
+
column: e?.column,
|
|
91
|
+
value: e?.value,
|
|
92
|
+
row: e?.row
|
|
93
|
+
}), r("update:modelValue", (o.rows.value || []).slice());
|
|
94
|
+
}
|
|
95
|
+
return d(() => t.data, (e) => {
|
|
96
|
+
o.setData(e || []);
|
|
97
|
+
}, { deep: !0 }), d(() => t.columns, (e) => {
|
|
98
|
+
o.setColumns(e || []);
|
|
99
|
+
}, { deep: !0 }), d(() => o.query.value, (e) => {
|
|
100
|
+
r("update:query", e);
|
|
101
|
+
}, { deep: !0 }), (e, a) => (i(), b("div", x, [
|
|
102
|
+
s(f).length ? (i(), C(O, {
|
|
103
|
+
key: 0,
|
|
104
|
+
modelValue: v.value,
|
|
105
|
+
"onUpdate:modelValue": a[0] || (a[0] = (n) => v.value = n),
|
|
106
|
+
schema: s(f),
|
|
107
|
+
loading: c.value,
|
|
108
|
+
onSearch: N,
|
|
109
|
+
onReset: R
|
|
110
|
+
}, null, 8, ["modelValue", "schema", "loading"])) : u("", !0),
|
|
111
|
+
A("div", M, [
|
|
112
|
+
g(U, {
|
|
113
|
+
loading: c.value,
|
|
114
|
+
"left-actions": Q.value,
|
|
115
|
+
"right-actions": V.value,
|
|
116
|
+
onInfo: a[1] || (a[1] = (n) => e.$emit("info"))
|
|
117
|
+
}, q({
|
|
118
|
+
right: p(() => [
|
|
119
|
+
m(e.$slots, "actions-right", {}, () => [
|
|
120
|
+
_.value ? (i(), C(I, {
|
|
121
|
+
key: 0,
|
|
122
|
+
table: s(o).table
|
|
123
|
+
}, null, 8, ["table"])) : u("", !0)
|
|
124
|
+
], !0)
|
|
125
|
+
]),
|
|
126
|
+
_: 2
|
|
127
|
+
}, [
|
|
128
|
+
e.$slots["actions-left"] ? {
|
|
129
|
+
name: "left",
|
|
130
|
+
fn: p(() => [
|
|
131
|
+
m(e.$slots, "actions-left", {}, void 0, !0)
|
|
132
|
+
]),
|
|
133
|
+
key: "0"
|
|
134
|
+
} : void 0
|
|
135
|
+
]), 1032, ["loading", "left-actions", "right-actions"])
|
|
136
|
+
]),
|
|
137
|
+
A("div", J, [
|
|
138
|
+
g(H, {
|
|
139
|
+
table: s(o).table,
|
|
140
|
+
mode: t.mode,
|
|
141
|
+
loading: c.value,
|
|
142
|
+
virtual: t.virtual,
|
|
143
|
+
height: t.height,
|
|
144
|
+
"row-height": t.rowHeight,
|
|
145
|
+
"enable-row-selection": y.value,
|
|
146
|
+
onSelectionChange: D,
|
|
147
|
+
onCellChange: F,
|
|
148
|
+
onServerFilterChange: j
|
|
149
|
+
}, q({ _: 2 }, [
|
|
150
|
+
G($.value, (n) => ({
|
|
151
|
+
name: `cell-${n.key}`,
|
|
152
|
+
fn: p((w) => [
|
|
153
|
+
e.$slots[`cell-${n.key}`] ? m(e.$slots, `cell-${n.key}`, {
|
|
154
|
+
key: 0,
|
|
155
|
+
value: w.value,
|
|
156
|
+
row: w.row
|
|
157
|
+
}, void 0, !0) : u("", !0)
|
|
158
|
+
])
|
|
159
|
+
}))
|
|
160
|
+
]), 1032, ["table", "mode", "loading", "virtual", "height", "row-height", "enable-row-selection"]),
|
|
161
|
+
z.value ? (i(), b("div", P, [
|
|
162
|
+
g(E, {
|
|
163
|
+
page: h.value,
|
|
164
|
+
"page-size": S.value,
|
|
165
|
+
total: K.value,
|
|
166
|
+
"onUpdate:page": a[2] || (a[2] = (n) => {
|
|
167
|
+
h.value = n;
|
|
168
|
+
}),
|
|
169
|
+
"onUpdate:pageSize": a[3] || (a[3] = (n) => {
|
|
170
|
+
S.value = n;
|
|
171
|
+
})
|
|
172
|
+
}, null, 8, ["page", "page-size", "total"])
|
|
173
|
+
])) : u("", !0)
|
|
174
|
+
])
|
|
175
|
+
]));
|
|
176
|
+
}
|
|
177
|
+
}, ie = /* @__PURE__ */ T(W, [["__scopeId", "data-v-9ebe45ca"]]);
|
|
178
|
+
export {
|
|
179
|
+
ie as default
|
|
180
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[data-v-11bc5d18],[data-v-11bc5d18]:before,[data-v-11bc5d18]: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-11bc5d18]::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: }.flex[data-v-11bc5d18]{display:flex}.items-center[data-v-11bc5d18]{align-items:center}.justify-between[data-v-11bc5d18]{justify-content:space-between}.gap-2[data-v-11bc5d18]{gap:.5rem}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { computed as d, openBlock as i, createElementBlock as s, createElementVNode as f, renderSlot as u, Fragment as p, renderList as m, createBlock as y, unref as v, withCtx as g, createTextVNode as A, toDisplayString as k } from "vue";
|
|
2
|
+
import { useLocale as $ } from "../../../hooks/useLocale.js";
|
|
3
|
+
import { GscButton as x } from "../../../Button/index.js";
|
|
4
|
+
import './ActionBar.css';/* empty css */
|
|
5
|
+
import L from "../../../../_virtual/_plugin-vue_export-helper.js";
|
|
6
|
+
const w = { class: "flex items-center justify-between" }, E = { class: "flex items-center gap-2" }, N = { class: "flex items-center gap-2" }, S = {
|
|
7
|
+
__name: "ActionBar",
|
|
8
|
+
props: {
|
|
9
|
+
loading: { type: Boolean, default: !1 },
|
|
10
|
+
leftActions: { type: Array, default: () => [] },
|
|
11
|
+
rightActions: { type: Array, default: () => [] }
|
|
12
|
+
},
|
|
13
|
+
emits: ["export", "info", "action"],
|
|
14
|
+
setup(a, { emit: h }) {
|
|
15
|
+
const o = a, n = h, { t: c } = $(), _ = d(() => {
|
|
16
|
+
const e = Array.isArray(o.leftActions) ? o.leftActions : [];
|
|
17
|
+
return e.length ? e : [
|
|
18
|
+
{ key: "export", text: c("gsc.grid.actionBar.export"), variant: "primary" },
|
|
19
|
+
{ key: "info", text: c("gsc.grid.actionBar.info"), variant: "default" }
|
|
20
|
+
];
|
|
21
|
+
}), B = d(() => Array.isArray(o.rightActions) ? o.rightActions : []);
|
|
22
|
+
function l(e) {
|
|
23
|
+
const r = e?.key;
|
|
24
|
+
n("action", { key: r, action: e }), r === "export" && n("export"), r === "info" && n("info");
|
|
25
|
+
try {
|
|
26
|
+
e?.onClick?.();
|
|
27
|
+
} catch {
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return (e, r) => (i(), s("div", w, [
|
|
31
|
+
f("div", E, [
|
|
32
|
+
u(e.$slots, "left", {}, () => [
|
|
33
|
+
(i(!0), s(p, null, m(_.value, (t) => (i(), y(v(x), {
|
|
34
|
+
key: t.key,
|
|
35
|
+
variant: t.variant || "default",
|
|
36
|
+
disabled: a.loading || !!t.disabled,
|
|
37
|
+
onClick: (C) => l(t)
|
|
38
|
+
}, {
|
|
39
|
+
default: g(() => [
|
|
40
|
+
A(k(t.text), 1)
|
|
41
|
+
]),
|
|
42
|
+
_: 2
|
|
43
|
+
}, 1032, ["variant", "disabled", "onClick"]))), 128))
|
|
44
|
+
], !0)
|
|
45
|
+
]),
|
|
46
|
+
f("div", N, [
|
|
47
|
+
(i(!0), s(p, null, m(B.value, (t) => (i(), y(v(x), {
|
|
48
|
+
key: t.key,
|
|
49
|
+
variant: t.variant || "default",
|
|
50
|
+
disabled: a.loading || !!t.disabled,
|
|
51
|
+
onClick: (C) => l(t)
|
|
52
|
+
}, {
|
|
53
|
+
default: g(() => [
|
|
54
|
+
A(k(t.text), 1)
|
|
55
|
+
]),
|
|
56
|
+
_: 2
|
|
57
|
+
}, 1032, ["variant", "disabled", "onClick"]))), 128)),
|
|
58
|
+
u(e.$slots, "right", {}, void 0, !0)
|
|
59
|
+
])
|
|
60
|
+
]));
|
|
61
|
+
}
|
|
62
|
+
}, I = /* @__PURE__ */ L(S, [["__scopeId", "data-v-11bc5d18"]]);
|
|
63
|
+
export {
|
|
64
|
+
I as default
|
|
65
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.gsc-cell-editor[data-v-dc815e23]{display:flex;flex-direction:column}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { ref as U, onMounted as L, openBlock as u, createElementBlock as i, renderSlot as V, unref as e, withDirectives as p, withKeys as s, withModifiers as d, isRef as v, Fragment as g, renderList as N, toDisplayString as w, vModelSelect as R, vModelText as y, createElementVNode as T, createVNode as C, withCtx as x, createTextVNode as K } from "vue";
|
|
2
|
+
import { GscButton as b } from "../../../Button/index.js";
|
|
3
|
+
import { useCellEditor as B } from "../composables/useCellEditor.js";
|
|
4
|
+
import './CellEditor2.css';import './CellEditor.css';/* empty css */
|
|
5
|
+
/* empty css */
|
|
6
|
+
import D from "../../../../_virtual/_plugin-vue_export-helper.js";
|
|
7
|
+
const I = { class: "gsc-cell-editor" }, $ = ["value"], H = { key: 0 }, j = { class: "mt-2 flex gap-2 justify-end" }, A = {
|
|
8
|
+
__name: "CellEditor",
|
|
9
|
+
props: { modelValue: [String, Number, Date], type: { type: String, default: "text" }, options: Array },
|
|
10
|
+
emits: ["update:modelValue", "commit", "cancel"],
|
|
11
|
+
setup(a, { emit: M }) {
|
|
12
|
+
const c = a, E = M, { localValue: n, updateLocal: f, commit: o, cancel: r } = B(c, E), k = U(null);
|
|
13
|
+
L(() => {
|
|
14
|
+
c.type === "rich-text" && k.value && (k.value.innerHTML = n.value || "");
|
|
15
|
+
});
|
|
16
|
+
function S(m) {
|
|
17
|
+
const t = m.target.innerHTML;
|
|
18
|
+
f(t);
|
|
19
|
+
}
|
|
20
|
+
return (m, t) => (u(), i("div", I, [
|
|
21
|
+
a.type === "custom" ? V(m.$slots, "custom", {
|
|
22
|
+
key: 0,
|
|
23
|
+
modelValue: a.modelValue,
|
|
24
|
+
update: e(f),
|
|
25
|
+
commit: e(o),
|
|
26
|
+
cancel: e(r)
|
|
27
|
+
}, void 0, !0) : a.type === "select" ? p((u(), i("select", {
|
|
28
|
+
key: 1,
|
|
29
|
+
"onUpdate:modelValue": t[0] || (t[0] = (l) => v(n) ? n.value = l : null),
|
|
30
|
+
class: "gsc-control",
|
|
31
|
+
onKeydown: [
|
|
32
|
+
t[1] || (t[1] = s(d((...l) => e(o) && e(o)(...l), ["prevent"]), ["enter"])),
|
|
33
|
+
t[2] || (t[2] = s(d((...l) => e(r) && e(r)(...l), ["prevent"]), ["esc"]))
|
|
34
|
+
]
|
|
35
|
+
}, [
|
|
36
|
+
(u(!0), i(g, null, N(a.options || [], (l) => (u(), i("option", {
|
|
37
|
+
key: l.value,
|
|
38
|
+
value: l.value
|
|
39
|
+
}, w(l.label), 9, $))), 128))
|
|
40
|
+
], 544)), [
|
|
41
|
+
[R, e(n)]
|
|
42
|
+
]) : a.type === "date" ? p((u(), i("input", {
|
|
43
|
+
key: 2,
|
|
44
|
+
"onUpdate:modelValue": t[3] || (t[3] = (l) => v(n) ? n.value = l : null),
|
|
45
|
+
type: "date",
|
|
46
|
+
class: "gsc-control",
|
|
47
|
+
onKeydown: [
|
|
48
|
+
t[4] || (t[4] = s(d((...l) => e(o) && e(o)(...l), ["prevent"]), ["enter"])),
|
|
49
|
+
t[5] || (t[5] = s(d((...l) => e(r) && e(r)(...l), ["prevent"]), ["esc"]))
|
|
50
|
+
]
|
|
51
|
+
}, null, 544)), [
|
|
52
|
+
[y, e(n)]
|
|
53
|
+
]) : a.type === "datetime-local" ? p((u(), i("input", {
|
|
54
|
+
key: 3,
|
|
55
|
+
"onUpdate:modelValue": t[6] || (t[6] = (l) => v(n) ? n.value = l : null),
|
|
56
|
+
type: "datetime-local",
|
|
57
|
+
class: "gsc-control",
|
|
58
|
+
onKeydown: [
|
|
59
|
+
t[7] || (t[7] = s(d((...l) => e(o) && e(o)(...l), ["prevent"]), ["enter"])),
|
|
60
|
+
t[8] || (t[8] = s(d((...l) => e(r) && e(r)(...l), ["prevent"]), ["esc"]))
|
|
61
|
+
]
|
|
62
|
+
}, null, 544)), [
|
|
63
|
+
[y, e(n)]
|
|
64
|
+
]) : a.type === "number" ? p((u(), i("input", {
|
|
65
|
+
key: 4,
|
|
66
|
+
"onUpdate:modelValue": t[9] || (t[9] = (l) => v(n) ? n.value = l : null),
|
|
67
|
+
type: "number",
|
|
68
|
+
class: "gsc-control",
|
|
69
|
+
onKeydown: [
|
|
70
|
+
t[10] || (t[10] = s(d((...l) => e(o) && e(o)(...l), ["prevent"]), ["enter"])),
|
|
71
|
+
t[11] || (t[11] = s(d((...l) => e(r) && e(r)(...l), ["prevent"]), ["esc"]))
|
|
72
|
+
]
|
|
73
|
+
}, null, 544)), [
|
|
74
|
+
[
|
|
75
|
+
y,
|
|
76
|
+
e(n),
|
|
77
|
+
void 0,
|
|
78
|
+
{ number: !0 }
|
|
79
|
+
]
|
|
80
|
+
]) : a.type === "rich-text" ? (u(), i(g, { key: 5 }, [
|
|
81
|
+
m.$slots.custom ? (u(), i("div", H, [
|
|
82
|
+
V(m.$slots, "custom", {
|
|
83
|
+
modelValue: e(n),
|
|
84
|
+
update: e(f),
|
|
85
|
+
commit: e(o),
|
|
86
|
+
cancel: e(r)
|
|
87
|
+
}, void 0, !0)
|
|
88
|
+
])) : (u(), i("div", {
|
|
89
|
+
key: 1,
|
|
90
|
+
ref_key: "richRef",
|
|
91
|
+
ref: k,
|
|
92
|
+
contenteditable: "",
|
|
93
|
+
class: "gsc-textarea",
|
|
94
|
+
onInput: S
|
|
95
|
+
}, w(e(n)), 545))
|
|
96
|
+
], 64)) : p((u(), i("input", {
|
|
97
|
+
key: 6,
|
|
98
|
+
"onUpdate:modelValue": t[12] || (t[12] = (l) => v(n) ? n.value = l : null),
|
|
99
|
+
class: "gsc-control",
|
|
100
|
+
onKeydown: [
|
|
101
|
+
t[13] || (t[13] = s(d((...l) => e(o) && e(o)(...l), ["prevent"]), ["enter"])),
|
|
102
|
+
t[14] || (t[14] = s(d((...l) => e(r) && e(r)(...l), ["prevent"]), ["esc"]))
|
|
103
|
+
]
|
|
104
|
+
}, null, 544)), [
|
|
105
|
+
[y, e(n)]
|
|
106
|
+
]),
|
|
107
|
+
T("div", j, [
|
|
108
|
+
C(e(b), {
|
|
109
|
+
variant: "primary",
|
|
110
|
+
onClick: e(o)
|
|
111
|
+
}, {
|
|
112
|
+
default: x(() => [...t[15] || (t[15] = [
|
|
113
|
+
K(" OK ", -1)
|
|
114
|
+
])]),
|
|
115
|
+
_: 1
|
|
116
|
+
}, 8, ["onClick"]),
|
|
117
|
+
C(e(b), {
|
|
118
|
+
variant: "default",
|
|
119
|
+
onClick: e(r)
|
|
120
|
+
}, {
|
|
121
|
+
default: x(() => [...t[16] || (t[16] = [
|
|
122
|
+
K(" Cancel ", -1)
|
|
123
|
+
])]),
|
|
124
|
+
_: 1
|
|
125
|
+
}, 8, ["onClick"])
|
|
126
|
+
])
|
|
127
|
+
]));
|
|
128
|
+
}
|
|
129
|
+
}, P = /* @__PURE__ */ D(A, [["__scopeId", "data-v-dc815e23"]]);
|
|
130
|
+
export {
|
|
131
|
+
P as default
|
|
132
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[data-v-dc815e23],[data-v-dc815e23]:before,[data-v-dc815e23]: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-dc815e23]::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: }.mt-2[data-v-dc815e23]{margin-top:.5rem}.flex[data-v-dc815e23]{display:flex}.justify-end[data-v-dc815e23]{justify-content:flex-end}.gap-2[data-v-dc815e23]{gap:.5rem}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[data-v-aa324207],[data-v-aa324207]:before,[data-v-aa324207]: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-aa324207]::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: }.absolute[data-v-aa324207]{position:absolute}.left-0[data-v-aa324207]{left:0}.top-full[data-v-aa324207]{top:100%}.z-20[data-v-aa324207]{z-index:20}.mt-2[data-v-aa324207]{margin-top:.5rem}.mt-3[data-v-aa324207]{margin-top:.75rem}.min-w-44[data-v-aa324207]{min-width:11rem}.flex[data-v-aa324207]{display:flex}.justify-end[data-v-aa324207]{justify-content:flex-end}.gap-2[data-v-aa324207]{gap:.5rem}.p-3[data-v-aa324207]{padding:.75rem}
|