@katlux/toolkit 0.1.0-beta.80 → 0.1.0-beta.82
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 +25 -19
- package/dist/compiled/utils/PresetResolver.mjs +18 -12
- package/dist/module.json +1 -1
- package/dist/runtime/components/KButton/KButton.logic.d.ts +1 -1
- package/dist/runtime/components/KContextMenu/KContextMenu.global.d.vue.ts +1 -1
- package/dist/runtime/components/KContextMenu/KContextMenu.global.vue.d.ts +1 -1
- 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/KModal/KModal.global.vue +3 -2
- package/dist/runtime/components/KTreePicker/KTreePicker.global.d.vue.ts +2 -2
- package/dist/runtime/components/KTreePicker/KTreePicker.global.vue.d.ts +2 -2
- 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/composables/usePresetComponent.d.ts +1 -1
- package/dist/runtime/composables/usePresetComponent.js +25 -19
- package/dist/runtime/presets/default/assets/scss/css-variables.css +8 -5
- package/dist/runtime/presets/default/assets/scss/css-variables.scss +8 -5
- package/dist/runtime/presets/default/assets/scss/index.css +17 -6
- package/dist/runtime/presets/default/assets/scss/index.scss +10 -1
- package/dist/runtime/presets/default/components/KButton/KButton.vue +20 -20
- package/dist/runtime/presets/default/components/KCalendar/KCalendar.vue +15 -3
- package/dist/runtime/presets/default/components/KCalendar/KCalendarMonth.vue +21 -15
- package/dist/runtime/presets/default/components/KCombobox/KCombobox.vue +2 -1
- package/dist/runtime/presets/default/components/KDatatable/KDatatable.vue +15 -8
- package/dist/runtime/presets/default/components/KDateTimePicker/KDateTimePicker.vue +2 -0
- package/dist/runtime/presets/default/components/KDropdown/KDropdown.vue +5 -1
- package/dist/runtime/presets/default/components/KGantt/KGanttRuler.vue +2 -2
- package/dist/runtime/presets/default/components/KGantt/KGanttTimeline.vue +10 -10
- package/dist/runtime/presets/default/components/KHourSelect/KHourSelect.vue +9 -6
- package/dist/runtime/presets/default/components/KLoader/KLoader.vue +1 -1
- package/dist/runtime/presets/default/components/KModal/KModal.vue +1 -1
- package/dist/runtime/presets/default/components/KPanel/KPanel.vue +4 -3
- package/dist/runtime/presets/default/components/KTextarea/KTextarea.vue +6 -0
- package/dist/runtime/presets/default/components/KTextbox/KTextbox.vue +6 -0
- package/dist/runtime/presets/default/components/KTree/KTree.vue +2 -2
- package/dist/runtime/presets/default/components/KTreePicker/KTreePicker.vue +3 -1
- package/dist/runtime/utils/PresetResolver.d.ts +8 -9
- package/dist/runtime/utils/PresetResolver.js +18 -12
- package/package.json +1 -1
|
@@ -6,31 +6,37 @@ export function registerPresetComponents(presetName, loaders) {
|
|
|
6
6
|
}
|
|
7
7
|
export function usePresetComponent(componentBaseName, defaultComponent) {
|
|
8
8
|
const appConfig = useAppConfig();
|
|
9
|
-
const
|
|
9
|
+
const presetStack = computed(() => {
|
|
10
|
+
const raw = appConfig.katluxToolkit?.activePreset;
|
|
11
|
+
const list = Array.isArray(raw) ? raw : raw ? [raw] : [];
|
|
12
|
+
return [...list.filter((p) => p && p !== "default"), "default"];
|
|
13
|
+
});
|
|
10
14
|
return computed(() => {
|
|
11
|
-
if (activePreset.value === "default") {
|
|
12
|
-
return defaultComponent;
|
|
13
|
-
}
|
|
14
15
|
let loader;
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"../presets/**/*.vue",
|
|
23
|
-
"../../runtime/presets/**/*.vue"
|
|
24
|
-
]);
|
|
25
|
-
const internalKey = `../presets/${activePreset.value}/components/${componentBaseName}/${componentBaseName}.vue`;
|
|
26
|
-
loader = internalLoaders[internalKey];
|
|
16
|
+
for (const presetName of presetStack.value) {
|
|
17
|
+
if (presetName === "default") break;
|
|
18
|
+
const externalLoaders = presetLoadersRegistry.get(presetName);
|
|
19
|
+
if (externalLoaders) {
|
|
20
|
+
const key = `./components/${componentBaseName}/${componentBaseName}.vue`;
|
|
21
|
+
loader = externalLoaders[key];
|
|
22
|
+
}
|
|
27
23
|
if (!loader) {
|
|
28
|
-
const
|
|
29
|
-
|
|
24
|
+
const internalLoaders = import.meta.glob([
|
|
25
|
+
"../presets/**/*.vue",
|
|
26
|
+
"../../runtime/presets/**/*.vue"
|
|
27
|
+
]);
|
|
28
|
+
const internalKey = `../presets/${presetName}/components/${componentBaseName}/${componentBaseName}.vue`;
|
|
29
|
+
loader = internalLoaders[internalKey];
|
|
30
|
+
if (!loader) {
|
|
31
|
+
const altKey = `../../runtime/presets/${presetName}/components/${componentBaseName}/${componentBaseName}.vue`;
|
|
32
|
+
loader = internalLoaders[altKey];
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
if (loader) {
|
|
36
|
+
break;
|
|
30
37
|
}
|
|
31
38
|
}
|
|
32
39
|
if (!loader) {
|
|
33
|
-
console.warn(`[${componentBaseName}] Preset "${activePreset.value}" not found, falling back to default`);
|
|
34
40
|
return defaultComponent;
|
|
35
41
|
}
|
|
36
42
|
return defineAsyncComponent({
|
|
@@ -15,7 +15,13 @@ export class PresetResolver {
|
|
|
15
15
|
const runtimeConfig = useRuntimeConfig();
|
|
16
16
|
const presetCookie = useCookie("katlux-active-preset");
|
|
17
17
|
if (presetCookie.value) {
|
|
18
|
-
|
|
18
|
+
try {
|
|
19
|
+
const val = presetCookie.value;
|
|
20
|
+
const parsed = val.startsWith("[") || val.startsWith("{") ? JSON.parse(val) : val;
|
|
21
|
+
this.activePreset = parsed;
|
|
22
|
+
} catch {
|
|
23
|
+
this.activePreset = presetCookie.value;
|
|
24
|
+
}
|
|
19
25
|
} else if (appConfig.katluxToolkit?.activePreset) {
|
|
20
26
|
this.activePreset = appConfig.katluxToolkit.activePreset;
|
|
21
27
|
}
|
|
@@ -33,7 +39,8 @@ export class PresetResolver {
|
|
|
33
39
|
* @returns Preset metadata including paths and availability
|
|
34
40
|
*/
|
|
35
41
|
resolvePreset(componentName) {
|
|
36
|
-
const
|
|
42
|
+
const keyStr = Array.isArray(this.activePreset) ? this.activePreset.join(",") : this.activePreset;
|
|
43
|
+
const cacheKey = `${keyStr}:${componentName}`;
|
|
37
44
|
if (this.cache[cacheKey]) {
|
|
38
45
|
return this.cache[cacheKey];
|
|
39
46
|
}
|
|
@@ -43,11 +50,10 @@ export class PresetResolver {
|
|
|
43
50
|
hasCustomPreset: false,
|
|
44
51
|
hasCustomStyles: false
|
|
45
52
|
};
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
metadata.
|
|
50
|
-
metadata.stylesPath = customStylesPath;
|
|
53
|
+
const firstPreset = Array.isArray(this.activePreset) ? this.activePreset[0] : this.activePreset;
|
|
54
|
+
if (firstPreset && firstPreset !== "default") {
|
|
55
|
+
metadata.presetPath = `${this.presetsDir}/${firstPreset}/${componentName}.pug`;
|
|
56
|
+
metadata.stylesPath = `${this.presetsDir}/${firstPreset}/${componentName}.scss`;
|
|
51
57
|
metadata.hasCustomPreset = true;
|
|
52
58
|
metadata.hasCustomStyles = true;
|
|
53
59
|
}
|
|
@@ -55,21 +61,21 @@ export class PresetResolver {
|
|
|
55
61
|
return metadata;
|
|
56
62
|
}
|
|
57
63
|
/**
|
|
58
|
-
* Get the active preset name
|
|
64
|
+
* Get the active preset name or array
|
|
59
65
|
*/
|
|
60
66
|
getActivePreset() {
|
|
61
67
|
return this.activePreset;
|
|
62
68
|
}
|
|
63
69
|
/**
|
|
64
|
-
* Set the active preset (
|
|
65
|
-
* @param presetName - Name of the
|
|
70
|
+
* Set the active preset (supports string or string[] array for preset stacks)
|
|
71
|
+
* @param presetName - Name or array of names of the presets to activate
|
|
66
72
|
*/
|
|
67
73
|
setActivePreset(presetName) {
|
|
68
|
-
if (this.activePreset !== presetName) {
|
|
74
|
+
if (JSON.stringify(this.activePreset) !== JSON.stringify(presetName)) {
|
|
69
75
|
this.activePreset = presetName;
|
|
70
76
|
this.clearCache();
|
|
71
77
|
const presetCookie = useCookie("katlux-active-preset");
|
|
72
|
-
presetCookie.value = presetName;
|
|
78
|
+
presetCookie.value = typeof presetName === "string" ? presetName : JSON.stringify(presetName);
|
|
73
79
|
}
|
|
74
80
|
}
|
|
75
81
|
/**
|
package/dist/module.json
CHANGED
|
@@ -22,7 +22,7 @@ export interface KButtonEmits {
|
|
|
22
22
|
export declare function useKButtonLogic(props: KButtonProps, emit: KButtonEmits): {
|
|
23
23
|
isLink: import("vue").ComputedRef<boolean>;
|
|
24
24
|
isDisabled: import("vue").ComputedRef<boolean | undefined>;
|
|
25
|
-
buttonClasses: import("vue").ComputedRef<("info" | "default" | "primary" | "danger" | "success" | "warning" | "light" | "dark" | "
|
|
25
|
+
buttonClasses: import("vue").ComputedRef<("info" | "default" | "small" | "primary" | "danger" | "success" | "warning" | "light" | "dark" | "large" | "medium" | {
|
|
26
26
|
disabled: boolean | undefined;
|
|
27
27
|
})[]>;
|
|
28
28
|
onClick: () => void;
|
|
@@ -46,8 +46,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
46
46
|
"onUpdate:isOpen"?: ((value: boolean) => any) | undefined;
|
|
47
47
|
}>, {
|
|
48
48
|
isOpen: boolean;
|
|
49
|
-
x: number;
|
|
50
49
|
teleportTo: string;
|
|
50
|
+
x: number;
|
|
51
51
|
y: number;
|
|
52
52
|
target: string | HTMLElement;
|
|
53
53
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -46,8 +46,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
46
46
|
"onUpdate:isOpen"?: ((value: boolean) => any) | undefined;
|
|
47
47
|
}>, {
|
|
48
48
|
isOpen: boolean;
|
|
49
|
-
x: number;
|
|
50
49
|
teleportTo: string;
|
|
50
|
+
x: number;
|
|
51
51
|
y: number;
|
|
52
52
|
target: string | HTMLElement;
|
|
53
53
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -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
|
-
search: string;
|
|
15
14
|
bulkActions: IKDatatableAction[];
|
|
15
|
+
search: string;
|
|
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
|
-
search: string;
|
|
15
14
|
bulkActions: IKDatatableAction[];
|
|
15
|
+
search: string;
|
|
16
16
|
loading: boolean;
|
|
17
17
|
visibleFields: Array<string> | null;
|
|
18
18
|
rowActions: IKDatatableAction[];
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
+
import { useId } from "#app";
|
|
2
3
|
import { useKModalLogic, KModalDefaultProps } from "./KModal.logic";
|
|
3
4
|
import { usePresetComponent } from "../../composables/usePresetComponent";
|
|
4
5
|
import { computed } from "vue";
|
|
5
6
|
import KModalDefault from "../../presets/default/components/KModal/KModal.vue";
|
|
6
7
|
const props = defineProps(KModalDefaultProps);
|
|
7
|
-
const
|
|
8
|
-
const stableId =
|
|
8
|
+
const generatedId = useId();
|
|
9
|
+
const stableId = `k-modal-${generatedId}`;
|
|
9
10
|
const { modalId, opened, openModal, closeModal } = useKModalLogic(props, stableId);
|
|
10
11
|
defineExpose({
|
|
11
12
|
openModal,
|
|
@@ -165,8 +165,6 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
165
165
|
"onUpdate:isOptionsOpen"?: ((value: boolean) => any) | undefined;
|
|
166
166
|
}>, {
|
|
167
167
|
label: string;
|
|
168
|
-
parentKey: string;
|
|
169
|
-
idKey: string;
|
|
170
168
|
disabled: boolean;
|
|
171
169
|
loading: boolean;
|
|
172
170
|
validation: "error" | "success" | "warning" | null | undefined;
|
|
@@ -181,6 +179,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
181
179
|
multiSelect: boolean;
|
|
182
180
|
valueField: string;
|
|
183
181
|
iconField: string;
|
|
182
|
+
idKey: string;
|
|
183
|
+
parentKey: string;
|
|
184
184
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
185
185
|
declare const _default: typeof __VLS_export;
|
|
186
186
|
export default _default;
|
|
@@ -165,8 +165,6 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
165
165
|
"onUpdate:isOptionsOpen"?: ((value: boolean) => any) | undefined;
|
|
166
166
|
}>, {
|
|
167
167
|
label: string;
|
|
168
|
-
parentKey: string;
|
|
169
|
-
idKey: string;
|
|
170
168
|
disabled: boolean;
|
|
171
169
|
loading: boolean;
|
|
172
170
|
validation: "error" | "success" | "warning" | null | undefined;
|
|
@@ -181,6 +179,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
181
179
|
multiSelect: boolean;
|
|
182
180
|
valueField: string;
|
|
183
181
|
iconField: string;
|
|
182
|
+
idKey: string;
|
|
183
|
+
parentKey: string;
|
|
184
184
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
185
185
|
declare const _default: typeof __VLS_export;
|
|
186
186
|
export default _default;
|
|
@@ -81,14 +81,14 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
81
81
|
default: () => {};
|
|
82
82
|
};
|
|
83
83
|
}>> & Readonly<{}>, {
|
|
84
|
-
parentKey: string;
|
|
85
|
-
idKey: string;
|
|
86
|
-
expandedByDefault: boolean;
|
|
87
84
|
bulkActions: import("@katlux/providers").IKDatatableAction[];
|
|
88
85
|
rowActions: import("./KTreeView.logic.js").IRowAction[];
|
|
89
86
|
cellSlots: Record<string, any>;
|
|
90
87
|
headerSlots: Record<string, any>;
|
|
91
88
|
treeColumnIndex: number;
|
|
89
|
+
idKey: string;
|
|
90
|
+
parentKey: string;
|
|
91
|
+
expandedByDefault: boolean;
|
|
92
92
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
93
93
|
declare const _default: typeof __VLS_export;
|
|
94
94
|
export default _default;
|
|
@@ -81,14 +81,14 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
81
81
|
default: () => {};
|
|
82
82
|
};
|
|
83
83
|
}>> & Readonly<{}>, {
|
|
84
|
-
parentKey: string;
|
|
85
|
-
idKey: string;
|
|
86
|
-
expandedByDefault: boolean;
|
|
87
84
|
bulkActions: import("@katlux/providers").IKDatatableAction[];
|
|
88
85
|
rowActions: import("./KTreeView.logic.js").IRowAction[];
|
|
89
86
|
cellSlots: Record<string, any>;
|
|
90
87
|
headerSlots: Record<string, any>;
|
|
91
88
|
treeColumnIndex: number;
|
|
89
|
+
idKey: string;
|
|
90
|
+
parentKey: string;
|
|
91
|
+
expandedByDefault: boolean;
|
|
92
92
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
93
93
|
declare const _default: typeof __VLS_export;
|
|
94
94
|
export default _default;
|
|
@@ -9,7 +9,7 @@ export declare const presetLoadersRegistry: Map<string, Record<string, () => Pro
|
|
|
9
9
|
*/
|
|
10
10
|
export declare function registerPresetComponents(presetName: string, loaders: Record<string, () => Promise<any>>): void;
|
|
11
11
|
/**
|
|
12
|
-
* Composable for dynamically loading preset components
|
|
12
|
+
* Composable for dynamically loading preset components across a cascade of active presets
|
|
13
13
|
*
|
|
14
14
|
* @param componentBaseName - Base name of the component (e.g., 'KButton')
|
|
15
15
|
* @param defaultComponent - The default preset component to fall back to
|
|
@@ -6,31 +6,37 @@ export function registerPresetComponents(presetName, loaders) {
|
|
|
6
6
|
}
|
|
7
7
|
export function usePresetComponent(componentBaseName, defaultComponent) {
|
|
8
8
|
const appConfig = useAppConfig();
|
|
9
|
-
const
|
|
9
|
+
const presetStack = computed(() => {
|
|
10
|
+
const raw = appConfig.katluxToolkit?.activePreset;
|
|
11
|
+
const list = Array.isArray(raw) ? raw : raw ? [raw] : [];
|
|
12
|
+
return [...list.filter((p) => p && p !== "default"), "default"];
|
|
13
|
+
});
|
|
10
14
|
return computed(() => {
|
|
11
|
-
if (activePreset.value === "default") {
|
|
12
|
-
return defaultComponent;
|
|
13
|
-
}
|
|
14
15
|
let loader;
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"../presets/**/*.vue",
|
|
23
|
-
"../../runtime/presets/**/*.vue"
|
|
24
|
-
]);
|
|
25
|
-
const internalKey = `../presets/${activePreset.value}/components/${componentBaseName}/${componentBaseName}.vue`;
|
|
26
|
-
loader = internalLoaders[internalKey];
|
|
16
|
+
for (const presetName of presetStack.value) {
|
|
17
|
+
if (presetName === "default") break;
|
|
18
|
+
const externalLoaders = presetLoadersRegistry.get(presetName);
|
|
19
|
+
if (externalLoaders) {
|
|
20
|
+
const key = `./components/${componentBaseName}/${componentBaseName}.vue`;
|
|
21
|
+
loader = externalLoaders[key];
|
|
22
|
+
}
|
|
27
23
|
if (!loader) {
|
|
28
|
-
const
|
|
29
|
-
|
|
24
|
+
const internalLoaders = import.meta.glob([
|
|
25
|
+
"../presets/**/*.vue",
|
|
26
|
+
"../../runtime/presets/**/*.vue"
|
|
27
|
+
]);
|
|
28
|
+
const internalKey = `../presets/${presetName}/components/${componentBaseName}/${componentBaseName}.vue`;
|
|
29
|
+
loader = internalLoaders[internalKey];
|
|
30
|
+
if (!loader) {
|
|
31
|
+
const altKey = `../../runtime/presets/${presetName}/components/${componentBaseName}/${componentBaseName}.vue`;
|
|
32
|
+
loader = internalLoaders[altKey];
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
if (loader) {
|
|
36
|
+
break;
|
|
30
37
|
}
|
|
31
38
|
}
|
|
32
39
|
if (!loader) {
|
|
33
|
-
console.warn(`[${componentBaseName}] Preset "${activePreset.value}" not found, falling back to default`);
|
|
34
40
|
return defaultComponent;
|
|
35
41
|
}
|
|
36
42
|
return defineAsyncComponent({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
:root,
|
|
2
|
-
[data-
|
|
2
|
+
[data-preset~=default] {
|
|
3
3
|
--primary-100: #e0f2f7;
|
|
4
4
|
--primary-300: #a7d9ed;
|
|
5
5
|
--primary-500: #2196f3;
|
|
@@ -171,11 +171,14 @@
|
|
|
171
171
|
--input-focus-border-color: var(--primary-500);
|
|
172
172
|
--input-focus-shadow: 0 0 0 3px rgba(33, 150, 243, 0.2);
|
|
173
173
|
--input-height: 40px;
|
|
174
|
-
--table-header-bg: var(--neutral-100);
|
|
175
|
-
--table-header-color: var(--neutral-700);
|
|
176
174
|
--table-border-color: var(--neutral-300);
|
|
177
|
-
--table-
|
|
178
|
-
--table-
|
|
175
|
+
--table-header-bg: var(--neutral-200);
|
|
176
|
+
--table-header-color: var(--neutral-900);
|
|
177
|
+
--table-row-bg: var(--neutral-50);
|
|
178
|
+
--table-row-alt-bg: var(--neutral-100);
|
|
179
|
+
--table-row-hover-bg: var(--neutral-200);
|
|
180
|
+
--table-row-selected-bg: var(--primary-100);
|
|
181
|
+
--table-row-text-color: var(--font-color-primary);
|
|
179
182
|
--checkbox-bg: var(--neutral-50);
|
|
180
183
|
--checkbox-checked-bg: var(--primary-500);
|
|
181
184
|
--checkbox-border-color: var(--border-color-medium);
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// or when data-template="default" is set
|
|
4
4
|
|
|
5
5
|
:root,
|
|
6
|
-
[data-
|
|
6
|
+
[data-preset~="default"] {
|
|
7
7
|
// Primary Colors
|
|
8
8
|
--primary-100: #e0f2f7;
|
|
9
9
|
--primary-300: #a7d9ed;
|
|
@@ -245,11 +245,14 @@
|
|
|
245
245
|
--input-height: 40px;
|
|
246
246
|
|
|
247
247
|
// Table
|
|
248
|
-
--table-header-bg: var(--neutral-100);
|
|
249
|
-
--table-header-color: var(--neutral-700);
|
|
250
248
|
--table-border-color: var(--neutral-300);
|
|
251
|
-
--table-
|
|
252
|
-
--table-
|
|
249
|
+
--table-header-bg: var(--neutral-200);
|
|
250
|
+
--table-header-color: var(--neutral-900);
|
|
251
|
+
--table-row-bg: var(--neutral-50);
|
|
252
|
+
--table-row-alt-bg: var(--neutral-100);
|
|
253
|
+
--table-row-hover-bg: var(--neutral-200);
|
|
254
|
+
--table-row-selected-bg: var(--primary-100);
|
|
255
|
+
--table-row-text-color: var(--font-color-primary);
|
|
253
256
|
|
|
254
257
|
// Checkbox
|
|
255
258
|
--checkbox-bg: var(--neutral-50);
|
|
@@ -16,7 +16,7 @@ li {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
:root,
|
|
19
|
-
[data-
|
|
19
|
+
[data-preset~=default] {
|
|
20
20
|
--primary-100: #e0f2f7;
|
|
21
21
|
--primary-300: #a7d9ed;
|
|
22
22
|
--primary-500: #2196f3;
|
|
@@ -188,11 +188,14 @@ li {
|
|
|
188
188
|
--input-focus-border-color: var(--primary-500);
|
|
189
189
|
--input-focus-shadow: 0 0 0 3px rgba(33, 150, 243, 0.2);
|
|
190
190
|
--input-height: 40px;
|
|
191
|
-
--table-header-bg: var(--neutral-100);
|
|
192
|
-
--table-header-color: var(--neutral-700);
|
|
193
191
|
--table-border-color: var(--neutral-300);
|
|
194
|
-
--table-
|
|
195
|
-
--table-
|
|
192
|
+
--table-header-bg: var(--neutral-200);
|
|
193
|
+
--table-header-color: var(--neutral-900);
|
|
194
|
+
--table-row-bg: var(--neutral-50);
|
|
195
|
+
--table-row-alt-bg: var(--neutral-100);
|
|
196
|
+
--table-row-hover-bg: var(--neutral-200);
|
|
197
|
+
--table-row-selected-bg: var(--primary-100);
|
|
198
|
+
--table-row-text-color: var(--font-color-primary);
|
|
196
199
|
--checkbox-bg: var(--neutral-50);
|
|
197
200
|
--checkbox-checked-bg: var(--primary-500);
|
|
198
201
|
--checkbox-border-color: var(--border-color-medium);
|
|
@@ -367,8 +370,16 @@ a:hover {
|
|
|
367
370
|
|
|
368
371
|
.k-input-label {
|
|
369
372
|
font-size: var(--font-size-xs);
|
|
370
|
-
color: var(--
|
|
373
|
+
color: var(--font-color-secondary);
|
|
371
374
|
margin-bottom: calc(var(--gap-sm) / 2);
|
|
372
375
|
display: block;
|
|
373
376
|
font-weight: 500;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
input, textarea, select {
|
|
380
|
+
color: var(--font-color-primary);
|
|
381
|
+
}
|
|
382
|
+
input::placeholder, textarea::placeholder, select::placeholder {
|
|
383
|
+
color: var(--font-color-secondary);
|
|
384
|
+
opacity: 0.7;
|
|
374
385
|
}
|
|
@@ -70,8 +70,17 @@ a {
|
|
|
70
70
|
}
|
|
71
71
|
.k-input-label {
|
|
72
72
|
font-size: var(--font-size-xs);
|
|
73
|
-
color: var(--
|
|
73
|
+
color: var(--font-color-secondary);
|
|
74
74
|
margin-bottom: calc(var(--gap-sm) / 2);
|
|
75
75
|
display: block;
|
|
76
76
|
font-weight: 500;
|
|
77
77
|
}
|
|
78
|
+
|
|
79
|
+
input, textarea, select {
|
|
80
|
+
color: var(--font-color-primary);
|
|
81
|
+
|
|
82
|
+
&::placeholder {
|
|
83
|
+
color: var(--font-color-secondary);
|
|
84
|
+
opacity: 0.7;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
@@ -41,15 +41,15 @@ defineProps<{
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
&.default {
|
|
44
|
-
background
|
|
45
|
-
border-color: var(--
|
|
46
|
-
color: var(--
|
|
44
|
+
background: var(--button-bg-default);
|
|
45
|
+
border-color: var(--button-bg-default);
|
|
46
|
+
color: var(--button-text-default);
|
|
47
47
|
.loading {
|
|
48
48
|
@include mixins.loading-animation($size: 10px, $color: light);
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
&.primary {
|
|
52
|
-
background
|
|
52
|
+
background: var(--button-bg-primary);
|
|
53
53
|
border-color: var(--button-bg-primary);
|
|
54
54
|
color: var(--button-text-primary);
|
|
55
55
|
.loading {
|
|
@@ -57,7 +57,7 @@ defineProps<{
|
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
&.danger {
|
|
60
|
-
background
|
|
60
|
+
background: var(--button-bg-danger);
|
|
61
61
|
border-color: var(--button-bg-danger);
|
|
62
62
|
color: var(--button-text-danger);
|
|
63
63
|
.loading {
|
|
@@ -65,7 +65,7 @@ defineProps<{
|
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
&.success {
|
|
68
|
-
background
|
|
68
|
+
background: var(--button-bg-success);
|
|
69
69
|
border-color: var(--button-bg-success);
|
|
70
70
|
color: var(--button-text-success);
|
|
71
71
|
.loading {
|
|
@@ -73,7 +73,7 @@ defineProps<{
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
&.warning {
|
|
76
|
-
background
|
|
76
|
+
background: var(--button-bg-warning);
|
|
77
77
|
border-color: var(--button-bg-warning);
|
|
78
78
|
color: var(--button-text-warning);
|
|
79
79
|
.loading {
|
|
@@ -81,7 +81,7 @@ defineProps<{
|
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
&.info {
|
|
84
|
-
background
|
|
84
|
+
background: var(--button-bg-info);
|
|
85
85
|
border-color: var(--button-bg-info);
|
|
86
86
|
color: var(--button-text-info);
|
|
87
87
|
.loading {
|
|
@@ -89,7 +89,7 @@ defineProps<{
|
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
&.light {
|
|
92
|
-
background
|
|
92
|
+
background: var(--button-bg-light);
|
|
93
93
|
border-color: var(--button-bg-light);
|
|
94
94
|
color: var(--button-text-light);
|
|
95
95
|
.loading {
|
|
@@ -97,7 +97,7 @@ defineProps<{
|
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
99
|
&.dark {
|
|
100
|
-
background
|
|
100
|
+
background: var(--button-bg-dark);
|
|
101
101
|
border-color: var(--button-bg-dark);
|
|
102
102
|
color: var(--button-text-dark);
|
|
103
103
|
.loading {
|
|
@@ -106,42 +106,42 @@ defineProps<{
|
|
|
106
106
|
}
|
|
107
107
|
&:hover {
|
|
108
108
|
&.default {
|
|
109
|
-
background
|
|
110
|
-
border-color: var(--
|
|
111
|
-
color: var(--
|
|
109
|
+
background: var(--button-hover-bg-default);
|
|
110
|
+
border-color: var(--button-hover-bg-default);
|
|
111
|
+
color: var(--button-hover-text-default);
|
|
112
112
|
}
|
|
113
113
|
&.primary {
|
|
114
|
-
background
|
|
114
|
+
background: var(--button-hover-bg-primary);
|
|
115
115
|
border-color: var(--button-hover-bg-primary);
|
|
116
116
|
color: var(--button-hover-text-primary);
|
|
117
117
|
}
|
|
118
118
|
&.danger {
|
|
119
|
-
background
|
|
119
|
+
background: var(--button-hover-bg-danger);
|
|
120
120
|
border-color: var(--button-hover-bg-danger);
|
|
121
121
|
color: var(--button-hover-text-danger);
|
|
122
122
|
}
|
|
123
123
|
&.success {
|
|
124
|
-
background
|
|
124
|
+
background: var(--button-hover-bg-success);
|
|
125
125
|
border-color: var(--button-hover-bg-success);
|
|
126
126
|
color: var(--button-hover-text-success);
|
|
127
127
|
}
|
|
128
128
|
&.warning {
|
|
129
|
-
background
|
|
129
|
+
background: var(--button-hover-bg-warning);
|
|
130
130
|
border-color: var(--button-hover-bg-warning);
|
|
131
131
|
color: var(--button-hover-text-warning);
|
|
132
132
|
}
|
|
133
133
|
&.info {
|
|
134
|
-
background
|
|
134
|
+
background: var(--button-hover-bg-info);
|
|
135
135
|
border-color: var(--button-hover-bg-info);
|
|
136
136
|
color: var(--button-hover-text-info);
|
|
137
137
|
}
|
|
138
138
|
&.light {
|
|
139
|
-
background
|
|
139
|
+
background: var(--button-hover-bg-light);
|
|
140
140
|
border-color: var(--button-hover-bg-light);
|
|
141
141
|
color: var(--button-hover-text-light);
|
|
142
142
|
}
|
|
143
143
|
&.dark {
|
|
144
|
-
background
|
|
144
|
+
background: var(--button-hover-bg-dark);
|
|
145
145
|
border-color: var(--button-hover-bg-dark);
|
|
146
146
|
color: var(--button-hover-text-dark);
|
|
147
147
|
}
|
|
@@ -42,11 +42,20 @@ const props = defineProps<{
|
|
|
42
42
|
<style lang="scss" scoped>
|
|
43
43
|
.KCalendar {
|
|
44
44
|
width: fit-content;
|
|
45
|
+
color: var(--font-color-primary);
|
|
45
46
|
.view-header {
|
|
46
47
|
display: flex;
|
|
47
48
|
flex-direction: row;
|
|
48
49
|
flex-wrap: nowrap;
|
|
49
50
|
justify-content: space-between;
|
|
51
|
+
align-items: center;
|
|
52
|
+
margin-bottom: 8px;
|
|
53
|
+
|
|
54
|
+
.year {
|
|
55
|
+
color: var(--font-color-heading);
|
|
56
|
+
font-weight: var(--font-weight-semibold);
|
|
57
|
+
}
|
|
58
|
+
|
|
50
59
|
.prev,
|
|
51
60
|
.next {
|
|
52
61
|
cursor: pointer;
|
|
@@ -57,8 +66,10 @@ const props = defineProps<{
|
|
|
57
66
|
justify-content: center;
|
|
58
67
|
align-items: center;
|
|
59
68
|
border-radius: 4px;
|
|
69
|
+
color: var(--font-color-primary);
|
|
70
|
+
|
|
60
71
|
&:hover {
|
|
61
|
-
background-color:
|
|
72
|
+
background-color: var(--border-color-light);
|
|
62
73
|
}
|
|
63
74
|
}
|
|
64
75
|
}
|
|
@@ -70,13 +81,14 @@ const props = defineProps<{
|
|
|
70
81
|
max-width: 790px;
|
|
71
82
|
width: fit-content;
|
|
72
83
|
.month {
|
|
73
|
-
//flex: 0 0 calc(33.333% - (2 * var(--grid-gap)) / 3);
|
|
74
84
|
max-width: 250px;
|
|
75
85
|
min-width: 250px;
|
|
76
|
-
//max-width: calc(33% - var(--grid-gap));
|
|
77
86
|
|
|
78
87
|
.month-name {
|
|
79
88
|
text-align: center;
|
|
89
|
+
color: var(--font-color-heading);
|
|
90
|
+
font-weight: var(--font-weight-semibold);
|
|
91
|
+
margin-bottom: 4px;
|
|
80
92
|
}
|
|
81
93
|
}
|
|
82
94
|
}
|
|
@@ -50,6 +50,9 @@ const props = defineProps<{
|
|
|
50
50
|
|
|
51
51
|
.weekday {
|
|
52
52
|
text-align: center;
|
|
53
|
+
color: var(--font-color-secondary);
|
|
54
|
+
font-size: var(--font-size-sm);
|
|
55
|
+
font-weight: var(--font-weight-medium);
|
|
53
56
|
}
|
|
54
57
|
}
|
|
55
58
|
.calendar-days {
|
|
@@ -64,6 +67,7 @@ const props = defineProps<{
|
|
|
64
67
|
transition: all 0.2s ease;
|
|
65
68
|
width: 28px;
|
|
66
69
|
height: 28px;
|
|
70
|
+
color: var(--font-color-primary);
|
|
67
71
|
|
|
68
72
|
display: flex;
|
|
69
73
|
flex-direction: row;
|
|
@@ -71,7 +75,7 @@ const props = defineProps<{
|
|
|
71
75
|
justify-content: center;
|
|
72
76
|
|
|
73
77
|
&:hover {
|
|
74
|
-
background-color:
|
|
78
|
+
background-color: var(--border-color-light);
|
|
75
79
|
}
|
|
76
80
|
|
|
77
81
|
&.marked {
|
|
@@ -141,7 +145,7 @@ const props = defineProps<{
|
|
|
141
145
|
|
|
142
146
|
&.offday {
|
|
143
147
|
font-style: italic;
|
|
144
|
-
color: var(--
|
|
148
|
+
color: var(--font-color-secondary);
|
|
145
149
|
}
|
|
146
150
|
&.bold {
|
|
147
151
|
font-weight: bold;
|
|
@@ -150,30 +154,32 @@ const props = defineProps<{
|
|
|
150
154
|
text-decoration: underline;
|
|
151
155
|
}
|
|
152
156
|
&.disabled {
|
|
153
|
-
color: var(--neutral-
|
|
157
|
+
color: var(--neutral-500);
|
|
154
158
|
pointer-events: none;
|
|
155
|
-
background:
|
|
156
|
-
opacity: 0.
|
|
159
|
+
background: transparent;
|
|
160
|
+
opacity: 0.5;
|
|
157
161
|
}
|
|
158
162
|
&.circled {
|
|
159
163
|
.day-number {
|
|
160
|
-
display:
|
|
164
|
+
display: flex;
|
|
165
|
+
align-items: center;
|
|
166
|
+
justify-content: center;
|
|
161
167
|
border: 2px solid var(--primary-500);
|
|
162
168
|
border-radius: 50%;
|
|
163
169
|
box-sizing: border-box;
|
|
164
|
-
|
|
170
|
+
width: 24px;
|
|
171
|
+
height: 24px;
|
|
165
172
|
}
|
|
166
173
|
}
|
|
167
174
|
&.selected {
|
|
168
|
-
background-color: var(--primary-
|
|
169
|
-
color:
|
|
175
|
+
background-color: var(--primary-500);
|
|
176
|
+
color: #ffffff;
|
|
170
177
|
.day-number {
|
|
171
|
-
display:
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
width: 23px;
|
|
178
|
+
display: flex;
|
|
179
|
+
align-items: center;
|
|
180
|
+
justify-content: center;
|
|
181
|
+
width: 24px;
|
|
182
|
+
height: 24px;
|
|
177
183
|
}
|
|
178
184
|
}
|
|
179
185
|
.marked-indicators-row {
|
|
@@ -109,14 +109,15 @@ const isLoading = computed(() => {
|
|
|
109
109
|
table {
|
|
110
110
|
width: 100%;
|
|
111
111
|
border-collapse: collapse;
|
|
112
|
-
border: 1px solid
|
|
112
|
+
border: 1px solid var(--table-border-color);
|
|
113
113
|
thead {
|
|
114
114
|
tr {
|
|
115
|
-
background-color:
|
|
115
|
+
background-color: var(--table-header-bg);
|
|
116
116
|
height: var(--page-height);
|
|
117
117
|
th {
|
|
118
|
-
|
|
119
|
-
border-
|
|
118
|
+
color: var(--table-header-color);
|
|
119
|
+
border-bottom: 1px solid var(--table-border-color);
|
|
120
|
+
border-left: 1px solid var(--table-border-color);
|
|
120
121
|
padding: 5px;
|
|
121
122
|
&:first-child {
|
|
122
123
|
border-left: none;
|
|
@@ -127,20 +128,26 @@ const isLoading = computed(() => {
|
|
|
127
128
|
tbody {
|
|
128
129
|
tr {
|
|
129
130
|
height: 40px;
|
|
130
|
-
background-color:
|
|
131
|
+
background-color: var(--table-row-bg);
|
|
132
|
+
color: var(--table-row-text-color);
|
|
131
133
|
&:nth-child(2n + 1) {
|
|
132
|
-
background-color:
|
|
134
|
+
background-color: var(--table-row-alt-bg);
|
|
133
135
|
}
|
|
134
136
|
&:hover {
|
|
135
|
-
background-color:
|
|
137
|
+
background-color: var(--table-row-hover-bg);
|
|
136
138
|
}
|
|
137
139
|
td {
|
|
138
140
|
padding: 5px;
|
|
141
|
+
border-bottom: 1px solid var(--table-border-color);
|
|
142
|
+
border-left: 1px solid var(--table-border-color);
|
|
143
|
+
&:first-child {
|
|
144
|
+
border-left: none;
|
|
145
|
+
}
|
|
139
146
|
}
|
|
140
147
|
td.empty-state {
|
|
141
148
|
text-align: center;
|
|
142
149
|
padding: 20px;
|
|
143
|
-
color:
|
|
150
|
+
color: var(--font-color-secondary);
|
|
144
151
|
}
|
|
145
152
|
}
|
|
146
153
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template lang="pug">
|
|
2
2
|
.KDropdown-source
|
|
3
3
|
Teleport(v-if="isMounted && open && teleportTarget" :to="teleportTarget")
|
|
4
|
-
.KDropdown-teleported
|
|
4
|
+
.KDropdown-teleported(style="pointer-events: auto;")
|
|
5
5
|
.KDropdown(v-click-outside="{ handler: clickoutside, extraInside: anchorEl }" :style="dialogStyle" v-bind="$attrs")
|
|
6
6
|
KPanel.KDropdown-container(:class="{'fullWidth': fullWidth}" :style="contentStyle")
|
|
7
7
|
slot
|
|
@@ -97,10 +97,14 @@ const contentStyle = computed(() => ({
|
|
|
97
97
|
max-width: 100vw;
|
|
98
98
|
box-shadow: var(--shadow-xl);
|
|
99
99
|
overflow: hidden;
|
|
100
|
+
background-color: var(--panel-bg-default);
|
|
101
|
+
color: var(--font-color-primary);
|
|
100
102
|
:deep {
|
|
101
103
|
.KPanel--content {
|
|
102
104
|
padding: var(--component-gap);
|
|
103
105
|
overflow-y: auto;
|
|
106
|
+
background-color: var(--panel-bg-default);
|
|
107
|
+
color: var(--font-color-primary);
|
|
104
108
|
}
|
|
105
109
|
}
|
|
106
110
|
}
|
|
@@ -41,7 +41,7 @@ const markers = computed(() => getGanttMarkers(props.startMs, props.endMs, props
|
|
|
41
41
|
&__label {
|
|
42
42
|
font-size: 0.68rem;
|
|
43
43
|
font-weight: 600;
|
|
44
|
-
color: var(--
|
|
44
|
+
color: var(--font-color-secondary);
|
|
45
45
|
padding: 4px 4px 0;
|
|
46
46
|
white-space: nowrap;
|
|
47
47
|
line-height: 1;
|
|
@@ -50,7 +50,7 @@ const markers = computed(() => getGanttMarkers(props.startMs, props.endMs, props
|
|
|
50
50
|
&__line {
|
|
51
51
|
flex: 1;
|
|
52
52
|
width: 1px;
|
|
53
|
-
background: var(--border-color
|
|
53
|
+
background: var(--border-color-light);
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
</style>
|
|
@@ -112,7 +112,7 @@ const gridMarkers = computed(() => getGanttMarkers(props.startMs, props.endMs, p
|
|
|
112
112
|
width: 100%;
|
|
113
113
|
height: 28px;
|
|
114
114
|
border-radius: 4px;
|
|
115
|
-
background-color: var(--
|
|
115
|
+
background-color: var(--neutral-200);
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
.gantt-grid-line {
|
|
@@ -120,7 +120,7 @@ const gridMarkers = computed(() => getGanttMarkers(props.startMs, props.endMs, p
|
|
|
120
120
|
top: 0;
|
|
121
121
|
bottom: 0;
|
|
122
122
|
width: 1px;
|
|
123
|
-
background: var(--border-color
|
|
123
|
+
background: var(--border-color-light);
|
|
124
124
|
z-index: 0;
|
|
125
125
|
}
|
|
126
126
|
|
|
@@ -146,15 +146,15 @@ const gridMarkers = computed(() => getGanttMarkers(props.startMs, props.endMs, p
|
|
|
146
146
|
}
|
|
147
147
|
|
|
148
148
|
&--bordered {
|
|
149
|
-
background-color:
|
|
149
|
+
background-color: var(--panel-bg-default);
|
|
150
150
|
border: 1px solid var(--task-color);
|
|
151
|
-
.gantt-title { color:
|
|
151
|
+
.gantt-title { color: var(--font-color-primary); }
|
|
152
152
|
}
|
|
153
153
|
|
|
154
154
|
&--dashed {
|
|
155
|
-
background-color:
|
|
155
|
+
background-color: var(--panel-bg-default);
|
|
156
156
|
border: 1px dashed var(--task-color);
|
|
157
|
-
.gantt-title { color:
|
|
157
|
+
.gantt-title { color: var(--font-color-primary); }
|
|
158
158
|
}
|
|
159
159
|
|
|
160
160
|
&--shaded {
|
|
@@ -162,13 +162,13 @@ const gridMarkers = computed(() => getGanttMarkers(props.startMs, props.endMs, p
|
|
|
162
162
|
45deg,
|
|
163
163
|
color-mix(in srgb, var(--task-color), transparent 80%),
|
|
164
164
|
color-mix(in srgb, var(--task-color), transparent 80%) 8px,
|
|
165
|
-
|
|
166
|
-
|
|
165
|
+
var(--panel-bg-default) 8px,
|
|
166
|
+
var(--panel-bg-default) 16px
|
|
167
167
|
);
|
|
168
168
|
border: 1px solid var(--task-color);
|
|
169
169
|
.gantt-title {
|
|
170
|
-
color:
|
|
171
|
-
background:
|
|
170
|
+
color: var(--font-color-primary);
|
|
171
|
+
background: var(--panel-bg-default);
|
|
172
172
|
border-radius: 2px;
|
|
173
173
|
}
|
|
174
174
|
}
|
|
@@ -21,29 +21,32 @@ const props = defineProps<{
|
|
|
21
21
|
|
|
22
22
|
<style lang="scss" scoped>
|
|
23
23
|
.KHourSelect {
|
|
24
|
+
color: var(--font-color-primary);
|
|
24
25
|
.time-list {
|
|
25
26
|
max-height: 200px;
|
|
26
27
|
overflow-y: auto;
|
|
27
|
-
border: 1px solid var(--border-color
|
|
28
|
-
border-radius:
|
|
28
|
+
border: 1px solid var(--border-color-light);
|
|
29
|
+
border-radius: var(--border-radius-sm);
|
|
30
|
+
background-color: var(--panel-bg-default);
|
|
29
31
|
|
|
30
32
|
.time-item {
|
|
31
33
|
padding: 8px 12px;
|
|
32
34
|
cursor: pointer;
|
|
33
35
|
transition: background-color 0.2s;
|
|
36
|
+
color: var(--font-color-primary);
|
|
34
37
|
|
|
35
38
|
&:hover {
|
|
36
|
-
background-color: var(--
|
|
39
|
+
background-color: var(--border-color-light);
|
|
37
40
|
}
|
|
38
41
|
|
|
39
42
|
&.selected {
|
|
40
|
-
background-color: var(--primary-
|
|
41
|
-
color:
|
|
43
|
+
background-color: var(--primary-500);
|
|
44
|
+
color: #ffffff;
|
|
42
45
|
font-weight: 500;
|
|
43
46
|
}
|
|
44
47
|
|
|
45
48
|
&:not(:last-child) {
|
|
46
|
-
border-bottom: 1px solid var(--border-light
|
|
49
|
+
border-bottom: 1px solid var(--border-color-light);
|
|
47
50
|
}
|
|
48
51
|
}
|
|
49
52
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template lang="pug">
|
|
2
2
|
dialog.k-modal(ref="dialogRef" @close="closeModal" @click="handleBackdropClick" @mousedown="handleMouseDown")
|
|
3
|
-
.modal-portal(:id="modalId" style="position: absolute; top: 0; left: 0; z-index:
|
|
3
|
+
.modal-portal(:id="modalId" style="position: absolute; top: 0; left: 0; z-index: 9999; pointer-events: none;")
|
|
4
4
|
KPanel(no-gap flex-content scrollable).modal-container
|
|
5
5
|
template(#header)
|
|
6
6
|
slot(name="header")
|
|
@@ -31,7 +31,7 @@ const props = withDefaults(defineProps<{
|
|
|
31
31
|
--current-panel-footer-bg: var(--panel-footer-bg-default);
|
|
32
32
|
|
|
33
33
|
border-radius: var(--border-radius-lg);
|
|
34
|
-
border: 1px solid var(--
|
|
34
|
+
border: 1px solid var(--border-color-light);
|
|
35
35
|
box-shadow: var(--shadow-md);
|
|
36
36
|
background-color: color-mix(in srgb, var(--current-panel-bg), transparent calc((1 - var(--panel-bg-opacity)) * 100%));
|
|
37
37
|
backdrop-filter: blur(var(--panel-blur));
|
|
@@ -82,7 +82,7 @@ const props = withDefaults(defineProps<{
|
|
|
82
82
|
&--header {
|
|
83
83
|
padding: var(--gap-md);
|
|
84
84
|
background-color: color-mix(in srgb, var(--current-panel-header-bg), transparent 92%);
|
|
85
|
-
border-bottom: 1px solid var(--
|
|
85
|
+
border-bottom: 1px solid var(--border-color-light);
|
|
86
86
|
font-weight: var(--font-weight-semibold);
|
|
87
87
|
color: var(--font-color-heading);
|
|
88
88
|
font-size: var(--font-size-lg);
|
|
@@ -92,6 +92,7 @@ const props = withDefaults(defineProps<{
|
|
|
92
92
|
padding: var(--gap-md);
|
|
93
93
|
flex: 1;
|
|
94
94
|
min-height: 0;
|
|
95
|
+
color: var(--font-color-primary);
|
|
95
96
|
|
|
96
97
|
&.scrollable {
|
|
97
98
|
overflow-y: auto;
|
|
@@ -106,7 +107,7 @@ const props = withDefaults(defineProps<{
|
|
|
106
107
|
&--footer {
|
|
107
108
|
padding: var(--gap-md);
|
|
108
109
|
background-color: color-mix(in srgb, var(--current-panel-footer-bg), transparent 92%);
|
|
109
|
-
border-top: 1px solid var(--
|
|
110
|
+
border-top: 1px solid var(--border-color-light);
|
|
110
111
|
}
|
|
111
112
|
}
|
|
112
113
|
</style>
|
|
@@ -35,6 +35,7 @@ const textareaAttrs = computed(() => {
|
|
|
35
35
|
border: var(--input-border);
|
|
36
36
|
border-radius: var(--input-border-radius);
|
|
37
37
|
background-color: var(--input-bg);
|
|
38
|
+
color: var(--font-color-primary);
|
|
38
39
|
padding: var(--component-gap);
|
|
39
40
|
font-family: inherit;
|
|
40
41
|
font-size: 14px;
|
|
@@ -43,6 +44,11 @@ const textareaAttrs = computed(() => {
|
|
|
43
44
|
width: 100%;
|
|
44
45
|
box-sizing: border-box;
|
|
45
46
|
|
|
47
|
+
&::placeholder {
|
|
48
|
+
color: var(--font-color-secondary);
|
|
49
|
+
opacity: 0.7;
|
|
50
|
+
}
|
|
51
|
+
|
|
46
52
|
&:focus {
|
|
47
53
|
border-color: var(--input-focus-border-color);
|
|
48
54
|
}
|
|
@@ -75,6 +75,7 @@ const inputAttrs = computed(() => {
|
|
|
75
75
|
flex: 1;
|
|
76
76
|
min-width: 0;
|
|
77
77
|
background-color: var(--input-bg);
|
|
78
|
+
color: var(--font-color-primary);
|
|
78
79
|
box-sizing: border-box;
|
|
79
80
|
padding: 0 var(--component-gap);
|
|
80
81
|
border: none;
|
|
@@ -82,6 +83,11 @@ const inputAttrs = computed(() => {
|
|
|
82
83
|
height: 100%;
|
|
83
84
|
width: 100%;
|
|
84
85
|
|
|
86
|
+
&::placeholder {
|
|
87
|
+
color: var(--font-color-secondary);
|
|
88
|
+
opacity: 0.7;
|
|
89
|
+
}
|
|
90
|
+
|
|
85
91
|
/* Hide arrows in Chrome, Safari, Edge, Opera */
|
|
86
92
|
&::-webkit-outer-spin-button,
|
|
87
93
|
&::-webkit-inner-spin-button {
|
|
@@ -92,7 +92,7 @@ const isLoading = computed(() => props.dataProvider?.loading?.value || props.dat
|
|
|
92
92
|
transition: background-color 0.2s;
|
|
93
93
|
|
|
94
94
|
&:hover {
|
|
95
|
-
background-color: var(--
|
|
95
|
+
background-color: var(--border-color-light);
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
.node-content {
|
|
@@ -113,7 +113,7 @@ const isLoading = computed(() => props.dataProvider?.loading?.value || props.dat
|
|
|
113
113
|
flex-shrink: 0;
|
|
114
114
|
|
|
115
115
|
&:hover {
|
|
116
|
-
background-color: var(--
|
|
116
|
+
background-color: var(--neutral-300);
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
|
|
@@ -108,7 +108,9 @@ function onTreeSelect(node: any) {
|
|
|
108
108
|
padding: 10px;
|
|
109
109
|
max-height: 400px;
|
|
110
110
|
overflow-y: auto;
|
|
111
|
-
min-width: 250px;
|
|
111
|
+
min-width: 250px;
|
|
112
|
+
background-color: var(--panel-bg-default);
|
|
113
|
+
color: var(--font-color-primary);
|
|
112
114
|
}
|
|
113
115
|
|
|
114
116
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export interface PresetMetadata {
|
|
2
2
|
componentName: string;
|
|
3
|
-
presetName: string;
|
|
3
|
+
presetName: string | string[];
|
|
4
4
|
hasCustomPreset: boolean;
|
|
5
5
|
hasCustomStyles: boolean;
|
|
6
6
|
presetPath?: string;
|
|
@@ -12,9 +12,9 @@ export interface PresetCache {
|
|
|
12
12
|
/**
|
|
13
13
|
* PresetResolver - Manages preset resolution and discovery for Katlux components
|
|
14
14
|
*
|
|
15
|
-
*
|
|
15
|
+
* Handles:
|
|
16
16
|
* - Discovering custom presets in the user's project
|
|
17
|
-
* - Resolving preset paths based on component name and active preset
|
|
17
|
+
* - Resolving preset paths based on component name and active preset stack
|
|
18
18
|
* - Falling back to default presets when custom ones don't exist
|
|
19
19
|
* - Caching preset resolution for performance
|
|
20
20
|
*/
|
|
@@ -34,14 +34,14 @@ export declare class PresetResolver {
|
|
|
34
34
|
*/
|
|
35
35
|
resolvePreset(componentName: string): PresetMetadata;
|
|
36
36
|
/**
|
|
37
|
-
* Get the active preset name
|
|
37
|
+
* Get the active preset name or array
|
|
38
38
|
*/
|
|
39
|
-
getActivePreset(): string;
|
|
39
|
+
getActivePreset(): string | string[];
|
|
40
40
|
/**
|
|
41
|
-
* Set the active preset (
|
|
42
|
-
* @param presetName - Name of the
|
|
41
|
+
* Set the active preset (supports string or string[] array for preset stacks)
|
|
42
|
+
* @param presetName - Name or array of names of the presets to activate
|
|
43
43
|
*/
|
|
44
|
-
setActivePreset(presetName: string): void;
|
|
44
|
+
setActivePreset(presetName: string | string[]): void;
|
|
45
45
|
/**
|
|
46
46
|
* Clear the preset cache (useful when presets change in dev mode)
|
|
47
47
|
*/
|
|
@@ -59,6 +59,5 @@ export declare class PresetResolver {
|
|
|
59
59
|
}
|
|
60
60
|
/**
|
|
61
61
|
* Factory function to get the PresetResolver instance
|
|
62
|
-
* This is the recommended way to access the resolver in composables
|
|
63
62
|
*/
|
|
64
63
|
export declare function usePresetResolver(): PresetResolver;
|
|
@@ -15,7 +15,13 @@ export class PresetResolver {
|
|
|
15
15
|
const runtimeConfig = useRuntimeConfig();
|
|
16
16
|
const presetCookie = useCookie("katlux-active-preset");
|
|
17
17
|
if (presetCookie.value) {
|
|
18
|
-
|
|
18
|
+
try {
|
|
19
|
+
const val = presetCookie.value;
|
|
20
|
+
const parsed = val.startsWith("[") || val.startsWith("{") ? JSON.parse(val) : val;
|
|
21
|
+
this.activePreset = parsed;
|
|
22
|
+
} catch {
|
|
23
|
+
this.activePreset = presetCookie.value;
|
|
24
|
+
}
|
|
19
25
|
} else if (appConfig.katluxToolkit?.activePreset) {
|
|
20
26
|
this.activePreset = appConfig.katluxToolkit.activePreset;
|
|
21
27
|
}
|
|
@@ -33,7 +39,8 @@ export class PresetResolver {
|
|
|
33
39
|
* @returns Preset metadata including paths and availability
|
|
34
40
|
*/
|
|
35
41
|
resolvePreset(componentName) {
|
|
36
|
-
const
|
|
42
|
+
const keyStr = Array.isArray(this.activePreset) ? this.activePreset.join(",") : this.activePreset;
|
|
43
|
+
const cacheKey = `${keyStr}:${componentName}`;
|
|
37
44
|
if (this.cache[cacheKey]) {
|
|
38
45
|
return this.cache[cacheKey];
|
|
39
46
|
}
|
|
@@ -43,11 +50,10 @@ export class PresetResolver {
|
|
|
43
50
|
hasCustomPreset: false,
|
|
44
51
|
hasCustomStyles: false
|
|
45
52
|
};
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
metadata.
|
|
50
|
-
metadata.stylesPath = customStylesPath;
|
|
53
|
+
const firstPreset = Array.isArray(this.activePreset) ? this.activePreset[0] : this.activePreset;
|
|
54
|
+
if (firstPreset && firstPreset !== "default") {
|
|
55
|
+
metadata.presetPath = `${this.presetsDir}/${firstPreset}/${componentName}.pug`;
|
|
56
|
+
metadata.stylesPath = `${this.presetsDir}/${firstPreset}/${componentName}.scss`;
|
|
51
57
|
metadata.hasCustomPreset = true;
|
|
52
58
|
metadata.hasCustomStyles = true;
|
|
53
59
|
}
|
|
@@ -55,21 +61,21 @@ export class PresetResolver {
|
|
|
55
61
|
return metadata;
|
|
56
62
|
}
|
|
57
63
|
/**
|
|
58
|
-
* Get the active preset name
|
|
64
|
+
* Get the active preset name or array
|
|
59
65
|
*/
|
|
60
66
|
getActivePreset() {
|
|
61
67
|
return this.activePreset;
|
|
62
68
|
}
|
|
63
69
|
/**
|
|
64
|
-
* Set the active preset (
|
|
65
|
-
* @param presetName - Name of the
|
|
70
|
+
* Set the active preset (supports string or string[] array for preset stacks)
|
|
71
|
+
* @param presetName - Name or array of names of the presets to activate
|
|
66
72
|
*/
|
|
67
73
|
setActivePreset(presetName) {
|
|
68
|
-
if (this.activePreset !== presetName) {
|
|
74
|
+
if (JSON.stringify(this.activePreset) !== JSON.stringify(presetName)) {
|
|
69
75
|
this.activePreset = presetName;
|
|
70
76
|
this.clearCache();
|
|
71
77
|
const presetCookie = useCookie("katlux-active-preset");
|
|
72
|
-
presetCookie.value = presetName;
|
|
78
|
+
presetCookie.value = typeof presetName === "string" ? presetName : JSON.stringify(presetName);
|
|
73
79
|
}
|
|
74
80
|
}
|
|
75
81
|
/**
|