@katlux/toolkit 0.1.0-beta.6 → 0.1.0-beta.66

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.
Files changed (184) hide show
  1. package/dist/compiled/composables/usePresetComponent.mjs +21 -16
  2. package/dist/module.cjs +52 -0
  3. package/dist/module.json +1 -1
  4. package/dist/module.mjs +52 -0
  5. package/dist/runtime/components/KBulkActions/KBulkActions.logic.d.ts +9 -2
  6. package/dist/runtime/components/KCalendar/KCalendar.global.d.vue.ts +11 -12
  7. package/dist/runtime/components/KCalendar/KCalendar.global.vue.d.ts +11 -12
  8. package/dist/runtime/components/KCalendar/KCalendar.logic.d.ts +1 -0
  9. package/dist/runtime/components/KCalendar/KCalendar.logic.js +25 -10
  10. package/dist/runtime/components/KCheckbox/KCheckbox.global.d.vue.ts +30 -0
  11. package/dist/runtime/components/KCheckbox/KCheckbox.global.vue +4 -1
  12. package/dist/runtime/components/KCheckbox/KCheckbox.global.vue.d.ts +30 -0
  13. package/dist/runtime/components/KCheckbox/KCheckbox.logic.d.ts +17 -0
  14. package/dist/runtime/components/KCheckbox/KCheckbox.logic.js +16 -1
  15. package/dist/runtime/components/KCombobox/KCombobox.global.d.vue.ts +75 -8
  16. package/dist/runtime/components/KCombobox/KCombobox.global.vue +18 -4
  17. package/dist/runtime/components/KCombobox/KCombobox.global.vue.d.ts +75 -8
  18. package/dist/runtime/components/KCombobox/KCombobox.logic.d.ts +46 -8
  19. package/dist/runtime/components/KCombobox/KCombobox.logic.js +77 -9
  20. package/dist/runtime/components/KCompositeInput/KCompositeInput.global.d.vue.ts +169 -0
  21. package/dist/runtime/components/KCompositeInput/KCompositeInput.global.vue +46 -0
  22. package/dist/runtime/components/KCompositeInput/KCompositeInput.global.vue.d.ts +169 -0
  23. package/dist/runtime/components/KCompositeInput/KCompositeInput.logic.d.ts +127 -0
  24. package/dist/runtime/components/KCompositeInput/KCompositeInput.logic.js +160 -0
  25. package/dist/runtime/components/KDatatable/KDataIterator.global.vue +1 -1
  26. package/dist/runtime/components/KDatatable/KDataIterator.logic.d.ts +2 -2
  27. package/dist/runtime/components/KDatatable/KDatatable.global.vue +1 -1
  28. package/dist/runtime/components/KDatatable/KDatatable.logic.d.ts +2 -2
  29. package/dist/runtime/components/KDatePicker/KDatePicker.global.d.vue.ts +95 -8
  30. package/dist/runtime/components/KDatePicker/KDatePicker.global.vue +27 -3
  31. package/dist/runtime/components/KDatePicker/KDatePicker.global.vue.d.ts +95 -8
  32. package/dist/runtime/components/KDatePicker/KDatePicker.logic.d.ts +43 -1
  33. package/dist/runtime/components/KDatePicker/KDatePicker.logic.js +106 -7
  34. package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.d.vue.ts +84 -8
  35. package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.vue +26 -3
  36. package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.vue.d.ts +84 -8
  37. package/dist/runtime/components/KDateTimePicker/KDateTimePicker.logic.d.ts +38 -1
  38. package/dist/runtime/components/KDateTimePicker/KDateTimePicker.logic.js +161 -7
  39. package/dist/runtime/components/KDropdown/KDropdown.global.d.vue.ts +27 -0
  40. package/dist/runtime/components/KDropdown/KDropdown.global.vue +14 -4
  41. package/dist/runtime/components/KDropdown/KDropdown.global.vue.d.ts +27 -0
  42. package/dist/runtime/components/KDropdown/KDropdown.logic.d.ts +36 -1
  43. package/dist/runtime/components/KDropdown/KDropdown.logic.js +92 -4
  44. package/dist/runtime/components/KGrid/KGrid.global.d.vue.ts +7 -56
  45. package/dist/runtime/components/KGrid/KGrid.global.vue +9 -2
  46. package/dist/runtime/components/KGrid/KGrid.global.vue.d.ts +7 -56
  47. package/dist/runtime/components/KHourPicker/KHourPicker.global.d.vue.ts +41 -0
  48. package/dist/runtime/components/KHourPicker/KHourPicker.global.vue +27 -12
  49. package/dist/runtime/components/KHourPicker/KHourPicker.global.vue.d.ts +41 -0
  50. package/dist/runtime/components/KHourPicker/KHourPicker.logic.d.ts +26 -3
  51. package/dist/runtime/components/KHourPicker/KHourPicker.logic.js +34 -10
  52. package/dist/runtime/components/KHourSelect/KHourSelect.logic.js +4 -1
  53. package/dist/runtime/components/KIcon/KIcon.global.d.vue.ts +1 -1
  54. package/dist/runtime/components/KIcon/KIcon.global.vue.d.ts +1 -1
  55. package/dist/runtime/components/KIcon/KIcon.logic.d.ts +1 -1
  56. package/dist/runtime/components/KIcon/KIcon.logic.js +13 -8
  57. package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.d.vue.ts +21 -0
  58. package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.vue +4 -2
  59. package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.vue.d.ts +21 -0
  60. package/dist/runtime/components/KMaskTextbox/KMaskTextbox.logic.d.ts +11 -0
  61. package/dist/runtime/components/KMaskTextbox/KMaskTextbox.logic.js +9 -0
  62. package/dist/runtime/components/KModal/KModal.global.d.vue.ts +14 -2
  63. package/dist/runtime/components/KModal/KModal.global.vue +5 -1
  64. package/dist/runtime/components/KModal/KModal.global.vue.d.ts +14 -2
  65. package/dist/runtime/components/KModal/KModal.logic.d.ts +10 -2
  66. package/dist/runtime/components/KModal/KModal.logic.js +12 -3
  67. package/dist/runtime/components/KPagination/KPagination.global.vue +1 -1
  68. package/dist/runtime/components/KPanel/KPanel.global.d.vue.ts +5 -28
  69. package/dist/runtime/components/KPanel/KPanel.global.vue +12 -4
  70. package/dist/runtime/components/KPanel/KPanel.global.vue.d.ts +5 -28
  71. package/dist/runtime/components/KPanel/KPanel.logic.d.ts +10 -0
  72. package/dist/runtime/components/KPanel/KPanel.logic.js +8 -0
  73. package/dist/runtime/components/KRadiobox/KRadiobox.global.d.vue.ts +21 -0
  74. package/dist/runtime/components/KRadiobox/KRadiobox.global.vue +3 -1
  75. package/dist/runtime/components/KRadiobox/KRadiobox.global.vue.d.ts +21 -0
  76. package/dist/runtime/components/KRadiobox/KRadiobox.logic.d.ts +11 -0
  77. package/dist/runtime/components/KRadiobox/KRadiobox.logic.js +9 -0
  78. package/dist/runtime/components/KTextarea/KTextarea.global.d.vue.ts +21 -0
  79. package/dist/runtime/components/KTextarea/KTextarea.global.vue +3 -1
  80. package/dist/runtime/components/KTextarea/KTextarea.global.vue.d.ts +21 -0
  81. package/dist/runtime/components/KTextarea/KTextarea.logic.d.ts +11 -0
  82. package/dist/runtime/components/KTextarea/KTextarea.logic.js +9 -0
  83. package/dist/runtime/components/KTextbox/KTextbox.global.d.vue.ts +35 -2
  84. package/dist/runtime/components/KTextbox/KTextbox.global.vue +7 -4
  85. package/dist/runtime/components/KTextbox/KTextbox.global.vue.d.ts +35 -2
  86. package/dist/runtime/components/KTextbox/KTextbox.logic.d.ts +21 -4
  87. package/dist/runtime/components/KTextbox/KTextbox.logic.js +21 -5
  88. package/dist/runtime/components/KToast/KToast.global.d.vue.ts +57 -0
  89. package/dist/runtime/components/KToast/KToast.global.vue +32 -0
  90. package/dist/runtime/components/KToast/KToast.global.vue.d.ts +57 -0
  91. package/dist/runtime/components/KToast/KToast.logic.d.ts +34 -0
  92. package/dist/runtime/components/KToast/KToast.logic.js +47 -0
  93. package/dist/runtime/components/KTree/KTree.logic.d.ts +1 -1
  94. package/dist/runtime/components/KTreePicker/KTreePicker.global.d.vue.ts +63 -5
  95. package/dist/runtime/components/KTreePicker/KTreePicker.global.vue +15 -3
  96. package/dist/runtime/components/KTreePicker/KTreePicker.global.vue.d.ts +63 -5
  97. package/dist/runtime/components/KTreePicker/KTreePicker.logic.d.ts +37 -5
  98. package/dist/runtime/components/KTreePicker/KTreePicker.logic.js +32 -1
  99. package/dist/runtime/components/KTreeView/KTreeView.global.d.vue.ts +5 -5
  100. package/dist/runtime/components/KTreeView/KTreeView.global.vue.d.ts +5 -5
  101. package/dist/runtime/components/KTreeView/KTreeView.logic.d.ts +1 -1
  102. package/dist/runtime/composables/usePresetComponent.d.ts +16 -0
  103. package/dist/runtime/composables/usePresetComponent.js +21 -16
  104. package/dist/runtime/presets/default/assets/scss/css-variables.css +64 -13
  105. package/dist/runtime/presets/default/assets/scss/css-variables.scss +286 -0
  106. package/dist/runtime/presets/default/assets/scss/docs.scss +52 -0
  107. package/dist/runtime/presets/default/assets/scss/index.css +99 -13
  108. package/dist/runtime/presets/default/assets/scss/index.scss +42 -0
  109. package/dist/runtime/presets/default/assets/scss/mixins.scss +94 -0
  110. package/dist/runtime/presets/default/assets/scss/reset.scss +16 -0
  111. package/dist/runtime/presets/default/components/KAccordion/KAccordion.vue +5 -2
  112. package/dist/runtime/presets/default/components/KAccordion/KAccordionItem.vue +40 -37
  113. package/dist/runtime/presets/default/components/KBulkActions/KBulkActions.vue +29 -22
  114. package/dist/runtime/presets/default/components/KButton/KButton.vue +147 -428
  115. package/dist/runtime/presets/default/components/KCalendar/KCalendar.vue +57 -53
  116. package/dist/runtime/presets/default/components/KCalendar/KCalendarMonth.vue +189 -161
  117. package/dist/runtime/presets/default/components/KCheckbox/KCheckbox.d.vue.ts +3 -0
  118. package/dist/runtime/presets/default/components/KCheckbox/KCheckbox.vue +59 -42
  119. package/dist/runtime/presets/default/components/KCheckbox/KCheckbox.vue.d.ts +3 -0
  120. package/dist/runtime/presets/default/components/KCombobox/KCombobox.d.vue.ts +7 -0
  121. package/dist/runtime/presets/default/components/KCombobox/KCombobox.vue +108 -79
  122. package/dist/runtime/presets/default/components/KCombobox/KCombobox.vue.d.ts +7 -0
  123. package/dist/runtime/presets/default/components/KCombobox/KComboboxList.d.vue.ts +1 -0
  124. package/dist/runtime/presets/default/components/KCombobox/KComboboxList.vue +79 -61
  125. package/dist/runtime/presets/default/components/KCombobox/KComboboxList.vue.d.ts +1 -0
  126. package/dist/runtime/presets/default/components/KCompositeInput/KCompositeInput.d.vue.ts +29 -0
  127. package/dist/runtime/presets/default/components/KCompositeInput/KCompositeInput.vue +202 -0
  128. package/dist/runtime/presets/default/components/KCompositeInput/KCompositeInput.vue.d.ts +29 -0
  129. package/dist/runtime/presets/default/components/KDataIterator/KDataIterator.vue +40 -31
  130. package/dist/runtime/presets/default/components/KDatatable/KDatatable.vue +110 -92
  131. package/dist/runtime/presets/default/components/KDatePicker/KDatePicker.d.vue.ts +7 -0
  132. package/dist/runtime/presets/default/components/KDatePicker/KDatePicker.vue +58 -25
  133. package/dist/runtime/presets/default/components/KDatePicker/KDatePicker.vue.d.ts +7 -0
  134. package/dist/runtime/presets/default/components/KDateTimePicker/KDateTimePicker.d.vue.ts +6 -0
  135. package/dist/runtime/presets/default/components/KDateTimePicker/KDateTimePicker.vue +81 -52
  136. package/dist/runtime/presets/default/components/KDateTimePicker/KDateTimePicker.vue.d.ts +6 -0
  137. package/dist/runtime/presets/default/components/KDropdown/KDropdown.d.vue.ts +10 -0
  138. package/dist/runtime/presets/default/components/KDropdown/KDropdown.vue +57 -25
  139. package/dist/runtime/presets/default/components/KDropdown/KDropdown.vue.d.ts +10 -0
  140. package/dist/runtime/presets/default/components/KGantt/KGantt.vue +337 -241
  141. package/dist/runtime/presets/default/components/KGantt/KGanttRuler.vue +40 -35
  142. package/dist/runtime/presets/default/components/KGantt/KGanttTimeline.vue +170 -140
  143. package/dist/runtime/presets/default/components/KGrid/KGrid.vue +62 -60
  144. package/dist/runtime/presets/default/components/KHourPicker/KHourPicker.d.vue.ts +8 -2
  145. package/dist/runtime/presets/default/components/KHourPicker/KHourPicker.vue +48 -28
  146. package/dist/runtime/presets/default/components/KHourPicker/KHourPicker.vue.d.ts +8 -2
  147. package/dist/runtime/presets/default/components/KHourSelect/KHourSelect.vue +34 -28
  148. package/dist/runtime/presets/default/components/KIcon/KIcon.d.vue.ts +1 -1
  149. package/dist/runtime/presets/default/components/KIcon/KIcon.vue +31 -22
  150. package/dist/runtime/presets/default/components/KIcon/KIcon.vue.d.ts +1 -1
  151. package/dist/runtime/presets/default/components/KLoader/KLoader.vue +65 -48
  152. package/dist/runtime/presets/default/components/KMaskTextbox/KMaskTextbox.d.vue.ts +2 -0
  153. package/dist/runtime/presets/default/components/KMaskTextbox/KMaskTextbox.vue +117 -84
  154. package/dist/runtime/presets/default/components/KMaskTextbox/KMaskTextbox.vue.d.ts +2 -0
  155. package/dist/runtime/presets/default/components/KModal/KModal.d.vue.ts +2 -0
  156. package/dist/runtime/presets/default/components/KModal/KModal.vue +85 -35
  157. package/dist/runtime/presets/default/components/KModal/KModal.vue.d.ts +2 -0
  158. package/dist/runtime/presets/default/components/KPagination/KPagination.vue +42 -40
  159. package/dist/runtime/presets/default/components/KPanel/KPanel.d.vue.ts +3 -0
  160. package/dist/runtime/presets/default/components/KPanel/KPanel.vue +97 -34
  161. package/dist/runtime/presets/default/components/KPanel/KPanel.vue.d.ts +3 -0
  162. package/dist/runtime/presets/default/components/KRadiobox/KRadiobox.d.vue.ts +2 -0
  163. package/dist/runtime/presets/default/components/KRadiobox/KRadiobox.vue +40 -35
  164. package/dist/runtime/presets/default/components/KRadiobox/KRadiobox.vue.d.ts +2 -0
  165. package/dist/runtime/presets/default/components/KRangeSlider/KRangeSlider.vue +158 -125
  166. package/dist/runtime/presets/default/components/KSlider/KSlider.vue +123 -100
  167. package/dist/runtime/presets/default/components/KTabs/KTabItem.vue +40 -37
  168. package/dist/runtime/presets/default/components/KTabs/KTabs.vue +9 -6
  169. package/dist/runtime/presets/default/components/KTextarea/KTextarea.d.vue.ts +2 -0
  170. package/dist/runtime/presets/default/components/KTextarea/KTextarea.vue +40 -21
  171. package/dist/runtime/presets/default/components/KTextarea/KTextarea.vue.d.ts +2 -0
  172. package/dist/runtime/presets/default/components/KTextbox/KTextbox.d.vue.ts +4 -1
  173. package/dist/runtime/presets/default/components/KTextbox/KTextbox.vue +76 -37
  174. package/dist/runtime/presets/default/components/KTextbox/KTextbox.vue.d.ts +4 -1
  175. package/dist/runtime/presets/default/components/KToast/KToast.d.vue.ts +17 -0
  176. package/dist/runtime/presets/default/components/KToast/KToast.vue +118 -0
  177. package/dist/runtime/presets/default/components/KToast/KToast.vue.d.ts +17 -0
  178. package/dist/runtime/presets/default/components/KTree/KTree.vue +103 -80
  179. package/dist/runtime/presets/default/components/KTreePicker/KTreePicker.d.vue.ts +6 -0
  180. package/dist/runtime/presets/default/components/KTreePicker/KTreePicker.vue +88 -55
  181. package/dist/runtime/presets/default/components/KTreePicker/KTreePicker.vue.d.ts +6 -0
  182. package/dist/runtime/presets/default/components/KTreeView/KTreeCell.vue +31 -30
  183. package/dist/runtime/presets/default/components/KTreeView/KTreeView.vue +34 -27
  184. package/package.json +5 -5
