sprintify-ui 0.0.56 → 0.0.57
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/dist/sprintify-ui.es.js +2542 -2558
- package/package.json +1 -1
- package/src/components/BaseSelect.vue +0 -40
package/package.json
CHANGED
|
@@ -64,7 +64,6 @@ const props = defineProps({
|
|
|
64
64
|
},
|
|
65
65
|
});
|
|
66
66
|
|
|
67
|
-
const mounted = useMounted();
|
|
68
67
|
const select = ref(null) as Ref<HTMLSelectElement | null>;
|
|
69
68
|
|
|
70
69
|
const emit = defineEmits(['update:modelValue']);
|
|
@@ -121,45 +120,6 @@ function validModelValue(): boolean {
|
|
|
121
120
|
return options.findIndex((o) => isEqual(o.value, props.modelValue)) != -1;
|
|
122
121
|
}
|
|
123
122
|
|
|
124
|
-
/**
|
|
125
|
-
* This watcher is used to update the parent value
|
|
126
|
-
* if the given modelValue should be empty.
|
|
127
|
-
*/
|
|
128
|
-
watch(
|
|
129
|
-
() => props.modelValue,
|
|
130
|
-
() => {
|
|
131
|
-
// Let the select re-render before validating
|
|
132
|
-
// The validation depends on the select options,
|
|
133
|
-
// which needs to be rendered first
|
|
134
|
-
nextTick(() => {
|
|
135
|
-
validateAndFixModelVale();
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
|
-
);
|
|
139
|
-
|
|
140
|
-
/**
|
|
141
|
-
* Re-trigger the same validation on mounted
|
|
142
|
-
*/
|
|
143
|
-
onMounted(() => {
|
|
144
|
-
validateAndFixModelVale();
|
|
145
|
-
});
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* Validate the current Model Value. Transform to external empty if :
|
|
149
|
-
* 1. is internal empty
|
|
150
|
-
* 2. is in the current options
|
|
151
|
-
*/
|
|
152
|
-
function validateAndFixModelVale() {
|
|
153
|
-
if (!mounted.value) {
|
|
154
|
-
return;
|
|
155
|
-
}
|
|
156
|
-
if (isEmptyInternal(props.modelValue)) {
|
|
157
|
-
emitUpdate(EMPTY_VALUE_EXTERNAL);
|
|
158
|
-
} else if (!validModelValue()) {
|
|
159
|
-
emitUpdate(EMPTY_VALUE_EXTERNAL);
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
|
|
163
123
|
/**
|
|
164
124
|
*
|
|
165
125
|
* Emit change while mutating internal empty value ''
|