vft 0.0.429 → 0.0.431
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/dist/index.css +1 -1
- package/es/components/alert/alert.vue2.js +38 -38
- package/es/components/autocomplete/autocomplete.vue2.js +82 -82
- package/es/components/avatar/avatar.vue2.js +23 -23
- package/es/components/avatar-stack/avatar-stack.vue2.js +25 -25
- package/es/components/breadcrumb/breadcrumb-item.vue2.js +19 -19
- package/es/components/button/button.vue2.js +37 -37
- package/es/components/card/card.vue2.js +19 -19
- package/es/components/carousel/carousel.vue2.js +75 -75
- package/es/components/carousel/use-carousel.js +1 -1
- package/es/components/cascader-panel/index.vue2.js +2 -2
- package/es/components/cascader-panel/menu.vue2.js +2 -2
- package/es/components/cascader-panel/node.vue2.js +3 -4
- package/es/components/checkbox/checkbox-button.vue2.js +52 -52
- package/es/components/checkbox/checkbox-group.vue2.js +26 -26
- package/es/components/checkbox/checkbox.vue2.js +57 -57
- package/es/components/clamp/clamp.vue2.js +14 -14
- package/es/components/clamp-toggle/clamp-toggle.vue2.js +17 -17
- package/es/components/clamp-tooltip/clamp-tooltip.vue2.js +19 -19
- package/es/components/col/col.vue2.js +20 -20
- package/es/components/color-picker/color-picker.vue2.js +126 -128
- package/es/components/color-picker/components/sv-panel.vue.js +2 -2
- package/es/components/config-provider/hooks/use-global-config.js +3 -3
- package/es/components/context-menu/context-menu.vue2.js +18 -18
- package/es/components/date-picker/date-picker-com/panel-date-pick.vue2.js +37 -39
- package/es/components/date-picker/date-picker-com/panel-date-range.vue2.js +8 -10
- package/es/components/date-picker/date-picker.d.ts +1 -1
- package/es/components/date-picker/index.d.ts +2 -2
- package/es/components/descriptions/description.vue2.js +44 -44
- package/es/components/descriptions/descriptions-row.vue2.js +12 -12
- package/es/components/dialog/dialog-content.vue2.js +31 -31
- package/es/components/dialog/dialog.vue2.js +46 -46
- package/es/components/divider/divider.vue2.js +19 -19
- package/es/components/drawer/drawer.vue2.js +41 -41
- package/es/components/dropdown/dropdown-item-impl.vue2.js +40 -40
- package/es/components/dropdown/dropdown-item.vue2.js +28 -28
- package/es/components/dropdown/dropdown.vue2.js +124 -124
- package/es/components/form/form-item.vue2.js +71 -71
- package/es/components/header-layout/header-layout.vue2.js +25 -25
- package/es/components/icon/icon.vue2.js +15 -15
- package/es/components/icon-text/icon-text.vue2.js +28 -28
- package/es/components/iframe-layout/iframe-layout.vue2.js +13 -13
- package/es/components/iframe-layout/iframe-page.vue2.js +11 -11
- package/es/components/image/image.vue2.js +63 -63
- package/es/components/image-viewer/image-viewer.vue2.js +88 -88
- package/es/components/infinite-scroll/index.d.ts +1 -1
- package/es/components/input/input.vue2.js +112 -112
- package/es/components/input-number/input-number.vue2.js +100 -100
- package/es/components/input-tag/composables/use-input-tag.js +1 -1
- package/es/components/link/link.vue2.js +20 -20
- package/es/components/list-cell/list-cell.vue2.js +19 -19
- package/es/components/logo/logo.vue2.js +22 -22
- package/es/components/menu/menu-item-group.vue2.js +8 -8
- package/es/components/menu/menu-item.vue2.js +48 -48
- package/es/components/menu/sub-menu.vue2.js +33 -31
- package/es/components/message/message.vue2.js +66 -66
- package/es/components/modal/modal-footer-action.vue2.js +25 -25
- package/es/components/modal/modal.vue2.js +40 -40
- package/es/components/multiple-tabs/multiple-tabs.vue2.js +30 -30
- package/es/components/page-wrapper/page-wrapper.vue2.js +12 -12
- package/es/components/pagination/components/jumper.vue2.js +18 -18
- package/es/components/pagination/components/next.vue2.js +11 -11
- package/es/components/pagination/components/pager.vue2.js +74 -74
- package/es/components/pagination/components/prev.vue2.js +9 -9
- package/es/components/pagination/components/sizes.vue2.js +18 -18
- package/es/components/pagination/components/total.vue2.js +8 -8
- package/es/components/popconfirm/popconfirm.vue2.js +47 -47
- package/es/components/popover/popover.vue2.js +28 -28
- package/es/components/popper/trigger.vue2.js +9 -9
- package/es/components/progress/progress.vue2.js +87 -87
- package/es/components/qrcode/qrcode.vue2.js +31 -31
- package/es/components/radio/radio-button.vue2.js +17 -17
- package/es/components/radio/radio-group.vue2.js +35 -35
- package/es/components/router-view-content/router-view-content.vue2.js +25 -25
- package/es/components/roving-focus-group/roving-focus-item.vue2.js +30 -30
- package/es/components/row/row.vue2.js +5 -5
- package/es/components/scrollbar/bar.vue2.js +16 -16
- package/es/components/scrollbar/scrollbar.vue2.js +48 -48
- package/es/components/scrollbar/thumb.vue2.js +27 -27
- package/es/components/search/search.vue2.js +29 -29
- package/es/components/select/index.d.ts +1 -1
- package/es/components/select/select.vue.d.ts +1 -1
- package/es/components/side-menu/index.d.ts +2 -8
- package/es/components/side-menu/side-menu.vue.d.ts +8 -62
- package/es/components/side-menu/side-menu.vue2.js +48 -46
- package/es/components/side-menu/types.d.ts +107 -0
- package/es/components/side-menu/use-drag-line.d.ts +3 -1
- package/es/components/side-menu/use-drag-line.js +39 -28
- package/es/components/skeleton/skeleton-item.vue2.js +9 -9
- package/es/components/skeleton/skeleton.vue2.js +14 -14
- package/es/components/slider/button.vue2.js +54 -54
- package/es/components/slider/slider.vue2.js +106 -106
- package/es/components/steps/item.vue2.js +56 -56
- package/es/components/steps/steps.vue2.js +16 -16
- package/es/components/super-form/super-form-action.vue2.js +28 -28
- package/es/components/super-form/super-form-item.vue2.js +1 -1
- package/es/components/switch/switch.vue2.js +108 -108
- package/es/components/table/field.d.ts +4 -4
- package/es/components/teleport/teleport.vue2.js +6 -6
- package/es/components/time-picker/common/picker.vue.d.ts +1 -1
- package/es/components/time-picker/index.d.ts +2 -2
- package/es/components/time-picker/time-picker.d.ts +1 -1
- package/es/components/timeline/timeline-item.vue2.js +20 -20
- package/es/components/tooltip/content.vue2.js +57 -57
- package/es/components/tooltip/tooltip.vue2.js +66 -66
- package/es/components/tooltip/trigger.vue2.js +42 -42
- package/es/components/tree/tree.vue2.js +72 -72
- package/es/components/upload/upload-content.vue2.js +85 -85
- package/es/components/upload/upload-list.vue2.js +70 -70
- package/es/components/upload/upload.vue2.js +86 -86
- package/es/components/verify-code/verify-code.vue2.js +18 -18
- package/es/package.json.d.ts +1 -1
- package/es/package.json.js +1 -1
- package/es/utils/vue/vnode.js +1 -1
- package/lib/components/alert/alert.vue2.cjs +1 -1
- package/lib/components/autocomplete/autocomplete.vue2.cjs +1 -1
- package/lib/components/avatar/avatar.vue2.cjs +1 -1
- package/lib/components/avatar-stack/avatar-stack.vue2.cjs +1 -1
- package/lib/components/breadcrumb/breadcrumb-item.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/carousel/carousel.vue2.cjs +1 -1
- package/lib/components/cascader-panel/index.vue2.cjs +1 -1
- package/lib/components/cascader-panel/menu.vue2.cjs +1 -1
- package/lib/components/cascader-panel/node.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/clamp-tooltip/clamp-tooltip.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/sv-panel.vue.cjs +1 -1
- package/lib/components/context-menu/context-menu.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.d.ts +1 -1
- package/lib/components/date-picker/index.d.ts +2 -2
- 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/drawer/drawer.vue2.cjs +1 -1
- package/lib/components/dropdown/dropdown-item-impl.vue2.cjs +1 -1
- package/lib/components/dropdown/dropdown-item.vue2.cjs +1 -1
- package/lib/components/dropdown/dropdown.vue2.cjs +1 -1
- package/lib/components/form/form-item.vue2.cjs +1 -1
- package/lib/components/header-layout/header-layout.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/infinite-scroll/index.d.ts +1 -1
- package/lib/components/input/input.vue2.cjs +1 -1
- package/lib/components/input-number/input-number.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/menu/menu-item-group.vue2.cjs +1 -1
- package/lib/components/menu/menu-item.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/modal/modal-footer-action.vue2.cjs +1 -1
- package/lib/components/modal/modal.vue2.cjs +1 -1
- package/lib/components/multiple-tabs/multiple-tabs.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/popconfirm/popconfirm.vue2.cjs +1 -1
- package/lib/components/popover/popover.vue2.cjs +1 -1
- package/lib/components/popper/trigger.vue2.cjs +1 -1
- package/lib/components/progress/progress.vue2.cjs +5 -5
- 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/router-view-content/router-view-content.vue2.cjs +1 -1
- package/lib/components/roving-focus-group/roving-focus-item.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/select/index.d.ts +1 -1
- package/lib/components/select/select.vue.d.ts +1 -1
- package/lib/components/side-menu/index.d.ts +2 -8
- package/lib/components/side-menu/side-menu.vue.d.ts +8 -62
- package/lib/components/side-menu/side-menu.vue2.cjs +1 -1
- package/lib/components/side-menu/types.d.ts +107 -0
- package/lib/components/side-menu/use-drag-line.cjs +1 -1
- package/lib/components/side-menu/use-drag-line.d.ts +3 -1
- package/lib/components/skeleton/skeleton-item.vue2.cjs +1 -1
- package/lib/components/skeleton/skeleton.vue2.cjs +1 -1
- package/lib/components/slider/button.vue2.cjs +1 -1
- package/lib/components/slider/slider.vue2.cjs +1 -1
- package/lib/components/steps/item.vue2.cjs +1 -1
- package/lib/components/steps/steps.vue2.cjs +1 -1
- package/lib/components/super-form/super-form-action.vue2.cjs +1 -1
- package/lib/components/switch/switch.vue2.cjs +1 -1
- package/lib/components/table/field.d.ts +4 -4
- package/lib/components/teleport/teleport.vue2.cjs +1 -1
- package/lib/components/time-picker/common/picker.vue.d.ts +1 -1
- package/lib/components/time-picker/index.d.ts +2 -2
- package/lib/components/time-picker/time-picker.d.ts +1 -1
- package/lib/components/timeline/timeline-item.vue2.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/tree/tree.vue2.cjs +1 -1
- package/lib/components/upload/upload-content.vue2.cjs +1 -1
- package/lib/components/upload/upload-list.vue2.cjs +1 -1
- package/lib/components/upload/upload.vue2.cjs +1 -1
- package/lib/components/verify-code/verify-code.vue2.cjs +1 -1
- package/lib/package.json.cjs +1 -1
- package/lib/package.json.d.ts +1 -1
- package/package.json +4 -4
- package/tags.json +1 -1
- package/theme-style/index.css +1 -1
- package/theme-style/src/header-layout.scss +1 -1
- package/theme-style/src/menu.scss +7 -2
- package/theme-style/src/mixins/mixins.scss +1 -0
- package/theme-style/src/side-menu.scss +0 -3
- package/theme-style/vft-header-layout.css +1 -1
- package/theme-style/vft-menu.css +1 -1
- package/theme-style/vft-side-menu.css +1 -1
- package/web-types.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { getRouterKeyPath as
|
|
1
|
+
import { defineComponent as p, computed as u, resolveComponent as C, createBlock as n, openBlock as a, withCtx as c, createVNode as f, unref as r, KeepAlive as x, createCommentVNode as A, resolveDynamicComponent as v, Transition as k, mergeProps as B } from "vue";
|
|
2
|
+
import { getRouterKeyPath as N } from "@vft/router";
|
|
3
3
|
import "vue-router";
|
|
4
|
-
import { createReusableTemplate as
|
|
5
|
-
const
|
|
4
|
+
import { createReusableTemplate as R } from "@vueuse/core";
|
|
5
|
+
const K = p({
|
|
6
6
|
name: "vft-router-view-content"
|
|
7
|
-
}),
|
|
8
|
-
...
|
|
7
|
+
}), b = /* @__PURE__ */ p({
|
|
8
|
+
...K,
|
|
9
9
|
props: {
|
|
10
10
|
cacheList: {},
|
|
11
11
|
transitionName: {},
|
|
@@ -16,40 +16,40 @@ const P = v({
|
|
|
16
16
|
enableErrorHandle: { type: Boolean },
|
|
17
17
|
exceptionComp: {}
|
|
18
18
|
},
|
|
19
|
-
setup(
|
|
20
|
-
const h = u(() =>
|
|
21
|
-
let o =
|
|
22
|
-
return
|
|
23
|
-
}), [g,
|
|
24
|
-
return (
|
|
19
|
+
setup(e) {
|
|
20
|
+
const h = u(() => e.openKeepAlive ? e.cacheList : []), m = u(() => (t) => e.enableErrorHandle && e.pageErrorStatus && e.exceptionComp || t), y = u(() => (t) => {
|
|
21
|
+
let o = t.name;
|
|
22
|
+
return t.meta?.currentActivePath && (o = t.matched?.filter((l) => l.path === t.meta?.currentActivePath)?.[0].name), e.isReloadFlag ? void 0 : o;
|
|
23
|
+
}), [g, d] = R();
|
|
24
|
+
return (t, o) => {
|
|
25
25
|
const l = C("router-view");
|
|
26
26
|
return a(), n(l, null, {
|
|
27
|
-
default:
|
|
28
|
-
|
|
29
|
-
default:
|
|
30
|
-
e.openKeepAlive ? (a(), n(
|
|
27
|
+
default: c(({ Component: s, route: i }) => [
|
|
28
|
+
f(r(g), null, {
|
|
29
|
+
default: c(() => [
|
|
30
|
+
e.openKeepAlive ? (a(), n(x, {
|
|
31
31
|
key: 0,
|
|
32
32
|
include: h.value,
|
|
33
33
|
exclude: y.value(i)
|
|
34
34
|
}, [
|
|
35
|
-
e.isReloadFlag ? (a(), n(
|
|
36
|
-
key: r(
|
|
37
|
-
})) :
|
|
38
|
-
], 1032, ["include", "exclude"])) : (a(), n(
|
|
35
|
+
e.isReloadFlag ? (a(), n(v(m.value(s)), {
|
|
36
|
+
key: r(N)(i)
|
|
37
|
+
})) : A("", !0)
|
|
38
|
+
], 1032, ["include", "exclude"])) : (a(), n(v(m.value(s)), {
|
|
39
39
|
key: i.fullPath
|
|
40
40
|
}))
|
|
41
41
|
]),
|
|
42
42
|
_: 2
|
|
43
43
|
}, 1024),
|
|
44
|
-
e.transitionName ? (a(), n(
|
|
44
|
+
e.transitionName ? (a(), n(k, B({
|
|
45
45
|
key: 0,
|
|
46
46
|
name: e.transitionName
|
|
47
47
|
}, e.transitionAttr), {
|
|
48
|
-
default:
|
|
49
|
-
|
|
48
|
+
default: c(() => [
|
|
49
|
+
f(r(d))
|
|
50
50
|
]),
|
|
51
51
|
_: 1
|
|
52
|
-
}, 16, ["name"])) : (a(), n(r(
|
|
52
|
+
}, 16, ["name"])) : (a(), n(r(d), { key: 1 }))
|
|
53
53
|
]),
|
|
54
54
|
_: 1
|
|
55
55
|
});
|
|
@@ -57,5 +57,5 @@ const P = v({
|
|
|
57
57
|
}
|
|
58
58
|
});
|
|
59
59
|
export {
|
|
60
|
-
|
|
60
|
+
b as default
|
|
61
61
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as p, inject as
|
|
1
|
+
import { defineComponent as p, inject as l, ref as g, unref as r, nextTick as x, computed as d, provide as R, createBlock as G, openBlock as K, withCtx as V, renderSlot as S } from "vue";
|
|
2
2
|
import { EVENT_CODE as U } from "../../constants/aria.js";
|
|
3
3
|
import "@vueuse/core";
|
|
4
4
|
import "@vft/utils";
|
|
5
|
-
import { composeEventHandlers as
|
|
5
|
+
import { composeEventHandlers as a } from "../../utils/event.js";
|
|
6
6
|
import "../config-provider/hooks/use-global-config.js";
|
|
7
7
|
import "lodash-es";
|
|
8
8
|
import "../form/index.js";
|
|
@@ -11,12 +11,12 @@ import "../../hooks/use-model-toggle/index.js";
|
|
|
11
11
|
import "@popperjs/core";
|
|
12
12
|
import "../../hooks/use-z-index/index.js";
|
|
13
13
|
import { ROVING_FOCUS_GROUP_INJECTION_KEY as J, ROVING_FOCUS_GROUP_ITEM_INJECTION_KEY as L } from "./tokens.js";
|
|
14
|
-
import { VftCollectionItem as
|
|
14
|
+
import { VftCollectionItem as I, ROVING_FOCUS_COLLECTION_INJECTION_KEY as Y } from "./types.js";
|
|
15
15
|
import { getFocusIntent as D, reorderArray as M, focusFirst as P } from "./utils.js";
|
|
16
16
|
const j = p({
|
|
17
17
|
name: "VftRovingFocusItem",
|
|
18
18
|
components: {
|
|
19
|
-
"roving-focus-collection-item":
|
|
19
|
+
"roving-focus-collection-item": I
|
|
20
20
|
}
|
|
21
21
|
}), ie = /* @__PURE__ */ p({
|
|
22
22
|
...j,
|
|
@@ -25,70 +25,70 @@ const j = p({
|
|
|
25
25
|
active: { type: Boolean, default: !1 }
|
|
26
26
|
},
|
|
27
27
|
emits: ["mousedown", "focus", "keydown"],
|
|
28
|
-
setup(
|
|
29
|
-
const v =
|
|
28
|
+
setup(s, { emit: _ }) {
|
|
29
|
+
const v = s, c = _, { currentTabbedId: O, loop: C, onItemFocus: f, onItemShiftTab: E } = l(
|
|
30
30
|
J,
|
|
31
31
|
void 0
|
|
32
|
-
), { getItems: b } =
|
|
32
|
+
), { getItems: b } = l(Y, void 0), n = B(), N = g(null), T = a(
|
|
33
33
|
(e) => {
|
|
34
|
-
|
|
34
|
+
c("mousedown", e);
|
|
35
35
|
},
|
|
36
36
|
(e) => {
|
|
37
|
-
v.focusable ?
|
|
37
|
+
v.focusable ? f(r(n)) : e.preventDefault();
|
|
38
38
|
}
|
|
39
|
-
), F =
|
|
39
|
+
), F = a(
|
|
40
40
|
(e) => {
|
|
41
|
-
|
|
41
|
+
c("focus", e);
|
|
42
42
|
},
|
|
43
43
|
() => {
|
|
44
|
-
|
|
44
|
+
f(r(n));
|
|
45
45
|
}
|
|
46
|
-
), h =
|
|
46
|
+
), h = a(
|
|
47
47
|
(e) => {
|
|
48
|
-
|
|
48
|
+
c("keydown", e);
|
|
49
49
|
},
|
|
50
50
|
(e) => {
|
|
51
|
-
const { key:
|
|
52
|
-
if (
|
|
51
|
+
const { key: m, shiftKey: w, target: y, currentTarget: u } = e;
|
|
52
|
+
if (m === U.tab && w) {
|
|
53
53
|
E();
|
|
54
54
|
return;
|
|
55
55
|
}
|
|
56
|
-
if (y !==
|
|
57
|
-
const
|
|
58
|
-
if (
|
|
56
|
+
if (y !== u) return;
|
|
57
|
+
const i = D(e);
|
|
58
|
+
if (i) {
|
|
59
59
|
e.preventDefault();
|
|
60
60
|
let t = b().filter((o) => o.focusable).map((o) => o.ref);
|
|
61
|
-
switch (
|
|
61
|
+
switch (i) {
|
|
62
62
|
case "last": {
|
|
63
63
|
t.reverse();
|
|
64
64
|
break;
|
|
65
65
|
}
|
|
66
66
|
case "prev":
|
|
67
67
|
case "next": {
|
|
68
|
-
|
|
69
|
-
const o = t.indexOf(
|
|
68
|
+
i === "prev" && t.reverse();
|
|
69
|
+
const o = t.indexOf(u);
|
|
70
70
|
t = C.value ? M(t, o + 1) : t.slice(o + 1);
|
|
71
71
|
break;
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
-
|
|
74
|
+
x(() => {
|
|
75
75
|
P(t);
|
|
76
76
|
});
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
|
-
), k =
|
|
80
|
-
return
|
|
79
|
+
), k = d(() => O.value === r(n));
|
|
80
|
+
return R(L, {
|
|
81
81
|
rovingFocusGroupItemRef: N,
|
|
82
|
-
tabIndex:
|
|
82
|
+
tabIndex: d(() => r(k) ? 0 : -1),
|
|
83
83
|
handleMousedown: T,
|
|
84
84
|
handleFocus: F,
|
|
85
85
|
handleKeydown: h
|
|
86
|
-
}), (e,
|
|
86
|
+
}), (e, m) => (K(), G(r(I), {
|
|
87
87
|
id: r(n),
|
|
88
|
-
focusable:
|
|
89
|
-
active:
|
|
88
|
+
focusable: s.focusable,
|
|
89
|
+
active: s.active
|
|
90
90
|
}, {
|
|
91
|
-
default:
|
|
91
|
+
default: V(() => [
|
|
92
92
|
S(e.$slots, "default")
|
|
93
93
|
]),
|
|
94
94
|
_: 3
|
|
@@ -4,11 +4,11 @@ import "@vft/utils";
|
|
|
4
4
|
import "../config-provider/hooks/use-global-config.js";
|
|
5
5
|
import "lodash-es";
|
|
6
6
|
import "../form/index.js";
|
|
7
|
-
import { useNamespace as
|
|
7
|
+
import { useNamespace as y } from "../../hooks/use-namespace/index.js";
|
|
8
8
|
import "../../hooks/use-model-toggle/index.js";
|
|
9
9
|
import "@popperjs/core";
|
|
10
10
|
import "../../hooks/use-z-index/index.js";
|
|
11
|
-
import { rowContextKey as
|
|
11
|
+
import { rowContextKey as p } from "./constants.js";
|
|
12
12
|
const v = a({
|
|
13
13
|
name: "vft-row"
|
|
14
14
|
}), D = /* @__PURE__ */ a({
|
|
@@ -20,8 +20,8 @@ const v = a({
|
|
|
20
20
|
align: { default: "top" }
|
|
21
21
|
},
|
|
22
22
|
setup(t) {
|
|
23
|
-
const r =
|
|
24
|
-
n(
|
|
23
|
+
const r = y("row");
|
|
24
|
+
n(p, {
|
|
25
25
|
gutter: o(() => t.gutter)
|
|
26
26
|
});
|
|
27
27
|
const i = o(() => {
|
|
@@ -32,7 +32,7 @@ const v = a({
|
|
|
32
32
|
r.is(`justify-${t.justify}`, t.justify !== "start"),
|
|
33
33
|
r.is(`align-${t.align}`, t.align !== "top")
|
|
34
34
|
]);
|
|
35
|
-
return (e, w) => (u(), s(m(
|
|
35
|
+
return (e, w) => (u(), s(m(t.tag), {
|
|
36
36
|
class: c(l.value),
|
|
37
37
|
style: f(i.value)
|
|
38
38
|
}, {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { GAP as
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as m, ref as i, createElementBlock as u, openBlock as h, Fragment as d, createVNode as n } from "vue";
|
|
2
|
+
import r from "./thumb.vue2.js";
|
|
3
|
+
import { GAP as s } from "./util.js";
|
|
4
|
+
const z = /* @__PURE__ */ m({
|
|
5
5
|
__name: "bar",
|
|
6
6
|
props: {
|
|
7
7
|
always: { type: Boolean, default: !0 },
|
|
@@ -10,24 +10,24 @@ const w = /* @__PURE__ */ u({
|
|
|
10
10
|
ratioX: { default: 1 },
|
|
11
11
|
ratioY: { default: 1 }
|
|
12
12
|
},
|
|
13
|
-
setup(
|
|
14
|
-
const
|
|
13
|
+
setup(e, { expose: f }) {
|
|
14
|
+
const a = i(0), o = i(0);
|
|
15
15
|
return f({
|
|
16
|
-
handleScroll: (
|
|
17
|
-
if (
|
|
18
|
-
const l =
|
|
19
|
-
|
|
16
|
+
handleScroll: (t) => {
|
|
17
|
+
if (t) {
|
|
18
|
+
const l = t.offsetHeight - s, c = t.offsetWidth - s;
|
|
19
|
+
o.value = t.scrollTop * 100 / l * e.ratioY, a.value = t.scrollLeft * 100 / c * e.ratioX;
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
-
}), (
|
|
23
|
-
r
|
|
24
|
-
move:
|
|
22
|
+
}), (t, l) => (h(), u(d, null, [
|
|
23
|
+
n(r, {
|
|
24
|
+
move: a.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
|
-
r
|
|
30
|
-
move:
|
|
29
|
+
n(r, {
|
|
30
|
+
move: o.value,
|
|
31
31
|
ratio: e.ratioY,
|
|
32
32
|
size: e.height,
|
|
33
33
|
vertical: "",
|
|
@@ -37,5 +37,5 @@ const w = /* @__PURE__ */ u({
|
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
39
|
export {
|
|
40
|
-
|
|
40
|
+
z as default
|
|
41
41
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as W, ref as o, computed as h, watch as k, nextTick as T, provide as D, reactive as G, onMounted as X, onUpdated as Y, createElementBlock as q, openBlock as y, normalizeClass as w, unref as F, createElementVNode as I, createBlock as B, createCommentVNode as J, normalizeStyle as E, resolveDynamicComponent as Q, withCtx as Z, renderSlot as _ } from "vue";
|
|
2
|
-
import { isNumber as
|
|
2
|
+
import { isNumber as r, isObject as ee } from "@vft/utils";
|
|
3
3
|
import { useResizeObserver as te, useEventListener as le } from "@vueuse/core";
|
|
4
4
|
import { debugWarn as N } from "../../utils/error.js";
|
|
5
5
|
import { addUnit as O } from "../../utils/helper.js";
|
|
@@ -10,12 +10,12 @@ import "../../hooks/use-model-toggle/index.js";
|
|
|
10
10
|
import "@popperjs/core";
|
|
11
11
|
import "../../hooks/use-z-index/index.js";
|
|
12
12
|
import oe from "./bar.vue2.js";
|
|
13
|
-
import { scrollbarContextKey as
|
|
13
|
+
import { scrollbarContextKey as ie } from "./constants.js";
|
|
14
14
|
import { GAP as f } from "./util.js";
|
|
15
|
-
const L = "ElScrollbar",
|
|
15
|
+
const L = "ElScrollbar", re = W({
|
|
16
16
|
name: "vft-scrollbar"
|
|
17
|
-
}),
|
|
18
|
-
...
|
|
17
|
+
}), xe = /* @__PURE__ */ W({
|
|
18
|
+
...re,
|
|
19
19
|
props: {
|
|
20
20
|
height: { default: "" },
|
|
21
21
|
maxHeight: { default: "" },
|
|
@@ -31,74 +31,74 @@ const L = "ElScrollbar", ie = W({
|
|
|
31
31
|
},
|
|
32
32
|
emits: {
|
|
33
33
|
scroll: ({
|
|
34
|
-
scrollTop:
|
|
34
|
+
scrollTop: t,
|
|
35
35
|
scrollLeft: u
|
|
36
|
-
}) => [
|
|
36
|
+
}) => [t, u].every(r)
|
|
37
37
|
},
|
|
38
|
-
setup(
|
|
38
|
+
setup(t, { expose: u, emit: M }) {
|
|
39
39
|
const s = ae("scrollbar"), A = M;
|
|
40
|
-
let
|
|
41
|
-
const
|
|
40
|
+
let b, g;
|
|
41
|
+
const S = o(), l = o(), x = o(), z = o("0"), p = o("0"), m = o(), C = o(1), R = o(1), $ = h(() => {
|
|
42
42
|
const e = {};
|
|
43
|
-
return
|
|
43
|
+
return t.height && (e.height = O(t.height)), t.maxHeight && (e.maxHeight = O(t.maxHeight)), [t.wrapStyle, e];
|
|
44
44
|
}), j = h(() => [
|
|
45
|
-
|
|
45
|
+
t.wrapClass,
|
|
46
46
|
s.e("wrap"),
|
|
47
|
-
{ [s.em("wrap", "hidden-default")]: !
|
|
48
|
-
]), K = h(() => [s.e("view"),
|
|
49
|
-
|
|
50
|
-
scrollTop:
|
|
51
|
-
scrollLeft:
|
|
47
|
+
{ [s.em("wrap", "hidden-default")]: !t.native }
|
|
48
|
+
]), K = h(() => [s.e("view"), t.viewClass]), H = () => {
|
|
49
|
+
l.value && (m.value?.handleScroll(l.value), A("scroll", {
|
|
50
|
+
scrollTop: l.value.scrollTop,
|
|
51
|
+
scrollLeft: l.value.scrollLeft
|
|
52
52
|
}));
|
|
53
53
|
};
|
|
54
54
|
function P(e, a) {
|
|
55
|
-
ee(e) ?
|
|
55
|
+
ee(e) ? l.value.scrollTo(e) : r(e) && r(a) && l.value.scrollTo(e, a);
|
|
56
56
|
}
|
|
57
57
|
const U = (e) => {
|
|
58
|
-
if (!
|
|
58
|
+
if (!r(e)) {
|
|
59
59
|
N(L, "value must be a number");
|
|
60
60
|
return;
|
|
61
61
|
}
|
|
62
|
-
|
|
62
|
+
l.value.scrollTop = e;
|
|
63
63
|
}, V = (e) => {
|
|
64
|
-
if (!
|
|
64
|
+
if (!r(e)) {
|
|
65
65
|
N(L, "value must be a number");
|
|
66
66
|
return;
|
|
67
67
|
}
|
|
68
|
-
|
|
69
|
-
},
|
|
70
|
-
if (!
|
|
71
|
-
const e =
|
|
72
|
-
C.value = v / (e - v) / (n / (e - n)), R.value = d / (a - d) / (c / (a - c)),
|
|
68
|
+
l.value.scrollLeft = e;
|
|
69
|
+
}, i = () => {
|
|
70
|
+
if (!l.value) return;
|
|
71
|
+
const e = l.value.offsetHeight - f, a = l.value.offsetWidth - f, v = e ** 2 / l.value.scrollHeight, d = a ** 2 / l.value.scrollWidth, n = Math.max(v, t.minSize), c = Math.max(d, t.minSize);
|
|
72
|
+
C.value = v / (e - v) / (n / (e - n)), R.value = d / (a - d) / (c / (a - c)), p.value = n + f < e ? `${n}px` : "", z.value = c + f < a ? `${c}px` : "";
|
|
73
73
|
};
|
|
74
74
|
return k(
|
|
75
|
-
() =>
|
|
75
|
+
() => t.noresize,
|
|
76
76
|
(e) => {
|
|
77
|
-
e ? (
|
|
77
|
+
e ? (b?.(), g?.()) : ({ stop: b } = te(x, i), g = le("resize", i));
|
|
78
78
|
},
|
|
79
79
|
{ immediate: !0 }
|
|
80
80
|
), k(
|
|
81
|
-
() => [
|
|
81
|
+
() => [t.maxHeight, t.height],
|
|
82
82
|
() => {
|
|
83
|
-
|
|
84
|
-
|
|
83
|
+
t.native || T(() => {
|
|
84
|
+
i(), l.value && m.value?.handleScroll(l.value);
|
|
85
85
|
});
|
|
86
86
|
}
|
|
87
87
|
), D(
|
|
88
|
-
|
|
88
|
+
ie,
|
|
89
89
|
G({
|
|
90
|
-
scrollbarElement:
|
|
91
|
-
wrapElement:
|
|
90
|
+
scrollbarElement: S,
|
|
91
|
+
wrapElement: l
|
|
92
92
|
})
|
|
93
93
|
), X(() => {
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
t.native || T(() => {
|
|
95
|
+
i();
|
|
96
96
|
});
|
|
97
|
-
}), Y(() =>
|
|
97
|
+
}), Y(() => i()), u({
|
|
98
98
|
/** @description scrollbar wrap ref */
|
|
99
|
-
wrapRef:
|
|
99
|
+
wrapRef: l,
|
|
100
100
|
/** @description update scrollbar state manually */
|
|
101
|
-
update:
|
|
101
|
+
update: i,
|
|
102
102
|
/** @description scrolls to a particular set of coordinates */
|
|
103
103
|
scrollTo: P,
|
|
104
104
|
/** @description set distance to scroll top */
|
|
@@ -109,21 +109,21 @@ const L = "ElScrollbar", ie = W({
|
|
|
109
109
|
handleScroll: H
|
|
110
110
|
}), (e, a) => (y(), q("div", {
|
|
111
111
|
ref_key: "scrollbarRef",
|
|
112
|
-
ref:
|
|
112
|
+
ref: S,
|
|
113
113
|
class: w(F(s).b())
|
|
114
114
|
}, [
|
|
115
115
|
I("div", {
|
|
116
116
|
ref_key: "wrapRef",
|
|
117
|
-
ref:
|
|
117
|
+
ref: l,
|
|
118
118
|
class: w(j.value),
|
|
119
119
|
style: E($.value),
|
|
120
120
|
onScroll: H
|
|
121
121
|
}, [
|
|
122
|
-
(y(), B(Q(
|
|
122
|
+
(y(), B(Q(t.tag), {
|
|
123
123
|
ref_key: "resizeRef",
|
|
124
|
-
ref:
|
|
124
|
+
ref: x,
|
|
125
125
|
class: w(K.value),
|
|
126
|
-
style: E(
|
|
126
|
+
style: E(t.viewStyle)
|
|
127
127
|
}, {
|
|
128
128
|
default: Z(() => [
|
|
129
129
|
_(e.$slots, "default")
|
|
@@ -131,13 +131,13 @@ const L = "ElScrollbar", ie = W({
|
|
|
131
131
|
_: 3
|
|
132
132
|
}, 8, ["class", "style"]))
|
|
133
133
|
], 38),
|
|
134
|
-
|
|
134
|
+
t.native ? J("", !0) : (y(), B(oe, {
|
|
135
135
|
key: 0,
|
|
136
136
|
ref_key: "barRef",
|
|
137
137
|
ref: m,
|
|
138
|
-
height:
|
|
138
|
+
height: p.value,
|
|
139
139
|
width: z.value,
|
|
140
|
-
always:
|
|
140
|
+
always: t.always,
|
|
141
141
|
"ratio-x": R.value,
|
|
142
142
|
"ratio-y": C.value
|
|
143
143
|
}, null, 8, ["height", "width", "always", "ratio-x", "ratio-y"]))
|
|
@@ -145,5 +145,5 @@ const L = "ElScrollbar", ie = W({
|
|
|
145
145
|
}
|
|
146
146
|
});
|
|
147
147
|
export {
|
|
148
|
-
|
|
148
|
+
xe as default
|
|
149
149
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as T, inject as D, ref as i, computed as E, onBeforeUnmount as N, toRef as S, createBlock as A, openBlock as O, Transition as j, unref as m, withCtx as K, withDirectives as U, createElementVNode as z, normalizeClass as C, normalizeStyle as
|
|
2
|
-
import { useEventListener as P, isClient as
|
|
1
|
+
import { defineComponent as T, inject as D, ref as i, computed as E, onBeforeUnmount as N, toRef as S, createBlock as A, openBlock as O, Transition as j, unref as m, withCtx as K, withDirectives as U, createElementVNode as z, normalizeClass as C, normalizeStyle as I, vShow as V } from "vue";
|
|
2
|
+
import { useEventListener as P, isClient as _ } from "@vueuse/core";
|
|
3
3
|
import "@vft/utils";
|
|
4
4
|
import { throwError as q } from "../../utils/error.js";
|
|
5
5
|
import "../config-provider/hooks/use-global-config.js";
|
|
@@ -20,15 +20,15 @@ const W = "Thumb", ce = /* @__PURE__ */ T({
|
|
|
20
20
|
ratio: {},
|
|
21
21
|
always: { type: Boolean }
|
|
22
22
|
},
|
|
23
|
-
setup(
|
|
23
|
+
setup(a) {
|
|
24
24
|
const o = D(G), s = F("scrollbar");
|
|
25
25
|
o || q(W, "can not inject scrollbar context");
|
|
26
|
-
const l = i(),
|
|
27
|
-
let c = !1, f = !1, d =
|
|
28
|
-
const e = E(() => J[
|
|
26
|
+
const l = i(), r = i(), v = i({}), u = i(!1);
|
|
27
|
+
let c = !1, f = !1, d = _ ? document.onselectstart : null;
|
|
28
|
+
const e = E(() => J[a.vertical ? "vertical" : "horizontal"]), k = E(
|
|
29
29
|
() => Q({
|
|
30
|
-
size:
|
|
31
|
-
move:
|
|
30
|
+
size: a.size,
|
|
31
|
+
move: a.move,
|
|
32
32
|
bar: e.value
|
|
33
33
|
})
|
|
34
34
|
), g = E(
|
|
@@ -36,36 +36,36 @@ const W = "Thumb", ce = /* @__PURE__ */ T({
|
|
|
36
36
|
// offsetRatioX = original width of thumb / current width of thumb / ratioX
|
|
37
37
|
// offsetRatioY = original height of thumb / current height of thumb / ratioY
|
|
38
38
|
// instance height = wrap height - GAP
|
|
39
|
-
l.value[e.value.offset] ** 2 / o.wrapElement[e.value.scrollSize] /
|
|
39
|
+
l.value[e.value.offset] ** 2 / o.wrapElement[e.value.scrollSize] / a.ratio / r.value[e.value.offset]
|
|
40
40
|
)
|
|
41
41
|
), B = (t) => {
|
|
42
42
|
if (t.stopPropagation(), t.ctrlKey || [1, 2].includes(t.button)) return;
|
|
43
|
-
window.getSelection()?.removeAllRanges(),
|
|
43
|
+
window.getSelection()?.removeAllRanges(), L(t);
|
|
44
44
|
const n = t.currentTarget;
|
|
45
45
|
n && (v.value[e.value.axis] = n[e.value.offset] - (t[e.value.client] - n.getBoundingClientRect()[e.value.direction]));
|
|
46
|
-
},
|
|
47
|
-
if (!
|
|
46
|
+
}, x = (t) => {
|
|
47
|
+
if (!r.value || !l.value || !o.wrapElement) return;
|
|
48
48
|
const n = Math.abs(
|
|
49
49
|
t.target.getBoundingClientRect()[e.value.direction] - t[e.value.client]
|
|
50
|
-
),
|
|
50
|
+
), p = r.value[e.value.offset] / 2, h = (n - p) * 100 * g.value / l.value[e.value.offset];
|
|
51
51
|
o.wrapElement[e.value.scroll] = h * o.wrapElement[e.value.scrollSize] / 100;
|
|
52
|
-
},
|
|
53
|
-
t.stopImmediatePropagation(), c = !0, document.addEventListener("mousemove", w), document.addEventListener("mouseup",
|
|
52
|
+
}, L = (t) => {
|
|
53
|
+
t.stopImmediatePropagation(), c = !0, document.addEventListener("mousemove", w), document.addEventListener("mouseup", b), d = document.onselectstart, document.onselectstart = () => !1;
|
|
54
54
|
}, w = (t) => {
|
|
55
|
-
if (!l.value || !
|
|
55
|
+
if (!l.value || !r.value || c === !1) return;
|
|
56
56
|
const n = v.value[e.value.axis];
|
|
57
57
|
if (!n) return;
|
|
58
|
-
const
|
|
58
|
+
const p = (l.value.getBoundingClientRect()[e.value.direction] - t[e.value.client]) * -1, h = r.value[e.value.offset] - n, R = (p - h) * 100 * g.value / l.value[e.value.offset];
|
|
59
59
|
o.wrapElement[e.value.scroll] = R * o.wrapElement[e.value.scrollSize] / 100;
|
|
60
|
-
},
|
|
61
|
-
c = !1, v.value[e.value.axis] = 0, document.removeEventListener("mousemove", w), document.removeEventListener("mouseup",
|
|
62
|
-
},
|
|
63
|
-
f = !1, u.value = !!
|
|
60
|
+
}, b = () => {
|
|
61
|
+
c = !1, v.value[e.value.axis] = 0, document.removeEventListener("mousemove", w), document.removeEventListener("mouseup", b), y(), f && (u.value = !1);
|
|
62
|
+
}, M = () => {
|
|
63
|
+
f = !1, u.value = !!a.size;
|
|
64
64
|
}, H = () => {
|
|
65
65
|
f = !0, u.value = c;
|
|
66
66
|
};
|
|
67
67
|
N(() => {
|
|
68
|
-
y(), document.removeEventListener("mouseup",
|
|
68
|
+
y(), document.removeEventListener("mouseup", b);
|
|
69
69
|
});
|
|
70
70
|
const y = () => {
|
|
71
71
|
document.onselectstart !== d && (document.onselectstart = d);
|
|
@@ -73,7 +73,7 @@ const W = "Thumb", ce = /* @__PURE__ */ T({
|
|
|
73
73
|
return P(
|
|
74
74
|
S(o, "scrollbarElement"),
|
|
75
75
|
"mousemove",
|
|
76
|
-
|
|
76
|
+
M
|
|
77
77
|
), P(
|
|
78
78
|
S(o, "scrollbarElement"),
|
|
79
79
|
"mouseleave",
|
|
@@ -86,17 +86,17 @@ const W = "Thumb", ce = /* @__PURE__ */ T({
|
|
|
86
86
|
ref_key: "instance",
|
|
87
87
|
ref: l,
|
|
88
88
|
class: C([m(s).e("bar"), m(s).is(e.value.key)]),
|
|
89
|
-
onMousedown:
|
|
89
|
+
onMousedown: x
|
|
90
90
|
}, [
|
|
91
91
|
z("div", {
|
|
92
92
|
ref_key: "thumb",
|
|
93
|
-
ref:
|
|
93
|
+
ref: r,
|
|
94
94
|
class: C(m(s).e("thumb")),
|
|
95
|
-
style:
|
|
95
|
+
style: I(k.value),
|
|
96
96
|
onMousedown: B
|
|
97
97
|
}, null, 38)
|
|
98
98
|
], 34), [
|
|
99
|
-
[
|
|
99
|
+
[V, a.always || u.value]
|
|
100
100
|
])
|
|
101
101
|
]),
|
|
102
102
|
_: 1
|