@varlet/ui 2.11.6-alpha.1686800314469 → 2.11.7
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/counter/counter.css +1 -1
- package/es/dialog/dialog.css +1 -1
- package/es/index.bundle.mjs +1 -1
- package/es/index.mjs +1 -1
- package/es/popup/Popup.mjs +31 -29
- package/es/popup/provide.mjs +26 -0
- package/es/progress/progress.css +1 -1
- package/es/style.css +1 -1
- package/es/swipe/Swipe.mjs +25 -0
- package/es/table/table.css +1 -1
- package/es/themes/dark/dialog.mjs +1 -0
- package/es/themes/dark/index.mjs +2 -1
- package/es/themes/dark/progress.mjs +3 -0
- package/es/themes/dark/table.mjs +1 -0
- package/es/varlet.esm.js +4708 -4668
- package/highlight/web-types.en-US.json +1 -1
- package/highlight/web-types.zh-CN.json +1 -1
- package/lib/style.css +1 -1
- package/lib/varlet.cjs.js +86 -27
- package/package.json +6 -6
- package/umd/varlet.js +5 -5
package/es/counter/counter.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root { --counter-padding: 0 4px; --counter-font-color: #fff; --counter-background: var(--color-primary); --counter-input-width: 28px; --counter-input-margin: 0 4px; --counter-input-font-size: 14px; --counter-button-size: 28px; --counter-button-icon-size: 100%; --counter-disabled-color: var(--color-disabled); --counter-disabled-opacity: var(--opacity-disabled); --counter-error-color: var(--color-danger);}.var-counter { display: inline-flex; flex-direction: column; align-items: flex-start;}.var-counter__controller { display: flex; align-items: center; color: var(--counter-font-color); border-radius: var(--counter-button-size); padding: var(--counter-padding); background: var(--counter-background); transition: color 0.25s, background-color 0.25s, opacity 0.25s;}.var-counter__input { width: var(--counter-input-width); font-size: var(--counter-input-font-size); outline: none; border: none; background: transparent; padding: 0; text-align: center; color: var(--counter-font-color); margin: var(--counter-input-margin);}.var-counter__input[disabled] { background: transparent;}.var-counter__increment-button[var-counter-cover],.var-counter__decrement-button[var-counter-cover] { width: var(--counter-button-size); height: var(--counter-button-size); font-size: var(--counter-button-icon-size); border-radius: 50%; padding: 0; background-color: rgba(0, 0, 0, 0); box-shadow: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-user-select: none; user-select: none;}.var-counter__increment-button[var-counter-cover]:active,.var-counter__decrement-button[var-counter-cover]:active { box-shadow: none;}.var-counter--disabled { opacity: var(--counter-disabled-opacity); cursor: not-allowed;}.var-counter--disabled .var-hover-overlay { opacity: 0;}.var-counter--not-allowed { cursor: not-allowed !important;}.var-counter--hidden { opacity: 0;}.var-counter--error { background: var(--counter-error-color);}
|
|
1
|
+
:root { --counter-padding: 0 4px; --counter-font-color: #fff; --counter-background: var(--color-primary); --counter-input-width: 28px; --counter-input-margin: 0 4px; --counter-input-font-size: 14px; --counter-button-size: 28px; --counter-button-text-color: #fff; --counter-button-icon-size: 100%; --counter-disabled-color: var(--color-disabled); --counter-disabled-opacity: var(--opacity-disabled); --counter-error-color: var(--color-danger);}.var-counter { display: inline-flex; flex-direction: column; align-items: flex-start;}.var-counter__controller { display: flex; align-items: center; color: var(--counter-font-color); border-radius: var(--counter-button-size); padding: var(--counter-padding); background: var(--counter-background); transition: color 0.25s, background-color 0.25s, opacity 0.25s;}.var-counter__input { width: var(--counter-input-width); font-size: var(--counter-input-font-size); outline: none; border: none; background: transparent; padding: 0; text-align: center; color: var(--counter-font-color); margin: var(--counter-input-margin);}.var-counter__input[disabled] { background: transparent;}.var-counter__increment-button[var-counter-cover],.var-counter__decrement-button[var-counter-cover] { width: var(--counter-button-size); height: var(--counter-button-size); font-size: var(--counter-button-icon-size); color: var(--counter-button-text-color); border-radius: 50%; padding: 0; background-color: rgba(0, 0, 0, 0); box-shadow: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-user-select: none; user-select: none;}.var-counter__increment-button[var-counter-cover]:active,.var-counter__decrement-button[var-counter-cover]:active { box-shadow: none;}.var-counter--disabled { opacity: var(--counter-disabled-opacity); cursor: not-allowed;}.var-counter--disabled .var-hover-overlay { opacity: 0;}.var-counter--not-allowed { cursor: not-allowed !important;}.var-counter--hidden { opacity: 0;}.var-counter--error { background: var(--counter-error-color);}
|
package/es/dialog/dialog.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root { --dialog-width: 280px; --dialog-border-radius: 3px; --dialog-title-padding: 20px 20px 0; --dialog-message-color: #888; --dialog-message-padding: 12px 20px; --dialog-message-line-height: 24px; --dialog-message-font-size: var(--font-size-md); --dialog-title-font-size: var(--font-size-lg); --dialog-actions-padding: 0 12px 12px; --dialog-button-margin-left: 6px; --dialog-confirm-button-color: var(--color-primary); --dialog-cancel-button-color: var(--color-primary); --dialog-background: #fff;}.var-dialog { width: var(--dialog-width); border-radius: var(--dialog-border-radius); background: var(--dialog-background); transition: 0.25s background-color;}.var-dialog__popup[var-dialog-cover] { background: transparent;}.var-dialog__title { font-size: var(--dialog-title-font-size); font-weight: 400; padding: var(--dialog-title-padding);}.var-dialog__message { padding: var(--dialog-message-padding); color: var(--dialog-message-color); line-height: var(--dialog-message-line-height); font-size: var(--dialog-message-font-size);}.var-dialog__actions { display: flex; justify-content: flex-end; padding: var(--dialog-actions-padding);}.var-dialog__button[var-dialog-cover] { margin-left: var(--dialog-button-margin-left); background-color: transparent; box-shadow: none;}.var-dialog__button[var-dialog-cover]:active { box-shadow: none;}.var-dialog__confirm-button[var-dialog-cover] { color: var(--dialog-confirm-button-color);}.var-dialog__cancel-button[var-dialog-cover] { color: var(--dialog-cancel-button-color);}
|
|
1
|
+
:root { --dialog-width: 280px; --dialog-border-radius: 3px; --dialog-title-padding: 20px 20px 0; --dialog-message-color: #888; --dialog-message-padding: 12px 20px; --dialog-message-line-height: 24px; --dialog-message-font-size: var(--font-size-md); --dialog-title-font-size: var(--font-size-lg); --dialog-actions-padding: 0 12px 12px; --dialog-button-margin-left: 6px; --dialog-title-color: #555; --dialog-confirm-button-color: var(--color-primary); --dialog-cancel-button-color: var(--color-primary); --dialog-background: #fff;}.var-dialog { width: var(--dialog-width); border-radius: var(--dialog-border-radius); background: var(--dialog-background); transition: 0.25s background-color;}.var-dialog__popup[var-dialog-cover] { background: transparent;}.var-dialog__title { font-size: var(--dialog-title-font-size); font-weight: 400; padding: var(--dialog-title-padding); color: var(--dialog-title-color);}.var-dialog__message { padding: var(--dialog-message-padding); color: var(--dialog-message-color); line-height: var(--dialog-message-line-height); font-size: var(--dialog-message-font-size);}.var-dialog__actions { display: flex; justify-content: flex-end; padding: var(--dialog-actions-padding);}.var-dialog__button[var-dialog-cover] { margin-left: var(--dialog-button-margin-left); background-color: transparent; box-shadow: none;}.var-dialog__button[var-dialog-cover]:active { box-shadow: none;}.var-dialog__confirm-button[var-dialog-cover] { color: var(--dialog-confirm-button-color);}.var-dialog__cancel-button[var-dialog-cover] { color: var(--dialog-cancel-button-color);}
|
package/es/index.bundle.mjs
CHANGED
|
@@ -241,7 +241,7 @@ import './time-picker/style/index.mjs'
|
|
|
241
241
|
import './tooltip/style/index.mjs'
|
|
242
242
|
import './uploader/style/index.mjs'
|
|
243
243
|
|
|
244
|
-
const version = '2.11.
|
|
244
|
+
const version = '2.11.7'
|
|
245
245
|
|
|
246
246
|
function install(app) {
|
|
247
247
|
ActionSheet.install && app.use(ActionSheet)
|
package/es/index.mjs
CHANGED
|
@@ -160,7 +160,7 @@ export * from './time-picker/index.mjs'
|
|
|
160
160
|
export * from './tooltip/index.mjs'
|
|
161
161
|
export * from './uploader/index.mjs'
|
|
162
162
|
|
|
163
|
-
const version = '2.11.
|
|
163
|
+
const version = '2.11.7'
|
|
164
164
|
|
|
165
165
|
function install(app) {
|
|
166
166
|
ActionSheet.install && app.use(ActionSheet)
|
package/es/popup/Popup.mjs
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { isVNode as _isVNode, withDirectives as _withDirectives,
|
|
1
|
+
import { isVNode as _isVNode, withDirectives as _withDirectives, mergeProps as _mergeProps, vShow as _vShow, createVNode as _createVNode } from "vue";
|
|
2
2
|
|
|
3
3
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
4
|
|
|
5
|
-
import { defineComponent, watch, Transition, Teleport } from 'vue';
|
|
5
|
+
import { defineComponent, watch, Transition, Teleport, computed } from 'vue';
|
|
6
6
|
import { props } from './props.mjs';
|
|
7
7
|
import { useLock } from '../context/lock.mjs';
|
|
8
8
|
import { useZIndex } from '../context/zIndex.mjs';
|
|
9
9
|
import { useRouteListener, useTeleport, createNamespace, call } from '../utils/components.mjs';
|
|
10
|
+
import { usePopupItems } from './provide.mjs';
|
|
11
|
+
import { useInitialized } from '@varlet/use';
|
|
10
12
|
|
|
11
13
|
|
|
12
14
|
|
|
@@ -28,12 +30,16 @@ export default defineComponent({
|
|
|
28
30
|
slots,
|
|
29
31
|
attrs
|
|
30
32
|
} = _ref;
|
|
33
|
+
var rendered = useInitialized(() => props.show, true);
|
|
31
34
|
var {
|
|
32
35
|
zIndex
|
|
33
36
|
} = useZIndex(() => props.show, 3);
|
|
34
37
|
var {
|
|
35
38
|
disabled
|
|
36
39
|
} = useTeleport();
|
|
40
|
+
var {
|
|
41
|
+
bindPopupItems
|
|
42
|
+
} = usePopupItems();
|
|
37
43
|
|
|
38
44
|
var hidePopup = () => {
|
|
39
45
|
var {
|
|
@@ -49,13 +55,6 @@ export default defineComponent({
|
|
|
49
55
|
call(props['onUpdate:show'], false);
|
|
50
56
|
};
|
|
51
57
|
|
|
52
|
-
useLock(() => props.show, () => props.lockScroll);
|
|
53
|
-
watch(() => props.show, newValue => {
|
|
54
|
-
newValue ? call(props.onOpen) : call(props.onClose);
|
|
55
|
-
}); // internal for Dialog
|
|
56
|
-
|
|
57
|
-
useRouteListener(() => call(props.onRouteChange));
|
|
58
|
-
|
|
59
58
|
var renderOverlay = () => {
|
|
60
59
|
var {
|
|
61
60
|
overlayClass = '',
|
|
@@ -71,54 +70,57 @@ export default defineComponent({
|
|
|
71
70
|
};
|
|
72
71
|
|
|
73
72
|
var renderContent = () => {
|
|
74
|
-
return _createVNode("div", _mergeProps({
|
|
73
|
+
return _withDirectives(_createVNode("div", _mergeProps({
|
|
75
74
|
"class": classes(n('content'), n("--" + props.position), [props.defaultStyle, n('--content-background-color')], [props.defaultStyle, n('$-elevation--3')], [props.safeArea, n('--safe-area')], [props.safeAreaTop, n('--safe-area-top')]),
|
|
76
75
|
"style": {
|
|
77
76
|
zIndex: zIndex.value
|
|
78
77
|
}
|
|
79
|
-
}, attrs), [call(slots.default)]);
|
|
78
|
+
}, attrs), [rendered.value && call(slots.default)]), [[_vShow, props.show]]);
|
|
80
79
|
};
|
|
81
80
|
|
|
82
81
|
var renderPopup = () => {
|
|
83
|
-
var
|
|
84
|
-
|
|
85
|
-
onClosed,
|
|
86
|
-
show,
|
|
87
|
-
overlay,
|
|
88
|
-
transition,
|
|
89
|
-
position
|
|
90
|
-
} = props;
|
|
82
|
+
var _slot;
|
|
83
|
+
|
|
91
84
|
return _createVNode(Transition, {
|
|
92
85
|
"name": n('$-fade'),
|
|
93
|
-
"onAfterEnter": onOpened,
|
|
94
|
-
"onAfterLeave": onClosed
|
|
86
|
+
"onAfterEnter": props.onOpened,
|
|
87
|
+
"onAfterLeave": props.onClosed
|
|
95
88
|
}, {
|
|
96
89
|
default: () => [_withDirectives(_createVNode("div", {
|
|
97
90
|
"class": classes(n('$--box'), n()),
|
|
98
91
|
"style": {
|
|
99
92
|
zIndex: zIndex.value - 2
|
|
100
93
|
}
|
|
101
|
-
}, [overlay && renderOverlay(), _createVNode(Transition, {
|
|
102
|
-
"name": transition || n("$-pop-" + position)
|
|
103
|
-
}, {
|
|
104
|
-
default: () => [
|
|
105
|
-
})]), [[_vShow, show]])]
|
|
94
|
+
}, [props.overlay && renderOverlay(), _createVNode(Transition, {
|
|
95
|
+
"name": props.transition || n("$-pop-" + props.position)
|
|
96
|
+
}, _isSlot(_slot = renderContent()) ? _slot : {
|
|
97
|
+
default: () => [_slot]
|
|
98
|
+
})]), [[_vShow, props.show]])]
|
|
106
99
|
});
|
|
107
100
|
};
|
|
108
101
|
|
|
102
|
+
useLock(() => props.show, () => props.lockScroll);
|
|
103
|
+
watch(() => props.show, newValue => {
|
|
104
|
+
newValue ? call(props.onOpen) : call(props.onClose);
|
|
105
|
+
});
|
|
106
|
+
bindPopupItems({
|
|
107
|
+
show: computed(() => props.show)
|
|
108
|
+
}); // internal for Dialog
|
|
109
|
+
|
|
110
|
+
useRouteListener(() => call(props.onRouteChange));
|
|
109
111
|
return () => {
|
|
110
112
|
var {
|
|
111
113
|
teleport
|
|
112
114
|
} = props;
|
|
113
115
|
|
|
114
116
|
if (teleport) {
|
|
115
|
-
var
|
|
117
|
+
var _slot2;
|
|
116
118
|
|
|
117
119
|
return _createVNode(Teleport, {
|
|
118
120
|
"to": teleport,
|
|
119
121
|
"disabled": disabled.value
|
|
120
|
-
}, _isSlot(
|
|
121
|
-
default: () => [
|
|
122
|
+
}, _isSlot(_slot2 = renderPopup()) ? _slot2 : {
|
|
123
|
+
default: () => [_slot2]
|
|
122
124
|
});
|
|
123
125
|
}
|
|
124
126
|
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { useChildren, useParent } from '@varlet/use';
|
|
2
|
+
export var POPUP_BIND_POPUP_ITEM_KEY = Symbol('POPUP_BIND_POPUP_ITEM_KEY');
|
|
3
|
+
export function usePopup() {
|
|
4
|
+
var {
|
|
5
|
+
bindParent,
|
|
6
|
+
parentProvider,
|
|
7
|
+
index
|
|
8
|
+
} = useParent(POPUP_BIND_POPUP_ITEM_KEY);
|
|
9
|
+
return {
|
|
10
|
+
index,
|
|
11
|
+
popup: parentProvider,
|
|
12
|
+
bindPopup: bindParent
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export function usePopupItems() {
|
|
16
|
+
var {
|
|
17
|
+
bindChildren,
|
|
18
|
+
childProviders,
|
|
19
|
+
length
|
|
20
|
+
} = useChildren(POPUP_BIND_POPUP_ITEM_KEY);
|
|
21
|
+
return {
|
|
22
|
+
length,
|
|
23
|
+
popupItems: childProviders,
|
|
24
|
+
bindPopupItems: bindChildren
|
|
25
|
+
};
|
|
26
|
+
}
|
package/es/progress/progress.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root { --progress-font-size: var(--font-size-sm); --progress-ripple-color: #fff; --progress-track-color: #d8d8d8; --progress-background: var(--color-primary);}.var-progress { position: relative; font-size: var(--progress-font-size);}.var-progress__linear { display: flex; align-items: center;}.var-progress__linear-block { flex: 1; position: relative; overflow: hidden; height: 4px;}.var-progress__linear-background,.var-progress__linear-certain { width: 100%; height: 100%;}.var-progress__linear-ripple::after { position: absolute; width: 0; background-color: var(--progress-ripple-color); height: 100%; opacity: 0; animation: ripple 1.8s cubic-bezier(0.4, 0, 0.2, 1) infinite; content: '';}.var-progress__linear-background { background-color: var(--progress-track-color);}.var-progress__linear-certain { position: absolute; background-color: var(--progress-background); top: 0; left: 0; transition: all 0.2s, background-color 0.8s;}.var-progress__linear-label { margin-left: 8px; flex: 0;}@keyframes ripple { 0% { width: 0; opacity: 0.1; } 20% { width: 0; opacity: 0.5; } 80% { width: 100%; opacity: 0; }}.var-progress__circle { position: relative; width: 40px; height: 40px;}.var-progress__circle-background { stroke: var(--progress-track-color);}.var-progress__circle-certain { transition: all 0.2s; stroke: var(--progress-background); position: absolute;}.var-progress__circle-label { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);}
|
|
1
|
+
:root { --progress-font-size: var(--font-size-sm); --progress-ripple-color: #fff; --progress-track-color: #d8d8d8; --progress-label-color: #555; --progress-background: var(--color-primary);}.var-progress { position: relative; font-size: var(--progress-font-size);}.var-progress__linear { display: flex; align-items: center;}.var-progress__linear-block { flex: 1; position: relative; overflow: hidden; height: 4px;}.var-progress__linear-background,.var-progress__linear-certain { width: 100%; height: 100%;}.var-progress__linear-ripple::after { position: absolute; width: 0; background-color: var(--progress-ripple-color); height: 100%; opacity: 0; animation: ripple 1.8s cubic-bezier(0.4, 0, 0.2, 1) infinite; content: '';}.var-progress__linear-background { background-color: var(--progress-track-color);}.var-progress__linear-certain { position: absolute; background-color: var(--progress-background); top: 0; left: 0; transition: all 0.2s, background-color 0.8s;}.var-progress__linear-label { margin-left: 8px; flex: 0; color: var(--progress-label-color);}@keyframes ripple { 0% { width: 0; opacity: 0.1; } 20% { width: 0; opacity: 0.5; } 80% { width: 100%; opacity: 0; }}.var-progress__circle { position: relative; width: 40px; height: 40px;}.var-progress__circle-background { stroke: var(--progress-track-color);}.var-progress__circle-certain { transition: all 0.2s; stroke: var(--progress-background); position: absolute;}.var-progress__circle-label { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); color: var(--progress-label-color);}
|