@vaadin/field-base 22.0.0-alpha1 → 22.0.0-alpha10

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.
Files changed (67) hide show
  1. package/index.d.ts +10 -9
  2. package/index.js +10 -9
  3. package/package.json +25 -19
  4. package/src/aria-label-controller.d.ts +11 -0
  5. package/src/aria-label-controller.js +58 -0
  6. package/src/checked-mixin.d.ts +26 -0
  7. package/src/checked-mixin.js +54 -0
  8. package/src/delegate-focus-mixin.d.ts +7 -4
  9. package/src/delegate-focus-mixin.js +154 -72
  10. package/src/delegate-state-mixin.d.ts +23 -0
  11. package/src/delegate-state-mixin.js +125 -0
  12. package/src/field-mixin.d.ts +39 -0
  13. package/src/field-mixin.js +317 -0
  14. package/src/input-constraints-mixin.d.ts +28 -0
  15. package/src/input-constraints-mixin.js +126 -0
  16. package/src/input-control-mixin.d.ts +52 -0
  17. package/src/input-control-mixin.js +170 -0
  18. package/src/input-controller.d.ts +11 -0
  19. package/src/input-controller.js +35 -0
  20. package/src/input-field-mixin.d.ts +2 -22
  21. package/src/input-field-mixin.js +117 -168
  22. package/src/input-mixin.d.ts +22 -6
  23. package/src/input-mixin.js +161 -51
  24. package/src/label-mixin.d.ts +2 -2
  25. package/src/label-mixin.js +74 -60
  26. package/src/pattern-mixin.d.ts +32 -0
  27. package/src/pattern-mixin.js +72 -0
  28. package/src/shadow-focus-mixin.d.ts +21 -0
  29. package/src/shadow-focus-mixin.js +87 -0
  30. package/src/slot-controller.d.ts +8 -0
  31. package/src/slot-controller.js +36 -0
  32. package/src/slot-label-mixin.d.ts +20 -0
  33. package/src/slot-label-mixin.js +38 -0
  34. package/src/slot-styles-mixin.d.ts +24 -0
  35. package/src/slot-styles-mixin.js +76 -0
  36. package/src/slot-target-mixin.d.ts +32 -0
  37. package/src/slot-target-mixin.js +110 -0
  38. package/src/styles/clear-button-styles.d.ts +8 -0
  39. package/src/styles/clear-button-styles.js +21 -0
  40. package/src/styles/field-shared-styles.d.ts +8 -0
  41. package/src/styles/field-shared-styles.js +29 -0
  42. package/src/styles/input-field-container-styles.d.ts +8 -0
  43. package/src/styles/input-field-container-styles.js +16 -0
  44. package/src/styles/input-field-shared-styles.d.ts +8 -0
  45. package/src/styles/input-field-shared-styles.js +10 -0
  46. package/src/text-area-controller.d.ts +11 -0
  47. package/src/text-area-controller.js +38 -0
  48. package/src/validate-mixin.d.ts +1 -9
  49. package/src/validate-mixin.js +43 -118
  50. package/src/clear-button-mixin.d.ts +0 -32
  51. package/src/clear-button-mixin.js +0 -87
  52. package/src/disabled-mixin.d.ts +0 -23
  53. package/src/disabled-mixin.js +0 -48
  54. package/src/field-aria-mixin.d.ts +0 -24
  55. package/src/field-aria-mixin.js +0 -61
  56. package/src/focus-mixin.d.ts +0 -33
  57. package/src/focus-mixin.js +0 -104
  58. package/src/helper-text-mixin.d.ts +0 -24
  59. package/src/helper-text-mixin.js +0 -109
  60. package/src/input-aria-mixin.d.ts +0 -20
  61. package/src/input-aria-mixin.js +0 -69
  62. package/src/input-props-mixin.d.ts +0 -40
  63. package/src/input-props-mixin.js +0 -106
  64. package/src/slot-mixin.d.ts +0 -23
  65. package/src/slot-mixin.js +0 -55
  66. package/src/text-field-mixin.d.ts +0 -47
  67. package/src/text-field-mixin.js +0 -125
