@vonage/vivid 3.39.0 → 3.41.0
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.
- package/accordion/index.js +2 -2
- package/accordion-item/index.js +2 -2
- package/alert/index.js +7 -5
- package/audio-player/index.js +33 -0
- package/avatar/index.js +2 -2
- package/badge/index.js +2 -2
- package/banner/index.js +9 -5
- package/breadcrumb/index.js +1 -1
- package/breadcrumb-item/index.js +3 -3
- package/button/index.js +5 -4
- package/calendar/index.js +1 -1
- package/calendar-event/index.js +1 -1
- package/card/index.js +4 -3
- package/checkbox/index.js +3 -3
- package/combobox/index.js +9 -7
- package/custom-elements.json +809 -5
- package/data-grid/index.js +3 -2
- package/date-picker/index.js +11 -9
- package/date-range-picker/index.js +11 -9
- package/dialog/index.js +10 -6
- package/divider/index.js +1 -1
- package/elevation/index.js +1 -1
- package/empty-state/index.js +2 -2
- package/fab/index.js +3 -3
- package/file-picker/index.js +6 -5
- package/focus/index.js +1 -1
- package/header/index.js +2 -2
- package/icon/index.js +1 -1
- package/index.js +60 -55
- package/layout/index.js +1 -1
- package/lib/alert/alert.d.ts +3 -1
- package/lib/alert/locale.d.ts +3 -0
- package/lib/audio-player/audio-player.d.ts +17 -0
- package/lib/audio-player/audio-player.template.d.ts +4 -0
- package/lib/audio-player/definition.d.ts +4 -0
- package/lib/audio-player/locale.d.ts +5 -0
- package/lib/banner/banner.d.ts +3 -1
- package/lib/banner/locale.d.ts +3 -0
- package/lib/card/card.d.ts +3 -0
- package/lib/card/card.template.d.ts +1 -1
- package/lib/card/definition.d.ts +1 -0
- package/lib/checkbox/checkbox.d.ts +2 -0
- package/lib/components.d.ts +2 -0
- package/lib/dialog/dialog.d.ts +4 -0
- package/lib/dialog/locale.d.ts +3 -0
- package/lib/enums.d.ts +2 -1
- package/lib/menu/menu.d.ts +1 -0
- package/lib/number-field/locale.d.ts +4 -0
- package/lib/number-field/number-field.d.ts +4 -2
- package/lib/progress/progress.d.ts +1 -0
- package/lib/progress-ring/progress-ring.d.ts +1 -0
- package/lib/radio/radio.d.ts +1 -0
- package/lib/selectable-box/definition.d.ts +3 -0
- package/lib/selectable-box/selectable-box.d.ts +12 -0
- package/lib/selectable-box/selectable-box.template.d.ts +4 -0
- package/lib/slider/definition.d.ts +1 -0
- package/lib/slider/slider.d.ts +5 -0
- package/lib/split-button/locale.d.ts +3 -0
- package/lib/split-button/split-button.d.ts +3 -1
- package/lib/text-area/text-area.d.ts +3 -0
- package/lib/text-field/text-field.d.ts +5 -2
- package/listbox/index.js +5 -4
- package/locales/en-GB.js +21 -0
- package/locales/en-US.js +21 -0
- package/locales/ja-JP.js +21 -0
- package/locales/zh-CN.js +21 -0
- package/menu/index.js +9 -8
- package/menu-item/index.js +3 -3
- package/nav/index.js +1 -1
- package/nav-disclosure/index.js +3 -3
- package/nav-item/index.js +3 -3
- package/note/index.js +2 -2
- package/number-field/index.js +8 -6
- package/option/index.js +3 -3
- package/package.json +1 -1
- package/pagination/index.js +6 -5
- package/popup/index.js +7 -6
- package/progress/index.js +1 -1
- package/progress-ring/index.js +1 -1
- package/radio/index.js +2 -2
- package/radio-group/index.js +2 -2
- package/select/index.js +10 -8
- package/selectable-box/index.js +23 -0
- package/shared/Reflector.js +65 -0
- package/shared/date-picker/calendar/segment.d.ts +21 -0
- package/shared/date-picker/date-picker-base.d.ts +1 -0
- package/shared/definition.js +3 -3
- package/shared/definition10.js +89 -227
- package/shared/definition11.js +151 -29
- package/shared/definition12.js +37 -766
- package/shared/definition13.js +747 -106
- package/shared/definition14.js +122 -192
- package/shared/definition15.js +156 -664
- package/shared/definition16.js +576 -1123
- package/shared/definition17.js +1278 -143
- package/shared/definition18.js +64 -298
- package/shared/definition19.js +358 -211
- package/shared/definition2.js +2 -2
- package/shared/definition20.js +259 -67
- package/shared/definition21.js +66 -58
- package/shared/definition22.js +43 -84
- package/shared/definition23.js +76 -2352
- package/shared/definition24.js +2362 -45
- package/shared/definition25.js +63 -27
- package/shared/definition26.js +24 -51
- package/shared/definition27.js +36 -813
- package/shared/definition28.js +837 -49
- package/shared/definition29.js +52 -89
- package/shared/definition3.js +1 -1
- package/shared/definition30.js +88 -24
- package/shared/definition31.js +25 -12
- package/shared/definition32.js +12 -52
- package/shared/definition33.js +28 -487
- package/shared/definition34.js +442 -197
- package/shared/definition35.js +260 -185
- package/shared/definition36.js +188 -69
- package/shared/definition37.js +72 -52
- package/shared/definition38.js +65 -421
- package/shared/definition39.js +435 -35
- package/shared/definition4.js +44 -16
- package/shared/definition40.js +32 -680
- package/shared/definition41.js +661 -77
- package/shared/definition42.js +103 -555
- package/shared/definition43.js +76 -103
- package/shared/definition44.js +522 -87
- package/shared/definition45.js +133 -22
- package/shared/definition46.js +131 -58
- package/shared/definition47.js +16 -501
- package/shared/definition48.js +69 -23
- package/shared/definition49.js +477 -108
- package/shared/definition5.js +160 -44
- package/shared/definition50.js +25 -271
- package/shared/definition51.js +103 -122
- package/shared/definition52.js +277 -122
- package/shared/definition53.js +274 -103
- package/shared/definition54.js +126 -71
- package/shared/definition55.js +128 -294
- package/shared/definition56.js +91 -13
- package/shared/definition57.js +298 -39
- package/shared/definition58.js +11 -175
- package/shared/definition59.js +47 -0
- package/shared/definition6.js +43 -33
- package/shared/definition60.js +181 -0
- package/shared/definition7.js +39 -105
- package/shared/definition8.js +122 -38
- package/shared/definition9.js +56 -89
- package/shared/enums.js +72 -0
- package/shared/icon.js +2 -2
- package/shared/index2.js +28 -1
- package/shared/key-codes.js +1 -1
- package/shared/key-codes2.js +9 -0
- package/shared/listbox.js +3 -8
- package/shared/localization/Locale.d.ts +12 -0
- package/shared/patterns/form-elements/form-elements.d.ts +6 -6
- package/shared/presentationDate.js +196 -143
- package/shared/radio.js +7 -0
- package/shared/text-field.js +1 -1
- package/shared/utils/Reflector.d.ts +8 -0
- package/shared/utils/randomId.d.ts +1 -0
- package/side-drawer/index.js +1 -1
- package/slider/index.js +3 -3
- package/split-button/index.js +6 -3
- package/style.css +889 -722
- package/styles/core/all.css +1 -1
- package/styles/core/theme.css +1 -1
- package/styles/core/typography.css +1 -1
- package/styles/tokens/theme-dark.css +4 -4
- package/styles/tokens/theme-light.css +4 -4
- package/styles/tokens/vivid-2-compat.css +1 -1
- package/switch/index.js +3 -3
- package/tab/index.js +3 -3
- package/tab-panel/index.js +1 -1
- package/tabs/index.js +5 -5
- package/tag/index.js +3 -3
- package/tag-group/index.js +1 -1
- package/text-area/index.js +4 -3
- package/text-field/index.js +4 -3
- package/toggletip/index.js +8 -7
- package/tooltip/index.js +8 -7
- package/tree-item/index.js +3 -3
- package/tree-view/index.js +1 -1
- package/vivid.api.json +392 -0
package/shared/definition34.js
CHANGED
|
@@ -1,209 +1,317 @@
|
|
|
1
|
-
import { F as FoundationElement,
|
|
2
|
-
import { a as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { F as FoundationElement, D as DOM, _ as __decorate, a as attr, n as nullableNumberConverter, o as observable, h as html, r as registerFactory } from './index.js';
|
|
2
|
+
import { B as Button, a as buttonRegistries } from './definition11.js';
|
|
3
|
+
import { D as Divider, a as dividerRegistries } from './definition21.js';
|
|
4
|
+
import { A as AffixIcon } from './affix.js';
|
|
5
|
+
import { e as errorText, f as formElements, F as FormElementSuccessText, a as FormElementHelperText, b as FormElementCharCount, g as getFeedbackTemplate } from './index2.js';
|
|
6
|
+
import { L as Localized } from './localized.js';
|
|
6
7
|
import { S as StartEnd } from './start-end.js';
|
|
7
8
|
import { a as applyMixins } from './apply-mixins.js';
|
|
8
|
-
import {
|
|
9
|
+
import { D as DelegatesARIATextbox } from './text-field2.js';
|
|
10
|
+
import { F as FormAssociated } from './form-associated.js';
|
|
11
|
+
import { f as keyArrowDown, e as keyArrowUp } from './key-codes.js';
|
|
12
|
+
import { S as Shape } from './enums.js';
|
|
9
13
|
import { f as focusTemplateFactory } from './focus2.js';
|
|
10
|
-
import './index2.js';
|
|
11
14
|
import { w as when } from './when.js';
|
|
15
|
+
import { r as ref } from './ref.js';
|
|
12
16
|
import { c as classNames } from './class-names.js';
|
|
13
17
|
|
|
18
|
+
class _NumberField extends FoundationElement {
|
|
19
|
+
}
|
|
14
20
|
/**
|
|
15
|
-
*
|
|
21
|
+
* A form-associated base class for the {@link @microsoft/fast-foundation#(NumberField:class)} component.
|
|
16
22
|
*
|
|
17
|
-
* @
|
|
18
|
-
* @public
|
|
23
|
+
* @internal
|
|
19
24
|
*/
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
(
|
|
23
|
-
|
|
25
|
+
class FormAssociatedNumberField extends FormAssociated(_NumberField) {
|
|
26
|
+
constructor() {
|
|
27
|
+
super(...arguments);
|
|
28
|
+
this.proxy = document.createElement("input");
|
|
29
|
+
}
|
|
24
30
|
}
|
|
31
|
+
|
|
25
32
|
/**
|
|
26
|
-
*
|
|
27
|
-
*
|
|
33
|
+
* A Number Field Custom HTML Element.
|
|
34
|
+
* Based largely on the {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/number | <input type="number" /> element }.
|
|
28
35
|
*
|
|
29
|
-
* @slot start - Content which can be provided before the
|
|
30
|
-
* @slot end - Content which can be provided after the
|
|
31
|
-
* @slot - The default slot for
|
|
32
|
-
* @
|
|
36
|
+
* @slot start - Content which can be provided before the number field input
|
|
37
|
+
* @slot end - Content which can be provided after the number field input
|
|
38
|
+
* @slot - The default slot for the label
|
|
39
|
+
* @slot step-up-glyph - The glyph for the step up control
|
|
40
|
+
* @slot step-down-glyph - The glyph for the step down control
|
|
41
|
+
* @csspart label - The label
|
|
42
|
+
* @csspart root - The element wrapping the control, including start and end slots
|
|
43
|
+
* @csspart control - The element representing the input
|
|
44
|
+
* @csspart controls - The step up and step down controls
|
|
45
|
+
* @csspart step-up - The step up control
|
|
46
|
+
* @csspart step-down - The step down control
|
|
47
|
+
* @fires input - Fires a custom 'input' event when the value has changed
|
|
48
|
+
* @fires change - Fires a custom 'change' event when the value has changed
|
|
33
49
|
*
|
|
34
50
|
* @public
|
|
35
51
|
*/
|
|
36
|
-
let
|
|
37
|
-
constructor(
|
|
38
|
-
super();
|
|
52
|
+
let NumberField$1 = class NumberField extends FormAssociatedNumberField {
|
|
53
|
+
constructor() {
|
|
54
|
+
super(...arguments);
|
|
39
55
|
/**
|
|
40
|
-
*
|
|
56
|
+
* When true, spin buttons will not be rendered
|
|
41
57
|
* @public
|
|
58
|
+
* @remarks
|
|
59
|
+
* HTML Attribute: autofocus
|
|
42
60
|
*/
|
|
43
|
-
this.
|
|
44
|
-
/**
|
|
45
|
-
* Tracks whether the "selected" property has been changed.
|
|
46
|
-
* @internal
|
|
47
|
-
*/
|
|
48
|
-
this.dirtySelected = false;
|
|
61
|
+
this.hideStep = false;
|
|
49
62
|
/**
|
|
50
|
-
*
|
|
51
|
-
*
|
|
63
|
+
* Amount to increment or decrement the value by
|
|
52
64
|
* @public
|
|
65
|
+
* @remarks
|
|
66
|
+
* HTMLAttribute: step
|
|
53
67
|
*/
|
|
54
|
-
this.
|
|
68
|
+
this.step = 1;
|
|
55
69
|
/**
|
|
56
|
-
*
|
|
70
|
+
* Flag to indicate that the value change is from the user input
|
|
71
|
+
* @internal
|
|
57
72
|
*/
|
|
58
|
-
this.
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
73
|
+
this.isUserInput = false;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Ensures that the max is greater than the min and that the value
|
|
77
|
+
* is less than the max
|
|
78
|
+
* @param previous - the previous max value
|
|
79
|
+
* @param next - updated max value
|
|
80
|
+
*
|
|
81
|
+
* @internal
|
|
82
|
+
*/
|
|
83
|
+
maxChanged(previous, next) {
|
|
84
|
+
var _a;
|
|
85
|
+
this.max = Math.max(next, (_a = this.min) !== null && _a !== void 0 ? _a : next);
|
|
86
|
+
const min = Math.min(this.min, this.max);
|
|
87
|
+
if (this.min !== undefined && this.min !== min) {
|
|
88
|
+
this.min = min;
|
|
70
89
|
}
|
|
71
|
-
this.
|
|
72
|
-
this.proxy.disabled = this.disabled;
|
|
90
|
+
this.value = this.getValidValue(this.value);
|
|
73
91
|
}
|
|
74
92
|
/**
|
|
75
|
-
*
|
|
93
|
+
* Ensures that the min is less than the max and that the value
|
|
94
|
+
* is greater than the min
|
|
95
|
+
* @param previous - previous min value
|
|
96
|
+
* @param next - updated min value
|
|
76
97
|
*
|
|
77
|
-
* @
|
|
78
|
-
|
|
98
|
+
* @internal
|
|
99
|
+
*/
|
|
100
|
+
minChanged(previous, next) {
|
|
101
|
+
var _a;
|
|
102
|
+
this.min = Math.min(next, (_a = this.max) !== null && _a !== void 0 ? _a : next);
|
|
103
|
+
const max = Math.max(this.min, this.max);
|
|
104
|
+
if (this.max !== undefined && this.max !== max) {
|
|
105
|
+
this.max = max;
|
|
106
|
+
}
|
|
107
|
+
this.value = this.getValidValue(this.value);
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* The value property, typed as a number.
|
|
79
111
|
*
|
|
80
112
|
* @public
|
|
81
113
|
*/
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
114
|
+
get valueAsNumber() {
|
|
115
|
+
return parseFloat(super.value);
|
|
116
|
+
}
|
|
117
|
+
set valueAsNumber(next) {
|
|
118
|
+
this.value = next.toString();
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Validates that the value is a number between the min and max
|
|
122
|
+
* @param previous - previous stored value
|
|
123
|
+
* @param next - value being updated
|
|
124
|
+
* @param updateControl - should the text field be updated with value, defaults to true
|
|
125
|
+
* @internal
|
|
126
|
+
*/
|
|
127
|
+
valueChanged(previous, next) {
|
|
128
|
+
this.value = this.getValidValue(next);
|
|
129
|
+
if (next !== this.value) {
|
|
85
130
|
return;
|
|
86
131
|
}
|
|
87
|
-
this.
|
|
132
|
+
if (this.control && !this.isUserInput) {
|
|
133
|
+
this.control.value = this.value;
|
|
134
|
+
}
|
|
135
|
+
super.valueChanged(previous, this.value);
|
|
136
|
+
if (previous !== undefined && !this.isUserInput) {
|
|
137
|
+
this.$emit("input");
|
|
138
|
+
this.$emit("change");
|
|
139
|
+
}
|
|
140
|
+
this.isUserInput = false;
|
|
141
|
+
}
|
|
142
|
+
/** {@inheritDoc (FormAssociated:interface).validate} */
|
|
143
|
+
validate() {
|
|
144
|
+
super.validate(this.control);
|
|
88
145
|
}
|
|
89
146
|
/**
|
|
90
|
-
*
|
|
91
|
-
* @param
|
|
92
|
-
* @param next - the current content value
|
|
147
|
+
* Sets the internal value to a valid number between the min and max properties
|
|
148
|
+
* @param value - user input
|
|
93
149
|
*
|
|
94
150
|
* @internal
|
|
95
151
|
*/
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
152
|
+
getValidValue(value) {
|
|
153
|
+
var _a, _b;
|
|
154
|
+
let validValue = parseFloat(parseFloat(value).toPrecision(12));
|
|
155
|
+
if (isNaN(validValue)) {
|
|
156
|
+
validValue = "";
|
|
99
157
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
if (!this.dirtySelected) {
|
|
104
|
-
this.selected = this.defaultSelected;
|
|
105
|
-
if (this.proxy instanceof HTMLOptionElement) {
|
|
106
|
-
this.proxy.selected = this.defaultSelected;
|
|
107
|
-
}
|
|
158
|
+
else {
|
|
159
|
+
validValue = Math.min(validValue, (_a = this.max) !== null && _a !== void 0 ? _a : validValue);
|
|
160
|
+
validValue = Math.max(validValue, (_b = this.min) !== null && _b !== void 0 ? _b : validValue).toString();
|
|
108
161
|
}
|
|
162
|
+
return validValue;
|
|
109
163
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
164
|
+
/**
|
|
165
|
+
* Increments the value using the step value
|
|
166
|
+
*
|
|
167
|
+
* @public
|
|
168
|
+
*/
|
|
169
|
+
stepUp() {
|
|
170
|
+
const value = parseFloat(this.value);
|
|
171
|
+
const stepUpValue = !isNaN(value)
|
|
172
|
+
? value + this.step
|
|
173
|
+
: this.min > 0
|
|
174
|
+
? this.min
|
|
175
|
+
: this.max < 0
|
|
176
|
+
? this.max
|
|
177
|
+
: !this.min
|
|
178
|
+
? this.step
|
|
179
|
+
: 0;
|
|
180
|
+
this.value = stepUpValue.toString();
|
|
115
181
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
182
|
+
/**
|
|
183
|
+
* Decrements the value using the step value
|
|
184
|
+
*
|
|
185
|
+
* @public
|
|
186
|
+
*/
|
|
187
|
+
stepDown() {
|
|
188
|
+
const value = parseFloat(this.value);
|
|
189
|
+
const stepDownValue = !isNaN(value)
|
|
190
|
+
? value - this.step
|
|
191
|
+
: this.min > 0
|
|
192
|
+
? this.min
|
|
193
|
+
: this.max < 0
|
|
194
|
+
? this.max
|
|
195
|
+
: !this.min
|
|
196
|
+
? 0 - this.step
|
|
197
|
+
: 0;
|
|
198
|
+
this.value = stepDownValue.toString();
|
|
121
199
|
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
200
|
+
/**
|
|
201
|
+
* Sets up the initial state of the number field
|
|
202
|
+
* @internal
|
|
203
|
+
*/
|
|
204
|
+
connectedCallback() {
|
|
205
|
+
super.connectedCallback();
|
|
206
|
+
this.proxy.setAttribute("type", "number");
|
|
207
|
+
this.validate();
|
|
208
|
+
this.control.value = this.value;
|
|
209
|
+
if (this.autofocus) {
|
|
210
|
+
DOM.queueUpdate(() => {
|
|
211
|
+
this.focus();
|
|
212
|
+
});
|
|
129
213
|
}
|
|
130
214
|
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
215
|
+
/**
|
|
216
|
+
* Selects all the text in the number field
|
|
217
|
+
*
|
|
218
|
+
* @public
|
|
219
|
+
*/
|
|
220
|
+
select() {
|
|
221
|
+
this.control.select();
|
|
222
|
+
/**
|
|
223
|
+
* The select event does not permeate the shadow DOM boundary.
|
|
224
|
+
* This fn effectively proxies the select event,
|
|
225
|
+
* emitting a `select` event whenever the internal
|
|
226
|
+
* control emits a `select` event
|
|
227
|
+
*/
|
|
228
|
+
this.$emit("select");
|
|
138
229
|
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
230
|
+
/**
|
|
231
|
+
* Handles the internal control's `input` event
|
|
232
|
+
* @internal
|
|
233
|
+
*/
|
|
234
|
+
handleTextInput() {
|
|
235
|
+
this.control.value = this.control.value.replace(/[^0-9\-+e.]/g, "");
|
|
236
|
+
this.isUserInput = true;
|
|
237
|
+
this.value = this.control.value;
|
|
142
238
|
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
239
|
+
/**
|
|
240
|
+
* Change event handler for inner control.
|
|
241
|
+
* @remarks
|
|
242
|
+
* "Change" events are not `composable` so they will not
|
|
243
|
+
* permeate the shadow DOM boundary. This fn effectively proxies
|
|
244
|
+
* the change event, emitting a `change` event whenever the internal
|
|
245
|
+
* control emits a `change` event
|
|
246
|
+
* @internal
|
|
247
|
+
*/
|
|
248
|
+
handleChange() {
|
|
249
|
+
this.$emit("change");
|
|
146
250
|
}
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
251
|
+
/**
|
|
252
|
+
* Handles the internal control's `keydown` event
|
|
253
|
+
* @internal
|
|
254
|
+
*/
|
|
255
|
+
handleKeyDown(e) {
|
|
256
|
+
const key = e.key;
|
|
257
|
+
switch (key) {
|
|
258
|
+
case keyArrowUp:
|
|
259
|
+
this.stepUp();
|
|
260
|
+
return false;
|
|
261
|
+
case keyArrowDown:
|
|
262
|
+
this.stepDown();
|
|
263
|
+
return false;
|
|
153
264
|
}
|
|
154
|
-
|
|
155
|
-
}
|
|
156
|
-
get value() {
|
|
157
|
-
var _a;
|
|
158
|
-
Observable.track(this, "value");
|
|
159
|
-
return (_a = this._value) !== null && _a !== void 0 ? _a : this.text;
|
|
265
|
+
return true;
|
|
160
266
|
}
|
|
161
|
-
|
|
162
|
-
|
|
267
|
+
/**
|
|
268
|
+
* Handles populating the input field with a validated value when
|
|
269
|
+
* leaving the input field.
|
|
270
|
+
* @internal
|
|
271
|
+
*/
|
|
272
|
+
handleBlur() {
|
|
273
|
+
this.control.value = this.value;
|
|
163
274
|
}
|
|
164
275
|
};
|
|
165
276
|
__decorate([
|
|
166
|
-
|
|
167
|
-
],
|
|
277
|
+
attr({ attribute: "readonly", mode: "boolean" })
|
|
278
|
+
], NumberField$1.prototype, "readOnly", void 0);
|
|
168
279
|
__decorate([
|
|
169
|
-
|
|
170
|
-
],
|
|
280
|
+
attr({ mode: "boolean" })
|
|
281
|
+
], NumberField$1.prototype, "autofocus", void 0);
|
|
171
282
|
__decorate([
|
|
172
|
-
|
|
173
|
-
],
|
|
283
|
+
attr({ attribute: "hide-step", mode: "boolean" })
|
|
284
|
+
], NumberField$1.prototype, "hideStep", void 0);
|
|
174
285
|
__decorate([
|
|
175
|
-
attr
|
|
176
|
-
],
|
|
286
|
+
attr
|
|
287
|
+
], NumberField$1.prototype, "placeholder", void 0);
|
|
177
288
|
__decorate([
|
|
178
|
-
attr
|
|
179
|
-
],
|
|
289
|
+
attr
|
|
290
|
+
], NumberField$1.prototype, "list", void 0);
|
|
180
291
|
__decorate([
|
|
181
|
-
|
|
182
|
-
],
|
|
292
|
+
attr({ converter: nullableNumberConverter })
|
|
293
|
+
], NumberField$1.prototype, "maxlength", void 0);
|
|
183
294
|
__decorate([
|
|
184
|
-
attr({
|
|
185
|
-
],
|
|
186
|
-
/**
|
|
187
|
-
* States and properties relating to the ARIA `option` role.
|
|
188
|
-
*
|
|
189
|
-
* @public
|
|
190
|
-
*/
|
|
191
|
-
class DelegatesARIAListboxOption {
|
|
192
|
-
}
|
|
295
|
+
attr({ converter: nullableNumberConverter })
|
|
296
|
+
], NumberField$1.prototype, "minlength", void 0);
|
|
193
297
|
__decorate([
|
|
194
|
-
|
|
195
|
-
],
|
|
298
|
+
attr({ converter: nullableNumberConverter })
|
|
299
|
+
], NumberField$1.prototype, "size", void 0);
|
|
196
300
|
__decorate([
|
|
197
|
-
|
|
198
|
-
],
|
|
301
|
+
attr({ converter: nullableNumberConverter })
|
|
302
|
+
], NumberField$1.prototype, "step", void 0);
|
|
199
303
|
__decorate([
|
|
200
|
-
|
|
201
|
-
],
|
|
304
|
+
attr({ converter: nullableNumberConverter })
|
|
305
|
+
], NumberField$1.prototype, "max", void 0);
|
|
306
|
+
__decorate([
|
|
307
|
+
attr({ converter: nullableNumberConverter })
|
|
308
|
+
], NumberField$1.prototype, "min", void 0);
|
|
202
309
|
__decorate([
|
|
203
310
|
observable
|
|
204
|
-
],
|
|
205
|
-
applyMixins(
|
|
206
|
-
|
|
311
|
+
], NumberField$1.prototype, "defaultSlottedNodes", void 0);
|
|
312
|
+
applyMixins(NumberField$1, StartEnd, DelegatesARIATextbox);
|
|
313
|
+
|
|
314
|
+
const styles = "/**\n * Do not edit directly\n * Generated on Wed, 22 Nov 2023 16:09:43 GMT\n */\n:host {\n display: inline-block;\n}\n\n.base {\n --_text-field-gutter: calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2))) / 2.5);\n --_text-field-icon-size: calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2))) / 2);\n display: inline-grid;\n width: 100%;\n gap: 4px;\n grid-template-columns: min-content 1fr max-content;\n}\n.base {\n --_appearance-color-text: var(--vvd-color-canvas-text);\n --_appearance-color-fill: var(--_connotation-color-backdrop);\n --_appearance-color-outline: var(--_connotation-color-intermediate);\n}\n.base.appearance-ghost {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: transparent;\n}\n.base:where(:hover, .hover):where(:not(:disabled, .disabled, .readonly)) {\n --_appearance-color-text: var(--vvd-color-canvas-text);\n --_appearance-color-fill: var(--_connotation-color-backdrop);\n --_appearance-color-outline: var(--_connotation-color-firm);\n}\n.base:where(:hover, .hover):where(:not(:disabled, .disabled, .readonly)).appearance-ghost {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: var(--_connotation-color-faint);\n --_appearance-color-outline: transparent;\n}\n.base:where(:disabled, .disabled) {\n --_appearance-color-text: var(--vvd-color-neutral-300);\n --_appearance-color-fill: var(--vvd-color-neutral-100);\n --_appearance-color-outline: var(--vvd-color-neutral-300);\n}\n.base:where(:disabled, .disabled).appearance-ghost {\n --_appearance-color-text: var(--vvd-color-neutral-300);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: transparent;\n}\n.base:where(.readonly):where(:not(:disabled, .disabled)) {\n --_appearance-color-text: var(--vvd-color-canvas-text);\n --_appearance-color-fill: var(--vvd-color-neutral-200);\n --_appearance-color-outline: var(--vvd-color-neutral-400);\n}\n.base:where(.readonly):where(:not(:disabled, .disabled)).appearance-ghost {\n --_appearance-color-text: var(--vvd-color-neutral-600);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: transparent;\n}\n.base.connotation-success {\n /* @cssprop [--vvd-text-field-success-primary=var(--vvd-color-success-500)] */\n --_connotation-color-primary: var(--vvd-text-field-success-primary, var(--vvd-color-success-500));\n /* @cssprop [--vvd-text-field-success-backdrop=var(--vvd-color-success-50)] */\n --_connotation-color-backdrop: var(--vvd-text-field-success-backdrop, var(--vvd-color-success-50));\n /* @cssprop [--vvd-text-field-success-intermediate=var(--vvd-color-success-500)] */\n --_connotation-color-intermediate: var(--vvd-text-field-success-intermediate, var(--vvd-color-success-500));\n /* @cssprop [--vvd-text-field-success-firm=var(--vvd-color-success-600)] */\n --_connotation-color-firm: var(--vvd-text-field-success-firm, var(--vvd-color-success-600));\n /* @cssprop [--vvd-text-field-success-faint=var(--vvd-color-success-50)] */\n --_connotation-color-faint: var(--vvd-text-field-success-faint, var(--vvd-color-success-50));\n /* @cssprop [--vvd-text-field-success-soft=var(--vvd-color-success-100)] */\n --_connotation-color-soft: var(--vvd-text-field-success-soft, var(--vvd-color-success-100));\n}\n.base.connotation-alert {\n /* @cssprop [--vvd-text-field-alert-primary=var(--vvd-color-alert-500)] */\n --_connotation-color-primary: var(--vvd-text-field-alert-primary, var(--vvd-color-alert-500));\n /* @cssprop [--vvd-text-field-alert-backdrop=var(--vvd-color-alert-50)] */\n --_connotation-color-backdrop: var(--vvd-text-field-alert-backdrop, var(--vvd-color-alert-50));\n /* @cssprop [--vvd-text-field-alert-intermediate=var(--vvd-color-alert-500)] */\n --_connotation-color-intermediate: var(--vvd-text-field-alert-intermediate, var(--vvd-color-alert-500));\n /* @cssprop [--vvd-text-field-alert-firm=var(--vvd-color-alert-600)] */\n --_connotation-color-firm: var(--vvd-text-field-alert-firm, var(--vvd-color-alert-600));\n /* @cssprop [--vvd-text-field-alert-faint=var(--vvd-color-alert-50)] */\n --_connotation-color-faint: var(--vvd-text-field-alert-faint, var(--vvd-color-alert-50));\n /* @cssprop [--vvd-text-field-alert-soft=var(--vvd-color-alert-100)] */\n --_connotation-color-soft: var(--vvd-text-field-alert-soft, var(--vvd-color-alert-100));\n}\n.base:not(.connotation-success, .connotation-alert) {\n /* @cssprop [--vvd-text-field-accent-primary=var(--vvd-color-canvas-text)] */\n --_connotation-color-primary: var(--vvd-text-field-accent-primary, var(--vvd-color-canvas-text));\n /* @cssprop [--vvd-text-field-accent-backdrop=var(--vvd-color-canvas)] */\n --_connotation-color-backdrop: var(--vvd-text-field-accent-backdrop, var(--vvd-color-canvas));\n /* @cssprop [--vvd-text-field-accent-intermediate=var(--vvd-color-neutral-500)] */\n --_connotation-color-intermediate: var(--vvd-text-field-accent-intermediate, var(--vvd-color-neutral-500));\n /* @cssprop [--vvd-text-field-accent-firm=var(--vvd-color-canvas-text)] */\n --_connotation-color-firm: var(--vvd-text-field-accent-firm, var(--vvd-color-canvas-text));\n /* @cssprop [--vvd-text-field-accent-faint=var(--vvd-color-neutral-50)] */\n --_connotation-color-faint: var(--vvd-text-field-accent-faint, var(--vvd-color-neutral-50));\n /* @cssprop [--vvd-text-field-accent-soft=var(--vvd-color-neutral-100)] */\n --_connotation-color-soft: var(--vvd-text-field-accent-soft, var(--vvd-color-neutral-100));\n}\n@supports (user-select: none) {\n .base {\n user-select: none;\n }\n}\n.base:not(.disabled) {\n --_low-ink-color: var(--vvd-color-neutral-600);\n}\n.base.disabled {\n --_low-ink-color: var(--_appearance-color-text);\n}\n\n.label:not(slot),\n.label::slotted(label) {\n color: var(--vvd-color-canvas-text);\n contain: inline-size;\n font: var(--vvd-typography-base);\n grid-column: 1/4;\n grid-row: 1;\n}\n.char-count + .label:not(slot),\n.char-count + .label::slotted(label) {\n grid-column: 1/3;\n}\n\n.char-count {\n color: var(--_low-ink-color);\n font: var(--vvd-typography-base);\n grid-column: 3/4;\n}\n\n.fieldset {\n position: relative;\n display: flex;\n align-items: center;\n background-color: var(--_appearance-color-fill);\n font: var(--vvd-typography-base);\n grid-column: 1/4;\n padding-block: 0;\n transition: color 0.2s, background-color 0.2s;\n /* Shape */\n}\n.fieldset::after {\n position: absolute;\n display: block;\n block-size: 100%;\n border-radius: inherit;\n box-shadow: inset 0 0 0 1px var(--_appearance-color-outline);\n content: \"\";\n inline-size: 100%;\n pointer-events: none;\n transition: box-shadow 0.2s;\n}\n.fieldset:focus-visible {\n outline: none;\n}\n.base > .fieldset {\n block-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2)));\n}\n.base:not(.shape-pill) .fieldset {\n border-radius: 6px;\n}\n.base.shape-pill .fieldset {\n border-radius: 24px;\n}\n\n.wrapper {\n block-size: 100%;\n border-radius: inherit;\n inline-size: 100%;\n}\n.wrapper:focus-visible {\n outline: none;\n}\n\n.control:not(slot), .control::slotted(input) {\n width: 100%;\n box-sizing: border-box;\n border: 0 none;\n appearance: none; /* for box-shadow visibility on IOS */\n background-color: transparent;\n block-size: 100%;\n border-radius: inherit;\n color: inherit;\n font: inherit;\n padding-block: 0;\n padding-inline-end: var(--_text-field-gutter);\n padding-inline-start: var(--_text-field-gutter);\n}\n.control:not(slot):disabled, .control::slotted(input:disabled) {\n cursor: not-allowed;\n opacity: 1; /* 2. correct opacity on iOS */\n -webkit-text-fill-color: var(--_appearance-color-text); /* 1. sets text fill to current `color` for safari */\n}\n.control:not(slot)::placeholder {\n opacity: 1 !important; /* 2. correct opacity on iOS */\n -webkit-text-fill-color: var(--_low-ink-color) !important; /* 1. sets text fill to current `color` for safari */\n}\n.control:not(slot):focus-visible, .control::slotted(input:focus-visible) {\n outline: none;\n}\n.has-icon .control:not(slot), .has-icon .control::slotted(input) {\n padding-inline-start: calc(var(--_text-field-icon-size) + var(--_text-field-gutter) * 2);\n}\n\n.icon {\n position: absolute;\n z-index: 1;\n color: var(--_low-ink-color);\n font-size: var(--_text-field-icon-size);\n inset-block-start: 50%;\n inset-inline-start: calc(100% + var(--_text-field-gutter));\n line-height: 1;\n transform: translateY(-50%);\n}\n\n.leading-items-wrapper {\n position: relative;\n}\n.base.no-leading .leading-items-wrapper {\n display: none;\n}\n\n.action-items-wrapper {\n margin-inline-end: 4px;\n}\n.base:not(.action-items) .action-items-wrapper {\n display: none;\n}\n\n.focus-indicator {\n --focus-stroke-gap-color: transparent;\n pointer-events: none;\n}\n.wrapper:not(:focus-visible, :focus-within) > .focus-indicator, .fieldset:not(:focus-visible, :focus-within) > .focus-indicator {\n display: none;\n}\n\n.control {\n padding-inline-end: 70px !important;\n}\n.control::-webkit-outer-spin-button, .control::-webkit-inner-spin-button {\n appearance: none;\n}\n.control-buttons {\n position: absolute;\n z-index: 1;\n right: 3px;\n display: flex;\n}\n.readonly .control-buttons, .disabled .control-buttons {\n pointer-events: none;\n}\n.control-buttons .divider {\n margin-block: 8px;\n}\n.control-buttons > * {\n flex-shrink: 0;\n}\n\n.disabled .focus-indicator {\n display: none;\n pointer-events: none;\n}";
|
|
207
315
|
|
|
208
316
|
var __defProp = Object.defineProperty;
|
|
209
317
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -216,74 +324,211 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
216
324
|
__defProp(target, key, result);
|
|
217
325
|
return result;
|
|
218
326
|
};
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
327
|
+
const STEP_DIRECTION = {
|
|
328
|
+
up: 1,
|
|
329
|
+
down: -1
|
|
330
|
+
};
|
|
331
|
+
const PROXY_REFLECTED_ATTRIBUTES = {
|
|
332
|
+
max: true,
|
|
333
|
+
min: true
|
|
334
|
+
};
|
|
335
|
+
function makeStep(element, direction) {
|
|
336
|
+
const value = parseFloat(element.value);
|
|
337
|
+
const stepUpValue = !isNaN(value) ? value + direction * element.step : element.min > 0 ? element.min : element.max < 0 ? element.max : !element.min ? direction * element.step : 0;
|
|
338
|
+
element.value = Number(stepUpValue.toFixed(12)).toString();
|
|
339
|
+
}
|
|
340
|
+
let NumberField = class extends NumberField$1 {
|
|
341
|
+
constructor() {
|
|
342
|
+
super(...arguments);
|
|
343
|
+
this.incrementButtonAriaLabel = null;
|
|
344
|
+
this.decrementButtonAriaLabel = null;
|
|
223
345
|
}
|
|
224
|
-
|
|
225
|
-
|
|
346
|
+
stepChanged(_previous, next) {
|
|
347
|
+
this.proxy.setAttribute("step", Number.isFinite(next) ? next.toString() : "");
|
|
226
348
|
}
|
|
227
|
-
|
|
228
|
-
|
|
349
|
+
attributeChangedCallback(name, previous, next) {
|
|
350
|
+
super.attributeChangedCallback(name, previous, next);
|
|
351
|
+
if (PROXY_REFLECTED_ATTRIBUTES[name]) {
|
|
352
|
+
this.proxy.setAttribute(name, next);
|
|
353
|
+
}
|
|
229
354
|
}
|
|
230
|
-
|
|
231
|
-
this.
|
|
355
|
+
stepUp() {
|
|
356
|
+
makeStep(this, STEP_DIRECTION.up);
|
|
232
357
|
}
|
|
233
|
-
|
|
234
|
-
|
|
358
|
+
stepDown() {
|
|
359
|
+
makeStep(this, STEP_DIRECTION.down);
|
|
360
|
+
}
|
|
361
|
+
};
|
|
362
|
+
__decorateClass([
|
|
363
|
+
attr({ attribute: "increment-button-aria-label" })
|
|
364
|
+
], NumberField.prototype, "incrementButtonAriaLabel", 2);
|
|
365
|
+
__decorateClass([
|
|
366
|
+
attr({ attribute: "decrement-button-aria-label" })
|
|
367
|
+
], NumberField.prototype, "decrementButtonAriaLabel", 2);
|
|
235
368
|
__decorateClass([
|
|
236
|
-
attr
|
|
237
|
-
|
|
238
|
-
})
|
|
239
|
-
], ListboxOption.prototype, "_text", 2);
|
|
369
|
+
attr
|
|
370
|
+
], NumberField.prototype, "appearance", 2);
|
|
240
371
|
__decorateClass([
|
|
241
|
-
attr
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
372
|
+
attr
|
|
373
|
+
], NumberField.prototype, "shape", 2);
|
|
374
|
+
__decorateClass([
|
|
375
|
+
attr
|
|
376
|
+
], NumberField.prototype, "autoComplete", 2);
|
|
377
|
+
NumberField = __decorateClass([
|
|
378
|
+
errorText,
|
|
379
|
+
formElements
|
|
380
|
+
], NumberField);
|
|
381
|
+
const numberInput = document.createElement("input");
|
|
382
|
+
numberInput.type = "number";
|
|
383
|
+
NumberField.prototype.getValidValue = function(value) {
|
|
384
|
+
if (!this.isUserInput) {
|
|
385
|
+
numberInput.value = value;
|
|
386
|
+
return numberInput.value;
|
|
387
|
+
}
|
|
388
|
+
if (value === "" || value === "-" || value === ".") {
|
|
389
|
+
return value;
|
|
390
|
+
}
|
|
391
|
+
const decimalSplit = value.split(".");
|
|
392
|
+
let valueSuffix = "";
|
|
393
|
+
if (decimalSplit.length === 2 && decimalSplit[1] === "") {
|
|
394
|
+
valueSuffix = ".";
|
|
395
|
+
numberInput.value = value.slice(0, -1);
|
|
396
|
+
} else {
|
|
397
|
+
numberInput.value = value;
|
|
398
|
+
}
|
|
399
|
+
if (numberInput.value === "") {
|
|
400
|
+
return this.currentValue;
|
|
401
|
+
}
|
|
402
|
+
return numberInput.value + valueSuffix;
|
|
403
|
+
};
|
|
404
|
+
applyMixins(NumberField, Localized, AffixIcon, FormElementCharCount, FormElementHelperText, FormElementSuccessText);
|
|
246
405
|
|
|
247
|
-
const
|
|
248
|
-
|
|
406
|
+
const getStateClasses = ({
|
|
407
|
+
errorValidationMessage,
|
|
249
408
|
disabled,
|
|
250
|
-
|
|
251
|
-
|
|
409
|
+
value,
|
|
410
|
+
readOnly,
|
|
411
|
+
placeholder,
|
|
412
|
+
appearance,
|
|
413
|
+
shape,
|
|
414
|
+
label,
|
|
415
|
+
successText
|
|
252
416
|
}) => classNames(
|
|
253
|
-
"
|
|
417
|
+
["error connotation-alert", Boolean(errorValidationMessage)],
|
|
254
418
|
["disabled", disabled],
|
|
255
|
-
["
|
|
256
|
-
["
|
|
257
|
-
["
|
|
419
|
+
["has-value", Boolean(value)],
|
|
420
|
+
["readonly", readOnly],
|
|
421
|
+
["placeholder", Boolean(placeholder)],
|
|
422
|
+
[`appearance-${appearance}`, Boolean(appearance)],
|
|
423
|
+
[`shape-${shape}`, Boolean(shape)],
|
|
424
|
+
["no-label", !label],
|
|
425
|
+
["success connotation-success", !!successText]
|
|
258
426
|
);
|
|
259
|
-
|
|
260
|
-
const affixIconTemplate = affixIconTemplateFactory(context);
|
|
261
|
-
const focusTemplate = focusTemplateFactory(context);
|
|
427
|
+
function renderLabel() {
|
|
262
428
|
return html`
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
429
|
+
<label for="control" class="label">
|
|
430
|
+
${(x) => x.label}
|
|
431
|
+
</label>`;
|
|
432
|
+
}
|
|
433
|
+
function setControlButtonShape(numberField) {
|
|
434
|
+
return numberField.shape === Shape.Pill ? Shape.Pill : null;
|
|
435
|
+
}
|
|
436
|
+
function getTabIndex(numberField) {
|
|
437
|
+
return numberField.disabled || numberField.readOnly ? "-1" : null;
|
|
438
|
+
}
|
|
439
|
+
function numberControlButtons(context) {
|
|
440
|
+
const buttonTag = context.tagFor(Button);
|
|
441
|
+
const dividerTag = context.tagFor(Divider);
|
|
442
|
+
return html`
|
|
443
|
+
<div class="control-buttons"
|
|
444
|
+
?inert="${(x) => x.disabled || x.readOnly}">
|
|
445
|
+
<${buttonTag} id="subtract" icon="minus-line"
|
|
446
|
+
aria-label=${(x) => x.decrementButtonAriaLabel || x.locale.numberField.decrementButtonLabel}
|
|
447
|
+
shape="${setControlButtonShape}"
|
|
448
|
+
type="button"
|
|
449
|
+
size="condensed"
|
|
450
|
+
tabindex="${getTabIndex}"
|
|
451
|
+
@click="${(x) => x.stepDown()}"></${buttonTag}>
|
|
452
|
+
<${dividerTag} class="divider" orientation="vertical"></${dividerTag}>
|
|
453
|
+
<${buttonTag} id="add" icon="plus-line"
|
|
454
|
+
aria-label=${(x) => x.incrementButtonAriaLabel || x.locale.numberField.incrementButtonLabel}
|
|
455
|
+
shape="${setControlButtonShape}"
|
|
456
|
+
type="button"
|
|
457
|
+
size="condensed"
|
|
458
|
+
tabindex="${getTabIndex}"
|
|
459
|
+
@click="${(x) => x.stepUp()}"></${buttonTag}>
|
|
460
|
+
</div>
|
|
276
461
|
`;
|
|
462
|
+
}
|
|
463
|
+
const NumberFieldTemplate = (context) => {
|
|
464
|
+
const focusTemplate = focusTemplateFactory(context);
|
|
465
|
+
return html`
|
|
466
|
+
<div class="base ${getStateClasses}">
|
|
467
|
+
${when((x) => x.label, renderLabel())}
|
|
468
|
+
<div class="fieldset">
|
|
469
|
+
<div class="wrapper">
|
|
470
|
+
<input class="control"
|
|
471
|
+
id="control"
|
|
472
|
+
@input="${(x) => x.handleTextInput()}"
|
|
473
|
+
@change="${(x) => x.handleChange()}"
|
|
474
|
+
?autofocus="${(x) => x.autofocus}"
|
|
475
|
+
?disabled="${(x) => x.disabled}"
|
|
476
|
+
list="${(x) => x.list}"
|
|
477
|
+
step="${(x) => x.step ? x.step : null}"
|
|
478
|
+
max="${(x) => x.max}"
|
|
479
|
+
min="${(x) => x.min}"
|
|
480
|
+
maxlength="${(x) => x.maxlength}"
|
|
481
|
+
minlength="${(x) => x.minlength}"
|
|
482
|
+
placeholder="${(x) => x.placeholder}"
|
|
483
|
+
?readonly="${(x) => x.readOnly}"
|
|
484
|
+
?required="${(x) => x.required}"
|
|
485
|
+
size="${(x) => x.size}"
|
|
486
|
+
autocomplete="${(x) => x.autoComplete}"
|
|
487
|
+
name="${(x) => x.name}"
|
|
488
|
+
?spellcheck="${(x) => x.spellcheck}"
|
|
489
|
+
:value="${(x) => x.value}"
|
|
490
|
+
type="text"
|
|
491
|
+
aria-atomic="${(x) => x.ariaAtomic}"
|
|
492
|
+
aria-busy="${(x) => x.ariaBusy}"
|
|
493
|
+
aria-controls="${(x) => x.ariaControls}"
|
|
494
|
+
aria-current="${(x) => x.ariaCurrent}"
|
|
495
|
+
aria-describedby="${(x) => x.ariaDescribedby}"
|
|
496
|
+
aria-details="${(x) => x.ariaDetails}"
|
|
497
|
+
aria-disabled="${(x) => x.ariaDisabled}"
|
|
498
|
+
aria-errormessage="${(x) => x.ariaErrormessage}"
|
|
499
|
+
aria-flowto="${(x) => x.ariaFlowto}"
|
|
500
|
+
aria-haspopup="${(x) => x.ariaHaspopup}"
|
|
501
|
+
aria-hidden="${(x) => x.ariaHidden}"
|
|
502
|
+
aria-invalid="${(x) => x.ariaInvalid}"
|
|
503
|
+
aria-keyshortcuts="${(x) => x.ariaKeyshortcuts}"
|
|
504
|
+
aria-label="${(x) => x.ariaLabel}"
|
|
505
|
+
aria-labelledby="${(x) => x.ariaLabelledby}"
|
|
506
|
+
aria-live="${(x) => x.ariaLive}"
|
|
507
|
+
aria-owns="${(x) => x.ariaOwns}"
|
|
508
|
+
aria-relevant="${(x) => x.ariaRelevant}"
|
|
509
|
+
aria-roledescription="${(x) => x.ariaRoledescription}"
|
|
510
|
+
${ref("control")}
|
|
511
|
+
/>
|
|
512
|
+
${() => focusTemplate}
|
|
513
|
+
</div>
|
|
514
|
+
${() => numberControlButtons(context)}
|
|
515
|
+
</div>
|
|
516
|
+
${when((x) => !x.successText && !x.errorValidationMessage && x.helperText?.length, getFeedbackTemplate("helper", context))}
|
|
517
|
+
${when((x) => !x.successText && x.errorValidationMessage, getFeedbackTemplate("error", context))}
|
|
518
|
+
${when((x) => x.successText, getFeedbackTemplate("success", context))}
|
|
519
|
+
</div>
|
|
520
|
+
`;
|
|
277
521
|
};
|
|
278
522
|
|
|
279
|
-
const
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
523
|
+
const numberFieldDefinition = NumberField.compose({
|
|
524
|
+
baseName: "number-field",
|
|
525
|
+
template: NumberFieldTemplate,
|
|
526
|
+
styles,
|
|
527
|
+
shadowOptions: {
|
|
528
|
+
delegatesFocus: true
|
|
529
|
+
}
|
|
285
530
|
});
|
|
286
|
-
const
|
|
287
|
-
const
|
|
531
|
+
const numberFieldRegistries = [numberFieldDefinition(), ...buttonRegistries, ...dividerRegistries];
|
|
532
|
+
const registerNumberField = registerFactory(numberFieldRegistries);
|
|
288
533
|
|
|
289
|
-
export {
|
|
534
|
+
export { numberFieldRegistries as a, numberFieldDefinition as n, registerNumberField as r };
|