@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,31 +1,41 @@
|
|
|
1
1
|
<template lang="pug">
|
|
2
|
-
.k-pagination(v-if="totalPages > 1")
|
|
2
|
+
nav.k-pagination(v-if="totalPages > 1" :aria-label="t('Pagination Navigation')")
|
|
3
3
|
ul
|
|
4
4
|
li(v-if="showPrevButton")
|
|
5
|
-
KButton(@click="goToPrev" :href="getPageHref(dp.currentPage.value - 1)" size="small" variant="outline") ‹
|
|
5
|
+
KButton(@click="goToPrev" :href="getPageHref(dp.currentPage.value - 1)" size="small" variant="outline" :aria-label="t('Previous Page')") ‹
|
|
6
6
|
|
|
7
7
|
li(v-if="showFirstEllipsis")
|
|
8
|
-
KButton(@click="goToFirst" :href="getPageHref(1)" size="small" variant="outline") 1
|
|
8
|
+
KButton(@click="goToFirst" :href="getPageHref(1)" size="small" variant="outline" :aria-label="t('Go to Page 1')") 1
|
|
9
9
|
|
|
10
10
|
li(v-if="showFirstEllipsis")
|
|
11
11
|
span.ellipsis ...
|
|
12
12
|
|
|
13
13
|
li(v-for="item in visiblePages" :key="item")
|
|
14
|
-
KButton(
|
|
14
|
+
KButton(
|
|
15
|
+
@click="pageClicked(item)"
|
|
16
|
+
:href="getPageHref(item)"
|
|
17
|
+
:class="{'light': item==dp.currentPage.value}"
|
|
18
|
+
size="small"
|
|
19
|
+
:aria-current="item === dp.currentPage.value ? 'page' : undefined"
|
|
20
|
+
:aria-label="t('Page') + ' ' + item"
|
|
21
|
+
) {{item}}
|
|
15
22
|
|
|
16
23
|
li(v-if="showLastEllipsis")
|
|
17
24
|
span.ellipsis ...
|
|
18
25
|
|
|
19
26
|
li(v-if="showLastEllipsis")
|
|
20
|
-
KButton(@click="goToLast" :href="getPageHref(totalPages)" size="small" variant="outline") {{totalPages}}
|
|
27
|
+
KButton(@click="goToLast" :href="getPageHref(totalPages)" size="small" variant="outline" :aria-label="t('Go to Page') + ' ' + totalPages") {{totalPages}}
|
|
21
28
|
|
|
22
29
|
li(v-if="showNextButton")
|
|
23
|
-
KButton(@click="goToNext" :href="getPageHref(dp.currentPage.value + 1)" size="small" variant="outline") ›
|
|
30
|
+
KButton(@click="goToNext" :href="getPageHref(dp.currentPage.value + 1)" size="small" variant="outline" :aria-label="t('Next Page')") ›
|
|
24
31
|
</template>
|
|
25
32
|
|
|
26
33
|
<script setup lang="ts">
|
|
27
34
|
import { computed } from 'vue'
|
|
28
35
|
|
|
36
|
+
const nuxtApp = useNuxtApp?.()
|
|
37
|
+
const t = (key: string) => nuxtApp?.$t ? nuxtApp.$t(key) : key
|
|
38
|
+
|
|
29
39
|
const props = defineProps<{
|
|
30
40
|
dp: any
|
|
31
41
|
totalPages: number
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
<template lang="pug">
|
|
2
2
|
.KRadiobox-wrapper
|
|
3
|
-
label.KRadiobox
|
|
4
|
-
|
|
3
|
+
label.KRadiobox(
|
|
4
|
+
role="radio"
|
|
5
|
+
:aria-checked="model === value"
|
|
6
|
+
:aria-disabled="disabled"
|
|
7
|
+
tabindex="0"
|
|
8
|
+
@keydown.space.prevent="model = value"
|
|
9
|
+
)
|
|
10
|
+
input(type="radio" v-model="model" :disabled="disabled" :value="value" tabindex="-1")
|
|
5
11
|
.icon-container(:class="validation ? `is-${validation}` : ''")
|
|
6
12
|
KIcon.icon(iconname="check")
|
|
7
13
|
span(v-if="$slots.label || $slots.default || label")
|
|
@@ -30,7 +36,13 @@ const model = defineModel()
|
|
|
30
36
|
gap: 5px;
|
|
31
37
|
cursor: pointer;
|
|
32
38
|
input {
|
|
33
|
-
|
|
39
|
+
position: absolute;
|
|
40
|
+
opacity: 0;
|
|
41
|
+
width: 1px;
|
|
42
|
+
height: 1px;
|
|
43
|
+
margin: -1px;
|
|
44
|
+
overflow: hidden;
|
|
45
|
+
clip: rect(0, 0, 0, 0);
|
|
34
46
|
}
|
|
35
47
|
.icon-container {
|
|
36
48
|
border: var(--input-border);
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
.KTab
|
|
3
3
|
KPanel
|
|
4
4
|
template(#header)
|
|
5
|
-
.k-tabs-nav
|
|
6
|
-
KButton.k-tabs-nav-btn(v-if="hasOverflow" @click="scroll(-1)" size="small") <
|
|
5
|
+
.k-tabs-nav(role="tablist" :aria-label="t('Tab Navigation')")
|
|
6
|
+
KButton.k-tabs-nav-btn(v-if="hasOverflow" @click="scroll(-1)" size="small" :aria-label="t('Scroll left')") <
|
|
7
7
|
.k-tabs-scroll-area(ref="scrollArea")
|
|
8
8
|
KGrid(direction="row" wrap="nowrap")
|
|
9
9
|
KButton.k-tab-btn(
|
|
@@ -12,14 +12,20 @@
|
|
|
12
12
|
@click="toggleItem(index)"
|
|
13
13
|
size="small"
|
|
14
14
|
:disabled="isOpen(index)"
|
|
15
|
+
role="tab"
|
|
16
|
+
:aria-selected="isOpen(index)"
|
|
17
|
+
:tabindex="isOpen(index) ? 0 : -1"
|
|
15
18
|
) {{item.title}}
|
|
16
|
-
KButton.k-tabs-nav-btn(v-if="hasOverflow" @click="scroll(1)" size="small") >
|
|
19
|
+
KButton.k-tabs-nav-btn(v-if="hasOverflow" @click="scroll(1)" size="small" :aria-label="t('Scroll right')") >
|
|
17
20
|
slot
|
|
18
21
|
</template>
|
|
19
22
|
|
|
20
23
|
<script lang="ts" setup>
|
|
21
24
|
import { ref, onMounted, onUnmounted, watch, nextTick } from 'vue'
|
|
22
25
|
|
|
26
|
+
const nuxtApp = useNuxtApp?.()
|
|
27
|
+
const t = (key: string) => nuxtApp?.$t ? nuxtApp.$t(key) : key
|
|
28
|
+
|
|
23
29
|
const props = defineProps<{
|
|
24
30
|
items: any[]
|
|
25
31
|
toggleItem: (index: number) => void
|
|
@@ -3,13 +3,16 @@
|
|
|
3
3
|
label.k-input-label(v-if="label") {{ label }}
|
|
4
4
|
.KTextbox(:class="validation ? `is-${validation}` : ''")
|
|
5
5
|
input(v-bind="inputAttrs" :type="props.type" v-model="text" :placeholder="placeholder")
|
|
6
|
-
KIcon(v-if="showClear" @click.stop="clear" @mousedown.stop iconname="close" width="10" height="10").closeIcon
|
|
6
|
+
KIcon(v-if="showClear" @click.stop="clear" @mousedown.stop iconname="close" width="10" height="10" role="button" :aria-label="t('Clear input')").closeIcon
|
|
7
7
|
span.validation-text(v-if="validation && ['success', 'warning', 'error'].includes(validation) && validationText" :class="`is-${validation}`") {{ validationText }}
|
|
8
8
|
</template>
|
|
9
9
|
|
|
10
10
|
<script lang="ts" setup>
|
|
11
11
|
import { computed, useAttrs } from 'vue'
|
|
12
12
|
|
|
13
|
+
const nuxtApp = useNuxtApp?.()
|
|
14
|
+
const t = (key: string) => nuxtApp?.$t ? nuxtApp.$t(key) : key
|
|
15
|
+
|
|
13
16
|
defineOptions({
|
|
14
17
|
inheritAttrs: false
|
|
15
18
|
})
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template lang="pug">
|
|
2
|
-
.KTree
|
|
2
|
+
.KTree(role="tree" :aria-label="t('Hierarchical Tree')")
|
|
3
3
|
KLoader(:loading="isLoading" overlay)
|
|
4
4
|
.tree-list
|
|
5
5
|
.tree-node(
|
|
@@ -7,6 +7,12 @@
|
|
|
7
7
|
:key="row[idKey] || row.id"
|
|
8
8
|
:class="{ 'has-children': row.__treeNode?.hasChildren }"
|
|
9
9
|
:style="{ paddingLeft: ((row.__treeNode?.depth || 0) * 20) + 'px' }"
|
|
10
|
+
role="treeitem"
|
|
11
|
+
:aria-expanded="row.__treeNode?.hasChildren ? row.__treeNode?.isExpanded : undefined"
|
|
12
|
+
:aria-level="(row.__treeNode?.depth || 0) + 1"
|
|
13
|
+
tabindex="0"
|
|
14
|
+
@keydown.enter.prevent="onNodeClick(row)"
|
|
15
|
+
@keydown.space.prevent="row.__treeNode?.hasChildren ? toggleNode(row.__treeNode?.id) : onNodeClick(row)"
|
|
10
16
|
)
|
|
11
17
|
.node-content
|
|
12
18
|
// Toggle
|
|
@@ -14,6 +20,9 @@
|
|
|
14
20
|
v-if="row.__treeNode?.hasChildren"
|
|
15
21
|
@click="toggleNode(row.__treeNode?.id)"
|
|
16
22
|
:class="{ expanded: row.__treeNode?.isExpanded }"
|
|
23
|
+
role="button"
|
|
24
|
+
:aria-label="t('Toggle node')"
|
|
25
|
+
tabindex="-1"
|
|
17
26
|
)
|
|
18
27
|
KIcon(iconname="chevron" :width="12" :height="12" :rotate="row.__treeNode?.isExpanded ? '90' : '0'")
|
|
19
28
|
|
|
@@ -42,6 +51,9 @@
|
|
|
42
51
|
<script lang="ts" setup>
|
|
43
52
|
import { computed, type Ref } from 'vue'
|
|
44
53
|
|
|
54
|
+
const nuxtApp = useNuxtApp?.()
|
|
55
|
+
const t = (key: string) => nuxtApp?.$t ? nuxtApp.$t(key) : key
|
|
56
|
+
|
|
45
57
|
const props = defineProps<{
|
|
46
58
|
visibleRows: any[] // Rows with __treeNode attached
|
|
47
59
|
expandedNodes: Set<string | number>
|
package/package.json
CHANGED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
-
declare const _default: typeof __VLS_export;
|
|
3
|
-
export default _default;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { usePresetComponent } from "../../composables/usePresetComponent";
|
|
3
|
-
import KSearchTreeDefault from "../../presets/default/components/KSearchTree/KSearchTree.vue";
|
|
4
|
-
const presetComponent = usePresetComponent("KSearchTree", KSearchTreeDefault);
|
|
5
|
-
</script>
|
|
6
|
-
|
|
7
|
-
<template lang="pug">
|
|
8
|
-
component(:is="presetComponent")
|
|
9
|
-
</template>
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
-
declare const _default: typeof __VLS_export;
|
|
3
|
-
export default _default;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
-
declare const _default: typeof __VLS_export;
|
|
3
|
-
export default _default;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { usePresetComponent } from "../../composables/usePresetComponent";
|
|
3
|
-
import KSearchTreeDropdownDefault from "../../presets/default/components/KSearchTreeDropdown/KSearchTreeDropdown.vue";
|
|
4
|
-
const presetComponent = usePresetComponent("KSearchTreeDropdown", KSearchTreeDropdownDefault);
|
|
5
|
-
</script>
|
|
6
|
-
|
|
7
|
-
<template lang="pug">
|
|
8
|
-
component(:is="presetComponent")
|
|
9
|
-
</template>
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
-
declare const _default: typeof __VLS_export;
|
|
3
|
-
export default _default;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
type __VLS_Props = {
|
|
2
|
-
label?: string;
|
|
3
|
-
};
|
|
4
|
-
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>;
|
|
5
|
-
declare const _default: typeof __VLS_export;
|
|
6
|
-
export default _default;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
type __VLS_Props = {
|
|
2
|
-
label?: string;
|
|
3
|
-
};
|
|
4
|
-
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>;
|
|
5
|
-
declare const _default: typeof __VLS_export;
|
|
6
|
-
export default _default;
|
package/dist/runtime/presets/default/components/KSearchTreeDropdown/KSearchTreeDropdown.d.vue.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
type __VLS_Props = {
|
|
2
|
-
label?: string;
|
|
3
|
-
};
|
|
4
|
-
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>;
|
|
5
|
-
declare const _default: typeof __VLS_export;
|
|
6
|
-
export default _default;
|
package/dist/runtime/presets/default/components/KSearchTreeDropdown/KSearchTreeDropdown.vue.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
type __VLS_Props = {
|
|
2
|
-
label?: string;
|
|
3
|
-
};
|
|
4
|
-
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>;
|
|
5
|
-
declare const _default: typeof __VLS_export;
|
|
6
|
-
export default _default;
|