@synergy-design-system/vue 2.30.1 → 2.31.0-numeric.1
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.
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { SynBlurEvent, SynChangeEvent, SynClearEvent, SynFocusEvent, SynInputEvent, SynInvalidEvent, SynInput } from '@synergy-design-system/components';
|
|
1
|
+
import { SynBlurEvent, SynChangeEvent, SynClearEvent, SynFocusEvent, SynInputEvent, SynInvalidEvent, SynClampEvent, SynInput } from '@synergy-design-system/components';
|
|
2
2
|
export type { SynBlurEvent } from '@synergy-design-system/components';
|
|
3
3
|
export type { SynChangeEvent } from '@synergy-design-system/components';
|
|
4
4
|
export type { SynClearEvent } from '@synergy-design-system/components';
|
|
5
5
|
export type { SynFocusEvent } from '@synergy-design-system/components';
|
|
6
6
|
export type { SynInputEvent } from '@synergy-design-system/components';
|
|
7
7
|
export type { SynInvalidEvent } from '@synergy-design-system/components';
|
|
8
|
+
export type { SynClampEvent } from '@synergy-design-system/components';
|
|
8
9
|
declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<{
|
|
9
10
|
title?: SynInput["title"];
|
|
10
11
|
/**
|
|
@@ -138,6 +139,27 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<{
|
|
|
138
139
|
*/
|
|
139
140
|
inputmode?: SynInput["inputmode"];
|
|
140
141
|
/**
|
|
142
|
+
* Defines the strategy for handling numbers in the numeric input.
|
|
143
|
+
This is used to determine how the input behaves when the user interacts with it.
|
|
144
|
+
|
|
145
|
+
Includes the following configuration options:
|
|
146
|
+
|
|
147
|
+
- **autoClamp**: If true, the input will clamp the value to the min and max attributes.
|
|
148
|
+
- **noStepAlign**: If true, the input will not align the value to the step attribute.
|
|
149
|
+
- **noStepValidation**: If true, the input will not validate the value against the step attribute.
|
|
150
|
+
|
|
151
|
+
You may provide this as one of the following values:
|
|
152
|
+
|
|
153
|
+
- 'native': Uses the native browser implementation.
|
|
154
|
+
- 'modern': Uses a more intuitive implementation:
|
|
155
|
+
- Values are clamped to the nearest min or max value.
|
|
156
|
+
- Stepping is inclusive to the provided min and max values.
|
|
157
|
+
- Provided stepping is no longer used in validation.
|
|
158
|
+
- An object that matches the `NumericStrategy` type.
|
|
159
|
+
* Note this can only be set via `property`, not as an `attribute`!
|
|
160
|
+
*/
|
|
161
|
+
numericStrategy?: SynInput["numericStrategy"];
|
|
162
|
+
/**
|
|
141
163
|
* Support for two way data binding
|
|
142
164
|
*/
|
|
143
165
|
modelValue?: SynInput["value"];
|
|
@@ -151,6 +173,7 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<{
|
|
|
151
173
|
"syn-input": (e: SynInputEvent) => any;
|
|
152
174
|
"update:modelValue": (newValue: string) => any;
|
|
153
175
|
"syn-clear": (e: SynClearEvent) => any;
|
|
176
|
+
"syn-clamp": (e: SynClampEvent) => any;
|
|
154
177
|
}, string, import('vue').PublicProps, Readonly<{
|
|
155
178
|
title?: SynInput["title"];
|
|
156
179
|
/**
|
|
@@ -284,6 +307,27 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<{
|
|
|
284
307
|
*/
|
|
285
308
|
inputmode?: SynInput["inputmode"];
|
|
286
309
|
/**
|
|
310
|
+
* Defines the strategy for handling numbers in the numeric input.
|
|
311
|
+
This is used to determine how the input behaves when the user interacts with it.
|
|
312
|
+
|
|
313
|
+
Includes the following configuration options:
|
|
314
|
+
|
|
315
|
+
- **autoClamp**: If true, the input will clamp the value to the min and max attributes.
|
|
316
|
+
- **noStepAlign**: If true, the input will not align the value to the step attribute.
|
|
317
|
+
- **noStepValidation**: If true, the input will not validate the value against the step attribute.
|
|
318
|
+
|
|
319
|
+
You may provide this as one of the following values:
|
|
320
|
+
|
|
321
|
+
- 'native': Uses the native browser implementation.
|
|
322
|
+
- 'modern': Uses a more intuitive implementation:
|
|
323
|
+
- Values are clamped to the nearest min or max value.
|
|
324
|
+
- Stepping is inclusive to the provided min and max values.
|
|
325
|
+
- Provided stepping is no longer used in validation.
|
|
326
|
+
- An object that matches the `NumericStrategy` type.
|
|
327
|
+
* Note this can only be set via `property`, not as an `attribute`!
|
|
328
|
+
*/
|
|
329
|
+
numericStrategy?: SynInput["numericStrategy"];
|
|
330
|
+
/**
|
|
287
331
|
* Support for two way data binding
|
|
288
332
|
*/
|
|
289
333
|
modelValue?: SynInput["value"];
|
|
@@ -295,6 +339,7 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<{
|
|
|
295
339
|
"onSyn-input"?: ((e: SynInputEvent) => any) | undefined;
|
|
296
340
|
"onUpdate:modelValue"?: ((newValue: string) => any) | undefined;
|
|
297
341
|
"onSyn-clear"?: ((e: SynClearEvent) => any) | undefined;
|
|
342
|
+
"onSyn-clamp"?: ((e: SynClampEvent) => any) | undefined;
|
|
298
343
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
299
344
|
nativeElement: unknown;
|
|
300
345
|
}, any>, {
|
|
@@ -33,9 +33,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
33
33
|
enterkeyhint: {},
|
|
34
34
|
spellcheck: {},
|
|
35
35
|
inputmode: {},
|
|
36
|
+
numericStrategy: {},
|
|
36
37
|
modelValue: {}
|
|
37
38
|
},
|
|
38
|
-
emits: ["syn-blur", "syn-change", "syn-clear", "syn-focus", "syn-input", "syn-invalid", "update:modelValue"],
|
|
39
|
+
emits: ["syn-blur", "syn-change", "syn-clear", "syn-focus", "syn-input", "syn-invalid", "syn-clamp", "update:modelValue"],
|
|
39
40
|
setup(__props, { expose: __expose }) {
|
|
40
41
|
const nativeElement = ref();
|
|
41
42
|
__expose({
|
|
@@ -58,6 +59,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
58
59
|
_ctx.$emit("syn-input", $event);
|
|
59
60
|
}),
|
|
60
61
|
onSynInvalid: _cache[5] || (_cache[5] = ($event) => _ctx.$emit("syn-invalid", $event)),
|
|
62
|
+
onSynClamp: _cache[6] || (_cache[6] = ($event) => _ctx.$emit("syn-clamp", $event)),
|
|
61
63
|
value: typeof props.modelValue !== "undefined" ? props.modelValue : typeof props.value !== "undefined" ? props.value : void 0
|
|
62
64
|
}, visibleProps.value, {
|
|
63
65
|
ref_key: "nativeElement",
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"url": "https://www.sick.com"
|
|
5
5
|
},
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@synergy-design-system/components": "^2.
|
|
7
|
+
"@synergy-design-system/components": "^2.31.0-numeric.1"
|
|
8
8
|
},
|
|
9
9
|
"description": "Vue3 wrappers for the Synergy Design System",
|
|
10
10
|
"exports": {
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"directory": "packages/vue"
|
|
41
41
|
},
|
|
42
42
|
"type": "module",
|
|
43
|
-
"version": "2.
|
|
43
|
+
"version": "2.31.0-numeric.1",
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@vitejs/plugin-vue": "^5.2.3",
|
|
46
46
|
"@vue/tsconfig": "^0.7.0",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
* @event syn-focus - Emitted when the control gains focus.
|
|
31
31
|
* @event syn-input - Emitted when the control receives input.
|
|
32
32
|
* @event syn-invalid - Emitted when the form control has been checked for validity and its constraints aren't satisfied.
|
|
33
|
+
* @event syn-clamp - Emitted if the numeric strategy allows autoClamp and the value is clamped to the min or max attribute.
|
|
33
34
|
*
|
|
34
35
|
* @csspart form-control - The form control that wraps the label, input, and help text.
|
|
35
36
|
* @csspart form-control-label - The label's wrapper.
|
|
@@ -60,6 +61,7 @@ import type { SynClearEvent } from '@synergy-design-system/components';
|
|
|
60
61
|
import type { SynFocusEvent } from '@synergy-design-system/components';
|
|
61
62
|
import type { SynInputEvent } from '@synergy-design-system/components';
|
|
62
63
|
import type { SynInvalidEvent } from '@synergy-design-system/components';
|
|
64
|
+
import type { SynClampEvent } from '@synergy-design-system/components';
|
|
63
65
|
import type { SynInput } from '@synergy-design-system/components';
|
|
64
66
|
|
|
65
67
|
// DOM Reference to the element
|
|
@@ -231,6 +233,28 @@ keyboard on supportive devices.
|
|
|
231
233
|
*/
|
|
232
234
|
inputmode?: SynInput['inputmode'];
|
|
233
235
|
|
|
236
|
+
/**
|
|
237
|
+
* Defines the strategy for handling numbers in the numeric input.
|
|
238
|
+
This is used to determine how the input behaves when the user interacts with it.
|
|
239
|
+
|
|
240
|
+
Includes the following configuration options:
|
|
241
|
+
|
|
242
|
+
- **autoClamp**: If true, the input will clamp the value to the min and max attributes.
|
|
243
|
+
- **noStepAlign**: If true, the input will not align the value to the step attribute.
|
|
244
|
+
- **noStepValidation**: If true, the input will not validate the value against the step attribute.
|
|
245
|
+
|
|
246
|
+
You may provide this as one of the following values:
|
|
247
|
+
|
|
248
|
+
- 'native': Uses the native browser implementation.
|
|
249
|
+
- 'modern': Uses a more intuitive implementation:
|
|
250
|
+
- Values are clamped to the nearest min or max value.
|
|
251
|
+
- Stepping is inclusive to the provided min and max values.
|
|
252
|
+
- Provided stepping is no longer used in validation.
|
|
253
|
+
- An object that matches the `NumericStrategy` type.
|
|
254
|
+
* Note this can only be set via `property`, not as an `attribute`!
|
|
255
|
+
*/
|
|
256
|
+
numericStrategy?: SynInput['numericStrategy'];
|
|
257
|
+
|
|
234
258
|
/**
|
|
235
259
|
* Support for two way data binding
|
|
236
260
|
*/
|
|
@@ -279,6 +303,11 @@ defineEmits<{
|
|
|
279
303
|
*/
|
|
280
304
|
'syn-invalid': [e: SynInvalidEvent];
|
|
281
305
|
|
|
306
|
+
/**
|
|
307
|
+
* Emitted if the numeric strategy allows autoClamp and the value is clamped to the min or max attribute.
|
|
308
|
+
*/
|
|
309
|
+
'syn-clamp': [e: SynClampEvent];
|
|
310
|
+
|
|
282
311
|
/**
|
|
283
312
|
* Support for two way data binding
|
|
284
313
|
*/
|
|
@@ -293,6 +322,7 @@ export type { SynClearEvent } from '@synergy-design-system/components';
|
|
|
293
322
|
export type { SynFocusEvent } from '@synergy-design-system/components';
|
|
294
323
|
export type { SynInputEvent } from '@synergy-design-system/components';
|
|
295
324
|
export type { SynInvalidEvent } from '@synergy-design-system/components';
|
|
325
|
+
export type { SynClampEvent } from '@synergy-design-system/components';
|
|
296
326
|
</script>
|
|
297
327
|
|
|
298
328
|
<template>
|
|
@@ -306,6 +336,7 @@ export type { SynInvalidEvent } from '@synergy-design-system/components';
|
|
|
306
336
|
$emit('syn-input', $event);
|
|
307
337
|
"
|
|
308
338
|
@syn-invalid="$emit('syn-invalid', $event)"
|
|
339
|
+
@syn-clamp="$emit('syn-clamp', $event)"
|
|
309
340
|
:value="
|
|
310
341
|
typeof props.modelValue !== 'undefined'
|
|
311
342
|
? props.modelValue
|