@abraca/nuxt 2.36.0 → 2.37.0
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/dist/module.d.mts +6 -0
- package/dist/module.json +1 -1
- package/dist/runtime/components/ADocPickModal.vue +1 -1
- package/dist/runtime/components/ADocSubPageList.d.vue.ts +46 -0
- package/dist/runtime/components/ADocSubPageList.vue +1006 -0
- package/dist/runtime/components/ADocSubPageList.vue.d.ts +46 -0
- package/dist/runtime/components/ADocumentTree.vue +3 -2
- package/dist/runtime/components/AEditor.d.vue.ts +9 -0
- package/dist/runtime/components/AEditor.vue +14 -2
- package/dist/runtime/components/AEditor.vue.d.ts +9 -0
- package/dist/runtime/components/AIconPicker.vue +27 -180
- package/dist/runtime/components/ANodePanel.d.vue.ts +8 -5
- package/dist/runtime/components/ANodePanel.vue +1 -1
- package/dist/runtime/components/ANodePanel.vue.d.ts +8 -5
- package/dist/runtime/components/AWindowLayer.vue +4 -2
- package/dist/runtime/components/aware/AMedia.d.vue.ts +1 -1
- package/dist/runtime/components/aware/AMedia.vue.d.ts +1 -1
- package/dist/runtime/components/docs/ADocsSearch.d.vue.ts +2 -2
- package/dist/runtime/components/docs/ADocsSearch.vue.d.ts +2 -2
- package/dist/runtime/components/editor/ADocSuggestMenu.vue +1 -1
- package/dist/runtime/components/editor/ALocationPickerPopover.vue +31 -16
- package/dist/runtime/components/renderers/ACalendarRenderer.d.vue.ts +1 -0
- package/dist/runtime/components/renderers/ACalendarRenderer.vue +309 -68
- package/dist/runtime/components/renderers/ACalendarRenderer.vue.d.ts +1 -0
- package/dist/runtime/components/renderers/AChecklistRenderer.vue +259 -40
- package/dist/runtime/components/renderers/ADashboardRenderer.vue +493 -89
- package/dist/runtime/components/renderers/AGraphRenderer.d.vue.ts +2 -0
- package/dist/runtime/components/renderers/AGraphRenderer.vue +2113 -576
- package/dist/runtime/components/renderers/AGraphRenderer.vue.d.ts +2 -0
- package/dist/runtime/components/renderers/AKanbanRenderer.vue +460 -86
- package/dist/runtime/components/renderers/AMapRenderer.d.vue.ts +7 -1
- package/dist/runtime/components/renderers/AMapRenderer.vue +999 -166
- package/dist/runtime/components/renderers/AMapRenderer.vue.d.ts +7 -1
- package/dist/runtime/components/renderers/AOutlineRenderer.d.vue.ts +2 -0
- package/dist/runtime/components/renderers/AOutlineRenderer.vue +285 -81
- package/dist/runtime/components/renderers/AOutlineRenderer.vue.d.ts +2 -0
- package/dist/runtime/components/renderers/AOverviewRenderer.vue +3 -2
- package/dist/runtime/components/renderers/ASheetsRenderer.client.vue +255 -87
- package/dist/runtime/components/renderers/ATimelineRenderer.d.vue.ts +1 -0
- package/dist/runtime/components/renderers/ATimelineRenderer.vue +224 -31
- package/dist/runtime/components/renderers/ATimelineRenderer.vue.d.ts +1 -0
- package/dist/runtime/components/renderers/calendar/ACalendarDayCell.d.vue.ts +8 -0
- package/dist/runtime/components/renderers/calendar/ACalendarDayCell.vue +12 -1
- package/dist/runtime/components/renderers/calendar/ACalendarDayCell.vue.d.ts +8 -0
- package/dist/runtime/components/renderers/calendar/ACalendarEventChip.d.vue.ts +10 -0
- package/dist/runtime/components/renderers/calendar/ACalendarEventChip.vue +15 -3
- package/dist/runtime/components/renderers/calendar/ACalendarEventChip.vue.d.ts +10 -0
- package/dist/runtime/components/renderers/calendar/ACalendarMonthView.d.vue.ts +14 -0
- package/dist/runtime/components/renderers/calendar/ACalendarMonthView.vue +6 -1
- package/dist/runtime/components/renderers/calendar/ACalendarMonthView.vue.d.ts +14 -0
- package/dist/runtime/components/renderers/sheets/ASheetsGrid.d.vue.ts +6 -6
- package/dist/runtime/components/renderers/sheets/ASheetsGrid.vue +25 -7
- package/dist/runtime/components/renderers/sheets/ASheetsGrid.vue.d.ts +6 -6
- package/dist/runtime/components/renderers/sheets/ASheetsMobileActionBar.d.vue.ts +2 -2
- package/dist/runtime/components/renderers/sheets/ASheetsMobileActionBar.vue.d.ts +2 -2
- package/dist/runtime/components/renderers/sheets/ASheetsToolbar.d.vue.ts +6 -0
- package/dist/runtime/components/renderers/sheets/ASheetsToolbar.vue +130 -23
- package/dist/runtime/components/renderers/sheets/ASheetsToolbar.vue.d.ts +6 -0
- package/dist/runtime/components/renderers/timeline/ATimelineAxis.vue +5 -3
- package/dist/runtime/components/renderers/timeline/ATimelineBar.vue +1 -1
- package/dist/runtime/components/renderers/timeline/ATimelineBarArea.d.vue.ts +0 -2
- package/dist/runtime/components/renderers/timeline/ATimelineBarArea.vue +16 -14
- package/dist/runtime/components/renderers/timeline/ATimelineBarArea.vue.d.ts +0 -2
- package/dist/runtime/components/renderers/timeline/ATimelineLabelPanel.vue +4 -2
- package/dist/runtime/composables/useCalendarView.js +34 -11
- package/dist/runtime/composables/useConnectionStatus.d.ts +1 -1
- package/dist/runtime/composables/useGraphReferenceEdges.d.ts +26 -0
- package/dist/runtime/composables/useGraphReferenceEdges.js +138 -0
- package/dist/runtime/composables/useGraphSim.d.ts +79 -0
- package/dist/runtime/composables/useGraphSim.js +231 -0
- package/dist/runtime/composables/useSheetsDependencyGraph.d.ts +26 -0
- package/dist/runtime/composables/useSheetsDependencyGraph.js +76 -0
- package/dist/runtime/composables/useSheetsFormulas.d.ts +4 -3
- package/dist/runtime/composables/useSheetsFormulas.js +575 -26
- package/dist/runtime/composables/useTimelineView.d.ts +4 -0
- package/dist/runtime/composables/useTimelineView.js +45 -11
- package/dist/runtime/composables/useWindowManager.d.ts +4 -0
- package/dist/runtime/composables/useWindowManager.js +11 -0
- package/dist/runtime/utils/dateField.d.ts +17 -0
- package/dist/runtime/utils/dateField.js +19 -0
- package/dist/runtime/utils/itemLabel.d.ts +27 -0
- package/dist/runtime/utils/itemLabel.js +8 -0
- package/dist/runtime/utils/localDate.d.ts +15 -0
- package/dist/runtime/utils/localDate.js +16 -0
- package/dist/runtime/utils/lucideIcons.d.ts +16 -10
- package/dist/runtime/utils/lucideIcons.js +1391 -69
- package/dist/runtime/utils/resolveDocColor.d.ts +7 -0
- package/dist/runtime/utils/resolveDocColor.js +32 -0
- package/dist/runtime/utils/resolveDocIcon.d.ts +10 -0
- package/dist/runtime/utils/resolveDocIcon.js +44 -0
- package/dist/runtime/utils/rowEdges.d.ts +22 -0
- package/dist/runtime/utils/rowEdges.js +29 -0
- package/package.json +1 -1
|
@@ -45,8 +45,8 @@ type __VLS_Props = {
|
|
|
45
45
|
formulaRefMode: boolean;
|
|
46
46
|
formulaRefHighlights: Map<string, string>;
|
|
47
47
|
fillPreview: {
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
fromCol: number;
|
|
49
|
+
toCol: number;
|
|
50
50
|
fromRow: number;
|
|
51
51
|
toRow: number;
|
|
52
52
|
} | null;
|
|
@@ -76,8 +76,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
|
76
76
|
formulaRefDragStart: (colIdx: number, rowIdx: number) => any;
|
|
77
77
|
formulaRefDragMove: (colIdx: number, rowIdx: number) => any;
|
|
78
78
|
formulaRefDragEnd: () => any;
|
|
79
|
-
fillDragStart: (rowIdx: number) => any;
|
|
80
|
-
fillDragMove: (rowIdx: number) => any;
|
|
79
|
+
fillDragStart: (rowIdx: number, colIdx: number) => any;
|
|
80
|
+
fillDragMove: (rowIdx: number, colIdx: number) => any;
|
|
81
81
|
fillDragEnd: () => any;
|
|
82
82
|
autoFitColumn: (colId: string) => any;
|
|
83
83
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
@@ -102,8 +102,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
|
102
102
|
onFormulaRefDragStart?: ((colIdx: number, rowIdx: number) => any) | undefined;
|
|
103
103
|
onFormulaRefDragMove?: ((colIdx: number, rowIdx: number) => any) | undefined;
|
|
104
104
|
onFormulaRefDragEnd?: (() => any) | undefined;
|
|
105
|
-
onFillDragStart?: ((rowIdx: number) => any) | undefined;
|
|
106
|
-
onFillDragMove?: ((rowIdx: number) => any) | undefined;
|
|
105
|
+
onFillDragStart?: ((rowIdx: number, colIdx: number) => any) | undefined;
|
|
106
|
+
onFillDragMove?: ((rowIdx: number, colIdx: number) => any) | undefined;
|
|
107
107
|
onFillDragEnd?: (() => any) | undefined;
|
|
108
108
|
onAutoFitColumn?: ((colId: string) => any) | undefined;
|
|
109
109
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -303,12 +303,30 @@ function rowIndexAtY(clientX, clientY) {
|
|
|
303
303
|
}
|
|
304
304
|
return max;
|
|
305
305
|
}
|
|
306
|
+
function colIndexAtX(clientX, clientY) {
|
|
307
|
+
const hit = cellAtPoint(clientX, clientY);
|
|
308
|
+
if (hit) return hit.colIdx;
|
|
309
|
+
const el = scrollRef.value;
|
|
310
|
+
const cols = props.columnPositions;
|
|
311
|
+
const max = Math.max(0, cols.length - 1);
|
|
312
|
+
if (!el || max < 0) return 0;
|
|
313
|
+
const rect = el.getBoundingClientRect();
|
|
314
|
+
const relX = clientX - rect.left - ROW_HEADER_WIDTH + el.scrollLeft;
|
|
315
|
+
if (relX <= 0) return 0;
|
|
316
|
+
for (let i = 0; i <= max; i++) {
|
|
317
|
+
const c = cols[i];
|
|
318
|
+
if (c && relX < c.start + c.size) return i;
|
|
319
|
+
}
|
|
320
|
+
return max;
|
|
321
|
+
}
|
|
306
322
|
const fillPreviewStyle = computed(() => {
|
|
307
323
|
const p = props.fillPreview;
|
|
308
324
|
if (!p) return null;
|
|
309
|
-
const
|
|
310
|
-
const
|
|
311
|
-
if (!
|
|
325
|
+
const fromColPos = props.columnPositions[p.fromCol];
|
|
326
|
+
const toColPos = props.columnPositions[p.toCol];
|
|
327
|
+
if (!fromColPos || !toColPos) return null;
|
|
328
|
+
const left = fromColPos.start;
|
|
329
|
+
const right = toColPos.start + toColPos.size;
|
|
312
330
|
let top;
|
|
313
331
|
let bottom;
|
|
314
332
|
const vFrom = virtualRows.value.find((r) => r.index === p.fromRow);
|
|
@@ -328,8 +346,8 @@ const fillPreviewStyle = computed(() => {
|
|
|
328
346
|
return {
|
|
329
347
|
position: "absolute",
|
|
330
348
|
top: `${top + props.defaultRowHeight}px`,
|
|
331
|
-
left: `${
|
|
332
|
-
width: `${
|
|
349
|
+
left: `${left + ROW_HEADER_WIDTH}px`,
|
|
350
|
+
width: `${right - left}px`,
|
|
333
351
|
height: `${bottom - top}px`,
|
|
334
352
|
border: "1.5px dashed var(--ui-primary)",
|
|
335
353
|
backgroundColor: "color-mix(in oklab, var(--ui-primary) 8%, transparent)",
|
|
@@ -343,7 +361,7 @@ function onFillHandleDown(e) {
|
|
|
343
361
|
const ac = props.activeCell;
|
|
344
362
|
if (!ac) return;
|
|
345
363
|
fillDragging.value = true;
|
|
346
|
-
emit("fillDragStart", ac.rowIdx);
|
|
364
|
+
emit("fillDragStart", ac.rowIdx, ac.colIdx);
|
|
347
365
|
const pointerId = e.pointerId;
|
|
348
366
|
const target = e.target;
|
|
349
367
|
target.setPointerCapture?.(pointerId);
|
|
@@ -351,7 +369,7 @@ function onFillHandleDown(e) {
|
|
|
351
369
|
if (ev.pointerId !== pointerId) return;
|
|
352
370
|
ev.preventDefault();
|
|
353
371
|
autoScrollNearEdge(ev.clientX, ev.clientY);
|
|
354
|
-
emit("fillDragMove", rowIndexAtY(ev.clientX, ev.clientY));
|
|
372
|
+
emit("fillDragMove", rowIndexAtY(ev.clientX, ev.clientY), colIndexAtX(ev.clientX, ev.clientY));
|
|
355
373
|
};
|
|
356
374
|
const onEnd = (ev) => {
|
|
357
375
|
if (ev.pointerId !== pointerId) return;
|
|
@@ -45,8 +45,8 @@ type __VLS_Props = {
|
|
|
45
45
|
formulaRefMode: boolean;
|
|
46
46
|
formulaRefHighlights: Map<string, string>;
|
|
47
47
|
fillPreview: {
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
fromCol: number;
|
|
49
|
+
toCol: number;
|
|
50
50
|
fromRow: number;
|
|
51
51
|
toRow: number;
|
|
52
52
|
} | null;
|
|
@@ -76,8 +76,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
|
76
76
|
formulaRefDragStart: (colIdx: number, rowIdx: number) => any;
|
|
77
77
|
formulaRefDragMove: (colIdx: number, rowIdx: number) => any;
|
|
78
78
|
formulaRefDragEnd: () => any;
|
|
79
|
-
fillDragStart: (rowIdx: number) => any;
|
|
80
|
-
fillDragMove: (rowIdx: number) => any;
|
|
79
|
+
fillDragStart: (rowIdx: number, colIdx: number) => any;
|
|
80
|
+
fillDragMove: (rowIdx: number, colIdx: number) => any;
|
|
81
81
|
fillDragEnd: () => any;
|
|
82
82
|
autoFitColumn: (colId: string) => any;
|
|
83
83
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
@@ -102,8 +102,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
|
102
102
|
onFormulaRefDragStart?: ((colIdx: number, rowIdx: number) => any) | undefined;
|
|
103
103
|
onFormulaRefDragMove?: ((colIdx: number, rowIdx: number) => any) | undefined;
|
|
104
104
|
onFormulaRefDragEnd?: (() => any) | undefined;
|
|
105
|
-
onFillDragStart?: ((rowIdx: number) => any) | undefined;
|
|
106
|
-
onFillDragMove?: ((rowIdx: number) => any) | undefined;
|
|
105
|
+
onFillDragStart?: ((rowIdx: number, colIdx: number) => any) | undefined;
|
|
106
|
+
onFillDragMove?: ((rowIdx: number, colIdx: number) => any) | undefined;
|
|
107
107
|
onFillDragEnd?: (() => any) | undefined;
|
|
108
108
|
onAutoFitColumn?: ((colId: string) => any) | undefined;
|
|
109
109
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -10,17 +10,17 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
10
10
|
cut: () => any;
|
|
11
11
|
paste: () => any;
|
|
12
12
|
clear: () => any;
|
|
13
|
-
edit: () => any;
|
|
14
13
|
toggleBold: () => any;
|
|
15
14
|
toggleItalic: () => any;
|
|
15
|
+
edit: () => any;
|
|
16
16
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
17
17
|
onCopy?: (() => any) | undefined;
|
|
18
18
|
onCut?: (() => any) | undefined;
|
|
19
19
|
onPaste?: (() => any) | undefined;
|
|
20
20
|
onClear?: (() => any) | undefined;
|
|
21
|
-
onEdit?: (() => any) | undefined;
|
|
22
21
|
onToggleBold?: (() => any) | undefined;
|
|
23
22
|
onToggleItalic?: (() => any) | undefined;
|
|
23
|
+
onEdit?: (() => any) | undefined;
|
|
24
24
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
25
25
|
declare const _default: typeof __VLS_export;
|
|
26
26
|
export default _default;
|
|
@@ -10,17 +10,17 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
10
10
|
cut: () => any;
|
|
11
11
|
paste: () => any;
|
|
12
12
|
clear: () => any;
|
|
13
|
-
edit: () => any;
|
|
14
13
|
toggleBold: () => any;
|
|
15
14
|
toggleItalic: () => any;
|
|
15
|
+
edit: () => any;
|
|
16
16
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
17
17
|
onCopy?: (() => any) | undefined;
|
|
18
18
|
onCut?: (() => any) | undefined;
|
|
19
19
|
onPaste?: (() => any) | undefined;
|
|
20
20
|
onClear?: (() => any) | undefined;
|
|
21
|
-
onEdit?: (() => any) | undefined;
|
|
22
21
|
onToggleBold?: (() => any) | undefined;
|
|
23
22
|
onToggleItalic?: (() => any) | undefined;
|
|
23
|
+
onEdit?: (() => any) | undefined;
|
|
24
24
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
25
25
|
declare const _default: typeof __VLS_export;
|
|
26
26
|
export default _default;
|
|
@@ -15,6 +15,10 @@ type __VLS_Props = {
|
|
|
15
15
|
selectionTextColor: string | undefined;
|
|
16
16
|
selectionBgColor: string | undefined;
|
|
17
17
|
selectionNumberFormat: string | undefined;
|
|
18
|
+
selectionNumberDecimals: number | undefined;
|
|
19
|
+
selectionNumberCurrency: string | undefined;
|
|
20
|
+
selectionNumberThousands: boolean | undefined;
|
|
21
|
+
selectionNumberNegativeRed: boolean | undefined;
|
|
18
22
|
labels?: Partial<AbracadabraLocale['renderers']['sheets']>;
|
|
19
23
|
};
|
|
20
24
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
@@ -30,6 +34,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
30
34
|
setBgColor: (color: string | undefined) => any;
|
|
31
35
|
setAlign: (align: string) => any;
|
|
32
36
|
setNumberFormat: (format: string | undefined) => any;
|
|
37
|
+
setFormatOption: (key: string, value: unknown) => any;
|
|
33
38
|
openFind: () => any;
|
|
34
39
|
openConditional: () => any;
|
|
35
40
|
openValidation: () => any;
|
|
@@ -46,6 +51,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
46
51
|
onSetBgColor?: ((color: string | undefined) => any) | undefined;
|
|
47
52
|
onSetAlign?: ((align: string) => any) | undefined;
|
|
48
53
|
onSetNumberFormat?: ((format: string | undefined) => any) | undefined;
|
|
54
|
+
onSetFormatOption?: ((key: string, value: unknown) => any) | undefined;
|
|
49
55
|
onOpenFind?: (() => any) | undefined;
|
|
50
56
|
onOpenConditional?: (() => any) | undefined;
|
|
51
57
|
onOpenValidation?: (() => any) | undefined;
|
|
@@ -17,15 +17,22 @@ const props = defineProps({
|
|
|
17
17
|
selectionTextColor: { type: null, required: true },
|
|
18
18
|
selectionBgColor: { type: null, required: true },
|
|
19
19
|
selectionNumberFormat: { type: null, required: true },
|
|
20
|
+
selectionNumberDecimals: { type: null, required: true },
|
|
21
|
+
selectionNumberCurrency: { type: null, required: true },
|
|
22
|
+
selectionNumberThousands: { type: Boolean, required: true, skipCheck: true },
|
|
23
|
+
selectionNumberNegativeRed: { type: Boolean, required: true, skipCheck: true },
|
|
20
24
|
labels: { type: Object, required: false }
|
|
21
25
|
});
|
|
22
|
-
const emit = defineEmits(["addColumn", "addRow", "update:editValue", "commitFormulaBar", "cancelFormulaBar", "startEditFromBar", "toggleBold", "toggleItalic", "setTextColor", "setBgColor", "setAlign", "setNumberFormat", "openFind", "openConditional", "openValidation"]);
|
|
26
|
+
const emit = defineEmits(["addColumn", "addRow", "update:editValue", "commitFormulaBar", "cancelFormulaBar", "startEditFromBar", "toggleBold", "toggleItalic", "setTextColor", "setBgColor", "setAlign", "setNumberFormat", "setFormatOption", "openFind", "openConditional", "openValidation"]);
|
|
23
27
|
const config = useRuntimeConfig();
|
|
24
28
|
const locale = computed(() => ({
|
|
25
29
|
...DEFAULT_LOCALE.renderers.sheets,
|
|
26
30
|
...config.public?.abracadabra?.locale?.renderers?.sheets ?? {},
|
|
27
31
|
...props.labels ?? {}
|
|
28
32
|
}));
|
|
33
|
+
function lbl(key, fallback) {
|
|
34
|
+
return locale.value[key] ?? fallback;
|
|
35
|
+
}
|
|
29
36
|
const formulaBarRef = ref();
|
|
30
37
|
function onFormulaBarFocus() {
|
|
31
38
|
if (!props.editMode && props.activeCell) {
|
|
@@ -62,29 +69,35 @@ const COLOR_SWATCHES = [
|
|
|
62
69
|
"#93c5fd",
|
|
63
70
|
"#d8b4fe"
|
|
64
71
|
];
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
72
|
+
const FORMAT_TYPES = computed(() => [
|
|
73
|
+
{ value: void 0, label: locale.value.formatGeneral, icon: "i-lucide-hash" },
|
|
74
|
+
{ value: "number", label: locale.value.formatNumber, icon: "i-lucide-calculator" },
|
|
75
|
+
{ value: "currency", label: locale.value.formatCurrency, icon: "i-lucide-dollar-sign" },
|
|
76
|
+
{ value: "accounting", label: lbl("formatAccounting", "Accounting"), icon: "i-lucide-landmark" },
|
|
77
|
+
{ value: "percent", label: locale.value.formatPercent, icon: "i-lucide-percent" },
|
|
78
|
+
{ value: "scientific", label: lbl("formatScientific", "Scientific"), icon: "i-lucide-flask-conical" },
|
|
79
|
+
{ value: "date", label: locale.value.formatDate, icon: "i-lucide-calendar" },
|
|
80
|
+
{ value: "time", label: lbl("formatTime", "Time"), icon: "i-lucide-clock" },
|
|
81
|
+
{ value: "datetime", label: lbl("formatDatetime", "Date & time"), icon: "i-lucide-calendar-clock" }
|
|
73
82
|
]);
|
|
83
|
+
const CURRENCIES = ["USD", "EUR", "GBP", "JPY", "CHF", "CAD", "AUD", "CNY", "INR", "BRL", "SEK", "NOK"];
|
|
74
84
|
const numberFormatLabel = computed(() => {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
return locale.value.formatPercent;
|
|
82
|
-
case "date":
|
|
83
|
-
return locale.value.formatDate;
|
|
84
|
-
default:
|
|
85
|
-
return locale.value.formatGeneral;
|
|
86
|
-
}
|
|
85
|
+
const f = FORMAT_TYPES.value.find((ft) => ft.value === props.selectionNumberFormat);
|
|
86
|
+
return f ? f.label : locale.value.formatGeneral;
|
|
87
|
+
});
|
|
88
|
+
const isNumeric = computed(() => {
|
|
89
|
+
const f = props.selectionNumberFormat;
|
|
90
|
+
return f === "number" || f === "currency" || f === "accounting" || f === "percent" || f === "scientific";
|
|
87
91
|
});
|
|
92
|
+
const isCurrencyKind = computed(() => props.selectionNumberFormat === "currency" || props.selectionNumberFormat === "accounting");
|
|
93
|
+
const decimals = computed(() => props.selectionNumberDecimals ?? 2);
|
|
94
|
+
function setFormatType(value) {
|
|
95
|
+
emit("setNumberFormat", value);
|
|
96
|
+
}
|
|
97
|
+
function adjustDecimals(delta) {
|
|
98
|
+
const next = Math.max(0, Math.min(10, decimals.value + delta));
|
|
99
|
+
emit("setFormatOption", "numberDecimals", next);
|
|
100
|
+
}
|
|
88
101
|
</script>
|
|
89
102
|
|
|
90
103
|
<template>
|
|
@@ -210,7 +223,7 @@ const numberFormatLabel = computed(() => {
|
|
|
210
223
|
|
|
211
224
|
<!-- Number format -->
|
|
212
225
|
<div class="border-l border-(--ui-border) pl-1 ml-0.5">
|
|
213
|
-
<
|
|
226
|
+
<UPopover>
|
|
214
227
|
<UButton
|
|
215
228
|
size="xs"
|
|
216
229
|
variant="ghost"
|
|
@@ -218,7 +231,101 @@ const numberFormatLabel = computed(() => {
|
|
|
218
231
|
:label="numberFormatLabel"
|
|
219
232
|
trailing-icon="i-lucide-chevron-down"
|
|
220
233
|
/>
|
|
221
|
-
|
|
234
|
+
<template #content>
|
|
235
|
+
<div class="p-2 w-56 space-y-2">
|
|
236
|
+
<!-- Format type list -->
|
|
237
|
+
<div class="grid grid-cols-1 gap-0.5">
|
|
238
|
+
<button
|
|
239
|
+
v-for="ft in FORMAT_TYPES"
|
|
240
|
+
:key="ft.label"
|
|
241
|
+
class="flex items-center gap-2 px-2 py-1 rounded text-sm text-left hover:bg-(--ui-bg-elevated)"
|
|
242
|
+
:class="(selectionNumberFormat ?? void 0) === ft.value ? 'bg-(--ui-primary)/10 text-(--ui-primary)' : ''"
|
|
243
|
+
@click="setFormatType(ft.value)"
|
|
244
|
+
>
|
|
245
|
+
<UIcon
|
|
246
|
+
:name="ft.icon"
|
|
247
|
+
class="size-4 shrink-0"
|
|
248
|
+
/>
|
|
249
|
+
<span class="flex-1">{{ ft.label }}</span>
|
|
250
|
+
<UIcon
|
|
251
|
+
v-if="(selectionNumberFormat ?? void 0) === ft.value"
|
|
252
|
+
name="i-lucide-check"
|
|
253
|
+
class="size-3.5"
|
|
254
|
+
/>
|
|
255
|
+
</button>
|
|
256
|
+
</div>
|
|
257
|
+
|
|
258
|
+
<!-- Numeric options -->
|
|
259
|
+
<div
|
|
260
|
+
v-if="isNumeric"
|
|
261
|
+
class="border-t border-(--ui-border) pt-2 space-y-1.5"
|
|
262
|
+
>
|
|
263
|
+
<!-- Decimals -->
|
|
264
|
+
<div class="flex items-center justify-between gap-2">
|
|
265
|
+
<span class="text-xs text-(--ui-text-muted)">{{ lbl("decimals", "Decimals") }}</span>
|
|
266
|
+
<div class="flex items-center gap-1">
|
|
267
|
+
<UButton
|
|
268
|
+
icon="i-lucide-minus"
|
|
269
|
+
size="xs"
|
|
270
|
+
variant="ghost"
|
|
271
|
+
:aria-label="lbl('decreaseDecimals', 'Decrease decimals')"
|
|
272
|
+
@click="adjustDecimals(-1)"
|
|
273
|
+
/>
|
|
274
|
+
<span class="w-5 text-center text-xs tabular-nums">{{ decimals }}</span>
|
|
275
|
+
<UButton
|
|
276
|
+
icon="i-lucide-plus"
|
|
277
|
+
size="xs"
|
|
278
|
+
variant="ghost"
|
|
279
|
+
:aria-label="lbl('increaseDecimals', 'Increase decimals')"
|
|
280
|
+
@click="adjustDecimals(1)"
|
|
281
|
+
/>
|
|
282
|
+
</div>
|
|
283
|
+
</div>
|
|
284
|
+
|
|
285
|
+
<!-- Currency picker -->
|
|
286
|
+
<div
|
|
287
|
+
v-if="isCurrencyKind"
|
|
288
|
+
class="flex items-center justify-between gap-2"
|
|
289
|
+
>
|
|
290
|
+
<span class="text-xs text-(--ui-text-muted)">{{ lbl("currency", "Currency") }}</span>
|
|
291
|
+
<select
|
|
292
|
+
class="bg-(--ui-bg-elevated) rounded px-1.5 py-0.5 text-xs outline-none"
|
|
293
|
+
:value="selectionNumberCurrency ?? 'USD'"
|
|
294
|
+
@change="emit('setFormatOption', 'numberCurrency', $event.target.value)"
|
|
295
|
+
>
|
|
296
|
+
<option
|
|
297
|
+
v-for="c in CURRENCIES"
|
|
298
|
+
:key="c"
|
|
299
|
+
:value="c"
|
|
300
|
+
>
|
|
301
|
+
{{ c }}
|
|
302
|
+
</option>
|
|
303
|
+
</select>
|
|
304
|
+
</div>
|
|
305
|
+
|
|
306
|
+
<!-- Thousands separator -->
|
|
307
|
+
<label class="flex items-center justify-between gap-2 cursor-pointer">
|
|
308
|
+
<span class="text-xs text-(--ui-text-muted)">{{ lbl("thousandsSeparator", "Thousands separator") }}</span>
|
|
309
|
+
<USwitch
|
|
310
|
+
:model-value="!!selectionNumberThousands"
|
|
311
|
+
size="xs"
|
|
312
|
+
@update:model-value="emit('setFormatOption', 'numberThousands', $event)"
|
|
313
|
+
/>
|
|
314
|
+
</label>
|
|
315
|
+
|
|
316
|
+
<!-- Negative red -->
|
|
317
|
+
<label class="flex items-center justify-between gap-2 cursor-pointer">
|
|
318
|
+
<span class="text-xs text-(--ui-text-muted)">{{ lbl("negativeRed", "Show negatives in red") }}</span>
|
|
319
|
+
<USwitch
|
|
320
|
+
:model-value="!!selectionNumberNegativeRed"
|
|
321
|
+
size="xs"
|
|
322
|
+
@update:model-value="emit('setFormatOption', 'numberNegativeRed', $event)"
|
|
323
|
+
/>
|
|
324
|
+
</label>
|
|
325
|
+
</div>
|
|
326
|
+
</div>
|
|
327
|
+
</template>
|
|
328
|
+
</UPopover>
|
|
222
329
|
</div>
|
|
223
330
|
</div>
|
|
224
331
|
</template>
|
|
@@ -15,6 +15,10 @@ type __VLS_Props = {
|
|
|
15
15
|
selectionTextColor: string | undefined;
|
|
16
16
|
selectionBgColor: string | undefined;
|
|
17
17
|
selectionNumberFormat: string | undefined;
|
|
18
|
+
selectionNumberDecimals: number | undefined;
|
|
19
|
+
selectionNumberCurrency: string | undefined;
|
|
20
|
+
selectionNumberThousands: boolean | undefined;
|
|
21
|
+
selectionNumberNegativeRed: boolean | undefined;
|
|
18
22
|
labels?: Partial<AbracadabraLocale['renderers']['sheets']>;
|
|
19
23
|
};
|
|
20
24
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
@@ -30,6 +34,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
30
34
|
setBgColor: (color: string | undefined) => any;
|
|
31
35
|
setAlign: (align: string) => any;
|
|
32
36
|
setNumberFormat: (format: string | undefined) => any;
|
|
37
|
+
setFormatOption: (key: string, value: unknown) => any;
|
|
33
38
|
openFind: () => any;
|
|
34
39
|
openConditional: () => any;
|
|
35
40
|
openValidation: () => any;
|
|
@@ -46,6 +51,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
46
51
|
onSetBgColor?: ((color: string | undefined) => any) | undefined;
|
|
47
52
|
onSetAlign?: ((align: string) => any) | undefined;
|
|
48
53
|
onSetNumberFormat?: ((format: string | undefined) => any) | undefined;
|
|
54
|
+
onSetFormatOption?: ((key: string, value: unknown) => any) | undefined;
|
|
49
55
|
onOpenFind?: (() => any) | undefined;
|
|
50
56
|
onOpenConditional?: (() => any) | undefined;
|
|
51
57
|
onOpenValidation?: (() => any) | undefined;
|
|
@@ -8,12 +8,14 @@ defineProps({
|
|
|
8
8
|
|
|
9
9
|
<template>
|
|
10
10
|
<div class="h-10 relative border-b border-(--ui-border) sticky top-0 bg-(--ui-bg) z-10">
|
|
11
|
-
<!-- Coarse labels (top row)
|
|
11
|
+
<!-- Coarse labels (top row) — year/decade/month context, more prominent.
|
|
12
|
+
The active unit is pinned to the left edge (sticky) so it's always visible. -->
|
|
12
13
|
<div
|
|
13
14
|
v-for="(lbl, i) in labels.filter((l) => l.tier === 'coarse')"
|
|
14
15
|
:key="'c-' + i"
|
|
15
|
-
class="absolute top-0 text-[
|
|
16
|
-
:
|
|
16
|
+
class="absolute top-0 text-[11px] font-semibold text-(--ui-text-toned) whitespace-nowrap leading-[18px]"
|
|
17
|
+
:class="lbl.sticky ? 'z-20 px-1.5 rounded-sm bg-(--ui-bg)/90 backdrop-blur-sm' : 'px-1'"
|
|
18
|
+
:style="{ left: `${lbl.labelOffset ?? lbl.offset}px` }"
|
|
17
19
|
>
|
|
18
20
|
{{ lbl.label }}
|
|
19
21
|
</div>
|
|
@@ -31,14 +31,12 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
31
31
|
"bar-click": (id: string, label: string) => any;
|
|
32
32
|
"focus-item": (id: string) => any;
|
|
33
33
|
"unfocus-item": () => any;
|
|
34
|
-
"context-menu": (e: MouseEvent, id: string, label: string) => any;
|
|
35
34
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
36
35
|
"onBar-pointer-down"?: ((e: PointerEvent, id: string) => any) | undefined;
|
|
37
36
|
"onBar-resize-start"?: ((e: PointerEvent, id: string) => any) | undefined;
|
|
38
37
|
"onBar-click"?: ((id: string, label: string) => any) | undefined;
|
|
39
38
|
"onFocus-item"?: ((id: string) => any) | undefined;
|
|
40
39
|
"onUnfocus-item"?: (() => any) | undefined;
|
|
41
|
-
"onContext-menu"?: ((e: MouseEvent, id: string, label: string) => any) | undefined;
|
|
42
40
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
43
41
|
declare const _default: typeof __VLS_export;
|
|
44
42
|
export default _default;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
+
import { tlStart, tlEnd } from "../../../utils/dateField";
|
|
2
3
|
import ATimelineBar from "./ATimelineBar.vue";
|
|
3
4
|
import ATimelineMilestone from "./ATimelineMilestone.vue";
|
|
4
5
|
defineProps({
|
|
@@ -13,9 +14,10 @@ defineProps({
|
|
|
13
14
|
itemViewers: { type: Function, required: false },
|
|
14
15
|
editable: { type: Boolean, required: false }
|
|
15
16
|
});
|
|
16
|
-
const emit = defineEmits(["bar-pointer-down", "bar-resize-start", "bar-click", "focus-item", "unfocus-item"
|
|
17
|
+
const emit = defineEmits(["bar-pointer-down", "bar-resize-start", "bar-click", "focus-item", "unfocus-item"]);
|
|
17
18
|
function isMilestone(entry) {
|
|
18
|
-
|
|
19
|
+
const end = tlEnd(entry.meta);
|
|
20
|
+
return !end || end === tlStart(entry.meta);
|
|
19
21
|
}
|
|
20
22
|
</script>
|
|
21
23
|
|
|
@@ -33,13 +35,13 @@ function isMilestone(entry) {
|
|
|
33
35
|
<!-- Epic bar row -->
|
|
34
36
|
<div
|
|
35
37
|
class="h-10 relative border-b border-(--ui-border)"
|
|
36
|
-
|
|
38
|
+
:data-tl-item="epic.id"
|
|
37
39
|
>
|
|
38
|
-
<template v-if="epic.meta
|
|
40
|
+
<template v-if="tlStart(epic.meta)">
|
|
39
41
|
<ATimelineMilestone
|
|
40
42
|
v-if="isMilestone(epic)"
|
|
41
43
|
:entry="epic"
|
|
42
|
-
:left="dateToX(epic.meta
|
|
44
|
+
:left="dateToX(tlStart(epic.meta))"
|
|
43
45
|
:color="epic.meta?.color ?? '#6366f1'"
|
|
44
46
|
:is-dragging="barDragId === epic.id"
|
|
45
47
|
:focusers="itemFocusers(epic.id)"
|
|
@@ -50,10 +52,10 @@ function isMilestone(entry) {
|
|
|
50
52
|
@click="emit('bar-click', epic.id, epic.label)"
|
|
51
53
|
/>
|
|
52
54
|
<ATimelineBar
|
|
53
|
-
v-else-if="epic.meta
|
|
55
|
+
v-else-if="tlEnd(epic.meta)"
|
|
54
56
|
:entry="epic"
|
|
55
|
-
:left="dateToX(epic.meta
|
|
56
|
-
:width="spanWidth(epic.meta
|
|
57
|
+
:left="dateToX(tlStart(epic.meta))"
|
|
58
|
+
:width="spanWidth(tlStart(epic.meta), tlEnd(epic.meta))"
|
|
57
59
|
:color="epic.meta?.color ?? '#6366f1'"
|
|
58
60
|
:is-dragging="barDragId === epic.id"
|
|
59
61
|
:focusers="itemFocusers(epic.id)"
|
|
@@ -72,13 +74,13 @@ function isMilestone(entry) {
|
|
|
72
74
|
v-for="task in tree.childrenOf(epic.id)"
|
|
73
75
|
:key="task.id"
|
|
74
76
|
class="h-9 relative border-b border-(--ui-border)"
|
|
75
|
-
|
|
77
|
+
:data-tl-item="task.id"
|
|
76
78
|
>
|
|
77
|
-
<template v-if="task.meta
|
|
79
|
+
<template v-if="tlStart(task.meta)">
|
|
78
80
|
<ATimelineMilestone
|
|
79
81
|
v-if="isMilestone(task)"
|
|
80
82
|
:entry="task"
|
|
81
|
-
:left="dateToX(task.meta
|
|
83
|
+
:left="dateToX(tlStart(task.meta))"
|
|
82
84
|
:color="task.meta?.color ?? '#818cf8'"
|
|
83
85
|
:is-dragging="barDragId === task.id"
|
|
84
86
|
:focusers="itemFocusers(task.id)"
|
|
@@ -89,10 +91,10 @@ function isMilestone(entry) {
|
|
|
89
91
|
@click="emit('bar-click', task.id, task.label)"
|
|
90
92
|
/>
|
|
91
93
|
<ATimelineBar
|
|
92
|
-
v-else-if="task.meta
|
|
94
|
+
v-else-if="tlEnd(task.meta)"
|
|
93
95
|
:entry="task"
|
|
94
|
-
:left="dateToX(task.meta
|
|
95
|
-
:width="spanWidth(task.meta
|
|
96
|
+
:left="dateToX(tlStart(task.meta))"
|
|
97
|
+
:width="spanWidth(tlStart(task.meta), tlEnd(task.meta))"
|
|
96
98
|
:color="task.meta?.color ?? '#818cf8'"
|
|
97
99
|
is-task
|
|
98
100
|
:is-dragging="barDragId === task.id"
|
|
@@ -31,14 +31,12 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
31
31
|
"bar-click": (id: string, label: string) => any;
|
|
32
32
|
"focus-item": (id: string) => any;
|
|
33
33
|
"unfocus-item": () => any;
|
|
34
|
-
"context-menu": (e: MouseEvent, id: string, label: string) => any;
|
|
35
34
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
36
35
|
"onBar-pointer-down"?: ((e: PointerEvent, id: string) => any) | undefined;
|
|
37
36
|
"onBar-resize-start"?: ((e: PointerEvent, id: string) => any) | undefined;
|
|
38
37
|
"onBar-click"?: ((id: string, label: string) => any) | undefined;
|
|
39
38
|
"onFocus-item"?: ((id: string) => any) | undefined;
|
|
40
39
|
"onUnfocus-item"?: (() => any) | undefined;
|
|
41
|
-
"onContext-menu"?: ((e: MouseEvent, id: string, label: string) => any) | undefined;
|
|
42
40
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
43
41
|
declare const _default: typeof __VLS_export;
|
|
44
42
|
export default _default;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { computed } from "vue";
|
|
3
3
|
import { useRuntimeConfig } from "#imports";
|
|
4
4
|
import { avatarBorderStyle } from "../../../utils/avatarStyle";
|
|
5
|
+
import { tlStart, tlEnd } from "../../../utils/dateField";
|
|
5
6
|
import { DEFAULT_LOCALE } from "../../../locale";
|
|
6
7
|
const props = defineProps({
|
|
7
8
|
epics: { type: Array, required: true },
|
|
@@ -75,7 +76,8 @@ function taskMenuItems(task) {
|
|
|
75
76
|
return items;
|
|
76
77
|
}
|
|
77
78
|
function isMilestone(entry) {
|
|
78
|
-
|
|
79
|
+
const end = tlEnd(entry.meta);
|
|
80
|
+
return !end || end === tlStart(entry.meta);
|
|
79
81
|
}
|
|
80
82
|
</script>
|
|
81
83
|
|
|
@@ -159,7 +161,7 @@ function isMilestone(entry) {
|
|
|
159
161
|
<span
|
|
160
162
|
v-else
|
|
161
163
|
class="truncate flex-1"
|
|
162
|
-
>{{ epic.label }}</span>
|
|
164
|
+
>{{ epic.label || tt.untitled }}</span>
|
|
163
165
|
</button>
|
|
164
166
|
</ANodeContextMenu>
|
|
165
167
|
|