@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/time-picker/utils.mjs
CHANGED
|
@@ -1,116 +1,76 @@
|
|
|
1
|
-
import { hours24, hoursAmpm } from
|
|
2
|
-
import { toNumber } from
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { hours24, hoursAmpm } from "./props.mjs";
|
|
2
|
+
import { toNumber } from "@varlet/shared";
|
|
3
|
+
const notConvert = (format, ampm) => format === "24hr" || ampm === "am";
|
|
4
|
+
const convertHour = (format, ampm, hour) => {
|
|
5
|
+
const index = hoursAmpm.findIndex((hourAmpm) => toNumber(hourAmpm) === toNumber(hour));
|
|
6
|
+
const getHour = notConvert(format, ampm) ? hour : hours24[index];
|
|
7
7
|
return {
|
|
8
8
|
hourStr: getHour,
|
|
9
9
|
hourNum: toNumber(getHour)
|
|
10
10
|
};
|
|
11
11
|
};
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
const getNumberTime = (time) => {
|
|
13
|
+
const [hour, minute, second] = time.split(":");
|
|
14
14
|
return {
|
|
15
15
|
hour: toNumber(hour),
|
|
16
16
|
minute: toNumber(minute),
|
|
17
17
|
second: toNumber(second)
|
|
18
18
|
};
|
|
19
19
|
};
|
|
20
|
-
|
|
21
|
-
var
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
min,
|
|
29
|
-
disableHour
|
|
30
|
-
} = values;
|
|
31
|
-
var {
|
|
32
|
-
hourStr,
|
|
33
|
-
hourNum
|
|
34
|
-
} = convertHour(format, ampm, hour);
|
|
35
|
-
var isBetweenMinMax = false;
|
|
36
|
-
var isAllow = false;
|
|
37
|
-
if (disableHour.includes(hourStr)) return true;
|
|
20
|
+
const getIsDisableMinute = (values) => {
|
|
21
|
+
var _a, _b;
|
|
22
|
+
const { time, format, ampm, hour, max, min, disableHour } = values;
|
|
23
|
+
const { hourStr, hourNum } = convertHour(format, ampm, hour);
|
|
24
|
+
let isBetweenMinMax = false;
|
|
25
|
+
let isAllow = false;
|
|
26
|
+
if (disableHour.includes(hourStr))
|
|
27
|
+
return true;
|
|
38
28
|
if (max && !min) {
|
|
39
|
-
|
|
40
|
-
hour: maxHour,
|
|
41
|
-
minute: maxMinute
|
|
42
|
-
} = getNumberTime(max);
|
|
29
|
+
const { hour: maxHour, minute: maxMinute } = getNumberTime(max);
|
|
43
30
|
isBetweenMinMax = maxHour === hourNum && time > maxMinute;
|
|
44
31
|
}
|
|
45
32
|
if (!max && min) {
|
|
46
|
-
|
|
47
|
-
hour: minHour,
|
|
48
|
-
minute: minMinute
|
|
49
|
-
} = getNumberTime(min);
|
|
33
|
+
const { hour: minHour, minute: minMinute } = getNumberTime(min);
|
|
50
34
|
isBetweenMinMax = minHour === hourNum && time < minMinute;
|
|
51
35
|
}
|
|
52
36
|
if (max && min) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
} = getNumberTime(max);
|
|
57
|
-
var {
|
|
58
|
-
hour: _minHour,
|
|
59
|
-
minute: _minMinute
|
|
60
|
-
} = getNumberTime(min);
|
|
61
|
-
isBetweenMinMax = _minHour === hourNum && time < _minMinute || _maxHour === hourNum && time > _maxMinute;
|
|
37
|
+
const { hour: maxHour, minute: maxMinute } = getNumberTime(max);
|
|
38
|
+
const { hour: minHour, minute: minMinute } = getNumberTime(min);
|
|
39
|
+
isBetweenMinMax = minHour === hourNum && time < minMinute || maxHour === hourNum && time > maxMinute;
|
|
62
40
|
}
|
|
63
|
-
if ((
|
|
41
|
+
if ((_a = values.allowedTime) == null ? void 0 : _a.minutes)
|
|
42
|
+
isAllow = (_b = values.allowedTime) == null ? void 0 : _b.minutes(time);
|
|
64
43
|
return isBetweenMinMax || isAllow;
|
|
65
44
|
};
|
|
66
|
-
|
|
67
|
-
var
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
max,
|
|
75
|
-
min,
|
|
76
|
-
disableHour
|
|
77
|
-
} = values;
|
|
78
|
-
var {
|
|
79
|
-
hourStr,
|
|
80
|
-
hourNum
|
|
81
|
-
} = convertHour(format, ampm, hour);
|
|
82
|
-
var isBetweenMinMax = false;
|
|
83
|
-
var isAllow = false;
|
|
84
|
-
if (disableHour.includes(hourStr)) return true;
|
|
45
|
+
const getIsDisableSecond = (values) => {
|
|
46
|
+
var _a, _b;
|
|
47
|
+
const { time, format, ampm, hour, minute, max, min, disableHour } = values;
|
|
48
|
+
const { hourStr, hourNum } = convertHour(format, ampm, hour);
|
|
49
|
+
let isBetweenMinMax = false;
|
|
50
|
+
let isAllow = false;
|
|
51
|
+
if (disableHour.includes(hourStr))
|
|
52
|
+
return true;
|
|
85
53
|
if (max && !min) {
|
|
86
|
-
|
|
87
|
-
hour: maxHour,
|
|
88
|
-
minute: maxMinute,
|
|
89
|
-
second: maxSecond
|
|
90
|
-
} = getNumberTime(max);
|
|
54
|
+
const { hour: maxHour, minute: maxMinute, second: maxSecond } = getNumberTime(max);
|
|
91
55
|
isBetweenMinMax = maxHour === hourNum && maxMinute < minute || maxMinute === minute && time > maxSecond;
|
|
92
56
|
}
|
|
93
57
|
if (!max && min) {
|
|
94
|
-
|
|
95
|
-
hour: minHour,
|
|
96
|
-
minute: minMinute,
|
|
97
|
-
second: minSecond
|
|
98
|
-
} = getNumberTime(min);
|
|
58
|
+
const { hour: minHour, minute: minMinute, second: minSecond } = getNumberTime(min);
|
|
99
59
|
isBetweenMinMax = minHour === hourNum && minMinute > minute || minMinute === minute && time > minSecond;
|
|
100
60
|
}
|
|
101
61
|
if (max && min) {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
second: _maxSecond
|
|
106
|
-
} = getNumberTime(max);
|
|
107
|
-
var {
|
|
108
|
-
hour: _minHour2,
|
|
109
|
-
minute: _minMinute2,
|
|
110
|
-
second: _minSecond
|
|
111
|
-
} = getNumberTime(min);
|
|
112
|
-
isBetweenMinMax = _maxHour2 === hourNum && _maxMinute2 < minute || _minHour2 === hourNum && _minMinute2 > minute || _maxHour2 === hourNum && _maxMinute2 === minute && time > _maxSecond || _minHour2 === hourNum && _minMinute2 === minute && time < _minSecond;
|
|
62
|
+
const { hour: maxHour, minute: maxMinute, second: maxSecond } = getNumberTime(max);
|
|
63
|
+
const { hour: minHour, minute: minMinute, second: minSecond } = getNumberTime(min);
|
|
64
|
+
isBetweenMinMax = maxHour === hourNum && maxMinute < minute || minHour === hourNum && minMinute > minute || maxHour === hourNum && maxMinute === minute && time > maxSecond || minHour === hourNum && minMinute === minute && time < minSecond;
|
|
113
65
|
}
|
|
114
|
-
if ((
|
|
66
|
+
if ((_a = values.allowedTime) == null ? void 0 : _a.seconds)
|
|
67
|
+
isAllow = (_b = values.allowedTime) == null ? void 0 : _b.seconds(time);
|
|
115
68
|
return isBetweenMinMax || isAllow;
|
|
116
|
-
};
|
|
69
|
+
};
|
|
70
|
+
export {
|
|
71
|
+
convertHour,
|
|
72
|
+
getIsDisableMinute,
|
|
73
|
+
getIsDisableSecond,
|
|
74
|
+
getNumberTime,
|
|
75
|
+
notConvert
|
|
76
|
+
};
|
package/es/tooltip/Tooltip.mjs
CHANGED
|
@@ -1,68 +1,85 @@
|
|
|
1
|
-
import { createNamespace, useTeleport } from
|
|
2
|
-
import { defineComponent } from
|
|
3
|
-
import { toSizeUnit } from
|
|
4
|
-
import { usePopover } from
|
|
5
|
-
import { props } from
|
|
6
|
-
|
|
7
|
-
name,
|
|
8
|
-
n,
|
|
9
|
-
classes
|
|
10
|
-
} = createNamespace('tooltip');
|
|
1
|
+
import { createNamespace, useTeleport } from "../utils/components.mjs";
|
|
2
|
+
import { defineComponent } from "vue";
|
|
3
|
+
import { toSizeUnit } from "../utils/elements.mjs";
|
|
4
|
+
import { usePopover } from "../menu/usePopover.mjs";
|
|
5
|
+
import { props } from "./props.mjs";
|
|
6
|
+
const { name, n, classes } = createNamespace("tooltip");
|
|
11
7
|
import { renderSlot as _renderSlot, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, vShow as _vShow, withModifiers as _withModifiers, withDirectives as _withDirectives, Transition as _Transition, withCtx as _withCtx, createVNode as _createVNode, Teleport as _Teleport, openBlock as _openBlock, createBlock as _createBlock, createElementBlock as _createElementBlock } from "vue";
|
|
12
8
|
function __render__(_ctx, _cache) {
|
|
13
|
-
return _openBlock(), _createElementBlock(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
9
|
+
return _openBlock(), _createElementBlock(
|
|
10
|
+
"div",
|
|
11
|
+
{
|
|
12
|
+
ref: "host",
|
|
13
|
+
class: _normalizeClass(_ctx.classes(_ctx.n(), _ctx.n("$--box"))),
|
|
14
|
+
onClick: _cache[3] || (_cache[3] = (...args) => _ctx.handleHostClick && _ctx.handleHostClick(...args)),
|
|
15
|
+
onMouseenter: _cache[4] || (_cache[4] = (...args) => _ctx.handleHostMouseenter && _ctx.handleHostMouseenter(...args)),
|
|
16
|
+
onMouseleave: _cache[5] || (_cache[5] = (...args) => _ctx.handleHostMouseleave && _ctx.handleHostMouseleave(...args))
|
|
17
|
+
},
|
|
18
|
+
[
|
|
19
|
+
_renderSlot(_ctx.$slots, "default"),
|
|
20
|
+
(_openBlock(), _createBlock(_Teleport, {
|
|
21
|
+
to: _ctx.teleport === false ? void 0 : _ctx.teleport,
|
|
22
|
+
disabled: _ctx.teleportDisabled || _ctx.teleport === false
|
|
23
|
+
}, [
|
|
24
|
+
_createVNode(_Transition, {
|
|
25
|
+
name: _ctx.n(),
|
|
26
|
+
onAfterEnter: _ctx.onOpened,
|
|
27
|
+
onAfterLeave: _ctx.handleClosed,
|
|
28
|
+
persisted: ""
|
|
29
|
+
}, {
|
|
30
|
+
default: _withCtx(() => [
|
|
31
|
+
_withDirectives(_createElementVNode(
|
|
32
|
+
"div",
|
|
33
|
+
{
|
|
34
|
+
ref: "popover",
|
|
35
|
+
class: _normalizeClass(_ctx.classes(_ctx.n("tooltip"), _ctx.n("$--box"))),
|
|
36
|
+
style: _normalizeStyle({ zIndex: _ctx.zIndex }),
|
|
37
|
+
onClick: _cache[0] || (_cache[0] = _withModifiers(() => {
|
|
38
|
+
}, ["stop"])),
|
|
39
|
+
onMouseenter: _cache[1] || (_cache[1] = (...args) => _ctx.handlePopoverMouseenter && _ctx.handlePopoverMouseenter(...args)),
|
|
40
|
+
onMouseleave: _cache[2] || (_cache[2] = (...args) => _ctx.handlePopoverMouseleave && _ctx.handlePopoverMouseleave(...args))
|
|
41
|
+
},
|
|
42
|
+
[
|
|
43
|
+
_createElementVNode(
|
|
44
|
+
"div",
|
|
45
|
+
{
|
|
46
|
+
style: _normalizeStyle({ background: _ctx.color, width: _ctx.sameWidth ? _ctx.toSizeUnit(Math.ceil(_ctx.hostSize.width)) : void 0 }),
|
|
47
|
+
class: _normalizeClass(_ctx.classes(_ctx.n("content-container"), _ctx.n(`--${_ctx.type}`)))
|
|
48
|
+
},
|
|
49
|
+
[
|
|
50
|
+
_renderSlot(_ctx.$slots, "content", {}, () => [
|
|
51
|
+
_createTextVNode(
|
|
52
|
+
_toDisplayString(_ctx.content),
|
|
53
|
+
1
|
|
54
|
+
/* TEXT */
|
|
55
|
+
)
|
|
56
|
+
])
|
|
57
|
+
],
|
|
58
|
+
6
|
|
59
|
+
/* CLASS, STYLE */
|
|
60
|
+
)
|
|
61
|
+
],
|
|
62
|
+
38
|
|
63
|
+
/* CLASS, STYLE, HYDRATE_EVENTS */
|
|
64
|
+
), [
|
|
65
|
+
[_vShow, _ctx.show]
|
|
66
|
+
])
|
|
67
|
+
]),
|
|
68
|
+
_: 3
|
|
69
|
+
/* FORWARDED */
|
|
70
|
+
}, 8, ["name", "onAfterEnter", "onAfterLeave"])
|
|
71
|
+
], 8, ["to", "disabled"]))
|
|
72
|
+
],
|
|
73
|
+
34
|
|
74
|
+
/* CLASS, HYDRATE_EVENTS */
|
|
75
|
+
);
|
|
56
76
|
}
|
|
57
|
-
|
|
58
|
-
var __sfc__ = defineComponent({
|
|
77
|
+
const __sfc__ = defineComponent({
|
|
59
78
|
name,
|
|
60
79
|
props,
|
|
61
|
-
setup(
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
} = useTeleport();
|
|
65
|
-
var {
|
|
80
|
+
setup(props2) {
|
|
81
|
+
const { disabled: teleportDisabled } = useTeleport();
|
|
82
|
+
const {
|
|
66
83
|
popover,
|
|
67
84
|
host,
|
|
68
85
|
hostSize,
|
|
@@ -81,7 +98,7 @@ var __sfc__ = defineComponent({
|
|
|
81
98
|
close,
|
|
82
99
|
// expose
|
|
83
100
|
resize
|
|
84
|
-
} = usePopover(
|
|
101
|
+
} = usePopover(props2);
|
|
85
102
|
return {
|
|
86
103
|
popover,
|
|
87
104
|
host,
|
|
@@ -106,4 +123,7 @@ var __sfc__ = defineComponent({
|
|
|
106
123
|
}
|
|
107
124
|
});
|
|
108
125
|
__sfc__.render = __render__;
|
|
109
|
-
|
|
126
|
+
var stdin_default = __sfc__;
|
|
127
|
+
export {
|
|
128
|
+
stdin_default as default
|
|
129
|
+
};
|
package/es/tooltip/index.mjs
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import Tooltip from
|
|
2
|
-
import { withInstall } from
|
|
1
|
+
import Tooltip from "./Tooltip.mjs";
|
|
2
|
+
import { withInstall } from "../utils/components.mjs";
|
|
3
3
|
withInstall(Tooltip);
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
import { props } from "./props.mjs";
|
|
5
|
+
const _TooltipComponent = Tooltip;
|
|
6
|
+
var stdin_default = Tooltip;
|
|
7
|
+
export {
|
|
8
|
+
_TooltipComponent,
|
|
9
|
+
stdin_default as default,
|
|
10
|
+
props as tooltipProps
|
|
11
|
+
};
|
package/es/tooltip/props.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineListenerProp } from
|
|
2
|
-
|
|
1
|
+
import { defineListenerProp } from "../utils/components.mjs";
|
|
2
|
+
const props = {
|
|
3
3
|
type: {
|
|
4
4
|
type: String,
|
|
5
|
-
default:
|
|
5
|
+
default: "default"
|
|
6
6
|
},
|
|
7
7
|
color: String,
|
|
8
8
|
content: String,
|
|
@@ -10,16 +10,16 @@ export var props = {
|
|
|
10
10
|
disabled: Boolean,
|
|
11
11
|
trigger: {
|
|
12
12
|
type: String,
|
|
13
|
-
default:
|
|
13
|
+
default: "hover"
|
|
14
14
|
},
|
|
15
15
|
reference: String,
|
|
16
16
|
placement: {
|
|
17
17
|
type: String,
|
|
18
|
-
default:
|
|
18
|
+
default: "bottom"
|
|
19
19
|
},
|
|
20
20
|
strategy: {
|
|
21
21
|
type: String,
|
|
22
|
-
default:
|
|
22
|
+
default: "absolute"
|
|
23
23
|
},
|
|
24
24
|
offsetX: {
|
|
25
25
|
type: [Number, String],
|
|
@@ -31,7 +31,7 @@ export var props = {
|
|
|
31
31
|
},
|
|
32
32
|
teleport: {
|
|
33
33
|
type: [String, Object, Boolean],
|
|
34
|
-
default:
|
|
34
|
+
default: "body"
|
|
35
35
|
},
|
|
36
36
|
sameWidth: Boolean,
|
|
37
37
|
closeOnClickReference: Boolean,
|
|
@@ -40,5 +40,8 @@ export var props = {
|
|
|
40
40
|
onClose: defineListenerProp(),
|
|
41
41
|
onClosed: defineListenerProp(),
|
|
42
42
|
onClickOutside: defineListenerProp(),
|
|
43
|
-
|
|
44
|
-
};
|
|
43
|
+
"onUpdate:show": defineListenerProp()
|
|
44
|
+
};
|
|
45
|
+
export {
|
|
46
|
+
props
|
|
47
|
+
};
|