@katlux/toolkit 0.1.1-alpha.91 → 0.1.1-alpha.92
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 +8 -4
- package/dist/module.json +1 -1
- package/dist/runtime/app.config.d.ts +2 -1
- package/dist/runtime/components/KAccordion/KAccordion.logic.d.ts +5 -1
- package/dist/runtime/components/KAccordion/KAccordion.logic.js +11 -4
- package/dist/runtime/components/KAlert/KAlert.global.d.vue.ts +10 -1
- package/dist/runtime/components/KAlert/KAlert.global.vue +9 -1
- package/dist/runtime/components/KAlert/KAlert.global.vue.d.ts +10 -1
- package/dist/runtime/components/KAlert/KAlert.logic.d.ts +10 -2
- package/dist/runtime/components/KAlert/KAlert.logic.js +18 -3
- package/dist/runtime/components/KButton/KButton.global.d.vue.ts +1 -1
- package/dist/runtime/components/KButton/KButton.global.vue.d.ts +1 -1
- package/dist/runtime/components/KButton/KButton.logic.d.ts +1 -1
- package/dist/runtime/components/KCalendar/KCalendar.global.vue +5 -0
- package/dist/runtime/components/KCalendar/KCalendar.logic.d.ts +3 -1
- package/dist/runtime/components/KCalendar/KCalendar.logic.js +37 -10
- package/dist/runtime/components/KCompositeInput/KCompositeInput.global.d.vue.ts +2 -2
- package/dist/runtime/components/KCompositeInput/KCompositeInput.global.vue.d.ts +2 -2
- package/dist/runtime/components/KDatePicker/KDatePicker.global.d.vue.ts +1 -1
- package/dist/runtime/components/KDatePicker/KDatePicker.global.vue.d.ts +1 -1
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.d.vue.ts +1 -1
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.vue.d.ts +1 -1
- package/dist/runtime/components/KHourPicker/KHourPicker.global.d.vue.ts +1 -1
- package/dist/runtime/components/KHourPicker/KHourPicker.global.vue.d.ts +1 -1
- package/dist/runtime/components/KModal/KModal.logic.js +4 -1
- package/dist/runtime/components/KTabs/KTabs.logic.js +12 -5
- package/dist/runtime/components/KTooltip/KTooltip.global.d.vue.ts +1 -1
- package/dist/runtime/components/KTooltip/KTooltip.global.vue.d.ts +1 -1
- package/dist/runtime/composables/usePresetComponent.d.ts +3 -2
- package/dist/runtime/composables/usePresetComponent.js +8 -4
- package/dist/runtime/plugins/PresetPlugin.d.ts +2 -3
- package/dist/runtime/plugins/PresetPlugin.js +3 -6
- package/dist/runtime/presets/default/components/KAccordion/KAccordionItem.vue +18 -1
- package/dist/runtime/presets/default/components/KAlert/KAlert.d.vue.ts +6 -1
- package/dist/runtime/presets/default/components/KAlert/KAlert.vue +113 -3
- package/dist/runtime/presets/default/components/KAlert/KAlert.vue.d.ts +6 -1
- package/dist/runtime/presets/default/components/KBulkActions/KBulkActions.vue +6 -3
- package/dist/runtime/presets/default/components/KCalendar/KCalendar.d.vue.ts +3 -0
- package/dist/runtime/presets/default/components/KCalendar/KCalendar.vue +17 -1
- package/dist/runtime/presets/default/components/KCalendar/KCalendar.vue.d.ts +3 -0
- package/dist/runtime/presets/default/components/KCalendar/KCalendarWeek.d.vue.ts +8 -1
- package/dist/runtime/presets/default/components/KCalendar/KCalendarWeek.vue +302 -2
- package/dist/runtime/presets/default/components/KCalendar/KCalendarWeek.vue.d.ts +8 -1
- package/dist/runtime/presets/default/components/KCheckbox/KCheckbox.vue +15 -3
- package/dist/runtime/presets/default/components/KCombobox/KCombobox.vue +12 -1
- package/dist/runtime/presets/default/components/KDatatable/KDatatable.vue +7 -4
- package/dist/runtime/presets/default/components/KModal/KModal.vue +4 -1
- package/dist/runtime/presets/default/components/KPagination/KPagination.vue +16 -6
- package/dist/runtime/presets/default/components/KRadiobox/KRadiobox.vue +15 -3
- package/dist/runtime/presets/default/components/KTabs/KTabs.vue +9 -3
- package/dist/runtime/presets/default/components/KTextbox/KTextbox.vue +4 -1
- package/dist/runtime/presets/default/components/KTree/KTree.vue +13 -1
- package/package.json +1 -1
- package/dist/runtime/components/KSearchTree/KSearchTree.global.d.vue.ts +0 -3
- package/dist/runtime/components/KSearchTree/KSearchTree.global.vue +0 -9
- package/dist/runtime/components/KSearchTree/KSearchTree.global.vue.d.ts +0 -3
- package/dist/runtime/components/KSearchTree/KSearchTree.logic.d.ts +0 -10
- package/dist/runtime/components/KSearchTree/KSearchTree.logic.js +0 -9
- package/dist/runtime/components/KSearchTreeDropdown/KSearchTreeDropdown.global.d.vue.ts +0 -3
- package/dist/runtime/components/KSearchTreeDropdown/KSearchTreeDropdown.global.vue +0 -9
- package/dist/runtime/components/KSearchTreeDropdown/KSearchTreeDropdown.global.vue.d.ts +0 -3
- package/dist/runtime/components/KSearchTreeDropdown/KSearchTreeDropdown.logic.d.ts +0 -10
- package/dist/runtime/components/KSearchTreeDropdown/KSearchTreeDropdown.logic.js +0 -9
- package/dist/runtime/presets/default/components/KSearchTree/KSearchTree.d.vue.ts +0 -6
- package/dist/runtime/presets/default/components/KSearchTree/KSearchTree.vue +0 -13
- package/dist/runtime/presets/default/components/KSearchTree/KSearchTree.vue.d.ts +0 -6
- package/dist/runtime/presets/default/components/KSearchTreeDropdown/KSearchTreeDropdown.d.vue.ts +0 -6
- package/dist/runtime/presets/default/components/KSearchTreeDropdown/KSearchTreeDropdown.vue +0 -13
- package/dist/runtime/presets/default/components/KSearchTreeDropdown/KSearchTreeDropdown.vue.d.ts +0 -6
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { computed, defineAsyncComponent } from "vue";
|
|
2
|
-
import { useAppConfig } from "#app";
|
|
3
|
-
export
|
|
2
|
+
import { useAppConfig, useState } from "#app";
|
|
3
|
+
export function usePresetLoadersRegistry() {
|
|
4
|
+
return useState("katlux-preset-loaders-registry", () => ({}));
|
|
5
|
+
}
|
|
4
6
|
export function registerPresetComponents(presetName, loaders) {
|
|
5
|
-
|
|
7
|
+
const registry = usePresetLoadersRegistry();
|
|
8
|
+
registry.value[presetName] = loaders;
|
|
6
9
|
}
|
|
7
10
|
export function usePresetComponent(componentBaseName, defaultComponent) {
|
|
8
11
|
const appConfig = useAppConfig();
|
|
12
|
+
const registry = usePresetLoadersRegistry();
|
|
9
13
|
const presetStack = computed(() => {
|
|
10
14
|
const raw = appConfig.katluxToolkit?.activePreset;
|
|
11
15
|
const list = Array.isArray(raw) ? raw : raw ? [raw] : [];
|
|
@@ -15,7 +19,7 @@ export function usePresetComponent(componentBaseName, defaultComponent) {
|
|
|
15
19
|
let loader;
|
|
16
20
|
for (const presetName of presetStack.value) {
|
|
17
21
|
if (presetName === "default") break;
|
|
18
|
-
const externalLoaders =
|
|
22
|
+
const externalLoaders = registry.value[presetName];
|
|
19
23
|
if (externalLoaders) {
|
|
20
24
|
const key = `./components/${componentBaseName}/${componentBaseName}.vue`;
|
|
21
25
|
loader = externalLoaders[key];
|
package/dist/module.json
CHANGED
|
@@ -6,4 +6,8 @@ export declare const KAccordionDefaultProps: {
|
|
|
6
6
|
type: BooleanConstructor;
|
|
7
7
|
};
|
|
8
8
|
};
|
|
9
|
-
export declare function useKAccordionLogic(props: KAccordionProps): {
|
|
9
|
+
export declare function useKAccordionLogic(props: KAccordionProps): {
|
|
10
|
+
openIds: import("vue").Ref<string[], string[]>;
|
|
11
|
+
toggleItem: (id: string) => void;
|
|
12
|
+
isOpen: (id: string) => boolean;
|
|
13
|
+
};
|
|
@@ -31,8 +31,15 @@ export function useKAccordionLogic(props) {
|
|
|
31
31
|
function isOpen(id) {
|
|
32
32
|
return openIds.value.includes(id);
|
|
33
33
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
try {
|
|
35
|
+
provide("accordionRegister", registerItem);
|
|
36
|
+
provide("accordionToggle", toggleItem);
|
|
37
|
+
provide("accordionIsOpen", isOpen);
|
|
38
|
+
} catch (e) {
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
openIds,
|
|
42
|
+
toggleItem,
|
|
43
|
+
isOpen
|
|
44
|
+
};
|
|
38
45
|
}
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
import type { KAlertProps } from './KAlert.logic.js';
|
|
2
|
+
declare const __VLS_export: import("vue").DefineComponent<KAlertProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
3
|
+
dismiss: () => any;
|
|
4
|
+
}, string, import("vue").PublicProps, Readonly<KAlertProps> & Readonly<{
|
|
5
|
+
onDismiss?: (() => any) | undefined;
|
|
6
|
+
}>, {
|
|
7
|
+
type: import("./KAlert.logic.js").KAlertType;
|
|
8
|
+
title: string;
|
|
9
|
+
dismissible: boolean;
|
|
10
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
2
11
|
declare const _default: typeof __VLS_export;
|
|
3
12
|
export default _default;
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { usePresetComponent } from "../../composables/usePresetComponent";
|
|
3
3
|
import KAlertDefault from "../../presets/default/components/KAlert/KAlert.vue";
|
|
4
|
+
import { KAlertDefaultProps } from "./KAlert.logic";
|
|
5
|
+
const props = defineProps(/* @__PURE__ */ _mergeDefaults({
|
|
6
|
+
type: { type: String, required: false },
|
|
7
|
+
title: { type: String, required: false },
|
|
8
|
+
dismissible: { type: Boolean, required: false }
|
|
9
|
+
}, KAlertDefaultProps));
|
|
10
|
+
const emit = defineEmits(["dismiss"]);
|
|
4
11
|
const presetComponent = usePresetComponent("KAlert", KAlertDefault);
|
|
5
12
|
</script>
|
|
6
13
|
|
|
7
14
|
<template lang="pug">
|
|
8
|
-
component(:is="presetComponent")
|
|
15
|
+
component(:is="presetComponent" v-bind="props" @dismiss="emit('dismiss')")
|
|
16
|
+
slot
|
|
9
17
|
</template>
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
import type { KAlertProps } from './KAlert.logic.js';
|
|
2
|
+
declare const __VLS_export: import("vue").DefineComponent<KAlertProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
3
|
+
dismiss: () => any;
|
|
4
|
+
}, string, import("vue").PublicProps, Readonly<KAlertProps> & Readonly<{
|
|
5
|
+
onDismiss?: (() => any) | undefined;
|
|
6
|
+
}>, {
|
|
7
|
+
type: import("./KAlert.logic.js").KAlertType;
|
|
8
|
+
title: string;
|
|
9
|
+
dismissible: boolean;
|
|
10
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
2
11
|
declare const _default: typeof __VLS_export;
|
|
3
12
|
export default _default;
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
+
export type KAlertType = 'info' | 'success' | 'warning' | 'danger';
|
|
1
2
|
export interface KAlertProps {
|
|
3
|
+
type?: KAlertType;
|
|
4
|
+
title?: string;
|
|
5
|
+
dismissible?: boolean;
|
|
2
6
|
}
|
|
3
|
-
export declare const KAlertDefaultProps:
|
|
4
|
-
export declare function useKAlertLogic(): {
|
|
7
|
+
export declare const KAlertDefaultProps: KAlertProps;
|
|
8
|
+
export declare function useKAlertLogic(props: KAlertProps, emit: (event: 'dismiss') => void): {
|
|
9
|
+
visible: any;
|
|
10
|
+
dismiss: () => void;
|
|
11
|
+
icon: any;
|
|
12
|
+
};
|
|
@@ -1,4 +1,19 @@
|
|
|
1
|
-
export const KAlertDefaultProps = {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export const KAlertDefaultProps = {
|
|
2
|
+
type: "info",
|
|
3
|
+
dismissible: false
|
|
4
|
+
};
|
|
5
|
+
export function useKAlertLogic(props, emit) {
|
|
6
|
+
const visible = ref(true);
|
|
7
|
+
function dismiss() {
|
|
8
|
+
visible.value = false;
|
|
9
|
+
emit("dismiss");
|
|
10
|
+
}
|
|
11
|
+
const iconMap = {
|
|
12
|
+
info: "\u2139\uFE0F",
|
|
13
|
+
success: "\u2705",
|
|
14
|
+
warning: "\u26A0\uFE0F",
|
|
15
|
+
danger: "\u274C"
|
|
16
|
+
};
|
|
17
|
+
const icon = computed(() => iconMap[props.type ?? "info"]);
|
|
18
|
+
return { visible, dismiss, icon };
|
|
4
19
|
}
|
|
@@ -55,7 +55,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
55
55
|
onClick?: (() => any) | undefined;
|
|
56
56
|
}>, {
|
|
57
57
|
size: "small" | "large" | "medium" | undefined;
|
|
58
|
-
type: "info" | "default" | "
|
|
58
|
+
type: "info" | "default" | "success" | "warning" | "danger" | "primary" | "light" | "dark" | undefined;
|
|
59
59
|
iconOnly: boolean;
|
|
60
60
|
disabled: boolean;
|
|
61
61
|
href: string;
|
|
@@ -55,7 +55,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
55
55
|
onClick?: (() => any) | undefined;
|
|
56
56
|
}>, {
|
|
57
57
|
size: "small" | "large" | "medium" | undefined;
|
|
58
|
-
type: "info" | "default" | "
|
|
58
|
+
type: "info" | "default" | "success" | "warning" | "danger" | "primary" | "light" | "dark" | undefined;
|
|
59
59
|
iconOnly: boolean;
|
|
60
60
|
disabled: boolean;
|
|
61
61
|
href: string;
|
|
@@ -23,7 +23,7 @@ export interface KButtonEmits {
|
|
|
23
23
|
export declare function useKButtonLogic(props: KButtonProps, emit: KButtonEmits): {
|
|
24
24
|
isLink: import("vue").ComputedRef<boolean>;
|
|
25
25
|
isDisabled: import("vue").ComputedRef<boolean | undefined>;
|
|
26
|
-
buttonClasses: import("vue").ComputedRef<("info" | "default" | "
|
|
26
|
+
buttonClasses: import("vue").ComputedRef<("info" | "default" | "success" | "warning" | "danger" | "small" | "primary" | "light" | "dark" | "large" | "medium" | {
|
|
27
27
|
disabled: boolean | undefined;
|
|
28
28
|
'icon-only': boolean | undefined;
|
|
29
29
|
})[]>;
|
|
@@ -8,6 +8,8 @@ const emit = defineEmits(["update:selectedDay", "dayClicked"]);
|
|
|
8
8
|
const {
|
|
9
9
|
monthSelectedDay,
|
|
10
10
|
actualYear,
|
|
11
|
+
actualMonth,
|
|
12
|
+
activeDate,
|
|
11
13
|
goToPrev,
|
|
12
14
|
goToNext,
|
|
13
15
|
getMonthName,
|
|
@@ -22,7 +24,10 @@ const templateProps = computed(() => ({
|
|
|
22
24
|
view: props.view,
|
|
23
25
|
viewCount: props.viewCount,
|
|
24
26
|
actualYear: actualYear.value,
|
|
27
|
+
actualMonth: actualMonth.value,
|
|
28
|
+
activeDate: activeDate.value,
|
|
25
29
|
monthSelectedDay: monthSelectedDay.value,
|
|
30
|
+
rawMarkedDays: props.markedDays,
|
|
26
31
|
goToPrev,
|
|
27
32
|
goToNext,
|
|
28
33
|
getMonthName,
|
|
@@ -236,10 +236,12 @@ export declare function useKCalendarLogic(props: KCalendarProps, emit: KCalendar
|
|
|
236
236
|
[Symbol.iterator]: () => StringIterator<string>;
|
|
237
237
|
}>;
|
|
238
238
|
actualYear: import("vue").Ref<any, any>;
|
|
239
|
+
actualMonth: import("vue").Ref<any, any>;
|
|
240
|
+
activeDate: import("vue").Ref<Date, Date>;
|
|
239
241
|
goToPrev: () => void;
|
|
240
242
|
goToNext: () => void;
|
|
241
243
|
getMonthName: (monthIndex: number) => string;
|
|
242
|
-
showingMonth: (monthIndex: number) =>
|
|
244
|
+
showingMonth: (monthIndex: number) => any;
|
|
243
245
|
showingYear: (monthIndex: number) => any;
|
|
244
246
|
getExpandedDefinedDays: (monthIndex: number) => IDefinedDay[];
|
|
245
247
|
getExpandedMarkedDays: (monthIndex: number) => IMarkedDay[];
|
|
@@ -33,12 +33,14 @@ export function useKCalendarLogic(props, emit) {
|
|
|
33
33
|
const actualWeek = ref();
|
|
34
34
|
const actualYear = ref();
|
|
35
35
|
const currentView = computed(() => props.view ?? "month");
|
|
36
|
+
const activeDate = ref(/* @__PURE__ */ new Date());
|
|
36
37
|
function initViewFromDate(dateInput) {
|
|
37
38
|
if (!dateInput) return false;
|
|
38
39
|
const date = typeof dateInput === "string" ? new Date(dateInput) : dateInput;
|
|
39
40
|
if (!isNaN(date.getTime())) {
|
|
40
41
|
actualMonth.value = date.getMonth() + 1;
|
|
41
42
|
actualYear.value = date.getFullYear();
|
|
43
|
+
activeDate.value = new Date(date);
|
|
42
44
|
return true;
|
|
43
45
|
}
|
|
44
46
|
return false;
|
|
@@ -74,6 +76,7 @@ export function useKCalendarLogic(props, emit) {
|
|
|
74
76
|
const now = /* @__PURE__ */ new Date();
|
|
75
77
|
actualMonth.value = now.getMonth() + 1;
|
|
76
78
|
actualYear.value = now.getFullYear();
|
|
79
|
+
activeDate.value = now;
|
|
77
80
|
}
|
|
78
81
|
});
|
|
79
82
|
const months = [
|
|
@@ -91,7 +94,7 @@ export function useKCalendarLogic(props, emit) {
|
|
|
91
94
|
"December"
|
|
92
95
|
];
|
|
93
96
|
function showingMonth(monthIndex) {
|
|
94
|
-
let month = actualMonth.value + monthIndex -
|
|
97
|
+
let month = actualMonth.value + (monthIndex - 1);
|
|
95
98
|
if (month > 12) {
|
|
96
99
|
month = (month - 1) % 12 + 1;
|
|
97
100
|
} else if (month < 1) {
|
|
@@ -101,7 +104,7 @@ export function useKCalendarLogic(props, emit) {
|
|
|
101
104
|
}
|
|
102
105
|
function showingYear(monthIndex) {
|
|
103
106
|
let year = actualYear.value;
|
|
104
|
-
let month = actualMonth.value + monthIndex -
|
|
107
|
+
let month = actualMonth.value + (monthIndex - 1);
|
|
105
108
|
if (month > 12) {
|
|
106
109
|
year += Math.floor((month - 1) / 12);
|
|
107
110
|
} else if (month < 1) {
|
|
@@ -148,18 +151,40 @@ export function useKCalendarLogic(props, emit) {
|
|
|
148
151
|
emit("dayClicked", date, getDayMark(date));
|
|
149
152
|
}
|
|
150
153
|
function goToPrev() {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
154
|
+
if (props.view === "week") {
|
|
155
|
+
const d = new Date(activeDate.value);
|
|
156
|
+
d.setDate(d.getDate() - 7);
|
|
157
|
+
activeDate.value = d;
|
|
158
|
+
actualMonth.value = d.getMonth() + 1;
|
|
159
|
+
actualYear.value = d.getFullYear();
|
|
160
|
+
return;
|
|
155
161
|
}
|
|
162
|
+
let newMonth = actualMonth.value - (props.viewCount || 1);
|
|
163
|
+
let newYear = actualYear.value;
|
|
164
|
+
while (newMonth < 1) {
|
|
165
|
+
newMonth += 12;
|
|
166
|
+
newYear--;
|
|
167
|
+
}
|
|
168
|
+
actualMonth.value = newMonth;
|
|
169
|
+
actualYear.value = newYear;
|
|
156
170
|
}
|
|
157
171
|
function goToNext() {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
172
|
+
if (props.view === "week") {
|
|
173
|
+
const d = new Date(activeDate.value);
|
|
174
|
+
d.setDate(d.getDate() + 7);
|
|
175
|
+
activeDate.value = d;
|
|
176
|
+
actualMonth.value = d.getMonth() + 1;
|
|
177
|
+
actualYear.value = d.getFullYear();
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
let newMonth = actualMonth.value + (props.viewCount || 1);
|
|
181
|
+
let newYear = actualYear.value;
|
|
182
|
+
while (newMonth > 12) {
|
|
183
|
+
newMonth -= 12;
|
|
184
|
+
newYear++;
|
|
162
185
|
}
|
|
186
|
+
actualMonth.value = newMonth;
|
|
187
|
+
actualYear.value = newYear;
|
|
163
188
|
}
|
|
164
189
|
function getMonthName(monthIndex) {
|
|
165
190
|
if ((props.viewCount || 1) <= 12) return months[showingMonth(monthIndex) - 1];
|
|
@@ -169,6 +194,8 @@ export function useKCalendarLogic(props, emit) {
|
|
|
169
194
|
return {
|
|
170
195
|
monthSelectedDay,
|
|
171
196
|
actualYear,
|
|
197
|
+
actualMonth,
|
|
198
|
+
activeDate,
|
|
172
199
|
goToPrev,
|
|
173
200
|
goToNext,
|
|
174
201
|
getMonthName,
|
|
@@ -198,13 +198,13 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
198
198
|
placeholder: string;
|
|
199
199
|
teleportTo: string;
|
|
200
200
|
valueField: string;
|
|
201
|
+
mask: string;
|
|
202
|
+
showClear: boolean;
|
|
201
203
|
inputType: "number" | "text" | "url" | "search" | "password" | "email" | "tel" | undefined;
|
|
202
204
|
selectionValue: string | number | Record<string, any> | unknown[];
|
|
203
205
|
inputValue: string | number | Record<string, any> | unknown[];
|
|
204
206
|
selectionSide: import("./KCompositeInput.logic.js").SelectionSide;
|
|
205
|
-
mask: string;
|
|
206
207
|
inputPlaceholder: string;
|
|
207
|
-
showClear: boolean;
|
|
208
208
|
inputConfigField: string;
|
|
209
209
|
validateAll: boolean;
|
|
210
210
|
inputFormat: string;
|
|
@@ -198,13 +198,13 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
198
198
|
placeholder: string;
|
|
199
199
|
teleportTo: string;
|
|
200
200
|
valueField: string;
|
|
201
|
+
mask: string;
|
|
202
|
+
showClear: boolean;
|
|
201
203
|
inputType: "number" | "text" | "url" | "search" | "password" | "email" | "tel" | undefined;
|
|
202
204
|
selectionValue: string | number | Record<string, any> | unknown[];
|
|
203
205
|
inputValue: string | number | Record<string, any> | unknown[];
|
|
204
206
|
selectionSide: import("./KCompositeInput.logic.js").SelectionSide;
|
|
205
|
-
mask: string;
|
|
206
207
|
inputPlaceholder: string;
|
|
207
|
-
showClear: boolean;
|
|
208
208
|
inputConfigField: string;
|
|
209
209
|
validateAll: boolean;
|
|
210
210
|
inputFormat: string;
|
|
@@ -128,9 +128,9 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
128
128
|
modelValue: string | Date;
|
|
129
129
|
placeholder: string;
|
|
130
130
|
teleportTo: string;
|
|
131
|
-
showClear: boolean;
|
|
132
131
|
align: "left" | "right" | undefined;
|
|
133
132
|
format: string;
|
|
133
|
+
showClear: boolean;
|
|
134
134
|
calendarDefinedDays: import("../KCalendar/types.js").IDefinedDay[];
|
|
135
135
|
calendarMarkedDays: import("../KCalendar/types.js").IMarkedDay[];
|
|
136
136
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -128,9 +128,9 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
128
128
|
modelValue: string | Date;
|
|
129
129
|
placeholder: string;
|
|
130
130
|
teleportTo: string;
|
|
131
|
-
showClear: boolean;
|
|
132
131
|
align: "left" | "right" | undefined;
|
|
133
132
|
format: string;
|
|
133
|
+
showClear: boolean;
|
|
134
134
|
calendarDefinedDays: import("../KCalendar/types.js").IDefinedDay[];
|
|
135
135
|
calendarMarkedDays: import("../KCalendar/types.js").IMarkedDay[];
|
|
136
136
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -134,8 +134,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
134
134
|
modelValue: string | Date;
|
|
135
135
|
placeholder: string;
|
|
136
136
|
teleportTo: string;
|
|
137
|
-
showClear: boolean;
|
|
138
137
|
format: string;
|
|
138
|
+
showClear: boolean;
|
|
139
139
|
calendarDefinedDays: import("../KCalendar/types.js").IDefinedDay[];
|
|
140
140
|
calendarMarkedDays: import("../KCalendar/types.js").IMarkedDay[];
|
|
141
141
|
timeFormat: string;
|
|
@@ -134,8 +134,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
134
134
|
modelValue: string | Date;
|
|
135
135
|
placeholder: string;
|
|
136
136
|
teleportTo: string;
|
|
137
|
-
showClear: boolean;
|
|
138
137
|
format: string;
|
|
138
|
+
showClear: boolean;
|
|
139
139
|
calendarDefinedDays: import("../KCalendar/types.js").IDefinedDay[];
|
|
140
140
|
calendarMarkedDays: import("../KCalendar/types.js").IMarkedDay[];
|
|
141
141
|
timeFormat: string;
|
|
@@ -113,8 +113,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
113
113
|
validationText: string;
|
|
114
114
|
modelValue: string;
|
|
115
115
|
placeholder: string;
|
|
116
|
-
showClear: boolean;
|
|
117
116
|
format: string;
|
|
117
|
+
showClear: boolean;
|
|
118
118
|
step: number;
|
|
119
119
|
startHour: string;
|
|
120
120
|
endHour: string;
|
|
@@ -113,8 +113,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
113
113
|
validationText: string;
|
|
114
114
|
modelValue: string;
|
|
115
115
|
placeholder: string;
|
|
116
|
-
showClear: boolean;
|
|
117
116
|
format: string;
|
|
117
|
+
showClear: boolean;
|
|
118
118
|
step: number;
|
|
119
119
|
startHour: string;
|
|
120
120
|
endHour: string;
|
|
@@ -8,7 +8,10 @@ export const KModalDefaultProps = {
|
|
|
8
8
|
};
|
|
9
9
|
export function useKModalLogic(props, stableId) {
|
|
10
10
|
const modalId = computed(() => stableId);
|
|
11
|
-
|
|
11
|
+
try {
|
|
12
|
+
provide(KMODAL_PORTAL_ID_KEY, modalId);
|
|
13
|
+
} catch (e) {
|
|
14
|
+
}
|
|
12
15
|
const opened = ref(false);
|
|
13
16
|
function openModal() {
|
|
14
17
|
opened.value = true;
|
|
@@ -2,9 +2,13 @@ import { ref, provide, useSlots, computed, Fragment, isVNode, watch } from "vue"
|
|
|
2
2
|
export const KTabsDefaultProps = {};
|
|
3
3
|
export function useKTabsLogic() {
|
|
4
4
|
const openIndexes = ref([]);
|
|
5
|
-
|
|
5
|
+
let slots = null;
|
|
6
|
+
try {
|
|
7
|
+
slots = useSlots();
|
|
8
|
+
} catch (e) {
|
|
9
|
+
}
|
|
6
10
|
const items = computed(() => {
|
|
7
|
-
if (!slots
|
|
11
|
+
if (!slots?.default) return [];
|
|
8
12
|
const vnodes = slots.default();
|
|
9
13
|
const tabs = [];
|
|
10
14
|
const processVNode = (vnode) => {
|
|
@@ -38,9 +42,12 @@ export function useKTabsLogic() {
|
|
|
38
42
|
function isOpen(index) {
|
|
39
43
|
return openIndexes.value.includes(index);
|
|
40
44
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
45
|
+
try {
|
|
46
|
+
provide("tabRegister", registerItem);
|
|
47
|
+
provide("tabToggle", toggleItem);
|
|
48
|
+
provide("tabIsOpen", isOpen);
|
|
49
|
+
} catch (e) {
|
|
50
|
+
}
|
|
44
51
|
return {
|
|
45
52
|
items,
|
|
46
53
|
toggleItem,
|
|
@@ -27,7 +27,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
27
27
|
}>> & Readonly<{}>, {
|
|
28
28
|
text: string;
|
|
29
29
|
disabled: boolean;
|
|
30
|
-
position: "
|
|
30
|
+
position: "top" | "left" | "right" | "bottom";
|
|
31
31
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
32
32
|
declare const _default: typeof __VLS_export;
|
|
33
33
|
export default _default;
|
|
@@ -27,7 +27,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
27
27
|
}>> & Readonly<{}>, {
|
|
28
28
|
text: string;
|
|
29
29
|
disabled: boolean;
|
|
30
|
-
position: "
|
|
30
|
+
position: "top" | "left" | "right" | "bottom";
|
|
31
31
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
32
32
|
declare const _default: typeof __VLS_export;
|
|
33
33
|
export default _default;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { type Component } from 'vue';
|
|
2
2
|
/**
|
|
3
3
|
* Registry mapping preset names to their respective module loaders (via import.meta.glob).
|
|
4
|
-
* Preset modules
|
|
4
|
+
* Preset modules inject their components via a Nuxt Plugin.
|
|
5
|
+
* Uses Nuxt useState to prevent cross-request SSR state leakage.
|
|
5
6
|
*/
|
|
6
|
-
export declare
|
|
7
|
+
export declare function usePresetLoadersRegistry(): import("vue").Ref<Record<string, Record<string, () => Promise<any>>>, Record<string, Record<string, () => Promise<any>>>>;
|
|
7
8
|
/**
|
|
8
9
|
* API for Nuxt modules to dynamically map their generated components
|
|
9
10
|
*/
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { computed, defineAsyncComponent } from "vue";
|
|
2
|
-
import { useAppConfig } from "#app";
|
|
3
|
-
export
|
|
2
|
+
import { useAppConfig, useState } from "#app";
|
|
3
|
+
export function usePresetLoadersRegistry() {
|
|
4
|
+
return useState("katlux-preset-loaders-registry", () => ({}));
|
|
5
|
+
}
|
|
4
6
|
export function registerPresetComponents(presetName, loaders) {
|
|
5
|
-
|
|
7
|
+
const registry = usePresetLoadersRegistry();
|
|
8
|
+
registry.value[presetName] = loaders;
|
|
6
9
|
}
|
|
7
10
|
export function usePresetComponent(componentBaseName, defaultComponent) {
|
|
8
11
|
const appConfig = useAppConfig();
|
|
12
|
+
const registry = usePresetLoadersRegistry();
|
|
9
13
|
const presetStack = computed(() => {
|
|
10
14
|
const raw = appConfig.katluxToolkit?.activePreset;
|
|
11
15
|
const list = Array.isArray(raw) ? raw : raw ? [raw] : [];
|
|
@@ -15,7 +19,7 @@ export function usePresetComponent(componentBaseName, defaultComponent) {
|
|
|
15
19
|
let loader;
|
|
16
20
|
for (const presetName of presetStack.value) {
|
|
17
21
|
if (presetName === "default") break;
|
|
18
|
-
const externalLoaders =
|
|
22
|
+
const externalLoaders = registry.value[presetName];
|
|
19
23
|
if (externalLoaders) {
|
|
20
24
|
const key = `./components/${componentBaseName}/${componentBaseName}.vue`;
|
|
21
25
|
loader = externalLoaders[key];
|
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
* Katlux Preset Plugin
|
|
3
3
|
*
|
|
4
4
|
* This plugin initializes the preset system on app startup:
|
|
5
|
-
* - Creates the PresetResolver singleton
|
|
5
|
+
* - Creates the PresetResolver singleton per-request
|
|
6
6
|
* - Discovers available presets
|
|
7
|
-
* -
|
|
8
|
-
* - Provides global preset utilities
|
|
7
|
+
* - Provides global preset utilities with SSR request isolation
|
|
9
8
|
*/
|
|
10
9
|
declare const _default: import("#app").Plugin<Record<string, unknown>> & import("#app").ObjectPlugin<Record<string, unknown>>;
|
|
11
10
|
export default _default;
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import { defineNuxtPlugin, useHead,
|
|
1
|
+
import { defineNuxtPlugin, useHead, useState } from "#app";
|
|
2
2
|
import { watch } from "vue";
|
|
3
3
|
import { PresetResolver } from "../utils/PresetResolver.js";
|
|
4
4
|
export default defineNuxtPlugin((nuxtApp) => {
|
|
5
5
|
const resolver = new PresetResolver();
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
if (activePreset && appConfig.katluxToolkit) {
|
|
9
|
-
appConfig.katluxToolkit.activePreset = activePreset;
|
|
10
|
-
}
|
|
6
|
+
const activePresetState = useState("katlux-active-preset-state", () => resolver.getActivePreset());
|
|
7
|
+
const activePreset = activePresetState.value;
|
|
11
8
|
const updateRootAttribute = (preset) => {
|
|
12
9
|
useHead({
|
|
13
10
|
htmlAttrs: {
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
<template lang="pug">
|
|
2
2
|
.accordion-item(:class="{'isOpen': isOpen}")
|
|
3
|
-
KGrid.accordion-item__header(
|
|
3
|
+
KGrid.accordion-item__header(
|
|
4
|
+
align="center"
|
|
5
|
+
justify="space-between"
|
|
6
|
+
noGap
|
|
7
|
+
@click="toggleAccordion"
|
|
8
|
+
@keydown.enter.prevent="toggleAccordion"
|
|
9
|
+
@keydown.space.prevent="toggleAccordion"
|
|
10
|
+
role="button"
|
|
11
|
+
:aria-expanded="isOpen"
|
|
12
|
+
tabindex="0"
|
|
13
|
+
)
|
|
4
14
|
.accordion-item__title {{title}}
|
|
5
15
|
KIcon.accordion-item__chevron(iconname="chevron", :class="{'open': isOpen}")
|
|
6
16
|
.accordion-item__content(:class="{'open': isOpen}")
|
|
@@ -17,6 +27,10 @@ const props = defineProps<{
|
|
|
17
27
|
|
|
18
28
|
<style lang="scss" scoped>
|
|
19
29
|
.accordion-item {
|
|
30
|
+
width: 100%;
|
|
31
|
+
min-width: 0;
|
|
32
|
+
box-sizing: border-box;
|
|
33
|
+
overflow: hidden;
|
|
20
34
|
&__header {
|
|
21
35
|
padding: var(--component-gap);
|
|
22
36
|
background-color: var(--background-color-medium);
|
|
@@ -42,6 +56,9 @@ const props = defineProps<{
|
|
|
42
56
|
display: none;
|
|
43
57
|
padding-top: var(--box-padding);
|
|
44
58
|
padding-bottom: var(--box-padding);
|
|
59
|
+
width: 100%;
|
|
60
|
+
box-sizing: border-box;
|
|
61
|
+
overflow: hidden;
|
|
45
62
|
&.open {
|
|
46
63
|
border-bottom: var(--box-border);
|
|
47
64
|
}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import type { KAlertProps } from '../../../../components/KAlert/KAlert.logic.js';
|
|
2
|
+
declare const __VLS_export: import("vue").DefineComponent<KAlertProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
3
|
+
dismiss: () => any;
|
|
4
|
+
}, string, import("vue").PublicProps, Readonly<KAlertProps> & Readonly<{
|
|
5
|
+
onDismiss?: (() => any) | undefined;
|
|
6
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
2
7
|
declare const _default: typeof __VLS_export;
|
|
3
8
|
export default _default;
|