@everymatrix/helper-filters 0.1.5 → 0.1.20

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.
@@ -1,5 +1,5 @@
1
1
  import { proxyCustomElement, HTMLElement as HTMLElement$1, createEvent, h as h$2 } from '@stencil/core/internal/client';
2
- import '@everymatrix/helper-modal';
2
+ import { d as defineCustomElement$2 } from './helper-modal2.js';
3
3
 
4
4
  const DEFAULT_LANGUAGE = 'en';
5
5
  const SUPPORTED_LANGUAGES = ['ro', 'en'];
@@ -41,7 +41,7 @@ const translate$1 = (key, customLang) => {
41
41
  */
42
42
  class Lumo extends HTMLElement {
43
43
  static get version() {
44
- return '23.2.0';
44
+ return '23.1.5';
45
45
  }
46
46
  }
47
47
 
@@ -97,7 +97,7 @@ const ThemePropertyMixin = (superClass) =>
97
97
  * **NOTE:** Extending the mixin only provides the property for binding,
98
98
  * and does not make the propagation alone.
99
99
  *
100
- * See [Styling Components: Sub-components](https://vaadin.com/docs/latest/styling/custom-theme/styling-components/#sub-components).
100
+ * See [Styling Components: Sub-components](https://vaadin.com/docs/latest/ds/customization/styling-components/#sub-components).
101
101
  * page for more information.
102
102
  *
103
103
  * @deprecated The `theme` property is not supposed for public use and will be dropped in Vaadin 24.
@@ -122,7 +122,7 @@ const ThemePropertyMixin = (superClass) =>
122
122
  * **NOTE:** Extending the mixin only provides the property for binding,
123
123
  * and does not make the propagation alone.
124
124
  *
125
- * See [Styling Components: Sub-components](https://vaadin.com/docs/latest/styling/custom-theme/styling-components/#sub-components).
125
+ * See [Styling Components: Sub-components](https://vaadin.com/docs/latest/ds/customization/styling-components/#sub-components).
126
126
  * page for more information.
127
127
  *
128
128
  * @protected
@@ -227,9 +227,9 @@ function matchesThemeFor(themeFor, tagName) {
227
227
  */
228
228
  function getIncludePriority(moduleName = '') {
229
229
  let includePriority = 0;
230
- if (moduleName.startsWith('lumo-') || moduleName.startsWith('material-')) {
230
+ if (moduleName.indexOf('lumo-') === 0 || moduleName.indexOf('material-') === 0) {
231
231
  includePriority = 1;
232
- } else if (moduleName.startsWith('vaadin-')) {
232
+ } else if (moduleName.indexOf('vaadin-') === 0) {
233
233
  includePriority = 2;
234
234
  }
235
235
  return includePriority;
@@ -10114,38 +10114,6 @@ const ControllerMixin = dedupingMixin(
10114
10114
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
10115
10115
  */
10116
10116
 
10117
- // We consider the keyboard to be active if the window has received a keydown
10118
- // event since the last mousedown event.
10119
- let keyboardActive = false;
10120
-
10121
- // Listen for top-level keydown and mousedown events.
10122
- // Use capture phase so we detect events even if they're handled.
10123
- window.addEventListener(
10124
- 'keydown',
10125
- () => {
10126
- keyboardActive = true;
10127
- },
10128
- { capture: true },
10129
- );
10130
-
10131
- window.addEventListener(
10132
- 'mousedown',
10133
- () => {
10134
- keyboardActive = false;
10135
- },
10136
- { capture: true },
10137
- );
10138
-
10139
- /**
10140
- * Returns true if the window has received a keydown
10141
- * event since the last mousedown event.
10142
- *
10143
- * @return {boolean}
10144
- */
10145
- function isKeyboardActive() {
10146
- return keyboardActive;
10147
- }
10148
-
10149
10117
  /**
10150
10118
  * Returns true if the element is hidden directly with `display: none` or `visibility: hidden`,
10151
10119
  * false otherwise.
@@ -10586,7 +10554,7 @@ class FocusTrapController {
10586
10554
  * ---|---|---
10587
10555
  * `--vaadin-overlay-viewport-bottom` | Bottom offset of the visible viewport area | `0` or detected offset
10588
10556
  *
10589
- * See [Styling Components](https://vaadin.com/docs/latest/styling/custom-theme/styling-components) documentation.
10557
+ * See [Styling Components](https://vaadin.com/docs/latest/ds/customization/styling-components) documentation.
10590
10558
  *
10591
10559
  * @fires {CustomEvent} opened-changed - Fired when the `opened` property changes.
10592
10560
  * @fires {CustomEvent} vaadin-overlay-open - Fired after the overlay is opened.
@@ -12856,7 +12824,7 @@ const registered = new Set();
12856
12824
  const ElementMixin = (superClass) =>
12857
12825
  class VaadinElementMixin extends DirMixin(superClass) {
12858
12826
  static get version() {
12859
- return '23.2.0';
12827
+ return '23.1.5';
12860
12828
  }
12861
12829
 
12862
12830
  /** @protected */
@@ -13154,7 +13122,7 @@ function _handleNative(ev) {
13154
13122
  }
13155
13123
  if (!ev[HANDLED_OBJ]) {
13156
13124
  ev[HANDLED_OBJ] = {};
13157
- if (type.startsWith('touch')) {
13125
+ if (type.slice(0, 5) === 'touch') {
13158
13126
  const t = ev.changedTouches[0];
13159
13127
  if (type === 'touchstart') {
13160
13128
  // Only handle the first finger
@@ -14013,6 +13981,28 @@ const ActiveMixin = (superclass) =>
14013
13981
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
14014
13982
  */
14015
13983
 
13984
+ // We consider the keyboard to be active if the window has received a keydown
13985
+ // event since the last mousedown event.
13986
+ let keyboardActive = false;
13987
+
13988
+ // Listen for top-level keydown and mousedown events.
13989
+ // Use capture phase so we detect events even if they're handled.
13990
+ window.addEventListener(
13991
+ 'keydown',
13992
+ () => {
13993
+ keyboardActive = true;
13994
+ },
13995
+ { capture: true },
13996
+ );
13997
+
13998
+ window.addEventListener(
13999
+ 'mousedown',
14000
+ () => {
14001
+ keyboardActive = false;
14002
+ },
14003
+ { capture: true },
14004
+ );
14005
+
14016
14006
  /**
14017
14007
  * A mixin to handle `focused` and `focus-ring` attributes based on focus.
14018
14008
  *
@@ -14026,7 +14016,7 @@ const FocusMixin = dedupingMixin(
14026
14016
  * @return {boolean}
14027
14017
  */
14028
14018
  get _keyboardActive() {
14029
- return isKeyboardActive();
14019
+ return keyboardActive;
14030
14020
  }
14031
14021
 
14032
14022
  /** @protected */
@@ -14290,7 +14280,7 @@ const ButtonMixin = (superClass) =>
14290
14280
  * `focus-ring` | Set when the button is focused using the keyboard.
14291
14281
  * `focused` | Set when the button is focused.
14292
14282
  *
14293
- * See [Styling Components](https://vaadin.com/docs/latest/styling/custom-theme/styling-components) documentation.
14283
+ * See [Styling Components](https://vaadin.com/docs/latest/ds/customization/styling-components) documentation.
14294
14284
  *
14295
14285
  * @extends HTMLElement
14296
14286
  * @mixes ButtonMixin
@@ -14372,6 +14362,7 @@ registerStyles(
14372
14362
  i$1`
14373
14363
  :host {
14374
14364
  position: relative;
14365
+ background-color: transparent;
14375
14366
  /* Background for the year scroller, placed here as we are using a mask image on the actual years part */
14376
14367
  background-image: linear-gradient(var(--lumo-shade-5pct), var(--lumo-shade-5pct));
14377
14368
  background-size: 57px 100%;
@@ -14479,10 +14470,17 @@ registerStyles(
14479
14470
 
14480
14471
  [part='toolbar'] {
14481
14472
  padding: var(--lumo-space-s);
14473
+ box-shadow: 0 -1px 0 0 var(--lumo-contrast-10pct);
14482
14474
  border-bottom-left-radius: var(--lumo-border-radius-l);
14483
14475
  margin-right: 57px;
14484
14476
  }
14485
14477
 
14478
+ @supports (mask-image: linear-gradient(#000, #000)) or (-webkit-mask-image: linear-gradient(#000, #000)) {
14479
+ [part='toolbar'] {
14480
+ box-shadow: none;
14481
+ }
14482
+ }
14483
+
14486
14484
  /* Today and Cancel buttons */
14487
14485
 
14488
14486
  [part='toolbar'] [part\$='button'] {
@@ -14515,6 +14513,8 @@ registerStyles(
14515
14513
  /* Very narrow screen (year scroller initially hidden) */
14516
14514
 
14517
14515
  [part='years-toggle-button'] {
14516
+ position: relative;
14517
+ right: auto;
14518
14518
  display: flex;
14519
14519
  align-items: center;
14520
14520
  height: var(--lumo-size-s);
@@ -14532,6 +14532,10 @@ registerStyles(
14532
14532
  color: var(--lumo-primary-contrast-color);
14533
14533
  }
14534
14534
 
14535
+ [part='years-toggle-button']::before {
14536
+ content: none;
14537
+ }
14538
+
14535
14539
  /* TODO magic number (same as used for iron-media-query in vaadin-date-picker-overlay-content) */
14536
14540
  @media screen and (max-width: 374px) {
14537
14541
  :host {
@@ -14707,9 +14711,9 @@ registerStyles(
14707
14711
  { moduleId: 'lumo-month-calendar' },
14708
14712
  );
14709
14713
 
14710
- const template$1 = document.createElement('template');
14714
+ const $_documentContainer$1 = document.createElement('template');
14711
14715
 
14712
- template$1.innerHTML = `
14716
+ $_documentContainer$1.innerHTML = `
14713
14717
  <style>
14714
14718
  @keyframes vaadin-date-picker-month-calendar-focus-date {
14715
14719
  50% {
@@ -14719,7 +14723,7 @@ template$1.innerHTML = `
14719
14723
  </style>
14720
14724
  `;
14721
14725
 
14722
- document.head.appendChild(template$1.content);
14726
+ document.head.appendChild($_documentContainer$1.content);
14723
14727
 
14724
14728
  /**
14725
14729
  * @license
@@ -14727,9 +14731,9 @@ document.head.appendChild(template$1.content);
14727
14731
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
14728
14732
  */
14729
14733
 
14730
- const template = document.createElement('template');
14734
+ const $_documentContainer = document.createElement('template');
14731
14735
 
14732
- template.innerHTML = `
14736
+ $_documentContainer.innerHTML = `
14733
14737
  <style>
14734
14738
  @font-face {
14735
14739
  font-family: 'lumo-icons';
@@ -14785,7 +14789,7 @@ template.innerHTML = `
14785
14789
  </style>
14786
14790
  `;
14787
14791
 
14788
- document.head.appendChild(template.content);
14792
+ document.head.appendChild($_documentContainer.content);
14789
14793
 
14790
14794
  /**
14791
14795
  * @license
@@ -15352,57 +15356,6 @@ function getAncestorRootNodes(node) {
15352
15356
  return result;
15353
15357
  }
15354
15358
 
15355
- /**
15356
- * @param {string} value
15357
- * @return {Set<string>}
15358
- */
15359
- function deserializeAttributeValue(value) {
15360
- if (!value) {
15361
- return new Set();
15362
- }
15363
-
15364
- return new Set(value.split(' '));
15365
- }
15366
-
15367
- /**
15368
- * @param {Set<string>} values
15369
- * @return {string}
15370
- */
15371
- function serializeAttributeValue(values) {
15372
- return [...values].join(' ');
15373
- }
15374
-
15375
- /**
15376
- * Adds a value to an attribute containing space-delimited values.
15377
- *
15378
- * @param {HTMLElement} element
15379
- * @param {string} attr
15380
- * @param {string} value
15381
- */
15382
- function addValueToAttribute(element, attr, value) {
15383
- const values = deserializeAttributeValue(element.getAttribute(attr));
15384
- values.add(value);
15385
- element.setAttribute(attr, serializeAttributeValue(values));
15386
- }
15387
-
15388
- /**
15389
- * Removes a value from an attribute containing space-delimited values.
15390
- * If the value is the last one, the whole attribute is removed.
15391
- *
15392
- * @param {HTMLElement} element
15393
- * @param {string} attr
15394
- * @param {string} value
15395
- */
15396
- function removeValueFromAttribute(element, attr, value) {
15397
- const values = deserializeAttributeValue(element.getAttribute(attr));
15398
- values.delete(value);
15399
- if (values.size === 0) {
15400
- element.removeAttribute(attr);
15401
- return;
15402
- }
15403
- element.setAttribute(attr, serializeAttributeValue(values));
15404
- }
15405
-
15406
15359
  /**
15407
15360
  * @license
15408
15361
  * Copyright (c) 2017 - 2022 Vaadin Ltd.
@@ -17127,9 +17080,7 @@ class MonthCalendar extends FocusMixin(ThemableMixin(PolymerElement)) {
17127
17080
 
17128
17081
  _onMonthGridTouchStart() {
17129
17082
  this._notTapping = false;
17130
- setTimeout(() => {
17131
- this._notTapping = true;
17132
- }, 300);
17083
+ setTimeout(() => (this._notTapping = true), 300);
17133
17084
  }
17134
17085
 
17135
17086
  _dateAdd(date, delta) {
@@ -17464,7 +17415,7 @@ class InfiniteScroller extends PolymerElement {
17464
17415
  // Once the first set of items start fading in, stamp the rest
17465
17416
  this._buffers.forEach((buffer) => {
17466
17417
  [].forEach.call(buffer.children, (insertionPoint) => this._ensureStampedInstance(insertionPoint._itemWrapper));
17467
- });
17418
+ }, this);
17468
17419
 
17469
17420
  if (!this._buffers[0].translateY) {
17470
17421
  this._reset();
@@ -17627,7 +17578,7 @@ class InfiniteScroller extends PolymerElement {
17627
17578
  }
17628
17579
  }, 1); // Wait for first reset
17629
17580
  }
17630
- });
17581
+ }, this);
17631
17582
 
17632
17583
  setTimeout(() => {
17633
17584
  afterNextRender(this, this._finishInit.bind(this));
@@ -17665,7 +17616,7 @@ class InfiniteScroller extends PolymerElement {
17665
17616
  });
17666
17617
  buffer.updated = true;
17667
17618
  }
17668
- });
17619
+ }, this);
17669
17620
  }
17670
17621
 
17671
17622
  _isVisible(element, container) {
@@ -17764,6 +17715,7 @@ class DatePickerOverlayContent extends ControllerMixin(ThemableMixin(DirMixin(Po
17764
17715
  height: 100%;
17765
17716
  width: 100%;
17766
17717
  outline: none;
17718
+ background: #fff;
17767
17719
  }
17768
17720
 
17769
17721
  [part='overlay-header'] {
@@ -17781,14 +17733,22 @@ class DatePickerOverlayContent extends ControllerMixin(ThemableMixin(DirMixin(Po
17781
17733
  flex-grow: 1;
17782
17734
  }
17783
17735
 
17784
- [hidden] {
17785
- display: none !important;
17736
+ [part='clear-button']:not([showclear]) {
17737
+ display: none;
17786
17738
  }
17787
17739
 
17788
17740
  [part='years-toggle-button'] {
17789
17741
  display: flex;
17790
17742
  }
17791
17743
 
17744
+ [part='years-toggle-button'][desktop] {
17745
+ display: none;
17746
+ }
17747
+
17748
+ :host(:not([years-visible])) [part='years-toggle-button']::before {
17749
+ transform: rotate(180deg);
17750
+ }
17751
+
17792
17752
  #scrollers {
17793
17753
  display: flex;
17794
17754
  height: 100%;
@@ -17862,14 +17822,27 @@ class DatePickerOverlayContent extends ControllerMixin(ThemableMixin(DirMixin(Po
17862
17822
  z-index: 2;
17863
17823
  flex-shrink: 0;
17864
17824
  }
17825
+
17826
+ [part~='overlay-header']:not([desktop]) {
17827
+ padding-bottom: 40px;
17828
+ }
17829
+
17830
+ [part~='years-toggle-button'] {
17831
+ position: absolute;
17832
+ top: auto;
17833
+ right: 8px;
17834
+ bottom: 0;
17835
+ z-index: 1;
17836
+ padding: 8px;
17837
+ }
17865
17838
  </style>
17866
17839
 
17867
17840
  <div part="overlay-header" on-touchend="_preventDefault" desktop$="[[_desktopMode]]" aria-hidden="true">
17868
17841
  <div part="label">[[_formatDisplayed(selectedDate, i18n.formatDate, label)]]</div>
17869
- <div part="clear-button" hidden$="[[!selectedDate]]"></div>
17842
+ <div part="clear-button" showclear$="[[_showClear(selectedDate)]]"></div>
17870
17843
  <div part="toggle-button"></div>
17871
17844
 
17872
- <div part="years-toggle-button" hidden$="[[_desktopMode]]" aria-hidden="true">
17845
+ <div part="years-toggle-button" desktop$="[[_desktopMode]]" aria-hidden="true">
17873
17846
  [[_yearAfterXMonths(_visibleMonthIndex)]]
17874
17847
  </div>
17875
17848
  </div>
@@ -17955,7 +17928,6 @@ class DatePickerOverlayContent extends ControllerMixin(ThemableMixin(DirMixin(Po
17955
17928
  */
17956
17929
  selectedDate: {
17957
17930
  type: Date,
17958
- value: null,
17959
17931
  },
17960
17932
 
17961
17933
  /**
@@ -18031,12 +18003,10 @@ class DatePickerOverlayContent extends ControllerMixin(ThemableMixin(DirMixin(Po
18031
18003
  return this.getAttribute('dir') === 'rtl';
18032
18004
  }
18033
18005
 
18034
- get calendars() {
18035
- return [...this.shadowRoot.querySelectorAll('vaadin-month-calendar')];
18036
- }
18037
-
18038
18006
  get focusableDateElement() {
18039
- return this.calendars.map((calendar) => calendar.focusableDateElement).find(Boolean);
18007
+ return [...this.shadowRoot.querySelectorAll('vaadin-month-calendar')]
18008
+ .map((calendar) => calendar.focusableDateElement)
18009
+ .find(Boolean);
18040
18010
  }
18041
18011
 
18042
18012
  ready() {
@@ -18044,6 +18014,7 @@ class DatePickerOverlayContent extends ControllerMixin(ThemableMixin(DirMixin(Po
18044
18014
 
18045
18015
  this.setAttribute('role', 'dialog');
18046
18016
 
18017
+ addListener(this, 'tap', this._stopPropagation);
18047
18018
  addListener(this.$.scrollers, 'track', this._track.bind(this));
18048
18019
  addListener(this.shadowRoot.querySelector('[part="clear-button"]'), 'tap', this._clear.bind(this));
18049
18020
  addListener(this.shadowRoot.querySelector('[part="today-button"]'), 'tap', this._onTodayTap.bind(this));
@@ -18165,9 +18136,7 @@ class DatePickerOverlayContent extends ControllerMixin(ThemableMixin(DirMixin(Po
18165
18136
 
18166
18137
  _onYearScrollTouchStart() {
18167
18138
  this._notTapping = false;
18168
- setTimeout(() => {
18169
- this._notTapping = true;
18170
- }, 300);
18139
+ setTimeout(() => (this._notTapping = true), 300);
18171
18140
 
18172
18141
  this._repositionMonthScroller();
18173
18142
  }
@@ -18178,9 +18147,7 @@ class DatePickerOverlayContent extends ControllerMixin(ThemableMixin(DirMixin(Po
18178
18147
 
18179
18148
  _doIgnoreTaps() {
18180
18149
  this._ignoreTaps = true;
18181
- this._debouncer = Debouncer$1.debounce(this._debouncer, timeOut.after(300), () => {
18182
- this._ignoreTaps = false;
18183
- });
18150
+ this._debouncer = Debouncer$1.debounce(this._debouncer, timeOut.after(300), () => (this._ignoreTaps = false));
18184
18151
  }
18185
18152
 
18186
18153
  _formatDisplayed(date, formatDate, label) {
@@ -18211,6 +18178,10 @@ class DatePickerOverlayContent extends ControllerMixin(ThemableMixin(DirMixin(Po
18211
18178
  this.scrollToDate(new Date(), true);
18212
18179
  }
18213
18180
 
18181
+ _showClear(selectedDate) {
18182
+ return !!selectedDate;
18183
+ }
18184
+
18214
18185
  _onYearTap(e) {
18215
18186
  if (!this._ignoreTaps && !this._notTapping) {
18216
18187
  const scrollDelta =
@@ -18236,11 +18207,6 @@ class DatePickerOverlayContent extends ControllerMixin(ThemableMixin(DirMixin(Po
18236
18207
 
18237
18208
  this._targetPosition = targetPosition;
18238
18209
 
18239
- let revealResolve;
18240
- this._revealPromise = new Promise((resolve) => {
18241
- revealResolve = resolve;
18242
- });
18243
-
18244
18210
  // http://gizma.com/easing/
18245
18211
  const easingFunction = (t, b, c, d) => {
18246
18212
  t /= d / 2;
@@ -18281,9 +18247,7 @@ class DatePickerOverlayContent extends ControllerMixin(ThemableMixin(DirMixin(Po
18281
18247
 
18282
18248
  this.$.monthScroller.position = this._targetPosition;
18283
18249
  this._targetPosition = undefined;
18284
-
18285
- revealResolve();
18286
- this._revealPromise = undefined;
18250
+ this.__tryFocusDate();
18287
18251
  }
18288
18252
 
18289
18253
  setTimeout(this._repositionYearScroller.bind(this), 1);
@@ -18493,44 +18457,51 @@ class DatePickerOverlayContent extends ControllerMixin(ThemableMixin(DirMixin(Po
18493
18457
  switch (section) {
18494
18458
  case 'calendar':
18495
18459
  if (event.shiftKey) {
18460
+ // Return focus back to the input field.
18496
18461
  event.preventDefault();
18497
-
18498
- if (this.hasAttribute('fullscreen')) {
18499
- // Trap focus in the overlay
18500
- this.$.cancelButton.focus();
18501
- } else {
18502
- this.__focusInput();
18503
- }
18462
+ this.__focusInput();
18504
18463
  }
18505
18464
  break;
18506
18465
  case 'today':
18507
18466
  if (event.shiftKey) {
18508
- event.preventDefault();
18509
- this.focusDateElement();
18467
+ // Browser returns focus back to the calendar.
18468
+ // We need to move the scroll to focused date.
18469
+ setTimeout(() => this.revealDate(this.focusedDate), 1);
18510
18470
  }
18511
18471
  break;
18512
18472
  case 'cancel':
18513
18473
  if (!event.shiftKey) {
18474
+ // Return focus back to the input field.
18514
18475
  event.preventDefault();
18515
-
18516
- if (this.hasAttribute('fullscreen')) {
18517
- // Trap focus in the overlay
18518
- this.focusDateElement();
18519
- } else {
18520
- this.__focusInput();
18521
- }
18476
+ this.__focusInput();
18522
18477
  }
18523
18478
  break;
18524
18479
  }
18525
18480
  }
18526
18481
 
18527
18482
  __onTodayButtonKeyDown(event) {
18483
+ if (this.hasAttribute('fullscreen')) {
18484
+ // Do not prevent closing on Esc
18485
+ if (event.key !== 'Escape') {
18486
+ event.stopPropagation();
18487
+ }
18488
+ return;
18489
+ }
18490
+
18528
18491
  if (event.key === 'Tab') {
18529
18492
  this._onTabKeyDown(event, 'today');
18530
18493
  }
18531
18494
  }
18532
18495
 
18533
18496
  __onCancelButtonKeyDown(event) {
18497
+ if (this.hasAttribute('fullscreen')) {
18498
+ // Do not prevent closing on Esc
18499
+ if (event.key !== 'Escape') {
18500
+ event.stopPropagation();
18501
+ }
18502
+ return;
18503
+ }
18504
+
18534
18505
  if (event.key === 'Tab') {
18535
18506
  this._onTabKeyDown(event, 'cancel');
18536
18507
  }
@@ -18559,29 +18530,15 @@ class DatePickerOverlayContent extends ControllerMixin(ThemableMixin(DirMixin(Po
18559
18530
  if (!keepMonth) {
18560
18531
  this._focusedMonthDate = dateToFocus.getDate();
18561
18532
  }
18562
- await this.focusDateElement(false);
18533
+ await this.focusDateElement();
18563
18534
  }
18564
18535
 
18565
- async focusDateElement(reveal = true) {
18536
+ async focusDateElement() {
18566
18537
  this.__pendingDateFocus = this.focusedDate;
18567
18538
 
18568
- // Wait for `vaadin-month-calendar` elements to be rendered
18569
- if (!this.calendars.length) {
18570
- await new Promise((resolve) => {
18571
- setTimeout(resolve);
18572
- });
18573
- }
18574
-
18575
- // Reveal focused date unless it has been just set,
18576
- // which triggers `revealDate()` in the observer.
18577
- if (reveal) {
18578
- this.revealDate(this.focusedDate);
18579
- }
18580
-
18581
- if (this._revealPromise) {
18582
- // Wait for focused date to be scrolled into view.
18583
- await this._revealPromise;
18584
- }
18539
+ await new Promise((resolve) => {
18540
+ requestAnimationFrame(resolve);
18541
+ });
18585
18542
 
18586
18543
  this.__tryFocusDate();
18587
18544
  }
@@ -18679,6 +18636,10 @@ class DatePickerOverlayContent extends ControllerMixin(ThemableMixin(DirMixin(Po
18679
18636
  todayMidnight.setDate(today.getDate());
18680
18637
  return this._dateAllowed(todayMidnight, min, max);
18681
18638
  }
18639
+
18640
+ _stopPropagation(e) {
18641
+ e.stopPropagation();
18642
+ }
18682
18643
  }
18683
18644
 
18684
18645
  customElements.define(DatePickerOverlayContent.is, DatePickerOverlayContent);
@@ -18909,24 +18870,6 @@ const DelegateFocusMixin = dedupingMixin(
18909
18870
  },
18910
18871
  );
18911
18872
 
18912
- /**
18913
- * @license
18914
- * Copyright (c) 2021 - 2022 Vaadin Ltd.
18915
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
18916
- */
18917
-
18918
- let uniqueId = 0;
18919
-
18920
- /**
18921
- * Returns a unique integer id.
18922
- *
18923
- * @return {number}
18924
- */
18925
- function generateUniqueId() {
18926
- // eslint-disable-next-line no-plusplus
18927
- return uniqueId++;
18928
- }
18929
-
18930
18873
  /**
18931
18874
  * @license
18932
18875
  * Copyright (c) 2021 - 2022 Vaadin Ltd.
@@ -18947,21 +18890,24 @@ class SlotController extends EventTarget {
18947
18890
  */
18948
18891
  static generateId(slotName, host) {
18949
18892
  const prefix = slotName || 'default';
18950
- return `${prefix}-${host.localName}-${generateUniqueId()}`;
18893
+
18894
+ // Support dash-case slot names e.g. "error-message"
18895
+ const field = `${dashToCamelCase(prefix)}Id`;
18896
+
18897
+ // Maintain the unique ID counter for a given prefix.
18898
+ this[field] = 1 + this[field] || 0;
18899
+
18900
+ return `${prefix}-${host.localName}-${this[field]}`;
18951
18901
  }
18952
18902
 
18953
- constructor(host, slotName, slotFactory, slotInitializer, useUniqueId) {
18903
+ constructor(host, slotName, slotFactory, slotInitializer) {
18954
18904
  super();
18955
18905
 
18956
18906
  this.host = host;
18957
18907
  this.slotName = slotName;
18958
18908
  this.slotFactory = slotFactory;
18959
18909
  this.slotInitializer = slotInitializer;
18960
-
18961
- // Only generate the default ID if requested by the controller.
18962
- if (useUniqueId) {
18963
- this.defaultId = SlotController.generateId(slotName, host);
18964
- }
18910
+ this.defaultId = SlotController.generateId(slotName, host);
18965
18911
  }
18966
18912
 
18967
18913
  hostConnected() {
@@ -19116,7 +19062,6 @@ class ErrorController extends SlotController {
19116
19062
 
19117
19063
  this.__updateHasError();
19118
19064
  },
19119
- true,
19120
19065
  );
19121
19066
  }
19122
19067
 
@@ -19231,6 +19176,63 @@ class ErrorController extends SlotController {
19231
19176
  }
19232
19177
  }
19233
19178
 
19179
+ /**
19180
+ * @license
19181
+ * Copyright (c) 2021 - 2022 Vaadin Ltd.
19182
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
19183
+ */
19184
+
19185
+ /**
19186
+ * @param {string} value
19187
+ * @return {Set<string>}
19188
+ */
19189
+ function deserializeAttributeValue(value) {
19190
+ if (!value) {
19191
+ return new Set();
19192
+ }
19193
+
19194
+ return new Set(value.split(' '));
19195
+ }
19196
+
19197
+ /**
19198
+ * @param {Set<string>} values
19199
+ * @return {string}
19200
+ */
19201
+ function serializeAttributeValue(values) {
19202
+ return [...values].join(' ');
19203
+ }
19204
+
19205
+ /**
19206
+ * Adds a value to an attribute containing space-delimited values.
19207
+ *
19208
+ * @param {HTMLElement} element
19209
+ * @param {string} attr
19210
+ * @param {string} value
19211
+ */
19212
+ function addValueToAttribute(element, attr, value) {
19213
+ const values = deserializeAttributeValue(element.getAttribute(attr));
19214
+ values.add(value);
19215
+ element.setAttribute(attr, serializeAttributeValue(values));
19216
+ }
19217
+
19218
+ /**
19219
+ * Removes a value from an attribute containing space-delimited values.
19220
+ * If the value is the last one, the whole attribute is removed.
19221
+ *
19222
+ * @param {HTMLElement} element
19223
+ * @param {string} attr
19224
+ * @param {string} value
19225
+ */
19226
+ function removeValueFromAttribute(element, attr, value) {
19227
+ const values = deserializeAttributeValue(element.getAttribute(attr));
19228
+ values.delete(value);
19229
+ if (values.size === 0) {
19230
+ element.removeAttribute(attr);
19231
+ return;
19232
+ }
19233
+ element.setAttribute(attr, serializeAttributeValue(values));
19234
+ }
19235
+
19234
19236
  /**
19235
19237
  * @license
19236
19238
  * Copyright (c) 2021 - 2022 Vaadin Ltd.
@@ -19405,7 +19407,7 @@ class FieldAriaController {
19405
19407
 
19406
19408
  /**
19407
19409
  * @license
19408
- * Copyright (c) 2021 - 2022 Vaadin Ltd.
19410
+ * Copyright (c) 2021 Vaadin Ltd.
19409
19411
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
19410
19412
  */
19411
19413
 
@@ -19415,7 +19417,7 @@ class FieldAriaController {
19415
19417
  class HelperController extends SlotController {
19416
19418
  constructor(host) {
19417
19419
  // Do not provide slot factory, as only create helper lazily.
19418
- super(host, 'helper', null, null, true);
19420
+ super(host, 'helper');
19419
19421
  }
19420
19422
 
19421
19423
  get helperId() {
@@ -19612,7 +19614,6 @@ class LabelController extends SlotController {
19612
19614
 
19613
19615
  this.__observeLabel(node);
19614
19616
  },
19615
- true,
19616
19617
  );
19617
19618
  }
19618
19619
 
@@ -19819,12 +19820,6 @@ const LabelMixin = dedupingMixin(
19819
19820
  super();
19820
19821
 
19821
19822
  this._labelController = new LabelController(this);
19822
- }
19823
-
19824
- /** @protected */
19825
- ready() {
19826
- super.ready();
19827
-
19828
19823
  this.addController(this._labelController);
19829
19824
  }
19830
19825
 
@@ -19872,17 +19867,12 @@ const ValidateMixin = dedupingMixin(
19872
19867
  }
19873
19868
 
19874
19869
  /**
19875
- * Validates the field and sets the `invalid` property based on the result.
19876
- *
19877
- * The method fires a `validated` event with the result of the validation.
19870
+ * Returns true if field is valid, and sets `invalid` based on the field validity.
19878
19871
  *
19879
19872
  * @return {boolean} True if the value is valid.
19880
19873
  */
19881
19874
  validate() {
19882
- const isValid = this.checkValidity();
19883
- this._setInvalid(!isValid);
19884
- this.dispatchEvent(new CustomEvent('validated', { detail: { valid: isValid } }));
19885
- return isValid;
19875
+ return !(this.invalid = !this.checkValidity());
19886
19876
  }
19887
19877
 
19888
19878
  /**
@@ -19893,35 +19883,6 @@ const ValidateMixin = dedupingMixin(
19893
19883
  checkValidity() {
19894
19884
  return !this.required || !!this.value;
19895
19885
  }
19896
-
19897
- /**
19898
- * @param {boolean} invalid
19899
- * @protected
19900
- */
19901
- _setInvalid(invalid) {
19902
- if (this._shouldSetInvalid(invalid)) {
19903
- this.invalid = invalid;
19904
- }
19905
- }
19906
-
19907
- /**
19908
- * Override this method to define whether the given `invalid` state should be set.
19909
- *
19910
- * @param {boolean} _invalid
19911
- * @return {boolean}
19912
- * @protected
19913
- */
19914
- _shouldSetInvalid(_invalid) {
19915
- return true;
19916
- }
19917
-
19918
- /**
19919
- * Fired whenever the field is validated.
19920
- *
19921
- * @event validated
19922
- * @param {Object} detail
19923
- * @param {boolean} detail.valid the result of the validation.
19924
- */
19925
19886
  },
19926
19887
  );
19927
19888
 
@@ -20010,6 +19971,10 @@ const FieldMixin = (superclass) =>
20010
19971
  this._helperController = new HelperController(this);
20011
19972
  this._errorController = new ErrorController(this);
20012
19973
 
19974
+ this.addController(this._fieldAriaController);
19975
+ this.addController(this._helperController);
19976
+ this.addController(this._errorController);
19977
+
20013
19978
  this._labelController.addEventListener('label-changed', (event) => {
20014
19979
  const { hasLabel, node } = event.detail;
20015
19980
  this.__labelChanged(hasLabel, node);
@@ -20021,15 +19986,6 @@ const FieldMixin = (superclass) =>
20021
19986
  });
20022
19987
  }
20023
19988
 
20024
- /** @protected */
20025
- ready() {
20026
- super.ready();
20027
-
20028
- this.addController(this._fieldAriaController);
20029
- this.addController(this._helperController);
20030
- this.addController(this._errorController);
20031
- }
20032
-
20033
19989
  /** @private */
20034
19990
  __helperChanged(hasHelper, helperNode) {
20035
19991
  if (hasHelper) {
@@ -20085,7 +20041,7 @@ const FieldMixin = (superclass) =>
20085
20041
  }
20086
20042
 
20087
20043
  /**
20088
- * @param {boolean} invalid
20044
+ * @param {boolean} required
20089
20045
  * @protected
20090
20046
  */
20091
20047
  _invalidChanged(invalid) {
@@ -20285,23 +20241,13 @@ const InputMixin = dedupingMixin(
20285
20241
  observer: '_valueChanged',
20286
20242
  notify: true,
20287
20243
  },
20288
-
20289
- /**
20290
- * When true, the input element has a non-empty value entered by the user.
20291
- * @protected
20292
- */
20293
- _hasInputValue: {
20294
- type: Boolean,
20295
- value: false,
20296
- observer: '_hasInputValueChanged',
20297
- },
20298
20244
  };
20299
20245
  }
20300
20246
 
20301
20247
  constructor() {
20302
20248
  super();
20303
20249
 
20304
- this._boundOnInput = this.__onInput.bind(this);
20250
+ this._boundOnInput = this._onInput.bind(this);
20305
20251
  this._boundOnChange = this._onChange.bind(this);
20306
20252
  }
20307
20253
 
@@ -20316,7 +20262,6 @@ const InputMixin = dedupingMixin(
20316
20262
  * Add event listeners to the input element instance.
20317
20263
  * Override this method to add custom listeners.
20318
20264
  * @param {!HTMLElement} input
20319
- * @protected
20320
20265
  */
20321
20266
  _addInputListeners(input) {
20322
20267
  input.addEventListener('input', this._boundOnInput);
@@ -20326,7 +20271,6 @@ const InputMixin = dedupingMixin(
20326
20271
  /**
20327
20272
  * Remove event listeners from the input element instance.
20328
20273
  * @param {!HTMLElement} input
20329
- * @protected
20330
20274
  */
20331
20275
  _removeInputListeners(input) {
20332
20276
  input.removeEventListener('input', this._boundOnInput);
@@ -20340,6 +20284,7 @@ const InputMixin = dedupingMixin(
20340
20284
  * for example to skip this in certain conditions.
20341
20285
  * @param {string} value
20342
20286
  * @protected
20287
+ * @override
20343
20288
  */
20344
20289
  _forwardInputValue(value) {
20345
20290
  // Value might be set before an input element is initialized.
@@ -20356,11 +20301,7 @@ const InputMixin = dedupingMixin(
20356
20301
  }
20357
20302
  }
20358
20303
 
20359
- /**
20360
- * @param {HTMLElement | undefined} input
20361
- * @param {HTMLElement | undefined} oldInput
20362
- * @protected
20363
- */
20304
+ /** @protected */
20364
20305
  _inputElementChanged(input, oldInput) {
20365
20306
  if (input) {
20366
20307
  this._addInputListeners(input);
@@ -20369,47 +20310,17 @@ const InputMixin = dedupingMixin(
20369
20310
  }
20370
20311
  }
20371
20312
 
20372
- /**
20373
- * Observer to notify about the change of private property.
20374
- *
20375
- * @private
20376
- */
20377
- _hasInputValueChanged(hasValue, oldHasValue) {
20378
- if (hasValue || oldHasValue) {
20379
- this.dispatchEvent(new CustomEvent('has-input-value-changed'));
20380
- }
20381
- }
20382
-
20383
- /**
20384
- * An input event listener used to update `_hasInputValue` property.
20385
- * Do not override this method.
20386
- *
20387
- * @param {Event} event
20388
- * @private
20389
- */
20390
- __onInput(event) {
20391
- // In the case a custom web component is passed as `inputElement`,
20392
- // the actual native input element, on which the event occurred,
20393
- // can be inside shadow trees.
20394
- const target = event.composedPath()[0];
20395
- this._hasInputValue = target.value.length > 0;
20396
- this._onInput(event);
20397
- }
20398
-
20399
20313
  /**
20400
20314
  * An input event listener used to update the field value.
20401
- *
20402
- * @param {Event} event
20315
+ * Override this method with an actual implementation.
20316
+ * @param {Event} _event
20403
20317
  * @protected
20318
+ * @override
20404
20319
  */
20405
20320
  _onInput(event) {
20406
- // In the case a custom web component is passed as `inputElement`,
20407
- // the actual native input element, on which the event occurred,
20408
- // can be inside shadow trees.
20409
- const target = event.composedPath()[0];
20410
20321
  // Ignore fake input events e.g. used by clear button.
20411
20322
  this.__userInput = event.isTrusted;
20412
- this.value = target.value;
20323
+ this.value = event.target.value;
20413
20324
  this.__userInput = false;
20414
20325
  }
20415
20326
 
@@ -20418,12 +20329,12 @@ const InputMixin = dedupingMixin(
20418
20329
  * Override this method with an actual implementation.
20419
20330
  * @param {Event} _event
20420
20331
  * @protected
20332
+ * @override
20421
20333
  */
20422
20334
  _onChange(_event) {}
20423
20335
 
20424
20336
  /**
20425
20337
  * Toggle the has-value attribute based on the value property.
20426
- *
20427
20338
  * @param {boolean} hasValue
20428
20339
  * @protected
20429
20340
  */
@@ -20436,9 +20347,10 @@ const InputMixin = dedupingMixin(
20436
20347
  * @param {string | undefined} newVal
20437
20348
  * @param {string | undefined} oldVal
20438
20349
  * @protected
20350
+ * @override
20439
20351
  */
20440
20352
  _valueChanged(newVal, oldVal) {
20441
- this._toggleHasValue(this._hasValue);
20353
+ this._toggleHasValue(newVal !== '' && newVal != null);
20442
20354
 
20443
20355
  // Setting initial value to empty string, do nothing.
20444
20356
  if (newVal === '' && oldVal === undefined) {
@@ -20453,16 +20365,6 @@ const InputMixin = dedupingMixin(
20453
20365
  // Setting a value programmatically, sync it to input element.
20454
20366
  this._forwardInputValue(newVal);
20455
20367
  }
20456
-
20457
- /**
20458
- * Indicates whether the value is different from the default one.
20459
- * Override if the `value` property has a type other than `string`.
20460
- *
20461
- * @protected
20462
- */
20463
- get _hasValue() {
20464
- return this.value != null && this.value !== '';
20465
- }
20466
20368
  },
20467
20369
  );
20468
20370
 
@@ -20534,32 +20436,26 @@ const InputConstraintsMixin = dedupingMixin(
20534
20436
  _createConstraintsObserver() {
20535
20437
  // This complex observer needs to be added dynamically instead of using `static get observers()`
20536
20438
  // to make it possible to tweak this behavior in classes that apply this mixin.
20537
- this._createMethodObserver(`_constraintsChanged(stateTarget, ${this.constructor.constraints.join(', ')})`);
20439
+ this._createMethodObserver(`_constraintsChanged(${this.constructor.constraints.join(', ')})`);
20538
20440
  }
20539
20441
 
20540
20442
  /**
20541
20443
  * Override this method to implement custom validation constraints.
20542
- * @param {HTMLElement | undefined} stateTarget
20543
20444
  * @param {unknown[]} constraints
20544
20445
  * @protected
20545
20446
  */
20546
- _constraintsChanged(stateTarget, ...constraints) {
20547
- // The input element's validity cannot be determined until
20548
- // all the necessary constraint attributes aren't set on it.
20549
- if (!stateTarget) {
20447
+ _constraintsChanged(...constraints) {
20448
+ // Prevent marking field as invalid when setting required state
20449
+ // or any other constraint before a user has entered the value.
20450
+ if (!this.invalid) {
20550
20451
  return;
20551
20452
  }
20552
20453
 
20553
- const hasConstraints = this._hasValidConstraints(constraints);
20554
- const isLastConstraintRemoved = this.__previousHasConstraints && !hasConstraints;
20555
-
20556
- if ((this._hasValue || this.invalid) && hasConstraints) {
20454
+ if (this._hasValidConstraints(constraints)) {
20557
20455
  this.validate();
20558
- } else if (isLastConstraintRemoved) {
20559
- this._setInvalid(false);
20456
+ } else {
20457
+ this.invalid = false;
20560
20458
  }
20561
-
20562
- this.__previousHasConstraints = hasConstraints;
20563
20459
  }
20564
20460
 
20565
20461
  /**
@@ -20615,22 +20511,6 @@ const InputControlMixin = (superclass) =>
20615
20511
  ) {
20616
20512
  static get properties() {
20617
20513
  return {
20618
- /**
20619
- * A pattern matched against individual characters the user inputs.
20620
- *
20621
- * When set, the field will prevent:
20622
- * - `keydown` events if the entered key doesn't match `/^allowedCharPattern$/`
20623
- * - `paste` events if the pasted text doesn't match `/^allowedCharPattern*$/`
20624
- * - `drop` events if the dropped text doesn't match `/^allowedCharPattern*$/`
20625
- *
20626
- * For example, to allow entering only numbers and minus signs, use:
20627
- * `allowedCharPattern = "[\\d-]"`
20628
- */
20629
- allowedCharPattern: {
20630
- type: String,
20631
- observer: '_allowedCharPatternChanged',
20632
- },
20633
-
20634
20514
  /**
20635
20515
  * If true, the input text gets fully selected when the field is focused using click or touch / tap.
20636
20516
  */
@@ -20688,14 +20568,6 @@ const InputControlMixin = (superclass) =>
20688
20568
  return [...super.delegateAttrs, 'name', 'type', 'placeholder', 'readonly', 'invalid', 'title'];
20689
20569
  }
20690
20570
 
20691
- constructor() {
20692
- super();
20693
-
20694
- this._boundOnPaste = this._onPaste.bind(this);
20695
- this._boundOnDrop = this._onDrop.bind(this);
20696
- this._boundOnBeforeInput = this._onBeforeInput.bind(this);
20697
- }
20698
-
20699
20571
  /**
20700
20572
  * Any element extending this mixin is required to implement this getter.
20701
20573
  * It returns the reference to the clear button element.
@@ -20788,115 +20660,6 @@ const InputControlMixin = (superclass) =>
20788
20660
  this.inputElement.dispatchEvent(new Event('change', { bubbles: true }));
20789
20661
  }
20790
20662
 
20791
- /**
20792
- * Override a method from `InputMixin`.
20793
- * @param {!HTMLElement} input
20794
- * @protected
20795
- * @override
20796
- */
20797
- _addInputListeners(input) {
20798
- super._addInputListeners(input);
20799
-
20800
- input.addEventListener('paste', this._boundOnPaste);
20801
- input.addEventListener('drop', this._boundOnDrop);
20802
- input.addEventListener('beforeinput', this._boundOnBeforeInput);
20803
- }
20804
-
20805
- /**
20806
- * Override a method from `InputMixin`.
20807
- * @param {!HTMLElement} input
20808
- * @protected
20809
- * @override
20810
- */
20811
- _removeInputListeners(input) {
20812
- super._removeInputListeners(input);
20813
-
20814
- input.removeEventListener('paste', this._boundOnPaste);
20815
- input.removeEventListener('drop', this._boundOnDrop);
20816
- input.removeEventListener('beforeinput', this._boundOnBeforeInput);
20817
- }
20818
-
20819
- /**
20820
- * Override an event listener from `KeyboardMixin`.
20821
- * @param {!KeyboardEvent} event
20822
- * @protected
20823
- * @override
20824
- */
20825
- _onKeyDown(event) {
20826
- super._onKeyDown(event);
20827
-
20828
- if (this.allowedCharPattern && !this.__shouldAcceptKey(event)) {
20829
- event.preventDefault();
20830
- this._markInputPrevented();
20831
- }
20832
- }
20833
-
20834
- /** @protected */
20835
- _markInputPrevented() {
20836
- // Add input-prevented attribute for 200ms
20837
- this.setAttribute('input-prevented', '');
20838
- this._preventInputDebouncer = Debouncer$1.debounce(this._preventInputDebouncer, timeOut.after(200), () => {
20839
- this.removeAttribute('input-prevented');
20840
- });
20841
- }
20842
-
20843
- /** @private */
20844
- __shouldAcceptKey(event) {
20845
- return (
20846
- event.metaKey ||
20847
- event.ctrlKey ||
20848
- !event.key || // Allow typing anything if event.key is not supported
20849
- event.key.length !== 1 || // Allow "Backspace", "ArrowLeft" etc.
20850
- this.__allowedCharRegExp.test(event.key)
20851
- );
20852
- }
20853
-
20854
- /** @private */
20855
- _onPaste(e) {
20856
- if (this.allowedCharPattern) {
20857
- const pastedText = e.clipboardData.getData('text');
20858
- if (!this.__allowedTextRegExp.test(pastedText)) {
20859
- e.preventDefault();
20860
- this._markInputPrevented();
20861
- }
20862
- }
20863
- }
20864
-
20865
- /** @private */
20866
- _onDrop(e) {
20867
- if (this.allowedCharPattern) {
20868
- const draggedText = e.dataTransfer.getData('text');
20869
- if (!this.__allowedTextRegExp.test(draggedText)) {
20870
- e.preventDefault();
20871
- this._markInputPrevented();
20872
- }
20873
- }
20874
- }
20875
-
20876
- /** @private */
20877
- _onBeforeInput(e) {
20878
- // The `beforeinput` event covers all the cases for `allowedCharPattern`: keyboard, pasting and dropping,
20879
- // but it is still experimental technology so we can't rely on it. It's used here just as an additional check,
20880
- // because it seems to be the only way to detect and prevent specific keys on mobile devices.
20881
- // See https://github.com/vaadin/vaadin-text-field/issues/429
20882
- if (this.allowedCharPattern && e.data && !this.__allowedTextRegExp.test(e.data)) {
20883
- e.preventDefault();
20884
- this._markInputPrevented();
20885
- }
20886
- }
20887
-
20888
- /** @private */
20889
- _allowedCharPatternChanged(charPattern) {
20890
- if (charPattern) {
20891
- try {
20892
- this.__allowedCharRegExp = new RegExp(`^${charPattern}$`);
20893
- this.__allowedTextRegExp = new RegExp(`^${charPattern}*$`);
20894
- } catch (e) {
20895
- console.error(e);
20896
- }
20897
- }
20898
- }
20899
-
20900
20663
  /**
20901
20664
  * Fired when the user commits a value change.
20902
20665
  *
@@ -20935,13 +20698,14 @@ class InputController extends SlotController {
20935
20698
  }
20936
20699
 
20937
20700
  // Ensure every instance has unique ID
20938
- node.id = this.defaultId;
20701
+ const uniqueId = (InputController._uniqueInputId = 1 + InputController._uniqueInputId || 0);
20702
+ host._inputId = `${host.localName}-${uniqueId}`;
20703
+ node.id = host._inputId;
20939
20704
 
20940
20705
  if (typeof callback === 'function') {
20941
20706
  callback(node);
20942
20707
  }
20943
20708
  },
20944
- true,
20945
20709
  );
20946
20710
  }
20947
20711
  }
@@ -21123,9 +20887,7 @@ class VirtualKeyboardController {
21123
20887
  * @param {function(new:HTMLElement)} subclass
21124
20888
  */
21125
20889
  const DatePickerMixin = (subclass) =>
21126
- class VaadinDatePickerMixin extends ControllerMixin(
21127
- DelegateFocusMixin(InputConstraintsMixin(KeyboardMixin(subclass))),
21128
- ) {
20890
+ class VaadinDatePickerMixin extends ControllerMixin(DelegateFocusMixin(InputMixin(KeyboardMixin(subclass)))) {
21129
20891
  static get properties() {
21130
20892
  return {
21131
20893
  /**
@@ -21154,6 +20916,7 @@ const DatePickerMixin = (subclass) =>
21154
20916
  */
21155
20917
  value: {
21156
20918
  type: String,
20919
+ observer: '_valueChanged',
21157
20920
  notify: true,
21158
20921
  value: '',
21159
20922
  },
@@ -21209,6 +20972,13 @@ const DatePickerMixin = (subclass) =>
21209
20972
  value: '(max-width: 420px), (max-height: 420px)',
21210
20973
  },
21211
20974
 
20975
+ /**
20976
+ * An array of ancestor elements whose -webkit-overflow-scrolling is forced from value
20977
+ * 'touch' to value 'auto' in order to prevent them from clipping the dropdown. iOS only.
20978
+ * @private
20979
+ */
20980
+ _touchPrevented: Array,
20981
+
21212
20982
  /**
21213
20983
  * The object used to localize this component.
21214
20984
  * To change the default localization, replace the entire
@@ -21364,6 +21134,7 @@ const DatePickerMixin = (subclass) =>
21364
21134
  */
21365
21135
  min: {
21366
21136
  type: String,
21137
+ observer: '_minChanged',
21367
21138
  },
21368
21139
 
21369
21140
  /**
@@ -21377,26 +21148,28 @@ const DatePickerMixin = (subclass) =>
21377
21148
  */
21378
21149
  max: {
21379
21150
  type: String,
21151
+ observer: '_maxChanged',
21380
21152
  },
21381
21153
 
21382
21154
  /**
21383
21155
  * The earliest date that can be selected. All earlier dates will be disabled.
21384
- * @type {Date | undefined}
21156
+ * @type {Date | string}
21385
21157
  * @protected
21386
21158
  */
21387
21159
  _minDate: {
21388
21160
  type: Date,
21389
- computed: '__computeMinOrMaxDate(min)',
21161
+ // Null does not work here because minimizer passes undefined to overlay (#351)
21162
+ value: '',
21390
21163
  },
21391
21164
 
21392
21165
  /**
21393
21166
  * The latest date that can be selected. All later dates will be disabled.
21394
- * @type {Date | undefined}
21167
+ * @type {Date | string}
21395
21168
  * @protected
21396
21169
  */
21397
21170
  _maxDate: {
21398
21171
  type: Date,
21399
- computed: '__computeMinOrMaxDate(max)',
21172
+ value: '',
21400
21173
  },
21401
21174
 
21402
21175
  /** @private */
@@ -21411,6 +21184,12 @@ const DatePickerMixin = (subclass) =>
21411
21184
  value: isIOS,
21412
21185
  },
21413
21186
 
21187
+ /** @private */
21188
+ _webkitOverflowScroll: {
21189
+ type: Boolean,
21190
+ value: document.createElement('div').style.webkitOverflowScrolling === '',
21191
+ },
21192
+
21414
21193
  /** @private */
21415
21194
  _focusOverlayOnOpen: Boolean,
21416
21195
 
@@ -21426,10 +21205,6 @@ const DatePickerMixin = (subclass) =>
21426
21205
  ];
21427
21206
  }
21428
21207
 
21429
- static get constraints() {
21430
- return [...super.constraints, 'min', 'max'];
21431
- }
21432
-
21433
21208
  /**
21434
21209
  * Override a getter from `InputControlMixin` to make it optional
21435
21210
  * and to prevent warning when a clear button is missing,
@@ -21496,10 +21271,12 @@ const DatePickerMixin = (subclass) =>
21496
21271
  }
21497
21272
  }
21498
21273
 
21499
- this.validate();
21500
-
21501
- if (this._inputValue === '' && this.value !== '') {
21274
+ if (this.inputElement.value === '' && this.__dispatchChange) {
21275
+ this.validate();
21502
21276
  this.value = '';
21277
+ this.__dispatchChange = false;
21278
+ } else {
21279
+ this.validate();
21503
21280
  }
21504
21281
  }
21505
21282
  }
@@ -21568,19 +21345,14 @@ const DatePickerMixin = (subclass) =>
21568
21345
  this.$.overlay.removeAttribute('disable-upgrade');
21569
21346
  this._overlayInitialized = true;
21570
21347
 
21571
- this.$.overlay.addEventListener('opened-changed', (e) => {
21572
- this.opened = e.detail.value;
21573
- });
21348
+ this.$.overlay.addEventListener('opened-changed', (e) => (this.opened = e.detail.value));
21574
21349
 
21575
21350
  this.$.overlay.addEventListener('vaadin-overlay-escape-press', () => {
21576
21351
  this._focusedDate = this._selectedDate;
21577
21352
  this._close();
21578
21353
  });
21579
21354
 
21580
- this._overlayContent.addEventListener('close', () => {
21581
- this._close();
21582
- });
21583
-
21355
+ this._overlayContent.addEventListener('close', this._close.bind(this));
21584
21356
  this._overlayContent.addEventListener('focus-input', this._focusAndSelect.bind(this));
21585
21357
 
21586
21358
  // User confirmed selected date by clicking the calendar.
@@ -21589,7 +21361,7 @@ const DatePickerMixin = (subclass) =>
21589
21361
 
21590
21362
  this._selectDate(e.detail.date);
21591
21363
 
21592
- this._close();
21364
+ this._close(e);
21593
21365
  });
21594
21366
 
21595
21367
  // User confirmed selected date by pressing Enter or Today.
@@ -21599,18 +21371,24 @@ const DatePickerMixin = (subclass) =>
21599
21371
  this._selectDate(e.detail.date);
21600
21372
  });
21601
21373
 
21602
- // Set focus-ring attribute when moving focus to the overlay
21603
- // by pressing Tab or arrow key, after opening it on click.
21374
+ // Keep focus attribute in focusElement for styling
21604
21375
  this._overlayContent.addEventListener('focusin', () => {
21605
- if (this._keyboardActive) {
21606
- this._setFocused(true);
21607
- }
21376
+ this._setFocused(true);
21608
21377
  });
21609
21378
 
21610
21379
  this.addEventListener('mousedown', () => this.__bringToFront());
21611
21380
  this.addEventListener('touchstart', () => this.__bringToFront());
21612
21381
  }
21613
21382
 
21383
+ /**
21384
+ * Returns true if `value` is valid, and sets the `invalid` flag appropriately.
21385
+ *
21386
+ * @return {boolean} True if the value is valid and sets the `invalid` flag appropriately
21387
+ */
21388
+ validate() {
21389
+ return !(this.invalid = !this.checkValidity());
21390
+ }
21391
+
21614
21392
  /**
21615
21393
  * Returns true if the current input value satisfies all constraints (if any)
21616
21394
  *
@@ -21621,7 +21399,7 @@ const DatePickerMixin = (subclass) =>
21621
21399
  checkValidity() {
21622
21400
  const inputValid =
21623
21401
  !this._inputValue ||
21624
- (!!this._selectedDate && this._inputValue === this._getFormattedDate(this.i18n.formatDate, this._selectedDate));
21402
+ (this._selectedDate && this._inputValue === this._getFormattedDate(this.i18n.formatDate, this._selectedDate));
21625
21403
  const minMaxValid = !this._selectedDate || dateAllowed(this._selectedDate, this._minDate, this._maxDate);
21626
21404
 
21627
21405
  let inputValidity = true;
@@ -21637,51 +21415,6 @@ const DatePickerMixin = (subclass) =>
21637
21415
  return inputValid && minMaxValid && inputValidity;
21638
21416
  }
21639
21417
 
21640
- /**
21641
- * Override method inherited from `FocusMixin`
21642
- * to not call `_setFocused(true)` when focus
21643
- * is restored after closing overlay on click,
21644
- * and to avoid removing `focus-ring` attribute.
21645
- *
21646
- * @param {!FocusEvent} _event
21647
- * @return {boolean}
21648
- * @protected
21649
- * @override
21650
- */
21651
- _shouldSetFocus(_event) {
21652
- return !this._shouldKeepFocusRing;
21653
- }
21654
-
21655
- /**
21656
- * Override method inherited from `FocusMixin`
21657
- * to prevent removing the `focused` attribute:
21658
- * - when moving focus to the overlay content,
21659
- * - when closing on date click / outside click.
21660
- *
21661
- * @param {!FocusEvent} _event
21662
- * @return {boolean}
21663
- * @protected
21664
- * @override
21665
- */
21666
- _shouldRemoveFocus(_event) {
21667
- return !this.opened;
21668
- }
21669
-
21670
- /**
21671
- * Override method inherited from `FocusMixin`
21672
- * to store the `focus-ring` state to restore
21673
- * it later when closing on outside click.
21674
- *
21675
- * @param {boolean} focused
21676
- * @protected
21677
- * @override
21678
- */
21679
- _setFocused(focused) {
21680
- super._setFocused(focused);
21681
-
21682
- this._shouldKeepFocusRing = focused && this._keyboardActive;
21683
- }
21684
-
21685
21418
  /**
21686
21419
  * Select date on user interaction and set the flag
21687
21420
  * to fire change event if necessary.
@@ -21701,7 +21434,10 @@ const DatePickerMixin = (subclass) =>
21701
21434
  }
21702
21435
 
21703
21436
  /** @private */
21704
- _close() {
21437
+ _close(e) {
21438
+ if (e) {
21439
+ e.stopPropagation();
21440
+ }
21705
21441
  this._focus();
21706
21442
  this.close();
21707
21443
  }
@@ -21830,46 +21566,47 @@ const DatePickerMixin = (subclass) =>
21830
21566
  }
21831
21567
  }
21832
21568
 
21833
- /**
21834
- * Override the value observer from `InputMixin` to implement custom
21835
- * handling of the `value` property. The date-picker doesn't forward
21836
- * the value directly to the input like the default implementation of `InputMixin`.
21837
- * Instead, it parses the value into a date, puts it in `_selectedDate` which
21838
- * is then displayed in the input with respect to the specified date format.
21839
- *
21840
- * @param {string | undefined} value
21841
- * @param {string | undefined} oldValue
21842
- * @protected
21843
- * @override
21844
- */
21845
- _valueChanged(value, oldValue) {
21846
- const newDate = this._parseDate(value);
21569
+ /** @private */
21570
+ _handleDateChange(property, value, oldValue) {
21571
+ if (!value) {
21572
+ this[property] = '';
21573
+ return;
21574
+ }
21847
21575
 
21848
- if (value && !newDate) {
21849
- // The new value cannot be parsed, revert the old value.
21576
+ const date = this._parseDate(value);
21577
+ if (!date) {
21850
21578
  this.value = oldValue;
21851
21579
  return;
21852
21580
  }
21853
-
21854
- if (value) {
21855
- if (!dateEquals(this._selectedDate, newDate)) {
21856
- // Update the date instance only if the date has actually changed.
21857
- this._selectedDate = newDate;
21858
-
21859
- if (oldValue !== undefined) {
21860
- // Validate only if `value` changes after initialization.
21861
- this.validate();
21862
- }
21581
+ if (!dateEquals(this[property], date)) {
21582
+ this[property] = date;
21583
+ if (this.value) {
21584
+ this.validate();
21863
21585
  }
21864
- } else {
21865
- this._selectedDate = null;
21866
21586
  }
21587
+ }
21588
+
21589
+ /** @private */
21590
+ _valueChanged(value, oldValue) {
21591
+ this._handleDateChange('_selectedDate', value, oldValue);
21867
21592
 
21868
- this._toggleHasValue(this._hasValue);
21593
+ this._toggleHasValue(!!value);
21594
+ }
21595
+
21596
+ /** @private */
21597
+ _minChanged(value, oldValue) {
21598
+ this._handleDateChange('_minDate', value, oldValue);
21599
+ }
21600
+
21601
+ /** @private */
21602
+ _maxChanged(value, oldValue) {
21603
+ this._handleDateChange('_maxDate', value, oldValue);
21869
21604
  }
21870
21605
 
21871
21606
  /** @protected */
21872
21607
  _onOverlayOpened() {
21608
+ this._openedWithFocusRing = this.hasAttribute('focus-ring');
21609
+
21873
21610
  const parsedInitialPosition = this._parseDate(this.initialPosition);
21874
21611
 
21875
21612
  const initialPosition =
@@ -21889,6 +21626,10 @@ const DatePickerMixin = (subclass) =>
21889
21626
 
21890
21627
  window.addEventListener('scroll', this._boundOnScroll, true);
21891
21628
 
21629
+ if (this._webkitOverflowScroll) {
21630
+ this._touchPrevented = this._preventWebkitOverflowScrollingTouch(this.parentElement);
21631
+ }
21632
+
21892
21633
  if (this._focusOverlayOnOpen) {
21893
21634
  this._overlayContent.focusDateElement();
21894
21635
  this._focusOverlayOnOpen = false;
@@ -21902,6 +21643,25 @@ const DatePickerMixin = (subclass) =>
21902
21643
  }
21903
21644
  }
21904
21645
 
21646
+ // A hack needed for iOS to prevent dropdown from being clipped in an
21647
+ // ancestor container with -webkit-overflow-scrolling: touch;
21648
+ /** @private */
21649
+ _preventWebkitOverflowScrollingTouch(element) {
21650
+ const result = [];
21651
+ while (element) {
21652
+ if (window.getComputedStyle(element).webkitOverflowScrolling === 'touch') {
21653
+ const oldInlineValue = element.style.webkitOverflowScrolling;
21654
+ element.style.webkitOverflowScrolling = 'auto';
21655
+ result.push({
21656
+ element,
21657
+ oldInlineValue,
21658
+ });
21659
+ }
21660
+ element = element.parentElement;
21661
+ }
21662
+ return result;
21663
+ }
21664
+
21905
21665
  /** @private */
21906
21666
  _selectParsedOrFocusedDate() {
21907
21667
  // Select the parsed input or focused date
@@ -21928,6 +21688,13 @@ const DatePickerMixin = (subclass) =>
21928
21688
  _onOverlayClosed() {
21929
21689
  window.removeEventListener('scroll', this._boundOnScroll, true);
21930
21690
 
21691
+ if (this._touchPrevented) {
21692
+ this._touchPrevented.forEach(
21693
+ (prevented) => (prevented.element.style.webkitOverflowScrolling = prevented.oldInlineValue),
21694
+ );
21695
+ this._touchPrevented = [];
21696
+ }
21697
+
21931
21698
  // No need to select date on close if it was confirmed by the user.
21932
21699
  if (this.__userConfirmedDate) {
21933
21700
  this.__userConfirmedDate = false;
@@ -21943,6 +21710,11 @@ const DatePickerMixin = (subclass) =>
21943
21710
  if (!this.value) {
21944
21711
  this.validate();
21945
21712
  }
21713
+
21714
+ // If the input isn't focused when overlay closes (fullscreen mode), clear focused state
21715
+ if (this.getRootNode().activeElement !== this.inputElement) {
21716
+ this._setFocused(false);
21717
+ }
21946
21718
  }
21947
21719
 
21948
21720
  /** @private */
@@ -21995,7 +21767,10 @@ const DatePickerMixin = (subclass) =>
21995
21767
  _onChange(event) {
21996
21768
  // For change event on the native <input> blur, after the input is cleared,
21997
21769
  // we schedule change event to be dispatched on date-picker blur.
21998
- if (this._inputValue === '') {
21770
+ if (
21771
+ this.inputElement.value === '' &&
21772
+ !(event.detail && event.detail.sourceEvent && event.detail.sourceEvent.__fromClearButton)
21773
+ ) {
21999
21774
  this.__dispatchChange = true;
22000
21775
  }
22001
21776
 
@@ -22082,7 +21857,7 @@ const DatePickerMixin = (subclass) =>
22082
21857
  if (e.shiftKey) {
22083
21858
  this._overlayContent.focusCancel();
22084
21859
  } else {
22085
- this._overlayContent.focusDateElement();
21860
+ this._overlayContent.focusDate(this._focusedDate);
22086
21861
  }
22087
21862
  }
22088
21863
  break;
@@ -22193,11 +21968,6 @@ const DatePickerMixin = (subclass) =>
22193
21968
  return this.$.overlay.content.querySelector('#overlay-content');
22194
21969
  }
22195
21970
 
22196
- /** @private */
22197
- __computeMinOrMaxDate(dateString) {
22198
- return this._parseDate(dateString);
22199
- }
22200
-
22201
21971
  /**
22202
21972
  * Fired when the user commits a value change.
22203
21973
  *
@@ -22309,13 +22079,12 @@ registerStyles('vaadin-date-picker', [inputFieldShared, datePickerStyles], { mod
22309
22079
  * Note: the `theme` attribute value set on `<vaadin-date-picker>` is
22310
22080
  * propagated to the internal components listed above.
22311
22081
  *
22312
- * See [Styling Components](https://vaadin.com/docs/latest/styling/custom-theme/styling-components) documentation.
22082
+ * See [Styling Components](https://vaadin.com/docs/latest/ds/customization/styling-components) documentation.
22313
22083
  *
22314
22084
  * @fires {Event} change - Fired when the user commits a value change.
22315
22085
  * @fires {CustomEvent} invalid-changed - Fired when the `invalid` property changes.
22316
22086
  * @fires {CustomEvent} opened-changed - Fired when the `opened` property changes.
22317
22087
  * @fires {CustomEvent} value-changed - Fired when the `value` property changes.
22318
- * @fires {CustomEvent} validated - Fired whenever the field is validated.
22319
22088
  *
22320
22089
  * @extends HTMLElement
22321
22090
  * @mixes ElementMixin
@@ -22369,7 +22138,7 @@ class DatePicker extends DatePickerMixin(InputControlMixin(ThemableMixin(Element
22369
22138
  fullscreen$="[[_fullscreen]]"
22370
22139
  theme$="[[__getOverlayTheme(_theme, _overlayInitialized)]]"
22371
22140
  on-vaadin-overlay-open="_onOverlayOpened"
22372
- on-vaadin-overlay-closing="_onOverlayClosed"
22141
+ on-vaadin-overlay-close="_onOverlayClosed"
22373
22142
  restore-focus-on-close
22374
22143
  restore-focus-node="[[inputElement]]"
22375
22144
  disable-upgrade
@@ -22429,6 +22198,11 @@ class DatePicker extends DatePickerMixin(InputControlMixin(ThemableMixin(Element
22429
22198
 
22430
22199
  /** @private */
22431
22200
  _onVaadinOverlayClose(e) {
22201
+ if (this._openedWithFocusRing && this.hasAttribute('focused')) {
22202
+ this.setAttribute('focus-ring', '');
22203
+ } else if (!this.hasAttribute('focused')) {
22204
+ this.blur();
22205
+ }
22432
22206
  if (e.detail.sourceEvent && e.detail.sourceEvent.composedPath().includes(this)) {
22433
22207
  e.preventDefault();
22434
22208
  }
@@ -22490,26 +22264,55 @@ const HelperFilters$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
22490
22264
  * Language
22491
22265
  */
22492
22266
  this.language = 'en';
22267
+ /**
22268
+ * Notifies if the quick filters from tickets are active
22269
+ */
22270
+ this.quickFiltersActive = false;
22271
+ /**
22272
+ * Client custom styling via string
22273
+ */
22274
+ this.clientStyling = '';
22275
+ /**
22276
+ * Client custom styling via url content
22277
+ */
22278
+ this.clientStylingUrlContent = '';
22493
22279
  this.showFilterModal = false;
22494
22280
  this.showClearButton = false;
22495
22281
  this.filterData = {};
22496
22282
  this.filterDataReset = { ticketDrawId: '', filterFromCalendar: '', filterToCalendar: '' };
22283
+ this.limitStylingAppends = false;
22284
+ this.setClientStyling = () => {
22285
+ let sheet = document.createElement('style');
22286
+ sheet.innerHTML = this.clientStyling;
22287
+ this.stylingContainer.prepend(sheet);
22288
+ };
22289
+ this.setClientStylingURL = () => {
22290
+ let cssFile = document.createElement('style');
22291
+ setTimeout(() => {
22292
+ cssFile.innerHTML = this.clientStylingUrlContent;
22293
+ this.stylingContainer.prepend(cssFile);
22294
+ }, 1);
22295
+ };
22497
22296
  }
22498
22297
  // reset field values each time the filter modal opens
22499
22298
  componentDidRender() {
22500
- this.filterData.ticketDrawId = null;
22501
- this.filterData.filterFromCalendar = null;
22502
- this.filterData.filterToCalendar = null;
22503
22299
  // @TODO: to way binding?
22504
22300
  if (document.getElementById('#FilterById'))
22505
22301
  document.getElementById('#FilterById').value = '';
22302
+ // start custom styling area
22303
+ if (!this.limitStylingAppends && this.stylingContainer) {
22304
+ if (this.clientStyling)
22305
+ this.setClientStyling();
22306
+ if (this.clientStylingUrlContent)
22307
+ this.setClientStylingURL();
22308
+ this.limitStylingAppends = true;
22309
+ }
22310
+ // end custom styling area
22506
22311
  }
22507
22312
  filterSelectionHandler(event) {
22508
22313
  if (this.postMessage)
22509
22314
  window.postMessage({ type: 'filterSelection', event }, window.location.href);
22510
- if (this.filterData.ticketDrawId)
22511
- this.filterDraw.emit(event);
22512
- if (this.filterData.filterFromCalendar || this.filterData.filterToCalendar)
22315
+ if (this.filterData.ticketDrawId || this.filterData.filterFromCalendar || this.filterData.filterToCalendar)
22513
22316
  this.filterSelection.emit(event);
22514
22317
  }
22515
22318
  filterSelectionResetHandler(event) {
@@ -22545,7 +22348,10 @@ const HelperFilters$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
22545
22348
  this.filterData.filterToCalendar = new Date(event.target.value).toISOString();
22546
22349
  }
22547
22350
  render() {
22548
- return (h$2("div", { class: "HelperFilters" }, h$2("div", { class: "FilterButtonsWrapper" }, h$2("button", { class: "FilterOpen", onClick: () => this.toggleFilterModal() }, translate$1('filterOpen', this.language)), this.showClearButton ? h$2("button", { class: "FilterClear", onClick: () => this.resetSearch() }, translate$1('filterClear', this.language)) : null), h$2("helper-modal", { "title-modal": "Filter Modal", visible: this.showFilterModal }, h$2("div", { class: "FilterModalHeader" }, h$2("h3", { class: "FilterModalTitle" }, this.activateTicketSearch ? translate$1('filterModalTicketTitle', this.language) : translate$1('filterModalDrawTitle', this.language))), h$2("div", { class: "FilterModalBody" }, h$2("input", { id: "FilterById", type: "text", value: this.filterData.ticketDrawId, onInput: (event) => this.handleTicketDrawId(event), class: "FilterModalSearch", placeholder: this.activateTicketSearch ? translate$1('filterTicketPlaceholder', this.language) : translate$1('filterDrawPlaceholder', this.language) }), h$2("p", null, translate$1('filterOrDate', this.language)), h$2("div", { class: "FilterCalendarWrapper" }, h$2("vaadin-date-picker", { value: this.filterData.filterFromCalendar, onChange: (event) => this.handleFilterFrom(event), placeholder: translate$1('filterFromCalendar', this.language), class: "VaadinDatePicker" }), h$2("vaadin-date-picker", { value: this.filterData.filterToCalendar, onChange: (event) => this.handleFilterTo(event), placeholder: translate$1('filterToCalendar', this.language), class: "VaadinDatePicker" }))), h$2("div", { class: "FilterModalFooter" }, h$2("button", { class: "FilterModalButton", onClick: () => this.filterSearch() }, translate$1('filterModalButton', this.language))))));
22351
+ return (h$2("div", { class: "HelperFilters", ref: el => this.stylingContainer = el }, h$2("div", { class: "FilterButtonsWrapper" }, h$2("button", { class: "FilterOpen", onClick: () => this.toggleFilterModal() }, translate$1('filterOpen', this.language)), (this.showClearButton || this.quickFiltersActive) ?
22352
+ h$2("button", { class: "FilterClear", onClick: () => this.resetSearch() }, translate$1('filterClear', this.language))
22353
+ :
22354
+ null), h$2("helper-modal", { "title-modal": "Filter Modal", visible: this.showFilterModal, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }, h$2("div", { class: "FilterModalHeader" }, h$2("h3", { class: "FilterModalTitle" }, this.activateTicketSearch ? translate$1('filterModalTicketTitle', this.language) : translate$1('filterModalDrawTitle', this.language))), h$2("div", { class: "FilterModalBody" }, h$2("input", { id: "FilterById", type: "text", value: this.filterData.ticketDrawId, onInput: (event) => this.handleTicketDrawId(event), class: "FilterModalSearch", placeholder: this.activateTicketSearch ? translate$1('filterTicketPlaceholder', this.language) : translate$1('filterDrawPlaceholder', this.language) }), h$2("p", null, translate$1('filterOrDate', this.language)), h$2("div", { class: "FilterCalendarWrapper" }, h$2("vaadin-date-picker", { value: this.filterData.filterFromCalendar, onChange: (event) => this.handleFilterFrom(event), placeholder: translate$1('filterFromCalendar', this.language), class: "VaadinDatePicker" }), h$2("vaadin-date-picker", { value: this.filterData.filterToCalendar, onChange: (event) => this.handleFilterTo(event), placeholder: translate$1('filterToCalendar', this.language), class: "VaadinDatePicker" }))), h$2("div", { class: "FilterModalFooter" }, h$2("button", { class: "FilterModalButton", onClick: () => this.filterSearch() }, translate$1('filterModalButton', this.language))))));
22549
22355
  }
22550
22356
  static get style() { return helperFiltersCss; }
22551
22357
  }, [1, "helper-filters", {
@@ -22556,22 +22362,31 @@ const HelperFilters$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
22556
22362
  "session": [1],
22557
22363
  "postMessage": [4, "post-message"],
22558
22364
  "language": [1],
22365
+ "quickFiltersActive": [4, "quick-filters-active"],
22366
+ "clientStyling": [1, "client-styling"],
22367
+ "clientStylingUrlContent": [1, "client-styling-url-content"],
22559
22368
  "showFilterModal": [32],
22560
22369
  "showClearButton": [32],
22561
22370
  "filterData": [32],
22562
- "filterDataReset": [32]
22371
+ "filterDataReset": [32],
22372
+ "limitStylingAppends": [32]
22563
22373
  }, [[0, "modalCloseEvent", "modalCloseEvent"]]]);
22564
22374
  function defineCustomElement$1() {
22565
22375
  if (typeof customElements === "undefined") {
22566
22376
  return;
22567
22377
  }
22568
- const components = ["helper-filters"];
22378
+ const components = ["helper-filters", "helper-modal"];
22569
22379
  components.forEach(tagName => { switch (tagName) {
22570
22380
  case "helper-filters":
22571
22381
  if (!customElements.get(tagName)) {
22572
22382
  customElements.define(tagName, HelperFilters$1);
22573
22383
  }
22574
22384
  break;
22385
+ case "helper-modal":
22386
+ if (!customElements.get(tagName)) {
22387
+ defineCustomElement$2();
22388
+ }
22389
+ break;
22575
22390
  } });
22576
22391
  }
22577
22392