@vtable-guild/vtable-guild 2.9.0-alpha.7 → 2.9.0-alpha.8
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/css/index.css +15 -0
- package/css/style.css +26 -2
- package/css/tailwind3-utilities.css +11 -2
- package/css/tailwind3.css +15 -0
- package/css/tailwind4.css +15 -0
- package/dist/css/index.css +15 -0
- package/dist/css/style.css +26 -2
- package/dist/css/tailwind3-utilities.css +11 -2
- package/dist/css/tailwind3.css +15 -0
- package/dist/css/tailwind4.css +15 -0
- package/dist/index.full.mjs +608 -599
- package/dist/table/src/components/TableQuery.d.ts.map +1 -1
- package/dist/table/src/components/TableQuery.mjs +60 -58
- package/dist/table/src/controls.d.ts.map +1 -1
- package/dist/table/src/types/controls.d.ts +4 -0
- package/dist/table/src/types/controls.d.ts.map +1 -1
- package/dist/table/src/types/editable.d.ts +4 -3
- package/dist/table/src/types/editable.d.ts.map +1 -1
- package/dist/table/src/types/query-form.d.ts +4 -2
- package/dist/table/src/types/query-form.d.ts.map +1 -1
- package/dist/table/src/types/query-form.typecheck.d.ts +15 -0
- package/dist/table/src/types/query-form.typecheck.d.ts.map +1 -1
- package/dist/theme/src/query.d.ts +61 -33
- package/dist/theme/src/query.d.ts.map +1 -1
- package/dist/theme/src/query.mjs +20 -13
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableQuery.d.ts","sourceRoot":"","sources":["../../../../../table/src/components/TableQuery.tsx"],"names":[],"mappings":"AAAA,OAAO,EAUL,KAAK,QAAQ,EACb,KAAK,SAAS,EACf,MAAM,KAAK,CAAA;AAIZ,OAAO,KAAK,EAGV,eAAe,EACf,eAAe,EAChB,MAAM,qBAAqB,CAAA;;;cAQC,QAAQ,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;;;;cAChC,QAAQ,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;;;;cACtC,QAAQ,CAAC,eAAe,CA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
|
4
|
-
import { VTABLE_GUILD_INJECTION_KEY as
|
|
5
|
-
import { resolveQueryThemePreset as
|
|
6
|
-
import { snapshot as
|
|
7
|
-
import { stateEqual as
|
|
8
|
-
const
|
|
1
|
+
import { defineComponent as ae, inject as ne, computed as y, useId as le, ref as K, watch as ue, onBeforeUnmount as re, createVNode as n, mergeProps as oe, toValue as C, Fragment as se, nextTick as ie } from "vue";
|
|
2
|
+
import { useTheme as de } from "../../../core/src/composables/useTheme.mjs";
|
|
3
|
+
import F from "../../../core/src/components/Button.mjs";
|
|
4
|
+
import { VTABLE_GUILD_INJECTION_KEY as ce } from "../../../core/src/plugin/index.mjs";
|
|
5
|
+
import { resolveQueryThemePreset as ye, queryEnUS as fe, queryZhCN as me } from "../../../theme/src/query.mjs";
|
|
6
|
+
import { snapshot as R } from "../utils/snapshot.mjs";
|
|
7
|
+
import { stateEqual as Y } from "../utils/stateEqual.mjs";
|
|
8
|
+
const Se = /* @__PURE__ */ ae({
|
|
9
9
|
name: "TableQuery",
|
|
10
10
|
inheritAttrs: !1,
|
|
11
11
|
props: {
|
|
@@ -27,7 +27,7 @@ const Te = /* @__PURE__ */ ee({
|
|
|
27
27
|
},
|
|
28
28
|
layout: {
|
|
29
29
|
type: String,
|
|
30
|
-
default: "
|
|
30
|
+
default: "light"
|
|
31
31
|
},
|
|
32
32
|
autoSubmit: Boolean,
|
|
33
33
|
debounceTime: {
|
|
@@ -59,89 +59,90 @@ const Te = /* @__PURE__ */ ee({
|
|
|
59
59
|
},
|
|
60
60
|
slots: Object,
|
|
61
61
|
setup(e, {
|
|
62
|
-
attrs:
|
|
63
|
-
slots:
|
|
64
|
-
emit:
|
|
65
|
-
expose:
|
|
62
|
+
attrs: Z,
|
|
63
|
+
slots: I,
|
|
64
|
+
emit: _,
|
|
65
|
+
expose: z
|
|
66
66
|
}) {
|
|
67
|
-
const
|
|
67
|
+
const U = ne(ce, null), {
|
|
68
68
|
slots: r
|
|
69
|
-
} =
|
|
70
|
-
...
|
|
69
|
+
} = de("query", y(() => ye(U?.themePreset)), e), v = y(() => ({
|
|
70
|
+
...U?.locale === "en-US" ? fe : me,
|
|
71
71
|
...e.locale
|
|
72
|
-
})),
|
|
73
|
-
let S, x,
|
|
74
|
-
const A =
|
|
72
|
+
})), H = le(), q = K(!1), b = K();
|
|
73
|
+
let S, x, f = 0, m = !1, P, g, O;
|
|
74
|
+
const A = y(() => [...e.fields].sort((a, t) => (a.order ?? 0) - (t.order ?? 0))), E = (a) => ({
|
|
75
75
|
field: a,
|
|
76
76
|
values: e.query.draft.value
|
|
77
|
-
}),
|
|
77
|
+
}), M = (a) => typeof a.hidden == "function" ? a.hidden(E(a)) : !!a.hidden, j = y(() => A.value.filter((a) => !M(a))), Q = y(() => Math.max(1, Math.floor(e.collapsedCount || 1))), V = y(() => e.collapsible && j.value.length > Q.value), W = y(() => V.value && e.query.collapsed.value ? j.value.slice(0, Q.value) : j.value), B = y(() => e.disabled || q.value || e.query.submitting.value);
|
|
78
78
|
function N() {
|
|
79
79
|
clearTimeout(S), S = void 0;
|
|
80
80
|
}
|
|
81
|
-
|
|
81
|
+
ue(() => [e.layout, e.autoSubmit, e.disabled], N, {
|
|
82
82
|
flush: "sync"
|
|
83
83
|
});
|
|
84
84
|
function k() {
|
|
85
|
-
N(),
|
|
85
|
+
N(), f++, x?.abort(), O?.(!1), O = void 0, x = void 0, q.value = !1, P = void 0, g = void 0;
|
|
86
86
|
}
|
|
87
|
-
function
|
|
87
|
+
function X() {
|
|
88
88
|
return e.hiddenPolicy === "omit" ? {
|
|
89
|
-
omitFields: A.value.filter(
|
|
89
|
+
omitFields: A.value.filter(M).map((a) => a.name)
|
|
90
90
|
} : void 0;
|
|
91
91
|
}
|
|
92
92
|
function h(a) {
|
|
93
93
|
if (m || e.disabled) return Promise.resolve(!1);
|
|
94
94
|
if (N(), g && P === a) return g;
|
|
95
95
|
k();
|
|
96
|
-
const t =
|
|
96
|
+
const t = f, l = new AbortController();
|
|
97
97
|
x = l, P = a, b.value = void 0, a === "reset" && e.query.resetFields();
|
|
98
|
-
const s =
|
|
98
|
+
const s = R(e.query.draft.value), i = X();
|
|
99
99
|
q.value = !0;
|
|
100
100
|
let d;
|
|
101
101
|
return g = new Promise((u) => {
|
|
102
102
|
d = u;
|
|
103
|
-
}),
|
|
103
|
+
}), O = d, (async () => {
|
|
104
104
|
let u = !1;
|
|
105
105
|
try {
|
|
106
|
-
if (a === "reset" && await
|
|
106
|
+
if (a === "reset" && await ie(), m || t !== f || l.signal.aborted) return !1;
|
|
107
107
|
const o = await e.validate?.(s, {
|
|
108
|
-
fields:
|
|
108
|
+
fields: j.value,
|
|
109
109
|
action: a,
|
|
110
110
|
signal: l.signal
|
|
111
111
|
});
|
|
112
|
-
return m || t !==
|
|
112
|
+
return m || t !== f || l.signal.aborted ? !1 : o === !1 ? (b.value = v.value.validationFailed, !1) : !Y(s, e.query.draft.value) || (q.value = !1, u = await (a === "reset" ? e.query.reset(i) : e.query.submit(i)), m || t !== f) ? !1 : (_(a === "reset" ? "reset" : "submitted", u), u);
|
|
113
113
|
} catch (o) {
|
|
114
|
-
return !m && t ===
|
|
114
|
+
return !m && t === f && (b.value = o instanceof Error ? o.message : String(o)), !1;
|
|
115
115
|
} finally {
|
|
116
|
-
t ===
|
|
116
|
+
t === f && (q.value = !1, P = void 0, x = void 0, g = void 0, O = void 0);
|
|
117
117
|
}
|
|
118
118
|
})().then(d), g;
|
|
119
119
|
}
|
|
120
|
-
function
|
|
120
|
+
function p(a, t) {
|
|
121
121
|
a = A.value.find((u) => u.name === a.name) ?? a;
|
|
122
122
|
const l = E(a), s = typeof a.disabled == "function" ? a.disabled(l) : a.disabled, i = typeof a.readonly == "function" ? a.readonly(l) : a.readonly;
|
|
123
|
-
if (e.disabled || e.query.submitting.value || s || i ||
|
|
123
|
+
if (e.disabled || e.query.submitting.value || s || i || Y(e.query.draft.value[a.name], t)) return;
|
|
124
124
|
k(), b.value = void 0;
|
|
125
125
|
const d = e.query.draft;
|
|
126
126
|
d.value = {
|
|
127
127
|
...d.value,
|
|
128
|
-
[a.name]:
|
|
128
|
+
[a.name]: R(t)
|
|
129
129
|
}, e.layout === "light" && e.autoSubmit && (S = setTimeout(() => {
|
|
130
130
|
S = void 0, !m && e.layout === "light" && e.autoSubmit && !e.disabled && h("submit");
|
|
131
131
|
}, Math.max(0, e.debounceTime)));
|
|
132
132
|
}
|
|
133
|
-
|
|
133
|
+
re(() => {
|
|
134
134
|
m = !0, k();
|
|
135
135
|
});
|
|
136
|
-
const
|
|
136
|
+
const $ = {
|
|
137
137
|
submit: () => h("submit"),
|
|
138
138
|
reset: () => h("reset"),
|
|
139
139
|
cancel: k
|
|
140
140
|
};
|
|
141
|
-
return
|
|
141
|
+
return z($), () => {
|
|
142
142
|
const a = e.rootTag;
|
|
143
|
-
return n(a,
|
|
143
|
+
return n(a, oe(Z, {
|
|
144
144
|
class: r.root(),
|
|
145
|
+
"data-query-layout": e.layout,
|
|
145
146
|
"aria-label": v.value.label,
|
|
146
147
|
onSubmit: (t) => {
|
|
147
148
|
t.preventDefault(), h("submit");
|
|
@@ -149,22 +150,22 @@ const Te = /* @__PURE__ */ ee({
|
|
|
149
150
|
}), {
|
|
150
151
|
default: () => [n("div", {
|
|
151
152
|
class: r.fields()
|
|
152
|
-
}, [
|
|
153
|
-
const l = E(t), s = `${
|
|
153
|
+
}, [W.value.map((t) => {
|
|
154
|
+
const l = E(t), s = `${H}-${t.name}`, i = e.errors?.[t.name] ?? C(t.dictionary?.error)?.message, d = typeof t.readonly == "function" ? t.readonly(l) : !!t.readonly, u = e.disabled || e.query.submitting.value || (typeof t.disabled == "function" ? t.disabled(l) : !!t.disabled), o = [...C(t.options) ?? C(t.dictionary?.options) ?? []], w = e.query.draft.value[t.name];
|
|
154
155
|
for (const c of Array.isArray(w) ? w : [w]) {
|
|
155
|
-
if (!t.dictionary || !["string", "number", "boolean"].includes(typeof c) || o.some((
|
|
156
|
-
const T = C(t.dictionary.valueEnum).get(c),
|
|
157
|
-
typeof
|
|
156
|
+
if (!t.dictionary || !["string", "number", "boolean"].includes(typeof c) || o.some((te) => Object.is(te.value, c))) continue;
|
|
157
|
+
const T = C(t.dictionary.valueEnum).get(c), J = typeof T == "string" ? T : T?.text;
|
|
158
|
+
typeof J == "string" && o.push({
|
|
158
159
|
value: c,
|
|
159
|
-
label:
|
|
160
|
+
label: J,
|
|
160
161
|
...typeof T == "object" ? {
|
|
161
162
|
status: T.status
|
|
162
163
|
} : {}
|
|
163
164
|
});
|
|
164
165
|
}
|
|
165
|
-
const
|
|
166
|
+
const L = {
|
|
166
167
|
value: w,
|
|
167
|
-
onChange: (c) =>
|
|
168
|
+
onChange: (c) => p(t, c),
|
|
168
169
|
fieldProps: typeof t.fieldProps == "function" ? t.fieldProps(l) : t.fieldProps ?? {},
|
|
169
170
|
options: o,
|
|
170
171
|
disabled: u,
|
|
@@ -177,7 +178,7 @@ const Te = /* @__PURE__ */ ee({
|
|
|
177
178
|
onSearch: t.dictionary ? (c) => {
|
|
178
179
|
t.dictionary.search(c);
|
|
179
180
|
} : void 0
|
|
180
|
-
},
|
|
181
|
+
}, D = t.valueType ?? "text", G = Object.prototype.hasOwnProperty.call(e.controls, D) ? e.controls[D] : void 0, ee = G ?? e.controls.text;
|
|
181
182
|
return n("div", {
|
|
182
183
|
key: t.name,
|
|
183
184
|
class: r.field(),
|
|
@@ -186,24 +187,25 @@ const Te = /* @__PURE__ */ ee({
|
|
|
186
187
|
class: r.label(),
|
|
187
188
|
for: s
|
|
188
189
|
}, [t.label ?? t.name]), n("div", {
|
|
189
|
-
class: r.control()
|
|
190
|
-
|
|
190
|
+
class: r.control(),
|
|
191
|
+
"data-query-value-type": G ? D : "text"
|
|
192
|
+
}, [I.field?.({
|
|
191
193
|
field: t,
|
|
192
194
|
values: e.query.draft.value,
|
|
193
|
-
control:
|
|
194
|
-
}) ??
|
|
195
|
+
control: L
|
|
196
|
+
}) ?? ee?.(L), i ? n("div", {
|
|
195
197
|
class: r.error(),
|
|
196
198
|
role: "alert",
|
|
197
199
|
id: `${s}-error`
|
|
198
200
|
}, [i]) : null])]);
|
|
199
201
|
})]), n("div", {
|
|
200
202
|
class: r.actions()
|
|
201
|
-
}, [
|
|
202
|
-
|
|
203
|
+
}, [I.actions?.({
|
|
204
|
+
...$,
|
|
203
205
|
submitting: B.value,
|
|
204
206
|
collapsed: e.query.collapsed.value,
|
|
205
207
|
toggleCollapsed: e.query.toggleCollapsed
|
|
206
|
-
}) ?? n(
|
|
208
|
+
}) ?? n(se, null, [n(F, {
|
|
207
209
|
htmlType: "button",
|
|
208
210
|
disabled: B.value,
|
|
209
211
|
onClick: (t) => {
|
|
@@ -211,7 +213,7 @@ const Te = /* @__PURE__ */ ee({
|
|
|
211
213
|
}
|
|
212
214
|
}, {
|
|
213
215
|
default: () => [v.value.reset]
|
|
214
|
-
}), n(
|
|
216
|
+
}), n(F, {
|
|
215
217
|
type: "primary",
|
|
216
218
|
htmlType: e.rootTag === "form" ? "submit" : "button",
|
|
217
219
|
disabled: B.value,
|
|
@@ -220,7 +222,7 @@ const Te = /* @__PURE__ */ ee({
|
|
|
220
222
|
}
|
|
221
223
|
}, {
|
|
222
224
|
default: () => [v.value.submit]
|
|
223
|
-
}),
|
|
225
|
+
}), V.value ? n(F, {
|
|
224
226
|
type: "link",
|
|
225
227
|
htmlType: "button",
|
|
226
228
|
disabled: e.disabled,
|
|
@@ -240,5 +242,5 @@ const Te = /* @__PURE__ */ ee({
|
|
|
240
242
|
}
|
|
241
243
|
});
|
|
242
244
|
export {
|
|
243
|
-
|
|
245
|
+
Se as default
|
|
244
246
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"controls.d.ts","sourceRoot":"","sources":["../../../../table/src/controls.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"controls.d.ts","sourceRoot":"","sources":["../../../../table/src/controls.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAEV,sBAAsB,EAGtB,aAAa,EACd,MAAM,kBAAkB,CAAA;AAqHzB,wBAAgB,wBAAwB,CAAC,UAAU,EAAE,sBAAsB,GAAG,aAAa,CAE1F;AACD,wBAAgB,8BAA8B,CAAC,UAAU,EAAE,sBAAsB,GAAG,aAAa,CAEhG"}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { Component, VNodeChild } from 'vue';
|
|
2
2
|
import { TableDictionaryOption } from './dictionary';
|
|
3
|
+
/** Keys registered by both host control factories; enum aliases select and money uses InputNumber. */
|
|
4
|
+
export type TableBuiltinControlValueType = 'text' | 'select' | 'enum' | 'digit' | 'money' | 'date' | 'dateRange' | 'dateTime' | 'dateTimeRange' | 'time';
|
|
5
|
+
/** Suggest built-in control keys while accepting custom keys from the controls registry. */
|
|
6
|
+
export type TableControlValueType = TableBuiltinControlValueType | (string & Record<never, never>);
|
|
3
7
|
/** Shared by schema query fields and editable cells; host libraries remain optional. */
|
|
4
8
|
export interface TableControlContext {
|
|
5
9
|
value: unknown;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"controls.d.ts","sourceRoot":"","sources":["../../../../../table/src/types/controls.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAChD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAA;AAEzD,wFAAwF;AACxF,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,OAAO,CAAA;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAA;IAClC,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IACpC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACnC,OAAO,EAAE,SAAS,qBAAqB,EAAE,CAAA;IACzC,QAAQ,EAAE,OAAO,CAAA;IACjB,QAAQ,EAAE,OAAO,CAAA;IACjB,OAAO,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AAE,OAAO,KAAK,IAAI,CAAA;IAClC,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IACpC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACnC,OAAO,EAAE,SAAS,qBAAqB,EAAE,CAAA;IACzC,QAAQ,EAAE,OAAO,CAAA;IACjB,QAAQ,EAAE,OAAO,CAAA;IACjB,OAAO,EAAE,OAAO,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,OAAO,GAAG,MAAM,CAAA;CACvB;AACD,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,EAAE,mBAAmB,KAAK,UAAU,CAAA;AAC/E,MAAM,MAAM,aAAa,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC,CAAA;AAE1E,iGAAiG;AACjG,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,SAAS,CAAA;IAChB,MAAM,EAAE,SAAS,CAAA;IACjB,WAAW,EAAE,SAAS,CAAA;IACtB,UAAU,EAAE,SAAS,CAAA;IACrB,WAAW,CAAC,EAAE,SAAS,CAAA;IACvB,UAAU,CAAC,EAAE,SAAS,CAAA;IACtB,mEAAmE;IACnE,MAAM,CAAC,EAAE,SAAS,CAAA;CACnB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MaybeRefOrGetter, VNodeChild } from 'vue';
|
|
2
2
|
import { ColumnType, ColumnsType, CustomRenderContext, Key } from './column';
|
|
3
|
-
import { TableControls, TableControlContext } from './controls';
|
|
3
|
+
import { TableControls, TableControlContext, TableControlValueType } from './controls';
|
|
4
4
|
import { TableDictionaryOption, TableDictionaryBinding } from './dictionary';
|
|
5
5
|
import { UseTableEditOptions, UseTableEditReturn } from './editing';
|
|
6
6
|
export interface TableEditableFieldContext<TRecord extends object> {
|
|
@@ -13,7 +13,8 @@ export interface TableEditableFieldContext<TRecord extends object> {
|
|
|
13
13
|
isNew: boolean;
|
|
14
14
|
}
|
|
15
15
|
export interface TableColumnEditor<TRecord extends object> {
|
|
16
|
-
|
|
16
|
+
/** Select a built-in or custom host control; omission uses the column's inferred control. */
|
|
17
|
+
valueType?: TableControlValueType;
|
|
17
18
|
editable?: boolean | ((context: TableEditableFieldContext<TRecord>) => boolean);
|
|
18
19
|
readonly?: boolean | ((context: TableEditableFieldContext<TRecord>) => boolean);
|
|
19
20
|
disabled?: boolean | ((context: TableEditableFieldContext<TRecord>) => boolean);
|
|
@@ -34,7 +35,7 @@ export interface TableEditableCellContext<TRecord extends object> extends TableC
|
|
|
34
35
|
key: Key;
|
|
35
36
|
column: ColumnType<TRecord>;
|
|
36
37
|
draft: TRecord;
|
|
37
|
-
valueType:
|
|
38
|
+
valueType: TableControlValueType;
|
|
38
39
|
}
|
|
39
40
|
export interface UseTableEditableOptions<TRecord extends object> extends Omit<UseTableEditOptions<TRecord>, 'toDraft' | 'toValue'> {
|
|
40
41
|
columns: MaybeRefOrGetter<ColumnsType<TRecord>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editable.d.ts","sourceRoot":"","sources":["../../../../../table/src/types/editable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AACvD,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,mBAAmB,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AACjF,OAAO,KAAK,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"editable.d.ts","sourceRoot":"","sources":["../../../../../table/src/types/editable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AACvD,OAAO,KAA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GAAG,aAAa,GAAG,WAAW,EAAE,MAAM,CAAC,CAAC,CAAA;CACvE;AACD,MAAM,WAAW,sBAAsB,CACrC,OAAO,SAAS,MAAM,CACtB,SAAQ,kBAAkB,CAAC,OAAO,CAAC;IACnC,OAAO,EAAE,CACP,OAAO,EAAE,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC,KAC7D,wBAAwB,CAAC,OAAO,CAAC,GAAG,SAAS,CAAA;IAClD,kFAAkF;IAClF,YAAY,EAAE,CAAC,OAAO,EAAE,mBAAmB,CAAC,OAAO,CAAC,KAAK,UAAU,CAAA;CACpE"}
|
|
@@ -3,7 +3,7 @@ import { QuerySlots } from '../../../theme/src/index.ts';
|
|
|
3
3
|
import { ColumnGroupType, ColumnType } from './column';
|
|
4
4
|
import { ColumnSentinel } from '../constants';
|
|
5
5
|
import { TableDictionaryOption, TableDictionaryBinding } from './dictionary';
|
|
6
|
-
import { TableControls, TableControlContext } from './controls';
|
|
6
|
+
import { TableControls, TableControlContext, TableControlValueType } from './controls';
|
|
7
7
|
import { UseTableQueryReturn } from './query';
|
|
8
8
|
export interface TableQueryFieldContext<TValues extends object> {
|
|
9
9
|
values: Readonly<TValues>;
|
|
@@ -13,7 +13,8 @@ export interface TableQueryFieldContext<TValues extends object> {
|
|
|
13
13
|
export interface TableQueryField<TValues extends object = Record<string, unknown>> {
|
|
14
14
|
name: keyof TValues & string;
|
|
15
15
|
label?: VNodeChild;
|
|
16
|
-
|
|
16
|
+
/** Select a registered host control; missing or unregistered keys fall back to text. */
|
|
17
|
+
valueType?: TableControlValueType;
|
|
17
18
|
order?: number;
|
|
18
19
|
hidden?: boolean | ((context: TableQueryFieldContext<TValues>) => boolean);
|
|
19
20
|
disabled?: boolean | ((context: TableQueryFieldContext<TValues>) => boolean);
|
|
@@ -49,6 +50,7 @@ export interface TableQueryProps<TValues extends object = Record<string, unknown
|
|
|
49
50
|
rootTag?: 'form' | 'div';
|
|
50
51
|
fields: readonly TableQueryField<TValues>[];
|
|
51
52
|
controls: TableControls;
|
|
53
|
+
/** Compact inline controls by default; form opts into a responsive grid. */
|
|
52
54
|
layout?: 'form' | 'light';
|
|
53
55
|
/** Explicit opt-in for light layout only. Form layout always waits for submit. */
|
|
54
56
|
autoSubmit?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-form.d.ts","sourceRoot":"","sources":["../../../../../table/src/types/query-form.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AACvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAClD,OAAO,KAAK,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAA;AACjF,OAAO,KAAK,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"query-form.d.ts","sourceRoot":"","sources":["../../../../../table/src/types/query-form.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AACvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAClD,OAAO,KAAK,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAA;AACjF,OAAO,KAAK,EAAE,aAAa,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAA;AAC3F,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAA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,CAAC,MAAM,EAAE,OAAO,CAAC;IAC/E,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,wBAAwB,CAAC,OAAO,CAAC,KAAK,UAAU,CAAA;IAChE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,yBAAyB,KAAK,UAAU,CAAA;CAC3D;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAA;IAC9B,KAAK,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAA;IAC7B,8EAA8E;IAC9E,MAAM,EAAE,MAAM,IAAI,CAAA;CACnB"}
|
|
@@ -1,8 +1,23 @@
|
|
|
1
1
|
import { TableQueryProps, TableQueryField, TableQueryInstance } from './query-form';
|
|
2
|
+
import { TableControls, TableControlValueType } from './controls';
|
|
3
|
+
import { TableColumnEditor, TableEditableCellContext } from './editable';
|
|
4
|
+
import { createAntdvTableControls, createElementPlusTableControls } from '../controls';
|
|
2
5
|
interface Values {
|
|
3
6
|
name: string;
|
|
4
7
|
range?: [string, string];
|
|
5
8
|
}
|
|
9
|
+
type Equal<A, B> = (<T>() => T extends A ? 1 : 2) extends <T>() => T extends B ? 1 : 2 ? true : false;
|
|
10
|
+
type Assert<T extends true> = T;
|
|
11
|
+
export type ControlValueTypeContract = [
|
|
12
|
+
Assert<Equal<TableControls, ReturnType<typeof createAntdvTableControls>>>,
|
|
13
|
+
Assert<Equal<TableControls, ReturnType<typeof createElementPlusTableControls>>>,
|
|
14
|
+
Assert<Equal<NonNullable<TableQueryField<Values>['valueType']>, TableControlValueType>>,
|
|
15
|
+
Assert<Equal<NonNullable<TableColumnEditor<Values>['valueType']>, TableControlValueType>>,
|
|
16
|
+
Assert<Equal<TableEditableCellContext<Values>['valueType'], TableControlValueType>>,
|
|
17
|
+
Assert<string extends TableControlValueType ? true : false>
|
|
18
|
+
];
|
|
19
|
+
export declare const customQueryField: TableQueryField<Values>;
|
|
20
|
+
export declare const customColumnEditor: TableColumnEditor<Values>;
|
|
6
21
|
export declare const queryProps: TableQueryProps<Values>;
|
|
7
22
|
export declare const derivedFields: TableQueryField<Values>[];
|
|
8
23
|
export declare function instanceContract(instance: TableQueryInstance): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-form.typecheck.d.ts","sourceRoot":"","sources":["../../../../../table/src/types/query-form.typecheck.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,eAAe,EAEf,kBAAkB,EACnB,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"query-form.typecheck.d.ts","sourceRoot":"","sources":["../../../../../table/src/types/query-form.typecheck.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,eAAe,EAEf,kBAAkB,EACnB,MAAM,cAAc,CAAA;AACrB,OAAO,KAAK,EAAgC,aAAa,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAA;AACpG,OAAO,KAAK,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAA;AAE7E,OAAO,EAAE,wBAAwB,EAAE,8BAA8B,EAAE,MAAM,aAAa,CAAA;AAGtF,UAAU,MAAM;IACd,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACzB;AAED,KAAK,KAAK,CAAC,CAAC,EAAE,CAAC,IACb,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,IAAI,GAAG,KAAK,CAAA;AACpF,KAAK,MAAM,CAAC,CAAC,SAAS,IAAI,IAAI,CAAC,CAAA;AAG/B,MAAM,MAAM,wBAAwB,GAAG;IACrC,MAAM,CAAC,KAAK,CAAC,aAAa,EAAE,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAC,CAAC;IACzE,MAAM,CAAC,KAAK,CAAC,aAAa,EAAE,UAAU,CAAC,OAAO,8BAA8B,CAAC,CAAC,CAAC;IAC/E,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,CAAC,EAAE,qBAAqB,CAAC,CAAC;IACvF,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,CAAC,EAAE,qBAAqB,CAAC,CAAC;IACzF,MAAM,CAAC,KAAK,CAAC,wBAAwB,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,EAAE,qBAAqB,CAAC,CAAC;IACnF,MAAM,CAAC,MAAM,SAAS,qBAAqB,GAAG,IAAI,GAAG,KAAK,CAAC;CAC5D,CAAA;AAED,eAAO,MAAM,gBAAgB,EAAE,eAAe,CAAC,MAAM,CAA+C,CAAA;AACpG,eAAO,MAAM,kBAAkB,EAAE,iBAAiB,CAAC,MAAM,CAAiC,CAAA;AAkB1F,eAAO,MAAM,UAAU,EAAE,eAAe,CAAC,MAAM,CAAoD,CAAA;AACnG,eAAO,MAAM,aAAa,2BAAkC,CAAA;AAC5D,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,kBAAkB,QAM5D"}
|
|
@@ -1,57 +1,71 @@
|
|
|
1
1
|
import { ThemePresetName } from '../../core/src/index.ts';
|
|
2
|
-
/**
|
|
2
|
+
/** Compact query controls by default; form opts into a responsive grid. */
|
|
3
3
|
export declare const queryTheme: {
|
|
4
4
|
readonly slots: {
|
|
5
5
|
readonly root: "flex min-w-0 flex-wrap items-start gap-x-[var(--vtg-query-column-gap,24px)] gap-y-[var(--vtg-query-row-gap,16px)] rounded-[var(--vtg-query-radius,6px)] bg-[color:var(--color-surface)] p-[var(--vtg-query-padding,24px)] font-[family-name:var(--font-family-base)] text-[length:var(--vtg-table-font-size)] text-[color:var(--color-on-surface)]";
|
|
6
|
-
readonly fields: "
|
|
6
|
+
readonly fields: "";
|
|
7
7
|
readonly field: "flex min-w-0 items-start gap-[var(--vtg-query-label-gap,12px)]";
|
|
8
|
-
readonly label: "flex h-[var(--vtg-query-control-height,32px)]
|
|
9
|
-
readonly control: "min-w-0
|
|
8
|
+
readonly label: "flex h-[var(--vtg-query-control-height,32px)] shrink-0 items-center";
|
|
9
|
+
readonly control: "min-w-0";
|
|
10
10
|
readonly error: "mt-1 text-[color:var(--vtg-cell-error)] text-[length:var(--vtg-query-error-font-size,12px)]";
|
|
11
|
-
readonly actions: "
|
|
11
|
+
readonly actions: "flex min-h-[var(--vtg-query-control-height,32px)] max-w-full flex-wrap items-center gap-[var(--vtg-query-action-gap,8px)]";
|
|
12
12
|
readonly feedback: "w-full text-[color:var(--vtg-cell-error)]";
|
|
13
13
|
readonly collapse: "inline-flex items-center gap-1";
|
|
14
14
|
};
|
|
15
15
|
readonly variants: {
|
|
16
16
|
readonly layout: {
|
|
17
|
-
readonly form: {
|
|
17
|
+
readonly form: {
|
|
18
|
+
readonly fields: "grid min-w-[min(100%,calc(var(--vtg-query-field-min-width,240px)*2_+_var(--vtg-query-column-gap,24px)))] flex-1 gap-x-[var(--vtg-query-column-gap,24px)] gap-y-[var(--vtg-query-row-gap,16px)] [grid-template-columns:repeat(auto-fit,minmax(min(100%,var(--vtg-query-field-min-width,240px)),1fr))]";
|
|
19
|
+
readonly label: "w-[var(--vtg-query-label-width,80px)] justify-end";
|
|
20
|
+
readonly control: "flex-1 [&>*]:w-full";
|
|
21
|
+
readonly actions: "ml-auto justify-end";
|
|
22
|
+
};
|
|
18
23
|
readonly light: {
|
|
19
24
|
readonly root: "p-[var(--vtg-query-light-padding,16px)]";
|
|
20
|
-
readonly fields: "
|
|
21
|
-
readonly field: "w-[var(--vtg-query-light-field-width,
|
|
25
|
+
readonly fields: "contents";
|
|
26
|
+
readonly field: "w-[var(--vtg-query-light-field-width,auto)] max-w-full";
|
|
22
27
|
readonly label: "w-auto justify-start";
|
|
28
|
+
readonly control: "flex-initial";
|
|
29
|
+
readonly actions: "ml-0 justify-start";
|
|
23
30
|
};
|
|
24
31
|
};
|
|
25
32
|
};
|
|
26
33
|
readonly defaultVariants: {
|
|
27
|
-
readonly layout: "
|
|
34
|
+
readonly layout: "light";
|
|
28
35
|
};
|
|
29
36
|
};
|
|
30
37
|
export declare const elementPlusQueryTheme: {
|
|
31
38
|
readonly slots: {
|
|
32
39
|
readonly root: "flex min-w-0 flex-wrap items-start gap-x-[var(--vtg-query-column-gap,24px)] gap-y-[var(--vtg-query-row-gap,16px)] rounded-[var(--vtg-query-radius,6px)] bg-[color:var(--color-surface)] p-[var(--vtg-query-padding,24px)] font-[family-name:var(--font-family-base)] text-[length:var(--vtg-table-font-size)] text-[color:var(--color-on-surface)] rounded-[var(--vtg-query-radius,4px)]";
|
|
33
|
-
readonly fields: "
|
|
40
|
+
readonly fields: "";
|
|
34
41
|
readonly field: "flex min-w-0 items-start gap-[var(--vtg-query-label-gap,12px)]";
|
|
35
|
-
readonly label: "flex h-[var(--vtg-query-control-height,32px)]
|
|
36
|
-
readonly control: "min-w-0
|
|
42
|
+
readonly label: "flex h-[var(--vtg-query-control-height,32px)] shrink-0 items-center";
|
|
43
|
+
readonly control: "min-w-0";
|
|
37
44
|
readonly error: "mt-1 text-[color:var(--vtg-cell-error)] text-[length:var(--vtg-query-error-font-size,12px)]";
|
|
38
|
-
readonly actions: "
|
|
45
|
+
readonly actions: "flex min-h-[var(--vtg-query-control-height,32px)] max-w-full flex-wrap items-center gap-[var(--vtg-query-action-gap,8px)]";
|
|
39
46
|
readonly feedback: "w-full text-[color:var(--vtg-cell-error)]";
|
|
40
47
|
readonly collapse: "inline-flex items-center gap-1";
|
|
41
48
|
};
|
|
42
49
|
readonly variants: {
|
|
43
50
|
readonly layout: {
|
|
44
|
-
readonly form: {
|
|
51
|
+
readonly form: {
|
|
52
|
+
readonly fields: "grid min-w-[min(100%,calc(var(--vtg-query-field-min-width,240px)*2_+_var(--vtg-query-column-gap,24px)))] flex-1 gap-x-[var(--vtg-query-column-gap,24px)] gap-y-[var(--vtg-query-row-gap,16px)] [grid-template-columns:repeat(auto-fit,minmax(min(100%,var(--vtg-query-field-min-width,240px)),1fr))]";
|
|
53
|
+
readonly label: "w-[var(--vtg-query-label-width,80px)] justify-end";
|
|
54
|
+
readonly control: "flex-1 [&>*]:w-full";
|
|
55
|
+
readonly actions: "ml-auto justify-end";
|
|
56
|
+
};
|
|
45
57
|
readonly light: {
|
|
46
58
|
readonly root: "p-[var(--vtg-query-light-padding,16px)]";
|
|
47
|
-
readonly fields: "
|
|
48
|
-
readonly field: "w-[var(--vtg-query-light-field-width,
|
|
59
|
+
readonly fields: "contents";
|
|
60
|
+
readonly field: "w-[var(--vtg-query-light-field-width,auto)] max-w-full";
|
|
49
61
|
readonly label: "w-auto justify-start";
|
|
62
|
+
readonly control: "flex-initial";
|
|
63
|
+
readonly actions: "ml-0 justify-start";
|
|
50
64
|
};
|
|
51
65
|
};
|
|
52
66
|
};
|
|
53
67
|
readonly defaultVariants: {
|
|
54
|
-
readonly layout: "
|
|
68
|
+
readonly layout: "light";
|
|
55
69
|
};
|
|
56
70
|
};
|
|
57
71
|
export type QueryThemeConfig = typeof queryTheme;
|
|
@@ -59,54 +73,68 @@ export type QuerySlots = keyof QueryThemeConfig['slots'];
|
|
|
59
73
|
export declare function resolveQueryThemePreset(name?: ThemePresetName): {
|
|
60
74
|
readonly slots: {
|
|
61
75
|
readonly root: "flex min-w-0 flex-wrap items-start gap-x-[var(--vtg-query-column-gap,24px)] gap-y-[var(--vtg-query-row-gap,16px)] rounded-[var(--vtg-query-radius,6px)] bg-[color:var(--color-surface)] p-[var(--vtg-query-padding,24px)] font-[family-name:var(--font-family-base)] text-[length:var(--vtg-table-font-size)] text-[color:var(--color-on-surface)]";
|
|
62
|
-
readonly fields: "
|
|
76
|
+
readonly fields: "";
|
|
63
77
|
readonly field: "flex min-w-0 items-start gap-[var(--vtg-query-label-gap,12px)]";
|
|
64
|
-
readonly label: "flex h-[var(--vtg-query-control-height,32px)]
|
|
65
|
-
readonly control: "min-w-0
|
|
78
|
+
readonly label: "flex h-[var(--vtg-query-control-height,32px)] shrink-0 items-center";
|
|
79
|
+
readonly control: "min-w-0";
|
|
66
80
|
readonly error: "mt-1 text-[color:var(--vtg-cell-error)] text-[length:var(--vtg-query-error-font-size,12px)]";
|
|
67
|
-
readonly actions: "
|
|
81
|
+
readonly actions: "flex min-h-[var(--vtg-query-control-height,32px)] max-w-full flex-wrap items-center gap-[var(--vtg-query-action-gap,8px)]";
|
|
68
82
|
readonly feedback: "w-full text-[color:var(--vtg-cell-error)]";
|
|
69
83
|
readonly collapse: "inline-flex items-center gap-1";
|
|
70
84
|
};
|
|
71
85
|
readonly variants: {
|
|
72
86
|
readonly layout: {
|
|
73
|
-
readonly form: {
|
|
87
|
+
readonly form: {
|
|
88
|
+
readonly fields: "grid min-w-[min(100%,calc(var(--vtg-query-field-min-width,240px)*2_+_var(--vtg-query-column-gap,24px)))] flex-1 gap-x-[var(--vtg-query-column-gap,24px)] gap-y-[var(--vtg-query-row-gap,16px)] [grid-template-columns:repeat(auto-fit,minmax(min(100%,var(--vtg-query-field-min-width,240px)),1fr))]";
|
|
89
|
+
readonly label: "w-[var(--vtg-query-label-width,80px)] justify-end";
|
|
90
|
+
readonly control: "flex-1 [&>*]:w-full";
|
|
91
|
+
readonly actions: "ml-auto justify-end";
|
|
92
|
+
};
|
|
74
93
|
readonly light: {
|
|
75
94
|
readonly root: "p-[var(--vtg-query-light-padding,16px)]";
|
|
76
|
-
readonly fields: "
|
|
77
|
-
readonly field: "w-[var(--vtg-query-light-field-width,
|
|
95
|
+
readonly fields: "contents";
|
|
96
|
+
readonly field: "w-[var(--vtg-query-light-field-width,auto)] max-w-full";
|
|
78
97
|
readonly label: "w-auto justify-start";
|
|
98
|
+
readonly control: "flex-initial";
|
|
99
|
+
readonly actions: "ml-0 justify-start";
|
|
79
100
|
};
|
|
80
101
|
};
|
|
81
102
|
};
|
|
82
103
|
readonly defaultVariants: {
|
|
83
|
-
readonly layout: "
|
|
104
|
+
readonly layout: "light";
|
|
84
105
|
};
|
|
85
106
|
} | {
|
|
86
107
|
readonly slots: {
|
|
87
108
|
readonly root: "flex min-w-0 flex-wrap items-start gap-x-[var(--vtg-query-column-gap,24px)] gap-y-[var(--vtg-query-row-gap,16px)] rounded-[var(--vtg-query-radius,6px)] bg-[color:var(--color-surface)] p-[var(--vtg-query-padding,24px)] font-[family-name:var(--font-family-base)] text-[length:var(--vtg-table-font-size)] text-[color:var(--color-on-surface)] rounded-[var(--vtg-query-radius,4px)]";
|
|
88
|
-
readonly fields: "
|
|
109
|
+
readonly fields: "";
|
|
89
110
|
readonly field: "flex min-w-0 items-start gap-[var(--vtg-query-label-gap,12px)]";
|
|
90
|
-
readonly label: "flex h-[var(--vtg-query-control-height,32px)]
|
|
91
|
-
readonly control: "min-w-0
|
|
111
|
+
readonly label: "flex h-[var(--vtg-query-control-height,32px)] shrink-0 items-center";
|
|
112
|
+
readonly control: "min-w-0";
|
|
92
113
|
readonly error: "mt-1 text-[color:var(--vtg-cell-error)] text-[length:var(--vtg-query-error-font-size,12px)]";
|
|
93
|
-
readonly actions: "
|
|
114
|
+
readonly actions: "flex min-h-[var(--vtg-query-control-height,32px)] max-w-full flex-wrap items-center gap-[var(--vtg-query-action-gap,8px)]";
|
|
94
115
|
readonly feedback: "w-full text-[color:var(--vtg-cell-error)]";
|
|
95
116
|
readonly collapse: "inline-flex items-center gap-1";
|
|
96
117
|
};
|
|
97
118
|
readonly variants: {
|
|
98
119
|
readonly layout: {
|
|
99
|
-
readonly form: {
|
|
120
|
+
readonly form: {
|
|
121
|
+
readonly fields: "grid min-w-[min(100%,calc(var(--vtg-query-field-min-width,240px)*2_+_var(--vtg-query-column-gap,24px)))] flex-1 gap-x-[var(--vtg-query-column-gap,24px)] gap-y-[var(--vtg-query-row-gap,16px)] [grid-template-columns:repeat(auto-fit,minmax(min(100%,var(--vtg-query-field-min-width,240px)),1fr))]";
|
|
122
|
+
readonly label: "w-[var(--vtg-query-label-width,80px)] justify-end";
|
|
123
|
+
readonly control: "flex-1 [&>*]:w-full";
|
|
124
|
+
readonly actions: "ml-auto justify-end";
|
|
125
|
+
};
|
|
100
126
|
readonly light: {
|
|
101
127
|
readonly root: "p-[var(--vtg-query-light-padding,16px)]";
|
|
102
|
-
readonly fields: "
|
|
103
|
-
readonly field: "w-[var(--vtg-query-light-field-width,
|
|
128
|
+
readonly fields: "contents";
|
|
129
|
+
readonly field: "w-[var(--vtg-query-light-field-width,auto)] max-w-full";
|
|
104
130
|
readonly label: "w-auto justify-start";
|
|
131
|
+
readonly control: "flex-initial";
|
|
132
|
+
readonly actions: "ml-0 justify-start";
|
|
105
133
|
};
|
|
106
134
|
};
|
|
107
135
|
};
|
|
108
136
|
readonly defaultVariants: {
|
|
109
|
-
readonly layout: "
|
|
137
|
+
readonly layout: "light";
|
|
110
138
|
};
|
|
111
139
|
};
|
|
112
140
|
export declare const queryZhCN: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../../theme/src/query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAe,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAEtE,
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../../theme/src/query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAe,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAEtE,2EAA2E;AAC3E,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkCS,CAAA;AAEhC,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAMF,CAAA;AAEhC,MAAM,MAAM,gBAAgB,GAAG,OAAO,UAAU,CAAA;AAChD,MAAM,MAAM,UAAU,GAAG,MAAM,gBAAgB,CAAC,OAAO,CAAC,CAAA;AAExD,wBAAgB,uBAAuB,CAAC,IAAI,GAAE,eAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEtE;AAED,eAAO,MAAM,SAAS;;;;;;;CAOZ,CAAA;AACV,eAAO,MAAM,SAAS;;;;;;;CAOZ,CAAA"}
|