@atscript/vue-table 0.1.149 → 0.1.151

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 (119) 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-BBwL1YZU.mjs → as-action-menu-content-BubYpIBQ.mjs} +1 -1
  4. package/dist/{as-action-menu-content-DAOjkslC.cjs → as-action-menu-content-DYcj5oBL.cjs} +1 -1
  5. package/dist/as-cell-date-CB5L8NZ-.mjs +85 -0
  6. package/dist/as-cell-date-C_ak4iib.cjs +90 -0
  7. package/dist/as-cell-date.cjs +1 -1
  8. package/dist/as-cell-date.d.cts +1 -1
  9. package/dist/as-cell-date.d.mts +1 -1
  10. package/dist/as-cell-date.mjs +1 -1
  11. package/dist/as-cell-date.vue-DwTSTjsj.d.cts +14 -0
  12. package/dist/as-cell-date.vue-Dyq2-vg9.d.mts +14 -0
  13. package/dist/{as-cell-number-D-mSaE_G.mjs → as-cell-number-CXhVesLq.mjs} +12 -23
  14. package/dist/{as-cell-number-C4JMqvqa.cjs → as-cell-number-vsYD5pyO.cjs} +12 -23
  15. package/dist/as-cell-number.cjs +1 -1
  16. package/dist/as-cell-number.mjs +1 -1
  17. package/dist/{as-config-dialog-ZKMnfirD.mjs → as-config-dialog-DW4WfYEi.mjs} +2 -2
  18. package/dist/{as-config-dialog-CnIvMsK0.cjs → as-config-dialog-XSkaW1X0.cjs} +2 -2
  19. package/dist/as-config-dialog.cjs +1 -1
  20. package/dist/as-config-dialog.mjs +1 -1
  21. package/dist/{as-confirm-dialog-cSEHVFBq.cjs → as-confirm-dialog-pcKkl-Qo.cjs} +1 -1
  22. package/dist/{as-confirm-dialog-DMiGquH1.mjs → as-confirm-dialog-rWRl5z4R.mjs} +1 -1
  23. package/dist/as-confirm-dialog.cjs +1 -1
  24. package/dist/as-confirm-dialog.mjs +1 -1
  25. package/dist/{as-filter-dialog-DNFR30fV.mjs → as-filter-dialog-8xvnKXTd.mjs} +10 -10
  26. package/dist/{as-filter-dialog-KjvJdaMg.cjs → as-filter-dialog-Cd16xRfM.cjs} +10 -10
  27. package/dist/as-filter-dialog.cjs +1 -1
  28. package/dist/as-filter-dialog.mjs +1 -1
  29. package/dist/{as-filter-field-BsucQwbm.cjs → as-filter-field-BPPMOZ9M.cjs} +4 -4
  30. package/dist/{as-filter-field-DE6MJMx7.mjs → as-filter-field-DEBQQy_6.mjs} +4 -4
  31. package/dist/as-filter-field.cjs +1 -1
  32. package/dist/as-filter-field.mjs +1 -1
  33. package/dist/{as-filter-input-ChJ8JE6-.cjs → as-filter-input-DZkhoSWO.cjs} +2 -2
  34. package/dist/{as-filter-input-DmOW_jzK.mjs → as-filter-input-DeI85XVZ.mjs} +2 -2
  35. package/dist/as-filter-input.cjs +1 -1
  36. package/dist/as-filter-input.mjs +1 -1
  37. package/dist/{as-filters-CYC_SXaA.cjs → as-filters-C22XxgEx.cjs} +4 -4
  38. package/dist/{as-filters-DErM2bFq.mjs → as-filters-CT1ks7gu.mjs} +4 -4
  39. package/dist/as-filters.cjs +1 -1
  40. package/dist/as-filters.mjs +1 -1
  41. package/dist/{as-preset-dialog-CY5dPfZa.mjs → as-preset-dialog-BXL8yt8O.mjs} +2 -2
  42. package/dist/{as-preset-dialog-tM-jrQgs.cjs → as-preset-dialog-CFvmrXGP.cjs} +2 -2
  43. package/dist/as-preset-dialog.cjs +1 -1
  44. package/dist/as-preset-dialog.mjs +1 -1
  45. package/dist/{as-preset-picker-CjSXtx83.cjs → as-preset-picker-DjV1c6Kh.cjs} +2 -2
  46. package/dist/{as-preset-picker-DkZ7sinz.mjs → as-preset-picker-IVVvFw6r.mjs} +2 -2
  47. package/dist/as-preset-picker.cjs +1 -1
  48. package/dist/as-preset-picker.mjs +1 -1
  49. package/dist/{as-residual-filter-XkXnMQNu.cjs → as-residual-filter-BGz7pSdL.cjs} +2 -2
  50. package/dist/{as-residual-filter-DHfbtTQj.mjs → as-residual-filter-BoeOL9AJ.mjs} +2 -2
  51. package/dist/as-residual-filter.cjs +1 -1
  52. package/dist/as-residual-filter.mjs +1 -1
  53. package/dist/{as-row-actions-BNQ7jrie.mjs → as-row-actions-QN_UFuah.mjs} +2 -2
  54. package/dist/{as-row-actions-q_oMmUz1.cjs → as-row-actions-S_IVb5c2.cjs} +2 -2
  55. package/dist/as-row-actions.cjs +1 -1
  56. package/dist/as-row-actions.mjs +1 -1
  57. package/dist/{as-select-cell-Dc3lArvR.cjs → as-select-cell-BmLF217C.cjs} +5 -5
  58. package/dist/{as-select-cell-DjcPorVb.mjs → as-select-cell-C9T1NHmN.mjs} +5 -5
  59. package/dist/{as-selection-banner-CxPXBztW.cjs → as-selection-banner-CroHk4lr.cjs} +1 -1
  60. package/dist/{as-selection-banner-Ca9DWVdW.mjs → as-selection-banner-DHzfs4v9.mjs} +1 -1
  61. package/dist/{as-table-BIAkCI4g.cjs → as-table-BIKHGH4x.cjs} +5 -3
  62. package/dist/{as-table-Bcz-WOTS.mjs → as-table-DEjvo36o.mjs} +5 -3
  63. package/dist/{as-table-actions-TaI-NeVv.cjs → as-table-actions-CgMktjjD.cjs} +2 -2
  64. package/dist/{as-table-actions-DPq5SrGa.mjs → as-table-actions-m-QLy2Ys.mjs} +2 -2
  65. package/dist/as-table-actions.cjs +1 -1
  66. package/dist/as-table-actions.mjs +1 -1
  67. package/dist/{as-table-base-CsK79vYe.mjs → as-table-base-C1B_VVk-.mjs} +314 -96
  68. package/dist/{as-table-base-Dvey_Gie.cjs → as-table-base-D_Hmin8J.cjs} +313 -95
  69. package/dist/as-table-cell-value-BYJd-QRA.mjs +57 -0
  70. package/dist/as-table-cell-value-CGBk-KWx.cjs +68 -0
  71. package/dist/as-table-cell-value.cjs +1 -1
  72. package/dist/as-table-cell-value.mjs +1 -1
  73. package/dist/{as-table-header-cell-ahzAeHXj.mjs → as-table-header-cell-Bg5wAPHv.mjs} +1 -1
  74. package/dist/{as-table-header-cell-DB7Cdskr.cjs → as-table-header-cell-Ch0J_Axe.cjs} +1 -1
  75. package/dist/as-table-header-cell.cjs +1 -1
  76. package/dist/as-table-header-cell.mjs +1 -1
  77. package/dist/{as-table-root-Nsk-9XaH.cjs → as-table-root-BQ5PA2SL.cjs} +5 -5
  78. package/dist/{as-table-root-BnkF5-rh.mjs → as-table-root-BeyqcJUq.mjs} +5 -5
  79. package/dist/as-table-root.cjs +1 -1
  80. package/dist/as-table-root.d.cts +1 -1
  81. package/dist/as-table-root.d.mts +1 -1
  82. package/dist/as-table-root.mjs +1 -1
  83. package/dist/{as-table-root.vue-CES8cqKw.d.mts → as-table-root.vue-BY7JFZsf.d.mts} +17 -16
  84. package/dist/{as-table-root.vue-BJMOyB9Q.d.cts → as-table-root.vue-BYgeE3xI.d.cts} +17 -16
  85. package/dist/as-table.cjs +1 -1
  86. package/dist/as-table.d.cts +1 -1
  87. package/dist/as-table.d.mts +1 -1
  88. package/dist/as-table.mjs +1 -1
  89. package/dist/{as-window-table-ubm2u8_i.cjs → as-window-table-BvUfaBj8.cjs} +7 -8
  90. package/dist/{as-window-table-DjplqWzr.mjs → as-window-table-Cf523h8Q.mjs} +7 -8
  91. package/dist/as-window-table.cjs +1 -1
  92. package/dist/as-window-table.d.cts +1 -1
  93. package/dist/as-window-table.d.mts +1 -1
  94. package/dist/as-window-table.mjs +1 -1
  95. package/dist/index.cjs +23 -23
  96. package/dist/index.d.cts +2 -2
  97. package/dist/index.d.mts +2 -2
  98. package/dist/index.mjs +23 -23
  99. package/dist/{use-cell-locale-BTJZ6UcP.mjs → use-cell-locale-Bye0ANIP.mjs} +11 -0
  100. package/dist/{use-cell-locale-Dv514-Al.cjs → use-cell-locale-Dy5Rf1yp.cjs} +11 -0
  101. package/dist/{use-condition-format-DrgfX6xL.cjs → use-condition-format-Dyb5CVYw.cjs} +1 -1
  102. package/dist/{use-condition-format-5LcuInDy.mjs → use-condition-format-ka5_XiSn.mjs} +1 -1
  103. package/dist/{use-table-C9qI-TL6.cjs → use-table-B3CvWW_y.cjs} +2 -2
  104. package/dist/{use-table-BYNBpLJt.mjs → use-table-CTCYFwrE.mjs} +2 -2
  105. package/dist/{use-table-component-Dy397695.mjs → use-table-component-B9QRSvoR.mjs} +1 -1
  106. package/dist/{use-table-component-CsdvdGJT.cjs → use-table-component-Daap95CE.cjs} +1 -1
  107. package/dist/{use-table-nav-bridge-Gm4ZfOjJ.cjs → use-table-nav-bridge-C43u266u.cjs} +1 -1
  108. package/dist/{use-table-nav-bridge-CJBERyPB.mjs → use-table-nav-bridge-Ch61msQs.mjs} +1 -1
  109. package/dist/{use-table-state-CIoWhwTD.mjs → use-table-state-DzvCmxEx.mjs} +2 -1
  110. package/dist/{use-table-state-BQchKxUr.cjs → use-table-state-zE3BpeA7.cjs} +1 -0
  111. package/package.json +11 -11
  112. package/dist/as-cell-date-DrnhvCr4.cjs +0 -71
  113. package/dist/as-cell-date-dhIM7hWA.mjs +0 -66
  114. package/dist/as-cell-date.vue-BcMgxBfm.d.cts +0 -12
  115. package/dist/as-cell-date.vue-Chs7WTZ9.d.mts +0 -12
  116. package/dist/as-table-cell-value-D-S127gr.mjs +0 -37
  117. package/dist/as-table-cell-value-VWlXc5dA.cjs +0 -42
  118. /package/dist/{error-message-CoUcpWal.cjs → error-message-B9iAuWYx.cjs} +0 -0
  119. /package/dist/{error-message-rziSiSjs.mjs → error-message-D3at_GXQ.mjs} +0 -0
