@everymatrix/general-registration 1.22.2 → 1.22.10

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.
@@ -113,7 +113,7 @@ class Lumo extends HTMLElement {
113
113
  }
114
114
 
115
115
  static get version() {
116
- return '24.2.3';
116
+ return '24.2.5';
117
117
  }
118
118
  }
119
119
 
@@ -9298,7 +9298,7 @@ const registered = new Set();
9298
9298
  const ElementMixin = (superClass) =>
9299
9299
  class VaadinElementMixin extends DirMixin(superClass) {
9300
9300
  static get version() {
9301
- return '24.2.3';
9301
+ return '24.2.5';
9302
9302
  }
9303
9303
 
9304
9304
  /** @protected */
@@ -12188,12 +12188,6 @@ const CheckedMixin = dedupingMixin(
12188
12188
  const input = event.target;
12189
12189
 
12190
12190
  this._toggleChecked(input.checked);
12191
-
12192
- // Clicking the checkbox or radio-button in Safari
12193
- // does not make it focused, so we do it manually.
12194
- if (!isElementFocused(input)) {
12195
- input.focus();
12196
- }
12197
12191
  }
12198
12192
 
12199
12193
  /** @protected */
@@ -12737,6 +12731,18 @@ const CheckboxMixin = (superclass) =>
12737
12731
  type: String,
12738
12732
  value: '',
12739
12733
  },
12734
+
12735
+ /**
12736
+ * Indicates whether the element can be focused and where it participates in sequential keyboard navigation.
12737
+ *
12738
+ * @override
12739
+ * @protected
12740
+ */
12741
+ tabindex: {
12742
+ type: Number,
12743
+ value: 0,
12744
+ reflectToAttribute: true,
12745
+ },
12740
12746
  };
12741
12747
  }
12742
12748
 
@@ -30130,6 +30136,9 @@ const GeneralRegistration = class {
30130
30136
  this.autofilled = true;
30131
30137
  }
30132
30138
  }
30139
+ addBtag() {
30140
+ this.addBtagValue();
30141
+ }
30133
30142
  checkInputsValidityHandler(event) {
30134
30143
  // Set isValid state of the input in the list.
30135
30144
  this.listOfInputValidity.find(input => input.name == event.detail.name).isValid = event.detail.valid;
@@ -30402,8 +30411,6 @@ const GeneralRegistration = class {
30402
30411
  return [inputElement];
30403
30412
  }
30404
30413
  });
30405
- if (this.btag)
30406
- this.addBtagValue();
30407
30414
  this.listOfInputValidity = this.listOfInputs.reduce((acc, field) => {
30408
30415
  var _a;
30409
30416
  // If the field is a togglecheckbox, add its subfields
@@ -30449,6 +30456,8 @@ const GeneralRegistration = class {
30449
30456
  }
30450
30457
  return acc;
30451
30458
  }, []);
30459
+ if (this.btag)
30460
+ this.addBtagValue();
30452
30461
  // Set the list of actions
30453
30462
  this.listOfActions = config.content.actions.map(action => action);
30454
30463
  this.registrationID = config.content.registrationID;
@@ -30498,6 +30507,10 @@ const GeneralRegistration = class {
30498
30507
  if (btagField) {
30499
30508
  btagField.defaultValue = this.btag;
30500
30509
  }
30510
+ const btagValue = this.listOfInputValues.find(input => input.name.toLowerCase() === 'btag');
30511
+ if (btagValue) {
30512
+ btagValue.value = this.btag;
30513
+ }
30501
30514
  }
