@varlet/ui 2.21.0 → 2.22.0-alpha.1705845515578
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/index-bar/IndexBar.mjs +10 -2
- package/es/index.bundle.mjs +1 -1
- package/es/index.mjs +1 -1
- package/es/locale/fa-IR.d.ts +5 -0
- package/es/locale/fa-IR.mjs +108 -0
- package/es/locale/index.mjs +2 -0
- package/es/picker/Picker.mjs +27 -34
- package/es/popup/Popup.mjs +1 -1
- package/es/popup/popup.css +1 -1
- package/es/snackbar/Snackbar.mjs +21 -18
- package/es/snackbar/core.mjs +18 -16
- package/es/snackbar/props.mjs +1 -3
- package/es/snackbar/snackbar.css +1 -1
- package/es/snackbar/style/index.mjs +1 -2
- package/es/style.css +1 -1
- package/es/switch/Switch.mjs +18 -6
- package/es/switch/props.mjs +6 -0
- package/es/varlet.esm.js +4241 -4112
- package/highlight/web-types.en-US.json +39 -8
- package/highlight/web-types.zh-CN.json +40 -9
- package/lib/style.css +1 -1
- package/lib/varlet.cjs.js +299 -171
- package/package.json +7 -7
- package/types/form.d.ts +1 -1
- package/types/indexBar.d.ts +1 -0
- package/types/rate.d.ts +1 -1
- package/types/styleVars.d.ts +2 -0
- package/types/switch.d.ts +7 -2
- package/umd/varlet.js +5 -5
|
@@ -36,7 +36,7 @@ import { props } from "./props.mjs";
|
|
|
36
36
|
import { createNamespace } from "../utils/components.mjs";
|
|
37
37
|
import { onSmartMounted } from "@varlet/use";
|
|
38
38
|
const { name, n, classes } = createNamespace("index-bar");
|
|
39
|
-
import { renderSlot as _renderSlot, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
|
39
|
+
import { renderSlot as _renderSlot, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
|
40
40
|
const _withScopeId = (n2) => (_pushScopeId(""), n2 = n2(), _popScopeId(), n2);
|
|
41
41
|
const _hoisted_1 = ["onClick"];
|
|
42
42
|
function __render__(_ctx, _cache) {
|
|
@@ -64,7 +64,15 @@ function __render__(_ctx, _cache) {
|
|
|
64
64
|
class: _normalizeClass(_ctx.classes(_ctx.n("anchor-item"), [_ctx.active === anchorName, _ctx.n("anchor-item--active")])),
|
|
65
65
|
style: _normalizeStyle({ color: _ctx.active === anchorName && _ctx.highlightColor ? _ctx.highlightColor : void 0 }),
|
|
66
66
|
onClick: ($event) => _ctx.anchorClick({ anchorName, manualCall: true })
|
|
67
|
-
},
|
|
67
|
+
}, [
|
|
68
|
+
_renderSlot(_ctx.$slots, "anchor-name", { anchorName }, () => [
|
|
69
|
+
_createTextVNode(
|
|
70
|
+
_toDisplayString(anchorName),
|
|
71
|
+
1
|
|
72
|
+
/* TEXT */
|
|
73
|
+
)
|
|
74
|
+
])
|
|
75
|
+
], 14, _hoisted_1);
|
|
68
76
|
}),
|
|
69
77
|
128
|
|
70
78
|
/* KEYED_FRAGMENT */
|
package/es/index.bundle.mjs
CHANGED
|
@@ -262,7 +262,7 @@ import './tooltip/style/index.mjs'
|
|
|
262
262
|
import './uploader/style/index.mjs'
|
|
263
263
|
import './watermark/style/index.mjs'
|
|
264
264
|
|
|
265
|
-
const version = '2.
|
|
265
|
+
const version = '2.22.0-alpha.1705845515578'
|
|
266
266
|
|
|
267
267
|
function install(app) {
|
|
268
268
|
ActionSheet.install && app.use(ActionSheet)
|
package/es/index.mjs
CHANGED
|
@@ -174,7 +174,7 @@ export * from './tooltip/index.mjs'
|
|
|
174
174
|
export * from './uploader/index.mjs'
|
|
175
175
|
export * from './watermark/index.mjs'
|
|
176
176
|
|
|
177
|
-
const version = '2.
|
|
177
|
+
const version = '2.22.0-alpha.1705845515578'
|
|
178
178
|
|
|
179
179
|
function install(app) {
|
|
180
180
|
ActionSheet.install && app.use(ActionSheet)
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
var stdin_default = {
|
|
2
|
+
// Dialog
|
|
3
|
+
dialogTitle: "\u0627\u0634\u0627\u0631\u0647",
|
|
4
|
+
dialogConfirmButtonText: "\u062A\u0627\u06CC\u06CC\u062F",
|
|
5
|
+
dialogCancelButtonText: "\u0644\u063A\u0648",
|
|
6
|
+
// ActionSheet
|
|
7
|
+
actionSheetTitle: "\u0627\u0646\u062A\u062E\u0627\u0628 \u06CC\u06A9 \u0645\u0648\u0631\u062F",
|
|
8
|
+
// List
|
|
9
|
+
listLoadingText: "\u062F\u0631 \u062D\u0627\u0644 \u0628\u0627\u0631\u06AF\u0632\u0627\u0631\u06CC",
|
|
10
|
+
listFinishedText: "\u0645\u0648\u0631\u062F \u062F\u06CC\u06AF\u0631\u06CC \u0648\u062C\u0648\u062F \u0646\u062F\u0627\u0631\u062F",
|
|
11
|
+
listErrorText: "\u0628\u0627\u0631\u06AF\u0632\u0627\u0631\u06CC \u0646\u0627\u0645\u0648\u0641\u0642",
|
|
12
|
+
// Picker
|
|
13
|
+
pickerTitle: "\u0627\u0646\u062A\u062E\u0627\u0628 \u06A9\u0646\u06CC\u062F",
|
|
14
|
+
pickerConfirmButtonText: "\u062A\u0627\u06CC\u06CC\u062F",
|
|
15
|
+
pickerCancelButtonText: "\u0644\u063A\u0648",
|
|
16
|
+
// date-picker
|
|
17
|
+
datePickerMonthDict: {
|
|
18
|
+
"01": {
|
|
19
|
+
name: "\u0698\u0627\u0646\u0648\u06CC\u0647",
|
|
20
|
+
abbr: "JAN"
|
|
21
|
+
},
|
|
22
|
+
"02": {
|
|
23
|
+
name: "\u0641\u0648\u0631\u06CC\u0647",
|
|
24
|
+
abbr: "FEB"
|
|
25
|
+
},
|
|
26
|
+
"03": {
|
|
27
|
+
name: "\u0645\u0627\u0631\u0633",
|
|
28
|
+
abbr: "MAR"
|
|
29
|
+
},
|
|
30
|
+
"04": {
|
|
31
|
+
name: "\u0622\u0648\u0631\u06CC\u0644",
|
|
32
|
+
abbr: "APR"
|
|
33
|
+
},
|
|
34
|
+
"05": {
|
|
35
|
+
name: "\u0645\u0647",
|
|
36
|
+
abbr: "MAY"
|
|
37
|
+
},
|
|
38
|
+
"06": {
|
|
39
|
+
name: "\u0698\u0648\u0626\u0646",
|
|
40
|
+
abbr: "JUN"
|
|
41
|
+
},
|
|
42
|
+
"07": {
|
|
43
|
+
name: "\u062C\u0648\u0644\u0627\u06CC",
|
|
44
|
+
abbr: "JUL"
|
|
45
|
+
},
|
|
46
|
+
"08": {
|
|
47
|
+
name: "\u0622\u06AF\u0648\u0633\u062A",
|
|
48
|
+
abbr: "AUG"
|
|
49
|
+
},
|
|
50
|
+
"09": {
|
|
51
|
+
name: "\u0633\u067E\u062A\u0627\u0645\u0628\u0631",
|
|
52
|
+
abbr: "SEP"
|
|
53
|
+
},
|
|
54
|
+
"10": {
|
|
55
|
+
name: "\u0627\u0648\u06A9\u062A\u0628\u0631",
|
|
56
|
+
abbr: "OCT"
|
|
57
|
+
},
|
|
58
|
+
"11": {
|
|
59
|
+
name: "\u0646\u0648\u0627\u0645\u0628\u0631",
|
|
60
|
+
abbr: "NOV"
|
|
61
|
+
},
|
|
62
|
+
"12": {
|
|
63
|
+
name: "\u062F\u0633\u0627\u0645\u0628\u0631",
|
|
64
|
+
abbr: "DEC"
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
datePickerWeekDict: {
|
|
68
|
+
"0": {
|
|
69
|
+
name: "\u06CC\u06A9\u0634\u0646\u0628\u0647",
|
|
70
|
+
abbr: "S"
|
|
71
|
+
},
|
|
72
|
+
"1": {
|
|
73
|
+
name: "\u062F\u0648\u0634\u0646\u0628\u0647",
|
|
74
|
+
abbr: "M"
|
|
75
|
+
},
|
|
76
|
+
"2": {
|
|
77
|
+
name: "\u0633\u0647\u200C\u0634\u0646\u0628\u0647",
|
|
78
|
+
abbr: "T"
|
|
79
|
+
},
|
|
80
|
+
"3": {
|
|
81
|
+
name: "\u0686\u0647\u0627\u0631\u0634\u0646\u0628\u0647",
|
|
82
|
+
abbr: "W"
|
|
83
|
+
},
|
|
84
|
+
"4": {
|
|
85
|
+
name: "\u067E\u0646\u062C\u0634\u0646\u0628\u0647",
|
|
86
|
+
abbr: "T"
|
|
87
|
+
},
|
|
88
|
+
"5": {
|
|
89
|
+
name: "\u062C\u0645\u0639\u0647",
|
|
90
|
+
abbr: "F"
|
|
91
|
+
},
|
|
92
|
+
"6": {
|
|
93
|
+
name: "\u0634\u0646\u0628\u0647",
|
|
94
|
+
abbr: "S"
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
datePickerSelected: " \u0627\u0646\u062A\u062E\u0627\u0628 \u0634\u062F\u0647",
|
|
98
|
+
datePickerHint: "\u0627\u0646\u062A\u062E\u0627\u0628 \u062A\u0627\u0631\u06CC\u062E",
|
|
99
|
+
// pagination
|
|
100
|
+
paginationItem: "",
|
|
101
|
+
paginationPage: "\u0635\u0641\u062D\u0647",
|
|
102
|
+
paginationJump: "\u0628\u0631\u0648 \u0628\u0647",
|
|
103
|
+
// time-picker
|
|
104
|
+
timePickerHint: "\u0627\u0646\u062A\u062E\u0627\u0628 \u0632\u0645\u0627\u0646"
|
|
105
|
+
};
|
|
106
|
+
export {
|
|
107
|
+
stdin_default as default
|
|
108
|
+
};
|
package/es/locale/index.mjs
CHANGED
|
@@ -18,6 +18,7 @@ import zhCN from "./zh-CN.mjs";
|
|
|
18
18
|
import enUS from "./en-US.mjs";
|
|
19
19
|
import zhTW from "./zh-TW.mjs";
|
|
20
20
|
import zhHK from "./zh-HK.mjs";
|
|
21
|
+
import faIR from "./fa-IR.mjs";
|
|
21
22
|
import { ref } from "vue";
|
|
22
23
|
function useLocale() {
|
|
23
24
|
const packs2 = {};
|
|
@@ -58,6 +59,7 @@ var stdin_default = {
|
|
|
58
59
|
enUS,
|
|
59
60
|
zhTW,
|
|
60
61
|
zhHK,
|
|
62
|
+
faIR,
|
|
61
63
|
packs,
|
|
62
64
|
pack,
|
|
63
65
|
add,
|
package/es/picker/Picker.mjs
CHANGED
|
@@ -232,18 +232,9 @@ const __sfc__ = defineComponent({
|
|
|
232
232
|
const columnHeight = computed(() => optionCount.value * optionHeight.value);
|
|
233
233
|
const { prevY, moveY, dragging, startTouch, moveTouch, endTouch } = useTouch();
|
|
234
234
|
let prevIndexes = [];
|
|
235
|
-
|
|
236
|
-
watch(() => props2.columns,
|
|
237
|
-
watch(
|
|
238
|
-
() => modelValue.value,
|
|
239
|
-
() => {
|
|
240
|
-
if (props2.cascade && props2.modelValue.length) {
|
|
241
|
-
buildScrollColumns();
|
|
242
|
-
} else {
|
|
243
|
-
updateScrollColumnsIndex();
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
);
|
|
235
|
+
initScrollColumns();
|
|
236
|
+
watch(() => props2.columns, initScrollColumns, { deep: true });
|
|
237
|
+
watch(() => modelValue.value, initScrollColumns);
|
|
247
238
|
function getOptionKey(key) {
|
|
248
239
|
const keyMap = {
|
|
249
240
|
text: props2.textKey,
|
|
@@ -260,7 +251,7 @@ const __sfc__ = defineComponent({
|
|
|
260
251
|
prevIndexes = [...indexes];
|
|
261
252
|
}
|
|
262
253
|
function normalizeNormalMode(columns) {
|
|
263
|
-
return columns.map((column) => {
|
|
254
|
+
return columns.map((column, idx) => {
|
|
264
255
|
const scrollColumn = {
|
|
265
256
|
id: sid++,
|
|
266
257
|
prevY: 0,
|
|
@@ -274,6 +265,9 @@ const __sfc__ = defineComponent({
|
|
|
274
265
|
scrollEl: null,
|
|
275
266
|
scrolling: false
|
|
276
267
|
};
|
|
268
|
+
const value = modelValue.value[idx];
|
|
269
|
+
const index = scrollColumn.column.findIndex((option) => value === getValue(option));
|
|
270
|
+
scrollColumn.index = index === -1 ? 0 : index;
|
|
277
271
|
scrollTo(scrollColumn);
|
|
278
272
|
return scrollColumn;
|
|
279
273
|
});
|
|
@@ -283,7 +277,7 @@ const __sfc__ = defineComponent({
|
|
|
283
277
|
createChildren(scrollColumns2, column);
|
|
284
278
|
return scrollColumns2;
|
|
285
279
|
}
|
|
286
|
-
function createChildren(scrollColumns2, children) {
|
|
280
|
+
function createChildren(scrollColumns2, children, syncModelValue = true) {
|
|
287
281
|
var _a;
|
|
288
282
|
if (children.length) {
|
|
289
283
|
const scrollColumn = {
|
|
@@ -300,31 +294,30 @@ const __sfc__ = defineComponent({
|
|
|
300
294
|
scrolling: false
|
|
301
295
|
};
|
|
302
296
|
scrollColumns2.push(scrollColumn);
|
|
303
|
-
if (
|
|
304
|
-
const
|
|
297
|
+
if (syncModelValue) {
|
|
298
|
+
const value = modelValue.value[scrollColumns2.length - 1];
|
|
299
|
+
const index = children.findIndex((option) => value === getValue(option));
|
|
305
300
|
scrollColumn.index = index === -1 ? 0 : index;
|
|
306
301
|
}
|
|
307
302
|
scrollTo(scrollColumn);
|
|
308
|
-
createChildren(
|
|
303
|
+
createChildren(
|
|
304
|
+
scrollColumns2,
|
|
305
|
+
(_a = scrollColumn.column[scrollColumn.index][getOptionKey("children")]) != null ? _a : [],
|
|
306
|
+
syncModelValue
|
|
307
|
+
);
|
|
309
308
|
}
|
|
310
309
|
}
|
|
311
310
|
function rebuildChildren(scrollColumn) {
|
|
312
311
|
var _a;
|
|
313
312
|
scrollColumns.value.splice(scrollColumns.value.indexOf(scrollColumn) + 1);
|
|
314
|
-
createChildren(
|
|
313
|
+
createChildren(
|
|
314
|
+
scrollColumns.value,
|
|
315
|
+
(_a = scrollColumn.column[scrollColumn.index][getOptionKey("children")]) != null ? _a : [],
|
|
316
|
+
false
|
|
317
|
+
);
|
|
315
318
|
}
|
|
316
|
-
function
|
|
319
|
+
function initScrollColumns() {
|
|
317
320
|
scrollColumns.value = props2.cascade ? normalizeCascadeMode(props2.columns) : normalizeNormalMode(props2.columns);
|
|
318
|
-
if (!props2.cascade) {
|
|
319
|
-
updateScrollColumnsIndex();
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
function updateScrollColumnsIndex() {
|
|
323
|
-
scrollColumns.value.forEach((scrollColumn, idx) => {
|
|
324
|
-
const index = scrollColumn.column.findIndex((option) => modelValue.value[idx] === getValue(option));
|
|
325
|
-
scrollColumn.index = index === -1 ? 0 : index;
|
|
326
|
-
scrollTo(scrollColumn);
|
|
327
|
-
});
|
|
328
321
|
const { indexes } = getPicked();
|
|
329
322
|
setPrevIndexes(indexes);
|
|
330
323
|
}
|
|
@@ -413,23 +406,23 @@ const __sfc__ = defineComponent({
|
|
|
413
406
|
scrollTo(scrollColumn, shouldMomentum ? MOMENTUM_TRANSITION_DURATION : TRANSITION_DURATION);
|
|
414
407
|
scrollColumn.scrolling = scrollColumn.translate !== oldTranslate;
|
|
415
408
|
if (!scrollColumn.scrolling) {
|
|
416
|
-
|
|
409
|
+
handleScrollColumnChange(scrollColumn);
|
|
417
410
|
}
|
|
418
411
|
}
|
|
419
412
|
function handleTransitionend(scrollColumn) {
|
|
420
413
|
scrollColumn.scrolling = false;
|
|
421
|
-
|
|
414
|
+
handleScrollColumnChange(scrollColumn);
|
|
422
415
|
}
|
|
423
416
|
function isSamePicked() {
|
|
424
417
|
const { indexes } = getPicked();
|
|
425
418
|
return indexes.every((index, idx) => index === prevIndexes[idx]);
|
|
426
419
|
}
|
|
427
|
-
function
|
|
428
|
-
const {
|
|
420
|
+
function handleScrollColumnChange(scrollColumn) {
|
|
421
|
+
const { onChange, cascade } = props2;
|
|
429
422
|
if (isSamePicked()) {
|
|
430
423
|
return;
|
|
431
424
|
}
|
|
432
|
-
if (cascade
|
|
425
|
+
if (cascade) {
|
|
433
426
|
rebuildChildren(scrollColumn);
|
|
434
427
|
}
|
|
435
428
|
const hasScrolling = scrollColumns.value.some((scrollColumn2) => scrollColumn2.scrolling);
|
package/es/popup/Popup.mjs
CHANGED
|
@@ -95,7 +95,7 @@ var stdin_default = defineComponent({
|
|
|
95
95
|
"onAfterLeave": props2.onClosed
|
|
96
96
|
}, {
|
|
97
97
|
default: () => [_withDirectives(_createVNode("div", {
|
|
98
|
-
"class": classes(n("$--box"), n()),
|
|
98
|
+
"class": classes(n("$--box"), n(), [!props2.overlay, n("--pointer-events-none")]),
|
|
99
99
|
"style": {
|
|
100
100
|
zIndex: zIndex.value - 2
|
|
101
101
|
}
|
package/es/popup/popup.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root { --popup-content-background-color: #fff; --popup-overlay-background-color: rgba(0, 0, 0, 0.6);}.var-fade-enter-from,.var-fade-leave-to { opacity: 0;}.var-fade-enter-active,.var-fade-leave-active { transition: opacity 0.25s;}.var-pop-center-enter-from,.var-pop-center-leave-to { transform: scale(0.3);}.var-pop-center-enter-active,.var-pop-center-leave-active { transition: all 0.25s;}.var-pop-bottom-enter-from,.var-pop-bottom-leave-to { transform: translateY(100%);}.var-pop-bottom-enter-active,.var-pop-bottom-leave-active { transition: all 0.25s;}.var-pop-top-enter-from,.var-pop-top-leave-to { transform: translateY(-100%);}.var-pop-top-enter-active,.var-pop-top-leave-active { transition: all 0.25s;}.var-pop-left-enter-from,.var-pop-left-leave-to { transform: translateX(-100%);}.var-pop-left-enter-active,.var-pop-left-leave-active { transition: all 0.25s;}.var-pop-right-enter-from,.var-pop-right-leave-to { transform: translateX(100%);}.var-pop-right-enter-active,.var-pop-right-leave-active { transition: all 0.25s;}.var-popup { display: flex; justify-content: center; align-items: center; position: fixed; top: 0; right: 0; bottom: 0; left: 0; overflow: auto;}.var-popup__overlay { display: flex; justify-content: center; align-items: center; position: fixed; top: 0; right: 0; bottom: 0; left: 0; background-color: var(--popup-overlay-background-color); transition: all 0.25s;}.var-popup__content { overflow: auto; transition: all 0.25s;}.var-popup--content-background-color { background-color: var(--popup-content-background-color);}.var-popup--center { position: relative;}.var-popup--bottom { width: 100%; position: absolute; left: 0; bottom: 0;}.var-popup--top { width: 100%; position: absolute; left: 0; top: 0;}.var-popup--left { height: 100%; position: absolute; left: 0; top: 0;}.var-popup--right { height: 100%; position: absolute; right: 0; top: 0;}.var-popup--safe-area { padding-bottom: constant(safe-area-inset-bottom); padding-bottom: env(safe-area-inset-bottom);}.var-popup--safe-area-top { padding-top: constant(safe-area-inset-top); padding-top: env(safe-area-inset-top);}
|
|
1
|
+
:root { --popup-content-background-color: #fff; --popup-overlay-background-color: rgba(0, 0, 0, 0.6);}.var-fade-enter-from,.var-fade-leave-to { opacity: 0;}.var-fade-enter-active,.var-fade-leave-active { transition: opacity 0.25s;}.var-pop-center-enter-from,.var-pop-center-leave-to { transform: scale(0.3);}.var-pop-center-enter-active,.var-pop-center-leave-active { transition: all 0.25s;}.var-pop-bottom-enter-from,.var-pop-bottom-leave-to { transform: translateY(100%);}.var-pop-bottom-enter-active,.var-pop-bottom-leave-active { transition: all 0.25s;}.var-pop-top-enter-from,.var-pop-top-leave-to { transform: translateY(-100%);}.var-pop-top-enter-active,.var-pop-top-leave-active { transition: all 0.25s;}.var-pop-left-enter-from,.var-pop-left-leave-to { transform: translateX(-100%);}.var-pop-left-enter-active,.var-pop-left-leave-active { transition: all 0.25s;}.var-pop-right-enter-from,.var-pop-right-leave-to { transform: translateX(100%);}.var-pop-right-enter-active,.var-pop-right-leave-active { transition: all 0.25s;}.var-popup { display: flex; justify-content: center; align-items: center; position: fixed; top: 0; right: 0; bottom: 0; left: 0; overflow: auto;}.var-popup__overlay { display: flex; justify-content: center; align-items: center; position: fixed; top: 0; right: 0; bottom: 0; left: 0; background-color: var(--popup-overlay-background-color); transition: all 0.25s;}.var-popup__content { overflow: auto; transition: all 0.25s; pointer-events: auto;}.var-popup--content-background-color { background-color: var(--popup-content-background-color);}.var-popup--center { position: relative;}.var-popup--bottom { width: 100%; position: absolute; left: 0; bottom: 0;}.var-popup--top { width: 100%; position: absolute; left: 0; top: 0;}.var-popup--left { height: 100%; position: absolute; left: 0; top: 0;}.var-popup--right { height: 100%; position: absolute; right: 0; top: 0;}.var-popup--safe-area { padding-bottom: constant(safe-area-inset-bottom); padding-bottom: env(safe-area-inset-bottom);}.var-popup--safe-area-top { padding-top: constant(safe-area-inset-top); padding-top: env(safe-area-inset-top);}.var-popup--pointer-events-none { pointer-events: none;}
|
package/es/snackbar/Snackbar.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { defineComponent } from "vue";
|
|
|
3
3
|
import { createNamespace, useTeleport } from "../utils/components.mjs";
|
|
4
4
|
import { props } from "./props.mjs";
|
|
5
5
|
const { name, n } = createNamespace("snackbar");
|
|
6
|
-
import { renderSlot as _renderSlot,
|
|
6
|
+
import { renderSlot as _renderSlot, resolveComponent as _resolveComponent, mergeProps as _mergeProps, withCtx as _withCtx, createSlots as _createSlots, createVNode as _createVNode, Transition as _Transition, Teleport as _Teleport, openBlock as _openBlock, createBlock as _createBlock } from "vue";
|
|
7
7
|
function __render__(_ctx, _cache) {
|
|
8
8
|
const _component_var_snackbar_core = _resolveComponent("var-snackbar-core");
|
|
9
9
|
return _openBlock(), _createBlock(_Teleport, {
|
|
@@ -18,25 +18,28 @@ function __render__(_ctx, _cache) {
|
|
|
18
18
|
default: _withCtx(() => [
|
|
19
19
|
_createVNode(_component_var_snackbar_core, _mergeProps(_ctx.$props, {
|
|
20
20
|
class: _ctx.n("transition")
|
|
21
|
-
}), {
|
|
22
|
-
icon: _withCtx(() => [
|
|
23
|
-
_renderSlot(_ctx.$slots, "icon")
|
|
24
|
-
]),
|
|
25
|
-
action: _withCtx(() => [
|
|
26
|
-
_renderSlot(_ctx.$slots, "action")
|
|
27
|
-
]),
|
|
21
|
+
}), _createSlots({
|
|
28
22
|
default: _withCtx(() => [
|
|
29
|
-
_renderSlot(_ctx.$slots, "default"
|
|
30
|
-
_createTextVNode(
|
|
31
|
-
_toDisplayString(_ctx.content),
|
|
32
|
-
1
|
|
33
|
-
/* TEXT */
|
|
34
|
-
)
|
|
35
|
-
])
|
|
23
|
+
_renderSlot(_ctx.$slots, "default")
|
|
36
24
|
]),
|
|
37
|
-
_:
|
|
38
|
-
/*
|
|
39
|
-
},
|
|
25
|
+
_: 2
|
|
26
|
+
/* DYNAMIC */
|
|
27
|
+
}, [
|
|
28
|
+
_ctx.$slots.icon ? {
|
|
29
|
+
name: "icon",
|
|
30
|
+
fn: _withCtx(() => [
|
|
31
|
+
_renderSlot(_ctx.$slots, "icon")
|
|
32
|
+
]),
|
|
33
|
+
key: "0"
|
|
34
|
+
} : void 0,
|
|
35
|
+
_ctx.$slots.action ? {
|
|
36
|
+
name: "action",
|
|
37
|
+
fn: _withCtx(() => [
|
|
38
|
+
_renderSlot(_ctx.$slots, "action")
|
|
39
|
+
]),
|
|
40
|
+
key: "1"
|
|
41
|
+
} : void 0
|
|
42
|
+
]), 1040, ["class"])
|
|
40
43
|
]),
|
|
41
44
|
_: 3
|
|
42
45
|
/* FORWARDED */
|
package/es/snackbar/core.mjs
CHANGED
|
@@ -59,10 +59,11 @@ function __render__(_ctx, _cache) {
|
|
|
59
59
|
2
|
|
60
60
|
/* CLASS */
|
|
61
61
|
),
|
|
62
|
-
|
|
62
|
+
_ctx.iconName || _ctx.type === "loading" || _ctx.$slots.icon ? (_openBlock(), _createElementBlock(
|
|
63
63
|
"div",
|
|
64
64
|
{
|
|
65
|
-
|
|
65
|
+
key: 0,
|
|
66
|
+
class: _normalizeClass(_ctx.n("icon"))
|
|
66
67
|
},
|
|
67
68
|
[
|
|
68
69
|
_ctx.iconName ? (_openBlock(), _createBlock(_component_var_icon, {
|
|
@@ -80,11 +81,11 @@ function __render__(_ctx, _cache) {
|
|
|
80
81
|
],
|
|
81
82
|
2
|
|
82
83
|
/* CLASS */
|
|
83
|
-
),
|
|
84
|
+
)) : _createCommentVNode("v-if", true),
|
|
84
85
|
_ctx.$slots.action ? (_openBlock(), _createElementBlock(
|
|
85
86
|
"div",
|
|
86
87
|
{
|
|
87
|
-
key:
|
|
88
|
+
key: 1,
|
|
88
89
|
class: _normalizeClass(_ctx.n("action"))
|
|
89
90
|
},
|
|
90
91
|
[
|
|
@@ -118,24 +119,25 @@ const __sfc__ = defineComponent({
|
|
|
118
119
|
() => props2.show,
|
|
119
120
|
() => props2.lockScroll
|
|
120
121
|
);
|
|
121
|
-
const isForbidClick = computed(() =>
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
return "";
|
|
125
|
-
return ICON_TYPE_DICT[props2.type];
|
|
122
|
+
const isForbidClick = computed(() => {
|
|
123
|
+
const { type, forbidClick } = props2;
|
|
124
|
+
return type === "loading" || forbidClick;
|
|
126
125
|
});
|
|
127
|
-
const
|
|
126
|
+
const iconName = computed(() => !props2.type ? "" : ICON_TYPE_DICT[props2.type]);
|
|
127
|
+
function updateAfterDuration() {
|
|
128
128
|
timer.value = setTimeout(() => {
|
|
129
|
-
props2.type !== "loading"
|
|
129
|
+
if (props2.type !== "loading") {
|
|
130
|
+
call(props2["onUpdate:show"], false);
|
|
131
|
+
}
|
|
130
132
|
}, props2.duration);
|
|
131
|
-
}
|
|
133
|
+
}
|
|
132
134
|
watch(
|
|
133
135
|
() => props2.show,
|
|
134
136
|
(show) => {
|
|
135
137
|
if (show) {
|
|
136
138
|
call(props2.onOpen);
|
|
137
139
|
updateAfterDuration();
|
|
138
|
-
} else
|
|
140
|
+
} else {
|
|
139
141
|
clearTimeout(timer.value);
|
|
140
142
|
call(props2.onClose);
|
|
141
143
|
}
|
|
@@ -156,11 +158,11 @@ const __sfc__ = defineComponent({
|
|
|
156
158
|
});
|
|
157
159
|
return {
|
|
158
160
|
SNACKBAR_TYPE,
|
|
159
|
-
n,
|
|
160
|
-
classes,
|
|
161
161
|
zIndex,
|
|
162
162
|
iconName,
|
|
163
|
-
isForbidClick
|
|
163
|
+
isForbidClick,
|
|
164
|
+
n,
|
|
165
|
+
classes
|
|
164
166
|
};
|
|
165
167
|
}
|
|
166
168
|
});
|
package/es/snackbar/props.mjs
CHANGED
package/es/snackbar/snackbar.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root { --snackbar-width: 256px; --snackbar-color: rgba(255, 255, 255, 0.87); --snackbar-border-radius: 4px; --snackbar-background: #333; --snackbar-font-size: var(--font-size-md); --snackbar-margin: 6px 24px; --snackbar-border-color: currentColor; --snackbar-success-background: var(--color-success); --snackbar-info-background: var(--color-info); --snackbar-error-background: var(--color-danger); --snackbar-warning-background: var(--color-warning); --snackbar-content-padding: 14px 16px; --snackbar-action-margin: 0 8px
|
|
1
|
+
:root { --snackbar-width: 256px; --snackbar-color: rgba(255, 255, 255, 0.87); --snackbar-border-radius: 4px; --snackbar-background: #333; --snackbar-font-size: var(--font-size-md); --snackbar-margin: 6px 24px; --snackbar-border-color: currentColor; --snackbar-success-background: var(--color-success); --snackbar-info-background: var(--color-info); --snackbar-error-background: var(--color-danger); --snackbar-warning-background: var(--color-warning); --snackbar-content-padding: 14px 16px; --snackbar-action-margin: 0 8px; --snackbar-vertical-action-margin: 0 8px 8px 0; --snackbar-icon-margin: 0 8px;}.var-transition-group { position: fixed; left: 0; right: 0; top: 0; bottom: 0; pointer-events: none;}.var-pointer-auto { pointer-events: auto;}.var-snackbar { display: flex; justify-content: center; align-items: baseline; left: 0; right: 0; bottom: 0; transition: all 0.15s var(--cubic-bezier);}.var-snackbar__transition { top: 0; position: fixed;}.var-snackbar__transition .var-snackbar__wrapper { position: absolute;}.var-snackbar__transition .var-snackbar__wrapper-top { top: 5%;}.var-snackbar__transition .var-snackbar__wrapper-center { top: 45%;}.var-snackbar__transition .var-snackbar__wrapper-bottom { bottom: 5%;}.var-snackbar__wrapper { width: var(--snackbar-width); display: flex; border-radius: var(--snackbar-border-radius); color: var(--snackbar-color); background: var(--snackbar-background); font-size: var(--snackbar-font-size); margin: var(--snackbar-margin); align-items: center; border-color: var(--snackbar-border-color); pointer-events: auto; transition: 0.3s var(--cubic-bezier);}.var-snackbar__wrapper-success { background: var(--snackbar-success-background);}.var-snackbar__wrapper-info { background: var(--snackbar-info-background);}.var-snackbar__wrapper-warning { background: var(--snackbar-warning-background);}.var-snackbar__wrapper-error { background: var(--snackbar-error-background);}.var-snackbar__icon { margin: var(--snackbar-icon-margin);}.var-snackbar__content { flex-grow: 1; padding: var(--snackbar-content-padding);}.var-snackbar__action { margin: var(--snackbar-action-margin); display: flex;}.var-snackbar__vertical { flex-direction: column; align-items: flex-start;}.var-snackbar__vertical .var-snackbar__action { align-self: flex-end; margin: var(--snackbar-vertical-action-margin);}.var-snackbar-fade-enter-from,.var-snackbar-fade-leave-to { opacity: 0; transform: translateY(-30px);}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import '../../styles/common.css'
|
|
2
|
+
import '../SnackbarSfc.css'
|
|
2
3
|
import '../../styles/elevation.css'
|
|
3
4
|
import '../../loading/loading.css'
|
|
4
|
-
import '../../button/button.css'
|
|
5
5
|
import '../../icon/icon.css'
|
|
6
6
|
import '../snackbar.css'
|
|
7
7
|
import '../coreSfc.css'
|
|
8
|
-
import '../SnackbarSfc.css'
|