bge-ui 1.4.2 → 1.4.3
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/index.js +82 -82
- package/package.json +1 -1
- package/src/checkbox/index.vue +3 -3
package/dist/index.js
CHANGED
|
@@ -4666,7 +4666,7 @@ function toValue(r) {
|
|
|
4666
4666
|
const isClient = typeof window !== "undefined" && typeof document !== "undefined";
|
|
4667
4667
|
typeof WorkerGlobalScope !== "undefined" && globalThis instanceof WorkerGlobalScope;
|
|
4668
4668
|
const toString = Object.prototype.toString;
|
|
4669
|
-
const isObject = (
|
|
4669
|
+
const isObject = (val) => toString.call(val) === "[object Object]";
|
|
4670
4670
|
const noop$1 = () => {
|
|
4671
4671
|
};
|
|
4672
4672
|
const isIOS$1 = /* @__PURE__ */ getIsIOS();
|
|
@@ -5366,7 +5366,7 @@ var range = function range2(rule, value, source, errors2, options) {
|
|
|
5366
5366
|
var min2 = typeof rule.min === "number";
|
|
5367
5367
|
var max2 = typeof rule.max === "number";
|
|
5368
5368
|
var spRegexp = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
|
|
5369
|
-
var
|
|
5369
|
+
var val = value;
|
|
5370
5370
|
var key = null;
|
|
5371
5371
|
var num = typeof value === "number";
|
|
5372
5372
|
var str = typeof value === "string";
|
|
@@ -5382,20 +5382,20 @@ var range = function range2(rule, value, source, errors2, options) {
|
|
|
5382
5382
|
return false;
|
|
5383
5383
|
}
|
|
5384
5384
|
if (arr) {
|
|
5385
|
-
|
|
5385
|
+
val = value.length;
|
|
5386
5386
|
}
|
|
5387
5387
|
if (str) {
|
|
5388
|
-
|
|
5388
|
+
val = value.replace(spRegexp, "_").length;
|
|
5389
5389
|
}
|
|
5390
5390
|
if (len) {
|
|
5391
|
-
if (
|
|
5391
|
+
if (val !== rule.len) {
|
|
5392
5392
|
errors2.push(format$1(options.messages[key].len, rule.fullField, rule.len));
|
|
5393
5393
|
}
|
|
5394
|
-
} else if (min2 && !max2 &&
|
|
5394
|
+
} else if (min2 && !max2 && val < rule.min) {
|
|
5395
5395
|
errors2.push(format$1(options.messages[key].min, rule.fullField, rule.min));
|
|
5396
|
-
} else if (max2 && !min2 &&
|
|
5396
|
+
} else if (max2 && !min2 && val > rule.max) {
|
|
5397
5397
|
errors2.push(format$1(options.messages[key].max, rule.fullField, rule.max));
|
|
5398
|
-
} else if (min2 && max2 && (
|
|
5398
|
+
} else if (min2 && max2 && (val < rule.min || val > rule.max)) {
|
|
5399
5399
|
errors2.push(format$1(options.messages[key].range, rule.fullField, rule.min, rule.max));
|
|
5400
5400
|
}
|
|
5401
5401
|
};
|
|
@@ -6219,8 +6219,8 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
6219
6219
|
emit("blur");
|
|
6220
6220
|
emit("update:modelValue", input.value);
|
|
6221
6221
|
}
|
|
6222
|
-
watch(() => props.modelValue, (
|
|
6223
|
-
input.value =
|
|
6222
|
+
watch(() => props.modelValue, (val) => {
|
|
6223
|
+
input.value = val;
|
|
6224
6224
|
formItemContext && formItemContext.validate && formItemContext.validate().catch((err) => err);
|
|
6225
6225
|
});
|
|
6226
6226
|
function handleChange() {
|
|
@@ -8895,16 +8895,16 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
8895
8895
|
const props = __props;
|
|
8896
8896
|
const formItemContext = inject(formItemContextKey$3, void 0);
|
|
8897
8897
|
const input = ref(false);
|
|
8898
|
-
watch(() => props.modelValue, (
|
|
8899
|
-
if (typeof
|
|
8898
|
+
watch(() => props.modelValue, (val) => {
|
|
8899
|
+
if (typeof val === "number" || typeof val === "string" || typeof val === "boolean") {
|
|
8900
8900
|
input.value = true;
|
|
8901
|
-
if (
|
|
8901
|
+
if (val === props.trueValue) {
|
|
8902
8902
|
input.value = true;
|
|
8903
8903
|
} else {
|
|
8904
8904
|
input.value = false;
|
|
8905
8905
|
}
|
|
8906
8906
|
} else {
|
|
8907
|
-
if (
|
|
8907
|
+
if (val.includes(props.trueValue)) {
|
|
8908
8908
|
input.value = true;
|
|
8909
8909
|
} else {
|
|
8910
8910
|
input.value = false;
|
|
@@ -8913,15 +8913,15 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
8913
8913
|
formItemContext && formItemContext.validate && formItemContext.validate().catch((err) => err);
|
|
8914
8914
|
});
|
|
8915
8915
|
onMounted(() => {
|
|
8916
|
-
if (typeof
|
|
8916
|
+
if (typeof props.modelValue === "number" || typeof props.modelValue === "string" || typeof props.modelValue === "boolean") {
|
|
8917
8917
|
input.value = true;
|
|
8918
|
-
if (
|
|
8918
|
+
if (props.modelValue === props.trueValue) {
|
|
8919
8919
|
input.value = true;
|
|
8920
8920
|
} else {
|
|
8921
8921
|
input.value = false;
|
|
8922
8922
|
}
|
|
8923
8923
|
} else {
|
|
8924
|
-
if (
|
|
8924
|
+
if (props.modelValue.includes(props.trueValue)) {
|
|
8925
8925
|
input.value = true;
|
|
8926
8926
|
} else {
|
|
8927
8927
|
input.value = false;
|
|
@@ -9065,8 +9065,8 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
9065
9065
|
const props = __props;
|
|
9066
9066
|
const formItemContext = inject(formItemContextKey$2, void 0);
|
|
9067
9067
|
const input = ref(false);
|
|
9068
|
-
watch(() => props.modelValue, (
|
|
9069
|
-
if (
|
|
9068
|
+
watch(() => props.modelValue, (val) => {
|
|
9069
|
+
if (val === props.trueValue) {
|
|
9070
9070
|
input.value = true;
|
|
9071
9071
|
} else {
|
|
9072
9072
|
input.value = false;
|
|
@@ -10715,8 +10715,8 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
10715
10715
|
tooltip.value && tooltip.value.popper.value && tooltip.value.popper.value.update();
|
|
10716
10716
|
}, 50);
|
|
10717
10717
|
}
|
|
10718
|
-
watch(() => props.modelValue, (
|
|
10719
|
-
let percent =
|
|
10718
|
+
watch(() => props.modelValue, (val) => {
|
|
10719
|
+
let percent = val;
|
|
10720
10720
|
percent = percent > 100 ? 100 : percent;
|
|
10721
10721
|
percent = percent < 0 ? 0 : percent;
|
|
10722
10722
|
setPosition(percent);
|
|
@@ -10916,8 +10916,8 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
10916
10916
|
});
|
|
10917
10917
|
const _export_sfc = (sfc, props) => {
|
|
10918
10918
|
const target = sfc.__vccOpts || sfc;
|
|
10919
|
-
for (const [key,
|
|
10920
|
-
target[key] =
|
|
10919
|
+
for (const [key, val] of props) {
|
|
10920
|
+
target[key] = val;
|
|
10921
10921
|
}
|
|
10922
10922
|
return target;
|
|
10923
10923
|
};
|
|
@@ -14729,8 +14729,8 @@ const errors = {
|
|
|
14729
14729
|
prop: (name) => `"${name}" prop must be enabled!`,
|
|
14730
14730
|
dateArr: (name) => `You need to use array as "model-value" binding in order to support "${name}"`
|
|
14731
14731
|
};
|
|
14732
|
-
const convertType = (
|
|
14733
|
-
return
|
|
14732
|
+
const convertType = (val) => {
|
|
14733
|
+
return val;
|
|
14734
14734
|
};
|
|
14735
14735
|
const getNumVal = (num) => {
|
|
14736
14736
|
if (num === 0)
|
|
@@ -15562,8 +15562,8 @@ const getDefaultUI = (ui) => {
|
|
|
15562
15562
|
Object.keys(ui).map((item) => {
|
|
15563
15563
|
const key = item;
|
|
15564
15564
|
const value = ui[key];
|
|
15565
|
-
const
|
|
15566
|
-
return [item,
|
|
15565
|
+
const val = typeof ui[key] === "string" ? { [value]: true } : Object.fromEntries(value.map((k) => [k, true]));
|
|
15566
|
+
return [item, val];
|
|
15567
15567
|
})
|
|
15568
15568
|
)
|
|
15569
15569
|
};
|
|
@@ -15719,7 +15719,7 @@ const useExternalInternalMapper = (emit, props, isInputFocused) => {
|
|
|
15719
15719
|
const mapYearExternalToInternal = (value) => {
|
|
15720
15720
|
if (Array.isArray(value)) {
|
|
15721
15721
|
if (defaultedMultiDates.value.enabled) {
|
|
15722
|
-
return value.map((
|
|
15722
|
+
return value.map((val) => convertCustomModeType(val, setYear(getDate(), val)));
|
|
15723
15723
|
}
|
|
15724
15724
|
return checkRangeEnabled(
|
|
15725
15725
|
() => [
|
|
@@ -15756,7 +15756,7 @@ const useExternalInternalMapper = (emit, props, isInputFocused) => {
|
|
|
15756
15756
|
const today = set(getDate(), { date: 1 });
|
|
15757
15757
|
if (Array.isArray(value)) {
|
|
15758
15758
|
if (defaultedMultiDates.value.enabled) {
|
|
15759
|
-
return value.map((
|
|
15759
|
+
return value.map((val) => convertCustomModeType(val, setDateMonthOrYear(today, +val.month, +val.year)));
|
|
15760
15760
|
}
|
|
15761
15761
|
return checkRangeEnabled(
|
|
15762
15762
|
() => [
|
|
@@ -15903,22 +15903,22 @@ const useExternalInternalMapper = (emit, props, isInputFocused) => {
|
|
|
15903
15903
|
}
|
|
15904
15904
|
return convertModelToTz(new Date(value));
|
|
15905
15905
|
};
|
|
15906
|
-
const toModelType = (
|
|
15907
|
-
if (!
|
|
15906
|
+
const toModelType = (val) => {
|
|
15907
|
+
if (!val)
|
|
15908
15908
|
return "";
|
|
15909
15909
|
if (props.utc) {
|
|
15910
|
-
return dateToUtc(
|
|
15910
|
+
return dateToUtc(val, props.utc === "preserve", props.enableSeconds);
|
|
15911
15911
|
}
|
|
15912
15912
|
if (props.modelType) {
|
|
15913
15913
|
if (props.modelType === "timestamp")
|
|
15914
|
-
return +convertZonedModelToLocal(
|
|
15914
|
+
return +convertZonedModelToLocal(val);
|
|
15915
15915
|
if (props.modelType === "iso")
|
|
15916
|
-
return convertZonedModelToLocal(
|
|
15916
|
+
return convertZonedModelToLocal(val).toISOString();
|
|
15917
15917
|
if (props.modelType === "format" && (typeof props.format === "string" || !props.format))
|
|
15918
|
-
return formatDateFn(convertZonedModelToLocal(
|
|
15919
|
-
return formatDateFn(convertZonedModelToLocal(
|
|
15918
|
+
return formatDateFn(convertZonedModelToLocal(val));
|
|
15919
|
+
return formatDateFn(convertZonedModelToLocal(val), props.modelType, true);
|
|
15920
15920
|
}
|
|
15921
|
-
return convertZonedModelToLocal(
|
|
15921
|
+
return convertZonedModelToLocal(val);
|
|
15922
15922
|
};
|
|
15923
15923
|
const emitValue = (value, useTz = false, returnOnly = false) => {
|
|
15924
15924
|
if (returnOnly)
|
|
@@ -16770,9 +16770,9 @@ const useValidation = (props) => {
|
|
|
16770
16770
|
}
|
|
16771
16771
|
return true;
|
|
16772
16772
|
};
|
|
16773
|
-
const isValidYear = (
|
|
16774
|
-
if (
|
|
16775
|
-
const activeYear = getYear(
|
|
16773
|
+
const isValidYear = (val) => {
|
|
16774
|
+
if (val) {
|
|
16775
|
+
const activeYear = getYear(val);
|
|
16776
16776
|
return activeYear >= +props.yearRange[0] && activeYear <= props.yearRange[1];
|
|
16777
16777
|
}
|
|
16778
16778
|
return true;
|
|
@@ -17236,7 +17236,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
17236
17236
|
handleRangeTextInput(value);
|
|
17237
17237
|
} else if (defaultedMultiDates.value.enabled) {
|
|
17238
17238
|
const dates = value.split(`;`);
|
|
17239
|
-
parsedDate.value = dates.map((
|
|
17239
|
+
parsedDate.value = dates.map((val) => parser(val.trim())).filter((val) => val);
|
|
17240
17240
|
} else {
|
|
17241
17241
|
parsedDate.value = parser(value);
|
|
17242
17242
|
}
|
|
@@ -17764,9 +17764,9 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
17764
17764
|
}
|
|
17765
17765
|
});
|
|
17766
17766
|
};
|
|
17767
|
-
const onClick = (
|
|
17768
|
-
if (!
|
|
17769
|
-
emit("selected",
|
|
17767
|
+
const onClick = (val) => {
|
|
17768
|
+
if (!val.disabled) {
|
|
17769
|
+
emit("selected", val.value);
|
|
17770
17770
|
}
|
|
17771
17771
|
};
|
|
17772
17772
|
const toggle = () => {
|
|
@@ -17803,9 +17803,9 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
17803
17803
|
return;
|
|
17804
17804
|
checkStopPropagation(ev, defaultedConfig.value, true);
|
|
17805
17805
|
};
|
|
17806
|
-
const setHoverValue = (
|
|
17807
|
-
hoverValue.value =
|
|
17808
|
-
emit("hover-value",
|
|
17806
|
+
const setHoverValue = (val) => {
|
|
17807
|
+
hoverValue.value = val;
|
|
17808
|
+
emit("hover-value", val);
|
|
17809
17809
|
};
|
|
17810
17810
|
const onTab = () => {
|
|
17811
17811
|
toggle();
|
|
@@ -18388,7 +18388,7 @@ const useMonthPicker = (props, emit) => {
|
|
|
18388
18388
|
const getModelMonthYear = () => {
|
|
18389
18389
|
if (modelValue.value) {
|
|
18390
18390
|
if (Array.isArray(modelValue.value)) {
|
|
18391
|
-
return modelValue.value.map((
|
|
18391
|
+
return modelValue.value.map((val) => getMonthYear(val));
|
|
18392
18392
|
}
|
|
18393
18393
|
return getMonthYear(modelValue.value);
|
|
18394
18394
|
}
|
|
@@ -18875,17 +18875,17 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
18875
18875
|
() => (type4) => isValueDisabled(type4, props[type4]) || isOverlayValueDisabled(type4, props[type4])
|
|
18876
18876
|
);
|
|
18877
18877
|
const timeValues = computed(() => ({ hours: props.hours, minutes: props.minutes, seconds: props.seconds }));
|
|
18878
|
-
const isOverlayValueDisabled = (type4,
|
|
18878
|
+
const isOverlayValueDisabled = (type4, val) => {
|
|
18879
18879
|
if (defaultedRange.value.enabled && !defaultedRange.value.disableTimeRangeValidation) {
|
|
18880
|
-
return !props.validateTime(type4,
|
|
18880
|
+
return !props.validateTime(type4, val);
|
|
18881
18881
|
}
|
|
18882
18882
|
return false;
|
|
18883
18883
|
};
|
|
18884
18884
|
const disabledRangedArrows = (type4, inc) => {
|
|
18885
18885
|
if (defaultedRange.value.enabled && !defaultedRange.value.disableTimeRangeValidation) {
|
|
18886
18886
|
const inVal = inc ? +props[`${type4}Increment`] : -+props[`${type4}Increment`];
|
|
18887
|
-
const
|
|
18888
|
-
return !props.validateTime(type4,
|
|
18887
|
+
const val = props[type4] + inVal;
|
|
18888
|
+
return !props.validateTime(type4, val);
|
|
18889
18889
|
}
|
|
18890
18890
|
return false;
|
|
18891
18891
|
};
|
|
@@ -18939,10 +18939,10 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
18939
18939
|
return true;
|
|
18940
18940
|
return Boolean((_a = disabledTimes[type4]) == null ? void 0 : _a.includes(value));
|
|
18941
18941
|
};
|
|
18942
|
-
const getAmPmDiff = (
|
|
18942
|
+
const getAmPmDiff = (val, type4) => {
|
|
18943
18943
|
if (type4 !== "hours")
|
|
18944
|
-
return
|
|
18945
|
-
return amPm.value === "AM" ?
|
|
18944
|
+
return val;
|
|
18945
|
+
return amPm.value === "AM" ? val : val + 12;
|
|
18946
18946
|
};
|
|
18947
18947
|
const getGridItems = (type4) => {
|
|
18948
18948
|
const timeRange = props.is24 ? 24 : 12;
|
|
@@ -18962,16 +18962,16 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
18962
18962
|
return { active, disabled };
|
|
18963
18963
|
});
|
|
18964
18964
|
};
|
|
18965
|
-
const sanitizeMinutesAndSeconds = (
|
|
18966
|
-
const sanitizeHours = (
|
|
18967
|
-
const isDateInRange = (
|
|
18965
|
+
const sanitizeMinutesAndSeconds = (val) => val >= 0 ? val : 59;
|
|
18966
|
+
const sanitizeHours = (val) => val >= 0 ? val : 23;
|
|
18967
|
+
const isDateInRange = (val, type4) => {
|
|
18968
18968
|
const minTime = props.minTime ? setTime(sanitizeTime(props.minTime)) : null;
|
|
18969
18969
|
const maxTime = props.maxTime ? setTime(sanitizeTime(props.maxTime)) : null;
|
|
18970
18970
|
const selectedDate = setTime(
|
|
18971
18971
|
sanitizeTime(
|
|
18972
18972
|
timeValues.value,
|
|
18973
18973
|
type4,
|
|
18974
|
-
type4 === "minutes" || type4 === "seconds" ? sanitizeMinutesAndSeconds(
|
|
18974
|
+
type4 === "minutes" || type4 === "seconds" ? sanitizeMinutesAndSeconds(val) : sanitizeHours(val)
|
|
18975
18975
|
)
|
|
18976
18976
|
);
|
|
18977
18977
|
if (minTime && maxTime)
|
|
@@ -19917,13 +19917,13 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
19917
19917
|
return { active, disabled, highlighted };
|
|
19918
19918
|
});
|
|
19919
19919
|
});
|
|
19920
|
-
const toggleWrap = (
|
|
19920
|
+
const toggleWrap = (val, type4, show) => {
|
|
19921
19921
|
if (show !== void 0) {
|
|
19922
|
-
|
|
19922
|
+
val.value = show;
|
|
19923
19923
|
} else {
|
|
19924
|
-
|
|
19924
|
+
val.value = !val.value;
|
|
19925
19925
|
}
|
|
19926
|
-
if (!
|
|
19926
|
+
if (!val.value) {
|
|
19927
19927
|
overlayOpen.value = false;
|
|
19928
19928
|
emit("overlay-closed", type4);
|
|
19929
19929
|
} else {
|
|
@@ -19958,7 +19958,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
19958
19958
|
index: 1,
|
|
19959
19959
|
toggle: toggleMonthPicker,
|
|
19960
19960
|
modelValue: monthModelBind.value,
|
|
19961
|
-
updateModelValue: (
|
|
19961
|
+
updateModelValue: (val) => monthModelBind.value = val,
|
|
19962
19962
|
text: getMonthDisplayVal.value.text,
|
|
19963
19963
|
showSelectionGrid: showMonthPicker.value,
|
|
19964
19964
|
items: groupedMonths.value,
|
|
@@ -19970,7 +19970,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
19970
19970
|
index: 2,
|
|
19971
19971
|
toggle: toggleYearPicker,
|
|
19972
19972
|
modelValue: yearModelBind.value,
|
|
19973
|
-
updateModelValue: (
|
|
19973
|
+
updateModelValue: (val) => yearModelBind.value = val,
|
|
19974
19974
|
text: formatNumber(props.year, props.locale),
|
|
19975
19975
|
showSelectionGrid: showYearPicker.value,
|
|
19976
19976
|
items: groupedYears.value,
|
|
@@ -20978,16 +20978,16 @@ const useDatePicker = (props, emit, triggerCalendarTransition, updateFlow) => {
|
|
|
20978
20978
|
postRangeSelect();
|
|
20979
20979
|
}
|
|
20980
20980
|
};
|
|
20981
|
-
const updateMonthYear = (instance,
|
|
20981
|
+
const updateMonthYear = (instance, val) => {
|
|
20982
20982
|
var _a;
|
|
20983
|
-
setCalendarMonthYear(instance,
|
|
20983
|
+
setCalendarMonthYear(instance, val.month, val.year, true);
|
|
20984
20984
|
if (defaultedMultiCalendars.value.count && !defaultedMultiCalendars.value.solo) {
|
|
20985
20985
|
autoChangeMultiCalendars(instance);
|
|
20986
20986
|
}
|
|
20987
|
-
emit("update-month-year", { instance, month:
|
|
20987
|
+
emit("update-month-year", { instance, month: val.month, year: val.year });
|
|
20988
20988
|
triggerCalendarTransition(defaultedMultiCalendars.value.solo ? instance : void 0);
|
|
20989
20989
|
const flowActive = ((_a = props.flow) == null ? void 0 : _a.length) ? props.flow[props.flowStep] : void 0;
|
|
20990
|
-
if (!
|
|
20990
|
+
if (!val.fromNav && (flowActive === FlowStep.month || flowActive === FlowStep.year)) {
|
|
20991
20991
|
updateFlow();
|
|
20992
20992
|
}
|
|
20993
20993
|
};
|
|
@@ -21382,7 +21382,7 @@ const useQuarterPicker = (props, emit) => {
|
|
|
21382
21382
|
const isQuarterActive = computed(() => (date4) => {
|
|
21383
21383
|
if (modelValue.value) {
|
|
21384
21384
|
if (Array.isArray(modelValue.value)) {
|
|
21385
|
-
return modelValue.value.some((
|
|
21385
|
+
return modelValue.value.some((val) => isSameQuarter(date4, val));
|
|
21386
21386
|
}
|
|
21387
21387
|
return isSameQuarter(modelValue.value, date4);
|
|
21388
21388
|
}
|
|
@@ -22585,17 +22585,17 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
22585
22585
|
const emit = __emit;
|
|
22586
22586
|
const inputValue = ref();
|
|
22587
22587
|
const formItemContext = inject(formItemContextKey, void 0);
|
|
22588
|
-
function inputValueCallback(
|
|
22589
|
-
inputValue.value =
|
|
22588
|
+
function inputValueCallback(val) {
|
|
22589
|
+
inputValue.value = val.split(" - ");
|
|
22590
22590
|
}
|
|
22591
|
-
watch(() => props.modelValue, (
|
|
22592
|
-
date4.value =
|
|
22591
|
+
watch(() => props.modelValue, (val) => {
|
|
22592
|
+
date4.value = val;
|
|
22593
22593
|
formItemContext && formItemContext.validate && formItemContext.validate().catch((err) => err);
|
|
22594
22594
|
});
|
|
22595
|
-
watch(date4, (
|
|
22596
|
-
emit("input",
|
|
22597
|
-
emit("change",
|
|
22598
|
-
emit("update:modelValue",
|
|
22595
|
+
watch(date4, (val) => {
|
|
22596
|
+
emit("input", val);
|
|
22597
|
+
emit("change", val);
|
|
22598
|
+
emit("update:modelValue", val);
|
|
22599
22599
|
});
|
|
22600
22600
|
onMounted(() => {
|
|
22601
22601
|
if (props.modelValue) {
|
|
@@ -22694,13 +22694,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
22694
22694
|
const isChecked = ref(false);
|
|
22695
22695
|
const emit = __emit;
|
|
22696
22696
|
const props = __props;
|
|
22697
|
-
watch(() => props.modelValue, (
|
|
22698
|
-
isChecked.value =
|
|
22697
|
+
watch(() => props.modelValue, (val) => {
|
|
22698
|
+
isChecked.value = val === props.trueValue;
|
|
22699
22699
|
}, {
|
|
22700
22700
|
immediate: true
|
|
22701
22701
|
});
|
|
22702
|
-
watch(isChecked, (
|
|
22703
|
-
if (
|
|
22702
|
+
watch(isChecked, (val) => {
|
|
22703
|
+
if (val) {
|
|
22704
22704
|
emit("update:modelValue", props.trueValue);
|
|
22705
22705
|
emit("change", props.trueValue);
|
|
22706
22706
|
} else {
|
package/package.json
CHANGED
package/src/checkbox/index.vue
CHANGED
|
@@ -95,15 +95,15 @@ watch(() => props.modelValue, (val) => {
|
|
|
95
95
|
})
|
|
96
96
|
|
|
97
97
|
onMounted(() => {
|
|
98
|
-
if (typeof
|
|
98
|
+
if (typeof props.modelValue === 'number' || typeof props.modelValue === 'string' || typeof props.modelValue === 'boolean') {
|
|
99
99
|
input.value = true
|
|
100
|
-
if (
|
|
100
|
+
if (props.modelValue === props.trueValue) {
|
|
101
101
|
input.value = true
|
|
102
102
|
} else {
|
|
103
103
|
input.value = false
|
|
104
104
|
}
|
|
105
105
|
} else {
|
|
106
|
-
if (
|
|
106
|
+
if (props.modelValue.includes(props.trueValue)) {
|
|
107
107
|
input.value = true
|
|
108
108
|
} else {
|
|
109
109
|
input.value = false
|