@eturnity/eturnity_reusable_components 8.26.1 → 8.26.3
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/dist/main.es12.js +2 -2
- package/dist/main.es13.js +3 -3
- package/dist/main.es14.js +2 -2
- package/dist/main.es15.js +22 -62
- package/dist/main.es16.js +1031 -174
- package/dist/main.es17.js +224 -21
- package/dist/main.es18.js +89 -1046
- package/dist/main.es19.js +2 -227
- package/dist/main.es20.js +510 -68
- package/dist/main.es21.js +199 -2
- package/dist/main.es22.js +148 -473
- package/dist/main.es23.js +60 -212
- package/dist/main.es24.js +2 -2
- package/dist/main.es5.js +3 -3
- package/dist/main.es6.js +4 -4
- package/dist/main.es9.js +1 -1
- package/package.json +1 -1
- package/src/components/errorMessage/index.vue +1 -1
- package/src/components/inputs/inputNumber/index.vue +3 -2
- package/src/components/inputs/inputText/index.vue +1 -3
- package/src/components/tableDropdown/index.vue +7 -5
- package/src/helpers/numberConverter.js +10 -1
package/dist/main.es23.js
CHANGED
@@ -1,218 +1,66 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
const
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
return (_d = (_c = (_b = (_a = props.theme) == null ? void 0 : _a.mainButton) == null ? void 0 : _b.size) == null ? void 0 : _c[props.buttonSize]) == null ? void 0 : _d.padding;
|
25
|
-
}};
|
26
|
-
font-size: ${(props) => {
|
27
|
-
var _a, _b, _c, _d;
|
28
|
-
return (_d = (_c = (_b = (_a = props.theme) == null ? void 0 : _a.mainButton) == null ? void 0 : _b.size) == null ? void 0 : _c[props.buttonSize]) == null ? void 0 : _d.fontSize;
|
29
|
-
}};
|
30
|
-
color: ${(props) => props.isDisabled ? props.theme.mainButton[props.appTheme][props.type][props.variant].disabled.textColor : props.theme.mainButton[props.appTheme][props.type][props.variant].default.textColor};
|
31
|
-
background-color: ${(props) => props.isDisabled ? props.theme.mainButton[props.appTheme][props.type][props.variant].disabled.backgroundColor : props.theme.mainButton[props.appTheme][props.type][props.variant].default.backgroundColor};
|
32
|
-
border: ${(props) => {
|
33
|
-
const borderValue = props.isDisabled ? props.theme.mainButton[props.appTheme][props.type][props.variant].disabled.borderColor : props.theme.mainButton[props.appTheme][props.type][props.variant].default.borderColor;
|
34
|
-
return borderValue ? "1px solid " + borderValue : "none";
|
35
|
-
}};
|
36
|
-
border-radius: 4px;
|
37
|
-
text-align: center;
|
38
|
-
cursor: ${(props) => props.isDisabled ? "not-allowed" : "pointer"};
|
39
|
-
user-select: none;
|
40
|
-
${(props) => props.minWidth ? `min-width: ${props.minWidth};` : ""};
|
41
|
-
${(props) => props.noWrap ? `white-space: nowrap;` : ""};
|
42
|
-
height: ${(props) => props.height};
|
43
|
-
line-height: 1;
|
44
|
-
|
45
|
-
&:hover {
|
46
|
-
background-color: ${(props) => props.isDisabled ? props.theme.mainButton[props.appTheme][props.type][props.variant].disabled.backgroundColor : props.theme.mainButton[props.appTheme][props.type][props.variant].hover.backgroundColor};
|
47
|
-
}
|
48
|
-
|
49
|
-
&:active {
|
50
|
-
background-color: ${(props) => props.isDisabled ? props.theme.mainButton[props.appTheme][props.type][props.variant].disabled.backgroundColor : props.theme.mainButton[props.appTheme][props.type][props.variant].active.backgroundColor};
|
51
|
-
}
|
52
|
-
`;
|
53
|
-
const AltAttrs = {
|
54
|
-
altStyle: Boolean,
|
55
|
-
color: String
|
56
|
-
};
|
57
|
-
styled("div", AltAttrs)`
|
58
|
-
background-color: ${(props) => props.color ? props.color : props.theme.colors.transparentWhite1};
|
59
|
-
padding: 7px;
|
60
|
-
height: 100%;
|
61
|
-
width: 30%;
|
62
|
-
justify-content: center;
|
63
|
-
display: flex;
|
64
|
-
align-items: center;
|
65
|
-
border-radius: 4px 0 0 4px;
|
66
|
-
color: ${(props) => props.theme.colors.white};
|
67
|
-
all: ${(props) => props.altStyle ? "" : "unset"};
|
68
|
-
`;
|
69
|
-
styled("span", AltAttrs)`
|
70
|
-
padding: ${(props) => props.altStyle ? "7px" : "0"};
|
71
|
-
all: ${(props) => props.altStyle ? "" : "unset"};
|
72
|
-
`;
|
73
|
-
const LabelAttrs = {
|
74
|
-
hasIcon: Boolean
|
1
|
+
function makeMap(str, expectsLowerCase) {
|
2
|
+
const map = /* @__PURE__ */ Object.create(null);
|
3
|
+
const list = str.split(",");
|
4
|
+
for (let i = 0; i < list.length; i++) {
|
5
|
+
map[list[i]] = true;
|
6
|
+
}
|
7
|
+
return expectsLowerCase ? (val) => !!map[val.toLowerCase()] : (val) => !!map[val];
|
8
|
+
}
|
9
|
+
!!(process.env.NODE_ENV !== "production") ? Object.freeze({}) : {};
|
10
|
+
!!(process.env.NODE_ENV !== "production") ? Object.freeze([]) : [];
|
11
|
+
const onRE = /^on[^a-z]/;
|
12
|
+
const isOn = (key) => onRE.test(key);
|
13
|
+
const isModelListener = (key) => key.startsWith("onUpdate:");
|
14
|
+
const extend = Object.assign;
|
15
|
+
const isArray = Array.isArray;
|
16
|
+
const isFunction = (val) => typeof val === "function";
|
17
|
+
const isString = (val) => typeof val === "string";
|
18
|
+
const cacheStringFunction = (fn) => {
|
19
|
+
const cache = /* @__PURE__ */ Object.create(null);
|
20
|
+
return (str) => {
|
21
|
+
const hit = cache[str];
|
22
|
+
return hit || (cache[str] = fn(str));
|
23
|
+
};
|
75
24
|
};
|
76
|
-
const
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
LabelComponent,
|
87
|
-
PageContainer,
|
88
|
-
ButtonContainer
|
89
|
-
},
|
90
|
-
props: {
|
91
|
-
type: {
|
92
|
-
required: false,
|
93
|
-
default: "primary",
|
94
|
-
// primary, secondary, tertiary, ghost
|
95
|
-
type: String
|
96
|
-
},
|
97
|
-
variant: {
|
98
|
-
required: false,
|
99
|
-
default: "main",
|
100
|
-
// main, cancel
|
101
|
-
type: String
|
102
|
-
},
|
103
|
-
isDisabled: {
|
104
|
-
required: false,
|
105
|
-
default: false,
|
106
|
-
type: Boolean
|
107
|
-
},
|
108
|
-
icon: {
|
109
|
-
required: false,
|
110
|
-
default: null,
|
111
|
-
type: String
|
112
|
-
},
|
113
|
-
iconColor: {
|
114
|
-
required: false,
|
115
|
-
default: "",
|
116
|
-
type: String
|
117
|
-
},
|
118
|
-
iconAltStyle: {
|
119
|
-
required: false,
|
120
|
-
default: false,
|
121
|
-
type: Boolean
|
122
|
-
},
|
123
|
-
iconAltStyleColor: {
|
124
|
-
required: false,
|
125
|
-
default: null,
|
126
|
-
type: String
|
127
|
-
},
|
128
|
-
text: {
|
129
|
-
required: true,
|
130
|
-
type: String
|
131
|
-
},
|
132
|
-
noWrap: {
|
133
|
-
required: false,
|
134
|
-
default: false,
|
135
|
-
type: Boolean
|
136
|
-
},
|
137
|
-
minWidth: {
|
138
|
-
required: false,
|
139
|
-
default: null,
|
140
|
-
type: String
|
141
|
-
},
|
142
|
-
height: {
|
143
|
-
required: false,
|
144
|
-
default: "auto",
|
145
|
-
type: String
|
146
|
-
},
|
147
|
-
id: {
|
148
|
-
required: false,
|
149
|
-
default: null,
|
150
|
-
type: String
|
151
|
-
},
|
152
|
-
dataId: {
|
153
|
-
type: String,
|
154
|
-
default: ""
|
155
|
-
},
|
156
|
-
dataQaId: {
|
157
|
-
type: String,
|
158
|
-
default: ""
|
159
|
-
},
|
160
|
-
appTheme: {
|
161
|
-
type: String,
|
162
|
-
default: "light"
|
163
|
-
},
|
164
|
-
buttonSize: {
|
165
|
-
type: String,
|
166
|
-
default: "medium",
|
167
|
-
required: false
|
168
|
-
}
|
169
|
-
},
|
170
|
-
computed: {
|
171
|
-
theme() {
|
172
|
-
return theme;
|
173
|
-
},
|
174
|
-
getIconColor() {
|
175
|
-
return this.isDisabled ? this.theme.mainButton[this.appTheme][this.type][this.variant].disabled.textColor : this.iconColor ? this.iconColor : this.theme.mainButton[this.appTheme][this.type][this.variant].default.textColor;
|
176
|
-
}
|
25
|
+
const hyphenateRE = /\B([A-Z])/g;
|
26
|
+
const hyphenate = cacheStringFunction(
|
27
|
+
(str) => str.replace(hyphenateRE, "-$1").toLowerCase()
|
28
|
+
);
|
29
|
+
const capitalize = cacheStringFunction(
|
30
|
+
(str) => str.charAt(0).toUpperCase() + str.slice(1)
|
31
|
+
);
|
32
|
+
const invokeArrayFns = (fns, arg) => {
|
33
|
+
for (let i = 0; i < fns.length; i++) {
|
34
|
+
fns[i](arg);
|
177
35
|
}
|
178
36
|
};
|
179
|
-
|
180
|
-
const
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
height: $props.height,
|
192
|
-
"is-disabled": $props.isDisabled,
|
193
|
-
"min-width": $props.minWidth,
|
194
|
-
"no-wrap": $props.noWrap,
|
195
|
-
type: $props.type,
|
196
|
-
variant: $props.variant
|
197
|
-
}, {
|
198
|
-
default: withCtx(() => [createVNode(_component_LabelComponent, {
|
199
|
-
"has-icon": Boolean($props.icon)
|
200
|
-
}, {
|
201
|
-
default: withCtx(() => [$props.icon ? (openBlock(), createBlock(_component_Icon, {
|
202
|
-
key: 0,
|
203
|
-
color: $options.getIconColor,
|
204
|
-
"hovered-color": $options.getIconColor,
|
205
|
-
name: $props.icon,
|
206
|
-
size: "14px"
|
207
|
-
}, null, 8, ["color", "hovered-color", "name"])) : createCommentVNode("", true), createTextVNode(" " + toDisplayString($props.text), 1)]),
|
208
|
-
_: 1
|
209
|
-
}, 8, ["has-icon"])]),
|
210
|
-
_: 1
|
211
|
-
}, 8, ["id", "app-theme", "button-size", "data-id", "data-qa-id", "height", "is-disabled", "min-width", "no-wrap", "type", "variant"])]),
|
212
|
-
_: 1
|
213
|
-
});
|
37
|
+
const looseToNumber = (val) => {
|
38
|
+
const n = parseFloat(val);
|
39
|
+
return isNaN(n) ? val : n;
|
40
|
+
};
|
41
|
+
const HTML_TAGS = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot";
|
42
|
+
const SVG_TAGS = "svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view";
|
43
|
+
const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS);
|
44
|
+
const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);
|
45
|
+
const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
|
46
|
+
const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
|
47
|
+
function includeBooleanAttr(value) {
|
48
|
+
return !!value || value === "";
|
214
49
|
}
|
215
|
-
const RCButton = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
216
50
|
export {
|
217
|
-
|
51
|
+
capitalize,
|
52
|
+
extend,
|
53
|
+
hyphenate,
|
54
|
+
includeBooleanAttr,
|
55
|
+
invokeArrayFns,
|
56
|
+
isArray,
|
57
|
+
isFunction,
|
58
|
+
isHTMLTag,
|
59
|
+
isModelListener,
|
60
|
+
isOn,
|
61
|
+
isSVGTag,
|
62
|
+
isSpecialBooleanAttr,
|
63
|
+
isString,
|
64
|
+
looseToNumber,
|
65
|
+
makeMap
|
218
66
|
};
|
package/dist/main.es24.js
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
import "./main.es3.js";
|
2
2
|
import styled from "./main.es7.js";
|
3
3
|
import { fetchIcon } from "./main.es377.js";
|
4
|
-
import { reactive } from "./main.
|
4
|
+
import { reactive } from "./main.es16.js";
|
5
5
|
import { computed, onMounted, watch, openBlock, createBlock, withCtx, createVNode, createElementVNode as createBaseVNode, createTextVNode, createCommentVNode } from "./main.es6.js";
|
6
|
-
import { toDisplayString } from "./main.
|
6
|
+
import { toDisplayString } from "./main.es21.js";
|
7
7
|
const _hoisted_1 = ["innerHTML"];
|
8
8
|
const _sfc_main = {
|
9
9
|
__name: "index",
|
package/dist/main.es5.js
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
import { isRuntimeOnly, warn, createRenderer, callWithAsyncErrorHandling } from "./main.es6.js";
|
2
2
|
import { Comment, Fragment, Static, Teleport, Text, callWithErrorHandling, cloneVNode, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createStaticVNode, createTextVNode, createVNode, defineComponent, devtools, getCurrentInstance, guardReactiveProps, h, handleError, initCustomFormatter, inject, isVNode, mergeProps, nextTick, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onServerPrefetch, onUnmounted, onUpdated, openBlock, provide, queuePostFlushCb, renderList, renderSlot, resolveComponent, resolveDynamicComponent, setBlockTracking, setDevtoolsHook, ssrContextKey, useSSRContext, version, watch, watchEffect, withCtx, withDirectives } from "./main.es6.js";
|
3
|
-
import { isFunction, isHTMLTag, isSVGTag, isString, looseToNumber, isArray, invokeArrayFns, hyphenate, extend, isOn, isModelListener, capitalize, isSpecialBooleanAttr, includeBooleanAttr } from "./main.
|
4
|
-
import { camelize } from "./main.
|
5
|
-
import { capitalize as capitalize2, normalizeClass, normalizeStyle, toDisplayString, toHandlerKey } from "./main.
|
3
|
+
import { isFunction, isHTMLTag, isSVGTag, isString, looseToNumber, isArray, invokeArrayFns, hyphenate, extend, isOn, isModelListener, capitalize, isSpecialBooleanAttr, includeBooleanAttr } from "./main.es23.js";
|
4
|
+
import { camelize } from "./main.es21.js";
|
5
|
+
import { capitalize as capitalize2, normalizeClass, normalizeStyle, toDisplayString, toHandlerKey } from "./main.es21.js";
|
6
6
|
const svgNS = "http://www.w3.org/2000/svg";
|
7
7
|
const doc = typeof document !== "undefined" ? document : null;
|
8
8
|
const templateContainer = doc && /* @__PURE__ */ doc.createElement("template");
|
package/dist/main.es6.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
import { isRef, toRaw, getCurrentScope, isShallow as isShallow$1, isReactive, ReactiveEffect, isProxy, computed as computed$1, pauseTracking, resetTracking, isReadonly, track, proxyRefs, markRaw, shallowReadonly, EffectScope, reactive, shallowReactive, trigger } from "./main.
|
2
|
-
import { readonly, ref, shallowRef, unref } from "./main.
|
3
|
-
import { isString, isFunction, getGlobalThis, isArray, NOOP, EMPTY_OBJ, normalizeClass, isObject, extend, normalizeStyle, isOn, isPromise, hasChanged, remove, isSet, isMap, isPlainObject, camelize, capitalize, toHandlerKey, hasOwn, EMPTY_ARR, NO, isBuiltInDirective, isReservedProp, invokeArrayFns, makeMap, looseToNumber, hyphenate, def, toRawType, isModelListener } from "./main.
|
4
|
-
import { toDisplayString } from "./main.
|
1
|
+
import { isRef, toRaw, getCurrentScope, isShallow as isShallow$1, isReactive, ReactiveEffect, isProxy, computed as computed$1, pauseTracking, resetTracking, isReadonly, track, proxyRefs, markRaw, shallowReadonly, EffectScope, reactive, shallowReactive, trigger } from "./main.es16.js";
|
2
|
+
import { readonly, ref, shallowRef, unref } from "./main.es16.js";
|
3
|
+
import { isString, isFunction, getGlobalThis, isArray, NOOP, EMPTY_OBJ, normalizeClass, isObject, extend, normalizeStyle, isOn, isPromise, hasChanged, remove, isSet, isMap, isPlainObject, camelize, capitalize, toHandlerKey, hasOwn, EMPTY_ARR, NO, isBuiltInDirective, isReservedProp, invokeArrayFns, makeMap, looseToNumber, hyphenate, def, toRawType, isModelListener } from "./main.es21.js";
|
4
|
+
import { toDisplayString } from "./main.es21.js";
|
5
5
|
const stack = [];
|
6
6
|
function pushWarningContext(vnode) {
|
7
7
|
stack.push(vnode);
|
package/dist/main.es9.js
CHANGED
package/package.json
CHANGED
@@ -230,6 +230,7 @@
|
|
230
230
|
//</inputNumber>
|
231
231
|
import styled from 'vue3-styled-components'
|
232
232
|
import {
|
233
|
+
roundViaInteger,
|
233
234
|
stringToNumber,
|
234
235
|
numberToString,
|
235
236
|
} from '../../../helpers/numberConverter'
|
@@ -861,7 +862,7 @@
|
|
861
862
|
this.inputValue = this.value
|
862
863
|
this.enteredValue =
|
863
864
|
typeof this.value === 'number' && !isNaN(this.value)
|
864
|
-
?
|
865
|
+
? roundViaInteger(this.value, this.numberPrecision)
|
865
866
|
: this.value
|
866
867
|
}
|
867
868
|
},
|
@@ -965,7 +966,7 @@
|
|
965
966
|
minDecimals: this.minDecimals,
|
966
967
|
})
|
967
968
|
} else if (typeof evaluated === 'number') {
|
968
|
-
evaluated = evaluated
|
969
|
+
evaluated = roundViaInteger(evaluated, this.numberPrecision)
|
969
970
|
}
|
970
971
|
return evaluated
|
971
972
|
},
|
@@ -179,9 +179,7 @@
|
|
179
179
|
position: relative;
|
180
180
|
font-size: ${(props) => (props.fontSize ? props.fontSize : '16px')};
|
181
181
|
color: ${(props) =>
|
182
|
-
props.
|
183
|
-
? props.theme.colors.grey6
|
184
|
-
: props.isDisabled
|
182
|
+
props.isDisabled
|
185
183
|
? props.theme.colors.grey2
|
186
184
|
: props.fontColor
|
187
185
|
? props.fontColor + ' !important'
|
@@ -78,10 +78,13 @@
|
|
78
78
|
v-else
|
79
79
|
class="inputField"
|
80
80
|
:disabled="customInputDisabled"
|
81
|
+
:error-message="item.errorMessage"
|
81
82
|
:font-color="showArchived ? theme.colors.red : 'black'"
|
83
|
+
:is-error="item.isError"
|
82
84
|
:min-width="item.value.length + 'ch'"
|
83
|
-
:no-border="
|
85
|
+
:no-border="item.noBorder || item.noBorder === undefined"
|
84
86
|
:value="item.value"
|
87
|
+
@input-blur="onCustomInputChange($event.trim())"
|
85
88
|
@input-change="onCustomInputChange($event)"
|
86
89
|
/>
|
87
90
|
</InputContainer>
|
@@ -162,7 +165,7 @@
|
|
162
165
|
</OptionsItem>
|
163
166
|
</OptionsWrapper>
|
164
167
|
<CustomContainer
|
165
|
-
v-if="
|
168
|
+
v-if="getCustomName.length && allowFreeInputs"
|
166
169
|
@click="onCustomNameClick()"
|
167
170
|
>
|
168
171
|
<CustomName>{{ getCustomName }}</CustomName>
|
@@ -226,7 +229,6 @@
|
|
226
229
|
const ItemAttrs = { isNested: Boolean, showArchived: Boolean }
|
227
230
|
const ComponentItem = styled('td', ItemAttrs)`
|
228
231
|
padding-left: ${(props) => (props.isNested ? '14px !important' : '0')};
|
229
|
-
overflow: hidden;
|
230
232
|
text-overflow: ellipsis;
|
231
233
|
padding-right: 0 !important;
|
232
234
|
color: ${(props) =>
|
@@ -558,7 +560,7 @@
|
|
558
560
|
},
|
559
561
|
computed: {
|
560
562
|
getCustomName() {
|
561
|
-
return this.inputText
|
563
|
+
return this.inputText.trim()
|
562
564
|
},
|
563
565
|
theme() {
|
564
566
|
return theme
|
@@ -652,7 +654,7 @@
|
|
652
654
|
},
|
653
655
|
onCustomNameClick() {
|
654
656
|
this.wasClicked = true
|
655
|
-
this.$emit('on-custom-input-name', this.
|
657
|
+
this.$emit('on-custom-input-name', this.getCustomName)
|
656
658
|
this.$emit('toggle-dropdown-open', { close: true })
|
657
659
|
this.inputText = ''
|
658
660
|
},
|
@@ -87,11 +87,20 @@ export const stringToNumber = ({
|
|
87
87
|
}
|
88
88
|
newVal = parseFloat(newVal)
|
89
89
|
if (numberPrecision !== false) {
|
90
|
-
newVal = newVal
|
90
|
+
newVal = roundViaInteger(newVal, numberPrecision)
|
91
91
|
}
|
92
92
|
return parseFloat(newVal)
|
93
93
|
}
|
94
94
|
|
95
|
+
export const roundViaInteger = (value, numberPrecision) => {
|
96
|
+
if (typeof value === 'string') {
|
97
|
+
value = parseFloat(value)
|
98
|
+
}
|
99
|
+
const factor = Math.pow(10, numberPrecision)
|
100
|
+
const roundedValue = Math.round(value * factor) / factor
|
101
|
+
return roundedValue
|
102
|
+
}
|
103
|
+
|
95
104
|
export const numberToString = ({ value, numberPrecision, minDecimals }) => {
|
96
105
|
const minimumRounding = minDecimals ? minDecimals : 0
|
97
106
|
value = !Number.isNaN(parseFloat(value)) ? parseFloat(value) : 0
|