@spectrum-web-components/number-field 0.3.13 → 0.4.1-devmode.7
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 +26 -13
- package/sp-number-field.dev.js +3 -0
- package/sp-number-field.dev.js.map +7 -0
- package/sp-number-field.js +3 -14
- package/sp-number-field.js.map +7 -1
- package/src/NumberField.dev.js +499 -0
- package/src/NumberField.dev.js.map +7 -0
- package/src/NumberField.js +452 -504
- package/src/NumberField.js.map +7 -1
- package/src/index.dev.js +2 -0
- package/src/index.dev.js.map +7 -0
- package/src/index.js +2 -13
- package/src/index.js.map +7 -1
- package/src/number-field.css.dev.js +147 -0
- package/src/number-field.css.dev.js.map +7 -0
- package/src/number-field.css.js +6 -15
- package/src/number-field.css.js.map +7 -1
- package/src/spectrum-number-field.css.dev.js +143 -0
- package/src/spectrum-number-field.css.dev.js.map +7 -0
- package/src/spectrum-number-field.css.js +3 -14
- package/src/spectrum-number-field.css.js.map +7 -1
- package/stories/number-field.stories.js +215 -229
- package/stories/number-field.stories.js.map +7 -1
- package/test/benchmark/basic-test.js +5 -16
- package/test/benchmark/basic-test.js.map +7 -1
- package/test/helpers.js +44 -55
- package/test/helpers.js.map +7 -1
- package/test/inputs.test.js +340 -350
- package/test/inputs.test.js.map +7 -1
- package/test/number-field.test-vrt.js +4 -15
- package/test/number-field.test-vrt.js.map +7 -1
- package/test/number-field.test.js +1135 -1135
- package/test/number-field.test.js.map +7 -1
|
@@ -1,200 +1,188 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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 { html } from '@spectrum-web-components/base';
|
|
13
|
-
import '../sp-number-field.js';
|
|
14
|
-
import '@spectrum-web-components/field-label/sp-field-label.js';
|
|
15
|
-
import { spreadProps } from '../../../test/lit-helpers.js';
|
|
1
|
+
import { html } from "@spectrum-web-components/base";
|
|
2
|
+
import { ifDefined } from "@spectrum-web-components/base/src/directives.js";
|
|
3
|
+
import "@spectrum-web-components/number-field/sp-number-field.js";
|
|
4
|
+
import "@spectrum-web-components/field-label/sp-field-label.js";
|
|
5
|
+
import { spreadProps } from "../../../test/lit-helpers.js";
|
|
16
6
|
export default {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
7
|
+
title: "Number Field",
|
|
8
|
+
component: "sp-number-field",
|
|
9
|
+
args: {
|
|
10
|
+
disabled: false,
|
|
11
|
+
readonly: false,
|
|
12
|
+
quiet: false,
|
|
13
|
+
value: void 0,
|
|
14
|
+
placeholder: "",
|
|
15
|
+
min: void 0,
|
|
16
|
+
max: void 0,
|
|
17
|
+
step: void 0
|
|
18
|
+
},
|
|
19
|
+
argTypes: {
|
|
20
|
+
disabled: {
|
|
21
|
+
name: "disabled",
|
|
22
|
+
type: { name: "boolean", required: false },
|
|
23
|
+
description: "Disable this control. It will not receive focus or events.",
|
|
24
|
+
table: {
|
|
25
|
+
type: { summary: "boolean" },
|
|
26
|
+
defaultValue: { summary: false }
|
|
27
|
+
},
|
|
28
|
+
control: {
|
|
29
|
+
type: "boolean"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
indeterminate: {
|
|
33
|
+
name: "indeterminate",
|
|
34
|
+
type: { name: "boolean", required: false },
|
|
35
|
+
description: "Whether the value of the Number Field can be determined for display.",
|
|
36
|
+
table: {
|
|
37
|
+
type: { summary: "boolean" },
|
|
38
|
+
defaultValue: { summary: false }
|
|
39
|
+
},
|
|
40
|
+
control: {
|
|
41
|
+
type: "boolean"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
readonly: {
|
|
45
|
+
name: "readonly",
|
|
46
|
+
type: { name: "boolean", required: false },
|
|
47
|
+
description: "When this control is read only, you will not be able to input an updated value.",
|
|
48
|
+
table: {
|
|
49
|
+
type: { summary: "boolean" },
|
|
50
|
+
defaultValue: { summary: false }
|
|
51
|
+
},
|
|
52
|
+
control: {
|
|
53
|
+
type: "boolean"
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
quiet: {
|
|
57
|
+
name: "quiet",
|
|
58
|
+
type: { name: "boolean", required: false },
|
|
59
|
+
description: "An altered delivery with no background and only a bottom border.",
|
|
60
|
+
table: {
|
|
61
|
+
type: { summary: "boolean" },
|
|
62
|
+
defaultValue: { summary: false }
|
|
63
|
+
},
|
|
64
|
+
control: {
|
|
65
|
+
type: "boolean"
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
hideStepper: {
|
|
69
|
+
name: "hide stepper",
|
|
70
|
+
type: { name: "boolean", required: false },
|
|
71
|
+
description: "Whether to remove the stepper UI from the control.",
|
|
72
|
+
table: {
|
|
73
|
+
type: { summary: "boolean" },
|
|
74
|
+
defaultValue: { summary: false }
|
|
75
|
+
},
|
|
76
|
+
control: {
|
|
77
|
+
type: "boolean"
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
value: {
|
|
81
|
+
name: "value",
|
|
82
|
+
type: { name: "number", required: false },
|
|
83
|
+
description: "Value to apply to the control.",
|
|
84
|
+
table: {
|
|
85
|
+
type: { summary: "string" },
|
|
86
|
+
defaultValue: { summary: void 0 }
|
|
87
|
+
},
|
|
88
|
+
control: {
|
|
89
|
+
type: "number"
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
step: {
|
|
93
|
+
name: "step",
|
|
94
|
+
type: { name: "number", required: false },
|
|
95
|
+
description: "Amount to change the value by when using the stepper or arrow key interactions.",
|
|
96
|
+
table: {
|
|
97
|
+
type: { summary: "string" },
|
|
98
|
+
defaultValue: { summary: void 0 }
|
|
99
|
+
},
|
|
100
|
+
control: {
|
|
101
|
+
type: "number"
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
stepModifier: {
|
|
105
|
+
name: "step modifier",
|
|
106
|
+
type: { name: "number", required: false },
|
|
107
|
+
description: "Amount to scale the step increment/decrement when holding the shift key",
|
|
108
|
+
table: {
|
|
109
|
+
type: { summary: "number" },
|
|
110
|
+
defaultValue: { summary: 10 }
|
|
111
|
+
},
|
|
112
|
+
control: {
|
|
113
|
+
type: "number"
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
placeholder: {
|
|
117
|
+
name: "placeholder",
|
|
118
|
+
type: { name: "string", required: false },
|
|
119
|
+
description: "Placeholder to apply to the control.",
|
|
120
|
+
table: {
|
|
121
|
+
type: { summary: "string" }
|
|
122
|
+
},
|
|
123
|
+
control: {
|
|
124
|
+
type: "text"
|
|
125
|
+
}
|
|
28
126
|
},
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
indeterminate: {
|
|
43
|
-
name: 'indeterminate',
|
|
44
|
-
type: { name: 'boolean', required: false },
|
|
45
|
-
description: 'Whether the value of the Number Field can be determined for display.',
|
|
46
|
-
table: {
|
|
47
|
-
type: { summary: 'boolean' },
|
|
48
|
-
defaultValue: { summary: false },
|
|
49
|
-
},
|
|
50
|
-
control: {
|
|
51
|
-
type: 'boolean',
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
readonly: {
|
|
55
|
-
name: 'readonly',
|
|
56
|
-
type: { name: 'boolean', required: false },
|
|
57
|
-
description: 'When this control is read only, you will not be able to input an updated value.',
|
|
58
|
-
table: {
|
|
59
|
-
type: { summary: 'boolean' },
|
|
60
|
-
defaultValue: { summary: false },
|
|
61
|
-
},
|
|
62
|
-
control: {
|
|
63
|
-
type: 'boolean',
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
quiet: {
|
|
67
|
-
name: 'quiet',
|
|
68
|
-
type: { name: 'boolean', required: false },
|
|
69
|
-
description: 'An altered delivery with no background and only a bottom border.',
|
|
70
|
-
table: {
|
|
71
|
-
type: { summary: 'boolean' },
|
|
72
|
-
defaultValue: { summary: false },
|
|
73
|
-
},
|
|
74
|
-
control: {
|
|
75
|
-
type: 'boolean',
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
hideStepper: {
|
|
79
|
-
name: 'hide stepper',
|
|
80
|
-
type: { name: 'boolean', required: false },
|
|
81
|
-
description: 'Whether to remove the stepper UI from the control.',
|
|
82
|
-
table: {
|
|
83
|
-
type: { summary: 'boolean' },
|
|
84
|
-
defaultValue: { summary: false },
|
|
85
|
-
},
|
|
86
|
-
control: {
|
|
87
|
-
type: 'boolean',
|
|
88
|
-
},
|
|
89
|
-
},
|
|
90
|
-
value: {
|
|
91
|
-
name: 'value',
|
|
92
|
-
type: { name: 'number', required: false },
|
|
93
|
-
description: 'Value to apply to the control.',
|
|
94
|
-
table: {
|
|
95
|
-
type: { summary: 'string' },
|
|
96
|
-
defaultValue: { summary: undefined },
|
|
97
|
-
},
|
|
98
|
-
control: {
|
|
99
|
-
type: 'number',
|
|
100
|
-
},
|
|
101
|
-
},
|
|
102
|
-
step: {
|
|
103
|
-
name: 'step',
|
|
104
|
-
type: { name: 'number', required: false },
|
|
105
|
-
description: 'Amount to change the value by when using the stepper or arrow key interactions.',
|
|
106
|
-
table: {
|
|
107
|
-
type: { summary: 'string' },
|
|
108
|
-
defaultValue: { summary: undefined },
|
|
109
|
-
},
|
|
110
|
-
control: {
|
|
111
|
-
type: 'number',
|
|
112
|
-
},
|
|
113
|
-
},
|
|
114
|
-
stepModifier: {
|
|
115
|
-
name: 'step modifier',
|
|
116
|
-
type: { name: 'number', required: false },
|
|
117
|
-
description: 'Amount to scale the step increment/decrement when holding the shift key',
|
|
118
|
-
table: {
|
|
119
|
-
type: { summary: 'number' },
|
|
120
|
-
defaultValue: { summary: 10 },
|
|
121
|
-
},
|
|
122
|
-
control: {
|
|
123
|
-
type: 'number',
|
|
124
|
-
},
|
|
125
|
-
},
|
|
126
|
-
placeholder: {
|
|
127
|
-
name: 'placeholder',
|
|
128
|
-
type: { name: 'string', required: false },
|
|
129
|
-
description: 'Placeholder to apply to the control.',
|
|
130
|
-
table: {
|
|
131
|
-
type: { summary: 'string' },
|
|
132
|
-
},
|
|
133
|
-
control: {
|
|
134
|
-
type: 'text',
|
|
135
|
-
},
|
|
136
|
-
},
|
|
137
|
-
min: {
|
|
138
|
-
name: 'min',
|
|
139
|
-
type: { name: 'number', required: false },
|
|
140
|
-
description: 'The minimum value the control can be set to.',
|
|
141
|
-
table: {
|
|
142
|
-
type: { summary: 'number' },
|
|
143
|
-
defaultValue: { summary: undefined },
|
|
144
|
-
},
|
|
145
|
-
control: {
|
|
146
|
-
type: 'number',
|
|
147
|
-
},
|
|
148
|
-
},
|
|
149
|
-
max: {
|
|
150
|
-
name: 'max',
|
|
151
|
-
type: { name: 'numer', required: false },
|
|
152
|
-
description: 'The maximum value the control can be set to.',
|
|
153
|
-
table: {
|
|
154
|
-
type: { summary: 'number' },
|
|
155
|
-
defaultValue: { summary: undefined },
|
|
156
|
-
},
|
|
157
|
-
control: {
|
|
158
|
-
type: 'number',
|
|
159
|
-
},
|
|
160
|
-
},
|
|
127
|
+
min: {
|
|
128
|
+
name: "min",
|
|
129
|
+
type: { name: "number", required: false },
|
|
130
|
+
description: "The minimum value the control can be set to.",
|
|
131
|
+
table: {
|
|
132
|
+
type: { summary: "number" },
|
|
133
|
+
defaultValue: { summary: void 0 }
|
|
134
|
+
},
|
|
135
|
+
control: {
|
|
136
|
+
type: "number"
|
|
137
|
+
}
|
|
161
138
|
},
|
|
139
|
+
max: {
|
|
140
|
+
name: "max",
|
|
141
|
+
type: { name: "numer", required: false },
|
|
142
|
+
description: "The maximum value the control can be set to.",
|
|
143
|
+
table: {
|
|
144
|
+
type: { summary: "number" },
|
|
145
|
+
defaultValue: { summary: void 0 }
|
|
146
|
+
},
|
|
147
|
+
control: {
|
|
148
|
+
type: "number"
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
162
152
|
};
|
|
163
153
|
export const Default = (args = {}) => {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
});
|
|
172
|
-
return html `
|
|
154
|
+
const onChange = args.onChange || (() => {
|
|
155
|
+
return;
|
|
156
|
+
});
|
|
157
|
+
const onInput = args.onInput || (() => {
|
|
158
|
+
return;
|
|
159
|
+
});
|
|
160
|
+
return html`
|
|
173
161
|
<sp-field-label for="default">Enter a number</sp-field-label>
|
|
174
162
|
<sp-number-field
|
|
175
163
|
id="default"
|
|
176
164
|
...=${spreadProps(args)}
|
|
177
165
|
@input=${(event) => onInput(event.target.value)}
|
|
178
166
|
@change=${(event) => onChange(event.target.value)}
|
|
179
|
-
style
|
|
167
|
+
style=${ifDefined(args.quiet ? void 0 : "width: 150px")}
|
|
180
168
|
></sp-number-field>
|
|
181
169
|
`;
|
|
182
170
|
};
|
|
183
171
|
Default.args = {
|
|
184
|
-
|
|
172
|
+
value: 100
|
|
185
173
|
};
|
|
186
174
|
export const quiet = (args = {}) => Default(args);
|
|
187
175
|
quiet.args = {
|
|
188
|
-
|
|
189
|
-
|
|
176
|
+
quiet: true,
|
|
177
|
+
value: 100
|
|
190
178
|
};
|
|
191
179
|
export const indeterminate = (args = {}) => Default(args);
|
|
192
180
|
indeterminate.args = {
|
|
193
|
-
|
|
194
|
-
|
|
181
|
+
value: 100,
|
|
182
|
+
indeterminate: true
|
|
195
183
|
};
|
|
196
184
|
export const decimals = (args) => {
|
|
197
|
-
|
|
185
|
+
return html`
|
|
198
186
|
<sp-field-label for="decimals">
|
|
199
187
|
Enter a number with visible decimals
|
|
200
188
|
</sp-field-label>
|
|
@@ -204,18 +192,18 @@ export const decimals = (args) => {
|
|
|
204
192
|
...=${spreadProps(args)}
|
|
205
193
|
@change=${args.onChange}
|
|
206
194
|
.formatOptions=${{
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
195
|
+
signDisplay: "exceptZero",
|
|
196
|
+
minimumFractionDigits: 1,
|
|
197
|
+
maximumFractionDigits: 2
|
|
198
|
+
}}
|
|
211
199
|
></sp-number-field>
|
|
212
200
|
`;
|
|
213
201
|
};
|
|
214
202
|
decimals.args = {
|
|
215
|
-
|
|
203
|
+
value: 19.274
|
|
216
204
|
};
|
|
217
205
|
export const percents = (args = {}) => {
|
|
218
|
-
|
|
206
|
+
return html`
|
|
219
207
|
<sp-field-label for="percents">Enter a percentage</sp-field-label>
|
|
220
208
|
<sp-number-field
|
|
221
209
|
id="percents"
|
|
@@ -223,36 +211,36 @@ export const percents = (args = {}) => {
|
|
|
223
211
|
...=${spreadProps(args)}
|
|
224
212
|
@change=${args.onChange}
|
|
225
213
|
.formatOptions=${{
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
214
|
+
style: "percent",
|
|
215
|
+
unitDisplay: "narrow"
|
|
216
|
+
}}
|
|
229
217
|
></sp-number-field>
|
|
230
218
|
`;
|
|
231
219
|
};
|
|
232
220
|
percents.args = {
|
|
233
|
-
|
|
221
|
+
value: 0.372
|
|
234
222
|
};
|
|
235
223
|
export const currency = (args = {}) => {
|
|
236
|
-
|
|
224
|
+
return html`
|
|
237
225
|
<sp-field-label for="currency">Enter a value in Euros</sp-field-label>
|
|
238
226
|
<sp-number-field
|
|
239
227
|
style="width: 200px"
|
|
240
228
|
...=${spreadProps(args)}
|
|
241
229
|
@change=${args.onChange}
|
|
242
230
|
.formatOptions=${{
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
231
|
+
style: "currency",
|
|
232
|
+
currency: "EUR",
|
|
233
|
+
currencyDisplay: "code",
|
|
234
|
+
currencySign: "accounting"
|
|
235
|
+
}}
|
|
248
236
|
></sp-number-field>
|
|
249
237
|
`;
|
|
250
238
|
};
|
|
251
239
|
currency.args = {
|
|
252
|
-
|
|
240
|
+
value: 23.19
|
|
253
241
|
};
|
|
254
242
|
export const units = (args) => {
|
|
255
|
-
|
|
243
|
+
return html`
|
|
256
244
|
<sp-field-label for="units">Enter a lengths in inches</sp-field-label>
|
|
257
245
|
<sp-number-field
|
|
258
246
|
id="units"
|
|
@@ -260,35 +248,35 @@ export const units = (args) => {
|
|
|
260
248
|
...=${spreadProps(args)}
|
|
261
249
|
@change=${args.onChange}
|
|
262
250
|
.formatOptions=${{
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
251
|
+
style: "unit",
|
|
252
|
+
unit: "inch",
|
|
253
|
+
unitDisplay: "long"
|
|
254
|
+
}}
|
|
267
255
|
></sp-number-field>
|
|
268
256
|
`;
|
|
269
257
|
};
|
|
270
258
|
units.args = {
|
|
271
|
-
|
|
259
|
+
value: 24
|
|
272
260
|
};
|
|
273
261
|
export const pixels = (args) => {
|
|
274
|
-
|
|
262
|
+
return html`
|
|
275
263
|
<sp-field-label for="units">Enter a lengths in pixels</sp-field-label>
|
|
276
264
|
<sp-number-field
|
|
277
265
|
id="units"
|
|
278
266
|
style="width: 200px"
|
|
279
267
|
.formatOptions=${{
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
268
|
+
style: "unit",
|
|
269
|
+
unit: "px"
|
|
270
|
+
}}
|
|
283
271
|
...=${spreadProps(args)}
|
|
284
272
|
@change=${args.onChange}
|
|
285
273
|
></sp-number-field>
|
|
286
274
|
`;
|
|
287
275
|
};
|
|
288
276
|
pixels.args = {
|
|
289
|
-
|
|
277
|
+
value: 800
|
|
290
278
|
};
|
|
291
|
-
export const minMax = (args) => html
|
|
279
|
+
export const minMax = (args) => html`
|
|
292
280
|
<sp-field-label for="min-max">
|
|
293
281
|
Enter a value between 0 and 255
|
|
294
282
|
</sp-field-label>
|
|
@@ -300,12 +288,12 @@ export const minMax = (args) => html `
|
|
|
300
288
|
></sp-number-field>
|
|
301
289
|
`;
|
|
302
290
|
minMax.args = {
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
291
|
+
value: 4,
|
|
292
|
+
min: 0,
|
|
293
|
+
max: 255
|
|
306
294
|
};
|
|
307
295
|
export const hideStepper = (args) => {
|
|
308
|
-
|
|
296
|
+
return html`
|
|
309
297
|
<sp-field-label for="hideStepper">
|
|
310
298
|
Enter a number without the stepper UI
|
|
311
299
|
</sp-field-label>
|
|
@@ -317,11 +305,11 @@ export const hideStepper = (args) => {
|
|
|
317
305
|
`;
|
|
318
306
|
};
|
|
319
307
|
hideStepper.args = {
|
|
320
|
-
|
|
321
|
-
|
|
308
|
+
hideStepper: true,
|
|
309
|
+
value: 67
|
|
322
310
|
};
|
|
323
311
|
export const hideStepperQuiet = (args) => {
|
|
324
|
-
|
|
312
|
+
return html`
|
|
325
313
|
<sp-field-label for="hideStepper">
|
|
326
314
|
Enter a number without the stepper UI
|
|
327
315
|
</sp-field-label>
|
|
@@ -333,12 +321,12 @@ export const hideStepperQuiet = (args) => {
|
|
|
333
321
|
`;
|
|
334
322
|
};
|
|
335
323
|
hideStepperQuiet.args = {
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
324
|
+
hideStepper: true,
|
|
325
|
+
value: 67,
|
|
326
|
+
quiet: true
|
|
339
327
|
};
|
|
340
328
|
export const disabled = (args) => {
|
|
341
|
-
|
|
329
|
+
return html`
|
|
342
330
|
<sp-field-label for="disabled">
|
|
343
331
|
This Number Field is disabled
|
|
344
332
|
</sp-field-label>
|
|
@@ -350,11 +338,11 @@ export const disabled = (args) => {
|
|
|
350
338
|
`;
|
|
351
339
|
};
|
|
352
340
|
disabled.args = {
|
|
353
|
-
|
|
354
|
-
|
|
341
|
+
disabled: true,
|
|
342
|
+
value: 892
|
|
355
343
|
};
|
|
356
344
|
export const readOnly = (args) => {
|
|
357
|
-
|
|
345
|
+
return html`
|
|
358
346
|
<sp-field-label for="readonly">
|
|
359
347
|
You can only read the following value
|
|
360
348
|
</sp-field-label>
|
|
@@ -366,19 +354,17 @@ export const readOnly = (args) => {
|
|
|
366
354
|
`;
|
|
367
355
|
};
|
|
368
356
|
readOnly.args = {
|
|
369
|
-
|
|
370
|
-
|
|
357
|
+
readonly: true,
|
|
358
|
+
value: "15"
|
|
371
359
|
};
|
|
372
360
|
export const ScrollingContainer = (args = {}) => {
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
});
|
|
381
|
-
return html `
|
|
361
|
+
const onChange = args.onChange || (() => {
|
|
362
|
+
return;
|
|
363
|
+
});
|
|
364
|
+
const onInput = args.onInput || (() => {
|
|
365
|
+
return;
|
|
366
|
+
});
|
|
367
|
+
return html`
|
|
382
368
|
<style>
|
|
383
369
|
.scroller {
|
|
384
370
|
height: 140px;
|
|
@@ -411,4 +397,4 @@ export const ScrollingContainer = (args = {}) => {
|
|
|
411
397
|
</div>
|
|
412
398
|
`;
|
|
413
399
|
};
|
|
414
|
-
//# sourceMappingURL=number-field.stories.js.map
|
|
400
|
+
//# sourceMappingURL=number-field.stories.js.map
|