@esportsplus/ui 0.62.0 → 0.64.0
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/.audit/audit.json +4 -92
- package/.audit/rules-audit.md +4 -18
- package/README.md +15 -18
- package/RULES.md +80 -9
- package/bin/agent-cli +300 -0
- package/build/components/accordion/index.d.ts +4 -0
- package/build/components/accordion/index.js +13 -10
- package/build/components/breadcrumb/index.d.ts +1 -0
- package/build/components/breadcrumb/index.js +43 -37
- package/build/components/breadcrumb/scss/index.scss +1 -1
- package/build/components/button/kbd.d.ts +1 -1
- package/build/components/button/kbd.js +17 -15
- package/build/components/button/scss/index.scss +1 -1
- package/build/components/button/split.js +14 -16
- package/build/components/capslock/scss/index.scss +1 -1
- package/build/components/card/scss/index.scss +1 -1
- package/build/components/chat/minimap/index.js +4 -5
- package/build/components/checkbox/group.d.ts +1 -0
- package/build/components/checkbox/group.js +21 -20
- package/build/components/checkbox/scss/index.scss +1 -1
- package/build/components/color-picker/index.js +6 -6
- package/build/components/color-picker/scss/index.scss +1 -1
- package/build/components/command/index.d.ts +1 -1
- package/build/components/command/palette.d.ts +13 -9
- package/build/components/command/palette.js +143 -152
- package/build/components/command/scss/index.scss +1 -1
- package/build/components/command/search.d.ts +5 -7
- package/build/components/command/search.js +6 -26
- package/build/components/counter/scss/index.scss +1 -1
- package/build/components/editor/code/commands.js +1 -1
- package/build/components/editor/code/document.d.ts +1 -3
- package/build/components/editor/code/document.js +1 -1
- package/build/components/editor/code/editor.d.ts +18 -6
- package/build/components/editor/code/editor.js +9 -7
- package/build/components/editor/code/features.js +27 -18
- package/build/components/editor/code/find.d.ts +1 -1
- package/build/components/editor/code/find.js +5 -6
- package/build/components/editor/code/folding.d.ts +3 -5
- package/build/components/editor/code/folding.js +2 -15
- package/build/components/editor/code/gutter.js +2 -2
- package/build/components/editor/code/index.d.ts +1 -0
- package/build/components/editor/code/index.js +1 -0
- package/build/components/editor/code/minimap.d.ts +3 -1
- package/build/components/editor/code/minimap.js +31 -5
- package/build/components/editor/code/services/model.js +2 -1
- package/build/components/editor/code/syntax.js +2 -1
- package/build/components/editor/code/view.d.ts +8 -2
- package/build/components/editor/code/view.js +37 -56
- package/build/components/editor/diffs/index.d.ts +1 -0
- package/build/components/editor/diffs/index.js +1 -0
- package/build/components/editor/diffs/merge.js +16 -17
- package/build/components/editor/diffs/view.js +10 -11
- package/build/components/editor/markdown/editing.d.ts +2 -1
- package/build/components/editor/markdown/editing.js +14 -5
- package/build/components/editor/markdown/format.d.ts +1 -1
- package/build/components/editor/markdown/format.js +116 -26
- package/build/components/editor/markdown/layout.js +2 -1
- package/build/components/editor/markdown/model.d.ts +1 -2
- package/build/components/editor/markdown/model.js +1 -29
- package/build/components/editor/markdown/render.js +1 -1
- package/build/components/editor/markdown/template.d.ts +3 -10
- package/build/components/editor/markdown/template.js +2 -29
- package/build/components/editor/markdown/toolbar.d.ts +2 -2
- package/build/components/editor/markdown/toolbar.js +90 -126
- package/build/components/editor/markdown/view.d.ts +1 -1
- package/build/components/editor/markdown/view.js +54 -87
- package/build/components/editor/tree/drag.js +1 -1
- package/build/components/editor/tree/find.js +70 -64
- package/build/components/editor/tree/template.js +8 -7
- package/build/components/editor/viewer/model.d.ts +1 -1
- package/build/components/editor/viewer/template.js +4 -26
- package/build/components/editor/workspace/keybindings.d.ts +1 -1
- package/build/components/editor/workspace/model.d.ts +12 -2
- package/build/components/editor/workspace/model.js +87 -31
- package/build/components/editor/workspace/session.d.ts +2 -6
- package/build/components/editor/workspace/session.js +99 -16
- package/build/components/editor/workspace/status.d.ts +1 -1
- package/build/components/editor/workspace/strip.d.ts +10 -9
- package/build/components/editor/workspace/strip.js +99 -141
- package/build/components/editor/workspace/tabs.d.ts +2 -4
- package/build/components/editor/workspace/tabs.js +1 -14
- package/build/components/editor/workspace/template.d.ts +1 -1
- package/build/components/editor/workspace/template.js +305 -435
- package/build/components/error/index.d.ts +4 -13
- package/build/components/error/index.js +53 -172
- package/build/components/error/scss/index.scss +1 -1
- package/build/components/form/action.d.ts +2 -2
- package/build/components/form/action.js +2 -2
- package/build/components/form/input.d.ts +3 -3
- package/build/components/form/input.js +32 -10
- package/build/components/frame/scss/index.scss +1 -1
- package/build/components/group/index.js +96 -9
- package/build/components/group/scss/index.scss +1 -1
- package/build/components/heatmap/scss/index.scss +1 -1
- package/build/components/highlight/index.js +55 -48
- package/build/components/highlight/scss/index.scss +1 -1
- package/build/components/icon/scss/index.scss +1 -1
- package/build/components/image/scss/index.scss +1 -1
- package/build/components/index.d.ts +3 -7
- package/build/components/index.js +3 -7
- package/build/components/inline-edit/index.d.ts +2 -2
- package/build/components/inline-edit/index.js +5 -5
- package/build/components/inline-edit/rich.js +4 -4
- package/build/components/inline-edit/scss/index.scss +1 -1
- package/build/components/inline-edit/status.js +1 -0
- package/build/components/input/index.d.ts +4 -0
- package/build/components/input/index.js +3 -1
- package/build/components/input/otp.d.ts +18 -0
- package/build/components/input/otp.js +112 -0
- package/build/components/input/password.d.ts +15 -0
- package/build/components/input/password.js +163 -0
- package/build/components/input/scrub.d.ts +1 -0
- package/build/components/input/scrub.js +103 -89
- package/build/components/input/scss/index.scss +1 -1
- package/build/components/input/tag.d.ts +5 -0
- package/build/components/input/tag.js +116 -69
- package/build/components/json/download.js +1 -1
- package/build/components/link/scss/index.scss +1 -1
- package/build/components/marquee/index.js +1 -1
- package/build/components/marquee/scss/index.scss +1 -1
- package/build/components/nav/scss/index.scss +1 -1
- package/build/components/nav/tree.d.ts +2 -1
- package/build/components/nav/tree.js +6 -5
- package/build/components/notification/index.js +3 -3
- package/build/components/notification/scss/index.scss +1 -1
- package/build/components/overlay/popup.d.ts +2 -2
- package/build/components/overlay/popup.js +1 -1
- package/build/components/overlay/scss/index.scss +1 -1
- package/build/components/pagination/arrows.js +2 -3
- package/build/components/pagination/cards.js +2 -3
- package/build/components/pagination/index.d.ts +2 -3
- package/build/components/pagination/index.js +18 -13
- package/build/components/pagination/scss/index.scss +1 -1
- package/build/components/progress/index.js +1 -1
- package/build/components/progress/scss/index.scss +1 -1
- package/build/components/progress/text.js +3 -3
- package/build/components/range/filter.d.ts +7 -1
- package/build/components/range/filter.js +188 -171
- package/build/components/range/index.d.ts +14 -9
- package/build/components/range/index.js +11 -8
- package/build/components/range/scss/index.scss +1 -1
- package/build/components/range/surface.d.ts +21 -0
- package/build/components/range/surface.js +144 -0
- package/build/components/relative-time/index.js +2 -2
- package/build/components/relative-time/scss/index.scss +1 -1
- package/build/components/root/scss/index.scss +1 -1
- package/build/components/{preview/header.d.ts → search/button.d.ts} +3 -3
- package/build/components/search/button.js +18 -0
- package/build/components/search/index.d.ts +8 -0
- package/build/components/search/index.js +5 -0
- package/build/components/search/input.d.ts +9 -0
- package/build/components/search/input.js +23 -0
- package/build/components/search/parts.d.ts +5 -0
- package/build/components/search/parts.js +17 -0
- package/build/components/search/scss/index.scss +2 -0
- package/build/components/select/expand.js +4 -5
- package/build/components/select/index.d.ts +7 -7
- package/build/components/select/index.js +127 -117
- package/build/components/select/placement.js +8 -1
- package/build/components/select/scss/index.scss +1 -1
- package/build/components/{panels → shell}/group.d.ts +21 -5
- package/build/components/shell/group.js +336 -0
- package/build/components/shell/index.d.ts +15 -17
- package/build/components/shell/index.js +583 -238
- package/build/components/shell/model.d.ts +94 -0
- package/build/components/{panels → shell}/model.js +199 -73
- package/build/components/shell/resize.d.ts +5 -0
- package/build/components/{panels → shell}/resize.js +54 -30
- package/build/components/shell/scss/index.scss +1 -1
- package/build/components/shell/sidebar.d.ts +34 -0
- package/build/components/shell/sidebar.js +362 -0
- package/build/components/{panels → shell}/subtree.js +7 -8
- package/build/components/shortcut-recorder/index.d.ts +5 -4
- package/build/components/shortcut-recorder/index.js +69 -44
- package/build/components/shortcut-recorder/scss/index.scss +1 -1
- package/build/components/sortable/index.d.ts +16 -2
- package/build/components/sortable/index.js +237 -134
- package/build/components/sortable/scss/index.scss +1 -1
- package/build/components/story/index.js +46 -34
- package/build/components/story/scss/index.scss +1 -1
- package/build/components/surface-field/engine.d.ts +2 -0
- package/build/components/surface-field/engine.js +86 -33
- package/build/components/surface-field/index.d.ts +26 -4
- package/build/components/surface-field/index.js +35 -4
- package/build/components/surface-field/scss/index.scss +1 -1
- package/build/components/surface-field/surface.d.ts +13 -1
- package/build/components/surface-field/surface.js +149 -58
- package/build/components/tasklist/index.d.ts +1 -4
- package/build/components/tasklist/index.js +36 -43
- package/build/components/tasklist/scss/index.scss +1 -1
- package/build/components/textarea/index.d.ts +1 -1
- package/build/components/textarea/index.js +14 -14
- package/build/components/theme/scss/index.scss +1 -1
- package/build/components/theme/shared.d.ts +1 -2
- package/build/components/theme/shared.js +2 -5
- package/build/components/toast/index.d.ts +3 -3
- package/build/components/toast/index.js +3 -3
- package/build/components/toast/scss/index.scss +1 -1
- package/build/components/toolbar/index.d.ts +91 -0
- package/build/components/toolbar/index.js +1281 -0
- package/build/components/toolbar/scss/index.scss +2 -0
- package/build/components/tooltip/menu.d.ts +9 -8
- package/build/components/tooltip/menu.js +397 -279
- package/build/components/tooltip/onclick.d.ts +2 -0
- package/build/components/tooltip/onclick.js +13 -4
- package/build/components/tooltip/onhover.d.ts +3 -1
- package/build/components/tooltip/onhover.js +10 -9
- package/build/components/tooltip/scss/index.scss +1 -1
- package/build/components/tooltip/shared.d.ts +4 -4
- package/build/components/tooltip/shared.js +27 -46
- package/build/components/tooltip/utilities.d.ts +5 -2
- package/build/components/tooltip/utilities.js +169 -9
- package/build/components/typewriter/rotate.js +6 -6
- package/build/components/typewriter/scss/index.scss +1 -1
- package/build/components/uptime/scss/index.scss +1 -1
- package/build/components/usage-meter/index.js +1 -1
- package/build/components/usage-meter/scss/index.scss +1 -1
- package/build/css-utilities/font/montserrat/OFL.txt +93 -0
- package/build/shared/drag.d.ts +15 -9
- package/build/shared/drag.js +41 -28
- package/build/shared/placement.d.ts +39 -0
- package/build/shared/placement.js +55 -0
- package/build/shared/transition.js +1 -1
- package/build/shared/viewport.d.ts +1 -2
- package/build/shared/viewport.js +1 -4
- package/package.json +9 -12
- package/src/components/accordion/index.ts +12 -5
- package/src/components/announcement/index.ts +1 -1
- package/src/components/breadcrumb/index.ts +13 -3
- package/src/components/breadcrumb/scss/index.scss +6 -6
- package/src/components/breadcrumb/scss/variables.scss +7 -0
- package/src/components/button/kbd.ts +22 -17
- package/src/components/button/scss/index.scss +69 -76
- package/src/components/button/scss/variables.scss +51 -18
- package/src/components/button/split.ts +12 -8
- package/src/components/capslock/index.ts +2 -0
- package/src/components/capslock/scss/index.scss +21 -21
- package/src/components/card/scss/index.scss +16 -0
- package/src/components/card/scss/variables.scss +25 -2
- package/src/components/chat/minimap/index.ts +5 -6
- package/src/components/chat/minimap/scss/index.scss +12 -11
- package/src/components/chat/minimap/scss/variables.scss +23 -17
- package/src/components/checkbox/group.ts +8 -7
- package/src/components/checkbox/scss/index.scss +59 -35
- package/src/components/checkbox/scss/variables.scss +24 -17
- package/src/components/color-picker/index.ts +6 -6
- package/src/components/color-picker/scss/index.scss +35 -22
- package/src/components/color-picker/scss/variables.scss +11 -3
- package/src/components/command/index.ts +1 -1
- package/src/components/command/palette.ts +174 -166
- package/src/components/command/scss/index.scss +18 -51
- package/src/components/command/scss/variables.scss +37 -71
- package/src/components/command/search.ts +9 -31
- package/src/components/counter/index.ts +22 -22
- package/src/components/counter/scss/variables.scss +10 -7
- package/src/components/editor/code/commands.ts +1 -1
- package/src/components/editor/code/document.ts +0 -2
- package/src/components/editor/code/editor.ts +31 -13
- package/src/components/editor/code/features.ts +39 -24
- package/src/components/editor/code/find.ts +5 -6
- package/src/components/editor/code/folding.ts +3 -21
- package/src/components/editor/code/gutter.ts +2 -2
- package/src/components/editor/code/index.ts +1 -0
- package/src/components/editor/code/minimap.ts +39 -5
- package/src/components/editor/code/scss/_editor.scss +28 -21
- package/src/components/editor/code/scss/_features.scss +19 -21
- package/src/components/editor/code/scss/_services.scss +14 -11
- package/src/components/editor/code/scss/variables.scss +31 -12
- package/src/components/editor/code/services/model.ts +2 -1
- package/src/components/editor/code/syntax.ts +2 -1
- package/src/components/editor/code/view.ts +22 -45
- package/src/components/editor/diffs/index.ts +1 -0
- package/src/components/editor/diffs/merge.ts +9 -10
- package/src/components/editor/diffs/scss/_diffs.scss +39 -63
- package/src/components/editor/diffs/scss/_merge.scss +10 -2
- package/src/components/editor/diffs/scss/index.scss +0 -1
- package/src/components/editor/diffs/scss/variables.scss +36 -17
- package/src/components/editor/diffs/view.ts +8 -9
- package/src/components/editor/markdown/editing.ts +18 -6
- package/src/components/editor/markdown/format.ts +180 -32
- package/src/components/editor/markdown/layout.ts +2 -1
- package/src/components/editor/markdown/model.ts +0 -38
- package/src/components/editor/markdown/render.ts +1 -1
- package/src/components/editor/markdown/scss/index.scss +38 -52
- package/src/components/editor/markdown/scss/variables.scss +24 -50
- package/src/components/editor/markdown/template.ts +3 -63
- package/src/components/editor/markdown/toolbar.ts +76 -127
- package/src/components/editor/markdown/view.ts +9 -32
- package/src/components/editor/tree/drag.ts +1 -1
- package/src/components/editor/tree/find.ts +61 -64
- package/src/components/editor/tree/scss/index.scss +29 -30
- package/src/components/editor/tree/scss/variables.scss +34 -15
- package/src/components/editor/tree/template.ts +9 -9
- package/src/components/editor/viewer/model.ts +1 -1
- package/src/components/editor/viewer/scss/_viewer.scss +4 -5
- package/src/components/editor/viewer/scss/variables.scss +3 -3
- package/src/components/editor/viewer/template.ts +4 -31
- package/src/components/editor/workspace/keybindings.ts +1 -1
- package/src/components/editor/workspace/model.ts +136 -37
- package/src/components/editor/workspace/scss/_keybindings.scss +3 -20
- package/src/components/editor/workspace/scss/_status.scss +0 -1
- package/src/components/editor/workspace/scss/_tabs.scss +2 -41
- package/src/components/editor/workspace/scss/index.scss +49 -71
- package/src/components/editor/workspace/scss/variables.scss +1 -135
- package/src/components/editor/workspace/session.ts +138 -18
- package/src/components/editor/workspace/status.ts +1 -1
- package/src/components/editor/workspace/strip.ts +96 -115
- package/src/components/editor/workspace/tabs.ts +2 -23
- package/src/components/editor/workspace/template.ts +323 -458
- package/src/components/error/index.ts +47 -183
- package/src/components/error/scss/index.scss +34 -35
- package/src/components/error/scss/variables.scss +14 -26
- package/src/components/filter/scss/index.scss +6 -5
- package/src/components/form/action.ts +7 -7
- package/src/components/form/input.ts +25 -12
- package/src/components/frame/scss/index.scss +5 -5
- package/src/components/group/index.ts +77 -2
- package/src/components/group/scss/index.scss +164 -0
- package/src/components/group/scss/variables.scss +110 -2
- package/src/components/heatmap/scss/variables.scss +13 -10
- package/src/components/highlight/index.ts +87 -79
- package/src/components/highlight/scss/index.scss +6 -16
- package/src/components/highlight/scss/variables.scss +33 -5
- package/src/components/icon/scss/index.scss +2 -2
- package/src/components/icon/scss/variables.scss +14 -1
- package/src/components/image/scss/index.scss +9 -9
- package/src/components/image/scss/variables.scss +1 -1
- package/src/components/index.ts +3 -7
- package/src/components/inline-edit/index.ts +8 -6
- package/src/components/inline-edit/rich.ts +8 -8
- package/src/components/inline-edit/scss/index.scss +50 -36
- package/src/components/inline-edit/scss/variables.scss +28 -18
- package/src/components/inline-edit/status.ts +2 -0
- package/src/components/input/index.ts +3 -1
- package/src/components/input/otp.ts +175 -0
- package/src/components/input/password.ts +178 -0
- package/src/components/input/scrub.ts +197 -178
- package/src/components/input/scss/index.scss +344 -4
- package/src/components/input/scss/variables.scss +234 -65
- package/src/components/input/tag.ts +98 -53
- package/src/components/json/download.ts +2 -5
- package/src/components/link/scss/index.scss +3 -5
- package/src/components/loading/scss/index.scss +1 -0
- package/src/components/loading/scss/variables.scss +1 -0
- package/src/components/marquee/index.ts +1 -1
- package/src/components/marquee/scss/index.scss +11 -4
- package/src/components/nav/scss/index.scss +10 -26
- package/src/components/nav/scss/variables.scss +13 -23
- package/src/components/nav/tree.ts +10 -8
- package/src/components/notification/index.ts +3 -3
- package/src/components/notification/scss/index.scss +7 -14
- package/src/components/notification/scss/variables.scss +10 -2
- package/src/components/number/index.ts +1 -1
- package/src/components/overlay/popup.ts +2 -2
- package/src/components/overlay/scss/index.scss +60 -51
- package/src/components/page/scss/variables.scss +1 -0
- package/src/components/pagination/arrows.ts +2 -3
- package/src/components/pagination/cards.ts +2 -3
- package/src/components/pagination/index.ts +11 -9
- package/src/components/pagination/scss/index.scss +38 -101
- package/src/components/pagination/scss/variables.scss +24 -69
- package/src/components/progress/index.ts +1 -1
- package/src/components/progress/scss/index.scss +22 -11
- package/src/components/progress/scss/variables.scss +13 -5
- package/src/components/progress/text.ts +3 -3
- package/src/components/range/filter.ts +249 -246
- package/src/components/range/index.ts +22 -7
- package/src/components/range/scss/index.scss +470 -15
- package/src/components/range/scss/variables.scss +402 -198
- package/src/components/range/surface.ts +135 -0
- package/src/components/relative-time/index.ts +2 -2
- package/src/components/relative-time/scss/index.scss +4 -2
- package/src/components/relative-time/scss/variables.scss +4 -5
- package/src/components/root/scss/index.scss +11 -11
- package/src/components/root/scss/variables.scss +4 -4
- package/src/components/search/button.ts +24 -0
- package/src/components/search/index.ts +12 -0
- package/src/components/search/input.ts +35 -0
- package/src/components/search/parts.ts +24 -0
- package/src/components/search/scss/index.scss +36 -0
- package/src/components/search/scss/variables.scss +67 -0
- package/src/components/section/scss/variables.scss +1 -0
- package/src/components/select/expand.ts +3 -4
- package/src/components/select/index.ts +55 -41
- package/src/components/select/placement.ts +17 -1
- package/src/components/select/scss/index.scss +57 -29
- package/src/components/select/scss/variables.scss +91 -53
- package/src/components/{panels → shell}/group.ts +151 -98
- package/src/components/shell/index.ts +805 -284
- package/src/components/{panels → shell}/model.ts +329 -102
- package/src/components/shell/resize.ts +176 -0
- package/src/components/shell/scss/index.scss +502 -89
- package/src/components/shell/scss/variables.scss +264 -39
- package/src/components/shell/sidebar.ts +325 -0
- package/src/components/{panels → shell}/subtree.ts +1 -2
- package/src/components/shortcut-recorder/index.ts +99 -61
- package/src/components/shortcut-recorder/scss/index.scss +76 -52
- package/src/components/shortcut-recorder/scss/variables.scss +25 -30
- package/src/components/sortable/index.ts +364 -63
- package/src/components/sortable/scss/index.scss +22 -2
- package/src/components/sortable/scss/variables.scss +16 -4
- package/src/components/story/index.ts +56 -33
- package/src/components/story/scss/index.scss +67 -16
- package/src/components/story/scss/variables.scss +59 -18
- package/src/components/surface-field/engine.ts +157 -61
- package/src/components/surface-field/index.ts +64 -9
- package/src/components/surface-field/scss/index.scss +88 -77
- package/src/components/surface-field/scss/variables.scss +84 -36
- package/src/components/surface-field/surface.ts +225 -76
- package/src/components/tasklist/index.ts +10 -14
- package/src/components/tasklist/scss/index.scss +25 -45
- package/src/components/tasklist/scss/variables.scss +12 -29
- package/src/components/textarea/index.ts +39 -42
- package/src/components/theme/reveal.ts +1 -0
- package/src/components/theme/scss/index.scss +20 -16
- package/src/components/theme/scss/variables.scss +11 -5
- package/src/components/theme/shared.ts +3 -7
- package/src/components/toast/index.ts +7 -8
- package/src/components/toast/scss/index.scss +44 -36
- package/src/components/toast/scss/variables.scss +36 -33
- package/src/components/toolbar/index.ts +1675 -0
- package/src/components/toolbar/scss/index.scss +759 -0
- package/src/components/toolbar/scss/variables.scss +555 -0
- package/src/components/tooltip/menu.ts +301 -220
- package/src/components/tooltip/onclick.ts +18 -3
- package/src/components/tooltip/onhover.ts +13 -9
- package/src/components/tooltip/scss/index.scss +155 -188
- package/src/components/tooltip/scss/variables.scss +151 -135
- package/src/components/tooltip/shared.ts +47 -74
- package/src/components/tooltip/utilities.ts +151 -10
- package/src/components/truncate/index.ts +1 -1
- package/src/components/typewriter/rotate.ts +6 -6
- package/src/components/typewriter/scss/index.scss +14 -5
- package/src/components/uptime/scss/index.scss +8 -15
- package/src/components/uptime/scss/variables.scss +12 -1
- package/src/components/usage-meter/index.ts +1 -1
- package/src/components/usage-meter/scss/index.scss +6 -4
- package/src/components/usage-meter/scss/variables.scss +11 -11
- package/src/css-utilities/box-shadow.scss +0 -1
- package/src/css-utilities/icon.scss +9 -9
- package/src/css-utilities/surface.scss +27 -17
- package/src/modifiers/glass/index.ts +2 -2
- package/src/modifiers/glass/scss/index.scss +2 -2
- package/src/normalize/scss/index.scss +1 -1
- package/src/shared/drag.ts +92 -53
- package/src/shared/placement.ts +145 -0
- package/src/shared/transition.ts +1 -1
- package/src/shared/viewport.ts +1 -7
- package/src/tokens/scss/color.scss +2 -2
- package/src/tokens/scss/scale.scss +5 -1
- package/src/tokens/scss/size.scss +0 -7
- package/storage/svg/angle.svg +1 -0
- package/storage/svg/{chevron-left.svg → arrow.svg} +1 -1
- package/storage/svg/calendar.svg +1 -0
- package/storage/svg/circle-filled.svg +1 -0
- package/storage/svg/cursor-arrow-left.svg +1 -0
- package/storage/svg/cursor-arrow-right.svg +1 -0
- package/storage/svg/fit.svg +1 -0
- package/storage/svg/grip.svg +1 -0
- package/storage/svg/mail.svg +1 -0
- package/storage/svg/{chevron-down.svg → minus.svg} +1 -1
- package/storage/svg/music.svg +1 -0
- package/storage/svg/{chevron-up.svg → rotate-ccw.svg} +1 -1
- package/vite.config.ts +9 -13
- package/build/components/cc/index.d.ts +0 -33
- package/build/components/cc/index.js +0 -603
- package/build/components/cc/scss/index.scss +0 -2
- package/build/components/dock/index.d.ts +0 -47
- package/build/components/dock/index.js +0 -469
- package/build/components/dock/scss/index.scss +0 -2
- package/build/components/metric/flash.d.ts +0 -12
- package/build/components/metric/flash.js +0 -117
- package/build/components/metric/index.d.ts +0 -44
- package/build/components/metric/index.js +0 -275
- package/build/components/metric/scss/index.scss +0 -2
- package/build/components/pagination/dots.d.ts +0 -23
- package/build/components/pagination/dots.js +0 -115
- package/build/components/panels/dnd.d.ts +0 -47
- package/build/components/panels/dnd.js +0 -114
- package/build/components/panels/group.js +0 -322
- package/build/components/panels/index.d.ts +0 -17
- package/build/components/panels/index.js +0 -524
- package/build/components/panels/model.d.ts +0 -64
- package/build/components/panels/resize.d.ts +0 -9
- package/build/components/panels/scss/index.scss +0 -2
- package/build/components/preview/buttons.d.ts +0 -12
- package/build/components/preview/buttons.js +0 -26
- package/build/components/preview/code.d.ts +0 -8
- package/build/components/preview/code.js +0 -18
- package/build/components/preview/header.js +0 -21
- package/build/components/preview/index.d.ts +0 -37
- package/build/components/preview/index.js +0 -123
- package/build/components/preview/scss/index.scss +0 -2
- package/build/components/preview/source.d.ts +0 -12
- package/build/components/preview/source.js +0 -79
- package/build/components/preview/stage.d.ts +0 -8
- package/build/components/preview/stage.js +0 -28
- package/build/components/textarea/scss/index.scss +0 -2
- package/src/components/cc/index.ts +0 -562
- package/src/components/cc/scss/index.scss +0 -416
- package/src/components/cc/scss/variables.scss +0 -257
- package/src/components/dock/index.ts +0 -567
- package/src/components/dock/scss/index.scss +0 -346
- package/src/components/dock/scss/variables.scss +0 -357
- package/src/components/input/scss/_field.scss +0 -39
- package/src/components/input/scss/_scrub.scss +0 -89
- package/src/components/input/scss/_tag.scss +0 -142
- package/src/components/metric/flash.ts +0 -129
- package/src/components/metric/index.ts +0 -307
- package/src/components/metric/scss/_flash.scss +0 -150
- package/src/components/metric/scss/index.scss +0 -155
- package/src/components/metric/scss/variables.scss +0 -233
- package/src/components/pagination/dots.ts +0 -132
- package/src/components/panels/dnd.ts +0 -190
- package/src/components/panels/index.ts +0 -676
- package/src/components/panels/resize.ts +0 -157
- package/src/components/panels/scss/index.scss +0 -379
- package/src/components/panels/scss/variables.scss +0 -197
- package/src/components/preview/buttons.ts +0 -48
- package/src/components/preview/code.ts +0 -28
- package/src/components/preview/header.ts +0 -23
- package/src/components/preview/index.ts +0 -149
- package/src/components/preview/scss/index.scss +0 -158
- package/src/components/preview/scss/variables.scss +0 -149
- package/src/components/preview/source.ts +0 -73
- package/src/components/preview/stage.ts +0 -33
- package/src/components/range/scss/_filter.scss +0 -360
- package/src/components/range/scss/_slider.scss +0 -65
- package/src/components/range/scss/_vertical.scss +0 -10
- package/src/components/textarea/scss/index.scss +0 -72
- package/src/components/textarea/scss/variables.scss +0 -22
- package/storage/svg/amex.svg +0 -1
- package/storage/svg/arrow-down.svg +0 -1
- package/storage/svg/arrow-left.svg +0 -1
- package/storage/svg/arrow-right.svg +0 -1
- package/storage/svg/arrow-up.svg +0 -1
- package/storage/svg/card.svg +0 -1
- package/storage/svg/chip.svg +0 -1
- package/storage/svg/discover.svg +0 -1
- package/storage/svg/mastercard.svg +0 -1
- package/storage/svg/visa.svg +0 -1
- /package/build/components/{panels → shell}/subtree.d.ts +0 -0
- /package/storage/svg/{chevron-right.svg → chevron.svg} +0 -0
|
@@ -1,22 +1,19 @@
|
|
|
1
1
|
import * as reactivity_u0 from '@esportsplus/reactivity';
|
|
2
|
-
import {
|
|
2
|
+
import { effect, untrack } from '@esportsplus/reactivity';
|
|
3
3
|
import * as template_u1 from '@esportsplus/template';
|
|
4
|
-
import
|
|
5
|
-
import
|
|
4
|
+
import undo from '@esportsplus/ui/svg/undo.svg';
|
|
5
|
+
import group from '../group/index.js';
|
|
6
6
|
import icon from '../icon/index.js';
|
|
7
|
+
import inlineEdit from '../inline-edit/index.js';
|
|
7
8
|
import input from '../input/index.js';
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const template_1np98yq15 = template_u1.template(`<div role='slider'>`, true);
|
|
17
|
-
const template_1np98yq17 = template_u1.template(`<span><!--$-->`, true);
|
|
18
|
-
const template_1np98yq1a = template_u1.template(`<div class='range-filter-fields'>`, true);
|
|
19
|
-
const template_1np98yq1c = template_u1.template(`<!--$--><span aria-hidden='true' class='range-filter-separator'></span><!--$-->`);
|
|
9
|
+
import { clamp } from '../../shared/clamp.js';
|
|
10
|
+
import { keystep } from '../../shared/keystep.js';
|
|
11
|
+
const template_1np98yq5 = template_u1.template(`<span class='group-label range-filter-label'></span><!--$--><div class='range-filter-body'><div role='group'><div class='range-filter-track'><div class='range-fill'></div></div><div aria-hidden='true'></div><!--$--></div><div aria-hidden='true' class='range-filter-ticks'></div></div><!--$-->`);
|
|
12
|
+
const template_1np98yqf = template_u1.template(`<button type='button'><!--$--><span class='button-reveal'><span class='button-reveal-text'>Reset`, true);
|
|
13
|
+
const template_1np98yqj = template_u1.template(`<div role='slider'>`, true);
|
|
14
|
+
const template_1np98yql = template_u1.template(`<span><!--$-->`, true);
|
|
15
|
+
const template_1np98yqo = template_u1.template(`<div class='range-filter-fields'>`, true);
|
|
16
|
+
const template_1np98yqq = template_u1.template(`<!--$--><span aria-hidden='true' class='range-filter-separator'></span><!--$-->`);
|
|
20
17
|
class ReactiveObject_1np98yq0 extends reactivity_u0.ReactiveObject {
|
|
21
18
|
#high;
|
|
22
19
|
#low;
|
|
@@ -58,26 +55,69 @@ class ReactiveObject_1np98yq1 extends reactivity_u0.ReactiveObject {
|
|
|
58
55
|
}
|
|
59
56
|
}
|
|
60
57
|
class ReactiveObject_1np98yq2 extends reactivity_u0.ReactiveObject {
|
|
58
|
+
#active = this[reactivity_u0.SIGNAL](false);
|
|
59
|
+
#error = this[reactivity_u0.SIGNAL]('');
|
|
61
60
|
#value;
|
|
62
61
|
constructor(_p0) {
|
|
63
62
|
super(null);
|
|
64
63
|
this.#value = this[reactivity_u0.SIGNAL](_p0);
|
|
65
64
|
}
|
|
65
|
+
get active() {
|
|
66
|
+
return reactivity_u0.read(this.#active);
|
|
67
|
+
}
|
|
68
|
+
set active(_v0) {
|
|
69
|
+
reactivity_u0.write(this.#active, _v0);
|
|
70
|
+
}
|
|
71
|
+
get error() {
|
|
72
|
+
return reactivity_u0.read(this.#error);
|
|
73
|
+
}
|
|
74
|
+
set error(_v1) {
|
|
75
|
+
reactivity_u0.write(this.#error, _v1);
|
|
76
|
+
}
|
|
66
77
|
get value() {
|
|
67
78
|
return reactivity_u0.read(this.#value);
|
|
68
79
|
}
|
|
69
|
-
set value(
|
|
70
|
-
reactivity_u0.write(this.#value,
|
|
80
|
+
set value(_v2) {
|
|
81
|
+
reactivity_u0.write(this.#value, _v2);
|
|
71
82
|
}
|
|
72
83
|
}
|
|
73
|
-
|
|
84
|
+
class ReactiveObject_1np98yq3 extends reactivity_u0.ReactiveObject {
|
|
85
|
+
#editing = this[reactivity_u0.SIGNAL](false);
|
|
86
|
+
#saved = this[reactivity_u0.SIGNAL](false);
|
|
87
|
+
#value;
|
|
88
|
+
constructor(_p0) {
|
|
89
|
+
super(null);
|
|
90
|
+
this.#value = this[reactivity_u0.SIGNAL](_p0);
|
|
91
|
+
}
|
|
92
|
+
get editing() {
|
|
93
|
+
return reactivity_u0.read(this.#editing);
|
|
94
|
+
}
|
|
95
|
+
set editing(_v0) {
|
|
96
|
+
reactivity_u0.write(this.#editing, _v0);
|
|
97
|
+
}
|
|
98
|
+
get saved() {
|
|
99
|
+
return reactivity_u0.read(this.#saved);
|
|
100
|
+
}
|
|
101
|
+
set saved(_v1) {
|
|
102
|
+
reactivity_u0.write(this.#saved, _v1);
|
|
103
|
+
}
|
|
104
|
+
get value() {
|
|
105
|
+
return reactivity_u0.read(this.#value);
|
|
106
|
+
}
|
|
107
|
+
set value(_v2) {
|
|
108
|
+
reactivity_u0.write(this.#value, _v2);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
const COVERED = 0.15;
|
|
74
112
|
const KEYS = ['low', 'high'];
|
|
75
113
|
const NON_NUMERIC_CHARACTERS = /[^\d.-]/g;
|
|
114
|
+
const RANGE_FILTER_RESET = Symbol.for('@esportsplus/ui/range-filter.reset');
|
|
115
|
+
const RESET = { class: 'button--surface' };
|
|
76
116
|
function snap(value, min, step, decimals) {
|
|
77
117
|
return Number((Math.round((value - min) / step) * step + min).toFixed(decimals));
|
|
78
118
|
}
|
|
79
|
-
|
|
80
|
-
let decimals = (String(step).split('.')[1] || '').length, vertical = orientation === 'vertical', single = typeof value === 'number', span = max - min || 1, s = state ?? new ReactiveObject_1np98yq0(typeof value === 'number' ? value : value?.[1] ?? clamp(snap(min + span * 0.65, min, step, decimals), min, max), typeof value === 'number' ? min : value?.[0] ?? clamp(snap(min + span * 0.15, min, step, decimals), min, max)), indices = single ? [1] : [0, 1], labels = [], pointer = -1, root, thumbs = [], ui = new ReactiveObject_1np98yq1()
|
|
119
|
+
function filter({ [RANGE_FILTER_RESET]: buttons = RESET, disabled = false, fields = false, format = (value) => value.toLocaleString('en-US'), label = 'Price Range', max = 1000, min = 0, orientation = 'horizontal', prefix = '$', reset = true, state, step = 10, ticks = 5, value, ...attributes }) {
|
|
120
|
+
let decimals = (String(step).split('.')[1] || '').length, vertical = orientation === 'vertical', single = typeof value === 'number', span = max - min || 1, s = state ?? new ReactiveObject_1np98yq0(typeof value === 'number' ? value : value?.[1] ?? clamp(snap(min + span * 0.65, min, step, decimals), min, max), typeof value === 'number' ? min : value?.[0] ?? clamp(snap(min + span * 0.15, min, step, decimals), min, max)), indices = single ? [1] : [0, 1], labels = [], hovered = min, pointer = -1, root, thumbs = [], ui = new ReactiveObject_1np98yq1();
|
|
81
121
|
for (let i = 0; i < ticks; i++) {
|
|
82
122
|
let tick = snap(min + (i * span) / Math.max(1, ticks - 1), min, step, decimals);
|
|
83
123
|
if (!labels.includes(tick)) {
|
|
@@ -88,57 +128,46 @@ export default ({ disabled = false, fields = false, format = (value) => value.to
|
|
|
88
128
|
if (!root) {
|
|
89
129
|
return min;
|
|
90
130
|
}
|
|
91
|
-
let rect = root.getBoundingClientRect(), thumb = vertical ? thumbs[indices[0]]?.offsetHeight ?? 0 : 0,
|
|
131
|
+
let rect = root.getBoundingClientRect(), thumb = vertical ? thumbs[indices[0]]?.offsetHeight ?? 0 : 0, share = vertical
|
|
92
132
|
? (rect.bottom - event.clientY - thumb / 2) / Math.max(1, rect.height - thumb)
|
|
93
133
|
: (event.clientX - rect.left) / rect.width;
|
|
94
|
-
return clamp(snap(
|
|
134
|
+
return clamp(snap(share * span + min, min, step, decimals), min, max);
|
|
95
135
|
}
|
|
96
136
|
function commit(index, raw) {
|
|
97
137
|
let next = clamp(snap(raw, min, step, decimals), min, max);
|
|
98
138
|
s[KEYS[index]] = index === 0 ? Math.min(next, s.high) : Math.max(next, s.low);
|
|
99
139
|
}
|
|
100
140
|
function field(index) {
|
|
101
|
-
let
|
|
102
|
-
function
|
|
103
|
-
if (
|
|
104
|
-
|
|
105
|
-
}
|
|
106
|
-
let parsed = Number(draft.value.replace(NON_NUMERIC_CHARACTERS, ''));
|
|
107
|
-
if (draft.value.trim() !== '' && Number.isFinite(parsed)) {
|
|
108
|
-
commit(index, parsed);
|
|
141
|
+
let key = KEYS[index], scrub = new ReactiveObject_1np98yq2(s[key]);
|
|
142
|
+
function sync() {
|
|
143
|
+
if (scrub.value !== s[key]) {
|
|
144
|
+
scrub.value = s[key];
|
|
109
145
|
}
|
|
110
|
-
draft.value = null;
|
|
111
|
-
}
|
|
112
|
-
{
|
|
113
|
-
let root_1np98yq3 = template_1np98yq4(), element_1np98yq5 = root_1np98yq3.firstElementChild, element_1np98yq6 = root_1np98yq3.firstChild.nextSibling;
|
|
114
|
-
element_1np98yq5.appendChild(template_u1.text(single ? 'Value' : index === 0 ? 'Min' : 'Max'));
|
|
115
|
-
template_u1.slot(element_1np98yq6, prefix && (() => {
|
|
116
|
-
let root_1np98yq7 = template_1np98yq8();
|
|
117
|
-
template_u1.slot(root_1np98yq7, prefix, 1);
|
|
118
|
-
return root_1np98yq7;
|
|
119
|
-
})());
|
|
120
|
-
template_u1.slot(root_1np98yq3, input({
|
|
121
|
-
'aria-label': single ? label : `${index === 0 ? 'Minimum' : 'Maximum'} ${label.toLowerCase()}`,
|
|
122
|
-
autocomplete: 'off',
|
|
123
|
-
class: 'range-filter-input',
|
|
124
|
-
disabled,
|
|
125
|
-
inputmode: 'decimal',
|
|
126
|
-
onblur: save,
|
|
127
|
-
oninput: (event) => {
|
|
128
|
-
draft.value = event.target.value;
|
|
129
|
-
},
|
|
130
|
-
onkeydown: (event) => {
|
|
131
|
-
if (event.key === 'Enter') {
|
|
132
|
-
save();
|
|
133
|
-
}
|
|
134
|
-
else if (event.key === 'Escape') {
|
|
135
|
-
draft.value = null;
|
|
136
|
-
}
|
|
137
|
-
},
|
|
138
|
-
value: () => draft.value ?? String(s[key])
|
|
139
|
-
}), 1);
|
|
140
|
-
return root_1np98yq3;
|
|
141
146
|
}
|
|
147
|
+
effect(() => {
|
|
148
|
+
let value = scrub.value;
|
|
149
|
+
untrack(() => {
|
|
150
|
+
commit(index, value);
|
|
151
|
+
sync();
|
|
152
|
+
});
|
|
153
|
+
});
|
|
154
|
+
effect(() => {
|
|
155
|
+
s[key];
|
|
156
|
+
untrack(sync);
|
|
157
|
+
});
|
|
158
|
+
return input.scrub({
|
|
159
|
+
[input.scrub.field]: { disabled },
|
|
160
|
+
class: 'range-filter-field',
|
|
161
|
+
label: name(index),
|
|
162
|
+
max,
|
|
163
|
+
min,
|
|
164
|
+
precision: decimals,
|
|
165
|
+
state: scrub,
|
|
166
|
+
step
|
|
167
|
+
}, single ? 'Value' : index === 0 ? 'Min' : 'Max');
|
|
168
|
+
}
|
|
169
|
+
function fraction(value) {
|
|
170
|
+
return (value - min) / span;
|
|
142
171
|
}
|
|
143
172
|
function keydown(index, event) {
|
|
144
173
|
if (disabled) {
|
|
@@ -151,8 +180,8 @@ export default ({ disabled = false, fields = false, format = (value) => value.to
|
|
|
151
180
|
event.preventDefault();
|
|
152
181
|
commit(index, clamp(s[KEYS[index]] + delta, min, max));
|
|
153
182
|
}
|
|
154
|
-
function
|
|
155
|
-
return
|
|
183
|
+
function name(index) {
|
|
184
|
+
return single ? label : `${index === 0 ? 'Minimum' : 'Maximum'} ${label.toLowerCase()}`;
|
|
156
185
|
}
|
|
157
186
|
function release(event) {
|
|
158
187
|
if (event.pointerId !== pointer) {
|
|
@@ -161,114 +190,111 @@ export default ({ disabled = false, fields = false, format = (value) => value.to
|
|
|
161
190
|
pointer = -1;
|
|
162
191
|
ui.dragging = -1;
|
|
163
192
|
}
|
|
164
|
-
function
|
|
165
|
-
let
|
|
166
|
-
{
|
|
167
|
-
let
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
}), 1);
|
|
181
|
-
new template_u1.EffectSlot(element_1np98yqg, () => !DIGITS.includes(read(char)) && read(char), 1);
|
|
182
|
-
template_u1.setStyle(element_1np98yqf, ["", () => `--digit: ${DIGITS.includes(read(char)) ? read(char) : 0}`]);
|
|
183
|
-
template_u1.setClass(root_1np98yqd, ["range-filter-column", () => {
|
|
184
|
-
let c = read(char);
|
|
185
|
-
return c === '' ? 'range-filter-column--empty' : DIGITS.includes(c) ? 'range-filter-column--digit' : 'range-filter-column--symbol';
|
|
186
|
-
}]);
|
|
187
|
-
return root_1np98yqd;
|
|
193
|
+
function tip(index) {
|
|
194
|
+
let key = KEYS[index], edit = new ReactiveObject_1np98yq3(String(s[key]));
|
|
195
|
+
effect(() => {
|
|
196
|
+
let value = String(s[key]);
|
|
197
|
+
untrack(() => {
|
|
198
|
+
edit.value = value;
|
|
199
|
+
});
|
|
200
|
+
});
|
|
201
|
+
return inlineEdit({
|
|
202
|
+
[inlineEdit.display]: { disabled },
|
|
203
|
+
class: 'range-edit range-filter-tip',
|
|
204
|
+
label: name(index),
|
|
205
|
+
onsave: (text) => {
|
|
206
|
+
let parsed = Number(text.replace(NON_NUMERIC_CHARACTERS, ''));
|
|
207
|
+
if (text.trim() !== '' && Number.isFinite(parsed)) {
|
|
208
|
+
commit(index, parsed);
|
|
188
209
|
}
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
210
|
+
edit.value = String(s[key]);
|
|
211
|
+
},
|
|
212
|
+
state: edit,
|
|
213
|
+
style: `--position: var(--${key});`
|
|
214
|
+
}, () => `${prefix}${format(s[key])}`);
|
|
192
215
|
}
|
|
193
|
-
{
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
216
|
+
return group({
|
|
217
|
+
...attributes,
|
|
218
|
+
class: ['range-filter', vertical && 'range-filter--vertical', disabled && '--disabled', attributes.class ?? []].flat()
|
|
219
|
+
}, (() => {
|
|
220
|
+
let root_1np98yq4 = template_1np98yq5(), element_1np98yq6 = root_1np98yq4.firstChild, element_1np98yq7 = element_1np98yq6.nextSibling, element_1np98yq8 = element_1np98yq7.nextSibling, element_1np98yq9 = element_1np98yq8.firstElementChild, element_1np98yqa = element_1np98yq9.firstElementChild.nextElementSibling, element_1np98yqb = element_1np98yq9.firstChild.nextSibling.nextSibling, element_1np98yqc = element_1np98yq9.nextElementSibling, element_1np98yqd = element_1np98yq8.nextSibling;
|
|
221
|
+
template_u1.slot(element_1np98yq6, label, 1);
|
|
222
|
+
template_u1.slot(element_1np98yq7, reset && (() => {
|
|
223
|
+
let root_1np98yqe = template_1np98yqf(), element_1np98yqg = root_1np98yqe.firstChild;
|
|
224
|
+
template_u1.slot(element_1np98yqg, icon({ 'aria-hidden': 'true', class: 'range-filter-reset-icon' }, undo));
|
|
225
|
+
template_u1.delegate(root_1np98yqe, 'click', () => {
|
|
226
|
+
s.low = min;
|
|
227
|
+
s.high = single ? min : max;
|
|
228
|
+
});
|
|
229
|
+
let attributes_1np98yqh = buttons;
|
|
230
|
+
template_u1.setProperties(root_1np98yqe, attributes_1np98yqh, true);
|
|
231
|
+
template_u1.setProperty(root_1np98yqe, 'disabled', () => disabled || (s.low === min && s.high === (single ? min : max)));
|
|
232
|
+
template_u1.setClass(root_1np98yqe, ["button button--border button--reveal button--reveal-hover range-filter-reset", attributes_1np98yqh?.class]);
|
|
233
|
+
template_u1.setStyle(root_1np98yqe, ["", attributes_1np98yqh?.style]);
|
|
234
|
+
return root_1np98yqe;
|
|
201
235
|
})());
|
|
202
|
-
template_u1.slot(
|
|
203
|
-
template_u1.slot(element_1np98yqr, roll('high'), 1);
|
|
204
|
-
template_u1.slot(element_1np98yqt, icon({ 'aria-hidden': 'true', class: 'range-filter-clear-icon' }, close));
|
|
205
|
-
template_u1.slot(element_1np98yqv, indices.map((index) => {
|
|
236
|
+
template_u1.slot(element_1np98yqb, indices.map((index) => {
|
|
206
237
|
let key = KEYS[index];
|
|
207
238
|
{
|
|
208
|
-
let
|
|
209
|
-
template_u1.setProperty(
|
|
210
|
-
template_u1.setProperty(
|
|
211
|
-
template_u1.setProperty(
|
|
212
|
-
template_u1.setProperty(
|
|
213
|
-
template_u1.setProperty(
|
|
214
|
-
template_u1.setProperty(
|
|
215
|
-
template_u1.setProperty(
|
|
216
|
-
template_u1.setProperty(
|
|
217
|
-
template_u1.onconnect(
|
|
239
|
+
let root_1np98yqi = template_1np98yqj();
|
|
240
|
+
template_u1.setProperty(root_1np98yqi, 'aria-disabled', disabled);
|
|
241
|
+
template_u1.setProperty(root_1np98yqi, 'aria-orientation', orientation);
|
|
242
|
+
template_u1.setProperty(root_1np98yqi, 'aria-label', name(index));
|
|
243
|
+
template_u1.setProperty(root_1np98yqi, 'aria-valuemax', max);
|
|
244
|
+
template_u1.setProperty(root_1np98yqi, 'aria-valuemin', min);
|
|
245
|
+
template_u1.setProperty(root_1np98yqi, 'tabindex', disabled ? -1 : 0);
|
|
246
|
+
template_u1.setProperty(root_1np98yqi, 'aria-valuenow', () => s[key]);
|
|
247
|
+
template_u1.setProperty(root_1np98yqi, 'aria-valuetext', () => `${prefix}${format(s[key])}`);
|
|
248
|
+
template_u1.onconnect(root_1np98yqi, (element) => {
|
|
218
249
|
thumbs[index] = element;
|
|
219
250
|
});
|
|
220
|
-
template_u1.delegate(
|
|
221
|
-
template_u1.setClass(
|
|
251
|
+
template_u1.delegate(root_1np98yqi, 'keydown', (event) => keydown(index, event));
|
|
252
|
+
template_u1.setClass(root_1np98yqi, ["range-filter-thumb", [
|
|
222
253
|
() => ui.dragging === index && '--active',
|
|
223
|
-
|
|
254
|
+
index === 0 && (() => s.low === max && 'range-filter-thumb--stacked')
|
|
224
255
|
]]);
|
|
225
|
-
template_u1.setStyle(
|
|
226
|
-
return
|
|
256
|
+
template_u1.setStyle(root_1np98yqi, ["", "--position: var(--" + (key) + ")"]);
|
|
257
|
+
return root_1np98yqi;
|
|
227
258
|
}
|
|
259
|
+
}));
|
|
260
|
+
template_u1.slot(element_1np98yq9, indices.map(tip), 1);
|
|
261
|
+
template_u1.slot(element_1np98yqc, labels.map((tick) => {
|
|
262
|
+
let root_1np98yqk = template_1np98yql(), element_1np98yqm = root_1np98yqk.firstChild;
|
|
263
|
+
template_u1.slot(element_1np98yqm, prefix);
|
|
264
|
+
template_u1.slot(root_1np98yqk, format(tick), 1);
|
|
265
|
+
template_u1.setClass(root_1np98yqk, ["range-filter-tick", () => indices.some((index) => Math.abs(fraction(s[KEYS[index]]) - fraction(tick)) < COVERED) && 'range-filter-tick--covered']);
|
|
266
|
+
return root_1np98yqk;
|
|
228
267
|
}), 1);
|
|
229
|
-
template_u1.slot(
|
|
230
|
-
let
|
|
231
|
-
template_u1.slot(
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
let root_1np98yq19 = template_1np98yq1a();
|
|
237
|
-
template_u1.slot(root_1np98yq19, single ? field(1) : (() => {
|
|
238
|
-
let root_1np98yq1b = template_1np98yq1c(), element_1np98yq1d = root_1np98yq1b.firstChild, element_1np98yq1e = element_1np98yq1d.nextSibling.nextSibling;
|
|
239
|
-
template_u1.slot(element_1np98yq1d, field(0));
|
|
240
|
-
template_u1.slot(element_1np98yq1e, field(1));
|
|
241
|
-
return root_1np98yq1b;
|
|
268
|
+
template_u1.slot(element_1np98yqd, fields && (() => {
|
|
269
|
+
let root_1np98yqn = template_1np98yqo();
|
|
270
|
+
template_u1.slot(root_1np98yqn, single ? field(1) : (() => {
|
|
271
|
+
let root_1np98yqp = template_1np98yqq(), element_1np98yqr = root_1np98yqp.firstChild, element_1np98yqs = element_1np98yqr.nextSibling.nextSibling;
|
|
272
|
+
template_u1.slot(element_1np98yqr, field(0));
|
|
273
|
+
template_u1.slot(element_1np98yqs, field(1));
|
|
274
|
+
return root_1np98yqp;
|
|
242
275
|
})(), 1);
|
|
243
|
-
return
|
|
244
|
-
})()
|
|
245
|
-
template_u1.setClass(
|
|
246
|
-
template_u1.
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
if (p === -1 || (p >= s.low && p <= s.high)) {
|
|
250
|
-
return '';
|
|
276
|
+
return root_1np98yqn;
|
|
277
|
+
})());
|
|
278
|
+
template_u1.setClass(element_1np98yqa, ["range-ghost", () => (ui.preview !== -1 && (ui.preview < s.low || ui.preview > s.high)) && '--active']);
|
|
279
|
+
template_u1.setStyle(element_1np98yqa, ["", () => {
|
|
280
|
+
if (ui.preview !== -1) {
|
|
281
|
+
hovered = ui.preview;
|
|
251
282
|
}
|
|
252
|
-
|
|
253
|
-
return p < s.low
|
|
254
|
-
? `${start}: ${pct(p)}%; ${size}: ${pct(s.low) - pct(p)}%;`
|
|
255
|
-
: `${start}: ${pct(s.high)}%; ${size}: ${pct(p) - pct(s.high)}%;`;
|
|
283
|
+
return `--preview: ${fraction(hovered)};`;
|
|
256
284
|
}]);
|
|
257
|
-
template_u1.
|
|
258
|
-
template_u1.
|
|
259
|
-
? `bottom: ${pct(s.low)}%; top: ${100 - pct(s.high)}%;`
|
|
260
|
-
: `left: ${pct(s.low)}%; right: ${100 - pct(s.high)}%;`]);
|
|
261
|
-
template_u1.setClass(element_1np98yqw, ["range-filter-track", vertical && 'range-filter-track--vertical']);
|
|
262
|
-
template_u1.setProperty(element_1np98yqv, 'aria-label', label);
|
|
263
|
-
template_u1.onconnect(element_1np98yqv, (element) => {
|
|
285
|
+
template_u1.setProperty(element_1np98yq9, 'aria-label', label);
|
|
286
|
+
template_u1.onconnect(element_1np98yq9, (element) => {
|
|
264
287
|
root = element;
|
|
265
288
|
});
|
|
266
|
-
template_u1.delegate(
|
|
267
|
-
template_u1.delegate(
|
|
268
|
-
template_u1.delegate(
|
|
289
|
+
template_u1.delegate(element_1np98yq9, 'lostpointercapture', release);
|
|
290
|
+
template_u1.delegate(element_1np98yq9, 'pointercancel', release);
|
|
291
|
+
template_u1.delegate(element_1np98yq9, 'pointerdown', (event) => {
|
|
269
292
|
if (disabled || event.button !== 0 || !root || pointer !== -1) {
|
|
270
293
|
return;
|
|
271
294
|
}
|
|
295
|
+
if (event.target.closest('.range-filter-tip')) {
|
|
296
|
+
return;
|
|
297
|
+
}
|
|
272
298
|
let grabbed = thumbs.indexOf(event.target.closest('.range-filter-thumb')), v = at(event), index;
|
|
273
299
|
if (grabbed !== -1) {
|
|
274
300
|
index = grabbed;
|
|
@@ -281,17 +307,17 @@ export default ({ disabled = false, fields = false, format = (value) => value.to
|
|
|
281
307
|
index = toLow === toHigh ? (v < s.low ? 0 : 1) : (toLow < toHigh ? 0 : 1);
|
|
282
308
|
}
|
|
283
309
|
event.preventDefault();
|
|
284
|
-
thumbs[index]?.focus({ preventScroll: true });
|
|
310
|
+
thumbs[index]?.focus({ focusVisible: false, preventScroll: true });
|
|
285
311
|
root.setPointerCapture(event.pointerId);
|
|
286
312
|
pointer = event.pointerId;
|
|
287
313
|
ui.dragging = index;
|
|
288
314
|
ui.preview = -1;
|
|
289
315
|
commit(index, v);
|
|
290
316
|
});
|
|
291
|
-
template_u1.direct(
|
|
317
|
+
template_u1.direct(element_1np98yq9, 'pointerleave', () => {
|
|
292
318
|
ui.preview = -1;
|
|
293
319
|
});
|
|
294
|
-
template_u1.delegate(
|
|
320
|
+
template_u1.delegate(element_1np98yq9, 'pointermove', (event) => {
|
|
295
321
|
if (ui.dragging !== -1) {
|
|
296
322
|
if (event.pointerId === pointer) {
|
|
297
323
|
commit(ui.dragging, at(event));
|
|
@@ -302,19 +328,10 @@ export default ({ disabled = false, fields = false, format = (value) => value.to
|
|
|
302
328
|
ui.preview = at(event);
|
|
303
329
|
}
|
|
304
330
|
});
|
|
305
|
-
template_u1.delegate(
|
|
306
|
-
template_u1.setClass(
|
|
307
|
-
template_u1.
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
template_u1.setProperty(element_1np98yqs, 'disabled', () => disabled || (s.low === min && s.high === (single ? min : max)));
|
|
313
|
-
template_u1.setClass(element_1np98yqs, ["range-filter-clear"]);
|
|
314
|
-
let attributes_1np98yq1f = attributes;
|
|
315
|
-
template_u1.setProperties(root_1np98yqj, attributes_1np98yq1f, true);
|
|
316
|
-
template_u1.setClass(root_1np98yqj, ["range-filter", vertical && 'range-filter--vertical', disabled && '--disabled', attributes_1np98yq1f?.class]);
|
|
317
|
-
template_u1.setStyle(root_1np98yqj, ["", attributes_1np98yq1f?.style]);
|
|
318
|
-
return root_1np98yqj;
|
|
319
|
-
}
|
|
320
|
-
};
|
|
331
|
+
template_u1.delegate(element_1np98yq9, 'pointerup', release);
|
|
332
|
+
template_u1.setClass(element_1np98yq9, ["range-filter-root"]);
|
|
333
|
+
template_u1.setStyle(element_1np98yq9, ["", () => `--high: ${fraction(s.high)}; --low: ${fraction(s.low)};`]);
|
|
334
|
+
return root_1np98yq4;
|
|
335
|
+
})());
|
|
336
|
+
}
|
|
337
|
+
export default Object.assign(filter, { reset: RANGE_FILTER_RESET });
|
|
@@ -1,21 +1,26 @@
|
|
|
1
1
|
import * as template_u1 from '@esportsplus/template';
|
|
2
2
|
import { type Attributes } from '@esportsplus/template';
|
|
3
3
|
import filter from './filter.js';
|
|
4
|
+
import surface from './surface.js';
|
|
4
5
|
import './scss/index.scss';
|
|
5
|
-
|
|
6
|
-
attributes?: Attributes;
|
|
7
|
-
} | void, { max, min, orientation, state, value, ...attributes }: Attributes & {
|
|
6
|
+
type A = Attributes & {
|
|
8
7
|
max: number;
|
|
9
8
|
min: number;
|
|
10
9
|
orientation?: 'horizontal' | 'vertical';
|
|
11
|
-
state?:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
state?: State;
|
|
11
|
+
};
|
|
12
|
+
type State = {
|
|
13
|
+
active: boolean;
|
|
14
|
+
error: string;
|
|
15
|
+
value: number;
|
|
16
|
+
};
|
|
17
|
+
declare function plain(this: {
|
|
18
|
+
attributes?: Attributes;
|
|
19
|
+
} | void, { max, min, orientation, state, value, ...attributes }: A): template_u1.Element;
|
|
17
20
|
declare const range: typeof plain & {
|
|
18
21
|
filter: typeof filter;
|
|
22
|
+
surface: typeof surface;
|
|
19
23
|
};
|
|
20
24
|
export default range;
|
|
21
25
|
export type { RangeFilterState } from './filter.js';
|
|
26
|
+
export type { RangeSurfaceState } from './surface.js';
|
|
@@ -2,14 +2,16 @@ import * as reactivity_u0 from '@esportsplus/reactivity';
|
|
|
2
2
|
import * as template_u1 from '@esportsplus/template';
|
|
3
3
|
import form from '../form/index.js';
|
|
4
4
|
import filter from './filter.js';
|
|
5
|
+
import surface from './surface.js';
|
|
5
6
|
import './scss/index.scss';
|
|
6
7
|
const template_0aka2e62 = template_u1.template(`<input type='range' />`, true);
|
|
7
8
|
class ReactiveObject_0aka2e60 extends reactivity_u0.ReactiveObject {
|
|
8
9
|
#active = this[reactivity_u0.SIGNAL](false);
|
|
9
10
|
#error = this[reactivity_u0.SIGNAL]('');
|
|
10
|
-
#value
|
|
11
|
-
constructor() {
|
|
11
|
+
#value;
|
|
12
|
+
constructor(_p0) {
|
|
12
13
|
super(null);
|
|
14
|
+
this.#value = this[reactivity_u0.SIGNAL](_p0);
|
|
13
15
|
}
|
|
14
16
|
get active() {
|
|
15
17
|
return reactivity_u0.read(this.#active);
|
|
@@ -30,10 +32,11 @@ class ReactiveObject_0aka2e60 extends reactivity_u0.ReactiveObject {
|
|
|
30
32
|
reactivity_u0.write(this.#value, _v2);
|
|
31
33
|
}
|
|
32
34
|
}
|
|
33
|
-
function plain({ max, min, orientation = 'horizontal', state = new ReactiveObject_0aka2e60(), value, ...attributes }) {
|
|
34
|
-
if (value) {
|
|
35
|
+
function plain({ max, min, orientation = 'horizontal', state = new ReactiveObject_0aka2e60(min), value, ...attributes }) {
|
|
36
|
+
if (value !== undefined) {
|
|
35
37
|
state.value = Number(value);
|
|
36
38
|
}
|
|
39
|
+
let span = max - min || 1;
|
|
37
40
|
{
|
|
38
41
|
let root_0aka2e61 = template_0aka2e62();
|
|
39
42
|
template_u1.setProperty(root_0aka2e61, 'aria-orientation', orientation);
|
|
@@ -44,14 +47,14 @@ function plain({ max, min, orientation = 'horizontal', state = new ReactiveObjec
|
|
|
44
47
|
let attributes_0aka2e64 = attributes;
|
|
45
48
|
template_u1.setProperties(root_0aka2e61, attributes_0aka2e64, true);
|
|
46
49
|
template_u1.setProperties(root_0aka2e61, form.input.attributes(state));
|
|
47
|
-
template_u1.delegate(root_0aka2e61, 'input', (
|
|
48
|
-
state.value = Number(
|
|
50
|
+
template_u1.delegate(root_0aka2e61, 'input', (event) => {
|
|
51
|
+
state.value = Number(event.target.value);
|
|
49
52
|
});
|
|
50
53
|
template_u1.setProperty(root_0aka2e61, 'value', () => state.value);
|
|
51
54
|
template_u1.setClass(root_0aka2e61, ["range", orientation === 'vertical' && 'range--vertical', attributes_0aka2e63?.class, attributes_0aka2e64?.class]);
|
|
52
|
-
template_u1.setStyle(root_0aka2e61, ["", () => `--thumb-position: ${((state.value - min) /
|
|
55
|
+
template_u1.setStyle(root_0aka2e61, ["", () => `--thumb-position: ${((state.value - min) / span) * 100}%`, attributes_0aka2e63?.style, attributes_0aka2e64?.style]);
|
|
53
56
|
return root_0aka2e61;
|
|
54
57
|
}
|
|
55
58
|
}
|
|
56
|
-
const range = Object.assign(plain, { filter });
|
|
59
|
+
const range = Object.assign(plain, { filter, surface });
|
|
57
60
|
export default range;
|