@katlux/preset-modern 0.1.0-alpha.74
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/LICENSE +200 -0
- package/README.md +138 -0
- package/dist/module.d.mts +3 -0
- package/dist/module.json +9 -0
- package/dist/module.mjs +50 -0
- package/dist/runtime/assets/scss/css-variables.css +129 -0
- package/dist/runtime/assets/scss/index.css +137 -0
- package/dist/runtime/components/KBulkActions/KBulkActions.d.vue.ts +20 -0
- package/dist/runtime/components/KBulkActions/KBulkActions.vue +72 -0
- package/dist/runtime/components/KBulkActions/KBulkActions.vue.d.ts +20 -0
- package/dist/runtime/components/KButton/KButton.d.vue.ts +11 -0
- package/dist/runtime/components/KButton/KButton.vue +215 -0
- package/dist/runtime/components/KButton/KButton.vue.d.ts +11 -0
- package/dist/runtime/components/KCheckbox/KCheckbox.d.vue.ts +15 -0
- package/dist/runtime/components/KCheckbox/KCheckbox.vue +122 -0
- package/dist/runtime/components/KCheckbox/KCheckbox.vue.d.ts +15 -0
- package/dist/runtime/components/KDatatable/KDatatable.d.vue.ts +28 -0
- package/dist/runtime/components/KDatatable/KDatatable.vue +209 -0
- package/dist/runtime/components/KDatatable/KDatatable.vue.d.ts +28 -0
- package/dist/runtime/components/KMaskTextbox/KMaskTextbox.d.vue.ts +16 -0
- package/dist/runtime/components/KMaskTextbox/KMaskTextbox.vue +104 -0
- package/dist/runtime/components/KMaskTextbox/KMaskTextbox.vue.d.ts +16 -0
- package/dist/runtime/components/KPagination/KPagination.d.vue.ts +18 -0
- package/dist/runtime/components/KPagination/KPagination.vue +92 -0
- package/dist/runtime/components/KPagination/KPagination.vue.d.ts +18 -0
- package/dist/runtime/components/KRangeSlider/KRangeSlider.d.vue.ts +20 -0
- package/dist/runtime/components/KRangeSlider/KRangeSlider.vue +168 -0
- package/dist/runtime/components/KRangeSlider/KRangeSlider.vue.d.ts +20 -0
- package/dist/runtime/components/KSlider/KSlider.d.vue.ts +16 -0
- package/dist/runtime/components/KSlider/KSlider.vue +133 -0
- package/dist/runtime/components/KSlider/KSlider.vue.d.ts +16 -0
- package/dist/runtime/components/KTextarea/KTextarea.d.vue.ts +16 -0
- package/dist/runtime/components/KTextarea/KTextarea.vue +55 -0
- package/dist/runtime/components/KTextarea/KTextarea.vue.d.ts +16 -0
- package/dist/runtime/components/KTextbox/KTextbox.d.vue.ts +17 -0
- package/dist/runtime/components/KTextbox/KTextbox.vue +101 -0
- package/dist/runtime/components/KTextbox/KTextbox.vue.d.ts +17 -0
- package/dist/runtime/plugin.d.ts +2 -0
- package/dist/runtime/plugin.js +21 -0
- package/dist/types.d.mts +7 -0
- package/package.json +29 -0
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
<template lang="pug">
|
|
2
|
+
.k-datatable.modern-datatable(:style="{ '--page-size': dataProvider?.pageSize?.value || 10 }")
|
|
3
|
+
.header(v-if="bulkActions && bulkActions.length > 0 && selectedRows.length > 0")
|
|
4
|
+
.selected-count {{ selectedRows.length }} items selected
|
|
5
|
+
KBulkActions.bulk-actions(:bulkActions="bulkActions" :selectedRows="selectedRows" :selectAll="selectAll")
|
|
6
|
+
|
|
7
|
+
.k-datatable-wrapper
|
|
8
|
+
.loading-overlay(v-if="dataProvider.loading.value")
|
|
9
|
+
.spinner
|
|
10
|
+
|
|
11
|
+
table
|
|
12
|
+
thead
|
|
13
|
+
tr
|
|
14
|
+
th.check-cell(v-if="bulkActions && bulkActions.length > 0")
|
|
15
|
+
KCheckbox(v-model="selectAll")
|
|
16
|
+
th(v-for="field in visibleFields || dataProvider.fields" :key="field" :data-field="field" :style="getColumnStyle(field)")
|
|
17
|
+
component(v-if="getHeaderSlot(field)" :is="getHeaderSlot(field)" :field="field")
|
|
18
|
+
span(v-else) {{ columnHeaders?.[field] ?? field }}
|
|
19
|
+
th.actions-cell(v-if="rowActions && rowActions.length > 0") Actions
|
|
20
|
+
|
|
21
|
+
tbody
|
|
22
|
+
tr.empty-row(v-if="!dataProvider.loading.value && (!dataProvider.pageData.value || dataProvider.pageData.value.length === 0)")
|
|
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 || 'no result found for filter' }}
|
|
25
|
+
span(v-else) {{ emptyStateText || 'no result' }}
|
|
26
|
+
tr(v-for="(row, index) in dataProvider.pageData.value" :key="index" :class="{ 'selected': selectedRows.includes(row) }")
|
|
27
|
+
td.check-cell(v-if="bulkActions && bulkActions.length > 0")
|
|
28
|
+
KCheckbox(:value="row" v-model="selectedRows")
|
|
29
|
+
td(v-for="visibleField in visibleFields || dataProvider.fields" :key="visibleField" :data-field="visibleField" :style="getColumnStyle(visibleField)")
|
|
30
|
+
component(v-if="getCellSlot(visibleField)" :is="getCellSlot(visibleField)" :row="row" :field="visibleField" :value="row[visibleField]")
|
|
31
|
+
span(v-else) {{ row[visibleField] }}
|
|
32
|
+
td.actions-cell(v-if="rowActions && rowActions.length > 0")
|
|
33
|
+
.action-buttons
|
|
34
|
+
KTooltip(
|
|
35
|
+
v-for="rowAction in rowActions"
|
|
36
|
+
:key="rowAction.label"
|
|
37
|
+
:text="rowAction.label"
|
|
38
|
+
:disabled="!(rowAction.iconOnly || !!rowAction.icon)"
|
|
39
|
+
)
|
|
40
|
+
KButton.action-btn(
|
|
41
|
+
:type="rowAction.type || 'default'"
|
|
42
|
+
:iconOnly="rowAction.iconOnly || !!rowAction.icon"
|
|
43
|
+
size="small"
|
|
44
|
+
@click="rowAction.action(row)"
|
|
45
|
+
)
|
|
46
|
+
template(#icon v-if="rowAction.icon")
|
|
47
|
+
KIcon(:iconname="rowAction.icon" :width="16" :height="16")
|
|
48
|
+
template(#default v-if="!rowAction.iconOnly && !rowAction.icon") {{ rowAction.label }}
|
|
49
|
+
|
|
50
|
+
.footer
|
|
51
|
+
KPagination.pagination(:dataProvider="dataProvider")
|
|
52
|
+
</template>
|
|
53
|
+
|
|
54
|
+
<script setup>
|
|
55
|
+
import { ADataProvider } from "@katlux/providers";
|
|
56
|
+
const selectedRows = defineModel("selectedRows", { type: Array, ...{ default: [] } });
|
|
57
|
+
const selectAll = defineModel("selectAll", { type: Boolean, ...{ default: false } });
|
|
58
|
+
const props = defineProps({
|
|
59
|
+
dataProvider: { type: Object, required: true },
|
|
60
|
+
visibleFields: { type: [Array, null], required: true },
|
|
61
|
+
rowActions: { type: Array, required: true },
|
|
62
|
+
bulkActions: { type: Array, required: true },
|
|
63
|
+
cellSlots: { type: Object, required: false },
|
|
64
|
+
headerSlots: { type: Object, required: false },
|
|
65
|
+
columnHeaders: { type: Object, required: false },
|
|
66
|
+
columnWidths: { type: Object, required: false },
|
|
67
|
+
emptyStateText: { type: String, required: false },
|
|
68
|
+
emptyFilterStateText: { type: String, required: false }
|
|
69
|
+
});
|
|
70
|
+
const getCellSlot = (fieldName) => {
|
|
71
|
+
const slotName = "cell-" + fieldName;
|
|
72
|
+
return props.cellSlots?.[slotName];
|
|
73
|
+
};
|
|
74
|
+
const getHeaderSlot = (fieldName) => {
|
|
75
|
+
const slotName = "header-" + fieldName;
|
|
76
|
+
return props.headerSlots?.[slotName] || props.cellSlots?.[slotName];
|
|
77
|
+
};
|
|
78
|
+
const getColumnStyle = (field) => {
|
|
79
|
+
const w = props.columnWidths?.[field];
|
|
80
|
+
if (!w) return void 0;
|
|
81
|
+
return { width: w, whiteSpace: "nowrap" };
|
|
82
|
+
};
|
|
83
|
+
</script>
|
|
84
|
+
|
|
85
|
+
<style scoped>
|
|
86
|
+
.modern-datatable {
|
|
87
|
+
--page-height: 50px;
|
|
88
|
+
width: 100%;
|
|
89
|
+
display: flex;
|
|
90
|
+
flex-direction: column;
|
|
91
|
+
gap: var(--gap-md);
|
|
92
|
+
font-family: var(--font-family);
|
|
93
|
+
}
|
|
94
|
+
.modern-datatable .header {
|
|
95
|
+
display: flex;
|
|
96
|
+
justify-content: space-between;
|
|
97
|
+
align-items: center;
|
|
98
|
+
padding: var(--gap-sm) var(--gap-lg);
|
|
99
|
+
background: var(--table-header-bg);
|
|
100
|
+
border-radius: var(--button-border-radius);
|
|
101
|
+
border: 1px solid var(--table-border-color);
|
|
102
|
+
}
|
|
103
|
+
.modern-datatable .header .selected-count {
|
|
104
|
+
font-weight: var(--font-weight-semibold);
|
|
105
|
+
color: var(--font-color-secondary);
|
|
106
|
+
}
|
|
107
|
+
.modern-datatable .k-datatable-wrapper {
|
|
108
|
+
position: relative;
|
|
109
|
+
border-radius: var(--border-radius-lg);
|
|
110
|
+
box-shadow: var(--shadow-md);
|
|
111
|
+
background: var(--background-color);
|
|
112
|
+
overflow: hidden;
|
|
113
|
+
border: 1px solid var(--table-border-color);
|
|
114
|
+
}
|
|
115
|
+
.modern-datatable .k-datatable-wrapper .loading-overlay {
|
|
116
|
+
position: absolute;
|
|
117
|
+
top: 0;
|
|
118
|
+
left: 0;
|
|
119
|
+
right: 0;
|
|
120
|
+
bottom: 0;
|
|
121
|
+
background: rgba(255, 255, 255, 0.7);
|
|
122
|
+
backdrop-filter: blur(2px);
|
|
123
|
+
display: flex;
|
|
124
|
+
justify-content: center;
|
|
125
|
+
align-items: center;
|
|
126
|
+
z-index: 10;
|
|
127
|
+
}
|
|
128
|
+
.modern-datatable table {
|
|
129
|
+
width: 100%;
|
|
130
|
+
border-collapse: separate;
|
|
131
|
+
border-spacing: 0;
|
|
132
|
+
}
|
|
133
|
+
.modern-datatable table thead {
|
|
134
|
+
background: var(--table-header-bg);
|
|
135
|
+
}
|
|
136
|
+
.modern-datatable table thead th {
|
|
137
|
+
padding: var(--gap-md);
|
|
138
|
+
font-weight: var(--font-weight-semibold);
|
|
139
|
+
text-align: left;
|
|
140
|
+
color: var(--table-header-color);
|
|
141
|
+
font-size: var(--font-size-sm);
|
|
142
|
+
letter-spacing: 0.05em;
|
|
143
|
+
text-transform: uppercase;
|
|
144
|
+
border-bottom: 1px solid var(--table-border-color);
|
|
145
|
+
white-space: nowrap;
|
|
146
|
+
}
|
|
147
|
+
.modern-datatable table thead th.check-cell {
|
|
148
|
+
width: 48px;
|
|
149
|
+
text-align: center;
|
|
150
|
+
}
|
|
151
|
+
.modern-datatable table thead th.actions-cell {
|
|
152
|
+
text-align: right;
|
|
153
|
+
}
|
|
154
|
+
.modern-datatable table tbody tr {
|
|
155
|
+
transition: all var(--transition-fast);
|
|
156
|
+
}
|
|
157
|
+
.modern-datatable table tbody tr td {
|
|
158
|
+
padding: var(--gap-md);
|
|
159
|
+
border-bottom: 1px solid var(--neutral-100);
|
|
160
|
+
color: var(--font-color-primary);
|
|
161
|
+
font-size: var(--font-size-md);
|
|
162
|
+
}
|
|
163
|
+
.modern-datatable table tbody tr td.check-cell {
|
|
164
|
+
text-align: center;
|
|
165
|
+
}
|
|
166
|
+
.modern-datatable table tbody tr td.actions-cell {
|
|
167
|
+
text-align: right;
|
|
168
|
+
}
|
|
169
|
+
.modern-datatable table tbody tr td.empty-state {
|
|
170
|
+
text-align: center;
|
|
171
|
+
padding: var(--gap-xl, 24px);
|
|
172
|
+
color: var(--font-color-secondary, #666);
|
|
173
|
+
}
|
|
174
|
+
.modern-datatable table tbody tr:last-child td {
|
|
175
|
+
border-bottom: none;
|
|
176
|
+
}
|
|
177
|
+
.modern-datatable table tbody tr:hover {
|
|
178
|
+
background-color: var(--table-row-hover);
|
|
179
|
+
}
|
|
180
|
+
.modern-datatable table tbody tr.selected {
|
|
181
|
+
background-color: var(--table-row-selected);
|
|
182
|
+
}
|
|
183
|
+
.modern-datatable table tbody tr.selected td {
|
|
184
|
+
border-bottom-color: #dbeafe;
|
|
185
|
+
}
|
|
186
|
+
.modern-datatable .action-buttons {
|
|
187
|
+
display: flex;
|
|
188
|
+
gap: var(--gap-sm);
|
|
189
|
+
justify-content: flex-end;
|
|
190
|
+
}
|
|
191
|
+
.modern-datatable .footer {
|
|
192
|
+
padding: 4px 0;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.spinner {
|
|
196
|
+
width: 40px;
|
|
197
|
+
height: 40px;
|
|
198
|
+
border: 3px solid var(--neutral-200);
|
|
199
|
+
border-radius: 50%;
|
|
200
|
+
border-top-color: var(--primary-500);
|
|
201
|
+
animation: spin 1s ease-in-out infinite;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
@keyframes spin {
|
|
205
|
+
to {
|
|
206
|
+
transform: rotate(360deg);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
</style>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ADataProvider } from '@katlux/providers';
|
|
2
|
+
import type { IKDatatableAction } from '@katlux/providers';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
dataProvider: ADataProvider;
|
|
5
|
+
visibleFields: Array<string> | null;
|
|
6
|
+
rowActions: Array<IKDatatableAction>;
|
|
7
|
+
bulkActions: Array<IKDatatableAction>;
|
|
8
|
+
cellSlots?: Record<string, any>;
|
|
9
|
+
headerSlots?: Record<string, any>;
|
|
10
|
+
columnHeaders?: Record<string, string>;
|
|
11
|
+
columnWidths?: Record<string, string>;
|
|
12
|
+
emptyStateText?: string;
|
|
13
|
+
emptyFilterStateText?: string;
|
|
14
|
+
};
|
|
15
|
+
type __VLS_ModelProps = {
|
|
16
|
+
'selectedRows'?: any[];
|
|
17
|
+
'selectAll'?: boolean;
|
|
18
|
+
};
|
|
19
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
20
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
21
|
+
"update:selectedRows": (value: any[]) => any;
|
|
22
|
+
"update:selectAll": (value: boolean) => any;
|
|
23
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
24
|
+
"onUpdate:selectedRows"?: ((value: any[]) => any) | undefined;
|
|
25
|
+
"onUpdate:selectAll"?: ((value: boolean) => any) | undefined;
|
|
26
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
27
|
+
declare const _default: typeof __VLS_export;
|
|
28
|
+
export default _default;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
label?: string;
|
|
3
|
+
maskedValue: string;
|
|
4
|
+
placeholder: string;
|
|
5
|
+
showClear: boolean;
|
|
6
|
+
mask: string;
|
|
7
|
+
};
|
|
8
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
9
|
+
"update:maskedValue": (value: string) => any;
|
|
10
|
+
clear: () => any;
|
|
11
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
12
|
+
"onUpdate:maskedValue"?: ((value: string) => any) | undefined;
|
|
13
|
+
onClear?: (() => any) | undefined;
|
|
14
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
15
|
+
declare const _default: typeof __VLS_export;
|
|
16
|
+
export default _default;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
<template lang="pug">
|
|
2
|
+
.KMaskTextbox
|
|
3
|
+
label.k-input-label(v-if="label") {{ label }}
|
|
4
|
+
KTextbox(
|
|
5
|
+
:modelValue="maskedValue"
|
|
6
|
+
:placeholder="placeholder"
|
|
7
|
+
:showClear="showClear"
|
|
8
|
+
:maxlength="mask.length"
|
|
9
|
+
@update:modelValue="handleUpdate"
|
|
10
|
+
@beforeinput="handleBeforeInput"
|
|
11
|
+
)
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script setup>
|
|
15
|
+
import { computed } from "vue";
|
|
16
|
+
import { getMaskPatternDef } from "@katlux/toolkit/components/KMaskTextbox/KMaskTextbox.logic";
|
|
17
|
+
const props = defineProps({
|
|
18
|
+
label: { type: String, required: false },
|
|
19
|
+
maskedValue: { type: String, required: true },
|
|
20
|
+
placeholder: { type: String, required: true },
|
|
21
|
+
showClear: { type: Boolean, required: true },
|
|
22
|
+
mask: { type: String, required: true }
|
|
23
|
+
});
|
|
24
|
+
const emit = defineEmits(["update:maskedValue", "clear"]);
|
|
25
|
+
const handleBeforeInput = (event) => {
|
|
26
|
+
if (!event.data || event.inputType !== "insertText") {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
const char = event.data;
|
|
30
|
+
if (!/[0-9]/.test(char)) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
const target = event.target;
|
|
34
|
+
const cursorPos = target.selectionStart || 0;
|
|
35
|
+
const currentValue = target.value;
|
|
36
|
+
let maskIdx = 0;
|
|
37
|
+
let valIdx = 0;
|
|
38
|
+
while (valIdx < cursorPos && maskIdx < props.mask.length) {
|
|
39
|
+
const def = getMaskPatternDef(props.mask, maskIdx);
|
|
40
|
+
if (def) {
|
|
41
|
+
let consumed = 0;
|
|
42
|
+
while (consumed < def.length && valIdx < currentValue.length) {
|
|
43
|
+
if (def.pattern.test(currentValue[valIdx])) {
|
|
44
|
+
consumed++;
|
|
45
|
+
}
|
|
46
|
+
valIdx++;
|
|
47
|
+
if (valIdx >= cursorPos) break;
|
|
48
|
+
}
|
|
49
|
+
maskIdx += def.length;
|
|
50
|
+
} else {
|
|
51
|
+
valIdx++;
|
|
52
|
+
maskIdx++;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
const patternType = props.mask.substring(maskIdx, maskIdx + 4);
|
|
56
|
+
const digit = parseInt(char, 10);
|
|
57
|
+
let digitsInPattern = 0;
|
|
58
|
+
let scanIdx = cursorPos;
|
|
59
|
+
while (scanIdx > 0 && digitsInPattern < 10) {
|
|
60
|
+
scanIdx--;
|
|
61
|
+
const ch = currentValue[scanIdx];
|
|
62
|
+
if (/[0-9]/.test(ch)) {
|
|
63
|
+
digitsInPattern++;
|
|
64
|
+
} else {
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
if (patternType.startsWith("DD")) {
|
|
69
|
+
if (digitsInPattern === 0) {
|
|
70
|
+
if (digit > 3) event.preventDefault();
|
|
71
|
+
} else if (digitsInPattern === 1) {
|
|
72
|
+
const firstDigit = parseInt(currentValue[cursorPos - 1], 10);
|
|
73
|
+
if (firstDigit === 0 && digit === 0) event.preventDefault();
|
|
74
|
+
if (firstDigit === 3 && digit > 1) event.preventDefault();
|
|
75
|
+
}
|
|
76
|
+
} else if (patternType.startsWith("MM")) {
|
|
77
|
+
if (digitsInPattern === 0) {
|
|
78
|
+
if (digit > 1) event.preventDefault();
|
|
79
|
+
} else if (digitsInPattern === 1) {
|
|
80
|
+
const firstDigit = parseInt(currentValue[cursorPos - 1], 10);
|
|
81
|
+
if (firstDigit === 0 && digit === 0) event.preventDefault();
|
|
82
|
+
if (firstDigit === 1 && digit > 2) event.preventDefault();
|
|
83
|
+
}
|
|
84
|
+
} else if (patternType.startsWith("HH")) {
|
|
85
|
+
if (digitsInPattern === 0) {
|
|
86
|
+
if (digit > 2) event.preventDefault();
|
|
87
|
+
} else if (digitsInPattern === 1) {
|
|
88
|
+
const firstDigit = parseInt(currentValue[cursorPos - 1], 10);
|
|
89
|
+
if (firstDigit === 2 && digit > 3) event.preventDefault();
|
|
90
|
+
}
|
|
91
|
+
} else if (patternType.startsWith("mm") || patternType.startsWith("ss")) {
|
|
92
|
+
if (digitsInPattern === 0) {
|
|
93
|
+
if (digit > 5) event.preventDefault();
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
const handleUpdate = (value) => {
|
|
98
|
+
emit("update:maskedValue", value);
|
|
99
|
+
};
|
|
100
|
+
</script>
|
|
101
|
+
|
|
102
|
+
<style lang="scss" scoped>
|
|
103
|
+
// No additional styles needed - KTextbox handles everything
|
|
104
|
+
</style>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
label?: string;
|
|
3
|
+
maskedValue: string;
|
|
4
|
+
placeholder: string;
|
|
5
|
+
showClear: boolean;
|
|
6
|
+
mask: string;
|
|
7
|
+
};
|
|
8
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
9
|
+
"update:maskedValue": (value: string) => any;
|
|
10
|
+
clear: () => any;
|
|
11
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
12
|
+
"onUpdate:maskedValue"?: ((value: string) => any) | undefined;
|
|
13
|
+
onClear?: (() => any) | undefined;
|
|
14
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
15
|
+
declare const _default: typeof __VLS_export;
|
|
16
|
+
export default _default;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
dp: any;
|
|
3
|
+
totalPages: number;
|
|
4
|
+
getPageHref: (page: number) => string | undefined;
|
|
5
|
+
visiblePages: number[];
|
|
6
|
+
showPrevButton: boolean;
|
|
7
|
+
showNextButton: boolean;
|
|
8
|
+
showFirstEllipsis: boolean;
|
|
9
|
+
showLastEllipsis: boolean;
|
|
10
|
+
pageClicked: (item: number) => void;
|
|
11
|
+
goToPrev: () => void;
|
|
12
|
+
goToNext: () => void;
|
|
13
|
+
goToFirst: () => void;
|
|
14
|
+
goToLast: () => void;
|
|
15
|
+
};
|
|
16
|
+
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>;
|
|
17
|
+
declare const _default: typeof __VLS_export;
|
|
18
|
+
export default _default;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
<template lang="pug">
|
|
2
|
+
.k-pagination-modern(v-if="totalPages > 1")
|
|
3
|
+
ul.pagination-list
|
|
4
|
+
li
|
|
5
|
+
KButton.nav-btn(
|
|
6
|
+
:onClick="goToPrev"
|
|
7
|
+
:isDisabled="!showPrevButton"
|
|
8
|
+
:buttonClasses="['light', 'small']"
|
|
9
|
+
aria-label="Previous page"
|
|
10
|
+
) ‹
|
|
11
|
+
|
|
12
|
+
li(v-if="showFirstEllipsis")
|
|
13
|
+
KButton.page-btn(
|
|
14
|
+
:onClick="goToFirst"
|
|
15
|
+
:buttonClasses="['light', 'small']"
|
|
16
|
+
:isLink="!!getPageHref(1)"
|
|
17
|
+
:href="getPageHref(1)"
|
|
18
|
+
) 1
|
|
19
|
+
|
|
20
|
+
li(v-if="showFirstEllipsis")
|
|
21
|
+
span.ellipsis ...
|
|
22
|
+
|
|
23
|
+
li(v-for="item in visiblePages" :key="item")
|
|
24
|
+
KButton.page-btn(
|
|
25
|
+
:onClick="() => pageClicked(item)"
|
|
26
|
+
:buttonClasses="[item === dp.currentPage.value ? 'primary' : 'light', 'small']"
|
|
27
|
+
:isLink="!!getPageHref(item)"
|
|
28
|
+
:href="getPageHref(item)"
|
|
29
|
+
) {{ item }}
|
|
30
|
+
|
|
31
|
+
li(v-if="showLastEllipsis")
|
|
32
|
+
span.ellipsis ...
|
|
33
|
+
|
|
34
|
+
li(v-if="showLastEllipsis")
|
|
35
|
+
KButton.page-btn(
|
|
36
|
+
:onClick="goToLast"
|
|
37
|
+
:buttonClasses="['light', 'small']"
|
|
38
|
+
:isLink="!!getPageHref(totalPages)"
|
|
39
|
+
:href="getPageHref(totalPages)"
|
|
40
|
+
) {{ totalPages }}
|
|
41
|
+
|
|
42
|
+
li
|
|
43
|
+
KButton.nav-btn(
|
|
44
|
+
:onClick="goToNext"
|
|
45
|
+
:isDisabled="!showNextButton"
|
|
46
|
+
:buttonClasses="['light', 'small']"
|
|
47
|
+
aria-label="Next page"
|
|
48
|
+
) ›
|
|
49
|
+
</template>
|
|
50
|
+
|
|
51
|
+
<script setup>
|
|
52
|
+
defineProps({
|
|
53
|
+
dp: { type: null, required: true },
|
|
54
|
+
totalPages: { type: Number, required: true },
|
|
55
|
+
getPageHref: { type: Function, required: true },
|
|
56
|
+
visiblePages: { type: Array, required: true },
|
|
57
|
+
showPrevButton: { type: Boolean, required: true },
|
|
58
|
+
showNextButton: { type: Boolean, required: true },
|
|
59
|
+
showFirstEllipsis: { type: Boolean, required: true },
|
|
60
|
+
showLastEllipsis: { type: Boolean, required: true },
|
|
61
|
+
pageClicked: { type: Function, required: true },
|
|
62
|
+
goToPrev: { type: Function, required: true },
|
|
63
|
+
goToNext: { type: Function, required: true },
|
|
64
|
+
goToFirst: { type: Function, required: true },
|
|
65
|
+
goToLast: { type: Function, required: true }
|
|
66
|
+
});
|
|
67
|
+
</script>
|
|
68
|
+
|
|
69
|
+
<style scoped>
|
|
70
|
+
.k-pagination-modern {
|
|
71
|
+
display: flex;
|
|
72
|
+
justify-content: flex-end;
|
|
73
|
+
font-family: var(--font-family);
|
|
74
|
+
}
|
|
75
|
+
.k-pagination-modern .pagination-list {
|
|
76
|
+
display: flex;
|
|
77
|
+
gap: 4px;
|
|
78
|
+
list-style: none;
|
|
79
|
+
padding: 0;
|
|
80
|
+
margin: 0;
|
|
81
|
+
align-items: center;
|
|
82
|
+
}
|
|
83
|
+
.k-pagination-modern .pagination-list li {
|
|
84
|
+
display: flex;
|
|
85
|
+
align-items: center;
|
|
86
|
+
}
|
|
87
|
+
.k-pagination-modern .ellipsis {
|
|
88
|
+
padding: 0 4px;
|
|
89
|
+
color: var(--neutral-400);
|
|
90
|
+
font-size: var(--font-size-sm);
|
|
91
|
+
}
|
|
92
|
+
</style>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
dp: any;
|
|
3
|
+
totalPages: number;
|
|
4
|
+
getPageHref: (page: number) => string | undefined;
|
|
5
|
+
visiblePages: number[];
|
|
6
|
+
showPrevButton: boolean;
|
|
7
|
+
showNextButton: boolean;
|
|
8
|
+
showFirstEllipsis: boolean;
|
|
9
|
+
showLastEllipsis: boolean;
|
|
10
|
+
pageClicked: (item: number) => void;
|
|
11
|
+
goToPrev: () => void;
|
|
12
|
+
goToNext: () => void;
|
|
13
|
+
goToFirst: () => void;
|
|
14
|
+
goToLast: () => void;
|
|
15
|
+
};
|
|
16
|
+
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>;
|
|
17
|
+
declare const _default: typeof __VLS_export;
|
|
18
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
label?: string;
|
|
3
|
+
rangeMin: number;
|
|
4
|
+
rangeMax: number;
|
|
5
|
+
rangeStep: number;
|
|
6
|
+
isDisabled: boolean;
|
|
7
|
+
currentMinValue: number;
|
|
8
|
+
currentMaxValue: number;
|
|
9
|
+
minPercent: number;
|
|
10
|
+
maxPercent: number;
|
|
11
|
+
};
|
|
12
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
13
|
+
"update:minValue": (value: number) => any;
|
|
14
|
+
"update:maxValue": (value: number) => any;
|
|
15
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
16
|
+
"onUpdate:minValue"?: ((value: number) => any) | undefined;
|
|
17
|
+
"onUpdate:maxValue"?: ((value: number) => any) | undefined;
|
|
18
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
|
+
declare const _default: typeof __VLS_export;
|
|
20
|
+
export default _default;
|