@atscript/vue-table 0.1.133 → 0.1.135

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.
Files changed (153) hide show
  1. package/dist/as-action-form-dialog.cjs +1 -1
  2. package/dist/as-action-form-dialog.mjs +1 -1
  3. package/dist/{as-action-menu-content-DiS37BYK.cjs → as-action-menu-content-D8VzLK9e.cjs} +1 -1
  4. package/dist/{as-action-menu-content-4D7CJNgr.mjs → as-action-menu-content-qATZy3cu.mjs} +1 -1
  5. package/dist/{as-cell-array-2qmJ1lT2.mjs → as-cell-array-BWHkJX3I.mjs} +2 -2
  6. package/dist/{as-cell-array-iPeUnk2G.cjs → as-cell-array-D-8Pqlgo.cjs} +2 -2
  7. package/dist/as-cell-array.cjs +1 -1
  8. package/dist/as-cell-array.mjs +1 -1
  9. package/dist/{as-cell-date-DyixWKuS.cjs → as-cell-date-DviMJEqs.cjs} +2 -2
  10. package/dist/{as-cell-date-BwFgi6O0.mjs → as-cell-date-mGlnDeLP.mjs} +2 -2
  11. package/dist/as-cell-date.cjs +1 -1
  12. package/dist/as-cell-date.mjs +1 -1
  13. package/dist/{as-cell-json--95Xq6yq.mjs → as-cell-json-2I081xnO.mjs} +2 -2
  14. package/dist/{as-cell-json-Bvv2P7YV.cjs → as-cell-json-CaVB6e7V.cjs} +2 -2
  15. package/dist/as-cell-json.cjs +1 -1
  16. package/dist/as-cell-json.mjs +1 -1
  17. package/dist/{as-cell-number-DuPMOesI.cjs → as-cell-number-BnYbxOiG.cjs} +2 -2
  18. package/dist/{as-cell-number-DKRaS9pM.mjs → as-cell-number-CP2AZI9g.mjs} +2 -2
  19. package/dist/as-cell-number.cjs +1 -1
  20. package/dist/as-cell-number.mjs +1 -1
  21. package/dist/{as-cell-union-DJNsEKTi.cjs → as-cell-union-BjMP91PS.cjs} +3 -3
  22. package/dist/{as-cell-union-C9FukGqF.mjs → as-cell-union-NHpDCXty.mjs} +3 -3
  23. package/dist/as-cell-union.cjs +1 -1
  24. package/dist/as-cell-union.mjs +1 -1
  25. package/dist/as-column-menu.cjs +1 -1
  26. package/dist/as-column-menu.d.cts +1 -1
  27. package/dist/as-column-menu.d.mts +1 -1
  28. package/dist/as-column-menu.mjs +1 -1
  29. package/dist/{as-column-menu.vue-Cuelpv3p.d.mts → as-column-menu.vue-BaIGUOhP.d.mts} +1 -1
  30. package/dist/{as-column-menu.vue-CZ8XqHl0.d.cts → as-column-menu.vue-CDlI4-Cz.d.cts} +1 -1
  31. package/dist/{as-config-dialog-BKsm8OHR.mjs → as-config-dialog-BMQxSqzl.mjs} +31 -15
  32. package/dist/{as-config-dialog-Bt8oP8qg.cjs → as-config-dialog-CP362FP3.cjs} +31 -15
  33. package/dist/as-config-dialog.cjs +1 -1
  34. package/dist/as-config-dialog.mjs +1 -1
  35. package/dist/{as-confirm-dialog-Cw7KErhz.cjs → as-confirm-dialog-D41XaN_P.cjs} +1 -1
  36. package/dist/{as-confirm-dialog-BV01t7dn.mjs → as-confirm-dialog-Dp_njNXz.mjs} +1 -1
  37. package/dist/as-confirm-dialog.cjs +1 -1
  38. package/dist/as-confirm-dialog.mjs +1 -1
  39. package/dist/{as-filter-dialog-Bxii-mYH.cjs → as-filter-dialog-BCUqpKPd.cjs} +9 -9
  40. package/dist/{as-filter-dialog-Ckrl79kU.mjs → as-filter-dialog-kAXGDwsk.mjs} +9 -9
  41. package/dist/as-filter-dialog.cjs +1 -1
  42. package/dist/as-filter-dialog.mjs +1 -1
  43. package/dist/{as-filter-field-xBr6TtKo.cjs → as-filter-field-D3jSbSwB.cjs} +3 -3
  44. package/dist/{as-filter-field-C-IFnj8K.mjs → as-filter-field-WnV2axh8.mjs} +3 -3
  45. package/dist/as-filter-field.cjs +1 -1
  46. package/dist/as-filter-field.mjs +1 -1
  47. package/dist/as-filter-input.cjs +1 -1
  48. package/dist/as-filter-input.mjs +1 -1
  49. package/dist/{as-filters-DJEQj7_p.mjs → as-filters-Bc44srvA.mjs} +3 -3
  50. package/dist/{as-filters-DuCk8nkk.cjs → as-filters-Dp93OWRS.cjs} +3 -3
  51. package/dist/as-filters.cjs +1 -1
  52. package/dist/as-filters.mjs +1 -1
  53. package/dist/{as-preset-dialog-CCIacZ2C.mjs → as-preset-dialog-Bx4nRuyk.mjs} +3 -3
  54. package/dist/{as-preset-dialog-jZeyXJeJ.cjs → as-preset-dialog-pusPD935.cjs} +3 -3
  55. package/dist/as-preset-dialog.cjs +1 -1
  56. package/dist/as-preset-dialog.mjs +1 -1
  57. package/dist/{as-preset-picker-DGSqQl9A.mjs → as-preset-picker-BRQdflJz.mjs} +54 -50
  58. package/dist/{as-preset-picker-4xXU1KQz.cjs → as-preset-picker-nAx3MYl7.cjs} +54 -50
  59. package/dist/as-preset-picker.cjs +1 -1
  60. package/dist/as-preset-picker.mjs +1 -1
  61. package/dist/{as-row-actions-B_OHWIAt.cjs → as-row-actions-PD-sFmDs.cjs} +24 -11
  62. package/dist/{as-row-actions-pukI1JT7.mjs → as-row-actions-gxmuZkYI.mjs} +24 -11
  63. package/dist/as-row-actions.cjs +1 -1
  64. package/dist/as-row-actions.d.cts +1 -1
  65. package/dist/as-row-actions.d.mts +1 -1
  66. package/dist/as-row-actions.mjs +1 -1
  67. package/dist/{as-row-actions.vue-DUSDuoR2.d.mts → as-row-actions.vue-AXXt5kQS.d.mts} +8 -0
  68. package/dist/{as-row-actions.vue-Bvcc2tUN.d.cts → as-row-actions.vue-D0MXQoeg.d.cts} +8 -0
  69. package/dist/{as-table-D5_bQ0p5.mjs → as-table-BIV1W3O9.mjs} +6 -6
  70. package/dist/{as-table-actions-DKYK_mTO.mjs → as-table-actions-DQ5Nn8Jc.mjs} +14 -9
  71. package/dist/{as-table-actions-qb0gQz2D.cjs → as-table-actions-D_PUqMYy.cjs} +14 -9
  72. package/dist/as-table-actions.cjs +1 -1
  73. package/dist/as-table-actions.d.cts +1 -1
  74. package/dist/as-table-actions.d.mts +1 -1
  75. package/dist/as-table-actions.mjs +1 -1
  76. package/dist/{as-table-actions.vue-CckRRsL6.d.cts → as-table-actions.vue-iKw4tsJh.d.cts} +2 -2
  77. package/dist/{as-table-actions.vue-DsqauvXR.d.mts → as-table-actions.vue-kndyFTyi.d.mts} +2 -2
  78. package/dist/{as-table-base-Dfw012G5.cjs → as-table-base-M6_12pPq.cjs} +3 -3
  79. package/dist/{as-table-base-B0arhJI8.mjs → as-table-base-kHOKCI7T.mjs} +3 -3
  80. package/dist/{as-table-cell-value-D1JkTQt0.cjs → as-table-cell-value-BAi5yadc.cjs} +2 -2
  81. package/dist/{as-table-cell-value-CPcFxSOj.mjs → as-table-cell-value-BVcfhhCb.mjs} +2 -2
  82. package/dist/as-table-cell-value.cjs +1 -1
  83. package/dist/as-table-cell-value.mjs +1 -1
  84. package/dist/{as-table-header-cell-q-c_QklI.mjs → as-table-header-cell-CZyy4q1s.mjs} +2 -2
  85. package/dist/{as-table-header-cell-Bb4ddLmQ.cjs → as-table-header-cell-Ct_GPLVu.cjs} +2 -2
  86. package/dist/as-table-header-cell.cjs +1 -1
  87. package/dist/as-table-header-cell.d.cts +1 -1
  88. package/dist/as-table-header-cell.d.mts +1 -1
  89. package/dist/as-table-header-cell.mjs +1 -1
  90. package/dist/{as-table-header-cell.vue-BjVOEFqz.d.mts → as-table-header-cell.vue-BNsOEsof.d.mts} +1 -1
  91. package/dist/{as-table-header-cell.vue-qS1Xfc-U.d.cts → as-table-header-cell.vue-DqjorECQ.d.cts} +1 -1
  92. package/dist/{as-table-root-Bpsrp0Vz.mjs → as-table-root-DGYw0kPC.mjs} +111 -9
  93. package/dist/{as-table-root-CUDO9ybm.cjs → as-table-root-EyN1JHuS.cjs} +111 -9
  94. package/dist/as-table-root.cjs +1 -1
  95. package/dist/as-table-root.d.cts +1 -1
  96. package/dist/as-table-root.d.mts +1 -1
  97. package/dist/as-table-root.mjs +1 -1
  98. package/dist/{as-table-root.vue-szvjZsCn.d.cts → as-table-root.vue-D0XFmTEL.d.mts} +201 -28
  99. package/dist/{as-table-root.vue-BPU92_Ns.d.mts → as-table-root.vue-Do0j4ibu.d.cts} +202 -29
  100. package/dist/{as-table-status-B9jlzPPV.mjs → as-table-status-CYzRbU71.mjs} +5 -5
  101. package/dist/{as-table-status-BgDexT2x.cjs → as-table-status-DMFZuZfJ.cjs} +5 -5
  102. package/dist/{as-table-BejpMVid.cjs → as-table-ucLFACn0.cjs} +6 -6
  103. package/dist/as-table.cjs +1 -1
  104. package/dist/as-table.d.cts +1 -1
  105. package/dist/as-table.d.mts +1 -1
  106. package/dist/as-table.mjs +1 -1
  107. package/dist/{as-table.vue-4WhMA8AM.d.mts → as-table.vue-Dl0nGtMF.d.mts} +5 -5
  108. package/dist/{as-table.vue-_urybtQj.d.cts → as-table.vue-QQ1aXpJC.d.cts} +5 -5
  109. package/dist/{as-window-table-S1XWpDHQ.mjs → as-window-table-B9Y4Xgwm.mjs} +11 -7
  110. package/dist/{as-window-table-CXq6UuUx.cjs → as-window-table-Bxq7cYW5.cjs} +11 -7
  111. package/dist/as-window-table.cjs +1 -1
  112. package/dist/as-window-table.d.cts +1 -1
  113. package/dist/as-window-table.d.mts +1 -1
  114. package/dist/as-window-table.mjs +1 -1
  115. package/dist/{as-window-table.vue-h1bdyMv7.d.cts → as-window-table.vue-CdfbFgGs.d.mts} +4 -4
  116. package/dist/{as-window-table.vue-CWsJvOkL.d.mts → as-window-table.vue-avZGJlCe.d.cts} +4 -4
  117. package/dist/index.cjs +193 -29
  118. package/dist/index.d.cts +9 -9
  119. package/dist/index.d.mts +9 -9
  120. package/dist/index.mjs +186 -31
  121. package/dist/{types-BZ0HssRY.d.cts → types-CyAmAg10.d.cts} +147 -2
  122. package/dist/{types-CXz-4dPz.d.mts → types-yS6-QFfT.d.mts} +147 -2
  123. package/dist/{use-table-Bk-jSxOM.mjs → use-table-BVptAnaS.mjs} +23 -13
  124. package/dist/{use-table-CdFFqaEx.cjs → use-table-Bm2a0g9D.cjs} +28 -12
  125. package/dist/{use-table-component-DlLganVc.cjs → use-table-component-Bpy5mg_P.cjs} +1 -1
  126. package/dist/{use-table-component-KuzZxAP8.mjs → use-table-component-DYzKgCC4.mjs} +1 -1
  127. package/dist/{use-table-nav-bridge-B9SSEajW.mjs → use-table-nav-bridge-LCL6vq9F.mjs} +1 -1
  128. package/dist/{use-table-nav-bridge-CVUmTjDr.cjs → use-table-nav-bridge-qyvyRm6S.cjs} +1 -1
  129. package/dist/{use-table-state-DLJbW753.mjs → use-table-state-CwfgWmuk.mjs} +222 -52
  130. package/dist/{use-table-state-D6dHOFrA.cjs → use-table-state-jljSQQ8m.cjs} +226 -56
  131. package/package.json +4 -4
  132. /package/dist/{as-cell-json-popover-Dkdv5Y9E.mjs → as-cell-json-popover-CH5bAcLE.mjs} +0 -0
  133. /package/dist/{as-cell-json-popover-BM2QLgfk.cjs → as-cell-json-popover-vty5vMjW.cjs} +0 -0
  134. /package/dist/{as-column-menu-kTIQfLTi.mjs → as-column-menu-BMTS3DO2.mjs} +0 -0
  135. /package/dist/{as-column-menu-fZVbJ9lU.cjs → as-column-menu-D_8NxujZ.cjs} +0 -0
  136. /package/dist/{as-filter-input-BM23TNeh.mjs → as-filter-input-C8KmOus8.mjs} +0 -0
  137. /package/dist/{as-filter-input-DJu2k9gO.cjs → as-filter-input-DUqpkTkg.cjs} +0 -0
  138. /package/dist/{error-message-CglODWl4.cjs → error-message-CfKpn_5w.cjs} +0 -0
  139. /package/dist/{error-message-hPSAu8Ug.mjs → error-message-gNEXnnbb.mjs} +0 -0
  140. /package/dist/{format-cell-D1Ziv96Q.mjs → format-cell-Bx7wNc4X.mjs} +0 -0
  141. /package/dist/{format-cell-vCNTh4WZ.cjs → format-cell-DaxV6WIJ.cjs} +0 -0
  142. /package/dist/{get-cell-value-4rHKP-TG.cjs → get-cell-value-CJT4fk4y.cjs} +0 -0
  143. /package/dist/{get-cell-value-C8LLc_Rr.mjs → get-cell-value-Cb3X8nUn.mjs} +0 -0
  144. /package/dist/{use-cell-locale-MQXoONh5.mjs → use-cell-locale-CxQOQsns.mjs} +0 -0
  145. /package/dist/{use-cell-locale-BGBRQB7s.cjs → use-cell-locale-caG2Fzpc.cjs} +0 -0
  146. /package/dist/{use-has-emit-listener-hhOH8CBI.cjs → use-has-emit-listener-BaGFZDyM.cjs} +0 -0
  147. /package/dist/{use-has-emit-listener-BTMDIv2e.mjs → use-has-emit-listener-DrBbsLHQ.mjs} +0 -0
  148. /package/dist/{use-seed-on-open-Dg9I89fU.cjs → use-seed-on-open-9TSm1Vbv.cjs} +0 -0
  149. /package/dist/{use-seed-on-open-DO3A1kIb.mjs → use-seed-on-open-DSh4XFyp.mjs} +0 -0
  150. /package/dist/{use-table-column-handlers-ehreEzcx.cjs → use-table-column-handlers-BMrP0WY2.cjs} +0 -0
  151. /package/dist/{use-table-column-handlers-CpiiIniD.mjs → use-table-column-handlers-Bx3JERqs.mjs} +0 -0
  152. /package/dist/{use-table-selection-Cmiu1h4S.cjs → use-table-selection-DtCV3rhu.cjs} +0 -0
  153. /package/dist/{use-table-selection-C84z4OZy.mjs → use-table-selection-ULbKT2xW.mjs} +0 -0
