@aceshooting/lyra-ui 3.5.0 → 3.7.0
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/README.md +111 -2
- package/custom-elements.json +50239 -41857
- package/dist/components/animated-image/animated-image.class.d.ts +131 -0
- package/dist/components/animated-image/animated-image.class.d.ts.map +1 -0
- package/dist/components/animated-image/animated-image.class.js +296 -0
- package/dist/components/animated-image/animated-image.class.js.map +1 -0
- package/dist/components/animated-image/animated-image.d.ts +2 -0
- package/dist/components/animated-image/animated-image.d.ts.map +1 -0
- package/dist/components/animated-image/animated-image.js +5 -0
- package/dist/components/animated-image/animated-image.js.map +1 -0
- package/dist/components/animated-image/animated-image.styles.d.ts +2 -0
- package/dist/components/animated-image/animated-image.styles.d.ts.map +1 -0
- package/dist/components/animated-image/animated-image.styles.js +117 -0
- package/dist/components/animated-image/animated-image.styles.js.map +1 -0
- package/dist/components/animation/animation.class.d.ts +119 -0
- package/dist/components/animation/animation.class.d.ts.map +1 -0
- package/dist/components/animation/animation.class.js +420 -0
- package/dist/components/animation/animation.class.js.map +1 -0
- package/dist/components/animation/animation.d.ts +2 -0
- package/dist/components/animation/animation.d.ts.map +1 -0
- package/dist/components/animation/animation.js +5 -0
- package/dist/components/animation/animation.js.map +1 -0
- package/dist/components/animation/animation.styles.d.ts +2 -0
- package/dist/components/animation/animation.styles.d.ts.map +1 -0
- package/dist/components/animation/animation.styles.js +18 -0
- package/dist/components/animation/animation.styles.js.map +1 -0
- package/dist/components/avatar-group/avatar-group.class.d.ts +110 -0
- package/dist/components/avatar-group/avatar-group.class.d.ts.map +1 -0
- package/dist/components/avatar-group/avatar-group.class.js +182 -0
- package/dist/components/avatar-group/avatar-group.class.js.map +1 -0
- package/dist/components/avatar-group/avatar-group.d.ts +2 -0
- package/dist/components/avatar-group/avatar-group.d.ts.map +1 -0
- package/dist/components/avatar-group/avatar-group.js +5 -0
- package/dist/components/avatar-group/avatar-group.js.map +1 -0
- package/dist/components/avatar-group/avatar-group.styles.d.ts +2 -0
- package/dist/components/avatar-group/avatar-group.styles.d.ts.map +1 -0
- package/dist/components/avatar-group/avatar-group.styles.js +112 -0
- package/dist/components/avatar-group/avatar-group.styles.js.map +1 -0
- package/dist/components/button/button.class.d.ts +5 -2
- package/dist/components/button/button.class.d.ts.map +1 -1
- package/dist/components/button/button.class.js +4 -1
- package/dist/components/button/button.class.js.map +1 -1
- package/dist/components/button/button.styles.d.ts.map +1 -1
- package/dist/components/button/button.styles.js +16 -0
- package/dist/components/button/button.styles.js.map +1 -1
- package/dist/components/calendar/calendar.class.d.ts.map +1 -1
- package/dist/components/calendar/calendar.class.js +1 -12
- package/dist/components/calendar/calendar.class.js.map +1 -1
- package/dist/components/calendar-viewer/calendar-viewer.class.d.ts +1 -1
- package/dist/components/calendar-viewer/calendar-viewer.class.d.ts.map +1 -1
- package/dist/components/calendar-viewer/calendar-viewer.class.js +2 -2
- package/dist/components/calendar-viewer/calendar-viewer.class.js.map +1 -1
- package/dist/components/chart/box-plot.class.d.ts.map +1 -1
- package/dist/components/chart/box-plot.class.js +1 -3
- package/dist/components/chart/box-plot.class.js.map +1 -1
- package/dist/components/chart/chart.class.d.ts.map +1 -1
- package/dist/components/chart/chart.class.js +1 -3
- package/dist/components/chart/chart.class.js.map +1 -1
- package/dist/components/code-editor/code-editor.styles.d.ts.map +1 -1
- package/dist/components/code-editor/code-editor.styles.js +5 -2
- package/dist/components/code-editor/code-editor.styles.js.map +1 -1
- package/dist/components/contact-viewer/contact-viewer.class.d.ts +4 -1
- package/dist/components/contact-viewer/contact-viewer.class.d.ts.map +1 -1
- package/dist/components/contact-viewer/contact-viewer.class.js +5 -2
- package/dist/components/contact-viewer/contact-viewer.class.js.map +1 -1
- package/dist/components/email-viewer/email-viewer.class.d.ts +4 -1
- package/dist/components/email-viewer/email-viewer.class.d.ts.map +1 -1
- package/dist/components/email-viewer/email-viewer.class.js +5 -2
- package/dist/components/email-viewer/email-viewer.class.js.map +1 -1
- package/dist/components/file-icon/file-icon.class.d.ts +5 -1
- package/dist/components/file-icon/file-icon.class.d.ts.map +1 -1
- package/dist/components/file-icon/file-icon.class.js +20 -2
- package/dist/components/file-icon/file-icon.class.js.map +1 -1
- package/dist/components/file-icon/file-icon.styles.d.ts.map +1 -1
- package/dist/components/file-icon/file-icon.styles.js +4 -0
- package/dist/components/file-icon/file-icon.styles.js.map +1 -1
- package/dist/components/graph/graph.class.d.ts.map +1 -1
- package/dist/components/graph/graph.class.js +1 -3
- package/dist/components/graph/graph.class.js.map +1 -1
- package/dist/components/heatmap/heatmap.class.d.ts.map +1 -1
- package/dist/components/heatmap/heatmap.class.js +1 -8
- package/dist/components/heatmap/heatmap.class.js.map +1 -1
- package/dist/components/icon/icon.styles.d.ts.map +1 -1
- package/dist/components/icon/icon.styles.js +1 -1
- package/dist/components/icon/icon.styles.js.map +1 -1
- package/dist/components/include/include.class.d.ts +104 -0
- package/dist/components/include/include.class.d.ts.map +1 -0
- package/dist/components/include/include.class.js +149 -0
- package/dist/components/include/include.class.js.map +1 -0
- package/dist/components/include/include.d.ts +2 -0
- package/dist/components/include/include.d.ts.map +1 -0
- package/dist/components/include/include.js +5 -0
- package/dist/components/include/include.js.map +1 -0
- package/dist/components/include/include.styles.d.ts +2 -0
- package/dist/components/include/include.styles.d.ts.map +1 -0
- package/dist/components/include/include.styles.js +14 -0
- package/dist/components/include/include.styles.js.map +1 -0
- package/dist/components/kbd/kbd.class.d.ts.map +1 -1
- package/dist/components/kbd/kbd.class.js +1 -11
- package/dist/components/kbd/kbd.class.js.map +1 -1
- package/dist/components/known-date/known-date.class.d.ts +208 -0
- package/dist/components/known-date/known-date.class.d.ts.map +1 -0
- package/dist/components/known-date/known-date.class.js +588 -0
- package/dist/components/known-date/known-date.class.js.map +1 -0
- package/dist/components/known-date/known-date.d.ts +2 -0
- package/dist/components/known-date/known-date.d.ts.map +1 -0
- package/dist/components/known-date/known-date.js +5 -0
- package/dist/components/known-date/known-date.js.map +1 -0
- package/dist/components/known-date/known-date.styles.d.ts +2 -0
- package/dist/components/known-date/known-date.styles.d.ts.map +1 -0
- package/dist/components/known-date/known-date.styles.js +134 -0
- package/dist/components/known-date/known-date.styles.js.map +1 -0
- package/dist/components/lightbox/lightbox.class.d.ts +187 -0
- package/dist/components/lightbox/lightbox.class.d.ts.map +1 -0
- package/dist/components/lightbox/lightbox.class.js +415 -0
- package/dist/components/lightbox/lightbox.class.js.map +1 -0
- package/dist/components/lightbox/lightbox.d.ts +3 -0
- package/dist/components/lightbox/lightbox.d.ts.map +1 -0
- package/dist/components/lightbox/lightbox.js +6 -0
- package/dist/components/lightbox/lightbox.js.map +1 -0
- package/dist/components/lightbox/lightbox.styles.d.ts +2 -0
- package/dist/components/lightbox/lightbox.styles.d.ts.map +1 -0
- package/dist/components/lightbox/lightbox.styles.js +179 -0
- package/dist/components/lightbox/lightbox.styles.js.map +1 -0
- package/dist/components/map/map.class.d.ts.map +1 -1
- package/dist/components/map/map.class.js +11 -23
- package/dist/components/map/map.class.js.map +1 -1
- package/dist/components/menu/menu.class.d.ts +1 -1
- package/dist/components/model-settings-panel/model-settings-panel.class.d.ts.map +1 -1
- package/dist/components/model-settings-panel/model-settings-panel.class.js +1 -10
- package/dist/components/model-settings-panel/model-settings-panel.class.js.map +1 -1
- package/dist/components/qr-code/qr-code-loader.d.ts +15 -0
- package/dist/components/qr-code/qr-code-loader.d.ts.map +1 -0
- package/dist/components/qr-code/qr-code-loader.js +28 -0
- package/dist/components/qr-code/qr-code-loader.js.map +1 -0
- package/dist/components/qr-code/qr-code.class.d.ts +121 -0
- package/dist/components/qr-code/qr-code.class.d.ts.map +1 -0
- package/dist/components/qr-code/qr-code.class.js +392 -0
- package/dist/components/qr-code/qr-code.class.js.map +1 -0
- package/dist/components/qr-code/qr-code.d.ts +2 -0
- package/dist/components/qr-code/qr-code.d.ts.map +1 -0
- package/dist/components/qr-code/qr-code.js +5 -0
- package/dist/components/qr-code/qr-code.js.map +1 -0
- package/dist/components/qr-code/qr-code.styles.d.ts +2 -0
- package/dist/components/qr-code/qr-code.styles.d.ts.map +1 -0
- package/dist/components/qr-code/qr-code.styles.js +48 -0
- package/dist/components/qr-code/qr-code.styles.js.map +1 -0
- package/dist/components/random-content/random-content.class.d.ts +99 -0
- package/dist/components/random-content/random-content.class.d.ts.map +1 -0
- package/dist/components/random-content/random-content.class.js +268 -0
- package/dist/components/random-content/random-content.class.js.map +1 -0
- package/dist/components/random-content/random-content.d.ts +2 -0
- package/dist/components/random-content/random-content.d.ts.map +1 -0
- package/dist/components/random-content/random-content.js +5 -0
- package/dist/components/random-content/random-content.js.map +1 -0
- package/dist/components/random-content/random-content.styles.d.ts +2 -0
- package/dist/components/random-content/random-content.styles.d.ts.map +1 -0
- package/dist/components/random-content/random-content.styles.js +94 -0
- package/dist/components/random-content/random-content.styles.js.map +1 -0
- package/dist/components/result-card/result-card.class.d.ts +9 -8
- package/dist/components/result-card/result-card.class.d.ts.map +1 -1
- package/dist/components/result-card/result-card.class.js +7 -26
- package/dist/components/result-card/result-card.class.js.map +1 -1
- package/dist/components/result-card/result-field.class.d.ts.map +1 -1
- package/dist/components/result-card/result-field.class.js +1 -11
- package/dist/components/result-card/result-field.class.js.map +1 -1
- package/dist/components/slider/slider.class.d.ts.map +1 -1
- package/dist/components/slider/slider.class.js +1 -19
- package/dist/components/slider/slider.class.js.map +1 -1
- package/dist/components/source-card/source-card.class.d.ts +8 -7
- package/dist/components/source-card/source-card.class.d.ts.map +1 -1
- package/dist/components/source-card/source-card.class.js +6 -25
- package/dist/components/source-card/source-card.class.js.map +1 -1
- package/dist/components/stat/stat.class.js +1 -1
- package/dist/components/stat/stat.class.js.map +1 -1
- package/dist/components/swatch-picker/swatch-picker.class.d.ts +55 -0
- package/dist/components/swatch-picker/swatch-picker.class.d.ts.map +1 -0
- package/dist/components/swatch-picker/swatch-picker.class.js +120 -0
- package/dist/components/swatch-picker/swatch-picker.class.js.map +1 -0
- package/dist/components/swatch-picker/swatch-picker.d.ts +2 -0
- package/dist/components/swatch-picker/swatch-picker.d.ts.map +1 -0
- package/dist/components/swatch-picker/swatch-picker.js +5 -0
- package/dist/components/swatch-picker/swatch-picker.js.map +1 -0
- package/dist/components/swatch-picker/swatch-picker.styles.d.ts +2 -0
- package/dist/components/swatch-picker/swatch-picker.styles.d.ts.map +1 -0
- package/dist/components/swatch-picker/swatch-picker.styles.js +55 -0
- package/dist/components/swatch-picker/swatch-picker.styles.js.map +1 -0
- package/dist/components/time-range/time-range.class.d.ts.map +1 -1
- package/dist/components/time-range/time-range.class.js +1 -21
- package/dist/components/time-range/time-range.class.js.map +1 -1
- package/dist/components/timeline/timeline-item.class.d.ts +120 -0
- package/dist/components/timeline/timeline-item.class.d.ts.map +1 -0
- package/dist/components/timeline/timeline-item.class.js +203 -0
- package/dist/components/timeline/timeline-item.class.js.map +1 -0
- package/dist/components/timeline/timeline-item.d.ts +3 -0
- package/dist/components/timeline/timeline-item.d.ts.map +1 -0
- package/dist/components/timeline/timeline-item.js +10 -0
- package/dist/components/timeline/timeline-item.js.map +1 -0
- package/dist/components/timeline/timeline-item.styles.d.ts +2 -0
- package/dist/components/timeline/timeline-item.styles.d.ts.map +1 -0
- package/dist/components/timeline/timeline-item.styles.js +149 -0
- package/dist/components/timeline/timeline-item.styles.js.map +1 -0
- package/dist/components/timeline/timeline.class.d.ts +59 -0
- package/dist/components/timeline/timeline.class.d.ts.map +1 -0
- package/dist/components/timeline/timeline.class.js +100 -0
- package/dist/components/timeline/timeline.class.js.map +1 -0
- package/dist/components/timeline/timeline.d.ts +2 -0
- package/dist/components/timeline/timeline.d.ts.map +1 -0
- package/dist/components/timeline/timeline.js +5 -0
- package/dist/components/timeline/timeline.js.map +1 -0
- package/dist/components/timeline/timeline.styles.d.ts +2 -0
- package/dist/components/timeline/timeline.styles.d.ts.map +1 -0
- package/dist/components/timeline/timeline.styles.js +52 -0
- package/dist/components/timeline/timeline.styles.js.map +1 -0
- package/dist/components/toast/toast-item.class.d.ts.map +1 -1
- package/dist/components/toast/toast-item.class.js +1 -3
- package/dist/components/toast/toast-item.class.js.map +1 -1
- package/dist/components/tool-param-form/tool-param-form.class.d.ts.map +1 -1
- package/dist/components/tool-param-form/tool-param-form.class.js +0 -1
- package/dist/components/tool-param-form/tool-param-form.class.js.map +1 -1
- package/dist/components/tour/tour.class.d.ts +250 -0
- package/dist/components/tour/tour.class.d.ts.map +1 -0
- package/dist/components/tour/tour.class.js +530 -0
- package/dist/components/tour/tour.class.js.map +1 -0
- package/dist/components/tour/tour.d.ts +2 -0
- package/dist/components/tour/tour.d.ts.map +1 -0
- package/dist/components/tour/tour.js +5 -0
- package/dist/components/tour/tour.js.map +1 -0
- package/dist/components/tour/tour.styles.d.ts +2 -0
- package/dist/components/tour/tour.styles.d.ts.map +1 -0
- package/dist/components/tour/tour.styles.js +165 -0
- package/dist/components/tour/tour.styles.js.map +1 -0
- package/dist/components/virtual-list/virtual-list.class.d.ts.map +1 -1
- package/dist/components/virtual-list/virtual-list.class.js +1 -3
- package/dist/components/virtual-list/virtual-list.class.js.map +1 -1
- package/dist/components/word-cloud/word-cloud.class.d.ts.map +1 -1
- package/dist/components/word-cloud/word-cloud.class.js +1 -8
- package/dist/components/word-cloud/word-cloud.class.js.map +1 -1
- package/dist/components/zoomable-frame/zoomable-frame.class.d.ts +15 -0
- package/dist/components/zoomable-frame/zoomable-frame.class.d.ts.map +1 -1
- package/dist/components/zoomable-frame/zoomable-frame.class.js +18 -0
- package/dist/components/zoomable-frame/zoomable-frame.class.js.map +1 -1
- package/dist/internal/a11y.d.ts +4 -0
- package/dist/internal/a11y.d.ts.map +1 -1
- package/dist/internal/a11y.js +17 -0
- package/dist/internal/a11y.js.map +1 -1
- package/dist/internal/canvas.d.ts +8 -0
- package/dist/internal/canvas.d.ts.map +1 -0
- package/dist/internal/canvas.js +14 -0
- package/dist/internal/canvas.js.map +1 -0
- package/dist/internal/localization.d.ts +1 -1
- package/dist/internal/localization.d.ts.map +1 -1
- package/dist/internal/localization.js +21 -2
- package/dist/internal/localization.js.map +1 -1
- package/dist/internal/motion.d.ts +5 -0
- package/dist/internal/motion.d.ts.map +1 -0
- package/dist/internal/motion.js +7 -0
- package/dist/internal/motion.js.map +1 -0
- package/dist/internal/numbers.d.ts +11 -0
- package/dist/internal/numbers.d.ts.map +1 -1
- package/dist/internal/numbers.js +21 -0
- package/dist/internal/numbers.js.map +1 -1
- package/dist/internal/positioner.d.ts +14 -0
- package/dist/internal/positioner.d.ts.map +1 -1
- package/dist/internal/positioner.js +27 -0
- package/dist/internal/positioner.js.map +1 -1
- package/dist/internal/root-registration-allowlist.d.ts +1 -1
- package/dist/internal/root-registration-allowlist.d.ts.map +1 -1
- package/dist/internal/root-registration-allowlist.js +12 -0
- package/dist/internal/root-registration-allowlist.js.map +1 -1
- package/dist/internal/rtl.d.ts +0 -11
- package/dist/internal/rtl.d.ts.map +1 -1
- package/dist/internal/rtl.js +0 -13
- package/dist/internal/rtl.js.map +1 -1
- package/dist/internal/safe-css.d.ts +15 -0
- package/dist/internal/safe-css.d.ts.map +1 -0
- package/dist/internal/safe-css.js +25 -0
- package/dist/internal/safe-css.js.map +1 -0
- package/dist/internal/strip-host-title.d.ts +24 -0
- package/dist/internal/strip-host-title.d.ts.map +1 -0
- package/dist/internal/strip-host-title.js +46 -0
- package/dist/internal/strip-host-title.js.map +1 -0
- package/dist/internal/tokens.styles.d.ts.map +1 -1
- package/dist/internal/tokens.styles.js +4 -0
- package/dist/internal/tokens.styles.js.map +1 -1
- package/dist/lyra.d.ts +37 -0
- package/dist/lyra.d.ts.map +1 -1
- package/dist/lyra.js +24 -0
- package/dist/lyra.js.map +1 -1
- package/llms-full.txt +161 -5
- package/llms.txt +5 -2
- package/package.json +43 -6
- package/vscode-css-data.json +733 -0
- package/vscode-html-data.json +10616 -0
- package/web-types.json +12206 -0
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { html } from 'lit';
|
|
8
|
+
import { property } from 'lit/decorators.js';
|
|
9
|
+
import { LyraElement } from '../../internal/lyra-element.js';
|
|
10
|
+
import { safeFetchUrl } from '../../internal/safe-url.js';
|
|
11
|
+
import { isAbortError, isResourceLimitError, readResponseText } from '../../internal/resource-loader.js';
|
|
12
|
+
import { loadHtmlSanitizer } from '../html-viewer/dompurify-loader.js';
|
|
13
|
+
import { styles } from './include.styles.js';
|
|
14
|
+
const VALID_MODES = new Set(['cors', 'no-cors', 'same-origin']);
|
|
15
|
+
/**
|
|
16
|
+
* `<lyra-include>` fetches an HTML fragment from `src` and transcludes it into
|
|
17
|
+
* the page as sanitized light-DOM content, so the fragment participates in
|
|
18
|
+
* the surrounding page's CSS cascade exactly like a native server-side
|
|
19
|
+
* include — unlike `<lyra-html-viewer>`, which renders a foreign document
|
|
20
|
+
* inside an isolated preview card.
|
|
21
|
+
*
|
|
22
|
+
* The fetched markup always passes through the shared DOMPurify-backed
|
|
23
|
+
* sanitizer (`loadHtmlSanitizer()`, the same loader `<lyra-html-viewer>`
|
|
24
|
+
* uses) before it ever touches `innerHTML` — there is no `allow-scripts`
|
|
25
|
+
* escape hatch here, unlike the Web Awesome/Shoelace components this element
|
|
26
|
+
* otherwise mirrors: their raw, unsanitized injection (with an opt-in to
|
|
27
|
+
* actually re-execute embedded `<script>` tags) is incompatible with this
|
|
28
|
+
* library's sanitize-always contract, so that option is simply omitted
|
|
29
|
+
* rather than shipped as a documented no-op.
|
|
30
|
+
*
|
|
31
|
+
* `mode` deliberately defaults to `'same-origin'` rather than the `'cors'`
|
|
32
|
+
* default those upstream components document — a same-origin-only fetch
|
|
33
|
+
* fails closed unless a consumer explicitly opts in to cross-origin fetching
|
|
34
|
+
* with `mode="cors"` (and the remote server cooperates via CORS headers).
|
|
35
|
+
* `'no-cors'` is accepted for enum completeness but is rarely useful: it
|
|
36
|
+
* always yields an opaque response (`status` `0`, unreadable body), a Fetch
|
|
37
|
+
* API platform limitation rather than a bug here.
|
|
38
|
+
*
|
|
39
|
+
* This is a deliberately bare transclusion primitive with no label/hint/
|
|
40
|
+
* error chrome — its interaction idiom (silently swapping light-DOM content)
|
|
41
|
+
* is incompatible with a generic label/hint/error frame. Listen for
|
|
42
|
+
* `lyra-include-error` to build your own error UI, and author meaningful
|
|
43
|
+
* fallback content inside `<lyra-include>` for when the fetch never
|
|
44
|
+
* succeeds; that fallback (and any previously successful include) is left
|
|
45
|
+
* untouched on failure. No `aria-live` region wraps the slot either: the
|
|
46
|
+
* fragment can contain its own landmarks and nested content, and forcing the
|
|
47
|
+
* whole host into a live region would re-announce all of it on every load.
|
|
48
|
+
*
|
|
49
|
+
* No implicit ARIA role and no computed accessible name are applied around
|
|
50
|
+
* the transcluded content — the fragment's own semantics (headings,
|
|
51
|
+
* landmarks, its own `role`/`aria-*` attributes) surface directly and
|
|
52
|
+
* unmodified, exactly as they would in a native include. `aria-busy="true"`
|
|
53
|
+
* is set on the host while a fetch is in flight and removed once it settles,
|
|
54
|
+
* whether it succeeds or fails.
|
|
55
|
+
*
|
|
56
|
+
* @customElement lyra-include
|
|
57
|
+
* @slot - Fallback content shown until (or unless) a fetch succeeds; overwritten with the sanitized fragment once one does.
|
|
58
|
+
* @event lyra-load - The fetched fragment was sanitized and written into the light DOM.
|
|
59
|
+
* @event lyra-include-error - Fetching or sanitizing the fragment failed; see `LyraIncludeErrorReason` for `detail.reason`.
|
|
60
|
+
* @csspart base - The non-layout (`display: contents`) wrapper around the default slot.
|
|
61
|
+
*/
|
|
62
|
+
export class LyraInclude extends LyraElement {
|
|
63
|
+
constructor() {
|
|
64
|
+
super(...arguments);
|
|
65
|
+
/**
|
|
66
|
+
* URL of the HTML fragment to fetch, validated through the shared
|
|
67
|
+
* `safeFetchUrl()` allowlist (`http:`, `https:`, `blob:`, `data:`).
|
|
68
|
+
* An empty/falsy value is a no-op: no fetch, no events, existing content
|
|
69
|
+
* untouched.
|
|
70
|
+
*/
|
|
71
|
+
this.src = '';
|
|
72
|
+
/**
|
|
73
|
+
* Forwarded to `fetch(url, { mode })`. Deliberately defaults to
|
|
74
|
+
* `'same-origin'` rather than the `'cors'` default documented by the
|
|
75
|
+
* Web Awesome/Shoelace components this element otherwise mirrors — a
|
|
76
|
+
* consumer opts in to cross-origin fetching explicitly. An invalid/typo'd
|
|
77
|
+
* attribute value is defensively normalized back to `'same-origin'`
|
|
78
|
+
* rather than letting `fetch()` throw synchronously for an invalid
|
|
79
|
+
* `RequestMode`.
|
|
80
|
+
*/
|
|
81
|
+
this.mode = 'same-origin';
|
|
82
|
+
this.generation = 0;
|
|
83
|
+
}
|
|
84
|
+
static { this.styles = [LyraElement.styles, styles]; }
|
|
85
|
+
updated(changed) {
|
|
86
|
+
if (changed.has('src') || changed.has('mode')) {
|
|
87
|
+
this.scheduleAfterUpdate(() => { void this.load(); });
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
async load() {
|
|
91
|
+
const generation = ++this.generation;
|
|
92
|
+
const signal = this.beginAbortableLoad();
|
|
93
|
+
// Unconditionally clear first: a superseded generation's in-flight fetch
|
|
94
|
+
// may still be settling (as an aborted/rejected promise) after this new
|
|
95
|
+
// generation starts, and none of its own early-return paths below touch
|
|
96
|
+
// aria-busy, so a stale "true" from that generation must not survive
|
|
97
|
+
// into this one. Re-set to 'true' just below if this generation actually
|
|
98
|
+
// reaches the fetch.
|
|
99
|
+
this.removeAttribute('aria-busy');
|
|
100
|
+
if (!this.src)
|
|
101
|
+
return; // idle no-op: no fetch, no events, content untouched
|
|
102
|
+
const url = safeFetchUrl(this.src);
|
|
103
|
+
if (!url) {
|
|
104
|
+
this.emit('lyra-include-error', { status: 0, reason: 'blocked-url' });
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
this.setAttribute('aria-busy', 'true');
|
|
108
|
+
const mode = VALID_MODES.has(this.mode) ? this.mode : 'same-origin';
|
|
109
|
+
try {
|
|
110
|
+
const response = await fetch(url, signal ? { mode, signal } : { mode });
|
|
111
|
+
if (!response.ok) {
|
|
112
|
+
if (generation === this.generation)
|
|
113
|
+
this.fail(response.status, 'http');
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
const sanitizer = await loadHtmlSanitizer();
|
|
117
|
+
if (!sanitizer) {
|
|
118
|
+
if (generation === this.generation)
|
|
119
|
+
this.fail(0, 'missing-sanitizer');
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
const markup = sanitizer.sanitize(await readResponseText(response));
|
|
123
|
+
if (generation !== this.generation || !this.isConnected)
|
|
124
|
+
return; // superseded/detached — silent
|
|
125
|
+
this.innerHTML = markup;
|
|
126
|
+
this.removeAttribute('aria-busy');
|
|
127
|
+
this.emit('lyra-load', { src: this.src });
|
|
128
|
+
}
|
|
129
|
+
catch (error) {
|
|
130
|
+
if (isAbortError(error) || !this.isConnected || generation !== this.generation)
|
|
131
|
+
return; // silent
|
|
132
|
+
this.fail(0, isResourceLimitError(error) ? 'resource-too-large' : 'network', error);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
fail(status, reason, error) {
|
|
136
|
+
this.removeAttribute('aria-busy');
|
|
137
|
+
this.emit('lyra-include-error', { status, reason, error });
|
|
138
|
+
}
|
|
139
|
+
render() {
|
|
140
|
+
return html `<span part="base"><slot></slot></span>`;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
__decorate([
|
|
144
|
+
property({ reflect: true })
|
|
145
|
+
], LyraInclude.prototype, "src", void 0);
|
|
146
|
+
__decorate([
|
|
147
|
+
property({ reflect: true })
|
|
148
|
+
], LyraInclude.prototype, "mode", void 0);
|
|
149
|
+
//# sourceMappingURL=include.class.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"include.class.js","sourceRoot":"","sources":["../../../src/components/include/include.class.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAA4C,MAAM,KAAK,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACzG,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAK7C,MAAM,WAAW,GAAwB,IAAI,GAAG,CAAkB,CAAC,MAAM,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC,CAAC;AAoBtG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,MAAM,OAAO,WAAY,SAAQ,WAAgC;IAAjE;;QAGE;;;;;WAKG;QAC0B,QAAG,GAAG,EAAE,CAAC;QAEtC;;;;;;;;WAQG;QAC0B,SAAI,GAAoB,aAAa,CAAC;QAE3D,eAAU,GAAG,CAAC,CAAC;IA0DzB,CAAC;aA/EQ,WAAM,GAAG,CAAC,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,AAA/B,CAAgC;IAuBnC,OAAO,CAAC,OAAuB;QACvC,IAAI,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;YAC9C,IAAI,CAAC,mBAAmB,CAAC,GAAG,EAAE,GAAG,KAAK,I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AAI,EAAE,CAAC;wCAAU;AAWT;IAA5B,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;yCAAuC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"include.d.ts","sourceRoot":"","sources":["../../../src/components/include/include.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"include.js","sourceRoot":"","sources":["../../../src/components/include/include.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,aAAa,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"include.styles.d.ts","sourceRoot":"","sources":["../../../src/components/include/include.styles.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,MAAM,yBAQlB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
// No visual chrome of its own: the fetched fragment supplies whatever layout
|
|
3
|
+
// or design-token usage it needs once transcluded into the light DOM, so
|
|
4
|
+
// there is nothing here to express through --lyra-* custom properties.
|
|
5
|
+
export const styles = css `
|
|
6
|
+
:host {
|
|
7
|
+
display: contents;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
[part='base'] {
|
|
11
|
+
display: contents;
|
|
12
|
+
}
|
|
13
|
+
`;
|
|
14
|
+
//# sourceMappingURL=include.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"include.styles.js","sourceRoot":"","sources":["../../../src/components/include/include.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,6EAA6E;AAC7E,yEAAyE;AACzE,uEAAuE;AACvE,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;CAQxB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kbd.class.d.ts","sourceRoot":"","sources":["../../../src/components/kbd/kbd.class.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAEzD,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"kbd.class.d.ts","sourceRoot":"","sources":["../../../src/components/kbd/kbd.class.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAEzD,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAI7D;;;2EAG2E;AAC3E,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;gBAIgB;AAChB,MAAM,MAAM,WAAW,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC;AA+CpE;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,WAAW,GAAG,WAAW,CAyCxG;AAED;wEACwE;AACxE,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,WAAW,GAAG,WAAW,EAAE,CAMjG;AA2BD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,qBAAa,OAAQ,SAAQ,WAAW;IACtC,MAAM,CAAC,MAAM,iCAAgC;IAE7C;8BAC0B;IACd,IAAI,SAAM;IAOb,OAAO,CAAC,gBAAgB,CAAS;IAE1C,SAAS,CAAC,UAAU,IAAI,IAAI,CAI3B;IAED,OAAO,CAAC,YAAY,CAElB;IAEF,MAAM,IAAI,cAAc,CAkDvB;CACF;AAGD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,UAAU,EAAE,OAAO,CAAC;KACrB;CACF"}
|
|
@@ -7,6 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
import { html, nothing } from 'lit';
|
|
8
8
|
import { property, state } from 'lit/decorators.js';
|
|
9
9
|
import { LyraElement } from '../../internal/lyra-element.js';
|
|
10
|
+
import { hasRealContent } from '../../internal/a11y.js';
|
|
10
11
|
import { styles } from './kbd.styles.js';
|
|
11
12
|
// A deliberately small map — just the modifier-adjacent/navigation keys
|
|
12
13
|
// common enough in real shortcuts to be worth a friendly glyph. Anything not
|
|
@@ -121,17 +122,6 @@ function detectIsMac() {
|
|
|
121
122
|
// little cost, however small) from re-detecting it on every <lyra-kbd>
|
|
122
123
|
// instance or every re-render.
|
|
123
124
|
const IS_MAC = detectIsMac();
|
|
124
|
-
// The one "is there real content" predicate shared by both the initial
|
|
125
|
-
// synchronous seed (willUpdate, reading light-DOM childNodes) and the
|
|
126
|
-
// runtime slotchange handler (reading assignedNodes) — using two different
|
|
127
|
-
// predicates for the same question let them disagree: a text-only check
|
|
128
|
-
// would seed correctly for whitespace-only text but (wrongly) treat a
|
|
129
|
-
// content-less icon element as empty, and a node-count-only check would
|
|
130
|
-
// treat *any* assigned node — including a whitespace-only text node — as
|
|
131
|
-
// real content. Counting every element node as real content (regardless of
|
|
132
|
-
// its own text) while requiring non-whitespace text from text nodes gets
|
|
133
|
-
// both cases right in one place.
|
|
134
|
-
const hasRealContent = (nodes) => Array.from(nodes).some((n) => n.nodeType === Node.ELEMENT_NODE || (n.textContent ?? '').trim().length > 0);
|
|
135
125
|
/**
|
|
136
126
|
* `<lyra-kbd>` — a small chip representing a keyboard shortcut, rendering
|
|
137
127
|
* the platform-appropriate glyph for cross-platform modifier keys (⌘ on
|
|
@@ -1 +1 @@
|
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,yDAAyD;QACzD,MAAM,SAAS,GAAG,aAAa,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAEvE,OAAO,IAAI,CAAA;;;eAGA,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO;sBACpB,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM;qBAC7B,SAAS,IAAI,OAAO;;UAE/B,MAAM,CAAC,GAAG,CACV,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,IAAI,CAAA;cACV,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA,+CAA+C,CAAC,CAAC,CAAC,OAAO;+BACpD,CAAC,CAAC,MAAM;WAC5B,CACF;4BACmB,IAAI,CAAC,YAAY;;KAExC,CAAC;IACJ,CAAC;CACF;AAtEa;IAAX,QAAQ,EAAE;qCAAW;AAOL;IAAhB,KAAK,EAAE;iDAAkC"}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import { type PropertyValues, type TemplateResult } from 'lit';
|
|
2
|
+
import { LyraElement } from '../../internal/lyra-element.js';
|
|
3
|
+
export type LyraKnownDateSize = 'xs' | 's' | 'm' | 'l' | 'xl';
|
|
4
|
+
export type LyraKnownDateField = 'day' | 'month' | 'year';
|
|
5
|
+
export interface LyraKnownDateEventDetail {
|
|
6
|
+
/** Canonical ISO 8601 date (`YYYY-MM-DD`), or `''` while incomplete/invalid. Mirrors `value`. */
|
|
7
|
+
value: string;
|
|
8
|
+
/** Per-field raw text as currently typed, always present even while incomplete. */
|
|
9
|
+
day: string;
|
|
10
|
+
month: string;
|
|
11
|
+
year: string;
|
|
12
|
+
/** Which field the user was last editing when this event fired. */
|
|
13
|
+
field: LyraKnownDateField;
|
|
14
|
+
}
|
|
15
|
+
export interface LyraKnownDateEventMap {
|
|
16
|
+
input: CustomEvent<LyraKnownDateEventDetail>;
|
|
17
|
+
change: CustomEvent<LyraKnownDateEventDetail>;
|
|
18
|
+
focus: CustomEvent<undefined>;
|
|
19
|
+
blur: CustomEvent<undefined>;
|
|
20
|
+
}
|
|
21
|
+
declare class LyraKnownDateBase extends LyraElement<LyraKnownDateEventMap> {
|
|
22
|
+
}
|
|
23
|
+
declare const LyraKnownDate_base: typeof LyraKnownDateBase & (new (...args: any[]) => import("../../lyra.js").FormAssociatedInterface);
|
|
24
|
+
/**
|
|
25
|
+
* `<lyra-known-date>` — a date a user already knows (a birthdate, a passport
|
|
26
|
+
* issue/expiry date) collected as three plain, labeled day/month/year number
|
|
27
|
+
* fields in the locale's natural field order, rather than a calendar popup.
|
|
28
|
+
* Form-associated; the submitted form value is always canonical ISO 8601
|
|
29
|
+
* (`YYYY-MM-DD`), or `''` while any field is blank or the combination isn't a
|
|
30
|
+
* real calendar date. Mirrors Web Awesome's `wa-known-date` API surface under
|
|
31
|
+
* `lyra-`, with `appearance`/`pill`/`form` dropped and `size` normalized to
|
|
32
|
+
* this library's own `xs`–`xl` scale, matching every other lyra form control
|
|
33
|
+
* mirrored from a Web Awesome counterpart.
|
|
34
|
+
*
|
|
35
|
+
* A field's own `<input>` shows exactly what was typed (never reformatted or
|
|
36
|
+
* reverted) -- only the composite `value` is zero-padded. Auto-advance
|
|
37
|
+
* (typing a field's last digit moves focus to the next field) and
|
|
38
|
+
* backspace-to-previous-field-when-empty are this library's own additions on
|
|
39
|
+
* top of Web Awesome's bare typing model, which documents no auto-advance;
|
|
40
|
+
* don't remove them to "restore" WA parity. Arrow-key field-to-field
|
|
41
|
+
* navigation at a field's text boundary is RTL-aware: the *physical* key that
|
|
42
|
+
* means "toward the next field" flips under an inherited `dir="rtl"`, while
|
|
43
|
+
* the field order itself (locale-derived) does not. Non-digit keystrokes are
|
|
44
|
+
* rejected before they reach a field's state -- no locale-specific numeral
|
|
45
|
+
* input (e.g. Arabic-Indic digits) is supported.
|
|
46
|
+
*
|
|
47
|
+
* No resizable text-editing surface exists (three fixed-width digit fields),
|
|
48
|
+
* so resize forwarding doesn't apply, and `spellcheck`/`autocapitalize`/
|
|
49
|
+
* `autocorrect`/`wrap` don't meaningfully apply to 2–4-digit numeric fields
|
|
50
|
+
* either -- the same carve-out `lyra-input[type="number"]` already documents.
|
|
51
|
+
*
|
|
52
|
+
* @customElement lyra-known-date
|
|
53
|
+
* @event input - Fires on every keystroke in any field. `detail.value` is the canonical ISO date
|
|
54
|
+
* only once all three fields resolve to a real calendar date, otherwise `''`; `detail.day`/
|
|
55
|
+
* `month`/`year` always carry the live raw typed text.
|
|
56
|
+
* @event change - Fires when a field loses focus (including a Tab/auto-advance move away from it)
|
|
57
|
+
* and the composite value has newly transitioned to a different complete date, or from complete
|
|
58
|
+
* back to incomplete/blank. Programmatic `value`/`valueAsDate` assignment stays silent.
|
|
59
|
+
* @event focus - Re-dispatched, bubbling and composed, when any of the three internal fields
|
|
60
|
+
* receives focus (native `focus` doesn't bubble or cross a shadow boundary).
|
|
61
|
+
* @event blur - Re-dispatched, bubbling and composed, once when focus leaves all three internal
|
|
62
|
+
* fields for something outside the control -- not once per internal field-to-field Tab.
|
|
63
|
+
* @slot label - Custom label/legend content, alongside the `label` attribute.
|
|
64
|
+
* @slot hint - Custom hint content, alongside the `hint` attribute.
|
|
65
|
+
* @slot error - Custom error content, alongside the `errorText` attribute.
|
|
66
|
+
* @csspart form-control - The outer wrapper around legend, fieldset, hint, and error.
|
|
67
|
+
* @csspart fieldset - The `<fieldset>` grouping the three fields.
|
|
68
|
+
* @csspart legend - The `<legend>` element.
|
|
69
|
+
* @csspart fields - The row wrapping the three field blocks.
|
|
70
|
+
* @csspart field - Each field block (label + input), repeated three times; distinguished by
|
|
71
|
+
* `data-field="day"|"month"|"year"`.
|
|
72
|
+
* @csspart field-input - The native per-field `<input type="text" inputmode="numeric">`, repeated
|
|
73
|
+
* three times; distinguished by `data-field="day"|"month"|"year"`.
|
|
74
|
+
* @csspart field-label - The small visible per-field text label ("Day"/"Month"/"Year").
|
|
75
|
+
* @csspart hint - The hint message.
|
|
76
|
+
* @csspart error - The validation message.
|
|
77
|
+
*/
|
|
78
|
+
export declare class LyraKnownDate extends LyraKnownDate_base {
|
|
79
|
+
static styles: import("lit").CSSResultGroup[];
|
|
80
|
+
static properties: {
|
|
81
|
+
min: {
|
|
82
|
+
noAccessor: boolean;
|
|
83
|
+
};
|
|
84
|
+
max: {
|
|
85
|
+
noAccessor: boolean;
|
|
86
|
+
};
|
|
87
|
+
readonly: {
|
|
88
|
+
type: BooleanConstructor;
|
|
89
|
+
reflect: boolean;
|
|
90
|
+
noAccessor: boolean;
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
size: LyraKnownDateSize;
|
|
94
|
+
label: string;
|
|
95
|
+
hint: string;
|
|
96
|
+
errorText: string;
|
|
97
|
+
/** BCP-47 override for field order and field-label localization sampling. Empty string falls
|
|
98
|
+
* back to `this.effectiveLocale` (inherited `lang`/ancestor), exactly like `lyra-date-input`'s
|
|
99
|
+
* `locale`. Redeclared (non-reflecting) over `LyraElement`'s own reflecting `locale` for the
|
|
100
|
+
* same reason `lyra-date-input` does. */
|
|
101
|
+
locale: string;
|
|
102
|
+
/** Forwarded to the internal day field as-is when non-empty. The special value `'bday'`
|
|
103
|
+
* expands into `'bday-day'`/`'bday-month'`/`'bday-year'` split across the three fields; any
|
|
104
|
+
* other non-empty value is forwarded verbatim to all three fields unmodified. */
|
|
105
|
+
autocomplete: string;
|
|
106
|
+
/** Overrides the fieldset's computed accessible name (normally the `<legend>`'s content). Applied
|
|
107
|
+
* as `aria-label` on the `part="fieldset"` element, which owns the role -- not just the host. */
|
|
108
|
+
accessibleLabel: string | null;
|
|
109
|
+
/** Visible + accessible per-field label for the day field. Routes through
|
|
110
|
+
* `this.localize('knownDateDay', ...)`. */
|
|
111
|
+
dayLabel: string;
|
|
112
|
+
/** Visible + accessible per-field label for the month field. Routes through
|
|
113
|
+
* `this.localize('knownDateMonth', ...)`. */
|
|
114
|
+
monthLabel: string;
|
|
115
|
+
/** Visible + accessible per-field label for the year field. Routes through
|
|
116
|
+
* `this.localize('knownDateYear', ...)`. */
|
|
117
|
+
yearLabel: string;
|
|
118
|
+
private dayText;
|
|
119
|
+
private monthText;
|
|
120
|
+
private yearText;
|
|
121
|
+
private touched;
|
|
122
|
+
private hasLabelSlot;
|
|
123
|
+
private hasHintSlot;
|
|
124
|
+
private hasErrorSlot;
|
|
125
|
+
private _min;
|
|
126
|
+
private _max;
|
|
127
|
+
private _readonly;
|
|
128
|
+
/** The last value a `change` event was fired for (or the constructed initial value) -- lets
|
|
129
|
+
* `commitChangeIfNeeded()` fire `change` only on a real transition, matching `lyra-date-input`'s
|
|
130
|
+
* own "input fires more often than change" contract. */
|
|
131
|
+
private lastCommittedValue;
|
|
132
|
+
private lastEditedField;
|
|
133
|
+
private readonly hintId;
|
|
134
|
+
private readonly errorId;
|
|
135
|
+
private readonly dayId;
|
|
136
|
+
private readonly monthId;
|
|
137
|
+
private readonly yearId;
|
|
138
|
+
constructor();
|
|
139
|
+
get min(): string;
|
|
140
|
+
set min(next: string);
|
|
141
|
+
get max(): string;
|
|
142
|
+
set max(next: string);
|
|
143
|
+
get readonly(): boolean;
|
|
144
|
+
set readonly(next: boolean);
|
|
145
|
+
get value(): string;
|
|
146
|
+
/** Normalizes an assignment to the canonical ISO date or `''`, and repopulates the three raw
|
|
147
|
+
* field texts to match -- a declarative `value="2007-3-27"` (non-padded) or a calendar-invalid
|
|
148
|
+
* literal (`"2007-02-30"`) sanitizes to `''`, same strict-ISO gate as `lyra-date-input`'s
|
|
149
|
+
* `parseStrictISO()`. Programmatic assignment stays silent (no `input`/`change`), matching every
|
|
150
|
+
* `FormAssociated` sibling's documented contract. */
|
|
151
|
+
set value(next: string);
|
|
152
|
+
/** The composite value as a local-midnight `Date`, or `null` while incomplete/invalid. */
|
|
153
|
+
get valueAsDate(): Date | null;
|
|
154
|
+
set valueAsDate(next: Date | null);
|
|
155
|
+
private parseStrictISO;
|
|
156
|
+
private get fieldOrder();
|
|
157
|
+
private textFor;
|
|
158
|
+
private setFieldText;
|
|
159
|
+
private idFor;
|
|
160
|
+
private get effectiveDayLabel();
|
|
161
|
+
private get effectiveMonthLabel();
|
|
162
|
+
private get effectiveYearLabel();
|
|
163
|
+
private labelFor;
|
|
164
|
+
/** `'bday'` expands into per-field companion tokens; any other non-empty value forwards
|
|
165
|
+
* verbatim to all three fields (see the `autocomplete` property doc comment). */
|
|
166
|
+
private autocompleteFor;
|
|
167
|
+
/** Computes the canonical zero-padded ISO date from the three raw typed field texts, or `''`
|
|
168
|
+
* when any field is empty or the combination isn't a real calendar date. */
|
|
169
|
+
private computeCanonicalValue;
|
|
170
|
+
/** Recomputes the composite value from the three field texts and pushes it through the base
|
|
171
|
+
* `FormAssociated` setter directly (bypassing this class's own `value` setter above, which
|
|
172
|
+
* would otherwise re-derive and clobber the raw per-field text this method is reading from). */
|
|
173
|
+
private commitFromFields;
|
|
174
|
+
private get eventDetail();
|
|
175
|
+
private detailFor;
|
|
176
|
+
/** Fires `change` only on a real transition of the composite value -- called on every field
|
|
177
|
+
* blur (whether that blur stays inside the control or leaves it), which also covers an
|
|
178
|
+
* auto-advance move since focusing another field synchronously blurs the current one first. */
|
|
179
|
+
private commitChangeIfNeeded;
|
|
180
|
+
private fieldInputElement;
|
|
181
|
+
/** Moves focus to the field `delta` steps away from `field` in locale field order; a no-op past
|
|
182
|
+
* either end (e.g. Backspace-empty on the first field, or auto-advance past the last field). */
|
|
183
|
+
private focusAdjacentField;
|
|
184
|
+
protected updateValidity(): void;
|
|
185
|
+
protected willUpdate(): void;
|
|
186
|
+
protected updated(changed: PropertyValues): void;
|
|
187
|
+
formResetCallback(): void;
|
|
188
|
+
private onLabelSlotChange;
|
|
189
|
+
private onHintSlotChange;
|
|
190
|
+
private onErrorSlotChange;
|
|
191
|
+
private onFieldInput;
|
|
192
|
+
private onFieldKeydown;
|
|
193
|
+
private onFieldFocus;
|
|
194
|
+
private onFieldBlur;
|
|
195
|
+
/** Focuses the first field in locale order. */
|
|
196
|
+
focus(options?: FocusOptions): void;
|
|
197
|
+
/** Blurs whichever internal field currently has focus, if any. */
|
|
198
|
+
blur(): void;
|
|
199
|
+
private renderField;
|
|
200
|
+
render(): TemplateResult;
|
|
201
|
+
}
|
|
202
|
+
declare global {
|
|
203
|
+
interface HTMLElementTagNameMap {
|
|
204
|
+
'lyra-known-date': LyraKnownDate;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
export {};
|
|
208
|
+
//# sourceMappingURL=known-date.class.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"known-date.class.d.ts","sourceRoot":"","sources":["../../../src/components/known-date/known-date.class.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,cAAc,EAAE,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAE9E,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAM7D,MAAM,MAAM,iBAAiB,GAAG,IAAI,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,CAAC;AAC9D,MAAM,MAAM,kBAAkB,GAAG,KAAK,GAAG,OAAO,GAAG,MAAM,CAAC;AAoD1D,MAAM,WAAW,wBAAwB;IACvC,iGAAiG;IACjG,KAAK,EAAE,MAAM,CAAC;IACd,mFAAmF;IACnF,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,mEAAmE;IACnE,KAAK,EAAE,kBAAkB,CAAC;CAC3B;AAED,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,WAAW,CAAC,wBAAwB,CAAC,CAAC;IAC7C,MAAM,EAAE,WAAW,CAAC,wBAAwB,CAAC,CAAC;IAC9C,KAAK,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IAC9B,IAAI,EAAE,WAAW,CAAC,SAAS,CAAC,C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