@varlet/ui 3.3.2 → 3.3.4
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/dialog/Dialog.mjs +60 -54
- package/es/index.bundle.mjs +1 -1
- package/es/index.mjs +1 -1
- package/es/option/Option.mjs +26 -9
- package/es/option/props.mjs +3 -1
- package/es/ripple/style/index.mjs +1 -1
- package/es/select/Select.mjs +58 -20
- package/es/select/props.mjs +9 -0
- package/es/select/style/index.mjs +1 -0
- package/es/utils/components.mjs +1 -1
- package/es/varlet.esm.js +4228 -4164
- package/highlight/web-types.en-US.json +32 -1
- package/highlight/web-types.zh-CN.json +33 -2
- package/lib/varlet.cjs.js +179 -108
- package/package.json +7 -7
- package/types/dialog.d.ts +7 -0
- package/types/select.d.ts +15 -0
- package/umd/varlet.js +7 -7
package/lib/varlet.cjs.js
CHANGED
|
@@ -41,7 +41,7 @@ var isURL = (val) => {
|
|
|
41
41
|
}
|
|
42
42
|
return /^(http)|(\.*\/)/.test(val);
|
|
43
43
|
};
|
|
44
|
-
var isEmpty = (val) => val === void 0 || val === null || val === "" ||
|
|
44
|
+
var isEmpty = (val) => val === void 0 || val === null || val === "" || isArray(val) && !val.length;
|
|
45
45
|
var isWindow = (val) => val === window;
|
|
46
46
|
var supportTouch = () => inBrowser() && "ontouchstart" in window;
|
|
47
47
|
var inBrowser = () => typeof window !== "undefined";
|
|
@@ -388,7 +388,7 @@ function flatVNodes(subTree) {
|
|
|
388
388
|
flat(subTree2 == null ? void 0 : subTree2.component.subTree);
|
|
389
389
|
return;
|
|
390
390
|
}
|
|
391
|
-
if (
|
|
391
|
+
if (isArray(subTree2 == null ? void 0 : subTree2.children)) {
|
|
392
392
|
subTree2.children.forEach((child) => {
|
|
393
393
|
if (vue.isVNode(child)) {
|
|
394
394
|
vNodes.push(child);
|
|
@@ -668,7 +668,7 @@ var __async$i = (__this, __arguments, generator) => {
|
|
|
668
668
|
});
|
|
669
669
|
};
|
|
670
670
|
function pickProps(props2, propsKey) {
|
|
671
|
-
return
|
|
671
|
+
return isArray(propsKey) ? propsKey.reduce((pickedProps, key) => {
|
|
672
672
|
pickedProps[key] = props2[key];
|
|
673
673
|
return pickedProps;
|
|
674
674
|
}, {}) : props2[propsKey];
|
|
@@ -3048,7 +3048,7 @@ const props$1c = {
|
|
|
3048
3048
|
const isInternalSize$1 = (size) => ["mini", "small", "normal", "large"].includes(size);
|
|
3049
3049
|
const { name: name$1c, n: n$1j, classes: classes$14 } = createNamespace("avatar");
|
|
3050
3050
|
const _hoisted_1$y = ["src", "alt", "lazy-loading", "lazy-error"];
|
|
3051
|
-
const _hoisted_2$
|
|
3051
|
+
const _hoisted_2$f = ["src", "alt"];
|
|
3052
3052
|
function __render__$1i(_ctx, _cache) {
|
|
3053
3053
|
const _directive_lazy = vue.resolveDirective("lazy");
|
|
3054
3054
|
return vue.openBlock(), vue.createElementBlock(
|
|
@@ -3099,7 +3099,7 @@ function __render__$1i(_ctx, _cache) {
|
|
|
3099
3099
|
style: vue.normalizeStyle({ objectFit: _ctx.fit }),
|
|
3100
3100
|
onLoad: _cache[1] || (_cache[1] = (...args) => _ctx.handleLoad && _ctx.handleLoad(...args)),
|
|
3101
3101
|
onError: _cache[2] || (_cache[2] = (...args) => _ctx.handleError && _ctx.handleError(...args))
|
|
3102
|
-
}, null, 46, _hoisted_2$
|
|
3102
|
+
}, null, 46, _hoisted_2$f))
|
|
3103
3103
|
],
|
|
3104
3104
|
64
|
|
3105
3105
|
/* STABLE_FRAGMENT */
|
|
@@ -3255,7 +3255,7 @@ const _hoisted_1$x = /* @__PURE__ */ _withScopeId$6(() => /* @__PURE__ */ vue.cr
|
|
|
3255
3255
|
-1
|
|
3256
3256
|
/* HOISTED */
|
|
3257
3257
|
));
|
|
3258
|
-
const _hoisted_2$
|
|
3258
|
+
const _hoisted_2$e = [
|
|
3259
3259
|
_hoisted_1$x
|
|
3260
3260
|
];
|
|
3261
3261
|
function __render__$1g(_ctx, _cache) {
|
|
@@ -3311,7 +3311,7 @@ function __render__$1g(_ctx, _cache) {
|
|
|
3311
3311
|
color: _ctx.color
|
|
3312
3312
|
})
|
|
3313
3313
|
},
|
|
3314
|
-
[..._hoisted_2$
|
|
3314
|
+
[..._hoisted_2$e],
|
|
3315
3315
|
6
|
|
3316
3316
|
/* CLASS, STYLE */
|
|
3317
3317
|
)
|
|
@@ -5035,7 +5035,7 @@ const props$$ = {
|
|
|
5035
5035
|
};
|
|
5036
5036
|
const { name: name$$, n: n$16 } = createNamespace("form-details");
|
|
5037
5037
|
const _hoisted_1$t = { key: 0 };
|
|
5038
|
-
const _hoisted_2$
|
|
5038
|
+
const _hoisted_2$d = { key: 0 };
|
|
5039
5039
|
function __render__$15(_ctx, _cache) {
|
|
5040
5040
|
return vue.openBlock(), vue.createBlock(vue.Transition, {
|
|
5041
5041
|
name: _ctx.n()
|
|
@@ -5086,7 +5086,7 @@ function __render__$15(_ctx, _cache) {
|
|
|
5086
5086
|
vue.renderSlot(_ctx.$slots, "extra-message", {}, () => [
|
|
5087
5087
|
_ctx.extraMessage ? (vue.openBlock(), vue.createElementBlock(
|
|
5088
5088
|
"div",
|
|
5089
|
-
_hoisted_2$
|
|
5089
|
+
_hoisted_2$d,
|
|
5090
5090
|
vue.toDisplayString(_ctx.extraMessage),
|
|
5091
5091
|
1
|
|
5092
5092
|
/* TEXT */
|
|
@@ -11714,60 +11714,66 @@ function __render__$R(_ctx, _cache) {
|
|
|
11714
11714
|
6
|
|
11715
11715
|
/* CLASS, STYLE */
|
|
11716
11716
|
),
|
|
11717
|
-
vue.
|
|
11718
|
-
"
|
|
11719
|
-
|
|
11720
|
-
|
|
11721
|
-
|
|
11722
|
-
|
|
11723
|
-
|
|
11724
|
-
|
|
11725
|
-
class: vue.normalizeClass(_ctx.
|
|
11726
|
-
|
|
11727
|
-
|
|
11728
|
-
|
|
11729
|
-
|
|
11730
|
-
|
|
11731
|
-
|
|
11732
|
-
|
|
11733
|
-
|
|
11734
|
-
|
|
11735
|
-
|
|
11736
|
-
|
|
11737
|
-
|
|
11738
|
-
|
|
11739
|
-
|
|
11740
|
-
|
|
11741
|
-
|
|
11742
|
-
|
|
11743
|
-
|
|
11744
|
-
|
|
11745
|
-
|
|
11746
|
-
|
|
11747
|
-
|
|
11748
|
-
|
|
11749
|
-
text: "",
|
|
11750
|
-
|
|
11751
|
-
|
|
11752
|
-
|
|
11753
|
-
|
|
11754
|
-
|
|
11755
|
-
|
|
11756
|
-
|
|
11757
|
-
|
|
11758
|
-
|
|
11759
|
-
|
|
11760
|
-
|
|
11761
|
-
|
|
11762
|
-
|
|
11763
|
-
|
|
11764
|
-
|
|
11765
|
-
|
|
11766
|
-
|
|
11767
|
-
|
|
11768
|
-
|
|
11769
|
-
|
|
11770
|
-
|
|
11717
|
+
vue.renderSlot(_ctx.$slots, "actions", {
|
|
11718
|
+
slotClass: _ctx.n("actions"),
|
|
11719
|
+
cancel: _ctx.cancel,
|
|
11720
|
+
confirm: _ctx.confirm
|
|
11721
|
+
}, () => [
|
|
11722
|
+
vue.createElementVNode(
|
|
11723
|
+
"div",
|
|
11724
|
+
{
|
|
11725
|
+
class: vue.normalizeClass(_ctx.n("actions"))
|
|
11726
|
+
},
|
|
11727
|
+
[
|
|
11728
|
+
_ctx.cancelButton ? (vue.openBlock(), vue.createBlock(_component_var_button, {
|
|
11729
|
+
key: 0,
|
|
11730
|
+
class: vue.normalizeClass(_ctx.classes(_ctx.n("button"), _ctx.n("cancel-button"))),
|
|
11731
|
+
"var-dialog-cover": "",
|
|
11732
|
+
text: "",
|
|
11733
|
+
"text-color": _ctx.cancelButtonTextColor,
|
|
11734
|
+
color: _ctx.cancelButtonColor,
|
|
11735
|
+
onClick: _ctx.cancel
|
|
11736
|
+
}, {
|
|
11737
|
+
default: vue.withCtx(() => {
|
|
11738
|
+
var _a;
|
|
11739
|
+
return [
|
|
11740
|
+
vue.createTextVNode(
|
|
11741
|
+
vue.toDisplayString((_a = _ctx.cancelButtonText) != null ? _a : (_ctx.pt ? _ctx.pt : _ctx.t)("dialogCancelButtonText")),
|
|
11742
|
+
1
|
|
11743
|
+
/* TEXT */
|
|
11744
|
+
)
|
|
11745
|
+
];
|
|
11746
|
+
}),
|
|
11747
|
+
_: 1
|
|
11748
|
+
/* STABLE */
|
|
11749
|
+
}, 8, ["class", "text-color", "color", "onClick"])) : vue.createCommentVNode("v-if", true),
|
|
11750
|
+
_ctx.confirmButton ? (vue.openBlock(), vue.createBlock(_component_var_button, {
|
|
11751
|
+
key: 1,
|
|
11752
|
+
class: vue.normalizeClass(_ctx.classes(_ctx.n("button"), _ctx.n("confirm-button"))),
|
|
11753
|
+
"var-dialog-cover": "",
|
|
11754
|
+
text: "",
|
|
11755
|
+
"text-color": _ctx.confirmButtonTextColor,
|
|
11756
|
+
color: _ctx.confirmButtonColor,
|
|
11757
|
+
onClick: _ctx.confirm
|
|
11758
|
+
}, {
|
|
11759
|
+
default: vue.withCtx(() => {
|
|
11760
|
+
var _a;
|
|
11761
|
+
return [
|
|
11762
|
+
vue.createTextVNode(
|
|
11763
|
+
vue.toDisplayString((_a = _ctx.confirmButtonText) != null ? _a : (_ctx.pt ? _ctx.pt : _ctx.t)("dialogConfirmButtonText")),
|
|
11764
|
+
1
|
|
11765
|
+
/* TEXT */
|
|
11766
|
+
)
|
|
11767
|
+
];
|
|
11768
|
+
}),
|
|
11769
|
+
_: 1
|
|
11770
|
+
/* STABLE */
|
|
11771
|
+
}, 8, ["class", "text-color", "color", "onClick"])) : vue.createCommentVNode("v-if", true)
|
|
11772
|
+
],
|
|
11773
|
+
2
|
|
11774
|
+
/* CLASS */
|
|
11775
|
+
)
|
|
11776
|
+
])
|
|
11771
11777
|
],
|
|
11772
11778
|
16
|
|
11773
11779
|
/* FULL_PROPS */
|
|
@@ -15119,7 +15125,7 @@ const props$G = {
|
|
|
15119
15125
|
};
|
|
15120
15126
|
const { name: name$G, n: n$J, classes: classes$B } = createNamespace("image");
|
|
15121
15127
|
const _hoisted_1$n = ["alt", "title", "referrerpolicy", "lazy-loading", "lazy-error"];
|
|
15122
|
-
const _hoisted_2$
|
|
15128
|
+
const _hoisted_2$c = ["alt", "title", "referrerpolicy", "src"];
|
|
15123
15129
|
function __render__$J(_ctx, _cache) {
|
|
15124
15130
|
var _a;
|
|
15125
15131
|
const _directive_lazy = vue.resolveDirective("lazy");
|
|
@@ -15162,7 +15168,7 @@ function __render__$J(_ctx, _cache) {
|
|
|
15162
15168
|
onLoad: _cache[2] || (_cache[2] = (...args) => _ctx.handleLoad && _ctx.handleLoad(...args)),
|
|
15163
15169
|
onError: _cache[3] || (_cache[3] = (...args) => _ctx.handleError && _ctx.handleError(...args)),
|
|
15164
15170
|
onClick: _cache[4] || (_cache[4] = (...args) => _ctx.handleClick && _ctx.handleClick(...args))
|
|
15165
|
-
}, null, 46, _hoisted_2$
|
|
15171
|
+
}, null, 46, _hoisted_2$c)) : vue.createCommentVNode("v-if", true),
|
|
15166
15172
|
_ctx.showErrorSlot ? vue.renderSlot(_ctx.$slots, "error", { key: 2 }) : vue.createCommentVNode("v-if", true)
|
|
15167
15173
|
],
|
|
15168
15174
|
6
|
|
@@ -15899,7 +15905,7 @@ const ANIMATION_DURATION = 200;
|
|
|
15899
15905
|
const LONG_PRESS_DELAY = 500;
|
|
15900
15906
|
const BASE_RATIO = 1;
|
|
15901
15907
|
const _hoisted_1$k = ["onTouchstart"];
|
|
15902
|
-
const _hoisted_2$
|
|
15908
|
+
const _hoisted_2$b = ["src", "alt"];
|
|
15903
15909
|
function __render__$G(_ctx, _cache) {
|
|
15904
15910
|
const _component_var_swipe_item = vue.resolveComponent("var-swipe-item");
|
|
15905
15911
|
const _component_var_swipe = vue.resolveComponent("var-swipe");
|
|
@@ -15962,7 +15968,7 @@ function __render__$G(_ctx, _cache) {
|
|
|
15962
15968
|
class: vue.normalizeClass(_ctx.classes(_ctx.n("image"), [_ctx.isPreventDefault, _ctx.n("--prevent")])),
|
|
15963
15969
|
src: image,
|
|
15964
15970
|
alt: image
|
|
15965
|
-
}, null, 10, _hoisted_2$
|
|
15971
|
+
}, null, 10, _hoisted_2$b)
|
|
15966
15972
|
], 46, _hoisted_1$k)
|
|
15967
15973
|
]),
|
|
15968
15974
|
_: 2
|
|
@@ -16688,7 +16694,7 @@ const props$B = __spreadValues$a({
|
|
|
16688
16694
|
]));
|
|
16689
16695
|
const { name: name$A, n: n$D, classes: classes$w } = createNamespace("input");
|
|
16690
16696
|
const _hoisted_1$i = ["placeholder", "enterkeyhint"];
|
|
16691
|
-
const _hoisted_2$
|
|
16697
|
+
const _hoisted_2$a = ["id", "disabled", "readonly", "type", "value", "placeholder", "maxlength", "rows", "enterkeyhint", "inputmode"];
|
|
16692
16698
|
const _hoisted_3$a = ["id", "disabled", "readonly", "type", "value", "placeholder", "maxlength", "enterkeyhint", "inputmode"];
|
|
16693
16699
|
function __render__$D(_ctx, _cache) {
|
|
16694
16700
|
const _component_var_field_decorator = vue.resolveComponent("var-field-decorator");
|
|
@@ -16777,7 +16783,7 @@ function __render__$D(_ctx, _cache) {
|
|
|
16777
16783
|
onChange: _cache[3] || (_cache[3] = (...args) => _ctx.handleChange && _ctx.handleChange(...args)),
|
|
16778
16784
|
onCompositionstart: _cache[4] || (_cache[4] = (...args) => _ctx.handleCompositionStart && _ctx.handleCompositionStart(...args)),
|
|
16779
16785
|
onCompositionend: _cache[5] || (_cache[5] = (...args) => _ctx.handleCompositionEnd && _ctx.handleCompositionEnd(...args))
|
|
16780
|
-
}, null, 46, _hoisted_2$
|
|
16786
|
+
}, null, 46, _hoisted_2$a)) : (vue.openBlock(), vue.createElementBlock("input", {
|
|
16781
16787
|
key: 2,
|
|
16782
16788
|
class: vue.normalizeClass(
|
|
16783
16789
|
_ctx.classes(
|
|
@@ -18197,12 +18203,15 @@ function useSelect() {
|
|
|
18197
18203
|
const props$s = {
|
|
18198
18204
|
label: {},
|
|
18199
18205
|
value: {},
|
|
18200
|
-
disabled: Boolean
|
|
18206
|
+
disabled: Boolean,
|
|
18207
|
+
// internal
|
|
18208
|
+
option: Object
|
|
18201
18209
|
};
|
|
18202
18210
|
const { name: name$s, n: n$v, classes: classes$p } = createNamespace("option");
|
|
18203
18211
|
const _hoisted_1$g = ["tabindex"];
|
|
18204
18212
|
function __render__$x(_ctx, _cache) {
|
|
18205
18213
|
const _component_var_checkbox = vue.resolveComponent("var-checkbox");
|
|
18214
|
+
const _component_maybe_v_node = vue.resolveComponent("maybe-v-node");
|
|
18206
18215
|
const _component_var_hover_overlay = vue.resolveComponent("var-hover-overlay");
|
|
18207
18216
|
const _directive_ripple = vue.resolveDirective("ripple");
|
|
18208
18217
|
const _directive_hover = vue.resolveDirective("hover");
|
|
@@ -18246,9 +18255,11 @@ function __render__$x(_ctx, _cache) {
|
|
|
18246
18255
|
{
|
|
18247
18256
|
class: vue.normalizeClass(_ctx.classes(_ctx.n("text"), _ctx.n("$--ellipsis")))
|
|
18248
18257
|
},
|
|
18249
|
-
|
|
18250
|
-
|
|
18251
|
-
|
|
18258
|
+
[
|
|
18259
|
+
vue.createVNode(_component_maybe_v_node, { is: _ctx.labelVNode }, null, 8, ["is"])
|
|
18260
|
+
],
|
|
18261
|
+
2
|
|
18262
|
+
/* CLASS */
|
|
18252
18263
|
)
|
|
18253
18264
|
]),
|
|
18254
18265
|
vue.createVNode(_component_var_hover_overlay, {
|
|
@@ -18265,7 +18276,8 @@ const __sfc__$y = vue.defineComponent({
|
|
|
18265
18276
|
directives: { Ripple: stdin_default$5W, Hover: stdin_default$5P },
|
|
18266
18277
|
components: {
|
|
18267
18278
|
VarCheckbox: stdin_default$59,
|
|
18268
|
-
VarHoverOverlay: stdin_default$5Q
|
|
18279
|
+
VarHoverOverlay: stdin_default$5Q,
|
|
18280
|
+
MaybeVNode
|
|
18269
18281
|
},
|
|
18270
18282
|
props: props$s,
|
|
18271
18283
|
setup(props2) {
|
|
@@ -18273,13 +18285,25 @@ const __sfc__$y = vue.defineComponent({
|
|
|
18273
18285
|
const isFocusing = vue.ref(false);
|
|
18274
18286
|
const optionSelected = vue.ref(false);
|
|
18275
18287
|
const selected = vue.computed(() => optionSelected.value);
|
|
18276
|
-
const
|
|
18288
|
+
const labelVNode = vue.computed(
|
|
18289
|
+
() => {
|
|
18290
|
+
var _a;
|
|
18291
|
+
return isFunction(props2.label) ? props2.label(
|
|
18292
|
+
(_a = props2.option) != null ? _a : {
|
|
18293
|
+
label: props2.label,
|
|
18294
|
+
value: props2.value,
|
|
18295
|
+
disabled: props2.disabled
|
|
18296
|
+
},
|
|
18297
|
+
optionSelected.value
|
|
18298
|
+
) : props2.label;
|
|
18299
|
+
}
|
|
18300
|
+
);
|
|
18277
18301
|
const value = vue.computed(() => props2.value);
|
|
18278
18302
|
const { select, bindSelect } = useSelect();
|
|
18279
18303
|
const { multiple, focusColor, onSelect, computeLabel } = select;
|
|
18280
18304
|
const { hovering, handleHovering } = useHoverOverlay();
|
|
18281
18305
|
const optionProvider = {
|
|
18282
|
-
label,
|
|
18306
|
+
label: labelVNode,
|
|
18283
18307
|
value,
|
|
18284
18308
|
selected,
|
|
18285
18309
|
sync
|
|
@@ -18330,6 +18354,7 @@ const __sfc__$y = vue.defineComponent({
|
|
|
18330
18354
|
focusColor,
|
|
18331
18355
|
hovering,
|
|
18332
18356
|
isFocusing,
|
|
18357
|
+
labelVNode,
|
|
18333
18358
|
n: n$v,
|
|
18334
18359
|
classes: classes$p,
|
|
18335
18360
|
handleHovering,
|
|
@@ -19027,7 +19052,7 @@ const TRANSITION_DURATION = 200;
|
|
|
19027
19052
|
const MOMENTUM_TRANSITION_DURATION = 1e3;
|
|
19028
19053
|
let sid$1 = 0;
|
|
19029
19054
|
const _hoisted_1$e = ["onTouchstartPassive", "onTouchmove", "onTouchend"];
|
|
19030
|
-
const _hoisted_2$
|
|
19055
|
+
const _hoisted_2$9 = ["onTransitionend"];
|
|
19031
19056
|
const _hoisted_3$9 = ["onClick"];
|
|
19032
19057
|
function __render__$u(_ctx, _cache) {
|
|
19033
19058
|
const _component_var_button = vue.resolveComponent("var-button");
|
|
@@ -19183,7 +19208,7 @@ function __render__$u(_ctx, _cache) {
|
|
|
19183
19208
|
128
|
|
19184
19209
|
/* KEYED_FRAGMENT */
|
|
19185
19210
|
))
|
|
19186
|
-
], 46, _hoisted_2$
|
|
19211
|
+
], 46, _hoisted_2$9)
|
|
19187
19212
|
], 42, _hoisted_1$e);
|
|
19188
19213
|
}),
|
|
19189
19214
|
128
|
|
@@ -19619,7 +19644,7 @@ const RADIUS = 20;
|
|
|
19619
19644
|
const CIRCUMFERENCE = 2 * Math.PI * RADIUS;
|
|
19620
19645
|
const { name: name$n, n: n$q, classes: classes$l } = createNamespace("progress");
|
|
19621
19646
|
const _hoisted_1$d = ["aria-valuenow"];
|
|
19622
|
-
const _hoisted_2$
|
|
19647
|
+
const _hoisted_2$8 = ["viewBox"];
|
|
19623
19648
|
const _hoisted_3$8 = { key: 0 };
|
|
19624
19649
|
const _hoisted_4$3 = ["id"];
|
|
19625
19650
|
const _hoisted_5$1 = ["offset", "stop-color"];
|
|
@@ -19773,7 +19798,7 @@ function __render__$t(_ctx, _cache) {
|
|
|
19773
19798
|
transformOrigin: "50% 50%"
|
|
19774
19799
|
})
|
|
19775
19800
|
}, null, 14, _hoisted_7)
|
|
19776
|
-
], 10, _hoisted_2$
|
|
19801
|
+
], 10, _hoisted_2$8)),
|
|
19777
19802
|
_ctx.label ? (vue.openBlock(), vue.createElementBlock(
|
|
19778
19803
|
"div",
|
|
19779
19804
|
{
|
|
@@ -20796,7 +20821,7 @@ const _hoisted_1$a = {
|
|
|
20796
20821
|
xmlns: "http://www.w3.org/2000/svg",
|
|
20797
20822
|
viewBox: "2 3.6 20 20"
|
|
20798
20823
|
};
|
|
20799
|
-
const _hoisted_2$
|
|
20824
|
+
const _hoisted_2$7 = /* @__PURE__ */ _withScopeId$5(() => /* @__PURE__ */ vue.createElementVNode(
|
|
20800
20825
|
"path",
|
|
20801
20826
|
{ d: "M11,9H13V7H11M11,20H13V11H11V20Z" },
|
|
20802
20827
|
null,
|
|
@@ -20804,7 +20829,7 @@ const _hoisted_2$8 = /* @__PURE__ */ _withScopeId$5(() => /* @__PURE__ */ vue.cr
|
|
|
20804
20829
|
/* HOISTED */
|
|
20805
20830
|
));
|
|
20806
20831
|
const _hoisted_3$7 = [
|
|
20807
|
-
_hoisted_2$
|
|
20832
|
+
_hoisted_2$7
|
|
20808
20833
|
];
|
|
20809
20834
|
function __render__$o(_ctx, _cache) {
|
|
20810
20835
|
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$a, [..._hoisted_3$7]);
|
|
@@ -20817,7 +20842,7 @@ const _hoisted_1$9 = {
|
|
|
20817
20842
|
xmlns: "http://www.w3.org/2000/svg",
|
|
20818
20843
|
viewBox: "2 2 20 20"
|
|
20819
20844
|
};
|
|
20820
|
-
const _hoisted_2$
|
|
20845
|
+
const _hoisted_2$6 = /* @__PURE__ */ _withScopeId$4(() => /* @__PURE__ */ vue.createElementVNode(
|
|
20821
20846
|
"path",
|
|
20822
20847
|
{ d: "M19,3V5H19V19M17,8.4L13.4,12L17,15.6L15.6,17L12,13.4L8.4,17L7,15.6L10.6,12L7,8.4L8.4,7L12,10.6L15.6,7L17,8.4Z" },
|
|
20823
20848
|
null,
|
|
@@ -20825,7 +20850,7 @@ const _hoisted_2$7 = /* @__PURE__ */ _withScopeId$4(() => /* @__PURE__ */ vue.cr
|
|
|
20825
20850
|
/* HOISTED */
|
|
20826
20851
|
));
|
|
20827
20852
|
const _hoisted_3$6 = [
|
|
20828
|
-
_hoisted_2$
|
|
20853
|
+
_hoisted_2$6
|
|
20829
20854
|
];
|
|
20830
20855
|
function __render__$n(_ctx, _cache) {
|
|
20831
20856
|
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$9, [..._hoisted_3$6]);
|
|
@@ -20838,7 +20863,7 @@ const _hoisted_1$8 = {
|
|
|
20838
20863
|
xmlns: "http://www.w3.org/2000/svg",
|
|
20839
20864
|
viewBox: "-6 -4 35 35"
|
|
20840
20865
|
};
|
|
20841
|
-
const _hoisted_2$
|
|
20866
|
+
const _hoisted_2$5 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ vue.createElementVNode(
|
|
20842
20867
|
"path",
|
|
20843
20868
|
{ d: "M10,21H14A2,2 0 0,1 12,23A2,2 0 0,1 10,21M21,19V20H3V19L5,17V11C5,7.9 7.03,5.17 10,4.29C10,4.19 10,4.1 10,4A2,2 0 0,1 12,2A2,2 0 0,1 14,4C14,4.1 14,4.19 14,4.29C16.97,5.17 19,7.9 19,11V17L21,19M17,11A5,5 0 0,0 12,6A5,5 0 0,0 7,11V18H17V11M19.75,3.19L18.33,4.61M1,11" },
|
|
20844
20869
|
null,
|
|
@@ -20846,7 +20871,7 @@ const _hoisted_2$6 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ vue.cr
|
|
|
20846
20871
|
/* HOISTED */
|
|
20847
20872
|
));
|
|
20848
20873
|
const _hoisted_3$5 = [
|
|
20849
|
-
_hoisted_2$
|
|
20874
|
+
_hoisted_2$5
|
|
20850
20875
|
];
|
|
20851
20876
|
function __render__$m(_ctx, _cache) {
|
|
20852
20877
|
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$8, [..._hoisted_3$5]);
|
|
@@ -20955,7 +20980,7 @@ const _hoisted_1$7 = {
|
|
|
20955
20980
|
xmlns: "http://www.w3.org/2000/svg",
|
|
20956
20981
|
viewBox: "-3 -3 30 30"
|
|
20957
20982
|
};
|
|
20958
|
-
const _hoisted_2$
|
|
20983
|
+
const _hoisted_2$4 = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ vue.createElementVNode(
|
|
20959
20984
|
"path",
|
|
20960
20985
|
{ d: "M10,19H13V22H10V19M12,2C17.35,2.22 19.68,7.62 16.5,11.67C15.67,12.67 14.33,13.33 13.67,14.17C13,15 13,16 13,17H10C10,15.33 10,13.92 10.67,12.92C11.33,11.92 12.67,11.33 13.5,10.67C15.92,8.43 15.32,5.26 12,5A3,3 0 0,0 9,8H6A6,6 0 0,1 12,2Z" },
|
|
20961
20986
|
null,
|
|
@@ -20963,7 +20988,7 @@ const _hoisted_2$5 = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ vue.cr
|
|
|
20963
20988
|
/* HOISTED */
|
|
20964
20989
|
));
|
|
20965
20990
|
const _hoisted_3$4 = [
|
|
20966
|
-
_hoisted_2$
|
|
20991
|
+
_hoisted_2$4
|
|
20967
20992
|
];
|
|
20968
20993
|
function __render__$k(_ctx, _cache) {
|
|
20969
20994
|
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$7, [..._hoisted_3$4]);
|
|
@@ -20973,7 +20998,7 @@ __sfc__$l.render = __render__$k;
|
|
|
20973
20998
|
var stdin_default$3G = __sfc__$l;
|
|
20974
20999
|
const _withScopeId$1 = (n2) => (vue.pushScopeId(""), n2 = n2(), vue.popScopeId(), n2);
|
|
20975
21000
|
const _hoisted_1$6 = { viewBox: "-4 -4 32 32" };
|
|
20976
|
-
const _hoisted_2$
|
|
21001
|
+
const _hoisted_2$3 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ vue.createElementVNode(
|
|
20977
21002
|
"path",
|
|
20978
21003
|
{
|
|
20979
21004
|
fill: "currentColor",
|
|
@@ -20984,7 +21009,7 @@ const _hoisted_2$4 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ vue.cr
|
|
|
20984
21009
|
/* HOISTED */
|
|
20985
21010
|
));
|
|
20986
21011
|
const _hoisted_3$3 = [
|
|
20987
|
-
_hoisted_2$
|
|
21012
|
+
_hoisted_2$3
|
|
20988
21013
|
];
|
|
20989
21014
|
function __render__$j(_ctx, _cache) {
|
|
20990
21015
|
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$6, [..._hoisted_3$3]);
|
|
@@ -21210,6 +21235,15 @@ const props$g = __spreadValues$6({
|
|
|
21210
21235
|
type: [String, Number, Boolean, Array],
|
|
21211
21236
|
default: void 0
|
|
21212
21237
|
},
|
|
21238
|
+
options: Array,
|
|
21239
|
+
labelKey: {
|
|
21240
|
+
type: String,
|
|
21241
|
+
default: "label"
|
|
21242
|
+
},
|
|
21243
|
+
valueKey: {
|
|
21244
|
+
type: String,
|
|
21245
|
+
default: "value"
|
|
21246
|
+
},
|
|
21213
21247
|
multiple: Boolean,
|
|
21214
21248
|
offsetY: {
|
|
21215
21249
|
type: [String, Number],
|
|
@@ -21251,11 +21285,12 @@ const props$g = __spreadValues$6({
|
|
|
21251
21285
|
]));
|
|
21252
21286
|
const { name: name$g, n: n$i, classes: classes$e } = createNamespace("select");
|
|
21253
21287
|
const _hoisted_1$5 = ["tabindex"];
|
|
21254
|
-
const _hoisted_2$3 = { key: 1 };
|
|
21255
21288
|
function __render__$g(_ctx, _cache) {
|
|
21289
|
+
const _component_maybe_v_node = vue.resolveComponent("maybe-v-node");
|
|
21256
21290
|
const _component_var_chip = vue.resolveComponent("var-chip");
|
|
21257
21291
|
const _component_var_icon = vue.resolveComponent("var-icon");
|
|
21258
21292
|
const _component_var_field_decorator = vue.resolveComponent("var-field-decorator");
|
|
21293
|
+
const _component_var_option = vue.resolveComponent("var-option");
|
|
21259
21294
|
const _component_var_menu = vue.resolveComponent("var-menu");
|
|
21260
21295
|
const _component_var_form_details = vue.resolveComponent("var-form-details");
|
|
21261
21296
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
@@ -21288,6 +21323,21 @@ function __render__$g(_ctx, _cache) {
|
|
|
21288
21323
|
class: vue.normalizeClass(_ctx.classes(_ctx.n("scroller"), _ctx.n("$-elevation--3")))
|
|
21289
21324
|
},
|
|
21290
21325
|
[
|
|
21326
|
+
_ctx.selectOptions.length ? (vue.openBlock(true), vue.createElementBlock(
|
|
21327
|
+
vue.Fragment,
|
|
21328
|
+
{ key: 0 },
|
|
21329
|
+
vue.renderList(_ctx.selectOptions, (option) => {
|
|
21330
|
+
return vue.openBlock(), vue.createBlock(_component_var_option, {
|
|
21331
|
+
key: option[_ctx.valueKey],
|
|
21332
|
+
label: option[_ctx.labelKey],
|
|
21333
|
+
value: option[_ctx.valueKey],
|
|
21334
|
+
option,
|
|
21335
|
+
disabled: option.disabled
|
|
21336
|
+
}, null, 8, ["label", "value", "option", "disabled"]);
|
|
21337
|
+
}),
|
|
21338
|
+
128
|
|
21339
|
+
/* KEYED_FRAGMENT */
|
|
21340
|
+
)) : vue.createCommentVNode("v-if", true),
|
|
21291
21341
|
vue.renderSlot(_ctx.$slots, "default")
|
|
21292
21342
|
],
|
|
21293
21343
|
2
|
|
@@ -21368,11 +21418,7 @@ function __render__$g(_ctx, _cache) {
|
|
|
21368
21418
|
onClose: () => _ctx.handleClose(l)
|
|
21369
21419
|
}, {
|
|
21370
21420
|
default: vue.withCtx(() => [
|
|
21371
|
-
vue.
|
|
21372
|
-
vue.toDisplayString(l),
|
|
21373
|
-
1
|
|
21374
|
-
/* TEXT */
|
|
21375
|
-
)
|
|
21421
|
+
vue.createVNode(_component_maybe_v_node, { is: l }, null, 8, ["is"])
|
|
21376
21422
|
]),
|
|
21377
21423
|
_: 2
|
|
21378
21424
|
/* DYNAMIC */
|
|
@@ -21390,20 +21436,40 @@ function __render__$g(_ctx, _cache) {
|
|
|
21390
21436
|
key: 1,
|
|
21391
21437
|
class: vue.normalizeClass(_ctx.n("values"))
|
|
21392
21438
|
},
|
|
21393
|
-
|
|
21394
|
-
|
|
21395
|
-
|
|
21439
|
+
[
|
|
21440
|
+
(vue.openBlock(true), vue.createElementBlock(
|
|
21441
|
+
vue.Fragment,
|
|
21442
|
+
null,
|
|
21443
|
+
vue.renderList(_ctx.labels, (l, labelIndex) => {
|
|
21444
|
+
return vue.openBlock(), vue.createElementBlock(
|
|
21445
|
+
vue.Fragment,
|
|
21446
|
+
{ key: l },
|
|
21447
|
+
[
|
|
21448
|
+
vue.createVNode(_component_maybe_v_node, { is: l }, null, 8, ["is"]),
|
|
21449
|
+
vue.createTextVNode(
|
|
21450
|
+
vue.toDisplayString(labelIndex !== _ctx.labels.length - 1 ? _ctx.separator : ""),
|
|
21451
|
+
1
|
|
21452
|
+
/* TEXT */
|
|
21453
|
+
)
|
|
21454
|
+
],
|
|
21455
|
+
64
|
|
21456
|
+
/* STABLE_FRAGMENT */
|
|
21457
|
+
);
|
|
21458
|
+
}),
|
|
21459
|
+
128
|
|
21460
|
+
/* KEYED_FRAGMENT */
|
|
21461
|
+
))
|
|
21462
|
+
],
|
|
21463
|
+
2
|
|
21464
|
+
/* CLASS */
|
|
21396
21465
|
))
|
|
21397
21466
|
],
|
|
21398
21467
|
64
|
|
21399
21468
|
/* STABLE_FRAGMENT */
|
|
21400
|
-
)) : (vue.openBlock(), vue.
|
|
21401
|
-
|
|
21402
|
-
|
|
21403
|
-
|
|
21404
|
-
1
|
|
21405
|
-
/* TEXT */
|
|
21406
|
-
))
|
|
21469
|
+
)) : (vue.openBlock(), vue.createBlock(_component_maybe_v_node, {
|
|
21470
|
+
key: 1,
|
|
21471
|
+
is: _ctx.label
|
|
21472
|
+
}, null, 8, ["is"]))
|
|
21407
21473
|
]) : vue.createCommentVNode("v-if", true)
|
|
21408
21474
|
],
|
|
21409
21475
|
2
|
|
@@ -21469,8 +21535,10 @@ const __sfc__$h = vue.defineComponent({
|
|
|
21469
21535
|
VarIcon: stdin_default$5S,
|
|
21470
21536
|
VarMenu: stdin_default$47,
|
|
21471
21537
|
VarChip: stdin_default$55,
|
|
21538
|
+
VarOption: stdin_default$41,
|
|
21472
21539
|
VarFieldDecorator: stdin_default$4z,
|
|
21473
|
-
VarFormDetails: stdin_default$5b
|
|
21540
|
+
VarFormDetails: stdin_default$5b,
|
|
21541
|
+
MaybeVNode
|
|
21474
21542
|
},
|
|
21475
21543
|
props: props$g,
|
|
21476
21544
|
setup(props2) {
|
|
@@ -21481,6 +21549,7 @@ const __sfc__$h = vue.defineComponent({
|
|
|
21481
21549
|
const focusColor = vue.computed(() => props2.focusColor);
|
|
21482
21550
|
const isEmptyModelValue = vue.computed(() => isEmpty(props2.modelValue));
|
|
21483
21551
|
const cursor = vue.computed(() => props2.disabled || props2.readonly ? "" : "pointer");
|
|
21552
|
+
const selectOptions = vue.computed(() => isArray(props2.options) ? props2.options : []);
|
|
21484
21553
|
const offsetY = vue.ref(0);
|
|
21485
21554
|
const { bindForm, form } = useForm();
|
|
21486
21555
|
const { length, options, bindOptions } = useOptions();
|
|
@@ -21696,6 +21765,8 @@ const __sfc__$h = vue.defineComponent({
|
|
|
21696
21765
|
cursor,
|
|
21697
21766
|
placeholderColor,
|
|
21698
21767
|
enableCustomPlaceholder,
|
|
21768
|
+
selectOptions,
|
|
21769
|
+
isFunction,
|
|
21699
21770
|
n: n$i,
|
|
21700
21771
|
classes: classes$e,
|
|
21701
21772
|
handleFocus,
|
|
@@ -28863,7 +28934,7 @@ withInstall(stdin_default$1);
|
|
|
28863
28934
|
withPropsDefaultsSetter(stdin_default$1, props);
|
|
28864
28935
|
const _WatermarkComponent = stdin_default$1;
|
|
28865
28936
|
var stdin_default = stdin_default$1;
|
|
28866
|
-
const version = "3.3.
|
|
28937
|
+
const version = "3.3.4";
|
|
28867
28938
|
function install(app) {
|
|
28868
28939
|
stdin_default$5G.install && app.use(stdin_default$5G);
|
|
28869
28940
|
stdin_default$5E.install && app.use(stdin_default$5E);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@varlet/ui",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.4",
|
|
4
4
|
"description": "A material like components library",
|
|
5
5
|
"main": "lib/varlet.cjs.js",
|
|
6
6
|
"module": "es/index.mjs",
|
|
@@ -48,9 +48,9 @@
|
|
|
48
48
|
"@popperjs/core": "^2.11.6",
|
|
49
49
|
"dayjs": "^1.10.4",
|
|
50
50
|
"decimal.js": "^10.2.1",
|
|
51
|
-
"@varlet/icons": "3.3.
|
|
52
|
-
"@varlet/shared": "3.3.
|
|
53
|
-
"@varlet/use": "3.3.
|
|
51
|
+
"@varlet/icons": "3.3.4",
|
|
52
|
+
"@varlet/shared": "3.3.4",
|
|
53
|
+
"@varlet/use": "3.3.4"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@vue/runtime-core": "3.4.21",
|
|
@@ -64,9 +64,9 @@
|
|
|
64
64
|
"typescript": "^5.1.5",
|
|
65
65
|
"vue": "3.4.21",
|
|
66
66
|
"vue-router": "4.2.0",
|
|
67
|
-
"@varlet/
|
|
68
|
-
"@varlet/
|
|
69
|
-
"@varlet/touch-emulator": "3.3.
|
|
67
|
+
"@varlet/ui": "3.3.4",
|
|
68
|
+
"@varlet/cli": "3.3.4",
|
|
69
|
+
"@varlet/touch-emulator": "3.3.4"
|
|
70
70
|
},
|
|
71
71
|
"scripts": {
|
|
72
72
|
"dev": "varlet-cli dev",
|
package/types/dialog.d.ts
CHANGED
|
@@ -40,12 +40,19 @@ export interface DialogProps extends BasicAttributes {
|
|
|
40
40
|
'onUpdate:show'?: ListenerProp<(show: boolean) => void>
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
+
export interface DialogActionsData {
|
|
44
|
+
slotClass: string
|
|
45
|
+
cancel: () => void
|
|
46
|
+
confirm: () => void
|
|
47
|
+
}
|
|
48
|
+
|
|
43
49
|
export class DialogComponent extends VarComponent {
|
|
44
50
|
$props: DialogProps
|
|
45
51
|
|
|
46
52
|
$slots: {
|
|
47
53
|
default(): VNode[]
|
|
48
54
|
title(): VNode[]
|
|
55
|
+
actions(data: DialogActionsData): VNode[]
|
|
49
56
|
}
|
|
50
57
|
}
|
|
51
58
|
|