@element-plus/nightly 0.0.20241118 → 0.0.20241119
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +0 -5
- package/dist/index.full.js +8 -6
- package/dist/index.full.min.js +3 -3
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +6 -6
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +8 -6
- package/dist/locale/af.js +1 -1
- package/dist/locale/af.min.js +1 -1
- package/dist/locale/af.min.mjs +1 -1
- package/dist/locale/af.mjs +1 -1
- package/dist/locale/ar-eg.js +1 -1
- package/dist/locale/ar-eg.min.js +1 -1
- package/dist/locale/ar-eg.min.mjs +1 -1
- package/dist/locale/ar-eg.mjs +1 -1
- package/dist/locale/ar.js +1 -1
- package/dist/locale/ar.min.js +1 -1
- package/dist/locale/ar.min.mjs +1 -1
- package/dist/locale/ar.mjs +1 -1
- package/dist/locale/az.js +1 -1
- package/dist/locale/az.min.js +1 -1
- package/dist/locale/az.min.mjs +1 -1
- package/dist/locale/az.mjs +1 -1
- package/dist/locale/bg.js +1 -1
- package/dist/locale/bg.min.js +1 -1
- package/dist/locale/bg.min.mjs +1 -1
- package/dist/locale/bg.mjs +1 -1
- package/dist/locale/bn.js +1 -1
- package/dist/locale/bn.min.js +1 -1
- package/dist/locale/bn.min.mjs +1 -1
- package/dist/locale/bn.mjs +1 -1
- package/dist/locale/ca.js +1 -1
- package/dist/locale/ca.min.js +1 -1
- package/dist/locale/ca.min.mjs +1 -1
- package/dist/locale/ca.mjs +1 -1
- package/dist/locale/ckb.js +1 -1
- package/dist/locale/ckb.min.js +1 -1
- package/dist/locale/ckb.min.mjs +1 -1
- package/dist/locale/ckb.mjs +1 -1
- package/dist/locale/cs.js +1 -1
- package/dist/locale/cs.min.js +1 -1
- package/dist/locale/cs.min.mjs +1 -1
- package/dist/locale/cs.mjs +1 -1
- package/dist/locale/da.js +1 -1
- package/dist/locale/da.min.js +1 -1
- package/dist/locale/da.min.mjs +1 -1
- package/dist/locale/da.mjs +1 -1
- package/dist/locale/de.js +1 -1
- package/dist/locale/de.min.js +1 -1
- package/dist/locale/de.min.mjs +1 -1
- package/dist/locale/de.mjs +1 -1
- package/dist/locale/el.js +1 -1
- package/dist/locale/el.min.js +1 -1
- package/dist/locale/el.min.mjs +1 -1
- package/dist/locale/el.mjs +1 -1
- package/dist/locale/en.js +1 -1
- package/dist/locale/en.min.js +1 -1
- package/dist/locale/en.min.mjs +1 -1
- package/dist/locale/en.mjs +1 -1
- package/dist/locale/eo.js +1 -1
- package/dist/locale/eo.min.js +1 -1
- package/dist/locale/eo.min.mjs +1 -1
- package/dist/locale/eo.mjs +1 -1
- package/dist/locale/es.js +1 -1
- package/dist/locale/es.min.js +1 -1
- package/dist/locale/es.min.mjs +1 -1
- package/dist/locale/es.mjs +1 -1
- package/dist/locale/et.js +1 -1
- package/dist/locale/et.min.js +1 -1
- package/dist/locale/et.min.mjs +1 -1
- package/dist/locale/et.mjs +1 -1
- package/dist/locale/eu.js +1 -1
- package/dist/locale/eu.min.js +1 -1
- package/dist/locale/eu.min.mjs +1 -1
- package/dist/locale/eu.mjs +1 -1
- package/dist/locale/fa.js +1 -1
- package/dist/locale/fa.min.js +1 -1
- package/dist/locale/fa.min.mjs +1 -1
- package/dist/locale/fa.mjs +1 -1
- package/dist/locale/fi.js +1 -1
- package/dist/locale/fi.min.js +1 -1
- package/dist/locale/fi.min.mjs +1 -1
- package/dist/locale/fi.mjs +1 -1
- package/dist/locale/fr.js +1 -1
- package/dist/locale/fr.min.js +1 -1
- package/dist/locale/fr.min.mjs +1 -1
- package/dist/locale/fr.mjs +1 -1
- package/dist/locale/he.js +1 -1
- package/dist/locale/he.min.js +1 -1
- package/dist/locale/he.min.mjs +1 -1
- package/dist/locale/he.mjs +1 -1
- package/dist/locale/hr.js +1 -1
- package/dist/locale/hr.min.js +1 -1
- package/dist/locale/hr.min.mjs +1 -1
- package/dist/locale/hr.mjs +1 -1
- package/dist/locale/hu.js +1 -1
- package/dist/locale/hu.min.js +1 -1
- package/dist/locale/hu.min.mjs +1 -1
- package/dist/locale/hu.mjs +1 -1
- package/dist/locale/hy-am.js +1 -1
- package/dist/locale/hy-am.min.js +1 -1
- package/dist/locale/hy-am.min.mjs +1 -1
- package/dist/locale/hy-am.mjs +1 -1
- package/dist/locale/id.js +1 -1
- package/dist/locale/id.min.js +1 -1
- package/dist/locale/id.min.mjs +1 -1
- package/dist/locale/id.mjs +1 -1
- package/dist/locale/it.js +1 -1
- package/dist/locale/it.min.js +1 -1
- package/dist/locale/it.min.mjs +1 -1
- package/dist/locale/it.mjs +1 -1
- package/dist/locale/ja.js +1 -1
- package/dist/locale/ja.min.js +1 -1
- package/dist/locale/ja.min.mjs +1 -1
- package/dist/locale/ja.mjs +1 -1
- package/dist/locale/kk.js +1 -1
- package/dist/locale/kk.min.js +1 -1
- package/dist/locale/kk.min.mjs +1 -1
- package/dist/locale/kk.mjs +1 -1
- package/dist/locale/km.js +1 -1
- package/dist/locale/km.min.js +1 -1
- package/dist/locale/km.min.mjs +1 -1
- package/dist/locale/km.mjs +1 -1
- package/dist/locale/ko.js +1 -1
- package/dist/locale/ko.min.js +1 -1
- package/dist/locale/ko.min.mjs +1 -1
- package/dist/locale/ko.mjs +1 -1
- package/dist/locale/ku.js +1 -1
- package/dist/locale/ku.min.js +1 -1
- package/dist/locale/ku.min.mjs +1 -1
- package/dist/locale/ku.mjs +1 -1
- package/dist/locale/ky.js +1 -1
- package/dist/locale/ky.min.js +1 -1
- package/dist/locale/ky.min.mjs +1 -1
- package/dist/locale/ky.mjs +1 -1
- package/dist/locale/lt.js +1 -1
- package/dist/locale/lt.min.js +1 -1
- package/dist/locale/lt.min.mjs +1 -1
- package/dist/locale/lt.mjs +1 -1
- package/dist/locale/lv.js +1 -1
- package/dist/locale/lv.min.js +1 -1
- package/dist/locale/lv.min.mjs +1 -1
- package/dist/locale/lv.mjs +1 -1
- package/dist/locale/mg.js +1 -1
- package/dist/locale/mg.min.js +1 -1
- package/dist/locale/mg.min.mjs +1 -1
- package/dist/locale/mg.mjs +1 -1
- package/dist/locale/mn.js +1 -1
- package/dist/locale/mn.min.js +1 -1
- package/dist/locale/mn.min.mjs +1 -1
- package/dist/locale/mn.mjs +1 -1
- package/dist/locale/ms.js +191 -0
- package/dist/locale/ms.min.js +2 -0
- package/dist/locale/ms.min.js.map +1 -0
- package/dist/locale/ms.min.mjs +2 -0
- package/dist/locale/ms.min.mjs.map +1 -0
- package/dist/locale/ms.mjs +183 -0
- package/dist/locale/my.js +1 -1
- package/dist/locale/my.min.js +1 -1
- package/dist/locale/my.min.mjs +1 -1
- package/dist/locale/my.mjs +1 -1
- package/dist/locale/nb-no.js +1 -1
- package/dist/locale/nb-no.min.js +1 -1
- package/dist/locale/nb-no.min.mjs +1 -1
- package/dist/locale/nb-no.mjs +1 -1
- package/dist/locale/nl.js +1 -1
- package/dist/locale/nl.min.js +1 -1
- package/dist/locale/nl.min.mjs +1 -1
- package/dist/locale/nl.mjs +1 -1
- package/dist/locale/pa.js +1 -1
- package/dist/locale/pa.min.js +1 -1
- package/dist/locale/pa.min.mjs +1 -1
- package/dist/locale/pa.mjs +1 -1
- package/dist/locale/pl.js +1 -1
- package/dist/locale/pl.min.js +1 -1
- package/dist/locale/pl.min.mjs +1 -1
- package/dist/locale/pl.mjs +1 -1
- package/dist/locale/pt-br.js +1 -1
- package/dist/locale/pt-br.min.js +1 -1
- package/dist/locale/pt-br.min.mjs +1 -1
- package/dist/locale/pt-br.mjs +1 -1
- package/dist/locale/pt.js +1 -1
- package/dist/locale/pt.min.js +1 -1
- package/dist/locale/pt.min.mjs +1 -1
- package/dist/locale/pt.mjs +1 -1
- package/dist/locale/ro.js +1 -1
- package/dist/locale/ro.min.js +1 -1
- package/dist/locale/ro.min.mjs +1 -1
- package/dist/locale/ro.mjs +1 -1
- package/dist/locale/ru.js +1 -1
- package/dist/locale/ru.min.js +1 -1
- package/dist/locale/ru.min.mjs +1 -1
- package/dist/locale/ru.mjs +1 -1
- package/dist/locale/sk.js +1 -1
- package/dist/locale/sk.min.js +1 -1
- package/dist/locale/sk.min.mjs +1 -1
- package/dist/locale/sk.mjs +1 -1
- package/dist/locale/sl.js +1 -1
- package/dist/locale/sl.min.js +1 -1
- package/dist/locale/sl.min.mjs +1 -1
- package/dist/locale/sl.mjs +1 -1
- package/dist/locale/sr.js +1 -1
- package/dist/locale/sr.min.js +1 -1
- package/dist/locale/sr.min.mjs +1 -1
- package/dist/locale/sr.mjs +1 -1
- package/dist/locale/sv.js +1 -1
- package/dist/locale/sv.min.js +1 -1
- package/dist/locale/sv.min.mjs +1 -1
- package/dist/locale/sv.mjs +1 -1
- package/dist/locale/sw.js +1 -1
- package/dist/locale/sw.min.js +1 -1
- package/dist/locale/sw.min.mjs +1 -1
- package/dist/locale/sw.mjs +1 -1
- package/dist/locale/ta.js +1 -1
- package/dist/locale/ta.min.js +1 -1
- package/dist/locale/ta.min.mjs +1 -1
- package/dist/locale/ta.mjs +1 -1
- package/dist/locale/th.js +1 -1
- package/dist/locale/th.min.js +1 -1
- package/dist/locale/th.min.mjs +1 -1
- package/dist/locale/th.mjs +1 -1
- package/dist/locale/tk.js +1 -1
- package/dist/locale/tk.min.js +1 -1
- package/dist/locale/tk.min.mjs +1 -1
- package/dist/locale/tk.mjs +1 -1
- package/dist/locale/tr.js +1 -1
- package/dist/locale/tr.min.js +1 -1
- package/dist/locale/tr.min.mjs +1 -1
- package/dist/locale/tr.mjs +1 -1
- package/dist/locale/ug-cn.js +1 -1
- package/dist/locale/ug-cn.min.js +1 -1
- package/dist/locale/ug-cn.min.mjs +1 -1
- package/dist/locale/ug-cn.mjs +1 -1
- package/dist/locale/uk.js +1 -1
- package/dist/locale/uk.min.js +1 -1
- package/dist/locale/uk.min.mjs +1 -1
- package/dist/locale/uk.mjs +1 -1
- package/dist/locale/uz-uz.js +1 -1
- package/dist/locale/uz-uz.min.js +1 -1
- package/dist/locale/uz-uz.min.mjs +1 -1
- package/dist/locale/uz-uz.mjs +1 -1
- package/dist/locale/vi.js +1 -1
- package/dist/locale/vi.min.js +1 -1
- package/dist/locale/vi.min.mjs +1 -1
- package/dist/locale/vi.mjs +1 -1
- package/dist/locale/zh-cn.js +1 -1
- package/dist/locale/zh-cn.min.js +1 -1
- package/dist/locale/zh-cn.min.mjs +1 -1
- package/dist/locale/zh-cn.mjs +1 -1
- package/dist/locale/zh-tw.js +1 -1
- package/dist/locale/zh-tw.min.js +1 -1
- package/dist/locale/zh-tw.min.mjs +1 -1
- package/dist/locale/zh-tw.mjs +1 -1
- package/es/components/dialog/src/dialog-content.mjs +26 -89
- package/es/components/dialog/src/dialog-content.mjs.map +1 -1
- package/es/components/dialog/src/dialog-content2.mjs +89 -26
- package/es/components/dialog/src/dialog-content2.mjs.map +1 -1
- package/es/components/dialog/src/dialog.mjs +1 -1
- package/es/components/dialog/src/dialog2.mjs +1 -1
- package/es/components/image-viewer/index.mjs +2 -2
- package/es/components/image-viewer/src/image-viewer.mjs +392 -45
- package/es/components/image-viewer/src/image-viewer.mjs.map +1 -1
- package/es/components/image-viewer/src/image-viewer2.mjs +45 -392
- package/es/components/image-viewer/src/image-viewer2.mjs.map +1 -1
- package/es/components/index.mjs +7 -7
- package/es/components/link/index.mjs +2 -2
- package/es/components/link/src/link.mjs +50 -25
- package/es/components/link/src/link.mjs.map +1 -1
- package/es/components/link/src/link2.mjs +25 -50
- package/es/components/link/src/link2.mjs.map +1 -1
- package/es/components/notification/src/notification.d.ts +4 -4
- package/es/components/notification/src/notification.mjs +5 -1
- package/es/components/notification/src/notification.mjs.map +1 -1
- package/es/components/notification/src/notification.vue.d.ts +12 -12
- package/es/components/notification/src/notify.mjs +2 -4
- package/es/components/notification/src/notify.mjs.map +1 -1
- package/es/components/page-header/index.mjs +2 -2
- package/es/components/page-header/src/page-header.mjs +102 -17
- package/es/components/page-header/src/page-header.mjs.map +1 -1
- package/es/components/page-header/src/page-header2.mjs +17 -102
- package/es/components/page-header/src/page-header2.mjs.map +1 -1
- package/es/components/result/index.mjs +2 -2
- package/es/components/result/src/result.mjs +63 -29
- package/es/components/result/src/result.mjs.map +1 -1
- package/es/components/result/src/result2.mjs +29 -63
- package/es/components/result/src/result2.mjs.map +1 -1
- package/es/components/row/index.mjs +2 -2
- package/es/components/row/src/row.mjs +29 -45
- package/es/components/row/src/row.mjs.map +1 -1
- package/es/components/row/src/row2.mjs +45 -29
- package/es/components/row/src/row2.mjs.map +1 -1
- package/es/components/scrollbar/index.mjs +1 -1
- package/es/components/scrollbar/src/bar2.mjs +1 -1
- package/es/components/scrollbar/src/thumb.mjs +130 -11
- package/es/components/scrollbar/src/thumb.mjs.map +1 -1
- package/es/components/scrollbar/src/thumb2.mjs +11 -130
- package/es/components/scrollbar/src/thumb2.mjs.map +1 -1
- package/es/components/slider/src/button.mjs +91 -21
- package/es/components/slider/src/button.mjs.map +1 -1
- package/es/components/slider/src/button2.mjs +21 -91
- package/es/components/slider/src/button2.mjs.map +1 -1
- package/es/components/slider/src/slider2.mjs +1 -1
- package/es/components/time-picker/src/common/picker-range-trigger.mjs.map +1 -1
- package/es/components/upload/index.mjs +2 -2
- package/es/components/upload/src/upload-content.mjs +1 -1
- package/es/components/upload/src/upload-content2.mjs +1 -1
- package/es/components/upload/src/upload-list.mjs +1 -1
- package/es/components/upload/src/upload.mjs +126 -98
- package/es/components/upload/src/upload.mjs.map +1 -1
- package/es/components/upload/src/upload2.mjs +98 -126
- package/es/components/upload/src/upload2.mjs.map +1 -1
- package/es/components/upload/src/use-handlers.mjs +1 -1
- package/es/index.mjs +7 -7
- package/es/locale/lang/ms.d.ts +180 -0
- package/es/locale/lang/ms.mjs +182 -0
- package/es/locale/lang/ms.mjs.map +1 -0
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/dialog/src/dialog-content.js +26 -88
- package/lib/components/dialog/src/dialog-content.js.map +1 -1
- package/lib/components/dialog/src/dialog-content2.js +88 -26
- package/lib/components/dialog/src/dialog-content2.js.map +1 -1
- package/lib/components/dialog/src/dialog.js +1 -1
- package/lib/components/dialog/src/dialog2.js +1 -1
- package/lib/components/image-viewer/index.js +2 -2
- package/lib/components/image-viewer/src/image-viewer.js +392 -46
- package/lib/components/image-viewer/src/image-viewer.js.map +1 -1
- package/lib/components/image-viewer/src/image-viewer2.js +46 -392
- package/lib/components/image-viewer/src/image-viewer2.js.map +1 -1
- package/lib/components/index.js +7 -7
- package/lib/components/link/index.js +2 -2
- package/lib/components/link/src/link.js +50 -26
- package/lib/components/link/src/link.js.map +1 -1
- package/lib/components/link/src/link2.js +26 -50
- package/lib/components/link/src/link2.js.map +1 -1
- package/lib/components/notification/src/notification.d.ts +4 -4
- package/lib/components/notification/src/notification.js +5 -1
- package/lib/components/notification/src/notification.js.map +1 -1
- package/lib/components/notification/src/notification.vue.d.ts +12 -12
- package/lib/components/notification/src/notify.js +1 -3
- package/lib/components/notification/src/notify.js.map +1 -1
- package/lib/components/page-header/index.js +2 -2
- package/lib/components/page-header/src/page-header.js +102 -18
- package/lib/components/page-header/src/page-header.js.map +1 -1
- package/lib/components/page-header/src/page-header2.js +18 -102
- package/lib/components/page-header/src/page-header2.js.map +1 -1
- package/lib/components/result/index.js +2 -2
- package/lib/components/result/src/result.js +63 -31
- package/lib/components/result/src/result.js.map +1 -1
- package/lib/components/result/src/result2.js +31 -63
- package/lib/components/result/src/result2.js.map +1 -1
- package/lib/components/row/index.js +2 -2
- package/lib/components/row/src/row.js +31 -45
- package/lib/components/row/src/row.js.map +1 -1
- package/lib/components/row/src/row2.js +45 -31
- package/lib/components/row/src/row2.js.map +1 -1
- package/lib/components/scrollbar/index.js +1 -1
- package/lib/components/scrollbar/src/bar2.js +1 -1
- package/lib/components/scrollbar/src/thumb.js +130 -11
- package/lib/components/scrollbar/src/thumb.js.map +1 -1
- package/lib/components/scrollbar/src/thumb2.js +11 -130
- package/lib/components/scrollbar/src/thumb2.js.map +1 -1
- package/lib/components/slider/src/button.js +91 -22
- package/lib/components/slider/src/button.js.map +1 -1
- package/lib/components/slider/src/button2.js +22 -91
- package/lib/components/slider/src/button2.js.map +1 -1
- package/lib/components/slider/src/slider2.js +1 -1
- package/lib/components/time-picker/src/common/picker-range-trigger.js.map +1 -1
- package/lib/components/upload/index.js +2 -2
- package/lib/components/upload/src/upload-content.js +1 -1
- package/lib/components/upload/src/upload-content2.js +1 -1
- package/lib/components/upload/src/upload-list.js +1 -1
- package/lib/components/upload/src/upload.js +126 -101
- package/lib/components/upload/src/upload.js.map +1 -1
- package/lib/components/upload/src/upload2.js +101 -126
- package/lib/components/upload/src/upload2.js.map +1 -1
- package/lib/components/upload/src/use-handlers.js +1 -1
- package/lib/index.js +7 -7
- package/lib/locale/lang/ms.d.ts +180 -0
- package/lib/locale/lang/ms.js +186 -0
- package/lib/locale/lang/ms.js.map +1 -0
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +2 -2
- package/web-types.json +1 -1
@@ -1,34 +1,68 @@
|
|
1
|
-
import '
|
2
|
-
import
|
3
|
-
import {
|
1
|
+
import { defineComponent, computed, openBlock, createElementBlock, normalizeClass, unref, createElementVNode, renderSlot, createBlock, resolveDynamicComponent, createCommentVNode, toDisplayString } from 'vue';
|
2
|
+
import '../../../hooks/index.mjs';
|
3
|
+
import { resultProps, IconMap, IconComponentMap } from './result2.mjs';
|
4
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
5
|
+
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
4
6
|
|
5
|
-
const
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
const
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
7
|
+
const __default__ = defineComponent({
|
8
|
+
name: "ElResult"
|
9
|
+
});
|
10
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
11
|
+
...__default__,
|
12
|
+
props: resultProps,
|
13
|
+
setup(__props) {
|
14
|
+
const props = __props;
|
15
|
+
const ns = useNamespace("result");
|
16
|
+
const resultIcon = computed(() => {
|
17
|
+
const icon = props.icon;
|
18
|
+
const iconClass = icon && IconMap[icon] ? IconMap[icon] : "icon-info";
|
19
|
+
const iconComponent = IconComponentMap[iconClass] || IconComponentMap["icon-info"];
|
20
|
+
return {
|
21
|
+
class: iconClass,
|
22
|
+
component: iconComponent
|
23
|
+
};
|
24
|
+
});
|
25
|
+
return (_ctx, _cache) => {
|
26
|
+
return openBlock(), createElementBlock("div", {
|
27
|
+
class: normalizeClass(unref(ns).b())
|
28
|
+
}, [
|
29
|
+
createElementVNode("div", {
|
30
|
+
class: normalizeClass(unref(ns).e("icon"))
|
31
|
+
}, [
|
32
|
+
renderSlot(_ctx.$slots, "icon", {}, () => [
|
33
|
+
unref(resultIcon).component ? (openBlock(), createBlock(resolveDynamicComponent(unref(resultIcon).component), {
|
34
|
+
key: 0,
|
35
|
+
class: normalizeClass(unref(resultIcon).class)
|
36
|
+
}, null, 8, ["class"])) : createCommentVNode("v-if", true)
|
37
|
+
])
|
38
|
+
], 2),
|
39
|
+
_ctx.title || _ctx.$slots.title ? (openBlock(), createElementBlock("div", {
|
40
|
+
key: 0,
|
41
|
+
class: normalizeClass(unref(ns).e("title"))
|
42
|
+
}, [
|
43
|
+
renderSlot(_ctx.$slots, "title", {}, () => [
|
44
|
+
createElementVNode("p", null, toDisplayString(_ctx.title), 1)
|
45
|
+
])
|
46
|
+
], 2)) : createCommentVNode("v-if", true),
|
47
|
+
_ctx.subTitle || _ctx.$slots["sub-title"] ? (openBlock(), createElementBlock("div", {
|
48
|
+
key: 1,
|
49
|
+
class: normalizeClass(unref(ns).e("subtitle"))
|
50
|
+
}, [
|
51
|
+
renderSlot(_ctx.$slots, "sub-title", {}, () => [
|
52
|
+
createElementVNode("p", null, toDisplayString(_ctx.subTitle), 1)
|
53
|
+
])
|
54
|
+
], 2)) : createCommentVNode("v-if", true),
|
55
|
+
_ctx.$slots.extra ? (openBlock(), createElementBlock("div", {
|
56
|
+
key: 2,
|
57
|
+
class: normalizeClass(unref(ns).e("extra"))
|
58
|
+
}, [
|
59
|
+
renderSlot(_ctx.$slots, "extra")
|
60
|
+
], 2)) : createCommentVNode("v-if", true)
|
61
|
+
], 2);
|
62
|
+
};
|
30
63
|
}
|
31
64
|
});
|
65
|
+
var Result = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "result.vue"]]);
|
32
66
|
|
33
|
-
export {
|
67
|
+
export { Result as default };
|
34
68
|
//# sourceMappingURL=result.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"result.mjs","sources":["../../../../../../packages/components/result/src/result.
|
1
|
+
{"version":3,"file":"result.mjs","sources":["../../../../../../packages/components/result/src/result.vue"],"sourcesContent":["<template>\n <div :class=\"ns.b()\">\n <div :class=\"ns.e('icon')\">\n <slot name=\"icon\">\n <component\n :is=\"resultIcon.component\"\n v-if=\"resultIcon.component\"\n :class=\"resultIcon.class\"\n />\n </slot>\n </div>\n <div v-if=\"title || $slots.title\" :class=\"ns.e('title')\">\n <slot name=\"title\">\n <p>{{ title }}</p>\n </slot>\n </div>\n <div v-if=\"subTitle || $slots['sub-title']\" :class=\"ns.e('subtitle')\">\n <slot name=\"sub-title\">\n <p>{{ subTitle }}</p>\n </slot>\n </div>\n <div v-if=\"$slots.extra\" :class=\"ns.e('extra')\">\n <slot name=\"extra\" />\n </div>\n </div>\n</template>\n<script lang=\"ts\" setup>\nimport { computed } from 'vue'\nimport { useNamespace } from '@element-plus/hooks'\nimport { IconComponentMap, IconMap, resultProps } from './result'\n\ndefineOptions({\n name: 'ElResult',\n})\n\nconst props = defineProps(resultProps)\n\nconst ns = useNamespace('result')\n\nconst resultIcon = computed(() => {\n const icon = props.icon\n const iconClass = icon && IconMap[icon] ? IconMap[icon] : 'icon-info'\n const iconComponent =\n IconComponentMap[iconClass] || IconComponentMap['icon-info']\n\n return {\n class: iconClass,\n component: iconComponent,\n }\n})\n</script>\n"],"names":[],"mappings":";;;;;;mCA+Bc,CAAA;AAAA,EACZ,IAAM,EAAA,UAAA;AACR,CAAA,CAAA,CAAA;;;;;;AAIA,IAAM,MAAA,EAAA,GAAK,aAAa,QAAQ,CAAA,CAAA;AAEhC,IAAM,MAAA,UAAA,GAAa,SAAS,MAAM;AAChC,MAAA,MAAM,OAAO,KAAM,CAAA,IAAA,CAAA;AACnB,MAAA,MAAM,YAAY,IAAQ,IAAA,OAAA,CAAQ,IAAI,CAAI,GAAA,OAAA,CAAQ,IAAI,CAAI,GAAA,WAAA,CAAA;AAC1D,MAAA,MAAM,aACJ,GAAA,gBAAA,CAAiB,SAAS,CAAA,IAAK,iBAAiB,WAAW,CAAA,CAAA;AAE7D,MAAO,OAAA;AAAA,QACL,KAAO,EAAA,SAAA;AAAA,QACP,SAAW,EAAA,aAAA;AAAA,OACb,CAAA;AAAA,KACD,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
@@ -1,68 +1,34 @@
|
|
1
|
-
import
|
2
|
-
import '
|
3
|
-
import {
|
4
|
-
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
5
|
-
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
1
|
+
import '../../../utils/index.mjs';
|
2
|
+
import { CircleCheckFilled, WarningFilled, CircleCloseFilled, InfoFilled } from '@element-plus/icons-vue';
|
3
|
+
import { buildProps } from '../../../utils/vue/props/runtime.mjs';
|
6
4
|
|
7
|
-
const
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
renderSlot(_ctx.$slots, "icon", {}, () => [
|
33
|
-
unref(resultIcon).component ? (openBlock(), createBlock(resolveDynamicComponent(unref(resultIcon).component), {
|
34
|
-
key: 0,
|
35
|
-
class: normalizeClass(unref(resultIcon).class)
|
36
|
-
}, null, 8, ["class"])) : createCommentVNode("v-if", true)
|
37
|
-
])
|
38
|
-
], 2),
|
39
|
-
_ctx.title || _ctx.$slots.title ? (openBlock(), createElementBlock("div", {
|
40
|
-
key: 0,
|
41
|
-
class: normalizeClass(unref(ns).e("title"))
|
42
|
-
}, [
|
43
|
-
renderSlot(_ctx.$slots, "title", {}, () => [
|
44
|
-
createElementVNode("p", null, toDisplayString(_ctx.title), 1)
|
45
|
-
])
|
46
|
-
], 2)) : createCommentVNode("v-if", true),
|
47
|
-
_ctx.subTitle || _ctx.$slots["sub-title"] ? (openBlock(), createElementBlock("div", {
|
48
|
-
key: 1,
|
49
|
-
class: normalizeClass(unref(ns).e("subtitle"))
|
50
|
-
}, [
|
51
|
-
renderSlot(_ctx.$slots, "sub-title", {}, () => [
|
52
|
-
createElementVNode("p", null, toDisplayString(_ctx.subTitle), 1)
|
53
|
-
])
|
54
|
-
], 2)) : createCommentVNode("v-if", true),
|
55
|
-
_ctx.$slots.extra ? (openBlock(), createElementBlock("div", {
|
56
|
-
key: 2,
|
57
|
-
class: normalizeClass(unref(ns).e("extra"))
|
58
|
-
}, [
|
59
|
-
renderSlot(_ctx.$slots, "extra")
|
60
|
-
], 2)) : createCommentVNode("v-if", true)
|
61
|
-
], 2);
|
62
|
-
};
|
5
|
+
const IconMap = {
|
6
|
+
success: "icon-success",
|
7
|
+
warning: "icon-warning",
|
8
|
+
error: "icon-error",
|
9
|
+
info: "icon-info"
|
10
|
+
};
|
11
|
+
const IconComponentMap = {
|
12
|
+
[IconMap.success]: CircleCheckFilled,
|
13
|
+
[IconMap.warning]: WarningFilled,
|
14
|
+
[IconMap.error]: CircleCloseFilled,
|
15
|
+
[IconMap.info]: InfoFilled
|
16
|
+
};
|
17
|
+
const resultProps = buildProps({
|
18
|
+
title: {
|
19
|
+
type: String,
|
20
|
+
default: ""
|
21
|
+
},
|
22
|
+
subTitle: {
|
23
|
+
type: String,
|
24
|
+
default: ""
|
25
|
+
},
|
26
|
+
icon: {
|
27
|
+
type: String,
|
28
|
+
values: ["success", "warning", "info", "error"],
|
29
|
+
default: "info"
|
63
30
|
}
|
64
31
|
});
|
65
|
-
var Result = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "result.vue"]]);
|
66
32
|
|
67
|
-
export {
|
33
|
+
export { IconComponentMap, IconMap, resultProps };
|
68
34
|
//# sourceMappingURL=result2.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"result2.mjs","sources":["../../../../../../packages/components/result/src/result.
|
1
|
+
{"version":3,"file":"result2.mjs","sources":["../../../../../../packages/components/result/src/result.ts"],"sourcesContent":["import { buildProps } from '@element-plus/utils'\nimport {\n CircleCheckFilled,\n CircleCloseFilled,\n InfoFilled,\n WarningFilled,\n} from '@element-plus/icons-vue'\nimport type { Component, ExtractPropTypes } from 'vue'\nimport type Result from './result.vue'\n\nexport const IconMap = {\n success: 'icon-success',\n warning: 'icon-warning',\n error: 'icon-error',\n info: 'icon-info',\n} as const\n\nexport const IconComponentMap: Record<\n typeof IconMap[keyof typeof IconMap],\n Component\n> = {\n [IconMap.success]: CircleCheckFilled,\n [IconMap.warning]: WarningFilled,\n [IconMap.error]: CircleCloseFilled,\n [IconMap.info]: InfoFilled,\n}\n\nexport const resultProps = buildProps({\n /**\n * @description title of result\n */\n title: {\n type: String,\n default: '',\n },\n /**\n * @description sub title of result\n */\n subTitle: {\n type: String,\n default: '',\n },\n /**\n * @description icon type of result\n */\n icon: {\n type: String,\n values: ['success', 'warning', 'info', 'error'],\n default: 'info',\n },\n} as const)\n\nexport type ResultProps = ExtractPropTypes<typeof resultProps>\n\nexport type ResultInstance = InstanceType<typeof Result>\n"],"names":[],"mappings":";;;;AAOY,MAAC,OAAO,GAAG;AACvB,EAAE,OAAO,EAAE,cAAc;AACzB,EAAE,OAAO,EAAE,cAAc;AACzB,EAAE,KAAK,EAAE,YAAY;AACrB,EAAE,IAAI,EAAE,WAAW;AACnB,EAAE;AACU,MAAC,gBAAgB,GAAG;AAChC,EAAE,CAAC,OAAO,CAAC,OAAO,GAAG,iBAAiB;AACtC,EAAE,CAAC,OAAO,CAAC,OAAO,GAAG,aAAa;AAClC,EAAE,CAAC,OAAO,CAAC,KAAK,GAAG,iBAAiB;AACpC,EAAE,CAAC,OAAO,CAAC,IAAI,GAAG,UAAU;AAC5B,EAAE;AACU,MAAC,WAAW,GAAG,UAAU,CAAC;AACtC,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC;AACnD,IAAI,OAAO,EAAE,MAAM;AACnB,GAAG;AACH,CAAC;;;;"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import '../../utils/index.mjs';
|
2
|
-
import Row from './src/
|
3
|
-
export { RowAlign, RowJustify, rowProps } from './src/
|
2
|
+
import Row from './src/row2.mjs';
|
3
|
+
export { RowAlign, RowJustify, rowProps } from './src/row.mjs';
|
4
4
|
export { rowContextKey } from './src/constants.mjs';
|
5
5
|
import { withInstall } from '../../utils/vue/install.mjs';
|
6
6
|
|
@@ -1,50 +1,34 @@
|
|
1
|
-
import
|
2
|
-
import '../../../
|
3
|
-
import { rowContextKey } from './constants.mjs';
|
4
|
-
import { rowProps } from './row2.mjs';
|
5
|
-
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
6
|
-
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
1
|
+
import '../../../utils/index.mjs';
|
2
|
+
import { buildProps } from '../../../utils/vue/props/runtime.mjs';
|
7
3
|
|
8
|
-
const
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
return (_ctx, _cache) => {
|
35
|
-
return openBlock(), createBlock(resolveDynamicComponent(_ctx.tag), {
|
36
|
-
class: normalizeClass(unref(rowKls)),
|
37
|
-
style: normalizeStyle(unref(style))
|
38
|
-
}, {
|
39
|
-
default: withCtx(() => [
|
40
|
-
renderSlot(_ctx.$slots, "default")
|
41
|
-
]),
|
42
|
-
_: 3
|
43
|
-
}, 8, ["class", "style"]);
|
44
|
-
};
|
4
|
+
const RowJustify = [
|
5
|
+
"start",
|
6
|
+
"center",
|
7
|
+
"end",
|
8
|
+
"space-around",
|
9
|
+
"space-between",
|
10
|
+
"space-evenly"
|
11
|
+
];
|
12
|
+
const RowAlign = ["top", "middle", "bottom"];
|
13
|
+
const rowProps = buildProps({
|
14
|
+
tag: {
|
15
|
+
type: String,
|
16
|
+
default: "div"
|
17
|
+
},
|
18
|
+
gutter: {
|
19
|
+
type: Number,
|
20
|
+
default: 0
|
21
|
+
},
|
22
|
+
justify: {
|
23
|
+
type: String,
|
24
|
+
values: RowJustify,
|
25
|
+
default: "start"
|
26
|
+
},
|
27
|
+
align: {
|
28
|
+
type: String,
|
29
|
+
values: RowAlign
|
45
30
|
}
|
46
31
|
});
|
47
|
-
var Row = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "row.vue"]]);
|
48
32
|
|
49
|
-
export {
|
33
|
+
export { RowAlign, RowJustify, rowProps };
|
50
34
|
//# sourceMappingURL=row.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"row.mjs","sources":["../../../../../../packages/components/row/src/row.
|
1
|
+
{"version":3,"file":"row.mjs","sources":["../../../../../../packages/components/row/src/row.ts"],"sourcesContent":["import { buildProps } from '@element-plus/utils'\nimport type { ExtractPropTypes } from 'vue'\nimport type Row from './row.vue'\n\nexport const RowJustify = [\n 'start',\n 'center',\n 'end',\n 'space-around',\n 'space-between',\n 'space-evenly',\n] as const\n\nexport const RowAlign = ['top', 'middle', 'bottom'] as const\n\nexport const rowProps = buildProps({\n /**\n * @description custom element tag\n */\n tag: {\n type: String,\n default: 'div',\n },\n /**\n * @description grid spacing\n */\n gutter: {\n type: Number,\n default: 0,\n },\n /**\n * @description horizontal alignment of flex layout\n */\n justify: {\n type: String,\n values: RowJustify,\n default: 'start',\n },\n /**\n * @description vertical alignment of flex layout\n */\n align: {\n type: String,\n values: RowAlign,\n },\n} as const)\n\nexport type RowProps = ExtractPropTypes<typeof rowProps>\nexport type RowInstance = InstanceType<typeof Row>\n"],"names":[],"mappings":";;;AACY,MAAC,UAAU,GAAG;AAC1B,EAAE,OAAO;AACT,EAAE,QAAQ;AACV,EAAE,KAAK;AACP,EAAE,cAAc;AAChB,EAAE,eAAe;AACjB,EAAE,cAAc;AAChB,EAAE;AACU,MAAC,QAAQ,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE;AACxC,MAAC,QAAQ,GAAG,UAAU,CAAC;AACnC,EAAE,GAAG,EAAE;AACP,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,OAAO,EAAE;AACX,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,UAAU;AACtB,IAAI,OAAO,EAAE,OAAO;AACpB,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,QAAQ;AACpB,GAAG;AACH,CAAC;;;;"}
|
@@ -1,34 +1,50 @@
|
|
1
|
-
import '
|
2
|
-
import
|
1
|
+
import { defineComponent, computed, provide, openBlock, createBlock, resolveDynamicComponent, normalizeClass, unref, normalizeStyle, withCtx, renderSlot } from 'vue';
|
2
|
+
import '../../../hooks/index.mjs';
|
3
|
+
import { rowContextKey } from './constants.mjs';
|
4
|
+
import { rowProps } from './row.mjs';
|
5
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
6
|
+
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
3
7
|
|
4
|
-
const
|
5
|
-
"
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
const
|
13
|
-
const
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
8
|
+
const __default__ = defineComponent({
|
9
|
+
name: "ElRow"
|
10
|
+
});
|
11
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
12
|
+
...__default__,
|
13
|
+
props: rowProps,
|
14
|
+
setup(__props) {
|
15
|
+
const props = __props;
|
16
|
+
const ns = useNamespace("row");
|
17
|
+
const gutter = computed(() => props.gutter);
|
18
|
+
provide(rowContextKey, {
|
19
|
+
gutter
|
20
|
+
});
|
21
|
+
const style = computed(() => {
|
22
|
+
const styles = {};
|
23
|
+
if (!props.gutter) {
|
24
|
+
return styles;
|
25
|
+
}
|
26
|
+
styles.marginRight = styles.marginLeft = `-${props.gutter / 2}px`;
|
27
|
+
return styles;
|
28
|
+
});
|
29
|
+
const rowKls = computed(() => [
|
30
|
+
ns.b(),
|
31
|
+
ns.is(`justify-${props.justify}`, props.justify !== "start"),
|
32
|
+
ns.is(`align-${props.align}`, !!props.align)
|
33
|
+
]);
|
34
|
+
return (_ctx, _cache) => {
|
35
|
+
return openBlock(), createBlock(resolveDynamicComponent(_ctx.tag), {
|
36
|
+
class: normalizeClass(unref(rowKls)),
|
37
|
+
style: normalizeStyle(unref(style))
|
38
|
+
}, {
|
39
|
+
default: withCtx(() => [
|
40
|
+
renderSlot(_ctx.$slots, "default")
|
41
|
+
]),
|
42
|
+
_: 3
|
43
|
+
}, 8, ["class", "style"]);
|
44
|
+
};
|
30
45
|
}
|
31
46
|
});
|
47
|
+
var Row = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "row.vue"]]);
|
32
48
|
|
33
|
-
export {
|
49
|
+
export { Row as default };
|
34
50
|
//# sourceMappingURL=row2.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"row2.mjs","sources":["../../../../../../packages/components/row/src/row.
|
1
|
+
{"version":3,"file":"row2.mjs","sources":["../../../../../../packages/components/row/src/row.vue"],"sourcesContent":["<template>\n <component :is=\"tag\" :class=\"rowKls\" :style=\"style\">\n <slot />\n </component>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, provide } from 'vue'\nimport { useNamespace } from '@element-plus/hooks'\nimport { rowContextKey } from './constants'\nimport { rowProps } from './row'\nimport type { CSSProperties } from 'vue'\n\ndefineOptions({\n name: 'ElRow',\n})\n\nconst props = defineProps(rowProps)\n\nconst ns = useNamespace('row')\nconst gutter = computed(() => props.gutter)\n\nprovide(rowContextKey, {\n gutter,\n})\n\nconst style = computed(() => {\n const styles: CSSProperties = {}\n if (!props.gutter) {\n return styles\n }\n\n styles.marginRight = styles.marginLeft = `-${props.gutter / 2}px`\n return styles\n})\n\nconst rowKls = computed(() => [\n ns.b(),\n ns.is(`justify-${props.justify}`, props.justify !== 'start'),\n ns.is(`align-${props.align}`, !!props.align),\n])\n</script>\n"],"names":[],"mappings":";;;;;;;mCAac,CAAA;AAAA,EACZ,IAAM,EAAA,OAAA;AACR,CAAA,CAAA,CAAA;;;;;;AAIA,IAAM,MAAA,EAAA,GAAK,aAAa,KAAK,CAAA,CAAA;AAC7B,IAAA,MAAM,MAAS,GAAA,QAAA,CAAS,MAAM,KAAA,CAAM,MAAM,CAAA,CAAA;AAE1C,IAAA,OAAA,CAAQ,aAAe,EAAA;AAAA,MACrB,MAAA;AAAA,KACD,CAAA,CAAA;AAED,IAAM,MAAA,KAAA,GAAQ,SAAS,MAAM;AAC3B,MAAA,MAAM,SAAwB,EAAC,CAAA;AAC/B,MAAI,IAAA,CAAC,MAAM,MAAQ,EAAA;AACjB,QAAO,OAAA,MAAA,CAAA;AAAA,OACT;AAEA,MAAA,MAAA,CAAO,cAAc,MAAO,CAAA,UAAA,GAAa,CAAI,CAAA,EAAA,KAAA,CAAM,SAAS,CAAC,CAAA,EAAA,CAAA,CAAA;AAC7D,MAAO,OAAA,MAAA,CAAA;AAAA,KACR,CAAA,CAAA;AAED,IAAM,MAAA,MAAA,GAAS,SAAS,MAAM;AAAA,MAC5B,GAAG,CAAE,EAAA;AAAA,MACL,EAAA,CAAG,GAAG,CAAW,QAAA,EAAA,KAAA,CAAM,OAAO,CAAI,CAAA,EAAA,KAAA,CAAM,YAAY,OAAO,CAAA;AAAA,MAC3D,EAAA,CAAG,GAAG,CAAS,MAAA,EAAA,KAAA,CAAM,KAAK,CAAI,CAAA,EAAA,CAAC,CAAC,KAAA,CAAM,KAAK,CAAA;AAAA,KAC5C,CAAA,CAAA;;;;;;;;;;;;;;;;;;"}
|
@@ -2,7 +2,7 @@ import '../../utils/index.mjs';
|
|
2
2
|
import Scrollbar from './src/scrollbar2.mjs';
|
3
3
|
export { BAR_MAP, GAP, renderThumbStyle } from './src/util.mjs';
|
4
4
|
export { scrollbarEmits, scrollbarProps } from './src/scrollbar.mjs';
|
5
|
-
export { thumbProps } from './src/
|
5
|
+
export { thumbProps } from './src/thumb2.mjs';
|
6
6
|
export { scrollbarContextKey } from './src/constants.mjs';
|
7
7
|
import { withInstall } from '../../utils/vue/install.mjs';
|
8
8
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { defineComponent, inject, ref, openBlock, createElementBlock, Fragment, createVNode } from 'vue';
|
2
2
|
import { GAP } from './util.mjs';
|
3
|
-
import Thumb from './
|
3
|
+
import Thumb from './thumb.mjs';
|
4
4
|
import { barProps } from './bar.mjs';
|
5
5
|
import { scrollbarContextKey } from './constants.mjs';
|
6
6
|
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
@@ -1,16 +1,135 @@
|
|
1
|
+
import { defineComponent, inject, ref, computed, onBeforeUnmount, toRef, openBlock, createBlock, Transition, unref, withCtx, withDirectives, createElementVNode, normalizeClass, normalizeStyle, vShow } from 'vue';
|
2
|
+
import { isClient, useEventListener } from '@vueuse/core';
|
1
3
|
import '../../../utils/index.mjs';
|
2
|
-
import
|
4
|
+
import '../../../hooks/index.mjs';
|
5
|
+
import { scrollbarContextKey } from './constants.mjs';
|
6
|
+
import { BAR_MAP, renderThumbStyle } from './util.mjs';
|
7
|
+
import { thumbProps } from './thumb2.mjs';
|
8
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
9
|
+
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
10
|
+
import { throwError } from '../../../utils/error.mjs';
|
3
11
|
|
4
|
-
const
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
12
|
+
const COMPONENT_NAME = "Thumb";
|
13
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
14
|
+
__name: "thumb",
|
15
|
+
props: thumbProps,
|
16
|
+
setup(__props) {
|
17
|
+
const props = __props;
|
18
|
+
const scrollbar = inject(scrollbarContextKey);
|
19
|
+
const ns = useNamespace("scrollbar");
|
20
|
+
if (!scrollbar)
|
21
|
+
throwError(COMPONENT_NAME, "can not inject scrollbar context");
|
22
|
+
const instance = ref();
|
23
|
+
const thumb = ref();
|
24
|
+
const thumbState = ref({});
|
25
|
+
const visible = ref(false);
|
26
|
+
let cursorDown = false;
|
27
|
+
let cursorLeave = false;
|
28
|
+
let originalOnSelectStart = isClient ? document.onselectstart : null;
|
29
|
+
const bar = computed(() => BAR_MAP[props.vertical ? "vertical" : "horizontal"]);
|
30
|
+
const thumbStyle = computed(() => renderThumbStyle({
|
31
|
+
size: props.size,
|
32
|
+
move: props.move,
|
33
|
+
bar: bar.value
|
34
|
+
}));
|
35
|
+
const offsetRatio = computed(() => instance.value[bar.value.offset] ** 2 / scrollbar.wrapElement[bar.value.scrollSize] / props.ratio / thumb.value[bar.value.offset]);
|
36
|
+
const clickThumbHandler = (e) => {
|
37
|
+
var _a;
|
38
|
+
e.stopPropagation();
|
39
|
+
if (e.ctrlKey || [1, 2].includes(e.button))
|
40
|
+
return;
|
41
|
+
(_a = window.getSelection()) == null ? void 0 : _a.removeAllRanges();
|
42
|
+
startDrag(e);
|
43
|
+
const el = e.currentTarget;
|
44
|
+
if (!el)
|
45
|
+
return;
|
46
|
+
thumbState.value[bar.value.axis] = el[bar.value.offset] - (e[bar.value.client] - el.getBoundingClientRect()[bar.value.direction]);
|
47
|
+
};
|
48
|
+
const clickTrackHandler = (e) => {
|
49
|
+
if (!thumb.value || !instance.value || !scrollbar.wrapElement)
|
50
|
+
return;
|
51
|
+
const offset = Math.abs(e.target.getBoundingClientRect()[bar.value.direction] - e[bar.value.client]);
|
52
|
+
const thumbHalf = thumb.value[bar.value.offset] / 2;
|
53
|
+
const thumbPositionPercentage = (offset - thumbHalf) * 100 * offsetRatio.value / instance.value[bar.value.offset];
|
54
|
+
scrollbar.wrapElement[bar.value.scroll] = thumbPositionPercentage * scrollbar.wrapElement[bar.value.scrollSize] / 100;
|
55
|
+
};
|
56
|
+
const startDrag = (e) => {
|
57
|
+
e.stopImmediatePropagation();
|
58
|
+
cursorDown = true;
|
59
|
+
document.addEventListener("mousemove", mouseMoveDocumentHandler);
|
60
|
+
document.addEventListener("mouseup", mouseUpDocumentHandler);
|
61
|
+
originalOnSelectStart = document.onselectstart;
|
62
|
+
document.onselectstart = () => false;
|
63
|
+
};
|
64
|
+
const mouseMoveDocumentHandler = (e) => {
|
65
|
+
if (!instance.value || !thumb.value)
|
66
|
+
return;
|
67
|
+
if (cursorDown === false)
|
68
|
+
return;
|
69
|
+
const prevPage = thumbState.value[bar.value.axis];
|
70
|
+
if (!prevPage)
|
71
|
+
return;
|
72
|
+
const offset = (instance.value.getBoundingClientRect()[bar.value.direction] - e[bar.value.client]) * -1;
|
73
|
+
const thumbClickPosition = thumb.value[bar.value.offset] - prevPage;
|
74
|
+
const thumbPositionPercentage = (offset - thumbClickPosition) * 100 * offsetRatio.value / instance.value[bar.value.offset];
|
75
|
+
scrollbar.wrapElement[bar.value.scroll] = thumbPositionPercentage * scrollbar.wrapElement[bar.value.scrollSize] / 100;
|
76
|
+
};
|
77
|
+
const mouseUpDocumentHandler = () => {
|
78
|
+
cursorDown = false;
|
79
|
+
thumbState.value[bar.value.axis] = 0;
|
80
|
+
document.removeEventListener("mousemove", mouseMoveDocumentHandler);
|
81
|
+
document.removeEventListener("mouseup", mouseUpDocumentHandler);
|
82
|
+
restoreOnselectstart();
|
83
|
+
if (cursorLeave)
|
84
|
+
visible.value = false;
|
85
|
+
};
|
86
|
+
const mouseMoveScrollbarHandler = () => {
|
87
|
+
cursorLeave = false;
|
88
|
+
visible.value = !!props.size;
|
89
|
+
};
|
90
|
+
const mouseLeaveScrollbarHandler = () => {
|
91
|
+
cursorLeave = true;
|
92
|
+
visible.value = cursorDown;
|
93
|
+
};
|
94
|
+
onBeforeUnmount(() => {
|
95
|
+
restoreOnselectstart();
|
96
|
+
document.removeEventListener("mouseup", mouseUpDocumentHandler);
|
97
|
+
});
|
98
|
+
const restoreOnselectstart = () => {
|
99
|
+
if (document.onselectstart !== originalOnSelectStart)
|
100
|
+
document.onselectstart = originalOnSelectStart;
|
101
|
+
};
|
102
|
+
useEventListener(toRef(scrollbar, "scrollbarElement"), "mousemove", mouseMoveScrollbarHandler);
|
103
|
+
useEventListener(toRef(scrollbar, "scrollbarElement"), "mouseleave", mouseLeaveScrollbarHandler);
|
104
|
+
return (_ctx, _cache) => {
|
105
|
+
return openBlock(), createBlock(Transition, {
|
106
|
+
name: unref(ns).b("fade"),
|
107
|
+
persisted: ""
|
108
|
+
}, {
|
109
|
+
default: withCtx(() => [
|
110
|
+
withDirectives(createElementVNode("div", {
|
111
|
+
ref_key: "instance",
|
112
|
+
ref: instance,
|
113
|
+
class: normalizeClass([unref(ns).e("bar"), unref(ns).is(unref(bar).key)]),
|
114
|
+
onMousedown: clickTrackHandler
|
115
|
+
}, [
|
116
|
+
createElementVNode("div", {
|
117
|
+
ref_key: "thumb",
|
118
|
+
ref: thumb,
|
119
|
+
class: normalizeClass(unref(ns).e("thumb")),
|
120
|
+
style: normalizeStyle(unref(thumbStyle)),
|
121
|
+
onMousedown: clickThumbHandler
|
122
|
+
}, null, 38)
|
123
|
+
], 34), [
|
124
|
+
[vShow, _ctx.always || visible.value]
|
125
|
+
])
|
126
|
+
]),
|
127
|
+
_: 1
|
128
|
+
}, 8, ["name"]);
|
129
|
+
};
|
130
|
+
}
|
13
131
|
});
|
132
|
+
var Thumb = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "thumb.vue"]]);
|
14
133
|
|
15
|
-
export {
|
134
|
+
export { Thumb as default };
|
16
135
|
//# sourceMappingURL=thumb.mjs.map
|