@atscript/vue-table 0.1.96 → 0.1.98
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/as-action-form-dialog.cjs +1 -1
- package/dist/as-action-form-dialog.mjs +1 -1
- package/dist/{as-cell-array-DOQKR6t5.mjs → as-cell-array-2qmJ1lT2.mjs} +2 -2
- package/dist/{as-cell-array-CXeZzZqt.cjs → as-cell-array-iPeUnk2G.cjs} +2 -2
- package/dist/as-cell-array.cjs +1 -1
- package/dist/as-cell-array.d.mts +1 -1
- package/dist/as-cell-array.mjs +1 -1
- package/dist/{as-cell-date-DPWBlhyM.mjs → as-cell-date-BwFgi6O0.mjs} +2 -2
- package/dist/{as-cell-date-D0rowX5E.cjs → as-cell-date-DyixWKuS.cjs} +2 -2
- package/dist/as-cell-date.cjs +1 -1
- package/dist/as-cell-date.d.mts +1 -1
- package/dist/as-cell-date.mjs +1 -1
- package/dist/{as-cell-json-BynWIs1d.mjs → as-cell-json--95Xq6yq.mjs} +2 -2
- package/dist/{as-cell-json-DvHvQ6IL.cjs → as-cell-json-Bvv2P7YV.cjs} +2 -2
- package/dist/as-cell-json.cjs +1 -1
- package/dist/as-cell-json.d.mts +1 -1
- package/dist/as-cell-json.mjs +1 -1
- package/dist/{as-cell-number-Bc1C97Vg.mjs → as-cell-number-DKRaS9pM.mjs} +2 -2
- package/dist/{as-cell-number-0_WrSCzu.cjs → as-cell-number-DuPMOesI.cjs} +2 -2
- package/dist/as-cell-number.cjs +1 -1
- package/dist/as-cell-number.d.mts +1 -1
- package/dist/as-cell-number.mjs +1 -1
- package/dist/{as-cell-union-CFAI0utz.cjs → as-cell-union-CT0rIvQq.cjs} +3 -3
- package/dist/{as-cell-union-C1w3B38J.mjs → as-cell-union-sAOSdepj.mjs} +3 -3
- package/dist/as-cell-union.cjs +1 -1
- package/dist/as-cell-union.d.mts +1 -1
- package/dist/as-cell-union.mjs +1 -1
- package/dist/as-column-menu.cjs +1 -1
- package/dist/as-column-menu.d.cts +1 -1
- package/dist/as-column-menu.d.mts +1 -1
- package/dist/as-column-menu.mjs +1 -1
- package/dist/{as-column-menu.vue-C9e6wJ3z.d.mts → as-column-menu.vue-BtXVQywl.d.cts} +2 -2
- package/dist/{as-column-menu.vue-o0qFdzoL.d.cts → as-column-menu.vue-D3Z5BVLx.d.mts} +2 -2
- package/dist/{as-config-dialog-BB6BDa1E.mjs → as-config-dialog-COwDabdW.mjs} +15 -13
- package/dist/{as-config-dialog-BCvtSxi6.cjs → as-config-dialog-vOUtx5zq.cjs} +14 -12
- package/dist/as-config-dialog.cjs +1 -1
- package/dist/as-config-dialog.d.mts +1 -1
- package/dist/as-config-dialog.mjs +1 -1
- package/dist/as-confirm-dialog.cjs +1 -1
- package/dist/as-confirm-dialog.d.mts +1 -1
- package/dist/as-confirm-dialog.mjs +1 -1
- package/dist/{as-filter-dialog-O62-CnIQ.cjs → as-filter-dialog-BcPI27cn.cjs} +19 -70
- package/dist/{as-filter-dialog-KGyPqr2P.mjs → as-filter-dialog-DuFgEjqE.mjs} +20 -65
- package/dist/as-filter-dialog.cjs +1 -1
- package/dist/as-filter-dialog.d.mts +1 -1
- package/dist/as-filter-dialog.mjs +1 -1
- package/dist/{as-filter-field-jL7cnKUR.cjs → as-filter-field-B8idz2UD.cjs} +3 -473
- package/dist/{as-filter-field-CkiRXHVx.mjs → as-filter-field-Dsk1l3Et.mjs} +7 -441
- package/dist/as-filter-field.cjs +1 -1
- package/dist/as-filter-field.d.mts +1 -1
- package/dist/as-filter-field.mjs +1 -1
- package/dist/as-filter-input.cjs +1 -1
- package/dist/as-filter-input.d.mts +1 -1
- package/dist/as-filter-input.mjs +1 -1
- package/dist/{as-filters-BJM-NjUn.mjs → as-filters-BS7kWJfI.mjs} +5 -3
- package/dist/{as-filters-BFpZKtAU.cjs → as-filters-BzdQ4HUx.cjs} +4 -2
- package/dist/as-filters.cjs +1 -1
- package/dist/as-filters.d.mts +1 -1
- package/dist/as-filters.mjs +1 -1
- package/dist/{as-preset-dialog-1Xl8DIiN.cjs → as-preset-dialog-DOdrDDKy.cjs} +7 -8
- package/dist/{as-preset-dialog-DXbqMVI1.mjs → as-preset-dialog-DoEpCt2j.mjs} +7 -8
- package/dist/as-preset-dialog.cjs +1 -1
- package/dist/as-preset-dialog.d.mts +1 -1
- package/dist/as-preset-dialog.mjs +1 -1
- package/dist/{as-preset-picker-CkaaKzYB.cjs → as-preset-picker-2DkH7QfW.cjs} +1 -1
- package/dist/{as-preset-picker-DJTF47_V.mjs → as-preset-picker-ByUCQpnX.mjs} +1 -1
- package/dist/as-preset-picker.cjs +1 -1
- package/dist/as-preset-picker.d.mts +1 -1
- package/dist/as-preset-picker.mjs +1 -1
- package/dist/{as-row-actions-C78cvaf3.cjs → as-row-actions-05pQX_om.cjs} +1 -1
- package/dist/{as-row-actions-CpEMa5NU.mjs → as-row-actions-D7YgGt0x.mjs} +1 -1
- package/dist/as-row-actions.cjs +1 -1
- package/dist/as-row-actions.d.mts +1 -1
- package/dist/as-row-actions.mjs +1 -1
- package/dist/{as-table-v42bV1ea.cjs → as-table-DyuL_hUo.cjs} +6 -5
- package/dist/{as-table-DDyvnBFL.mjs → as-table-H5uKWieH.mjs} +4 -3
- package/dist/{as-table-actions-DtCjMMCI.cjs → as-table-actions-CsdY2_BG.cjs} +1 -1
- package/dist/{as-table-actions-D2-MBvoy.mjs → as-table-actions-DCEGQiHi.mjs} +1 -1
- package/dist/as-table-actions.cjs +1 -1
- package/dist/as-table-actions.d.cts +1 -1
- package/dist/as-table-actions.d.mts +1 -1
- package/dist/as-table-actions.mjs +1 -1
- package/dist/{as-table-actions.vue-BuqEk4zM.d.cts → as-table-actions.vue-33oeDXOg.d.cts} +2 -2
- package/dist/{as-table-actions.vue-q8hQPcZp.d.mts → as-table-actions.vue-DMf6-R5o.d.mts} +2 -2
- package/dist/{as-table-base-CSrtmIN2.mjs → as-table-base-DReD74pJ.mjs} +2 -2
- package/dist/{as-table-base-CHzULili.cjs → as-table-base-GEf95oXP.cjs} +2 -2
- package/dist/{as-table-cell-value-B1CiJYFn.mjs → as-table-cell-value-Byrb_Zyh.mjs} +2 -2
- package/dist/{as-table-cell-value-CuxRtFn9.cjs → as-table-cell-value-CcWR5oG4.cjs} +2 -2
- package/dist/as-table-cell-value.cjs +1 -1
- package/dist/as-table-cell-value.d.mts +1 -1
- package/dist/as-table-cell-value.mjs +1 -1
- package/dist/{as-table-header-cell-CBn_ioCe.mjs → as-table-header-cell-BUf8wvrw.mjs} +6 -4
- package/dist/{as-table-header-cell-C3zeZUZo.cjs → as-table-header-cell-DWONx2MI.cjs} +5 -3
- package/dist/as-table-header-cell.cjs +1 -1
- package/dist/as-table-header-cell.d.cts +1 -1
- package/dist/as-table-header-cell.d.mts +1 -1
- package/dist/as-table-header-cell.mjs +1 -1
- package/dist/{as-table-header-cell.vue-Bc_DSsGY.d.cts → as-table-header-cell.vue-CzqTEpyk.d.cts} +1 -1
- package/dist/{as-table-header-cell.vue-DNMOHfek.d.mts → as-table-header-cell.vue-Dj_Tl7dZ.d.mts} +1 -1
- package/dist/{as-table-root-zJdmNnsC.cjs → as-table-root-Cg2zkxR5.cjs} +8 -20
- package/dist/{as-table-root-Bc23Z7we.mjs → as-table-root-DpQUTbQ8.mjs} +4 -16
- package/dist/as-table-root.cjs +1 -1
- package/dist/as-table-root.d.cts +1 -1
- package/dist/as-table-root.d.mts +1 -1
- package/dist/as-table-root.mjs +1 -1
- package/dist/{as-table-root.vue-DtjHgOVP.d.mts → as-table-root.vue-Boq6pDr1.d.mts} +15 -6
- package/dist/{as-table-root.vue-DL3BnZOe.d.cts → as-table-root.vue-CYmnf5SH.d.cts} +15 -6
- package/dist/{as-table-status-DKXFSCzE.cjs → as-table-status-DZP8dFpm.cjs} +17 -74
- package/dist/{as-table-status-B11orhFu.mjs → as-table-status-Dinns93w.mjs} +19 -64
- package/dist/as-table.cjs +1 -1
- package/dist/as-table.d.cts +1 -1
- package/dist/as-table.d.mts +1 -1
- package/dist/as-table.mjs +1 -1
- package/dist/{as-table.vue-CLBXcYRv.d.cts → as-table.vue-CE_7OC_h.d.mts} +5 -5
- package/dist/{as-table.vue-Co7gHZ8C.d.mts → as-table.vue-kFORh8Vg.d.cts} +5 -5
- package/dist/{as-window-table-CDTjX7W5.mjs → as-window-table-BwF2t4Zy.mjs} +5 -3
- package/dist/{as-window-table-DuwMCDUh.cjs → as-window-table-CCRJKpoE.cjs} +7 -5
- package/dist/as-window-table.cjs +1 -1
- package/dist/as-window-table.d.cts +1 -1
- package/dist/as-window-table.d.mts +1 -1
- package/dist/as-window-table.mjs +1 -1
- package/dist/{as-window-table.vue-CLXZuY3h.d.cts → as-window-table.vue-C60NtRtq.d.cts} +4 -4
- package/dist/{as-window-table.vue-BA2S6YQr.d.mts → as-window-table.vue-C88OoW5d.d.mts} +4 -4
- package/dist/index.cjs +46 -44
- package/dist/index.d.cts +19 -17
- package/dist/index.d.mts +23 -21
- package/dist/index.mjs +35 -35
- package/dist/{types-BvvXN72P.d.mts → types-BPFBxUS_.d.cts} +2 -4
- package/dist/{types-CNMmF6W2.d.cts → types-BWeFiZKk.d.mts} +2 -4
- package/dist/use-has-emit-listener-BTMDIv2e.mjs +14 -0
- package/dist/use-has-emit-listener-hhOH8CBI.cjs +19 -0
- package/dist/use-seed-on-open-DO3A1kIb.mjs +30 -0
- package/dist/use-seed-on-open-Dg9I89fU.cjs +35 -0
- package/dist/use-table-CLsp2mAu.cjs +475 -0
- package/dist/use-table-CRsFMyJb.mjs +440 -0
- package/dist/{use-table-column-handlers-CGYAY2xH.cjs → use-table-column-handlers-BgC4gUJV.cjs} +0 -19
- package/dist/{use-table-column-handlers-t6xi1yCE.mjs → use-table-column-handlers-cm0GxR2u.mjs} +1 -14
- package/dist/use-table-component-BbETnUuy.mjs +12 -0
- package/dist/use-table-component-CirEOQ_P.cjs +17 -0
- package/dist/use-table-nav-bridge-Bh1tpG0X.cjs +57 -0
- package/dist/use-table-nav-bridge-i8AjtjIt.mjs +52 -0
- package/dist/use-table-selection-C84z4OZy.mjs +59 -0
- package/dist/use-table-selection-Cmiu1h4S.cjs +70 -0
- package/package.json +10 -7
- /package/dist/{as-action-menu-content-CSPPMACR.cjs → as-action-menu-content-BChqFX3E.cjs} +0 -0
- /package/dist/{as-action-menu-content-DXWuttt_.mjs → as-action-menu-content-D2yf0zD2.mjs} +0 -0
- /package/dist/{as-cell-array.vue-DZGM2VHh.d.mts → as-cell-array.vue-D4vS7C_D.d.mts} +0 -0
- /package/dist/{as-cell-date.vue-Zlt4mHWb.d.mts → as-cell-date.vue-Chs7WTZ9.d.mts} +0 -0
- /package/dist/{as-cell-json-popover-BWdNs1YU.cjs → as-cell-json-popover-BM2QLgfk.cjs} +0 -0
- /package/dist/{as-cell-json-popover-DUq25I0L.mjs → as-cell-json-popover-Dkdv5Y9E.mjs} +0 -0
- /package/dist/{as-cell-json.vue-CESWuCer.d.mts → as-cell-json.vue-C0_LDvQw.d.mts} +0 -0
- /package/dist/{as-cell-number.vue-1Oq7nVI3.d.mts → as-cell-number.vue-BBF0OuU8.d.mts} +0 -0
- /package/dist/{as-cell-union.vue-NnDmQZOA.d.mts → as-cell-union.vue-CL-Lf-Rm.d.mts} +0 -0
- /package/dist/{as-column-menu-CH9Htz0Q.cjs → as-column-menu-fZVbJ9lU.cjs} +0 -0
- /package/dist/{as-column-menu-DCfhorMP.mjs → as-column-menu-kTIQfLTi.mjs} +0 -0
- /package/dist/{as-config-dialog.vue-C6Q62xF5.d.mts → as-config-dialog.vue-BvFZZRuY.d.mts} +0 -0
- /package/dist/{as-confirm-dialog-Xtw2wE1X.cjs → as-confirm-dialog-C6HAGzrj.cjs} +0 -0
- /package/dist/{as-confirm-dialog-DL0mCEeX.mjs → as-confirm-dialog-ClVKU1Dm.mjs} +0 -0
- /package/dist/{as-confirm-dialog.vue-pas8jGhv.d.mts → as-confirm-dialog.vue-Cz52-v6c.d.mts} +0 -0
- /package/dist/{as-filter-dialog.vue-RDZjp4gJ.d.mts → as-filter-dialog.vue-likNLqzF.d.mts} +0 -0
- /package/dist/{as-filter-field.vue-QY8wi5S5.d.mts → as-filter-field.vue-BbXLhd6O.d.mts} +0 -0
- /package/dist/{as-filter-input-P1i0CW2-.mjs → as-filter-input-BM23TNeh.mjs} +0 -0
- /package/dist/{as-filter-input--nr72iwX.cjs → as-filter-input-DJu2k9gO.cjs} +0 -0
- /package/dist/{as-filter-input.vue-CBQ71eNg.d.mts → as-filter-input.vue-B9ma2l9j.d.mts} +0 -0
- /package/dist/{as-filters.vue-BsMgYUcX.d.mts → as-filters.vue-DmECMd1v.d.mts} +0 -0
- /package/dist/{as-preset-dialog.vue-Bzv-ON9W.d.mts → as-preset-dialog.vue-BRjjfPty.d.mts} +0 -0
- /package/dist/{as-preset-picker.vue-CTBk6leV.d.mts → as-preset-picker.vue-BPjsiaVt.d.mts} +0 -0
- /package/dist/{as-row-actions.vue-BPaQfGev.d.mts → as-row-actions.vue-DUSDuoR2.d.mts} +0 -0
- /package/dist/{as-table-cell-value.vue-BuPCQ8YA.d.mts → as-table-cell-value.vue-kfNgVhzn.d.mts} +0 -0
- /package/dist/{format-cell-B2xMDYO9.mjs → format-cell-CNQ6BpvR.mjs} +0 -0
- /package/dist/{format-cell-D4mqaN0E.cjs → format-cell-CSbJgz5B.cjs} +0 -0
- /package/dist/{get-cell-value-CZSVfDLg.cjs → get-cell-value-4rHKP-TG.cjs} +0 -0
- /package/dist/{get-cell-value-DiH84HKL.mjs → get-cell-value-C8LLc_Rr.mjs} +0 -0
- /package/dist/{preset-aspect-display-BYeiSgcc.mjs → preset-aspect-display-IICxAlVo.mjs} +0 -0
- /package/dist/{preset-aspect-display-y8aal_EF.cjs → preset-aspect-display-TWwf6j1B.cjs} +0 -0
- /package/dist/{use-cell-locale-B480_QYK.cjs → use-cell-locale-BGBRQB7s.cjs} +0 -0
- /package/dist/{use-cell-locale-1uQaFTLQ.mjs → use-cell-locale-MQXoONh5.mjs} +0 -0
|
@@ -1,63 +1,16 @@
|
|
|
1
|
-
import { a as useTableContext,
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { t as
|
|
5
|
-
import { t as
|
|
6
|
-
import { t as
|
|
1
|
+
import { a as useTableContext, r as provideTableContext, t as createStaticTableState } from "./use-table-state-CuZ2OXoY.mjs";
|
|
2
|
+
import { n as useTable } from "./use-table-CRsFMyJb.mjs";
|
|
3
|
+
import { t as useTableNavBridge } from "./use-table-nav-bridge-i8AjtjIt.mjs";
|
|
4
|
+
import { t as useTableComponent } from "./use-table-component-BbETnUuy.mjs";
|
|
5
|
+
import { n as useDialogTabKeyboard, t as as_config_dialog_default } from "./as-config-dialog-COwDabdW.mjs";
|
|
6
|
+
import { t as useSeedOnOpen } from "./use-seed-on-open-DO3A1kIb.mjs";
|
|
7
|
+
import { t as as_filter_input_default } from "./as-filter-input-BM23TNeh.mjs";
|
|
8
|
+
import { t as as_window_table_default } from "./as-window-table-BwF2t4Zy.mjs";
|
|
9
|
+
import { t as as_filters_default } from "./as-filters-BS7kWJfI.mjs";
|
|
7
10
|
import { resolveValueHelp, valueHelpDictPaths } from "@atscript/ui";
|
|
8
|
-
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, mergeModels, normalizeClass, normalizeStyle, onMounted, openBlock, ref, renderList, shallowRef, toDisplayString, unref, useModel, watch, withCtx } from "vue";
|
|
11
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, mergeModels, normalizeClass, normalizeStyle, onMounted, openBlock, ref, renderList, resolveDynamicComponent, shallowRef, toDisplayString, unref, useModel, watch, withCtx } from "vue";
|
|
9
12
|
import { columnFilterType, conditionLabel, conditionsForType, dateShortcuts, defaultCondition, filledFilterCount, formatFilterCondition, isFilled, isSimpleEq, sameColumnSet } from "@atscript/ui-table";
|
|
10
13
|
import { DialogClose, DialogContent, DialogOverlay, DialogPortal, DialogRoot, DialogTitle, TabsContent, TabsList, TabsRoot, TabsTrigger } from "reka-ui";
|
|
11
|
-
//#region src/composables/use-table-nav-bridge.ts
|
|
12
|
-
function isPassthroughKey(event) {
|
|
13
|
-
const key = event.key;
|
|
14
|
-
const meta = event.metaKey;
|
|
15
|
-
const ctrl = event.ctrlKey;
|
|
16
|
-
const alt = event.altKey;
|
|
17
|
-
if (key === " ") return true;
|
|
18
|
-
if (key.length === 1 && !meta && !ctrl && !alt) return true;
|
|
19
|
-
if ((key === "Home" || key === "End") && !meta && !ctrl && !alt) return true;
|
|
20
|
-
return false;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Construct a keyboard-bridge for an external `<input>` to drive table nav
|
|
24
|
-
* without losing focus. Without args, injects the nearest `<as-table-root>`
|
|
25
|
-
* context's state. With an explicit `state`, binds to that state. With
|
|
26
|
-
* `opts.enterAction`, the returned bridge's `onKeydown` defaults to that
|
|
27
|
-
* enter-action (per-call options still win).
|
|
28
|
-
*
|
|
29
|
-
* Each call returns a fresh bridge object — callers that need stable
|
|
30
|
-
* identity should bind once at setup and reuse the binding.
|
|
31
|
-
*/
|
|
32
|
-
function useTableNavBridge(state, opts) {
|
|
33
|
-
let target = state;
|
|
34
|
-
if (!target) {
|
|
35
|
-
const ctx = useTableContextOptional();
|
|
36
|
-
if (!ctx) throw new Error("[vue-table] useTableNavBridge() called outside of <as-table-root>.");
|
|
37
|
-
target = ctx.state;
|
|
38
|
-
}
|
|
39
|
-
const bound = target;
|
|
40
|
-
const defaultEnterAction = opts?.enterAction;
|
|
41
|
-
const modeOpt = opts?.mode;
|
|
42
|
-
const readMode = () => {
|
|
43
|
-
if (typeof modeOpt === "function") return modeOpt();
|
|
44
|
-
return modeOpt ?? "none";
|
|
45
|
-
};
|
|
46
|
-
function onKeydown(event, callOpts) {
|
|
47
|
-
if (isPassthroughKey(event)) return;
|
|
48
|
-
bound.handleNavKey(event, {
|
|
49
|
-
enterAction: callOpts?.enterAction ?? defaultEnterAction,
|
|
50
|
-
mode: callOpts?.mode ?? readMode()
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
return {
|
|
54
|
-
onKeydown,
|
|
55
|
-
activeIndex: bound.activeIndex,
|
|
56
|
-
setActive: bound.setActive,
|
|
57
|
-
clearActive: bound.clearActive
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
//#endregion
|
|
61
14
|
//#region src/components/internal/as-filter-conditions.vue?vue&type=script&setup=true&lang.ts
|
|
62
15
|
const _hoisted_1$2 = ["value", "onChange"];
|
|
63
16
|
const _hoisted_2$2 = ["value"];
|
|
@@ -84,6 +37,7 @@ var as_filter_conditions_default = /* @__PURE__ */ defineComponent({
|
|
|
84
37
|
emits: ["update:modelValue"],
|
|
85
38
|
setup(__props) {
|
|
86
39
|
const props = __props;
|
|
40
|
+
const FilterInput = useTableComponent("filterInput", as_filter_input_default);
|
|
87
41
|
const model = useModel(__props, "modelValue");
|
|
88
42
|
const filterType = computed(() => columnFilterType(props.column.type));
|
|
89
43
|
const availableConditions = computed(() => conditionsForType(filterType.value, props.column.nullable));
|
|
@@ -135,17 +89,17 @@ var as_filter_conditions_default = /* @__PURE__ */ defineComponent({
|
|
|
135
89
|
value: ct
|
|
136
90
|
}, toDisplayString(unref(conditionLabel)(ct)), 9, _hoisted_2$2);
|
|
137
91
|
}), 128))], 40, _hoisted_1$2),
|
|
138
|
-
|
|
92
|
+
(openBlock(), createBlock(resolveDynamicComponent(unref(FilterInput)), {
|
|
139
93
|
column: __props.column,
|
|
140
94
|
condition: cond,
|
|
141
95
|
"filter-type": filterType.value,
|
|
142
96
|
"onUpdate:condition": (c) => updateCondition(index, c)
|
|
143
|
-
}, null,
|
|
97
|
+
}, null, 40, [
|
|
144
98
|
"column",
|
|
145
99
|
"condition",
|
|
146
100
|
"filter-type",
|
|
147
101
|
"onUpdate:condition"
|
|
148
|
-
]),
|
|
102
|
+
])),
|
|
149
103
|
createElementVNode("button", {
|
|
150
104
|
type: "button",
|
|
151
105
|
class: "as-filter-condition-remove",
|
|
@@ -379,6 +333,7 @@ var as_filter_dialog_default = /* @__PURE__ */ defineComponent({
|
|
|
379
333
|
__name: "as-filter-dialog",
|
|
380
334
|
setup(__props) {
|
|
381
335
|
const { state } = useTableContext();
|
|
336
|
+
const FilterValueHelp = useTableComponent("filterValueHelp", as_filter_value_help_default);
|
|
382
337
|
const isOpen = computed({
|
|
383
338
|
get: () => state.filterDialogColumn.value !== null,
|
|
384
339
|
set: (val) => {
|
|
@@ -391,8 +346,8 @@ var as_filter_dialog_default = /* @__PURE__ */ defineComponent({
|
|
|
391
346
|
const valueHelpConditions = ref([]);
|
|
392
347
|
const freeConditions = ref([]);
|
|
393
348
|
const activeTab = ref("value-help");
|
|
394
|
-
|
|
395
|
-
|
|
349
|
+
useSeedOnOpen(column, () => {
|
|
350
|
+
const col = column.value;
|
|
396
351
|
const existing = state.filters.value[col.path] ?? [];
|
|
397
352
|
if (hasValueHelp.value) {
|
|
398
353
|
valueHelpConditions.value = existing.filter(isSimpleEq);
|
|
@@ -544,11 +499,11 @@ var as_filter_dialog_default = /* @__PURE__ */ defineComponent({
|
|
|
544
499
|
value: "value-help",
|
|
545
500
|
class: "as-filter-dialog-tab-content"
|
|
546
501
|
}, {
|
|
547
|
-
default: withCtx(() => [
|
|
502
|
+
default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(unref(FilterValueHelp)), {
|
|
548
503
|
column: column.value,
|
|
549
504
|
modelValue: valueHelpConditions.value,
|
|
550
505
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => valueHelpConditions.value = $event)
|
|
551
|
-
}, null, 8, ["column", "modelValue"])]),
|
|
506
|
+
}, null, 8, ["column", "modelValue"]))]),
|
|
552
507
|
_: 1
|
|
553
508
|
}),
|
|
554
509
|
createVNode(unref(TabsContent), {
|
|
@@ -607,4 +562,4 @@ var as_filter_dialog_default = /* @__PURE__ */ defineComponent({
|
|
|
607
562
|
}
|
|
608
563
|
});
|
|
609
564
|
//#endregion
|
|
610
|
-
export {
|
|
565
|
+
export { as_filter_dialog_default as t };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const require_as_filter_dialog = require("./as-filter-dialog-
|
|
1
|
+
const require_as_filter_dialog = require("./as-filter-dialog-BcPI27cn.cjs");
|
|
2
2
|
module.exports = require_as_filter_dialog.as_filter_dialog_default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as _default } from "./as-filter-dialog.vue-
|
|
1
|
+
import { t as _default } from "./as-filter-dialog.vue-likNLqzF.mjs";
|
|
2
2
|
export { _default as default };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as as_filter_dialog_default } from "./as-filter-dialog-
|
|
1
|
+
import { t as as_filter_dialog_default } from "./as-filter-dialog-DuFgEjqE.mjs";
|
|
2
2
|
export { as_filter_dialog_default as default };
|
|
@@ -1,445 +1,11 @@
|
|
|
1
1
|
const require_use_table_state = require("./use-table-state-DFQ30m-j.cjs");
|
|
2
|
-
const
|
|
3
|
-
const require_as_table_base = require("./as-table-base-
|
|
2
|
+
const require_use_table = require("./use-table-CLsp2mAu.cjs");
|
|
3
|
+
const require_as_table_base = require("./as-table-base-GEf95oXP.cjs");
|
|
4
4
|
let _atscript_ui = require("@atscript/ui");
|
|
5
5
|
let vue = require("vue");
|
|
6
6
|
let _atscript_ui_table = require("@atscript/ui-table");
|
|
7
7
|
let _vueuse_core = require("@vueuse/core");
|
|
8
8
|
let reka_ui = require("reka-ui");
|
|
9
|
-
//#region src/composables/as-presets-app.ts
|
|
10
|
-
/**
|
|
11
|
-
* App-wide injection key for the presets system. The host app calls
|
|
12
|
-
* `app.provide(AS_PRESETS_APP, '<your-app>')` once at boot; every
|
|
13
|
-
* `<AsTableRoot>`, `usePresets`, and `useAppPrefs` call below it pulls the
|
|
14
|
-
* value via `inject(AS_PRESETS_APP)` unless an explicit `app` option
|
|
15
|
-
* overrides it.
|
|
16
|
-
*
|
|
17
|
-
* The string identifies the application namespace on the server side —
|
|
18
|
-
* one Moost backend can serve many apps; rows are scoped by `(app,
|
|
19
|
-
* tableKey)`.
|
|
20
|
-
*/
|
|
21
|
-
const AS_PRESETS_APP = Symbol("AS_PRESETS_APP");
|
|
22
|
-
/**
|
|
23
|
-
* Resolve the app name with these precedence rules:
|
|
24
|
-
*
|
|
25
|
-
* 1. `explicit` argument (composable option) — wins.
|
|
26
|
-
* 2. `inject(AS_PRESETS_APP)` from the Vue tree.
|
|
27
|
-
* 3. Throws — composable can't run without an app namespace.
|
|
28
|
-
*
|
|
29
|
-
* Throws a clear error when neither is available so misconfiguration
|
|
30
|
-
* surfaces at setup time, not when the first network round-trip fails.
|
|
31
|
-
*/
|
|
32
|
-
function injectPresetsApp(explicit) {
|
|
33
|
-
if (explicit && explicit.length > 0) return explicit;
|
|
34
|
-
const fromProvide = (0, vue.inject)(AS_PRESETS_APP, void 0);
|
|
35
|
-
if (fromProvide && fromProvide.length > 0) return fromProvide;
|
|
36
|
-
throw new Error("[vue-table] AS_PRESETS_APP not provided. Call `app.provide(AS_PRESETS_APP, '<your-app>')` once at boot, or pass `app` to the composable.");
|
|
37
|
-
}
|
|
38
|
-
//#endregion
|
|
39
|
-
//#region src/composables/use-local-draft.ts
|
|
40
|
-
const DEFAULT_DEBOUNCE_MS = 300;
|
|
41
|
-
/**
|
|
42
|
-
* localStorage overlay manager for table presets. One overlay per
|
|
43
|
-
* `(app, tableKey)`; switching presets clears it (caller's responsibility
|
|
44
|
-
* — this composable only tracks state, not which preset is active).
|
|
45
|
-
*/
|
|
46
|
-
function useLocalDraft(opts) {
|
|
47
|
-
const key = `as-table-draft:${opts.app}:${opts.tableKey}`;
|
|
48
|
-
const debounceMs = opts.debounceMs ?? DEFAULT_DEBOUNCE_MS;
|
|
49
|
-
const storage = resolveStorage(opts.storage);
|
|
50
|
-
function isEnabled() {
|
|
51
|
-
if (typeof opts.enabled === "boolean") return opts.enabled;
|
|
52
|
-
if ((0, vue.isRef)(opts.enabled)) return Boolean(opts.enabled.value);
|
|
53
|
-
return false;
|
|
54
|
-
}
|
|
55
|
-
function readDraft() {
|
|
56
|
-
if (!storage) return null;
|
|
57
|
-
try {
|
|
58
|
-
const raw = storage.getItem(key);
|
|
59
|
-
if (!raw) return null;
|
|
60
|
-
const parsed = JSON.parse(raw);
|
|
61
|
-
if (!parsed || typeof parsed !== "object") return null;
|
|
62
|
-
return parsed;
|
|
63
|
-
} catch (err) {
|
|
64
|
-
console.warn("[vue-table] useLocalDraft: corrupted localStorage entry, ignoring", err);
|
|
65
|
-
return null;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
function writeDraft(draft) {
|
|
69
|
-
if (!storage) return;
|
|
70
|
-
try {
|
|
71
|
-
storage.setItem(key, JSON.stringify(draft));
|
|
72
|
-
} catch (err) {
|
|
73
|
-
console.warn("[vue-table] useLocalDraft: localStorage write failed", err);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
function clear() {
|
|
77
|
-
if (!storage) return;
|
|
78
|
-
try {
|
|
79
|
-
storage.removeItem(key);
|
|
80
|
-
} catch {}
|
|
81
|
-
}
|
|
82
|
-
function hydrate(applied) {
|
|
83
|
-
if (!isEnabled()) return applied;
|
|
84
|
-
const draft = readDraft();
|
|
85
|
-
if (!draft || (0, _atscript_ui_table.isEmptyDraft)(draft)) return applied;
|
|
86
|
-
const overlay = (0, _atscript_ui_table.deserializeDraft)(draft, opts.availableAspects);
|
|
87
|
-
return {
|
|
88
|
-
...applied,
|
|
89
|
-
...overlay
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
function watchAndPersist(currentSnapshot, activePresetSnapshot) {
|
|
93
|
-
let lastDraftSerialized = "";
|
|
94
|
-
let lastPresetRef = null;
|
|
95
|
-
let lastPresetSerialized = "";
|
|
96
|
-
function flush(current, preset) {
|
|
97
|
-
if (!isEnabled()) return;
|
|
98
|
-
const draft = (0, _atscript_ui_table.serializeDraft)(current, opts.availableAspects);
|
|
99
|
-
if ((0, _atscript_ui_table.isEmptyDraft)(draft)) {
|
|
100
|
-
clear();
|
|
101
|
-
lastDraftSerialized = "";
|
|
102
|
-
return;
|
|
103
|
-
}
|
|
104
|
-
const draftSerialized = (0, _atscript_ui_table.stableStringify)(draft);
|
|
105
|
-
if (preset !== lastPresetRef) {
|
|
106
|
-
lastPresetRef = preset;
|
|
107
|
-
lastPresetSerialized = (0, _atscript_ui_table.stableStringify)((0, _atscript_ui_table.serializeDraft)(preset, opts.availableAspects));
|
|
108
|
-
}
|
|
109
|
-
if (draftSerialized === lastPresetSerialized) {
|
|
110
|
-
clear();
|
|
111
|
-
lastDraftSerialized = "";
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
if (draftSerialized === lastDraftSerialized) return;
|
|
115
|
-
lastDraftSerialized = draftSerialized;
|
|
116
|
-
writeDraft(draft);
|
|
117
|
-
}
|
|
118
|
-
const flushDebounced = (0, _atscript_ui_table.debounce)(((current, preset) => flush(current, preset)), debounceMs);
|
|
119
|
-
const stop = (0, vue.watch)(() => [currentSnapshot(), activePresetSnapshot()], ([current, preset]) => flushDebounced(current, preset), { flush: "post" });
|
|
120
|
-
return () => {
|
|
121
|
-
flushDebounced.cancel();
|
|
122
|
-
stop();
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
|
-
return {
|
|
126
|
-
hydrate,
|
|
127
|
-
watchAndPersist,
|
|
128
|
-
clear,
|
|
129
|
-
readDraft
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
function resolveStorage(provided) {
|
|
133
|
-
if (provided !== void 0) return provided;
|
|
134
|
-
try {
|
|
135
|
-
return globalThis.localStorage ?? null;
|
|
136
|
-
} catch {
|
|
137
|
-
return null;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
//#endregion
|
|
141
|
-
//#region src/composables/use-presets.ts
|
|
142
|
-
/**
|
|
143
|
-
* Public dev-facing composable for table presets. Powers `<AsPresetPicker>`
|
|
144
|
-
* internally and is exported for devs who want to wire bespoke surfaces.
|
|
145
|
-
*
|
|
146
|
-
* Stateful: holds reactive `presets` / `userConf` / `capabilities` and
|
|
147
|
-
* supports optimistic mutators that re-list after each successful write.
|
|
148
|
-
*
|
|
149
|
-
* Active-preset selection (`activePresetId`) is **owned by the caller** —
|
|
150
|
-
* the composable provides the ref but doesn't auto-resolve it on mount;
|
|
151
|
-
* that's the table-state's responsibility (Slice 4) since it depends on
|
|
152
|
-
* `userConf.defaultPresetId` resolution + Standard fallback.
|
|
153
|
-
*/
|
|
154
|
-
function usePresets(opts) {
|
|
155
|
-
const app = injectPresetsApp(opts.app);
|
|
156
|
-
if (!opts.tableKey) throw new Error("[vue-table] usePresets: `tableKey` is required");
|
|
157
|
-
const client = new _atscript_ui_table.PresetsClient({
|
|
158
|
-
url: opts.url,
|
|
159
|
-
app,
|
|
160
|
-
tableKey: opts.tableKey,
|
|
161
|
-
clientFactory: opts.clientFactory
|
|
162
|
-
});
|
|
163
|
-
const systemPresetsResolved = (0, vue.computed)(() => (0, _atscript_ui_table.resolveSystemPresets)(opts.systemPresets));
|
|
164
|
-
const presets = (0, vue.shallowRef)([]);
|
|
165
|
-
const userConf = (0, vue.shallowRef)(null);
|
|
166
|
-
const capabilities = (0, vue.ref)(null);
|
|
167
|
-
const loading = (0, vue.ref)(false);
|
|
168
|
-
const error = (0, vue.ref)(null);
|
|
169
|
-
const denied = (0, vue.ref)(false);
|
|
170
|
-
const activePresetId = (0, vue.ref)(null);
|
|
171
|
-
const available = (0, vue.computed)(() => !denied.value);
|
|
172
|
-
const presetsById = (0, vue.computed)(() => {
|
|
173
|
-
const map = /* @__PURE__ */ new Map();
|
|
174
|
-
for (const row of presets.value) map.set(row.id, row);
|
|
175
|
-
return map;
|
|
176
|
-
});
|
|
177
|
-
const systemPresetsById = (0, vue.computed)(() => {
|
|
178
|
-
const map = /* @__PURE__ */ new Map();
|
|
179
|
-
for (const sp of systemPresetsResolved.value) map.set(sp.id, sp);
|
|
180
|
-
return map;
|
|
181
|
-
});
|
|
182
|
-
const activePreset = (0, vue.computed)(() => {
|
|
183
|
-
const id = activePresetId.value;
|
|
184
|
-
if (!id) return null;
|
|
185
|
-
if ((0, _atscript_ui_table.isSystemPresetId)(id)) {
|
|
186
|
-
const entry = systemPresetsById.value.get(id);
|
|
187
|
-
return entry ? {
|
|
188
|
-
kind: "system",
|
|
189
|
-
entry
|
|
190
|
-
} : null;
|
|
191
|
-
}
|
|
192
|
-
const entry = presetsById.value.get(id);
|
|
193
|
-
return entry ? {
|
|
194
|
-
kind: "stored",
|
|
195
|
-
entry
|
|
196
|
-
} : null;
|
|
197
|
-
});
|
|
198
|
-
const currentUser = (0, vue.computed)(() => {
|
|
199
|
-
const fromCaps = capabilities.value?.userId;
|
|
200
|
-
if (typeof fromCaps === "string" && fromCaps.length > 0) return fromCaps;
|
|
201
|
-
for (const row of presets.value) if (row.public !== true && typeof row.user === "string" && row.user.length > 0) return row.user;
|
|
202
|
-
return null;
|
|
203
|
-
});
|
|
204
|
-
function isOwned(id) {
|
|
205
|
-
if ((0, _atscript_ui_table.isSystemPresetId)(id)) return false;
|
|
206
|
-
const row = presetsById.value.get(id);
|
|
207
|
-
if (!row) return false;
|
|
208
|
-
if (row.public !== true) return true;
|
|
209
|
-
const me = currentUser.value;
|
|
210
|
-
return me !== null && row.user === me;
|
|
211
|
-
}
|
|
212
|
-
/**
|
|
213
|
-
* @param opts.capabilities — set `false` for refresh-after-mutation calls
|
|
214
|
-
* (fav-toggle, save, rename, delete, public-toggle, set-default) where
|
|
215
|
-
* role-derived capabilities can't have changed. Default `true`, used
|
|
216
|
-
* only on the initial mount load.
|
|
217
|
-
*/
|
|
218
|
-
let batchDepth = 0;
|
|
219
|
-
let reloadPending = false;
|
|
220
|
-
async function maybeReloadAfterMutation() {
|
|
221
|
-
if (batchDepth > 0) {
|
|
222
|
-
reloadPending = true;
|
|
223
|
-
return;
|
|
224
|
-
}
|
|
225
|
-
await reload({ capabilities: false });
|
|
226
|
-
}
|
|
227
|
-
async function batch(fn) {
|
|
228
|
-
batchDepth++;
|
|
229
|
-
try {
|
|
230
|
-
return await fn();
|
|
231
|
-
} finally {
|
|
232
|
-
batchDepth--;
|
|
233
|
-
if (batchDepth === 0 && reloadPending) {
|
|
234
|
-
reloadPending = false;
|
|
235
|
-
await reload({ capabilities: false });
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
async function reload(opts = {}) {
|
|
240
|
-
loading.value = true;
|
|
241
|
-
error.value = null;
|
|
242
|
-
try {
|
|
243
|
-
const result = await client.list(opts);
|
|
244
|
-
if (result.denied) {
|
|
245
|
-
denied.value = true;
|
|
246
|
-
presets.value = [];
|
|
247
|
-
userConf.value = null;
|
|
248
|
-
capabilities.value = null;
|
|
249
|
-
return;
|
|
250
|
-
}
|
|
251
|
-
denied.value = false;
|
|
252
|
-
presets.value = result.presets;
|
|
253
|
-
userConf.value = result.userConf;
|
|
254
|
-
if (result.capabilities !== void 0) capabilities.value = result.capabilities;
|
|
255
|
-
} catch (err) {
|
|
256
|
-
if ((0, _atscript_ui_table.isAuthError)(err)) {
|
|
257
|
-
denied.value = true;
|
|
258
|
-
presets.value = [];
|
|
259
|
-
userConf.value = null;
|
|
260
|
-
capabilities.value = null;
|
|
261
|
-
return;
|
|
262
|
-
}
|
|
263
|
-
error.value = err;
|
|
264
|
-
console.warn("[vue-table] usePresets load failed:", err);
|
|
265
|
-
} finally {
|
|
266
|
-
loading.value = false;
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
async function savePreset(snapshot) {
|
|
270
|
-
const id = activePresetId.value;
|
|
271
|
-
if (!id) throw new Error("[vue-table] usePresets.savePreset: no active preset");
|
|
272
|
-
if ((0, _atscript_ui_table.isSystemPresetId)(id)) throw new Error("[vue-table] usePresets.savePreset: system presets cannot be overwritten");
|
|
273
|
-
const row = presetsById.value.get(id);
|
|
274
|
-
const label = row?.label ?? (row?.data)?.label ?? "";
|
|
275
|
-
if (!label) throw new Error("[vue-table] usePresets.savePreset: existing preset has no label");
|
|
276
|
-
await client.savePreset(id, label, snapshot);
|
|
277
|
-
await maybeReloadAfterMutation();
|
|
278
|
-
}
|
|
279
|
-
async function savePresetAs(label, snapshot, saveOpts = {}) {
|
|
280
|
-
const result = await client.savePresetAs(label, snapshot, saveOpts);
|
|
281
|
-
await maybeReloadAfterMutation();
|
|
282
|
-
activePresetId.value = result.id;
|
|
283
|
-
return result.id;
|
|
284
|
-
}
|
|
285
|
-
async function renamePreset(id, label) {
|
|
286
|
-
if ((0, _atscript_ui_table.isSystemPresetId)(id)) throw new Error("[vue-table] usePresets.renamePreset: system presets cannot be renamed");
|
|
287
|
-
await client.renamePreset(id, label);
|
|
288
|
-
await maybeReloadAfterMutation();
|
|
289
|
-
}
|
|
290
|
-
async function deletePreset(id) {
|
|
291
|
-
if ((0, _atscript_ui_table.isSystemPresetId)(id)) throw new Error("[vue-table] usePresets.deletePreset: system presets cannot be deleted");
|
|
292
|
-
await client.deletePreset(id);
|
|
293
|
-
if (activePresetId.value === id) activePresetId.value = _atscript_ui_table.STANDARD_PRESET_ID;
|
|
294
|
-
await maybeReloadAfterMutation();
|
|
295
|
-
}
|
|
296
|
-
async function togglePublic(id) {
|
|
297
|
-
if ((0, _atscript_ui_table.isSystemPresetId)(id)) throw new Error("[vue-table] usePresets.togglePublic: system presets are not public");
|
|
298
|
-
const row = presetsById.value.get(id);
|
|
299
|
-
if (!row) return;
|
|
300
|
-
await client.setPublic(id, row.public !== true);
|
|
301
|
-
await maybeReloadAfterMutation();
|
|
302
|
-
}
|
|
303
|
-
async function setDefault(id) {
|
|
304
|
-
const user = currentUser.value ?? void 0;
|
|
305
|
-
await client.upsertUserConf(userConf.value, { defaultPresetId: id ?? void 0 }, user);
|
|
306
|
-
await maybeReloadAfterMutation();
|
|
307
|
-
}
|
|
308
|
-
async function toggleFav(id) {
|
|
309
|
-
const current = (userConf.value?.data)?.favPresetIds;
|
|
310
|
-
const set = new Set(current ?? []);
|
|
311
|
-
if (set.has(id)) set.delete(id);
|
|
312
|
-
else set.add(id);
|
|
313
|
-
await setFavorites([...set]);
|
|
314
|
-
}
|
|
315
|
-
async function setFavorites(ids) {
|
|
316
|
-
const user = currentUser.value ?? void 0;
|
|
317
|
-
await client.upsertUserConf(userConf.value, { favPresetIds: ids }, user);
|
|
318
|
-
if (userConf.value) userConf.value = {
|
|
319
|
-
...userConf.value,
|
|
320
|
-
data: {
|
|
321
|
-
...userConf.value.data,
|
|
322
|
-
favPresetIds: ids
|
|
323
|
-
}
|
|
324
|
-
};
|
|
325
|
-
await maybeReloadAfterMutation();
|
|
326
|
-
}
|
|
327
|
-
if (opts.autoLoad !== false) reload();
|
|
328
|
-
return {
|
|
329
|
-
presets,
|
|
330
|
-
presetsById,
|
|
331
|
-
userConf,
|
|
332
|
-
capabilities,
|
|
333
|
-
systemPresets: systemPresetsResolved,
|
|
334
|
-
systemPresetsById,
|
|
335
|
-
available,
|
|
336
|
-
loading,
|
|
337
|
-
error,
|
|
338
|
-
currentUser,
|
|
339
|
-
activePresetId,
|
|
340
|
-
activePreset,
|
|
341
|
-
isOwned,
|
|
342
|
-
reload,
|
|
343
|
-
batch,
|
|
344
|
-
savePreset,
|
|
345
|
-
savePresetAs,
|
|
346
|
-
renamePreset,
|
|
347
|
-
deletePreset,
|
|
348
|
-
togglePublic,
|
|
349
|
-
setDefault,
|
|
350
|
-
toggleFav,
|
|
351
|
-
setFavorites
|
|
352
|
-
};
|
|
353
|
-
}
|
|
354
|
-
//#endregion
|
|
355
|
-
//#region src/composables/use-table.ts
|
|
356
|
-
/** Thin alias over `resetMetaCache` — retained so existing test code keeps working. */
|
|
357
|
-
function clearTableCache() {
|
|
358
|
-
(0, _atscript_ui.resetMetaCache)();
|
|
359
|
-
}
|
|
360
|
-
/**
|
|
361
|
-
* Main entry composable for table setup.
|
|
362
|
-
*
|
|
363
|
-
* @param url — Table endpoint URL (e.g. "/db/tables/products")
|
|
364
|
-
*/
|
|
365
|
-
function useTable(url, opts) {
|
|
366
|
-
const entry = (0, _atscript_ui.getMetaEntry)(url, opts?.clientFactory);
|
|
367
|
-
if (!entry.tableDef) entry.tableDef = Promise.all([entry.meta, entry.type]).then(([meta, type]) => (0, _atscript_ui.createTableDef)(meta, type));
|
|
368
|
-
const { client } = entry;
|
|
369
|
-
const defPromise = entry.tableDef;
|
|
370
|
-
const preset = opts?.preset;
|
|
371
|
-
const presetsHandle = preset ? usePresets({
|
|
372
|
-
url: preset.url,
|
|
373
|
-
tableKey: preset.tableKey,
|
|
374
|
-
app: preset.app,
|
|
375
|
-
clientFactory: opts?.clientFactory,
|
|
376
|
-
systemPresets: preset.systemPresets
|
|
377
|
-
}) : null;
|
|
378
|
-
const draftHandle = preset ? useLocalDraft({
|
|
379
|
-
app: injectPresetsApp(preset.app),
|
|
380
|
-
tableKey: preset.tableKey,
|
|
381
|
-
enabled: preset.persistDrafts ?? false,
|
|
382
|
-
availableAspects: preset.aspects ?? require_use_table_state.DEFAULT_AVAILABLE_ASPECTS
|
|
383
|
-
}) : null;
|
|
384
|
-
const { state, internals } = require_use_table_state.createTableState({
|
|
385
|
-
client,
|
|
386
|
-
limit: opts?.limit,
|
|
387
|
-
selection: {
|
|
388
|
-
rowValueFn: opts?.rowValueFn,
|
|
389
|
-
selectedRows: opts?.selectedRows
|
|
390
|
-
},
|
|
391
|
-
model: {
|
|
392
|
-
filterFields: opts?.filterFields,
|
|
393
|
-
columnNames: opts?.columnNames,
|
|
394
|
-
columnWidths: opts?.columnWidths,
|
|
395
|
-
sorters: opts?.sorters
|
|
396
|
-
},
|
|
397
|
-
query: {
|
|
398
|
-
fn: opts?.queryFn,
|
|
399
|
-
forceFilters: opts?.forceFilters,
|
|
400
|
-
forceSorters: opts?.forceSorters,
|
|
401
|
-
alwaysSelected: opts?.alwaysSelected,
|
|
402
|
-
blockQuery: opts?.blockQuery,
|
|
403
|
-
queryOnMount: opts?.queryOnMount,
|
|
404
|
-
urlQueryReady: opts?.urlQueryReady,
|
|
405
|
-
onUrlQueryChange: opts?.onUrlQueryChange,
|
|
406
|
-
urlQuerySync: opts?.urlQuerySync
|
|
407
|
-
},
|
|
408
|
-
window: {
|
|
409
|
-
blockSize: opts?.blockSize,
|
|
410
|
-
dragReleaseDebounceMs: opts?.dragReleaseDebounceMs
|
|
411
|
-
},
|
|
412
|
-
actions: {
|
|
413
|
-
refreshOnAction: opts?.refreshOnAction,
|
|
414
|
-
onResolved: opts?.onActionResolved
|
|
415
|
-
},
|
|
416
|
-
preset: {
|
|
417
|
-
presetsHandle,
|
|
418
|
-
draftHandle,
|
|
419
|
-
availableAspects: preset?.aspects,
|
|
420
|
-
persistDrafts: preset?.persistDrafts ?? false
|
|
421
|
-
}
|
|
422
|
-
});
|
|
423
|
-
require_as_table_status.useTableSelection(state, { mode: opts?.selectionPersistence ?? "trim" });
|
|
424
|
-
if (opts?.provideContext !== false) require_use_table_state.provideTableContext({
|
|
425
|
-
state,
|
|
426
|
-
client,
|
|
427
|
-
controls: opts?.controls ?? {},
|
|
428
|
-
types: opts?.types,
|
|
429
|
-
components: opts?.components,
|
|
430
|
-
formTypes: opts?.formTypes,
|
|
431
|
-
formComponents: opts?.formComponents
|
|
432
|
-
});
|
|
433
|
-
defPromise.then((def) => {
|
|
434
|
-
internals.init(def);
|
|
435
|
-
}).catch((err) => {
|
|
436
|
-
state.metadataError.value = err instanceof Error ? err : new Error(String(err));
|
|
437
|
-
}).finally(() => {
|
|
438
|
-
state.loadingMetadata.value = false;
|
|
439
|
-
});
|
|
440
|
-
return state;
|
|
441
|
-
}
|
|
442
|
-
//#endregion
|
|
443
9
|
//#region src/composables/use-drag-scroll.ts
|
|
444
10
|
/**
|
|
445
11
|
* Pointer-drag horizontal scroll for a container. Listens for pointerdown on
|
|
@@ -574,7 +140,7 @@ var as_filter_field_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
574
140
|
const resolved = (0, vue.shallowRef)(null);
|
|
575
141
|
if (hasValueHelp && info) {
|
|
576
142
|
vhClient = new _atscript_ui.ValueHelpClient((0, _atscript_ui.getMetaEntry)(info.url).client);
|
|
577
|
-
innerState = useTable(info.url, {
|
|
143
|
+
innerState = require_use_table.useTable(info.url, {
|
|
578
144
|
select: "none",
|
|
579
145
|
queryOnMount: false,
|
|
580
146
|
limit: 10,
|
|
@@ -941,45 +507,9 @@ var as_filter_field_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
941
507
|
}
|
|
942
508
|
});
|
|
943
509
|
//#endregion
|
|
944
|
-
Object.defineProperty(exports, "AS_PRESETS_APP", {
|
|
945
|
-
enumerable: true,
|
|
946
|
-
get: function() {
|
|
947
|
-
return AS_PRESETS_APP;
|
|
948
|
-
}
|
|
949
|
-
});
|
|
950
510
|
Object.defineProperty(exports, "as_filter_field_default", {
|
|
951
511
|
enumerable: true,
|
|
952
512
|
get: function() {
|
|
953
513
|
return as_filter_field_default;
|
|
954
514
|
}
|
|
955
515
|
});
|
|
956
|
-
Object.defineProperty(exports, "clearTableCache", {
|
|
957
|
-
enumerable: true,
|
|
958
|
-
get: function() {
|
|
959
|
-
return clearTableCache;
|
|
960
|
-
}
|
|
961
|
-
});
|
|
962
|
-
Object.defineProperty(exports, "injectPresetsApp", {
|
|
963
|
-
enumerable: true,
|
|
964
|
-
get: function() {
|
|
965
|
-
return injectPresetsApp;
|
|
966
|
-
}
|
|
967
|
-
});
|
|
968
|
-
Object.defineProperty(exports, "useLocalDraft", {
|
|
969
|
-
enumerable: true,
|
|
970
|
-
get: function() {
|
|
971
|
-
return useLocalDraft;
|
|
972
|
-
}
|
|
973
|
-
});
|
|
974
|
-
Object.defineProperty(exports, "usePresets", {
|
|
975
|
-
enumerable: true,
|
|
976
|
-
get: function() {
|
|
977
|
-
return usePresets;
|
|
978
|
-
}
|
|
979
|
-
});
|
|
980
|
-
Object.defineProperty(exports, "useTable", {
|
|
981
|
-
enumerable: true,
|
|
982
|
-
get: function() {
|
|
983
|
-
return useTable;
|
|
984
|
-
}
|
|
985
|
-
});
|