@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
package/dist/index.mjs
CHANGED
|
@@ -1,37 +1,36 @@
|
|
|
1
|
-
import { I as queryTargetGate, O as extractIdentifier, V as ROW_ACTIONS_TYPE, a as useTableContext, b as QUERY_TARGET_UNSUPPORTED_REASON, k as identifierFieldsOf, n as createTableState, o as useTableContextOptional, r as provideTableContext, t as createStaticTableState, v as resolveRowActions, x as actionIdentifiers } from "./use-table-state-
|
|
1
|
+
import { I as queryTargetGate, O as extractIdentifier, V as ROW_ACTIONS_TYPE, a as useTableContext, b as QUERY_TARGET_UNSUPPORTED_REASON, k as identifierFieldsOf, n as createTableState, o as useTableContextOptional, r as provideTableContext, t as createStaticTableState, v as resolveRowActions, x as actionIdentifiers } from "./use-table-state-CIoWhwTD.mjs";
|
|
2
2
|
import { t as getCellValue } from "./get-cell-value-Cb3X8nUn.mjs";
|
|
3
3
|
import { n as useTableSelection } from "./use-table-selection-CdaOPo1d.mjs";
|
|
4
|
-
import { a as useLocalDraft, i as usePresets, o as AS_PRESETS_APP, r as useTable, s as injectPresetsApp, t as clearTableCache } from "./use-table-
|
|
5
|
-
import { t as
|
|
6
|
-
import { t as
|
|
7
|
-
import { t as
|
|
8
|
-
import { t as
|
|
9
|
-
import {
|
|
10
|
-
import { t as as_cell_json_default } from "./as-cell-json-
|
|
11
|
-
import { t as as_cell_number_default } from "./as-cell-number-
|
|
4
|
+
import { a as useLocalDraft, i as usePresets, o as AS_PRESETS_APP, r as useTable, s as injectPresetsApp, t as clearTableCache } from "./use-table-BYNBpLJt.mjs";
|
|
5
|
+
import { n as useCellLocale, t as provideCellLocale } from "./use-cell-locale-BTJZ6UcP.mjs";
|
|
6
|
+
import { t as useTableNavBridge } from "./use-table-nav-bridge-CJBERyPB.mjs";
|
|
7
|
+
import { t as useTableComponent } from "./use-table-component-Dy397695.mjs";
|
|
8
|
+
import { t as as_cell_array_default } from "./as-cell-array-CnoVd9ps.mjs";
|
|
9
|
+
import { t as as_cell_date_default } from "./as-cell-date-dhIM7hWA.mjs";
|
|
10
|
+
import { t as as_cell_json_default } from "./as-cell-json-ChN_NDhO.mjs";
|
|
11
|
+
import { t as as_cell_number_default } from "./as-cell-number-D-mSaE_G.mjs";
|
|
12
12
|
import { t as formatCellValue } from "./format-cell-D1Ziv96Q.mjs";
|
|
13
|
-
import { t as as_cell_union_default } from "./as-cell-union-
|
|
13
|
+
import { t as as_cell_union_default } from "./as-cell-union-C9Bbnkrg.mjs";
|
|
14
14
|
import { t as as_column_menu_default } from "./as-column-menu-CBtUfYEE.mjs";
|
|
15
|
-
import { t as as_config_dialog_default } from "./as-config-dialog-
|
|
16
|
-
import { t as as_confirm_dialog_default } from "./as-confirm-dialog-
|
|
17
|
-
import { t as
|
|
18
|
-
import { t as
|
|
19
|
-
import { t as
|
|
20
|
-
import { t as
|
|
21
|
-
import { t as
|
|
22
|
-
import { t as as_residual_filter_default } from "./as-residual-filter-
|
|
23
|
-
import { t as as_filters_default } from "./as-filters-
|
|
24
|
-
import { t as as_preset_dialog_default } from "./as-preset-dialog-
|
|
25
|
-
import { t as as_row_actions_default } from "./as-row-actions-
|
|
26
|
-
import { t as as_table_cell_value_default } from "./as-table-cell-value-
|
|
27
|
-
import { t as as_table_root_default } from "./as-table-root-
|
|
28
|
-
import { t as as_table_default } from "./as-table-
|
|
29
|
-
import { t as as_table_actions_default } from "./as-table-actions-
|
|
30
|
-
import { t as as_preset_picker_default } from "./as-preset-picker-
|
|
15
|
+
import { t as as_config_dialog_default } from "./as-config-dialog-ZKMnfirD.mjs";
|
|
16
|
+
import { t as as_confirm_dialog_default } from "./as-confirm-dialog-DMiGquH1.mjs";
|
|
17
|
+
import { t as as_filter_field_default } from "./as-filter-field-DE6MJMx7.mjs";
|
|
18
|
+
import { t as as_filter_input_default } from "./as-filter-input-DmOW_jzK.mjs";
|
|
19
|
+
import { t as as_filter_dialog_default } from "./as-filter-dialog-DNFR30fV.mjs";
|
|
20
|
+
import { t as as_table_header_cell_default } from "./as-table-header-cell-ahzAeHXj.mjs";
|
|
21
|
+
import { t as as_window_table_default } from "./as-window-table-DjplqWzr.mjs";
|
|
22
|
+
import { t as as_residual_filter_default } from "./as-residual-filter-DHfbtTQj.mjs";
|
|
23
|
+
import { t as as_filters_default } from "./as-filters-DErM2bFq.mjs";
|
|
24
|
+
import { t as as_preset_dialog_default } from "./as-preset-dialog-CY5dPfZa.mjs";
|
|
25
|
+
import { t as as_row_actions_default } from "./as-row-actions-BNQ7jrie.mjs";
|
|
26
|
+
import { t as as_table_cell_value_default } from "./as-table-cell-value-D-S127gr.mjs";
|
|
27
|
+
import { t as as_table_root_default } from "./as-table-root-BnkF5-rh.mjs";
|
|
28
|
+
import { t as as_table_default } from "./as-table-Bcz-WOTS.mjs";
|
|
29
|
+
import { t as as_table_actions_default } from "./as-table-actions-DPq5SrGa.mjs";
|
|
30
|
+
import { t as as_preset_picker_default } from "./as-preset-picker-DkZ7sinz.mjs";
|
|
31
31
|
import { getDefaultClientFactory, resetDefaultClientFactory, setDefaultClientFactory } from "@atscript/ui";
|
|
32
32
|
import { computed, effectScope, ref, shallowRef } from "vue";
|
|
33
|
-
import { AppPrefsClient, ExportAbortError, PRESET_ASPECTS, STANDARD_PRESET_ID, SYSTEM_PRESET_PREFIX, collectExportRows,
|
|
34
|
-
import { splitUrlSegments } from "@uniqu/url";
|
|
33
|
+
import { AppPrefsClient, DEV, ExportAbortError, PRESET_ASPECTS, STANDARD_PRESET_ID, SYSTEM_PRESET_PREFIX, collectExportRows, columnFilter, isFilled, isSystemPresetId, isUnavailableError, leadingKey, mergeUrlQueryRecord, resolveExportValue, resolveSystemPresets, toCsv, urlQueryConsumesKey, urlQueryRecordToString, withStableOrder } from "@atscript/ui-table";
|
|
35
34
|
import { StorageSerializers, useEventBus, useStorage } from "@vueuse/core";
|
|
36
35
|
//#region src/composables/use-table-export.ts
|
|
37
36
|
/**
|
|
@@ -71,13 +70,12 @@ function useTableExport(ctx) {
|
|
|
71
70
|
}
|
|
72
71
|
/**
|
|
73
72
|
* One value resolver per column, built once per run: the formatter lookup
|
|
74
|
-
*
|
|
73
|
+
* happens here instead of per cell (union-option labels are Map-backed in `optionLabel`).
|
|
75
74
|
*/
|
|
76
75
|
function resolversFor(columns, opts) {
|
|
77
76
|
return columns.map((column) => {
|
|
78
77
|
const perColumn = opts.formatters?.[column.path];
|
|
79
78
|
const formatCell = opts.formatCell;
|
|
80
|
-
const labels = column.options?.length ? new Map(column.options.map((o) => [o.key, o.label])) : null;
|
|
81
79
|
return (row) => {
|
|
82
80
|
const raw = getCellValue(row, column.path);
|
|
83
81
|
if (perColumn) {
|
|
@@ -88,11 +86,7 @@ function useTableExport(ctx) {
|
|
|
88
86
|
const out = formatCell(raw, column, row);
|
|
89
87
|
if (out !== void 0) return out;
|
|
90
88
|
}
|
|
91
|
-
|
|
92
|
-
const hit = labels.get(String(raw));
|
|
93
|
-
if (hit !== void 0) return hit;
|
|
94
|
-
}
|
|
95
|
-
return resolveExportValue(raw);
|
|
89
|
+
return resolveExportValue(raw, column);
|
|
96
90
|
};
|
|
97
91
|
});
|
|
98
92
|
}
|
|
@@ -198,9 +192,7 @@ function rawColumn(path) {
|
|
|
198
192
|
* Accepts `state` directly rather than injecting — safe to call outside `setup`.
|
|
199
193
|
*/
|
|
200
194
|
function useTableFilter(column, state) {
|
|
201
|
-
const filterType =
|
|
202
|
-
const availableConditions = columnFilterConditions(column);
|
|
203
|
-
const defCondition = columnDefaultCondition(column);
|
|
195
|
+
const { kind: filterType, conditions: availableConditions, defaultCondition: defCondition } = columnFilter(column);
|
|
204
196
|
function cloneConditions() {
|
|
205
197
|
const existing = state.filters.value[column.path];
|
|
206
198
|
if (existing && existing.length > 0) return existing.map((c) => ({
|
|
@@ -294,26 +286,11 @@ function useTableActions() {
|
|
|
294
286
|
}
|
|
295
287
|
//#endregion
|
|
296
288
|
//#region src/composables/use-table-url-query.ts
|
|
297
|
-
const KEY_CHAR = /[A-Za-z0-9_.$-]/;
|
|
298
|
-
/**
|
|
299
|
-
* Index of `=` if every char before it is URL-key-safe. Returns -1 when any
|
|
300
|
-
* non-key char (uniqu operator, whitespace, etc.) appears first — those
|
|
301
|
-
* segments must round-trip as a single bare key because vue-router's `query`
|
|
302
|
-
* record has no encoding for non-`=` separators.
|
|
303
|
-
*/
|
|
304
|
-
function findCleanEq(segment) {
|
|
305
|
-
for (let i = 0; i < segment.length; i++) {
|
|
306
|
-
const c = segment[i];
|
|
307
|
-
if (c === "=") return i > 0 ? i : -1;
|
|
308
|
-
if (!KEY_CHAR.test(c)) return -1;
|
|
309
|
-
}
|
|
310
|
-
return -1;
|
|
311
|
-
}
|
|
312
289
|
/**
|
|
313
|
-
* Bridge `<AsTableRoot v-model:url-query>` to
|
|
314
|
-
*
|
|
315
|
-
*
|
|
316
|
-
*
|
|
290
|
+
* Bridge `<AsTableRoot v-model:url-query>` to a router. Takes the structural
|
|
291
|
+
* {@link TableUrlQueryRoute} / {@link TableUrlQueryRouter} slices, so
|
|
292
|
+
* `@atscript/vue-table` imports nothing from `vue-router`: consumers pass
|
|
293
|
+
* their already-resolved `useRoute()` and `useRouter()` instances.
|
|
317
294
|
*
|
|
318
295
|
* Scope: the bridge owns **only what the table reads back** (since 0.1.133).
|
|
319
296
|
* A key is the table's iff `urlQueryStringToState` would consume it — see
|
|
@@ -325,10 +302,11 @@ function findCleanEq(segment) {
|
|
|
325
302
|
* written as one block in the table's order.
|
|
326
303
|
*
|
|
327
304
|
* Without a `prefix` the bridge cannot tell a plain `field=value` filter from
|
|
328
|
-
* a page-owned flag of the same shape
|
|
329
|
-
*
|
|
330
|
-
*
|
|
331
|
-
*
|
|
305
|
+
* a page-owned flag of the same shape: the table reads every unprefixed key,
|
|
306
|
+
* so a host key that is also a column path becomes a user filter. Pass
|
|
307
|
+
* `preserveKeys` to fence such host keys off (or `prefix` to namespace the
|
|
308
|
+
* table, which changes its URLs), and `prefix` when a route carries two
|
|
309
|
+
* tables.
|
|
332
310
|
*
|
|
333
311
|
* @example
|
|
334
312
|
* ```vue
|
|
@@ -346,47 +324,47 @@ function findCleanEq(segment) {
|
|
|
346
324
|
* ```
|
|
347
325
|
*/
|
|
348
326
|
function useTableUrlQuery(route, router, opts = {}) {
|
|
349
|
-
const
|
|
327
|
+
const usePush = (opts.mode ?? "replace") === "push";
|
|
328
|
+
if (usePush && typeof router.push !== "function") throw new TypeError("[vue-table] useTableUrlQuery: mode \"push\" needs router.push.");
|
|
329
|
+
const navigate = (query) => usePush ? router.push?.({ query }) : router.replace({ query });
|
|
350
330
|
const prefix = opts.prefix ? `${opts.prefix}.` : "";
|
|
331
|
+
const recordOpts = {
|
|
332
|
+
prefix: opts.prefix,
|
|
333
|
+
preserveKeys: opts.preserveKeys
|
|
334
|
+
};
|
|
351
335
|
const written = /* @__PURE__ */ new Set();
|
|
352
336
|
function isOwn(key) {
|
|
353
337
|
if (prefix) return key.startsWith(prefix);
|
|
354
338
|
return written.has(key) || urlQueryConsumesKey(key);
|
|
355
339
|
}
|
|
340
|
+
let withheld;
|
|
341
|
+
const warned = /* @__PURE__ */ new Set();
|
|
356
342
|
return computed({
|
|
357
343
|
get: () => {
|
|
358
|
-
const
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
const own = prefix ? key.slice(prefix.length) : key;
|
|
363
|
-
const v = q[key];
|
|
364
|
-
if (Array.isArray(v)) for (const item of v) parts.push(item == null ? own : `${own}=${item}`);
|
|
365
|
-
else if (v == null) parts.push(own);
|
|
366
|
-
else parts.push(`${own}=${v}`);
|
|
367
|
-
}
|
|
368
|
-
return parts.join("&");
|
|
344
|
+
const own = urlQueryRecordToString(route.query, recordOpts);
|
|
345
|
+
if (!withheld) return own;
|
|
346
|
+
if (own === withheld.expectedOwn) return withheld.lastSet;
|
|
347
|
+
return [own, ...withheld.held].filter(Boolean).join("&");
|
|
369
348
|
},
|
|
370
349
|
set: (urlString) => {
|
|
371
|
-
const
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
350
|
+
const merged = mergeUrlQueryRecord(route.query, urlString, {
|
|
351
|
+
...recordOpts,
|
|
352
|
+
isOwn
|
|
353
|
+
});
|
|
354
|
+
const { query } = merged;
|
|
355
|
+
for (const key of merged.own) written.add(key);
|
|
356
|
+
withheld = merged.withheld.length ? {
|
|
357
|
+
held: merged.withheld,
|
|
358
|
+
lastSet: urlString,
|
|
359
|
+
expectedOwn: urlQueryRecordToString(query, recordOpts)
|
|
360
|
+
} : void 0;
|
|
361
|
+
if (DEV) for (const segment of merged.withheld) {
|
|
362
|
+
const name = leadingKey(segment) || segment;
|
|
363
|
+
if (warned.has(name)) continue;
|
|
364
|
+
warned.add(name);
|
|
365
|
+
console.warn(`[vue-table] useTableUrlQuery: "${name}" is in preserveKeys, so the table's own "${name}" filter is kept private and is not written to the URL.`);
|
|
378
366
|
}
|
|
379
|
-
|
|
380
|
-
let placed = false;
|
|
381
|
-
const place = () => {
|
|
382
|
-
if (placed) return;
|
|
383
|
-
placed = true;
|
|
384
|
-
for (const [key, value] of serialized) query[key] = value;
|
|
385
|
-
};
|
|
386
|
-
for (const key in route.query) if (isOwn(key)) place();
|
|
387
|
-
else query[key] = route.query[key];
|
|
388
|
-
place();
|
|
389
|
-
navigate({ query });
|
|
367
|
+
navigate(query);
|
|
390
368
|
}
|
|
391
369
|
});
|
|
392
370
|
}
|
|
@@ -586,6 +586,19 @@ interface ReactiveTableState extends TableStateMethods {
|
|
|
586
586
|
* when present, otherwise type+`@expect.maxLen`-derived (see `computeDefaultColumnWidth`).
|
|
587
587
|
*/
|
|
588
588
|
columnWidths: Ref<ColumnWidthsMap>;
|
|
589
|
+
/**
|
|
590
|
+
* The app-authored `forceFilters` scope, read live. For chrome such as a
|
|
591
|
+
* "scoped to ..." badge. Since 0.1.148.
|
|
592
|
+
*/
|
|
593
|
+
forceFilters: ComputedRef<FilterExpr | undefined>;
|
|
594
|
+
/** The app-authored `forceSorters`, read live (empty when none). Since 0.1.148. */
|
|
595
|
+
forceSorters: ComputedRef<SortControl[]>;
|
|
596
|
+
/**
|
|
597
|
+
* The IANA time zone the table reads dates in (`undefined` = the browser's):
|
|
598
|
+
* the `timeZone` option, else the cell locale's. Date filters, their chips
|
|
599
|
+
* and their inputs all follow it. Since 0.1.148.
|
|
600
|
+
*/
|
|
601
|
+
timeZone: ComputedRef<string | undefined>;
|
|
589
602
|
filterFields: ShallowRef<string[]>;
|
|
590
603
|
filters: ShallowRef<FieldFilters>;
|
|
591
604
|
/**
|
|
@@ -586,6 +586,19 @@ interface ReactiveTableState extends TableStateMethods {
|
|
|
586
586
|
* when present, otherwise type+`@expect.maxLen`-derived (see `computeDefaultColumnWidth`).
|
|
587
587
|
*/
|
|
588
588
|
columnWidths: Ref<ColumnWidthsMap>;
|
|
589
|
+
/**
|
|
590
|
+
* The app-authored `forceFilters` scope, read live. For chrome such as a
|
|
591
|
+
* "scoped to ..." badge. Since 0.1.148.
|
|
592
|
+
*/
|
|
593
|
+
forceFilters: ComputedRef<FilterExpr | undefined>;
|
|
594
|
+
/** The app-authored `forceSorters`, read live (empty when none). Since 0.1.148. */
|
|
595
|
+
forceSorters: ComputedRef<SortControl[]>;
|
|
596
|
+
/**
|
|
597
|
+
* The IANA time zone the table reads dates in (`undefined` = the browser's):
|
|
598
|
+
* the `timeZone` option, else the cell locale's. Date filters, their chips
|
|
599
|
+
* and their inputs all follow it. Since 0.1.148.
|
|
600
|
+
*/
|
|
601
|
+
timeZone: ComputedRef<string | undefined>;
|
|
589
602
|
filterFields: ShallowRef<string[]>;
|
|
590
603
|
filters: ShallowRef<FieldFilters>;
|
|
591
604
|
/**
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { n as useCellLocale } from "./use-cell-locale-BTJZ6UcP.mjs";
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
import { formatColumnCondition, formatColumnValue, formatFilterCondition } from "@atscript/ui-table";
|
|
4
|
+
//#region src/composables/use-condition-format.ts
|
|
5
|
+
/**
|
|
6
|
+
* Chip wording for filter conditions, in the table's time zone and the cell
|
|
7
|
+
* locale: "Last 7 days", "on Oct 5, 2026", "after Oct 5, 2026, 14:30" on date
|
|
8
|
+
* columns, the operator symbols elsewhere. Reads reactive sources, so call the
|
|
9
|
+
* returned functions inside `computed` / templates.
|
|
10
|
+
*
|
|
11
|
+
* Call in `setup` (it injects the cell locale).
|
|
12
|
+
*/
|
|
13
|
+
function useConditionFormat(state) {
|
|
14
|
+
const { locale } = useCellLocale();
|
|
15
|
+
const opts = () => ({
|
|
16
|
+
locale: locale.value,
|
|
17
|
+
timeZone: state.timeZone.value
|
|
18
|
+
});
|
|
19
|
+
const columns = computed(() => new Map(state.allColumns.value.map((c) => [c.path, c])));
|
|
20
|
+
return {
|
|
21
|
+
formatCondition(column, cond) {
|
|
22
|
+
return column ? formatColumnCondition(column, cond, opts()) : formatFilterCondition(cond);
|
|
23
|
+
},
|
|
24
|
+
formatValue(path, value) {
|
|
25
|
+
const column = columns.value.get(path);
|
|
26
|
+
return column ? formatColumnValue(column, value, opts()) : void 0;
|
|
27
|
+
},
|
|
28
|
+
labelOf(path) {
|
|
29
|
+
return columns.value.get(path)?.label;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
//#endregion
|
|
34
|
+
export { useConditionFormat as t };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
const require_use_cell_locale = require("./use-cell-locale-Dv514-Al.cjs");
|
|
2
|
+
let vue = require("vue");
|
|
3
|
+
let _atscript_ui_table = require("@atscript/ui-table");
|
|
4
|
+
//#region src/composables/use-condition-format.ts
|
|
5
|
+
/**
|
|
6
|
+
* Chip wording for filter conditions, in the table's time zone and the cell
|
|
7
|
+
* locale: "Last 7 days", "on Oct 5, 2026", "after Oct 5, 2026, 14:30" on date
|
|
8
|
+
* columns, the operator symbols elsewhere. Reads reactive sources, so call the
|
|
9
|
+
* returned functions inside `computed` / templates.
|
|
10
|
+
*
|
|
11
|
+
* Call in `setup` (it injects the cell locale).
|
|
12
|
+
*/
|
|
13
|
+
function useConditionFormat(state) {
|
|
14
|
+
const { locale } = require_use_cell_locale.useCellLocale();
|
|
15
|
+
const opts = () => ({
|
|
16
|
+
locale: locale.value,
|
|
17
|
+
timeZone: state.timeZone.value
|
|
18
|
+
});
|
|
19
|
+
const columns = (0, vue.computed)(() => new Map(state.allColumns.value.map((c) => [c.path, c])));
|
|
20
|
+
return {
|
|
21
|
+
formatCondition(column, cond) {
|
|
22
|
+
return column ? (0, _atscript_ui_table.formatColumnCondition)(column, cond, opts()) : (0, _atscript_ui_table.formatFilterCondition)(cond);
|
|
23
|
+
},
|
|
24
|
+
formatValue(path, value) {
|
|
25
|
+
const column = columns.value.get(path);
|
|
26
|
+
return column ? (0, _atscript_ui_table.formatColumnValue)(column, value, opts()) : void 0;
|
|
27
|
+
},
|
|
28
|
+
labelOf(path) {
|
|
29
|
+
return columns.value.get(path)?.label;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
//#endregion
|
|
34
|
+
Object.defineProperty(exports, "useConditionFormat", {
|
|
35
|
+
enumerable: true,
|
|
36
|
+
get: function() {
|
|
37
|
+
return useConditionFormat;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { l as DEFAULT_AVAILABLE_ASPECTS, n as createTableState, r as provideTableContext } from "./use-table-state-
|
|
1
|
+
import { l as DEFAULT_AVAILABLE_ASPECTS, n as createTableState, r as provideTableContext } from "./use-table-state-CIoWhwTD.mjs";
|
|
2
2
|
import { n as useTableSelection } from "./use-table-selection-CdaOPo1d.mjs";
|
|
3
|
+
import { n as useCellLocale } from "./use-cell-locale-BTJZ6UcP.mjs";
|
|
3
4
|
import { createTableDef, getMetaEntry, resetMetaCache } from "@atscript/ui";
|
|
4
|
-
import { computed, inject, isRef, ref, shallowRef, toValue, watch } from "vue";
|
|
5
|
+
import { computed, getCurrentInstance, inject, isRef, ref, shallowRef, toValue, watch } from "vue";
|
|
5
6
|
import { PresetsClient, STANDARD_PRESET_ID, debounce, deserializeDraft, isEmptyDraft, isSystemPresetId, isUnavailableError, resolveSystemPresets, serializeDraft, stableStringify } from "@atscript/ui-table";
|
|
6
7
|
//#region src/composables/as-presets-app.ts
|
|
7
8
|
/**
|
|
@@ -33,6 +34,23 @@ function injectPresetsApp(explicit) {
|
|
|
33
34
|
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.");
|
|
34
35
|
}
|
|
35
36
|
//#endregion
|
|
37
|
+
//#region src/utils/week-start.ts
|
|
38
|
+
/**
|
|
39
|
+
* The first day of the week for a locale, `1` = Monday … `7` = Sunday, from
|
|
40
|
+
* `Intl.Locale#getWeekInfo` where the runtime has it; `undefined` otherwise
|
|
41
|
+
* (callers then default to Monday).
|
|
42
|
+
*/
|
|
43
|
+
function weekStartOf(locale) {
|
|
44
|
+
if (!locale) return void 0;
|
|
45
|
+
try {
|
|
46
|
+
const l = new Intl.Locale(locale);
|
|
47
|
+
const day = (l.getWeekInfo?.() ?? l.weekInfo)?.firstDay;
|
|
48
|
+
return typeof day === "number" && day >= 1 && day <= 7 ? day : void 0;
|
|
49
|
+
} catch {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
//#endregion
|
|
36
54
|
//#region src/composables/use-local-draft.ts
|
|
37
55
|
const DEFAULT_DEBOUNCE_MS = 300;
|
|
38
56
|
/**
|
|
@@ -395,6 +413,7 @@ function useTable(url, opts) {
|
|
|
395
413
|
if (!entry.tableDef) entry.tableDef = Promise.all([entry.meta, entry.type]).then(([meta, type]) => createTableDef(meta, type));
|
|
396
414
|
const { client } = entry;
|
|
397
415
|
const defPromise = entry.tableDef;
|
|
416
|
+
const cellLocale = getCurrentInstance() ? useCellLocale() : void 0;
|
|
398
417
|
const preset = opts?.preset;
|
|
399
418
|
const presetsHandle = preset ? usePresets({
|
|
400
419
|
url: preset.url,
|
|
@@ -431,6 +450,8 @@ function useTable(url, opts) {
|
|
|
431
450
|
forceFilters: opts?.forceFilters,
|
|
432
451
|
forceSorters: opts?.forceSorters,
|
|
433
452
|
alwaysSelected: opts?.alwaysSelected,
|
|
453
|
+
timeZone: () => toValue(opts?.timeZone) ?? cellLocale?.timezone.value,
|
|
454
|
+
weekStart: () => toValue(opts?.weekStart) ?? weekStartOf(cellLocale?.locale.value),
|
|
434
455
|
blockQuery: opts?.blockQuery,
|
|
435
456
|
queryOnMount: opts?.queryOnMount,
|
|
436
457
|
ignoreSortersWhenSearched: typeof opts?.ignoreSortersWhenSearched === "boolean" ? opts.ignoreSortersWhenSearched : void 0,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
const require_use_table_state = require("./use-table-state-
|
|
1
|
+
const require_use_table_state = require("./use-table-state-BQchKxUr.cjs");
|
|
2
2
|
const require_use_table_selection = require("./use-table-selection-Cs7-gjHg.cjs");
|
|
3
|
+
const require_use_cell_locale = require("./use-cell-locale-Dv514-Al.cjs");
|
|
3
4
|
let _atscript_ui = require("@atscript/ui");
|
|
4
5
|
let vue = require("vue");
|
|
5
6
|
let _atscript_ui_table = require("@atscript/ui-table");
|
|
@@ -33,6 +34,23 @@ function injectPresetsApp(explicit) {
|
|
|
33
34
|
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.");
|
|
34
35
|
}
|
|
35
36
|
//#endregion
|
|
37
|
+
//#region src/utils/week-start.ts
|
|
38
|
+
/**
|
|
39
|
+
* The first day of the week for a locale, `1` = Monday … `7` = Sunday, from
|
|
40
|
+
* `Intl.Locale#getWeekInfo` where the runtime has it; `undefined` otherwise
|
|
41
|
+
* (callers then default to Monday).
|
|
42
|
+
*/
|
|
43
|
+
function weekStartOf(locale) {
|
|
44
|
+
if (!locale) return void 0;
|
|
45
|
+
try {
|
|
46
|
+
const l = new Intl.Locale(locale);
|
|
47
|
+
const day = (l.getWeekInfo?.() ?? l.weekInfo)?.firstDay;
|
|
48
|
+
return typeof day === "number" && day >= 1 && day <= 7 ? day : void 0;
|
|
49
|
+
} catch {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
//#endregion
|
|
36
54
|
//#region src/composables/use-local-draft.ts
|
|
37
55
|
const DEFAULT_DEBOUNCE_MS = 300;
|
|
38
56
|
/**
|
|
@@ -395,6 +413,7 @@ function useTable(url, opts) {
|
|
|
395
413
|
if (!entry.tableDef) entry.tableDef = Promise.all([entry.meta, entry.type]).then(([meta, type]) => (0, _atscript_ui.createTableDef)(meta, type));
|
|
396
414
|
const { client } = entry;
|
|
397
415
|
const defPromise = entry.tableDef;
|
|
416
|
+
const cellLocale = (0, vue.getCurrentInstance)() ? require_use_cell_locale.useCellLocale() : void 0;
|
|
398
417
|
const preset = opts?.preset;
|
|
399
418
|
const presetsHandle = preset ? usePresets({
|
|
400
419
|
url: preset.url,
|
|
@@ -431,6 +450,8 @@ function useTable(url, opts) {
|
|
|
431
450
|
forceFilters: opts?.forceFilters,
|
|
432
451
|
forceSorters: opts?.forceSorters,
|
|
433
452
|
alwaysSelected: opts?.alwaysSelected,
|
|
453
|
+
timeZone: () => (0, vue.toValue)(opts?.timeZone) ?? cellLocale?.timezone.value,
|
|
454
|
+
weekStart: () => (0, vue.toValue)(opts?.weekStart) ?? weekStartOf(cellLocale?.locale.value),
|
|
434
455
|
blockQuery: opts?.blockQuery,
|
|
435
456
|
queryOnMount: opts?.queryOnMount,
|
|
436
457
|
ignoreSortersWhenSearched: typeof opts?.ignoreSortersWhenSearched === "boolean" ? opts.ignoreSortersWhenSearched : void 0,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_use_table_state = require("./use-table-state-
|
|
1
|
+
const require_use_table_state = require("./use-table-state-BQchKxUr.cjs");
|
|
2
2
|
//#region src/composables/use-table-component.ts
|
|
3
3
|
/**
|
|
4
4
|
* Resolve a single skin-slot component from the injected `controls` map,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as useTableContextOptional } from "./use-table-state-
|
|
1
|
+
import { o as useTableContextOptional } from "./use-table-state-CIoWhwTD.mjs";
|
|
2
2
|
//#region src/composables/use-table-component.ts
|
|
3
3
|
/**
|
|
4
4
|
* Resolve a single skin-slot component from the injected `controls` map,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as useTableContextOptional } from "./use-table-state-
|
|
1
|
+
import { o as useTableContextOptional } from "./use-table-state-CIoWhwTD.mjs";
|
|
2
2
|
//#region src/composables/use-table-nav-bridge.ts
|
|
3
3
|
function isPassthroughKey(event) {
|
|
4
4
|
const key = event.key;
|
|
@@ -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 = (0, vue.computed)(() => (0, vue.toValue)(queryOpts?.forceFilters));
|
|
2364
|
+
const timeZone = (0, vue.computed)(() => (0, vue.toValue)(queryOpts?.timeZone));
|
|
2365
|
+
const weekStart = (0, vue.computed)(() => (0, vue.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 = (0, vue.computed)(() => (0, _atscript_ui_table.createColumnValueEncoder)(allColumns.value, {
|
|
2372
|
+
timeZone: timeZone.value,
|
|
2373
|
+
weekStart: weekStart.value
|
|
2374
|
+
}));
|
|
2375
|
+
const forceSorters = (0, vue.computed)(() => (0, vue.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 || !(0, _atscript_ui_table.isTemporalKind)((0, _atscript_ui_table.columnFilterKind)(c))) continue;
|
|
2380
|
+
if (filters.value[c.path]?.some(_atscript_ui_table.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 (0, _atscript_ui_table.sortRowsLocally)(rows, forced.length ? (0, _atscript_ui_table.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 (0, vue.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: (0, _atscript_ui_table.stableValueKey)(forceFilters.value ?? null),
|
|
3036
|
+
sorters: (0, _atscript_ui_table.stableValueKey)(forceSorters.value),
|
|
3037
|
+
selected: ((0, vue.toValue)(queryOpts?.alwaysSelected) ?? []).join("\0"),
|
|
3038
|
+
zone: `${timeZone.value ?? ""}|${weekStart.value ?? ""}`
|
|
3039
|
+
});
|
|
3040
|
+
let scope = readScope();
|
|
3041
|
+
(0, vue.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
|
(0, vue.watch)(() => sorters.value, (next, prev) => {
|
|
3010
3056
|
if (hydratingFromUrl) return;
|
|
3011
3057
|
if ((0, _atscript_ui_table.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
|
};
|