vft 0.0.89 → 0.0.91
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/attributes.json +1 -1
- package/es/comp-resolver.js +20 -29
- package/es/components/affix/affix.vue2.js +34 -34
- package/es/components/alert/alert.vue2.js +44 -44
- package/es/components/avatar/avatar.vue2.js +28 -28
- package/es/components/backtop/backtop.vue2.js +11 -11
- package/es/components/button/button-group.vue2.js +8 -8
- package/es/components/button/button.vue2.js +39 -39
- package/es/components/card/card.vue2.js +20 -20
- package/es/components/check-tag/check-tag.vue2.js +14 -14
- package/es/components/checkbox/checkbox-button.vue2.js +61 -61
- package/es/components/checkbox/checkbox-group.vue2.js +27 -27
- package/es/components/checkbox/checkbox.vue2.js +81 -81
- package/es/components/clamp/clamp.vue2.js +59 -59
- package/es/components/clamp-toggle/clamp-toggle.vue2.js +25 -25
- package/es/components/col/col.vue2.js +33 -33
- package/es/components/color-picker/color-picker.vue2.js +126 -126
- package/es/components/color-picker/components/alpha-slider.vue2.js +12 -12
- package/es/components/config-provider/config-provider.vue2.js +29 -29
- package/es/components/container/aside.vue2.js +9 -9
- package/es/components/container/container.vue2.js +11 -11
- package/es/components/container/footer.vue2.js +8 -8
- package/es/components/container/header.vue2.js +9 -9
- package/es/components/context-menu/context-menu.vue2.js +29 -29
- package/es/components/date-picker/date-picker-com/basic-date-table.vue2.js +53 -53
- package/es/components/date-picker/date-picker-com/basic-month-table.vue2.js +19 -19
- package/es/components/date-picker/date-picker-com/basic-year-table.vue2.js +32 -32
- package/es/components/date-picker/date-picker-com/panel-date-pick.vue2.js +168 -168
- package/es/components/date-picker/date-picker-com/panel-date-range.vue2.js +89 -89
- package/es/components/date-picker/date-picker-com/panel-month-range.vue2.js +38 -38
- package/es/components/descriptions/description-item.vue2.js +16 -16
- package/es/components/descriptions/description.vue2.js +54 -54
- package/es/components/descriptions/descriptions-row.vue2.js +24 -24
- package/es/components/dialog/dialog-content.vue2.js +30 -30
- package/es/components/dialog/dialog.vue2.js +64 -64
- package/es/components/divider/divider.vue2.js +20 -20
- package/es/components/dropdown/dropdown.vue.js +2 -127
- package/es/components/dropdown/dropdown.vue2.js +234 -181
- package/es/components/dropdown/index.js +10 -17
- package/es/components/dropdown/style/css.js +5 -0
- package/es/components/dropdown/style/index.js +5 -0
- package/es/components/dropdown/tokens.js +1 -1
- package/es/components/empty/empty.vue2.js +27 -27
- package/es/components/exception/exception.vue2.js +19 -19
- package/es/components/footer-layout/footer-layout.vue2.js +1 -1
- package/es/components/form/form-item.vue2.js +77 -77
- package/es/components/form/form.vue2.js +37 -37
- package/es/components/full-screen/full-screen.vue2.js +26 -15
- package/es/components/header-layout/header-layout.vue2.js +27 -27
- package/es/components/horizontal-menu/horizontal-menu.vue2.js +43 -43
- package/es/components/icon/icon.vue2.js +24 -24
- package/es/components/icon-text/icon-text.vue2.js +27 -27
- package/es/components/iframe-layout/iframe-layout.vue2.js +18 -18
- package/es/components/iframe-layout/iframe-page.vue2.js +11 -11
- package/es/components/image/image.vue2.js +73 -73
- package/es/components/image-viewer/image-viewer.vue2.js +109 -109
- package/es/components/index.js +145 -150
- package/es/components/input/input.vue2.js +175 -175
- package/es/components/link/link.vue2.js +27 -27
- package/es/components/list-cell/list-cell.vue2.js +8 -8
- package/es/components/logo/logo.vue2.js +27 -27
- package/es/components/md-container/md-container.vue2.js +1 -1
- package/es/components/md-vue-playground/md-vue-playground.vue2.js +16 -16
- package/es/components/menu/menu-item-group.vue2.js +15 -15
- package/es/components/menu/menu-item.vue2.js +56 -56
- package/es/components/menu/menu.vue2.js +20 -20
- package/es/components/menu/sub-menu.vue2.js +16 -16
- package/es/components/message/message.vue2.js +81 -81
- package/es/components/multiple-tabs/multiple-tabs.vue2.js +12 -12
- package/es/components/multiple-tabs/tab-content.vue2.js +16 -16
- package/es/components/overlay/overlay.vue2.js +14 -14
- package/es/components/page-wrapper/page-wrapper.vue2.js +12 -12
- package/es/components/pagination/components/jumper.vue2.js +22 -22
- package/es/components/pagination/components/next.vue2.js +12 -12
- package/es/components/pagination/components/pager.vue2.js +75 -75
- package/es/components/pagination/components/prev.vue2.js +13 -13
- package/es/components/pagination/components/sizes.vue2.js +11 -11
- package/es/components/pagination/components/total.vue2.js +8 -8
- package/es/components/pagination/pagination.vue2.js +28 -28
- package/es/components/popconfirm/popconfirm.vue2.js +50 -50
- package/es/components/popover/popover.vue2.js +44 -44
- package/es/components/popper/arrow.vue2.js +2 -2
- package/es/components/popper/content.vue2.js +34 -34
- package/es/components/popper/popper.vue2.js +5 -5
- package/es/components/popper/trigger.vue2.js +48 -48
- package/es/components/qrcode/qrcode.vue2.js +35 -35
- package/es/components/radio/radio-button.vue2.js +28 -28
- package/es/components/radio/radio-group.vue2.js +26 -26
- package/es/components/radio/radio.vue2.js +44 -44
- package/es/components/result/result.vue2.js +10 -10
- package/es/components/router-view-content/router-view-content.vue2.js +20 -20
- package/es/components/row/row.vue2.js +19 -19
- package/es/components/scrollbar/bar.vue2.js +19 -19
- package/es/components/scrollbar/scrollbar.vue2.js +67 -67
- package/es/components/scrollbar/thumb.vue2.js +41 -41
- package/es/components/search/search.vue2.js +65 -65
- package/es/components/side-menu/side-menu.vue2.js +36 -36
- package/es/components/skeleton/skeleton-item.vue2.js +13 -13
- package/es/components/skeleton/skeleton.vue2.js +19 -19
- package/es/components/switch/switch.vue2.js +128 -128
- package/es/components/table/index.js +5 -3
- package/es/components/table/table.vue2.js +70 -70
- package/es/components/tabs/tab-bar.vue2.js +15 -15
- package/es/components/tabs/tab-nav.vue2.js +33 -33
- package/es/components/tabs/tab-pane.vue2.js +21 -21
- package/es/components/tabs/tabs.vue2.js +64 -66
- package/es/components/tag/tag.vue2.js +7 -7
- package/es/components/time-picker/common/picker.vue2.js +14 -14
- package/es/components/time-picker/time-picker-com/basic-time-spinner.vue2.js +60 -60
- package/es/components/time-picker/time-picker-com/panel-time-pick.vue2.js +30 -30
- package/es/components/time-picker/time-picker-com/panel-time-range.vue2.js +57 -57
- package/es/components/time-select/time-select.vue2.js +29 -29
- package/es/components/tooltip/constants.js +1 -1
- package/es/components/tooltip/content.vue2.js +73 -73
- package/es/components/tooltip/tooltip.vue2.js +91 -91
- package/es/components/tooltip/trigger.vue2.js +33 -33
- package/es/components/verify-code/verify-code.vue2.js +25 -25
- package/es/index.js +208 -213
- package/es/package.json.js +1 -1
- package/lib/comp-resolver.cjs +1 -1
- package/lib/components/affix/affix.vue2.cjs +1 -1
- package/lib/components/alert/alert.vue2.cjs +1 -1
- package/lib/components/avatar/avatar.vue2.cjs +1 -1
- package/lib/components/backtop/backtop.vue2.cjs +1 -1
- package/lib/components/button/button-group.vue2.cjs +1 -1
- package/lib/components/button/button.vue2.cjs +1 -1
- package/lib/components/card/card.vue2.cjs +1 -1
- package/lib/components/check-tag/check-tag.vue2.cjs +1 -1
- package/lib/components/checkbox/checkbox-button.vue2.cjs +1 -1
- package/lib/components/checkbox/checkbox-group.vue2.cjs +1 -1
- package/lib/components/checkbox/checkbox.vue2.cjs +1 -1
- package/lib/components/clamp/clamp.vue2.cjs +1 -1
- package/lib/components/clamp-toggle/clamp-toggle.vue2.cjs +1 -1
- package/lib/components/col/col.vue2.cjs +1 -1
- package/lib/components/color-picker/color-picker.vue2.cjs +1 -1
- package/lib/components/color-picker/components/alpha-slider.vue2.cjs +1 -1
- package/lib/components/config-provider/config-provider.vue2.cjs +1 -1
- package/lib/components/container/aside.vue2.cjs +1 -1
- package/lib/components/container/container.vue2.cjs +1 -1
- package/lib/components/container/footer.vue2.cjs +1 -1
- package/lib/components/container/header.vue2.cjs +1 -1
- package/lib/components/context-menu/context-menu.vue2.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/basic-date-table.vue2.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/basic-month-table.vue2.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/basic-year-table.vue2.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/panel-date-pick.vue2.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/panel-date-range.vue2.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/panel-month-range.vue2.cjs +1 -1
- package/lib/components/descriptions/description-item.vue2.cjs +1 -1
- package/lib/components/descriptions/description.vue2.cjs +1 -1
- package/lib/components/descriptions/descriptions-row.vue2.cjs +1 -1
- package/lib/components/dialog/dialog-content.vue2.cjs +1 -1
- package/lib/components/dialog/dialog.vue2.cjs +1 -1
- package/lib/components/divider/divider.vue2.cjs +1 -1
- package/lib/components/dropdown/dropdown.vue.cjs +1 -1
- package/lib/components/dropdown/dropdown.vue2.cjs +1 -1
- package/lib/components/dropdown/index.cjs +1 -1
- package/lib/components/dropdown/style/css.cjs +1 -1
- package/lib/components/dropdown/style/index.cjs +1 -1
- package/lib/components/dropdown/tokens.cjs +1 -1
- package/lib/components/empty/empty.vue2.cjs +1 -1
- package/lib/components/exception/exception.vue2.cjs +1 -1
- package/lib/components/footer-layout/footer-layout.vue2.cjs +1 -1
- package/lib/components/form/form-item.vue2.cjs +1 -1
- package/lib/components/form/form.vue2.cjs +1 -1
- package/lib/components/full-screen/full-screen.vue2.cjs +1 -1
- package/lib/components/header-layout/header-layout.vue2.cjs +1 -1
- package/lib/components/horizontal-menu/horizontal-menu.vue2.cjs +1 -1
- package/lib/components/icon/icon.vue2.cjs +1 -1
- package/lib/components/icon-text/icon-text.vue2.cjs +1 -1
- package/lib/components/iframe-layout/iframe-layout.vue2.cjs +1 -1
- package/lib/components/iframe-layout/iframe-page.vue2.cjs +1 -1
- package/lib/components/image/image.vue2.cjs +1 -1
- package/lib/components/image-viewer/image-viewer.vue2.cjs +1 -1
- package/lib/components/index.cjs +1 -1
- package/lib/components/input/input.vue2.cjs +1 -1
- package/lib/components/link/link.vue2.cjs +1 -1
- package/lib/components/list-cell/list-cell.vue2.cjs +1 -1
- package/lib/components/logo/logo.vue2.cjs +1 -1
- package/lib/components/md-container/md-container.vue2.cjs +1 -1
- package/lib/components/md-vue-playground/md-vue-playground.vue2.cjs +1 -1
- package/lib/components/menu/menu-item-group.vue2.cjs +1 -1
- package/lib/components/menu/menu-item.vue2.cjs +1 -1
- package/lib/components/menu/menu.vue2.cjs +1 -1
- package/lib/components/menu/sub-menu.vue2.cjs +1 -1
- package/lib/components/message/message.vue2.cjs +1 -1
- package/lib/components/multiple-tabs/multiple-tabs.vue2.cjs +1 -1
- package/lib/components/multiple-tabs/tab-content.vue2.cjs +1 -1
- package/lib/components/overlay/overlay.vue2.cjs +1 -1
- package/lib/components/page-wrapper/page-wrapper.vue2.cjs +1 -1
- package/lib/components/pagination/components/jumper.vue2.cjs +1 -1
- package/lib/components/pagination/components/next.vue2.cjs +1 -1
- package/lib/components/pagination/components/pager.vue2.cjs +1 -1
- package/lib/components/pagination/components/prev.vue2.cjs +1 -1
- package/lib/components/pagination/components/sizes.vue2.cjs +1 -1
- package/lib/components/pagination/components/total.vue2.cjs +1 -1
- package/lib/components/pagination/pagination.vue2.cjs +1 -1
- package/lib/components/popconfirm/popconfirm.vue2.cjs +1 -1
- package/lib/components/popover/popover.vue2.cjs +1 -1
- package/lib/components/popper/arrow.vue2.cjs +1 -1
- package/lib/components/popper/content.vue2.cjs +1 -1
- package/lib/components/popper/trigger.vue2.cjs +1 -1
- package/lib/components/qrcode/qrcode.vue2.cjs +1 -1
- package/lib/components/radio/radio-button.vue2.cjs +1 -1
- package/lib/components/radio/radio-group.vue2.cjs +1 -1
- package/lib/components/radio/radio.vue2.cjs +1 -1
- package/lib/components/result/result.vue2.cjs +1 -1
- package/lib/components/router-view-content/router-view-content.vue2.cjs +1 -1
- package/lib/components/row/row.vue2.cjs +1 -1
- package/lib/components/scrollbar/bar.vue2.cjs +1 -1
- package/lib/components/scrollbar/scrollbar.vue2.cjs +1 -1
- package/lib/components/scrollbar/thumb.vue2.cjs +1 -1
- package/lib/components/search/search.vue2.cjs +1 -1
- package/lib/components/side-menu/side-menu.vue2.cjs +1 -1
- package/lib/components/skeleton/skeleton-item.vue2.cjs +1 -1
- package/lib/components/skeleton/skeleton.vue2.cjs +1 -1
- package/lib/components/switch/switch.vue2.cjs +1 -1
- package/lib/components/table/index.cjs +1 -1
- package/lib/components/table/table.vue2.cjs +1 -1
- package/lib/components/tabs/tab-bar.vue2.cjs +1 -1
- package/lib/components/tabs/tab-nav.vue2.cjs +1 -1
- package/lib/components/tabs/tab-pane.vue2.cjs +1 -1
- package/lib/components/tabs/tabs.vue2.cjs +1 -1
- package/lib/components/tag/tag.vue2.cjs +1 -1
- package/lib/components/time-picker/common/picker.vue2.cjs +1 -1
- package/lib/components/time-picker/time-picker-com/basic-time-spinner.vue2.cjs +1 -1
- package/lib/components/time-picker/time-picker-com/panel-time-pick.vue2.cjs +1 -1
- package/lib/components/time-picker/time-picker-com/panel-time-range.vue2.cjs +1 -1
- package/lib/components/time-select/time-select.vue2.cjs +1 -1
- package/lib/components/tooltip/constants.cjs +1 -1
- package/lib/components/tooltip/content.vue2.cjs +1 -1
- package/lib/components/tooltip/tooltip.vue2.cjs +1 -1
- package/lib/components/tooltip/trigger.vue2.cjs +1 -1
- package/lib/components/verify-code/verify-code.vue2.cjs +1 -1
- package/lib/index.cjs +1 -1
- package/lib/package.json.cjs +1 -1
- package/package.json +5 -5
- package/tags.json +1 -1
- package/web-types.json +1 -1
- package/theme-style/vft-back-top.css +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as s, computed as u, resolveComponent as
|
|
1
|
+
import { defineComponent as s, computed as u, resolveComponent as h, openBlock as a, createBlock as l, withCtx as y, KeepAlive as C, resolveDynamicComponent as p, unref as g, createCommentVNode as x } from "vue";
|
|
2
2
|
import { getRouterKeyPath as A } from "@vft/router";
|
|
3
3
|
import { useNamespace as B } from "../../hooks/use-namespace/index.js";
|
|
4
4
|
import "@popperjs/core";
|
|
@@ -15,35 +15,35 @@ const k = (
|
|
|
15
15
|
}), S = /* @__PURE__ */ s({
|
|
16
16
|
...K,
|
|
17
17
|
props: {
|
|
18
|
-
cacheList:
|
|
18
|
+
cacheList: {},
|
|
19
19
|
openKeepAlive: { type: Boolean, default: !0 },
|
|
20
20
|
isReloadFlag: { type: Boolean },
|
|
21
21
|
pageErrorStatus: { type: Boolean },
|
|
22
22
|
enableErrorHandle: { type: Boolean },
|
|
23
|
-
exceptionComp:
|
|
23
|
+
exceptionComp: {}
|
|
24
24
|
},
|
|
25
25
|
setup(t) {
|
|
26
|
-
const
|
|
27
|
-
var
|
|
28
|
-
let
|
|
29
|
-
return (
|
|
30
|
-
var
|
|
31
|
-
return
|
|
32
|
-
})) == null ? void 0 : n[0].name), t.isReloadFlag ? void 0 :
|
|
26
|
+
const d = u(() => t.openKeepAlive ? t.cacheList : []), c = u(() => (e) => t.enableErrorHandle && t.pageErrorStatus && t.exceptionComp || e), v = u(() => (e) => {
|
|
27
|
+
var o, r, n;
|
|
28
|
+
let i = e.name;
|
|
29
|
+
return (o = e.meta) != null && o.currentActivePath && (i = (n = (r = e.matched) == null ? void 0 : r.filter((f) => {
|
|
30
|
+
var m;
|
|
31
|
+
return f.path === ((m = e.meta) == null ? void 0 : m.currentActivePath);
|
|
32
|
+
})) == null ? void 0 : n[0].name), t.isReloadFlag ? void 0 : i;
|
|
33
33
|
});
|
|
34
|
-
return (e,
|
|
35
|
-
const
|
|
36
|
-
return
|
|
37
|
-
default:
|
|
38
|
-
|
|
34
|
+
return (e, i) => {
|
|
35
|
+
const o = h("router-view");
|
|
36
|
+
return a(), l(o, null, {
|
|
37
|
+
default: y(({ Component: r, route: n }) => [
|
|
38
|
+
e.openKeepAlive ? (a(), l(C, {
|
|
39
39
|
key: 0,
|
|
40
|
-
include:
|
|
41
|
-
exclude:
|
|
40
|
+
include: d.value,
|
|
41
|
+
exclude: v.value(n)
|
|
42
42
|
}, [
|
|
43
|
-
|
|
44
|
-
key:
|
|
43
|
+
e.isReloadFlag ? (a(), l(p(c.value(r)), {
|
|
44
|
+
key: g(A)(n)
|
|
45
45
|
})) : x("", !0)
|
|
46
|
-
], 1032, ["include", "exclude"])) : (
|
|
46
|
+
], 1032, ["include", "exclude"])) : (a(), l(p(c.value(r)), {
|
|
47
47
|
key: n.fullPath
|
|
48
48
|
}))
|
|
49
49
|
]),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { rowContextKey as
|
|
3
|
-
import { useNamespace as
|
|
1
|
+
import { defineComponent as s, computed as r, provide as u, openBlock as p, createBlock as m, resolveDynamicComponent as f, normalizeClass as c, normalizeStyle as g, withCtx as d, renderSlot as y } from "vue";
|
|
2
|
+
import { rowContextKey as _ } from "./constants.js";
|
|
3
|
+
import { useNamespace as v } from "../../hooks/use-namespace/index.js";
|
|
4
4
|
import "@popperjs/core";
|
|
5
5
|
import "lodash";
|
|
6
6
|
import "../../hooks/use-z-index/index.js";
|
|
@@ -9,41 +9,41 @@ import "@vft/utils";
|
|
|
9
9
|
import "../../utils/ns-cover.js";
|
|
10
10
|
const o = (
|
|
11
11
|
/* hoist-static*/
|
|
12
|
-
|
|
13
|
-
),
|
|
12
|
+
v("row")
|
|
13
|
+
), C = s({
|
|
14
14
|
name: o.b()
|
|
15
|
-
}),
|
|
16
|
-
...
|
|
15
|
+
}), S = /* @__PURE__ */ s({
|
|
16
|
+
...C,
|
|
17
17
|
props: {
|
|
18
18
|
tag: { default: "div" },
|
|
19
19
|
gutter: { default: 0 },
|
|
20
20
|
justify: { default: "start" },
|
|
21
21
|
align: { default: "top" }
|
|
22
22
|
},
|
|
23
|
-
setup(
|
|
24
|
-
const t =
|
|
25
|
-
|
|
26
|
-
gutter:
|
|
23
|
+
setup(a) {
|
|
24
|
+
const t = a, n = r(() => t.gutter);
|
|
25
|
+
u(_, {
|
|
26
|
+
gutter: n
|
|
27
27
|
});
|
|
28
|
-
const
|
|
28
|
+
const i = r(() => {
|
|
29
29
|
const e = {};
|
|
30
30
|
return t.gutter && (e.marginRight = e.marginLeft = `-${t.gutter / 2}px`), e;
|
|
31
|
-
}),
|
|
31
|
+
}), l = r(() => [
|
|
32
32
|
o.b(),
|
|
33
33
|
o.is(`justify-${t.justify}`, t.justify !== "start"),
|
|
34
34
|
o.is(`align-${t.align}`, t.align !== "top")
|
|
35
35
|
]);
|
|
36
|
-
return (e,
|
|
37
|
-
class:
|
|
38
|
-
style:
|
|
36
|
+
return (e, j) => (p(), m(f(e.tag), {
|
|
37
|
+
class: c(l.value),
|
|
38
|
+
style: g(i.value)
|
|
39
39
|
}, {
|
|
40
|
-
default:
|
|
41
|
-
|
|
40
|
+
default: d(() => [
|
|
41
|
+
y(e.$slots, "default")
|
|
42
42
|
]),
|
|
43
43
|
_: 3
|
|
44
44
|
}, 8, ["class", "style"]));
|
|
45
45
|
}
|
|
46
46
|
});
|
|
47
47
|
export {
|
|
48
|
-
|
|
48
|
+
S as default
|
|
49
49
|
};
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { GAP as
|
|
3
|
-
import
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as u, ref as i, openBlock as c, createElementBlock as h, Fragment as d, createVNode as r } from "vue";
|
|
2
|
+
import { GAP as s } from "./util.js";
|
|
3
|
+
import n from "./thumb.vue2.js";
|
|
4
|
+
const w = /* @__PURE__ */ u({
|
|
5
5
|
__name: "bar",
|
|
6
6
|
props: {
|
|
7
7
|
always: { type: Boolean, default: !0 },
|
|
8
|
-
width:
|
|
9
|
-
height:
|
|
8
|
+
width: {},
|
|
9
|
+
height: {},
|
|
10
10
|
ratioX: { default: 1 },
|
|
11
11
|
ratioY: { default: 1 }
|
|
12
12
|
},
|
|
13
|
-
setup(
|
|
14
|
-
const
|
|
15
|
-
return
|
|
16
|
-
handleScroll: (
|
|
17
|
-
if (
|
|
18
|
-
const
|
|
19
|
-
|
|
13
|
+
setup(o, { expose: f }) {
|
|
14
|
+
const t = i(0), a = i(0);
|
|
15
|
+
return f({
|
|
16
|
+
handleScroll: (e) => {
|
|
17
|
+
if (e) {
|
|
18
|
+
const l = e.offsetHeight - s, m = e.offsetWidth - s;
|
|
19
|
+
a.value = e.scrollTop * 100 / l * o.ratioY, t.value = e.scrollLeft * 100 / m * o.ratioX;
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
-
}), (
|
|
23
|
-
n
|
|
24
|
-
move:
|
|
22
|
+
}), (e, l) => (c(), h(d, null, [
|
|
23
|
+
r(n, {
|
|
24
|
+
move: t.value,
|
|
25
25
|
ratio: e.ratioX,
|
|
26
26
|
size: e.width,
|
|
27
27
|
always: e.always
|
|
28
28
|
}, null, 8, ["move", "ratio", "size", "always"]),
|
|
29
|
-
n
|
|
30
|
-
move:
|
|
29
|
+
r(n, {
|
|
30
|
+
move: a.value,
|
|
31
31
|
ratio: e.ratioY,
|
|
32
32
|
size: e.height,
|
|
33
33
|
vertical: "",
|
|
@@ -37,5 +37,5 @@ const z = /* @__PURE__ */ m({
|
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
39
|
export {
|
|
40
|
-
|
|
40
|
+
w as default
|
|
41
41
|
};
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as L, ref as o, computed as w, watch as T, nextTick as E, provide as j, reactive as D, onMounted as G, onUpdated as X, openBlock as g, createElementBlock as Y, normalizeClass as b, unref as q, createElementVNode as F, normalizeStyle as N, createBlock as R, resolveDynamicComponent as I, withCtx as J, renderSlot as Q, createCommentVNode as Z } from "vue";
|
|
2
2
|
import { useResizeObserver as _, useEventListener as ee } from "@vueuse/core";
|
|
3
|
-
import { isNumber as r, addUnit as
|
|
3
|
+
import { isNumber as r, addUnit as B, isObject as te } from "@vft/utils";
|
|
4
4
|
import { useNamespace as le } from "../../hooks/use-namespace/index.js";
|
|
5
5
|
import "@popperjs/core";
|
|
6
6
|
import "lodash";
|
|
7
7
|
import "../../hooks/use-z-index/index.js";
|
|
8
|
-
import { debugWarn as
|
|
8
|
+
import { debugWarn as W } from "../../utils/error.js";
|
|
9
9
|
import "../../utils/ns-cover.js";
|
|
10
|
-
import { GAP as
|
|
10
|
+
import { GAP as m } from "./util.js";
|
|
11
11
|
import ae from "./bar.vue2.js";
|
|
12
12
|
import { scrollbarContextKey as oe } from "./constants.js";
|
|
13
|
-
const
|
|
13
|
+
const M = "ElScrollbar", s = (
|
|
14
14
|
/* hoist-static*/
|
|
15
15
|
le("scrollbar")
|
|
16
|
-
), ie =
|
|
16
|
+
), ie = L({
|
|
17
17
|
name: s.b()
|
|
18
|
-
}), ge = /* @__PURE__ */
|
|
18
|
+
}), ge = /* @__PURE__ */ L({
|
|
19
19
|
...ie,
|
|
20
20
|
props: {
|
|
21
21
|
height: { default: "" },
|
|
@@ -32,101 +32,101 @@ const L = "ElScrollbar", s = (
|
|
|
32
32
|
},
|
|
33
33
|
emits: {
|
|
34
34
|
scroll: ({
|
|
35
|
-
scrollTop:
|
|
35
|
+
scrollTop: l,
|
|
36
36
|
scrollLeft: v
|
|
37
|
-
}) => [
|
|
37
|
+
}) => [l, v].every(r)
|
|
38
38
|
},
|
|
39
|
-
setup(
|
|
39
|
+
setup(l, { expose: v, emit: $ }) {
|
|
40
40
|
let n, c;
|
|
41
|
-
const
|
|
41
|
+
const S = o(), t = o(), p = o(), x = o("0"), z = o("0"), d = o(), C = o(1), H = o(1), K = w(() => {
|
|
42
42
|
const e = {};
|
|
43
|
-
return
|
|
44
|
-
}),
|
|
45
|
-
|
|
43
|
+
return l.height && (e.height = B(l.height)), l.maxHeight && (e.maxHeight = B(l.maxHeight)), [l.wrapStyle, e];
|
|
44
|
+
}), O = w(() => [
|
|
45
|
+
l.wrapClass,
|
|
46
46
|
s.e("wrap"),
|
|
47
|
-
{ [s.em("wrap", "hidden-default")]: !
|
|
48
|
-
]),
|
|
47
|
+
{ [s.em("wrap", "hidden-default")]: !l.native }
|
|
48
|
+
]), A = w(() => [s.e("view"), l.viewClass]), k = () => {
|
|
49
49
|
var e;
|
|
50
|
-
|
|
51
|
-
scrollTop:
|
|
52
|
-
scrollLeft:
|
|
50
|
+
t.value && ((e = d.value) == null || e.handleScroll(t.value), $("scroll", {
|
|
51
|
+
scrollTop: t.value.scrollTop,
|
|
52
|
+
scrollLeft: t.value.scrollLeft
|
|
53
53
|
}));
|
|
54
54
|
};
|
|
55
|
-
function
|
|
56
|
-
te(e) ?
|
|
55
|
+
function P(e, a) {
|
|
56
|
+
te(e) ? t.value.scrollTo(e) : r(e) && r(a) && t.value.scrollTo(e, a);
|
|
57
57
|
}
|
|
58
|
-
const
|
|
58
|
+
const U = (e) => {
|
|
59
59
|
if (!r(e)) {
|
|
60
|
-
M
|
|
60
|
+
W(M, "value must be a number");
|
|
61
61
|
return;
|
|
62
62
|
}
|
|
63
|
-
|
|
64
|
-
},
|
|
63
|
+
t.value.scrollTop = e;
|
|
64
|
+
}, V = (e) => {
|
|
65
65
|
if (!r(e)) {
|
|
66
|
-
M
|
|
66
|
+
W(M, "value must be a number");
|
|
67
67
|
return;
|
|
68
68
|
}
|
|
69
|
-
|
|
69
|
+
t.value.scrollLeft = e;
|
|
70
70
|
}, i = () => {
|
|
71
|
-
if (!
|
|
71
|
+
if (!t.value)
|
|
72
72
|
return;
|
|
73
|
-
const e =
|
|
74
|
-
|
|
73
|
+
const e = t.value.offsetHeight - m, a = t.value.offsetWidth - m, h = e ** 2 / t.value.scrollHeight, y = a ** 2 / t.value.scrollWidth, f = Math.max(h, l.minSize), u = Math.max(y, l.minSize);
|
|
74
|
+
C.value = h / (e - h) / (f / (e - f)), H.value = y / (a - y) / (u / (a - u)), z.value = f + m < e ? `${f}px` : "", x.value = u + m < a ? `${u}px` : "";
|
|
75
75
|
};
|
|
76
|
-
return
|
|
77
|
-
() =>
|
|
76
|
+
return T(
|
|
77
|
+
() => l.noresize,
|
|
78
78
|
(e) => {
|
|
79
|
-
e ? (n == null || n(), c == null || c()) : ({ stop: n } = _(
|
|
79
|
+
e ? (n == null || n(), c == null || c()) : ({ stop: n } = _(p, i), c = ee("resize", i));
|
|
80
80
|
},
|
|
81
81
|
{ immediate: !0 }
|
|
82
|
-
),
|
|
83
|
-
() => [
|
|
82
|
+
), T(
|
|
83
|
+
() => [l.maxHeight, l.height],
|
|
84
84
|
() => {
|
|
85
|
-
|
|
85
|
+
l.native || E(() => {
|
|
86
86
|
var e;
|
|
87
|
-
i(),
|
|
87
|
+
i(), t.value && ((e = d.value) == null || e.handleScroll(t.value));
|
|
88
88
|
});
|
|
89
89
|
}
|
|
90
|
-
),
|
|
90
|
+
), j(
|
|
91
91
|
oe,
|
|
92
|
-
|
|
93
|
-
scrollbarElement:
|
|
94
|
-
wrapElement:
|
|
92
|
+
D({
|
|
93
|
+
scrollbarElement: S,
|
|
94
|
+
wrapElement: t
|
|
95
95
|
})
|
|
96
|
-
),
|
|
97
|
-
|
|
96
|
+
), G(() => {
|
|
97
|
+
l.native || E(() => {
|
|
98
98
|
i();
|
|
99
99
|
});
|
|
100
|
-
}),
|
|
100
|
+
}), X(() => i()), v({
|
|
101
101
|
/** @description scrollbar wrap ref */
|
|
102
|
-
wrapRef:
|
|
102
|
+
wrapRef: t,
|
|
103
103
|
/** @description update scrollbar state manually */
|
|
104
104
|
update: i,
|
|
105
105
|
/** @description scrolls to a particular set of coordinates */
|
|
106
|
-
scrollTo:
|
|
106
|
+
scrollTo: P,
|
|
107
107
|
/** @description set distance to scroll top */
|
|
108
|
-
setScrollTop:
|
|
108
|
+
setScrollTop: U,
|
|
109
109
|
/** @description set distance to scroll left */
|
|
110
|
-
setScrollLeft:
|
|
110
|
+
setScrollLeft: V,
|
|
111
111
|
/** @description handle scroll event */
|
|
112
|
-
handleScroll:
|
|
113
|
-
}), (e, a) => (
|
|
112
|
+
handleScroll: k
|
|
113
|
+
}), (e, a) => (g(), Y("div", {
|
|
114
114
|
ref_key: "scrollbarRef",
|
|
115
|
-
ref:
|
|
116
|
-
class:
|
|
115
|
+
ref: S,
|
|
116
|
+
class: b(q(s).b())
|
|
117
117
|
}, [
|
|
118
118
|
F("div", {
|
|
119
119
|
ref_key: "wrapRef",
|
|
120
|
-
ref:
|
|
121
|
-
class:
|
|
122
|
-
style:
|
|
123
|
-
onScroll:
|
|
120
|
+
ref: t,
|
|
121
|
+
class: b(O.value),
|
|
122
|
+
style: N(K.value),
|
|
123
|
+
onScroll: k
|
|
124
124
|
}, [
|
|
125
|
-
(
|
|
125
|
+
(g(), R(I(e.tag), {
|
|
126
126
|
ref_key: "resizeRef",
|
|
127
|
-
ref:
|
|
128
|
-
class:
|
|
129
|
-
style:
|
|
127
|
+
ref: p,
|
|
128
|
+
class: b(A.value),
|
|
129
|
+
style: N(e.viewStyle)
|
|
130
130
|
}, {
|
|
131
131
|
default: J(() => [
|
|
132
132
|
Q(e.$slots, "default")
|
|
@@ -134,15 +134,15 @@ const L = "ElScrollbar", s = (
|
|
|
134
134
|
_: 3
|
|
135
135
|
}, 8, ["class", "style"]))
|
|
136
136
|
], 38),
|
|
137
|
-
|
|
137
|
+
e.native ? Z("", !0) : (g(), R(ae, {
|
|
138
138
|
key: 0,
|
|
139
139
|
ref_key: "barRef",
|
|
140
|
-
ref:
|
|
141
|
-
height:
|
|
142
|
-
width:
|
|
143
|
-
always:
|
|
144
|
-
"ratio-x":
|
|
145
|
-
"ratio-y":
|
|
140
|
+
ref: d,
|
|
141
|
+
height: z.value,
|
|
142
|
+
width: x.value,
|
|
143
|
+
always: e.always,
|
|
144
|
+
"ratio-x": H.value,
|
|
145
|
+
"ratio-y": C.value
|
|
146
146
|
}, null, 8, ["height", "width", "always", "ratio-x", "ratio-y"]))
|
|
147
147
|
], 2));
|
|
148
148
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as T, inject as D, ref as
|
|
2
|
-
import { useEventListener as P, isClient as
|
|
1
|
+
import { defineComponent as T, inject as D, ref as m, computed as E, onBeforeUnmount as N, toRef as S, openBlock as A, createBlock as O, Transition as j, unref as v, withCtx as K, withDirectives as U, createElementVNode as z, normalizeClass as C, normalizeStyle as _, vShow as I } from "vue";
|
|
2
|
+
import { useEventListener as P, isClient as V } from "@vueuse/core";
|
|
3
3
|
import "@vft/utils";
|
|
4
4
|
import { throwError as q } from "../../utils/error.js";
|
|
5
5
|
import "lodash";
|
|
@@ -13,20 +13,20 @@ const W = "Thumb", se = /* @__PURE__ */ T({
|
|
|
13
13
|
__name: "thumb",
|
|
14
14
|
props: {
|
|
15
15
|
vertical: { type: Boolean },
|
|
16
|
-
size:
|
|
17
|
-
move:
|
|
18
|
-
ratio:
|
|
16
|
+
size: {},
|
|
17
|
+
move: {},
|
|
18
|
+
ratio: {},
|
|
19
19
|
always: { type: Boolean }
|
|
20
20
|
},
|
|
21
|
-
setup(
|
|
22
|
-
const o = D(G),
|
|
21
|
+
setup(s) {
|
|
22
|
+
const o = D(G), u = F("scrollbar");
|
|
23
23
|
o || q(W, "can not inject scrollbar context");
|
|
24
|
-
const
|
|
25
|
-
let
|
|
26
|
-
const e = E(() => J[
|
|
24
|
+
const l = m(), a = m(), f = m({}), c = m(!1);
|
|
25
|
+
let i = !1, d = !1, b = V ? document.onselectstart : null;
|
|
26
|
+
const e = E(() => J[s.vertical ? "vertical" : "horizontal"]), k = E(
|
|
27
27
|
() => Q({
|
|
28
|
-
size:
|
|
29
|
-
move:
|
|
28
|
+
size: s.size,
|
|
29
|
+
move: s.move,
|
|
30
30
|
bar: e.value
|
|
31
31
|
})
|
|
32
32
|
), g = E(
|
|
@@ -34,38 +34,38 @@ const W = "Thumb", se = /* @__PURE__ */ T({
|
|
|
34
34
|
// offsetRatioX = original width of thumb / current width of thumb / ratioX
|
|
35
35
|
// offsetRatioY = original height of thumb / current height of thumb / ratioY
|
|
36
36
|
// instance height = wrap height - GAP
|
|
37
|
-
|
|
37
|
+
l.value[e.value.offset] ** 2 / o.wrapElement[e.value.scrollSize] / s.ratio / a.value[e.value.offset]
|
|
38
38
|
)
|
|
39
39
|
), B = (t) => {
|
|
40
|
-
var
|
|
40
|
+
var r;
|
|
41
41
|
if (t.stopPropagation(), t.ctrlKey || [1, 2].includes(t.button))
|
|
42
42
|
return;
|
|
43
|
-
(
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
},
|
|
47
|
-
if (!
|
|
43
|
+
(r = window.getSelection()) == null || r.removeAllRanges(), M(t);
|
|
44
|
+
const n = t.currentTarget;
|
|
45
|
+
n && (f.value[e.value.axis] = n[e.value.offset] - (t[e.value.client] - n.getBoundingClientRect()[e.value.direction]));
|
|
46
|
+
}, L = (t) => {
|
|
47
|
+
if (!a.value || !l.value || !o.wrapElement)
|
|
48
48
|
return;
|
|
49
|
-
const
|
|
49
|
+
const n = Math.abs(
|
|
50
50
|
t.target.getBoundingClientRect()[e.value.direction] - t[e.value.client]
|
|
51
|
-
),
|
|
51
|
+
), r = a.value[e.value.offset] / 2, h = (n - r) * 100 * g.value / l.value[e.value.offset];
|
|
52
52
|
o.wrapElement[e.value.scroll] = h * o.wrapElement[e.value.scrollSize] / 100;
|
|
53
|
-
},
|
|
54
|
-
t.stopImmediatePropagation(),
|
|
53
|
+
}, M = (t) => {
|
|
54
|
+
t.stopImmediatePropagation(), i = !0, document.addEventListener("mousemove", w), document.addEventListener("mouseup", p), b = document.onselectstart, document.onselectstart = () => !1;
|
|
55
55
|
}, w = (t) => {
|
|
56
|
-
if (!
|
|
56
|
+
if (!l.value || !a.value || i === !1)
|
|
57
57
|
return;
|
|
58
|
-
const
|
|
59
|
-
if (!
|
|
58
|
+
const n = f.value[e.value.axis];
|
|
59
|
+
if (!n)
|
|
60
60
|
return;
|
|
61
|
-
const
|
|
61
|
+
const r = (l.value.getBoundingClientRect()[e.value.direction] - t[e.value.client]) * -1, h = a.value[e.value.offset] - n, R = (r - h) * 100 * g.value / l.value[e.value.offset];
|
|
62
62
|
o.wrapElement[e.value.scroll] = R * o.wrapElement[e.value.scrollSize] / 100;
|
|
63
63
|
}, p = () => {
|
|
64
|
-
|
|
65
|
-
},
|
|
66
|
-
d = !1,
|
|
64
|
+
i = !1, f.value[e.value.axis] = 0, document.removeEventListener("mousemove", w), document.removeEventListener("mouseup", p), y(), d && (c.value = !1);
|
|
65
|
+
}, x = () => {
|
|
66
|
+
d = !1, c.value = !!s.size;
|
|
67
67
|
}, H = () => {
|
|
68
|
-
d = !0,
|
|
68
|
+
d = !0, c.value = i;
|
|
69
69
|
};
|
|
70
70
|
N(() => {
|
|
71
71
|
y(), document.removeEventListener("mouseup", p);
|
|
@@ -76,30 +76,30 @@ const W = "Thumb", se = /* @__PURE__ */ T({
|
|
|
76
76
|
return P(
|
|
77
77
|
S(o, "scrollbarElement"),
|
|
78
78
|
"mousemove",
|
|
79
|
-
|
|
79
|
+
x
|
|
80
80
|
), P(
|
|
81
81
|
S(o, "scrollbarElement"),
|
|
82
82
|
"mouseleave",
|
|
83
83
|
H
|
|
84
|
-
), (t,
|
|
85
|
-
name: u
|
|
84
|
+
), (t, n) => (A(), O(j, {
|
|
85
|
+
name: v(u).b("fade")
|
|
86
86
|
}, {
|
|
87
87
|
default: K(() => [
|
|
88
88
|
U(z("div", {
|
|
89
89
|
ref_key: "instance",
|
|
90
|
-
ref:
|
|
91
|
-
class: C([u
|
|
92
|
-
onMousedown:
|
|
90
|
+
ref: l,
|
|
91
|
+
class: C([v(u).e("bar"), v(u).is(e.value.key)]),
|
|
92
|
+
onMousedown: L
|
|
93
93
|
}, [
|
|
94
94
|
z("div", {
|
|
95
95
|
ref_key: "thumb",
|
|
96
|
-
ref:
|
|
97
|
-
class: C(u
|
|
98
|
-
style:
|
|
96
|
+
ref: a,
|
|
97
|
+
class: C(v(u).e("thumb")),
|
|
98
|
+
style: _(k.value),
|
|
99
99
|
onMousedown: B
|
|
100
100
|
}, null, 38)
|
|
101
101
|
], 34), [
|
|
102
|
-
[
|
|
102
|
+
[I, t.always || c.value]
|
|
103
103
|
])
|
|
104
104
|
]),
|
|
105
105
|
_: 1
|