@@ -1,4 +1,4 @@
1
- import { o as useTableContextOptional } from "./use-table-state-CIoWhwTD.mjs";
1
+ import { o as useTableContextOptional } from "./use-table-state-DzvCmxEx.mjs";
2
2
  //#region src/composables/use-table-nav-bridge.ts
3
3
  function isPassthroughKey(event) {
4
4
  const key = event.key;
@@ -1,5 +1,5 @@
1
1
  import { t as getCellValue } from "./get-cell-value-Cb3X8nUn.mjs";
2
- import { navigateHrefFor, setByPath } from "@atscript/ui";
2
+ import { invalidateValueHelpCache, navigateHrefFor, setByPath } from "@atscript/ui";
3
3
  import { computed, inject, nextTick, onBeforeUnmount, onScopeDispose, provide, ref, shallowRef, toValue, watch } from "vue";
4
4
  import { DEV, STANDARD_PRESET_ID, arraysEqual, blockStartFor, buildTableQuery, canonicalPresetSnapshot, cellAsString, columnFilterKind, compactFieldFilters, createColumnValueEncoder, debounce, derivePresetAspects, filterExprFields, filterExprKey, fromWireSnapshot, gateOwns, isDirtyAgainst, isFilled, isSystemPresetId, isTemporalKind, mergeDisplayColumns, mergeSorters, normalizeResidualFilters, pageAlignedBlocksFor, planFetch, prunePresetSnapshot, pruneResidualFilters, reconcileColumnWidthDefaults, residualGateOwns, resolveAspectGate, resolveSystemPresets, restoreDroppedEntries, rowsToPks, sameColumnSet, selectionQueryOf, selectionSignature, sortRowsLocally, sortersEqual, stableValueKey, stateToUrlQueryString, togglePk, urlQueryStringToState, walkBackwardAbsorb, walkForwardAbsorb } from "@atscript/ui-table";
5
5
  import { formatIdentifier } from "@atscript/db-client";
@@ -791,6 +791,7 @@ function createActions(opts) {
791
791
  }
792
792
  setLastResult(name, result);
793
793
  setInvoking(name, false);
794
+ if (action.processor !== "custom" && action.processor !== "navigate") invalidateValueHelpCache();
794
795
  if (callOpts?.suppressRefresh !== true && opts.refreshOnAction() !== false && result.ok && (result.kind === "backend" || result.kind === "remove")) opts.scheduleQuery("query");
795
796
  if (result.ok && result.kind === "backend" && result.target) opts.onTargetSettled?.();
796
797
  if (opts.onResolved) opts.onResolved(action, idsForAction(action.level, pk), result, callOpts?.event);
@@ -791,6 +791,7 @@ function createActions(opts) {
791
791
  }
792
792
  setLastResult(name, result);
793
793
  setInvoking(name, false);
794
+ if (action.processor !== "custom" && action.processor !== "navigate") (0, _atscript_ui.invalidateValueHelpCache)();
794
795
  if (callOpts?.suppressRefresh !== true && opts.refreshOnAction() !== false && result.ok && (result.kind === "backend" || result.kind === "remove")) opts.scheduleQuery("query");
795
796
  if (result.ok && result.kind === "backend" && result.target) opts.onTargetSettled?.();
796
797
  if (opts.onResolved) opts.onResolved(action, idsForAction(action.level, pk), result, callOpts?.event);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atscript/vue-table",
3
- "version": "0.1.149",
3
+ "version": "0.1.151",
4
4
  "description": "Type-driven table components for Atscript with Vue 3",
5
5
  "keywords": [
6
6
  "atscript",
@@ -167,17 +167,17 @@
167
167
  "access": "public"
168
168
  },
169
169
  "dependencies": {
170
- "@atscript/ui": "^0.1.149",
171
- "@atscript/ui-table": "^0.1.149",
172
- "@atscript/vue-form": "^0.1.149"
170
+ "@atscript/ui": "^0.1.151",
171
+ "@atscript/ui-table": "^0.1.151",
172
+ "@atscript/vue-form": "^0.1.151"
173
173
  },
174
174
  "devDependencies": {
175
- "@atscript/core": "^0.1.100",
176
- "@atscript/db-client": "^0.1.149",
177
- "@atscript/typescript": "^0.1.100",
175
+ "@atscript/core": "^0.1.102",
176
+ "@atscript/db-client": "^0.1.151",
177
+ "@atscript/typescript": "^0.1.102",
178
178
  "@tanstack/vue-virtual": "^3.13.26",
179
- "@uniqu/core": "^0.1.13",
180
- "@uniqu/url": "^0.1.13",
179
+ "@uniqu/core": "^0.1.14",
180
+ "@uniqu/url": "^0.1.14",
181
181
  "@vitejs/plugin-vue": "^6",
182
182
  "@vue/test-utils": "^2",
183
183
  "@vueuse/core": "^14.3.0",
@@ -190,9 +190,9 @@
190
190
  "vunor": "^0.3.2"
191
191
  },
192
192
  "peerDependencies": {
193
- "@atscript/db-client": "^0.1.149",
193
+ "@atscript/db-client": "^0.1.151",
194
194
  "@tanstack/vue-virtual": "^3.13.26",
195
- "@uniqu/url": "^0.1.13",
195
+ "@uniqu/url": "^0.1.14",
196
196
  "@vueuse/core": "^14.3.0",
197
197
  "reka-ui": "^2.9.8",
198
198
  "vue": "^3"
@@ -1,71 +0,0 @@
1
- const require_get_cell_value = require("./get-cell-value-CJT4fk4y.cjs");
2
- const require_use_cell_locale = require("./use-cell-locale-Dv514-Al.cjs");
3
- let vue = require("vue");
4
- let _atscript_ui_table = require("@atscript/ui-table");
5
- let _vueuse_core = require("@vueuse/core");
6
- //#region src/components/defaults/as-cell-date.vue?vue&type=script&setup=true&lang.ts
7
- const _hoisted_1 = ["title"];
8
- //#endregion
9
- //#region src/components/defaults/as-cell-date.vue
10
- var as_cell_date_default = /* @__PURE__ */ (0, vue.defineComponent)({
11
- __name: "as-cell-date",
12
- props: {
13
- row: {
14
- type: Object,
15
- required: true
16
- },
17
- column: {
18
- type: Object,
19
- required: true
20
- }
21
- },
22
- setup(__props) {
23
- const props = __props;
24
- const { locale, timezone } = require_use_cell_locale.useCellLocale();
25
- const DATE_OPTS = {
26
- year: "numeric",
27
- month: "short",
28
- day: "2-digit"
29
- };
30
- const DATETIME_OPTS = {
31
- ...DATE_OPTS,
32
- hour: "2-digit",
33
- minute: "2-digit"
34
- };
35
- const date = (0, vue.computed)(() => {
36
- const v = require_get_cell_value.getCellValue(props.row, props.column.path);
37
- if (v === null || v === void 0 || v === "") return void 0;
38
- if (v instanceof Date) {
39
- const t = v.getTime();
40
- return Number.isFinite(t) && t !== 0 ? v : void 0;
41
- }
42
- if (typeof v === "number" || typeof v === "string") {
43
- const d = new Date(v);
44
- const t = d.getTime();
45
- return Number.isFinite(t) && t !== 0 ? d : void 0;
46
- }
47
- });
48
- const formatted = (0, vue.computed)(() => {
49
- const d = date.value;
50
- if (!d) return "";
51
- if (props.column.type === "relative") return (0, _vueuse_core.formatTimeAgoIntl)(d, { locale: locale.value });
52
- const tz = timezone.value;
53
- const base = props.column.type === "datetime" ? DATETIME_OPTS : DATE_OPTS;
54
- const opts = tz ? {
55
- ...base,
56
- timeZone: tz
57
- } : base;
58
- return (0, _atscript_ui_table.getDateTimeFormat)(locale.value, opts).format(d);
59
- });
60
- return (_ctx, _cache) => {
61
- return (0, vue.openBlock)(), (0, vue.createElementBlock)("td", { title: date.value?.toISOString() ?? "" }, (0, vue.toDisplayString)(formatted.value), 9, _hoisted_1);
62
- };
63
- }
64
- });
65
- //#endregion
66
- Object.defineProperty(exports, "as_cell_date_default", {
67
- enumerable: true,
68
- get: function() {
69
- return as_cell_date_default;
70
- }
71
- });
@@ -1,66 +0,0 @@
1
- import { t as getCellValue } from "./get-cell-value-Cb3X8nUn.mjs";
2
- import { n as useCellLocale } from "./use-cell-locale-BTJZ6UcP.mjs";
3
- import { computed, createElementBlock, defineComponent, openBlock, toDisplayString } from "vue";
4
- import { getDateTimeFormat } from "@atscript/ui-table";
5
- import { formatTimeAgoIntl } from "@vueuse/core";
6
- //#region src/components/defaults/as-cell-date.vue?vue&type=script&setup=true&lang.ts
7
- const _hoisted_1 = ["title"];
8
- //#endregion
9
- //#region src/components/defaults/as-cell-date.vue
10
- var as_cell_date_default = /* @__PURE__ */ defineComponent({
11
- __name: "as-cell-date",
12
- props: {
13
- row: {
14
- type: Object,
15
- required: true
16
- },
17
- column: {
18
- type: Object,
19
- required: true
20
- }
21
- },
22
- setup(__props) {
23
- const props = __props;
24
- const { locale, timezone } = useCellLocale();
25
- const DATE_OPTS = {
26
- year: "numeric",
27
- month: "short",
28
- day: "2-digit"
29
- };
30
- const DATETIME_OPTS = {
31
- ...DATE_OPTS,
32
- hour: "2-digit",
33
- minute: "2-digit"
34
- };
35
- const date = computed(() => {
36
- const v = getCellValue(props.row, props.column.path);
37
- if (v === null || v === void 0 || v === "") return void 0;
38
- if (v instanceof Date) {
39
- const t = v.getTime();
40
- return Number.isFinite(t) && t !== 0 ? v : void 0;
41
- }
42
- if (typeof v === "number" || typeof v === "string") {
43
- const d = new Date(v);
44
- const t = d.getTime();
45
- return Number.isFinite(t) && t !== 0 ? d : void 0;
46
- }
47
- });
48
- const formatted = computed(() => {
49
- const d = date.value;
50
- if (!d) return "";
51
- if (props.column.type === "relative") return formatTimeAgoIntl(d, { locale: locale.value });
52
- const tz = timezone.value;
53
- const base = props.column.type === "datetime" ? DATETIME_OPTS : DATE_OPTS;
54
- const opts = tz ? {
55
- ...base,
56
- timeZone: tz
57
- } : base;
58
- return getDateTimeFormat(locale.value, opts).format(d);
59
- });
60
- return (_ctx, _cache) => {
61
- return openBlock(), createElementBlock("td", { title: date.value?.toISOString() ?? "" }, toDisplayString(formatted.value), 9, _hoisted_1);
62
- };
63
- }
64
- });
65
- //#endregion
66
- export { as_cell_date_default as t };
@@ -1,12 +0,0 @@
1
- import * as vue from "vue";
2
- import { ColumnDef } from "@atscript/ui";
3
-
4
- //#region src/components/defaults/as-cell-date.vue.d.ts
5
- type __VLS_Props = {
6
- row: Record<string, unknown>;
7
- column: ColumnDef;
8
- };
9
- declare const __VLS_export: vue.DefineComponent<__VLS_Props, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
10
- declare const _default: typeof __VLS_export;
11
- //#endregion
12
- export { _default as t };
@@ -1,12 +0,0 @@
1
- import { ColumnDef } from "@atscript/ui";
2
- import * as vue from "vue";
3
-
4
- //#region src/components/defaults/as-cell-date.vue.d.ts
5
- type __VLS_Props = {
6
- row: Record<string, unknown>;
7
- column: ColumnDef;
8
- };
9
- declare const __VLS_export: vue.DefineComponent<__VLS_Props, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
10
- declare const _default: typeof __VLS_export;
11
- //#endregion
12
- export { _default as t };
@@ -1,37 +0,0 @@
1
- import { t as getCellValue } from "./get-cell-value-Cb3X8nUn.mjs";
2
- import { t as formatCellValue } from "./format-cell-D1Ziv96Q.mjs";
3
- import { createElementBlock, defineComponent, normalizeClass, openBlock, toDisplayString } from "vue";
4
- //#endregion
5
- //#region src/components/defaults/as-table-cell-value.vue
6
- var as_table_cell_value_default = /* @__PURE__ */ defineComponent({
7
- __name: "as-table-cell-value",
8
- props: {
9
- row: {
10
- type: Object,
11
- required: true
12
- },
13
- column: {
14
- type: Object,
15
- required: true
16
- }
17
- },
18
- setup(__props) {
19
- const props = __props;
20
- /** Union columns show the option label (`@ui.literalLabel`); anything else formats by type. */
21
- function display() {
22
- const value = getCellValue(props.row, props.column.path);
23
- const options = props.column.options;
24
- if (options?.length && value !== null && typeof value !== "object") {
25
- const key = String(value);
26
- const hit = options.find((o) => o.key === key);
27
- if (hit) return hit.label;
28
- }
29
- return formatCellValue(value, props.column.type);
30
- }
31
- return (_ctx, _cache) => {
32
- return openBlock(), createElementBlock("td", { class: normalizeClass({ "as-cell-number": props.column.type === "number" }) }, toDisplayString(display()), 3);
33
- };
34
- }
35
- });
36
- //#endregion
37
- export { as_table_cell_value_default as t };
@@ -1,42 +0,0 @@
1
- const require_get_cell_value = require("./get-cell-value-CJT4fk4y.cjs");
2
- const require_format_cell = require("./format-cell-vCNTh4WZ.cjs");
3
- let vue = require("vue");
4
- //#endregion
5
- //#region src/components/defaults/as-table-cell-value.vue
6
- var as_table_cell_value_default = /* @__PURE__ */ (0, vue.defineComponent)({
7
- __name: "as-table-cell-value",
8
- props: {
9
- row: {
10
- type: Object,
11
- required: true
12
- },
13
- column: {
14
- type: Object,
15
- required: true
16
- }
17
- },
18
- setup(__props) {
19
- const props = __props;
20
- /** Union columns show the option label (`@ui.literalLabel`); anything else formats by type. */
21
- function display() {
22
- const value = require_get_cell_value.getCellValue(props.row, props.column.path);
23
- const options = props.column.options;
24
- if (options?.length && value !== null && typeof value !== "object") {
25
- const key = String(value);
26
- const hit = options.find((o) => o.key === key);
27
- if (hit) return hit.label;
28
- }
29
- return require_format_cell.formatCellValue(value, props.column.type);
30
- }
31
- return (_ctx, _cache) => {
32
- return (0, vue.openBlock)(), (0, vue.createElementBlock)("td", { class: (0, vue.normalizeClass)({ "as-cell-number": props.column.type === "number" }) }, (0, vue.toDisplayString)(display()), 3);
33
- };
34
- }
35
- });
36
- //#endregion
37
- Object.defineProperty(exports, "as_table_cell_value_default", {
38
- enumerable: true,
39
- get: function() {
40
- return as_table_cell_value_default;
41
- }
42
- });