@varlet/ui 2.4.3-alpha.1671119797012 → 2.4.3-alpha.1672073838506
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/index.js +4 -4
- package/es/action-sheet/props.js +3 -7
- package/es/back-top/props.js +2 -3
- package/es/bottom-navigation/BottomNavigation.js +8 -2
- package/es/bottom-navigation/props.js +5 -12
- package/es/bottom-navigation-item/props.js +2 -3
- package/es/breadcrumb/Breadcrumb.js +66 -0
- package/es/breadcrumb/BreadcrumbSfc.css +0 -0
- package/es/breadcrumb/breadcrumb.css +1 -0
- package/es/breadcrumb/index.js +8 -0
- package/es/breadcrumb/props.js +7 -0
- package/es/breadcrumb/provide.js +21 -0
- package/es/breadcrumb/style/index.js +3 -0
- package/es/breadcrumbs/Breadcrumbs.js +37 -0
- package/es/breadcrumbs/BreadcrumbsSfc.css +0 -0
- package/es/breadcrumbs/breadcrumbs.css +1 -0
- package/es/breadcrumbs/index.js +8 -0
- package/es/breadcrumbs/props.js +6 -0
- package/es/breadcrumbs/provide.js +17 -0
- package/es/breadcrumbs/style/index.js +3 -0
- package/es/button/Button.js +6 -4
- package/es/button/props.js +3 -7
- package/es/card/Card.js +1 -1
- package/es/card/card.css +1 -1
- package/es/card/props.js +8 -6
- package/es/checkbox/props.js +4 -9
- package/es/checkbox-group/props.js +3 -6
- package/es/chip/props.js +2 -4
- package/es/col/props.js +4 -4
- package/es/collapse/props.js +3 -6
- package/es/countdown/props.js +3 -6
- package/es/counter/props.js +6 -15
- package/es/date-picker/props.js +5 -9
- package/es/dialog/index.js +5 -5
- package/es/dialog/props.js +6 -14
- package/es/form/Form.js +28 -2
- package/es/form/props.js +12 -0
- package/es/form/provide.js +10 -1
- package/es/icon/Icon.js +1 -1
- package/es/icon/icon.css +1 -1
- package/es/icon/props.js +2 -3
- package/es/image/props.js +5 -9
- package/es/image-preview/index.js +3 -3
- package/es/image-preview/props.js +2 -4
- package/es/index-bar/props.js +3 -6
- package/es/index.js +10 -0
- package/es/input/Input.js +3 -1
- package/es/input/props.js +8 -21
- package/es/link/props.js +3 -3
- package/es/list/props.js +4 -9
- package/es/menu/Menu.js +1 -1
- package/es/menu/props.js +7 -15
- package/es/overlay/props.js +3 -6
- package/es/pagination/Pagination.js +8 -6
- package/es/pagination/porps.js +4 -9
- package/es/picker/index.js +5 -5
- package/es/picker/props.js +5 -11
- package/es/popup/Popup.js +6 -12
- package/es/popup/popup.css +1 -1
- package/es/popup/props.js +9 -21
- package/es/pull-refresh/PullRefresh.js +3 -5
- package/es/pull-refresh/props.js +3 -6
- package/es/radio/props.js +4 -9
- package/es/radio-group/props.js +3 -6
- package/es/rate/props.js +3 -6
- package/es/row/props.js +3 -3
- package/es/select/props.js +8 -21
- package/es/slider/props.js +6 -12
- package/es/snackbar/core.js +5 -7
- package/es/snackbar/index.js +7 -4
- package/es/snackbar/props.js +6 -20
- package/es/steps/props.js +3 -3
- package/es/sticky/props.js +2 -3
- package/es/style.css +1 -1
- package/es/style.js +2 -0
- package/es/swipe/props.js +2 -3
- package/es/switch/props.js +4 -9
- package/es/tab/Tab.js +2 -2
- package/es/tab/props.js +2 -3
- package/es/tabs/props.js +4 -10
- package/es/tabs-items/props.js +2 -3
- package/es/themes/dark/breadcrumb.js +3 -0
- package/es/themes/dark/card.js +1 -0
- package/es/themes/dark/index.js +2 -1
- package/es/time-picker/props.js +3 -6
- package/es/umdIndex.js +10 -0
- package/es/uploader/Uploader.js +23 -8
- package/es/uploader/props.js +7 -18
- package/es/utils/components.js +15 -3
- package/es/utils/types.js +1 -0
- package/es/varlet.esm.js +5769 -5811
- package/highlight/attributes.json +30 -14
- package/highlight/tags.json +14 -2
- package/highlight/web-types.json +90 -16
- package/lib/action-sheet/index.js +3 -3
- package/lib/action-sheet/props.js +2 -6
- package/lib/back-top/props.js +4 -3
- package/lib/bottom-navigation/BottomNavigation.js +7 -1
- package/lib/bottom-navigation/props.js +7 -12
- package/lib/bottom-navigation-item/props.js +4 -3
- package/lib/breadcrumb/Breadcrumb.js +79 -0
- package/lib/breadcrumb/BreadcrumbSfc.css +0 -0
- package/lib/breadcrumb/breadcrumb.css +1 -0
- package/lib/breadcrumb/index.js +17 -0
- package/lib/breadcrumb/props.js +14 -0
- package/lib/breadcrumb/provide.js +28 -0
- package/lib/breadcrumb/style/index.js +3 -0
- package/lib/breadcrumbs/Breadcrumbs.js +50 -0
- package/lib/breadcrumbs/BreadcrumbsSfc.css +0 -0
- package/lib/breadcrumbs/breadcrumbs.css +1 -0
- package/lib/breadcrumbs/index.js +17 -0
- package/lib/breadcrumbs/props.js +11 -0
- package/lib/breadcrumbs/provide.js +27 -0
- package/lib/breadcrumbs/style/index.js +3 -0
- package/lib/button/Button.js +6 -3
- package/lib/button/props.js +2 -6
- package/lib/card/Card.js +1 -1
- package/lib/card/card.css +1 -1
- package/lib/card/props.js +8 -6
- package/lib/checkbox/props.js +6 -9
- package/lib/checkbox-group/props.js +4 -6
- package/lib/chip/props.js +1 -3
- package/lib/col/props.js +4 -4
- package/lib/collapse/props.js +5 -6
- package/lib/countdown/props.js +5 -6
- package/lib/counter/props.js +8 -15
- package/lib/date-picker/props.js +5 -9
- package/lib/dialog/index.js +4 -4
- package/lib/dialog/props.js +5 -13
- package/lib/form/Form.js +31 -2
- package/lib/form/props.js +13 -0
- package/lib/form/provide.js +11 -1
- package/lib/icon/Icon.js +1 -1
- package/lib/icon/icon.css +1 -1
- package/lib/icon/props.js +4 -3
- package/lib/image/props.js +5 -9
- package/lib/image-preview/index.js +2 -2
- package/lib/image-preview/props.js +1 -3
- package/lib/index-bar/props.js +5 -6
- package/lib/index.js +6 -0
- package/lib/input/Input.js +3 -1
- package/lib/input/props.js +9 -21
- package/lib/link/props.js +3 -3
- package/lib/list/props.js +6 -9
- package/lib/menu/Menu.js +1 -1
- package/lib/menu/props.js +7 -15
- package/lib/overlay/props.js +5 -6
- package/lib/pagination/Pagination.js +7 -5
- package/lib/pagination/porps.js +6 -9
- package/lib/picker/index.js +4 -4
- package/lib/picker/props.js +4 -10
- package/lib/popup/Popup.js +5 -11
- package/lib/popup/popup.css +1 -1
- package/lib/popup/props.js +9 -21
- package/lib/pull-refresh/PullRefresh.js +2 -4
- package/lib/pull-refresh/props.js +5 -6
- package/lib/radio/props.js +6 -9
- package/lib/radio-group/props.js +4 -6
- package/lib/rate/props.js +5 -6
- package/lib/row/props.js +3 -3
- package/lib/select/props.js +9 -21
- package/lib/slider/props.js +6 -12
- package/lib/snackbar/core.js +4 -6
- package/lib/snackbar/index.js +6 -3
- package/lib/snackbar/props.js +5 -19
- package/lib/snackbar/style/index.js +1 -1
- package/lib/steps/props.js +3 -3
- package/lib/sticky/props.js +4 -3
- package/lib/style.css +1 -1
- package/lib/style.js +2 -0
- package/lib/swipe/props.js +4 -3
- package/lib/switch/props.js +6 -9
- package/lib/tab/Tab.js +1 -1
- package/lib/tab/props.js +4 -3
- package/lib/tabs/props.js +3 -9
- package/lib/tabs-items/props.js +4 -3
- package/lib/themes/dark/breadcrumb.js +8 -0
- package/lib/themes/dark/card.js +1 -0
- package/lib/themes/dark/index.js +3 -1
- package/lib/time-picker/props.js +5 -6
- package/lib/uploader/Uploader.js +22 -7
- package/lib/uploader/props.js +9 -18
- package/lib/utils/components.js +17 -3
- package/lib/utils/types.js +3 -0
- package/package.json +5 -5
- package/types/actionSheet.d.ts +9 -10
- package/types/backTop.d.ts +2 -2
- package/types/breadcrumb.d.ts +18 -0
- package/types/breadcrumbs.d.ts +16 -0
- package/types/button.d.ts +3 -3
- package/types/card.d.ts +3 -3
- package/types/checkbox.d.ts +4 -4
- package/types/checkboxGroup.d.ts +3 -3
- package/types/chip.d.ts +2 -2
- package/types/col.d.ts +2 -2
- package/types/collapse.d.ts +3 -3
- package/types/countdown.d.ts +3 -3
- package/types/counter.d.ts +6 -6
- package/types/datePicker.d.ts +4 -4
- package/types/dialog.d.ts +10 -10
- package/types/form.d.ts +4 -0
- package/types/icon.d.ts +2 -2
- package/types/image.d.ts +4 -4
- package/types/imagePreview.d.ts +7 -7
- package/types/index.d.ts +4 -0
- package/types/indexBar.d.ts +3 -3
- package/types/input.d.ts +8 -8
- package/types/link.d.ts +2 -2
- package/types/list.d.ts +4 -4
- package/types/menu.d.ts +6 -6
- package/types/overlay.d.ts +3 -3
- package/types/pagination.d.ts +4 -4
- package/types/picker.d.ts +4 -4
- package/types/popup.d.ts +7 -7
- package/types/pullRefresh.d.ts +3 -3
- package/types/radio.d.ts +4 -4
- package/types/radioGroup.d.ts +3 -3
- package/types/rate.d.ts +3 -3
- package/types/row.d.ts +2 -2
- package/types/select.d.ts +8 -8
- package/types/slider.d.ts +5 -5
- package/types/snackbar.d.ts +6 -6
- package/types/steps.d.ts +2 -2
- package/types/sticky.d.ts +2 -2
- package/types/swipe.d.ts +2 -2
- package/types/switch.d.ts +4 -4
- package/types/tab.d.ts +2 -2
- package/types/tabs.d.ts +4 -4
- package/types/tabsItems.d.ts +3 -3
- package/types/timePicker.d.ts +3 -3
- package/types/uploader.d.ts +8 -8
- package/types/varComponent.d.ts +2 -0
- package/umd/varlet.js +7 -7
package/es/action-sheet/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import VarActionSheet from './ActionSheet.js'
|
|
2
2
|
import { nextTick, reactive } from 'vue';
|
|
3
3
|
import { inBrowser } from '@varlet/shared';
|
|
4
|
-
import { mountInstance } from '../utils/components';
|
|
4
|
+
import { call, mountInstance } from '../utils/components';
|
|
5
5
|
var singletonOptions;
|
|
6
6
|
|
|
7
7
|
function ActionSheet(options) {
|
|
@@ -18,15 +18,15 @@ function ActionSheet(options) {
|
|
|
18
18
|
unmountInstance
|
|
19
19
|
} = mountInstance(VarActionSheet, reactiveActionSheetOptions, {
|
|
20
20
|
onSelect: action => {
|
|
21
|
-
reactiveActionSheetOptions.onSelect
|
|
21
|
+
call(reactiveActionSheetOptions.onSelect, action);
|
|
22
22
|
resolve(action);
|
|
23
23
|
},
|
|
24
24
|
onClose: () => {
|
|
25
|
-
reactiveActionSheetOptions.onClose
|
|
25
|
+
call(reactiveActionSheetOptions.onClose);
|
|
26
26
|
resolve('close');
|
|
27
27
|
},
|
|
28
28
|
onClosed: () => {
|
|
29
|
-
reactiveActionSheetOptions.onClosed
|
|
29
|
+
call(reactiveActionSheetOptions.onClosed);
|
|
30
30
|
unmountInstance();
|
|
31
31
|
singletonOptions === reactiveActionSheetOptions && (singletonOptions = null);
|
|
32
32
|
},
|
package/es/action-sheet/props.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
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); }
|
|
2
2
|
|
|
3
|
-
import { pickProps } from '../utils/components';
|
|
3
|
+
import { defineListenerProp, pickProps } from '../utils/components';
|
|
4
4
|
import { props as popupProps } from '../popup/props';
|
|
5
5
|
export var props = _extends({
|
|
6
6
|
show: {
|
|
@@ -18,11 +18,7 @@ export var props = _extends({
|
|
|
18
18
|
type: Boolean,
|
|
19
19
|
default: true
|
|
20
20
|
},
|
|
21
|
-
onSelect:
|
|
22
|
-
|
|
23
|
-
},
|
|
24
|
-
'onUpdate:show': {
|
|
25
|
-
type: Function
|
|
26
|
-
}
|
|
21
|
+
onSelect: defineListenerProp(),
|
|
22
|
+
'onUpdate:show': defineListenerProp()
|
|
27
23
|
}, pickProps(popupProps, ['overlay', 'overlayClass', 'overlayStyle', 'lockScroll', 'closeOnClickOverlay', 'teleport', 'onOpen', 'onClose', 'onOpened', 'onClosed', 'onClickOverlay', // internal for function call closes the dialog
|
|
28
24
|
'onRouteChange']));
|
package/es/back-top/props.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { defineListenerProp } from '../utils/components';
|
|
1
2
|
export var props = {
|
|
2
3
|
visibilityHeight: {
|
|
3
4
|
type: [Number, String],
|
|
@@ -16,7 +17,5 @@ export var props = {
|
|
|
16
17
|
target: {
|
|
17
18
|
type: [String, Object]
|
|
18
19
|
},
|
|
19
|
-
onClick:
|
|
20
|
-
type: Function
|
|
21
|
-
}
|
|
20
|
+
onClick: defineListenerProp()
|
|
22
21
|
};
|
|
@@ -5,7 +5,7 @@ import { defineComponent, ref, computed, onMounted, onUpdated, watch } from 'vue
|
|
|
5
5
|
import { props } from './props';
|
|
6
6
|
import { useBottomNavigationItems } from './provide';
|
|
7
7
|
import { createNamespace, call } from '../utils/components';
|
|
8
|
-
import { isNumber } from '@varlet/shared';
|
|
8
|
+
import { isNumber, isArray } from '@varlet/shared';
|
|
9
9
|
var {
|
|
10
10
|
n,
|
|
11
11
|
classes
|
|
@@ -115,7 +115,13 @@ export default defineComponent({
|
|
|
115
115
|
};
|
|
116
116
|
|
|
117
117
|
var handleBeforeChange = changedValue => {
|
|
118
|
-
|
|
118
|
+
var results = call(props.onBeforeChange, changedValue);
|
|
119
|
+
results = isArray(results) ? results : [results];
|
|
120
|
+
Promise.all(results).then(results => {
|
|
121
|
+
if (!results.some(result => !result)) {
|
|
122
|
+
handleChange(changedValue);
|
|
123
|
+
}
|
|
124
|
+
});
|
|
119
125
|
};
|
|
120
126
|
|
|
121
127
|
var handleChange = changedValue => {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { defineListenerProp } from '../utils/components';
|
|
1
2
|
export var props = {
|
|
2
3
|
active: {
|
|
3
4
|
type: [Number, String],
|
|
@@ -25,18 +26,10 @@ export var props = {
|
|
|
25
26
|
inactiveColor: {
|
|
26
27
|
type: String
|
|
27
28
|
},
|
|
28
|
-
onChange:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
type: Function
|
|
33
|
-
},
|
|
34
|
-
onBeforeChange: {
|
|
35
|
-
type: Function
|
|
36
|
-
},
|
|
37
|
-
onFabClick: {
|
|
38
|
-
type: Function
|
|
39
|
-
},
|
|
29
|
+
onChange: defineListenerProp(),
|
|
30
|
+
'onUpdate:active': defineListenerProp(),
|
|
31
|
+
onBeforeChange: defineListenerProp(),
|
|
32
|
+
onFabClick: defineListenerProp(),
|
|
40
33
|
fabProps: {
|
|
41
34
|
type: Object
|
|
42
35
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { defineListenerProp } from '../utils/components';
|
|
1
2
|
export var props = {
|
|
2
3
|
name: {
|
|
3
4
|
type: String
|
|
@@ -16,7 +17,5 @@ export var props = {
|
|
|
16
17
|
type: [Boolean, Object],
|
|
17
18
|
default: false
|
|
18
19
|
},
|
|
19
|
-
onClick:
|
|
20
|
-
type: Function
|
|
21
|
-
}
|
|
20
|
+
onClick: defineListenerProp()
|
|
22
21
|
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { defineComponent, computed } from 'vue';
|
|
2
|
+
import { props } from './props';
|
|
3
|
+
import { useBreadcrumb } from './provide';
|
|
4
|
+
import { call, createNamespace } from '../utils/components';
|
|
5
|
+
var {
|
|
6
|
+
n,
|
|
7
|
+
classes
|
|
8
|
+
} = createNamespace('breadcrumb');
|
|
9
|
+
import { renderSlot as _renderSlot, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, toDisplayString as _toDisplayString, createCommentVNode as _createCommentVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
|
|
10
|
+
export function render(_ctx, _cache) {
|
|
11
|
+
return _openBlock(), _createElementBlock("div", {
|
|
12
|
+
class: _normalizeClass(_ctx.n())
|
|
13
|
+
}, [_createElementVNode("div", {
|
|
14
|
+
class: _normalizeClass(_ctx.classes(_ctx.n('content'), [!_ctx.isLast, _ctx.n('--active')])),
|
|
15
|
+
onClick: _cache[0] || (_cache[0] = function () {
|
|
16
|
+
return _ctx.handleClick && _ctx.handleClick(...arguments);
|
|
17
|
+
})
|
|
18
|
+
}, [_renderSlot(_ctx.$slots, "default")], 2
|
|
19
|
+
/* CLASS */
|
|
20
|
+
), !_ctx.isLast ? _renderSlot(_ctx.$slots, "separator", {
|
|
21
|
+
key: 0
|
|
22
|
+
}, () => {
|
|
23
|
+
var _ctx$separator;
|
|
24
|
+
|
|
25
|
+
return [_createElementVNode("div", {
|
|
26
|
+
class: _normalizeClass(_ctx.n('separator'))
|
|
27
|
+
}, _toDisplayString((_ctx$separator = _ctx.separator) != null ? _ctx$separator : _ctx.parentSeparator), 3
|
|
28
|
+
/* TEXT, CLASS */
|
|
29
|
+
)];
|
|
30
|
+
}) : _createCommentVNode("v-if", true)], 2
|
|
31
|
+
/* CLASS */
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
export default defineComponent({
|
|
35
|
+
render,
|
|
36
|
+
name: 'VarBreadcrumb',
|
|
37
|
+
props,
|
|
38
|
+
|
|
39
|
+
setup(props) {
|
|
40
|
+
var {
|
|
41
|
+
index,
|
|
42
|
+
breadcrumb,
|
|
43
|
+
bindBreadcrumb
|
|
44
|
+
} = useBreadcrumb();
|
|
45
|
+
var isLast = computed(() => index.value === breadcrumb.length.value - 1);
|
|
46
|
+
var parentSeparator = computed(() => breadcrumb.separator.value);
|
|
47
|
+
|
|
48
|
+
var handleClick = e => {
|
|
49
|
+
if (isLast.value) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
call(props.onClick, e);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
bindBreadcrumb(null);
|
|
57
|
+
return {
|
|
58
|
+
n,
|
|
59
|
+
classes,
|
|
60
|
+
isLast,
|
|
61
|
+
parentSeparator,
|
|
62
|
+
handleClick
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
});
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:root { --breadcrumb-active-color: var(--color-primary); --breadcrumb-inactive-color: #888; --breadcrumb-separator-margin: 0 10px; --breadcrumb-separator-font-size: 14px;}.var-breadcrumb { display: flex; align-items: center; color: var(--breadcrumb-inactive-color);}.var-breadcrumb__separator { margin: var(--breadcrumb-separator-margin); font-size: var(--breadcrumb-separator-font-size);}.var-breadcrumb--active { color: var(--breadcrumb-active-color); transition: opacity 0.25s;}.var-breadcrumb--active:hover { opacity: 0.7; cursor: pointer;}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { useAtParentIndex, useParent } from '../utils/components';
|
|
2
|
+
import { BREADCRUMBS_BIND_BREADCRUMB_ITEM_KEY, BREADCRUMBS_COUNT_BREADCRUMB_ITEM_KEY } from '../breadcrumbs/provide';
|
|
3
|
+
export function useBreadcrumb() {
|
|
4
|
+
var {
|
|
5
|
+
parentProvider,
|
|
6
|
+
bindParent
|
|
7
|
+
} = useParent(BREADCRUMBS_BIND_BREADCRUMB_ITEM_KEY);
|
|
8
|
+
var {
|
|
9
|
+
index
|
|
10
|
+
} = useAtParentIndex(BREADCRUMBS_COUNT_BREADCRUMB_ITEM_KEY);
|
|
11
|
+
|
|
12
|
+
if (!parentProvider || !bindParent || !index) {
|
|
13
|
+
throw Error('<var-breadcrumb/> must in <var-breadcrumbs/>');
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return {
|
|
17
|
+
index,
|
|
18
|
+
breadcrumb: parentProvider,
|
|
19
|
+
bindBreadcrumb: bindParent
|
|
20
|
+
};
|
|
21
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { defineComponent, computed } from 'vue';
|
|
2
|
+
import { props } from './props';
|
|
3
|
+
import { useBreadcrumbsList } from './provide';
|
|
4
|
+
import { createNamespace } from '../utils/components';
|
|
5
|
+
var {
|
|
6
|
+
n
|
|
7
|
+
} = createNamespace('breadcrumbs');
|
|
8
|
+
import { renderSlot as _renderSlot, normalizeClass as _normalizeClass, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
|
|
9
|
+
export function render(_ctx, _cache) {
|
|
10
|
+
return _openBlock(), _createElementBlock("div", {
|
|
11
|
+
class: _normalizeClass(_ctx.n())
|
|
12
|
+
}, [_renderSlot(_ctx.$slots, "default")], 2
|
|
13
|
+
/* CLASS */
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
export default defineComponent({
|
|
17
|
+
render,
|
|
18
|
+
name: 'VarBreadcrumbs',
|
|
19
|
+
props,
|
|
20
|
+
|
|
21
|
+
setup(props) {
|
|
22
|
+
var separator = computed(() => props.separator);
|
|
23
|
+
var {
|
|
24
|
+
bindBreadcrumbList,
|
|
25
|
+
length
|
|
26
|
+
} = useBreadcrumbsList();
|
|
27
|
+
var breadcrumbsProvider = {
|
|
28
|
+
length,
|
|
29
|
+
separator
|
|
30
|
+
};
|
|
31
|
+
bindBreadcrumbList(breadcrumbsProvider);
|
|
32
|
+
return {
|
|
33
|
+
n
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
});
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.var-breadcrumbs { display: flex; flex-wrap: wrap; align-items: center;}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useAtChildrenCounter, useChildren } from '../utils/components';
|
|
2
|
+
export var BREADCRUMBS_BIND_BREADCRUMB_ITEM_KEY = Symbol('BREADCRUMBS_BIND_BREADCRUMB_KEY');
|
|
3
|
+
export var BREADCRUMBS_COUNT_BREADCRUMB_ITEM_KEY = Symbol('BREADCRUMBS_COUNT_BREADCRUMB_KEY');
|
|
4
|
+
export function useBreadcrumbsList() {
|
|
5
|
+
var {
|
|
6
|
+
childProviders,
|
|
7
|
+
bindChildren
|
|
8
|
+
} = useChildren(BREADCRUMBS_BIND_BREADCRUMB_ITEM_KEY);
|
|
9
|
+
var {
|
|
10
|
+
length
|
|
11
|
+
} = useAtChildrenCounter(BREADCRUMBS_COUNT_BREADCRUMB_ITEM_KEY);
|
|
12
|
+
return {
|
|
13
|
+
length,
|
|
14
|
+
breadcrumbList: childProviders,
|
|
15
|
+
bindBreadcrumbList: bindChildren
|
|
16
|
+
};
|
|
17
|
+
}
|
package/es/button/Button.js
CHANGED
|
@@ -2,7 +2,8 @@ import Ripple from '../ripple';
|
|
|
2
2
|
import VarLoading from '../loading';
|
|
3
3
|
import { defineComponent, ref } from 'vue';
|
|
4
4
|
import { props } from './props';
|
|
5
|
-
import { createNamespace } from '../utils/components';
|
|
5
|
+
import { call, createNamespace } from '../utils/components';
|
|
6
|
+
import { isArray } from '@varlet/shared';
|
|
6
7
|
var {
|
|
7
8
|
n,
|
|
8
9
|
classes
|
|
@@ -67,7 +68,8 @@ export default defineComponent({
|
|
|
67
68
|
var attemptAutoLoading = result => {
|
|
68
69
|
if (props.autoLoading) {
|
|
69
70
|
pending.value = true;
|
|
70
|
-
|
|
71
|
+
result = isArray(result) ? result : [result];
|
|
72
|
+
Promise.all(result).then(() => {
|
|
71
73
|
pending.value = false;
|
|
72
74
|
}).catch(() => {
|
|
73
75
|
pending.value = false;
|
|
@@ -86,7 +88,7 @@ export default defineComponent({
|
|
|
86
88
|
return;
|
|
87
89
|
}
|
|
88
90
|
|
|
89
|
-
attemptAutoLoading(onClick
|
|
91
|
+
attemptAutoLoading(call(onClick, e));
|
|
90
92
|
};
|
|
91
93
|
|
|
92
94
|
var handleTouchstart = e => {
|
|
@@ -100,7 +102,7 @@ export default defineComponent({
|
|
|
100
102
|
return;
|
|
101
103
|
}
|
|
102
104
|
|
|
103
|
-
attemptAutoLoading(onTouchstart
|
|
105
|
+
attemptAutoLoading(call(onTouchstart, e));
|
|
104
106
|
};
|
|
105
107
|
|
|
106
108
|
return {
|
package/es/button/props.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
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); }
|
|
2
2
|
|
|
3
3
|
import { props as loadingProps } from '../loading/props';
|
|
4
|
-
import { pickProps } from '../utils/components';
|
|
4
|
+
import { defineListenerProp, pickProps } from '../utils/components';
|
|
5
5
|
|
|
6
6
|
function typeValidator(type) {
|
|
7
7
|
return ['default', 'primary', 'info', 'success', 'warning', 'danger'].includes(type);
|
|
@@ -68,10 +68,6 @@ export var props = {
|
|
|
68
68
|
loadingColor: _extends({}, pickProps(loadingProps, 'color'), {
|
|
69
69
|
default: 'currentColor'
|
|
70
70
|
}),
|
|
71
|
-
onClick:
|
|
72
|
-
|
|
73
|
-
},
|
|
74
|
-
onTouchstart: {
|
|
75
|
-
type: Function
|
|
76
|
-
}
|
|
71
|
+
onClick: defineListenerProp(),
|
|
72
|
+
onTouchstart: defineListenerProp()
|
|
77
73
|
};
|
package/es/card/Card.js
CHANGED
|
@@ -30,7 +30,7 @@ export function render(_ctx, _cache) {
|
|
|
30
30
|
|
|
31
31
|
return _withDirectives((_openBlock(), _createElementBlock("div", {
|
|
32
32
|
ref: "card",
|
|
33
|
-
class: _normalizeClass(_ctx.classes(_ctx.n(), [_ctx.isRow, _ctx.n('--layout-row')], [_ctx.elevation, _ctx.n("$-elevation--" + _ctx.elevation), _ctx.n('$-elevation--1')])),
|
|
33
|
+
class: _normalizeClass(_ctx.classes(_ctx.n(), [_ctx.isRow, _ctx.n('--layout-row')], [_ctx.outline, _ctx.n('--outline')], [_ctx.elevation, _ctx.n("$-elevation--" + _ctx.elevation), _ctx.n('$-elevation--1')])),
|
|
34
34
|
style: _normalizeStyle({
|
|
35
35
|
zIndex: _ctx.floated ? _ctx.zIndex : undefined
|
|
36
36
|
}),
|
package/es/card/card.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root { --card-padding: 0 0 15px 0; --card-background: #fff; --card-border-radius: 4px; --card-image-width: 100%; --card-row-image-width: 140px; --card-image-height: 200px; --card-row-height: 140px; --card-title-color: #333; --card-title-font-size: 20px; --card-title-padding: 0 12px; --card-title-margin: 15px 0 0 0; --card-title-row-margin: 12px 0; --card-subtitle-color: rgba(0, 0, 0, 0.6); --card-subtitle-font-size: 14px; --card-subtitle-padding: 0 12px; --card-subtitle-margin: 10px 0 0 0; --card-subtitle-row-margin: -8px 0 0 0; --card-description-color: rgba(0, 0, 0, 0.6); --card-description-font-size: 14px; --card-description-margin: 20px 0 0 0; --card-description-padding: 0 13px; --card-footer-padding: 0 12px; --card-footer-right: 13px; --card-footer-bottom: 9px; --card-footer-margin: 30px 0 0 0; --card-line-height: 22px; --card-row-line-height: 1.5; --card-floating-buttons-bottom: 16px; --card-floating-buttons-right: 16px; --card-floating-buttons-color: #fff; --card-close-button-icon-size: 24px; --card-close-button-size: 56px; --card-close-button-primary-color: #212121;}.var-card { border-radius: var(--card-border-radius); overflow: hidden; width: 100%;}.var-card__floater { display: flex; flex-direction: column; position: static; line-height: var(--card-line-height); background: var(--card-background); transition: background-color 0.25s, color 0.25s; transition-timing-function: cubic-bezier(0.45, 0.19, 0.06, 0.89);}.var-card__container { padding: var(--card-padding); flex-grow: 1; min-width: 0;}.var-card--layout-row .var-card__floater { min-height: var(--card-row-height); height: 100%; flex-direction: row; position: relative; line-height: var(--card-row-line-height);}.var-card__image { width: var(--card-image-width); height: var(--card-image-height); display: block;}.var-card--layout-row .var-card__image { width: var(--card-row-image-width); height: auto; display: block; flex-shrink: 0;}.var-card__title { font-size: var(--card-title-font-size); padding: var(--card-title-padding); margin: var(--card-title-margin); color: var(--card-title-color); word-break: break-word;}.var-card--layout-row .var-card__title { max-width: 100%; overflow: hidden; margin: var(--card-title-row-margin); text-overflow: ellipsis; white-space: nowrap;}.var-card__subtitle { font-size: var(--card-subtitle-font-size); color: var(--card-subtitle-color); padding: var(--card-subtitle-padding); margin: var(--card-subtitle-margin); word-break: break-word;}.var-card--layout-row .var-card__subtitle { margin: var(--card-subtitle-row-margin); text-overflow: ellipsis; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;}.var-card__description { font-size: var(--card-description-font-size); color: var(--card-description-color); margin: var(--card-description-margin); padding: var(--card-description-padding); word-break: break-all;}.var-card__footer { display: flex; justify-content: flex-end; padding: var(--card-footer-padding); margin: var(--card-footer-margin);}.var-card--layout-row .var-card__footer { position: absolute; padding: 0; right: var(--card-footer-right); bottom: var(--card-footer-bottom);}.var-card__floating-content { overflow: hidden; transition-timing-function: cubic-bezier(0.45, 0.19, 0.06, 0.89);}.var-card__floating-buttons { position: fixed; bottom: var(--card-floating-buttons-bottom); right: var(--card-floating-buttons-right); color: var(--card-floating-buttons-color);}.var-card__close-button[var-card-cover] { padding: var(--card-close-button-padding); width: var(--card-close-button-size); height: var(--card-close-button-size); background-color: var(--card-close-button-primary-color);}.var-card__close-button-icon[var-card-cover] { font-size: var(--card-close-button-icon-size);}
|
|
1
|
+
:root { --card-padding: 0 0 15px 0; --card-background: #fff; --card-outline-color: rgba(0, 0, 0, 0.12); --card-border-radius: 4px; --card-image-width: 100%; --card-row-image-width: 140px; --card-image-height: 200px; --card-row-height: 140px; --card-title-color: #333; --card-title-font-size: 20px; --card-title-padding: 0 12px; --card-title-margin: 15px 0 0 0; --card-title-row-margin: 12px 0; --card-subtitle-color: rgba(0, 0, 0, 0.6); --card-subtitle-font-size: 14px; --card-subtitle-padding: 0 12px; --card-subtitle-margin: 10px 0 0 0; --card-subtitle-row-margin: -8px 0 0 0; --card-description-color: rgba(0, 0, 0, 0.6); --card-description-font-size: 14px; --card-description-margin: 20px 0 0 0; --card-description-padding: 0 13px; --card-footer-padding: 0 12px; --card-footer-right: 13px; --card-footer-bottom: 9px; --card-footer-margin: 30px 0 0 0; --card-line-height: 22px; --card-row-line-height: 1.5; --card-floating-buttons-bottom: 16px; --card-floating-buttons-right: 16px; --card-floating-buttons-color: #fff; --card-close-button-icon-size: 24px; --card-close-button-size: 56px; --card-close-button-primary-color: #212121;}.var-card { border-radius: var(--card-border-radius); overflow: hidden; width: 100%;}.var-card--outline { border: thin solid var(--card-outline-color);}.var-card__floater { display: flex; flex-direction: column; position: static; line-height: var(--card-line-height); background: var(--card-background); transition: background-color 0.25s, color 0.25s; transition-timing-function: cubic-bezier(0.45, 0.19, 0.06, 0.89);}.var-card__container { padding: var(--card-padding); flex-grow: 1; min-width: 0;}.var-card--layout-row .var-card__floater { min-height: var(--card-row-height); height: 100%; flex-direction: row; position: relative; line-height: var(--card-row-line-height);}.var-card__image { width: var(--card-image-width); height: var(--card-image-height); display: block;}.var-card--layout-row .var-card__image { width: var(--card-row-image-width); height: auto; display: block; flex-shrink: 0;}.var-card__title { font-size: var(--card-title-font-size); padding: var(--card-title-padding); margin: var(--card-title-margin); color: var(--card-title-color); word-break: break-word;}.var-card--layout-row .var-card__title { max-width: 100%; overflow: hidden; margin: var(--card-title-row-margin); text-overflow: ellipsis; white-space: nowrap;}.var-card__subtitle { font-size: var(--card-subtitle-font-size); color: var(--card-subtitle-color); padding: var(--card-subtitle-padding); margin: var(--card-subtitle-margin); word-break: break-word;}.var-card--layout-row .var-card__subtitle { margin: var(--card-subtitle-row-margin); text-overflow: ellipsis; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;}.var-card__description { font-size: var(--card-description-font-size); color: var(--card-description-color); margin: var(--card-description-margin); padding: var(--card-description-padding); word-break: break-all;}.var-card__footer { display: flex; justify-content: flex-end; padding: var(--card-footer-padding); margin: var(--card-footer-margin);}.var-card--layout-row .var-card__footer { position: absolute; padding: 0; right: var(--card-footer-right); bottom: var(--card-footer-bottom);}.var-card__floating-content { overflow: hidden; transition-timing-function: cubic-bezier(0.45, 0.19, 0.06, 0.89);}.var-card__floating-buttons { position: fixed; bottom: var(--card-floating-buttons-bottom); right: var(--card-floating-buttons-right); color: var(--card-floating-buttons-color);}.var-card__close-button[var-card-cover] { padding: var(--card-close-button-padding); width: var(--card-close-button-size); height: var(--card-close-button-size); background-color: var(--card-close-button-primary-color);}.var-card__close-button-icon[var-card-cover] { font-size: var(--card-close-button-icon-size);}
|
package/es/card/props.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { defineListenerProp } from '../utils/components';
|
|
2
|
+
|
|
1
3
|
function fitValidator(fit) {
|
|
2
4
|
return ['fill', 'contain', 'cover', 'none', 'scale-down'].includes(fit);
|
|
3
5
|
}
|
|
@@ -17,6 +19,10 @@ export var props = {
|
|
|
17
19
|
imageWidth: {
|
|
18
20
|
type: [String, Number]
|
|
19
21
|
},
|
|
22
|
+
outline: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: false
|
|
25
|
+
},
|
|
20
26
|
layout: {
|
|
21
27
|
type: String,
|
|
22
28
|
default: 'column'
|
|
@@ -25,9 +31,6 @@ export var props = {
|
|
|
25
31
|
type: Boolean,
|
|
26
32
|
default: false
|
|
27
33
|
},
|
|
28
|
-
'onUpdate:floating': {
|
|
29
|
-
type: Function
|
|
30
|
-
},
|
|
31
34
|
floatingDuration: {
|
|
32
35
|
type: Number,
|
|
33
36
|
default: 250
|
|
@@ -51,7 +54,6 @@ export var props = {
|
|
|
51
54
|
type: Boolean,
|
|
52
55
|
default: false
|
|
53
56
|
},
|
|
54
|
-
onClick:
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
+
onClick: defineListenerProp(),
|
|
58
|
+
'onUpdate:floating': defineListenerProp()
|
|
57
59
|
};
|
package/es/checkbox/props.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { defineListenerProp } from '../utils/components';
|
|
1
2
|
export var props = {
|
|
2
3
|
modelValue: {
|
|
3
4
|
type: [String, Number, Boolean, Object, Array],
|
|
@@ -39,13 +40,7 @@ export var props = {
|
|
|
39
40
|
rules: {
|
|
40
41
|
type: Array
|
|
41
42
|
},
|
|
42
|
-
onClick:
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
onChange: {
|
|
46
|
-
type: Function
|
|
47
|
-
},
|
|
48
|
-
'onUpdate:modelValue': {
|
|
49
|
-
type: Function
|
|
50
|
-
}
|
|
43
|
+
onClick: defineListenerProp(),
|
|
44
|
+
onChange: defineListenerProp(),
|
|
45
|
+
'onUpdate:modelValue': defineListenerProp()
|
|
51
46
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { defineListenerProp } from '../utils/components';
|
|
1
2
|
export function directionValidator(direction) {
|
|
2
3
|
return ['horizontal', 'vertical'].includes(direction);
|
|
3
4
|
}
|
|
@@ -21,10 +22,6 @@ export var props = {
|
|
|
21
22
|
rules: {
|
|
22
23
|
type: Array
|
|
23
24
|
},
|
|
24
|
-
onChange:
|
|
25
|
-
|
|
26
|
-
},
|
|
27
|
-
'onUpdate:modelValue': {
|
|
28
|
-
type: Function
|
|
29
|
-
}
|
|
25
|
+
onChange: defineListenerProp(),
|
|
26
|
+
'onUpdate:modelValue': defineListenerProp()
|
|
30
27
|
};
|
package/es/chip/props.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { pickProps } from '../utils/components';
|
|
1
|
+
import { defineListenerProp, pickProps } from '../utils/components';
|
|
2
2
|
import { props as iconProps } from '../icon/props';
|
|
3
3
|
|
|
4
4
|
function typeValidator(type) {
|
|
@@ -43,7 +43,5 @@ export var props = {
|
|
|
43
43
|
type: Boolean,
|
|
44
44
|
default: false
|
|
45
45
|
},
|
|
46
|
-
onClose:
|
|
47
|
-
type: Function
|
|
48
|
-
}
|
|
46
|
+
onClose: defineListenerProp()
|
|
49
47
|
};
|
package/es/col/props.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { defineListenerProp } from '../utils/components';
|
|
2
|
+
|
|
1
3
|
function directionValidator(direction) {
|
|
2
4
|
return ['row', 'column'].includes(direction);
|
|
3
5
|
}
|
|
@@ -16,9 +18,6 @@ export var props = {
|
|
|
16
18
|
default: 'row',
|
|
17
19
|
validator: directionValidator
|
|
18
20
|
},
|
|
19
|
-
onClick: {
|
|
20
|
-
type: Function
|
|
21
|
-
},
|
|
22
21
|
xs: {
|
|
23
22
|
type: [Object, Number, String]
|
|
24
23
|
},
|
|
@@ -33,5 +32,6 @@ export var props = {
|
|
|
33
32
|
},
|
|
34
33
|
xl: {
|
|
35
34
|
type: [Object, Number, String]
|
|
36
|
-
}
|
|
35
|
+
},
|
|
36
|
+
onClick: defineListenerProp()
|
|
37
37
|
};
|
package/es/collapse/props.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { defineListenerProp } from '../utils/components';
|
|
1
2
|
export var props = {
|
|
2
3
|
modelValue: {
|
|
3
4
|
type: [Array, String, Number]
|
|
@@ -10,10 +11,6 @@ export var props = {
|
|
|
10
11
|
type: Boolean,
|
|
11
12
|
default: true
|
|
12
13
|
},
|
|
13
|
-
onChange:
|
|
14
|
-
|
|
15
|
-
},
|
|
16
|
-
'onUpdate:modelValue': {
|
|
17
|
-
type: Function
|
|
18
|
-
}
|
|
14
|
+
onChange: defineListenerProp(),
|
|
15
|
+
'onUpdate:modelValue': defineListenerProp()
|
|
19
16
|
};
|
package/es/countdown/props.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { defineListenerProp } from '../utils/components';
|
|
1
2
|
export var props = {
|
|
2
3
|
time: {
|
|
3
4
|
type: [String, Number],
|
|
@@ -11,10 +12,6 @@ export var props = {
|
|
|
11
12
|
type: Boolean,
|
|
12
13
|
default: true
|
|
13
14
|
},
|
|
14
|
-
onEnd:
|
|
15
|
-
|
|
16
|
-
},
|
|
17
|
-
onChange: {
|
|
18
|
-
type: Function
|
|
19
|
-
}
|
|
15
|
+
onEnd: defineListenerProp(),
|
|
16
|
+
onChange: defineListenerProp()
|
|
20
17
|
};
|
package/es/counter/props.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { defineListenerProp } from '../utils/components';
|
|
1
2
|
export var props = {
|
|
2
3
|
modelValue: {
|
|
3
4
|
type: [String, Number],
|
|
@@ -75,19 +76,9 @@ export var props = {
|
|
|
75
76
|
rules: {
|
|
76
77
|
type: Array
|
|
77
78
|
},
|
|
78
|
-
onBeforeChange:
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
},
|
|
84
|
-
onIncrement: {
|
|
85
|
-
type: Function
|
|
86
|
-
},
|
|
87
|
-
onDecrement: {
|
|
88
|
-
type: Function
|
|
89
|
-
},
|
|
90
|
-
'onUpdate:modelValue': {
|
|
91
|
-
type: Function
|
|
92
|
-
}
|
|
79
|
+
onBeforeChange: defineListenerProp(),
|
|
80
|
+
onChange: defineListenerProp(),
|
|
81
|
+
onIncrement: defineListenerProp(),
|
|
82
|
+
onDecrement: defineListenerProp(),
|
|
83
|
+
'onUpdate:modelValue': defineListenerProp()
|
|
93
84
|
};
|
package/es/date-picker/props.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { defineListenerProp } from '../utils/components';
|
|
2
|
+
|
|
1
3
|
function typeValidator(type) {
|
|
2
4
|
return ['date', 'month'].includes(type);
|
|
3
5
|
}
|
|
@@ -94,13 +96,7 @@ export var props = {
|
|
|
94
96
|
type: Boolean,
|
|
95
97
|
default: true
|
|
96
98
|
},
|
|
97
|
-
onPreview:
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
onChange: {
|
|
101
|
-
type: Function
|
|
102
|
-
},
|
|
103
|
-
'onUpdate:modelValue': {
|
|
104
|
-
type: Function
|
|
105
|
-
}
|
|
99
|
+
onPreview: defineListenerProp(),
|
|
100
|
+
onChange: defineListenerProp(),
|
|
101
|
+
'onUpdate:modelValue': defineListenerProp()
|
|
106
102
|
};
|