@varlet/ui 2.16.7 → 2.16.8-alpha.1695118057982
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/ActionSheet.mjs +97 -67
- package/es/action-sheet/index.mjs +43 -28
- package/es/action-sheet/props.mjs +39 -8
- package/es/app-bar/AppBar.mjs +129 -56
- package/es/app-bar/index.mjs +10 -5
- package/es/app-bar/props.mjs +6 -3
- package/es/avatar/Avatar.mjs +97 -87
- package/es/avatar/index.mjs +10 -5
- package/es/avatar/props.mjs +8 -5
- package/es/avatar-group/AvatarGroup.mjs +26 -20
- package/es/avatar-group/index.mjs +10 -5
- package/es/avatar-group/props.mjs +5 -2
- package/es/back-top/BackTop.mjs +71 -53
- package/es/back-top/index.mjs +10 -5
- package/es/back-top/props.mjs +6 -3
- package/es/badge/Badge.mjs +74 -46
- package/es/badge/index.mjs +10 -5
- package/es/badge/props.mjs +7 -4
- package/es/bottom-navigation/BottomNavigation.mjs +100 -97
- package/es/bottom-navigation/index.mjs +10 -5
- package/es/bottom-navigation/props.mjs +7 -4
- package/es/bottom-navigation/provide.mjs +13 -9
- package/es/bottom-navigation-item/BottomNavigationItem.mjs +93 -74
- package/es/bottom-navigation-item/index.mjs +10 -5
- package/es/bottom-navigation-item/props.mjs +7 -4
- package/es/bottom-navigation-item/provide.mjs +14 -11
- package/es/breadcrumb/Breadcrumb.mjs +51 -36
- package/es/breadcrumb/index.mjs +10 -5
- package/es/breadcrumb/props.mjs +6 -3
- package/es/breadcrumb/provide.mjs +12 -11
- package/es/breadcrumbs/Breadcrumbs.mjs +26 -24
- package/es/breadcrumbs/index.mjs +10 -5
- package/es/breadcrumbs/props.mjs +6 -3
- package/es/breadcrumbs/provide.mjs +11 -9
- package/es/button/Button.mjs +88 -90
- package/es/button/index.mjs +10 -5
- package/es/button/props.mjs +31 -10
- package/es/button/provide.mjs +8 -9
- package/es/button-group/ButtonGroup.mjs +38 -26
- package/es/button-group/index.mjs +8 -4
- package/es/button-group/props.mjs +8 -5
- package/es/button-group/provide.mjs +9 -9
- package/es/card/Card.mjs +292 -189
- package/es/card/index.mjs +10 -5
- package/es/card/props.mjs +9 -6
- package/es/cell/Cell.mjs +96 -52
- package/es/cell/index.mjs +10 -5
- package/es/cell/props.mjs +6 -3
- package/es/checkbox/Checkbox.mjs +136 -130
- package/es/checkbox/index.mjs +10 -5
- package/es/checkbox/props.mjs +9 -6
- package/es/checkbox/provide.mjs +10 -9
- package/es/checkbox-group/CheckboxGroup.mjs +63 -96
- package/es/checkbox-group/index.mjs +10 -5
- package/es/checkbox-group/props.mjs +9 -6
- package/es/checkbox-group/provide.mjs +11 -9
- package/es/chip/Chip.mjs +66 -50
- package/es/chip/index.mjs +10 -5
- package/es/chip/props.mjs +10 -7
- package/es/col/Col.mjs +60 -55
- package/es/col/index.mjs +10 -5
- package/es/col/props.mjs +7 -4
- package/es/col/provide.mjs +8 -9
- package/es/collapse/Collapse.mjs +70 -73
- package/es/collapse/index.mjs +10 -5
- package/es/collapse/props.mjs +7 -4
- package/es/collapse/provide.mjs +11 -9
- package/es/collapse-item/CollapseItem.mjs +156 -93
- package/es/collapse-item/index.mjs +10 -5
- package/es/collapse-item/props.mjs +6 -3
- package/es/collapse-item/provide.mjs +12 -11
- package/es/context/index.mjs +9 -5
- package/es/context/lock.mjs +18 -22
- package/es/context/zIndex.mjs +19 -16
- package/es/countdown/Countdown.mjs +73 -70
- package/es/countdown/index.mjs +10 -5
- package/es/countdown/props.mjs +7 -4
- package/es/counter/Counter.mjs +169 -173
- package/es/counter/index.mjs +10 -5
- package/es/counter/props.mjs +8 -5
- package/es/counter/provide.ts +3 -0
- package/es/date-picker/DatePicker.mjs +411 -304
- package/es/date-picker/index.mjs +10 -5
- package/es/date-picker/props.mjs +71 -45
- package/es/date-picker/src/day-picker-panel.mjs +270 -208
- package/es/date-picker/src/month-picker-panel.mjs +205 -175
- package/es/date-picker/src/panel-header.mjs +101 -83
- package/es/date-picker/src/year-picker-panel.mjs +64 -54
- package/es/dialog/Dialog.mjs +171 -106
- package/es/dialog/index.mjs +49 -33
- package/es/dialog/props.mjs +39 -9
- package/es/divider/Divider.mjs +56 -51
- package/es/divider/index.mjs +10 -5
- package/es/divider/props.mjs +5 -2
- package/es/drag/Drag.mjs +126 -144
- package/es/drag/index.mjs +10 -5
- package/es/drag/props.mjs +8 -5
- package/es/ellipsis/Ellipsis.mjs +81 -50
- package/es/ellipsis/index.mjs +8 -4
- package/es/ellipsis/props.mjs +5 -2
- package/es/fab/Fab.mjs +73 -75
- package/es/fab/index.mjs +8 -4
- package/es/fab/props.mjs +14 -11
- package/es/field-decorator/FieldDecorator.mjs +215 -110
- package/es/field-decorator/props.mjs +9 -6
- package/es/form/Form.mjs +69 -79
- package/es/form/index.mjs +11 -6
- package/es/form/props.mjs +6 -3
- package/es/form/provide.mjs +35 -22
- package/es/form-details/FormDetails.mjs +81 -39
- package/es/form-details/index.mjs +10 -5
- package/es/form-details/props.mjs +7 -4
- package/es/hover/index.mjs +37 -40
- package/es/hover-overlay/HoverOverlay.mjs +18 -14
- package/es/hover-overlay/index.mjs +13 -8
- package/es/hover-overlay/props.mjs +5 -2
- package/es/icon/Icon.mjs +50 -33
- package/es/icon/index.mjs +10 -5
- package/es/icon/props.mjs +7 -4
- package/es/image/Image.mjs +76 -82
- package/es/image/index.mjs +10 -5
- package/es/image/props.mjs +7 -4
- package/es/image-preview/ImagePreview.mjs +176 -193
- package/es/image-preview/index.mjs +44 -30
- package/es/image-preview/props.mjs +34 -9
- package/es/index-anchor/IndexAnchor.mjs +45 -42
- package/es/index-anchor/index.mjs +10 -5
- package/es/index-anchor/props.mjs +5 -2
- package/es/index-anchor/provide.mjs +12 -11
- package/es/index-bar/IndexBar.mjs +130 -131
- package/es/index-bar/index.mjs +10 -5
- package/es/index-bar/props.mjs +6 -3
- package/es/index-bar/provide.mjs +11 -9
- package/es/index.bundle.mjs +1 -1
- package/es/index.mjs +1 -1
- package/es/input/Input.mjs +231 -247
- package/es/input/index.mjs +10 -5
- package/es/input/props.mjs +38 -8
- package/es/input/provide.ts +3 -0
- package/es/lazy/index.mjs +94 -87
- package/es/link/Link.mjs +39 -45
- package/es/link/index.mjs +10 -5
- package/es/link/props.mjs +8 -5
- package/es/list/List.mjs +144 -97
- package/es/list/index.mjs +10 -5
- package/es/list/props.mjs +8 -5
- package/es/list/provide.mjs +8 -9
- package/es/loading/Loading.mjs +165 -72
- package/es/loading/index.mjs +10 -5
- package/es/loading/props.mjs +7 -4
- package/es/loading-bar/LoadingBar.mjs +19 -16
- package/es/loading-bar/index.mjs +37 -30
- package/es/loading-bar/props.mjs +5 -2
- package/es/locale/en-US.mjs +76 -73
- package/es/locale/index.mjs +52 -41
- package/es/locale/zh-CN.mjs +76 -73
- package/es/menu/Menu.mjs +76 -57
- package/es/menu/index.mjs +10 -5
- package/es/menu/props.mjs +11 -8
- package/es/menu/usePopover.mjs +214 -207
- package/es/option/Option.mjs +86 -70
- package/es/option/index.mjs +10 -5
- package/es/option/props.mjs +5 -2
- package/es/option/provide.mjs +10 -11
- package/es/overlay/Overlay.mjs +29 -31
- package/es/overlay/index.mjs +10 -5
- package/es/overlay/props.mjs +7 -4
- package/es/pagination/Pagination.mjs +334 -202
- package/es/pagination/index.mjs +10 -5
- package/es/pagination/props.mjs +8 -5
- package/es/paper/Paper.mjs +43 -31
- package/es/paper/index.mjs +10 -5
- package/es/paper/props.mjs +6 -3
- package/es/picker/Picker.mjs +288 -224
- package/es/picker/index.mjs +24 -23
- package/es/picker/props.mjs +37 -7
- package/es/popup/Popup.mjs +68 -58
- package/es/popup/index.mjs +10 -5
- package/es/popup/props.mjs +9 -6
- package/es/popup/provide.mjs +12 -15
- package/es/progress/Progress.mjs +186 -114
- package/es/progress/index.mjs +10 -5
- package/es/progress/props.mjs +7 -4
- package/es/pull-refresh/PullRefresh.mjs +136 -116
- package/es/pull-refresh/index.mjs +10 -5
- package/es/pull-refresh/props.mjs +8 -5
- package/es/radio/Radio.mjs +122 -118
- package/es/radio/index.mjs +10 -5
- package/es/radio/props.mjs +8 -5
- package/es/radio/provide.mjs +8 -9
- package/es/radio-group/RadioGroup.mjs +50 -58
- package/es/radio-group/index.mjs +10 -5
- package/es/radio-group/props.mjs +10 -7
- package/es/radio-group/provide.mjs +11 -9
- package/es/rate/Rate.mjs +103 -132
- package/es/rate/index.mjs +10 -5
- package/es/rate/props.mjs +10 -7
- package/es/rate/provide.ts +3 -0
- package/es/result/Empty.mjs +21 -12
- package/es/result/Error.mjs +18 -9
- package/es/result/Info.mjs +18 -9
- package/es/result/Question.mjs +18 -9
- package/es/result/Result.mjs +102 -55
- package/es/result/Success.mjs +84 -40
- package/es/result/Warning.mjs +18 -9
- package/es/result/index.mjs +10 -5
- package/es/result/props.mjs +6 -3
- package/es/ripple/index.mjs +89 -101
- package/es/row/Row.mjs +40 -45
- package/es/row/index.mjs +10 -5
- package/es/row/props.mjs +8 -5
- package/es/row/provide.mjs +9 -9
- package/es/select/Select.mjs +308 -298
- package/es/select/index.mjs +10 -5
- package/es/select/props.mjs +40 -10
- package/es/select/provide.mjs +9 -9
- package/es/skeleton/Skeleton.mjs +182 -71
- package/es/skeleton/index.mjs +10 -5
- package/es/skeleton/props.mjs +5 -2
- package/es/slider/Slider.mjs +310 -260
- package/es/slider/index.mjs +10 -5
- package/es/slider/props.mjs +15 -11
- package/es/slider/provide.ts +3 -0
- package/es/snackbar/Snackbar.mjs +47 -34
- package/es/snackbar/core.mjs +140 -77
- package/es/snackbar/index.mjs +111 -97
- package/es/snackbar/props.mjs +35 -14
- package/es/space/Space.mjs +30 -28
- package/es/space/index.mjs +10 -5
- package/es/space/margin.mjs +22 -23
- package/es/space/props.mjs +8 -5
- package/es/step/Step.mjs +96 -74
- package/es/step/index.mjs +10 -5
- package/es/step/props.mjs +6 -3
- package/es/step/provide.mjs +10 -11
- package/es/steps/Steps.mjs +31 -30
- package/es/steps/index.mjs +10 -5
- package/es/steps/props.mjs +7 -4
- package/es/steps/provide.mjs +9 -8
- package/es/sticky/Sticky.mjs +104 -92
- package/es/sticky/index.mjs +10 -5
- package/es/sticky/props.mjs +6 -3
- package/es/style-provider/StyleProvider.mjs +19 -18
- package/es/style-provider/index.mjs +15 -11
- package/es/style-provider/props.mjs +6 -3
- package/es/swipe/Swipe.mjs +281 -268
- package/es/swipe/index.mjs +10 -5
- package/es/swipe/props.mjs +6 -3
- package/es/swipe/provide.mjs +11 -9
- package/es/swipe-item/SwipeItem.mjs +29 -29
- package/es/swipe-item/index.mjs +8 -4
- package/es/swipe-item/provide.mjs +10 -11
- package/es/switch/Switch.mjs +143 -103
- package/es/switch/index.mjs +10 -5
- package/es/switch/props.mjs +7 -4
- package/es/switch/provide.ts +3 -0
- package/es/tab/Tab.mjs +48 -61
- package/es/tab/index.mjs +10 -5
- package/es/tab/props.mjs +6 -3
- package/es/tab/provide.mjs +10 -11
- package/es/tab-item/TabItem.mjs +27 -32
- package/es/tab-item/index.mjs +10 -5
- package/es/tab-item/props.mjs +5 -2
- package/es/tab-item/provide.mjs +17 -18
- package/es/table/Table.mjs +54 -25
- package/es/table/index.mjs +10 -5
- package/es/table/props.mjs +6 -3
- package/es/tabs/Tabs.mjs +162 -134
- package/es/tabs/index.mjs +10 -5
- package/es/tabs/props.mjs +15 -12
- package/es/tabs/provide.mjs +9 -9
- package/es/tabs-items/TabsItems.mjs +61 -65
- package/es/tabs-items/index.mjs +10 -5
- package/es/tabs-items/props.mjs +7 -4
- package/es/tabs-items/provide.mjs +11 -9
- package/es/themes/dark/actionSheet.mjs +8 -5
- package/es/themes/dark/appBar.mjs +6 -3
- package/es/themes/dark/avatar.mjs +7 -4
- package/es/themes/dark/badge.mjs +6 -3
- package/es/themes/dark/bottomNavigation.mjs +7 -4
- package/es/themes/dark/bottomNavigationItem.mjs +6 -3
- package/es/themes/dark/breadcrumb.mjs +6 -3
- package/es/themes/dark/button.mjs +7 -4
- package/es/themes/dark/card.mjs +10 -7
- package/es/themes/dark/cell.mjs +7 -4
- package/es/themes/dark/checkbox.mjs +7 -4
- package/es/themes/dark/chip.mjs +7 -4
- package/es/themes/dark/collapse.mjs +8 -5
- package/es/themes/dark/countdown.mjs +6 -3
- package/es/themes/dark/datePicker.mjs +10 -7
- package/es/themes/dark/dialog.mjs +8 -5
- package/es/themes/dark/divider.mjs +7 -4
- package/es/themes/dark/fieldDecorator.mjs +7 -4
- package/es/themes/dark/index.mjs +69 -51
- package/es/themes/dark/link.mjs +6 -3
- package/es/themes/dark/menu.mjs +6 -3
- package/es/themes/dark/option.mjs +6 -3
- package/es/themes/dark/pagination.mjs +11 -8
- package/es/themes/dark/paper.mjs +6 -3
- package/es/themes/dark/picker.mjs +11 -8
- package/es/themes/dark/popup.mjs +6 -3
- package/es/themes/dark/progress.mjs +6 -3
- package/es/themes/dark/pullRefresh.mjs +6 -3
- package/es/themes/dark/radio.mjs +7 -4
- package/es/themes/dark/result.mjs +12 -9
- package/es/themes/dark/select.mjs +6 -3
- package/es/themes/dark/skeleton.mjs +11 -6
- package/es/themes/dark/steps.mjs +8 -5
- package/es/themes/dark/switch.mjs +7 -4
- package/es/themes/dark/tab.mjs +6 -3
- package/es/themes/dark/table.mjs +12 -9
- package/es/themes/dark/tabs.mjs +6 -3
- package/es/themes/dark/timePicker.mjs +9 -6
- package/es/themes/dark/uploader.mjs +10 -7
- package/es/themes/dark/watermark.mjs +6 -3
- package/es/themes/index.mjs +7 -5
- package/es/time-picker/TimePicker.mjs +297 -232
- package/es/time-picker/clock.mjs +222 -172
- package/es/time-picker/index.mjs +10 -5
- package/es/time-picker/props.mjs +14 -8
- package/es/time-picker/utils.mjs +46 -86
- package/es/tooltip/Tooltip.mjs +82 -62
- package/es/tooltip/index.mjs +10 -5
- package/es/tooltip/props.mjs +12 -9
- package/es/uploader/Uploader.mjs +315 -308
- package/es/uploader/index.mjs +10 -5
- package/es/uploader/props.mjs +10 -7
- package/es/uploader/provide.ts +3 -0
- package/es/utils/components.mjs +158 -127
- package/es/utils/elements.mjs +106 -123
- package/es/utils/logger.mjs +9 -5
- package/es/utils/shared.mjs +25 -23
- package/es/utils/test.mjs +105 -93
- package/es/varlet.esm.js +12464 -13425
- package/es/watermark/Watermark.mjs +191 -109
- package/es/watermark/index.mjs +8 -4
- package/es/watermark/props.mjs +8 -5
- package/highlight/web-types.en-US.json +3 -3
- package/highlight/web-types.zh-CN.json +2 -2
- package/lib/varlet.cjs.js +9187 -10199
- package/package.json +7 -7
- package/umd/varlet.js +4 -4
- package/es/counter/provide.mjs +0 -1
- package/es/input/provide.mjs +0 -1
- package/es/rate/provide.mjs +0 -1
- package/es/slider/provide.mjs +0 -1
- package/es/switch/provide.mjs +0 -1
- package/es/uploader/provide.mjs +0 -1
package/es/uploader/index.mjs
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import Uploader from
|
|
2
|
-
import { withInstall } from
|
|
1
|
+
import Uploader from "./Uploader.mjs";
|
|
2
|
+
import { withInstall } from "../utils/components.mjs";
|
|
3
3
|
withInstall(Uploader);
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
import { props } from "./props.mjs";
|
|
5
|
+
const _UploaderComponent = Uploader;
|
|
6
|
+
var stdin_default = Uploader;
|
|
7
|
+
export {
|
|
8
|
+
_UploaderComponent,
|
|
9
|
+
stdin_default as default,
|
|
10
|
+
props as uploaderProps
|
|
11
|
+
};
|
package/es/uploader/props.mjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { defineListenerProp } from
|
|
2
|
-
|
|
1
|
+
import { defineListenerProp } from "../utils/components.mjs";
|
|
2
|
+
const props = {
|
|
3
3
|
modelValue: {
|
|
4
4
|
type: Array,
|
|
5
5
|
default: () => []
|
|
6
6
|
},
|
|
7
7
|
accept: {
|
|
8
8
|
type: String,
|
|
9
|
-
default:
|
|
9
|
+
default: "image/*"
|
|
10
10
|
},
|
|
11
11
|
capture: {
|
|
12
12
|
type: [String, Boolean],
|
|
13
|
-
default:
|
|
13
|
+
default: void 0
|
|
14
14
|
},
|
|
15
15
|
multiple: Boolean,
|
|
16
16
|
readonly: Boolean,
|
|
@@ -35,7 +35,7 @@ export var props = {
|
|
|
35
35
|
},
|
|
36
36
|
validateTrigger: {
|
|
37
37
|
type: Array,
|
|
38
|
-
default: () => [
|
|
38
|
+
default: () => ["onChange", "onRemove"]
|
|
39
39
|
},
|
|
40
40
|
rules: Array,
|
|
41
41
|
hideList: Boolean,
|
|
@@ -45,5 +45,8 @@ export var props = {
|
|
|
45
45
|
onBeforeRemove: defineListenerProp(),
|
|
46
46
|
onRemove: defineListenerProp(),
|
|
47
47
|
onOversize: defineListenerProp(),
|
|
48
|
-
|
|
49
|
-
};
|
|
48
|
+
"onUpdate:modelValue": defineListenerProp()
|
|
49
|
+
};
|
|
50
|
+
export {
|
|
51
|
+
props
|
|
52
|
+
};
|
package/es/utils/components.mjs
CHANGED
|
@@ -1,30 +1,73 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
if (__hasOwnProp.call(b, prop))
|
|
9
|
+
__defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
+
if (__propIsEnum.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
17
|
+
var __async = (__this, __arguments, generator) => {
|
|
18
|
+
return new Promise((resolve, reject) => {
|
|
19
|
+
var fulfilled = (value) => {
|
|
20
|
+
try {
|
|
21
|
+
step(generator.next(value));
|
|
22
|
+
} catch (e) {
|
|
23
|
+
reject(e);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
var rejected = (value) => {
|
|
27
|
+
try {
|
|
28
|
+
step(generator.throw(value));
|
|
29
|
+
} catch (e) {
|
|
30
|
+
reject(e);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
34
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
import { useEventListener } from "@varlet/use";
|
|
38
|
+
import {
|
|
39
|
+
createApp,
|
|
40
|
+
h,
|
|
41
|
+
getCurrentInstance,
|
|
42
|
+
isVNode,
|
|
43
|
+
ref,
|
|
44
|
+
onActivated,
|
|
45
|
+
onDeactivated,
|
|
46
|
+
Comment,
|
|
47
|
+
Fragment,
|
|
48
|
+
computed,
|
|
49
|
+
watch
|
|
50
|
+
} from "vue";
|
|
51
|
+
import { bigCamelize, isArray } from "@varlet/shared";
|
|
52
|
+
function pickProps(props, propsKey) {
|
|
8
53
|
return Array.isArray(propsKey) ? propsKey.reduce((pickedProps, key) => {
|
|
9
54
|
pickedProps[key] = props[key];
|
|
10
55
|
return pickedProps;
|
|
11
56
|
}, {}) : props[propsKey];
|
|
12
57
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
componentWithInstall.install = function
|
|
16
|
-
|
|
17
|
-
name
|
|
18
|
-
} = component;
|
|
58
|
+
function withInstall(component, target) {
|
|
59
|
+
const componentWithInstall = target != null ? target : component;
|
|
60
|
+
componentWithInstall.install = function(app) {
|
|
61
|
+
const { name } = component;
|
|
19
62
|
if (name) {
|
|
20
63
|
app.component(name, component);
|
|
21
64
|
}
|
|
22
65
|
};
|
|
23
66
|
return componentWithInstall;
|
|
24
67
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
68
|
+
function mount(component) {
|
|
69
|
+
const app = createApp(component);
|
|
70
|
+
const host = document.createElement("div");
|
|
28
71
|
document.body.appendChild(host);
|
|
29
72
|
return {
|
|
30
73
|
instance: app.mount(host),
|
|
@@ -34,33 +77,23 @@ export function mount(component) {
|
|
|
34
77
|
}
|
|
35
78
|
};
|
|
36
79
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
props = {};
|
|
40
|
-
}
|
|
41
|
-
if (eventListener === void 0) {
|
|
42
|
-
eventListener = {};
|
|
43
|
-
}
|
|
44
|
-
var Host = {
|
|
80
|
+
function mountInstance(component, props = {}, eventListener = {}) {
|
|
81
|
+
const Host = {
|
|
45
82
|
setup() {
|
|
46
|
-
return () => h(component,
|
|
83
|
+
return () => h(component, __spreadValues(__spreadValues({}, props), eventListener));
|
|
47
84
|
}
|
|
48
85
|
};
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
} = mount(Host);
|
|
52
|
-
return {
|
|
53
|
-
unmountInstance: unmount
|
|
54
|
-
};
|
|
86
|
+
const { unmount } = mount(Host);
|
|
87
|
+
return { unmountInstance: unmount };
|
|
55
88
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
vNodes.forEach(vNode => {
|
|
89
|
+
function flatFragment(vNodes) {
|
|
90
|
+
const result = [];
|
|
91
|
+
vNodes.forEach((vNode) => {
|
|
59
92
|
if (vNode.type === Comment) {
|
|
60
93
|
return;
|
|
61
94
|
}
|
|
62
95
|
if (vNode.type === Fragment && isArray(vNode.children)) {
|
|
63
|
-
vNode.children.forEach(item => {
|
|
96
|
+
vNode.children.forEach((item) => {
|
|
64
97
|
result.push(item);
|
|
65
98
|
});
|
|
66
99
|
return;
|
|
@@ -69,15 +102,15 @@ export function flatFragment(vNodes) {
|
|
|
69
102
|
});
|
|
70
103
|
return result;
|
|
71
104
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
if (
|
|
76
|
-
flat(
|
|
105
|
+
function flatVNodes(subTree) {
|
|
106
|
+
const vNodes = [];
|
|
107
|
+
const flat = (subTree2) => {
|
|
108
|
+
if (subTree2 == null ? void 0 : subTree2.component) {
|
|
109
|
+
flat(subTree2 == null ? void 0 : subTree2.component.subTree);
|
|
77
110
|
return;
|
|
78
111
|
}
|
|
79
|
-
if (Array.isArray(
|
|
80
|
-
|
|
112
|
+
if (Array.isArray(subTree2 == null ? void 0 : subTree2.children)) {
|
|
113
|
+
subTree2.children.forEach((child) => {
|
|
81
114
|
if (isVNode(child)) {
|
|
82
115
|
vNodes.push(child);
|
|
83
116
|
flat(child);
|
|
@@ -88,44 +121,34 @@ export function flatVNodes(subTree) {
|
|
|
88
121
|
flat(subTree);
|
|
89
122
|
return vNodes;
|
|
90
123
|
}
|
|
91
|
-
|
|
92
|
-
|
|
124
|
+
function keyInProvides(key) {
|
|
125
|
+
const instance = getCurrentInstance();
|
|
93
126
|
return key in instance.provides;
|
|
94
127
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
128
|
+
function useValidation() {
|
|
129
|
+
const errorMessage = ref("");
|
|
130
|
+
const validate = (rules, value, apis) => __async(this, null, function* () {
|
|
131
|
+
if (!isArray(rules) || !rules.length) {
|
|
132
|
+
return true;
|
|
133
|
+
}
|
|
134
|
+
const resArr = yield Promise.all(rules.map((rule) => rule(value, apis)));
|
|
135
|
+
return !resArr.some((res) => {
|
|
136
|
+
if (res !== true) {
|
|
137
|
+
errorMessage.value = String(res);
|
|
100
138
|
return true;
|
|
101
139
|
}
|
|
102
|
-
|
|
103
|
-
return !resArr.some(res => {
|
|
104
|
-
if (res !== true) {
|
|
105
|
-
errorMessage.value = String(res);
|
|
106
|
-
return true;
|
|
107
|
-
}
|
|
108
|
-
return false;
|
|
109
|
-
});
|
|
140
|
+
return false;
|
|
110
141
|
});
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
}();
|
|
115
|
-
var resetValidation = () => {
|
|
116
|
-
errorMessage.value = '';
|
|
142
|
+
});
|
|
143
|
+
const resetValidation = () => {
|
|
144
|
+
errorMessage.value = "";
|
|
117
145
|
};
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
});
|
|
125
|
-
return function validateWithTrigger(_x4, _x5, _x6, _x7, _x8) {
|
|
126
|
-
return _ref2.apply(this, arguments);
|
|
127
|
-
};
|
|
128
|
-
}();
|
|
146
|
+
const validateWithTrigger = (validateTrigger, trigger, rules, value, apis) => __async(this, null, function* () {
|
|
147
|
+
if (validateTrigger.includes(trigger)) {
|
|
148
|
+
;
|
|
149
|
+
(yield validate(rules, value, apis)) && (errorMessage.value = "");
|
|
150
|
+
}
|
|
151
|
+
});
|
|
129
152
|
return {
|
|
130
153
|
errorMessage,
|
|
131
154
|
validate,
|
|
@@ -133,12 +156,12 @@ export function useValidation() {
|
|
|
133
156
|
validateWithTrigger
|
|
134
157
|
};
|
|
135
158
|
}
|
|
136
|
-
|
|
137
|
-
useEventListener(() => window,
|
|
138
|
-
useEventListener(() => window,
|
|
159
|
+
function useRouteListener(listener) {
|
|
160
|
+
useEventListener(() => window, "hashchange", listener);
|
|
161
|
+
useEventListener(() => window, "popstate", listener);
|
|
139
162
|
}
|
|
140
|
-
|
|
141
|
-
|
|
163
|
+
function useTeleport() {
|
|
164
|
+
const disabled = ref(false);
|
|
142
165
|
onActivated(() => {
|
|
143
166
|
disabled.value = false;
|
|
144
167
|
});
|
|
@@ -149,80 +172,64 @@ export function useTeleport() {
|
|
|
149
172
|
disabled
|
|
150
173
|
};
|
|
151
174
|
}
|
|
152
|
-
|
|
153
|
-
|
|
175
|
+
function exposeApis(apis) {
|
|
176
|
+
const instance = getCurrentInstance();
|
|
154
177
|
if (instance) {
|
|
155
178
|
Object.assign(instance.proxy, apis);
|
|
156
179
|
}
|
|
157
180
|
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
181
|
+
function createNamespace(name) {
|
|
182
|
+
const namespace = `var`;
|
|
183
|
+
const componentName = `${namespace}-${name}`;
|
|
184
|
+
const createBEM = (suffix) => {
|
|
162
185
|
if (!suffix) {
|
|
163
186
|
return componentName;
|
|
164
187
|
}
|
|
165
|
-
if (suffix[0] ===
|
|
166
|
-
return suffix.replace(
|
|
188
|
+
if (suffix[0] === "$") {
|
|
189
|
+
return suffix.replace("$", namespace);
|
|
167
190
|
}
|
|
168
|
-
return suffix.startsWith(
|
|
191
|
+
return suffix.startsWith("--") ? `${componentName}${suffix}` : `${componentName}__${suffix}`;
|
|
169
192
|
};
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
193
|
+
const classes = (...classes2) => classes2.map((className) => {
|
|
194
|
+
if (isArray(className)) {
|
|
195
|
+
const [condition, truthy, falsy = null] = className;
|
|
196
|
+
return condition ? truthy : falsy;
|
|
173
197
|
}
|
|
174
|
-
return
|
|
175
|
-
|
|
176
|
-
var [condition, truthy, falsy = null] = className;
|
|
177
|
-
return condition ? truthy : falsy;
|
|
178
|
-
}
|
|
179
|
-
return className;
|
|
180
|
-
});
|
|
181
|
-
};
|
|
198
|
+
return className;
|
|
199
|
+
});
|
|
182
200
|
return {
|
|
183
201
|
name: bigCamelize(componentName),
|
|
184
202
|
n: createBEM,
|
|
185
203
|
classes
|
|
186
204
|
};
|
|
187
205
|
}
|
|
188
|
-
|
|
189
|
-
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
190
|
-
args[_key2 - 1] = arguments[_key2];
|
|
191
|
-
}
|
|
206
|
+
function call(fn, ...args) {
|
|
192
207
|
if (isArray(fn)) {
|
|
193
|
-
return fn.map(f => f(...args));
|
|
208
|
+
return fn.map((f) => f(...args));
|
|
194
209
|
}
|
|
195
210
|
if (fn) {
|
|
196
211
|
return fn(...args);
|
|
197
212
|
}
|
|
198
213
|
}
|
|
199
|
-
|
|
214
|
+
function defineListenerProp(fallback) {
|
|
200
215
|
return {
|
|
201
216
|
type: [Function, Array],
|
|
202
217
|
default: fallback
|
|
203
218
|
};
|
|
204
219
|
}
|
|
205
|
-
|
|
220
|
+
function formatElevation(elevation, defaultLevel) {
|
|
206
221
|
if (elevation === false) {
|
|
207
222
|
return null;
|
|
208
223
|
}
|
|
209
224
|
if (elevation === true && defaultLevel) {
|
|
210
225
|
elevation = defaultLevel;
|
|
211
226
|
}
|
|
212
|
-
return
|
|
227
|
+
return `var-elevation--${elevation}`;
|
|
213
228
|
}
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
var {
|
|
219
|
-
passive = true,
|
|
220
|
-
eventName,
|
|
221
|
-
defaultValue,
|
|
222
|
-
emit
|
|
223
|
-
} = options;
|
|
224
|
-
var event = eventName != null ? eventName : "onUpdate:" + key.toString();
|
|
225
|
-
var getValue = () => props[key] != null ? props[key] : defaultValue;
|
|
229
|
+
function useVModel(props, key, options = {}) {
|
|
230
|
+
const { passive = true, eventName, defaultValue, emit } = options;
|
|
231
|
+
const event = eventName != null ? eventName : `onUpdate:${key.toString()}`;
|
|
232
|
+
const getValue = () => props[key] != null ? props[key] : defaultValue;
|
|
226
233
|
if (!passive) {
|
|
227
234
|
return computed({
|
|
228
235
|
get() {
|
|
@@ -233,12 +240,36 @@ export function useVModel(props, key, options) {
|
|
|
233
240
|
}
|
|
234
241
|
});
|
|
235
242
|
}
|
|
236
|
-
|
|
237
|
-
watch(
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
+
const proxy = ref(getValue());
|
|
244
|
+
watch(
|
|
245
|
+
() => props[key],
|
|
246
|
+
() => {
|
|
247
|
+
proxy.value = getValue();
|
|
248
|
+
}
|
|
249
|
+
);
|
|
250
|
+
watch(
|
|
251
|
+
() => proxy.value,
|
|
252
|
+
(newValue) => {
|
|
253
|
+
emit ? emit(event, newValue) : call(props[event], newValue);
|
|
254
|
+
}
|
|
255
|
+
);
|
|
243
256
|
return proxy;
|
|
244
|
-
}
|
|
257
|
+
}
|
|
258
|
+
export {
|
|
259
|
+
call,
|
|
260
|
+
createNamespace,
|
|
261
|
+
defineListenerProp,
|
|
262
|
+
exposeApis,
|
|
263
|
+
flatFragment,
|
|
264
|
+
flatVNodes,
|
|
265
|
+
formatElevation,
|
|
266
|
+
keyInProvides,
|
|
267
|
+
mount,
|
|
268
|
+
mountInstance,
|
|
269
|
+
pickProps,
|
|
270
|
+
useRouteListener,
|
|
271
|
+
useTeleport,
|
|
272
|
+
useVModel,
|
|
273
|
+
useValidation,
|
|
274
|
+
withInstall
|
|
275
|
+
};
|