@spectrum-web-components/number-field 1.0.0 → 1.0.2
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/package.json +10 -11
- package/src/NumberField.dev.js +11 -5
- package/src/NumberField.dev.js.map +2 -2
- package/src/NumberField.js +5 -5
- package/src/NumberField.js.map +3 -3
- package/LICENSE +0 -201
- package/stories/number-field-sizes.stories.js +0 -29
- package/stories/number-field-sizes.stories.js.map +0 -7
- package/stories/number-field.stories.js +0 -425
- package/stories/number-field.stories.js.map +0 -7
- package/test/benchmark/basic-test.js +0 -8
- package/test/benchmark/basic-test.js.map +0 -7
- package/test/helpers.js +0 -45
- package/test/helpers.js.map +0 -7
- package/test/inputs.test.js +0 -421
- package/test/inputs.test.js.map +0 -7
- package/test/number-field-memory.test.js +0 -5
- package/test/number-field-memory.test.js.map +0 -7
- package/test/number-field-sizes.test-vrt.js +0 -5
- package/test/number-field-sizes.test-vrt.js.map +0 -7
- package/test/number-field.test-vrt.js +0 -5
- package/test/number-field.test-vrt.js.map +0 -7
- package/test/number-field.test.js +0 -1739
- package/test/number-field.test.js.map +0 -7
package/test/inputs.test.js
DELETED
|
@@ -1,421 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
import { html } from "@spectrum-web-components/base";
|
|
3
|
-
import { elementUpdated, expect } from "@open-wc/testing";
|
|
4
|
-
import { getElFrom } from "./helpers.js";
|
|
5
|
-
import { createLanguageContext } from "../../../tools/reactive-controllers/test/helpers.js";
|
|
6
|
-
import { shouldPolyfill } from "@formatjs/intl-numberformat/should-polyfill.js";
|
|
7
|
-
import "@spectrum-web-components/number-field/sp-number-field.js";
|
|
8
|
-
import { remapMultiByteCharacters } from "@spectrum-web-components/number-field";
|
|
9
|
-
import {
|
|
10
|
-
currency,
|
|
11
|
-
decimals,
|
|
12
|
-
Default,
|
|
13
|
-
minMax,
|
|
14
|
-
percents
|
|
15
|
-
} from "../stories/number-field.stories.js";
|
|
16
|
-
import { sendKeys } from "@web/test-runner-commands";
|
|
17
|
-
describe("NumberField - inputs", () => {
|
|
18
|
-
before(async () => {
|
|
19
|
-
const shouldPolyfillEn = shouldPolyfill("en");
|
|
20
|
-
const shouldPolyfillEs = shouldPolyfill("es");
|
|
21
|
-
const shouldPolyfillFr = shouldPolyfill("fr");
|
|
22
|
-
if (shouldPolyfillEn || shouldPolyfillEs || shouldPolyfillFr) {
|
|
23
|
-
await import("@formatjs/intl-numberformat/polyfill-force.js");
|
|
24
|
-
}
|
|
25
|
-
if (shouldPolyfillEn) {
|
|
26
|
-
await import("@formatjs/intl-numberformat/locale-data/en.js");
|
|
27
|
-
}
|
|
28
|
-
if (shouldPolyfillEs) {
|
|
29
|
-
await import("@formatjs/intl-numberformat/locale-data/es.js");
|
|
30
|
-
}
|
|
31
|
-
if (shouldPolyfillFr) {
|
|
32
|
-
await import("@formatjs/intl-numberformat/locale-data/fr.js");
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
describe("keystroke prevention", () => {
|
|
36
|
-
it("converts 2 byte characters, default", async () => {
|
|
37
|
-
const el = await getElFrom(html`
|
|
38
|
-
${Default()}
|
|
39
|
-
`);
|
|
40
|
-
await elementUpdated(el);
|
|
41
|
-
el.focus();
|
|
42
|
-
await sendKeys({
|
|
43
|
-
type: "\uFF13\u3001\uFF15\uFF16\uFF17\u3001\uFF18\uFF19\uFF10\u3002\uFF11"
|
|
44
|
-
});
|
|
45
|
-
await elementUpdated(el);
|
|
46
|
-
expect(el.formattedValue).to.equal("3,567,890.1");
|
|
47
|
-
});
|
|
48
|
-
it("converts 2 byte characters, percents", async () => {
|
|
49
|
-
const el = await getElFrom(html`
|
|
50
|
-
${percents()}
|
|
51
|
-
`);
|
|
52
|
-
await elementUpdated(el);
|
|
53
|
-
el.focus();
|
|
54
|
-
await sendKeys({
|
|
55
|
-
type: "\uFF12\uFF14\uFF05"
|
|
56
|
-
});
|
|
57
|
-
await elementUpdated(el);
|
|
58
|
-
expect(el.formattedValue).to.equal("24%");
|
|
59
|
-
});
|
|
60
|
-
it('prevents second "." in EN', async () => {
|
|
61
|
-
const el = await getElFrom(html`
|
|
62
|
-
${Default()}
|
|
63
|
-
`);
|
|
64
|
-
el.formatOptions = {
|
|
65
|
-
maximumFractionDigits: 2
|
|
66
|
-
};
|
|
67
|
-
await elementUpdated(el);
|
|
68
|
-
el.focus();
|
|
69
|
-
await sendKeys({
|
|
70
|
-
type: "1.1.1"
|
|
71
|
-
});
|
|
72
|
-
await elementUpdated(el);
|
|
73
|
-
expect(el.formattedValue).to.equal("1.11");
|
|
74
|
-
});
|
|
75
|
-
it("prevents text characters", async () => {
|
|
76
|
-
const el = await getElFrom(html`
|
|
77
|
-
${Default()}
|
|
78
|
-
`);
|
|
79
|
-
el.formatOptions = {
|
|
80
|
-
maximumFractionDigits: 1
|
|
81
|
-
};
|
|
82
|
-
await elementUpdated(el);
|
|
83
|
-
el.focus();
|
|
84
|
-
await sendKeys({
|
|
85
|
-
type: "D2.2"
|
|
86
|
-
});
|
|
87
|
-
await elementUpdated(el);
|
|
88
|
-
expect(el.formattedValue).to.equal("2.2");
|
|
89
|
-
el.value = NaN;
|
|
90
|
-
await sendKeys({
|
|
91
|
-
type: "8u23.s7"
|
|
92
|
-
});
|
|
93
|
-
await elementUpdated(el);
|
|
94
|
-
expect(el.formattedValue).to.equal("823.7");
|
|
95
|
-
});
|
|
96
|
-
it('allows "-" to start', async () => {
|
|
97
|
-
const el = await getElFrom(html`
|
|
98
|
-
${Default()}
|
|
99
|
-
`);
|
|
100
|
-
await elementUpdated(el);
|
|
101
|
-
el.focus();
|
|
102
|
-
await sendKeys({
|
|
103
|
-
type: "-54"
|
|
104
|
-
});
|
|
105
|
-
await elementUpdated(el);
|
|
106
|
-
expect(el.formattedValue).to.equal("-54");
|
|
107
|
-
});
|
|
108
|
-
it('prevents "-" not at the start', async () => {
|
|
109
|
-
const el = await getElFrom(html`
|
|
110
|
-
${Default()}
|
|
111
|
-
`);
|
|
112
|
-
await elementUpdated(el);
|
|
113
|
-
el.focus();
|
|
114
|
-
await sendKeys({
|
|
115
|
-
type: "54-"
|
|
116
|
-
});
|
|
117
|
-
await elementUpdated(el);
|
|
118
|
-
expect(el.formattedValue).to.equal("54");
|
|
119
|
-
el.value = NaN;
|
|
120
|
-
await sendKeys({
|
|
121
|
-
type: "5-4"
|
|
122
|
-
});
|
|
123
|
-
await elementUpdated(el);
|
|
124
|
-
expect(el.formattedValue).to.equal("54");
|
|
125
|
-
});
|
|
126
|
-
it('prevent "+" to start, normally', async () => {
|
|
127
|
-
const el = await getElFrom(html`
|
|
128
|
-
${Default()}
|
|
129
|
-
`);
|
|
130
|
-
await elementUpdated(el);
|
|
131
|
-
el.focus();
|
|
132
|
-
await sendKeys({
|
|
133
|
-
type: "+54"
|
|
134
|
-
});
|
|
135
|
-
await elementUpdated(el);
|
|
136
|
-
expect(el.formattedValue).to.equal("54");
|
|
137
|
-
});
|
|
138
|
-
it('allow "+" to start when "signDisplay: always"', async () => {
|
|
139
|
-
const el = await getElFrom(html`
|
|
140
|
-
${Default()}
|
|
141
|
-
`);
|
|
142
|
-
await elementUpdated(el);
|
|
143
|
-
el.formatOptions = {
|
|
144
|
-
signDisplay: "always"
|
|
145
|
-
};
|
|
146
|
-
el.focus();
|
|
147
|
-
await sendKeys({
|
|
148
|
-
type: "+54"
|
|
149
|
-
});
|
|
150
|
-
await elementUpdated(el);
|
|
151
|
-
expect(el.formattedValue).to.equal("+54");
|
|
152
|
-
});
|
|
153
|
-
it('prevents "%" when when not percents', async () => {
|
|
154
|
-
const el = await getElFrom(html`
|
|
155
|
-
${Default()}
|
|
156
|
-
`);
|
|
157
|
-
await elementUpdated(el);
|
|
158
|
-
el.focus();
|
|
159
|
-
await sendKeys({
|
|
160
|
-
type: "63%"
|
|
161
|
-
});
|
|
162
|
-
await elementUpdated(el);
|
|
163
|
-
expect(el.formattedValue).to.equal("63");
|
|
164
|
-
el.blur();
|
|
165
|
-
await elementUpdated(el);
|
|
166
|
-
expect(el.formattedValue).to.equal("63");
|
|
167
|
-
});
|
|
168
|
-
it('allows "%" when percents, and keeps "%" on blur', async () => {
|
|
169
|
-
const el = await getElFrom(html`
|
|
170
|
-
${percents()}
|
|
171
|
-
`);
|
|
172
|
-
await elementUpdated(el);
|
|
173
|
-
el.focus();
|
|
174
|
-
await sendKeys({
|
|
175
|
-
type: "63%"
|
|
176
|
-
});
|
|
177
|
-
await elementUpdated(el);
|
|
178
|
-
expect(el.formattedValue).to.equal("63%");
|
|
179
|
-
el.blur();
|
|
180
|
-
await elementUpdated(el);
|
|
181
|
-
expect(el.formattedValue).to.equal("63%");
|
|
182
|
-
});
|
|
183
|
-
it('prevents "Backspace" on curreny value text, and keeps currency value text of blur', async () => {
|
|
184
|
-
const el = await getElFrom(html`
|
|
185
|
-
${currency({ value: 234.21 })}
|
|
186
|
-
`);
|
|
187
|
-
await elementUpdated(el);
|
|
188
|
-
expect(el.formattedValue).to.equal("EUR\xA0234.21");
|
|
189
|
-
el.focus();
|
|
190
|
-
el.inputElement.setSelectionRange(2, 2);
|
|
191
|
-
await sendKeys({
|
|
192
|
-
press: "Backspace"
|
|
193
|
-
});
|
|
194
|
-
await elementUpdated(el);
|
|
195
|
-
expect(
|
|
196
|
-
el.inputElement.value
|
|
197
|
-
).to.equal("EUR\xA0234.21");
|
|
198
|
-
el.blur();
|
|
199
|
-
await elementUpdated(el);
|
|
200
|
-
expect(
|
|
201
|
-
el.inputElement.value
|
|
202
|
-
).to.equal("EUR\xA0234.21");
|
|
203
|
-
});
|
|
204
|
-
it('prevents "." when `maximumFractionDigits: 0`', async () => {
|
|
205
|
-
const el = await getElFrom(html`
|
|
206
|
-
${Default()}
|
|
207
|
-
`);
|
|
208
|
-
await elementUpdated(el);
|
|
209
|
-
el.formatOptions = {
|
|
210
|
-
maximumFractionDigits: 0
|
|
211
|
-
};
|
|
212
|
-
el.focus();
|
|
213
|
-
await elementUpdated(el);
|
|
214
|
-
await sendKeys({
|
|
215
|
-
type: "5.2"
|
|
216
|
-
});
|
|
217
|
-
await elementUpdated(el);
|
|
218
|
-
expect(el.formattedValue).to.equal("52");
|
|
219
|
-
await sendKeys({
|
|
220
|
-
press: "Enter"
|
|
221
|
-
});
|
|
222
|
-
await elementUpdated(el);
|
|
223
|
-
expect(el.value).to.equal(52);
|
|
224
|
-
});
|
|
225
|
-
xit("allow arabic numerals entered", async () => {
|
|
226
|
-
const el = await getElFrom(html`
|
|
227
|
-
${Default()}
|
|
228
|
-
`);
|
|
229
|
-
await elementUpdated(el);
|
|
230
|
-
el.focus();
|
|
231
|
-
await elementUpdated(el);
|
|
232
|
-
await sendKeys({
|
|
233
|
-
type: "\u0662\u0661"
|
|
234
|
-
});
|
|
235
|
-
await elementUpdated(el);
|
|
236
|
-
expect(el.formattedValue).to.equal("21");
|
|
237
|
-
await sendKeys({
|
|
238
|
-
press: "Enter"
|
|
239
|
-
});
|
|
240
|
-
await elementUpdated(el);
|
|
241
|
-
expect(el.value).to.equal(21);
|
|
242
|
-
});
|
|
243
|
-
xit("allow hanidec numerals entered", async () => {
|
|
244
|
-
const el = await getElFrom(html`
|
|
245
|
-
${Default()}
|
|
246
|
-
`);
|
|
247
|
-
await elementUpdated(el);
|
|
248
|
-
el.focus();
|
|
249
|
-
await elementUpdated(el);
|
|
250
|
-
await sendKeys({
|
|
251
|
-
type: "\u4E8C\u4E00"
|
|
252
|
-
});
|
|
253
|
-
await elementUpdated(el);
|
|
254
|
-
expect(el.formattedValue).to.equal("21");
|
|
255
|
-
await sendKeys({
|
|
256
|
-
press: "Enter"
|
|
257
|
-
});
|
|
258
|
-
await elementUpdated(el);
|
|
259
|
-
expect(el.value).to.equal(21);
|
|
260
|
-
});
|
|
261
|
-
});
|
|
262
|
-
describe("user suplied large numbers", () => {
|
|
263
|
-
it("do not crash the Number Field", async () => {
|
|
264
|
-
const el = await getElFrom(minMax(minMax.args));
|
|
265
|
-
await elementUpdated(el);
|
|
266
|
-
el.focus();
|
|
267
|
-
await sendKeys({
|
|
268
|
-
type: "12345678901234567890"
|
|
269
|
-
});
|
|
270
|
-
await elementUpdated(el);
|
|
271
|
-
expect(el.formattedValue).to.equal("255");
|
|
272
|
-
await sendKeys({
|
|
273
|
-
press: "Enter"
|
|
274
|
-
});
|
|
275
|
-
await elementUpdated(el);
|
|
276
|
-
expect(el.value).to.equal(255);
|
|
277
|
-
});
|
|
278
|
-
});
|
|
279
|
-
describe("with floating point numbers", () => {
|
|
280
|
-
it("do not crash the Number Field", async () => {
|
|
281
|
-
const el = await getElFrom(minMax(minMax.args));
|
|
282
|
-
el.setAttribute("min", "0.1");
|
|
283
|
-
el.setAttribute("step", "0.01");
|
|
284
|
-
el.setAttribute("value", "0.5");
|
|
285
|
-
await elementUpdated(el);
|
|
286
|
-
el.focus();
|
|
287
|
-
await sendKeys({
|
|
288
|
-
type: "6"
|
|
289
|
-
});
|
|
290
|
-
await elementUpdated(el);
|
|
291
|
-
expect(el.formattedValue).to.equal("0.56");
|
|
292
|
-
await sendKeys({
|
|
293
|
-
press: "Enter"
|
|
294
|
-
});
|
|
295
|
-
await elementUpdated(el);
|
|
296
|
-
expect(el.value).to.equal(0.56);
|
|
297
|
-
});
|
|
298
|
-
});
|
|
299
|
-
describe("locale specific", () => {
|
|
300
|
-
it("can determine the group symbol", async () => {
|
|
301
|
-
const [languageContext] = createLanguageContext("es-ES");
|
|
302
|
-
const el = await getElFrom(html`
|
|
303
|
-
<div @sp-language-context=${languageContext}>${Default()}</div>
|
|
304
|
-
`);
|
|
305
|
-
await elementUpdated(el);
|
|
306
|
-
el.focus();
|
|
307
|
-
await sendKeys({
|
|
308
|
-
type: "123.456.789"
|
|
309
|
-
});
|
|
310
|
-
await elementUpdated(el);
|
|
311
|
-
expect(el.formattedValue).to.equal("123.456.789");
|
|
312
|
-
await sendKeys({
|
|
313
|
-
press: "Tab"
|
|
314
|
-
});
|
|
315
|
-
await elementUpdated(el);
|
|
316
|
-
expect(el.formattedValue).to.equal("123.456.789");
|
|
317
|
-
});
|
|
318
|
-
});
|
|
319
|
-
describe("2-byte characters", () => {
|
|
320
|
-
const numbers = Object.keys(remapMultiByteCharacters);
|
|
321
|
-
numbers.splice(10);
|
|
322
|
-
numbers.forEach((input) => {
|
|
323
|
-
const actual = remapMultiByteCharacters[input];
|
|
324
|
-
it(`accepts "${input}" as "${actual}"`, async () => {
|
|
325
|
-
const el = await getElFrom(Default());
|
|
326
|
-
el.focusElement.value = input;
|
|
327
|
-
el.focusElement.dispatchEvent(
|
|
328
|
-
new Event("input", {
|
|
329
|
-
bubbles: true,
|
|
330
|
-
cancelable: true,
|
|
331
|
-
composed: true
|
|
332
|
-
})
|
|
333
|
-
);
|
|
334
|
-
await elementUpdated(el);
|
|
335
|
-
expect(el.formattedValue).to.equal(actual);
|
|
336
|
-
expect(el.value).to.equal(Number(actual));
|
|
337
|
-
});
|
|
338
|
-
});
|
|
339
|
-
it('accepts "\u3001" as "," and "\u3002" as "."', async () => {
|
|
340
|
-
const el = await getElFrom(Default(Default.args));
|
|
341
|
-
el.focusElement.value = "\uFF11\u3001\uFF12\uFF13\uFF14\u3002\uFF156";
|
|
342
|
-
el.focusElement.dispatchEvent(
|
|
343
|
-
new Event("input", {
|
|
344
|
-
bubbles: true,
|
|
345
|
-
cancelable: true,
|
|
346
|
-
composed: true
|
|
347
|
-
})
|
|
348
|
-
);
|
|
349
|
-
await elementUpdated(el);
|
|
350
|
-
expect(el.formattedValue).to.equal("1,234.56");
|
|
351
|
-
expect(el.value).to.equal(Number(1234.56));
|
|
352
|
-
});
|
|
353
|
-
it('accepts misplaced "\u3001" and corrects them', async () => {
|
|
354
|
-
const el = await getElFrom(Default(Default.args));
|
|
355
|
-
const nextFocusableElement = document.createElement("input");
|
|
356
|
-
el.insertAdjacentElement("afterend", nextFocusableElement);
|
|
357
|
-
el.focus();
|
|
358
|
-
await elementUpdated(el);
|
|
359
|
-
el.focusElement.value = "\uFF11\uFF12\u3001\uFF13\uFF14\uFF15\uFF16\u3001\uFF17\u3002\uFF18\uFF19";
|
|
360
|
-
el.focusElement.dispatchEvent(
|
|
361
|
-
new Event("input", {
|
|
362
|
-
bubbles: true,
|
|
363
|
-
cancelable: true,
|
|
364
|
-
composed: true
|
|
365
|
-
})
|
|
366
|
-
);
|
|
367
|
-
await elementUpdated(el);
|
|
368
|
-
expect(el.focusElement.value, "visible").to.equal("12,3456,7.89");
|
|
369
|
-
expect(el.formattedValue, "tracked").to.equal("1,234,567.89");
|
|
370
|
-
expect(el.value, "value").to.equal(Number(123456789e-2));
|
|
371
|
-
await sendKeys({
|
|
372
|
-
press: "Tab"
|
|
373
|
-
});
|
|
374
|
-
await elementUpdated(el);
|
|
375
|
-
expect(el.focusElement.value, "visible").to.equal("1,234,567.89");
|
|
376
|
-
expect(el.formattedValue, "tracked").to.equal("1,234,567.89");
|
|
377
|
-
expect(el.value, "value").to.equal(Number(123456789e-2));
|
|
378
|
-
nextFocusableElement.remove();
|
|
379
|
-
});
|
|
380
|
-
it('accepts "\uFF0B" as "+" and "\u30FC" as "-"', async () => {
|
|
381
|
-
const el = await getElFrom(decimals(decimals.args));
|
|
382
|
-
el.focusElement.value = "\uFF0B\uFF19\u3002\uFF18\uFF17";
|
|
383
|
-
el.focusElement.dispatchEvent(
|
|
384
|
-
new Event("input", {
|
|
385
|
-
bubbles: true,
|
|
386
|
-
cancelable: true,
|
|
387
|
-
composed: true
|
|
388
|
-
})
|
|
389
|
-
);
|
|
390
|
-
await elementUpdated(el);
|
|
391
|
-
expect(el.formattedValue).to.equal("+9.87");
|
|
392
|
-
expect(el.value).to.equal(Number(9.87));
|
|
393
|
-
el.focusElement.value = "\u30FC\uFF19\uFF0E\uFF18\uFF17";
|
|
394
|
-
el.focusElement.dispatchEvent(
|
|
395
|
-
new Event("input", {
|
|
396
|
-
bubbles: true,
|
|
397
|
-
cancelable: true,
|
|
398
|
-
composed: true
|
|
399
|
-
})
|
|
400
|
-
);
|
|
401
|
-
await elementUpdated(el);
|
|
402
|
-
expect(el.formattedValue).to.equal("-9.87");
|
|
403
|
-
expect(el.value).to.equal(Number(-9.87));
|
|
404
|
-
});
|
|
405
|
-
it('accepts "\uFF05" as "%"', async () => {
|
|
406
|
-
const el = await getElFrom(percents(percents.args));
|
|
407
|
-
el.focusElement.value = "\uFF11\uFF10\uFF05";
|
|
408
|
-
el.focusElement.dispatchEvent(
|
|
409
|
-
new Event("input", {
|
|
410
|
-
bubbles: true,
|
|
411
|
-
cancelable: true,
|
|
412
|
-
composed: true
|
|
413
|
-
})
|
|
414
|
-
);
|
|
415
|
-
await elementUpdated(el);
|
|
416
|
-
expect(el.formattedValue).to.equal("10%");
|
|
417
|
-
expect(el.value).to.equal(Number(0.1));
|
|
418
|
-
});
|
|
419
|
-
});
|
|
420
|
-
});
|
|
421
|
-
//# sourceMappingURL=inputs.test.js.map
|
package/test/inputs.test.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["inputs.test.ts"],
|
|
4
|
-
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport { html } from '@spectrum-web-components/base';\nimport { elementUpdated, expect } from '@open-wc/testing';\nimport { getElFrom } from './helpers.js';\nimport { createLanguageContext } from '../../../tools/reactive-controllers/test/helpers.js';\nimport { shouldPolyfill } from '@formatjs/intl-numberformat/should-polyfill.js';\n\nimport '@spectrum-web-components/number-field/sp-number-field.js';\nimport { remapMultiByteCharacters } from '@spectrum-web-components/number-field';\nimport {\n currency,\n decimals,\n Default,\n minMax,\n percents,\n} from '../stories/number-field.stories.js';\nimport { sendKeys } from '@web/test-runner-commands';\n\ndescribe('NumberField - inputs', () => {\n before(async () => {\n const shouldPolyfillEn = shouldPolyfill('en');\n const shouldPolyfillEs = shouldPolyfill('es');\n const shouldPolyfillFr = shouldPolyfill('fr');\n if (shouldPolyfillEn || shouldPolyfillEs || shouldPolyfillFr) {\n await import('@formatjs/intl-numberformat/polyfill-force.js');\n }\n if (shouldPolyfillEn) {\n await import('@formatjs/intl-numberformat/locale-data/en.js');\n }\n if (shouldPolyfillEs) {\n await import('@formatjs/intl-numberformat/locale-data/es.js');\n }\n if (shouldPolyfillFr) {\n await import('@formatjs/intl-numberformat/locale-data/fr.js');\n }\n });\n describe('keystroke prevention', () => {\n it('converts 2 byte characters, default', async () => {\n const el = await getElFrom(html`\n ${Default()}\n `);\n await elementUpdated(el);\n\n el.focus();\n await sendKeys({\n type: '\uFF13\u3001\uFF15\uFF16\uFF17\u3001\uFF18\uFF19\uFF10\u3002\uFF11',\n });\n await elementUpdated(el);\n expect(el.formattedValue).to.equal('3,567,890.1');\n });\n it('converts 2 byte characters, percents', async () => {\n const el = await getElFrom(html`\n ${percents()}\n `);\n await elementUpdated(el);\n\n el.focus();\n await sendKeys({\n type: '\uFF12\uFF14\uFF05',\n });\n await elementUpdated(el);\n expect(el.formattedValue).to.equal('24%');\n });\n it('prevents second \".\" in EN', async () => {\n const el = await getElFrom(html`\n ${Default()}\n `);\n el.formatOptions = {\n maximumFractionDigits: 2,\n };\n await elementUpdated(el);\n\n el.focus();\n await sendKeys({\n type: '1.1.1',\n });\n await elementUpdated(el);\n expect(el.formattedValue).to.equal('1.11');\n });\n it('prevents text characters', async () => {\n const el = await getElFrom(html`\n ${Default()}\n `);\n el.formatOptions = {\n maximumFractionDigits: 1,\n };\n await elementUpdated(el);\n\n el.focus();\n await sendKeys({\n type: 'D2.2',\n });\n await elementUpdated(el);\n expect(el.formattedValue).to.equal('2.2');\n\n el.value = NaN;\n\n await sendKeys({\n type: '8u23.s7',\n });\n await elementUpdated(el);\n expect(el.formattedValue).to.equal('823.7');\n });\n it('allows \"-\" to start', async () => {\n const el = await getElFrom(html`\n ${Default()}\n `);\n await elementUpdated(el);\n\n el.focus();\n await sendKeys({\n type: '-54',\n });\n await elementUpdated(el);\n expect(el.formattedValue).to.equal('-54');\n });\n it('prevents \"-\" not at the start', async () => {\n const el = await getElFrom(html`\n ${Default()}\n `);\n await elementUpdated(el);\n\n el.focus();\n await sendKeys({\n type: '54-',\n });\n await elementUpdated(el);\n expect(el.formattedValue).to.equal('54');\n\n el.value = NaN;\n\n await sendKeys({\n type: '5-4',\n });\n await elementUpdated(el);\n expect(el.formattedValue).to.equal('54');\n });\n it('prevent \"+\" to start, normally', async () => {\n const el = await getElFrom(html`\n ${Default()}\n `);\n await elementUpdated(el);\n\n el.focus();\n await sendKeys({\n type: '+54',\n });\n await elementUpdated(el);\n expect(el.formattedValue).to.equal('54');\n });\n it('allow \"+\" to start when \"signDisplay: always\"', async () => {\n const el = await getElFrom(html`\n ${Default()}\n `);\n await elementUpdated(el);\n el.formatOptions = {\n signDisplay: 'always',\n };\n el.focus();\n await sendKeys({\n type: '+54',\n });\n await elementUpdated(el);\n expect(el.formattedValue).to.equal('+54');\n });\n it('prevents \"%\" when when not percents', async () => {\n const el = await getElFrom(html`\n ${Default()}\n `);\n await elementUpdated(el);\n\n el.focus();\n await sendKeys({\n type: '63%',\n });\n await elementUpdated(el);\n expect(el.formattedValue).to.equal('63');\n el.blur();\n await elementUpdated(el);\n expect(el.formattedValue).to.equal('63');\n });\n it('allows \"%\" when percents, and keeps \"%\" on blur', async () => {\n const el = await getElFrom(html`\n ${percents()}\n `);\n await elementUpdated(el);\n\n el.focus();\n await sendKeys({\n type: '63%',\n });\n await elementUpdated(el);\n expect(el.formattedValue).to.equal('63%');\n el.blur();\n await elementUpdated(el);\n expect(el.formattedValue).to.equal('63%');\n });\n it('prevents \"Backspace\" on curreny value text, and keeps currency value text of blur', async () => {\n const el = await getElFrom(html`\n ${currency({ value: 234.21 })}\n `);\n await elementUpdated(el);\n expect(el.formattedValue).to.equal('EUR\u00A0234.21');\n\n el.focus();\n (\n el as unknown as {\n inputElement: HTMLInputElement;\n }\n ).inputElement.setSelectionRange(2, 2);\n await sendKeys({\n press: 'Backspace',\n });\n await elementUpdated(el);\n expect(\n (el as unknown as { inputElement: HTMLInputElement })\n .inputElement.value\n ).to.equal('EUR\u00A0234.21');\n el.blur();\n await elementUpdated(el);\n expect(\n (el as unknown as { inputElement: HTMLInputElement })\n .inputElement.value\n ).to.equal('EUR\u00A0234.21');\n });\n it('prevents \".\" when `maximumFractionDigits: 0`', async () => {\n const el = await getElFrom(html`\n ${Default()}\n `);\n await elementUpdated(el);\n el.formatOptions = {\n maximumFractionDigits: 0,\n };\n el.focus();\n await elementUpdated(el);\n await sendKeys({\n type: '5.2',\n });\n await elementUpdated(el);\n expect(el.formattedValue).to.equal('52');\n await sendKeys({\n press: 'Enter',\n });\n await elementUpdated(el);\n expect(el.value).to.equal(52);\n });\n xit('allow arabic numerals entered', async () => {\n // Safari requires more polyfilling for this text\n const el = await getElFrom(html`\n ${Default()}\n `);\n await elementUpdated(el);\n\n el.focus();\n await elementUpdated(el);\n await sendKeys({\n type: '\u0662\u0661',\n });\n await elementUpdated(el);\n expect(el.formattedValue).to.equal('21');\n await sendKeys({\n press: 'Enter',\n });\n await elementUpdated(el);\n expect(el.value).to.equal(21);\n });\n xit('allow hanidec numerals entered', async () => {\n // Safari requires more polyfilling for this text\n const el = await getElFrom(html`\n ${Default()}\n `);\n await elementUpdated(el);\n\n el.focus();\n await elementUpdated(el);\n await sendKeys({\n type: '\u4E8C\u4E00',\n });\n await elementUpdated(el);\n expect(el.formattedValue).to.equal('21');\n await sendKeys({\n press: 'Enter',\n });\n await elementUpdated(el);\n expect(el.value).to.equal(21);\n });\n });\n describe('user suplied large numbers', () => {\n it('do not crash the Number Field', async () => {\n const el = await getElFrom(minMax(minMax.args));\n await elementUpdated(el);\n\n el.focus();\n await sendKeys({\n type: '12345678901234567890',\n });\n await elementUpdated(el);\n expect(el.formattedValue).to.equal('255');\n await sendKeys({\n press: 'Enter',\n });\n await elementUpdated(el);\n expect(el.value).to.equal(255);\n });\n });\n describe('with floating point numbers', () => {\n it('do not crash the Number Field', async () => {\n const el = await getElFrom(minMax(minMax.args));\n el.setAttribute('min', '0.1');\n el.setAttribute('step', '0.01');\n el.setAttribute('value', '0.5');\n await elementUpdated(el);\n\n el.focus();\n await sendKeys({\n type: '6',\n });\n await elementUpdated(el);\n expect(el.formattedValue).to.equal('0.56');\n await sendKeys({\n press: 'Enter',\n });\n await elementUpdated(el);\n expect(el.value).to.equal(0.56);\n });\n });\n describe('locale specific', () => {\n it('can determine the group symbol', async () => {\n const [languageContext] = createLanguageContext('es-ES');\n const el = await getElFrom(html`\n <div @sp-language-context=${languageContext}>${Default()}</div>\n `);\n await elementUpdated(el);\n\n el.focus();\n await sendKeys({\n type: '123.456.789',\n });\n await elementUpdated(el);\n expect(el.formattedValue).to.equal('123.456.789');\n await sendKeys({\n press: 'Tab',\n });\n await elementUpdated(el);\n expect(el.formattedValue).to.equal('123.456.789');\n });\n });\n describe('2-byte characters', () => {\n const numbers = Object.keys(remapMultiByteCharacters);\n // only `\uFF11`-`\uFF10` can be accepted as single key inputs.\n numbers.splice(10);\n numbers.forEach((input) => {\n const actual = remapMultiByteCharacters[input];\n it(`accepts \"${input}\" as \"${actual}\"`, async () => {\n const el = await getElFrom(Default());\n el.focusElement.value = input;\n el.focusElement.dispatchEvent(\n new Event('input', {\n bubbles: true,\n cancelable: true,\n composed: true,\n })\n );\n await elementUpdated(el);\n\n expect(el.formattedValue).to.equal(actual);\n expect(el.value).to.equal(Number(actual));\n });\n });\n it('accepts \"\u3001\" as \",\" and \"\u3002\" as \".\"', async () => {\n const el = await getElFrom(Default(Default.args));\n el.focusElement.value = '\uFF11\u3001\uFF12\uFF13\uFF14\u3002\uFF156';\n el.focusElement.dispatchEvent(\n new Event('input', {\n bubbles: true,\n cancelable: true,\n composed: true,\n })\n );\n await elementUpdated(el);\n\n expect(el.formattedValue).to.equal('1,234.56');\n expect(el.value).to.equal(Number(1234.56));\n });\n it('accepts misplaced \"\u3001\" and corrects them', async () => {\n const el = await getElFrom(Default(Default.args));\n const nextFocusableElement = document.createElement('input');\n el.insertAdjacentElement('afterend', nextFocusableElement);\n el.focus();\n await elementUpdated(el);\n\n el.focusElement.value = '\uFF11\uFF12\u3001\uFF13\uFF14\uFF15\uFF16\u3001\uFF17\u3002\uFF18\uFF19';\n el.focusElement.dispatchEvent(\n new Event('input', {\n bubbles: true,\n cancelable: true,\n composed: true,\n })\n );\n await elementUpdated(el);\n\n expect(el.focusElement.value, 'visible').to.equal('12,3456,7.89');\n expect(el.formattedValue, 'tracked').to.equal('1,234,567.89');\n expect(el.value, 'value').to.equal(Number(1234567.89));\n\n await sendKeys({\n press: 'Tab',\n });\n await elementUpdated(el);\n expect(el.focusElement.value, 'visible').to.equal('1,234,567.89');\n expect(el.formattedValue, 'tracked').to.equal('1,234,567.89');\n expect(el.value, 'value').to.equal(Number(1234567.89));\n nextFocusableElement.remove();\n });\n it('accepts \"\uFF0B\" as \"+\" and \"\u30FC\" as \"-\"', async () => {\n const el = await getElFrom(decimals(decimals.args));\n el.focusElement.value = '\uFF0B\uFF19\u3002\uFF18\uFF17';\n el.focusElement.dispatchEvent(\n new Event('input', {\n bubbles: true,\n cancelable: true,\n composed: true,\n })\n );\n await elementUpdated(el);\n\n expect(el.formattedValue).to.equal('+9.87');\n expect(el.value).to.equal(Number(9.87));\n\n el.focusElement.value = '\u30FC\uFF19\uFF0E\uFF18\uFF17';\n el.focusElement.dispatchEvent(\n new Event('input', {\n bubbles: true,\n cancelable: true,\n composed: true,\n })\n );\n await elementUpdated(el);\n\n expect(el.formattedValue).to.equal('-9.87');\n expect(el.value).to.equal(Number(-9.87));\n });\n it('accepts \"\uFF05\" as \"%\"', async () => {\n const el = await getElFrom(percents(percents.args));\n el.focusElement.value = '\uFF11\uFF10\uFF05';\n el.focusElement.dispatchEvent(\n new Event('input', {\n bubbles: true,\n cancelable: true,\n composed: true,\n })\n );\n await elementUpdated(el);\n\n expect(el.formattedValue).to.equal('10%');\n expect(el.value).to.equal(Number(0.1));\n });\n });\n});\n"],
|
|
5
|
-
"mappings": ";AAYA,SAAS,YAAY;AACrB,SAAS,gBAAgB,cAAc;AACvC,SAAS,iBAAiB;AAC1B,SAAS,6BAA6B;AACtC,SAAS,sBAAsB;AAE/B,OAAO;AACP,SAAS,gCAAgC;AACzC;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AACP,SAAS,gBAAgB;AAEzB,SAAS,wBAAwB,MAAM;AACnC,SAAO,YAAY;AACf,UAAM,mBAAmB,eAAe,IAAI;AAC5C,UAAM,mBAAmB,eAAe,IAAI;AAC5C,UAAM,mBAAmB,eAAe,IAAI;AAC5C,QAAI,oBAAoB,oBAAoB,kBAAkB;AAC1D,YAAM,OAAO,+CAA+C;AAAA,IAChE;AACA,QAAI,kBAAkB;AAClB,YAAM,OAAO,+CAA+C;AAAA,IAChE;AACA,QAAI,kBAAkB;AAClB,YAAM,OAAO,+CAA+C;AAAA,IAChE;AACA,QAAI,kBAAkB;AAClB,YAAM,OAAO,+CAA+C;AAAA,IAChE;AAAA,EACJ,CAAC;AACD,WAAS,wBAAwB,MAAM;AACnC,OAAG,uCAAuC,YAAY;AAClD,YAAM,KAAK,MAAM,UAAU;AAAA,kBACrB,QAAQ,CAAC;AAAA,aACd;AACD,YAAM,eAAe,EAAE;AAEvB,SAAG,MAAM;AACT,YAAM,SAAS;AAAA,QACX,MAAM;AAAA,MACV,CAAC;AACD,YAAM,eAAe,EAAE;AACvB,aAAO,GAAG,cAAc,EAAE,GAAG,MAAM,aAAa;AAAA,IACpD,CAAC;AACD,OAAG,wCAAwC,YAAY;AACnD,YAAM,KAAK,MAAM,UAAU;AAAA,kBACrB,SAAS,CAAC;AAAA,aACf;AACD,YAAM,eAAe,EAAE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YAAM,eAAe,EAAE;AAEvB,aAAO,GAAG,cAAc,EAAE,GAAG,MAAM,OAAO;AAC1C,aAAO,GAAG,KAAK,EAAE,GAAG,MAAM,OAAO,KAAK,CAAC;AAAA,IAC3C,CAAC;AACD,OAAG,2BAAsB,YAAY;AACjC,YAAM,KAAK,MAAM,UAAU,SAAS,SAAS,IAAI,CAAC;AAClD,SAAG,aAAa,QAAQ;AACxB,SAAG,aAAa;AAAA,QACZ,IAAI,MAAM,SAAS;AAAA,UACf,SAAS;AAAA,UACT,YAAY;AAAA,UACZ,UAAU;AAAA,QACd,CAAC;AAAA,MACL;AACA,YAAM,eAAe,EAAE;AAEvB,aAAO,GAAG,cAAc,EAAE,GAAG,MAAM,KAAK;AACxC,aAAO,GAAG,KAAK,EAAE,GAAG,MAAM,OAAO,GAAG,CAAC;AAAA,IACzC,CAAC;AAAA,EACL,CAAC;AACL,CAAC;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["number-field-memory.test.ts"],
|
|
4
|
-
"sourcesContent": ["/*\nCopyright 2023 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport { Default } from '../stories/number-field.stories.js';\nimport { testForMemoryLeaks } from '../../../test/testing-helpers.js';\n\ntestForMemoryLeaks(Default({}));\n"],
|
|
5
|
-
"mappings": ";AAWA,SAAS,eAAe;AACxB,SAAS,0BAA0B;AAEnC,mBAAmB,QAAQ,CAAC,CAAC,CAAC;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["number-field-sizes.test-vrt.ts"],
|
|
4
|
-
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport * as stories from '../stories/number-field-sizes.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\nimport type { TestsType } from '../../../test/visual/test.js';\n\nregressVisuals('NumberFieldSizesStories', stories as unknown as TestsType);\n"],
|
|
5
|
-
"mappings": ";AAYA,YAAY,aAAa;AACzB,SAAS,sBAAsB;AAG/B,eAAe,2BAA2B,OAA+B;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["number-field.test-vrt.ts"],
|
|
4
|
-
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport * as stories from '../stories/number-field.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\nimport type { TestsType } from '../../../test/visual/test.js';\n\nregressVisuals('NumberFieldStories', stories as unknown as TestsType);\n"],
|
|
5
|
-
"mappings": ";AAYA,YAAY,aAAa;AACzB,SAAS,sBAAsB;AAG/B,eAAe,sBAAsB,OAA+B;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|