@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,168 @@
|
|
|
1
|
+
<template lang="pug">
|
|
2
|
+
.KRangeSlider(:class="{ disabled: isDisabled }")
|
|
3
|
+
label.k-input-label(v-if="label") {{ label }}
|
|
4
|
+
.slider-container(@click="handleTrackClick")
|
|
5
|
+
.slider-track
|
|
6
|
+
.slider-range(:style="{ left: minPercent + '%', width: (maxPercent - minPercent) + '%' }")
|
|
7
|
+
input.slider-input.slider-min(
|
|
8
|
+
type="range"
|
|
9
|
+
:min="rangeMin"
|
|
10
|
+
:max="rangeMax"
|
|
11
|
+
:step="rangeStep"
|
|
12
|
+
:value="currentMinValue"
|
|
13
|
+
:disabled="isDisabled"
|
|
14
|
+
@input="updateMinValue"
|
|
15
|
+
)
|
|
16
|
+
input.slider-input.slider-max(
|
|
17
|
+
type="range"
|
|
18
|
+
:min="rangeMin"
|
|
19
|
+
:max="rangeMax"
|
|
20
|
+
:step="rangeStep"
|
|
21
|
+
:value="currentMaxValue"
|
|
22
|
+
:disabled="isDisabled"
|
|
23
|
+
@input="updateMaxValue"
|
|
24
|
+
)
|
|
25
|
+
</template>
|
|
26
|
+
|
|
27
|
+
<script setup>
|
|
28
|
+
import { computed } from "vue";
|
|
29
|
+
const props = defineProps({
|
|
30
|
+
label: { type: String, required: false },
|
|
31
|
+
rangeMin: { type: Number, required: true },
|
|
32
|
+
rangeMax: { type: Number, required: true },
|
|
33
|
+
rangeStep: { type: Number, required: true },
|
|
34
|
+
isDisabled: { type: Boolean, required: true },
|
|
35
|
+
currentMinValue: { type: Number, required: true },
|
|
36
|
+
currentMaxValue: { type: Number, required: true },
|
|
37
|
+
minPercent: { type: Number, required: true },
|
|
38
|
+
maxPercent: { type: Number, required: true }
|
|
39
|
+
});
|
|
40
|
+
const emit = defineEmits(["update:minValue", "update:maxValue"]);
|
|
41
|
+
const updateMinValue = (event) => {
|
|
42
|
+
const value = parseFloat(event.target.value);
|
|
43
|
+
if (value <= props.currentMaxValue) {
|
|
44
|
+
emit("update:minValue", value);
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
const updateMaxValue = (event) => {
|
|
48
|
+
const value = parseFloat(event.target.value);
|
|
49
|
+
if (value >= props.currentMinValue) {
|
|
50
|
+
emit("update:maxValue", value);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
const handleTrackClick = (event) => {
|
|
54
|
+
if (props.isDisabled) return;
|
|
55
|
+
const target = event.currentTarget;
|
|
56
|
+
const rect = target.getBoundingClientRect();
|
|
57
|
+
const clickX = event.clientX - rect.left;
|
|
58
|
+
const percentage = clickX / rect.width;
|
|
59
|
+
const rawValue = props.rangeMin + percentage * (props.rangeMax - props.rangeMin);
|
|
60
|
+
const steppedValue = Math.round(rawValue / props.rangeStep) * props.rangeStep;
|
|
61
|
+
const value = Math.max(props.rangeMin, Math.min(props.rangeMax, steppedValue));
|
|
62
|
+
const distanceToMin = Math.abs(value - props.currentMinValue);
|
|
63
|
+
const distanceToMax = Math.abs(value - props.currentMaxValue);
|
|
64
|
+
if (distanceToMin < distanceToMax) {
|
|
65
|
+
if (value <= props.currentMaxValue) {
|
|
66
|
+
emit("update:minValue", value);
|
|
67
|
+
}
|
|
68
|
+
} else {
|
|
69
|
+
if (value >= props.currentMinValue) {
|
|
70
|
+
emit("update:maxValue", value);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
</script>
|
|
75
|
+
|
|
76
|
+
<style scoped>
|
|
77
|
+
.KRangeSlider {
|
|
78
|
+
position: relative;
|
|
79
|
+
padding: 20px 0;
|
|
80
|
+
}
|
|
81
|
+
.KRangeSlider.disabled {
|
|
82
|
+
opacity: 0.5;
|
|
83
|
+
cursor: not-allowed;
|
|
84
|
+
}
|
|
85
|
+
.KRangeSlider .slider-container {
|
|
86
|
+
position: relative;
|
|
87
|
+
height: 8px;
|
|
88
|
+
cursor: pointer;
|
|
89
|
+
}
|
|
90
|
+
.KRangeSlider .slider-track {
|
|
91
|
+
position: absolute;
|
|
92
|
+
width: 100%;
|
|
93
|
+
height: 8px;
|
|
94
|
+
background: linear-gradient(to right, var(--neutral-200), var(--neutral-300));
|
|
95
|
+
border-radius: 4px;
|
|
96
|
+
box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
|
|
97
|
+
}
|
|
98
|
+
.KRangeSlider .slider-range {
|
|
99
|
+
position: absolute;
|
|
100
|
+
height: 8px;
|
|
101
|
+
background: linear-gradient(90deg, var(--primary-400), var(--primary-600));
|
|
102
|
+
border-radius: 4px;
|
|
103
|
+
z-index: 1;
|
|
104
|
+
box-shadow: 0 2px 8px rgba(var(--primary-500-rgb), 0.3);
|
|
105
|
+
}
|
|
106
|
+
.KRangeSlider .slider-input {
|
|
107
|
+
position: absolute;
|
|
108
|
+
width: 100%;
|
|
109
|
+
height: 4px;
|
|
110
|
+
background: transparent;
|
|
111
|
+
pointer-events: none;
|
|
112
|
+
-webkit-appearance: none;
|
|
113
|
+
appearance: none;
|
|
114
|
+
}
|
|
115
|
+
.KRangeSlider .slider-input::-webkit-slider-thumb {
|
|
116
|
+
-webkit-appearance: none;
|
|
117
|
+
appearance: none;
|
|
118
|
+
width: 22px;
|
|
119
|
+
height: 22px;
|
|
120
|
+
background: linear-gradient(135deg, var(--primary-400), var(--primary-600));
|
|
121
|
+
border: 3px solid white;
|
|
122
|
+
border-radius: 50%;
|
|
123
|
+
cursor: pointer;
|
|
124
|
+
pointer-events: auto;
|
|
125
|
+
box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.1);
|
|
126
|
+
transition: all 0.2s ease;
|
|
127
|
+
}
|
|
128
|
+
.KRangeSlider .slider-input::-webkit-slider-thumb:hover {
|
|
129
|
+
transform: scale(1.2);
|
|
130
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 0 2px var(--primary-200);
|
|
131
|
+
}
|
|
132
|
+
.KRangeSlider .slider-input::-webkit-slider-thumb:active {
|
|
133
|
+
transform: scale(1.1);
|
|
134
|
+
}
|
|
135
|
+
.KRangeSlider .slider-input::-moz-range-thumb {
|
|
136
|
+
width: 22px;
|
|
137
|
+
height: 22px;
|
|
138
|
+
background: linear-gradient(135deg, var(--primary-400), var(--primary-600));
|
|
139
|
+
border: 3px solid white;
|
|
140
|
+
border-radius: 50%;
|
|
141
|
+
cursor: pointer;
|
|
142
|
+
pointer-events: auto;
|
|
143
|
+
box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.1);
|
|
144
|
+
transition: all 0.2s ease;
|
|
145
|
+
}
|
|
146
|
+
.KRangeSlider .slider-input::-moz-range-thumb:hover {
|
|
147
|
+
transform: scale(1.2);
|
|
148
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 0 2px var(--primary-200);
|
|
149
|
+
}
|
|
150
|
+
.KRangeSlider .slider-input::-moz-range-thumb:active {
|
|
151
|
+
transform: scale(1.1);
|
|
152
|
+
}
|
|
153
|
+
.KRangeSlider .slider-input:disabled {
|
|
154
|
+
cursor: not-allowed;
|
|
155
|
+
}
|
|
156
|
+
.KRangeSlider .slider-input:disabled::-webkit-slider-thumb {
|
|
157
|
+
cursor: not-allowed;
|
|
158
|
+
}
|
|
159
|
+
.KRangeSlider .slider-input:disabled::-moz-range-thumb {
|
|
160
|
+
cursor: not-allowed;
|
|
161
|
+
}
|
|
162
|
+
.KRangeSlider .slider-min {
|
|
163
|
+
z-index: 3;
|
|
164
|
+
}
|
|
165
|
+
.KRangeSlider .slider-max {
|
|
166
|
+
z-index: 4;
|
|
167
|
+
}
|
|
168
|
+
</style>
|
|
@@ -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;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
label?: string;
|
|
3
|
+
rangeMin: number;
|
|
4
|
+
rangeMax: number;
|
|
5
|
+
rangeStep: number;
|
|
6
|
+
isDisabled: boolean;
|
|
7
|
+
currentValue: number;
|
|
8
|
+
valuePercent: number;
|
|
9
|
+
};
|
|
10
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
11
|
+
"update:value": (value: number) => any;
|
|
12
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
13
|
+
"onUpdate:value"?: ((value: number) => any) | undefined;
|
|
14
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
15
|
+
declare const _default: typeof __VLS_export;
|
|
16
|
+
export default _default;
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
<template lang="pug">
|
|
2
|
+
.KSlider(:class="{ disabled: isDisabled }")
|
|
3
|
+
label.k-input-label(v-if="label") {{ label }}
|
|
4
|
+
.slider-container(@click="handleTrackClick")
|
|
5
|
+
.slider-track
|
|
6
|
+
.slider-fill(:style="{ width: valuePercent + '%' }")
|
|
7
|
+
input.slider-input(
|
|
8
|
+
type="range"
|
|
9
|
+
:min="rangeMin"
|
|
10
|
+
:max="rangeMax"
|
|
11
|
+
:step="rangeStep"
|
|
12
|
+
:value="currentValue"
|
|
13
|
+
:disabled="isDisabled"
|
|
14
|
+
@input="updateValue"
|
|
15
|
+
)
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script setup>
|
|
19
|
+
import { computed } from "vue";
|
|
20
|
+
const props = defineProps({
|
|
21
|
+
label: { type: String, required: false },
|
|
22
|
+
rangeMin: { type: Number, required: true },
|
|
23
|
+
rangeMax: { type: Number, required: true },
|
|
24
|
+
rangeStep: { type: Number, required: true },
|
|
25
|
+
isDisabled: { type: Boolean, required: true },
|
|
26
|
+
currentValue: { type: Number, required: true },
|
|
27
|
+
valuePercent: { type: Number, required: true }
|
|
28
|
+
});
|
|
29
|
+
const emit = defineEmits(["update:value"]);
|
|
30
|
+
const updateValue = (event) => {
|
|
31
|
+
const value = parseFloat(event.target.value);
|
|
32
|
+
emit("update:value", value);
|
|
33
|
+
};
|
|
34
|
+
const handleTrackClick = (event) => {
|
|
35
|
+
if (props.isDisabled) return;
|
|
36
|
+
const target = event.currentTarget;
|
|
37
|
+
const rect = target.getBoundingClientRect();
|
|
38
|
+
const clickX = event.clientX - rect.left;
|
|
39
|
+
const percentage = clickX / rect.width;
|
|
40
|
+
const rawValue = props.rangeMin + percentage * (props.rangeMax - props.rangeMin);
|
|
41
|
+
const steppedValue = Math.round(rawValue / props.rangeStep) * props.rangeStep;
|
|
42
|
+
const value = Math.max(props.rangeMin, Math.min(props.rangeMax, steppedValue));
|
|
43
|
+
emit("update:value", value);
|
|
44
|
+
};
|
|
45
|
+
</script>
|
|
46
|
+
|
|
47
|
+
<style scoped>
|
|
48
|
+
.KSlider {
|
|
49
|
+
position: relative;
|
|
50
|
+
padding: 20px 0;
|
|
51
|
+
}
|
|
52
|
+
.KSlider.disabled {
|
|
53
|
+
opacity: 0.5;
|
|
54
|
+
cursor: not-allowed;
|
|
55
|
+
}
|
|
56
|
+
.KSlider .slider-container {
|
|
57
|
+
position: relative;
|
|
58
|
+
height: 8px;
|
|
59
|
+
cursor: pointer;
|
|
60
|
+
}
|
|
61
|
+
.KSlider .slider-track {
|
|
62
|
+
position: absolute;
|
|
63
|
+
width: 100%;
|
|
64
|
+
height: 8px;
|
|
65
|
+
background: linear-gradient(to right, var(--neutral-200), var(--neutral-300));
|
|
66
|
+
border-radius: 4px;
|
|
67
|
+
box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
|
|
68
|
+
}
|
|
69
|
+
.KSlider .slider-fill {
|
|
70
|
+
position: absolute;
|
|
71
|
+
height: 8px;
|
|
72
|
+
background: linear-gradient(90deg, var(--primary-400), var(--primary-600));
|
|
73
|
+
border-radius: 4px;
|
|
74
|
+
z-index: 1;
|
|
75
|
+
box-shadow: 0 2px 8px rgba(var(--primary-500-rgb), 0.3);
|
|
76
|
+
}
|
|
77
|
+
.KSlider .slider-input {
|
|
78
|
+
position: absolute;
|
|
79
|
+
width: 100%;
|
|
80
|
+
height: 4px;
|
|
81
|
+
background: transparent;
|
|
82
|
+
pointer-events: none;
|
|
83
|
+
-webkit-appearance: none;
|
|
84
|
+
appearance: none;
|
|
85
|
+
}
|
|
86
|
+
.KSlider .slider-input::-webkit-slider-thumb {
|
|
87
|
+
-webkit-appearance: none;
|
|
88
|
+
appearance: none;
|
|
89
|
+
width: 22px;
|
|
90
|
+
height: 22px;
|
|
91
|
+
background: linear-gradient(135deg, var(--primary-400), var(--primary-600));
|
|
92
|
+
border: 3px solid white;
|
|
93
|
+
border-radius: 50%;
|
|
94
|
+
cursor: pointer;
|
|
95
|
+
pointer-events: auto;
|
|
96
|
+
box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.1);
|
|
97
|
+
transition: all 0.2s ease;
|
|
98
|
+
}
|
|
99
|
+
.KSlider .slider-input::-webkit-slider-thumb:hover {
|
|
100
|
+
transform: scale(1.2);
|
|
101
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 0 2px var(--primary-200);
|
|
102
|
+
}
|
|
103
|
+
.KSlider .slider-input::-webkit-slider-thumb:active {
|
|
104
|
+
transform: scale(1.1);
|
|
105
|
+
}
|
|
106
|
+
.KSlider .slider-input::-moz-range-thumb {
|
|
107
|
+
width: 22px;
|
|
108
|
+
height: 22px;
|
|
109
|
+
background: linear-gradient(135deg, var(--primary-400), var(--primary-600));
|
|
110
|
+
border: 3px solid white;
|
|
111
|
+
border-radius: 50%;
|
|
112
|
+
cursor: pointer;
|
|
113
|
+
pointer-events: auto;
|
|
114
|
+
box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.1);
|
|
115
|
+
transition: all 0.2s ease;
|
|
116
|
+
}
|
|
117
|
+
.KSlider .slider-input::-moz-range-thumb:hover {
|
|
118
|
+
transform: scale(1.2);
|
|
119
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 0 2px var(--primary-200);
|
|
120
|
+
}
|
|
121
|
+
.KSlider .slider-input::-moz-range-thumb:active {
|
|
122
|
+
transform: scale(1.1);
|
|
123
|
+
}
|
|
124
|
+
.KSlider .slider-input:disabled {
|
|
125
|
+
cursor: not-allowed;
|
|
126
|
+
}
|
|
127
|
+
.KSlider .slider-input:disabled::-webkit-slider-thumb {
|
|
128
|
+
cursor: not-allowed;
|
|
129
|
+
}
|
|
130
|
+
.KSlider .slider-input:disabled::-moz-range-thumb {
|
|
131
|
+
cursor: not-allowed;
|
|
132
|
+
}
|
|
133
|
+
</style>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
label?: string;
|
|
3
|
+
rangeMin: number;
|
|
4
|
+
rangeMax: number;
|
|
5
|
+
rangeStep: number;
|
|
6
|
+
isDisabled: boolean;
|
|
7
|
+
currentValue: number;
|
|
8
|
+
valuePercent: number;
|
|
9
|
+
};
|
|
10
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
11
|
+
"update:value": (value: number) => any;
|
|
12
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
13
|
+
"onUpdate:value"?: ((value: number) => any) | undefined;
|
|
14
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
15
|
+
declare const _default: typeof __VLS_export;
|
|
16
|
+
export default _default;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
placeholder: string;
|
|
3
|
+
rows: number;
|
|
4
|
+
label?: string;
|
|
5
|
+
};
|
|
6
|
+
type __VLS_ModelProps = {
|
|
7
|
+
'text'?: string;
|
|
8
|
+
};
|
|
9
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
10
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
|
+
"update:text": (value: string | undefined) => any;
|
|
12
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
13
|
+
"onUpdate:text"?: ((value: string | undefined) => any) | undefined;
|
|
14
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
15
|
+
declare const _default: typeof __VLS_export;
|
|
16
|
+
export default _default;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
<template lang="pug">
|
|
2
|
+
.KTextarea-wrapper
|
|
3
|
+
label.k-input-label(v-if="label") {{ label }}
|
|
4
|
+
textarea.KTextarea.modern-textarea(v-model="text" :placeholder="placeholder" :rows="rows")
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script setup>
|
|
8
|
+
const text = defineModel("text", { type: String });
|
|
9
|
+
defineProps({
|
|
10
|
+
placeholder: { type: String, required: true },
|
|
11
|
+
rows: { type: Number, required: true },
|
|
12
|
+
label: { type: String, required: false }
|
|
13
|
+
});
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<style scoped>
|
|
17
|
+
.KTextarea-wrapper {
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
width: 100%;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.KTextarea.modern-textarea {
|
|
24
|
+
border: 2px solid var(--border-color-medium);
|
|
25
|
+
border-radius: var(--border-radius-sm);
|
|
26
|
+
background: var(--input-bg);
|
|
27
|
+
padding: var(--gap-sm) var(--gap-md);
|
|
28
|
+
font-family: var(--font-family);
|
|
29
|
+
font-size: var(--font-size-md);
|
|
30
|
+
color: var(--font-color-primary);
|
|
31
|
+
resize: vertical;
|
|
32
|
+
outline: none;
|
|
33
|
+
width: 100%;
|
|
34
|
+
box-sizing: border-box;
|
|
35
|
+
transition: all var(--transition-bounce);
|
|
36
|
+
box-shadow: var(--shadow-sm);
|
|
37
|
+
line-height: 1.5;
|
|
38
|
+
}
|
|
39
|
+
.KTextarea.modern-textarea::placeholder {
|
|
40
|
+
color: var(--neutral-400);
|
|
41
|
+
}
|
|
42
|
+
.KTextarea.modern-textarea:hover {
|
|
43
|
+
border-color: var(--neutral-400);
|
|
44
|
+
}
|
|
45
|
+
.KTextarea.modern-textarea:focus {
|
|
46
|
+
border-color: var(--primary-500);
|
|
47
|
+
box-shadow: var(--input-focus-shadow), var(--shadow-sm);
|
|
48
|
+
}
|
|
49
|
+
.KTextarea.modern-textarea:disabled {
|
|
50
|
+
background-color: var(--neutral-100);
|
|
51
|
+
border-color: var(--neutral-200);
|
|
52
|
+
color: var(--neutral-400);
|
|
53
|
+
cursor: not-allowed;
|
|
54
|
+
}
|
|
55
|
+
</style>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
placeholder: string;
|
|
3
|
+
rows: number;
|
|
4
|
+
label?: string;
|
|
5
|
+
};
|
|
6
|
+
type __VLS_ModelProps = {
|
|
7
|
+
'text'?: string;
|
|
8
|
+
};
|
|
9
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
10
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
|
+
"update:text": (value: string | undefined) => any;
|
|
12
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
13
|
+
"onUpdate:text"?: ((value: string | undefined) => any) | undefined;
|
|
14
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
15
|
+
declare const _default: typeof __VLS_export;
|
|
16
|
+
export default _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
label?: string;
|
|
3
|
+
text: string;
|
|
4
|
+
showClear: boolean;
|
|
5
|
+
clear: () => void;
|
|
6
|
+
placeholder: string;
|
|
7
|
+
type: string;
|
|
8
|
+
validation?: 'success' | 'warning' | 'error' | null;
|
|
9
|
+
validationText?: string;
|
|
10
|
+
};
|
|
11
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
12
|
+
"update:text": (value: string) => any;
|
|
13
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
14
|
+
"onUpdate:text"?: ((value: string) => any) | undefined;
|
|
15
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
16
|
+
declare const _default: typeof __VLS_export;
|
|
17
|
+
export default _default;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
<template lang="pug">
|
|
2
|
+
.KTextbox-wrapper(:class="$attrs.class" :style="$attrs.style")
|
|
3
|
+
label.k-input-label(v-if="label") {{ label }}
|
|
4
|
+
.KTextbox.modern-textbox(:class="validation ? `is-${validation}` : ''")
|
|
5
|
+
input(v-bind="inputAttrs" :type="props.type" v-model="text" :placeholder="placeholder")
|
|
6
|
+
.clear-button(v-if="showClear" @click.stop="clear" @mousedown.stop)
|
|
7
|
+
KIcon(iconname="close" width="16" height="16")
|
|
8
|
+
span.validation-text(v-if="validation && ['success', 'warning', 'error'].includes(validation) && validationText" :class="`is-${validation}`") {{ validationText }}
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script setup>
|
|
12
|
+
import { computed, useAttrs } from "vue";
|
|
13
|
+
defineOptions({
|
|
14
|
+
inheritAttrs: false
|
|
15
|
+
});
|
|
16
|
+
const props = defineProps({
|
|
17
|
+
label: { type: String, required: false },
|
|
18
|
+
text: { type: String, required: true },
|
|
19
|
+
showClear: { type: Boolean, required: true },
|
|
20
|
+
clear: { type: Function, required: true },
|
|
21
|
+
placeholder: { type: String, required: true },
|
|
22
|
+
type: { type: String, required: true },
|
|
23
|
+
validation: { type: [String, null], required: false },
|
|
24
|
+
validationText: { type: String, required: false }
|
|
25
|
+
});
|
|
26
|
+
const emit = defineEmits(["update:text"]);
|
|
27
|
+
const text = computed({
|
|
28
|
+
get: () => props.text,
|
|
29
|
+
set: (value) => emit("update:text", value)
|
|
30
|
+
});
|
|
31
|
+
const attrs = useAttrs();
|
|
32
|
+
const inputAttrs = computed(() => {
|
|
33
|
+
const { class: _, style: __, ...rest } = attrs;
|
|
34
|
+
return rest;
|
|
35
|
+
});
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
<style scoped>
|
|
39
|
+
.KTextbox-wrapper {
|
|
40
|
+
display: flex;
|
|
41
|
+
flex-direction: column;
|
|
42
|
+
flex: 1;
|
|
43
|
+
min-width: 0;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.KTextbox.modern-textbox {
|
|
47
|
+
position: relative;
|
|
48
|
+
display: flex;
|
|
49
|
+
align-items: center;
|
|
50
|
+
border: var(--input-border);
|
|
51
|
+
border-radius: var(--border-radius-sm);
|
|
52
|
+
background: var(--input-bg);
|
|
53
|
+
height: var(--input-height);
|
|
54
|
+
box-sizing: border-box;
|
|
55
|
+
transition: all var(--transition-bounce);
|
|
56
|
+
box-shadow: var(--shadow-sm);
|
|
57
|
+
}
|
|
58
|
+
.KTextbox.modern-textbox:focus-within {
|
|
59
|
+
border-color: var(--input-focus-border-color);
|
|
60
|
+
box-shadow: var(--input-focus-shadow), var(--shadow-sm);
|
|
61
|
+
}
|
|
62
|
+
.KTextbox.modern-textbox:hover {
|
|
63
|
+
border-color: var(--input-hover-border-color);
|
|
64
|
+
}
|
|
65
|
+
.KTextbox.modern-textbox input {
|
|
66
|
+
flex: 1;
|
|
67
|
+
min-width: 0;
|
|
68
|
+
background: transparent;
|
|
69
|
+
border: none;
|
|
70
|
+
outline: none;
|
|
71
|
+
font-size: 15px;
|
|
72
|
+
color: var(--font-color-primary);
|
|
73
|
+
box-sizing: border-box;
|
|
74
|
+
padding: 0 var(--component-gap);
|
|
75
|
+
height: 100%;
|
|
76
|
+
width: 100%;
|
|
77
|
+
}
|
|
78
|
+
.KTextbox.modern-textbox input::placeholder {
|
|
79
|
+
color: var(--neutral-400);
|
|
80
|
+
}
|
|
81
|
+
.KTextbox.modern-textbox .clear-button {
|
|
82
|
+
position: absolute;
|
|
83
|
+
right: var(--component-gap);
|
|
84
|
+
top: 50%;
|
|
85
|
+
transform: translateY(-50%);
|
|
86
|
+
display: flex;
|
|
87
|
+
align-items: center;
|
|
88
|
+
justify-content: center;
|
|
89
|
+
width: 24px;
|
|
90
|
+
height: 24px;
|
|
91
|
+
color: var(--neutral-500);
|
|
92
|
+
cursor: pointer;
|
|
93
|
+
transition: all var(--transition-fast);
|
|
94
|
+
}
|
|
95
|
+
.KTextbox.modern-textbox .clear-button:hover {
|
|
96
|
+
color: var(--neutral-700);
|
|
97
|
+
}
|
|
98
|
+
.KTextbox.modern-textbox .clear-button:active {
|
|
99
|
+
transform: translateY(-50%) scale(0.95);
|
|
100
|
+
}
|
|
101
|
+
</style>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
label?: string;
|
|
3
|
+
text: string;
|
|
4
|
+
showClear: boolean;
|
|
5
|
+
clear: () => void;
|
|
6
|
+
placeholder: string;
|
|
7
|
+
type: string;
|
|
8
|
+
validation?: 'success' | 'warning' | 'error' | null;
|
|
9
|
+
validationText?: string;
|
|
10
|
+
};
|
|
11
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
12
|
+
"update:text": (value: string) => any;
|
|
13
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
14
|
+
"onUpdate:text"?: ((value: string) => any) | undefined;
|
|
15
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
16
|
+
declare const _default: typeof __VLS_export;
|
|
17
|
+
export default _default;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { defineNuxtPlugin } from "#app";
|
|
2
|
+
import { registerPresetComponents } from "#imports";
|
|
3
|
+
export default defineNuxtPlugin(() => {
|
|
4
|
+
const loaders = {
|
|
5
|
+
"./components/KBulkActions/KBulkActions.vue": () => import("./components/KBulkActions/KBulkActions.vue"),
|
|
6
|
+
"./components/KButton/KButton.vue": () => import("./components/KButton/KButton.vue"),
|
|
7
|
+
"./components/KCheckbox/KCheckbox.vue": () => import("./components/KCheckbox/KCheckbox.vue"),
|
|
8
|
+
"./components/KDatatable/KDatatable.vue": () => import("./components/KDatatable/KDatatable.vue"),
|
|
9
|
+
"./components/KMaskTextbox/KMaskTextbox.vue": () => import("./components/KMaskTextbox/KMaskTextbox.vue"),
|
|
10
|
+
"./components/KPagination/KPagination.vue": () => import("./components/KPagination/KPagination.vue"),
|
|
11
|
+
"./components/KRangeSlider/KRangeSlider.vue": () => import("./components/KRangeSlider/KRangeSlider.vue"),
|
|
12
|
+
"./components/KSlider/KSlider.vue": () => import("./components/KSlider/KSlider.vue"),
|
|
13
|
+
"./components/KTextarea/KTextarea.vue": () => import("./components/KTextarea/KTextarea.vue"),
|
|
14
|
+
"./components/KTextbox/KTextbox.vue": () => import("./components/KTextbox/KTextbox.vue")
|
|
15
|
+
};
|
|
16
|
+
if (typeof registerPresetComponents === "function") {
|
|
17
|
+
registerPresetComponents("modern", loaders);
|
|
18
|
+
} else {
|
|
19
|
+
console.warn("Katlux preset-modern: registerPresetComponents not found in imports. Ensure @katlux/toolkit is installed and loaded.");
|
|
20
|
+
}
|
|
21
|
+
});
|
package/dist/types.d.mts
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@katlux/preset-modern",
|
|
3
|
+
"version": "0.1.0-alpha.74",
|
|
4
|
+
"description": "Modern default design preset and styling variables for Katlux components",
|
|
5
|
+
"author": "Katlux",
|
|
6
|
+
"license": "Apache-2.0",
|
|
7
|
+
"publishConfig": {
|
|
8
|
+
"access": "public"
|
|
9
|
+
},
|
|
10
|
+
"main": "./dist/module.mjs",
|
|
11
|
+
"scripts": {
|
|
12
|
+
"build": "nuxt-module-build build",
|
|
13
|
+
"dev": "nuxt-module-build build --stub",
|
|
14
|
+
"prepublishOnly": "npm run build"
|
|
15
|
+
},
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"import": "./dist/module.mjs"
|
|
19
|
+
},
|
|
20
|
+
"./dist/runtime/assets/*": "./dist/runtime/assets/*"
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@katlux/toolkit": "*",
|
|
24
|
+
"@nuxt/kit": "^3.12.0"
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"dist"
|
|
28
|
+
]
|
|
29
|
+
}
|