@ojiepermana/angular 22.1.13 → 22.2.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/README.md +8 -6
- package/SUPPORT.md +3 -3
- package/chart/README.md +1 -1
- package/component/README.md +2 -2
- package/component/calendar/README.md +3 -15
- package/component/drawer/README.md +1 -2
- package/fesm2022/ojiepermana-angular-chart-area.mjs +352 -137
- package/fesm2022/ojiepermana-angular-chart-bar.mjs +744 -524
- package/fesm2022/ojiepermana-angular-chart-core.mjs +1140 -1344
- package/fesm2022/ojiepermana-angular-chart-line.mjs +393 -147
- package/fesm2022/ojiepermana-angular-chart-pie.mjs +408 -179
- package/fesm2022/ojiepermana-angular-chart-primitives.mjs +1262 -920
- package/fesm2022/ojiepermana-angular-chart-radar.mjs +473 -205
- package/fesm2022/ojiepermana-angular-chart-radial.mjs +425 -182
- package/fesm2022/ojiepermana-angular-chart-scatter.mjs +386 -210
- package/fesm2022/ojiepermana-angular-chart.mjs +3 -19
- package/fesm2022/ojiepermana-angular-component-accordion.mjs +485 -243
- package/fesm2022/ojiepermana-angular-component-alert-dialog.mjs +963 -325
- package/fesm2022/ojiepermana-angular-component-alert.mjs +266 -103
- package/fesm2022/ojiepermana-angular-component-aspect-ratio.mjs +80 -35
- package/fesm2022/ojiepermana-angular-component-avatar.mjs +402 -135
- package/fesm2022/ojiepermana-angular-component-badge.mjs +109 -59
- package/fesm2022/ojiepermana-angular-component-breadcrumb.mjs +410 -142
- package/fesm2022/ojiepermana-angular-component-button-group.mjs +249 -96
- package/fesm2022/ojiepermana-angular-component-button.mjs +153 -75
- package/fesm2022/ojiepermana-angular-component-calendar.mjs +531 -418
- package/fesm2022/ojiepermana-angular-component-card.mjs +457 -171
- package/fesm2022/ojiepermana-angular-component-carousel.mjs +642 -272
- package/fesm2022/ojiepermana-angular-component-checkbox.mjs +312 -108
- package/fesm2022/ojiepermana-angular-component-collapsible.mjs +299 -115
- package/fesm2022/ojiepermana-angular-component-combobox.mjs +396 -183
- package/fesm2022/ojiepermana-angular-component-command.mjs +807 -347
- package/fesm2022/ojiepermana-angular-component-composer.mjs +807 -330
- package/fesm2022/ojiepermana-angular-component-context-menu.mjs +196 -161
- package/fesm2022/ojiepermana-angular-component-date-picker.mjs +650 -338
- package/fesm2022/ojiepermana-angular-component-dialog.mjs +710 -316
- package/fesm2022/ojiepermana-angular-component-drawer.mjs +2 -5
- package/fesm2022/ojiepermana-angular-component-dropdown-menu.mjs +1212 -646
- package/fesm2022/ojiepermana-angular-component-editor.mjs +987 -502
- package/fesm2022/ojiepermana-angular-component-empty.mjs +350 -137
- package/fesm2022/ojiepermana-angular-component-form.mjs +813 -434
- package/fesm2022/ojiepermana-angular-component-hover-card.mjs +486 -277
- package/fesm2022/ojiepermana-angular-component-icon.mjs +241 -140
- package/fesm2022/ojiepermana-angular-component-input-group.mjs +449 -176
- package/fesm2022/ojiepermana-angular-component-input-otp.mjs +891 -488
- package/fesm2022/ojiepermana-angular-component-input.mjs +86 -55
- package/fesm2022/ojiepermana-angular-component-item.mjs +713 -261
- package/fesm2022/ojiepermana-angular-component-kanban.mjs +714 -216
- package/fesm2022/ojiepermana-angular-component-kbd.mjs +124 -52
- package/fesm2022/ojiepermana-angular-component-label.mjs +82 -31
- package/fesm2022/ojiepermana-angular-component-menubar.mjs +479 -329
- package/fesm2022/ojiepermana-angular-component-native-select.mjs +167 -65
- package/fesm2022/ojiepermana-angular-component-navigation-menu.mjs +683 -380
- package/fesm2022/ojiepermana-angular-component-pagination.mjs +277 -94
- package/fesm2022/ojiepermana-angular-component-pillbox.mjs +1283 -607
- package/fesm2022/ojiepermana-angular-component-popover.mjs +291 -204
- package/fesm2022/ojiepermana-angular-component-progress.mjs +176 -53
- package/fesm2022/ojiepermana-angular-component-radio.mjs +449 -142
- package/fesm2022/ojiepermana-angular-component-resizable.mjs +659 -453
- package/fesm2022/ojiepermana-angular-component-scroll-area.mjs +117 -39
- package/fesm2022/ojiepermana-angular-component-segmented-control.mjs +351 -172
- package/fesm2022/ojiepermana-angular-component-select.mjs +475 -345
- package/fesm2022/ojiepermana-angular-component-separator.mjs +102 -35
- package/fesm2022/ojiepermana-angular-component-sheet.mjs +797 -347
- package/fesm2022/ojiepermana-angular-component-skeleton.mjs +62 -29
- package/fesm2022/ojiepermana-angular-component-slider.mjs +592 -376
- package/fesm2022/ojiepermana-angular-component-spinner.mjs +135 -38
- package/fesm2022/ojiepermana-angular-component-switch.mjs +315 -103
- package/fesm2022/ojiepermana-angular-component-table.mjs +440 -153
- package/fesm2022/ojiepermana-angular-component-tabs.mjs +590 -317
- package/fesm2022/ojiepermana-angular-component-textarea.mjs +85 -50
- package/fesm2022/ojiepermana-angular-component-timeline.mjs +609 -231
- package/fesm2022/ojiepermana-angular-component-toast.mjs +229 -243
- package/fesm2022/ojiepermana-angular-component-toggle-group.mjs +573 -288
- package/fesm2022/ojiepermana-angular-component-toggle.mjs +187 -78
- package/fesm2022/ojiepermana-angular-component-tooltip.mjs +798 -517
- package/fesm2022/ojiepermana-angular-component-utils-core.mjs +159 -292
- package/fesm2022/ojiepermana-angular-component-utils-overlay.mjs +46 -58
- package/fesm2022/ojiepermana-angular-component-utils-scale.mjs +76 -38
- package/fesm2022/ojiepermana-angular-component-utils.mjs +2 -8
- package/fesm2022/ojiepermana-angular-component.mjs +0 -10
- package/fesm2022/ojiepermana-angular-navigation-core.mjs +13 -23
- package/fesm2022/ojiepermana-angular-navigation-icon.mjs +35 -24
- package/fesm2022/ojiepermana-angular-navigation-navigation-badge-count.component-BKCeWzml.mjs +129 -0
- package/fesm2022/ojiepermana-angular-navigation-navigation-dockbar-menu.component-DFEJK2jD.mjs +811 -0
- package/fesm2022/{ojiepermana-angular-navigation-navigation-entry-grid.component-Cd-jh6tg.mjs → ojiepermana-angular-navigation-navigation-entry-grid.component-mpK9Ar08.mjs} +387 -183
- package/fesm2022/ojiepermana-angular-navigation-navigation-flyout-menu.component-BPgH7FJk.mjs +650 -0
- package/fesm2022/ojiepermana-angular-navigation-navigation-horizontal.component-DMpYcD9t.mjs +662 -0
- package/fesm2022/ojiepermana-angular-navigation-navigation-item.component-Basp5SIk.mjs +1228 -0
- package/fesm2022/ojiepermana-angular-navigation-navigation-list.component-YUzHI9Pj.mjs +311 -0
- package/fesm2022/ojiepermana-angular-navigation-service.mjs +542 -724
- package/fesm2022/ojiepermana-angular-navigation-types.mjs +27 -56
- package/fesm2022/ojiepermana-angular-navigation.mjs +3052 -4
- package/fesm2022/ojiepermana-angular-sdk.mjs +91 -201
- package/fesm2022/ojiepermana-angular-theme-component-settings.mjs +1115 -737
- package/fesm2022/ojiepermana-angular-theme-layout-services.mjs +245 -328
- package/fesm2022/ojiepermana-angular-theme-layout-types.mjs +35 -38
- package/fesm2022/ojiepermana-angular-theme-layout-wrapper.mjs +1719 -552
- package/fesm2022/ojiepermana-angular-theme-layout.mjs +847 -491
- package/fesm2022/ojiepermana-angular-theme-page-core.mjs +288 -358
- package/fesm2022/ojiepermana-angular-theme-page-filter.mjs +362 -224
- package/fesm2022/ojiepermana-angular-theme-page-overview.mjs +88 -0
- package/fesm2022/ojiepermana-angular-theme-page-root.mjs +576 -254
- package/fesm2022/ojiepermana-angular-theme-page-side.mjs +317 -177
- package/fesm2022/ojiepermana-angular-theme-page-slots.mjs +256 -112
- package/fesm2022/ojiepermana-angular-theme-page.mjs +7 -12
- package/fesm2022/ojiepermana-angular-theme-shell-services.mjs +215 -326
- package/fesm2022/ojiepermana-angular-theme-shell-types.mjs +68 -129
- package/fesm2022/ojiepermana-angular-theme-shell.mjs +907 -378
- package/fesm2022/ojiepermana-angular-theme-styles.mjs +521 -720
- package/fesm2022/ojiepermana-angular-theme.mjs +0 -10
- package/fesm2022/ojiepermana-angular.mjs +5 -24
- package/navigation/README.md +1 -1
- package/package.json +16 -12
- package/sdk/README.md +1 -1
- package/sdk/src/writer/index.js +2 -2
- package/theme/README.md +1 -1
- package/theme/layout/README.md +2 -4
- package/theme/page/README.md +50 -0
- package/theme/styles/README.md +10 -10
- package/theme/styles/css/base/prefers-dark.css +1 -1
- package/theme/styles/css/base/status.css +1 -1
- package/theme/styles/css/color/amber.css +1 -1
- package/theme/styles/css/color/blue.css +1 -1
- package/theme/styles/css/color/cyan.css +1 -1
- package/theme/styles/css/color/emerald.css +1 -1
- package/theme/styles/css/color/fuchsia.css +1 -1
- package/theme/styles/css/color/green.css +1 -1
- package/theme/styles/css/color/indigo.css +1 -1
- package/theme/styles/css/color/lime.css +1 -1
- package/theme/styles/css/color/orange.css +1 -1
- package/theme/styles/css/color/pink.css +1 -1
- package/theme/styles/css/color/purple.css +1 -1
- package/theme/styles/css/color/red.css +1 -1
- package/theme/styles/css/color/rose.css +1 -1
- package/theme/styles/css/color/sky.css +1 -1
- package/theme/styles/css/color/teal.css +1 -1
- package/theme/styles/css/color/violet.css +1 -1
- package/theme/styles/css/color/yellow.css +1 -1
- package/theme/styles/css/neutral/gray.css +1 -1
- package/theme/styles/css/neutral/mauve.css +1 -1
- package/theme/styles/css/neutral/mist.css +1 -1
- package/theme/styles/css/neutral/neutral.css +1 -1
- package/theme/styles/css/neutral/olive.css +1 -1
- package/theme/styles/css/neutral/slate.css +1 -1
- package/theme/styles/css/neutral/stone.css +1 -1
- package/theme/styles/css/neutral/taupe.css +1 -1
- package/theme/styles/css/neutral/zinc.css +1 -1
- package/types/ojiepermana-angular-chart-area.d.ts +126 -63
- package/types/ojiepermana-angular-chart-bar.d.ts +244 -154
- package/types/ojiepermana-angular-chart-core.d.ts +409 -398
- package/types/ojiepermana-angular-chart-line.d.ts +141 -68
- package/types/ojiepermana-angular-chart-pie.d.ts +192 -121
- package/types/ojiepermana-angular-chart-primitives.d.ts +283 -214
- package/types/ojiepermana-angular-chart-radar.d.ts +189 -108
- package/types/ojiepermana-angular-chart-radial.d.ts +177 -106
- package/types/ojiepermana-angular-chart-scatter.d.ts +166 -110
- package/types/ojiepermana-angular-chart.d.ts +3 -2
- package/types/ojiepermana-angular-component-accordion.d.ts +135 -81
- package/types/ojiepermana-angular-component-alert-dialog.d.ts +271 -123
- package/types/ojiepermana-angular-component-alert.d.ts +69 -39
- package/types/ojiepermana-angular-component-aspect-ratio.d.ts +20 -12
- package/types/ojiepermana-angular-component-avatar.d.ts +103 -49
- package/types/ojiepermana-angular-component-badge.d.ts +36 -24
- package/types/ojiepermana-angular-component-breadcrumb.d.ts +79 -40
- package/types/ojiepermana-angular-component-button-group.d.ts +48 -24
- package/types/ojiepermana-angular-component-button.d.ts +44 -27
- package/types/ojiepermana-angular-component-calendar.d.ts +145 -107
- package/types/ojiepermana-angular-component-card.d.ts +112 -63
- package/types/ojiepermana-angular-component-carousel.d.ts +150 -81
- package/types/ojiepermana-angular-component-checkbox.d.ts +96 -38
- package/types/ojiepermana-angular-component-collapsible.d.ts +65 -39
- package/types/ojiepermana-angular-component-combobox.d.ts +100 -55
- package/types/ojiepermana-angular-component-command.d.ts +206 -121
- package/types/ojiepermana-angular-component-composer.d.ts +184 -84
- package/types/ojiepermana-angular-component-context-menu.d.ts +51 -41
- package/types/ojiepermana-angular-component-date-picker.d.ts +199 -109
- package/types/ojiepermana-angular-component-dialog.d.ts +200 -105
- package/types/ojiepermana-angular-component-drawer.d.ts +2 -1
- package/types/ojiepermana-angular-component-dropdown-menu.d.ts +324 -202
- package/types/ojiepermana-angular-component-editor.d.ts +215 -117
- package/types/ojiepermana-angular-component-empty.d.ts +80 -45
- package/types/ojiepermana-angular-component-form.d.ts +185 -121
- package/types/ojiepermana-angular-component-hover-card.d.ts +130 -72
- package/types/ojiepermana-angular-component-icon.d.ts +87 -57
- package/types/ojiepermana-angular-component-input-group.d.ts +93 -46
- package/types/ojiepermana-angular-component-input-otp.d.ts +243 -150
- package/types/ojiepermana-angular-component-input.d.ts +27 -17
- package/types/ojiepermana-angular-component-item.d.ts +160 -84
- package/types/ojiepermana-angular-component-kanban.d.ts +157 -62
- package/types/ojiepermana-angular-component-kbd.d.ts +24 -15
- package/types/ojiepermana-angular-component-label.d.ts +19 -11
- package/types/ojiepermana-angular-component-menubar.d.ts +120 -90
- package/types/ojiepermana-angular-component-native-select.d.ts +37 -24
- package/types/ojiepermana-angular-component-navigation-menu.d.ts +157 -98
- package/types/ojiepermana-angular-component-pagination.d.ts +78 -28
- package/types/ojiepermana-angular-component-pillbox.d.ts +361 -204
- package/types/ojiepermana-angular-component-popover.d.ts +94 -64
- package/types/ojiepermana-angular-component-progress.d.ts +45 -17
- package/types/ojiepermana-angular-component-radio.d.ts +129 -53
- package/types/ojiepermana-angular-component-resizable.d.ts +160 -112
- package/types/ojiepermana-angular-component-scroll-area.d.ts +33 -15
- package/types/ojiepermana-angular-component-segmented-control.d.ts +94 -50
- package/types/ojiepermana-angular-component-select.d.ts +94 -77
- package/types/ojiepermana-angular-component-separator.d.ts +26 -14
- package/types/ojiepermana-angular-component-sheet.d.ts +226 -116
- package/types/ojiepermana-angular-component-skeleton.d.ts +13 -10
- package/types/ojiepermana-angular-component-slider.d.ts +140 -75
- package/types/ojiepermana-angular-component-spinner.d.ts +31 -13
- package/types/ojiepermana-angular-component-switch.d.ts +97 -40
- package/types/ojiepermana-angular-component-table.d.ts +102 -50
- package/types/ojiepermana-angular-component-tabs.d.ts +174 -115
- package/types/ojiepermana-angular-component-textarea.d.ts +27 -17
- package/types/ojiepermana-angular-component-timeline.d.ts +141 -59
- package/types/ojiepermana-angular-component-toast.d.ts +51 -55
- package/types/ojiepermana-angular-component-toggle-group.d.ts +159 -88
- package/types/ojiepermana-angular-component-toggle.d.ts +47 -25
- package/types/ojiepermana-angular-component-tooltip.d.ts +222 -132
- package/types/ojiepermana-angular-component-utils-core.d.ts +81 -90
- package/types/ojiepermana-angular-component-utils-overlay.d.ts +7 -11
- package/types/ojiepermana-angular-component-utils-scale.d.ts +20 -12
- package/types/ojiepermana-angular-component-utils.d.ts +2 -2
- package/types/ojiepermana-angular-component.d.ts +1 -2
- package/types/ojiepermana-angular-navigation-core.d.ts +46 -50
- package/types/ojiepermana-angular-navigation-icon.d.ts +9 -12
- package/types/ojiepermana-angular-navigation-service.d.ts +112 -115
- package/types/ojiepermana-angular-navigation-types.d.ts +121 -125
- package/types/ojiepermana-angular-navigation.d.ts +663 -374
- package/types/ojiepermana-angular-sdk.d.ts +69 -71
- package/types/ojiepermana-angular-theme-component-settings.d.ts +115 -83
- package/types/ojiepermana-angular-theme-layout-services.d.ts +119 -124
- package/types/ojiepermana-angular-theme-layout-types.d.ts +27 -31
- package/types/ojiepermana-angular-theme-layout-wrapper.d.ts +399 -187
- package/types/ojiepermana-angular-theme-layout.d.ts +201 -112
- package/types/ojiepermana-angular-theme-page-core.d.ts +136 -142
- package/types/ojiepermana-angular-theme-page-filter.d.ts +112 -62
- package/types/ojiepermana-angular-theme-page-overview.d.ts +28 -0
- package/types/ojiepermana-angular-theme-page-root.d.ts +172 -88
- package/types/ojiepermana-angular-theme-page-side.d.ts +89 -49
- package/types/ojiepermana-angular-theme-page-slots.d.ts +58 -37
- package/types/ojiepermana-angular-theme-page.d.ts +7 -5
- package/types/ojiepermana-angular-theme-shell-services.d.ts +119 -125
- package/types/ojiepermana-angular-theme-shell-types.d.ts +38 -41
- package/types/ojiepermana-angular-theme-shell.d.ts +139 -61
- package/types/ojiepermana-angular-theme-styles.d.ts +184 -196
- package/types/ojiepermana-angular-theme.d.ts +1 -2
- package/types/ojiepermana-angular.d.ts +5 -5
- package/fesm2022/ojiepermana-angular-navigation-navigation-badge-count.component-CDBxQ8rk.mjs +0 -91
- package/fesm2022/ojiepermana-angular-navigation-navigation-dockbar-menu.component-DBQHdvGa.mjs +0 -512
- package/fesm2022/ojiepermana-angular-navigation-navigation-flyout-menu.component-BCGvhoYj.mjs +0 -404
- package/fesm2022/ojiepermana-angular-navigation-navigation-horizontal.component-Dk_03e-6.mjs +0 -466
- package/fesm2022/ojiepermana-angular-navigation-ojiepermana-angular-navigation-DNKU6viC.mjs +0 -2642
|
@@ -1,331 +1,434 @@
|
|
|
1
|
-
import * as i0 from
|
|
2
|
-
import {
|
|
3
|
-
import { cn } from
|
|
4
|
-
import { DOCUMENT } from
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
class
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { Component, DestroyRef, ElementRef, booleanAttribute, computed, effect, inject, input, numberAttribute, output, signal, untracked, viewChild } from "@angular/core";
|
|
3
|
+
import { cn } from "@ojiepermana/angular/component/utils/core";
|
|
4
|
+
import { DOCUMENT } from "@angular/common";
|
|
5
|
+
var SliderComponent = class SliderComponent {
|
|
6
|
+
el = inject(ElementRef);
|
|
7
|
+
class = input("", ...ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []);
|
|
8
|
+
classes = computed(() => cn("Slider relative w-full appearance-none bg-transparent", "focus-visible:outline-none", "disabled:pointer-events-none disabled:opacity-50", this.class()), ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
|
|
9
|
+
focus() {
|
|
10
|
+
this.el.nativeElement.focus();
|
|
11
|
+
}
|
|
12
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
13
|
+
minVersion: "12.0.0",
|
|
14
|
+
version: "22.2.0",
|
|
15
|
+
ngImport: i0,
|
|
16
|
+
type: SliderComponent,
|
|
17
|
+
deps: [],
|
|
18
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
19
|
+
});
|
|
20
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
21
|
+
minVersion: "17.1.0",
|
|
22
|
+
version: "22.2.0",
|
|
23
|
+
type: SliderComponent,
|
|
24
|
+
isStandalone: true,
|
|
25
|
+
selector: "input[type=range][Slider]",
|
|
26
|
+
inputs: { class: {
|
|
27
|
+
classPropertyName: "class",
|
|
28
|
+
publicName: "class",
|
|
29
|
+
isSignal: true,
|
|
30
|
+
isRequired: false,
|
|
31
|
+
transformFunction: null
|
|
32
|
+
} },
|
|
33
|
+
host: { properties: { "class": "classes()" } },
|
|
34
|
+
ngImport: i0,
|
|
35
|
+
template: "",
|
|
36
|
+
isInline: true,
|
|
37
|
+
styles: [":host.Slider{height:calc(var(--spacing-base) * 5);cursor:pointer}:host.Slider::-webkit-slider-runnable-track{height:calc(var(--spacing-base) * 2);border-radius:var(--radius-lg);background:hsl(var(--secondary))}:host.Slider::-moz-range-track{height:calc(var(--spacing-base) * 2);border-radius:var(--radius-lg);background:hsl(var(--secondary))}:host.Slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;margin-top:calc(var(--spacing-base) * -1);width:calc(var(--spacing-base) * 4);height:calc(var(--spacing-base) * 4);border-radius:var(--radius-lg);background:hsl(var(--background));border:var(--border-width) solid hsl(var(--primary));transition:box-shadow .15s cubic-bezier(.4,0,.2,1)}:host.Slider::-moz-range-thumb{width:calc(var(--spacing-base) * 4);height:calc(var(--spacing-base) * 4);border-radius:var(--radius-lg);background:hsl(var(--background));border:var(--border-width) solid hsl(var(--primary));transition:box-shadow .15s cubic-bezier(.4,0,.2,1)}:host.Slider:focus-visible::-webkit-slider-thumb{box-shadow:0 0 0 calc(var(--border-width) + 3px) hsl(var(--ring) / .3)}:host.Slider:focus-visible::-moz-range-thumb{box-shadow:0 0 0 calc(var(--border-width) + 3px) hsl(var(--ring) / .3)}:host.Slider:disabled::-webkit-slider-thumb{cursor:not-allowed}:host.Slider:disabled::-moz-range-thumb{cursor:not-allowed}\n"]
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
41
|
+
minVersion: "12.0.0",
|
|
42
|
+
version: "22.2.0",
|
|
43
|
+
ngImport: i0,
|
|
44
|
+
type: SliderComponent,
|
|
45
|
+
decorators: [{
|
|
46
|
+
type: Component,
|
|
47
|
+
args: [{
|
|
48
|
+
selector: "input[type=range][Slider]",
|
|
49
|
+
host: { "[class]": "classes()" },
|
|
50
|
+
template: "",
|
|
51
|
+
styles: [":host.Slider{height:calc(var(--spacing-base) * 5);cursor:pointer}:host.Slider::-webkit-slider-runnable-track{height:calc(var(--spacing-base) * 2);border-radius:var(--radius-lg);background:hsl(var(--secondary))}:host.Slider::-moz-range-track{height:calc(var(--spacing-base) * 2);border-radius:var(--radius-lg);background:hsl(var(--secondary))}:host.Slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;margin-top:calc(var(--spacing-base) * -1);width:calc(var(--spacing-base) * 4);height:calc(var(--spacing-base) * 4);border-radius:var(--radius-lg);background:hsl(var(--background));border:var(--border-width) solid hsl(var(--primary));transition:box-shadow .15s cubic-bezier(.4,0,.2,1)}:host.Slider::-moz-range-thumb{width:calc(var(--spacing-base) * 4);height:calc(var(--spacing-base) * 4);border-radius:var(--radius-lg);background:hsl(var(--background));border:var(--border-width) solid hsl(var(--primary));transition:box-shadow .15s cubic-bezier(.4,0,.2,1)}:host.Slider:focus-visible::-webkit-slider-thumb{box-shadow:0 0 0 calc(var(--border-width) + 3px) hsl(var(--ring) / .3)}:host.Slider:focus-visible::-moz-range-thumb{box-shadow:0 0 0 calc(var(--border-width) + 3px) hsl(var(--ring) / .3)}:host.Slider:disabled::-webkit-slider-thumb{cursor:not-allowed}:host.Slider:disabled::-moz-range-thumb{cursor:not-allowed}\n"]
|
|
52
|
+
}]
|
|
53
|
+
}],
|
|
54
|
+
propDecorators: { class: [{
|
|
55
|
+
type: i0.Input,
|
|
56
|
+
args: [{
|
|
57
|
+
isSignal: true,
|
|
58
|
+
alias: "class",
|
|
59
|
+
required: false
|
|
60
|
+
}]
|
|
61
|
+
}] }
|
|
62
|
+
});
|
|
63
|
+
var SliderRootComponent = class SliderRootComponent {
|
|
64
|
+
host = inject(ElementRef);
|
|
65
|
+
document = inject(DOCUMENT);
|
|
66
|
+
destroyRef = inject(DestroyRef);
|
|
67
|
+
track = viewChild.required("track", ...ngDevMode ? [{ debugName: "track" }] : /* istanbul ignore next */ []);
|
|
68
|
+
value = input([0], ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
|
|
69
|
+
min = input(0, {
|
|
70
|
+
...ngDevMode ? { debugName: "min" } : /* istanbul ignore next */ {},
|
|
71
|
+
transform: numberAttribute
|
|
72
|
+
});
|
|
73
|
+
max = input(100, {
|
|
74
|
+
...ngDevMode ? { debugName: "max" } : /* istanbul ignore next */ {},
|
|
75
|
+
transform: numberAttribute
|
|
76
|
+
});
|
|
77
|
+
step = input(1, {
|
|
78
|
+
...ngDevMode ? { debugName: "step" } : /* istanbul ignore next */ {},
|
|
79
|
+
transform: numberAttribute
|
|
80
|
+
});
|
|
81
|
+
minStepsBetweenThumbs = input(0, {
|
|
82
|
+
...ngDevMode ? { debugName: "minStepsBetweenThumbs" } : /* istanbul ignore next */ {},
|
|
83
|
+
transform: numberAttribute
|
|
84
|
+
});
|
|
85
|
+
orientation = input("horizontal", ...ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []);
|
|
86
|
+
disabled = input(false, {
|
|
87
|
+
...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
|
|
88
|
+
transform: booleanAttribute
|
|
89
|
+
});
|
|
90
|
+
thumbLabels = input(null, ...ngDevMode ? [{ debugName: "thumbLabels" }] : /* istanbul ignore next */ []);
|
|
91
|
+
ariaLabel = input(null, {
|
|
92
|
+
...ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {},
|
|
93
|
+
alias: "aria-label"
|
|
94
|
+
});
|
|
95
|
+
ariaDescribedby = input(null, {
|
|
96
|
+
...ngDevMode ? { debugName: "ariaDescribedby" } : /* istanbul ignore next */ {},
|
|
97
|
+
alias: "aria-describedby"
|
|
98
|
+
});
|
|
99
|
+
ariaLabelledby = input(null, {
|
|
100
|
+
...ngDevMode ? { debugName: "ariaLabelledby" } : /* istanbul ignore next */ {},
|
|
101
|
+
alias: "aria-labelledby"
|
|
102
|
+
});
|
|
103
|
+
class = input("", ...ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []);
|
|
104
|
+
valueChange = output();
|
|
105
|
+
valueState = signal([0], ...ngDevMode ? [{ debugName: "valueState" }] : /* istanbul ignore next */ []);
|
|
106
|
+
activeThumbIndex = signal(0, ...ngDevMode ? [{ debugName: "activeThumbIndex" }] : /* istanbul ignore next */ []);
|
|
107
|
+
draggedThumbIndex = signal(null, ...ngDevMode ? [{ debugName: "draggedThumbIndex" }] : /* istanbul ignore next */ []);
|
|
108
|
+
pointerId = signal(null, ...ngDevMode ? [{ debugName: "pointerId" }] : /* istanbul ignore next */ []);
|
|
109
|
+
detachDragListeners = null;
|
|
110
|
+
config = computed(() => ({
|
|
111
|
+
min: Math.min(this.min(), this.max()),
|
|
112
|
+
max: Math.max(this.min(), this.max()),
|
|
113
|
+
step: this.step() > 0 ? this.step() : 1,
|
|
114
|
+
minStepsBetweenThumbs: Math.max(0, Math.floor(this.minStepsBetweenThumbs()))
|
|
115
|
+
}), ...ngDevMode ? [{ debugName: "config" }] : /* istanbul ignore next */ []);
|
|
116
|
+
hostClasses = computed(() => cn("slider-root relative flex touch-none select-none", this.orientation() === "horizontal" ? "h-5 w-full items-center" : "h-32 w-5 justify-center", this.disabled() ? "opacity-50" : "", this.class()), ...ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []);
|
|
117
|
+
thumbs = computed(() => {
|
|
118
|
+
const values = this.valueState();
|
|
119
|
+
const config = this.config();
|
|
120
|
+
return values.map((value, index) => {
|
|
121
|
+
const bounds = thumbBounds(values, index, config);
|
|
122
|
+
return {
|
|
123
|
+
index,
|
|
124
|
+
value,
|
|
125
|
+
position: this.positionPercent(value),
|
|
126
|
+
min: bounds.min,
|
|
127
|
+
max: bounds.max,
|
|
128
|
+
label: this.thumbLabel(index, values.length)
|
|
129
|
+
};
|
|
130
|
+
});
|
|
131
|
+
}, ...ngDevMode ? [{ debugName: "thumbs" }] : /* istanbul ignore next */ []);
|
|
132
|
+
rangeOffset = computed(() => {
|
|
133
|
+
return this.rangeSpan().start;
|
|
134
|
+
}, ...ngDevMode ? [{ debugName: "rangeOffset" }] : /* istanbul ignore next */ []);
|
|
135
|
+
rangeSize = computed(() => {
|
|
136
|
+
const span = this.rangeSpan();
|
|
137
|
+
return span.end - span.start;
|
|
138
|
+
}, ...ngDevMode ? [{ debugName: "rangeSize" }] : /* istanbul ignore next */ []);
|
|
139
|
+
syncExternalValue = effect(() => {
|
|
140
|
+
const normalized = normalizeSliderValues(this.value(), this.config());
|
|
141
|
+
untracked(() => {
|
|
142
|
+
if (!sameValues(normalized, this.valueState())) this.valueState.set(normalized);
|
|
143
|
+
this.activeThumbIndex.set(clampIndex(this.activeThumbIndex(), normalized.length));
|
|
144
|
+
});
|
|
145
|
+
}, ...ngDevMode ? [{ debugName: "syncExternalValue" }] : /* istanbul ignore next */ []);
|
|
146
|
+
constructor() {
|
|
147
|
+
this.destroyRef.onDestroy(() => this.endDrag());
|
|
148
|
+
}
|
|
149
|
+
onTrackPointerDown(event) {
|
|
150
|
+
if (this.disabled() || event.button !== 0) return;
|
|
151
|
+
event.preventDefault();
|
|
152
|
+
const nextValue = this.valueFromPointer(event);
|
|
153
|
+
if (nextValue == null) return;
|
|
154
|
+
const thumbIndex = this.closestThumbIndex(nextValue);
|
|
155
|
+
this.activeThumbIndex.set(thumbIndex);
|
|
156
|
+
this.updateThumbValue(thumbIndex, nextValue);
|
|
157
|
+
this.beginDrag(event, thumbIndex);
|
|
158
|
+
}
|
|
159
|
+
onThumbPointerDown(event, index) {
|
|
160
|
+
if (this.disabled() || event.button !== 0) return;
|
|
161
|
+
event.preventDefault();
|
|
162
|
+
event.stopPropagation();
|
|
163
|
+
this.activeThumbIndex.set(index);
|
|
164
|
+
this.beginDrag(event, index);
|
|
165
|
+
}
|
|
166
|
+
onThumbFocus(index) {
|
|
167
|
+
this.activeThumbIndex.set(index);
|
|
168
|
+
}
|
|
169
|
+
onThumbKeydown(event, index) {
|
|
170
|
+
if (this.disabled()) return;
|
|
171
|
+
const current = this.valueState()[index];
|
|
172
|
+
const config = this.config();
|
|
173
|
+
const pageStep = config.step * 10;
|
|
174
|
+
const direction = this.resolvedDirection();
|
|
175
|
+
let nextValue = null;
|
|
176
|
+
switch (event.key) {
|
|
177
|
+
case "ArrowRight":
|
|
178
|
+
nextValue = current + (direction === "rtl" && this.orientation() === "horizontal" ? -config.step : config.step);
|
|
179
|
+
break;
|
|
180
|
+
case "ArrowLeft":
|
|
181
|
+
nextValue = current + (direction === "rtl" && this.orientation() === "horizontal" ? config.step : -config.step);
|
|
182
|
+
break;
|
|
183
|
+
case "ArrowUp":
|
|
184
|
+
nextValue = current + config.step;
|
|
185
|
+
break;
|
|
186
|
+
case "ArrowDown":
|
|
187
|
+
nextValue = current - config.step;
|
|
188
|
+
break;
|
|
189
|
+
case "PageUp":
|
|
190
|
+
nextValue = current + pageStep;
|
|
191
|
+
break;
|
|
192
|
+
case "PageDown":
|
|
193
|
+
nextValue = current - pageStep;
|
|
194
|
+
break;
|
|
195
|
+
case "Home":
|
|
196
|
+
nextValue = thumbBounds(this.valueState(), index, config).min;
|
|
197
|
+
break;
|
|
198
|
+
case "End":
|
|
199
|
+
nextValue = thumbBounds(this.valueState(), index, config).max;
|
|
200
|
+
break;
|
|
201
|
+
default: return;
|
|
202
|
+
}
|
|
203
|
+
event.preventDefault();
|
|
204
|
+
this.activeThumbIndex.set(index);
|
|
205
|
+
this.updateThumbValue(index, nextValue);
|
|
206
|
+
}
|
|
207
|
+
beginDrag(event, index) {
|
|
208
|
+
this.endDrag();
|
|
209
|
+
this.pointerId.set(event.pointerId);
|
|
210
|
+
this.draggedThumbIndex.set(index);
|
|
211
|
+
this.host.nativeElement.setPointerCapture(event.pointerId);
|
|
212
|
+
const move = (next) => this.onDragMove(next);
|
|
213
|
+
const end = (next) => this.endDrag(next);
|
|
214
|
+
this.document.addEventListener("pointermove", move);
|
|
215
|
+
this.document.addEventListener("pointerup", end);
|
|
216
|
+
this.document.addEventListener("pointercancel", end);
|
|
217
|
+
this.detachDragListeners = () => {
|
|
218
|
+
this.document.removeEventListener("pointermove", move);
|
|
219
|
+
this.document.removeEventListener("pointerup", end);
|
|
220
|
+
this.document.removeEventListener("pointercancel", end);
|
|
221
|
+
this.detachDragListeners = null;
|
|
222
|
+
};
|
|
223
|
+
this.focusThumb(index);
|
|
224
|
+
}
|
|
225
|
+
onDragMove(event) {
|
|
226
|
+
if (this.pointerId() !== event.pointerId) return;
|
|
227
|
+
const thumbIndex = this.draggedThumbIndex();
|
|
228
|
+
if (thumbIndex == null) return;
|
|
229
|
+
const nextValue = this.valueFromPointer(event);
|
|
230
|
+
if (nextValue == null) return;
|
|
231
|
+
event.preventDefault();
|
|
232
|
+
this.updateThumbValue(thumbIndex, nextValue);
|
|
233
|
+
}
|
|
234
|
+
endDrag(event) {
|
|
235
|
+
const pointerId = event ? event.pointerId : this.pointerId();
|
|
236
|
+
if (pointerId == null || event && this.pointerId() !== pointerId) return;
|
|
237
|
+
const host = this.host.nativeElement;
|
|
238
|
+
if (host.hasPointerCapture(pointerId)) host.releasePointerCapture(pointerId);
|
|
239
|
+
this.detachDragListeners?.();
|
|
240
|
+
this.draggedThumbIndex.set(null);
|
|
241
|
+
this.pointerId.set(null);
|
|
242
|
+
}
|
|
243
|
+
updateThumbValue(index, rawValue) {
|
|
244
|
+
const current = this.valueState();
|
|
245
|
+
const bounds = thumbBounds(current, index, this.config());
|
|
246
|
+
const nextValues = current.slice();
|
|
247
|
+
nextValues[index] = snapWithinBounds(rawValue, bounds.min, bounds.max, this.config());
|
|
248
|
+
if (sameValues(nextValues, current)) return;
|
|
249
|
+
this.valueState.set(nextValues);
|
|
250
|
+
this.valueChange.emit(nextValues);
|
|
251
|
+
}
|
|
252
|
+
valueFromPointer(event) {
|
|
253
|
+
const rect = this.track().nativeElement.getBoundingClientRect();
|
|
254
|
+
const config = this.config();
|
|
255
|
+
if (rect.width <= 0 || rect.height <= 0) return null;
|
|
256
|
+
let ratio = 0;
|
|
257
|
+
if (this.orientation() === "horizontal") {
|
|
258
|
+
const physicalRatio = clamp((event.clientX - rect.left) / rect.width, 0, 1);
|
|
259
|
+
ratio = this.resolvedDirection() === "rtl" ? 1 - physicalRatio : physicalRatio;
|
|
260
|
+
} else ratio = clamp((rect.bottom - event.clientY) / rect.height, 0, 1);
|
|
261
|
+
return config.min + ratio * (config.max - config.min);
|
|
262
|
+
}
|
|
263
|
+
closestThumbIndex(nextValue) {
|
|
264
|
+
const values = this.valueState();
|
|
265
|
+
let bestIndex = 0;
|
|
266
|
+
let bestDistance = Number.POSITIVE_INFINITY;
|
|
267
|
+
values.forEach((value, index) => {
|
|
268
|
+
const distance = Math.abs(value - nextValue);
|
|
269
|
+
if (distance < bestDistance) {
|
|
270
|
+
bestDistance = distance;
|
|
271
|
+
bestIndex = index;
|
|
272
|
+
}
|
|
273
|
+
});
|
|
274
|
+
return bestIndex;
|
|
275
|
+
}
|
|
276
|
+
rangeSpan() {
|
|
277
|
+
const positions = this.valueState().map((value) => this.positionPercent(value));
|
|
278
|
+
if (!positions.length) return {
|
|
279
|
+
start: 0,
|
|
280
|
+
end: 0
|
|
281
|
+
};
|
|
282
|
+
if (positions.length === 1) {
|
|
283
|
+
const minBoundary = this.positionPercent(this.config().min);
|
|
284
|
+
return {
|
|
285
|
+
start: Math.min(minBoundary, positions[0]),
|
|
286
|
+
end: Math.max(minBoundary, positions[0])
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
return {
|
|
290
|
+
start: Math.min(...positions),
|
|
291
|
+
end: Math.max(...positions)
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
positionPercent(value) {
|
|
295
|
+
const config = this.config();
|
|
296
|
+
const range = config.max - config.min;
|
|
297
|
+
if (range <= 0) return this.orientation() === "horizontal" && this.resolvedDirection() === "rtl" ? 100 : 0;
|
|
298
|
+
const logicalRatio = (value - config.min) / range;
|
|
299
|
+
return clamp((this.orientation() === "horizontal" && this.resolvedDirection() === "rtl" ? 1 - logicalRatio : logicalRatio) * 100, 0, 100);
|
|
300
|
+
}
|
|
301
|
+
thumbLabel(index, count) {
|
|
302
|
+
const labels = this.thumbLabels();
|
|
303
|
+
if (labels?.[index]) return labels[index] ?? null;
|
|
304
|
+
if (count === 1) return this.ariaLabel();
|
|
305
|
+
return this.ariaLabel() ? `${this.ariaLabel()} ${index + 1}` : `Slider thumb ${index + 1}`;
|
|
306
|
+
}
|
|
307
|
+
focusThumb(index) {
|
|
308
|
+
this.host.nativeElement.querySelector(`.slider__thumb[data-index="${index}"]`)?.focus();
|
|
309
|
+
}
|
|
310
|
+
resolvedDirection() {
|
|
311
|
+
const host = this.host.nativeElement;
|
|
312
|
+
if (host.dir === "ltr" || host.dir === "rtl") return host.dir;
|
|
313
|
+
const view = this.document.defaultView;
|
|
314
|
+
if (!view) return "ltr";
|
|
315
|
+
return view.getComputedStyle(host).direction === "rtl" ? "rtl" : "ltr";
|
|
316
|
+
}
|
|
317
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
318
|
+
minVersion: "12.0.0",
|
|
319
|
+
version: "22.2.0",
|
|
320
|
+
ngImport: i0,
|
|
321
|
+
type: SliderRootComponent,
|
|
322
|
+
deps: [],
|
|
323
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
324
|
+
});
|
|
325
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
326
|
+
minVersion: "17.0.0",
|
|
327
|
+
version: "22.2.0",
|
|
328
|
+
type: SliderRootComponent,
|
|
329
|
+
isStandalone: true,
|
|
330
|
+
selector: "Slider",
|
|
331
|
+
inputs: {
|
|
332
|
+
value: {
|
|
333
|
+
classPropertyName: "value",
|
|
334
|
+
publicName: "value",
|
|
335
|
+
isSignal: true,
|
|
336
|
+
isRequired: false,
|
|
337
|
+
transformFunction: null
|
|
338
|
+
},
|
|
339
|
+
min: {
|
|
340
|
+
classPropertyName: "min",
|
|
341
|
+
publicName: "min",
|
|
342
|
+
isSignal: true,
|
|
343
|
+
isRequired: false,
|
|
344
|
+
transformFunction: null
|
|
345
|
+
},
|
|
346
|
+
max: {
|
|
347
|
+
classPropertyName: "max",
|
|
348
|
+
publicName: "max",
|
|
349
|
+
isSignal: true,
|
|
350
|
+
isRequired: false,
|
|
351
|
+
transformFunction: null
|
|
352
|
+
},
|
|
353
|
+
step: {
|
|
354
|
+
classPropertyName: "step",
|
|
355
|
+
publicName: "step",
|
|
356
|
+
isSignal: true,
|
|
357
|
+
isRequired: false,
|
|
358
|
+
transformFunction: null
|
|
359
|
+
},
|
|
360
|
+
minStepsBetweenThumbs: {
|
|
361
|
+
classPropertyName: "minStepsBetweenThumbs",
|
|
362
|
+
publicName: "minStepsBetweenThumbs",
|
|
363
|
+
isSignal: true,
|
|
364
|
+
isRequired: false,
|
|
365
|
+
transformFunction: null
|
|
366
|
+
},
|
|
367
|
+
orientation: {
|
|
368
|
+
classPropertyName: "orientation",
|
|
369
|
+
publicName: "orientation",
|
|
370
|
+
isSignal: true,
|
|
371
|
+
isRequired: false,
|
|
372
|
+
transformFunction: null
|
|
373
|
+
},
|
|
374
|
+
disabled: {
|
|
375
|
+
classPropertyName: "disabled",
|
|
376
|
+
publicName: "disabled",
|
|
377
|
+
isSignal: true,
|
|
378
|
+
isRequired: false,
|
|
379
|
+
transformFunction: null
|
|
380
|
+
},
|
|
381
|
+
thumbLabels: {
|
|
382
|
+
classPropertyName: "thumbLabels",
|
|
383
|
+
publicName: "thumbLabels",
|
|
384
|
+
isSignal: true,
|
|
385
|
+
isRequired: false,
|
|
386
|
+
transformFunction: null
|
|
387
|
+
},
|
|
388
|
+
ariaLabel: {
|
|
389
|
+
classPropertyName: "ariaLabel",
|
|
390
|
+
publicName: "aria-label",
|
|
391
|
+
isSignal: true,
|
|
392
|
+
isRequired: false,
|
|
393
|
+
transformFunction: null
|
|
394
|
+
},
|
|
395
|
+
ariaDescribedby: {
|
|
396
|
+
classPropertyName: "ariaDescribedby",
|
|
397
|
+
publicName: "aria-describedby",
|
|
398
|
+
isSignal: true,
|
|
399
|
+
isRequired: false,
|
|
400
|
+
transformFunction: null
|
|
401
|
+
},
|
|
402
|
+
ariaLabelledby: {
|
|
403
|
+
classPropertyName: "ariaLabelledby",
|
|
404
|
+
publicName: "aria-labelledby",
|
|
405
|
+
isSignal: true,
|
|
406
|
+
isRequired: false,
|
|
407
|
+
transformFunction: null
|
|
408
|
+
},
|
|
409
|
+
class: {
|
|
410
|
+
classPropertyName: "class",
|
|
411
|
+
publicName: "class",
|
|
412
|
+
isSignal: true,
|
|
413
|
+
isRequired: false,
|
|
414
|
+
transformFunction: null
|
|
415
|
+
}
|
|
416
|
+
},
|
|
417
|
+
outputs: { valueChange: "valueChange" },
|
|
418
|
+
host: { properties: {
|
|
419
|
+
"class": "hostClasses()",
|
|
420
|
+
"attr.data-disabled": "disabled() ? \"\" : null",
|
|
421
|
+
"attr.data-orientation": "orientation()"
|
|
422
|
+
} },
|
|
423
|
+
viewQueries: [{
|
|
424
|
+
propertyName: "track",
|
|
425
|
+
first: true,
|
|
426
|
+
predicate: ["track"],
|
|
427
|
+
descendants: true,
|
|
428
|
+
isSignal: true
|
|
429
|
+
}],
|
|
430
|
+
ngImport: i0,
|
|
431
|
+
template: `
|
|
329
432
|
<div #track class="slider__track" (pointerdown)="onTrackPointerDown($event)">
|
|
330
433
|
<div
|
|
331
434
|
class="slider__range"
|
|
@@ -360,15 +463,26 @@ class SliderRootComponent {
|
|
|
360
463
|
></button>
|
|
361
464
|
}
|
|
362
465
|
</div>
|
|
363
|
-
`,
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
466
|
+
`,
|
|
467
|
+
isInline: true,
|
|
468
|
+
styles: [":host.slider-root{--slider-thumb-size: 1rem;--slider-track-size: .5rem;display:block}.slider__track{position:relative;flex:1 1 auto;border-radius:9999px;background:hsl(var(--secondary))}:host[data-orientation=horizontal] .slider__track{height:var(--slider-track-size);width:100%}:host[data-orientation=vertical] .slider__track{height:100%;width:var(--slider-track-size)}.slider__range{position:absolute;border-radius:inherit;background:hsl(var(--primary))}:host[data-orientation=horizontal] .slider__range{top:0;height:100%}:host[data-orientation=vertical] .slider__range{left:0;width:100%}.slider__thumb{position:absolute;height:var(--slider-thumb-size);width:var(--slider-thumb-size);border:var(--border-width) solid hsl(var(--primary));border-radius:9999px;background:hsl(var(--background));box-shadow:0 1px 2px hsl(var(--foreground) / .14);transition:box-shadow .15s cubic-bezier(.4,0,.2,1),border-color .15s cubic-bezier(.4,0,.2,1),background-color .15s cubic-bezier(.4,0,.2,1)}:host[data-orientation=horizontal] .slider__thumb{transform:translate(-50%,-50%)}:host[data-orientation=vertical] .slider__thumb{transform:translate(-50%,50%)}.slider__thumb:focus-visible{outline:none;box-shadow:0 0 0 calc(var(--border-width) + 3px) hsl(var(--ring) / .3)}:host[data-disabled] .slider__track,:host[data-disabled] .slider__thumb{cursor:not-allowed}\n"]
|
|
469
|
+
});
|
|
470
|
+
};
|
|
471
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
472
|
+
minVersion: "12.0.0",
|
|
473
|
+
version: "22.2.0",
|
|
474
|
+
ngImport: i0,
|
|
475
|
+
type: SliderRootComponent,
|
|
476
|
+
decorators: [{
|
|
477
|
+
type: Component,
|
|
478
|
+
args: [{
|
|
479
|
+
selector: "Slider",
|
|
480
|
+
host: {
|
|
481
|
+
"[class]": "hostClasses()",
|
|
482
|
+
"[attr.data-disabled]": "disabled() ? \"\" : null",
|
|
483
|
+
"[attr.data-orientation]": "orientation()"
|
|
484
|
+
},
|
|
485
|
+
template: `
|
|
372
486
|
<div #track class="slider__track" (pointerdown)="onTrackPointerDown($event)">
|
|
373
487
|
<div
|
|
374
488
|
class="slider__range"
|
|
@@ -403,58 +517,160 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImpor
|
|
|
403
517
|
></button>
|
|
404
518
|
}
|
|
405
519
|
</div>
|
|
406
|
-
`,
|
|
407
|
-
|
|
520
|
+
`,
|
|
521
|
+
styles: [":host.slider-root{--slider-thumb-size: 1rem;--slider-track-size: .5rem;display:block}.slider__track{position:relative;flex:1 1 auto;border-radius:9999px;background:hsl(var(--secondary))}:host[data-orientation=horizontal] .slider__track{height:var(--slider-track-size);width:100%}:host[data-orientation=vertical] .slider__track{height:100%;width:var(--slider-track-size)}.slider__range{position:absolute;border-radius:inherit;background:hsl(var(--primary))}:host[data-orientation=horizontal] .slider__range{top:0;height:100%}:host[data-orientation=vertical] .slider__range{left:0;width:100%}.slider__thumb{position:absolute;height:var(--slider-thumb-size);width:var(--slider-thumb-size);border:var(--border-width) solid hsl(var(--primary));border-radius:9999px;background:hsl(var(--background));box-shadow:0 1px 2px hsl(var(--foreground) / .14);transition:box-shadow .15s cubic-bezier(.4,0,.2,1),border-color .15s cubic-bezier(.4,0,.2,1),background-color .15s cubic-bezier(.4,0,.2,1)}:host[data-orientation=horizontal] .slider__thumb{transform:translate(-50%,-50%)}:host[data-orientation=vertical] .slider__thumb{transform:translate(-50%,50%)}.slider__thumb:focus-visible{outline:none;box-shadow:0 0 0 calc(var(--border-width) + 3px) hsl(var(--ring) / .3)}:host[data-disabled] .slider__track,:host[data-disabled] .slider__thumb{cursor:not-allowed}\n"]
|
|
522
|
+
}]
|
|
523
|
+
}],
|
|
524
|
+
ctorParameters: () => [],
|
|
525
|
+
propDecorators: {
|
|
526
|
+
track: [{
|
|
527
|
+
type: i0.ViewChild,
|
|
528
|
+
args: ["track", { isSignal: true }]
|
|
529
|
+
}],
|
|
530
|
+
value: [{
|
|
531
|
+
type: i0.Input,
|
|
532
|
+
args: [{
|
|
533
|
+
isSignal: true,
|
|
534
|
+
alias: "value",
|
|
535
|
+
required: false
|
|
536
|
+
}]
|
|
537
|
+
}],
|
|
538
|
+
min: [{
|
|
539
|
+
type: i0.Input,
|
|
540
|
+
args: [{
|
|
541
|
+
isSignal: true,
|
|
542
|
+
alias: "min",
|
|
543
|
+
required: false
|
|
544
|
+
}]
|
|
545
|
+
}],
|
|
546
|
+
max: [{
|
|
547
|
+
type: i0.Input,
|
|
548
|
+
args: [{
|
|
549
|
+
isSignal: true,
|
|
550
|
+
alias: "max",
|
|
551
|
+
required: false
|
|
552
|
+
}]
|
|
553
|
+
}],
|
|
554
|
+
step: [{
|
|
555
|
+
type: i0.Input,
|
|
556
|
+
args: [{
|
|
557
|
+
isSignal: true,
|
|
558
|
+
alias: "step",
|
|
559
|
+
required: false
|
|
560
|
+
}]
|
|
561
|
+
}],
|
|
562
|
+
minStepsBetweenThumbs: [{
|
|
563
|
+
type: i0.Input,
|
|
564
|
+
args: [{
|
|
565
|
+
isSignal: true,
|
|
566
|
+
alias: "minStepsBetweenThumbs",
|
|
567
|
+
required: false
|
|
568
|
+
}]
|
|
569
|
+
}],
|
|
570
|
+
orientation: [{
|
|
571
|
+
type: i0.Input,
|
|
572
|
+
args: [{
|
|
573
|
+
isSignal: true,
|
|
574
|
+
alias: "orientation",
|
|
575
|
+
required: false
|
|
576
|
+
}]
|
|
577
|
+
}],
|
|
578
|
+
disabled: [{
|
|
579
|
+
type: i0.Input,
|
|
580
|
+
args: [{
|
|
581
|
+
isSignal: true,
|
|
582
|
+
alias: "disabled",
|
|
583
|
+
required: false
|
|
584
|
+
}]
|
|
585
|
+
}],
|
|
586
|
+
thumbLabels: [{
|
|
587
|
+
type: i0.Input,
|
|
588
|
+
args: [{
|
|
589
|
+
isSignal: true,
|
|
590
|
+
alias: "thumbLabels",
|
|
591
|
+
required: false
|
|
592
|
+
}]
|
|
593
|
+
}],
|
|
594
|
+
ariaLabel: [{
|
|
595
|
+
type: i0.Input,
|
|
596
|
+
args: [{
|
|
597
|
+
isSignal: true,
|
|
598
|
+
alias: "aria-label",
|
|
599
|
+
required: false
|
|
600
|
+
}]
|
|
601
|
+
}],
|
|
602
|
+
ariaDescribedby: [{
|
|
603
|
+
type: i0.Input,
|
|
604
|
+
args: [{
|
|
605
|
+
isSignal: true,
|
|
606
|
+
alias: "aria-describedby",
|
|
607
|
+
required: false
|
|
608
|
+
}]
|
|
609
|
+
}],
|
|
610
|
+
ariaLabelledby: [{
|
|
611
|
+
type: i0.Input,
|
|
612
|
+
args: [{
|
|
613
|
+
isSignal: true,
|
|
614
|
+
alias: "aria-labelledby",
|
|
615
|
+
required: false
|
|
616
|
+
}]
|
|
617
|
+
}],
|
|
618
|
+
class: [{
|
|
619
|
+
type: i0.Input,
|
|
620
|
+
args: [{
|
|
621
|
+
isSignal: true,
|
|
622
|
+
alias: "class",
|
|
623
|
+
required: false
|
|
624
|
+
}]
|
|
625
|
+
}],
|
|
626
|
+
valueChange: [{
|
|
627
|
+
type: i0.Output,
|
|
628
|
+
args: ["valueChange"]
|
|
629
|
+
}]
|
|
630
|
+
}
|
|
631
|
+
});
|
|
408
632
|
function clamp(value, min, max) {
|
|
409
|
-
|
|
633
|
+
return Math.min(Math.max(value, min), max);
|
|
410
634
|
}
|
|
411
635
|
function clampIndex(index, length) {
|
|
412
|
-
|
|
636
|
+
return clamp(index, 0, Math.max(length - 1, 0));
|
|
413
637
|
}
|
|
414
638
|
function decimalPlaces(value) {
|
|
415
|
-
|
|
416
|
-
const fraction = text.split('.')[1];
|
|
417
|
-
return fraction?.length ?? 0;
|
|
639
|
+
return `${value}`.split(".")[1]?.length ?? 0;
|
|
418
640
|
}
|
|
419
641
|
function normalizeSliderValues(values, config) {
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
normalized.push(snapWithinBounds(value, min, max, config));
|
|
431
|
-
});
|
|
432
|
-
return normalized;
|
|
642
|
+
const sorted = (values.length ? [...values] : [config.min]).map((value) => snapToStep(value, config)).sort((left, right) => left - right);
|
|
643
|
+
const gap = config.step * config.minStepsBetweenThumbs;
|
|
644
|
+
const normalized = [];
|
|
645
|
+
sorted.forEach((value, index) => {
|
|
646
|
+
const remaining = sorted.length - index - 1;
|
|
647
|
+
const min = index === 0 ? config.min : normalized[index - 1] + gap;
|
|
648
|
+
const max = Math.max(min, config.max - remaining * gap);
|
|
649
|
+
normalized.push(snapWithinBounds(value, min, max, config));
|
|
650
|
+
});
|
|
651
|
+
return normalized;
|
|
433
652
|
}
|
|
434
653
|
function sameValues(left, right) {
|
|
435
|
-
|
|
654
|
+
return left.length === right.length && left.every((value, index) => value === right[index]);
|
|
436
655
|
}
|
|
437
656
|
function snapToStep(value, config) {
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
657
|
+
const ratio = (value - config.min) / config.step;
|
|
658
|
+
const snapped = config.min + Math.round(ratio) * config.step;
|
|
659
|
+
const precision = Math.max(decimalPlaces(config.step), decimalPlaces(config.min));
|
|
660
|
+
return Number(snapped.toFixed(precision));
|
|
442
661
|
}
|
|
443
662
|
function snapWithinBounds(value, min, max, config) {
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
return clamp(snapped, boundedMin, boundedMax);
|
|
663
|
+
const boundedMin = Math.min(min, max);
|
|
664
|
+
const boundedMax = Math.max(min, max);
|
|
665
|
+
return clamp(snapToStep(value, config), boundedMin, boundedMax);
|
|
448
666
|
}
|
|
449
667
|
function thumbBounds(values, index, config) {
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
668
|
+
const gap = config.step * config.minStepsBetweenThumbs;
|
|
669
|
+
const min = index === 0 ? config.min : values[index - 1] + gap;
|
|
670
|
+
const max = index === values.length - 1 ? config.max : values[index + 1] - gap;
|
|
671
|
+
return {
|
|
672
|
+
min: Math.min(min, max),
|
|
673
|
+
max: Math.max(min, max)
|
|
674
|
+
};
|
|
454
675
|
}
|
|
455
|
-
|
|
456
|
-
/**
|
|
457
|
-
* Generated bundle index. Do not edit.
|
|
458
|
-
*/
|
|
459
|
-
|
|
460
|
-
export { SliderComponent, SliderComponent as SliderInputDirective, SliderRootComponent };
|
|
676
|
+
export { SliderComponent, SliderComponent as SliderInputDirective, SliderRootComponent };
|