@katlux/toolkit 0.1.1-alpha.146 → 0.1.1-alpha.147
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 +32 -22
- package/bin/ai-init.mjs +71 -13
- package/bin/ai-tokens/adapters/antigravityAdapter.mjs +22 -0
- package/bin/ai-tokens/adapters/claudeCodeAdapter.mjs +192 -0
- package/bin/ai-tokens/adapters/codexAdapter.mjs +176 -0
- package/bin/ai-tokens/adapters/cursorAdapter.mjs +202 -0
- package/bin/ai-tokens/adapters/index.mjs +30 -0
- package/bin/ai-tokens/cliViews.mjs +301 -0
- package/bin/ai-tokens/formatAndDates.mjs +89 -0
- package/bin/ai-tokens/reportGenerator.mjs +232 -0
- package/bin/ai-tokens/transcriptParser.mjs +299 -0
- package/bin/ai-tokens.mjs +38 -1030
- package/bin/cli.mjs +14 -10
- package/bin/preset-contracts.json +66 -10
- package/dist/compiled/composables/locales/asianAndPacific.mjs +296 -0
- package/dist/compiled/composables/locales/northernAndEasternEuropean.mjs +342 -0
- package/dist/compiled/composables/locales/westernEuropean.mjs +268 -0
- package/dist/compiled/composables/locales.mjs +28 -895
- package/dist/compiled/composables/useDataProvider.mjs +3 -1
- package/dist/compiled/composables/useKatluxForm.mjs +7 -7
- package/dist/compiled/composables/usePresetComponent.mjs +2 -0
- package/dist/compiled/composables/useRequestQueue.mjs +3 -1
- package/dist/compiled/composables/useVirtualDataset.mjs +322 -354
- package/dist/compiled/composables/useVirtualScroll.mjs +69 -62
- package/dist/compiled/composables/virtualDataset/cacheStateHelpers.mjs +76 -0
- package/dist/compiled/composables/virtualDataset/keyboardNavHelpers.mjs +60 -0
- package/dist/compiled/composables/virtualDataset/treeSelectionHelpers.mjs +103 -0
- package/dist/compiled/composables/virtualDataset/types.mjs +0 -0
- package/dist/compiled/utils/deprecation.mjs +44 -0
- package/dist/compiled/utils/dom.mjs +124 -0
- package/dist/module.cjs +0 -5
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -6
- package/dist/runtime/app.config.d.ts +3 -0
- package/dist/runtime/components/KAccordion/KAccordion.global.d.vue.ts +1 -1
- package/dist/runtime/components/KAccordion/KAccordion.global.vue.d.ts +1 -1
- package/dist/runtime/components/KBulkActions/KBulkActions.logic.d.ts +8 -0
- package/dist/runtime/components/KBulkActions/KBulkActions.logic.js +21 -55
- package/dist/runtime/components/KButton/KButton.global.d.vue.ts +2 -2
- package/dist/runtime/components/KButton/KButton.global.vue.d.ts +2 -2
- package/dist/runtime/components/KButton/KButton.logic.d.ts +1 -1
- package/dist/runtime/components/KCalendar/KCalendar.global.d.vue.ts +4 -4
- package/dist/runtime/components/KCalendar/KCalendar.global.vue.d.ts +4 -4
- package/dist/runtime/components/KCalendar/KCalendar.logic.js +8 -4
- package/dist/runtime/components/KCalendar/KCalendarMonth.global.vue +4 -0
- package/dist/runtime/components/KCalendar/KCalendarMonth.logic.d.ts +2 -0
- package/dist/runtime/components/KCalendar/KCalendarMonth.logic.js +41 -26
- package/dist/runtime/components/KCalendar/recurringUtils.js +6 -5
- package/dist/runtime/components/KCheckbox/KCheckbox.global.d.vue.ts +1 -1
- package/dist/runtime/components/KCheckbox/KCheckbox.global.vue.d.ts +1 -1
- package/dist/runtime/components/KCombobox/KCombobox.global.d.vue.ts +17 -2
- package/dist/runtime/components/KCombobox/KCombobox.global.vue +9 -4
- package/dist/runtime/components/KCombobox/KCombobox.global.vue.d.ts +17 -2
- package/dist/runtime/components/KCombobox/KCombobox.logic.d.ts +10 -2
- package/dist/runtime/components/KCombobox/KCombobox.logic.js +32 -13
- package/dist/runtime/components/KCompositeInput/KCompositeInput.global.d.vue.ts +7 -7
- package/dist/runtime/components/KCompositeInput/KCompositeInput.global.vue.d.ts +7 -7
- package/dist/runtime/components/KCompositeInput/KCompositeInput.logic.d.ts +3 -3
- package/dist/runtime/components/KContextMenu/KContextMenu.global.d.vue.ts +3 -3
- package/dist/runtime/components/KContextMenu/KContextMenu.global.vue +4 -1
- package/dist/runtime/components/KContextMenu/KContextMenu.global.vue.d.ts +3 -3
- package/dist/runtime/components/KContextMenu/KContextMenu.logic.d.ts +24 -4
- package/dist/runtime/components/KContextMenu/KContextMenu.logic.js +43 -27
- package/dist/runtime/components/KDatatable/KDataIterator.global.d.vue.ts +25 -2
- package/dist/runtime/components/KDatatable/KDataIterator.global.vue +19 -7
- package/dist/runtime/components/KDatatable/KDataIterator.global.vue.d.ts +25 -2
- package/dist/runtime/components/KDatatable/KDataIterator.logic.d.ts +20 -0
- package/dist/runtime/components/KDatatable/KDataIterator.logic.js +54 -14
- package/dist/runtime/components/KDatatable/KDatatable.global.d.vue.ts +1 -1
- package/dist/runtime/components/KDatatable/KDatatable.global.vue.d.ts +1 -1
- package/dist/runtime/components/KDatatable/KDatatable.logic.js +6 -5
- package/dist/runtime/components/KDatePicker/KDatePicker.global.d.vue.ts +5 -3
- package/dist/runtime/components/KDatePicker/KDatePicker.global.vue +45 -26
- package/dist/runtime/components/KDatePicker/KDatePicker.global.vue.d.ts +5 -3
- package/dist/runtime/components/KDatePicker/KDatePicker.logic.d.ts +2 -0
- package/dist/runtime/components/KDatePicker/KDatePicker.logic.js +66 -20
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.d.vue.ts +2 -2
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.vue.d.ts +2 -2
- package/dist/runtime/components/KDropdown/KDropdown.global.d.vue.ts +4 -4
- package/dist/runtime/components/KDropdown/KDropdown.global.vue.d.ts +4 -4
- package/dist/runtime/components/KDropdown/KDropdown.logic.d.ts +3 -2
- package/dist/runtime/components/KDropdown/KDropdown.logic.js +14 -13
- package/dist/runtime/components/KGantt/KGantt.global.d.vue.ts +3 -1
- package/dist/runtime/components/KGantt/KGantt.global.vue +7 -1
- package/dist/runtime/components/KGantt/KGantt.global.vue.d.ts +3 -1
- package/dist/runtime/components/KGrid/KGrid.global.d.vue.ts +1 -1
- package/dist/runtime/components/KGrid/KGrid.global.vue.d.ts +1 -1
- package/dist/runtime/components/KHourPicker/KHourPicker.global.d.vue.ts +1 -1
- package/dist/runtime/components/KHourPicker/KHourPicker.global.vue.d.ts +1 -1
- package/dist/runtime/components/KIcon/KIcon.global.d.vue.ts +1 -1
- package/dist/runtime/components/KIcon/KIcon.global.vue.d.ts +1 -1
- package/dist/runtime/components/KLayout/KLayout.global.d.vue.ts +4 -1
- package/dist/runtime/components/KLayout/KLayout.global.vue +4 -1
- package/dist/runtime/components/KLayout/KLayout.global.vue.d.ts +4 -1
- package/dist/runtime/components/KLoader/KLoader.global.d.vue.ts +9 -0
- package/dist/runtime/components/KLoader/KLoader.global.vue +1 -0
- package/dist/runtime/components/KLoader/KLoader.global.vue.d.ts +9 -0
- package/dist/runtime/components/KLoader/KLoader.logic.d.ts +5 -0
- package/dist/runtime/components/KLoader/KLoader.logic.js +4 -0
- package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.d.vue.ts +1 -1
- package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.vue.d.ts +1 -1
- package/dist/runtime/components/KMaskTextbox/KMaskTextbox.logic.js +30 -7
- package/dist/runtime/components/KMultiTabs/KMultiTabs.logic.d.ts +1 -0
- package/dist/runtime/components/KMultiTabs/MultiTabs.global.vue +6 -4
- package/dist/runtime/components/KPagination/KPagination.logic.d.ts +1 -1
- package/dist/runtime/components/KPagination/KPagination.logic.js +17 -9
- package/dist/runtime/components/KRadiobox/KRadiobox.global.d.vue.ts +1 -1
- package/dist/runtime/components/KRadiobox/KRadiobox.global.vue.d.ts +1 -1
- package/dist/runtime/components/KTabs/KTabs.logic.js +33 -11
- package/dist/runtime/components/KTextarea/KTextarea.global.d.vue.ts +2 -2
- package/dist/runtime/components/KTextarea/KTextarea.global.vue.d.ts +2 -2
- package/dist/runtime/components/KTextbox/KTextbox.global.d.vue.ts +14 -3
- package/dist/runtime/components/KTextbox/KTextbox.global.vue +8 -2
- package/dist/runtime/components/KTextbox/KTextbox.global.vue.d.ts +14 -3
- package/dist/runtime/components/KTextbox/KTextbox.logic.d.ts +5 -0
- package/dist/runtime/components/KTextbox/KTextbox.logic.js +4 -0
- package/dist/runtime/components/KTooltip/KTooltip.global.d.vue.ts +1 -1
- package/dist/runtime/components/KTooltip/KTooltip.global.vue.d.ts +1 -1
- package/dist/runtime/components/KTooltip/KTooltip.logic.d.ts +11 -2
- package/dist/runtime/components/KTooltip/KTooltip.logic.js +7 -5
- package/dist/runtime/components/KTree/KTree.global.d.vue.ts +1 -1
- package/dist/runtime/components/KTree/KTree.global.vue.d.ts +1 -1
- package/dist/runtime/components/KTree/KTree.logic.js +21 -1
- package/dist/runtime/components/KTreePicker/KTreePicker.global.d.vue.ts +8 -4
- package/dist/runtime/components/KTreePicker/KTreePicker.global.vue +4 -2
- package/dist/runtime/components/KTreePicker/KTreePicker.global.vue.d.ts +8 -4
- package/dist/runtime/components/KTreePicker/KTreePicker.logic.d.ts +3 -2
- package/dist/runtime/components/KTreePicker/KTreePicker.logic.js +10 -1
- package/dist/runtime/components/KTreeView/KTreeView.global.d.vue.ts +3 -3
- package/dist/runtime/components/KTreeView/KTreeView.global.vue.d.ts +3 -3
- package/dist/runtime/components/KTreeView/KTreeView.logic.d.ts +1 -1
- package/dist/runtime/components/KTreeView/KTreeView.logic.js +36 -12
- package/dist/runtime/composables/locales/asianAndPacific.d.ts +11 -0
- package/dist/runtime/composables/locales/asianAndPacific.js +296 -0
- package/dist/runtime/composables/locales/northernAndEasternEuropean.d.ts +12 -0
- package/dist/runtime/composables/locales/northernAndEasternEuropean.js +342 -0
- package/dist/runtime/composables/locales/westernEuropean.d.ts +10 -0
- package/dist/runtime/composables/locales/westernEuropean.js +268 -0
- package/dist/runtime/composables/locales.d.ts +4 -24
- package/dist/runtime/composables/locales.js +28 -895
- package/dist/runtime/composables/useDataProvider.js +3 -1
- package/dist/runtime/composables/useKatluxForm.js +7 -7
- package/dist/runtime/composables/usePresetComponent.js +2 -0
- package/dist/runtime/composables/useRequestQueue.d.ts +2 -0
- package/dist/runtime/composables/useRequestQueue.js +3 -1
- package/dist/runtime/composables/useVirtualDataset.d.ts +6 -118
- package/dist/runtime/composables/useVirtualDataset.js +322 -354
- package/dist/runtime/composables/useVirtualScroll.d.ts +9 -9
- package/dist/runtime/composables/useVirtualScroll.js +69 -62
- package/dist/runtime/composables/virtualDataset/cacheStateHelpers.d.ts +49 -0
- package/dist/runtime/composables/virtualDataset/cacheStateHelpers.js +76 -0
- package/dist/runtime/composables/virtualDataset/keyboardNavHelpers.d.ts +26 -0
- package/dist/runtime/composables/virtualDataset/keyboardNavHelpers.js +60 -0
- package/dist/runtime/composables/virtualDataset/treeSelectionHelpers.d.ts +24 -0
- package/dist/runtime/composables/virtualDataset/treeSelectionHelpers.js +103 -0
- package/dist/runtime/composables/virtualDataset/types.d.ts +113 -0
- package/dist/runtime/composables/virtualDataset/types.js +0 -0
- package/dist/runtime/directives/clickOutside.d.ts +1 -1
- package/dist/runtime/directives/clickOutside.js +41 -13
- package/dist/runtime/plugins/nuxtCompatPlugin.d.ts +2 -1
- package/dist/runtime/plugins/nuxtCompatPlugin.js +7 -0
- package/dist/runtime/plugins/toastPlugin.client.js +2 -2
- package/dist/runtime/presets/default/components/KCalendar/KCalendarMonth.d.vue.ts +2 -0
- package/dist/runtime/presets/default/components/KCalendar/KCalendarMonth.vue +24 -0
- package/dist/runtime/presets/default/components/KCalendar/KCalendarMonth.vue.d.ts +2 -0
- package/dist/runtime/presets/default/components/KCalendar/KCalendarWeek.vue +6 -5
- package/dist/runtime/presets/default/components/KCombobox/KCombobox.d.vue.ts +4 -1
- package/dist/runtime/presets/default/components/KCombobox/KCombobox.vue +27 -17
- package/dist/runtime/presets/default/components/KCombobox/KCombobox.vue.d.ts +4 -1
- package/dist/runtime/presets/default/components/KCombobox/KComboboxList.d.vue.ts +1 -1
- package/dist/runtime/presets/default/components/KCombobox/KComboboxList.vue +10 -10
- package/dist/runtime/presets/default/components/KCombobox/KComboboxList.vue.d.ts +1 -1
- package/dist/runtime/presets/default/components/KContextMenu/KContextMenu.d.vue.ts +2 -0
- package/dist/runtime/presets/default/components/KContextMenu/KContextMenu.vue +60 -21
- package/dist/runtime/presets/default/components/KContextMenu/KContextMenu.vue.d.ts +2 -0
- package/dist/runtime/presets/default/components/KDataIterator/KDataIterator.d.vue.ts +12 -1
- package/dist/runtime/presets/default/components/KDataIterator/KDataIterator.vue +109 -15
- package/dist/runtime/presets/default/components/KDataIterator/KDataIterator.vue.d.ts +12 -1
- package/dist/runtime/presets/default/components/KDatatable/KDatatable.d.vue.ts +1 -1
- package/dist/runtime/presets/default/components/KDatatable/KDatatable.vue +14 -0
- package/dist/runtime/presets/default/components/KDatatable/KDatatable.vue.d.ts +1 -1
- package/dist/runtime/presets/default/components/KDropdown/KDropdown.d.vue.ts +5 -2
- package/dist/runtime/presets/default/components/KDropdown/KDropdown.vue +15 -12
- package/dist/runtime/presets/default/components/KDropdown/KDropdown.vue.d.ts +5 -2
- package/dist/runtime/presets/default/components/KGantt/KGantt.d.vue.ts +10 -0
- package/dist/runtime/presets/default/components/KGantt/KGantt.vue +23 -69
- package/dist/runtime/presets/default/components/KGantt/KGantt.vue.d.ts +10 -0
- package/dist/runtime/presets/default/components/KGantt/KGanttTimeline.d.vue.ts +6 -2
- package/dist/runtime/presets/default/components/KGantt/KGanttTimeline.vue +22 -8
- package/dist/runtime/presets/default/components/KGantt/KGanttTimeline.vue.d.ts +6 -2
- package/dist/runtime/presets/default/components/KLayout/KLayout.vue +2 -2
- package/dist/runtime/presets/default/components/KLoader/KLoader.d.vue.ts +1 -0
- package/dist/runtime/presets/default/components/KLoader/KLoader.vue +13 -2
- package/dist/runtime/presets/default/components/KLoader/KLoader.vue.d.ts +1 -0
- package/dist/runtime/presets/default/components/KMaskTextbox/KMaskTextbox.vue +1 -94
- package/dist/runtime/presets/default/components/KMultiTabs/KMultiTabs.vue +69 -4
- package/dist/runtime/presets/default/components/KRangeSlider/KRangeSlider.vue +18 -46
- package/dist/runtime/presets/default/components/KSlider/KSlider.vue +11 -23
- package/dist/runtime/presets/default/components/KTextbox/KTextbox.d.vue.ts +4 -1
- package/dist/runtime/presets/default/components/KTextbox/KTextbox.vue +24 -8
- package/dist/runtime/presets/default/components/KTextbox/KTextbox.vue.d.ts +4 -1
- package/dist/runtime/presets/default/components/KTree/KTree.d.vue.ts +1 -1
- package/dist/runtime/presets/default/components/KTree/KTree.vue +51 -80
- package/dist/runtime/presets/default/components/KTree/KTree.vue.d.ts +1 -1
- package/dist/runtime/presets/default/components/KTree/KTreeNodeItem.d.vue.ts +1 -0
- package/dist/runtime/presets/default/components/KTree/KTreeNodeItem.vue +12 -2
- package/dist/runtime/presets/default/components/KTree/KTreeNodeItem.vue.d.ts +1 -0
- package/dist/runtime/server/middleware/session.js +7 -0
- package/dist/runtime/utils/deprecation.d.ts +14 -0
- package/dist/runtime/utils/deprecation.js +44 -0
- package/dist/runtime/utils/dom.d.ts +31 -0
- package/dist/runtime/utils/dom.js +124 -0
- package/dist/skills/KATLUX_INDEX.md +15 -19
- package/dist/skills/katlux-components/components/KBulkActions.md +1 -1
- package/dist/skills/katlux-components/components/KDataIterator.md +5 -0
- package/dist/skills/katlux-components/components/KLayout.md +4 -0
- package/dist/skills/katlux-components/components/KLoader.md +3 -0
- package/dist/skills/katlux-components/components/KTextbox.md +1 -0
- package/dist/skills/katlux-config/SKILL.md +15 -7
- package/dist/skills/katlux-presets/SKILL.md +42 -2
- package/dist/skills/katlux-providers/SKILL.md +12 -0
- package/dist/skills/katlux-providers/providers/ADataProvider.md +1 -0
- package/dist/skills/katlux-providers/providers/CAPITreeServerDataProvider.md +13 -0
- package/dist/skills/katlux-providers/providers/RequestProvider.md +2 -2
- package/dist/skills/katlux-providers/providers/encryption-field-level.md +5 -2
- package/dist/skills/katlux-providers/providers/encryption-key-management.md +5 -2
- package/dist/skills/katlux-providers/providers/encryption-searchable.md +150 -27
- package/dist/skills/katlux-providers/providers/encryption-symmetric.md +4 -1
- package/dist/skills/katlux-providers/providers/encryption-threat-model.md +12 -6
- package/dist/skills/katlux-providers/providers/encryption.md +1 -1
- package/package.json +3 -3
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
<template lang="pug">
|
|
2
|
-
.KGantt(
|
|
2
|
+
.KGantt(:class="{ 'is-virtual-scroll': virtualScroll }")
|
|
3
3
|
.KGantt__scroll-container(
|
|
4
4
|
ref="scrollContainer"
|
|
5
5
|
@wheel="onWheel"
|
|
6
|
-
@mousedown="onMouseDown"
|
|
7
6
|
)
|
|
8
7
|
.KGantt__inner
|
|
9
8
|
KTreeView(
|
|
@@ -58,6 +57,7 @@
|
|
|
58
57
|
:resourceTypeField="resourceTypeField"
|
|
59
58
|
:resolvedMapping="resolvedMapping"
|
|
60
59
|
:activeDrag="activeDragState && activeDragState.sourceRowId === row?.id ? activeDragState : null"
|
|
60
|
+
@timeline-panstart="onTimelinePanStart"
|
|
61
61
|
@task-dragstart="onTaskDragStart($event, row)"
|
|
62
62
|
@cell-mouseenter="onCellMouseEnter($event, row)"
|
|
63
63
|
@task-click="onTaskClick"
|
|
@@ -117,6 +117,7 @@ const props = defineProps<{
|
|
|
117
117
|
|
|
118
118
|
const emit = defineEmits<{
|
|
119
119
|
(e: 'update:task', payload: { task: IGanttTask; sourceRow: any; targetRow?: any }): void
|
|
120
|
+
(e: 'task-change', payload: { task: IGanttTask; sourceRow: any; targetRow?: any }): void
|
|
120
121
|
(e: 'update:selectedRows', value: any[]): void
|
|
121
122
|
(e: 'update:selectAll', value: boolean): void
|
|
122
123
|
(e: 'update:selectAllScope', value: 'page' | 'dataset'): void
|
|
@@ -132,7 +133,6 @@ const emit = defineEmits<{
|
|
|
132
133
|
interface ActiveDrag {
|
|
133
134
|
taskId: string | number
|
|
134
135
|
task: IGanttTask
|
|
135
|
-
taskElement?: HTMLElement | null
|
|
136
136
|
sourceRow: any
|
|
137
137
|
sourceRowId: string | number
|
|
138
138
|
currentHoverRow: any
|
|
@@ -147,21 +147,14 @@ interface ActiveDrag {
|
|
|
147
147
|
}
|
|
148
148
|
|
|
149
149
|
const activeDragState = ref<ActiveDrag | null>(null)
|
|
150
|
-
const scrollContainer = ref<
|
|
151
|
-
const chartRef = ref<HTMLElement | null>(null)
|
|
150
|
+
const scrollContainer = ref<{ clientWidth?: number } | null>(null)
|
|
152
151
|
|
|
153
152
|
// ── Drag to pan state ─────────────
|
|
154
153
|
const isDraggingGantt = ref(false)
|
|
155
154
|
let ganttDragStartX = 0
|
|
156
155
|
|
|
157
|
-
const
|
|
158
|
-
// Only initiate drag if left button and target is not a task bar or its resize handles
|
|
156
|
+
const onTimelinePanStart = (e: MouseEvent) => {
|
|
159
157
|
if (e.button !== 0) return
|
|
160
|
-
const target = e.target as HTMLElement
|
|
161
|
-
if (target.closest('.gantt-bar')) return
|
|
162
|
-
|
|
163
|
-
// MUST be inside the timeline cell to start panning
|
|
164
|
-
if (!target.closest('[data-field="ganttTimeline"]')) return
|
|
165
158
|
|
|
166
159
|
isDraggingGantt.value = true
|
|
167
160
|
ganttDragStartX = e.clientX
|
|
@@ -214,11 +207,19 @@ const onWheel = (e: WheelEvent) => {
|
|
|
214
207
|
let wasDragging = false
|
|
215
208
|
let draggedTaskIdForClick: string | number | null = null
|
|
216
209
|
let captureClickTimer: ReturnType<typeof setTimeout> | null = null
|
|
217
|
-
let activeCaptureHandler: ((e: MouseEvent) => void) | null = null
|
|
218
210
|
|
|
219
|
-
const onTaskClick = (payload: { task: IGanttTask; row: any }) => {
|
|
220
|
-
if (wasDragging && draggedTaskIdForClick !== null && payload.task?.id === draggedTaskIdForClick)
|
|
221
|
-
|
|
211
|
+
const onTaskClick = (payload: { task: IGanttTask; row: any; event?: MouseEvent }) => {
|
|
212
|
+
if (wasDragging && draggedTaskIdForClick !== null && payload.task?.id === draggedTaskIdForClick) {
|
|
213
|
+
payload.event?.preventDefault()
|
|
214
|
+
if (captureClickTimer) {
|
|
215
|
+
clearTimeout(captureClickTimer)
|
|
216
|
+
captureClickTimer = null
|
|
217
|
+
}
|
|
218
|
+
wasDragging = false
|
|
219
|
+
draggedTaskIdForClick = null
|
|
220
|
+
return
|
|
221
|
+
}
|
|
222
|
+
emit('task-click', { task: payload.task, row: payload.row })
|
|
222
223
|
}
|
|
223
224
|
|
|
224
225
|
function formatTaskDate(originalValue: any, ms: number, mode?: 'date' | 'numeric') {
|
|
@@ -238,7 +239,7 @@ function formatTaskDate(originalValue: any, ms: number, mode?: 'date' | 'numeric
|
|
|
238
239
|
}
|
|
239
240
|
|
|
240
241
|
const onTaskDragStart = (
|
|
241
|
-
{ event, task, rowId, mode,
|
|
242
|
+
{ event, task, rowId, mode, wrapperWidth }: { event: MouseEvent; task: IGanttTask; rowId: any; mode: string; wrapperWidth: number },
|
|
242
243
|
row: any
|
|
243
244
|
) => {
|
|
244
245
|
wasDragging = false
|
|
@@ -246,26 +247,21 @@ const onTaskDragStart = (
|
|
|
246
247
|
if (!props.editable || event.button !== 0) { return }
|
|
247
248
|
event.preventDefault()
|
|
248
249
|
|
|
249
|
-
const wrapperRect = wrapperEl?.getBoundingClientRect()
|
|
250
|
-
const wrapperWidth = wrapperRect?.width ?? 1000
|
|
251
|
-
|
|
252
250
|
const startField = props.resolvedMapping?.startDate ?? 'startDate'
|
|
253
251
|
const endField = props.resolvedMapping?.endDate ?? 'endDate'
|
|
254
252
|
const originalStartMs = new Date(task[startField]).getTime()
|
|
255
253
|
const originalEndMs = new Date(task[endField]).getTime()
|
|
256
|
-
const taskElement = (event.target as HTMLElement)?.closest('.gantt-bar') as HTMLElement | null
|
|
257
254
|
|
|
258
255
|
activeDragState.value = {
|
|
259
256
|
taskId: task.id,
|
|
260
257
|
task,
|
|
261
|
-
taskElement,
|
|
262
258
|
sourceRow: row,
|
|
263
259
|
sourceRowId: row?.id,
|
|
264
260
|
currentHoverRow: row,
|
|
265
261
|
mode: mode as ActiveDrag['mode'],
|
|
266
262
|
startX: event.clientX,
|
|
267
263
|
startY: event.clientY,
|
|
268
|
-
wrapperWidth,
|
|
264
|
+
wrapperWidth: wrapperWidth || 1000,
|
|
269
265
|
originalStartMs,
|
|
270
266
|
originalEndMs,
|
|
271
267
|
currentStartMs: originalStartMs,
|
|
@@ -336,54 +332,15 @@ const onMouseUp = () => {
|
|
|
336
332
|
if (hasMoved || wasDragging) {
|
|
337
333
|
wasDragging = true
|
|
338
334
|
draggedTaskIdForClick = state.taskId
|
|
339
|
-
const draggedTaskId = state.taskId
|
|
340
|
-
const draggedEl = state.taskElement
|
|
341
|
-
const root = chartRef.value
|
|
342
|
-
|
|
343
|
-
if (activeCaptureHandler && root) {
|
|
344
|
-
root.removeEventListener('click', activeCaptureHandler, true)
|
|
345
|
-
activeCaptureHandler = null
|
|
346
|
-
}
|
|
347
335
|
if (captureClickTimer) {
|
|
348
336
|
clearTimeout(captureClickTimer)
|
|
349
337
|
captureClickTimer = null
|
|
350
338
|
}
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
// strictly on the Gantt root container, never on window
|
|
354
|
-
const captureClick = (e: MouseEvent) => {
|
|
355
|
-
const target = e.target as Element | null
|
|
356
|
-
const bar = target?.closest?.('.gantt-bar')
|
|
357
|
-
const isFromDraggedBar = Boolean(
|
|
358
|
-
(draggedEl && (draggedEl === bar || (target && draggedEl.contains(target)))) ||
|
|
359
|
-
(bar && draggedTaskId != null && bar.getAttribute('data-task-id') === String(draggedTaskId))
|
|
360
|
-
)
|
|
361
|
-
|
|
362
|
-
if (isFromDraggedBar) {
|
|
363
|
-
e.stopPropagation()
|
|
364
|
-
e.stopImmediatePropagation()
|
|
365
|
-
e.preventDefault()
|
|
366
|
-
root?.removeEventListener('click', captureClick, true)
|
|
367
|
-
activeCaptureHandler = null
|
|
368
|
-
}
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
if (root) {
|
|
372
|
-
activeCaptureHandler = captureClick
|
|
373
|
-
root.addEventListener('click', captureClick, true)
|
|
374
|
-
captureClickTimer = setTimeout(() => {
|
|
375
|
-
root.removeEventListener('click', captureClick, true)
|
|
376
|
-
if (activeCaptureHandler === captureClick) {
|
|
377
|
-
activeCaptureHandler = null
|
|
378
|
-
}
|
|
379
|
-
captureClickTimer = null
|
|
380
|
-
wasDragging = false
|
|
381
|
-
draggedTaskIdForClick = null
|
|
382
|
-
}, 100)
|
|
383
|
-
} else {
|
|
339
|
+
captureClickTimer = setTimeout(() => {
|
|
340
|
+
captureClickTimer = null
|
|
384
341
|
wasDragging = false
|
|
385
342
|
draggedTaskIdForClick = null
|
|
386
|
-
}
|
|
343
|
+
}, 100)
|
|
387
344
|
}
|
|
388
345
|
|
|
389
346
|
if (!hasMoved) {
|
|
@@ -454,6 +411,7 @@ const onMouseUp = () => {
|
|
|
454
411
|
}
|
|
455
412
|
|
|
456
413
|
emit('update:task', emitPayload)
|
|
414
|
+
emit('task-change', emitPayload)
|
|
457
415
|
|
|
458
416
|
activeDragState.value = null
|
|
459
417
|
}
|
|
@@ -465,10 +423,6 @@ onBeforeUnmount(() => {
|
|
|
465
423
|
window.removeEventListener('mousemove', onGanttMouseMove)
|
|
466
424
|
window.removeEventListener('mouseup', onGanttMouseUp)
|
|
467
425
|
}
|
|
468
|
-
if (activeCaptureHandler && chartRef.value) {
|
|
469
|
-
chartRef.value.removeEventListener('click', activeCaptureHandler, true)
|
|
470
|
-
activeCaptureHandler = null
|
|
471
|
-
}
|
|
472
426
|
if (captureClickTimer) {
|
|
473
427
|
clearTimeout(captureClickTimer)
|
|
474
428
|
captureClickTimer = null
|
|
@@ -57,6 +57,11 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
57
57
|
sourceRow: any;
|
|
58
58
|
targetRow?: any;
|
|
59
59
|
}) => any;
|
|
60
|
+
"task-change": (payload: {
|
|
61
|
+
task: IGanttTask;
|
|
62
|
+
sourceRow: any;
|
|
63
|
+
targetRow?: any;
|
|
64
|
+
}) => any;
|
|
60
65
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
61
66
|
"onUpdate:selectedRows"?: ((value: any[]) => any) | undefined;
|
|
62
67
|
"onUpdate:selectAll"?: ((value: boolean) => any) | undefined;
|
|
@@ -78,6 +83,11 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
78
83
|
sourceRow: any;
|
|
79
84
|
targetRow?: any;
|
|
80
85
|
}) => any) | undefined;
|
|
86
|
+
"onTask-change"?: ((payload: {
|
|
87
|
+
task: IGanttTask;
|
|
88
|
+
sourceRow: any;
|
|
89
|
+
targetRow?: any;
|
|
90
|
+
}) => any) | undefined;
|
|
81
91
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
82
92
|
declare const _default: typeof __VLS_export;
|
|
83
93
|
export default _default;
|
|
@@ -19,17 +19,19 @@ type __VLS_Props = {
|
|
|
19
19
|
mode?: 'date' | 'numeric';
|
|
20
20
|
};
|
|
21
21
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
22
|
+
"timeline-panstart": (event: MouseEvent) => any;
|
|
22
23
|
"task-dragstart": (payload: {
|
|
23
24
|
event: MouseEvent;
|
|
24
25
|
task: IGanttTask;
|
|
25
26
|
rowId: any;
|
|
26
27
|
mode: string;
|
|
27
|
-
|
|
28
|
+
wrapperWidth: number;
|
|
28
29
|
}) => any;
|
|
29
30
|
"cell-mouseenter": (rowId: any) => any;
|
|
30
31
|
"task-click": (payload: {
|
|
31
32
|
task: IGanttTask;
|
|
32
33
|
row: any;
|
|
34
|
+
event?: MouseEvent;
|
|
33
35
|
}) => any;
|
|
34
36
|
"task-dblclick": (payload: {
|
|
35
37
|
task: IGanttTask;
|
|
@@ -58,17 +60,19 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
58
60
|
clientY: number;
|
|
59
61
|
}) => any;
|
|
60
62
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
63
|
+
"onTimeline-panstart"?: ((event: MouseEvent) => any) | undefined;
|
|
61
64
|
"onTask-dragstart"?: ((payload: {
|
|
62
65
|
event: MouseEvent;
|
|
63
66
|
task: IGanttTask;
|
|
64
67
|
rowId: any;
|
|
65
68
|
mode: string;
|
|
66
|
-
|
|
69
|
+
wrapperWidth: number;
|
|
67
70
|
}) => any) | undefined;
|
|
68
71
|
"onCell-mouseenter"?: ((rowId: any) => any) | undefined;
|
|
69
72
|
"onTask-click"?: ((payload: {
|
|
70
73
|
task: IGanttTask;
|
|
71
74
|
row: any;
|
|
75
|
+
event?: MouseEvent;
|
|
72
76
|
}) => any) | undefined;
|
|
73
77
|
"onTask-dblclick"?: ((payload: {
|
|
74
78
|
task: IGanttTask;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
.gantt-cell(
|
|
3
3
|
:data-row-id="row?.id ?? ''"
|
|
4
4
|
@mouseenter="onCellMouseEnter"
|
|
5
|
+
@mousedown.left="emit('timeline-panstart', $event)"
|
|
5
6
|
)
|
|
6
7
|
.gantt-bar-wrapper(ref="wrapperRef")
|
|
7
8
|
//- Month grid lines behind bars
|
|
@@ -18,20 +19,20 @@
|
|
|
18
19
|
:style="getBarStyle(task)"
|
|
19
20
|
:title="task[titleField] || ''"
|
|
20
21
|
:class="[{ 'is-dragging': isDraggingThisTask(task.id) }, 'gantt-bar--' + getTaskAppearance(task)]"
|
|
21
|
-
@mousedown.left="
|
|
22
|
-
@click.left.stop="
|
|
22
|
+
@mousedown.left.stop="onBarMouseDown($event, task, 'move')"
|
|
23
|
+
@click.left.stop="emit('task-click', { task, row, event: $event })"
|
|
23
24
|
@dblclick.left.stop="$emit('task-dblclick', { task, row })"
|
|
24
25
|
@contextmenu.stop="onContextMenu($event, task)"
|
|
25
26
|
)
|
|
26
27
|
.gantt-resize-handle.left(
|
|
27
28
|
v-if="editable"
|
|
28
|
-
@mousedown.left.stop="
|
|
29
|
+
@mousedown.left.stop="onBarMouseDown($event, task, 'resize-left')"
|
|
29
30
|
@click.stop
|
|
30
31
|
)
|
|
31
32
|
span.gantt-title {{ task[titleField] || '' }}
|
|
32
33
|
.gantt-resize-handle.right(
|
|
33
34
|
v-if="editable"
|
|
34
|
-
@mousedown.left.stop="
|
|
35
|
+
@mousedown.left.stop="onBarMouseDown($event, task, 'resize-right')"
|
|
35
36
|
@click.stop
|
|
36
37
|
)
|
|
37
38
|
</template>
|
|
@@ -62,14 +63,29 @@ const props = defineProps<{
|
|
|
62
63
|
}>()
|
|
63
64
|
|
|
64
65
|
const emit = defineEmits<{
|
|
65
|
-
(e: '
|
|
66
|
+
(e: 'timeline-panstart', event: MouseEvent): void
|
|
67
|
+
(e: 'task-dragstart', payload: { event: MouseEvent; task: IGanttTask; rowId: any; mode: string; wrapperWidth: number }): void
|
|
66
68
|
(e: 'cell-mouseenter', rowId: any): void
|
|
67
|
-
(e: 'task-click', payload: { task: IGanttTask; row: any }): void
|
|
69
|
+
(e: 'task-click', payload: { task: IGanttTask; row: any; event?: MouseEvent }): void
|
|
68
70
|
(e: 'task-dblclick', payload: { task: IGanttTask; row: any }): void
|
|
69
71
|
(e: 'task-contextmenu', payload: { event: MouseEvent; task: IGanttTask; row: any; ctrlKey: boolean; shiftKey: boolean; altKey: boolean; metaKey: boolean; clientX: number; clientY: number }): void
|
|
70
72
|
(e: 'task-rightclick', payload: { event: MouseEvent; task: IGanttTask; row: any; ctrlKey: boolean; shiftKey: boolean; altKey: boolean; metaKey: boolean; clientX: number; clientY: number }): void
|
|
71
73
|
}>()
|
|
72
74
|
|
|
75
|
+
const wrapperRef = ref<{ clientWidth?: number; getBoundingClientRect?: () => { width: number } } | null>(null)
|
|
76
|
+
|
|
77
|
+
const onBarMouseDown = (event: MouseEvent, task: IGanttTask, mode: 'move' | 'resize-left' | 'resize-right') => {
|
|
78
|
+
if (!props.editable) return
|
|
79
|
+
const wrapperWidth = wrapperRef.value?.getBoundingClientRect?.().width || wrapperRef.value?.clientWidth || 1000
|
|
80
|
+
emit('task-dragstart', {
|
|
81
|
+
event,
|
|
82
|
+
task,
|
|
83
|
+
rowId: props.row?.id,
|
|
84
|
+
mode,
|
|
85
|
+
wrapperWidth
|
|
86
|
+
})
|
|
87
|
+
}
|
|
88
|
+
|
|
73
89
|
const onContextMenu = (event: MouseEvent, task: IGanttTask) => {
|
|
74
90
|
const payload = {
|
|
75
91
|
event,
|
|
@@ -86,8 +102,6 @@ const onContextMenu = (event: MouseEvent, task: IGanttTask) => {
|
|
|
86
102
|
emit('task-rightclick', payload)
|
|
87
103
|
}
|
|
88
104
|
|
|
89
|
-
const wrapperRef = ref<HTMLElement | null>(null)
|
|
90
|
-
|
|
91
105
|
const onCellMouseEnter = () => {
|
|
92
106
|
emit('cell-mouseenter', props.row?.id)
|
|
93
107
|
}
|
|
@@ -19,17 +19,19 @@ type __VLS_Props = {
|
|
|
19
19
|
mode?: 'date' | 'numeric';
|
|
20
20
|
};
|
|
21
21
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
22
|
+
"timeline-panstart": (event: MouseEvent) => any;
|
|
22
23
|
"task-dragstart": (payload: {
|
|
23
24
|
event: MouseEvent;
|
|
24
25
|
task: IGanttTask;
|
|
25
26
|
rowId: any;
|
|
26
27
|
mode: string;
|
|
27
|
-
|
|
28
|
+
wrapperWidth: number;
|
|
28
29
|
}) => any;
|
|
29
30
|
"cell-mouseenter": (rowId: any) => any;
|
|
30
31
|
"task-click": (payload: {
|
|
31
32
|
task: IGanttTask;
|
|
32
33
|
row: any;
|
|
34
|
+
event?: MouseEvent;
|
|
33
35
|
}) => any;
|
|
34
36
|
"task-dblclick": (payload: {
|
|
35
37
|
task: IGanttTask;
|
|
@@ -58,17 +60,19 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
58
60
|
clientY: number;
|
|
59
61
|
}) => any;
|
|
60
62
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
63
|
+
"onTimeline-panstart"?: ((event: MouseEvent) => any) | undefined;
|
|
61
64
|
"onTask-dragstart"?: ((payload: {
|
|
62
65
|
event: MouseEvent;
|
|
63
66
|
task: IGanttTask;
|
|
64
67
|
rowId: any;
|
|
65
68
|
mode: string;
|
|
66
|
-
|
|
69
|
+
wrapperWidth: number;
|
|
67
70
|
}) => any) | undefined;
|
|
68
71
|
"onCell-mouseenter"?: ((rowId: any) => any) | undefined;
|
|
69
72
|
"onTask-click"?: ((payload: {
|
|
70
73
|
task: IGanttTask;
|
|
71
74
|
row: any;
|
|
75
|
+
event?: MouseEvent;
|
|
72
76
|
}) => any) | undefined;
|
|
73
77
|
"onTask-dblclick"?: ((payload: {
|
|
74
78
|
task: IGanttTask;
|
|
@@ -19,12 +19,12 @@ const slots = useSlots()
|
|
|
19
19
|
const props = withDefaults(defineProps<{
|
|
20
20
|
scrollMode?: 'window' | 'container'
|
|
21
21
|
}>(), {
|
|
22
|
-
scrollMode: '
|
|
22
|
+
scrollMode: 'window'
|
|
23
23
|
})
|
|
24
24
|
|
|
25
25
|
const layoutClasses = computed(() => [
|
|
26
26
|
{ 'has-aside': Boolean(slots.aside) },
|
|
27
|
-
`is-scroll-${props.scrollMode || '
|
|
27
|
+
`is-scroll-${props.scrollMode || 'window'}`
|
|
28
28
|
])
|
|
29
29
|
</script>
|
|
30
30
|
|
|
@@ -2,6 +2,7 @@ type __VLS_Props = {
|
|
|
2
2
|
loading: boolean;
|
|
3
3
|
overlay?: boolean;
|
|
4
4
|
size?: 'small' | 'medium' | 'large';
|
|
5
|
+
label?: string;
|
|
5
6
|
loaderClasses?: any;
|
|
6
7
|
};
|
|
7
8
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<template lang="pug">
|
|
2
|
-
.KLoader(:class="computedClasses")
|
|
2
|
+
.KLoader(:class="computedClasses" role="status" :aria-live="props.loading ? 'polite' : undefined")
|
|
3
3
|
.KLoader__spinner
|
|
4
|
-
|
|
4
|
+
.KLoader__label(v-if="props.label || $slots.default")
|
|
5
|
+
slot {{ props.label }}
|
|
5
6
|
</template>
|
|
6
7
|
|
|
7
8
|
<script lang="ts" setup>
|
|
@@ -10,6 +11,7 @@ const props = defineProps<{
|
|
|
10
11
|
loading: boolean
|
|
11
12
|
overlay?: boolean
|
|
12
13
|
size?: 'small' | 'medium' | 'large'
|
|
14
|
+
label?: string
|
|
13
15
|
loaderClasses?: any
|
|
14
16
|
}>()
|
|
15
17
|
|
|
@@ -33,8 +35,17 @@ const computedClasses = computed(() => {
|
|
|
33
35
|
|
|
34
36
|
&.is-loading {
|
|
35
37
|
display: flex;
|
|
38
|
+
flex-direction: column;
|
|
36
39
|
justify-content: center;
|
|
37
40
|
align-items: center;
|
|
41
|
+
gap: var(--gap-sm);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&__label {
|
|
45
|
+
font-size: var(--font-size-sm);
|
|
46
|
+
font-weight: var(--font-weight-medium);
|
|
47
|
+
color: var(--font-color-primary);
|
|
48
|
+
text-align: center;
|
|
38
49
|
}
|
|
39
50
|
|
|
40
51
|
&.is-overlay {
|
|
@@ -2,6 +2,7 @@ type __VLS_Props = {
|
|
|
2
2
|
loading: boolean;
|
|
3
3
|
overlay?: boolean;
|
|
4
4
|
size?: 'small' | 'medium' | 'large';
|
|
5
|
+
label?: string;
|
|
5
6
|
loaderClasses?: any;
|
|
6
7
|
};
|
|
7
8
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -10,14 +10,11 @@
|
|
|
10
10
|
:validation="validation"
|
|
11
11
|
:validationText="validationText"
|
|
12
12
|
@update:modelValue="handleUpdate"
|
|
13
|
-
@beforeinput="handleBeforeInput"
|
|
14
13
|
)
|
|
15
14
|
</template>
|
|
16
15
|
|
|
17
16
|
<script lang="ts" setup>
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const props = defineProps<{
|
|
17
|
+
defineProps<{
|
|
21
18
|
label?: string
|
|
22
19
|
maskedValue: string
|
|
23
20
|
placeholder: string
|
|
@@ -32,96 +29,6 @@ const emit = defineEmits<{
|
|
|
32
29
|
(e: 'clear'): void
|
|
33
30
|
}>()
|
|
34
31
|
|
|
35
|
-
// Use beforeinput for better validation (fires before input is accepted)
|
|
36
|
-
const handleBeforeInput = (event: InputEvent) => {
|
|
37
|
-
if (!event.data || event.inputType !== 'insertText') {
|
|
38
|
-
return // Allow deletions, etc.
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const char = event.data
|
|
42
|
-
if (!/[0-9]/.test(char)) {
|
|
43
|
-
return // Not a digit, let through for other patterns
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
const target = event.target as HTMLInputElement
|
|
47
|
-
const cursorPos = target.selectionStart || 0
|
|
48
|
-
const currentValue = target.value
|
|
49
|
-
|
|
50
|
-
// Find the mask pattern at cursor position
|
|
51
|
-
let maskIdx = 0
|
|
52
|
-
let valIdx = 0
|
|
53
|
-
|
|
54
|
-
// Walk through to find where we are in the mask
|
|
55
|
-
while (valIdx < cursorPos && maskIdx < props.mask.length) {
|
|
56
|
-
const def = getMaskPatternDef(props.mask, maskIdx)
|
|
57
|
-
if (def) {
|
|
58
|
-
// Pattern - check how many chars it uses in value
|
|
59
|
-
let consumed = 0
|
|
60
|
-
while (consumed < def.length && valIdx < currentValue.length) {
|
|
61
|
-
if (def.pattern.test(currentValue[valIdx])) {
|
|
62
|
-
consumed++
|
|
63
|
-
}
|
|
64
|
-
valIdx++
|
|
65
|
-
if (valIdx >= cursorPos) break
|
|
66
|
-
}
|
|
67
|
-
maskIdx += def.length
|
|
68
|
-
} else {
|
|
69
|
-
// Literal
|
|
70
|
-
valIdx++
|
|
71
|
-
maskIdx++
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
// Get pattern at current position
|
|
76
|
-
const patternType = props.mask.substring(maskIdx, maskIdx + 4)
|
|
77
|
-
const digit = parseInt(char, 10)
|
|
78
|
-
|
|
79
|
-
// Find how many digits already entered for this specific pattern instance
|
|
80
|
-
let digitsInPattern = 0
|
|
81
|
-
let scanIdx = cursorPos
|
|
82
|
-
|
|
83
|
-
// Count backwards to start of this pattern
|
|
84
|
-
while (scanIdx > 0 && digitsInPattern < 10) {
|
|
85
|
-
scanIdx--
|
|
86
|
-
const ch = currentValue[scanIdx]
|
|
87
|
-
if (/[0-9]/.test(ch)) {
|
|
88
|
-
digitsInPattern++
|
|
89
|
-
} else {
|
|
90
|
-
break // Hit a literal, stop
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
// Validate based on pattern
|
|
95
|
-
if (patternType.startsWith('DD')) {
|
|
96
|
-
if (digitsInPattern === 0) {
|
|
97
|
-
if (digit > 3) event.preventDefault()
|
|
98
|
-
} else if (digitsInPattern === 1) {
|
|
99
|
-
const firstDigit = parseInt(currentValue[cursorPos - 1], 10)
|
|
100
|
-
if (firstDigit === 0 && digit === 0) event.preventDefault()
|
|
101
|
-
if (firstDigit === 3 && digit > 1) event.preventDefault()
|
|
102
|
-
}
|
|
103
|
-
} else if (patternType.startsWith('MM')) {
|
|
104
|
-
if (digitsInPattern === 0) {
|
|
105
|
-
if (digit > 1) event.preventDefault()
|
|
106
|
-
} else if (digitsInPattern === 1) {
|
|
107
|
-
const firstDigit = parseInt(currentValue[cursorPos - 1], 10)
|
|
108
|
-
if (firstDigit === 0 && digit === 0) event.preventDefault()
|
|
109
|
-
if (firstDigit === 1 && digit > 2) event.preventDefault()
|
|
110
|
-
}
|
|
111
|
-
} else if (patternType.startsWith('HH')) {
|
|
112
|
-
if (digitsInPattern === 0) {
|
|
113
|
-
if (digit > 2) event.preventDefault()
|
|
114
|
-
} else if (digitsInPattern === 1) {
|
|
115
|
-
const firstDigit = parseInt(currentValue[cursorPos - 1], 10)
|
|
116
|
-
if (firstDigit === 2 && digit > 3) event.preventDefault()
|
|
117
|
-
}
|
|
118
|
-
} else if (patternType.startsWith('mm') || patternType.startsWith('ss')) {
|
|
119
|
-
if (digitsInPattern === 0) {
|
|
120
|
-
if (digit > 5) event.preventDefault()
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
|
|
125
32
|
const handleUpdate = (value: string) => {
|
|
126
33
|
emit('update:maskedValue', value)
|
|
127
34
|
}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
<template lang="pug">
|
|
2
|
-
KGrid.k-multi-tabs(direction="row" align="stretch" flexChild)
|
|
2
|
+
KGrid.k-multi-tabs(direction="row" align="stretch" flexChild :noGap="true")
|
|
3
3
|
template(v-for="(group, groupIndex) in groups" :key="group.id || groupIndex")
|
|
4
|
+
.k-multi-tabs-pane(:class="{ 'has-divider': groupIndex > 0 }")
|
|
4
5
|
KTabs.k-multi-tabs-tabs(v-if="group.tabs && group.tabs.length > 0")
|
|
5
6
|
KTabItem(v-for="tab in group.tabs" :key="tab.id" :title="tab.title" :isOpen="tab.isOpen")
|
|
6
7
|
.k-multi-tabs-tab-content
|
|
7
8
|
slot(:name="tab.slotName || tab.id" :tab="tab")
|
|
8
9
|
component(v-if="tab.component" :is="tab.component" v-bind="tab.props")
|
|
10
|
+
.default-tab-content(v-else)
|
|
11
|
+
h3.default-tab-title {{ tab.title }}
|
|
12
|
+
p.default-tab-desc {{ tab.content || t('Content for') + ' ' + tab.title }}
|
|
9
13
|
.k-multi-tabs-empty(v-else)
|
|
10
14
|
slot(name="empty" :group="group")
|
|
11
15
|
span {{ t('No tabs open') }}
|
|
@@ -32,6 +36,19 @@ const { t } = useKatluxI18n()
|
|
|
32
36
|
overflow: hidden;
|
|
33
37
|
}
|
|
34
38
|
|
|
39
|
+
.k-multi-tabs-pane {
|
|
40
|
+
flex: 1 1 0%;
|
|
41
|
+
min-width: 0;
|
|
42
|
+
height: 100%;
|
|
43
|
+
display: flex;
|
|
44
|
+
flex-direction: column;
|
|
45
|
+
box-sizing: border-box;
|
|
46
|
+
|
|
47
|
+
&.has-divider {
|
|
48
|
+
border-left: 1px solid var(--border-color-light, #e2e8f0);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
35
52
|
.k-multi-tabs-empty {
|
|
36
53
|
display: flex;
|
|
37
54
|
align-items: center;
|
|
@@ -40,27 +57,75 @@ const { t } = useKatluxI18n()
|
|
|
40
57
|
flex: 1 1 0%;
|
|
41
58
|
min-width: 0;
|
|
42
59
|
}
|
|
60
|
+
|
|
43
61
|
.k-multi-tabs-tabs {
|
|
44
62
|
box-sizing: border-box;
|
|
45
|
-
|
|
46
63
|
flex: 1 1 0%;
|
|
47
64
|
min-width: 0;
|
|
48
65
|
display: flex;
|
|
49
66
|
flex-direction: column;
|
|
50
|
-
|
|
67
|
+
height: 100%;
|
|
68
|
+
|
|
69
|
+
:deep(.KTab) {
|
|
51
70
|
height: 100%;
|
|
52
|
-
|
|
71
|
+
display: flex;
|
|
72
|
+
flex-direction: column;
|
|
73
|
+
max-width: 100%;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
:deep(.KPanel) {
|
|
77
|
+
height: 100%;
|
|
78
|
+
border: none;
|
|
79
|
+
border-radius: 0;
|
|
80
|
+
box-shadow: none;
|
|
81
|
+
background: transparent;
|
|
82
|
+
display: flex;
|
|
83
|
+
flex-direction: column;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
:deep(.KPanel--header) {
|
|
87
|
+
background: var(--bg-surface-secondary, var(--panel-header-bg-default, #f8fafc));
|
|
88
|
+
border-bottom: 1px solid var(--border-color-light, #e2e8f0);
|
|
89
|
+
padding: 0.35rem 0.5rem;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
:deep(.KPanel--content) {
|
|
93
|
+
flex: 1 1 auto;
|
|
94
|
+
overflow: auto;
|
|
95
|
+
padding: 0;
|
|
53
96
|
}
|
|
54
97
|
}
|
|
98
|
+
|
|
55
99
|
.k-multi-tabs-tab-content {
|
|
56
100
|
display: flex;
|
|
57
101
|
flex-direction: column;
|
|
58
102
|
height: 100%;
|
|
59
103
|
overflow: auto;
|
|
104
|
+
padding: 1.25rem;
|
|
105
|
+
box-sizing: border-box;
|
|
60
106
|
|
|
61
107
|
> * {
|
|
62
108
|
flex: 1 1 auto;
|
|
63
109
|
height: 100%;
|
|
64
110
|
}
|
|
65
111
|
}
|
|
112
|
+
|
|
113
|
+
.default-tab-content {
|
|
114
|
+
display: flex;
|
|
115
|
+
flex-direction: column;
|
|
116
|
+
gap: 0.5rem;
|
|
117
|
+
|
|
118
|
+
.default-tab-title {
|
|
119
|
+
font-size: 1.25rem;
|
|
120
|
+
font-weight: 700;
|
|
121
|
+
color: var(--font-color-primary, #0f172a);
|
|
122
|
+
margin: 0;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.default-tab-desc {
|
|
126
|
+
color: var(--font-color-secondary, #64748b);
|
|
127
|
+
font-size: 0.95rem;
|
|
128
|
+
margin: 0;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
66
131
|
</style>
|