aloha-vue 2.52.0 → 2.53.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/CHANGELOG.md +4 -0
- package/dist/aloha-vue.es.js +61000 -61096
- package/dist/aloha-vue.umd.js +209 -209
- package/package.json +1 -1
- package/src/ADropdown/compositionAPI/AttributesAPI.js +100 -101
- package/src/ui/AInputCurrency/AInputCurrency.js +1 -1
- package/src/ui/AInputCurrency/compositionAPI/IncreaseDecreaseAPI.js +76 -76
- package/src/ui/AInputCurrency/compositionAPI/InputEventsAPI.js +26 -26
- package/src/ui/AInputCurrency/compositionAPI/ModelAPI.js +82 -82
- package/src/ui/compositionApi/UiAPI.js +185 -176
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aloha-vue",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.53.0",
|
|
4
4
|
"description": "Aloha-vue is a JavaScript library that provides a wide range of accessible components and directives for Vue.js. Accessibility is of paramount importance to us, and we have designed all our components to meet accessibility compliance criteria. This library is a valuable tool for frontend developers and has already been used in three projects, including two large-scale ones",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"accessibility compliance criteria",
|
|
@@ -1,101 +1,100 @@
|
|
|
1
|
-
import {
|
|
2
|
-
computed,
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
BUTTON_ATTRIBUTES["aria-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
computed,
|
|
3
|
+
ref,
|
|
4
|
+
toRef,
|
|
5
|
+
} from "vue";
|
|
6
|
+
|
|
7
|
+
import ARemPxAPI from "../../compositionAPI/ARemPxAPI";
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
assign,
|
|
11
|
+
cloneDeep,
|
|
12
|
+
} from "lodash-es";
|
|
13
|
+
|
|
14
|
+
export default function AttributesAPI(props, {
|
|
15
|
+
eventsMenu = computed(() => ({})),
|
|
16
|
+
statusExpanded = ref(false),
|
|
17
|
+
wasOpened = ref(false),
|
|
18
|
+
}) {
|
|
19
|
+
const buttonAttributes = toRef(props, "buttonAttributes");
|
|
20
|
+
const buttonTag = toRef(props, "buttonTag");
|
|
21
|
+
const disabled = toRef(props, "disabled");
|
|
22
|
+
const dropdownAttributes = toRef(props, "dropdownAttributes");
|
|
23
|
+
const dropdownClass = toRef(props, "dropdownClass");
|
|
24
|
+
const id = toRef(props, "id");
|
|
25
|
+
const menuWidth = toRef(props, "menuWidth");
|
|
26
|
+
const persist = toRef(props, "persist");
|
|
27
|
+
const readonly = toRef(props, "readonly");
|
|
28
|
+
const useRem = toRef(props, "useRem");
|
|
29
|
+
|
|
30
|
+
const {
|
|
31
|
+
scalePxWithRem,
|
|
32
|
+
} = ARemPxAPI();
|
|
33
|
+
|
|
34
|
+
const buttonTagLocal = computed(() => {
|
|
35
|
+
if (readonly.value) {
|
|
36
|
+
return "span";
|
|
37
|
+
}
|
|
38
|
+
return buttonTag.value;
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
const idLocal = computed(() => {
|
|
42
|
+
return buttonAttributes.value.id || id.value;
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
const buttonAttributesLocal = computed(() => {
|
|
46
|
+
const BUTTON_ATTRIBUTES = cloneDeep(buttonAttributes.value);
|
|
47
|
+
if (readonly.value) {
|
|
48
|
+
return BUTTON_ATTRIBUTES;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
BUTTON_ATTRIBUTES["aria-haspopup"] = "true";
|
|
52
|
+
BUTTON_ATTRIBUTES["aria-expanded"] = statusExpanded.value;
|
|
53
|
+
|
|
54
|
+
if (buttonTag.value === "button") {
|
|
55
|
+
BUTTON_ATTRIBUTES.type = BUTTON_ATTRIBUTES.type || "button";
|
|
56
|
+
}
|
|
57
|
+
return BUTTON_ATTRIBUTES;
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
const buttonAttributesDisabled = computed(() => {
|
|
61
|
+
const ATTRIBUTES = {};
|
|
62
|
+
if (disabled.value) {
|
|
63
|
+
if (buttonTag.value === "button") {
|
|
64
|
+
ATTRIBUTES.disabled = true;
|
|
65
|
+
} else if (buttonTag.value === "a") {
|
|
66
|
+
ATTRIBUTES.ariaDisabled = true;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return ATTRIBUTES;
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
const dropdownAttributesLocal = computed(() => {
|
|
74
|
+
const DROPDOWN_ATTRIBUTES = cloneDeep(dropdownAttributes.value);
|
|
75
|
+
DROPDOWN_ATTRIBUTES.class = ["a_dropdown__menu", dropdownClass.value, {
|
|
76
|
+
a_dropdown__menu_show: statusExpanded.value,
|
|
77
|
+
}];
|
|
78
|
+
if (menuWidth.value) {
|
|
79
|
+
if (useRem.value) {
|
|
80
|
+
DROPDOWN_ATTRIBUTES.style = `width: ${ scalePxWithRem(menuWidth.value) }px`;
|
|
81
|
+
} else {
|
|
82
|
+
DROPDOWN_ATTRIBUTES.style = `width: ${ menuWidth.value }px`;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return assign({}, DROPDOWN_ATTRIBUTES, eventsMenu.value);
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
const isMenuRendered = computed(() => {
|
|
89
|
+
return statusExpanded.value || (persist.value && wasOpened.value);
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
return {
|
|
93
|
+
idLocal,
|
|
94
|
+
buttonAttributesDisabled,
|
|
95
|
+
buttonAttributesLocal,
|
|
96
|
+
buttonTagLocal,
|
|
97
|
+
dropdownAttributesLocal,
|
|
98
|
+
isMenuRendered,
|
|
99
|
+
};
|
|
100
|
+
}
|
|
@@ -386,7 +386,7 @@ export default {
|
|
|
386
386
|
const isSameAsLocalModel = newVal === localModel.value;
|
|
387
387
|
if (!isInternalChange.value || !isSameAsLocalModel) {
|
|
388
388
|
localModel.value = newVal;
|
|
389
|
-
handleInput(null, newVal, true);
|
|
389
|
+
handleInput(null, { value: newVal, updateOutside: true, triggerDetails: "modelChange" });
|
|
390
390
|
}
|
|
391
391
|
isInternalChange.value = false;
|
|
392
392
|
});
|
|
@@ -1,76 +1,76 @@
|
|
|
1
|
-
import {
|
|
2
|
-
computed,
|
|
3
|
-
toRef,
|
|
4
|
-
} from "vue";
|
|
5
|
-
|
|
6
|
-
export default function IncreaseDecreaseAPI(props, {
|
|
7
|
-
adjustFloatPartAndDivider = () => {},
|
|
8
|
-
ensurePrecision = () => {},
|
|
9
|
-
setCurrentValue = () => {},
|
|
10
|
-
modelNumber = computed(() => undefined),
|
|
11
|
-
}) {
|
|
12
|
-
const decimalDivider = toRef(props, "decimalDivider");
|
|
13
|
-
const disabled = toRef(props, "disabled");
|
|
14
|
-
const modelValue = toRef(props, "modelValue");
|
|
15
|
-
const max = toRef(props, "max");
|
|
16
|
-
const min = toRef(props, "min");
|
|
17
|
-
const step = toRef(props, "step");
|
|
18
|
-
|
|
19
|
-
const minDisabled = computed(() => {
|
|
20
|
-
return modelNumber.value <= min.value;
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
const maxDisabled = computed(() => {
|
|
24
|
-
return modelNumber.value >= max.value;
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
const setMaximumValue = () => {
|
|
28
|
-
const newVal = adjustFloatPartAndDivider(max.value);
|
|
29
|
-
setCurrentValue(newVal);
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
const setMinimumValue = () => {
|
|
33
|
-
const newVal = adjustFloatPartAndDivider(min.value);
|
|
34
|
-
setCurrentValue(newVal);
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
const increase = () => {
|
|
38
|
-
if (disabled.value || maxDisabled.value) {
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
const value = modelNumber.value;
|
|
42
|
-
const newValue = ensurePrecision({
|
|
43
|
-
value,
|
|
44
|
-
currentValue: modelValue.value,
|
|
45
|
-
}).replace(".", decimalDivider.value);
|
|
46
|
-
if (value + step.value > max.value) {
|
|
47
|
-
setMaximumValue();
|
|
48
|
-
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
setCurrentValue(adjustFloatPartAndDivider(newValue));
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
const decrease = () => {
|
|
55
|
-
if (disabled.value || minDisabled.value) {
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
const value = modelNumber.value;
|
|
59
|
-
const newValue = ensurePrecision({
|
|
60
|
-
value,
|
|
61
|
-
currentValue: modelValue.value,
|
|
62
|
-
coefficient: -1,
|
|
63
|
-
}).replace(".", decimalDivider.value);
|
|
64
|
-
if (value - step.value < min.value) {
|
|
65
|
-
setMinimumValue();
|
|
66
|
-
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
setCurrentValue(adjustFloatPartAndDivider(newValue));
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
return {
|
|
73
|
-
increase,
|
|
74
|
-
decrease,
|
|
75
|
-
};
|
|
76
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
computed,
|
|
3
|
+
toRef,
|
|
4
|
+
} from "vue";
|
|
5
|
+
|
|
6
|
+
export default function IncreaseDecreaseAPI(props, {
|
|
7
|
+
adjustFloatPartAndDivider = () => {},
|
|
8
|
+
ensurePrecision = () => {},
|
|
9
|
+
setCurrentValue = () => {},
|
|
10
|
+
modelNumber = computed(() => undefined),
|
|
11
|
+
}) {
|
|
12
|
+
const decimalDivider = toRef(props, "decimalDivider");
|
|
13
|
+
const disabled = toRef(props, "disabled");
|
|
14
|
+
const modelValue = toRef(props, "modelValue");
|
|
15
|
+
const max = toRef(props, "max");
|
|
16
|
+
const min = toRef(props, "min");
|
|
17
|
+
const step = toRef(props, "step");
|
|
18
|
+
|
|
19
|
+
const minDisabled = computed(() => {
|
|
20
|
+
return modelNumber.value <= min.value;
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
const maxDisabled = computed(() => {
|
|
24
|
+
return modelNumber.value >= max.value;
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const setMaximumValue = () => {
|
|
28
|
+
const newVal = adjustFloatPartAndDivider(max.value);
|
|
29
|
+
setCurrentValue({ value: newVal });
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const setMinimumValue = () => {
|
|
33
|
+
const newVal = adjustFloatPartAndDivider(min.value);
|
|
34
|
+
setCurrentValue({ value: newVal });
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const increase = () => {
|
|
38
|
+
if (disabled.value || maxDisabled.value) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
const value = modelNumber.value;
|
|
42
|
+
const newValue = ensurePrecision({
|
|
43
|
+
value,
|
|
44
|
+
currentValue: modelValue.value,
|
|
45
|
+
}).replace(".", decimalDivider.value);
|
|
46
|
+
if (value + step.value > max.value) {
|
|
47
|
+
setMaximumValue();
|
|
48
|
+
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
setCurrentValue({ value: adjustFloatPartAndDivider(newValue) });
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const decrease = () => {
|
|
55
|
+
if (disabled.value || minDisabled.value) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
const value = modelNumber.value;
|
|
59
|
+
const newValue = ensurePrecision({
|
|
60
|
+
value,
|
|
61
|
+
currentValue: modelValue.value,
|
|
62
|
+
coefficient: -1,
|
|
63
|
+
}).replace(".", decimalDivider.value);
|
|
64
|
+
if (value - step.value < min.value) {
|
|
65
|
+
setMinimumValue();
|
|
66
|
+
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
setCurrentValue({ value: adjustFloatPartAndDivider(newValue) });
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
return {
|
|
73
|
+
increase,
|
|
74
|
+
decrease,
|
|
75
|
+
};
|
|
76
|
+
}
|
|
@@ -56,8 +56,8 @@ export default function InputEventsAPI(props, {
|
|
|
56
56
|
return Number(`${ val }`.replaceAll(thousandDivider.value, "").replace(decimalDivider.value, "."));
|
|
57
57
|
};
|
|
58
58
|
|
|
59
|
-
const setValueLocal = (
|
|
60
|
-
setCurrentValue(
|
|
59
|
+
const setValueLocal = ({ value, updateOutside, trigger, triggerDetails }) => {
|
|
60
|
+
setCurrentValue({ value, updateOutside, trigger, triggerDetails });
|
|
61
61
|
};
|
|
62
62
|
|
|
63
63
|
const setCursorPosition = position => {
|
|
@@ -66,14 +66,14 @@ export default function InputEventsAPI(props, {
|
|
|
66
66
|
});
|
|
67
67
|
};
|
|
68
68
|
|
|
69
|
-
const setMaximumValue = () => {
|
|
69
|
+
const setMaximumValue = ({ trigger, triggerDetails } = {}) => {
|
|
70
70
|
const newVal = adjustFloatPartAndDivider(max.value);
|
|
71
|
-
setValueLocal(newVal);
|
|
71
|
+
setValueLocal({ value: newVal, trigger, triggerDetails });
|
|
72
72
|
};
|
|
73
73
|
|
|
74
|
-
const setMinimumValue = () => {
|
|
74
|
+
const setMinimumValue = ({ trigger, triggerDetails } = {}) => {
|
|
75
75
|
const newVal = adjustFloatPartAndDivider(min.value);
|
|
76
|
-
setValueLocal(newVal);
|
|
76
|
+
setValueLocal({ value: newVal, trigger, triggerDetails });
|
|
77
77
|
};
|
|
78
78
|
|
|
79
79
|
const validateMinMax = val => {
|
|
@@ -90,9 +90,9 @@ export default function InputEventsAPI(props, {
|
|
|
90
90
|
}
|
|
91
91
|
};
|
|
92
92
|
|
|
93
|
-
const handleInput = ($event, _value, updateOutside = false) => {
|
|
93
|
+
const handleInput = ($event, { value: _value, updateOutside = false, triggerDetails = "keydown" } = {}) => {
|
|
94
94
|
if (!required.value && isNil(_value) && !$event?.target?.value) {
|
|
95
|
-
setValueLocal(_value, updateOutside);
|
|
95
|
+
setValueLocal({ value: _value, updateOutside, triggerDetails });
|
|
96
96
|
|
|
97
97
|
return;
|
|
98
98
|
}
|
|
@@ -138,7 +138,7 @@ export default function InputEventsAPI(props, {
|
|
|
138
138
|
return;
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
|
-
setValueLocal(newVal, updateOutside);
|
|
141
|
+
setValueLocal({ value: newVal, updateOutside, triggerDetails });
|
|
142
142
|
setCursorPosition(cursorPosition);
|
|
143
143
|
};
|
|
144
144
|
|
|
@@ -158,7 +158,7 @@ export default function InputEventsAPI(props, {
|
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
160
|
|
|
161
|
-
setValueLocal(newVal);
|
|
161
|
+
setValueLocal({ value: newVal, triggerDetails: "decrement" });
|
|
162
162
|
isTimeoutActive.value--;
|
|
163
163
|
}, timeoutDelay);
|
|
164
164
|
}
|
|
@@ -177,7 +177,7 @@ export default function InputEventsAPI(props, {
|
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
179
|
|
|
180
|
-
setValueLocal(newVal);
|
|
180
|
+
setValueLocal({ value: newVal, triggerDetails: "increment" });
|
|
181
181
|
isTimeoutActive.value--;
|
|
182
182
|
}, timeoutDelay);
|
|
183
183
|
}
|
|
@@ -221,7 +221,7 @@ export default function InputEventsAPI(props, {
|
|
|
221
221
|
const positionToSet = value.length + 1;
|
|
222
222
|
if (valueAfterKeyPress[valueAfterKeyPress.length - 1] === decimalDivider.value) {
|
|
223
223
|
valueAfterKeyPress += times(decimalPartLength.value, () => "0").join("");
|
|
224
|
-
setValueLocal(valueAfterKeyPress);
|
|
224
|
+
setValueLocal({ value: valueAfterKeyPress, triggerDetails: "keydown" });
|
|
225
225
|
setCursorPosition(positionToSet);
|
|
226
226
|
}
|
|
227
227
|
} else {
|
|
@@ -239,7 +239,7 @@ export default function InputEventsAPI(props, {
|
|
|
239
239
|
intVal,
|
|
240
240
|
floatVal,
|
|
241
241
|
].join(decimalDivider.value);
|
|
242
|
-
setValueLocal(result);
|
|
242
|
+
setValueLocal({ value: result, triggerDetails: "keydown" });
|
|
243
243
|
setCursorPosition(intVal.length + 1);
|
|
244
244
|
}
|
|
245
245
|
isTimeoutActive.value--;
|
|
@@ -265,7 +265,7 @@ export default function InputEventsAPI(props, {
|
|
|
265
265
|
isTimeoutActive.value++;
|
|
266
266
|
requestAnimationFrame(() => {
|
|
267
267
|
setCursorPositionForBackspace({ cursorPosition, numberOfSymbols });
|
|
268
|
-
setValueLocal(intVal);
|
|
268
|
+
setValueLocal({ value: intVal, triggerDetails: "backspace" });
|
|
269
269
|
isTimeoutActive.value--;
|
|
270
270
|
}, timeoutDelay);
|
|
271
271
|
|
|
@@ -283,7 +283,7 @@ export default function InputEventsAPI(props, {
|
|
|
283
283
|
if (!isInteger.value && hasDecimalDivider && value[cursorPosition] === decimalDivider.value) {
|
|
284
284
|
const splitVal = value.split(decimalDivider.value);
|
|
285
285
|
const intVal = splitVal[0];
|
|
286
|
-
setValueLocal(intVal);
|
|
286
|
+
setValueLocal({ value: intVal, triggerDetails: "delete" });
|
|
287
287
|
setCursorPosition(cursorPosition);
|
|
288
288
|
|
|
289
289
|
return;
|
|
@@ -315,7 +315,7 @@ export default function InputEventsAPI(props, {
|
|
|
315
315
|
} else {
|
|
316
316
|
newVal = valWithDivider;
|
|
317
317
|
}
|
|
318
|
-
setValueLocal(newVal);
|
|
318
|
+
setValueLocal({ value: newVal, triggerDetails: "delete" });
|
|
319
319
|
setCursorPosition(positionToSet + 1);
|
|
320
320
|
} else {
|
|
321
321
|
requestAnimationFrame(() => {
|
|
@@ -440,7 +440,7 @@ export default function InputEventsAPI(props, {
|
|
|
440
440
|
const splitVal = value.split("");
|
|
441
441
|
splitVal[cursorPosition] = keyValue;
|
|
442
442
|
const newVal = splitVal.join("");
|
|
443
|
-
setValueLocal(newVal);
|
|
443
|
+
setValueLocal({ value: newVal, triggerDetails: "keydown" });
|
|
444
444
|
isTimeoutActive.value++;
|
|
445
445
|
requestAnimationFrame(() => {
|
|
446
446
|
setCursorPosition(cursorPosition + 1);
|
|
@@ -475,7 +475,7 @@ export default function InputEventsAPI(props, {
|
|
|
475
475
|
if (cursorPosition === 0 && value.length && value[0] === "0") {
|
|
476
476
|
$event.preventDefault();
|
|
477
477
|
const newVal = `${ keyValue }${ value.slice(1) }`;
|
|
478
|
-
setValueLocal(newVal);
|
|
478
|
+
setValueLocal({ value: newVal, triggerDetails: "keydown" });
|
|
479
479
|
setCursorPosition(1);
|
|
480
480
|
} else {
|
|
481
481
|
const numberOfSymbols = value.length;
|
|
@@ -543,7 +543,7 @@ export default function InputEventsAPI(props, {
|
|
|
543
543
|
.match(/.{1,3}/g).join(thousandDivider.value)
|
|
544
544
|
.split("").reverse().join("");
|
|
545
545
|
const valueToPaste = [intValToPaste, floatVal].join(decimalDivider.value);
|
|
546
|
-
handleInput(null, valueToPaste);
|
|
546
|
+
handleInput(null, { value: valueToPaste, triggerDetails: "paste" });
|
|
547
547
|
};
|
|
548
548
|
|
|
549
549
|
const onBlurNumber = $event => {
|
|
@@ -558,25 +558,25 @@ export default function InputEventsAPI(props, {
|
|
|
558
558
|
const value = decimalDivider.value
|
|
559
559
|
? `0${ decimalDivider.value }${ times(decimalPartLength.value, () => "0").join("") }`
|
|
560
560
|
: "0";
|
|
561
|
-
setValueLocal(value);
|
|
561
|
+
setValueLocal({ value, trigger: "blur", triggerDetails: "blur" });
|
|
562
562
|
} else {
|
|
563
|
-
setMinimumValue();
|
|
563
|
+
setMinimumValue({ trigger: "blur", triggerDetails: "blur" });
|
|
564
564
|
}
|
|
565
565
|
onBlur($event);
|
|
566
566
|
|
|
567
567
|
return;
|
|
568
568
|
}
|
|
569
569
|
const value = modelUndefinedLocal.value;
|
|
570
|
-
setValueLocal(value);
|
|
570
|
+
setValueLocal({ value, trigger: "blur", triggerDetails: "blur" });
|
|
571
571
|
onBlur($event);
|
|
572
572
|
|
|
573
573
|
return;
|
|
574
574
|
} else if (!isNil(min.value) && modelNumber.value < min.value) {
|
|
575
|
-
setMinimumValue();
|
|
575
|
+
setMinimumValue({ trigger: "blur", triggerDetails: "blur" });
|
|
576
576
|
|
|
577
577
|
return;
|
|
578
578
|
} else if (!isNil(max.value) && modelNumber.value > max.value) {
|
|
579
|
-
setMaximumValue();
|
|
579
|
+
setMaximumValue({ triggerDetails: "blur" });
|
|
580
580
|
|
|
581
581
|
return;
|
|
582
582
|
}
|
|
@@ -589,7 +589,7 @@ export default function InputEventsAPI(props, {
|
|
|
589
589
|
} else if (floatVal.length < decimalPartLength.value) {
|
|
590
590
|
value += `${ times(decimalPartLength.value - floatVal.length, () => "0").join("") }`;
|
|
591
591
|
}
|
|
592
|
-
setValueLocal(value);
|
|
592
|
+
setValueLocal({ value, trigger: "blur", triggerDetails: "blur" });
|
|
593
593
|
}
|
|
594
594
|
onBlur($event);
|
|
595
595
|
};
|
|
@@ -645,7 +645,7 @@ export default function InputEventsAPI(props, {
|
|
|
645
645
|
modelUndefinedLocal.value;
|
|
646
646
|
}
|
|
647
647
|
const shouldInitModel = required.value && !hasModel;
|
|
648
|
-
handleInput(null, valueToSet, !shouldInitModel);
|
|
648
|
+
handleInput(null, { value: valueToSet, updateOutside: !shouldInitModel, triggerDetails: "init" });
|
|
649
649
|
});
|
|
650
650
|
};
|
|
651
651
|
|