@fusion.dev/helix-core 0.177.1 → 0.177.2
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/custom-elements.json
CHANGED
|
@@ -21390,7 +21390,7 @@
|
|
|
21390
21390
|
"kind": "field",
|
|
21391
21391
|
"name": "handleTriggerClick",
|
|
21392
21392
|
"type": {
|
|
21393
|
-
"text": "() => void"
|
|
21393
|
+
"text": "(event?: Event) => void"
|
|
21394
21394
|
},
|
|
21395
21395
|
"privacy": "protected",
|
|
21396
21396
|
"readonly": true,
|
|
@@ -21648,6 +21648,17 @@
|
|
|
21648
21648
|
"readonly": true,
|
|
21649
21649
|
"description": "Escape and Tab pressed inside the panel, which `handleKeydown` never\nhears.\n\nA family binds `handleKeydown` on the field, and the surface is the\nfield's sibling, so a key pressed in the grid or the list went past it to\nthe document, where the dismissal closed the panel and left focus on a\ncell that was no longer shown. Measured: focus fell to the body. Here the\nkey is taken on the host, and focus goes back to the text.\n\n**Tab stays in the panel**, which is the APG date picker dialog and\nReact Aria's popover: the panel is a dialog, so Tab from its last control\ngoes to its first and Shift+Tab from its first goes to its last. Tab from\nthe grid left the dialog for the page behind it while the dialog stayed\nopen. Escape, a pick, or a press outside leaves it."
|
|
21650
21650
|
},
|
|
21651
|
+
{
|
|
21652
|
+
"kind": "method",
|
|
21653
|
+
"name": "dismiss",
|
|
21654
|
+
"privacy": "private",
|
|
21655
|
+
"return": {
|
|
21656
|
+
"type": {
|
|
21657
|
+
"text": "void"
|
|
21658
|
+
}
|
|
21659
|
+
},
|
|
21660
|
+
"description": "Escape's close, which hands focus back to the control that opened the\npanel: the trigger after its press, which is the APG date picker\ndialog's rule, and the field otherwise.\n\n**Here rather than in each family.** Color Input had the rule alone, and\nDate Input and Time Input, on the same code, put focus in the text after\nthe trigger's press: one control before where the reader had been."
|
|
21661
|
+
},
|
|
21651
21662
|
{
|
|
21652
21663
|
"kind": "field",
|
|
21653
21664
|
"name": "handleFocusOut",
|
|
@@ -21672,6 +21683,16 @@
|
|
|
21672
21683
|
"default": "false",
|
|
21673
21684
|
"description": "Whether the trigger opened the panel, so focus moves into the picker."
|
|
21674
21685
|
},
|
|
21686
|
+
{
|
|
21687
|
+
"kind": "field",
|
|
21688
|
+
"name": "pressedOpen",
|
|
21689
|
+
"type": {
|
|
21690
|
+
"text": "boolean"
|
|
21691
|
+
},
|
|
21692
|
+
"privacy": "private",
|
|
21693
|
+
"default": "false",
|
|
21694
|
+
"description": "Whether the trigger's press opened the panel that is open now, so Escape returns there."
|
|
21695
|
+
},
|
|
21675
21696
|
{
|
|
21676
21697
|
"kind": "field",
|
|
21677
21698
|
"name": "handleKeypress",
|
|
@@ -33958,7 +33979,7 @@
|
|
|
33958
33979
|
"type": {
|
|
33959
33980
|
"text": "string"
|
|
33960
33981
|
},
|
|
33961
|
-
"default": "'0.177.
|
|
33982
|
+
"default": "'0.177.2'",
|
|
33962
33983
|
"description": "The version of the package this file ships in.\n\n**Written by `fusion/scripts/version.mjs`** wherever it writes the package's\n`package.json`, and stamped back into the repository beside it after a\nrelease, so the two never disagree; a spec beside this holds them to it.\nNothing else in the running code knows which release it is."
|
|
33963
33984
|
}
|
|
33964
33985
|
],
|
|
@@ -34594,6 +34615,6 @@
|
|
|
34594
34615
|
],
|
|
34595
34616
|
"helix": {
|
|
34596
34617
|
"package": "@fusion.dev/helix-core",
|
|
34597
|
-
"version": "0.177.
|
|
34618
|
+
"version": "0.177.2"
|
|
34598
34619
|
}
|
|
34599
34620
|
}
|
|
@@ -56,7 +56,7 @@ export declare class MixinPickerFieldInterface {
|
|
|
56
56
|
* The trigger's press: opens the panel with focus in the picker, or closes
|
|
57
57
|
* it.
|
|
58
58
|
*/
|
|
59
|
-
protected readonly handleTriggerClick: () => void;
|
|
59
|
+
protected readonly handleTriggerClick: (event?: Event) => void;
|
|
60
60
|
/** Enter in the text submits the form, as it does in a native text field. */
|
|
61
61
|
protected readonly handleKeypress: (event: KeyboardEvent) => void;
|
|
62
62
|
/**
|
|
@@ -30,8 +30,7 @@ export const MixinPickerField = (Base) => {
|
|
|
30
30
|
this.handleKeydown = (event) => {
|
|
31
31
|
if (event.key === 'Escape' && this.open) {
|
|
32
32
|
event.stopPropagation();
|
|
33
|
-
this.
|
|
34
|
-
this.returnFocus();
|
|
33
|
+
this.dismiss();
|
|
35
34
|
return;
|
|
36
35
|
}
|
|
37
36
|
const fromText = event.composedPath()[0] === this.control;
|
|
@@ -73,8 +72,7 @@ export const MixinPickerField = (Base) => {
|
|
|
73
72
|
}
|
|
74
73
|
event.stopPropagation();
|
|
75
74
|
event.preventDefault();
|
|
76
|
-
this.
|
|
77
|
-
this.returnFocus();
|
|
75
|
+
this.dismiss();
|
|
78
76
|
};
|
|
79
77
|
this.handleFocusOut = (event) => {
|
|
80
78
|
const to = event.relatedTarget;
|
|
@@ -91,14 +89,17 @@ export const MixinPickerField = (Base) => {
|
|
|
91
89
|
this.announceChange();
|
|
92
90
|
};
|
|
93
91
|
this.fromTrigger = false;
|
|
92
|
+
this.pressedOpen = false;
|
|
94
93
|
this.handleKeypress = (event) => {
|
|
95
94
|
if (event.key === 'Enter' && !event.defaultPrevented) {
|
|
96
95
|
submitImplicitly(this.form);
|
|
97
96
|
}
|
|
98
97
|
};
|
|
99
|
-
this.handleTriggerClick = () => {
|
|
100
|
-
|
|
98
|
+
this.handleTriggerClick = (event) => {
|
|
99
|
+
const opening = !this.open;
|
|
100
|
+
this.fromTrigger = opening;
|
|
101
101
|
this.toggleOpen();
|
|
102
|
+
this.pressedOpen = event !== undefined && opening && this.open;
|
|
102
103
|
};
|
|
103
104
|
this.returning = false;
|
|
104
105
|
}
|
|
@@ -147,6 +148,18 @@ export const MixinPickerField = (Base) => {
|
|
|
147
148
|
}
|
|
148
149
|
this.refreshFeedback();
|
|
149
150
|
}
|
|
151
|
+
dismiss() {
|
|
152
|
+
const trigger = this.pressedOpen ? this.partNamed('trigger') : null;
|
|
153
|
+
this.pressedOpen = false;
|
|
154
|
+
this.requestOpen(false);
|
|
155
|
+
if (trigger) {
|
|
156
|
+
this.returning = true;
|
|
157
|
+
trigger.focus();
|
|
158
|
+
this.returning = false;
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
this.returnFocus();
|
|
162
|
+
}
|
|
150
163
|
get blocksImplicitSubmission() {
|
|
151
164
|
return this.control !== null;
|
|
152
165
|
}
|
|
@@ -186,6 +199,9 @@ export const MixinPickerField = (Base) => {
|
|
|
186
199
|
this.partNamed('picker')?.focus();
|
|
187
200
|
}
|
|
188
201
|
this.fromTrigger = false;
|
|
202
|
+
if (!this.open) {
|
|
203
|
+
this.pressedOpen = false;
|
|
204
|
+
}
|
|
189
205
|
}
|
|
190
206
|
this.sync();
|
|
191
207
|
}
|
package/dist/version.d.ts
CHANGED
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.177.
|
|
1
|
+
export const VERSION = '0.177.2';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fusion.dev/helix-core",
|
|
3
3
|
"description": "Helix element primitives: base classes, mixins, decorators, utilities.",
|
|
4
|
-
"version": "0.177.
|
|
4
|
+
"version": "0.177.2",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Ross Sheppard <ross.sheppard@fusion.dev>",
|
|
7
7
|
"repository": {
|
|
@@ -68,11 +68,11 @@
|
|
|
68
68
|
"bugs": "https://github.com/project-fusion/fusion/issues",
|
|
69
69
|
"dependencies": {
|
|
70
70
|
"@floating-ui/dom": "^1.8.0",
|
|
71
|
-
"@fusion.dev/helix-icons": "0.177.
|
|
71
|
+
"@fusion.dev/helix-icons": "0.177.2"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
|
-
"@fusion.dev/helix-cem": "0.177.
|
|
75
|
-
"@fusion.dev/helix-testing": "0.177.
|
|
74
|
+
"@fusion.dev/helix-cem": "0.177.2",
|
|
75
|
+
"@fusion.dev/helix-testing": "0.177.2",
|
|
76
76
|
"@lit-labs/ssr": "^4.1.0",
|
|
77
77
|
"lit": "^3.2.1"
|
|
78
78
|
},
|