@class-kit/vue 0.1.2 → 0.1.3
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/CHANGELOG.md +20 -3
- package/dist/components/affix.cjs +71 -26
- package/dist/components/affix.cjs.map +1 -1
- package/dist/components/affix.js +72 -27
- package/dist/components/affix.js.map +1 -1
- package/dist/components/backtop.cjs +72 -26
- package/dist/components/backtop.cjs.map +1 -1
- package/dist/components/backtop.js +73 -27
- package/dist/components/backtop.js.map +1 -1
- package/dist/components/badge.cjs +51 -9
- package/dist/components/badge.cjs.map +1 -1
- package/dist/components/badge.js +52 -10
- package/dist/components/badge.js.map +1 -1
- package/dist/components/barcode.cjs +60 -16
- package/dist/components/barcode.cjs.map +1 -1
- package/dist/components/barcode.js +61 -17
- package/dist/components/barcode.js.map +1 -1
- package/dist/components/breadcrumb.cjs +49 -8
- package/dist/components/breadcrumb.cjs.map +1 -1
- package/dist/components/breadcrumb.js +50 -9
- package/dist/components/breadcrumb.js.map +1 -1
- package/dist/components/button.cjs +69 -25
- package/dist/components/button.cjs.map +1 -1
- package/dist/components/button.js +70 -26
- package/dist/components/button.js.map +1 -1
- package/dist/components/calendar.cjs +53 -10
- package/dist/components/calendar.cjs.map +1 -1
- package/dist/components/calendar.js +54 -11
- package/dist/components/calendar.js.map +1 -1
- package/dist/components/canvas-editor.cjs +198 -142
- package/dist/components/canvas-editor.cjs.map +1 -1
- package/dist/components/canvas-editor.js +199 -143
- package/dist/components/canvas-editor.js.map +1 -1
- package/dist/components/canvas-image.cjs +50 -9
- package/dist/components/canvas-image.cjs.map +1 -1
- package/dist/components/canvas-image.js +51 -10
- package/dist/components/canvas-image.js.map +1 -1
- package/dist/components/chat-textarea.cjs +61 -16
- package/dist/components/chat-textarea.cjs.map +1 -1
- package/dist/components/chat-textarea.js +62 -17
- package/dist/components/chat-textarea.js.map +1 -1
- package/dist/components/chat-virtual-list.cjs +98 -50
- package/dist/components/chat-virtual-list.cjs.map +1 -1
- package/dist/components/chat-virtual-list.js +99 -51
- package/dist/components/chat-virtual-list.js.map +1 -1
- package/dist/components/checkbox.cjs +63 -19
- package/dist/components/checkbox.cjs.map +1 -1
- package/dist/components/checkbox.js +64 -20
- package/dist/components/checkbox.js.map +1 -1
- package/dist/components/checked.cjs +63 -19
- package/dist/components/checked.cjs.map +1 -1
- package/dist/components/checked.js +64 -20
- package/dist/components/checked.js.map +1 -1
- package/dist/components/code-preview.cjs +88 -36
- package/dist/components/code-preview.cjs.map +1 -1
- package/dist/components/code-preview.js +89 -37
- package/dist/components/code-preview.js.map +1 -1
- package/dist/components/color-picker.cjs +68 -21
- package/dist/components/color-picker.cjs.map +1 -1
- package/dist/components/color-picker.js +69 -22
- package/dist/components/color-picker.js.map +1 -1
- package/dist/components/comic-reader.cjs +72 -27
- package/dist/components/comic-reader.cjs.map +1 -1
- package/dist/components/comic-reader.js +73 -28
- package/dist/components/comic-reader.js.map +1 -1
- package/dist/components/config-provider.cjs +49 -8
- package/dist/components/config-provider.cjs.map +1 -1
- package/dist/components/config-provider.js +50 -9
- package/dist/components/config-provider.js.map +1 -1
- package/dist/components/config-table.cjs +105 -53
- package/dist/components/config-table.cjs.map +1 -1
- package/dist/components/config-table.js +106 -54
- package/dist/components/config-table.js.map +1 -1
- package/dist/components/countdown.cjs +53 -9
- package/dist/components/countdown.cjs.map +1 -1
- package/dist/components/countdown.js +54 -10
- package/dist/components/countdown.js.map +1 -1
- package/dist/components/danmaku.cjs +73 -29
- package/dist/components/danmaku.cjs.map +1 -1
- package/dist/components/danmaku.js +74 -30
- package/dist/components/danmaku.js.map +1 -1
- package/dist/components/date-picker.cjs +64 -19
- package/dist/components/date-picker.cjs.map +1 -1
- package/dist/components/date-picker.js +65 -20
- package/dist/components/date-picker.js.map +1 -1
- package/dist/components/date-range-picker.cjs +64 -19
- package/dist/components/date-range-picker.cjs.map +1 -1
- package/dist/components/date-range-picker.js +65 -20
- package/dist/components/date-range-picker.js.map +1 -1
- package/dist/components/design-effect.cjs +51 -9
- package/dist/components/design-effect.cjs.map +1 -1
- package/dist/components/design-effect.js +52 -10
- package/dist/components/design-effect.js.map +1 -1
- package/dist/components/drag-drop-board.cjs +189 -134
- package/dist/components/drag-drop-board.cjs.map +1 -1
- package/dist/components/drag-drop-board.js +190 -135
- package/dist/components/drag-drop-board.js.map +1 -1
- package/dist/components/draggable.cjs +91 -44
- package/dist/components/draggable.cjs.map +1 -1
- package/dist/components/draggable.js +92 -45
- package/dist/components/draggable.js.map +1 -1
- package/dist/components/ellipsis-text.cjs +57 -14
- package/dist/components/ellipsis-text.cjs.map +1 -1
- package/dist/components/ellipsis-text.js +58 -15
- package/dist/components/ellipsis-text.js.map +1 -1
- package/dist/components/empty.cjs +58 -14
- package/dist/components/empty.cjs.map +1 -1
- package/dist/components/empty.js +59 -15
- package/dist/components/empty.js.map +1 -1
- package/dist/components/field.cjs +63 -19
- package/dist/components/field.cjs.map +1 -1
- package/dist/components/field.js +64 -20
- package/dist/components/field.js.map +1 -1
- package/dist/components/file-preview.cjs +99 -36
- package/dist/components/file-preview.cjs.map +1 -1
- package/dist/components/file-preview.js +100 -37
- package/dist/components/file-preview.js.map +1 -1
- package/dist/components/floating-ball.cjs +100 -51
- package/dist/components/floating-ball.cjs.map +1 -1
- package/dist/components/floating-ball.js +101 -52
- package/dist/components/floating-ball.js.map +1 -1
- package/dist/components/form.cjs +73 -28
- package/dist/components/form.cjs.map +1 -1
- package/dist/components/form.js +74 -29
- package/dist/components/form.js.map +1 -1
- package/dist/components/gradient-text.cjs +51 -9
- package/dist/components/gradient-text.cjs.map +1 -1
- package/dist/components/gradient-text.js +52 -10
- package/dist/components/gradient-text.js.map +1 -1
- package/dist/components/height-transition.cjs +71 -26
- package/dist/components/height-transition.cjs.map +1 -1
- package/dist/components/height-transition.js +72 -27
- package/dist/components/height-transition.js.map +1 -1
- package/dist/components/input.cjs +63 -19
- package/dist/components/input.cjs.map +1 -1
- package/dist/components/input.js +64 -20
- package/dist/components/input.js.map +1 -1
- package/dist/components/lazy-image.cjs +62 -21
- package/dist/components/lazy-image.cjs.map +1 -1
- package/dist/components/lazy-image.js +63 -22
- package/dist/components/lazy-image.js.map +1 -1
- package/dist/components/live-room.cjs +100 -46
- package/dist/components/live-room.cjs.map +1 -1
- package/dist/components/live-room.js +101 -47
- package/dist/components/live-room.js.map +1 -1
- package/dist/components/loading.cjs +63 -19
- package/dist/components/loading.cjs.map +1 -1
- package/dist/components/loading.js +64 -20
- package/dist/components/loading.js.map +1 -1
- package/dist/components/marquee.cjs +64 -17
- package/dist/components/marquee.cjs.map +1 -1
- package/dist/components/marquee.js +65 -18
- package/dist/components/marquee.js.map +1 -1
- package/dist/components/masonry-virtual-list.cjs +72 -25
- package/dist/components/masonry-virtual-list.cjs.map +1 -1
- package/dist/components/masonry-virtual-list.js +73 -26
- package/dist/components/masonry-virtual-list.js.map +1 -1
- package/dist/components/menu.cjs +73 -29
- package/dist/components/menu.cjs.map +1 -1
- package/dist/components/menu.js +74 -30
- package/dist/components/menu.js.map +1 -1
- package/dist/components/modal.cjs +64 -19
- package/dist/components/modal.cjs.map +1 -1
- package/dist/components/modal.js +65 -20
- package/dist/components/modal.js.map +1 -1
- package/dist/components/multi-column-picker.cjs +78 -28
- package/dist/components/multi-column-picker.cjs.map +1 -1
- package/dist/components/multi-column-picker.js +79 -29
- package/dist/components/multi-column-picker.js.map +1 -1
- package/dist/components/novel-reader.cjs +96 -54
- package/dist/components/novel-reader.cjs.map +1 -1
- package/dist/components/novel-reader.js +97 -55
- package/dist/components/novel-reader.js.map +1 -1
- package/dist/components/number-input.cjs +67 -21
- package/dist/components/number-input.cjs.map +1 -1
- package/dist/components/number-input.js +68 -22
- package/dist/components/number-input.js.map +1 -1
- package/dist/components/orbital-sphere.cjs +69 -25
- package/dist/components/orbital-sphere.cjs.map +1 -1
- package/dist/components/orbital-sphere.js +70 -26
- package/dist/components/orbital-sphere.js.map +1 -1
- package/dist/components/pagination.cjs +49 -8
- package/dist/components/pagination.cjs.map +1 -1
- package/dist/components/pagination.js +50 -9
- package/dist/components/pagination.js.map +1 -1
- package/dist/components/password-input.cjs +74 -33
- package/dist/components/password-input.cjs.map +1 -1
- package/dist/components/password-input.js +75 -34
- package/dist/components/password-input.js.map +1 -1
- package/dist/components/popconfirm.cjs +59 -15
- package/dist/components/popconfirm.cjs.map +1 -1
- package/dist/components/popconfirm.js +60 -16
- package/dist/components/popconfirm.js.map +1 -1
- package/dist/components/popup.cjs +68 -22
- package/dist/components/popup.cjs.map +1 -1
- package/dist/components/popup.js +69 -23
- package/dist/components/popup.js.map +1 -1
- package/dist/components/progress-bar.cjs +76 -25
- package/dist/components/progress-bar.cjs.map +1 -1
- package/dist/components/progress-bar.js +77 -26
- package/dist/components/progress-bar.js.map +1 -1
- package/dist/components/qr-code.cjs +52 -10
- package/dist/components/qr-code.cjs.map +1 -1
- package/dist/components/qr-code.js +53 -11
- package/dist/components/qr-code.js.map +1 -1
- package/dist/components/radio-group.cjs +63 -19
- package/dist/components/radio-group.cjs.map +1 -1
- package/dist/components/radio-group.js +64 -20
- package/dist/components/radio-group.js.map +1 -1
- package/dist/components/rating.cjs +67 -22
- package/dist/components/rating.cjs.map +1 -1
- package/dist/components/rating.js +68 -23
- package/dist/components/rating.js.map +1 -1
- package/dist/components/rolling-number.cjs +49 -8
- package/dist/components/rolling-number.cjs.map +1 -1
- package/dist/components/rolling-number.js +50 -9
- package/dist/components/rolling-number.js.map +1 -1
- package/dist/components/select.cjs +69 -24
- package/dist/components/select.cjs.map +1 -1
- package/dist/components/select.js +70 -25
- package/dist/components/select.js.map +1 -1
- package/dist/components/signature.cjs +77 -28
- package/dist/components/signature.cjs.map +1 -1
- package/dist/components/signature.js +78 -29
- package/dist/components/signature.js.map +1 -1
- package/dist/components/skeleton.cjs +52 -10
- package/dist/components/skeleton.cjs.map +1 -1
- package/dist/components/skeleton.js +53 -11
- package/dist/components/skeleton.js.map +1 -1
- package/dist/components/slide-captcha.cjs +74 -24
- package/dist/components/slide-captcha.cjs.map +1 -1
- package/dist/components/slide-captcha.js +75 -25
- package/dist/components/slide-captcha.js.map +1 -1
- package/dist/components/swiper.cjs +75 -21
- package/dist/components/swiper.cjs.map +1 -1
- package/dist/components/swiper.js +76 -22
- package/dist/components/swiper.js.map +1 -1
- package/dist/components/switch.cjs +63 -19
- package/dist/components/switch.cjs.map +1 -1
- package/dist/components/switch.js +64 -20
- package/dist/components/switch.js.map +1 -1
- package/dist/components/table.cjs +105 -53
- package/dist/components/table.cjs.map +1 -1
- package/dist/components/table.js +106 -54
- package/dist/components/table.js.map +1 -1
- package/dist/components/tabs.cjs +91 -43
- package/dist/components/tabs.cjs.map +1 -1
- package/dist/components/tabs.js +92 -44
- package/dist/components/tabs.js.map +1 -1
- package/dist/components/tag.cjs +51 -9
- package/dist/components/tag.cjs.map +1 -1
- package/dist/components/tag.js +52 -10
- package/dist/components/tag.js.map +1 -1
- package/dist/components/textarea.cjs +63 -19
- package/dist/components/textarea.cjs.map +1 -1
- package/dist/components/textarea.js +64 -20
- package/dist/components/textarea.js.map +1 -1
- package/dist/components/theme-box.cjs +132 -0
- package/dist/components/theme-box.cjs.map +1 -0
- package/dist/components/theme-box.d.ts +2 -0
- package/dist/components/theme-box.d.ts.map +1 -0
- package/dist/components/theme-box.js +130 -0
- package/dist/components/theme-box.js.map +1 -0
- package/dist/components/tilt-card.cjs +88 -41
- package/dist/components/tilt-card.cjs.map +1 -1
- package/dist/components/tilt-card.js +89 -42
- package/dist/components/tilt-card.js.map +1 -1
- package/dist/components/timeline.cjs +64 -20
- package/dist/components/timeline.cjs.map +1 -1
- package/dist/components/timeline.js +65 -21
- package/dist/components/timeline.js.map +1 -1
- package/dist/components/toast.cjs +67 -21
- package/dist/components/toast.cjs.map +1 -1
- package/dist/components/toast.js +68 -22
- package/dist/components/toast.js.map +1 -1
- package/dist/components/tooltip.cjs +59 -15
- package/dist/components/tooltip.cjs.map +1 -1
- package/dist/components/tooltip.js +60 -16
- package/dist/components/tooltip.js.map +1 -1
- package/dist/components/typewriter-text.cjs +66 -24
- package/dist/components/typewriter-text.cjs.map +1 -1
- package/dist/components/typewriter-text.js +67 -25
- package/dist/components/typewriter-text.js.map +1 -1
- package/dist/components/upload.cjs +68 -22
- package/dist/components/upload.cjs.map +1 -1
- package/dist/components/upload.js +69 -23
- package/dist/components/upload.js.map +1 -1
- package/dist/components/verification-code.cjs +119 -69
- package/dist/components/verification-code.cjs.map +1 -1
- package/dist/components/verification-code.js +120 -70
- package/dist/components/verification-code.js.map +1 -1
- package/dist/components/video-detail-transition.cjs +80 -28
- package/dist/components/video-detail-transition.cjs.map +1 -1
- package/dist/components/video-detail-transition.js +81 -29
- package/dist/components/video-detail-transition.js.map +1 -1
- package/dist/components/video-player.cjs +76 -25
- package/dist/components/video-player.cjs.map +1 -1
- package/dist/components/video-player.js +77 -26
- package/dist/components/video-player.js.map +1 -1
- package/dist/components/virtual-list.cjs +86 -37
- package/dist/components/virtual-list.cjs.map +1 -1
- package/dist/components/virtual-list.js +87 -38
- package/dist/components/virtual-list.js.map +1 -1
- package/dist/components/virtual-select.cjs +71 -25
- package/dist/components/virtual-select.cjs.map +1 -1
- package/dist/components/virtual-select.js +72 -26
- package/dist/components/virtual-select.js.map +1 -1
- package/dist/components/virtual-table.cjs +105 -53
- package/dist/components/virtual-table.cjs.map +1 -1
- package/dist/components/virtual-table.js +106 -54
- package/dist/components/virtual-table.js.map +1 -1
- package/dist/components/width-transition.cjs +163 -0
- package/dist/components/width-transition.cjs.map +1 -0
- package/dist/components/width-transition.d.ts +2 -0
- package/dist/components/width-transition.d.ts.map +1 -0
- package/dist/components/width-transition.js +161 -0
- package/dist/components/width-transition.js.map +1 -0
- package/dist/import-transform-B8NYJq5a.js +150 -0
- package/dist/import-transform-B8NYJq5a.js.map +1 -0
- package/dist/{import-transform-BFq5_6VQ.js → import-transform-D0YbYGmj.js} +4 -4
- package/dist/{import-transform-BFq5_6VQ.js.map → import-transform-D0YbYGmj.js.map} +1 -1
- package/dist/{import-transform-CvGKNZyR.js → import-transform-DgmJXsp_.js} +4 -4
- package/dist/{import-transform-CvGKNZyR.js.map → import-transform-DgmJXsp_.js.map} +1 -1
- package/dist/import-transform-DydmFGaG.js +152 -0
- package/dist/import-transform-DydmFGaG.js.map +1 -0
- package/dist/import-transform.d.ts.map +1 -1
- package/dist/index.cjs +1486 -1070
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +124 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1480 -1074
- package/dist/index.js.map +1 -1
- package/dist/styles/base.css +66 -222
- package/dist/styles/components/backtop.css +8 -14
- package/dist/styles/components/barcode.css +14 -24
- package/dist/styles/components/button.css +10 -27
- package/dist/styles/components/calendar.css +2 -2
- package/dist/styles/components/canvas-editor.css +15 -15
- package/dist/styles/components/chat-textarea.css +17 -16
- package/dist/styles/components/chat-virtual-list.css +3 -7
- package/dist/styles/components/checkbox.css +26 -33
- package/dist/styles/components/checked.css +26 -33
- package/dist/styles/components/code-preview.css +14 -24
- package/dist/styles/components/color-picker.css +25 -41
- package/dist/styles/components/comic-reader.css +5 -23
- package/dist/styles/components/config-provider.css +87 -1
- package/dist/styles/components/config-table.css +16 -45
- package/dist/styles/components/date-picker.css +32 -36
- package/dist/styles/components/date-range-picker.css +38 -40
- package/dist/styles/components/design-effect.css +24 -85
- package/dist/styles/components/draggable.css +3 -10
- package/dist/styles/components/ellipsis-text.css +6 -7
- package/dist/styles/components/empty.css +13 -27
- package/dist/styles/components/field.css +23 -30
- package/dist/styles/components/file-preview.css +10 -25
- package/dist/styles/components/form.css +23 -30
- package/dist/styles/components/gradient-text.css +2 -16
- package/dist/styles/components/input.css +23 -30
- package/dist/styles/components/live-room.css +5 -19
- package/dist/styles/components/loading.css +9 -14
- package/dist/styles/components/marquee.css +4 -0
- package/dist/styles/components/masonry-virtual-list.css +0 -1
- package/dist/styles/components/menu.css +13 -13
- package/dist/styles/components/modal.css +8 -1
- package/dist/styles/components/multi-column-picker.css +5 -3
- package/dist/styles/components/novel-reader.css +5 -28
- package/dist/styles/components/number-input.css +23 -30
- package/dist/styles/components/orbital-sphere.css +3 -3
- package/dist/styles/components/password-input.css +29 -31
- package/dist/styles/components/popup.css +8 -2
- package/dist/styles/components/qr-code.css +14 -24
- package/dist/styles/components/radio-group.css +26 -33
- package/dist/styles/components/rating.css +28 -30
- package/dist/styles/components/select.css +27 -32
- package/dist/styles/components/signature.css +26 -38
- package/dist/styles/components/skeleton.css +8 -8
- package/dist/styles/components/slide-captcha.css +15 -54
- package/dist/styles/components/swiper.css +2 -3
- package/dist/styles/components/switch.css +26 -37
- package/dist/styles/components/table.css +16 -45
- package/dist/styles/components/tag.css +3 -12
- package/dist/styles/components/textarea.css +23 -30
- package/dist/styles/components/theme-box.css +39 -0
- package/dist/styles/components/tilt-card.css +1 -5
- package/dist/styles/components/toast.css +7 -1
- package/dist/styles/components/upload.css +24 -32
- package/dist/styles/components/verification-code.css +23 -30
- package/dist/styles/components/video-detail-transition.css +20 -2
- package/dist/styles/components/video-player.css +0 -5
- package/dist/styles/components/virtual-list.css +9 -13
- package/dist/styles/components/virtual-select.css +34 -38
- package/dist/styles/components/virtual-table.css +16 -45
- package/dist/styles/components/width-transition.css +50 -0
- package/dist/styles/components.css +527 -743
- package/dist/styles/themes/business-blue.css +26 -17
- package/dist/styles/themes/cartoon-3d.css +27 -96
- package/dist/styles/themes/creative-purple.css +26 -17
- package/dist/styles/themes/dark-tech.css +31 -34
- package/dist/styles/themes/liquid-glass.css +28 -116
- package/dist/styles/themes/minimal.css +21 -17
- package/dist/styles/themes/soft-pink.css +26 -17
- package/dist/styles.css +527 -743
- package/dist/vite.cjs +2 -2
- package/dist/vite.cjs.map +1 -1
- package/dist/vite.js +2 -2
- package/dist/vite.js.map +1 -1
- package/dist/webpack-loader.cjs +5 -4
- package/dist/webpack-loader.cjs.map +1 -1
- package/dist/webpack-loader.js +5 -4
- package/dist/webpack-loader.js.map +1 -1
- package/dist/webpack.cjs +11 -6
- package/dist/webpack.cjs.map +1 -1
- package/dist/webpack.d.ts.map +1 -1
- package/dist/webpack.js +11 -6
- package/dist/webpack.js.map +1 -1
- package/package.json +4 -3
package/dist/index.cjs
CHANGED
|
@@ -23,6 +23,21 @@ const classIconPaths = {
|
|
|
23
23
|
],
|
|
24
24
|
x: ["M18 6 6 18", "M6 6l12 12"],
|
|
25
25
|
};
|
|
26
|
+
function getClassKitGlobal() {
|
|
27
|
+
if (typeof window !== "undefined") {
|
|
28
|
+
return window;
|
|
29
|
+
}
|
|
30
|
+
if (typeof self !== "undefined") {
|
|
31
|
+
return self;
|
|
32
|
+
}
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
async function writeClipboardText(text) {
|
|
36
|
+
const clipboard = typeof navigator !== "undefined" ? navigator.clipboard : undefined;
|
|
37
|
+
if (clipboard && typeof clipboard.writeText === "function") {
|
|
38
|
+
await clipboard.writeText(text);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
26
41
|
function classIcon(name, className = "cc-icon") {
|
|
27
42
|
return vue.h("svg", {
|
|
28
43
|
"aria-hidden": "true",
|
|
@@ -39,13 +54,37 @@ function classIcon(name, className = "cc-icon") {
|
|
|
39
54
|
})));
|
|
40
55
|
}
|
|
41
56
|
function resolveClassKitThemeName(theme) {
|
|
57
|
+
var _a;
|
|
42
58
|
if (typeof theme === "string")
|
|
43
59
|
return theme;
|
|
44
|
-
return theme
|
|
60
|
+
return (_a = theme === null || theme === void 0 ? void 0 : theme.name) !== null && _a !== void 0 ? _a : "minimal";
|
|
61
|
+
}
|
|
62
|
+
function applyDocumentTheme(themeName) {
|
|
63
|
+
if (typeof document === "undefined")
|
|
64
|
+
return undefined;
|
|
65
|
+
const root = document.documentElement;
|
|
66
|
+
const previousTheme = root.getAttribute("data-cc-theme");
|
|
67
|
+
const previousPage = root.getAttribute("data-cc-theme-page");
|
|
68
|
+
root.setAttribute("data-cc-theme", themeName);
|
|
69
|
+
root.setAttribute("data-cc-theme-page", "true");
|
|
70
|
+
return () => {
|
|
71
|
+
if (previousTheme === null)
|
|
72
|
+
root.removeAttribute("data-cc-theme");
|
|
73
|
+
else
|
|
74
|
+
root.setAttribute("data-cc-theme", previousTheme);
|
|
75
|
+
if (previousPage === null)
|
|
76
|
+
root.removeAttribute("data-cc-theme-page");
|
|
77
|
+
else
|
|
78
|
+
root.setAttribute("data-cc-theme-page", previousPage);
|
|
79
|
+
};
|
|
45
80
|
}
|
|
46
81
|
const ClassConfigProvider = vue.defineComponent({
|
|
47
82
|
name: "ClassConfigProvider",
|
|
48
83
|
props: {
|
|
84
|
+
applyGlobalTheme: {
|
|
85
|
+
type: Boolean,
|
|
86
|
+
default: true,
|
|
87
|
+
},
|
|
49
88
|
class: {
|
|
50
89
|
type: String,
|
|
51
90
|
default: "",
|
|
@@ -65,6 +104,7 @@ const ClassConfigProvider = vue.defineComponent({
|
|
|
65
104
|
},
|
|
66
105
|
setup(props, { slots }) {
|
|
67
106
|
const version = vue.ref(0);
|
|
107
|
+
let restoreDocumentTheme;
|
|
68
108
|
const applyConfig = () => {
|
|
69
109
|
core.configureClassComponents({
|
|
70
110
|
locale: props.locale,
|
|
@@ -72,20 +112,37 @@ const ClassConfigProvider = vue.defineComponent({
|
|
|
72
112
|
});
|
|
73
113
|
version.value += 1;
|
|
74
114
|
};
|
|
115
|
+
const applyGlobalTheme = () => {
|
|
116
|
+
restoreDocumentTheme === null || restoreDocumentTheme === void 0 ? void 0 : restoreDocumentTheme();
|
|
117
|
+
restoreDocumentTheme = props.applyGlobalTheme
|
|
118
|
+
? applyDocumentTheme(resolveClassKitThemeName(props.theme))
|
|
119
|
+
: undefined;
|
|
120
|
+
};
|
|
75
121
|
vue.watch(() => [props.locale, props.theme], applyConfig, {
|
|
76
122
|
deep: true,
|
|
77
123
|
immediate: true,
|
|
78
124
|
});
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
125
|
+
vue.watch(() => [props.applyGlobalTheme, props.theme], applyGlobalTheme, {
|
|
126
|
+
deep: true,
|
|
127
|
+
immediate: true,
|
|
128
|
+
});
|
|
129
|
+
vue.onBeforeUnmount(() => {
|
|
130
|
+
restoreDocumentTheme === null || restoreDocumentTheme === void 0 ? void 0 : restoreDocumentTheme();
|
|
131
|
+
});
|
|
132
|
+
return () => {
|
|
133
|
+
var _a;
|
|
134
|
+
return vue.h("div", {
|
|
135
|
+
class: ["cc-config-provider", props.class].filter(Boolean),
|
|
136
|
+
"data-cc-theme": resolveClassKitThemeName(props.theme),
|
|
137
|
+
style: props.style,
|
|
138
|
+
}, [
|
|
139
|
+
vue.h("div", { key: version.value, class: "cc-config-provider__content" }, (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots)),
|
|
140
|
+
]);
|
|
141
|
+
};
|
|
86
142
|
},
|
|
87
143
|
});
|
|
88
144
|
function resolveAnimation(animation, fallbackName) {
|
|
145
|
+
var _a, _b, _c, _d;
|
|
89
146
|
if (animation === false) {
|
|
90
147
|
return {
|
|
91
148
|
duration: 0,
|
|
@@ -95,10 +152,10 @@ function resolveAnimation(animation, fallbackName) {
|
|
|
95
152
|
};
|
|
96
153
|
}
|
|
97
154
|
return {
|
|
98
|
-
duration: animation
|
|
99
|
-
easing: animation
|
|
100
|
-
enabled: animation
|
|
101
|
-
name: animation
|
|
155
|
+
duration: (_a = animation === null || animation === void 0 ? void 0 : animation.duration) !== null && _a !== void 0 ? _a : 180,
|
|
156
|
+
easing: (_b = animation === null || animation === void 0 ? void 0 : animation.easing) !== null && _b !== void 0 ? _b : "cubic-bezier(0.22, 0.8, 0.28, 1)",
|
|
157
|
+
enabled: (_c = animation === null || animation === void 0 ? void 0 : animation.enabled) !== null && _c !== void 0 ? _c : true,
|
|
158
|
+
name: (_d = animation === null || animation === void 0 ? void 0 : animation.name) !== null && _d !== void 0 ? _d : fallbackName,
|
|
102
159
|
};
|
|
103
160
|
}
|
|
104
161
|
function animationStyle(animation) {
|
|
@@ -130,8 +187,9 @@ function getFocusableElements(container) {
|
|
|
130
187
|
element.getAttribute("aria-hidden") !== "true");
|
|
131
188
|
}
|
|
132
189
|
function focusInitialElement(container) {
|
|
133
|
-
|
|
134
|
-
target
|
|
190
|
+
var _a;
|
|
191
|
+
const target = (_a = getFocusableElements(container)[0]) !== null && _a !== void 0 ? _a : container;
|
|
192
|
+
target === null || target === void 0 ? void 0 : target.focus({ preventScroll: true });
|
|
135
193
|
}
|
|
136
194
|
function trapFocus(event, container) {
|
|
137
195
|
if (event.key !== "Tab" || !container)
|
|
@@ -179,7 +237,7 @@ function setupLayerA11y(container, options) {
|
|
|
179
237
|
if (options.lockScroll)
|
|
180
238
|
document.body.style.overflow = previousOverflow;
|
|
181
239
|
if (options.restoreFocus)
|
|
182
|
-
previousActiveElement
|
|
240
|
+
previousActiveElement === null || previousActiveElement === void 0 ? void 0 : previousActiveElement.focus({ preventScroll: true });
|
|
183
241
|
};
|
|
184
242
|
}
|
|
185
243
|
function resolveTabsDirection(tabs, previousId, nextId, direction) {
|
|
@@ -203,10 +261,10 @@ function useFormInteractivity() {
|
|
|
203
261
|
});
|
|
204
262
|
}
|
|
205
263
|
function resolveFieldInteractivity(form, disabled, readOnly) {
|
|
206
|
-
const resolvedDisabled = disabled
|
|
264
|
+
const resolvedDisabled = disabled !== null && disabled !== void 0 ? disabled : form.disabled.value;
|
|
207
265
|
return {
|
|
208
266
|
disabled: resolvedDisabled,
|
|
209
|
-
readOnly: !resolvedDisabled && (readOnly
|
|
267
|
+
readOnly: !resolvedDisabled && (readOnly !== null && readOnly !== void 0 ? readOnly : form.readOnly.value),
|
|
210
268
|
};
|
|
211
269
|
}
|
|
212
270
|
function useForm() {
|
|
@@ -226,6 +284,7 @@ function useFormState() {
|
|
|
226
284
|
return state;
|
|
227
285
|
}
|
|
228
286
|
function useField(name, options = {}) {
|
|
287
|
+
var _a;
|
|
229
288
|
const form = useForm();
|
|
230
289
|
const state = useFormState();
|
|
231
290
|
let unsubscribe;
|
|
@@ -233,11 +292,11 @@ function useField(name, options = {}) {
|
|
|
233
292
|
unsubscribe = form.registerField(name, options);
|
|
234
293
|
});
|
|
235
294
|
vue.onBeforeUnmount(() => {
|
|
236
|
-
unsubscribe
|
|
295
|
+
unsubscribe === null || unsubscribe === void 0 ? void 0 : unsubscribe();
|
|
237
296
|
});
|
|
238
|
-
const value = vue.ref((form.getValue(name)
|
|
239
|
-
vue.watch(() => state.value.fields[name]
|
|
240
|
-
value.value = (nextValue
|
|
297
|
+
const value = vue.ref(((_a = form.getValue(name)) !== null && _a !== void 0 ? _a : ""));
|
|
298
|
+
vue.watch(() => { var _a; return (_a = state.value.fields[name]) === null || _a === void 0 ? void 0 : _a.value; }, (nextValue) => {
|
|
299
|
+
value.value = (nextValue !== null && nextValue !== void 0 ? nextValue : "");
|
|
241
300
|
});
|
|
242
301
|
return {
|
|
243
302
|
value,
|
|
@@ -261,28 +320,30 @@ function createEmptyFormState() {
|
|
|
261
320
|
};
|
|
262
321
|
}
|
|
263
322
|
function useOptionalField(name, options = {}) {
|
|
323
|
+
var _a, _b, _c;
|
|
264
324
|
const form = vue.inject(formSymbol, null);
|
|
265
|
-
const state = vue.shallowRef(form
|
|
266
|
-
const value = vue.ref((name ? form
|
|
325
|
+
const state = vue.shallowRef((_a = form === null || form === void 0 ? void 0 : form.getState()) !== null && _a !== void 0 ? _a : createEmptyFormState());
|
|
326
|
+
const value = vue.ref((_c = (_b = (name ? form === null || form === void 0 ? void 0 : form.getValue(name) : undefined)) !== null && _b !== void 0 ? _b : options.initialValue) !== null && _c !== void 0 ? _c : "");
|
|
267
327
|
let unsubscribeForm;
|
|
268
328
|
let unsubscribeField;
|
|
269
329
|
vue.onMounted(() => {
|
|
330
|
+
var _a;
|
|
270
331
|
if (!form || !name)
|
|
271
332
|
return;
|
|
272
333
|
unsubscribeForm = form.subscribe((nextState) => {
|
|
273
334
|
state.value = nextState;
|
|
274
335
|
});
|
|
275
336
|
unsubscribeField = form.registerField(name, options);
|
|
276
|
-
value.value = (form.getValue(name)
|
|
337
|
+
value.value = ((_a = form.getValue(name)) !== null && _a !== void 0 ? _a : "");
|
|
277
338
|
});
|
|
278
339
|
vue.onBeforeUnmount(() => {
|
|
279
|
-
unsubscribeField
|
|
280
|
-
unsubscribeForm
|
|
340
|
+
unsubscribeField === null || unsubscribeField === void 0 ? void 0 : unsubscribeField();
|
|
341
|
+
unsubscribeForm === null || unsubscribeForm === void 0 ? void 0 : unsubscribeForm();
|
|
281
342
|
});
|
|
282
|
-
vue.watch(() => (name ? state.value.fields[name]
|
|
343
|
+
vue.watch(() => { var _a; return (name ? (_a = state.value.fields[name]) === null || _a === void 0 ? void 0 : _a.value : undefined); }, (nextValue) => {
|
|
283
344
|
if (!form || !name)
|
|
284
345
|
return;
|
|
285
|
-
value.value = (nextValue
|
|
346
|
+
value.value = (nextValue !== null && nextValue !== void 0 ? nextValue : "");
|
|
286
347
|
});
|
|
287
348
|
return {
|
|
288
349
|
value,
|
|
@@ -324,28 +385,31 @@ const ClassForm = /*#__PURE__*/ vue.defineComponent({
|
|
|
324
385
|
},
|
|
325
386
|
},
|
|
326
387
|
setup(props, { slots }) {
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
388
|
+
var _a;
|
|
389
|
+
const controller = (_a = props.form) !== null && _a !== void 0 ? _a : new core.FormController({
|
|
390
|
+
initialValues: props.initialValues,
|
|
391
|
+
onSubmit: props.onSubmit,
|
|
392
|
+
validateOn: props.validateOn,
|
|
393
|
+
});
|
|
333
394
|
vue.provide(formSymbol, controller);
|
|
334
395
|
vue.provide(formInteractivitySymbol, {
|
|
335
396
|
disabled: vue.computed(() => props.disabled),
|
|
336
397
|
readOnly: vue.computed(() => props.readOnly || props.readonly),
|
|
337
398
|
});
|
|
338
399
|
vue.onBeforeUnmount(() => controller.destroy());
|
|
339
|
-
return () =>
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
400
|
+
return () => {
|
|
401
|
+
var _a;
|
|
402
|
+
return vue.h("form", {
|
|
403
|
+
class: props.className,
|
|
404
|
+
"data-disabled": props.disabled ? "true" : "false",
|
|
405
|
+
"data-readonly": props.readOnly || props.readonly ? "true" : "false",
|
|
406
|
+
novalidate: true,
|
|
407
|
+
onSubmit: (event) => {
|
|
408
|
+
event.preventDefault();
|
|
409
|
+
void controller.submit();
|
|
410
|
+
},
|
|
411
|
+
}, (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots));
|
|
412
|
+
};
|
|
349
413
|
},
|
|
350
414
|
});
|
|
351
415
|
function renderError(errors, errorId) {
|
|
@@ -427,13 +491,14 @@ const ClassInput = /*#__PURE__*/ vue.defineComponent({
|
|
|
427
491
|
rules: props.rules,
|
|
428
492
|
});
|
|
429
493
|
return () => {
|
|
494
|
+
var _a, _b;
|
|
430
495
|
const fieldState = props.name
|
|
431
496
|
? field.state.value.fields[props.name]
|
|
432
497
|
: undefined;
|
|
433
|
-
const errors = fieldState
|
|
498
|
+
const errors = (_a = fieldState === null || fieldState === void 0 ? void 0 : fieldState.errors) !== null && _a !== void 0 ? _a : [];
|
|
434
499
|
const invalid = errors.length > 0;
|
|
435
500
|
const errorId = `${props.name}-error`;
|
|
436
|
-
const interactivity = resolveFieldInteractivity(formInteractivity, props.disabled, props.readOnly
|
|
501
|
+
const interactivity = resolveFieldInteractivity(formInteractivity, props.disabled, (_b = props.readOnly) !== null && _b !== void 0 ? _b : props.readonly);
|
|
437
502
|
const canClear = props.clearable &&
|
|
438
503
|
field.value.value !== "" &&
|
|
439
504
|
!interactivity.disabled &&
|
|
@@ -528,14 +593,15 @@ const ClassPasswordInput = /*#__PURE__*/ vue.defineComponent({
|
|
|
528
593
|
});
|
|
529
594
|
const innerVisible = vue.ref(props.defaultVisible);
|
|
530
595
|
return () => {
|
|
596
|
+
var _a, _b, _c, _d;
|
|
531
597
|
const fieldState = props.name
|
|
532
598
|
? field.state.value.fields[props.name]
|
|
533
599
|
: undefined;
|
|
534
|
-
const errors = fieldState
|
|
600
|
+
const errors = (_a = fieldState === null || fieldState === void 0 ? void 0 : fieldState.errors) !== null && _a !== void 0 ? _a : [];
|
|
535
601
|
const invalid = errors.length > 0;
|
|
536
602
|
const errorId = `${props.name}-error`;
|
|
537
|
-
const interactivity = resolveFieldInteractivity(formInteractivity, props.disabled, props.readOnly
|
|
538
|
-
const visible = props.visible
|
|
603
|
+
const interactivity = resolveFieldInteractivity(formInteractivity, props.disabled, (_b = props.readOnly) !== null && _b !== void 0 ? _b : props.readonly);
|
|
604
|
+
const visible = (_c = props.visible) !== null && _c !== void 0 ? _c : innerVisible.value;
|
|
539
605
|
const controller = new core.PasswordInputController({ visible });
|
|
540
606
|
const state = controller.getState();
|
|
541
607
|
const canClear = props.clearable &&
|
|
@@ -544,6 +610,7 @@ const ClassPasswordInput = /*#__PURE__*/ vue.defineComponent({
|
|
|
544
610
|
!interactivity.readOnly;
|
|
545
611
|
const canToggle = props.showToggle && !interactivity.disabled;
|
|
546
612
|
const renderToggleContent = () => {
|
|
613
|
+
var _a, _b, _c, _d;
|
|
547
614
|
if (state.visible && slots.visibleIcon)
|
|
548
615
|
return slots.visibleIcon({ visible: state.visible });
|
|
549
616
|
if (!state.visible && slots.hiddenIcon)
|
|
@@ -559,10 +626,8 @@ const ClassPasswordInput = /*#__PURE__*/ vue.defineComponent({
|
|
|
559
626
|
src,
|
|
560
627
|
})
|
|
561
628
|
: state.visible
|
|
562
|
-
? (props.visibleIcon
|
|
563
|
-
|
|
564
|
-
: (props.hiddenIcon ??
|
|
565
|
-
core.getClassComponentsLocale().passwordHiddenIcon);
|
|
629
|
+
? ((_a = props.visibleIcon) !== null && _a !== void 0 ? _a : core.getClassComponentsLocale().passwordVisibleIcon)
|
|
630
|
+
: ((_b = props.hiddenIcon) !== null && _b !== void 0 ? _b : core.getClassComponentsLocale().passwordHiddenIcon);
|
|
566
631
|
}
|
|
567
632
|
if (props.toggleType === "icon" &&
|
|
568
633
|
(state.visible ? props.visibleIcon : props.hiddenIcon) === undefined) {
|
|
@@ -593,9 +658,8 @@ const ClassPasswordInput = /*#__PURE__*/ vue.defineComponent({
|
|
|
593
658
|
]);
|
|
594
659
|
}
|
|
595
660
|
return state.visible
|
|
596
|
-
? (props.visibleIcon
|
|
597
|
-
|
|
598
|
-
: (props.hiddenIcon ?? core.getClassComponentsLocale().passwordHiddenIcon);
|
|
661
|
+
? ((_c = props.visibleIcon) !== null && _c !== void 0 ? _c : core.getClassComponentsLocale().passwordVisibleIcon)
|
|
662
|
+
: ((_d = props.hiddenIcon) !== null && _d !== void 0 ? _d : core.getClassComponentsLocale().passwordHiddenIcon);
|
|
599
663
|
};
|
|
600
664
|
return vue.h("div", {
|
|
601
665
|
class: props.fieldClass,
|
|
@@ -642,12 +706,11 @@ const ClassPasswordInput = /*#__PURE__*/ vue.defineComponent({
|
|
|
642
706
|
: null,
|
|
643
707
|
canToggle
|
|
644
708
|
? vue.h("button", {
|
|
645
|
-
"aria-label": props.toggleLabel
|
|
646
|
-
(
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
.passwordToggleHiddenLabel),
|
|
709
|
+
"aria-label": (_d = props.toggleLabel) !== null && _d !== void 0 ? _d : (state.visible
|
|
710
|
+
? core.getClassComponentsLocale()
|
|
711
|
+
.passwordToggleVisibleLabel
|
|
712
|
+
: core.getClassComponentsLocale()
|
|
713
|
+
.passwordToggleHiddenLabel),
|
|
651
714
|
"aria-pressed": state.visible,
|
|
652
715
|
class: "cc-password-field__toggle",
|
|
653
716
|
"data-type": props.toggleType,
|
|
@@ -715,8 +778,9 @@ const ClassColorPicker = /*#__PURE__*/ vue.defineComponent({
|
|
|
715
778
|
};
|
|
716
779
|
};
|
|
717
780
|
const closeOnOutside = (event) => {
|
|
781
|
+
var _a, _b;
|
|
718
782
|
const target = event.target;
|
|
719
|
-
if (!rootRef.value
|
|
783
|
+
if (!((_a = rootRef.value) === null || _a === void 0 ? void 0 : _a.contains(target)) && !((_b = panelRef.value) === null || _b === void 0 ? void 0 : _b.contains(target)))
|
|
720
784
|
open.value = false;
|
|
721
785
|
};
|
|
722
786
|
vue.watch(open, (value) => {
|
|
@@ -734,7 +798,8 @@ const ClassColorPicker = /*#__PURE__*/ vue.defineComponent({
|
|
|
734
798
|
window.removeEventListener("scroll", updatePanelPosition, true);
|
|
735
799
|
});
|
|
736
800
|
return () => {
|
|
737
|
-
|
|
801
|
+
var _a;
|
|
802
|
+
const interactivity = resolveFieldInteractivity(formInteractivity, props.disabled, (_a = props.readOnly) !== null && _a !== void 0 ? _a : props.readonly);
|
|
738
803
|
const controller = new core.ColorPickerController(String(field.value.value || "#1d2129"));
|
|
739
804
|
const state = controller.getState();
|
|
740
805
|
const commit = (value) => {
|
|
@@ -813,8 +878,9 @@ const ClassColorPicker = /*#__PURE__*/ vue.defineComponent({
|
|
|
813
878
|
},
|
|
814
879
|
tabindex: interactivity.disabled ? -1 : 0,
|
|
815
880
|
onPointerdown: (event) => {
|
|
881
|
+
var _a, _b;
|
|
816
882
|
updateSpectrum(event);
|
|
817
|
-
event.currentTarget.setPointerCapture(event.pointerId);
|
|
883
|
+
(_b = (_a = event.currentTarget).setPointerCapture) === null || _b === void 0 ? void 0 : _b.call(_a, event.pointerId);
|
|
818
884
|
},
|
|
819
885
|
onPointermove: (event) => {
|
|
820
886
|
if (event.buttons > 0)
|
|
@@ -828,8 +894,9 @@ const ClassColorPicker = /*#__PURE__*/ vue.defineComponent({
|
|
|
828
894
|
role: "slider",
|
|
829
895
|
tabindex: interactivity.disabled ? -1 : 0,
|
|
830
896
|
onPointerdown: (event) => {
|
|
897
|
+
var _a, _b;
|
|
831
898
|
updateHue(event);
|
|
832
|
-
event.currentTarget.setPointerCapture(event.pointerId);
|
|
899
|
+
(_b = (_a = event.currentTarget).setPointerCapture) === null || _b === void 0 ? void 0 : _b.call(_a, event.pointerId);
|
|
833
900
|
},
|
|
834
901
|
onPointermove: (event) => {
|
|
835
902
|
if (event.buttons > 0)
|
|
@@ -996,8 +1063,9 @@ const ClassDatePicker = /*#__PURE__*/ vue.defineComponent({
|
|
|
996
1063
|
requestAnimationFrame(updatePanelPosition);
|
|
997
1064
|
});
|
|
998
1065
|
const closeOnOutside = (event) => {
|
|
1066
|
+
var _a, _b;
|
|
999
1067
|
const target = event.target;
|
|
1000
|
-
if (!rootRef.value
|
|
1068
|
+
if (!((_a = rootRef.value) === null || _a === void 0 ? void 0 : _a.contains(target)) && !((_b = panelRef.value) === null || _b === void 0 ? void 0 : _b.contains(target)))
|
|
1001
1069
|
open.value = false;
|
|
1002
1070
|
};
|
|
1003
1071
|
vue.onMounted(() => {
|
|
@@ -1019,7 +1087,8 @@ const ClassDatePicker = /*#__PURE__*/ vue.defineComponent({
|
|
|
1019
1087
|
open.value = false;
|
|
1020
1088
|
};
|
|
1021
1089
|
return () => {
|
|
1022
|
-
|
|
1090
|
+
var _a;
|
|
1091
|
+
const interactivity = resolveFieldInteractivity(formInteractivity, props.disabled, (_a = props.readOnly) !== null && _a !== void 0 ? _a : props.readonly);
|
|
1023
1092
|
return vue.h("div", {
|
|
1024
1093
|
...attrs,
|
|
1025
1094
|
class: props.fieldClass,
|
|
@@ -1216,8 +1285,9 @@ const ClassDateRangePicker = /*#__PURE__*/ vue.defineComponent({
|
|
|
1216
1285
|
requestAnimationFrame(updatePanelPosition);
|
|
1217
1286
|
});
|
|
1218
1287
|
const closeOnOutside = (event) => {
|
|
1288
|
+
var _a, _b;
|
|
1219
1289
|
const target = event.target;
|
|
1220
|
-
if (!rootRef.value
|
|
1290
|
+
if (!((_a = rootRef.value) === null || _a === void 0 ? void 0 : _a.contains(target)) && !((_b = panelRef.value) === null || _b === void 0 ? void 0 : _b.contains(target)))
|
|
1221
1291
|
open.value = false;
|
|
1222
1292
|
};
|
|
1223
1293
|
vue.onMounted(() => {
|
|
@@ -1270,7 +1340,8 @@ const ClassDateRangePicker = /*#__PURE__*/ vue.defineComponent({
|
|
|
1270
1340
|
}, day.day))),
|
|
1271
1341
|
]);
|
|
1272
1342
|
return () => {
|
|
1273
|
-
|
|
1343
|
+
var _a;
|
|
1344
|
+
const interactivity = resolveFieldInteractivity(formInteractivity, props.disabled, (_a = props.readOnly) !== null && _a !== void 0 ? _a : props.readonly);
|
|
1274
1345
|
const currentValue = { start: state.value.start, end: state.value.end };
|
|
1275
1346
|
return vue.h("div", {
|
|
1276
1347
|
...attrs,
|
|
@@ -1415,13 +1486,14 @@ const ClassTextarea = /*#__PURE__*/ vue.defineComponent({
|
|
|
1415
1486
|
rules: props.rules,
|
|
1416
1487
|
});
|
|
1417
1488
|
return () => {
|
|
1489
|
+
var _a, _b;
|
|
1418
1490
|
const fieldState = props.name
|
|
1419
1491
|
? field.state.value.fields[props.name]
|
|
1420
1492
|
: undefined;
|
|
1421
|
-
const errors = fieldState
|
|
1493
|
+
const errors = (_a = fieldState === null || fieldState === void 0 ? void 0 : fieldState.errors) !== null && _a !== void 0 ? _a : [];
|
|
1422
1494
|
const invalid = errors.length > 0;
|
|
1423
1495
|
const errorId = `${props.name}-error`;
|
|
1424
|
-
const interactivity = resolveFieldInteractivity(formInteractivity, props.disabled, props.readOnly
|
|
1496
|
+
const interactivity = resolveFieldInteractivity(formInteractivity, props.disabled, (_b = props.readOnly) !== null && _b !== void 0 ? _b : props.readonly);
|
|
1425
1497
|
const canClear = props.clearable &&
|
|
1426
1498
|
field.value.value !== "" &&
|
|
1427
1499
|
!interactivity.disabled &&
|
|
@@ -1512,11 +1584,12 @@ const ClassChatTextarea = /*#__PURE__*/ vue.defineComponent({
|
|
|
1512
1584
|
},
|
|
1513
1585
|
emits: ["change", "input", "update:modelValue", "update:value"],
|
|
1514
1586
|
setup(props, { attrs, emit, expose }) {
|
|
1587
|
+
var _a, _b;
|
|
1515
1588
|
const textareaRef = vue.ref(null);
|
|
1516
1589
|
const controller = new core.ChatTextareaController({
|
|
1517
1590
|
maxRows: props.maxRows,
|
|
1518
1591
|
minRows: props.minRows,
|
|
1519
|
-
value: props.modelValue
|
|
1592
|
+
value: (_b = (_a = props.modelValue) !== null && _a !== void 0 ? _a : props.value) !== null && _b !== void 0 ? _b : props.defaultValue,
|
|
1520
1593
|
});
|
|
1521
1594
|
const state = vue.ref(controller.getState());
|
|
1522
1595
|
const controlled = vue.computed(() => props.modelValue !== undefined || props.value !== undefined);
|
|
@@ -1535,11 +1608,12 @@ const ClassChatTextarea = /*#__PURE__*/ vue.defineComponent({
|
|
|
1535
1608
|
element.scrollHeight > maxHeight + 1 ? "auto" : "hidden";
|
|
1536
1609
|
};
|
|
1537
1610
|
const syncState = () => {
|
|
1611
|
+
var _a, _b;
|
|
1538
1612
|
state.value = controller.update({
|
|
1539
1613
|
maxRows: props.maxRows,
|
|
1540
1614
|
minRows: props.minRows,
|
|
1541
1615
|
value: controlled.value
|
|
1542
|
-
? (props.modelValue
|
|
1616
|
+
? ((_b = (_a = props.modelValue) !== null && _a !== void 0 ? _a : props.value) !== null && _b !== void 0 ? _b : "")
|
|
1543
1617
|
: state.value.value,
|
|
1544
1618
|
});
|
|
1545
1619
|
vue.nextTick(resize);
|
|
@@ -1553,7 +1627,7 @@ const ClassChatTextarea = /*#__PURE__*/ vue.defineComponent({
|
|
|
1553
1627
|
resizeObserver.observe(textareaRef.value);
|
|
1554
1628
|
});
|
|
1555
1629
|
vue.onBeforeUnmount(() => {
|
|
1556
|
-
resizeObserver
|
|
1630
|
+
resizeObserver === null || resizeObserver === void 0 ? void 0 : resizeObserver.disconnect();
|
|
1557
1631
|
});
|
|
1558
1632
|
const commit = (nextValue, event) => {
|
|
1559
1633
|
const nextState = controller.setValue(nextValue);
|
|
@@ -1566,14 +1640,15 @@ const ClassChatTextarea = /*#__PURE__*/ vue.defineComponent({
|
|
|
1566
1640
|
vue.nextTick(resize);
|
|
1567
1641
|
};
|
|
1568
1642
|
expose({
|
|
1569
|
-
blur: () => textareaRef.value
|
|
1570
|
-
focus: () => textareaRef.value
|
|
1643
|
+
blur: () => { var _a; return (_a = textareaRef.value) === null || _a === void 0 ? void 0 : _a.blur(); },
|
|
1644
|
+
focus: () => { var _a; return (_a = textareaRef.value) === null || _a === void 0 ? void 0 : _a.focus(); },
|
|
1571
1645
|
getElement: () => textareaRef.value,
|
|
1572
1646
|
});
|
|
1573
1647
|
return () => {
|
|
1648
|
+
var _a, _b, _c;
|
|
1574
1649
|
const locked = props.disabled || props.readOnly || props.readonly;
|
|
1575
1650
|
const currentValue = controlled.value
|
|
1576
|
-
? (props.modelValue
|
|
1651
|
+
? ((_b = (_a = props.modelValue) !== null && _a !== void 0 ? _a : props.value) !== null && _b !== void 0 ? _b : "")
|
|
1577
1652
|
: state.value.value;
|
|
1578
1653
|
const canClear = props.clearable && currentValue !== "" && !locked;
|
|
1579
1654
|
return vue.h("div", {
|
|
@@ -1596,7 +1671,7 @@ const ClassChatTextarea = /*#__PURE__*/ vue.defineComponent({
|
|
|
1596
1671
|
style: {
|
|
1597
1672
|
"--cc-chat-textarea-max-rows": state.value.maxRows,
|
|
1598
1673
|
"--cc-chat-textarea-min-rows": state.value.minRows,
|
|
1599
|
-
...(props.textareaStyle
|
|
1674
|
+
...((_c = props.textareaStyle) !== null && _c !== void 0 ? _c : {}),
|
|
1600
1675
|
},
|
|
1601
1676
|
value: currentValue,
|
|
1602
1677
|
onInput: (event) => {
|
|
@@ -1611,8 +1686,9 @@ const ClassChatTextarea = /*#__PURE__*/ vue.defineComponent({
|
|
|
1611
1686
|
class: "cc-chat-textarea__clear",
|
|
1612
1687
|
type: "button",
|
|
1613
1688
|
onClick: (event) => {
|
|
1689
|
+
var _a;
|
|
1614
1690
|
commit("", event);
|
|
1615
|
-
textareaRef.value
|
|
1691
|
+
(_a = textareaRef.value) === null || _a === void 0 ? void 0 : _a.focus();
|
|
1616
1692
|
},
|
|
1617
1693
|
}, props.clearIcon)
|
|
1618
1694
|
: null,
|
|
@@ -1660,15 +1736,17 @@ const ClassVerificationCode = /*#__PURE__*/ vue.defineComponent({
|
|
|
1660
1736
|
if (nextState.complete)
|
|
1661
1737
|
emit("complete", nextState.value);
|
|
1662
1738
|
if (focusIndex !== undefined)
|
|
1663
|
-
void vue.nextTick(() => inputRefs[focusIndex]
|
|
1739
|
+
void vue.nextTick(() => { var _a; return (_a = inputRefs[focusIndex]) === null || _a === void 0 ? void 0 : _a.focus(); });
|
|
1664
1740
|
};
|
|
1665
1741
|
vue.onMounted(() => {
|
|
1666
|
-
|
|
1742
|
+
var _a, _b;
|
|
1743
|
+
const interactivity = resolveFieldInteractivity(formInteractivity, props.disabled, (_a = props.readOnly) !== null && _a !== void 0 ? _a : props.readonly);
|
|
1667
1744
|
if (props.autoFocus && !interactivity.disabled && !interactivity.readOnly)
|
|
1668
|
-
inputRefs[0]
|
|
1745
|
+
(_b = inputRefs[0]) === null || _b === void 0 ? void 0 : _b.focus();
|
|
1669
1746
|
});
|
|
1670
1747
|
return () => {
|
|
1671
|
-
|
|
1748
|
+
var _a;
|
|
1749
|
+
const interactivity = resolveFieldInteractivity(formInteractivity, props.disabled, (_a = props.readOnly) !== null && _a !== void 0 ? _a : props.readonly);
|
|
1672
1750
|
return vue.h("div", {
|
|
1673
1751
|
...attrs,
|
|
1674
1752
|
class: props.fieldClass,
|
|
@@ -1678,55 +1756,60 @@ const ClassVerificationCode = /*#__PURE__*/ vue.defineComponent({
|
|
|
1678
1756
|
props.label
|
|
1679
1757
|
? vue.h("span", { class: "cc-field__label" }, props.label)
|
|
1680
1758
|
: null,
|
|
1681
|
-
vue.h("div", { class: "cc-verification-code__group" }, state.value.chars.map((char, index) =>
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1759
|
+
vue.h("div", { class: "cc-verification-code__group" }, state.value.chars.map((char, index) => {
|
|
1760
|
+
var _a;
|
|
1761
|
+
return vue.h("input", {
|
|
1762
|
+
"aria-label": `${(_a = props.label) !== null && _a !== void 0 ? _a : props.name} ${index + 1}`,
|
|
1763
|
+
class: "cc-verification-code__input",
|
|
1764
|
+
disabled: interactivity.disabled,
|
|
1765
|
+
inputmode: props.inputMode,
|
|
1766
|
+
key: index,
|
|
1767
|
+
maxlength: 1,
|
|
1768
|
+
readonly: interactivity.readOnly,
|
|
1769
|
+
ref: ((element) => {
|
|
1770
|
+
inputRefs[index] = element;
|
|
1771
|
+
}),
|
|
1772
|
+
value: char,
|
|
1773
|
+
onInput: (event) => {
|
|
1774
|
+
if (interactivity.disabled || interactivity.readOnly)
|
|
1775
|
+
return;
|
|
1776
|
+
const value = event.target.value;
|
|
1777
|
+
if (value === "") {
|
|
1778
|
+
commit(controller.remove(index), index);
|
|
1779
|
+
return;
|
|
1780
|
+
}
|
|
1781
|
+
if (value.length > 1) {
|
|
1782
|
+
const next = controller.paste(value, controller.getNextInputIndex(index));
|
|
1783
|
+
commit(next, Math.min(next.length - 1, next.value.length));
|
|
1784
|
+
return;
|
|
1785
|
+
}
|
|
1786
|
+
const next = controller.inputAtNextSlot(index, value);
|
|
1787
|
+
commit(next.state, next.focusIndex);
|
|
1788
|
+
},
|
|
1789
|
+
onKeydown: (event) => {
|
|
1790
|
+
var _a, _b;
|
|
1791
|
+
if (event.key === "Backspace" &&
|
|
1792
|
+
!state.value.chars[index] &&
|
|
1793
|
+
index > 0) {
|
|
1794
|
+
event.preventDefault();
|
|
1795
|
+
commit(controller.remove(index - 1), index - 1);
|
|
1796
|
+
}
|
|
1797
|
+
if (event.key === "ArrowLeft" && index > 0)
|
|
1798
|
+
(_a = inputRefs[index - 1]) === null || _a === void 0 ? void 0 : _a.focus();
|
|
1799
|
+
if (event.key === "ArrowRight" &&
|
|
1800
|
+
index < state.value.length - 1)
|
|
1801
|
+
(_b = inputRefs[index + 1]) === null || _b === void 0 ? void 0 : _b.focus();
|
|
1802
|
+
},
|
|
1803
|
+
onPaste: (event) => {
|
|
1804
|
+
var _a, _b;
|
|
1805
|
+
if (interactivity.disabled || interactivity.readOnly)
|
|
1806
|
+
return;
|
|
1713
1807
|
event.preventDefault();
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
index < state.value.length - 1)
|
|
1720
|
-
inputRefs[index + 1]?.focus();
|
|
1721
|
-
},
|
|
1722
|
-
onPaste: (event) => {
|
|
1723
|
-
if (interactivity.disabled || interactivity.readOnly)
|
|
1724
|
-
return;
|
|
1725
|
-
event.preventDefault();
|
|
1726
|
-
const text = event.clipboardData?.getData("text") ?? "";
|
|
1727
|
-
commit(controller.paste(text, index), Math.min(state.value.length - 1, index + text.length));
|
|
1728
|
-
},
|
|
1729
|
-
}))),
|
|
1808
|
+
const text = (_b = (_a = event.clipboardData) === null || _a === void 0 ? void 0 : _a.getData("text")) !== null && _b !== void 0 ? _b : "";
|
|
1809
|
+
commit(controller.paste(text, index), Math.min(state.value.length - 1, index + text.length));
|
|
1810
|
+
},
|
|
1811
|
+
});
|
|
1812
|
+
})),
|
|
1730
1813
|
vue.h("input", {
|
|
1731
1814
|
name: props.name,
|
|
1732
1815
|
type: "hidden",
|
|
@@ -1774,6 +1857,7 @@ const ClassSlideCaptcha = /*#__PURE__*/ vue.defineComponent({
|
|
|
1774
1857
|
},
|
|
1775
1858
|
emits: ["change", "fail", "success"],
|
|
1776
1859
|
setup(props, { attrs, emit }) {
|
|
1860
|
+
var _a;
|
|
1777
1861
|
const formInteractivity = useFormInteractivity();
|
|
1778
1862
|
const field = useOptionalField(props.name, {
|
|
1779
1863
|
rules: props.rules,
|
|
@@ -1781,7 +1865,7 @@ const ClassSlideCaptcha = /*#__PURE__*/ vue.defineComponent({
|
|
|
1781
1865
|
const controller = new core.SlideCaptchaController({
|
|
1782
1866
|
height: props.height,
|
|
1783
1867
|
moveAxis: props.moveAxis,
|
|
1784
|
-
originY: props.pieceTop
|
|
1868
|
+
originY: (_a = props.pieceTop) !== null && _a !== void 0 ? _a : Math.round(props.height * 0.38),
|
|
1785
1869
|
pieceHeight: props.pieceHeight,
|
|
1786
1870
|
pieceWidth: props.pieceWidth,
|
|
1787
1871
|
targetX: props.targetX,
|
|
@@ -1806,10 +1890,11 @@ const ClassSlideCaptcha = /*#__PURE__*/ vue.defineComponent({
|
|
|
1806
1890
|
props.tolerance,
|
|
1807
1891
|
props.width,
|
|
1808
1892
|
], () => {
|
|
1893
|
+
var _a;
|
|
1809
1894
|
state.value = controller.updateOptions({
|
|
1810
1895
|
height: props.height,
|
|
1811
1896
|
moveAxis: props.moveAxis,
|
|
1812
|
-
originY: props.pieceTop
|
|
1897
|
+
originY: (_a = props.pieceTop) !== null && _a !== void 0 ? _a : Math.round(props.height * 0.38),
|
|
1813
1898
|
pieceHeight: props.pieceHeight,
|
|
1814
1899
|
pieceWidth: props.pieceWidth,
|
|
1815
1900
|
targetX: props.targetX,
|
|
@@ -1839,7 +1924,8 @@ const ClassSlideCaptcha = /*#__PURE__*/ vue.defineComponent({
|
|
|
1839
1924
|
}
|
|
1840
1925
|
};
|
|
1841
1926
|
const reset = () => {
|
|
1842
|
-
|
|
1927
|
+
var _a;
|
|
1928
|
+
const interactivity = resolveFieldInteractivity(formInteractivity, props.disabled, (_a = props.readOnly) !== null && _a !== void 0 ? _a : props.readonly);
|
|
1843
1929
|
if (interactivity.disabled || interactivity.readOnly)
|
|
1844
1930
|
return;
|
|
1845
1931
|
if (failedResetTimer !== null) {
|
|
@@ -1853,7 +1939,8 @@ const ClassSlideCaptcha = /*#__PURE__*/ vue.defineComponent({
|
|
|
1853
1939
|
window.clearTimeout(failedResetTimer);
|
|
1854
1940
|
});
|
|
1855
1941
|
return () => {
|
|
1856
|
-
|
|
1942
|
+
var _a;
|
|
1943
|
+
const interactivity = resolveFieldInteractivity(formInteractivity, props.disabled, (_a = props.readOnly) !== null && _a !== void 0 ? _a : props.readonly);
|
|
1857
1944
|
const safePieceTop = Math.max(0, Math.min(state.value.height - state.value.pieceHeight, state.value.originY));
|
|
1858
1945
|
const scaleX = cardRef.value
|
|
1859
1946
|
? state.value.width /
|
|
@@ -1864,12 +1951,13 @@ const ClassSlideCaptcha = /*#__PURE__*/ vue.defineComponent({
|
|
|
1864
1951
|
Math.max(1, cardRef.value.getBoundingClientRect().height)
|
|
1865
1952
|
: 1;
|
|
1866
1953
|
const startDrag = (event) => {
|
|
1954
|
+
var _a, _b;
|
|
1867
1955
|
if (interactivity.disabled ||
|
|
1868
1956
|
interactivity.readOnly ||
|
|
1869
1957
|
state.value.status === "success")
|
|
1870
1958
|
return;
|
|
1871
1959
|
event.preventDefault();
|
|
1872
|
-
event.currentTarget.setPointerCapture
|
|
1960
|
+
(_b = (_a = event.currentTarget).setPointerCapture) === null || _b === void 0 ? void 0 : _b.call(_a, event.pointerId);
|
|
1873
1961
|
drag.value = {
|
|
1874
1962
|
pointerId: event.pointerId,
|
|
1875
1963
|
startClientX: event.clientX,
|
|
@@ -1887,15 +1975,17 @@ const ClassSlideCaptcha = /*#__PURE__*/ vue.defineComponent({
|
|
|
1887
1975
|
(event.clientY - drag.value.startClientY) * scaleY), false);
|
|
1888
1976
|
};
|
|
1889
1977
|
const cancelDrag = (event) => {
|
|
1890
|
-
|
|
1978
|
+
var _a;
|
|
1979
|
+
if (((_a = drag.value) === null || _a === void 0 ? void 0 : _a.pointerId) !== event.pointerId)
|
|
1891
1980
|
return;
|
|
1892
1981
|
drag.value = null;
|
|
1893
1982
|
commit(controller.reset());
|
|
1894
1983
|
};
|
|
1895
1984
|
const endDrag = (event) => {
|
|
1985
|
+
var _a, _b;
|
|
1896
1986
|
if (!drag.value || drag.value.pointerId !== event.pointerId)
|
|
1897
1987
|
return;
|
|
1898
|
-
event.currentTarget.releasePointerCapture
|
|
1988
|
+
(_b = (_a = event.currentTarget).releasePointerCapture) === null || _b === void 0 ? void 0 : _b.call(_a, event.pointerId);
|
|
1899
1989
|
drag.value = null;
|
|
1900
1990
|
commit(controller.verify());
|
|
1901
1991
|
};
|
|
@@ -2005,12 +2095,13 @@ function countFractionDigits(value) {
|
|
|
2005
2095
|
return fraction.length;
|
|
2006
2096
|
}
|
|
2007
2097
|
function applyNumberStep(current, direction, options) {
|
|
2098
|
+
var _a;
|
|
2008
2099
|
const step = Number.isFinite(options.step) &&
|
|
2009
2100
|
options.step !== undefined &&
|
|
2010
2101
|
options.step > 0
|
|
2011
2102
|
? options.step
|
|
2012
2103
|
: 1;
|
|
2013
|
-
const base = current
|
|
2104
|
+
const base = (_a = current !== null && current !== void 0 ? current : options.min) !== null && _a !== void 0 ? _a : 0;
|
|
2014
2105
|
const precision = Math.max(countFractionDigits(base), countFractionDigits(step));
|
|
2015
2106
|
const factor = 10 ** precision;
|
|
2016
2107
|
let next = (Math.round(base * factor) + direction * Math.round(step * factor)) /
|
|
@@ -2128,13 +2219,14 @@ const ClassNumberInput = /*#__PURE__*/ vue.defineComponent({
|
|
|
2128
2219
|
void field.setValue(nextValue);
|
|
2129
2220
|
};
|
|
2130
2221
|
return () => {
|
|
2222
|
+
var _a, _b;
|
|
2131
2223
|
const fieldState = props.name
|
|
2132
2224
|
? field.state.value.fields[props.name]
|
|
2133
2225
|
: undefined;
|
|
2134
|
-
const errors = fieldState
|
|
2226
|
+
const errors = (_a = fieldState === null || fieldState === void 0 ? void 0 : fieldState.errors) !== null && _a !== void 0 ? _a : [];
|
|
2135
2227
|
const invalid = errors.length > 0;
|
|
2136
2228
|
const errorId = `${props.name}-error`;
|
|
2137
|
-
const interactivity = resolveFieldInteractivity(formInteractivity, props.disabled, props.readOnly
|
|
2229
|
+
const interactivity = resolveFieldInteractivity(formInteractivity, props.disabled, (_b = props.readOnly) !== null && _b !== void 0 ? _b : props.readonly);
|
|
2138
2230
|
const currentValue = field.value.value;
|
|
2139
2231
|
const currentNumber = currentValue === undefined || currentValue === ""
|
|
2140
2232
|
? undefined
|
|
@@ -2199,7 +2291,8 @@ const ClassNumberInput = /*#__PURE__*/ vue.defineComponent({
|
|
|
2199
2291
|
void field.setValue(parseNumberDraft(target.value));
|
|
2200
2292
|
},
|
|
2201
2293
|
onKeydown: (event) => {
|
|
2202
|
-
|
|
2294
|
+
var _a;
|
|
2295
|
+
callEventHandler((_a = attrs.onKeydown) !== null && _a !== void 0 ? _a : attrs.onKeyDown, event);
|
|
2203
2296
|
if (event.defaultPrevented ||
|
|
2204
2297
|
interactivity.disabled ||
|
|
2205
2298
|
interactivity.readOnly)
|
|
@@ -2314,8 +2407,9 @@ const ClassSelect = /*#__PURE__*/ vue.defineComponent({
|
|
|
2314
2407
|
menuPosition.value = getSelectMenuPosition(triggerRef.value, 240, true);
|
|
2315
2408
|
};
|
|
2316
2409
|
const closeOnOutsideClick = (event) => {
|
|
2410
|
+
var _a, _b;
|
|
2317
2411
|
const target = event.target;
|
|
2318
|
-
if (!rootRef.value
|
|
2412
|
+
if (!((_a = rootRef.value) === null || _a === void 0 ? void 0 : _a.contains(target)) && !((_b = menuRef.value) === null || _b === void 0 ? void 0 : _b.contains(target)))
|
|
2319
2413
|
open.value = false;
|
|
2320
2414
|
};
|
|
2321
2415
|
vue.onMounted(() => {
|
|
@@ -2333,14 +2427,15 @@ const ClassSelect = /*#__PURE__*/ vue.defineComponent({
|
|
|
2333
2427
|
updateMenuPosition();
|
|
2334
2428
|
});
|
|
2335
2429
|
return () => {
|
|
2430
|
+
var _a, _b, _c;
|
|
2336
2431
|
const fieldState = props.name
|
|
2337
2432
|
? field.state.value.fields[props.name]
|
|
2338
2433
|
: undefined;
|
|
2339
|
-
const errors = fieldState
|
|
2434
|
+
const errors = (_a = fieldState === null || fieldState === void 0 ? void 0 : fieldState.errors) !== null && _a !== void 0 ? _a : [];
|
|
2340
2435
|
const invalid = errors.length > 0;
|
|
2341
2436
|
const errorId = `${props.name}-error`;
|
|
2342
2437
|
const listboxId = `${props.name}-listbox`;
|
|
2343
|
-
const interactivity = resolveFieldInteractivity(formInteractivity, props.disabled, props.readOnly
|
|
2438
|
+
const interactivity = resolveFieldInteractivity(formInteractivity, props.disabled, (_b = props.readOnly) !== null && _b !== void 0 ? _b : props.readonly);
|
|
2344
2439
|
const rawValue = field.value.value;
|
|
2345
2440
|
const selectedValues = Array.isArray(rawValue)
|
|
2346
2441
|
? rawValue
|
|
@@ -2350,7 +2445,7 @@ const ClassSelect = /*#__PURE__*/ vue.defineComponent({
|
|
|
2350
2445
|
const selectedOptions = props.options.filter((option) => selectedValues.includes(option.value));
|
|
2351
2446
|
const displayText = selectedOptions.length > 0
|
|
2352
2447
|
? selectedOptions.map((option) => option.label).join("、")
|
|
2353
|
-
: (props.placeholder
|
|
2448
|
+
: ((_c = props.placeholder) !== null && _c !== void 0 ? _c : "Select");
|
|
2354
2449
|
const setValue = (nextValue) => {
|
|
2355
2450
|
void field.setValue(nextValue);
|
|
2356
2451
|
emit("valueChange", nextValue);
|
|
@@ -2487,6 +2582,7 @@ const ClassSelect = /*#__PURE__*/ vue.defineComponent({
|
|
|
2487
2582
|
...menuPosition.value.style,
|
|
2488
2583
|
},
|
|
2489
2584
|
}, props.options.map((option) => {
|
|
2585
|
+
var _a, _b;
|
|
2490
2586
|
const selected = selectedValues.includes(option.value);
|
|
2491
2587
|
return vue.h("button", {
|
|
2492
2588
|
"aria-selected": selected,
|
|
@@ -2503,8 +2599,7 @@ const ClassSelect = /*#__PURE__*/ vue.defineComponent({
|
|
|
2503
2599
|
? vue.h("span", {
|
|
2504
2600
|
"aria-hidden": "true",
|
|
2505
2601
|
class: props.selectedIconClass,
|
|
2506
|
-
}, slots.selectedIcon
|
|
2507
|
-
props.selectedIcon)
|
|
2602
|
+
}, (_b = (_a = slots.selectedIcon) === null || _a === void 0 ? void 0 : _a.call(slots, { option })) !== null && _b !== void 0 ? _b : props.selectedIcon)
|
|
2508
2603
|
: null,
|
|
2509
2604
|
]);
|
|
2510
2605
|
})))
|
|
@@ -2514,7 +2609,7 @@ const ClassSelect = /*#__PURE__*/ vue.defineComponent({
|
|
|
2514
2609
|
type: "hidden",
|
|
2515
2610
|
value: props.multiple
|
|
2516
2611
|
? selectedValues.join(",")
|
|
2517
|
-
: String(rawValue
|
|
2612
|
+
: String(rawValue !== null && rawValue !== void 0 ? rawValue : ""),
|
|
2518
2613
|
}),
|
|
2519
2614
|
]),
|
|
2520
2615
|
renderError(errors, errorId),
|
|
@@ -2628,8 +2723,9 @@ const ClassVirtualSelect = /*#__PURE__*/ vue.defineComponent({
|
|
|
2628
2723
|
menuPosition.value = getSelectMenuPosition(triggerRef.value, props.menuHeight + (props.searchable ? 52 : 12));
|
|
2629
2724
|
};
|
|
2630
2725
|
const closeOnOutsideClick = (event) => {
|
|
2726
|
+
var _a, _b;
|
|
2631
2727
|
const target = event.target;
|
|
2632
|
-
if (!rootRef.value
|
|
2728
|
+
if (!((_a = rootRef.value) === null || _a === void 0 ? void 0 : _a.contains(target)) && !((_b = menuRef.value) === null || _b === void 0 ? void 0 : _b.contains(target)))
|
|
2633
2729
|
open.value = false;
|
|
2634
2730
|
};
|
|
2635
2731
|
vue.onMounted(() => {
|
|
@@ -2650,15 +2746,16 @@ const ClassVirtualSelect = /*#__PURE__*/ vue.defineComponent({
|
|
|
2650
2746
|
scrollOffset.value = 0;
|
|
2651
2747
|
});
|
|
2652
2748
|
return () => {
|
|
2749
|
+
var _a, _b, _c, _d;
|
|
2653
2750
|
const fieldState = props.name
|
|
2654
2751
|
? field.state.value.fields[props.name]
|
|
2655
2752
|
: undefined;
|
|
2656
|
-
const errors = fieldState
|
|
2753
|
+
const errors = (_a = fieldState === null || fieldState === void 0 ? void 0 : fieldState.errors) !== null && _a !== void 0 ? _a : [];
|
|
2657
2754
|
const invalid = errors.length > 0;
|
|
2658
2755
|
const errorId = `${props.name}-error`;
|
|
2659
2756
|
const listboxId = `${props.name}-virtual-listbox`;
|
|
2660
2757
|
const labelId = `${props.name}-label`;
|
|
2661
|
-
const interactivity = resolveFieldInteractivity(formInteractivity, props.disabled, props.readOnly
|
|
2758
|
+
const interactivity = resolveFieldInteractivity(formInteractivity, props.disabled, (_b = props.readOnly) !== null && _b !== void 0 ? _b : props.readonly);
|
|
2662
2759
|
const rawValue = field.value.value;
|
|
2663
2760
|
const coreOptions = props.options.map((option) => ({
|
|
2664
2761
|
disabled: option.disabled,
|
|
@@ -2681,12 +2778,12 @@ const ClassVirtualSelect = /*#__PURE__*/ vue.defineComponent({
|
|
|
2681
2778
|
estimateSize: props.itemHeight,
|
|
2682
2779
|
overscan: props.overscan,
|
|
2683
2780
|
});
|
|
2684
|
-
const menuMaxHeight = Number.parseFloat(String(menuPosition.value.style.maxHeight
|
|
2781
|
+
const menuMaxHeight = Number.parseFloat(String((_c = menuPosition.value.style.maxHeight) !== null && _c !== void 0 ? _c : props.menuHeight));
|
|
2685
2782
|
const viewportHeight = Math.max(80, Math.min(props.menuHeight, menuMaxHeight - (props.searchable ? 52 : 12)));
|
|
2686
2783
|
const range = listController.getRange(scrollOffset.value, viewportHeight);
|
|
2687
2784
|
const displayText = selectedOptions.length > 0
|
|
2688
2785
|
? selectedOptions.map((option) => option.label).join("、")
|
|
2689
|
-
: (props.placeholder
|
|
2786
|
+
: ((_d = props.placeholder) !== null && _d !== void 0 ? _d : "Select");
|
|
2690
2787
|
const setValue = (nextValue) => {
|
|
2691
2788
|
void field.setValue(nextValue);
|
|
2692
2789
|
emit("valueChange", nextValue);
|
|
@@ -2822,6 +2919,7 @@ const ClassVirtualSelect = /*#__PURE__*/ vue.defineComponent({
|
|
|
2822
2919
|
.selectEmptyText),
|
|
2823
2920
|
]
|
|
2824
2921
|
: range.items.map((item) => {
|
|
2922
|
+
var _a, _b;
|
|
2825
2923
|
const optionIndex = filteredIndexes[item.index];
|
|
2826
2924
|
if (optionIndex === undefined)
|
|
2827
2925
|
return null;
|
|
@@ -2849,9 +2947,9 @@ const ClassVirtualSelect = /*#__PURE__*/ vue.defineComponent({
|
|
|
2849
2947
|
? vue.h("span", {
|
|
2850
2948
|
"aria-hidden": "true",
|
|
2851
2949
|
class: props.selectedIconClass,
|
|
2852
|
-
}, slots.selectedIcon
|
|
2950
|
+
}, (_b = (_a = slots.selectedIcon) === null || _a === void 0 ? void 0 : _a.call(slots, {
|
|
2853
2951
|
option,
|
|
2854
|
-
})
|
|
2952
|
+
})) !== null && _b !== void 0 ? _b : props.selectedIcon)
|
|
2855
2953
|
: null,
|
|
2856
2954
|
]);
|
|
2857
2955
|
})),
|
|
@@ -2863,7 +2961,7 @@ const ClassVirtualSelect = /*#__PURE__*/ vue.defineComponent({
|
|
|
2863
2961
|
type: "hidden",
|
|
2864
2962
|
value: props.multiple
|
|
2865
2963
|
? selectState.selectedValues.join(",")
|
|
2866
|
-
: String(rawValue
|
|
2964
|
+
: String(rawValue !== null && rawValue !== void 0 ? rawValue : ""),
|
|
2867
2965
|
}),
|
|
2868
2966
|
]),
|
|
2869
2967
|
renderError(errors, errorId),
|
|
@@ -2908,12 +3006,13 @@ const ClassRadioGroup = /*#__PURE__*/ vue.defineComponent({
|
|
|
2908
3006
|
rules: props.rules,
|
|
2909
3007
|
});
|
|
2910
3008
|
return () => {
|
|
3009
|
+
var _a, _b;
|
|
2911
3010
|
const fieldState = props.name
|
|
2912
3011
|
? field.state.value.fields[props.name]
|
|
2913
3012
|
: undefined;
|
|
2914
|
-
const errors = fieldState
|
|
3013
|
+
const errors = (_a = fieldState === null || fieldState === void 0 ? void 0 : fieldState.errors) !== null && _a !== void 0 ? _a : [];
|
|
2915
3014
|
const errorId = `${props.name}-error`;
|
|
2916
|
-
const interactivity = resolveFieldInteractivity(formInteractivity, props.disabled, props.readOnly
|
|
3015
|
+
const interactivity = resolveFieldInteractivity(formInteractivity, props.disabled, (_b = props.readOnly) !== null && _b !== void 0 ? _b : props.readonly);
|
|
2917
3016
|
return vue.h("fieldset", {
|
|
2918
3017
|
...attrs,
|
|
2919
3018
|
"aria-readonly": interactivity.readOnly || undefined,
|
|
@@ -2976,12 +3075,13 @@ const ClassCheckbox = /*#__PURE__*/ vue.defineComponent({
|
|
|
2976
3075
|
rules: props.rules,
|
|
2977
3076
|
});
|
|
2978
3077
|
return () => {
|
|
3078
|
+
var _a, _b;
|
|
2979
3079
|
const fieldState = props.name
|
|
2980
3080
|
? field.state.value.fields[props.name]
|
|
2981
3081
|
: undefined;
|
|
2982
|
-
const errors = fieldState
|
|
3082
|
+
const errors = (_a = fieldState === null || fieldState === void 0 ? void 0 : fieldState.errors) !== null && _a !== void 0 ? _a : [];
|
|
2983
3083
|
const errorId = `${props.name}-error`;
|
|
2984
|
-
const interactivity = resolveFieldInteractivity(formInteractivity, props.disabled, props.readOnly
|
|
3084
|
+
const interactivity = resolveFieldInteractivity(formInteractivity, props.disabled, (_b = props.readOnly) !== null && _b !== void 0 ? _b : props.readonly);
|
|
2985
3085
|
return vue.h("label", {
|
|
2986
3086
|
class: props.fieldClass,
|
|
2987
3087
|
"data-disabled": interactivity.disabled,
|
|
@@ -3053,12 +3153,13 @@ const ClassSwitch = /*#__PURE__*/ vue.defineComponent({
|
|
|
3053
3153
|
rules: props.rules,
|
|
3054
3154
|
});
|
|
3055
3155
|
return () => {
|
|
3156
|
+
var _a, _b;
|
|
3056
3157
|
const fieldState = props.name
|
|
3057
3158
|
? field.state.value.fields[props.name]
|
|
3058
3159
|
: undefined;
|
|
3059
|
-
const errors = fieldState
|
|
3160
|
+
const errors = (_a = fieldState === null || fieldState === void 0 ? void 0 : fieldState.errors) !== null && _a !== void 0 ? _a : [];
|
|
3060
3161
|
const errorId = `${props.name}-error`;
|
|
3061
|
-
const interactivity = resolveFieldInteractivity(formInteractivity, props.disabled, props.readOnly
|
|
3162
|
+
const interactivity = resolveFieldInteractivity(formInteractivity, props.disabled, (_b = props.readOnly) !== null && _b !== void 0 ? _b : props.readonly);
|
|
3062
3163
|
return vue.h("label", {
|
|
3063
3164
|
class: props.fieldClass,
|
|
3064
3165
|
"data-disabled": interactivity.disabled,
|
|
@@ -3141,13 +3242,14 @@ const ClassRating = /*#__PURE__*/ vue.defineComponent({
|
|
|
3141
3242
|
rules: props.rules,
|
|
3142
3243
|
});
|
|
3143
3244
|
return () => {
|
|
3245
|
+
var _a, _b, _c;
|
|
3144
3246
|
const fieldState = props.name
|
|
3145
3247
|
? field.state.value.fields[props.name]
|
|
3146
3248
|
: undefined;
|
|
3147
|
-
const errors = fieldState
|
|
3249
|
+
const errors = (_a = fieldState === null || fieldState === void 0 ? void 0 : fieldState.errors) !== null && _a !== void 0 ? _a : [];
|
|
3148
3250
|
const errorId = `${props.name}-error`;
|
|
3149
3251
|
const value = Number(field.value.value) || 0;
|
|
3150
|
-
const interactivity = resolveFieldInteractivity(formInteractivity, props.disabled, props.readOnly
|
|
3252
|
+
const interactivity = resolveFieldInteractivity(formInteractivity, props.disabled, (_b = props.readOnly) !== null && _b !== void 0 ? _b : props.readonly);
|
|
3151
3253
|
return vue.h("fieldset", {
|
|
3152
3254
|
...attrs,
|
|
3153
3255
|
"aria-readonly": interactivity.readOnly || undefined,
|
|
@@ -3161,13 +3263,14 @@ const ClassRating = /*#__PURE__*/ vue.defineComponent({
|
|
|
3161
3263
|
vue.h("div", {
|
|
3162
3264
|
class: props.starsClass,
|
|
3163
3265
|
role: "radiogroup",
|
|
3164
|
-
"aria-label": props.label
|
|
3266
|
+
"aria-label": (_c = props.label) !== null && _c !== void 0 ? _c : props.name,
|
|
3165
3267
|
}, Array.from({ length: props.max }, (_, index) => {
|
|
3268
|
+
var _a, _b, _c, _d;
|
|
3166
3269
|
const starValue = index + 1;
|
|
3167
3270
|
const active = starValue <= value;
|
|
3168
3271
|
return vue.h("button", {
|
|
3169
3272
|
"aria-checked": value === starValue,
|
|
3170
|
-
"aria-label": props.starLabel
|
|
3273
|
+
"aria-label": (_b = (_a = props.starLabel) === null || _a === void 0 ? void 0 : _a.call(props, starValue)) !== null && _b !== void 0 ? _b : `${starValue} star`,
|
|
3171
3274
|
class: props.starClass,
|
|
3172
3275
|
"data-active": active,
|
|
3173
3276
|
"data-readonly": interactivity.readOnly,
|
|
@@ -3181,7 +3284,7 @@ const ClassRating = /*#__PURE__*/ vue.defineComponent({
|
|
|
3181
3284
|
return;
|
|
3182
3285
|
void field.setValue(starValue);
|
|
3183
3286
|
},
|
|
3184
|
-
}, slots.icon
|
|
3287
|
+
}, (_d = (_c = slots.icon) === null || _c === void 0 ? void 0 : _c.call(slots, { active, value: starValue })) !== null && _d !== void 0 ? _d : props.icon);
|
|
3185
3288
|
})),
|
|
3186
3289
|
renderError(errors, errorId),
|
|
3187
3290
|
]);
|
|
@@ -3295,7 +3398,10 @@ const ClassCountdown = /*#__PURE__*/ vue.defineComponent({
|
|
|
3295
3398
|
start();
|
|
3296
3399
|
}, { immediate: true });
|
|
3297
3400
|
vue.onBeforeUnmount(stop);
|
|
3298
|
-
return () =>
|
|
3401
|
+
return () => {
|
|
3402
|
+
var _a, _b;
|
|
3403
|
+
return vue.h("span", { ...attrs, class: props.className, "data-done": state.value.done }, (_b = (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots, state.value)) !== null && _b !== void 0 ? _b : state.value.display);
|
|
3404
|
+
};
|
|
3299
3405
|
},
|
|
3300
3406
|
});
|
|
3301
3407
|
const ClassCalendar = /*#__PURE__*/ vue.defineComponent({
|
|
@@ -3323,17 +3429,19 @@ const ClassCalendar = /*#__PURE__*/ vue.defineComponent({
|
|
|
3323
3429
|
},
|
|
3324
3430
|
emits: ["change", "update:value"],
|
|
3325
3431
|
setup(props, { attrs, emit }) {
|
|
3432
|
+
var _a;
|
|
3326
3433
|
const controller = new core.CalendarController({
|
|
3327
3434
|
max: props.max,
|
|
3328
3435
|
min: props.min,
|
|
3329
|
-
value: props.value
|
|
3436
|
+
value: (_a = props.value) !== null && _a !== void 0 ? _a : props.defaultValue,
|
|
3330
3437
|
});
|
|
3331
3438
|
const state = vue.ref(controller.getState());
|
|
3332
3439
|
vue.watch(() => [props.value, props.max, props.min], () => {
|
|
3440
|
+
var _a;
|
|
3333
3441
|
state.value = controller.updateOptions({
|
|
3334
3442
|
max: props.max,
|
|
3335
3443
|
min: props.min,
|
|
3336
|
-
value: props.value
|
|
3444
|
+
value: (_a = props.value) !== null && _a !== void 0 ? _a : state.value.value,
|
|
3337
3445
|
});
|
|
3338
3446
|
});
|
|
3339
3447
|
const commit = (value) => {
|
|
@@ -3490,22 +3598,23 @@ const ClassTypewriterText = /*#__PURE__*/ vue.defineComponent({
|
|
|
3490
3598
|
});
|
|
3491
3599
|
vue.onMounted(schedule);
|
|
3492
3600
|
vue.onBeforeUnmount(clearTimers);
|
|
3493
|
-
return () =>
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
vue.h("span", { "aria-hidden": "true", class: props.cursorClass }))
|
|
3507
|
-
|
|
3508
|
-
|
|
3601
|
+
return () => {
|
|
3602
|
+
var _a, _b, _c, _d, _e;
|
|
3603
|
+
return vue.h("span", {
|
|
3604
|
+
...attrs,
|
|
3605
|
+
"aria-label": (_a = attrs["aria-label"]) !== null && _a !== void 0 ? _a : props.text,
|
|
3606
|
+
class: props.className,
|
|
3607
|
+
"data-done": state.value.done,
|
|
3608
|
+
}, [
|
|
3609
|
+
vue.h("span", { class: "cc-typewriter-text__content" }, state.value.displayedText),
|
|
3610
|
+
state.value.loading
|
|
3611
|
+
? ((_c = (_b = slots.loading) === null || _b === void 0 ? void 0 : _b.call(slots)) !== null && _c !== void 0 ? _c : vue.h("span", { "aria-hidden": "true", class: props.loadingClass }))
|
|
3612
|
+
: null,
|
|
3613
|
+
state.value.cursor
|
|
3614
|
+
? ((_e = (_d = slots.cursor) === null || _d === void 0 ? void 0 : _d.call(slots)) !== null && _e !== void 0 ? _e : vue.h("span", { "aria-hidden": "true", class: props.cursorClass }))
|
|
3615
|
+
: null,
|
|
3616
|
+
]);
|
|
3617
|
+
};
|
|
3509
3618
|
},
|
|
3510
3619
|
});
|
|
3511
3620
|
const ClassDesignEffect = /*#__PURE__*/ vue.defineComponent({
|
|
@@ -3544,6 +3653,7 @@ const ClassDesignEffect = /*#__PURE__*/ vue.defineComponent({
|
|
|
3544
3653
|
},
|
|
3545
3654
|
setup(props, { attrs, slots }) {
|
|
3546
3655
|
return () => {
|
|
3656
|
+
var _a;
|
|
3547
3657
|
const state = new core.DesignEffectController({
|
|
3548
3658
|
animated: props.animated,
|
|
3549
3659
|
colors: props.colors,
|
|
@@ -3569,7 +3679,7 @@ const ClassDesignEffect = /*#__PURE__*/ vue.defineComponent({
|
|
|
3569
3679
|
state.overlay
|
|
3570
3680
|
? vue.h("span", { "aria-hidden": "true", class: props.overlayClass })
|
|
3571
3681
|
: null,
|
|
3572
|
-
vue.h("div", { class: props.contentClass }, slots.default
|
|
3682
|
+
vue.h("div", { class: props.contentClass }, (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots)),
|
|
3573
3683
|
]);
|
|
3574
3684
|
};
|
|
3575
3685
|
},
|
|
@@ -3596,6 +3706,7 @@ const ClassGradientText = /*#__PURE__*/ vue.defineComponent({
|
|
|
3596
3706
|
},
|
|
3597
3707
|
setup(props, { attrs, slots }) {
|
|
3598
3708
|
return () => {
|
|
3709
|
+
var _a, _b;
|
|
3599
3710
|
const controller = new core.GradientTextController({
|
|
3600
3711
|
animated: props.animated,
|
|
3601
3712
|
backgroundSize: props.backgroundSize,
|
|
@@ -3618,7 +3729,7 @@ const ClassGradientText = /*#__PURE__*/ vue.defineComponent({
|
|
|
3618
3729
|
"--cc-gradient-text-easing": state.easing,
|
|
3619
3730
|
"--cc-gradient-text-font-weight": state.fontWeight,
|
|
3620
3731
|
},
|
|
3621
|
-
}, slots.default
|
|
3732
|
+
}, (_b = (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots)) !== null && _b !== void 0 ? _b : state.text);
|
|
3622
3733
|
};
|
|
3623
3734
|
},
|
|
3624
3735
|
});
|
|
@@ -3664,7 +3775,7 @@ const ClassLazyImage = /*#__PURE__*/ vue.defineComponent({
|
|
|
3664
3775
|
const state = vue.shallowRef(controller.getState());
|
|
3665
3776
|
let observer;
|
|
3666
3777
|
const disconnect = () => {
|
|
3667
|
-
observer
|
|
3778
|
+
observer === null || observer === void 0 ? void 0 : observer.disconnect();
|
|
3668
3779
|
observer = undefined;
|
|
3669
3780
|
};
|
|
3670
3781
|
const startLoading = () => {
|
|
@@ -3712,6 +3823,7 @@ const ClassLazyImage = /*#__PURE__*/ vue.defineComponent({
|
|
|
3712
3823
|
vue.onMounted(setupObserver);
|
|
3713
3824
|
vue.onBeforeUnmount(disconnect);
|
|
3714
3825
|
return () => {
|
|
3826
|
+
var _a, _b, _c, _d;
|
|
3715
3827
|
const current = state.value;
|
|
3716
3828
|
const slotState = { status: current.status };
|
|
3717
3829
|
return vue.h("div", {
|
|
@@ -3748,23 +3860,22 @@ const ClassLazyImage = /*#__PURE__*/ vue.defineComponent({
|
|
|
3748
3860
|
(current.status === "idle" || current.status === "loading") &&
|
|
3749
3861
|
(props.loadingVariant !== "none" || Boolean(slots.placeholder))
|
|
3750
3862
|
? vue.h("span", { class: props.placeholderClass }, [
|
|
3751
|
-
slots.placeholder
|
|
3752
|
-
(
|
|
3753
|
-
|
|
3754
|
-
|
|
3863
|
+
(_b = (_a = slots.placeholder) === null || _a === void 0 ? void 0 : _a.call(slots, slotState)) !== null && _b !== void 0 ? _b : (props.loadingVariant === "image" && current.placeholderSrc
|
|
3864
|
+
? vue.h("img", {
|
|
3865
|
+
alt: "",
|
|
3866
|
+
"aria-hidden": "true",
|
|
3867
|
+
src: current.placeholderSrc,
|
|
3868
|
+
})
|
|
3869
|
+
: props.loadingVariant === "skeleton"
|
|
3870
|
+
? vue.h("span", {
|
|
3755
3871
|
"aria-hidden": "true",
|
|
3756
|
-
|
|
3872
|
+
class: props.skeletonClass,
|
|
3757
3873
|
})
|
|
3758
|
-
:
|
|
3759
|
-
? vue.h("span", {
|
|
3760
|
-
"aria-hidden": "true",
|
|
3761
|
-
class: props.skeletonClass,
|
|
3762
|
-
})
|
|
3763
|
-
: null),
|
|
3874
|
+
: null),
|
|
3764
3875
|
])
|
|
3765
3876
|
: null,
|
|
3766
3877
|
current.status === "error"
|
|
3767
|
-
? vue.h("span", { class: props.errorClass }, slots.error
|
|
3878
|
+
? vue.h("span", { class: props.errorClass }, (_d = (_c = slots.error) === null || _c === void 0 ? void 0 : _c.call(slots, slotState)) !== null && _d !== void 0 ? _d : "Image unavailable")
|
|
3768
3879
|
: null,
|
|
3769
3880
|
]);
|
|
3770
3881
|
};
|
|
@@ -3833,12 +3944,13 @@ const ClassTiltCard = /*#__PURE__*/ vue.defineComponent({
|
|
|
3833
3944
|
});
|
|
3834
3945
|
});
|
|
3835
3946
|
const syncRect = (event) => {
|
|
3947
|
+
var _a, _b, _c;
|
|
3836
3948
|
if (event) {
|
|
3837
|
-
callEventHandler(attrs.onPointerenter
|
|
3949
|
+
callEventHandler((_a = attrs.onPointerenter) !== null && _a !== void 0 ? _a : attrs.onPointerEnter, event);
|
|
3838
3950
|
if (event.defaultPrevented)
|
|
3839
3951
|
return;
|
|
3840
3952
|
}
|
|
3841
|
-
rect = rootRef.value
|
|
3953
|
+
rect = (_c = (_b = rootRef.value) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect()) !== null && _c !== void 0 ? _c : null;
|
|
3842
3954
|
if (!event || props.disabled || !rect)
|
|
3843
3955
|
return;
|
|
3844
3956
|
useEnterTransition = true;
|
|
@@ -3851,12 +3963,13 @@ const ClassTiltCard = /*#__PURE__*/ vue.defineComponent({
|
|
|
3851
3963
|
});
|
|
3852
3964
|
};
|
|
3853
3965
|
const handlePointerMove = (event) => {
|
|
3854
|
-
|
|
3966
|
+
var _a, _b, _c;
|
|
3967
|
+
callEventHandler((_a = attrs.onPointermove) !== null && _a !== void 0 ? _a : attrs.onPointerMove, event);
|
|
3855
3968
|
if (event.defaultPrevented)
|
|
3856
3969
|
return;
|
|
3857
3970
|
if (props.disabled)
|
|
3858
3971
|
return;
|
|
3859
|
-
rect = rect
|
|
3972
|
+
rect = (_c = rect !== null && rect !== void 0 ? rect : (_b = rootRef.value) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect()) !== null && _c !== void 0 ? _c : null;
|
|
3860
3973
|
if (!rect)
|
|
3861
3974
|
return;
|
|
3862
3975
|
pendingPoint = {
|
|
@@ -3881,7 +3994,8 @@ const ClassTiltCard = /*#__PURE__*/ vue.defineComponent({
|
|
|
3881
3994
|
});
|
|
3882
3995
|
};
|
|
3883
3996
|
const handlePointerLeave = (event) => {
|
|
3884
|
-
|
|
3997
|
+
var _a;
|
|
3998
|
+
callEventHandler((_a = attrs.onPointerleave) !== null && _a !== void 0 ? _a : attrs.onPointerLeave, event);
|
|
3885
3999
|
if (event.defaultPrevented)
|
|
3886
4000
|
return;
|
|
3887
4001
|
rect = null;
|
|
@@ -3897,34 +4011,37 @@ const ClassTiltCard = /*#__PURE__*/ vue.defineComponent({
|
|
|
3897
4011
|
if (frame !== undefined)
|
|
3898
4012
|
window.cancelAnimationFrame(frame);
|
|
3899
4013
|
});
|
|
3900
|
-
return () =>
|
|
3901
|
-
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
|
|
3917
|
-
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
|
|
3923
|
-
|
|
3924
|
-
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
|
|
4014
|
+
return () => {
|
|
4015
|
+
var _a;
|
|
4016
|
+
return vue.h("div", {
|
|
4017
|
+
...attrs,
|
|
4018
|
+
class: [props.className, attrs.class],
|
|
4019
|
+
"data-active": state.value.isActive,
|
|
4020
|
+
"data-disabled": props.disabled,
|
|
4021
|
+
onPointerenter: syncRect,
|
|
4022
|
+
onPointerleave: handlePointerLeave,
|
|
4023
|
+
onPointermove: handlePointerMove,
|
|
4024
|
+
ref: rootRef,
|
|
4025
|
+
style: [
|
|
4026
|
+
attrs.style,
|
|
4027
|
+
{
|
|
4028
|
+
"--cc-tilt-card-glare-opacity": String(state.value.glareOpacity),
|
|
4029
|
+
"--cc-tilt-card-glare-x": `${state.value.glareX}%`,
|
|
4030
|
+
"--cc-tilt-card-glare-y": `${state.value.glareY}%`,
|
|
4031
|
+
"--cc-tilt-card-transition-easing": state.value.transitionEasing,
|
|
4032
|
+
"--cc-tilt-card-transition-duration": `${state.value.transitionDuration}ms`,
|
|
4033
|
+
"--cc-tilt-card-transform": state.value.transform,
|
|
4034
|
+
},
|
|
4035
|
+
],
|
|
4036
|
+
}, [
|
|
4037
|
+
vue.h("div", { class: props.surfaceClass }, [
|
|
4038
|
+
vue.h("div", { class: props.contentClass }, (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots)),
|
|
4039
|
+
state.value.glare
|
|
4040
|
+
? vue.h("span", { "aria-hidden": "true", class: props.glareClass })
|
|
4041
|
+
: null,
|
|
4042
|
+
]),
|
|
4043
|
+
]);
|
|
4044
|
+
};
|
|
3928
4045
|
},
|
|
3929
4046
|
});
|
|
3930
4047
|
const ClassOrbitalSphere = /*#__PURE__*/ vue.defineComponent({
|
|
@@ -3979,23 +4096,26 @@ const ClassOrbitalSphere = /*#__PURE__*/ vue.defineComponent({
|
|
|
3979
4096
|
style: [state.styleVars, attrs.style],
|
|
3980
4097
|
}, [
|
|
3981
4098
|
vue.h("span", { "aria-hidden": "true", class: props.shellClass }),
|
|
3982
|
-
vue.h("div", { class: props.stageClass }, state.items.map((item) =>
|
|
3983
|
-
|
|
3984
|
-
|
|
3985
|
-
|
|
3986
|
-
|
|
3987
|
-
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
|
|
3995
|
-
|
|
3996
|
-
|
|
3997
|
-
|
|
3998
|
-
|
|
4099
|
+
vue.h("div", { class: props.stageClass }, state.items.map((item) => {
|
|
4100
|
+
var _a, _b;
|
|
4101
|
+
return vue.h("button", {
|
|
4102
|
+
"aria-label": item.label,
|
|
4103
|
+
class: props.itemClass,
|
|
4104
|
+
"data-tone": item.tone,
|
|
4105
|
+
disabled: state.disabled,
|
|
4106
|
+
key: item.id,
|
|
4107
|
+
onClick: (event) => emit("item-click", item, event),
|
|
4108
|
+
style: [
|
|
4109
|
+
{
|
|
4110
|
+
"--cc-orbital-index": item.index,
|
|
4111
|
+
},
|
|
4112
|
+
item.styleVars,
|
|
4113
|
+
],
|
|
4114
|
+
type: "button",
|
|
4115
|
+
}, [
|
|
4116
|
+
vue.h("span", { class: props.itemContentClass }, (_b = (_a = slots.item) === null || _a === void 0 ? void 0 : _a.call(slots, { index: item.index, item })) !== null && _b !== void 0 ? _b : item.content),
|
|
4117
|
+
]);
|
|
4118
|
+
})),
|
|
3999
4119
|
]);
|
|
4000
4120
|
};
|
|
4001
4121
|
},
|
|
@@ -4026,7 +4146,8 @@ const ClassHeightTransition = /*#__PURE__*/ vue.defineComponent({
|
|
|
4026
4146
|
const state = vue.ref(controller.getState());
|
|
4027
4147
|
let observer;
|
|
4028
4148
|
const measure = () => {
|
|
4029
|
-
|
|
4149
|
+
var _a, _b;
|
|
4150
|
+
height.value = (_b = (_a = contentRef.value) === null || _a === void 0 ? void 0 : _a.scrollHeight) !== null && _b !== void 0 ? _b : 0;
|
|
4030
4151
|
};
|
|
4031
4152
|
vue.watch(() => [props.duration, props.easing, props.expanded, props.mode], () => {
|
|
4032
4153
|
state.value = controller.update({
|
|
@@ -4044,23 +4165,129 @@ const ClassHeightTransition = /*#__PURE__*/ vue.defineComponent({
|
|
|
4044
4165
|
observer.observe(contentRef.value);
|
|
4045
4166
|
}
|
|
4046
4167
|
});
|
|
4047
|
-
vue.onBeforeUnmount(() => observer
|
|
4048
|
-
return () =>
|
|
4049
|
-
|
|
4050
|
-
|
|
4051
|
-
|
|
4052
|
-
|
|
4053
|
-
|
|
4054
|
-
|
|
4055
|
-
|
|
4056
|
-
|
|
4057
|
-
|
|
4058
|
-
|
|
4059
|
-
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
|
|
4168
|
+
vue.onBeforeUnmount(() => observer === null || observer === void 0 ? void 0 : observer.disconnect());
|
|
4169
|
+
return () => {
|
|
4170
|
+
var _a;
|
|
4171
|
+
return vue.h("div", {
|
|
4172
|
+
...attrs,
|
|
4173
|
+
class: props.className,
|
|
4174
|
+
"data-expanded": state.value.expanded,
|
|
4175
|
+
"data-mode": state.value.mode,
|
|
4176
|
+
style: [
|
|
4177
|
+
attrs.style,
|
|
4178
|
+
{
|
|
4179
|
+
"--cc-height-transition-duration": `${state.value.duration}ms`,
|
|
4180
|
+
"--cc-height-transition-easing": state.value.easing,
|
|
4181
|
+
"--cc-height-transition-height": `${height.value}px`,
|
|
4182
|
+
},
|
|
4183
|
+
],
|
|
4184
|
+
}, [
|
|
4185
|
+
vue.h("div", { ref: contentRef, class: props.contentClass }, (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots)),
|
|
4186
|
+
]);
|
|
4187
|
+
};
|
|
4188
|
+
},
|
|
4189
|
+
});
|
|
4190
|
+
const ClassWidthTransition = /*#__PURE__*/ vue.defineComponent({
|
|
4191
|
+
name: "ClassWidthTransition",
|
|
4192
|
+
inheritAttrs: false,
|
|
4193
|
+
props: {
|
|
4194
|
+
className: { type: String, default: "cc-width-transition" },
|
|
4195
|
+
contentClass: { type: String, default: "cc-width-transition__content" },
|
|
4196
|
+
duration: { type: Number, default: 220 },
|
|
4197
|
+
easing: { type: String, default: "cubic-bezier(0.22, 0.8, 0.28, 1)" },
|
|
4198
|
+
expanded: { type: Boolean, default: false },
|
|
4199
|
+
mode: {
|
|
4200
|
+
type: String,
|
|
4201
|
+
default: "auto",
|
|
4202
|
+
},
|
|
4203
|
+
},
|
|
4204
|
+
setup(props, { attrs, slots }) {
|
|
4205
|
+
const contentRef = vue.ref(null);
|
|
4206
|
+
const width = vue.ref(0);
|
|
4207
|
+
const controller = new core.WidthTransitionController({
|
|
4208
|
+
duration: props.duration,
|
|
4209
|
+
easing: props.easing,
|
|
4210
|
+
expanded: props.expanded,
|
|
4211
|
+
mode: props.mode,
|
|
4212
|
+
});
|
|
4213
|
+
const state = vue.ref(controller.getState());
|
|
4214
|
+
let observer;
|
|
4215
|
+
const measure = () => {
|
|
4216
|
+
var _a, _b;
|
|
4217
|
+
width.value = (_b = (_a = contentRef.value) === null || _a === void 0 ? void 0 : _a.scrollWidth) !== null && _b !== void 0 ? _b : 0;
|
|
4218
|
+
};
|
|
4219
|
+
vue.watch(() => [props.duration, props.easing, props.expanded, props.mode], () => {
|
|
4220
|
+
state.value = controller.update({
|
|
4221
|
+
duration: props.duration,
|
|
4222
|
+
easing: props.easing,
|
|
4223
|
+
expanded: props.expanded,
|
|
4224
|
+
mode: props.mode,
|
|
4225
|
+
});
|
|
4226
|
+
vue.nextTick(measure);
|
|
4227
|
+
}, { immediate: true });
|
|
4228
|
+
vue.onMounted(() => {
|
|
4229
|
+
measure();
|
|
4230
|
+
if (typeof ResizeObserver !== "undefined" && contentRef.value) {
|
|
4231
|
+
observer = new ResizeObserver(measure);
|
|
4232
|
+
observer.observe(contentRef.value);
|
|
4233
|
+
}
|
|
4234
|
+
});
|
|
4235
|
+
vue.onBeforeUnmount(() => observer === null || observer === void 0 ? void 0 : observer.disconnect());
|
|
4236
|
+
return () => {
|
|
4237
|
+
var _a;
|
|
4238
|
+
return vue.h("div", {
|
|
4239
|
+
...attrs,
|
|
4240
|
+
class: props.className,
|
|
4241
|
+
"data-expanded": state.value.expanded,
|
|
4242
|
+
"data-mode": state.value.mode,
|
|
4243
|
+
style: [
|
|
4244
|
+
attrs.style,
|
|
4245
|
+
{
|
|
4246
|
+
"--cc-width-transition-duration": `${state.value.duration}ms`,
|
|
4247
|
+
"--cc-width-transition-easing": state.value.easing,
|
|
4248
|
+
"--cc-width-transition-width": `${width.value}px`,
|
|
4249
|
+
},
|
|
4250
|
+
],
|
|
4251
|
+
}, [
|
|
4252
|
+
vue.h("div", { ref: contentRef, class: props.contentClass }, (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots)),
|
|
4253
|
+
]);
|
|
4254
|
+
};
|
|
4255
|
+
},
|
|
4256
|
+
});
|
|
4257
|
+
const ClassThemeBox = /*#__PURE__*/ vue.defineComponent({
|
|
4258
|
+
name: "ClassThemeBox",
|
|
4259
|
+
inheritAttrs: false,
|
|
4260
|
+
props: {
|
|
4261
|
+
className: { type: String, default: "" },
|
|
4262
|
+
radius: { type: String, default: undefined },
|
|
4263
|
+
size: { type: String, default: "md" },
|
|
4264
|
+
theme: {
|
|
4265
|
+
type: [String, Object],
|
|
4266
|
+
default: undefined,
|
|
4267
|
+
},
|
|
4268
|
+
variant: { type: String, default: "surface" },
|
|
4269
|
+
},
|
|
4270
|
+
setup(props, { attrs, slots }) {
|
|
4271
|
+
const state = vue.computed(() => new core.ThemeBoxController({
|
|
4272
|
+
radius: props.radius,
|
|
4273
|
+
size: props.size,
|
|
4274
|
+
theme: resolveClassKitThemeName(props.theme),
|
|
4275
|
+
variant: props.variant,
|
|
4276
|
+
}).getState());
|
|
4277
|
+
return () => {
|
|
4278
|
+
var _a;
|
|
4279
|
+
return vue.h("div", {
|
|
4280
|
+
...attrs,
|
|
4281
|
+
class: ["cc-theme-box", props.className, attrs.class].filter(Boolean),
|
|
4282
|
+
"data-cc-theme": state.value.theme,
|
|
4283
|
+
"data-size": state.value.size,
|
|
4284
|
+
"data-variant": state.value.variant,
|
|
4285
|
+
style: [
|
|
4286
|
+
attrs.style,
|
|
4287
|
+
{ "--cc-theme-box-radius": state.value.radius },
|
|
4288
|
+
],
|
|
4289
|
+
}, (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots));
|
|
4290
|
+
};
|
|
4064
4291
|
},
|
|
4065
4292
|
});
|
|
4066
4293
|
const ClassCodePreview = /*#__PURE__*/ vue.defineComponent({
|
|
@@ -4109,7 +4336,8 @@ const ClassCodePreview = /*#__PURE__*/ vue.defineComponent({
|
|
|
4109
4336
|
});
|
|
4110
4337
|
};
|
|
4111
4338
|
const resolvePlacement = (estimate = false) => {
|
|
4112
|
-
|
|
4339
|
+
var _a, _b, _c, _d;
|
|
4340
|
+
const rect = (_a = rootRef.value) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
4113
4341
|
const panel = panelRef.value;
|
|
4114
4342
|
if (!rect || (!panel && !estimate) || typeof window === "undefined")
|
|
4115
4343
|
return;
|
|
@@ -4120,10 +4348,10 @@ const ClassCodePreview = /*#__PURE__*/ vue.defineComponent({
|
|
|
4120
4348
|
const maxPanelHeight = Math.max(160, viewportHeight - padding * 2);
|
|
4121
4349
|
const maxPanelWidth = Math.max(160, viewportWidth - padding * 2);
|
|
4122
4350
|
const minPanelHeight = Math.min(160, maxPanelHeight);
|
|
4123
|
-
const panelContent = panel
|
|
4124
|
-
const measuredPanelHeight = Math.max(panel
|
|
4351
|
+
const panelContent = panel === null || panel === void 0 ? void 0 : panel.querySelector("pre");
|
|
4352
|
+
const measuredPanelHeight = Math.max((_b = panel === null || panel === void 0 ? void 0 : panel.offsetHeight) !== null && _b !== void 0 ? _b : 0, (_c = panel === null || panel === void 0 ? void 0 : panel.scrollHeight) !== null && _c !== void 0 ? _c : 0, (_d = panelContent === null || panelContent === void 0 ? void 0 : panelContent.scrollHeight) !== null && _d !== void 0 ? _d : 0, estimate ? 420 : 0);
|
|
4125
4353
|
const preferredPanelHeight = Math.min(Math.max(160, measuredPanelHeight || 420), maxPanelHeight);
|
|
4126
|
-
const panelWidth = Math.min(Math.max(rect.width, panel
|
|
4354
|
+
const panelWidth = Math.min(Math.max(rect.width, (panel === null || panel === void 0 ? void 0 : panel.offsetWidth) || 720), maxPanelWidth);
|
|
4127
4355
|
const availableBelow = Math.max(minPanelHeight, viewportHeight - rect.bottom - gap - padding);
|
|
4128
4356
|
const availableAbove = Math.max(minPanelHeight, rect.top - gap - padding);
|
|
4129
4357
|
const placementHeight = Math.min(preferredPanelHeight, Math.max(availableBelow, availableAbove));
|
|
@@ -4178,9 +4406,7 @@ const ClassCodePreview = /*#__PURE__*/ vue.defineComponent({
|
|
|
4178
4406
|
};
|
|
4179
4407
|
const resolvePlacementFromViewport = () => resolvePlacement();
|
|
4180
4408
|
const copy = async () => {
|
|
4181
|
-
|
|
4182
|
-
await navigator.clipboard?.writeText(props.code);
|
|
4183
|
-
}
|
|
4409
|
+
await writeClipboardText(props.code);
|
|
4184
4410
|
state.value = controller.copied();
|
|
4185
4411
|
emit("copy", props.code);
|
|
4186
4412
|
window.clearTimeout(resetTimer);
|
|
@@ -4201,10 +4427,11 @@ const ClassCodePreview = /*#__PURE__*/ vue.defineComponent({
|
|
|
4201
4427
|
state.value = controller.close();
|
|
4202
4428
|
};
|
|
4203
4429
|
const closeOnOutside = (event) => {
|
|
4430
|
+
var _a, _b;
|
|
4204
4431
|
const target = event.target;
|
|
4205
4432
|
if (target &&
|
|
4206
|
-
(rootRef.value
|
|
4207
|
-
panelRef.value
|
|
4433
|
+
(((_a = rootRef.value) === null || _a === void 0 ? void 0 : _a.contains(target)) ||
|
|
4434
|
+
((_b = panelRef.value) === null || _b === void 0 ? void 0 : _b.contains(target))))
|
|
4208
4435
|
return;
|
|
4209
4436
|
close();
|
|
4210
4437
|
};
|
|
@@ -4230,6 +4457,7 @@ const ClassCodePreview = /*#__PURE__*/ vue.defineComponent({
|
|
|
4230
4457
|
window.removeEventListener("scroll", resolvePlacementFromViewport, true);
|
|
4231
4458
|
});
|
|
4232
4459
|
return () => {
|
|
4460
|
+
var _a, _b;
|
|
4233
4461
|
const panel = vue.h("div", {
|
|
4234
4462
|
ref: panelRef,
|
|
4235
4463
|
class: "cc-code-preview__panel",
|
|
@@ -4260,7 +4488,7 @@ const ClassCodePreview = /*#__PURE__*/ vue.defineComponent({
|
|
|
4260
4488
|
vue.h("div", { class: "cc-code-preview__bar" }, [
|
|
4261
4489
|
vue.h("div", { class: "cc-code-preview__meta" }, [
|
|
4262
4490
|
vue.h("span", { class: "cc-code-preview__title" }, [
|
|
4263
|
-
slots.title
|
|
4491
|
+
(_b = (_a = slots.title) === null || _a === void 0 ? void 0 : _a.call(slots)) !== null && _b !== void 0 ? _b : props.title,
|
|
4264
4492
|
]),
|
|
4265
4493
|
vue.h("span", { class: "cc-code-preview__lang" }, state.value.language),
|
|
4266
4494
|
]),
|
|
@@ -4342,7 +4570,8 @@ const ClassQRCode = /*#__PURE__*/ vue.defineComponent({
|
|
|
4342
4570
|
}
|
|
4343
4571
|
}, { immediate: true });
|
|
4344
4572
|
return () => {
|
|
4345
|
-
|
|
4573
|
+
var _a, _b, _c;
|
|
4574
|
+
const logoSize = (_a = props.logoSize) !== null && _a !== void 0 ? _a : Math.round(props.size * 0.22);
|
|
4346
4575
|
return vue.h("span", {
|
|
4347
4576
|
...attrs,
|
|
4348
4577
|
"aria-label": error.value ? props.errorText : props.value,
|
|
@@ -4351,7 +4580,7 @@ const ClassQRCode = /*#__PURE__*/ vue.defineComponent({
|
|
|
4351
4580
|
style: { height: `${props.size}px`, width: `${props.size}px` },
|
|
4352
4581
|
}, [
|
|
4353
4582
|
error.value
|
|
4354
|
-
? vue.h("span", { class: "cc-code__error" }, slots.error
|
|
4583
|
+
? vue.h("span", { class: "cc-code__error" }, (_c = (_b = slots.error) === null || _b === void 0 ? void 0 : _b.call(slots, { error: error.value })) !== null && _c !== void 0 ? _c : props.errorText)
|
|
4355
4584
|
: vue.h("span", { class: "cc-qr-code__svg", innerHTML: svg.value }),
|
|
4356
4585
|
!error.value && props.logoSrc
|
|
4357
4586
|
? vue.h("span", {
|
|
@@ -4430,14 +4659,17 @@ const ClassBarcode = /*#__PURE__*/ vue.defineComponent({
|
|
|
4430
4659
|
error.value = optionalDependencyError("jsbarcode", "Barcode rendering", "window.JsBarcode", nextError);
|
|
4431
4660
|
}
|
|
4432
4661
|
}, { immediate: true });
|
|
4433
|
-
return () =>
|
|
4434
|
-
|
|
4435
|
-
"
|
|
4436
|
-
|
|
4437
|
-
|
|
4438
|
-
|
|
4439
|
-
|
|
4440
|
-
|
|
4662
|
+
return () => {
|
|
4663
|
+
var _a, _b;
|
|
4664
|
+
return vue.h("span", {
|
|
4665
|
+
...attrs,
|
|
4666
|
+
"aria-label": error.value ? props.errorText : props.value,
|
|
4667
|
+
class: props.className,
|
|
4668
|
+
role: "img",
|
|
4669
|
+
}, error.value
|
|
4670
|
+
? vue.h("span", { class: "cc-code__error" }, (_b = (_a = slots.error) === null || _a === void 0 ? void 0 : _a.call(slots, { error: error.value })) !== null && _b !== void 0 ? _b : props.errorText)
|
|
4671
|
+
: vue.h("span", { innerHTML: svg.value }));
|
|
4672
|
+
};
|
|
4441
4673
|
},
|
|
4442
4674
|
});
|
|
4443
4675
|
const ClassEllipsisText = /*#__PURE__*/ vue.defineComponent({
|
|
@@ -4507,15 +4739,17 @@ const ClassEllipsisText = /*#__PURE__*/ vue.defineComponent({
|
|
|
4507
4739
|
handler(event);
|
|
4508
4740
|
};
|
|
4509
4741
|
const toggleExpanded = () => {
|
|
4510
|
-
|
|
4742
|
+
var _a, _b;
|
|
4743
|
+
const current = (_a = props.expanded) !== null && _a !== void 0 ? _a : innerExpanded.value;
|
|
4511
4744
|
const next = !current;
|
|
4512
4745
|
if (props.expanded === undefined)
|
|
4513
4746
|
innerExpanded.value = next;
|
|
4514
|
-
props.onExpandedChange
|
|
4747
|
+
(_b = props.onExpandedChange) === null || _b === void 0 ? void 0 : _b.call(props, next);
|
|
4515
4748
|
};
|
|
4516
4749
|
return () => {
|
|
4750
|
+
var _a, _b;
|
|
4517
4751
|
const { class: attrClass, onClick, onKeydown, onKeyDown, role, style: attrStyle, tabindex, tabIndex, ...restAttrs } = attrs;
|
|
4518
|
-
const isExpanded = props.expanded
|
|
4752
|
+
const isExpanded = (_a = props.expanded) !== null && _a !== void 0 ? _a : innerExpanded.value;
|
|
4519
4753
|
const cssVars = {
|
|
4520
4754
|
"--cc-ellipsis-collapsed-height": `calc(var(--cc-ellipsis-line-height) * ${Math.max(1, Math.floor(props.lines))})`,
|
|
4521
4755
|
"--cc-ellipsis-expanded-max-height": typeof props.expandedMaxHeight === "number"
|
|
@@ -4544,7 +4778,7 @@ const ClassEllipsisText = /*#__PURE__*/ vue.defineComponent({
|
|
|
4544
4778
|
toggleExpanded();
|
|
4545
4779
|
},
|
|
4546
4780
|
onKeydown: (event) => {
|
|
4547
|
-
invokeAttrHandler(onKeydown
|
|
4781
|
+
invokeAttrHandler(onKeydown !== null && onKeydown !== void 0 ? onKeydown : onKeyDown, event);
|
|
4548
4782
|
if (!props.expandable ||
|
|
4549
4783
|
event.defaultPrevented ||
|
|
4550
4784
|
(event.key !== "Enter" && event.key !== " "))
|
|
@@ -4555,8 +4789,8 @@ const ClassEllipsisText = /*#__PURE__*/ vue.defineComponent({
|
|
|
4555
4789
|
role: props.expandable ? "button" : role,
|
|
4556
4790
|
style: [attrStyle, cssVars],
|
|
4557
4791
|
tabindex: props.expandable
|
|
4558
|
-
? (tabindex
|
|
4559
|
-
: (tabindex
|
|
4792
|
+
? ((_b = tabindex !== null && tabindex !== void 0 ? tabindex : tabIndex) !== null && _b !== void 0 ? _b : 0)
|
|
4793
|
+
: (tabindex !== null && tabindex !== void 0 ? tabindex : tabIndex),
|
|
4560
4794
|
}, [vue.h("span", { class: props.contentClass }, String(props.text))]);
|
|
4561
4795
|
};
|
|
4562
4796
|
},
|
|
@@ -4654,12 +4888,13 @@ const ClassMarquee = /*#__PURE__*/ vue.defineComponent({
|
|
|
4654
4888
|
return { "data-clickable": false };
|
|
4655
4889
|
return {
|
|
4656
4890
|
"data-clickable": true,
|
|
4657
|
-
onClick: (event) => props.onItemClick
|
|
4891
|
+
onClick: (event) => { var _a; return (_a = props.onItemClick) === null || _a === void 0 ? void 0 : _a.call(props, item, index, event); },
|
|
4658
4892
|
onKeydown: (event) => {
|
|
4893
|
+
var _a;
|
|
4659
4894
|
if (event.key !== "Enter" && event.key !== " ")
|
|
4660
4895
|
return;
|
|
4661
4896
|
event.preventDefault();
|
|
4662
|
-
props.onItemClick
|
|
4897
|
+
(_a = props.onItemClick) === null || _a === void 0 ? void 0 : _a.call(props, item, index, event);
|
|
4663
4898
|
},
|
|
4664
4899
|
role: "button",
|
|
4665
4900
|
tabindex: 0,
|
|
@@ -4668,12 +4903,16 @@ const ClassMarquee = /*#__PURE__*/ vue.defineComponent({
|
|
|
4668
4903
|
const renderGroup = (items, groupIndex) => vue.h("span", {
|
|
4669
4904
|
"aria-hidden": groupIndex > 0,
|
|
4670
4905
|
class: props.groupClass,
|
|
4671
|
-
}, items.map((item, index) =>
|
|
4672
|
-
|
|
4673
|
-
|
|
4674
|
-
|
|
4675
|
-
|
|
4906
|
+
}, items.map((item, index) => {
|
|
4907
|
+
var _a, _b;
|
|
4908
|
+
return vue.h("span", {
|
|
4909
|
+
class: props.itemClass,
|
|
4910
|
+
key: `${groupIndex}-${item.key}`,
|
|
4911
|
+
...getItemInteractiveProps(item, index),
|
|
4912
|
+
}, (_b = (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots, { index, item })) !== null && _b !== void 0 ? _b : item.text);
|
|
4913
|
+
}));
|
|
4676
4914
|
const renderStepItem = (items, index, itemClass, phase) => {
|
|
4915
|
+
var _a, _b;
|
|
4677
4916
|
const item = items[index];
|
|
4678
4917
|
if (!item)
|
|
4679
4918
|
return null;
|
|
@@ -4682,7 +4921,7 @@ const ClassMarquee = /*#__PURE__*/ vue.defineComponent({
|
|
|
4682
4921
|
"data-phase": phase,
|
|
4683
4922
|
key: `${phase}-${item.key}-${activeIndex.value}`,
|
|
4684
4923
|
...getItemInteractiveProps(item, index),
|
|
4685
|
-
}, slots.default
|
|
4924
|
+
}, (_b = (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots, { index, item })) !== null && _b !== void 0 ? _b : item.text);
|
|
4686
4925
|
};
|
|
4687
4926
|
const resolveState = () => new core.MarqueeController(props.items, {
|
|
4688
4927
|
direction: props.direction,
|
|
@@ -4735,6 +4974,7 @@ const ClassMarquee = /*#__PURE__*/ vue.defineComponent({
|
|
|
4735
4974
|
clearPreviousTimer();
|
|
4736
4975
|
});
|
|
4737
4976
|
return () => {
|
|
4977
|
+
var _a;
|
|
4738
4978
|
const state = resolveState();
|
|
4739
4979
|
const isStepMarquee = state.direction === "vertical" && state.verticalMode === "step";
|
|
4740
4980
|
return vue.h("div", {
|
|
@@ -4745,7 +4985,7 @@ const ClassMarquee = /*#__PURE__*/ vue.defineComponent({
|
|
|
4745
4985
|
"data-direction": state.direction,
|
|
4746
4986
|
"data-pause-on-hover": state.pauseOnHover,
|
|
4747
4987
|
"data-reverse": state.reverse,
|
|
4748
|
-
"data-step-animation": state.stepAnimation
|
|
4988
|
+
"data-step-animation": (_a = state.stepAnimation) !== null && _a !== void 0 ? _a : "none",
|
|
4749
4989
|
"data-vertical-mode": state.verticalMode,
|
|
4750
4990
|
role: "region",
|
|
4751
4991
|
style: {
|
|
@@ -4882,7 +5122,7 @@ const ClassVideoPlayer = /*#__PURE__*/ vue.defineComponent({
|
|
|
4882
5122
|
},
|
|
4883
5123
|
});
|
|
4884
5124
|
function resolveVideoDetailContainer(container) {
|
|
4885
|
-
return typeof container === "function" ? container() : (container
|
|
5125
|
+
return typeof container === "function" ? container() : (container !== null && container !== void 0 ? container : null);
|
|
4886
5126
|
}
|
|
4887
5127
|
function videoDetailContainerRect(container) {
|
|
4888
5128
|
const element = resolveVideoDetailContainer(container);
|
|
@@ -4925,12 +5165,13 @@ function videoDetailTargetRect(sourceRect, container) {
|
|
|
4925
5165
|
};
|
|
4926
5166
|
}
|
|
4927
5167
|
function videoDetailOverlayStyle(backdropColor, container) {
|
|
5168
|
+
var _a;
|
|
4928
5169
|
const rect = videoDetailContainerRect(container);
|
|
4929
5170
|
return {
|
|
4930
5171
|
"--cc-video-detail-backdrop-color": backdropColor,
|
|
4931
5172
|
...(rect
|
|
4932
5173
|
? {
|
|
4933
|
-
borderRadius: rect.borderRadius
|
|
5174
|
+
borderRadius: (_a = rect.borderRadius) !== null && _a !== void 0 ? _a : 0,
|
|
4934
5175
|
height: `${rect.height}px`,
|
|
4935
5176
|
left: "0px",
|
|
4936
5177
|
overflow: "hidden",
|
|
@@ -4951,7 +5192,7 @@ function videoDetailStyle(state, full, container) {
|
|
|
4951
5192
|
top: state.sourceRect.top - containerRect.top,
|
|
4952
5193
|
}
|
|
4953
5194
|
: state.sourceRect;
|
|
4954
|
-
const rect = full ? target : (sourceRect
|
|
5195
|
+
const rect = full ? target : (sourceRect !== null && sourceRect !== void 0 ? sourceRect : target);
|
|
4955
5196
|
return {
|
|
4956
5197
|
"--cc-video-detail-duration": `${state.animationDuration}ms`,
|
|
4957
5198
|
"--cc-video-detail-backdrop-color": state.backdropColor,
|
|
@@ -5106,29 +5347,36 @@ const ClassVideoDetailTransition = /*#__PURE__*/ vue.defineComponent({
|
|
|
5106
5347
|
});
|
|
5107
5348
|
async function importOptionalLibrary(name) {
|
|
5108
5349
|
try {
|
|
5109
|
-
|
|
5350
|
+
if (name === "xlsx")
|
|
5351
|
+
return await import('xlsx');
|
|
5352
|
+
if (name === "mammoth")
|
|
5353
|
+
return await import('mammoth');
|
|
5354
|
+
return null;
|
|
5110
5355
|
}
|
|
5111
|
-
catch {
|
|
5356
|
+
catch (_a) {
|
|
5112
5357
|
return null;
|
|
5113
5358
|
}
|
|
5114
5359
|
}
|
|
5115
5360
|
function getGlobalLibrary(name) {
|
|
5116
|
-
|
|
5117
|
-
|
|
5361
|
+
var _a;
|
|
5362
|
+
const record = getClassKitGlobal();
|
|
5363
|
+
return record ? ((_a = record[name]) !== null && _a !== void 0 ? _a : null) : null;
|
|
5118
5364
|
}
|
|
5119
5365
|
async function renderExcelFileWithExternalLibrary(file) {
|
|
5120
|
-
|
|
5366
|
+
var _a, _b;
|
|
5367
|
+
const xlsx = (_a = getGlobalLibrary("XLSX")) !== null && _a !== void 0 ? _a : (await importOptionalLibrary("xlsx"));
|
|
5121
5368
|
if (!xlsx)
|
|
5122
5369
|
throw new Error("Excel local preview requires xlsx. Install it or load it from CDN.");
|
|
5123
5370
|
const workbook = xlsx.read(await file.arrayBuffer(), { type: "array" });
|
|
5124
|
-
const sheetName = workbook.SheetNames
|
|
5371
|
+
const sheetName = (_b = workbook.SheetNames) === null || _b === void 0 ? void 0 : _b[0];
|
|
5125
5372
|
const sheet = sheetName ? workbook.Sheets[sheetName] : undefined;
|
|
5126
5373
|
if (!sheet)
|
|
5127
5374
|
return '<div class="cc-file-preview__local-empty">Empty workbook</div>';
|
|
5128
5375
|
return xlsx.utils.sheet_to_html(sheet, { editable: false });
|
|
5129
5376
|
}
|
|
5130
5377
|
async function renderWordFileWithExternalLibrary(file) {
|
|
5131
|
-
|
|
5378
|
+
var _a;
|
|
5379
|
+
const mammoth = (_a = getGlobalLibrary("mammoth")) !== null && _a !== void 0 ? _a : (await importOptionalLibrary("mammoth"));
|
|
5132
5380
|
if (!mammoth)
|
|
5133
5381
|
throw new Error("Word local preview requires mammoth. Install it or load it from CDN.");
|
|
5134
5382
|
const result = await mammoth.convertToHtml({
|
|
@@ -5158,7 +5406,8 @@ const ClassFilePreview = /*#__PURE__*/ vue.defineComponent({
|
|
|
5158
5406
|
},
|
|
5159
5407
|
emits: ["pageChange", "update:currentPage"],
|
|
5160
5408
|
setup(props, { attrs, emit }) {
|
|
5161
|
-
|
|
5409
|
+
var _a;
|
|
5410
|
+
const innerPage = vue.ref((_a = props.currentPage) !== null && _a !== void 0 ? _a : 1);
|
|
5162
5411
|
const objectUrl = vue.ref("");
|
|
5163
5412
|
const localContent = vue.ref("");
|
|
5164
5413
|
const localError = vue.ref("");
|
|
@@ -5211,6 +5460,7 @@ const ClassFilePreview = /*#__PURE__*/ vue.defineComponent({
|
|
|
5211
5460
|
props.renderLocalPpt,
|
|
5212
5461
|
props.renderLocalWord,
|
|
5213
5462
|
], async () => {
|
|
5463
|
+
var _a, _b, _c, _d;
|
|
5214
5464
|
const file = props.file;
|
|
5215
5465
|
if (!file) {
|
|
5216
5466
|
localContent.value = "";
|
|
@@ -5218,8 +5468,8 @@ const ClassFilePreview = /*#__PURE__*/ vue.defineComponent({
|
|
|
5218
5468
|
return;
|
|
5219
5469
|
}
|
|
5220
5470
|
const state = new core.FilePreviewController({
|
|
5221
|
-
currentPage: props.currentPage
|
|
5222
|
-
fileName: props.fileName
|
|
5471
|
+
currentPage: (_a = props.currentPage) !== null && _a !== void 0 ? _a : innerPage.value,
|
|
5472
|
+
fileName: (_b = props.fileName) !== null && _b !== void 0 ? _b : file.name,
|
|
5223
5473
|
pageCount: props.pageCount,
|
|
5224
5474
|
src: objectUrl.value || props.src || "",
|
|
5225
5475
|
type: props.type,
|
|
@@ -5237,9 +5487,9 @@ const ClassFilePreview = /*#__PURE__*/ vue.defineComponent({
|
|
|
5237
5487
|
localError.value = "";
|
|
5238
5488
|
try {
|
|
5239
5489
|
const renderer = state.type === "excel"
|
|
5240
|
-
? (props.renderLocalExcel
|
|
5490
|
+
? ((_c = props.renderLocalExcel) !== null && _c !== void 0 ? _c : renderExcelFileWithExternalLibrary)
|
|
5241
5491
|
: state.type === "word"
|
|
5242
|
-
? (props.renderLocalWord
|
|
5492
|
+
? ((_d = props.renderLocalWord) !== null && _d !== void 0 ? _d : renderWordFileWithExternalLibrary)
|
|
5243
5493
|
: props.renderLocalPpt;
|
|
5244
5494
|
if (!renderer)
|
|
5245
5495
|
throw new Error("PPT/PPTX 本地预览需要传入 renderLocalPpt,或先转换成 PDF 文件后按 PDF 预览。");
|
|
@@ -5260,10 +5510,11 @@ const ClassFilePreview = /*#__PURE__*/ vue.defineComponent({
|
|
|
5260
5510
|
URL.revokeObjectURL(objectUrl.value);
|
|
5261
5511
|
});
|
|
5262
5512
|
return () => {
|
|
5263
|
-
|
|
5513
|
+
var _a, _b, _c, _d, _e, _f;
|
|
5514
|
+
const activePage = (_a = props.currentPage) !== null && _a !== void 0 ? _a : innerPage.value;
|
|
5264
5515
|
const controller = new core.FilePreviewController({
|
|
5265
5516
|
currentPage: activePage,
|
|
5266
|
-
fileName: props.fileName
|
|
5517
|
+
fileName: (_b = props.fileName) !== null && _b !== void 0 ? _b : (_c = props.file) === null || _c === void 0 ? void 0 : _c.name,
|
|
5267
5518
|
pageCount: props.pageCount,
|
|
5268
5519
|
src: objectUrl.value || props.src || "",
|
|
5269
5520
|
type: props.type,
|
|
@@ -5305,7 +5556,7 @@ const ClassFilePreview = /*#__PURE__*/ vue.defineComponent({
|
|
|
5305
5556
|
vue.h("div", { class: "cc-file-preview__toolbar" }, [
|
|
5306
5557
|
vue.h("div", { class: "cc-file-preview__meta" }, [
|
|
5307
5558
|
vue.h("span", { class: "cc-file-preview__badge" }, state.type.toUpperCase()),
|
|
5308
|
-
vue.h("strong", null, props.title
|
|
5559
|
+
vue.h("strong", null, (_d = props.title) !== null && _d !== void 0 ? _d : state.title),
|
|
5309
5560
|
vue.h("small", null, state.mode === "office"
|
|
5310
5561
|
? "Office viewer"
|
|
5311
5562
|
: state.mode === "pdf"
|
|
@@ -5347,7 +5598,7 @@ const ClassFilePreview = /*#__PURE__*/ vue.defineComponent({
|
|
|
5347
5598
|
localError.value
|
|
5348
5599
|
? vue.h("div", { class: "cc-file-preview__empty" }, [
|
|
5349
5600
|
vue.h("strong", null, "本地预览依赖未就绪"),
|
|
5350
|
-
vue.h("span", null, props.localUnsupportedText
|
|
5601
|
+
vue.h("span", null, (_e = props.localUnsupportedText) !== null && _e !== void 0 ? _e : localError.value),
|
|
5351
5602
|
])
|
|
5352
5603
|
: vue.h("div", {
|
|
5353
5604
|
class: "cc-file-preview__local-html",
|
|
@@ -5368,7 +5619,7 @@ const ClassFilePreview = /*#__PURE__*/ vue.defineComponent({
|
|
|
5368
5619
|
class: "cc-file-preview__frame",
|
|
5369
5620
|
key: state.previewUrl,
|
|
5370
5621
|
src: state.previewUrl,
|
|
5371
|
-
title: props.title
|
|
5622
|
+
title: (_f = props.title) !== null && _f !== void 0 ? _f : state.title,
|
|
5372
5623
|
onLoad: () => hidePreviewLoading(),
|
|
5373
5624
|
}),
|
|
5374
5625
|
vue.h("div", {
|
|
@@ -5427,7 +5678,7 @@ const ClassCanvasImage = /*#__PURE__*/ vue.defineComponent({
|
|
|
5427
5678
|
};
|
|
5428
5679
|
expose({
|
|
5429
5680
|
render,
|
|
5430
|
-
toDataURL: (type = "image/png", quality) => canvasRef.value
|
|
5681
|
+
toDataURL: (type = "image/png", quality) => { var _a, _b; return (_b = (_a = canvasRef.value) === null || _a === void 0 ? void 0 : _a.toDataURL(type, quality)) !== null && _b !== void 0 ? _b : ""; },
|
|
5431
5682
|
});
|
|
5432
5683
|
vue.onMounted(() => {
|
|
5433
5684
|
void render();
|
|
@@ -5484,12 +5735,13 @@ const ClassCanvasEditor = /*#__PURE__*/ vue.defineComponent({
|
|
|
5484
5735
|
"update:nodes",
|
|
5485
5736
|
],
|
|
5486
5737
|
setup(props, { attrs, emit }) {
|
|
5738
|
+
var _a, _b;
|
|
5487
5739
|
const innerMode = vue.ref(props.defaultMode);
|
|
5488
5740
|
const innerNodes = vue.ref(props.defaultNodes);
|
|
5489
5741
|
const controller = new core.CanvasEditorController({
|
|
5490
5742
|
disabled: props.disabled,
|
|
5491
|
-
mode: props.mode
|
|
5492
|
-
nodes: props.nodes
|
|
5743
|
+
mode: (_a = props.mode) !== null && _a !== void 0 ? _a : innerMode.value,
|
|
5744
|
+
nodes: (_b = props.nodes) !== null && _b !== void 0 ? _b : innerNodes.value,
|
|
5493
5745
|
readOnly: props.readOnly,
|
|
5494
5746
|
rootId: props.rootId,
|
|
5495
5747
|
});
|
|
@@ -5509,10 +5761,10 @@ const ClassCanvasEditor = /*#__PURE__*/ vue.defineComponent({
|
|
|
5509
5761
|
}
|
|
5510
5762
|
};
|
|
5511
5763
|
const centerMindRoot = (nextState = controller.getState()) => {
|
|
5764
|
+
var _a, _b, _c, _d, _e;
|
|
5512
5765
|
if (nextState.mode !== "mind" || didCenterMind.value || !mindRef.value)
|
|
5513
5766
|
return;
|
|
5514
|
-
const rootNode = nextState.nodes.find((node) => node.id === nextState.rootId)
|
|
5515
|
-
nextState.nodes[0];
|
|
5767
|
+
const rootNode = (_a = nextState.nodes.find((node) => node.id === nextState.rootId)) !== null && _a !== void 0 ? _a : nextState.nodes[0];
|
|
5516
5768
|
if (!rootNode)
|
|
5517
5769
|
return;
|
|
5518
5770
|
const rect = mindRef.value.getBoundingClientRect();
|
|
@@ -5521,8 +5773,8 @@ const ClassCanvasEditor = /*#__PURE__*/ vue.defineComponent({
|
|
|
5521
5773
|
didCenterMind.value = true;
|
|
5522
5774
|
commit(controller.updateOptions({
|
|
5523
5775
|
viewport: {
|
|
5524
|
-
x: rect.width / 2 - (rootNode.x
|
|
5525
|
-
y: rect.height / 2 - (rootNode.y
|
|
5776
|
+
x: rect.width / 2 - ((_b = rootNode.x) !== null && _b !== void 0 ? _b : 0) - ((_c = rootNode.width) !== null && _c !== void 0 ? _c : 0) / 2,
|
|
5777
|
+
y: rect.height / 2 - ((_d = rootNode.y) !== null && _d !== void 0 ? _d : 0) - ((_e = rootNode.height) !== null && _e !== void 0 ? _e : 0) / 2,
|
|
5526
5778
|
},
|
|
5527
5779
|
}));
|
|
5528
5780
|
};
|
|
@@ -5533,10 +5785,11 @@ const ClassCanvasEditor = /*#__PURE__*/ vue.defineComponent({
|
|
|
5533
5785
|
props.readOnly,
|
|
5534
5786
|
props.rootId,
|
|
5535
5787
|
], () => {
|
|
5788
|
+
var _a, _b;
|
|
5536
5789
|
const nextState = controller.updateOptions({
|
|
5537
5790
|
disabled: props.disabled,
|
|
5538
|
-
mode: props.mode
|
|
5539
|
-
nodes: props.nodes
|
|
5791
|
+
mode: (_a = props.mode) !== null && _a !== void 0 ? _a : innerMode.value,
|
|
5792
|
+
nodes: (_b = props.nodes) !== null && _b !== void 0 ? _b : innerNodes.value,
|
|
5540
5793
|
readOnly: props.readOnly,
|
|
5541
5794
|
rootId: props.rootId,
|
|
5542
5795
|
});
|
|
@@ -5594,11 +5847,15 @@ const ClassCanvasEditor = /*#__PURE__*/ vue.defineComponent({
|
|
|
5594
5847
|
event.stopPropagation();
|
|
5595
5848
|
drag.value = null;
|
|
5596
5849
|
};
|
|
5597
|
-
const getMindTitleRows = (node) =>
|
|
5598
|
-
|
|
5850
|
+
const getMindTitleRows = (node) => {
|
|
5851
|
+
var _a;
|
|
5852
|
+
return Math.max(1, Math.ceil(String(node.title || " ").length /
|
|
5853
|
+
Math.max(1, Math.floor((((_a = node.width) !== null && _a !== void 0 ? _a : 160) - 24) / 7.2))));
|
|
5854
|
+
};
|
|
5599
5855
|
const getMindContentRows = (node) => {
|
|
5600
|
-
|
|
5601
|
-
const
|
|
5856
|
+
var _a, _b;
|
|
5857
|
+
const charsPerLine = Math.max(1, Math.floor((((_a = node.width) !== null && _a !== void 0 ? _a : 160) - 24) / 7.2));
|
|
5858
|
+
const content = String((_b = node.content) !== null && _b !== void 0 ? _b : "");
|
|
5602
5859
|
if (content.trim() === "")
|
|
5603
5860
|
return 1;
|
|
5604
5861
|
return content
|
|
@@ -5619,63 +5876,67 @@ const ClassCanvasEditor = /*#__PURE__*/ vue.defineComponent({
|
|
|
5619
5876
|
event.currentTarget.blur();
|
|
5620
5877
|
}
|
|
5621
5878
|
};
|
|
5622
|
-
const renderDocumentNode = (node, nodeMap, depth = 0) =>
|
|
5623
|
-
|
|
5624
|
-
"
|
|
5625
|
-
|
|
5626
|
-
|
|
5627
|
-
|
|
5628
|
-
|
|
5629
|
-
|
|
5630
|
-
|
|
5631
|
-
|
|
5632
|
-
|
|
5633
|
-
|
|
5634
|
-
|
|
5635
|
-
|
|
5636
|
-
|
|
5637
|
-
|
|
5638
|
-
|
|
5639
|
-
|
|
5640
|
-
|
|
5641
|
-
|
|
5642
|
-
|
|
5643
|
-
|
|
5644
|
-
|
|
5645
|
-
|
|
5646
|
-
|
|
5647
|
-
|
|
5648
|
-
|
|
5649
|
-
|
|
5650
|
-
|
|
5651
|
-
|
|
5652
|
-
|
|
5653
|
-
|
|
5654
|
-
|
|
5879
|
+
const renderDocumentNode = (node, nodeMap, depth = 0) => {
|
|
5880
|
+
var _a, _b, _c, _d;
|
|
5881
|
+
return vue.h("section", {
|
|
5882
|
+
class: "cc-canvas-editor__doc-node",
|
|
5883
|
+
"data-depth": depth,
|
|
5884
|
+
"data-editing": editingId.value === node.id,
|
|
5885
|
+
key: node.id,
|
|
5886
|
+
}, [
|
|
5887
|
+
vue.h("div", { class: "cc-canvas-editor__doc-head" }, [
|
|
5888
|
+
vue.h("input", {
|
|
5889
|
+
class: "cc-canvas-editor__doc-title",
|
|
5890
|
+
disabled: props.disabled,
|
|
5891
|
+
readonly: props.readOnly,
|
|
5892
|
+
value: node.title,
|
|
5893
|
+
onBlur: () => blurNode(node.id),
|
|
5894
|
+
onFocus: () => focusNode(node.id),
|
|
5895
|
+
onInput: (event) => updateNode(node.id, {
|
|
5896
|
+
title: event.currentTarget.value,
|
|
5897
|
+
}),
|
|
5898
|
+
onKeydown: handleTitleKeydown,
|
|
5899
|
+
onPointerdown: stopInputPointer,
|
|
5900
|
+
}),
|
|
5901
|
+
vue.h("span", { class: "cc-canvas-editor__doc-actions" }, [
|
|
5902
|
+
vue.h("button", {
|
|
5903
|
+
disabled: props.disabled || props.readOnly,
|
|
5904
|
+
type: "button",
|
|
5905
|
+
onClick: () => addNode(node.id),
|
|
5906
|
+
}, "子节点"),
|
|
5907
|
+
vue.h("button", {
|
|
5908
|
+
disabled: props.disabled ||
|
|
5909
|
+
props.readOnly ||
|
|
5910
|
+
node.id === state.value.rootId,
|
|
5911
|
+
type: "button",
|
|
5912
|
+
onClick: () => commit(controller.removeNode(node.id), true),
|
|
5913
|
+
}, "删除"),
|
|
5914
|
+
]),
|
|
5655
5915
|
]),
|
|
5656
|
-
|
|
5657
|
-
|
|
5658
|
-
|
|
5659
|
-
|
|
5660
|
-
|
|
5661
|
-
|
|
5662
|
-
|
|
5663
|
-
|
|
5664
|
-
|
|
5665
|
-
|
|
5666
|
-
|
|
5916
|
+
vue.h("textarea", {
|
|
5917
|
+
class: "cc-canvas-editor__doc-content",
|
|
5918
|
+
disabled: props.disabled,
|
|
5919
|
+
readonly: props.readOnly,
|
|
5920
|
+
rows: Math.max(2, Math.ceil(((_b = (_a = node.content) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) / 42)),
|
|
5921
|
+
value: (_c = node.content) !== null && _c !== void 0 ? _c : "",
|
|
5922
|
+
onBlur: () => blurNode(node.id),
|
|
5923
|
+
onFocus: () => focusNode(node.id),
|
|
5924
|
+
onInput: (event) => updateNode(node.id, {
|
|
5925
|
+
content: event.currentTarget.value,
|
|
5926
|
+
}),
|
|
5927
|
+
onKeydown: handleContentKeydown,
|
|
5928
|
+
onPointerdown: stopInputPointer,
|
|
5667
5929
|
}),
|
|
5668
|
-
|
|
5669
|
-
|
|
5670
|
-
|
|
5671
|
-
|
|
5672
|
-
|
|
5673
|
-
|
|
5674
|
-
}),
|
|
5675
|
-
]);
|
|
5930
|
+
...((_d = node.children) !== null && _d !== void 0 ? _d : []).map((childId) => {
|
|
5931
|
+
const child = nodeMap.get(childId);
|
|
5932
|
+
return child ? renderDocumentNode(child, nodeMap, depth + 1) : null;
|
|
5933
|
+
}),
|
|
5934
|
+
]);
|
|
5935
|
+
};
|
|
5676
5936
|
return () => {
|
|
5937
|
+
var _a;
|
|
5677
5938
|
const nodeMap = new Map(state.value.nodes.map((node) => [node.id, node]));
|
|
5678
|
-
const root = nodeMap.get(state.value.rootId)
|
|
5939
|
+
const root = (_a = nodeMap.get(state.value.rootId)) !== null && _a !== void 0 ? _a : state.value.nodes[0];
|
|
5679
5940
|
return vue.h("div", {
|
|
5680
5941
|
...attrs,
|
|
5681
5942
|
class: props.className,
|
|
@@ -5736,6 +5997,7 @@ const ClassCanvasEditor = /*#__PURE__*/ vue.defineComponent({
|
|
|
5736
5997
|
class: "cc-canvas-editor__mind",
|
|
5737
5998
|
ref: mindRef,
|
|
5738
5999
|
onPointerdown: (event) => {
|
|
6000
|
+
var _a, _b;
|
|
5739
6001
|
if (props.disabled ||
|
|
5740
6002
|
event.target.closest(".cc-canvas-editor__card"))
|
|
5741
6003
|
return;
|
|
@@ -5744,7 +6006,7 @@ const ClassCanvasEditor = /*#__PURE__*/ vue.defineComponent({
|
|
|
5744
6006
|
lastY: event.clientY,
|
|
5745
6007
|
type: "pan",
|
|
5746
6008
|
};
|
|
5747
|
-
event.currentTarget.setPointerCapture
|
|
6009
|
+
(_b = (_a = event.currentTarget).setPointerCapture) === null || _b === void 0 ? void 0 : _b.call(_a, event.pointerId);
|
|
5748
6010
|
},
|
|
5749
6011
|
onPointermove: (event) => {
|
|
5750
6012
|
if (!drag.value || drag.value.type !== "pan")
|
|
@@ -5772,83 +6034,87 @@ const ClassCanvasEditor = /*#__PURE__*/ vue.defineComponent({
|
|
|
5772
6034
|
d: link.d,
|
|
5773
6035
|
key: `${link.from}-${link.to}`,
|
|
5774
6036
|
}))),
|
|
5775
|
-
...state.value.nodes.map((node) =>
|
|
5776
|
-
|
|
5777
|
-
"
|
|
5778
|
-
|
|
5779
|
-
|
|
5780
|
-
|
|
5781
|
-
|
|
5782
|
-
|
|
5783
|
-
|
|
5784
|
-
|
|
5785
|
-
|
|
5786
|
-
|
|
5787
|
-
|
|
5788
|
-
|
|
5789
|
-
|
|
5790
|
-
|
|
5791
|
-
|
|
5792
|
-
|
|
5793
|
-
|
|
5794
|
-
|
|
5795
|
-
|
|
5796
|
-
|
|
5797
|
-
|
|
5798
|
-
|
|
5799
|
-
|
|
5800
|
-
|
|
5801
|
-
|
|
5802
|
-
|
|
5803
|
-
|
|
5804
|
-
|
|
5805
|
-
|
|
5806
|
-
|
|
5807
|
-
|
|
5808
|
-
|
|
5809
|
-
|
|
5810
|
-
|
|
5811
|
-
|
|
5812
|
-
|
|
5813
|
-
|
|
5814
|
-
|
|
5815
|
-
|
|
5816
|
-
|
|
5817
|
-
|
|
5818
|
-
|
|
5819
|
-
|
|
5820
|
-
|
|
5821
|
-
|
|
5822
|
-
|
|
5823
|
-
|
|
5824
|
-
|
|
5825
|
-
|
|
5826
|
-
|
|
5827
|
-
|
|
5828
|
-
|
|
5829
|
-
|
|
5830
|
-
|
|
5831
|
-
|
|
5832
|
-
|
|
5833
|
-
|
|
6037
|
+
...state.value.nodes.map((node) => {
|
|
6038
|
+
var _a;
|
|
6039
|
+
return vue.h("article", {
|
|
6040
|
+
class: "cc-canvas-editor__card",
|
|
6041
|
+
"data-editing": editingId.value === node.id,
|
|
6042
|
+
"data-selected": state.value.selectedId === node.id,
|
|
6043
|
+
key: node.id,
|
|
6044
|
+
style: {
|
|
6045
|
+
minHeight: `${node.height}px`,
|
|
6046
|
+
transform: `translate3d(${node.x}px, ${node.y}px, 0)`,
|
|
6047
|
+
width: `${node.width}px`,
|
|
6048
|
+
},
|
|
6049
|
+
onPointerdown: (event) => {
|
|
6050
|
+
var _a, _b;
|
|
6051
|
+
if (props.disabled || props.readOnly)
|
|
6052
|
+
return;
|
|
6053
|
+
event.stopPropagation();
|
|
6054
|
+
if (event.target.closest("input, textarea")) {
|
|
6055
|
+
focusNode(node.id);
|
|
6056
|
+
return;
|
|
6057
|
+
}
|
|
6058
|
+
drag.value = {
|
|
6059
|
+
id: node.id,
|
|
6060
|
+
lastX: event.clientX,
|
|
6061
|
+
lastY: event.clientY,
|
|
6062
|
+
type: "node",
|
|
6063
|
+
};
|
|
6064
|
+
commit(controller.select(node.id));
|
|
6065
|
+
(_b = (_a = event.currentTarget).setPointerCapture) === null || _b === void 0 ? void 0 : _b.call(_a, event.pointerId);
|
|
6066
|
+
},
|
|
6067
|
+
onPointermove: (event) => {
|
|
6068
|
+
if (!drag.value ||
|
|
6069
|
+
drag.value.type !== "node" ||
|
|
6070
|
+
drag.value.id !== node.id)
|
|
6071
|
+
return;
|
|
6072
|
+
const deltaX = event.clientX - drag.value.lastX;
|
|
6073
|
+
const deltaY = event.clientY - drag.value.lastY;
|
|
6074
|
+
drag.value.lastX = event.clientX;
|
|
6075
|
+
drag.value.lastY = event.clientY;
|
|
6076
|
+
commit(controller.moveNode({
|
|
6077
|
+
deltaX,
|
|
6078
|
+
deltaY,
|
|
6079
|
+
id: node.id,
|
|
6080
|
+
}), true);
|
|
6081
|
+
},
|
|
6082
|
+
onPointerup: () => {
|
|
6083
|
+
drag.value = null;
|
|
6084
|
+
},
|
|
6085
|
+
onPointercancel: () => {
|
|
6086
|
+
drag.value = null;
|
|
6087
|
+
},
|
|
6088
|
+
}, [
|
|
6089
|
+
vue.h("textarea", {
|
|
6090
|
+
class: "cc-canvas-editor__card-title",
|
|
6091
|
+
disabled: props.disabled,
|
|
6092
|
+
readonly: props.readOnly,
|
|
6093
|
+
rows: getMindTitleRows(node),
|
|
6094
|
+
value: node.title,
|
|
6095
|
+
onBlur: () => blurNode(node.id),
|
|
6096
|
+
onFocus: () => focusNode(node.id),
|
|
6097
|
+
onInput: (event) => updateNode(node.id, {
|
|
6098
|
+
title: event.currentTarget.value,
|
|
6099
|
+
}),
|
|
6100
|
+
onKeydown: handleTitleKeydown,
|
|
6101
|
+
onPointerdown: stopInputPointer,
|
|
5834
6102
|
}),
|
|
5835
|
-
|
|
5836
|
-
|
|
5837
|
-
|
|
5838
|
-
|
|
5839
|
-
|
|
5840
|
-
|
|
5841
|
-
|
|
5842
|
-
|
|
5843
|
-
|
|
5844
|
-
|
|
5845
|
-
|
|
5846
|
-
|
|
6103
|
+
vue.h("textarea", {
|
|
6104
|
+
disabled: props.disabled,
|
|
6105
|
+
readonly: props.readOnly,
|
|
6106
|
+
rows: getMindContentRows(node),
|
|
6107
|
+
value: (_a = node.content) !== null && _a !== void 0 ? _a : "",
|
|
6108
|
+
onBlur: () => blurNode(node.id),
|
|
6109
|
+
onFocus: () => focusNode(node.id),
|
|
6110
|
+
onInput: (event) => updateNode(node.id, {
|
|
6111
|
+
content: event.currentTarget.value,
|
|
6112
|
+
}),
|
|
6113
|
+
onKeydown: handleContentKeydown,
|
|
6114
|
+
onPointerdown: stopInputPointer,
|
|
5847
6115
|
}),
|
|
5848
|
-
|
|
5849
|
-
|
|
5850
|
-
}),
|
|
5851
|
-
])),
|
|
6116
|
+
]);
|
|
6117
|
+
}),
|
|
5852
6118
|
]),
|
|
5853
6119
|
]),
|
|
5854
6120
|
]);
|
|
@@ -5881,9 +6147,10 @@ const ClassProgressBar = /*#__PURE__*/ vue.defineComponent({
|
|
|
5881
6147
|
},
|
|
5882
6148
|
emits: ["change", "changeEnd", "update:value"],
|
|
5883
6149
|
setup(props, { attrs, emit }) {
|
|
6150
|
+
var _a, _b, _c;
|
|
5884
6151
|
const form = vue.inject(formSymbol, null);
|
|
5885
6152
|
const formInteractivity = useFormInteractivity();
|
|
5886
|
-
const formState = vue.shallowRef(form
|
|
6153
|
+
const formState = vue.shallowRef((_a = form === null || form === void 0 ? void 0 : form.getState()) !== null && _a !== void 0 ? _a : null);
|
|
5887
6154
|
const trackRef = vue.ref(null);
|
|
5888
6155
|
const thumbRef = vue.ref(null);
|
|
5889
6156
|
const dragging = vue.ref(false);
|
|
@@ -5892,8 +6159,8 @@ const ClassProgressBar = /*#__PURE__*/ vue.defineComponent({
|
|
|
5892
6159
|
? Math.max(safeMin.value, props.max)
|
|
5893
6160
|
: Math.max(safeMin.value, 100));
|
|
5894
6161
|
const safeStep = vue.computed(() => Number.isFinite(props.step) && props.step > 0 ? props.step : 1);
|
|
5895
|
-
const formField = vue.computed(() => props.name ? formState.value
|
|
5896
|
-
const formFieldValue = vue.computed(() => Number(formField.value
|
|
6162
|
+
const formField = vue.computed(() => { var _a; return props.name ? (_a = formState.value) === null || _a === void 0 ? void 0 : _a.fields[props.name] : undefined; });
|
|
6163
|
+
const formFieldValue = vue.computed(() => { var _a; return Number((_a = formField.value) === null || _a === void 0 ? void 0 : _a.value); });
|
|
5897
6164
|
const usesFormField = vue.computed(() => Boolean(form && props.name));
|
|
5898
6165
|
const safeValue = vue.computed(() => usesFormField.value && Number.isFinite(formFieldValue.value)
|
|
5899
6166
|
? formFieldValue.value
|
|
@@ -5904,33 +6171,37 @@ const ClassProgressBar = /*#__PURE__*/ vue.defineComponent({
|
|
|
5904
6171
|
const fieldInitialValue = vue.computed(() => Number.isFinite(props.initialValue)
|
|
5905
6172
|
? props.initialValue
|
|
5906
6173
|
: safeDefaultValue.value);
|
|
5907
|
-
const interactivity = vue.computed(() =>
|
|
6174
|
+
const interactivity = vue.computed(() => {
|
|
6175
|
+
var _a;
|
|
6176
|
+
return resolveFieldInteractivity(formInteractivity, props.disabled, (_a = props.readOnly) !== null && _a !== void 0 ? _a : props.readonly);
|
|
6177
|
+
});
|
|
5908
6178
|
const locked = vue.computed(() => interactivity.value.disabled || interactivity.value.readOnly);
|
|
5909
6179
|
const controller = new core.ProgressController({
|
|
5910
6180
|
disabled: locked.value,
|
|
5911
6181
|
max: safeMax.value,
|
|
5912
6182
|
min: safeMin.value,
|
|
5913
6183
|
step: safeStep.value,
|
|
5914
|
-
value: safeValue.value
|
|
6184
|
+
value: (_c = (_b = safeValue.value) !== null && _b !== void 0 ? _b : fieldInitialValue.value) !== null && _c !== void 0 ? _c : safeMin.value,
|
|
5915
6185
|
});
|
|
5916
6186
|
const state = vue.ref(controller.getState());
|
|
5917
6187
|
let unsubscribeField;
|
|
5918
6188
|
let unsubscribeForm;
|
|
5919
6189
|
vue.onMounted(() => {
|
|
6190
|
+
var _a;
|
|
5920
6191
|
if (!form || !props.name)
|
|
5921
6192
|
return;
|
|
5922
6193
|
unsubscribeForm = form.subscribe((nextState) => {
|
|
5923
6194
|
formState.value = nextState;
|
|
5924
6195
|
});
|
|
5925
6196
|
unsubscribeField = form.registerField(props.name, {
|
|
5926
|
-
initialValue: fieldInitialValue.value
|
|
6197
|
+
initialValue: (_a = fieldInitialValue.value) !== null && _a !== void 0 ? _a : safeMin.value,
|
|
5927
6198
|
rules: props.rules,
|
|
5928
6199
|
validateOn: props.validateOn,
|
|
5929
6200
|
});
|
|
5930
6201
|
});
|
|
5931
6202
|
vue.onBeforeUnmount(() => {
|
|
5932
|
-
unsubscribeField
|
|
5933
|
-
unsubscribeForm
|
|
6203
|
+
unsubscribeField === null || unsubscribeField === void 0 ? void 0 : unsubscribeField();
|
|
6204
|
+
unsubscribeForm === null || unsubscribeForm === void 0 ? void 0 : unsubscribeForm();
|
|
5934
6205
|
});
|
|
5935
6206
|
vue.watch(() => [
|
|
5936
6207
|
locked.value,
|
|
@@ -5940,12 +6211,13 @@ const ClassProgressBar = /*#__PURE__*/ vue.defineComponent({
|
|
|
5940
6211
|
props.value,
|
|
5941
6212
|
formFieldValue.value,
|
|
5942
6213
|
], () => {
|
|
6214
|
+
var _a;
|
|
5943
6215
|
state.value = controller.updateOptions({
|
|
5944
6216
|
disabled: locked.value,
|
|
5945
6217
|
max: safeMax.value,
|
|
5946
6218
|
min: safeMin.value,
|
|
5947
6219
|
step: safeStep.value,
|
|
5948
|
-
value: safeValue.value
|
|
6220
|
+
value: (_a = safeValue.value) !== null && _a !== void 0 ? _a : state.value.value,
|
|
5949
6221
|
});
|
|
5950
6222
|
});
|
|
5951
6223
|
const commitValue = (nextValue, end = false) => {
|
|
@@ -5958,10 +6230,11 @@ const ClassProgressBar = /*#__PURE__*/ vue.defineComponent({
|
|
|
5958
6230
|
emit("changeEnd", state.value.value);
|
|
5959
6231
|
};
|
|
5960
6232
|
const updateFromClientX = (clientX, end = false) => {
|
|
5961
|
-
|
|
6233
|
+
var _a, _b, _c;
|
|
6234
|
+
const rect = (_a = trackRef.value) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
5962
6235
|
if (!rect)
|
|
5963
6236
|
return;
|
|
5964
|
-
state.value = controller.valueFromClientX(clientX, rect, thumbRef.value
|
|
6237
|
+
state.value = controller.valueFromClientX(clientX, rect, (_c = (_b = thumbRef.value) === null || _b === void 0 ? void 0 : _b.offsetWidth) !== null && _c !== void 0 ? _c : 0);
|
|
5965
6238
|
if (form && props.name)
|
|
5966
6239
|
void form.setValue(props.name, state.value.value);
|
|
5967
6240
|
emit("update:value", state.value.value);
|
|
@@ -5970,7 +6243,8 @@ const ClassProgressBar = /*#__PURE__*/ vue.defineComponent({
|
|
|
5970
6243
|
emit("changeEnd", state.value.value);
|
|
5971
6244
|
};
|
|
5972
6245
|
return () => {
|
|
5973
|
-
|
|
6246
|
+
var _a, _b, _c;
|
|
6247
|
+
const errors = (_b = (_a = formField.value) === null || _a === void 0 ? void 0 : _a.errors) !== null && _b !== void 0 ? _b : [];
|
|
5974
6248
|
const errorId = props.name ? `${props.name}-error` : undefined;
|
|
5975
6249
|
const progress = vue.h("div", {
|
|
5976
6250
|
...attrs,
|
|
@@ -6001,12 +6275,13 @@ const ClassProgressBar = /*#__PURE__*/ vue.defineComponent({
|
|
|
6001
6275
|
commitValue(state.value.max);
|
|
6002
6276
|
},
|
|
6003
6277
|
onPointerdown: (event) => {
|
|
6278
|
+
var _a, _b;
|
|
6004
6279
|
if (locked.value || !props.interactive)
|
|
6005
6280
|
return;
|
|
6006
6281
|
event.preventDefault();
|
|
6007
6282
|
dragging.value = true;
|
|
6008
6283
|
updateFromClientX(event.clientX);
|
|
6009
|
-
event.currentTarget.setPointerCapture(event.pointerId);
|
|
6284
|
+
(_b = (_a = event.currentTarget).setPointerCapture) === null || _b === void 0 ? void 0 : _b.call(_a, event.pointerId);
|
|
6010
6285
|
},
|
|
6011
6286
|
onPointermove: (event) => {
|
|
6012
6287
|
if (!props.interactive ||
|
|
@@ -6017,10 +6292,11 @@ const ClassProgressBar = /*#__PURE__*/ vue.defineComponent({
|
|
|
6017
6292
|
updateFromClientX(event.clientX);
|
|
6018
6293
|
},
|
|
6019
6294
|
onPointerup: (event) => {
|
|
6295
|
+
var _a, _b;
|
|
6020
6296
|
if (locked.value || !props.interactive)
|
|
6021
6297
|
return;
|
|
6022
6298
|
dragging.value = false;
|
|
6023
|
-
event.currentTarget.releasePointerCapture
|
|
6299
|
+
(_b = (_a = event.currentTarget).releasePointerCapture) === null || _b === void 0 ? void 0 : _b.call(_a, event.pointerId);
|
|
6024
6300
|
updateFromClientX(event.clientX, true);
|
|
6025
6301
|
},
|
|
6026
6302
|
onPointercancel: () => {
|
|
@@ -6052,7 +6328,7 @@ const ClassProgressBar = /*#__PURE__*/ vue.defineComponent({
|
|
|
6052
6328
|
: null,
|
|
6053
6329
|
progress,
|
|
6054
6330
|
errorId && errors.length > 0
|
|
6055
|
-
? vue.h("div", { class: props.errorClass
|
|
6331
|
+
? vue.h("div", { class: (_c = props.errorClass) !== null && _c !== void 0 ? _c : "cc-field__error", id: errorId }, errors.join(","))
|
|
6056
6332
|
: null,
|
|
6057
6333
|
]);
|
|
6058
6334
|
};
|
|
@@ -6159,15 +6435,16 @@ const ClassSignature = /*#__PURE__*/ vue.defineComponent({
|
|
|
6159
6435
|
},
|
|
6160
6436
|
emits: ["change", "clear", "end", "undo"],
|
|
6161
6437
|
setup(props, { attrs, emit, expose }) {
|
|
6438
|
+
var _a, _b;
|
|
6162
6439
|
const form = vue.inject(formSymbol, null);
|
|
6163
6440
|
const formInteractivity = useFormInteractivity();
|
|
6164
|
-
const formState = vue.shallowRef(form
|
|
6441
|
+
const formState = vue.shallowRef((_a = form === null || form === void 0 ? void 0 : form.getState()) !== null && _a !== void 0 ? _a : null);
|
|
6165
6442
|
const canvasRef = vue.ref(null);
|
|
6166
6443
|
const controller = new core.SignatureController({
|
|
6167
6444
|
disabled: Boolean(props.disabled),
|
|
6168
6445
|
lineWidth: props.lineWidth,
|
|
6169
6446
|
penColor: props.penColor,
|
|
6170
|
-
readOnly: Boolean(props.readOnly
|
|
6447
|
+
readOnly: Boolean((_b = props.readOnly) !== null && _b !== void 0 ? _b : props.readonly),
|
|
6171
6448
|
});
|
|
6172
6449
|
const state = vue.ref(controller.getState());
|
|
6173
6450
|
let resizeObserver;
|
|
@@ -6199,24 +6476,25 @@ const ClassSignature = /*#__PURE__*/ vue.defineComponent({
|
|
|
6199
6476
|
expose({
|
|
6200
6477
|
clear,
|
|
6201
6478
|
isEmpty: () => controller.getState().isEmpty,
|
|
6202
|
-
toDataURL: (type = props.exportType, quality) => canvasRef.value
|
|
6479
|
+
toDataURL: (type = props.exportType, quality) => { var _a, _b; return (_b = (_a = canvasRef.value) === null || _a === void 0 ? void 0 : _a.toDataURL(type, quality)) !== null && _b !== void 0 ? _b : ""; },
|
|
6203
6480
|
undo,
|
|
6204
6481
|
});
|
|
6205
6482
|
vue.onMounted(() => {
|
|
6483
|
+
var _a, _b;
|
|
6206
6484
|
if (form && props.name) {
|
|
6207
6485
|
unsubscribeForm = form.subscribe((nextState) => {
|
|
6208
6486
|
formState.value = nextState;
|
|
6209
6487
|
});
|
|
6210
6488
|
unsubscribeField = form.registerField(props.name, {
|
|
6211
|
-
initialValue: props.initialValue
|
|
6489
|
+
initialValue: (_a = props.initialValue) !== null && _a !== void 0 ? _a : controller.getState(),
|
|
6212
6490
|
rules: props.rules,
|
|
6213
6491
|
validateOn: props.validateOn,
|
|
6214
6492
|
});
|
|
6215
6493
|
}
|
|
6216
6494
|
const initialStrokes = Array.isArray(props.initialValue)
|
|
6217
6495
|
? props.initialValue
|
|
6218
|
-
: props.initialValue
|
|
6219
|
-
if (initialStrokes
|
|
6496
|
+
: (_b = props.initialValue) === null || _b === void 0 ? void 0 : _b.strokes;
|
|
6497
|
+
if (initialStrokes === null || initialStrokes === void 0 ? void 0 : initialStrokes.length)
|
|
6220
6498
|
commit(controller.replaceStrokes(initialStrokes), false);
|
|
6221
6499
|
if (canvasRef.value && typeof ResizeObserver !== "undefined") {
|
|
6222
6500
|
resizeObserver = new ResizeObserver(() => redraw());
|
|
@@ -6225,13 +6503,16 @@ const ClassSignature = /*#__PURE__*/ vue.defineComponent({
|
|
|
6225
6503
|
redraw();
|
|
6226
6504
|
});
|
|
6227
6505
|
vue.onBeforeUnmount(() => {
|
|
6228
|
-
resizeObserver
|
|
6229
|
-
unsubscribeField
|
|
6230
|
-
unsubscribeForm
|
|
6231
|
-
});
|
|
6232
|
-
vue.watch(() =>
|
|
6233
|
-
|
|
6234
|
-
|
|
6506
|
+
resizeObserver === null || resizeObserver === void 0 ? void 0 : resizeObserver.disconnect();
|
|
6507
|
+
unsubscribeField === null || unsubscribeField === void 0 ? void 0 : unsubscribeField();
|
|
6508
|
+
unsubscribeForm === null || unsubscribeForm === void 0 ? void 0 : unsubscribeForm();
|
|
6509
|
+
});
|
|
6510
|
+
vue.watch(() => {
|
|
6511
|
+
var _a;
|
|
6512
|
+
return formState.value && props.name
|
|
6513
|
+
? (_a = formState.value.fields[props.name]) === null || _a === void 0 ? void 0 : _a.value
|
|
6514
|
+
: undefined;
|
|
6515
|
+
}, (nextValue) => {
|
|
6235
6516
|
if (!nextValue ||
|
|
6236
6517
|
typeof nextValue !== "object" ||
|
|
6237
6518
|
!("strokes" in nextValue))
|
|
@@ -6251,7 +6532,8 @@ const ClassSignature = /*#__PURE__*/ vue.defineComponent({
|
|
|
6251
6532
|
formInteractivity.disabled.value,
|
|
6252
6533
|
formInteractivity.readOnly.value,
|
|
6253
6534
|
], () => {
|
|
6254
|
-
|
|
6535
|
+
var _a;
|
|
6536
|
+
const interactivity = resolveFieldInteractivity(formInteractivity, props.disabled, (_a = props.readOnly) !== null && _a !== void 0 ? _a : props.readonly);
|
|
6255
6537
|
commit(controller.updateOptions({
|
|
6256
6538
|
disabled: interactivity.disabled,
|
|
6257
6539
|
lineWidth: props.lineWidth,
|
|
@@ -6261,10 +6543,11 @@ const ClassSignature = /*#__PURE__*/ vue.defineComponent({
|
|
|
6261
6543
|
}, { immediate: true });
|
|
6262
6544
|
vue.watch(() => props.backgroundColor, () => redraw());
|
|
6263
6545
|
const handlePointerDown = (event) => {
|
|
6546
|
+
var _a, _b;
|
|
6264
6547
|
if (state.value.disabled || state.value.readOnly || !canvasRef.value)
|
|
6265
6548
|
return;
|
|
6266
6549
|
event.preventDefault();
|
|
6267
|
-
event.currentTarget.setPointerCapture(event.pointerId);
|
|
6550
|
+
(_b = (_a = event.currentTarget).setPointerCapture) === null || _b === void 0 ? void 0 : _b.call(_a, event.pointerId);
|
|
6268
6551
|
const point = signaturePointFromEvent(canvasRef.value, event);
|
|
6269
6552
|
commit(controller.beginStroke(point.x, point.y, point, point.pressure));
|
|
6270
6553
|
};
|
|
@@ -6286,11 +6569,12 @@ const ClassSignature = /*#__PURE__*/ vue.defineComponent({
|
|
|
6286
6569
|
emit("end", next);
|
|
6287
6570
|
};
|
|
6288
6571
|
return () => {
|
|
6289
|
-
|
|
6572
|
+
var _a, _b, _c, _d;
|
|
6573
|
+
const interactivity = resolveFieldInteractivity(formInteractivity, props.disabled, (_a = props.readOnly) !== null && _a !== void 0 ? _a : props.readonly);
|
|
6290
6574
|
const field = props.name
|
|
6291
|
-
? formState.value
|
|
6575
|
+
? (_b = formState.value) === null || _b === void 0 ? void 0 : _b.fields[props.name]
|
|
6292
6576
|
: undefined;
|
|
6293
|
-
const errors = field
|
|
6577
|
+
const errors = (_c = field === null || field === void 0 ? void 0 : field.errors) !== null && _c !== void 0 ? _c : [];
|
|
6294
6578
|
const errorId = props.name ? `${props.name}-error` : undefined;
|
|
6295
6579
|
const signature = vue.h("div", {
|
|
6296
6580
|
...attrs,
|
|
@@ -6351,7 +6635,7 @@ const ClassSignature = /*#__PURE__*/ vue.defineComponent({
|
|
|
6351
6635
|
: null,
|
|
6352
6636
|
signature,
|
|
6353
6637
|
errors.length > 0 && errorId
|
|
6354
|
-
? vue.h("span", { class: props.errorClass
|
|
6638
|
+
? vue.h("span", { class: (_d = props.errorClass) !== null && _d !== void 0 ? _d : "cc-field__error", id: errorId }, errors[0])
|
|
6355
6639
|
: null,
|
|
6356
6640
|
]);
|
|
6357
6641
|
};
|
|
@@ -6374,18 +6658,21 @@ const ClassTimeline = /*#__PURE__*/ vue.defineComponent({
|
|
|
6374
6658
|
direction: props.direction,
|
|
6375
6659
|
items: props.items,
|
|
6376
6660
|
}).getState();
|
|
6377
|
-
return vue.h("ol", { ...attrs, class: props.className, "data-direction": state.direction }, state.items.map((item, index) =>
|
|
6378
|
-
|
|
6379
|
-
|
|
6380
|
-
|
|
6381
|
-
|
|
6382
|
-
|
|
6383
|
-
|
|
6384
|
-
vue.h("
|
|
6385
|
-
|
|
6386
|
-
|
|
6387
|
-
|
|
6388
|
-
|
|
6661
|
+
return vue.h("ol", { ...attrs, class: props.className, "data-direction": state.direction }, state.items.map((item, index) => {
|
|
6662
|
+
var _a, _b, _c;
|
|
6663
|
+
return vue.h("li", {
|
|
6664
|
+
class: "cc-timeline__item",
|
|
6665
|
+
"data-status": (_a = item.status) !== null && _a !== void 0 ? _a : "pending",
|
|
6666
|
+
key: item.id,
|
|
6667
|
+
}, [
|
|
6668
|
+
vue.h("span", { class: "cc-timeline__dot" }),
|
|
6669
|
+
vue.h("div", { class: "cc-timeline__content" }, (_c = (_b = slots.default) === null || _b === void 0 ? void 0 : _b.call(slots, { index, item })) !== null && _c !== void 0 ? _c : [
|
|
6670
|
+
vue.h("strong", item.title),
|
|
6671
|
+
item.meta ? vue.h("span", item.meta) : null,
|
|
6672
|
+
item.description ? vue.h("p", item.description) : null,
|
|
6673
|
+
]),
|
|
6674
|
+
]);
|
|
6675
|
+
}));
|
|
6389
6676
|
};
|
|
6390
6677
|
},
|
|
6391
6678
|
});
|
|
@@ -6431,22 +6718,24 @@ const ClassDraggable = /*#__PURE__*/ vue.defineComponent({
|
|
|
6431
6718
|
};
|
|
6432
6719
|
};
|
|
6433
6720
|
const getLocalPoint = (event) => {
|
|
6434
|
-
|
|
6721
|
+
var _a, _b, _c;
|
|
6722
|
+
const rect = (_a = props.boundary) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
6435
6723
|
return {
|
|
6436
|
-
x: event.clientX - (rect
|
|
6437
|
-
y: event.clientY - (rect
|
|
6724
|
+
x: event.clientX - ((_b = rect === null || rect === void 0 ? void 0 : rect.left) !== null && _b !== void 0 ? _b : 0),
|
|
6725
|
+
y: event.clientY - ((_c = rect === null || rect === void 0 ? void 0 : rect.top) !== null && _c !== void 0 ? _c : 0),
|
|
6438
6726
|
};
|
|
6439
6727
|
};
|
|
6440
6728
|
const syncTarget = (position) => {
|
|
6729
|
+
var _a, _b, _c;
|
|
6441
6730
|
const element = elementRef.value;
|
|
6442
6731
|
const target = props.target;
|
|
6443
|
-
const boundaryRect = props.boundary
|
|
6732
|
+
const boundaryRect = (_a = props.boundary) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
6444
6733
|
if (!element || !target)
|
|
6445
6734
|
return false;
|
|
6446
6735
|
const targetRect = target.getBoundingClientRect();
|
|
6447
6736
|
const nextOverTarget = controller.isOverTarget({
|
|
6448
|
-
x: position.x + (boundaryRect
|
|
6449
|
-
y: position.y + (boundaryRect
|
|
6737
|
+
x: position.x + ((_b = boundaryRect === null || boundaryRect === void 0 ? void 0 : boundaryRect.left) !== null && _b !== void 0 ? _b : 0),
|
|
6738
|
+
y: position.y + ((_c = boundaryRect === null || boundaryRect === void 0 ? void 0 : boundaryRect.top) !== null && _c !== void 0 ? _c : 0),
|
|
6450
6739
|
width: element.offsetWidth,
|
|
6451
6740
|
height: element.offsetHeight,
|
|
6452
6741
|
}, {
|
|
@@ -6495,36 +6784,40 @@ const ClassDraggable = /*#__PURE__*/ vue.defineComponent({
|
|
|
6495
6784
|
window.removeEventListener("pointerup", handleEnd);
|
|
6496
6785
|
window.removeEventListener("pointercancel", handleEnd);
|
|
6497
6786
|
});
|
|
6498
|
-
return () =>
|
|
6499
|
-
|
|
6500
|
-
|
|
6501
|
-
|
|
6502
|
-
|
|
6503
|
-
|
|
6504
|
-
|
|
6505
|
-
|
|
6506
|
-
|
|
6507
|
-
|
|
6508
|
-
|
|
6509
|
-
|
|
6510
|
-
|
|
6511
|
-
|
|
6512
|
-
|
|
6513
|
-
|
|
6514
|
-
|
|
6515
|
-
|
|
6516
|
-
|
|
6517
|
-
|
|
6518
|
-
|
|
6519
|
-
|
|
6520
|
-
|
|
6521
|
-
|
|
6522
|
-
|
|
6523
|
-
|
|
6524
|
-
|
|
6525
|
-
|
|
6526
|
-
|
|
6527
|
-
|
|
6787
|
+
return () => {
|
|
6788
|
+
var _a;
|
|
6789
|
+
return vue.h("div", {
|
|
6790
|
+
...attrs,
|
|
6791
|
+
class: props.className,
|
|
6792
|
+
"data-disabled": props.disabled,
|
|
6793
|
+
"data-dragging": state.value.dragging,
|
|
6794
|
+
"data-over-target": overTarget.value,
|
|
6795
|
+
ref: elementRef,
|
|
6796
|
+
style: {
|
|
6797
|
+
transform: `translate3d(${state.value.position.x}px, ${state.value.position.y}px, 0)`,
|
|
6798
|
+
},
|
|
6799
|
+
onPointerdown: (event) => {
|
|
6800
|
+
var _a, _b;
|
|
6801
|
+
if (props.disabled)
|
|
6802
|
+
return;
|
|
6803
|
+
syncOptions();
|
|
6804
|
+
state.value = controller.start(getLocalPoint(event), state.value.position);
|
|
6805
|
+
syncTarget(state.value.position);
|
|
6806
|
+
emit("dragStart", state.value.position);
|
|
6807
|
+
(_b = (_a = event.currentTarget).setPointerCapture) === null || _b === void 0 ? void 0 : _b.call(_a, event.pointerId);
|
|
6808
|
+
window.addEventListener("pointermove", handleMove, {
|
|
6809
|
+
passive: true,
|
|
6810
|
+
});
|
|
6811
|
+
window.addEventListener("pointerup", handleEnd, { passive: true });
|
|
6812
|
+
window.addEventListener("pointercancel", handleEnd, {
|
|
6813
|
+
passive: true,
|
|
6814
|
+
});
|
|
6815
|
+
},
|
|
6816
|
+
}, (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots, {
|
|
6817
|
+
dragging: state.value.dragging,
|
|
6818
|
+
position: state.value.position,
|
|
6819
|
+
}));
|
|
6820
|
+
};
|
|
6528
6821
|
},
|
|
6529
6822
|
});
|
|
6530
6823
|
function reorderDropItems(items, fromIndex, toIndex, mode) {
|
|
@@ -6571,7 +6864,13 @@ function readDragDropPreviewStyleVars(element) {
|
|
|
6571
6864
|
"--cc-drag-drop-preview-shadow": read("--cc-drag-drop-preview-shadow"),
|
|
6572
6865
|
"--cc-drag-drop-motion-duration": read("--cc-drag-drop-motion-duration"),
|
|
6573
6866
|
};
|
|
6574
|
-
|
|
6867
|
+
const next = {};
|
|
6868
|
+
Object.entries(values).forEach(([key, value]) => {
|
|
6869
|
+
if (value.length > 0) {
|
|
6870
|
+
next[key] = value;
|
|
6871
|
+
}
|
|
6872
|
+
});
|
|
6873
|
+
return next;
|
|
6575
6874
|
}
|
|
6576
6875
|
const ClassDragDropBoard = /*#__PURE__*/ vue.defineComponent({
|
|
6577
6876
|
name: "ClassDragDropBoard",
|
|
@@ -6620,7 +6919,8 @@ const ClassDragDropBoard = /*#__PURE__*/ vue.defineComponent({
|
|
|
6620
6919
|
moveFrame = window.requestAnimationFrame(flushPreviewPosition);
|
|
6621
6920
|
};
|
|
6622
6921
|
const isPreviewInsideBoard = (currentPreview) => {
|
|
6623
|
-
|
|
6922
|
+
var _a;
|
|
6923
|
+
const boardRect = (_a = boardRef.value) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
6624
6924
|
if (!boardRect)
|
|
6625
6925
|
return true;
|
|
6626
6926
|
return (getRectOverlapRatio(getPreviewRect(currentPreview), boardRect) > 0.05);
|
|
@@ -6632,9 +6932,10 @@ const ClassDragDropBoard = /*#__PURE__*/ vue.defineComponent({
|
|
|
6632
6932
|
if (!isPreviewInsideBoard(currentPreview))
|
|
6633
6933
|
return nextIndex;
|
|
6634
6934
|
itemRefs.forEach((element, id) => {
|
|
6935
|
+
var _a;
|
|
6635
6936
|
if (id === state.value.draggingId)
|
|
6636
6937
|
return;
|
|
6637
|
-
const rect = slotRects.get(id)
|
|
6938
|
+
const rect = (_a = slotRects.get(id)) !== null && _a !== void 0 ? _a : element.getBoundingClientRect();
|
|
6638
6939
|
const ratio = getRectOverlapRatio(previewRect, rect);
|
|
6639
6940
|
if (ratio >= 0.8 && ratio > bestRatio) {
|
|
6640
6941
|
bestRatio = ratio;
|
|
@@ -6680,9 +6981,10 @@ const ClassDragDropBoard = /*#__PURE__*/ vue.defineComponent({
|
|
|
6680
6981
|
return `translate3d(${deltaX}px, ${deltaY}px, 0)`;
|
|
6681
6982
|
};
|
|
6682
6983
|
const finishDrag = (action) => {
|
|
6984
|
+
var _a;
|
|
6683
6985
|
if (action === "end") {
|
|
6684
6986
|
const fromIndex = state.value.items.findIndex((item) => item.id === state.value.draggingId);
|
|
6685
|
-
const toIndex = state.value.overIndex
|
|
6987
|
+
const toIndex = (_a = state.value.overIndex) !== null && _a !== void 0 ? _a : fromIndex;
|
|
6686
6988
|
const nextItems = reorderDropItems(state.value.items, fromIndex, toIndex, props.mode);
|
|
6687
6989
|
controller.cancel();
|
|
6688
6990
|
isCommittingDrop.value = true;
|
|
@@ -6703,7 +7005,7 @@ const ClassDragDropBoard = /*#__PURE__*/ vue.defineComponent({
|
|
|
6703
7005
|
preview.value = null;
|
|
6704
7006
|
};
|
|
6705
7007
|
const endDrag = () => {
|
|
6706
|
-
const currentPreview = dragSession
|
|
7008
|
+
const currentPreview = dragSession !== null && dragSession !== void 0 ? dragSession : preview.value;
|
|
6707
7009
|
if (currentPreview && !currentPreview.dropping) {
|
|
6708
7010
|
const originalIndex = getOriginalIndex();
|
|
6709
7011
|
const shouldCancel = !isPreviewInsideBoard(currentPreview) ||
|
|
@@ -6745,7 +7047,7 @@ const ClassDragDropBoard = /*#__PURE__*/ vue.defineComponent({
|
|
|
6745
7047
|
finishDrag("end");
|
|
6746
7048
|
};
|
|
6747
7049
|
const cancelDrag = () => {
|
|
6748
|
-
const currentPreview = dragSession
|
|
7050
|
+
const currentPreview = dragSession !== null && dragSession !== void 0 ? dragSession : preview.value;
|
|
6749
7051
|
if (currentPreview && !currentPreview.dropping) {
|
|
6750
7052
|
const returningPreview = {
|
|
6751
7053
|
...currentPreview,
|
|
@@ -6771,128 +7073,133 @@ const ClassDragDropBoard = /*#__PURE__*/ vue.defineComponent({
|
|
|
6771
7073
|
if (commitFrame)
|
|
6772
7074
|
window.cancelAnimationFrame(commitFrame);
|
|
6773
7075
|
});
|
|
6774
|
-
return () =>
|
|
6775
|
-
|
|
6776
|
-
|
|
6777
|
-
|
|
6778
|
-
|
|
6779
|
-
|
|
6780
|
-
|
|
6781
|
-
|
|
6782
|
-
|
|
6783
|
-
|
|
6784
|
-
|
|
6785
|
-
|
|
6786
|
-
|
|
6787
|
-
|
|
6788
|
-
|
|
6789
|
-
|
|
6790
|
-
|
|
6791
|
-
|
|
6792
|
-
|
|
6793
|
-
|
|
6794
|
-
"
|
|
6795
|
-
|
|
6796
|
-
|
|
6797
|
-
|
|
6798
|
-
|
|
6799
|
-
|
|
6800
|
-
|
|
6801
|
-
|
|
6802
|
-
|
|
6803
|
-
|
|
6804
|
-
|
|
6805
|
-
|
|
6806
|
-
|
|
6807
|
-
|
|
6808
|
-
|
|
6809
|
-
|
|
6810
|
-
|
|
6811
|
-
|
|
6812
|
-
|
|
6813
|
-
|
|
6814
|
-
|
|
6815
|
-
|
|
6816
|
-
|
|
7076
|
+
return () => {
|
|
7077
|
+
var _a, _b;
|
|
7078
|
+
return vue.h("div", {
|
|
7079
|
+
...attrs,
|
|
7080
|
+
class: props.className,
|
|
7081
|
+
ref: boardRef,
|
|
7082
|
+
style: { "--cc-drag-drop-columns": props.columns },
|
|
7083
|
+
}, [
|
|
7084
|
+
...state.value.items.map((item, index) => {
|
|
7085
|
+
var _a, _b;
|
|
7086
|
+
const dragging = state.value.draggingId === item.id;
|
|
7087
|
+
const over = state.value.overIndex === index &&
|
|
7088
|
+
state.value.draggingId !== undefined;
|
|
7089
|
+
const transform = dragging
|
|
7090
|
+
? undefined
|
|
7091
|
+
: getSlotTransform(item, index);
|
|
7092
|
+
const slotStyle = {
|
|
7093
|
+
...(transform ? { transform } : {}),
|
|
7094
|
+
...(isCommittingDrop.value ? { transition: "none" } : {}),
|
|
7095
|
+
};
|
|
7096
|
+
return vue.h("div", {
|
|
7097
|
+
class: "cc-drag-drop-board__slot",
|
|
7098
|
+
"data-disabled": item.disabled,
|
|
7099
|
+
"data-dragging": dragging,
|
|
7100
|
+
"data-over": over,
|
|
7101
|
+
key: item.id,
|
|
7102
|
+
style: Object.keys(slotStyle).length ? slotStyle : undefined,
|
|
7103
|
+
ref: (node) => {
|
|
7104
|
+
if (node instanceof HTMLElement)
|
|
7105
|
+
itemRefs.set(item.id, node);
|
|
7106
|
+
else
|
|
7107
|
+
itemRefs.delete(item.id);
|
|
7108
|
+
},
|
|
7109
|
+
onPointerdown: (event) => {
|
|
7110
|
+
var _a, _b;
|
|
7111
|
+
if (item.disabled)
|
|
7112
|
+
return;
|
|
7113
|
+
const nextSlotRects = new Map();
|
|
7114
|
+
itemRefs.forEach((element, id) => {
|
|
7115
|
+
const itemRect = element.getBoundingClientRect();
|
|
7116
|
+
nextSlotRects.set(id, {
|
|
7117
|
+
bottom: itemRect.bottom,
|
|
7118
|
+
height: itemRect.height,
|
|
7119
|
+
left: itemRect.left,
|
|
7120
|
+
right: itemRect.right,
|
|
7121
|
+
top: itemRect.top,
|
|
7122
|
+
width: itemRect.width,
|
|
7123
|
+
});
|
|
6817
7124
|
});
|
|
6818
|
-
|
|
6819
|
-
|
|
6820
|
-
|
|
6821
|
-
|
|
6822
|
-
|
|
6823
|
-
|
|
6824
|
-
|
|
6825
|
-
|
|
6826
|
-
|
|
6827
|
-
|
|
6828
|
-
|
|
6829
|
-
|
|
6830
|
-
|
|
6831
|
-
y: rect.top,
|
|
6832
|
-
};
|
|
6833
|
-
state.value = controller.start(item.id);
|
|
6834
|
-
dragSession = nextPreview;
|
|
6835
|
-
preview.value = nextPreview;
|
|
6836
|
-
event.currentTarget.setPointerCapture(event.pointerId);
|
|
6837
|
-
},
|
|
6838
|
-
onPointermove: (event) => {
|
|
6839
|
-
if (!state.value.draggingId ||
|
|
6840
|
-
!dragSession ||
|
|
6841
|
-
dragSession.dropping)
|
|
6842
|
-
return;
|
|
6843
|
-
const nextPreview = {
|
|
6844
|
-
...dragSession,
|
|
6845
|
-
x: event.clientX - dragSession.offsetX,
|
|
6846
|
-
y: event.clientY - dragSession.offsetY,
|
|
6847
|
-
};
|
|
6848
|
-
dragSession = nextPreview;
|
|
6849
|
-
schedulePreviewPosition();
|
|
6850
|
-
if (!isPreviewInsideBoard(nextPreview)) {
|
|
6851
|
-
state.value = controller.moveToIndex(getOriginalIndex());
|
|
6852
|
-
const returningPreview = {
|
|
6853
|
-
...nextPreview,
|
|
6854
|
-
dropping: true,
|
|
6855
|
-
offsetX: 0,
|
|
6856
|
-
offsetY: 0,
|
|
6857
|
-
returning: true,
|
|
6858
|
-
x: nextPreview.originX,
|
|
6859
|
-
y: nextPreview.originY,
|
|
7125
|
+
slotRects = nextSlotRects;
|
|
7126
|
+
const rect = event.currentTarget.getBoundingClientRect();
|
|
7127
|
+
const nextPreview = {
|
|
7128
|
+
height: rect.height,
|
|
7129
|
+
item,
|
|
7130
|
+
offsetX: event.clientX - rect.left,
|
|
7131
|
+
offsetY: event.clientY - rect.top,
|
|
7132
|
+
originX: rect.left,
|
|
7133
|
+
originY: rect.top,
|
|
7134
|
+
styleVars: readDragDropPreviewStyleVars(boardRef.value),
|
|
7135
|
+
width: rect.width,
|
|
7136
|
+
x: rect.left,
|
|
7137
|
+
y: rect.top,
|
|
6860
7138
|
};
|
|
6861
|
-
|
|
6862
|
-
|
|
6863
|
-
|
|
6864
|
-
|
|
6865
|
-
}
|
|
6866
|
-
|
|
6867
|
-
|
|
6868
|
-
|
|
6869
|
-
|
|
6870
|
-
|
|
6871
|
-
|
|
6872
|
-
|
|
6873
|
-
|
|
6874
|
-
|
|
6875
|
-
|
|
6876
|
-
|
|
6877
|
-
|
|
6878
|
-
|
|
6879
|
-
|
|
6880
|
-
|
|
6881
|
-
|
|
6882
|
-
|
|
6883
|
-
|
|
6884
|
-
|
|
6885
|
-
|
|
6886
|
-
|
|
6887
|
-
|
|
6888
|
-
|
|
6889
|
-
|
|
6890
|
-
|
|
6891
|
-
|
|
6892
|
-
|
|
6893
|
-
|
|
6894
|
-
|
|
6895
|
-
|
|
7139
|
+
state.value = controller.start(item.id);
|
|
7140
|
+
dragSession = nextPreview;
|
|
7141
|
+
preview.value = nextPreview;
|
|
7142
|
+
(_b = (_a = event.currentTarget).setPointerCapture) === null || _b === void 0 ? void 0 : _b.call(_a, event.pointerId);
|
|
7143
|
+
},
|
|
7144
|
+
onPointermove: (event) => {
|
|
7145
|
+
if (!state.value.draggingId ||
|
|
7146
|
+
!dragSession ||
|
|
7147
|
+
dragSession.dropping)
|
|
7148
|
+
return;
|
|
7149
|
+
const nextPreview = {
|
|
7150
|
+
...dragSession,
|
|
7151
|
+
x: event.clientX - dragSession.offsetX,
|
|
7152
|
+
y: event.clientY - dragSession.offsetY,
|
|
7153
|
+
};
|
|
7154
|
+
dragSession = nextPreview;
|
|
7155
|
+
schedulePreviewPosition();
|
|
7156
|
+
if (!isPreviewInsideBoard(nextPreview)) {
|
|
7157
|
+
state.value = controller.moveToIndex(getOriginalIndex());
|
|
7158
|
+
const returningPreview = {
|
|
7159
|
+
...nextPreview,
|
|
7160
|
+
dropping: true,
|
|
7161
|
+
offsetX: 0,
|
|
7162
|
+
offsetY: 0,
|
|
7163
|
+
returning: true,
|
|
7164
|
+
x: nextPreview.originX,
|
|
7165
|
+
y: nextPreview.originY,
|
|
7166
|
+
};
|
|
7167
|
+
dragSession = returningPreview;
|
|
7168
|
+
preview.value = returningPreview;
|
|
7169
|
+
dropTimer = setTimeout(() => finishDrag("cancel"), 320);
|
|
7170
|
+
return;
|
|
7171
|
+
}
|
|
7172
|
+
const nextIndex = resolveIndexFromPreview(nextPreview);
|
|
7173
|
+
if (nextIndex !== state.value.overIndex)
|
|
7174
|
+
state.value = controller.moveToIndex(nextIndex);
|
|
7175
|
+
},
|
|
7176
|
+
onPointerup: endDrag,
|
|
7177
|
+
onPointercancel: cancelDrag,
|
|
7178
|
+
}, [
|
|
7179
|
+
vue.h("div", { class: "cc-drag-drop-board__item" }, (_b = (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots, { dragging, item, over })) !== null && _b !== void 0 ? _b : item.id),
|
|
7180
|
+
]);
|
|
7181
|
+
}),
|
|
7182
|
+
preview.value
|
|
7183
|
+
? vue.h(vue.Teleport, { to: "body" }, vue.h("div", {
|
|
7184
|
+
"aria-hidden": "true",
|
|
7185
|
+
class: "cc-drag-drop-board__preview",
|
|
7186
|
+
"data-dropping": preview.value.dropping,
|
|
7187
|
+
"data-returning": preview.value.returning,
|
|
7188
|
+
ref: previewRef,
|
|
7189
|
+
style: {
|
|
7190
|
+
...preview.value.styleVars,
|
|
7191
|
+
height: `${preview.value.height}px`,
|
|
7192
|
+
transform: `translate3d(${preview.value.x}px, ${preview.value.y}px, 0)`,
|
|
7193
|
+
width: `${preview.value.width}px`,
|
|
7194
|
+
},
|
|
7195
|
+
}, (_b = (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots, {
|
|
7196
|
+
dragging: true,
|
|
7197
|
+
item: preview.value.item,
|
|
7198
|
+
over: false,
|
|
7199
|
+
})) !== null && _b !== void 0 ? _b : preview.value.item.id))
|
|
7200
|
+
: null,
|
|
7201
|
+
]);
|
|
7202
|
+
};
|
|
6896
7203
|
},
|
|
6897
7204
|
});
|
|
6898
7205
|
const ClassFloatingBall = /*#__PURE__*/ vue.defineComponent({
|
|
@@ -6932,23 +7239,27 @@ const ClassFloatingBall = /*#__PURE__*/ vue.defineComponent({
|
|
|
6932
7239
|
moveAxis: props.moveAxis,
|
|
6933
7240
|
});
|
|
6934
7241
|
const state = vue.ref(controller.getState());
|
|
6935
|
-
const getBounds = () =>
|
|
6936
|
-
|
|
6937
|
-
|
|
6938
|
-
|
|
6939
|
-
|
|
6940
|
-
|
|
6941
|
-
|
|
6942
|
-
|
|
6943
|
-
|
|
6944
|
-
|
|
6945
|
-
|
|
6946
|
-
|
|
7242
|
+
const getBounds = () => {
|
|
7243
|
+
var _a, _b, _c, _d;
|
|
7244
|
+
return ({
|
|
7245
|
+
size: {
|
|
7246
|
+
height: (_b = (_a = elementRef.value) === null || _a === void 0 ? void 0 : _a.offsetHeight) !== null && _b !== void 0 ? _b : 56,
|
|
7247
|
+
width: (_d = (_c = elementRef.value) === null || _c === void 0 ? void 0 : _c.offsetWidth) !== null && _d !== void 0 ? _d : 56,
|
|
7248
|
+
},
|
|
7249
|
+
viewport: props.boundary
|
|
7250
|
+
? {
|
|
7251
|
+
height: props.boundary.clientHeight,
|
|
7252
|
+
width: props.boundary.clientWidth,
|
|
7253
|
+
}
|
|
7254
|
+
: { height: window.innerHeight, width: window.innerWidth },
|
|
7255
|
+
});
|
|
7256
|
+
};
|
|
6947
7257
|
const toLocalPoint = (event) => {
|
|
6948
|
-
|
|
7258
|
+
var _a, _b, _c;
|
|
7259
|
+
const rect = (_a = props.boundary) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
6949
7260
|
return {
|
|
6950
|
-
x: event.clientX - (rect
|
|
6951
|
-
y: event.clientY - (rect
|
|
7261
|
+
x: event.clientX - ((_b = rect === null || rect === void 0 ? void 0 : rect.left) !== null && _b !== void 0 ? _b : 0),
|
|
7262
|
+
y: event.clientY - ((_c = rect === null || rect === void 0 ? void 0 : rect.top) !== null && _c !== void 0 ? _c : 0),
|
|
6952
7263
|
};
|
|
6953
7264
|
};
|
|
6954
7265
|
const flushMove = () => {
|
|
@@ -7013,34 +7324,38 @@ const ClassFloatingBall = /*#__PURE__*/ vue.defineComponent({
|
|
|
7013
7324
|
if (frame)
|
|
7014
7325
|
window.cancelAnimationFrame(frame);
|
|
7015
7326
|
});
|
|
7016
|
-
return () =>
|
|
7017
|
-
|
|
7018
|
-
|
|
7019
|
-
|
|
7020
|
-
|
|
7021
|
-
|
|
7022
|
-
|
|
7023
|
-
|
|
7024
|
-
|
|
7025
|
-
|
|
7026
|
-
|
|
7027
|
-
|
|
7028
|
-
|
|
7029
|
-
|
|
7030
|
-
|
|
7031
|
-
|
|
7032
|
-
|
|
7033
|
-
|
|
7034
|
-
|
|
7035
|
-
|
|
7036
|
-
|
|
7037
|
-
|
|
7038
|
-
|
|
7039
|
-
|
|
7040
|
-
|
|
7041
|
-
|
|
7042
|
-
|
|
7043
|
-
|
|
7327
|
+
return () => {
|
|
7328
|
+
var _a;
|
|
7329
|
+
return vue.h("div", {
|
|
7330
|
+
...attrs,
|
|
7331
|
+
class: props.className,
|
|
7332
|
+
"data-edge": state.value.edge,
|
|
7333
|
+
"data-dragging": dragging.value,
|
|
7334
|
+
ref: elementRef,
|
|
7335
|
+
style: {
|
|
7336
|
+
left: `${state.value.position.x}px`,
|
|
7337
|
+
top: `${state.value.position.y}px`,
|
|
7338
|
+
},
|
|
7339
|
+
onPointerdown: (event) => {
|
|
7340
|
+
var _a, _b;
|
|
7341
|
+
const localPoint = toLocalPoint(event);
|
|
7342
|
+
drag.value = {
|
|
7343
|
+
dx: localPoint.x - state.value.position.x,
|
|
7344
|
+
dy: localPoint.y - state.value.position.y,
|
|
7345
|
+
};
|
|
7346
|
+
dragging.value = true;
|
|
7347
|
+
gesture.start({ x: event.clientX, y: event.clientY });
|
|
7348
|
+
(_b = (_a = event.currentTarget).setPointerCapture) === null || _b === void 0 ? void 0 : _b.call(_a, event.pointerId);
|
|
7349
|
+
window.addEventListener("pointermove", handleMove, {
|
|
7350
|
+
passive: true,
|
|
7351
|
+
});
|
|
7352
|
+
window.addEventListener("pointerup", handleUp, { passive: true });
|
|
7353
|
+
window.addEventListener("pointercancel", handleUp, {
|
|
7354
|
+
passive: true,
|
|
7355
|
+
});
|
|
7356
|
+
},
|
|
7357
|
+
}, (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots));
|
|
7358
|
+
};
|
|
7044
7359
|
},
|
|
7045
7360
|
});
|
|
7046
7361
|
const ClassMultiColumnPicker = /*#__PURE__*/ vue.defineComponent({
|
|
@@ -7077,12 +7392,14 @@ const ClassMultiColumnPicker = /*#__PURE__*/ vue.defineComponent({
|
|
|
7077
7392
|
},
|
|
7078
7393
|
emits: ["change", "update:values"],
|
|
7079
7394
|
setup(props, { attrs, emit }) {
|
|
7395
|
+
var _a;
|
|
7080
7396
|
const form = vue.inject(formSymbol, null);
|
|
7081
7397
|
const formInteractivity = useFormInteractivity();
|
|
7082
|
-
const formState = vue.shallowRef(form
|
|
7398
|
+
const formState = vue.shallowRef((_a = form === null || form === void 0 ? void 0 : form.getState()) !== null && _a !== void 0 ? _a : null);
|
|
7083
7399
|
const getValues = () => {
|
|
7400
|
+
var _a, _b;
|
|
7084
7401
|
const fieldValue = props.name
|
|
7085
|
-
? formState.value
|
|
7402
|
+
? (_b = (_a = formState.value) === null || _a === void 0 ? void 0 : _a.fields[props.name]) === null || _b === void 0 ? void 0 : _b.value
|
|
7086
7403
|
: undefined;
|
|
7087
7404
|
return Array.isArray(fieldValue)
|
|
7088
7405
|
? fieldValue
|
|
@@ -7101,28 +7418,32 @@ const ClassMultiColumnPicker = /*#__PURE__*/ vue.defineComponent({
|
|
|
7101
7418
|
let unsubscribeField;
|
|
7102
7419
|
let unsubscribeForm;
|
|
7103
7420
|
vue.onMounted(() => {
|
|
7421
|
+
var _a;
|
|
7104
7422
|
if (!form || !props.name)
|
|
7105
7423
|
return;
|
|
7106
7424
|
unsubscribeForm = form.subscribe((nextState) => {
|
|
7107
7425
|
formState.value = nextState;
|
|
7108
7426
|
});
|
|
7109
7427
|
unsubscribeField = form.registerField(props.name, {
|
|
7110
|
-
initialValue: props.initialValue
|
|
7428
|
+
initialValue: (_a = props.initialValue) !== null && _a !== void 0 ? _a : props.values,
|
|
7111
7429
|
rules: props.rules,
|
|
7112
7430
|
validateOn: props.validateOn,
|
|
7113
7431
|
});
|
|
7114
7432
|
});
|
|
7115
7433
|
vue.onBeforeUnmount(() => {
|
|
7116
|
-
unsubscribeField
|
|
7117
|
-
unsubscribeForm
|
|
7434
|
+
unsubscribeField === null || unsubscribeField === void 0 ? void 0 : unsubscribeField();
|
|
7435
|
+
unsubscribeForm === null || unsubscribeForm === void 0 ? void 0 : unsubscribeForm();
|
|
7118
7436
|
});
|
|
7119
|
-
vue.watch(() =>
|
|
7120
|
-
|
|
7121
|
-
|
|
7122
|
-
|
|
7123
|
-
|
|
7124
|
-
|
|
7125
|
-
|
|
7437
|
+
vue.watch(() => {
|
|
7438
|
+
var _a, _b;
|
|
7439
|
+
return [
|
|
7440
|
+
props.cascade,
|
|
7441
|
+
props.columns,
|
|
7442
|
+
props.source,
|
|
7443
|
+
props.values,
|
|
7444
|
+
props.name ? (_b = (_a = formState.value) === null || _a === void 0 ? void 0 : _a.fields[props.name]) === null || _b === void 0 ? void 0 : _b.value : undefined,
|
|
7445
|
+
];
|
|
7446
|
+
}, () => {
|
|
7126
7447
|
state.value = controller.updateOptions({
|
|
7127
7448
|
cascade: props.cascade,
|
|
7128
7449
|
columns: props.columns,
|
|
@@ -7139,12 +7460,13 @@ const ClassMultiColumnPicker = /*#__PURE__*/ vue.defineComponent({
|
|
|
7139
7460
|
emit("change", state.value.values, state.value.selectedOptions);
|
|
7140
7461
|
};
|
|
7141
7462
|
return () => {
|
|
7142
|
-
|
|
7463
|
+
var _a, _b, _c, _d;
|
|
7464
|
+
const interactivity = resolveFieldInteractivity(formInteractivity, props.disabled, (_a = props.readOnly) !== null && _a !== void 0 ? _a : props.readonly);
|
|
7143
7465
|
const locked = interactivity.disabled || interactivity.readOnly;
|
|
7144
7466
|
const field = props.name
|
|
7145
|
-
? formState.value
|
|
7467
|
+
? (_b = formState.value) === null || _b === void 0 ? void 0 : _b.fields[props.name]
|
|
7146
7468
|
: undefined;
|
|
7147
|
-
const errors = field
|
|
7469
|
+
const errors = (_c = field === null || field === void 0 ? void 0 : field.errors) !== null && _c !== void 0 ? _c : [];
|
|
7148
7470
|
const errorId = props.name ? `${props.name}-error` : undefined;
|
|
7149
7471
|
const safeItemHeight = Math.max(1, Number.isFinite(props.itemHeight) ? props.itemHeight : 38);
|
|
7150
7472
|
const safeVisibleItemCount = Math.max(3, Math.floor(Number.isFinite(props.visibleItemCount) ? props.visibleItemCount : 5));
|
|
@@ -7153,17 +7475,19 @@ const ClassMultiColumnPicker = /*#__PURE__*/ vue.defineComponent({
|
|
|
7153
7475
|
: safeVisibleItemCount;
|
|
7154
7476
|
const wheelHeight = safeItemHeight * visibleCount;
|
|
7155
7477
|
const columnNodes = state.value.columns.map((column, columnIndex) => {
|
|
7478
|
+
var _a;
|
|
7156
7479
|
const selectedIndex = Math.max(0, column.findIndex((item) => item.value === state.value.values[columnIndex]));
|
|
7157
7480
|
return vue.h("div", {
|
|
7158
7481
|
class: "cc-picker__column",
|
|
7159
7482
|
key: columnIndex,
|
|
7160
7483
|
style: { height: `${wheelHeight}px` },
|
|
7161
7484
|
onPointerdown: (event) => {
|
|
7485
|
+
var _a, _b;
|
|
7162
7486
|
if (locked)
|
|
7163
7487
|
return;
|
|
7164
7488
|
activeColumn.value = columnIndex;
|
|
7165
7489
|
gesture.start({ x: event.clientX, y: event.clientY });
|
|
7166
|
-
event.currentTarget.setPointerCapture(event.pointerId);
|
|
7490
|
+
(_b = (_a = event.currentTarget).setPointerCapture) === null || _b === void 0 ? void 0 : _b.call(_a, event.pointerId);
|
|
7167
7491
|
},
|
|
7168
7492
|
onPointermove: (event) => {
|
|
7169
7493
|
if (locked ||
|
|
@@ -7202,7 +7526,7 @@ const ClassMultiColumnPicker = /*#__PURE__*/ vue.defineComponent({
|
|
|
7202
7526
|
vue.h("div", {
|
|
7203
7527
|
class: "cc-picker__wheel",
|
|
7204
7528
|
style: {
|
|
7205
|
-
transform: `translate3d(0, ${((visibleCount - 1) / 2 - selectedIndex) * safeItemHeight + (dragOffsets.value[columnIndex]
|
|
7529
|
+
transform: `translate3d(0, ${((visibleCount - 1) / 2 - selectedIndex) * safeItemHeight + ((_a = dragOffsets.value[columnIndex]) !== null && _a !== void 0 ? _a : 0)}px, 0)`,
|
|
7206
7530
|
},
|
|
7207
7531
|
}, column.map((option, optionIndex) => vue.h("button", {
|
|
7208
7532
|
class: "cc-picker__option",
|
|
@@ -7248,7 +7572,7 @@ const ClassMultiColumnPicker = /*#__PURE__*/ vue.defineComponent({
|
|
|
7248
7572
|
: null,
|
|
7249
7573
|
picker,
|
|
7250
7574
|
errors.length > 0 && errorId
|
|
7251
|
-
? vue.h("span", { class: props.errorClass
|
|
7575
|
+
? vue.h("span", { class: (_d = props.errorClass) !== null && _d !== void 0 ? _d : "cc-field__error", id: errorId }, errors[0])
|
|
7252
7576
|
: null,
|
|
7253
7577
|
]);
|
|
7254
7578
|
};
|
|
@@ -7315,6 +7639,7 @@ const ClassSwiper = /*#__PURE__*/ vue.defineComponent({
|
|
|
7315
7639
|
let timer;
|
|
7316
7640
|
let resizeObserver;
|
|
7317
7641
|
let initialTransitionFrame;
|
|
7642
|
+
let removeViewportResizeFallback = () => { };
|
|
7318
7643
|
const setCurrent = (nextState) => {
|
|
7319
7644
|
state.value = nextState;
|
|
7320
7645
|
dragOffset.value = 0;
|
|
@@ -7377,10 +7702,11 @@ const ClassSwiper = /*#__PURE__*/ vue.defineComponent({
|
|
|
7377
7702
|
startAutoplay();
|
|
7378
7703
|
if (viewportRef.value) {
|
|
7379
7704
|
const syncSize = () => {
|
|
7705
|
+
var _a, _b, _c, _d;
|
|
7380
7706
|
viewportSize.value =
|
|
7381
7707
|
props.direction === "vertical"
|
|
7382
|
-
? (viewportRef.value
|
|
7383
|
-
: (viewportRef.value
|
|
7708
|
+
? ((_b = (_a = viewportRef.value) === null || _a === void 0 ? void 0 : _a.clientHeight) !== null && _b !== void 0 ? _b : 0)
|
|
7709
|
+
: ((_d = (_c = viewportRef.value) === null || _c === void 0 ? void 0 : _c.clientWidth) !== null && _d !== void 0 ? _d : 0);
|
|
7384
7710
|
if (!props.disableInitialTransition || viewportSize.value <= 0)
|
|
7385
7711
|
return;
|
|
7386
7712
|
if (initialTransitionFrame !== undefined)
|
|
@@ -7390,23 +7716,31 @@ const ClassSwiper = /*#__PURE__*/ vue.defineComponent({
|
|
|
7390
7716
|
});
|
|
7391
7717
|
};
|
|
7392
7718
|
syncSize();
|
|
7393
|
-
|
|
7394
|
-
|
|
7719
|
+
if (typeof ResizeObserver === "undefined") {
|
|
7720
|
+
window.addEventListener("resize", syncSize);
|
|
7721
|
+
removeViewportResizeFallback = () => window.removeEventListener("resize", syncSize);
|
|
7722
|
+
}
|
|
7723
|
+
else {
|
|
7724
|
+
resizeObserver = new ResizeObserver(syncSize);
|
|
7725
|
+
resizeObserver.observe(viewportRef.value);
|
|
7726
|
+
}
|
|
7395
7727
|
}
|
|
7396
7728
|
});
|
|
7397
7729
|
vue.watch(() => props.direction, () => {
|
|
7730
|
+
var _a, _b;
|
|
7398
7731
|
const element = viewportRef.value;
|
|
7399
7732
|
viewportSize.value =
|
|
7400
7733
|
props.direction === "vertical"
|
|
7401
|
-
? (element
|
|
7402
|
-
: (element
|
|
7734
|
+
? ((_a = element === null || element === void 0 ? void 0 : element.clientHeight) !== null && _a !== void 0 ? _a : 0)
|
|
7735
|
+
: ((_b = element === null || element === void 0 ? void 0 : element.clientWidth) !== null && _b !== void 0 ? _b : 0);
|
|
7403
7736
|
dragOffset.value = 0;
|
|
7404
7737
|
});
|
|
7405
7738
|
vue.onBeforeUnmount(() => {
|
|
7406
7739
|
stopAutoplay();
|
|
7407
7740
|
if (initialTransitionFrame !== undefined)
|
|
7408
7741
|
window.cancelAnimationFrame(initialTransitionFrame);
|
|
7409
|
-
|
|
7742
|
+
removeViewportResizeFallback();
|
|
7743
|
+
resizeObserver === null || resizeObserver === void 0 ? void 0 : resizeObserver.disconnect();
|
|
7410
7744
|
});
|
|
7411
7745
|
return () => {
|
|
7412
7746
|
const isVertical = props.direction === "vertical";
|
|
@@ -7424,9 +7758,11 @@ const ClassSwiper = /*#__PURE__*/ vue.defineComponent({
|
|
|
7424
7758
|
? centeredOffset - state.value.current * stepSize + dragOffset.value
|
|
7425
7759
|
: -state.value.current * stepSize + dragOffset.value;
|
|
7426
7760
|
const resolvePressedSlideIndex = (event) => {
|
|
7761
|
+
var _a;
|
|
7427
7762
|
const fallback = () => {
|
|
7428
|
-
|
|
7429
|
-
const
|
|
7763
|
+
var _a;
|
|
7764
|
+
const slide = (_a = event.target) === null || _a === void 0 ? void 0 : _a.closest(".cc-swiper__slide");
|
|
7765
|
+
const index = Number(slide === null || slide === void 0 ? void 0 : slide.dataset.swiperIndex);
|
|
7430
7766
|
return Number.isFinite(index) ? index : null;
|
|
7431
7767
|
};
|
|
7432
7768
|
if (!isCinemaMode.value ||
|
|
@@ -7434,7 +7770,7 @@ const ClassSwiper = /*#__PURE__*/ vue.defineComponent({
|
|
|
7434
7770
|
slideSize <= 0 ||
|
|
7435
7771
|
safeData.value.length <= 0)
|
|
7436
7772
|
return fallback();
|
|
7437
|
-
const rect = viewportRef.value
|
|
7773
|
+
const rect = (_a = viewportRef.value) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
7438
7774
|
if (!rect)
|
|
7439
7775
|
return fallback();
|
|
7440
7776
|
const localPoint = isVertical
|
|
@@ -7462,12 +7798,13 @@ const ClassSwiper = /*#__PURE__*/ vue.defineComponent({
|
|
|
7462
7798
|
class: "cc-swiper__viewport",
|
|
7463
7799
|
ref: viewportRef,
|
|
7464
7800
|
onPointerdown: (event) => {
|
|
7801
|
+
var _a, _b;
|
|
7465
7802
|
event.preventDefault();
|
|
7466
7803
|
clickSuppressed.value = false;
|
|
7467
7804
|
pressedSlideIndex.value = resolvePressedSlideIndex(event);
|
|
7468
7805
|
gesture.start({ x: event.clientX, y: event.clientY });
|
|
7469
7806
|
dragging.value = true;
|
|
7470
|
-
event.currentTarget.setPointerCapture(event.pointerId);
|
|
7807
|
+
(_b = (_a = event.currentTarget).setPointerCapture) === null || _b === void 0 ? void 0 : _b.call(_a, event.pointerId);
|
|
7471
7808
|
},
|
|
7472
7809
|
onPointermove: (event) => {
|
|
7473
7810
|
if (!gesture.getState().active)
|
|
@@ -7525,6 +7862,7 @@ const ClassSwiper = /*#__PURE__*/ vue.defineComponent({
|
|
|
7525
7862
|
: `translate3d(${trackOffset}px, 0, 0)`,
|
|
7526
7863
|
},
|
|
7527
7864
|
}, safeData.value.map((item, index) => {
|
|
7865
|
+
var _a, _b;
|
|
7528
7866
|
const rawOffset = index - state.value.current;
|
|
7529
7867
|
const normalizedOffset = Math.max(-3, Math.min(3, rawOffset));
|
|
7530
7868
|
const distance = Math.min(3, Math.abs(rawOffset));
|
|
@@ -7576,8 +7914,7 @@ const ClassSwiper = /*#__PURE__*/ vue.defineComponent({
|
|
|
7576
7914
|
"--cc-swiper-slide-shift-y": `${slideVerticalShift}px`,
|
|
7577
7915
|
zIndex: 30 - distance,
|
|
7578
7916
|
},
|
|
7579
|
-
}, slots.default
|
|
7580
|
-
String(item ?? ""));
|
|
7917
|
+
}, (_b = (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots, { data: item, index })) !== null && _b !== void 0 ? _b : String(item !== null && item !== void 0 ? item : ""));
|
|
7581
7918
|
})),
|
|
7582
7919
|
]),
|
|
7583
7920
|
props.showArrows && swiperCount.value > 1
|
|
@@ -7752,10 +8089,12 @@ const ClassVirtualList = /*#__PURE__*/ vue.defineComponent({
|
|
|
7752
8089
|
emit("rangeChange", { endIndex, startIndex });
|
|
7753
8090
|
}, { immediate: true });
|
|
7754
8091
|
const updateViewportHeight = () => {
|
|
7755
|
-
|
|
8092
|
+
var _a, _b;
|
|
8093
|
+
viewportHeight.value = (_b = (_a = viewportRef.value) === null || _a === void 0 ? void 0 : _a.clientHeight) !== null && _b !== void 0 ? _b : 0;
|
|
7756
8094
|
};
|
|
7757
8095
|
const updateHeaderHeight = () => {
|
|
7758
|
-
|
|
8096
|
+
var _a, _b;
|
|
8097
|
+
headerHeight.value = (_b = (_a = headerRef.value) === null || _a === void 0 ? void 0 : _a.offsetHeight) !== null && _b !== void 0 ? _b : 0;
|
|
7759
8098
|
};
|
|
7760
8099
|
const finishPullDown = () => {
|
|
7761
8100
|
pullDownStatus.value = "success";
|
|
@@ -7802,19 +8141,21 @@ const ClassVirtualList = /*#__PURE__*/ vue.defineComponent({
|
|
|
7802
8141
|
}
|
|
7803
8142
|
});
|
|
7804
8143
|
const handlePullDownStart = (event) => {
|
|
8144
|
+
var _a, _b;
|
|
7805
8145
|
const element = event.currentTarget;
|
|
7806
8146
|
if (!props.enablePullDown ||
|
|
7807
8147
|
pullDownPending.value ||
|
|
7808
8148
|
props.pullDownLoading ||
|
|
7809
8149
|
element.scrollTop > 0)
|
|
7810
8150
|
return;
|
|
7811
|
-
pullDownStartY.value = event.touches[0]
|
|
8151
|
+
pullDownStartY.value = (_b = (_a = event.touches[0]) === null || _a === void 0 ? void 0 : _a.clientY) !== null && _b !== void 0 ? _b : null;
|
|
7812
8152
|
};
|
|
7813
8153
|
const handlePullDownMove = (event) => {
|
|
8154
|
+
var _a;
|
|
7814
8155
|
if (!props.enablePullDown || pullDownStartY.value === null)
|
|
7815
8156
|
return;
|
|
7816
8157
|
const element = event.currentTarget;
|
|
7817
|
-
const touchY = event.touches[0]
|
|
8158
|
+
const touchY = (_a = event.touches[0]) === null || _a === void 0 ? void 0 : _a.clientY;
|
|
7818
8159
|
if (touchY === undefined)
|
|
7819
8160
|
return;
|
|
7820
8161
|
const delta = touchY - pullDownStartY.value;
|
|
@@ -7888,7 +8229,7 @@ const ClassVirtualList = /*#__PURE__*/ vue.defineComponent({
|
|
|
7888
8229
|
}
|
|
7889
8230
|
if (typeof IntersectionObserver !== "undefined") {
|
|
7890
8231
|
const pullObserver = new IntersectionObserver(([entry]) => {
|
|
7891
|
-
if (entry
|
|
8232
|
+
if (entry === null || entry === void 0 ? void 0 : entry.isIntersecting)
|
|
7892
8233
|
triggerPullUp();
|
|
7893
8234
|
}, {
|
|
7894
8235
|
root: viewportRef.value,
|
|
@@ -7917,7 +8258,8 @@ const ClassVirtualList = /*#__PURE__*/ vue.defineComponent({
|
|
|
7917
8258
|
observers.clear();
|
|
7918
8259
|
});
|
|
7919
8260
|
const observeItem = (index, element) => {
|
|
7920
|
-
|
|
8261
|
+
var _a;
|
|
8262
|
+
(_a = observers.get(index)) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
7921
8263
|
observers.delete(index);
|
|
7922
8264
|
if (!(element instanceof HTMLElement))
|
|
7923
8265
|
return;
|
|
@@ -7933,6 +8275,7 @@ const ClassVirtualList = /*#__PURE__*/ vue.defineComponent({
|
|
|
7933
8275
|
observers.set(index, observer);
|
|
7934
8276
|
};
|
|
7935
8277
|
return () => {
|
|
8278
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
7936
8279
|
const range = visibleRange.value;
|
|
7937
8280
|
const resolvedHeight = typeof props.height === "number" ? `${props.height}px` : props.height;
|
|
7938
8281
|
const pullDownProgress = props.pullDownThreshold <= 0
|
|
@@ -7979,16 +8322,16 @@ const ClassVirtualList = /*#__PURE__*/ vue.defineComponent({
|
|
|
7979
8322
|
return undefined;
|
|
7980
8323
|
};
|
|
7981
8324
|
const resolvedPullDownIconNode = resolvedPullDownStatus === "success"
|
|
7982
|
-
? ((props.pullDownSuccessImage
|
|
8325
|
+
? ((_b = (props.pullDownSuccessImage
|
|
7983
8326
|
? iconNode("success", props.pullDownSuccessIcon, props.pullDownSuccessImage)
|
|
7984
8327
|
: props.pullDownSuccessIcon
|
|
7985
8328
|
? iconNode("success", props.pullDownSuccessIcon)
|
|
7986
|
-
: slots.pullDownSuccessIcon
|
|
7987
|
-
: ((props.pullDownLoadingImage
|
|
8329
|
+
: (_a = slots.pullDownSuccessIcon) === null || _a === void 0 ? void 0 : _a.call(slots))) !== null && _b !== void 0 ? _b : defaultPullDownIcon())
|
|
8330
|
+
: ((_d = (props.pullDownLoadingImage
|
|
7988
8331
|
? iconNode("loading", props.pullDownLoadingIcon, props.pullDownLoadingImage)
|
|
7989
8332
|
: props.pullDownLoadingIcon
|
|
7990
8333
|
? iconNode("loading", props.pullDownLoadingIcon)
|
|
7991
|
-
: slots.pullDownLoadingIcon
|
|
8334
|
+
: (_c = slots.pullDownLoadingIcon) === null || _c === void 0 ? void 0 : _c.call(slots))) !== null && _d !== void 0 ? _d : defaultPullDownIcon());
|
|
7992
8335
|
return vue.h("div", {
|
|
7993
8336
|
...attrs,
|
|
7994
8337
|
class: props.className,
|
|
@@ -8009,11 +8352,11 @@ const ClassVirtualList = /*#__PURE__*/ vue.defineComponent({
|
|
|
8009
8352
|
"--cc-virtual-list-pull-down-distance": `${pullDownDistance.value}px`,
|
|
8010
8353
|
"--cc-virtual-list-pull-down-progress": pullDownProgress,
|
|
8011
8354
|
},
|
|
8012
|
-
}, slots.pullDown
|
|
8355
|
+
}, (_f = (_e = slots.pullDown) === null || _e === void 0 ? void 0 : _e.call(slots, {
|
|
8013
8356
|
distance: pullDownDistance.value,
|
|
8014
8357
|
progress: pullDownProgress,
|
|
8015
8358
|
status: resolvedPullDownStatus,
|
|
8016
|
-
})
|
|
8359
|
+
})) !== null && _f !== void 0 ? _f : resolvedPullDownIconNode)
|
|
8017
8360
|
: null,
|
|
8018
8361
|
vue.h("div", {
|
|
8019
8362
|
class: "cc-virtual-list__content",
|
|
@@ -8028,29 +8371,31 @@ const ClassVirtualList = /*#__PURE__*/ vue.defineComponent({
|
|
|
8028
8371
|
vue.h("div", {
|
|
8029
8372
|
class: props.listClass,
|
|
8030
8373
|
style: { height: `${range.totalSize}px` },
|
|
8031
|
-
}, range.items.map((item) =>
|
|
8032
|
-
|
|
8033
|
-
|
|
8034
|
-
|
|
8035
|
-
|
|
8036
|
-
|
|
8037
|
-
|
|
8038
|
-
|
|
8039
|
-
|
|
8040
|
-
|
|
8374
|
+
}, range.items.map((item) => {
|
|
8375
|
+
var _a;
|
|
8376
|
+
return vue.h("div", {
|
|
8377
|
+
class: props.itemClass,
|
|
8378
|
+
key: item.key,
|
|
8379
|
+
ref: (element) => observeItem(item.index, element),
|
|
8380
|
+
style: { transform: `translateY(${item.start}px)` },
|
|
8381
|
+
}, (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots, {
|
|
8382
|
+
data: props.data[item.index],
|
|
8383
|
+
index: item.index,
|
|
8384
|
+
item,
|
|
8385
|
+
}));
|
|
8386
|
+
})),
|
|
8041
8387
|
props.enablePullUp
|
|
8042
8388
|
? vue.h("div", {
|
|
8043
8389
|
class: props.pullUpClass,
|
|
8044
8390
|
"data-loading": props.pullUpLoading || pullUpPending.value,
|
|
8045
8391
|
ref: pullUpRef,
|
|
8046
|
-
}, slots.pullUp
|
|
8392
|
+
}, (_h = (_g = slots.pullUp) === null || _g === void 0 ? void 0 : _g.call(slots, {
|
|
8047
8393
|
loading: props.pullUpLoading || pullUpPending.value,
|
|
8048
|
-
})
|
|
8049
|
-
|
|
8050
|
-
|
|
8051
|
-
|
|
8052
|
-
|
|
8053
|
-
.virtualListPullUpReadyText))
|
|
8394
|
+
})) !== null && _h !== void 0 ? _h : (props.pullUpLoading || pullUpPending.value
|
|
8395
|
+
? core.getClassComponentsLocale()
|
|
8396
|
+
.virtualListPullUpLoadingText
|
|
8397
|
+
: core.getClassComponentsLocale()
|
|
8398
|
+
.virtualListPullUpReadyText))
|
|
8054
8399
|
: null,
|
|
8055
8400
|
]),
|
|
8056
8401
|
]),
|
|
@@ -8162,11 +8507,13 @@ const ClassMasonryVirtualList = /*#__PURE__*/ vue.defineComponent({
|
|
|
8162
8507
|
emit("rangeChange", { columns, endIndex, startIndex });
|
|
8163
8508
|
}, { immediate: true });
|
|
8164
8509
|
const updateViewportSize = () => {
|
|
8165
|
-
|
|
8166
|
-
|
|
8510
|
+
var _a, _b, _c, _d;
|
|
8511
|
+
viewportHeight.value = (_b = (_a = viewportRef.value) === null || _a === void 0 ? void 0 : _a.clientHeight) !== null && _b !== void 0 ? _b : 0;
|
|
8512
|
+
containerWidth.value = (_d = (_c = viewportRef.value) === null || _c === void 0 ? void 0 : _c.clientWidth) !== null && _d !== void 0 ? _d : 0;
|
|
8167
8513
|
};
|
|
8168
8514
|
const updateHeaderHeight = () => {
|
|
8169
|
-
|
|
8515
|
+
var _a, _b;
|
|
8516
|
+
headerHeight.value = (_b = (_a = headerRef.value) === null || _a === void 0 ? void 0 : _a.offsetHeight) !== null && _b !== void 0 ? _b : 0;
|
|
8170
8517
|
};
|
|
8171
8518
|
vue.onMounted(() => {
|
|
8172
8519
|
updateViewportSize();
|
|
@@ -8187,7 +8534,8 @@ const ClassMasonryVirtualList = /*#__PURE__*/ vue.defineComponent({
|
|
|
8187
8534
|
observers.clear();
|
|
8188
8535
|
});
|
|
8189
8536
|
const observeItem = (index, element) => {
|
|
8190
|
-
|
|
8537
|
+
var _a;
|
|
8538
|
+
(_a = observers.get(index)) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
8191
8539
|
observers.delete(index);
|
|
8192
8540
|
if (!(element instanceof HTMLElement))
|
|
8193
8541
|
return;
|
|
@@ -8226,19 +8574,22 @@ const ClassMasonryVirtualList = /*#__PURE__*/ vue.defineComponent({
|
|
|
8226
8574
|
vue.h("div", {
|
|
8227
8575
|
class: props.listClass,
|
|
8228
8576
|
style: { height: `${range.totalSize}px` },
|
|
8229
|
-
}, range.items.map((item) =>
|
|
8230
|
-
|
|
8231
|
-
|
|
8232
|
-
|
|
8233
|
-
|
|
8234
|
-
|
|
8235
|
-
|
|
8236
|
-
|
|
8237
|
-
|
|
8238
|
-
|
|
8239
|
-
|
|
8240
|
-
|
|
8241
|
-
|
|
8577
|
+
}, range.items.map((item) => {
|
|
8578
|
+
var _a;
|
|
8579
|
+
return vue.h("div", {
|
|
8580
|
+
class: props.itemClass,
|
|
8581
|
+
key: item.key,
|
|
8582
|
+
ref: (element) => observeItem(item.index, element),
|
|
8583
|
+
style: {
|
|
8584
|
+
transform: `translate3d(${item.x}px, ${item.y}px, 0)`,
|
|
8585
|
+
width: `${item.width}px`,
|
|
8586
|
+
},
|
|
8587
|
+
}, (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots, {
|
|
8588
|
+
data: props.data[item.index],
|
|
8589
|
+
index: item.index,
|
|
8590
|
+
item,
|
|
8591
|
+
}));
|
|
8592
|
+
})),
|
|
8242
8593
|
]),
|
|
8243
8594
|
]);
|
|
8244
8595
|
};
|
|
@@ -8551,18 +8902,19 @@ const ClassChatVirtualList = /*#__PURE__*/ vue.defineComponent({
|
|
|
8551
8902
|
props.pullUpThreshold,
|
|
8552
8903
|
viewportHeight.value,
|
|
8553
8904
|
], () => {
|
|
8905
|
+
var _a, _b, _c;
|
|
8554
8906
|
const viewport = viewportRef.value;
|
|
8555
8907
|
const keys = getKeys();
|
|
8556
8908
|
const oldTotal = previousTotal.value;
|
|
8557
|
-
const oldScrollTop = viewport
|
|
8558
|
-
const wasNearBottom = chatController.isNearBottom(oldScrollTop, viewport
|
|
8909
|
+
const oldScrollTop = (_a = viewport === null || viewport === void 0 ? void 0 : viewport.scrollTop) !== null && _a !== void 0 ? _a : previousScrollTop.value;
|
|
8910
|
+
const wasNearBottom = chatController.isNearBottom(oldScrollTop, (_b = viewport === null || viewport === void 0 ? void 0 : viewport.clientHeight) !== null && _b !== void 0 ? _b : viewportHeight.value, oldTotal, (_c = viewport === null || viewport === void 0 ? void 0 : viewport.scrollHeight) !== null && _c !== void 0 ? _c : oldTotal);
|
|
8559
8911
|
const prependCount = chatController.detectPrependCount(previousKeys.value, keys);
|
|
8560
8912
|
const previousAnchor = (() => {
|
|
8913
|
+
var _a;
|
|
8561
8914
|
if (!viewport || previousKeys.value.length === 0)
|
|
8562
8915
|
return null;
|
|
8563
8916
|
const previousRange = listController.getRange(oldScrollTop, viewport.clientHeight || viewportHeight.value);
|
|
8564
|
-
const anchorItem = previousRange.items.find((item) => item.end > oldScrollTop)
|
|
8565
|
-
previousRange.items[0];
|
|
8917
|
+
const anchorItem = (_a = previousRange.items.find((item) => item.end > oldScrollTop)) !== null && _a !== void 0 ? _a : previousRange.items[0];
|
|
8566
8918
|
if (!anchorItem)
|
|
8567
8919
|
return null;
|
|
8568
8920
|
const anchorKey = previousKeys.value[anchorItem.index];
|
|
@@ -8665,7 +9017,8 @@ const ClassChatVirtualList = /*#__PURE__*/ vue.defineComponent({
|
|
|
8665
9017
|
emit("rangeChange", { endIndex, startIndex });
|
|
8666
9018
|
}, { immediate: true });
|
|
8667
9019
|
const updateViewportHeight = () => {
|
|
8668
|
-
|
|
9020
|
+
var _a, _b;
|
|
9021
|
+
viewportHeight.value = (_b = (_a = viewportRef.value) === null || _a === void 0 ? void 0 : _a.clientHeight) !== null && _b !== void 0 ? _b : 0;
|
|
8669
9022
|
};
|
|
8670
9023
|
const triggerPullUp = () => {
|
|
8671
9024
|
if (!props.enablePullUp || props.pullUpLoading || pullUpPending.value)
|
|
@@ -8701,13 +9054,13 @@ const ClassChatVirtualList = /*#__PURE__*/ vue.defineComponent({
|
|
|
8701
9054
|
vue.onMounted(() => {
|
|
8702
9055
|
updateViewportHeight();
|
|
8703
9056
|
const viewport = viewportRef.value;
|
|
8704
|
-
viewport
|
|
9057
|
+
viewport === null || viewport === void 0 ? void 0 : viewport.addEventListener("wheel", preventWhileTopLoading, {
|
|
8705
9058
|
passive: false,
|
|
8706
9059
|
});
|
|
8707
|
-
viewport
|
|
9060
|
+
viewport === null || viewport === void 0 ? void 0 : viewport.addEventListener("touchmove", preventWhileTopLoading, {
|
|
8708
9061
|
passive: false,
|
|
8709
9062
|
});
|
|
8710
|
-
viewport
|
|
9063
|
+
viewport === null || viewport === void 0 ? void 0 : viewport.addEventListener("keydown", preventScrollKeys);
|
|
8711
9064
|
if (typeof ResizeObserver === "undefined" || !viewportRef.value)
|
|
8712
9065
|
return;
|
|
8713
9066
|
const observer = new ResizeObserver(updateViewportHeight);
|
|
@@ -8715,7 +9068,7 @@ const ClassChatVirtualList = /*#__PURE__*/ vue.defineComponent({
|
|
|
8715
9068
|
observers.set("__viewport", observer);
|
|
8716
9069
|
if (typeof IntersectionObserver !== "undefined") {
|
|
8717
9070
|
const pullObserver = new IntersectionObserver(([entry]) => {
|
|
8718
|
-
if (entry
|
|
9071
|
+
if (entry === null || entry === void 0 ? void 0 : entry.isIntersecting)
|
|
8719
9072
|
triggerPullUp();
|
|
8720
9073
|
}, {
|
|
8721
9074
|
root: viewportRef.value,
|
|
@@ -8730,9 +9083,9 @@ const ClassChatVirtualList = /*#__PURE__*/ vue.defineComponent({
|
|
|
8730
9083
|
});
|
|
8731
9084
|
vue.onBeforeUnmount(() => {
|
|
8732
9085
|
const viewport = viewportRef.value;
|
|
8733
|
-
viewport
|
|
8734
|
-
viewport
|
|
8735
|
-
viewport
|
|
9086
|
+
viewport === null || viewport === void 0 ? void 0 : viewport.removeEventListener("wheel", preventWhileTopLoading);
|
|
9087
|
+
viewport === null || viewport === void 0 ? void 0 : viewport.removeEventListener("touchmove", preventWhileTopLoading);
|
|
9088
|
+
viewport === null || viewport === void 0 ? void 0 : viewport.removeEventListener("keydown", preventScrollKeys);
|
|
8736
9089
|
if (bottomFrame !== undefined)
|
|
8737
9090
|
window.cancelAnimationFrame(bottomFrame);
|
|
8738
9091
|
if (bottomTimer !== undefined)
|
|
@@ -8749,11 +9102,13 @@ const ClassChatVirtualList = /*#__PURE__*/ vue.defineComponent({
|
|
|
8749
9102
|
observers.clear();
|
|
8750
9103
|
});
|
|
8751
9104
|
const observeItem = (index, key, element) => {
|
|
8752
|
-
|
|
9105
|
+
var _a;
|
|
9106
|
+
(_a = observers.get(key)) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
8753
9107
|
observers.delete(key);
|
|
8754
9108
|
if (!(element instanceof HTMLElement))
|
|
8755
9109
|
return;
|
|
8756
9110
|
const measure = () => {
|
|
9111
|
+
var _a;
|
|
8757
9112
|
const keys = getKeys();
|
|
8758
9113
|
const oldKeys = previousKeys.value;
|
|
8759
9114
|
const hasPendingKeySync = oldKeys.length !== keys.length ||
|
|
@@ -8763,7 +9118,7 @@ const ClassChatVirtualList = /*#__PURE__*/ vue.defineComponent({
|
|
|
8763
9118
|
const viewport = viewportRef.value;
|
|
8764
9119
|
const oldTotal = listController.getTotalSize();
|
|
8765
9120
|
const oldItem = listController.getItem(index);
|
|
8766
|
-
const oldScrollTop = viewport
|
|
9121
|
+
const oldScrollTop = (_a = viewport === null || viewport === void 0 ? void 0 : viewport.scrollTop) !== null && _a !== void 0 ? _a : 0;
|
|
8767
9122
|
if (!listController.measure(index, element.offsetHeight))
|
|
8768
9123
|
return;
|
|
8769
9124
|
const nextTotal = listController.getTotalSize();
|
|
@@ -8814,6 +9169,7 @@ const ClassChatVirtualList = /*#__PURE__*/ vue.defineComponent({
|
|
|
8814
9169
|
observers.set(key, observer);
|
|
8815
9170
|
};
|
|
8816
9171
|
return () => {
|
|
9172
|
+
var _a, _b, _c, _d;
|
|
8817
9173
|
const range = visibleRange.value;
|
|
8818
9174
|
const resolvedHeight = typeof props.height === "number" ? `${props.height}px` : props.height;
|
|
8819
9175
|
const keys = getKeys();
|
|
@@ -8823,14 +9179,13 @@ const ClassChatVirtualList = /*#__PURE__*/ vue.defineComponent({
|
|
|
8823
9179
|
"data-top-loading": topLoadingPending.value ? "true" : undefined,
|
|
8824
9180
|
style: { "--cc-chat-virtual-list-height": resolvedHeight },
|
|
8825
9181
|
}, [
|
|
8826
|
-
slots.topLoading
|
|
8827
|
-
|
|
8828
|
-
|
|
8829
|
-
|
|
8830
|
-
|
|
8831
|
-
|
|
8832
|
-
|
|
8833
|
-
}),
|
|
9182
|
+
(_b = (_a = slots.topLoading) === null || _a === void 0 ? void 0 : _a.call(slots, { loading: topLoadingPending.value })) !== null && _b !== void 0 ? _b : vue.h(ClassLoading, {
|
|
9183
|
+
"aria-hidden": topLoadingPending.value ? undefined : "true",
|
|
9184
|
+
className: props.topLoadingClass,
|
|
9185
|
+
"data-active": topLoadingPending.value ? "true" : "false",
|
|
9186
|
+
role: topLoadingPending.value ? "status" : undefined,
|
|
9187
|
+
text: props.topLoadingContent,
|
|
9188
|
+
}),
|
|
8834
9189
|
vue.h("div", {
|
|
8835
9190
|
class: props.viewportClass,
|
|
8836
9191
|
"data-top-loading": topLoadingPending.value ? "true" : undefined,
|
|
@@ -8860,13 +9215,14 @@ const ClassChatVirtualList = /*#__PURE__*/ vue.defineComponent({
|
|
|
8860
9215
|
class: props.listClass,
|
|
8861
9216
|
style: { height: `${range.totalSize}px` },
|
|
8862
9217
|
}, range.items.map((item) => {
|
|
8863
|
-
|
|
9218
|
+
var _a, _b;
|
|
9219
|
+
const key = (_a = keys[item.index]) !== null && _a !== void 0 ? _a : item.key;
|
|
8864
9220
|
return vue.h("div", {
|
|
8865
9221
|
class: props.itemClass,
|
|
8866
9222
|
key,
|
|
8867
9223
|
ref: (element) => observeItem(item.index, key, element),
|
|
8868
9224
|
style: { transform: `translateY(${item.start}px)` },
|
|
8869
|
-
}, slots.default
|
|
9225
|
+
}, (_b = slots.default) === null || _b === void 0 ? void 0 : _b.call(slots, {
|
|
8870
9226
|
data: props.data[item.index],
|
|
8871
9227
|
index: item.index,
|
|
8872
9228
|
item,
|
|
@@ -8877,14 +9233,13 @@ const ClassChatVirtualList = /*#__PURE__*/ vue.defineComponent({
|
|
|
8877
9233
|
class: props.pullUpClass,
|
|
8878
9234
|
"data-loading": props.pullUpLoading || pullUpPending.value,
|
|
8879
9235
|
ref: pullUpRef,
|
|
8880
|
-
}, slots.pullUp
|
|
9236
|
+
}, (_d = (_c = slots.pullUp) === null || _c === void 0 ? void 0 : _c.call(slots, {
|
|
8881
9237
|
loading: props.pullUpLoading || pullUpPending.value,
|
|
8882
|
-
})
|
|
8883
|
-
|
|
8884
|
-
|
|
8885
|
-
|
|
8886
|
-
|
|
8887
|
-
.virtualListPullUpReadyText))
|
|
9238
|
+
})) !== null && _d !== void 0 ? _d : (props.pullUpLoading || pullUpPending.value
|
|
9239
|
+
? core.getClassComponentsLocale()
|
|
9240
|
+
.virtualListPullUpLoadingText
|
|
9241
|
+
: core.getClassComponentsLocale()
|
|
9242
|
+
.virtualListPullUpReadyText))
|
|
8888
9243
|
: null,
|
|
8889
9244
|
]),
|
|
8890
9245
|
]);
|
|
@@ -8921,23 +9276,26 @@ const ClassButton = /*#__PURE__*/ vue.defineComponent({
|
|
|
8921
9276
|
if (typeof handler === "function")
|
|
8922
9277
|
handler(event);
|
|
8923
9278
|
};
|
|
8924
|
-
return () =>
|
|
8925
|
-
|
|
8926
|
-
|
|
8927
|
-
|
|
8928
|
-
|
|
8929
|
-
|
|
8930
|
-
|
|
8931
|
-
|
|
8932
|
-
|
|
8933
|
-
|
|
8934
|
-
|
|
8935
|
-
|
|
8936
|
-
|
|
8937
|
-
|
|
8938
|
-
|
|
8939
|
-
|
|
8940
|
-
|
|
9279
|
+
return () => {
|
|
9280
|
+
var _a;
|
|
9281
|
+
return vue.h("button", {
|
|
9282
|
+
...attrs,
|
|
9283
|
+
class: ["cc-button", `cc-button--${props.variant}`, props.className],
|
|
9284
|
+
disabled: props.disabled || props.loading,
|
|
9285
|
+
onClick: (event) => {
|
|
9286
|
+
if (props.disabled || props.loading)
|
|
9287
|
+
return;
|
|
9288
|
+
invokeClick(event);
|
|
9289
|
+
emit("click", event);
|
|
9290
|
+
},
|
|
9291
|
+
type: props.type,
|
|
9292
|
+
}, [
|
|
9293
|
+
props.loading
|
|
9294
|
+
? vue.h("span", { "aria-hidden": "true", class: "cc-button__spinner" })
|
|
9295
|
+
: null,
|
|
9296
|
+
vue.h("span", (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots)),
|
|
9297
|
+
]);
|
|
9298
|
+
};
|
|
8941
9299
|
},
|
|
8942
9300
|
});
|
|
8943
9301
|
function renderDefaultLoadingIndicator() {
|
|
@@ -8977,17 +9335,20 @@ const ClassLoading = /*#__PURE__*/ vue.defineComponent({
|
|
|
8977
9335
|
},
|
|
8978
9336
|
},
|
|
8979
9337
|
setup(props, { attrs, slots }) {
|
|
8980
|
-
return () =>
|
|
8981
|
-
|
|
8982
|
-
|
|
8983
|
-
|
|
8984
|
-
|
|
8985
|
-
|
|
8986
|
-
|
|
8987
|
-
|
|
8988
|
-
|
|
8989
|
-
|
|
8990
|
-
|
|
9338
|
+
return () => {
|
|
9339
|
+
var _a, _b;
|
|
9340
|
+
return vue.h("div", {
|
|
9341
|
+
...attrs,
|
|
9342
|
+
"aria-live": "polite",
|
|
9343
|
+
class: ["cc-loading", props.className],
|
|
9344
|
+
role: "status",
|
|
9345
|
+
}, [
|
|
9346
|
+
vue.h("span", { "aria-hidden": "true", class: "cc-loading__indicator" }, (_b = (_a = slots.indicator) === null || _a === void 0 ? void 0 : _a.call(slots)) !== null && _b !== void 0 ? _b : renderDefaultLoadingIndicator()),
|
|
9347
|
+
props.text
|
|
9348
|
+
? vue.h("span", { class: "cc-loading__text" }, props.text)
|
|
9349
|
+
: null,
|
|
9350
|
+
]);
|
|
9351
|
+
};
|
|
8991
9352
|
},
|
|
8992
9353
|
});
|
|
8993
9354
|
function renderDefaultEmptyIcon() {
|
|
@@ -9051,12 +9412,15 @@ const ClassEmpty = /*#__PURE__*/ vue.defineComponent({
|
|
|
9051
9412
|
},
|
|
9052
9413
|
},
|
|
9053
9414
|
setup(props, { attrs, slots }) {
|
|
9054
|
-
return () =>
|
|
9055
|
-
|
|
9056
|
-
props.
|
|
9057
|
-
|
|
9058
|
-
|
|
9059
|
-
|
|
9415
|
+
return () => {
|
|
9416
|
+
var _a, _b;
|
|
9417
|
+
return vue.h("div", { ...attrs, class: ["cc-empty", props.className], role: "status" }, [
|
|
9418
|
+
vue.h("span", { "aria-hidden": "true", class: "cc-empty__icon" }, (_b = (_a = slots.icon) === null || _a === void 0 ? void 0 : _a.call(slots)) !== null && _b !== void 0 ? _b : renderDefaultEmptyIcon()),
|
|
9419
|
+
props.description
|
|
9420
|
+
? vue.h("span", { class: "cc-empty__description" }, props.description)
|
|
9421
|
+
: null,
|
|
9422
|
+
]);
|
|
9423
|
+
};
|
|
9060
9424
|
},
|
|
9061
9425
|
});
|
|
9062
9426
|
const ClassBadge = /*#__PURE__*/ vue.defineComponent({
|
|
@@ -9073,6 +9437,7 @@ const ClassBadge = /*#__PURE__*/ vue.defineComponent({
|
|
|
9073
9437
|
},
|
|
9074
9438
|
setup(props, { attrs, slots }) {
|
|
9075
9439
|
return () => {
|
|
9440
|
+
var _a;
|
|
9076
9441
|
const state = new core.BadgeController({
|
|
9077
9442
|
dot: props.dot,
|
|
9078
9443
|
max: props.max,
|
|
@@ -9084,7 +9449,7 @@ const ClassBadge = /*#__PURE__*/ vue.defineComponent({
|
|
|
9084
9449
|
class: props.className,
|
|
9085
9450
|
"data-dot": state.dot,
|
|
9086
9451
|
"data-tone": state.tone,
|
|
9087
|
-
}, [slots.default
|
|
9452
|
+
}, [(_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots), vue.h("sup", null, state.displayValue)]);
|
|
9088
9453
|
};
|
|
9089
9454
|
},
|
|
9090
9455
|
});
|
|
@@ -9121,6 +9486,7 @@ const ClassTag = /*#__PURE__*/ vue.defineComponent({
|
|
|
9121
9486
|
setup(props, { attrs, emit, slots }) {
|
|
9122
9487
|
const closing = vue.ref(false);
|
|
9123
9488
|
return () => {
|
|
9489
|
+
var _a;
|
|
9124
9490
|
const state = new core.TagController(props).getState();
|
|
9125
9491
|
return vue.h("span", {
|
|
9126
9492
|
...attrs,
|
|
@@ -9138,7 +9504,7 @@ const ClassTag = /*#__PURE__*/ vue.defineComponent({
|
|
|
9138
9504
|
state.checkable &&
|
|
9139
9505
|
emit("checkedChange", !state.checked),
|
|
9140
9506
|
}, [
|
|
9141
|
-
vue.h("span", slots.default
|
|
9507
|
+
vue.h("span", (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots)),
|
|
9142
9508
|
state.closable
|
|
9143
9509
|
? vue.h("button", {
|
|
9144
9510
|
disabled: state.disabled,
|
|
@@ -9164,12 +9530,13 @@ const ClassSkeleton = /*#__PURE__*/ vue.defineComponent({
|
|
|
9164
9530
|
},
|
|
9165
9531
|
setup(props, { attrs, slots }) {
|
|
9166
9532
|
return () => {
|
|
9533
|
+
var _a;
|
|
9167
9534
|
const state = new core.SkeletonController({
|
|
9168
9535
|
animated: props.animated,
|
|
9169
9536
|
count: props.count,
|
|
9170
9537
|
}).getState();
|
|
9171
|
-
const content = slots.default
|
|
9172
|
-
if (content
|
|
9538
|
+
const content = (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots);
|
|
9539
|
+
if (content === null || content === void 0 ? void 0 : content.length) {
|
|
9173
9540
|
const children = [
|
|
9174
9541
|
vue.h("div", { class: "cc-skeleton__content" }, content),
|
|
9175
9542
|
...(props.loading
|
|
@@ -9224,10 +9591,9 @@ const ClassBreadcrumb = /*#__PURE__*/ vue.defineComponent({
|
|
|
9224
9591
|
});
|
|
9225
9592
|
function renderVueMenuItems(items, collapsed, slots, toggle, select) {
|
|
9226
9593
|
return items.map((item) => {
|
|
9594
|
+
var _a, _b, _c;
|
|
9227
9595
|
const hasChildren = item.children.length > 0;
|
|
9228
|
-
const icon = slots.icon
|
|
9229
|
-
item.icon ??
|
|
9230
|
-
(collapsed ? item.label.slice(0, 1) : undefined);
|
|
9596
|
+
const icon = (_c = (_b = (_a = slots.icon) === null || _a === void 0 ? void 0 : _a.call(slots, { item })) !== null && _b !== void 0 ? _b : item.icon) !== null && _c !== void 0 ? _c : (collapsed ? item.label.slice(0, 1) : undefined);
|
|
9231
9597
|
return vue.h("li", {
|
|
9232
9598
|
class: "cc-menu__item",
|
|
9233
9599
|
"data-active": item.isActive,
|
|
@@ -9470,9 +9836,10 @@ const ClassPopconfirm = /*#__PURE__*/ vue.defineComponent({
|
|
|
9470
9836
|
}, motion.enabled ? motion.duration : 0);
|
|
9471
9837
|
};
|
|
9472
9838
|
const closeOnOutside = (event) => {
|
|
9839
|
+
var _a, _b;
|
|
9473
9840
|
if (!props.closeOnOutsideClick ||
|
|
9474
|
-
rootRef.value
|
|
9475
|
-
panelRef.value
|
|
9841
|
+
((_a = rootRef.value) === null || _a === void 0 ? void 0 : _a.contains(event.target)) ||
|
|
9842
|
+
((_b = panelRef.value) === null || _b === void 0 ? void 0 : _b.contains(event.target)))
|
|
9476
9843
|
return;
|
|
9477
9844
|
hide();
|
|
9478
9845
|
};
|
|
@@ -9498,6 +9865,7 @@ const ClassPopconfirm = /*#__PURE__*/ vue.defineComponent({
|
|
|
9498
9865
|
});
|
|
9499
9866
|
vue.watch(() => props.placement, updatePlacement);
|
|
9500
9867
|
return () => {
|
|
9868
|
+
var _a;
|
|
9501
9869
|
const motion = resolveAnimation(props.animation, "scale");
|
|
9502
9870
|
const rootClass = [
|
|
9503
9871
|
"cc-popconfirm",
|
|
@@ -9529,7 +9897,7 @@ const ClassPopconfirm = /*#__PURE__*/ vue.defineComponent({
|
|
|
9529
9897
|
ref: rootRef,
|
|
9530
9898
|
style: animationStyle(motion),
|
|
9531
9899
|
}, [
|
|
9532
|
-
vue.h("span", { onClick: show }, slots.default
|
|
9900
|
+
vue.h("span", { onClick: show }, (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots)),
|
|
9533
9901
|
props.portal ? null : panelNode,
|
|
9534
9902
|
]);
|
|
9535
9903
|
if (!props.portal)
|
|
@@ -9569,12 +9937,13 @@ const ClassBacktop = /*#__PURE__*/ vue.defineComponent({
|
|
|
9569
9937
|
let currentTarget = null;
|
|
9570
9938
|
let bindFrame = 0;
|
|
9571
9939
|
const resolveTarget = () => {
|
|
9940
|
+
var _a, _b;
|
|
9572
9941
|
const propTarget = props.target;
|
|
9573
9942
|
if (typeof propTarget === "function")
|
|
9574
|
-
return propTarget()
|
|
9943
|
+
return (_a = propTarget()) !== null && _a !== void 0 ? _a : null;
|
|
9575
9944
|
if (typeof propTarget === "string")
|
|
9576
|
-
return document.querySelector(propTarget)
|
|
9577
|
-
return propTarget
|
|
9945
|
+
return (_b = document.querySelector(propTarget)) !== null && _b !== void 0 ? _b : window;
|
|
9946
|
+
return propTarget !== null && propTarget !== void 0 ? propTarget : window;
|
|
9578
9947
|
};
|
|
9579
9948
|
const readScrollTop = (target) => target instanceof Window ? target.scrollY : target.scrollTop;
|
|
9580
9949
|
const writeScrollTop = (target, top) => {
|
|
@@ -9585,7 +9954,8 @@ const ClassBacktop = /*#__PURE__*/ vue.defineComponent({
|
|
|
9585
9954
|
target.scrollTop = top;
|
|
9586
9955
|
};
|
|
9587
9956
|
const scrollToTop = (target) => {
|
|
9588
|
-
|
|
9957
|
+
var _a, _b;
|
|
9958
|
+
const duration = Math.max(0, Number.isFinite((_a = props.duration) !== null && _a !== void 0 ? _a : 0) ? ((_b = props.duration) !== null && _b !== void 0 ? _b : 0) : 0);
|
|
9589
9959
|
if (duration <= 0) {
|
|
9590
9960
|
target.scrollTo({ top: 0, behavior: "smooth" });
|
|
9591
9961
|
return;
|
|
@@ -9602,7 +9972,7 @@ const ClassBacktop = /*#__PURE__*/ vue.defineComponent({
|
|
|
9602
9972
|
requestAnimationFrame(step);
|
|
9603
9973
|
};
|
|
9604
9974
|
const onScroll = () => {
|
|
9605
|
-
const target = currentTarget
|
|
9975
|
+
const target = currentTarget !== null && currentTarget !== void 0 ? currentTarget : resolveTarget();
|
|
9606
9976
|
if (!target)
|
|
9607
9977
|
return;
|
|
9608
9978
|
visible.value = controller.resolve(readScrollTop(target), visible.value).visible;
|
|
@@ -9634,19 +10004,22 @@ const ClassBacktop = /*#__PURE__*/ vue.defineComponent({
|
|
|
9634
10004
|
if (currentTarget)
|
|
9635
10005
|
currentTarget.removeEventListener("scroll", onScroll);
|
|
9636
10006
|
});
|
|
9637
|
-
return () =>
|
|
9638
|
-
|
|
9639
|
-
|
|
9640
|
-
|
|
9641
|
-
|
|
9642
|
-
|
|
9643
|
-
|
|
9644
|
-
|
|
9645
|
-
|
|
9646
|
-
|
|
9647
|
-
|
|
9648
|
-
|
|
9649
|
-
|
|
10007
|
+
return () => {
|
|
10008
|
+
var _a, _b;
|
|
10009
|
+
return visible.value
|
|
10010
|
+
? vue.h("button", {
|
|
10011
|
+
...attrs,
|
|
10012
|
+
class: props.className,
|
|
10013
|
+
type: "button",
|
|
10014
|
+
onClick: (event) => {
|
|
10015
|
+
emit("click", event);
|
|
10016
|
+
const target = currentTarget !== null && currentTarget !== void 0 ? currentTarget : resolveTarget();
|
|
10017
|
+
if (target)
|
|
10018
|
+
scrollToTop(target);
|
|
10019
|
+
},
|
|
10020
|
+
}, (_b = (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots)) !== null && _b !== void 0 ? _b : classIcon("chevronUp"))
|
|
10021
|
+
: null;
|
|
10022
|
+
};
|
|
9650
10023
|
},
|
|
9651
10024
|
});
|
|
9652
10025
|
const ClassAffix = /*#__PURE__*/ vue.defineComponent({
|
|
@@ -9663,10 +10036,11 @@ const ClassAffix = /*#__PURE__*/ vue.defineComponent({
|
|
|
9663
10036
|
const windowTarget = vue.ref(true);
|
|
9664
10037
|
let scrollTarget = window;
|
|
9665
10038
|
const resolveTarget = () => {
|
|
10039
|
+
var _a;
|
|
9666
10040
|
const propTarget = typeof props.target === "function" ? props.target() : props.target;
|
|
9667
10041
|
if (typeof propTarget === "string")
|
|
9668
|
-
return document.querySelector(propTarget)
|
|
9669
|
-
return propTarget
|
|
10042
|
+
return (_a = document.querySelector(propTarget)) !== null && _a !== void 0 ? _a : window;
|
|
10043
|
+
return propTarget !== null && propTarget !== void 0 ? propTarget : window;
|
|
9670
10044
|
};
|
|
9671
10045
|
const onScroll = () => {
|
|
9672
10046
|
const element = scrollTarget;
|
|
@@ -9708,22 +10082,25 @@ const ClassAffix = /*#__PURE__*/ vue.defineComponent({
|
|
|
9708
10082
|
vue.watch(() => props.target, attach);
|
|
9709
10083
|
vue.watch(() => props.offsetTop, onScroll);
|
|
9710
10084
|
vue.onBeforeUnmount(detach);
|
|
9711
|
-
return () =>
|
|
9712
|
-
|
|
9713
|
-
|
|
9714
|
-
|
|
9715
|
-
|
|
9716
|
-
|
|
9717
|
-
|
|
9718
|
-
|
|
9719
|
-
|
|
9720
|
-
|
|
9721
|
-
|
|
9722
|
-
|
|
9723
|
-
|
|
9724
|
-
|
|
9725
|
-
|
|
9726
|
-
|
|
10085
|
+
return () => {
|
|
10086
|
+
var _a;
|
|
10087
|
+
return vue.h("div", {
|
|
10088
|
+
...attrs,
|
|
10089
|
+
class: props.className,
|
|
10090
|
+
"data-fixed": fixed.value,
|
|
10091
|
+
"data-target": windowTarget.value ? "window" : "element",
|
|
10092
|
+
ref: root,
|
|
10093
|
+
style: {
|
|
10094
|
+
...(windowTarget.value && fixed.value
|
|
10095
|
+
? { height: fixedStyle.value.height }
|
|
10096
|
+
: {}),
|
|
10097
|
+
...(!windowTarget.value ? { top: `${props.offsetTop}px` } : {}),
|
|
10098
|
+
},
|
|
10099
|
+
}, vue.h("div", {
|
|
10100
|
+
class: "cc-affix__inner",
|
|
10101
|
+
style: windowTarget.value && fixed.value ? fixedStyle.value : undefined,
|
|
10102
|
+
}, (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots)));
|
|
10103
|
+
};
|
|
9727
10104
|
},
|
|
9728
10105
|
});
|
|
9729
10106
|
const ClassModal = /*#__PURE__*/ vue.defineComponent({
|
|
@@ -9784,7 +10161,8 @@ const ClassModal = /*#__PURE__*/ vue.defineComponent({
|
|
|
9784
10161
|
},
|
|
9785
10162
|
emits: ["update:open"],
|
|
9786
10163
|
setup(props, { attrs, emit, slots }) {
|
|
9787
|
-
|
|
10164
|
+
var _a;
|
|
10165
|
+
const controller = (_a = props.controller) !== null && _a !== void 0 ? _a : new core.ModalController(props.open);
|
|
9788
10166
|
const open = vue.ref(controller.isOpen());
|
|
9789
10167
|
const rendered = vue.ref(open.value);
|
|
9790
10168
|
const panelRef = vue.ref(null);
|
|
@@ -9839,10 +10217,11 @@ const ClassModal = /*#__PURE__*/ vue.defineComponent({
|
|
|
9839
10217
|
clearTimeout(timer);
|
|
9840
10218
|
if (frame)
|
|
9841
10219
|
cancelAnimationFrame(frame);
|
|
9842
|
-
cleanupA11y
|
|
10220
|
+
cleanupA11y === null || cleanupA11y === void 0 ? void 0 : cleanupA11y();
|
|
9843
10221
|
unsubscribe();
|
|
9844
10222
|
});
|
|
9845
10223
|
return () => {
|
|
10224
|
+
var _a, _b;
|
|
9846
10225
|
const motion = resolveAnimation(props.animation, "scale");
|
|
9847
10226
|
const { style: attrStyle, ...restAttrs } = attrs;
|
|
9848
10227
|
const modalNode = vue.h("div", {
|
|
@@ -9880,11 +10259,11 @@ const ClassModal = /*#__PURE__*/ vue.defineComponent({
|
|
|
9880
10259
|
}, props.closeIcon),
|
|
9881
10260
|
])
|
|
9882
10261
|
: null,
|
|
9883
|
-
vue.h("div", { class: "cc-modal__body" }, slots.default
|
|
10262
|
+
vue.h("div", { class: "cc-modal__body" }, (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots)),
|
|
9884
10263
|
]),
|
|
9885
10264
|
]);
|
|
9886
10265
|
return rendered.value
|
|
9887
|
-
? vue.h(vue.Teleport, { to: props.container
|
|
10266
|
+
? vue.h(vue.Teleport, { to: (_b = props.container) !== null && _b !== void 0 ? _b : "body" }, modalNode)
|
|
9888
10267
|
: null;
|
|
9889
10268
|
};
|
|
9890
10269
|
},
|
|
@@ -9959,7 +10338,8 @@ const ClassPopup = /*#__PURE__*/ vue.defineComponent({
|
|
|
9959
10338
|
},
|
|
9960
10339
|
emits: ["update:open"],
|
|
9961
10340
|
setup(props, { attrs, emit, slots }) {
|
|
9962
|
-
|
|
10341
|
+
var _a;
|
|
10342
|
+
const controller = (_a = props.controller) !== null && _a !== void 0 ? _a : new core.PopupController(props.open, props.placement);
|
|
9963
10343
|
const state = vue.ref(controller.getState());
|
|
9964
10344
|
const rendered = vue.ref(state.value.open);
|
|
9965
10345
|
const panelRef = vue.ref(null);
|
|
@@ -9969,6 +10349,7 @@ const ClassPopup = /*#__PURE__*/ vue.defineComponent({
|
|
|
9969
10349
|
let cleanupA11y;
|
|
9970
10350
|
let pushSnapshot = null;
|
|
9971
10351
|
const syncPushTarget = () => {
|
|
10352
|
+
var _a, _b, _c, _d, _e;
|
|
9972
10353
|
const target = props.pushTarget;
|
|
9973
10354
|
if (!target)
|
|
9974
10355
|
return;
|
|
@@ -9982,11 +10363,11 @@ const ClassPopup = /*#__PURE__*/ vue.defineComponent({
|
|
|
9982
10363
|
const original = pushSnapshot;
|
|
9983
10364
|
const motion = resolveAnimation(props.animation, "slide");
|
|
9984
10365
|
const measuredDistance = state.value.placement === "left" || state.value.placement === "right"
|
|
9985
|
-
? (panelRef.value
|
|
9986
|
-
: (panelRef.value
|
|
10366
|
+
? ((_b = (_a = panelRef.value) === null || _a === void 0 ? void 0 : _a.offsetWidth) !== null && _b !== void 0 ? _b : 0)
|
|
10367
|
+
: ((_d = (_c = panelRef.value) === null || _c === void 0 ? void 0 : _c.offsetHeight) !== null && _d !== void 0 ? _d : 0);
|
|
9987
10368
|
const distance = typeof props.pushDistance === "number"
|
|
9988
10369
|
? `${props.pushDistance}px`
|
|
9989
|
-
: (props.pushDistance
|
|
10370
|
+
: ((_e = props.pushDistance) !== null && _e !== void 0 ? _e : `${measuredDistance}px`);
|
|
9990
10371
|
const signedDistance = state.value.placement === "left" || state.value.placement === "top"
|
|
9991
10372
|
? distance
|
|
9992
10373
|
: `calc(-1 * ${distance})`;
|
|
@@ -10053,10 +10434,11 @@ const ClassPopup = /*#__PURE__*/ vue.defineComponent({
|
|
|
10053
10434
|
pushSnapshot.target.style.transition = pushSnapshot.transition;
|
|
10054
10435
|
pushSnapshot = null;
|
|
10055
10436
|
}
|
|
10056
|
-
cleanupA11y
|
|
10437
|
+
cleanupA11y === null || cleanupA11y === void 0 ? void 0 : cleanupA11y();
|
|
10057
10438
|
unsubscribe();
|
|
10058
10439
|
});
|
|
10059
10440
|
return () => {
|
|
10441
|
+
var _a, _b;
|
|
10060
10442
|
const motion = resolveAnimation(props.animation, "slide");
|
|
10061
10443
|
const { style: attrStyle, ...restAttrs } = attrs;
|
|
10062
10444
|
const popupNode = vue.h("div", {
|
|
@@ -10095,11 +10477,11 @@ const ClassPopup = /*#__PURE__*/ vue.defineComponent({
|
|
|
10095
10477
|
}, props.closeIcon),
|
|
10096
10478
|
])
|
|
10097
10479
|
: null,
|
|
10098
|
-
vue.h("div", { class: "cc-popup__body" }, slots.default
|
|
10480
|
+
vue.h("div", { class: "cc-popup__body" }, (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots)),
|
|
10099
10481
|
]),
|
|
10100
10482
|
]);
|
|
10101
10483
|
return rendered.value
|
|
10102
|
-
? vue.h(vue.Teleport, { to: props.container
|
|
10484
|
+
? vue.h(vue.Teleport, { to: (_b = props.container) !== null && _b !== void 0 ? _b : "body" }, popupNode)
|
|
10103
10485
|
: null;
|
|
10104
10486
|
};
|
|
10105
10487
|
},
|
|
@@ -10181,9 +10563,10 @@ const ClassTooltip = /*#__PURE__*/ vue.defineComponent({
|
|
|
10181
10563
|
typeof document === "undefined")
|
|
10182
10564
|
return;
|
|
10183
10565
|
const handlePointerDown = (event) => {
|
|
10566
|
+
var _a, _b;
|
|
10184
10567
|
if (!props.closeOnOutsideClick ||
|
|
10185
|
-
rootRef.value
|
|
10186
|
-
contentRef.value
|
|
10568
|
+
((_a = rootRef.value) === null || _a === void 0 ? void 0 : _a.contains(event.target)) ||
|
|
10569
|
+
((_b = contentRef.value) === null || _b === void 0 ? void 0 : _b.contains(event.target)))
|
|
10187
10570
|
return;
|
|
10188
10571
|
controller.close();
|
|
10189
10572
|
};
|
|
@@ -10209,6 +10592,7 @@ const ClassTooltip = /*#__PURE__*/ vue.defineComponent({
|
|
|
10209
10592
|
});
|
|
10210
10593
|
vue.watch(() => props.placement, () => updatePlacement());
|
|
10211
10594
|
return () => {
|
|
10595
|
+
var _a;
|
|
10212
10596
|
const openEvents = props.trigger === "click"
|
|
10213
10597
|
? {
|
|
10214
10598
|
onClick: () => {
|
|
@@ -10251,7 +10635,7 @@ const ClassTooltip = /*#__PURE__*/ vue.defineComponent({
|
|
|
10251
10635
|
ref: rootRef,
|
|
10252
10636
|
style: animationStyle(motion),
|
|
10253
10637
|
tabindex: props.trigger === "click" ? 0 : undefined,
|
|
10254
|
-
}, [slots.default
|
|
10638
|
+
}, [(_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots), props.portal ? null : tooltipContent]);
|
|
10255
10639
|
if (!props.portal)
|
|
10256
10640
|
return rootNode;
|
|
10257
10641
|
const portalNode = open.value || anchorStyle.value.left > -9999
|
|
@@ -10298,7 +10682,8 @@ const ClassToastViewport = /*#__PURE__*/ vue.defineComponent({
|
|
|
10298
10682
|
},
|
|
10299
10683
|
},
|
|
10300
10684
|
setup(props, { attrs, slots }) {
|
|
10301
|
-
|
|
10685
|
+
var _a;
|
|
10686
|
+
const activeManager = vue.shallowRef((_a = props.manager) !== null && _a !== void 0 ? _a : defaultToastManager);
|
|
10302
10687
|
const items = vue.shallowRef(activeManager.value.getToasts());
|
|
10303
10688
|
const getVisibleItems = (source) => {
|
|
10304
10689
|
const positionItems = source.filter((item) => item.position === props.position);
|
|
@@ -10372,13 +10757,16 @@ const ClassToastViewport = /*#__PURE__*/ vue.defineComponent({
|
|
|
10372
10757
|
const enteringIds = nextItems
|
|
10373
10758
|
.filter((item) => !currentIds.has(item.id))
|
|
10374
10759
|
.map((item) => item.id);
|
|
10375
|
-
const retainedOrExiting = renderedItems.value.map(({ item }) =>
|
|
10376
|
-
|
|
10377
|
-
|
|
10378
|
-
|
|
10379
|
-
|
|
10380
|
-
:
|
|
10381
|
-
|
|
10760
|
+
const retainedOrExiting = renderedItems.value.map(({ item }) => {
|
|
10761
|
+
var _a;
|
|
10762
|
+
return ({
|
|
10763
|
+
item: (_a = incomingById.get(item.id)) !== null && _a !== void 0 ? _a : item,
|
|
10764
|
+
motion: !incomingIds.has(item.id),
|
|
10765
|
+
state: incomingIds.has(item.id)
|
|
10766
|
+
? "enter"
|
|
10767
|
+
: "exit",
|
|
10768
|
+
});
|
|
10769
|
+
});
|
|
10382
10770
|
const entering = nextItems
|
|
10383
10771
|
.filter((item) => !currentIds.has(item.id))
|
|
10384
10772
|
.map((item) => ({ item, motion: true, state: "prepare" }));
|
|
@@ -10425,7 +10813,7 @@ const ClassToastViewport = /*#__PURE__*/ vue.defineComponent({
|
|
|
10425
10813
|
};
|
|
10426
10814
|
subscribeManager(activeManager.value);
|
|
10427
10815
|
vue.watch(() => props.manager, (nextManager) => {
|
|
10428
|
-
subscribeManager(nextManager
|
|
10816
|
+
subscribeManager(nextManager !== null && nextManager !== void 0 ? nextManager : defaultToastManager);
|
|
10429
10817
|
});
|
|
10430
10818
|
vue.watch(() => [props.position, props.maxVisible], () => syncRenderedItems(getVisibleItems(items.value)));
|
|
10431
10819
|
vue.onBeforeUnmount(() => {
|
|
@@ -10514,7 +10902,8 @@ const ClassTabs = /*#__PURE__*/ vue.defineComponent({
|
|
|
10514
10902
|
},
|
|
10515
10903
|
emits: ["update:activeId"],
|
|
10516
10904
|
setup(props, { attrs, emit, slots }) {
|
|
10517
|
-
|
|
10905
|
+
var _a;
|
|
10906
|
+
const controller = (_a = props.controller) !== null && _a !== void 0 ? _a : new core.TabsController(props.tabs, props.activeId);
|
|
10518
10907
|
const activeId = vue.ref(controller.getActiveId());
|
|
10519
10908
|
const visited = vue.ref(new Set([activeId.value]));
|
|
10520
10909
|
const direction = vue.ref("forward");
|
|
@@ -10529,7 +10918,7 @@ const ClassTabs = /*#__PURE__*/ vue.defineComponent({
|
|
|
10529
10918
|
};
|
|
10530
10919
|
const unsubscribe = controller.subscribe((nextActiveId) => {
|
|
10531
10920
|
const tabsAnimation = props.animation;
|
|
10532
|
-
direction.value = resolveTabsDirection(props.tabs, activeId.value, nextActiveId, tabsAnimation === false ? "none" : tabsAnimation
|
|
10921
|
+
direction.value = resolveTabsDirection(props.tabs, activeId.value, nextActiveId, tabsAnimation === false ? "none" : tabsAnimation === null || tabsAnimation === void 0 ? void 0 : tabsAnimation.direction);
|
|
10533
10922
|
activeId.value = nextActiveId;
|
|
10534
10923
|
visited.value = new Set([...visited.value, nextActiveId]);
|
|
10535
10924
|
emit("update:activeId", nextActiveId);
|
|
@@ -10543,7 +10932,7 @@ const ClassTabs = /*#__PURE__*/ vue.defineComponent({
|
|
|
10543
10932
|
return () => {
|
|
10544
10933
|
const tabsAnimation = props.animation;
|
|
10545
10934
|
const tabsFallbackAnimation = tabsAnimation !== false &&
|
|
10546
|
-
tabsAnimation
|
|
10935
|
+
(tabsAnimation === null || tabsAnimation === void 0 ? void 0 : tabsAnimation.direction) &&
|
|
10547
10936
|
tabsAnimation.direction !== "none"
|
|
10548
10937
|
? "slide"
|
|
10549
10938
|
: "fade";
|
|
@@ -10573,6 +10962,7 @@ const ClassTabs = /*#__PURE__*/ vue.defineComponent({
|
|
|
10573
10962
|
onClick: () => controller.activate(tab.id),
|
|
10574
10963
|
}, tab.label))),
|
|
10575
10964
|
vue.h("div", { class: "cc-tabs__panes" }, panelIds.map((panelId) => {
|
|
10965
|
+
var _a, _b, _c, _d, _e;
|
|
10576
10966
|
const active = panelId === activeId.value;
|
|
10577
10967
|
const loading = resolveFlag(props.loadingTabs, panelId);
|
|
10578
10968
|
const empty = !loading && resolveFlag(props.emptyTabs, panelId);
|
|
@@ -10585,18 +10975,16 @@ const ClassTabs = /*#__PURE__*/ vue.defineComponent({
|
|
|
10585
10975
|
key: panelId,
|
|
10586
10976
|
role: "tabpanel",
|
|
10587
10977
|
}, loading
|
|
10588
|
-
? (slots.loading
|
|
10589
|
-
|
|
10590
|
-
|
|
10591
|
-
|
|
10592
|
-
}))
|
|
10978
|
+
? ((_b = (_a = slots.loading) === null || _a === void 0 ? void 0 : _a.call(slots, { activeId: panelId })) !== null && _b !== void 0 ? _b : vue.h(ClassLoading, {
|
|
10979
|
+
className: "cc-tabs__loading",
|
|
10980
|
+
text: core.getClassComponentsLocale().tabsLoadingText,
|
|
10981
|
+
}))
|
|
10593
10982
|
: empty
|
|
10594
|
-
? (slots.empty
|
|
10595
|
-
|
|
10596
|
-
|
|
10597
|
-
|
|
10598
|
-
|
|
10599
|
-
: slots.default?.({ activeId: panelId, active }));
|
|
10983
|
+
? ((_d = (_c = slots.empty) === null || _c === void 0 ? void 0 : _c.call(slots, { activeId: panelId })) !== null && _d !== void 0 ? _d : vue.h(ClassEmpty, {
|
|
10984
|
+
className: "cc-tabs__empty",
|
|
10985
|
+
description: core.getClassComponentsLocale().tabsEmptyText,
|
|
10986
|
+
}))
|
|
10987
|
+
: (_e = slots.default) === null || _e === void 0 ? void 0 : _e.call(slots, { activeId: panelId, active }));
|
|
10600
10988
|
})),
|
|
10601
10989
|
]);
|
|
10602
10990
|
};
|
|
@@ -10671,9 +11059,12 @@ const ClassTable = /*#__PURE__*/ vue.defineComponent({
|
|
|
10671
11059
|
let resizeObserver;
|
|
10672
11060
|
let bodyResizeObserver;
|
|
10673
11061
|
let settingsTimer;
|
|
10674
|
-
const getContentWidth = () =>
|
|
10675
|
-
|
|
10676
|
-
(
|
|
11062
|
+
const getContentWidth = () => {
|
|
11063
|
+
var _a, _b;
|
|
11064
|
+
return Math.max(0, ((_b = (_a = rootRef.value) === null || _a === void 0 ? void 0 : _a.clientWidth) !== null && _b !== void 0 ? _b : 0) -
|
|
11065
|
+
(props.rowSelection ? 44 : 0) -
|
|
11066
|
+
(props.virtual ? bodyScrollbarWidth.value : 0));
|
|
11067
|
+
};
|
|
10677
11068
|
const updateContainerWidth = () => {
|
|
10678
11069
|
containerWidth.value = getContentWidth();
|
|
10679
11070
|
};
|
|
@@ -10737,10 +11128,11 @@ const ClassTable = /*#__PURE__*/ vue.defineComponent({
|
|
|
10737
11128
|
showSettings();
|
|
10738
11129
|
};
|
|
10739
11130
|
const closeSettingsOnOutside = (event) => {
|
|
11131
|
+
var _a, _b;
|
|
10740
11132
|
const target = event.target;
|
|
10741
11133
|
if (!settingsOpen.value ||
|
|
10742
|
-
settingsRef.value
|
|
10743
|
-
settingsMenuRef.value
|
|
11134
|
+
((_a = settingsRef.value) === null || _a === void 0 ? void 0 : _a.contains(target)) ||
|
|
11135
|
+
((_b = settingsMenuRef.value) === null || _b === void 0 ? void 0 : _b.contains(target)))
|
|
10744
11136
|
return;
|
|
10745
11137
|
hideSettings();
|
|
10746
11138
|
};
|
|
@@ -10802,8 +11194,8 @@ const ClassTable = /*#__PURE__*/ vue.defineComponent({
|
|
|
10802
11194
|
}
|
|
10803
11195
|
});
|
|
10804
11196
|
vue.onBeforeUnmount(() => {
|
|
10805
|
-
resizeObserver
|
|
10806
|
-
bodyResizeObserver
|
|
11197
|
+
resizeObserver === null || resizeObserver === void 0 ? void 0 : resizeObserver.disconnect();
|
|
11198
|
+
bodyResizeObserver === null || bodyResizeObserver === void 0 ? void 0 : bodyResizeObserver.disconnect();
|
|
10807
11199
|
document.removeEventListener("mousedown", closeSettingsOnOutside);
|
|
10808
11200
|
window.removeEventListener("resize", updateSettingsPosition);
|
|
10809
11201
|
window.removeEventListener("scroll", updateSettingsPosition, true);
|
|
@@ -10813,8 +11205,8 @@ const ClassTable = /*#__PURE__*/ vue.defineComponent({
|
|
|
10813
11205
|
window.removeEventListener("resize", updateContainerWidth);
|
|
10814
11206
|
});
|
|
10815
11207
|
return () => {
|
|
10816
|
-
|
|
10817
|
-
|
|
11208
|
+
var _a, _b, _c, _d, _e, _f;
|
|
11209
|
+
const tableViewportWidth = (_b = (_a = rootRef.value) === null || _a === void 0 ? void 0 : _a.clientWidth) !== null && _b !== void 0 ? _b : containerWidth.value + (props.rowSelection ? 44 : 0);
|
|
10818
11210
|
const displayColumns = state.value.columns;
|
|
10819
11211
|
const dataGridTemplateColumns = `${props.rowSelection ? "44px " : ""}${displayColumns.map((column) => `${column.width}px`).join(" ")}`;
|
|
10820
11212
|
const headerScrollbarWidth = props.virtual ? bodyScrollbarWidth.value : 0;
|
|
@@ -10854,17 +11246,18 @@ const ClassTable = /*#__PURE__*/ vue.defineComponent({
|
|
|
10854
11246
|
: tableWidthStyle;
|
|
10855
11247
|
const hasHorizontalOverflow = tableContentWidth() + headerScrollbarWidth > tableViewportWidth + 1;
|
|
10856
11248
|
const getFixedEdge = (column) => {
|
|
11249
|
+
var _a, _b;
|
|
10857
11250
|
if (!hasHorizontalOverflow)
|
|
10858
11251
|
return undefined;
|
|
10859
11252
|
if (column.fixed === "left") {
|
|
10860
11253
|
const leftFixed = displayColumns.filter((item) => item.fixed === "left");
|
|
10861
|
-
return leftFixed[leftFixed.length - 1]
|
|
11254
|
+
return ((_a = leftFixed[leftFixed.length - 1]) === null || _a === void 0 ? void 0 : _a.key) === column.key
|
|
10862
11255
|
? "left"
|
|
10863
11256
|
: undefined;
|
|
10864
11257
|
}
|
|
10865
11258
|
if (column.fixed === "right") {
|
|
10866
11259
|
const rightFixed = displayColumns.filter((item) => item.fixed === "right");
|
|
10867
|
-
return rightFixed[0]
|
|
11260
|
+
return ((_b = rightFixed[0]) === null || _b === void 0 ? void 0 : _b.key) === column.key ? "right" : undefined;
|
|
10868
11261
|
}
|
|
10869
11262
|
return undefined;
|
|
10870
11263
|
};
|
|
@@ -10916,16 +11309,18 @@ const ClassTable = /*#__PURE__*/ vue.defineComponent({
|
|
|
10916
11309
|
: undefined,
|
|
10917
11310
|
}, renderCheckbox(state.value.selectedKeys.includes(key), false, `${core.getClassComponentsLocale().tableSelectRowLabel} ${String(key)}`, (checked) => toggle(key, checked)))
|
|
10918
11311
|
: null,
|
|
10919
|
-
...displayColumns.map((column) =>
|
|
10920
|
-
|
|
10921
|
-
"
|
|
10922
|
-
|
|
10923
|
-
:
|
|
10924
|
-
|
|
10925
|
-
|
|
10926
|
-
|
|
10927
|
-
|
|
10928
|
-
|
|
11312
|
+
...displayColumns.map((column) => {
|
|
11313
|
+
var _a, _b, _c;
|
|
11314
|
+
return vue.h("div", {
|
|
11315
|
+
class: "cc-table__cell",
|
|
11316
|
+
"data-fixed": hasHorizontalOverflow
|
|
11317
|
+
? column.fixed
|
|
11318
|
+
: undefined,
|
|
11319
|
+
"data-fixed-edge": getFixedEdge(column),
|
|
11320
|
+
key: column.key,
|
|
11321
|
+
style: getColumnStickyStyle(column),
|
|
11322
|
+
}, (_b = (_a = slots.cell) === null || _a === void 0 ? void 0 : _a.call(slots, { column, row, rowIndex })) !== null && _b !== void 0 ? _b : String((_c = row[column.dataIndex]) !== null && _c !== void 0 ? _c : ""));
|
|
11323
|
+
}),
|
|
10929
11324
|
]);
|
|
10930
11325
|
};
|
|
10931
11326
|
return vue.h("div", {
|
|
@@ -11058,11 +11453,10 @@ const ClassTable = /*#__PURE__*/ vue.defineComponent({
|
|
|
11058
11453
|
: bodyWidthStyle,
|
|
11059
11454
|
}, !props.loading && state.value.rows.length === 0
|
|
11060
11455
|
? [
|
|
11061
|
-
vue.h("div", { class: "cc-table__state" }, slots.empty
|
|
11062
|
-
|
|
11063
|
-
|
|
11064
|
-
|
|
11065
|
-
})),
|
|
11456
|
+
vue.h("div", { class: "cc-table__state" }, (_d = (_c = slots.empty) === null || _c === void 0 ? void 0 : _c.call(slots)) !== null && _d !== void 0 ? _d : vue.h(ClassEmpty, {
|
|
11457
|
+
className: "cc-table__empty",
|
|
11458
|
+
description: props.emptyText,
|
|
11459
|
+
})),
|
|
11066
11460
|
]
|
|
11067
11461
|
: props.virtual && range
|
|
11068
11462
|
? [
|
|
@@ -11086,8 +11480,7 @@ const ClassTable = /*#__PURE__*/ vue.defineComponent({
|
|
|
11086
11480
|
? vue.h("div", {
|
|
11087
11481
|
class: "cc-table__loading",
|
|
11088
11482
|
"data-cover-header": props.loadingCoverHeader,
|
|
11089
|
-
}, slots.loading
|
|
11090
|
-
vue.h(ClassLoading, { text: props.loadingText }))
|
|
11483
|
+
}, (_f = (_e = slots.loading) === null || _e === void 0 ? void 0 : _e.call(slots)) !== null && _f !== void 0 ? _f : vue.h(ClassLoading, { text: props.loadingText }))
|
|
11091
11484
|
: null,
|
|
11092
11485
|
]);
|
|
11093
11486
|
};
|
|
@@ -11131,9 +11524,10 @@ const ClassUpload = /*#__PURE__*/ vue.defineComponent({
|
|
|
11131
11524
|
},
|
|
11132
11525
|
emits: ["change"],
|
|
11133
11526
|
setup(props, { attrs, emit }) {
|
|
11527
|
+
var _a;
|
|
11134
11528
|
const form = vue.inject(formSymbol, null);
|
|
11135
11529
|
const formInteractivity = useFormInteractivity();
|
|
11136
|
-
const formState = vue.shallowRef(form
|
|
11530
|
+
const formState = vue.shallowRef((_a = form === null || form === void 0 ? void 0 : form.getState()) !== null && _a !== void 0 ? _a : null);
|
|
11137
11531
|
const inputRef = vue.ref(null);
|
|
11138
11532
|
const controller = new core.UploadController({
|
|
11139
11533
|
accept: props.accept,
|
|
@@ -11145,20 +11539,21 @@ const ClassUpload = /*#__PURE__*/ vue.defineComponent({
|
|
|
11145
11539
|
let unsubscribeField;
|
|
11146
11540
|
let unsubscribeForm;
|
|
11147
11541
|
vue.onMounted(() => {
|
|
11542
|
+
var _a;
|
|
11148
11543
|
if (!form || !props.name)
|
|
11149
11544
|
return;
|
|
11150
11545
|
unsubscribeForm = form.subscribe((nextState) => {
|
|
11151
11546
|
formState.value = nextState;
|
|
11152
11547
|
});
|
|
11153
11548
|
unsubscribeField = form.registerField(props.name, {
|
|
11154
|
-
initialValue: props.initialValue
|
|
11549
|
+
initialValue: (_a = props.initialValue) !== null && _a !== void 0 ? _a : [],
|
|
11155
11550
|
rules: props.rules,
|
|
11156
11551
|
validateOn: props.validateOn,
|
|
11157
11552
|
});
|
|
11158
11553
|
});
|
|
11159
11554
|
vue.onBeforeUnmount(() => {
|
|
11160
|
-
unsubscribeField
|
|
11161
|
-
unsubscribeForm
|
|
11555
|
+
unsubscribeField === null || unsubscribeField === void 0 ? void 0 : unsubscribeField();
|
|
11556
|
+
unsubscribeForm === null || unsubscribeForm === void 0 ? void 0 : unsubscribeForm();
|
|
11162
11557
|
});
|
|
11163
11558
|
vue.watch(() => [props.accept, props.maxSize, props.multiple], () => {
|
|
11164
11559
|
state.value = controller.updateOptions({
|
|
@@ -11167,7 +11562,7 @@ const ClassUpload = /*#__PURE__*/ vue.defineComponent({
|
|
|
11167
11562
|
multiple: props.multiple,
|
|
11168
11563
|
});
|
|
11169
11564
|
});
|
|
11170
|
-
vue.watch(() => props.name ? formState.value
|
|
11565
|
+
vue.watch(() => { var _a, _b; return props.name ? (_b = (_a = formState.value) === null || _a === void 0 ? void 0 : _a.fields[props.name]) === null || _b === void 0 ? void 0 : _b.value : undefined; }, (nextValue) => {
|
|
11171
11566
|
if (!Array.isArray(nextValue))
|
|
11172
11567
|
return;
|
|
11173
11568
|
state.value = controller.replaceFiles(nextValue);
|
|
@@ -11178,19 +11573,21 @@ const ClassUpload = /*#__PURE__*/ vue.defineComponent({
|
|
|
11178
11573
|
emit("change", files);
|
|
11179
11574
|
};
|
|
11180
11575
|
const addFiles = (files) => {
|
|
11181
|
-
|
|
11576
|
+
var _a;
|
|
11577
|
+
const interactivity = resolveFieldInteractivity(formInteractivity, props.disabled, (_a = props.readOnly) !== null && _a !== void 0 ? _a : props.readonly);
|
|
11182
11578
|
if (interactivity.disabled || interactivity.readOnly)
|
|
11183
11579
|
return;
|
|
11184
11580
|
state.value = controller.addFiles(Array.from(files));
|
|
11185
11581
|
commitFiles(state.value.files);
|
|
11186
11582
|
};
|
|
11187
11583
|
return () => {
|
|
11188
|
-
|
|
11584
|
+
var _a, _b, _c, _d;
|
|
11585
|
+
const interactivity = resolveFieldInteractivity(formInteractivity, props.disabled, (_a = props.readOnly) !== null && _a !== void 0 ? _a : props.readonly);
|
|
11189
11586
|
const locked = interactivity.disabled || interactivity.readOnly;
|
|
11190
11587
|
const field = props.name
|
|
11191
|
-
? formState.value
|
|
11588
|
+
? (_b = formState.value) === null || _b === void 0 ? void 0 : _b.fields[props.name]
|
|
11192
11589
|
: undefined;
|
|
11193
|
-
const errors = field
|
|
11590
|
+
const errors = (_c = field === null || field === void 0 ? void 0 : field.errors) !== null && _c !== void 0 ? _c : [];
|
|
11194
11591
|
const errorId = props.name ? `${props.name}-error` : undefined;
|
|
11195
11592
|
const upload = vue.h("div", {
|
|
11196
11593
|
...attrs,
|
|
@@ -11209,9 +11606,10 @@ const ClassUpload = /*#__PURE__*/ vue.defineComponent({
|
|
|
11209
11606
|
},
|
|
11210
11607
|
onDragover: (event) => event.preventDefault(),
|
|
11211
11608
|
onDrop: (event) => {
|
|
11609
|
+
var _a;
|
|
11212
11610
|
event.preventDefault();
|
|
11213
11611
|
dragging.value = false;
|
|
11214
|
-
if (!locked && event.dataTransfer
|
|
11612
|
+
if (!locked && ((_a = event.dataTransfer) === null || _a === void 0 ? void 0 : _a.files))
|
|
11215
11613
|
addFiles(event.dataTransfer.files);
|
|
11216
11614
|
},
|
|
11217
11615
|
}, [
|
|
@@ -11230,7 +11628,7 @@ const ClassUpload = /*#__PURE__*/ vue.defineComponent({
|
|
|
11230
11628
|
vue.h("button", {
|
|
11231
11629
|
disabled: locked,
|
|
11232
11630
|
type: "button",
|
|
11233
|
-
onClick: () => inputRef.value
|
|
11631
|
+
onClick: () => { var _a; return (_a = inputRef.value) === null || _a === void 0 ? void 0 : _a.click(); },
|
|
11234
11632
|
}, props.buttonText),
|
|
11235
11633
|
vue.h("span", { class: "cc-upload__drag" }, props.dragText),
|
|
11236
11634
|
vue.h("ul", null, state.value.files.map((file) => vue.h("li", { key: file.id }, [
|
|
@@ -11259,7 +11657,7 @@ const ClassUpload = /*#__PURE__*/ vue.defineComponent({
|
|
|
11259
11657
|
: null,
|
|
11260
11658
|
upload,
|
|
11261
11659
|
errors.length > 0 && errorId
|
|
11262
|
-
? vue.h("span", { class: props.errorClass
|
|
11660
|
+
? vue.h("span", { class: (_d = props.errorClass) !== null && _d !== void 0 ? _d : "cc-field__error", id: errorId }, errors[0])
|
|
11263
11661
|
: null,
|
|
11264
11662
|
]);
|
|
11265
11663
|
};
|
|
@@ -11303,7 +11701,7 @@ const ClassNovelReader = /*#__PURE__*/ vue.defineComponent({
|
|
|
11303
11701
|
const dragState = vue.ref(null);
|
|
11304
11702
|
let activeDragState = null;
|
|
11305
11703
|
const turningPage = vue.ref(null);
|
|
11306
|
-
const activeCurrent = () => props.current
|
|
11704
|
+
const activeCurrent = () => { var _a; return (_a = props.current) !== null && _a !== void 0 ? _a : innerCurrent.value; };
|
|
11307
11705
|
const finishTurn = () => {
|
|
11308
11706
|
const finished = turningPage.value;
|
|
11309
11707
|
if (!finished)
|
|
@@ -11315,15 +11713,16 @@ const ClassNovelReader = /*#__PURE__*/ vue.defineComponent({
|
|
|
11315
11713
|
turningPage.value = null;
|
|
11316
11714
|
};
|
|
11317
11715
|
let turnTimer;
|
|
11318
|
-
const renderNovelPage = (page, current, total, className, onAnimationEnd, key) =>
|
|
11319
|
-
|
|
11320
|
-
|
|
11321
|
-
|
|
11322
|
-
core.getClassComponentsLocale().novelReaderTitle),
|
|
11323
|
-
|
|
11324
|
-
|
|
11325
|
-
|
|
11326
|
-
|
|
11716
|
+
const renderNovelPage = (page, current, total, className, onAnimationEnd, key) => {
|
|
11717
|
+
var _a, _b, _c;
|
|
11718
|
+
return vue.h("div", { class: className, key, onAnimationEnd }, [
|
|
11719
|
+
vue.h("div", { class: "cc-novel-reader__header" }, [
|
|
11720
|
+
vue.h("strong", null, (_b = (_a = page === null || page === void 0 ? void 0 : page.title) !== null && _a !== void 0 ? _a : props.title) !== null && _b !== void 0 ? _b : core.getClassComponentsLocale().novelReaderTitle),
|
|
11721
|
+
vue.h("span", null, total ? `${current + 1} / ${total}` : "0 / 0"),
|
|
11722
|
+
]),
|
|
11723
|
+
vue.h("div", { class: "cc-novel-reader__content" }, (_c = page === null || page === void 0 ? void 0 : page.content) !== null && _c !== void 0 ? _c : core.getClassComponentsLocale().novelReaderEmptyText),
|
|
11724
|
+
]);
|
|
11725
|
+
};
|
|
11327
11726
|
const getStateAt = (nextCurrent) => {
|
|
11328
11727
|
const total = props.pages.length;
|
|
11329
11728
|
const normalized = props.loop && total > 0
|
|
@@ -11378,7 +11777,7 @@ const ClassNovelReader = /*#__PURE__*/ vue.defineComponent({
|
|
|
11378
11777
|
clearTimeout(turnTimer);
|
|
11379
11778
|
});
|
|
11380
11779
|
const updateDrag = (pointerId, clientX, width, state, end = false) => {
|
|
11381
|
-
const drag = activeDragState
|
|
11780
|
+
const drag = activeDragState !== null && activeDragState !== void 0 ? activeDragState : dragState.value;
|
|
11382
11781
|
if (!drag || drag.pointerId !== pointerId)
|
|
11383
11782
|
return;
|
|
11384
11783
|
const delta = clientX - drag.startX;
|
|
@@ -11410,15 +11809,16 @@ const ClassNovelReader = /*#__PURE__*/ vue.defineComponent({
|
|
|
11410
11809
|
dragState.value = activeDragState;
|
|
11411
11810
|
};
|
|
11412
11811
|
return () => {
|
|
11812
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9;
|
|
11413
11813
|
const state = new core.NovelReaderController({
|
|
11414
11814
|
current: activeCurrent(),
|
|
11415
11815
|
loop: props.loop,
|
|
11416
11816
|
pages: props.pages,
|
|
11417
11817
|
}).getState();
|
|
11418
|
-
const activeTurningPage = turningPage.value
|
|
11419
|
-
const dragMetrics = dragState.value
|
|
11420
|
-
const releaseProgress = turningPage.value
|
|
11421
|
-
const dragProgress = dragMetrics
|
|
11818
|
+
const activeTurningPage = (_a = turningPage.value) !== null && _a !== void 0 ? _a : dragState.value;
|
|
11819
|
+
const dragMetrics = (_b = dragState.value) === null || _b === void 0 ? void 0 : _b.metrics;
|
|
11820
|
+
const releaseProgress = (_d = (_c = turningPage.value) === null || _c === void 0 ? void 0 : _c.releaseProgress) !== null && _d !== void 0 ? _d : 0;
|
|
11821
|
+
const dragProgress = (_e = dragMetrics === null || dragMetrics === void 0 ? void 0 : dragMetrics.progress) !== null && _e !== void 0 ? _e : releaseProgress;
|
|
11422
11822
|
const releaseDuration = Math.max(80, Math.round(props.animationDuration * (1 - releaseProgress)));
|
|
11423
11823
|
const releaseEnterOpacity = 0.18 + releaseProgress * 0.82;
|
|
11424
11824
|
const releaseLeaveOpacity = 1 - releaseProgress * 0.82;
|
|
@@ -11427,9 +11827,7 @@ const ClassNovelReader = /*#__PURE__*/ vue.defineComponent({
|
|
|
11427
11827
|
const releaseEnterNextX = (1 - releaseProgress) * 10;
|
|
11428
11828
|
const releaseEnterPreviousX = (releaseProgress - 1) * 10;
|
|
11429
11829
|
const releaseLeaveX = releaseProgress * 18;
|
|
11430
|
-
const activeDirection = dragMetrics
|
|
11431
|
-
activeTurningPage?.direction ??
|
|
11432
|
-
direction.value;
|
|
11830
|
+
const activeDirection = (_g = (_f = dragMetrics === null || dragMetrics === void 0 ? void 0 : dragMetrics.direction) !== null && _f !== void 0 ? _f : activeTurningPage === null || activeTurningPage === void 0 ? void 0 : activeTurningPage.direction) !== null && _g !== void 0 ? _g : direction.value;
|
|
11433
11831
|
const dragSign = activeDirection === "previous" ? 1 : -1;
|
|
11434
11832
|
const dragCanTurn = dragState.value
|
|
11435
11833
|
? dragState.value.direction === "next"
|
|
@@ -11452,26 +11850,26 @@ const ClassNovelReader = /*#__PURE__*/ vue.defineComponent({
|
|
|
11452
11850
|
ref: readerRef,
|
|
11453
11851
|
class: props.className,
|
|
11454
11852
|
"data-animation": props.animation,
|
|
11455
|
-
"data-direction": dragState.value
|
|
11853
|
+
"data-direction": (_j = (_h = dragState.value) === null || _h === void 0 ? void 0 : _h.direction) !== null && _j !== void 0 ? _j : direction.value,
|
|
11456
11854
|
"data-dragging": dragState.value ? "true" : "false",
|
|
11457
11855
|
"data-turning": activeTurningPage ? "true" : "false",
|
|
11458
11856
|
style: [
|
|
11459
11857
|
inheritedStyle,
|
|
11460
11858
|
{
|
|
11461
11859
|
"--cc-novel-reader-duration": `${props.animationDuration}ms`,
|
|
11462
|
-
"--cc-novel-drag-angle": `${dragMetrics
|
|
11463
|
-
"--cc-novel-drag-clip-end": `${dragMetrics
|
|
11464
|
-
"--cc-novel-drag-clip-x": `${dragMetrics
|
|
11465
|
-
"--cc-novel-drag-clip-y": `${(dragMetrics
|
|
11466
|
-
"--cc-novel-drag-curl": dragMetrics
|
|
11860
|
+
"--cc-novel-drag-angle": `${(_k = dragMetrics === null || dragMetrics === void 0 ? void 0 : dragMetrics.angle) !== null && _k !== void 0 ? _k : 0}deg`,
|
|
11861
|
+
"--cc-novel-drag-clip-end": `${(_l = dragMetrics === null || dragMetrics === void 0 ? void 0 : dragMetrics.clipEnd) !== null && _l !== void 0 ? _l : 4}%`,
|
|
11862
|
+
"--cc-novel-drag-clip-x": `${(_m = dragMetrics === null || dragMetrics === void 0 ? void 0 : dragMetrics.clipStart) !== null && _m !== void 0 ? _m : 0}%`,
|
|
11863
|
+
"--cc-novel-drag-clip-y": `${((_o = dragMetrics === null || dragMetrics === void 0 ? void 0 : dragMetrics.clipStart) !== null && _o !== void 0 ? _o : 0) * 0.72}%`,
|
|
11864
|
+
"--cc-novel-drag-curl": (_p = dragMetrics === null || dragMetrics === void 0 ? void 0 : dragMetrics.curl) !== null && _p !== void 0 ? _p : 0,
|
|
11467
11865
|
"--cc-novel-drag-filter-shadow": `${dragSign * 38 * dragProgress}px`,
|
|
11468
|
-
"--cc-novel-drag-fold-opacity": dragMetrics
|
|
11469
|
-
"--cc-novel-drag-fold-scale": dragMetrics
|
|
11470
|
-
"--cc-novel-drag-fold-skew": `${dragMetrics
|
|
11471
|
-
"--cc-novel-drag-fold-translate": `${dragMetrics
|
|
11472
|
-
"--cc-novel-drag-fold-translate-signed": `${-dragSign * (dragMetrics
|
|
11473
|
-
"--cc-novel-drag-next-opacity": dragMetrics
|
|
11474
|
-
"--cc-novel-drag-opacity": dragMetrics
|
|
11866
|
+
"--cc-novel-drag-fold-opacity": (_q = dragMetrics === null || dragMetrics === void 0 ? void 0 : dragMetrics.foldOpacity) !== null && _q !== void 0 ? _q : 0.18,
|
|
11867
|
+
"--cc-novel-drag-fold-scale": (_r = dragMetrics === null || dragMetrics === void 0 ? void 0 : dragMetrics.foldScale) !== null && _r !== void 0 ? _r : 0.48,
|
|
11868
|
+
"--cc-novel-drag-fold-skew": `${(_s = dragMetrics === null || dragMetrics === void 0 ? void 0 : dragMetrics.foldSkew) !== null && _s !== void 0 ? _s : 0}deg`,
|
|
11869
|
+
"--cc-novel-drag-fold-translate": `${(_t = dragMetrics === null || dragMetrics === void 0 ? void 0 : dragMetrics.foldTranslate) !== null && _t !== void 0 ? _t : 58}%`,
|
|
11870
|
+
"--cc-novel-drag-fold-translate-signed": `${-dragSign * ((_u = dragMetrics === null || dragMetrics === void 0 ? void 0 : dragMetrics.foldTranslate) !== null && _u !== void 0 ? _u : 58)}%`,
|
|
11871
|
+
"--cc-novel-drag-next-opacity": (_v = dragMetrics === null || dragMetrics === void 0 ? void 0 : dragMetrics.nextOpacity) !== null && _v !== void 0 ? _v : 0.42,
|
|
11872
|
+
"--cc-novel-drag-opacity": (_w = dragMetrics === null || dragMetrics === void 0 ? void 0 : dragMetrics.pageOpacity) !== null && _w !== void 0 ? _w : 1,
|
|
11475
11873
|
"--cc-novel-drag-progress": dragProgress,
|
|
11476
11874
|
"--cc-novel-release-progress": releaseProgress,
|
|
11477
11875
|
"--cc-novel-release-duration": `${releaseProgress > 0 ? releaseDuration : props.animationDuration}ms`,
|
|
@@ -11481,13 +11879,13 @@ const ClassNovelReader = /*#__PURE__*/ vue.defineComponent({
|
|
|
11481
11879
|
"--cc-novel-slide-leave-start-opacity": releaseLeaveOpacity,
|
|
11482
11880
|
"--cc-novel-slide-leave-next-start-transform": `translate3d(${-releaseLeaveX}%, 0, 0) scale(${releaseLeaveScale})`,
|
|
11483
11881
|
"--cc-novel-slide-leave-previous-start-transform": `translate3d(${releaseLeaveX}%, 0, 0) scale(${releaseLeaveScale})`,
|
|
11484
|
-
"--cc-novel-drag-shadow-opacity": dragMetrics
|
|
11485
|
-
"--cc-novel-drag-shadow-scale": dragMetrics
|
|
11486
|
-
"--cc-novel-drag-shadow-translate": `${dragMetrics
|
|
11487
|
-
"--cc-novel-drag-shadow-translate-signed": `${dragSign * (dragMetrics
|
|
11488
|
-
"--cc-novel-drag-skew": `${dragMetrics
|
|
11489
|
-
"--cc-novel-drag-translate": `${dragMetrics
|
|
11490
|
-
"--cc-novel-drag-x": `${dragMetrics
|
|
11882
|
+
"--cc-novel-drag-shadow-opacity": (_x = dragMetrics === null || dragMetrics === void 0 ? void 0 : dragMetrics.shadowOpacity) !== null && _x !== void 0 ? _x : 0.12,
|
|
11883
|
+
"--cc-novel-drag-shadow-scale": (_y = dragMetrics === null || dragMetrics === void 0 ? void 0 : dragMetrics.shadowScale) !== null && _y !== void 0 ? _y : 0.8,
|
|
11884
|
+
"--cc-novel-drag-shadow-translate": `${(_z = dragMetrics === null || dragMetrics === void 0 ? void 0 : dragMetrics.shadowTranslate) !== null && _z !== void 0 ? _z : 22}%`,
|
|
11885
|
+
"--cc-novel-drag-shadow-translate-signed": `${dragSign * ((_0 = dragMetrics === null || dragMetrics === void 0 ? void 0 : dragMetrics.shadowTranslate) !== null && _0 !== void 0 ? _0 : 22)}%`,
|
|
11886
|
+
"--cc-novel-drag-skew": `${(_1 = dragMetrics === null || dragMetrics === void 0 ? void 0 : dragMetrics.skew) !== null && _1 !== void 0 ? _1 : 0}deg`,
|
|
11887
|
+
"--cc-novel-drag-translate": `${(_2 = dragMetrics === null || dragMetrics === void 0 ? void 0 : dragMetrics.translate) !== null && _2 !== void 0 ? _2 : 0}%`,
|
|
11888
|
+
"--cc-novel-drag-x": `${(_3 = dragMetrics === null || dragMetrics === void 0 ? void 0 : dragMetrics.dragX) !== null && _3 !== void 0 ? _3 : 0}px`,
|
|
11491
11889
|
},
|
|
11492
11890
|
],
|
|
11493
11891
|
onPointerCancel: (event) => {
|
|
@@ -11496,20 +11894,20 @@ const ClassNovelReader = /*#__PURE__*/ vue.defineComponent({
|
|
|
11496
11894
|
dragState.value = null;
|
|
11497
11895
|
},
|
|
11498
11896
|
onPointerDown: (event) => {
|
|
11897
|
+
var _a, _b, _c, _d;
|
|
11499
11898
|
if (event.button !== 0 || turningPage.value)
|
|
11500
11899
|
return;
|
|
11501
11900
|
const target = event.target;
|
|
11502
11901
|
if (target.closest("button, input, textarea, select, a, [data-no-reader-drag='true']"))
|
|
11503
11902
|
return;
|
|
11504
11903
|
event.preventDefault();
|
|
11505
|
-
event.currentTarget.setPointerCapture
|
|
11904
|
+
(_b = (_a = event.currentTarget).setPointerCapture) === null || _b === void 0 ? void 0 : _b.call(_a, event.pointerId);
|
|
11506
11905
|
const pointerId = event.pointerId;
|
|
11507
|
-
const width = Math.max(1, readerRef.value
|
|
11508
|
-
event.currentTarget.clientWidth);
|
|
11906
|
+
const width = Math.max(1, (_d = (_c = readerRef.value) === null || _c === void 0 ? void 0 : _c.clientWidth) !== null && _d !== void 0 ? _d : event.currentTarget.clientWidth);
|
|
11509
11907
|
const startX = event.clientX;
|
|
11510
11908
|
const targetNode = event.currentTarget;
|
|
11511
11909
|
const ensureDrag = (clientX) => {
|
|
11512
|
-
if (activeDragState
|
|
11910
|
+
if ((activeDragState === null || activeDragState === void 0 ? void 0 : activeDragState.pointerId) === pointerId)
|
|
11513
11911
|
return activeDragState;
|
|
11514
11912
|
if (Math.abs(clientX - startX) < NOVEL_READER_DRAG_THRESHOLD)
|
|
11515
11913
|
return null;
|
|
@@ -11543,11 +11941,12 @@ const ClassNovelReader = /*#__PURE__*/ vue.defineComponent({
|
|
|
11543
11941
|
updateDrag(pointerId, moveEvent.clientX, width, state);
|
|
11544
11942
|
};
|
|
11545
11943
|
const handleEnd = (endEvent) => {
|
|
11944
|
+
var _a;
|
|
11546
11945
|
if (endEvent.pointerId !== pointerId)
|
|
11547
11946
|
return;
|
|
11548
11947
|
endEvent.preventDefault();
|
|
11549
|
-
targetNode.releasePointerCapture
|
|
11550
|
-
if (activeDragState
|
|
11948
|
+
(_a = targetNode.releasePointerCapture) === null || _a === void 0 ? void 0 : _a.call(targetNode, pointerId);
|
|
11949
|
+
if ((activeDragState === null || activeDragState === void 0 ? void 0 : activeDragState.pointerId) === pointerId ||
|
|
11551
11950
|
ensureDrag(endEvent.clientX)) {
|
|
11552
11951
|
updateDrag(pointerId, endEvent.clientX, width, state, true);
|
|
11553
11952
|
}
|
|
@@ -11565,9 +11964,9 @@ const ClassNovelReader = /*#__PURE__*/ vue.defineComponent({
|
|
|
11565
11964
|
},
|
|
11566
11965
|
}, [
|
|
11567
11966
|
vue.h("div", { class: "cc-novel-reader__book" }, [
|
|
11568
|
-
renderNovelPage(baseState.page, baseState.current, state.total, "cc-novel-reader__page cc-novel-reader__page--base", undefined, `base-${baseState.current}-${turningPage.value
|
|
11967
|
+
renderNovelPage(baseState.page, baseState.current, state.total, "cc-novel-reader__page cc-novel-reader__page--base", undefined, `base-${baseState.current}-${(_7 = (_5 = (_4 = turningPage.value) === null || _4 === void 0 ? void 0 : _4.key) !== null && _5 !== void 0 ? _5 : (_6 = dragState.value) === null || _6 === void 0 ? void 0 : _6.key) !== null && _7 !== void 0 ? _7 : "idle"}`),
|
|
11569
11968
|
previewState
|
|
11570
|
-
? renderNovelPage(previewState.page, previewState.current, state.total, "cc-novel-reader__page cc-novel-reader__page--preview", undefined, `preview-${previewState.current}-${dragState.value
|
|
11969
|
+
? renderNovelPage(previewState.page, previewState.current, state.total, "cc-novel-reader__page cc-novel-reader__page--preview", undefined, `preview-${previewState.current}-${(_9 = (_8 = dragState.value) === null || _8 === void 0 ? void 0 : _8.key) !== null && _9 !== void 0 ? _9 : "idle"}`)
|
|
11571
11970
|
: null,
|
|
11572
11971
|
activeTurningPage
|
|
11573
11972
|
? renderNovelPage(activeTurningPage.page, activeTurningPage.current, state.total, `cc-novel-reader__page cc-novel-reader__page--turning${dragState.value ? " cc-novel-reader__page--dragging" : ""}`, () => {
|
|
@@ -11627,8 +12026,9 @@ const ClassComicReader = /*#__PURE__*/ vue.defineComponent({
|
|
|
11627
12026
|
const sentinel = vue.ref(null);
|
|
11628
12027
|
const pageRefs = vue.shallowRef([]);
|
|
11629
12028
|
let observer = null;
|
|
11630
|
-
const activeCurrent = () => props.current
|
|
12029
|
+
const activeCurrent = () => { var _a; return (_a = props.current) !== null && _a !== void 0 ? _a : innerCurrent.value; };
|
|
11631
12030
|
const commit = (index) => {
|
|
12031
|
+
var _a;
|
|
11632
12032
|
const next = new core.ComicReaderController({
|
|
11633
12033
|
current: activeCurrent(),
|
|
11634
12034
|
hasMore: props.hasMore,
|
|
@@ -11639,13 +12039,13 @@ const ClassComicReader = /*#__PURE__*/ vue.defineComponent({
|
|
|
11639
12039
|
innerCurrent.value = next.current;
|
|
11640
12040
|
emit("update:current", next.current);
|
|
11641
12041
|
emit("pageChange", next.current, next.page);
|
|
11642
|
-
pageRefs.value[next.current]
|
|
12042
|
+
(_a = pageRefs.value[next.current]) === null || _a === void 0 ? void 0 : _a.scrollIntoView({
|
|
11643
12043
|
behavior: "smooth",
|
|
11644
12044
|
block: "start",
|
|
11645
12045
|
});
|
|
11646
12046
|
};
|
|
11647
12047
|
vue.onMounted(() => {
|
|
11648
|
-
if (!sentinel.value)
|
|
12048
|
+
if (!sentinel.value || typeof IntersectionObserver === "undefined")
|
|
11649
12049
|
return;
|
|
11650
12050
|
observer = new IntersectionObserver((entries) => {
|
|
11651
12051
|
if (entries.some((entry) => entry.isIntersecting) &&
|
|
@@ -11655,7 +12055,7 @@ const ClassComicReader = /*#__PURE__*/ vue.defineComponent({
|
|
|
11655
12055
|
}, { rootMargin: "240px" });
|
|
11656
12056
|
observer.observe(sentinel.value);
|
|
11657
12057
|
});
|
|
11658
|
-
vue.onBeforeUnmount(() => observer
|
|
12058
|
+
vue.onBeforeUnmount(() => observer === null || observer === void 0 ? void 0 : observer.disconnect());
|
|
11659
12059
|
return () => {
|
|
11660
12060
|
const state = new core.ComicReaderController({
|
|
11661
12061
|
current: activeCurrent(),
|
|
@@ -11683,21 +12083,24 @@ const ClassComicReader = /*#__PURE__*/ vue.defineComponent({
|
|
|
11683
12083
|
}, [readerIcon("chevronRight")]),
|
|
11684
12084
|
]),
|
|
11685
12085
|
vue.h("div", { class: "cc-comic-reader__pages" }, [
|
|
11686
|
-
...state.pages.map((page, index) =>
|
|
11687
|
-
|
|
11688
|
-
|
|
11689
|
-
|
|
11690
|
-
|
|
11691
|
-
|
|
11692
|
-
|
|
11693
|
-
|
|
11694
|
-
|
|
11695
|
-
|
|
11696
|
-
|
|
11697
|
-
|
|
11698
|
-
|
|
11699
|
-
|
|
11700
|
-
|
|
12086
|
+
...state.pages.map((page, index) => {
|
|
12087
|
+
var _a;
|
|
12088
|
+
return vue.h("div", {
|
|
12089
|
+
key: page.id,
|
|
12090
|
+
class: "cc-comic-reader__page",
|
|
12091
|
+
"data-active": index === state.current,
|
|
12092
|
+
ref: (node) => {
|
|
12093
|
+
if (node)
|
|
12094
|
+
pageRefs.value[index] = node;
|
|
12095
|
+
},
|
|
12096
|
+
}, [
|
|
12097
|
+
vue.h("img", {
|
|
12098
|
+
alt: (_a = page.alt) !== null && _a !== void 0 ? _a : "",
|
|
12099
|
+
loading: "lazy",
|
|
12100
|
+
src: page.src,
|
|
12101
|
+
}),
|
|
12102
|
+
]);
|
|
12103
|
+
}),
|
|
11701
12104
|
vue.h("div", { ref: sentinel, class: "cc-comic-reader__load" }, props.loading
|
|
11702
12105
|
? core.getClassComponentsLocale().comicReaderLoadingText
|
|
11703
12106
|
: props.hasMore
|
|
@@ -11743,29 +12146,32 @@ const ClassDanmaku = /*#__PURE__*/ vue.defineComponent({
|
|
|
11743
12146
|
"--cc-danmaku-track-count": state.maxTracks,
|
|
11744
12147
|
},
|
|
11745
12148
|
],
|
|
11746
|
-
}, state.items.map((item) =>
|
|
11747
|
-
|
|
11748
|
-
|
|
11749
|
-
|
|
11750
|
-
"
|
|
11751
|
-
|
|
11752
|
-
|
|
11753
|
-
|
|
11754
|
-
|
|
11755
|
-
|
|
11756
|
-
|
|
11757
|
-
?
|
|
11758
|
-
|
|
11759
|
-
alt: item.imageAlt ?? item.content,
|
|
11760
|
-
src: item.imageSrc,
|
|
11761
|
-
}),
|
|
11762
|
-
item.content ? vue.h("span", null, item.content) : null,
|
|
11763
|
-
]
|
|
11764
|
-
: item.type === "icon"
|
|
12149
|
+
}, state.items.map((item) => {
|
|
12150
|
+
var _a, _b;
|
|
12151
|
+
return vue.h("div", {
|
|
12152
|
+
key: item.id,
|
|
12153
|
+
class: "cc-danmaku__item",
|
|
12154
|
+
style: {
|
|
12155
|
+
"--cc-danmaku-color": item.color,
|
|
12156
|
+
"--cc-danmaku-duration": `${item.duration}ms`,
|
|
12157
|
+
"--cc-danmaku-track": item.track,
|
|
12158
|
+
},
|
|
12159
|
+
}, slots.default
|
|
12160
|
+
? slots.default({ item })
|
|
12161
|
+
: item.type === "image" && item.imageSrc
|
|
11765
12162
|
? [
|
|
11766
|
-
vue.h("
|
|
12163
|
+
vue.h("img", {
|
|
12164
|
+
alt: (_a = item.imageAlt) !== null && _a !== void 0 ? _a : item.content,
|
|
12165
|
+
src: item.imageSrc,
|
|
12166
|
+
}),
|
|
12167
|
+
item.content ? vue.h("span", null, item.content) : null,
|
|
11767
12168
|
]
|
|
11768
|
-
:
|
|
12169
|
+
: item.type === "icon"
|
|
12170
|
+
? [
|
|
12171
|
+
vue.h("span", { "aria-hidden": "true", class: "cc-danmaku__icon" }, (_b = item.icon) !== null && _b !== void 0 ? _b : item.content),
|
|
12172
|
+
]
|
|
12173
|
+
: [vue.h("span", null, item.content)]);
|
|
12174
|
+
}));
|
|
11769
12175
|
};
|
|
11770
12176
|
},
|
|
11771
12177
|
});
|
|
@@ -12141,6 +12547,10 @@ Object.defineProperty(exports, "TagController", {
|
|
|
12141
12547
|
enumerable: true,
|
|
12142
12548
|
get: function () { return core.TagController; }
|
|
12143
12549
|
});
|
|
12550
|
+
Object.defineProperty(exports, "ThemeBoxController", {
|
|
12551
|
+
enumerable: true,
|
|
12552
|
+
get: function () { return core.ThemeBoxController; }
|
|
12553
|
+
});
|
|
12144
12554
|
Object.defineProperty(exports, "TiltCardController", {
|
|
12145
12555
|
enumerable: true,
|
|
12146
12556
|
get: function () { return core.TiltCardController; }
|
|
@@ -12185,6 +12595,10 @@ Object.defineProperty(exports, "VirtualSelectController", {
|
|
|
12185
12595
|
enumerable: true,
|
|
12186
12596
|
get: function () { return core.VirtualSelectController; }
|
|
12187
12597
|
});
|
|
12598
|
+
Object.defineProperty(exports, "WidthTransitionController", {
|
|
12599
|
+
enumerable: true,
|
|
12600
|
+
get: function () { return core.WidthTransitionController; }
|
|
12601
|
+
});
|
|
12188
12602
|
Object.defineProperty(exports, "configureClassComponents", {
|
|
12189
12603
|
enumerable: true,
|
|
12190
12604
|
get: function () { return core.configureClassComponents; }
|
|
@@ -12265,6 +12679,7 @@ exports.ClassTable = ClassTable;
|
|
|
12265
12679
|
exports.ClassTabs = ClassTabs;
|
|
12266
12680
|
exports.ClassTag = ClassTag;
|
|
12267
12681
|
exports.ClassTextarea = ClassTextarea;
|
|
12682
|
+
exports.ClassThemeBox = ClassThemeBox;
|
|
12268
12683
|
exports.ClassTiltCard = ClassTiltCard;
|
|
12269
12684
|
exports.ClassTimeline = ClassTimeline;
|
|
12270
12685
|
exports.ClassToastViewport = ClassToastViewport;
|
|
@@ -12277,6 +12692,7 @@ exports.ClassVideoPlayer = ClassVideoPlayer;
|
|
|
12277
12692
|
exports.ClassVirtualList = ClassVirtualList;
|
|
12278
12693
|
exports.ClassVirtualSelect = ClassVirtualSelect;
|
|
12279
12694
|
exports.ClassVirtualTable = ClassVirtualTable;
|
|
12695
|
+
exports.ClassWidthTransition = ClassWidthTransition;
|
|
12280
12696
|
exports.defaultToastManager = defaultToastManager;
|
|
12281
12697
|
exports.useField = useField;
|
|
12282
12698
|
exports.useForm = useForm;
|