@webitel/ui-sdk 24.12.23 → 24.12.24
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/CHANGELOG.md +10 -0
- package/dist/ui-sdk.css +1 -1
- package/dist/ui-sdk.js +460 -435
- package/dist/ui-sdk.umd.cjs +9 -9
- package/package.json +1 -1
- package/src/components/wt-datepicker/wt-datepicker.vue +25 -3
- package/src/components/wt-timepicker/wt-timepicker.vue +18 -1
package/package.json
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
name="label"
|
|
15
15
|
v-bind="{ label }"
|
|
16
16
|
>
|
|
17
|
-
{{
|
|
17
|
+
{{ requiredLabel }}
|
|
18
18
|
</slot>
|
|
19
19
|
</wt-label>
|
|
20
20
|
<vue-datepicker
|
|
@@ -80,9 +80,14 @@
|
|
|
80
80
|
<script setup>
|
|
81
81
|
import VueDatepicker from '@vuepic/vue-datepicker';
|
|
82
82
|
import '@vuepic/vue-datepicker/dist/main.css';
|
|
83
|
-
import { ref } from 'vue';
|
|
83
|
+
import { computed, ref } from 'vue';
|
|
84
84
|
|
|
85
85
|
const props = defineProps({
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* [`'date'`, `'datetime'`]
|
|
89
|
+
* */
|
|
90
|
+
|
|
86
91
|
mode: {
|
|
87
92
|
type: String,
|
|
88
93
|
default: 'date',
|
|
@@ -114,9 +119,22 @@ const props = defineProps({
|
|
|
114
119
|
type: String,
|
|
115
120
|
default: 'en',
|
|
116
121
|
},
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Object with props, passed down to wt-label as props
|
|
125
|
+
*/
|
|
126
|
+
|
|
117
127
|
labelProps: {
|
|
118
128
|
type: Object,
|
|
119
|
-
|
|
129
|
+
},
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Native input required attribute
|
|
133
|
+
*/
|
|
134
|
+
|
|
135
|
+
required: {
|
|
136
|
+
type: Boolean,
|
|
137
|
+
default: false,
|
|
120
138
|
},
|
|
121
139
|
});
|
|
122
140
|
const emit = defineEmits(['input']);
|
|
@@ -125,6 +143,10 @@ const isOpened = ref(false);
|
|
|
125
143
|
const datepicker = ref(null); // template ref
|
|
126
144
|
|
|
127
145
|
const isDateTime = props.mode === 'datetime';
|
|
146
|
+
|
|
147
|
+
const requiredLabel = computed(() => {
|
|
148
|
+
return props.required ? `${props.label}*` : props.label;
|
|
149
|
+
});
|
|
128
150
|
</script>
|
|
129
151
|
|
|
130
152
|
<style lang="scss">
|
|
@@ -8,7 +8,13 @@
|
|
|
8
8
|
:invalid="invalid"
|
|
9
9
|
v-bind="labelProps"
|
|
10
10
|
>
|
|
11
|
-
|
|
11
|
+
<!-- @slot Custom input label -->
|
|
12
|
+
<slot
|
|
13
|
+
name="label"
|
|
14
|
+
v-bind="{ label }"
|
|
15
|
+
>
|
|
16
|
+
{{ requiredLabel }}
|
|
17
|
+
</slot>
|
|
12
18
|
</wt-label>
|
|
13
19
|
<div class="wt-timepicker__wrapper">
|
|
14
20
|
<wt-time-input
|
|
@@ -65,6 +71,9 @@ export default {
|
|
|
65
71
|
event: 'input',
|
|
66
72
|
},
|
|
67
73
|
props: {
|
|
74
|
+
/**
|
|
75
|
+
* Time value in seconds (not milliseconds!)
|
|
76
|
+
*/
|
|
68
77
|
value: {
|
|
69
78
|
type: [String, Number],
|
|
70
79
|
default: 0,
|
|
@@ -93,6 +102,11 @@ export default {
|
|
|
93
102
|
type: Boolean,
|
|
94
103
|
default: false,
|
|
95
104
|
},
|
|
105
|
+
required: {
|
|
106
|
+
type: Boolean,
|
|
107
|
+
default: false,
|
|
108
|
+
description: 'Native input required attribute',
|
|
109
|
+
},
|
|
96
110
|
},
|
|
97
111
|
|
|
98
112
|
computed: {
|
|
@@ -154,6 +168,9 @@ export default {
|
|
|
154
168
|
this.$emit('input', newValue);
|
|
155
169
|
},
|
|
156
170
|
},
|
|
171
|
+
requiredLabel() {
|
|
172
|
+
return this.required ? `${this.label} (${this.format})*` : `${this.label} (${this.format})`;
|
|
173
|
+
},
|
|
157
174
|
},
|
|
158
175
|
|
|
159
176
|
methods: {},
|