@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,156 @@
|
|
|
1
|
+
import { ref as v, computed as s, onMounted as T, onBeforeUnmount as W, openBlock as N, createElementBlock as j, Fragment as I, createVNode as w, unref as r, withCtx as c, createElementVNode as g, normalizeStyle as L, createTextVNode as h, toDisplayString as x, createBlock as $, createCommentVNode as G, renderSlot as Q } from "vue";
|
|
2
|
+
import { useLocale as U } from "../../../hooks/useLocale.js";
|
|
3
|
+
import { GscForm as A } from "../../../Form/index.js";
|
|
4
|
+
import { GscButton as k } from "../../../Button/index.js";
|
|
5
|
+
import './QueryBar.css';/* empty css */
|
|
6
|
+
import D from "../../../../_virtual/_plugin-vue_export-helper.js";
|
|
7
|
+
const O = { class: "actions-left" }, P = { class: "actions-right flex items-center gap-2" }, H = {
|
|
8
|
+
__name: "QueryBar",
|
|
9
|
+
props: {
|
|
10
|
+
schema: { type: Array, default: () => [] },
|
|
11
|
+
modelValue: { type: Object, default: () => ({}) },
|
|
12
|
+
loading: { type: Boolean, default: !1 }
|
|
13
|
+
},
|
|
14
|
+
emits: ["update:modelValue", "search", "reset"],
|
|
15
|
+
setup(f, { emit: _ }) {
|
|
16
|
+
const b = f, i = _, { t: u } = U(), d = v(!0), m = v(null);
|
|
17
|
+
function z(t = []) {
|
|
18
|
+
return (t || []).filter(Boolean).map((e) => ({
|
|
19
|
+
key: e.key,
|
|
20
|
+
label: e.label ?? e.title ?? e.key,
|
|
21
|
+
type: e.type ?? "text",
|
|
22
|
+
placeholder: e.placeholder,
|
|
23
|
+
options: e.options,
|
|
24
|
+
span: e.span,
|
|
25
|
+
startKey: e.startKey,
|
|
26
|
+
endKey: e.endKey,
|
|
27
|
+
showTime: e.showTime || e.withTime || !1,
|
|
28
|
+
defaultValue: e.defaultValue
|
|
29
|
+
})).filter((e) => e.type === "dateRange" ? !!(e.startKey && e.endKey) : !!e.key);
|
|
30
|
+
}
|
|
31
|
+
const B = s(() => z(b.schema)), V = v(typeof window < "u" ? window.innerWidth : 1200);
|
|
32
|
+
function C() {
|
|
33
|
+
typeof window < "u" && (V.value = window.innerWidth);
|
|
34
|
+
}
|
|
35
|
+
T(() => {
|
|
36
|
+
typeof window < "u" && window.addEventListener("resize", C);
|
|
37
|
+
}), W(() => {
|
|
38
|
+
typeof window < "u" && window.removeEventListener("resize", C);
|
|
39
|
+
});
|
|
40
|
+
const p = s(() => {
|
|
41
|
+
const t = V.value || 1200;
|
|
42
|
+
return t >= 3840 ? 8 : t >= 2560 ? 7 : t >= 1920 ? 6 : t >= 1536 ? 5 : t >= 1280 ? 4 : t >= 1024 ? 3 : t >= 768 ? 2 : 1;
|
|
43
|
+
});
|
|
44
|
+
function S(t) {
|
|
45
|
+
if (!t)
|
|
46
|
+
return 1;
|
|
47
|
+
if (t.type === "dateRange")
|
|
48
|
+
return 2;
|
|
49
|
+
const e = Number(t.span || 0);
|
|
50
|
+
return e >= 1 ? e : 1;
|
|
51
|
+
}
|
|
52
|
+
function F(t, e) {
|
|
53
|
+
let n = 1, o = 0;
|
|
54
|
+
for (const l of t) {
|
|
55
|
+
const a = Math.min(S(l), e);
|
|
56
|
+
o + a > e ? (n += 1, o = a) : o += a;
|
|
57
|
+
}
|
|
58
|
+
return n;
|
|
59
|
+
}
|
|
60
|
+
const K = s(() => {
|
|
61
|
+
const t = p.value;
|
|
62
|
+
return F(B.value, t) > 2;
|
|
63
|
+
}), R = s(() => {
|
|
64
|
+
const t = B.value, e = p.value;
|
|
65
|
+
if (!K.value || !d.value)
|
|
66
|
+
return t;
|
|
67
|
+
const n = [];
|
|
68
|
+
let o = 1, l = 0;
|
|
69
|
+
for (const a of t) {
|
|
70
|
+
const y = Math.min(S(a), e);
|
|
71
|
+
if (l + y > e ? (o += 1, l = y) : l += y, o > 2)
|
|
72
|
+
break;
|
|
73
|
+
n.push(a);
|
|
74
|
+
}
|
|
75
|
+
return n;
|
|
76
|
+
}), q = s(() => {
|
|
77
|
+
const t = p.value || 1;
|
|
78
|
+
return t <= 2 ? { gridColumn: "1 / -1", display: "flex", justifyContent: "flex-end", gap: "8px", alignItems: "center" } : { gridColumn: `${Math.max(1, t - 1)} / span 2`, display: "flex", justifyContent: "flex-end", gap: "6px", alignItems: "center" };
|
|
79
|
+
});
|
|
80
|
+
function E() {
|
|
81
|
+
try {
|
|
82
|
+
m.value?.submit();
|
|
83
|
+
} catch {
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
function M() {
|
|
87
|
+
try {
|
|
88
|
+
m.value?.reset();
|
|
89
|
+
} catch {
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return (t, e) => (N(), j(I, null, [
|
|
93
|
+
w(r(A), {
|
|
94
|
+
ref_key: "innerForm",
|
|
95
|
+
ref: m,
|
|
96
|
+
schema: R.value,
|
|
97
|
+
"model-value": b.modelValue,
|
|
98
|
+
"show-actions": !1,
|
|
99
|
+
"onUpdate:modelValue": e[1] || (e[1] = (n) => i("update:modelValue", n)),
|
|
100
|
+
onSubmit: e[2] || (e[2] = (n) => {
|
|
101
|
+
i("update:modelValue", n), i("search", n);
|
|
102
|
+
}),
|
|
103
|
+
onReset: e[3] || (e[3] = (n) => {
|
|
104
|
+
i("update:modelValue", n), i("reset", n);
|
|
105
|
+
})
|
|
106
|
+
}, {
|
|
107
|
+
actions: c(() => [
|
|
108
|
+
g("div", {
|
|
109
|
+
class: "gsc-form-actions-unified",
|
|
110
|
+
style: L(q.value)
|
|
111
|
+
}, [
|
|
112
|
+
g("div", O, [
|
|
113
|
+
w(r(k), {
|
|
114
|
+
variant: "default",
|
|
115
|
+
disabled: f.loading,
|
|
116
|
+
onClick: M
|
|
117
|
+
}, {
|
|
118
|
+
default: c(() => [
|
|
119
|
+
h(x(r(u)("gsc.grid.queryBar.action.reset")), 1)
|
|
120
|
+
]),
|
|
121
|
+
_: 1
|
|
122
|
+
}, 8, ["disabled"])
|
|
123
|
+
]),
|
|
124
|
+
g("div", P, [
|
|
125
|
+
w(r(k), {
|
|
126
|
+
variant: "primary",
|
|
127
|
+
disabled: f.loading,
|
|
128
|
+
onClick: E
|
|
129
|
+
}, {
|
|
130
|
+
default: c(() => [
|
|
131
|
+
h(x(r(u)("gsc.grid.queryBar.action.search")), 1)
|
|
132
|
+
]),
|
|
133
|
+
_: 1
|
|
134
|
+
}, 8, ["disabled"]),
|
|
135
|
+
K.value ? (N(), $(r(k), {
|
|
136
|
+
key: 0,
|
|
137
|
+
variant: "link",
|
|
138
|
+
onClick: e[0] || (e[0] = (n) => d.value = !d.value)
|
|
139
|
+
}, {
|
|
140
|
+
default: c(() => [
|
|
141
|
+
h(x(d.value ? r(u)("gsc.grid.queryBar.action.expand") : r(u)("gsc.grid.queryBar.action.collapse")), 1)
|
|
142
|
+
]),
|
|
143
|
+
_: 1
|
|
144
|
+
})) : G("", !0)
|
|
145
|
+
])
|
|
146
|
+
], 4)
|
|
147
|
+
]),
|
|
148
|
+
_: 1
|
|
149
|
+
}, 8, ["schema", "model-value"]),
|
|
150
|
+
Q(t.$slots, "extra", {}, void 0, !0)
|
|
151
|
+
], 64));
|
|
152
|
+
}
|
|
153
|
+
}, ne = /* @__PURE__ */ D(H, [["__scopeId", "data-v-366b3fad"]]);
|
|
154
|
+
export {
|
|
155
|
+
ne as default
|
|
156
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ref as t, watch as d } from "vue";
|
|
2
|
+
function f(a, l) {
|
|
3
|
+
const e = t(a.modelValue ?? "");
|
|
4
|
+
d(() => a.modelValue, (u) => {
|
|
5
|
+
e.value = u ?? "";
|
|
6
|
+
});
|
|
7
|
+
function o(u) {
|
|
8
|
+
e.value = u, l("update:modelValue", u);
|
|
9
|
+
}
|
|
10
|
+
function c() {
|
|
11
|
+
l("commit", e.value), l("update:modelValue", e.value);
|
|
12
|
+
}
|
|
13
|
+
function n() {
|
|
14
|
+
l("cancel");
|
|
15
|
+
}
|
|
16
|
+
return { localValue: e, updateLocal: o, commit: c, cancel: n };
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
f as useCellEditor
|
|
20
|
+
};
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import { ref as u, computed as g, watch as M } from "vue";
|
|
2
|
+
import { useVueTable as G } from "../../../../node_modules/@tanstack/vue-table/build/lib/index.js";
|
|
3
|
+
import { getPaginationRowModel as H, getFilteredRowModel as U, getSortedRowModel as B, getCoreRowModel as E, functionalUpdate as h } from "../../../../node_modules/@tanstack/table-core/build/lib/index.js";
|
|
4
|
+
function O(f = []) {
|
|
5
|
+
return (f || []).map((t) => ({
|
|
6
|
+
key: t.key,
|
|
7
|
+
title: t.title ?? t.label ?? t.key,
|
|
8
|
+
width: t.width,
|
|
9
|
+
minWidth: t.minWidth,
|
|
10
|
+
fixed: t.fixed,
|
|
11
|
+
sortable: !!t.sortable,
|
|
12
|
+
filterable: !!t.filterable,
|
|
13
|
+
filterType: t.filterType,
|
|
14
|
+
filterOptions: t.filterOptions,
|
|
15
|
+
formatter: t.formatter,
|
|
16
|
+
editor: t.editor,
|
|
17
|
+
options: t.options
|
|
18
|
+
}));
|
|
19
|
+
}
|
|
20
|
+
function J(f) {
|
|
21
|
+
return g(() => O(f.value).map((l) => ({
|
|
22
|
+
id: l.key,
|
|
23
|
+
accessorKey: l.key,
|
|
24
|
+
header: l.title,
|
|
25
|
+
size: l.width,
|
|
26
|
+
minSize: l.minWidth ?? 40,
|
|
27
|
+
enableSorting: l.sortable,
|
|
28
|
+
enableResizing: !0,
|
|
29
|
+
enableHiding: !0,
|
|
30
|
+
enablePinning: !0,
|
|
31
|
+
meta: { col: l },
|
|
32
|
+
cell: (v) => {
|
|
33
|
+
const d = v.getValue();
|
|
34
|
+
if (typeof l.formatter == "function")
|
|
35
|
+
try {
|
|
36
|
+
return l.formatter(d, { row: v.row.original, index: v.row.index });
|
|
37
|
+
} catch {
|
|
38
|
+
return String(d ?? "");
|
|
39
|
+
}
|
|
40
|
+
return String(d ?? "");
|
|
41
|
+
}
|
|
42
|
+
})));
|
|
43
|
+
}
|
|
44
|
+
function Z(f = {}) {
|
|
45
|
+
const {
|
|
46
|
+
data: t = [],
|
|
47
|
+
request: l,
|
|
48
|
+
mode: v = "server",
|
|
49
|
+
pageSize: d = 10,
|
|
50
|
+
initialQuery: T = {},
|
|
51
|
+
columns: q = [],
|
|
52
|
+
rowKey: D = "id",
|
|
53
|
+
enableRowSelection: F = !1
|
|
54
|
+
} = f, P = u(q || []), r = u(Array.isArray(t) ? (t || []).slice() : (t?.value || []).slice()), S = u({ ...T || {} }), c = u(0), z = u(!1), n = u({ pageIndex: 0, pageSize: d }), i = u([]), y = u({}), w = u({ left: [], right: [] }), b = u({}), N = J(P), o = g(() => v === "server" && typeof l == "function"), x = G({
|
|
55
|
+
get data() {
|
|
56
|
+
return r.value;
|
|
57
|
+
},
|
|
58
|
+
get columns() {
|
|
59
|
+
return N.value;
|
|
60
|
+
},
|
|
61
|
+
getRowId: (e, a) => {
|
|
62
|
+
const p = e && e[D];
|
|
63
|
+
return String(p === 0 || p ? p : a);
|
|
64
|
+
},
|
|
65
|
+
state: {
|
|
66
|
+
get sorting() {
|
|
67
|
+
return i.value;
|
|
68
|
+
},
|
|
69
|
+
get pagination() {
|
|
70
|
+
return n.value;
|
|
71
|
+
},
|
|
72
|
+
get columnVisibility() {
|
|
73
|
+
return y.value;
|
|
74
|
+
},
|
|
75
|
+
get columnPinning() {
|
|
76
|
+
return w.value;
|
|
77
|
+
},
|
|
78
|
+
get rowSelection() {
|
|
79
|
+
return b.value;
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
// 服务端排序变更时,重置到第一页
|
|
83
|
+
onSortingChange: (e) => {
|
|
84
|
+
i.value = h(e, i.value), o.value && (n.value = { ...n.value, pageIndex: 0 });
|
|
85
|
+
},
|
|
86
|
+
onPaginationChange: (e) => {
|
|
87
|
+
n.value = h(e, n.value);
|
|
88
|
+
},
|
|
89
|
+
onColumnVisibilityChange: (e) => {
|
|
90
|
+
y.value = h(e, y.value);
|
|
91
|
+
},
|
|
92
|
+
onColumnPinningChange: (e) => {
|
|
93
|
+
w.value = h(e, w.value);
|
|
94
|
+
},
|
|
95
|
+
enableRowSelection: !!F,
|
|
96
|
+
onRowSelectionChange: (e) => {
|
|
97
|
+
b.value = h(e, b.value);
|
|
98
|
+
},
|
|
99
|
+
manualPagination: o.value,
|
|
100
|
+
manualSorting: o.value,
|
|
101
|
+
manualFiltering: o.value,
|
|
102
|
+
pageCount: g(() => {
|
|
103
|
+
const e = n.value.pageSize || 1;
|
|
104
|
+
return Math.max(1, Math.ceil((c.value || 0) / e));
|
|
105
|
+
}),
|
|
106
|
+
enableColumnResizing: !0,
|
|
107
|
+
columnResizeMode: "onChange",
|
|
108
|
+
getCoreRowModel: E(),
|
|
109
|
+
getSortedRowModel: B(),
|
|
110
|
+
getFilteredRowModel: U(),
|
|
111
|
+
getPaginationRowModel: H()
|
|
112
|
+
}), k = g({
|
|
113
|
+
get: () => (n.value.pageIndex || 0) + 1,
|
|
114
|
+
set: (e) => {
|
|
115
|
+
const a = Math.max(1, Number(e || 1));
|
|
116
|
+
n.value = { ...n.value, pageIndex: a - 1 };
|
|
117
|
+
}
|
|
118
|
+
}), I = g({
|
|
119
|
+
get: () => n.value.pageSize,
|
|
120
|
+
set: (e) => {
|
|
121
|
+
const a = Math.max(1, Number(e || d));
|
|
122
|
+
n.value = { pageIndex: 0, pageSize: a };
|
|
123
|
+
}
|
|
124
|
+
}), R = g(() => {
|
|
125
|
+
const e = i.value && i.value[0];
|
|
126
|
+
return { id: e?.id ?? null, desc: !!e?.desc };
|
|
127
|
+
}), W = g(() => (x.getRowModel()?.rows || []).map((a) => a.original));
|
|
128
|
+
async function C() {
|
|
129
|
+
if (!o.value) {
|
|
130
|
+
c.value = r.value.length;
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
z.value = !0;
|
|
134
|
+
try {
|
|
135
|
+
const e = await l({
|
|
136
|
+
page: k.value,
|
|
137
|
+
pageSize: I.value,
|
|
138
|
+
query: S.value,
|
|
139
|
+
// 向后兼容:同时提供单列排序信息和多列排序数组。
|
|
140
|
+
sort: R.value,
|
|
141
|
+
sorts: i.value
|
|
142
|
+
});
|
|
143
|
+
r.value = (e?.records || []).slice(), c.value = Number(e?.total ?? r.value.length);
|
|
144
|
+
} finally {
|
|
145
|
+
z.value = !1;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
function j(e = {}) {
|
|
149
|
+
S.value = { ...e || {} }, o.value && (n.value = { ...n.value, pageIndex: 0 });
|
|
150
|
+
}
|
|
151
|
+
function V(e = []) {
|
|
152
|
+
r.value = (e || []).slice(), o.value || (c.value = r.value.length);
|
|
153
|
+
}
|
|
154
|
+
function A(e = []) {
|
|
155
|
+
P.value = (e || []).slice();
|
|
156
|
+
try {
|
|
157
|
+
const a = O(e || []), m = a.filter((s) => s.fixed === "left").map((s) => s.key), p = a.filter((s) => s.fixed === "right").map((s) => s.key);
|
|
158
|
+
x.setColumnPinning?.({ left: m, right: p });
|
|
159
|
+
} catch {
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
function Q(e) {
|
|
163
|
+
if (!e)
|
|
164
|
+
return;
|
|
165
|
+
const a = x.getColumn(e);
|
|
166
|
+
if (a && typeof a.toggleSorting == "function") {
|
|
167
|
+
a.toggleSorting(void 0, !1);
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
const m = i.value?.[0];
|
|
171
|
+
m?.id === e ? i.value = [{ id: e, desc: !m.desc }] : i.value = [{ id: e, desc: !1 }];
|
|
172
|
+
}
|
|
173
|
+
return t && typeof t == "object" && Object.prototype.hasOwnProperty.call(t, "value") && M(
|
|
174
|
+
() => t.value,
|
|
175
|
+
(e) => {
|
|
176
|
+
V(e || []);
|
|
177
|
+
},
|
|
178
|
+
{ deep: !0 }
|
|
179
|
+
), M(
|
|
180
|
+
() => [n.value.pageIndex, n.value.pageSize, R.value.id, R.value.desc],
|
|
181
|
+
() => {
|
|
182
|
+
o.value && C();
|
|
183
|
+
}
|
|
184
|
+
), M(
|
|
185
|
+
() => S.value,
|
|
186
|
+
() => {
|
|
187
|
+
o.value && C();
|
|
188
|
+
},
|
|
189
|
+
{ deep: !0 }
|
|
190
|
+
), o.value ? C() : c.value = r.value.length, {
|
|
191
|
+
table: x,
|
|
192
|
+
loading: z,
|
|
193
|
+
query: S,
|
|
194
|
+
page: k,
|
|
195
|
+
pageSize: I,
|
|
196
|
+
total: c,
|
|
197
|
+
rows: W,
|
|
198
|
+
sort: Q,
|
|
199
|
+
sortState: R,
|
|
200
|
+
sorting: i,
|
|
201
|
+
columnVisibility: y,
|
|
202
|
+
columnPinning: w,
|
|
203
|
+
rowSelection: b,
|
|
204
|
+
load: C,
|
|
205
|
+
setQuery: j,
|
|
206
|
+
setData: V,
|
|
207
|
+
setColumns: A,
|
|
208
|
+
mode: v
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
export {
|
|
212
|
+
Z as useGridTable
|
|
213
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.gsc-grid{color:var(--gsc-basic-text-primary);font-size:14px;line-height:1.5715}.gsc-grid .gsc-text-secondary{color:var(--gsc-basic-text-secondary)}.gsc-grid .gsc-card{border:1px solid var(--gsc-basic-divider);border-radius:8px;background:var(--gsc-basic-bg);box-shadow:var(--gsc-basic-shadow-light)}.gsc-grid .gsc-card-pad{padding:12px 16px}.gsc-grid .gsc-pager{display:flex;align-items:center;justify-content:flex-end;gap:10px;flex-wrap:wrap}.gsc-grid .gsc-pager .gsc-pager-jumper{display:inline-flex;align-items:center;gap:8px}.gsc-grid .gsc-table{width:100%;border-collapse:collapse;table-layout:fixed}.gsc-grid .gsc-thead{background:var(--gsc-basic-bg-hover)}.gsc-grid .gsc-th{border-bottom:1px solid var(--gsc-basic-divider);padding:10px 12px;text-align:left;font-weight:500;color:var(--gsc-basic-text-primary);-webkit-user-select:none;-moz-user-select:none;user-select:none}.gsc-grid .gsc-td{border-bottom:1px solid var(--gsc-basic-divider);padding:8px 12px;color:var(--gsc-basic-text-primary);background:var(--gsc-basic-bg)}.gsc-grid .gsc-tr{transition:background-color .2s}.gsc-grid .gsc-tr:hover,.gsc-grid .gsc-tr:hover .gsc-td{background:var(--gsc-basic-bg-hover)}.gsc-grid .gsc-divider-top{border-top:1px solid var(--gsc-basic-divider)}.gsc-grid .gsc-checkbox{-moz-appearance:none;appearance:none;-webkit-appearance:none;width:16px;height:16px;border:1px solid var(--gsc-basic-border);border-radius:4px;background:var(--gsc-basic-bg);display:inline-grid;place-content:center;cursor:pointer;vertical-align:middle;transition:border-color .2s,background-color .2s,box-shadow .2s}.gsc-grid .gsc-checkbox:hover{border-color:var(--gsc-basic-primary-hover)}.gsc-grid .gsc-checkbox:focus-visible{outline:none;box-shadow:var(--gsc-basic-focus-shadow)}.gsc-grid .gsc-checkbox:checked{background:var(--gsc-basic-primary);color:var(--gsc-basic-text-primary)}.gsc-grid .gsc-checkbox:checked:after{content:"";width:4px;height:8px;border:2px solid var(--gsc-basic-bg);border-top:0;border-left:0;transform:rotate(45deg);margin-top:-1px}.gsc-grid .gsc-checkbox:indeterminate{background:var(--gsc-basic-primary);border-color:var(--gsc-basic-primary)}.gsc-grid .gsc-checkbox:indeterminate:after{content:"";width:8px;height:2px;background:var(--gsc-basic-bg);border-radius:1px}.gsc-grid .gsc-popover{border:1px solid var(--gsc-basic-divider);border-radius:10px;background:var(--gsc-basic-bg);box-shadow:var(--gsc-basic-shadow-popover)}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { createApp as u, h as l } from "vue";
|
|
2
|
+
import a from "./src/Modal.vue.js";
|
|
3
|
+
import f from "./src/Message.vue.js";
|
|
4
|
+
import p from "./src/Notice.vue.js";
|
|
5
|
+
let d = null, c = null;
|
|
6
|
+
function h() {
|
|
7
|
+
if (!d) {
|
|
8
|
+
const e = document.createElement("div");
|
|
9
|
+
document.body.appendChild(e), d = u(f).mount(e);
|
|
10
|
+
}
|
|
11
|
+
return d;
|
|
12
|
+
}
|
|
13
|
+
function v() {
|
|
14
|
+
if (!c) {
|
|
15
|
+
const e = document.createElement("div");
|
|
16
|
+
document.body.appendChild(e), c = u(p).mount(e);
|
|
17
|
+
}
|
|
18
|
+
return c;
|
|
19
|
+
}
|
|
20
|
+
function y(e) {
|
|
21
|
+
return h().add(e || {});
|
|
22
|
+
}
|
|
23
|
+
function C(e) {
|
|
24
|
+
return v().add(e || {});
|
|
25
|
+
}
|
|
26
|
+
function E(e = {}, n = {}) {
|
|
27
|
+
const t = document.createElement("div");
|
|
28
|
+
document.body.appendChild(t);
|
|
29
|
+
const s = Object.fromEntries(
|
|
30
|
+
Object.entries(n || {}).map(([m, r]) => [m, typeof r == "function" ? r : () => r])
|
|
31
|
+
), i = u({
|
|
32
|
+
render() {
|
|
33
|
+
return l(
|
|
34
|
+
a,
|
|
35
|
+
{
|
|
36
|
+
ref: "modalRef",
|
|
37
|
+
...e,
|
|
38
|
+
"onUpdate:modelValue": (m) => {
|
|
39
|
+
m || setTimeout(() => {
|
|
40
|
+
i.unmount(), t.parentNode && t.parentNode.removeChild(t);
|
|
41
|
+
}, 0);
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
s
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
}), o = i.mount(t);
|
|
48
|
+
return {
|
|
49
|
+
close: () => {
|
|
50
|
+
o && o.$refs && o.$refs.modalRef && o.$refs.modalRef.$emit("update:modelValue", !1);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
export {
|
|
55
|
+
f as Message,
|
|
56
|
+
a as Modal,
|
|
57
|
+
p as Notice,
|
|
58
|
+
E as openModal,
|
|
59
|
+
y as showMessage,
|
|
60
|
+
C as showNotice
|
|
61
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.gsc-message-wrapper[data-v-82eadbcc]{position:fixed;top:16px;right:16px;z-index:1100;display:flex;flex-direction:column;gap:8px}.gsc-message[data-v-82eadbcc]{background:var(--gsc-basic-bg);padding:10px 14px;border-radius:6px;box-shadow:var(--gsc-basic-shadow-light);display:flex;align-items:center;min-width:180px}.gsc-message.info[data-v-82eadbcc]{border-left:4px solid var(--gsc-basic-primary)}.gsc-message.success[data-v-82eadbcc]{border-left:4px solid var(--gsc-basic-success)}.gsc-message.error[data-v-82eadbcc]{border-left:4px solid var(--gsc-basic-danger)}.gsc-message__content[data-v-82eadbcc]{flex:1}.gsc-message__close[data-v-82eadbcc]{border:0;background:transparent;cursor:pointer;padding-left:8px;font-size:20px;width:36px;height:36px;display:flex;align-items:center;justify-content:center;border-radius:6px;line-height:1;transition:background-color .15s ease}.gsc-message__close[data-v-82eadbcc]:hover{background:var(--gsc-basic-bg-hover-icon)}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { reactive as d, toRefs as g, openBlock as a, createElementBlock as r, Fragment as f, renderList as u, unref as k, normalizeClass as v, createElementVNode as i, toDisplayString as x } from "vue";
|
|
2
|
+
import './Message2.css';import './Message.css';/* empty css */
|
|
3
|
+
/* empty css */
|
|
4
|
+
import y from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
+
const h = { class: "gsc-message-wrapper" }, C = { class: "gsc-message__content" }, b = ["onClick"], B = {
|
|
6
|
+
__name: "Message",
|
|
7
|
+
setup(E, { expose: _ }) {
|
|
8
|
+
const t = d({ messages: [] });
|
|
9
|
+
let m = 0;
|
|
10
|
+
function l({ text: o = "", type: s = "info", duration: e = 3e3 } = {}) {
|
|
11
|
+
const c = ++m;
|
|
12
|
+
return t.messages.push({ key: c, text: o, type: s }), e > 0 && setTimeout(() => n(c), e), c;
|
|
13
|
+
}
|
|
14
|
+
function n(o) {
|
|
15
|
+
const s = t.messages.findIndex((e) => e.key === o);
|
|
16
|
+
s >= 0 && t.messages.splice(s, 1);
|
|
17
|
+
}
|
|
18
|
+
_({ add: l, remove: n });
|
|
19
|
+
const { messages: p } = g(t);
|
|
20
|
+
return (o, s) => (a(), r("div", h, [
|
|
21
|
+
(a(!0), r(f, null, u(k(p), (e) => (a(), r("div", {
|
|
22
|
+
key: e.key,
|
|
23
|
+
class: v(["gsc-message", e.type])
|
|
24
|
+
}, [
|
|
25
|
+
i("div", C, x(e.text), 1),
|
|
26
|
+
i("button", {
|
|
27
|
+
class: "gsc-message__close",
|
|
28
|
+
onClick: (c) => n(e.key)
|
|
29
|
+
}, " × ", 8, b)
|
|
30
|
+
], 2))), 128))
|
|
31
|
+
]));
|
|
32
|
+
}
|
|
33
|
+
}, D = /* @__PURE__ */ y(B, [["__scopeId", "data-v-82eadbcc"]]);
|
|
34
|
+
export {
|
|
35
|
+
D as default
|
|
36
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[data-v-82eadbcc],[data-v-82eadbcc]:before,[data-v-82eadbcc]: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-82eadbcc]::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: }.fixed[data-v-82eadbcc]{position:fixed}.flex[data-v-82eadbcc]{display:flex}.border[data-v-82eadbcc]{border-width:1px}.transition[data-v-82eadbcc]{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.ease[data-v-82eadbcc]{transition-timing-function:cubic-bezier(.4,0,.2,1)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.gsc-overlay[data-v-bd2a624e]{position:fixed;inset:0;z-index:1000;display:flex;align-items:center;justify-content:center}.gsc-mask[data-v-bd2a624e]{position:fixed;inset:0;background:var(--gsc-basic-mask-bg)}.gsc-modal[data-v-bd2a624e]{position:relative;z-index:1001;background:var(--gsc-basic-bg);border-radius:8px;min-width:320px;max-width:90%;box-shadow:var(--gsc-basic-shadow-popover);overflow:hidden}.gsc-modal__header[data-v-bd2a624e]{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;border-bottom:1px solid var(--gsc-basic-divider)}.gsc-modal__title[data-v-bd2a624e]{margin:0;font-size:16px}.gsc-modal__close[data-v-bd2a624e]{background:none;border:0;font-size:20px;cursor:pointer;width:36px;height:36px;display:flex;align-items:center;justify-content:center;border-radius:6px;transition:background-color .15s ease}.gsc-modal__close[data-v-bd2a624e]:hover{background:var(--gsc-basic-bg-hover-icon)}.gsc-modal__body[data-v-bd2a624e]{padding:16px}.gsc-modal__footer[data-v-bd2a624e]{padding:12px 16px;border-top:1px solid var(--gsc-basic-divider);text-align:right}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { computed as h, watch as v, onBeforeUnmount as k, openBlock as i, createElementBlock as u, createCommentVNode as f, createElementVNode as e, toDisplayString as g, renderSlot as m } from "vue";
|
|
2
|
+
import './Modal2.css';import './Modal.css';/* empty css */
|
|
3
|
+
/* empty css */
|
|
4
|
+
import b from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
+
const B = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "gsc-overlay"
|
|
8
|
+
}, w = {
|
|
9
|
+
class: "gsc-modal",
|
|
10
|
+
role: "dialog",
|
|
11
|
+
"aria-modal": "true"
|
|
12
|
+
}, C = { class: "gsc-modal__header" }, M = { class: "gsc-modal__title" }, V = { class: "gsc-modal__body" }, S = { class: "gsc-modal__footer" }, x = {
|
|
13
|
+
__name: "Modal",
|
|
14
|
+
props: {
|
|
15
|
+
modelValue: { type: Boolean, default: !1 },
|
|
16
|
+
title: { type: String, default: "" },
|
|
17
|
+
maskClose: { type: Boolean, default: !0 },
|
|
18
|
+
showMask: { type: Boolean, default: !0 }
|
|
19
|
+
},
|
|
20
|
+
emits: ["update:modelValue", "close"],
|
|
21
|
+
setup(a, { emit: _ }) {
|
|
22
|
+
const d = a, n = _, t = h(() => d.modelValue);
|
|
23
|
+
let o = 0, l = null;
|
|
24
|
+
function p() {
|
|
25
|
+
typeof document > "u" || (o === 0 && (l = document.body.style.overflow, document.body.style.overflow = "hidden"), o++);
|
|
26
|
+
}
|
|
27
|
+
function c() {
|
|
28
|
+
typeof document > "u" || (o = Math.max(0, o - 1), o === 0 && (l !== null ? document.body.style.overflow = l : document.body.style.overflow = "", l = null));
|
|
29
|
+
}
|
|
30
|
+
v(t, (s) => {
|
|
31
|
+
s ? p() : c();
|
|
32
|
+
}), k(() => {
|
|
33
|
+
t.value && t.value && c();
|
|
34
|
+
});
|
|
35
|
+
function r() {
|
|
36
|
+
n("update:modelValue", !1), n("close");
|
|
37
|
+
}
|
|
38
|
+
function y() {
|
|
39
|
+
d.maskClose && r();
|
|
40
|
+
}
|
|
41
|
+
return (s, E) => t.value ? (i(), u("div", B, [
|
|
42
|
+
d.showMask ? (i(), u("div", {
|
|
43
|
+
key: 0,
|
|
44
|
+
class: "gsc-mask",
|
|
45
|
+
onClick: y
|
|
46
|
+
})) : f("", !0),
|
|
47
|
+
e("div", w, [
|
|
48
|
+
e("header", C, [
|
|
49
|
+
e("h3", M, g(a.title), 1),
|
|
50
|
+
e("button", {
|
|
51
|
+
class: "gsc-modal__close",
|
|
52
|
+
onClick: r
|
|
53
|
+
}, " × ")
|
|
54
|
+
]),
|
|
55
|
+
e("section", V, [
|
|
56
|
+
m(s.$slots, "default", {}, void 0, !0)
|
|
57
|
+
]),
|
|
58
|
+
e("footer", S, [
|
|
59
|
+
m(s.$slots, "footer", {}, void 0, !0)
|
|
60
|
+
])
|
|
61
|
+
])
|
|
62
|
+
])) : f("", !0);
|
|
63
|
+
}
|
|
64
|
+
}, O = /* @__PURE__ */ b(x, [["__scopeId", "data-v-bd2a624e"]]);
|
|
65
|
+
export {
|
|
66
|
+
O as default
|
|
67
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[data-v-bd2a624e],[data-v-bd2a624e]:before,[data-v-bd2a624e]: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-bd2a624e]::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: }.visible[data-v-bd2a624e]{visibility:visible}.fixed[data-v-bd2a624e]{position:fixed}.relative[data-v-bd2a624e]{position:relative}.hidden[data-v-bd2a624e]{display:none}.flex[data-v-bd2a624e]{display:flex}.border[data-v-bd2a624e]{border-width:1px}.transition[data-v-bd2a624e]{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.ease[data-v-bd2a624e]{transition-timing-function:cubic-bezier(.4,0,.2,1)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.gsc-notice-wrapper[data-v-9ecbc548]{position:fixed;bottom:16px;right:16px;z-index:1100;display:flex;flex-direction:column;gap:10px}.gsc-notice[data-v-9ecbc548]{background:var(--gsc-basic-bg);padding:12px;border-radius:6px;box-shadow:var(--gsc-basic-shadow-popover);min-width:240px;position:relative}.gsc-notice__title[data-v-9ecbc548]{font-weight:600;margin-bottom:6px;color:var(--gsc-basic-text-primary)}.gsc-notice__content[data-v-9ecbc548]{color:var(--gsc-basic-text-secondary)}.gsc-notice__close[data-v-9ecbc548]{position:absolute;top:6px;right:8px;border:0;background:transparent;cursor:pointer;font-size:20px;width:36px;height:36px;display:flex;align-items:center;justify-content:center;border-radius:6px;line-height:1;transition:background-color .15s ease}.gsc-notice__close[data-v-9ecbc548]:hover{background:var(--gsc-basic-bg-hover-icon)}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { reactive as u, toRefs as f, openBlock as i, createElementBlock as r, Fragment as k, renderList as v, unref as g, createElementVNode as _, toDisplayString as l } from "vue";
|
|
2
|
+
import './Notice2.css';import './Notice.css';/* empty css */
|
|
3
|
+
/* empty css */
|
|
4
|
+
import h from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
+
const x = { class: "gsc-notice-wrapper" }, y = { class: "gsc-notice__title" }, N = { class: "gsc-notice__content" }, b = ["onClick"], B = {
|
|
6
|
+
__name: "Notice",
|
|
7
|
+
setup(C, { expose: a }) {
|
|
8
|
+
const c = u({ notices: [] });
|
|
9
|
+
let d = 0;
|
|
10
|
+
function p({ title: o = "", content: t = "", duration: e = 0 } = {}) {
|
|
11
|
+
const s = ++d;
|
|
12
|
+
return c.notices.push({ key: s, title: o, content: t }), e > 0 && setTimeout(() => n(s), e), s;
|
|
13
|
+
}
|
|
14
|
+
function n(o) {
|
|
15
|
+
const t = c.notices.findIndex((e) => e.key === o);
|
|
16
|
+
t >= 0 && c.notices.splice(t, 1);
|
|
17
|
+
}
|
|
18
|
+
a({ add: p, remove: n });
|
|
19
|
+
const { notices: m } = f(c);
|
|
20
|
+
return (o, t) => (i(), r("div", x, [
|
|
21
|
+
(i(!0), r(k, null, v(g(m), (e) => (i(), r("div", {
|
|
22
|
+
key: e.key,
|
|
23
|
+
class: "gsc-notice"
|
|
24
|
+
}, [
|
|
25
|
+
_("div", y, l(e.title), 1),
|
|
26
|
+
_("div", N, l(e.content), 1),
|
|
27
|
+
_("button", {
|
|
28
|
+
class: "gsc-notice__close",
|
|
29
|
+
onClick: (s) => n(e.key)
|
|
30
|
+
}, " × ", 8, b)
|
|
31
|
+
]))), 128))
|
|
32
|
+
]));
|
|
33
|
+
}
|
|
34
|
+
}, F = /* @__PURE__ */ h(B, [["__scopeId", "data-v-9ecbc548"]]);
|
|
35
|
+
export {
|
|
36
|
+
F as default
|
|
37
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[data-v-9ecbc548],[data-v-9ecbc548]:before,[data-v-9ecbc548]: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-9ecbc548]::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-9ecbc548]{position:absolute}.fixed[data-v-9ecbc548]{position:fixed}.relative[data-v-9ecbc548]{position:relative}.flex[data-v-9ecbc548]{display:flex}.border[data-v-9ecbc548]{border-width:1px}.transition[data-v-9ecbc548]{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.ease[data-v-9ecbc548]{transition-timing-function:cubic-bezier(.4,0,.2,1)}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { reactive as y, ref as S, watch as $, onMounted as j, nextTick as w,
|
|
1
|
+
import { reactive as y, ref as S, watch as $, onMounted as j, nextTick as w, openBlock as v, createElementBlock as O, normalizeClass as _, unref as z, normalizeStyle as b, createElementVNode as k, renderSlot as N } from "vue";
|
|
2
2
|
import { useWindowSizeFn as B } from "@gsc-basic/hooks";
|
|
3
3
|
import { useNamespace as M } from "../../hooks/useNamespace.js";
|
|
4
4
|
import './index2.css';import './index.css';/* empty css */
|
|
@@ -93,7 +93,7 @@ const E = {
|
|
|
93
93
|
w(async () => {
|
|
94
94
|
await g(), p(), f();
|
|
95
95
|
});
|
|
96
|
-
}), (t, o) => (
|
|
96
|
+
}), (t, o) => (v(), O("section", {
|
|
97
97
|
ref_key: "box",
|
|
98
98
|
ref: h,
|
|
99
99
|
style: b(s.boxStyle),
|