@varlet/ui 3.4.0 → 3.5.0-alpha.1726330414687
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/es/auto-complete/AutoComplete.mjs +20 -11
- package/es/auto-complete/props.mjs +1 -1
- package/es/checkbox/props.mjs +1 -1
- package/es/checkbox-group/props.mjs +1 -1
- package/es/counter/props.mjs +2 -2
- package/es/field-decorator/FieldDecorator.mjs +7 -0
- package/es/index.bundle.mjs +1 -1
- package/es/index.mjs +1 -1
- package/es/input/props.mjs +1 -1
- package/es/menu-select/MenuSelect.mjs +1 -0
- package/es/menu-select/props.mjs +9 -2
- package/es/radio/props.mjs +1 -1
- package/es/radio-group/props.mjs +1 -1
- package/es/select/props.mjs +1 -1
- package/es/slider/props.mjs +1 -1
- package/es/snackbar/style/index.mjs +1 -1
- package/es/swipe/Swipe.mjs +6 -1
- package/es/swipe/provide.mjs +26 -2
- package/es/switch/props.mjs +1 -1
- package/es/tooltip/Tooltip.mjs +5 -1
- package/es/tooltip/props.mjs +1 -0
- package/es/uploader/props.mjs +1 -1
- package/es/utils/components.mjs +30 -9
- package/es/varlet.esm.js +5521 -5466
- package/highlight/web-types.en-US.json +33 -24
- package/highlight/web-types.zh-CN.json +34 -25
- package/lib/varlet.cjs.js +137 -72
- package/package.json +8 -7
- package/types/autoComplete.d.ts +2 -1
- package/types/checkbox.d.ts +2 -2
- package/types/checkboxGroup.d.ts +2 -1
- package/types/counter.d.ts +4 -4
- package/types/input.d.ts +9 -2
- package/types/radio.d.ts +2 -2
- package/types/radioGroup.d.ts +2 -1
- package/types/rate.d.ts +2 -2
- package/types/select.d.ts +9 -2
- package/types/slider.d.ts +2 -1
- package/types/switch.d.ts +2 -2
- package/types/tooltip.d.ts +1 -0
- package/types/uploader.d.ts +2 -2
- package/types/varComponent.d.ts +4 -0
- package/umd/varlet.js +7 -7
package/lib/varlet.cjs.js
CHANGED
|
@@ -9,8 +9,8 @@ const context = {
|
|
|
9
9
|
const _ContextComponent = vue.reactive(context);
|
|
10
10
|
var stdin_default$5Z = vue.reactive(context);
|
|
11
11
|
var __defProp$z = Object.defineProperty;
|
|
12
|
-
var __defProps$
|
|
13
|
-
var __getOwnPropDescs$
|
|
12
|
+
var __defProps$d = Object.defineProperties;
|
|
13
|
+
var __getOwnPropDescs$d = Object.getOwnPropertyDescriptors;
|
|
14
14
|
var __getOwnPropSymbols$z = Object.getOwnPropertySymbols;
|
|
15
15
|
var __hasOwnProp$z = Object.prototype.hasOwnProperty;
|
|
16
16
|
var __propIsEnum$z = Object.prototype.propertyIsEnumerable;
|
|
@@ -26,7 +26,7 @@ var __spreadValues$z = (a, b) => {
|
|
|
26
26
|
}
|
|
27
27
|
return a;
|
|
28
28
|
};
|
|
29
|
-
var __spreadProps$
|
|
29
|
+
var __spreadProps$d = (a, b) => __defProps$d(a, __getOwnPropDescs$d(b));
|
|
30
30
|
var isString = (val) => typeof val === "string";
|
|
31
31
|
var isBoolean = (val) => typeof val === "boolean";
|
|
32
32
|
var isNumber = (val) => typeof val === "number";
|
|
@@ -117,7 +117,7 @@ var getRect = (element) => {
|
|
|
117
117
|
width,
|
|
118
118
|
height
|
|
119
119
|
};
|
|
120
|
-
return __spreadProps$
|
|
120
|
+
return __spreadProps$d(__spreadValues$z({}, rect), {
|
|
121
121
|
toJSON: () => rect
|
|
122
122
|
});
|
|
123
123
|
}
|
|
@@ -629,8 +629,8 @@ function useVModel(props2, key, options = {}) {
|
|
|
629
629
|
return proxy;
|
|
630
630
|
}
|
|
631
631
|
var __defProp$x = Object.defineProperty;
|
|
632
|
-
var __defProps$
|
|
633
|
-
var __getOwnPropDescs$
|
|
632
|
+
var __defProps$c = Object.defineProperties;
|
|
633
|
+
var __getOwnPropDescs$c = Object.getOwnPropertyDescriptors;
|
|
634
634
|
var __getOwnPropSymbols$x = Object.getOwnPropertySymbols;
|
|
635
635
|
var __hasOwnProp$x = Object.prototype.hasOwnProperty;
|
|
636
636
|
var __propIsEnum$x = Object.prototype.propertyIsEnumerable;
|
|
@@ -646,7 +646,7 @@ var __spreadValues$x = (a, b) => {
|
|
|
646
646
|
}
|
|
647
647
|
return a;
|
|
648
648
|
};
|
|
649
|
-
var __spreadProps$
|
|
649
|
+
var __spreadProps$c = (a, b) => __defProps$c(a, __getOwnPropDescs$c(b));
|
|
650
650
|
var __async$j = (__this, __arguments, generator) => {
|
|
651
651
|
return new Promise((resolve, reject) => {
|
|
652
652
|
var fulfilled = (value) => {
|
|
@@ -691,7 +691,7 @@ function withPropsDefaultsSetter(target, props2) {
|
|
|
691
691
|
return;
|
|
692
692
|
}
|
|
693
693
|
if (isPlainObject(prop)) {
|
|
694
|
-
props2[key] = __spreadProps$
|
|
694
|
+
props2[key] = __spreadProps$c(__spreadValues$x({}, prop), {
|
|
695
695
|
default: value
|
|
696
696
|
});
|
|
697
697
|
return;
|
|
@@ -742,17 +742,28 @@ function flatFragment(vNodes) {
|
|
|
742
742
|
});
|
|
743
743
|
return result;
|
|
744
744
|
}
|
|
745
|
+
function isZodRule(rule) {
|
|
746
|
+
return isPlainObject(rule) && isFunction(rule.safeParseAsync);
|
|
747
|
+
}
|
|
748
|
+
function isZodResult(result) {
|
|
749
|
+
return isPlainObject(result) && hasOwn(result, "success");
|
|
750
|
+
}
|
|
745
751
|
function useValidation() {
|
|
746
752
|
const errorMessage = vue.ref("");
|
|
747
|
-
const validate = (
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
753
|
+
const validate = (ruleOrRules, value, apis) => __async$j(this, null, function* () {
|
|
754
|
+
const rules = normalizeToArray(ruleOrRules).filter((rule) => isZodRule(rule) || isFunction(rule));
|
|
755
|
+
const results = yield Promise.all(
|
|
756
|
+
rules.map((rule) => isZodRule(rule) ? rule.safeParseAsync(value) : rule(value, apis))
|
|
757
|
+
);
|
|
752
758
|
resetValidation();
|
|
753
|
-
return !
|
|
754
|
-
if (
|
|
755
|
-
|
|
759
|
+
return !results.some((result) => {
|
|
760
|
+
if (isZodResult(result)) {
|
|
761
|
+
if (result.success === false) {
|
|
762
|
+
errorMessage.value = result.error.issues[0].message;
|
|
763
|
+
return true;
|
|
764
|
+
}
|
|
765
|
+
} else if (result !== true) {
|
|
766
|
+
errorMessage.value = String(result);
|
|
756
767
|
return true;
|
|
757
768
|
}
|
|
758
769
|
return false;
|
|
@@ -820,8 +831,8 @@ const MaybeVNode = vue.defineComponent({
|
|
|
820
831
|
}
|
|
821
832
|
});
|
|
822
833
|
var __defProp$w = Object.defineProperty;
|
|
823
|
-
var __defProps$
|
|
824
|
-
var __getOwnPropDescs$
|
|
834
|
+
var __defProps$b = Object.defineProperties;
|
|
835
|
+
var __getOwnPropDescs$b = Object.getOwnPropertyDescriptors;
|
|
825
836
|
var __getOwnPropSymbols$w = Object.getOwnPropertySymbols;
|
|
826
837
|
var __hasOwnProp$w = Object.prototype.hasOwnProperty;
|
|
827
838
|
var __propIsEnum$w = Object.prototype.propertyIsEnumerable;
|
|
@@ -837,7 +848,7 @@ var __spreadValues$w = (a, b) => {
|
|
|
837
848
|
}
|
|
838
849
|
return a;
|
|
839
850
|
};
|
|
840
|
-
var __spreadProps$
|
|
851
|
+
var __spreadProps$b = (a, b) => __defProps$b(a, __getOwnPropDescs$b(b));
|
|
841
852
|
const { n: n$1s } = createNamespace("ripple");
|
|
842
853
|
const ANIMATION_DURATION$1 = 250;
|
|
843
854
|
function setStyles(element) {
|
|
@@ -934,7 +945,7 @@ function removeKeyboardRipple() {
|
|
|
934
945
|
}
|
|
935
946
|
function mounted$2(el, binding) {
|
|
936
947
|
var _a;
|
|
937
|
-
el._ripple = __spreadProps$
|
|
948
|
+
el._ripple = __spreadProps$b(__spreadValues$w({
|
|
938
949
|
tasker: null
|
|
939
950
|
}, (_a = binding.value) != null ? _a : {}), {
|
|
940
951
|
removeRipple: removeRipple.bind(el)
|
|
@@ -2917,6 +2928,38 @@ const props$1b = {
|
|
|
2917
2928
|
onClick: defineListenerProp(),
|
|
2918
2929
|
onClear: defineListenerProp()
|
|
2919
2930
|
};
|
|
2931
|
+
const SWIPE_BIND_SWIPE_ITEM_KEY = Symbol("SWIPE_BIND_SWIPE_ITEM_KEY");
|
|
2932
|
+
const SWIPE_RESIZE_DISPATCHER_BIND_SWIPE_RESIZE_LISTENER_KEY = Symbol(
|
|
2933
|
+
"SWIPE_RESIZE_DISPATCHER_BIND_SWIPE_RESIZE_LISTENER_KEY"
|
|
2934
|
+
);
|
|
2935
|
+
function useSwipeItems() {
|
|
2936
|
+
const { childProviders, length, bindChildren } = useChildren(
|
|
2937
|
+
SWIPE_BIND_SWIPE_ITEM_KEY
|
|
2938
|
+
);
|
|
2939
|
+
return {
|
|
2940
|
+
length,
|
|
2941
|
+
swipeItems: childProviders,
|
|
2942
|
+
bindSwipeItems: bindChildren
|
|
2943
|
+
};
|
|
2944
|
+
}
|
|
2945
|
+
function useSwipeResizeListeners() {
|
|
2946
|
+
const { childProviders, bindChildren } = useChildren(
|
|
2947
|
+
SWIPE_RESIZE_DISPATCHER_BIND_SWIPE_RESIZE_LISTENER_KEY
|
|
2948
|
+
);
|
|
2949
|
+
return {
|
|
2950
|
+
swipeResizeListeners: childProviders,
|
|
2951
|
+
bindSwipeResizeListeners: bindChildren
|
|
2952
|
+
};
|
|
2953
|
+
}
|
|
2954
|
+
function useSwipeResizeDispatcher() {
|
|
2955
|
+
const { parentProvider, bindParent } = useParent(
|
|
2956
|
+
SWIPE_RESIZE_DISPATCHER_BIND_SWIPE_RESIZE_LISTENER_KEY
|
|
2957
|
+
);
|
|
2958
|
+
return {
|
|
2959
|
+
swipeResizeDispatcher: parentProvider,
|
|
2960
|
+
bindSwipeResizeDispatcher: bindParent
|
|
2961
|
+
};
|
|
2962
|
+
}
|
|
2920
2963
|
var __async$h = (__this, __arguments, generator) => {
|
|
2921
2964
|
return new Promise((resolve, reject) => {
|
|
2922
2965
|
var fulfilled = (value) => {
|
|
@@ -3147,6 +3190,7 @@ const __sfc__$1k = vue.defineComponent({
|
|
|
3147
3190
|
const transitionDisabled = vue.ref(true);
|
|
3148
3191
|
const isFloating = vue.computed(() => props2.hint && (!isEmpty(props2.value) || props2.isFocusing));
|
|
3149
3192
|
const { popup, bindPopup } = usePopup();
|
|
3193
|
+
const { bindSwipeResizeDispatcher } = useSwipeResizeDispatcher();
|
|
3150
3194
|
const color = vue.computed(
|
|
3151
3195
|
() => !props2.isError ? props2.isFocusing ? props2.focusColor : props2.blurColor : void 0
|
|
3152
3196
|
);
|
|
@@ -3159,6 +3203,11 @@ const __sfc__$1k = vue.defineComponent({
|
|
|
3159
3203
|
});
|
|
3160
3204
|
vue.onUpdated(resize);
|
|
3161
3205
|
call(bindPopup, null);
|
|
3206
|
+
call(bindSwipeResizeDispatcher, {
|
|
3207
|
+
onResize() {
|
|
3208
|
+
vue.nextTick().then(resize);
|
|
3209
|
+
}
|
|
3210
|
+
});
|
|
3162
3211
|
if (popup) {
|
|
3163
3212
|
vue.watch(
|
|
3164
3213
|
() => popup.show.value,
|
|
@@ -3222,8 +3271,8 @@ withPropsDefaultsSetter(stdin_default$5D, props$1b);
|
|
|
3222
3271
|
const _FieldDecoratorComponent = stdin_default$5D;
|
|
3223
3272
|
var stdin_default$5C = stdin_default$5D;
|
|
3224
3273
|
var __defProp$r = Object.defineProperty;
|
|
3225
|
-
var __defProps$
|
|
3226
|
-
var __getOwnPropDescs$
|
|
3274
|
+
var __defProps$a = Object.defineProperties;
|
|
3275
|
+
var __getOwnPropDescs$a = Object.getOwnPropertyDescriptors;
|
|
3227
3276
|
var __getOwnPropSymbols$r = Object.getOwnPropertySymbols;
|
|
3228
3277
|
var __hasOwnProp$r = Object.prototype.hasOwnProperty;
|
|
3229
3278
|
var __propIsEnum$r = Object.prototype.propertyIsEnumerable;
|
|
@@ -3239,8 +3288,8 @@ var __spreadValues$r = (a, b) => {
|
|
|
3239
3288
|
}
|
|
3240
3289
|
return a;
|
|
3241
3290
|
};
|
|
3242
|
-
var __spreadProps$
|
|
3243
|
-
const props$1a = __spreadProps$
|
|
3291
|
+
var __spreadProps$a = (a, b) => __defProps$a(a, __getOwnPropDescs$a(b));
|
|
3292
|
+
const props$1a = __spreadProps$a(__spreadValues$r({
|
|
3244
3293
|
modelValue: String,
|
|
3245
3294
|
modelModifiers: {
|
|
3246
3295
|
type: Object,
|
|
@@ -3263,7 +3312,7 @@ const props$1a = __spreadProps$9(__spreadValues$r({
|
|
|
3263
3312
|
type: Array,
|
|
3264
3313
|
default: () => ["onInput", "onClear"]
|
|
3265
3314
|
},
|
|
3266
|
-
rules: Array,
|
|
3315
|
+
rules: [Array, Function, Object],
|
|
3267
3316
|
enterkeyhint: String,
|
|
3268
3317
|
onFocus: defineListenerProp(),
|
|
3269
3318
|
onBlur: defineListenerProp(),
|
|
@@ -3301,8 +3350,8 @@ const props$1a = __spreadProps$9(__spreadValues$r({
|
|
|
3301
3350
|
// internal end
|
|
3302
3351
|
});
|
|
3303
3352
|
var __defProp$q = Object.defineProperty;
|
|
3304
|
-
var __defProps$
|
|
3305
|
-
var __getOwnPropDescs$
|
|
3353
|
+
var __defProps$9 = Object.defineProperties;
|
|
3354
|
+
var __getOwnPropDescs$9 = Object.getOwnPropertyDescriptors;
|
|
3306
3355
|
var __getOwnPropSymbols$q = Object.getOwnPropertySymbols;
|
|
3307
3356
|
var __hasOwnProp$q = Object.prototype.hasOwnProperty;
|
|
3308
3357
|
var __propIsEnum$q = Object.prototype.propertyIsEnumerable;
|
|
@@ -3318,13 +3367,13 @@ var __spreadValues$q = (a, b) => {
|
|
|
3318
3367
|
}
|
|
3319
3368
|
return a;
|
|
3320
3369
|
};
|
|
3321
|
-
var __spreadProps$
|
|
3370
|
+
var __spreadProps$9 = (a, b) => __defProps$9(a, __getOwnPropDescs$9(b));
|
|
3322
3371
|
const FORM_BIND_FORM_ITEM_KEY = Symbol("FORM_BIND_FORM_ITEM_KEY");
|
|
3323
3372
|
function useForm() {
|
|
3324
3373
|
const { parentProvider, index, bindParent } = useParent(FORM_BIND_FORM_ITEM_KEY);
|
|
3325
3374
|
const instance = vue.getCurrentInstance();
|
|
3326
3375
|
const bindForm = bindParent ? (formItemProvider) => {
|
|
3327
|
-
bindParent(__spreadProps$
|
|
3376
|
+
bindParent(__spreadProps$9(__spreadValues$q({}, formItemProvider), { instance }));
|
|
3328
3377
|
} : null;
|
|
3329
3378
|
return {
|
|
3330
3379
|
index,
|
|
@@ -5027,8 +5076,8 @@ var createPopper = /* @__PURE__ */ popperGenerator({
|
|
|
5027
5076
|
defaultModifiers
|
|
5028
5077
|
});
|
|
5029
5078
|
var __defProp$p = Object.defineProperty;
|
|
5030
|
-
var __defProps$
|
|
5031
|
-
var __getOwnPropDescs$
|
|
5079
|
+
var __defProps$8 = Object.defineProperties;
|
|
5080
|
+
var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;
|
|
5032
5081
|
var __getOwnPropSymbols$p = Object.getOwnPropertySymbols;
|
|
5033
5082
|
var __hasOwnProp$p = Object.prototype.hasOwnProperty;
|
|
5034
5083
|
var __propIsEnum$p = Object.prototype.propertyIsEnumerable;
|
|
@@ -5044,7 +5093,7 @@ var __spreadValues$p = (a, b) => {
|
|
|
5044
5093
|
}
|
|
5045
5094
|
return a;
|
|
5046
5095
|
};
|
|
5047
|
-
var __spreadProps$
|
|
5096
|
+
var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
|
|
5048
5097
|
var __async$g = (__this, __arguments, generator) => {
|
|
5049
5098
|
return new Promise((resolve, reject) => {
|
|
5050
5099
|
var fulfilled = (value) => {
|
|
@@ -5303,15 +5352,15 @@ function usePopover(options) {
|
|
|
5303
5352
|
function getPopperOptions() {
|
|
5304
5353
|
const { placement, skidding, distance } = getPosition();
|
|
5305
5354
|
const modifiers = [
|
|
5306
|
-
__spreadProps$
|
|
5355
|
+
__spreadProps$8(__spreadValues$p({}, flip$1), {
|
|
5307
5356
|
enabled: show.value
|
|
5308
5357
|
}),
|
|
5309
|
-
__spreadProps$
|
|
5358
|
+
__spreadProps$8(__spreadValues$p({}, offset$1), {
|
|
5310
5359
|
options: {
|
|
5311
5360
|
offset: [skidding, distance]
|
|
5312
5361
|
}
|
|
5313
5362
|
}),
|
|
5314
|
-
__spreadProps$
|
|
5363
|
+
__spreadProps$8(__spreadValues$p({}, computeStyles$1), {
|
|
5315
5364
|
options: {
|
|
5316
5365
|
adaptive: false,
|
|
5317
5366
|
gpuAcceleration: false
|
|
@@ -5521,7 +5570,7 @@ const props$18 = {
|
|
|
5521
5570
|
type: Array,
|
|
5522
5571
|
default: () => ["onChange"]
|
|
5523
5572
|
},
|
|
5524
|
-
rules: Array,
|
|
5573
|
+
rules: [Array, Function, Object],
|
|
5525
5574
|
onClick: defineListenerProp(),
|
|
5526
5575
|
onChange: defineListenerProp(),
|
|
5527
5576
|
"onUpdate:modelValue": defineListenerProp(),
|
|
@@ -5987,6 +6036,8 @@ withPropsDefaultsSetter(stdin_default$5v, props$17);
|
|
|
5987
6036
|
const _MenuOptionComponent = stdin_default$5v;
|
|
5988
6037
|
var stdin_default$5u = stdin_default$5v;
|
|
5989
6038
|
var __defProp$o = Object.defineProperty;
|
|
6039
|
+
var __defProps$7 = Object.defineProperties;
|
|
6040
|
+
var __getOwnPropDescs$7 = Object.getOwnPropertyDescriptors;
|
|
5990
6041
|
var __getOwnPropSymbols$o = Object.getOwnPropertySymbols;
|
|
5991
6042
|
var __hasOwnProp$o = Object.prototype.hasOwnProperty;
|
|
5992
6043
|
var __propIsEnum$o = Object.prototype.propertyIsEnumerable;
|
|
@@ -6002,7 +6053,8 @@ var __spreadValues$o = (a, b) => {
|
|
|
6002
6053
|
}
|
|
6003
6054
|
return a;
|
|
6004
6055
|
};
|
|
6005
|
-
|
|
6056
|
+
var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
|
|
6057
|
+
const props$16 = __spreadProps$7(__spreadValues$o({
|
|
6006
6058
|
modelValue: {
|
|
6007
6059
|
type: [String, Number, Boolean, Array],
|
|
6008
6060
|
default: void 0
|
|
@@ -6050,7 +6102,11 @@ const props$16 = __spreadValues$o({
|
|
|
6050
6102
|
"onClosed",
|
|
6051
6103
|
"onClickOutside",
|
|
6052
6104
|
"onUpdate:show"
|
|
6053
|
-
]))
|
|
6105
|
+
])), {
|
|
6106
|
+
// internal start
|
|
6107
|
+
onKeyEscape: defineListenerProp()
|
|
6108
|
+
// internal end
|
|
6109
|
+
});
|
|
6054
6110
|
function useSelectController(options) {
|
|
6055
6111
|
const {
|
|
6056
6112
|
multiple: multipleGetter,
|
|
@@ -6220,6 +6276,7 @@ const __sfc__$1f = vue.defineComponent({
|
|
|
6220
6276
|
if (key === "Escape") {
|
|
6221
6277
|
menu.value.$el.focus();
|
|
6222
6278
|
close();
|
|
6279
|
+
call(props2.onKeyEscape);
|
|
6223
6280
|
return;
|
|
6224
6281
|
}
|
|
6225
6282
|
if (key === "ArrowDown" || key === "ArrowUp") {
|
|
@@ -6295,7 +6352,7 @@ const props$15 = __spreadValues$n({
|
|
|
6295
6352
|
default: () => ["onInput", "onClear", "onChange"]
|
|
6296
6353
|
},
|
|
6297
6354
|
getShow: Function,
|
|
6298
|
-
rules: Array,
|
|
6355
|
+
rules: [Array, Function, Object],
|
|
6299
6356
|
onFocus: defineListenerProp(),
|
|
6300
6357
|
onBlur: defineListenerProp(),
|
|
6301
6358
|
onInput: defineListenerProp(),
|
|
@@ -6360,7 +6417,8 @@ function __render__$1c(_ctx, _cache) {
|
|
|
6360
6417
|
"popover-class": _ctx.variant === "standard" ? _ctx.n("--standard-menu-margin") : void 0,
|
|
6361
6418
|
show: _ctx.isShowMenuSelect,
|
|
6362
6419
|
"onUpdate:show": _cache[1] || (_cache[1] = ($event) => _ctx.isShowMenuSelect = $event),
|
|
6363
|
-
"onUpdate:modelValue": _ctx.handleAutoComplete
|
|
6420
|
+
"onUpdate:modelValue": _ctx.handleAutoComplete,
|
|
6421
|
+
onKeyEscape: _ctx.handleKeyEscape
|
|
6364
6422
|
}, {
|
|
6365
6423
|
options: vue.withCtx(() => [
|
|
6366
6424
|
vue.createElementVNode(
|
|
@@ -6451,7 +6509,7 @@ function __render__$1c(_ctx, _cache) {
|
|
|
6451
6509
|
]),
|
|
6452
6510
|
_: 3
|
|
6453
6511
|
/* FORWARDED */
|
|
6454
|
-
}, 8, ["disabled", "class", "popover-class", "show", "onUpdate:modelValue"]),
|
|
6512
|
+
}, 8, ["disabled", "class", "popover-class", "show", "onUpdate:modelValue", "onKeyEscape"]),
|
|
6455
6513
|
vue.createVNode(_component_var_form_details, {
|
|
6456
6514
|
"error-message": _ctx.errorMessage,
|
|
6457
6515
|
"extra-message": _ctx.maxlengthText
|
|
@@ -6608,15 +6666,22 @@ const __sfc__$1e = vue.defineComponent({
|
|
|
6608
6666
|
validateWithTrigger("onChange");
|
|
6609
6667
|
}
|
|
6610
6668
|
function handleAutoComplete(newValue) {
|
|
6611
|
-
|
|
6612
|
-
|
|
6613
|
-
|
|
6614
|
-
|
|
6615
|
-
|
|
6616
|
-
|
|
6617
|
-
|
|
6618
|
-
|
|
6619
|
-
|
|
6669
|
+
return __async$f(this, null, function* () {
|
|
6670
|
+
var _a;
|
|
6671
|
+
if (props2.maxlength != null) {
|
|
6672
|
+
newValue = newValue.slice(0, toNumber(props2.maxlength));
|
|
6673
|
+
}
|
|
6674
|
+
if (newValue !== value.value) {
|
|
6675
|
+
value.value = newValue;
|
|
6676
|
+
call(props2.onChange, newValue);
|
|
6677
|
+
validateWithTrigger("onChange");
|
|
6678
|
+
}
|
|
6679
|
+
yield raf();
|
|
6680
|
+
(_a = input.value) == null ? void 0 : _a.focus();
|
|
6681
|
+
});
|
|
6682
|
+
}
|
|
6683
|
+
function handleKeyEscape() {
|
|
6684
|
+
input.value.focus();
|
|
6620
6685
|
}
|
|
6621
6686
|
function getShowMenuSelect(newValue) {
|
|
6622
6687
|
if (props2.disabled || props2.readonly || (form == null ? void 0 : form.disabled.value) || (form == null ? void 0 : form.readonly.value)) {
|
|
@@ -6641,6 +6706,7 @@ const __sfc__$1e = vue.defineComponent({
|
|
|
6641
6706
|
handleClick,
|
|
6642
6707
|
handleChange,
|
|
6643
6708
|
handleBlur,
|
|
6709
|
+
handleKeyEscape,
|
|
6644
6710
|
handleAutoComplete,
|
|
6645
6711
|
reset,
|
|
6646
6712
|
validate,
|
|
@@ -8961,7 +9027,7 @@ const props$T = {
|
|
|
8961
9027
|
type: Array,
|
|
8962
9028
|
default: () => ["onChange"]
|
|
8963
9029
|
},
|
|
8964
|
-
rules: Array,
|
|
9030
|
+
rules: [Array, Function, Object],
|
|
8965
9031
|
onChange: defineListenerProp(),
|
|
8966
9032
|
"onUpdate:modelValue": defineListenerProp()
|
|
8967
9033
|
};
|
|
@@ -12332,7 +12398,7 @@ LN10 = new Decimal(LN10);
|
|
|
12332
12398
|
PI = new Decimal(PI);
|
|
12333
12399
|
const props$M = {
|
|
12334
12400
|
modelValue: {
|
|
12335
|
-
type:
|
|
12401
|
+
type: Number,
|
|
12336
12402
|
default: 0
|
|
12337
12403
|
},
|
|
12338
12404
|
min: [String, Number],
|
|
@@ -12376,7 +12442,7 @@ const props$M = {
|
|
|
12376
12442
|
type: Array,
|
|
12377
12443
|
default: () => ["onInputChange", "onLazyChange", "onIncrement", "onDecrement"]
|
|
12378
12444
|
},
|
|
12379
|
-
rules: Array,
|
|
12445
|
+
rules: [Array, Function, Object],
|
|
12380
12446
|
onBeforeChange: defineListenerProp(),
|
|
12381
12447
|
onChange: defineListenerProp(),
|
|
12382
12448
|
onIncrement: defineListenerProp(),
|
|
@@ -15815,6 +15881,7 @@ const props$G = {
|
|
|
15815
15881
|
default: "default"
|
|
15816
15882
|
},
|
|
15817
15883
|
color: String,
|
|
15884
|
+
textColor: String,
|
|
15818
15885
|
content: String,
|
|
15819
15886
|
show: Boolean,
|
|
15820
15887
|
disabled: Boolean,
|
|
@@ -15895,7 +15962,11 @@ function __render__$J(_ctx, _cache) {
|
|
|
15895
15962
|
vue.createElementVNode(
|
|
15896
15963
|
"div",
|
|
15897
15964
|
{
|
|
15898
|
-
style: vue.normalizeStyle({
|
|
15965
|
+
style: vue.normalizeStyle({
|
|
15966
|
+
background: _ctx.color,
|
|
15967
|
+
color: _ctx.textColor,
|
|
15968
|
+
width: _ctx.sameWidth ? _ctx.toSizeUnit(Math.ceil(_ctx.hostSize.width)) : void 0
|
|
15969
|
+
}),
|
|
15899
15970
|
class: vue.normalizeClass(_ctx.classes(_ctx.n("content-container"), _ctx.n(`--${_ctx.type}`))),
|
|
15900
15971
|
role: "tooltip"
|
|
15901
15972
|
},
|
|
@@ -16761,17 +16832,6 @@ withInstall(stdin_default$4m);
|
|
|
16761
16832
|
withPropsDefaultsSetter(stdin_default$4m, props$B);
|
|
16762
16833
|
const _ImageComponent = stdin_default$4m;
|
|
16763
16834
|
var stdin_default$4l = stdin_default$4m;
|
|
16764
|
-
const SWIPE_BIND_SWIPE_ITEM_KEY = Symbol("SWIPE_BIND_SWIPE_ITEM_KEY");
|
|
16765
|
-
function useSwipeItems() {
|
|
16766
|
-
const { childProviders, length, bindChildren } = useChildren(
|
|
16767
|
-
SWIPE_BIND_SWIPE_ITEM_KEY
|
|
16768
|
-
);
|
|
16769
|
-
return {
|
|
16770
|
-
length,
|
|
16771
|
-
swipeItems: childProviders,
|
|
16772
|
-
bindSwipeItems: bindChildren
|
|
16773
|
-
};
|
|
16774
|
-
}
|
|
16775
16835
|
const props$A = {
|
|
16776
16836
|
loop: {
|
|
16777
16837
|
type: Boolean,
|
|
@@ -17003,6 +17063,7 @@ const __sfc__$G = vue.defineComponent({
|
|
|
17003
17063
|
const index = vue.ref(0);
|
|
17004
17064
|
const hovering = vue.ref(false);
|
|
17005
17065
|
const { swipeItems, bindSwipeItems, length } = useSwipeItems();
|
|
17066
|
+
const { swipeResizeListeners, bindSwipeResizeListeners } = useSwipeResizeListeners();
|
|
17006
17067
|
const { popup, bindPopup } = usePopup();
|
|
17007
17068
|
const {
|
|
17008
17069
|
deltaX,
|
|
@@ -17029,6 +17090,7 @@ const __sfc__$G = vue.defineComponent({
|
|
|
17029
17090
|
bindSwipeItems(swipeProvider);
|
|
17030
17091
|
useEventListener(() => window, "keydown", handleKeydown);
|
|
17031
17092
|
call(bindPopup, null);
|
|
17093
|
+
call(bindSwipeResizeListeners, null);
|
|
17032
17094
|
vue.watch(
|
|
17033
17095
|
() => length.value,
|
|
17034
17096
|
() => __async$7(this, null, function* () {
|
|
@@ -17231,6 +17293,9 @@ const __sfc__$G = vue.defineComponent({
|
|
|
17231
17293
|
setTimeout(() => {
|
|
17232
17294
|
lockDuration.value = false;
|
|
17233
17295
|
});
|
|
17296
|
+
swipeResizeListeners.forEach(({ onResize }) => {
|
|
17297
|
+
onResize();
|
|
17298
|
+
});
|
|
17234
17299
|
}
|
|
17235
17300
|
function next(options) {
|
|
17236
17301
|
return __async$7(this, null, function* () {
|
|
@@ -20679,7 +20744,7 @@ const props$l = {
|
|
|
20679
20744
|
type: Array,
|
|
20680
20745
|
default: () => ["onChange"]
|
|
20681
20746
|
},
|
|
20682
|
-
rules: Array,
|
|
20747
|
+
rules: [Array, Function, Object],
|
|
20683
20748
|
onClick: defineListenerProp(),
|
|
20684
20749
|
onChange: defineListenerProp(),
|
|
20685
20750
|
"onUpdate:modelValue": defineListenerProp()
|
|
@@ -20960,7 +21025,7 @@ const props$k = {
|
|
|
20960
21025
|
type: Array,
|
|
20961
21026
|
default: () => ["onChange"]
|
|
20962
21027
|
},
|
|
20963
|
-
rules: Array,
|
|
21028
|
+
rules: [Array, Function, Object],
|
|
20964
21029
|
onChange: defineListenerProp(),
|
|
20965
21030
|
"onUpdate:modelValue": defineListenerProp()
|
|
20966
21031
|
};
|
|
@@ -21801,7 +21866,7 @@ const props$g = __spreadValues$6({
|
|
|
21801
21866
|
type: Array,
|
|
21802
21867
|
default: () => ["onChange", "onClear", "onClose"]
|
|
21803
21868
|
},
|
|
21804
|
-
rules: Array,
|
|
21869
|
+
rules: [Array, Function, Object],
|
|
21805
21870
|
onFocus: defineListenerProp(),
|
|
21806
21871
|
onBlur: defineListenerProp(),
|
|
21807
21872
|
onClose: defineListenerProp(),
|
|
@@ -22581,7 +22646,7 @@ const props$e = {
|
|
|
22581
22646
|
type: String,
|
|
22582
22647
|
default: "horizontal"
|
|
22583
22648
|
},
|
|
22584
|
-
rules: Array,
|
|
22649
|
+
rules: [Array, Function, Object],
|
|
22585
22650
|
onChange: defineListenerProp(),
|
|
22586
22651
|
onStart: defineListenerProp(),
|
|
22587
22652
|
onEnd: defineListenerProp(),
|
|
@@ -24024,7 +24089,7 @@ const props$8 = {
|
|
|
24024
24089
|
closeColor: String,
|
|
24025
24090
|
size: [String, Number],
|
|
24026
24091
|
variant: Boolean,
|
|
24027
|
-
rules: Array,
|
|
24092
|
+
rules: [Array, Function, Object],
|
|
24028
24093
|
ripple: {
|
|
24029
24094
|
type: Boolean,
|
|
24030
24095
|
default: true
|
|
@@ -28778,7 +28843,7 @@ const props$1 = {
|
|
|
28778
28843
|
type: Array,
|
|
28779
28844
|
default: () => ["onChange", "onRemove"]
|
|
28780
28845
|
},
|
|
28781
|
-
rules: Array,
|
|
28846
|
+
rules: [Array, Function, Object],
|
|
28782
28847
|
hideList: Boolean,
|
|
28783
28848
|
preventDefaultPreview: Boolean,
|
|
28784
28849
|
onClickAction: defineListenerProp(),
|
|
@@ -29580,7 +29645,7 @@ withInstall(stdin_default$1);
|
|
|
29580
29645
|
withPropsDefaultsSetter(stdin_default$1, props);
|
|
29581
29646
|
const _WatermarkComponent = stdin_default$1;
|
|
29582
29647
|
var stdin_default = stdin_default$1;
|
|
29583
|
-
const version = "3.
|
|
29648
|
+
const version = "3.5.0-alpha.1726330414687";
|
|
29584
29649
|
function install(app) {
|
|
29585
29650
|
stdin_default$5I.install && app.use(stdin_default$5I);
|
|
29586
29651
|
stdin_default$5G.install && app.use(stdin_default$5G);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@varlet/ui",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.5.0-alpha.1726330414687",
|
|
4
4
|
"description": "A material like components library",
|
|
5
5
|
"main": "lib/varlet.cjs.js",
|
|
6
6
|
"module": "es/index.mjs",
|
|
@@ -48,15 +48,16 @@
|
|
|
48
48
|
"@popperjs/core": "^2.11.6",
|
|
49
49
|
"dayjs": "^1.10.4",
|
|
50
50
|
"decimal.js": "^10.2.1",
|
|
51
|
-
"@varlet/
|
|
52
|
-
"@varlet/
|
|
53
|
-
"@varlet/use": "3.
|
|
51
|
+
"@varlet/shared": "3.5.0-alpha.1726330414687",
|
|
52
|
+
"@varlet/icons": "3.5.0-alpha.1726330414687",
|
|
53
|
+
"@varlet/use": "3.5.0-alpha.1726330414687"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@vue/runtime-core": "3.4.21",
|
|
57
57
|
"@vue/test-utils": "2.4.1",
|
|
58
58
|
"@types/node": "^18.7.18",
|
|
59
59
|
"@vitest/coverage-istanbul": "2.0.5",
|
|
60
|
+
"zod": "^3.23.8",
|
|
60
61
|
"jsdom": "24.1.1",
|
|
61
62
|
"vitest": "2.0.5",
|
|
62
63
|
"clipboard": "^2.0.6",
|
|
@@ -64,9 +65,9 @@
|
|
|
64
65
|
"typescript": "^5.1.5",
|
|
65
66
|
"vue": "3.4.21",
|
|
66
67
|
"vue-router": "4.2.0",
|
|
67
|
-
"@varlet/cli": "3.
|
|
68
|
-
"@varlet/ui": "3.
|
|
69
|
-
"@varlet/touch-emulator": "3.
|
|
68
|
+
"@varlet/cli": "3.5.0-alpha.1726330414687",
|
|
69
|
+
"@varlet/ui": "3.5.0-alpha.1726330414687",
|
|
70
|
+
"@varlet/touch-emulator": "3.5.0-alpha.1726330414687"
|
|
70
71
|
},
|
|
71
72
|
"scripts": {
|
|
72
73
|
"dev": "varlet-cli dev",
|
package/types/autoComplete.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
BasicAttributes,
|
|
4
4
|
ListenerProp,
|
|
5
5
|
Variant as AutoCompleteVariant,
|
|
6
|
+
Rules as AutoCompleteRules,
|
|
6
7
|
SetPropsDefaults,
|
|
7
8
|
} from './varComponent'
|
|
8
9
|
import { VNode, VNodeChild, type InputHTMLAttributes } from 'vue'
|
|
@@ -44,7 +45,7 @@ export interface AutoCompleteProps extends BasicAttributes {
|
|
|
44
45
|
clearable?: boolean
|
|
45
46
|
validateTrigger?: AutoCompleteValidateTrigger[]
|
|
46
47
|
getShow?: (v: string) => boolean
|
|
47
|
-
rules?:
|
|
48
|
+
rules?: AutoCompleteRules
|
|
48
49
|
enterkeyhint?: InputHTMLAttributes['enterKeyHint']
|
|
49
50
|
onFocus?: ListenerProp<() => void>
|
|
50
51
|
onBlur?: ListenerProp<() => void>
|
package/types/checkbox.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { VarComponent, BasicAttributes, ListenerProp, SetPropsDefaults } from './varComponent'
|
|
1
|
+
import { VarComponent, BasicAttributes, ListenerProp, SetPropsDefaults, Rules as CheckboxRules } from './varComponent'
|
|
2
2
|
import { VNode } from 'vue'
|
|
3
3
|
|
|
4
4
|
export declare const checkboxProps: Record<keyof CheckboxProps, any>
|
|
@@ -17,7 +17,7 @@ export interface CheckboxProps extends BasicAttributes {
|
|
|
17
17
|
iconSize?: string | number
|
|
18
18
|
ripple?: boolean
|
|
19
19
|
validateTrigger?: Array<CheckboxValidateTrigger>
|
|
20
|
-
rules?:
|
|
20
|
+
rules?: CheckboxRules
|
|
21
21
|
onClick?: ListenerProp<(e: Event) => void>
|
|
22
22
|
onChange?: ListenerProp<(value: any) => void>
|
|
23
23
|
'onUpdate:modelValue'?: ListenerProp<(value: any) => void>
|
package/types/checkboxGroup.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import {
|
|
|
2
2
|
VarComponent,
|
|
3
3
|
BasicAttributes,
|
|
4
4
|
Direction as CheckboxGroupDirection,
|
|
5
|
+
Rules as CheckboxGroupRules,
|
|
5
6
|
ListenerProp,
|
|
6
7
|
SetPropsDefaults,
|
|
7
8
|
} from './varComponent'
|
|
@@ -31,7 +32,7 @@ export interface CheckboxGroupProps extends BasicAttributes {
|
|
|
31
32
|
options?: Array<CheckboxGroupOption>
|
|
32
33
|
direction?: CheckboxGroupDirection
|
|
33
34
|
validateTrigger?: Array<CheckboxGroupValidateTrigger>
|
|
34
|
-
rules?:
|
|
35
|
+
rules?: CheckboxGroupRules
|
|
35
36
|
onChange?: ListenerProp<(value: Array<any>) => void>
|
|
36
37
|
'onUpdate:modelValue'?: ListenerProp<(value: Array<any>) => void>
|
|
37
38
|
}
|
package/types/counter.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { VarComponent, BasicAttributes, ListenerProp, SetPropsDefaults } from './varComponent'
|
|
1
|
+
import { VarComponent, BasicAttributes, ListenerProp, SetPropsDefaults, Rules as CounterRules } from './varComponent'
|
|
2
2
|
|
|
3
3
|
export declare const counterProps: Record<keyof CounterProps, any>
|
|
4
4
|
|
|
5
5
|
export type CounterValidateTrigger = 'onIncrement' | 'onDecrement' | 'onInputChange' | 'onLazyChange'
|
|
6
6
|
|
|
7
7
|
export interface CounterProps extends BasicAttributes {
|
|
8
|
-
modelValue?:
|
|
8
|
+
modelValue?: number
|
|
9
9
|
min?: string | number
|
|
10
10
|
max?: string | number
|
|
11
11
|
step?: string | number
|
|
@@ -26,8 +26,8 @@ export interface CounterProps extends BasicAttributes {
|
|
|
26
26
|
press?: boolean
|
|
27
27
|
ripple?: boolean
|
|
28
28
|
validateTrigger?: Array<CounterValidateTrigger>
|
|
29
|
-
rules?:
|
|
30
|
-
onBeforeChange?: ListenerProp<(value: number, change: (value:
|
|
29
|
+
rules?: CounterRules
|
|
30
|
+
onBeforeChange?: ListenerProp<(value: number, change: (value: number) => void) => void>
|
|
31
31
|
onChange?: ListenerProp<(value: number) => void>
|
|
32
32
|
onIncrement?: ListenerProp<(value: number) => void>
|
|
33
33
|
onDecrement?: ListenerProp<(value: number) => void>
|
package/types/input.d.ts
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
VarComponent,
|
|
3
|
+
BasicAttributes,
|
|
4
|
+
ListenerProp,
|
|
5
|
+
Variant as InputVariant,
|
|
6
|
+
Rules as InputRules,
|
|
7
|
+
SetPropsDefaults,
|
|
8
|
+
} from './varComponent'
|
|
2
9
|
import { VNode, InputHTMLAttributes } from 'vue'
|
|
3
10
|
|
|
4
11
|
export declare const inputProps: Record<keyof InputProps, any>
|
|
@@ -29,7 +36,7 @@ export interface InputProps extends BasicAttributes {
|
|
|
29
36
|
resize?: boolean
|
|
30
37
|
autofocus?: boolean
|
|
31
38
|
validateTrigger?: InputValidateTrigger[]
|
|
32
|
-
rules?:
|
|
39
|
+
rules?: InputRules
|
|
33
40
|
enterkeyhint?: InputHTMLAttributes['enterKeyHint']
|
|
34
41
|
onFocus?: ListenerProp<(e: Event) => void>
|
|
35
42
|
onBlur?: ListenerProp<(e: Event) => void>
|