@varlet/ui 3.3.9 → 3.3.11
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/action-sheet/style/index.mjs +1 -1
- package/es/index.bundle.mjs +1 -1
- package/es/index.mjs +1 -1
- package/es/picker/Picker.mjs +10 -6
- package/es/picker/props.mjs +1 -0
- package/es/popup/Popup.mjs +8 -4
- package/es/popup/props.mjs +1 -0
- package/es/snackbar/style/index.mjs +1 -1
- package/es/varlet.esm.js +3703 -3696
- package/highlight/web-types.en-US.json +20 -2
- package/highlight/web-types.zh-CN.json +19 -1
- package/lib/varlet.cjs.js +20 -10
- package/package.json +7 -7
- package/types/picker.d.ts +2 -0
- package/types/popup.d.ts +1 -0
- package/umd/varlet.js +6 -6
package/es/index.bundle.mjs
CHANGED
|
@@ -265,7 +265,7 @@ import './tooltip/style/index.mjs'
|
|
|
265
265
|
import './uploader/style/index.mjs'
|
|
266
266
|
import './watermark/style/index.mjs'
|
|
267
267
|
|
|
268
|
-
const version = '3.3.
|
|
268
|
+
const version = '3.3.11'
|
|
269
269
|
|
|
270
270
|
function install(app) {
|
|
271
271
|
ActionSheet.install && app.use(ActionSheet)
|
package/es/index.mjs
CHANGED
|
@@ -176,7 +176,7 @@ export * from './tooltip/index.mjs'
|
|
|
176
176
|
export * from './uploader/index.mjs'
|
|
177
177
|
export * from './watermark/index.mjs'
|
|
178
178
|
|
|
179
|
-
const version = '3.3.
|
|
179
|
+
const version = '3.3.11'
|
|
180
180
|
|
|
181
181
|
function install(app) {
|
|
182
182
|
ActionSheet.install && app.use(ActionSheet)
|
package/es/picker/Picker.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import VarPopup from "../popup/index.mjs";
|
|
|
3
3
|
import { defineComponent, watch, ref, computed, Transition } from "vue";
|
|
4
4
|
import { props } from "./props.mjs";
|
|
5
5
|
import { useTouch, useVModel } from "@varlet/use";
|
|
6
|
-
import { clamp, clampArrayRange, call } from "@varlet/shared";
|
|
6
|
+
import { clamp, clampArrayRange, call, toNumber } from "@varlet/shared";
|
|
7
7
|
import { toPxNum, getTranslateY } from "../utils/elements.mjs";
|
|
8
8
|
import { t } from "../locale/index.mjs";
|
|
9
9
|
import { createNamespace } from "../utils/components.mjs";
|
|
@@ -229,6 +229,7 @@ const __sfc__ = defineComponent({
|
|
|
229
229
|
setup(props2) {
|
|
230
230
|
const modelValue = useVModel(props2, "modelValue");
|
|
231
231
|
const scrollColumns = ref([]);
|
|
232
|
+
const visibleColumnsCount = computed(() => toNumber(props2.columnsCount));
|
|
232
233
|
const optionHeight = computed(() => toPxNum(props2.optionHeight));
|
|
233
234
|
const optionCount = computed(() => toPxNum(props2.optionCount));
|
|
234
235
|
const center = computed(() => optionCount.value * optionHeight.value / 2 - optionHeight.value / 2);
|
|
@@ -255,7 +256,8 @@ const __sfc__ = defineComponent({
|
|
|
255
256
|
prevIndexes = [...indexes];
|
|
256
257
|
}
|
|
257
258
|
function normalizeNormalMode(columns) {
|
|
258
|
-
|
|
259
|
+
const visibleColumns = props2.columnsCount != null ? columns.slice(0, visibleColumnsCount.value) : columns;
|
|
260
|
+
return visibleColumns.map((column, idx) => {
|
|
259
261
|
const scrollColumn = {
|
|
260
262
|
id: sid++,
|
|
261
263
|
prevY: 0,
|
|
@@ -281,9 +283,9 @@ const __sfc__ = defineComponent({
|
|
|
281
283
|
createChildren(scrollColumns2, column);
|
|
282
284
|
return scrollColumns2;
|
|
283
285
|
}
|
|
284
|
-
function createChildren(scrollColumns2, children, syncModelValue = true) {
|
|
286
|
+
function createChildren(scrollColumns2, children, syncModelValue = true, depth = 1) {
|
|
285
287
|
var _a;
|
|
286
|
-
if (children.length) {
|
|
288
|
+
if (children.length && (props2.columnsCount == null || depth <= visibleColumnsCount.value)) {
|
|
287
289
|
const scrollColumn = {
|
|
288
290
|
id: sid++,
|
|
289
291
|
prevY: 0,
|
|
@@ -307,7 +309,8 @@ const __sfc__ = defineComponent({
|
|
|
307
309
|
createChildren(
|
|
308
310
|
scrollColumns2,
|
|
309
311
|
(_a = scrollColumn.column[scrollColumn.index][getOptionKey("children")]) != null ? _a : [],
|
|
310
|
-
syncModelValue
|
|
312
|
+
syncModelValue,
|
|
313
|
+
depth + 1
|
|
311
314
|
);
|
|
312
315
|
}
|
|
313
316
|
}
|
|
@@ -317,7 +320,8 @@ const __sfc__ = defineComponent({
|
|
|
317
320
|
createChildren(
|
|
318
321
|
scrollColumns.value,
|
|
319
322
|
(_a = scrollColumn.column[scrollColumn.index][getOptionKey("children")]) != null ? _a : [],
|
|
320
|
-
false
|
|
323
|
+
false,
|
|
324
|
+
scrollColumns.value.length + 1
|
|
321
325
|
);
|
|
322
326
|
}
|
|
323
327
|
function initScrollColumns() {
|
package/es/picker/props.mjs
CHANGED
package/es/popup/Popup.mjs
CHANGED
|
@@ -43,9 +43,13 @@ var stdin_default = defineComponent({
|
|
|
43
43
|
const {
|
|
44
44
|
zIndex
|
|
45
45
|
} = useZIndex(() => props2.show, 3);
|
|
46
|
+
const normalizedZIndex = computed(() => {
|
|
47
|
+
var _a;
|
|
48
|
+
return (_a = props2.zIndex) != null ? _a : zIndex.value;
|
|
49
|
+
});
|
|
46
50
|
const {
|
|
47
51
|
onStackTop
|
|
48
|
-
} = useStack(() => props2.show,
|
|
52
|
+
} = useStack(() => props2.show, normalizedZIndex);
|
|
49
53
|
const {
|
|
50
54
|
disabled
|
|
51
55
|
} = useTeleport();
|
|
@@ -80,7 +84,7 @@ var stdin_default = defineComponent({
|
|
|
80
84
|
return _createVNode("div", {
|
|
81
85
|
"class": classes(n("overlay"), overlayClass),
|
|
82
86
|
"style": __spreadValues({
|
|
83
|
-
zIndex:
|
|
87
|
+
zIndex: normalizedZIndex.value - 1
|
|
84
88
|
}, overlayStyle),
|
|
85
89
|
"onClick": hidePopup
|
|
86
90
|
}, null);
|
|
@@ -89,7 +93,7 @@ var stdin_default = defineComponent({
|
|
|
89
93
|
return _withDirectives(_createVNode("div", _mergeProps({
|
|
90
94
|
"class": classes(n("content"), n(`--${props2.position}`), [props2.defaultStyle, n("--content-background-color")], [props2.defaultStyle, n("$-elevation--3")], [props2.safeArea, n("--safe-area")], [props2.safeAreaTop, n("--safe-area-top")]),
|
|
91
95
|
"style": {
|
|
92
|
-
zIndex:
|
|
96
|
+
zIndex: normalizedZIndex.value
|
|
93
97
|
},
|
|
94
98
|
"role": "dialog",
|
|
95
99
|
"aria-modal": "true"
|
|
@@ -104,7 +108,7 @@ var stdin_default = defineComponent({
|
|
|
104
108
|
default: () => [_withDirectives(_createVNode("div", {
|
|
105
109
|
"class": classes(n("$--box"), n(), [!props2.overlay, n("--pointer-events-none")]),
|
|
106
110
|
"style": {
|
|
107
|
-
zIndex:
|
|
111
|
+
zIndex: normalizedZIndex.value - 2
|
|
108
112
|
}
|
|
109
113
|
}, [props2.overlay && renderOverlay(), _createVNode(Transition, {
|
|
110
114
|
"name": props2.transition || n(`$-pop-${props2.position}`)
|
package/es/popup/props.mjs
CHANGED