@atscript/vue-table 0.1.147 → 0.1.148
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-action-menu-content-35yQWbLF.mjs → as-action-menu-content-BBwL1YZU.mjs} +1 -1
- package/dist/{as-action-menu-content-BJ0tn6jq.cjs → as-action-menu-content-DAOjkslC.cjs} +1 -1
- package/dist/{as-cell-array-CCZ0Ajj9.cjs → as-cell-array-CB4Nt6Fo.cjs} +3 -2
- package/dist/{as-cell-array-Bgc4GYZf.mjs → as-cell-array-CnoVd9ps.mjs} +4 -3
- 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-RU5JPJhI.cjs → as-cell-date-DrnhvCr4.cjs} +3 -14
- package/dist/{as-cell-date-B9mu0OOD.mjs → as-cell-date-dhIM7hWA.mjs} +2 -13
- 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-ByEGYRST.mjs → as-cell-json-ChN_NDhO.mjs} +1 -1
- package/dist/{as-cell-json-w5YJxNuF.cjs → as-cell-json-CzHTpkjS.cjs} +1 -1
- 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-DGJCTXDf.cjs → as-cell-number-C4JMqvqa.cjs} +1 -1
- package/dist/{as-cell-number-CNDT6gfw.mjs → as-cell-number-D-mSaE_G.mjs} +1 -1
- 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-DMnoa7RM.mjs → as-cell-union-C9Bbnkrg.mjs} +1 -1
- package/dist/{as-cell-union-LOGvhPeK.cjs → as-cell-union-DpCEHLzN.cjs} +1 -1
- 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.d.cts +1 -1
- package/dist/as-column-menu.d.mts +1 -1
- package/dist/{as-column-menu.vue-B6iuKmIj.d.cts → as-column-menu.vue-4zJmC_M6.d.mts} +2 -2
- package/dist/{as-column-menu.vue-wxb2f92k.d.mts → as-column-menu.vue-CS_8jHG3.d.cts} +2 -2
- package/dist/{as-config-dialog-BJkBzaku.cjs → as-config-dialog-CnIvMsK0.cjs} +10 -5
- package/dist/{as-config-dialog-D503Ek_m.mjs → as-config-dialog-ZKMnfirD.mjs} +10 -5
- 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-CJfDnaiU.mjs → as-confirm-dialog-DMiGquH1.mjs} +1 -1
- package/dist/{as-confirm-dialog-C5xPbkox.cjs → as-confirm-dialog-cSEHVFBq.cjs} +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-CxjO-Ge5.mjs → as-filter-dialog-DNFR30fV.mjs} +61 -38
- package/dist/{as-filter-dialog-Co0WfWOe.cjs → as-filter-dialog-KjvJdaMg.cjs} +60 -37
- 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-FTrxFkTw.cjs → as-filter-field-BsucQwbm.cjs} +247 -35
- package/dist/{as-filter-field-ByPlGyWz.mjs → as-filter-field-DE6MJMx7.mjs} +227 -39
- 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-ChJ8JE6-.cjs +254 -0
- package/dist/as-filter-input-DmOW_jzK.mjs +249 -0
- package/dist/as-filter-input.cjs +1 -1
- package/dist/as-filter-input.d.cts +1 -1
- package/dist/as-filter-input.d.mts +1 -1
- package/dist/as-filter-input.mjs +1 -1
- package/dist/{as-filter-input.vue-CksJOtqw.d.cts → as-filter-input.vue-BLTzA2Iy.d.cts} +9 -0
- package/dist/{as-filter-input.vue-DMwr0ArL.d.mts → as-filter-input.vue-CmWQGQCv.d.mts} +9 -0
- package/dist/{as-filters-W3iMELuL.cjs → as-filters-CYC_SXaA.cjs} +4 -4
- package/dist/{as-filters-CJZJiOXb.mjs → as-filters-DErM2bFq.mjs} +4 -4
- 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-CLOVEpWZ.mjs → as-preset-dialog-CY5dPfZa.mjs} +2 -2
- package/dist/{as-preset-dialog-Dvvx0jmU.cjs → as-preset-dialog-tM-jrQgs.cjs} +2 -2
- 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-DFLhbm59.cjs → as-preset-picker-CjSXtx83.cjs} +2 -2
- package/dist/{as-preset-picker-CwFObhME.mjs → as-preset-picker-DkZ7sinz.mjs} +2 -2
- 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-residual-filter-BRsEs8oe.mjs → as-residual-filter-DHfbtTQj.mjs} +4 -5
- package/dist/{as-residual-filter-sZlsFPDS.cjs → as-residual-filter-XkXnMQNu.cjs} +4 -5
- package/dist/as-residual-filter.cjs +1 -1
- package/dist/as-residual-filter.d.mts +1 -1
- package/dist/as-residual-filter.mjs +1 -1
- package/dist/{as-row-actions-DyjIXePd.mjs → as-row-actions-BNQ7jrie.mjs} +2 -2
- package/dist/{as-row-actions-DFv2cSrP.cjs → as-row-actions-q_oMmUz1.cjs} +2 -2
- package/dist/as-row-actions.cjs +1 -1
- package/dist/as-row-actions.d.cts +1 -1
- package/dist/as-row-actions.d.mts +1 -1
- package/dist/as-row-actions.mjs +1 -1
- package/dist/{as-row-actions.vue-BHrZBXVU.d.cts → as-row-actions.vue-BB8ATWBY.d.mts} +1 -1
- package/dist/{as-row-actions.vue-D4MylwCW.d.mts → as-row-actions.vue-CnjcRD0P.d.cts} +1 -1
- package/dist/{as-select-cell-CoQJjhnq.cjs → as-select-cell-Dc3lArvR.cjs} +5 -5
- package/dist/{as-select-cell-Dl8fohIj.mjs → as-select-cell-DjcPorVb.mjs} +5 -5
- package/dist/{as-selection-banner-DBtLjulh.mjs → as-selection-banner-Ca9DWVdW.mjs} +1 -1
- package/dist/{as-selection-banner-BI5gKHqW.cjs → as-selection-banner-CxPXBztW.cjs} +1 -1
- package/dist/{as-table-B1FowaPF.cjs → as-table-BIAkCI4g.cjs} +4 -4
- package/dist/{as-table-Cpvfv9zA.mjs → as-table-Bcz-WOTS.mjs} +4 -4
- package/dist/{as-table-actions-BlbAps1h.mjs → as-table-actions-DPq5SrGa.mjs} +2 -2
- package/dist/{as-table-actions-B0xaicfv.cjs → as-table-actions-TaI-NeVv.cjs} +2 -2
- 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-7ml3JiOO.d.mts → as-table-actions.vue-C2szPEXd.d.mts} +2 -2
- package/dist/{as-table-actions.vue-BKRqHprR.d.cts → as-table-actions.vue-CBD_tEpe.d.cts} +2 -2
- package/dist/{as-table-base-EzKaChOp.mjs → as-table-base-CsK79vYe.mjs} +2 -2
- package/dist/{as-table-base-LZ26YlWp.cjs → as-table-base-Dvey_Gie.cjs} +2 -2
- package/dist/{as-table-cell-value-DoH8Mieo.mjs → as-table-cell-value-D-S127gr.mjs} +13 -2
- package/dist/{as-table-cell-value-COyZnwUj.cjs → as-table-cell-value-VWlXc5dA.cjs} +12 -1
- 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-gHhCdxJX.cjs → as-table-header-cell-DB7Cdskr.cjs} +1 -1
- package/dist/{as-table-header-cell-DrVzYaof.mjs → as-table-header-cell-ahzAeHXj.mjs} +1 -1
- 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-BCk4NPYT.d.cts → as-table-header-cell.vue-D2s9YLSJ.d.cts} +1 -1
- package/dist/{as-table-header-cell.vue-BZU8s9CT.d.mts → as-table-header-cell.vue-DfDNma_Z.d.mts} +1 -1
- package/dist/{as-table-root-BYHXuNPI.mjs → as-table-root-BnkF5-rh.mjs} +49 -9
- package/dist/{as-table-root-K6fWKHtF.cjs → as-table-root-Nsk-9XaH.cjs} +48 -8
- 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-Bm2DxAqU.d.mts → as-table-root.vue-D56WcudY.d.mts} +313 -1638
- package/dist/{as-table-root.vue-CF03c4vu.d.cts → as-table-root.vue-DXXcBPu_.d.cts} +313 -1638
- 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-window-table-CygDqZMU.mjs → as-window-table-DjplqWzr.mjs} +4 -4
- package/dist/{as-window-table-_flc8o64.cjs → as-window-table-ubm2u8_i.cjs} +4 -4
- 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/index.cjs +68 -90
- package/dist/index.d.cts +8 -8
- package/dist/index.d.mts +21 -21
- package/dist/index.mjs +69 -91
- package/dist/{intent-scope-BXPEN5kJ.d.cts → intent-scope-CGch9yhy.d.cts} +13 -0
- package/dist/{intent-scope-Ck7RZ0dK.d.mts → intent-scope-CvD4YOvf.d.mts} +13 -0
- package/dist/use-condition-format-5LcuInDy.mjs +34 -0
- package/dist/use-condition-format-DrgfX6xL.cjs +39 -0
- package/dist/{use-table-DP6Y0kbl.mjs → use-table-BYNBpLJt.mjs} +23 -2
- package/dist/{use-table-CydIJZbx.cjs → use-table-C9qI-TL6.cjs} +22 -1
- package/dist/{use-table-component-aqfGzECx.cjs → use-table-component-CsdvdGJT.cjs} +1 -1
- package/dist/{use-table-component-DNGUvhf7.mjs → use-table-component-Dy397695.mjs} +1 -1
- package/dist/{use-table-nav-bridge-BhOPIT2R.mjs → use-table-nav-bridge-CJBERyPB.mjs} +1 -1
- package/dist/{use-table-nav-bridge-B7A30yja.cjs → use-table-nav-bridge-Gm4ZfOjJ.cjs} +1 -1
- package/dist/{use-table-state-sDnqOi3b.cjs → use-table-state-BQchKxUr.cjs} +53 -6
- package/dist/{use-table-state-1OZfdhQi.mjs → use-table-state-CIoWhwTD.mjs} +54 -7
- package/package.json +11 -11
- package/dist/as-filter-input-BM23TNeh.mjs +0 -101
- package/dist/as-filter-input-DJu2k9gO.cjs +0 -106
- /package/dist/{as-cell-array.vue-Dj3nZop3.d.mts → as-cell-array.vue-D4vS7C_D.d.mts} +0 -0
- /package/dist/{as-cell-date.vue-BPuyH7q3.d.mts → as-cell-date.vue-Chs7WTZ9.d.mts} +0 -0
- /package/dist/{as-cell-json-popover-Dkdv5Y9E.mjs → as-cell-json-popover-CH5bAcLE.mjs} +0 -0
- /package/dist/{as-cell-json-popover-BM2QLgfk.cjs → as-cell-json-popover-vty5vMjW.cjs} +0 -0
- /package/dist/{as-cell-json.vue-D8J7YwVV.d.mts → as-cell-json.vue-C0_LDvQw.d.mts} +0 -0
- /package/dist/{as-cell-number.vue-sUoZvuat.d.mts → as-cell-number.vue-BBF0OuU8.d.mts} +0 -0
- /package/dist/{as-cell-union.vue-DZBejMxR.d.mts → as-cell-union.vue-CL-Lf-Rm.d.mts} +0 -0
- /package/dist/{as-config-dialog.vue-D2AVR1a5.d.mts → as-config-dialog.vue-BvFZZRuY.d.mts} +0 -0
- /package/dist/{as-confirm-dialog.vue-BxAaCuYf.d.mts → as-confirm-dialog.vue-Cz52-v6c.d.mts} +0 -0
- /package/dist/{as-filter-dialog.vue-WYXGtymZ.d.mts → as-filter-dialog.vue-likNLqzF.d.mts} +0 -0
- /package/dist/{as-filter-field.vue-DTpuDkHh.d.mts → as-filter-field.vue-BbXLhd6O.d.mts} +0 -0
- /package/dist/{as-filters.vue-dHbGmcbr.d.mts → as-filters.vue-Bu4wK0iD.d.mts} +0 -0
- /package/dist/{as-preset-dialog.vue-BrnvBWxJ.d.mts → as-preset-dialog.vue-BRjjfPty.d.mts} +0 -0
- /package/dist/{as-preset-picker.vue-OaAV2v9z.d.mts → as-preset-picker.vue-DAUZOlOD.d.mts} +0 -0
- /package/dist/{as-residual-filter.vue-Cev_8Wy7.d.mts → as-residual-filter.vue-DbeOOtR7.d.mts} +0 -0
- /package/dist/{as-table-cell-value.vue-kfNgVhzn.d.mts → as-table-cell-value.vue-BXIH_yfq.d.mts} +0 -0
- /package/dist/{error-message-CfKpn_5w.cjs → error-message-CoUcpWal.cjs} +0 -0
- /package/dist/{error-message-gNEXnnbb.mjs → error-message-rziSiSjs.mjs} +0 -0
- /package/dist/{use-cell-locale-MQXoONh5.mjs → use-cell-locale-BTJZ6UcP.mjs} +0 -0
- /package/dist/{use-cell-locale-BGBRQB7s.cjs → use-cell-locale-Dv514-Al.cjs} +0 -0
- /package/dist/{use-has-emit-listener-DrBbsLHQ.mjs → use-has-emit-listener-CsF2w9iT.mjs} +0 -0
- /package/dist/{use-has-emit-listener-BaGFZDyM.cjs → use-has-emit-listener-gD1aWp6N.cjs} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as getCellValue } from "./get-cell-value-Cb3X8nUn.mjs";
|
|
2
2
|
import { navigateHrefFor, setByPath } from "@atscript/ui";
|
|
3
3
|
import { computed, inject, nextTick, onBeforeUnmount, onScopeDispose, provide, ref, shallowRef, toValue, watch } from "vue";
|
|
4
|
-
import { DEV, STANDARD_PRESET_ID, arraysEqual, blockStartFor, buildTableQuery, canonicalPresetSnapshot, cellAsString, compactFieldFilters, debounce, derivePresetAspects, filterExprFields, filterExprKey, fromWireSnapshot, gateOwns, isDirtyAgainst, isFilled, isSystemPresetId, mergeDisplayColumns, mergeSorters, normalizeResidualFilters, pageAlignedBlocksFor, planFetch, prunePresetSnapshot, pruneResidualFilters, reconcileColumnWidthDefaults, residualGateOwns, resolveAspectGate, resolveSystemPresets, restoreDroppedEntries, rowsToPks, sameColumnSet, selectionQueryOf, selectionSignature, sortRowsLocally, sortersEqual, stateToUrlQueryString, togglePk, urlQueryStringToState, walkBackwardAbsorb, walkForwardAbsorb } from "@atscript/ui-table";
|
|
4
|
+
import { DEV, STANDARD_PRESET_ID, arraysEqual, blockStartFor, buildTableQuery, canonicalPresetSnapshot, cellAsString, columnFilterKind, compactFieldFilters, createColumnValueEncoder, debounce, derivePresetAspects, filterExprFields, filterExprKey, fromWireSnapshot, gateOwns, isDirtyAgainst, isFilled, isSystemPresetId, isTemporalKind, mergeDisplayColumns, mergeSorters, normalizeResidualFilters, pageAlignedBlocksFor, planFetch, prunePresetSnapshot, pruneResidualFilters, reconcileColumnWidthDefaults, residualGateOwns, resolveAspectGate, resolveSystemPresets, restoreDroppedEntries, rowsToPks, sameColumnSet, selectionQueryOf, selectionSignature, sortRowsLocally, sortersEqual, stableValueKey, stateToUrlQueryString, togglePk, urlQueryStringToState, walkBackwardAbsorb, walkForwardAbsorb } from "@atscript/ui-table";
|
|
5
5
|
import { formatIdentifier } from "@atscript/db-client";
|
|
6
6
|
//#region src/types.ts
|
|
7
7
|
/** UI-side sentinel for the synthesised row-delete processor. */
|
|
@@ -2359,10 +2359,33 @@ function createTableState(opts) {
|
|
|
2359
2359
|
}
|
|
2360
2360
|
/** Reads the value a sorter orders by — a display column's `sortValue` wins. */
|
|
2361
2361
|
const sortValueOf = createSortValueReader(opts.displayColumns);
|
|
2362
|
+
/** The app-authored scope, read live — the query, local sort and chrome all go through these. */
|
|
2363
|
+
const forceFilters = computed(() => toValue(queryOpts?.forceFilters));
|
|
2364
|
+
const timeZone = computed(() => toValue(queryOpts?.timeZone));
|
|
2365
|
+
const weekStart = computed(() => toValue(queryOpts?.weekStart));
|
|
2366
|
+
/**
|
|
2367
|
+
* Turns a typed filter value into what the server accepts (date periods in
|
|
2368
|
+
* `timeZone`, boolean text → boolean). Rebuilt when the columns, the zone or
|
|
2369
|
+
* the week start change; "today" is read at each query build.
|
|
2370
|
+
*/
|
|
2371
|
+
const encodeCondition = computed(() => createColumnValueEncoder(allColumns.value, {
|
|
2372
|
+
timeZone: timeZone.value,
|
|
2373
|
+
weekStart: weekStart.value
|
|
2374
|
+
}));
|
|
2375
|
+
const forceSorters = computed(() => toValue(queryOpts?.forceSorters) ?? []);
|
|
2376
|
+
/** Whether a date filter is set — the only filters a zone or week-start change affects. */
|
|
2377
|
+
function hasFilledTemporalFilter() {
|
|
2378
|
+
for (const c of allColumns.value) {
|
|
2379
|
+
if (!c.valueKind || !isTemporalKind(columnFilterKind(c))) continue;
|
|
2380
|
+
if (filters.value[c.path]?.some(isFilled)) return true;
|
|
2381
|
+
}
|
|
2382
|
+
return false;
|
|
2383
|
+
}
|
|
2362
2384
|
function applyLocalSort(rows) {
|
|
2363
2385
|
if (queryOpts?.preSorted) return rows;
|
|
2364
2386
|
if (splitSorters.value.local.length === 0 || sortersIgnored()) return rows;
|
|
2365
|
-
|
|
2387
|
+
const forced = forceSorters.value;
|
|
2388
|
+
return sortRowsLocally(rows, forced.length ? mergeSorters(forced, sorters.value) : sorters.value, sortValueOf);
|
|
2366
2389
|
}
|
|
2367
2390
|
/**
|
|
2368
2391
|
* The query's view of the model, gated to the fields this caller can use.
|
|
@@ -2405,9 +2428,7 @@ function createTableState(opts) {
|
|
|
2405
2428
|
const available = tableDef.value?.fetchableFields ?? knownFields.value?.columns ?? /* @__PURE__ */ new Set();
|
|
2406
2429
|
const extra = /* @__PURE__ */ new Set();
|
|
2407
2430
|
for (const c of columns.value) for (const p of c.selectWith ?? []) if (available.has(p)) extra.add(p);
|
|
2408
|
-
|
|
2409
|
-
for (const p of queryOpts.alwaysSelected) if (available.has(p)) extra.add(p);
|
|
2410
|
-
}
|
|
2431
|
+
for (const p of toValue(queryOpts?.alwaysSelected) ?? []) if (available.has(p)) extra.add(p);
|
|
2411
2432
|
const def = tableDef.value;
|
|
2412
2433
|
if (def?.identifierFields && def.identifierFields !== def.preferredId) {
|
|
2413
2434
|
for (const p of def.identifierFields) if (available.has(p) && !def.preferredId.includes(p)) extra.add(p);
|
|
@@ -2426,10 +2447,11 @@ function createTableState(opts) {
|
|
|
2426
2447
|
visibleColumnPaths: (buildOpts?.columnPaths ?? model.columnNames).filter((p) => !localPaths.has(p) && (!known || known.columns.has(p))),
|
|
2427
2448
|
extraSelect: extra.size ? [...extra] : void 0,
|
|
2428
2449
|
sorters: model.sorters,
|
|
2429
|
-
forceSorters:
|
|
2450
|
+
forceSorters: forceSorters.value,
|
|
2430
2451
|
filters: model.filters,
|
|
2452
|
+
encodeCondition: encodeCondition.value,
|
|
2431
2453
|
residualFilters: model.residual,
|
|
2432
|
-
forceFilters:
|
|
2454
|
+
forceFilters: forceFilters.value,
|
|
2433
2455
|
search: searchTerm.value || void 0,
|
|
2434
2456
|
ignoreSorters: sortersIgnored(),
|
|
2435
2457
|
includeActions: buildOpts?.includeActions ?? includeActions.value
|
|
@@ -2714,6 +2736,9 @@ function createTableState(opts) {
|
|
|
2714
2736
|
metadataError,
|
|
2715
2737
|
lastError,
|
|
2716
2738
|
mustRefresh,
|
|
2739
|
+
forceFilters,
|
|
2740
|
+
forceSorters,
|
|
2741
|
+
timeZone,
|
|
2717
2742
|
searchTerm,
|
|
2718
2743
|
ignoreSortersWhenSearched,
|
|
2719
2744
|
configDialogOpen,
|
|
@@ -3006,6 +3031,27 @@ function createTableState(opts) {
|
|
|
3006
3031
|
resetPagination();
|
|
3007
3032
|
debouncedFilterQuery();
|
|
3008
3033
|
});
|
|
3034
|
+
const readScope = () => ({
|
|
3035
|
+
filter: stableValueKey(forceFilters.value ?? null),
|
|
3036
|
+
sorters: stableValueKey(forceSorters.value),
|
|
3037
|
+
selected: (toValue(queryOpts?.alwaysSelected) ?? []).join("\0"),
|
|
3038
|
+
zone: `${timeZone.value ?? ""}|${weekStart.value ?? ""}`
|
|
3039
|
+
});
|
|
3040
|
+
let scope = readScope();
|
|
3041
|
+
watch(() => Object.values(readScope()).join(""), () => {
|
|
3042
|
+
const prev = scope;
|
|
3043
|
+
scope = readScope();
|
|
3044
|
+
if (!queryDetected) return;
|
|
3045
|
+
const filterChanged = scope.filter !== prev.filter;
|
|
3046
|
+
if (!filterChanged && scope.sorters === prev.sorters && scope.selected === prev.selected && (scope.zone === prev.zone || !hasFilledTemporalFilter())) return;
|
|
3047
|
+
mustRefresh.value = true;
|
|
3048
|
+
if (hydratingFromUrl) {
|
|
3049
|
+
if (filterChanged && urlQuerySync?.pagination === false) resetPagination();
|
|
3050
|
+
return;
|
|
3051
|
+
}
|
|
3052
|
+
if (filterChanged) resetPagination();
|
|
3053
|
+
scheduleQuery();
|
|
3054
|
+
});
|
|
3009
3055
|
watch(() => sorters.value, (next, prev) => {
|
|
3010
3056
|
if (hydratingFromUrl) return;
|
|
3011
3057
|
if (sortersEqual(prev, next)) return;
|
|
@@ -3114,6 +3160,7 @@ function createStaticTableState(opts) {
|
|
|
3114
3160
|
itemsPerPage: size,
|
|
3115
3161
|
pages: 1
|
|
3116
3162
|
});
|
|
3163
|
+
if (opts.remote) return opts.remote({ searchTerm: _state.searchTerm.value }, page, size);
|
|
3117
3164
|
fetcher ??= buildStaticQueryFn(opts, _state);
|
|
3118
3165
|
return fetcher(q, page, size);
|
|
3119
3166
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atscript/vue-table",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.148",
|
|
4
4
|
"description": "Type-driven table components for Atscript with Vue 3",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"atscript",
|
|
@@ -167,17 +167,17 @@
|
|
|
167
167
|
"access": "public"
|
|
168
168
|
},
|
|
169
169
|
"dependencies": {
|
|
170
|
-
"@atscript/ui": "^0.1.
|
|
171
|
-
"@atscript/
|
|
172
|
-
"@atscript/
|
|
170
|
+
"@atscript/ui": "^0.1.148",
|
|
171
|
+
"@atscript/ui-table": "^0.1.148",
|
|
172
|
+
"@atscript/vue-form": "^0.1.148"
|
|
173
173
|
},
|
|
174
174
|
"devDependencies": {
|
|
175
|
-
"@atscript/core": "^0.1.
|
|
176
|
-
"@atscript/db-client": "^0.1.
|
|
177
|
-
"@atscript/typescript": "^0.1.
|
|
175
|
+
"@atscript/core": "^0.1.100",
|
|
176
|
+
"@atscript/db-client": "^0.1.148",
|
|
177
|
+
"@atscript/typescript": "^0.1.100",
|
|
178
178
|
"@tanstack/vue-virtual": "^3.13.26",
|
|
179
|
-
"@uniqu/core": "^0.1.
|
|
180
|
-
"@uniqu/url": "^0.1.
|
|
179
|
+
"@uniqu/core": "^0.1.13",
|
|
180
|
+
"@uniqu/url": "^0.1.13",
|
|
181
181
|
"@vitejs/plugin-vue": "^6",
|
|
182
182
|
"@vue/test-utils": "^2",
|
|
183
183
|
"@vueuse/core": "^14.3.0",
|
|
@@ -190,9 +190,9 @@
|
|
|
190
190
|
"vunor": "^0.3.2"
|
|
191
191
|
},
|
|
192
192
|
"peerDependencies": {
|
|
193
|
-
"@atscript/db-client": "^0.1.
|
|
193
|
+
"@atscript/db-client": "^0.1.148",
|
|
194
194
|
"@tanstack/vue-virtual": "^3.13.26",
|
|
195
|
-
"@uniqu/url": "^0.1.
|
|
195
|
+
"@uniqu/url": "^0.1.13",
|
|
196
196
|
"@vueuse/core": "^14.3.0",
|
|
197
197
|
"reka-ui": "^2.9.8",
|
|
198
198
|
"vue": "^3"
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import { Fragment, computed, createCommentVNode, createElementBlock, createElementVNode, defineComponent, openBlock } from "vue";
|
|
2
|
-
import { NULL_OPS, hasSecondValue } from "@atscript/ui-table";
|
|
3
|
-
//#region src/components/defaults/as-filter-input.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
-
const _hoisted_1 = {
|
|
5
|
-
key: 0,
|
|
6
|
-
class: "as-filter-input-disabled",
|
|
7
|
-
"aria-hidden": "true"
|
|
8
|
-
};
|
|
9
|
-
const _hoisted_2 = ["value"];
|
|
10
|
-
const _hoisted_3 = { class: "as-filter-input-range" };
|
|
11
|
-
const _hoisted_4 = ["type", "value"];
|
|
12
|
-
const _hoisted_5 = ["type", "value"];
|
|
13
|
-
const _hoisted_6 = [
|
|
14
|
-
"type",
|
|
15
|
-
"value",
|
|
16
|
-
"placeholder"
|
|
17
|
-
];
|
|
18
|
-
//#endregion
|
|
19
|
-
//#region src/components/defaults/as-filter-input.vue
|
|
20
|
-
var as_filter_input_default = /* @__PURE__ */ defineComponent({
|
|
21
|
-
__name: "as-filter-input",
|
|
22
|
-
props: {
|
|
23
|
-
column: {
|
|
24
|
-
type: Object,
|
|
25
|
-
required: true
|
|
26
|
-
},
|
|
27
|
-
condition: {
|
|
28
|
-
type: Object,
|
|
29
|
-
required: true
|
|
30
|
-
},
|
|
31
|
-
filterType: {
|
|
32
|
-
type: String,
|
|
33
|
-
required: true
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
emits: ["update:condition"],
|
|
37
|
-
setup(__props, { emit: __emit }) {
|
|
38
|
-
const props = __props;
|
|
39
|
-
const emit = __emit;
|
|
40
|
-
const needsInput = computed(() => !NULL_OPS.has(props.condition.type));
|
|
41
|
-
const isBetween = computed(() => hasSecondValue(props.condition.type));
|
|
42
|
-
function updateValue(index, raw) {
|
|
43
|
-
const value = [...props.condition.value];
|
|
44
|
-
value[index] = props.filterType === "number" ? Number(raw) : raw;
|
|
45
|
-
emit("update:condition", {
|
|
46
|
-
...props.condition,
|
|
47
|
-
value
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
function onBoolSelect(val) {
|
|
51
|
-
const boolVal = val === "true";
|
|
52
|
-
emit("update:condition", {
|
|
53
|
-
...props.condition,
|
|
54
|
-
value: [boolVal]
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
const inputType = computed(() => {
|
|
58
|
-
if (props.filterType === "number") return "number";
|
|
59
|
-
if (props.filterType === "date") return "date";
|
|
60
|
-
return "text";
|
|
61
|
-
});
|
|
62
|
-
return (_ctx, _cache) => {
|
|
63
|
-
return openBlock(), createElementBlock(Fragment, null, [createCommentVNode(" Null/notNull: render a plain layer-1 box the size of a filter input, no text. "), !needsInput.value ? (openBlock(), createElementBlock("div", _hoisted_1)) : __props.filterType === "boolean" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [createCommentVNode(" Boolean select "), createElementVNode("select", {
|
|
64
|
-
class: "as-filter-input as-filter-select",
|
|
65
|
-
value: String(__props.condition.value[0] ?? ""),
|
|
66
|
-
onChange: _cache[0] || (_cache[0] = ($event) => onBoolSelect($event.target.value))
|
|
67
|
-
}, [..._cache[4] || (_cache[4] = [
|
|
68
|
-
createElementVNode("option", {
|
|
69
|
-
value: "",
|
|
70
|
-
disabled: ""
|
|
71
|
-
}, "Select...", -1),
|
|
72
|
-
createElementVNode("option", { value: "true" }, "true", -1),
|
|
73
|
-
createElementVNode("option", { value: "false" }, "false", -1)
|
|
74
|
-
])], 40, _hoisted_2)], 2112)) : isBetween.value ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [createCommentVNode(" Between: two inputs "), createElementVNode("div", _hoisted_3, [
|
|
75
|
-
createElementVNode("input", {
|
|
76
|
-
class: "as-filter-input",
|
|
77
|
-
type: inputType.value,
|
|
78
|
-
value: __props.condition.value[0] ?? "",
|
|
79
|
-
placeholder: "From",
|
|
80
|
-
onInput: _cache[1] || (_cache[1] = ($event) => updateValue(0, $event.target.value))
|
|
81
|
-
}, null, 40, _hoisted_4),
|
|
82
|
-
_cache[5] || (_cache[5] = createElementVNode("span", { class: "as-filter-input-range-sep" }, "–", -1)),
|
|
83
|
-
createElementVNode("input", {
|
|
84
|
-
class: "as-filter-input",
|
|
85
|
-
type: inputType.value,
|
|
86
|
-
value: __props.condition.value[1] ?? "",
|
|
87
|
-
placeholder: "To",
|
|
88
|
-
onInput: _cache[2] || (_cache[2] = ($event) => updateValue(1, $event.target.value))
|
|
89
|
-
}, null, 40, _hoisted_5)
|
|
90
|
-
])], 2112)) : (openBlock(), createElementBlock(Fragment, { key: 3 }, [createCommentVNode(" Default: single input "), createElementVNode("input", {
|
|
91
|
-
class: "as-filter-input",
|
|
92
|
-
type: inputType.value,
|
|
93
|
-
value: __props.condition.value[0] ?? "",
|
|
94
|
-
placeholder: __props.filterType === "date" ? "" : "Value...",
|
|
95
|
-
onInput: _cache[3] || (_cache[3] = ($event) => updateValue(0, $event.target.value))
|
|
96
|
-
}, null, 40, _hoisted_6)], 2112))], 2112);
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
//#endregion
|
|
101
|
-
export { as_filter_input_default as t };
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
let vue = require("vue");
|
|
2
|
-
let _atscript_ui_table = require("@atscript/ui-table");
|
|
3
|
-
//#region src/components/defaults/as-filter-input.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
-
const _hoisted_1 = {
|
|
5
|
-
key: 0,
|
|
6
|
-
class: "as-filter-input-disabled",
|
|
7
|
-
"aria-hidden": "true"
|
|
8
|
-
};
|
|
9
|
-
const _hoisted_2 = ["value"];
|
|
10
|
-
const _hoisted_3 = { class: "as-filter-input-range" };
|
|
11
|
-
const _hoisted_4 = ["type", "value"];
|
|
12
|
-
const _hoisted_5 = ["type", "value"];
|
|
13
|
-
const _hoisted_6 = [
|
|
14
|
-
"type",
|
|
15
|
-
"value",
|
|
16
|
-
"placeholder"
|
|
17
|
-
];
|
|
18
|
-
//#endregion
|
|
19
|
-
//#region src/components/defaults/as-filter-input.vue
|
|
20
|
-
var as_filter_input_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
21
|
-
__name: "as-filter-input",
|
|
22
|
-
props: {
|
|
23
|
-
column: {
|
|
24
|
-
type: Object,
|
|
25
|
-
required: true
|
|
26
|
-
},
|
|
27
|
-
condition: {
|
|
28
|
-
type: Object,
|
|
29
|
-
required: true
|
|
30
|
-
},
|
|
31
|
-
filterType: {
|
|
32
|
-
type: String,
|
|
33
|
-
required: true
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
emits: ["update:condition"],
|
|
37
|
-
setup(__props, { emit: __emit }) {
|
|
38
|
-
const props = __props;
|
|
39
|
-
const emit = __emit;
|
|
40
|
-
const needsInput = (0, vue.computed)(() => !_atscript_ui_table.NULL_OPS.has(props.condition.type));
|
|
41
|
-
const isBetween = (0, vue.computed)(() => (0, _atscript_ui_table.hasSecondValue)(props.condition.type));
|
|
42
|
-
function updateValue(index, raw) {
|
|
43
|
-
const value = [...props.condition.value];
|
|
44
|
-
value[index] = props.filterType === "number" ? Number(raw) : raw;
|
|
45
|
-
emit("update:condition", {
|
|
46
|
-
...props.condition,
|
|
47
|
-
value
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
function onBoolSelect(val) {
|
|
51
|
-
const boolVal = val === "true";
|
|
52
|
-
emit("update:condition", {
|
|
53
|
-
...props.condition,
|
|
54
|
-
value: [boolVal]
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
const inputType = (0, vue.computed)(() => {
|
|
58
|
-
if (props.filterType === "number") return "number";
|
|
59
|
-
if (props.filterType === "date") return "date";
|
|
60
|
-
return "text";
|
|
61
|
-
});
|
|
62
|
-
return (_ctx, _cache) => {
|
|
63
|
-
return (0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, null, [(0, vue.createCommentVNode)(" Null/notNull: render a plain layer-1 box the size of a filter input, no text. "), !needsInput.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_1)) : __props.filterType === "boolean" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 1 }, [(0, vue.createCommentVNode)(" Boolean select "), (0, vue.createElementVNode)("select", {
|
|
64
|
-
class: "as-filter-input as-filter-select",
|
|
65
|
-
value: String(__props.condition.value[0] ?? ""),
|
|
66
|
-
onChange: _cache[0] || (_cache[0] = ($event) => onBoolSelect($event.target.value))
|
|
67
|
-
}, [..._cache[4] || (_cache[4] = [
|
|
68
|
-
(0, vue.createElementVNode)("option", {
|
|
69
|
-
value: "",
|
|
70
|
-
disabled: ""
|
|
71
|
-
}, "Select...", -1),
|
|
72
|
-
(0, vue.createElementVNode)("option", { value: "true" }, "true", -1),
|
|
73
|
-
(0, vue.createElementVNode)("option", { value: "false" }, "false", -1)
|
|
74
|
-
])], 40, _hoisted_2)], 2112)) : isBetween.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 2 }, [(0, vue.createCommentVNode)(" Between: two inputs "), (0, vue.createElementVNode)("div", _hoisted_3, [
|
|
75
|
-
(0, vue.createElementVNode)("input", {
|
|
76
|
-
class: "as-filter-input",
|
|
77
|
-
type: inputType.value,
|
|
78
|
-
value: __props.condition.value[0] ?? "",
|
|
79
|
-
placeholder: "From",
|
|
80
|
-
onInput: _cache[1] || (_cache[1] = ($event) => updateValue(0, $event.target.value))
|
|
81
|
-
}, null, 40, _hoisted_4),
|
|
82
|
-
_cache[5] || (_cache[5] = (0, vue.createElementVNode)("span", { class: "as-filter-input-range-sep" }, "–", -1)),
|
|
83
|
-
(0, vue.createElementVNode)("input", {
|
|
84
|
-
class: "as-filter-input",
|
|
85
|
-
type: inputType.value,
|
|
86
|
-
value: __props.condition.value[1] ?? "",
|
|
87
|
-
placeholder: "To",
|
|
88
|
-
onInput: _cache[2] || (_cache[2] = ($event) => updateValue(1, $event.target.value))
|
|
89
|
-
}, null, 40, _hoisted_5)
|
|
90
|
-
])], 2112)) : ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 3 }, [(0, vue.createCommentVNode)(" Default: single input "), (0, vue.createElementVNode)("input", {
|
|
91
|
-
class: "as-filter-input",
|
|
92
|
-
type: inputType.value,
|
|
93
|
-
value: __props.condition.value[0] ?? "",
|
|
94
|
-
placeholder: __props.filterType === "date" ? "" : "Value...",
|
|
95
|
-
onInput: _cache[3] || (_cache[3] = ($event) => updateValue(0, $event.target.value))
|
|
96
|
-
}, null, 40, _hoisted_6)], 2112))], 2112);
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
//#endregion
|
|
101
|
-
Object.defineProperty(exports, "as_filter_input_default", {
|
|
102
|
-
enumerable: true,
|
|
103
|
-
get: function() {
|
|
104
|
-
return as_filter_input_default;
|
|
105
|
-
}
|
|
106
|
-
});
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/{as-residual-filter.vue-Cev_8Wy7.d.mts → as-residual-filter.vue-DbeOOtR7.d.mts}
RENAMED
|
File without changes
|
/package/dist/{as-table-cell-value.vue-kfNgVhzn.d.mts → as-table-cell-value.vue-BXIH_yfq.d.mts}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|