@nvidia-elements/core 2.19.1 → 2.20.1
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 +15 -0
- package/dist/accordion/accordion2.js +4 -4
- package/dist/alert/alert-group2.js +1 -1
- package/dist/alert/alert2.js +1 -1
- package/dist/avatar/avatar-group2.js +1 -1
- package/dist/avatar/avatar2.js +1 -1
- package/dist/badge/badge2.js +1 -1
- package/dist/breadcrumb/breadcrumb2.js +1 -1
- package/dist/bundle.d.ts +2 -0
- package/dist/bundles/index.d.ts +128 -0
- package/dist/bundles/index.js +6 -6
- 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/color2.js +1 -1
- package/dist/combobox/combobox2.js +1 -1
- package/dist/copy-button/copy-button2.js +1 -1
- package/dist/custom-elements-jsx.d.ts +166 -0
- package/dist/custom-elements-vue.d.ts +160 -0
- package/dist/custom-elements.json +1586 -403
- package/dist/data.html.json +117 -0
- package/dist/data.snippets.json +27 -27
- package/dist/date/date2.js +1 -1
- package/dist/datetime/datetime2.js +1 -1
- package/dist/dialog/dialog-footer2.js +1 -1
- package/dist/dialog/dialog-header2.js +1 -1
- package/dist/dialog/dialog2.js +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 +1 -1
- package/dist/dropdown/dropdown-footer2.js +1 -1
- package/dist/dropdown/dropdown-header2.js +1 -1
- package/dist/dropdown/dropdown2.js +1 -1
- package/dist/dropdown-group/dropdown-group.js +1 -1
- package/dist/dropzone/dropzone2.js +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/control2.js +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 +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 +1 -1
- package/dist/input/input-group2.js +1 -1
- package/dist/input/input2.js +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/month2.js +1 -1
- package/dist/notification/notification-group2.js +1 -1
- package/dist/notification/notification2.js +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-panel2.js +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 +1 -1
- package/dist/panel/panel2.js +4 -4
- package/dist/password/password2.js +1 -1
- package/dist/polyfills/index.d.ts +0 -1
- package/dist/polyfills/index.js.map +1 -1
- package/dist/preferences-input/preferences-input2.js +1 -1
- package/dist/progress-bar/progress-bar2.js +1 -1
- package/dist/progress-dot/progress-dot2.js +1 -1
- package/dist/progress-ring/progress-ring2.js +1 -1
- package/dist/progressive-filter-chip/progressive-filter-chip2.js +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 +1 -1
- package/dist/search/search2.js +1 -1
- package/dist/select/select2.js +1 -1
- package/dist/skeleton/skeleton2.js +1 -1
- package/dist/sort-button/sort-button2.js +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 +1 -1
- package/dist/textarea/textarea2.js +1 -1
- package/dist/time/time2.js +1 -1
- package/dist/toast/toast2.js +1 -1
- package/dist/toggletip/toggletip-footer2.js +1 -1
- package/dist/toggletip/toggletip-header2.js +1 -1
- package/dist/toggletip/toggletip2.js +1 -1
- package/dist/toolbar/toolbar2.js +1 -1
- package/dist/tooltip/tooltip2.js +1 -1
- package/dist/tree/tree-node2.js +1 -1
- package/dist/tree/tree2.js +1 -1
- package/dist/week/week2.js +1 -1
- package/package.json +14 -7
- package/dist/polyfills/custom-state-set.d.ts +0 -17
- package/dist/polyfills/custom-state-set.js +0 -49
- package/dist/polyfills/custom-state-set.js.map +0 -1
|
@@ -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.1",
|
|
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;MAAE,MAAM;MAAmB,SAAS;MAAI,SAAS;KAAE;IACxD;IACA,UAAU,CAAC,KAAK,GAAG;IACnB,sBAAsB;GACxB;EACF;;CAuCA;CAKA;CACA;CACA;CACA;CACA;CAE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B,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/month2.js
CHANGED
package/dist/page/page2.js
CHANGED
package/dist/panel/panel2.js
CHANGED
|
@@ -26,7 +26,7 @@ var g = {
|
|
|
26
26
|
static {
|
|
27
27
|
this.metadata = {
|
|
28
28
|
tag: "nve-panel-header",
|
|
29
|
-
version: "2.
|
|
29
|
+
version: "2.20.1"
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
32
|
render() {
|
|
@@ -42,7 +42,7 @@ var g = {
|
|
|
42
42
|
static {
|
|
43
43
|
this.metadata = {
|
|
44
44
|
tag: "nve-panel-content",
|
|
45
|
-
version: "2.
|
|
45
|
+
version: "2.20.1"
|
|
46
46
|
};
|
|
47
47
|
}
|
|
48
48
|
render() {
|
|
@@ -55,7 +55,7 @@ var g = {
|
|
|
55
55
|
static {
|
|
56
56
|
this.metadata = {
|
|
57
57
|
tag: "nve-panel-footer",
|
|
58
|
-
version: "2.
|
|
58
|
+
version: "2.20.1"
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
61
|
render() {
|
|
@@ -74,7 +74,7 @@ var g = {
|
|
|
74
74
|
static {
|
|
75
75
|
this.metadata = {
|
|
76
76
|
tag: "nve-panel",
|
|
77
|
-
version: "2.
|
|
77
|
+
version: "2.20.1"
|
|
78
78
|
};
|
|
79
79
|
}
|
|
80
80
|
static {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/polyfills/index.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * - Vitest (happy-dom/js-dom)\n * - Safari\n *\n * Used for Custom Elements Form/A11y APIs\n * https://github.com/whatwg/html/pull/8467\n * https://bugs.webkit.org/show_bug.cgi?id=215911\n * https://bugzilla.mozilla.org/show_bug.cgi?id=1588763\n */\nimport 'construct-style-sheets-polyfill';\nimport 'element-internals-polyfill';\nimport 'formdata-polyfill';\
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/polyfills/index.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * - Vitest (happy-dom/js-dom)\n * - Safari\n *\n * Used for Custom Elements Form/A11y APIs\n * https://github.com/whatwg/html/pull/8467\n * https://bugs.webkit.org/show_bug.cgi?id=215911\n * https://bugzilla.mozilla.org/show_bug.cgi?id=1588763\n */\nimport 'construct-style-sheets-polyfill';\nimport 'element-internals-polyfill';\nimport 'formdata-polyfill';\n\n/**\n * https://developer.mozilla.org/en-US/docs/Web/API/Element/toggleAttribute\n * - Vitest (happy-dom/js-dom)\n * - Safari\n *\n * Used in element-internals-polyfill\n */\nif (!Element.prototype.toggleAttribute) {\n Element.prototype.toggleAttribute = function (name, force) {\n const forceBool = force !== void 0 ? force : undefined;\n\n if (this.hasAttribute(name)) {\n if (forceBool) {\n return true;\n }\n\n this.removeAttribute(name);\n return false;\n }\n if (forceBool === false) {\n return false;\n }\n\n this.setAttribute(name, '');\n return true;\n };\n}\n"],"mappings":";;;;AAuBK,QAAQ,UAAU,oBACrB,QAAQ,UAAU,kBAAkB,SAAU,GAAM,GAAO;CACzD,IAAM,IAAY,MAAU,KAAK,IAAY,KAAA,IAAR;CAerC,OAbI,KAAK,aAAa,CAAI,IACpB,IACK,MAGT,KAAK,gBAAgB,CAAI,GAClB,MAEL,MAAc,OAIlB,KAAK,aAAa,GAAM,EAAE,GACnB;AACT"}
|