vue-devui 1.0.0-rc.1 → 1.0.0-rc.12
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 +70 -121
- package/alert/index.es.js +46 -15
- package/alert/index.umd.js +1 -1
- package/alert/style.css +1 -1
- package/auto-complete/index.es.js +8204 -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 +36 -5
- package/badge/index.umd.js +1 -1
- package/badge/style.css +1 -1
- package/button/index.es.js +5727 -111
- 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 +213 -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 +59 -19
- package/countdown/index.umd.js +1 -1
- package/{anchor → date-picker-pro}/index.d.ts +0 -0
- package/date-picker-pro/index.es.js +10856 -0
- package/date-picker-pro/index.umd.js +27 -0
- package/{breadcrumb → date-picker-pro}/package.json +1 -1
- package/date-picker-pro/style.css +1 -0
- 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 +210 -149
- package/dropdown/index.umd.js +1 -1
- package/dropdown/style.css +1 -1
- package/editable-select/index.es.js +569 -159
- package/editable-select/index.umd.js +1 -1
- package/editable-select/style.css +1 -1
- package/form/index.es.js +1048 -1187
- package/form/index.umd.js +15 -15
- package/form/style.css +1 -1
- package/fullscreen/index.es.js +29 -5
- 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 +183 -23
- package/icon/index.umd.js +1 -1
- package/icon/style.css +1 -0
- package/image-preview/index.es.js +53 -30
- package/image-preview/index.umd.js +1 -1
- package/image-preview/style.css +1 -1
- package/input/index.es.js +8101 -144
- package/input/index.umd.js +27 -1
- package/input/style.css +1 -1
- package/input-number/index.es.js +274 -177
- 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 +375 -171
- package/modal/index.umd.js +1 -1
- package/modal/style.css +1 -1
- package/notification/index.es.js +293 -40
- 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/DRangeDatePickerPro.js +3 -0
- package/nuxt/components/DatePickerPro.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/OptionGroup.js +3 -0
- package/nuxt/components/RadioButton.js +3 -0
- package/nuxt/components/Step.js +3 -0
- package/nuxt/components/Steps.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/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/datePickerProCommonProps.js +3 -0
- package/nuxt/components/datePickerProPanelProps.js +3 -0
- package/nuxt/components/datePickerProProps.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/iconProps.js +1 -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/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/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/stepProps.js +3 -0
- package/nuxt/components/stepsProps.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/timerPickerPanelProps.js +3 -0
- package/nuxt/components/treeProps.js +3 -0
- package/overlay/index.es.js +104 -133
- package/overlay/index.umd.js +1 -1
- package/overlay/style.css +1 -1
- package/package.json +4 -2
- package/pagination/index.es.js +171 -141
- package/pagination/index.umd.js +1 -1
- package/pagination/style.css +1 -1
- package/panel/style.css +1 -1
- package/popover/index.es.js +294 -230
- 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 +7967 -146
- 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 +170 -27
- package/result/index.umd.js +1 -1
- package/result/style.css +1 -1
- package/ripple/index.es.js +43 -42
- package/ripple/index.umd.js +1 -1
- package/search/index.es.js +3660 -1097
- package/search/index.umd.js +18 -18
- package/search/style.css +1 -1
- package/select/index.es.js +8998 -487
- package/select/index.umd.js +27 -1
- package/select/style.css +1 -1
- package/skeleton/index.es.js +46 -24
- package/skeleton/index.umd.js +1 -1
- package/skeleton/style.css +1 -1
- package/slider/index.es.js +144 -138
- package/slider/index.umd.js +1 -1
- package/slider/style.css +1 -1
- package/splitter/index.es.js +468 -340
- package/splitter/index.umd.js +16 -16
- 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 +26 -2
- package/status/index.umd.js +1 -1
- package/status/style.css +1 -1
- package/{back-top → steps}/index.d.ts +0 -0
- package/steps/index.es.js +385 -0
- package/steps/index.umd.js +1 -0
- package/{gantt → steps}/package.json +1 -1
- package/steps/style.css +1 -0
- 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 +10315 -1147
- package/table/index.umd.js +27 -1
- package/table/style.css +1 -1
- package/tabs/index.es.js +345 -142
- package/tabs/index.umd.js +1 -1
- package/tabs/style.css +1 -1
- package/tag/index.es.js +47 -23
- 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/time-picker/index.es.js +8704 -559
- package/time-picker/index.umd.js +27 -1
- package/time-picker/style.css +1 -1
- package/{breadcrumb → time-select}/index.d.ts +0 -0
- package/{color-picker → time-select}/index.es.js +4116 -2914
- package/time-select/index.umd.js +27 -0
- package/{back-top → time-select}/package.json +1 -1
- package/time-select/style.css +1 -0
- package/timeline/index.es.js +177 -37
- package/timeline/index.umd.js +1 -1
- package/timeline/style.css +1 -1
- package/tooltip/index.es.js +286 -221
- package/tooltip/index.umd.js +15 -15
- package/tooltip/style.css +1 -1
- package/tree/index.es.js +5325 -1855
- package/tree/index.umd.js +18 -18
- package/tree/style.css +1 -1
- package/upload/index.es.js +456 -133
- package/upload/index.umd.js +1 -1
- package/upload/style.css +1 -1
- package/vue-devui.es.js +14986 -16343
- package/vue-devui.umd.js +30 -20
- package/accordion/index.es.js +0 -723
- 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 -130
- package/back-top/index.umd.js +0 -1
- package/back-top/style.css +0 -1
- package/breadcrumb/index.es.js +0 -128
- 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 -314
- 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 -5971
- 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/date-picker/index.d.ts +0 -7
- package/date-picker/index.es.js +0 -1154
- package/date-picker/index.umd.js +0 -1
- package/date-picker/package.json +0 -7
- package/date-picker/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/style.css +0 -1
- package/input-icon/index.d.ts +0 -7
- package/input-icon/index.es.js +0 -332
- 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/DatePicker.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/StickSlider.js +0 -3
- package/nuxt/components/Sticky.js +0 -2
- package/nuxt/components/TagInput.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 -261
- 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 -242
- 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 -331
- package/tag-input/index.umd.js +0 -1
- package/tag-input/package.json +0 -7
- package/tag-input/style.css +0 -1
- package/transfer/index.d.ts +0 -7
- package/transfer/index.es.js +0 -7615
- 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 -627
- package/tree-select/index.umd.js +0 -1
- package/tree-select/package.json +0 -7
- package/tree-select/style.css +0 -1
package/statistic/index.es.js
CHANGED
|
@@ -4,7 +4,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4
4
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
5
|
return value;
|
|
6
6
|
};
|
|
7
|
-
import { defineComponent, ref, computed, onMounted, watch, createVNode,
|
|
7
|
+
import { defineComponent, ref, computed, onMounted, watch, createVNode, createTextVNode } from "vue";
|
|
8
8
|
const statisticProps = {
|
|
9
9
|
title: {
|
|
10
10
|
type: String,
|
|
@@ -26,9 +26,6 @@ const statisticProps = {
|
|
|
26
26
|
type: String,
|
|
27
27
|
default: ""
|
|
28
28
|
},
|
|
29
|
-
valueStyle: {
|
|
30
|
-
type: Object
|
|
31
|
-
},
|
|
32
29
|
animationDuration: {
|
|
33
30
|
type: Number,
|
|
34
31
|
default: 2e3
|
|
@@ -61,9 +58,10 @@ const isHasDot = (value) => {
|
|
|
61
58
|
if (!isNaN(value)) {
|
|
62
59
|
return (value + "").indexOf(".") !== -1;
|
|
63
60
|
}
|
|
61
|
+
return false;
|
|
64
62
|
};
|
|
65
63
|
const analysisValueType = (value, propsValue, groupSeparator, splitPrecisionNumber) => {
|
|
66
|
-
const fixedNumber = propsValue.toString().indexOf(".") !== -1 ? propsValue.toString().length - propsValue.toString().indexOf(".") - 1 : 0;
|
|
64
|
+
const fixedNumber = (propsValue == null ? void 0 : propsValue.toString().indexOf(".")) !== -1 ? (propsValue == null ? void 0 : propsValue.toString().length) - (propsValue == null ? void 0 : propsValue.toString().indexOf(".")) - 1 : 0;
|
|
67
65
|
if (typeof value === "number") {
|
|
68
66
|
if (isHasDot(value)) {
|
|
69
67
|
return splitPrecisionNumber ? separator(value.toFixed(splitPrecisionNumber).toString(), groupSeparator) : separator(value.toFixed(fixedNumber).toString(), groupSeparator);
|
|
@@ -92,16 +90,7 @@ const easeInExpo = function(x) {
|
|
|
92
90
|
const easeInOutCirc = function(x) {
|
|
93
91
|
return x < 0.5 ? (1 - sqrt(1 - pow(2 * x, 2))) / 2 : (sqrt(1 - pow(-2 * x + 2, 2)) + 1) / 2;
|
|
94
92
|
};
|
|
95
|
-
var easing =
|
|
96
|
-
__proto__: null,
|
|
97
|
-
[Symbol.toStringTag]: "Module",
|
|
98
|
-
easeOutCubic,
|
|
99
|
-
linear,
|
|
100
|
-
easeOutExpo,
|
|
101
|
-
easeInOutExpo,
|
|
102
|
-
easeInExpo,
|
|
103
|
-
easeInOutCirc
|
|
104
|
-
});
|
|
93
|
+
var easing = { easeOutCubic, linear, easeOutExpo, easeInOutExpo, easeInExpo, easeInOutCirc };
|
|
105
94
|
class Tween {
|
|
106
95
|
constructor(options) {
|
|
107
96
|
__publicField(this, "from");
|
|
@@ -119,7 +108,7 @@ class Tween {
|
|
|
119
108
|
__publicField(this, "time");
|
|
120
109
|
__publicField(this, "elapsed");
|
|
121
110
|
__publicField(this, "keys");
|
|
122
|
-
const { from, to, duration, delay, easing:
|
|
111
|
+
const { from, to, duration, delay, easing: easingValue, onStart, onUpdate, onFinish } = options;
|
|
123
112
|
for (const key in from) {
|
|
124
113
|
if (to[key] === void 0) {
|
|
125
114
|
to[key] = from[key];
|
|
@@ -134,7 +123,7 @@ class Tween {
|
|
|
134
123
|
this.to = to;
|
|
135
124
|
this.duration = duration;
|
|
136
125
|
this.delay = delay;
|
|
137
|
-
this.easing =
|
|
126
|
+
this.easing = easingValue;
|
|
138
127
|
this.onStart = onStart;
|
|
139
128
|
this.onUpdate = onUpdate;
|
|
140
129
|
this.onFinish = onFinish;
|
|
@@ -187,15 +176,38 @@ class Tween {
|
|
|
187
176
|
this.timer = null;
|
|
188
177
|
}
|
|
189
178
|
}
|
|
179
|
+
function createBem(namespace, element, modifier) {
|
|
180
|
+
let cls = namespace;
|
|
181
|
+
if (element) {
|
|
182
|
+
cls += `__${element}`;
|
|
183
|
+
}
|
|
184
|
+
if (modifier) {
|
|
185
|
+
cls += `--${modifier}`;
|
|
186
|
+
}
|
|
187
|
+
return cls;
|
|
188
|
+
}
|
|
189
|
+
function useNamespace(block, needDot = false) {
|
|
190
|
+
const namespace = needDot ? `.devui-${block}` : `devui-${block}`;
|
|
191
|
+
const b = () => createBem(namespace);
|
|
192
|
+
const e = (element) => element ? createBem(namespace, element) : "";
|
|
193
|
+
const m = (modifier) => modifier ? createBem(namespace, "", modifier) : "";
|
|
194
|
+
const em = (element, modifier) => element && modifier ? createBem(namespace, element, modifier) : "";
|
|
195
|
+
return {
|
|
196
|
+
b,
|
|
197
|
+
e,
|
|
198
|
+
m,
|
|
199
|
+
em
|
|
200
|
+
};
|
|
201
|
+
}
|
|
190
202
|
var statistic = "";
|
|
191
203
|
var Statistic = defineComponent({
|
|
192
204
|
name: "DStatistic",
|
|
193
|
-
inheritAttrs: false,
|
|
194
205
|
props: statisticProps,
|
|
195
206
|
setup(props, ctx) {
|
|
196
207
|
var _a;
|
|
197
208
|
const innerValue = ref((_a = props.valueFrom) != null ? _a : props.value);
|
|
198
209
|
const tween = ref(null);
|
|
210
|
+
const ns = useNamespace("statistic");
|
|
199
211
|
const animation = (from = ((_b) => (_b = props.valueFrom) != null ? _b : 0)(), to = typeof props.value === "number" ? props.value : Number(props.value)) => {
|
|
200
212
|
if (from !== to) {
|
|
201
213
|
tween.value = new Tween({
|
|
@@ -233,35 +245,30 @@ var Statistic = defineComponent({
|
|
|
233
245
|
});
|
|
234
246
|
return () => {
|
|
235
247
|
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
|
|
236
|
-
return createVNode("div",
|
|
237
|
-
"class":
|
|
238
|
-
},
|
|
239
|
-
"class": "
|
|
240
|
-
"style": props.titleStyle
|
|
248
|
+
return createVNode("div", {
|
|
249
|
+
"class": ns.b()
|
|
250
|
+
}, [createVNode("div", {
|
|
251
|
+
"class": ns.e("title")
|
|
241
252
|
}, [((_b = (_a2 = ctx.slots).title) == null ? void 0 : _b.call(_a2)) || props.title]), createVNode("div", {
|
|
242
|
-
"class": "
|
|
243
|
-
"style": props.valueStyle
|
|
253
|
+
"class": ns.e("content")
|
|
244
254
|
}, [props.prefix || ((_d = (_c = ctx.slots).prefix) == null ? void 0 : _d.call(_c)) ? createVNode("span", {
|
|
245
|
-
"class": "
|
|
255
|
+
"class": ns.e("prefix")
|
|
246
256
|
}, [((_f = (_e = ctx.slots).prefix) == null ? void 0 : _f.call(_e)) || props.prefix]) : null, createVNode("span", {
|
|
247
|
-
"class": "
|
|
257
|
+
"class": ns.e("value")
|
|
248
258
|
}, [statisticValue.value]), props.suffix || ((_h = (_g = ctx.slots).suffix) == null ? void 0 : _h.call(_g)) ? createVNode("span", {
|
|
249
|
-
"class": "
|
|
259
|
+
"class": ns.e("suffix")
|
|
250
260
|
}, [((_j = (_i = ctx.slots).suffix) == null ? void 0 : _j.call(_i)) || props.suffix]) : null]), props.extra || ((_l = (_k = ctx.slots).extra) == null ? void 0 : _l.call(_k)) ? createVNode("div", {
|
|
251
|
-
"class": "
|
|
261
|
+
"class": ns.e("extra")
|
|
252
262
|
}, [createTextVNode(" "), ((_n = (_m = ctx.slots).extra) == null ? void 0 : _n.call(_m)) || props.extra]) : null]);
|
|
253
263
|
};
|
|
254
264
|
}
|
|
255
265
|
});
|
|
256
|
-
Statistic.install = function(app) {
|
|
257
|
-
app.component(Statistic.name, Statistic);
|
|
258
|
-
};
|
|
259
266
|
var index = {
|
|
260
267
|
title: "Statistic \u7EDF\u8BA1\u6570\u503C",
|
|
261
268
|
category: "\u6570\u636E\u5C55\u793A",
|
|
262
269
|
status: "100%",
|
|
263
270
|
install(app) {
|
|
264
|
-
app.
|
|
271
|
+
app.component(Statistic.name, Statistic);
|
|
265
272
|
}
|
|
266
273
|
};
|
|
267
|
-
export { Statistic, index as default };
|
|
274
|
+
export { Statistic, index as default, statisticProps };
|
package/statistic/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var _=Object.defineProperty;var j=(a,i,c)=>i in a?_(a,i,{enumerable:!0,configurable:!0,writable:!0,value:c}):a[i]=c;var r=(a,i,c)=>(j(a,typeof i!="symbol"?i+"":i,c),c);(function(a,i){typeof exports=="object"&&typeof module!="undefined"?i(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],i):(a=typeof globalThis!="undefined"?globalThis:a||self,i(a.index={},a.Vue))})(this,function(a,i){"use strict";const c={title:{type:String,default:""},value:{type:[Number,String]},prefix:{type:String},suffix:{type:String},precision:{type:Number},groupSeparator:{type:String,default:""},animationDuration:{type:Number,default:2e3},valueFrom:{type:Number},animation:{type:Boolean,default:!1},start:{type:Boolean,default:!0},extra:{type:String,default:""}},y=(t,e)=>t.replace(/\d+/,function(s){return s.replace(/(\d)(?=(\d{3})+$)/g,function(o){return o+`${e}`})}),$=t=>isNaN(t)?!1:(t+"").indexOf(".")!==-1,A=(t,e,n,s)=>{const o=(e==null?void 0:e.toString().indexOf("."))!==-1?(e==null?void 0:e.toString().length)-(e==null?void 0:e.toString().indexOf("."))-1:0;return typeof t=="number"?$(t)?y(s?t.toFixed(s).toString():t.toFixed(o).toString(),n):y(s?t.toFixed(s).toString():t.toString(),n):t},l=Math.pow,v=Math.sqrt;var M={easeOutCubic:function(t){return 1-l(1-t,3)},linear:t=>t,easeOutExpo:function(t){return t===1?1:1-l(2,-10*t)},easeInOutExpo:function(t){return t===0?0:t===1?1:t<.5?l(2,20*t-10)/2:(2-l(2,-20*t+10))/2},easeInExpo:function(t){return t===0?0:l(2,10*t-10)},easeInOutCirc:function(t){return t<.5?(1-v(1-l(2*t,2)))/2:(v(1-l(-2*t+2,2))+1)/2}};class U{constructor(e){r(this,"from");r(this,"to");r(this,"duration");r(this,"delay");r(this,"easing");r(this,"onStart");r(this,"onUpdate");r(this,"onFinish");r(this,"startTime");r(this,"started");r(this,"finished");r(this,"timer");r(this,"time");r(this,"elapsed");r(this,"keys");const{from:n,to:s,duration:o,delay:m,easing:S,onStart:u,onUpdate:f,onFinish:h}=e;for(const d in n)s[d]===void 0&&(s[d]=n[d]);for(const d in s)n[d]===void 0&&(n[d]=s[d]);this.from=n,this.to=s,this.duration=o,this.delay=m,this.easing=S,this.onStart=u,this.onUpdate=f,this.onFinish=h,this.startTime=Date.now()+this.delay,this.started=!1,this.finished=!1,this.timer=null,this.keys={}}update(){if(this.time=Date.now(),!(this.time<this.startTime)&&!this.finished){if(this.elapsed===this.duration){this.finished||(this.finished=!0,this.onFinish&&this.onFinish(this.keys));return}this.elapsed=this.time-this.startTime,this.elapsed=this.elapsed>this.duration?this.duration:this.elapsed;for(const e in this.to)this.keys[e]=this.from[e]+(this.to[e]-this.from[e])*M[this.easing](this.elapsed/this.duration);this.started||(this.onStart&&this.onStart(this.keys),this.started=!0),this.onUpdate(this.keys)}}start(){this.startTime=Date.now()+this.delay;const e=()=>{this.update(),this.timer=requestAnimationFrame(e),this.finished&&(cancelAnimationFrame(this.timer),this.timer=null)};e()}stop(){cancelAnimationFrame(this.timer),this.timer=null}}function g(t,e,n){let s=t;return e&&(s+=`__${e}`),n&&(s+=`--${n}`),s}function q(t,e=!1){const n=e?`.devui-${t}`:`devui-${t}`;return{b:()=>g(n),e:u=>u?g(n,u):"",m:u=>u?g(n,"",u):"",em:(u,f)=>u&&f?g(n,u,f):""}}var P="",F=i.defineComponent({name:"DStatistic",props:c,setup(t,e){var u;const n=i.ref((u=t.valueFrom)!=null?u:t.value),s=i.ref(null),o=q("statistic"),m=(f=(d=>(d=t.valueFrom)!=null?d:0)(),h=typeof t.value=="number"?t.value:Number(t.value))=>{f!==h&&(s.value=new U({from:{value:f},to:{value:h},delay:0,duration:t.animationDuration,easing:"easeOutCubic",onUpdate:x=>{n.value=x.value},onFinish:()=>{n.value=h}}),s.value.start())},S=i.computed(()=>A(n.value,t.value,t.groupSeparator,t.precision));return i.onMounted(()=>{t.animation&&t.start&&m()}),i.watch(()=>t.start,f=>{f&&!s.value&&m()}),()=>{var f,h,d,x,N,O,b,T,k,w,C,D,E,I;return i.createVNode("div",{class:o.b()},[i.createVNode("div",{class:o.e("title")},[((h=(f=e.slots).title)==null?void 0:h.call(f))||t.title]),i.createVNode("div",{class:o.e("content")},[t.prefix||((x=(d=e.slots).prefix)==null?void 0:x.call(d))?i.createVNode("span",{class:o.e("prefix")},[((O=(N=e.slots).prefix)==null?void 0:O.call(N))||t.prefix]):null,i.createVNode("span",{class:o.e("value")},[S.value]),t.suffix||((T=(b=e.slots).suffix)==null?void 0:T.call(b))?i.createVNode("span",{class:o.e("suffix")},[((w=(k=e.slots).suffix)==null?void 0:w.call(k))||t.suffix]):null]),t.extra||((D=(C=e.slots).extra)==null?void 0:D.call(C))?i.createVNode("div",{class:o.e("extra")},[i.createTextVNode(" "),((I=(E=e.slots).extra)==null?void 0:I.call(E))||t.extra]):null])}}}),B={title:"Statistic \u7EDF\u8BA1\u6570\u503C",category:"\u6570\u636E\u5C55\u793A",status:"100%",install(t){t.component(F.name,F)}};a.Statistic=F,a.default=B,a.statisticProps=c,Object.defineProperty(a,"__esModule",{value:!0}),a[Symbol.toStringTag]="Module"});
|
package/statistic/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.devui-statistic{box-sizing:border-box;margin:0;padding:0;font-size:14px;line-height:1.5715;list-style:none}.devui-
|
|
1
|
+
.devui-statistic{box-sizing:border-box;margin:0;padding:0;font-size:14px;line-height:1.5715;list-style:none}.devui-statistic__title{margin-bottom:4px;font-size:14px}.devui-statistic__content{font-size:24px;display:flex;align-items:center}.devui-statistic__prefix{margin-right:6px;display:flex;align-items:center}.devui-statistic__suffix{margin-left:6px;display:flex;align-items:center}.devui-statistic__value{display:inline-block}
|
package/status/index.es.js
CHANGED
|
@@ -1,4 +1,27 @@
|
|
|
1
1
|
import { defineComponent, computed, createVNode } from "vue";
|
|
2
|
+
function createBem(namespace, element, modifier) {
|
|
3
|
+
let cls = namespace;
|
|
4
|
+
if (element) {
|
|
5
|
+
cls += `__${element}`;
|
|
6
|
+
}
|
|
7
|
+
if (modifier) {
|
|
8
|
+
cls += `--${modifier}`;
|
|
9
|
+
}
|
|
10
|
+
return cls;
|
|
11
|
+
}
|
|
12
|
+
function useNamespace(block, needDot = false) {
|
|
13
|
+
const namespace = needDot ? `.devui-${block}` : `devui-${block}`;
|
|
14
|
+
const b = () => createBem(namespace);
|
|
15
|
+
const e = (element) => element ? createBem(namespace, element) : "";
|
|
16
|
+
const m = (modifier) => modifier ? createBem(namespace, "", modifier) : "";
|
|
17
|
+
const em = (element, modifier) => element && modifier ? createBem(namespace, element, modifier) : "";
|
|
18
|
+
return {
|
|
19
|
+
b,
|
|
20
|
+
e,
|
|
21
|
+
m,
|
|
22
|
+
em
|
|
23
|
+
};
|
|
24
|
+
}
|
|
2
25
|
var status = "";
|
|
3
26
|
var Status = defineComponent({
|
|
4
27
|
name: "DStatus",
|
|
@@ -9,14 +32,15 @@ var Status = defineComponent({
|
|
|
9
32
|
}
|
|
10
33
|
},
|
|
11
34
|
setup(props, ctx) {
|
|
35
|
+
const ns = useNamespace("status");
|
|
12
36
|
const typeClass = computed(() => {
|
|
13
37
|
const {
|
|
14
38
|
type
|
|
15
39
|
} = props;
|
|
16
40
|
const typeStatus = ["success", "error", "initial", "warning", "waiting", "running", "invalid"];
|
|
17
|
-
let typeClassStr =
|
|
41
|
+
let typeClassStr = `${ns.b()} ${ns.em("bg", "invalid")}`;
|
|
18
42
|
if (typeStatus.includes(type)) {
|
|
19
|
-
typeClassStr =
|
|
43
|
+
typeClassStr = `${ns.b()} ${ns.em("bg", type)}`;
|
|
20
44
|
}
|
|
21
45
|
return typeClassStr;
|
|
22
46
|
});
|
package/status/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(t,u){typeof exports=="object"&&typeof module!="undefined"?u(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],u):(t=typeof globalThis!="undefined"?globalThis:t||self,u(t.index={},t.Vue))})(this,function(t,u){"use strict";function r(n,a,e){let i=n;return a&&(i+=`__${a}`),e&&(i+=`--${e}`),i}function f(n,a=!1){const e=a?`.devui-${n}`:`devui-${n}`;return{b:()=>r(e),e:s=>s?r(e,s):"",m:s=>s?r(e,"",s):"",em:(s,p)=>s&&p?r(e,s,p):""}}var y="",d=u.defineComponent({name:"DStatus",props:{type:{default:"invalid",type:String}},setup(n,a){const e=f("status"),i=u.computed(()=>{const{type:o}=n,c=["success","error","initial","warning","waiting","running","invalid"];let l=`${e.b()} ${e.em("bg","invalid")}`;return c.includes(o)&&(l=`${e.b()} ${e.em("bg",o)}`),l});return()=>{var o,c;return u.createVNode("span",{class:i.value},[(c=(o=a.slots).default)==null?void 0:c.call(o)])}}}),m={title:"Status \u72B6\u6001",category:"\u901A\u7528",status:"100%",install(n){n.component(d.name,d)}};t.Status=d,t.default=m,Object.defineProperty(t,"__esModule",{value:!0}),t[Symbol.toStringTag]="Module"});
|
package/status/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.devui-status{line-height:20px;height:20px;display:flex;align-items:center}.devui-status:before{display:inline-block;content:"";width:10px;height:10px;margin-right:5px;border-radius:100%}.devui-status.devui-
|
|
1
|
+
.devui-status{line-height:20px;height:20px;display:flex;align-items:center}.devui-status:before{display:inline-block;content:"";width:10px;height:10px;margin-right:5px;border-radius:100%}.devui-status.devui-status__bg--success:before{background-color:var(--devui-success, #50d4ab)}.devui-status.devui-status__bg--error:before{background-color:var(--devui-danger, #f66f6a)}.devui-status.devui-status__bg--warning:before{background-color:var(--devui-warning, #fac20a)}.devui-status.devui-status__bg--initial:before{background-color:var(--devui-initial, #e9edfa)}.devui-status.devui-status__bg--waiting:before{background-color:var(--devui-waiting, #9faad7)}.devui-status.devui-status__bg--running:before{background-color:var(--devui-info, #5e7ce0)}.devui-status.devui-status__bg--invalid:before{background-color:var(--devui-dividing-line, #f2f2f3)}
|
|
File without changes
|
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
import { defineComponent, toRefs, ref, provide, watch, computed, createVNode, resolveDynamicComponent, mergeProps, getCurrentInstance, inject, Fragment } from "vue";
|
|
2
|
+
const stepsProps = {
|
|
3
|
+
modelValue: {
|
|
4
|
+
type: Number,
|
|
5
|
+
default: 0
|
|
6
|
+
},
|
|
7
|
+
space: {
|
|
8
|
+
type: Number
|
|
9
|
+
},
|
|
10
|
+
alignCenter: {
|
|
11
|
+
type: Boolean,
|
|
12
|
+
default: false
|
|
13
|
+
},
|
|
14
|
+
direction: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: "horizontal"
|
|
17
|
+
},
|
|
18
|
+
simple: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: false
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
function createBem(namespace, element, modifier) {
|
|
24
|
+
let cls = namespace;
|
|
25
|
+
if (element) {
|
|
26
|
+
cls += `__${element}`;
|
|
27
|
+
}
|
|
28
|
+
if (modifier) {
|
|
29
|
+
cls += `--${modifier}`;
|
|
30
|
+
}
|
|
31
|
+
return cls;
|
|
32
|
+
}
|
|
33
|
+
function useNamespace(block, needDot = false) {
|
|
34
|
+
const namespace = needDot ? `.devui-${block}` : `devui-${block}`;
|
|
35
|
+
const b = () => createBem(namespace);
|
|
36
|
+
const e = (element) => element ? createBem(namespace, element) : "";
|
|
37
|
+
const m = (modifier) => modifier ? createBem(namespace, "", modifier) : "";
|
|
38
|
+
const em = (element, modifier) => element && modifier ? createBem(namespace, element, modifier) : "";
|
|
39
|
+
return {
|
|
40
|
+
b,
|
|
41
|
+
e,
|
|
42
|
+
m,
|
|
43
|
+
em
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
var steps = "";
|
|
47
|
+
const ACTIVE_STEP = "active-step";
|
|
48
|
+
const STEPS = "steps";
|
|
49
|
+
const STEPS_PROPS = "steps-props";
|
|
50
|
+
var Steps = defineComponent({
|
|
51
|
+
name: "DSteps",
|
|
52
|
+
props: stepsProps,
|
|
53
|
+
emits: ["update:modelValue"],
|
|
54
|
+
setup(props, {
|
|
55
|
+
slots
|
|
56
|
+
}) {
|
|
57
|
+
const {
|
|
58
|
+
modelValue,
|
|
59
|
+
direction,
|
|
60
|
+
simple
|
|
61
|
+
} = toRefs(props);
|
|
62
|
+
const ns = useNamespace("steps");
|
|
63
|
+
const activeStep = ref(modelValue.value);
|
|
64
|
+
provide(ACTIVE_STEP, activeStep);
|
|
65
|
+
provide(STEPS_PROPS, props);
|
|
66
|
+
const steps2 = ref([]);
|
|
67
|
+
provide(STEPS, steps2);
|
|
68
|
+
watch(modelValue, (newVal) => {
|
|
69
|
+
activeStep.value = newVal;
|
|
70
|
+
});
|
|
71
|
+
const stepsClass = computed(() => {
|
|
72
|
+
const directionClass = direction.value === "vertical" ? " vertical" : "";
|
|
73
|
+
const simpleClass = simple.value ? " simple" : "";
|
|
74
|
+
return `${ns.b()}${directionClass}${simpleClass}`;
|
|
75
|
+
});
|
|
76
|
+
return () => {
|
|
77
|
+
var _a;
|
|
78
|
+
return createVNode("div", {
|
|
79
|
+
"class": stepsClass.value
|
|
80
|
+
}, [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
const stepProps = {
|
|
85
|
+
title: {
|
|
86
|
+
type: String,
|
|
87
|
+
required: true
|
|
88
|
+
},
|
|
89
|
+
description: {
|
|
90
|
+
type: String
|
|
91
|
+
},
|
|
92
|
+
icon: {
|
|
93
|
+
type: String
|
|
94
|
+
},
|
|
95
|
+
status: {
|
|
96
|
+
type: String
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
const DEFAULT_PREFIX = "icon";
|
|
100
|
+
const iconProps = {
|
|
101
|
+
name: {
|
|
102
|
+
type: String,
|
|
103
|
+
default: "",
|
|
104
|
+
required: true
|
|
105
|
+
},
|
|
106
|
+
size: {
|
|
107
|
+
type: [Number, String],
|
|
108
|
+
default: "inherit"
|
|
109
|
+
},
|
|
110
|
+
color: {
|
|
111
|
+
type: String,
|
|
112
|
+
default: "inherit"
|
|
113
|
+
},
|
|
114
|
+
component: {
|
|
115
|
+
type: Object,
|
|
116
|
+
default: null
|
|
117
|
+
},
|
|
118
|
+
classPrefix: {
|
|
119
|
+
type: String,
|
|
120
|
+
default: DEFAULT_PREFIX
|
|
121
|
+
},
|
|
122
|
+
operable: {
|
|
123
|
+
type: Boolean,
|
|
124
|
+
default: false
|
|
125
|
+
},
|
|
126
|
+
disabled: {
|
|
127
|
+
type: Boolean,
|
|
128
|
+
default: false
|
|
129
|
+
},
|
|
130
|
+
rotate: {
|
|
131
|
+
type: [Number, String]
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
const svgIconProps = {
|
|
135
|
+
name: {
|
|
136
|
+
type: String,
|
|
137
|
+
default: "",
|
|
138
|
+
required: true
|
|
139
|
+
},
|
|
140
|
+
color: {
|
|
141
|
+
type: String,
|
|
142
|
+
default: "inherit"
|
|
143
|
+
},
|
|
144
|
+
size: {
|
|
145
|
+
type: [Number, String],
|
|
146
|
+
default: "inherit"
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
var icon = "";
|
|
150
|
+
var svgIcon = defineComponent({
|
|
151
|
+
name: "DSvgIcon",
|
|
152
|
+
props: svgIconProps,
|
|
153
|
+
setup(props) {
|
|
154
|
+
const {
|
|
155
|
+
name,
|
|
156
|
+
color,
|
|
157
|
+
size
|
|
158
|
+
} = toRefs(props);
|
|
159
|
+
const ns = useNamespace("svg-icon");
|
|
160
|
+
const iconName = computed(() => `#icon-${name.value}`);
|
|
161
|
+
const iconSize = computed(() => {
|
|
162
|
+
return typeof size.value === "number" ? `${size.value}px` : size.value;
|
|
163
|
+
});
|
|
164
|
+
const styles = {
|
|
165
|
+
width: iconSize.value,
|
|
166
|
+
height: iconSize.value
|
|
167
|
+
};
|
|
168
|
+
return () => {
|
|
169
|
+
return createVNode("svg", {
|
|
170
|
+
"class": ns.b(),
|
|
171
|
+
"style": styles
|
|
172
|
+
}, [createVNode("use", {
|
|
173
|
+
"xlink:href": iconName.value,
|
|
174
|
+
"fill": color.value
|
|
175
|
+
}, null)]);
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
function isUrl(value) {
|
|
180
|
+
return /^((http|https):)?\/\//.test(value);
|
|
181
|
+
}
|
|
182
|
+
function useIconDom(props, ctx) {
|
|
183
|
+
const {
|
|
184
|
+
component,
|
|
185
|
+
name,
|
|
186
|
+
size,
|
|
187
|
+
color,
|
|
188
|
+
classPrefix,
|
|
189
|
+
rotate
|
|
190
|
+
} = toRefs(props);
|
|
191
|
+
const ns = useNamespace("icon");
|
|
192
|
+
const iconSize = computed(() => {
|
|
193
|
+
return typeof size.value === "number" ? `${size.value}px` : size.value;
|
|
194
|
+
});
|
|
195
|
+
const IconComponent = component.value ? resolveDynamicComponent(component.value) : resolveDynamicComponent(svgIcon);
|
|
196
|
+
const imgIconDom = () => {
|
|
197
|
+
return createVNode("img", mergeProps({
|
|
198
|
+
"src": name.value,
|
|
199
|
+
"alt": name.value.split("/")[name.value.split("/").length - 1],
|
|
200
|
+
"class": [(rotate == null ? void 0 : rotate.value) === "infinite" && ns.m("spin")],
|
|
201
|
+
"style": {
|
|
202
|
+
width: iconSize.value || "",
|
|
203
|
+
transform: `rotate(${rotate == null ? void 0 : rotate.value}deg)`
|
|
204
|
+
}
|
|
205
|
+
}, ctx.attrs), null);
|
|
206
|
+
};
|
|
207
|
+
const svgIconDom = () => {
|
|
208
|
+
return createVNode(IconComponent, mergeProps({
|
|
209
|
+
"name": name.value,
|
|
210
|
+
"color": color.value,
|
|
211
|
+
"size": iconSize.value,
|
|
212
|
+
"class": [(rotate == null ? void 0 : rotate.value) === "infinite" && ns.m("spin")],
|
|
213
|
+
"style": {
|
|
214
|
+
transform: `rotate(${rotate == null ? void 0 : rotate.value}deg)`
|
|
215
|
+
}
|
|
216
|
+
}, ctx.attrs), null);
|
|
217
|
+
};
|
|
218
|
+
const fontIconDom = () => {
|
|
219
|
+
const fontIconClass = /^icon-/.test(name.value) ? name.value : `${classPrefix.value}-${name.value}`;
|
|
220
|
+
return createVNode("i", mergeProps({
|
|
221
|
+
"class": [classPrefix.value, fontIconClass, (rotate == null ? void 0 : rotate.value) === "infinite" && ns.m("spin")],
|
|
222
|
+
"style": {
|
|
223
|
+
fontSize: iconSize.value,
|
|
224
|
+
color: color.value,
|
|
225
|
+
transform: `rotate(${rotate == null ? void 0 : rotate.value}deg)`
|
|
226
|
+
}
|
|
227
|
+
}, ctx.attrs), null);
|
|
228
|
+
};
|
|
229
|
+
const iconDom = () => {
|
|
230
|
+
return component.value ? svgIconDom() : isUrl(name.value) ? imgIconDom() : fontIconDom();
|
|
231
|
+
};
|
|
232
|
+
return {
|
|
233
|
+
iconDom
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
var Icon = defineComponent({
|
|
237
|
+
name: "DIcon",
|
|
238
|
+
props: iconProps,
|
|
239
|
+
emits: ["click"],
|
|
240
|
+
setup(props, ctx) {
|
|
241
|
+
const {
|
|
242
|
+
disabled,
|
|
243
|
+
operable
|
|
244
|
+
} = toRefs(props);
|
|
245
|
+
const {
|
|
246
|
+
iconDom
|
|
247
|
+
} = useIconDom(props, ctx);
|
|
248
|
+
const ns = useNamespace("icon");
|
|
249
|
+
const wrapClassed = computed(() => ({
|
|
250
|
+
[ns.e("container")]: true,
|
|
251
|
+
[ns.m("disabled")]: disabled.value,
|
|
252
|
+
[ns.m("operable")]: operable.value
|
|
253
|
+
}));
|
|
254
|
+
const onClick = (e) => {
|
|
255
|
+
if (disabled.value) {
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
258
|
+
ctx.emit("click", e);
|
|
259
|
+
};
|
|
260
|
+
return () => {
|
|
261
|
+
var _a, _b, _c, _d;
|
|
262
|
+
return createVNode("div", {
|
|
263
|
+
"class": wrapClassed.value,
|
|
264
|
+
"onClick": onClick
|
|
265
|
+
}, [(_b = (_a = ctx.slots).prefix) == null ? void 0 : _b.call(_a), iconDom(), (_d = (_c = ctx.slots).suffix) == null ? void 0 : _d.call(_c)]);
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
});
|
|
269
|
+
var iconGroup = "";
|
|
270
|
+
defineComponent({
|
|
271
|
+
name: "DIconGroup",
|
|
272
|
+
setup(_, ctx) {
|
|
273
|
+
const ns = useNamespace("icon-group");
|
|
274
|
+
return () => {
|
|
275
|
+
var _a, _b;
|
|
276
|
+
return createVNode("div", {
|
|
277
|
+
"class": ns.b()
|
|
278
|
+
}, [(_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)]);
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
});
|
|
282
|
+
var step = "";
|
|
283
|
+
var Step = defineComponent({
|
|
284
|
+
name: "DStep",
|
|
285
|
+
props: stepProps,
|
|
286
|
+
setup(props, {
|
|
287
|
+
slots
|
|
288
|
+
}) {
|
|
289
|
+
const {
|
|
290
|
+
title,
|
|
291
|
+
description,
|
|
292
|
+
icon: icon2,
|
|
293
|
+
status
|
|
294
|
+
} = toRefs(props);
|
|
295
|
+
const ns = useNamespace("step");
|
|
296
|
+
const instance = getCurrentInstance();
|
|
297
|
+
const activeStep = inject(ACTIVE_STEP);
|
|
298
|
+
const steps2 = inject(STEPS);
|
|
299
|
+
steps2.value.push(instance);
|
|
300
|
+
const stepsProps2 = inject(STEPS_PROPS);
|
|
301
|
+
const currentStepIndex = steps2.value.indexOf(instance);
|
|
302
|
+
const stepClass = computed(() => {
|
|
303
|
+
const activeClass = activeStep.value === currentStepIndex ? " active" : "";
|
|
304
|
+
const finishedClass = activeStep.value > currentStepIndex ? " finished" : "";
|
|
305
|
+
const centerClass = stepsProps2.alignCenter ? " center" : "";
|
|
306
|
+
const statusClass = (status == null ? void 0 : status.value) ? ` ${status == null ? void 0 : status.value}` : "";
|
|
307
|
+
const simpleClass = stepsProps2.simple ? ` ${ns.m("simple")}` : "";
|
|
308
|
+
return `${ns.b()}${activeClass}${finishedClass}${centerClass}${statusClass}${simpleClass}`;
|
|
309
|
+
});
|
|
310
|
+
const stepStyle = computed(() => {
|
|
311
|
+
const styleObj = {};
|
|
312
|
+
if (stepsProps2.space) {
|
|
313
|
+
styleObj.width = `${stepsProps2.space}px`;
|
|
314
|
+
} else {
|
|
315
|
+
styleObj.flexBasis = stepsProps2.alignCenter || stepsProps2.simple ? `${100 / steps2.value.length}%` : `${100 / (steps2.value.length - 1)}%`;
|
|
316
|
+
}
|
|
317
|
+
return styleObj;
|
|
318
|
+
});
|
|
319
|
+
const iconColor = computed(() => {
|
|
320
|
+
const isActive = activeStep.value === currentStepIndex;
|
|
321
|
+
const isFinished = activeStep.value > currentStepIndex;
|
|
322
|
+
return isActive ? "var(--devui-brand)" : isFinished ? "var(--devui-success)" : "var(--devui-placeholder)";
|
|
323
|
+
});
|
|
324
|
+
const statusMap = {
|
|
325
|
+
finish: createVNode(Icon, {
|
|
326
|
+
"name": "right-o",
|
|
327
|
+
"color": "var(--devui-success)",
|
|
328
|
+
"size": "24px"
|
|
329
|
+
}, null),
|
|
330
|
+
success: createVNode(Icon, {
|
|
331
|
+
"name": "right-o",
|
|
332
|
+
"color": "var(--devui-success)",
|
|
333
|
+
"size": "24px"
|
|
334
|
+
}, null),
|
|
335
|
+
error: createVNode(Icon, {
|
|
336
|
+
"name": "error-o",
|
|
337
|
+
"color": "var(--devui-danger)",
|
|
338
|
+
"size": "24px"
|
|
339
|
+
}, null)
|
|
340
|
+
};
|
|
341
|
+
const renderDot = () => {
|
|
342
|
+
var _a;
|
|
343
|
+
return slots.icon ? (_a = slots.icon) == null ? void 0 : _a.call(slots, iconColor.value) : icon2.value ? createVNode(Icon, {
|
|
344
|
+
"name": icon2.value,
|
|
345
|
+
"color": iconColor.value,
|
|
346
|
+
"size": "24px"
|
|
347
|
+
}, null) : status.value && statusMap[status.value] ? statusMap[status.value] : activeStep.value > steps2.value.indexOf(instance) ? createVNode(Icon, {
|
|
348
|
+
"name": "right-o",
|
|
349
|
+
"color": "var(--devui-success)",
|
|
350
|
+
"size": "24px"
|
|
351
|
+
}, null) : createVNode("span", {
|
|
352
|
+
"class": ns.e("dot")
|
|
353
|
+
}, [currentStepIndex + 1]);
|
|
354
|
+
};
|
|
355
|
+
return () => {
|
|
356
|
+
return createVNode(Fragment, null, [stepsProps2.simple ? createVNode("div", {
|
|
357
|
+
"class": stepClass.value,
|
|
358
|
+
"style": stepStyle.value
|
|
359
|
+
}, [title.value]) : createVNode("div", {
|
|
360
|
+
"class": stepClass.value,
|
|
361
|
+
"style": stepStyle.value
|
|
362
|
+
}, [createVNode("div", {
|
|
363
|
+
"class": ns.e("dot-container")
|
|
364
|
+
}, [renderDot(), createVNode("div", {
|
|
365
|
+
"class": ns.e("line")
|
|
366
|
+
}, null)]), createVNode("div", {
|
|
367
|
+
"class": ns.e("content")
|
|
368
|
+
}, [createVNode("span", {
|
|
369
|
+
"class": ns.e("title")
|
|
370
|
+
}, [title.value]), description.value && createVNode("span", {
|
|
371
|
+
"class": ns.e("description")
|
|
372
|
+
}, [description.value])])])]);
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
});
|
|
376
|
+
var index = {
|
|
377
|
+
title: "Steps \u6B65\u9AA4\u6761",
|
|
378
|
+
category: "\u6570\u636E\u5C55\u793A",
|
|
379
|
+
status: "100%",
|
|
380
|
+
install(app) {
|
|
381
|
+
app.component(Steps.name, Steps);
|
|
382
|
+
app.component(Step.name, Step);
|
|
383
|
+
}
|
|
384
|
+
};
|
|
385
|
+
export { Step, Steps, index as default, stepProps, stepsProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(d,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(d=typeof globalThis!="undefined"?globalThis:d||self,e(d.index={},d.Vue))})(this,function(d,e){"use strict";const P={modelValue:{type:Number,default:0},space:{type:Number},alignCenter:{type:Boolean,default:!1},direction:{type:String,default:"horizontal"},simple:{type:Boolean,default:!1}};function y(a,s,o){let n=a;return s&&(n+=`__${s}`),o&&(n+=`--${o}`),n}function v(a,s=!1){const o=s?`.devui-${a}`:`devui-${a}`;return{b:()=>y(o),e:t=>t?y(o,t):"",m:t=>t?y(o,"",t):"",em:(t,r)=>t&&r?y(o,t,r):""}}var k="";const D="active-step",I="steps",z="steps-props";var C=e.defineComponent({name:"DSteps",props:P,emits:["update:modelValue"],setup(a,{slots:s}){const{modelValue:o,direction:n,simple:u}=e.toRefs(a),l=v("steps"),c=e.ref(o.value);e.provide(D,c),e.provide(z,a);const t=e.ref([]);e.provide(I,t),e.watch(o,i=>{c.value=i});const r=e.computed(()=>{const i=n.value==="vertical"?" vertical":"",p=u.value?" simple":"";return`${l.b()}${i}${p}`});return()=>{var i;return e.createVNode("div",{class:r.value},[(i=s.default)==null?void 0:i.call(s)])}}});const x={title:{type:String,required:!0},description:{type:String},icon:{type:String},status:{type:String}},E={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]}},T={name:{type:String,default:"",required:!0},color:{type:String,default:"inherit"},size:{type:[Number,String],default:"inherit"}};var M="",_=e.defineComponent({name:"DSvgIcon",props:T,setup(a){const{name:s,color:o,size:n}=e.toRefs(a),u=v("svg-icon"),l=e.computed(()=>`#icon-${s.value}`),c=e.computed(()=>typeof n.value=="number"?`${n.value}px`:n.value),t={width:c.value,height:c.value};return()=>e.createVNode("svg",{class:u.b(),style:t},[e.createVNode("use",{"xlink:href":l.value,fill:o.value},null)])}});function R(a){return/^((http|https):)?\/\//.test(a)}function j(a,s){const{component:o,name:n,size:u,color:l,classPrefix:c,rotate:t}=e.toRefs(a),r=v("icon"),i=e.computed(()=>typeof u.value=="number"?`${u.value}px`:u.value),p=o.value?e.resolveDynamicComponent(o.value):e.resolveDynamicComponent(_),m=()=>e.createVNode("img",e.mergeProps({src:n.value,alt:n.value.split("/")[n.value.split("/").length-1],class:[(t==null?void 0:t.value)==="infinite"&&r.m("spin")],style:{width:i.value||"",transform:`rotate(${t==null?void 0:t.value}deg)`}},s.attrs),null),S=()=>e.createVNode(p,e.mergeProps({name:n.value,color:l.value,size:i.value,class:[(t==null?void 0:t.value)==="infinite"&&r.m("spin")],style:{transform:`rotate(${t==null?void 0:t.value}deg)`}},s.attrs),null),h=()=>{const N=/^icon-/.test(n.value)?n.value:`${c.value}-${n.value}`;return e.createVNode("i",e.mergeProps({class:[c.value,N,(t==null?void 0:t.value)==="infinite"&&r.m("spin")],style:{fontSize:i.value,color:l.value,transform:`rotate(${t==null?void 0:t.value}deg)`}},s.attrs),null)};return{iconDom:()=>o.value?S():R(n.value)?m():h()}}var g=e.defineComponent({name:"DIcon",props:E,emits:["click"],setup(a,s){const{disabled:o,operable:n}=e.toRefs(a),{iconDom:u}=j(a,s),l=v("icon"),c=e.computed(()=>({[l.e("container")]:!0,[l.m("disabled")]:o.value,[l.m("operable")]:n.value})),t=r=>{o.value||s.emit("click",r)};return()=>{var r,i,p,m;return e.createVNode("div",{class:c.value,onClick:t},[(i=(r=s.slots).prefix)==null?void 0:i.call(r),u(),(m=(p=s.slots).suffix)==null?void 0:m.call(p)])}}}),U="";e.defineComponent({name:"DIconGroup",setup(a,s){const o=v("icon-group");return()=>{var n,u;return e.createVNode("div",{class:o.b()},[(u=(n=s.slots).default)==null?void 0:u.call(n)])}}});var G="",V=e.defineComponent({name:"DStep",props:x,setup(a,{slots:s}){const{title:o,description:n,icon:u,status:l}=e.toRefs(a),c=v("step"),t=e.getCurrentInstance(),r=e.inject(D),i=e.inject(I);i.value.push(t);const p=e.inject(z),m=i.value.indexOf(t),S=e.computed(()=>{const f=r.value===m?" active":"",b=r.value>m?" finished":"",F=p.alignCenter?" center":"",O=(l==null?void 0:l.value)?` ${l==null?void 0:l.value}`:"",w=p.simple?` ${c.m("simple")}`:"";return`${c.b()}${f}${b}${F}${O}${w}`}),h=e.computed(()=>{const f={};return p.space?f.width=`${p.space}px`:f.flexBasis=p.alignCenter||p.simple?`${100/i.value.length}%`:`${100/(i.value.length-1)}%`,f}),$=e.computed(()=>{const f=r.value===m,b=r.value>m;return f?"var(--devui-brand)":b?"var(--devui-success)":"var(--devui-placeholder)"}),N={finish:e.createVNode(g,{name:"right-o",color:"var(--devui-success)",size:"24px"},null),success:e.createVNode(g,{name:"right-o",color:"var(--devui-success)",size:"24px"},null),error:e.createVNode(g,{name:"error-o",color:"var(--devui-danger)",size:"24px"},null)},B=()=>{var f;return s.icon?(f=s.icon)==null?void 0:f.call(s,$.value):u.value?e.createVNode(g,{name:u.value,color:$.value,size:"24px"},null):l.value&&N[l.value]?N[l.value]:r.value>i.value.indexOf(t)?e.createVNode(g,{name:"right-o",color:"var(--devui-success)",size:"24px"},null):e.createVNode("span",{class:c.e("dot")},[m+1])};return()=>e.createVNode(e.Fragment,null,[p.simple?e.createVNode("div",{class:S.value,style:h.value},[o.value]):e.createVNode("div",{class:S.value,style:h.value},[e.createVNode("div",{class:c.e("dot-container")},[B(),e.createVNode("div",{class:c.e("line")},null)]),e.createVNode("div",{class:c.e("content")},[e.createVNode("span",{class:c.e("title")},[o.value]),n.value&&e.createVNode("span",{class:c.e("description")},[n.value])])])])}}),A={title:"Steps \u6B65\u9AA4\u6761",category:"\u6570\u636E\u5C55\u793A",status:"100%",install(a){a.component(C.name,C),a.component(V.name,V)}};d.Step=V,d.Steps=C,d.default=A,d.stepProps=x,d.stepsProps=P,Object.defineProperty(d,"__esModule",{value:!0}),d[Symbol.toStringTag]="Module"});
|