vue-devui 1.0.0-rc.9 → 1.0.0
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 +163 -149
- package/alert/index.es.js +12 -7
- package/alert/index.umd.js +1 -1
- package/alert/style.css +1 -1
- package/auto-complete/index.es.js +8019 -254
- package/auto-complete/index.umd.js +29 -3
- package/auto-complete/style.css +1 -1
- package/badge/index.es.js +8 -2
- package/badge/index.umd.js +1 -1
- package/badge/style.css +1 -1
- package/button/index.es.js +104 -40
- package/button/index.umd.js +15 -15
- package/button/style.css +1 -1
- package/card/index.es.js +5 -1
- package/card/index.umd.js +1 -1
- package/card/style.css +1 -1
- package/checkbox/index.es.js +7772 -81
- package/checkbox/index.umd.js +27 -1
- package/checkbox/style.css +1 -1
- package/{date-picker → collapse}/index.d.ts +0 -0
- package/collapse/index.es.js +213 -0
- package/collapse/index.umd.js +1 -0
- package/{date-picker → collapse}/package.json +1 -1
- package/collapse/style.css +1 -0
- package/countdown/index.es.js +56 -13
- package/countdown/index.umd.js +1 -1
- package/date-picker-pro/index.d.ts +7 -0
- package/date-picker-pro/index.es.js +12020 -0
- package/date-picker-pro/index.umd.js +27 -0
- package/date-picker-pro/package.json +7 -0
- package/date-picker-pro/style.css +1 -0
- package/drawer/index.es.js +1 -1
- package/drawer/index.umd.js +1 -1
- package/drawer/style.css +1 -1
- package/dropdown/index.es.js +77 -121
- package/dropdown/index.umd.js +1 -1
- package/dropdown/style.css +1 -1
- package/editable-select/index.es.js +324 -104
- package/editable-select/index.umd.js +1 -1
- package/editable-select/style.css +1 -1
- package/form/index.es.js +91 -118
- package/form/index.umd.js +14 -14
- package/form/style.css +1 -1
- package/icon/index.es.js +106 -41
- package/icon/index.umd.js +1 -1
- package/icon/style.css +1 -1
- package/image-preview/style.css +1 -1
- package/input/index.es.js +8088 -169
- package/input/index.umd.js +27 -1
- package/input/style.css +1 -1
- package/input-number/index.es.js +8 -9
- package/input-number/index.umd.js +1 -1
- package/input-number/style.css +1 -1
- package/layout/index.es.js +1 -1
- package/layout/index.umd.js +1 -1
- package/loading/style.css +1 -1
- package/mention/index.d.ts +7 -0
- package/mention/index.es.js +8310 -0
- package/mention/index.umd.js +36 -0
- package/mention/package.json +7 -0
- package/mention/style.css +1 -0
- package/menu/index.d.ts +7 -0
- package/menu/index.es.js +934 -0
- package/menu/index.umd.js +1 -0
- package/menu/package.json +7 -0
- package/menu/style.css +1 -0
- package/message/index.d.ts +7 -0
- package/message/index.es.js +538 -0
- package/message/index.umd.js +1 -0
- package/message/package.json +7 -0
- package/message/style.css +1 -0
- package/modal/index.es.js +275 -185
- package/modal/index.umd.js +1 -1
- package/modal/style.css +1 -1
- package/notification/index.es.js +143 -72
- package/notification/index.umd.js +1 -1
- package/notification/style.css +1 -1
- package/nuxt/components/Collapse.js +3 -0
- package/nuxt/components/CollapseItem.js +3 -0
- package/nuxt/components/DRangeDatePickerPro.js +3 -0
- package/nuxt/components/DatePickerPro.js +3 -0
- package/nuxt/components/IconGroup.js +3 -0
- package/nuxt/components/Mention.js +3 -0
- package/nuxt/components/Menu.js +3 -0
- package/nuxt/components/MenuItem.js +3 -0
- package/nuxt/components/Message.js +3 -0
- package/nuxt/components/OptionGroup.js +3 -0
- package/nuxt/components/RadioButton.js +3 -0
- package/nuxt/components/Step.js +3 -0
- package/nuxt/components/Steps.js +3 -0
- package/nuxt/components/SubMenu.js +3 -0
- package/nuxt/components/TABLE_TOKEN.js +3 -0
- package/nuxt/components/TimePicker.js +3 -0
- package/nuxt/components/TimeSelect.js +3 -0
- package/nuxt/components/animationInjectionKey.js +3 -0
- package/nuxt/components/collapseItemProps.js +3 -0
- package/nuxt/components/collapseProps.js +3 -0
- package/nuxt/components/datePickerProCommonProps.js +3 -0
- package/nuxt/components/datePickerProPanelProps.js +3 -0
- package/nuxt/components/datePickerProProps.js +3 -0
- package/nuxt/components/mentionProps.js +3 -0
- package/nuxt/components/messageProps.js +3 -0
- package/nuxt/components/roundInjectionKey.js +3 -0
- package/nuxt/components/skeletonItemProps.js +3 -0
- package/nuxt/components/stepProps.js +3 -0
- package/nuxt/components/stepsProps.js +3 -0
- package/nuxt/components/tableProps.js +3 -0
- package/nuxt/components/timerPickerPanelProps.js +3 -0
- package/nuxt/components/treeNodeProps.js +3 -0
- package/overlay/index.es.js +76 -139
- package/overlay/index.umd.js +1 -1
- package/overlay/style.css +1 -1
- package/package.json +6 -3
- package/pagination/index.es.js +175 -7
- package/pagination/index.umd.js +1 -1
- package/pagination/style.css +1 -1
- package/panel/style.css +1 -1
- package/popover/index.es.js +101 -162
- package/popover/index.umd.js +17 -17
- package/popover/style.css +1 -1
- package/progress/style.css +1 -1
- package/radio/index.es.js +7854 -58
- package/radio/index.umd.js +27 -1
- package/radio/style.css +1 -1
- package/rate/style.css +1 -1
- package/result/index.es.js +92 -41
- package/result/index.umd.js +1 -1
- package/result/style.css +1 -1
- package/search/index.es.js +3729 -1206
- package/search/index.umd.js +18 -18
- package/search/style.css +1 -1
- package/select/index.es.js +4426 -2501
- package/select/index.umd.js +17 -17
- package/select/style.css +1 -1
- package/skeleton/index.es.js +87 -261
- package/skeleton/index.umd.js +1 -1
- package/skeleton/style.css +1 -1
- package/slider/index.es.js +116 -143
- package/slider/index.umd.js +1 -1
- package/slider/style.css +1 -1
- package/splitter/index.es.js +256 -147
- package/splitter/index.umd.js +16 -16
- package/splitter/style.css +1 -1
- package/statistic/index.es.js +34 -16
- package/statistic/index.umd.js +1 -1
- package/statistic/style.css +1 -1
- package/status/style.css +1 -1
- package/steps/index.d.ts +7 -0
- package/steps/index.es.js +386 -0
- package/steps/index.umd.js +1 -0
- package/steps/package.json +7 -0
- package/steps/style.css +1 -0
- package/style.css +1 -1
- package/switch/index.es.js +7779 -60
- package/switch/index.umd.js +27 -1
- package/switch/style.css +1 -1
- package/table/index.es.js +4092 -1464
- package/table/index.umd.js +17 -17
- package/table/style.css +1 -1
- package/tabs/index.es.js +224 -77
- package/tabs/index.umd.js +1 -1
- package/tabs/style.css +1 -1
- package/tag/index.es.js +5 -1
- package/tag/index.umd.js +1 -1
- package/tag/style.css +1 -1
- package/textarea/index.es.js +3357 -1064
- package/textarea/index.umd.js +19 -19
- package/textarea/style.css +1 -1
- package/time-picker/index.d.ts +7 -0
- package/time-picker/index.es.js +9549 -0
- package/time-picker/index.umd.js +27 -0
- package/time-picker/package.json +7 -0
- package/time-picker/style.css +1 -0
- package/time-select/index.d.ts +7 -0
- package/time-select/index.es.js +9585 -0
- package/time-select/index.umd.js +27 -0
- package/time-select/package.json +7 -0
- package/time-select/style.css +1 -0
- package/timeline/index.es.js +92 -41
- package/timeline/index.umd.js +1 -1
- package/timeline/style.css +1 -1
- package/tooltip/index.es.js +100 -163
- package/tooltip/index.umd.js +16 -16
- package/tooltip/style.css +1 -1
- package/tree/index.es.js +11036 -608
- package/tree/index.umd.js +27 -1
- package/tree/style.css +1 -1
- package/upload/index.es.js +389 -105
- package/upload/index.umd.js +1 -1
- package/upload/style.css +1 -1
- package/vue-devui.es.js +17291 -9726
- package/vue-devui.umd.js +24 -23
- package/date-picker/index.es.js +0 -1298
- package/date-picker/index.umd.js +0 -1
- package/date-picker/style.css +0 -1
- package/nuxt/components/DatePicker.js +0 -3
- package/nuxt/components/StickSlider.js +0 -3
- package/nuxt/components/formControlProps.js +0 -3
- package/nuxt/components/overlayEmits.js +0 -3
- package/nuxt/components/overlayProps.js +0 -3
package/notification/index.es.js
CHANGED
|
@@ -39,9 +39,6 @@ const notificationProps = {
|
|
|
39
39
|
type: Function
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
|
-
function isUrl(value) {
|
|
43
|
-
return /^((http|https):)?\/\//.test(value);
|
|
44
|
-
}
|
|
45
42
|
const DEFAULT_PREFIX = "icon";
|
|
46
43
|
const iconProps = {
|
|
47
44
|
name: {
|
|
@@ -64,6 +61,17 @@ const iconProps = {
|
|
|
64
61
|
classPrefix: {
|
|
65
62
|
type: String,
|
|
66
63
|
default: DEFAULT_PREFIX
|
|
64
|
+
},
|
|
65
|
+
operable: {
|
|
66
|
+
type: Boolean,
|
|
67
|
+
default: false
|
|
68
|
+
},
|
|
69
|
+
disabled: {
|
|
70
|
+
type: Boolean,
|
|
71
|
+
default: false
|
|
72
|
+
},
|
|
73
|
+
rotate: {
|
|
74
|
+
type: [Number, String]
|
|
67
75
|
}
|
|
68
76
|
};
|
|
69
77
|
const svgIconProps = {
|
|
@@ -134,51 +142,107 @@ var svgIcon = defineComponent({
|
|
|
134
142
|
};
|
|
135
143
|
}
|
|
136
144
|
});
|
|
145
|
+
function isUrl(value) {
|
|
146
|
+
return /^((http|https):)?\/\//.test(value);
|
|
147
|
+
}
|
|
148
|
+
function useIconDom(props, ctx) {
|
|
149
|
+
const {
|
|
150
|
+
component,
|
|
151
|
+
name,
|
|
152
|
+
size,
|
|
153
|
+
color,
|
|
154
|
+
classPrefix,
|
|
155
|
+
rotate
|
|
156
|
+
} = toRefs(props);
|
|
157
|
+
const ns2 = useNamespace("icon");
|
|
158
|
+
const iconSize = computed(() => {
|
|
159
|
+
return typeof size.value === "number" ? `${size.value}px` : size.value;
|
|
160
|
+
});
|
|
161
|
+
const IconComponent = component.value ? resolveDynamicComponent(component.value) : resolveDynamicComponent(svgIcon);
|
|
162
|
+
const imgIconDom = () => {
|
|
163
|
+
return createVNode("img", mergeProps({
|
|
164
|
+
"src": name.value,
|
|
165
|
+
"alt": name.value.split("/")[name.value.split("/").length - 1],
|
|
166
|
+
"class": [(rotate == null ? void 0 : rotate.value) === "infinite" && ns2.m("spin")],
|
|
167
|
+
"style": {
|
|
168
|
+
width: iconSize.value || "",
|
|
169
|
+
transform: `rotate(${rotate == null ? void 0 : rotate.value}deg)`,
|
|
170
|
+
verticalAlign: "middle"
|
|
171
|
+
}
|
|
172
|
+
}, ctx.attrs), null);
|
|
173
|
+
};
|
|
174
|
+
const svgIconDom = () => {
|
|
175
|
+
return createVNode(IconComponent, mergeProps({
|
|
176
|
+
"name": name.value,
|
|
177
|
+
"color": color.value,
|
|
178
|
+
"size": iconSize.value,
|
|
179
|
+
"class": [(rotate == null ? void 0 : rotate.value) === "infinite" && ns2.m("spin")],
|
|
180
|
+
"style": {
|
|
181
|
+
transform: `rotate(${rotate == null ? void 0 : rotate.value}deg)`
|
|
182
|
+
}
|
|
183
|
+
}, ctx.attrs), null);
|
|
184
|
+
};
|
|
185
|
+
const fontIconDom = () => {
|
|
186
|
+
const fontIconClass = /^icon-/.test(name.value) ? name.value : `${classPrefix.value}-${name.value}`;
|
|
187
|
+
return createVNode("i", mergeProps({
|
|
188
|
+
"class": [classPrefix.value, fontIconClass, (rotate == null ? void 0 : rotate.value) === "infinite" && ns2.m("spin")],
|
|
189
|
+
"style": {
|
|
190
|
+
fontSize: iconSize.value,
|
|
191
|
+
color: color.value,
|
|
192
|
+
transform: `rotate(${rotate == null ? void 0 : rotate.value}deg)`
|
|
193
|
+
}
|
|
194
|
+
}, ctx.attrs), null);
|
|
195
|
+
};
|
|
196
|
+
const iconDom = () => {
|
|
197
|
+
return component.value ? svgIconDom() : isUrl(name.value) ? imgIconDom() : fontIconDom();
|
|
198
|
+
};
|
|
199
|
+
return {
|
|
200
|
+
iconDom
|
|
201
|
+
};
|
|
202
|
+
}
|
|
137
203
|
var Icon = defineComponent({
|
|
138
204
|
name: "DIcon",
|
|
139
205
|
props: iconProps,
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
}) {
|
|
206
|
+
emits: ["click"],
|
|
207
|
+
setup(props, ctx) {
|
|
143
208
|
const {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
size,
|
|
147
|
-
color,
|
|
148
|
-
classPrefix
|
|
209
|
+
disabled,
|
|
210
|
+
operable
|
|
149
211
|
} = toRefs(props);
|
|
150
|
-
const
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
const
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
"alt": name.value.split("/")[name.value.split("/").length - 1],
|
|
165
|
-
"style": {
|
|
166
|
-
width: iconSize.value || ""
|
|
167
|
-
}
|
|
168
|
-
}, attrs), null);
|
|
212
|
+
const {
|
|
213
|
+
iconDom
|
|
214
|
+
} = useIconDom(props, ctx);
|
|
215
|
+
const ns2 = useNamespace("icon");
|
|
216
|
+
const wrapClassed = computed(() => ({
|
|
217
|
+
[ns2.e("container")]: true,
|
|
218
|
+
[ns2.m("disabled")]: disabled.value,
|
|
219
|
+
[ns2.m("operable")]: operable.value
|
|
220
|
+
}));
|
|
221
|
+
const onClick = (e) => {
|
|
222
|
+
if (disabled.value) {
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
ctx.emit("click", e);
|
|
169
226
|
};
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
return createVNode("
|
|
173
|
-
"class":
|
|
174
|
-
"
|
|
175
|
-
|
|
176
|
-
color: color.value
|
|
177
|
-
}
|
|
178
|
-
}, attrs), null);
|
|
227
|
+
return () => {
|
|
228
|
+
var _a, _b, _c, _d;
|
|
229
|
+
return createVNode("div", {
|
|
230
|
+
"class": wrapClassed.value,
|
|
231
|
+
"onClick": onClick
|
|
232
|
+
}, [(_b = (_a = ctx.slots).prefix) == null ? void 0 : _b.call(_a), iconDom(), (_d = (_c = ctx.slots).suffix) == null ? void 0 : _d.call(_c)]);
|
|
179
233
|
};
|
|
234
|
+
}
|
|
235
|
+
});
|
|
236
|
+
var iconGroup = "";
|
|
237
|
+
defineComponent({
|
|
238
|
+
name: "DIconGroup",
|
|
239
|
+
setup(_, ctx) {
|
|
240
|
+
const ns2 = useNamespace("icon-group");
|
|
180
241
|
return () => {
|
|
181
|
-
|
|
242
|
+
var _a, _b;
|
|
243
|
+
return createVNode("div", {
|
|
244
|
+
"class": ns2.b()
|
|
245
|
+
}, [(_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)]);
|
|
182
246
|
};
|
|
183
247
|
}
|
|
184
248
|
});
|
|
@@ -198,15 +262,20 @@ var Close = defineComponent({
|
|
|
198
262
|
}
|
|
199
263
|
});
|
|
200
264
|
const ns = useNamespace("notification");
|
|
265
|
+
const XLINK = {
|
|
266
|
+
"xmlns:xlink": "http://www.w3.org/1999/xlink"
|
|
267
|
+
};
|
|
268
|
+
const XLINK_HREF = {
|
|
269
|
+
"xlink:href": "#path-s"
|
|
270
|
+
};
|
|
201
271
|
function SuccessIcon() {
|
|
202
|
-
return createVNode("svg", {
|
|
272
|
+
return createVNode("svg", mergeProps({
|
|
203
273
|
"width": "16px",
|
|
204
274
|
"height": "16px",
|
|
205
275
|
"viewBox": "0 0 16 16",
|
|
206
276
|
"version": "1.1",
|
|
207
|
-
"xmlns": "http://www.w3.org/2000/svg"
|
|
208
|
-
|
|
209
|
-
}, [createVNode("defs", null, [createVNode("polygon", {
|
|
277
|
+
"xmlns": "http://www.w3.org/2000/svg"
|
|
278
|
+
}, XLINK), [createVNode("defs", null, [createVNode("polygon", {
|
|
210
279
|
"id": "path-s",
|
|
211
280
|
"points": "6.53553391 9.77817459 12.1923882 4.12132034 13.6066017 5.53553391 6.53553391 12.6066017 3 9.07106781 4.41421356 7.65685425 6.53553391 9.77817459"
|
|
212
281
|
}, null)]), createVNode("g", {
|
|
@@ -218,30 +287,26 @@ function SuccessIcon() {
|
|
|
218
287
|
}, [createVNode("mask", {
|
|
219
288
|
"id": "mask-2",
|
|
220
289
|
"fill": "white"
|
|
221
|
-
}, [createVNode("use", {
|
|
222
|
-
"xlink:href": "#path-s"
|
|
223
|
-
}, null)]), createVNode("use", {
|
|
290
|
+
}, [createVNode("use", XLINK_HREF, null)]), createVNode("use", mergeProps({
|
|
224
291
|
"id": "Mask",
|
|
225
|
-
"class": ns.e("image-success-path")
|
|
226
|
-
|
|
227
|
-
}, null)])]);
|
|
292
|
+
"class": ns.e("image-success-path")
|
|
293
|
+
}, XLINK_HREF), null)])]);
|
|
228
294
|
}
|
|
229
295
|
function WarningIcon() {
|
|
230
|
-
return createVNode("svg", {
|
|
296
|
+
return createVNode("svg", mergeProps({
|
|
231
297
|
"width": "16px",
|
|
232
298
|
"height": "16px",
|
|
233
299
|
"viewBox": "0 0 16 16",
|
|
234
300
|
"version": "1.1",
|
|
235
|
-
"xmlns": "http://www.w3.org/2000/svg"
|
|
236
|
-
|
|
237
|
-
}, [createVNode("g", {
|
|
301
|
+
"xmlns": "http://www.w3.org/2000/svg"
|
|
302
|
+
}, XLINK), [createVNode("g", {
|
|
238
303
|
"stroke": "none",
|
|
239
304
|
"stroke-width": "1",
|
|
240
305
|
"fill": "none",
|
|
241
306
|
"fill-rule": "evenodd"
|
|
242
307
|
}, [createVNode("path", {
|
|
243
308
|
"class": ns.e("warning-outer"),
|
|
244
|
-
"d": "M8.96244623,0.57254229 L15.8714442,13.4101975 C16.1549662,13.9370117 15.9538562,14.5918482 15.4222523,14.8728158 C15.2642579,14.9563203 15.0879506,15 14.9088903,15 L1.09089441,15 C0.488410063,15 0,14.5159904 0,13.9189343 C0,13.7414873 0.0440768395,13.5667684 0.128340519,13.4101975 L7.03733844,0.57254229 C7.32086049,0.0457280838 7.98165058,-0.153569987 8.51325441,0.127397589 C8.70423071,0.228333932 8.8605922,0.383286648 8.96244623,0.57254229 Z"
|
|
309
|
+
"d": "M8.96244623,0.57254229 L15.8714442,13.4101975 C16.1549662,13.9370117 15.9538562,14.5918482 15.4222523,14.8728158 C15.2642579,14.9563203 15.0879506, 15 14.9088903,15 L1.09089441,15 C0.488410063,15 0,14.5159904 0,13.9189343 C0,13.7414873 0.0440768395,13.5667684 0.128340519,13.4101975 L7.03733844,0.57254229 C7.32086049, 0.0457280838 7.98165058,-0.153569987 8.51325441,0.127397589 C8.70423071, 0.228333932 8.8605922,0.383286648 8.96244623,0.57254229 Z"
|
|
245
310
|
}, null), createVNode("path", {
|
|
246
311
|
"class": ns.e("warning-inner"),
|
|
247
312
|
"stroke-width": "0.3",
|
|
@@ -250,14 +315,13 @@ function WarningIcon() {
|
|
|
250
315
|
}, null)])]);
|
|
251
316
|
}
|
|
252
317
|
function InfoIcon() {
|
|
253
|
-
return createVNode("svg", {
|
|
318
|
+
return createVNode("svg", mergeProps({
|
|
254
319
|
"width": "16px",
|
|
255
320
|
"height": "16px",
|
|
256
321
|
"viewBox": "0 0 16 16",
|
|
257
322
|
"version": "1.1",
|
|
258
|
-
"xmlns": "http://www.w3.org/2000/svg"
|
|
259
|
-
|
|
260
|
-
}, [createVNode("g", {
|
|
323
|
+
"xmlns": "http://www.w3.org/2000/svg"
|
|
324
|
+
}, XLINK), [createVNode("g", {
|
|
261
325
|
"id": "info",
|
|
262
326
|
"stroke": "none",
|
|
263
327
|
"stroke-width": "1",
|
|
@@ -270,14 +334,13 @@ function InfoIcon() {
|
|
|
270
334
|
}, null)])]);
|
|
271
335
|
}
|
|
272
336
|
function ErrorIcon() {
|
|
273
|
-
return createVNode("svg", {
|
|
337
|
+
return createVNode("svg", mergeProps({
|
|
274
338
|
"width": "16px",
|
|
275
339
|
"height": "16px",
|
|
276
340
|
"viewBox": "0 0 16 16",
|
|
277
341
|
"version": "1.1",
|
|
278
|
-
"xmlns": "http://www.w3.org/2000/svg"
|
|
279
|
-
|
|
280
|
-
}, [createVNode("defs", null, [createVNode("polygon", {
|
|
342
|
+
"xmlns": "http://www.w3.org/2000/svg"
|
|
343
|
+
}, XLINK), [createVNode("defs", null, [createVNode("polygon", {
|
|
281
344
|
"id": "path-e",
|
|
282
345
|
"points": "8.07106781 6.65685425 10.8994949 3.82842712 12.3137085 5.24264069 9.48528137 8.07106781 12.3137085 10.8994949 10.8994949 12.3137085 8.07106781 9.48528137 5.24264069 12.3137085 3.82842712 10.8994949 6.65685425 8.07106781 3.82842712 5.24264069 5.24264069 3.82842712"
|
|
283
346
|
}, null)]), createVNode("g", {
|
|
@@ -289,13 +352,10 @@ function ErrorIcon() {
|
|
|
289
352
|
}, [createVNode("mask", {
|
|
290
353
|
"id": "mask-2",
|
|
291
354
|
"fill": "white"
|
|
292
|
-
}, [createVNode("use", {
|
|
293
|
-
"xlink:href": "#path-e"
|
|
294
|
-
}, null)]), createVNode("use", {
|
|
355
|
+
}, [createVNode("use", XLINK_HREF, null)]), createVNode("use", mergeProps({
|
|
295
356
|
"id": "Mask",
|
|
296
|
-
"class": ns.e("image-error-path")
|
|
297
|
-
|
|
298
|
-
}, null)])]);
|
|
357
|
+
"class": ns.e("image-error-path")
|
|
358
|
+
}, XLINK_HREF), null)])]);
|
|
299
359
|
}
|
|
300
360
|
var TypeIcon = defineComponent({
|
|
301
361
|
props: {
|
|
@@ -330,7 +390,7 @@ function useEvent(props, emit) {
|
|
|
330
390
|
let timestamp;
|
|
331
391
|
const close2 = () => {
|
|
332
392
|
var _a;
|
|
333
|
-
clearTimeout(timer);
|
|
393
|
+
timer && clearTimeout(timer);
|
|
334
394
|
timer = null;
|
|
335
395
|
(_a = props.onClose) == null ? void 0 : _a.call(props);
|
|
336
396
|
emit("update:modelValue", false);
|
|
@@ -423,13 +483,24 @@ const defaultOptions = {
|
|
|
423
483
|
};
|
|
424
484
|
function initInstance(props, content) {
|
|
425
485
|
const container = document.createElement("div");
|
|
486
|
+
container.classList.add("notification__warpper");
|
|
487
|
+
const lastChild = document.body.lastElementChild;
|
|
488
|
+
let offset_Top = 50;
|
|
489
|
+
if (lastChild == null ? void 0 : lastChild.classList.contains("notification__warpper")) {
|
|
490
|
+
const notification2 = lastChild.lastElementChild;
|
|
491
|
+
const rects = notification2.getBoundingClientRect();
|
|
492
|
+
const height = rects.height;
|
|
493
|
+
const top = rects.top;
|
|
494
|
+
offset_Top = height + top;
|
|
495
|
+
}
|
|
426
496
|
const app = createApp({
|
|
427
497
|
setup() {
|
|
428
498
|
onUnmounted(() => {
|
|
429
499
|
document.body.removeChild(container);
|
|
430
500
|
});
|
|
431
501
|
return () => createVNode(Notification, mergeProps(props, {
|
|
432
|
-
"onDestroy": app.unmount
|
|
502
|
+
"onDestroy": app.unmount,
|
|
503
|
+
"style": [`top: ${offset_Top}px`]
|
|
433
504
|
}), _isSlot(content) ? content : {
|
|
434
505
|
default: () => [content]
|
|
435
506
|
});
|
|
@@ -457,7 +528,7 @@ class NotificationService {
|
|
|
457
528
|
initInstance(props, content);
|
|
458
529
|
props.modelValue = true;
|
|
459
530
|
clearTimeout(timer);
|
|
460
|
-
if (options.duration) {
|
|
531
|
+
if (options.duration && props.onClose) {
|
|
461
532
|
timer = setTimeout(props.onClose, options.duration);
|
|
462
533
|
}
|
|
463
534
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var U=Object.defineProperty,q=Object.defineProperties;var O=Object.getOwnPropertyDescriptors;var v=Object.getOwnPropertySymbols;var X=Object.prototype.hasOwnProperty,W=Object.prototype.propertyIsEnumerable;var k=(i,e,u)=>e in i?U(i,e,{enumerable:!0,configurable:!0,writable:!0,value:u}):i[e]=u,y=(i,e)=>{for(var u in e||(e={}))X.call(e,u)&&k(i,u,e[u]);if(v)for(var u of v(e))W.call(e,u)&&k(i,u,e[u]);return i},C=(i,e)=>q(i,O(e));(function(i,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(i=typeof globalThis!="undefined"?globalThis:i||self,e(i.index={},i.Vue))})(this,function(i,e){"use strict";const u={modelValue:{type:Boolean,default:!1},title:{type:String,default:""},type:{type:String,default:"normal"},duration:{type:Number,default:3e3},onClose:{type:Function}};function L(n){return/^((http|https):)?\/\//.test(n)}const S={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"}},I={name:{type:String,default:"",required:!0},color:{type:String,default:"inherit"},size:{type:[Number,String],default:"inherit"}};function g(n,t,o){let l=n;return t&&(l+=`__${t}`),o&&(l+=`--${o}`),l}function m(n,t=!1){const o=t?`.devui-${n}`:`devui-${n}`;return{b:()=>g(o),e:r=>r?g(o,r):"",m:r=>r?g(o,"",r):"",em:(r,c)=>r&&c?g(o,r,c):""}}var H="",b=e.defineComponent({name:"DSvgIcon",props:I,setup(n){const{name:t,color:o,size:l}=e.toRefs(n),a=m("svg-icon"),s=e.computed(()=>`#icon-${t.value}`),d=e.computed(()=>typeof l.value=="number"?`${l.value}px`:l.value),r={width:d.value,height:d.value};return()=>e.createVNode("svg",{class:a.b(),style:r},[e.createVNode("use",{"xlink:href":s.value,fill:o.value},null)])}}),D=e.defineComponent({name:"DIcon",props:S,setup(n,{attrs:t}){const{component:o,name:l,size:a,color:s,classPrefix:d}=e.toRefs(n),r=o.value?e.resolveDynamicComponent(o.value):e.resolveDynamicComponent(b),c=e.computed(()=>typeof a.value=="number"?`${a.value}px`:a.value),w=()=>e.createVNode(r,e.mergeProps({name:l.value,color:s.value,size:c.value},t),null),V=()=>e.createVNode("img",e.mergeProps({src:l.value,alt:l.value.split("/")[l.value.split("/").length-1],style:{width:c.value||""}},t),null),f=()=>{const N=/^icon-/.test(l.value)?l.value:`${d.value}-${l.value}`;return e.createVNode("i",e.mergeProps({class:[d.value,N],style:{fontSize:c.value,color:s.value}},t),null)};return()=>o.value?w():L(l.value)?V():f()}}),P=e.defineComponent({emits:["click"],setup(n,{emit:t}){const o=m("notification");return()=>e.createVNode("div",{class:o.e("icon-close"),onClick:l=>t("click",l)},[e.createVNode(D,{name:"close",size:"14px"},null)])}});const p=m("notification");function T(){return 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("defs",null,[e.createVNode("polygon",{id:"path-s",points:"6.53553391 9.77817459 12.1923882 4.12132034 13.6066017 5.53553391 6.53553391 12.6066017 3 9.07106781 4.41421356 7.65685425 6.53553391 9.77817459"},null)]),e.createVNode("g",{id:"correct",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("mask",{id:"mask-2",fill:"white"},[e.createVNode("use",{"xlink:href":"#path-s"},null)]),e.createVNode("use",{id:"Mask",class:p.e("image-success-path"),"xlink:href":"#path-s"},null)])])}function M(){return 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("path",{class:p.e("warning-outer"),d:"M8.96244623,0.57254229 L15.8714442,13.4101975 C16.1549662,13.9370117 15.9538562,14.5918482 15.4222523,14.8728158 C15.2642579,14.9563203 15.0879506,15 14.9088903,15 L1.09089441,15 C0.488410063,15 0,14.5159904 0,13.9189343 C0,13.7414873 0.0440768395,13.5667684 0.128340519,13.4101975 L7.03733844,0.57254229 C7.32086049,0.0457280838 7.98165058,-0.153569987 8.51325441,0.127397589 C8.70423071,0.228333932 8.8605922,0.383286648 8.96244623,0.57254229 Z"},null),e.createVNode("path",{class:p.e("warning-inner"),"stroke-width":"0.3","fill-rule":"nonzero",d:"M8.87894737,13 L7.08947368,13 L7.08947368,11.2105263 L8.87894737,11.2105263 L8.87894737,13 Z M8.62102372,9.86842105 L7.32800539,9.86842105 L7,4.5 L8.96842105,4.5 L8.62102372,9.86842105 Z"},null)])])}function $(){return 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",{id:"info",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("path",{class:p.e("image-info-path"),d:"M7,13 L7,6 L9,6 L9,13 L7,13 Z M7,5 L7,3 L9,3 L9,5 L7,5 Z",id:"info"},null)])])}function z(){return 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("defs",null,[e.createVNode("polygon",{id:"path-e",points:"8.07106781 6.65685425 10.8994949 3.82842712 12.3137085 5.24264069 9.48528137 8.07106781 12.3137085 10.8994949 10.8994949 12.3137085 8.07106781 9.48528137 5.24264069 12.3137085 3.82842712 10.8994949 6.65685425 8.07106781 3.82842712 5.24264069 5.24264069 3.82842712"},null)]),e.createVNode("g",{id:"error",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("mask",{id:"mask-2",fill:"white"},[e.createVNode("use",{"xlink:href":"#path-e"},null)]),e.createVNode("use",{id:"Mask",class:p.e("image-error-path"),"xlink:href":"#path-e"},null)])])}var E=e.defineComponent({props:{type:{type:String,default:"normal"}},setup(n){const{type:t}=e.toRefs(n),o=m("notification"),l=e.computed(()=>({[o.e("image")]:!0,[o.em("image",t.value)]:!0}));return()=>e.createVNode("span",{class:l.value},[t.value&&t.value!=="normal"&&(t.value==="success"&&e.createVNode(T,null,null)||t.value==="info"&&e.createVNode($,null,null)||t.value==="warning"&&e.createVNode(M,null,null)||t.value==="error"&&e.createVNode(z,null,null))])}});function R(n){return{classes:e.computed(()=>({"devui-notification-item-container":!0,[`devui-notification-message-${n.type}`]:!0}))}}function _(n,t){let o=null,l;const a=()=>{var c;clearTimeout(o),o=null,(c=n.onClose)==null||c.call(n),t("update:modelValue",!1)},s=()=>{o&&(clearTimeout(o),o=null)},d=()=>{if(!n.modelValue){const c=n.duration-(Date.now()-l);o=setTimeout(a,c)}},r=()=>{t("destroy")};return e.watch(()=>n.modelValue,c=>{c&&(l=Date.now(),n.duration&&(o=setTimeout(a,n.duration)))}),{interrupt:s,removeReset:d,close:a,handleDestroy:r}}var J="",h=e.defineComponent({name:"DNotification",props:u,emits:["update:modelValue","destroy"],setup(n,{emit:t,slots:o}){const{modelValue:l,title:a,type:s}=e.toRefs(n),{classes:d}=R(n),{interrupt:r,removeReset:c,close:w,handleDestroy:V}=_(n,t),f=m("notification");return()=>e.createVNode(e.Transition,{name:"notification-fade",onAfterLeave:V},{default:()=>{var N;return[l.value&&e.createVNode("div",{class:f.b()},[e.createVNode("div",{class:d.value,onMouseenter:r,onMouseleave:c},[e.createVNode("div",{class:f.e("item")},[e.createVNode(P,{onClick:w},null),a.value&&e.createVNode(E,{type:s.value},null),e.createVNode("div",{class:f.e("message")},[e.createVNode("span",{class:f.e("title")},[a.value]),e.createVNode("span",{class:f.e("content")},[(N=o.default)==null?void 0:N.call(o)])])])])])]}})}});function j(n){return typeof n=="function"||Object.prototype.toString.call(n)==="[object Object]"&&!e.isVNode(n)}const B={modelValue:!1,duration:3e3,type:"normal"};function A(n,t){const o=document.createElement("div"),l=e.createApp({setup(){return e.onUnmounted(()=>{document.body.removeChild(o)}),()=>e.createVNode(h,e.mergeProps(n,{onDestroy:l.unmount}),j(t)?t:{default:()=>[t]})}});return document.body.appendChild(o),l.mount(o),l}function F(n,t){n.modelValue=!1,t==null||t()}class x{static open(t){const o=t.onClose||null,l=t.content;let a;delete t.content;const s=e.reactive(C(y(y({},B),t),{onClose:()=>{F(s,o)}}));A(s,l),s.modelValue=!0,clearTimeout(a),t.duration&&(a=setTimeout(s.onClose,t.duration))}}var Z={title:"Notification \u5168\u5C40\u901A\u77E5",category:"\u53CD\u9988",status:"100%",install(n){n.component(h.name,h),n.config.globalProperties.$notificationService=x}};i.Notification=h,i.NotificationService=x,i.default=Z,i.notificationProps=u,Object.defineProperty(i,"__esModule",{value:!0}),i[Symbol.toStringTag]="Module"});
|
|
1
|
+
var O=Object.defineProperty,H=Object.defineProperties;var W=Object.getOwnPropertyDescriptors;var k=Object.getOwnPropertySymbols;var J=Object.prototype.hasOwnProperty,Q=Object.prototype.propertyIsEnumerable;var L=(r,e,d)=>e in r?O(r,e,{enumerable:!0,configurable:!0,writable:!0,value:d}):r[e]=d,C=(r,e)=>{for(var d in e||(e={}))J.call(e,d)&&L(r,d,e[d]);if(k)for(var d of k(e))Q.call(e,d)&&L(r,d,e[d]);return r},x=(r,e)=>H(r,W(e));(function(r,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(r=typeof globalThis!="undefined"?globalThis:r||self,e(r.index={},r.Vue))})(this,function(r,e){"use strict";const d={modelValue:{type:Boolean,default:!1},title:{type:String,default:""},type:{type:String,default:"normal"},duration:{type:Number,default:3e3},onClose:{type:Function}},I={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]}},S={name:{type:String,default:"",required:!0},color:{type:String,default:"inherit"},size:{type:[Number,String],default:"inherit"}};function h(n,t,o){let i=n;return t&&(i+=`__${t}`),o&&(i+=`--${o}`),i}function p(n,t=!1){const o=t?`.devui-${n}`:`devui-${n}`;return{b:()=>h(o),e:l=>l?h(o,l):"",m:l=>l?h(o,"",l):"",em:(l,c)=>l&&c?h(o,l,c):""}}var ee="",D=e.defineComponent({name:"DSvgIcon",props:S,setup(n){const{name:t,color:o,size:i}=e.toRefs(n),a=p("svg-icon"),s=e.computed(()=>`#icon-${t.value}`),u=e.computed(()=>typeof i.value=="number"?`${i.value}px`:i.value),l={width:u.value,height:u.value};return()=>e.createVNode("svg",{class:a.b(),style:l},[e.createVNode("use",{"xlink:href":s.value,fill:o.value},null)])}});function P(n){return/^((http|https):)?\/\//.test(n)}function T(n,t){const{component:o,name:i,size:a,color:s,classPrefix:u,rotate:l}=e.toRefs(n),c=p("icon"),f=e.computed(()=>typeof a.value=="number"?`${a.value}px`:a.value),g=o.value?e.resolveDynamicComponent(o.value):e.resolveDynamicComponent(D),m=()=>e.createVNode("img",e.mergeProps({src:i.value,alt:i.value.split("/")[i.value.split("/").length-1],class:[(l==null?void 0:l.value)==="infinite"&&c.m("spin")],style:{width:f.value||"",transform:`rotate(${l==null?void 0:l.value}deg)`,verticalAlign:"middle"}},t.attrs),null),v=()=>e.createVNode(g,e.mergeProps({name:i.value,color:s.value,size:f.value,class:[(l==null?void 0:l.value)==="infinite"&&c.m("spin")],style:{transform:`rotate(${l==null?void 0:l.value}deg)`}},t.attrs),null),G=()=>{const K=/^icon-/.test(i.value)?i.value:`${u.value}-${i.value}`;return e.createVNode("i",e.mergeProps({class:[u.value,K,(l==null?void 0:l.value)==="infinite"&&c.m("spin")],style:{fontSize:f.value,color:s.value,transform:`rotate(${l==null?void 0:l.value}deg)`}},t.attrs),null)};return{iconDom:()=>o.value?v():P(i.value)?m():G()}}var $=e.defineComponent({name:"DIcon",props:I,emits:["click"],setup(n,t){const{disabled:o,operable:i}=e.toRefs(n),{iconDom:a}=T(n,t),s=p("icon"),u=e.computed(()=>({[s.e("container")]:!0,[s.m("disabled")]:o.value,[s.m("operable")]:i.value})),l=c=>{o.value||t.emit("click",c)};return()=>{var c,f,g,m;return e.createVNode("div",{class:u.value,onClick:l},[(f=(c=t.slots).prefix)==null?void 0:f.call(c),a(),(m=(g=t.slots).suffix)==null?void 0:m.call(g)])}}}),te="";e.defineComponent({name:"DIconGroup",setup(n,t){const o=p("icon-group");return()=>{var i,a;return e.createVNode("div",{class:o.b()},[(a=(i=t.slots).default)==null?void 0:a.call(i)])}}});var _=e.defineComponent({emits:["click"],setup(n,{emit:t}){const o=p("notification");return()=>e.createVNode("div",{class:o.e("icon-close"),onClick:i=>t("click",i)},[e.createVNode($,{name:"close",size:"14px"},null)])}});const N=p("notification"),V={"xmlns:xlink":"http://www.w3.org/1999/xlink"},y={"xlink:href":"#path-s"};function E(){return e.createVNode("svg",e.mergeProps({width:"16px",height:"16px",viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},V),[e.createVNode("defs",null,[e.createVNode("polygon",{id:"path-s",points:"6.53553391 9.77817459 12.1923882 4.12132034 13.6066017 5.53553391 6.53553391 12.6066017 3 9.07106781 4.41421356 7.65685425 6.53553391 9.77817459"},null)]),e.createVNode("g",{id:"correct",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("mask",{id:"mask-2",fill:"white"},[e.createVNode("use",y,null)]),e.createVNode("use",e.mergeProps({id:"Mask",class:N.e("image-success-path")},y),null)])])}function M(){return e.createVNode("svg",e.mergeProps({width:"16px",height:"16px",viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},V),[e.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("path",{class:N.e("warning-outer"),d:"M8.96244623,0.57254229 L15.8714442,13.4101975 C16.1549662,13.9370117 15.9538562,14.5918482 15.4222523,14.8728158 C15.2642579,14.9563203 15.0879506, 15 14.9088903,15 L1.09089441,15 C0.488410063,15 0,14.5159904 0,13.9189343 C0,13.7414873 0.0440768395,13.5667684 0.128340519,13.4101975 L7.03733844,0.57254229 C7.32086049, 0.0457280838 7.98165058,-0.153569987 8.51325441,0.127397589 C8.70423071, 0.228333932 8.8605922,0.383286648 8.96244623,0.57254229 Z"},null),e.createVNode("path",{class:N.e("warning-inner"),"stroke-width":"0.3","fill-rule":"nonzero",d:"M8.87894737,13 L7.08947368,13 L7.08947368,11.2105263 L8.87894737,11.2105263 L8.87894737,13 Z M8.62102372,9.86842105 L7.32800539,9.86842105 L7,4.5 L8.96842105,4.5 L8.62102372,9.86842105 Z"},null)])])}function R(){return e.createVNode("svg",e.mergeProps({width:"16px",height:"16px",viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},V),[e.createVNode("g",{id:"info",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("path",{class:N.e("image-info-path"),d:"M7,13 L7,6 L9,6 L9,13 L7,13 Z M7,5 L7,3 L9,3 L9,5 L7,5 Z",id:"info"},null)])])}function z(){return e.createVNode("svg",e.mergeProps({width:"16px",height:"16px",viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},V),[e.createVNode("defs",null,[e.createVNode("polygon",{id:"path-e",points:"8.07106781 6.65685425 10.8994949 3.82842712 12.3137085 5.24264069 9.48528137 8.07106781 12.3137085 10.8994949 10.8994949 12.3137085 8.07106781 9.48528137 5.24264069 12.3137085 3.82842712 10.8994949 6.65685425 8.07106781 3.82842712 5.24264069 5.24264069 3.82842712"},null)]),e.createVNode("g",{id:"error",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("mask",{id:"mask-2",fill:"white"},[e.createVNode("use",y,null)]),e.createVNode("use",e.mergeProps({id:"Mask",class:N.e("image-error-path")},y),null)])])}var B=e.defineComponent({props:{type:{type:String,default:"normal"}},setup(n){const{type:t}=e.toRefs(n),o=p("notification"),i=e.computed(()=>({[o.e("image")]:!0,[o.em("image",t.value)]:!0}));return()=>e.createVNode("span",{class:i.value},[t.value&&t.value!=="normal"&&(t.value==="success"&&e.createVNode(E,null,null)||t.value==="info"&&e.createVNode(R,null,null)||t.value==="warning"&&e.createVNode(M,null,null)||t.value==="error"&&e.createVNode(z,null,null))])}});function j(n){return{classes:e.computed(()=>({"devui-notification-item-container":!0,[`devui-notification-message-${n.type}`]:!0}))}}function A(n,t){let o=null,i;const a=()=>{var c;o&&clearTimeout(o),o=null,(c=n.onClose)==null||c.call(n),t("update:modelValue",!1)},s=()=>{o&&(clearTimeout(o),o=null)},u=()=>{if(!n.modelValue){const c=n.duration-(Date.now()-i);o=setTimeout(a,c)}},l=()=>{t("destroy")};return e.watch(()=>n.modelValue,c=>{c&&(i=Date.now(),n.duration&&(o=setTimeout(a,n.duration)))}),{interrupt:s,removeReset:u,close:a,handleDestroy:l}}var ne="",w=e.defineComponent({name:"DNotification",props:d,emits:["update:modelValue","destroy"],setup(n,{emit:t,slots:o}){const{modelValue:i,title:a,type:s}=e.toRefs(n),{classes:u}=j(n),{interrupt:l,removeReset:c,close:f,handleDestroy:g}=A(n,t),m=p("notification");return()=>e.createVNode(e.Transition,{name:"notification-fade",onAfterLeave:g},{default:()=>{var v;return[i.value&&e.createVNode("div",{class:m.b()},[e.createVNode("div",{class:u.value,onMouseenter:l,onMouseleave:c},[e.createVNode("div",{class:m.e("item")},[e.createVNode(_,{onClick:f},null),a.value&&e.createVNode(B,{type:s.value},null),e.createVNode("div",{class:m.e("message")},[e.createVNode("span",{class:m.e("title")},[a.value]),e.createVNode("span",{class:m.e("content")},[(v=o.default)==null?void 0:v.call(o)])])])])])]}})}});function F(n){return typeof n=="function"||Object.prototype.toString.call(n)==="[object Object]"&&!e.isVNode(n)}const Z={modelValue:!1,duration:3e3,type:"normal"};function U(n,t){const o=document.createElement("div");o.classList.add("notification__warpper");const i=document.body.lastElementChild;let a=50;if(i==null?void 0:i.classList.contains("notification__warpper")){const l=i.lastElementChild.getBoundingClientRect(),c=l.height,f=l.top;a=c+f}const s=e.createApp({setup(){return e.onUnmounted(()=>{document.body.removeChild(o)}),()=>e.createVNode(w,e.mergeProps(n,{onDestroy:s.unmount,style:[`top: ${a}px`]}),F(t)?t:{default:()=>[t]})}});return document.body.appendChild(o),s.mount(o),s}function X(n,t){n.modelValue=!1,t==null||t()}class b{static open(t){const o=t.onClose||null,i=t.content;let a;delete t.content;const s=e.reactive(x(C(C({},Z),t),{onClose:()=>{X(s,o)}}));U(s,i),s.modelValue=!0,clearTimeout(a),t.duration&&s.onClose&&(a=setTimeout(s.onClose,t.duration))}}var q={title:"Notification \u5168\u5C40\u901A\u77E5",category:"\u53CD\u9988",status:"100%",install(n){n.component(w.name,w),n.config.globalProperties.$notificationService=b}};r.Notification=w,r.NotificationService=b,r.default=q,r.notificationProps=d,Object.defineProperty(r,"__esModule",{value:!0}),r[Symbol.toStringTag]="Module"});
|
package/notification/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.devui-svg-icon{vertical-align:middle}.devui-notification{position:fixed;top:50px;right:20px;width:20em;word-break:normal;word-wrap:break-word;z-index:1060}.devui-notification a:link,.devui-notification a:visited{color:var(--devui-link-light, #96adfa)}.devui-notification a:hover,.devui-notification a:active{color:var(--devui-link-light-active, #beccfa)}.devui-notification-item-container{position:relative;margin:0 0 8px;opacity:.95;filter:alpha(opacity=95);box-shadow:var(--devui-shadow-length-feedback-overlay, 0
|
|
1
|
+
.devui-icon__container{display:inline-block;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;line-height:32px;padding:0 8px;margin-left:-8px;border-radius:var(--devui-border-radius, 4px);transition:all var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1))}.devui-icon--spin{animation:iconSpin 2.5s linear infinite}.devui-svg-icon{vertical-align:middle}@keyframes iconSpin{0%{transform:rotate(0)}50%{transform:rotate(180deg)}to{transform:rotate(360deg)}}.devui-icon-group{display:inline-flex;align-items:center}.devui-icon-group>.devui-icon__container:not(.devui-icon--operable){padding:8px;margin-left:0}.devui-icon-group>.devui-icon__container:not(.devui-icon--operable):first-child{margin-left:-8px}.devui-icon-group>*:not(:first-child){margin-left:0}.devui-notification{position:fixed;top:50px;right:20px;width:20em;word-break:normal;word-wrap:break-word;z-index:1060}.devui-notification a:link,.devui-notification a:visited{color:var(--devui-link-light, #96adfa)}.devui-notification a:hover,.devui-notification a:active{color:var(--devui-link-light-active, #beccfa)}.devui-notification-item-container{position:relative;margin:0 0 8px;opacity:.95;filter:alpha(opacity=95);box-shadow:var(--devui-shadow-length-feedback-overlay, 0 8px 16px 0) var(--devui-shadow, rgba(37, 43, 58, .2));border-radius:var(--devui-border-radius-feedback, 4px);color:var(--devui-feedback-overlay-text, #dfe1e6);background-color:var(--devui-feedback-overlay-bg, #464d6e)}.devui-notification__item{position:relative;display:block;padding:12px 16px}.devui-notification__icon-close{position:absolute;top:7px;right:10px;cursor:pointer}.devui-notification__icon-close i.icon{color:var(--devui-light-text, #ffffff)!important}.devui-notification__title{font-size:var(--devui-font-size-card-title, 16px);padding:0 0 calc(.5em - 2px) 0;display:block;font-weight:700}.devui-notification__image{position:absolute;display:inline-block;width:16px;height:16px;border-radius:50%;left:16px;top:14px;padding:0;line-height:1}.devui-notification__image.devui-notification__image--warning path.devui-notification__warning-outer{fill:var(--devui-warning-line, #fa9841)}.devui-notification__image.devui-notification__image--warning path.devui-notification__warning-inner{fill:var(--devui-light-text, #ffffff);stroke:var(--devui-light-text, #ffffff)}.devui-notification__image.devui-notification__image--info{background-color:var(--devui-info, #5e7ce0)}.devui-notification__image.devui-notification__image--error{background-color:var(--devui-danger, #f66f6a)}.devui-notification__image.devui-notification__image--success{background-color:var(--devui-success, #50d4ab)}.devui-notification__image .devui-notification__image-info-path,.devui-notification__image .devui-notification__image-error-path,.devui-notification__image .devui-notification__image-success-path{fill:var(--devui-light-text, #ffffff)}.devui-notification__message{margin-left:20px}.devui-notification__message .devui-notification__content{font-size:var(--devui-font-size, 14px);margin-top:4px}.devui-notification-message-common .devui-notification__message{margin-left:0}.devui-notification__message p{font-size:var(--devui-font-size, 14px);margin-top:4px}.notification-fade-enter-active,.notification-fade-leave-active{transition:transform var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out, cubic-bezier(.5, .05, .5, .95))}.notification-fade-enter-from,.notification-fade-leave-to{transform:translate(100%)}
|