sccoreui 3.5.9 → 3.6.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/dist/App.scss
CHANGED
|
@@ -329,8 +329,28 @@ h3 {
|
|
|
329
329
|
background: #162578;
|
|
330
330
|
}
|
|
331
331
|
|
|
332
|
-
|
|
333
|
-
|
|
332
|
+
|
|
333
|
+
.custom_date_picker_sec {
|
|
334
|
+
|
|
335
|
+
.custom_date_picker {
|
|
336
|
+
// padding-left: 134px;
|
|
337
|
+
.p-inputtext{
|
|
338
|
+
padding-right: 16px;
|
|
339
|
+
width: 130px;
|
|
340
|
+
// max-width: max-content;
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
.custom_date_picker.multiple {
|
|
345
|
+
.p-inputtext{
|
|
346
|
+
width: 236px;
|
|
347
|
+
// max-width: max-content;
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
.clear_icon_sec {
|
|
352
|
+
right: 32px;
|
|
353
|
+
}
|
|
334
354
|
}
|
|
335
355
|
|
|
336
356
|
.date_filter {
|
|
@@ -16,10 +16,7 @@ const DatePicker = (props) => {
|
|
|
16
16
|
const [fromDateFormate, setFromDateFormate] = (0, react_1.useState)(formattedDate);
|
|
17
17
|
const [toDateFormate, setToDateFormate] = (0, react_1.useState)('-');
|
|
18
18
|
const [propsState, setPropsState] = (0, react_1.useState)({});
|
|
19
|
-
let dateFromTo = {
|
|
20
|
-
0: null,
|
|
21
|
-
1: null,
|
|
22
|
-
};
|
|
19
|
+
let dateFromTo = {};
|
|
23
20
|
const selecteDateOption = (dateType) => {
|
|
24
21
|
dateFromTo[0] = today;
|
|
25
22
|
switch (dateType) {
|
|
@@ -88,16 +85,6 @@ const DatePicker = (props) => {
|
|
|
88
85
|
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex justify-content-end" }, { children: [(0, jsx_runtime_1.jsxs)("ul", Object.assign({ className: "list-none date_filter" }, { children: [(0, jsx_runtime_1.jsx)("li", Object.assign({ className: "border-round-xs p-2 flex align-items-center text-gray-700 cursor-pointer ", onClick: () => selecteDateOption('Today') }, { children: "Today" })), (0, jsx_runtime_1.jsx)("li", Object.assign({ className: "border-round-xs p-2 flex align-items-center text-gray-700 cursor-pointer ", onClick: () => selecteDateOption('Yesterday') }, { children: "Yesterday" })), (0, jsx_runtime_1.jsx)("li", Object.assign({ className: "border-round-xs p-2 flex align-items-center text-gray-700 cursor-pointer ", onClick: () => selecteDateOption('This week') }, { children: "This week" })), (0, jsx_runtime_1.jsx)("li", Object.assign({ className: "border-round-xs p-2 flex align-items-center text-gray-700 cursor-pointer ", onClick: () => selecteDateOption('Last week') }, { children: "Last week" })), (0, jsx_runtime_1.jsx)("li", Object.assign({ className: "border-round-xs p-2 flex align-items-center text-gray-700 cursor-pointer ", onClick: () => selecteDateOption('This month') }, { children: "This month" })), (0, jsx_runtime_1.jsx)("li", Object.assign({ className: "border-round-xs p-2 flex align-items-center text-gray-700 cursor-pointer ", onClick: () => selecteDateOption('Last month') }, { children: "Last month" })), (0, jsx_runtime_1.jsx)("li", Object.assign({ className: "border-round-xs p-2 flex align-items-center text-gray-700 cursor-pointer ", onClick: () => selecteDateOption('This year') }, { children: "This year" })), (0, jsx_runtime_1.jsx)("li", Object.assign({ className: "border-round-xs p-2 flex align-items-center text-gray-700 cursor-pointer ", onClick: () => selecteDateOption('Last year') }, { children: "Last year" })), (0, jsx_runtime_1.jsx)("li", Object.assign({ className: "border-round-xs p-2 flex align-items-center text-gray-700 cursor-pointer ", onClick: () => selecteDateOption('Custom') }, { children: "Custom" }))] })), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "bottom_date_filters pt-4 px-6 pb-2 flex align-items-center justify-content-between" }, { children: [(0, jsx_runtime_1.jsx)(button_1.Button, { label: "Today", className: "bg-white text-gray-900 border-1 border-gray-300", onClick: () => selecteDateOption('Today') }), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center" }, { children: [(0, jsx_runtime_1.jsx)(button_1.Button, { label: `${fromDateFormate}`, className: "text-left bg-white text-gray-900 border-1 border-gray-300 mr-2 w-7rem" }), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "text-gray-900 text-xl" }, { children: "-" })), (0, jsx_runtime_1.jsx)(button_1.Button, { label: `${toDateFormate}`, className: "text-left bg-white text-gray-900 border-1 border-gray-300 ml-2 w-7rem" })] }))] }))] })) }));
|
|
89
86
|
};
|
|
90
87
|
const onChangeDate = (e) => {
|
|
91
|
-
setFromDate(e.value);
|
|
92
|
-
const frmD = e.value[0].toLocaleDateString('en-US', options);
|
|
93
|
-
setFromDateFormate(frmD);
|
|
94
|
-
if (e.value[1]) {
|
|
95
|
-
const toD = e.value[1].toLocaleDateString('en-US', options);
|
|
96
|
-
setToDateFormate(toD);
|
|
97
|
-
}
|
|
98
|
-
else {
|
|
99
|
-
setToDateFormate('-');
|
|
100
|
-
}
|
|
101
88
|
if (props.onChange)
|
|
102
89
|
props.onChange(e);
|
|
103
90
|
};
|
|
@@ -128,6 +115,30 @@ const DatePicker = (props) => {
|
|
|
128
115
|
}
|
|
129
116
|
setPropsState(datePickerProps);
|
|
130
117
|
}, []);
|
|
131
|
-
|
|
118
|
+
(0, react_1.useEffect)(() => {
|
|
119
|
+
if (props.value === null) {
|
|
120
|
+
setFromDate(null);
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
setFromDate(props.value);
|
|
124
|
+
const frmD = props.value[0].toLocaleDateString('en-US', options);
|
|
125
|
+
setFromDateFormate(frmD);
|
|
126
|
+
if (props.value[1]) {
|
|
127
|
+
const toD = props.value[1].toLocaleDateString('en-US', options);
|
|
128
|
+
setToDateFormate(toD);
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
setToDateFormate('-');
|
|
132
|
+
}
|
|
133
|
+
}, [props.value]);
|
|
134
|
+
const clearIcon = () => {
|
|
135
|
+
const onClear = () => {
|
|
136
|
+
if (props.onClear)
|
|
137
|
+
props.onClear();
|
|
138
|
+
};
|
|
139
|
+
return ((0, jsx_runtime_1.jsx)("div", Object.assign({ onClick: onClear, className: "flex align-items-center absolute right-20 clear_icon_sec cursor-pointer" }, { children: (0, jsx_runtime_1.jsx)(svg_component_1.default, { className: "icon_right right_section_item absolute z-5 ", icon: props.clear, size: 20 }, Math.floor(Math.random() * 1000)) })));
|
|
140
|
+
};
|
|
141
|
+
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: `flex justify-content-center w-full relative align-items-center custom_date_picker_sec` }, { children: [(0, jsx_runtime_1.jsx)(calendar_1.Calendar, Object.assign({ showIcon: true, value: fromDate, onChange: (e) => onChangeDate(e), footerTemplate: template, className: `custom_date_picker ${(!JSON.stringify(fromDate).includes('null') && JSON.stringify(fromDate).includes(',')) ? 'multiple' : ''}` }, propsState)), (props.clear && JSON.stringify(fromDate).split(',').length > 1) &&
|
|
142
|
+
clearIcon()] })));
|
|
132
143
|
};
|
|
133
144
|
exports.default = DatePicker;
|
|
@@ -29,7 +29,6 @@ const MultiSelectDropDown = (props) => {
|
|
|
29
29
|
return ((0, jsx_runtime_1.jsx)("div", Object.assign({ onClick: onClear, className: "flex align-items-center" }, { children: (0, jsx_runtime_1.jsx)(svg_component_1.default, { className: "propile_icon icon_right right_section_item absolute z-5 ", icon: props.clear, size: 20 }, Math.floor(Math.random() * 1000)) })));
|
|
30
30
|
};
|
|
31
31
|
const onChange = (e) => {
|
|
32
|
-
setItems(e.value);
|
|
33
32
|
if (props.onChange)
|
|
34
33
|
props.onChange(e);
|
|
35
34
|
};
|
|
@@ -39,6 +38,9 @@ const MultiSelectDropDown = (props) => {
|
|
|
39
38
|
else
|
|
40
39
|
setIsMoreThenOne(false);
|
|
41
40
|
}, [items]);
|
|
41
|
+
(0, react_1.useEffect)(() => {
|
|
42
|
+
setItems(props.value);
|
|
43
|
+
}, [props.value]);
|
|
42
44
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [props.dropdownType !== '' &&
|
|
43
45
|
(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: `sc_custom_multiselect flex align-items-center relative ${(props.dropdownType !== undefined && props.dropdownType === "status") ? 'status_dropdown' : ''} ${isMoreThanOne ? `selected_multile ${`selected_num_` + items.length}` : ''}` }, { children: [(0, jsx_runtime_1.jsx)(LeftSection, {}), (0, jsx_runtime_1.jsx)(multiselect_1.MultiSelect, { value: items, onChange: (e) => onChange(e), options: props.options, optionLabel: "name", itemTemplate: props.dropdownType === 'status' ? (option) => { return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ className: `status_dropdown_item pl-3 ${option.name}` }, { children: option.name })) })); } : '', filter: true, placeholder: props.placeholder, display: "chip", maxSelectedLabels: props.maxSelectedLabels, className: `w-full md:w-20rem` }), items.length > 0 &&
|
|
44
46
|
(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center" }, { children: [isMoreThanOne && (0, jsx_runtime_1.jsxs)("span", Object.assign({ className: "selected_moreThan_one absolute z-5" }, { children: [" +", items.length - props.maxSelectedLabels] })), props.clear &&
|