element-ps 2.0.32 → 2.0.35
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 +74 -406
- package/dist/index.full.min.js +5 -5
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +5 -5
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +74 -406
- package/es/components/alert/index.mjs +2 -2
- package/es/components/alert/src/alert.mjs +33 -83
- package/es/components/alert/src/alert.mjs.map +1 -1
- package/es/components/alert/src/alert2.mjs +83 -33
- package/es/components/alert/src/alert2.mjs.map +1 -1
- package/es/components/backtop/index.mjs +2 -2
- package/es/components/backtop/src/backtop.mjs +59 -18
- package/es/components/backtop/src/backtop.mjs.map +1 -1
- package/es/components/backtop/src/backtop2.mjs +18 -59
- package/es/components/backtop/src/backtop2.mjs.map +1 -1
- package/es/components/breadcrumb/index.mjs +2 -2
- package/es/components/breadcrumb/src/breadcrumb-item.mjs +46 -11
- package/es/components/breadcrumb/src/breadcrumb-item.mjs.map +1 -1
- package/es/components/breadcrumb/src/breadcrumb-item2.mjs +11 -46
- package/es/components/breadcrumb/src/breadcrumb-item2.mjs.map +1 -1
- package/es/components/button/index.mjs +3 -3
- package/es/components/button/src/button-group.mjs +30 -5
- package/es/components/button/src/button-group.mjs.map +1 -1
- package/es/components/button/src/button-group2.mjs +5 -30
- package/es/components/button/src/button-group2.mjs.map +1 -1
- package/es/components/button/src/button.mjs +96 -48
- package/es/components/button/src/button.mjs.map +1 -1
- package/es/components/button/src/button2.mjs +48 -96
- package/es/components/button/src/button2.mjs.map +1 -1
- package/es/components/calendar/index.mjs +2 -2
- package/es/components/calendar/src/calendar.mjs +9 -188
- package/es/components/calendar/src/calendar.mjs.map +1 -1
- package/es/components/calendar/src/calendar2.mjs +188 -9
- package/es/components/calendar/src/calendar2.mjs.map +1 -1
- package/es/components/cascader/src/index.mjs +1 -1
- package/es/components/empty/index.mjs +2 -2
- package/es/components/empty/src/empty.mjs +11 -56
- package/es/components/empty/src/empty.mjs.map +1 -1
- package/es/components/empty/src/empty2.mjs +56 -11
- package/es/components/empty/src/empty2.mjs.map +1 -1
- package/es/components/form/src/form-item2.mjs +2 -8
- package/es/components/form/src/form-item2.mjs.map +1 -1
- package/es/components/image/index.mjs +2 -2
- package/es/components/image/src/image.mjs +50 -127
- package/es/components/image/src/image.mjs.map +1 -1
- package/es/components/image/src/image2.mjs +127 -50
- package/es/components/image/src/image2.mjs.map +1 -1
- package/es/components/image-viewer/index.mjs +2 -2
- package/es/components/image-viewer/src/image-viewer.mjs +210 -31
- package/es/components/image-viewer/src/image-viewer.mjs.map +1 -1
- package/es/components/image-viewer/src/image-viewer2.mjs +31 -210
- package/es/components/image-viewer/src/image-viewer2.mjs.map +1 -1
- package/es/components/index.mjs +24 -24
- package/es/components/input/index.mjs +2 -2
- package/es/components/input/src/input.mjs +295 -85
- package/es/components/input/src/input.mjs.map +1 -1
- package/es/components/input/src/input2.mjs +85 -295
- package/es/components/input/src/input2.mjs.map +1 -1
- package/es/components/link/index.mjs +2 -2
- package/es/components/link/src/link.mjs +19 -43
- package/es/components/link/src/link.mjs.map +1 -1
- package/es/components/link/src/link2.mjs +43 -19
- package/es/components/link/src/link2.mjs.map +1 -1
- package/es/components/menu/index.d.ts +6 -16
- package/es/components/menu/src/menu-item.mjs +8 -35
- package/es/components/menu/src/menu-item.mjs.map +1 -1
- package/es/components/menu/src/menu-item.vue.d.ts +10 -15
- package/es/components/menu/src/menu.mjs +2 -1
- package/es/components/menu/src/menu.mjs.map +1 -1
- package/es/components/popconfirm/index.mjs +2 -2
- package/es/components/popconfirm/src/popconfirm.mjs +20 -53
- package/es/components/popconfirm/src/popconfirm.mjs.map +1 -1
- package/es/components/popconfirm/src/popconfirm2.mjs +53 -20
- package/es/components/popconfirm/src/popconfirm2.mjs.map +1 -1
- package/es/components/popper/index.mjs +2 -2
- package/es/components/popper/src/arrow.mjs +31 -7
- package/es/components/popper/src/arrow.mjs.map +1 -1
- package/es/components/popper/src/arrow2.mjs +7 -31
- package/es/components/popper/src/arrow2.mjs.map +1 -1
- package/es/components/radio/index.mjs +6 -6
- package/es/components/radio/src/radio-button.mjs +9 -80
- package/es/components/radio/src/radio-button.mjs.map +1 -1
- package/es/components/radio/src/radio-button2.mjs +80 -9
- package/es/components/radio/src/radio-button2.mjs.map +1 -1
- package/es/components/radio/src/radio-group.mjs +37 -18
- package/es/components/radio/src/radio-group.mjs.map +1 -1
- package/es/components/radio/src/radio-group2.mjs +18 -37
- package/es/components/radio/src/radio-group2.mjs.map +1 -1
- package/es/components/radio/src/radio.mjs +74 -62
- package/es/components/radio/src/radio.mjs.map +1 -1
- package/es/components/radio/src/radio2.mjs +62 -74
- package/es/components/radio/src/radio2.mjs.map +1 -1
- package/es/components/rate/index.mjs +2 -2
- package/es/components/rate/src/rate.mjs +84 -169
- package/es/components/rate/src/rate.mjs.map +1 -1
- package/es/components/rate/src/rate2.mjs +169 -84
- package/es/components/rate/src/rate2.mjs.map +1 -1
- package/es/components/result/index.mjs +2 -2
- package/es/components/result/src/result.mjs +73 -28
- package/es/components/result/src/result.mjs.map +1 -1
- package/es/components/result/src/result2.mjs +28 -73
- package/es/components/result/src/result2.mjs.map +1 -1
- package/es/components/roving-focus-group/index.mjs +3 -3
- package/es/components/roving-focus-group/src/roving-focus-group-impl.mjs +1 -1
- package/es/components/roving-focus-group/src/roving-focus-group.mjs +27 -29
- package/es/components/roving-focus-group/src/roving-focus-group.mjs.map +1 -1
- package/es/components/roving-focus-group/src/roving-focus-group2.mjs +29 -27
- package/es/components/roving-focus-group/src/roving-focus-group2.mjs.map +1 -1
- package/es/components/roving-focus-group/src/roving-focus-item.mjs +1 -1
- package/es/components/scrollbar/index.mjs +2 -2
- package/es/components/scrollbar/src/bar.mjs +22 -35
- package/es/components/scrollbar/src/bar.mjs.map +1 -1
- package/es/components/scrollbar/src/bar2.mjs +35 -22
- package/es/components/scrollbar/src/bar2.mjs.map +1 -1
- package/es/components/scrollbar/src/scrollbar.mjs +112 -42
- package/es/components/scrollbar/src/scrollbar.mjs.map +1 -1
- package/es/components/scrollbar/src/scrollbar2.mjs +42 -112
- package/es/components/scrollbar/src/scrollbar2.mjs.map +1 -1
- package/es/components/select/src/select.mjs +1 -1
- package/es/components/skeleton/index.mjs +2 -2
- package/es/components/skeleton/src/skeleton.mjs +49 -22
- package/es/components/skeleton/src/skeleton.mjs.map +1 -1
- package/es/components/skeleton/src/skeleton2.mjs +22 -49
- package/es/components/skeleton/src/skeleton2.mjs.map +1 -1
- package/es/components/switch/index.mjs +2 -2
- package/es/components/switch/src/switch.mjs +81 -176
- package/es/components/switch/src/switch.mjs.map +1 -1
- package/es/components/switch/src/switch2.mjs +176 -81
- package/es/components/switch/src/switch2.mjs.map +1 -1
- package/es/components/tabs/index.mjs +2 -2
- package/es/components/tabs/src/tab-pane.mjs +61 -15
- package/es/components/tabs/src/tab-pane.mjs.map +1 -1
- package/es/components/tabs/src/tab-pane2.mjs +15 -61
- package/es/components/tabs/src/tab-pane2.mjs.map +1 -1
- package/es/components/tag/index.mjs +2 -2
- package/es/components/tag/src/tag.mjs +33 -81
- package/es/components/tag/src/tag.mjs.map +1 -1
- package/es/components/tag/src/tag2.mjs +81 -33
- package/es/components/tag/src/tag2.mjs.map +1 -1
- package/es/components/tooltip/src/tooltip2.mjs +1 -1
- package/es/components/tooltip-v2/index.mjs +5 -5
- package/es/components/tooltip-v2/src/content.mjs +113 -50
- package/es/components/tooltip-v2/src/content.mjs.map +1 -1
- package/es/components/tooltip-v2/src/content2.mjs +50 -113
- package/es/components/tooltip-v2/src/content2.mjs.map +1 -1
- package/es/components/tooltip-v2/src/root.mjs +17 -81
- package/es/components/tooltip-v2/src/root.mjs.map +1 -1
- package/es/components/tooltip-v2/src/root2.mjs +81 -17
- package/es/components/tooltip-v2/src/root2.mjs.map +1 -1
- package/es/components/tooltip-v2/src/tooltip.mjs +21 -74
- package/es/components/tooltip-v2/src/tooltip.mjs.map +1 -1
- package/es/components/tooltip-v2/src/tooltip2.mjs +74 -21
- package/es/components/tooltip-v2/src/tooltip2.mjs.map +1 -1
- package/es/components/tooltip-v2/src/trigger.mjs +11 -89
- package/es/components/tooltip-v2/src/trigger.mjs.map +1 -1
- package/es/components/tooltip-v2/src/trigger2.mjs +89 -11
- package/es/components/tooltip-v2/src/trigger2.mjs.map +1 -1
- package/es/components/upload/index.mjs +1 -1
- package/es/components/upload/src/upload-list.mjs +155 -26
- package/es/components/upload/src/upload-list.mjs.map +1 -1
- package/es/components/upload/src/upload-list2.mjs +26 -155
- package/es/components/upload/src/upload-list2.mjs.map +1 -1
- package/es/components/upload/src/upload2.mjs +1 -1
- package/es/index.mjs +24 -24
- package/lib/components/alert/index.js +2 -2
- package/lib/components/alert/src/alert.js +33 -82
- package/lib/components/alert/src/alert.js.map +1 -1
- package/lib/components/alert/src/alert2.js +82 -33
- package/lib/components/alert/src/alert2.js.map +1 -1
- package/lib/components/backtop/index.js +2 -2
- package/lib/components/backtop/src/backtop.js +59 -18
- package/lib/components/backtop/src/backtop.js.map +1 -1
- package/lib/components/backtop/src/backtop2.js +18 -59
- package/lib/components/backtop/src/backtop2.js.map +1 -1
- package/lib/components/breadcrumb/index.js +2 -2
- package/lib/components/breadcrumb/src/breadcrumb-item.js +46 -11
- package/lib/components/breadcrumb/src/breadcrumb-item.js.map +1 -1
- package/lib/components/breadcrumb/src/breadcrumb-item2.js +11 -46
- package/lib/components/breadcrumb/src/breadcrumb-item2.js.map +1 -1
- package/lib/components/button/index.js +3 -3
- package/lib/components/button/src/button-group.js +30 -5
- package/lib/components/button/src/button-group.js.map +1 -1
- package/lib/components/button/src/button-group2.js +5 -30
- package/lib/components/button/src/button-group2.js.map +1 -1
- package/lib/components/button/src/button.js +96 -50
- package/lib/components/button/src/button.js.map +1 -1
- package/lib/components/button/src/button2.js +50 -96
- package/lib/components/button/src/button2.js.map +1 -1
- package/lib/components/calendar/index.js +2 -2
- package/lib/components/calendar/src/calendar.js +9 -192
- package/lib/components/calendar/src/calendar.js.map +1 -1
- package/lib/components/calendar/src/calendar2.js +192 -9
- package/lib/components/calendar/src/calendar2.js.map +1 -1
- package/lib/components/cascader/src/index.js +1 -1
- package/lib/components/empty/index.js +2 -2
- package/lib/components/empty/src/empty.js +11 -56
- package/lib/components/empty/src/empty.js.map +1 -1
- package/lib/components/empty/src/empty2.js +56 -11
- package/lib/components/empty/src/empty2.js.map +1 -1
- package/lib/components/form/src/form-item2.js +1 -7
- package/lib/components/form/src/form-item2.js.map +1 -1
- package/lib/components/image/index.js +2 -2
- package/lib/components/image/src/image.js +50 -127
- package/lib/components/image/src/image.js.map +1 -1
- package/lib/components/image/src/image2.js +127 -50
- package/lib/components/image/src/image2.js.map +1 -1
- package/lib/components/image-viewer/index.js +2 -2
- package/lib/components/image-viewer/src/image-viewer.js +210 -31
- package/lib/components/image-viewer/src/image-viewer.js.map +1 -1
- package/lib/components/image-viewer/src/image-viewer2.js +31 -210
- package/lib/components/image-viewer/src/image-viewer2.js.map +1 -1
- package/lib/components/index.js +24 -24
- package/lib/components/input/index.js +2 -2
- package/lib/components/input/src/input.js +294 -84
- package/lib/components/input/src/input.js.map +1 -1
- package/lib/components/input/src/input2.js +84 -294
- package/lib/components/input/src/input2.js.map +1 -1
- package/lib/components/link/index.js +2 -2
- package/lib/components/link/src/link.js +19 -43
- package/lib/components/link/src/link.js.map +1 -1
- package/lib/components/link/src/link2.js +43 -19
- package/lib/components/link/src/link2.js.map +1 -1
- package/lib/components/menu/index.d.ts +6 -16
- package/lib/components/menu/src/menu-item.js +6 -33
- package/lib/components/menu/src/menu-item.js.map +1 -1
- package/lib/components/menu/src/menu-item.vue.d.ts +10 -15
- package/lib/components/menu/src/menu.js +2 -1
- package/lib/components/menu/src/menu.js.map +1 -1
- package/lib/components/popconfirm/index.js +2 -2
- package/lib/components/popconfirm/src/popconfirm.js +20 -53
- package/lib/components/popconfirm/src/popconfirm.js.map +1 -1
- package/lib/components/popconfirm/src/popconfirm2.js +53 -20
- package/lib/components/popconfirm/src/popconfirm2.js.map +1 -1
- package/lib/components/popper/index.js +2 -2
- package/lib/components/popper/src/arrow.js +31 -7
- package/lib/components/popper/src/arrow.js.map +1 -1
- package/lib/components/popper/src/arrow2.js +7 -31
- package/lib/components/popper/src/arrow2.js.map +1 -1
- package/lib/components/radio/index.js +6 -6
- package/lib/components/radio/src/radio-button.js +9 -80
- package/lib/components/radio/src/radio-button.js.map +1 -1
- package/lib/components/radio/src/radio-button2.js +80 -9
- package/lib/components/radio/src/radio-button2.js.map +1 -1
- package/lib/components/radio/src/radio-group.js +37 -18
- package/lib/components/radio/src/radio-group.js.map +1 -1
- package/lib/components/radio/src/radio-group2.js +18 -37
- package/lib/components/radio/src/radio-group2.js.map +1 -1
- package/lib/components/radio/src/radio.js +73 -64
- package/lib/components/radio/src/radio.js.map +1 -1
- package/lib/components/radio/src/radio2.js +64 -73
- package/lib/components/radio/src/radio2.js.map +1 -1
- package/lib/components/rate/index.js +2 -2
- package/lib/components/rate/src/rate.js +84 -169
- package/lib/components/rate/src/rate.js.map +1 -1
- package/lib/components/rate/src/rate2.js +169 -84
- package/lib/components/rate/src/rate2.js.map +1 -1
- package/lib/components/result/index.js +2 -2
- package/lib/components/result/src/result.js +73 -30
- package/lib/components/result/src/result.js.map +1 -1
- package/lib/components/result/src/result2.js +30 -73
- package/lib/components/result/src/result2.js.map +1 -1
- package/lib/components/roving-focus-group/index.js +2 -2
- package/lib/components/roving-focus-group/src/roving-focus-group-impl.js +1 -1
- package/lib/components/roving-focus-group/src/roving-focus-group.js +27 -33
- package/lib/components/roving-focus-group/src/roving-focus-group.js.map +1 -1
- package/lib/components/roving-focus-group/src/roving-focus-group2.js +33 -27
- package/lib/components/roving-focus-group/src/roving-focus-group2.js.map +1 -1
- package/lib/components/roving-focus-group/src/roving-focus-item.js +1 -1
- package/lib/components/scrollbar/index.js +2 -2
- package/lib/components/scrollbar/src/bar.js +22 -35
- package/lib/components/scrollbar/src/bar.js.map +1 -1
- package/lib/components/scrollbar/src/bar2.js +35 -22
- package/lib/components/scrollbar/src/bar2.js.map +1 -1
- package/lib/components/scrollbar/src/scrollbar.js +112 -42
- package/lib/components/scrollbar/src/scrollbar.js.map +1 -1
- package/lib/components/scrollbar/src/scrollbar2.js +42 -112
- package/lib/components/scrollbar/src/scrollbar2.js.map +1 -1
- package/lib/components/select/src/select.js +1 -1
- package/lib/components/skeleton/index.js +2 -2
- package/lib/components/skeleton/src/skeleton.js +49 -22
- package/lib/components/skeleton/src/skeleton.js.map +1 -1
- package/lib/components/skeleton/src/skeleton2.js +22 -49
- package/lib/components/skeleton/src/skeleton2.js.map +1 -1
- package/lib/components/switch/index.js +2 -2
- package/lib/components/switch/src/switch.js +81 -176
- package/lib/components/switch/src/switch.js.map +1 -1
- package/lib/components/switch/src/switch2.js +176 -81
- package/lib/components/switch/src/switch2.js.map +1 -1
- package/lib/components/tabs/index.js +2 -2
- package/lib/components/tabs/src/tab-pane.js +61 -15
- package/lib/components/tabs/src/tab-pane.js.map +1 -1
- package/lib/components/tabs/src/tab-pane2.js +15 -61
- package/lib/components/tabs/src/tab-pane2.js.map +1 -1
- package/lib/components/tag/index.js +2 -2
- package/lib/components/tag/src/tag.js +34 -81
- package/lib/components/tag/src/tag.js.map +1 -1
- package/lib/components/tag/src/tag2.js +81 -34
- package/lib/components/tag/src/tag2.js.map +1 -1
- package/lib/components/tooltip/src/tooltip2.js +1 -1
- package/lib/components/tooltip-v2/index.js +5 -5
- package/lib/components/tooltip-v2/src/content.js +113 -50
- package/lib/components/tooltip-v2/src/content.js.map +1 -1
- package/lib/components/tooltip-v2/src/content2.js +50 -113
- package/lib/components/tooltip-v2/src/content2.js.map +1 -1
- package/lib/components/tooltip-v2/src/root.js +17 -81
- package/lib/components/tooltip-v2/src/root.js.map +1 -1
- package/lib/components/tooltip-v2/src/root2.js +81 -17
- package/lib/components/tooltip-v2/src/root2.js.map +1 -1
- package/lib/components/tooltip-v2/src/tooltip.js +21 -74
- package/lib/components/tooltip-v2/src/tooltip.js.map +1 -1
- package/lib/components/tooltip-v2/src/tooltip2.js +74 -21
- package/lib/components/tooltip-v2/src/tooltip2.js.map +1 -1
- package/lib/components/tooltip-v2/src/trigger.js +11 -89
- package/lib/components/tooltip-v2/src/trigger.js.map +1 -1
- package/lib/components/tooltip-v2/src/trigger2.js +89 -11
- package/lib/components/tooltip-v2/src/trigger2.js.map +1 -1
- package/lib/components/upload/index.js +1 -1
- package/lib/components/upload/src/upload-list.js +155 -27
- package/lib/components/upload/src/upload-list.js.map +1 -1
- package/lib/components/upload/src/upload-list2.js +27 -155
- package/lib/components/upload/src/upload-list2.js.map +1 -1
- package/lib/components/upload/src/upload2.js +1 -1
- package/lib/index.js +24 -24
- package/package.json +1 -1
- package/web-types.json +1 -1
|
@@ -1,33 +1,31 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import '
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
1
|
+
import { defineComponent, resolveComponent, openBlock, createBlock, withCtx, createVNode, normalizeProps, guardReactiveProps, renderSlot } from 'vue';
|
|
2
|
+
import PsRovingFocusGroupImpl from './roving-focus-group-impl.mjs';
|
|
3
|
+
import { PsCollection } from './roving-focus-group2.mjs';
|
|
4
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
5
5
|
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
loop: Boolean,
|
|
13
|
-
dir: {
|
|
14
|
-
type: String,
|
|
15
|
-
values: ["ltr", "rtl"],
|
|
16
|
-
default: "ltr"
|
|
17
|
-
},
|
|
18
|
-
orientation: {
|
|
19
|
-
type: definePropType(String)
|
|
20
|
-
},
|
|
21
|
-
onBlur: Function,
|
|
22
|
-
onFocus: Function,
|
|
23
|
-
onMousedown: Function
|
|
6
|
+
const _sfc_main = defineComponent({
|
|
7
|
+
name: "PsRovingFocusGroup",
|
|
8
|
+
components: {
|
|
9
|
+
PsFocusGroupCollection: PsCollection,
|
|
10
|
+
PsRovingFocusGroupImpl
|
|
11
|
+
}
|
|
24
12
|
});
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
13
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
14
|
+
const _component_ps_roving_focus_group_impl = resolveComponent("ps-roving-focus-group-impl");
|
|
15
|
+
const _component_ps_focus_group_collection = resolveComponent("ps-focus-group-collection");
|
|
16
|
+
return openBlock(), createBlock(_component_ps_focus_group_collection, null, {
|
|
17
|
+
default: withCtx(() => [
|
|
18
|
+
createVNode(_component_ps_roving_focus_group_impl, normalizeProps(guardReactiveProps(_ctx.$attrs)), {
|
|
19
|
+
default: withCtx(() => [
|
|
20
|
+
renderSlot(_ctx.$slots, "default")
|
|
21
|
+
]),
|
|
22
|
+
_: 3
|
|
23
|
+
}, 16)
|
|
24
|
+
]),
|
|
25
|
+
_: 3
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
var PsRovingFocusGroup = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/Users/meng/workspace/element-ps/packages/components/roving-focus-group/src/roving-focus-group.vue"]]);
|
|
31
29
|
|
|
32
|
-
export {
|
|
30
|
+
export { PsRovingFocusGroup as default };
|
|
33
31
|
//# sourceMappingURL=roving-focus-group.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"roving-focus-group.mjs","sources":["../../../../../../packages/components/roving-focus-group/src/roving-focus-group.
|
|
1
|
+
{"version":3,"file":"roving-focus-group.mjs","sources":["../../../../../../packages/components/roving-focus-group/src/roving-focus-group.vue"],"sourcesContent":["<template>\n <ps-focus-group-collection>\n <ps-roving-focus-group-impl v-bind=\"$attrs\">\n <slot />\n </ps-roving-focus-group-impl>\n </ps-focus-group-collection>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent } from 'vue'\nimport PsRovingFocusGroupImpl from './roving-focus-group-impl.vue'\nimport { PsCollection as PsFocusGroupCollection } from './roving-focus-group'\n\nexport default defineComponent({\n name: 'PsRovingFocusGroup',\n components: {\n PsFocusGroupCollection,\n PsRovingFocusGroupImpl,\n },\n})\n</script>\n"],"names":["PsFocusGroupCollection","_createBlock","_withCtx","_createVNode","_renderSlot"],"mappings":";;;;;AAaA,MAAK,YAAa,eAAa,CAAA;AAAA,EAC7B,IAAM,EAAA,oBAAA;AAAA,EACN,UAAY,EAAA;AAAA,4BACVA,YAAA;AAAA,IACA,sBAAA;AAAA,GACF;AACF,CAAC,CAAA,CAAA;;;;sBAlBCC,WAI4B,CAAA,oCAAA,EAAA,IAAA,EAAA;AAAA,IAAA,OAAA,EAAAC,OAAA,CAH1B,MAE6B;AAAA,MAF7BC,WAAA,CAE6B,yEAFO,IAAM,CAAA,MAAA,CAAA,CAAA,EAAA;AAAA,QAAA,OAAA,EAAAD,OAAA,CACxC,MAAQ;AAAA,UAARE,UAAQ,CAAA,IAAA,CAAA,MAAA,EAAA,SAAA,CAAA;AAAA,SAAA,CAAA;;;;;;;;;;;"}
|
|
@@ -1,31 +1,33 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
1
|
+
import '../../../utils/index.mjs';
|
|
2
|
+
import '../../collection/index.mjs';
|
|
3
|
+
import { buildProps, definePropType } from '../../../utils/vue/props.mjs';
|
|
4
|
+
import { createCollectionWithScope } from '../../collection/src/collection.mjs';
|
|
5
5
|
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
const rovingFocusGroupProps = buildProps({
|
|
7
|
+
style: { type: definePropType([String, Array, Object]) },
|
|
8
|
+
currentTabId: {
|
|
9
|
+
type: definePropType(String)
|
|
10
|
+
},
|
|
11
|
+
defaultCurrentTabId: String,
|
|
12
|
+
loop: Boolean,
|
|
13
|
+
dir: {
|
|
14
|
+
type: String,
|
|
15
|
+
values: ["ltr", "rtl"],
|
|
16
|
+
default: "ltr"
|
|
17
|
+
},
|
|
18
|
+
orientation: {
|
|
19
|
+
type: definePropType(String)
|
|
20
|
+
},
|
|
21
|
+
onBlur: Function,
|
|
22
|
+
onFocus: Function,
|
|
23
|
+
onMousedown: Function
|
|
12
24
|
});
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
default: withCtx(() => [
|
|
20
|
-
renderSlot(_ctx.$slots, "default")
|
|
21
|
-
]),
|
|
22
|
-
_: 3
|
|
23
|
-
}, 16)
|
|
24
|
-
]),
|
|
25
|
-
_: 3
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
var PsRovingFocusGroup = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/Users/meng/workspace/element-ps/packages/components/roving-focus-group/src/roving-focus-group.vue"]]);
|
|
25
|
+
const {
|
|
26
|
+
PsCollection,
|
|
27
|
+
PsCollectionItem,
|
|
28
|
+
COLLECTION_INJECTION_KEY,
|
|
29
|
+
COLLECTION_ITEM_INJECTION_KEY
|
|
30
|
+
} = createCollectionWithScope("RovingFocusGroup");
|
|
29
31
|
|
|
30
|
-
export {
|
|
32
|
+
export { PsCollection, PsCollectionItem, COLLECTION_INJECTION_KEY as ROVING_FOCUS_COLLECTION_INJECTION_KEY, COLLECTION_ITEM_INJECTION_KEY as ROVING_FOCUS_ITEM_COLLECTION_INJECTION_KEY, rovingFocusGroupProps };
|
|
31
33
|
//# sourceMappingURL=roving-focus-group2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"roving-focus-group2.mjs","sources":["../../../../../../packages/components/roving-focus-group/src/roving-focus-group.
|
|
1
|
+
{"version":3,"file":"roving-focus-group2.mjs","sources":["../../../../../../packages/components/roving-focus-group/src/roving-focus-group.ts"],"sourcesContent":["import { buildProps, definePropType } from '@element-ps/utils'\nimport { createCollectionWithScope } from '@element-ps/components/collection'\nimport type { ExtractPropTypes, HTMLAttributes, StyleValue } from 'vue'\n\nexport const rovingFocusGroupProps = buildProps({\n style: { type: definePropType<StyleValue>([String, Array, Object]) },\n currentTabId: {\n type: definePropType<string | null>(String),\n },\n defaultCurrentTabId: String,\n loop: Boolean,\n dir: {\n type: String, // left for direction support\n values: ['ltr', 'rtl'],\n default: 'ltr',\n },\n orientation: {\n // left for orientation support\n type: definePropType<HTMLAttributes['aria-orientation']>(String),\n },\n\n onBlur: Function,\n onFocus: Function,\n onMousedown: Function,\n})\n\nexport type PsRovingFocusGroupProps = ExtractPropTypes<\n typeof rovingFocusGroupProps\n>\n\nconst {\n PsCollection,\n PsCollectionItem,\n COLLECTION_INJECTION_KEY,\n COLLECTION_ITEM_INJECTION_KEY,\n} = createCollectionWithScope('RovingFocusGroup')\n\nexport {\n PsCollection,\n PsCollectionItem,\n COLLECTION_INJECTION_KEY as ROVING_FOCUS_COLLECTION_INJECTION_KEY,\n COLLECTION_ITEM_INJECTION_KEY as ROVING_FOCUS_ITEM_COLLECTION_INJECTION_KEY,\n}\n"],"names":[],"mappings":";;;;;AAEY,MAAC,qBAAqB,GAAG,UAAU,CAAC;AAChD,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,EAAE;AAC1D,EAAE,YAAY,EAAE;AAChB,IAAI,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC;AAChC,GAAG;AACH,EAAE,mBAAmB,EAAE,MAAM;AAC7B,EAAE,IAAI,EAAE,OAAO;AACf,EAAE,GAAG,EAAE;AACP,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC;AAC1B,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC;AAChC,GAAG;AACH,EAAE,MAAM,EAAE,QAAQ;AAClB,EAAE,OAAO,EAAE,QAAQ;AACnB,EAAE,WAAW,EAAE,QAAQ;AACvB,CAAC,EAAE;AACE,MAAC;AACN,EAAE,YAAY;AACd,EAAE,gBAAgB;AAClB,EAAE,wBAAwB;AAC1B,EAAE,6BAA6B;AAC/B,CAAC,GAAG,yBAAyB,CAAC,kBAAkB;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent, resolveComponent, openBlock, createBlock, withCtx, renderSlot } from 'vue';
|
|
2
2
|
import '../../../hooks/index.mjs';
|
|
3
|
-
import { PsCollectionItem } from './roving-focus-
|
|
3
|
+
import { PsCollectionItem } from './roving-focus-group2.mjs';
|
|
4
4
|
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
5
5
|
import { useId } from '../../../hooks/use-id/index.mjs';
|
|
6
6
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import '../../utils/index.mjs';
|
|
2
|
-
import Scrollbar from './src/
|
|
2
|
+
import Scrollbar from './src/scrollbar.mjs';
|
|
3
3
|
export { BAR_MAP, renderThumbStyle } from './src/util.mjs';
|
|
4
|
-
export { scrollbarProps } from './src/
|
|
4
|
+
export { scrollbarProps } from './src/scrollbar2.mjs';
|
|
5
5
|
export { thumbProps } from './src/thumb.mjs';
|
|
6
6
|
import { withInstall } from '../../utils/vue/install.mjs';
|
|
7
7
|
|
|
@@ -1,41 +1,28 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { barProps } from './bar2.mjs';
|
|
4
|
-
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
1
|
+
import '../../../utils/index.mjs';
|
|
2
|
+
import { buildProps } from '../../../utils/vue/props.mjs';
|
|
5
3
|
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
const barProps = buildProps({
|
|
5
|
+
always: {
|
|
6
|
+
type: Boolean,
|
|
7
|
+
default: true
|
|
9
8
|
},
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
9
|
+
width: {
|
|
10
|
+
type: String,
|
|
11
|
+
default: ""
|
|
12
|
+
},
|
|
13
|
+
height: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: ""
|
|
16
|
+
},
|
|
17
|
+
ratioX: {
|
|
18
|
+
type: Number,
|
|
19
|
+
default: 1
|
|
20
|
+
},
|
|
21
|
+
ratioY: {
|
|
22
|
+
type: Number,
|
|
23
|
+
default: 1
|
|
18
24
|
}
|
|
19
25
|
});
|
|
20
|
-
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
21
|
-
const _component_thumb = resolveComponent("thumb");
|
|
22
|
-
return openBlock(), createElementBlock(Fragment, null, [
|
|
23
|
-
createVNode(_component_thumb, {
|
|
24
|
-
move: _ctx.moveX,
|
|
25
|
-
ratio: _ctx.ratioX,
|
|
26
|
-
size: _ctx.width,
|
|
27
|
-
always: _ctx.always
|
|
28
|
-
}, null, 8, ["move", "ratio", "size", "always"]),
|
|
29
|
-
createVNode(_component_thumb, {
|
|
30
|
-
move: _ctx.moveY,
|
|
31
|
-
ratio: _ctx.ratioY,
|
|
32
|
-
size: _ctx.height,
|
|
33
|
-
vertical: "",
|
|
34
|
-
always: _ctx.always
|
|
35
|
-
}, null, 8, ["move", "ratio", "size", "always"])
|
|
36
|
-
], 64);
|
|
37
|
-
}
|
|
38
|
-
var Bar = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/Users/meng/workspace/element-ps/packages/components/scrollbar/src/bar.vue"]]);
|
|
39
26
|
|
|
40
|
-
export {
|
|
27
|
+
export { barProps };
|
|
41
28
|
//# sourceMappingURL=bar.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bar.mjs","sources":["../../../../../../packages/components/scrollbar/src/bar.
|
|
1
|
+
{"version":3,"file":"bar.mjs","sources":["../../../../../../packages/components/scrollbar/src/bar.ts"],"sourcesContent":["import { buildProps } from '@element-ps/utils'\nimport type { ExtractPropTypes } from 'vue'\n\nexport const barProps = buildProps({\n always: {\n type: Boolean,\n default: true,\n },\n width: {\n type: String,\n default: '',\n },\n height: {\n type: String,\n default: '',\n },\n ratioX: {\n type: Number,\n default: 1,\n },\n ratioY: {\n type: Number,\n default: 1,\n },\n} as const)\nexport type BarProps = ExtractPropTypes<typeof barProps>\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,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,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,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,CAAC;;;;"}
|
|
@@ -1,28 +1,41 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent, ref, resolveComponent, openBlock, createElementBlock, Fragment, createVNode } from 'vue';
|
|
2
|
+
import Thumb from './thumb2.mjs';
|
|
3
|
+
import { barProps } from './bar.mjs';
|
|
4
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
3
5
|
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
default: true
|
|
6
|
+
const _sfc_main = defineComponent({
|
|
7
|
+
components: {
|
|
8
|
+
Thumb
|
|
8
9
|
},
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
ratioX: {
|
|
18
|
-
type: Number,
|
|
19
|
-
default: 1
|
|
20
|
-
},
|
|
21
|
-
ratioY: {
|
|
22
|
-
type: Number,
|
|
23
|
-
default: 1
|
|
10
|
+
props: barProps,
|
|
11
|
+
setup() {
|
|
12
|
+
const moveX = ref(0);
|
|
13
|
+
const moveY = ref(0);
|
|
14
|
+
return {
|
|
15
|
+
moveX,
|
|
16
|
+
moveY
|
|
17
|
+
};
|
|
24
18
|
}
|
|
25
19
|
});
|
|
20
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
21
|
+
const _component_thumb = resolveComponent("thumb");
|
|
22
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
23
|
+
createVNode(_component_thumb, {
|
|
24
|
+
move: _ctx.moveX,
|
|
25
|
+
ratio: _ctx.ratioX,
|
|
26
|
+
size: _ctx.width,
|
|
27
|
+
always: _ctx.always
|
|
28
|
+
}, null, 8, ["move", "ratio", "size", "always"]),
|
|
29
|
+
createVNode(_component_thumb, {
|
|
30
|
+
move: _ctx.moveY,
|
|
31
|
+
ratio: _ctx.ratioY,
|
|
32
|
+
size: _ctx.height,
|
|
33
|
+
vertical: "",
|
|
34
|
+
always: _ctx.always
|
|
35
|
+
}, null, 8, ["move", "ratio", "size", "always"])
|
|
36
|
+
], 64);
|
|
37
|
+
}
|
|
38
|
+
var Bar = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/Users/meng/workspace/element-ps/packages/components/scrollbar/src/bar.vue"]]);
|
|
26
39
|
|
|
27
|
-
export {
|
|
40
|
+
export { Bar as default };
|
|
28
41
|
//# sourceMappingURL=bar2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bar2.mjs","sources":["../../../../../../packages/components/scrollbar/src/bar.
|
|
1
|
+
{"version":3,"file":"bar2.mjs","sources":["../../../../../../packages/components/scrollbar/src/bar.vue"],"sourcesContent":["<template>\n <thumb :move=\"moveX\" :ratio=\"ratioX\" :size=\"width\" :always=\"always\" />\n <thumb\n :move=\"moveY\"\n :ratio=\"ratioY\"\n :size=\"height\"\n vertical\n :always=\"always\"\n />\n</template>\n<script lang=\"ts\">\nimport { defineComponent, ref } from 'vue'\nimport Thumb from './thumb.vue'\nimport { barProps } from './bar'\n\nexport default defineComponent({\n components: {\n Thumb,\n },\n props: barProps,\n setup() {\n const moveX = ref(0)\n const moveY = ref(0)\n\n return {\n moveX,\n moveY,\n }\n },\n})\n</script>\n"],"names":["_createVNode"],"mappings":";;;;;AAeA,MAAK,YAAa,eAAa,CAAA;AAAA,EAC7B,UAAY,EAAA;AAAA,IACV,KAAA;AAAA,GACF;AAAA,EACA,KAAO,EAAA,QAAA;AAAA,EACP,KAAQ,GAAA;AACN,IAAM,MAAA,KAAA,GAAQ,IAAI,CAAC,CAAA,CAAA;AACnB,IAAM,MAAA,KAAA,GAAQ,IAAI,CAAC,CAAA,CAAA;AAEnB,IAAO,OAAA;AAAA,MACL,KAAA;AAAA,MACA,KAAA;AAAA,KACF,CAAA;AAAA,GACF;AACF,CAAC,CAAA,CAAA;;;;IA5BCA,WAAsE,CAAA,gBAAA,EAAA;AAAA,MAA9D,IAAM,EAAA,IAAA,CAAA,KAAA;AAAA,MAAQ,KAAO,EAAA,IAAA,CAAA,MAAA;AAAA,MAAS,IAAM,EAAA,IAAA,CAAA,KAAA;AAAA,MAAQ,MAAQ,EAAA,IAAA,CAAA,MAAA;AAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,MAAA,EAAA,OAAA,EAAA,MAAA,EAAA,QAAA,CAAA,CAAA;IAC5DA,WAME,CAAA,gBAAA,EAAA;AAAA,MALC,IAAM,EAAA,IAAA,CAAA,KAAA;AAAA,MACN,KAAO,EAAA,IAAA,CAAA,MAAA;AAAA,MACP,IAAM,EAAA,IAAA,CAAA,MAAA;AAAA,MACP,QAAA,EAAA,EAAA;AAAA,MACC,MAAQ,EAAA,IAAA,CAAA,MAAA;AAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,MAAA,EAAA,OAAA,EAAA,MAAA,EAAA,QAAA,CAAA,CAAA;;;;;;;"}
|
|
@@ -1,49 +1,119 @@
|
|
|
1
|
+
import { defineComponent, ref, computed, provide, reactive, onMounted, nextTick, onUpdated, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, createBlock, resolveDynamicComponent, withCtx, renderSlot, createCommentVNode } from 'vue';
|
|
1
2
|
import '../../../utils/index.mjs';
|
|
2
|
-
import
|
|
3
|
+
import '../../../tokens/index.mjs';
|
|
4
|
+
import '../../../hooks/index.mjs';
|
|
5
|
+
import Bar from './bar2.mjs';
|
|
6
|
+
import { scrollbarProps } from './scrollbar2.mjs';
|
|
7
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
8
|
+
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
9
|
+
import { addUnit } from '../../../utils/dom/style.mjs';
|
|
10
|
+
import { scrollbarContextKey } from '../../../tokens/scrollbar.mjs';
|
|
3
11
|
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
12
|
+
const _sfc_main = defineComponent({
|
|
13
|
+
name: "PsScrollbar",
|
|
14
|
+
components: {
|
|
15
|
+
Bar
|
|
8
16
|
},
|
|
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
|
-
|
|
17
|
+
props: scrollbarProps,
|
|
18
|
+
setup(props) {
|
|
19
|
+
const ns = useNamespace("scrollbar");
|
|
20
|
+
const scrollbar$ = ref();
|
|
21
|
+
const wrap$ = ref();
|
|
22
|
+
const resize$ = ref();
|
|
23
|
+
const sizeWidth = ref("0");
|
|
24
|
+
const sizeHeight = ref("0");
|
|
25
|
+
const barRef = ref();
|
|
26
|
+
const moveX = ref(0);
|
|
27
|
+
const moveY = ref(0);
|
|
28
|
+
const ratioY = ref(1);
|
|
29
|
+
const ratioX = ref(1);
|
|
30
|
+
const GAP = 4;
|
|
31
|
+
const style = computed(() => {
|
|
32
|
+
const style2 = {};
|
|
33
|
+
if (props.height)
|
|
34
|
+
style2.height = addUnit(props.height);
|
|
35
|
+
if (props.maxHeight)
|
|
36
|
+
style2.maxHeight = addUnit(props.maxHeight);
|
|
37
|
+
return [props.wrapStyle, style2];
|
|
38
|
+
});
|
|
39
|
+
const update = () => {
|
|
40
|
+
if (!wrap$.value)
|
|
41
|
+
return;
|
|
42
|
+
const offsetHeight = wrap$.value.offsetHeight - GAP;
|
|
43
|
+
const offsetWidth = wrap$.value.offsetWidth - GAP;
|
|
44
|
+
const originalHeight = offsetHeight ** 2 / wrap$.value.scrollHeight;
|
|
45
|
+
const originalWidth = offsetWidth ** 2 / wrap$.value.scrollWidth;
|
|
46
|
+
const height = Math.max(originalHeight, props.minSize);
|
|
47
|
+
const width = Math.max(originalWidth, props.minSize);
|
|
48
|
+
ratioY.value = originalHeight / (offsetHeight - originalHeight) / (height / (offsetHeight - height));
|
|
49
|
+
ratioX.value = originalWidth / (offsetWidth - originalWidth) / (width / (offsetWidth - width));
|
|
50
|
+
sizeHeight.value = height + GAP < offsetHeight ? `${height}px` : "";
|
|
51
|
+
sizeWidth.value = width + GAP < offsetWidth ? `${width}px` : "";
|
|
52
|
+
};
|
|
53
|
+
provide(scrollbarContextKey, reactive({
|
|
54
|
+
scrollbarElement: scrollbar$,
|
|
55
|
+
wrapElement: wrap$
|
|
56
|
+
}));
|
|
57
|
+
onMounted(() => {
|
|
58
|
+
if (!props.native)
|
|
59
|
+
nextTick(() => update());
|
|
60
|
+
});
|
|
61
|
+
onUpdated(() => update());
|
|
62
|
+
return {
|
|
63
|
+
ns,
|
|
64
|
+
scrollbar$,
|
|
65
|
+
wrap$,
|
|
66
|
+
resize$,
|
|
67
|
+
barRef,
|
|
68
|
+
moveX,
|
|
69
|
+
moveY,
|
|
70
|
+
ratioX,
|
|
71
|
+
ratioY,
|
|
72
|
+
sizeWidth,
|
|
73
|
+
sizeHeight,
|
|
74
|
+
style,
|
|
75
|
+
update
|
|
76
|
+
};
|
|
45
77
|
}
|
|
46
78
|
});
|
|
79
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
80
|
+
const _component_bar = resolveComponent("bar");
|
|
81
|
+
return openBlock(), createElementBlock("div", {
|
|
82
|
+
ref: "scrollbar$",
|
|
83
|
+
class: normalizeClass(_ctx.ns.b())
|
|
84
|
+
}, [
|
|
85
|
+
createElementVNode("div", {
|
|
86
|
+
ref: "wrap$",
|
|
87
|
+
class: normalizeClass([
|
|
88
|
+
_ctx.wrapClass,
|
|
89
|
+
_ctx.ns.e("wrap"),
|
|
90
|
+
{ [_ctx.ns.em("wrap", "hidden-default")]: !_ctx.native }
|
|
91
|
+
]),
|
|
92
|
+
style: normalizeStyle(_ctx.style)
|
|
93
|
+
}, [
|
|
94
|
+
(openBlock(), createBlock(resolveDynamicComponent(_ctx.tag), {
|
|
95
|
+
ref: "resize$",
|
|
96
|
+
class: normalizeClass([_ctx.ns.e("view"), _ctx.viewClass]),
|
|
97
|
+
style: normalizeStyle(_ctx.viewStyle)
|
|
98
|
+
}, {
|
|
99
|
+
default: withCtx(() => [
|
|
100
|
+
renderSlot(_ctx.$slots, "default")
|
|
101
|
+
]),
|
|
102
|
+
_: 3
|
|
103
|
+
}, 8, ["class", "style"]))
|
|
104
|
+
], 6),
|
|
105
|
+
!_ctx.native ? (openBlock(), createBlock(_component_bar, {
|
|
106
|
+
key: 0,
|
|
107
|
+
ref: "barRef",
|
|
108
|
+
height: _ctx.sizeHeight,
|
|
109
|
+
width: _ctx.sizeWidth,
|
|
110
|
+
always: _ctx.always,
|
|
111
|
+
"ratio-x": _ctx.ratioX,
|
|
112
|
+
"ratio-y": _ctx.ratioY
|
|
113
|
+
}, null, 8, ["height", "width", "always", "ratio-x", "ratio-y"])) : createCommentVNode("v-if", true)
|
|
114
|
+
], 2);
|
|
115
|
+
}
|
|
116
|
+
var Scrollbar = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/Users/meng/workspace/element-ps/packages/components/scrollbar/src/scrollbar.vue"]]);
|
|
47
117
|
|
|
48
|
-
export {
|
|
118
|
+
export { Scrollbar as default };
|
|
49
119
|
//# 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=\"scrollbar$\" :class=\"ns.b()\">\n <div\n ref=\"wrap$\"\n :class=\"[\n wrapClass,\n ns.e('wrap'),\n { [ns.em('wrap', 'hidden-default')]: !native },\n ]\"\n :style=\"style\"\n >\n <component\n :is=\"tag\"\n ref=\"resize$\"\n :class=\"[ns.e('view'), viewClass]\"\n :style=\"viewStyle\"\n >\n <slot />\n </component>\n </div>\n <template v-if=\"!native\">\n <bar\n ref=\"barRef\"\n :height=\"sizeHeight\"\n :width=\"sizeWidth\"\n :always=\"always\"\n :ratio-x=\"ratioX\"\n :ratio-y=\"ratioY\"\n />\n </template>\n </div>\n</template>\n<script lang=\"ts\">\nimport {\n computed,\n defineComponent,\n nextTick,\n onMounted,\n onUpdated,\n provide,\n reactive,\n ref,\n} from 'vue'\nimport { addUnit } from '@element-ps/utils'\nimport { scrollbarContextKey } from '@element-ps/tokens'\nimport { useNamespace } from '@element-ps/hooks'\nimport Bar from './bar.vue'\n\nimport { scrollbarProps } from './scrollbar'\nimport type { CSSProperties, StyleValue } from 'vue'\n\nexport default defineComponent({\n name: 'PsScrollbar',\n components: {\n Bar,\n },\n props: scrollbarProps,\n\n setup(props) {\n const ns = useNamespace('scrollbar')\n\n const scrollbar$ = ref<HTMLDivElement>()\n const wrap$ = ref<HTMLDivElement>()\n const resize$ = ref<HTMLElement>()\n\n const sizeWidth = ref('0')\n const sizeHeight = ref('0')\n const barRef = ref()\n const moveX = ref(0)\n const moveY = ref(0)\n const ratioY = ref(1)\n const ratioX = ref(1)\n const GAP = 4 // top 2 + bottom 2 of bar instance\n\n const style = 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\n const update = () => {\n if (!wrap$.value) return\n const offsetHeight = wrap$.value.offsetHeight - GAP\n const offsetWidth = wrap$.value.offsetWidth - GAP\n\n const originalHeight = offsetHeight ** 2 / wrap$.value.scrollHeight\n const originalWidth = offsetWidth ** 2 / wrap$.value.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\n provide(\n scrollbarContextKey,\n reactive({\n scrollbarElement: scrollbar$,\n wrapElement: wrap$,\n })\n )\n\n onMounted(() => {\n if (!props.native) nextTick(() => update())\n })\n onUpdated(() => update())\n\n return {\n ns,\n scrollbar$,\n wrap$,\n resize$,\n barRef,\n moveX,\n moveY,\n ratioX,\n ratioY,\n sizeWidth,\n sizeHeight,\n style,\n update,\n }\n },\n})\n</script>\n"],"names":["_createElementBlock","_normalizeClass","_createElementVNode","_normalizeStyle","_openBlock","_createBlock","_resolveDynamicComponent","_renderSlot","_createCommentVNode"],"mappings":";;;;;;;;;;;AAmDA,MAAK,YAAa,eAAa,CAAA;AAAA,EAC7B,IAAM,EAAA,aAAA;AAAA,EACN,UAAY,EAAA;AAAA,IACV,GAAA;AAAA,GACF;AAAA,EACA,KAAO,EAAA,cAAA;AAAA,EAEP,MAAM,KAAO,EAAA;AACX,IAAM,MAAA,EAAA,GAAK,aAAa,WAAW,CAAA,CAAA;AAEnC,IAAA,MAAM,aAAa,GAAoB,EAAA,CAAA;AACvC,IAAA,MAAM,QAAQ,GAAoB,EAAA,CAAA;AAClC,IAAA,MAAM,UAAU,GAAiB,EAAA,CAAA;AAEjC,IAAM,MAAA,SAAA,GAAY,IAAI,GAAG,CAAA,CAAA;AACzB,IAAM,MAAA,UAAA,GAAa,IAAI,GAAG,CAAA,CAAA;AAC1B,IAAA,MAAM,SAAS,GAAI,EAAA,CAAA;AACnB,IAAM,MAAA,KAAA,GAAQ,IAAI,CAAC,CAAA,CAAA;AACnB,IAAM,MAAA,KAAA,GAAQ,IAAI,CAAC,CAAA,CAAA;AACnB,IAAM,MAAA,MAAA,GAAS,IAAI,CAAC,CAAA,CAAA;AACpB,IAAM,MAAA,MAAA,GAAS,IAAI,CAAC,CAAA,CAAA;AACpB,IAAA,MAAM,GAAM,GAAA,CAAA,CAAA;AAEZ,IAAM,MAAA,KAAA,GAAQ,SAAqB,MAAM;AACvC,MAAA,MAAM,SAAuB,EAAC,CAAA;AAC9B,MAAA,IAAI,KAAM,CAAA,MAAA;AAAQ,QAAM,MAAA,CAAA,MA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