@spectrum-web-components/number-field 0.3.4 → 0.3.6

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spectrum-web-components/number-field",
3
- "version": "0.3.4",
3
+ "version": "0.3.6",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -45,22 +45,22 @@
45
45
  ],
46
46
  "dependencies": {
47
47
  "@internationalized/number": "^3.0.2",
48
- "@spectrum-web-components/action-button": "^0.7.3",
49
- "@spectrum-web-components/base": "^0.5.1",
50
- "@spectrum-web-components/icon": "^0.11.2",
51
- "@spectrum-web-components/icons-ui": "^0.8.2",
52
- "@spectrum-web-components/shared": "^0.13.3",
53
- "@spectrum-web-components/textfield": "^0.11.0",
48
+ "@spectrum-web-components/action-button": "^0.8.0",
49
+ "@spectrum-web-components/base": "^0.5.3",
50
+ "@spectrum-web-components/icon": "^0.11.4",
51
+ "@spectrum-web-components/icons-ui": "^0.8.4",
52
+ "@spectrum-web-components/shared": "^0.13.5",
53
+ "@spectrum-web-components/textfield": "^0.11.2",
54
54
  "tslib": "^2.0.0"
55
55
  },
56
56
  "devDependencies": {
57
57
  "@formatjs/intl-numberformat": "7.1.4",
58
- "@spectrum-css/stepper": "^3.0.13"
58
+ "@spectrum-css/stepper": "^3.0.17"
59
59
  },
60
60
  "types": "./src/index.d.ts",
61
61
  "customElements": "custom-elements.json",
62
62
  "sideEffects": [
63
63
  "./sp-*.js"
64
64
  ],
65
- "gitHead": "f23b15ec952d7450272a8275524c905e028b4ddc"
65
+ "gitHead": "57aba8030b6af96af4015a0aa830e342a17dc219"
66
66
  }
@@ -1,6 +0,0 @@
1
- import { NumberField } from './src/NumberField.js';
2
- declare global {
3
- interface HTMLElementTagNameMap {
4
- 'sp-number-field': NumberField;
5
- }
6
- }
@@ -1,14 +0,0 @@
1
- /*
2
- Copyright 2020 Adobe. All rights reserved.
3
- This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License. You may obtain a copy
5
- of the License at http://www.apache.org/licenses/LICENSE-2.0
6
-
7
- Unless required by applicable law or agreed to in writing, software distributed under
8
- the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
- OF ANY KIND, either express or implied. See the License for the specific language
10
- governing permissions and limitations under the License.
11
- */
12
- import { NumberField } from './src/NumberField.js';
13
- customElements.define('sp-number-field', NumberField);
14
- //# sourceMappingURL=sp-number-field.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sp-number-field.js","sourceRoot":"","sources":["sp-number-field.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AAEF,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,cAAc,CAAC,MAAM,CAAC,iBAAiB,EAAE,WAAW,CAAC,CAAC","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 { NumberField } from './src/NumberField.js';\n\ncustomElements.define('sp-number-field', NumberField);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-number-field': NumberField;\n }\n}\n"]}
@@ -1,99 +0,0 @@
1
- import { CSSResultArray, PropertyValues, TemplateResult } from '@spectrum-web-components/base';
2
- import { NumberFormatter, NumberParser } from '@internationalized/number';
3
- import '@spectrum-web-components/icons-ui/icons/sp-icon-chevron75.js';
4
- import '@spectrum-web-components/action-button/sp-action-button.js';
5
- import { TextfieldBase } from '@spectrum-web-components/textfield';
6
- export declare const FRAMES_PER_CHANGE = 5;
7
- export declare const indeterminatePlaceholder = "-";
8
- export declare const remapMultiByteCharacters: Record<string, string>;
9
- /**
10
- * @element sp-number-field
11
- * @slot help-text - default or non-negative help text to associate to your form element
12
- * @slot negative-help-text - negative help text to associate to your form element when `invalid`
13
- */
14
- export declare class NumberField extends TextfieldBase {
15
- static get styles(): CSSResultArray;
16
- private buttons;
17
- focused: boolean;
18
- _forcedUnit: string;
19
- /**
20
- * An `&lt;sp-number-field&gt;` element will process its numeric value with
21
- * `new Intl.NumberFormat(this.resolvedLanguage, this.formatOptions).format(this.valueAsNumber)`
22
- * in order to prepare it for visual delivery in the input. In order to customize this
23
- * processing supply your own `Intl.NumberFormatOptions` object here.
24
- *
25
- * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat
26
- */
27
- formatOptions: Intl.NumberFormatOptions;
28
- /**
29
- * Whether the stepper UI is hidden or not.
30
- */
31
- hideStepper: boolean;
32
- indeterminate: boolean;
33
- keyboardFocused: boolean;
34
- max?: number;
35
- min?: number;
36
- private resolvedLanguage;
37
- /**
38
- * The distance by which to alter the value of the element when taking a "step".
39
- *
40
- * When `this.formatOptions.style === 'percentage'` the default step will be
41
- * set to 0.01 unless otherwise supplied to the element.
42
- */
43
- step?: number;
44
- stepperActive: boolean;
45
- stepModifier: number;
46
- set value(rawValue: number);
47
- get value(): number;
48
- private get inputValue();
49
- _value: number;
50
- private _trackingValue;
51
- /**
52
- * Retreive the value of the element parsed to a Number.
53
- */
54
- get valueAsString(): string;
55
- set valueAsString(value: string);
56
- get formattedValue(): string;
57
- private convertValueToNumber;
58
- private get _step();
59
- private nextChange;
60
- private changeCount;
61
- private findChange;
62
- private change;
63
- private safty;
64
- private handlePointerdown;
65
- private startChange;
66
- private doChange;
67
- private handlePointermove;
68
- private handlePointerup;
69
- private doNextChange;
70
- private stepBy;
71
- private increment;
72
- private decrement;
73
- private handleKeydown;
74
- protected onScroll(event: WheelEvent): void;
75
- protected onFocus(): void;
76
- protected onBlur(): void;
77
- private handleFocusin;
78
- private handleFocusout;
79
- private wasIndeterminate;
80
- private indeterminateValue?;
81
- protected handleChange(): void;
82
- protected handleInput(): void;
83
- private validateInput;
84
- protected get displayValue(): string;
85
- protected clearNumberFormatterCache(): void;
86
- protected get numberFormatter(): NumberFormatter;
87
- private _numberFormatter?;
88
- private _numberFormatterFocused?;
89
- protected get numberParser(): NumberParser;
90
- private _numberParser?;
91
- private _numberParserFocused?;
92
- protected renderField(): TemplateResult;
93
- protected update(changes: PropertyValues): void;
94
- protected firstUpdated(changes: PropertyValues): void;
95
- protected updated(changes: PropertyValues<this>): void;
96
- connectedCallback(): void;
97
- disconnectedCallback(): void;
98
- private resolveLanguage;
99
- }