@gsc-basic/components 1.0.2 → 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/dist/es/index.js +43 -29
- package/dist/es/node_modules/@codemirror/autocomplete/dist/index.js +15 -15
- package/dist/es/node_modules/@codemirror/commands/dist/index.js +5 -5
- 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 +1 -1
- package/dist/es/node_modules/@codemirror/lint/dist/index.js +7 -7
- package/dist/es/node_modules/@codemirror/search/dist/index.js +9 -9
- package/dist/es/node_modules/@codemirror/view/dist/index.js +7 -7
- package/dist/es/node_modules/@lezer/lr/dist/index.js +4 -2
- package/dist/es/node_modules/@tanstack/form-core/dist/esm/FormApi.js +146 -142
- package/dist/es/node_modules/@tanstack/vue-table/build/lib/index.js +7 -7
- 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/src/Grid.css +1 -1
- package/dist/es/src/Grid/src/Grid.vue.js +77 -83
- package/dist/es/src/Grid/src/components/ActionBar.css +1 -1
- package/dist/es/src/Grid/src/components/ActionBar.vue.js +43 -36
- package/dist/es/src/Grid/src/components/CellEditor.css +1 -1
- package/dist/es/src/Grid/src/components/CellEditor.vue.js +80 -69
- package/dist/es/src/Grid/src/components/CellEditor2.css +1 -1
- package/dist/es/src/Grid/src/components/ColumnFilter.css +1 -1
- package/dist/es/src/Grid/src/components/ColumnFilter.vue.js +45 -34
- package/dist/es/src/Grid/src/components/ColumnSettings.css +1 -1
- package/dist/es/src/Grid/src/components/ColumnSettings.vue.js +72 -49
- package/dist/es/src/Grid/src/components/DataTable.css +1 -1
- package/dist/es/src/Grid/src/components/DataTable.vue.js +251 -228
- package/dist/es/src/Grid/src/components/Pager.css +1 -1
- package/dist/es/src/Grid/src/components/Pager.vue.js +40 -31
- package/dist/es/src/Grid/src/components/QueryBar.css +1 -1
- package/dist/es/src/Grid/src/components/QueryBar.vue.js +119 -147
- package/dist/es/src/Grid/src/composables/useGridTable.js +45 -44
- 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 +39 -25
- package/dist/es/src/styles/tokens.css +1 -1
- package/dist/lib/index.js +1 -1
- package/dist/lib/node_modules/@lezer/lr/dist/index.js +1 -1
- package/dist/lib/node_modules/@tanstack/form-core/dist/esm/FormApi.js +1 -1
- 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/src/Grid.css +1 -1
- package/dist/lib/src/Grid/src/Grid.vue.js +1 -1
- package/dist/lib/src/Grid/src/components/ActionBar.css +1 -1
- package/dist/lib/src/Grid/src/components/ActionBar.vue.js +1 -1
- package/dist/lib/src/Grid/src/components/CellEditor.css +1 -1
- package/dist/lib/src/Grid/src/components/CellEditor.vue.js +1 -1
- package/dist/lib/src/Grid/src/components/CellEditor2.css +1 -1
- package/dist/lib/src/Grid/src/components/ColumnFilter.css +1 -1
- package/dist/lib/src/Grid/src/components/ColumnFilter.vue.js +1 -1
- package/dist/lib/src/Grid/src/components/ColumnSettings.css +1 -1
- package/dist/lib/src/Grid/src/components/ColumnSettings.vue.js +1 -1
- package/dist/lib/src/Grid/src/components/DataTable.css +1 -1
- package/dist/lib/src/Grid/src/components/DataTable.vue.js +1 -1
- package/dist/lib/src/Grid/src/components/Pager.css +1 -1
- package/dist/lib/src/Grid/src/components/Pager.vue.js +1 -1
- package/dist/lib/src/Grid/src/components/QueryBar.css +1 -1
- package/dist/lib/src/Grid/src/components/QueryBar.vue.js +1 -1
- package/dist/lib/src/Grid/src/composables/useGridTable.js +1 -1
- 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/styles/tokens.css +1 -1
- package/package.json +9 -9
- package/dist/es/src/Grid/src/styles/antd.css +0 -1
- package/dist/es/src/Grid/src/utils/exportCsv.js +0 -15
- package/dist/lib/src/Grid/src/styles/antd.css +0 -1
- package/dist/lib/src/Grid/src/utils/exportCsv.js +0 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createTable as m } from "../../../table-core/build/lib/index.js";
|
|
2
2
|
import { ColumnFaceting as G, ColumnFiltering as T, ColumnGrouping as k, ColumnOrdering as j, ColumnPinning as z, ColumnSizing as D, ColumnVisibility as H, GlobalFaceting as I, GlobalFiltering as N, Headers as U, RowExpanding as $, RowPagination as B, RowPinning as K, RowSelection as L, RowSorting as O, _getVisibleLeafColumns as W, aggregationFns as X, buildHeaderGroups as Y, createCell as q, createColumn as J, createRow as Q, defaultColumnSizing as Z, expandRows as _, filterFns as ee, flattenBy as te, functionalUpdate as ne, getCoreRowModel as re, getFilteredRowModel as oe, getMemoOptions as ae, getPaginationRowModel as le, getSortedRowModel as ue, isFunction as ie, isNumberArray as ge, isRowSelected as se, isSubRowSelected as fe, makeStateUpdater as ce, memo as de, orderColumns as me, passiveEventSupported as we, reSplitAlphaNumeric as Re, selectRowsFn as Se, shouldAutoRemoveFilter as he, sortingFns as Ce } from "../../../table-core/build/lib/index.js";
|
|
3
|
-
import {
|
|
3
|
+
import { isRef as w, shallowRef as R, watch as S, ref as h, watchEffect as C, defineComponent as y, h as b, unref as p } from "vue";
|
|
4
4
|
function g() {
|
|
5
5
|
return !0;
|
|
6
6
|
}
|
|
@@ -53,7 +53,7 @@ function i() {
|
|
|
53
53
|
}
|
|
54
54
|
}, F);
|
|
55
55
|
}
|
|
56
|
-
const A =
|
|
56
|
+
const A = y({
|
|
57
57
|
props: ["render", "props"],
|
|
58
58
|
setup: (e) => () => typeof e.render == "function" || typeof e.render == "object" ? b(e.render, e.props) : e.render
|
|
59
59
|
});
|
|
@@ -63,7 +63,7 @@ function f(e) {
|
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
65
|
function E(e) {
|
|
66
|
-
const t =
|
|
66
|
+
const t = w(e.data), a = i({
|
|
67
67
|
state: {},
|
|
68
68
|
// Dummy state
|
|
69
69
|
onStateChange: () => {
|
|
@@ -78,8 +78,8 @@ function E(e) {
|
|
|
78
78
|
}
|
|
79
79
|
}, t ? f(e) : e), r = m(a);
|
|
80
80
|
if (t) {
|
|
81
|
-
const o =
|
|
82
|
-
|
|
81
|
+
const o = R(e.data);
|
|
82
|
+
S(o, () => {
|
|
83
83
|
r.setState((l) => ({
|
|
84
84
|
...l,
|
|
85
85
|
data: o.value
|
|
@@ -88,8 +88,8 @@ function E(e) {
|
|
|
88
88
|
immediate: !0
|
|
89
89
|
});
|
|
90
90
|
}
|
|
91
|
-
const n =
|
|
92
|
-
return
|
|
91
|
+
const n = h(r.initialState);
|
|
92
|
+
return C(() => {
|
|
93
93
|
r.setOptions((o) => {
|
|
94
94
|
var l;
|
|
95
95
|
const c = new Proxy({}, {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useTimeoutFn as w, isClient as T, toArray as h, watchImmediate as q, createSingletonPromise as I, isObject as O } from "../../shared/dist/index.js";
|
|
2
2
|
import { tryOnScopeDispose as J } from "../../shared/dist/index.js";
|
|
3
|
-
import { computed as b, shallowRef as y,
|
|
3
|
+
import { computed as b, shallowRef as y, readonly as x, toValue as m, getCurrentInstance as W, onMounted as j, unref as B, toRaw as F } from "vue";
|
|
4
4
|
const N = T ? window : void 0, E = T ? window.navigator : void 0;
|
|
5
5
|
function V(e) {
|
|
6
6
|
var i;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { lineNumbers as t, highlightActiveLineGutter as e, highlightSpecialChars as i, drawSelection as o, dropCursor as r, rectangularSelection as a, crosshairCursor as l, highlightActiveLine as m, keymap as p } from "../../@codemirror/view/dist/index.js";
|
|
2
2
|
import { EditorView as V } from "../../@codemirror/view/dist/index.js";
|
|
3
3
|
import { EditorState as h } from "../../@codemirror/state/dist/index.js";
|
|
4
|
-
import { foldGutter as c, indentOnInput as n, syntaxHighlighting as s,
|
|
4
|
+
import { foldGutter as c, indentOnInput as n, syntaxHighlighting as s, defaultHighlightStyle as f, bracketMatching as g, foldKeymap as u } from "../../@codemirror/language/dist/index.js";
|
|
5
5
|
import { history as y, defaultKeymap as d, historyKeymap as S } from "../../@codemirror/commands/dist/index.js";
|
|
6
6
|
import { highlightSelectionMatches as K, searchKeymap as k } from "../../@codemirror/search/dist/index.js";
|
|
7
7
|
import { closeBrackets as b, autocompletion as w, closeBracketsKeymap as x, completionKeymap as C } from "../../@codemirror/autocomplete/dist/index.js";
|
|
@@ -16,8 +16,8 @@ const I = [
|
|
|
16
16
|
r(),
|
|
17
17
|
h.allowMultipleSelections.of(!0),
|
|
18
18
|
n(),
|
|
19
|
-
s(
|
|
20
|
-
|
|
19
|
+
s(f, { fallback: !0 }),
|
|
20
|
+
g(),
|
|
21
21
|
b(),
|
|
22
22
|
w(),
|
|
23
23
|
a(),
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.gsc-btn[data-v-ceb757ec]{height:32px;padding:4px 15px;border-radius:6px;font-size:14px;line-height:22px;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;transition:border-color .2s,background-color .2s,color .2s,box-shadow .2s}.gsc-btn[data-v-ceb757ec]:disabled{cursor:not-allowed;opacity:.5}.gsc-btn-default[data-v-ceb757ec]{border:1px solid var(--gsc-basic-border);background:var(--gsc-basic-bg);color:var(--gsc-basic-text-primary)}.gsc-btn-link[data-v-ceb757ec]{border:0;background:transparent;color:var(--gsc-basic-primary);padding:0 4px}.gsc-btn-primary[data-v-ceb757ec]{border:1px solid var(--gsc-basic-primary);background:var(--gsc-basic-primary);color:var(--gsc-basic-bg)}.gsc-btn-danger[data-v-ceb757ec]{border:1px solid var(--gsc-basic-danger);background:var(--gsc-basic-danger);color:var(--gsc-basic-bg)}.gsc-btn-text[data-v-ceb757ec]{border:1px solid transparent;background:transparent;color:var(--gsc-basic-text-secondary);padding:0 8px;height:24px;border-radius:6px;font-size:12px;line-height:22px}.gsc-btn-sm[data-v-ceb757ec]{height:28px;padding:0 10px;font-size:14px;line-height:22px}.gsc-btn-icon[data-v-ceb757ec]{width:32px;padding:0;display:inline-flex;align-items:center;justify-content:center}.gsc-btn-icon-sm[data-v-ceb757ec]{width:24px;padding:0;display:inline-flex;align-items:center;justify-content:center}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { computed as s, openBlock as l, createElementBlock as c, mergeProps as u, renderSlot as d } from "vue";
|
|
2
|
+
import './Button2.css';import './Button.css';/* empty css */
|
|
3
|
+
/* empty css */
|
|
4
|
+
import p from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
+
const f = ["disabled", "type"], m = {
|
|
6
|
+
__name: "Button",
|
|
7
|
+
props: {
|
|
8
|
+
variant: { type: String, default: "default" },
|
|
9
|
+
size: { type: String, default: "" },
|
|
10
|
+
disabled: { type: Boolean, default: !1 },
|
|
11
|
+
type: { type: String, default: "button" }
|
|
12
|
+
},
|
|
13
|
+
emits: ["click"],
|
|
14
|
+
setup(n) {
|
|
15
|
+
const t = n, a = s(() => {
|
|
16
|
+
switch (t.variant) {
|
|
17
|
+
case "primary":
|
|
18
|
+
return "gsc-btn-primary";
|
|
19
|
+
case "link":
|
|
20
|
+
return "gsc-btn-link";
|
|
21
|
+
case "danger":
|
|
22
|
+
return "gsc-btn-danger";
|
|
23
|
+
case "text":
|
|
24
|
+
return "gsc-btn-text";
|
|
25
|
+
default:
|
|
26
|
+
return "gsc-btn-default";
|
|
27
|
+
}
|
|
28
|
+
}), i = s(() => t.size ? t.size === "sm" ? "gsc-btn-sm" : t.size === "icon" ? "gsc-btn-icon" : "" : "");
|
|
29
|
+
return (e, r) => (l(), c("button", u(e.$attrs, {
|
|
30
|
+
class: ["gsc-btn", a.value, i.value].filter(Boolean).join(" "),
|
|
31
|
+
disabled: n.disabled || e.$attrs.disabled,
|
|
32
|
+
type: n.type,
|
|
33
|
+
onClick: r[0] || (r[0] = (o) => e.$emit("click", o))
|
|
34
|
+
}), [
|
|
35
|
+
d(e.$slots, "default", {}, void 0, !0)
|
|
36
|
+
], 16, f));
|
|
37
|
+
}
|
|
38
|
+
}, v = /* @__PURE__ */ p(m, [["__scopeId", "data-v-ceb757ec"]]);
|
|
39
|
+
export {
|
|
40
|
+
v as default
|
|
41
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[data-v-ceb757ec],[data-v-ceb757ec]:before,[data-v-ceb757ec]: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-ceb757ec]::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: }.inline-flex[data-v-ceb757ec]{display:inline-flex}.border[data-v-ceb757ec]{border-width:1px}.transition[data-v-ceb757ec]{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}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.gsc-basic-code-editor[data-v-
|
|
1
|
+
.gsc-basic-code-editor[data-v-1a48abc7]{min-width:380px;border:1px solid var(--gsc-basic-border-color);border-radius:var(--gsc-basic-border-radius-base)}.gsc-basic-code-editor__copy-btn[data-v-1a48abc7]{height:20px;padding:0 12px;border:0;background-color:transparent;font-size:12px;line-height:1;cursor:pointer;transition:background-color .2s ease,color .2s ease,opacity .2s ease}.gsc-basic-code-editor__copy-btn[data-v-1a48abc7]:disabled{cursor:not-allowed;opacity:.5}.gsc-basic-code-editor[data-v-1a48abc7] .cm-editor{border:0 solid var(--gsc-basic-border-color);border-width:1px 0}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { computed as d, unref as o, reactive as
|
|
2
|
-
import { useClipboard as
|
|
3
|
-
import { Codemirror as
|
|
4
|
-
import { oneDark as
|
|
5
|
-
import { json as
|
|
1
|
+
import { computed as d, unref as o, reactive as V, openBlock as _, createElementBlock as B, normalizeClass as T, createVNode as p, normalizeStyle as D, isRef as N, createElementVNode as c, withCtx as z, createTextVNode as L, toDisplayString as l } from "vue";
|
|
2
|
+
import { useClipboard as O } from "../../../node_modules/@vueuse/core/dist/index.js";
|
|
3
|
+
import { Codemirror as q } from "../../../node_modules/vue-codemirror/dist/vue-codemirror.esm.js";
|
|
4
|
+
import { oneDark as G } from "../../../node_modules/@codemirror/theme-one-dark/dist/index.js";
|
|
5
|
+
import { json as J, jsonParseLinter as w } from "../../../node_modules/@codemirror/lang-json/dist/index.js";
|
|
6
6
|
import { java as A } from "../../../node_modules/@codemirror/lang-java/dist/index.js";
|
|
7
7
|
import { sql as F } from "../../../node_modules/@codemirror/lang-sql/dist/index.js";
|
|
8
8
|
import { javascript as I } from "../../../node_modules/@codemirror/lang-javascript/dist/index.js";
|
|
@@ -10,13 +10,14 @@ import { yaml as M } from "../../../node_modules/@codemirror/lang-yaml/dist/inde
|
|
|
10
10
|
import { xml as P } from "../../../node_modules/@codemirror/lang-xml/dist/index.js";
|
|
11
11
|
import { python as R } from "../../../node_modules/@codemirror/lang-python/dist/index.js";
|
|
12
12
|
import { linter as U, lintGutter as $ } from "../../../node_modules/@codemirror/lint/dist/index.js";
|
|
13
|
-
import { useModelBinding as
|
|
14
|
-
import { useNamespace as
|
|
15
|
-
import { useLocale as
|
|
13
|
+
import { useModelBinding as H } from "@gsc-basic/hooks";
|
|
14
|
+
import { useNamespace as K } from "../../hooks/useNamespace.js";
|
|
15
|
+
import { useLocale as Q } from "../../hooks/useLocale.js";
|
|
16
|
+
import { GscButton as W } from "../../Button/index.js";
|
|
16
17
|
import './index2.css';import './index.css';/* empty css */
|
|
17
18
|
/* empty css */
|
|
18
|
-
import
|
|
19
|
-
const
|
|
19
|
+
import X from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
20
|
+
const Y = { class: "flex items-center justify-between py-1 text-xs dark:text-gray-200 dark:bg-gray-800" }, Z = { class: "flex" }, ee = { class: "pr-2" }, te = { class: "pr-2" }, oe = { class: "pr-2" }, se = /* @__PURE__ */ Object.assign({
|
|
20
21
|
name: "GscCodeEditor"
|
|
21
22
|
}, {
|
|
22
23
|
__name: "index",
|
|
@@ -45,8 +46,8 @@ const W = { class: "flex items-center justify-between py-1 text-xs dark:text-gra
|
|
|
45
46
|
},
|
|
46
47
|
emits: ["change", "update:modelValue"],
|
|
47
48
|
setup(s) {
|
|
48
|
-
const a = s, { prefixCls:
|
|
49
|
-
json: () => [
|
|
49
|
+
const a = s, { prefixCls: m } = K("code-editor"), { t: r } = Q(), f = {
|
|
50
|
+
json: () => [J(), U(w()), $()],
|
|
50
51
|
java: () => [A()],
|
|
51
52
|
sql: () => [F()],
|
|
52
53
|
yaml: () => [M()],
|
|
@@ -56,73 +57,75 @@ const W = { class: "flex items-center justify-between py-1 text-xs dark:text-gra
|
|
|
56
57
|
jsx: !0,
|
|
57
58
|
typescript: !0
|
|
58
59
|
})]
|
|
59
|
-
},
|
|
60
|
-
const e = [...
|
|
61
|
-
return a.isDarkTheme && e.push(
|
|
62
|
-
}),
|
|
60
|
+
}, g = d(() => {
|
|
61
|
+
const e = [...f[a.language]?.() ?? []];
|
|
62
|
+
return a.isDarkTheme && e.push(G), e;
|
|
63
|
+
}), y = d(() => {
|
|
63
64
|
if (a.placeholder)
|
|
64
65
|
return a.placeholder;
|
|
65
66
|
const t = `gsc.codeEditor.placeholder.${a.language}`, e = r(t);
|
|
66
67
|
return e === t ? r("gsc.codeEditor.placeholder.default") : e;
|
|
67
|
-
}), [
|
|
68
|
+
}), [n, h] = H(a, "modelValue", "update:modelValue");
|
|
68
69
|
try {
|
|
69
|
-
a.language === "json" &&
|
|
70
|
+
a.language === "json" && h(JSON.stringify(JSON.parse(o(n)), null, 2));
|
|
70
71
|
} catch {
|
|
71
72
|
}
|
|
72
|
-
const
|
|
73
|
-
const t = o(
|
|
73
|
+
const x = d(() => {
|
|
74
|
+
const t = o(n);
|
|
74
75
|
return !t || t.length === 0;
|
|
75
76
|
}), {
|
|
76
77
|
copy: b,
|
|
77
|
-
copied:
|
|
78
|
-
isSupported:
|
|
79
|
-
} =
|
|
80
|
-
source:
|
|
78
|
+
copied: v,
|
|
79
|
+
isSupported: j
|
|
80
|
+
} = O({
|
|
81
|
+
source: n,
|
|
81
82
|
legacy: !0
|
|
82
|
-
}), u = d(() => !
|
|
83
|
+
}), u = d(() => !j.value || x.value), E = d(() => r(v.value ? "gsc.codeEditor.action.copied" : "gsc.codeEditor.action.copy")), S = () => {
|
|
83
84
|
u.value || b();
|
|
84
|
-
},
|
|
85
|
+
}, i = V({
|
|
85
86
|
lines: null,
|
|
86
87
|
cursor: null,
|
|
87
88
|
length: null
|
|
88
|
-
}),
|
|
89
|
+
}), C = (t) => {
|
|
89
90
|
const e = t.state.selection.ranges;
|
|
90
|
-
|
|
91
|
+
i.cursor = e[0].anchor, i.length = t.state.doc.length, i.lines = t.state.doc.lines;
|
|
91
92
|
};
|
|
92
|
-
return (t, e) => (
|
|
93
|
-
class:
|
|
93
|
+
return (t, e) => (_(), B("div", {
|
|
94
|
+
class: T([o(m), s.isDarkTheme ? "dark-bg" : "light-bg"])
|
|
94
95
|
}, [
|
|
95
|
-
|
|
96
|
-
modelValue: o(
|
|
97
|
-
"onUpdate:modelValue": e[0] || (e[0] = (k) => N(
|
|
98
|
-
placeholder:
|
|
96
|
+
p(o(q), {
|
|
97
|
+
modelValue: o(n),
|
|
98
|
+
"onUpdate:modelValue": e[0] || (e[0] = (k) => N(n) ? n.value = k : null),
|
|
99
|
+
placeholder: y.value,
|
|
99
100
|
style: D(s.editorStyle),
|
|
100
101
|
autofocus: s.autofocus,
|
|
101
102
|
"indent-with-tab": !0,
|
|
102
103
|
"tab-size": 2,
|
|
103
104
|
disabled: s.disabled,
|
|
104
|
-
extensions:
|
|
105
|
-
onUpdate:
|
|
105
|
+
extensions: g.value,
|
|
106
|
+
onUpdate: C
|
|
106
107
|
}, null, 8, ["modelValue", "placeholder", "style", "autofocus", "disabled", "extensions"]),
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
type: "button",
|
|
108
|
+
c("div", Y, [
|
|
109
|
+
p(o(W), {
|
|
110
|
+
variant: "text",
|
|
111
111
|
disabled: u.value,
|
|
112
|
-
onClick:
|
|
113
|
-
},
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
112
|
+
onClick: S
|
|
113
|
+
}, {
|
|
114
|
+
default: z(() => [
|
|
115
|
+
e[1] || (e[1] = c("i", { class: "i-material-symbols:content-copy-outline" }, null, -1)),
|
|
116
|
+
L(" " + l(E.value), 1)
|
|
117
|
+
]),
|
|
118
|
+
_: 1
|
|
119
|
+
}, 8, ["disabled"]),
|
|
120
|
+
c("div", Z, [
|
|
121
|
+
c("span", ee, l(o(r)("gsc.codeEditor.info.length")) + ": " + l(i.length), 1),
|
|
122
|
+
c("span", te, l(o(r)("gsc.codeEditor.info.lines")) + ": " + l(i.lines), 1),
|
|
123
|
+
c("span", oe, l(o(r)("gsc.codeEditor.info.cursor")) + ": " + l(i.cursor), 1)
|
|
121
124
|
])
|
|
122
125
|
])
|
|
123
126
|
], 2));
|
|
124
127
|
}
|
|
125
|
-
}),
|
|
128
|
+
}), Se = /* @__PURE__ */ X(se, [["__scopeId", "data-v-1a48abc7"]]);
|
|
126
129
|
export {
|
|
127
|
-
|
|
130
|
+
Se as default
|
|
128
131
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[data-v-
|
|
1
|
+
[data-v-1a48abc7],[data-v-1a48abc7]:before,[data-v-1a48abc7]: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-1a48abc7]::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: }.i-material-symbols\:content-copy-outline[data-v-1a48abc7]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' vertical-align='-0.125em' display='inline-block' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M9 18q-.825 0-1.412-.587T7 16V4q0-.825.588-1.412T9 2h9q.825 0 1.413.588T20 4v12q0 .825-.587 1.413T18 18zm0-2h9V4H9zm-4 6q-.825 0-1.412-.587T3 20V6h2v14h11v2zm4-6V4z'/%3E%3C/svg%3E");-webkit-mask:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' vertical-align='-0.125em' display='inline-block' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M9 18q-.825 0-1.412-.587T7 16V4q0-.825.588-1.412T9 2h9q.825 0 1.413.588T20 4v12q0 .825-.587 1.413T18 18zm0-2h9V4H9zm-4 6q-.825 0-1.412-.587T3 20V6h2v14h11v2zm4-6V4z'/%3E%3C/svg%3E") no-repeat;mask:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' vertical-align='-0.125em' display='inline-block' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M9 18q-.825 0-1.412-.587T7 16V4q0-.825.588-1.412T9 2h9q.825 0 1.413.588T20 4v12q0 .825-.587 1.413T18 18zm0-2h9V4H9zm-4 6q-.825 0-1.412-.587T3 20V6h2v14h11v2zm4-6V4z'/%3E%3C/svg%3E") no-repeat;-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;vertical-align:-.125em;display:inline-block;width:1em;height:1em}.flex[data-v-1a48abc7]{display:flex}.items-center[data-v-1a48abc7]{align-items:center}.justify-between[data-v-1a48abc7]{justify-content:space-between}.border[data-v-1a48abc7]{border-width:1px}.dark .dark\:bg-gray-800[data-v-1a48abc7]{--un-bg-opacity:1;background-color:#1f2937}@supports (color: rgb(0 0 0 / 0)){.dark .dark\:bg-gray-800[data-v-1a48abc7]{background-color:rgb(31 41 55 / var(--un-bg-opacity))}}.py-1[data-v-1a48abc7]{padding-top:.25rem;padding-bottom:.25rem}.pr-2[data-v-1a48abc7]{padding-right:.5rem}.text-xs[data-v-1a48abc7]{font-size:.75rem;line-height:1rem}.dark .dark\:text-gray-200[data-v-1a48abc7]{--un-text-opacity:1;color:#e5e7eb}@supports (color: rgb(0 0 0 / 0)){.dark .dark\:text-gray-200[data-v-1a48abc7]{color:rgb(229 231 235 / var(--un-text-opacity))}}.transition[data-v-1a48abc7]{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-1a48abc7]{transition-timing-function:cubic-bezier(.4,0,.2,1)}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { getCurrentInstance as a,
|
|
1
|
+
import { getCurrentInstance as a, provide as v, computed as n, unref as o, inject as g, ref as C } from "vue";
|
|
2
2
|
import { deepMerge as m } from "@gsc-basic/utils";
|
|
3
3
|
import { useLocale as x } from "../../hooks/useLocale.js";
|
|
4
|
-
import { configProviderContextKey as d,
|
|
5
|
-
const c =
|
|
4
|
+
import { configProviderContextKey as d, localeContextKey as z, zIndexContextKey as I, sizeInjectionKey as b, defaultInitialZIndex as G } from "./constants.js";
|
|
5
|
+
const c = C();
|
|
6
6
|
function p(t, e = void 0) {
|
|
7
|
-
const i = a() ?
|
|
7
|
+
const i = a() ? g(d, c) : c;
|
|
8
8
|
return t ? n(() => i.value?.[t] ?? e) : i;
|
|
9
9
|
}
|
|
10
10
|
function F(t) {
|
|
11
11
|
const e = p(), i = x(n(() => e.value?.locale)), u = n(() => o(t) || e.value?.size || "");
|
|
12
12
|
return y(n(() => o(e) || {})), {
|
|
13
13
|
locale: i,
|
|
14
|
-
zIndex: e.value?.zIndex ||
|
|
14
|
+
zIndex: e.value?.zIndex || G,
|
|
15
15
|
size: u
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
18
|
const y = (t, e, i = !1) => {
|
|
19
|
-
const u = !!a(), f = u ? p() : void 0, l = e?.provide ?? (u ?
|
|
19
|
+
const u = !!a(), f = u ? p() : void 0, l = e?.provide ?? (u ? v : void 0);
|
|
20
20
|
if (!l) {
|
|
21
21
|
console.warn(
|
|
22
22
|
"provideGlobalConfig",
|
|
@@ -29,12 +29,12 @@ const y = (t, e, i = !1) => {
|
|
|
29
29
|
return f?.value ? m(f.value, s) : s;
|
|
30
30
|
});
|
|
31
31
|
return l(d, r), l(
|
|
32
|
-
|
|
32
|
+
z,
|
|
33
33
|
n(() => o(r).locale)
|
|
34
34
|
), l(
|
|
35
|
-
|
|
35
|
+
I,
|
|
36
36
|
n(() => o(r).zIndex)
|
|
37
|
-
), l(
|
|
37
|
+
), l(b, {
|
|
38
38
|
size: n(() => o(r).size || "")
|
|
39
39
|
}), (i || !c.value) && (c.value = o(r)), r;
|
|
40
40
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[data-v-86e89bcb],[data-v-86e89bcb]:before,[data-v-86e89bcb]: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-86e89bcb]::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: }.grid-cols-1[data-v-86e89bcb]{grid-template-columns:repeat(1,minmax(0,1fr))}.mb-0\.5[data-v-86e89bcb]{margin-bottom:.125rem}.ml-2[data-v-86e89bcb]{margin-left:.5rem}.mr-3[data-v-86e89bcb]{margin-right:.75rem}.w-full[data-v-86e89bcb]{width:100%}.flex[data-v-86e89bcb]{display:flex}.inline-flex[data-v-86e89bcb]{display:inline-flex}.items-center[data-v-86e89bcb]{align-items:center}.gap-1[data-v-86e89bcb]{gap:.25rem}.gap-2[data-v-86e89bcb]{gap:.5rem}.text-left[data-v-86e89bcb]{text-align:left}@media(min-width:768px){.md\:grid-cols-2[data-v-86e89bcb]{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(min-width:992px){.lg\:col-span-2[data-v-86e89bcb]{grid-column:span 2/span 2}.lg\:col-span-3[data-v-86e89bcb]{grid-column:span 3/span 3}.lg\:col-span-4[data-v-86e89bcb]{grid-column:span 4/span 4}.lg\:grid-cols-3[data-v-86e89bcb]{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(min-width:1200px){.xl\:grid-cols-4[data-v-86e89bcb]{grid-template-columns:repeat(4,minmax(0,1fr))}}
|
|
@@ -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}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[data-v-
|
|
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}
|