@@ -1,5 +1,5 @@
1
- const require_use_table_state = require("./use-table-state-D6dHOFrA.cjs");
2
- const require_as_action_menu_content = require("./as-action-menu-content-DiS37BYK.cjs");
1
+ const require_use_table_state = require("./use-table-state-jljSQQ8m.cjs");
2
+ const require_as_action_menu_content = require("./as-action-menu-content-D8VzLK9e.cjs");
3
3
  let vue = require("vue");
4
4
  let reka_ui = require("reka-ui");
5
5
  //#region src/components/as-table-actions.vue?vue&type=script&setup=true&lang.ts
@@ -46,7 +46,7 @@ var as_table_actions_default = /* @__PURE__ */ (0, vue.defineComponent)({
46
46
  const preferredId = (0, vue.computed)(() => state.tableDef.value?.preferredId ?? []);
47
47
  const resolved = (0, vue.computed)(() => {
48
48
  const r = resolveBuckets();
49
- const defaultHref = r.defaultAction ? require_use_table_state.actionHref(state, r.defaultAction, r.ids[0]) : void 0;
49
+ const defaultHref = r.defaultAction ? require_use_table_state.rowActionHref(state, r.defaultAction, r.ids[0], r.row) : void 0;
50
50
  return {
51
51
  ...r,
52
52
  defaultHref,
@@ -67,17 +67,21 @@ var as_table_actions_default = /* @__PURE__ */ (0, vue.defineComponent)({
67
67
  });
68
68
  if (effectiveLevel === "row") {
69
69
  const source = explicit === "auto" && selectedCount === 1 ? state.selectedRows.value[0] : state.getActiveRow();
70
- const filtered = require_use_table_state.applyRowGate({
70
+ const policy = state.rowActionsPolicy.value;
71
+ const filtered = policy.apply(require_use_table_state.applyRowGate({
71
72
  default: state.actions.default.row,
72
73
  others: state.actions.others.row,
73
74
  rows: explicit === "auto" && selectedCount === 1 ? state.actions.rows : []
74
- }, source);
75
+ }, source));
76
+ const row = source;
77
+ const extra = policy.extra(row);
75
78
  return collapseSingle({
76
79
  defaultAction: filtered.default,
77
- otherActions: filtered.others,
80
+ otherActions: extra.length > 0 ? [...filtered.others, ...extra] : filtered.others,
78
81
  trailingRowActions: filtered.rows,
79
82
  level: "row",
80
- ids: require_use_table_state.collectIdentifiers(state, [source], pid)
83
+ ids: require_use_table_state.collectIdentifiers(state, [source], pid),
84
+ row
81
85
  });
82
86
  }
83
87
  const filtered = require_use_table_state.applyRowsGate({
@@ -97,7 +101,8 @@ var as_table_actions_default = /* @__PURE__ */ (0, vue.defineComponent)({
97
101
  function promptCtx() {
98
102
  return {
99
103
  identifiers: resolved.value.ids,
100
- preferredId: preferredId.value
104
+ preferredId: preferredId.value,
105
+ row: resolved.value.row
101
106
  };
102
107
  }
103
108
  async function invokeWith(action, event) {
@@ -105,7 +110,7 @@ var as_table_actions_default = /* @__PURE__ */ (0, vue.defineComponent)({
105
110
  }
106
111
  /** Resolved navigate href for `action` against the toolbar's current ids. */
107
112
  function hrefFor(action) {
108
- return require_use_table_state.actionHref(state, action, resolved.value.ids[0]);
113
+ return require_use_table_state.rowActionHref(state, action, resolved.value.ids[0], resolved.value.row);
109
114
  }
110
115
  const { onTriggerClick, onTriggerAuxClick, openNewTab } = require_use_table_state.createNavigateGestures(state, promptCtx, hrefFor);
111
116
  const running = (0, vue.computed)(() => state.actions.invoking.value);
@@ -1,2 +1,2 @@
1
- const require_as_table_actions = require("./as-table-actions-qb0gQz2D.cjs");
1
+ const require_as_table_actions = require("./as-table-actions-D_PUqMYy.cjs");
2
2
  module.exports = require_as_table_actions.as_table_actions_default;
@@ -1,2 +1,2 @@
1
- import { t as _default } from "./as-table-actions.vue-CckRRsL6.cjs";
1
+ import { t as _default } from "./as-table-actions.vue-iKw4tsJh.cjs";
2
2
  export = _default;
@@ -1,2 +1,2 @@
1
- import { t as _default } from "./as-table-actions.vue-DsqauvXR.mjs";
1
+ import { t as _default } from "./as-table-actions.vue-kndyFTyi.mjs";
2
2
  export { _default as default };
@@ -1,2 +1,2 @@
1
- import { t as as_table_actions_default } from "./as-table-actions-DKYK_mTO.mjs";
1
+ import { t as as_table_actions_default } from "./as-table-actions-DQ5Nn8Jc.mjs";
2
2
  export { as_table_actions_default as default };
@@ -1,4 +1,4 @@
1
- import { b as TVueTableActionInfo } from "./types-BZ0HssRY.cjs";
1
+ import { S as TVueTableActionInfo } from "./types-CyAmAg10.cjs";
2
2
  import * as vue from "vue";
3
3
 
4
4
  //#region src/components/as-table-actions.vue.d.ts
@@ -18,7 +18,7 @@ declare var __VLS_1: {
18
18
  defaultAction: TVueTableActionInfo | undefined;
19
19
  otherActions: TVueTableActionInfo[];
20
20
  trailingRowActions: TVueTableActionInfo[];
21
- level: "row" | "rows" | "table";
21
+ level: "rows" | "table" | "row";
22
22
  ids: Record<string, unknown>[];
23
23
  invoke: typeof invokeWith;
24
24
  }, __VLS_12: {
@@ -1,4 +1,4 @@
1
- import { b as TVueTableActionInfo } from "./types-CXz-4dPz.mjs";
1
+ import { S as TVueTableActionInfo } from "./types-yS6-QFfT.mjs";
2
2
  import * as vue from "vue";
3
3
 
4
4
  //#region src/components/as-table-actions.vue.d.ts
@@ -18,7 +18,7 @@ declare var __VLS_1: {
18
18
  defaultAction: TVueTableActionInfo | undefined;
19
19
  otherActions: TVueTableActionInfo[];
20
20
  trailingRowActions: TVueTableActionInfo[];
21
- level: "row" | "rows" | "table";
21
+ level: "rows" | "table" | "row";
22
22
  ids: Record<string, unknown>[];
23
23
  invoke: typeof invokeWith;
24
24
  }, __VLS_12: {
@@ -1,6 +1,6 @@
1
- const require_use_table_state = require("./use-table-state-D6dHOFrA.cjs");
2
- const require_get_cell_value = require("./get-cell-value-4rHKP-TG.cjs");
3
- const require_as_table_status = require("./as-table-status-BgDexT2x.cjs");
1
+ const require_use_table_state = require("./use-table-state-jljSQQ8m.cjs");
2
+ const require_get_cell_value = require("./get-cell-value-CJT4fk4y.cjs");
3
+ const require_as_table_status = require("./as-table-status-DMFZuZfJ.cjs");
4
4
  let vue = require("vue");
5
5
  let _atscript_ui_table = require("@atscript/ui-table");
6
6
  let _vueuse_core = require("@vueuse/core");
@@ -1,6 +1,6 @@
1
- import { o as useTableContextOptional, p as onSelectControlKeydown } from "./use-table-state-DLJbW753.mjs";
2
- import { t as getCellValue } from "./get-cell-value-C8LLc_Rr.mjs";
3
- import { a as useCellComponents, n as as_table_header_default, o as useCellResolver, r as as_table_colgroup_default, t as as_table_status_default } from "./as-table-status-B9jlzPPV.mjs";
1
+ import { o as useTableContextOptional, p as onSelectControlKeydown } from "./use-table-state-CwfgWmuk.mjs";
2
+ import { t as getCellValue } from "./get-cell-value-Cb3X8nUn.mjs";
3
+ import { a as useCellComponents, n as as_table_header_default, o as useCellResolver, r as as_table_colgroup_default, t as as_table_status_default } from "./as-table-status-CYzRbU71.mjs";
4
4
  import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createVNode, defineComponent, guardReactiveProps, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onMounted, openBlock, ref, renderList, renderSlot, resolveDynamicComponent, unref, useSlots, watch, withCtx } from "vue";
5
5
  import { DEFAULT_ROW_HEIGHT_PX, filledFilterCount } from "@atscript/ui-table";
6
6
  import { useParentElement, useResizeObserver } from "@vueuse/core";
@@ -1,5 +1,5 @@
1
- const require_get_cell_value = require("./get-cell-value-4rHKP-TG.cjs");
2
- const require_format_cell = require("./format-cell-vCNTh4WZ.cjs");
1
+ const require_get_cell_value = require("./get-cell-value-CJT4fk4y.cjs");
2
+ const require_format_cell = require("./format-cell-DaxV6WIJ.cjs");
3
3
  let vue = require("vue");
4
4
  //#endregion
5
5
  //#region src/components/defaults/as-table-cell-value.vue
@@ -1,5 +1,5 @@
1
- import { t as getCellValue } from "./get-cell-value-C8LLc_Rr.mjs";
2
- import { t as formatCellValue } from "./format-cell-D1Ziv96Q.mjs";
1
+ import { t as getCellValue } from "./get-cell-value-Cb3X8nUn.mjs";
2
+ import { t as formatCellValue } from "./format-cell-Bx7wNc4X.mjs";
3
3
  import { createElementBlock, defineComponent, normalizeClass, openBlock, toDisplayString, unref } from "vue";
4
4
  //#endregion
5
5
  //#region src/components/defaults/as-table-cell-value.vue
@@ -1,2 +1,2 @@
1
- const require_as_table_cell_value = require("./as-table-cell-value-D1JkTQt0.cjs");
1
+ const require_as_table_cell_value = require("./as-table-cell-value-BAi5yadc.cjs");
2
2
  module.exports = require_as_table_cell_value.as_table_cell_value_default;
@@ -1,2 +1,2 @@
1
- import { t as as_table_cell_value_default } from "./as-table-cell-value-CPcFxSOj.mjs";
1
+ import { t as as_table_cell_value_default } from "./as-table-cell-value-BVcfhhCb.mjs";
2
2
  export { as_table_cell_value_default as default };
@@ -1,5 +1,5 @@
1
- import { t as useTableComponent } from "./use-table-component-KuzZxAP8.mjs";
2
- import { t as as_column_menu_default } from "./as-column-menu-kTIQfLTi.mjs";
1
+ import { t as useTableComponent } from "./use-table-component-DYzKgCC4.mjs";
2
+ import { t as as_column_menu_default } from "./as-column-menu-BMTS3DO2.mjs";
3
3
  import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, defineComponent, normalizeClass, openBlock, resolveDynamicComponent, toDisplayString, unref, withCtx, withModifiers } from "vue";
4
4
  import { isFilled } from "@atscript/ui-table";
5
5
  //#region src/components/defaults/as-table-header-cell.vue?vue&type=script&setup=true&lang.ts
@@ -1,5 +1,5 @@
1
- const require_use_table_component = require("./use-table-component-DlLganVc.cjs");
2
- const require_as_column_menu = require("./as-column-menu-fZVbJ9lU.cjs");
1
+ const require_use_table_component = require("./use-table-component-Bpy5mg_P.cjs");
2
+ const require_as_column_menu = require("./as-column-menu-D_8NxujZ.cjs");
3
3
  let vue = require("vue");
4
4
  let _atscript_ui_table = require("@atscript/ui-table");
5
5
  //#region src/components/defaults/as-table-header-cell.vue?vue&type=script&setup=true&lang.ts
@@ -1,2 +1,2 @@
1
- const require_as_table_header_cell = require("./as-table-header-cell-Bb4ddLmQ.cjs");
1
+ const require_as_table_header_cell = require("./as-table-header-cell-Ct_GPLVu.cjs");
2
2
  module.exports = require_as_table_header_cell.as_table_header_cell_default;
@@ -1,2 +1,2 @@
1
- import { t as _default } from "./as-table-header-cell.vue-qS1Xfc-U.cjs";
1
+ import { t as _default } from "./as-table-header-cell.vue-DqjorECQ.cjs";
2
2
  export = _default;
@@ -1,2 +1,2 @@
1
- import { t as _default } from "./as-table-header-cell.vue-BjVOEFqz.mjs";
1
+ import { t as _default } from "./as-table-header-cell.vue-BNsOEsof.mjs";
2
2
  export { _default as default };
@@ -1,2 +1,2 @@
1
- import { t as as_table_header_cell_default } from "./as-table-header-cell-q-c_QklI.mjs";
1
+ import { t as as_table_header_cell_default } from "./as-table-header-cell-CZyy4q1s.mjs";
2
2
  export { as_table_header_cell_default as default };
@@ -1,4 +1,4 @@
1
- import { n as ColumnMenuConfig } from "./types-CXz-4dPz.mjs";
1
+ import { n as ColumnMenuConfig } from "./types-yS6-QFfT.mjs";
2
2
  import { ColumnDef } from "@atscript/ui";
3
3
  import * as vue from "vue";
4
4
  import { ColumnWidthEntry, FilterCondition } from "@atscript/ui-table";
@@ -1,4 +1,4 @@
1
- import { n as ColumnMenuConfig } from "./types-BZ0HssRY.cjs";
1
+ import { n as ColumnMenuConfig } from "./types-CyAmAg10.cjs";
2
2
  import * as vue from "vue";
3
3
  import { ColumnDef } from "@atscript/ui";
4
4
  import { ColumnWidthEntry, FilterCondition } from "@atscript/ui-table";
@@ -1,9 +1,28 @@
1
- import { i as useRegisterMainActionListener } from "./use-table-state-DLJbW753.mjs";
2
- import { n as useTable } from "./use-table-Bk-jSxOM.mjs";
3
- import { t as useTableNavBridge } from "./use-table-nav-bridge-B9SSEajW.mjs";
4
- import { t as useHasEmitListener } from "./use-has-emit-listener-BTMDIv2e.mjs";
5
- import { t as as_confirm_dialog_default } from "./as-confirm-dialog-BV01t7dn.mjs";
1
+ import { i as useRegisterMainActionListener, t as createStaticTableState } from "./use-table-state-CwfgWmuk.mjs";
2
+ import { n as finalizeTableState, r as useTable } from "./use-table-BVptAnaS.mjs";
3
+ import { t as useTableNavBridge } from "./use-table-nav-bridge-LCL6vq9F.mjs";
4
+ import { t as useHasEmitListener } from "./use-has-emit-listener-DrBbsLHQ.mjs";
5
+ import { t as as_confirm_dialog_default } from "./as-confirm-dialog-Dp_njNXz.mjs";
6
6
  import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, defineAsyncComponent, defineComponent, mergeModels, openBlock, ref, renderSlot, resolveDynamicComponent, unref, useModel, watch } from "vue";
7
+ //#region src/utils/dev.ts
8
+ /**
9
+ * `true` outside a production build — the gate for authoring-time warnings, so
10
+ * their strings and checks cost a shipped app nothing.
11
+ *
12
+ * Read from `process.env.NODE_ENV` rather than `import.meta.env`: bundlers
13
+ * replace this expression with a literal in both the ESM and the CJS output,
14
+ * while `import.meta` only exists in the former. Where neither a bundler nor a
15
+ * `process` shim is present the read throws — warnings stay on, which is the
16
+ * safe side of the trade.
17
+ */
18
+ function detectDev() {
19
+ try {
20
+ return process.env.NODE_ENV !== "production";
21
+ } catch {
22
+ return true;
23
+ }
24
+ }
25
+ const DEV = detectDev();
7
26
  //#endregion
8
27
  //#region src/components/as-table-root.vue
9
28
  var as_table_root_default = /* @__PURE__ */ defineComponent({
@@ -11,7 +30,32 @@ var as_table_root_default = /* @__PURE__ */ defineComponent({
11
30
  props: /* @__PURE__ */ mergeModels({
12
31
  url: {
13
32
  type: String,
14
- required: true
33
+ required: false
34
+ },
35
+ rows: {
36
+ type: Array,
37
+ required: false
38
+ },
39
+ columns: {
40
+ type: Array,
41
+ required: false
42
+ },
43
+ searchPaths: {
44
+ type: Array,
45
+ required: false
46
+ },
47
+ localSort: {
48
+ type: Boolean,
49
+ required: false,
50
+ default: true
51
+ },
52
+ displayColumns: {
53
+ type: Array,
54
+ required: false
55
+ },
56
+ rowActions: {
57
+ type: Object,
58
+ required: false
15
59
  },
16
60
  clientFactory: {
17
61
  type: Function,
@@ -174,7 +218,61 @@ var as_table_root_default = /* @__PURE__ */ defineComponent({
174
218
  const urlQuery = useModel(__props, "urlQuery");
175
219
  const urlQueryActive = useHasEmitListener("onUpdate:urlQuery").value;
176
220
  const urlQueryReady = ref(!urlQueryActive);
177
- const state = useTable(props.url, {
221
+ /**
222
+ * Local mode is decided once, at setup: `:rows` present means "render this
223
+ * array", which is a different state factory (no client, no metadata fetch).
224
+ * It cannot flip at runtime — a table that changes data source re-mounts.
225
+ */
226
+ const localMode = props.rows !== void 0;
227
+ if (!localMode && !props.url) throw new Error("[vue-table] <AsTableRoot> requires either :url or :rows (local mode).");
228
+ /**
229
+ * Build the local-mode state: a `createStaticTableState` over the `:rows`
230
+ * array, provided to the subtree exactly like the fetching path so cells,
231
+ * keyboard nav, header slots, selection and the config dialog all work.
232
+ * Features that need a client are inert here and warned about once.
233
+ */
234
+ function createLocalState() {
235
+ if (DEV) {
236
+ if (props.url) console.warn("[vue-table] <AsTableRoot>: :rows is set, so :url is ignored (local mode).");
237
+ if (props.preset) console.warn("[vue-table] <AsTableRoot>: presets need a server and are off in local mode.");
238
+ if (urlQueryActive) console.warn("[vue-table] <AsTableRoot>: v-model:urlQuery is not wired in local mode.");
239
+ if (props.queryFn) console.warn("[vue-table] <AsTableRoot>: :queryFn is ignored in local mode.");
240
+ }
241
+ const { state: localState } = createStaticTableState({
242
+ rows: () => props.rows ?? [],
243
+ columns: props.columns ?? [],
244
+ searchPaths: props.searchPaths,
245
+ localSort: props.localSort,
246
+ displayColumns: props.displayColumns,
247
+ limit: props.limit,
248
+ queryOnMount: props.queryOnMount,
249
+ selection: {
250
+ rowValueFn: props.rowValueFn,
251
+ selectedRows
252
+ },
253
+ model: {
254
+ filterFields,
255
+ columnNames,
256
+ columnWidths,
257
+ sorters
258
+ },
259
+ actions: {
260
+ resolveHref: props.resolveHref,
261
+ onResolved: (action, ids, result, event) => emit("action", action, ids, result, event)
262
+ }
263
+ });
264
+ finalizeTableState(localState, {}, {
265
+ selectionPersistence: props.selectionPersistence,
266
+ controls: props.controls,
267
+ types: props.types,
268
+ components: props.components,
269
+ formTypes: props.formTypes,
270
+ formComponents: props.formComponents
271
+ });
272
+ watch(() => props.rows, () => localState.query({ silent: true }));
273
+ return localState;
274
+ }
275
+ const state = localMode ? createLocalState() : useTable(props.url, {
178
276
  limit: props.limit,
179
277
  rowValueFn: props.rowValueFn,
180
278
  selectionPersistence: props.selectionPersistence,
@@ -206,9 +304,13 @@ var as_table_root_default = /* @__PURE__ */ defineComponent({
206
304
  urlQueryReady: urlQueryActive ? urlQueryReady : void 0,
207
305
  onUrlQueryChange: urlQueryActive ? (s) => urlQuery.value = s : void 0,
208
306
  urlQuerySync: props.urlQuerySync,
209
- preset: props.preset
307
+ preset: props.preset,
308
+ displayColumns: props.displayColumns
210
309
  });
211
- if (urlQueryActive) watch([
310
+ watch(() => props.rowActions, (value) => {
311
+ state.rowActions.value = value;
312
+ }, { immediate: true });
313
+ if (urlQueryActive && !localMode) watch([
212
314
  () => state.tableDef.value,
213
315
  () => urlQuery.value,
214
316
  () => state.preset.ready.value
@@ -1,9 +1,28 @@
1
- const require_use_table_state = require("./use-table-state-D6dHOFrA.cjs");
2
- const require_use_table = require("./use-table-CdFFqaEx.cjs");
3
- const require_use_table_nav_bridge = require("./use-table-nav-bridge-CVUmTjDr.cjs");
4
- const require_use_has_emit_listener = require("./use-has-emit-listener-hhOH8CBI.cjs");
5
- const require_as_confirm_dialog = require("./as-confirm-dialog-Cw7KErhz.cjs");
1
+ const require_use_table_state = require("./use-table-state-jljSQQ8m.cjs");
2
+ const require_use_table = require("./use-table-Bm2a0g9D.cjs");
3
+ const require_use_table_nav_bridge = require("./use-table-nav-bridge-qyvyRm6S.cjs");
4
+ const require_use_has_emit_listener = require("./use-has-emit-listener-BaGFZDyM.cjs");
5
+ const require_as_confirm_dialog = require("./as-confirm-dialog-D41XaN_P.cjs");
6
6
  let vue = require("vue");
7
+ //#region src/utils/dev.ts
8
+ /**
9
+ * `true` outside a production build — the gate for authoring-time warnings, so
10
+ * their strings and checks cost a shipped app nothing.
11
+ *
12
+ * Read from `process.env.NODE_ENV` rather than `import.meta.env`: bundlers
13
+ * replace this expression with a literal in both the ESM and the CJS output,
14
+ * while `import.meta` only exists in the former. Where neither a bundler nor a
15
+ * `process` shim is present the read throws — warnings stay on, which is the
16
+ * safe side of the trade.
17
+ */
18
+ function detectDev() {
19
+ try {
20
+ return process.env.NODE_ENV !== "production";
21
+ } catch {
22
+ return true;
23
+ }
24
+ }
25
+ const DEV = detectDev();
7
26
  //#endregion
8
27
  //#region src/components/as-table-root.vue
9
28
  var as_table_root_default = /* @__PURE__ */ (0, vue.defineComponent)({
@@ -11,7 +30,32 @@ var as_table_root_default = /* @__PURE__ */ (0, vue.defineComponent)({
11
30
  props: /* @__PURE__ */ (0, vue.mergeModels)({
12
31
  url: {
13
32
  type: String,
14
- required: true
33
+ required: false
34
+ },
35
+ rows: {
36
+ type: Array,
37
+ required: false
38
+ },
39
+ columns: {
40
+ type: Array,
41
+ required: false
42
+ },
43
+ searchPaths: {
44
+ type: Array,
45
+ required: false
46
+ },
47
+ localSort: {
48
+ type: Boolean,
49
+ required: false,
50
+ default: true
51
+ },
52
+ displayColumns: {
53
+ type: Array,
54
+ required: false
55
+ },
56
+ rowActions: {
57
+ type: Object,
58
+ required: false
15
59
  },
16
60
  clientFactory: {
17
61
  type: Function,
@@ -174,7 +218,61 @@ var as_table_root_default = /* @__PURE__ */ (0, vue.defineComponent)({
174
218
  const urlQuery = (0, vue.useModel)(__props, "urlQuery");
175
219
  const urlQueryActive = require_use_has_emit_listener.useHasEmitListener("onUpdate:urlQuery").value;
176
220
  const urlQueryReady = (0, vue.ref)(!urlQueryActive);
177
- const state = require_use_table.useTable(props.url, {
221
+ /**
222
+ * Local mode is decided once, at setup: `:rows` present means "render this
223
+ * array", which is a different state factory (no client, no metadata fetch).
224
+ * It cannot flip at runtime — a table that changes data source re-mounts.
225
+ */
226
+ const localMode = props.rows !== void 0;
227
+ if (!localMode && !props.url) throw new Error("[vue-table] <AsTableRoot> requires either :url or :rows (local mode).");
228
+ /**
229
+ * Build the local-mode state: a `createStaticTableState` over the `:rows`
230
+ * array, provided to the subtree exactly like the fetching path so cells,
231
+ * keyboard nav, header slots, selection and the config dialog all work.
232
+ * Features that need a client are inert here and warned about once.
233
+ */
234
+ function createLocalState() {
235
+ if (DEV) {
236
+ if (props.url) console.warn("[vue-table] <AsTableRoot>: :rows is set, so :url is ignored (local mode).");
237
+ if (props.preset) console.warn("[vue-table] <AsTableRoot>: presets need a server and are off in local mode.");
238
+ if (urlQueryActive) console.warn("[vue-table] <AsTableRoot>: v-model:urlQuery is not wired in local mode.");
239
+ if (props.queryFn) console.warn("[vue-table] <AsTableRoot>: :queryFn is ignored in local mode.");
240
+ }
241
+ const { state: localState } = require_use_table_state.createStaticTableState({
242
+ rows: () => props.rows ?? [],
243
+ columns: props.columns ?? [],
244
+ searchPaths: props.searchPaths,
245
+ localSort: props.localSort,
246
+ displayColumns: props.displayColumns,
247
+ limit: props.limit,
248
+ queryOnMount: props.queryOnMount,
249
+ selection: {
250
+ rowValueFn: props.rowValueFn,
251
+ selectedRows
252
+ },
253
+ model: {
254
+ filterFields,
255
+ columnNames,
256
+ columnWidths,
257
+ sorters
258
+ },
259
+ actions: {
260
+ resolveHref: props.resolveHref,
261
+ onResolved: (action, ids, result, event) => emit("action", action, ids, result, event)
262
+ }
263
+ });
264
+ require_use_table.finalizeTableState(localState, {}, {
265
+ selectionPersistence: props.selectionPersistence,
266
+ controls: props.controls,
267
+ types: props.types,
268
+ components: props.components,
269
+ formTypes: props.formTypes,
270
+ formComponents: props.formComponents
271
+ });
272
+ (0, vue.watch)(() => props.rows, () => localState.query({ silent: true }));
273
+ return localState;
274
+ }
275
+ const state = localMode ? createLocalState() : require_use_table.useTable(props.url, {
178
276
  limit: props.limit,
179
277
  rowValueFn: props.rowValueFn,
180
278
  selectionPersistence: props.selectionPersistence,
@@ -206,9 +304,13 @@ var as_table_root_default = /* @__PURE__ */ (0, vue.defineComponent)({
206
304
  urlQueryReady: urlQueryActive ? urlQueryReady : void 0,
207
305
  onUrlQueryChange: urlQueryActive ? (s) => urlQuery.value = s : void 0,
208
306
  urlQuerySync: props.urlQuerySync,
209
- preset: props.preset
307
+ preset: props.preset,
308
+ displayColumns: props.displayColumns
210
309
  });
211
- if (urlQueryActive) (0, vue.watch)([
310
+ (0, vue.watch)(() => props.rowActions, (value) => {
311
+ state.rowActions.value = value;
312
+ }, { immediate: true });
313
+ if (urlQueryActive && !localMode) (0, vue.watch)([
212
314
  () => state.tableDef.value,
213
315
  () => urlQuery.value,
214
316
  () => state.preset.ready.value
@@ -1,2 +1,2 @@
1
- const require_as_table_root = require("./as-table-root-CUDO9ybm.cjs");
1
+ const require_as_table_root = require("./as-table-root-EyN1JHuS.cjs");
2
2
  module.exports = require_as_table_root.as_table_root_default;
@@ -1,2 +1,2 @@
1
- import { t as _default } from "./as-table-root.vue-szvjZsCn.cjs";
1
+ import { t as _default } from "./as-table-root.vue-Do0j4ibu.cjs";
2
2
  export = _default;
@@ -1,2 +1,2 @@
1
- import { t as _default } from "./as-table-root.vue-BPU92_Ns.mjs";
1
+ import { t as _default } from "./as-table-root.vue-D0XFmTEL.mjs";
2
2
  export { _default as default };
@@ -1,2 +1,2 @@
1
- import { t as as_table_root_default } from "./as-table-root-Bpsrp0Vz.mjs";
1
+ import { t as as_table_root_default } from "./as-table-root-DGYw0kPC.mjs";
2
2
  export { as_table_root_default as default };