30502
30515
  addTranslation(field) {
30503
30516
  if (TRANSLATIONS[this.language][field.name]) {
@@ -30554,7 +30567,8 @@ const GeneralRegistration = class {
30554
30567
  get host() { return index.getElement(this); }
30555
30568
  static get watchers() { return {
30556
30569
  "registrationStep": ["sendStep"],
30557
- "forms": ["setFormValidity"]
30570
+ "forms": ["setFormValidity"],
30571
+ "btag": ["addBtag"]
30558
30572
  }; }
30559
30573
  };
30560
30574
  GeneralRegistration.style = generalRegistrationCss;
@@ -33329,7 +33343,9 @@ class IronListAdapter {
33329
33343
  this.__preventElementUpdates = false;
33330
33344
  } else {
33331
33345
  // Already initialized, just update _virtualCount
33346
+ this._updateScrollerSize();
33332
33347
  this._virtualCount = this.items.length;
33348
+ this._render();
33333
33349
  }
33334
33350
 
33335
33351
  // When reducing size while invisible, iron-list does not update items, so
@@ -34878,6 +34894,14 @@ const ComboBoxMixin = (subclass) =>
34878
34894
  observer: '_toggleElementChanged',
34879
34895
  },
34880
34896
 
34897
+ /**
34898
+ * Set of items to be rendered in the dropdown.
34899
+ * @protected
34900
+ */
34901
+ _dropdownItems: {
34902
+ type: Array,
34903
+ },
34904
+
34881
34905
  /** @private */
34882
34906
  _closeOnBlurIsPrevented: Boolean,
34883
34907
 
@@ -34895,8 +34919,8 @@ const ComboBoxMixin = (subclass) =>
34895
34919
  static get observers() {
34896
34920
  return [
34897
34921
  '_selectedItemChanged(selectedItem, itemValuePath, itemLabelPath)',
34898
- '_openedOrItemsChanged(opened, filteredItems, loading)',
34899
- '_updateScroller(_scroller, filteredItems, opened, loading, selectedItem, itemIdPath, _focusedIndex, renderer, theme)',
34922
+ '_openedOrItemsChanged(opened, _dropdownItems, loading)',
34923
+ '_updateScroller(_scroller, _dropdownItems, opened, loading, selectedItem, itemIdPath, _focusedIndex, renderer, theme)',
34900
34924
  ];
34901
34925
  }
34902
34926
 
@@ -35135,7 +35159,7 @@ const ComboBoxMixin = (subclass) =>
35135
35159
  this.dispatchEvent(new CustomEvent('vaadin-combo-box-dropdown-opened', { bubbles: true, composed: true }));
35136
35160
 
35137
35161
  this._onOpened();
35138
- } else if (wasOpened && this.filteredItems && this.filteredItems.length) {
35162
+ } else if (wasOpened && this._dropdownItems && this._dropdownItems.length) {
35139
35163
  this.close();
35140
35164
 
35141
35165
  this.dispatchEvent(new CustomEvent('vaadin-combo-box-dropdown-closed', { bubbles: true, composed: true }));
@@ -35325,7 +35349,7 @@ const ComboBoxMixin = (subclass) =>
35325
35349
  /** @private */
35326
35350
  _onArrowDown() {
35327
35351
  if (this.opened) {
35328
- const items = this.filteredItems;
35352
+ const items = this._dropdownItems;
35329
35353
  if (items) {
35330
35354
  this._focusedIndex = Math.min(items.length - 1, this._focusedIndex + 1);
35331
35355
  this._prefillFocusedItemLabel();
@@ -35341,7 +35365,7 @@ const ComboBoxMixin = (subclass) =>
35341
35365
  if (this._focusedIndex > -1) {
35342
35366
  this._focusedIndex = Math.max(0, this._focusedIndex - 1);
35343
35367
  } else {
35344
- const items = this.filteredItems;
35368
+ const items = this._dropdownItems;
35345
35369
  if (items) {
35346
35370
  this._focusedIndex = items.length - 1;
35347
35371
  }
@@ -35356,7 +35380,7 @@ const ComboBoxMixin = (subclass) =>
35356
35380
  /** @private */
35357
35381
  _prefillFocusedItemLabel() {
35358
35382
  if (this._focusedIndex > -1) {
35359
- const focusedItem = this.filteredItems[this._focusedIndex];
35383
+ const focusedItem = this._dropdownItems[this._focusedIndex];
35360
35384
  this._inputElementValue = this._getItemLabel(focusedItem);
35361
35385
  this._markAllSelectionRange();
35362
35386
  }
@@ -35529,7 +35553,7 @@ const ComboBoxMixin = (subclass) =>
35529
35553
  /** @private */
35530
35554
  _commitValue() {
35531
35555
  if (this._focusedIndex > -1) {
35532
- const focusedItem = this.filteredItems[this._focusedIndex];
35556
+ const focusedItem = this._dropdownItems[this._focusedIndex];
35533
35557
  if (this.selectedItem !== focusedItem) {
35534
35558
  this.selectedItem = focusedItem;
35535
35559
  }
@@ -35544,7 +35568,7 @@ const ComboBoxMixin = (subclass) =>
35544
35568
  }
35545
35569
  } else {
35546
35570
  // Try to find an item which label matches the input value.
35547
- const items = [this.selectedItem, ...(this.filteredItems || [])];
35571
+ const items = [this.selectedItem, ...(this._dropdownItems || [])];
35548
35572
  const itemMatchingInputValue = items[this.__getItemIndexByLabel(items, this._inputElementValue)];
35549
35573
 
35550
35574
  if (
@@ -35759,6 +35783,8 @@ const ComboBoxMixin = (subclass) =>
35759
35783
 
35760
35784
  /** @private */
35761
35785
  _filteredItemsChanged(filteredItems, oldFilteredItems) {
35786
+ this._setDropdownItems(filteredItems);
35787
+
35762
35788
  // Store the currently focused item if any. The focused index preserves
35763
35789
  // in the case when more filtered items are loading but it is reset
35764
35790
  // when the user types in a filter query.
@@ -35819,6 +35845,16 @@ const ComboBoxMixin = (subclass) =>
35819
35845
  }
35820
35846
  }
35821
35847
 
35848
+ /**
35849
+ * Provide items to be rendered in the dropdown.
35850
+ * Override this method to show custom items.
35851
+ *
35852
+ * @protected
35853
+ */
35854
+ _setDropdownItems(items) {
35855
+ this._dropdownItems = items;
35856
+ }
35857
+
35822
35858
  /** @private */
35823
35859
  _getItemElements() {
35824
35860
  return Array.from(this._scroller.querySelectorAll(`${this._tagNamePrefix}-item`));
@@ -8,7 +8,7 @@ function safeDecorator(fn) {
8
8
  }
9
9
  catch (error) {
10
10
  if (error instanceof DOMException &&
11
- error.message.includes('has already been used with this registry')) {
11
+ error.message.includes('has already been used with this registry') || error.message.includes('Cannot define multiple custom elements with the same tag name')) {
12
12
  return false;
13
13
  }
14
14
  throw error;
@@ -68,6 +68,9 @@ export class GeneralRegistration {
68
68
  this.autofilled = true;
69
69
  }
70
70
  }
71
+ addBtag() {
72
+ this.addBtagValue();
73
+ }
71
74
  checkInputsValidityHandler(event) {
72
75
  // Set isValid state of the input in the list.
73
76
  this.listOfInputValidity.find(input => input.name == event.detail.name).isValid = event.detail.valid;
@@ -340,8 +343,6 @@ export class GeneralRegistration {
340
343
  return [inputElement];
341
344
  }
342
345
  });
343
- if (this.btag)
344
- this.addBtagValue();
345
346
  this.listOfInputValidity = this.listOfInputs.reduce((acc, field) => {
346
347
  var _a;
347
348
  // If the field is a togglecheckbox, add its subfields
@@ -387,6 +388,8 @@ export class GeneralRegistration {
387
388
  }
388
389
  return acc;
389
390
  }, []);
391
+ if (this.btag)
392
+ this.addBtagValue();
390
393
  // Set the list of actions
391
394
  this.listOfActions = config.content.actions.map(action => action);
392
395
  this.registrationID = config.content.registrationID;
@@ -437,6 +440,10 @@ export class GeneralRegistration {
437
440
  if (btagField) {
438
441
  btagField.defaultValue = this.btag;
439
442
  }
443
+ const btagValue = this.listOfInputValues.find(input => input.name.toLowerCase() === 'btag');
444
+ if (btagValue) {
445
+ btagValue.value = this.btag;
446
+ }
440
447
  }
441
448
  addTranslation(field) {
442
449
  if (TRANSLATIONS[this.language][field.name]) {
@@ -699,6 +706,9 @@ export class GeneralRegistration {
699
706
  }, {
700
707
  "propName": "forms",
701
708
  "methodName": "setFormValidity"
709
+ }, {
710
+ "propName": "btag",
711
+ "methodName": "addBtag"
702
712
  }]; }
703
713
  static get listeners() { return [{
704
714
  "name": "sendValidityState",
@@ -6,7 +6,7 @@ function safeDecorator(fn) {
6
6
  }
7
7
  catch (error) {
8
8
  if (error instanceof DOMException &&
9
- error.message.includes('has already been used with this registry')) {
9
+ error.message.includes('has already been used with this registry') || error.message.includes('Cannot define multiple custom elements with the same tag name')) {
10
10
  return false;
11
11
  }
12
12
  throw error;
@@ -1,4 +1,4 @@
1
- import { n as microTask, a as DisabledMixin, K as KeyboardMixin } from './field-mixin.js';
1
+ import { m as microTask, a as DisabledMixin, K as KeyboardMixin } from './field-mixin.js';
2
2
 
3
3
  /**
4
4
  @license
@@ -1,6 +1,6 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
2
  import { t as translate, a as tooltipIconSvg } from './tooltipIcon.js';
3
- import { r as registerStyles, i, d as dedupingMixin, D as DelegateStateMixin, a as DisabledMixin, I as InputMixin, b as isElementFocused, L as LabelMixin, c as DelegateFocusMixin, e as InputController, f as LabelledInputController, h as html, T as TooltipController, g as defineCustomElement$1, E as ElementMixin, j as ThemableMixin, P as PolymerElement, k as requiredField, l as helper, F as FieldMixin, m as FocusMixin, S as SlotObserver } from './field-mixin.js';
3
+ import { r as registerStyles, i, d as dedupingMixin, D as DelegateStateMixin, a as DisabledMixin, I as InputMixin, L as LabelMixin, b as DelegateFocusMixin, c as InputController, e as LabelledInputController, h as html, T as TooltipController, f as defineCustomElement$1, E as ElementMixin, g as ThemableMixin, P as PolymerElement, j as requiredField, k as helper, F as FieldMixin, l as FocusMixin, S as SlotObserver } from './field-mixin.js';
4
4
  import { A as ActiveMixin } from './active-mixin.js';
5
5
 
6
6
  registerStyles(
@@ -206,12 +206,6 @@ const CheckedMixin = dedupingMixin(
206
206
  const input = event.target;
207
207
 
208
208
  this._toggleChecked(input.checked);
209
-
210
- // Clicking the checkbox or radio-button in Safari
211
- // does not make it focused, so we do it manually.
212
- if (!isElementFocused(input)) {
213
- input.focus();
214
- }
215
209
  }
216
210
 
217
211
  /** @protected */
@@ -265,6 +259,18 @@ const CheckboxMixin = (superclass) =>
265
259
  type: String,
266
260
  value: '',
267
261
  },
262
+
263
+ /**
264
+ * Indicates whether the element can be focused and where it participates in sequential keyboard navigation.
265
+ *
266
+ * @override
267
+ * @protected
268
+ */
269
+ tabindex: {
270
+ type: Number,
271
+ value: 0,
272
+ reflectToAttribute: true,
273
+ },
268
274
  };
269
275
  }
270
276
 
@@ -1,7 +1,7 @@
1
1
  import { proxyCustomElement, HTMLElement as HTMLElement$1, createEvent, h } from '@stencil/core/internal/client';
2
2
  import { t as translate$1, a as tooltipIconSvg } from './tooltipIcon.js';
3
3
  import { i as inputFieldShared, a as isFirefox, I as InputConstraintsMixin, b as isIOS, c as InputControlMixin, d as inputFieldShared$1 } from './input-field-shared-styles.js';
4
- import { i, r as registerStyles, h as html, g as defineCustomElement$1, o as DirMixin, j as ThemableMixin, P as PolymerElement, p as Debouncer$1, t as timeOut, q as generateUniqueId, d as dedupingMixin, s as PropertyEffects, w as wrap, u as strictTemplatePolicy, v as legacyWarnings, x as legacyOptimizations, y as useShadow, z as suppressTemplateNotifications, A as timeOut$1, B as microTask, C as matches, G as translate, m as FocusMixin, H as SlotController, J as ControllerMixin, c as DelegateFocusMixin, K as KeyboardMixin, e as InputController, f as LabelledInputController, T as TooltipController, E as ElementMixin } from './field-mixin.js';
4
+ import { i, r as registerStyles, h as html, f as defineCustomElement$1, n as DirMixin, g as ThemableMixin, P as PolymerElement, o as Debouncer$1, t as timeOut, p as generateUniqueId, d as dedupingMixin, q as PropertyEffects, w as wrap, s as strictTemplatePolicy, u as legacyWarnings, v as legacyOptimizations, x as useShadow, y as suppressTemplateNotifications, z as timeOut$1, A as microTask, B as matches, C as translate, l as FocusMixin, G as SlotController, H as ControllerMixin, b as DelegateFocusMixin, K as KeyboardMixin, c as InputController, e as LabelledInputController, T as TooltipController, E as ElementMixin } from './field-mixin.js';
5
5
  import { m as menuOverlay, P as PositionMixin, O as OverlayMixin, o as overlayStyles, a as afterNextRender, b as OverlayClassMixin, V as VirtualKeyboardController, h as hideOthers } from './virtual-keyboard-controller.js';
6
6
  import './vaadin-button.js';
7
7
  import { a as addListener, s as setTouchAction } from './active-mixin.js';
@@ -38,7 +38,7 @@ class Lumo extends HTMLElement {
38
38
  }
39
39
 
40
40
  static get version() {
41
- return '24.2.3';
41
+ return '24.2.5';
42
42
  }
43
43
  }
44
44
 
@@ -9065,7 +9065,7 @@ const registered = new Set();
9065
9065
  const ElementMixin = (superClass) =>
9066
9066
  class VaadinElementMixin extends DirMixin(superClass) {
9067
9067
  static get version() {
9068
- return '24.2.3';
9068
+ return '24.2.5';
9069
9069
  }
9070
9070
 
9071
9071
  /** @protected */
@@ -12423,4 +12423,4 @@ const FieldMixin = (superclass) =>
12423
12423
  }
12424
12424
  };
12425
12425
 
12426
- export { timeOut$1 as A, microTask$1 as B, matches as C, DelegateStateMixin as D, ElementMixin as E, FieldMixin as F, translate as G, SlotController as H, InputMixin as I, ControllerMixin as J, KeyboardMixin as K, LabelMixin as L, getDeepActiveElement as M, getFocusableElements as N, getAncestorRootNodes as O, PolymerElement as P, TabindexMixin as Q, idlePeriod as R, SlotObserver as S, TooltipController as T, animationFrame as U, ValidateMixin as V, flush as W, enqueueDebouncer as X, DisabledMixin as a, isElementFocused as b, DelegateFocusMixin as c, dedupingMixin as d, InputController as e, LabelledInputController as f, defineCustomElement as g, html as h, i$1 as i, ThemableMixin as j, requiredField as k, helper as l, FocusMixin as m, microTask as n, DirMixin as o, Debouncer as p, generateUniqueId as q, registerStyles as r, PropertyEffects as s, timeOut as t, strictTemplatePolicy as u, legacyWarnings as v, wrap as w, legacyOptimizations as x, useShadow as y, suppressTemplateNotifications as z };
12426
+ export { microTask$1 as A, matches as B, translate as C, DelegateStateMixin as D, ElementMixin as E, FieldMixin as F, SlotController as G, ControllerMixin as H, InputMixin as I, getDeepActiveElement as J, KeyboardMixin as K, LabelMixin as L, getFocusableElements as M, isElementFocused as N, getAncestorRootNodes as O, PolymerElement as P, TabindexMixin as Q, idlePeriod as R, SlotObserver as S, TooltipController as T, animationFrame as U, ValidateMixin as V, flush as W, enqueueDebouncer as X, DisabledMixin as a, DelegateFocusMixin as b, InputController as c, dedupingMixin as d, LabelledInputController as e, defineCustomElement as f, ThemableMixin as g, html as h, i$1 as i, requiredField as j, helper as k, FocusMixin as l, microTask as m, DirMixin as n, Debouncer as o, generateUniqueId as p, PropertyEffects as q, registerStyles as r, strictTemplatePolicy as s, timeOut as t, legacyWarnings as u, legacyOptimizations as v, wrap as w, useShadow as x, suppressTemplateNotifications as y, timeOut$1 as z };
@@ -141,6 +141,9 @@ const GeneralRegistration$1 = /*@__PURE__*/ proxyCustomElement(class extends HTM
141
141
  this.autofilled = true;
142
142
  }
143
143
  }
144
+ addBtag() {
145
+ this.addBtagValue();
146
+ }
144
147
  checkInputsValidityHandler(event) {
145
148
  // Set isValid state of the input in the list.
146
149
  this.listOfInputValidity.find(input => input.name == event.detail.name).isValid = event.detail.valid;
@@ -413,8 +416,6 @@ const GeneralRegistration$1 = /*@__PURE__*/ proxyCustomElement(class extends HTM
413
416
  return [inputElement];
414
417
  }
415
418
  });
416
- if (this.btag)
417
- this.addBtagValue();
418
419
  this.listOfInputValidity = this.listOfInputs.reduce((acc, field) => {
419
420
  var _a;
420
421
  // If the field is a togglecheckbox, add its subfields
@@ -460,6 +461,8 @@ const GeneralRegistration$1 = /*@__PURE__*/ proxyCustomElement(class extends HTM
460
461
  }
461
462
  return acc;
462
463
  }, []);
464
+ if (this.btag)
465
+ this.addBtagValue();
463
466
  // Set the list of actions
464
467
  this.listOfActions = config.content.actions.map(action => action);
465
468
  this.registrationID = config.content.registrationID;
@@ -509,6 +512,10 @@ const GeneralRegistration$1 = /*@__PURE__*/ proxyCustomElement(class extends HTM
509
512
  if (btagField) {
510
513
  btagField.defaultValue = this.btag;
511
514
  }
515
+ const btagValue = this.listOfInputValues.find(input => input.name.toLowerCase() === 'btag');
516
+ if (btagValue) {
517
+ btagValue.value = this.btag;
518
+ }
512
519
  }
513
520
  addTranslation(field) {
514
521
  if (TRANSLATIONS[this.language][field.name]) {
@@ -565,7 +572,8 @@ const GeneralRegistration$1 = /*@__PURE__*/ proxyCustomElement(class extends HTM
565
572
  get host() { return this; }
566
573
  static get watchers() { return {
567
574
  "registrationStep": ["sendStep"],
568
- "forms": ["setFormValidity"]
575
+ "forms": ["setFormValidity"],
576
+ "btag": ["addBtag"]
569
577
  }; }
570
578
  static get style() { return generalRegistrationCss; }
571
579
  }, [1, "general-registration", {
@@ -8,7 +8,7 @@ function safeDecorator(fn) {
8
8
  }
9
9
  catch (error) {
10
10
  if (error instanceof DOMException &&
11
- error.message.includes('has already been used with this registry')) {
11
+ error.message.includes('has already been used with this registry') || error.message.includes('Cannot define multiple custom elements with the same tag name')) {
12
12
  return false;
13
13
  }
14
14
  throw error;
@@ -1,4 +1,4 @@
1
- import { r as registerStyles, i, g as defineCustomElement, j as ThemableMixin, o as DirMixin, P as PolymerElement, h as html, k as requiredField, l as helper, d as dedupingMixin, I as InputMixin, K as KeyboardMixin, D as DelegateStateMixin, V as ValidateMixin, c as DelegateFocusMixin, F as FieldMixin, p as Debouncer, t as timeOut } from './field-mixin.js';
1
+ import { r as registerStyles, i, f as defineCustomElement, g as ThemableMixin, n as DirMixin, P as PolymerElement, h as html, j as requiredField, k as helper, d as dedupingMixin, I as InputMixin, K as KeyboardMixin, D as DelegateStateMixin, V as ValidateMixin, b as DelegateFocusMixin, F as FieldMixin, o as Debouncer, t as timeOut } from './field-mixin.js';
2
2
 
3
3
  registerStyles(
4
4
  'vaadin-input-container',
@@ -1,7 +1,7 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
2
  import { t as translate, a as tooltipIconSvg } from './tooltipIcon.js';
3
3
  import { i as inputFieldShared, c as InputControlMixin, d as inputFieldShared$1 } from './input-field-shared-styles.js';
4
- import { r as registerStyles, e as InputController, f as LabelledInputController, h as html, T as TooltipController, g as defineCustomElement$1, j as ThemableMixin, E as ElementMixin, P as PolymerElement, i, H as SlotController } from './field-mixin.js';
4
+ import { r as registerStyles, c as InputController, e as LabelledInputController, h as html, T as TooltipController, f as defineCustomElement$1, g as ThemableMixin, E as ElementMixin, P as PolymerElement, i, G as SlotController } from './field-mixin.js';
5
5
  import { b as button, B as Button } from './vaadin-button.js';
6
6
 
7
7
  /**
@@ -1,4 +1,4 @@
1
- import { i, r as registerStyles, Q as TabindexMixin, m as FocusMixin, E as ElementMixin, j as ThemableMixin, J as ControllerMixin, P as PolymerElement, T as TooltipController, g as defineCustomElement, h as html } from './field-mixin.js';
1
+ import { i, r as registerStyles, Q as TabindexMixin, l as FocusMixin, E as ElementMixin, g as ThemableMixin, H as ControllerMixin, P as PolymerElement, T as TooltipController, f as defineCustomElement, h as html } from './field-mixin.js';
2
2
  import { A as ActiveMixin } from './active-mixin.js';
3
3
 
4
4
  const button = i`
@@ -1,4 +1,4 @@
1
- import { i, r as registerStyles, g as defineCustomElement, h as html, j as ThemableMixin, o as DirMixin, P as PolymerElement, n as microTask, R as idlePeriod, U as animationFrame, W as flush, p as Debouncer, X as enqueueDebouncer, t as timeOut, q as generateUniqueId, J as ControllerMixin, V as ValidateMixin, m as FocusMixin, K as KeyboardMixin, I as InputMixin, a as DisabledMixin, b as isElementFocused, e as InputController, f as LabelledInputController, T as TooltipController, E as ElementMixin } from './field-mixin.js';
1
+ import { i, r as registerStyles, f as defineCustomElement, h as html, g as ThemableMixin, n as DirMixin, P as PolymerElement, m as microTask, R as idlePeriod, U as animationFrame, W as flush, o as Debouncer, X as enqueueDebouncer, t as timeOut, p as generateUniqueId, H as ControllerMixin, V as ValidateMixin, l as FocusMixin, K as KeyboardMixin, I as InputMixin, a as DisabledMixin, N as isElementFocused, c as InputController, e as LabelledInputController, T as TooltipController, E as ElementMixin } from './field-mixin.js';
2
2
  import { c as overlay, d as menuOverlayCore, P as PositionMixin, O as OverlayMixin, o as overlayStyles, b as OverlayClassMixin, V as VirtualKeyboardController } from './virtual-keyboard-controller.js';
3
3
  import { i as inputFieldShared, e as isSafari, I as InputConstraintsMixin, f as isTouch, c as InputControlMixin, d as inputFieldShared$1 } from './input-field-shared-styles.js';
4
4
 
@@ -1566,7 +1566,9 @@ class IronListAdapter {
1566
1566
  this.__preventElementUpdates = false;
1567
1567
  } else {
1568
1568
  // Already initialized, just update _virtualCount
1569
+ this._updateScrollerSize();
1569
1570
  this._virtualCount = this.items.length;
1571
+ this._render();
1570
1572
  }
1571
1573
 
1572
1574
  // When reducing size while invisible, iron-list does not update items, so
@@ -3115,6 +3117,14 @@ const ComboBoxMixin = (subclass) =>
3115
3117
  observer: '_toggleElementChanged',
3116
3118
  },
3117
3119
 
3120
+ /**
3121
+ * Set of items to be rendered in the dropdown.
3122
+ * @protected
3123
+ */
3124
+ _dropdownItems: {
3125
+ type: Array,
3126
+ },
3127
+
3118
3128
  /** @private */
3119
3129
  _closeOnBlurIsPrevented: Boolean,
3120
3130
 
@@ -3132,8 +3142,8 @@ const ComboBoxMixin = (subclass) =>
3132
3142
  static get observers() {
3133
3143
  return [
3134
3144
  '_selectedItemChanged(selectedItem, itemValuePath, itemLabelPath)',
3135
- '_openedOrItemsChanged(opened, filteredItems, loading)',
3136
- '_updateScroller(_scroller, filteredItems, opened, loading, selectedItem, itemIdPath, _focusedIndex, renderer, theme)',
3145
+ '_openedOrItemsChanged(opened, _dropdownItems, loading)',
3146
+ '_updateScroller(_scroller, _dropdownItems, opened, loading, selectedItem, itemIdPath, _focusedIndex, renderer, theme)',
3137
3147
  ];
3138
3148
  }
3139
3149
 
@@ -3372,7 +3382,7 @@ const ComboBoxMixin = (subclass) =>
3372
3382
  this.dispatchEvent(new CustomEvent('vaadin-combo-box-dropdown-opened', { bubbles: true, composed: true }));
3373
3383
 
3374
3384
  this._onOpened();
3375
- } else if (wasOpened && this.filteredItems && this.filteredItems.length) {
3385
+ } else if (wasOpened && this._dropdownItems && this._dropdownItems.length) {
3376
3386
  this.close();
3377
3387
 
3378
3388
  this.dispatchEvent(new CustomEvent('vaadin-combo-box-dropdown-closed', { bubbles: true, composed: true }));
@@ -3562,7 +3572,7 @@ const ComboBoxMixin = (subclass) =>
3562
3572
  /** @private */
3563
3573
  _onArrowDown() {
3564
3574
  if (this.opened) {
3565
- const items = this.filteredItems;
3575
+ const items = this._dropdownItems;
3566
3576
  if (items) {
3567
3577
  this._focusedIndex = Math.min(items.length - 1, this._focusedIndex + 1);
3568
3578
  this._prefillFocusedItemLabel();
@@ -3578,7 +3588,7 @@ const ComboBoxMixin = (subclass) =>
3578
3588
  if (this._focusedIndex > -1) {
3579
3589
  this._focusedIndex = Math.max(0, this._focusedIndex - 1);
3580
3590
  } else {
3581
- const items = this.filteredItems;
3591
+ const items = this._dropdownItems;
3582
3592
  if (items) {
3583
3593
  this._focusedIndex = items.length - 1;
3584
3594
  }
@@ -3593,7 +3603,7 @@ const ComboBoxMixin = (subclass) =>
3593
3603
  /** @private */
3594
3604
  _prefillFocusedItemLabel() {
3595
3605
  if (this._focusedIndex > -1) {
3596
- const focusedItem = this.filteredItems[this._focusedIndex];
3606
+ const focusedItem = this._dropdownItems[this._focusedIndex];
3597
3607
  this._inputElementValue = this._getItemLabel(focusedItem);
3598
3608
  this._markAllSelectionRange();
3599
3609
  }
@@ -3766,7 +3776,7 @@ const ComboBoxMixin = (subclass) =>
3766
3776
  /** @private */
3767
3777
  _commitValue() {
3768
3778
  if (this._focusedIndex > -1) {
3769
- const focusedItem = this.filteredItems[this._focusedIndex];
3779
+ const focusedItem = this._dropdownItems[this._focusedIndex];
3770
3780
  if (this.selectedItem !== focusedItem) {
3771
3781
  this.selectedItem = focusedItem;
3772
3782
  }
@@ -3781,7 +3791,7 @@ const ComboBoxMixin = (subclass) =>
3781
3791
  }
3782
3792
  } else {
3783
3793
  // Try to find an item which label matches the input value.
3784
- const items = [this.selectedItem, ...(this.filteredItems || [])];
3794
+ const items = [this.selectedItem, ...(this._dropdownItems || [])];
3785
3795
  const itemMatchingInputValue = items[this.__getItemIndexByLabel(items, this._inputElementValue)];
3786
3796
 
3787
3797
  if (
@@ -3996,6 +4006,8 @@ const ComboBoxMixin = (subclass) =>
3996
4006
 
3997
4007
  /** @private */
3998
4008
  _filteredItemsChanged(filteredItems, oldFilteredItems) {
4009
+ this._setDropdownItems(filteredItems);
4010
+
3999
4011
  // Store the currently focused item if any. The focused index preserves
4000
4012
  // in the case when more filtered items are loading but it is reset
4001
4013
  // when the user types in a filter query.
@@ -4056,6 +4068,16 @@ const ComboBoxMixin = (subclass) =>
4056
4068
  }
4057
4069
  }
4058
4070
 
4071
+ /**
4072
+ * Provide items to be rendered in the dropdown.
4073
+ * Override this method to show custom items.
4074
+ *
4075
+ * @protected
4076
+ */
4077
+ _setDropdownItems(items) {
4078
+ this._dropdownItems = items;
4079
+ }
4080
+
4059
4081
  /** @private */
4060
4082
  _getItemElements() {
4061
4083
  return Array.from(this._scroller.querySelectorAll(`${this._tagNamePrefix}-item`));
@@ -1,4 +1,4 @@
1
- import { i, r as registerStyles, M as getDeepActiveElement, N as getFocusableElements, b as isElementFocused, J as ControllerMixin, O as getAncestorRootNodes } from './field-mixin.js';
1
+ import { i, r as registerStyles, J as getDeepActiveElement, M as getFocusableElements, N as isElementFocused, H as ControllerMixin, O as getAncestorRootNodes } from './field-mixin.js';
2
2
  import { b as isIOS } from './input-field-shared-styles.js';
3
3
 
4
4
  /**