@expressivecss/expressive 0.11.0 → 0.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +392 -7
- package/README.md +37 -1
- package/dist/css/expressive.css +5440 -234
- package/dist/css/expressive.css.map +1 -1
- package/dist/css/expressive.min.css +1 -1
- package/dist/css/expressive.min.css.map +1 -1
- package/dist/fonts/material-symbols-outlined.woff2 +0 -0
- package/dist/fonts/material-symbols-rounded.woff2 +0 -0
- package/dist/fonts/material-symbols-sharp.woff2 +0 -0
- package/dist/js/chunks/{chunk-AYYYWUJ4.mjs → chunk-3CLXLPYS.mjs} +17 -11
- package/dist/js/chunks/chunk-3CLXLPYS.mjs.map +7 -0
- package/dist/js/chunks/chunk-3DHK5CZU.mjs +105 -0
- package/dist/js/chunks/chunk-3DHK5CZU.mjs.map +7 -0
- package/dist/js/chunks/{chunk-IMUPRRI6.mjs → chunk-3VOK6J7U.mjs} +3 -3
- package/dist/js/chunks/chunk-4PWAPV6F.mjs +7 -0
- package/dist/js/chunks/chunk-4PWAPV6F.mjs.map +7 -0
- package/dist/js/chunks/{chunk-XFJ452AZ.mjs → chunk-55IA2XUC.mjs} +5 -6
- package/dist/js/chunks/{chunk-XFJ452AZ.mjs.map → chunk-55IA2XUC.mjs.map} +2 -2
- package/dist/js/chunks/{chunk-XDB3G6RL.mjs → chunk-6N2XAEFK.mjs} +15 -4
- package/dist/js/chunks/{chunk-XDB3G6RL.mjs.map → chunk-6N2XAEFK.mjs.map} +2 -2
- package/dist/js/chunks/{chunk-MISGHDUU.mjs → chunk-6OMRGML6.mjs} +9 -7
- package/dist/js/chunks/{chunk-MISGHDUU.mjs.map → chunk-6OMRGML6.mjs.map} +2 -2
- package/dist/js/chunks/{chunk-A3BJA7V4.mjs → chunk-6WLSDZ4O.mjs} +2 -2
- package/dist/js/chunks/chunk-CCWDV5CR.mjs +292 -0
- package/dist/js/chunks/chunk-CCWDV5CR.mjs.map +7 -0
- package/dist/js/chunks/{chunk-JODJAGFS.mjs → chunk-CKQP6P76.mjs} +31 -8
- package/dist/js/chunks/chunk-CKQP6P76.mjs.map +7 -0
- package/dist/js/chunks/{chunk-KR44BSYQ.mjs → chunk-DLWYKFEI.mjs} +3 -3
- package/dist/js/chunks/chunk-DTKR54I6.mjs +270 -0
- package/dist/js/chunks/chunk-DTKR54I6.mjs.map +7 -0
- package/dist/js/chunks/{chunk-SLFNPY5M.mjs → chunk-EC63CHXU.mjs} +2 -2
- package/dist/js/chunks/chunk-GVGT6MIU.mjs +47 -0
- package/dist/js/chunks/chunk-GVGT6MIU.mjs.map +7 -0
- package/dist/js/chunks/{chunk-LZVBJ33S.mjs → chunk-GZWPXXY6.mjs} +15 -8
- package/dist/js/chunks/chunk-GZWPXXY6.mjs.map +7 -0
- package/dist/js/chunks/chunk-HKT2S7VM.mjs +48 -0
- package/dist/js/chunks/chunk-HKT2S7VM.mjs.map +7 -0
- package/dist/js/chunks/{chunk-D4UZ4HFN.mjs → chunk-IFXVDDDH.mjs} +23 -11
- package/dist/js/chunks/chunk-IFXVDDDH.mjs.map +7 -0
- package/dist/js/chunks/chunk-K4CJCRGE.mjs +262 -0
- package/dist/js/chunks/chunk-K4CJCRGE.mjs.map +7 -0
- package/dist/js/chunks/chunk-LNCCYGPC.mjs +163 -0
- package/dist/js/chunks/chunk-LNCCYGPC.mjs.map +7 -0
- package/dist/js/chunks/{chunk-QSQ24FYT.mjs → chunk-LTWPGFBR.mjs} +2 -2
- package/dist/js/chunks/{chunk-QSQ24FYT.mjs.map → chunk-LTWPGFBR.mjs.map} +2 -2
- package/dist/js/chunks/{chunk-I5KR22BY.mjs → chunk-LWBQIX5J.mjs} +15 -15
- package/dist/js/chunks/chunk-LWBQIX5J.mjs.map +7 -0
- package/dist/js/chunks/{chunk-GY2Z5CJ2.mjs → chunk-NNYP33NB.mjs} +67 -32
- package/dist/js/chunks/chunk-NNYP33NB.mjs.map +7 -0
- package/dist/js/chunks/chunk-NQLC3YMW.mjs +1 -0
- package/dist/js/chunks/chunk-O5XPWXIQ.mjs +406 -0
- package/dist/js/chunks/chunk-O5XPWXIQ.mjs.map +7 -0
- package/dist/js/chunks/chunk-P3G3QHII.mjs +166 -0
- package/dist/js/chunks/chunk-P3G3QHII.mjs.map +7 -0
- package/dist/js/chunks/{chunk-VAS6JQ6P.mjs → chunk-PIJ2TAR3.mjs} +3 -3
- package/dist/js/chunks/{chunk-74N6U5JJ.mjs → chunk-PLYXLSH3.mjs} +38 -37
- package/dist/js/chunks/chunk-PLYXLSH3.mjs.map +7 -0
- package/dist/js/chunks/{chunk-PIIAEYAJ.mjs → chunk-QDAL4IYN.mjs} +2 -2
- package/dist/js/chunks/chunk-QKWPQK5N.mjs +179 -0
- package/dist/js/chunks/chunk-QKWPQK5N.mjs.map +7 -0
- package/dist/js/chunks/{chunk-FRB7TOCS.mjs → chunk-QV2JAWIZ.mjs} +2 -2
- package/dist/js/chunks/{chunk-N3UHGN3N.mjs → chunk-QVVEWBOF.mjs} +3 -3
- package/dist/js/chunks/chunk-RHRQKTTX.mjs +139 -0
- package/dist/js/chunks/chunk-RHRQKTTX.mjs.map +7 -0
- package/dist/js/chunks/chunk-SPETGK25.mjs +59 -0
- package/dist/js/chunks/chunk-SPETGK25.mjs.map +7 -0
- package/dist/js/chunks/{chunk-TK6PX2GC.mjs → chunk-U2OTHOTI.mjs} +131 -19
- package/dist/js/chunks/chunk-U2OTHOTI.mjs.map +7 -0
- package/dist/js/chunks/{chunk-TYM6U5DY.mjs → chunk-UAEAQBRC.mjs} +2 -2
- package/dist/js/chunks/{chunk-7UXHSYIA.mjs → chunk-UBLRRJ7N.mjs} +3 -3
- package/dist/js/chunks/{chunk-EP3CVKB5.mjs → chunk-UEZUJQ66.mjs} +8 -5
- package/dist/js/chunks/chunk-UEZUJQ66.mjs.map +7 -0
- package/dist/js/chunks/{chunk-JNPIWFJT.mjs → chunk-UNEMYWEW.mjs} +3 -3
- package/dist/js/chunks/chunk-VTLBW7QS.mjs +124 -0
- package/dist/js/chunks/chunk-VTLBW7QS.mjs.map +7 -0
- package/dist/js/chunks/{chunk-JKNPQQWY.mjs → chunk-WJXDBPXQ.mjs} +28 -12
- package/dist/js/chunks/chunk-WJXDBPXQ.mjs.map +7 -0
- package/dist/js/chunks/{chunk-CDW6WIRT.mjs → chunk-XGHORT7J.mjs} +18 -11
- package/dist/js/chunks/chunk-XGHORT7J.mjs.map +7 -0
- package/dist/js/chunks/{chunk-7GKXUG4B.mjs → chunk-XH6BEEMY.mjs} +78 -25
- package/dist/js/chunks/chunk-XH6BEEMY.mjs.map +7 -0
- package/dist/js/chunks/{chunk-XO5WX3TK.mjs → chunk-YDCS5S3J.mjs} +2 -2
- package/dist/js/expressive.cjs +2540 -233
- package/dist/js/expressive.cjs.map +4 -4
- package/dist/js/expressive.js +2540 -233
- package/dist/js/expressive.js.map +4 -4
- package/dist/js/expressive.min.js +10 -10
- package/dist/js/expressive.min.js.map +4 -4
- package/dist/js/expressive.mjs +86 -38
- package/dist/js/expressive.mjs.map +1 -1
- package/dist/js/internal/behaviors/bottomSheets.mjs +3 -3
- package/dist/js/internal/behaviors/dialogs.mjs +2 -2
- package/dist/js/internal/behaviors/forms.mjs +2 -2
- package/dist/js/internal/behaviors/sheetDrag.mjs +2 -2
- package/dist/js/internal/behaviors/sideSheets.mjs +3 -3
- package/dist/js/internal/components/appBar.mjs +2 -2
- package/dist/js/internal/components/autocomplete.mjs +4 -4
- package/dist/js/internal/components/barChart.mjs +10 -0
- package/dist/js/internal/components/barChart.mjs.map +7 -0
- package/dist/js/internal/components/buttonGroup.mjs +2 -2
- package/dist/js/internal/components/buttons.mjs +3 -3
- package/dist/js/internal/components/cards.mjs +3 -3
- package/dist/js/internal/components/carousel.mjs +3 -3
- package/dist/js/internal/components/characterCounter.mjs +2 -2
- package/dist/js/internal/components/chips.mjs +5 -5
- package/dist/js/internal/components/columnChart.mjs +9 -0
- package/dist/js/internal/components/columnChart.mjs.map +7 -0
- package/dist/js/internal/components/commandPalette.mjs +9 -0
- package/dist/js/internal/components/commandPalette.mjs.map +7 -0
- package/dist/js/internal/components/datepicker.mjs +6 -6
- package/dist/js/internal/components/expandingCard.mjs +3 -3
- package/dist/js/internal/components/heatmapChart.mjs +9 -0
- package/dist/js/internal/components/heatmapChart.mjs.map +7 -0
- package/dist/js/internal/components/index.mjs +79 -31
- package/dist/js/internal/components/lightbox.mjs +3 -3
- package/dist/js/internal/components/lineChart.mjs +12 -0
- package/dist/js/internal/components/lineChart.mjs.map +7 -0
- package/dist/js/internal/components/menu.mjs +3 -3
- package/dist/js/internal/components/messageScroller.mjs +9 -0
- package/dist/js/internal/components/messageScroller.mjs.map +7 -0
- package/dist/js/internal/components/mixedChart.mjs +10 -0
- package/dist/js/internal/components/mixedChart.mjs.map +7 -0
- package/dist/js/internal/components/navigationRail.mjs +2 -2
- package/dist/js/internal/components/pieChart.mjs +9 -0
- package/dist/js/internal/components/pieChart.mjs.map +7 -0
- package/dist/js/internal/components/questionnaire.mjs +9 -0
- package/dist/js/internal/components/questionnaire.mjs.map +7 -0
- package/dist/js/internal/components/radarChart.mjs +9 -0
- package/dist/js/internal/components/radarChart.mjs.map +7 -0
- package/dist/js/internal/components/radialChart.mjs +9 -0
- package/dist/js/internal/components/radialChart.mjs.map +7 -0
- package/dist/js/internal/components/registry.mjs +37 -25
- package/dist/js/internal/components/richTextEditor.mjs +9 -0
- package/dist/js/internal/components/richTextEditor.mjs.map +7 -0
- package/dist/js/internal/components/scrollspy.mjs +2 -2
- package/dist/js/internal/components/select.mjs +4 -4
- package/dist/js/internal/components/slider.mjs +3 -3
- package/dist/js/internal/components/snackbar.mjs +2 -2
- package/dist/js/internal/components/tabs.mjs +4 -4
- package/dist/js/internal/components/timepicker.mjs +4 -4
- package/dist/js/internal/components/tooltip.mjs +3 -3
- package/dist/js/internal/core/component.mjs +1 -1
- package/dist/js/internal/core/utils.mjs +1 -1
- package/dist/js/internal/plugins/dockedDisplayPlugin.mjs +2 -2
- package/dist/js/modular.mjs +86 -38
- package/dist/types/behaviors/forms.d.ts +22 -0
- package/dist/types/components/appBar.d.ts +1 -1
- package/dist/types/components/barChart.d.ts +24 -0
- package/dist/types/components/columnChart.d.ts +21 -0
- package/dist/types/components/commandPalette.d.ts +96 -0
- package/dist/types/components/datepicker.d.ts +5 -2
- package/dist/types/components/heatmapChart.d.ts +49 -0
- package/dist/types/components/index.d.ts +12 -0
- package/dist/types/components/lineChart.d.ts +134 -0
- package/dist/types/components/menu.d.ts +32 -0
- package/dist/types/components/messageScroller.d.ts +111 -0
- package/dist/types/components/mixedChart.d.ts +25 -0
- package/dist/types/components/pieChart.d.ts +40 -0
- package/dist/types/components/questionnaire.d.ts +96 -0
- package/dist/types/components/radarChart.d.ts +39 -0
- package/dist/types/components/radialChart.d.ts +45 -0
- package/dist/types/components/registry.d.ts +44 -0
- package/dist/types/components/richTextEditor.d.ts +71 -0
- package/dist/types/components/slider.d.ts +1 -0
- package/dist/types/components/snackbar.d.ts +6 -0
- package/dist/types/components/timepicker.d.ts +4 -1
- package/dist/types/components/tooltip.d.ts +2 -1
- package/dist/types/modular.d.ts +10 -1
- package/package.json +4 -1
- package/src/sass/README.md +3 -6
- package/src/sass/abstracts/_index.scss +1 -1
- package/src/sass/abstracts/_mixins.scss +226 -0
- package/src/sass/abstracts/_variables.scss +14 -0
- package/src/sass/base/_typography.scss +45 -0
- package/src/sass/components/_accordion.scss +161 -0
- package/src/sass/components/_aura.scss +119 -0
- package/src/sass/components/_avatar.scss +86 -0
- package/src/sass/components/_bar-chart.scss +285 -0
- package/src/sass/components/_bottom-sheet.scss +1 -0
- package/src/sass/components/_button-groups.scss +13 -3
- package/src/sass/components/_cards.scss +16 -13
- package/src/sass/components/_carousel.scss +9 -7
- package/src/sass/components/_column-chart.scss +134 -0
- package/src/sass/components/_command-palette.scss +140 -0
- package/src/sass/components/_countdown.scss +89 -0
- package/src/sass/components/_data-table.scss +188 -0
- package/src/sass/components/_dialog.scss +1 -0
- package/src/sass/components/_empty-state.scss +78 -0
- package/src/sass/components/_expanding-card.scss +3 -0
- package/src/sass/components/_heatmap-chart.scss +156 -0
- package/src/sass/components/_index.scss +27 -0
- package/src/sass/components/_kpi.scss +162 -0
- package/src/sass/components/_line-chart.scss +102 -0
- package/src/sass/components/_marquee.scss +111 -0
- package/src/sass/components/_menu.scss +10 -0
- package/src/sass/components/_message-scroller.scss +66 -0
- package/src/sass/components/_message.scss +202 -0
- package/src/sass/components/_mixed-chart.scss +157 -0
- package/src/sass/components/_navbar.scss +11 -6
- package/src/sass/components/_navigation-bar.scss +1 -0
- package/src/sass/components/_navigation-rail.scss +9 -0
- package/src/sass/components/_page-footer.scss +0 -11
- package/src/sass/components/_pie-chart.scss +203 -0
- package/src/sass/components/_popover.scss +112 -0
- package/src/sass/components/_progress.scss +25 -6
- package/src/sass/components/_questionnaire.scss +144 -0
- package/src/sass/components/_radar-chart.scss +205 -0
- package/src/sass/components/_radial-chart.scss +174 -0
- package/src/sass/components/_rich-text-editor.scss +99 -0
- package/src/sass/components/_search.scss +1 -0
- package/src/sass/components/_side-sheet.scss +1 -0
- package/src/sass/components/_skeleton.scss +81 -0
- package/src/sass/components/_snackbar.scss +2 -1
- package/src/sass/components/_stat.scss +86 -0
- package/src/sass/components/_stepper.scss +190 -0
- package/src/sass/components/_timeline.scss +114 -0
- package/src/sass/components/_timepicker.scss +2 -2
- package/src/sass/components/_toolbar.scss +2 -1
- package/src/sass/components/_tooltip.scss +2 -0
- package/src/sass/components/_tree.scss +139 -0
- package/src/sass/components/forms/_checkboxes.scss +2 -2
- package/src/sass/components/forms/_drop-zone.scss +128 -0
- package/src/sass/components/forms/_index.scss +2 -0
- package/src/sass/components/forms/_input-fields.scss +166 -15
- package/src/sass/components/forms/_radio-buttons.scss +2 -2
- package/src/sass/components/forms/_rating.scss +165 -0
- package/src/sass/components/forms/_slider.scss +51 -29
- package/src/sass/components/forms/_switches.scss +3 -3
- package/src/sass/tokens/_reference.scss +3 -15
- package/src/sass/utilities/_helpers.scss +14 -0
- package/src/sass/utilities/_index.scss +2 -0
- package/src/sass/utilities/_scroll-area.scss +35 -0
- package/src/sass/utilities/_shapes.scss +164 -0
- package/src/sass/utilities/_spacing.scss +29 -23
- package/src/sass/utilities/_visibility.scss +3 -2
- package/dist/js/chunks/chunk-74N6U5JJ.mjs.map +0 -7
- package/dist/js/chunks/chunk-7GKXUG4B.mjs.map +0 -7
- package/dist/js/chunks/chunk-AYYYWUJ4.mjs.map +0 -7
- package/dist/js/chunks/chunk-CDW6WIRT.mjs.map +0 -7
- package/dist/js/chunks/chunk-D4UZ4HFN.mjs.map +0 -7
- package/dist/js/chunks/chunk-EP3CVKB5.mjs.map +0 -7
- package/dist/js/chunks/chunk-GY2Z5CJ2.mjs.map +0 -7
- package/dist/js/chunks/chunk-I5KR22BY.mjs.map +0 -7
- package/dist/js/chunks/chunk-JKNPQQWY.mjs.map +0 -7
- package/dist/js/chunks/chunk-JODJAGFS.mjs.map +0 -7
- package/dist/js/chunks/chunk-JR24UB4X.mjs +0 -100
- package/dist/js/chunks/chunk-JR24UB4X.mjs.map +0 -7
- package/dist/js/chunks/chunk-LZVBJ33S.mjs.map +0 -7
- package/dist/js/chunks/chunk-PMBPAFAS.mjs +0 -7
- package/dist/js/chunks/chunk-PMBPAFAS.mjs.map +0 -7
- package/dist/js/chunks/chunk-TK6PX2GC.mjs.map +0 -7
- package/dist/js/chunks/chunk-WWPAPHMA.mjs +0 -1
- /package/dist/js/chunks/{chunk-IMUPRRI6.mjs.map → chunk-3VOK6J7U.mjs.map} +0 -0
- /package/dist/js/chunks/{chunk-A3BJA7V4.mjs.map → chunk-6WLSDZ4O.mjs.map} +0 -0
- /package/dist/js/chunks/{chunk-KR44BSYQ.mjs.map → chunk-DLWYKFEI.mjs.map} +0 -0
- /package/dist/js/chunks/{chunk-SLFNPY5M.mjs.map → chunk-EC63CHXU.mjs.map} +0 -0
- /package/dist/js/chunks/{chunk-WWPAPHMA.mjs.map → chunk-NQLC3YMW.mjs.map} +0 -0
- /package/dist/js/chunks/{chunk-VAS6JQ6P.mjs.map → chunk-PIJ2TAR3.mjs.map} +0 -0
- /package/dist/js/chunks/{chunk-PIIAEYAJ.mjs.map → chunk-QDAL4IYN.mjs.map} +0 -0
- /package/dist/js/chunks/{chunk-FRB7TOCS.mjs.map → chunk-QV2JAWIZ.mjs.map} +0 -0
- /package/dist/js/chunks/{chunk-N3UHGN3N.mjs.map → chunk-QVVEWBOF.mjs.map} +0 -0
- /package/dist/js/chunks/{chunk-TYM6U5DY.mjs.map → chunk-UAEAQBRC.mjs.map} +0 -0
- /package/dist/js/chunks/{chunk-7UXHSYIA.mjs.map → chunk-UBLRRJ7N.mjs.map} +0 -0
- /package/dist/js/chunks/{chunk-JNPIWFJT.mjs.map → chunk-UNEMYWEW.mjs.map} +0 -0
- /package/dist/js/chunks/{chunk-XO5WX3TK.mjs.map → chunk-YDCS5S3J.mjs.map} +0 -0
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Utils
|
|
3
|
+
} from "./chunk-6OMRGML6.mjs";
|
|
4
|
+
import {
|
|
5
|
+
Component
|
|
6
|
+
} from "./chunk-LTWPGFBR.mjs";
|
|
7
|
+
|
|
8
|
+
// src/ts/components/questionnaire.ts
|
|
9
|
+
var _defaults = {
|
|
10
|
+
progressLabel: "Question {current} of {total}",
|
|
11
|
+
requiredMessage: "Choose an answer to continue."
|
|
12
|
+
};
|
|
13
|
+
var NAVIGATION = ["previous", "skip", "next"];
|
|
14
|
+
var Questionnaire = class _Questionnaire extends Component {
|
|
15
|
+
constructor(el, options) {
|
|
16
|
+
super(el, options, _Questionnaire);
|
|
17
|
+
this._active = null;
|
|
18
|
+
this._generated = [];
|
|
19
|
+
this._generatedIds = [];
|
|
20
|
+
/** Set while one submission's invalid events arrive, so only the first opens. */
|
|
21
|
+
this._reporting = false;
|
|
22
|
+
/** Shows the question at `index` without checking the current one. */
|
|
23
|
+
this.goTo = (index) => {
|
|
24
|
+
const item = this.items[index];
|
|
25
|
+
if (!item) return;
|
|
26
|
+
this._active = item;
|
|
27
|
+
this._render();
|
|
28
|
+
const controls = this._controls(item).filter((control) => !control.disabled);
|
|
29
|
+
(controls.find((control) => control.checked) ?? controls[0])?.focus();
|
|
30
|
+
};
|
|
31
|
+
/** Checks the shown question and moves to the next one if it is answered. */
|
|
32
|
+
this.next = () => {
|
|
33
|
+
if (this._validate(this._active)) this.goTo(this.index + 1);
|
|
34
|
+
};
|
|
35
|
+
/** Moves to the previous question. */
|
|
36
|
+
this.previous = () => this.goTo(this.index - 1);
|
|
37
|
+
/** Clears the answer to the shown question and moves to the next one. */
|
|
38
|
+
this.skip = () => {
|
|
39
|
+
if (!this._active) return;
|
|
40
|
+
for (const control of this._controls(this._active)) {
|
|
41
|
+
const isChoice = control instanceof HTMLInputElement && (control.type === "radio" || control.type === "checkbox");
|
|
42
|
+
if (isChoice ? !control.checked : !control.value) continue;
|
|
43
|
+
if (isChoice) control.checked = false;
|
|
44
|
+
else control.value = "";
|
|
45
|
+
control.dispatchEvent(new Event("change", { bubbles: true }));
|
|
46
|
+
}
|
|
47
|
+
this.goTo(this.index + 1);
|
|
48
|
+
};
|
|
49
|
+
this._handleClick = (e) => {
|
|
50
|
+
const button = e.target.closest?.("button");
|
|
51
|
+
if (!button || !this._buttons().includes(button)) return;
|
|
52
|
+
if (NAVIGATION.includes(button.value)) {
|
|
53
|
+
e.preventDefault();
|
|
54
|
+
this[button.value]();
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
this._syncRequired();
|
|
58
|
+
};
|
|
59
|
+
// Enter in a field moves on instead of submitting the form early.
|
|
60
|
+
this._handleKeydown = (e) => {
|
|
61
|
+
if (e.key !== "Enter" || e.defaultPrevented || e.isComposing) return;
|
|
62
|
+
if (!(e.target instanceof HTMLInputElement) || this.index >= this.items.length - 1) return;
|
|
63
|
+
e.preventDefault();
|
|
64
|
+
this.next();
|
|
65
|
+
};
|
|
66
|
+
// A submission found an unanswered question, possibly a hidden one. Open the
|
|
67
|
+
// first instead of letting the browser report a control it cannot show.
|
|
68
|
+
// One submission fires its invalid events in a single task.
|
|
69
|
+
this._handleInvalid = (e) => {
|
|
70
|
+
const item = this.items.find((item2) => item2.contains(e.target));
|
|
71
|
+
if (!item) return;
|
|
72
|
+
e.preventDefault();
|
|
73
|
+
if (this._reporting) return;
|
|
74
|
+
this._reporting = true;
|
|
75
|
+
setTimeout(() => this._reporting = false);
|
|
76
|
+
this._active = item;
|
|
77
|
+
this._render();
|
|
78
|
+
this._validate(item);
|
|
79
|
+
};
|
|
80
|
+
// An answer clears the question's error.
|
|
81
|
+
this._handleInput = (e) => {
|
|
82
|
+
this._syncRequired();
|
|
83
|
+
const item = e.target.closest?.("fieldset");
|
|
84
|
+
if (item instanceof HTMLFieldSetElement && item.classList.contains("invalid")) this._setInvalid(item, false);
|
|
85
|
+
};
|
|
86
|
+
this.el["Expressive_Questionnaire"] = this;
|
|
87
|
+
const progressLabel = el.dataset.progressLabel;
|
|
88
|
+
this.options = {
|
|
89
|
+
..._Questionnaire.defaults,
|
|
90
|
+
...progressLabel ? { progressLabel } : {},
|
|
91
|
+
...options
|
|
92
|
+
};
|
|
93
|
+
this._progress = document.createElement("div");
|
|
94
|
+
this._progress.className = "questionnaire-progress";
|
|
95
|
+
this._progressText = document.createElement("span");
|
|
96
|
+
this._progressText.id = `questionnaire-progress-${Utils.guid()}`;
|
|
97
|
+
this._progressBar = document.createElement("progress");
|
|
98
|
+
this._progressBar.className = "progress";
|
|
99
|
+
this._progressBar.setAttribute("aria-labelledby", this._progressText.id);
|
|
100
|
+
this._progress.append(this._progressText, this._progressBar);
|
|
101
|
+
this.el.prepend(this._progress);
|
|
102
|
+
for (const item of this._fieldsets()) {
|
|
103
|
+
const ids = Array.from(item.querySelectorAll(":scope > p:not(.questionnaire-error)")).map((p) => this._ensureId(p, "questionnaire-description"));
|
|
104
|
+
if (ids.length && !item.hasAttribute("aria-describedby")) {
|
|
105
|
+
item.setAttribute("aria-describedby", ids.join(" "));
|
|
106
|
+
this._generatedIds.push(item);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
this._active = this.items[0] ?? null;
|
|
110
|
+
this._syncRequired();
|
|
111
|
+
this._render();
|
|
112
|
+
this._observer = new MutationObserver(() => {
|
|
113
|
+
this._syncRequired();
|
|
114
|
+
this._render();
|
|
115
|
+
});
|
|
116
|
+
this._observer.observe(this.el, { attributes: true, subtree: true, attributeFilter: ["disabled"] });
|
|
117
|
+
this.el.addEventListener("click", this._handleClick);
|
|
118
|
+
this.el.addEventListener("keydown", this._handleKeydown);
|
|
119
|
+
this.el.addEventListener("input", this._handleInput);
|
|
120
|
+
this.el.addEventListener("invalid", this._handleInvalid, true);
|
|
121
|
+
}
|
|
122
|
+
static get defaults() {
|
|
123
|
+
return _defaults;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Initializes instances of Questionnaire.
|
|
127
|
+
* @param els HTML elements.
|
|
128
|
+
* @param options Component options.
|
|
129
|
+
*/
|
|
130
|
+
static init(els, options = {}) {
|
|
131
|
+
return super.init(els, options, _Questionnaire);
|
|
132
|
+
}
|
|
133
|
+
static getInstance(el) {
|
|
134
|
+
return el["Expressive_Questionnaire"];
|
|
135
|
+
}
|
|
136
|
+
/** The questions that apply: every fieldset child that is not disabled. */
|
|
137
|
+
get items() {
|
|
138
|
+
return this._fieldsets().filter((item) => !item.disabled);
|
|
139
|
+
}
|
|
140
|
+
/** Position of the shown question in `items`. */
|
|
141
|
+
get index() {
|
|
142
|
+
return this.items.indexOf(this._active);
|
|
143
|
+
}
|
|
144
|
+
destroy() {
|
|
145
|
+
this._observer.disconnect();
|
|
146
|
+
this.el.removeEventListener("click", this._handleClick);
|
|
147
|
+
this.el.removeEventListener("keydown", this._handleKeydown);
|
|
148
|
+
this.el.removeEventListener("input", this._handleInput);
|
|
149
|
+
this.el.removeEventListener("invalid", this._handleInvalid, true);
|
|
150
|
+
for (const item of this._fieldsets()) {
|
|
151
|
+
if (item.hasAttribute("data-required")) for (const control of this._controls(item)) control.setCustomValidity("");
|
|
152
|
+
item.hidden = false;
|
|
153
|
+
this._setInvalid(item, false);
|
|
154
|
+
}
|
|
155
|
+
for (const button of this._buttons()) button.hidden = false;
|
|
156
|
+
this._progress.remove();
|
|
157
|
+
for (const el of this._generated) el.remove();
|
|
158
|
+
for (const el of this._generatedIds) {
|
|
159
|
+
el.removeAttribute(el instanceof HTMLFieldSetElement ? "aria-describedby" : "id");
|
|
160
|
+
}
|
|
161
|
+
this.el["Expressive_Questionnaire"] = void 0;
|
|
162
|
+
}
|
|
163
|
+
_fieldsets() {
|
|
164
|
+
return Array.from(this.el.querySelectorAll(":scope > fieldset"));
|
|
165
|
+
}
|
|
166
|
+
/** The footer's navigation and submit buttons. */
|
|
167
|
+
_buttons() {
|
|
168
|
+
return Array.from(this.el.querySelectorAll(":scope > footer > button")).filter(
|
|
169
|
+
(button) => NAVIGATION.includes(button.value) || button.type === "submit"
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
_controls(item) {
|
|
173
|
+
return Array.from(item.elements).filter(
|
|
174
|
+
(el) => el instanceof HTMLTextAreaElement || el instanceof HTMLSelectElement || el instanceof HTMLInputElement && el.type !== "button" && el.type !== "submit"
|
|
175
|
+
);
|
|
176
|
+
}
|
|
177
|
+
_required(item) {
|
|
178
|
+
return item.hasAttribute("data-required") || this._controls(item).some((control) => control.required);
|
|
179
|
+
}
|
|
180
|
+
_ensureId(el, prefix) {
|
|
181
|
+
if (!el.id) {
|
|
182
|
+
el.id = `${prefix}-${Utils.guid()}`;
|
|
183
|
+
this._generatedIds.push(el);
|
|
184
|
+
}
|
|
185
|
+
return el.id;
|
|
186
|
+
}
|
|
187
|
+
_render() {
|
|
188
|
+
const items = this.items;
|
|
189
|
+
if (!items.includes(this._active)) {
|
|
190
|
+
const all = this._fieldsets();
|
|
191
|
+
const after = all.slice(all.indexOf(this._active) + 1).find((item) => !item.disabled);
|
|
192
|
+
this._active = after ?? items[items.length - 1] ?? null;
|
|
193
|
+
}
|
|
194
|
+
const index = items.indexOf(this._active);
|
|
195
|
+
const last = index === items.length - 1;
|
|
196
|
+
for (const item of this._fieldsets()) item.hidden = item !== this._active;
|
|
197
|
+
for (const button of this._buttons()) {
|
|
198
|
+
if (button.value === "previous") button.hidden = index <= 0;
|
|
199
|
+
else if (button.value === "skip") button.hidden = last || !this._active || this._required(this._active);
|
|
200
|
+
else if (button.value === "next") button.hidden = last;
|
|
201
|
+
else button.hidden = !last;
|
|
202
|
+
}
|
|
203
|
+
this._progressText.textContent = this.options.progressLabel.replace("{current}", String(index + 1)).replace("{total}", String(items.length));
|
|
204
|
+
this._progressBar.max = Math.max(items.length, 1);
|
|
205
|
+
this._progressBar.value = index + 1;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Puts "choose at least one" on the first enabled checkbox of each
|
|
209
|
+
* data-required group with none checked, so the browser's validation, and
|
|
210
|
+
* every way of submitting, sees it. A disabled checkbox is not sent, so it
|
|
211
|
+
* does not count.
|
|
212
|
+
*/
|
|
213
|
+
_syncRequired() {
|
|
214
|
+
for (const item of this._fieldsets()) {
|
|
215
|
+
if (!item.hasAttribute("data-required")) continue;
|
|
216
|
+
const boxes = this._controls(item).filter(
|
|
217
|
+
(control) => control instanceof HTMLInputElement && control.type === "checkbox"
|
|
218
|
+
);
|
|
219
|
+
const enabled = boxes.filter((box) => !box.disabled);
|
|
220
|
+
for (const box of boxes) box.setCustomValidity("");
|
|
221
|
+
if (enabled.length && !enabled.some((box) => box.checked)) {
|
|
222
|
+
const error = item.querySelector(":scope > .questionnaire-error:not([data-generated])");
|
|
223
|
+
enabled[0].setCustomValidity(error?.textContent.trim() || this.options.requiredMessage);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
/** The first control in the question that still needs an answer. */
|
|
228
|
+
_invalidControl(item) {
|
|
229
|
+
return this._controls(item).find((control) => control.willValidate && !control.validity.valid);
|
|
230
|
+
}
|
|
231
|
+
/** Shows the question's error and returns false when it needs an answer. */
|
|
232
|
+
_validate(item) {
|
|
233
|
+
this._syncRequired();
|
|
234
|
+
const invalid = item && this._invalidControl(item);
|
|
235
|
+
if (!invalid) return true;
|
|
236
|
+
let error = item.querySelector(":scope > .questionnaire-error");
|
|
237
|
+
if (!error) {
|
|
238
|
+
error = document.createElement("p");
|
|
239
|
+
error.className = "questionnaire-error";
|
|
240
|
+
error.dataset.generated = "";
|
|
241
|
+
error.textContent = invalid.validationMessage || this.options.requiredMessage;
|
|
242
|
+
item.append(error);
|
|
243
|
+
this._generated.push(error);
|
|
244
|
+
}
|
|
245
|
+
this._setInvalid(item, true);
|
|
246
|
+
invalid.focus();
|
|
247
|
+
return false;
|
|
248
|
+
}
|
|
249
|
+
_setInvalid(item, invalid) {
|
|
250
|
+
item.classList.toggle("invalid", invalid);
|
|
251
|
+
const error = item.querySelector(":scope > .questionnaire-error");
|
|
252
|
+
const described = (item.getAttribute("aria-describedby") ?? "").split(" ").filter((id) => id && id !== error?.id);
|
|
253
|
+
if (invalid && error) described.push(this._ensureId(error, "questionnaire-error"));
|
|
254
|
+
if (described.length) item.setAttribute("aria-describedby", described.join(" "));
|
|
255
|
+
else item.removeAttribute("aria-describedby");
|
|
256
|
+
for (const control of this._controls(item)) {
|
|
257
|
+
if (invalid) control.setAttribute("aria-invalid", "true");
|
|
258
|
+
else control.removeAttribute("aria-invalid");
|
|
259
|
+
}
|
|
260
|
+
if (!invalid && this._generated.includes(error)) {
|
|
261
|
+
error.remove();
|
|
262
|
+
this._generated.splice(this._generated.indexOf(error), 1);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
export {
|
|
268
|
+
Questionnaire
|
|
269
|
+
};
|
|
270
|
+
//# sourceMappingURL=chunk-DTKR54I6.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/ts/components/questionnaire.ts"],
|
|
4
|
+
"sourcesContent": ["import { Utils } from '../core/utils';\nimport { Component, BaseOptions, InitElements, InitElement } from '../core/component';\n\nexport interface QuestionnaireOptions extends BaseOptions {\n /**\n * Text above the progress bar. `{current}` and `{total}` are replaced with\n * the question number and the number of questions. `data-progress-label`\n * on the form sets it.\n * @default 'Question {current} of {total}'\n */\n progressLabel: string;\n /**\n * Error shown when a question has no `.questionnaire-error` of its own and\n * the browser gives no validation message, as for a `data-required` group\n * of checkboxes.\n * @default 'Choose an answer to continue.'\n */\n requiredMessage: string;\n}\n\nconst _defaults: QuestionnaireOptions = {\n progressLabel: 'Question {current} of {total}',\n requiredMessage: 'Choose an answer to continue.'\n};\n\nconst NAVIGATION = ['previous', 'skip', 'next'];\n\ntype Control = HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement;\n\n/**\n * A multi-step questionnaire: a <form class=\"questionnaire\"> whose\n * <fieldset> children are the questions, shown one at a time, and a <footer>\n * of buttons. `value=\"previous\"`, `value=\"skip\"` and `value=\"next\"` mark the\n * navigation buttons; a submit button sends the form on the last question.\n *\n * A question is required when one of its controls is `required`, or when the\n * fieldset has `data-required` (at least one enabled checkbox, held as a\n * custom validity on the first one). Next and every way of submitting check\n * it with the browser's own validation; an optional question gets Skip, which\n * clears its answer. A disabled fieldset is left out, so a page can switch\n * questions on and off from earlier answers.\n *\n * Without JavaScript every question shows at once and the submit button sends\n * the form. The answers are ordinary form controls, so FormData reads them.\n */\nexport class Questionnaire extends Component<QuestionnaireOptions> {\n declare el: HTMLFormElement;\n private _active: HTMLFieldSetElement | null = null;\n private _progress: HTMLElement;\n private _progressText: HTMLElement;\n private _progressBar: HTMLProgressElement;\n private _generated: HTMLElement[] = [];\n private _generatedIds: HTMLElement[] = [];\n private _observer: MutationObserver;\n /** Set while one submission's invalid events arrive, so only the first opens. */\n private _reporting = false;\n\n constructor(el: HTMLFormElement, options: Partial<QuestionnaireOptions>) {\n super(el, options, Questionnaire);\n this.el['Expressive_Questionnaire'] = this;\n const progressLabel = el.dataset.progressLabel;\n this.options = {\n ...Questionnaire.defaults,\n ...(progressLabel ? { progressLabel } : {}),\n ...options\n };\n\n this._progress = document.createElement('div');\n this._progress.className = 'questionnaire-progress';\n this._progressText = document.createElement('span');\n this._progressText.id = `questionnaire-progress-${Utils.guid()}`;\n this._progressBar = document.createElement('progress');\n this._progressBar.className = 'progress';\n this._progressBar.setAttribute('aria-labelledby', this._progressText.id);\n this._progress.append(this._progressText, this._progressBar);\n this.el.prepend(this._progress);\n\n for (const item of this._fieldsets()) {\n const ids = Array.from(item.querySelectorAll<HTMLElement>(':scope > p:not(.questionnaire-error)'))\n .map((p) => this._ensureId(p, 'questionnaire-description'));\n if (ids.length && !item.hasAttribute('aria-describedby')) {\n item.setAttribute('aria-describedby', ids.join(' '));\n this._generatedIds.push(item);\n }\n }\n\n this._active = this.items[0] ?? null;\n this._syncRequired();\n this._render();\n // A page enabling or disabling a question from an earlier answer changes\n // the count and the buttons.\n this._observer = new MutationObserver(() => {\n this._syncRequired();\n this._render();\n });\n this._observer.observe(this.el, { attributes: true, subtree: true, attributeFilter: ['disabled'] });\n this.el.addEventListener('click', this._handleClick);\n this.el.addEventListener('keydown', this._handleKeydown);\n this.el.addEventListener('input', this._handleInput);\n // invalid does not bubble.\n this.el.addEventListener('invalid', this._handleInvalid, true);\n }\n\n static get defaults(): QuestionnaireOptions {\n return _defaults;\n }\n\n /**\n * Initializes instance of Questionnaire.\n * @param el HTML element.\n * @param options Component options.\n */\n static init(el: HTMLElement, options?: Partial<QuestionnaireOptions>): Questionnaire;\n /**\n * Initializes instances of Questionnaire.\n * @param els HTML elements.\n * @param options Component options.\n */\n static init(\n els: InitElements<InitElement>,\n options?: Partial<QuestionnaireOptions>\n ): Questionnaire[];\n /**\n * Initializes instances of Questionnaire.\n * @param els HTML elements.\n * @param options Component options.\n */\n static init(\n els: HTMLElement | InitElements<InitElement>,\n options: Partial<QuestionnaireOptions> = {}\n ): Questionnaire | Questionnaire[] {\n return super.init(els, options, Questionnaire);\n }\n\n static getInstance(el: HTMLElement): Questionnaire {\n return el['Expressive_Questionnaire'];\n }\n\n /** The questions that apply: every fieldset child that is not disabled. */\n get items(): HTMLFieldSetElement[] {\n return this._fieldsets().filter((item) => !item.disabled);\n }\n\n /** Position of the shown question in `items`. */\n get index(): number {\n return this.items.indexOf(this._active);\n }\n\n /** Shows the question at `index` without checking the current one. */\n goTo = (index: number) => {\n const item = this.items[index];\n if (!item) return;\n this._active = item;\n this._render();\n const controls = this._controls(item).filter((control) => !control.disabled);\n (controls.find((control) => (control as HTMLInputElement).checked) ?? controls[0])?.focus();\n };\n\n /** Checks the shown question and moves to the next one if it is answered. */\n next = () => {\n if (this._validate(this._active)) this.goTo(this.index + 1);\n };\n\n /** Moves to the previous question. */\n previous = () => this.goTo(this.index - 1);\n\n /** Clears the answer to the shown question and moves to the next one. */\n skip = () => {\n if (!this._active) return;\n for (const control of this._controls(this._active)) {\n const isChoice = control instanceof HTMLInputElement && (control.type === 'radio' || control.type === 'checkbox');\n if (isChoice ? !control.checked : !control.value) continue;\n if (isChoice) control.checked = false;\n else control.value = '';\n control.dispatchEvent(new Event('change', { bubbles: true }));\n }\n this.goTo(this.index + 1);\n };\n\n destroy() {\n this._observer.disconnect();\n this.el.removeEventListener('click', this._handleClick);\n this.el.removeEventListener('keydown', this._handleKeydown);\n this.el.removeEventListener('input', this._handleInput);\n this.el.removeEventListener('invalid', this._handleInvalid, true);\n for (const item of this._fieldsets()) {\n if (item.hasAttribute('data-required')) for (const control of this._controls(item)) control.setCustomValidity('');\n item.hidden = false;\n this._setInvalid(item, false);\n }\n for (const button of this._buttons()) button.hidden = false;\n this._progress.remove();\n for (const el of this._generated) el.remove();\n for (const el of this._generatedIds) {\n el.removeAttribute(el instanceof HTMLFieldSetElement ? 'aria-describedby' : 'id');\n }\n this.el['Expressive_Questionnaire'] = undefined;\n }\n\n private _fieldsets() {\n return Array.from(this.el.querySelectorAll<HTMLFieldSetElement>(':scope > fieldset'));\n }\n\n /** The footer's navigation and submit buttons. */\n private _buttons() {\n return Array.from(this.el.querySelectorAll<HTMLButtonElement>(':scope > footer > button')).filter(\n (button) => NAVIGATION.includes(button.value) || button.type === 'submit'\n );\n }\n\n private _controls(item: HTMLFieldSetElement) {\n return Array.from(item.elements).filter(\n (el): el is Control =>\n el instanceof HTMLTextAreaElement || el instanceof HTMLSelectElement ||\n (el instanceof HTMLInputElement && el.type !== 'button' && el.type !== 'submit')\n );\n }\n\n private _required(item: HTMLFieldSetElement) {\n return item.hasAttribute('data-required') || this._controls(item).some((control) => control.required);\n }\n\n private _ensureId(el: HTMLElement, prefix: string) {\n if (!el.id) {\n el.id = `${prefix}-${Utils.guid()}`;\n this._generatedIds.push(el);\n }\n return el.id;\n }\n\n private _render() {\n const items = this.items;\n // The shown question was switched off: carry on from the next one.\n if (!items.includes(this._active)) {\n const all = this._fieldsets();\n const after = all.slice(all.indexOf(this._active) + 1).find((item) => !item.disabled);\n this._active = after ?? items[items.length - 1] ?? null;\n }\n const index = items.indexOf(this._active);\n const last = index === items.length - 1;\n for (const item of this._fieldsets()) item.hidden = item !== this._active;\n for (const button of this._buttons()) {\n if (button.value === 'previous') button.hidden = index <= 0;\n else if (button.value === 'skip') button.hidden = last || !this._active || this._required(this._active);\n else if (button.value === 'next') button.hidden = last;\n else button.hidden = !last;\n }\n this._progressText.textContent = this.options.progressLabel\n .replace('{current}', String(index + 1))\n .replace('{total}', String(items.length));\n this._progressBar.max = Math.max(items.length, 1);\n this._progressBar.value = index + 1;\n }\n\n /**\n * Puts \"choose at least one\" on the first enabled checkbox of each\n * data-required group with none checked, so the browser's validation, and\n * every way of submitting, sees it. A disabled checkbox is not sent, so it\n * does not count.\n */\n private _syncRequired() {\n for (const item of this._fieldsets()) {\n if (!item.hasAttribute('data-required')) continue;\n const boxes = this._controls(item).filter(\n (control): control is HTMLInputElement => control instanceof HTMLInputElement && control.type === 'checkbox'\n );\n const enabled = boxes.filter((box) => !box.disabled);\n for (const box of boxes) box.setCustomValidity('');\n if (enabled.length && !enabled.some((box) => box.checked)) {\n const error = item.querySelector<HTMLElement>(':scope > .questionnaire-error:not([data-generated])');\n enabled[0].setCustomValidity(error?.textContent.trim() || this.options.requiredMessage);\n }\n }\n }\n\n /** The first control in the question that still needs an answer. */\n private _invalidControl(item: HTMLFieldSetElement): Control | undefined {\n return this._controls(item).find((control) => control.willValidate && !control.validity.valid);\n }\n\n /** Shows the question's error and returns false when it needs an answer. */\n private _validate(item: HTMLFieldSetElement | null) {\n this._syncRequired();\n const invalid = item && this._invalidControl(item);\n if (!invalid) return true;\n let error = item.querySelector<HTMLElement>(':scope > .questionnaire-error');\n if (!error) {\n error = document.createElement('p');\n error.className = 'questionnaire-error';\n error.dataset.generated = '';\n error.textContent = invalid.validationMessage || this.options.requiredMessage;\n item.append(error);\n this._generated.push(error);\n }\n this._setInvalid(item, true);\n invalid.focus();\n return false;\n }\n\n private _setInvalid(item: HTMLFieldSetElement, invalid: boolean) {\n item.classList.toggle('invalid', invalid);\n const error = item.querySelector<HTMLElement>(':scope > .questionnaire-error');\n const described = (item.getAttribute('aria-describedby') ?? '').split(' ').filter((id) => id && id !== error?.id);\n if (invalid && error) described.push(this._ensureId(error, 'questionnaire-error'));\n if (described.length) item.setAttribute('aria-describedby', described.join(' '));\n else item.removeAttribute('aria-describedby');\n for (const control of this._controls(item)) {\n if (invalid) control.setAttribute('aria-invalid', 'true');\n else control.removeAttribute('aria-invalid');\n }\n if (!invalid && this._generated.includes(error)) {\n error.remove();\n this._generated.splice(this._generated.indexOf(error), 1);\n }\n }\n\n private _handleClick = (e: MouseEvent) => {\n const button = (e.target as Element).closest?.('button');\n if (!button || !this._buttons().includes(button)) return;\n if (NAVIGATION.includes(button.value)) {\n // Also stops a navigation button written without type=\"button\" from\n // submitting the form.\n e.preventDefault();\n this[button.value as 'previous' | 'skip' | 'next']();\n return;\n }\n // Submit by click or Enter: catch answers a script set without an event.\n this._syncRequired();\n };\n\n // Enter in a field moves on instead of submitting the form early.\n private _handleKeydown = (e: KeyboardEvent) => {\n if (e.key !== 'Enter' || e.defaultPrevented || e.isComposing) return;\n if (!(e.target instanceof HTMLInputElement) || this.index >= this.items.length - 1) return;\n e.preventDefault();\n this.next();\n };\n\n // A submission found an unanswered question, possibly a hidden one. Open the\n // first instead of letting the browser report a control it cannot show.\n // One submission fires its invalid events in a single task.\n private _handleInvalid = (e: Event) => {\n const item = this.items.find((item) => item.contains(e.target as Node));\n if (!item) return;\n e.preventDefault();\n if (this._reporting) return;\n this._reporting = true;\n setTimeout(() => (this._reporting = false));\n this._active = item;\n this._render();\n this._validate(item);\n };\n\n // An answer clears the question's error.\n private _handleInput = (e: Event) => {\n this._syncRequired();\n const item = (e.target as Element).closest?.('fieldset');\n if (item instanceof HTMLFieldSetElement && item.classList.contains('invalid')) this._setInvalid(item, false);\n };\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;AAoBA,IAAM,YAAkC;AAAA,EACtC,eAAe;AAAA,EACf,iBAAiB;AACnB;AAEA,IAAM,aAAa,CAAC,YAAY,QAAQ,MAAM;AAoBvC,IAAM,gBAAN,MAAM,uBAAsB,UAAgC;AAAA,EAYjE,YAAY,IAAqB,SAAwC;AACvE,UAAM,IAAI,SAAS,cAAa;AAXlC,SAAQ,UAAsC;AAI9C,SAAQ,aAA4B,CAAC;AACrC,SAAQ,gBAA+B,CAAC;AAGxC;AAAA,SAAQ,aAAa;AA8FrB;AAAA,gBAAO,CAAC,UAAkB;AACxB,YAAM,OAAO,KAAK,MAAM,KAAK;AAC7B,UAAI,CAAC,KAAM;AACX,WAAK,UAAU;AACf,WAAK,QAAQ;AACb,YAAM,WAAW,KAAK,UAAU,IAAI,EAAE,OAAO,CAAC,YAAY,CAAC,QAAQ,QAAQ;AAC3E,OAAC,SAAS,KAAK,CAAC,YAAa,QAA6B,OAAO,KAAK,SAAS,CAAC,IAAI,MAAM;AAAA,IAC5F;AAGA;A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AAG;AAC1C,UAAI,QAAS,SAAQ,aAAa,gBAAgB,MAAM;AAAA,UACnD,SAAQ,gBAAgB,cAAc;AAAA,IAC7C;AACA,QAAI,CAAC,WAAW,KAAK,WAAW,SAAS,KAAK,GAAG;AAC/C,YAAM,OAAO;AACb,WAAK,WAAW,OAAO,KAAK,WAAW,QAAQ,KAAK,GAAG,CAAC;AAAA,IAC1D;AAAA,EACF;AA6CF;",
|
|
6
|
+
"names": ["item"]
|
|
7
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Utils
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-6OMRGML6.mjs";
|
|
4
4
|
|
|
5
5
|
// src/ts/plugins/dockedDisplayPlugin.ts
|
|
6
6
|
var _defaults = {
|
|
@@ -75,4 +75,4 @@ var DockedDisplayPlugin = class _DockedDisplayPlugin {
|
|
|
75
75
|
export {
|
|
76
76
|
DockedDisplayPlugin
|
|
77
77
|
};
|
|
78
|
-
//# sourceMappingURL=chunk-
|
|
78
|
+
//# sourceMappingURL=chunk-EC63CHXU.mjs.map
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ColumnChart
|
|
3
|
+
} from "./chunk-SPETGK25.mjs";
|
|
4
|
+
|
|
5
|
+
// src/ts/components/barChart.ts
|
|
6
|
+
var BarChart = class extends ColumnChart {
|
|
7
|
+
get _type() {
|
|
8
|
+
return "bar-chart";
|
|
9
|
+
}
|
|
10
|
+
get _key() {
|
|
11
|
+
return "Expressive_BarChart";
|
|
12
|
+
}
|
|
13
|
+
get _horizontal() {
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
static init(els, options = {}) {
|
|
17
|
+
return super.init(els, options);
|
|
18
|
+
}
|
|
19
|
+
static getInstance(el) {
|
|
20
|
+
return el["Expressive_BarChart"];
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The column chart's spans; CSS reads their --top and --bottom across the
|
|
24
|
+
* plot. With .values, a copy of the bars without their clipping holds each
|
|
25
|
+
* cell's text, so text longer than a short bar can run past its end.
|
|
26
|
+
*/
|
|
27
|
+
_draw() {
|
|
28
|
+
const bars = super._draw();
|
|
29
|
+
bars.className = "bar-chart-bars";
|
|
30
|
+
bars.classList.toggle("rtl", getComputedStyle(this.el).direction === "rtl");
|
|
31
|
+
if (!this.el.classList.contains("values")) return bars;
|
|
32
|
+
const values = bars.cloneNode(true);
|
|
33
|
+
values.classList.replace("bar-chart-bars", "bar-chart-values");
|
|
34
|
+
values.querySelectorAll("span[data-text]").forEach((span) => {
|
|
35
|
+
span.textContent = span.dataset.text;
|
|
36
|
+
});
|
|
37
|
+
const layers = document.createElement("div");
|
|
38
|
+
layers.className = "bar-chart-layers";
|
|
39
|
+
layers.append(bars, values);
|
|
40
|
+
return layers;
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export {
|
|
45
|
+
BarChart
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=chunk-GVGT6MIU.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/ts/components/barChart.ts"],
|
|
4
|
+
"sourcesContent": ["import { InitElements, InitElement } from '../core/component';\nimport { ColumnChart, ColumnChartOptions } from './columnChart';\n\nexport type BarChartOptions = ColumnChartOptions;\n\n/**\n * Bar chart. A column chart turned on its side: each row of the <table> is\n * a band of bars that grow from zero along the inline axis, with its label\n * beside it. The up and down arrows move the tooltip between rows.\n *\n * Re-run `BarChart.init(el)` after changing the table.\n */\nexport class BarChart extends ColumnChart {\n protected get _type() {\n return 'bar-chart';\n }\n\n protected get _key() {\n return 'Expressive_BarChart';\n }\n\n protected get _horizontal() {\n return true;\n }\n\n static init(el: HTMLElement, options?: Partial<BarChartOptions>): BarChart;\n static init(els: InitElements<InitElement>, options?: Partial<BarChartOptions>): BarChart[];\n static init(\n els: HTMLElement | InitElements<InitElement>,\n options: Partial<BarChartOptions> = {}\n ): BarChart | BarChart[] {\n return super.init(els as HTMLElement, options) as BarChart | BarChart[];\n }\n\n static getInstance(el: HTMLElement): BarChart {\n return el['Expressive_BarChart'];\n }\n\n /**\n * The column chart's spans; CSS reads their --top and --bottom across the\n * plot. With .values, a copy of the bars without their clipping holds each\n * cell's text, so text longer than a short bar can run past its end.\n */\n protected _draw(): Element {\n const bars = super._draw() as HTMLElement;\n bars.className = 'bar-chart-bars';\n // Read here rather than with :dir(), which misses CSS `direction`.\n bars.classList.toggle('rtl', getComputedStyle(this.el).direction === 'rtl');\n if (!this.el.classList.contains('values')) return bars;\n\n const values = bars.cloneNode(true) as HTMLElement;\n values.classList.replace('bar-chart-bars', 'bar-chart-values');\n values.querySelectorAll<HTMLElement>('span[data-text]').forEach((span) => {\n span.textContent = span.dataset.text;\n });\n const layers = document.createElement('div');\n layers.className = 'bar-chart-layers';\n layers.append(bars, values);\n return layers;\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;AAYO,IAAM,WAAN,cAAuB,YAAY;AAAA,EACxC,IAAc,QAAQ;AACpB,WAAO;AAAA,EACT;AAAA,EAEA,IAAc,OAAO;AACnB,WAAO;AAAA,EACT;AAAA,EAEA,IAAc,cAAc;AAC1B,WAAO;AAAA,EACT;AAAA,EAIA,OAAO,KACL,KACA,UAAoC,CAAC,GACd;AACvB,WAAO,MAAM,KAAK,KAAoB,OAAO;AAAA,EAC/C;AAAA,EAEA,OAAO,YAAY,IAA2B;AAC5C,WAAO,GAAG,qBAAqB;AAAA,EACjC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOU,QAAiB;AACzB,UAAM,OAAO,MAAM,MAAM;AACzB,SAAK,YAAY;AAEjB,SAAK,UAAU,OAAO,OAAO,iBAAiB,KAAK,EAAE,EAAE,cAAc,KAAK;AAC1E,QAAI,CAAC,KAAK,GAAG,UAAU,SAAS,QAAQ,EAAG,QAAO;AAElD,UAAM,SAAS,KAAK,UAAU,IAAI;AAClC,WAAO,UAAU,QAAQ,kBAAkB,kBAAkB;AAC7D,WAAO,iBAA8B,iBAAiB,EAAE,QAAQ,CAAC,SAAS;AACxE,WAAK,cAAc,KAAK,QAAQ;AAAA,IAClC,CAAC;AACD,UAAM,SAAS,SAAS,cAAc,KAAK;AAC3C,WAAO,YAAY;AACnB,WAAO,OAAO,MAAM,MAAM;AAC1B,WAAO;AAAA,EACT;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Utils
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-6OMRGML6.mjs";
|
|
4
4
|
|
|
5
5
|
// src/ts/behaviors/sheetDrag.ts
|
|
6
6
|
var DISMISS_DISTANCE = 96;
|
|
7
7
|
var DISMISS_VELOCITY = 0.5;
|
|
8
|
+
var FLICK_TIMEOUT = 100;
|
|
8
9
|
var DRAG_SLOP = 4;
|
|
9
10
|
function installSheetDrag(config) {
|
|
10
11
|
const coord = (event) => config.axis === "x" ? event.clientX : event.clientY;
|
|
@@ -41,6 +42,7 @@ function installSheetDrag(config) {
|
|
|
41
42
|
start: coord(event),
|
|
42
43
|
last: coord(event),
|
|
43
44
|
lastT: Date.now(),
|
|
45
|
+
velocity: 0,
|
|
44
46
|
shift: 0
|
|
45
47
|
};
|
|
46
48
|
observer.observe(document, { childList: true, subtree: true, attributes: true, attributeFilter: ["open"], attributeOldValue: true });
|
|
@@ -53,8 +55,12 @@ function installSheetDrag(config) {
|
|
|
53
55
|
}
|
|
54
56
|
const delta = coord(event) - drag.start;
|
|
55
57
|
drag.shift = drag.direction === 1 ? Math.max(0, delta) : Math.min(0, delta);
|
|
56
|
-
|
|
57
|
-
|
|
58
|
+
if (coord(event) !== drag.last) {
|
|
59
|
+
const now = Date.now();
|
|
60
|
+
drag.velocity = (coord(event) - drag.last) / Math.max(1, now - drag.lastT);
|
|
61
|
+
drag.last = coord(event);
|
|
62
|
+
drag.lastT = now;
|
|
63
|
+
}
|
|
58
64
|
drag.dialog.style.setProperty(config.property, `${drag.shift}px`);
|
|
59
65
|
};
|
|
60
66
|
const onUp = (event) => {
|
|
@@ -64,13 +70,14 @@ function installSheetDrag(config) {
|
|
|
64
70
|
onCancel();
|
|
65
71
|
return;
|
|
66
72
|
}
|
|
73
|
+
onMove(event);
|
|
67
74
|
drag = null;
|
|
68
75
|
observer.disconnect();
|
|
69
76
|
held.dialog.style.transition = "";
|
|
70
|
-
const
|
|
71
|
-
const
|
|
72
|
-
config.onRelease?.(
|
|
73
|
-
const dismiss = held.direction === 1 ? held.shift > DISMISS_DISTANCE || velocity > DISMISS_VELOCITY : held.shift < -DISMISS_DISTANCE || velocity < -DISMISS_VELOCITY;
|
|
77
|
+
const velocity = Date.now() - held.lastT < FLICK_TIMEOUT ? held.velocity : 0;
|
|
78
|
+
const dragged = Math.abs(held.shift) > DRAG_SLOP;
|
|
79
|
+
config.onRelease?.(dragged);
|
|
80
|
+
const dismiss = dragged && (held.direction === 1 ? held.shift > DISMISS_DISTANCE || velocity > DISMISS_VELOCITY : held.shift < -DISMISS_DISTANCE || velocity < -DISMISS_VELOCITY);
|
|
74
81
|
if (dismiss && held.dialog.open) held.dialog.close();
|
|
75
82
|
held.dialog.style.setProperty(config.property, "0px");
|
|
76
83
|
};
|
|
@@ -99,4 +106,4 @@ function installSheetDrag(config) {
|
|
|
99
106
|
export {
|
|
100
107
|
installSheetDrag
|
|
101
108
|
};
|
|
102
|
-
//# sourceMappingURL=chunk-
|
|
109
|
+
//# sourceMappingURL=chunk-GZWPXXY6.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/ts/behaviors/sheetDrag.ts"],
|
|
4
|
+
"sourcesContent": ["import { Utils } from '../core/utils';\n\n/**\n * Drag-to-dismiss, shared by the bottom sheet and the side sheet.\n *\n * The two were the same state machine written twice on different axes - same\n * dismissal distance, same flick velocity, same transition suppression, same\n * pointer bookkeeping - so a fix to one could land without reaching the other.\n * What actually differs between them is stated as configuration below.\n *\n * Light-dismiss on the scrim is not here; it stays with `Dialogs`.\n */\nexport interface SheetDragConfig {\n /** Which dialogs this drag applies to. */\n selector: string;\n /** The axis the sheet travels on. */\n axis: 'x' | 'y';\n /** The custom property carrying the live drag offset. */\n property: string;\n /**\n * `1` when the sheet dismisses toward increasing coordinates (downward, or\n * rightward for an end-docked side sheet), `-1` when it dismisses toward\n * decreasing ones. A function rather than a constant because a side sheet's\n * direction depends on which edge each individual sheet is docked to.\n */\n direction: (dialog: HTMLDialogElement) => 1 | -1;\n /** Whether a press at this point landed on the sheet's drag handle. */\n inHandle: (event: PointerEvent, dialog: HTMLDialogElement) => boolean;\n /**\n * Called on primary `pointerdown`, after clearing the previous drag. The\n * bottom sheet clears its dragged flag here so a sequence abandoned without\n * a `pointerup` cannot leave the flag set and swallow the next tap.\n */\n onPress?: () => void;\n /** Called when a drag ends, with whether the pointer actually moved. */\n onRelease?: (dragged: boolean) => void;\n}\n\n/** Past this the sheet dismisses rather than snapping back, in pixels. */\nconst DISMISS_DISTANCE = 96;\n/** Past this a flick dismisses whatever the distance, in pixels per millisecond. */\nconst DISMISS_VELOCITY = 0.5;\n/** Ignore a flick after the pointer has rested for this many milliseconds. */\nconst FLICK_TIMEOUT = 100;\n/** Past this the pointer was dragging, not tapping. Hand jitter, in pixels. */\nconst DRAG_SLOP = 4;\n\n/**\n * Register one sheet kind's drag handlers on the document. Called once per kind\n * at import time; there is nothing to tear down.\n */\nexport function installSheetDrag(config: SheetDragConfig): void {\n const coord = (event: PointerEvent) => (config.axis === 'x' ? event.clientX : event.clientY);\n let observer: MutationObserver;\n\n let drag: {\n dialog: HTMLDialogElement;\n pointerId: number;\n direction: 1 | -1;\n start: number;\n last: number;\n lastT: number;\n velocity: number;\n shift: number;\n } | null = null;\n\n const sheetFor = (target: EventTarget | null): HTMLDialogElement | null => {\n if (!(target instanceof Element)) return null;\n const dialog = target.closest(config.selector);\n return dialog instanceof HTMLDialogElement ? dialog : null;\n };\n\n const reset = (dialog: HTMLDialogElement) => {\n dialog.style.transition = '';\n dialog.style.setProperty(config.property, '0px');\n };\n\n const onDown = (event: PointerEvent) => {\n // A press that is not the primary pointer is ignored without disturbing a\n // drag already in flight - a second finger must not abort the first one.\n // A press that lands off the sheet or off its handle does clear it.\n if (!event.isPrimary) return;\n if (event.pointerType === 'mouse' && event.button !== 0) return;\n onCancel();\n config.onPress?.();\n const dialog = sheetFor(event.target);\n if (!dialog?.open) {\n drag = null;\n return;\n }\n if (!config.inHandle(event, dialog)) {\n drag = null;\n return;\n }\n dialog.style.transition = 'none';\n drag = {\n dialog,\n pointerId: event.pointerId,\n direction: config.direction(dialog),\n start: coord(event),\n last: coord(event),\n lastT: Date.now(),\n velocity: 0,\n shift: 0\n };\n observer.observe(document, { childList: true, subtree: true, attributes: true, attributeFilter: ['open'], attributeOldValue: true });\n };\n\n const onMove = (event: PointerEvent) => {\n if (!drag || drag.pointerId !== event.pointerId) return;\n if (!drag.dialog.open || !drag.dialog.isConnected) {\n onCancel();\n return;\n }\n const delta = coord(event) - drag.start;\n // Only movement toward dismissal counts; dragging the other way is a no-op\n // rather than a sheet that lifts off its edge.\n drag.shift = drag.direction === 1 ? Math.max(0, delta) : Math.min(0, delta);\n if (coord(event) !== drag.last) {\n const now = Date.now();\n drag.velocity = (coord(event) - drag.last) / Math.max(1, now - drag.lastT);\n drag.last = coord(event);\n drag.lastT = now;\n }\n drag.dialog.style.setProperty(config.property, `${drag.shift}px`);\n };\n\n const onUp = (event: PointerEvent) => {\n const held = drag;\n if (!held || held.pointerId !== event.pointerId) return;\n if (!held.dialog.open || !held.dialog.isConnected) {\n onCancel();\n return;\n }\n onMove(event);\n drag = null;\n observer.disconnect();\n // Not `reset()`, though it looks like it: the two halves belong on either\n // side of close(). The transition has to be back before the sheet closes,\n // so the dismissal animates; the shift has to clear after, or a snap-back\n // would jump to zero before the transition could carry it there.\n held.dialog.style.transition = '';\n const velocity = Date.now() - held.lastT < FLICK_TIMEOUT ? held.velocity : 0;\n const dragged = Math.abs(held.shift) > DRAG_SLOP;\n config.onRelease?.(dragged);\n const dismiss = dragged &&\n (held.direction === 1\n ? held.shift > DISMISS_DISTANCE || velocity > DISMISS_VELOCITY\n : held.shift < -DISMISS_DISTANCE || velocity < -DISMISS_VELOCITY);\n if (dismiss && held.dialog.open) held.dialog.close();\n held.dialog.style.setProperty(config.property, '0px');\n };\n\n const onCancel = (event?: PointerEvent) => {\n if (event && drag?.pointerId !== event.pointerId) return;\n observer.disconnect();\n config.onRelease?.(false);\n const held = drag;\n drag = null;\n if (held) reset(held.dialog);\n };\n\n Utils.onDocumentReady(() => {\n observer = new MutationObserver(records => {\n const dialog = drag?.dialog;\n if (dialog && (!dialog.open || !dialog.isConnected || records.some(record =>\n (record.type === 'attributes' && record.target === dialog && record.oldValue === null) ||\n [...record.removedNodes].some(node => node.contains(dialog))\n ))) onCancel();\n });\n document.addEventListener('pointerdown', onDown, { passive: true });\n document.addEventListener('pointermove', onMove, { passive: true });\n document.addEventListener('pointerup', onUp, { passive: true });\n document.addEventListener('pointercancel', onCancel, { passive: true });\n });\n}\n"],
|
|
5
|
+
"mappings": ";;;;;AAuCA,IAAM,mBAAmB;AAEzB,IAAM,mBAAmB;AAEzB,IAAM,gBAAgB;AAEtB,IAAM,YAAY;AAMX,SAAS,iBAAiB,QAA+B;AAC9D,QAAM,QAAQ,CAAC,UAAyB,OAAO,SAAS,MAAM,MAAM,UAAU,MAAM;AACpF,MAAI;AAEJ,MAAI,OASO;AAEX,QAAM,WAAW,CAAC,WAAyD;AACzE,QAAI,EAAE,kBAAkB,SAAU,QAAO;AACzC,UAAM,SAAS,OAAO,QAAQ,OAAO,QAAQ;AAC7C,WAAO,kBAAkB,oBAAoB,SAAS;AAAA,EACxD;AAEA,QAAM,QAAQ,CAAC,WAA8B;AAC3C,WAAO,MAAM,aAAa;AAC1B,WA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,UAAS;AAAA,IACf,CAAC;AACD,aAAS,iBAAiB,eAAe,QAAQ,EAAE,SAAS,KAAK,CAAC;AAClE,aAAS,iBAAiB,eAAe,QAAQ,EAAE,SAAS,KAAK,CAAC;AAClE,aAAS,iBAAiB,aAAa,MAAM,EAAE,SAAS,KAAK,CAAC;AAC9D,aAAS,iBAAiB,iBAAiB,UAAU,EAAE,SAAS,KAAK,CAAC;AAAA,EACxE,CAAC;AACH;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ColumnChart
|
|
3
|
+
} from "./chunk-SPETGK25.mjs";
|
|
4
|
+
import {
|
|
5
|
+
LineChart
|
|
6
|
+
} from "./chunk-O5XPWXIQ.mjs";
|
|
7
|
+
|
|
8
|
+
// src/ts/components/mixedChart.ts
|
|
9
|
+
var has = (series, name) => series.className.split(/\s+/).includes(name);
|
|
10
|
+
var MixedChart = class extends ColumnChart {
|
|
11
|
+
get _type() {
|
|
12
|
+
return "mixed-chart";
|
|
13
|
+
}
|
|
14
|
+
get _key() {
|
|
15
|
+
return "Expressive_MixedChart";
|
|
16
|
+
}
|
|
17
|
+
get _points() {
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
static init(els, options = {}) {
|
|
21
|
+
return super.init(els, options);
|
|
22
|
+
}
|
|
23
|
+
static getInstance(el) {
|
|
24
|
+
return el["Expressive_MixedChart"];
|
|
25
|
+
}
|
|
26
|
+
/** The start scale, then the end scale; each includes zero if it has columns. */
|
|
27
|
+
_scale(series, min, max) {
|
|
28
|
+
const end = series.filter((each) => has(each, "end"));
|
|
29
|
+
const start = series.filter((each) => !end.includes(each));
|
|
30
|
+
const columns = (list) => list.some((each) => has(each, "column"));
|
|
31
|
+
super._scale(end, this._number("endMin"), this._number("endMax"), columns(end));
|
|
32
|
+
return super._scale(start, min, max, columns(start));
|
|
33
|
+
}
|
|
34
|
+
/** Columns behind, then the lines and areas over them. */
|
|
35
|
+
_draw() {
|
|
36
|
+
const marks = document.createElement("div");
|
|
37
|
+
marks.className = "mixed-chart-marks";
|
|
38
|
+
const columns = super._draw(this.series.filter((series) => has(series, "column")));
|
|
39
|
+
columns.className = "mixed-chart-columns";
|
|
40
|
+
marks.append(columns, LineChart.prototype["_draw"].call(this, this.series.filter((series) => !has(series, "column"))));
|
|
41
|
+
return marks;
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export {
|
|
46
|
+
MixedChart
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=chunk-HKT2S7VM.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/ts/components/mixedChart.ts"],
|
|
4
|
+
"sourcesContent": ["import { InitElements, InitElement } from '../core/component';\nimport { ColumnChart } from './columnChart';\nimport { LineChart, LineChartOptions, Series } from './lineChart';\n\nexport type MixedChartOptions = LineChartOptions;\n\n/** Whether a series header cell has a class. */\nconst has = (series: Series, name: string) => series.className.split(/\\s+/).includes(name);\n\n/**\n * Mixed chart. It reads its <table> like LineChart, and draws each series\n * by its header cell's class: `column` as columns from zero, `area` as a\n * line with a fill under it, and anything else as a line. Series with\n * `end` are drawn against a second scale, set by `data-end-min` and\n * `data-end-max`, so values of different sizes or units share the plot.\n *\n * Re-run `MixedChart.init(el)` after changing the table.\n */\nexport class MixedChart extends ColumnChart {\n protected get _type() {\n return 'mixed-chart';\n }\n\n protected get _key() {\n return 'Expressive_MixedChart';\n }\n\n protected get _points() {\n return true;\n }\n\n static init(el: HTMLElement, options?: Partial<MixedChartOptions>): MixedChart;\n static init(els: InitElements<InitElement>, options?: Partial<MixedChartOptions>): MixedChart[];\n static init(\n els: HTMLElement | InitElements<InitElement>,\n options: Partial<MixedChartOptions> = {}\n ): MixedChart | MixedChart[] {\n return super.init(els as HTMLElement, options) as MixedChart | MixedChart[];\n }\n\n static getInstance(el: HTMLElement): MixedChart {\n return el['Expressive_MixedChart'];\n }\n\n /** The start scale, then the end scale; each includes zero if it has columns. */\n protected _scale(series: Series[], min: number | null, max: number | null) {\n const end = series.filter((each) => has(each, 'end'));\n const start = series.filter((each) => !end.includes(each));\n const columns = (list: Series[]) => list.some((each) => has(each, 'column'));\n super._scale(end, this._number('endMin'), this._number('endMax'), columns(end));\n return super._scale(start, min, max, columns(start));\n }\n\n /** Columns behind, then the lines and areas over them. */\n protected _draw(): Element {\n const marks = document.createElement('div');\n marks.className = 'mixed-chart-marks';\n const columns = super._draw(this.series.filter((series) => has(series, 'column')));\n columns.className = 'mixed-chart-columns';\n marks.append(columns, LineChart.prototype['_draw'].call(this, this.series.filter((series) => !has(series, 'column'))));\n return marks;\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;AAOA,IAAM,MAAM,CAAC,QAAgB,SAAiB,OAAO,UAAU,MAAM,KAAK,EAAE,SAAS,IAAI;AAWlF,IAAM,aAAN,cAAyB,YAAY;AAAA,EAC1C,IAAc,QAAQ;AACpB,WAAO;AAAA,EACT;AAAA,EAEA,IAAc,OAAO;AACnB,WAAO;AAAA,EACT;AAAA,EAEA,IAAc,UAAU;AACtB,WAAO;AAAA,EACT;AAAA,EAIA,OAAO,KACL,KACA,UAAsC,CAAC,GACZ;AAC3B,WAAO,MAAM,KAAK,KAAoB,OAAO;AAAA,EAC/C;AAAA,EAEA,OAAO,YAAY,IAA6B;AAC9C,WAAO,GAAG,uBAAuB;AAAA,EACnC;AAAA;AAAA,EAGU,OAAO,QAAkB,KAAoB,KAAoB;AACzE,UAAM,MAAM,OAAO,OAAO,CAAC,SAAS,IAAI,MAAM,KAAK,CAAC;AACpD,UAAM,QAAQ,OAAO,OAAO,CAAC,SAAS,CAAC,IAAI,SAAS,IAAI,CAAC;AACzD,UAAM,UAAU,CAAC,SAAmB,KAAK,KAAK,CAAC,SAAS,IAAI,MAAM,QAAQ,CAAC;AAC3E,UAAM,OAAO,KAAK,KAAK,QAAQ,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