@element-plus/nightly 0.0.20240207 → 0.0.20240209
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 +38 -39
- package/dist/index.full.min.js +11 -11
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +14 -14
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +38 -39
- 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/autocomplete/index.d.ts +67 -43
- package/es/components/autocomplete/src/autocomplete.vue.d.ts +67 -43
- package/es/components/carousel/index.mjs +2 -2
- package/es/components/carousel/src/carousel.mjs +56 -177
- package/es/components/carousel/src/carousel.mjs.map +1 -1
- package/es/components/carousel/src/carousel2.mjs +177 -56
- package/es/components/carousel/src/carousel2.mjs.map +1 -1
- package/es/components/cascader/index.d.ts +402 -258
- package/es/components/cascader/src/cascader.vue.d.ts +201 -129
- package/es/components/date-picker/src/date-picker-com/panel-date-pick.vue.d.ts +737 -473
- package/es/components/date-picker/src/date-picker-com/panel-date-range.vue.d.ts +737 -473
- package/es/components/date-picker/src/panel-utils.d.ts +1474 -946
- package/es/components/drawer/index.mjs +2 -2
- package/es/components/drawer/src/drawer.mjs +27 -180
- package/es/components/drawer/src/drawer.mjs.map +1 -1
- package/es/components/drawer/src/drawer2.mjs +180 -27
- package/es/components/drawer/src/drawer2.mjs.map +1 -1
- package/es/components/index.mjs +5 -5
- package/es/components/rate/index.mjs +2 -2
- package/es/components/rate/src/rate.mjs +260 -87
- package/es/components/rate/src/rate.mjs.map +1 -1
- package/es/components/rate/src/rate2.mjs +87 -260
- package/es/components/rate/src/rate2.mjs.map +1 -1
- package/es/components/scrollbar/index.d.ts +67 -43
- package/es/components/scrollbar/index.mjs +2 -2
- package/es/components/scrollbar/src/bar.d.ts +6 -4
- package/es/components/scrollbar/src/bar.mjs +2 -8
- package/es/components/scrollbar/src/bar.mjs.map +1 -1
- package/es/components/scrollbar/src/bar.vue.d.ts +24 -14
- package/es/components/scrollbar/src/bar2.mjs +30 -8
- package/es/components/scrollbar/src/bar2.mjs.map +1 -1
- package/es/components/scrollbar/src/scrollbar.mjs +160 -53
- package/es/components/scrollbar/src/scrollbar.mjs.map +1 -1
- package/es/components/scrollbar/src/scrollbar.vue.d.ts +67 -43
- package/es/components/scrollbar/src/scrollbar2.mjs +53 -178
- package/es/components/scrollbar/src/scrollbar2.mjs.map +1 -1
- package/es/components/select-v2/src/useSelect.mjs +2 -1
- package/es/components/select-v2/src/useSelect.mjs.map +1 -1
- package/es/components/tabs/index.mjs +2 -2
- package/es/components/tabs/src/tab-pane.mjs +13 -72
- package/es/components/tabs/src/tab-pane.mjs.map +1 -1
- package/es/components/tabs/src/tab-pane2.mjs +72 -13
- package/es/components/tabs/src/tab-pane2.mjs.map +1 -1
- package/es/components/time-picker/src/time-picker-com/basic-time-spinner.vue.d.ts +603 -387
- package/es/components/time-picker/src/time-picker-com/panel-time-pick.vue.d.ts +737 -473
- package/es/components/time-picker/src/time-picker-com/panel-time-range.vue.d.ts +737 -473
- package/es/index.mjs +5 -5
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/autocomplete/index.d.ts +67 -43
- package/lib/components/autocomplete/src/autocomplete.vue.d.ts +67 -43
- package/lib/components/carousel/index.js +2 -2
- package/lib/components/carousel/src/carousel.js +57 -177
- package/lib/components/carousel/src/carousel.js.map +1 -1
- package/lib/components/carousel/src/carousel2.js +177 -57
- package/lib/components/carousel/src/carousel2.js.map +1 -1
- package/lib/components/cascader/index.d.ts +402 -258
- package/lib/components/cascader/src/cascader.vue.d.ts +201 -129
- package/lib/components/date-picker/src/date-picker-com/panel-date-pick.vue.d.ts +737 -473
- package/lib/components/date-picker/src/date-picker-com/panel-date-range.vue.d.ts +737 -473
- package/lib/components/date-picker/src/panel-utils.d.ts +1474 -946
- package/lib/components/drawer/index.js +2 -2
- package/lib/components/drawer/src/drawer.js +28 -180
- package/lib/components/drawer/src/drawer.js.map +1 -1
- package/lib/components/drawer/src/drawer2.js +180 -28
- package/lib/components/drawer/src/drawer2.js.map +1 -1
- package/lib/components/index.js +5 -5
- package/lib/components/rate/index.js +2 -2
- package/lib/components/rate/src/rate.js +259 -87
- package/lib/components/rate/src/rate.js.map +1 -1
- package/lib/components/rate/src/rate2.js +87 -259
- package/lib/components/rate/src/rate2.js.map +1 -1
- package/lib/components/scrollbar/index.d.ts +67 -43
- package/lib/components/scrollbar/index.js +2 -2
- package/lib/components/scrollbar/src/bar.d.ts +6 -4
- package/lib/components/scrollbar/src/bar.js +2 -8
- package/lib/components/scrollbar/src/bar.js.map +1 -1
- package/lib/components/scrollbar/src/bar.vue.d.ts +24 -14
- package/lib/components/scrollbar/src/bar2.js +29 -7
- package/lib/components/scrollbar/src/bar2.js.map +1 -1
- package/lib/components/scrollbar/src/scrollbar.js +160 -54
- package/lib/components/scrollbar/src/scrollbar.js.map +1 -1
- package/lib/components/scrollbar/src/scrollbar.vue.d.ts +67 -43
- package/lib/components/scrollbar/src/scrollbar2.js +54 -178
- package/lib/components/scrollbar/src/scrollbar2.js.map +1 -1
- package/lib/components/select-v2/src/useSelect.js +2 -1
- package/lib/components/select-v2/src/useSelect.js.map +1 -1
- package/lib/components/tabs/index.js +2 -2
- package/lib/components/tabs/src/tab-pane.js +13 -72
- package/lib/components/tabs/src/tab-pane.js.map +1 -1
- package/lib/components/tabs/src/tab-pane2.js +72 -13
- package/lib/components/tabs/src/tab-pane2.js.map +1 -1
- package/lib/components/time-picker/src/time-picker-com/basic-time-spinner.vue.d.ts +603 -387
- package/lib/components/time-picker/src/time-picker-com/panel-time-pick.vue.d.ts +737 -473
- package/lib/components/time-picker/src/time-picker-com/panel-time-range.vue.d.ts +737 -473
- package/lib/index.js +5 -5
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +2 -2
- package/web-types.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bar.mjs","sources":["../../../../../../packages/components/scrollbar/src/bar.ts"],"sourcesContent":["import { buildProps } from '@element-plus/utils'\nimport type { ExtractPropTypes } from 'vue'\nimport type Bar from './bar.vue'\n\nexport const barProps = buildProps({\n always: {\n type: Boolean,\n default: true,\n },\n
|
|
1
|
+
{"version":3,"file":"bar.mjs","sources":["../../../../../../packages/components/scrollbar/src/bar.ts"],"sourcesContent":["import { buildProps } from '@element-plus/utils'\nimport type { ExtractPropTypes } from 'vue'\nimport type Bar from './bar.vue'\n\nexport const barProps = buildProps({\n always: {\n type: Boolean,\n default: true,\n },\n minSize: {\n type: Number,\n required: true,\n },\n} as const)\nexport type BarProps = ExtractPropTypes<typeof barProps>\n\nexport type BarInstance = InstanceType<typeof Bar>\n"],"names":[],"mappings":";;;AACY,MAAC,QAAQ,GAAG,UAAU,CAAC;AACnC,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,OAAO,EAAE;AACX,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,QAAQ,EAAE,IAAI;AAClB,GAAG;AACH,CAAC;;;;"}
|
|
@@ -1,22 +1,32 @@
|
|
|
1
1
|
declare const _default: import("vue").DefineComponent<{
|
|
2
2
|
readonly always: import("../../../utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
3
|
-
readonly
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
readonly minSize: {
|
|
4
|
+
readonly type: import("vue").PropType<number>;
|
|
5
|
+
readonly required: true;
|
|
6
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
7
|
+
__epPropKey: true;
|
|
8
|
+
};
|
|
7
9
|
}, {
|
|
8
10
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
9
11
|
readonly always: import("../../../utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
10
|
-
readonly
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
readonly minSize: {
|
|
13
|
+
readonly type: import("vue").PropType<number>;
|
|
14
|
+
readonly required: true;
|
|
15
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
16
|
+
__epPropKey: true;
|
|
17
|
+
};
|
|
14
18
|
}>> & {
|
|
15
19
|
[x: string & `on${string}`]: ((...args: any[]) => any) | ((...args: unknown[]) => any) | undefined;
|
|
16
20
|
}>>;
|
|
21
|
+
scrollbar: import("./constants").ScrollbarContext | undefined;
|
|
17
22
|
moveX: import("vue").Ref<number>;
|
|
18
23
|
moveY: import("vue").Ref<number>;
|
|
24
|
+
sizeWidth: import("vue").Ref<string>;
|
|
25
|
+
sizeHeight: import("vue").Ref<string>;
|
|
26
|
+
ratioY: import("vue").Ref<number>;
|
|
27
|
+
ratioX: import("vue").Ref<number>;
|
|
19
28
|
handleScroll: (wrap: HTMLDivElement) => void;
|
|
29
|
+
update: () => void;
|
|
20
30
|
Thumb: import("vue").DefineComponent<{
|
|
21
31
|
readonly vertical: BooleanConstructor;
|
|
22
32
|
readonly size: StringConstructor;
|
|
@@ -119,13 +129,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
119
129
|
}>;
|
|
120
130
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
121
131
|
readonly always: import("../../../utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
122
|
-
readonly
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
132
|
+
readonly minSize: {
|
|
133
|
+
readonly type: import("vue").PropType<number>;
|
|
134
|
+
readonly required: true;
|
|
135
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
136
|
+
__epPropKey: true;
|
|
137
|
+
};
|
|
126
138
|
}>>, {
|
|
127
139
|
readonly always: import("../../../utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
128
|
-
readonly ratioX: number;
|
|
129
|
-
readonly ratioY: number;
|
|
130
140
|
}>;
|
|
131
141
|
export default _default;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { defineComponent, ref, openBlock, createElementBlock, Fragment, createVNode } from 'vue';
|
|
1
|
+
import { defineComponent, inject, ref, openBlock, createElementBlock, Fragment, createVNode } from 'vue';
|
|
2
2
|
import { GAP } from './util.mjs';
|
|
3
3
|
import Thumb from './thumb2.mjs';
|
|
4
4
|
import { barProps } from './bar.mjs';
|
|
5
|
+
import { scrollbarContextKey } from './constants.mjs';
|
|
5
6
|
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
6
7
|
|
|
7
8
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
@@ -9,31 +10,52 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
9
10
|
props: barProps,
|
|
10
11
|
setup(__props, { expose }) {
|
|
11
12
|
const props = __props;
|
|
13
|
+
const scrollbar = inject(scrollbarContextKey);
|
|
12
14
|
const moveX = ref(0);
|
|
13
15
|
const moveY = ref(0);
|
|
16
|
+
const sizeWidth = ref("");
|
|
17
|
+
const sizeHeight = ref("");
|
|
18
|
+
const ratioY = ref(1);
|
|
19
|
+
const ratioX = ref(1);
|
|
14
20
|
const handleScroll = (wrap) => {
|
|
15
21
|
if (wrap) {
|
|
16
22
|
const offsetHeight = wrap.offsetHeight - GAP;
|
|
17
23
|
const offsetWidth = wrap.offsetWidth - GAP;
|
|
18
|
-
moveY.value = wrap.scrollTop * 100 / offsetHeight *
|
|
19
|
-
moveX.value = wrap.scrollLeft * 100 / offsetWidth *
|
|
24
|
+
moveY.value = wrap.scrollTop * 100 / offsetHeight * ratioY.value;
|
|
25
|
+
moveX.value = wrap.scrollLeft * 100 / offsetWidth * ratioX.value;
|
|
20
26
|
}
|
|
21
27
|
};
|
|
28
|
+
const update = () => {
|
|
29
|
+
const wrap = scrollbar == null ? void 0 : scrollbar.wrapElement;
|
|
30
|
+
if (!wrap)
|
|
31
|
+
return;
|
|
32
|
+
const offsetHeight = wrap.offsetHeight - GAP;
|
|
33
|
+
const offsetWidth = wrap.offsetWidth - GAP;
|
|
34
|
+
const originalHeight = offsetHeight ** 2 / wrap.scrollHeight;
|
|
35
|
+
const originalWidth = offsetWidth ** 2 / wrap.scrollWidth;
|
|
36
|
+
const height = Math.max(originalHeight, props.minSize);
|
|
37
|
+
const width = Math.max(originalWidth, props.minSize);
|
|
38
|
+
ratioY.value = originalHeight / (offsetHeight - originalHeight) / (height / (offsetHeight - height));
|
|
39
|
+
ratioX.value = originalWidth / (offsetWidth - originalWidth) / (width / (offsetWidth - width));
|
|
40
|
+
sizeHeight.value = height + GAP < offsetHeight ? `${height}px` : "";
|
|
41
|
+
sizeWidth.value = width + GAP < offsetWidth ? `${width}px` : "";
|
|
42
|
+
};
|
|
22
43
|
expose({
|
|
23
|
-
handleScroll
|
|
44
|
+
handleScroll,
|
|
45
|
+
update
|
|
24
46
|
});
|
|
25
47
|
return (_ctx, _cache) => {
|
|
26
48
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
27
49
|
createVNode(Thumb, {
|
|
28
50
|
move: moveX.value,
|
|
29
|
-
ratio:
|
|
30
|
-
size:
|
|
51
|
+
ratio: ratioX.value,
|
|
52
|
+
size: sizeWidth.value,
|
|
31
53
|
always: _ctx.always
|
|
32
54
|
}, null, 8, ["move", "ratio", "size", "always"]),
|
|
33
55
|
createVNode(Thumb, {
|
|
34
56
|
move: moveY.value,
|
|
35
|
-
ratio:
|
|
36
|
-
size:
|
|
57
|
+
ratio: ratioY.value,
|
|
58
|
+
size: sizeHeight.value,
|
|
37
59
|
vertical: "",
|
|
38
60
|
always: _ctx.always
|
|
39
61
|
}, null, 8, ["move", "ratio", "size", "always"])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bar2.mjs","sources":["../../../../../../packages/components/scrollbar/src/bar.vue"],"sourcesContent":["<template>\n <thumb :move=\"moveX\" :ratio=\"ratioX\" :size=\"
|
|
1
|
+
{"version":3,"file":"bar2.mjs","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":[],"mappings":";;;;;;;;;;;;AAmBA,IAAM,MAAA,SAAA,GAAY,OAAO,mBAAmB,CAAA,CAAA;AAE5C,IAAM,MAAA,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,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,GAAS,GAAM,GAAA,YAAA,GAAe,GAAG,MAAa,CAAA,EAAA,CAAA,GAAA,EAAA,CAAA;AACjE,MAAA,SAAA,CAAU,KAAQ,GAAA,KAAA,GAAQ,GAAM,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;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,60 +1,167 @@
|
|
|
1
|
+
import { defineComponent, ref, computed, watch, nextTick, provide, reactive, onMounted, onUpdated, openBlock, createElementBlock, normalizeClass, unref, createElementVNode, normalizeStyle, createBlock, resolveDynamicComponent, withCtx, renderSlot, createCommentVNode } from 'vue';
|
|
2
|
+
import { useResizeObserver, useEventListener } from '@vueuse/core';
|
|
1
3
|
import '../../../utils/index.mjs';
|
|
2
|
-
import
|
|
4
|
+
import '../../../hooks/index.mjs';
|
|
5
|
+
import Bar from './bar2.mjs';
|
|
6
|
+
import { scrollbarContextKey } from './constants.mjs';
|
|
7
|
+
import { scrollbarProps, scrollbarEmits } from './scrollbar2.mjs';
|
|
8
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
9
|
+
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
10
|
+
import { addUnit } from '../../../utils/dom/style.mjs';
|
|
11
|
+
import { isObject } from '@vue/shared';
|
|
3
12
|
import { isNumber } from '../../../utils/types.mjs';
|
|
13
|
+
import { debugWarn } from '../../../utils/error.mjs';
|
|
4
14
|
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
15
|
+
const COMPONENT_NAME = "ElScrollbar";
|
|
16
|
+
const __default__ = defineComponent({
|
|
17
|
+
name: COMPONENT_NAME
|
|
18
|
+
});
|
|
19
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
20
|
+
...__default__,
|
|
21
|
+
props: scrollbarProps,
|
|
22
|
+
emits: scrollbarEmits,
|
|
23
|
+
setup(__props, { expose, emit }) {
|
|
24
|
+
const props = __props;
|
|
25
|
+
const ns = useNamespace("scrollbar");
|
|
26
|
+
let stopResizeObserver = void 0;
|
|
27
|
+
let stopResizeListener = void 0;
|
|
28
|
+
const scrollbarRef = ref();
|
|
29
|
+
const wrapRef = ref();
|
|
30
|
+
const resizeRef = ref();
|
|
31
|
+
const barRef = ref();
|
|
32
|
+
const wrapStyle = computed(() => {
|
|
33
|
+
const style = {};
|
|
34
|
+
if (props.height)
|
|
35
|
+
style.height = addUnit(props.height);
|
|
36
|
+
if (props.maxHeight)
|
|
37
|
+
style.maxHeight = addUnit(props.maxHeight);
|
|
38
|
+
return [props.wrapStyle, style];
|
|
39
|
+
});
|
|
40
|
+
const wrapKls = computed(() => {
|
|
41
|
+
return [
|
|
42
|
+
props.wrapClass,
|
|
43
|
+
ns.e("wrap"),
|
|
44
|
+
{ [ns.em("wrap", "hidden-default")]: !props.native }
|
|
45
|
+
];
|
|
46
|
+
});
|
|
47
|
+
const resizeKls = computed(() => {
|
|
48
|
+
return [ns.e("view"), props.viewClass];
|
|
49
|
+
});
|
|
50
|
+
const handleScroll = () => {
|
|
51
|
+
var _a;
|
|
52
|
+
if (wrapRef.value) {
|
|
53
|
+
(_a = barRef.value) == null ? void 0 : _a.handleScroll(wrapRef.value);
|
|
54
|
+
emit("scroll", {
|
|
55
|
+
scrollTop: wrapRef.value.scrollTop,
|
|
56
|
+
scrollLeft: wrapRef.value.scrollLeft
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
function scrollTo(arg1, arg2) {
|
|
61
|
+
if (isObject(arg1)) {
|
|
62
|
+
wrapRef.value.scrollTo(arg1);
|
|
63
|
+
} else if (isNumber(arg1) && isNumber(arg2)) {
|
|
64
|
+
wrapRef.value.scrollTo(arg1, arg2);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
const setScrollTop = (value) => {
|
|
68
|
+
if (!isNumber(value)) {
|
|
69
|
+
debugWarn(COMPONENT_NAME, "value must be a number");
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
wrapRef.value.scrollTop = value;
|
|
73
|
+
};
|
|
74
|
+
const setScrollLeft = (value) => {
|
|
75
|
+
if (!isNumber(value)) {
|
|
76
|
+
debugWarn(COMPONENT_NAME, "value must be a number");
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
wrapRef.value.scrollLeft = value;
|
|
80
|
+
};
|
|
81
|
+
const update = () => {
|
|
82
|
+
var _a;
|
|
83
|
+
(_a = barRef.value) == null ? void 0 : _a.update();
|
|
84
|
+
};
|
|
85
|
+
watch(() => props.noresize, (noresize) => {
|
|
86
|
+
if (noresize) {
|
|
87
|
+
stopResizeObserver == null ? void 0 : stopResizeObserver();
|
|
88
|
+
stopResizeListener == null ? void 0 : stopResizeListener();
|
|
89
|
+
} else {
|
|
90
|
+
;
|
|
91
|
+
({ stop: stopResizeObserver } = useResizeObserver(resizeRef, update));
|
|
92
|
+
stopResizeListener = useEventListener("resize", update);
|
|
93
|
+
}
|
|
94
|
+
}, { immediate: true });
|
|
95
|
+
watch(() => [props.maxHeight, props.height], () => {
|
|
96
|
+
if (!props.native)
|
|
97
|
+
nextTick(() => {
|
|
98
|
+
var _a;
|
|
99
|
+
update();
|
|
100
|
+
if (wrapRef.value) {
|
|
101
|
+
(_a = barRef.value) == null ? void 0 : _a.handleScroll(wrapRef.value);
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
provide(scrollbarContextKey, reactive({
|
|
106
|
+
scrollbarElement: scrollbarRef,
|
|
107
|
+
wrapElement: wrapRef
|
|
108
|
+
}));
|
|
109
|
+
onMounted(() => {
|
|
110
|
+
if (!props.native)
|
|
111
|
+
nextTick(() => {
|
|
112
|
+
update();
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
onUpdated(() => update());
|
|
116
|
+
expose({
|
|
117
|
+
wrapRef,
|
|
118
|
+
update,
|
|
119
|
+
scrollTo,
|
|
120
|
+
setScrollTop,
|
|
121
|
+
setScrollLeft,
|
|
122
|
+
handleScroll
|
|
123
|
+
});
|
|
124
|
+
return (_ctx, _cache) => {
|
|
125
|
+
return openBlock(), createElementBlock("div", {
|
|
126
|
+
ref_key: "scrollbarRef",
|
|
127
|
+
ref: scrollbarRef,
|
|
128
|
+
class: normalizeClass(unref(ns).b())
|
|
129
|
+
}, [
|
|
130
|
+
createElementVNode("div", {
|
|
131
|
+
ref_key: "wrapRef",
|
|
132
|
+
ref: wrapRef,
|
|
133
|
+
class: normalizeClass(unref(wrapKls)),
|
|
134
|
+
style: normalizeStyle(unref(wrapStyle)),
|
|
135
|
+
onScroll: handleScroll
|
|
136
|
+
}, [
|
|
137
|
+
(openBlock(), createBlock(resolveDynamicComponent(_ctx.tag), {
|
|
138
|
+
id: _ctx.id,
|
|
139
|
+
ref_key: "resizeRef",
|
|
140
|
+
ref: resizeRef,
|
|
141
|
+
class: normalizeClass(unref(resizeKls)),
|
|
142
|
+
style: normalizeStyle(_ctx.viewStyle),
|
|
143
|
+
role: _ctx.role,
|
|
144
|
+
"aria-label": _ctx.ariaLabel,
|
|
145
|
+
"aria-orientation": _ctx.ariaOrientation
|
|
146
|
+
}, {
|
|
147
|
+
default: withCtx(() => [
|
|
148
|
+
renderSlot(_ctx.$slots, "default")
|
|
149
|
+
]),
|
|
150
|
+
_: 3
|
|
151
|
+
}, 8, ["id", "class", "style", "role", "aria-label", "aria-orientation"]))
|
|
152
|
+
], 38),
|
|
153
|
+
!_ctx.native ? (openBlock(), createBlock(Bar, {
|
|
154
|
+
key: 0,
|
|
155
|
+
ref_key: "barRef",
|
|
156
|
+
ref: barRef,
|
|
157
|
+
always: _ctx.always,
|
|
158
|
+
"min-size": _ctx.minSize
|
|
159
|
+
}, null, 8, ["always", "min-size"])) : createCommentVNode("v-if", true)
|
|
160
|
+
], 2);
|
|
161
|
+
};
|
|
50
162
|
}
|
|
51
163
|
});
|
|
52
|
-
|
|
53
|
-
scroll: ({
|
|
54
|
-
scrollTop,
|
|
55
|
-
scrollLeft
|
|
56
|
-
}) => [scrollTop, scrollLeft].every(isNumber)
|
|
57
|
-
};
|
|
164
|
+
var Scrollbar = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "scrollbar.vue"]]);
|
|
58
165
|
|
|
59
|
-
export {
|
|
166
|
+
export { Scrollbar as default };
|
|
60
167
|
//# sourceMappingURL=scrollbar.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scrollbar.mjs","sources":["../../../../../../packages/components/scrollbar/src/scrollbar.
|
|
1
|
+
{"version":3,"file":"scrollbar.mjs","sources":["../../../../../../packages/components/scrollbar/src/scrollbar.vue"],"sourcesContent":["<template>\n <div ref=\"scrollbarRef\" :class=\"ns.b()\">\n <div\n ref=\"wrapRef\"\n :class=\"wrapKls\"\n :style=\"wrapStyle\"\n @scroll=\"handleScroll\"\n >\n <component\n :is=\"tag\"\n :id=\"id\"\n ref=\"resizeRef\"\n :class=\"resizeKls\"\n :style=\"viewStyle\"\n :role=\"role\"\n :aria-label=\"ariaLabel\"\n :aria-orientation=\"ariaOrientation\"\n >\n <slot />\n </component>\n </div>\n <template v-if=\"!native\">\n <bar ref=\"barRef\" :always=\"always\" :min-size=\"minSize\" />\n </template>\n </div>\n</template>\n<script lang=\"ts\" setup>\nimport {\n computed,\n nextTick,\n onMounted,\n onUpdated,\n provide,\n reactive,\n ref,\n watch,\n} from 'vue'\nimport { useEventListener, useResizeObserver } from '@vueuse/core'\nimport { addUnit, debugWarn, isNumber, isObject } from '@element-plus/utils'\nimport { useNamespace } from '@element-plus/hooks'\nimport Bar from './bar.vue'\nimport { scrollbarContextKey } from './constants'\nimport { scrollbarEmits, scrollbarProps } from './scrollbar'\nimport type { BarInstance } from './bar'\nimport type { CSSProperties, StyleValue } from 'vue'\n\nconst COMPONENT_NAME = 'ElScrollbar'\n\ndefineOptions({\n name: COMPONENT_NAME,\n})\n\nconst props = defineProps(scrollbarProps)\nconst emit = defineEmits(scrollbarEmits)\n\nconst ns = useNamespace('scrollbar')\n\nlet stopResizeObserver: (() => void) | undefined = undefined\nlet stopResizeListener: (() => void) | undefined = undefined\n\nconst scrollbarRef = ref<HTMLDivElement>()\nconst wrapRef = ref<HTMLDivElement>()\nconst resizeRef = ref<HTMLElement>()\nconst barRef = ref<BarInstance>()\n\nconst wrapStyle = computed<StyleValue>(() => {\n const style: CSSProperties = {}\n if (props.height) style.height = addUnit(props.height)\n if (props.maxHeight) style.maxHeight = addUnit(props.maxHeight)\n return [props.wrapStyle, style]\n})\n\nconst wrapKls = computed(() => {\n return [\n props.wrapClass,\n ns.e('wrap'),\n { [ns.em('wrap', 'hidden-default')]: !props.native },\n ]\n})\n\nconst resizeKls = computed(() => {\n return [ns.e('view'), props.viewClass]\n})\n\nconst handleScroll = () => {\n if (wrapRef.value) {\n barRef.value?.handleScroll(wrapRef.value)\n\n emit('scroll', {\n scrollTop: wrapRef.value.scrollTop,\n scrollLeft: wrapRef.value.scrollLeft,\n })\n }\n}\n\n// TODO: refactor method overrides, due to script setup dts\n// @ts-nocheck\nfunction scrollTo(xCord: number, yCord?: number): void\nfunction scrollTo(options: ScrollToOptions): void\nfunction scrollTo(arg1: unknown, arg2?: number) {\n if (isObject(arg1)) {\n wrapRef.value!.scrollTo(arg1)\n } else if (isNumber(arg1) && isNumber(arg2)) {\n wrapRef.value!.scrollTo(arg1, arg2)\n }\n}\n\nconst setScrollTop = (value: number) => {\n if (!isNumber(value)) {\n debugWarn(COMPONENT_NAME, 'value must be a number')\n return\n }\n wrapRef.value!.scrollTop = value\n}\n\nconst setScrollLeft = (value: number) => {\n if (!isNumber(value)) {\n debugWarn(COMPONENT_NAME, 'value must be a number')\n return\n }\n wrapRef.value!.scrollLeft = value\n}\n\nconst update = () => {\n barRef.value?.update()\n}\n\nwatch(\n () => props.noresize,\n (noresize) => {\n if (noresize) {\n stopResizeObserver?.()\n stopResizeListener?.()\n } else {\n ;({ stop: stopResizeObserver } = useResizeObserver(resizeRef, update))\n stopResizeListener = useEventListener('resize', update)\n }\n },\n { immediate: true }\n)\n\nwatch(\n () => [props.maxHeight, props.height],\n () => {\n if (!props.native)\n nextTick(() => {\n update()\n if (wrapRef.value) {\n barRef.value?.handleScroll(wrapRef.value)\n }\n })\n }\n)\n\nprovide(\n scrollbarContextKey,\n reactive({\n scrollbarElement: scrollbarRef,\n wrapElement: wrapRef,\n })\n)\n\nonMounted(() => {\n if (!props.native)\n nextTick(() => {\n update()\n })\n})\nonUpdated(() => update())\n\ndefineExpose({\n /** @description scrollbar wrap ref */\n wrapRef,\n /** @description update scrollbar state manually */\n update,\n /** @description scrolls to a particular set of coordinates */\n scrollTo,\n /** @description set distance to scroll top */\n setScrollTop,\n /** @description set distance to scroll left */\n setScrollLeft,\n /** @description handle scroll event */\n handleScroll,\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;mCAgDc,CAAA;AAAA,EACZ,IAAM,EAAA,cAAA;AACR;;;;;;;AAKA,IAAM,MAAA,EAAA,GAAK,aAAa,WAAW,CAAA,CAAA;AAEnC,IAAA,IAAI,kBAA+C,GAAA,KAAA,CAAA,CAAA;AACnD,IAAA,IAAI,kBAA+C,GAAA,KAAA,CAAA,CAAA;AAEnD,IAAA,MAAM,eAAe,GAAoB,EAAA,CAAA;AACzC,IAAA,MAAM,UAAU,GAAoB,EAAA,CAAA;AACpC,IAAA,MAAM,YAAY,GAAiB,EAAA,CAAA;AACnC,IAAA,MAAM,SAAS,GAAiB,EAAA,CAAA;AAEhC,IAAM,MAAA,SAAA,GAAY,SAAqB,MAAM;AAC3C,MAAA,MAAM,QAAuB,EAAC,CAAA;AAC9B,MAAA,IAAI,KAAM,CAAA,MAAA;AAAQ,QAAM,KAAA,CAAA,MAAA,GAAS,OAAQ,CAAA,KAAA,CAAM,MAAM,CAAA,CAAA;AACrD,MAAA,IAAI,KAAM,CAAA,SAAA;AAAW,QAAM,KAAA,CAAA,SAAA,GAAY,OAAQ,CAAA,KAAA,CAAM,SAAS,CAAA,CAAA;AAC9D,MAAO,OAAA,CAAC,KAAM,CAAA,SAAA,EAAW,KAAK,CAAA,CAAA;AAAA,KAC/B,CAAA,CAAA;AAED,IAAM,MAAA,OAAA,GAAU,SAAS,MAAM;AAC7B,MAAO,OAAA;AAAA,QACL,KAAM,CAAA,SAAA;AAAA,QACN,EAAA,CAAG,EAAE,MAA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