@everymatrix/general-registration 1.10.12 → 1.10.13

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.
@@ -0,0 +1,84 @@
1
+ import { I as InputConstraintsMixin, D as Debouncer, e as timeOut } from './input-field-shared-styles.js';
2
+
3
+ /**
4
+ * @license
5
+ * Copyright (c) 2021 - 2022 Vaadin Ltd.
6
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
7
+ */
8
+
9
+ /**
10
+ * A mixin to provide `pattern` and `preventInvalidInput` properties.
11
+ *
12
+ * @polymerMixin
13
+ * @mixes InputConstraintsMixin
14
+ */
15
+ const PatternMixin = (superclass) =>
16
+ class PatternMixinClass extends InputConstraintsMixin(superclass) {
17
+ static get properties() {
18
+ return {
19
+ /**
20
+ * A regular expression that the value is checked against.
21
+ * The pattern must match the entire value, not just some subset.
22
+ */
23
+ pattern: {
24
+ type: String,
25
+ },
26
+
27
+ /**
28
+ * When set to true, user is prevented from typing a value that
29
+ * conflicts with the given `pattern`.
30
+ * @attr {boolean} prevent-invalid-input
31
+ * @deprecated Please use `allowedCharPattern` instead.
32
+ */
33
+ preventInvalidInput: {
34
+ type: Boolean,
35
+ observer: '_preventInvalidInputChanged',
36
+ },
37
+ };
38
+ }
39
+
40
+ static get delegateAttrs() {
41
+ return [...super.delegateAttrs, 'pattern'];
42
+ }
43
+
44
+ static get constraints() {
45
+ return [...super.constraints, 'pattern'];
46
+ }
47
+
48
+ /** @private */
49
+ _checkInputValue() {
50
+ if (this.preventInvalidInput) {
51
+ const input = this.inputElement;
52
+ if (input && input.value.length > 0 && !this.checkValidity()) {
53
+ input.value = this.value || '';
54
+ // Add input-prevented attribute for 200ms
55
+ this.setAttribute('input-prevented', '');
56
+ this._inputDebouncer = Debouncer.debounce(this._inputDebouncer, timeOut.after(200), () => {
57
+ this.removeAttribute('input-prevented');
58
+ });
59
+ }
60
+ }
61
+ }
62
+
63
+ /**
64
+ * @param {Event} event
65
+ * @protected
66
+ * @override
67
+ */
68
+ _onInput(event) {
69
+ this._checkInputValue();
70
+
71
+ super._onInput(event);
72
+ }
73
+
74
+ /** @private */
75
+ _preventInvalidInputChanged(preventInvalidInput) {
76
+ if (preventInvalidInput) {
77
+ console.warn(
78
+ `WARNING: Since Vaadin 23.2, "preventInvalidInput" is deprecated. Please use "allowedCharPattern" instead.`,
79
+ );
80
+ }
81
+ }
82
+ };
83
+
84
+ export { PatternMixin as P };
@@ -1,6 +1,7 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
2
  import { t as translate } from './locale.utils.js';
3
- import '@vaadin/combo-box';
3
+ import './input-field-shared-styles.js';
4
+ import './vaadin-combo-box.js';
4
5
 
5
6
  const selectInputCss = "*,*::before,*::after{padding:0;margin:0;box-sizing:border-box}.select{font-family:\"Roboto\";font-style:normal}.select__wrapper{position:relative;width:100%;padding-top:26px}.select__label{font-family:inherit;font-style:normal;font-weight:500;font-size:16px;line-height:20px;color:#1F1F1F;position:absolute;top:0;left:0}.select__label--required::after{content:\"*\";font-family:inherit;color:#1F1F1F;margin-left:2px}.select__input{border:none;width:inherit;position:relative}.select__input[focused]::part(input-field){border-color:#3E3E3E}.select__input[invalid]::part(input-field){border-color:#cc0000b3}.select__input vaadin-date-picker-overlay-content>vaadin-button{color:#1F1F1F}.select__input vaadin-month-calendar::part(selected date){background-color:red}.select__input::part(input-field){border-radius:4px;background-color:#FFFFFF;border:2px solid #DEE1EE;color:#2A2E3F;border-radius:4px;background-color:transparent;font-family:inherit;font-style:normal;font-weight:300;font-size:16px;line-height:19px}.select__error-message{position:absolute;top:calc(100% + 5px);left:0;color:#cc0000b3}";
6
7
 
@@ -1,6 +1,7 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
2
  import { t as translate } from './locale.utils.js';
3
- import '@vaadin/combo-box';
3
+ import './input-field-shared-styles.js';
4
+ import './vaadin-combo-box.js';
4
5
 
5
6
  const telInputCss = "*,*::before,*::after{padding:0;margin:0;box-sizing:border-box}.tel{font-family:\"Roboto\";font-style:normal}.tel__wrapper{position:relative;width:100%;padding-top:26px}.tel__wrapper--flex{width:inherit;display:flex;align-items:stretch;border-radius:4px;border:2px solid #DEE1EE}.tel__wrapper--flex:focus-within{border:2px solid #3E3E3E}.tel__wrapper--flex--invalid{border:2px solid #cc0000b3}.tel__label{font-family:inherit;font-style:normal;font-weight:500;font-size:16px;line-height:20px;color:#1F1F1F;position:absolute;top:0;left:0}.tel__label--required::after{content:\"*\";font-family:inherit;color:#1F1F1F;margin-left:2px}.tel__prefix{width:120px}.tel__prefix[focus]{outline:none}.tel__prefix::part(input-field){border-radius:0 4px 4px 0;background-color:#DEE1EE;color:#1F1F1F;font-family:inherit;font-style:normal;font-weight:300;font-size:16px;line-height:19px}.tel__input{border-radius:4px;background-color:transparent;font-family:inherit;font-style:normal;font-weight:300;font-size:16px;line-height:19px;color:#2A2E3F;border:none;padding:8px 20px;width:inherit;position:relative;-moz-appearance:textfield;}.tel__input:focus{outline:none}.tel__input::-webkit-outer-spin-button,.tel__input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.tel__error-message{position:absolute;top:calc(100% + 5px);left:0;color:#cc0000b3}";
6
7