@katlux/toolkit 0.1.0-beta.6 → 0.1.0-beta.60
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/compiled/composables/usePresetComponent.mjs +21 -16
- package/dist/module.cjs +52 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +52 -0
- package/dist/runtime/components/KBulkActions/KBulkActions.logic.d.ts +9 -2
- package/dist/runtime/components/KButton/KButton.logic.d.ts +1 -1
- package/dist/runtime/components/KCalendar/KCalendar.global.d.vue.ts +11 -12
- package/dist/runtime/components/KCalendar/KCalendar.global.vue.d.ts +11 -12
- package/dist/runtime/components/KCalendar/KCalendar.logic.d.ts +1 -0
- package/dist/runtime/components/KCalendar/KCalendar.logic.js +25 -10
- package/dist/runtime/components/KCheckbox/KCheckbox.global.d.vue.ts +30 -0
- package/dist/runtime/components/KCheckbox/KCheckbox.global.vue +4 -1
- package/dist/runtime/components/KCheckbox/KCheckbox.global.vue.d.ts +30 -0
- package/dist/runtime/components/KCheckbox/KCheckbox.logic.d.ts +17 -0
- package/dist/runtime/components/KCheckbox/KCheckbox.logic.js +16 -1
- package/dist/runtime/components/KCombobox/KCombobox.global.d.vue.ts +75 -8
- package/dist/runtime/components/KCombobox/KCombobox.global.vue +18 -4
- package/dist/runtime/components/KCombobox/KCombobox.global.vue.d.ts +75 -8
- package/dist/runtime/components/KCombobox/KCombobox.logic.d.ts +46 -8
- package/dist/runtime/components/KCombobox/KCombobox.logic.js +77 -9
- package/dist/runtime/components/KCompositeInput/KCompositeInput.global.d.vue.ts +169 -0
- package/dist/runtime/components/KCompositeInput/KCompositeInput.global.vue +46 -0
- package/dist/runtime/components/KCompositeInput/KCompositeInput.global.vue.d.ts +169 -0
- package/dist/runtime/components/KCompositeInput/KCompositeInput.logic.d.ts +127 -0
- package/dist/runtime/components/KCompositeInput/KCompositeInput.logic.js +160 -0
- package/dist/runtime/components/KDatatable/KDataIterator.global.vue +1 -1
- package/dist/runtime/components/KDatatable/KDataIterator.logic.d.ts +2 -2
- package/dist/runtime/components/KDatatable/KDatatable.global.vue +1 -1
- package/dist/runtime/components/KDatatable/KDatatable.logic.d.ts +2 -2
- package/dist/runtime/components/KDatePicker/KDatePicker.global.d.vue.ts +95 -8
- package/dist/runtime/components/KDatePicker/KDatePicker.global.vue +27 -3
- package/dist/runtime/components/KDatePicker/KDatePicker.global.vue.d.ts +95 -8
- package/dist/runtime/components/KDatePicker/KDatePicker.logic.d.ts +43 -1
- package/dist/runtime/components/KDatePicker/KDatePicker.logic.js +106 -7
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.d.vue.ts +84 -8
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.vue +26 -3
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.vue.d.ts +84 -8
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.logic.d.ts +38 -1
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.logic.js +161 -7
- package/dist/runtime/components/KDropdown/KDropdown.global.d.vue.ts +27 -0
- package/dist/runtime/components/KDropdown/KDropdown.global.vue +14 -4
- package/dist/runtime/components/KDropdown/KDropdown.global.vue.d.ts +27 -0
- package/dist/runtime/components/KDropdown/KDropdown.logic.d.ts +36 -1
- package/dist/runtime/components/KDropdown/KDropdown.logic.js +92 -4
- package/dist/runtime/components/KGrid/KGrid.global.d.vue.ts +7 -56
- package/dist/runtime/components/KGrid/KGrid.global.vue +9 -2
- package/dist/runtime/components/KGrid/KGrid.global.vue.d.ts +7 -56
- package/dist/runtime/components/KHourPicker/KHourPicker.global.d.vue.ts +41 -0
- package/dist/runtime/components/KHourPicker/KHourPicker.global.vue +27 -12
- package/dist/runtime/components/KHourPicker/KHourPicker.global.vue.d.ts +41 -0
- package/dist/runtime/components/KHourPicker/KHourPicker.logic.d.ts +26 -3
- package/dist/runtime/components/KHourPicker/KHourPicker.logic.js +34 -10
- package/dist/runtime/components/KHourSelect/KHourSelect.logic.js +4 -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/KIcon/KIcon.logic.d.ts +1 -1
- package/dist/runtime/components/KIcon/KIcon.logic.js +13 -8
- package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.d.vue.ts +21 -0
- package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.vue +4 -2
- package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.vue.d.ts +21 -0
- package/dist/runtime/components/KMaskTextbox/KMaskTextbox.logic.d.ts +11 -0
- package/dist/runtime/components/KMaskTextbox/KMaskTextbox.logic.js +9 -0
- package/dist/runtime/components/KModal/KModal.global.d.vue.ts +14 -2
- package/dist/runtime/components/KModal/KModal.global.vue +5 -1
- package/dist/runtime/components/KModal/KModal.global.vue.d.ts +14 -2
- package/dist/runtime/components/KModal/KModal.logic.d.ts +10 -2
- package/dist/runtime/components/KModal/KModal.logic.js +12 -3
- package/dist/runtime/components/KPagination/KPagination.global.vue +1 -1
- package/dist/runtime/components/KPanel/KPanel.global.d.vue.ts +5 -28
- package/dist/runtime/components/KPanel/KPanel.global.vue +12 -4
- package/dist/runtime/components/KPanel/KPanel.global.vue.d.ts +5 -28
- package/dist/runtime/components/KPanel/KPanel.logic.d.ts +10 -0
- package/dist/runtime/components/KPanel/KPanel.logic.js +8 -0
- package/dist/runtime/components/KRadiobox/KRadiobox.global.d.vue.ts +21 -0
- package/dist/runtime/components/KRadiobox/KRadiobox.global.vue +3 -1
- package/dist/runtime/components/KRadiobox/KRadiobox.global.vue.d.ts +21 -0
- package/dist/runtime/components/KRadiobox/KRadiobox.logic.d.ts +11 -0
- package/dist/runtime/components/KRadiobox/KRadiobox.logic.js +9 -0
- package/dist/runtime/components/KTextarea/KTextarea.global.d.vue.ts +21 -0
- package/dist/runtime/components/KTextarea/KTextarea.global.vue +3 -1
- package/dist/runtime/components/KTextarea/KTextarea.global.vue.d.ts +21 -0
- package/dist/runtime/components/KTextarea/KTextarea.logic.d.ts +11 -0
- package/dist/runtime/components/KTextarea/KTextarea.logic.js +9 -0
- package/dist/runtime/components/KTextbox/KTextbox.global.d.vue.ts +35 -2
- package/dist/runtime/components/KTextbox/KTextbox.global.vue +7 -4
- package/dist/runtime/components/KTextbox/KTextbox.global.vue.d.ts +35 -2
- package/dist/runtime/components/KTextbox/KTextbox.logic.d.ts +21 -4
- package/dist/runtime/components/KTextbox/KTextbox.logic.js +21 -5
- package/dist/runtime/components/KToast/KToast.global.d.vue.ts +57 -0
- package/dist/runtime/components/KToast/KToast.global.vue +32 -0
- package/dist/runtime/components/KToast/KToast.global.vue.d.ts +57 -0
- package/dist/runtime/components/KToast/KToast.logic.d.ts +34 -0
- package/dist/runtime/components/KToast/KToast.logic.js +47 -0
- package/dist/runtime/components/KTree/KTree.logic.d.ts +1 -1
- package/dist/runtime/components/KTreePicker/KTreePicker.global.d.vue.ts +65 -7
- package/dist/runtime/components/KTreePicker/KTreePicker.global.vue +15 -3
- package/dist/runtime/components/KTreePicker/KTreePicker.global.vue.d.ts +65 -7
- package/dist/runtime/components/KTreePicker/KTreePicker.logic.d.ts +37 -5
- package/dist/runtime/components/KTreePicker/KTreePicker.logic.js +32 -1
- package/dist/runtime/components/KTreeView/KTreeView.global.d.vue.ts +8 -8
- package/dist/runtime/components/KTreeView/KTreeView.global.vue.d.ts +8 -8
- package/dist/runtime/components/KTreeView/KTreeView.logic.d.ts +1 -1
- package/dist/runtime/composables/usePresetComponent.d.ts +16 -0
- package/dist/runtime/composables/usePresetComponent.js +21 -16
- package/dist/runtime/presets/default/assets/scss/css-variables.css +64 -13
- package/dist/runtime/presets/default/assets/scss/css-variables.scss +286 -0
- package/dist/runtime/presets/default/assets/scss/docs.scss +52 -0
- package/dist/runtime/presets/default/assets/scss/index.css +99 -13
- package/dist/runtime/presets/default/assets/scss/index.scss +42 -0
- package/dist/runtime/presets/default/assets/scss/mixins.scss +94 -0
- package/dist/runtime/presets/default/assets/scss/reset.scss +16 -0
- package/dist/runtime/presets/default/components/KAccordion/KAccordion.vue +5 -2
- package/dist/runtime/presets/default/components/KAccordion/KAccordionItem.vue +40 -37
- package/dist/runtime/presets/default/components/KBulkActions/KBulkActions.vue +29 -22
- package/dist/runtime/presets/default/components/KButton/KButton.vue +147 -428
- package/dist/runtime/presets/default/components/KCalendar/KCalendar.vue +57 -53
- package/dist/runtime/presets/default/components/KCalendar/KCalendarMonth.vue +189 -161
- package/dist/runtime/presets/default/components/KCheckbox/KCheckbox.d.vue.ts +3 -0
- package/dist/runtime/presets/default/components/KCheckbox/KCheckbox.vue +59 -42
- package/dist/runtime/presets/default/components/KCheckbox/KCheckbox.vue.d.ts +3 -0
- package/dist/runtime/presets/default/components/KCombobox/KCombobox.d.vue.ts +7 -0
- package/dist/runtime/presets/default/components/KCombobox/KCombobox.vue +108 -79
- package/dist/runtime/presets/default/components/KCombobox/KCombobox.vue.d.ts +7 -0
- package/dist/runtime/presets/default/components/KCombobox/KComboboxList.d.vue.ts +1 -0
- package/dist/runtime/presets/default/components/KCombobox/KComboboxList.vue +79 -61
- package/dist/runtime/presets/default/components/KCombobox/KComboboxList.vue.d.ts +1 -0
- package/dist/runtime/presets/default/components/KCompositeInput/KCompositeInput.d.vue.ts +29 -0
- package/dist/runtime/presets/default/components/KCompositeInput/KCompositeInput.vue +202 -0
- package/dist/runtime/presets/default/components/KCompositeInput/KCompositeInput.vue.d.ts +29 -0
- package/dist/runtime/presets/default/components/KDataIterator/KDataIterator.vue +40 -31
- package/dist/runtime/presets/default/components/KDatatable/KDatatable.vue +110 -92
- package/dist/runtime/presets/default/components/KDatePicker/KDatePicker.d.vue.ts +7 -0
- package/dist/runtime/presets/default/components/KDatePicker/KDatePicker.vue +58 -25
- package/dist/runtime/presets/default/components/KDatePicker/KDatePicker.vue.d.ts +7 -0
- package/dist/runtime/presets/default/components/KDateTimePicker/KDateTimePicker.d.vue.ts +6 -0
- package/dist/runtime/presets/default/components/KDateTimePicker/KDateTimePicker.vue +81 -52
- package/dist/runtime/presets/default/components/KDateTimePicker/KDateTimePicker.vue.d.ts +6 -0
- package/dist/runtime/presets/default/components/KDropdown/KDropdown.d.vue.ts +10 -0
- package/dist/runtime/presets/default/components/KDropdown/KDropdown.vue +57 -25
- package/dist/runtime/presets/default/components/KDropdown/KDropdown.vue.d.ts +10 -0
- package/dist/runtime/presets/default/components/KGantt/KGantt.vue +337 -241
- package/dist/runtime/presets/default/components/KGantt/KGanttRuler.vue +40 -35
- package/dist/runtime/presets/default/components/KGantt/KGanttTimeline.vue +170 -140
- package/dist/runtime/presets/default/components/KGrid/KGrid.vue +62 -60
- package/dist/runtime/presets/default/components/KHourPicker/KHourPicker.d.vue.ts +8 -2
- package/dist/runtime/presets/default/components/KHourPicker/KHourPicker.vue +48 -28
- package/dist/runtime/presets/default/components/KHourPicker/KHourPicker.vue.d.ts +8 -2
- package/dist/runtime/presets/default/components/KHourSelect/KHourSelect.vue +34 -28
- package/dist/runtime/presets/default/components/KIcon/KIcon.d.vue.ts +1 -1
- package/dist/runtime/presets/default/components/KIcon/KIcon.vue +31 -22
- package/dist/runtime/presets/default/components/KIcon/KIcon.vue.d.ts +1 -1
- package/dist/runtime/presets/default/components/KLoader/KLoader.vue +65 -48
- package/dist/runtime/presets/default/components/KMaskTextbox/KMaskTextbox.d.vue.ts +2 -0
- package/dist/runtime/presets/default/components/KMaskTextbox/KMaskTextbox.vue +117 -84
- package/dist/runtime/presets/default/components/KMaskTextbox/KMaskTextbox.vue.d.ts +2 -0
- package/dist/runtime/presets/default/components/KModal/KModal.d.vue.ts +2 -0
- package/dist/runtime/presets/default/components/KModal/KModal.vue +85 -35
- package/dist/runtime/presets/default/components/KModal/KModal.vue.d.ts +2 -0
- package/dist/runtime/presets/default/components/KPagination/KPagination.vue +42 -40
- package/dist/runtime/presets/default/components/KPanel/KPanel.d.vue.ts +3 -0
- package/dist/runtime/presets/default/components/KPanel/KPanel.vue +97 -34
- package/dist/runtime/presets/default/components/KPanel/KPanel.vue.d.ts +3 -0
- package/dist/runtime/presets/default/components/KRadiobox/KRadiobox.d.vue.ts +2 -0
- package/dist/runtime/presets/default/components/KRadiobox/KRadiobox.vue +40 -35
- package/dist/runtime/presets/default/components/KRadiobox/KRadiobox.vue.d.ts +2 -0
- package/dist/runtime/presets/default/components/KRangeSlider/KRangeSlider.vue +158 -125
- package/dist/runtime/presets/default/components/KSlider/KSlider.vue +123 -100
- package/dist/runtime/presets/default/components/KTabs/KTabItem.vue +40 -37
- package/dist/runtime/presets/default/components/KTabs/KTabs.vue +9 -6
- package/dist/runtime/presets/default/components/KTextarea/KTextarea.d.vue.ts +2 -0
- package/dist/runtime/presets/default/components/KTextarea/KTextarea.vue +40 -21
- package/dist/runtime/presets/default/components/KTextarea/KTextarea.vue.d.ts +2 -0
- package/dist/runtime/presets/default/components/KTextbox/KTextbox.d.vue.ts +4 -1
- package/dist/runtime/presets/default/components/KTextbox/KTextbox.vue +76 -37
- package/dist/runtime/presets/default/components/KTextbox/KTextbox.vue.d.ts +4 -1
- package/dist/runtime/presets/default/components/KToast/KToast.d.vue.ts +17 -0
- package/dist/runtime/presets/default/components/KToast/KToast.vue +118 -0
- package/dist/runtime/presets/default/components/KToast/KToast.vue.d.ts +17 -0
- package/dist/runtime/presets/default/components/KTree/KTree.vue +103 -80
- package/dist/runtime/presets/default/components/KTreePicker/KTreePicker.d.vue.ts +6 -0
- package/dist/runtime/presets/default/components/KTreePicker/KTreePicker.vue +88 -55
- package/dist/runtime/presets/default/components/KTreePicker/KTreePicker.vue.d.ts +6 -0
- package/dist/runtime/presets/default/components/KTreeView/KTreeCell.vue +31 -30
- package/dist/runtime/presets/default/components/KTreeView/KTreeView.vue +34 -27
- package/package.json +5 -5
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
<template lang="pug">
|
|
2
|
+
Teleport(to="body" :disabled="!teleport")
|
|
3
|
+
Transition(name="toast-fade")
|
|
4
|
+
.KToast(
|
|
5
|
+
v-if="modelValue"
|
|
6
|
+
:class="[`type-${type}`, { 'is-fixed': teleport }]"
|
|
7
|
+
)
|
|
8
|
+
.KToast--content
|
|
9
|
+
slot {{ text }}
|
|
10
|
+
.KToast--actions
|
|
11
|
+
button.close-btn(@click="$emit('close')")
|
|
12
|
+
KIcon(iconname="close" :width="16" :height="16")
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script lang="ts" setup>
|
|
16
|
+
import type { KToastType } from '../../../../components/KToast/KToast.logic'
|
|
17
|
+
|
|
18
|
+
defineProps<{
|
|
19
|
+
modelValue: boolean
|
|
20
|
+
text?: string
|
|
21
|
+
timeout?: number
|
|
22
|
+
teleport?: boolean
|
|
23
|
+
type?: KToastType
|
|
24
|
+
}>()
|
|
25
|
+
|
|
26
|
+
defineEmits(['update:modelValue', 'close'])
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<style lang="scss" scoped>
|
|
30
|
+
.KToast {
|
|
31
|
+
--current-toast-bg: var(--panel-bg-default);
|
|
32
|
+
--current-toast-border: var(--neutral-200);
|
|
33
|
+
--current-toast-text: var(--font-color-default);
|
|
34
|
+
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
padding: var(--gap-sm) var(--gap-md);
|
|
38
|
+
border-radius: var(--border-radius-md);
|
|
39
|
+
border: 1px solid var(--current-toast-border);
|
|
40
|
+
background-color: color-mix(in srgb, var(--current-toast-bg), transparent calc((1 - var(--panel-bg-opacity, 0.9)) * 100%));
|
|
41
|
+
backdrop-filter: blur(var(--panel-blur, 8px));
|
|
42
|
+
box-shadow: var(--shadow-lg);
|
|
43
|
+
min-width: 250px;
|
|
44
|
+
max-width: 450px;
|
|
45
|
+
pointer-events: auto;
|
|
46
|
+
z-index: 9999;
|
|
47
|
+
|
|
48
|
+
&.is-fixed {
|
|
49
|
+
position: fixed;
|
|
50
|
+
top: 20px;
|
|
51
|
+
right: 20px;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&.type-primary {
|
|
55
|
+
--current-toast-bg: var(--panel-bg-primary);
|
|
56
|
+
--current-toast-border: var(--color-primary-300);
|
|
57
|
+
}
|
|
58
|
+
&.type-success {
|
|
59
|
+
--current-toast-bg: var(--panel-bg-success);
|
|
60
|
+
--current-toast-border: var(--color-success-300);
|
|
61
|
+
}
|
|
62
|
+
&.type-warning {
|
|
63
|
+
--current-toast-bg: var(--panel-bg-warning);
|
|
64
|
+
--current-toast-border: var(--color-warning-300);
|
|
65
|
+
}
|
|
66
|
+
&.type-danger, &.type-error {
|
|
67
|
+
--current-toast-bg: var(--panel-bg-danger);
|
|
68
|
+
--current-toast-border: var(--color-danger-300);
|
|
69
|
+
}
|
|
70
|
+
&.type-info {
|
|
71
|
+
--current-toast-bg: var(--panel-bg-info);
|
|
72
|
+
--current-toast-border: var(--color-info-300);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
&--content {
|
|
76
|
+
flex: 1;
|
|
77
|
+
font-size: var(--font-size-md);
|
|
78
|
+
color: var(--current-toast-text);
|
|
79
|
+
margin-right: var(--gap-md);
|
|
80
|
+
line-height: 1.4;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
&--actions {
|
|
84
|
+
display: flex;
|
|
85
|
+
align-items: center;
|
|
86
|
+
|
|
87
|
+
.close-btn {
|
|
88
|
+
background: transparent;
|
|
89
|
+
border: none;
|
|
90
|
+
padding: 4px;
|
|
91
|
+
cursor: pointer;
|
|
92
|
+
display: flex;
|
|
93
|
+
align-items: center;
|
|
94
|
+
justify-content: center;
|
|
95
|
+
border-radius: var(--border-radius-sm);
|
|
96
|
+
color: var(--current-toast-text);
|
|
97
|
+
opacity: 0.6;
|
|
98
|
+
transition: opacity var(--transition-fast), background-color var(--transition-fast);
|
|
99
|
+
|
|
100
|
+
&:hover {
|
|
101
|
+
opacity: 1;
|
|
102
|
+
background-color: rgba(0, 0, 0, 0.05);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.toast-fade-enter-active,
|
|
109
|
+
.toast-fade-leave-active {
|
|
110
|
+
transition: all 0.3s ease;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.toast-fade-enter-from,
|
|
114
|
+
.toast-fade-leave-to {
|
|
115
|
+
opacity: 0;
|
|
116
|
+
transform: translateY(-20px) scale(0.95);
|
|
117
|
+
}
|
|
118
|
+
</style>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { KToastType } from '../../../../components/KToast/KToast.logic.js';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
modelValue: boolean;
|
|
4
|
+
text?: string;
|
|
5
|
+
timeout?: number;
|
|
6
|
+
teleport?: boolean;
|
|
7
|
+
type?: KToastType;
|
|
8
|
+
};
|
|
9
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
10
|
+
close: (...args: any[]) => void;
|
|
11
|
+
"update:modelValue": (...args: any[]) => void;
|
|
12
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
13
|
+
onClose?: ((...args: any[]) => any) | undefined;
|
|
14
|
+
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
15
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
16
|
+
declare const _default: typeof __VLS_export;
|
|
17
|
+
export default _default;
|
|
@@ -36,91 +36,114 @@
|
|
|
36
36
|
.default-item
|
|
37
37
|
KIcon(v-if="iconField && row[iconField]" :iconname="row[iconField]" :width="16" :height="16")
|
|
38
38
|
span {{ row[labelField] }}
|
|
39
|
+
|
|
39
40
|
</template>
|
|
40
41
|
|
|
41
|
-
<script setup>
|
|
42
|
-
import { computed } from
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
42
|
+
<script lang="ts" setup>
|
|
43
|
+
import { computed, type Ref } from 'vue'
|
|
44
|
+
|
|
45
|
+
const props = defineProps<{
|
|
46
|
+
visibleRows: any[] // Rows with __treeNode attached
|
|
47
|
+
expandedNodes: Set<string | number>
|
|
48
|
+
labelField: string
|
|
49
|
+
iconField: string
|
|
50
|
+
disabled: boolean
|
|
51
|
+
multiSelect: boolean
|
|
52
|
+
isNodeSelected: (node: any) => boolean
|
|
53
|
+
toggleNode: (id: string | number) => void
|
|
54
|
+
selectable: boolean
|
|
55
|
+
dataProvider?: {
|
|
56
|
+
loading: Ref<boolean>
|
|
57
|
+
initialLoad?: Ref<boolean>
|
|
58
|
+
}
|
|
59
|
+
}>()
|
|
60
|
+
|
|
61
|
+
// Helper to get ID if needed, but we use row[idKey] or row.id in key
|
|
62
|
+
const idKey = 'id' // Simplify for now, or pass as prop if needed. usually id.
|
|
63
|
+
|
|
64
|
+
const emit = defineEmits<{
|
|
65
|
+
(e: 'select', row: any): void
|
|
66
|
+
}>()
|
|
67
|
+
|
|
68
|
+
function onNodeClick(row: any) {
|
|
69
|
+
if (!props.disabled) {
|
|
70
|
+
emit('select', row)
|
|
71
|
+
}
|
|
61
72
|
}
|
|
62
|
-
|
|
73
|
+
|
|
74
|
+
const isLoading = computed(() => props.dataProvider?.loading?.value || props.dataProvider?.initialLoad?.value || false)
|
|
63
75
|
</script>
|
|
64
76
|
|
|
65
|
-
<style scoped>
|
|
77
|
+
<style lang="scss" scoped>
|
|
66
78
|
.KTree {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
.
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
.
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
79
|
+
width: 100%;
|
|
80
|
+
position: relative; // Ensure loader overlay is contained
|
|
81
|
+
|
|
82
|
+
.tree-list {
|
|
83
|
+
display: flex;
|
|
84
|
+
flex-direction: column;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.tree-node {
|
|
88
|
+
display: flex;
|
|
89
|
+
align-items: center;
|
|
90
|
+
padding: 4px 8px;
|
|
91
|
+
min-height: 32px;
|
|
92
|
+
transition: background-color 0.2s;
|
|
93
|
+
|
|
94
|
+
&:hover {
|
|
95
|
+
background-color: var(--hover-bg, #f5f5f5);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.node-content {
|
|
99
|
+
display: flex;
|
|
100
|
+
align-items: center;
|
|
101
|
+
width: 100%;
|
|
102
|
+
gap: 4px;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.tree-toggle {
|
|
106
|
+
cursor: pointer;
|
|
107
|
+
display: inline-flex;
|
|
108
|
+
align-items: center;
|
|
109
|
+
justify-content: center;
|
|
110
|
+
width: 20px;
|
|
111
|
+
height: 20px;
|
|
112
|
+
border-radius: 4px;
|
|
113
|
+
flex-shrink: 0;
|
|
114
|
+
|
|
115
|
+
&:hover {
|
|
116
|
+
background-color: var(--hover-light, #e0e0e0);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.tree-spacer {
|
|
121
|
+
width: 20px;
|
|
122
|
+
height: 20px;
|
|
123
|
+
flex-shrink: 0;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.node-label {
|
|
127
|
+
flex: 1;
|
|
128
|
+
display: flex;
|
|
129
|
+
align-items: center;
|
|
130
|
+
overflow: hidden;
|
|
131
|
+
text-overflow: ellipsis;
|
|
132
|
+
white-space: nowrap;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.selection-control {
|
|
136
|
+
margin-right: 8px;
|
|
137
|
+
display: flex;
|
|
138
|
+
align-items: center;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.default-item {
|
|
142
|
+
display: flex;
|
|
143
|
+
align-items: center;
|
|
144
|
+
gap: 6px;
|
|
145
|
+
cursor: pointer;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
125
148
|
}
|
|
126
149
|
</style>
|
|
@@ -8,6 +8,7 @@ type __VLS_Props = {
|
|
|
8
8
|
labelField: string;
|
|
9
9
|
placeholder: string;
|
|
10
10
|
searchbox: boolean;
|
|
11
|
+
searchPlaceholder: string;
|
|
11
12
|
multiSelect: boolean;
|
|
12
13
|
searchtext: string;
|
|
13
14
|
filteredOptions: any[];
|
|
@@ -18,10 +19,15 @@ type __VLS_Props = {
|
|
|
18
19
|
isSelected: (option: any) => boolean;
|
|
19
20
|
loading: boolean;
|
|
20
21
|
closeOnSelect: boolean;
|
|
22
|
+
fullWidth: boolean;
|
|
23
|
+
validation?: 'success' | 'warning' | 'error' | null;
|
|
24
|
+
validationText?: string;
|
|
21
25
|
};
|
|
22
26
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
27
|
+
"update:isOptionsOpen": (value: boolean) => any;
|
|
23
28
|
"update:searchtext": (value: string) => any;
|
|
24
29
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
30
|
+
"onUpdate:isOptionsOpen"?: ((value: boolean) => any) | undefined;
|
|
25
31
|
"onUpdate:searchtext"?: ((value: string) => any) | undefined;
|
|
26
32
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
27
33
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<template lang="pug">
|
|
2
2
|
KCombobox(
|
|
3
|
+
:dataProvider="dataProvider"
|
|
3
4
|
:disabled="disabled"
|
|
4
|
-
:isOptionsOpen="
|
|
5
|
+
v-model:isOptionsOpen="isOptionsOpenModel"
|
|
5
6
|
:labelField="labelField"
|
|
6
7
|
:placeholder="placeholder"
|
|
7
8
|
:searchbox="searchbox"
|
|
@@ -13,68 +14,100 @@ KCombobox(
|
|
|
13
14
|
:selectItem="selectItem"
|
|
14
15
|
:isSelected="isSelected"
|
|
15
16
|
:loading="loading"
|
|
17
|
+
:fullWidth="fullWidth"
|
|
18
|
+
:validation="validation"
|
|
19
|
+
:validationText="validationText"
|
|
16
20
|
)
|
|
17
|
-
|
|
18
|
-
.
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
showClear
|
|
24
|
-
)
|
|
25
|
-
KTree(
|
|
26
|
-
:dataProvider="dataProvider"
|
|
27
|
-
:idKey="idKey"
|
|
28
|
-
:parentKey="parentKey"
|
|
29
|
-
:labelField="labelField"
|
|
30
|
-
:iconField="iconField"
|
|
31
|
-
:loading="loading"
|
|
32
|
-
:multiSelect="multiSelect"
|
|
33
|
-
:isNodeSelected="isSelected"
|
|
34
|
-
:searchtext="searchtext"
|
|
35
|
-
:selectable="true"
|
|
36
|
-
@select="onTreeSelect"
|
|
21
|
+
.KTreePicker__tree-container
|
|
22
|
+
.KTreePicker__search(v-if="searchbox")
|
|
23
|
+
KTextbox(
|
|
24
|
+
v-model="searchtextModel"
|
|
25
|
+
:placeholder="searchPlaceholder"
|
|
26
|
+
showClear
|
|
37
27
|
)
|
|
28
|
+
KTree(
|
|
29
|
+
:dataProvider="dataProvider"
|
|
30
|
+
:idKey="idKey"
|
|
31
|
+
:parentKey="parentKey"
|
|
32
|
+
:labelField="labelField"
|
|
33
|
+
:iconField="iconField"
|
|
34
|
+
:loading="loading"
|
|
35
|
+
:multiSelect="multiSelect"
|
|
36
|
+
:isNodeSelected="isSelected"
|
|
37
|
+
:searchtext="searchtext"
|
|
38
|
+
:selectable="true"
|
|
39
|
+
@select="onTreeSelect"
|
|
40
|
+
)
|
|
38
41
|
</template>
|
|
39
42
|
|
|
40
|
-
<script setup>
|
|
41
|
-
import { computed } from
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
43
|
+
<script lang="ts" setup>
|
|
44
|
+
import { computed } from 'vue'
|
|
45
|
+
// Props passed from global component (which handles the logic)
|
|
46
|
+
const props = defineProps<{
|
|
47
|
+
// Tree specific
|
|
48
|
+
dataProvider: any
|
|
49
|
+
idKey?: string
|
|
50
|
+
parentKey?: string
|
|
51
|
+
iconField?: string
|
|
52
|
+
|
|
53
|
+
// Combobox Logic Props
|
|
54
|
+
disabled: boolean
|
|
55
|
+
isOptionsOpen: boolean
|
|
56
|
+
labelField: string
|
|
57
|
+
placeholder: string
|
|
58
|
+
searchbox: boolean
|
|
59
|
+
searchPlaceholder: string
|
|
60
|
+
multiSelect: boolean
|
|
61
|
+
searchtext: string
|
|
62
|
+
filteredOptions: any[]
|
|
63
|
+
getSelectedContent: () => any[]
|
|
64
|
+
toggleDropdown: () => void
|
|
65
|
+
closeDropdown: () => void
|
|
66
|
+
selectItem: (option: any) => void
|
|
67
|
+
isSelected: (option: any) => boolean
|
|
68
|
+
loading: boolean
|
|
69
|
+
closeOnSelect: boolean
|
|
70
|
+
fullWidth: boolean
|
|
71
|
+
validation?: 'success' | 'warning' | 'error' | null
|
|
72
|
+
validationText?: string
|
|
73
|
+
}>()
|
|
74
|
+
|
|
75
|
+
const emit = defineEmits<{
|
|
76
|
+
(e: 'update:searchtext', value: string): void
|
|
77
|
+
(e: 'update:isOptionsOpen', value: boolean): void
|
|
78
|
+
}>()
|
|
79
|
+
|
|
64
80
|
const searchtextModel = computed({
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
})
|
|
68
|
-
|
|
69
|
-
|
|
81
|
+
get: () => props.searchtext,
|
|
82
|
+
set: (value) => emit('update:searchtext', value)
|
|
83
|
+
})
|
|
84
|
+
|
|
85
|
+
const isOptionsOpenModel = computed({
|
|
86
|
+
get: () => props.isOptionsOpen,
|
|
87
|
+
set: (value) => emit('update:isOptionsOpen', value)
|
|
88
|
+
})
|
|
89
|
+
|
|
90
|
+
function onTreeSelect(node: any) {
|
|
91
|
+
// Call the selectItem method from logic
|
|
92
|
+
props.selectItem(node)
|
|
93
|
+
|
|
94
|
+
// If closeOnSelect is true, we should close the dropdown
|
|
95
|
+
// but selectItem might have already toggled it if it was a distinct action?
|
|
96
|
+
// In KCombobox.logic.ts: selectItem sets isOptionsOpen = !closeOnSelect
|
|
97
|
+
// So it should be handled there!
|
|
98
|
+
|
|
99
|
+
// However, selectItem expects a ComboboxItem (TDataRow).
|
|
100
|
+
// KTree returns a node object which should be compatible.
|
|
70
101
|
}
|
|
71
102
|
</script>
|
|
72
103
|
|
|
73
|
-
<style scoped>
|
|
104
|
+
<style lang="scss" scoped>
|
|
74
105
|
.KTreePicker__tree-container {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
106
|
+
padding: 10px;
|
|
107
|
+
max-height: 400px;
|
|
108
|
+
overflow-y: auto;
|
|
109
|
+
min-width: 250px; // Ensure tree has some width
|
|
79
110
|
}
|
|
111
|
+
|
|
112
|
+
|
|
80
113
|
</style>
|
|
@@ -8,6 +8,7 @@ type __VLS_Props = {
|
|
|
8
8
|
labelField: string;
|
|
9
9
|
placeholder: string;
|
|
10
10
|
searchbox: boolean;
|
|
11
|
+
searchPlaceholder: string;
|
|
11
12
|
multiSelect: boolean;
|
|
12
13
|
searchtext: string;
|
|
13
14
|
filteredOptions: any[];
|
|
@@ -18,10 +19,15 @@ type __VLS_Props = {
|
|
|
18
19
|
isSelected: (option: any) => boolean;
|
|
19
20
|
loading: boolean;
|
|
20
21
|
closeOnSelect: boolean;
|
|
22
|
+
fullWidth: boolean;
|
|
23
|
+
validation?: 'success' | 'warning' | 'error' | null;
|
|
24
|
+
validationText?: string;
|
|
21
25
|
};
|
|
22
26
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
27
|
+
"update:isOptionsOpen": (value: boolean) => any;
|
|
23
28
|
"update:searchtext": (value: string) => any;
|
|
24
29
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
30
|
+
"onUpdate:isOptionsOpen"?: ((value: boolean) => any) | undefined;
|
|
25
31
|
"onUpdate:searchtext"?: ((value: string) => any) | undefined;
|
|
26
32
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
27
33
|
declare const _default: typeof __VLS_export;
|
|
@@ -6,47 +6,48 @@
|
|
|
6
6
|
span.tree-content {{ value }}
|
|
7
7
|
</template>
|
|
8
8
|
|
|
9
|
-
<script setup>
|
|
10
|
-
defineProps
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
})
|
|
9
|
+
<script lang="ts" setup>
|
|
10
|
+
defineProps<{
|
|
11
|
+
value: any
|
|
12
|
+
depth: number
|
|
13
|
+
hasChildren: boolean
|
|
14
|
+
isExpanded: boolean
|
|
15
|
+
toggle: () => void
|
|
16
|
+
}>()
|
|
17
17
|
</script>
|
|
18
18
|
|
|
19
|
-
<style scoped>
|
|
19
|
+
<style lang="scss" scoped>
|
|
20
20
|
.tree-cell {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
display: flex;
|
|
22
|
+
align-items: center;
|
|
23
|
+
gap: 4px;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
.tree-toggle {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
27
|
+
cursor: pointer;
|
|
28
|
+
display: inline-flex;
|
|
29
|
+
align-items: center;
|
|
30
|
+
justify-content: center;
|
|
31
|
+
width: 20px;
|
|
32
|
+
height: 20px;
|
|
33
|
+
border-radius: 2px;
|
|
34
|
+
flex-shrink: 0;
|
|
35
|
+
|
|
36
|
+
&:hover {
|
|
37
|
+
background-color: var(--hover-light, #e0e0e0);
|
|
38
|
+
}
|
|
38
39
|
}
|
|
39
40
|
|
|
40
41
|
.tree-spacer {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
width: 20px;
|
|
43
|
+
flex-shrink: 0;
|
|
44
|
+
display: inline-block;
|
|
44
45
|
}
|
|
45
46
|
|
|
46
47
|
.tree-content {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
flex: 1;
|
|
49
|
+
overflow: hidden;
|
|
50
|
+
text-overflow: ellipsis;
|
|
51
|
+
white-space: nowrap;
|
|
51
52
|
}
|
|
52
53
|
</style>
|