@atscript/vue-table 0.1.137 → 0.1.138

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 (63) hide show
  1. package/dist/as-column-menu.d.cts +1 -1
  2. package/dist/as-column-menu.d.mts +1 -1
  3. package/dist/{as-column-menu.vue-DIuEvru6.d.mts → as-column-menu.vue-CgvDp7JK.d.cts} +2 -2
  4. package/dist/{as-column-menu.vue-olu6BNEU.d.cts → as-column-menu.vue-SRkxrvo_.d.mts} +2 -2
  5. package/dist/{as-filter-dialog-DoynFox2.cjs → as-filter-dialog-CW8-zoag.cjs} +2 -2
  6. package/dist/{as-filter-dialog-DAvtsH3d.mjs → as-filter-dialog-Dis7tkN_.mjs} +2 -2
  7. package/dist/as-filter-dialog.cjs +1 -1
  8. package/dist/as-filter-dialog.mjs +1 -1
  9. package/dist/{as-filter-field-DB5WFT4l.mjs → as-filter-field-BKoxTudl.mjs} +1 -1
  10. package/dist/{as-filter-field-CBMDjApB.cjs → as-filter-field-bVIXoH3j.cjs} +1 -1
  11. package/dist/as-filter-field.cjs +1 -1
  12. package/dist/as-filter-field.mjs +1 -1
  13. package/dist/{as-filters-DfBH5YH9.mjs → as-filters-CxVy00LQ.mjs} +1 -1
  14. package/dist/{as-filters-CiPv-dKs.cjs → as-filters-Dx8WkGiA.cjs} +1 -1
  15. package/dist/as-filters.cjs +1 -1
  16. package/dist/as-filters.mjs +1 -1
  17. package/dist/as-row-actions.d.cts +1 -1
  18. package/dist/as-row-actions.d.mts +1 -1
  19. package/dist/{as-row-actions.vue-Cac2kfwO.d.cts → as-row-actions.vue-BCgHsU18.d.mts} +1 -1
  20. package/dist/{as-row-actions.vue-DZrASzp7.d.mts → as-row-actions.vue-C49h8PpE.d.cts} +1 -1
  21. package/dist/{as-table-DtfWLLlb.mjs → as-table-BAoJ60tx.mjs} +8 -34
  22. package/dist/{as-table-BNfZcSra.cjs → as-table-QoXP-NZr.cjs} +7 -33
  23. package/dist/as-table-actions.d.cts +1 -1
  24. package/dist/as-table-actions.d.mts +1 -1
  25. package/dist/{as-table-actions.vue-66cjnFZI.d.mts → as-table-actions.vue-BTGQnFH_.d.mts} +2 -2
  26. package/dist/{as-table-actions.vue-B7ttOxKU.d.cts → as-table-actions.vue-oxyikRAt.d.cts} +2 -2
  27. package/dist/{as-table-base-D7mO_Zmv.mjs → as-table-base-DA5T7x_K.mjs} +1 -1
  28. package/dist/{as-table-base-CdtyDOra.cjs → as-table-base-wPJuru7P.cjs} +1 -1
  29. package/dist/as-table-header-cell.d.cts +1 -1
  30. package/dist/as-table-header-cell.d.mts +1 -1
  31. package/dist/{as-table-header-cell.vue-DhCxDIn1.d.mts → as-table-header-cell.vue-BjgxfKhi.d.cts} +2 -2
  32. package/dist/{as-table-header-cell.vue-DmncmpeQ.d.cts → as-table-header-cell.vue-zGeuzm3w.d.mts} +2 -2
  33. package/dist/as-table-root.d.cts +1 -1
  34. package/dist/as-table-root.d.mts +1 -1
  35. package/dist/{as-table-root.vue-zWOmt_ug.d.mts → as-table-root.vue-DnOHVQtA.d.mts} +3 -3
  36. package/dist/{as-table-root.vue-BllmTRXj.d.cts → as-table-root.vue-Dze91qga.d.cts} +3 -3
  37. package/dist/as-table.cjs +1 -1
  38. package/dist/as-table.d.cts +1 -1
  39. package/dist/as-table.d.mts +1 -1
  40. package/dist/as-table.mjs +1 -1
  41. package/dist/{as-table.vue-Bzp4UOqz.d.cts → as-table.vue-BSKifGzD.d.cts} +4 -4
  42. package/dist/{as-table.vue-Cd1Hc5v9.d.mts → as-table.vue-emq84QmP.d.mts} +4 -4
  43. package/dist/{as-window-table-D5grrLFG.mjs → as-window-table-ByTXS8yA.mjs} +29 -12
  44. package/dist/{as-window-table-OB4B1knU.cjs → as-window-table-DS30wumm.cjs} +29 -12
  45. package/dist/as-window-table.cjs +1 -1
  46. package/dist/as-window-table.d.cts +1 -1
  47. package/dist/as-window-table.d.mts +1 -1
  48. package/dist/as-window-table.mjs +1 -1
  49. package/dist/{as-window-table.vue-CcDoghqs.d.mts → as-window-table.vue-DJNJ-6dd.d.cts} +15 -2
  50. package/dist/{as-window-table.vue-Db--CSWD.d.cts → as-window-table.vue-DUJgZDXy.d.mts} +15 -2
  51. package/dist/index.cjs +5 -5
  52. package/dist/index.d.cts +8 -8
  53. package/dist/index.d.mts +8 -8
  54. package/dist/index.mjs +5 -5
  55. package/dist/{types-n40LWFm_.d.cts → types-CsgAGRfG.d.mts} +8 -3
  56. package/dist/{types-CuOHiH-S.d.mts → types-DvWLY5zQ.d.cts} +8 -3
  57. package/dist/use-table-column-handlers-DGn4ZW9j.mjs +85 -0
  58. package/dist/use-table-column-handlers-r47WDxEh.cjs +96 -0
  59. package/package.json +4 -4
  60. package/dist/use-table-column-handlers-BMrP0WY2.cjs +0 -45
  61. package/dist/use-table-column-handlers-Bx3JERqs.mjs +0 -40
  62. /package/dist/{as-table-status-CbKmSKAy.cjs → as-table-status-B2O3hLGg.cjs} +0 -0
  63. /package/dist/{as-table-status-D9YuoBOm.mjs → as-table-status-aebsG7bR.mjs} +0 -0
