@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,20 @@
|
|
|
1
|
+
import { CFlatClientDataProvider } from '@katlux/providers';
|
|
2
|
+
import type { IKDatatableAction } from '@katlux/providers';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
bulkActions: IKDatatableAction[];
|
|
5
|
+
selectedRows: any[];
|
|
6
|
+
selectAll: boolean;
|
|
7
|
+
dp: CFlatClientDataProvider;
|
|
8
|
+
doAction: (action: any) => void;
|
|
9
|
+
};
|
|
10
|
+
type __VLS_ModelProps = {
|
|
11
|
+
'selected'?: any;
|
|
12
|
+
};
|
|
13
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
14
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
15
|
+
"update:selected": (value: any) => any;
|
|
16
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
17
|
+
"onUpdate:selected"?: ((value: any) => any) | undefined;
|
|
18
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
|
+
declare const _default: typeof __VLS_export;
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
<template lang="pug">
|
|
2
|
+
.k-bulk-actions-modern
|
|
3
|
+
.actions-wrapper
|
|
4
|
+
//- Display actions as buttons if few, or dropdown if many
|
|
5
|
+
template(v-if="bulkActions.length > 3")
|
|
6
|
+
KCombobox(
|
|
7
|
+
:dataProvider="dp"
|
|
8
|
+
v-model="selected"
|
|
9
|
+
labelField="label"
|
|
10
|
+
closeOnSelect
|
|
11
|
+
:disabled="selectedRows.length === 0"
|
|
12
|
+
placeholder="Select Action"
|
|
13
|
+
class="action-select"
|
|
14
|
+
)
|
|
15
|
+
KButton(
|
|
16
|
+
@click="doAction(selected)"
|
|
17
|
+
size="small"
|
|
18
|
+
:disabled="selectedRows.length === 0 || selected == undefined"
|
|
19
|
+
class="execute-btn"
|
|
20
|
+
) Go
|
|
21
|
+
|
|
22
|
+
template(v-else v-for="action in bulkActions" :key="action.label")
|
|
23
|
+
KTooltip(
|
|
24
|
+
:text="action.label"
|
|
25
|
+
:disabled="!(action.iconOnly || !!action.icon)"
|
|
26
|
+
)
|
|
27
|
+
KButton(
|
|
28
|
+
@click="doAction(action)"
|
|
29
|
+
size="small"
|
|
30
|
+
:type="action.type || 'default'"
|
|
31
|
+
:iconOnly="action.iconOnly || !!action.icon"
|
|
32
|
+
class="action-btn"
|
|
33
|
+
)
|
|
34
|
+
template(#icon v-if="action.icon")
|
|
35
|
+
KIcon(:iconname="action.icon" :width="16" :height="16")
|
|
36
|
+
template(#default v-if="!action.iconOnly && !action.icon") {{ action.label }}
|
|
37
|
+
</template>
|
|
38
|
+
|
|
39
|
+
<script setup>
|
|
40
|
+
import { CFlatClientDataProvider } from "@katlux/providers";
|
|
41
|
+
const selected = defineModel("selected", { type: null });
|
|
42
|
+
defineProps({
|
|
43
|
+
bulkActions: { type: Array, required: true },
|
|
44
|
+
selectedRows: { type: Array, required: true },
|
|
45
|
+
selectAll: { type: Boolean, required: true },
|
|
46
|
+
dp: { type: Object, required: true },
|
|
47
|
+
doAction: { type: Function, required: true }
|
|
48
|
+
});
|
|
49
|
+
</script>
|
|
50
|
+
|
|
51
|
+
<style scoped>
|
|
52
|
+
.k-bulk-actions-modern {
|
|
53
|
+
display: flex;
|
|
54
|
+
align-items: center;
|
|
55
|
+
}
|
|
56
|
+
.k-bulk-actions-modern .actions-wrapper {
|
|
57
|
+
display: flex;
|
|
58
|
+
gap: var(--gap-sm);
|
|
59
|
+
align-items: center;
|
|
60
|
+
}
|
|
61
|
+
.k-bulk-actions-modern .action-btn {
|
|
62
|
+
border-radius: var(--border-radius-sm);
|
|
63
|
+
font-weight: var(--font-weight-medium);
|
|
64
|
+
transition: all var(--transition-fast);
|
|
65
|
+
}
|
|
66
|
+
.k-bulk-actions-modern .action-btn:hover {
|
|
67
|
+
transform: translateY(-1px);
|
|
68
|
+
}
|
|
69
|
+
.k-bulk-actions-modern .execute-btn {
|
|
70
|
+
border-radius: var(--border-radius-sm);
|
|
71
|
+
}
|
|
72
|
+
</style>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { CFlatClientDataProvider } from '@katlux/providers';
|
|
2
|
+
import type { IKDatatableAction } from '@katlux/providers';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
bulkActions: IKDatatableAction[];
|
|
5
|
+
selectedRows: any[];
|
|
6
|
+
selectAll: boolean;
|
|
7
|
+
dp: CFlatClientDataProvider;
|
|
8
|
+
doAction: (action: any) => void;
|
|
9
|
+
};
|
|
10
|
+
type __VLS_ModelProps = {
|
|
11
|
+
'selected'?: any;
|
|
12
|
+
};
|
|
13
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
14
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
15
|
+
"update:selected": (value: any) => any;
|
|
16
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
17
|
+
"onUpdate:selected"?: ((value: any) => any) | undefined;
|
|
18
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
|
+
declare const _default: typeof __VLS_export;
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
isLink: boolean;
|
|
3
|
+
isDisabled: boolean;
|
|
4
|
+
buttonClasses: any;
|
|
5
|
+
onClick: () => void;
|
|
6
|
+
href?: string;
|
|
7
|
+
loading?: boolean;
|
|
8
|
+
};
|
|
9
|
+
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>;
|
|
10
|
+
declare const _default: typeof __VLS_export;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
<template lang="pug">
|
|
2
|
+
NuxtLink.KButton.modern-button(v-if="isLink" :to="href" @click.prevent="onClick" :class="buttonClasses")
|
|
3
|
+
.button-content
|
|
4
|
+
.button-icon(v-if="$slots.icon")
|
|
5
|
+
slot(name="icon")
|
|
6
|
+
.button-text
|
|
7
|
+
slot
|
|
8
|
+
.button-loader(v-if="loading")
|
|
9
|
+
.spinner
|
|
10
|
+
button.KButton.modern-button(v-else @click="onClick" :class="buttonClasses" :disabled="isDisabled")
|
|
11
|
+
.button-content
|
|
12
|
+
.button-icon(v-if="$slots.icon")
|
|
13
|
+
slot(name="icon")
|
|
14
|
+
.button-text
|
|
15
|
+
slot
|
|
16
|
+
.button-loader(v-if="loading")
|
|
17
|
+
.spinner
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<script setup>
|
|
21
|
+
defineProps({
|
|
22
|
+
isLink: { type: Boolean, required: true },
|
|
23
|
+
isDisabled: { type: Boolean, required: true },
|
|
24
|
+
buttonClasses: { type: null, required: true },
|
|
25
|
+
onClick: { type: Function, required: true },
|
|
26
|
+
href: { type: String, required: false },
|
|
27
|
+
loading: { type: Boolean, required: false }
|
|
28
|
+
});
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<style scoped>
|
|
32
|
+
.KButton.modern-button {
|
|
33
|
+
border-radius: var(--button-border-radius);
|
|
34
|
+
font-weight: var(--font-weight-semibold);
|
|
35
|
+
cursor: pointer;
|
|
36
|
+
transition: all var(--transition-bounce);
|
|
37
|
+
border: 2px solid transparent;
|
|
38
|
+
position: relative;
|
|
39
|
+
overflow: hidden;
|
|
40
|
+
text-decoration: none;
|
|
41
|
+
box-shadow: var(--shadow-md);
|
|
42
|
+
}
|
|
43
|
+
.KButton.modern-button .button-content {
|
|
44
|
+
display: flex;
|
|
45
|
+
align-items: center;
|
|
46
|
+
justify-content: center;
|
|
47
|
+
gap: var(--gap-sm);
|
|
48
|
+
position: relative;
|
|
49
|
+
z-index: 1;
|
|
50
|
+
}
|
|
51
|
+
.KButton.modern-button .button-icon {
|
|
52
|
+
display: flex;
|
|
53
|
+
align-items: center;
|
|
54
|
+
font-size: 1.2em;
|
|
55
|
+
}
|
|
56
|
+
.KButton.modern-button .button-text {
|
|
57
|
+
display: flex;
|
|
58
|
+
align-items: center;
|
|
59
|
+
}
|
|
60
|
+
.KButton.modern-button .button-loader {
|
|
61
|
+
position: absolute;
|
|
62
|
+
right: 12px;
|
|
63
|
+
top: 50%;
|
|
64
|
+
transform: translateY(-50%);
|
|
65
|
+
}
|
|
66
|
+
.KButton.modern-button .button-loader .spinner {
|
|
67
|
+
width: 16px;
|
|
68
|
+
height: 16px;
|
|
69
|
+
border: 2px solid rgba(255, 255, 255, 0.3);
|
|
70
|
+
border-top-color: white;
|
|
71
|
+
border-radius: 50%;
|
|
72
|
+
animation: spin 0.6s linear infinite;
|
|
73
|
+
}
|
|
74
|
+
.KButton.modern-button::before {
|
|
75
|
+
content: "";
|
|
76
|
+
position: absolute;
|
|
77
|
+
top: 0;
|
|
78
|
+
left: 0;
|
|
79
|
+
right: 0;
|
|
80
|
+
bottom: 0;
|
|
81
|
+
background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 100%);
|
|
82
|
+
opacity: 0;
|
|
83
|
+
transition: opacity var(--transition-normal);
|
|
84
|
+
}
|
|
85
|
+
.KButton.modern-button:hover::before {
|
|
86
|
+
opacity: 1;
|
|
87
|
+
}
|
|
88
|
+
.KButton.modern-button:disabled {
|
|
89
|
+
opacity: 0.6;
|
|
90
|
+
cursor: not-allowed;
|
|
91
|
+
pointer-events: none;
|
|
92
|
+
box-shadow: none;
|
|
93
|
+
}
|
|
94
|
+
.KButton.modern-button.default, .KButton.modern-button.primary {
|
|
95
|
+
background: var(--button-bg-primary);
|
|
96
|
+
color: var(--button-text-primary);
|
|
97
|
+
}
|
|
98
|
+
.KButton.modern-button.default:hover, .KButton.modern-button.primary:hover {
|
|
99
|
+
transform: translateY(-2px);
|
|
100
|
+
box-shadow: var(--shadow-glow-primary, var(--shadow-lg));
|
|
101
|
+
}
|
|
102
|
+
.KButton.modern-button.danger {
|
|
103
|
+
background: var(--button-bg-danger);
|
|
104
|
+
color: var(--button-text-danger);
|
|
105
|
+
}
|
|
106
|
+
.KButton.modern-button.danger:hover {
|
|
107
|
+
transform: translateY(-2px);
|
|
108
|
+
box-shadow: var(--shadow-glow-danger, var(--shadow-lg));
|
|
109
|
+
}
|
|
110
|
+
.KButton.modern-button.success {
|
|
111
|
+
background: var(--button-bg-success);
|
|
112
|
+
color: var(--button-text-success);
|
|
113
|
+
}
|
|
114
|
+
.KButton.modern-button.success:hover {
|
|
115
|
+
transform: translateY(-2px);
|
|
116
|
+
box-shadow: var(--shadow-glow-success, var(--shadow-lg));
|
|
117
|
+
}
|
|
118
|
+
.KButton.modern-button.warning {
|
|
119
|
+
background: var(--button-bg-warning);
|
|
120
|
+
color: var(--button-text-warning);
|
|
121
|
+
}
|
|
122
|
+
.KButton.modern-button.warning:hover {
|
|
123
|
+
transform: translateY(-2px);
|
|
124
|
+
box-shadow: var(--shadow-lg);
|
|
125
|
+
}
|
|
126
|
+
.KButton.modern-button.warning .spinner {
|
|
127
|
+
border-color: rgba(51, 51, 51, 0.3);
|
|
128
|
+
border-top-color: #333;
|
|
129
|
+
}
|
|
130
|
+
.KButton.modern-button.info {
|
|
131
|
+
background: var(--button-bg-info);
|
|
132
|
+
color: var(--button-text-info);
|
|
133
|
+
}
|
|
134
|
+
.KButton.modern-button.info:hover {
|
|
135
|
+
transform: translateY(-2px);
|
|
136
|
+
box-shadow: var(--shadow-lg);
|
|
137
|
+
}
|
|
138
|
+
.KButton.modern-button.light {
|
|
139
|
+
background: var(--button-bg-light);
|
|
140
|
+
color: var(--button-text-light);
|
|
141
|
+
border-color: var(--border-color-medium);
|
|
142
|
+
}
|
|
143
|
+
.KButton.modern-button.light:hover {
|
|
144
|
+
transform: translateY(-2px);
|
|
145
|
+
box-shadow: var(--shadow-lg);
|
|
146
|
+
}
|
|
147
|
+
.KButton.modern-button.light .spinner {
|
|
148
|
+
border-color: rgba(51, 51, 51, 0.3);
|
|
149
|
+
border-top-color: #333;
|
|
150
|
+
}
|
|
151
|
+
.KButton.modern-button.dark {
|
|
152
|
+
background: var(--button-bg-dark);
|
|
153
|
+
color: var(--button-text-dark);
|
|
154
|
+
}
|
|
155
|
+
.KButton.modern-button.dark:hover {
|
|
156
|
+
transform: translateY(-2px);
|
|
157
|
+
box-shadow: var(--shadow-lg);
|
|
158
|
+
}
|
|
159
|
+
.KButton.modern-button.large {
|
|
160
|
+
font-size: var(--font-size-lg);
|
|
161
|
+
padding: var(--gap-md) var(--gap-xl);
|
|
162
|
+
border-radius: var(--border-radius-lg);
|
|
163
|
+
}
|
|
164
|
+
.KButton.modern-button.large .button-icon {
|
|
165
|
+
font-size: 1.3em;
|
|
166
|
+
}
|
|
167
|
+
.KButton.modern-button.medium {
|
|
168
|
+
font-size: var(--font-size-md);
|
|
169
|
+
padding: var(--gap-sm) var(--gap-lg);
|
|
170
|
+
border-radius: var(--button-border-radius);
|
|
171
|
+
}
|
|
172
|
+
.KButton.modern-button.small {
|
|
173
|
+
font-size: var(--font-size-sm);
|
|
174
|
+
padding: var(--gap-sm) var(--gap-md);
|
|
175
|
+
border-radius: var(--border-radius-sm);
|
|
176
|
+
}
|
|
177
|
+
.KButton.modern-button.small .button-icon {
|
|
178
|
+
font-size: 1.1em;
|
|
179
|
+
}
|
|
180
|
+
.KButton.modern-button.small .spinner {
|
|
181
|
+
width: 12px;
|
|
182
|
+
height: 12px;
|
|
183
|
+
}
|
|
184
|
+
.KButton.modern-button.icon-only {
|
|
185
|
+
padding: 0;
|
|
186
|
+
display: inline-flex;
|
|
187
|
+
align-items: center;
|
|
188
|
+
justify-content: center;
|
|
189
|
+
aspect-ratio: 1/1;
|
|
190
|
+
}
|
|
191
|
+
.KButton.modern-button.icon-only .button-text {
|
|
192
|
+
display: none;
|
|
193
|
+
}
|
|
194
|
+
.KButton.modern-button.icon-only.large {
|
|
195
|
+
width: 44px;
|
|
196
|
+
height: 44px;
|
|
197
|
+
}
|
|
198
|
+
.KButton.modern-button.icon-only.medium {
|
|
199
|
+
width: 36px;
|
|
200
|
+
height: 36px;
|
|
201
|
+
}
|
|
202
|
+
.KButton.modern-button.icon-only.small {
|
|
203
|
+
width: 28px;
|
|
204
|
+
height: 28px;
|
|
205
|
+
}
|
|
206
|
+
.KButton.modern-button:active {
|
|
207
|
+
transform: translateY(0);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
@keyframes spin {
|
|
211
|
+
to {
|
|
212
|
+
transform: rotate(360deg);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
</style>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
isLink: boolean;
|
|
3
|
+
isDisabled: boolean;
|
|
4
|
+
buttonClasses: any;
|
|
5
|
+
onClick: () => void;
|
|
6
|
+
href?: string;
|
|
7
|
+
loading?: boolean;
|
|
8
|
+
};
|
|
9
|
+
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>;
|
|
10
|
+
declare const _default: typeof __VLS_export;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
model: any;
|
|
3
|
+
checkboxValue: any;
|
|
4
|
+
isDisabled: boolean;
|
|
5
|
+
label?: string;
|
|
6
|
+
validation?: 'success' | 'warning' | 'error' | null;
|
|
7
|
+
validationText?: string;
|
|
8
|
+
};
|
|
9
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
10
|
+
"update:model": (value: any) => any;
|
|
11
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
12
|
+
"onUpdate:model"?: ((value: any) => any) | undefined;
|
|
13
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
|
+
declare const _default: typeof __VLS_export;
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
<template lang="pug">
|
|
2
|
+
.KCheckbox-wrapper
|
|
3
|
+
label.KCheckbox.modern-checkbox
|
|
4
|
+
input(type="checkbox" v-model="formattedModel" :value="checkboxValue" :disabled="isDisabled")
|
|
5
|
+
.checkbox-box(:class="validation ? `is-${validation}` : ''")
|
|
6
|
+
.checkbox-checkmark
|
|
7
|
+
KIcon.icon(iconname="check")
|
|
8
|
+
.checkbox-label(v-if="$slots.label || $slots.default || label")
|
|
9
|
+
slot(name="label")
|
|
10
|
+
slot
|
|
11
|
+
| {{ label }}
|
|
12
|
+
span.validation-text(v-if="validation && ['success', 'warning', 'error'].includes(validation) && validationText" :class="`is-${validation}`") {{ validationText }}
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script setup>
|
|
16
|
+
import { computed } from "vue";
|
|
17
|
+
const props = defineProps({
|
|
18
|
+
model: { type: null, required: true },
|
|
19
|
+
checkboxValue: { type: null, required: true },
|
|
20
|
+
isDisabled: { type: Boolean, required: true },
|
|
21
|
+
label: { type: String, required: false },
|
|
22
|
+
validation: { type: [String, null], required: false },
|
|
23
|
+
validationText: { type: String, required: false }
|
|
24
|
+
});
|
|
25
|
+
const emit = defineEmits(["update:model"]);
|
|
26
|
+
const formattedModel = computed({
|
|
27
|
+
get: () => props.model,
|
|
28
|
+
set: (value) => emit("update:model", value)
|
|
29
|
+
});
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
<style scoped>
|
|
33
|
+
.KCheckbox.modern-checkbox {
|
|
34
|
+
display: flex;
|
|
35
|
+
align-items: center;
|
|
36
|
+
gap: var(--gap-sm);
|
|
37
|
+
cursor: pointer;
|
|
38
|
+
user-select: none;
|
|
39
|
+
transition: all var(--transition-fast);
|
|
40
|
+
}
|
|
41
|
+
.KCheckbox.modern-checkbox:hover .checkbox-box {
|
|
42
|
+
border-color: var(--primary-500);
|
|
43
|
+
box-shadow: var(--input-focus-shadow);
|
|
44
|
+
}
|
|
45
|
+
.KCheckbox.modern-checkbox input {
|
|
46
|
+
display: none;
|
|
47
|
+
}
|
|
48
|
+
.KCheckbox.modern-checkbox .checkbox-box {
|
|
49
|
+
position: relative;
|
|
50
|
+
width: 22px;
|
|
51
|
+
height: 22px;
|
|
52
|
+
border: 2px solid var(--neutral-400);
|
|
53
|
+
border-radius: var(--checkbox-border-radius, 4px);
|
|
54
|
+
background: var(--background-color);
|
|
55
|
+
transition: all var(--transition-bounce);
|
|
56
|
+
display: flex;
|
|
57
|
+
align-items: center;
|
|
58
|
+
justify-content: center;
|
|
59
|
+
flex-shrink: 0;
|
|
60
|
+
}
|
|
61
|
+
.KCheckbox.modern-checkbox .checkbox-box::before {
|
|
62
|
+
content: "";
|
|
63
|
+
position: absolute;
|
|
64
|
+
inset: 0;
|
|
65
|
+
border-radius: 4px;
|
|
66
|
+
background: var(--checkbox-checked-bg);
|
|
67
|
+
opacity: 0;
|
|
68
|
+
transform: scale(0.8);
|
|
69
|
+
transition: all var(--transition-bounce);
|
|
70
|
+
}
|
|
71
|
+
.KCheckbox.modern-checkbox .checkbox-checkmark {
|
|
72
|
+
position: relative;
|
|
73
|
+
z-index: 1;
|
|
74
|
+
}
|
|
75
|
+
.KCheckbox.modern-checkbox .checkbox-checkmark .icon {
|
|
76
|
+
display: none;
|
|
77
|
+
color: white;
|
|
78
|
+
font-size: 14px;
|
|
79
|
+
animation: checkmark-pop 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
|
|
80
|
+
}
|
|
81
|
+
.KCheckbox.modern-checkbox .checkbox-label {
|
|
82
|
+
font-size: 15px;
|
|
83
|
+
color: var(--font-color-primary);
|
|
84
|
+
line-height: 1.5;
|
|
85
|
+
}
|
|
86
|
+
.KCheckbox.modern-checkbox input:checked + .checkbox-box {
|
|
87
|
+
border-color: var(--primary-500);
|
|
88
|
+
}
|
|
89
|
+
.KCheckbox.modern-checkbox input:checked + .checkbox-box::before {
|
|
90
|
+
opacity: 1;
|
|
91
|
+
transform: scale(1);
|
|
92
|
+
}
|
|
93
|
+
.KCheckbox.modern-checkbox input:checked + .checkbox-box .checkbox-checkmark .icon {
|
|
94
|
+
display: block;
|
|
95
|
+
}
|
|
96
|
+
.KCheckbox.modern-checkbox input:disabled + .checkbox-box {
|
|
97
|
+
background-color: var(--neutral-200);
|
|
98
|
+
border-color: var(--neutral-300);
|
|
99
|
+
cursor: not-allowed;
|
|
100
|
+
}
|
|
101
|
+
.KCheckbox.modern-checkbox input:disabled + .checkbox-box::before {
|
|
102
|
+
background: var(--neutral-400);
|
|
103
|
+
}
|
|
104
|
+
.KCheckbox.modern-checkbox input:disabled ~ .checkbox-label {
|
|
105
|
+
color: var(--neutral-400);
|
|
106
|
+
cursor: not-allowed;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
@keyframes checkmark-pop {
|
|
110
|
+
0% {
|
|
111
|
+
transform: scale(0);
|
|
112
|
+
opacity: 0;
|
|
113
|
+
}
|
|
114
|
+
50% {
|
|
115
|
+
transform: scale(1.2);
|
|
116
|
+
}
|
|
117
|
+
100% {
|
|
118
|
+
transform: scale(1);
|
|
119
|
+
opacity: 1;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
</style>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
model: any;
|
|
3
|
+
checkboxValue: any;
|
|
4
|
+
isDisabled: boolean;
|
|
5
|
+
label?: string;
|
|
6
|
+
validation?: 'success' | 'warning' | 'error' | null;
|
|
7
|
+
validationText?: string;
|
|
8
|
+
};
|
|
9
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
10
|
+
"update:model": (value: any) => any;
|
|
11
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
12
|
+
"onUpdate:model"?: ((value: any) => any) | undefined;
|
|
13
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
|
+
declare const _default: typeof __VLS_export;
|
|
15
|
+
export default _default;
|
|
@@ -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;
|