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
package/rate/index.es.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { defineComponent,
|
|
1
|
+
import { defineComponent, ref, watch, onMounted, createVNode, resolveComponent } from "vue";
|
|
2
2
|
const rateProps = {
|
|
3
3
|
modelValue: {
|
|
4
|
-
type: Number
|
|
4
|
+
type: Number,
|
|
5
|
+
default: 0
|
|
5
6
|
},
|
|
6
7
|
read: {
|
|
7
8
|
type: Boolean,
|
|
@@ -40,69 +41,92 @@ const rateProps = {
|
|
|
40
41
|
default: void 0
|
|
41
42
|
}
|
|
42
43
|
};
|
|
44
|
+
function createBem(namespace, element, modifier) {
|
|
45
|
+
let cls = namespace;
|
|
46
|
+
if (element) {
|
|
47
|
+
cls += `__${element}`;
|
|
48
|
+
}
|
|
49
|
+
if (modifier) {
|
|
50
|
+
cls += `--${modifier}`;
|
|
51
|
+
}
|
|
52
|
+
return cls;
|
|
53
|
+
}
|
|
54
|
+
function useNamespace(block, needDot = false) {
|
|
55
|
+
const namespace = needDot ? `.devui-${block}` : `devui-${block}`;
|
|
56
|
+
const b = () => createBem(namespace);
|
|
57
|
+
const e = (element) => element ? createBem(namespace, element) : "";
|
|
58
|
+
const m = (modifier) => modifier ? createBem(namespace, "", modifier) : "";
|
|
59
|
+
const em = (element, modifier) => element && modifier ? createBem(namespace, element, modifier) : "";
|
|
60
|
+
return {
|
|
61
|
+
b,
|
|
62
|
+
e,
|
|
63
|
+
m,
|
|
64
|
+
em
|
|
65
|
+
};
|
|
66
|
+
}
|
|
43
67
|
var rate = "";
|
|
44
68
|
var Rate = defineComponent({
|
|
45
69
|
name: "DRate",
|
|
46
70
|
props: rateProps,
|
|
47
71
|
emits: ["change", "update:modelValue"],
|
|
48
72
|
setup(props, ctx) {
|
|
49
|
-
const totalLevelArray =
|
|
73
|
+
const totalLevelArray = ref([]);
|
|
50
74
|
const chooseValue = ref(0);
|
|
51
75
|
const setChange = (start, end, width) => {
|
|
52
76
|
for (let i = start; i < end; i++) {
|
|
53
|
-
totalLevelArray[i]["width"] = width;
|
|
77
|
+
totalLevelArray.value[i]["width"] = width;
|
|
54
78
|
}
|
|
55
79
|
};
|
|
56
80
|
const initRating = () => {
|
|
57
|
-
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
chooseValue.value = props.modelValue - 1;
|
|
81
|
+
chooseValue.value = props.modelValue;
|
|
61
82
|
const halfStar = chooseValue.value % 1;
|
|
62
83
|
const intCurrentLevel = Math.floor(chooseValue.value);
|
|
63
|
-
setChange(0, intCurrentLevel
|
|
84
|
+
setChange(0, intCurrentLevel, "100%");
|
|
64
85
|
if (halfStar > 0) {
|
|
65
|
-
totalLevelArray[intCurrentLevel
|
|
66
|
-
setChange(intCurrentLevel + 2, props.count, "0");
|
|
67
|
-
} else {
|
|
86
|
+
totalLevelArray.value[intCurrentLevel]["width"] = halfStar * 100 + "%";
|
|
68
87
|
setChange(intCurrentLevel + 1, props.count, "0");
|
|
88
|
+
} else {
|
|
89
|
+
setChange(intCurrentLevel, props.count, "0");
|
|
69
90
|
}
|
|
70
91
|
};
|
|
71
|
-
|
|
92
|
+
const initLevelArray = () => {
|
|
93
|
+
totalLevelArray.value = [];
|
|
72
94
|
for (let i = 0; i < props.count; i++) {
|
|
73
|
-
totalLevelArray.push({
|
|
95
|
+
totalLevelArray.value.push({
|
|
74
96
|
width: "0"
|
|
75
97
|
});
|
|
76
98
|
}
|
|
99
|
+
};
|
|
100
|
+
watch([() => props.modelValue, () => props.count], () => {
|
|
101
|
+
initLevelArray();
|
|
77
102
|
initRating();
|
|
78
103
|
});
|
|
79
|
-
|
|
104
|
+
onMounted(() => {
|
|
105
|
+
initLevelArray();
|
|
106
|
+
initRating();
|
|
107
|
+
});
|
|
108
|
+
const isSemiSelected = (e) => {
|
|
109
|
+
const target = e.target;
|
|
110
|
+
return props.allowHalf && e.offsetX * 2 <= target.clientWidth;
|
|
111
|
+
};
|
|
112
|
+
const hoverToggle = (e, index2) => {
|
|
80
113
|
if (props.read) {
|
|
81
114
|
return;
|
|
82
115
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
} else {
|
|
91
|
-
setChange(0, index2 + 1, "100%");
|
|
92
|
-
if (props.allowHalf && e.offsetX * 2 <= e.target.clientWidth) {
|
|
93
|
-
setChange(index2, index2 + 1, "50%");
|
|
94
|
-
} else {
|
|
95
|
-
setChange(index2, index2 + 1, "100%");
|
|
96
|
-
}
|
|
97
|
-
setChange(index2 + 1, props.count, "0");
|
|
98
|
-
}
|
|
116
|
+
setChange(0, index2 + 1, "100%");
|
|
117
|
+
const width = isSemiSelected(e) ? "50%" : "100%";
|
|
118
|
+
setChange(index2, index2 + 1, width);
|
|
119
|
+
setChange(index2 + 1, props.count, "0");
|
|
120
|
+
};
|
|
121
|
+
const onMouseleave = () => {
|
|
122
|
+
initRating();
|
|
99
123
|
};
|
|
100
124
|
const selectValue = (e, index2) => {
|
|
101
125
|
if (props.read) {
|
|
102
126
|
return;
|
|
103
127
|
}
|
|
104
128
|
setChange(0, index2, "100%");
|
|
105
|
-
if (
|
|
129
|
+
if (isSemiSelected(e)) {
|
|
106
130
|
setChange(index2, index2 + 1, "50%");
|
|
107
131
|
chooseValue.value = index2 - 0.5;
|
|
108
132
|
} else {
|
|
@@ -110,46 +134,48 @@ var Rate = defineComponent({
|
|
|
110
134
|
chooseValue.value = index2;
|
|
111
135
|
}
|
|
112
136
|
setChange(index2 + 1, props.count, "0");
|
|
113
|
-
|
|
114
|
-
props.onChange && props.onChange(index2 + 1);
|
|
137
|
+
props.onChange && props.onChange(chooseValue.value + 1);
|
|
115
138
|
props.onTouched && props.onTouched();
|
|
116
|
-
ctx.emit("update:modelValue",
|
|
139
|
+
ctx.emit("update:modelValue", chooseValue.value + 1);
|
|
117
140
|
};
|
|
118
141
|
return {
|
|
119
142
|
totalLevelArray,
|
|
120
143
|
chooseValue,
|
|
121
144
|
hoverToggle,
|
|
122
|
-
selectValue
|
|
145
|
+
selectValue,
|
|
146
|
+
onMouseleave
|
|
123
147
|
};
|
|
124
148
|
},
|
|
125
149
|
render() {
|
|
126
150
|
const {
|
|
127
151
|
totalLevelArray,
|
|
128
|
-
chooseValue,
|
|
129
152
|
icon,
|
|
130
153
|
character,
|
|
131
154
|
read,
|
|
132
155
|
type,
|
|
133
156
|
color,
|
|
134
157
|
hoverToggle,
|
|
135
|
-
selectValue
|
|
158
|
+
selectValue,
|
|
159
|
+
onMouseleave
|
|
136
160
|
} = this;
|
|
161
|
+
const ns = useNamespace("rate");
|
|
137
162
|
return createVNode("div", {
|
|
138
|
-
"class":
|
|
139
|
-
"onMouseleave":
|
|
163
|
+
"class": ns.b(),
|
|
164
|
+
"onMouseleave": onMouseleave,
|
|
165
|
+
"style": `--star-color: ${color}`
|
|
140
166
|
}, [totalLevelArray.map((item, index2) => createVNode("div", {
|
|
141
|
-
"class":
|
|
167
|
+
"class": [ns.m("align"), ns.m("pointer"), read ? ns.m("only-read") : ""],
|
|
142
168
|
"key": index2,
|
|
143
169
|
"onMouseover": (e) => hoverToggle(e, index2),
|
|
144
170
|
"onClick": (e) => selectValue(e, index2)
|
|
145
171
|
}, [icon && !character && createVNode("span", {
|
|
146
|
-
"class": "
|
|
172
|
+
"class": ns.e("color")
|
|
147
173
|
}, [createVNode(resolveComponent("d-icon"), {
|
|
148
174
|
"name": icon
|
|
149
175
|
}, null)]), character && !icon && createVNode("span", {
|
|
150
|
-
"class": "
|
|
176
|
+
"class": ns.e("color")
|
|
151
177
|
}, [character]), !icon && !character && createVNode("span", {
|
|
152
|
-
"class": "
|
|
178
|
+
"class": ns.e("color")
|
|
153
179
|
}, [createVNode("svg", {
|
|
154
180
|
"width": "16px",
|
|
155
181
|
"height": "16px",
|
|
@@ -166,9 +192,9 @@ var Rate = defineComponent({
|
|
|
166
192
|
"fill": "#E3E5E9",
|
|
167
193
|
"id": "Mask"
|
|
168
194
|
}, [createVNode("polygon", {
|
|
169
|
-
"points": "8 12.7603585 3.67376208 14.3147912 3.81523437 9.71994835
|
|
195
|
+
"points": "8 12.7603585 3.67376208 14.3147912 3.81523437 9.71994835 1 6.0857977 5.41367261 4.80046131 8 1 10.5863274 4.80046131 15 6.0857977 12.1847656 9.71994835 12.3262379 14.3147912"
|
|
170
196
|
}, null)])])])]), icon && !character && createVNode("span", {
|
|
171
|
-
"class":
|
|
197
|
+
"class": [ns.e("color-active"), ns.e("active-star"), ns.em("color", type)],
|
|
172
198
|
"style": {
|
|
173
199
|
width: item.width
|
|
174
200
|
}
|
|
@@ -176,15 +202,14 @@ var Rate = defineComponent({
|
|
|
176
202
|
"name": icon,
|
|
177
203
|
"color": color
|
|
178
204
|
}, null)]), character && !icon && createVNode("span", {
|
|
179
|
-
"class":
|
|
205
|
+
"class": [ns.e("color-active"), ns.e("active-star"), ns.em("color", type)],
|
|
180
206
|
"style": {
|
|
181
207
|
color,
|
|
182
208
|
width: item.width
|
|
183
209
|
}
|
|
184
210
|
}, [character]), !character && !icon && createVNode("span", {
|
|
185
|
-
"class":
|
|
211
|
+
"class": [ns.e("color-active"), ns.e("active-star"), !color ? ns.em("color", type) : ns.em("color", "customize")],
|
|
186
212
|
"style": {
|
|
187
|
-
color,
|
|
188
213
|
width: item.width
|
|
189
214
|
}
|
|
190
215
|
}, [createVNode("svg", {
|
|
@@ -202,19 +227,16 @@ var Rate = defineComponent({
|
|
|
202
227
|
}, [createVNode("g", {
|
|
203
228
|
"id": "Mask"
|
|
204
229
|
}, [createVNode("polygon", {
|
|
205
|
-
"points": "8 12.7603585 3.67376208 14.3147912 3.81523437 9.71994835 1
|
|
230
|
+
"points": "8 12.7603585 3.67376208 14.3147912 3.81523437 9.71994835 1 6.0857977 5.41367261 4.80046131 8 1 10.5863274 4.80046131 15 6.0857977 12.1847656 9.71994835 12.3262379 14.3147912"
|
|
206
231
|
}, null)])])])])]))]);
|
|
207
232
|
}
|
|
208
233
|
});
|
|
209
|
-
Rate.install = function(app) {
|
|
210
|
-
app.component(Rate.name, Rate);
|
|
211
|
-
};
|
|
212
234
|
var index = {
|
|
213
235
|
title: "Rate \u8BC4\u5206",
|
|
214
236
|
category: "\u6570\u636E\u5C55\u793A",
|
|
215
237
|
status: "100%",
|
|
216
238
|
install(app) {
|
|
217
|
-
app.
|
|
239
|
+
app.component(Rate.name, Rate);
|
|
218
240
|
}
|
|
219
241
|
};
|
|
220
|
-
export { Rate, index as default };
|
|
242
|
+
export { Rate, index as default, rateProps };
|
package/rate/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
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 V={modelValue:{type:Number,default:0},read:{type:Boolean,default:!1},count:{type:Number,default:5},type:{type:String,default:""},color:{type:String,default:""},icon:{type:String,default:""},character:{type:String,default:""},allowHalf:{type:Boolean,default:!1},onChange:{type:Function,default:void 0},onTouched:{type:Function,default:void 0}};function g(o,c,a){let r=o;return c&&(r+=`__${c}`),a&&(r+=`--${a}`),r}function p(o,c=!1){const a=c?`.devui-${o}`:`devui-${o}`;return{b:()=>g(a),e:i=>i?g(a,i):"",m:i=>i?g(a,"",i):"",em:(i,h)=>i&&h?g(a,i,h):""}}var k="",m=e.defineComponent({name:"DRate",props:V,emits:["change","update:modelValue"],setup(o,c){const a=e.ref([]),r=e.ref(0),s=(n,t,v)=>{for(let y=n;y<t;y++)a.value[y].width=v},u=()=>{r.value=o.modelValue;const n=r.value%1,t=Math.floor(r.value);s(0,t,"100%"),n>0?(a.value[t].width=n*100+"%",s(t+1,o.count,"0")):s(t,o.count,"0")},f=()=>{a.value=[];for(let n=0;n<o.count;n++)a.value.push({width:"0"})};e.watch([()=>o.modelValue,()=>o.count],()=>{f(),u()}),e.onMounted(()=>{f(),u()});const i=n=>{const t=n.target;return o.allowHalf&&n.offsetX*2<=t.clientWidth};return{totalLevelArray:a,chooseValue:r,hoverToggle:(n,t)=>{if(o.read)return;s(0,t+1,"100%");const v=i(n)?"50%":"100%";s(t,t+1,v),s(t+1,o.count,"0")},selectValue:(n,t)=>{o.read||(s(0,t,"100%"),i(n)?(s(t,t+1,"50%"),r.value=t-.5):(s(t,t+1,"100%"),r.value=t),s(t+1,o.count,"0"),o.onChange&&o.onChange(r.value+1),o.onTouched&&o.onTouched(),c.emit("update:modelValue",r.value+1))},onMouseleave:()=>{u()}}},render(){const{totalLevelArray:o,icon:c,character:a,read:r,type:s,color:u,hoverToggle:f,selectValue:i,onMouseleave:h}=this,l=p("rate");return e.createVNode("div",{class:l.b(),onMouseleave:h,style:`--star-color: ${u}`},[o.map((w,n)=>e.createVNode("div",{class:[l.m("align"),l.m("pointer"),r?l.m("only-read"):""],key:n,onMouseover:t=>f(t,n),onClick:t=>i(t,n)},[c&&!a&&e.createVNode("span",{class:l.e("color")},[e.createVNode(e.resolveComponent("d-icon"),{name:c},null)]),a&&!c&&e.createVNode("span",{class:l.e("color")},[a]),!c&&!a&&e.createVNode("span",{class:l.e("color")},[e.createVNode("svg",{width:"16px",height:"16px",viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns-xlink":"http://www.w3.org/1999/xlink"},[e.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("g",{fill:"#E3E5E9",id:"Mask"},[e.createVNode("polygon",{points:"8 12.7603585 3.67376208 14.3147912 3.81523437 9.71994835 1 6.0857977 5.41367261 4.80046131 8 1 10.5863274 4.80046131 15 6.0857977 12.1847656 9.71994835 12.3262379 14.3147912"},null)])])])]),c&&!a&&e.createVNode("span",{class:[l.e("color-active"),l.e("active-star"),l.em("color",s)],style:{width:w.width}},[e.createVNode(e.resolveComponent("d-icon"),{name:c,color:u},null)]),a&&!c&&e.createVNode("span",{class:[l.e("color-active"),l.e("active-star"),l.em("color",s)],style:{color:u,width:w.width}},[a]),!a&&!c&&e.createVNode("span",{class:[l.e("color-active"),l.e("active-star"),u?l.em("color","customize"):l.em("color",s)],style:{width:w.width}},[e.createVNode("svg",{width:"16px",height:"16px",viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns-xlink":"http://www.w3.org/1999/xlink"},[e.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("g",{id:"Mask"},[e.createVNode("polygon",{points:"8 12.7603585 3.67376208 14.3147912 3.81523437 9.71994835 1 6.0857977 5.41367261 4.80046131 8 1 10.5863274 4.80046131 15 6.0857977 12.1847656 9.71994835 12.3262379 14.3147912"},null)])])])])]))])}}),N={title:"Rate \u8BC4\u5206",category:"\u6570\u636E\u5C55\u793A",status:"100%",install(o){o.component(m.name,m)}};d.Rate=m,d.default=N,d.rateProps=V,Object.defineProperty(d,"__esModule",{value:!0}),d[Symbol.toStringTag]="Module"});
|
package/rate/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.devui-
|
|
1
|
+
.devui-rate--align{font-size:var(--devui-font-size-icon, 16px);margin-right:5px;position:relative;line-height:1}.devui-rate--pointer{cursor:pointer}.devui-rate{display:inline-flex}.devui-rate__color-active{line-height:1.5}.devui-rate__color-active i{color:var(--devui-brand, #5e7ce0)}.devui-rate__color-active svg g{fill:var(--devui-brand, #5e7ce0)}.devui-rate__color--success i{color:#3dcca6}.devui-rate__color--success svg g{fill:#3dcca6}.devui-rate__color--warning i{color:#fac20a}.devui-rate__color--warning svg g{fill:#fac20a}.devui-rate__color--error i{color:#f66f6a}.devui-rate__color--error svg g{fill:#f66f6a}.devui-rate__color--customize{color:var(--star-color)}.devui-rate__color--customize svg g{fill:var(--star-color)}.devui-rate__active-star{position:absolute;top:0;left:0;overflow:hidden}.devui-rate__color{color:var(--devui-shape-icon-fill, #d7d8da);line-height:1.5}.devui-rate__color .icon{color:var(--devui-shape-icon-fill, #d7d8da)!important}.devui-rate__color svg g{fill:var(--devui-shape-icon-fill, #d7d8da)}.devui-rate--only-read{cursor:not-allowed}
|
package/result/index.es.js
CHANGED
|
@@ -1,20 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
-
var __spreadValues = (a, b) => {
|
|
7
|
-
for (var prop in b || (b = {}))
|
|
8
|
-
if (__hasOwnProp.call(b, prop))
|
|
9
|
-
__defNormalProp(a, prop, b[prop]);
|
|
10
|
-
if (__getOwnPropSymbols)
|
|
11
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
-
if (__propIsEnum.call(b, prop))
|
|
13
|
-
__defNormalProp(a, prop, b[prop]);
|
|
14
|
-
}
|
|
15
|
-
return a;
|
|
16
|
-
};
|
|
17
|
-
import { defineComponent, createVNode } from "vue";
|
|
1
|
+
import { defineComponent, toRefs, computed, createVNode, resolveDynamicComponent, mergeProps } from "vue";
|
|
18
2
|
const resultProps = {
|
|
19
3
|
icon: {
|
|
20
4
|
type: String,
|
|
@@ -29,50 +13,196 @@ const resultProps = {
|
|
|
29
13
|
default: ""
|
|
30
14
|
}
|
|
31
15
|
};
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
},
|
|
39
|
-
size: {
|
|
40
|
-
type: String,
|
|
41
|
-
default: "inherit"
|
|
42
|
-
},
|
|
43
|
-
color: {
|
|
44
|
-
type: String,
|
|
45
|
-
default: "inherit"
|
|
46
|
-
},
|
|
47
|
-
classPrefix: {
|
|
48
|
-
type: String,
|
|
49
|
-
default: "icon"
|
|
50
|
-
}
|
|
16
|
+
const DEFAULT_PREFIX = "icon";
|
|
17
|
+
const iconProps = {
|
|
18
|
+
name: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: "",
|
|
21
|
+
required: true
|
|
51
22
|
},
|
|
52
|
-
|
|
53
|
-
|
|
23
|
+
size: {
|
|
24
|
+
type: [Number, String],
|
|
25
|
+
default: "inherit"
|
|
26
|
+
},
|
|
27
|
+
color: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: "inherit"
|
|
30
|
+
},
|
|
31
|
+
component: {
|
|
32
|
+
type: Object,
|
|
33
|
+
default: null
|
|
34
|
+
},
|
|
35
|
+
classPrefix: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: DEFAULT_PREFIX
|
|
38
|
+
},
|
|
39
|
+
operable: {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
default: false
|
|
54
42
|
},
|
|
55
|
-
|
|
43
|
+
disabled: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
default: false
|
|
46
|
+
},
|
|
47
|
+
rotate: {
|
|
48
|
+
type: [Number, String]
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
const svgIconProps = {
|
|
52
|
+
name: {
|
|
53
|
+
type: String,
|
|
54
|
+
default: "",
|
|
55
|
+
required: true
|
|
56
|
+
},
|
|
57
|
+
color: {
|
|
58
|
+
type: String,
|
|
59
|
+
default: "inherit"
|
|
60
|
+
},
|
|
61
|
+
size: {
|
|
62
|
+
type: [Number, String],
|
|
63
|
+
default: "inherit"
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
function createBem(namespace, element, modifier) {
|
|
67
|
+
let cls = namespace;
|
|
68
|
+
if (element) {
|
|
69
|
+
cls += `__${element}`;
|
|
70
|
+
}
|
|
71
|
+
if (modifier) {
|
|
72
|
+
cls += `--${modifier}`;
|
|
73
|
+
}
|
|
74
|
+
return cls;
|
|
75
|
+
}
|
|
76
|
+
function useNamespace(block, needDot = false) {
|
|
77
|
+
const namespace = needDot ? `.devui-${block}` : `devui-${block}`;
|
|
78
|
+
const b = () => createBem(namespace);
|
|
79
|
+
const e = (element) => element ? createBem(namespace, element) : "";
|
|
80
|
+
const m = (modifier) => modifier ? createBem(namespace, "", modifier) : "";
|
|
81
|
+
const em = (element, modifier) => element && modifier ? createBem(namespace, element, modifier) : "";
|
|
82
|
+
return {
|
|
83
|
+
b,
|
|
84
|
+
e,
|
|
85
|
+
m,
|
|
86
|
+
em
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
var icon = "";
|
|
90
|
+
var svgIcon = defineComponent({
|
|
91
|
+
name: "DSvgIcon",
|
|
92
|
+
props: svgIconProps,
|
|
93
|
+
setup(props) {
|
|
56
94
|
const {
|
|
57
95
|
name,
|
|
58
|
-
size,
|
|
59
96
|
color,
|
|
60
|
-
|
|
61
|
-
} =
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
97
|
+
size
|
|
98
|
+
} = toRefs(props);
|
|
99
|
+
const ns = useNamespace("svg-icon");
|
|
100
|
+
const iconName = computed(() => `#icon-${name.value}`);
|
|
101
|
+
const iconSize = computed(() => {
|
|
102
|
+
return typeof size.value === "number" ? `${size.value}px` : size.value;
|
|
103
|
+
});
|
|
104
|
+
const styles = {
|
|
105
|
+
width: iconSize.value,
|
|
106
|
+
height: iconSize.value
|
|
107
|
+
};
|
|
108
|
+
return () => {
|
|
109
|
+
return createVNode("svg", {
|
|
110
|
+
"class": ns.b(),
|
|
111
|
+
"style": styles
|
|
112
|
+
}, [createVNode("use", {
|
|
113
|
+
"xlink:href": iconName.value,
|
|
114
|
+
"fill": color.value
|
|
115
|
+
}, null)]);
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
function isUrl(value) {
|
|
120
|
+
return /^((http|https):)?\/\//.test(value);
|
|
121
|
+
}
|
|
122
|
+
function useIconDom(props, ctx) {
|
|
123
|
+
const {
|
|
124
|
+
component,
|
|
125
|
+
name,
|
|
126
|
+
size,
|
|
127
|
+
color,
|
|
128
|
+
classPrefix,
|
|
129
|
+
rotate
|
|
130
|
+
} = toRefs(props);
|
|
131
|
+
const ns = useNamespace("icon");
|
|
132
|
+
const iconSize = computed(() => {
|
|
133
|
+
return typeof size.value === "number" ? `${size.value}px` : size.value;
|
|
134
|
+
});
|
|
135
|
+
const IconComponent = component.value ? resolveDynamicComponent(component.value) : resolveDynamicComponent(svgIcon);
|
|
136
|
+
const imgIconDom = () => {
|
|
137
|
+
return createVNode("img", mergeProps({
|
|
138
|
+
"src": name.value,
|
|
139
|
+
"alt": name.value.split("/")[name.value.split("/").length - 1],
|
|
140
|
+
"class": [(rotate == null ? void 0 : rotate.value) === "infinite" && ns.m("spin")],
|
|
141
|
+
"style": {
|
|
142
|
+
width: iconSize.value || "",
|
|
143
|
+
transform: `rotate(${rotate == null ? void 0 : rotate.value}deg)`
|
|
144
|
+
}
|
|
145
|
+
}, ctx.attrs), null);
|
|
146
|
+
};
|
|
147
|
+
const svgIconDom = () => {
|
|
148
|
+
return createVNode(IconComponent, mergeProps({
|
|
149
|
+
"name": name.value,
|
|
150
|
+
"color": color.value,
|
|
151
|
+
"size": iconSize.value,
|
|
152
|
+
"class": [(rotate == null ? void 0 : rotate.value) === "infinite" && ns.m("spin")],
|
|
65
153
|
"style": {
|
|
66
|
-
|
|
67
|
-
verticalAlign: "text-bottom"
|
|
154
|
+
transform: `rotate(${rotate == null ? void 0 : rotate.value}deg)`
|
|
68
155
|
}
|
|
69
|
-
},
|
|
70
|
-
|
|
156
|
+
}, ctx.attrs), null);
|
|
157
|
+
};
|
|
158
|
+
const fontIconDom = () => {
|
|
159
|
+
const fontIconClass = /^icon-/.test(name.value) ? name.value : `${classPrefix.value}-${name.value}`;
|
|
160
|
+
return createVNode("i", mergeProps({
|
|
161
|
+
"class": [classPrefix.value, fontIconClass, (rotate == null ? void 0 : rotate.value) === "infinite" && ns.m("spin")],
|
|
71
162
|
"style": {
|
|
72
|
-
fontSize:
|
|
73
|
-
color
|
|
163
|
+
fontSize: iconSize.value,
|
|
164
|
+
color: color.value,
|
|
165
|
+
transform: `rotate(${rotate == null ? void 0 : rotate.value}deg)`
|
|
74
166
|
}
|
|
75
|
-
}, null);
|
|
167
|
+
}, ctx.attrs), null);
|
|
168
|
+
};
|
|
169
|
+
const iconDom = () => {
|
|
170
|
+
return component.value ? svgIconDom() : isUrl(name.value) ? imgIconDom() : fontIconDom();
|
|
171
|
+
};
|
|
172
|
+
return {
|
|
173
|
+
iconDom
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
var Icon = defineComponent({
|
|
177
|
+
name: "DIcon",
|
|
178
|
+
props: iconProps,
|
|
179
|
+
setup(props, ctx) {
|
|
180
|
+
const {
|
|
181
|
+
disabled,
|
|
182
|
+
operable
|
|
183
|
+
} = toRefs(props);
|
|
184
|
+
const {
|
|
185
|
+
iconDom
|
|
186
|
+
} = useIconDom(props, ctx);
|
|
187
|
+
const ns = useNamespace("icon");
|
|
188
|
+
const wrapClassed = computed(() => ({
|
|
189
|
+
[ns.e("container")]: true,
|
|
190
|
+
[ns.m("disabled")]: disabled.value,
|
|
191
|
+
[ns.m("operable")]: operable.value
|
|
192
|
+
}));
|
|
193
|
+
const onClick = (e) => {
|
|
194
|
+
e.stopImmediatePropagation();
|
|
195
|
+
if (disabled.value) {
|
|
196
|
+
e.preventDefault();
|
|
197
|
+
}
|
|
198
|
+
};
|
|
199
|
+
return () => {
|
|
200
|
+
var _a, _b, _c, _d;
|
|
201
|
+
return createVNode("div", {
|
|
202
|
+
"class": wrapClassed.value,
|
|
203
|
+
"onClick": onClick
|
|
204
|
+
}, [(_b = (_a = ctx.slots).prefix) == null ? void 0 : _b.call(_a), iconDom(), (_d = (_c = ctx.slots).suffix) == null ? void 0 : _d.call(_c)]);
|
|
205
|
+
};
|
|
76
206
|
}
|
|
77
207
|
});
|
|
78
208
|
var result = "";
|
|
@@ -105,15 +235,12 @@ var Result = defineComponent({
|
|
|
105
235
|
};
|
|
106
236
|
}
|
|
107
237
|
});
|
|
108
|
-
Result.install = function(app) {
|
|
109
|
-
app.component(Result.name, Result);
|
|
110
|
-
};
|
|
111
238
|
var index = {
|
|
112
239
|
title: "Result \u7ED3\u679C",
|
|
113
240
|
category: "\u53CD\u9988",
|
|
114
241
|
status: "100%",
|
|
115
242
|
install(app) {
|
|
116
|
-
app.
|
|
243
|
+
app.component(Result.name, Result);
|
|
117
244
|
}
|
|
118
245
|
};
|
|
119
|
-
export { Result, index as default };
|
|
246
|
+
export { Result, index as default, resultProps };
|
package/result/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(c,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(c=typeof globalThis!="undefined"?globalThis:c||self,e(c.index={},c.Vue))})(this,function(c,e){"use strict";const y={icon:{type:String,default:"info"},title:{type:String,default:""},desc:{type:String,default:""}},D={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]}},N={name:{type:String,default:"",required:!0},color:{type:String,default:"inherit"},size:{type:[Number,String],default:"inherit"}};function f(o,s,l){let n=o;return s&&(n+=`__${s}`),l&&(n+=`--${l}`),n}function v(o,s=!1){const l=s?`.devui-${o}`:`devui-${o}`;return{b:()=>f(l),e:t=>t?f(l,t):"",m:t=>t?f(l,"",t):"",em:(t,a)=>t&&a?f(l,t,a):""}}var z="",S=e.defineComponent({name:"DSvgIcon",props:N,setup(o){const{name:s,color:l,size:n}=e.toRefs(o),r=v("svg-icon"),i=e.computed(()=>`#icon-${s.value}`),u=e.computed(()=>typeof n.value=="number"?`${n.value}px`:n.value),t={width:u.value,height:u.value};return()=>e.createVNode("svg",{class:r.b(),style:t},[e.createVNode("use",{"xlink:href":i.value,fill:l.value},null)])}});function b(o){return/^((http|https):)?\/\//.test(o)}function h(o,s){const{component:l,name:n,size:r,color:i,classPrefix:u,rotate:t}=e.toRefs(o),a=v("icon"),d=e.computed(()=>typeof r.value=="number"?`${r.value}px`:r.value),p=l.value?e.resolveDynamicComponent(l.value):e.resolveDynamicComponent(S),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"&&a.m("spin")],style:{width:d.value||"",transform:`rotate(${t==null?void 0:t.value}deg)`}},s.attrs),null),V=()=>e.createVNode(p,e.mergeProps({name:n.value,color:i.value,size:d.value,class:[(t==null?void 0:t.value)==="infinite"&&a.m("spin")],style:{transform:`rotate(${t==null?void 0:t.value}deg)`}},s.attrs),null),$=()=>{const C=/^icon-/.test(n.value)?n.value:`${u.value}-${n.value}`;return e.createVNode("i",e.mergeProps({class:[u.value,C,(t==null?void 0:t.value)==="infinite"&&a.m("spin")],style:{fontSize:d.value,color:i.value,transform:`rotate(${t==null?void 0:t.value}deg)`}},s.attrs),null)};return{iconDom:()=>l.value?V():b(n.value)?m():$()}}var _=e.defineComponent({name:"DIcon",props:D,setup(o,s){const{disabled:l,operable:n}=e.toRefs(o),{iconDom:r}=h(o,s),i=v("icon"),u=e.computed(()=>({[i.e("container")]:!0,[i.m("disabled")]:l.value,[i.m("operable")]:n.value})),t=a=>{a.stopImmediatePropagation(),l.value&&a.preventDefault()};return()=>{var a,d,p,m;return e.createVNode("div",{class:u.value,onClick:t},[(d=(a=s.slots).prefix)==null?void 0:d.call(a),r(),(m=(p=s.slots).suffix)==null?void 0:m.call(p)])}}}),R="",g=e.defineComponent({name:"DResult",props:y,setup(o,s){let l;return function(n){n.success="right-o",n.danger="error-o",n.warning="warning-o",n.info="info-o"}(l||(l={})),()=>{var n,r,i,u;return e.createVNode("div",{class:"devui-result"},[s.slots.icon?e.createVNode("div",null,[(n=s.slots)==null?void 0:n.icon()]):e.createVNode(_,{name:l[o.icon]||"",class:`devui-result__icon-${o.icon}`,size:"64px"},null),e.createVNode("div",{class:"devui-result__title"},[s.slots.title?(r=s.slots)==null?void 0:r.title():o.title]),e.createVNode("div",{class:"devui-result__desc"},[s.slots.desc?(i=s.slots)==null?void 0:i.desc():o.desc]),e.createVNode("div",{class:"devui-result__extra"},[s.slots.extra?(u=s.slots)==null?void 0:u.extra():""])])}}}),P={title:"Result \u7ED3\u679C",category:"\u53CD\u9988",status:"100%",install(o){o.component(g.name,g)}};c.Result=g,c.default=P,c.resultProps=y,Object.defineProperty(c,"__esModule",{value:!0}),c[Symbol.toStringTag]="Module"});
|
package/result/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.devui-result{display:flex;justify-content:center;align-items:center;flex-direction:column;text-align:center;box-sizing:border-box;padding:30px}.devui-result__icon-success:before{color:var(--devui-success, #50d4ab)}.devui-result__icon-danger:before{color:var(--devui-danger, #f66f6a)}.devui-result__icon-warning:before{color:var(--devui-warning, #fac20a)}.devui-result__icon-info:before{color:var(--devui-info, #5e7ce0)}.devui-result__title{margin-top:20px;color:var(--devui-text, #252b3a);font-size:var(--devui-font-size-lg, 14px)}.devui-result__desc{margin-top:10px;color:var(--devui-text-weak, #575d6c);font-size:var(--devui-font-size-md,
|
|
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-result{display:flex;justify-content:center;align-items:center;flex-direction:column;text-align:center;box-sizing:border-box;padding:30px}.devui-result__icon-success:before{color:var(--devui-success, #50d4ab)}.devui-result__icon-danger:before{color:var(--devui-danger, #f66f6a)}.devui-result__icon-warning:before{color:var(--devui-warning, #fac20a)}.devui-result__icon-info:before{color:var(--devui-info, #5e7ce0)}.devui-result__title{margin-top:20px;color:var(--devui-text, #252b3a);font-size:var(--devui-font-size-lg, 14px)}.devui-result__desc{margin-top:10px;color:var(--devui-text-weak, #575d6c);font-size:var(--devui-font-size-md, 14px)}.devui-result__extra{margin-top:30px}
|