@@ -0,0 +1,85 @@
1
+ import { D as ROW_ACTIONS_TYPE, E as ROW_ACTIONS_PATH } from "./use-table-state-CqU1N4Q9.mjs";
2
+ import { computed, watch } from "vue";
3
+ import { reorderColumnNames } from "@atscript/ui-table";
4
+ //#region src/composables/use-row-actions-column.ts
5
+ /**
6
+ * The synthesised row-actions pseudo-column, shared by `<AsTable>` and
7
+ * `<AsWindowTable>`. Returns the renderer's effective column list — the base
8
+ * columns with a fixed `__actions` column prepended / appended per
9
+ * `placement` — and opts the table into per-row `$actions` while the column
10
+ * is shown.
11
+ */
12
+ function useRowActionsColumn(state, opts) {
13
+ watch(() => {
14
+ const placement = opts.placement();
15
+ if (!placement) return false;
16
+ if (placement === "merge-select" && opts.select() !== "none") return false;
17
+ return state.actions.cellRow.length > 0;
18
+ }, (on) => {
19
+ state.includeActions.value = on;
20
+ }, { immediate: true });
21
+ const actionsCol = computed(() => {
22
+ const acts = state.actions.row;
23
+ return {
24
+ path: ROW_ACTIONS_PATH,
25
+ label: "",
26
+ type: ROW_ACTIONS_TYPE,
27
+ sortable: false,
28
+ filterable: false,
29
+ nullable: false,
30
+ order: 0,
31
+ fixed: true,
32
+ width: acts.length === 1 && !acts[0]?.icon ? "8em" : "4em"
33
+ };
34
+ });
35
+ return computed(() => {
36
+ const base = opts.columns();
37
+ const placement = opts.placement();
38
+ if (placement === false || placement === void 0) return base;
39
+ if (state.actions.row.length === 0) return base;
40
+ if (placement === "first") return [actionsCol.value, ...base];
41
+ if (placement === "last") return [...base, actionsCol.value];
42
+ if (opts.select() === "none") return [actionsCol.value, ...base];
43
+ return base;
44
+ });
45
+ }
46
+ //#endregion
47
+ //#region src/composables/use-table-column-handlers.ts
48
+ /**
49
+ * Pure pass-through handlers shared between the pagination renderer
50
+ * (`<AsTable>`) and the window renderer (`<AsWindowTableBase>`). Selection
51
+ * and row-mouse handlers stay in their owning components because their
52
+ * semantics diverge meaningfully (window has no "all" state; standalone
53
+ * vs Reka renderModes need different gating).
54
+ */
55
+ function useTableColumnHandlers(state) {
56
+ return {
57
+ onSort(column, direction) {
58
+ state.sorters.value = direction === null ? [] : [{
59
+ field: column.path,
60
+ direction
61
+ }];
62
+ },
63
+ onHide(column) {
64
+ state.columnNames.value = state.columnNames.value.filter((n) => n !== column.path);
65
+ },
66
+ onFilter(column) {
67
+ state.openFilterDialog(column);
68
+ },
69
+ onFiltersOff(column) {
70
+ state.removeFieldFilter(column.path);
71
+ },
72
+ onResetWidth(column) {
73
+ state.resetColumnWidth(column.path);
74
+ },
75
+ onReorder(fromPath, toPath, position) {
76
+ state.columnNames.value = reorderColumnNames(state.columnNames.value, fromPath, toPath, position);
77
+ },
78
+ onClearFilters() {
79
+ state.resetFilters();
80
+ if (state.searchTerm.value) state.searchTerm.value = "";
81
+ }
82
+ };
83
+ }
84
+ //#endregion
85
+ export { useRowActionsColumn as n, useTableColumnHandlers as t };
@@ -0,0 +1,96 @@
1
+ const require_use_table_state = require("./use-table-state-CoVe_8NI.cjs");
2
+ let vue = require("vue");
3
+ let _atscript_ui_table = require("@atscript/ui-table");
4
+ //#region src/composables/use-row-actions-column.ts
5
+ /**
6
+ * The synthesised row-actions pseudo-column, shared by `<AsTable>` and
7
+ * `<AsWindowTable>`. Returns the renderer's effective column list — the base
8
+ * columns with a fixed `__actions` column prepended / appended per
9
+ * `placement` — and opts the table into per-row `$actions` while the column
10
+ * is shown.
11
+ */
12
+ function useRowActionsColumn(state, opts) {
13
+ (0, vue.watch)(() => {
14
+ const placement = opts.placement();
15
+ if (!placement) return false;
16
+ if (placement === "merge-select" && opts.select() !== "none") return false;
17
+ return state.actions.cellRow.length > 0;
18
+ }, (on) => {
19
+ state.includeActions.value = on;
20
+ }, { immediate: true });
21
+ const actionsCol = (0, vue.computed)(() => {
22
+ const acts = state.actions.row;
23
+ return {
24
+ path: require_use_table_state.ROW_ACTIONS_PATH,
25
+ label: "",
26
+ type: require_use_table_state.ROW_ACTIONS_TYPE,
27
+ sortable: false,
28
+ filterable: false,
29
+ nullable: false,
30
+ order: 0,
31
+ fixed: true,
32
+ width: acts.length === 1 && !acts[0]?.icon ? "8em" : "4em"
33
+ };
34
+ });
35
+ return (0, vue.computed)(() => {
36
+ const base = opts.columns();
37
+ const placement = opts.placement();
38
+ if (placement === false || placement === void 0) return base;
39
+ if (state.actions.row.length === 0) return base;
40
+ if (placement === "first") return [actionsCol.value, ...base];
41
+ if (placement === "last") return [...base, actionsCol.value];
42
+ if (opts.select() === "none") return [actionsCol.value, ...base];
43
+ return base;
44
+ });
45
+ }
46
+ //#endregion
47
+ //#region src/composables/use-table-column-handlers.ts
48
+ /**
49
+ * Pure pass-through handlers shared between the pagination renderer
50
+ * (`<AsTable>`) and the window renderer (`<AsWindowTableBase>`). Selection
51
+ * and row-mouse handlers stay in their owning components because their
52
+ * semantics diverge meaningfully (window has no "all" state; standalone
53
+ * vs Reka renderModes need different gating).
54
+ */
55
+ function useTableColumnHandlers(state) {
56
+ return {
57
+ onSort(column, direction) {
58
+ state.sorters.value = direction === null ? [] : [{
59
+ field: column.path,
60
+ direction
61
+ }];
62
+ },
63
+ onHide(column) {
64
+ state.columnNames.value = state.columnNames.value.filter((n) => n !== column.path);
65
+ },
66
+ onFilter(column) {
67
+ state.openFilterDialog(column);
68
+ },
69
+ onFiltersOff(column) {
70
+ state.removeFieldFilter(column.path);
71
+ },
72
+ onResetWidth(column) {
73
+ state.resetColumnWidth(column.path);
74
+ },
75
+ onReorder(fromPath, toPath, position) {
76
+ state.columnNames.value = (0, _atscript_ui_table.reorderColumnNames)(state.columnNames.value, fromPath, toPath, position);
77
+ },
78
+ onClearFilters() {
79
+ state.resetFilters();
80
+ if (state.searchTerm.value) state.searchTerm.value = "";
81
+ }
82
+ };
83
+ }
84
+ //#endregion
85
+ Object.defineProperty(exports, "useRowActionsColumn", {
86
+ enumerable: true,
87
+ get: function() {
88
+ return useRowActionsColumn;
89
+ }
90
+ });
91
+ Object.defineProperty(exports, "useTableColumnHandlers", {
92
+ enumerable: true,
93
+ get: function() {
94
+ return useTableColumnHandlers;
95
+ }
96
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atscript/vue-table",
3
- "version": "0.1.137",
3
+ "version": "0.1.138",
4
4
  "description": "Type-driven table components for Atscript with Vue 3",
5
5
  "keywords": [
6
6
  "atscript",
@@ -162,9 +162,9 @@
162
162
  "access": "public"
163
163
  },
164
164
  "dependencies": {
165
- "@atscript/ui": "^0.1.137",
166
- "@atscript/ui-table": "^0.1.137",
167
- "@atscript/vue-form": "^0.1.137"
165
+ "@atscript/ui": "^0.1.138",
166
+ "@atscript/ui-table": "^0.1.138",
167
+ "@atscript/vue-form": "^0.1.138"
168
168
  },
169
169
  "devDependencies": {
170
170
  "@atscript/db-client": "^0.1.131",
@@ -1,45 +0,0 @@
1
- let _atscript_ui_table = require("@atscript/ui-table");
2
- //#region src/composables/use-table-column-handlers.ts
3
- /**
4
- * Pure pass-through handlers shared between the pagination renderer
5
- * (`<AsTable>`) and the window renderer (`<AsWindowTableBase>`). Selection
6
- * and row-mouse handlers stay in their owning components because their
7
- * semantics diverge meaningfully (window has no "all" state; standalone
8
- * vs Reka renderModes need different gating).
9
- */
10
- function useTableColumnHandlers(state) {
11
- return {
12
- onSort(column, direction) {
13
- state.sorters.value = direction === null ? [] : [{
14
- field: column.path,
15
- direction
16
- }];
17
- },
18
- onHide(column) {
19
- state.columnNames.value = state.columnNames.value.filter((n) => n !== column.path);
20
- },
21
- onFilter(column) {
22
- state.openFilterDialog(column);
23
- },
24
- onFiltersOff(column) {
25
- state.removeFieldFilter(column.path);
26
- },
27
- onResetWidth(column) {
28
- state.resetColumnWidth(column.path);
29
- },
30
- onReorder(fromPath, toPath, position) {
31
- state.columnNames.value = (0, _atscript_ui_table.reorderColumnNames)(state.columnNames.value, fromPath, toPath, position);
32
- },
33
- onClearFilters() {
34
- state.resetFilters();
35
- if (state.searchTerm.value) state.searchTerm.value = "";
36
- }
37
- };
38
- }
39
- //#endregion
40
- Object.defineProperty(exports, "useTableColumnHandlers", {
41
- enumerable: true,
42
- get: function() {
43
- return useTableColumnHandlers;
44
- }
45
- });
@@ -1,40 +0,0 @@
1
- import { reorderColumnNames } from "@atscript/ui-table";
2
- //#region src/composables/use-table-column-handlers.ts
3
- /**
4
- * Pure pass-through handlers shared between the pagination renderer
5
- * (`<AsTable>`) and the window renderer (`<AsWindowTableBase>`). Selection
6
- * and row-mouse handlers stay in their owning components because their
7
- * semantics diverge meaningfully (window has no "all" state; standalone
8
- * vs Reka renderModes need different gating).
9
- */
10
- function useTableColumnHandlers(state) {
11
- return {
12
- onSort(column, direction) {
13
- state.sorters.value = direction === null ? [] : [{
14
- field: column.path,
15
- direction
16
- }];
17
- },
18
- onHide(column) {
19
- state.columnNames.value = state.columnNames.value.filter((n) => n !== column.path);
20
- },
21
- onFilter(column) {
22
- state.openFilterDialog(column);
23
- },
24
- onFiltersOff(column) {
25
- state.removeFieldFilter(column.path);
26
- },
27
- onResetWidth(column) {
28
- state.resetColumnWidth(column.path);
29
- },
30
- onReorder(fromPath, toPath, position) {
31
- state.columnNames.value = reorderColumnNames(state.columnNames.value, fromPath, toPath, position);
32
- },
33
- onClearFilters() {
34
- state.resetFilters();
35
- if (state.searchTerm.value) state.searchTerm.value = "";
36
- }
37
- };
38
- }
39
- //#endregion
40
- export { useTableColumnHandlers as t };