vue-devui 1.0.0-rc.0 → 1.0.0-rc.11
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/README.md +78 -116
- package/alert/index.es.js +74 -45
- package/alert/index.umd.js +1 -1
- package/alert/style.css +1 -1
- package/auto-complete/index.es.js +8190 -296
- package/auto-complete/index.umd.js +29 -1
- package/auto-complete/style.css +1 -1
- package/avatar/index.es.js +153 -146
- package/avatar/index.umd.js +1 -1
- package/avatar/style.css +1 -1
- package/badge/index.es.js +34 -5
- package/badge/index.umd.js +1 -1
- package/badge/style.css +1 -1
- package/button/index.es.js +5741 -127
- package/button/index.umd.js +27 -1
- package/button/style.css +1 -1
- package/card/index.es.js +63 -35
- package/card/index.umd.js +1 -1
- package/card/style.css +1 -1
- package/checkbox/index.es.js +8068 -255
- package/checkbox/index.umd.js +27 -1
- package/checkbox/style.css +1 -1
- package/{accordion → collapse}/index.d.ts +0 -0
- package/collapse/index.es.js +379 -0
- package/collapse/index.umd.js +1 -0
- package/{anchor → collapse}/package.json +1 -1
- package/collapse/style.css +1 -0
- package/countdown/index.es.js +5 -7
- package/countdown/index.umd.js +1 -1
- package/date-picker/index.es.js +8167 -288
- package/date-picker/index.umd.js +27 -1
- package/date-picker/style.css +1 -1
- package/drawer/index.es.js +31 -4
- package/drawer/index.umd.js +1 -1
- package/drawer/style.css +1 -1
- package/dropdown/index.es.js +297 -181
- package/dropdown/index.umd.js +1 -1
- package/dropdown/style.css +1 -1
- package/editable-select/index.es.js +525 -154
- package/editable-select/index.umd.js +1 -1
- package/editable-select/style.css +1 -1
- package/form/index.es.js +1048 -1176
- package/form/index.umd.js +16 -16
- package/form/style.css +1 -1
- package/fullscreen/index.es.js +42 -21
- package/fullscreen/index.umd.js +1 -1
- package/fullscreen/style.css +1 -1
- package/grid/index.es.js +101 -86
- package/grid/index.umd.js +1 -1
- package/grid/style.css +1 -1
- package/icon/index.es.js +197 -56
- package/icon/index.umd.js +1 -1
- package/icon/style.css +1 -0
- package/image-preview/index.es.js +55 -31
- package/image-preview/index.umd.js +1 -1
- package/image-preview/style.css +1 -1
- package/input/index.es.js +8074 -144
- package/input/index.umd.js +27 -1
- package/input/style.css +1 -1
- package/input-number/index.es.js +269 -183
- package/input-number/index.umd.js +1 -1
- package/input-number/style.css +1 -1
- package/layout/index.es.js +40 -25
- package/layout/index.umd.js +1 -1
- package/layout/style.css +1 -1
- package/loading/index.es.js +74 -35
- package/loading/index.umd.js +1 -1
- package/loading/style.css +1 -1
- package/modal/index.es.js +412 -204
- package/modal/index.umd.js +1 -1
- package/modal/style.css +1 -1
- package/notification/index.es.js +307 -57
- package/notification/index.umd.js +1 -1
- package/notification/style.css +1 -1
- package/nuxt/components/ButtonGroup.js +3 -0
- package/nuxt/components/CheckboxButton.js +3 -0
- package/nuxt/components/CheckboxGroup.js +3 -0
- package/nuxt/components/Collapse.js +3 -0
- package/nuxt/components/CollapseItem.js +3 -0
- package/nuxt/components/DropdownPropsKey.js +3 -0
- package/nuxt/components/FORM_ITEM_TOKEN.js +3 -0
- package/nuxt/components/FORM_TOKEN.js +3 -0
- package/nuxt/components/Icon.js +1 -0
- package/nuxt/components/IconGroup.js +3 -0
- package/nuxt/components/LABEL_DATA.js +3 -0
- package/nuxt/components/LoadingOptions.js +3 -0
- package/nuxt/components/Option.js +3 -0
- package/nuxt/components/PanelBody.js +3 -0
- package/nuxt/components/PanelFooter.js +3 -0
- package/nuxt/components/PanelHeader.js +3 -0
- package/nuxt/components/RadioButton.js +3 -0
- package/nuxt/components/TABLE_TOKEN.js +3 -0
- package/nuxt/components/Tab.js +3 -0
- package/nuxt/components/TimeSelect.js +3 -0
- package/nuxt/components/Timeline.js +3 -0
- package/nuxt/components/TimelineItem.js +3 -0
- package/nuxt/components/alertProps.js +3 -0
- package/nuxt/components/autoCompleteProps.js +3 -0
- package/nuxt/components/avatarProps.js +3 -0
- package/nuxt/components/buttonGroupInjectionKey.js +3 -0
- package/nuxt/components/buttonGroupProps.js +3 -0
- package/nuxt/components/cardProps.js +3 -0
- package/nuxt/components/checkboxGroupInjectionKey.js +3 -0
- package/nuxt/components/checkboxGroupProps.js +3 -0
- package/nuxt/components/checkboxProps.js +3 -0
- package/nuxt/components/colProps.js +3 -0
- package/nuxt/components/colPropsBaseClass.js +3 -0
- package/nuxt/components/colPropsBaseStyle.js +3 -0
- package/nuxt/components/collapseItemProps.js +3 -0
- package/nuxt/components/collapseProps.js +3 -0
- package/nuxt/components/countdownProps.js +3 -0
- package/nuxt/components/editableSelectProps.js +3 -0
- package/nuxt/components/formItemProps.js +3 -0
- package/nuxt/components/formProps.js +3 -0
- package/nuxt/components/fullscreenProps.js +3 -0
- package/nuxt/components/iconProps.js +3 -0
- package/nuxt/components/imagePreviewProps.js +3 -0
- package/nuxt/components/inputProps.js +3 -0
- package/nuxt/components/loadingProps.js +3 -0
- package/nuxt/components/modalProps.js +3 -0
- package/nuxt/components/paginationProps.js +3 -0
- package/nuxt/components/panelProps.js +3 -0
- package/nuxt/components/progressProps.js +3 -0
- package/nuxt/components/rateProps.js +3 -0
- package/nuxt/components/resultProps.js +3 -0
- package/nuxt/components/rowProps.js +3 -0
- package/nuxt/components/screenSizes.js +3 -0
- package/nuxt/components/searchProps.js +3 -0
- package/nuxt/components/skeletonProps.js +3 -0
- package/nuxt/components/sliderProps.js +3 -0
- package/nuxt/components/splitterProps.js +3 -0
- package/nuxt/components/statisticProps.js +3 -0
- package/nuxt/components/svgIconProps.js +3 -0
- package/nuxt/components/switchProps.js +3 -0
- package/nuxt/components/tableProps.js +3 -0
- package/nuxt/components/tabsProps.js +3 -0
- package/nuxt/components/tagProps.js +3 -0
- package/nuxt/components/textareaProps.js +3 -0
- package/nuxt/components/timeAxisProps.js +3 -0
- package/nuxt/components/treeProps.js +3 -0
- package/overlay/index.es.js +127 -149
- package/overlay/index.umd.js +1 -1
- package/overlay/style.css +1 -1
- package/package.json +11 -44
- package/pagination/index.es.js +158 -148
- package/pagination/index.umd.js +1 -1
- package/pagination/style.css +1 -1
- package/panel/index.es.js +45 -32
- package/panel/index.umd.js +1 -1
- package/panel/style.css +1 -1
- package/popover/index.es.js +317 -246
- package/popover/index.umd.js +15 -15
- package/popover/style.css +1 -1
- package/progress/index.es.js +110 -56
- package/progress/index.umd.js +3 -3
- package/progress/style.css +1 -1
- package/radio/index.es.js +7972 -157
- package/radio/index.umd.js +27 -1
- package/radio/style.css +1 -1
- package/rate/index.es.js +77 -55
- package/rate/index.umd.js +1 -1
- package/rate/style.css +1 -1
- package/result/index.es.js +184 -57
- package/result/index.umd.js +1 -1
- package/result/style.css +1 -1
- package/ripple/index.es.js +47 -42
- package/ripple/index.umd.js +1 -1
- package/search/index.es.js +3653 -1122
- package/search/index.umd.js +18 -18
- package/search/style.css +1 -1
- package/select/index.es.js +9170 -596
- package/select/index.umd.js +27 -1
- package/select/style.css +1 -1
- package/skeleton/index.es.js +63 -41
- package/skeleton/index.umd.js +1 -1
- package/skeleton/style.css +1 -1
- package/slider/index.es.js +144 -137
- package/slider/index.umd.js +1 -1
- package/slider/style.css +1 -1
- package/splitter/index.es.js +469 -349
- package/splitter/index.umd.js +15 -15
- package/splitter/style.css +1 -1
- package/statistic/index.es.js +41 -34
- package/statistic/index.umd.js +1 -1
- package/statistic/style.css +1 -1
- package/status/index.es.js +27 -6
- package/status/index.umd.js +1 -1
- package/status/style.css +1 -1
- package/style.css +1 -1
- package/switch/index.es.js +7802 -64
- package/switch/index.umd.js +27 -1
- package/switch/style.css +1 -1
- package/table/index.es.js +10459 -1511
- package/table/index.umd.js +27 -1
- package/table/style.css +1 -1
- package/tabs/index.es.js +344 -141
- package/tabs/index.umd.js +1 -1
- package/tabs/style.css +1 -1
- package/tag/index.es.js +49 -24
- package/tag/index.umd.js +1 -1
- package/tag/style.css +1 -1
- package/textarea/index.es.js +7921 -83
- package/textarea/index.umd.js +35 -1
- package/textarea/style.css +1 -1
- package/{anchor → time-select}/index.d.ts +0 -0
- package/{color-picker → time-select}/index.es.js +4171 -2898
- package/time-select/index.umd.js +27 -0
- package/{breadcrumb → time-select}/package.json +1 -1
- package/time-select/style.css +1 -0
- package/{back-top → timeline}/index.d.ts +0 -0
- package/timeline/index.es.js +425 -0
- package/timeline/index.umd.js +1 -0
- package/{back-top → timeline}/package.json +1 -1
- package/timeline/style.css +1 -0
- package/tooltip/index.es.js +308 -236
- package/tooltip/index.umd.js +15 -15
- package/tooltip/style.css +1 -1
- package/tree/index.es.js +5198 -1850
- package/tree/index.umd.js +18 -18
- package/tree/style.css +1 -1
- package/upload/index.es.js +427 -132
- package/upload/index.umd.js +1 -1
- package/upload/style.css +1 -1
- package/vue-devui.es.js +12064 -15841
- package/vue-devui.umd.js +30 -20
- package/accordion/index.es.js +0 -720
- package/accordion/index.umd.js +0 -1
- package/accordion/package.json +0 -7
- package/accordion/style.css +0 -1
- package/anchor/index.es.js +0 -263
- package/anchor/index.umd.js +0 -1
- package/anchor/style.css +0 -1
- package/back-top/index.es.js +0 -128
- package/back-top/index.umd.js +0 -1
- package/back-top/style.css +0 -1
- package/breadcrumb/index.d.ts +0 -7
- package/breadcrumb/index.es.js +0 -127
- package/breadcrumb/index.umd.js +0 -1
- package/breadcrumb/style.css +0 -1
- package/carousel/index.d.ts +0 -7
- package/carousel/index.es.js +0 -329
- package/carousel/index.umd.js +0 -1
- package/carousel/package.json +0 -7
- package/carousel/style.css +0 -1
- package/cascader/index.d.ts +0 -7
- package/cascader/index.es.js +0 -5963
- package/cascader/index.umd.js +0 -27
- package/cascader/package.json +0 -7
- package/cascader/style.css +0 -1
- package/color-picker/index.d.ts +0 -7
- package/color-picker/index.umd.js +0 -27
- package/color-picker/package.json +0 -7
- package/color-picker/style.css +0 -1
- package/comment/index.d.ts +0 -7
- package/comment/index.es.js +0 -86
- package/comment/index.umd.js +0 -1
- package/comment/package.json +0 -7
- package/comment/style.css +0 -1
- package/dragdrop/index.d.ts +0 -7
- package/dragdrop/index.es.js +0 -157
- package/dragdrop/index.umd.js +0 -1
- package/dragdrop/package.json +0 -7
- package/gantt/index.d.ts +0 -7
- package/gantt/index.es.js +0 -523
- package/gantt/index.umd.js +0 -1
- package/gantt/package.json +0 -7
- package/gantt/style.css +0 -1
- package/input-icon/index.d.ts +0 -7
- package/input-icon/index.es.js +0 -331
- package/input-icon/index.umd.js +0 -1
- package/input-icon/package.json +0 -7
- package/input-icon/style.css +0 -1
- package/list/index.d.ts +0 -7
- package/list/index.es.js +0 -39
- package/list/index.umd.js +0 -1
- package/list/package.json +0 -7
- package/list/style.css +0 -1
- package/nav-sprite/index.d.ts +0 -7
- package/nav-sprite/index.es.js +0 -68
- package/nav-sprite/index.umd.js +0 -1
- package/nav-sprite/package.json +0 -7
- package/nuxt/components/Accordion.js +0 -3
- package/nuxt/components/Anchor.js +0 -3
- package/nuxt/components/BackTop.js +0 -3
- package/nuxt/components/Breadcrumb.js +0 -3
- package/nuxt/components/Carousel.js +0 -3
- package/nuxt/components/CarouselItem.js +0 -3
- package/nuxt/components/Cascader.js +0 -3
- package/nuxt/components/ColorPicker.js +0 -3
- package/nuxt/components/Comment.js +0 -3
- package/nuxt/components/FormControl.js +0 -3
- package/nuxt/components/FormLabel.js +0 -3
- package/nuxt/components/Gantt.js +0 -3
- package/nuxt/components/InputIcon.js +0 -3
- package/nuxt/components/List.js +0 -3
- package/nuxt/components/ListItem.js +0 -3
- package/nuxt/components/NavSprite.js +0 -2
- package/nuxt/components/QuadrantDiagram.js +0 -3
- package/nuxt/components/ReadTip.js +0 -3
- package/nuxt/components/StepsGuide.js +0 -3
- package/nuxt/components/Sticky.js +0 -2
- package/nuxt/components/TagInput.js +0 -3
- package/nuxt/components/TimeAxis.js +0 -3
- package/nuxt/components/TimeAxisItem.js +0 -3
- package/nuxt/components/TimePicker.js +0 -3
- package/nuxt/components/Transfer.js +0 -3
- package/nuxt/components/TreeSelect.js +0 -3
- package/nuxt/components/overlayEmits.js +0 -3
- package/nuxt/components/overlayProps.js +0 -3
- package/quadrant-diagram/index.d.ts +0 -7
- package/quadrant-diagram/index.es.js +0 -5728
- package/quadrant-diagram/index.umd.js +0 -27
- package/quadrant-diagram/package.json +0 -7
- package/quadrant-diagram/style.css +0 -1
- package/read-tip/index.d.ts +0 -7
- package/read-tip/index.es.js +0 -258
- package/read-tip/index.umd.js +0 -1
- package/read-tip/package.json +0 -7
- package/read-tip/style.css +0 -1
- package/steps-guide/index.d.ts +0 -7
- package/steps-guide/index.es.js +0 -239
- package/steps-guide/index.umd.js +0 -1
- package/steps-guide/package.json +0 -7
- package/steps-guide/style.css +0 -1
- package/sticky/index.d.ts +0 -7
- package/sticky/index.es.js +0 -197
- package/sticky/index.umd.js +0 -1
- package/sticky/package.json +0 -7
- package/tag-input/index.d.ts +0 -7
- package/tag-input/index.es.js +0 -329
- package/tag-input/index.umd.js +0 -1
- package/tag-input/package.json +0 -7
- package/tag-input/style.css +0 -1
- package/time-axis/index.d.ts +0 -7
- package/time-axis/index.es.js +0 -299
- package/time-axis/index.umd.js +0 -1
- package/time-axis/package.json +0 -7
- package/time-axis/style.css +0 -1
- package/time-picker/index.d.ts +0 -7
- package/time-picker/index.es.js +0 -1237
- package/time-picker/index.umd.js +0 -1
- package/time-picker/package.json +0 -7
- package/time-picker/style.css +0 -1
- package/transfer/index.d.ts +0 -7
- package/transfer/index.es.js +0 -7608
- package/transfer/index.umd.js +0 -27
- package/transfer/package.json +0 -7
- package/transfer/style.css +0 -1
- package/tree-select/index.d.ts +0 -7
- package/tree-select/index.es.js +0 -623
- package/tree-select/index.umd.js +0 -1
- package/tree-select/package.json +0 -7
- package/tree-select/style.css +0 -1
|
@@ -0,0 +1,379 @@
|
|
|
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 { defineComponent, provide, reactive, toRefs, createVNode, computed, resolveDynamicComponent, mergeProps, shallowRef, inject, onMounted, Transition } from "vue";
|
|
21
|
+
const SELECT_TOKEN = Symbol("dCollapse");
|
|
22
|
+
const collapseProps = {
|
|
23
|
+
modelValue: {
|
|
24
|
+
type: [String, Number, Array],
|
|
25
|
+
default: "",
|
|
26
|
+
required: true
|
|
27
|
+
},
|
|
28
|
+
accordion: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
default: false
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
const collapseItemProps = {
|
|
34
|
+
name: {
|
|
35
|
+
type: [String, Number],
|
|
36
|
+
default: "",
|
|
37
|
+
required: true
|
|
38
|
+
},
|
|
39
|
+
title: {
|
|
40
|
+
type: String,
|
|
41
|
+
default: ""
|
|
42
|
+
},
|
|
43
|
+
disabled: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
default: false
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
function createBem(namespace, element, modifier) {
|
|
49
|
+
let cls = namespace;
|
|
50
|
+
if (element) {
|
|
51
|
+
cls += `__${element}`;
|
|
52
|
+
}
|
|
53
|
+
if (modifier) {
|
|
54
|
+
cls += `--${modifier}`;
|
|
55
|
+
}
|
|
56
|
+
return cls;
|
|
57
|
+
}
|
|
58
|
+
function useNamespace(block, needDot = false) {
|
|
59
|
+
const namespace = needDot ? `.devui-${block}` : `devui-${block}`;
|
|
60
|
+
const b = () => createBem(namespace);
|
|
61
|
+
const e = (element) => element ? createBem(namespace, element) : "";
|
|
62
|
+
const m = (modifier) => modifier ? createBem(namespace, "", modifier) : "";
|
|
63
|
+
const em = (element, modifier) => element && modifier ? createBem(namespace, element, modifier) : "";
|
|
64
|
+
return {
|
|
65
|
+
b,
|
|
66
|
+
e,
|
|
67
|
+
m,
|
|
68
|
+
em
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
var collapse = "";
|
|
72
|
+
var Collapse = defineComponent({
|
|
73
|
+
name: "DCollapse",
|
|
74
|
+
props: collapseProps,
|
|
75
|
+
emits: ["change", "update:modelValue"],
|
|
76
|
+
setup(props, ctx) {
|
|
77
|
+
const ns = useNamespace("collapse");
|
|
78
|
+
const scrollbarNs = useNamespace("scrollbar");
|
|
79
|
+
const getLists = (data) => {
|
|
80
|
+
if (!data && data !== 0) {
|
|
81
|
+
return [];
|
|
82
|
+
}
|
|
83
|
+
return Array.isArray(data) ? data : [data];
|
|
84
|
+
};
|
|
85
|
+
const collapseItemClick = (name) => {
|
|
86
|
+
const activeLists = [...getLists(props.modelValue)];
|
|
87
|
+
const itemIndex = activeLists.indexOf(name);
|
|
88
|
+
if (props.accordion) {
|
|
89
|
+
let activeName = name;
|
|
90
|
+
if ((activeLists[0] || activeLists[0] === 0) && activeLists[0] === name) {
|
|
91
|
+
activeName = "";
|
|
92
|
+
}
|
|
93
|
+
ctx.emit("update:modelValue", activeName);
|
|
94
|
+
ctx.emit("change", activeName);
|
|
95
|
+
} else {
|
|
96
|
+
if (itemIndex > -1) {
|
|
97
|
+
activeLists.splice(itemIndex, 1);
|
|
98
|
+
} else {
|
|
99
|
+
activeLists.push(name);
|
|
100
|
+
}
|
|
101
|
+
ctx.emit("update:modelValue", activeLists);
|
|
102
|
+
ctx.emit("change", activeLists);
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
provide(SELECT_TOKEN, reactive(__spreadProps(__spreadValues({}, toRefs(props)), {
|
|
106
|
+
collapseItemClick
|
|
107
|
+
})));
|
|
108
|
+
return () => {
|
|
109
|
+
var _a, _b;
|
|
110
|
+
return createVNode("div", {
|
|
111
|
+
"class": [ns.b(), scrollbarNs.b()]
|
|
112
|
+
}, [(_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)]);
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
const DEFAULT_PREFIX = "icon";
|
|
117
|
+
const iconProps = {
|
|
118
|
+
name: {
|
|
119
|
+
type: String,
|
|
120
|
+
default: "",
|
|
121
|
+
required: true
|
|
122
|
+
},
|
|
123
|
+
size: {
|
|
124
|
+
type: [Number, String],
|
|
125
|
+
default: "inherit"
|
|
126
|
+
},
|
|
127
|
+
color: {
|
|
128
|
+
type: String,
|
|
129
|
+
default: "inherit"
|
|
130
|
+
},
|
|
131
|
+
component: {
|
|
132
|
+
type: Object,
|
|
133
|
+
default: null
|
|
134
|
+
},
|
|
135
|
+
classPrefix: {
|
|
136
|
+
type: String,
|
|
137
|
+
default: DEFAULT_PREFIX
|
|
138
|
+
},
|
|
139
|
+
operable: {
|
|
140
|
+
type: Boolean,
|
|
141
|
+
default: false
|
|
142
|
+
},
|
|
143
|
+
disabled: {
|
|
144
|
+
type: Boolean,
|
|
145
|
+
default: false
|
|
146
|
+
},
|
|
147
|
+
rotate: {
|
|
148
|
+
type: [Number, String]
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
const svgIconProps = {
|
|
152
|
+
name: {
|
|
153
|
+
type: String,
|
|
154
|
+
default: "",
|
|
155
|
+
required: true
|
|
156
|
+
},
|
|
157
|
+
color: {
|
|
158
|
+
type: String,
|
|
159
|
+
default: "inherit"
|
|
160
|
+
},
|
|
161
|
+
size: {
|
|
162
|
+
type: [Number, String],
|
|
163
|
+
default: "inherit"
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
var icon = "";
|
|
167
|
+
var svgIcon = defineComponent({
|
|
168
|
+
name: "DSvgIcon",
|
|
169
|
+
props: svgIconProps,
|
|
170
|
+
setup(props) {
|
|
171
|
+
const {
|
|
172
|
+
name,
|
|
173
|
+
color,
|
|
174
|
+
size
|
|
175
|
+
} = toRefs(props);
|
|
176
|
+
const ns = useNamespace("svg-icon");
|
|
177
|
+
const iconName = computed(() => `#icon-${name.value}`);
|
|
178
|
+
const iconSize = computed(() => {
|
|
179
|
+
return typeof size.value === "number" ? `${size.value}px` : size.value;
|
|
180
|
+
});
|
|
181
|
+
const styles = {
|
|
182
|
+
width: iconSize.value,
|
|
183
|
+
height: iconSize.value
|
|
184
|
+
};
|
|
185
|
+
return () => {
|
|
186
|
+
return createVNode("svg", {
|
|
187
|
+
"class": ns.b(),
|
|
188
|
+
"style": styles
|
|
189
|
+
}, [createVNode("use", {
|
|
190
|
+
"xlink:href": iconName.value,
|
|
191
|
+
"fill": color.value
|
|
192
|
+
}, null)]);
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
function isUrl(value) {
|
|
197
|
+
return /^((http|https):)?\/\//.test(value);
|
|
198
|
+
}
|
|
199
|
+
function useIconDom(props, ctx) {
|
|
200
|
+
const {
|
|
201
|
+
component,
|
|
202
|
+
name,
|
|
203
|
+
size,
|
|
204
|
+
color,
|
|
205
|
+
classPrefix,
|
|
206
|
+
rotate
|
|
207
|
+
} = toRefs(props);
|
|
208
|
+
const ns = useNamespace("icon");
|
|
209
|
+
const iconSize = computed(() => {
|
|
210
|
+
return typeof size.value === "number" ? `${size.value}px` : size.value;
|
|
211
|
+
});
|
|
212
|
+
const IconComponent = component.value ? resolveDynamicComponent(component.value) : resolveDynamicComponent(svgIcon);
|
|
213
|
+
const imgIconDom = () => {
|
|
214
|
+
return createVNode("img", mergeProps({
|
|
215
|
+
"src": name.value,
|
|
216
|
+
"alt": name.value.split("/")[name.value.split("/").length - 1],
|
|
217
|
+
"class": [(rotate == null ? void 0 : rotate.value) === "infinite" && ns.m("spin")],
|
|
218
|
+
"style": {
|
|
219
|
+
width: iconSize.value || "",
|
|
220
|
+
transform: `rotate(${rotate == null ? void 0 : rotate.value}deg)`
|
|
221
|
+
}
|
|
222
|
+
}, ctx.attrs), null);
|
|
223
|
+
};
|
|
224
|
+
const svgIconDom = () => {
|
|
225
|
+
return createVNode(IconComponent, mergeProps({
|
|
226
|
+
"name": name.value,
|
|
227
|
+
"color": color.value,
|
|
228
|
+
"size": iconSize.value,
|
|
229
|
+
"class": [(rotate == null ? void 0 : rotate.value) === "infinite" && ns.m("spin")],
|
|
230
|
+
"style": {
|
|
231
|
+
transform: `rotate(${rotate == null ? void 0 : rotate.value}deg)`
|
|
232
|
+
}
|
|
233
|
+
}, ctx.attrs), null);
|
|
234
|
+
};
|
|
235
|
+
const fontIconDom = () => {
|
|
236
|
+
const fontIconClass = /^icon-/.test(name.value) ? name.value : `${classPrefix.value}-${name.value}`;
|
|
237
|
+
return createVNode("i", mergeProps({
|
|
238
|
+
"class": [classPrefix.value, fontIconClass, (rotate == null ? void 0 : rotate.value) === "infinite" && ns.m("spin")],
|
|
239
|
+
"style": {
|
|
240
|
+
fontSize: iconSize.value,
|
|
241
|
+
color: color.value,
|
|
242
|
+
transform: `rotate(${rotate == null ? void 0 : rotate.value}deg)`
|
|
243
|
+
}
|
|
244
|
+
}, ctx.attrs), null);
|
|
245
|
+
};
|
|
246
|
+
const iconDom = () => {
|
|
247
|
+
return component.value ? svgIconDom() : isUrl(name.value) ? imgIconDom() : fontIconDom();
|
|
248
|
+
};
|
|
249
|
+
return {
|
|
250
|
+
iconDom
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
var Icon = defineComponent({
|
|
254
|
+
name: "DIcon",
|
|
255
|
+
props: iconProps,
|
|
256
|
+
setup(props, ctx) {
|
|
257
|
+
const {
|
|
258
|
+
disabled,
|
|
259
|
+
operable
|
|
260
|
+
} = toRefs(props);
|
|
261
|
+
const {
|
|
262
|
+
iconDom
|
|
263
|
+
} = useIconDom(props, ctx);
|
|
264
|
+
const ns = useNamespace("icon");
|
|
265
|
+
const wrapClassed = computed(() => ({
|
|
266
|
+
[ns.e("container")]: true,
|
|
267
|
+
[ns.m("disabled")]: disabled.value,
|
|
268
|
+
[ns.m("operable")]: operable.value
|
|
269
|
+
}));
|
|
270
|
+
const onClick = (e) => {
|
|
271
|
+
e.stopImmediatePropagation();
|
|
272
|
+
if (disabled.value) {
|
|
273
|
+
e.preventDefault();
|
|
274
|
+
}
|
|
275
|
+
};
|
|
276
|
+
return () => {
|
|
277
|
+
var _a, _b, _c, _d;
|
|
278
|
+
return createVNode("div", {
|
|
279
|
+
"class": wrapClassed.value,
|
|
280
|
+
"onClick": onClick
|
|
281
|
+
}, [(_b = (_a = ctx.slots).prefix) == null ? void 0 : _b.call(_a), iconDom(), (_d = (_c = ctx.slots).suffix) == null ? void 0 : _d.call(_c)]);
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
});
|
|
285
|
+
var iconGroup = "";
|
|
286
|
+
defineComponent({
|
|
287
|
+
name: "DIconGroup",
|
|
288
|
+
setup(_, ctx) {
|
|
289
|
+
const ns = useNamespace("icon-group");
|
|
290
|
+
return () => {
|
|
291
|
+
var _a, _b;
|
|
292
|
+
return createVNode("div", {
|
|
293
|
+
"class": ns.b()
|
|
294
|
+
}, [(_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)]);
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
});
|
|
298
|
+
var CollapseItem = defineComponent({
|
|
299
|
+
name: "DCollapseItem",
|
|
300
|
+
props: collapseItemProps,
|
|
301
|
+
setup(props, ctx) {
|
|
302
|
+
const ns = useNamespace("collapse");
|
|
303
|
+
const transitionNs = useNamespace("collapse-transition");
|
|
304
|
+
const collapseContent = shallowRef();
|
|
305
|
+
const collapse2 = inject(SELECT_TOKEN, null);
|
|
306
|
+
const isOpen = computed(() => {
|
|
307
|
+
if (props.disabled) {
|
|
308
|
+
return false;
|
|
309
|
+
}
|
|
310
|
+
if (Array.isArray(collapse2 == null ? void 0 : collapse2.modelValue)) {
|
|
311
|
+
return Boolean(collapse2 == null ? void 0 : collapse2.modelValue.length) && (collapse2 == null ? void 0 : collapse2.modelValue.includes(props.name));
|
|
312
|
+
} else {
|
|
313
|
+
return Boolean(collapse2 == null ? void 0 : collapse2.modelValue) && (collapse2 == null ? void 0 : collapse2.modelValue) === props.name;
|
|
314
|
+
}
|
|
315
|
+
});
|
|
316
|
+
const handlerTitleClick = (e) => {
|
|
317
|
+
e.preventDefault();
|
|
318
|
+
e.stopPropagation();
|
|
319
|
+
if (!props.disabled) {
|
|
320
|
+
collapse2 == null ? void 0 : collapse2.collapseItemClick(props.name);
|
|
321
|
+
}
|
|
322
|
+
};
|
|
323
|
+
onMounted(() => {
|
|
324
|
+
if (collapseContent.value) {
|
|
325
|
+
const dom = collapseContent.value;
|
|
326
|
+
if (isOpen.value) {
|
|
327
|
+
dom.style.height = `${dom.offsetHeight}px`;
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
});
|
|
331
|
+
const enter = (element) => {
|
|
332
|
+
const el = element;
|
|
333
|
+
el.style.height = "";
|
|
334
|
+
const height = el.offsetHeight;
|
|
335
|
+
el.style.height = "0px";
|
|
336
|
+
el.offsetHeight;
|
|
337
|
+
el.style.height = `${height}px`;
|
|
338
|
+
};
|
|
339
|
+
const leave = (element) => {
|
|
340
|
+
const el = element;
|
|
341
|
+
el.style.height = "0px";
|
|
342
|
+
};
|
|
343
|
+
return () => {
|
|
344
|
+
return createVNode("div", {
|
|
345
|
+
"class": ns.e("item")
|
|
346
|
+
}, [createVNode("div", {
|
|
347
|
+
"class": [ns.e("item-title"), ns.m("overflow-ellipsis"), isOpen.value && ns.m("open"), props.disabled && ns.em("item", "disabled")],
|
|
348
|
+
"onClick": handlerTitleClick
|
|
349
|
+
}, [ctx.slots.title ? ctx.slots.title() : props.title, createVNode("span", {
|
|
350
|
+
"class": ns.e("open-icon")
|
|
351
|
+
}, [createVNode(Icon, {
|
|
352
|
+
"name": "select-arrow",
|
|
353
|
+
"size": "16px"
|
|
354
|
+
}, null)])]), createVNode(Transition, {
|
|
355
|
+
"name": transitionNs.b(),
|
|
356
|
+
"onEnter": enter,
|
|
357
|
+
"onLeave": leave
|
|
358
|
+
}, {
|
|
359
|
+
default: () => {
|
|
360
|
+
var _a, _b;
|
|
361
|
+
return [isOpen.value && createVNode("div", {
|
|
362
|
+
"ref": collapseContent,
|
|
363
|
+
"class": ns.e("item-content")
|
|
364
|
+
}, [(_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)])];
|
|
365
|
+
}
|
|
366
|
+
})]);
|
|
367
|
+
};
|
|
368
|
+
}
|
|
369
|
+
});
|
|
370
|
+
var index = {
|
|
371
|
+
title: "Collapse \u6298\u53E0\u9762\u677F",
|
|
372
|
+
category: "\u6570\u636E\u5C55\u793A",
|
|
373
|
+
status: "100%",
|
|
374
|
+
install(app) {
|
|
375
|
+
app.component(Collapse.name, Collapse);
|
|
376
|
+
app.component(CollapseItem.name, CollapseItem);
|
|
377
|
+
}
|
|
378
|
+
};
|
|
379
|
+
export { Collapse, CollapseItem, collapseItemProps, collapseProps, index as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var k=Object.defineProperty,w=Object.defineProperties;var L=Object.getOwnPropertyDescriptors;var V=Object.getOwnPropertySymbols;var q=Object.prototype.hasOwnProperty,F=Object.prototype.propertyIsEnumerable;var I=(r,e,f)=>e in r?k(r,e,{enumerable:!0,configurable:!0,writable:!0,value:f}):r[e]=f,S=(r,e)=>{for(var f in e||(e={}))q.call(e,f)&&I(r,f,e[f]);if(V)for(var f of V(e))F.call(e,f)&&I(r,f,e[f]);return r},D=(r,e)=>w(r,L(e));(function(r,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(r=typeof globalThis!="undefined"?globalThis:r||self,e(r.index={},r.Vue))})(this,function(r,e){"use strict";const f=Symbol("dCollapse"),C={modelValue:{type:[String,Number,Array],default:"",required:!0},accordion:{type:Boolean,default:!1}},N={name:{type:[String,Number],default:"",required:!0},title:{type:String,default:""},disabled:{type:Boolean,default:!1}};function v(o,s,l){let a=o;return s&&(a+=`__${s}`),l&&(a+=`--${l}`),a}function g(o,s=!1){const l=s?`.devui-${o}`:`devui-${o}`;return{b:()=>v(l),e:t=>t?v(l,t):"",m:t=>t?v(l,"",t):"",em:(t,u)=>t&&u?v(l,t,u):""}}var O="",y=e.defineComponent({name:"DCollapse",props:C,emits:["change","update:modelValue"],setup(o,s){const l=g("collapse"),a=g("scrollbar"),c=i=>!i&&i!==0?[]:Array.isArray(i)?i:[i],n=i=>{const t=[...c(o.modelValue)],u=t.indexOf(i);if(o.accordion){let p=i;(t[0]||t[0]===0)&&t[0]===i&&(p=""),s.emit("update:modelValue",p),s.emit("change",p)}else u>-1?t.splice(u,1):t.push(i),s.emit("update:modelValue",t),s.emit("change",t)};return e.provide(f,e.reactive(D(S({},e.toRefs(o)),{collapseItemClick:n}))),()=>{var i,t;return e.createVNode("div",{class:[l.b(),a.b()]},[(t=(i=s.slots).default)==null?void 0:t.call(i)])}}});const P={name:{type:String,default:"",required:!0},size:{type:[Number,String],default:"inherit"},color:{type:String,default:"inherit"},component:{type:Object,default:null},classPrefix:{type:String,default:"icon"},operable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},rotate:{type:[Number,String]}},$={name:{type:String,default:"",required:!0},color:{type:String,default:"inherit"},size:{type:[Number,String],default:"inherit"}};var x="",E=e.defineComponent({name:"DSvgIcon",props:$,setup(o){const{name:s,color:l,size:a}=e.toRefs(o),c=g("svg-icon"),n=e.computed(()=>`#icon-${s.value}`),i=e.computed(()=>typeof a.value=="number"?`${a.value}px`:a.value),t={width:i.value,height:i.value};return()=>e.createVNode("svg",{class:c.b(),style:t},[e.createVNode("use",{"xlink:href":n.value,fill:l.value},null)])}});function z(o){return/^((http|https):)?\/\//.test(o)}function T(o,s){const{component:l,name:a,size:c,color:n,classPrefix:i,rotate:t}=e.toRefs(o),u=g("icon"),p=e.computed(()=>typeof c.value=="number"?`${c.value}px`:c.value),d=l.value?e.resolveDynamicComponent(l.value):e.resolveDynamicComponent(E),m=()=>e.createVNode("img",e.mergeProps({src:a.value,alt:a.value.split("/")[a.value.split("/").length-1],class:[(t==null?void 0:t.value)==="infinite"&&u.m("spin")],style:{width:p.value||"",transform:`rotate(${t==null?void 0:t.value}deg)`}},s.attrs),null),b=()=>e.createVNode(d,e.mergeProps({name:a.value,color:n.value,size:p.value,class:[(t==null?void 0:t.value)==="infinite"&&u.m("spin")],style:{transform:`rotate(${t==null?void 0:t.value}deg)`}},s.attrs),null),B=()=>{const R=/^icon-/.test(a.value)?a.value:`${i.value}-${a.value}`;return e.createVNode("i",e.mergeProps({class:[i.value,R,(t==null?void 0:t.value)==="infinite"&&u.m("spin")],style:{fontSize:p.value,color:n.value,transform:`rotate(${t==null?void 0:t.value}deg)`}},s.attrs),null)};return{iconDom:()=>l.value?b():z(a.value)?m():B()}}var A=e.defineComponent({name:"DIcon",props:P,setup(o,s){const{disabled:l,operable:a}=e.toRefs(o),{iconDom:c}=T(o,s),n=g("icon"),i=e.computed(()=>({[n.e("container")]:!0,[n.m("disabled")]:l.value,[n.m("operable")]:a.value})),t=u=>{u.stopImmediatePropagation(),l.value&&u.preventDefault()};return()=>{var u,p,d,m;return e.createVNode("div",{class:i.value,onClick:t},[(p=(u=s.slots).prefix)==null?void 0:p.call(u),c(),(m=(d=s.slots).suffix)==null?void 0:m.call(d)])}}}),H="";e.defineComponent({name:"DIconGroup",setup(o,s){const l=g("icon-group");return()=>{var a,c;return e.createVNode("div",{class:l.b()},[(c=(a=s.slots).default)==null?void 0:c.call(a)])}}});var h=e.defineComponent({name:"DCollapseItem",props:N,setup(o,s){const l=g("collapse"),a=g("collapse-transition"),c=e.shallowRef(),n=e.inject(f,null),i=e.computed(()=>o.disabled?!1:Array.isArray(n==null?void 0:n.modelValue)?Boolean(n==null?void 0:n.modelValue.length)&&(n==null?void 0:n.modelValue.includes(o.name)):Boolean(n==null?void 0:n.modelValue)&&(n==null?void 0:n.modelValue)===o.name),t=d=>{d.preventDefault(),d.stopPropagation(),o.disabled||n==null||n.collapseItemClick(o.name)};e.onMounted(()=>{if(c.value){const d=c.value;i.value&&(d.style.height=`${d.offsetHeight}px`)}});const u=d=>{const m=d;m.style.height="";const b=m.offsetHeight;m.style.height="0px",m.offsetHeight,m.style.height=`${b}px`},p=d=>{const m=d;m.style.height="0px"};return()=>e.createVNode("div",{class:l.e("item")},[e.createVNode("div",{class:[l.e("item-title"),l.m("overflow-ellipsis"),i.value&&l.m("open"),o.disabled&&l.em("item","disabled")],onClick:t},[s.slots.title?s.slots.title():o.title,e.createVNode("span",{class:l.e("open-icon")},[e.createVNode(A,{name:"select-arrow",size:"16px"},null)])]),e.createVNode(e.Transition,{name:a.b(),onEnter:u,onLeave:p},{default:()=>{var d,m;return[i.value&&e.createVNode("div",{ref:c,class:l.e("item-content")},[(m=(d=s.slots).default)==null?void 0:m.call(d)])]}})])}}),_={title:"Collapse \u6298\u53E0\u9762\u677F",category:"\u6570\u636E\u5C55\u793A",status:"100%",install(o){o.component(y.name,y),o.component(h.name,h)}};r.Collapse=y,r.CollapseItem=h,r.collapseItemProps=N,r.collapseProps=C,r.default=_,Object.defineProperty(r,"__esModule",{value:!0}),r[Symbol.toStringTag]="Module"});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@charset "UTF-8";.devui-collapse{font-size:var(--devui-font-size, 14px);background:var(--devui-base-bg, #ffffff);width:100%;overflow-y:auto;box-shadow:var(--devui-shadow-length-base, 0 1px 4px 0) var(--devui-shadow, rgba(37, 43, 58, .2))}:host{display:block}.devui-collapse__item .devui-collapse--overflow-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.devui-collapse__item-title{display:block;height:45px;width:100%;padding:0 28px 0 20px;font-weight:400;line-height:45px;color:var(--devui-text, #252b3a);background-color:var(--devui-base-bg, #ffffff);cursor:pointer}.devui-collapse__item-title.devui-collapse__item--disabled{color:var(--devui-disabled-text, #adb0b8);cursor:not-allowed}.devui-collapse__item-title:not(.devui-collapse__item--disabled):hover{background:var(--devui-list-item-hover-bg, #f2f2f3);color:var(--devui-list-item-hover-text, #252b3a)}.devui-collapse__item>.devui-collapse__item-title{position:relative}.devui-collapse__item>.devui-collapse__item-title>.devui-collapse__open-icon{display:inline-block;text-indent:0;pointer-events:none;position:absolute;right:10px;top:14px;width:16px;height:16px;line-height:16px;transition:transform ease-out .4s}.devui-collapse__item>.devui-collapse__item-title.devui-collapse--open>.devui-collapse__open-icon{transform:rotate(180deg);transform-origin:center}.devui-collapse__item-content{padding:0 12px 0 20px;line-height:1.5;color:var(--devui-text-weak, #575d6c)}.devui-collapse-transition-leave-active{transition:all .4s ease-in-out;animation:panelUpOut .4s ease-in-out;animation-fill-mode:both}.devui-collapse-transition-enter-active{transition:all .4s ease-in-out;animation:panelUpIn .4s ease-in-out;animation-fill-mode:both}@keyframes panelUpOut{0%{transform:scaleY(1);transform-origin:0% 0%;opacity:1}to{transform:scaleY(0);transform-origin:0% 0%;opacity:0}}@keyframes panelUpIn{0%{transform:scaleY(0);transform-origin:0% 0%;opacity:0}to{transform:scaleY(1);transform-origin:0% 0%;opacity:1}}.devui-icon__container{display:inline-flex;align-items:center;color:var(--devui-icon-fill, #71757f)}.devui-icon__container>*:not(:last-child){vertical-align:middle;margin-right:8px}.devui-icon__container i{vertical-align:middle;transition:all var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1))}.devui-icon--disabled{color:var(--devui-disabled-text, #adb0b8);cursor:not-allowed}.devui-icon--disabled i{color:var(--devui-disabled-text, #adb0b8)}.devui-icon--operable:not(.devui-icon--disabled){cursor:pointer;transition:color var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1))}.devui-icon--operable:not(.devui-icon--disabled) i{cursor:pointer}.devui-icon--operable:hover:not(.devui-icon--disabled){color:var(--devui-icon-fill-hover, #252b3a)}.devui-icon--operable:hover:not(.devui-icon--disabled).devui-icon__container{background-color:var(--devui-icon-background-hover, var(--devui-list-item-hover-bg, #f2f2f3))}.devui-icon--operable:hover:not(.devui-icon--disabled) i{color:var(--devui-icon-fill-hover, #252b3a)}.devui-icon--operable:active:not(.devui-icon--disabled){color:var(--devui-icon-active-color, var(--devui-icon-fill-active, #252b3a))}.devui-icon--operable:active:not(.devui-icon--disabled).devui-icon__container{background-color:var(--devui-icon-background-active, var(--devui-list-item-active-bg, #f2f5fc))}.devui-icon--operable:active:not(.devui-icon--disabled) i{color:var(--devui-icon-active-color, var(--devui-icon-fill-active, #252b3a))}.devui-icon--operable.devui-icon__container{height:32px;padding:0 8px;margin-left:-8px;border-radius:var(--devui-border-radius, 4px);transition:all var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1))}.devui-icon--spin{animation:iconSpin 2.5s linear infinite}.devui-svg-icon{vertical-align:middle}@keyframes iconSpin{0%{transform:rotate(0)}50%{transform:rotate(180deg)}to{transform:rotate(360deg)}}.devui-icon-group{display:inline-flex;align-items:center}.devui-icon-group>.devui-icon__container:not(.devui-icon--operable){padding:8px;margin-left:0}.devui-icon-group>.devui-icon__container:not(.devui-icon--operable):first-child{margin-left:-8px}.devui-icon-group>*:not(:first-child){margin-left:0}
|
package/countdown/index.es.js
CHANGED
|
@@ -23,7 +23,6 @@ const countdownProps = {
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
|
-
var countdown = "";
|
|
27
26
|
const getFormatTime = (leftTime) => {
|
|
28
27
|
const timeformat = /* @__PURE__ */ new Map([["Y", 0], ["M", 0], ["D", 0], ["H", 0], ["m", 0], ["s", 0], ["S", 0]]);
|
|
29
28
|
const year = Math.floor(leftTime / (365 * 24 * 60 * 60 * 1e3));
|
|
@@ -96,6 +95,7 @@ const numFormat = (n, len) => {
|
|
|
96
95
|
return str + n;
|
|
97
96
|
}
|
|
98
97
|
};
|
|
98
|
+
var countdown = "";
|
|
99
99
|
var Countdown = defineComponent({
|
|
100
100
|
name: "DCountdown",
|
|
101
101
|
props: countdownProps,
|
|
@@ -130,8 +130,9 @@ var Countdown = defineComponent({
|
|
|
130
130
|
};
|
|
131
131
|
const startTime = () => {
|
|
132
132
|
getTime();
|
|
133
|
-
if (countdown2.value)
|
|
133
|
+
if (countdown2.value) {
|
|
134
134
|
return;
|
|
135
|
+
}
|
|
135
136
|
countdown2.value = setInterval(() => {
|
|
136
137
|
const t = getTime();
|
|
137
138
|
if (t === 0) {
|
|
@@ -162,15 +163,12 @@ var Countdown = defineComponent({
|
|
|
162
163
|
};
|
|
163
164
|
}
|
|
164
165
|
});
|
|
165
|
-
Countdown.install = function(app) {
|
|
166
|
-
app.component(Countdown.name, Countdown);
|
|
167
|
-
};
|
|
168
166
|
var index = {
|
|
169
167
|
title: "Countdown \u5012\u8BA1\u65F6",
|
|
170
168
|
category: "\u6570\u636E\u5C55\u793A",
|
|
171
169
|
status: "100%",
|
|
172
170
|
install(app) {
|
|
173
|
-
app.
|
|
171
|
+
app.component(Countdown.name, Countdown);
|
|
174
172
|
}
|
|
175
173
|
};
|
|
176
|
-
export { Countdown, index as default };
|
|
174
|
+
export { Countdown, countdownProps, index as default };
|
package/countdown/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(u,a){typeof exports=="object"&&typeof module!="undefined"?a(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],a):(u=typeof globalThis!="undefined"?globalThis:u||self,a(u.index={},u.Vue))})(this,function(u,a){"use strict";const w={value:{type:Number,required:!0},format:{type:String,default:"HH:mm:ss"},prefix:{type:String,default:""},suffix:{type:String,default:""},valueStyle:{type:Object,default:()=>({})}},M=e=>{const t=new Map([["Y",0],["M",0],["D",0],["H",0],["m",0],["s",0],["S",0]]),n=Math.floor(e/(365*24*60*60*1e3)),s=Math.floor(e/(30*24*60*60*1e3)%12),o=Math.floor(e/(24*60*60*1e3)%30),r=Math.floor(e/(60*60*1e3)%24),h=Math.floor(e/(60*1e3)%60),d=Math.floor(e/1e3%60),S=e%1e3;return t.set("Y",n),t.set("M",s),t.set("D",o),t.set("H",r),t.set("m",h),t.set("s",d),t.set("S",S),t},p=(e,t)=>{const n=new Map([["Y",0],["M",0],["D",0],["H",0],["m",0],["s",0],["S",0]]),s=new Map([["Y",12],["M",30],["D",24],["H",60],["m",60],["s",1e3],["S",1]]);let o=0;for(const r of n.keys())e.has(r)?(n.set(r,t.get(r)+o),o=0):o+=t.get(r)*s.get(r);return!e.has("S")&&t.get("S")>500&&n.set("s",n.get("s")+1),n},y=e=>{const t=new Set(["Y","M","D","H","m","s","S"]),n=[];for(let s=0;s<e.length;s++){const o=e[s];n.length===0||n[n.length-1].k!==o||!t.has(o)?n.push({k:o,n:1}):n[n.length-1].n++}return n},v=e=>{const t=new Set(["Y","M","D","H","m","s","S"]),n=new Set;for(let s=0;s<e.length;s++){const o=e[s];t.has(o)&&n.add(o)}return n},D=(e,t)=>{const n=10**t-1;if(e>=n)return e;{const s=t-e.toString().length;let o="";for(let r=0;r<s;r++)o+="0";return o+e}};var T="",g=a.defineComponent({name:"DCountdown",props:w,emits:["onChange","onFinish"],setup(e,t){const n=a.ref(),s=v(e.format),o=y(e.format),r=a.ref(""),h=c=>{const l=new Set(["Y","M","D","H","m","s","S"]),f=o.reduce((i,m)=>l.has(m.k)?i+D(c.get(m.k),m.n):i+m.k,"");r.value=f},d=()=>{const c=new Date(e.value).getTime(),l=c>new Date().getTime()?c-new Date().getTime():0,f=M(l),i=p(s,f);return!t.slots.default&&h(i),t.emit("onChange",{leftTime:l,formatTime:f,legalTime:i}),l},S=()=>{d(),!n.value&&(n.value=setInterval(()=>{d()===0&&(t.emit("onFinish"),clearInterval(n.value))},s.has("S")?100:1e3))};return a.onMounted(()=>{S()}),a.onUnmounted(()=>{clearInterval(n.value)}),()=>a.createVNode("div",{class:"devui-countdown"},[t.slots.default?t.slots.default():a.createVNode("div",{class:"countdown-content",style:e.valueStyle},[a.createVNode("span",{class:"countdown-prefix"},[e.prefix]),a.createVNode("span",{class:"countdown-value"},[r.value]),a.createVNode("span",{class:"countdown-suffix"},[e.suffix])])])}}),H={title:"Countdown \u5012\u8BA1\u65F6",category:"\u6570\u636E\u5C55\u793A",status:"100%",install(e){e.component(g.name,g)}};u.Countdown=g,u.countdownProps=w,u.default=H,Object.defineProperty(u,"__esModule",{value:!0}),u[Symbol.toStringTag]="Module"});
|