@@ -1,32 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2021 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import { InputMixin } from './input-mixin.js';
7
-
8
- /**
9
- * A mixin to add clear button support to field components.
10
- */
11
- declare function ClearButtonMixin<T extends new (...args: any[]) => {}>(base: T): T & ClearButtonMixinConstructor;
12
-
13
- interface ClearButtonMixinConstructor {
14
- new (...args: any[]): ClearButtonMixin;
15
- }
16
-
17
- interface ClearButtonMixin extends InputMixin {
18
- /**
19
- * Set to true to display the clear icon which clears the input.
20
- * @attr {boolean} clear-button-visible
21
- */
22
- clearButtonVisible: boolean;
23
-
24
- /**
25
- * Clear the value of this field.
26
- */
27
- clear(): void;
28
-
29
- readonly _clearOnEsc: boolean;
30
- }
31
-
32
- export { ClearButtonMixin, ClearButtonMixinConstructor };
@@ -1,87 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2021 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import { dedupingMixin } from '@polymer/polymer/lib/utils/mixin.js';
7
- import { InputMixin } from './input-mixin.js';
8
-
9
- const ClearButtonMixinImplementation = (superclass) =>
10
- class ClearButtonMixinClass extends InputMixin(superclass) {
11
- static get properties() {
12
- return {
13
- /**
14
- * Set to true to display the clear icon which clears the input.
15
- * @attr {boolean} clear-button-visible
16
- */
17
- clearButtonVisible: {
18
- type: Boolean,
19
- reflectToAttribute: true,
20
- value: false
21
- }
22
- };
23
- }
24
-
25
- /**
26
- * Any element extending this mixin is required to implement this getter.
27
- * It returns the reference to the clear button element.
28
- * @protected
29
- * @return {Element | null | undefined}
30
- */
31
- get clearElement() {
32
- console.warn(`Please implement the 'clearElement' property in <${this.localName}>`);
33
- return null;
34
- }
35
-
36
- /** @protected */
37
- get _clearOnEsc() {
38
- return true;
39
- }
40
-
41
- /** @protected */
42
- ready() {
43
- super.ready();
44
-
45
- this.addEventListener('keydown', (e) => this._onKeyDown(e));
46
-
47
- if (this.clearElement) {
48
- this.clearElement.addEventListener('click', (e) => this._onClearButtonClick(e));
49
- }
50
- }
51
-
52
- /**
53
- * Clear the value of this field.
54
- */
55
- clear() {
56
- this.value = this._inputNode.value = '';
57
- }
58
-
59
- /**
60
- * @param {Event} event
61
- * @protected
62
- */
63
- _onClearButtonClick(event) {
64
- event.preventDefault();
65
- this._inputNode.focus();
66
- this.clear();
67
- this._inputNode.dispatchEvent(new Event('input', { bubbles: true, composed: true }));
68
- this._inputNode.dispatchEvent(new Event('change', { bubbles: true }));
69
- }
70
-
71
- /**
72
- * @param {Event} event
73
- * @protected
74
- */
75
- _onKeyDown(event) {
76
- if (event.key === 'Escape' && this.clearButtonVisible && this._clearOnEsc) {
77
- const dispatchChange = !!this.value;
78
- this.clear();
79
- dispatchChange && this._inputNode.dispatchEvent(new Event('change', { bubbles: true }));
80
- }
81
- }
82
- };
83
-
84
- /**
85
- * A mixin to add clear button support to field components.
86
- */
87
- export const ClearButtonMixin = dedupingMixin(ClearButtonMixinImplementation);
@@ -1,23 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2021 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
-
7
- /**
8
- * A mixin to provide disabled property for field components.
9
- */
10
- declare function DisabledMixin<T extends new (...args: any[]) => {}>(base: T): T & DisabledMixinConstructor;
11
-
12
- interface DisabledMixinConstructor {
13
- new (...args: any[]): DisabledMixin;
14
- }
15
-
16
- interface DisabledMixin {
17
- /**
18
- * If true, the user cannot interact with this element.
19
- */
20
- disabled: boolean;
21
- }
22
-
23
- export { DisabledMixinConstructor, DisabledMixin };
@@ -1,48 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2021 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import { dedupingMixin } from '@polymer/polymer/lib/utils/mixin.js';
7
-
8
- const DisabledMixinImplementation = (superclass) =>
9
- class DisabledMixinClass extends superclass {
10
- static get properties() {
11
- return {
12
- /**
13
- * If true, the user cannot interact with this element.
14
- */
15
- disabled: {
16
- type: Boolean,
17
- value: false,
18
- observer: '_disabledChanged',
19
- reflectToAttribute: true
20
- }
21
- };
22
- }
23
-
24
- /**
25
- * @param {boolean} disabled
26
- * @protected
27
- */
28
- _disabledChanged(disabled) {
29
- this._setAriaDisabled(disabled);
30
- }
31
-
32
- /**
33
- * @param {boolean} disabled
34
- * @protected
35
- */
36
- _setAriaDisabled(disabled) {
37
- if (disabled) {
38
- this.setAttribute('aria-disabled', 'true');
39
- } else {
40
- this.removeAttribute('aria-disabled');
41
- }
42
- }
43
- };
44
-
45
- /**
46
- * A mixin to provide disabled property for field components.
47
- */
48
- export const DisabledMixin = dedupingMixin(DisabledMixinImplementation);
@@ -1,24 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2021 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import { HelperTextMixin } from './helper-text-mixin.js';
7
- import { ValidateMixin } from './validate-mixin.js';
8
-
9
- /**
10
- * A mixin to handle field ARIA attributes based on the label, error message and helper text.
11
- */
12
- declare function FieldAriaMixin<T extends new (...args: any[]) => {}>(base: T): T & FieldAriaMixinConstructor;
13
-
14
- interface FieldAriaMixinConstructor {
15
- new (...args: any[]): FieldAriaMixin;
16
- }
17
-
18
- interface FieldAriaMixin extends HelperTextMixin, ValidateMixin {
19
- readonly _ariaTarget: HTMLElement;
20
-
21
- readonly _ariaAttr: string;
22
- }
23
-
24
- export { FieldAriaMixin, FieldAriaMixinConstructor };
@@ -1,61 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2021 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import { dedupingMixin } from '@polymer/polymer/lib/utils/mixin.js';
7
- import { HelperTextMixin } from './helper-text-mixin.js';
8
- import { ValidateMixin } from './validate-mixin.js';
9
-
10
- const FieldAriaMixinImplementation = (superclass) =>
11
- class FieldAriaMixinClass extends HelperTextMixin(ValidateMixin(superclass)) {
12
- /** @protected */
13
- get _ariaTarget() {
14
- return this;
15
- }
16
-
17
- /** @protected */
18
- get _ariaAttr() {
19
- return 'aria-describedby';
20
- }
21
-
22
- static get observers() {
23
- return ['_invalidChanged(invalid)'];
24
- }
25
-
26
- /** @protected */
27
- connectedCallback() {
28
- super.connectedCallback();
29
-
30
- this._updateAriaAttribute(this.invalid);
31
- }
32
-
33
- /** @protected */
34
- _updateAriaAttribute(invalid) {
35
- const attr = this._ariaAttr;
36
-
37
- if (this._ariaTarget && attr) {
38
- // For groups, add all IDs to aria-labelledby rather than aria-describedby -
39
- // that should guarantee that it's announced when the group is entered.
40
- const ariaIds = attr === 'aria-describedby' ? [this._helperId] : [this._labelId, this._helperId];
41
-
42
- // Error message ID needs to be dynamically added / removed based on the validity
43
- // Otherwise assistive technologies would announce the error, even if we hide it.
44
- if (invalid) {
45
- ariaIds.push(this._errorId);
46
- }
47
-
48
- this._ariaTarget.setAttribute(attr, ariaIds.join(' '));
49
- }
50
- }
51
-
52
- /** @protected */
53
- _invalidChanged(invalid) {
54
- this._updateAriaAttribute(invalid);
55
- }
56
- };
57
-
58
- /**
59
- * A mixin to handle field ARIA attributes based on the label, error message and helper text.
60
- */
61
- export const FieldAriaMixin = dedupingMixin(FieldAriaMixinImplementation);
@@ -1,33 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2021 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
-
7
- /**
8
- * A mixin to handle `focused` and `focus-ring` attributes based on focus.
9
- */
10
- declare function FocusMixin<T extends new (...args: any[]) => {}>(base: T): T & FocusMixinConstructor;
11
-
12
- interface FocusMixinConstructor {
13
- new (...args: any[]): FocusMixin;
14
- }
15
-
16
- interface FocusMixin {
17
- /**
18
- * Override to change how focused and focus-ring attributes are set.
19
- */
20
- _setFocused(focused: boolean): void;
21
-
22
- /**
23
- * Override to define if the field receives focus based on the event.
24
- */
25
- _shouldSetFocus(event: FocusEvent): boolean;
26
-
27
- /**
28
- * Override to define if the field loses focus based on the event.
29
- */
30
- _shouldRemoveFocus(event: FocusEvent): boolean;
31
- }
32
-
33
- export { FocusMixinConstructor, FocusMixin };
@@ -1,104 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2021 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import { dedupingMixin } from '@polymer/polymer/lib/utils/mixin.js';
7
-
8
- // We consider the keyboard to be active if the window has received a keydown
9
- // event since the last mousedown event.
10
- let keyboardActive = false;
11
-
12
- // Listen for top-level keydown and mousedown events.
13
- // Use capture phase so we detect events even if they're handled.
14
- window.addEventListener(
15
- 'keydown',
16
- () => {
17
- keyboardActive = true;
18
- },
19
- { capture: true }
20
- );
21
-
22
- window.addEventListener(
23
- 'mousedown',
24
- () => {
25
- keyboardActive = false;
26
- },
27
- { capture: true }
28
- );
29
-
30
- const FocusMixinImplementation = (superclass) =>
31
- class FocusMixinClass extends superclass {
32
- /** @protected */
33
- ready() {
34
- this.addEventListener('focusin', (e) => {
35
- if (this._shouldSetFocus(e)) {
36
- this._setFocused(true);
37
- }
38
- });
39
-
40
- this.addEventListener('focusout', (e) => {
41
- if (this._shouldRemoveFocus(e)) {
42
- this._setFocused(false);
43
- }
44
- });
45
-
46
- // In super.ready() other 'focusin' and 'focusout' listeners might be
47
- // added, so we call it after our own ones to ensure they execute first.
48
- // Issue to watch out: when incorrect, <vaadin-combo-box> refocuses the
49
- // input field on iOS after “Done” is pressed.
50
- super.ready();
51
- }
52
-
53
- /** @protected */
54
- disconnectedCallback() {
55
- super.disconnectedCallback();
56
-
57
- // in non-Chrome browsers, blur does not fire on the element when it is disconnected.
58
- // reproducible in `<vaadin-date-picker>` when closing on `Cancel` or `Today` click.
59
- if (this.hasAttribute('focused')) {
60
- this._setFocused(false);
61
- }
62
- }
63
-
64
- /**
65
- * Override to change how focused and focus-ring attributes are set.
66
- *
67
- * @param {boolean} focused
68
- * @protected
69
- */
70
- _setFocused(focused) {
71
- this.toggleAttribute('focused', focused);
72
-
73
- // focus-ring is true when the element was focused from the keyboard.
74
- // Focus Ring [A11ycasts]: https://youtu.be/ilj2P5-5CjI
75
- this.toggleAttribute('focus-ring', focused && keyboardActive);
76
- }
77
-
78
- /**
79
- * Override to define if the field receives focus based on the event.
80
- *
81
- * @param {FocusEvent} event
82
- * @return {boolean}
83
- * @protected
84
- */
85
- _shouldSetFocus(_event) {
86
- return true;
87
- }
88
-
89
- /**
90
- * Override to define if the field loses focus based on the event.
91
- *
92
- * @param {FocusEvent} event
93
- * @return {boolean}
94
- * @protected
95
- */
96
- _shouldRemoveFocus(_event) {
97
- return true;
98
- }
99
- };
100
-
101
- /**
102
- * A mixin to handle `focused` and `focus-ring` attributes based on focus.
103
- */
104
- export const FocusMixin = dedupingMixin(FocusMixinImplementation);
@@ -1,24 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2021 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import { SlotMixin } from './slot-mixin.js';
7
-
8
- /**
9
- * A mixin to provide helper text via corresponding property or named slot.
10
- */
11
- declare function HelperTextMixin<T extends new (...args: any[]) => {}>(base: T): T & HelperTextMixinConstructor;
12
-
13
- interface HelperTextMixinConstructor {
14
- new (...args: any[]): HelperTextMixin;
15
- }
16
-
17
- interface HelperTextMixin extends SlotMixin {
18
- /**
19
- * String used for the helper text.
20
- */
21
- helperText: string;
22
- }
23
-
24
- export { HelperTextMixinConstructor, HelperTextMixin };
@@ -1,109 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2021 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import { dedupingMixin } from '@polymer/polymer/lib/utils/mixin.js';
7
- import { SlotMixin } from './slot-mixin.js';
8
-
9
- const HelperTextMixinImplementation = (superclass) =>
10
- class HelperTextMixinClass extends SlotMixin(superclass) {
11
- static get properties() {
12
- return {
13
- /**
14
- * String used for the helper text.
15
- * @attr {string} helper-text
16
- */
17
- helperText: {
18
- type: String,
19
- observer: '_helperTextChanged'
20
- }
21
- };
22
- }
23
-
24
- get slots() {
25
- return {
26
- ...super.slots,
27
- helper: () => {
28
- const helper = document.createElement('div');
29
- helper.textContent = this.helperText;
30
- return helper;
31
- }
32
- };
33
- }
34
-
35
- /** @protected */
36
- get _helperNode() {
37
- return this._getDirectSlotChild('helper');
38
- }
39
-
40
- constructor() {
41
- super();
42
-
43
- // Ensure every instance has unique ID
44
- const uniqueId = (HelperTextMixinClass._uniqueId = 1 + HelperTextMixinClass._uniqueId || 0);
45
- this._helperId = `helper-${this.localName}-${uniqueId}`;
46
- }
47
-
48
- /** @protected */
49
- connectedCallback() {
50
- super.connectedCallback();
51
-
52
- if (this._helperNode) {
53
- this._currentHelper = this._helperNode;
54
- this._helperNode.id = this._helperId;
55
-
56
- this._applyCustomHelper();
57
- }
58
- }
59
-
60
- /** @protected */
61
- ready() {
62
- super.ready();
63
-
64
- this.__helperSlot = this.shadowRoot.querySelector('[name="helper"]');
65
- this.__helperSlot.addEventListener('slotchange', this.__onHelperSlotChange.bind(this));
66
- }
67
-
68
- /** @private */
69
- __onHelperSlotChange() {
70
- // Check fot slotted element node that is not the one created by this mixin.
71
- const customHelper = this.__helperSlot
72
- .assignedElements({ flatten: true })
73
- .find((node) => node !== this._currentHelper);
74
-
75
- if (customHelper) {
76
- customHelper.id = this._helperId;
77
-
78
- if (this._currentHelper.isConnected) {
79
- this._currentHelper.remove();
80
- }
81
-
82
- this._applyCustomHelper();
83
-
84
- this._currentHelper = customHelper;
85
- }
86
- }
87
-
88
- /** @protected */
89
- _applyCustomHelper() {
90
- const helper = this._helperNode.textContent;
91
- if (helper !== this.helperText) {
92
- this.helperText = helper;
93
- }
94
- }
95
-
96
- /** @protected */
97
- _helperTextChanged(helper) {
98
- if (this._helperNode) {
99
- this._helperNode.textContent = helper;
100
- }
101
-
102
- this.toggleAttribute('has-helper', Boolean(helper));
103
- }
104
- };
105
-
106
- /**
107
- * A mixin to provide helper text via corresponding property or named slot.
108
- */
109
- export const HelperTextMixin = dedupingMixin(HelperTextMixinImplementation);
@@ -1,20 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2021 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import { LabelMixin } from './label-mixin.js';
7
- import { InputMixin } from './input-mixin.js';
8
-
9
- /**
10
- * A mixin to link slotted `<input>` and `<label>` elements.
11
- */
12
- declare function InputAriaMixin<T extends new (...args: any[]) => {}>(base: T): T & InputAriaMixinConstructor;
13
-
14
- interface InputAriaMixinConstructor {
15
- new (...args: any[]): InputAriaMixin;
16
- }
17
-
18
- interface InputAriaMixin extends InputMixin, LabelMixin {}
19
-
20
- export { InputAriaMixin, InputAriaMixinConstructor };
@@ -1,69 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2021 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import { dedupingMixin } from '@polymer/polymer/lib/utils/mixin.js';
7
- import { LabelMixin } from './label-mixin.js';
8
- import { InputMixin } from './input-mixin.js';
9
-
10
- const InputAriaMixinImplementation = (superclass) =>
11
- class InputAriaMixinClass extends InputMixin(LabelMixin(superclass)) {
12
- constructor() {
13
- super();
14
-
15
- this.__preventDuplicateLabelClick = this.__preventDuplicateLabelClick.bind(this);
16
- }
17
-
18
- /** @protected */
19
- connectedCallback() {
20
- super.connectedCallback();
21
-
22
- this._enhanceLightDomA11y();
23
-
24
- if (this._labelNode) {
25
- this._labelNode.addEventListener('click', this.__preventDuplicateLabelClick);
26
- }
27
- }
28
-
29
- /** @protected */
30
- disconnectedCallback() {
31
- super.disconnectedCallback();
32
-
33
- if (this._labelNode) {
34
- this._labelNode.removeEventListener('click', this.__preventDuplicateLabelClick);
35
- }
36
- }
37
-
38
- /** @protected */
39
- _enhanceLightDomA11y() {
40
- if (this._inputNode) {
41
- this._inputNode.setAttribute('aria-labelledby', this._labelId);
42
- }
43
-
44
- if (this._labelNode) {
45
- this._labelNode.setAttribute('for', this._inputId);
46
- }
47
- }
48
-
49
- /**
50
- * The native platform fires an event for both the click on the label, and also
51
- * the subsequent click on the native input element caused by label click.
52
- * This results in two click events arriving at the host, but we only want one.
53
- * This method prevents the duplicate click and ensures the correct isTrusted event
54
- * with the correct event.target arrives at the host.
55
- * @private
56
- */
57
- __preventDuplicateLabelClick() {
58
- const inputClickHandler = (e) => {
59
- e.stopImmediatePropagation();
60
- this._inputNode.removeEventListener('click', inputClickHandler);
61
- };
62
- this._inputNode.addEventListener('click', inputClickHandler);
63
- }
64
- };
65
-
66
- /**
67
- * A mixin to link slotted `<input>` and `<label>` elements.
68
- */
69
- export const InputAriaMixin = dedupingMixin(InputAriaMixinImplementation);
@@ -1,40 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2021 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import { InputAriaMixin } from './input-aria-mixin.js';
7
- import { ValidateMixin } from './validate-mixin.js';
8
-
9
- /**
10
- * A mixin to forward properties to the native <input> element.
11
- */
12
- declare function InputPropsMixin<T extends new (...args: any[]) => {}>(base: T): T & InputPropsMixinConstructor;
13
-
14
- interface InputPropsMixinConstructor {
15
- new (...args: any[]): InputPropsMixin;
16
- }
17
-
18
- interface InputPropsMixin extends InputAriaMixin, ValidateMixin {
19
- /**
20
- * The name of this field.
21
- */
22
- name: string;
23
-
24
- /**
25
- * A hint to the user of what can be entered in the field.
26
- */
27
- placeholder: string;
28
-
29
- /**
30
- * When present, it specifies that the field is read-only.
31
- */
32
- readonly: boolean;
33
-
34
- /**
35
- * The text usually displayed in a tooltip popup when the mouse is over the field.
36
- */
37
- title: string;
38
- }
39
-
40
- export { InputPropsMixinConstructor, InputPropsMixin };