@@ -30,159 +30,189 @@
30
30
  )
31
31
  </template>
32
32
 
33
- <script setup>
34
- import { computed, ref } from "vue";
35
- import { getSnapMs, getGanttMarkers } from "#toolkit/components/KGantt/KGantt.logic";
36
- const props = defineProps({
37
- row: { type: null, required: false },
38
- tasks: { type: Array, required: true },
39
- titleField: { type: String, required: true },
40
- getTaskStyle: { type: Function, required: true },
41
- startMs: { type: Number, required: true },
42
- endMs: { type: Number, required: true },
43
- editable: { type: Boolean, required: false },
44
- snapTo: { type: String, required: false },
45
- resourceTypeField: { type: String, required: false },
46
- resolvedMapping: { type: null, required: false },
47
- activeDrag: { type: [Object, null], required: false },
48
- mode: { type: String, required: false }
49
- });
50
- const emit = defineEmits(["task-dragstart", "cell-mouseenter"]);
51
- const wrapperRef = ref(null);
33
+ <script lang="ts" setup>
34
+ import { computed, ref } from 'vue'
35
+ import { getSnapMs, type IGanttTask, getGanttMarkers } from '#toolkit/components/KGantt/KGantt.logic'
36
+
37
+ const props = defineProps<{
38
+ row?: any
39
+ tasks: IGanttTask[]
40
+ titleField: string
41
+ getTaskStyle: (task: any) => any
42
+ startMs: number
43
+ endMs: number
44
+ editable?: boolean
45
+ snapTo?: string
46
+ resourceTypeField?: string
47
+ resolvedMapping?: any
48
+ // Global drag state provided from KGantt parent
49
+ activeDrag?: {
50
+ taskId: string | number
51
+ currentStartMs: number
52
+ currentEndMs: number
53
+ sourceRowId: string | number
54
+ } | null
55
+ mode?: 'date' | 'numeric'
56
+ }>()
57
+
58
+ const emit = defineEmits<{
59
+ (e: 'task-dragstart', payload: { event: MouseEvent; task: IGanttTask; rowId: any; mode: string; wrapperEl: HTMLElement | null }): void
60
+ (e: 'cell-mouseenter', rowId: any): void
61
+ }>()
62
+
63
+ const wrapperRef = ref<HTMLElement | null>(null)
64
+
52
65
  const onCellMouseEnter = () => {
53
- emit("cell-mouseenter", props.row?.id);
54
- };
55
- const isDraggingThisTask = (taskId) => {
56
- return props.activeDrag?.taskId === taskId;
57
- };
66
+ emit('cell-mouseenter', props.row?.id)
67
+ }
68
+
69
+ const isDraggingThisTask = (taskId: string | number): boolean => {
70
+ return props.activeDrag?.taskId === taskId
71
+ }
72
+
73
+ // Shows live-updated position during drag
58
74
  const displayTasks = computed(() => {
59
- if (!props.activeDrag || !props.resolvedMapping) return props.tasks;
60
- const drag = props.activeDrag;
61
- return props.tasks.map((t) => {
62
- if (t.id === drag.taskId) {
63
- return {
64
- ...t,
65
- [props.resolvedMapping.startDate]: drag.currentStartMs,
66
- [props.resolvedMapping.endDate]: drag.currentEndMs
67
- };
68
- }
69
- return t;
70
- });
71
- });
72
- const getTaskAppearance = (task) => {
73
- const field = props.resolvedMapping?.appearanceField || "appearance";
74
- return task[field] || "filled";
75
- };
76
- const getBarStyle = (task) => props.getTaskStyle(task);
77
- const gridMarkers = computed(() => getGanttMarkers(props.startMs, props.endMs, props.mode));
75
+ if (!props.activeDrag || !props.resolvedMapping) return props.tasks
76
+ const drag = props.activeDrag
77
+ return props.tasks.map(t => {
78
+ if (t.id === drag.taskId) {
79
+ return {
80
+ ...t,
81
+ [props.resolvedMapping.startDate]: drag.currentStartMs,
82
+ [props.resolvedMapping.endDate]: drag.currentEndMs
83
+ }
84
+ }
85
+ return t
86
+ })
87
+ })
88
+
89
+ const getTaskAppearance = (task: any) => {
90
+ const field = props.resolvedMapping?.appearanceField || 'appearance'
91
+ return task[field] || 'filled'
92
+ }
93
+
94
+ // Use parent getTaskStyle but pass live task data
95
+ const getBarStyle = (task: any) => props.getTaskStyle(task)
96
+
97
+ const gridMarkers = computed(() => getGanttMarkers(props.startMs, props.endMs, props.mode))
78
98
  </script>
