sccoreui 6.3.19 → 6.3.20
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/components/formula-template/FormulaCoponent.js +453 -14
- package/package.json +1 -1
- package/dist/assets/App.css +0 -96
- package/dist/assets/App.css.map +0 -1
- package/dist/assets/App.scss +0 -130
- package/dist/assets/flex.css +0 -21652
- package/dist/assets/fonts/Lato-Black.ttf +0 -0
- package/dist/assets/fonts/Lato-Bold.ttf +0 -0
- package/dist/assets/fonts/Lato-Light.ttf +0 -0
- package/dist/assets/fonts/Lato-Regular.ttf +0 -0
- package/dist/assets/fonts/Lato-Thin.ttf +0 -0
- package/dist/assets/fonts/Roboto-Bold.ttf +0 -0
- package/dist/assets/fonts/Roboto-Italic.ttf +0 -0
- package/dist/assets/fonts/Roboto-Medium.ttf +0 -0
- package/dist/assets/fonts/Roboto-Regular.ttf +0 -0
- package/dist/assets/fonts/primeicons.eot +0 -0
- package/dist/assets/fonts/primeicons.svg +0 -292
- package/dist/assets/fonts/primeicons.ttf +0 -0
- package/dist/assets/fonts/primeicons.woff +0 -0
- package/dist/assets/fonts/primeicons.woff2 +0 -0
- package/dist/assets/images/Payment-method-apple-card.png +0 -0
- package/dist/assets/images/Payment-method-card-white.png +0 -0
- package/dist/assets/images/Payment-method-master-card.png +0 -0
- package/dist/assets/images/avatar.png +0 -0
- package/dist/assets/images/avatar1.png +0 -0
- package/dist/assets/images/avatar2.png +0 -0
- package/dist/assets/images/avatar3.png +0 -0
- package/dist/assets/images/avatar4.png +0 -0
- package/dist/assets/images/avatar5.png +0 -0
- package/dist/assets/images/avatar6.png +0 -0
- package/dist/assets/images/avatar7.png +0 -0
- package/dist/assets/images/avatar8.png +0 -0
- package/dist/assets/images/avatar9.png +0 -0
- package/dist/assets/images/company.png +0 -0
- package/dist/assets/images/company1.png +0 -0
- package/dist/assets/images/company2.png +0 -0
- package/dist/assets/images/company3.png +0 -0
- package/dist/assets/images/company4.png +0 -0
- package/dist/assets/images/company5.png +0 -0
- package/dist/assets/images/company6.png +0 -0
- package/dist/assets/images/demoImage.png +0 -0
- package/dist/assets/images/drag-and-drop-icon.png +0 -0
- package/dist/assets/images/drag.svg +0 -8
- package/dist/assets/images/empty-state-icon.svg +0 -53
- package/dist/assets/images/label-image.png +0 -0
- package/dist/assets/images/profile-square-image.png +0 -0
- package/dist/assets/png/checkbox_fill_icon.png +0 -0
- package/dist/assets/png/checkbox_minus_icon.png +0 -0
- package/dist/assets/png/checkbox_outline_icon.png +0 -0
- package/dist/assets/png/salseforce-img.png +0 -0
- package/dist/assets/sccoreicons.css +0 -1105
- package/dist/assets/sccoreui.css +0 -8940
- package/dist/assets/svg/add.svg +0 -3
- package/dist/assets/svg/back-button.svg +0 -3
- package/dist/assets/svg/check-white.svg +0 -3
- package/dist/assets/svg/check.svg +0 -3
- package/dist/assets/svg/check2.svg +0 -3
- package/dist/assets/svg/close.svg +0 -3
- package/dist/assets/svg/delete.svg +0 -3
- package/dist/assets/svg/done_all.svg +0 -3
- package/dist/assets/svg/dot_list.svg +0 -3
- package/dist/assets/svg/down_arrow.svg +0 -3
- package/dist/assets/svg/drag.svg +0 -8
- package/dist/assets/svg/edit.svg +0 -3
- package/dist/assets/svg/gallery.svg +0 -3
- package/dist/assets/svg/heading1.svg +0 -3
- package/dist/assets/svg/heading2.svg +0 -3
- package/dist/assets/svg/hyphen.svg +0 -3
- package/dist/assets/svg/info.svg +0 -3
- package/dist/assets/svg/input-info.svg +0 -0
- package/dist/assets/svg/italic.svg +0 -3
- package/dist/assets/svg/link.svg +0 -3
- package/dist/assets/svg/message-info.svg +0 -3
- package/dist/assets/svg/number_list.svg +0 -3
- package/dist/assets/svg/payment_method.svg +0 -7
- package/dist/assets/svg/quotes.svg +0 -3
- package/dist/assets/svg/remove.svg +0 -3
- package/dist/assets/svg/sort-down-arrow.svg +0 -3
- package/dist/assets/svg/sort-up-arrow.svg +0 -8
- package/dist/assets/svg/svg.js +0 -51
- package/dist/assets/svg/user.svg +0 -3
- package/dist/assets/theme.css +0 -6459
|
@@ -4,15 +4,29 @@ const tslib_1 = require("tslib");
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const dropdown_1 = require("primereact/dropdown");
|
|
7
|
+
const inputtext_1 = require("primereact/inputtext");
|
|
7
8
|
const inputnumber_1 = require("primereact/inputnumber");
|
|
8
9
|
const svg_component_1 = tslib_1.__importDefault(require("../../directives/svg-component"));
|
|
9
10
|
const menu_1 = require("primereact/menu");
|
|
10
|
-
// import { InputText } from "primereact/inputtext";
|
|
11
|
-
const Tagify_1 = tslib_1.__importDefault(require("./Tagify"));
|
|
12
11
|
const FormulaComponent = (props) => {
|
|
13
12
|
const priceConditioRef = (0, react_1.useRef)(null);
|
|
13
|
+
const [isValid, setIsValid] = (0, react_1.useState)(false);
|
|
14
|
+
const [selectedItem, setSelectedItem] = (0, react_1.useState)();
|
|
14
15
|
const [fieldOptions, setFieldOptions] = (0, react_1.useState)(props === null || props === void 0 ? void 0 : props.fieldOptions);
|
|
16
|
+
const contentEditableDivRef = (0, react_1.useRef)(null);
|
|
17
|
+
const [content, setContent] = (0, react_1.useState)(`<span class='formulaSpanElm'></span>`);
|
|
18
|
+
const [contentEditableCursorIndex, setContentEditableCursorIndex] = (0, react_1.useState)(null);
|
|
15
19
|
const [conditionValue, setConditionValue] = (0, react_1.useState)((props === null || props === void 0 ? void 0 : props.conditionValue) ? props === null || props === void 0 ? void 0 : props.conditionValue : 1);
|
|
20
|
+
const [formulaPlaceholder, setFormulaPlaceholder] = (0, react_1.useState)(true);
|
|
21
|
+
const operators = {
|
|
22
|
+
addition: "+",
|
|
23
|
+
subtraction: "-",
|
|
24
|
+
multiplication: "*",
|
|
25
|
+
division: "/",
|
|
26
|
+
percentile: "%",
|
|
27
|
+
openBracket: "(",
|
|
28
|
+
closeBracket: ")",
|
|
29
|
+
};
|
|
16
30
|
(0, react_1.useEffect)(() => {
|
|
17
31
|
setConditionValue(props.conditionValue);
|
|
18
32
|
}, [props.conditionValue]);
|
|
@@ -20,6 +34,330 @@ const FormulaComponent = (props) => {
|
|
|
20
34
|
if (props === null || props === void 0 ? void 0 : props.fieldOptions)
|
|
21
35
|
setFieldOptions(props === null || props === void 0 ? void 0 : props.fieldOptions);
|
|
22
36
|
}, [props === null || props === void 0 ? void 0 : props.fieldOptions]);
|
|
37
|
+
const onSelecteItem = (item) => {
|
|
38
|
+
var _a, _b, _c, _d, _e;
|
|
39
|
+
if (selectedItem) {
|
|
40
|
+
if (selectedItem.find((id) => id === item.id))
|
|
41
|
+
setSelectedItem(selectedItem.filter((id) => id !== item.id));
|
|
42
|
+
else
|
|
43
|
+
setSelectedItem([item.id, ...selectedItem]);
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
setSelectedItem([item.id]);
|
|
47
|
+
}
|
|
48
|
+
let chipElm = `<div class="formulaChipElm max-w-8rem w-max chip-h-25 overflow-hidden text-overflow-ellipsis white-space-nowrap bg-primary-25 border-primary-200 border-1 text-gray-600 border-round-sm p-1 ${props.formulaChipClassName}" contentEditable=${false} itemid="${item === null || item === void 0 ? void 0 : item.id}" title=${item === null || item === void 0 ? void 0 : item.name}>${item === null || item === void 0 ? void 0 : item.name}</div>`;
|
|
49
|
+
let currentText = contentEditableDivRef.current.innerHTML ===
|
|
50
|
+
'<span class="formulaSpanElm"></span>'
|
|
51
|
+
? '<span class="formulaSpanElm"></span>'
|
|
52
|
+
: contentEditableDivRef.current.innerHTML.replaceAll("<br>", "");
|
|
53
|
+
const index = contentEditableDivRef.current.innerHTML.indexOf((_a = document.querySelector(".formulaSpanElm.activeSpanElm")) === null || _a === void 0 ? void 0 : _a.outerHTML);
|
|
54
|
+
if (index === -1 &&
|
|
55
|
+
(contentEditableCursorIndex === null || contentEditableCursorIndex === 0)) {
|
|
56
|
+
let str = currentText +
|
|
57
|
+
chipElm +
|
|
58
|
+
`<span class='formulaSpanElm activeSpanElm'></span>`;
|
|
59
|
+
setContent(str);
|
|
60
|
+
// setContentEditableCursorIndex(str.length)
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
if (((_b = document.querySelector(".formulaSpanElm.activeSpanElm")) === null || _b === void 0 ? void 0 : _b.innerHTML.length) === contentEditableCursorIndex) {
|
|
64
|
+
let sliptText = currentText.split(document.querySelector(".formulaSpanElm.activeSpanElm").outerHTML);
|
|
65
|
+
let str = sliptText[0] +
|
|
66
|
+
document.querySelector(".formulaSpanElm.activeSpanElm").outerHTML +
|
|
67
|
+
chipElm +
|
|
68
|
+
`<span class='formulaSpanElm'></span>` +
|
|
69
|
+
sliptText[1];
|
|
70
|
+
setContent(str);
|
|
71
|
+
// setContentEditableCursorIndex(str.length)
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
// const index = contentEditableDivRef.current.innerHTML.indexOf(document.querySelector('.formulaSpanElm.activeSpanElm')?.outerHTML)
|
|
75
|
+
const firstContent = contentEditableDivRef.current.innerHTML.slice(0, index === -1 ? 0 : index) +
|
|
76
|
+
`<span class="formulaSpanElm activeSpanElm">${(_c = document
|
|
77
|
+
.querySelector(".formulaSpanElm.activeSpanElm")) === null || _c === void 0 ? void 0 : _c.innerHTML.substring(0, contentEditableCursorIndex)}</span>`;
|
|
78
|
+
const secondContent = `<span class="formulaSpanElm">${(_d = document
|
|
79
|
+
.querySelector(".formulaSpanElm.activeSpanElm")) === null || _d === void 0 ? void 0 : _d.innerHTML.substring(contentEditableCursorIndex)}</span>` +
|
|
80
|
+
contentEditableDivRef.current.innerHTML
|
|
81
|
+
.slice(index)
|
|
82
|
+
.split((_e = document.querySelector(".formulaSpanElm.activeSpanElm")) === null || _e === void 0 ? void 0 : _e.outerHTML)[1];
|
|
83
|
+
const str = firstContent + chipElm + secondContent;
|
|
84
|
+
setContent(str);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
setTimeout(() => {
|
|
88
|
+
onChangeCondition();
|
|
89
|
+
addEventListenerForSpan();
|
|
90
|
+
}, 500);
|
|
91
|
+
};
|
|
92
|
+
const onChangeCondition = () => {
|
|
93
|
+
// Here we are validating a formula for its end result.
|
|
94
|
+
// The end result should be a number, whether negative or positive.
|
|
95
|
+
if ((contentEditableDivRef === null || contentEditableDivRef === void 0 ? void 0 : contentEditableDivRef.current) === null) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
let elements = contentEditableDivRef === null || contentEditableDivRef === void 0 ? void 0 : contentEditableDivRef.current.children;
|
|
99
|
+
let formulaText = "";
|
|
100
|
+
let spanElms = Array.from(document.querySelectorAll(".formulaSpanElm"));
|
|
101
|
+
if (spanElms.length > 1) {
|
|
102
|
+
let spanInnerText = spanElms === null || spanElms === void 0 ? void 0 : spanElms.map((x) => x === null || x === void 0 ? void 0 : x.innerHTML);
|
|
103
|
+
// remove first and last span
|
|
104
|
+
const specialCharacters = /[/*\-+%(]/;
|
|
105
|
+
if (spanInnerText[0] !== "" &&
|
|
106
|
+
!specialCharacters.test(spanInnerText[0].charAt(spanInnerText[0].length - 1))) {
|
|
107
|
+
setIsValid(false);
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
else if (specialCharacters.test(spanInnerText[0].charAt(spanInnerText[0].length - 1)) ||
|
|
111
|
+
spanInnerText[0] === "") {
|
|
112
|
+
spanInnerText.shift();
|
|
113
|
+
}
|
|
114
|
+
if (spanInnerText[spanInnerText.length - 1] === "" ||
|
|
115
|
+
specialCharacters.test(spanInnerText[spanInnerText.length - 1].charAt(0))) {
|
|
116
|
+
spanInnerText.pop();
|
|
117
|
+
}
|
|
118
|
+
// spanInnerText = spanInnerText.slice(0, 1)
|
|
119
|
+
// spanInnerText = spanInnerText.slice(0, spanElms.length - 1)
|
|
120
|
+
// const specialCharacters = /[/*\-+%(]/;
|
|
121
|
+
let findText = spanInnerText.find((x) => !specialCharacters.test(x.charAt(0)) ||
|
|
122
|
+
!specialCharacters.test(x.charAt(x.length - 1)));
|
|
123
|
+
if (findText)
|
|
124
|
+
findText = findText.replaceAll("<br>", "");
|
|
125
|
+
if (findText) {
|
|
126
|
+
setIsValid(false);
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
let finalSanInnerText = spanInnerText.filter((x) => x === "");
|
|
131
|
+
if (finalSanInnerText.length !== 0) {
|
|
132
|
+
setIsValid(false);
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
for (let i = 0; i < elements.length; i++) {
|
|
138
|
+
const element = elements[i];
|
|
139
|
+
if (element.classList.contains("formulaChipElm")) {
|
|
140
|
+
let id = element.getAttribute("itemid");
|
|
141
|
+
let findObj = fieldOptions.find((x) => x.id === id);
|
|
142
|
+
formulaText = formulaText + (findObj === null || findObj === void 0 ? void 0 : findObj.price);
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
let spanText = element.innerHTML ? element.innerHTML : "";
|
|
146
|
+
formulaText = formulaText + spanText;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
formulaText = formulaText.replaceAll("<br>", "");
|
|
150
|
+
// If the formula ends with any operator without ending with numbers, then the formula is not correct
|
|
151
|
+
const regex = /^(?!0+$)(?=.*[+\-*/%])(?!.*(?:\s|\+\+|--|%%|\*\*|\+\-|\+\*|\+\%|\-\-|\-\*|\-\%|\*\-|\*\+|\*\%|\%\+|\%\-|\%\/|\%\*|\/\+|\/\-|\/\*|\/\%))(?:(?:\([+\-*/%]*\)|[-+*/%])*)$/;
|
|
152
|
+
if (!regex.test(formulaText) && formulaText !== "0" && formulaText !== "") {
|
|
153
|
+
try {
|
|
154
|
+
// For example, if textContent (formula) value is like "<chip> + <chip> - 456 + 778 * 464 / 645 % 4736"
|
|
155
|
+
// That will be converted here like "0 + 0 - 0 + 0 * 0 / 0 % 0". If the total equals 0 or -0, it means the formula is correct.
|
|
156
|
+
// The eval() JavaScript method will give us a result from the string.
|
|
157
|
+
// If the eval() result is NOT A NUMBER it will go to the error block.
|
|
158
|
+
// const str = formula.replaceAll(' ', '')
|
|
159
|
+
let value = eval(formulaText);
|
|
160
|
+
console.log(value);
|
|
161
|
+
setIsValid(true);
|
|
162
|
+
}
|
|
163
|
+
catch (error) {
|
|
164
|
+
setIsValid(false);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
else {
|
|
168
|
+
setIsValid(false);
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
function getCursorPosition(contentEditableElm) {
|
|
172
|
+
var _a;
|
|
173
|
+
const selection = window.getSelection();
|
|
174
|
+
if (selection.anchorNode) {
|
|
175
|
+
const range = selection.getRangeAt(0);
|
|
176
|
+
const clonedRange = range.cloneRange();
|
|
177
|
+
clonedRange.selectNodeContents(contentEditableElm);
|
|
178
|
+
clonedRange.setEnd(range.endContainer, range.endOffset);
|
|
179
|
+
setContentEditableCursorIndex((_a = clonedRange === null || clonedRange === void 0 ? void 0 : clonedRange.toString()) === null || _a === void 0 ? void 0 : _a.length);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
const onConditionKeyDown = (event) => {
|
|
183
|
+
const content = event.target.textContent.trim();
|
|
184
|
+
const lastChar = content.charAt(content.length - 1);
|
|
185
|
+
const operators = ["%", "*", "-", "+", "/"];
|
|
186
|
+
let selection = window.getSelection();
|
|
187
|
+
let actElm = document.querySelector(".formulaSpanElm.activeSpanElm");
|
|
188
|
+
if (actElm && actElm.innerHTML.indexOf("<br>") !== -1)
|
|
189
|
+
actElm.innerHTML = actElm.textContent;
|
|
190
|
+
if (event.keyCode === 37 ||
|
|
191
|
+
event.keyCode === 39 ||
|
|
192
|
+
event.keyCode === 38 ||
|
|
193
|
+
event.keyCode === 40) {
|
|
194
|
+
let actElm = document.querySelector(".formulaSpanElm.activeSpanElm");
|
|
195
|
+
let spanElms = Array.from(document.querySelectorAll(".formulaSpanElm"));
|
|
196
|
+
const range = document.createRange();
|
|
197
|
+
// range.setStart(selection.focusNode, selection.focusOffset);
|
|
198
|
+
let activeIndex;
|
|
199
|
+
spanElms.filter((elmt, index) => {
|
|
200
|
+
if (elmt.classList.contains("activeSpanElm")) {
|
|
201
|
+
activeIndex = index;
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
if (actElm) {
|
|
205
|
+
if (event.keyCode === 37 /* ArrowLeft */ ||
|
|
206
|
+
event.keyCode === 38 /* ArrowUp */) {
|
|
207
|
+
if (selection.getRangeAt(0).endOffset !== 0 &&
|
|
208
|
+
actElm.innerText.length !== 0) {
|
|
209
|
+
getCursorPosition(actElm);
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
if (activeIndex !== 0) {
|
|
213
|
+
// activeIndex = activeIndex + 1
|
|
214
|
+
activeIndex = activeIndex - 1;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
else if (event.keyCode === 39 /* ArrowRight */ ||
|
|
218
|
+
event.keyCode === 40 /* ArrowDown */) {
|
|
219
|
+
//&& selection.focusOffset === selection.focusNode.textContent.length
|
|
220
|
+
if (actElm.innerText.length === selection.getRangeAt(0).endOffset &&
|
|
221
|
+
activeIndex < spanElms.length - 1) {
|
|
222
|
+
activeIndex = activeIndex + 1;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
if (activeIndex !== -1 && spanElms.indexOf(actElm) !== activeIndex)
|
|
226
|
+
actElm.classList.remove("activeSpanElm");
|
|
227
|
+
}
|
|
228
|
+
if (activeIndex !== null &&
|
|
229
|
+
activeIndex !== -1 &&
|
|
230
|
+
spanElms.length > activeIndex &&
|
|
231
|
+
spanElms.indexOf(actElm) !== activeIndex) {
|
|
232
|
+
if (event.keyCode === 37 /* ArrowLeft */ ||
|
|
233
|
+
event.keyCode === 38 /* ArrowUp */)
|
|
234
|
+
range.selectNodeContents(spanElms[activeIndex]);
|
|
235
|
+
else if (event.keyCode === 39 /* ArrowRight */ || event.keyCode === 40)
|
|
236
|
+
range.setStart(spanElms[activeIndex], 0);
|
|
237
|
+
if (!range.startContainer.parentElement.getAttribute("id")) {
|
|
238
|
+
range.startContainer.parentElement.classList.add("activeSpanElm");
|
|
239
|
+
}
|
|
240
|
+
else {
|
|
241
|
+
let eml = range.startContainer;
|
|
242
|
+
eml === null || eml === void 0 ? void 0 : eml.classList.add("activeSpanElm");
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
let CurrentActElm = document.querySelector(".formulaSpanElm.activeSpanElm");
|
|
246
|
+
if (CurrentActElm)
|
|
247
|
+
getCursorPosition(CurrentActElm);
|
|
248
|
+
}
|
|
249
|
+
// Allow numbers, *, -, +, %, /, (, ), and single space
|
|
250
|
+
if (!((event.keyCode >= "0" && event.keyCode <= "9") ||
|
|
251
|
+
event.keyCode === "*" ||
|
|
252
|
+
event.keyCode === "-" ||
|
|
253
|
+
event.keyCode === "+" ||
|
|
254
|
+
event.keyCode === "%" ||
|
|
255
|
+
event.keyCode === "/" ||
|
|
256
|
+
event.keyCode === "(" ||
|
|
257
|
+
event.keyCode === ")" ||
|
|
258
|
+
(event.keyCode !== " " &&
|
|
259
|
+
event.target.textContent.trim().slice(-1) === " "))) {
|
|
260
|
+
event.preventDefault();
|
|
261
|
+
}
|
|
262
|
+
// Prevent new lines (enter keypress)
|
|
263
|
+
if (event.keyCode === "Enter") {
|
|
264
|
+
event.preventDefault();
|
|
265
|
+
}
|
|
266
|
+
getCursorPosition(event.target);
|
|
267
|
+
// Prevent entering operators continuously after each other
|
|
268
|
+
if (operators.includes(event.keyCode) &&
|
|
269
|
+
operators.includes(lastChar) &&
|
|
270
|
+
operators.includes(content[contentEditableCursorIndex - 2])) {
|
|
271
|
+
event.preventDefault();
|
|
272
|
+
}
|
|
273
|
+
};
|
|
274
|
+
const onFilter = (e) => {
|
|
275
|
+
if (e.target.value) {
|
|
276
|
+
let opts = props === null || props === void 0 ? void 0 : props.fieldOptions.filter((x) => {
|
|
277
|
+
var _a, _b, _c, _d;
|
|
278
|
+
return (_b = (_a = x === null || x === void 0 ? void 0 : x[props === null || props === void 0 ? void 0 : props.fieldFilterOption]) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === null || _b === void 0 ? void 0 : _b.includes((_d = (_c = e === null || e === void 0 ? void 0 : e.target) === null || _c === void 0 ? void 0 : _c.value) === null || _d === void 0 ? void 0 : _d.toLowerCase());
|
|
279
|
+
});
|
|
280
|
+
setFieldOptions(opts);
|
|
281
|
+
}
|
|
282
|
+
else {
|
|
283
|
+
setFieldOptions(props === null || props === void 0 ? void 0 : props.fieldOptions);
|
|
284
|
+
}
|
|
285
|
+
};
|
|
286
|
+
const onClickContentEditable = (e) => {
|
|
287
|
+
var _a, _b, _c;
|
|
288
|
+
let spanElms = Array.from(document.querySelectorAll(".formulaSpanElm"));
|
|
289
|
+
if (!e.target.classList.contains("formulaSpanElm") &&
|
|
290
|
+
spanElms.length !== 0) {
|
|
291
|
+
// let contentEditableElement = e.target
|
|
292
|
+
// contentEditableElement.focus(); // Set focus to the content editable element
|
|
293
|
+
const range = document.createRange(); // Create a new range
|
|
294
|
+
range.selectNodeContents(spanElms[spanElms.length - 1]); // Select the entire content of the element
|
|
295
|
+
range.collapse(false); // Collapse the range to the end
|
|
296
|
+
const selection = window.getSelection(); // Get the selection object
|
|
297
|
+
selection.removeAllRanges(); // Remove any existing ranges from the selection
|
|
298
|
+
selection.addRange(range);
|
|
299
|
+
(_a = document
|
|
300
|
+
.querySelector(".activeSpanElm")) === null || _a === void 0 ? void 0 : _a.classList.remove("activeSpanElm");
|
|
301
|
+
let elms = document.querySelectorAll(".formulaSpanElm");
|
|
302
|
+
(_c = (_b = elms[elms.length - 1]) === null || _b === void 0 ? void 0 : _b.classList) === null || _c === void 0 ? void 0 : _c.add("activeSpanElm");
|
|
303
|
+
e.preventDefault();
|
|
304
|
+
}
|
|
305
|
+
else {
|
|
306
|
+
console.log(e);
|
|
307
|
+
}
|
|
308
|
+
};
|
|
309
|
+
const onAddOperator = (event, operator) => {
|
|
310
|
+
let elm = document.querySelector(".activeSpanElm");
|
|
311
|
+
console.log(event);
|
|
312
|
+
// const operators = ['%', '*', '-', '+', '/'];
|
|
313
|
+
// const lastChar = elm.innerHTML?.charAt(elm.innerHTML?.length - 1);
|
|
314
|
+
// // Prevent entering operators coonChangeCondition(str);ntinuously after each other
|
|
315
|
+
// if (lastChar && operators.includes(lastChar) && operators.includes(operator)) {
|
|
316
|
+
// event.preventDefault();
|
|
317
|
+
// return;
|
|
318
|
+
// }
|
|
319
|
+
if (contentEditableDivRef.current.innerHTML !==
|
|
320
|
+
`<span class='formulaSpanElm'></span>`) {
|
|
321
|
+
elm.innerHTML = elm.innerHTML + operator;
|
|
322
|
+
}
|
|
323
|
+
onChangeCondition();
|
|
324
|
+
};
|
|
325
|
+
const onSave = (event) => {
|
|
326
|
+
let elements = contentEditableDivRef.current.children;
|
|
327
|
+
let formula = "";
|
|
328
|
+
for (let i = 0; i < elements.length; i++) {
|
|
329
|
+
const element = elements[i];
|
|
330
|
+
if (element.classList.contains("formulaChipElm"))
|
|
331
|
+
formula = formula + element.getAttribute("itemid");
|
|
332
|
+
else
|
|
333
|
+
formula = formula + element.innerHTML;
|
|
334
|
+
}
|
|
335
|
+
// setContent(contentEditableDivRef.current.innerHTML)
|
|
336
|
+
priceConditioRef.current.toggle(event);
|
|
337
|
+
formula = formula.replaceAll("<br>", "");
|
|
338
|
+
props.onSaveFormula(formula);
|
|
339
|
+
};
|
|
340
|
+
const onKeyDownHandler = (event) => {
|
|
341
|
+
var _a;
|
|
342
|
+
if (event.keyCode === 8 || event.keyCode === 46) {
|
|
343
|
+
// let elm = document.querySelector('.activeSpanElm') as HTMLElement
|
|
344
|
+
let spanElms = Array.from(document.querySelectorAll(".formulaSpanElm"));
|
|
345
|
+
let activeIndex = spanElms.findIndex((x) => x.classList.contains("activeSpanElm"));
|
|
346
|
+
if (activeIndex && ((_a = spanElms[activeIndex]) === null || _a === void 0 ? void 0 : _a.innerHTML) === "") {
|
|
347
|
+
spanElms[activeIndex].previousElementSibling.remove();
|
|
348
|
+
let index = event.keyCode === 8 ? activeIndex - 1 : activeIndex;
|
|
349
|
+
spanElms[index].classList.add("activeSpanElm");
|
|
350
|
+
const range = document.createRange(); // Create a new range
|
|
351
|
+
spanElms[activeIndex].remove();
|
|
352
|
+
range.selectNodeContents(spanElms[index]); // Select the entire content of the element
|
|
353
|
+
range.collapse(false); // Collapse the range to the end
|
|
354
|
+
const selection = window.getSelection(); // Get the selection object
|
|
355
|
+
selection.removeAllRanges(); // Remove any existing ranges from the selection
|
|
356
|
+
selection.addRange(range);
|
|
357
|
+
event.preventDefault();
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
};
|
|
23
361
|
const menuContent = [
|
|
24
362
|
{
|
|
25
363
|
template: () => {
|
|
@@ -27,10 +365,120 @@ const FormulaComponent = (props) => {
|
|
|
27
365
|
? props === null || props === void 0 ? void 0 : props.headerLabel
|
|
28
366
|
: "Configure Value" })), (0, jsx_runtime_1.jsx)("span", { children: (props === null || props === void 0 ? void 0 : props.headerDescription)
|
|
29
367
|
? props === null || props === void 0 ? void 0 : props.headerDescription
|
|
30
|
-
: "Select price attribute and perform calculater." })] })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "" }, { children: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "help-circle", size: 16 }) }))] }))), (0, jsx_runtime_1.
|
|
368
|
+
: "Select price attribute and perform calculater." })] })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "" }, { children: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "help-circle", size: 16 }) }))] }))), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "condition_section flex border-top-1 border-bottom-1 border-gray-200" }, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "w-6 border-right-1 border-gray-200" }, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "bg-gray-50 w-full h-auto border-bottom-1 border-gray-200 p-2 pt-0" }, { children: [(0, jsx_runtime_1.jsx)("div", Object.assign({ className: "p-2 flex align-items-center" }, { children: (0, jsx_runtime_1.jsxs)("span", { children: [(props === null || props === void 0 ? void 0 : props.fieldOptionTemplateTitle) + " (0)", " "] }) })), (props === null || props === void 0 ? void 0 : props.fieldFilter) && (
|
|
369
|
+
// <div className="px-4 py-2 border-top-1 border-gray-200">
|
|
370
|
+
// <div className="relative flex aling-items-center w-full">
|
|
371
|
+
// <div className="h-full flex align-items-cente justify-content-center w-2rem absolute left-0">
|
|
372
|
+
// <SvgComponent icon="search-md" />
|
|
373
|
+
// </div>
|
|
374
|
+
// <InputText onInput={(e: any) => onFilter(e)} className="pl-8 w-full" placeholder={props.fieldOptionFilterPlaceholder} />
|
|
375
|
+
// </div>
|
|
376
|
+
// </div>
|
|
377
|
+
(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "p-input-icon-left p-input-icon-right w-full" }, { children: [(0, jsx_runtime_1.jsx)("span", Object.assign({ className: "p-input-prefix" }, { children: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "search-md", size: 18 }) })), (0, jsx_runtime_1.jsx)("span", Object.assign({ className: "p-input-suffix" }, { children: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "x-close", size: 18 }) })), (0, jsx_runtime_1.jsx)(inputtext_1.InputText, { onInput: (e) => onFilter(e), className: "pl-8 w-full", placeholder: props.fieldOptionFilterPlaceholder })] })))] })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: `condition_itemibute_list_sect overflow-auto flex flex-column row-gap-2 px-4 py-2` }, { children: fieldOptions.length > 0 ? ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "grid gap-2 p-2 py-4" }, { children: fieldOptions === null || fieldOptions === void 0 ? void 0 : fieldOptions.map((item, index) => {
|
|
378
|
+
return ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: `max-w-8rem overflow-hidden text-overflow-ellipsis white-space-nowrap border-1 px-2 chip-h-25 border-gray-300 text-gray-600 cursor-pointer item_chip border-round-sm hover:bg-primary-25 hover:border-primary-200 ${props === null || props === void 0 ? void 0 : props.fieldOptionClassName}`, onClick: () => onSelecteItem(item), title: item === null || item === void 0 ? void 0 : item.name }, { children: item === null || item === void 0 ? void 0 : item.name }), "formula__option__" + index));
|
|
379
|
+
}) }))) : ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "text-gray-700 fobt-bold text-lg text-center" }, { children: (props === null || props === void 0 ? void 0 : props.fieldFilterEmptyMessage)
|
|
380
|
+
? props === null || props === void 0 ? void 0 : props.fieldFilterEmptyMessage
|
|
381
|
+
: "No Results Found!" }))) }))] })), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "w-6" }, { children: [(0, jsx_runtime_1.jsx)("div", Object.assign({ className: "h-2rem px-4 border-bottom-1 flex column-gap-2 align-items-center border-gray-200" }, { children: props.formulaOperators.map((operator, index) => {
|
|
382
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", Object.assign({ className: "condition_operator flex align-items-center justify-content-center text-lg w-2 sc_icon_hover cursor-pointer hover:bg-primary-50 border-round-sm", onClick: (e) => onAddOperator(e, operators[operator]) }, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "text-lg font-bold" }, { children: operators[operator] })) }), "formula__operator_" + index), (0, jsx_runtime_1.jsx)("span", { className: "operator_divider" })] }));
|
|
383
|
+
}) })), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "relative h-17rem w-full" }, { children: [(0, jsx_runtime_1.jsx)("div", { onClick: (e) => onClickContentEditable(e), ref: contentEditableDivRef, dangerouslySetInnerHTML: { __html: content }, onKeyDown: (e) => onKeyDownHandler(e), onKeyUp: (e) => onConditionKeyDown(e), onInput: () => onChangeCondition(), onFocus: () => setFormulaPlaceholder(false), className: `condition_configure px-4 py-3 h-17rem overflow-auto w-full absolute top-0 left-0 z-5`, id: "condition_configure_elm", contentEditable: true }), content === `<span class='formulaSpanElm'></span>` &&
|
|
384
|
+
formulaPlaceholder && ((0, jsx_runtime_1.jsx)("span", Object.assign({ className: " px-4 py-2 top-0 text-lg left-0 absolute z-3" }, { children: (props === null || props === void 0 ? void 0 : props.formulaElemectPlaceholder)
|
|
385
|
+
? props === null || props === void 0 ? void 0 : props.formulaElemectPlaceholder
|
|
386
|
+
: "Please Enter Formula" })))] }))] }))] })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: `condition_footer_section flex align-items-center p-2 ${props === null || props === void 0 ? void 0 : props.footerTemplateClassName}` }, { children: (props === null || props === void 0 ? void 0 : props.footerTemplate) ? ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: props === null || props === void 0 ? void 0 : props.footerTemplate })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", Object.assign({ className: "w-6 px-4 py-2 hover:bg-primary-50 cursor-pointer sc_icon_hover", onClick: (e) => {
|
|
387
|
+
setContent(props === null || props === void 0 ? void 0 : props.formulaValue);
|
|
388
|
+
priceConditioRef.current.toggle(e);
|
|
389
|
+
} }, { children: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "x-close", size: 20 }) })), (0, jsx_runtime_1.jsx)("div", Object.assign({ onClick: (e) => onSave(e), className: `w-6 px-4 py-2 hover:bg-primary-50 cursor-pointer sc_icon_hover ${!isValid && "p-disabled"}` }, { children: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "check", size: 20 }) }))] })) }))] }), "formula__dev"));
|
|
31
390
|
},
|
|
32
391
|
},
|
|
33
392
|
];
|
|
393
|
+
const addEventListenerForSpan = () => {
|
|
394
|
+
var _a;
|
|
395
|
+
// Select all div elements with the specified class name
|
|
396
|
+
const spanElements = document.querySelectorAll(".formulaSpanElm");
|
|
397
|
+
(_a = document.querySelector(".activeSpanElm")) === null || _a === void 0 ? void 0 : _a.classList.remove("activeSpanElm");
|
|
398
|
+
// Loop through each div element
|
|
399
|
+
spanElements.forEach((spanElement) => {
|
|
400
|
+
// Add an event listener for the 'click' event to each div element
|
|
401
|
+
spanElement.addEventListener("click", function (e) {
|
|
402
|
+
var _a;
|
|
403
|
+
(_a = document
|
|
404
|
+
.querySelector(".activeSpanElm")) === null || _a === void 0 ? void 0 : _a.classList.remove("activeSpanElm");
|
|
405
|
+
e.target.classList.add("activeSpanElm");
|
|
406
|
+
getCursorPosition(e.target);
|
|
407
|
+
// Your event handler code here
|
|
408
|
+
});
|
|
409
|
+
});
|
|
410
|
+
if (spanElements.length !== 0) {
|
|
411
|
+
spanElements[spanElements.length - 1].classList.add("activeSpanElm");
|
|
412
|
+
getCursorPosition(spanElements[spanElements.length - 1]);
|
|
413
|
+
}
|
|
414
|
+
};
|
|
415
|
+
const onShowMenu = () => {
|
|
416
|
+
if (props === null || props === void 0 ? void 0 : props.formulaValue) {
|
|
417
|
+
let formulatText = "";
|
|
418
|
+
const pattern = /(?:[a-f0-9]{24}|msrp|map|costprice)/g;
|
|
419
|
+
// const ids = props?.formulaValue.match(pattern);
|
|
420
|
+
// console.log(ids)
|
|
421
|
+
const splitPattern = /(?=[+\-*/%])/g;
|
|
422
|
+
// Split the text using the splitPattern
|
|
423
|
+
const splitText = props === null || props === void 0 ? void 0 : props.formulaValue.split(splitPattern);
|
|
424
|
+
for (let i = 0; i < splitText.length; i++) {
|
|
425
|
+
// let chipElm: string = '';
|
|
426
|
+
// let text = splitText[i];
|
|
427
|
+
const id = splitText[i].match(pattern);
|
|
428
|
+
let chipElm = "";
|
|
429
|
+
if (id) {
|
|
430
|
+
let item = fieldOptions.find((x) => x.id === id[0]);
|
|
431
|
+
chipElm = `<div class="formulaChipElm max-w-8rem w-max overflow-hidden text-overflow-ellipsis white-space-nowrap bg-primary-25 border-1 border-primary-200 text-gray-600 border-round-sm px-2 py-1" contentEditable=${false} itemid="${item === null || item === void 0 ? void 0 : item.id}" title="${item === null || item === void 0 ? void 0 : item.name}">${item === null || item === void 0 ? void 0 : item.name}</div>`;
|
|
432
|
+
}
|
|
433
|
+
// chipElm = text.replace(text, t)
|
|
434
|
+
const placeholderText = splitText[i].replace(pattern, "|");
|
|
435
|
+
const textParts = placeholderText
|
|
436
|
+
.split("|")
|
|
437
|
+
.filter((part) => part !== "");
|
|
438
|
+
if (textParts.length > 0) {
|
|
439
|
+
for (let z = 0; z < textParts.length; z++) {
|
|
440
|
+
if (z === 0 && splitText.length - 1 === i && chipElm)
|
|
441
|
+
formulatText = textParts[z]
|
|
442
|
+
? formulatText +
|
|
443
|
+
`<span class='formulaSpanElm'>${textParts[z]}</span>` +
|
|
444
|
+
chipElm +
|
|
445
|
+
`<span class='formulaSpanElm'></span>`
|
|
446
|
+
: `<span class='formulaSpanElm'></span>`;
|
|
447
|
+
else if (z === 0 && chipElm && id) {
|
|
448
|
+
// let lastSpanIndex = formulatText.lastIndexOf('</span>');
|
|
449
|
+
formulatText = textParts[z]
|
|
450
|
+
? formulatText +
|
|
451
|
+
`<span class='formulaSpanElm'>${textParts[z]}</span>` +
|
|
452
|
+
chipElm
|
|
453
|
+
: `<span class='formulaSpanElm'></span>`;
|
|
454
|
+
}
|
|
455
|
+
else
|
|
456
|
+
formulatText = textParts[z]
|
|
457
|
+
? formulatText +
|
|
458
|
+
`<span class='formulaSpanElm'>${textParts[z]}</span>`
|
|
459
|
+
: `<span class='formulaSpanElm'></span>`;
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
else {
|
|
463
|
+
if (splitText.length - 1 === i)
|
|
464
|
+
formulatText =
|
|
465
|
+
`<span class='formulaSpanElm'></span>` +
|
|
466
|
+
chipElm +
|
|
467
|
+
`<span class='formulaSpanElm'></span>`;
|
|
468
|
+
else
|
|
469
|
+
formulatText = `<span class='formulaSpanElm'></span>` + chipElm;
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
setContent(formulatText);
|
|
473
|
+
}
|
|
474
|
+
else {
|
|
475
|
+
setFormulaPlaceholder(true);
|
|
476
|
+
}
|
|
477
|
+
setTimeout(() => {
|
|
478
|
+
addEventListenerForSpan();
|
|
479
|
+
setIsValid(false);
|
|
480
|
+
}, 1000);
|
|
481
|
+
};
|
|
34
482
|
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: `condition_column border-1 flex border-gray-300 border-round-lg overflow-hidden w-full ${props === null || props === void 0 ? void 0 : props.className}` }, { children: [(0, jsx_runtime_1.jsx)(dropdown_1.Dropdown, { optionLabel: props === null || props === void 0 ? void 0 : props.optionLabel, panelClassName: "formula_panel_dropdown", "data-pr-classname": "block", placeholder: (props === null || props === void 0 ? void 0 : props.dropdownPlaceholder) ? props === null || props === void 0 ? void 0 : props.dropdownPlaceholder : "Select", value: conditionValue, onChange: (e) => {
|
|
35
483
|
if (props === null || props === void 0 ? void 0 : props.onConditionChange)
|
|
36
484
|
props === null || props === void 0 ? void 0 : props.onConditionChange(e);
|
|
@@ -45,12 +493,7 @@ const FormulaComponent = (props) => {
|
|
|
45
493
|
}
|
|
46
494
|
case "INCREASE_BY_PERCENTAGE":
|
|
47
495
|
case "DECREASE_BY_PERCENTAGE": {
|
|
48
|
-
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "w-6 relative" }, { children: [(0, jsx_runtime_1.jsx)("div", Object.assign({ className: "absolute left-0 h-full flex align-items-center px-2" }, { children: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "percent-01", size: 16, color: "#344054" }) })), (0, jsx_runtime_1.jsx)(inputnumber_1.InputNumber, Object.assign({ useGrouping: false, min: 0, max:
|
|
49
|
-
const value = e.value > 100 ? 100 : e.value;
|
|
50
|
-
e.originalEvent.target.value = value
|
|
51
|
-
? value === null || value === void 0 ? void 0 : value.toFixed(2)
|
|
52
|
-
: 0;
|
|
53
|
-
}, onValueChange: (e) => (props === null || props === void 0 ? void 0 : props.onChange) && (props === null || props === void 0 ? void 0 : props.onChange(e)), placeholder: "Enter Number", value: props === null || props === void 0 ? void 0 : props.inputValue, className: "border-none w-full", inputClassName: "border-none pl-8 focus:shadow-none" }))] })));
|
|
496
|
+
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "w-6 relative" }, { children: [(0, jsx_runtime_1.jsx)("div", Object.assign({ className: "absolute left-0 h-full flex align-items-center px-2" }, { children: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "percent-01", size: 16, color: "#344054" }) })), (0, jsx_runtime_1.jsx)(inputnumber_1.InputNumber, Object.assign({ useGrouping: false, min: 0, max: 99, minFractionDigits: 2, maxFractionDigits: 2, maxLength: (props === null || props === void 0 ? void 0 : props.maxLength) || Infinity }, props === null || props === void 0 ? void 0 : props.field, { onValueChange: (e) => (props === null || props === void 0 ? void 0 : props.onChange) && (props === null || props === void 0 ? void 0 : props.onChange(e)), placeholder: "Enter Number", value: props === null || props === void 0 ? void 0 : props.inputValue, className: "border-none w-full", inputClassName: "border-none pl-8 focus:shadow-none" }))] })));
|
|
54
497
|
}
|
|
55
498
|
case "MANUAL": {
|
|
56
499
|
return ((0, jsx_runtime_1.jsx)(inputnumber_1.InputNumber, Object.assign({ useGrouping: false, min: 0, minFractionDigits: 2, maxFractionDigits: 2, maxLength: (props === null || props === void 0 ? void 0 : props.maxLength) || Infinity }, props === null || props === void 0 ? void 0 : props.field, { onValueChange: (e) => (props === null || props === void 0 ? void 0 : props.onChange) && (props === null || props === void 0 ? void 0 : props.onChange(e)), placeholder: "Enter Number", value: props === null || props === void 0 ? void 0 : props.inputValue, className: "border-none w-6", inputClassName: "border-none focus:shadow-none" })));
|
|
@@ -74,10 +517,6 @@ const FormulaComponent = (props) => {
|
|
|
74
517
|
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {});
|
|
75
518
|
}
|
|
76
519
|
}
|
|
77
|
-
})() }), (0, jsx_runtime_1.jsx)(menu_1.Menu
|
|
78
|
-
// onShow={onShowMenu}
|
|
79
|
-
, {
|
|
80
|
-
// onShow={onShowMenu}
|
|
81
|
-
popup: true, popupAlignment: "left", className: `w-28rem p-0 ${props === null || props === void 0 ? void 0 : props.menuClassName}`, model: menuContent, ref: priceConditioRef, id: "condition_menu_popup" })] }), "asadssadsasdsdadasd"));
|
|
520
|
+
})() }), (0, jsx_runtime_1.jsx)(menu_1.Menu, { onShow: onShowMenu, popup: true, popupAlignment: "left", className: `condition_menu p-0 ${props === null || props === void 0 ? void 0 : props.menuClassName}`, model: menuContent, ref: priceConditioRef, id: "condition_menu_popup" })] }), "asadssadsasdsdadasd"));
|
|
82
521
|
};
|
|
83
522
|
exports.default = FormulaComponent;
|
package/package.json
CHANGED
package/dist/assets/App.css
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
@import url("./assets/theme.css");
|
|
2
|
-
@import url("./assets/sccoreui.css");
|
|
3
|
-
@import url("./assets/sccoreicons.css");
|
|
4
|
-
@import url("./assets/flex.css");
|
|
5
|
-
@import url("https://fonts.googleapis.com/css2?family=Lato:wght@100;300;400;700;900&display=swap");
|
|
6
|
-
:root {
|
|
7
|
-
--fw-600: 600;
|
|
8
|
-
--fw-400: 400;
|
|
9
|
-
--fs-24: 24px;
|
|
10
|
-
--fs-18: 18px;
|
|
11
|
-
--fs-16: 16px;
|
|
12
|
-
--lh: 24px;
|
|
13
|
-
--fs-14: 14px;
|
|
14
|
-
--grey-bg: #101828;
|
|
15
|
-
--border-none: border-none;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
body {
|
|
19
|
-
font-family: "Lato", sans-serif;
|
|
20
|
-
-webkit-font-smoothing: antialiased;
|
|
21
|
-
-moz-osx-font-smoothing: grayscale;
|
|
22
|
-
line-height: var(--lh);
|
|
23
|
-
padding: 0;
|
|
24
|
-
margin: 0;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
code {
|
|
28
|
-
font-family: "Lato", sans-serif;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
h1 {
|
|
32
|
-
font-size: var(--fs-24);
|
|
33
|
-
font-weight: var(--fw-600);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
h2 {
|
|
37
|
-
font-size: var(--fs-18);
|
|
38
|
-
font-weight: var(--fw-600);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
h3 {
|
|
42
|
-
font-size: var(--fs-16);
|
|
43
|
-
font-weight: var(--fw-400);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.progress-container {
|
|
47
|
-
isolation: isolate;
|
|
48
|
-
}
|
|
49
|
-
.progress-container::before {
|
|
50
|
-
content: "";
|
|
51
|
-
background-color: var(--gray-200);
|
|
52
|
-
position: absolute;
|
|
53
|
-
z-index: -1;
|
|
54
|
-
}
|
|
55
|
-
.progress-container.horizontal::before {
|
|
56
|
-
height: 2px;
|
|
57
|
-
width: 100%;
|
|
58
|
-
top: 11%;
|
|
59
|
-
}
|
|
60
|
-
.progress-container.vertical::before {
|
|
61
|
-
height: 100%;
|
|
62
|
-
width: 2px;
|
|
63
|
-
left: 5%;
|
|
64
|
-
top: 0;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.progressbar {
|
|
68
|
-
z-index: -1;
|
|
69
|
-
transition: all 0.6s ease;
|
|
70
|
-
}
|
|
71
|
-
.progressbar.horizontal {
|
|
72
|
-
left: 0;
|
|
73
|
-
height: 2px;
|
|
74
|
-
top: 11%;
|
|
75
|
-
}
|
|
76
|
-
.progressbar.vertical {
|
|
77
|
-
width: 2px;
|
|
78
|
-
left: 5%;
|
|
79
|
-
top: 0;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.progress-step-item.horizontal:nth-of-type(1) {
|
|
83
|
-
transform: translateX(-50%);
|
|
84
|
-
}
|
|
85
|
-
.progress-step-item.horizontal:last-child {
|
|
86
|
-
transform: translateX(50%);
|
|
87
|
-
}
|
|
88
|
-
.progress-step-item.vertical {
|
|
89
|
-
transform: translateY(50%);
|
|
90
|
-
}
|
|
91
|
-
.progress-step-item.vertical:nth-of-type(1) {
|
|
92
|
-
transform: translateY(-5%);
|
|
93
|
-
}
|
|
94
|
-
.progress-step-item.vertical:last-child {
|
|
95
|
-
transform: translateY(100%);
|
|
96
|
-
}/*# sourceMappingURL=App.css.map */
|
package/dist/assets/App.css.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["App.scss","App.css"],"names":[],"mappings":"AAAQ,iCAAA;AACA,oCAAA;AACA,uCAAA;AACA,gCAAA;AACA,kGAAA;AAER;EACE,aAAA;EACA,aAAA;EACA,aAAA;EACA,aAAA;EACA,aAAA;EACA,UAAA;EACA,aAAA;EACA,kBAAA;EACA,0BAAA;ACAF;;ADmBA;EACE,+BAAA;EACA,mCAAA;EACA,kCAAA;EACA,sBAAA;EACA,UAAA;EACA,SAAA;AChBF;;ADmBA;EACE,+BAAA;AChBF;;ADmBA;EACE,uBAAA;EACA,0BAAA;AChBF;;ADmBA;EACE,uBAAA;EACA,0BAAA;AChBF;;ADmBA;EACE,uBAAA;EACA,0BAAA;AChBF;;ADqBA;EACE,kBAAA;AClBF;ADoBE;EACE,WAAA;EACA,iCAAA;EACA,kBAAA;EACA,WAAA;AClBJ;ADqBE;EACE,WAAA;EACA,WAAA;EACA,QAAA;ACnBJ;ADsBE;EACE,YAAA;EACA,UAAA;EACA,QAAA;EACA,MAAA;ACpBJ;;ADwBA;EACE,WAAA;EACA,yBAAA;ACrBF;ADuBE;EACE,OAAA;EACA,WAAA;EACA,QAAA;ACrBJ;ADwBE;EACE,UAAA;EACA,QAAA;EACA,MAAA;ACtBJ;;AD8BI;EACE,2BAAA;AC3BN;AD8BI;EACE,0BAAA;AC5BN;ADgCE;EACE,0BAAA;AC9BJ;ADgCI;EACE,0BAAA;AC9BN;ADiCI;EACE,2BAAA;AC/BN","file":"App.css"}
|