@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/form/provide.mjs
CHANGED
|
@@ -1,18 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
import { useChildren, useParent } from "@varlet/use";
|
|
21
|
+
import { getCurrentInstance } from "vue";
|
|
22
|
+
const FORM_BIND_FORM_ITEM_KEY = Symbol("FORM_BIND_FORM_ITEM_KEY");
|
|
23
|
+
function useForm() {
|
|
24
|
+
const { parentProvider, index, bindParent } = useParent(FORM_BIND_FORM_ITEM_KEY);
|
|
25
|
+
const instance = getCurrentInstance();
|
|
26
|
+
const bindForm = bindParent ? (formItemProvider) => {
|
|
27
|
+
bindParent(__spreadProps(__spreadValues({}, formItemProvider), { instance }));
|
|
16
28
|
} : null;
|
|
17
29
|
return {
|
|
18
30
|
index,
|
|
@@ -20,15 +32,16 @@ export function useForm() {
|
|
|
20
32
|
bindForm
|
|
21
33
|
};
|
|
22
34
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
childProviders,
|
|
26
|
-
length,
|
|
27
|
-
bindChildren
|
|
28
|
-
} = useChildren(FORM_BIND_FORM_ITEM_KEY);
|
|
35
|
+
function useFormItems() {
|
|
36
|
+
const { childProviders, length, bindChildren } = useChildren(FORM_BIND_FORM_ITEM_KEY);
|
|
29
37
|
return {
|
|
30
38
|
length,
|
|
31
39
|
formItems: childProviders,
|
|
32
40
|
bindFormItems: bindChildren
|
|
33
41
|
};
|
|
34
|
-
}
|
|
42
|
+
}
|
|
43
|
+
export {
|
|
44
|
+
FORM_BIND_FORM_ITEM_KEY,
|
|
45
|
+
useForm,
|
|
46
|
+
useFormItems
|
|
47
|
+
};
|
|
@@ -1,49 +1,91 @@
|
|
|
1
|
-
import { defineComponent } from
|
|
2
|
-
import { createNamespace } from
|
|
3
|
-
import { props } from
|
|
4
|
-
|
|
5
|
-
name,
|
|
6
|
-
n
|
|
7
|
-
} = createNamespace('form-details');
|
|
1
|
+
import { defineComponent } from "vue";
|
|
2
|
+
import { createNamespace } from "../utils/components.mjs";
|
|
3
|
+
import { props } from "./props.mjs";
|
|
4
|
+
const { name, n } = createNamespace("form-details");
|
|
8
5
|
import { toDisplayString as _toDisplayString, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, Transition as _Transition, withCtx as _withCtx, createVNode as _createVNode, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, renderSlot as _renderSlot, createBlock as _createBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
};
|
|
13
|
-
var _hoisted_2 = {
|
|
14
|
-
key: 0
|
|
15
|
-
};
|
|
6
|
+
const _withScopeId = (n2) => (_pushScopeId(""), n2 = n2(), _popScopeId(), n2);
|
|
7
|
+
const _hoisted_1 = { key: 0 };
|
|
8
|
+
const _hoisted_2 = { key: 0 };
|
|
16
9
|
function __render__(_ctx, _cache) {
|
|
17
10
|
return _openBlock(), _createBlock(_Transition, {
|
|
18
11
|
name: _ctx.n()
|
|
19
12
|
}, {
|
|
20
|
-
default: _withCtx(() => [
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
13
|
+
default: _withCtx(() => [
|
|
14
|
+
_ctx.errorMessage || _ctx.extraMessage || _ctx.$slots["extra-message"] ? (_openBlock(), _createElementBlock(
|
|
15
|
+
"div",
|
|
16
|
+
{
|
|
17
|
+
key: 0,
|
|
18
|
+
class: _normalizeClass(_ctx.n())
|
|
19
|
+
},
|
|
20
|
+
[
|
|
21
|
+
_createElementVNode(
|
|
22
|
+
"div",
|
|
23
|
+
{
|
|
24
|
+
class: _normalizeClass(_ctx.n("error-message"))
|
|
25
|
+
},
|
|
26
|
+
[
|
|
27
|
+
_createVNode(_Transition, {
|
|
28
|
+
name: _ctx.n("message")
|
|
29
|
+
}, {
|
|
30
|
+
default: _withCtx(() => [
|
|
31
|
+
_ctx.errorMessage ? (_openBlock(), _createElementBlock(
|
|
32
|
+
"div",
|
|
33
|
+
_hoisted_1,
|
|
34
|
+
_toDisplayString(_ctx.errorMessage),
|
|
35
|
+
1
|
|
36
|
+
/* TEXT */
|
|
37
|
+
)) : _createCommentVNode("v-if", true)
|
|
38
|
+
]),
|
|
39
|
+
_: 1
|
|
40
|
+
/* STABLE */
|
|
41
|
+
}, 8, ["name"])
|
|
42
|
+
],
|
|
43
|
+
2
|
|
44
|
+
/* CLASS */
|
|
45
|
+
),
|
|
46
|
+
_createElementVNode(
|
|
47
|
+
"div",
|
|
48
|
+
{
|
|
49
|
+
class: _normalizeClass(_ctx.n("extra-message"))
|
|
50
|
+
},
|
|
51
|
+
[
|
|
52
|
+
_createVNode(_Transition, {
|
|
53
|
+
name: _ctx.n("message")
|
|
54
|
+
}, {
|
|
55
|
+
default: _withCtx(() => [
|
|
56
|
+
_renderSlot(_ctx.$slots, "extra-message", {}, () => [
|
|
57
|
+
_ctx.extraMessage ? (_openBlock(), _createElementBlock(
|
|
58
|
+
"div",
|
|
59
|
+
_hoisted_2,
|
|
60
|
+
_toDisplayString(_ctx.extraMessage),
|
|
61
|
+
1
|
|
62
|
+
/* TEXT */
|
|
63
|
+
)) : _createCommentVNode("v-if", true)
|
|
64
|
+
])
|
|
65
|
+
]),
|
|
66
|
+
_: 3
|
|
67
|
+
/* FORWARDED */
|
|
68
|
+
}, 8, ["name"])
|
|
69
|
+
],
|
|
70
|
+
2
|
|
71
|
+
/* CLASS */
|
|
72
|
+
)
|
|
73
|
+
],
|
|
74
|
+
2
|
|
75
|
+
/* CLASS */
|
|
76
|
+
)) : _createCommentVNode("v-if", true)
|
|
77
|
+
]),
|
|
78
|
+
_: 3
|
|
79
|
+
/* FORWARDED */
|
|
80
|
+
}, 8, ["name"]);
|
|
40
81
|
}
|
|
41
|
-
|
|
82
|
+
const __sfc__ = defineComponent({
|
|
42
83
|
name,
|
|
43
84
|
props,
|
|
44
|
-
setup: () => ({
|
|
45
|
-
n
|
|
46
|
-
})
|
|
85
|
+
setup: () => ({ n })
|
|
47
86
|
});
|
|
48
87
|
__sfc__.render = __render__;
|
|
49
|
-
|
|
88
|
+
var stdin_default = __sfc__;
|
|
89
|
+
export {
|
|
90
|
+
stdin_default as default
|
|
91
|
+
};
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import FormDetails from
|
|
2
|
-
import { withInstall } from
|
|
1
|
+
import FormDetails from "./FormDetails.mjs";
|
|
2
|
+
import { withInstall } from "../utils/components.mjs";
|
|
3
3
|
withInstall(FormDetails);
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
import { props } from "./props.mjs";
|
|
5
|
+
const _FormDetailsComponent = FormDetails;
|
|
6
|
+
var stdin_default = FormDetails;
|
|
7
|
+
export {
|
|
8
|
+
_FormDetailsComponent,
|
|
9
|
+
stdin_default as default,
|
|
10
|
+
props as formDetailsProps
|
|
11
|
+
};
|
package/es/hover/index.mjs
CHANGED
|
@@ -1,52 +1,51 @@
|
|
|
1
|
-
import { isFunction, camelize } from
|
|
1
|
+
import { isFunction, camelize } from "@varlet/shared";
|
|
2
2
|
function shouldDisabled(arg) {
|
|
3
3
|
if (!arg) {
|
|
4
4
|
return false;
|
|
5
5
|
}
|
|
6
|
-
|
|
7
|
-
if (arg ===
|
|
6
|
+
const isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
|
|
7
|
+
if (arg === "desktop" && isMobile) {
|
|
8
8
|
return true;
|
|
9
9
|
}
|
|
10
|
-
if (arg ===
|
|
10
|
+
if (arg === "mobile" && !isMobile) {
|
|
11
11
|
return true;
|
|
12
12
|
}
|
|
13
13
|
return false;
|
|
14
14
|
}
|
|
15
15
|
function getStyle(element) {
|
|
16
|
-
|
|
17
|
-
if (!style)
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
const style = element.getAttribute("style");
|
|
17
|
+
if (!style)
|
|
18
|
+
return {};
|
|
19
|
+
return style.split(";").filter(Boolean).reduce((style2, item) => {
|
|
20
|
+
const [key, value] = item.split(":").map((item2) => item2.trim());
|
|
21
|
+
style2[camelize(key)] = value;
|
|
22
|
+
return style2;
|
|
22
23
|
}, {});
|
|
23
24
|
}
|
|
24
25
|
function updateRawStyle(element) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
var camelizedKey = camelize(key);
|
|
31
|
-
var styleValue = value[camelizedKey];
|
|
26
|
+
const { value } = element._hover;
|
|
27
|
+
const style = getStyle(element);
|
|
28
|
+
Object.keys(value).forEach((key) => {
|
|
29
|
+
const camelizedKey = camelize(key);
|
|
30
|
+
const styleValue = value[camelizedKey];
|
|
32
31
|
if (styleValue != null && style[camelizedKey]) {
|
|
33
32
|
element._hover.rawStyle[camelizedKey] = style[camelizedKey];
|
|
34
33
|
}
|
|
35
34
|
});
|
|
36
35
|
}
|
|
37
36
|
function updateStyle(element, styleValue) {
|
|
38
|
-
Object.keys(styleValue).forEach(key => {
|
|
39
|
-
|
|
37
|
+
Object.keys(styleValue).forEach((key) => {
|
|
38
|
+
const value = styleValue[key];
|
|
40
39
|
if (value != null) {
|
|
41
40
|
element.style[key] = value;
|
|
42
41
|
}
|
|
43
42
|
});
|
|
44
43
|
}
|
|
45
44
|
function clearStyle(element) {
|
|
46
|
-
Object.keys(element._hover.value).forEach(key => {
|
|
47
|
-
|
|
45
|
+
Object.keys(element._hover.value).forEach((key) => {
|
|
46
|
+
const value = element._hover.value[key];
|
|
48
47
|
if (value != null) {
|
|
49
|
-
element.style[key] =
|
|
48
|
+
element.style[key] = "";
|
|
50
49
|
}
|
|
51
50
|
});
|
|
52
51
|
}
|
|
@@ -55,9 +54,7 @@ function restoreStyle(element) {
|
|
|
55
54
|
updateStyle(element, element._hover.rawStyle);
|
|
56
55
|
}
|
|
57
56
|
function createHover() {
|
|
58
|
-
|
|
59
|
-
value
|
|
60
|
-
} = this._hover;
|
|
57
|
+
const { value } = this._hover;
|
|
61
58
|
this._hover.hovering = true;
|
|
62
59
|
if (isFunction(value)) {
|
|
63
60
|
value(this._hover.hovering);
|
|
@@ -74,34 +71,30 @@ function removeHover() {
|
|
|
74
71
|
restoreStyle(this);
|
|
75
72
|
}
|
|
76
73
|
function mounted(element, binding) {
|
|
77
|
-
var
|
|
78
|
-
|
|
79
|
-
arg,
|
|
80
|
-
value
|
|
81
|
-
} = binding;
|
|
74
|
+
var _a, _b;
|
|
75
|
+
const { arg, value } = binding;
|
|
82
76
|
if (shouldDisabled(arg)) {
|
|
83
77
|
return;
|
|
84
78
|
}
|
|
85
79
|
element._hover = {
|
|
86
80
|
value,
|
|
87
|
-
hovering: (
|
|
81
|
+
hovering: (_b = (_a = element._hover) == null ? void 0 : _a.hovering) != null ? _b : false,
|
|
88
82
|
rawStyle: {}
|
|
89
83
|
};
|
|
90
84
|
updateRawStyle(element);
|
|
91
|
-
element.addEventListener(
|
|
92
|
-
element.addEventListener(
|
|
85
|
+
element.addEventListener("mouseenter", createHover);
|
|
86
|
+
element.addEventListener("mouseleave", removeHover);
|
|
93
87
|
}
|
|
94
88
|
function unmounted(element, binding) {
|
|
95
89
|
if (shouldDisabled(binding.arg)) {
|
|
96
90
|
return;
|
|
97
91
|
}
|
|
98
92
|
restoreStyle(element);
|
|
99
|
-
element.removeEventListener(
|
|
100
|
-
element.removeEventListener(
|
|
93
|
+
element.removeEventListener("mouseenter", createHover);
|
|
94
|
+
element.removeEventListener("mouseleave", removeHover);
|
|
101
95
|
}
|
|
102
96
|
function beforeUpdate(element, binding) {
|
|
103
97
|
if (!element._hover) {
|
|
104
|
-
// issue #942
|
|
105
98
|
return;
|
|
106
99
|
}
|
|
107
100
|
unmounted(element, binding);
|
|
@@ -115,14 +108,18 @@ function updated(element, binding) {
|
|
|
115
108
|
updateStyle(element, binding.value);
|
|
116
109
|
}
|
|
117
110
|
}
|
|
118
|
-
|
|
111
|
+
const Hover = {
|
|
119
112
|
mounted,
|
|
120
113
|
unmounted,
|
|
121
114
|
beforeUpdate,
|
|
122
115
|
updated,
|
|
123
116
|
install(app) {
|
|
124
|
-
app.directive(
|
|
117
|
+
app.directive("hover", this);
|
|
125
118
|
}
|
|
126
119
|
};
|
|
127
|
-
|
|
128
|
-
|
|
120
|
+
const _HoverComponent = Hover;
|
|
121
|
+
var stdin_default = Hover;
|
|
122
|
+
export {
|
|
123
|
+
_HoverComponent,
|
|
124
|
+
stdin_default as default
|
|
125
|
+
};
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import { defineComponent } from
|
|
2
|
-
import { props } from
|
|
3
|
-
import { createNamespace } from
|
|
4
|
-
|
|
5
|
-
name,
|
|
6
|
-
n,
|
|
7
|
-
classes
|
|
8
|
-
} = createNamespace('hover-overlay');
|
|
1
|
+
import { defineComponent } from "vue";
|
|
2
|
+
import { props } from "./props.mjs";
|
|
3
|
+
import { createNamespace } from "../utils/components.mjs";
|
|
4
|
+
const { name, n, classes } = createNamespace("hover-overlay");
|
|
9
5
|
import { normalizeClass as _normalizeClass, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
|
|
10
6
|
function __render__(_ctx, _cache) {
|
|
11
|
-
return _openBlock(), _createElementBlock(
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
return _openBlock(), _createElementBlock(
|
|
8
|
+
"div",
|
|
9
|
+
{
|
|
10
|
+
class: _normalizeClass(_ctx.classes(_ctx.n(), [_ctx.hovering, _ctx.n("--hovering")]))
|
|
11
|
+
},
|
|
12
|
+
null,
|
|
13
|
+
2
|
|
14
|
+
/* CLASS */
|
|
15
|
+
);
|
|
14
16
|
}
|
|
15
|
-
|
|
16
|
-
var __sfc__ = defineComponent({
|
|
17
|
+
const __sfc__ = defineComponent({
|
|
17
18
|
name,
|
|
18
19
|
props,
|
|
19
20
|
setup: () => ({
|
|
@@ -22,4 +23,7 @@ var __sfc__ = defineComponent({
|
|
|
22
23
|
})
|
|
23
24
|
});
|
|
24
25
|
__sfc__.render = __render__;
|
|
25
|
-
|
|
26
|
+
var stdin_default = __sfc__;
|
|
27
|
+
export {
|
|
28
|
+
stdin_default as default
|
|
29
|
+
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import HoverOverlay from
|
|
2
|
-
import { withInstall } from
|
|
3
|
-
import { ref } from
|
|
1
|
+
import HoverOverlay from "./HoverOverlay.mjs";
|
|
2
|
+
import { withInstall } from "../utils/components.mjs";
|
|
3
|
+
import { ref } from "vue";
|
|
4
4
|
withInstall(HoverOverlay);
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
function useHoverOverlay() {
|
|
6
|
+
const hovering = ref(false);
|
|
7
|
+
const handleHovering = (value) => {
|
|
8
8
|
hovering.value = value;
|
|
9
9
|
};
|
|
10
10
|
return {
|
|
@@ -12,5 +12,10 @@ export function useHoverOverlay() {
|
|
|
12
12
|
handleHovering
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
const _HoverOverlayComponent = HoverOverlay;
|
|
16
|
+
var stdin_default = HoverOverlay;
|
|
17
|
+
export {
|
|
18
|
+
_HoverOverlayComponent,
|
|
19
|
+
stdin_default as default,
|
|
20
|
+
useHoverOverlay
|
|
21
|
+
};
|
package/es/icon/Icon.mjs
CHANGED
|
@@ -1,47 +1,62 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
var __async = (__this, __arguments, generator) => {
|
|
2
|
+
return new Promise((resolve, reject) => {
|
|
3
|
+
var fulfilled = (value) => {
|
|
4
|
+
try {
|
|
5
|
+
step(generator.next(value));
|
|
6
|
+
} catch (e) {
|
|
7
|
+
reject(e);
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
var rejected = (value) => {
|
|
11
|
+
try {
|
|
12
|
+
step(generator.throw(value));
|
|
13
|
+
} catch (e) {
|
|
14
|
+
reject(e);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
18
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
import { defineComponent, watch, ref, nextTick } from "vue";
|
|
22
|
+
import { isURL, toNumber } from "@varlet/shared";
|
|
23
|
+
import { props } from "./props.mjs";
|
|
24
|
+
import { toSizeUnit } from "../utils/elements.mjs";
|
|
25
|
+
import { createNamespace } from "../utils/components.mjs";
|
|
26
|
+
const { name, n, classes } = createNamespace("icon");
|
|
13
27
|
import { resolveDynamicComponent as _resolveDynamicComponent, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, openBlock as _openBlock, createBlock as _createBlock } from "vue";
|
|
14
28
|
function __render__(_ctx, _cache) {
|
|
15
|
-
return _openBlock(), _createBlock(_resolveDynamicComponent(_ctx.isURL(_ctx.name) ?
|
|
16
|
-
class: _normalizeClass(
|
|
29
|
+
return _openBlock(), _createBlock(_resolveDynamicComponent(_ctx.isURL(_ctx.name) ? "img" : "i"), {
|
|
30
|
+
class: _normalizeClass(
|
|
31
|
+
_ctx.classes(
|
|
32
|
+
_ctx.n(),
|
|
33
|
+
[_ctx.namespace !== _ctx.n(), _ctx.namespace],
|
|
34
|
+
`${_ctx.namespace}--set`,
|
|
35
|
+
[_ctx.isURL(_ctx.name), _ctx.n("image"), `${_ctx.namespace}-${_ctx.nextName}`],
|
|
36
|
+
[_ctx.animateInProgress, _ctx.animationClass == null ? _ctx.n("--shrinking") : _ctx.animationClass]
|
|
37
|
+
)
|
|
38
|
+
),
|
|
17
39
|
style: _normalizeStyle({
|
|
18
40
|
color: _ctx.color,
|
|
19
|
-
|
|
41
|
+
"transition-duration": `${_ctx.toNumber(_ctx.transition)}ms`,
|
|
20
42
|
width: _ctx.isURL(_ctx.name) ? _ctx.toSizeUnit(_ctx.size) : null,
|
|
21
43
|
height: _ctx.isURL(_ctx.name) ? _ctx.toSizeUnit(_ctx.size) : null,
|
|
22
44
|
fontSize: _ctx.toSizeUnit(_ctx.size)
|
|
23
45
|
}),
|
|
24
46
|
src: _ctx.isURL(_ctx.name) ? _ctx.nextName : null,
|
|
25
47
|
onClick: _ctx.onClick
|
|
26
|
-
}, null, 8
|
|
48
|
+
}, null, 8, ["class", "style", "src", "onClick"]);
|
|
27
49
|
}
|
|
28
|
-
|
|
50
|
+
const __sfc__ = defineComponent({
|
|
29
51
|
name,
|
|
30
52
|
props,
|
|
31
|
-
setup(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
watch(() =>
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
return _handleNameChange.apply(this, arguments);
|
|
39
|
-
}
|
|
40
|
-
function _handleNameChange() {
|
|
41
|
-
_handleNameChange = _asyncToGenerator(function* (newName, oldName) {
|
|
42
|
-
var {
|
|
43
|
-
transition
|
|
44
|
-
} = props;
|
|
53
|
+
setup(props2) {
|
|
54
|
+
const nextName = ref("");
|
|
55
|
+
const animateInProgress = ref(false);
|
|
56
|
+
watch(() => props2.name, handleNameChange, { immediate: true });
|
|
57
|
+
function handleNameChange(newName, oldName) {
|
|
58
|
+
return __async(this, null, function* () {
|
|
59
|
+
const { transition } = props2;
|
|
45
60
|
if (oldName == null || toNumber(transition) === 0) {
|
|
46
61
|
nextName.value = newName;
|
|
47
62
|
return;
|
|
@@ -55,7 +70,6 @@ var __sfc__ = defineComponent({
|
|
|
55
70
|
animateInProgress.value = false;
|
|
56
71
|
}, toNumber(transition));
|
|
57
72
|
});
|
|
58
|
-
return _handleNameChange.apply(this, arguments);
|
|
59
73
|
}
|
|
60
74
|
return {
|
|
61
75
|
nextName,
|
|
@@ -69,4 +83,7 @@ var __sfc__ = defineComponent({
|
|
|
69
83
|
}
|
|
70
84
|
});
|
|
71
85
|
__sfc__.render = __render__;
|
|
72
|
-
|
|
86
|
+
var stdin_default = __sfc__;
|
|
87
|
+
export {
|
|
88
|
+
stdin_default as default
|
|
89
|
+
};
|
package/es/icon/index.mjs
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import Icon from
|
|
2
|
-
import { withInstall } from
|
|
1
|
+
import Icon from "./Icon.mjs";
|
|
2
|
+
import { withInstall } from "../utils/components.mjs";
|
|
3
3
|
withInstall(Icon);
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
import { props } from "./props.mjs";
|
|
5
|
+
const _IconComponent = Icon;
|
|
6
|
+
var stdin_default = Icon;
|
|
7
|
+
export {
|
|
8
|
+
_IconComponent,
|
|
9
|
+
stdin_default as default,
|
|
10
|
+
props as iconProps
|
|
11
|
+
};
|
package/es/icon/props.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineListenerProp } from
|
|
2
|
-
|
|
1
|
+
import { defineListenerProp } from "../utils/components.mjs";
|
|
2
|
+
const props = {
|
|
3
3
|
name: String,
|
|
4
4
|
size: [Number, String],
|
|
5
5
|
color: String,
|
|
6
6
|
namespace: {
|
|
7
7
|
type: String,
|
|
8
|
-
default:
|
|
8
|
+
default: "var-icon"
|
|
9
9
|
},
|
|
10
10
|
transition: {
|
|
11
11
|
type: [Number, String],
|
|
@@ -13,4 +13,7 @@ export var props = {
|
|
|
13
13
|
},
|
|
14
14
|
animationClass: String,
|
|
15
15
|
onClick: defineListenerProp()
|
|
16
|
-
};
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
props
|
|
19
|
+
};
|