@fusion.dev/helix-core 0.0.0-dev
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/LICENSE +21 -0
- package/custom-elements.json +8005 -0
- package/dist/controllers/aria-forward-controller/aria-forward-controller.d.ts +67 -0
- package/dist/controllers/aria-forward-controller/aria-forward-controller.js +146 -0
- package/dist/controllers/chart-pointer-controller/chart-pointer-controller.d.ts +79 -0
- package/dist/controllers/chart-pointer-controller/chart-pointer-controller.js +140 -0
- package/dist/controllers/command-controller/command-controller.d.ts +83 -0
- package/dist/controllers/command-controller/command-controller.js +93 -0
- package/dist/controllers/copy-controller/copy-controller.d.ts +58 -0
- package/dist/controllers/copy-controller/copy-controller.js +128 -0
- package/dist/controllers/disabled-cascade-controller/disabled-cascade-controller.d.ts +76 -0
- package/dist/controllers/disabled-cascade-controller/disabled-cascade-controller.js +67 -0
- package/dist/controllers/dismiss-controller/dismiss-controller.d.ts +58 -0
- package/dist/controllers/dismiss-controller/dismiss-controller.js +165 -0
- package/dist/controllers/drilldown-controller/drilldown-controller.d.ts +127 -0
- package/dist/controllers/drilldown-controller/drilldown-controller.js +171 -0
- package/dist/controllers/floating-controller/floating-controller.d.ts +123 -0
- package/dist/controllers/floating-controller/floating-controller.js +227 -0
- package/dist/controllers/focus-trap-controller/focus-trap-controller.d.ts +26 -0
- package/dist/controllers/focus-trap-controller/focus-trap-controller.js +93 -0
- package/dist/controllers/indicator-controller/indicator-controller.d.ts +97 -0
- package/dist/controllers/indicator-controller/indicator-controller.js +164 -0
- package/dist/controllers/keyboard-navigation-controller/keyboard-navigation-controller.d.ts +113 -0
- package/dist/controllers/keyboard-navigation-controller/keyboard-navigation-controller.js +117 -0
- package/dist/controllers/popover-controller/popover-controller.d.ts +132 -0
- package/dist/controllers/popover-controller/popover-controller.js +150 -0
- package/dist/controllers/source-controller/source-controller.d.ts +55 -0
- package/dist/controllers/source-controller/source-controller.js +94 -0
- package/dist/controllers/token-color-controller/token-color-controller.d.ts +63 -0
- package/dist/controllers/token-color-controller/token-color-controller.js +105 -0
- package/dist/controllers/virtualize-controller/virtualize-controller.d.ts +127 -0
- package/dist/controllers/virtualize-controller/virtualize-controller.js +216 -0
- package/dist/events/element-events.d.ts +4 -0
- package/dist/events/element-events.js +34 -0
- package/dist/events/events.d.ts +743 -0
- package/dist/events/events.js +799 -0
- package/dist/helix-element/helix-element.d.ts +201 -0
- package/dist/helix-element/helix-element.js +695 -0
- package/dist/helix-form-element/helix-form-element.d.ts +152 -0
- package/dist/helix-form-element/helix-form-element.js +194 -0
- package/dist/index.d.ts +54 -0
- package/dist/index.js +54 -0
- package/dist/mixins/mixin-chart-source/mixin-chart-source.d.ts +137 -0
- package/dist/mixins/mixin-chart-source/mixin-chart-source.js +140 -0
- package/dist/mixins/mixin-collection/index.d.ts +1 -0
- package/dist/mixins/mixin-collection/index.js +1 -0
- package/dist/mixins/mixin-collection/mixin-collection.d.ts +58 -0
- package/dist/mixins/mixin-collection/mixin-collection.js +154 -0
- package/dist/mixins/mixin-controller-active/mixin-controller-active.d.ts +53 -0
- package/dist/mixins/mixin-controller-active/mixin-controller-active.js +155 -0
- package/dist/mixins/mixin-controller-checked/mixin-controller-checked.d.ts +54 -0
- package/dist/mixins/mixin-controller-checked/mixin-controller-checked.js +157 -0
- package/dist/mixins/mixin-controller-open/mixin-controller-open.d.ts +49 -0
- package/dist/mixins/mixin-controller-open/mixin-controller-open.js +176 -0
- package/dist/mixins/mixin-controller-value/mixin-controller-value.d.ts +73 -0
- package/dist/mixins/mixin-controller-value/mixin-controller-value.js +173 -0
- package/dist/mixins/mixin-dismissible/mixin-dismissible.d.ts +41 -0
- package/dist/mixins/mixin-dismissible/mixin-dismissible.js +79 -0
- package/dist/mixins/mixin-field/mixin-field.d.ts +145 -0
- package/dist/mixins/mixin-field/mixin-field.js +423 -0
- package/dist/utils/anchor-element/anchor-element.d.ts +23 -0
- package/dist/utils/anchor-element/anchor-element.js +39 -0
- package/dist/utils/capture-pointer/capture-pointer.d.ts +22 -0
- package/dist/utils/capture-pointer/capture-pointer.js +30 -0
- package/dist/utils/closest-instance/closest-instance.d.ts +25 -0
- package/dist/utils/closest-instance/closest-instance.js +34 -0
- package/dist/utils/create-sheet/create-sheet.d.ts +16 -0
- package/dist/utils/create-sheet/create-sheet.js +16 -0
- package/dist/utils/custom-element/custom-element.d.ts +26 -0
- package/dist/utils/custom-element/custom-element.js +114 -0
- package/dist/utils/draw-icon/draw-icon.d.ts +38 -0
- package/dist/utils/draw-icon/draw-icon.js +39 -0
- package/dist/utils/draw-tooltip/draw-tooltip.d.ts +56 -0
- package/dist/utils/draw-tooltip/draw-tooltip.js +89 -0
- package/dist/utils/elapsed-time/elapsed-time.d.ts +10 -0
- package/dist/utils/elapsed-time/elapsed-time.js +117 -0
- package/dist/utils/focusable-elements/focusable-elements.d.ts +40 -0
- package/dist/utils/focusable-elements/focusable-elements.js +88 -0
- package/dist/utils/format-numbers/format-numbers.d.ts +1 -0
- package/dist/utils/format-numbers/format-numbers.js +29 -0
- package/dist/utils/host-aria/host-aria.d.ts +38 -0
- package/dist/utils/host-aria/host-aria.js +41 -0
- package/dist/utils/inherit-disabled/inherit-disabled.d.ts +33 -0
- package/dist/utils/inherit-disabled/inherit-disabled.js +55 -0
- package/dist/utils/line-path/line-path.d.ts +23 -0
- package/dist/utils/line-path/line-path.js +107 -0
- package/dist/utils/on-unless-false/on-unless-false.d.ts +28 -0
- package/dist/utils/on-unless-false/on-unless-false.js +32 -0
- package/dist/utils/read-series/read-series.d.ts +78 -0
- package/dist/utils/read-series/read-series.js +187 -0
- package/dist/utils/relative-time/relative-time.d.ts +24 -0
- package/dist/utils/relative-time/relative-time.js +84 -0
- package/dist/utils/request-change/request-change.d.ts +48 -0
- package/dist/utils/request-change/request-change.js +7 -0
- package/dist/utils/resolve-active-item/resolve-active-item.d.ts +28 -0
- package/dist/utils/resolve-active-item/resolve-active-item.js +21 -0
- package/dist/utils/restore-value/restore-value.d.ts +32 -0
- package/dist/utils/restore-value/restore-value.js +84 -0
- package/dist/utils/scale/scale.d.ts +23 -0
- package/dist/utils/scale/scale.js +32 -0
- package/dist/utils/scale/ticks.d.ts +27 -0
- package/dist/utils/scale/ticks.js +52 -0
- package/dist/utils/scroll-item-into-view/scroll-item-into-view.d.ts +10 -0
- package/dist/utils/scroll-item-into-view/scroll-item-into-view.js +98 -0
- package/dist/utils/slot-filled/slot-filled.d.ts +26 -0
- package/dist/utils/slot-filled/slot-filled.js +26 -0
- package/dist/utils/tell-disclosure/tell-disclosure.d.ts +51 -0
- package/dist/utils/tell-disclosure/tell-disclosure.js +76 -0
- package/dist/utils/ticker/ticker.d.ts +8 -0
- package/dist/utils/ticker/ticker.js +55 -0
- package/dist/utils/tone-marks/tone-marks.d.ts +52 -0
- package/dist/utils/tone-marks/tone-marks.js +36 -0
- package/dist/utils/value-as/value-as.d.ts +64 -0
- package/dist/utils/value-as/value-as.js +105 -0
- package/package.json +58 -0
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import type { PropertyValues } from 'lit';
|
|
2
|
+
import { HelixElement } from '../helix-element/helix-element.js';
|
|
3
|
+
/**
|
|
4
|
+
* @summary Base for every element that participates in a form.
|
|
5
|
+
*
|
|
6
|
+
* @description
|
|
7
|
+
* This has to be a class rather than a mixin or controller, and that is not a
|
|
8
|
+
* style preference: the browser reads `formAssociated` off the constructor
|
|
9
|
+
* during element upgrade, which cannot be delegated to a composed object.
|
|
10
|
+
*
|
|
11
|
+
* `internals` comes from `HelixElement`, which attaches it for every component.
|
|
12
|
+
* `attachInternals()` throws on a second call, so there is exactly one owner.
|
|
13
|
+
*
|
|
14
|
+
* Deliberately small. It carries what every form participant needs and nothing
|
|
15
|
+
* more; `value`, validity, and the reset and restore callbacks land when the
|
|
16
|
+
* first input does, rather than being designed against components that do not
|
|
17
|
+
* exist yet.
|
|
18
|
+
*
|
|
19
|
+
* @since 0.1.0
|
|
20
|
+
* @status experimental
|
|
21
|
+
* @documentation https://helix.fusion.dev/core/form-element
|
|
22
|
+
*/
|
|
23
|
+
export declare class HelixFormElement extends HelixElement {
|
|
24
|
+
/** Opts the element into form ownership, labels, and submission. */
|
|
25
|
+
static readonly formAssociated = true;
|
|
26
|
+
/**
|
|
27
|
+
* Whether the control is non-interactive.
|
|
28
|
+
*
|
|
29
|
+
* Reflected, because the styled tier selects on it, and mirrored to
|
|
30
|
+
* `aria-disabled` rather than removing the element from the accessibility
|
|
31
|
+
* tree, so a screen reader can still announce that the control exists.
|
|
32
|
+
*
|
|
33
|
+
* The mirror is below and was for a while only a sentence: this paragraph
|
|
34
|
+
* described it, four components had their own copies of it, and the class
|
|
35
|
+
* itself did nothing. Here is where it belongs, because here is where
|
|
36
|
+
* `disabled` is.
|
|
37
|
+
*/
|
|
38
|
+
disabled: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Whether an ancestor `<fieldset disabled>` has switched this control off.
|
|
41
|
+
*
|
|
42
|
+
* The platform tells a form-associated element through `formDisabledCallback`
|
|
43
|
+
* and nothing here implemented it, so a control inside a disabled fieldset
|
|
44
|
+
* stayed fully typeable and announced itself as enabled. Measured: a
|
|
45
|
+
* `helix-input` in one accepted text, reported `disabled` as false, and
|
|
46
|
+
* carried no `aria-disabled`.
|
|
47
|
+
*
|
|
48
|
+
* What the platform already did on its own is the submission half. The same
|
|
49
|
+
* measurement showed the fieldset's controls absent from the form's entry
|
|
50
|
+
* list and the host matching `:disabled`, so the value never went anywhere.
|
|
51
|
+
* What was missing is everything a reader can see or touch.
|
|
52
|
+
*
|
|
53
|
+
* State rather than the `disabled` property. Writing that would reflect an
|
|
54
|
+
* attribute the consumer's server markup does not have, which React reports
|
|
55
|
+
* on hydration and does not patch up, and it would also silently overwrite
|
|
56
|
+
* what the consumer set.
|
|
57
|
+
*/
|
|
58
|
+
protected formDisabled: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Whether the control is off, by its own attribute or by an ancestor.
|
|
61
|
+
*
|
|
62
|
+
* What a component should bind to rather than `disabled`, which is only the
|
|
63
|
+
* half of it the consumer wrote.
|
|
64
|
+
*
|
|
65
|
+
* @internal Read by the component itself and by nothing outside it: every
|
|
66
|
+
* call in the library is `this.isDisabled`. Public, it printed a row on
|
|
67
|
+
* twenty-four families in both tiers, forty-eight in all, on every form
|
|
68
|
+
* control's reference page, and it is the largest single entry in those
|
|
69
|
+
* tables.
|
|
70
|
+
*
|
|
71
|
+
* **A consumer loses nothing, which was measured rather than assumed.**
|
|
72
|
+
* `element.matches(':disabled')` answers the same question, is the platform's
|
|
73
|
+
* own, and works on a native control too. Checked in a browser across the
|
|
74
|
+
* three cases: a control disabled by its own attribute, one inside a
|
|
75
|
+
* `<fieldset>` before and after that fieldset is disabled, and one that is
|
|
76
|
+
* neither. `:disabled` agreed with `isDisabled` in every one, including the
|
|
77
|
+
* inheritance case that is the only reason this getter exists.
|
|
78
|
+
*
|
|
79
|
+
* Documented away rather than made `protected`, because a subclass in
|
|
80
|
+
* `helix/styled` binds to it and that is exactly what it is for.
|
|
81
|
+
*/
|
|
82
|
+
get isDisabled(): boolean;
|
|
83
|
+
/**
|
|
84
|
+
* The platform's notice that an ancestor fieldset changed.
|
|
85
|
+
*
|
|
86
|
+
* **The argument is the effective state, and taking it whole is what latched
|
|
87
|
+
* every control in the library.** The platform calls this for the element's
|
|
88
|
+
* own `disabled` as well as for a fieldset, and our own arrives here at the
|
|
89
|
+
* worst possible moment: reflecting `disabled` to the attribute happens
|
|
90
|
+
* inside Lit's `update()`, the UA fires this synchronously from that write,
|
|
91
|
+
* and a reactive write during an update is a change-in-update Lit does not
|
|
92
|
+
* re-render for. So `formDisabled` ran exactly one update behind forever.
|
|
93
|
+
*
|
|
94
|
+
* Measured on Slider, logging what `render` saw:
|
|
95
|
+
*
|
|
96
|
+
* ```
|
|
97
|
+
* set true disabled true formDisabled false isDisabled true
|
|
98
|
+
* set false disabled false formDisabled true isDisabled true <- stale
|
|
99
|
+
* (no third render)
|
|
100
|
+
* ```
|
|
101
|
+
*
|
|
102
|
+
* The host came out right every time, `disabled` false, `:disabled` not
|
|
103
|
+
* matching, and the inner control kept the attribute, so a control disabled
|
|
104
|
+
* once could never be re-enabled. It only shows when something re-enables,
|
|
105
|
+
* which is the same shape of bug `inheritDisabled` was written for.
|
|
106
|
+
*
|
|
107
|
+
* Our own half is already in `this.disabled` and `isDisabled` is an or, so
|
|
108
|
+
* this records only what the fieldset adds. That also removes the write
|
|
109
|
+
* entirely on the own-disabled path rather than moving it.
|
|
110
|
+
*
|
|
111
|
+
* The one case this cannot see is a control that is disabled itself *and*
|
|
112
|
+
* inside a disabled fieldset, whose own `disabled` is then removed: the
|
|
113
|
+
* effective state does not change, so the platform does not call again, and
|
|
114
|
+
* the fieldset's hold is not recorded. There is no callback to learn it from
|
|
115
|
+
* and reading `:disabled` here would answer about the attribute we are in the
|
|
116
|
+
* middle of removing.
|
|
117
|
+
*/
|
|
118
|
+
formDisabledCallback(disabled: boolean): void;
|
|
119
|
+
protected willUpdate(changed: PropertyValues): void;
|
|
120
|
+
/**
|
|
121
|
+
* Name submitted with the form.
|
|
122
|
+
*
|
|
123
|
+
* **Reflected, and it is the exception to "reflect only what CSS selects
|
|
124
|
+
* on".** The platform builds a form's entry list from the `name` *content
|
|
125
|
+
* attribute*, not from the property, so a control named through the property
|
|
126
|
+
* submitted under no name at all and was silently dropped. Measured: two
|
|
127
|
+
* inputs in one form, one named by attribute and one by property, and the
|
|
128
|
+
* form carried a single entry.
|
|
129
|
+
*
|
|
130
|
+
* Safe for a React consumer, which is what the rule is protecting: React
|
|
131
|
+
* renders a custom element's props as attributes on the server, so the name
|
|
132
|
+
* is already in the markup being hydrated and reflecting it writes what is
|
|
133
|
+
* there. It is only a change to the markup when a consumer assigns it
|
|
134
|
+
* imperatively later, and nothing is hydrating by then.
|
|
135
|
+
*
|
|
136
|
+
* Here rather than on each control, where it was declared eight times and
|
|
137
|
+
* reflected none of them.
|
|
138
|
+
*/
|
|
139
|
+
name: string;
|
|
140
|
+
/**
|
|
141
|
+
* The form this control belongs to, if any.
|
|
142
|
+
*
|
|
143
|
+
* @reference https://html.spec.whatwg.org/multipage/custom-elements.html#form-associated-custom-elements form-associated custom elements
|
|
144
|
+
*/
|
|
145
|
+
get form(): HTMLFormElement | null;
|
|
146
|
+
/**
|
|
147
|
+
* Labels associated with this control.
|
|
148
|
+
*
|
|
149
|
+
* @reference https://html.spec.whatwg.org/multipage/custom-elements.html#form-associated-custom-elements form-associated custom elements
|
|
150
|
+
*/
|
|
151
|
+
get labels(): NodeList;
|
|
152
|
+
}
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
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
|
+
};
|
|
7
|
+
import { property, state } from 'lit/decorators.js';
|
|
8
|
+
import { HelixElement } from '../helix-element/helix-element.js';
|
|
9
|
+
/**
|
|
10
|
+
* @summary Base for every element that participates in a form.
|
|
11
|
+
*
|
|
12
|
+
* @description
|
|
13
|
+
* This has to be a class rather than a mixin or controller, and that is not a
|
|
14
|
+
* style preference: the browser reads `formAssociated` off the constructor
|
|
15
|
+
* during element upgrade, which cannot be delegated to a composed object.
|
|
16
|
+
*
|
|
17
|
+
* `internals` comes from `HelixElement`, which attaches it for every component.
|
|
18
|
+
* `attachInternals()` throws on a second call, so there is exactly one owner.
|
|
19
|
+
*
|
|
20
|
+
* Deliberately small. It carries what every form participant needs and nothing
|
|
21
|
+
* more; `value`, validity, and the reset and restore callbacks land when the
|
|
22
|
+
* first input does, rather than being designed against components that do not
|
|
23
|
+
* exist yet.
|
|
24
|
+
*
|
|
25
|
+
* @since 0.1.0
|
|
26
|
+
* @status experimental
|
|
27
|
+
* @documentation https://helix.fusion.dev/core/form-element
|
|
28
|
+
*/
|
|
29
|
+
export class HelixFormElement extends HelixElement {
|
|
30
|
+
constructor() {
|
|
31
|
+
super(...arguments);
|
|
32
|
+
/**
|
|
33
|
+
* Whether the control is non-interactive.
|
|
34
|
+
*
|
|
35
|
+
* Reflected, because the styled tier selects on it, and mirrored to
|
|
36
|
+
* `aria-disabled` rather than removing the element from the accessibility
|
|
37
|
+
* tree, so a screen reader can still announce that the control exists.
|
|
38
|
+
*
|
|
39
|
+
* The mirror is below and was for a while only a sentence: this paragraph
|
|
40
|
+
* described it, four components had their own copies of it, and the class
|
|
41
|
+
* itself did nothing. Here is where it belongs, because here is where
|
|
42
|
+
* `disabled` is.
|
|
43
|
+
*/
|
|
44
|
+
this.disabled = false;
|
|
45
|
+
/**
|
|
46
|
+
* Whether an ancestor `<fieldset disabled>` has switched this control off.
|
|
47
|
+
*
|
|
48
|
+
* The platform tells a form-associated element through `formDisabledCallback`
|
|
49
|
+
* and nothing here implemented it, so a control inside a disabled fieldset
|
|
50
|
+
* stayed fully typeable and announced itself as enabled. Measured: a
|
|
51
|
+
* `helix-input` in one accepted text, reported `disabled` as false, and
|
|
52
|
+
* carried no `aria-disabled`.
|
|
53
|
+
*
|
|
54
|
+
* What the platform already did on its own is the submission half. The same
|
|
55
|
+
* measurement showed the fieldset's controls absent from the form's entry
|
|
56
|
+
* list and the host matching `:disabled`, so the value never went anywhere.
|
|
57
|
+
* What was missing is everything a reader can see or touch.
|
|
58
|
+
*
|
|
59
|
+
* State rather than the `disabled` property. Writing that would reflect an
|
|
60
|
+
* attribute the consumer's server markup does not have, which React reports
|
|
61
|
+
* on hydration and does not patch up, and it would also silently overwrite
|
|
62
|
+
* what the consumer set.
|
|
63
|
+
*/
|
|
64
|
+
this.formDisabled = false;
|
|
65
|
+
/**
|
|
66
|
+
* Name submitted with the form.
|
|
67
|
+
*
|
|
68
|
+
* **Reflected, and it is the exception to "reflect only what CSS selects
|
|
69
|
+
* on".** The platform builds a form's entry list from the `name` *content
|
|
70
|
+
* attribute*, not from the property, so a control named through the property
|
|
71
|
+
* submitted under no name at all and was silently dropped. Measured: two
|
|
72
|
+
* inputs in one form, one named by attribute and one by property, and the
|
|
73
|
+
* form carried a single entry.
|
|
74
|
+
*
|
|
75
|
+
* Safe for a React consumer, which is what the rule is protecting: React
|
|
76
|
+
* renders a custom element's props as attributes on the server, so the name
|
|
77
|
+
* is already in the markup being hydrated and reflecting it writes what is
|
|
78
|
+
* there. It is only a change to the markup when a consumer assigns it
|
|
79
|
+
* imperatively later, and nothing is hydrating by then.
|
|
80
|
+
*
|
|
81
|
+
* Here rather than on each control, where it was declared eight times and
|
|
82
|
+
* reflected none of them.
|
|
83
|
+
*/
|
|
84
|
+
this.name = '';
|
|
85
|
+
}
|
|
86
|
+
/** Opts the element into form ownership, labels, and submission. */
|
|
87
|
+
static { this.formAssociated = true; }
|
|
88
|
+
/**
|
|
89
|
+
* Whether the control is off, by its own attribute or by an ancestor.
|
|
90
|
+
*
|
|
91
|
+
* What a component should bind to rather than `disabled`, which is only the
|
|
92
|
+
* half of it the consumer wrote.
|
|
93
|
+
*
|
|
94
|
+
* @internal Read by the component itself and by nothing outside it: every
|
|
95
|
+
* call in the library is `this.isDisabled`. Public, it printed a row on
|
|
96
|
+
* twenty-four families in both tiers, forty-eight in all, on every form
|
|
97
|
+
* control's reference page, and it is the largest single entry in those
|
|
98
|
+
* tables.
|
|
99
|
+
*
|
|
100
|
+
* **A consumer loses nothing, which was measured rather than assumed.**
|
|
101
|
+
* `element.matches(':disabled')` answers the same question, is the platform's
|
|
102
|
+
* own, and works on a native control too. Checked in a browser across the
|
|
103
|
+
* three cases: a control disabled by its own attribute, one inside a
|
|
104
|
+
* `<fieldset>` before and after that fieldset is disabled, and one that is
|
|
105
|
+
* neither. `:disabled` agreed with `isDisabled` in every one, including the
|
|
106
|
+
* inheritance case that is the only reason this getter exists.
|
|
107
|
+
*
|
|
108
|
+
* Documented away rather than made `protected`, because a subclass in
|
|
109
|
+
* `helix/styled` binds to it and that is exactly what it is for.
|
|
110
|
+
*/
|
|
111
|
+
get isDisabled() {
|
|
112
|
+
return this.disabled || this.formDisabled;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* The platform's notice that an ancestor fieldset changed.
|
|
116
|
+
*
|
|
117
|
+
* **The argument is the effective state, and taking it whole is what latched
|
|
118
|
+
* every control in the library.** The platform calls this for the element's
|
|
119
|
+
* own `disabled` as well as for a fieldset, and our own arrives here at the
|
|
120
|
+
* worst possible moment: reflecting `disabled` to the attribute happens
|
|
121
|
+
* inside Lit's `update()`, the UA fires this synchronously from that write,
|
|
122
|
+
* and a reactive write during an update is a change-in-update Lit does not
|
|
123
|
+
* re-render for. So `formDisabled` ran exactly one update behind forever.
|
|
124
|
+
*
|
|
125
|
+
* Measured on Slider, logging what `render` saw:
|
|
126
|
+
*
|
|
127
|
+
* ```
|
|
128
|
+
* set true disabled true formDisabled false isDisabled true
|
|
129
|
+
* set false disabled false formDisabled true isDisabled true <- stale
|
|
130
|
+
* (no third render)
|
|
131
|
+
* ```
|
|
132
|
+
*
|
|
133
|
+
* The host came out right every time, `disabled` false, `:disabled` not
|
|
134
|
+
* matching, and the inner control kept the attribute, so a control disabled
|
|
135
|
+
* once could never be re-enabled. It only shows when something re-enables,
|
|
136
|
+
* which is the same shape of bug `inheritDisabled` was written for.
|
|
137
|
+
*
|
|
138
|
+
* Our own half is already in `this.disabled` and `isDisabled` is an or, so
|
|
139
|
+
* this records only what the fieldset adds. That also removes the write
|
|
140
|
+
* entirely on the own-disabled path rather than moving it.
|
|
141
|
+
*
|
|
142
|
+
* The one case this cannot see is a control that is disabled itself *and*
|
|
143
|
+
* inside a disabled fieldset, whose own `disabled` is then removed: the
|
|
144
|
+
* effective state does not change, so the platform does not call again, and
|
|
145
|
+
* the fieldset's hold is not recorded. There is no callback to learn it from
|
|
146
|
+
* and reading `:disabled` here would answer about the attribute we are in the
|
|
147
|
+
* middle of removing.
|
|
148
|
+
*/
|
|
149
|
+
formDisabledCallback(disabled) {
|
|
150
|
+
this.formDisabled = disabled && !this.disabled;
|
|
151
|
+
}
|
|
152
|
+
willUpdate(changed) {
|
|
153
|
+
super.willUpdate(changed);
|
|
154
|
+
// Off for either reason, and said once for every control in the library.
|
|
155
|
+
this.internals.ariaDisabled = this.isDisabled ? 'true' : null;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* The form this control belongs to, if any.
|
|
159
|
+
*
|
|
160
|
+
* @reference https://html.spec.whatwg.org/multipage/custom-elements.html#form-associated-custom-elements form-associated custom elements
|
|
161
|
+
*/
|
|
162
|
+
get form() {
|
|
163
|
+
return this.internals.form;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Labels associated with this control.
|
|
167
|
+
*
|
|
168
|
+
* @reference https://html.spec.whatwg.org/multipage/custom-elements.html#form-associated-custom-elements form-associated custom elements
|
|
169
|
+
*/
|
|
170
|
+
get labels() {
|
|
171
|
+
return this.internals.labels;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
__decorate([
|
|
175
|
+
property({ reflect: true, type: Boolean })
|
|
176
|
+
], HelixFormElement.prototype, "disabled", void 0);
|
|
177
|
+
__decorate([
|
|
178
|
+
state()
|
|
179
|
+
], HelixFormElement.prototype, "formDisabled", void 0);
|
|
180
|
+
__decorate([
|
|
181
|
+
property({
|
|
182
|
+
/* Empty means absent, which plain reflection cannot say. `name = ''` is the
|
|
183
|
+
default and Lit reflects it as `name=""`, so every button, switch and
|
|
184
|
+
calendar in the library shipped an empty name attribute the consumer
|
|
185
|
+
never wrote, and six SSR specs said so. Returning `null` removes the
|
|
186
|
+
attribute instead. Same trap `hostAria` exists for: a name of no
|
|
187
|
+
characters is not the absence of one. */
|
|
188
|
+
converter: {
|
|
189
|
+
fromAttribute: (value) => value ?? '',
|
|
190
|
+
toAttribute: (value) => (value === '' ? null : value),
|
|
191
|
+
},
|
|
192
|
+
reflect: true,
|
|
193
|
+
})
|
|
194
|
+
], HelixFormElement.prototype, "name", void 0);
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export { AriaForwardController, type AriaForwardOptions, } from './controllers/aria-forward-controller/aria-forward-controller.js';
|
|
2
|
+
export { ChartPointerController, type ChartPointerHost, } from './controllers/chart-pointer-controller/chart-pointer-controller.js';
|
|
3
|
+
export { CommandController, type CommandOptions, HelixFallbackCommandEvent, supportsInvokers, } from './controllers/command-controller/command-controller.js';
|
|
4
|
+
export { CopyController, type CopyOptions, } from './controllers/copy-controller/copy-controller.js';
|
|
5
|
+
export { DisabledCascadeController, type DisabledCascadeOptions, } from './controllers/disabled-cascade-controller/disabled-cascade-controller.js';
|
|
6
|
+
export { DismissController, type DismissOptions, } from './controllers/dismiss-controller/dismiss-controller.js';
|
|
7
|
+
export { DrilldownController, type DrilldownOptions, } from './controllers/drilldown-controller/drilldown-controller.js';
|
|
8
|
+
export { FloatingController, type FloatingOptions, type Placement, } from './controllers/floating-controller/floating-controller.js';
|
|
9
|
+
export { FocusTrapController } from './controllers/focus-trap-controller/focus-trap-controller.js';
|
|
10
|
+
export { IndicatorController, type IndicatorOptions, } from './controllers/indicator-controller/indicator-controller.js';
|
|
11
|
+
export { KeyboardNavigationController, type KeyboardNavigationOptions, type NavigableItem, } from './controllers/keyboard-navigation-controller/keyboard-navigation-controller.js';
|
|
12
|
+
export { PopoverController, type PopoverOptions, } from './controllers/popover-controller/popover-controller.js';
|
|
13
|
+
export { SourceController, type SourceHost, } from './controllers/source-controller/source-controller.js';
|
|
14
|
+
export { type TokenColor, TokenColorController, } from './controllers/token-color-controller/token-color-controller.js';
|
|
15
|
+
export { VirtualizeController, type VirtualizeOptions, type Window as VirtualizeWindow, } from './controllers/virtualize-controller/virtualize-controller.js';
|
|
16
|
+
export { eventsForTag, registerElementEvents } from './events/element-events.js';
|
|
17
|
+
export { type CaretDetail, type ChangeDetail, type CompleteDetail, type ConsoleDetail, type CopyDetail, type CreateDetail, type DismissDetail, type FilterDetail, HelixActivateEvent, HelixBeforeActivateEvent, HelixBeforeChangeEvent, HelixBeforeCloseEvent, HelixBeforeCollapseEvent, HelixBeforeEditEvent, HelixBeforeOpenEvent, HelixBeforePanelResizeEvent, HelixBeforePinEvent, HelixBeforeResizeEvent, HelixBeforeSplitEvent, HelixBeforeToggleEvent, HelixCaretEvent, HelixCompleteEvent, HelixConsoleEvent, HelixCopyEvent, HelixCreateEvent, HelixDismissEvent, HelixFilterEvent, HelixNavigateEvent, HelixNextEvent, HelixPreviousEvent, HelixReadEvent, HelixResizeEvent, HelixSampleEndEvent, HelixSampleStartEvent, HelixScrolledEvent, HelixSelectEvent, HelixSendEvent, HelixShortcutEvent, HelixSortEvent, HelixTourAskEvent, type NavigateDetail, type OpenDetail, type ReadDetail, type ResizeDetail, type ScrolledDetail, type SelectDetail, type SendDetail, type ShortcutDetail, type SkipDetail, type SortDetail, type ToggleDetail, } from './events/events.js';
|
|
18
|
+
export { HelixElement } from './helix-element/helix-element.js';
|
|
19
|
+
export { HelixFormElement } from './helix-form-element/helix-form-element.js';
|
|
20
|
+
export { MixinChartSource, type MixinChartSourceInterface, PALETTE, seriesIndex, } from './mixins/mixin-chart-source/mixin-chart-source.js';
|
|
21
|
+
export { type CollectionElement, MixinCollection, } from './mixins/mixin-collection/mixin-collection.js';
|
|
22
|
+
export { MixinControllerActive, type MixinControllerActiveInterface, } from './mixins/mixin-controller-active/mixin-controller-active.js';
|
|
23
|
+
export { MixinControllerChecked, type MixinControllerCheckedInterface, } from './mixins/mixin-controller-checked/mixin-controller-checked.js';
|
|
24
|
+
export { MixinControllerOpen, type MixinControllerOpenInterface, } from './mixins/mixin-controller-open/mixin-controller-open.js';
|
|
25
|
+
export { MixinControllerValue, type MixinControllerValueInterface, } from './mixins/mixin-controller-value/mixin-controller-value.js';
|
|
26
|
+
export { type DismissibleElement, MixinDismissible, } from './mixins/mixin-dismissible/mixin-dismissible.js';
|
|
27
|
+
export { MixinField, type MixinFieldInterface } from './mixins/mixin-field/mixin-field.js';
|
|
28
|
+
export { anchorElement } from './utils/anchor-element/anchor-element.js';
|
|
29
|
+
export { capturePointer } from './utils/capture-pointer/capture-pointer.js';
|
|
30
|
+
export { closestInstance } from './utils/closest-instance/closest-instance.js';
|
|
31
|
+
export { createSheet } from './utils/create-sheet/create-sheet.js';
|
|
32
|
+
export { customElement, definedTags, duplicateRegistrations, } from './utils/custom-element/custom-element.js';
|
|
33
|
+
export { type DrawIconOptions, drawIcon } from './utils/draw-icon/draw-icon.js';
|
|
34
|
+
export { drawTooltip } from './utils/draw-tooltip/draw-tooltip.js';
|
|
35
|
+
export { elapsedTime } from './utils/elapsed-time/elapsed-time.js';
|
|
36
|
+
export { deepActiveElement, deepContains, focusableElements, } from './utils/focusable-elements/focusable-elements.js';
|
|
37
|
+
export { formatNumbers } from './utils/format-numbers/format-numbers.js';
|
|
38
|
+
export { type HostAria, hostAria } from './utils/host-aria/host-aria.js';
|
|
39
|
+
export { type DisableableItem, forgetDisabled, inheritDisabled, } from './utils/inherit-disabled/inherit-disabled.js';
|
|
40
|
+
export { type Curve, linePath, type Point } from './utils/line-path/line-path.js';
|
|
41
|
+
export { onUnlessFalse } from './utils/on-unless-false/on-unless-false.js';
|
|
42
|
+
export { type Row, type RowCell, readRows, readSeries, type Series, type SeriesPoint, } from './utils/read-series/read-series.js';
|
|
43
|
+
export { type Relative, relativeTime, } from './utils/relative-time/relative-time.js';
|
|
44
|
+
export { type ChangeRequestOptions, requestChange, } from './utils/request-change/request-change.js';
|
|
45
|
+
export { type ActivatableItem, resolveActiveItem, } from './utils/resolve-active-item/resolve-active-item.js';
|
|
46
|
+
export { holdCaret, restoreValue } from './utils/restore-value/restore-value.js';
|
|
47
|
+
export { extent, linear, type Scale } from './utils/scale/scale.js';
|
|
48
|
+
export { ticks } from './utils/scale/ticks.js';
|
|
49
|
+
export { type ScrollItemOptions, scrollItemIntoView, } from './utils/scroll-item-into-view/scroll-item-into-view.js';
|
|
50
|
+
export { slotFilled } from './utils/slot-filled/slot-filled.js';
|
|
51
|
+
export { tellDisclosure } from './utils/tell-disclosure/tell-disclosure.js';
|
|
52
|
+
export { subscribe } from './utils/ticker/ticker.js';
|
|
53
|
+
export { type HelixStatusTone, TONE_MARKS, type ToneMark, toneMark, } from './utils/tone-marks/tone-marks.js';
|
|
54
|
+
export { dateAsValue, numberAsValue, timeAsValue, valueAsDate, valueAsNumber, valueAsTime, } from './utils/value-as/value-as.js';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export { AriaForwardController, } from './controllers/aria-forward-controller/aria-forward-controller.js';
|
|
2
|
+
export { ChartPointerController, } from './controllers/chart-pointer-controller/chart-pointer-controller.js';
|
|
3
|
+
export { CommandController, HelixFallbackCommandEvent, supportsInvokers, } from './controllers/command-controller/command-controller.js';
|
|
4
|
+
export { CopyController, } from './controllers/copy-controller/copy-controller.js';
|
|
5
|
+
export { DisabledCascadeController, } from './controllers/disabled-cascade-controller/disabled-cascade-controller.js';
|
|
6
|
+
export { DismissController, } from './controllers/dismiss-controller/dismiss-controller.js';
|
|
7
|
+
export { DrilldownController, } from './controllers/drilldown-controller/drilldown-controller.js';
|
|
8
|
+
export { FloatingController, } from './controllers/floating-controller/floating-controller.js';
|
|
9
|
+
export { FocusTrapController } from './controllers/focus-trap-controller/focus-trap-controller.js';
|
|
10
|
+
export { IndicatorController, } from './controllers/indicator-controller/indicator-controller.js';
|
|
11
|
+
export { KeyboardNavigationController, } from './controllers/keyboard-navigation-controller/keyboard-navigation-controller.js';
|
|
12
|
+
export { PopoverController, } from './controllers/popover-controller/popover-controller.js';
|
|
13
|
+
export { SourceController, } from './controllers/source-controller/source-controller.js';
|
|
14
|
+
export { TokenColorController, } from './controllers/token-color-controller/token-color-controller.js';
|
|
15
|
+
export { VirtualizeController, } from './controllers/virtualize-controller/virtualize-controller.js';
|
|
16
|
+
export { eventsForTag, registerElementEvents } from './events/element-events.js';
|
|
17
|
+
export { HelixActivateEvent, HelixBeforeActivateEvent, HelixBeforeChangeEvent, HelixBeforeCloseEvent, HelixBeforeCollapseEvent, HelixBeforeEditEvent, HelixBeforeOpenEvent, HelixBeforePanelResizeEvent, HelixBeforePinEvent, HelixBeforeResizeEvent, HelixBeforeSplitEvent, HelixBeforeToggleEvent, HelixCaretEvent, HelixCompleteEvent, HelixConsoleEvent, HelixCopyEvent, HelixCreateEvent, HelixDismissEvent, HelixFilterEvent, HelixNavigateEvent, HelixNextEvent, HelixPreviousEvent, HelixReadEvent, HelixResizeEvent, HelixSampleEndEvent, HelixSampleStartEvent, HelixScrolledEvent, HelixSelectEvent, HelixSendEvent, HelixShortcutEvent, HelixSortEvent, HelixTourAskEvent, } from './events/events.js';
|
|
18
|
+
export { HelixElement } from './helix-element/helix-element.js';
|
|
19
|
+
export { HelixFormElement } from './helix-form-element/helix-form-element.js';
|
|
20
|
+
export { MixinChartSource, PALETTE, seriesIndex, } from './mixins/mixin-chart-source/mixin-chart-source.js';
|
|
21
|
+
export { MixinCollection, } from './mixins/mixin-collection/mixin-collection.js';
|
|
22
|
+
export { MixinControllerActive, } from './mixins/mixin-controller-active/mixin-controller-active.js';
|
|
23
|
+
export { MixinControllerChecked, } from './mixins/mixin-controller-checked/mixin-controller-checked.js';
|
|
24
|
+
export { MixinControllerOpen, } from './mixins/mixin-controller-open/mixin-controller-open.js';
|
|
25
|
+
export { MixinControllerValue, } from './mixins/mixin-controller-value/mixin-controller-value.js';
|
|
26
|
+
export { MixinDismissible, } from './mixins/mixin-dismissible/mixin-dismissible.js';
|
|
27
|
+
export { MixinField } from './mixins/mixin-field/mixin-field.js';
|
|
28
|
+
export { anchorElement } from './utils/anchor-element/anchor-element.js';
|
|
29
|
+
export { capturePointer } from './utils/capture-pointer/capture-pointer.js';
|
|
30
|
+
export { closestInstance } from './utils/closest-instance/closest-instance.js';
|
|
31
|
+
export { createSheet } from './utils/create-sheet/create-sheet.js';
|
|
32
|
+
export { customElement, definedTags, duplicateRegistrations, } from './utils/custom-element/custom-element.js';
|
|
33
|
+
export { drawIcon } from './utils/draw-icon/draw-icon.js';
|
|
34
|
+
export { drawTooltip } from './utils/draw-tooltip/draw-tooltip.js';
|
|
35
|
+
export { elapsedTime } from './utils/elapsed-time/elapsed-time.js';
|
|
36
|
+
export { deepActiveElement, deepContains, focusableElements, } from './utils/focusable-elements/focusable-elements.js';
|
|
37
|
+
export { formatNumbers } from './utils/format-numbers/format-numbers.js';
|
|
38
|
+
export { hostAria } from './utils/host-aria/host-aria.js';
|
|
39
|
+
export { forgetDisabled, inheritDisabled, } from './utils/inherit-disabled/inherit-disabled.js';
|
|
40
|
+
export { linePath } from './utils/line-path/line-path.js';
|
|
41
|
+
export { onUnlessFalse } from './utils/on-unless-false/on-unless-false.js';
|
|
42
|
+
export { readRows, readSeries, } from './utils/read-series/read-series.js';
|
|
43
|
+
export { relativeTime, } from './utils/relative-time/relative-time.js';
|
|
44
|
+
export { requestChange, } from './utils/request-change/request-change.js';
|
|
45
|
+
export { resolveActiveItem, } from './utils/resolve-active-item/resolve-active-item.js';
|
|
46
|
+
export { holdCaret, restoreValue } from './utils/restore-value/restore-value.js';
|
|
47
|
+
export { extent, linear } from './utils/scale/scale.js';
|
|
48
|
+
export { ticks } from './utils/scale/ticks.js';
|
|
49
|
+
export { scrollItemIntoView, } from './utils/scroll-item-into-view/scroll-item-into-view.js';
|
|
50
|
+
export { slotFilled } from './utils/slot-filled/slot-filled.js';
|
|
51
|
+
export { tellDisclosure } from './utils/tell-disclosure/tell-disclosure.js';
|
|
52
|
+
export { subscribe } from './utils/ticker/ticker.js';
|
|
53
|
+
export { TONE_MARKS, toneMark, } from './utils/tone-marks/tone-marks.js';
|
|
54
|
+
export { dateAsValue, numberAsValue, timeAsValue, valueAsDate, valueAsNumber, valueAsTime, } from './utils/value-as/value-as.js';
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { ChartPointerController } from '../../controllers/chart-pointer-controller/chart-pointer-controller.js';
|
|
2
|
+
import type { HelixElement } from '../../helix-element/helix-element.js';
|
|
3
|
+
import { type Row, type Series } from '../../utils/read-series/read-series.js';
|
|
4
|
+
type Constructor<T> = new (...args: any[]) => T;
|
|
5
|
+
/**
|
|
6
|
+
* How many colours the series palette has, and so where it starts over.
|
|
7
|
+
*
|
|
8
|
+
* Here rather than in each chart, which is what it was. Four families held the
|
|
9
|
+
* same `const PALETTE = 24` and the legend held a fifth: when the palette went
|
|
10
|
+
* from eight to twenty-four, one of them was missed and drew every ninth series
|
|
11
|
+
* in the first color again while the legend beside it named the ninth. A
|
|
12
|
+
* number two files have to agree on is a number that will stop agreeing.
|
|
13
|
+
*/
|
|
14
|
+
export declare const PALETTE = 24;
|
|
15
|
+
/** The palette slot for the nth series, counting from one and wrapping. */
|
|
16
|
+
export declare const seriesIndex: (depth: number) => number;
|
|
17
|
+
/**
|
|
18
|
+
* The public surface `MixinChartSource` adds.
|
|
19
|
+
*
|
|
20
|
+
* Declared separately because TypeScript cannot emit declarations for an
|
|
21
|
+
* anonymous class that has private or protected members (TS4094), and every
|
|
22
|
+
* class extending `HelixElement` inherits protected `willUpdate` and `updated`.
|
|
23
|
+
* Returning the class directly was tried and refused for exactly that.
|
|
24
|
+
*
|
|
25
|
+
* **Every member here is documented twice, and that is the convention rather
|
|
26
|
+
* than an oversight.** TypeScript reads this interface; the analyzer reads the
|
|
27
|
+
* inner class. Documented only here, `helix-convention-lint` failed the build
|
|
28
|
+
* with six `Public member has no description` on three charts that had just
|
|
29
|
+
* been given a shared, fully documented property.
|
|
30
|
+
*
|
|
31
|
+
* **The protected members are declared here too, and have to be.** Cast to an
|
|
32
|
+
* interface holding only `for` and `label`, `series` and `named` vanished from
|
|
33
|
+
* the emitted `.d.ts` and every chart failed with `Property 'series' does not
|
|
34
|
+
* exist`. A mixin's interface is not its public API, it is everything a
|
|
35
|
+
* subclass can see.
|
|
36
|
+
*
|
|
37
|
+
* **The series palette, and the one property every chart's mark reads.** A
|
|
38
|
+
* chart knows which series a bar belongs to and CSS cannot count it, so the
|
|
39
|
+
* headless tier writes `--chart-series: var(--chart-series-3)` onto the
|
|
40
|
+
* rectangle and each styled sheet is one rule rather than twenty-four.
|
|
41
|
+
*
|
|
42
|
+
* Declared here because this is where `seriesIndex` and `PALETTE` live, and
|
|
43
|
+
* because a hook repeated on four families is a hook four families have to keep
|
|
44
|
+
* agreeing about, which is the mistake the `PALETTE` comment above already
|
|
45
|
+
* records somebody making.
|
|
46
|
+
*
|
|
47
|
+
* The numbered twenty-four are the seam between the tiers: `chart/series.css`
|
|
48
|
+
* points each at a semantic token, which is a decision and so belongs to the
|
|
49
|
+
* styled tier, and a consumer on `headless` sets the same names to whatever
|
|
50
|
+
* they like. The headless examples set them to a ramp of grays.
|
|
51
|
+
*
|
|
52
|
+
* @cssproperty --chart-series - The color of the mark this is set on. Written by the component, read by the sheet that paints.
|
|
53
|
+
* @cssproperty --chart-series-1 - The color of series 1. The styled tier points it at a palette token.
|
|
54
|
+
* @cssproperty --chart-series-2 - The color of series 2. The styled tier points it at a palette token.
|
|
55
|
+
* @cssproperty --chart-series-3 - The color of series 3. The styled tier points it at a palette token.
|
|
56
|
+
* @cssproperty --chart-series-4 - The color of series 4. The styled tier points it at a palette token.
|
|
57
|
+
* @cssproperty --chart-series-5 - The color of series 5. The styled tier points it at a palette token.
|
|
58
|
+
* @cssproperty --chart-series-6 - The color of series 6. The styled tier points it at a palette token.
|
|
59
|
+
* @cssproperty --chart-series-7 - The color of series 7. The styled tier points it at a palette token.
|
|
60
|
+
* @cssproperty --chart-series-8 - The color of series 8. The styled tier points it at a palette token.
|
|
61
|
+
* @cssproperty --chart-series-9 - The color of series 9. The styled tier points it at a palette token.
|
|
62
|
+
* @cssproperty --chart-series-10 - The color of series 10. The styled tier points it at a palette token.
|
|
63
|
+
* @cssproperty --chart-series-11 - The color of series 11. The styled tier points it at a palette token.
|
|
64
|
+
* @cssproperty --chart-series-12 - The color of series 12. The styled tier points it at a palette token.
|
|
65
|
+
* @cssproperty --chart-series-13 - The color of series 13. The styled tier points it at a palette token.
|
|
66
|
+
* @cssproperty --chart-series-14 - The color of series 14. The styled tier points it at a palette token.
|
|
67
|
+
* @cssproperty --chart-series-15 - The color of series 15. The styled tier points it at a palette token.
|
|
68
|
+
* @cssproperty --chart-series-16 - The color of series 16. The styled tier points it at a palette token.
|
|
69
|
+
* @cssproperty --chart-series-17 - The color of series 17. The styled tier points it at a palette token.
|
|
70
|
+
* @cssproperty --chart-series-18 - The color of series 18. The styled tier points it at a palette token.
|
|
71
|
+
* @cssproperty --chart-series-19 - The color of series 19. The styled tier points it at a palette token.
|
|
72
|
+
* @cssproperty --chart-series-20 - The color of series 20. The styled tier points it at a palette token.
|
|
73
|
+
* @cssproperty --chart-series-21 - The color of series 21. The styled tier points it at a palette token.
|
|
74
|
+
* @cssproperty --chart-series-22 - The color of series 22. The styled tier points it at a palette token.
|
|
75
|
+
* @cssproperty --chart-series-23 - The color of series 23. The styled tier points it at a palette token.
|
|
76
|
+
* @cssproperty --chart-series-24 - The color of series 24. The styled tier points it at a palette token.
|
|
77
|
+
*/
|
|
78
|
+
export declare class MixinChartSourceInterface {
|
|
79
|
+
/**
|
|
80
|
+
* The id of the table to read.
|
|
81
|
+
*
|
|
82
|
+
* Resolved through `getRootNode()`, so a chart inside another component's
|
|
83
|
+
* shadow root names a table in that root rather than in the document. A
|
|
84
|
+
* `<table>` or anything built from grid roles, including `helix-table`.
|
|
85
|
+
*
|
|
86
|
+
* **In React this arrives as a property and not as an attribute**, the way
|
|
87
|
+
* `Tooltip.for` does, so it does not reflect and nothing styles on it.
|
|
88
|
+
*/
|
|
89
|
+
for: string;
|
|
90
|
+
/**
|
|
91
|
+
* The drawing's name, for a pointer resting on it.
|
|
92
|
+
*
|
|
93
|
+
* Absent falls back to the table's own caption, which is usually the right
|
|
94
|
+
* words and is already written.
|
|
95
|
+
*/
|
|
96
|
+
label: string;
|
|
97
|
+
/**
|
|
98
|
+
* The columns of the table, one series each, or none if there is no table.
|
|
99
|
+
*/
|
|
100
|
+
get series(): Series[];
|
|
101
|
+
/**
|
|
102
|
+
* What to call the drawing, the consumer's word or the table's own.
|
|
103
|
+
*/
|
|
104
|
+
get named(): string;
|
|
105
|
+
/**
|
|
106
|
+
* Every row of the table, with each cell's text as well as its number.
|
|
107
|
+
*/
|
|
108
|
+
get sourceRows(): Row[];
|
|
109
|
+
/**
|
|
110
|
+
* How many readings there are, which is what the pointer maps onto.
|
|
111
|
+
*/
|
|
112
|
+
get readings(): number;
|
|
113
|
+
/**
|
|
114
|
+
* Which reading a pointer is nearest, for a tooltip to sit on.
|
|
115
|
+
*/
|
|
116
|
+
pointer: ChartPointerController;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* The half of a chart that is about finding its numbers rather than drawing.
|
|
120
|
+
*
|
|
121
|
+
* Four families had written this out separately, and the row that asked for it
|
|
122
|
+
* set the bar: two copies is a coincidence and three is a pattern. There were
|
|
123
|
+
* five copies of `for`, four of `label` and three of the caption fallback by the
|
|
124
|
+
* time the line and donut charts landed, which is why this arrives now and not
|
|
125
|
+
* when the second chart did.
|
|
126
|
+
*
|
|
127
|
+
* **A mixin rather than a controller**, by the rule the tier notes give: it
|
|
128
|
+
* introduces `for` and `label`, which a consumer writes. `SourceController` is
|
|
129
|
+
* the other half and stays a controller, because resolving an id and watching
|
|
130
|
+
* for changes is behavior nobody calls.
|
|
131
|
+
*
|
|
132
|
+
* **`Legend` deliberately does not take this.** It reads a table and has no
|
|
133
|
+
* drawing to title, so `label` would be API it never uses, and a mixin applied
|
|
134
|
+
* for four fifths of a fit is how a shared thing starts drifting.
|
|
135
|
+
*/
|
|
136
|
+
export declare const MixinChartSource: <T extends Constructor<HelixElement>>(Base: T) => T & Constructor<MixinChartSourceInterface>;
|
|
137
|
+
export {};
|