lintje 0.13.0 → 0.13.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/dist-elements/actions.js +1 -1
- package/dist-elements/chunks/addon-CpQCmf0a.js +5 -0
- package/dist-elements/chunks/{avatar-LhpMTvpD.js → avatar-B6dKdtGU.js} +1 -1
- package/dist-elements/chunks/axes-Ce4tMvPe.js +129 -0
- package/dist-elements/chunks/base-D8Q8sQCj.js +252 -0
- package/dist-elements/chunks/chart-styles-nx70xRzE.js +45 -0
- package/dist-elements/chunks/{controls-DksmKkWN.js → controls-DHkjleqE.js} +1 -1
- package/dist-elements/chunks/date-format-imsP7-Nh.js +1 -0
- package/dist-elements/chunks/dialog-D4xqY347.js +1 -0
- package/dist-elements/chunks/{disclosure-CCO3GRDT.js → disclosure-DK8aIhWl.js} +5 -5
- package/dist-elements/chunks/{download-DXiWLTI2.js → download-Fdo7dKWd.js} +2 -2
- package/dist-elements/chunks/focus-trap-DmfusP3B.js +1 -0
- package/dist-elements/chunks/input-CgCrHxiZ.js +1 -0
- package/dist-elements/chunks/input-DyOCwq6h.js +8 -0
- package/dist-elements/chunks/{month-grid-S8RlqdwA.js → month-grid-BsW9jRNi.js} +8 -8
- package/dist-elements/chunks/{other-DoAwQm3o.js → other-BnXhCURa.js} +2 -1
- package/dist-elements/chunks/{player-BvpcNxBe.js → player-CnoXMz2g.js} +21 -21
- package/dist-elements/chunks/sentence-CxM-gm_8.js +3 -0
- package/dist-elements/chunks/{sheet-D7wJCRja.js → sheet-DKBISOgH.js} +2 -2
- package/dist-elements/chunks/stagger-VUPHAfRM.js +28 -0
- package/dist-elements/core.js +1 -1
- package/dist-elements/custom-elements.json +274 -28
- package/dist-elements/data-types.json +179 -11
- package/dist-elements/feedback.js +1 -1
- package/dist-elements/guides/dashboard.md +3 -1
- package/dist-elements/guides/page-contents.md +2 -1
- package/dist-elements/guides/start.md +6 -2
- package/dist-elements/layout.js +1 -1
- package/dist-elements/lintje.js +1417 -1293
- package/dist-elements/overlays.js +1 -1
- package/dist-elements/tag/accordion.js +3 -3
- package/dist-elements/tag/ai-label.js +5 -5
- package/dist-elements/tag/announcement.js +10 -10
- package/dist-elements/tag/app-search.js +44 -39
- package/dist-elements/tag/attachment.js +28 -27
- package/dist-elements/tag/audio-player.js +54 -49
- package/dist-elements/tag/badge.js +1 -1
- package/dist-elements/tag/breadcrumbs.js +14 -14
- package/dist-elements/tag/button.js +1 -1
- package/dist-elements/tag/card-list.js +10 -9
- package/dist-elements/tag/card.js +41 -41
- package/dist-elements/tag/chart.js +636 -599
- package/dist-elements/tag/chat-answer.js +23 -23
- package/dist-elements/tag/chat-composer.js +57 -54
- package/dist-elements/tag/chat-message.js +16 -16
- package/dist-elements/tag/chat-questions.js +79 -68
- package/dist-elements/tag/chat-steps.js +29 -27
- package/dist-elements/tag/chat-strip.js +25 -25
- package/dist-elements/tag/chat-suggestions.js +5 -5
- package/dist-elements/tag/chat.js +62 -61
- package/dist-elements/tag/checkbox-group.js +15 -12
- package/dist-elements/tag/checkbox.js +9 -9
- package/dist-elements/tag/code.js +7 -7
- package/dist-elements/tag/combobox.js +21 -21
- package/dist-elements/tag/conflict-alert.js +2 -2
- package/dist-elements/tag/copy-button.js +10 -8
- package/dist-elements/tag/data-table.js +303 -297
- package/dist-elements/tag/date-input.js +15 -15
- package/dist-elements/tag/date-range.js +18 -18
- package/dist-elements/tag/description-list.js +24 -24
- package/dist-elements/tag/dialog.js +7 -7
- package/dist-elements/tag/document-viewer.js +32 -32
- package/dist-elements/tag/drawer.js +9 -9
- package/dist-elements/tag/empty-state.js +1 -1
- package/dist-elements/tag/error-page.js +14 -14
- package/dist-elements/tag/error-summary.js +15 -15
- package/dist-elements/tag/expander.js +4 -4
- package/dist-elements/tag/explainer.js +6 -6
- package/dist-elements/tag/field.js +5 -5
- package/dist-elements/tag/file-upload.js +19 -18
- package/dist-elements/tag/filter-bar.js +45 -44
- package/dist-elements/tag/filter-sheet.js +7 -7
- package/dist-elements/tag/filter-zone.js +23 -23
- package/dist-elements/tag/find.js +14 -14
- package/dist-elements/tag/footer.js +13 -13
- package/dist-elements/tag/form-actions.js +5 -2
- package/dist-elements/tag/form-section.js +4 -4
- package/dist-elements/tag/form.js +3 -3
- package/dist-elements/tag/gallery.js +11 -11
- package/dist-elements/tag/graph.js +58 -58
- package/dist-elements/tag/grid-item.js +1 -1
- package/dist-elements/tag/grid.js +1 -1
- package/dist-elements/tag/hero.js +7 -7
- package/dist-elements/tag/highlight.js +3 -3
- package/dist-elements/tag/icon-button.js +1 -1
- package/dist-elements/tag/icon.js +1 -1
- package/dist-elements/tag/job-list.js +4 -4
- package/dist-elements/tag/key.js +1 -1
- package/dist-elements/tag/kpi-row.js +25 -22
- package/dist-elements/tag/kpi.js +85 -82
- package/dist-elements/tag/language-nav.js +20 -20
- package/dist-elements/tag/level-meter.js +7 -7
- package/dist-elements/tag/list.js +54 -48
- package/dist-elements/tag/log-viewer.js +96 -97
- package/dist-elements/tag/logo.js +23 -23
- package/dist-elements/tag/map.js +173 -168
- package/dist-elements/tag/menu-button.js +49 -49
- package/dist-elements/tag/modal.js +12 -10
- package/dist-elements/tag/multiselect.js +21 -21
- package/dist-elements/tag/note.js +6 -6
- package/dist-elements/tag/notifications.js +37 -37
- package/dist-elements/tag/number-input.js +19 -18
- package/dist-elements/tag/page-header.js +17 -17
- package/dist-elements/tag/pagination.js +41 -40
- package/dist-elements/tag/person-group.js +10 -10
- package/dist-elements/tag/person.js +7 -7
- package/dist-elements/tag/popover.js +1 -1
- package/dist-elements/tag/progress-bar.js +1 -1
- package/dist-elements/tag/prose.js +1 -1
- package/dist-elements/tag/qr-code.js +5 -5
- package/dist-elements/tag/radio-group.js +18 -17
- package/dist-elements/tag/range.js +25 -25
- package/dist-elements/tag/recording-status.js +9 -9
- package/dist-elements/tag/repeater.js +4 -4
- package/dist-elements/tag/segmented.js +11 -11
- package/dist-elements/tag/select.js +7 -7
- package/dist-elements/tag/shell.js +360 -354
- package/dist-elements/tag/skeleton.js +1 -1
- package/dist-elements/tag/slot-picker.js +12 -12
- package/dist-elements/tag/sortable-list.js +23 -23
- package/dist-elements/tag/spinner.js +1 -1
- package/dist-elements/tag/split-pane.js +9 -9
- package/dist-elements/tag/status-dot.js +1 -1
- package/dist-elements/tag/stepper.js +18 -18
- package/dist-elements/tag/streaming-text.js +13 -13
- package/dist-elements/tag/sub-nav.js +26 -26
- package/dist-elements/tag/tabs.js +40 -40
- package/dist-elements/tag/tag-input.js +32 -29
- package/dist-elements/tag/text-editor.js +21 -19
- package/dist-elements/tag/text-input.js +21 -21
- package/dist-elements/tag/textarea.js +13 -11
- package/dist-elements/tag/tile.js +1 -1
- package/dist-elements/tag/time-input.js +16 -16
- package/dist-elements/tag/timeline.js +74 -71
- package/dist-elements/tag/toast.js +14 -12
- package/dist-elements/tag/toggle.js +6 -6
- package/dist-elements/tag/toggletip.js +6 -6
- package/dist-elements/tag/token-value.js +1 -1
- package/dist-elements/tag/tooltip.js +1 -1
- package/dist-elements/tag/transcript.js +34 -35
- package/dist-elements/tag/translator.js +4 -3
- package/dist-elements/tag/tree-view.js +22 -22
- package/dist-elements/tag/user-menu.js +58 -57
- package/dist-elements/tag/video-player.js +12 -12
- package/dist-elements/tokens.css +34 -16
- package/dist-elements/tokens.json +12 -2
- package/dist-elements/types/components/actions/copy-button/copy-button.d.ts +5 -0
- package/dist-elements/types/components/actions/menu-button/menu-button.d.ts +6 -1
- package/dist-elements/types/components/charts/kpi/kpi.d.ts +7 -0
- package/dist-elements/types/components/charts/kpi-row/kpi-row.d.ts +10 -2
- package/dist-elements/types/components/chat/chat/chat.d.ts +1 -1
- package/dist-elements/types/components/chat/chat-composer/chat-composer.d.ts +0 -2
- package/dist-elements/types/components/chat/chat-questions/chat-questions.d.ts +2 -1
- package/dist-elements/types/components/chat/shared/chat-terms.d.ts +2 -0
- package/dist-elements/types/components/content/attachment/attachment.d.ts +6 -1
- package/dist-elements/types/components/content/audio-player/audio-player.d.ts +6 -0
- package/dist-elements/types/components/content/log-viewer/log-viewer.d.ts +4 -0
- package/dist-elements/types/components/content/translator/translator.d.ts +5 -0
- package/dist-elements/types/components/feedback/toast/toast.d.ts +5 -1
- package/dist-elements/types/components/filters/filter-zone/filter-zone.d.ts +3 -1
- package/dist-elements/types/components/forms/form-actions/form-actions.d.ts +4 -1
- package/dist-elements/types/components/forms/stepper/stepper.d.ts +1 -0
- package/dist-elements/types/components/frame/app-search/app-search.d.ts +2 -0
- package/dist-elements/types/components/frame/shell/header.d.ts +5 -1
- package/dist-elements/types/components/frame/shell/navigation.d.ts +0 -2
- package/dist-elements/types/components/frame/shell/shell.d.ts +5 -0
- package/dist-elements/types/components/frame/user-menu/user-menu.d.ts +2 -0
- package/dist-elements/types/components/inputs/checkbox-group/checkbox-group.d.ts +2 -1
- package/dist-elements/types/components/inputs/date-input/date-input.d.ts +5 -0
- package/dist-elements/types/components/inputs/radio-group/radio-group.d.ts +1 -2
- package/dist-elements/types/components/inputs/shared/field-foot.d.ts +6 -0
- package/dist-elements/types/components/inputs/shared/input.d.ts +17 -2
- package/dist-elements/types/components/inputs/tag-input/tag-input.d.ts +2 -0
- package/dist-elements/types/components/inputs/text-input/text-input.d.ts +5 -2
- package/dist-elements/types/components/inputs/textarea/textarea.d.ts +11 -0
- package/dist-elements/types/components/overlays/tooltip/tooltip.d.ts +4 -1
- package/dist-elements/types/components/shared/charts/dual-axis-chart/dual-axis-chart.d.ts +2 -2
- package/dist-elements/types/components/shared/charts/dumbbell-chart/dumbbell-chart.d.ts +4 -1
- package/dist-elements/types/components/shared/charts/histogram-chart/histogram-chart.d.ts +2 -1
- package/dist-elements/types/components/shared/charts/map-chart/leaflet.d.ts +4 -0
- package/dist-elements/types/components/shared/charts/map-chart/map-chart.d.ts +10 -1
- package/dist-elements/types/components/shared/charts/map-chart/marks.d.ts +3 -1
- package/dist-elements/types/components/shared/charts/map-chart/reveal.d.ts +2 -2
- package/dist-elements/types/components/shared/charts/pie-chart/pie-chart.d.ts +4 -3
- package/dist-elements/types/components/shared/charts/scatter-chart/scatter-chart.d.ts +2 -1
- package/dist-elements/types/components/shared/charts/shared/axes.d.ts +7 -6
- package/dist-elements/types/components/shared/charts/shared/colors.d.ts +12 -7
- package/dist-elements/types/components/shared/charts/shared/controller.d.ts +88 -5
- package/dist-elements/types/components/shared/charts/shared/fold.d.ts +38 -0
- package/dist-elements/types/components/shared/charts/shared/forecast.d.ts +6 -1
- package/dist-elements/types/components/shared/charts/shared/mark-select.d.ts +4 -3
- package/dist-elements/types/components/shared/charts/shared/nearest-mark.d.ts +25 -0
- package/dist-elements/types/components/shared/charts/shared/plot-keys.d.ts +9 -1
- package/dist-elements/types/components/shared/charts/shared/scale.d.ts +5 -4
- package/dist-elements/types/components/shared/charts/stacked-bar-chart/stacked-bar-chart.d.ts +4 -1
- package/dist-elements/types/components/shared/charts/treemap-chart/treemap-chart.d.ts +7 -0
- package/dist-elements/types/components/shared/charts/treemap-chart/treemap-labels.d.ts +3 -2
- package/dist-elements/types/components/shared/date-format.d.ts +3 -3
- package/dist-elements/types/components/shared/other.d.ts +2 -1
- package/dist-elements/types/components/tables/data-table/data-table.d.ts +7 -3
- package/dist-elements/types/components/tables/data-table/filters.d.ts +2 -1
- package/dist-elements/types/components/tables/list/list.d.ts +2 -0
- package/dist-elements/types/components/tables/pagination/pagination.d.ts +1 -0
- package/dist-elements/types/core/format.d.ts +15 -3
- package/dist-elements/types/core/scroll-room.d.ts +16 -0
- package/dist-elements/types/types.d.ts +6 -1
- package/package.json +1 -1
- package/dist-elements/chunks/addon-uVno0du7.js +0 -5
- package/dist-elements/chunks/axes-Bvby71Kw.js +0 -129
- package/dist-elements/chunks/base-CA5SqOS7.js +0 -252
- package/dist-elements/chunks/chart-styles-DOqcYbwm.js +0 -45
- package/dist-elements/chunks/date-format-DvDaZtFc.js +0 -1
- package/dist-elements/chunks/dialog-IENGotYb.js +0 -1
- package/dist-elements/chunks/focus-trap-BQYLu24z.js +0 -1
- package/dist-elements/chunks/input-Ca1jedrl.js +0 -8
- package/dist-elements/chunks/input-_KQsbmkp.js +0 -1
- package/dist-elements/chunks/sentence-C9bcudIj.js +0 -3
- package/dist-elements/chunks/stagger-w2eZPjUS.js +0 -27
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* `<lintje-radio-group>` — one option per line, for options that do not fit `lintje-segmented`.
|
|
3
3
|
*
|
|
4
4
|
* With `other` the last option is "Anders", value `other`, with a text field under it while it is
|
|
5
|
-
* chosen;
|
|
5
|
+
* chosen; the focus stays on the option, and the field is the next Tab stop. The group checks
|
|
6
6
|
* nothing: the host sets `error`, and `other-error` for an empty field. Cards draw no "Anders".
|
|
7
7
|
*
|
|
8
8
|
* Events: `lintje-change` `string`, `lintje-other-change` `string` (the field's text, on leaving
|
|
@@ -14,7 +14,6 @@ import { LintjeChoiceGroupElement } from '../shared/input.js';
|
|
|
14
14
|
import '../text-input/text-input.js';
|
|
15
15
|
import type { FilterOption } from '../../../types.js';
|
|
16
16
|
export declare class LintjeRadioGroup extends LintjeChoiceGroupElement {
|
|
17
|
-
#private;
|
|
18
17
|
static styles: import("lit").CSSResult[];
|
|
19
18
|
static properties: PropertyDeclarations;
|
|
20
19
|
value: string;
|
|
@@ -8,6 +8,12 @@ export interface FootIds {
|
|
|
8
8
|
hintId: string;
|
|
9
9
|
errorId: string;
|
|
10
10
|
}
|
|
11
|
+
/** Where a control's `description` stands: hidden text, read after its label. */
|
|
12
|
+
export declare const DESCRIPTION_ID = "lintje-input-description";
|
|
11
13
|
export declare function footDescribedBy(hint: string | undefined, message: string, ids: FootIds): string | typeof nothing;
|
|
12
14
|
/** `alert: false` leaves a message out of the alert region, for one that changes as the user types. */
|
|
13
15
|
export declare function renderFieldFoot(hint: string | undefined, message: string, ids: FootIds, alert?: boolean): TemplateResult | typeof nothing;
|
|
16
|
+
/** A control's `description`, never drawn: the host shows those words itself. */
|
|
17
|
+
export declare function renderDescription(description: string | undefined): TemplateResult | typeof nothing;
|
|
18
|
+
/** `aria-describedby` with the description in front of the ids of the foot. */
|
|
19
|
+
export declare function describedWith(description: string | undefined, ids: string | typeof nothing): string | typeof nothing;
|
|
@@ -130,6 +130,11 @@ export declare abstract class LintjeInputElement extends LintjeGridItemElement {
|
|
|
130
130
|
export declare abstract class LintjeFormInputElement extends LintjeInputElement {
|
|
131
131
|
static properties: PropertyDeclarations;
|
|
132
132
|
readonly: boolean;
|
|
133
|
+
/**
|
|
134
|
+
* What the field asks for, passed to the native control as is (`name`, `email`, `bday-year`),
|
|
135
|
+
* so the browser and assistive software can fill it in.
|
|
136
|
+
*/
|
|
137
|
+
autocomplete: string;
|
|
133
138
|
abstract value: unknown;
|
|
134
139
|
private initialValue;
|
|
135
140
|
protected abstract get formValue(): string;
|
|
@@ -157,6 +162,11 @@ export declare abstract class LintjeChoiceGroupElement extends LintjeInputElemen
|
|
|
157
162
|
#private;
|
|
158
163
|
static properties: PropertyDeclarations;
|
|
159
164
|
options?: FilterOption[];
|
|
165
|
+
/**
|
|
166
|
+
* Read after the label and never drawn: what the host shows about the group itself, such as
|
|
167
|
+
* the hint above a group whose label it hides.
|
|
168
|
+
*/
|
|
169
|
+
description?: string;
|
|
160
170
|
/**
|
|
161
171
|
* Ends the options in "Anders", value `other`, with a text field under it while it is chosen.
|
|
162
172
|
* Left out when an option of the host already has the value `other`.
|
|
@@ -176,11 +186,18 @@ export declare abstract class LintjeChoiceGroupElement extends LintjeInputElemen
|
|
|
176
186
|
* sets it from `errors.fields['<name>-other']`. The group never sets it itself.
|
|
177
187
|
*/
|
|
178
188
|
otherError?: string;
|
|
189
|
+
/**
|
|
190
|
+
* Brings the row that takes the keyboard's focus wholly into view, also in a list that scrolls:
|
|
191
|
+
* WebKit leaves a row that is partly in view where it is, with its focus ring cut.
|
|
192
|
+
*/
|
|
193
|
+
protected readonly revealRow: (event: Event) => void;
|
|
179
194
|
/** "Anders" is the choice, or one of them. */
|
|
180
195
|
protected abstract get otherChosen(): boolean;
|
|
181
196
|
/** The control of the option "Anders", where the focus goes when its field goes. */
|
|
182
197
|
protected abstract get otherOption(): HTMLElement | null;
|
|
183
198
|
protected warnOnce(key: string, message: string): void;
|
|
199
|
+
protected get describedBy(): string | typeof nothing;
|
|
200
|
+
protected renderFoot(): TemplateResult | typeof nothing;
|
|
184
201
|
/** The group draws "Anders": `other` is on and no option of the host holds its value. */
|
|
185
202
|
protected get drawsOther(): boolean;
|
|
186
203
|
/** "Anders" is drawn and chosen: its field stands, and its text counts. */
|
|
@@ -189,8 +206,6 @@ export declare abstract class LintjeChoiceGroupElement extends LintjeInputElemen
|
|
|
189
206
|
protected valuesChange(url: unknown): Record<string, unknown>;
|
|
190
207
|
/** The field's commit: `lintje-other-change`, and `lintje-values-change` with a `name`. */
|
|
191
208
|
protected commitOther(text: string): void;
|
|
192
|
-
/** After "Anders" is chosen by a click, a tap or Space: the focus goes into its field. */
|
|
193
|
-
protected focusOther(): Promise<void>;
|
|
194
209
|
formResetCallback(): void;
|
|
195
210
|
protected willUpdate(changed: PropertyValues<this>): void;
|
|
196
211
|
protected updated(changed: PropertyValues<this>): void;
|
|
@@ -30,6 +30,8 @@ export declare class LintjeTagInput extends LintjeInputElement {
|
|
|
30
30
|
stacked: boolean;
|
|
31
31
|
protected text: string;
|
|
32
32
|
protected flash: string | null;
|
|
33
|
+
/** The word typed again that stands already, shown in the foot until the reader types on. */
|
|
34
|
+
protected repeated: string | null;
|
|
33
35
|
protected active: number;
|
|
34
36
|
/** Off after Escape, on again with the next keystroke. */
|
|
35
37
|
protected suggesting: boolean;
|
|
@@ -33,8 +33,6 @@ export declare class LintjeTextInput extends LintjeFormInputElement {
|
|
|
33
33
|
* bundles keystrokes and commits 300 ms after the last.
|
|
34
34
|
*/
|
|
35
35
|
commitOn: CommitOn;
|
|
36
|
-
/** Passed to the native input as is. */
|
|
37
|
-
autocomplete: string;
|
|
38
36
|
/** The fixed text before the input, as written ("€", "www."); never part of `value`. */
|
|
39
37
|
prefix: string | null;
|
|
40
38
|
/** The fixed text after the input (".nl", "@rijksoverheid.nl"); never part of `value`. */
|
|
@@ -44,6 +42,11 @@ export declare class LintjeTextInput extends LintjeFormInputElement {
|
|
|
44
42
|
* then sends `lintje-action`; it works when `readonly`. Ignored for a password.
|
|
45
43
|
*/
|
|
46
44
|
action?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Says the field must be filled, as `aria-required` only: unlike `required` it holds back no
|
|
47
|
+
* form, for a field whose holder checks it, such as the one under "Anders, namelijk".
|
|
48
|
+
*/
|
|
49
|
+
softRequired: boolean;
|
|
47
50
|
protected revealed: boolean;
|
|
48
51
|
private readonly typing;
|
|
49
52
|
protected get formValue(): string;
|
|
@@ -23,6 +23,11 @@ export declare class LintjeTextarea extends LintjeFormInputElement {
|
|
|
23
23
|
static properties: PropertyDeclarations;
|
|
24
24
|
value: string;
|
|
25
25
|
placeholder: string;
|
|
26
|
+
/**
|
|
27
|
+
* Read after the label and never drawn: what the host shows about the field itself, such as
|
|
28
|
+
* the hint above a field whose label it hides.
|
|
29
|
+
*/
|
|
30
|
+
description?: string;
|
|
26
31
|
/** The limit the counter counts to; the counter is read out from 90 % of it on. */
|
|
27
32
|
maxlength?: number;
|
|
28
33
|
/** The attribute `commit`; `commit()` is the method every input commits through. */
|
|
@@ -35,6 +40,11 @@ export declare class LintjeTextarea extends LintjeFormInputElement {
|
|
|
35
40
|
* stands and the full height, for a surface that frames the text and draws the ring itself.
|
|
36
41
|
*/
|
|
37
42
|
variant: TextareaVariant;
|
|
43
|
+
/**
|
|
44
|
+
* The language of the text in the field (`en`), as `lang` on the native control: the label,
|
|
45
|
+
* the hint and the counter keep the page's.
|
|
46
|
+
*/
|
|
47
|
+
textLang?: string;
|
|
38
48
|
private readonly typing;
|
|
39
49
|
private get counterId();
|
|
40
50
|
private get control();
|
|
@@ -52,6 +62,7 @@ export declare class LintjeTextarea extends LintjeFormInputElement {
|
|
|
52
62
|
private get counterShown();
|
|
53
63
|
protected renderFieldLine(): TemplateResult | typeof nothing;
|
|
54
64
|
protected renderFoot(): TemplateResult | typeof nothing;
|
|
65
|
+
private renderOwnFoot;
|
|
55
66
|
protected render(): TemplateResult;
|
|
56
67
|
}
|
|
57
68
|
declare global {
|
|
@@ -30,7 +30,10 @@ export declare class LintjeTooltip extends LintjeElement {
|
|
|
30
30
|
private readonly onPointerLeave;
|
|
31
31
|
private readonly onFocusIn;
|
|
32
32
|
private readonly onFocusOut;
|
|
33
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* On the document: a tooltip opened by the pointer is dismissed wherever the focus is, and that
|
|
35
|
+
* Escape is its own: what stands around it (a menu) sees it prevented and stays open.
|
|
36
|
+
*/
|
|
34
37
|
private readonly onKeydown;
|
|
35
38
|
/** Fixed to the viewport, so it is placed again when what holds its element scrolls. */
|
|
36
39
|
private readonly onReflow;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Two y-axes, each in the color of its series
|
|
3
|
-
*
|
|
2
|
+
* Two y-axes, each a line in the color of its series; their labels are in the axis grey of every
|
|
3
|
+
* chart, since yellow is never text.
|
|
4
4
|
*/
|
|
5
5
|
import { type TemplateResult } from 'lit';
|
|
6
6
|
import { type ChartOptions } from '../shared/controller.js';
|
|
@@ -14,7 +14,10 @@ type DumbbellSpec = Extract<ChartSpec, {
|
|
|
14
14
|
/** The legend keys of the two moments: never the host's labels, which may name anything. */
|
|
15
15
|
export declare const FROM_KEY = "moment:from";
|
|
16
16
|
export declare const TO_KEY = "moment:to";
|
|
17
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* The chart's height with every name on one line: a row each, the head above and the scale
|
|
19
|
+
* under them. On a phone a name that runs on makes its row taller.
|
|
20
|
+
*/
|
|
18
21
|
export declare function dumbbellHeight(count: number, mobile?: boolean): number;
|
|
19
22
|
/** As many decimals as the most precise value of the rows. */
|
|
20
23
|
export declare function dumbbellDecimals(rows: DumbbellRow[]): number;
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { type TemplateResult } from 'lit';
|
|
6
6
|
import { type PlotArea } from '../shared/scale.js';
|
|
7
|
+
import { type TextFont } from '../../../../core/format.js';
|
|
7
8
|
import { type ChartOptions } from '../shared/controller.js';
|
|
8
9
|
import type { ChartSpec } from '../shared/types.js';
|
|
9
10
|
type HistogramSpec = Extract<ChartSpec, {
|
|
@@ -24,7 +25,7 @@ export interface LineLabel {
|
|
|
24
25
|
* Where the labels of the median and the threshold stand: right of their line, or left of it
|
|
25
26
|
* where they would leave the drawing, and the right one a line lower when the two would touch.
|
|
26
27
|
*/
|
|
27
|
-
export declare function placeLineLabels(labels: LineLabel[], area: PlotArea,
|
|
28
|
+
export declare function placeLineLabels(labels: LineLabel[], area: PlotArea, font?: TextFont | string): {
|
|
28
29
|
x: number;
|
|
29
30
|
y: number;
|
|
30
31
|
anchor: 'start' | 'end';
|
|
@@ -22,6 +22,10 @@ export interface LeafletSyncOptions {
|
|
|
22
22
|
/** The drawing tool that is on, and what a finished area goes to. */
|
|
23
23
|
tool: MapTool | null;
|
|
24
24
|
drawn: (area: MapArea) => void;
|
|
25
|
+
/** A new area begins: the one standing steps aside, until the new one is done or undone. */
|
|
26
|
+
drawStart: () => void;
|
|
27
|
+
/** The new area was undone or chose nothing: the one that stood comes back. */
|
|
28
|
+
drawCancel: () => void;
|
|
25
29
|
/** Escape with no area being drawn: the tool goes off. */
|
|
26
30
|
stopTool: () => void;
|
|
27
31
|
/** Panning with the mouse, and zooming by double click and pinch; the host may switch them off. */
|
|
@@ -6,13 +6,22 @@
|
|
|
6
6
|
import { type TemplateResult } from 'lit';
|
|
7
7
|
import type { ChartOptions } from '../shared/controller.js';
|
|
8
8
|
import type { Mode } from '../../../../core/element.js';
|
|
9
|
-
import type { MapArea, MapSpec, MapValue } from '../shared/types.js';
|
|
9
|
+
import type { MapArea, MapSpec, MapTool, MapValue } from '../shared/types.js';
|
|
10
10
|
import '../../../overlays/popover/popover.js';
|
|
11
11
|
/** The map's own height in a tile: on a phone taller, so all its buttons fit on the touch size. */
|
|
12
12
|
export declare const MAP_HEIGHT: {
|
|
13
13
|
readonly desktop: 400;
|
|
14
14
|
readonly mobile: 280;
|
|
15
15
|
};
|
|
16
|
+
/**
|
|
17
|
+
* How to draw with a tool, under the map, in the way the reader works: with a pointer (on a phone
|
|
18
|
+
* the short form, for a finger), or with the keyboard while its focus is in the map.
|
|
19
|
+
*/
|
|
20
|
+
export declare const TOOL_HINTS: Record<MapTool, {
|
|
21
|
+
pointer: string;
|
|
22
|
+
short: string;
|
|
23
|
+
keys: string;
|
|
24
|
+
}>;
|
|
16
25
|
/** The distance of the scale, in m or km: the figure beside the bracket. */
|
|
17
26
|
export declare function scaleLabel(metres: number): string;
|
|
18
27
|
/**
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* clears the selection, and its double click zooms.
|
|
8
8
|
*/
|
|
9
9
|
import { nothing, type SVGTemplateResult } from 'lit';
|
|
10
|
-
import type { ChartController } from '../shared/controller.js';
|
|
10
|
+
import type { ChartController, TooltipContent } from '../shared/controller.js';
|
|
11
11
|
import { type MapDrawing } from './drawings.js';
|
|
12
12
|
import type { MapArea, MapPointSize, MapSeriesKey, MapValue } from '../shared/types.js';
|
|
13
13
|
/** Longitude and latitude to the surface's reference pixels. */
|
|
@@ -52,6 +52,8 @@ export declare const FIXED_RADIUS = 6;
|
|
|
52
52
|
export declare function pointRadius(value: number, max: number, size?: MapPointSize): number;
|
|
53
53
|
/** A series of one layer, as the legend switches it: a colour may serve several layers. */
|
|
54
54
|
export declare const seriesKey: (drawing: MapDrawing, series: MapSeriesKey) => string;
|
|
55
|
+
/** What a mark's tooltip says: the same under the pointer and on the keyboard's focus. */
|
|
56
|
+
export declare function markTip(drawing: MapDrawing, value: MapValue): TooltipContent;
|
|
55
57
|
/** A drawn area, in the reference pixels; a circle with its middle. `draft` is the area while it is drawn. */
|
|
56
58
|
export declare function renderRegion(area: MapArea | null, project: Project, draft?: boolean): SVGTemplateResult | typeof nothing;
|
|
57
59
|
/** The whole drawing: the hatch, the land, then the drawings in order, each as one of three kinds. */
|
|
@@ -10,8 +10,8 @@ export interface Box {
|
|
|
10
10
|
}
|
|
11
11
|
/** How far a revealed mark stands off the overlay or edge it passed, in px. */
|
|
12
12
|
export declare const REVEAL_MARGIN = 8;
|
|
13
|
-
/** What stands over the drawing: the tile's own overlays and Leaflet's credit. */
|
|
14
|
-
export declare const OVERLAYS = ".lintje-map-chart__layers, .lintje-map-chart__zoom, .lintje-map-chart__selection, .lintje-map-chart__scale-bar, .leaflet-control";
|
|
13
|
+
/** What stands over the drawing: the tile's own overlays, the drawing hint and Leaflet's credit. */
|
|
14
|
+
export declare const OVERLAYS = ".lintje-map-chart__layers, .lintje-map-chart__zoom, .lintje-map-chart__selection, .lintje-map-chart__scale-bar, .lintje-map-chart__hint, .leaflet-control";
|
|
15
15
|
/** The overlays in `area`, as boxes in client pixels; one that is not drawn has no size. */
|
|
16
16
|
export declare function overlayBoxes(area: Element): Box[];
|
|
17
17
|
/**
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
* Pie and donut: at most five parts, largest first and darkest first, whatever order the host
|
|
3
3
|
* sends. The parts take the tints of one variable (the spec's `color`, or the default) spread
|
|
4
4
|
* over the ladder with their number. "Overig" and a `remainder` segment (the open part of an
|
|
5
|
-
* occupancy donut) are not parts: they draw last
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* occupancy donut) are not parts: they draw last. "Overig" is the last, lightest member of the
|
|
6
|
+
* set, the remainder light gray; a segment's own `color` wins, except `other`, which says "this
|
|
7
|
+
* is Overig". More than five parts fold into four and one "Overig" that is not clickable: a
|
|
8
|
+
* merged slice has no single place to drill into. The legend
|
|
8
9
|
* is a table, in the drawn order; without it the shared legend stands above the pie, one item per
|
|
9
10
|
* slice and none a switch. The drawing takes the focus and the arrow keys walk its slices.
|
|
10
11
|
*/
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { type TemplateResult } from 'lit';
|
|
6
6
|
import { type PlotArea } from '../shared/scale.js';
|
|
7
|
+
import { type TextFont } from '../../../../core/format.js';
|
|
7
8
|
import { type ChartOptions } from '../shared/controller.js';
|
|
8
9
|
import type { ChartSpec } from '../shared/types.js';
|
|
9
10
|
type ScatterSpec = Extract<ChartSpec, {
|
|
@@ -24,6 +25,6 @@ export declare function placeDataLabels(points: {
|
|
|
24
25
|
label: string;
|
|
25
26
|
x: number;
|
|
26
27
|
y: number;
|
|
27
|
-
}[], names: string[], area: PlotArea,
|
|
28
|
+
}[], names: string[], area: PlotArea, font: TextFont | string): DataLabel[];
|
|
28
29
|
export declare function renderScatterChart(spec: ScatterSpec, options: ChartOptions): TemplateResult;
|
|
29
30
|
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/** The chart frame: axes, grid, zero line, hatching, as-of line, description and legend. */
|
|
2
2
|
import { nothing, type SVGTemplateResult, type TemplateResult } from 'lit';
|
|
3
3
|
import { type PlotArea } from './scale.js';
|
|
4
|
+
import { type TextFont } from '../../../../core/format.js';
|
|
4
5
|
import type { PlotKeys } from './plot-keys.js';
|
|
5
6
|
import { type SeriesKey, type SeriesShape } from './series-shapes.js';
|
|
6
7
|
/** Anything that may go inside the `<svg>`; built with lit's `svg`, since `html` draws nothing. */
|
|
@@ -76,8 +77,8 @@ export interface ChartFrameOptions {
|
|
|
76
77
|
zeroLine?: boolean;
|
|
77
78
|
/** How a tick is written; `axisColumn` decides between full and compact. Default full. */
|
|
78
79
|
formatTick?: (tick: number) => string;
|
|
79
|
-
/** The
|
|
80
|
-
|
|
80
|
+
/** The axis labels' type (`controller.font`), for measuring the x labels. */
|
|
81
|
+
font?: TextFont;
|
|
81
82
|
id: string;
|
|
82
83
|
/** Some mark is a button: the drawing is a group named by its description, not an image. */
|
|
83
84
|
interactive?: boolean;
|
|
@@ -104,8 +105,8 @@ export declare function thinLabels<T extends {
|
|
|
104
105
|
label: string;
|
|
105
106
|
x: number;
|
|
106
107
|
anchor?: XAnchor;
|
|
107
|
-
}>(labels: T[],
|
|
108
|
-
export declare function renderChartFrame({ area, ticks, max, axisTitle, xLabels, xTitle, description, defs, underlay, zeroLine, formatTick, id, height,
|
|
108
|
+
}>(labels: T[], font?: TextFont | string): T[];
|
|
109
|
+
export declare function renderChartFrame({ area, ticks, max, axisTitle, xLabels, xTitle, description, defs, underlay, zeroLine, formatTick, id, height, font, interactive, keys, }: ChartFrameOptions, children: SvgSlot): TemplateResult;
|
|
109
110
|
/**
|
|
110
111
|
* The boundary of a forecast: one line at `x`, "Gemeten" left of it and the forecast's word right,
|
|
111
112
|
* or on a row of its own above when it does not fit there (`forecastWordFits`).
|
|
@@ -116,8 +117,8 @@ export interface ForecastBoundary {
|
|
|
116
117
|
x: number;
|
|
117
118
|
/** The forecast's word, `forecastLabel`. */
|
|
118
119
|
label: string;
|
|
119
|
-
/** The
|
|
120
|
-
|
|
120
|
+
/** The axis labels' type (`controller.font`), for measuring whether the word fits. */
|
|
121
|
+
font?: TextFont;
|
|
121
122
|
}
|
|
122
123
|
/**
|
|
123
124
|
* The as-of marker. Up to 6 pending hours (tail) it draws nothing and the missing hours are
|
|
@@ -6,13 +6,6 @@ import { type DataColor } from '../../../../tokens/colors.js';
|
|
|
6
6
|
import type { ChartColor } from './types.js';
|
|
7
7
|
/** What a figure draws when its data names no colour; the stylesheets name the same token. */
|
|
8
8
|
export declare const DEFAULT_SERIES_COLOR = "var(--color-chart-default)";
|
|
9
|
-
/** The data colours white text reaches 4.5:1 on; any other named fill but the rest takes ink. */
|
|
10
|
-
export declare const DARK_FILLS: ReadonlySet<string>;
|
|
11
|
-
/**
|
|
12
|
-
* Whether text on rung `rung` (0 is the colour itself) of a variable's ladder is white: only on
|
|
13
|
-
* the darkest rung of a dark colour; every lighter rung takes ink.
|
|
14
|
-
*/
|
|
15
|
-
export declare function whiteOnRung(color: ChartColor | undefined, rung: number): boolean;
|
|
16
9
|
export declare function chartColor(color: ChartColor | undefined): string | undefined;
|
|
17
10
|
/** The edge under a line, a point or a legend shape in `color`, if that colour needs one. */
|
|
18
11
|
export declare function lineCasing(color: string | undefined): string | undefined;
|
|
@@ -30,6 +23,18 @@ export declare const LABEL_INK: Readonly<Record<DataColor, Rungs>>;
|
|
|
30
23
|
* other fill a host names (a role, a CSS colour) is light and takes ink.
|
|
31
24
|
*/
|
|
32
25
|
export declare function labelInk(color: string | undefined, step?: number): LabelInk;
|
|
26
|
+
/** The text a label on a dimmed fill takes: the text colour, ink, or none. */
|
|
27
|
+
export type DimmedInk = 'text' | 'ink' | null;
|
|
28
|
+
/**
|
|
29
|
+
* Which text reaches 4.5:1 on each step of each ladder once it is dimmed (`fill-opacity: .45` over
|
|
30
|
+
* the surface), in light and dark and in both house styles alike, as no component draws by mode
|
|
31
|
+
* or style: the text colour (near-black in light, white in dark), the near-black ink of a light
|
|
32
|
+
* fill, or neither (`null`), where the dimmed area carries no label and its tooltip names it. `colour-scheme.test.ts` checks
|
|
33
|
+
* every cell.
|
|
34
|
+
*/
|
|
35
|
+
export declare const DIMMED_INK: Readonly<Record<DataColor, readonly [DimmedInk, DimmedInk, DimmedInk, DimmedInk, DimmedInk]>>;
|
|
36
|
+
/** The ink of a label on step `step` of `color`'s ladder once dimmed; as `labelInk`, by default. */
|
|
37
|
+
export declare function dimmedLabelInk(color: string | undefined, step?: number): DimmedInk;
|
|
33
38
|
/** The class of a label drawn on a mark in that ink. */
|
|
34
39
|
export declare function insideLabelClass(ink: Exclude<LabelInk, null>): string;
|
|
35
40
|
/** The colour of a map point's series; colour names only. */
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The state a chart needs between renders; the charts themselves are render functions.
|
|
3
|
+
* The host (a Lit element) creates one controller per chart and passes it in `ChartOptions`.
|
|
4
|
+
*/
|
|
5
|
+
import type { TextFont } from '../../../../core/format.js';
|
|
1
6
|
import { type PlotArea } from './scale.js';
|
|
2
7
|
import type { LeafletSurface } from '../map-chart/leaflet.js';
|
|
3
8
|
import type { ChartSelection } from './mark-select.js';
|
|
@@ -20,6 +25,12 @@ export interface ChartOptions {
|
|
|
20
25
|
expanded?: boolean;
|
|
21
26
|
/** Cross-drill: the chosen mark's id. The chart keeps no selection of its own. */
|
|
22
27
|
selectedId?: string | null;
|
|
28
|
+
/**
|
|
29
|
+
* The host keeps a selection (cross-drill): a mark with a `href` chooses, a toggle. Without it
|
|
30
|
+
* the mark goes to its `href`, a link, also when the host cancels the event to route itself.
|
|
31
|
+
* Default: whether `selectedId` is given.
|
|
32
|
+
*/
|
|
33
|
+
choosing?: boolean;
|
|
23
34
|
/**
|
|
24
35
|
* A mark that carries a `href` was activated; `newTab` for a modifier or middle click. Without
|
|
25
36
|
* this the marks stay inert.
|
|
@@ -46,6 +57,8 @@ export interface TooltipRow {
|
|
|
46
57
|
marker?: 'line' | 'dashed' | 'dotted' | 'open' | KeyMark;
|
|
47
58
|
/** A quieter line under the row before it, such as a forecast's margin. */
|
|
48
59
|
note?: boolean;
|
|
60
|
+
/** One of what the row above holds, such as a part "Overig" folded: indented under it. */
|
|
61
|
+
part?: boolean;
|
|
49
62
|
/** A muted word after the value, such as "buiten de as". */
|
|
50
63
|
aside?: string;
|
|
51
64
|
}
|
|
@@ -80,6 +93,25 @@ export interface MeasureSpec {
|
|
|
80
93
|
/** The token is the height of the whole chart: legend, axis title and border come off it. */
|
|
81
94
|
fit?: boolean;
|
|
82
95
|
}
|
|
96
|
+
/**
|
|
97
|
+
* How long the pointer's tooltip waits before it follows the pointer to another mark or goes:
|
|
98
|
+
* on its way to the tooltip the pointer may cross a neighbour (WCAG 1.4.13).
|
|
99
|
+
*/
|
|
100
|
+
export declare const POINTER_GRACE = 200;
|
|
101
|
+
export interface ClientPoint {
|
|
102
|
+
x: number;
|
|
103
|
+
y: number;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Whether a move from `from` to `to` heads for `box`: `to` lies in the triangle between `from`
|
|
107
|
+
* and the side of the box that faces it, or in the box itself.
|
|
108
|
+
*/
|
|
109
|
+
export declare function headingFor(from: ClientPoint, to: ClientPoint, box: {
|
|
110
|
+
left: number;
|
|
111
|
+
top: number;
|
|
112
|
+
right: number;
|
|
113
|
+
bottom: number;
|
|
114
|
+
}): boolean;
|
|
83
115
|
export declare class ChartController {
|
|
84
116
|
/** Stable per chart: `<desc>` and the hatch pattern are addressed by it. */
|
|
85
117
|
readonly id: string;
|
|
@@ -112,6 +144,8 @@ export declare class ChartController {
|
|
|
112
144
|
mapTool: MapTool | null;
|
|
113
145
|
/** The tool the map's one select button shows: the last one used, until a shape is chosen. */
|
|
114
146
|
mapLastTool: MapTool | null;
|
|
147
|
+
/** The keyboard's focus is in the map: the drawing hint speaks of the keys. */
|
|
148
|
+
mapKeyboard: boolean;
|
|
115
149
|
/** The menu of tools stands open, and which row takes the focus once it has drawn. */
|
|
116
150
|
mapMenuOpen: boolean;
|
|
117
151
|
mapMenuFocus: 'first' | 'last' | 'checked' | null;
|
|
@@ -119,8 +153,13 @@ export declare class ChartController {
|
|
|
119
153
|
mapLegendOpen: boolean;
|
|
120
154
|
/** The area that chose marks, and the last one the host sent, compared as JSON. */
|
|
121
155
|
mapArea: MapArea | null;
|
|
156
|
+
/** The area that steps aside while a new one is drawn, to come back if that one is undone. */
|
|
157
|
+
mapAreaAside: MapArea | null;
|
|
122
158
|
hostArea: string | undefined;
|
|
123
159
|
hostSelection: string | null | undefined;
|
|
160
|
+
/** What the map's live region says about a drawn area: emptied, and filled a frame later. */
|
|
161
|
+
mapSaid: string;
|
|
162
|
+
private mapSayFrame;
|
|
124
163
|
/** The map's surface, created on the first render; `detach()` destroys it. */
|
|
125
164
|
leaflet: LeafletSurface | null;
|
|
126
165
|
/** Centre and zoom of the Leaflet map. `detach()` keeps it so a re-attach does not reset. */
|
|
@@ -129,6 +168,15 @@ export declare class ChartController {
|
|
|
129
168
|
lon: number;
|
|
130
169
|
zoom: number;
|
|
131
170
|
} | null;
|
|
171
|
+
/** What the pointer's tooltip stands for (a category, a mark); `undefined` for the keyboard's. */
|
|
172
|
+
private pointerKey;
|
|
173
|
+
private pointerTimer;
|
|
174
|
+
/** The key `pointerTimer` waits to show; `undefined` while it waits for nothing or to hide. */
|
|
175
|
+
private pendingKey;
|
|
176
|
+
/** Where the pointer was at its last move over a mark, in client coordinates. */
|
|
177
|
+
private pointerAt;
|
|
178
|
+
/** Lifts the mark the tooltip stands for, to bring the lift back from a neighbour. */
|
|
179
|
+
private pointerLift;
|
|
132
180
|
private readonly notify;
|
|
133
181
|
/** The data last drawn, and as JSON once its reference changed. */
|
|
134
182
|
private drawn;
|
|
@@ -140,7 +188,12 @@ export declare class ChartController {
|
|
|
140
188
|
private intersectionObserver;
|
|
141
189
|
constructor(requestUpdate: () => void);
|
|
142
190
|
requestUpdate(): void;
|
|
143
|
-
|
|
191
|
+
/**
|
|
192
|
+
* An axis label as this chart draws it, read from one (or from a hidden one before the first):
|
|
193
|
+
* the reader's default font and letter and word spacing reach every measurement. The tokens
|
|
194
|
+
* sit on the element's `:host`, not the document, so the family is read from the element.
|
|
195
|
+
*/
|
|
196
|
+
get font(): TextFont;
|
|
144
197
|
/**
|
|
145
198
|
* What to measure; applied by `attach` once the element exists. A spec that changes under a
|
|
146
199
|
* standing chart is read here, since Lit calls a stable `ref` only when the element changes.
|
|
@@ -161,16 +214,39 @@ export declare class ChartController {
|
|
|
161
214
|
*/
|
|
162
215
|
follow(data: unknown): void;
|
|
163
216
|
/**
|
|
164
|
-
*
|
|
165
|
-
*
|
|
166
|
-
*
|
|
217
|
+
* The pointer on a mark without a keyboard place of its own (a map's mark, a heatmap's cell):
|
|
218
|
+
* the tooltip stands at the middle of what shows of the mark, not at the pointer, relative to
|
|
219
|
+
* the `data-tooltip-anchor`. `from` is the mark when it is not the event's `currentTarget`.
|
|
167
220
|
*/
|
|
168
221
|
showTooltip(event: MouseEvent, content: TooltipContent, from?: Element): void;
|
|
222
|
+
/**
|
|
223
|
+
* The pointer is on the mark or category `key`, at `at`; `show` stands its tooltip and `lift`
|
|
224
|
+
* only lifts it. The same key changes nothing; another shows at once, unless the pointer heads
|
|
225
|
+
* for the tooltip: then only the lift follows, and the tooltip waits `POINTER_GRACE`, so the
|
|
226
|
+
* pointer can cross a neighbour on its way there and the tooltip under the pointer keeps it.
|
|
227
|
+
* Without `at` it always waits.
|
|
228
|
+
*/
|
|
229
|
+
pointTo(key: unknown, show: () => void, at?: ClientPoint, lift?: () => void): void;
|
|
230
|
+
private headingForTooltip;
|
|
231
|
+
/** The pointer left the marks: the tooltip goes after `POINTER_GRACE`, unless it reaches it. */
|
|
232
|
+
pointerLeft(): void;
|
|
233
|
+
/** The pointer is on the tooltip: it stays, and goes once the pointer leaves it too. */
|
|
234
|
+
enterTooltip(): void;
|
|
235
|
+
/** A neighbour lifted on the way to the tooltip hands the lift back to the tooltip's mark. */
|
|
236
|
+
private liftBack;
|
|
237
|
+
/**
|
|
238
|
+
* The category the pointer or the keyboard lifts. From one category to the next the lift
|
|
239
|
+
* jumps: its motion would trail the pointer. Only lifting from none moves.
|
|
240
|
+
*/
|
|
241
|
+
liftAt(index: number | null): void;
|
|
242
|
+
leaveTooltip(): void;
|
|
243
|
+
private clearPointerTimer;
|
|
169
244
|
/** The tooltip at a place relative to the `data-tooltip-anchor`: the keyboard's way in. */
|
|
170
245
|
/** `place`: `left` stands it left of `x`; a number is where it ends when it does not fit right. */
|
|
171
246
|
showTooltipAt(x: number, y: number, content: TooltipContent, place?: 'left' | number): void;
|
|
172
247
|
hideTooltip(): void;
|
|
173
|
-
|
|
248
|
+
/** No category under the pointer or the keyboard: the tooltip goes at once. */
|
|
249
|
+
hoverAt(index: number | null): void;
|
|
174
250
|
/**
|
|
175
251
|
* Escape on the chart hides its tooltip, and only then is it the chart's: a second Escape
|
|
176
252
|
* goes on to a selection or an enclosing modal. Returns whether it hid one.
|
|
@@ -180,6 +256,13 @@ export declare class ChartController {
|
|
|
180
256
|
private watching;
|
|
181
257
|
private watchEscape;
|
|
182
258
|
private unwatchEscape;
|
|
259
|
+
/**
|
|
260
|
+
* The chart's status region says what a choice on the drawing did, emptied first and filled a
|
|
261
|
+
* frame later, so the same sentence twice is heard twice (`LiveMessage`).
|
|
262
|
+
*/
|
|
263
|
+
sayStatus(text: string): void;
|
|
264
|
+
/** The map says a sentence in its live region, also the same one twice (`LiveMessage`). */
|
|
265
|
+
sayOnMap(text: string): void;
|
|
183
266
|
toggleLayer(index: number): void;
|
|
184
267
|
toggleOpen(id: string): void;
|
|
185
268
|
emphasise(label: string | null): void;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The parts of a stack past the ladder's five. Each part of one variable takes its own rung, so
|
|
3
|
+
* a sixth would repeat one: the largest four keep their place and their tint, and the rest fold
|
|
4
|
+
* into one "Overig" on top, the ladder's last and lightest rung, as the pie folds. The CSV keeps
|
|
5
|
+
* every part; the tooltip names the folded ones under "Overig".
|
|
6
|
+
|
|
7
|
+
/** The rungs of a ladder: more parts than this in one colour fold. */
|
|
8
|
+
export declare const LADDER_PARTS = 5;
|
|
9
|
+
/** The part the smallest fold into: the last rung, not clickable, its parts named in the tooltip. */
|
|
10
|
+
export interface OtherPart<S> {
|
|
11
|
+
label: string;
|
|
12
|
+
values: (number | null)[];
|
|
13
|
+
color: 'other';
|
|
14
|
+
folded: S[];
|
|
15
|
+
}
|
|
16
|
+
export declare const isOtherPart: <S>(row: S | OtherPart<S>) => row is OtherPart<S>;
|
|
17
|
+
/** A part the host calls "Overig", by its label or by `color: 'other'`: what folds joins it. */
|
|
18
|
+
export declare const namesOther: (row: {
|
|
19
|
+
label: string;
|
|
20
|
+
color?: unknown;
|
|
21
|
+
}) => boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Whether a part draws as "Overig", the ladder's last rung: what folded, or what the host calls
|
|
24
|
+
* so without a colour of its own (`other` is no colour of its own: it says "Overig").
|
|
25
|
+
*/
|
|
26
|
+
export declare const drawsAsOther: (row: {
|
|
27
|
+
label: string;
|
|
28
|
+
color?: unknown;
|
|
29
|
+
}) => boolean;
|
|
30
|
+
/**
|
|
31
|
+
* `series` with the parts that take a rung (`takesTint`) folded past five, into the host's own
|
|
32
|
+
* "Overig" where it sent one, as the pie does. A missing value in a folded part leaves "Overig"
|
|
33
|
+
* missing there too, never the sum of the rest (rule 15).
|
|
34
|
+
*/
|
|
35
|
+
export declare function foldStack<S extends {
|
|
36
|
+
label: string;
|
|
37
|
+
values: readonly (number | null)[];
|
|
38
|
+
}>(series: readonly S[], takesTint: (row: S) => boolean): (S | OtherPart<S>)[];
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The forecast of a line or bar chart: where it starts and how its margin reads. The chart
|
|
3
|
+
* element's table reads the same start, so drawing and table agree on what is a forecast.
|
|
4
|
+
*/
|
|
5
|
+
import { type TextFont } from '../../../../core/format.js';
|
|
1
6
|
import type { TooltipRow } from './controller.js';
|
|
2
7
|
import type { PlotArea } from './scale.js';
|
|
3
8
|
import type { ChartForecast } from './types.js';
|
|
@@ -11,7 +16,7 @@ export declare const BOUNDARY_GAP = 6;
|
|
|
11
16
|
* Whether the forecast's word fits right of the boundary at `x`, within the plot. When it does
|
|
12
17
|
* not, it takes a row of its own above "Gemeten", so it never stands over the line or that word.
|
|
13
18
|
*/
|
|
14
|
-
export declare function forecastWordFits(x: number, area: Pick<PlotArea, 'width' | 'right'>, label: string,
|
|
19
|
+
export declare function forecastWordFits(x: number, area: Pick<PlotArea, 'width' | 'right'>, label: string, font?: TextFont | string): boolean;
|
|
15
20
|
/** The room above the plot for the boundary's words: one row, or two for a word of its own. */
|
|
16
21
|
export declare function forecastRoom(fits: boolean): number;
|
|
17
22
|
/** What the drawing's description adds, as it names its events: where measuring stops. */
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* A chart mark that drills. A mark is clickable only when its data point carries a `href
|
|
3
|
-
*
|
|
2
|
+
* A chart mark that drills. A mark is clickable only when its data point carries a `href`;
|
|
3
|
+
* without one it is inert. It goes to that page, so it is a link, unless the host keeps a
|
|
4
|
+
* selection (`options.choosing`): then it chooses, a toggle with `aria-pressed`.
|
|
4
5
|
*
|
|
5
6
|
* The selection is not kept here: the chosen mark is whatever `options.selectedId` says, so
|
|
6
7
|
* the URL is the only state. Clearing (the chosen mark again, or Escape) emits
|
|
@@ -21,7 +22,7 @@ export interface MarkAttributes {
|
|
|
21
22
|
/** The `is-*` states, to chain onto the mark's own BEM class. */
|
|
22
23
|
state: string;
|
|
23
24
|
markId: string | typeof nothing;
|
|
24
|
-
role: 'button' | typeof nothing;
|
|
25
|
+
role: 'button' | 'link' | typeof nothing;
|
|
25
26
|
tabIndex: 0 | typeof nothing;
|
|
26
27
|
pressed: 'true' | 'false' | typeof nothing;
|
|
27
28
|
label: string | typeof nothing;
|