@optionfactory/fml 9.0.0-rc4 → 9.0.0-rc5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/custom-elements.json +7 -0
- package/dist/fml.css +1 -1
- package/dist/fml.css.map +1 -1
- package/dist/fml.iife.js +44 -6
- package/dist/fml.iife.js.map +1 -1
- package/dist/fml.iife.min.js +1 -1
- package/dist/fml.iife.min.js.map +1 -1
- package/dist/ful.css +1 -1
- package/dist/ful.css.map +1 -1
- package/dist/ful.d.mts +20 -1
- package/dist/ful.iife.js +44 -6
- package/dist/ful.iife.js.map +1 -1
- package/dist/ful.iife.min.js +1 -1
- package/dist/ful.iife.min.js.map +1 -1
- package/dist/ful.min.mjs +1 -1
- package/dist/ful.min.mjs.map +1 -1
- package/dist/ful.mjs +44 -6
- package/dist/ful.mjs.map +1 -1
- package/dist/vscode.html-custom-data.json +4 -0
- package/dist/web-types.json +9 -1
- package/package.json +1 -1
package/dist/fml.iife.js
CHANGED
|
@@ -11079,15 +11079,37 @@ var fml = (function (exports) {
|
|
|
11079
11079
|
}
|
|
11080
11080
|
}
|
|
11081
11081
|
|
|
11082
|
-
/**
|
|
11082
|
+
/**
|
|
11083
|
+
* A modal dialog on the native platform, open()/ask() resolving with the
|
|
11084
|
+
* closer's data-result.
|
|
11085
|
+
*
|
|
11086
|
+
* The header carries a close button, as the drawer's does: Escape dismisses a
|
|
11087
|
+
* modal on its own, but nothing says so, and a dialog whose only exit is a key
|
|
11088
|
+
* you have to know about leaves a pointer with nowhere to go. It answers the way
|
|
11089
|
+
* Escape does, with null.
|
|
11090
|
+
*
|
|
11091
|
+
* `requires-answer` is for the dialog that must be answered: the close button is not
|
|
11092
|
+
* rendered and Escape is refused, so the only way out is a button that carries a
|
|
11093
|
+
* result. It has to be both, a close button withheld while Escape still worked
|
|
11094
|
+
* being decoration rather than a rule.
|
|
11095
|
+
*
|
|
11096
|
+
* The chrome is reachable by class as well as by tag, so a plain `<dialog
|
|
11097
|
+
* class="ful-dialog">` written by a page gets the same look whatever its
|
|
11098
|
+
* structure: the tag form matches a direct child, and `ful-dialog-header`,
|
|
11099
|
+
* `ful-dialog-body` and `ful-dialog-footer` match at any depth, which is what a
|
|
11100
|
+
* dialog whose content is wrapped in a form needs.
|
|
11101
|
+
*/
|
|
11083
11102
|
class Dialog extends ParsedElement {
|
|
11084
|
-
static attributes = ['header'];
|
|
11103
|
+
static attributes = ['header', 'requires-answer:presence'];
|
|
11085
11104
|
static slots = true;
|
|
11086
11105
|
static template = `
|
|
11087
11106
|
<dialog data-ref="dialog" class="ful-dialog">
|
|
11088
|
-
<header data-tpl-if="header"
|
|
11089
|
-
|
|
11090
|
-
|
|
11107
|
+
<header data-tpl-if="header || !requiresAnswer" class="ful-dialog-header">
|
|
11108
|
+
<h2 data-tpl-if="header">{{ header }}</h2>
|
|
11109
|
+
<button data-tpl-if="!requiresAnswer" type="button" data-ref="close" data-tpl-aria-label="#l10n:t('dialog.close')"><ful-icon name="x-lg" aria-hidden="true"></ful-icon></button>
|
|
11110
|
+
</header>
|
|
11111
|
+
<div data-ref="body" class="ful-dialog-body">{{{{ slots.default }}}}</div>
|
|
11112
|
+
<footer class="ful-dialog-footer">
|
|
11091
11113
|
<button type="button" data-ref="acknowledge" data-result="acknowledged" data-tpl-if="!slots.buttons" data-tpl-aria-label="#l10n:t('dialog.acknowledge')">{{ #l10n:t('dialog.acknowledge') }}</button>
|
|
11092
11114
|
{{{{ slots.buttons }}}}
|
|
11093
11115
|
</footer>
|
|
@@ -11098,8 +11120,9 @@ var fml = (function (exports) {
|
|
|
11098
11120
|
#requests = new SectionRequests();
|
|
11099
11121
|
#resolvers = [];
|
|
11100
11122
|
render({ slots }) {
|
|
11123
|
+
const requiresAnswer = this.declared('requires-answer');
|
|
11101
11124
|
const fragment = this.template()
|
|
11102
|
-
.withOverlay({ slots, header: this.declared('header') ?? '' })
|
|
11125
|
+
.withOverlay({ slots, header: this.declared('header') ?? '', requiresAnswer })
|
|
11103
11126
|
.render();
|
|
11104
11127
|
this.#dialog = fragment.querySelector('[data-ref=dialog]');
|
|
11105
11128
|
this.#body = fragment.querySelector('[data-ref=body]');
|
|
@@ -11117,6 +11140,17 @@ var fml = (function (exports) {
|
|
|
11117
11140
|
this.#dialog.close(result);
|
|
11118
11141
|
}
|
|
11119
11142
|
});
|
|
11143
|
+
//dismissal, not an answer: the waiters are settled with null, as Escape does.
|
|
11144
|
+
//Optional because a subclass overriding the template owns what it renders
|
|
11145
|
+
fragment
|
|
11146
|
+
.querySelector('[data-ref=close]')
|
|
11147
|
+
?.addEventListener('click', () => this.#dialog.close(''));
|
|
11148
|
+
if (requiresAnswer) {
|
|
11149
|
+
//the platform's own dismissal, refused where the dialog must be
|
|
11150
|
+
//answered: cancel fires for Escape and for a close request the
|
|
11151
|
+
//browser makes on its own, and preventing it leaves the dialog open
|
|
11152
|
+
this.#dialog.addEventListener('cancel', (/** @type any */ e) => e.preventDefault());
|
|
11153
|
+
}
|
|
11120
11154
|
this.replaceChildren(fragment);
|
|
11121
11155
|
wireTargets();
|
|
11122
11156
|
}
|
|
@@ -11705,6 +11739,7 @@ var fml = (function (exports) {
|
|
|
11705
11739
|
'filters.boolean.false': 'No',
|
|
11706
11740
|
'info.tooltip': 'More information',
|
|
11707
11741
|
'dialog.acknowledge': 'Got it',
|
|
11742
|
+
'dialog.close': 'Close',
|
|
11708
11743
|
'drawer.close': 'Close',
|
|
11709
11744
|
'spinner.loading': 'Loading…',
|
|
11710
11745
|
'toast.region': 'Notifications',
|
|
@@ -11746,6 +11781,7 @@ var fml = (function (exports) {
|
|
|
11746
11781
|
'filters.boolean.false': 'No',
|
|
11747
11782
|
'info.tooltip': 'Maggiori informazioni',
|
|
11748
11783
|
'dialog.acknowledge': 'Ho capito',
|
|
11784
|
+
'dialog.close': 'Chiudi',
|
|
11749
11785
|
'drawer.close': 'Chiudi',
|
|
11750
11786
|
'spinner.loading': 'Caricamento…',
|
|
11751
11787
|
'toast.region': 'Notifiche',
|
|
@@ -11787,6 +11823,7 @@ var fml = (function (exports) {
|
|
|
11787
11823
|
'filters.boolean.false': 'No',
|
|
11788
11824
|
'info.tooltip': 'Más información',
|
|
11789
11825
|
'dialog.acknowledge': 'Entendido',
|
|
11826
|
+
'dialog.close': 'Cerrar',
|
|
11790
11827
|
'drawer.close': 'Cerrar',
|
|
11791
11828
|
'spinner.loading': 'Cargando…',
|
|
11792
11829
|
'toast.region': 'Notificaciones',
|
|
@@ -11831,6 +11868,7 @@ var fml = (function (exports) {
|
|
|
11831
11868
|
'filters.boolean.false': 'Non',
|
|
11832
11869
|
'info.tooltip': 'Plus d’informations',
|
|
11833
11870
|
'dialog.acknowledge': 'J’ai compris',
|
|
11871
|
+
'dialog.close': 'Fermer',
|
|
11834
11872
|
'drawer.close': 'Fermer',
|
|
11835
11873
|
'spinner.loading': 'Chargement…',
|
|
11836
11874
|
'toast.region': 'Notifications',
|