@element-plus/nightly 0.0.20240531 → 0.0.20240601
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/dist/index.full.js +2 -2
- package/dist/index.full.min.js +2 -2
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +2 -2
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +2 -2
- 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/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/affix/index.mjs +2 -2
- package/es/components/affix/src/affix.mjs +117 -26
- package/es/components/affix/src/affix.mjs.map +1 -1
- package/es/components/affix/src/affix2.mjs +26 -117
- package/es/components/affix/src/affix2.mjs.map +1 -1
- package/es/components/index.mjs +6 -6
- package/es/components/row/index.mjs +2 -2
- package/es/components/row/src/row.mjs +45 -29
- package/es/components/row/src/row.mjs.map +1 -1
- package/es/components/row/src/row2.mjs +29 -45
- package/es/components/row/src/row2.mjs.map +1 -1
- package/es/components/scrollbar/src/bar.mjs +64 -11
- package/es/components/scrollbar/src/bar.mjs.map +1 -1
- package/es/components/scrollbar/src/bar2.mjs +11 -64
- package/es/components/scrollbar/src/bar2.mjs.map +1 -1
- package/es/components/scrollbar/src/scrollbar2.mjs +1 -1
- package/es/components/slider/index.mjs +2 -2
- package/es/components/slider/src/slider.mjs +242 -94
- package/es/components/slider/src/slider.mjs.map +1 -1
- package/es/components/slider/src/slider2.mjs +94 -242
- package/es/components/slider/src/slider2.mjs.map +1 -1
- package/es/components/steps/index.mjs +2 -2
- package/es/components/steps/src/steps.mjs +39 -36
- package/es/components/steps/src/steps.mjs.map +1 -1
- package/es/components/steps/src/steps2.mjs +36 -39
- package/es/components/steps/src/steps2.mjs.map +1 -1
- package/es/components/tabs/index.mjs +2 -2
- package/es/components/tabs/src/tab-pane.mjs +72 -13
- package/es/components/tabs/src/tab-pane.mjs.map +1 -1
- package/es/components/tabs/src/tab-pane2.mjs +13 -72
- package/es/components/tabs/src/tab-pane2.mjs.map +1 -1
- package/es/components/tooltip/index.mjs +2 -2
- package/es/components/tooltip/src/tooltip.mjs +170 -31
- package/es/components/tooltip/src/tooltip.mjs.map +1 -1
- package/es/components/tooltip/src/tooltip2.mjs +31 -170
- package/es/components/tooltip/src/tooltip2.mjs.map +1 -1
- package/es/index.mjs +6 -6
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/affix/index.js +2 -2
- package/lib/components/affix/src/affix.js +117 -27
- package/lib/components/affix/src/affix.js.map +1 -1
- package/lib/components/affix/src/affix2.js +27 -117
- package/lib/components/affix/src/affix2.js.map +1 -1
- package/lib/components/index.js +6 -6
- package/lib/components/row/index.js +2 -2
- package/lib/components/row/src/row.js +45 -31
- package/lib/components/row/src/row.js.map +1 -1
- package/lib/components/row/src/row2.js +31 -45
- package/lib/components/row/src/row2.js.map +1 -1
- package/lib/components/scrollbar/src/bar.js +64 -11
- package/lib/components/scrollbar/src/bar.js.map +1 -1
- package/lib/components/scrollbar/src/bar2.js +11 -64
- package/lib/components/scrollbar/src/bar2.js.map +1 -1
- package/lib/components/scrollbar/src/scrollbar2.js +1 -1
- package/lib/components/slider/index.js +2 -2
- package/lib/components/slider/src/slider.js +242 -95
- package/lib/components/slider/src/slider.js.map +1 -1
- package/lib/components/slider/src/slider2.js +95 -242
- package/lib/components/slider/src/slider2.js.map +1 -1
- package/lib/components/steps/index.js +2 -2
- package/lib/components/steps/src/steps.js +39 -37
- package/lib/components/steps/src/steps.js.map +1 -1
- package/lib/components/steps/src/steps2.js +37 -39
- package/lib/components/steps/src/steps2.js.map +1 -1
- package/lib/components/tabs/index.js +2 -2
- package/lib/components/tabs/src/tab-pane.js +72 -13
- package/lib/components/tabs/src/tab-pane.js.map +1 -1
- package/lib/components/tabs/src/tab-pane2.js +13 -72
- package/lib/components/tabs/src/tab-pane2.js.map +1 -1
- package/lib/components/tooltip/index.js +2 -2
- package/lib/components/tooltip/src/tooltip.js +170 -35
- package/lib/components/tooltip/src/tooltip.js.map +1 -1
- package/lib/components/tooltip/src/tooltip2.js +35 -170
- package/lib/components/tooltip/src/tooltip2.js.map +1 -1
- package/lib/index.js +6 -6
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +1 -1
- package/web-types.json +1 -1
|
@@ -2,126 +2,36 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var vue = require('vue');
|
|
6
|
-
var core = require('@vueuse/core');
|
|
7
5
|
require('../../../utils/index.js');
|
|
8
|
-
require('../../../
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var style = require('../../../utils/dom/style.js');
|
|
13
|
-
var error = require('../../../utils/error.js');
|
|
14
|
-
var scroll = require('../../../utils/dom/scroll.js');
|
|
6
|
+
require('../../../constants/index.js');
|
|
7
|
+
var runtime = require('../../../utils/vue/props/runtime.js');
|
|
8
|
+
var types = require('../../../utils/types.js');
|
|
9
|
+
var event = require('../../../constants/event.js');
|
|
15
10
|
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
width: rootWidth,
|
|
34
|
-
top: rootTop,
|
|
35
|
-
bottom: rootBottom,
|
|
36
|
-
update: updateRoot
|
|
37
|
-
} = core.useElementBounding(root, { windowScroll: false });
|
|
38
|
-
const targetRect = core.useElementBounding(target);
|
|
39
|
-
const fixed = vue.ref(false);
|
|
40
|
-
const scrollTop = vue.ref(0);
|
|
41
|
-
const transform = vue.ref(0);
|
|
42
|
-
const rootStyle = vue.computed(() => {
|
|
43
|
-
return {
|
|
44
|
-
height: fixed.value ? `${rootHeight.value}px` : "",
|
|
45
|
-
width: fixed.value ? `${rootWidth.value}px` : ""
|
|
46
|
-
};
|
|
47
|
-
});
|
|
48
|
-
const affixStyle = vue.computed(() => {
|
|
49
|
-
if (!fixed.value)
|
|
50
|
-
return {};
|
|
51
|
-
const offset = props.offset ? style.addUnit(props.offset) : 0;
|
|
52
|
-
return {
|
|
53
|
-
height: `${rootHeight.value}px`,
|
|
54
|
-
width: `${rootWidth.value}px`,
|
|
55
|
-
top: props.position === "top" ? offset : "",
|
|
56
|
-
bottom: props.position === "bottom" ? offset : "",
|
|
57
|
-
transform: transform.value ? `translateY(${transform.value}px)` : "",
|
|
58
|
-
zIndex: props.zIndex
|
|
59
|
-
};
|
|
60
|
-
});
|
|
61
|
-
const update = () => {
|
|
62
|
-
if (!scrollContainer.value)
|
|
63
|
-
return;
|
|
64
|
-
scrollTop.value = scrollContainer.value instanceof Window ? document.documentElement.scrollTop : scrollContainer.value.scrollTop || 0;
|
|
65
|
-
if (props.position === "top") {
|
|
66
|
-
if (props.target) {
|
|
67
|
-
const difference = targetRect.bottom.value - props.offset - rootHeight.value;
|
|
68
|
-
fixed.value = props.offset > rootTop.value && targetRect.bottom.value > 0;
|
|
69
|
-
transform.value = difference < 0 ? difference : 0;
|
|
70
|
-
} else {
|
|
71
|
-
fixed.value = props.offset > rootTop.value;
|
|
72
|
-
}
|
|
73
|
-
} else if (props.target) {
|
|
74
|
-
const difference = windowHeight.value - targetRect.top.value - props.offset - rootHeight.value;
|
|
75
|
-
fixed.value = windowHeight.value - props.offset < rootBottom.value && windowHeight.value > targetRect.top.value;
|
|
76
|
-
transform.value = difference < 0 ? -difference : 0;
|
|
77
|
-
} else {
|
|
78
|
-
fixed.value = windowHeight.value - props.offset < rootBottom.value;
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
const handleScroll = () => {
|
|
82
|
-
updateRoot();
|
|
83
|
-
emit("scroll", {
|
|
84
|
-
scrollTop: scrollTop.value,
|
|
85
|
-
fixed: fixed.value
|
|
86
|
-
});
|
|
87
|
-
};
|
|
88
|
-
vue.watch(fixed, (val) => emit("change", val));
|
|
89
|
-
vue.onMounted(() => {
|
|
90
|
-
var _a;
|
|
91
|
-
if (props.target) {
|
|
92
|
-
target.value = (_a = document.querySelector(props.target)) != null ? _a : void 0;
|
|
93
|
-
if (!target.value)
|
|
94
|
-
error.throwError(COMPONENT_NAME, `Target does not exist: ${props.target}`);
|
|
95
|
-
} else {
|
|
96
|
-
target.value = document.documentElement;
|
|
97
|
-
}
|
|
98
|
-
scrollContainer.value = scroll.getScrollContainer(root.value, true);
|
|
99
|
-
updateRoot();
|
|
100
|
-
});
|
|
101
|
-
core.useEventListener(scrollContainer, "scroll", handleScroll);
|
|
102
|
-
vue.watchEffect(update);
|
|
103
|
-
expose({
|
|
104
|
-
update,
|
|
105
|
-
updateRoot
|
|
106
|
-
});
|
|
107
|
-
return (_ctx, _cache) => {
|
|
108
|
-
return vue.openBlock(), vue.createElementBlock("div", {
|
|
109
|
-
ref_key: "root",
|
|
110
|
-
ref: root,
|
|
111
|
-
class: vue.normalizeClass(vue.unref(ns).b()),
|
|
112
|
-
style: vue.normalizeStyle(vue.unref(rootStyle))
|
|
113
|
-
}, [
|
|
114
|
-
vue.createElementVNode("div", {
|
|
115
|
-
class: vue.normalizeClass({ [vue.unref(ns).m("fixed")]: fixed.value }),
|
|
116
|
-
style: vue.normalizeStyle(vue.unref(affixStyle))
|
|
117
|
-
}, [
|
|
118
|
-
vue.renderSlot(_ctx.$slots, "default")
|
|
119
|
-
], 6)
|
|
120
|
-
], 6);
|
|
121
|
-
};
|
|
11
|
+
const affixProps = runtime.buildProps({
|
|
12
|
+
zIndex: {
|
|
13
|
+
type: runtime.definePropType([Number, String]),
|
|
14
|
+
default: 100
|
|
15
|
+
},
|
|
16
|
+
target: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: ""
|
|
19
|
+
},
|
|
20
|
+
offset: {
|
|
21
|
+
type: Number,
|
|
22
|
+
default: 0
|
|
23
|
+
},
|
|
24
|
+
position: {
|
|
25
|
+
type: String,
|
|
26
|
+
values: ["top", "bottom"],
|
|
27
|
+
default: "top"
|
|
122
28
|
}
|
|
123
29
|
});
|
|
124
|
-
|
|
30
|
+
const affixEmits = {
|
|
31
|
+
scroll: ({ scrollTop, fixed }) => types.isNumber(scrollTop) && types.isBoolean(fixed),
|
|
32
|
+
[event.CHANGE_EVENT]: (fixed) => types.isBoolean(fixed)
|
|
33
|
+
};
|
|
125
34
|
|
|
126
|
-
exports
|
|
35
|
+
exports.affixEmits = affixEmits;
|
|
36
|
+
exports.affixProps = affixProps;
|
|
127
37
|
//# sourceMappingURL=affix2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"affix2.js","sources":["../../../../../../packages/components/affix/src/affix.
|
|
1
|
+
{"version":3,"file":"affix2.js","sources":["../../../../../../packages/components/affix/src/affix.ts"],"sourcesContent":["import {\n buildProps,\n definePropType,\n isBoolean,\n isNumber,\n} from '@element-plus/utils'\nimport { CHANGE_EVENT } from '@element-plus/constants'\nimport type { ExtractPropTypes } from 'vue'\nimport type { ZIndexProperty } from 'csstype'\nimport type Affix from './affix.vue'\n\nexport const affixProps = buildProps({\n /**\n * @description affix element zIndex value\n * */\n zIndex: {\n type: definePropType<ZIndexProperty>([Number, String]),\n default: 100,\n },\n /**\n * @description target container. (CSS selector)\n */\n target: {\n type: String,\n default: '',\n },\n /**\n * @description offset distance\n * */\n offset: {\n type: Number,\n default: 0,\n },\n /**\n * @description position of affix\n * */\n position: {\n type: String,\n values: ['top', 'bottom'],\n default: 'top',\n },\n} as const)\nexport type AffixProps = ExtractPropTypes<typeof affixProps>\n\nexport const affixEmits = {\n scroll: ({ scrollTop, fixed }: { scrollTop: number; fixed: boolean }) =>\n isNumber(scrollTop) && isBoolean(fixed),\n [CHANGE_EVENT]: (fixed: boolean) => isBoolean(fixed),\n}\nexport type AffixEmits = typeof affixEmits\n\nexport type AffixInstance = InstanceType<typeof Affix>\n"],"names":["buildProps","definePropType","isNumber","isBoolean","CHANGE_EVENT"],"mappings":";;;;;;;;;;AAOY,MAAC,UAAU,GAAGA,kBAAU,CAAC;AACrC,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAEC,sBAAc,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC1C,IAAI,OAAO,EAAE,GAAG;AAChB,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC;AAC7B,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,CAAC,EAAE;AACS,MAAC,UAAU,GAAG;AAC1B,EAAE,MAAM,EAAE,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,KAAKC,cAAQ,CAAC,SAAS,CAAC,IAAIC,eAAS,CAAC,KAAK,CAAC;AAC3E,EAAE,CAACC,kBAAY,GAAG,CAAC,KAAK,KAAKD,eAAS,CAAC,KAAK,CAAC;AAC7C;;;;;"}
|
package/lib/components/index.js
CHANGED
|
@@ -83,7 +83,7 @@ var index$1c = require('./message/index.js');
|
|
|
83
83
|
var index$1d = require('./message-box/index.js');
|
|
84
84
|
var index$1e = require('./notification/index.js');
|
|
85
85
|
var index$1f = require('./popover/index.js');
|
|
86
|
-
var affix = require('./affix/src/
|
|
86
|
+
var affix = require('./affix/src/affix2.js');
|
|
87
87
|
var alert = require('./alert/src/alert.js');
|
|
88
88
|
var autocomplete = require('./autocomplete/src/autocomplete.js');
|
|
89
89
|
var avatar = require('./avatar/src/avatar.js');
|
|
@@ -163,7 +163,7 @@ var radioButton = require('./radio/src/radio-button.js');
|
|
|
163
163
|
var constants$b = require('./radio/src/constants.js');
|
|
164
164
|
var rate = require('./rate/src/rate.js');
|
|
165
165
|
var result = require('./result/src/result.js');
|
|
166
|
-
var row = require('./row/src/
|
|
166
|
+
var row = require('./row/src/row2.js');
|
|
167
167
|
var constants$c = require('./row/src/constants.js');
|
|
168
168
|
var util = require('./scrollbar/src/util.js');
|
|
169
169
|
var scrollbar = require('./scrollbar/src/scrollbar.js');
|
|
@@ -173,14 +173,14 @@ var token = require('./select/src/token.js');
|
|
|
173
173
|
var token$1 = require('./select-v2/src/token.js');
|
|
174
174
|
var skeleton = require('./skeleton/src/skeleton.js');
|
|
175
175
|
var skeletonItem = require('./skeleton/src/skeleton-item.js');
|
|
176
|
-
var slider = require('./slider/src/
|
|
176
|
+
var slider = require('./slider/src/slider2.js');
|
|
177
177
|
var constants$e = require('./slider/src/constants.js');
|
|
178
178
|
var space = require('./space/src/space.js');
|
|
179
179
|
var item = require('./space/src/item.js');
|
|
180
180
|
var useSpace = require('./space/src/use-space.js');
|
|
181
181
|
var statistic = require('./statistic/src/statistic.js');
|
|
182
182
|
var item$1 = require('./steps/src/item.js');
|
|
183
|
-
var steps = require('./steps/src/
|
|
183
|
+
var steps = require('./steps/src/steps2.js');
|
|
184
184
|
var _switch = require('./switch/src/switch.js');
|
|
185
185
|
var constants$f = require('./table-v2/src/constants.js');
|
|
186
186
|
var tableV2 = require('./table-v2/src/table-v2.js');
|
|
@@ -191,7 +191,7 @@ var row$1 = require('./table-v2/src/row.js');
|
|
|
191
191
|
var tabs = require('./tabs/src/tabs.js');
|
|
192
192
|
var tabBar = require('./tabs/src/tab-bar.js');
|
|
193
193
|
var tabNav = require('./tabs/src/tab-nav.js');
|
|
194
|
-
var tabPane = require('./tabs/src/tab-
|
|
194
|
+
var tabPane = require('./tabs/src/tab-pane2.js');
|
|
195
195
|
var constants$g = require('./tabs/src/constants.js');
|
|
196
196
|
var tag = require('./tag/src/tag2.js');
|
|
197
197
|
var text = require('./text/src/text.js');
|
|
@@ -201,7 +201,7 @@ var props = require('./time-picker/src/common/props.js');
|
|
|
201
201
|
var picker = require('./time-picker/src/common/picker.js');
|
|
202
202
|
var panelTimePick = require('./time-picker/src/time-picker-com/panel-time-pick.js');
|
|
203
203
|
var timelineItem = require('./timeline/src/timeline-item.js');
|
|
204
|
-
var tooltip = require('./tooltip/src/
|
|
204
|
+
var tooltip = require('./tooltip/src/tooltip2.js');
|
|
205
205
|
var trigger$2 = require('./tooltip/src/trigger.js');
|
|
206
206
|
var content$2 = require('./tooltip/src/content.js');
|
|
207
207
|
var constants$i = require('./tooltip/src/constants.js');
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
require('../../utils/index.js');
|
|
6
|
-
var row$1 = require('./src/
|
|
7
|
-
var row = require('./src/
|
|
6
|
+
var row$1 = require('./src/row.js');
|
|
7
|
+
var row = require('./src/row2.js');
|
|
8
8
|
var constants = require('./src/constants.js');
|
|
9
9
|
var install = require('../../utils/vue/install.js');
|
|
10
10
|
|
|
@@ -2,39 +2,53 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
require('
|
|
6
|
-
|
|
5
|
+
var vue = require('vue');
|
|
6
|
+
require('../../../hooks/index.js');
|
|
7
|
+
var constants = require('./constants.js');
|
|
8
|
+
var row = require('./row2.js');
|
|
9
|
+
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
|
|
10
|
+
var index = require('../../../hooks/use-namespace/index.js');
|
|
7
11
|
|
|
8
|
-
const
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
12
|
+
const __default__ = vue.defineComponent({
|
|
13
|
+
name: "ElRow"
|
|
14
|
+
});
|
|
15
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
16
|
+
...__default__,
|
|
17
|
+
props: row.rowProps,
|
|
18
|
+
setup(__props) {
|
|
19
|
+
const props = __props;
|
|
20
|
+
const ns = index.useNamespace("row");
|
|
21
|
+
const gutter = vue.computed(() => props.gutter);
|
|
22
|
+
vue.provide(constants.rowContextKey, {
|
|
23
|
+
gutter
|
|
24
|
+
});
|
|
25
|
+
const style = vue.computed(() => {
|
|
26
|
+
const styles = {};
|
|
27
|
+
if (!props.gutter) {
|
|
28
|
+
return styles;
|
|
29
|
+
}
|
|
30
|
+
styles.marginRight = styles.marginLeft = `-${props.gutter / 2}px`;
|
|
31
|
+
return styles;
|
|
32
|
+
});
|
|
33
|
+
const rowKls = vue.computed(() => [
|
|
34
|
+
ns.b(),
|
|
35
|
+
ns.is(`justify-${props.justify}`, props.justify !== "start"),
|
|
36
|
+
ns.is(`align-${props.align}`, !!props.align)
|
|
37
|
+
]);
|
|
38
|
+
return (_ctx, _cache) => {
|
|
39
|
+
return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.tag), {
|
|
40
|
+
class: vue.normalizeClass(vue.unref(rowKls)),
|
|
41
|
+
style: vue.normalizeStyle(vue.unref(style))
|
|
42
|
+
}, {
|
|
43
|
+
default: vue.withCtx(() => [
|
|
44
|
+
vue.renderSlot(_ctx.$slots, "default")
|
|
45
|
+
]),
|
|
46
|
+
_: 3
|
|
47
|
+
}, 8, ["class", "style"]);
|
|
48
|
+
};
|
|
34
49
|
}
|
|
35
50
|
});
|
|
51
|
+
var Row = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "row.vue"]]);
|
|
36
52
|
|
|
37
|
-
exports
|
|
38
|
-
exports.RowJustify = RowJustify;
|
|
39
|
-
exports.rowProps = rowProps;
|
|
53
|
+
exports["default"] = Row;
|
|
40
54
|
//# sourceMappingURL=row.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"row.js","sources":["../../../../../../packages/components/row/src/row.
|
|
1
|
+
{"version":3,"file":"row.js","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":["useNamespace","computed","provide","rowContextKey"],"mappings":";;;;;;;;;;;uCAac,CAAA;AAAA,EACZ,IAAM,EAAA,OAAA;AACR,CAAA,CAAA,CAAA;;;;;;AAIA,IAAM,MAAA,EAAA,GAAKA,mBAAa,KAAK,CAAA,CAAA;AAC7B,IAAA,MAAM,MAAS,GAAAC,YAAA,CAAS,MAAM,KAAA,CAAM,MAAM,CAAA,CAAA;AAE1C,IAAAC,WAAA,CAAQC,uBAAe,EAAA;AAAA,MACrB,MAAA;AAAA,KACD,CAAA,CAAA;AAED,IAAM,MAAA,KAAA,GAAQF,aAAS,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,WAAc,GAAA,MAAA,CAAO,UAAa,GAAA,CAAA,CAAA,EAAI,MAAM,MAAS,GAAA,CAAA,CAAA,EAAA,CAAA,CAAA;AAC5D,MAAO,OAAA,MAAA,CAAA;AAAA,KACR,CAAA,CAAA;AAED,IAAM,MAAA,MAAA,GAASA,aAAS,MAAM;AAAA,MAC5B,GAAG,CAAE,EAAA;AAAA,MACL,GAAG,EAAG,CAAA,CAAA,QAAA,EAAW,MAAM,OAAW,CAAA,CAAA,EAAA,KAAA,CAAM,YAAY,OAAO,CAAA;AAAA,MAC3D,EAAA,CAAG,GAAG,CAAS,MAAA,EAAA,KAAA,CAAM,SAAS,CAAC,CAAC,MAAM,KAAK,CAAA;AAAA,KAC5C,CAAA,CAAA;;;;;;;;;;;;;;;;;;"}
|
|
@@ -2,53 +2,39 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
require('../../../
|
|
7
|
-
var constants = require('./constants.js');
|
|
8
|
-
var row = require('./row.js');
|
|
9
|
-
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
|
|
10
|
-
var index = require('../../../hooks/use-namespace/index.js');
|
|
5
|
+
require('../../../utils/index.js');
|
|
6
|
+
var runtime = require('../../../utils/vue/props/runtime.js');
|
|
11
7
|
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
return (_ctx, _cache) => {
|
|
39
|
-
return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.tag), {
|
|
40
|
-
class: vue.normalizeClass(vue.unref(rowKls)),
|
|
41
|
-
style: vue.normalizeStyle(vue.unref(style))
|
|
42
|
-
}, {
|
|
43
|
-
default: vue.withCtx(() => [
|
|
44
|
-
vue.renderSlot(_ctx.$slots, "default")
|
|
45
|
-
]),
|
|
46
|
-
_: 3
|
|
47
|
-
}, 8, ["class", "style"]);
|
|
48
|
-
};
|
|
8
|
+
const RowJustify = [
|
|
9
|
+
"start",
|
|
10
|
+
"center",
|
|
11
|
+
"end",
|
|
12
|
+
"space-around",
|
|
13
|
+
"space-between",
|
|
14
|
+
"space-evenly"
|
|
15
|
+
];
|
|
16
|
+
const RowAlign = ["top", "middle", "bottom"];
|
|
17
|
+
const rowProps = runtime.buildProps({
|
|
18
|
+
tag: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: "div"
|
|
21
|
+
},
|
|
22
|
+
gutter: {
|
|
23
|
+
type: Number,
|
|
24
|
+
default: 0
|
|
25
|
+
},
|
|
26
|
+
justify: {
|
|
27
|
+
type: String,
|
|
28
|
+
values: RowJustify,
|
|
29
|
+
default: "start"
|
|
30
|
+
},
|
|
31
|
+
align: {
|
|
32
|
+
type: String,
|
|
33
|
+
values: RowAlign
|
|
49
34
|
}
|
|
50
35
|
});
|
|
51
|
-
var Row = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "row.vue"]]);
|
|
52
36
|
|
|
53
|
-
exports
|
|
37
|
+
exports.RowAlign = RowAlign;
|
|
38
|
+
exports.RowJustify = RowJustify;
|
|
39
|
+
exports.rowProps = rowProps;
|
|
54
40
|
//# sourceMappingURL=row2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"row2.js","sources":["../../../../../../packages/components/row/src/row.
|
|
1
|
+
{"version":3,"file":"row2.js","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":["buildProps"],"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,GAAGA,kBAAU,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;;;;;;"}
|
|
@@ -2,19 +2,72 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
require('
|
|
6
|
-
var
|
|
5
|
+
var vue = require('vue');
|
|
6
|
+
var util = require('./util.js');
|
|
7
|
+
var thumb = require('./thumb2.js');
|
|
8
|
+
var bar = require('./bar2.js');
|
|
9
|
+
var constants = require('./constants.js');
|
|
10
|
+
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
|
|
7
11
|
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
13
|
+
__name: "bar",
|
|
14
|
+
props: bar.barProps,
|
|
15
|
+
setup(__props, { expose }) {
|
|
16
|
+
const props = __props;
|
|
17
|
+
const scrollbar = vue.inject(constants.scrollbarContextKey);
|
|
18
|
+
const moveX = vue.ref(0);
|
|
19
|
+
const moveY = vue.ref(0);
|
|
20
|
+
const sizeWidth = vue.ref("");
|
|
21
|
+
const sizeHeight = vue.ref("");
|
|
22
|
+
const ratioY = vue.ref(1);
|
|
23
|
+
const ratioX = vue.ref(1);
|
|
24
|
+
const handleScroll = (wrap) => {
|
|
25
|
+
if (wrap) {
|
|
26
|
+
const offsetHeight = wrap.offsetHeight - util.GAP;
|
|
27
|
+
const offsetWidth = wrap.offsetWidth - util.GAP;
|
|
28
|
+
moveY.value = wrap.scrollTop * 100 / offsetHeight * ratioY.value;
|
|
29
|
+
moveX.value = wrap.scrollLeft * 100 / offsetWidth * ratioX.value;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
const update = () => {
|
|
33
|
+
const wrap = scrollbar == null ? void 0 : scrollbar.wrapElement;
|
|
34
|
+
if (!wrap)
|
|
35
|
+
return;
|
|
36
|
+
const offsetHeight = wrap.offsetHeight - util.GAP;
|
|
37
|
+
const offsetWidth = wrap.offsetWidth - util.GAP;
|
|
38
|
+
const originalHeight = offsetHeight ** 2 / wrap.scrollHeight;
|
|
39
|
+
const originalWidth = offsetWidth ** 2 / wrap.scrollWidth;
|
|
40
|
+
const height = Math.max(originalHeight, props.minSize);
|
|
41
|
+
const width = Math.max(originalWidth, props.minSize);
|
|
42
|
+
ratioY.value = originalHeight / (offsetHeight - originalHeight) / (height / (offsetHeight - height));
|
|
43
|
+
ratioX.value = originalWidth / (offsetWidth - originalWidth) / (width / (offsetWidth - width));
|
|
44
|
+
sizeHeight.value = height + util.GAP < offsetHeight ? `${height}px` : "";
|
|
45
|
+
sizeWidth.value = width + util.GAP < offsetWidth ? `${width}px` : "";
|
|
46
|
+
};
|
|
47
|
+
expose({
|
|
48
|
+
handleScroll,
|
|
49
|
+
update
|
|
50
|
+
});
|
|
51
|
+
return (_ctx, _cache) => {
|
|
52
|
+
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
|
|
53
|
+
vue.createVNode(thumb["default"], {
|
|
54
|
+
move: moveX.value,
|
|
55
|
+
ratio: ratioX.value,
|
|
56
|
+
size: sizeWidth.value,
|
|
57
|
+
always: _ctx.always
|
|
58
|
+
}, null, 8, ["move", "ratio", "size", "always"]),
|
|
59
|
+
vue.createVNode(thumb["default"], {
|
|
60
|
+
move: moveY.value,
|
|
61
|
+
ratio: ratioY.value,
|
|
62
|
+
size: sizeHeight.value,
|
|
63
|
+
vertical: "",
|
|
64
|
+
always: _ctx.always
|
|
65
|
+
}, null, 8, ["move", "ratio", "size", "always"])
|
|
66
|
+
], 64);
|
|
67
|
+
};
|
|
16
68
|
}
|
|
17
69
|
});
|
|
70
|
+
var Bar = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "bar.vue"]]);
|
|
18
71
|
|
|
19
|
-
exports
|
|
72
|
+
exports["default"] = Bar;
|
|
20
73
|
//# sourceMappingURL=bar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bar.js","sources":["../../../../../../packages/components/scrollbar/src/bar.
|
|
1
|
+
{"version":3,"file":"bar.js","sources":["../../../../../../packages/components/scrollbar/src/bar.vue"],"sourcesContent":["<template>\n <thumb :move=\"moveX\" :ratio=\"ratioX\" :size=\"sizeWidth\" :always=\"always\" />\n <thumb\n :move=\"moveY\"\n :ratio=\"ratioY\"\n :size=\"sizeHeight\"\n vertical\n :always=\"always\"\n />\n</template>\n<script lang=\"ts\" setup>\nimport { inject, ref } from 'vue'\nimport { GAP } from './util'\nimport Thumb from './thumb.vue'\nimport { barProps } from './bar'\nimport { scrollbarContextKey } from './constants'\n\nconst props = defineProps(barProps)\n\nconst scrollbar = inject(scrollbarContextKey)\n\nconst moveX = ref(0)\nconst moveY = ref(0)\nconst sizeWidth = ref('')\nconst sizeHeight = ref('')\nconst ratioY = ref(1)\nconst ratioX = ref(1)\n\nconst handleScroll = (wrap: HTMLDivElement) => {\n if (wrap) {\n const offsetHeight = wrap.offsetHeight - GAP\n const offsetWidth = wrap.offsetWidth - GAP\n\n moveY.value = ((wrap.scrollTop * 100) / offsetHeight) * ratioY.value\n moveX.value = ((wrap.scrollLeft * 100) / offsetWidth) * ratioX.value\n }\n}\n\nconst update = () => {\n const wrap = scrollbar?.wrapElement\n if (!wrap) return\n const offsetHeight = wrap.offsetHeight - GAP\n const offsetWidth = wrap.offsetWidth - GAP\n\n const originalHeight = offsetHeight ** 2 / wrap.scrollHeight\n const originalWidth = offsetWidth ** 2 / wrap.scrollWidth\n const height = Math.max(originalHeight, props.minSize)\n const width = Math.max(originalWidth, props.minSize)\n\n ratioY.value =\n originalHeight /\n (offsetHeight - originalHeight) /\n (height / (offsetHeight - height))\n ratioX.value =\n originalWidth /\n (offsetWidth - originalWidth) /\n (width / (offsetWidth - width))\n\n sizeHeight.value = height + GAP < offsetHeight ? `${height}px` : ''\n sizeWidth.value = width + GAP < offsetWidth ? `${width}px` : ''\n}\n\ndefineExpose({\n handleScroll,\n update,\n})\n</script>\n"],"names":["inject","scrollbarContextKey","ref","GAP"],"mappings":";;;;;;;;;;;;;;;;AAmBA,IAAM,MAAA,SAAA,GAAYA,WAAOC,6BAAmB,CAAA,CAAA;AAE5C,IAAM,MAAA,KAAA,GAAQC,QAAI,CAAC,CAAA,CAAA;AACnB,IAAM,MAAA,KAAA,GAAQA,QAAI,CAAC,CAAA,CAAA;AACnB,IAAM,MAAA,SAAA,GAAYA,QAAI,EAAE,CAAA,CAAA;AACxB,IAAM,MAAA,UAAA,GAAaA,QAAI,EAAE,CAAA,CAAA;AACzB,IAAM,MAAA,MAAA,GAASA,QAAI,CAAC,CAAA,CAAA;AACpB,IAAM,MAAA,MAAA,GAASA,QAAI,CAAC,CAAA,CAAA;AAEpB,IAAM,MAAA,YAAA,GAAe,CAAC,IAAyB,KAAA;AAC7C,MAAA,IAAI,IAAM,EAAA;AACR,QAAM,MAAA,YAAA,GAAe,KAAK,YAAe,GAAAC,QAAA,CAAA;AACzC,QAAM,MAAA,WAAA,GAAc,KAAK,WAAc,GAAAA,QAAA,CAAA;AAEvC,QAAA,KAAA,CAAM,KAAU,GAAA,IAAA,CAAK,SAAY,GAAA,GAAA,GAAO,eAAgB,MAAO,CAAA,KAAA,CAAA;AAC/D,QAAA,KAAA,CAAM,KAAU,GAAA,IAAA,CAAK,UAAa,GAAA,GAAA,GAAO,cAAe,MAAO,CAAA,KAAA,CAAA;AAAA,OACjE;AAAA,KACF,CAAA;AAEA,IAAA,MAAM,SAAS,MAAM;AACnB,MAAA,MAAM,OAAO,SAAW,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,SAAA,CAAA,WAAA,CAAA;AACxB,MAAA,IAAI,CAAC,IAAA;AAAM,QAAA,OAAA;AACX,MAAM,MAAA,YAAA,GAAe,KAAK,YAAe,GAAAA,QAAA,CAAA;AACzC,MAAM,MAAA,WAAA,GAAc,KAAK,WAAc,GAAAA,QAAA,CAAA;AAEvC,MAAM,MAAA,cAAA,GAAiB,YAAgB,IAAA,CAAA,GAAI,IAAK,CAAA,YAAA,CAAA;AAChD,MAAM,MAAA,aAAA,GAAgB,WAAe,IAAA,CAAA,GAAI,IAAK,CAAA,WAAA,CAAA;AAC9C,MAAA,MAAM,MAAS,GAAA,IAAA,CAAK,GAAI,CAAA,cAAA,EAAgB,MAAM,OAAO,CAAA,CAAA;AACrD,MAAA,MAAM,KAAQ,GAAA,IAAA,CAAK,GAAI,CAAA,aAAA,EAAe,MAAM,OAAO,CAAA,CAAA;AAEnD,MAAA,MAAA,CAAO,KACL,GAAA,cAAA,IACgB,YAAA,GAAA,cAAA,CAAA,cACU,YAAA,GAAA,MAAA,CAAA,CAAA,CAAA;AAC5B,MAAA,MAAA,CAAO,KACL,GAAA,aAAA,IACe,WAAA,GAAA,aAAA,CAAA,aACS,WAAA,GAAA,KAAA,CAAA,CAAA,CAAA;AAE1B,MAAA,UAAA,CAAW,KAAQ,GAAA,MAAA,GAASA,QAAM,GAAA,YAAA,GAAe,GAAG,MAAa,CAAA,EAAA,CAAA,GAAA,EAAA,CAAA;AACjE,MAAA,SAAA,CAAU,KAAQ,GAAA,KAAA,GAAQA,QAAM,GAAA,WAAA,GAAc,GAAG,KAAY,CAAA,EAAA,CAAA,GAAA,EAAA,CAAA;AAAA,KAC/D,CAAA;AAEA,IAAa,MAAA,CAAA;AAAA,MACX,YAAA;AAAA,MACA,MAAA;AAAA,KACD,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;"}
|