@katlux/toolkit 0.1.0-beta.84 → 0.1.1-alpha.100
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/README.md +9 -4
- package/bin/add-ai-reference.mjs +84 -0
- package/dist/compiled/composables/locales.mjs +554 -0
- package/dist/compiled/composables/useKatluxI18n.mjs +56 -0
- package/dist/compiled/composables/useKatluxI18n.spec.mjs +10 -0
- package/dist/compiled/composables/usePresetComponent.mjs +22 -13
- package/dist/module.cjs +70 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +71 -2
- 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/KCheckbox/KCheckbox.global.d.vue.ts +2 -2
- package/dist/runtime/components/KCheckbox/KCheckbox.global.vue.d.ts +2 -2
- package/dist/runtime/components/KCombobox/KCombobox.global.d.vue.ts +3 -3
- package/dist/runtime/components/KCombobox/KCombobox.global.vue.d.ts +3 -3
- package/dist/runtime/components/KCombobox/KCombobox.logic.d.ts +1 -1
- package/dist/runtime/components/KCombobox/KCombobox.logic.js +1 -1
- package/dist/runtime/components/KCompositeInput/KCompositeInput.global.d.vue.ts +7 -7
- package/dist/runtime/components/KCompositeInput/KCompositeInput.global.vue.d.ts +7 -7
- package/dist/runtime/components/KCompositeInput/KCompositeInput.logic.d.ts +3 -3
- 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/KDatePicker/KDatePicker.global.d.vue.ts +6 -6
- package/dist/runtime/components/KDatePicker/KDatePicker.global.vue.d.ts +6 -6
- package/dist/runtime/components/KDatePicker/KDatePicker.logic.d.ts +2 -2
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.d.vue.ts +6 -6
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.vue.d.ts +6 -6
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.logic.d.ts +2 -2
- package/dist/runtime/components/KGantt/KGantt.global.d.vue.ts +9 -9
- package/dist/runtime/components/KGantt/KGantt.global.vue.d.ts +9 -9
- package/dist/runtime/components/KGantt/KGantt.logic.d.ts +4 -4
- package/dist/runtime/components/KHourPicker/KHourPicker.global.d.vue.ts +2 -2
- package/dist/runtime/components/KHourPicker/KHourPicker.global.vue.d.ts +2 -2
- package/dist/runtime/components/KIcon/KIcon.global.d.vue.ts +6 -6
- package/dist/runtime/components/KIcon/KIcon.global.vue.d.ts +6 -6
- package/dist/runtime/components/KIcon/KIcon.logic.d.ts +3 -3
- package/dist/runtime/components/KLoader/KLoader.global.d.vue.ts +1 -1
- package/dist/runtime/components/KLoader/KLoader.global.vue.d.ts +1 -1
- package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.d.vue.ts +1 -1
- package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.vue.d.ts +1 -1
- package/dist/runtime/components/KModal/KModal.logic.js +4 -1
- package/dist/runtime/components/KRadiobox/KRadiobox.global.d.vue.ts +1 -1
- package/dist/runtime/components/KRadiobox/KRadiobox.global.vue.d.ts +1 -1
- package/dist/runtime/components/KSlider/KSlider.global.d.vue.ts +1 -1
- package/dist/runtime/components/KSlider/KSlider.global.vue.d.ts +1 -1
- package/dist/runtime/components/KTabs/KTabs.logic.js +12 -5
- package/dist/runtime/components/KTextarea/KTextarea.global.d.vue.ts +2 -2
- package/dist/runtime/components/KTextarea/KTextarea.global.vue.d.ts +2 -2
- package/dist/runtime/components/KTextbox/KTextbox.global.d.vue.ts +2 -2
- package/dist/runtime/components/KTextbox/KTextbox.global.vue.d.ts +2 -2
- package/dist/runtime/components/KToast/KToast.global.d.vue.ts +1 -1
- package/dist/runtime/components/KToast/KToast.global.vue.d.ts +1 -1
- 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/components/KTreePicker/KTreePicker.global.d.vue.ts +3 -3
- package/dist/runtime/components/KTreePicker/KTreePicker.global.vue.d.ts +3 -3
- 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/locales.d.ts +28 -0
- package/dist/runtime/composables/locales.js +554 -0
- package/dist/runtime/composables/useKatluxI18n.d.ts +15 -0
- package/dist/runtime/composables/useKatluxI18n.js +56 -0
- package/dist/runtime/composables/usePresetComponent.d.ts +3 -8
- package/dist/runtime/composables/usePresetComponent.js +22 -13
- package/dist/runtime/plugins/PresetPlugin.d.ts +2 -3
- package/dist/runtime/plugins/PresetPlugin.js +11 -15
- 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 +112 -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/KCombobox/KComboboxList.vue +7 -0
- package/dist/runtime/presets/default/components/KDatatable/KDatatable.vue +7 -4
- package/dist/runtime/presets/default/components/KDropdown/KDropdown.vue +7 -2
- 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/dist/runtime/presets/default/components/KTreePicker/KTreePicker.vue +5 -1
- package/package.json +7 -2
- 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,8 +1,8 @@
|
|
|
1
|
-
import { computed, defineAsyncComponent } from "vue";
|
|
1
|
+
import { computed, defineAsyncComponent, shallowReactive } from "vue";
|
|
2
2
|
import { useAppConfig } from "#app";
|
|
3
|
-
|
|
3
|
+
const _loadersRegistry = shallowReactive({});
|
|
4
4
|
export function registerPresetComponents(presetName, loaders) {
|
|
5
|
-
|
|
5
|
+
_loadersRegistry[presetName] = loaders;
|
|
6
6
|
}
|
|
7
7
|
export function usePresetComponent(componentBaseName, defaultComponent) {
|
|
8
8
|
const appConfig = useAppConfig();
|
|
@@ -15,7 +15,7 @@ export function usePresetComponent(componentBaseName, defaultComponent) {
|
|
|
15
15
|
let loader;
|
|
16
16
|
for (const presetName of presetStack.value) {
|
|
17
17
|
if (presetName === "default") break;
|
|
18
|
-
const externalLoaders =
|
|
18
|
+
const externalLoaders = _loadersRegistry[presetName];
|
|
19
19
|
if (externalLoaders) {
|
|
20
20
|
const key = `./components/${componentBaseName}/${componentBaseName}.vue`;
|
|
21
21
|
loader = externalLoaders[key];
|
|
@@ -23,18 +23,27 @@ export function usePresetComponent(componentBaseName, defaultComponent) {
|
|
|
23
23
|
if (!loader) {
|
|
24
24
|
const internalLoaders = import.meta.glob([
|
|
25
25
|
"../presets/**/*.vue",
|
|
26
|
-
"../../runtime/presets/**/*.vue"
|
|
26
|
+
"../../runtime/presets/**/*.vue",
|
|
27
|
+
"~/presets/**/*.vue",
|
|
28
|
+
"@/presets/**/*.vue"
|
|
27
29
|
]);
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
const candidateKeys = [
|
|
31
|
+
`../presets/${presetName}/components/${componentBaseName}/${componentBaseName}.vue`,
|
|
32
|
+
`../../runtime/presets/${presetName}/components/${componentBaseName}/${componentBaseName}.vue`,
|
|
33
|
+
`/app/presets/${presetName}/components/${componentBaseName}/${componentBaseName}.vue`,
|
|
34
|
+
`/presets/${presetName}/components/${componentBaseName}/${componentBaseName}.vue`
|
|
35
|
+
];
|
|
36
|
+
for (const [key, importFn] of Object.entries(internalLoaders)) {
|
|
37
|
+
for (const candidate of candidateKeys) {
|
|
38
|
+
if (key.endsWith(candidate)) {
|
|
39
|
+
loader = importFn;
|
|
40
|
+
break;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
if (loader) break;
|
|
33
44
|
}
|
|
34
45
|
}
|
|
35
|
-
if (loader)
|
|
36
|
-
break;
|
|
37
|
-
}
|
|
46
|
+
if (loader) break;
|
|
38
47
|
}
|
|
39
48
|
if (!loader) {
|
|
40
49
|
return defaultComponent;
|
|
@@ -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,25 +1,21 @@
|
|
|
1
|
-
import { defineNuxtPlugin, useHead, useAppConfig } from "#app";
|
|
2
|
-
import { watch } from "vue";
|
|
1
|
+
import { defineNuxtPlugin, useHead, useAppConfig, useState } from "#app";
|
|
2
|
+
import { ref, 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 activePreset = resolver.getActivePreset();
|
|
7
6
|
const appConfig = useAppConfig();
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
});
|
|
17
|
-
};
|
|
18
|
-
updateRootAttribute(activePreset);
|
|
7
|
+
const activePresetState = useState("katlux-active-preset-state", () => resolver.getActivePreset());
|
|
8
|
+
const resolvePresetString = (val) => Array.isArray(val) ? val[0] ?? "default" : val;
|
|
9
|
+
const currentPreset = ref(resolvePresetString(activePresetState.value));
|
|
10
|
+
useHead({
|
|
11
|
+
htmlAttrs: {
|
|
12
|
+
"data-preset": currentPreset
|
|
13
|
+
}
|
|
14
|
+
});
|
|
19
15
|
if (appConfig.katluxToolkit) {
|
|
20
16
|
watch(() => appConfig.katluxToolkit?.activePreset, (newPreset) => {
|
|
21
17
|
if (newPreset) {
|
|
22
|
-
|
|
18
|
+
currentPreset.value = resolvePresetString(newPreset);
|
|
23
19
|
resolver.setActivePreset(newPreset);
|
|
24
20
|
}
|
|
25
21
|
});
|
|
@@ -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;
|
|
@@ -1,5 +1,114 @@
|
|
|
1
1
|
<template lang="pug">
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
Transition(name="k-alert-fade")
|
|
3
|
+
.KAlert(v-if="visible" :class="[props.type]" role="alert")
|
|
4
|
+
.alert-icon {{ icon }}
|
|
5
|
+
.alert-body
|
|
6
|
+
.alert-title(v-if="props.title") {{ props.title }}
|
|
7
|
+
.alert-content
|
|
8
|
+
slot
|
|
9
|
+
button.alert-dismiss(v-if="props.dismissible" @click="dismiss" :aria-label="t('Dismiss')")
|
|
10
|
+
| ×
|
|
4
11
|
</template>
|
|
5
|
-
|
|
12
|
+
|
|
13
|
+
<script lang="ts" setup>
|
|
14
|
+
import type { KAlertProps } from '../../../../components/KAlert/KAlert.logic'
|
|
15
|
+
import { useKatluxI18n } from '#toolkit/composables/useKatluxI18n'
|
|
16
|
+
|
|
17
|
+
const props = defineProps<KAlertProps>()
|
|
18
|
+
const emit = defineEmits<{ dismiss: [] }>()
|
|
19
|
+
const { visible, dismiss, icon } = useKAlertLogic(props, () => emit('dismiss'))
|
|
20
|
+
|
|
21
|
+
const { t } = useKatluxI18n()
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<style lang="scss" scoped>
|
|
25
|
+
.KAlert {
|
|
26
|
+
display: flex;
|
|
27
|
+
align-items: flex-start;
|
|
28
|
+
gap: 0.75rem;
|
|
29
|
+
padding: 0.875rem 1.125rem;
|
|
30
|
+
border-radius: var(--border-radius-md, 8px);
|
|
31
|
+
border: 1px solid transparent;
|
|
32
|
+
font-size: var(--font-size-md, 14px);
|
|
33
|
+
line-height: 1.5;
|
|
34
|
+
margin-bottom: 0.75rem;
|
|
35
|
+
|
|
36
|
+
// Type variants
|
|
37
|
+
&.info {
|
|
38
|
+
background-color: var(--info-color-light, #cffafe);
|
|
39
|
+
border-color: var(--info-color, #06b6d4);
|
|
40
|
+
color: var(--cyan-900, #164e63);
|
|
41
|
+
}
|
|
42
|
+
&.success {
|
|
43
|
+
background-color: var(--success-color-light, #dcfce7);
|
|
44
|
+
border-color: var(--success-color, #4caf50);
|
|
45
|
+
color: var(--green-900, #14532d);
|
|
46
|
+
}
|
|
47
|
+
&.warning {
|
|
48
|
+
background-color: var(--warning-color-light, #fef9c3);
|
|
49
|
+
border-color: var(--warning-color, #eab308);
|
|
50
|
+
color: var(--yellow-900, #713f12);
|
|
51
|
+
}
|
|
52
|
+
&.danger {
|
|
53
|
+
background-color: var(--error-color-light, #fee2e2);
|
|
54
|
+
border-color: var(--error-color, #ef4444);
|
|
55
|
+
color: var(--red-900, #7f1d1d);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.alert-icon {
|
|
59
|
+
font-size: 1.1rem;
|
|
60
|
+
flex-shrink: 0;
|
|
61
|
+
margin-top: 1px;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.alert-body {
|
|
65
|
+
flex: 1;
|
|
66
|
+
min-width: 0;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.alert-title {
|
|
70
|
+
font-weight: var(--font-weight-semibold, 600);
|
|
71
|
+
margin-bottom: 0.25rem;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.alert-content {
|
|
75
|
+
font-size: var(--font-size-md, 14px);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.alert-dismiss {
|
|
79
|
+
background: none;
|
|
80
|
+
border: none;
|
|
81
|
+
cursor: pointer;
|
|
82
|
+
font-size: 1.25rem;
|
|
83
|
+
line-height: 1;
|
|
84
|
+
opacity: 0.6;
|
|
85
|
+
color: inherit;
|
|
86
|
+
padding: 0;
|
|
87
|
+
flex-shrink: 0;
|
|
88
|
+
transition: opacity var(--transition-fast, 0.15s ease);
|
|
89
|
+
|
|
90
|
+
&:hover {
|
|
91
|
+
opacity: 1;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.k-alert-fade-enter-active,
|
|
97
|
+
.k-alert-fade-leave-active {
|
|
98
|
+
transition: all var(--transition-normal, 0.3s ease);
|
|
99
|
+
overflow: hidden;
|
|
100
|
+
}
|
|
101
|
+
.k-alert-fade-enter-from,
|
|
102
|
+
.k-alert-fade-leave-to {
|
|
103
|
+
opacity: 0;
|
|
104
|
+
max-height: 0;
|
|
105
|
+
padding-top: 0;
|
|
106
|
+
padding-bottom: 0;
|
|
107
|
+
margin-bottom: 0;
|
|
108
|
+
}
|
|
109
|
+
.k-alert-fade-enter-to,
|
|
110
|
+
.k-alert-fade-leave-from {
|
|
111
|
+
opacity: 1;
|
|
112
|
+
max-height: 200px;
|
|
113
|
+
}
|
|
114
|
+
</style>
|
|
@@ -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;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<template lang="pug">
|
|
2
2
|
.k-bulk-actions
|
|
3
3
|
template(v-if="props.bulkActions.length>3")
|
|
4
|
-
KCombobox(:dataProvider="dp" v-model="internalSelected" labelField="label" closeOnSelect :disabled="props.selectedRows.length === 0" placeholder="Select an action")
|
|
5
|
-
KButton(@click="doAction(internalSelected)" size="small" :disabled="props.selectedRows.length === 0 || internalSelected == undefined")
|
|
4
|
+
KCombobox(:dataProvider="dp" v-model="internalSelected" labelField="label" closeOnSelect :disabled="props.selectedRows.length === 0" :placeholder="t('Select an action')")
|
|
5
|
+
KButton(@click="doAction(internalSelected)" size="small" :disabled="props.selectedRows.length === 0 || internalSelected == undefined") {{ t('Apply') }}
|
|
6
6
|
template(v-else-if="props.bulkActions.length<=3" v-for="(action, index) in props.bulkActions")
|
|
7
7
|
KTooltip(
|
|
8
8
|
:text="action.label"
|
|
@@ -18,13 +18,16 @@
|
|
|
18
18
|
template(#icon v-if="action.icon")
|
|
19
19
|
KIcon(:iconname="action.icon" :width="16" :height="16")
|
|
20
20
|
template(#default v-if="!action.iconOnly && !action.icon") {{action.label}}
|
|
21
|
-
.info Selected {{props.selectedRows.length}}
|
|
21
|
+
.info {{ t('Selected {count} items').replace('{count}', props.selectedRows.length.toString()) }}
|
|
22
22
|
</template>
|
|
23
23
|
|
|
24
24
|
<script setup lang="ts">
|
|
25
25
|
import { computed } from 'vue'
|
|
26
26
|
import { CFlatClientDataProvider } from '@katlux/providers'
|
|
27
27
|
import type { IKDatatableAction } from '@katlux/providers'
|
|
28
|
+
import { useKatluxI18n } from '#toolkit/composables/useKatluxI18n'
|
|
29
|
+
|
|
30
|
+
const { t } = useKatluxI18n()
|
|
28
31
|
|
|
29
32
|
const props = defineProps<{
|
|
30
33
|
bulkActions: IKDatatableAction[]
|
|
@@ -3,7 +3,10 @@ type __VLS_Props = {
|
|
|
3
3
|
view: string;
|
|
4
4
|
viewCount: number;
|
|
5
5
|
actualYear: any;
|
|
6
|
+
actualMonth: any;
|
|
7
|
+
activeDate: Date;
|
|
6
8
|
monthSelectedDay: any;
|
|
9
|
+
rawMarkedDays?: IMarkedDay[];
|
|
7
10
|
goToPrev: () => void;
|
|
8
11
|
goToNext: () => void;
|
|
9
12
|
getMonthName: (i: number) => string;
|
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
<template lang="pug">
|
|
2
2
|
.KCalendar
|
|
3
|
-
.
|
|
3
|
+
.week-view(v-if="view=='week'")
|
|
4
|
+
.view-header
|
|
5
|
+
.prev(@click="goToPrev")
|
|
6
|
+
KIcon(iconname="chevron" width=10 height=10 rotate="180")
|
|
7
|
+
.year {{ getMonthName(1) }} {{ actualYear }}
|
|
8
|
+
.next(@click="goToNext")
|
|
9
|
+
KIcon(iconname="chevron" width=10 height=10)
|
|
10
|
+
KCalendarWeek(
|
|
11
|
+
:currentDate="activeDate"
|
|
12
|
+
:selectedDay="monthSelectedDay"
|
|
13
|
+
:markedDays="rawMarkedDays && rawMarkedDays.length > 0 ? rawMarkedDays : getExpandedMarkedDays(1)"
|
|
14
|
+
:dayClicked="dayClicked"
|
|
15
|
+
)
|
|
16
|
+
.month-view(v-else)
|
|
4
17
|
.view-header
|
|
5
18
|
.prev(@click="goToPrev")
|
|
6
19
|
KIcon(iconname="chevron" width=10 height=10 rotate="180")
|
|
@@ -27,7 +40,10 @@ const props = defineProps<{
|
|
|
27
40
|
view: string
|
|
28
41
|
viewCount: number
|
|
29
42
|
actualYear: any
|
|
43
|
+
actualMonth: any
|
|
44
|
+
activeDate: Date
|
|
30
45
|
monthSelectedDay: any
|
|
46
|
+
rawMarkedDays?: IMarkedDay[]
|
|
31
47
|
goToPrev: () => void
|
|
32
48
|
goToNext: () => void
|
|
33
49
|
getMonthName: (i: number) => string
|
|
@@ -3,7 +3,10 @@ type __VLS_Props = {
|
|
|
3
3
|
view: string;
|
|
4
4
|
viewCount: number;
|
|
5
5
|
actualYear: any;
|
|
6
|
+
actualMonth: any;
|
|
7
|
+
activeDate: Date;
|
|
6
8
|
monthSelectedDay: any;
|
|
9
|
+
rawMarkedDays?: IMarkedDay[];
|
|
7
10
|
goToPrev: () => void;
|
|
8
11
|
goToNext: () => void;
|
|
9
12
|
getMonthName: (i: number) => string;
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
import type { IMarkedDay } from '../../../../components/KCalendar/types.js';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
currentDate?: Date | string;
|
|
4
|
+
selectedDay?: Date | string;
|
|
5
|
+
markedDays?: IMarkedDay[];
|
|
6
|
+
dayClicked: (date: Date) => void;
|
|
7
|
+
};
|
|
8
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
2
9
|
declare const _default: typeof __VLS_export;
|
|
3
10
|
export default _default;
|