@katlux/toolkit 0.1.0-beta.74 → 0.1.0-beta.76
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/module.json +1 -1
- package/dist/runtime/components/KButton/KButton.logic.d.ts +1 -1
- package/dist/runtime/components/KCombobox/KCombobox.global.d.vue.ts +11 -2
- package/dist/runtime/components/KCombobox/KCombobox.global.vue +1 -0
- package/dist/runtime/components/KCombobox/KCombobox.global.vue.d.ts +11 -2
- package/dist/runtime/components/KCombobox/KCombobox.logic.d.ts +5 -0
- package/dist/runtime/components/KCombobox/KCombobox.logic.js +11 -7
- package/dist/runtime/components/KCompositeInput/KCompositeInput.global.d.vue.ts +47 -2
- package/dist/runtime/components/KCompositeInput/KCompositeInput.global.vue +11 -2
- package/dist/runtime/components/KCompositeInput/KCompositeInput.global.vue.d.ts +47 -2
- package/dist/runtime/components/KCompositeInput/KCompositeInput.logic.d.ts +61 -1
- package/dist/runtime/components/KCompositeInput/KCompositeInput.logic.js +112 -9
- package/dist/runtime/components/KDatatable/KDataIterator.global.d.vue.ts +1 -1
- package/dist/runtime/components/KDatatable/KDataIterator.global.vue.d.ts +1 -1
- package/dist/runtime/components/KDatePicker/KDatePicker.global.d.vue.ts +11 -2
- package/dist/runtime/components/KDatePicker/KDatePicker.global.vue +1 -0
- package/dist/runtime/components/KDatePicker/KDatePicker.global.vue.d.ts +11 -2
- package/dist/runtime/components/KDatePicker/KDatePicker.logic.d.ts +5 -0
- package/dist/runtime/components/KDatePicker/KDatePicker.logic.js +12 -0
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.d.vue.ts +11 -2
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.vue +1 -0
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.vue.d.ts +11 -2
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.logic.d.ts +5 -0
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.logic.js +7 -0
- package/dist/runtime/components/KHourPicker/KHourPicker.global.d.vue.ts +10 -1
- package/dist/runtime/components/KHourPicker/KHourPicker.global.vue +1 -0
- package/dist/runtime/components/KHourPicker/KHourPicker.global.vue.d.ts +10 -1
- package/dist/runtime/components/KHourPicker/KHourPicker.logic.d.ts +5 -0
- package/dist/runtime/components/KHourPicker/KHourPicker.logic.js +4 -0
- package/dist/runtime/components/KHourSelect/KHourSelect.global.d.vue.ts +9 -0
- package/dist/runtime/components/KHourSelect/KHourSelect.global.vue +1 -0
- package/dist/runtime/components/KHourSelect/KHourSelect.global.vue.d.ts +9 -0
- package/dist/runtime/components/KHourSelect/KHourSelect.logic.d.ts +5 -0
- package/dist/runtime/components/KHourSelect/KHourSelect.logic.js +4 -0
- package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.d.vue.ts +10 -1
- package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.vue +1 -0
- package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.vue.d.ts +10 -1
- package/dist/runtime/components/KMaskTextbox/KMaskTextbox.logic.d.ts +5 -0
- package/dist/runtime/components/KMaskTextbox/KMaskTextbox.logic.js +14 -5
- package/dist/runtime/components/KRangeSlider/KRangeSlider.global.d.vue.ts +9 -0
- package/dist/runtime/components/KRangeSlider/KRangeSlider.global.vue +1 -0
- package/dist/runtime/components/KRangeSlider/KRangeSlider.global.vue.d.ts +9 -0
- package/dist/runtime/components/KRangeSlider/KRangeSlider.logic.d.ts +5 -0
- package/dist/runtime/components/KRangeSlider/KRangeSlider.logic.js +4 -0
- package/dist/runtime/components/KSearchTree/KSearchTree.logic.d.ts +7 -1
- package/dist/runtime/components/KSearchTree/KSearchTree.logic.js +6 -1
- package/dist/runtime/components/KSearchTreeDropdown/KSearchTreeDropdown.logic.d.ts +7 -1
- package/dist/runtime/components/KSearchTreeDropdown/KSearchTreeDropdown.logic.js +6 -1
- package/dist/runtime/components/KSlider/KSlider.global.d.vue.ts +9 -0
- package/dist/runtime/components/KSlider/KSlider.global.vue +1 -0
- package/dist/runtime/components/KSlider/KSlider.global.vue.d.ts +9 -0
- package/dist/runtime/components/KSlider/KSlider.logic.d.ts +5 -0
- package/dist/runtime/components/KSlider/KSlider.logic.js +4 -0
- package/dist/runtime/components/KTextarea/KTextarea.global.d.vue.ts +10 -1
- package/dist/runtime/components/KTextarea/KTextarea.global.vue +1 -0
- package/dist/runtime/components/KTextarea/KTextarea.global.vue.d.ts +10 -1
- package/dist/runtime/components/KTextarea/KTextarea.logic.d.ts +5 -0
- package/dist/runtime/components/KTextarea/KTextarea.logic.js +4 -0
- package/dist/runtime/components/KTextbox/KTextbox.global.d.vue.ts +10 -1
- package/dist/runtime/components/KTextbox/KTextbox.global.vue +1 -0
- package/dist/runtime/components/KTextbox/KTextbox.global.vue.d.ts +10 -1
- 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/KTreePicker/KTreePicker.global.d.vue.ts +13 -4
- package/dist/runtime/components/KTreePicker/KTreePicker.global.vue +1 -0
- package/dist/runtime/components/KTreePicker/KTreePicker.global.vue.d.ts +13 -4
- package/dist/runtime/components/KTreePicker/KTreePicker.logic.d.ts +5 -0
- package/dist/runtime/components/KTreePicker/KTreePicker.logic.js +4 -0
- 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/presets/default/assets/scss/css-variables.css +3 -0
- package/dist/runtime/presets/default/assets/scss/css-variables.scss +3 -0
- package/dist/runtime/presets/default/assets/scss/index.css +11 -0
- package/dist/runtime/presets/default/assets/scss/index.scss +8 -1
- package/dist/runtime/presets/default/components/KCombobox/KCombobox.d.vue.ts +1 -0
- package/dist/runtime/presets/default/components/KCombobox/KCombobox.vue +22 -2
- package/dist/runtime/presets/default/components/KCombobox/KCombobox.vue.d.ts +1 -0
- package/dist/runtime/presets/default/components/KCompositeInput/KCompositeInput.d.vue.ts +5 -0
- package/dist/runtime/presets/default/components/KCompositeInput/KCompositeInput.vue +79 -47
- package/dist/runtime/presets/default/components/KCompositeInput/KCompositeInput.vue.d.ts +5 -0
- package/dist/runtime/presets/default/components/KDatePicker/KDatePicker.d.vue.ts +1 -0
- package/dist/runtime/presets/default/components/KDatePicker/KDatePicker.vue +2 -0
- package/dist/runtime/presets/default/components/KDatePicker/KDatePicker.vue.d.ts +1 -0
- package/dist/runtime/presets/default/components/KDateTimePicker/KDateTimePicker.d.vue.ts +1 -0
- package/dist/runtime/presets/default/components/KDateTimePicker/KDateTimePicker.vue +2 -0
- package/dist/runtime/presets/default/components/KDateTimePicker/KDateTimePicker.vue.d.ts +1 -0
- package/dist/runtime/presets/default/components/KHourPicker/KHourPicker.d.vue.ts +1 -0
- package/dist/runtime/presets/default/components/KHourPicker/KHourPicker.vue +2 -0
- package/dist/runtime/presets/default/components/KHourPicker/KHourPicker.vue.d.ts +1 -0
- package/dist/runtime/presets/default/components/KHourSelect/KHourSelect.d.vue.ts +1 -0
- package/dist/runtime/presets/default/components/KHourSelect/KHourSelect.vue +2 -0
- package/dist/runtime/presets/default/components/KHourSelect/KHourSelect.vue.d.ts +1 -0
- package/dist/runtime/presets/default/components/KMaskTextbox/KMaskTextbox.d.vue.ts +1 -0
- package/dist/runtime/presets/default/components/KMaskTextbox/KMaskTextbox.vue +2 -0
- package/dist/runtime/presets/default/components/KMaskTextbox/KMaskTextbox.vue.d.ts +1 -0
- package/dist/runtime/presets/default/components/KRangeSlider/KRangeSlider.d.vue.ts +1 -0
- package/dist/runtime/presets/default/components/KRangeSlider/KRangeSlider.vue +2 -0
- package/dist/runtime/presets/default/components/KRangeSlider/KRangeSlider.vue.d.ts +1 -0
- package/dist/runtime/presets/default/components/KSearchTree/KSearchTree.d.vue.ts +4 -1
- package/dist/runtime/presets/default/components/KSearchTree/KSearchTree.vue +9 -1
- package/dist/runtime/presets/default/components/KSearchTree/KSearchTree.vue.d.ts +4 -1
- package/dist/runtime/presets/default/components/KSearchTreeDropdown/KSearchTreeDropdown.d.vue.ts +4 -1
- package/dist/runtime/presets/default/components/KSearchTreeDropdown/KSearchTreeDropdown.vue +9 -1
- package/dist/runtime/presets/default/components/KSearchTreeDropdown/KSearchTreeDropdown.vue.d.ts +4 -1
- package/dist/runtime/presets/default/components/KSlider/KSlider.d.vue.ts +1 -0
- package/dist/runtime/presets/default/components/KSlider/KSlider.vue +2 -0
- package/dist/runtime/presets/default/components/KSlider/KSlider.vue.d.ts +1 -0
- package/dist/runtime/presets/default/components/KTextarea/KTextarea.d.vue.ts +1 -0
- package/dist/runtime/presets/default/components/KTextarea/KTextarea.vue +3 -1
- package/dist/runtime/presets/default/components/KTextarea/KTextarea.vue.d.ts +1 -0
- package/dist/runtime/presets/default/components/KTextbox/KTextbox.d.vue.ts +1 -0
- package/dist/runtime/presets/default/components/KTextbox/KTextbox.vue +36 -8
- package/dist/runtime/presets/default/components/KTextbox/KTextbox.vue.d.ts +1 -0
- package/dist/runtime/presets/default/components/KTreePicker/KTreePicker.d.vue.ts +1 -0
- package/dist/runtime/presets/default/components/KTreePicker/KTreePicker.vue +2 -0
- package/dist/runtime/presets/default/components/KTreePicker/KTreePicker.vue.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import { computed, watch } from "vue";
|
|
1
|
+
import { computed, watch, unref } from "vue";
|
|
2
2
|
export const KCompositeInputDefaultProps = {
|
|
3
|
+
label: {
|
|
4
|
+
type: String,
|
|
5
|
+
default: ""
|
|
6
|
+
},
|
|
3
7
|
selectionValue: {
|
|
4
8
|
type: [String, Number, Object, Array],
|
|
5
9
|
default: null
|
|
@@ -52,6 +56,10 @@ export const KCompositeInputDefaultProps = {
|
|
|
52
56
|
type: Boolean,
|
|
53
57
|
default: false
|
|
54
58
|
},
|
|
59
|
+
inputFormat: {
|
|
60
|
+
type: String,
|
|
61
|
+
default: void 0
|
|
62
|
+
},
|
|
55
63
|
showClear: {
|
|
56
64
|
type: Boolean,
|
|
57
65
|
default: false
|
|
@@ -68,6 +76,18 @@ export const KCompositeInputDefaultProps = {
|
|
|
68
76
|
validationText: {
|
|
69
77
|
type: String,
|
|
70
78
|
default: ""
|
|
79
|
+
},
|
|
80
|
+
inputConfigField: {
|
|
81
|
+
type: String,
|
|
82
|
+
default: "inputConfig"
|
|
83
|
+
},
|
|
84
|
+
validateAll: {
|
|
85
|
+
type: Boolean,
|
|
86
|
+
default: false
|
|
87
|
+
},
|
|
88
|
+
singleValue: {
|
|
89
|
+
type: Boolean,
|
|
90
|
+
default: false
|
|
71
91
|
}
|
|
72
92
|
};
|
|
73
93
|
export function useKCompositeInputLogic(props, emit) {
|
|
@@ -82,11 +102,84 @@ export function useKCompositeInputLogic(props, emit) {
|
|
|
82
102
|
if (typeof props.selectionValue === "object") return props.selectionValue;
|
|
83
103
|
if (props.dataProvider && typeof props.dataProvider === "object") {
|
|
84
104
|
const provider = props.dataProvider;
|
|
85
|
-
const data = provider.allData
|
|
105
|
+
const data = unref(provider.allData) || unref(provider.pageData) || [];
|
|
86
106
|
return data.find((item) => getSelectionKey(item) === props.selectionValue) || props.selectionValue;
|
|
87
107
|
}
|
|
88
108
|
return props.selectionValue;
|
|
89
109
|
});
|
|
110
|
+
const resolvedInputConfig = computed(() => {
|
|
111
|
+
const configField = props.inputConfigField || "inputConfig";
|
|
112
|
+
const selectedItem = resolvedSelectionItem.value;
|
|
113
|
+
const itemConfig = selectedItem && typeof selectedItem === "object" && selectedItem[configField] ? { ...selectedItem[configField] } : {};
|
|
114
|
+
return {
|
|
115
|
+
type: itemConfig.type ?? props.type ?? "textbox",
|
|
116
|
+
inputType: itemConfig.inputType ?? props.inputType ?? "text",
|
|
117
|
+
mask: itemConfig.mask ?? props.mask ?? "",
|
|
118
|
+
placeholder: itemConfig.placeholder ?? props.inputPlaceholder ?? "",
|
|
119
|
+
showClear: itemConfig.showClear ?? props.showClear ?? false,
|
|
120
|
+
inputDataProvider: itemConfig.inputDataProvider ?? void 0,
|
|
121
|
+
inputLabelField: itemConfig.inputLabelField ?? props.labelField ?? "label",
|
|
122
|
+
inputValueField: itemConfig.inputValueField ?? props.valueField ?? "value",
|
|
123
|
+
inputSearchbox: itemConfig.inputSearchbox ?? false,
|
|
124
|
+
inputFormat: itemConfig.inputFormat ?? props.inputFormat ?? void 0,
|
|
125
|
+
validation: itemConfig.validation ?? props.validation ?? null,
|
|
126
|
+
validationText: itemConfig.validationText ?? props.validationText ?? ""
|
|
127
|
+
};
|
|
128
|
+
});
|
|
129
|
+
const resolvedValidation = computed(() => {
|
|
130
|
+
if (props.validateAll) {
|
|
131
|
+
const provider = props.dataProvider;
|
|
132
|
+
const data = unref(provider?.allData) || unref(provider?.pageData) || [];
|
|
133
|
+
const configField = props.inputConfigField || "inputConfig";
|
|
134
|
+
const activeConfig = resolvedInputConfig.value;
|
|
135
|
+
if (activeConfig.validation && activeConfig.validation !== "success") {
|
|
136
|
+
return activeConfig.validation;
|
|
137
|
+
}
|
|
138
|
+
for (const item of data) {
|
|
139
|
+
const itemConfig = item && typeof item === "object" && item[configField] ? item[configField] : null;
|
|
140
|
+
if (itemConfig && itemConfig.validation && itemConfig.validation !== "success") {
|
|
141
|
+
return itemConfig.validation;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
if (activeConfig.validation === "success") {
|
|
145
|
+
return "success";
|
|
146
|
+
}
|
|
147
|
+
for (const item of data) {
|
|
148
|
+
const itemConfig = item && typeof item === "object" && item[configField] ? item[configField] : null;
|
|
149
|
+
if (itemConfig && itemConfig.validation === "success") {
|
|
150
|
+
return "success";
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return resolvedInputConfig.value.validation || props.validation || null;
|
|
155
|
+
});
|
|
156
|
+
const resolvedValidationText = computed(() => {
|
|
157
|
+
if (props.validateAll) {
|
|
158
|
+
const provider = props.dataProvider;
|
|
159
|
+
const data = unref(provider?.allData) || unref(provider?.pageData) || [];
|
|
160
|
+
const configField = props.inputConfigField || "inputConfig";
|
|
161
|
+
const activeConfig = resolvedInputConfig.value;
|
|
162
|
+
if (activeConfig.validation && activeConfig.validation !== "success") {
|
|
163
|
+
return activeConfig.validationText || "";
|
|
164
|
+
}
|
|
165
|
+
for (const item of data) {
|
|
166
|
+
const itemConfig = item && typeof item === "object" && item[configField] ? item[configField] : null;
|
|
167
|
+
if (itemConfig && itemConfig.validation && itemConfig.validation !== "success") {
|
|
168
|
+
return itemConfig.validationText || "";
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
if (activeConfig.validation === "success") {
|
|
172
|
+
return activeConfig.validationText || "";
|
|
173
|
+
}
|
|
174
|
+
for (const item of data) {
|
|
175
|
+
const itemConfig = item && typeof item === "object" && item[configField] ? item[configField] : null;
|
|
176
|
+
if (itemConfig && itemConfig.validation === "success") {
|
|
177
|
+
return itemConfig.validationText || "";
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
return resolvedInputConfig.value.validationText || props.validationText || "";
|
|
182
|
+
});
|
|
90
183
|
const internalSelectionValue = computed({
|
|
91
184
|
get: () => resolvedSelectionItem.value,
|
|
92
185
|
set: (val) => {
|
|
@@ -110,15 +203,22 @@ export function useKCompositeInputLogic(props, emit) {
|
|
|
110
203
|
});
|
|
111
204
|
if (existingItem) {
|
|
112
205
|
emit("update:inputValue", existingItem.value);
|
|
113
|
-
} else {
|
|
114
|
-
const
|
|
206
|
+
} else if (!props.singleValue) {
|
|
207
|
+
const resolvedType = resolvedInputConfig.value.type;
|
|
208
|
+
const defaultValue = resolvedType?.includes("picker") ? null : "";
|
|
115
209
|
emit("update:inputValue", defaultValue);
|
|
210
|
+
} else if (props.inputValue !== null && props.inputValue !== "") {
|
|
211
|
+
updateModelValue(newSelection, props.inputValue);
|
|
116
212
|
}
|
|
117
213
|
}
|
|
118
214
|
});
|
|
119
215
|
function updateModelValue(selection, value) {
|
|
120
216
|
const selectionKey = getSelectionKey(selection);
|
|
121
217
|
if (selectionKey === void 0 || selectionKey === null) return;
|
|
218
|
+
if (props.singleValue) {
|
|
219
|
+
emit("update:modelValue", [{ selection, value }]);
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
122
222
|
const currentModel = [...props.modelValue || []];
|
|
123
223
|
const index = currentModel.findIndex((item) => {
|
|
124
224
|
const itemKey = getSelectionKey(item.selection);
|
|
@@ -145,16 +245,19 @@ export function useKCompositeInputLogic(props, emit) {
|
|
|
145
245
|
const inputProps = computed(() => ({
|
|
146
246
|
modelValue: props.inputValue,
|
|
147
247
|
"onUpdate:modelValue": (val) => internalInputValue.value = val,
|
|
148
|
-
placeholder:
|
|
149
|
-
type:
|
|
150
|
-
mask:
|
|
151
|
-
showClear:
|
|
248
|
+
placeholder: resolvedInputConfig.value.placeholder,
|
|
249
|
+
type: resolvedInputConfig.value.inputType,
|
|
250
|
+
mask: resolvedInputConfig.value.mask,
|
|
251
|
+
showClear: resolvedInputConfig.value.showClear
|
|
152
252
|
}));
|
|
153
253
|
return {
|
|
154
254
|
internalSelectionValue,
|
|
155
255
|
internalInputValue,
|
|
156
256
|
selectionProps,
|
|
157
257
|
inputProps,
|
|
158
|
-
resolvedSelectionItem
|
|
258
|
+
resolvedSelectionItem,
|
|
259
|
+
resolvedInputConfig,
|
|
260
|
+
resolvedValidation,
|
|
261
|
+
resolvedValidationText
|
|
159
262
|
};
|
|
160
263
|
}
|
|
@@ -11,8 +11,8 @@ interface Props {
|
|
|
11
11
|
page?: number;
|
|
12
12
|
}
|
|
13
13
|
declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
14
|
-
bulkActions: IKDatatableAction[];
|
|
15
14
|
search: string;
|
|
15
|
+
bulkActions: IKDatatableAction[];
|
|
16
16
|
loading: boolean;
|
|
17
17
|
visibleFields: Array<string> | null;
|
|
18
18
|
rowActions: IKDatatableAction[];
|
|
@@ -11,8 +11,8 @@ interface Props {
|
|
|
11
11
|
page?: number;
|
|
12
12
|
}
|
|
13
13
|
declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
14
|
-
bulkActions: IKDatatableAction[];
|
|
15
14
|
search: string;
|
|
15
|
+
bulkActions: IKDatatableAction[];
|
|
16
16
|
loading: boolean;
|
|
17
17
|
visibleFields: Array<string> | null;
|
|
18
18
|
rowActions: IKDatatableAction[];
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { type KDatePickerProps } from './KDatePicker.logic.js';
|
|
2
2
|
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
3
|
+
label: {
|
|
4
|
+
type: StringConstructor;
|
|
5
|
+
default: string;
|
|
6
|
+
};
|
|
3
7
|
format: {
|
|
4
8
|
type: StringConstructor;
|
|
5
9
|
default: string;
|
|
@@ -56,6 +60,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
56
60
|
"update:day": (value: string | Date) => any;
|
|
57
61
|
"update:isOpen": (value: boolean) => any;
|
|
58
62
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
63
|
+
label: {
|
|
64
|
+
type: StringConstructor;
|
|
65
|
+
default: string;
|
|
66
|
+
};
|
|
59
67
|
format: {
|
|
60
68
|
type: StringConstructor;
|
|
61
69
|
default: string;
|
|
@@ -112,13 +120,14 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
112
120
|
"onUpdate:day"?: ((value: string | Date) => any) | undefined;
|
|
113
121
|
"onUpdate:isOpen"?: ((value: boolean) => any) | undefined;
|
|
114
122
|
}>, {
|
|
123
|
+
label: string;
|
|
115
124
|
isOpen: boolean;
|
|
116
125
|
day: string | Date;
|
|
117
126
|
validation: "error" | "success" | "warning" | null | undefined;
|
|
118
|
-
validationText: string;
|
|
119
|
-
modelValue: string | Date;
|
|
120
127
|
placeholder: string;
|
|
121
128
|
teleportTo: string;
|
|
129
|
+
validationText: string;
|
|
130
|
+
modelValue: string | Date;
|
|
122
131
|
showClear: boolean;
|
|
123
132
|
align: "left" | "right" | undefined;
|
|
124
133
|
format: string;
|
|
@@ -15,6 +15,7 @@ const {
|
|
|
15
15
|
} = useKDatePickerLogic(props);
|
|
16
16
|
const presetComponent = usePresetComponent("KDatePicker", KDatePickerDefault);
|
|
17
17
|
const templateProps = computed(() => ({
|
|
18
|
+
label: props.label,
|
|
18
19
|
maskedModel: maskedModel.value,
|
|
19
20
|
calendarShow: calendarShow.value,
|
|
20
21
|
_date: _date.value,
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { type KDatePickerProps } from './KDatePicker.logic.js';
|
|
2
2
|
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
3
|
+
label: {
|
|
4
|
+
type: StringConstructor;
|
|
5
|
+
default: string;
|
|
6
|
+
};
|
|
3
7
|
format: {
|
|
4
8
|
type: StringConstructor;
|
|
5
9
|
default: string;
|
|
@@ -56,6 +60,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
56
60
|
"update:day": (value: string | Date) => any;
|
|
57
61
|
"update:isOpen": (value: boolean) => any;
|
|
58
62
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
63
|
+
label: {
|
|
64
|
+
type: StringConstructor;
|
|
65
|
+
default: string;
|
|
66
|
+
};
|
|
59
67
|
format: {
|
|
60
68
|
type: StringConstructor;
|
|
61
69
|
default: string;
|
|
@@ -112,13 +120,14 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
112
120
|
"onUpdate:day"?: ((value: string | Date) => any) | undefined;
|
|
113
121
|
"onUpdate:isOpen"?: ((value: boolean) => any) | undefined;
|
|
114
122
|
}>, {
|
|
123
|
+
label: string;
|
|
115
124
|
isOpen: boolean;
|
|
116
125
|
day: string | Date;
|
|
117
126
|
validation: "error" | "success" | "warning" | null | undefined;
|
|
118
|
-
validationText: string;
|
|
119
|
-
modelValue: string | Date;
|
|
120
127
|
placeholder: string;
|
|
121
128
|
teleportTo: string;
|
|
129
|
+
validationText: string;
|
|
130
|
+
modelValue: string | Date;
|
|
122
131
|
showClear: boolean;
|
|
123
132
|
align: "left" | "right" | undefined;
|
|
124
133
|
format: string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type PropType } from 'vue';
|
|
2
2
|
import type { IMarkedDay, IDefinedDay } from '../KCalendar/types.js';
|
|
3
3
|
export interface KDatePickerProps {
|
|
4
|
+
label?: string;
|
|
4
5
|
format: string;
|
|
5
6
|
day?: Date | string;
|
|
6
7
|
modelValue?: Date | string;
|
|
@@ -15,6 +16,10 @@ export interface KDatePickerProps {
|
|
|
15
16
|
align?: 'left' | 'right';
|
|
16
17
|
}
|
|
17
18
|
export declare const KDatePickerDefaultProps: {
|
|
19
|
+
label: {
|
|
20
|
+
type: StringConstructor;
|
|
21
|
+
default: string;
|
|
22
|
+
};
|
|
18
23
|
format: {
|
|
19
24
|
type: StringConstructor;
|
|
20
25
|
default: string;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { ref, watch, onMounted, computed } from "vue";
|
|
2
2
|
export const KDatePickerDefaultProps = {
|
|
3
|
+
label: {
|
|
4
|
+
type: String,
|
|
5
|
+
default: ""
|
|
6
|
+
},
|
|
3
7
|
format: {
|
|
4
8
|
type: String,
|
|
5
9
|
default: "MM-DD-YYYY"
|
|
@@ -144,6 +148,14 @@ export function useKDatePickerLogic(props) {
|
|
|
144
148
|
watch(() => props.isOpen, (newVal) => {
|
|
145
149
|
calendarShow.value = !!newVal;
|
|
146
150
|
});
|
|
151
|
+
watch(() => props.format, () => {
|
|
152
|
+
if (_date.value && _date.value !== "") {
|
|
153
|
+
const d = _date.value instanceof Date ? _date.value : new Date(_date.value);
|
|
154
|
+
if (!isNaN(d.getTime())) {
|
|
155
|
+
maskedModel.value = formatDate(d);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
});
|
|
147
159
|
const calendarDay = computed(() => {
|
|
148
160
|
const val = props.modelValue || props.day;
|
|
149
161
|
if (val) {
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { type KDateTimePickerProps } from './KDateTimePicker.logic.js';
|
|
2
2
|
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
3
|
+
label: {
|
|
4
|
+
type: StringConstructor;
|
|
5
|
+
default: string;
|
|
6
|
+
};
|
|
3
7
|
format: {
|
|
4
8
|
type: StringConstructor;
|
|
5
9
|
default: string;
|
|
@@ -59,6 +63,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
59
63
|
"update:calendarShow": (value: boolean) => any;
|
|
60
64
|
"update:isOpen": (value: boolean) => any;
|
|
61
65
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
66
|
+
label: {
|
|
67
|
+
type: StringConstructor;
|
|
68
|
+
default: string;
|
|
69
|
+
};
|
|
62
70
|
format: {
|
|
63
71
|
type: StringConstructor;
|
|
64
72
|
default: string;
|
|
@@ -118,13 +126,14 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
118
126
|
"onUpdate:calendarShow"?: ((value: boolean) => any) | undefined;
|
|
119
127
|
"onUpdate:isOpen"?: ((value: boolean) => any) | undefined;
|
|
120
128
|
}>, {
|
|
129
|
+
label: string;
|
|
121
130
|
isOpen: boolean;
|
|
122
131
|
day: string | Date;
|
|
123
132
|
validation: "error" | "success" | "warning" | null | undefined;
|
|
124
|
-
validationText: string;
|
|
125
|
-
modelValue: string | Date;
|
|
126
133
|
placeholder: string;
|
|
127
134
|
teleportTo: string;
|
|
135
|
+
validationText: string;
|
|
136
|
+
modelValue: string | Date;
|
|
128
137
|
showClear: boolean;
|
|
129
138
|
format: string;
|
|
130
139
|
calendarDefinedDays: import("../KCalendar/types.js").IDefinedDay[];
|
|
@@ -17,6 +17,7 @@ const {
|
|
|
17
17
|
} = useKDateTimePickerLogic(props);
|
|
18
18
|
const presetComponent = usePresetComponent("KDateTimePicker", KDateTimePickerDefault);
|
|
19
19
|
const templateProps = computed(() => ({
|
|
20
|
+
label: props.label,
|
|
20
21
|
maskedModel: maskedModel.value,
|
|
21
22
|
calendarShow: calendarShow.value,
|
|
22
23
|
_date: _date.value,
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { type KDateTimePickerProps } from './KDateTimePicker.logic.js';
|
|
2
2
|
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
3
|
+
label: {
|
|
4
|
+
type: StringConstructor;
|
|
5
|
+
default: string;
|
|
6
|
+
};
|
|
3
7
|
format: {
|
|
4
8
|
type: StringConstructor;
|
|
5
9
|
default: string;
|
|
@@ -59,6 +63,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
59
63
|
"update:calendarShow": (value: boolean) => any;
|
|
60
64
|
"update:isOpen": (value: boolean) => any;
|
|
61
65
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
66
|
+
label: {
|
|
67
|
+
type: StringConstructor;
|
|
68
|
+
default: string;
|
|
69
|
+
};
|
|
62
70
|
format: {
|
|
63
71
|
type: StringConstructor;
|
|
64
72
|
default: string;
|
|
@@ -118,13 +126,14 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
118
126
|
"onUpdate:calendarShow"?: ((value: boolean) => any) | undefined;
|
|
119
127
|
"onUpdate:isOpen"?: ((value: boolean) => any) | undefined;
|
|
120
128
|
}>, {
|
|
129
|
+
label: string;
|
|
121
130
|
isOpen: boolean;
|
|
122
131
|
day: string | Date;
|
|
123
132
|
validation: "error" | "success" | "warning" | null | undefined;
|
|
124
|
-
validationText: string;
|
|
125
|
-
modelValue: string | Date;
|
|
126
133
|
placeholder: string;
|
|
127
134
|
teleportTo: string;
|
|
135
|
+
validationText: string;
|
|
136
|
+
modelValue: string | Date;
|
|
128
137
|
showClear: boolean;
|
|
129
138
|
format: string;
|
|
130
139
|
calendarDefinedDays: import("../KCalendar/types.js").IDefinedDay[];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type PropType } from 'vue';
|
|
2
2
|
import type { IMarkedDay, IDefinedDay } from '../KCalendar/types.js';
|
|
3
3
|
export interface KDateTimePickerProps {
|
|
4
|
+
label?: string;
|
|
4
5
|
format?: string;
|
|
5
6
|
timeFormat?: string;
|
|
6
7
|
day?: Date | string;
|
|
@@ -16,6 +17,10 @@ export interface KDateTimePickerProps {
|
|
|
16
17
|
validationText?: string;
|
|
17
18
|
}
|
|
18
19
|
export declare const KDateTimePickerDefaultProps: {
|
|
20
|
+
label: {
|
|
21
|
+
type: StringConstructor;
|
|
22
|
+
default: string;
|
|
23
|
+
};
|
|
19
24
|
format: {
|
|
20
25
|
type: StringConstructor;
|
|
21
26
|
default: string;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { ref, watch, onMounted, computed } from "vue";
|
|
2
2
|
export const KDateTimePickerDefaultProps = {
|
|
3
|
+
label: {
|
|
4
|
+
type: String,
|
|
5
|
+
default: ""
|
|
6
|
+
},
|
|
3
7
|
format: {
|
|
4
8
|
type: String,
|
|
5
9
|
default: "MM-DD-YYYY HH:mm"
|
|
@@ -218,6 +222,9 @@ export function useKDateTimePickerLogic(props) {
|
|
|
218
222
|
watch(() => props.isOpen, (newVal) => {
|
|
219
223
|
calendarShow.value = !!newVal;
|
|
220
224
|
});
|
|
225
|
+
watch(() => props.format, () => {
|
|
226
|
+
updateMaskedModel();
|
|
227
|
+
});
|
|
221
228
|
return {
|
|
222
229
|
_date,
|
|
223
230
|
_time,
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { type KHourPickerProps } from './KHourPicker.logic.js';
|
|
2
2
|
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
3
|
+
label: {
|
|
4
|
+
type: StringConstructor;
|
|
5
|
+
default: string;
|
|
6
|
+
};
|
|
3
7
|
step: {
|
|
4
8
|
type: NumberConstructor;
|
|
5
9
|
default: number;
|
|
@@ -49,6 +53,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
49
53
|
"update:modelValue": (value: string) => any;
|
|
50
54
|
"update:isOpen": (value: boolean) => any;
|
|
51
55
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
56
|
+
label: {
|
|
57
|
+
type: StringConstructor;
|
|
58
|
+
default: string;
|
|
59
|
+
};
|
|
52
60
|
step: {
|
|
53
61
|
type: NumberConstructor;
|
|
54
62
|
default: number;
|
|
@@ -98,12 +106,13 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
98
106
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
99
107
|
"onUpdate:isOpen"?: ((value: boolean) => any) | undefined;
|
|
100
108
|
}>, {
|
|
109
|
+
label: string;
|
|
101
110
|
isOpen: boolean;
|
|
102
111
|
disabled: boolean;
|
|
103
112
|
validation: "error" | "success" | "warning" | null | undefined;
|
|
113
|
+
placeholder: string;
|
|
104
114
|
validationText: string;
|
|
105
115
|
modelValue: string;
|
|
106
|
-
placeholder: string;
|
|
107
116
|
showClear: boolean;
|
|
108
117
|
format: string;
|
|
109
118
|
step: number;
|
|
@@ -15,6 +15,7 @@ const {
|
|
|
15
15
|
} = useKHourPickerLogic(props);
|
|
16
16
|
const presetComponent = usePresetComponent("KHourPicker", KHourPickerDefault);
|
|
17
17
|
const templateProps = computed(() => ({
|
|
18
|
+
label: props.label,
|
|
18
19
|
maskedModel: maskedModel.value,
|
|
19
20
|
isOpen: isOpen.value,
|
|
20
21
|
step: props.step,
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { type KHourPickerProps } from './KHourPicker.logic.js';
|
|
2
2
|
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
3
|
+
label: {
|
|
4
|
+
type: StringConstructor;
|
|
5
|
+
default: string;
|
|
6
|
+
};
|
|
3
7
|
step: {
|
|
4
8
|
type: NumberConstructor;
|
|
5
9
|
default: number;
|
|
@@ -49,6 +53,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
49
53
|
"update:modelValue": (value: string) => any;
|
|
50
54
|
"update:isOpen": (value: boolean) => any;
|
|
51
55
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
56
|
+
label: {
|
|
57
|
+
type: StringConstructor;
|
|
58
|
+
default: string;
|
|
59
|
+
};
|
|
52
60
|
step: {
|
|
53
61
|
type: NumberConstructor;
|
|
54
62
|
default: number;
|
|
@@ -98,12 +106,13 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
98
106
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
99
107
|
"onUpdate:isOpen"?: ((value: boolean) => any) | undefined;
|
|
100
108
|
}>, {
|
|
109
|
+
label: string;
|
|
101
110
|
isOpen: boolean;
|
|
102
111
|
disabled: boolean;
|
|
103
112
|
validation: "error" | "success" | "warning" | null | undefined;
|
|
113
|
+
placeholder: string;
|
|
104
114
|
validationText: string;
|
|
105
115
|
modelValue: string;
|
|
106
|
-
placeholder: string;
|
|
107
116
|
showClear: boolean;
|
|
108
117
|
format: string;
|
|
109
118
|
step: number;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type PropType } from 'vue';
|
|
2
2
|
export interface KHourPickerProps {
|
|
3
|
+
label?: string;
|
|
3
4
|
step?: number;
|
|
4
5
|
format?: string;
|
|
5
6
|
startHour?: string;
|
|
@@ -13,6 +14,10 @@ export interface KHourPickerProps {
|
|
|
13
14
|
validationText?: string;
|
|
14
15
|
}
|
|
15
16
|
export declare const KHourPickerDefaultProps: {
|
|
17
|
+
label: {
|
|
18
|
+
type: StringConstructor;
|
|
19
|
+
default: string;
|
|
20
|
+
};
|
|
16
21
|
step: {
|
|
17
22
|
type: NumberConstructor;
|
|
18
23
|
default: number;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
+
label: {
|
|
3
|
+
type: StringConstructor;
|
|
4
|
+
default: string;
|
|
5
|
+
};
|
|
2
6
|
step: {
|
|
3
7
|
type: NumberConstructor;
|
|
4
8
|
default: number;
|
|
@@ -22,6 +26,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
22
26
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
23
27
|
"update:modelValue": (value: string) => any;
|
|
24
28
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
29
|
+
label: {
|
|
30
|
+
type: StringConstructor;
|
|
31
|
+
default: string;
|
|
32
|
+
};
|
|
25
33
|
step: {
|
|
26
34
|
type: NumberConstructor;
|
|
27
35
|
default: number;
|
|
@@ -45,6 +53,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
45
53
|
}>> & Readonly<{
|
|
46
54
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
47
55
|
}>, {
|
|
56
|
+
label: string;
|
|
48
57
|
modelValue: string;
|
|
49
58
|
format: string;
|
|
50
59
|
step: number;
|
|
@@ -12,6 +12,7 @@ const {
|
|
|
12
12
|
} = useKHourSelectLogic(props);
|
|
13
13
|
const presetComponent = usePresetComponent("KHourSelect", KHourSelectDefault);
|
|
14
14
|
const templateProps = computed(() => ({
|
|
15
|
+
label: props.label,
|
|
15
16
|
timeSlots: timeSlots.value,
|
|
16
17
|
selectedTime: selectedTime.value,
|
|
17
18
|
selectTime: handleSelectTime
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
+
label: {
|
|
3
|
+
type: StringConstructor;
|
|
4
|
+
default: string;
|
|
5
|
+
};
|
|
2
6
|
step: {
|
|
3
7
|
type: NumberConstructor;
|
|
4
8
|
default: number;
|
|
@@ -22,6 +26,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
22
26
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
23
27
|
"update:modelValue": (value: string) => any;
|
|
24
28
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
29
|
+
label: {
|
|
30
|
+
type: StringConstructor;
|
|
31
|
+
default: string;
|
|
32
|
+
};
|
|
25
33
|
step: {
|
|
26
34
|
type: NumberConstructor;
|
|
27
35
|
default: number;
|
|
@@ -45,6 +53,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
45
53
|
}>> & Readonly<{
|
|
46
54
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
47
55
|
}>, {
|
|
56
|
+
label: string;
|
|
48
57
|
modelValue: string;
|
|
49
58
|
format: string;
|
|
50
59
|
step: number;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export interface KHourSelectProps {
|
|
2
|
+
label?: string;
|
|
2
3
|
step?: number;
|
|
3
4
|
format?: string;
|
|
4
5
|
startHour?: string;
|
|
@@ -6,6 +7,10 @@ export interface KHourSelectProps {
|
|
|
6
7
|
modelValue?: string;
|
|
7
8
|
}
|
|
8
9
|
export declare const KHourSelectDefaultProps: {
|
|
10
|
+
label: {
|
|
11
|
+
type: StringConstructor;
|
|
12
|
+
default: string;
|
|
13
|
+
};
|
|
9
14
|
step: {
|
|
10
15
|
type: NumberConstructor;
|
|
11
16
|
default: number;
|