@fusion.dev/helix-core 0.182.1 → 0.182.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 +1109 -163
- package/dist/controllers/aria-forward-controller/aria-forward-controller.d.ts +4 -0
- package/dist/helix-element/helix-element.d.ts +11 -1
- package/dist/helix-element/helix-element.js +7 -6
- package/dist/helix-element/mark-rules.d.ts +119 -0
- package/dist/helix-element/mark-rules.js +4 -0
- package/dist/helix-form-element/helix-form-element-base.d.ts +264 -0
- package/dist/helix-form-element/helix-form-element-base.js +173 -0
- package/dist/helix-form-element/helix-form-element.d.ts +8 -226
- package/dist/helix-form-element/helix-form-element.js +2 -157
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/mixins/mixin-chart-source/mixin-chart-source.js +1 -6
- package/dist/mixins/mixin-chart-status/mixin-chart-status.js +1 -6
- package/dist/mixins/mixin-collection/mixin-collection.js +1 -6
- package/dist/mixins/mixin-controller-active/mixin-controller-active.js +1 -6
- package/dist/mixins/mixin-controller-checked/mixin-controller-checked.js +1 -6
- package/dist/mixins/mixin-controller-open/mixin-controller-open.js +1 -6
- package/dist/mixins/mixin-controller-value/mixin-controller-value.js +1 -6
- package/dist/mixins/mixin-dismissible/mixin-dismissible.js +1 -6
- package/dist/mixins/mixin-field/mixin-field.js +1 -6
- package/dist/mixins/mixin-picker-editing/mixin-picker-editing.js +1 -6
- package/dist/mixins/mixin-picker-feedback/mixin-picker-feedback.js +1 -6
- package/dist/mixins/mixin-picker-field/mixin-picker-field.js +1 -6
- package/dist/mixins/mixin-segmented-field/mixin-segmented-field.js +1 -6
- package/dist/mixins/mixin-selectable-item/mixin-selectable-item.js +1 -6
- package/dist/mixins/mixin-tokens/mixin-tokens.js +1 -6
- package/dist/mixins/mixin-viewport/mixin-viewport.js +1 -6
- package/dist/utils/audit-name/audit-name.d.ts +3 -3
- package/dist/utils/audit-name/audit-name.js +7 -2
- package/dist/utils/implicit-submit/implicit-submit.js +4 -4
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +5 -4
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
1
|
+
import { __decorate } from "tslib";
|
|
7
2
|
import { html, nothing } from 'lit';
|
|
8
3
|
import { property, state } from 'lit/decorators.js';
|
|
9
4
|
import { hostAria } from '../../utils/host-aria/host-aria.js';
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
1
|
+
import { __decorate } from "tslib";
|
|
7
2
|
import { property } from 'lit/decorators.js';
|
|
8
3
|
import { PopoverController } from '../../controllers/popover-controller/popover-controller.js';
|
|
9
4
|
import { submitImplicitly } from '../../utils/implicit-submit/implicit-submit.js';
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
1
|
+
import { __decorate } from "tslib";
|
|
7
2
|
import { html, nothing } from 'lit';
|
|
8
3
|
import { property, state } from 'lit/decorators.js';
|
|
9
4
|
import { isPartial, isTwelveHourLayout, segmentKey, segmentLayout, segmentName, segmentRange, segmentsOf, segmentsValue, segmentText, segmentValueText, shownValue, } from '../../utils/date-segments/date-segments.js';
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
1
|
+
import { __decorate } from "tslib";
|
|
7
2
|
import { property } from 'lit/decorators.js';
|
|
8
3
|
import { HelixSelectEvent } from '../../events/events.js';
|
|
9
4
|
export const MixinSelectableItem = (Base) => {
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
1
|
+
import { __decorate } from "tslib";
|
|
7
2
|
import { caretUp } from '@fusion.dev/helix-icons';
|
|
8
3
|
import { html, nothing } from 'lit';
|
|
9
4
|
import { property, state } from 'lit/decorators.js';
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
1
|
+
import { __decorate } from "tslib";
|
|
7
2
|
import { html, nothing } from 'lit';
|
|
8
3
|
import { property, state } from 'lit/decorators.js';
|
|
9
4
|
import { FullscreenController } from '../../controllers/fullscreen-controller/fullscreen-controller.js';
|
|
@@ -43,8 +43,8 @@ export declare const hasName: (element: HTMLElement, shown?: Element | null) =>
|
|
|
43
43
|
* read: the host is then read again the next time it asks.
|
|
44
44
|
*
|
|
45
45
|
* `also` answers for a name the component gave through its internals, which no
|
|
46
|
-
* attribute shows. `fix` is the sentence that says how to name it
|
|
47
|
-
* the part where the control shows its value or its
|
|
48
|
-
* are no name.
|
|
46
|
+
* attribute shows. `fix` is the sentence that says how to name it, or its key
|
|
47
|
+
* in `FIXES`. `shown` is the part where the control shows its value or its
|
|
48
|
+
* placeholder, whose words are no name.
|
|
49
49
|
*/
|
|
50
50
|
export declare const auditName: (host: HTMLElement, control: () => HTMLElement | null | undefined, fix: string, also?: () => boolean, shown?: () => Element | null) => void;
|
|
@@ -49,6 +49,10 @@ const implicitRole = (element) => {
|
|
|
49
49
|
}
|
|
50
50
|
return element.localName === 'a' && element.hasAttribute('href') ? 'link' : '';
|
|
51
51
|
};
|
|
52
|
+
const FIXES = new Map([
|
|
53
|
+
['button', 'Give it words, a `label`, or an `aria-label`.'],
|
|
54
|
+
['virtual-list', 'Give it a `label`, or an `aria-label` that says what the items are.'],
|
|
55
|
+
]);
|
|
52
56
|
const audited = new WeakSet();
|
|
53
57
|
const waiting = new Map();
|
|
54
58
|
const readWaiting = () => {
|
|
@@ -79,11 +83,12 @@ export const auditName = (host, control, fix, also, shown) => {
|
|
|
79
83
|
return;
|
|
80
84
|
}
|
|
81
85
|
const placeholder = [host, inner].some((one) => one?.getAttribute('placeholder')?.trim());
|
|
86
|
+
const sentence = FIXES.get(fix) ?? fix;
|
|
82
87
|
reportRuntime({
|
|
83
88
|
kind: 'missing-name',
|
|
84
89
|
message: placeholder
|
|
85
|
-
? `<${host.localName}> is named only by its placeholder, which is gone once a person types. ${
|
|
86
|
-
: `<${host.localName}> has no accessible name, so a screen reader announces it by its role alone. ${
|
|
90
|
+
? `<${host.localName}> is named only by its placeholder, which is gone once a person types. ${sentence}`
|
|
91
|
+
: `<${host.localName}> has no accessible name, so a screen reader announces it by its role alone. ${sentence}`,
|
|
87
92
|
tag: host.localName,
|
|
88
93
|
});
|
|
89
94
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { HelixFormElementBase } from '../../helix-form-element/helix-form-element-base.js';
|
|
2
2
|
const BLOCKING_TYPES = new Set([
|
|
3
3
|
'date',
|
|
4
4
|
'datetime-local',
|
|
@@ -15,7 +15,7 @@ const BLOCKING_TYPES = new Set([
|
|
|
15
15
|
]);
|
|
16
16
|
const hooks = (element) => element;
|
|
17
17
|
export const submits = (element) => {
|
|
18
|
-
if (element instanceof
|
|
18
|
+
if (element instanceof HelixFormElementBase) {
|
|
19
19
|
return hooks(element).submitsForm;
|
|
20
20
|
}
|
|
21
21
|
if (element instanceof HTMLButtonElement) {
|
|
@@ -34,7 +34,7 @@ export const submitImplicitly = (form) => {
|
|
|
34
34
|
if (button.matches(':disabled')) {
|
|
35
35
|
return;
|
|
36
36
|
}
|
|
37
|
-
if (button instanceof
|
|
37
|
+
if (button instanceof HelixFormElementBase) {
|
|
38
38
|
hooks(button).activate();
|
|
39
39
|
}
|
|
40
40
|
else {
|
|
@@ -43,7 +43,7 @@ export const submitImplicitly = (form) => {
|
|
|
43
43
|
}
|
|
44
44
|
return;
|
|
45
45
|
}
|
|
46
|
-
const blocking = [...form.elements].filter((element) => element instanceof
|
|
46
|
+
const blocking = [...form.elements].filter((element) => element instanceof HelixFormElementBase
|
|
47
47
|
? hooks(element).blocksImplicitSubmission
|
|
48
48
|
: element instanceof HTMLInputElement && BLOCKING_TYPES.has(element.type));
|
|
49
49
|
if (blocking.length <= 1) {
|
package/dist/version.d.ts
CHANGED
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.182.
|
|
1
|
+
export const VERSION = '0.182.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.182.
|
|
4
|
+
"version": "0.182.2",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Ross Sheppard <ross.sheppard@fusion.dev>",
|
|
7
7
|
"repository": {
|
|
@@ -74,11 +74,12 @@
|
|
|
74
74
|
"bugs": "https://github.com/project-fusion/fusion/issues",
|
|
75
75
|
"dependencies": {
|
|
76
76
|
"@floating-ui/dom": "^1.8.0",
|
|
77
|
-
"@fusion.dev/helix-icons": "0.182.
|
|
77
|
+
"@fusion.dev/helix-icons": "0.182.2",
|
|
78
|
+
"tslib": "^2.8.1"
|
|
78
79
|
},
|
|
79
80
|
"devDependencies": {
|
|
80
|
-
"@fusion.dev/helix-cem": "0.182.
|
|
81
|
-
"@fusion.dev/helix-testing": "0.182.
|
|
81
|
+
"@fusion.dev/helix-cem": "0.182.2",
|
|
82
|
+
"@fusion.dev/helix-testing": "0.182.2",
|
|
82
83
|
"@lit-labs/ssr": "^4.1.0",
|
|
83
84
|
"lit": "^3.2.1"
|
|
84
85
|
},
|