79
99
 
80
- <style scoped>
100
+ <style lang="scss" scoped>
81
101
  .gantt-cell {
82
- width: 100%;
83
- height: 100%;
84
- min-height: 36px;
85
- display: flex;
86
- align-items: center;
87
- padding: 4px 0;
102
+ width: 100%;
103
+ height: 100%;
104
+ min-height: 36px;
105
+ display: flex;
106
+ align-items: center;
107
+ padding: 4px 0;
88
108
  }
89
109
 
90
110
  .gantt-bar-wrapper {
91
- position: relative;
92
- width: 100%;
93
- height: 28px;
94
- border-radius: 4px;
95
- background-color: var(--surface-ground, #f1f5f9);
111
+ position: relative;
112
+ width: 100%;
113
+ height: 28px;
114
+ border-radius: 4px;
115
+ background-color: var(--surface-ground, #f1f5f9);
96
116
  }
97
117
 
98
118
  .gantt-grid-line {
99
- position: absolute;
100
- top: 0;
101
- bottom: 0;
102
- width: 1px;
103
- background: var(--border-color, #e2e8f0);
104
- z-index: 0;
119
+ position: absolute;
120
+ top: 0;
121
+ bottom: 0;
122
+ width: 1px;
123
+ background: var(--border-color, #e2e8f0);
124
+ z-index: 0;
105
125
  }
106
126
 
107
127
  .gantt-bar {
108
- position: absolute;
109
- top: 3px;
110
- bottom: 3px;
111
- border-radius: 4px;
112
- display: flex;
113
- align-items: center;
114
- padding: 0px;
115
- white-space: nowrap;
116
- overflow: hidden;
117
- box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
118
- z-index: 1;
119
- cursor: grab;
120
- user-select: none;
121
- transition: filter 0.2s;
122
- }
123
- .gantt-bar--filled {
124
- background-color: var(--task-color);
125
- }
126
- .gantt-bar--filled .gantt-title {
127
- color: #fff;
128
- }
129
- .gantt-bar--bordered {
130
- background-color: #fff;
131
- border: 1px solid var(--task-color);
132
- }
133
- .gantt-bar--bordered .gantt-title {
134
- color: #000;
135
- }
136
- .gantt-bar--dashed {
137
- background-color: #fff;
138
- border: 1px dashed var(--task-color);
139
- }
140
- .gantt-bar--dashed .gantt-title {
141
- color: #000;
142
- }
143
- .gantt-bar--shaded {
144
- background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--task-color), transparent 80%), color-mix(in srgb, var(--task-color), transparent 80%) 8px, #fff 8px, #fff 16px);
145
- border: 1px solid var(--task-color);
146
- }
147
- .gantt-bar--shaded .gantt-title {
148
- color: #000;
149
- background: rgba(255, 255, 255, 0.6);
150
- border-radius: 2px;
151
- }
152
- .gantt-bar.is-dragging {
153
- opacity: 0.8;
154
- z-index: 50;
155
- cursor: grabbing;
156
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
157
- }
158
- .gantt-bar:hover {
159
- filter: brightness(1.1);
160
- z-index: 2;
161
- }
162
- .gantt-bar .gantt-resize-handle {
163
- position: absolute;
164
- top: 0;
165
- bottom: 0;
166
- width: 8px;
167
- cursor: ew-resize;
168
- z-index: 3;
169
- }
170
- .gantt-bar .gantt-resize-handle:hover {
171
- background: rgba(255, 255, 255, 0.3);
172
- }
173
- .gantt-bar .gantt-resize-handle.left {
174
- left: 0;
175
- }
176
- .gantt-bar .gantt-resize-handle.right {
177
- right: 0;
178
- }
179
- .gantt-bar .gantt-title {
180
- font-size: 0.72rem;
181
- font-weight: 600;
182
- overflow: hidden;
183
- text-overflow: ellipsis;
184
- user-select: none;
185
- pointer-events: none;
186
- padding: 0px 8px;
128
+ position: absolute;
129
+ top: 3px;
130
+ bottom: 3px;
131
+ border-radius: 4px;
132
+ display: flex;
133
+ align-items: center;
134
+ padding: 0px;
135
+ white-space: nowrap;
136
+ overflow: hidden;
137
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
138
+ z-index: 1;
139
+ cursor: grab;
140
+ user-select: none;
141
+ transition: filter 0.2s;
142
+
143
+ &--filled {
144
+ background-color: var(--task-color);
145
+ .gantt-title { color: #fff; }
146
+ }
147
+
148
+ &--bordered {
149
+ background-color: #fff;
150
+ border: 1px solid var(--task-color);
151
+ .gantt-title { color: #000; }
152
+ }
153
+
154
+ &--dashed {
155
+ background-color: #fff;
156
+ border: 1px dashed var(--task-color);
157
+ .gantt-title { color: #000; }
158
+ }
159
+
160
+ &--shaded {
161
+ background: repeating-linear-gradient(
162
+ 45deg,
163
+ color-mix(in srgb, var(--task-color), transparent 80%),
164
+ color-mix(in srgb, var(--task-color), transparent 80%) 8px,
165
+ #fff 8px,
166
+ #fff 16px
167
+ );
168
+ border: 1px solid var(--task-color);
169
+ .gantt-title {
170
+ color: #000;
171
+ background: rgba(255, 255, 255, 0.6);
172
+ border-radius: 2px;
173
+ }
174
+ }
175
+
176
+ &.is-dragging {
177
+ opacity: 0.8;
178
+ z-index: 50;
179
+ cursor: grabbing;
180
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
181
+ }
182
+
183
+ &:hover {
184
+ filter: brightness(1.1);
185
+ z-index: 2;
186
+ }
187
+
188
+ .gantt-resize-handle {
189
+ position: absolute;
190
+ top: 0;
191
+ bottom: 0;
192
+ width: 8px;
193
+ cursor: ew-resize;
194
+ z-index: 3;
195
+
196
+ &:hover {
197
+ background: rgba(255, 255, 255, 0.3);
198
+ }
199
+
200
+ &.left {
201
+ left: 0;
202
+ }
203
+ &.right {
204
+ right: 0;
205
+ }
206
+ }
207
+
208
+ .gantt-title {
209
+ font-size: 0.72rem;
210
+ font-weight: 600;
211
+ overflow: hidden;
212
+ text-overflow: ellipsis;
213
+ user-select: none;
214
+ pointer-events: none;
215
+ padding: 0px 8px;
216
+ }
187
217
  }
188
218
  </style>
@@ -3,68 +3,70 @@
3
3
  slot
4
4
  </template>
5
5
 
6
- <script setup>
7
- const props = defineProps({
8
- classes: { type: String, required: true }
9
- });
6
+ <script lang="ts" setup>
7
+ const props = defineProps<{
8
+ classes: string
9
+ }>()
10
10
  </script>
11
11
 
12
- <style scoped>
12
+ <style lang="scss" scoped>
13
13
  .KGrid {
14
- display: flex;
15
- gap: var(--grid-gap);
16
- box-sizing: border-box;
17
- }
18
- .KGrid.direction-row {
19
- flex-direction: row;
20
- }
21
- .KGrid.direction-column {
22
- flex-direction: column;
23
- }
24
- .KGrid.wrap {
25
- flex-wrap: wrap;
26
- }
27
- .KGrid.nowrap {
28
- flex-wrap: nowrap;
29
- }
30
- .KGrid.flex-child > * {
31
- flex-grow: 1;
32
- width: 100%;
33
- }
34
- .KGrid.flex-align-start {
35
- align-items: flex-start;
36
- }
37
- .KGrid.flex-align-center {
38
- align-items: center;
39
- }
40
- .KGrid.flex-align-end {
41
- align-items: flex-end;
42
- }
43
- .KGrid.flex-align-baseline {
44
- align-items: baseline;
45
- }
46
- .KGrid.flex-align-stretch {
47
- align-items: stretch;
48
- }
49
- .KGrid.justify-start {
50
- justify-content: flex-start;
51
- }
52
- .KGrid.justify-center {
53
- justify-content: center;
54
- }
55
- .KGrid.justify-end {
56
- justify-content: flex-end;
57
- }
58
- .KGrid.justify-between {
59
- justify-content: space-between;
60
- }
61
- .KGrid.justify-around {
62
- justify-content: space-around;
63
- }
64
- .KGrid.justify-evenly {
65
- justify-content: space-evenly;
66
- }
67
- .KGrid.no-gap {
68
- gap: 0;
14
+ display: flex;
15
+ gap: var(--grid-gap);
16
+ box-sizing: border-box;
17
+
18
+ &.direction-row {
19
+ flex-direction: row;
20
+ }
21
+ &.direction-column {
22
+ flex-direction: column;
23
+ }
24
+ &.wrap {
25
+ flex-wrap: wrap;
26
+ }
27
+ &.nowrap {
28
+ flex-wrap: nowrap;
29
+ }
30
+
31
+ &.flex-child > * {
32
+ flex-grow: 1;
33
+ width: auto;
34
+ }
35
+ &.flex-align-start {
36
+ align-items: flex-start;
37
+ }
38
+ &.flex-align-center {
39
+ align-items: center;
40
+ }
41
+ &.flex-align-end {
42
+ align-items: flex-end;
43
+ }
44
+ &.flex-align-baseline {
45
+ align-items: baseline;
46
+ }
47
+ &.flex-align-stretch {
48
+ align-items: stretch;
49
+ }
50
+ &.justify-start {
51
+ justify-content: flex-start;
52
+ }
53
+ &.justify-center {
54
+ justify-content: center;
55
+ }
56
+ &.justify-end {
57
+ justify-content: flex-end;
58
+ }
59
+ &.justify-between {
60
+ justify-content: space-between;
61
+ }
62
+ &.justify-around {
63
+ justify-content: space-around;
64
+ }
65
+ &.justify-evenly {
66
+ justify-content: space-evenly;
67
+ }
68
+ &.no-gap {
69
+ gap: 0;
70
+ }
69
71
  }
70
72
  </style>
@@ -1,5 +1,5 @@
1
1
  type __VLS_Props = {
2
- modelValue: string;
2
+ maskedModel: string;
3
3
  isOpen: boolean;
4
4
  step: number;
5
5
  format: string;
@@ -7,13 +7,19 @@ type __VLS_Props = {
7
7
  endHour?: string;
8
8
  placeholder: string;
9
9
  disabled: boolean;
10
- toggleDropdown: () => void;
10
+ showClear: boolean;
11
+ textboxClicked: () => void;
11
12
  closeDropdown: () => void;
12
13
  onTimeSelect: (time: string) => void;
14
+ clear: () => void;
15
+ validation?: 'success' | 'warning' | 'error' | null;
16
+ validationText?: string;
13
17
  };
14
18
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
19
+ "update:maskedModel": (value: string) => any;
15
20
  "update:isOpen": (value: boolean) => any;
16
21
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
22
+ "onUpdate:maskedModel"?: ((value: string) => any) | undefined;
17
23
  "onUpdate:isOpen"?: ((value: boolean) => any) | undefined;
18
24
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
19
25
  declare const _default: typeof __VLS_export;
@@ -1,22 +1,25 @@
1
1
  <template lang="pug">
2
- .KHourPicker
3
- KTextbox(
4
- :modelValue="modelValue"
2
+ .KHourPicker(ref="activatorRef")
3
+ KMaskTextbox(
4
+ v-model:maskedValue="maskedModel"
5
+ :mask="format"
5
6
  :placeholder="placeholder"
6
- :disabled="disabled"
7
- readonly
8
- @click="toggleDropdown"
7
+ :showClear="showClear"
8
+ @click.stop="textboxClicked"
9
+ @clear="clear"
10
+ :validation="validation"
11
+ :validationText="validationText"
9
12
  )
10
13
  template(#append)
11
- KIcon(iconname="clock" clickable @click="toggleDropdown")
14
+ KIcon(iconname="clock" clickable @click.stop="textboxClicked")
12
15
 
13
16
  KDropdown(
14
17
  :isOpen="isOpen"
15
18
  @update:isOpen="$emit('update:isOpen', $event)"
16
- fullWidth
19
+ :anchorEl="activatorRef"
17
20
  )
18
21
  KHourSelect(
19
- :modelValue="modelValue"
22
+ :modelValue="maskedModel"
20
23
  :step="step"
21
24
  :format="format"
22
25
  :startHour="startHour"
@@ -25,27 +28,44 @@
25
28
  )
26
29
  </template>
27
30
 
28
- <script setup>
29
- import KHourSelect from "../../../../components/KHourSelect/KHourSelect.global.vue";
30
- defineProps({
31
- modelValue: { type: String, required: true },
32
- isOpen: { type: Boolean, required: true },
33
- step: { type: Number, required: true },
34
- format: { type: String, required: true },
35
- startHour: { type: String, required: true },
36
- endHour: { type: String, required: false },
37
- placeholder: { type: String, required: true },
38
- disabled: { type: Boolean, required: true },
39
- toggleDropdown: { type: Function, required: true },
40
- closeDropdown: { type: Function, required: true },
41
- onTimeSelect: { type: Function, required: true }
42
- });
43
- defineEmits(["update:isOpen"]);
31
+ <script lang="ts" setup>
32
+ import { ref, computed } from 'vue'
33
+ const activatorRef = ref<HTMLElement | null>(null)
34
+ import KHourSelect from '../../../../components/KHourSelect/KHourSelect.global.vue'
35
+ import KMaskTextbox from '../../../../components/KMaskTextbox/KMaskTextbox.global.vue'
36
+
37
+ const props = defineProps<{
38
+ maskedModel: string
39
+ isOpen: boolean
40
+ step: number
41
+ format: string
42
+ startHour: string
43
+ endHour?: string
44
+ placeholder: string
45
+ disabled: boolean
46
+ showClear: boolean
47
+ textboxClicked: () => void
48
+ closeDropdown: () => void
49
+ onTimeSelect: (time: string) => void
50
+ clear: () => void
51
+ validation?: 'success' | 'warning' | 'error' | null
52
+ validationText?: string
53
+ }>()
54
+
55
+ const emit = defineEmits<{
56
+ (e: 'update:isOpen', value: boolean): void
57
+ (e: 'update:maskedModel', value: string): void
58
+ }>()
59
+
60
+ const maskedModel = computed({
61
+ get: () => props.maskedModel,
62
+ set: (value) => emit('update:maskedModel', value)
63
+ })
44
64
  </script>
45
65
 
46
- <style scoped>
66
+ <style lang="scss" scoped>
47
67
  .KHourPicker {
48
- position: relative;
49
- width: 100%;
68
+ position: relative;
69
+ width: 100%;
50
70
  }
51
71
  </style>
@@ -1,5 +1,5 @@
1
1
  type __VLS_Props = {
2
- modelValue: string;
2
+ maskedModel: string;
3
3
  isOpen: boolean;
4
4
  step: number;
5
5
  format: string;
@@ -7,13 +7,19 @@ type __VLS_Props = {
7
7
  endHour?: string;
8
8
  placeholder: string;
9
9
  disabled: boolean;
10
- toggleDropdown: () => void;
10
+ showClear: boolean;
11
+ textboxClicked: () => void;
11
12
  closeDropdown: () => void;
12
13
  onTimeSelect: (time: string) => void;
14
+ clear: () => void;
15
+ validation?: 'success' | 'warning' | 'error' | null;
16
+ validationText?: string;
13
17
  };
14
18
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
19
+ "update:maskedModel": (value: string) => any;
15
20
  "update:isOpen": (value: boolean) => any;
16
21
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
22
+ "onUpdate:maskedModel"?: ((value: string) => any) | undefined;
17
23
  "onUpdate:isOpen"?: ((value: boolean) => any) | undefined;
18
24
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
19
25
  declare const _default: typeof __VLS_export;