vlite3 1.5.5 → 1.5.7
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/README.md +34 -0
- package/VLiteIconsVite.d.ts +36 -0
- package/components/AppShell/AppShell.vue.d.ts +1 -1
- package/components/AppShell/AppShellLayoutDashboard.vue.js +3 -2
- package/components/AppShell/AppShellLayoutDock.vue.js +3 -2
- package/components/AppShell/AppShellLayoutHeaderShell.vue.js +28 -27
- package/components/AppShell/AppShellLayoutSidebarFirst.vue.js +3 -2
- package/components/AsyncSelect/createAsyncSelect.d.ts +4 -4
- package/components/AsyncSelect/createAsyncSelect.js +3 -2
- package/components/BackButton.vue.d.ts +1 -1
- package/components/ButtonGroup.vue.js +2 -2
- package/components/CategoryManager/CategoryManager.vue2.js +15 -15
- package/components/CategoryManager/CategoryNode.vue.js +16 -16
- package/components/CategoryMenu/CategoryMenu.vue.js +9 -8
- package/components/Chart/BarChart.vue.d.ts +1 -1
- package/components/Chart/GanttChart.vue.d.ts +1 -1
- package/components/Chart/LineChart.vue.d.ts +1 -1
- package/components/Chart/TimelineChart.vue.d.ts +1 -1
- package/components/Chip/Chip.vue.d.ts +1 -0
- package/components/Chip/Chip.vue.js +67 -36
- package/components/Chip/types.d.ts +5 -1
- package/components/ColorPicker/ColorIro.vue3.js +2 -2
- package/components/ColorPicker/ColorPicker.vue.js +2 -2
- package/components/CommandPalette/CommandPaletteContent.vue2.js +1 -1
- package/components/CommandPalette/{CommandPaletteItem.vue2.js → CommandPaletteItem.vue.js} +1 -1
- package/components/ConfirmationModal.vue.d.ts +4 -0
- package/components/ConfirmationModal.vue.js +47 -39
- package/components/DataTable/DataTable.vue.d.ts +12 -3
- package/components/DataTable/DataTable.vue.js +5 -561
- package/components/DataTable/DataTable.vue2.js +711 -2
- package/components/DataTable/DataTableHeader.vue.d.ts +22 -0
- package/components/DataTable/DataTableHeader.vue.js +5 -58
- package/components/DataTable/DataTableHeader.vue2.js +106 -2
- package/components/DataTable/DataTableRow.vue.d.ts +15 -0
- package/components/DataTable/DataTableRow.vue.js +3 -3
- package/components/DataTable/DataTableRow.vue2.js +131 -118
- package/components/DataTable/dataTableColumnWidths.d.ts +91 -0
- package/components/DataTable/dataTableColumnWidths.js +82 -0
- package/components/DataTable/types.d.ts +50 -0
- package/components/DataTable/useDataTableColumnResize.d.ts +52 -0
- package/components/DataTable/useDataTableColumnResize.js +328 -0
- package/components/DatePicker.vue.js +5 -4
- package/components/Empty/Empty.vue.js +3 -2
- package/components/ExportData/ExportData.vue.d.ts +1 -1
- package/components/Form/{AccordionView.vue.js → AccordionView.vue2.js} +1 -1
- package/components/Form/Form.vue2.js +44 -43
- package/components/Form/FormField.vue.js +24 -24
- package/components/Form/index.vue2.js +1 -1
- package/components/Heatmap/Heatmap.vue2.js +3 -2
- package/components/Icon.vue.d.ts +3 -2
- package/components/Icon.vue.js +22 -12
- package/components/IconPicker.vue.js +5 -133
- package/components/IconPicker.vue2.js +218 -2
- package/components/ImportData/ImportData.vue.js +3 -2
- package/components/ImportData/ImportStep2.vue.js +3 -2
- package/components/Kanban/KanbanBoard.vue2.js +4 -2
- package/components/List/utils.js +5 -4
- package/components/Masonry/Masonry.vue2.js +14 -13
- package/components/Navbar/Navbar.vue.d.ts +1 -1
- package/components/NavbarCommandPalette.vue.js +1 -1
- package/components/PanZoomViewport/PanZoomViewport.vue.d.ts +1 -1
- package/components/Price/Price.vue.js +13 -12
- package/components/Rating/Rating.vue.js +2 -2
- package/components/Rating/Rating.vue2.js +41 -41
- package/components/Rating/ReviewSummary.vue.js +20 -20
- package/components/Screen/ScreenFilter.vue.js +6 -4
- package/components/Screen/components/ScreenExportModal.vue.d.ts +2 -2
- package/components/Stats/StatItem.vue.js +3 -2
- package/components/StatusChip/StatusChip.vue.d.ts +6 -0
- package/components/StatusChip/StatusChip.vue.js +14 -11
- package/components/Tabes/Tabes.vue.js +3 -3
- package/components/Tabes/Tabes.vue2.js +241 -220
- package/components/Tabes/types.d.ts +3 -1
- package/components/Workbook/Sheet.vue.js +11 -11
- package/core/config.d.ts +28 -0
- package/core/config.js +23 -21
- package/core/index.js +18 -17
- package/icons/IconRegistry.d.ts +38 -0
- package/icons/IconRegistry.js +166 -0
- package/icons/IconTypes.d.ts +37 -0
- package/index.d.ts +2 -0
- package/index.js +473 -457
- package/package.json +15 -3
- package/style.css +17 -3
- package/types/config.type.d.ts +8 -1
- package/utils/functions.js +44 -43
- package/utils/index.d.ts +1 -0
- package/utils/usePersistentState.d.ts +4 -1
- package/utils/usePersistentState.js +4 -3
- package/vite.d.ts +6 -0
- package/vite.js +223 -0
- /package/components/ColorPicker/{ColorIro.vue.js → ColorIro.vue2.js} +0 -0
|
@@ -35,6 +35,13 @@ export interface TableHeader {
|
|
|
35
35
|
width?: string;
|
|
36
36
|
minWidth?: string;
|
|
37
37
|
sortable?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Per-column opt-out for column resizing.
|
|
40
|
+
* Only meaningful when the table sets `resizable`.
|
|
41
|
+
* `false` pins this column (action / utility / fixed-width columns).
|
|
42
|
+
* @default true (resizable when the table is)
|
|
43
|
+
*/
|
|
44
|
+
resizable?: boolean;
|
|
38
45
|
hideOnMobile?: boolean;
|
|
39
46
|
align?: 'left' | 'center' | 'right';
|
|
40
47
|
format?: (value: any, row?: any) => string;
|
|
@@ -54,6 +61,8 @@ export interface DataTableProps {
|
|
|
54
61
|
keyField?: string;
|
|
55
62
|
loading?: boolean;
|
|
56
63
|
hideSelectable?: boolean;
|
|
64
|
+
/** Return false to keep a row visible while disabling its selection checkbox. */
|
|
65
|
+
isRowSelectable?: (row: any) => boolean;
|
|
57
66
|
emptyTitle?: string;
|
|
58
67
|
emptyTitleI18n?: string;
|
|
59
68
|
emptyDescription?: string;
|
|
@@ -94,6 +103,24 @@ export interface DataTableProps {
|
|
|
94
103
|
* Set to `false` to keep the always-table + horizontal-scroll layout.
|
|
95
104
|
*/
|
|
96
105
|
responsive?: boolean;
|
|
106
|
+
/**
|
|
107
|
+
* Opt in to drag-to-resize column boundaries on the desktop table.
|
|
108
|
+
* Each header renders and owns the control on its logical trailing edge
|
|
109
|
+
* (right in LTR, left in RTL), so there is no boundary-to-column index mapping.
|
|
110
|
+
* Disabled by default — when `false` the table renders and behaves exactly
|
|
111
|
+
* as it does without the feature (no handles, no width persistence).
|
|
112
|
+
* Individual columns can opt out with `header.resizable: false`.
|
|
113
|
+
* @default false
|
|
114
|
+
*/
|
|
115
|
+
resizable?: boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Stable key used to persist user column widths in local storage
|
|
118
|
+
* (`data-table:{persistenceKey}:column-widths`). Deliberately separate from
|
|
119
|
+
* `keyField`, which identifies rows.
|
|
120
|
+
*
|
|
121
|
+
* Omit it to keep resizing session-only — nothing is written to storage.
|
|
122
|
+
*/
|
|
123
|
+
persistenceKey?: string;
|
|
97
124
|
}
|
|
98
125
|
export interface SelectionState {
|
|
99
126
|
selected: any[];
|
|
@@ -114,6 +141,29 @@ export interface ExpandPayload {
|
|
|
114
141
|
children?: any[];
|
|
115
142
|
depth: number;
|
|
116
143
|
}
|
|
144
|
+
/**
|
|
145
|
+
* Emitted by `@column-resize` when a column resize is committed
|
|
146
|
+
* (drag end, keyboard adjust, or double-click reset).
|
|
147
|
+
*/
|
|
148
|
+
export interface ColumnResizePayload {
|
|
149
|
+
/** `header.field` owning the dragged logical trailing-edge boundary. */
|
|
150
|
+
field: string;
|
|
151
|
+
/** Committed width in px, or `null` when the column was reset to its configured width. */
|
|
152
|
+
width: number | null;
|
|
153
|
+
/** Width in px before this interaction started. */
|
|
154
|
+
previousWidth: number | null;
|
|
155
|
+
/** How the change was made. */
|
|
156
|
+
source: 'pointer' | 'keyboard' | 'reset';
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Persisted column-width payload (local storage).
|
|
160
|
+
* Versioned so the schema can change without breaking saved state.
|
|
161
|
+
*/
|
|
162
|
+
export interface ColumnWidthsState {
|
|
163
|
+
version: number;
|
|
164
|
+
/** Pixel widths keyed by stable `header.field` — never by column index. */
|
|
165
|
+
widths: Record<string, number>;
|
|
166
|
+
}
|
|
117
167
|
/** Flattened visible tree row metadata used internally by DataTable. */
|
|
118
168
|
export interface DataTableFlatRow {
|
|
119
169
|
row: any;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { ComputedRef, Ref } from 'vue';
|
|
2
|
+
import { ColumnResizePayload, TableHeader } from './types';
|
|
3
|
+
export { DEFAULT_MIN_COLUMN_WIDTH, MAX_COLUMN_WIDTH, COLUMN_WIDTHS_VERSION, SELECTION_COLUMN_WIDTH, sanitizeColumnWidths, } from './dataTableColumnWidths';
|
|
4
|
+
export interface UseDataTableColumnResizeOptions {
|
|
5
|
+
headers: Ref<TableHeader[]> | ComputedRef<TableHeader[]>;
|
|
6
|
+
enabled: Ref<boolean> | ComputedRef<boolean>;
|
|
7
|
+
/** Enables one measured, full-table-height boundary per resizable column. */
|
|
8
|
+
fullHeightBoundaries: Ref<boolean> | ComputedRef<boolean>;
|
|
9
|
+
persistenceKey: Ref<string | undefined> | ComputedRef<string | undefined>;
|
|
10
|
+
isRtl: Ref<boolean> | Readonly<Ref<boolean>>;
|
|
11
|
+
tableRef: Ref<HTMLTableElement | null>;
|
|
12
|
+
viewportRef: Ref<HTMLElement | null>;
|
|
13
|
+
hasSelectionColumn: Ref<boolean> | ComputedRef<boolean>;
|
|
14
|
+
measurementReady: Ref<boolean> | ComputedRef<boolean>;
|
|
15
|
+
onCommit?: (payload: ColumnResizePayload) => void;
|
|
16
|
+
}
|
|
17
|
+
export interface DataTableColumnBoundary {
|
|
18
|
+
field: string;
|
|
19
|
+
/** Logical inline position of the owning column's rendered trailing edge. */
|
|
20
|
+
offset: number;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Conventional table-column resizing.
|
|
24
|
+
*
|
|
25
|
+
* A non-bordered table renders the separator inside the owning `<th>`. A
|
|
26
|
+
* cell-bordered table uses one measured full-height control at that same
|
|
27
|
+
* rendered trailing edge. Both paths pass `header.field` directly into this
|
|
28
|
+
* composable; no boundary index or neighbouring-column lookup is involved.
|
|
29
|
+
* A fixed final column may separately receive passive viewport slack so the
|
|
30
|
+
* table stays flush at its trailing edge.
|
|
31
|
+
*/
|
|
32
|
+
export declare function useDataTableColumnResize({ headers, enabled, fullHeightBoundaries, persistenceKey, isRtl, tableRef, viewportRef, hasSelectionColumn, measurementReady, onCommit, }: UseDataTableColumnResizeOptions): {
|
|
33
|
+
isResizing: Ref<boolean, boolean>;
|
|
34
|
+
activeField: Ref<string, string>;
|
|
35
|
+
isApplyingWidths: ComputedRef<boolean>;
|
|
36
|
+
columnWidths: ComputedRef<Record<string, number>>;
|
|
37
|
+
tableWidth: ComputedRef<number>;
|
|
38
|
+
columnBoundaries: Ref<{
|
|
39
|
+
field: string;
|
|
40
|
+
offset: number;
|
|
41
|
+
}[], DataTableColumnBoundary[] | {
|
|
42
|
+
field: string;
|
|
43
|
+
offset: number;
|
|
44
|
+
}[]>;
|
|
45
|
+
boundaryLayerWidth: Ref<number, number>;
|
|
46
|
+
boundaryLayerHeight: Ref<number, number>;
|
|
47
|
+
minWidthFor: (header: TableHeader) => number;
|
|
48
|
+
resolveWidth: (header: TableHeader) => number | undefined;
|
|
49
|
+
startResize: (field: string, event: PointerEvent) => void;
|
|
50
|
+
adjustWidth: (field: string, physicalDirection: 1 | -1, large?: boolean) => void;
|
|
51
|
+
resetColumn: (field: string) => void;
|
|
52
|
+
};
|
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
import { ref as s, computed as h, onMounted as Ve, watch as S, nextTick as Oe, onUnmounted as Je } from "vue";
|
|
2
|
+
import { useResizeObserver as Pe } from "@vueuse/core";
|
|
3
|
+
import { usePersistentState as Qe } from "../../utils/usePersistentState.js";
|
|
4
|
+
import { pruneUnusableWidths as Ae, sanitizeColumnWidths as Ze, computeColumnLayout as et, COLUMN_WIDTHS_VERSION as De, clampWidth as Ne, resolveColumnWidth as tt, minWidthFor as nt, MAX_COLUMN_WIDTH as Be } from "./dataTableColumnWidths.js";
|
|
5
|
+
import { DEFAULT_MIN_COLUMN_WIDTH as ft, SELECTION_COLUMN_WIDTH as mt } from "./dataTableColumnWidths.js";
|
|
6
|
+
const rt = 8, ot = 40, lt = 250;
|
|
7
|
+
function dt({
|
|
8
|
+
headers: c,
|
|
9
|
+
enabled: d,
|
|
10
|
+
fullHeightBoundaries: ue,
|
|
11
|
+
persistenceKey: ae,
|
|
12
|
+
isRtl: H,
|
|
13
|
+
tableRef: m,
|
|
14
|
+
viewportRef: se,
|
|
15
|
+
hasSelectionColumn: de,
|
|
16
|
+
measurementReady: U,
|
|
17
|
+
onCommit: q
|
|
18
|
+
}) {
|
|
19
|
+
const y = s({}), p = s({}), u = s({}), b = s(!1), K = s(!1), R = s(!1), W = s(!1), $ = s(null), ce = s(null), j = s([]), G = s(0), Y = s(0), P = h(() => {
|
|
20
|
+
const e = /* @__PURE__ */ new Map();
|
|
21
|
+
for (const t of c.value) e.set(t.field, t);
|
|
22
|
+
return e;
|
|
23
|
+
}), A = (e) => !!e && d.value && e.resizable !== !1, M = (e) => nt(e, p.value[e.field]), D = (e) => tt(
|
|
24
|
+
e,
|
|
25
|
+
u.value,
|
|
26
|
+
y.value,
|
|
27
|
+
p.value[e.field]
|
|
28
|
+
), V = h(
|
|
29
|
+
() => d.value && b.value && !K.value
|
|
30
|
+
), N = h(() => {
|
|
31
|
+
const e = c.value[c.value.length - 1];
|
|
32
|
+
return e?.resizable === !1 ? e.field : null;
|
|
33
|
+
}), J = (e) => et({
|
|
34
|
+
headers: c.value,
|
|
35
|
+
userWidths: e,
|
|
36
|
+
baseWidths: y.value,
|
|
37
|
+
minimumWidths: p.value,
|
|
38
|
+
hasSelectionColumn: de.value,
|
|
39
|
+
containerWidth: ce.value,
|
|
40
|
+
trailingFillField: N.value
|
|
41
|
+
}), Q = h(() => V.value ? J(u.value) : { widths: {}, totalWidth: null, complete: !1 }), ve = h(() => Q.value.widths), ze = h(
|
|
42
|
+
() => Q.value.complete ? Q.value.totalWidth : null
|
|
43
|
+
), Z = () => {
|
|
44
|
+
const e = m.value;
|
|
45
|
+
if (!e) return {};
|
|
46
|
+
const t = {};
|
|
47
|
+
return e.querySelectorAll("thead th[data-vlite-col]").forEach((r) => {
|
|
48
|
+
const o = r.dataset.vliteCol, l = r.getBoundingClientRect().width;
|
|
49
|
+
o && Number.isFinite(l) && l > 0 && (t[o] = Math.round(l));
|
|
50
|
+
}), t;
|
|
51
|
+
}, fe = () => {
|
|
52
|
+
const e = m.value;
|
|
53
|
+
if (!e || typeof window > "u") return {};
|
|
54
|
+
const t = {};
|
|
55
|
+
return e.querySelectorAll("thead th[data-vlite-col]").forEach((r) => {
|
|
56
|
+
const o = r.dataset.vliteCol, l = r.querySelector("[data-vlite-header-content]");
|
|
57
|
+
if (!o || !l) return;
|
|
58
|
+
const a = Array.from(l.children).filter(
|
|
59
|
+
(le) => le instanceof HTMLElement
|
|
60
|
+
), g = window.getComputedStyle(l), i = Number.parseFloat(g.columnGap) || 0, f = a.reduce((le, ie) => {
|
|
61
|
+
const Te = window.getComputedStyle(ie), Ye = (Number.parseFloat(Te.marginInlineStart) || 0) + (Number.parseFloat(Te.marginInlineEnd) || 0);
|
|
62
|
+
return le + Math.max(ie.scrollWidth, ie.getBoundingClientRect().width) + Ye;
|
|
63
|
+
}, i * Math.max(0, a.length - 1)), E = window.getComputedStyle(r), Ge = (Number.parseFloat(E.paddingInlineStart) || 0) + (Number.parseFloat(E.paddingInlineEnd) || 0), oe = Math.ceil(f + Ge);
|
|
64
|
+
Number.isFinite(oe) && oe > 0 && (t[o] = oe);
|
|
65
|
+
}), t;
|
|
66
|
+
}, me = () => {
|
|
67
|
+
const e = fe();
|
|
68
|
+
Object.keys(e).length && (p.value = { ...p.value, ...e });
|
|
69
|
+
};
|
|
70
|
+
let I = null;
|
|
71
|
+
const T = /* @__PURE__ */ new Set(), he = (e) => {
|
|
72
|
+
if (!I) return;
|
|
73
|
+
const t = new Set(e);
|
|
74
|
+
for (const r of T)
|
|
75
|
+
t.has(r) || (I.unobserve(r), T.delete(r));
|
|
76
|
+
for (const r of t)
|
|
77
|
+
T.has(r) || (I.observe(r), T.add(r));
|
|
78
|
+
}, ke = () => {
|
|
79
|
+
if (!d.value || !ue.value) {
|
|
80
|
+
he([]), j.value = [], G.value = 0, Y.value = 0;
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
if (W.value) return;
|
|
84
|
+
const e = m.value;
|
|
85
|
+
if (!e) return;
|
|
86
|
+
const t = e.getBoundingClientRect();
|
|
87
|
+
if (t.width <= 0 || t.height <= 0) return;
|
|
88
|
+
const r = Array.from(
|
|
89
|
+
e.querySelectorAll("thead th[data-vlite-col]")
|
|
90
|
+
);
|
|
91
|
+
he(r);
|
|
92
|
+
const o = [];
|
|
93
|
+
r.forEach((l) => {
|
|
94
|
+
const a = l.dataset.vliteCol, g = a ? P.value.get(a) : void 0;
|
|
95
|
+
if (!a || !A(g)) return;
|
|
96
|
+
const i = l.getBoundingClientRect();
|
|
97
|
+
if (i.width <= 0 || i.height <= 0) return;
|
|
98
|
+
const f = H.value ? t.right - i.left : i.right - t.left;
|
|
99
|
+
Number.isFinite(f) && o.push({ field: a, offset: f });
|
|
100
|
+
}), j.value = o, G.value = t.width, Y.value = t.height;
|
|
101
|
+
};
|
|
102
|
+
let C = null;
|
|
103
|
+
const v = () => {
|
|
104
|
+
typeof window > "u" || C != null || (C = window.requestAnimationFrame(() => {
|
|
105
|
+
C = null, ke();
|
|
106
|
+
}));
|
|
107
|
+
}, _e = () => {
|
|
108
|
+
C == null || typeof window > "u" || (window.cancelAnimationFrame(C), C = null);
|
|
109
|
+
}, ee = () => {
|
|
110
|
+
if (me(), b.value) return !0;
|
|
111
|
+
const e = Z();
|
|
112
|
+
return Object.keys(e).length ? (y.value = { ...y.value, ...e }, b.value = !0, !0) : !1;
|
|
113
|
+
}, xe = async () => {
|
|
114
|
+
if (!d.value || !b.value || W.value) return;
|
|
115
|
+
if (!c.value.some((o) => y.value[o.field] == null)) {
|
|
116
|
+
me();
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
K.value = !0, await Oe();
|
|
120
|
+
const t = Z(), r = fe();
|
|
121
|
+
K.value = !1, y.value = { ...y.value, ...t }, p.value = { ...p.value, ...r };
|
|
122
|
+
}, B = h(
|
|
123
|
+
() => ae.value ? `data-table:${ae.value}:column-widths` : null
|
|
124
|
+
), ye = h(() => !!B.value), te = Qe(
|
|
125
|
+
() => B.value ?? "data-table:@session:column-widths",
|
|
126
|
+
{ version: De, widths: {} },
|
|
127
|
+
{ writeDefaults: !1, onError: () => {
|
|
128
|
+
} }
|
|
129
|
+
), ne = () => {
|
|
130
|
+
ye.value && (te.value = {
|
|
131
|
+
version: De,
|
|
132
|
+
widths: Ae(u.value, c.value)
|
|
133
|
+
});
|
|
134
|
+
};
|
|
135
|
+
let pe = "", we = "", z = !1;
|
|
136
|
+
const Xe = () => {
|
|
137
|
+
z || typeof document > "u" || (pe = document.body.style.cursor, we = document.body.style.userSelect, document.body.style.cursor = "col-resize", document.body.style.userSelect = "none", z = !0);
|
|
138
|
+
}, He = () => {
|
|
139
|
+
!z || typeof document > "u" || (document.body.style.cursor = pe, document.body.style.userSelect = we, z = !1);
|
|
140
|
+
}, ge = () => H.value ? -1 : 1, be = (e, t) => {
|
|
141
|
+
u.value = { ...u.value, [e]: Math.round(t) };
|
|
142
|
+
}, k = (e) => {
|
|
143
|
+
const t = m.value;
|
|
144
|
+
if (!t) return null;
|
|
145
|
+
for (const r of t.querySelectorAll("col[data-vlite-col]"))
|
|
146
|
+
if (r.dataset.vliteCol === e) return r;
|
|
147
|
+
return null;
|
|
148
|
+
};
|
|
149
|
+
let n = null, F = null;
|
|
150
|
+
const We = (e) => Ne(
|
|
151
|
+
e.startWidth + (e.lastX - e.startX) * ge(),
|
|
152
|
+
e.min,
|
|
153
|
+
Be
|
|
154
|
+
), Ue = () => {
|
|
155
|
+
F != null && (cancelAnimationFrame(F), F = null);
|
|
156
|
+
}, qe = () => {
|
|
157
|
+
if (!n) return;
|
|
158
|
+
const e = Math.round(We(n)), t = J({ ...u.value, [n.field]: e });
|
|
159
|
+
n.col || (n.col = k(n.field)), n.col && (n.col.style.width = `${t.widths[n.field] ?? e}px`);
|
|
160
|
+
const r = N.value;
|
|
161
|
+
if (r) {
|
|
162
|
+
n.trailingFillCol || (n.trailingFillCol = k(r));
|
|
163
|
+
const l = t.widths[r];
|
|
164
|
+
n.trailingFillCol && l != null && (n.trailingFillCol.style.width = `${l}px`);
|
|
165
|
+
}
|
|
166
|
+
m.value && t.totalWidth != null && (m.value.style.width = `${t.totalWidth}px`, n.boundaryLayer && (n.boundaryLayer.style.inlineSize = `${t.totalWidth}px`));
|
|
167
|
+
const o = t.widths[n.field] ?? e;
|
|
168
|
+
n.boundary && n.boundaryStart != null && (n.boundary.style.insetInlineStart = `${n.boundaryStart + o - n.startWidth}px`);
|
|
169
|
+
}, Ce = (e) => {
|
|
170
|
+
!n || e.pointerId !== n.pointerId || (e.cancelable && e.preventDefault(), n.lastX = e.clientX, e.clientX !== n.startX && (n.moved = !0), F == null && (F = requestAnimationFrame(() => {
|
|
171
|
+
F = null, qe();
|
|
172
|
+
})));
|
|
173
|
+
}, Ke = () => {
|
|
174
|
+
typeof window > "u" || (n?.handle?.removeEventListener("lostpointercapture", Ee), n?.handle?.hasPointerCapture(n.pointerId) && n.handle.releasePointerCapture(n.pointerId), window.removeEventListener("pointermove", Ce), window.removeEventListener("pointerup", Fe), window.removeEventListener("pointercancel", Le), window.removeEventListener("keydown", Se, !0), window.removeEventListener("blur", Me));
|
|
175
|
+
}, w = (e) => {
|
|
176
|
+
const t = n;
|
|
177
|
+
if (Ue(), Ke(), He(), n = null, W.value = !1, $.value = null, !t) return;
|
|
178
|
+
if (t.col?.style.removeProperty("width"), t.trailingFillCol?.style.removeProperty("width"), t.boundary?.style.removeProperty("inset-inline-start"), t.boundaryLayer?.style.removeProperty("inline-size"), m.value?.style.removeProperty("width"), !t.moved || !e) {
|
|
179
|
+
v();
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
const r = Math.round(We(t));
|
|
183
|
+
if (r === t.startWidth) {
|
|
184
|
+
v();
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
be(t.field, r), ne(), q?.({
|
|
188
|
+
field: t.field,
|
|
189
|
+
width: r,
|
|
190
|
+
previousWidth: t.startWidth,
|
|
191
|
+
source: "pointer"
|
|
192
|
+
}), v();
|
|
193
|
+
};
|
|
194
|
+
function Fe(e) {
|
|
195
|
+
!n || e.pointerId !== n.pointerId || w(!0);
|
|
196
|
+
}
|
|
197
|
+
function Le(e) {
|
|
198
|
+
!n || e.pointerId !== n.pointerId || w(!1);
|
|
199
|
+
}
|
|
200
|
+
function Ee(e) {
|
|
201
|
+
!n || e.pointerId !== n.pointerId || w(!1);
|
|
202
|
+
}
|
|
203
|
+
function Se(e) {
|
|
204
|
+
e.key === "Escape" && (e.preventDefault(), w(!1));
|
|
205
|
+
}
|
|
206
|
+
function Me() {
|
|
207
|
+
w(!1);
|
|
208
|
+
}
|
|
209
|
+
const Re = (e, t) => {
|
|
210
|
+
const r = P.value.get(e);
|
|
211
|
+
if (!A(r) || n || t.button !== 0 || !ee()) return;
|
|
212
|
+
t.preventDefault(), t.stopPropagation(), X();
|
|
213
|
+
const o = J(u.value), l = Z()[e], a = Math.round(
|
|
214
|
+
o.widths[e] ?? l ?? D(r) ?? M(r)
|
|
215
|
+
), g = t.currentTarget, i = g instanceof HTMLElement ? g : null, f = i?.dataset.vliteResizeBoundary === e ? i : null, E = f ? Number.parseFloat(f.style.insetInlineStart) : null;
|
|
216
|
+
n = {
|
|
217
|
+
field: e,
|
|
218
|
+
pointerId: t.pointerId,
|
|
219
|
+
startX: t.clientX,
|
|
220
|
+
lastX: t.clientX,
|
|
221
|
+
startWidth: a,
|
|
222
|
+
min: M(r),
|
|
223
|
+
moved: !1,
|
|
224
|
+
handle: i,
|
|
225
|
+
col: k(e),
|
|
226
|
+
trailingFillCol: N.value ? k(N.value) : null,
|
|
227
|
+
boundary: f,
|
|
228
|
+
boundaryLayer: f?.parentElement ?? null,
|
|
229
|
+
boundaryStart: E != null && Number.isFinite(E) ? E : null
|
|
230
|
+
}, W.value = !0, $.value = e, Xe(), i?.setPointerCapture(t.pointerId), i?.addEventListener("lostpointercapture", Ee), !(typeof window > "u") && (window.addEventListener("pointermove", Ce, { passive: !1 }), window.addEventListener("pointerup", Fe), window.addEventListener("pointercancel", Le), window.addEventListener("keydown", Se, !0), window.addEventListener("blur", Me));
|
|
231
|
+
};
|
|
232
|
+
let L = null, _ = null, O = null, re = null;
|
|
233
|
+
const x = () => {
|
|
234
|
+
L && clearTimeout(L), L = null, _ = null, O = null, re = null;
|
|
235
|
+
}, X = () => {
|
|
236
|
+
const e = _;
|
|
237
|
+
x(), e?.();
|
|
238
|
+
}, $e = (e, t, r = !1) => {
|
|
239
|
+
const o = P.value.get(e);
|
|
240
|
+
if (!A(o) || (_ && O !== e && X(), !ee())) return;
|
|
241
|
+
const l = Math.round(D(o) ?? M(o)), a = O === e ? re : l, i = Ne(
|
|
242
|
+
l + (r ? ot : rt) * t * ge(),
|
|
243
|
+
M(o),
|
|
244
|
+
Be
|
|
245
|
+
);
|
|
246
|
+
i !== l && (be(e, i), L && clearTimeout(L), O = e, re = a, _ = () => {
|
|
247
|
+
ne(), q?.({ field: e, width: i, previousWidth: a, source: "keyboard" });
|
|
248
|
+
}, L = setTimeout(X, lt));
|
|
249
|
+
}, je = (e) => {
|
|
250
|
+
const t = P.value.get(e);
|
|
251
|
+
if (!A(t) || u.value[e] == null) return;
|
|
252
|
+
O === e ? x() : X();
|
|
253
|
+
const r = D(t) ?? u.value[e], o = { ...u.value };
|
|
254
|
+
delete o[e], u.value = o, ne(), q?.({ field: e, width: null, previousWidth: r, source: "reset" });
|
|
255
|
+
}, Ie = () => {
|
|
256
|
+
const e = se.value?.clientWidth;
|
|
257
|
+
e != null && Number.isFinite(e) && e > 0 && (ce.value = e), v();
|
|
258
|
+
};
|
|
259
|
+
return Pe(se, Ie), Pe(m, v), Ve(() => {
|
|
260
|
+
R.value = !0, typeof ResizeObserver < "u" && (I = new ResizeObserver(v)), Ie(), v();
|
|
261
|
+
}), S(
|
|
262
|
+
[B, d, te],
|
|
263
|
+
() => {
|
|
264
|
+
!d.value || W.value || !ye.value || (u.value = Ae(
|
|
265
|
+
Ze(te.value),
|
|
266
|
+
c.value
|
|
267
|
+
));
|
|
268
|
+
},
|
|
269
|
+
{ immediate: !0, deep: !0 }
|
|
270
|
+
), S(B, (e, t) => {
|
|
271
|
+
e !== t && (x(), e || (u.value = {}));
|
|
272
|
+
}), S(
|
|
273
|
+
[
|
|
274
|
+
d,
|
|
275
|
+
U,
|
|
276
|
+
R,
|
|
277
|
+
() => Object.keys(u.value).length > 0,
|
|
278
|
+
() => c.value.length
|
|
279
|
+
],
|
|
280
|
+
async () => {
|
|
281
|
+
!d.value || !U.value || !R.value || b.value || !Object.keys(u.value).length || (await Oe(), ee());
|
|
282
|
+
},
|
|
283
|
+
{ immediate: !0 }
|
|
284
|
+
), S(
|
|
285
|
+
() => c.value.map((e) => e.field).join("\0"),
|
|
286
|
+
() => {
|
|
287
|
+
d.value && b.value && xe(), v();
|
|
288
|
+
}
|
|
289
|
+
), S(
|
|
290
|
+
[
|
|
291
|
+
d,
|
|
292
|
+
ue,
|
|
293
|
+
H,
|
|
294
|
+
V,
|
|
295
|
+
ve,
|
|
296
|
+
U,
|
|
297
|
+
de
|
|
298
|
+
],
|
|
299
|
+
v,
|
|
300
|
+
{ deep: !0, flush: "post" }
|
|
301
|
+
), S(d, (e) => {
|
|
302
|
+
!e && n && w(!1);
|
|
303
|
+
}), Je(() => {
|
|
304
|
+
x(), w(!1), _e(), I?.disconnect(), T.clear();
|
|
305
|
+
}), {
|
|
306
|
+
isResizing: W,
|
|
307
|
+
activeField: $,
|
|
308
|
+
isApplyingWidths: V,
|
|
309
|
+
columnWidths: ve,
|
|
310
|
+
tableWidth: ze,
|
|
311
|
+
columnBoundaries: j,
|
|
312
|
+
boundaryLayerWidth: G,
|
|
313
|
+
boundaryLayerHeight: Y,
|
|
314
|
+
minWidthFor: M,
|
|
315
|
+
resolveWidth: D,
|
|
316
|
+
startResize: Re,
|
|
317
|
+
adjustWidth: $e,
|
|
318
|
+
resetColumn: je
|
|
319
|
+
};
|
|
320
|
+
}
|
|
321
|
+
export {
|
|
322
|
+
De as COLUMN_WIDTHS_VERSION,
|
|
323
|
+
ft as DEFAULT_MIN_COLUMN_WIDTH,
|
|
324
|
+
Be as MAX_COLUMN_WIDTH,
|
|
325
|
+
mt as SELECTION_COLUMN_WIDTH,
|
|
326
|
+
Ze as sanitizeColumnWidths,
|
|
327
|
+
dt as useDataTableColumnResize
|
|
328
|
+
};
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as p, computed as m, openBlock as w, createBlock as $, unref as D, withCtx as h, createElementVNode as z, createVNode as g, renderSlot as B, mergeProps as x } from "vue";
|
|
2
2
|
import P from "./Button.vue.js";
|
|
3
3
|
import L from "./Dropdown/Dropdown.vue.js";
|
|
4
4
|
import "@iconify/vue";
|
|
5
|
+
import "../icons/IconRegistry.js";
|
|
5
6
|
import { $t as V } from "../utils/i18n.js";
|
|
6
7
|
/* empty css */
|
|
7
8
|
/* empty css */
|
|
8
9
|
/* empty css */
|
|
9
10
|
import U, { TimePicker as j } from "v-datepicker-lite";
|
|
10
11
|
import "v-datepicker-lite/style.css";
|
|
11
|
-
const C = { class: "overflow-hidden min-w-[300px]" },
|
|
12
|
+
const C = { class: "overflow-hidden min-w-[300px]" }, K = /* @__PURE__ */ p({
|
|
12
13
|
__name: "DatePicker",
|
|
13
14
|
props: {
|
|
14
15
|
placeholder: {},
|
|
@@ -160,7 +161,7 @@ const C = { class: "overflow-hidden min-w-[300px]" }, J = /* @__PURE__ */ z({
|
|
|
160
161
|
])
|
|
161
162
|
]),
|
|
162
163
|
default: h(() => [
|
|
163
|
-
|
|
164
|
+
z("div", C, [
|
|
164
165
|
g(D(U), {
|
|
165
166
|
value: T.value,
|
|
166
167
|
mode: t.mode,
|
|
@@ -211,5 +212,5 @@ const C = { class: "overflow-hidden min-w-[300px]" }, J = /* @__PURE__ */ z({
|
|
|
211
212
|
}
|
|
212
213
|
});
|
|
213
214
|
export {
|
|
214
|
-
|
|
215
|
+
K as default
|
|
215
216
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { defineComponent as d, computed as n, markRaw as t, openBlock as m, createElementBlock as u, createBlock as $, resolveDynamicComponent as y, createSlots as h, renderList as I, withCtx as g, renderSlot as C, normalizeProps as k, guardReactiveProps as w } from "vue";
|
|
2
2
|
import { $t as e } from "../../utils/i18n.js";
|
|
3
3
|
import { useVLiteConfig as x } from "../../core/config.js";
|
|
4
|
+
import "../../icons/IconRegistry.js";
|
|
4
5
|
import B from "./variants/Variant1.vue.js";
|
|
5
6
|
import S from "./variants/Variant2.vue.js";
|
|
6
7
|
import V from "./variants/Variant3.vue.js";
|
|
@@ -13,7 +14,7 @@ import R from "./variants/Variant9.vue.js";
|
|
|
13
14
|
import T from "./variants/Variant10.vue.js";
|
|
14
15
|
import j from "./variants/Variant11.vue.js";
|
|
15
16
|
import z from "./variants/Variant12.vue.js";
|
|
16
|
-
const N = { class: "flex items-center justify-center w-full py-2" },
|
|
17
|
+
const N = { class: "flex items-center justify-center w-full py-2" }, nt = /* @__PURE__ */ d({
|
|
17
18
|
__name: "Empty",
|
|
18
19
|
props: {
|
|
19
20
|
title: {},
|
|
@@ -67,5 +68,5 @@ const N = { class: "flex items-center justify-center w-full py-2" }, rt = /* @__
|
|
|
67
68
|
}
|
|
68
69
|
});
|
|
69
70
|
export {
|
|
70
|
-
|
|
71
|
+
nt as default
|
|
71
72
|
};
|
|
@@ -7,8 +7,8 @@ declare const _default: import('vue').DefineComponent<ExportDataProps, {
|
|
|
7
7
|
icon: string;
|
|
8
8
|
}[]>;
|
|
9
9
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ExportDataProps> & Readonly<{}>, {
|
|
10
|
-
title: string;
|
|
11
10
|
mode: "frontend" | "backend";
|
|
11
|
+
title: string;
|
|
12
12
|
buttonText: string;
|
|
13
13
|
buttonIcon: string;
|
|
14
14
|
formats: ExportFormat[];
|