@optionfactory/fml 9.0.0-rc12 → 9.0.0-rc13

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/ful.iife.js CHANGED
@@ -2302,7 +2302,18 @@ var ful = (function (exports, index_mjs, index_mjs$1) {
2302
2302
  if (invoke) {
2303
2303
  //popovertarget needs a target that can be named
2304
2304
  popover.id = popover.id || uid;
2305
- invoker.setAttribute('popovertarget', popover.id);
2305
+ if (invoker.localName === 'button' || invoker.localName === 'input') {
2306
+ invoker.setAttribute('popovertarget', popover.id);
2307
+ } else {
2308
+ invoker.addEventListener('click', () => popover.togglePopover());
2309
+ invoker.addEventListener('keydown', (/** @type any */ evt) => {
2310
+ if (evt.key !== 'Enter' && evt.key !== ' ') {
2311
+ return;
2312
+ }
2313
+ evt.preventDefault();
2314
+ popover.togglePopover();
2315
+ });
2316
+ }
2306
2317
  }
2307
2318
  const anchor = `--${uid}`;
2308
2319
  invoker.style.anchorName = anchor;
@@ -2914,7 +2925,7 @@ var ful = (function (exports, index_mjs, index_mjs$1) {
2914
2925
  //the select's: a tooltip marker slotted into `info`, a button a page
2915
2926
  //put in an affix. Without this, reading the note beside a select
2916
2927
  //also stole the focus and dropped the dropdown over the note
2917
- const elsewhere = e.target.closest('button, a[href], input, select, textarea');
2928
+ const elsewhere = e.target.closest('button, [role="button"], a[href], input, select, textarea');
2918
2929
  if (elsewhere && elsewhere !== this.#input) {
2919
2930
  return;
2920
2931
  }
@@ -4845,7 +4856,6 @@ var ful = (function (exports, index_mjs, index_mjs$1) {
4845
4856
  */
4846
4857
  class InFilter extends Select {
4847
4858
  static attributes = ['operator'];
4848
- /** the selection as the array the wire takes, whether one key was chosen or many */
4849
4859
  #keys() {
4850
4860
  const chosen = super.value;
4851
4861
  if (this.multiple) {
@@ -4866,8 +4876,6 @@ var ful = (function (exports, index_mjs, index_mjs$1) {
4866
4876
  set value(v) {
4867
4877
  const operator = this.declared('operator');
4868
4878
  let keys = v === null || v === undefined ? [] : Array.isArray(v) ? v : [v];
4869
- //what the getter answers has to be assignable back, and it carries the
4870
- //operator in front of the keys
4871
4879
  if (operator && keys[0] === operator) {
4872
4880
  keys = keys.slice(1);
4873
4881
  }
@@ -5014,7 +5022,7 @@ var ful = (function (exports, index_mjs, index_mjs$1) {
5014
5022
  icon: 'info-circle-fill',
5015
5023
  };
5016
5024
  static template = `
5017
- <button type="button" class="ful-tip" data-ref="trigger" data-tpl-aria-label="#l10n:t('info.tooltip')"><ful-icon data-tpl-name="icon ?? config.icon" aria-hidden="true"></ful-icon></button>
5025
+ <span role="button" tabindex="0" class="ful-tip" data-ref="trigger" data-tpl-aria-label="#l10n:t('info.tooltip')"><ful-icon data-tpl-name="icon ?? config.icon" aria-hidden="true"></ful-icon></span>
5018
5026
  <ful-note popover data-ref="content">{{{{ slots.default }}}}</ful-note>
5019
5027
  `;
5020
5028
  render({ slots }) {
@@ -5123,10 +5131,18 @@ var ful = (function (exports, index_mjs, index_mjs$1) {
5123
5131
  this.dispatchEvent(new CustomEvent('close', { detail: outcome }));
5124
5132
  this.#settle(outcome);
5125
5133
  });
5134
+ let pressedOutside = false;
5135
+ this.#dialog.addEventListener('mousedown', (/** @type any */ e) => {
5136
+ pressedOutside = e.target === this.#dialog;
5137
+ });
5126
5138
  this.#dialog.addEventListener('click', (/** @type any */ e) => {
5127
5139
  const result = e.target.closest('button[data-result]')?.dataset.result;
5128
5140
  if (result !== undefined) {
5129
5141
  this.#dialog.close(result);
5142
+ return;
5143
+ }
5144
+ if (!requiresAnswer && pressedOutside && e.target === this.#dialog) {
5145
+ this.#dialog.close('');
5130
5146
  }
5131
5147
  });
5132
5148
  //dismissal, not an answer: the waiters are settled with a dismissal, as
@@ -5328,6 +5344,15 @@ var ful = (function (exports, index_mjs, index_mjs$1) {
5328
5344
  this.#dialog.setAttribute('placement', placement);
5329
5345
  }
5330
5346
  fragment.querySelector('[data-ref=close]').addEventListener('click', () => this.close());
5347
+ let pressedOutside = false;
5348
+ this.#dialog.addEventListener('mousedown', (e) => {
5349
+ pressedOutside = e.target === this.#dialog;
5350
+ });
5351
+ this.#dialog.addEventListener('click', (e) => {
5352
+ if (pressedOutside && e.target === this.#dialog) {
5353
+ this.close();
5354
+ }
5355
+ });
5331
5356
  this.#dialog.addEventListener('close', () => {
5332
5357
  this.dispatchEvent(
5333
5358
  new CustomEvent('close', { detail: this.#answer ?? { dismissed: true, response: null } }),