vue-devui 1.0.0-beta.1 → 1.0.0-beta.13
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 +62 -45
- package/accordion/index.d.ts +7 -0
- package/accordion/index.es.js +460 -142
- package/accordion/index.umd.js +1 -1
- package/accordion/style.css +1 -1
- package/alert/index.d.ts +7 -0
- package/alert/index.es.js +7 -5
- package/alert/index.umd.js +1 -1
- package/alert/style.css +1 -1
- package/anchor/index.d.ts +7 -0
- package/avatar/index.d.ts +7 -0
- package/avatar/index.es.js +1 -1
- package/avatar/index.umd.js +1 -1
- package/back-top/index.d.ts +7 -0
- package/back-top/index.es.js +128 -0
- package/back-top/index.umd.js +1 -0
- package/back-top/package.json +7 -0
- package/back-top/style.css +1 -0
- package/badge/index.d.ts +7 -0
- package/badge/index.es.js +1 -1
- package/badge/index.umd.js +1 -1
- package/breadcrumb/index.d.ts +7 -0
- package/button/index.d.ts +7 -0
- package/button/index.es.js +218 -12
- package/button/index.umd.js +1 -1
- package/button/style.css +1 -1
- package/card/index.d.ts +7 -0
- package/card/index.es.js +1 -1
- package/card/index.umd.js +1 -1
- package/carousel/index.d.ts +7 -0
- package/carousel/index.es.js +5 -4
- package/carousel/index.umd.js +1 -1
- package/cascader/index.d.ts +7 -0
- package/cascader/index.es.js +1239 -83
- package/cascader/index.umd.js +1 -1
- package/cascader/style.css +1 -1
- package/checkbox/index.d.ts +7 -0
- package/checkbox/index.es.js +43 -8
- package/checkbox/index.umd.js +1 -1
- package/color-picker/index.d.ts +7 -0
- package/color-picker/index.es.js +2960 -0
- package/color-picker/index.umd.js +1 -0
- package/color-picker/package.json +7 -0
- package/color-picker/style.css +1 -0
- package/comment/index.d.ts +7 -0
- package/comment/index.es.js +85 -0
- package/comment/index.umd.js +1 -0
- package/comment/package.json +7 -0
- package/comment/style.css +1 -0
- package/countdown/index.d.ts +7 -0
- package/countdown/index.es.js +176 -0
- package/countdown/index.umd.js +1 -0
- package/countdown/package.json +7 -0
- package/countdown/style.css +1 -0
- package/date-picker/index.d.ts +7 -0
- package/date-picker/index.es.js +32 -21
- package/date-picker/index.umd.js +1 -1
- package/date-picker/style.css +1 -1
- package/dragdrop/index.d.ts +7 -0
- package/dragdrop/index.es.js +157 -0
- package/dragdrop/index.umd.js +1 -0
- package/dragdrop/package.json +7 -0
- package/drawer/index.d.ts +7 -0
- package/drawer/index.es.js +194 -42
- package/drawer/index.umd.js +1 -1
- package/drawer/style.css +1 -1
- package/dropdown/index.d.ts +7 -0
- package/dropdown/index.es.js +535 -0
- package/dropdown/index.umd.js +1 -0
- package/dropdown/package.json +7 -0
- package/dropdown/style.css +1 -0
- package/editable-select/index.d.ts +7 -0
- package/editable-select/index.es.js +5782 -469
- package/editable-select/index.umd.js +27 -1
- package/editable-select/style.css +1 -1
- package/form/index.d.ts +7 -0
- package/form/index.es.js +2257 -0
- package/form/index.umd.js +1 -0
- package/form/package.json +7 -0
- package/form/style.css +1 -0
- package/fullscreen/index.d.ts +7 -0
- package/fullscreen/index.es.js +14 -4
- package/fullscreen/index.umd.js +1 -1
- package/gantt/index.d.ts +7 -0
- package/gantt/index.es.js +535 -0
- package/gantt/index.umd.js +1 -0
- package/gantt/package.json +7 -0
- package/gantt/style.css +1 -0
- package/grid/index.d.ts +7 -0
- package/grid/index.es.js +269 -0
- package/grid/index.umd.js +1 -0
- package/grid/package.json +7 -0
- package/grid/style.css +1 -0
- package/icon/index.d.ts +7 -0
- package/icon/index.es.js +6 -5
- package/icon/index.umd.js +1 -1
- package/image-preview/index.d.ts +7 -0
- package/image-preview/index.es.js +99 -20
- package/image-preview/index.umd.js +1 -1
- package/image-preview/style.css +1 -1
- package/index.d.ts +7 -0
- package/input/index.d.ts +7 -0
- package/input/index.es.js +24 -13
- package/input/index.umd.js +1 -1
- package/input-icon/index.d.ts +7 -0
- package/input-icon/index.es.js +332 -0
- package/input-icon/index.umd.js +1 -0
- package/input-icon/package.json +7 -0
- package/input-icon/style.css +1 -0
- package/input-number/index.d.ts +7 -0
- package/input-number/index.es.js +5 -4
- package/input-number/index.umd.js +1 -1
- package/layout/index.d.ts +7 -0
- package/layout/index.es.js +1 -1
- package/layout/index.umd.js +1 -1
- package/loading/index.d.ts +7 -0
- package/loading/index.es.js +1 -1
- package/loading/index.umd.js +1 -1
- package/modal/index.d.ts +7 -0
- package/modal/index.es.js +328 -109
- package/modal/index.umd.js +1 -1
- package/modal/style.css +1 -1
- package/nav-sprite/index.d.ts +7 -0
- package/nuxt/components/Accordion.js +3 -0
- package/nuxt/components/Alert.js +3 -0
- package/nuxt/components/Anchor.js +3 -0
- package/nuxt/components/Aside.js +3 -0
- package/nuxt/components/Avatar.js +3 -0
- package/nuxt/components/BackTop.js +3 -0
- package/nuxt/components/Badge.js +3 -0
- package/nuxt/components/Breadcrumb.js +3 -0
- package/nuxt/components/Button.js +3 -0
- package/nuxt/components/Card.js +3 -0
- package/nuxt/components/Carousel.js +3 -0
- package/nuxt/components/Cascader.js +3 -0
- package/nuxt/components/Checkbox.js +3 -0
- package/nuxt/components/Col.js +3 -0
- package/nuxt/components/ColorPicker.js +3 -0
- package/nuxt/components/Column.js +3 -0
- package/nuxt/components/Comment.js +3 -0
- package/nuxt/components/Content.js +3 -0
- package/nuxt/components/Countdown.js +3 -0
- package/nuxt/components/DatePicker.js +3 -0
- package/nuxt/components/Drawer.js +3 -0
- package/nuxt/components/DrawerService.js +3 -0
- package/nuxt/components/Dropdown.js +3 -0
- package/nuxt/components/EditableSelect.js +3 -0
- package/nuxt/components/FixedOverlay.js +3 -0
- package/nuxt/components/FlexibleOverlay.js +3 -0
- package/nuxt/components/Footer.js +3 -0
- package/nuxt/components/Form.js +3 -0
- package/nuxt/components/FormControl.js +3 -0
- package/nuxt/components/FormItem.js +3 -0
- package/nuxt/components/FormLabel.js +3 -0
- package/nuxt/components/FormOperation.js +3 -0
- package/nuxt/components/Fullscreen.js +3 -0
- package/nuxt/components/Gantt.js +3 -0
- package/nuxt/components/Header.js +3 -0
- package/nuxt/components/Icon.js +2 -0
- package/nuxt/components/ImagePreviewService.js +3 -0
- package/nuxt/components/Input.js +3 -0
- package/nuxt/components/InputIcon.js +3 -0
- package/nuxt/components/InputNumber.js +3 -0
- package/nuxt/components/Layout.js +3 -0
- package/nuxt/components/Loading.js +3 -0
- package/nuxt/components/LoadingService.js +3 -0
- package/nuxt/components/Modal.js +3 -0
- package/nuxt/components/NavSprite.js +2 -0
- package/nuxt/components/Pagination.js +3 -0
- package/nuxt/components/Panel.js +3 -0
- package/nuxt/components/Popover.js +3 -0
- package/nuxt/components/Progress.js +3 -0
- package/nuxt/components/QuadrantDiagram.js +3 -0
- package/nuxt/components/Radio.js +3 -0
- package/nuxt/components/RadioGroup.js +3 -0
- package/nuxt/components/Rate.js +3 -0
- package/nuxt/components/ReadTip.js +3 -0
- package/nuxt/components/Result.js +3 -0
- package/nuxt/components/Row.js +3 -0
- package/nuxt/components/Search.js +3 -0
- package/nuxt/components/Select.js +3 -0
- package/nuxt/components/Skeleton.js +3 -0
- package/nuxt/components/SkeletonItem.js +3 -0
- package/nuxt/components/Slider.js +3 -0
- package/nuxt/components/Splitter.js +3 -0
- package/nuxt/components/Statistic.js +3 -0
- package/nuxt/components/Status.js +3 -0
- package/nuxt/components/StepsGuide.js +3 -0
- package/nuxt/components/StickSlider.js +3 -0
- package/nuxt/components/Sticky.js +2 -0
- package/nuxt/components/Switch.js +3 -0
- package/nuxt/components/Table.js +3 -0
- package/nuxt/components/Tabs.js +3 -0
- package/nuxt/components/Tag.js +3 -0
- package/nuxt/components/TagInput.js +3 -0
- package/nuxt/components/Textarea.js +3 -0
- package/nuxt/components/TimeAxis.js +3 -0
- package/nuxt/components/TimeAxisItem.js +3 -0
- package/nuxt/components/TimePicker.js +3 -0
- package/nuxt/components/Toast.js +3 -0
- package/nuxt/components/ToastService.js +3 -0
- package/nuxt/components/Tooltip.js +3 -0
- package/nuxt/components/Transfer.js +3 -0
- package/nuxt/components/Tree.js +3 -0
- package/nuxt/components/TreeSelect.js +3 -0
- package/nuxt/components/Upload.js +3 -0
- package/nuxt/components/buttonProps.js +3 -0
- package/nuxt/index.js +13 -0
- package/overlay/index.d.ts +7 -0
- package/overlay/index.es.js +111 -94
- package/overlay/index.umd.js +1 -1
- package/overlay/style.css +1 -1
- package/package.json +5 -47
- package/pagination/index.d.ts +7 -0
- package/pagination/index.es.js +3 -3
- package/pagination/index.umd.js +1 -1
- package/panel/index.d.ts +7 -0
- package/panel/index.es.js +25 -22
- package/panel/index.umd.js +1 -1
- package/panel/style.css +1 -1
- package/popover/index.d.ts +7 -0
- package/popover/index.es.js +18 -6
- package/popover/index.umd.js +1 -1
- package/progress/index.d.ts +7 -0
- package/progress/index.es.js +9 -9
- package/progress/index.umd.js +3 -3
- package/quadrant-diagram/index.d.ts +7 -0
- package/radio/index.d.ts +7 -0
- package/radio/index.es.js +6 -6
- package/radio/index.umd.js +1 -1
- package/rate/index.d.ts +7 -0
- package/rate/index.es.js +1 -1
- package/rate/index.umd.js +1 -1
- package/read-tip/index.d.ts +7 -0
- package/read-tip/index.es.js +258 -0
- package/read-tip/index.umd.js +1 -0
- package/read-tip/package.json +7 -0
- package/read-tip/style.css +1 -0
- package/result/index.d.ts +7 -0
- package/result/index.es.js +119 -0
- package/result/index.umd.js +1 -0
- package/result/package.json +7 -0
- package/result/style.css +1 -0
- package/ripple/index.d.ts +7 -0
- package/ripple/index.es.js +5 -2
- package/ripple/index.umd.js +1 -1
- package/search/index.d.ts +7 -0
- package/search/index.es.js +35 -21
- package/search/index.umd.js +1 -1
- package/select/index.d.ts +7 -0
- package/select/index.es.js +47 -11
- package/select/index.umd.js +1 -1
- package/skeleton/index.d.ts +7 -0
- package/skeleton/index.es.js +148 -26
- package/skeleton/index.umd.js +1 -1
- package/skeleton/style.css +1 -1
- package/slider/index.d.ts +7 -0
- package/slider/index.es.js +32 -182
- package/slider/index.umd.js +1 -1
- package/slider/style.css +1 -1
- package/splitter/index.d.ts +7 -0
- package/splitter/index.es.js +295 -100
- package/splitter/index.umd.js +1 -1
- package/splitter/style.css +1 -1
- package/statistic/index.d.ts +7 -0
- package/statistic/index.es.js +280 -0
- package/statistic/index.umd.js +1 -0
- package/statistic/package.json +7 -0
- package/statistic/style.css +1 -0
- package/status/index.d.ts +7 -0
- package/status/index.es.js +2 -2
- package/status/index.umd.js +1 -1
- package/steps-guide/index.d.ts +7 -0
- package/steps-guide/index.es.js +101 -73
- package/steps-guide/index.umd.js +1 -1
- package/steps-guide/style.css +1 -1
- package/sticky/index.d.ts +7 -0
- package/style.css +1 -1
- package/switch/index.d.ts +7 -0
- package/switch/index.es.js +1 -1
- package/switch/index.umd.js +1 -1
- package/table/index.d.ts +7 -0
- package/table/index.es.js +1708 -156
- package/table/index.umd.js +1 -1
- package/table/style.css +1 -1
- package/tabs/index.d.ts +7 -0
- package/tabs/index.es.js +6 -3
- package/tabs/index.umd.js +1 -1
- package/tag/index.d.ts +7 -0
- package/tag/index.es.js +131 -0
- package/tag/index.umd.js +1 -0
- package/tag/package.json +7 -0
- package/tag/style.css +1 -0
- package/tag-input/index.d.ts +7 -0
- package/tag-input/index.es.js +1 -13
- package/tag-input/index.umd.js +1 -1
- package/textarea/index.d.ts +7 -0
- package/textarea/index.es.js +132 -0
- package/textarea/index.umd.js +1 -0
- package/textarea/package.json +7 -0
- package/textarea/style.css +1 -0
- package/time-axis/index.d.ts +7 -0
- package/time-axis/index.es.js +241 -21
- package/time-axis/index.umd.js +1 -1
- package/time-axis/style.css +1 -1
- package/time-picker/index.d.ts +7 -0
- package/time-picker/index.es.js +266 -32
- package/time-picker/index.umd.js +1 -1
- package/time-picker/style.css +1 -1
- package/toast/index.d.ts +7 -0
- package/toast/index.es.js +16 -12
- package/toast/index.umd.js +1 -1
- package/toast/style.css +1 -1
- package/tooltip/index.d.ts +7 -0
- package/transfer/index.d.ts +7 -0
- package/transfer/index.es.js +575 -83
- package/transfer/index.umd.js +1 -1
- package/transfer/style.css +1 -1
- package/tree/index.d.ts +7 -0
- package/tree/index.es.js +171 -35
- package/tree/index.umd.js +1 -1
- package/tree-select/index.d.ts +7 -0
- package/tree-select/index.es.js +528 -0
- package/tree-select/index.umd.js +1 -0
- package/tree-select/package.json +7 -0
- package/tree-select/style.css +1 -0
- package/upload/index.d.ts +7 -0
- package/upload/index.es.js +172 -513
- package/upload/index.umd.js +1 -1
- package/upload/style.css +1 -1
- package/vue-devui.es.js +22079 -8773
- package/vue-devui.umd.js +29 -3
package/panel/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { reactive, ref, defineComponent, provide,
|
|
1
|
+
import { reactive, ref, defineComponent, provide, computed, createVNode, inject, onMounted, Transition } from "vue";
|
|
2
2
|
var panel = "";
|
|
3
3
|
const PanelProps = {
|
|
4
4
|
type: {
|
|
@@ -11,7 +11,7 @@ const PanelProps = {
|
|
|
11
11
|
},
|
|
12
12
|
isCollapsed: {
|
|
13
13
|
type: Boolean,
|
|
14
|
-
default:
|
|
14
|
+
default: false
|
|
15
15
|
},
|
|
16
16
|
beforeToggle: {
|
|
17
17
|
type: Function,
|
|
@@ -47,28 +47,23 @@ var Panel = defineComponent({
|
|
|
47
47
|
props: PanelProps,
|
|
48
48
|
setup(props, ctx) {
|
|
49
49
|
provide("beforeToggle", props.beforeToggle);
|
|
50
|
-
provide("showAnimation", props.showAnimation);
|
|
51
|
-
provide("hasLeftPadding", props.hasLeftPadding);
|
|
50
|
+
provide("showAnimation", computed(() => props.showAnimation));
|
|
51
|
+
provide("hasLeftPadding", computed(() => props.hasLeftPadding));
|
|
52
52
|
const isCollapsed = ref(props.isCollapsed);
|
|
53
|
-
const
|
|
53
|
+
const type = computed(() => props.type);
|
|
54
|
+
const cssClass = computed(() => props.cssClass);
|
|
54
55
|
const onToggle = () => {
|
|
55
56
|
var _a;
|
|
56
57
|
(_a = props.toggle) == null ? void 0 : _a.call(props, Store.getByKey(`isCollapsed[${timeStamp}]`));
|
|
57
58
|
};
|
|
58
|
-
onMounted(() => {
|
|
59
|
-
if (bodyEl.value) {
|
|
60
|
-
const dom = bodyEl.value;
|
|
61
|
-
if (isCollapsed.value)
|
|
62
|
-
dom.style.height = `${dom.offsetHeight}px`;
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
59
|
const timeStamp = new Date().getTime().toString();
|
|
66
60
|
Store.setData(`isCollapsed[${timeStamp}]`, isCollapsed.value);
|
|
67
61
|
return () => {
|
|
62
|
+
var _a, _b;
|
|
68
63
|
return createVNode("div", {
|
|
69
64
|
"onClick": onToggle,
|
|
70
|
-
"class": `devui-panel devui-panel-${
|
|
71
|
-
}, [ctx.slots.default()]);
|
|
65
|
+
"class": `devui-panel devui-panel-${type.value} ${cssClass.value}`
|
|
66
|
+
}, [(_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)]);
|
|
72
67
|
};
|
|
73
68
|
}
|
|
74
69
|
});
|
|
@@ -80,6 +75,8 @@ var PanelHeader = defineComponent({
|
|
|
80
75
|
const keys = Object.keys(Store.state());
|
|
81
76
|
const key = keys.pop();
|
|
82
77
|
const isCollapsed = ref(Store.state()[key]);
|
|
78
|
+
let changeFlag = ref();
|
|
79
|
+
let header = null;
|
|
83
80
|
const canToggle = () => {
|
|
84
81
|
let changeResult = Promise.resolve(true);
|
|
85
82
|
if (beforeToggle) {
|
|
@@ -94,28 +91,34 @@ var PanelHeader = defineComponent({
|
|
|
94
91
|
}
|
|
95
92
|
return changeResult;
|
|
96
93
|
};
|
|
94
|
+
canToggle().then((val) => changeFlag.value = val);
|
|
97
95
|
const toggleBody = () => {
|
|
98
96
|
canToggle().then((val) => {
|
|
99
|
-
var _a;
|
|
97
|
+
var _a, _b;
|
|
98
|
+
changeFlag.value = val;
|
|
100
99
|
if (!val) {
|
|
100
|
+
if (!isCollapsed.value) {
|
|
101
|
+
Store.setData(`${key}`, !isCollapsed.value);
|
|
102
|
+
isCollapsed.value = !isCollapsed.value;
|
|
103
|
+
(_a = props.toggle) == null ? void 0 : _a.call(props, isCollapsed.value);
|
|
104
|
+
}
|
|
101
105
|
return;
|
|
102
106
|
}
|
|
103
107
|
if (isCollapsed.value !== void 0) {
|
|
104
108
|
Store.setData(`${key}`, !isCollapsed.value);
|
|
105
109
|
isCollapsed.value = !isCollapsed.value;
|
|
106
|
-
(
|
|
110
|
+
(_b = props.toggle) == null ? void 0 : _b.call(props, isCollapsed.value);
|
|
107
111
|
}
|
|
108
112
|
});
|
|
109
113
|
};
|
|
110
114
|
return () => {
|
|
111
115
|
var _a, _b;
|
|
112
|
-
let header = null;
|
|
113
116
|
if (ctx.slots.default) {
|
|
114
117
|
header = createVNode("div", {
|
|
115
118
|
"class": "devui-panel-heading",
|
|
116
119
|
"onClick": toggleBody,
|
|
117
120
|
"style": {
|
|
118
|
-
"cursor":
|
|
121
|
+
"cursor": changeFlag.value ? "pointer" : "auto"
|
|
119
122
|
}
|
|
120
123
|
}, [(_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)]);
|
|
121
124
|
}
|
|
@@ -127,8 +130,8 @@ var PanelBody = defineComponent({
|
|
|
127
130
|
name: "DPanelBody",
|
|
128
131
|
props: PanelProps,
|
|
129
132
|
setup(props, ctx) {
|
|
130
|
-
|
|
131
|
-
|
|
133
|
+
let animationName = inject("showAnimation");
|
|
134
|
+
let hasLeftPadding = inject("hasLeftPadding");
|
|
132
135
|
const keys = Object.keys(Store.state());
|
|
133
136
|
const key = keys.pop();
|
|
134
137
|
const isCollapsed = Store.state();
|
|
@@ -156,7 +159,7 @@ var PanelBody = defineComponent({
|
|
|
156
159
|
return createVNode("div", {
|
|
157
160
|
"class": `devui-panel devui-panel-${props.type} ${props.cssClass}`
|
|
158
161
|
}, [createVNode(Transition, {
|
|
159
|
-
"name": animationName,
|
|
162
|
+
"name": animationName.value ? "devui-panel" : "",
|
|
160
163
|
"onEnter": enter,
|
|
161
164
|
"onLeave": leave
|
|
162
165
|
}, {
|
|
@@ -164,7 +167,7 @@ var PanelBody = defineComponent({
|
|
|
164
167
|
var _a, _b;
|
|
165
168
|
return [isCollapsed[key] === void 0 || isCollapsed[key] ? createVNode("div", {
|
|
166
169
|
"ref": bodyEl,
|
|
167
|
-
"class": `devui-panel-body ${isCollapsed[key] !== void 0 ? "devui-panel-body-collapse" : ""} ${hasLeftPadding}`
|
|
170
|
+
"class": `devui-panel-body ${isCollapsed[key] !== void 0 ? "devui-panel-body-collapse" : ""} ${!hasLeftPadding.value ? "no-left-padding" : ""}`
|
|
168
171
|
}, [createVNode("div", {
|
|
169
172
|
"class": "devui-panel-content"
|
|
170
173
|
}, [(_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)])]) : null];
|
package/panel/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";var $="";const h={type:{type:String,default:"default"},cssClass:{type:String,default:""},isCollapsed:{type:Boolean,default:!1},beforeToggle:{type:Function,default:null},toggle:{type:Function,default:null},showAnimation:{type:Boolean,default:!0},hasLeftPadding:{type:Boolean,default:!0}},p=e.reactive({});class f{static getByKey(o){return p[o]}static state(){return p}static setData(o,u){p[o]=e.ref(u)}}var y=e.defineComponent({name:"DPanel",props:h,setup(t,o){e.provide("beforeToggle",t.beforeToggle),e.provide("showAnimation",e.computed(()=>t.showAnimation)),e.provide("hasLeftPadding",e.computed(()=>t.hasLeftPadding));const u=e.ref(t.isCollapsed),r=e.computed(()=>t.type),c=e.computed(()=>t.cssClass),l=()=>{var s;(s=t.toggle)==null||s.call(t,f.getByKey(`isCollapsed[${i}]`))},i=new Date().getTime().toString();return f.setData(`isCollapsed[${i}]`,u.value),()=>{var s,g;return e.createVNode("div",{onClick:l,class:`devui-panel devui-panel-${r.value} ${c.value}`},[(g=(s=o.slots).default)==null?void 0:g.call(s)])}}}),P=e.defineComponent({name:"DPanelHeader",props:h,setup(t,o){const u=e.inject("beforeToggle"),c=Object.keys(f.state()).pop(),l=e.ref(f.state()[c]);let i=e.ref(),s=null;const g=()=>{let n=Promise.resolve(!0);if(u){const a=u(l);typeof a!==void 0&&(a instanceof Promise?n=a:n=Promise.resolve(a))}return n};g().then(n=>i.value=n);const v=()=>{g().then(n=>{var a,m;if(i.value=n,!n){l.value||(f.setData(`${c}`,!l.value),l.value=!l.value,(a=t.toggle)==null||a.call(t,l.value));return}l.value!==void 0&&(f.setData(`${c}`,!l.value),l.value=!l.value,(m=t.toggle)==null||m.call(t,l.value))})};return()=>{var n,a;return o.slots.default&&(s=e.createVNode("div",{class:"devui-panel-heading",onClick:v,style:{cursor:i.value?"pointer":"auto"}},[(a=(n=o.slots).default)==null?void 0:a.call(n)])),s}}}),C=e.defineComponent({name:"DPanelBody",props:h,setup(t,o){let u=e.inject("showAnimation"),r=e.inject("hasLeftPadding");const l=Object.keys(f.state()).pop(),i=f.state(),s=e.ref();e.onMounted(()=>{if(s.value){const n=s.value;i[l]&&(n.style.height=`${n.offsetHeight}px`)}});const g=n=>{const a=n;a.style.height="";const m=a.offsetHeight;a.style.height="0px",a.offsetHeight,a.style.height=`${m}px`},v=n=>{const a=n;a.style.height="0px"};return()=>e.createVNode("div",{class:`devui-panel devui-panel-${t.type} ${t.cssClass}`},[e.createVNode(e.Transition,{name:u.value?"devui-panel":"",onEnter:g,onLeave:v},{default:()=>{var n,a;return[i[l]===void 0||i[l]?e.createVNode("div",{ref:s,class:`devui-panel-body ${i[l]!==void 0?"devui-panel-body-collapse":""} ${r.value?"":"no-left-padding"}`},[e.createVNode("div",{class:"devui-panel-content"},[(a=(n=o.slots).default)==null?void 0:a.call(n)])]):null]}})])}}),b=e.defineComponent({name:"DPanelFooter",setup(t,o){return()=>{var r,c;return o.slots.default?e.createVNode("div",{class:"devui-panel-footer"},[(c=(r=o.slots).default)==null?void 0:c.call(r)]):null}}});y.install=function(t){t.component(y.name,y),t.component(P.name,P),t.component(C.name,C),t.component(b.name,b)};var T={title:"Panel \u9762\u677F",category:"\u901A\u7528",status:"100%",install(t){t.use(y)}};d.Panel=y,d.default=T,Object.defineProperty(d,"__esModule",{value:!0}),d[Symbol.toStringTag]="Module"});
|
package/panel/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.devui-panel{line-height:1.5;background-color:var(--devui-base-bg, #ffffff)}.devui-panel .devui-panel-heading{padding:12px 20px;color:var(--devui-text, #252b3a)}.devui-panel .devui-panel-heading d-panel-header{line-height:1.5}.devui-panel .
|
|
1
|
+
.no-left-padding.devui-panel-body-collapse:before{content:none!important}.no-left-padding.devui-panel-body-collapse .devui-panel-content{border-left:none!important}.devui-panel{line-height:1.5;background-color:var(--devui-base-bg, #ffffff)}.devui-panel .devui-panel-heading{padding:12px 20px;color:var(--devui-text, #252b3a)}.devui-panel .devui-panel-heading d-panel-header{line-height:1.5}.devui-panel .devui-panel-body{display:flex;position:relative;border-top:1px solid var(--devui-dividing-line, #dfe1e6)}.devui-panel .devui-panel-body .devui-panel-content{line-height:1.5;padding:15px;background:var(--devui-base-bg, #ffffff);flex:1}.devui-panel .devui-panel-body.devui-panel-body-collapse:before{content:"";width:30px;height:100%}.devui-panel .devui-panel-body.devui-panel-body-collapse .devui-panel-content{border-left:2px solid var(--devui-dividing-line, #dfe1e6)}.devui-panel .devui-panel-footer{padding:10px 15px;color:var(--devui-text, #252b3a);background-color:var(--devui-area, #f8f8f8)}.devui-panel .devui-panel-footer d-panel-footer{line-height:1.5}.devui-panel.devui-panel-default .devui-panel-heading,.devui-panel.devui-panel-default .devui-panel-body{background-color:var(--devui-default-bg, #f3f6f8)}.devui-panel.devui-panel-primary .devui-panel-heading,.devui-panel.devui-panel-primary .devui-panel-body{background-color:var(--devui-primary-bg, #f2f5fc)}.devui-panel.devui-panel-primary .devui-panel-body-collapse .devui-panel-content{border-color:var(--devui-primary-line, #5e7ce0)}.devui-panel.devui-panel-info .devui-panel-heading,.devui-panel.devui-panel-info .devui-panel-body{background-color:var(--devui-info-bg, #f2f5fc)}.devui-panel.devui-panel-info .devui-panel-body-collapse .devui-panel-content{border-color:var(--devui-info-line, #5e7ce0)}.devui-panel.devui-panel-success .devui-panel-heading,.devui-panel.devui-panel-success .devui-panel-body{background-color:var(--devui-success-bg, #edfff9)}.devui-panel.devui-panel-success .devui-panel-body-collapse .devui-panel-content{border-color:var(--devui-success-line, #50d4ab)}.devui-panel.devui-panel-warning .devui-panel-heading,.devui-panel.devui-panel-warning .devui-panel-body{background-color:var(--devui-warning-bg, #fff3e8)}.devui-panel.devui-panel-warning .devui-panel-body-collapse .devui-panel-content{border-color:var(--devui-warning-line, #fa9841)}.devui-panel.devui-panel-danger .devui-panel-heading,.devui-panel.devui-panel-danger .devui-panel-body{background-color:var(--devui-danger-bg, #ffeeed)}.devui-panel.devui-panel-danger .devui-panel-body-collapse .devui-panel-content{border-color:var(--devui-danger-line, #f66f6a)}.devui-panel .devui-panel-leave-active{transition:all .3s ease-in-out;animation:panelUpOut .3s ease-in-out;animation-fill-mode:both}.devui-panel .devui-panel-enter-active{transition:all .3s ease-in-out;animation:panelUpIn .3s ease-in-out;animation-fill-mode:both}@keyframes panelUpOut{0%{transform:scaleY(1);transform-origin:0% 0%;opacity:1}to{transform:scaleY(0);transform-origin:0% 0%;opacity:0}}@keyframes panelUpIn{0%{transform:scaleY(0);transform-origin:0% 0%;opacity:0}to{transform:scaleY(1);transform-origin:0% 0%;opacity:1}}
|
package/popover/index.es.js
CHANGED
|
@@ -14,7 +14,7 @@ var __spreadValues = (a, b) => {
|
|
|
14
14
|
}
|
|
15
15
|
return a;
|
|
16
16
|
};
|
|
17
|
-
import { defineComponent, ref, toRefs, reactive, createVNode, withDirectives, resolveDirective, resolveComponent } from "vue";
|
|
17
|
+
import { defineComponent, ref, toRefs, reactive, watch, createVNode, withDirectives, resolveDirective, resolveComponent } from "vue";
|
|
18
18
|
var debounce = (callBack, wait) => {
|
|
19
19
|
let time = null;
|
|
20
20
|
return () => {
|
|
@@ -125,6 +125,10 @@ var Popover = defineComponent({
|
|
|
125
125
|
type: Number,
|
|
126
126
|
default: 1060
|
|
127
127
|
},
|
|
128
|
+
controlled: {
|
|
129
|
+
type: Boolean,
|
|
130
|
+
default: false
|
|
131
|
+
},
|
|
128
132
|
popType: {
|
|
129
133
|
type: String,
|
|
130
134
|
default: "default"
|
|
@@ -165,7 +169,8 @@ var Popover = defineComponent({
|
|
|
165
169
|
mouseEnterDelay,
|
|
166
170
|
mouseLeaveDelay,
|
|
167
171
|
showAnimation,
|
|
168
|
-
popMaxWidth
|
|
172
|
+
popMaxWidth,
|
|
173
|
+
controlled
|
|
169
174
|
} = toRefs(props);
|
|
170
175
|
const style = __spreadValues({
|
|
171
176
|
zIndex: zIndex.value
|
|
@@ -179,19 +184,26 @@ var Popover = defineComponent({
|
|
|
179
184
|
}
|
|
180
185
|
visible.value = true;
|
|
181
186
|
};
|
|
182
|
-
const onClick = isClick ? event : null;
|
|
187
|
+
const onClick = isClick && controlled.value ? event : null;
|
|
183
188
|
const enter = debounce(() => {
|
|
184
189
|
visible.value = true;
|
|
185
190
|
}, mouseEnterDelay.value);
|
|
186
191
|
const leave = debounce(() => {
|
|
187
192
|
visible.value = false;
|
|
188
193
|
}, mouseLeaveDelay.value);
|
|
189
|
-
const onMouseenter = isClick ?
|
|
190
|
-
const onMouseleave = isClick ?
|
|
194
|
+
const onMouseenter = !isClick && controlled.value ? enter : null;
|
|
195
|
+
const onMouseleave = !isClick && controlled.value ? leave : null;
|
|
191
196
|
const hiddenContext = () => {
|
|
197
|
+
if (!controlled.value)
|
|
198
|
+
return;
|
|
192
199
|
visible.value = false;
|
|
193
200
|
};
|
|
194
201
|
popMaxWidth.value && (style.maxWidth = `${popMaxWidth.value}px`);
|
|
202
|
+
watch(() => props.visible, (newVal) => {
|
|
203
|
+
if (controlled.value)
|
|
204
|
+
return;
|
|
205
|
+
visible.value = newVal;
|
|
206
|
+
});
|
|
195
207
|
return () => {
|
|
196
208
|
var _a, _b;
|
|
197
209
|
return createVNode("div", {
|
|
@@ -225,7 +237,7 @@ Popover.install = function(app) {
|
|
|
225
237
|
var index = {
|
|
226
238
|
title: "Popover \u60AC\u6D6E\u63D0\u793A",
|
|
227
239
|
category: "\u53CD\u9988",
|
|
228
|
-
status: "
|
|
240
|
+
status: "100%",
|
|
229
241
|
install(app) {
|
|
230
242
|
app.use(Popover);
|
|
231
243
|
}
|
package/popover/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var B=Object.defineProperty;var M=Object.getOwnPropertySymbols;var G=Object.prototype.hasOwnProperty,J=Object.prototype.propertyIsEnumerable;var S=(o,t,r)=>t in o?B(o,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[t]=r,T=(o,t)=>{for(var r in t||(t={}))G.call(t,r)&&S(o,r,t[r]);if(M)for(var r of M(t))J.call(t,r)&&S(o,r,t[r]);return o};(function(o,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(o=typeof globalThis!="undefined"?globalThis:o||self,t(o.index={},o.Vue))})(this,function(o,t){"use strict";var r=(e,i)=>{let n=null;return()=>{n&&clearTimeout(n),n=setTimeout(()=>{e==null||e()},i)}};const V=typeof window!="undefined";function b(e,i,n){document.addEventListener?e&&i&&n&&e.addEventListener(i,n,!1):e&&i&&n&&e.attachEvent("on"+i,n)}const a=Symbol("@@clickoutside"),p=new Map;let x,v=0,D=!0;function h(e,i,n){return V&&D&&(D=!1,b(document,"mousedown",u=>{x=u}),b(document,"mouseup",u=>{for(const[c,m]of p)m[a].documentHandler(u,x)})),function(u,c){!n||!i.instance||!u.target||!c.target||e.contains(u.target)||e.contains(c.target)||e===u.target||e[a].bindingFn&&e[a].bindingFn()}}const N={beforeMount:function(e,i,n){v++,p.set(v,e),e[a]={nid:v,documentHandler:h(e,i,n),bindingFn:i.value}},updated:function(e,i,n){e[a].documentHandler=h(e,i,n),e[a].bindingFn=i.value},unmounted:function(e){p.delete(e[a].nid),delete e[a]}};var K="";const k={success:{name:"right-o",color:"rgb(61, 204, 166)"},error:{name:"error-o",color:"rgb(249, 95, 91)"},info:{name:"info-o",color:"rgb(81, 112, 255)"},warning:{name:"warning-o",color:"rgb(254, 204, 85)"},default:{}};var l=t.defineComponent({name:"DPopover",directives:{clickoutside:N},props:{visible:{type:Boolean,default:!1},position:{type:String,default:"bottom"},content:{type:String,default:"default"},trigger:{type:String,default:"click"},zIndex:{type:Number,default:1060},controlled:{type:Boolean,default:!1},popType:{type:String,default:"default"},showAnimation:{type:Boolean,default:!0},mouseEnterDelay:{type:Number,default:150},mouseLeaveDelay:{type:Number,default:100},popMaxWidth:{type:Number,default:void 0},popoverStyle:{type:Object,default:()=>({})}},setup(e,i){const{slots:n}=i,u=t.ref(e.visible),{position:c,content:m,zIndex:F,trigger:L,popType:P,popoverStyle:z,mouseEnterDelay:A,mouseLeaveDelay:H,showAnimation:j,popMaxWidth:w,controlled:s}=t.toRefs(e),y=T({zIndex:F.value},z.value),g=L.value==="click",d=t.reactive(k[P.value]),I=function(){if(u.value){u.value=!1;return}u.value=!0},W=g&&s.value?I:null,O=r(()=>{u.value=!0},A.value),_=r(()=>{u.value=!1},H.value),q=!g&&s.value?O:null,R=!g&&s.value?_:null,$=()=>{!s.value||(u.value=!1)};return w.value&&(y.maxWidth=`${w.value}px`),t.watch(()=>e.visible,f=>{s.value||(u.value=f)}),()=>{var f,C;return t.createVNode("div",{class:["devui-popover",c.value,{"devui-popover-animation":j.value,"devui-popover-isVisible":u.value}]},[t.withDirectives(t.createVNode("div",{class:"devui-popover-reference",onMouseenter:q,onMouseleave:R,onClick:W},[(f=n.reference)==null?void 0:f.call(n)]),[[t.resolveDirective("clickoutside"),$]]),t.createVNode("div",{class:["devui-popover-content",d.name?"is-icon":""],style:y},[d.name&&t.createVNode(t.resolveComponent("d-icon"),{name:d.name,color:d.color,class:"devui-popover-icon",size:"16px"},null),((C=n.content)==null?void 0:C.call(n))||t.createVNode("span",null,[m.value]),t.createVNode("span",{class:"after",style:y},null)])])}}});l.install=function(e){e.component(l.name,l)};var E={title:"Popover \u60AC\u6D6E\u63D0\u793A",category:"\u53CD\u9988",status:"100%",install(e){e.use(l)}};o.Popover=l,o.default=E,Object.defineProperty(o,"__esModule",{value:!0}),o[Symbol.toStringTag]="Module"});
|
package/progress/index.es.js
CHANGED
|
@@ -93,13 +93,13 @@ var Progress = defineComponent({
|
|
|
93
93
|
$slots
|
|
94
94
|
} = this;
|
|
95
95
|
const progressLine = createVNode("div", {
|
|
96
|
-
"
|
|
96
|
+
"class": "devui-progress--line",
|
|
97
97
|
"style": {
|
|
98
98
|
height,
|
|
99
99
|
borderRadius: height
|
|
100
100
|
}
|
|
101
101
|
}, [createVNode("div", {
|
|
102
|
-
"
|
|
102
|
+
"class": "devui-progress-bar",
|
|
103
103
|
"style": {
|
|
104
104
|
height,
|
|
105
105
|
borderRadius: height,
|
|
@@ -112,21 +112,21 @@ var Progress = defineComponent({
|
|
|
112
112
|
}
|
|
113
113
|
}, [percentageText])]);
|
|
114
114
|
const textElement = createVNode("span", {
|
|
115
|
-
"
|
|
115
|
+
"class": "devui-progress-circle-text"
|
|
116
116
|
}, [percentage, createTextVNode("%")]);
|
|
117
117
|
const progressCircle = createVNode("div", {
|
|
118
|
-
"
|
|
118
|
+
"class": "devui-progress-circle"
|
|
119
119
|
}, [createVNode("svg", {
|
|
120
|
-
"
|
|
120
|
+
"class": "devui-progress-circle",
|
|
121
121
|
"viewBox": "0 0 100 100"
|
|
122
122
|
}, [createVNode("path", {
|
|
123
|
-
"
|
|
123
|
+
"class": "devui-progress-circle-trail",
|
|
124
124
|
"fill-opacity": "0",
|
|
125
125
|
"stroke-width": strokeWidth,
|
|
126
126
|
"style": data.trailPath,
|
|
127
127
|
"d": data.pathString
|
|
128
128
|
}, null), createVNode("path", {
|
|
129
|
-
"
|
|
129
|
+
"class": "devui-progress-circle-path",
|
|
130
130
|
"d": data.pathString,
|
|
131
131
|
"stroke-linecap": "round",
|
|
132
132
|
"fill-opacity": "0",
|
|
@@ -135,7 +135,7 @@ var Progress = defineComponent({
|
|
|
135
135
|
"style": data.strokePath
|
|
136
136
|
}, null)]), showContent && ((_a = $slots.default) == null ? void 0 : _a.call($slots)), showContent && !$slots.default && textElement]);
|
|
137
137
|
return createVNode("div", {
|
|
138
|
-
"
|
|
138
|
+
"class": "devui-progress"
|
|
139
139
|
}, [!isCircle ? progressLine : progressCircle]);
|
|
140
140
|
}
|
|
141
141
|
});
|
|
@@ -145,7 +145,7 @@ Progress.install = function(app) {
|
|
|
145
145
|
var index = {
|
|
146
146
|
title: "Progress \u8FDB\u5EA6\u6761",
|
|
147
147
|
category: "\u6570\u636E\u5C55\u793A",
|
|
148
|
-
status: "
|
|
148
|
+
status: "100%",
|
|
149
149
|
install(app) {
|
|
150
150
|
app.use(Progress);
|
|
151
151
|
}
|
package/progress/index.umd.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(function(s,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(s=typeof globalThis!="undefined"?globalThis:s||self,e(s.index={},s.Vue))})(this,function(s,e){"use strict";var
|
|
2
|
-
a ${
|
|
3
|
-
a ${
|
|
1
|
+
(function(s,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(s=typeof globalThis!="undefined"?globalThis:s||self,e(s.index={},s.Vue))})(this,function(s,e){"use strict";var P="",i=e.defineComponent({name:"DProgress",props:{height:{type:String,default:"20px"},percentage:{type:Number,default:0},percentageText:{type:String,default:""},barBgColor:{type:String,default:"#5170ff"},isCircle:{type:Boolean,default:!1},strokeWidth:{type:Number,default:6},showContent:{type:Boolean,default:!0}},setup(t){const{height:n,percentage:p,percentageText:u,barBgColor:h,isCircle:l,strokeWidth:d,showContent:a}=e.toRefs(t),r=e.reactive({pathString:"",trailPath:null,strokePath:null}),g=()=>{if(!l)return;const o=50-d.value/2,k=-o,c=o*-2;r.pathString=`M 50,50 m 0,${k}
|
|
2
|
+
a ${o},${o} 0 1 1 0,${-c}
|
|
3
|
+
a ${o},${o} 0 1 1 0,${c}`;const f=Math.PI*2*o;r.trailPath={stroke:"#dfe1e6",strokeDasharray:`${f}px ${f}px`,strokeDashoffset:"0",transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s"},r.strokePath={stroke:h||null,strokeDasharray:`${p.value/100*f}px ${f}px`,strokeDashoffset:"0",transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"}};return g(),e.watch([n,p,u,h,l,d,a],()=>{g()}),{data:r}},render(){var c;const{height:t,percentage:n,percentageText:p,barBgColor:u,isCircle:h,strokeWidth:l,showContent:d,data:a,$slots:r}=this,g=e.createVNode("div",{class:"devui-progress--line",style:{height:t,borderRadius:t}},[e.createVNode("div",{class:"devui-progress-bar",style:{height:t,borderRadius:t,width:`${n}%`,backgroundColor:u}},null),e.createVNode("span",{style:{lineHeight:t}},[p])]),o=e.createVNode("span",{class:"devui-progress-circle-text"},[n,e.createTextVNode("%")]),k=e.createVNode("div",{class:"devui-progress-circle"},[e.createVNode("svg",{class:"devui-progress-circle",viewBox:"0 0 100 100"},[e.createVNode("path",{class:"devui-progress-circle-trail","fill-opacity":"0","stroke-width":l,style:a.trailPath,d:a.pathString},null),e.createVNode("path",{class:"devui-progress-circle-path",d:a.pathString,"stroke-linecap":"round","fill-opacity":"0",stroke:u,"stroke-width":n?l:0,style:a.strokePath},null)]),d&&((c=r.default)==null?void 0:c.call(r)),d&&!r.default&&o]);return e.createVNode("div",{class:"devui-progress"},[h?k:g])}});i.install=function(t){t.component(i.name,i)};var y={title:"Progress \u8FDB\u5EA6\u6761",category:"\u6570\u636E\u5C55\u793A",status:"100%",install(t){t.use(i)}};s.Progress=i,s.default=y,Object.defineProperty(s,"__esModule",{value:!0}),s[Symbol.toStringTag]="Module"});
|
package/radio/index.d.ts
ADDED
package/radio/index.es.js
CHANGED
|
@@ -48,7 +48,7 @@ const radioGroupProps = __spreadProps(__spreadValues({}, radioCommonProps), {
|
|
|
48
48
|
type: Array,
|
|
49
49
|
default: null
|
|
50
50
|
},
|
|
51
|
-
|
|
51
|
+
direction: {
|
|
52
52
|
type: String,
|
|
53
53
|
default: "column"
|
|
54
54
|
}
|
|
@@ -179,8 +179,8 @@ var RadioGroup = defineComponent({
|
|
|
179
179
|
},
|
|
180
180
|
render() {
|
|
181
181
|
const {
|
|
182
|
-
|
|
183
|
-
|
|
182
|
+
values,
|
|
183
|
+
direction
|
|
184
184
|
} = this;
|
|
185
185
|
const getContent = () => {
|
|
186
186
|
const defaultSlot = this.$slots.default;
|
|
@@ -201,8 +201,8 @@ var RadioGroup = defineComponent({
|
|
|
201
201
|
};
|
|
202
202
|
return createVNode("div", {
|
|
203
203
|
"class": ["devui-radio-group", {
|
|
204
|
-
"is-row":
|
|
205
|
-
"is-column":
|
|
204
|
+
"is-row": direction === "row",
|
|
205
|
+
"is-column": direction === "column"
|
|
206
206
|
}]
|
|
207
207
|
}, [getContent()]);
|
|
208
208
|
}
|
|
@@ -216,7 +216,7 @@ RadioGroup.install = function(app) {
|
|
|
216
216
|
var index = {
|
|
217
217
|
title: "Radio \u5355\u9009\u6846",
|
|
218
218
|
category: "\u6570\u636E\u5F55\u5165",
|
|
219
|
-
status: "
|
|
219
|
+
status: "100%",
|
|
220
220
|
install(app) {
|
|
221
221
|
app.use(Radio);
|
|
222
222
|
app.use(RadioGroup);
|
package/radio/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var S=Object.defineProperty,j=Object.defineProperties;var P=Object.getOwnPropertyDescriptors;var C=Object.getOwnPropertySymbols;var k=Object.prototype.hasOwnProperty,x=Object.prototype.propertyIsEnumerable;var V=(n,e,o)=>e in n?S(n,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):n[e]=o,p=(n,e)=>{for(var o in e||(e={}))k.call(e,o)&&V(n,o,e[o]);if(C)for(var o of C(e))x.call(e,o)&&V(n,o,e[o]);return n},y=(n,e)=>j(n,P(e));(function(n,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(n=typeof globalThis!="undefined"?globalThis:n||self,e(n.index={},n.Vue))})(this,function(n,e){"use strict";const o={modelValue:{type:String,default:null},name:{type:String,default:null},beforeChange:{type:Function,default:null},disabled:{type:Boolean,default:!1}},v=y(p({},o),{value:{type:String,required:!0,default:null}}),N=y(p({},o),{values:{type:Array,default:null},direction:{type:String,default:"column"}}),b=Symbol("DRadioGroup");var D="",s=e.defineComponent({name:"DRadio",props:v,emits:["change","update:modelValue"],setup(a,{emit:d}){const t=e.inject(b,null),i=e.computed(()=>a.disabled||(t==null?void 0:t.disabled.value)),l=e.computed(()=>{const r=t?t.modelValue.value:a.modelValue;return a.value===r}),h=e.computed(()=>t?t.name.value:a.name),g=r=>{const u=a.beforeChange||(t?t.beforeChange:null);let f=Promise.resolve(!0);if(u){const m=u(r);if(typeof m=="undefined")return f;typeof m=="boolean"?f=Promise.resolve(m):f=m}return f};return{isChecked:l,radioName:h,disabled:i,handleChange:async r=>{const u=a.value;if(!await g(u)){r.preventDefault();return}t==null||t.emitChange(u),d("update:modelValue",u),d("change",u)}}},render(){var r;const{disabled:a,radioName:d,value:t,isChecked:i,$slots:l,handleChange:h}=this,g=["devui-radio",{active:i,disabled:a}];return e.createVNode("label",{class:g},[e.createVNode("input",{type:"radio",name:d,class:"devui-radio-input",disabled:a,onChange:h,value:t,checked:i},null),e.createVNode("span",{class:"devui-radio-material"},[e.createVNode("svg",{height:"100%",width:"100%",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},[e.createVNode("circle",{class:"devui-radio-material-outer",cx:"512",cy:"512",r:"486.5","stroke-width":"51"},null),e.createVNode("circle",{class:"devui-radio-material-inner",cx:"512","fill-rule":"nonzero",cy:"512",r:"320"},null)])]),e.createVNode("span",{class:"devui-radio-label"},[(r=l.default)==null?void 0:r.call(l)])])}}),_="";function R(a){return typeof a=="function"||Object.prototype.toString.call(a)==="[object Object]"&&!e.isVNode(a)}var c=e.defineComponent({name:"DRadioGroup",props:N,emits:["change","update:modelValue"],setup(a,{emit:d}){const t=i=>{d("update:modelValue",i),d("change",i)};e.provide(b,{modelValue:e.toRef(a,"modelValue"),name:e.toRef(a,"name"),disabled:e.toRef(a,"disabled"),beforeChange:a.beforeChange,emitChange:t})},render(){const{values:a,direction:d}=this,t=()=>{const i=this.$slots.default;return i?i():Array.isArray(a)?a.map(l=>e.createVNode(s,{key:l,value:l},R(l)?l:{default:()=>[l]})):""};return e.createVNode("div",{class:["devui-radio-group",{"is-row":d==="row","is-column":d==="column"}]},[t()])}});s.install=function(a){a.component(s.name,s)},c.install=function(a){a.component(c.name,c)};var w={title:"Radio \u5355\u9009\u6846",category:"\u6570\u636E\u5F55\u5165",status:"100%",install(a){a.use(s),a.use(c)}};n.Radio=s,n.RadioGroup=c,n.default=w,Object.defineProperty(n,"__esModule",{value:!0}),n[Symbol.toStringTag]="Module"});
|
package/rate/index.d.ts
ADDED
package/rate/index.es.js
CHANGED
package/rate/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(i,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(i=typeof globalThis!="undefined"?globalThis:i||self,t(i.index={},i.Vue))})(this,function(i,t){"use strict";const g={modelValue:{type:Number},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}};var V="",d=t.defineComponent({name:"DRate",props:g,emits:["change","update:modelValue"],setup(o,h){const r=t.reactive([]),a=t.ref(0),l=(n,e,c)=>{for(let s=n;s<e;s++)r[s].width=c},u=()=>{if(!o.modelValue)return;a.value=o.modelValue-1;const n=a.value%1,e=Math.floor(a.value);l(0,e+1,"100%"),n>0?(r[e+1].width=n*100+"%",l(e+2,o.count,"0")):l(e+1,o.count,"0")};return t.onMounted(()=>{for(let n=0;n<o.count;n++)r.push({width:"0"});u()}),{totalLevelArray:r,chooseValue:a,hoverToggle:(n,e,c=!1)=>{o.read||(c?a.value>=0?(l(0,a.value+1,"100%"),l(a.value+1,o.count,"0")):l(0,o.count,"0"):(l(0,e+1,"100%"),o.allowHalf&&n.offsetX*2<=n.target.clientWidth?l(e,e+1,"50%"):l(e,e+1,"100%"),l(e+1,o.count,"0")))},selectValue:(n,e)=>{o.read||(l(0,e,"100%"),o.allowHalf&&n.offsetX*2<=n.target.clientWidth?(l(e,e+1,"50%"),a.value=e-.5):(l(e,e+1,"100%"),a.value=e),l(e+1,o.count,"0"),e=a.value,o.onChange&&o.onChange(e+1),o.onTouched&&o.onTouched(),h.emit("update:modelValue",e+1))}}},render(){const{totalLevelArray:o,chooseValue:h,icon:r,character:a,read:l,type:u,color:f,hoverToggle:v,selectValue:n}=this;return t.createVNode("div",{class:"devui-star-container",onMouseleave:e=>v(e,h,!0)},[o.map((e,c)=>t.createVNode("div",{class:`devui-star-align devui-pointer ${l?"devui-only-read":""}`,key:c,onMouseover:s=>v(s,c),onClick:s=>n(s,c)},[r&&!a&&t.createVNode("span",{class:"devui-star-color"},[t.createVNode(t.resolveComponent("d-icon"),{name:r},null)]),a&&!r&&t.createVNode("span",{class:"devui-star-color"},[a]),!r&&!a&&t.createVNode("span",{class:"devui-star-color"},[t.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"},[t.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[t.createVNode("g",{fill:"#E3E5E9",id:"Mask"},[t.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)])])])]),r&&!a&&t.createVNode("span",{class:`devui-star-color-active devui-active-star devui-star-color-${u}`,style:{width:e.width}},[t.createVNode(t.resolveComponent("d-icon"),{name:r,color:f},null)]),a&&!r&&t.createVNode("span",{class:`devui-star-color-active devui-active-star devui-star-color-${u}`,style:{color:f,width:e.width}},[a]),!a&&!r&&t.createVNode("span",{class:`devui-star-color-active devui-active-star devui-star-color-${u}`,style:{color:f,width:e.width}},[t.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"},[t.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[t.createVNode("g",{id:"Mask"},[t.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)])])])])]))])}});d.install=function(o){o.component(d.name,d)};var w={title:"Rate \u8BC4\u5206",category:"\u6570\u636E\u5C55\u793A",status:"
|
|
1
|
+
(function(i,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(i=typeof globalThis!="undefined"?globalThis:i||self,t(i.index={},i.Vue))})(this,function(i,t){"use strict";const g={modelValue:{type:Number},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}};var V="",d=t.defineComponent({name:"DRate",props:g,emits:["change","update:modelValue"],setup(o,h){const r=t.reactive([]),a=t.ref(0),l=(n,e,c)=>{for(let s=n;s<e;s++)r[s].width=c},u=()=>{if(!o.modelValue)return;a.value=o.modelValue-1;const n=a.value%1,e=Math.floor(a.value);l(0,e+1,"100%"),n>0?(r[e+1].width=n*100+"%",l(e+2,o.count,"0")):l(e+1,o.count,"0")};return t.onMounted(()=>{for(let n=0;n<o.count;n++)r.push({width:"0"});u()}),{totalLevelArray:r,chooseValue:a,hoverToggle:(n,e,c=!1)=>{o.read||(c?a.value>=0?(l(0,a.value+1,"100%"),l(a.value+1,o.count,"0")):l(0,o.count,"0"):(l(0,e+1,"100%"),o.allowHalf&&n.offsetX*2<=n.target.clientWidth?l(e,e+1,"50%"):l(e,e+1,"100%"),l(e+1,o.count,"0")))},selectValue:(n,e)=>{o.read||(l(0,e,"100%"),o.allowHalf&&n.offsetX*2<=n.target.clientWidth?(l(e,e+1,"50%"),a.value=e-.5):(l(e,e+1,"100%"),a.value=e),l(e+1,o.count,"0"),e=a.value,o.onChange&&o.onChange(e+1),o.onTouched&&o.onTouched(),h.emit("update:modelValue",e+1))}}},render(){const{totalLevelArray:o,chooseValue:h,icon:r,character:a,read:l,type:u,color:f,hoverToggle:v,selectValue:n}=this;return t.createVNode("div",{class:"devui-star-container",onMouseleave:e=>v(e,h,!0)},[o.map((e,c)=>t.createVNode("div",{class:`devui-star-align devui-pointer ${l?"devui-only-read":""}`,key:c,onMouseover:s=>v(s,c),onClick:s=>n(s,c)},[r&&!a&&t.createVNode("span",{class:"devui-star-color"},[t.createVNode(t.resolveComponent("d-icon"),{name:r},null)]),a&&!r&&t.createVNode("span",{class:"devui-star-color"},[a]),!r&&!a&&t.createVNode("span",{class:"devui-star-color"},[t.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"},[t.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[t.createVNode("g",{fill:"#E3E5E9",id:"Mask"},[t.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)])])])]),r&&!a&&t.createVNode("span",{class:`devui-star-color-active devui-active-star devui-star-color-${u}`,style:{width:e.width}},[t.createVNode(t.resolveComponent("d-icon"),{name:r,color:f},null)]),a&&!r&&t.createVNode("span",{class:`devui-star-color-active devui-active-star devui-star-color-${u}`,style:{color:f,width:e.width}},[a]),!a&&!r&&t.createVNode("span",{class:`devui-star-color-active devui-active-star devui-star-color-${u}`,style:{color:f,width:e.width}},[t.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"},[t.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[t.createVNode("g",{id:"Mask"},[t.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)])])])])]))])}});d.install=function(o){o.component(d.name,d)};var w={title:"Rate \u8BC4\u5206",category:"\u6570\u636E\u5C55\u793A",status:"100%",install(o){o.use(d)}};i.Rate=d,i.default=w,Object.defineProperty(i,"__esModule",{value:!0}),i[Symbol.toStringTag]="Module"});
|