@nvidia-elements/core 2.19.0 → 2.20.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/CHANGELOG.md +18 -0
- package/dist/_virtual/_rolldown/runtime.js +17 -0
- package/dist/accordion/accordion2.js +60 -57
- package/dist/accordion/accordion2.js.map +1 -1
- package/dist/alert/alert-group2.js +1 -1
- package/dist/alert/alert2.js +37 -31
- package/dist/alert/alert2.js.map +1 -1
- package/dist/avatar/avatar-group2.js +1 -1
- package/dist/avatar/avatar2.js +1 -1
- package/dist/badge/badge.d.ts +0 -6
- package/dist/badge/badge2.js +31 -36
- package/dist/badge/badge2.js.map +1 -1
- package/dist/breadcrumb/breadcrumb2.js +1 -1
- package/dist/bundle.d.ts +2 -0
- package/dist/bundles/index.d.ts +153 -27
- package/dist/bundles/index.js +9 -9
- package/dist/button/button2.js +1 -1
- package/dist/button-group/button-group2.js +1 -1
- package/dist/card/card2.js +4 -4
- package/dist/chat-message/chat-message2.js +1 -1
- package/dist/checkbox/checkbox-group2.js +1 -1
- package/dist/checkbox/checkbox2.js +1 -1
- package/dist/color/color.d.ts +2 -0
- package/dist/color/color2.js +7 -4
- package/dist/color/color2.js.map +1 -1
- package/dist/combobox/combobox.d.ts +2 -0
- package/dist/combobox/combobox2.js +14 -6
- package/dist/combobox/combobox2.js.map +1 -1
- package/dist/copy-button/copy-button2.js +26 -23
- package/dist/copy-button/copy-button2.js.map +1 -1
- package/dist/custom-elements-jsx.d.ts +166 -4
- package/dist/custom-elements-vue.d.ts +160 -4
- package/dist/custom-elements.json +1239 -220
- package/dist/data.html.json +117 -10
- package/dist/date/date.d.ts +2 -0
- package/dist/date/date2.js +7 -4
- package/dist/date/date2.js.map +1 -1
- package/dist/datetime/datetime.d.ts +2 -0
- package/dist/datetime/datetime2.js +7 -4
- package/dist/datetime/datetime2.js.map +1 -1
- package/dist/dialog/dialog-footer2.js +1 -1
- package/dist/dialog/dialog-header2.js +1 -1
- package/dist/dialog/dialog2.js +27 -27
- package/dist/dialog/dialog2.js.map +1 -1
- package/dist/divider/divider2.js +1 -1
- package/dist/dot/dot2.js +1 -1
- package/dist/drag-handle/drag-handle2.js +1 -1
- package/dist/drawer/drawer-content2.js +1 -1
- package/dist/drawer/drawer-footer2.js +1 -1
- package/dist/drawer/drawer-header2.js +1 -1
- package/dist/drawer/drawer2.js +27 -27
- package/dist/drawer/drawer2.js.map +1 -1
- package/dist/dropdown/dropdown-footer2.js +1 -1
- package/dist/dropdown/dropdown-header2.js +1 -1
- package/dist/dropdown/dropdown2.js +23 -23
- package/dist/dropdown/dropdown2.js.map +1 -1
- package/dist/dropdown-group/dropdown-group.js +1 -1
- package/dist/dropzone/dropzone2.js +28 -22
- package/dist/dropzone/dropzone2.js.map +1 -1
- package/dist/file/file2.js +1 -1
- package/dist/format-bytes/format-bytes2.js +1 -1
- package/dist/format-datetime/format-datetime2.js +1 -1
- package/dist/format-number/format-number2.js +1 -1
- package/dist/format-relative-time/format-relative-time2.js +1 -1
- package/dist/format-truncate/format-truncate2.js +1 -1
- package/dist/forms/control/control.d.ts +3 -0
- package/dist/forms/control/control2.js +34 -31
- package/dist/forms/control/control2.js.map +1 -1
- package/dist/forms/control-group/control-group2.js +1 -1
- package/dist/forms/control-message/control-message2.js +1 -1
- package/dist/gauge/gauge2.js +26 -21
- package/dist/gauge/gauge2.js.map +1 -1
- package/dist/grid/cell/cell2.js +1 -1
- package/dist/grid/column/column2.js +1 -1
- package/dist/grid/footer/footer2.js +1 -1
- package/dist/grid/grid2.js +1 -1
- package/dist/grid/header/header2.js +1 -1
- package/dist/grid/placeholder/placeholder2.js +1 -1
- package/dist/grid/row/row2.js +1 -1
- package/dist/icon/icon2.js +2 -2
- package/dist/icon-button/icon-button2.js +1 -1
- package/dist/iframe/iframe2.js +1 -1
- package/dist/index.js +5 -6
- package/dist/input/input-group2.js +1 -1
- package/dist/input/input2.js +1 -1
- package/dist/internal/index.d.ts +1 -2
- package/dist/internal/index.js +150 -33
- package/dist/internal/index.js.map +1 -0
- package/dist/internal/types/index.d.ts +1 -1
- package/dist/internal/types/index.js.map +1 -1
- package/dist/joystick/define.d.ts +6 -0
- package/dist/joystick/define.js +7 -0
- package/dist/joystick/define.js.map +1 -0
- package/dist/joystick/index.d.ts +1 -0
- package/dist/joystick/index.js +2 -0
- package/dist/joystick/joystick.d.ts +126 -0
- package/dist/joystick/joystick.examples.js +6 -0
- package/dist/joystick/joystick.examples.js.map +1 -0
- package/dist/joystick/joystick.examples.json +107 -0
- package/dist/joystick/joystick.js +6 -0
- package/dist/joystick/joystick.js.map +1 -0
- package/dist/joystick/joystick2.js +347 -0
- package/dist/joystick/joystick2.js.map +1 -0
- package/dist/logo/logo2.js +1 -1
- package/dist/menu/menu-group2.js +1 -1
- package/dist/menu/menu-item2.js +1 -1
- package/dist/menu/menu2.js +1 -1
- package/dist/month/month.d.ts +2 -0
- package/dist/month/month2.js +7 -4
- package/dist/month/month2.js.map +1 -1
- package/dist/notification/notification-group2.js +1 -1
- package/dist/notification/notification2.js +38 -32
- package/dist/notification/notification2.js.map +1 -1
- package/dist/page/page-panel/page-panel-content2.js +1 -1
- package/dist/page/page-panel/page-panel-footer2.js +1 -1
- package/dist/page/page-panel/page-panel-header2.js +1 -1
- package/dist/page/page-panel/page-panel.d.ts +0 -7
- package/dist/page/page-panel/page-panel2.js +18 -20
- package/dist/page/page-panel/page-panel2.js.map +1 -1
- package/dist/page/page2.js +1 -1
- package/dist/page-header/page-header2.js +1 -1
- package/dist/page-loader/page-loader2.js +1 -1
- package/dist/pagination/pagination2.js +45 -38
- package/dist/pagination/pagination2.js.map +1 -1
- package/dist/panel/panel2.js +43 -38
- package/dist/panel/panel2.js.map +1 -1
- package/dist/password/password.d.ts +2 -0
- package/dist/password/password2.js +10 -4
- package/dist/password/password2.js.map +1 -1
- package/dist/preferences-input/preferences-input2.js +32 -27
- package/dist/preferences-input/preferences-input2.js.map +1 -1
- package/dist/progress-bar/progress-bar2.js +1 -1
- package/dist/progress-dot/progress-dot2.js +17 -17
- package/dist/progress-dot/progress-dot2.js.map +1 -1
- package/dist/progress-ring/progress-ring2.js +27 -22
- package/dist/progress-ring/progress-ring2.js.map +1 -1
- package/dist/progressive-filter-chip/progressive-filter-chip2.js +30 -30
- package/dist/progressive-filter-chip/progressive-filter-chip2.js.map +1 -1
- package/dist/pulse/pulse2.js +1 -1
- package/dist/radio/radio-group2.js +1 -1
- package/dist/radio/radio2.js +1 -1
- package/dist/range/range2.js +1 -1
- package/dist/resize-handle/resize-handle2.js +17 -17
- package/dist/resize-handle/resize-handle2.js.map +1 -1
- package/dist/search/search2.js +1 -1
- package/dist/select/select2.js +44 -41
- package/dist/select/select2.js.map +1 -1
- package/dist/skeleton/skeleton2.js +1 -1
- package/dist/sort-button/sort-button2.js +20 -20
- package/dist/sort-button/sort-button2.js.map +1 -1
- package/dist/sparkline/sparkline2.js +1 -1
- package/dist/star-rating/star-rating2.js +1 -1
- package/dist/steps/steps2.js +2 -2
- package/dist/switch/switch-group2.js +1 -1
- package/dist/switch/switch2.js +1 -1
- package/dist/tabs/tabs-group2.js +1 -1
- package/dist/tabs/tabs-item-group2.js +1 -1
- package/dist/tabs/tabs2.js +2 -2
- package/dist/tag/tag2.js +19 -19
- package/dist/tag/tag2.js.map +1 -1
- package/dist/textarea/textarea2.js +1 -1
- package/dist/time/time.d.ts +2 -0
- package/dist/time/time2.js +7 -4
- package/dist/time/time2.js.map +1 -1
- package/dist/toast/toast2.js +35 -29
- package/dist/toast/toast2.js.map +1 -1
- package/dist/toggletip/toggletip-footer2.js +1 -1
- package/dist/toggletip/toggletip-header2.js +1 -1
- package/dist/toggletip/toggletip2.js +25 -25
- package/dist/toggletip/toggletip2.js.map +1 -1
- package/dist/toolbar/toolbar2.js +1 -1
- package/dist/tooltip/tooltip2.js +1 -1
- package/dist/tree/tree-node2.js +45 -45
- package/dist/tree/tree-node2.js.map +1 -1
- package/dist/tree/tree2.js +1 -1
- package/dist/week/week.d.ts +2 -0
- package/dist/week/week2.js +7 -4
- package/dist/week/week2.js.map +1 -1
- package/package.json +14 -2
- package/dist/internal/controllers/i18n.controller.d.ts +0 -19
- package/dist/internal/controllers/i18n.controller.examples.js +0 -6
- package/dist/internal/controllers/i18n.controller.examples.js.map +0 -1
- package/dist/internal/controllers/i18n.controller.examples.json +0 -16
- package/dist/internal/controllers/i18n.controller.js +0 -38
- package/dist/internal/controllers/i18n.controller.js.map +0 -1
- package/dist/internal/services/i18n.service.d.ts +0 -64
- package/dist/internal/services/i18n.service.js +0 -73
- package/dist/internal/services/i18n.service.js.map +0 -1
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
{
|
|
2
|
+
"element": "nve-joystick",
|
|
3
|
+
"entrypoint": "@nvidia-elements/core/joystick/joystick.examples.json",
|
|
4
|
+
"items": [
|
|
5
|
+
{
|
|
6
|
+
"id": "joystick",
|
|
7
|
+
"name": "Default",
|
|
8
|
+
"template": "<nve-joystick aria-label=\"Movement\"></nve-joystick>\n",
|
|
9
|
+
"summary": "Select a direction and intensity with a circular movement region. Release the pointer or arrow keys to return to center.",
|
|
10
|
+
"description": "Both axes use normalized values from -1 to 1. Applications can derive length with Math.hypot(x, y) and angle with Math.atan2(-y, x). This angle uses radians from the rightward direction with counterclockwise positive rotation. Use undefined at neutral. Keep these derived quantities outside the writable value. The angle does not describe the robot's heading.",
|
|
11
|
+
"composition": false,
|
|
12
|
+
"tags": []
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"id": "joystick-size",
|
|
16
|
+
"name": "Size",
|
|
17
|
+
"template": "<div nve-layout=\"row gap:lg align:wrap\">\n <nve-joystick aria-label=\"Small movement\" size=\"sm\"></nve-joystick>\n <nve-joystick aria-label=\"Medium movement\" size=\"md\"></nve-joystick>\n <nve-joystick aria-label=\"Large movement\" size=\"lg\"></nve-joystick>\n</div>\n",
|
|
18
|
+
"summary": "Choose small, medium, or large controls to fit the available space. Each size scales the movement surface and thumb together.",
|
|
19
|
+
"description": "",
|
|
20
|
+
"composition": false,
|
|
21
|
+
"tags": []
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"id": "joystick-opacity",
|
|
25
|
+
"name": "Opacity",
|
|
26
|
+
"template": "<div\n nve-layout=\"row align:center pad:lg\"\n style=\"width: 100%; min-height: 16rem; background: repeating-conic-gradient(var(--nve-sys-layer-container-background) 0% 25%, var(--nve-sys-layer-canvas-background) 0% 50%) center / 2rem 2rem\"\n>\n <nve-joystick aria-label=\"Movement\" opacity></nve-joystick>\n</div>\n",
|
|
27
|
+
"summary": "Overlay a joystick with a translucent background on a checkered scene. Keep the border and thumb at full opacity for contrast.",
|
|
28
|
+
"description": "",
|
|
29
|
+
"composition": false,
|
|
30
|
+
"tags": [
|
|
31
|
+
"theme"
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"id": "joystick-constraints",
|
|
36
|
+
"name": "Constraints",
|
|
37
|
+
"template": "<div nve-layout=\"row gap:lg align:wrap\">\n <nve-joystick aria-label=\"Circular movement\"></nve-joystick>\n <nve-joystick aria-label=\"Independent axes\" constraint=\"square\"></nve-joystick>\n <nve-joystick aria-label=\"Turn\" constraint=\"horizontal\"></nve-joystick>\n <nve-joystick aria-label=\"Vertical movement\" constraint=\"vertical\"></nve-joystick>\n</div>\n",
|
|
38
|
+
"summary": "Compare circular, square, and single-axis movement regions. Choose a constraint that matches the available commands.",
|
|
39
|
+
"description": "Circle bounds normalized magnitude to one. Square allows independent full-scale axes and a magnitude of up to Math.SQRT2. Use circle for planar direction and intensity, or square for independent limits such as forward velocity and turning rate. Equally scaled planar velocity axes can produce about 41% greater diagonal speed with square input.",
|
|
40
|
+
"composition": false,
|
|
41
|
+
"tags": []
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"id": "joystick-hold",
|
|
45
|
+
"name": "Hold",
|
|
46
|
+
"template": "<nve-joystick aria-label=\"Persistent target\" release=\"hold\"></nve-joystick>\n",
|
|
47
|
+
"summary": "Keep the last position after release for persistent target selection. Press Escape during an interaction to return to center.",
|
|
48
|
+
"description": "",
|
|
49
|
+
"composition": false,
|
|
50
|
+
"tags": []
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"id": "joystick-states",
|
|
54
|
+
"name": "States",
|
|
55
|
+
"template": "<div nve-layout=\"row gap:lg align:wrap\">\n <nve-joystick aria-label=\"Recorded input\" readonly value='{\"x\":0.4,\"y\":-0.6}'></nve-joystick>\n <nve-joystick aria-label=\"Unavailable control\" disabled></nve-joystick>\n</div>\n",
|
|
56
|
+
"summary": "Display recorded input without generating control events. Use read-only state for inspection and disabled state for unavailable controls.",
|
|
57
|
+
"description": "Set readOnly to true before assigning recorded vectors through .value. Use undefined for an absent sample and a zero vector for recorded neutral input. The recording layer captures source, sample time, engagement transitions, and mapping configuration. Preserve its clock during replay and avoid applying input shaping to recorded samples again.",
|
|
58
|
+
"composition": false,
|
|
59
|
+
"tags": []
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"id": "joystick-travel-turn",
|
|
63
|
+
"name": "TravelTurn",
|
|
64
|
+
"template": "<div id=\"joystick-travel-turn\" nve-layout=\"column gap:lg\">\n <div nve-layout=\"row gap:lg align:wrap\">\n <div nve-layout=\"column gap:sm\">\n <label for=\"joystick-travel\">Travel</label>\n <nve-joystick id=\"joystick-travel\" constraint=\"square\"></nve-joystick>\n <output data-travel style=\"width: 170px\">Released: x 0.00, y 0.00</output>\n </div>\n <div nve-layout=\"column gap:sm\">\n <label for=\"joystick-turn\">Turn</label>\n <nve-joystick id=\"joystick-turn\" constraint=\"horizontal\"></nve-joystick>\n <output data-turn>Released: x 0.00, y 0.00</output>\n </div>\n </div>\n <output data-command>vx 0.00 m/s, vy 0.00 m/s, wz 0.00 rad/s</output>\n</div>\n<script type=\"module\">\n const group = document.querySelector(\"#joystick-travel-turn\");\n const travel = group.querySelector(\"#joystick-travel\");\n const turn = group.querySelector(\"#joystick-turn\");\n const maxForwardMps = 1;\n const maxLateralMps = 0.5;\n const maxYawRadps = 1;\n\n function describe(control) {\n const value = control.value;\n const state = control.matches(\":state(active)\") ? \"Engaged\" : \"Released\";\n return state + \": \" + (value ? \"x \" + value.x.toFixed(2) + \", y \" + value.y.toFixed(2) : \"No sample\");\n }\n\n function update() {\n group.querySelector(\"[data-travel]\").textContent = describe(travel);\n group.querySelector(\"[data-turn]\").textContent = describe(turn);\n const translation = travel.matches(\":state(active)\") ? travel.value : undefined;\n const rotation = turn.matches(\":state(active)\") ? turn.value : undefined;\n const command = {\n vx: -(translation?.y ?? 0) * maxForwardMps,\n vy: -(translation?.x ?? 0) * maxLateralMps,\n wz: -(rotation?.x ?? 0) * maxYawRadps,\n };\n group.querySelector(\"[data-command]\").textContent = \"vx \" + command.vx.toFixed(2) + \" m/s, vy \" + command.vy.toFixed(2) + \" m/s, wz \" + command.wz.toFixed(2) + \" rad/s\";\n }\n\n for (const type of [\"input\", \"interaction-start\", \"interaction-end\"]) group.addEventListener(type, update);\n await customElements.whenDefined(\"nve-joystick\");\n update();\n</script>\n",
|
|
65
|
+
"summary": "Map travel and turn input to body-frame velocities in meters and radians per second. Engage either joystick to update its command axes.",
|
|
66
|
+
"description": "Input maps to ROS body axes: x-forward, y-left, z-up, with positive yaw counterclockwise. Travel uses square constraints for independent axis limits; use circle to bound normalized translation magnitude. The illustrative maxima are 1 m/s forward, 0.5 m/s lateral, and 1 rad/s yaw. Each control's :state(active) CSS custom state gates its displayed velocity. Interaction events refresh the readouts. The application chooses its limits and publishes the latest command at its own cadence, including while input remains stationary.",
|
|
67
|
+
"composition": false,
|
|
68
|
+
"tags": []
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"id": "joystick-input-shaping",
|
|
72
|
+
"name": "InputShaping",
|
|
73
|
+
"template": "<div id=\"joystick-shaping\" nve-layout=\"column gap:md\">\n <nve-joystick aria-label=\"Movement\" constraint=\"circle\"></nve-joystick>\n <nve-range>\n <label for=\"joystick-deadzone\">Dead zone</label>\n <input id=\"joystick-deadzone\" type=\"range\" min=\"0\" max=\"0.5\" step=\"0.01\" value=\"0\" />\n </nve-range>\n <nve-range>\n <label for=\"joystick-response\">Response exponent</label>\n <input id=\"joystick-response\" type=\"range\" min=\"1\" max=\"3\" step=\"0.1\" value=\"1\" />\n </nve-range>\n <output data-settings>Dead zone 0.00, response 1.0</output>\n <output data-raw>Raw: x 0.00, y 0.00</output>\n <output data-shaped>Shaped: x 0.00, y 0.00</output>\n</div>\n<script type=\"module\">\n const group = document.querySelector(\"#joystick-shaping\");\n const joystick = group.querySelector(\"nve-joystick\");\n const deadzone = group.querySelector(\"#joystick-deadzone\");\n const response = group.querySelector(\"#joystick-response\");\n\n function shape(value, deadzone, exponent) {\n const magnitude = Math.hypot(value.x, value.y);\n if (magnitude <= deadzone) return { x: 0, y: 0 };\n const strength = ((magnitude - deadzone) / (1 - deadzone)) ** exponent;\n return { x: (value.x / magnitude) * strength, y: (value.y / magnitude) * strength };\n }\n\n function update() {\n const raw = joystick.value ?? { x: 0, y: 0 };\n const shaped = shape(raw, deadzone.valueAsNumber, response.valueAsNumber);\n group.querySelector(\"[data-settings]\").textContent = \"Dead zone \" + deadzone.valueAsNumber.toFixed(2) + \", response \" + response.valueAsNumber.toFixed(1);\n group.querySelector(\"[data-raw]\").textContent = \"Raw: x \" + raw.x.toFixed(2) + \", y \" + raw.y.toFixed(2);\n group.querySelector(\"[data-shaped]\").textContent = \"Shaped: x \" + shaped.x.toFixed(2) + \", y \" + shaped.y.toFixed(2);\n }\n\n group.addEventListener(\"input\", update);\n await customElements.whenDefined(\"nve-joystick\");\n update();\n</script>\n",
|
|
74
|
+
"summary": "Adjust a radial dead zone and response curve before mapping input to commands. Compare the shaped vector with the unchanged joystick value.",
|
|
75
|
+
"description": "A dead zone of zero and response exponent of one leave circular input unchanged. The dead zone makes neutral easier to select; a larger exponent provides finer control near neutral. The remaining range scales back to full output at the boundary and preserves direction. Shaping produces a separate command vector without rewriting .value. Map it to physical units afterward. Apply filtering in one input layer to avoid processing hardware or recorded samples twice. [ROS joystick parameters](https://github.com/ros-drivers/joystick_drivers/blob/ros2/joy/README.md)",
|
|
76
|
+
"composition": false,
|
|
77
|
+
"tags": []
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"id": "joystick-form",
|
|
81
|
+
"name": "Form",
|
|
82
|
+
"template": "<form nve-layout=\"column gap:md\">\n <label for=\"joystick-form\">Target</label>\n <nve-joystick id=\"joystick-form\" name=\"target\" release=\"hold\" value='{\"x\":0.2,\"y\":-0.3}'></nve-joystick>\n <nve-button type=\"reset\">Reset target</nve-button>\n</form>\n",
|
|
83
|
+
"summary": "Submit both axes as separate named fields and restore the declared position with form reset. Use held values when selecting persistent form targets.",
|
|
84
|
+
"description": "",
|
|
85
|
+
"composition": false,
|
|
86
|
+
"tags": []
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"id": "joystick-accessible-feedback",
|
|
90
|
+
"name": "AccessibleFeedback",
|
|
91
|
+
"template": "<nve-joystick aria-label=\"Movement\" i18n='{\"joystickPosition\":\"Horizontal {x}, vertical {y}.\"}'></nve-joystick>\n",
|
|
92
|
+
"summary": "Override joystickPosition through i18n to localize spoken coordinates while keeping built-in position announcements.",
|
|
93
|
+
"description": "",
|
|
94
|
+
"composition": false,
|
|
95
|
+
"tags": []
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"id": "joystick-external-feedback",
|
|
99
|
+
"name": "ExternalFeedback",
|
|
100
|
+
"template": "<div id=\"joystick-external-feedback\" nve-layout=\"column gap:md\">\n <nve-joystick aria-label=\"Target\" announce=\"off\" release=\"hold\"></nve-joystick>\n <output aria-live=\"polite\" aria-atomic=\"true\">Target: X 0, Y 0</output>\n</div>\n<script type=\"module\">\n const root = document.querySelector(\"#joystick-external-feedback\");\n const joystick = root.querySelector(\"nve-joystick\");\n const output = root.querySelector(\"output\");\n joystick.addEventListener(\"change\", () => {\n const value = joystick.value;\n output.textContent = value ? \"Target: X \" + value.x + \", Y \" + value.y : \"No target\";\n });\n</script>\n",
|
|
101
|
+
"summary": "Supply application announcements with a labeled output. Disable built-in announcements to avoid duplicate feedback.",
|
|
102
|
+
"description": "",
|
|
103
|
+
"composition": false,
|
|
104
|
+
"tags": []
|
|
105
|
+
}
|
|
106
|
+
]
|
|
107
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
//#region src/joystick/joystick.css?inline
|
|
2
|
+
var e = ":host{--_size-scale: 1;--width: calc(8.125rem * var(--_size-scale));--height: calc(8.125rem * var(--_size-scale));--background: var(--nve-sys-interaction-background);--opacity: .6;--border: var(--nve-ref-border-width-sm) solid var(--nve-ref-border-color);--thumb-width: calc(var(--nve-ref-size-600) * var(--_size-scale));--thumb-height: calc(var(--nve-ref-size-600) * var(--_size-scale));--thumb-background: var(--nve-sys-text-muted-color);--thumb-border: var(--nve-ref-border-width-sm) solid var(--nve-sys-layer-canvas-background);--_axis-size: calc(3rem * var(--_size-scale));display:inline-block;width:var(--width);height:var(--height);user-select:none}[internal-host]{position:relative;box-sizing:border-box;width:100%;height:100%;border:var(--border);border-radius:50%;cursor:grab}.background{position:absolute;inset:0;z-index:0;border-radius:inherit;background:var(--background);pointer-events:none}:host([opacity]) .background{opacity:var(--opacity)}[internal-host]:before,[internal-host]:after{content:\"\";position:absolute;z-index:1}[internal-host]:before{left:50%;top:0;bottom:0;border-left:var(--nve-ref-border-width-sm) solid var(--nve-ref-border-color)}[internal-host]:after{top:50%;left:0;right:0;border-top:var(--nve-ref-border-width-sm) solid var(--nve-ref-border-color)}.travel{position:absolute;inset:calc(var(--thumb-height) / 2) calc(var(--thumb-width) / 2);z-index:2}.thumb{position:absolute;box-sizing:border-box;width:var(--thumb-width);height:var(--thumb-height);border:var(--thumb-border);border-radius:50%;background:var(--thumb-background);transform:translate(-50%,-50%)}:host([constraint=\"square\"]) [internal-host]{border-radius:var(--nve-ref-border-radius-md)}:host([size=\"sm\"]){--_size-scale: .8}:host([size=\"lg\"]){--_size-scale: 1.2}:host([constraint=\"horizontal\"]){--height: var(--_axis-size)}:host([constraint=\"vertical\"]){--width: var(--_axis-size)}:host([constraint=\"horizontal\"]) [internal-host],:host([constraint=\"vertical\"]) [internal-host]{border-radius:var(--nve-ref-border-radius-md)}:host(:focus-visible){outline:none}:host(:focus-visible) [internal-host]{outline:var(--nve-ref-border-width-md) solid var(--nve-sys-accent-secondary-background);outline-offset:var(--nve-ref-space-xs)}:host(:state(active)){--thumb-background: var(--nve-sys-accent-secondary-background)}:host(:state(active)) [internal-host]{cursor:grabbing}:host([disabled]){--background: var(--nve-sys-interaction-disabled-background);--thumb-background: var(--nve-sys-interaction-disabled-color)}:host([disabled]) [internal-host],:host([readonly]) [internal-host]{cursor:default}.announcement{position:absolute;width:1px;height:1px;padding:0;margin:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}";
|
|
3
|
+
//#endregion
|
|
4
|
+
export { e as default };
|
|
5
|
+
|
|
6
|
+
//# sourceMappingURL=joystick.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"joystick.js","names":[],"sources":["../../src/joystick/joystick.css?inline"],"sourcesContent":["/* SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. */\n/* SPDX-License-Identifier: Apache-2.0 */\n\n:host {\n --_size-scale: 1;\n --width: calc(8.125rem * var(--_size-scale));\n --height: calc(8.125rem * var(--_size-scale));\n --background: var(--nve-sys-interaction-background);\n --opacity: 0.6;\n --border: var(--nve-ref-border-width-sm) solid var(--nve-ref-border-color);\n --thumb-width: calc(var(--nve-ref-size-600) * var(--_size-scale));\n --thumb-height: calc(var(--nve-ref-size-600) * var(--_size-scale));\n --thumb-background: var(--nve-sys-text-muted-color);\n --thumb-border: var(--nve-ref-border-width-sm) solid var(--nve-sys-layer-canvas-background);\n --_axis-size: calc(3rem * var(--_size-scale));\n display: inline-block;\n width: var(--width);\n height: var(--height);\n user-select: none;\n}\n\n[internal-host] {\n position: relative;\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n border: var(--border);\n border-radius: 50%;\n cursor: grab;\n}\n\n.background {\n position: absolute;\n inset: 0;\n z-index: 0;\n border-radius: inherit;\n background: var(--background);\n pointer-events: none;\n}\n\n:host([opacity]) .background {\n opacity: var(--opacity);\n}\n\n[internal-host]::before,\n[internal-host]::after {\n content: '';\n position: absolute;\n z-index: 1;\n}\n\n[internal-host]::before {\n left: 50%;\n top: 0;\n bottom: 0;\n border-left: var(--nve-ref-border-width-sm) solid var(--nve-ref-border-color);\n}\n\n[internal-host]::after {\n top: 50%;\n left: 0;\n right: 0;\n border-top: var(--nve-ref-border-width-sm) solid var(--nve-ref-border-color);\n}\n\n.travel {\n position: absolute;\n inset: calc(var(--thumb-height) / 2) calc(var(--thumb-width) / 2);\n z-index: 2;\n}\n\n.thumb {\n position: absolute;\n box-sizing: border-box;\n width: var(--thumb-width);\n height: var(--thumb-height);\n border: var(--thumb-border);\n border-radius: 50%;\n background: var(--thumb-background);\n transform: translate(-50%, -50%);\n}\n\n:host([constraint='square']) [internal-host] {\n border-radius: var(--nve-ref-border-radius-md);\n}\n\n:host([size='sm']) {\n --_size-scale: 0.8;\n}\n\n:host([size='lg']) {\n --_size-scale: 1.2;\n}\n\n:host([constraint='horizontal']) {\n --height: var(--_axis-size);\n}\n\n:host([constraint='vertical']) {\n --width: var(--_axis-size);\n}\n\n:host([constraint='horizontal']) [internal-host],\n:host([constraint='vertical']) [internal-host] {\n border-radius: var(--nve-ref-border-radius-md);\n}\n\n:host(:focus-visible) {\n outline: none;\n}\n\n:host(:focus-visible) [internal-host] {\n outline: var(--nve-ref-border-width-md) solid var(--nve-sys-accent-secondary-background);\n outline-offset: var(--nve-ref-space-xs);\n}\n\n:host(:state(active)) {\n --thumb-background: var(--nve-sys-accent-secondary-background);\n}\n\n:host(:state(active)) [internal-host] {\n cursor: grabbing;\n}\n\n:host([disabled]) {\n --background: var(--nve-sys-interaction-disabled-background);\n --thumb-background: var(--nve-sys-interaction-disabled-color);\n}\n\n:host([disabled]) [internal-host],\n:host([readonly]) [internal-host] {\n cursor: default;\n}\n\n.announcement {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: 0;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n border: 0;\n}\n"],"mappings":""}
|
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
import { GestureController as e } from "../internal/controllers/gesture.controller.js";
|
|
2
|
+
import { useStyles as t } from "../internal/styles/index.js";
|
|
3
|
+
import n from "../_virtual/_@oxc-project_runtime@0.147.0/helpers/esm/decorate.js";
|
|
4
|
+
import r from "./joystick.js";
|
|
5
|
+
import { LitElement as i, html as a, isServer as o } from "lit";
|
|
6
|
+
import { property as s } from "lit/decorators/property.js";
|
|
7
|
+
import { I18nController as c } from "@nvidia-elements/foundations/internal/i18n";
|
|
8
|
+
import { FormControlMixin as l } from "@nvidia-elements/forms/mixins";
|
|
9
|
+
import { styleMap as u } from "lit/directives/style-map.js";
|
|
10
|
+
//#region src/joystick/joystick.ts
|
|
11
|
+
var d = {
|
|
12
|
+
joystickPosition: "X {x}, Y {y}.",
|
|
13
|
+
joystickNoPosition: "No position.",
|
|
14
|
+
joystickInstructions: "Use arrow keys to adjust the enabled axes. Release to return to center. Press Escape to cancel.",
|
|
15
|
+
joystickHoldInstructions: "Use arrow keys to adjust the enabled axes. Release to keep the position. Escape and interruptions return to center.",
|
|
16
|
+
joystickReturnedToCenter: "{position} Returned to center."
|
|
17
|
+
}, f = {
|
|
18
|
+
ArrowLeft: {
|
|
19
|
+
x: -1,
|
|
20
|
+
y: 0
|
|
21
|
+
},
|
|
22
|
+
ArrowRight: {
|
|
23
|
+
x: 1,
|
|
24
|
+
y: 0
|
|
25
|
+
},
|
|
26
|
+
ArrowUp: {
|
|
27
|
+
x: 0,
|
|
28
|
+
y: -1
|
|
29
|
+
},
|
|
30
|
+
ArrowDown: {
|
|
31
|
+
x: 0,
|
|
32
|
+
y: 1
|
|
33
|
+
}
|
|
34
|
+
}, p = class extends l(i) {
|
|
35
|
+
static {
|
|
36
|
+
this.styles = t([r]);
|
|
37
|
+
}
|
|
38
|
+
static {
|
|
39
|
+
this.metadata = {
|
|
40
|
+
tag: "nve-joystick",
|
|
41
|
+
version: "2.20.0",
|
|
42
|
+
valueSchema: {
|
|
43
|
+
type: "object",
|
|
44
|
+
properties: {
|
|
45
|
+
x: {
|
|
46
|
+
type: "number",
|
|
47
|
+
minimum: -1,
|
|
48
|
+
maximum: 1
|
|
49
|
+
},
|
|
50
|
+
y: {
|
|
51
|
+
type: "number",
|
|
52
|
+
minimum: -1,
|
|
53
|
+
maximum: 1
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
required: ["x", "y"],
|
|
57
|
+
additionalProperties: !1
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
#e;
|
|
62
|
+
#t;
|
|
63
|
+
#n;
|
|
64
|
+
#r;
|
|
65
|
+
#i;
|
|
66
|
+
#a;
|
|
67
|
+
#o;
|
|
68
|
+
#s;
|
|
69
|
+
#c;
|
|
70
|
+
#l;
|
|
71
|
+
#u;
|
|
72
|
+
static get observedAttributes() {
|
|
73
|
+
return [...super.observedAttributes, "tabindex"];
|
|
74
|
+
}
|
|
75
|
+
attributeChangedCallback(e, t, n) {
|
|
76
|
+
super.attributeChangedCallback(e, t, n), e === "tabindex" && (this.#u = !1);
|
|
77
|
+
}
|
|
78
|
+
get disabled() {
|
|
79
|
+
return super.disabled;
|
|
80
|
+
}
|
|
81
|
+
set disabled(e) {
|
|
82
|
+
super.disabled = !!e, this.#S();
|
|
83
|
+
}
|
|
84
|
+
get readOnly() {
|
|
85
|
+
return super.readOnly;
|
|
86
|
+
}
|
|
87
|
+
set readOnly(e) {
|
|
88
|
+
super.readOnly = !!e, this.#S();
|
|
89
|
+
}
|
|
90
|
+
constructor() {
|
|
91
|
+
super(), this.constraint = "circle", this.size = "md", this.opacity = !1, this.release = "center", this.keyboardStep = .1, this.announce = "polite", this.#e = new c(this, d), this.i18n = this.#e.i18n, this.#t = "", this.#a = !1, this.#o = new e(this, {
|
|
92
|
+
touchAction: () => this.disabled || this.readOnly ? void 0 : "none",
|
|
93
|
+
suppressNativeDrag: !0
|
|
94
|
+
}), this.#s = /* @__PURE__ */ new Set(), this.#l = !1, this.#u = !1, this.#w = (e) => {
|
|
95
|
+
if (!(e instanceof CustomEvent)) return;
|
|
96
|
+
let t = e.detail;
|
|
97
|
+
this.#S(), t.kind === "pointerdown" ? this.#T(t) : t.kind === "pointerend" && this.#c?.pointerId === t.event.pointerId && (t.interrupted || this.#C(t.event), this.#h(t.interrupted ? t.reason === "cancel" ? "pointer-cancel" : "lost-capture" : "release"));
|
|
98
|
+
}, this.#E = (e) => {
|
|
99
|
+
if (!(e instanceof CustomEvent)) return;
|
|
100
|
+
let t = e.detail;
|
|
101
|
+
this.#S(), t.kind === "drag" && this.#c?.pointerId === t.event.pointerId && this.#C(t.event);
|
|
102
|
+
}, this.#D = (e) => {
|
|
103
|
+
if (e.key === "Escape" && this.#c) {
|
|
104
|
+
e.preventDefault(), this.#h("escape");
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
let t = f[e.key];
|
|
108
|
+
!t || !this.#A(e, t) || (e.preventDefault(), this.#s.add(e.key), this.#c || this.#p({
|
|
109
|
+
source: "keyboard",
|
|
110
|
+
changed: !1
|
|
111
|
+
}), this.#c && this.#O(t));
|
|
112
|
+
}, this.#j = (e) => {
|
|
113
|
+
this.#c?.source !== "keyboard" || !this.#s.delete(e.key) || (e.preventDefault(), this.#s.size || this.#h("release"));
|
|
114
|
+
}, this.#M = () => {
|
|
115
|
+
this.#S(), this.#h("blur"), this.#b();
|
|
116
|
+
}, this.#N = () => {
|
|
117
|
+
globalThis.document.hidden && (this.#h("hidden"), this.#b());
|
|
118
|
+
}, this.value = {
|
|
119
|
+
x: 0,
|
|
120
|
+
y: 0
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
connectedCallback() {
|
|
124
|
+
let e = this.getAttribute("tabindex"), t = this.#u || e === null;
|
|
125
|
+
super.connectedCallback(), e !== null && this.setAttribute("tabindex", e), this.#u = t, this.hasUpdated && (this.#o.target = this), this.addEventListener("nve-gesture-input", this.#w), this.addEventListener("nve-gesture", this.#E), this.addEventListener("keydown", this.#D), this.addEventListener("keyup", this.#j), this.addEventListener("blur", this.#M), globalThis.window?.addEventListener("blur", this.#M), globalThis.document?.addEventListener("visibilitychange", this.#N);
|
|
126
|
+
}
|
|
127
|
+
disconnectedCallback() {
|
|
128
|
+
this.#h("disconnect"), this.#b(), this.removeEventListener("nve-gesture-input", this.#w), this.removeEventListener("nve-gesture", this.#E), this.removeEventListener("keydown", this.#D), this.removeEventListener("keyup", this.#j), this.removeEventListener("blur", this.#M), globalThis.window?.removeEventListener("blur", this.#M), globalThis.document?.removeEventListener("visibilitychange", this.#N), super.disconnectedCallback();
|
|
129
|
+
}
|
|
130
|
+
firstUpdated() {
|
|
131
|
+
this.#o.target = this;
|
|
132
|
+
}
|
|
133
|
+
willUpdate(e) {
|
|
134
|
+
if (o && this.hasAttribute("value") && this._handleAttributeChange("value", this.getAttribute("value")), this.#S(), this.announce === "off" && this.#b(), (e.has("constraint") || e.has("release") || e.has("keyboardStep")) && (this.#h("configuration-change"), this.#b(), this.value)) {
|
|
135
|
+
let e = this.#f(this.value);
|
|
136
|
+
h(this.value, e) || (this.value = e);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
updated() {
|
|
140
|
+
(this.#u || !this.hasAttribute("tabindex")) && (this.tabIndex = this.disabled ? -1 : 0, this.#u = !0), this._internals.role = this.disabled || this.readOnly ? "group" : "application", this._internals.ariaLabel = this.ariaLabel || this.composedLabel || null, this._internals.ariaReadOnly = null, this._internals.ariaDescription = this.#d;
|
|
141
|
+
}
|
|
142
|
+
get #d() {
|
|
143
|
+
let e = this.#_(this.value);
|
|
144
|
+
return this.disabled || this.readOnly ? e : `${e} ${this.release === "hold" ? this.i18n.joystickHoldInstructions : this.i18n.joystickInstructions}`;
|
|
145
|
+
}
|
|
146
|
+
render() {
|
|
147
|
+
let e = this.value ?? {
|
|
148
|
+
x: 0,
|
|
149
|
+
y: 0
|
|
150
|
+
};
|
|
151
|
+
return a`<div internal-host aria-hidden="true"><div class="background"></div><div class="travel"><div class="thumb" ?hidden="${!this.value}" style="${u({
|
|
152
|
+
left: `${(e.x + 1) * 50}%`,
|
|
153
|
+
top: `${(e.y + 1) * 50}%`
|
|
154
|
+
})}"></div></div></div><span class="announcement" role="status" aria-live="${this.announce === "off" ? "off" : "polite"}" aria-atomic="true">${this.#t}</span>`;
|
|
155
|
+
}
|
|
156
|
+
updateValue(e) {
|
|
157
|
+
let t = this.#l && m(e) ? this.#f(e) : e;
|
|
158
|
+
if (this.#l = !1, t !== void 0 && (!m(t) || !h(t, this.#f(t)))) throw TypeError("Joystick value must contain finite x and y coordinates within its constraint.");
|
|
159
|
+
super.updateValue(t), this.#a || (this.#i = void 0, this.#b());
|
|
160
|
+
}
|
|
161
|
+
reset() {
|
|
162
|
+
this.#h("reset"), this.#b(), this.#l = !0;
|
|
163
|
+
try {
|
|
164
|
+
super.reset();
|
|
165
|
+
} finally {
|
|
166
|
+
this.#l = !1;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
formStateRestoreCallback(e, t) {
|
|
170
|
+
if (typeof e != "string") return;
|
|
171
|
+
let n;
|
|
172
|
+
try {
|
|
173
|
+
n = e === "" ? void 0 : JSON.parse(e);
|
|
174
|
+
} catch {
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
n !== void 0 && (!m(n) || !h(n, this.#f(n))) || (this.#h("reset"), this.value = n);
|
|
178
|
+
}
|
|
179
|
+
_updateFormState() {
|
|
180
|
+
if (!this.name || !this.value) {
|
|
181
|
+
this._internals.setFormValue(null, this.valueAsString);
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
let e = new FormData();
|
|
185
|
+
e.set(`${this.name}-x`, `${this.value.x}`), e.set(`${this.name}-y`, `${this.value.y}`), this._internals.setFormValue(e, this.valueAsString);
|
|
186
|
+
}
|
|
187
|
+
#f({ x: e, y: t }) {
|
|
188
|
+
let n = this.hasUpdated ? this.constraint : this.getAttribute("constraint") ?? this.constraint;
|
|
189
|
+
if (n === "circle") {
|
|
190
|
+
let n = Math.max(1, Math.hypot(e, t));
|
|
191
|
+
return {
|
|
192
|
+
x: e / n,
|
|
193
|
+
y: t / n
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
return {
|
|
197
|
+
x: n === "vertical" ? 0 : Math.max(-1, Math.min(1, e)),
|
|
198
|
+
y: n === "horizontal" ? 0 : Math.max(-1, Math.min(1, t))
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
#p(e) {
|
|
202
|
+
this.#c = e, this.#i = void 0, this.#t = "", this.requestUpdate(), this._internals.states.add("active"), this.dispatchEvent(new CustomEvent("interaction-start", {
|
|
203
|
+
bubbles: !0,
|
|
204
|
+
composed: !0,
|
|
205
|
+
detail: { source: e.source }
|
|
206
|
+
})), this.#S();
|
|
207
|
+
}
|
|
208
|
+
#m(e) {
|
|
209
|
+
if (!h(this.value, e)) {
|
|
210
|
+
this.#a = !0;
|
|
211
|
+
try {
|
|
212
|
+
this.value = e;
|
|
213
|
+
} finally {
|
|
214
|
+
this.#a = !1;
|
|
215
|
+
}
|
|
216
|
+
this.#c && (this.#i = e), this.#c && (this.#c.changed = !0), this.dispatchInputEvent(), this.#S(), this.#c && this.#i === e && this.#y(e, "position");
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
#h(e) {
|
|
220
|
+
let t = this.#c;
|
|
221
|
+
if (!t) return;
|
|
222
|
+
let n = this.#i;
|
|
223
|
+
this.#c = void 0, this.#s.clear(), this._internals.states.delete("active"), this.#x(t.pointerId), e !== "reset" && (e !== "release" || this.release !== "hold") && this.#m({
|
|
224
|
+
x: 0,
|
|
225
|
+
y: 0
|
|
226
|
+
}), this.#g(e, this.#i ? n : void 0), e === "release" && t.changed && this.dispatchChangeEvent(), this.dispatchEvent(new CustomEvent("interaction-end", {
|
|
227
|
+
bubbles: !0,
|
|
228
|
+
composed: !0,
|
|
229
|
+
detail: {
|
|
230
|
+
source: t.source,
|
|
231
|
+
reason: e
|
|
232
|
+
}
|
|
233
|
+
}));
|
|
234
|
+
}
|
|
235
|
+
#g(e, t) {
|
|
236
|
+
e === "escape" ? h(this.value, {
|
|
237
|
+
x: 0,
|
|
238
|
+
y: 0
|
|
239
|
+
}) && this.#y({
|
|
240
|
+
x: 0,
|
|
241
|
+
y: 0
|
|
242
|
+
}, "position") : e === "release" && t ? this.release === "hold" && h(this.value, t) ? this.#y(t, "position") : this.release !== "hold" && h(this.value, {
|
|
243
|
+
x: 0,
|
|
244
|
+
y: 0
|
|
245
|
+
}) && this.#y(t, "return") : this.#b();
|
|
246
|
+
}
|
|
247
|
+
#_(e) {
|
|
248
|
+
if (!e) return this.i18n.joystickNoPosition ?? d.joystickNoPosition;
|
|
249
|
+
let t, n = {
|
|
250
|
+
maximumFractionDigits: 6,
|
|
251
|
+
useGrouping: !1
|
|
252
|
+
};
|
|
253
|
+
try {
|
|
254
|
+
t = new Intl.NumberFormat(globalThis.document?.documentElement.lang || void 0, n);
|
|
255
|
+
} catch {
|
|
256
|
+
t = new Intl.NumberFormat(void 0, n);
|
|
257
|
+
}
|
|
258
|
+
let r = (e) => t.format(Number(e.toFixed(6)) || 0);
|
|
259
|
+
return (this.i18n.joystickPosition ?? "").replaceAll("{x}", r(e.x)).replaceAll("{y}", r(e.y));
|
|
260
|
+
}
|
|
261
|
+
get #v() {
|
|
262
|
+
return this.isConnected && this.matches(":focus") && !this.disabled && !this.readOnly && this.announce !== "off" && !globalThis.document.hidden;
|
|
263
|
+
}
|
|
264
|
+
#y(e, t) {
|
|
265
|
+
this.#v && (this.#n = {
|
|
266
|
+
value: e,
|
|
267
|
+
kind: t
|
|
268
|
+
}, this.#r === void 0 && (this.#r = setTimeout(() => {
|
|
269
|
+
this.#r = void 0;
|
|
270
|
+
let e = this.#n;
|
|
271
|
+
if (this.#n = void 0, !e || !this.#v) return;
|
|
272
|
+
let t = this.#_(e.value), n = e.kind === "return" ? this.i18n.joystickReturnedToCenter?.replaceAll("{position}", t) : t;
|
|
273
|
+
!n || n === this.#t || (this.#t = n, this.requestUpdate());
|
|
274
|
+
}, 500)));
|
|
275
|
+
}
|
|
276
|
+
#b() {
|
|
277
|
+
clearTimeout(this.#r), this.#r = void 0, this.#n = void 0, this.#t && (this.#t = "", this.requestUpdate());
|
|
278
|
+
}
|
|
279
|
+
#x(e) {
|
|
280
|
+
e !== void 0 && (this.hasPointerCapture(e) && this.releasePointerCapture(e), this.#o.target = void 0, this.isConnected && this.hasUpdated && (this.#o.target = this));
|
|
281
|
+
}
|
|
282
|
+
#S() {
|
|
283
|
+
(this.disabled || this.readOnly) && (this.#h(this.disabled ? "disabled" : "readonly"), this.#b());
|
|
284
|
+
}
|
|
285
|
+
#C(e) {
|
|
286
|
+
let t = this.shadowRoot?.querySelector(".travel")?.getBoundingClientRect();
|
|
287
|
+
!t || t.width <= 0 || t.height <= 0 || this.#m(this.#f({
|
|
288
|
+
x: (e.clientX - t.left) / t.width * 2 - 1,
|
|
289
|
+
y: (e.clientY - t.top) / t.height * 2 - 1
|
|
290
|
+
}));
|
|
291
|
+
}
|
|
292
|
+
#w;
|
|
293
|
+
#T(e) {
|
|
294
|
+
!this.hasUpdated || this.disabled || this.readOnly || this.#c || e.event.button !== 0 || e.claim({ kind: "drag" }) && (e.event.preventDefault(), e.event.pointerType !== "touch" && this.focus({ preventScroll: !0 }), this.#p({
|
|
295
|
+
source: "pointer",
|
|
296
|
+
pointerId: e.event.pointerId,
|
|
297
|
+
changed: !1
|
|
298
|
+
}), this.#c && this.#C(e.event));
|
|
299
|
+
}
|
|
300
|
+
#E;
|
|
301
|
+
#D;
|
|
302
|
+
#O(e) {
|
|
303
|
+
let t = this.#k, n = this.value ?? {
|
|
304
|
+
x: 0,
|
|
305
|
+
y: 0
|
|
306
|
+
};
|
|
307
|
+
this.#m(this.#f({
|
|
308
|
+
x: Number((n.x + e.x * t).toFixed(6)),
|
|
309
|
+
y: Number((n.y + e.y * t).toFixed(6))
|
|
310
|
+
}));
|
|
311
|
+
}
|
|
312
|
+
get #k() {
|
|
313
|
+
return Number.isFinite(this.keyboardStep) && this.keyboardStep > 0 && this.keyboardStep <= 1 ? this.keyboardStep : .1;
|
|
314
|
+
}
|
|
315
|
+
#A(e, t) {
|
|
316
|
+
return e.altKey || e.ctrlKey || e.metaKey || this.disabled || this.readOnly || this.#c?.source === "pointer" ? !1 : this.constraint === "horizontal" ? t.y === 0 : this.constraint !== "vertical" || t.x === 0;
|
|
317
|
+
}
|
|
318
|
+
#j;
|
|
319
|
+
#M;
|
|
320
|
+
#N;
|
|
321
|
+
};
|
|
322
|
+
n([s({
|
|
323
|
+
type: String,
|
|
324
|
+
reflect: !0
|
|
325
|
+
})], p.prototype, "constraint", void 0), n([s({
|
|
326
|
+
type: String,
|
|
327
|
+
reflect: !0
|
|
328
|
+
})], p.prototype, "size", void 0), n([s({
|
|
329
|
+
type: Boolean,
|
|
330
|
+
reflect: !0
|
|
331
|
+
})], p.prototype, "opacity", void 0), n([s({
|
|
332
|
+
type: String,
|
|
333
|
+
reflect: !0
|
|
334
|
+
})], p.prototype, "release", void 0), n([s({
|
|
335
|
+
type: Number,
|
|
336
|
+
attribute: "keyboard-step"
|
|
337
|
+
})], p.prototype, "keyboardStep", void 0), n([s({ type: String })], p.prototype, "announce", void 0), n([s({ type: Object })], p.prototype, "i18n", void 0);
|
|
338
|
+
function m(e) {
|
|
339
|
+
return typeof e == "object" && !!e && "x" in e && "y" in e && typeof e.x == "number" && typeof e.y == "number" && Number.isFinite(e.x) && Number.isFinite(e.y) && Object.keys(e).length === 2;
|
|
340
|
+
}
|
|
341
|
+
function h(e, t) {
|
|
342
|
+
return e !== void 0 && Math.abs(e.x - t.x) < 1e-12 && Math.abs(e.y - t.y) < 1e-12;
|
|
343
|
+
}
|
|
344
|
+
//#endregion
|
|
345
|
+
export { p as Joystick };
|
|
346
|
+
|
|
347
|
+
//# sourceMappingURL=joystick2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"joystick2.js","names":[],"sources":["../../src/joystick/joystick.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { html, isServer, LitElement, type PropertyValues } from 'lit';\nimport { property } from 'lit/decorators/property.js';\nimport { styleMap } from 'lit/directives/style-map.js';\nimport { FormControlMixin } from '@nvidia-elements/forms/mixins';\nimport {\n GestureController,\n useStyles,\n type Gesture,\n type GestureInput,\n type Size\n} from '@nvidia-elements/core/internal';\nimport { I18nController, type I18nDefaults } from '@nvidia-elements/foundations/internal/i18n';\nimport styles from './joystick.css?inline';\n\nexport interface JoystickValue {\n readonly x: number;\n readonly y: number;\n}\n\nexport type JoystickConstraint = 'circle' | 'square' | 'horizontal' | 'vertical';\nexport type JoystickRelease = 'center' | 'hold';\n\nexport interface JoystickInteractionStart {\n readonly source: 'pointer' | 'keyboard';\n}\n\nexport interface JoystickInteractionEnd extends JoystickInteractionStart {\n readonly reason:\n | 'release'\n | 'escape'\n | 'pointer-cancel'\n | 'lost-capture'\n | 'blur'\n | 'hidden'\n | 'disabled'\n | 'readonly'\n | 'configuration-change'\n | 'reset'\n | 'disconnect';\n}\n\ntype Session = JoystickInteractionStart & { pointerId?: number; changed: boolean };\n\nconst i18nDefaults = {\n joystickPosition: 'X {x}, Y {y}.',\n joystickNoPosition: 'No position.',\n joystickInstructions:\n 'Use arrow keys to adjust the enabled axes. Release to return to center. Press Escape to cancel.',\n joystickHoldInstructions:\n 'Use arrow keys to adjust the enabled axes. Release to keep the position. Escape and interruptions return to center.',\n joystickReturnedToCenter: '{position} Returned to center.'\n} satisfies I18nDefaults;\n\nconst directions: Record<string, JoystickValue> = {\n ArrowLeft: { x: -1, y: 0 },\n ArrowRight: { x: 1, y: 0 },\n ArrowUp: { x: 0, y: -1 },\n ArrowDown: { x: 0, y: 1 }\n};\n\n/* eslint-disable jsdoc/no-types -- The metadata analyzer needs the inherited generic value type. */\n/**\n * @element nve-joystick\n * @description A joystick selects a normalized two-axis vector with pointer or keyboard input.\n * Applications own physical units, coordinate frames, input shaping, publishing cadence, recording clocks,\n * command-outcome feedback, and alternative controls when needed.\n *\n * Give each joystick an accessible name with a label, aria-label, or aria-labelledby.\n * Editable controls use the application role to receive two-axis keyboard input.\n * The default accessible description includes both normalized coordinates, keyboard instructions, and release behavior.\n * A locked axis stays at zero; an absent value reads \"No position.\" Disabled and read-only controls omit instructions.\n * Coordinates use up to six decimal places and the document language for number formatting.\n * An explicit aria-description or aria-describedby replaces the default focus description through standard ARIA precedence;\n * it does not disable live announcements.\n * @documentation https://nvidia.github.io/elements/docs/elements/joystick/\n * @since 0.0.0\n * @entrypoint \\@nvidia-elements/core/joystick\n * @property {JoystickValue | undefined} value - The normalized vector: positive x points right and positive y points down, independent of text direction. Assign a complete finite object within the selected constraint. Invalid vectors throw TypeError without replacing the previous value. Programmatic writes do not dispatch input or change events. Use undefined for an absent sample and a zero vector for recorded neutral input. Set readOnly before assigning replay ownership. User input can replace external writes during an interaction.\n * @attribute {string} value - A JSON object containing normalized x and y coordinates.\n * @event input - Dispatched after user input changes the vector, including a return to neutral. Read .value for the current vector. A held position does not generate repeated events. Publish commands at an application-controlled cadence.\n * @event change - Dispatched after a normal interaction completes and produces input. Cancellation sends any necessary neutral input without change.\n * @event interaction-start - Dispatched with the pointer or keyboard source after setting :state(active), including engagement at neutral.\n * @event interaction-end - Dispatched with the source and terminal reason after clearing :state(active). Interruption first sends any necessary neutral input. Reset restores the declared default without value events. Detached events cannot bubble to former ancestors.\n * @cssprop --width\n * @cssprop --height\n * @cssprop --background\n * @cssprop --opacity - Background opacity when the opacity flag is present. Defaults to 0.6. The border, crosshair, thumb, and focus indicator keep their opacity.\n * @cssprop --border\n * @cssprop --thumb-width\n * @cssprop --thumb-height\n * @cssprop --thumb-background\n * @cssprop --thumb-border\n * @stable false\n */\nexport class Joystick extends FormControlMixin<typeof LitElement, JoystickValue>(LitElement) {\n static styles = useStyles([styles]);\n\n static readonly metadata = {\n tag: 'nve-joystick',\n version: '0.0.0',\n valueSchema: {\n type: 'object' as const,\n properties: {\n x: { type: 'number' as const, minimum: -1, maximum: 1 },\n y: { type: 'number' as const, minimum: -1, maximum: 1 }\n },\n required: ['x', 'y'],\n additionalProperties: false\n }\n };\n\n /**\n * Constrains the movement region or selects one axis. Circle limits vector magnitude to one;\n * square permits both axes at full scale and a magnitude of up to Math.SQRT2.\n * With equally scaled planar velocity axes, square corners allow about 41% greater speed.\n * Mixed forward-velocity and turning-rate axes have no common physical magnitude.\n * Changing the constraint projects the current value silently and cancels an active interaction.\n */\n @property({ type: String, reflect: true }) constraint: JoystickConstraint = 'circle';\n\n /** Sets surface and thumb size. At the default font size, sm is 104px, md is 130px, and lg is 156px. */\n @property({ type: String, reflect: true }) size: Size = 'md';\n\n /** Enables background transparency using the --opacity CSS custom property. */\n @property({ type: Boolean, reflect: true }) opacity = false;\n\n /**\n * Determines whether normal release returns to center or holds the final vector.\n * Interrupted interactions return to neutral in either mode. Form reset restores the declared default instead.\n */\n @property({ type: String, reflect: true }) release: JoystickRelease = 'center';\n\n /**\n * Sets the normalized increment for each arrow key press. Repeated presses continue adjusting;\n * releasing the final arrow applies the release behavior. Escape cancels the interaction.\n * Invalid steps fall back to 0.1. Modifier shortcuts and locked-axis directions remain available to the browser.\n */\n @property({ type: Number, attribute: 'keyboard-step' }) keyboardStep = 0.1;\n\n /**\n * Controls automatic position announcements. Focused user input produces polite announcements at most every 500 ms.\n * A quick tap in center mode reports the input coordinates and the return to center.\n * Escape announces the resulting coordinates without a separate cancellation message.\n * Programmatic writes and read-only playback update the description without live announcements.\n * Set off when the application supplies spoken output, the position description on focus remains available.\n */\n @property({ type: String }) announce: 'polite' | 'off' = 'polite';\n\n readonly #i18nController: I18nController<this> = new I18nController(this, i18nDefaults);\n\n /** Enables updating internal string values for internationalization. */\n @property({ type: Object }) i18n = this.#i18nController.i18n;\n\n #announcement = '';\n #pendingFeedback?: { value: JoystickValue; kind: 'position' | 'return' };\n #announcementTimer?: ReturnType<typeof setTimeout>;\n #lastInput?: JoystickValue;\n #writingInput = false;\n\n readonly #gestureController = new GestureController(this, {\n touchAction: () => (this.disabled || this.readOnly ? undefined : 'none'),\n suppressNativeDrag: true\n });\n readonly #keys = new Set<string>();\n #session?: Session;\n #resetting = false;\n #ownsTabIndex = false;\n\n static override get observedAttributes() {\n return [...super.observedAttributes, 'tabindex'];\n }\n\n override attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null) {\n super.attributeChangedCallback(name, oldValue, newValue);\n if (name === 'tabindex') this.#ownsTabIndex = false;\n }\n\n override get disabled(): boolean {\n return super.disabled;\n }\n\n override set disabled(value: boolean | unknown) {\n super.disabled = Boolean(value);\n this.#checkAvailability();\n }\n\n override get readOnly(): boolean {\n return super.readOnly;\n }\n\n override set readOnly(value: boolean | unknown) {\n super.readOnly = Boolean(value);\n this.#checkAvailability();\n }\n\n constructor() {\n super();\n this.value = { x: 0, y: 0 };\n }\n\n connectedCallback() {\n const tabIndex = this.getAttribute('tabindex');\n const ownsTabIndex = this.#ownsTabIndex || tabIndex === null;\n super.connectedCallback();\n // The forms mixin assigns tabindex on connection; keep the caller's focus order.\n if (tabIndex !== null) this.setAttribute('tabindex', tabIndex);\n this.#ownsTabIndex = ownsTabIndex;\n if (this.hasUpdated) this.#gestureController.target = this;\n this.addEventListener('nve-gesture-input', this.#handleGestureInput);\n this.addEventListener('nve-gesture', this.#handleGesture);\n this.addEventListener('keydown', this.#handleKeyDown);\n this.addEventListener('keyup', this.#handleKeyUp);\n this.addEventListener('blur', this.#handleBlur);\n globalThis.window?.addEventListener('blur', this.#handleBlur);\n globalThis.document?.addEventListener('visibilitychange', this.#handleVisibility);\n }\n\n disconnectedCallback() {\n this.#end('disconnect');\n this.#clearFeedback();\n this.removeEventListener('nve-gesture-input', this.#handleGestureInput);\n this.removeEventListener('nve-gesture', this.#handleGesture);\n this.removeEventListener('keydown', this.#handleKeyDown);\n this.removeEventListener('keyup', this.#handleKeyUp);\n this.removeEventListener('blur', this.#handleBlur);\n globalThis.window?.removeEventListener('blur', this.#handleBlur);\n globalThis.document?.removeEventListener('visibilitychange', this.#handleVisibility);\n super.disconnectedCallback();\n }\n\n firstUpdated() {\n this.#gestureController.target = this;\n }\n\n willUpdate(changes: PropertyValues<this>) {\n // Lit SSR converts reactive attributes without invoking the forms mixin callback.\n if (isServer && this.hasAttribute('value')) this._handleAttributeChange('value', this.getAttribute('value'));\n this.#checkAvailability();\n if (this.announce === 'off') this.#clearFeedback();\n if (changes.has('constraint') || changes.has('release') || changes.has('keyboardStep')) {\n this.#end('configuration-change');\n this.#clearFeedback();\n if (this.value) {\n const value = this.#constrain(this.value);\n if (!sameVector(this.value, value)) this.value = value;\n }\n }\n }\n\n updated() {\n if (this.#ownsTabIndex || !this.hasAttribute('tabindex')) {\n this.tabIndex = this.disabled ? -1 : 0;\n this.#ownsTabIndex = true;\n }\n // Editable joysticks own the two-axis keyboard interaction, including release and cancellation.\n this._internals.role = this.disabled || this.readOnly ? 'group' : 'application';\n this._internals.ariaLabel = this.ariaLabel || this.composedLabel || null;\n this._internals.ariaReadOnly = null;\n this._internals.ariaDescription = this.#description;\n }\n\n get #description() {\n const position = this.#describePosition(this.value);\n if (this.disabled || this.readOnly) return position;\n const instructions = this.release === 'hold' ? this.i18n.joystickHoldInstructions : this.i18n.joystickInstructions;\n return `${position} ${instructions}`;\n }\n\n render() {\n const value = this.value ?? { x: 0, y: 0 };\n return html`\n <div internal-host aria-hidden=\"true\">\n <div class=\"background\"></div>\n <div class=\"travel\">\n <div class=\"thumb\" ?hidden=${!this.value} style=${styleMap({ left: `${(value.x + 1) * 50}%`, top: `${(value.y + 1) * 50}%` })}></div>\n </div>\n </div>\n <span class=\"announcement\" role=\"status\" aria-live=${this.announce === 'off' ? 'off' : 'polite'} aria-atomic=\"true\">${this.#announcement}</span>\n `;\n }\n\n override updateValue(value: JoystickValue) {\n // Only project the default assignment; writes from reset listeners still use strict validation.\n const nextValue = this.#resetting && isVector(value) ? this.#constrain(value) : value;\n this.#resetting = false;\n if (nextValue !== undefined && (!isVector(nextValue) || !sameVector(nextValue, this.#constrain(nextValue)))) {\n throw new TypeError('Joystick value must contain finite x and y coordinates within its constraint.');\n }\n super.updateValue(nextValue);\n if (!this.#writingInput) {\n this.#lastInput = undefined;\n this.#clearFeedback();\n }\n }\n\n override reset() {\n this.#end('reset');\n this.#clearFeedback();\n this.#resetting = true;\n try {\n super.reset();\n } finally {\n this.#resetting = false;\n }\n }\n\n override formStateRestoreCallback(state: unknown, _reason?: string) {\n if (typeof state !== 'string') return;\n let value: unknown;\n try {\n value = state === '' ? undefined : JSON.parse(state);\n } catch {\n return;\n }\n if (value !== undefined && (!isVector(value) || !sameVector(value, this.#constrain(value)))) return;\n this.#end('reset');\n this.value = value;\n }\n\n override _updateFormState() {\n if (!this.name || !this.value) {\n this._internals.setFormValue(null, this.valueAsString);\n return;\n }\n const data = new FormData();\n data.set(`${this.name}-x`, `${this.value.x}`);\n data.set(`${this.name}-y`, `${this.value.y}`);\n this._internals.setFormValue(data, this.valueAsString);\n }\n\n #constrain({ x, y }: JoystickValue): JoystickValue {\n const constraint = this.hasUpdated ? this.constraint : (this.getAttribute('constraint') ?? this.constraint);\n if (constraint === 'circle') {\n const length = Math.max(1, Math.hypot(x, y));\n return { x: x / length, y: y / length };\n }\n return {\n x: constraint === 'vertical' ? 0 : Math.max(-1, Math.min(1, x)),\n y: constraint === 'horizontal' ? 0 : Math.max(-1, Math.min(1, y))\n };\n }\n\n #begin(session: Session) {\n this.#session = session;\n this.#lastInput = undefined;\n // A later interaction can report identical text after an empty region.\n this.#announcement = '';\n this.requestUpdate();\n this._internals.states.add('active');\n this.dispatchEvent(\n new CustomEvent<JoystickInteractionStart>('interaction-start', {\n bubbles: true,\n composed: true,\n detail: { source: session.source }\n })\n );\n this.#checkAvailability();\n }\n\n #input(value: JoystickValue) {\n if (sameVector(this.value, value)) return;\n this.#writingInput = true;\n try {\n this.value = value;\n } finally {\n this.#writingInput = false;\n }\n if (this.#session) this.#lastInput = value;\n if (this.#session) this.#session.changed = true;\n this.dispatchInputEvent();\n this.#checkAvailability();\n if (this.#session && this.#lastInput === value) this.#queueFeedback(value, 'position');\n }\n\n #end(reason: JoystickInteractionEnd['reason']) {\n const session = this.#session;\n if (!session) return;\n const lastInput = this.#lastInput;\n this.#session = undefined;\n this.#keys.clear();\n this._internals.states.delete('active');\n this.#releasePointer(session.pointerId);\n if (reason !== 'reset' && (reason !== 'release' || this.release !== 'hold')) {\n this.#input({ x: 0, y: 0 });\n }\n this.#finishFeedback(reason, this.#lastInput ? lastInput : undefined);\n if (reason === 'release' && session.changed) this.dispatchChangeEvent();\n this.dispatchEvent(\n new CustomEvent<JoystickInteractionEnd>('interaction-end', {\n bubbles: true,\n composed: true,\n detail: { source: session.source, reason }\n })\n );\n }\n\n #finishFeedback(reason: JoystickInteractionEnd['reason'], lastInput: JoystickValue | undefined) {\n if (reason === 'escape') {\n if (sameVector(this.value, { x: 0, y: 0 })) this.#queueFeedback({ x: 0, y: 0 }, 'position');\n } else if (reason === 'release' && lastInput) {\n if (this.release === 'hold' && sameVector(this.value, lastInput)) this.#queueFeedback(lastInput, 'position');\n else if (this.release !== 'hold' && sameVector(this.value, { x: 0, y: 0 }))\n this.#queueFeedback(lastInput, 'return');\n } else {\n this.#clearFeedback();\n }\n }\n\n #describePosition(value: JoystickValue | undefined): string {\n if (!value) return this.i18n.joystickNoPosition ?? i18nDefaults.joystickNoPosition;\n let formatter: Intl.NumberFormat;\n const options = { maximumFractionDigits: 6, useGrouping: false };\n try {\n formatter = new Intl.NumberFormat(globalThis.document?.documentElement.lang || undefined, options);\n } catch {\n formatter = new Intl.NumberFormat(undefined, options);\n }\n const format = (number: number) => formatter.format(Number(number.toFixed(6)) || 0);\n return (this.i18n.joystickPosition ?? '').replaceAll('{x}', format(value.x)).replaceAll('{y}', format(value.y));\n }\n\n get #canAnnounce() {\n return (\n this.isConnected &&\n this.matches(':focus') &&\n !this.disabled &&\n !this.readOnly &&\n this.announce !== 'off' &&\n !globalThis.document.hidden\n );\n }\n\n #queueFeedback(value: JoystickValue, kind: 'position' | 'return') {\n if (!this.#canAnnounce) return;\n this.#pendingFeedback = { value, kind };\n if (this.#announcementTimer !== undefined) return;\n this.#announcementTimer = setTimeout(() => {\n this.#announcementTimer = undefined;\n const feedback = this.#pendingFeedback;\n this.#pendingFeedback = undefined;\n if (!feedback || !this.#canAnnounce) return;\n const position = this.#describePosition(feedback.value);\n const message =\n feedback.kind === 'return' ? this.i18n.joystickReturnedToCenter?.replaceAll('{position}', position) : position;\n if (!message || message === this.#announcement) return;\n this.#announcement = message;\n this.requestUpdate();\n }, 500);\n }\n\n #clearFeedback() {\n clearTimeout(this.#announcementTimer);\n this.#announcementTimer = undefined;\n this.#pendingFeedback = undefined;\n if (this.#announcement) {\n this.#announcement = '';\n this.requestUpdate();\n }\n }\n\n #releasePointer(pointerId: number | undefined) {\n if (pointerId === undefined) return;\n if (this.hasPointerCapture(pointerId)) this.releasePointerCapture(pointerId);\n this.#gestureController.target = undefined;\n if (this.isConnected && this.hasUpdated) this.#gestureController.target = this;\n }\n\n #checkAvailability() {\n if (this.disabled || this.readOnly) {\n this.#end(this.disabled ? 'disabled' : 'readonly');\n this.#clearFeedback();\n }\n }\n\n #movePointer(event: PointerEvent) {\n const bounds = this.shadowRoot?.querySelector('.travel')?.getBoundingClientRect();\n if (!bounds || bounds.width <= 0 || bounds.height <= 0) return;\n this.#input(\n this.#constrain({\n x: ((event.clientX - bounds.left) / bounds.width) * 2 - 1,\n y: ((event.clientY - bounds.top) / bounds.height) * 2 - 1\n })\n );\n }\n\n #handleGestureInput = (event: Event) => {\n if (!(event instanceof CustomEvent)) return;\n const input: GestureInput = event.detail;\n this.#checkAvailability();\n if (input.kind === 'pointerdown') {\n this.#startPointer(input);\n } else if (input.kind === 'pointerend' && this.#session?.pointerId === input.event.pointerId) {\n if (!input.interrupted) this.#movePointer(input.event);\n this.#end(input.interrupted ? (input.reason === 'cancel' ? 'pointer-cancel' : 'lost-capture') : 'release');\n }\n };\n\n #startPointer(input: Extract<GestureInput, { kind: 'pointerdown' }>) {\n if (!this.hasUpdated || this.disabled || this.readOnly || this.#session || input.event.button !== 0) return;\n if (!input.claim({ kind: 'drag' })) return;\n input.event.preventDefault();\n // Touch controls can operate together without transferring keyboard focus.\n if (input.event.pointerType !== 'touch') this.focus({ preventScroll: true });\n this.#begin({ source: 'pointer', pointerId: input.event.pointerId, changed: false });\n if (this.#session) this.#movePointer(input.event);\n }\n\n #handleGesture = (event: Event) => {\n if (!(event instanceof CustomEvent)) return;\n const gesture: Gesture<undefined> = event.detail;\n this.#checkAvailability();\n if (gesture.kind === 'drag' && this.#session?.pointerId === gesture.event.pointerId) {\n this.#movePointer(gesture.event);\n }\n };\n\n #handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Escape' && this.#session) {\n event.preventDefault();\n this.#end('escape');\n return;\n }\n const direction = directions[event.key];\n if (!direction || !this.#acceptKey(event, direction)) return;\n event.preventDefault();\n this.#keys.add(event.key);\n if (!this.#session) this.#begin({ source: 'keyboard', changed: false });\n if (!this.#session) return;\n this.#moveKey(direction);\n };\n\n #moveKey(direction: JoystickValue) {\n const step = this.#step;\n const value = this.value ?? { x: 0, y: 0 };\n this.#input(\n this.#constrain({\n x: Number((value.x + direction.x * step).toFixed(6)),\n y: Number((value.y + direction.y * step).toFixed(6))\n })\n );\n }\n\n get #step() {\n return Number.isFinite(this.keyboardStep) && this.keyboardStep > 0 && this.keyboardStep <= 1\n ? this.keyboardStep\n : 0.1;\n }\n\n #acceptKey(event: KeyboardEvent, direction: JoystickValue) {\n if (event.altKey || event.ctrlKey || event.metaKey || this.disabled || this.readOnly) return false;\n if (this.#session?.source === 'pointer') return false;\n if (this.constraint === 'horizontal') return direction.y === 0;\n if (this.constraint === 'vertical') return direction.x === 0;\n return true;\n }\n\n #handleKeyUp = (event: KeyboardEvent) => {\n if (this.#session?.source !== 'keyboard' || !this.#keys.delete(event.key)) return;\n event.preventDefault();\n if (!this.#keys.size) this.#end('release');\n };\n\n #handleBlur = () => {\n this.#checkAvailability();\n this.#end('blur');\n this.#clearFeedback();\n };\n #handleVisibility = () => {\n if (globalThis.document.hidden) {\n this.#end('hidden');\n this.#clearFeedback();\n }\n };\n}\n\nfunction isVector(value: unknown): value is JoystickValue {\n return (\n typeof value === 'object' &&\n value !== null &&\n 'x' in value &&\n 'y' in value &&\n typeof value.x === 'number' &&\n typeof value.y === 'number' &&\n Number.isFinite(value.x) &&\n Number.isFinite(value.y) &&\n Object.keys(value).length === 2\n );\n}\n\nfunction sameVector(first: JoystickValue | undefined, second: JoystickValue): boolean {\n return first !== undefined && Math.abs(first.x - second.x) < 1e-12 && Math.abs(first.y - second.y) < 1e-12;\n}\n"],"mappings":";;;;;;;;;;AA8CA,IAAM,IAAe;CACnB,kBAAkB;CAClB,oBAAoB;CACpB,sBACE;CACF,0BACE;CACF,0BAA0B;AAC5B,GAEM,IAA4C;CAChD,WAAW;EAAE,GAAG;EAAI,GAAG;CAAE;CACzB,YAAY;EAAE,GAAG;EAAG,GAAG;CAAE;CACzB,SAAS;EAAE,GAAG;EAAG,GAAG;CAAG;CACvB,WAAW;EAAE,GAAG;EAAG,GAAG;CAAE;AAC1B,GAoCa,IAAb,cAA8B,EAAmD,CAAU,CAAC,CAAC;;EAC3E,KAAA,SAAA,EAAU,CAAC,CAAM,CAAC;;;EAEP,KAAA,WAAA;GACzB,KAAK;GACL,SAAS;GACT,aAAa;IACX,MAAM;IACN,YAAY;KACV,GAAG;MAAE,MAAM;MAAmB,SAAS;MAAI,SAAS;KAAE;KACtD,GAAG;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GAAA,EAAA,WAAA,QAAA,KAAA,CAAA;AAwa5B,SAAS,EAAS,GAAwC;CACxD,OACE,OAAO,KAAU,cACjB,KACA,OAAO,KACP,OAAO,KACP,OAAO,EAAM,KAAM,YACnB,OAAO,EAAM,KAAM,YACnB,OAAO,SAAS,EAAM,CAAC,KACvB,OAAO,SAAS,EAAM,CAAC,KACvB,OAAO,KAAK,CAAK,CAAC,CAAC,WAAW;AAElC;AAEA,SAAS,EAAW,GAAkC,GAAgC;CACpF,OAAO,MAAU,KAAA,KAAa,KAAK,IAAI,EAAM,IAAI,EAAO,CAAC,IAAI,SAAS,KAAK,IAAI,EAAM,IAAI,EAAO,CAAC,IAAI;AACvG"}
|
package/dist/logo/logo2.js
CHANGED
package/dist/menu/menu-group2.js
CHANGED
package/dist/menu/menu-item2.js
CHANGED
package/dist/menu/menu2.js
CHANGED
package/dist/month/month.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ContainerElement } from '@nvidia-elements/core/internal';
|
|
2
2
|
import { Control } from '@nvidia-elements/core/forms';
|
|
3
3
|
import { IconButton } from '@nvidia-elements/core/icon-button';
|
|
4
|
+
import type { I18nDefaults } from '@nvidia-elements/foundations/internal/i18n';
|
|
4
5
|
/**
|
|
5
6
|
* @element nve-month
|
|
6
7
|
* @description A month picker is a control that enables users to choose a month value.
|
|
@@ -18,6 +19,7 @@ import { IconButton } from '@nvidia-elements/core/icon-button';
|
|
|
18
19
|
* @aria https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/month
|
|
19
20
|
*/
|
|
20
21
|
export declare class Month extends Control implements ContainerElement {
|
|
22
|
+
protected get i18nDefaults(): I18nDefaults;
|
|
21
23
|
/**
|
|
22
24
|
* Reduces the visual container for a minimal borderless appearance while preserving whitespace bounds.
|
|
23
25
|
* Use when embedding within another container such as a toolbar.
|