@katlux/preset-modern 0.1.1-alpha.80 → 0.1.1-alpha.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/module.json +1 -1
- package/dist/runtime/components/KBulkActions/KBulkActions.vue +4 -2
- package/dist/runtime/components/KCheckbox/KCheckbox.vue +7 -1
- package/dist/runtime/components/KDatatable/KDatatable.vue +8 -6
- package/dist/runtime/components/KPagination/KPagination.vue +4 -2
- package/dist/runtime/components/KTextbox/KTextbox.vue +3 -1
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
labelField="label"
|
|
10
10
|
closeOnSelect
|
|
11
11
|
:disabled="selectedRows.length === 0"
|
|
12
|
-
placeholder="Select
|
|
12
|
+
:placeholder="t('Select an action')"
|
|
13
13
|
class="action-select"
|
|
14
14
|
)
|
|
15
15
|
KButton(
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
size="small"
|
|
18
18
|
:disabled="selectedRows.length === 0 || selected == undefined"
|
|
19
19
|
class="execute-btn"
|
|
20
|
-
)
|
|
20
|
+
) {{ t('Apply') }}
|
|
21
21
|
|
|
22
22
|
template(v-else v-for="action in bulkActions" :key="action.label")
|
|
23
23
|
KTooltip(
|
|
@@ -38,6 +38,8 @@
|
|
|
38
38
|
|
|
39
39
|
<script setup>
|
|
40
40
|
import { CFlatClientDataProvider } from "@katlux/providers";
|
|
41
|
+
const nuxtApp = useNuxtApp?.();
|
|
42
|
+
const t = (key) => nuxtApp?.$t ? nuxtApp.$t(key) : key;
|
|
41
43
|
const selected = defineModel("selected", { type: null });
|
|
42
44
|
defineProps({
|
|
43
45
|
bulkActions: { type: Array, required: true },
|
|
@@ -43,7 +43,13 @@ const formattedModel = computed({
|
|
|
43
43
|
box-shadow: var(--input-focus-shadow);
|
|
44
44
|
}
|
|
45
45
|
.KCheckbox.modern-checkbox input {
|
|
46
|
-
|
|
46
|
+
position: absolute;
|
|
47
|
+
opacity: 0;
|
|
48
|
+
width: 1px;
|
|
49
|
+
height: 1px;
|
|
50
|
+
margin: -1px;
|
|
51
|
+
overflow: hidden;
|
|
52
|
+
clip: rect(0, 0, 0, 0);
|
|
47
53
|
}
|
|
48
54
|
.KCheckbox.modern-checkbox .checkbox-box {
|
|
49
55
|
position: relative;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
<template lang="pug">
|
|
2
|
-
.k-datatable.modern-datatable(:style="{ '--page-size': dataProvider?.pageSize?.value || 10 }")
|
|
2
|
+
.k-datatable.modern-datatable(:style="{ '--page-size': dataProvider?.pageSize?.value || 10 }" role="region" :aria-label="t('Data Table')")
|
|
3
3
|
.header(v-if="bulkActions && bulkActions.length > 0 && selectedRows.length > 0")
|
|
4
|
-
.selected-count {{ selectedRows.length }}
|
|
4
|
+
.selected-count {{ t('{count} items selected').replace('{count}', selectedRows.length.toString()) }}
|
|
5
5
|
KBulkActions.bulk-actions(:bulkActions="bulkActions" :selectedRows="selectedRows" :selectAll="selectAll")
|
|
6
6
|
|
|
7
7
|
.k-datatable-wrapper
|
|
8
8
|
.loading-overlay(v-if="dataProvider.loading.value")
|
|
9
9
|
.spinner
|
|
10
10
|
|
|
11
|
-
table
|
|
11
|
+
table(role="grid" :aria-busy="dataProvider.loading.value")
|
|
12
12
|
thead
|
|
13
13
|
tr
|
|
14
14
|
th.check-cell(v-if="bulkActions && bulkActions.length > 0")
|
|
@@ -16,13 +16,13 @@
|
|
|
16
16
|
th(v-for="field in visibleFields || dataProvider.fields" :key="field" :data-field="field" :style="getColumnStyle(field)")
|
|
17
17
|
component(v-if="getHeaderSlot(field)" :is="getHeaderSlot(field)" :field="field")
|
|
18
18
|
span(v-else) {{ columnHeaders?.[field] ?? field }}
|
|
19
|
-
th.actions-cell(v-if="rowActions && rowActions.length > 0") Actions
|
|
19
|
+
th.actions-cell(v-if="rowActions && rowActions.length > 0") {{ t('Actions') }}
|
|
20
20
|
|
|
21
21
|
tbody
|
|
22
22
|
tr.empty-row(v-if="!dataProvider.loading.value && (!dataProvider.pageData.value || dataProvider.pageData.value.length === 0)")
|
|
23
23
|
td.empty-state(:colspan="(visibleFields || dataProvider.fields || []).length + (bulkActions && bulkActions.length > 0 ? 1 : 0) + (rowActions && rowActions.length > 0 ? 1 : 0)")
|
|
24
|
-
span(v-if="dataProvider.filter.value?.active") {{ emptyFilterStateText || '
|
|
25
|
-
span(v-else) {{ emptyStateText || '
|
|
24
|
+
span(v-if="dataProvider.filter.value?.active") {{ emptyFilterStateText || t('No result found for filter') }}
|
|
25
|
+
span(v-else) {{ emptyStateText || t('No result') }}
|
|
26
26
|
tr(v-for="(row, index) in dataProvider.pageData.value" :key="index" :class="{ 'selected': selectedRows.includes(row) }")
|
|
27
27
|
td.check-cell(v-if="bulkActions && bulkActions.length > 0")
|
|
28
28
|
KCheckbox(:value="row" v-model="selectedRows")
|
|
@@ -53,6 +53,8 @@
|
|
|
53
53
|
|
|
54
54
|
<script setup>
|
|
55
55
|
import { ADataProvider } from "@katlux/providers";
|
|
56
|
+
const nuxtApp = useNuxtApp?.();
|
|
57
|
+
const t = (key) => nuxtApp?.$t ? nuxtApp.$t(key) : key;
|
|
56
58
|
const selectedRows = defineModel("selectedRows", { type: Array, ...{ default: [] } });
|
|
57
59
|
const selectAll = defineModel("selectAll", { type: Boolean, ...{ default: false } });
|
|
58
60
|
const props = defineProps({
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
:onClick="goToPrev"
|
|
7
7
|
:isDisabled="!showPrevButton"
|
|
8
8
|
:buttonClasses="['light', 'small']"
|
|
9
|
-
aria-label="Previous page"
|
|
9
|
+
:aria-label="t('Previous page')"
|
|
10
10
|
) ‹
|
|
11
11
|
|
|
12
12
|
li(v-if="showFirstEllipsis")
|
|
@@ -44,11 +44,13 @@
|
|
|
44
44
|
:onClick="goToNext"
|
|
45
45
|
:isDisabled="!showNextButton"
|
|
46
46
|
:buttonClasses="['light', 'small']"
|
|
47
|
-
aria-label="Next page"
|
|
47
|
+
:aria-label="t('Next page')"
|
|
48
48
|
) ›
|
|
49
49
|
</template>
|
|
50
50
|
|
|
51
51
|
<script setup>
|
|
52
|
+
const nuxtApp = useNuxtApp?.();
|
|
53
|
+
const t = (key) => nuxtApp?.$t ? nuxtApp.$t(key) : key;
|
|
52
54
|
defineProps({
|
|
53
55
|
dp: { type: null, required: true },
|
|
54
56
|
totalPages: { type: Number, required: true },
|
|
@@ -3,13 +3,15 @@
|
|
|
3
3
|
label.k-input-label(v-if="label") {{ label }}
|
|
4
4
|
.KTextbox.modern-textbox(:class="validation ? `is-${validation}` : ''")
|
|
5
5
|
input(v-bind="inputAttrs" :type="props.type" v-model="text" :placeholder="placeholder")
|
|
6
|
-
.clear-button(v-if="showClear" @click.stop="clear" @mousedown.stop)
|
|
6
|
+
.clear-button(v-if="showClear" @click.stop="clear" @mousedown.stop role="button" :aria-label="t('Clear input')")
|
|
7
7
|
KIcon(iconname="close" width="16" height="16")
|
|
8
8
|
span.validation-text(v-if="validation && ['success', 'warning', 'error'].includes(validation) && validationText" :class="`is-${validation}`") {{ validationText }}
|
|
9
9
|
</template>
|
|
10
10
|
|
|
11
11
|
<script setup>
|
|
12
12
|
import { computed, useAttrs } from "vue";
|
|
13
|
+
const nuxtApp = useNuxtApp?.();
|
|
14
|
+
const t = (key) => nuxtApp?.$t ? nuxtApp.$t(key) : key;
|
|
13
15
|
defineOptions({
|
|
14
16
|
inheritAttrs: false
|
|
15
17
|
});
|
package/package.json
CHANGED