ketekny-ui-kit 1.0.41 → 1.0.43
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/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<div>
|
|
3
3
|
<label v-if="label" class="block mb-1 text-sm font-medium text-slate-700 dark:text-slate-300">{{ label }}</label>
|
|
4
4
|
<el-date-picker
|
|
5
|
-
:id="
|
|
5
|
+
:id="computedId"
|
|
6
6
|
:model-value="normalizedModelValue"
|
|
7
7
|
:type="pickerType"
|
|
8
8
|
:placeholder="placeholder"
|
|
@@ -34,7 +34,7 @@ import { ElDatePicker } from 'element-plus'
|
|
|
34
34
|
const props = defineProps({
|
|
35
35
|
modelValue: { type: [String, Date, Array], default: null },
|
|
36
36
|
id: {
|
|
37
|
-
type: String,
|
|
37
|
+
type: [String, Array],
|
|
38
38
|
default: () => `datepicker-${Math.random().toString(36).slice(2, 11)}`,
|
|
39
39
|
},
|
|
40
40
|
label: { type: String, default: '' },
|
|
@@ -66,6 +66,11 @@ const props = defineProps({
|
|
|
66
66
|
defineEmits(['update:modelValue', 'change'])
|
|
67
67
|
|
|
68
68
|
const pickerType = computed(() => props.type === 'yearMonth' ? 'month' : props.type)
|
|
69
|
+
const isRange = computed(() => ['daterange', 'datetimerange', 'monthrange'].includes(pickerType.value))
|
|
70
|
+
const computedId = computed(() => {
|
|
71
|
+
if (Array.isArray(props.id)) return props.id
|
|
72
|
+
return isRange.value ? [`${props.id}-start`, `${props.id}-end`] : props.id
|
|
73
|
+
})
|
|
69
74
|
const hasError = computed(() => props.error != null && props.error !== false)
|
|
70
75
|
|
|
71
76
|
const defaultFormatByType = {
|