@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,9 @@
|
|
|
1
|
+
require("./use-table-state-MU-vuzui.cjs");
|
|
2
|
+
require("./as-table-status-DWYoJIMC.cjs");
|
|
3
|
+
require("./use-table-column-handlers-CGYAY2xH.cjs");
|
|
4
|
+
require("./format-cell-D4mqaN0E.cjs");
|
|
5
|
+
require("./as-column-menu-CH9Htz0Q.cjs");
|
|
6
|
+
require("./as-table-cell-value-CuxRtFn9.cjs");
|
|
7
|
+
require("./as-table-header-cell-C3zeZUZo.cjs");
|
|
8
|
+
const require_as_window_table = require("./as-window-table-DE7_NyEP.cjs");
|
|
9
|
+
module.exports = require_as_window_table.as_window_table_default;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import "./use-table-state-C4JbonEZ.mjs";
|
|
2
|
+
import "./as-table-status-BjRGGuhC.mjs";
|
|
3
|
+
import "./use-table-column-handlers-t6xi1yCE.mjs";
|
|
4
|
+
import "./format-cell-B2xMDYO9.mjs";
|
|
5
|
+
import "./as-column-menu-DCfhorMP.mjs";
|
|
6
|
+
import "./as-table-cell-value-B1CiJYFn.mjs";
|
|
7
|
+
import "./as-table-header-cell-CBn_ioCe.mjs";
|
|
8
|
+
import { t as as_window_table_default } from "./as-window-table-CKIfo3M_.mjs";
|
|
9
|
+
export { as_window_table_default as default };
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { a as EnterAction, f as RowDeleteOpt, n as ColumnMenuConfig, u as QueryErrorKind } from "./types-BvvXN72P.mjs";
|
|
2
|
+
import * as vue from "vue";
|
|
3
|
+
import { SelectionMode } from "@atscript/ui-table";
|
|
4
|
+
|
|
5
|
+
//#region src/components/as-window-table.vue.d.ts
|
|
6
|
+
type Row = Record<string, unknown>;
|
|
7
|
+
type __VLS_Props = {
|
|
8
|
+
/** Pixel height of one row. Defaults to `DEFAULT_ROW_HEIGHT_PX`. */rowHeight?: number; /** Number of rows the viewport advances per wheel-tick. */
|
|
9
|
+
wheelRowsPerTick?: number;
|
|
10
|
+
/**
|
|
11
|
+
* Selection mode — rendering concern owned by the renderer. `"multi"`
|
|
12
|
+
* shows a leading checkbox column and turns row clicks into selection
|
|
13
|
+
* toggles; `"none"` (default) hides the column and routes clicks
|
|
14
|
+
* through the main-action path. Independent of `state.selectedRows` —
|
|
15
|
+
* flipping `select` to `"none"` hides the checkbox UI but leaves the
|
|
16
|
+
* user's selected pks in place, surviving a future re-enable.
|
|
17
|
+
*/
|
|
18
|
+
select?: SelectionMode;
|
|
19
|
+
/**
|
|
20
|
+
* Force exactly N rows tall. Equivalent to setting both `min-rows` and
|
|
21
|
+
* `max-rows` to N — overrides both when set. The table reserves N rows
|
|
22
|
+
* worth of height even when empty.
|
|
23
|
+
*/
|
|
24
|
+
rows?: number;
|
|
25
|
+
/**
|
|
26
|
+
* Minimum row count. The table is at least this tall even when empty
|
|
27
|
+
* or when fewer rows would fit the available area.
|
|
28
|
+
*/
|
|
29
|
+
minRows?: number;
|
|
30
|
+
/**
|
|
31
|
+
* Maximum row count. The table caps at this many rows tall even if the
|
|
32
|
+
* available area would fit more. Useful for value-help dialogs.
|
|
33
|
+
*/
|
|
34
|
+
maxRows?: number;
|
|
35
|
+
columnMenu?: ColumnMenuConfig; /** Allow header drag-and-drop column reorder. Default true. */
|
|
36
|
+
reorderable?: boolean; /** Allow header drag-resize. Default true. */
|
|
37
|
+
resizable?: boolean; /** Pixel floor for the resize clamp. Default 48. */
|
|
38
|
+
columnMinWidth?: number;
|
|
39
|
+
/**
|
|
40
|
+
* Override Enter-key semantics. Default `"main-action"`. Pass
|
|
41
|
+
* `"toggle-select"` to make Enter mirror Space (pick/unpick the active
|
|
42
|
+
* row) — used by value-help dialog tables where Enter shouldn't fire a
|
|
43
|
+
* main action.
|
|
44
|
+
*/
|
|
45
|
+
enterAction?: EnterAction;
|
|
46
|
+
/**
|
|
47
|
+
* Built-in row-delete: `false` (off, default), `true` (on with defaults),
|
|
48
|
+
* or a `RowDeleteOpt` overriding label/icon/intent/promptText. The
|
|
49
|
+
* synthesised `__remove` action only appears when the consumer opts in
|
|
50
|
+
* AND `tableDef.canRemove === true`. Pushed into `state.rowDelete` via
|
|
51
|
+
* a watcher — the action set live-updates as the prop flips.
|
|
52
|
+
*/
|
|
53
|
+
rowDelete?: boolean | RowDeleteOpt;
|
|
54
|
+
};
|
|
55
|
+
declare var __VLS_13: string, __VLS_14: any, __VLS_16: {};
|
|
56
|
+
type __VLS_Slots = {} & { [K in NonNullable<typeof __VLS_13>]?: (props: typeof __VLS_14) => any } & {
|
|
57
|
+
'query-loading'?: (props: typeof __VLS_16) => any;
|
|
58
|
+
};
|
|
59
|
+
declare const __VLS_base: vue.DefineComponent<__VLS_Props, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
|
|
60
|
+
"main-action": (row: Row, absIndex: number, event: KeyboardEvent | MouseEvent) => any;
|
|
61
|
+
"row-click": (row: Row, event: MouseEvent) => any;
|
|
62
|
+
"row-dblclick": (row: Row, event: MouseEvent) => any;
|
|
63
|
+
error: (error: Error, kind: QueryErrorKind) => any;
|
|
64
|
+
}, string, vue.PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
65
|
+
"onMain-action"?: ((row: Row, absIndex: number, event: KeyboardEvent | MouseEvent) => any) | undefined;
|
|
66
|
+
"onRow-click"?: ((row: Row, event: MouseEvent) => any) | undefined;
|
|
67
|
+
"onRow-dblclick"?: ((row: Row, event: MouseEvent) => any) | undefined;
|
|
68
|
+
onError?: ((error: Error, kind: QueryErrorKind) => any) | undefined;
|
|
69
|
+
}>, {
|
|
70
|
+
select: SelectionMode;
|
|
71
|
+
rowHeight: number;
|
|
72
|
+
wheelRowsPerTick: number;
|
|
73
|
+
reorderable: boolean;
|
|
74
|
+
resizable: boolean;
|
|
75
|
+
columnMinWidth: number;
|
|
76
|
+
rowDelete: boolean | RowDeleteOpt;
|
|
77
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
78
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
79
|
+
declare const _default: typeof __VLS_export;
|
|
80
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
81
|
+
new (): {
|
|
82
|
+
$slots: S;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
//#endregion
|
|
86
|
+
export { _default as t };
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { a as EnterAction, f as RowDeleteOpt, n as ColumnMenuConfig, u as QueryErrorKind } from "./types-CNMmF6W2.cjs";
|
|
2
|
+
import * as vue from "vue";
|
|
3
|
+
import { SelectionMode } from "@atscript/ui-table";
|
|
4
|
+
|
|
5
|
+
//#region src/components/as-window-table.vue.d.ts
|
|
6
|
+
type Row = Record<string, unknown>;
|
|
7
|
+
type __VLS_Props = {
|
|
8
|
+
/** Pixel height of one row. Defaults to `DEFAULT_ROW_HEIGHT_PX`. */rowHeight?: number; /** Number of rows the viewport advances per wheel-tick. */
|
|
9
|
+
wheelRowsPerTick?: number;
|
|
10
|
+
/**
|
|
11
|
+
* Selection mode — rendering concern owned by the renderer. `"multi"`
|
|
12
|
+
* shows a leading checkbox column and turns row clicks into selection
|
|
13
|
+
* toggles; `"none"` (default) hides the column and routes clicks
|
|
14
|
+
* through the main-action path. Independent of `state.selectedRows` —
|
|
15
|
+
* flipping `select` to `"none"` hides the checkbox UI but leaves the
|
|
16
|
+
* user's selected pks in place, surviving a future re-enable.
|
|
17
|
+
*/
|
|
18
|
+
select?: SelectionMode;
|
|
19
|
+
/**
|
|
20
|
+
* Force exactly N rows tall. Equivalent to setting both `min-rows` and
|
|
21
|
+
* `max-rows` to N — overrides both when set. The table reserves N rows
|
|
22
|
+
* worth of height even when empty.
|
|
23
|
+
*/
|
|
24
|
+
rows?: number;
|
|
25
|
+
/**
|
|
26
|
+
* Minimum row count. The table is at least this tall even when empty
|
|
27
|
+
* or when fewer rows would fit the available area.
|
|
28
|
+
*/
|
|
29
|
+
minRows?: number;
|
|
30
|
+
/**
|
|
31
|
+
* Maximum row count. The table caps at this many rows tall even if the
|
|
32
|
+
* available area would fit more. Useful for value-help dialogs.
|
|
33
|
+
*/
|
|
34
|
+
maxRows?: number;
|
|
35
|
+
columnMenu?: ColumnMenuConfig; /** Allow header drag-and-drop column reorder. Default true. */
|
|
36
|
+
reorderable?: boolean; /** Allow header drag-resize. Default true. */
|
|
37
|
+
resizable?: boolean; /** Pixel floor for the resize clamp. Default 48. */
|
|
38
|
+
columnMinWidth?: number;
|
|
39
|
+
/**
|
|
40
|
+
* Override Enter-key semantics. Default `"main-action"`. Pass
|
|
41
|
+
* `"toggle-select"` to make Enter mirror Space (pick/unpick the active
|
|
42
|
+
* row) — used by value-help dialog tables where Enter shouldn't fire a
|
|
43
|
+
* main action.
|
|
44
|
+
*/
|
|
45
|
+
enterAction?: EnterAction;
|
|
46
|
+
/**
|
|
47
|
+
* Built-in row-delete: `false` (off, default), `true` (on with defaults),
|
|
48
|
+
* or a `RowDeleteOpt` overriding label/icon/intent/promptText. The
|
|
49
|
+
* synthesised `__remove` action only appears when the consumer opts in
|
|
50
|
+
* AND `tableDef.canRemove === true`. Pushed into `state.rowDelete` via
|
|
51
|
+
* a watcher — the action set live-updates as the prop flips.
|
|
52
|
+
*/
|
|
53
|
+
rowDelete?: boolean | RowDeleteOpt;
|
|
54
|
+
};
|
|
55
|
+
declare var __VLS_13: string, __VLS_14: any, __VLS_16: {};
|
|
56
|
+
type __VLS_Slots = {} & { [K in NonNullable<typeof __VLS_13>]?: (props: typeof __VLS_14) => any } & {
|
|
57
|
+
'query-loading'?: (props: typeof __VLS_16) => any;
|
|
58
|
+
};
|
|
59
|
+
declare const __VLS_base: vue.DefineComponent<__VLS_Props, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
|
|
60
|
+
"main-action": (row: Row, absIndex: number, event: KeyboardEvent | MouseEvent) => any;
|
|
61
|
+
"row-click": (row: Row, event: MouseEvent) => any;
|
|
62
|
+
"row-dblclick": (row: Row, event: MouseEvent) => any;
|
|
63
|
+
error: (error: Error, kind: QueryErrorKind) => any;
|
|
64
|
+
}, string, vue.PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
65
|
+
"onMain-action"?: ((row: Row, absIndex: number, event: KeyboardEvent | MouseEvent) => any) | undefined;
|
|
66
|
+
"onRow-click"?: ((row: Row, event: MouseEvent) => any) | undefined;
|
|
67
|
+
"onRow-dblclick"?: ((row: Row, event: MouseEvent) => any) | undefined;
|
|
68
|
+
onError?: ((error: Error, kind: QueryErrorKind) => any) | undefined;
|
|
69
|
+
}>, {
|
|
70
|
+
select: SelectionMode;
|
|
71
|
+
rowHeight: number;
|
|
72
|
+
wheelRowsPerTick: number;
|
|
73
|
+
reorderable: boolean;
|
|
74
|
+
resizable: boolean;
|
|
75
|
+
columnMinWidth: number;
|
|
76
|
+
rowDelete: boolean | RowDeleteOpt;
|
|
77
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
78
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
79
|
+
declare const _default: typeof __VLS_export;
|
|
80
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
81
|
+
new (): {
|
|
82
|
+
$slots: S;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
//#endregion
|
|
86
|
+
export { _default as t };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { str } from "@atscript/ui";
|
|
2
|
+
//#region src/utils/format-cell.ts
|
|
3
|
+
const numberFmt = new Intl.NumberFormat();
|
|
4
|
+
const dateFmt = new Intl.DateTimeFormat();
|
|
5
|
+
/** Format a cell value based on column type. */
|
|
6
|
+
function formatCellValue(value, type) {
|
|
7
|
+
if (value === null || value === void 0) return "";
|
|
8
|
+
switch (type) {
|
|
9
|
+
case "boolean": return value ? "✓" : "✗";
|
|
10
|
+
case "number": {
|
|
11
|
+
const n = typeof value === "number" ? value : Number(value);
|
|
12
|
+
return Number.isFinite(n) ? numberFmt.format(n) : str(value);
|
|
13
|
+
}
|
|
14
|
+
case "date":
|
|
15
|
+
if (value instanceof Date) return dateFmt.format(value);
|
|
16
|
+
if (typeof value === "string" || typeof value === "number") {
|
|
17
|
+
const d = new Date(value);
|
|
18
|
+
return isNaN(d.getTime()) ? str(value) : dateFmt.format(d);
|
|
19
|
+
}
|
|
20
|
+
return str(value);
|
|
21
|
+
case "array": return Array.isArray(value) ? `[${value.length}]` : str(value);
|
|
22
|
+
case "object": return typeof value === "object" ? "[Object]" : str(value);
|
|
23
|
+
default: return str(value);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { formatCellValue as t };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
let _atscript_ui = require("@atscript/ui");
|
|
2
|
+
//#region src/utils/format-cell.ts
|
|
3
|
+
const numberFmt = new Intl.NumberFormat();
|
|
4
|
+
const dateFmt = new Intl.DateTimeFormat();
|
|
5
|
+
/** Format a cell value based on column type. */
|
|
6
|
+
function formatCellValue(value, type) {
|
|
7
|
+
if (value === null || value === void 0) return "";
|
|
8
|
+
switch (type) {
|
|
9
|
+
case "boolean": return value ? "✓" : "✗";
|
|
10
|
+
case "number": {
|
|
11
|
+
const n = typeof value === "number" ? value : Number(value);
|
|
12
|
+
return Number.isFinite(n) ? numberFmt.format(n) : (0, _atscript_ui.str)(value);
|
|
13
|
+
}
|
|
14
|
+
case "date":
|
|
15
|
+
if (value instanceof Date) return dateFmt.format(value);
|
|
16
|
+
if (typeof value === "string" || typeof value === "number") {
|
|
17
|
+
const d = new Date(value);
|
|
18
|
+
return isNaN(d.getTime()) ? (0, _atscript_ui.str)(value) : dateFmt.format(d);
|
|
19
|
+
}
|
|
20
|
+
return (0, _atscript_ui.str)(value);
|
|
21
|
+
case "array": return Array.isArray(value) ? `[${value.length}]` : (0, _atscript_ui.str)(value);
|
|
22
|
+
case "object": return typeof value === "object" ? "[Object]" : (0, _atscript_ui.str)(value);
|
|
23
|
+
default: return (0, _atscript_ui.str)(value);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
Object.defineProperty(exports, "formatCellValue", {
|
|
28
|
+
enumerable: true,
|
|
29
|
+
get: function() {
|
|
30
|
+
return formatCellValue;
|
|
31
|
+
}
|
|
32
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//#region src/utils/get-cell-value.ts
|
|
2
|
+
/** Gets a nested value from a row by dot-separated path. */
|
|
3
|
+
function getCellValue(row, path) {
|
|
4
|
+
if (!path) return void 0;
|
|
5
|
+
const keys = path.split(".");
|
|
6
|
+
let current = row;
|
|
7
|
+
for (const key of keys) {
|
|
8
|
+
if (current === null || current === void 0 || typeof current !== "object") return void 0;
|
|
9
|
+
current = current[key];
|
|
10
|
+
}
|
|
11
|
+
return current;
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
Object.defineProperty(exports, "getCellValue", {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function() {
|
|
17
|
+
return getCellValue;
|
|
18
|
+
}
|
|
19
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//#region src/utils/get-cell-value.ts
|
|
2
|
+
/** Gets a nested value from a row by dot-separated path. */
|
|
3
|
+
function getCellValue(row, path) {
|
|
4
|
+
if (!path) return void 0;
|
|
5
|
+
const keys = path.split(".");
|
|
6
|
+
let current = row;
|
|
7
|
+
for (const key of keys) {
|
|
8
|
+
if (current === null || current === void 0 || typeof current !== "object") return void 0;
|
|
9
|
+
current = current[key];
|
|
10
|
+
}
|
|
11
|
+
return current;
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
export { getCellValue as t };
|