@everymatrix/general-input 1.27.6 → 1.27.8

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,2 @@
1
+ import { Config } from '../../../../../../../../../../../stencil-public-runtime';
2
+ export declare const config: Config;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/general-input",
3
- "version": "1.27.6",
3
+ "version": "1.27.8",
4
4
  "main": "./dist/index.cjs.js",
5
5
  "module": "./dist/index.js",
6
6
  "es2015": "./dist/esm/index.mjs",
@@ -1,85 +0,0 @@
1
- import { y as Debouncer, z as timeOut } from './field-mixin.js';
2
- import { I as InputConstraintsMixin } from './input-field-shared-styles.js';
3
-
4
- /**
5
- * @license
6
- * Copyright (c) 2021 - 2022 Vaadin Ltd.
7
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
8
- */
9
-
10
- /**
11
- * A mixin to provide `pattern` and `preventInvalidInput` properties.
12
- *
13
- * @polymerMixin
14
- * @mixes InputConstraintsMixin
15
- */
16
- const PatternMixin = (superclass) =>
17
- class PatternMixinClass extends InputConstraintsMixin(superclass) {
18
- static get properties() {
19
- return {
20
- /**
21
- * A regular expression that the value is checked against.
22
- * The pattern must match the entire value, not just some subset.
23
- */
24
- pattern: {
25
- type: String,
26
- },
27
-
28
- /**
29
- * When set to true, user is prevented from typing a value that
30
- * conflicts with the given `pattern`.
31
- * @attr {boolean} prevent-invalid-input
32
- * @deprecated Please use `allowedCharPattern` instead.
33
- */
34
- preventInvalidInput: {
35
- type: Boolean,
36
- observer: '_preventInvalidInputChanged',
37
- },
38
- };
39
- }
40
-
41
- static get delegateAttrs() {
42
- return [...super.delegateAttrs, 'pattern'];
43
- }
44
-
45
- static get constraints() {
46
- return [...super.constraints, 'pattern'];
47
- }
48
-
49
- /** @private */
50
- _checkInputValue() {
51
- if (this.preventInvalidInput) {
52
- const input = this.inputElement;
53
- if (input && input.value.length > 0 && !this.checkValidity()) {
54
- input.value = this.value || '';
55
- // Add input-prevented attribute for 200ms
56
- this.setAttribute('input-prevented', '');
57
- this._inputDebouncer = Debouncer.debounce(this._inputDebouncer, timeOut.after(200), () => {
58
- this.removeAttribute('input-prevented');
59
- });
60
- }
61
- }
62
- }
63
-
64
- /**
65
- * @param {Event} event
66
- * @protected
67
- * @override
68
- */
69
- _onInput(event) {
70
- this._checkInputValue();
71
-
72
- super._onInput(event);
73
- }
74
-
75
- /** @private */
76
- _preventInvalidInputChanged(preventInvalidInput) {
77
- if (preventInvalidInput) {
78
- console.warn(
79
- `WARNING: Since Vaadin 23.2, "preventInvalidInput" is deprecated. Please use "allowedCharPattern" instead.`,
80
- );
81
- }
82
- }
83
- };
84
-
85
- export { PatternMixin as P };