@atscript/vue-table 0.1.58
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/LICENSE +21 -0
- package/README.md +24 -0
- package/dist/as-action-form-dialog.cjs +221 -0
- package/dist/as-action-form-dialog.d.cts +6 -0
- package/dist/as-action-form-dialog.d.mts +7 -0
- package/dist/as-action-form-dialog.mjs +221 -0
- package/dist/as-action-menu-content-CXsdPn42.mjs +104 -0
- package/dist/as-action-menu-content-CyUfBrWH.cjs +109 -0
- package/dist/as-cell-array-CXeZzZqt.cjs +69 -0
- package/dist/as-cell-array-DOQKR6t5.mjs +64 -0
- package/dist/as-cell-array.cjs +3 -0
- package/dist/as-cell-array.d.cts +2 -0
- package/dist/as-cell-array.d.mts +2 -0
- package/dist/as-cell-array.mjs +3 -0
- package/dist/as-cell-array.vue-DZGM2VHh.d.mts +12 -0
- package/dist/as-cell-array.vue-pFs5GcCR.d.cts +12 -0
- package/dist/as-cell-date-CTrvxS1h.cjs +78 -0
- package/dist/as-cell-date-Cq49RHmL.mjs +73 -0
- package/dist/as-cell-date.cjs +3 -0
- package/dist/as-cell-date.d.cts +2 -0
- package/dist/as-cell-date.d.mts +2 -0
- package/dist/as-cell-date.mjs +3 -0
- package/dist/as-cell-date.vue-BBSps2B2.d.cts +12 -0
- package/dist/as-cell-date.vue-Zlt4mHWb.d.mts +12 -0
- package/dist/as-cell-json-BynWIs1d.mjs +37 -0
- package/dist/as-cell-json-DvHvQ6IL.cjs +42 -0
- package/dist/as-cell-json-popover-BWdNs1YU.cjs +70 -0
- package/dist/as-cell-json-popover-DUq25I0L.mjs +65 -0
- package/dist/as-cell-json.cjs +3 -0
- package/dist/as-cell-json.d.cts +2 -0
- package/dist/as-cell-json.d.mts +2 -0
- package/dist/as-cell-json.mjs +3 -0
- package/dist/as-cell-json.vue-C6wg4ARZ.d.cts +12 -0
- package/dist/as-cell-json.vue-CESWuCer.d.mts +12 -0
- package/dist/as-cell-number-0_WrSCzu.cjs +76 -0
- package/dist/as-cell-number-Bc1C97Vg.mjs +71 -0
- package/dist/as-cell-number.cjs +3 -0
- package/dist/as-cell-number.d.cts +2 -0
- package/dist/as-cell-number.d.mts +2 -0
- package/dist/as-cell-number.mjs +3 -0
- package/dist/as-cell-number.vue-1Oq7nVI3.d.mts +12 -0
- package/dist/as-cell-number.vue-CJ2K5zeM.d.cts +12 -0
- package/dist/as-cell-union-C1w3B38J.mjs +88 -0
- package/dist/as-cell-union-CFAI0utz.cjs +93 -0
- package/dist/as-cell-union.cjs +4 -0
- package/dist/as-cell-union.d.cts +2 -0
- package/dist/as-cell-union.d.mts +2 -0
- package/dist/as-cell-union.mjs +4 -0
- package/dist/as-cell-union.vue-CslPM_c2.d.cts +12 -0
- package/dist/as-cell-union.vue-NnDmQZOA.d.mts +12 -0
- package/dist/as-column-menu-CH9Htz0Q.cjs +220 -0
- package/dist/as-column-menu-DCfhorMP.mjs +215 -0
- package/dist/as-column-menu.cjs +2 -0
- package/dist/as-column-menu.d.cts +2 -0
- package/dist/as-column-menu.d.mts +2 -0
- package/dist/as-column-menu.mjs +2 -0
- package/dist/as-column-menu.vue-C9e6wJ3z.d.mts +47 -0
- package/dist/as-column-menu.vue-o0qFdzoL.d.cts +47 -0
- package/dist/as-config-dialog-d2k7_l0U.cjs +699 -0
- package/dist/as-config-dialog-vRklaKbi.mjs +688 -0
- package/dist/as-config-dialog.cjs +3 -0
- package/dist/as-config-dialog.d.cts +2 -0
- package/dist/as-config-dialog.d.mts +2 -0
- package/dist/as-config-dialog.mjs +3 -0
- package/dist/as-config-dialog.vue-C6Q62xF5.d.mts +7 -0
- package/dist/as-config-dialog.vue-DvvJi3xx.d.cts +7 -0
- package/dist/as-confirm-dialog-BLh3Ju4-.mjs +52 -0
- package/dist/as-confirm-dialog-BgpIEE2z.cjs +57 -0
- package/dist/as-confirm-dialog.cjs +3 -0
- package/dist/as-confirm-dialog.d.cts +2 -0
- package/dist/as-confirm-dialog.d.mts +2 -0
- package/dist/as-confirm-dialog.mjs +3 -0
- package/dist/as-confirm-dialog.vue-CXxLpzbu.d.cts +7 -0
- package/dist/as-confirm-dialog.vue-pas8jGhv.d.mts +7 -0
- package/dist/as-filter-dialog-C0HMpUPT.mjs +610 -0
- package/dist/as-filter-dialog-DcGvIV3h.cjs +621 -0
- package/dist/as-filter-dialog.cjs +15 -0
- package/dist/as-filter-dialog.d.cts +2 -0
- package/dist/as-filter-dialog.d.mts +2 -0
- package/dist/as-filter-dialog.mjs +15 -0
- package/dist/as-filter-dialog.vue-BV2J8PgZ.d.cts +7 -0
- package/dist/as-filter-dialog.vue-RDZjp4gJ.d.mts +7 -0
- package/dist/as-filter-field-B_tYzvvl.cjs +984 -0
- package/dist/as-filter-field-Bqvu2ASN.mjs +943 -0
- package/dist/as-filter-field.cjs +9 -0
- package/dist/as-filter-field.d.cts +2 -0
- package/dist/as-filter-field.d.mts +2 -0
- package/dist/as-filter-field.mjs +9 -0
- package/dist/as-filter-field.vue-ByQ8xIGq.d.cts +11 -0
- package/dist/as-filter-field.vue-QY8wi5S5.d.mts +11 -0
- package/dist/as-filter-input--nr72iwX.cjs +106 -0
- package/dist/as-filter-input-P1i0CW2-.mjs +101 -0
- package/dist/as-filter-input.cjs +2 -0
- package/dist/as-filter-input.d.cts +2 -0
- package/dist/as-filter-input.d.mts +2 -0
- package/dist/as-filter-input.mjs +2 -0
- package/dist/as-filter-input.vue-CBQ71eNg.d.mts +18 -0
- package/dist/as-filter-input.vue-CS4nOk_Q.d.cts +18 -0
- package/dist/as-filters-Bxa9ZEMm.mjs +44 -0
- package/dist/as-filters-xRT2qv56.cjs +49 -0
- package/dist/as-filters.cjs +10 -0
- package/dist/as-filters.d.cts +2 -0
- package/dist/as-filters.d.mts +2 -0
- package/dist/as-filters.mjs +10 -0
- package/dist/as-filters.vue-BsMgYUcX.d.mts +10 -0
- package/dist/as-filters.vue-fv-tRL2H.d.cts +10 -0
- package/dist/as-preset-dialog-BaTfwMnh.cjs +569 -0
- package/dist/as-preset-dialog-BdDRgwf_.mjs +564 -0
- package/dist/as-preset-dialog.cjs +4 -0
- package/dist/as-preset-dialog.d.cts +2 -0
- package/dist/as-preset-dialog.d.mts +2 -0
- package/dist/as-preset-dialog.mjs +4 -0
- package/dist/as-preset-dialog.vue-Bzv-ON9W.d.mts +7 -0
- package/dist/as-preset-dialog.vue-DP9fy00Y.d.cts +7 -0
- package/dist/as-preset-picker-BQbNEiy9.mjs +427 -0
- package/dist/as-preset-picker-Ce3crTQy.cjs +432 -0
- package/dist/as-preset-picker.cjs +4 -0
- package/dist/as-preset-picker.d.cts +2 -0
- package/dist/as-preset-picker.d.mts +2 -0
- package/dist/as-preset-picker.mjs +4 -0
- package/dist/as-preset-picker.vue-CTBk6leV.d.mts +7 -0
- package/dist/as-preset-picker.vue-DfXS3pGl.d.cts +7 -0
- package/dist/as-row-actions-B6Kob6gt.cjs +120 -0
- package/dist/as-row-actions-CeWBBGqh.mjs +115 -0
- package/dist/as-row-actions.cjs +4 -0
- package/dist/as-row-actions.d.cts +2 -0
- package/dist/as-row-actions.d.mts +2 -0
- package/dist/as-row-actions.mjs +4 -0
- package/dist/as-row-actions.vue-BPaQfGev.d.mts +11 -0
- package/dist/as-row-actions.vue-Bvcc2tUN.d.cts +11 -0
- package/dist/as-table-Cnw2fOqZ.mjs +204 -0
- package/dist/as-table-DlDFxdXI.cjs +209 -0
- package/dist/as-table-actions-BK1Thy2G.cjs +142 -0
- package/dist/as-table-actions-BpMiNFni.mjs +137 -0
- package/dist/as-table-actions.cjs +4 -0
- package/dist/as-table-actions.d.cts +2 -0
- package/dist/as-table-actions.d.mts +2 -0
- package/dist/as-table-actions.mjs +4 -0
- package/dist/as-table-actions.vue-B7Q-JA3z.d.cts +47 -0
- package/dist/as-table-actions.vue-Bs1Jl1ep.d.mts +47 -0
- package/dist/as-table-base-D0k4k7k_.mjs +646 -0
- package/dist/as-table-base-VIz-B_6_.cjs +651 -0
- package/dist/as-table-cell-value-B1CiJYFn.mjs +26 -0
- package/dist/as-table-cell-value-CuxRtFn9.cjs +31 -0
- package/dist/as-table-cell-value.cjs +3 -0
- package/dist/as-table-cell-value.d.cts +2 -0
- package/dist/as-table-cell-value.d.mts +2 -0
- package/dist/as-table-cell-value.mjs +3 -0
- package/dist/as-table-cell-value.vue-BgFDv2JQ.d.cts +12 -0
- package/dist/as-table-cell-value.vue-BuPCQ8YA.d.mts +12 -0
- package/dist/as-table-header-cell-C3zeZUZo.cjs +117 -0
- package/dist/as-table-header-cell-CBn_ioCe.mjs +112 -0
- package/dist/as-table-header-cell.cjs +3 -0
- package/dist/as-table-header-cell.d.cts +2 -0
- package/dist/as-table-header-cell.d.mts +2 -0
- package/dist/as-table-header-cell.mjs +3 -0
- package/dist/as-table-header-cell.vue-Bc_DSsGY.d.cts +31 -0
- package/dist/as-table-header-cell.vue-DNMOHfek.d.mts +31 -0
- package/dist/as-table-root-Br6WcGRo.cjs +263 -0
- package/dist/as-table-root-gG7pTIdD.mjs +258 -0
- package/dist/as-table-root.cjs +28 -0
- package/dist/as-table-root.d.cts +2 -0
- package/dist/as-table-root.d.mts +2 -0
- package/dist/as-table-root.mjs +28 -0
- package/dist/as-table-root.vue-5_OhVwse.d.mts +2258 -0
- package/dist/as-table-root.vue-CSqEtIll.d.cts +2258 -0
- package/dist/as-table-status-BjRGGuhC.mjs +683 -0
- package/dist/as-table-status-DWYoJIMC.cjs +724 -0
- package/dist/as-table.cjs +10 -0
- package/dist/as-table.d.cts +2 -0
- package/dist/as-table.d.mts +2 -0
- package/dist/as-table.mjs +10 -0
- package/dist/as-table.vue-BTYg-e3Z.d.mts +81 -0
- package/dist/as-table.vue-wdRARLIe.d.cts +81 -0
- package/dist/as-window-table-CKIfo3M_.mjs +709 -0
- package/dist/as-window-table-DE7_NyEP.cjs +714 -0
- package/dist/as-window-table.cjs +9 -0
- package/dist/as-window-table.d.cts +2 -0
- package/dist/as-window-table.d.mts +2 -0
- package/dist/as-window-table.mjs +9 -0
- package/dist/as-window-table.vue-Bf8xGC9M.d.mts +86 -0
- package/dist/as-window-table.vue-CA8qsrz4.d.cts +86 -0
- package/dist/format-cell-B2xMDYO9.mjs +27 -0
- package/dist/format-cell-D4mqaN0E.cjs +32 -0
- package/dist/get-cell-value-CZSVfDLg.cjs +19 -0
- package/dist/get-cell-value-DiH84HKL.mjs +14 -0
- package/dist/index.cjs +598 -0
- package/dist/index.d.cts +21 -0
- package/dist/index.d.mts +21 -0
- package/dist/index.mjs +505 -0
- package/dist/preset-aspect-display-BYeiSgcc.mjs +43 -0
- package/dist/preset-aspect-display-y8aal_EF.cjs +72 -0
- package/dist/types-BvvXN72P.d.mts +531 -0
- package/dist/types-CNMmF6W2.d.cts +531 -0
- package/dist/use-cell-locale-1uQaFTLQ.mjs +23 -0
- package/dist/use-cell-locale-B480_QYK.cjs +34 -0
- package/dist/use-table-column-handlers-CGYAY2xH.cjs +65 -0
- package/dist/use-table-column-handlers-t6xi1yCE.mjs +54 -0
- package/dist/use-table-state-C4JbonEZ.mjs +1822 -0
- package/dist/use-table-state-MU-vuzui.cjs +1917 -0
- package/package.json +195 -0
- package/styles.d.ts +2 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { computed, createBlock, createElementBlock, createElementVNode, createVNode, defineComponent, openBlock, ref, renderSlot, toDisplayString, unref, withCtx } from "vue";
|
|
2
|
+
import { PopoverContent, PopoverPortal, PopoverRoot, PopoverTrigger } from "reka-ui";
|
|
3
|
+
//#region src/components/internal/as-cell-json-body.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
const _hoisted_1 = { class: "as-cell-json-pre" };
|
|
5
|
+
//#endregion
|
|
6
|
+
//#region src/components/internal/as-cell-json-body.vue
|
|
7
|
+
var as_cell_json_body_default = /* @__PURE__ */ defineComponent({
|
|
8
|
+
__name: "as-cell-json-body",
|
|
9
|
+
props: { value: {
|
|
10
|
+
type: null,
|
|
11
|
+
required: true
|
|
12
|
+
} },
|
|
13
|
+
setup(__props) {
|
|
14
|
+
const props = __props;
|
|
15
|
+
const pretty = computed(() => {
|
|
16
|
+
const v = props.value;
|
|
17
|
+
if (v === null || v === void 0) return "";
|
|
18
|
+
try {
|
|
19
|
+
return JSON.stringify(v, null, 2);
|
|
20
|
+
} catch {
|
|
21
|
+
return String(v);
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
return (_ctx, _cache) => {
|
|
25
|
+
return openBlock(), createElementBlock("pre", _hoisted_1, [createElementVNode("code", null, toDisplayString(pretty.value), 1)]);
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region src/components/internal/as-cell-json-popover.vue
|
|
31
|
+
var as_cell_json_popover_default = /* @__PURE__ */ defineComponent({
|
|
32
|
+
__name: "as-cell-json-popover",
|
|
33
|
+
props: { value: {
|
|
34
|
+
type: null,
|
|
35
|
+
required: true
|
|
36
|
+
} },
|
|
37
|
+
setup(__props) {
|
|
38
|
+
const open = ref(false);
|
|
39
|
+
return (_ctx, _cache) => {
|
|
40
|
+
return openBlock(), createBlock(unref(PopoverRoot), {
|
|
41
|
+
open: open.value,
|
|
42
|
+
"onUpdate:open": _cache[0] || (_cache[0] = ($event) => open.value = $event)
|
|
43
|
+
}, {
|
|
44
|
+
default: withCtx(() => [createVNode(unref(PopoverTrigger), { "as-child": "" }, {
|
|
45
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "trigger")]),
|
|
46
|
+
_: 3
|
|
47
|
+
}), createVNode(unref(PopoverPortal), null, {
|
|
48
|
+
default: withCtx(() => [createVNode(unref(PopoverContent), {
|
|
49
|
+
class: "as-cell-json-popup",
|
|
50
|
+
align: "start",
|
|
51
|
+
"side-offset": 4,
|
|
52
|
+
"collision-padding": 8
|
|
53
|
+
}, {
|
|
54
|
+
default: withCtx(() => [createVNode(as_cell_json_body_default, { value: __props.value }, null, 8, ["value"])]),
|
|
55
|
+
_: 1
|
|
56
|
+
})]),
|
|
57
|
+
_: 1
|
|
58
|
+
})]),
|
|
59
|
+
_: 3
|
|
60
|
+
}, 8, ["open"]);
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
//#endregion
|
|
65
|
+
export { as_cell_json_popover_default as t };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as vue from "vue";
|
|
2
|
+
import { ColumnDef } from "@atscript/ui";
|
|
3
|
+
|
|
4
|
+
//#region src/components/defaults/as-cell-json.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 };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ColumnDef } from "@atscript/ui";
|
|
2
|
+
import * as vue from "vue";
|
|
3
|
+
|
|
4
|
+
//#region src/components/defaults/as-cell-json.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 };
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
const require_get_cell_value = require("./get-cell-value-CZSVfDLg.cjs");
|
|
2
|
+
const require_use_cell_locale = require("./use-cell-locale-B480_QYK.cjs");
|
|
3
|
+
let _atscript_ui = require("@atscript/ui");
|
|
4
|
+
let vue = require("vue");
|
|
5
|
+
//#region src/components/defaults/as-cell-number.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
+
const _hoisted_1 = { class: "as-cell-number as-cell-decimal" };
|
|
7
|
+
//#endregion
|
|
8
|
+
//#region src/components/defaults/as-cell-number.vue
|
|
9
|
+
var as_cell_number_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
10
|
+
__name: "as-cell-number",
|
|
11
|
+
props: {
|
|
12
|
+
row: {
|
|
13
|
+
type: Object,
|
|
14
|
+
required: true
|
|
15
|
+
},
|
|
16
|
+
column: {
|
|
17
|
+
type: Object,
|
|
18
|
+
required: true
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
setup(__props) {
|
|
22
|
+
const props = __props;
|
|
23
|
+
const { locale } = require_use_cell_locale.useCellLocale();
|
|
24
|
+
const value = (0, vue.computed)(() => require_get_cell_value.getCellValue(props.row, props.column.path));
|
|
25
|
+
const currency = (0, vue.computed)(() => {
|
|
26
|
+
const c = props.column.currencyCode;
|
|
27
|
+
if (c) return c;
|
|
28
|
+
const ref = props.column.currencyRefField;
|
|
29
|
+
if (ref) {
|
|
30
|
+
const v = props.row[ref];
|
|
31
|
+
if (typeof v === "string" && v.length > 0) return v;
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
const unit = (0, vue.computed)(() => {
|
|
35
|
+
const u = props.column.unitCode;
|
|
36
|
+
if (u) return u;
|
|
37
|
+
const ref = props.column.unitRefField;
|
|
38
|
+
if (ref) {
|
|
39
|
+
const v = props.row[ref];
|
|
40
|
+
if (typeof v === "string" && v.length > 0) return v;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
const formatted = (0, vue.computed)(() => {
|
|
44
|
+
const v = value.value;
|
|
45
|
+
if (v === null || v === void 0 || v === "") return "";
|
|
46
|
+
const cur = currency.value;
|
|
47
|
+
if (cur) {
|
|
48
|
+
const out = (0, _atscript_ui.formatDecimalForDisplay)({
|
|
49
|
+
value: v,
|
|
50
|
+
locale: locale.value,
|
|
51
|
+
currency: cur
|
|
52
|
+
});
|
|
53
|
+
if (out !== "") return out;
|
|
54
|
+
return typeof v === "string" ? v : String(v);
|
|
55
|
+
}
|
|
56
|
+
const out = (0, _atscript_ui.formatDecimalForDisplay)({
|
|
57
|
+
value: v,
|
|
58
|
+
scale: props.column.precisionScale,
|
|
59
|
+
locale: locale.value,
|
|
60
|
+
unit: unit.value
|
|
61
|
+
});
|
|
62
|
+
if (out !== "") return out;
|
|
63
|
+
return typeof v === "string" ? v : String(v);
|
|
64
|
+
});
|
|
65
|
+
return (_ctx, _cache) => {
|
|
66
|
+
return (0, vue.openBlock)(), (0, vue.createElementBlock)("td", _hoisted_1, (0, vue.toDisplayString)(formatted.value), 1);
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
//#endregion
|
|
71
|
+
Object.defineProperty(exports, "as_cell_number_default", {
|
|
72
|
+
enumerable: true,
|
|
73
|
+
get: function() {
|
|
74
|
+
return as_cell_number_default;
|
|
75
|
+
}
|
|
76
|
+
});
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { t as getCellValue } from "./get-cell-value-DiH84HKL.mjs";
|
|
2
|
+
import { n as useCellLocale } from "./use-cell-locale-1uQaFTLQ.mjs";
|
|
3
|
+
import { formatDecimalForDisplay } from "@atscript/ui";
|
|
4
|
+
import { computed, createElementBlock, defineComponent, openBlock, toDisplayString } from "vue";
|
|
5
|
+
//#region src/components/defaults/as-cell-number.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
+
const _hoisted_1 = { class: "as-cell-number as-cell-decimal" };
|
|
7
|
+
//#endregion
|
|
8
|
+
//#region src/components/defaults/as-cell-number.vue
|
|
9
|
+
var as_cell_number_default = /* @__PURE__ */ defineComponent({
|
|
10
|
+
__name: "as-cell-number",
|
|
11
|
+
props: {
|
|
12
|
+
row: {
|
|
13
|
+
type: Object,
|
|
14
|
+
required: true
|
|
15
|
+
},
|
|
16
|
+
column: {
|
|
17
|
+
type: Object,
|
|
18
|
+
required: true
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
setup(__props) {
|
|
22
|
+
const props = __props;
|
|
23
|
+
const { locale } = useCellLocale();
|
|
24
|
+
const value = computed(() => getCellValue(props.row, props.column.path));
|
|
25
|
+
const currency = computed(() => {
|
|
26
|
+
const c = props.column.currencyCode;
|
|
27
|
+
if (c) return c;
|
|
28
|
+
const ref = props.column.currencyRefField;
|
|
29
|
+
if (ref) {
|
|
30
|
+
const v = props.row[ref];
|
|
31
|
+
if (typeof v === "string" && v.length > 0) return v;
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
const unit = computed(() => {
|
|
35
|
+
const u = props.column.unitCode;
|
|
36
|
+
if (u) return u;
|
|
37
|
+
const ref = props.column.unitRefField;
|
|
38
|
+
if (ref) {
|
|
39
|
+
const v = props.row[ref];
|
|
40
|
+
if (typeof v === "string" && v.length > 0) return v;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
const formatted = computed(() => {
|
|
44
|
+
const v = value.value;
|
|
45
|
+
if (v === null || v === void 0 || v === "") return "";
|
|
46
|
+
const cur = currency.value;
|
|
47
|
+
if (cur) {
|
|
48
|
+
const out = formatDecimalForDisplay({
|
|
49
|
+
value: v,
|
|
50
|
+
locale: locale.value,
|
|
51
|
+
currency: cur
|
|
52
|
+
});
|
|
53
|
+
if (out !== "") return out;
|
|
54
|
+
return typeof v === "string" ? v : String(v);
|
|
55
|
+
}
|
|
56
|
+
const out = formatDecimalForDisplay({
|
|
57
|
+
value: v,
|
|
58
|
+
scale: props.column.precisionScale,
|
|
59
|
+
locale: locale.value,
|
|
60
|
+
unit: unit.value
|
|
61
|
+
});
|
|
62
|
+
if (out !== "") return out;
|
|
63
|
+
return typeof v === "string" ? v : String(v);
|
|
64
|
+
});
|
|
65
|
+
return (_ctx, _cache) => {
|
|
66
|
+
return openBlock(), createElementBlock("td", _hoisted_1, toDisplayString(formatted.value), 1);
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
//#endregion
|
|
71
|
+
export { as_cell_number_default as t };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ColumnDef } from "@atscript/ui";
|
|
2
|
+
import * as vue from "vue";
|
|
3
|
+
|
|
4
|
+
//#region src/components/defaults/as-cell-number.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 };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as vue from "vue";
|
|
2
|
+
import { ColumnDef } from "@atscript/ui";
|
|
3
|
+
|
|
4
|
+
//#region src/components/defaults/as-cell-number.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 };
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { t as getCellValue } from "./get-cell-value-DiH84HKL.mjs";
|
|
2
|
+
import { t as as_cell_json_popover_default } from "./as-cell-json-popover-DUq25I0L.mjs";
|
|
3
|
+
import { t as formatCellValue } from "./format-cell-B2xMDYO9.mjs";
|
|
4
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, defineComponent, openBlock, renderList, toDisplayString, unref, withCtx } from "vue";
|
|
5
|
+
//#region src/components/defaults/as-cell-union.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
+
const _hoisted_1 = {
|
|
7
|
+
key: 0,
|
|
8
|
+
class: "as-cell-chips"
|
|
9
|
+
};
|
|
10
|
+
const _hoisted_2 = ["aria-label"];
|
|
11
|
+
const _hoisted_3 = { class: "as-cell-json-trigger-count" };
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region src/components/defaults/as-cell-union.vue
|
|
14
|
+
var as_cell_union_default = /* @__PURE__ */ defineComponent({
|
|
15
|
+
__name: "as-cell-union",
|
|
16
|
+
props: {
|
|
17
|
+
row: {
|
|
18
|
+
type: Object,
|
|
19
|
+
required: true
|
|
20
|
+
},
|
|
21
|
+
column: {
|
|
22
|
+
type: Object,
|
|
23
|
+
required: true
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
setup(__props) {
|
|
27
|
+
const props = __props;
|
|
28
|
+
const view = computed(() => {
|
|
29
|
+
const v = getCellValue(props.row, props.column.path);
|
|
30
|
+
if (Array.isArray(v)) {
|
|
31
|
+
if (v.length === 0) return { kind: "array-empty" };
|
|
32
|
+
let primitive = true;
|
|
33
|
+
for (const el of v) {
|
|
34
|
+
const t = typeof el;
|
|
35
|
+
if (t !== "string" && t !== "number" && t !== "boolean") {
|
|
36
|
+
primitive = false;
|
|
37
|
+
break;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return primitive ? {
|
|
41
|
+
kind: "array-chips",
|
|
42
|
+
items: v
|
|
43
|
+
} : {
|
|
44
|
+
kind: "array-json",
|
|
45
|
+
items: v
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
if (v && typeof v === "object") return {
|
|
49
|
+
kind: "object",
|
|
50
|
+
value: v
|
|
51
|
+
};
|
|
52
|
+
return {
|
|
53
|
+
kind: "primitive",
|
|
54
|
+
value: v
|
|
55
|
+
};
|
|
56
|
+
});
|
|
57
|
+
return (_ctx, _cache) => {
|
|
58
|
+
return openBlock(), createElementBlock("td", null, [view.value.kind === "array-chips" ? (openBlock(), createElementBlock("span", _hoisted_1, [(openBlock(true), createElementBlock(Fragment, null, renderList(view.value.items, (item, i) => {
|
|
59
|
+
return openBlock(), createElementBlock("span", {
|
|
60
|
+
key: i,
|
|
61
|
+
class: "as-cell-chip"
|
|
62
|
+
}, toDisplayString(item), 1);
|
|
63
|
+
}), 128))])) : view.value.kind === "array-json" ? (openBlock(), createBlock(as_cell_json_popover_default, {
|
|
64
|
+
key: 1,
|
|
65
|
+
value: view.value.items
|
|
66
|
+
}, {
|
|
67
|
+
trigger: withCtx(() => [createElementVNode("button", {
|
|
68
|
+
type: "button",
|
|
69
|
+
class: "as-cell-json-trigger",
|
|
70
|
+
"aria-label": `View ${view.value.items.length} items`
|
|
71
|
+
}, [_cache[0] || (_cache[0] = createElementVNode("span", { class: "as-cell-json-trigger-glyph" }, "{}", -1)), createElementVNode("span", _hoisted_3, "[" + toDisplayString(view.value.items.length) + "]", 1)], 8, _hoisted_2)]),
|
|
72
|
+
_: 1
|
|
73
|
+
}, 8, ["value"])) : view.value.kind === "object" ? (openBlock(), createBlock(as_cell_json_popover_default, {
|
|
74
|
+
key: 2,
|
|
75
|
+
value: view.value.value
|
|
76
|
+
}, {
|
|
77
|
+
trigger: withCtx(() => [..._cache[1] || (_cache[1] = [createElementVNode("button", {
|
|
78
|
+
type: "button",
|
|
79
|
+
class: "as-cell-json-trigger",
|
|
80
|
+
"aria-label": "View object"
|
|
81
|
+
}, [createElementVNode("span", { class: "as-cell-json-trigger-glyph" }, "{}")], -1)])]),
|
|
82
|
+
_: 1
|
|
83
|
+
}, 8, ["value"])) : view.value.kind === "primitive" ? (openBlock(), createElementBlock(Fragment, { key: 3 }, [createTextVNode(toDisplayString(unref(formatCellValue)(view.value.value, props.column.type)), 1)], 64)) : createCommentVNode("v-if", true)]);
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
//#endregion
|
|
88
|
+
export { as_cell_union_default as t };
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
const require_get_cell_value = require("./get-cell-value-CZSVfDLg.cjs");
|
|
2
|
+
const require_as_cell_json_popover = require("./as-cell-json-popover-BWdNs1YU.cjs");
|
|
3
|
+
const require_format_cell = require("./format-cell-D4mqaN0E.cjs");
|
|
4
|
+
let vue = require("vue");
|
|
5
|
+
//#region src/components/defaults/as-cell-union.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
+
const _hoisted_1 = {
|
|
7
|
+
key: 0,
|
|
8
|
+
class: "as-cell-chips"
|
|
9
|
+
};
|
|
10
|
+
const _hoisted_2 = ["aria-label"];
|
|
11
|
+
const _hoisted_3 = { class: "as-cell-json-trigger-count" };
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region src/components/defaults/as-cell-union.vue
|
|
14
|
+
var as_cell_union_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
15
|
+
__name: "as-cell-union",
|
|
16
|
+
props: {
|
|
17
|
+
row: {
|
|
18
|
+
type: Object,
|
|
19
|
+
required: true
|
|
20
|
+
},
|
|
21
|
+
column: {
|
|
22
|
+
type: Object,
|
|
23
|
+
required: true
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
setup(__props) {
|
|
27
|
+
const props = __props;
|
|
28
|
+
const view = (0, vue.computed)(() => {
|
|
29
|
+
const v = require_get_cell_value.getCellValue(props.row, props.column.path);
|
|
30
|
+
if (Array.isArray(v)) {
|
|
31
|
+
if (v.length === 0) return { kind: "array-empty" };
|
|
32
|
+
let primitive = true;
|
|
33
|
+
for (const el of v) {
|
|
34
|
+
const t = typeof el;
|
|
35
|
+
if (t !== "string" && t !== "number" && t !== "boolean") {
|
|
36
|
+
primitive = false;
|
|
37
|
+
break;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return primitive ? {
|
|
41
|
+
kind: "array-chips",
|
|
42
|
+
items: v
|
|
43
|
+
} : {
|
|
44
|
+
kind: "array-json",
|
|
45
|
+
items: v
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
if (v && typeof v === "object") return {
|
|
49
|
+
kind: "object",
|
|
50
|
+
value: v
|
|
51
|
+
};
|
|
52
|
+
return {
|
|
53
|
+
kind: "primitive",
|
|
54
|
+
value: v
|
|
55
|
+
};
|
|
56
|
+
});
|
|
57
|
+
return (_ctx, _cache) => {
|
|
58
|
+
return (0, vue.openBlock)(), (0, vue.createElementBlock)("td", null, [view.value.kind === "array-chips" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_1, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(view.value.items, (item, i) => {
|
|
59
|
+
return (0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
|
|
60
|
+
key: i,
|
|
61
|
+
class: "as-cell-chip"
|
|
62
|
+
}, (0, vue.toDisplayString)(item), 1);
|
|
63
|
+
}), 128))])) : view.value.kind === "array-json" ? ((0, vue.openBlock)(), (0, vue.createBlock)(require_as_cell_json_popover.as_cell_json_popover_default, {
|
|
64
|
+
key: 1,
|
|
65
|
+
value: view.value.items
|
|
66
|
+
}, {
|
|
67
|
+
trigger: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("button", {
|
|
68
|
+
type: "button",
|
|
69
|
+
class: "as-cell-json-trigger",
|
|
70
|
+
"aria-label": `View ${view.value.items.length} items`
|
|
71
|
+
}, [_cache[0] || (_cache[0] = (0, vue.createElementVNode)("span", { class: "as-cell-json-trigger-glyph" }, "{}", -1)), (0, vue.createElementVNode)("span", _hoisted_3, "[" + (0, vue.toDisplayString)(view.value.items.length) + "]", 1)], 8, _hoisted_2)]),
|
|
72
|
+
_: 1
|
|
73
|
+
}, 8, ["value"])) : view.value.kind === "object" ? ((0, vue.openBlock)(), (0, vue.createBlock)(require_as_cell_json_popover.as_cell_json_popover_default, {
|
|
74
|
+
key: 2,
|
|
75
|
+
value: view.value.value
|
|
76
|
+
}, {
|
|
77
|
+
trigger: (0, vue.withCtx)(() => [..._cache[1] || (_cache[1] = [(0, vue.createElementVNode)("button", {
|
|
78
|
+
type: "button",
|
|
79
|
+
class: "as-cell-json-trigger",
|
|
80
|
+
"aria-label": "View object"
|
|
81
|
+
}, [(0, vue.createElementVNode)("span", { class: "as-cell-json-trigger-glyph" }, "{}")], -1)])]),
|
|
82
|
+
_: 1
|
|
83
|
+
}, 8, ["value"])) : view.value.kind === "primitive" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 3 }, [(0, vue.createTextVNode)((0, vue.toDisplayString)((0, vue.unref)(require_format_cell.formatCellValue)(view.value.value, props.column.type)), 1)], 64)) : (0, vue.createCommentVNode)("v-if", true)]);
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
//#endregion
|
|
88
|
+
Object.defineProperty(exports, "as_cell_union_default", {
|
|
89
|
+
enumerable: true,
|
|
90
|
+
get: function() {
|
|
91
|
+
return as_cell_union_default;
|
|
92
|
+
}
|
|
93
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as vue from "vue";
|
|
2
|
+
import { ColumnDef } from "@atscript/ui";
|
|
3
|
+
|
|
4
|
+
//#region src/components/defaults/as-cell-union.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 };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ColumnDef } from "@atscript/ui";
|
|
2
|
+
import * as vue from "vue";
|
|
3
|
+
|
|
4
|
+
//#region src/components/defaults/as-cell-union.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 };
|