@apexcura/ui-components 0.0.14-Beta26 → 0.0.14-Beta261
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/index.css +42 -0
- package/dist/index.d.mts +37 -8
- package/dist/index.d.ts +37 -8
- package/dist/index.js +961 -153
- package/dist/index.mjs +966 -142
- package/package.json +13 -7
- package/postcss.config.js +7 -6
- package/tailwind.config.js +2 -3
package/dist/index.js
CHANGED
|
@@ -31,20 +31,27 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
31
31
|
var src_exports = {};
|
|
32
32
|
__export(src_exports, {
|
|
33
33
|
AddMoreTable: () => AddMoreTable,
|
|
34
|
+
BarChart: () => BarChart,
|
|
34
35
|
ButtonElement: () => ButtonElement,
|
|
35
36
|
CheckboxElement: () => CheckboxElement,
|
|
37
|
+
CircleDonut: () => CircleDonut,
|
|
36
38
|
CkEditor: () => CkEditor,
|
|
37
39
|
DatePickerElement: () => DatePickerElement,
|
|
38
40
|
DateRangePickerElement: () => DateRangePickerElement,
|
|
41
|
+
DoubleBarChart: () => DoubleBarChart,
|
|
39
42
|
DropDownGroup: () => DropDownGroup,
|
|
40
43
|
FileUpload: () => FileUpload,
|
|
44
|
+
HorizontalBarChart: () => HorizontalBarChart,
|
|
41
45
|
Image: () => Image,
|
|
46
|
+
LineChart: () => LineChart,
|
|
42
47
|
MultipleSelectElement: () => MultipleSelectElement,
|
|
43
48
|
Navbar: () => Navbar,
|
|
44
49
|
NumberElement: () => NumberElement,
|
|
50
|
+
OtpElement: () => OtpElement,
|
|
45
51
|
PasswordElement: () => PasswordElement,
|
|
46
52
|
RadioElement: () => RadioElement,
|
|
47
53
|
SelectElement: () => SelectElement,
|
|
54
|
+
SemiCircleDonut: () => SemiCircleDonut,
|
|
48
55
|
Sidebar: () => Sidebar,
|
|
49
56
|
SingleCheckbox: () => SingleCheckbox,
|
|
50
57
|
SingleSelectElement: () => SingleSelectElement,
|
|
@@ -52,7 +59,8 @@ __export(src_exports, {
|
|
|
52
59
|
TableElement: () => TableElement,
|
|
53
60
|
TabsElement: () => TabsElement,
|
|
54
61
|
TextElement: () => TextElement,
|
|
55
|
-
TextareaElement: () => TextareaElement
|
|
62
|
+
TextareaElement: () => TextareaElement,
|
|
63
|
+
Upload: () => Upload2
|
|
56
64
|
});
|
|
57
65
|
module.exports = __toCommonJS(src_exports);
|
|
58
66
|
|
|
@@ -71,6 +79,7 @@ var TextElement = (props) => {
|
|
|
71
79
|
placeholder: props.placeholder,
|
|
72
80
|
allowClear: true,
|
|
73
81
|
id: props.name,
|
|
82
|
+
value: props.value,
|
|
74
83
|
prefix: props.prefix,
|
|
75
84
|
type: props.type,
|
|
76
85
|
status: props.status,
|
|
@@ -130,8 +139,7 @@ var NumberElement = (props) => {
|
|
|
130
139
|
{
|
|
131
140
|
placeholder: props.placeholder,
|
|
132
141
|
addonBefore: props.addonBefore,
|
|
133
|
-
|
|
134
|
-
defaultValue: props.defaultValue,
|
|
142
|
+
value: props.value,
|
|
135
143
|
disabled: props.disabled,
|
|
136
144
|
id: props.name,
|
|
137
145
|
prefix: props.prefix,
|
|
@@ -181,6 +189,9 @@ var TextareaElement = (props) => {
|
|
|
181
189
|
// src/Components/SelectElement.tsx
|
|
182
190
|
var import_react5 = __toESM(require("react"));
|
|
183
191
|
var import_antd5 = require("antd");
|
|
192
|
+
var filterOptions = (input, option) => {
|
|
193
|
+
return (option?.label ?? "").toLowerCase().includes(input.toLowerCase());
|
|
194
|
+
};
|
|
184
195
|
var SelectElement = (props) => {
|
|
185
196
|
const handleChange = (value) => {
|
|
186
197
|
console.log("++=====", typeof value);
|
|
@@ -197,20 +208,15 @@ var SelectElement = (props) => {
|
|
|
197
208
|
}
|
|
198
209
|
}
|
|
199
210
|
};
|
|
200
|
-
return /* @__PURE__ */ import_react5.default.createElement("div", { className:
|
|
211
|
+
return /* @__PURE__ */ import_react5.default.createElement("div", { className: "flex flex-col p-10 m-10" }, props.label && /* @__PURE__ */ import_react5.default.createElement("label", { htmlFor: props.name, className: "font-semibold text-default-400 text-red bg-green-500 border-4" }, props.label), /* @__PURE__ */ import_react5.default.createElement(
|
|
201
212
|
import_antd5.Select,
|
|
202
213
|
{
|
|
203
|
-
mode: props.mode,
|
|
204
214
|
options: props.options,
|
|
205
215
|
placeholder: props.placeholder,
|
|
206
216
|
allowClear: true,
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
id: props.name,
|
|
210
|
-
status: props.status,
|
|
211
|
-
style: props.styles,
|
|
217
|
+
filterOption: filterOptions,
|
|
218
|
+
showSearch: true,
|
|
212
219
|
className: props.className,
|
|
213
|
-
variant: props.variant,
|
|
214
220
|
onChange: handleChange
|
|
215
221
|
}
|
|
216
222
|
));
|
|
@@ -374,26 +380,166 @@ var MultipleSelectElement = (props) => {
|
|
|
374
380
|
};
|
|
375
381
|
|
|
376
382
|
// src/Components/Button.tsx
|
|
383
|
+
var import_react12 = __toESM(require("react"));
|
|
384
|
+
|
|
385
|
+
// src/constants/icons.tsx
|
|
377
386
|
var import_react11 = __toESM(require("react"));
|
|
387
|
+
var icons = {
|
|
388
|
+
download: /* @__PURE__ */ import_react11.default.createElement("svg", { viewBox: "0 0 25 25", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react11.default.createElement(
|
|
389
|
+
"path",
|
|
390
|
+
{
|
|
391
|
+
d: "M6.39023 19.49H18.9902C19.2452 19.49 19.459 19.5763 19.6315 19.7488C19.804 19.9213 19.8902 20.135 19.8902 20.39C19.8902 20.645 19.804 20.8588 19.6315 21.0313C19.459 21.2038 19.2452 21.29 18.9902 21.29H6.39023C6.13523 21.29 5.92148 21.2038 5.74898 21.0313C5.57648 20.8588 5.49023 20.645 5.49023 20.39C5.49023 20.135 5.57648 19.9213 5.74898 19.7488C5.92148 19.5763 6.13523 19.49 6.39023 19.49ZM12.6902 17.1275C12.5552 17.1275 12.424 17.0975 12.2965 17.0375C12.169 16.9775 12.0602 16.8875 11.9702 16.7675L7.51523 11.0525C7.29023 10.7525 7.26023 10.4338 7.42523 10.0963C7.59023 9.75879 7.86023 9.59004 8.23523 9.59004H9.99023V4.19004C9.99023 3.93504 10.0765 3.72129 10.249 3.54879C10.4215 3.37629 10.6352 3.29004 10.8902 3.29004H14.4902C14.7452 3.29004 14.959 3.37629 15.1315 3.54879C15.304 3.72129 15.3902 3.93504 15.3902 4.19004V9.59004H17.1452C17.5202 9.59004 17.7902 9.75879 17.9552 10.0963C18.1202 10.4338 18.0902 10.7525 17.8652 11.0525L13.4102 16.7675C13.3202 16.8875 13.2115 16.9775 13.084 17.0375C12.9565 17.0975 12.8252 17.1275 12.6902 17.1275Z",
|
|
392
|
+
fill: "#505050"
|
|
393
|
+
}
|
|
394
|
+
)),
|
|
395
|
+
save: /* @__PURE__ */ import_react11.default.createElement("svg", { viewBox: "0 0 27 27", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react11.default.createElement(
|
|
396
|
+
"path",
|
|
397
|
+
{
|
|
398
|
+
d: "M18.4602 4.67108H6.6883C5.5994 4.67108 4.72632 5.55397 4.72632 6.63306V20.3669C4.72632 21.446 5.5994 22.3289 6.6883 22.3289H20.4222C21.5013 22.3289 22.3842 21.446 22.3842 20.3669V8.59505L18.4602 4.67108ZM13.5552 20.3669C11.9268 20.3669 10.6123 19.0524 10.6123 17.424C10.6123 15.7955 11.9268 14.481 13.5552 14.481C15.1837 14.481 16.4982 15.7955 16.4982 17.424C16.4982 19.0524 15.1837 20.3669 13.5552 20.3669ZM16.4982 10.557H6.6883V6.63306H16.4982V10.557Z",
|
|
399
|
+
fill: "#A3A3A3"
|
|
400
|
+
}
|
|
401
|
+
)),
|
|
402
|
+
filter: /* @__PURE__ */ import_react11.default.createElement("svg", { viewBox: "0 0 25 25", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react11.default.createElement(
|
|
403
|
+
"path",
|
|
404
|
+
{
|
|
405
|
+
d: "M3.92978 5.0621C6.21468 7.99174 10.4338 13.4212 10.4338 13.4212V20.208C10.4338 20.8301 10.9428 21.3391 11.5649 21.3391H13.8272C14.4493 21.3391 14.9584 20.8301 14.9584 20.208V13.4212C14.9584 13.4212 19.1662 7.99174 21.4511 5.0621C22.028 4.31555 21.4963 3.24097 20.5575 3.24097H4.82338C3.88454 3.24097 3.3529 4.31555 3.92978 5.0621Z",
|
|
406
|
+
fill: "#505050"
|
|
407
|
+
}
|
|
408
|
+
)),
|
|
409
|
+
logout: /* @__PURE__ */ import_react11.default.createElement("svg", { viewBox: "0 0 25 25", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react11.default.createElement(
|
|
410
|
+
"path",
|
|
411
|
+
{
|
|
412
|
+
d: "M4.3457 3.87939C3.79342 3.87939 3.3457 4.32711 3.3457 4.87939V20.441C3.3457 20.9933 3.79342 21.441 4.3457 21.441H13.8618C14.4141 21.441 14.8618 20.9933 14.8618 20.441V15.1346C14.8618 14.8585 14.6379 14.6346 14.3618 14.6346H8.03954C7.48725 14.6346 7.03954 14.1869 7.03954 13.6346V10.7859C7.03954 10.2336 7.48725 9.78585 8.03954 9.78585H14.3618C14.6379 9.78585 14.8618 9.562 14.8618 9.28585V4.87939C14.8618 4.32711 14.4141 3.87939 13.8618 3.87939H4.3457Z",
|
|
413
|
+
fill: "#505050"
|
|
414
|
+
}
|
|
415
|
+
), /* @__PURE__ */ import_react11.default.createElement(
|
|
416
|
+
"path",
|
|
417
|
+
{
|
|
418
|
+
d: "M16.6159 7.55579L15.2915 8.88016L17.7511 11.3397H8.10205V13.2317H17.7511L15.2915 15.6912L16.6159 17.0156L21.3458 12.2857L16.6159 7.55579Z",
|
|
419
|
+
fill: "#505050"
|
|
420
|
+
}
|
|
421
|
+
)),
|
|
422
|
+
patient: /* @__PURE__ */ import_react11.default.createElement("svg", { viewBox: "0 0 24 25", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react11.default.createElement(
|
|
423
|
+
"path",
|
|
424
|
+
{
|
|
425
|
+
d: "M11.9997 15.8119C12.379 15.8119 12.7012 15.679 12.9664 15.4132C13.2322 15.148 13.3651 14.8258 13.3651 14.4465V13.5363H14.2753C14.6546 13.5363 14.9768 13.4034 15.242 13.1376C15.5078 12.8724 15.6407 12.5502 15.6407 12.1709C15.6407 11.7916 15.5078 11.4694 15.242 11.2042C14.9768 10.9384 14.6546 10.8055 14.2753 10.8055H13.3651V9.8953C13.3651 9.51604 13.2322 9.19381 12.9664 8.92863C12.7012 8.66284 12.379 8.52994 11.9997 8.52994C11.6204 8.52994 11.2982 8.66284 11.033 8.92863C10.7672 9.19381 10.6343 9.51604 10.6343 9.8953V10.8055H9.72409C9.34483 10.8055 9.0226 10.9384 8.75742 11.2042C8.49163 11.4694 8.35873 11.7916 8.35873 12.1709C8.35873 12.5502 8.49163 12.8724 8.75742 13.1376C9.0226 13.4034 9.34483 13.5363 9.72409 13.5363H10.6343V14.4465C10.6343 14.8258 10.7672 15.148 11.033 15.4132C11.2982 15.679 11.6204 15.8119 11.9997 15.8119ZM11.9997 21.6602H11.7721C11.6963 21.6602 11.628 21.645 11.5673 21.6146C9.57997 20.9926 7.94154 19.7599 6.65203 17.9163C5.36253 16.0734 4.71777 14.0369 4.71777 11.8068V7.50592C4.71777 7.12665 4.82791 6.78531 5.04819 6.4819C5.26786 6.17849 5.55216 5.95851 5.90109 5.82198L11.3625 3.77394C11.5749 3.69808 11.7873 3.66016 11.9997 3.66016C12.2121 3.66016 12.4245 3.69808 12.6369 3.77394L18.0983 5.82198C18.4472 5.95851 18.7318 6.17849 18.9521 6.4819C19.1718 6.78531 19.2816 7.12665 19.2816 7.50592V11.8068C19.2816 14.0369 18.6369 16.0734 17.3474 17.9163C16.0578 19.7599 14.4194 20.9926 12.4321 21.6146C12.3562 21.645 12.2121 21.6602 11.9997 21.6602Z",
|
|
426
|
+
fill: "#505050"
|
|
427
|
+
}
|
|
428
|
+
)),
|
|
429
|
+
refresh: /* @__PURE__ */ import_react11.default.createElement("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react11.default.createElement(
|
|
430
|
+
"path",
|
|
431
|
+
{
|
|
432
|
+
d: "M18.346 5.64739C17.4032 4.69617 16.2589 3.96885 14.9974 3.51916C13.7359 3.06947 12.3895 2.90888 11.0577 3.04926C6.92991 3.46541 3.53322 6.81712 3.07208 10.9449C2.45347 16.3998 6.67122 21 11.9912 21C13.6897 21 15.3533 20.5181 16.7888 19.6102C18.2242 18.7023 19.3726 17.4058 20.1005 15.8712C20.4604 15.1176 19.9206 14.2516 19.0883 14.2516C18.6721 14.2516 18.2785 14.4765 18.0985 14.8477C17.4455 16.2525 16.3286 17.3896 14.9357 18.0676C13.5428 18.7456 11.9588 18.9232 10.4503 18.5706C7.95342 18.0195 5.94015 15.9837 5.41152 13.4868C5.18931 12.4996 5.19188 11.475 5.41905 10.4889C5.64622 9.50282 6.09217 8.58042 6.72392 7.78992C7.35566 6.99943 8.15704 6.36107 9.06878 5.92207C9.98052 5.48307 10.9793 5.25466 11.9912 5.25374C13.8583 5.25374 15.5229 6.0298 16.7376 7.25576L15.0392 8.95411C14.3307 9.66269 14.8255 10.8774 15.8265 10.8774H19.8643C20.4829 10.8774 20.9891 10.3713 20.9891 9.75267V5.71488C20.9891 4.71386 19.7744 4.20773 19.0658 4.91632L18.346 5.64739Z",
|
|
433
|
+
fill: "#595959"
|
|
434
|
+
}
|
|
435
|
+
)),
|
|
436
|
+
scheduler: /* @__PURE__ */ import_react11.default.createElement("svg", { viewBox: "0 0 24 25", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react11.default.createElement(
|
|
437
|
+
"path",
|
|
438
|
+
{
|
|
439
|
+
d: "M19 4.58746H18V2.56927H16V4.58746H8V2.56927H6V4.58746H5C3.89 4.58746 3.01 5.49564 3.01 6.60564L3 20.7329C3 21.8429 3.89 22.7511 5 22.7511H19C20.1 22.7511 21 21.8429 21 20.7329V6.60564C21 5.49564 20.1 4.58746 19 4.58746ZM19 20.7329H5V10.642H19V20.7329ZM9 14.6784H7V12.6602H9V14.6784ZM13 14.6784H11V12.6602H13V14.6784ZM17 14.6784H15V12.6602H17V14.6784ZM9 18.7147H7V16.6965H9V18.7147ZM13 18.7147H11V16.6965H13V18.7147ZM17 18.7147H15V16.6965H17V18.7147Z",
|
|
440
|
+
fill: "#505050"
|
|
441
|
+
}
|
|
442
|
+
)),
|
|
443
|
+
add: /* @__PURE__ */ import_react11.default.createElement("svg", { viewBox: "0 0 26 27", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react11.default.createElement(
|
|
444
|
+
"path",
|
|
445
|
+
{
|
|
446
|
+
d: "M21.4869 14.7981H13.9193V22.3657H11.3967V14.7981H3.8291V12.2755H11.3967V4.70789H13.9193V12.2755H21.4869V14.7981Z",
|
|
447
|
+
fill: "white"
|
|
448
|
+
}
|
|
449
|
+
)),
|
|
450
|
+
bot: /* @__PURE__ */ import_react11.default.createElement("svg", { viewBox: "0 0 24 25", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react11.default.createElement(
|
|
451
|
+
"path",
|
|
452
|
+
{
|
|
453
|
+
d: "M5 21.6602C4.71667 21.6602 4.47917 21.5644 4.2875 21.3727C4.09583 21.181 4 20.9435 4 20.6602V16.6602C4 16.1102 4.19583 15.6394 4.5875 15.2477C4.97917 14.856 5.45 14.6602 6 14.6602H18C18.55 14.6602 19.0208 14.856 19.4125 15.2477C19.8042 15.6394 20 16.1102 20 16.6602V20.6602C20 20.9435 19.9042 21.181 19.7125 21.3727C19.5208 21.5644 19.2833 21.6602 19 21.6602H5ZM9 13.6602C7.61667 13.6602 6.4375 13.1727 5.4625 12.1977C4.4875 11.2227 4 10.0435 4 8.66019C4 7.27685 4.4875 6.09769 5.4625 5.12269C6.4375 4.14769 7.61667 3.66019 9 3.66019H15C16.3833 3.66019 17.5625 4.14769 18.5375 5.12269C19.5125 6.09769 20 7.27685 20 8.66019C20 10.0435 19.5125 11.2227 18.5375 12.1977C17.5625 13.1727 16.3833 13.6602 15 13.6602H9ZM9 9.66019C9.28333 9.66019 9.52083 9.56435 9.7125 9.37269C9.90417 9.18102 10 8.94352 10 8.66019C10 8.37685 9.90417 8.13935 9.7125 7.94769C9.52083 7.75602 9.28333 7.66019 9 7.66019C8.71667 7.66019 8.47917 7.75602 8.2875 7.94769C8.09583 8.13935 8 8.37685 8 8.66019C8 8.94352 8.09583 9.18102 8.2875 9.37269C8.47917 9.56435 8.71667 9.66019 9 9.66019ZM15 9.66019C15.2833 9.66019 15.5208 9.56435 15.7125 9.37269C15.9042 9.18102 16 8.94352 16 8.66019C16 8.37685 15.9042 8.13935 15.7125 7.94769C15.5208 7.75602 15.2833 7.66019 15 7.66019C14.7167 7.66019 14.4792 7.75602 14.2875 7.94769C14.0958 8.13935 14 8.37685 14 8.66019C14 8.94352 14.0958 9.18102 14.2875 9.37269C14.4792 9.56435 14.7167 9.66019 15 9.66019Z",
|
|
454
|
+
fill: "#505050"
|
|
455
|
+
}
|
|
456
|
+
)),
|
|
457
|
+
campaign: /* @__PURE__ */ import_react11.default.createElement("svg", { viewBox: "0 0 24 25", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react11.default.createElement(
|
|
458
|
+
"path",
|
|
459
|
+
{
|
|
460
|
+
d: "M20.0152 13.5174C19.6907 13.5174 19.419 13.4074 19.1999 13.1876C18.98 12.9685 18.8701 12.6967 18.8701 12.3723C18.8701 12.0479 18.98 11.7757 19.1999 11.5559C19.419 11.3368 19.6907 11.2272 20.0152 11.2272H22.3053C22.6298 11.2272 22.9015 11.3368 23.1206 11.5559C23.3405 11.7757 23.4504 12.0479 23.4504 12.3723C23.4504 12.6967 23.3405 12.9685 23.1206 13.1876C22.9015 13.4074 22.6298 13.5174 22.3053 13.5174H20.0152ZM19.3281 20.8459L17.496 19.4718C17.2288 19.2809 17.0761 19.0328 17.038 18.7275C16.9998 18.4221 17.0761 18.1359 17.267 17.8687C17.4578 17.6015 17.7059 17.4488 18.0113 17.4106C18.3166 17.3725 18.6029 17.4488 18.8701 17.6397L20.7022 19.0138C20.9694 19.2046 21.1221 19.4527 21.1602 19.7581C21.1984 20.0634 21.1221 20.3497 20.9312 20.6169C20.7404 20.884 20.4923 21.0367 20.1869 21.0749C19.8816 21.1131 19.5953 21.0367 19.3281 20.8459ZM18.8701 7.10493C18.6029 7.29578 18.3166 7.37212 18.0113 7.33395C17.7059 7.29578 17.4578 7.1431 17.267 6.87592C17.0761 6.60873 16.9998 6.32246 17.038 6.01711C17.0761 5.71176 17.2288 5.46366 17.496 5.27281L19.3281 3.89871C19.5953 3.70787 19.8816 3.63153 20.1869 3.6697C20.4923 3.70787 20.7404 3.86055 20.9312 4.12773C21.1221 4.39492 21.1984 4.68118 21.1602 4.98654C21.1221 5.29189 20.9694 5.53999 20.7022 5.73084L18.8701 7.10493ZM3.98406 21.6602V15.8075H2.83899C2.20919 15.8075 1.67024 15.5831 1.22213 15.1342C0.773264 14.6861 0.548828 14.1472 0.548828 13.5174V11.2272C0.548828 10.5974 0.773264 10.0581 1.22213 9.60922C1.67024 9.16111 2.20919 8.93706 2.83899 8.93706H7.4193L11.3984 6.5324C11.7801 6.30338 12.1668 6.30338 12.5584 6.5324C12.9493 6.76141 13.1447 7.09539 13.1447 7.53434V17.2103C13.1447 17.6492 12.9493 17.9832 12.5584 18.2122C12.1668 18.4412 11.7801 18.4412 11.3984 18.2122L7.4193 15.8075H6.27422V21.6602H3.98406ZM14.2898 16.2083V8.53628C14.8051 8.99431 15.2203 9.55273 15.5356 10.2115C15.8501 10.8696 16.0074 11.5898 16.0074 12.3723C16.0074 13.1548 15.8501 13.875 15.5356 14.5331C15.2203 15.1919 14.8051 15.7503 14.2898 16.2083Z",
|
|
461
|
+
fill: "#505050"
|
|
462
|
+
}
|
|
463
|
+
)),
|
|
464
|
+
"chatbot-white-border": /* @__PURE__ */ import_react11.default.createElement("svg", { viewBox: "0 0 33 34", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react11.default.createElement(
|
|
465
|
+
"path",
|
|
466
|
+
{
|
|
467
|
+
d: "M20.7249 1.17695H21.1499V1.1766C27.1029 1.40539 31.8779 6.41961 31.8779 12.5765V22.1994C31.8779 28.3489 27.0016 33.3184 21.0054 33.3184H2.1677C1.21133 33.3184 0.425039 32.5301 0.425039 31.5332V12.296C0.425039 6.14663 5.3011 1.17695 11.306 1.17695H20.7249Z",
|
|
468
|
+
fill: "#472D7A",
|
|
469
|
+
stroke: "white",
|
|
470
|
+
"stroke-width": "0.850077"
|
|
471
|
+
}
|
|
472
|
+
), /* @__PURE__ */ import_react11.default.createElement(
|
|
473
|
+
"path",
|
|
474
|
+
{
|
|
475
|
+
d: "M9.24976 13.3416C7.92364 13.3416 6.85254 14.4382 6.85254 15.7898C6.85254 17.1414 7.92364 18.238 9.24976 18.238C10.5759 18.238 11.647 17.1414 11.647 15.7898C11.647 14.4382 10.5759 13.3416 9.24976 13.3416Z",
|
|
476
|
+
fill: "white"
|
|
477
|
+
}
|
|
478
|
+
), /* @__PURE__ */ import_react11.default.createElement(
|
|
479
|
+
"path",
|
|
480
|
+
{
|
|
481
|
+
d: "M23.2839 13.3416C21.9578 13.3416 20.8867 14.4382 20.8867 15.7898C20.8867 17.1414 21.9578 18.238 23.2839 18.238C24.6101 18.238 25.6812 17.1414 25.6812 15.7898C25.6812 14.4382 24.6101 13.3416 23.2839 13.3416Z",
|
|
482
|
+
fill: "white"
|
|
483
|
+
}
|
|
484
|
+
), /* @__PURE__ */ import_react11.default.createElement(
|
|
485
|
+
"path",
|
|
486
|
+
{
|
|
487
|
+
d: "M19.5011 23.5C18.362 23.7125 17.1634 23.8316 15.9223 23.8316C14.6811 23.8316 13.4825 23.7125 12.3434 23.5C11.7399 23.3895 11.3743 24.2566 11.8844 24.6986C13.0405 25.7017 14.4261 26.2883 15.9223 26.2883C17.4184 26.2883 18.804 25.7017 19.9601 24.6986C20.4702 24.2566 20.1046 23.381 19.5011 23.5Z",
|
|
488
|
+
fill: "white"
|
|
489
|
+
}
|
|
490
|
+
)),
|
|
491
|
+
dashboard: /* @__PURE__ */ import_react11.default.createElement("svg", { viewBox: "0 0 25 25", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react11.default.createElement(
|
|
492
|
+
"path",
|
|
493
|
+
{
|
|
494
|
+
d: "M5.3457 21.6602C4.7957 21.6602 4.3247 21.4645 3.9327 21.0732C3.54137 20.6812 3.3457 20.2102 3.3457 19.6602V5.66016C3.3457 5.11016 3.54137 4.63916 3.9327 4.24716C4.3247 3.85582 4.7957 3.66016 5.3457 3.66016H9.3457C9.8957 3.66016 10.3667 3.85582 10.7587 4.24716C11.15 4.63916 11.3457 5.11016 11.3457 5.66016V19.6602C11.3457 20.2102 11.15 20.6812 10.7587 21.0732C10.3667 21.4645 9.8957 21.6602 9.3457 21.6602H5.3457ZM15.3457 10.6602C14.7957 10.6602 14.325 10.4642 13.9337 10.0722C13.5417 9.68082 13.3457 9.21016 13.3457 8.66016V5.66016C13.3457 5.11016 13.5417 4.63916 13.9337 4.24716C14.325 3.85582 14.7957 3.66016 15.3457 3.66016H19.3457C19.8957 3.66016 20.3667 3.85582 20.7587 4.24716C21.15 4.63916 21.3457 5.11016 21.3457 5.66016V8.66016C21.3457 9.21016 21.15 9.68082 20.7587 10.0722C20.3667 10.4642 19.8957 10.6602 19.3457 10.6602H15.3457ZM15.3457 21.6602C14.7957 21.6602 14.325 21.4645 13.9337 21.0732C13.5417 20.6812 13.3457 20.2102 13.3457 19.6602V14.6602C13.3457 14.1102 13.5417 13.6392 13.9337 13.2472C14.325 12.8558 14.7957 12.6602 15.3457 12.6602H19.3457C19.8957 12.6602 20.3667 12.8558 20.7587 13.2472C21.15 13.6392 21.3457 14.1102 21.3457 14.6602V19.6602C21.3457 20.2102 21.15 20.6812 20.7587 21.0732C20.3667 21.4645 19.8957 21.6602 19.3457 21.6602H15.3457Z",
|
|
495
|
+
fill: "#505050"
|
|
496
|
+
}
|
|
497
|
+
)),
|
|
498
|
+
discard: /* @__PURE__ */ import_react11.default.createElement("svg", { viewBox: "0 0 26 27", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react11.default.createElement(
|
|
499
|
+
"path",
|
|
500
|
+
{
|
|
501
|
+
d: "M7.75303 22.3289C7.21349 22.3289 6.75177 22.137 6.36787 21.7531C5.98332 21.3685 5.79105 20.9065 5.79105 20.3669V7.61405C5.5131 7.61405 5.27995 7.52021 5.0916 7.33251C4.90391 7.14416 4.81006 6.91101 4.81006 6.63306C4.81006 6.35512 4.90391 6.12197 5.0916 5.93362C5.27995 5.74592 5.5131 5.65207 5.79105 5.65207H9.71501C9.71501 5.37413 9.80919 5.14098 9.99754 4.95263C10.1852 4.76493 10.4181 4.67108 10.696 4.67108H14.62C14.8979 4.67108 15.1311 4.76493 15.3194 4.95263C15.5071 5.14098 15.601 5.37413 15.601 5.65207H19.5249C19.8029 5.65207 20.0357 5.74592 20.2234 5.93362C20.4117 6.12197 20.5059 6.35512 20.5059 6.63306C20.5059 6.91101 20.4117 7.14416 20.2234 7.33251C20.0357 7.52021 19.8029 7.61405 19.5249 7.61405V20.3669C19.5249 20.9065 19.333 21.3685 18.9491 21.7531C18.5645 22.137 18.1025 22.3289 17.5629 22.3289H7.75303ZM9.71501 17.424C9.71501 17.7019 9.80919 17.9347 9.99754 18.1224C10.1852 18.3108 10.4181 18.405 10.696 18.405C10.974 18.405 11.2071 18.3108 11.3955 18.1224C11.5831 17.9347 11.677 17.7019 11.677 17.424V10.557C11.677 10.2791 11.5831 10.0459 11.3955 9.85758C11.2071 9.66988 10.974 9.57604 10.696 9.57604C10.4181 9.57604 10.1852 9.66988 9.99754 9.85758C9.80919 10.0459 9.71501 10.2791 9.71501 10.557V17.424ZM13.639 17.424C13.639 17.7019 13.7332 17.9347 13.9215 18.1224C14.1092 18.3108 14.342 18.405 14.62 18.405C14.8979 18.405 15.1311 18.3108 15.3194 18.1224C15.5071 17.9347 15.601 17.7019 15.601 17.424V10.557C15.601 10.2791 15.5071 10.0459 15.3194 9.85758C15.1311 9.66988 14.8979 9.57604 14.62 9.57604C14.342 9.57604 14.1092 9.66988 13.9215 9.85758C13.7332 10.0459 13.639 10.2791 13.639 10.557V17.424Z",
|
|
502
|
+
fill: "#A3A3A3"
|
|
503
|
+
}
|
|
504
|
+
)),
|
|
505
|
+
"discard-red": /* @__PURE__ */ import_react11.default.createElement("svg", { viewBox: "0 0 26 26", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react11.default.createElement(
|
|
506
|
+
"path",
|
|
507
|
+
{
|
|
508
|
+
d: "M7.75254 21.4868C7.213 21.4868 6.75128 21.2948 6.36738 20.9109C5.98284 20.5264 5.79056 20.0643 5.79056 19.5248V6.77189C5.51261 6.77189 5.27947 6.67804 5.09111 6.49035C4.90342 6.302 4.80957 6.06885 4.80957 5.7909C4.80957 5.51295 4.90342 5.2798 5.09111 5.09145C5.27947 4.90376 5.51261 4.80991 5.79056 4.80991H9.71453C9.71453 4.53196 9.8087 4.29881 9.99705 4.11046C10.1847 3.92277 10.4176 3.82892 10.6955 3.82892H14.6195C14.8974 3.82892 15.1306 3.92277 15.3189 4.11046C15.5066 4.29881 15.6005 4.53196 15.6005 4.80991H19.5244C19.8024 4.80991 20.0352 4.90376 20.2229 5.09145C20.4113 5.2798 20.5054 5.51295 20.5054 5.7909C20.5054 6.06885 20.4113 6.302 20.2229 6.49035C20.0352 6.67804 19.8024 6.77189 19.5244 6.77189V19.5248C19.5244 20.0643 19.3325 20.5264 18.9486 20.9109C18.564 21.2948 18.102 21.4868 17.5625 21.4868H7.75254ZM9.71453 16.5818C9.71453 16.8597 9.8087 17.0926 9.99705 17.2803C10.1847 17.4686 10.4176 17.5628 10.6955 17.5628C10.9735 17.5628 11.2066 17.4686 11.395 17.2803C11.5827 17.0926 11.6765 16.8597 11.6765 16.5818V9.71486C11.6765 9.43692 11.5827 9.20377 11.395 9.01542C11.2066 8.82772 10.9735 8.73387 10.6955 8.73387C10.4176 8.73387 10.1847 8.82772 9.99705 9.01542C9.8087 9.20377 9.71453 9.43692 9.71453 9.71486V16.5818ZM13.6385 16.5818C13.6385 16.8597 13.7327 17.0926 13.921 17.2803C14.1087 17.4686 14.3415 17.5628 14.6195 17.5628C14.8974 17.5628 15.1306 17.4686 15.3189 17.2803C15.5066 17.0926 15.6005 16.8597 15.6005 16.5818V9.71486C15.6005 9.43692 15.5066 9.20377 15.3189 9.01542C15.1306 8.82772 14.8974 8.73387 14.6195 8.73387C14.3415 8.73387 14.1087 8.82772 13.921 9.01542C13.7327 9.20377 13.6385 9.43692 13.6385 9.71486V16.5818Z",
|
|
509
|
+
fill: "#D9363E"
|
|
510
|
+
}
|
|
511
|
+
))
|
|
512
|
+
};
|
|
513
|
+
|
|
514
|
+
// src/Components/Button.tsx
|
|
378
515
|
var ButtonElement = (props) => {
|
|
379
|
-
|
|
516
|
+
const textColorClass = props.className?.match(/text-[\w-]+/g)?.[0] === "text-white";
|
|
517
|
+
return /* @__PURE__ */ import_react12.default.createElement(
|
|
380
518
|
"button",
|
|
381
519
|
{
|
|
382
|
-
onClick:
|
|
383
|
-
className:
|
|
520
|
+
onClick: props.onClick,
|
|
521
|
+
className: props.className ? props.className : "",
|
|
522
|
+
disabled: props.loading,
|
|
523
|
+
style: {
|
|
524
|
+
cursor: props.loading ? "no-drop" : "pointer"
|
|
525
|
+
}
|
|
384
526
|
},
|
|
385
|
-
props.
|
|
527
|
+
/* @__PURE__ */ import_react12.default.createElement("span", { className: props.iconsClassName }, props.isSVGStylesOverride === false ? /* @__PURE__ */ import_react12.default.createElement("img", { src: props.icon, className: props.iconsClassName }) : icons[props.icon], /* @__PURE__ */ import_react12.default.createElement("style", null, textColorClass && `.${props.className?.match(/text-[\w-]+/g)?.[0]} path {
|
|
528
|
+
filter: brightness(0) invert(1);
|
|
529
|
+
}`, `.${props.className?.match(/text-[\w-]+/g)?.[0]}:hover path {
|
|
530
|
+
filter: brightness(0) invert(1);
|
|
531
|
+
}`)),
|
|
386
532
|
props.label
|
|
387
533
|
);
|
|
388
534
|
};
|
|
389
535
|
|
|
390
536
|
// src/Components/AddMoreTable.tsx
|
|
391
|
-
var
|
|
537
|
+
var import_react13 = __toESM(require("react"));
|
|
392
538
|
var import_antd10 = require("antd");
|
|
393
|
-
var
|
|
539
|
+
var import_icons3 = require("@ant-design/icons");
|
|
394
540
|
var AddMoreTable = (props) => {
|
|
395
541
|
const { thead, tbody } = props;
|
|
396
|
-
const [rows, setRows] = (0,
|
|
542
|
+
const [rows, setRows] = (0, import_react13.useState)(tbody || []);
|
|
397
543
|
const onHandleRows = () => {
|
|
398
544
|
const newId = rows.length > 0 ? rows[rows.length - 1].id + 1 : 1;
|
|
399
545
|
let newRow = {
|
|
@@ -458,16 +604,16 @@ var AddMoreTable = (props) => {
|
|
|
458
604
|
});
|
|
459
605
|
});
|
|
460
606
|
};
|
|
461
|
-
(0,
|
|
607
|
+
(0, import_react13.useEffect)(() => {
|
|
462
608
|
console.log(rows);
|
|
463
609
|
}, [rows]);
|
|
464
610
|
const renderInputElement = (element, value) => {
|
|
465
611
|
if (!element) return null;
|
|
466
612
|
const { element: type, label } = element;
|
|
467
613
|
if (type === "single-select") {
|
|
468
|
-
return /* @__PURE__ */
|
|
614
|
+
return /* @__PURE__ */ import_react13.default.createElement(SingleSelectElement, { onChange: (value2) => console.log(label, value2), optionType: "", className: void 0, selectedStyle: false, style: false, options1: [], options2: [], firstOptions: [], secondOptions: [] });
|
|
469
615
|
} else if (type === "textarea") {
|
|
470
|
-
return /* @__PURE__ */
|
|
616
|
+
return /* @__PURE__ */ import_react13.default.createElement(TextareaElement, { onChange: (value2) => console.log(label, value2), optionType: "", className: void 0, selectedStyle: false, style: false, options1: [], options2: [], firstOptions: [], secondOptions: [] });
|
|
471
617
|
} else {
|
|
472
618
|
return null;
|
|
473
619
|
}
|
|
@@ -484,13 +630,13 @@ var AddMoreTable = (props) => {
|
|
|
484
630
|
eachRow.variable_data.forEach((variable, subIndex) => {
|
|
485
631
|
Object.keys(variable).forEach((key) => {
|
|
486
632
|
if (key === "SubRows") {
|
|
487
|
-
rowData[`${key}`] = /* @__PURE__ */
|
|
633
|
+
rowData[`${key}`] = /* @__PURE__ */ import_react13.default.createElement("div", { key: subIndex }, eachRow.variable_data.length > 1 && /* @__PURE__ */ import_react13.default.createElement(import_antd10.Button, { onClick: () => onHandleSubRowsDelete(rowIndex, subIndex) }, /* @__PURE__ */ import_react13.default.createElement(import_icons3.DeleteOutlined, null)), subIndex === eachRow.variable_data.length - 1 && /* @__PURE__ */ import_react13.default.createElement(import_antd10.Button, { onClick: () => onHandleSubRowsAdd(rowIndex) }, /* @__PURE__ */ import_react13.default.createElement(import_icons3.PlusOutlined, null)));
|
|
488
634
|
} else {
|
|
489
635
|
rowData[`${key}`] = renderInputElement(variable[key]);
|
|
490
636
|
}
|
|
491
637
|
});
|
|
492
638
|
});
|
|
493
|
-
rowData.actions = /* @__PURE__ */
|
|
639
|
+
rowData.actions = /* @__PURE__ */ import_react13.default.createElement("div", null, /* @__PURE__ */ import_react13.default.createElement(import_antd10.Button, { onClick: () => onHandleDelete(eachRow.id) }, /* @__PURE__ */ import_react13.default.createElement(import_icons3.DeleteOutlined, null)), rowIndex === rows.length - 1 && /* @__PURE__ */ import_react13.default.createElement(import_antd10.Button, { onClick: onHandleRows }, /* @__PURE__ */ import_react13.default.createElement(import_icons3.PlusOutlined, null)));
|
|
494
640
|
console.log("=====rowdata", rowData);
|
|
495
641
|
return rowData;
|
|
496
642
|
});
|
|
@@ -506,7 +652,7 @@ var AddMoreTable = (props) => {
|
|
|
506
652
|
key: "actions"
|
|
507
653
|
});
|
|
508
654
|
}
|
|
509
|
-
return /* @__PURE__ */
|
|
655
|
+
return /* @__PURE__ */ import_react13.default.createElement(
|
|
510
656
|
import_antd10.Table,
|
|
511
657
|
{
|
|
512
658
|
columns,
|
|
@@ -518,44 +664,53 @@ var AddMoreTable = (props) => {
|
|
|
518
664
|
};
|
|
519
665
|
|
|
520
666
|
// src/Components/Sidebar.tsx
|
|
521
|
-
var
|
|
667
|
+
var import_react14 = __toESM(require("react"));
|
|
522
668
|
var Sidebar = (props) => {
|
|
523
669
|
const handleChange = (item) => {
|
|
524
670
|
if (props.onChange) {
|
|
525
671
|
props.onChange(item);
|
|
526
672
|
}
|
|
527
673
|
};
|
|
528
|
-
return /* @__PURE__ */
|
|
529
|
-
return /* @__PURE__ */
|
|
530
|
-
|
|
531
|
-
|
|
674
|
+
return /* @__PURE__ */ import_react14.default.createElement(import_react14.default.Fragment, { key: props.name }, /* @__PURE__ */ import_react14.default.createElement("div", { className: props.imgClassName }, /* @__PURE__ */ import_react14.default.createElement("img", { src: props.img, alt: "logo" })), /* @__PURE__ */ import_react14.default.createElement("div", { className: props.listClassName }, props.items?.map((item) => {
|
|
675
|
+
return /* @__PURE__ */ import_react14.default.createElement(import_react14.default.Fragment, { key: item.label }, /* @__PURE__ */ import_react14.default.createElement(
|
|
676
|
+
ButtonElement,
|
|
677
|
+
{
|
|
678
|
+
...item,
|
|
679
|
+
className: item.active ? props.activeClassName : props.className,
|
|
680
|
+
iconsClassName: props.iconsClassName,
|
|
681
|
+
onClick: (e) => {
|
|
682
|
+
e.preventDefault();
|
|
683
|
+
handleChange(item);
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
));
|
|
532
687
|
})));
|
|
533
688
|
};
|
|
534
689
|
|
|
535
690
|
// src/Components/Navbar.tsx
|
|
536
|
-
var
|
|
691
|
+
var import_react18 = __toESM(require("react"));
|
|
537
692
|
|
|
538
693
|
// src/Components/Notification.tsx
|
|
539
|
-
var
|
|
694
|
+
var import_react15 = __toESM(require("react"));
|
|
540
695
|
var import_antd11 = require("antd");
|
|
541
696
|
var import_io = require("react-icons/io");
|
|
542
697
|
var popoverContentStyle = {
|
|
543
698
|
minWidth: "300px",
|
|
544
699
|
maxWidth: "100%"
|
|
545
700
|
};
|
|
546
|
-
var Notification = (props) => /* @__PURE__ */
|
|
701
|
+
var Notification = (props) => /* @__PURE__ */ import_react15.default.createElement(
|
|
547
702
|
import_antd11.Popover,
|
|
548
703
|
{
|
|
549
704
|
className: props.className,
|
|
550
|
-
content: /* @__PURE__ */
|
|
705
|
+
content: /* @__PURE__ */ import_react15.default.createElement("div", { style: popoverContentStyle }, " ", /* @__PURE__ */ import_react15.default.createElement(
|
|
551
706
|
import_antd11.List,
|
|
552
707
|
{
|
|
553
708
|
itemLayout: "horizontal",
|
|
554
709
|
dataSource: props.items,
|
|
555
|
-
renderItem: (item, index) => /* @__PURE__ */
|
|
710
|
+
renderItem: (item, index) => /* @__PURE__ */ import_react15.default.createElement(import_antd11.List.Item, { key: item.text }, /* @__PURE__ */ import_react15.default.createElement(
|
|
556
711
|
import_antd11.List.Item.Meta,
|
|
557
712
|
{
|
|
558
|
-
avatar: /* @__PURE__ */
|
|
713
|
+
avatar: /* @__PURE__ */ import_react15.default.createElement(import_antd11.Avatar, { src: `https://api.dicebear.com/7.x/miniavs/svg?seed=${index}` }),
|
|
559
714
|
title: item.text,
|
|
560
715
|
description: item.time
|
|
561
716
|
}
|
|
@@ -565,61 +720,91 @@ var Notification = (props) => /* @__PURE__ */ import_react14.default.createEleme
|
|
|
565
720
|
trigger: "focus",
|
|
566
721
|
placement: "bottomRight"
|
|
567
722
|
},
|
|
568
|
-
/* @__PURE__ */
|
|
723
|
+
/* @__PURE__ */ import_react15.default.createElement(import_antd11.Button, { className: props.buttonClassName }, /* @__PURE__ */ import_react15.default.createElement(import_antd11.Badge, { size: "small", count: props.count }, /* @__PURE__ */ import_react15.default.createElement("span", { className: props.iconsClassName }, /* @__PURE__ */ import_react15.default.createElement(import_io.IoIosNotifications, null))))
|
|
569
724
|
);
|
|
570
725
|
|
|
571
726
|
// src/Components/SpanElement.tsx
|
|
572
|
-
var
|
|
573
|
-
var SpanElement = (props) => /* @__PURE__ */
|
|
727
|
+
var import_react16 = __toESM(require("react"));
|
|
728
|
+
var SpanElement = (props) => /* @__PURE__ */ import_react16.default.createElement("span", { className: props.className }, props.label);
|
|
574
729
|
|
|
575
730
|
// src/Components/Profile.tsx
|
|
576
|
-
var
|
|
731
|
+
var import_react17 = __toESM(require("react"));
|
|
577
732
|
var import_antd12 = require("antd");
|
|
578
|
-
var
|
|
579
|
-
var Profile = (props) => /* @__PURE__ */
|
|
733
|
+
var import_icons4 = require("@ant-design/icons");
|
|
734
|
+
var Profile = (props) => /* @__PURE__ */ import_react17.default.createElement("div", { className: props.className }, /* @__PURE__ */ import_react17.default.createElement(import_antd12.Avatar, { style: { backgroundColor: "#87d068", marginRight: "10px" }, icon: /* @__PURE__ */ import_react17.default.createElement(import_icons4.UserOutlined, null) }), /* @__PURE__ */ import_react17.default.createElement("div", { className: props.profileSubClassName }, /* @__PURE__ */ import_react17.default.createElement("p", null, props.primaryText), /* @__PURE__ */ import_react17.default.createElement("p", { className: props.secondTextClassName }, " ", props.secondaryText)));
|
|
580
735
|
|
|
581
736
|
// src/Components/Navbar.tsx
|
|
582
737
|
var Navbar = (props) => {
|
|
583
|
-
return /* @__PURE__ */
|
|
738
|
+
return /* @__PURE__ */ import_react18.default.createElement("div", { className: `${props.className}`, key: props.name }, props.items && props.items.map((item) => {
|
|
584
739
|
if (item.element === "span") {
|
|
585
|
-
return /* @__PURE__ */
|
|
740
|
+
return /* @__PURE__ */ import_react18.default.createElement(SpanElement, { ...item });
|
|
586
741
|
} else if (item.element === "notifications") {
|
|
587
|
-
return /* @__PURE__ */
|
|
742
|
+
return /* @__PURE__ */ import_react18.default.createElement(Notification, { ...item });
|
|
588
743
|
} else if (item.name === "profile") {
|
|
589
|
-
return /* @__PURE__ */
|
|
744
|
+
return /* @__PURE__ */ import_react18.default.createElement(Profile, { ...item });
|
|
590
745
|
}
|
|
591
746
|
return null;
|
|
592
747
|
}));
|
|
593
748
|
};
|
|
594
749
|
|
|
595
750
|
// src/Components/TableElement.tsx
|
|
596
|
-
var
|
|
751
|
+
var import_react21 = __toESM(require("react"));
|
|
597
752
|
var import_antd14 = require("antd");
|
|
598
753
|
|
|
599
754
|
// src/Components/Model.tsx
|
|
600
|
-
var
|
|
755
|
+
var import_react20 = __toESM(require("react"));
|
|
601
756
|
var import_antd13 = require("antd");
|
|
602
757
|
|
|
603
758
|
// src/Components/ModelBody.tsx
|
|
604
|
-
var
|
|
759
|
+
var import_react19 = __toESM(require("react"));
|
|
760
|
+
var import_moment = __toESM(require("moment"));
|
|
605
761
|
var ModelBody = (props) => {
|
|
606
|
-
return /* @__PURE__ */
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
762
|
+
return /* @__PURE__ */ import_react19.default.createElement("div", { className: props.modalContent && props.modalContent.className }, props.modalContent && props.modalContent.fields[1].fields.map(
|
|
763
|
+
(eachField) => {
|
|
764
|
+
if (eachField.element === "div") {
|
|
765
|
+
return /* @__PURE__ */ import_react19.default.createElement(import_react19.default.Fragment, null, /* @__PURE__ */ import_react19.default.createElement("div", { className: eachField.className }, eachField.label), eachField.dateTime ? /* @__PURE__ */ import_react19.default.createElement(
|
|
766
|
+
"p",
|
|
767
|
+
{
|
|
768
|
+
style: {
|
|
769
|
+
fontSize: "10px",
|
|
770
|
+
textAlign: eachField.source === "bot" ? "left" : "right"
|
|
771
|
+
}
|
|
772
|
+
},
|
|
773
|
+
(0, import_moment.default)(eachField.dateTime).format("LT")
|
|
774
|
+
) : "");
|
|
775
|
+
} else if (eachField.element === "input-radio") {
|
|
776
|
+
return /* @__PURE__ */ import_react19.default.createElement(import_react19.default.Fragment, null, /* @__PURE__ */ import_react19.default.createElement("div", { className: eachField.className }, /* @__PURE__ */ import_react19.default.createElement(RadioElement, { ...eachField })), eachField.dateTime ? /* @__PURE__ */ import_react19.default.createElement(
|
|
777
|
+
"p",
|
|
778
|
+
{
|
|
779
|
+
style: {
|
|
780
|
+
fontSize: "10px",
|
|
781
|
+
textAlign: eachField.source === "bot" ? "left" : "right"
|
|
782
|
+
}
|
|
783
|
+
},
|
|
784
|
+
(0, import_moment.default)(eachField.dateTime).format("LT")
|
|
785
|
+
) : "");
|
|
786
|
+
} else if (eachField.element === "button") {
|
|
787
|
+
return /* @__PURE__ */ import_react19.default.createElement(import_react19.default.Fragment, null, /* @__PURE__ */ import_react19.default.createElement("div", { className: eachField.className }, /* @__PURE__ */ import_react19.default.createElement(ButtonElement, { ...eachField })), eachField.dateTime ? /* @__PURE__ */ import_react19.default.createElement(
|
|
788
|
+
"p",
|
|
789
|
+
{
|
|
790
|
+
style: {
|
|
791
|
+
fontSize: "10px",
|
|
792
|
+
textAlign: eachField.source === "bot" ? "left" : "right"
|
|
793
|
+
}
|
|
794
|
+
},
|
|
795
|
+
(0, import_moment.default)(eachField.dateTime).format("LT")
|
|
796
|
+
) : "");
|
|
797
|
+
} else {
|
|
798
|
+
return null;
|
|
799
|
+
}
|
|
615
800
|
}
|
|
616
|
-
|
|
801
|
+
));
|
|
617
802
|
};
|
|
618
803
|
|
|
619
804
|
// src/Components/Model.tsx
|
|
620
805
|
var ModelElement = (props) => {
|
|
621
|
-
const { model, onCancel,
|
|
622
|
-
return /* @__PURE__ */
|
|
806
|
+
const { model, onCancel, modalContent } = props;
|
|
807
|
+
return /* @__PURE__ */ import_react20.default.createElement(
|
|
623
808
|
import_antd13.Modal,
|
|
624
809
|
{
|
|
625
810
|
centered: true,
|
|
@@ -627,7 +812,7 @@ var ModelElement = (props) => {
|
|
|
627
812
|
onCancel,
|
|
628
813
|
footer: null,
|
|
629
814
|
width: 850,
|
|
630
|
-
title: /* @__PURE__ */
|
|
815
|
+
title: /* @__PURE__ */ import_react20.default.createElement(
|
|
631
816
|
"div",
|
|
632
817
|
{
|
|
633
818
|
style: {
|
|
@@ -638,26 +823,49 @@ var ModelElement = (props) => {
|
|
|
638
823
|
margin: "-10px"
|
|
639
824
|
}
|
|
640
825
|
},
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
826
|
+
modalContent && modalContent.fields[0].fields.map((eachField) => {
|
|
827
|
+
return /* @__PURE__ */ import_react20.default.createElement("p", { style: { fontWeight: "500", padding: "10px" } }, /* @__PURE__ */ import_react20.default.createElement(
|
|
828
|
+
"span",
|
|
829
|
+
{
|
|
830
|
+
style: {
|
|
831
|
+
fontWeight: "200",
|
|
832
|
+
color: "gray",
|
|
833
|
+
paddingRight: "10px"
|
|
834
|
+
}
|
|
835
|
+
},
|
|
836
|
+
eachField.fields[0].label
|
|
837
|
+
), eachField.fields[0].label !== "" ? eachField.fields[0].label : "--");
|
|
644
838
|
})
|
|
645
839
|
)
|
|
646
840
|
},
|
|
647
|
-
/* @__PURE__ */
|
|
841
|
+
/* @__PURE__ */ import_react20.default.createElement(ModelBody, { ...props })
|
|
648
842
|
);
|
|
649
843
|
};
|
|
650
844
|
|
|
651
845
|
// src/Components/TableElement.tsx
|
|
846
|
+
var import_icons5 = require("@ant-design/icons");
|
|
652
847
|
var TableElement = (props) => {
|
|
653
848
|
const { thead, tbody } = props;
|
|
654
|
-
const [selectedRecord, setSelectedRecord] = (0,
|
|
655
|
-
const [model, setModel] = (0,
|
|
656
|
-
const [
|
|
849
|
+
const [selectedRecord, setSelectedRecord] = (0, import_react21.useState)({});
|
|
850
|
+
const [model, setModel] = (0, import_react21.useState)(false);
|
|
851
|
+
const [dataSource, setDataSource] = (0, import_react21.useState)([]);
|
|
852
|
+
const defaultVal = props.value;
|
|
853
|
+
(0, import_react21.useEffect)(() => {
|
|
854
|
+
if (tbody) {
|
|
855
|
+
setDataSource(
|
|
856
|
+
tbody.map((row, index) => ({
|
|
857
|
+
...row,
|
|
858
|
+
key: index,
|
|
859
|
+
index: index + 1
|
|
860
|
+
}))
|
|
861
|
+
);
|
|
862
|
+
}
|
|
863
|
+
}, [tbody]);
|
|
657
864
|
const handleChange = (record) => {
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
865
|
+
if (record) {
|
|
866
|
+
props.onChange && props.onChange(record);
|
|
867
|
+
} else {
|
|
868
|
+
props.onChange && props.onChange(defaultVal);
|
|
661
869
|
}
|
|
662
870
|
};
|
|
663
871
|
let columns = [];
|
|
@@ -665,88 +873,133 @@ var TableElement = (props) => {
|
|
|
665
873
|
columns = [
|
|
666
874
|
{
|
|
667
875
|
title: "#",
|
|
668
|
-
dataIndex: "
|
|
669
|
-
key: "
|
|
876
|
+
dataIndex: "index",
|
|
877
|
+
key: "index",
|
|
878
|
+
fixed: "left"
|
|
670
879
|
},
|
|
671
880
|
...thead.map((col, ind) => ({
|
|
672
881
|
title: col.label,
|
|
673
882
|
dataIndex: col.name,
|
|
674
883
|
key: col.key,
|
|
884
|
+
ellipsis: col.ellipsis,
|
|
675
885
|
render: col.render,
|
|
676
886
|
sorter: {
|
|
677
887
|
compare: (a, b) => {
|
|
678
|
-
if (typeof a[col.key] === "number" && typeof
|
|
888
|
+
if (typeof a[col.key] === "number" && typeof b[col.key] === "number") {
|
|
679
889
|
return a[col.key] - b[col.key];
|
|
680
|
-
} else if (typeof a[col.key] === "string" && typeof
|
|
890
|
+
} else if (typeof a[col.key] === "string" && typeof b[col.key] === "string") {
|
|
681
891
|
return a[col.key].localeCompare(b[col.key]);
|
|
682
892
|
}
|
|
683
893
|
}
|
|
684
894
|
}
|
|
685
|
-
}))
|
|
686
|
-
|
|
895
|
+
}))
|
|
896
|
+
];
|
|
897
|
+
if (props.view) {
|
|
898
|
+
columns.push({
|
|
687
899
|
title: "View",
|
|
688
900
|
dataIndex: "View",
|
|
689
901
|
key: "View",
|
|
690
|
-
render: (_, record) =>
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
902
|
+
render: (_, record) => {
|
|
903
|
+
return /* @__PURE__ */ import_react21.default.createElement(
|
|
904
|
+
"a",
|
|
905
|
+
{
|
|
906
|
+
onClick: () => {
|
|
907
|
+
if (props.view) {
|
|
908
|
+
setSelectedRecord(record);
|
|
909
|
+
handleChange(record);
|
|
910
|
+
setModel(true);
|
|
911
|
+
}
|
|
912
|
+
}
|
|
913
|
+
},
|
|
914
|
+
/* @__PURE__ */ import_react21.default.createElement(import_icons5.EyeOutlined, null)
|
|
915
|
+
);
|
|
916
|
+
}
|
|
917
|
+
});
|
|
918
|
+
}
|
|
703
919
|
}
|
|
704
|
-
const
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
920
|
+
const onChangeTable = (pagination, filters, sorter, extra) => {
|
|
921
|
+
if (extra && extra.currentDataSource) {
|
|
922
|
+
setDataSource(
|
|
923
|
+
extra.currentDataSource.map((row, index) => ({
|
|
924
|
+
...row,
|
|
925
|
+
index: index + 1
|
|
926
|
+
}))
|
|
927
|
+
);
|
|
928
|
+
}
|
|
929
|
+
};
|
|
709
930
|
const onChangePage = (page, pageSize) => {
|
|
710
931
|
if (props.onChange) {
|
|
711
932
|
props.onChange({ name: "pagination", page, pageSize });
|
|
712
933
|
}
|
|
713
934
|
};
|
|
714
|
-
const onSelectChange = (newSelectedRowKeys) => {
|
|
715
|
-
console.log("selectedRowKeys changed: ", newSelectedRowKeys);
|
|
716
|
-
setSelectedRowKeys(newSelectedRowKeys);
|
|
717
|
-
};
|
|
718
935
|
const rowSelectionConfig = props.rowSelection ? {
|
|
719
|
-
selectedRowKeys,
|
|
720
|
-
|
|
936
|
+
onChange: (selectedRowKeys, selectedRows) => {
|
|
937
|
+
console.log(
|
|
938
|
+
`selectedRowKeys: ${selectedRowKeys}`,
|
|
939
|
+
"selectedRows: ",
|
|
940
|
+
selectedRows
|
|
941
|
+
);
|
|
942
|
+
if (props.onChange) {
|
|
943
|
+
props.onChange(selectedRows);
|
|
944
|
+
}
|
|
945
|
+
}
|
|
721
946
|
} : void 0;
|
|
722
|
-
return /* @__PURE__ */
|
|
947
|
+
return /* @__PURE__ */ import_react21.default.createElement(import_react21.default.Fragment, null, /* @__PURE__ */ import_react21.default.createElement(
|
|
723
948
|
import_antd14.Table,
|
|
724
949
|
{
|
|
725
|
-
|
|
950
|
+
loading: props.loading,
|
|
951
|
+
className: props.className,
|
|
952
|
+
pagination: props.pagination ? {
|
|
953
|
+
current: props.value && props.value.page && props.value.page,
|
|
726
954
|
showTotal: (total) => `Total: ${total} items`,
|
|
727
|
-
total: count,
|
|
728
|
-
showSizeChanger: count > 10,
|
|
955
|
+
total: props.count,
|
|
956
|
+
showSizeChanger: props.count ? props.count > 10 : 0 > 10,
|
|
729
957
|
onChange: onChangePage
|
|
958
|
+
} : false,
|
|
959
|
+
onRow: (record) => {
|
|
960
|
+
return {
|
|
961
|
+
onClick: () => {
|
|
962
|
+
if (props.view) {
|
|
963
|
+
setSelectedRecord(record);
|
|
964
|
+
handleChange(record);
|
|
965
|
+
setModel(true);
|
|
966
|
+
}
|
|
967
|
+
},
|
|
968
|
+
style: { cursor: "pointer" }
|
|
969
|
+
};
|
|
730
970
|
},
|
|
971
|
+
rowSelection: rowSelectionConfig,
|
|
731
972
|
dataSource,
|
|
732
973
|
columns,
|
|
974
|
+
size: props.size,
|
|
733
975
|
bordered: true,
|
|
734
|
-
|
|
735
|
-
size: props.size && props.size
|
|
976
|
+
onChange: onChangeTable
|
|
736
977
|
}
|
|
737
|
-
), model && /* @__PURE__ */
|
|
978
|
+
), model && /* @__PURE__ */ import_react21.default.createElement(
|
|
979
|
+
ModelElement,
|
|
980
|
+
{
|
|
981
|
+
selectedRecord,
|
|
982
|
+
...props,
|
|
983
|
+
columns,
|
|
984
|
+
model,
|
|
985
|
+
onCancel: () => setModel(false)
|
|
986
|
+
}
|
|
987
|
+
));
|
|
738
988
|
};
|
|
739
989
|
|
|
740
990
|
// src/Components/DatePicker.tsx
|
|
741
|
-
var
|
|
991
|
+
var import_react22 = __toESM(require("react"));
|
|
742
992
|
var import_antd15 = require("antd");
|
|
993
|
+
var import_dayjs = __toESM(require("dayjs"));
|
|
994
|
+
var import_customParseFormat = __toESM(require("dayjs/plugin/customParseFormat.js"));
|
|
995
|
+
var import_moment2 = __toESM(require("moment"));
|
|
996
|
+
import_dayjs.default.extend(import_customParseFormat.default);
|
|
743
997
|
var DatePickerElement = (props) => {
|
|
744
|
-
const [dateState, setDateState] = (0,
|
|
745
|
-
const dateFormat = "DD/MM/YYYY";
|
|
998
|
+
const [dateState, setDateState] = (0, import_react22.useState)("");
|
|
746
999
|
const handleChange = (date, dateString) => {
|
|
747
1000
|
if (date) {
|
|
748
|
-
const formattedDate =
|
|
749
|
-
setDateState(
|
|
1001
|
+
const formattedDate = dateString;
|
|
1002
|
+
setDateState(date);
|
|
750
1003
|
if (props.onChange) {
|
|
751
1004
|
props.onChange(formattedDate);
|
|
752
1005
|
}
|
|
@@ -757,47 +1010,66 @@ var DatePickerElement = (props) => {
|
|
|
757
1010
|
}
|
|
758
1011
|
}
|
|
759
1012
|
};
|
|
760
|
-
|
|
1013
|
+
const disabledDate = (current) => {
|
|
1014
|
+
return current && current > (0, import_moment2.default)();
|
|
1015
|
+
};
|
|
1016
|
+
return /* @__PURE__ */ import_react22.default.createElement("div", null, /* @__PURE__ */ import_react22.default.createElement(
|
|
761
1017
|
import_antd15.DatePicker,
|
|
762
1018
|
{
|
|
1019
|
+
disabledDate,
|
|
763
1020
|
placeholder: props.placeholder,
|
|
764
1021
|
value: dateState,
|
|
765
|
-
|
|
1022
|
+
format: { format: "DD-MM-YYYY" },
|
|
766
1023
|
onChange: handleChange
|
|
767
1024
|
}
|
|
768
1025
|
));
|
|
769
1026
|
};
|
|
770
1027
|
|
|
771
1028
|
// src/Components/DateRangePickerElement.tsx
|
|
772
|
-
var
|
|
1029
|
+
var import_react23 = __toESM(require("react"));
|
|
773
1030
|
var import_antd16 = require("antd");
|
|
774
|
-
var
|
|
1031
|
+
var import_dayjs2 = __toESM(require("dayjs"));
|
|
1032
|
+
var import_moment3 = __toESM(require("moment"));
|
|
775
1033
|
var DateRangePickerElement = (props) => {
|
|
1034
|
+
const { value } = props;
|
|
776
1035
|
const { RangePicker } = import_antd16.DatePicker;
|
|
1036
|
+
const dateValues = value ? value.map((date) => (0, import_dayjs2.default)(date, "DD-MM-YYYY")) : null;
|
|
777
1037
|
const handleChange = (dates, dateStrings) => {
|
|
778
|
-
if (dates
|
|
779
|
-
props.onChange(dateStrings);
|
|
1038
|
+
if (dates) {
|
|
1039
|
+
props.onChange && props.onChange(dateStrings);
|
|
780
1040
|
} else {
|
|
781
|
-
|
|
1041
|
+
props.onChange && props.onChange("");
|
|
782
1042
|
}
|
|
783
1043
|
};
|
|
784
1044
|
const rangePresets = [
|
|
785
|
-
{ label: "Last 7 Days", value: [(0,
|
|
786
|
-
{ label: "Last 14 Days", value: [(0,
|
|
787
|
-
{ label: "Last 30 Days", value: [(0,
|
|
788
|
-
{ label: "Last 90 Days", value: [(0,
|
|
1045
|
+
{ label: "Last 7 Days", value: [(0, import_dayjs2.default)().add(-7, "d"), (0, import_dayjs2.default)()] },
|
|
1046
|
+
{ label: "Last 14 Days", value: [(0, import_dayjs2.default)().add(-14, "d"), (0, import_dayjs2.default)()] },
|
|
1047
|
+
{ label: "Last 30 Days", value: [(0, import_dayjs2.default)().add(-30, "d"), (0, import_dayjs2.default)()] },
|
|
1048
|
+
{ label: "Last 90 Days", value: [(0, import_dayjs2.default)().add(-90, "d"), (0, import_dayjs2.default)()] }
|
|
789
1049
|
];
|
|
790
|
-
|
|
1050
|
+
const disabledDate = (current) => {
|
|
1051
|
+
return current && current > (0, import_moment3.default)();
|
|
1052
|
+
};
|
|
1053
|
+
return /* @__PURE__ */ import_react23.default.createElement(import_antd16.Space, { direction: "vertical", size: 12 }, /* @__PURE__ */ import_react23.default.createElement(
|
|
1054
|
+
RangePicker,
|
|
1055
|
+
{
|
|
1056
|
+
disabledDate,
|
|
1057
|
+
presets: rangePresets,
|
|
1058
|
+
format: { format: "DD-MM-YYYY" },
|
|
1059
|
+
onChange: handleChange,
|
|
1060
|
+
value: dateValues
|
|
1061
|
+
}
|
|
1062
|
+
));
|
|
791
1063
|
};
|
|
792
1064
|
|
|
793
1065
|
// src/Components/Image.tsx
|
|
794
|
-
var
|
|
1066
|
+
var import_react24 = __toESM(require("react"));
|
|
795
1067
|
var Image = (props) => {
|
|
796
|
-
return /* @__PURE__ */
|
|
1068
|
+
return /* @__PURE__ */ import_react24.default.createElement("img", { className: props.className, src: props.img, alt: "image" });
|
|
797
1069
|
};
|
|
798
1070
|
|
|
799
1071
|
// src/Components/SingleCheckbox.tsx
|
|
800
|
-
var
|
|
1072
|
+
var import_react25 = __toESM(require("react"));
|
|
801
1073
|
var import_antd17 = require("antd");
|
|
802
1074
|
var SingleCheckbox = (props) => {
|
|
803
1075
|
const handleChange = (e) => {
|
|
@@ -805,28 +1077,30 @@ var SingleCheckbox = (props) => {
|
|
|
805
1077
|
props.onChange(e.target.checked);
|
|
806
1078
|
}
|
|
807
1079
|
};
|
|
808
|
-
return /* @__PURE__ */
|
|
1080
|
+
return /* @__PURE__ */ import_react25.default.createElement(import_antd17.Checkbox, { onChange: (e) => handleChange(e), className: props.className }, props.label);
|
|
809
1081
|
};
|
|
810
1082
|
|
|
811
1083
|
// src/Components/DropDownGroup.tsx
|
|
812
|
-
var
|
|
1084
|
+
var import_react26 = __toESM(require("react"));
|
|
813
1085
|
var import_antd18 = require("antd");
|
|
814
1086
|
var DropDownGroup = (props) => {
|
|
815
|
-
const [selectedValue, setSelectedValue] = (0,
|
|
1087
|
+
const [selectedValue, setSelectedValue] = (0, import_react26.useState)({
|
|
816
1088
|
firstValue: {},
|
|
817
|
-
secondValue: {}
|
|
1089
|
+
secondValue: {},
|
|
1090
|
+
temp: ""
|
|
818
1091
|
});
|
|
819
1092
|
const handleFirstChange = (value) => {
|
|
1093
|
+
console.log(selectedValue.temp);
|
|
820
1094
|
const filterOption2 = props.firstOptions?.find(
|
|
821
1095
|
(eachOption) => eachOption.value === value
|
|
822
1096
|
);
|
|
823
1097
|
setSelectedValue((prev) => {
|
|
824
1098
|
const newValue = { ...prev, firstValue: filterOption2 };
|
|
1099
|
+
const { temp, ...rest } = newValue;
|
|
825
1100
|
if (newValue.firstValue) {
|
|
826
|
-
props.onChange?.(
|
|
1101
|
+
props.onChange?.(rest);
|
|
827
1102
|
}
|
|
828
|
-
|
|
829
|
-
return selectedValue;
|
|
1103
|
+
return newValue;
|
|
830
1104
|
});
|
|
831
1105
|
};
|
|
832
1106
|
const handleSecondChange = (value) => {
|
|
@@ -835,39 +1109,49 @@ var DropDownGroup = (props) => {
|
|
|
835
1109
|
);
|
|
836
1110
|
setSelectedValue((prev) => {
|
|
837
1111
|
const newValue = { ...prev, secondValue: filterOption2 };
|
|
1112
|
+
const { temp, ...rest } = newValue;
|
|
838
1113
|
if (newValue.secondValue) {
|
|
839
|
-
props.onChange?.(
|
|
1114
|
+
props.onChange?.(rest);
|
|
840
1115
|
}
|
|
841
|
-
|
|
842
|
-
return selectedValue;
|
|
1116
|
+
return newValue;
|
|
843
1117
|
});
|
|
844
1118
|
};
|
|
845
|
-
|
|
1119
|
+
const firstFilterOptions = (input, option) => {
|
|
1120
|
+
return (option?.label ?? "").toLowerCase().includes(input.toLowerCase());
|
|
1121
|
+
};
|
|
1122
|
+
const secondFilterOptions = (input, option) => {
|
|
1123
|
+
return (option?.label ?? "").toLowerCase().includes(input.toLowerCase());
|
|
1124
|
+
};
|
|
1125
|
+
return /* @__PURE__ */ import_react26.default.createElement("div", { className: props.containerClassName }, props.label && /* @__PURE__ */ import_react26.default.createElement("label", { htmlFor: props.name, className: props.labelClassName }, props.label), /* @__PURE__ */ import_react26.default.createElement("div", { className: props.subContainerClassName }, /* @__PURE__ */ import_react26.default.createElement(
|
|
846
1126
|
import_antd18.Select,
|
|
847
1127
|
{
|
|
848
1128
|
onChange: handleFirstChange,
|
|
849
1129
|
variant: props.variant,
|
|
850
1130
|
options: props.firstOptions,
|
|
851
|
-
className: props.className
|
|
1131
|
+
className: props.className,
|
|
1132
|
+
filterOption: firstFilterOptions,
|
|
1133
|
+
showSearch: true
|
|
852
1134
|
}
|
|
853
|
-
), /* @__PURE__ */
|
|
1135
|
+
), /* @__PURE__ */ import_react26.default.createElement("div", { style: { borderLeft: "1px solid gray", height: "33px" } }), /* @__PURE__ */ import_react26.default.createElement(
|
|
854
1136
|
import_antd18.Select,
|
|
855
1137
|
{
|
|
856
1138
|
onChange: handleSecondChange,
|
|
857
1139
|
variant: props.variant,
|
|
858
1140
|
options: props.secondOptions,
|
|
859
|
-
className: props.className
|
|
1141
|
+
className: props.className,
|
|
1142
|
+
filterOption: secondFilterOptions,
|
|
1143
|
+
showSearch: true
|
|
860
1144
|
}
|
|
861
1145
|
)));
|
|
862
1146
|
};
|
|
863
1147
|
|
|
864
1148
|
// src/Components/FilesUpload.tsx
|
|
865
|
-
var
|
|
1149
|
+
var import_react27 = __toESM(require("react"));
|
|
866
1150
|
var import_antd19 = require("antd");
|
|
867
|
-
var
|
|
1151
|
+
var import_icons6 = require("@ant-design/icons");
|
|
868
1152
|
var FileUpload = (props) => {
|
|
869
1153
|
const { Dragger } = import_antd19.Upload;
|
|
870
|
-
const [files, setFiles] = (0,
|
|
1154
|
+
const [files, setFiles] = (0, import_react27.useState)([]);
|
|
871
1155
|
const handleChange = ({ fileList }) => {
|
|
872
1156
|
setFiles(fileList);
|
|
873
1157
|
if (props.onChange) {
|
|
@@ -882,7 +1166,7 @@ var FileUpload = (props) => {
|
|
|
882
1166
|
onSuccess("ok");
|
|
883
1167
|
}, 0);
|
|
884
1168
|
};
|
|
885
|
-
return /* @__PURE__ */
|
|
1169
|
+
return /* @__PURE__ */ import_react27.default.createElement("div", null, /* @__PURE__ */ import_react27.default.createElement(
|
|
886
1170
|
Dragger,
|
|
887
1171
|
{
|
|
888
1172
|
action: "",
|
|
@@ -895,13 +1179,13 @@ var FileUpload = (props) => {
|
|
|
895
1179
|
showUploadList: true,
|
|
896
1180
|
customRequest
|
|
897
1181
|
},
|
|
898
|
-
/* @__PURE__ */
|
|
899
|
-
/* @__PURE__ */
|
|
1182
|
+
/* @__PURE__ */ import_react27.default.createElement("p", null, /* @__PURE__ */ import_react27.default.createElement(import_icons6.InboxOutlined, null)),
|
|
1183
|
+
/* @__PURE__ */ import_react27.default.createElement("p", null, "Click or drag file to upload")
|
|
900
1184
|
));
|
|
901
1185
|
};
|
|
902
1186
|
|
|
903
1187
|
// src/Components/TabsElement.tsx
|
|
904
|
-
var
|
|
1188
|
+
var import_react28 = __toESM(require("react"));
|
|
905
1189
|
var import_antd20 = require("antd");
|
|
906
1190
|
var TabsElement = (props) => {
|
|
907
1191
|
const handleChange = (key) => {
|
|
@@ -909,33 +1193,556 @@ var TabsElement = (props) => {
|
|
|
909
1193
|
props.onChange(props.options?.find((eachOption) => eachOption.key === key));
|
|
910
1194
|
}
|
|
911
1195
|
};
|
|
912
|
-
return /* @__PURE__ */
|
|
1196
|
+
return /* @__PURE__ */ import_react28.default.createElement(import_antd20.Tabs, { className: props.containerClassName, items: props.options, onChange: handleChange });
|
|
913
1197
|
};
|
|
914
1198
|
|
|
915
1199
|
// src/Components/SwitchElement.tsx
|
|
916
|
-
var
|
|
1200
|
+
var import_react29 = __toESM(require("react"));
|
|
917
1201
|
var import_antd21 = require("antd");
|
|
918
1202
|
var onChange = (checked) => {
|
|
919
1203
|
console.log(`switch to ${checked}`);
|
|
920
1204
|
};
|
|
921
|
-
var SwitchElement = () => /* @__PURE__ */
|
|
1205
|
+
var SwitchElement = () => /* @__PURE__ */ import_react29.default.createElement(import_antd21.Switch, { defaultChecked: true, onChange });
|
|
1206
|
+
|
|
1207
|
+
// src/Components/Upload.tsx
|
|
1208
|
+
var import_react30 = __toESM(require("react"));
|
|
1209
|
+
var Upload2 = (props) => {
|
|
1210
|
+
const [file, setFile] = (0, import_react30.useState)();
|
|
1211
|
+
const handleFileChange = (e) => {
|
|
1212
|
+
setFile(e.target.files[0]);
|
|
1213
|
+
if (props.onChange) {
|
|
1214
|
+
props.onChange(e.target.files[0]);
|
|
1215
|
+
}
|
|
1216
|
+
};
|
|
1217
|
+
const handleUpload = async () => {
|
|
1218
|
+
if (!file) {
|
|
1219
|
+
console.error("No file selected");
|
|
1220
|
+
return;
|
|
1221
|
+
}
|
|
1222
|
+
};
|
|
1223
|
+
return /* @__PURE__ */ import_react30.default.createElement("div", { style: { marginTop: 16 } }, /* @__PURE__ */ import_react30.default.createElement("input", { type: "file", onChange: handleFileChange }), /* @__PURE__ */ import_react30.default.createElement(
|
|
1224
|
+
"button",
|
|
1225
|
+
{
|
|
1226
|
+
type: "button",
|
|
1227
|
+
onClick: handleUpload,
|
|
1228
|
+
disabled: !file,
|
|
1229
|
+
style: { marginTop: 16 }
|
|
1230
|
+
},
|
|
1231
|
+
"Upload"
|
|
1232
|
+
));
|
|
1233
|
+
};
|
|
1234
|
+
|
|
1235
|
+
// src/Components/OtpElement.tsx
|
|
1236
|
+
var import_react31 = __toESM(require("react"));
|
|
1237
|
+
var import_antd22 = require("antd");
|
|
1238
|
+
var OtpElement = (props) => {
|
|
1239
|
+
const length = props.length;
|
|
1240
|
+
const [otp, setOtp] = (0, import_react31.useState)(Array(length).fill(""));
|
|
1241
|
+
const inputRefs = (0, import_react31.useRef)([]);
|
|
1242
|
+
const handleChange = (e, index) => {
|
|
1243
|
+
const value = e.target.value;
|
|
1244
|
+
if (/^[0-9]$/.test(value) || value === "") {
|
|
1245
|
+
const newOtp = [...otp];
|
|
1246
|
+
newOtp[index] = value;
|
|
1247
|
+
setOtp(newOtp);
|
|
1248
|
+
props.onChange && props.onChange(newOtp.join(""));
|
|
1249
|
+
if (value && index < length - 1) {
|
|
1250
|
+
inputRefs.current[index + 1]?.focus();
|
|
1251
|
+
}
|
|
1252
|
+
}
|
|
1253
|
+
};
|
|
1254
|
+
const handleKeyDown = (e, index) => {
|
|
1255
|
+
if (e.key === "Backspace" && !otp[index] && index > 0) {
|
|
1256
|
+
inputRefs.current[index - 1]?.focus();
|
|
1257
|
+
}
|
|
1258
|
+
};
|
|
1259
|
+
const handlePaste = (e) => {
|
|
1260
|
+
e.preventDefault();
|
|
1261
|
+
const pasteData = e.clipboardData.getData("text");
|
|
1262
|
+
if (/^\d+$/.test(pasteData)) {
|
|
1263
|
+
const newOtp = pasteData.split("").slice(0, length);
|
|
1264
|
+
setOtp(newOtp.concat(Array(length - newOtp.length).fill("")));
|
|
1265
|
+
props.onChange && props.onChange(newOtp.join(""));
|
|
1266
|
+
newOtp.forEach((_, idx) => {
|
|
1267
|
+
if (inputRefs.current[idx]) {
|
|
1268
|
+
inputRefs.current[idx]?.focus();
|
|
1269
|
+
}
|
|
1270
|
+
});
|
|
1271
|
+
}
|
|
1272
|
+
};
|
|
1273
|
+
(0, import_react31.useEffect)(() => {
|
|
1274
|
+
inputRefs.current[0]?.focus();
|
|
1275
|
+
}, []);
|
|
1276
|
+
return /* @__PURE__ */ import_react31.default.createElement("div", { className: props.containerClassName }, Array.from({ length }).map((_, index) => /* @__PURE__ */ import_react31.default.createElement(
|
|
1277
|
+
import_antd22.Input,
|
|
1278
|
+
{
|
|
1279
|
+
key: index,
|
|
1280
|
+
className: props.className,
|
|
1281
|
+
maxLength: 1,
|
|
1282
|
+
value: otp[index],
|
|
1283
|
+
onChange: (e) => handleChange(e, index),
|
|
1284
|
+
onKeyDown: (e) => handleKeyDown(e, index),
|
|
1285
|
+
onPaste: handlePaste,
|
|
1286
|
+
ref: (el) => inputRefs.current[index] = el
|
|
1287
|
+
}
|
|
1288
|
+
)));
|
|
1289
|
+
};
|
|
1290
|
+
|
|
1291
|
+
// src/Components/CircleDonut.tsx
|
|
1292
|
+
var import_react32 = __toESM(require("react"));
|
|
1293
|
+
var import_react_chartjs_2 = require("react-chartjs-2");
|
|
1294
|
+
var import_chart = require("chart.js");
|
|
1295
|
+
import_chart.Chart.register(import_chart.DoughnutController, import_chart.ArcElement, import_chart.Tooltip, import_chart.Legend);
|
|
1296
|
+
var CircleDonut = (props) => {
|
|
1297
|
+
const data = {
|
|
1298
|
+
labels: props.labels,
|
|
1299
|
+
datasets: [
|
|
1300
|
+
{
|
|
1301
|
+
label: "Bot Conversation",
|
|
1302
|
+
data: props.data,
|
|
1303
|
+
backgroundColor: [
|
|
1304
|
+
"#FFCB8A",
|
|
1305
|
+
"#CADBBF",
|
|
1306
|
+
"#8AC1BB",
|
|
1307
|
+
"#FCB0CB",
|
|
1308
|
+
"#CEB0FA"
|
|
1309
|
+
],
|
|
1310
|
+
borderWidth: 0
|
|
1311
|
+
}
|
|
1312
|
+
]
|
|
1313
|
+
};
|
|
1314
|
+
const options = {
|
|
1315
|
+
responsive: true,
|
|
1316
|
+
cutout: "80%",
|
|
1317
|
+
plugins: {
|
|
1318
|
+
legend: {
|
|
1319
|
+
position: "left",
|
|
1320
|
+
labels: {
|
|
1321
|
+
font: {
|
|
1322
|
+
size: 10
|
|
1323
|
+
},
|
|
1324
|
+
boxWidth: 15,
|
|
1325
|
+
generateLabels: (chart) => {
|
|
1326
|
+
const dataset = chart.data.datasets[0];
|
|
1327
|
+
return chart.data.labels.map((label, index) => {
|
|
1328
|
+
const value = dataset.data[index];
|
|
1329
|
+
return {
|
|
1330
|
+
text: `${label}: ${value}`,
|
|
1331
|
+
fillStyle: dataset.backgroundColor[index]
|
|
1332
|
+
};
|
|
1333
|
+
});
|
|
1334
|
+
}
|
|
1335
|
+
}
|
|
1336
|
+
},
|
|
1337
|
+
tooltip: {
|
|
1338
|
+
enabled: true,
|
|
1339
|
+
callbacks: {
|
|
1340
|
+
label: function(context) {
|
|
1341
|
+
const label = context.label || "";
|
|
1342
|
+
const value = context.raw || 0;
|
|
1343
|
+
return `${label}: ${value}`;
|
|
1344
|
+
}
|
|
1345
|
+
}
|
|
1346
|
+
}
|
|
1347
|
+
}
|
|
1348
|
+
};
|
|
1349
|
+
const centerTextPlugin = {
|
|
1350
|
+
id: "centerText",
|
|
1351
|
+
beforeDraw: (chart) => {
|
|
1352
|
+
const { ctx, chartArea: { left, right, top, bottom } } = chart;
|
|
1353
|
+
const width = right - left;
|
|
1354
|
+
const height = bottom - top;
|
|
1355
|
+
const centerX = left + width / 2;
|
|
1356
|
+
const centerY = top + height / 2;
|
|
1357
|
+
ctx.save();
|
|
1358
|
+
ctx.font = "7px Arial";
|
|
1359
|
+
ctx.fillStyle = "blue";
|
|
1360
|
+
ctx.textAlign = "center";
|
|
1361
|
+
ctx.textBaseline = "middle";
|
|
1362
|
+
ctx.fillText("Total Sessions", centerX, centerY - 10);
|
|
1363
|
+
ctx.font = "25px Arial";
|
|
1364
|
+
ctx.fillStyle = "black";
|
|
1365
|
+
ctx.fillText("85", centerX, centerY + 20);
|
|
1366
|
+
ctx.restore();
|
|
1367
|
+
}
|
|
1368
|
+
};
|
|
1369
|
+
return /* @__PURE__ */ import_react32.default.createElement("div", { className: props.className }, /* @__PURE__ */ import_react32.default.createElement("h1", { className: props.labelClassName }, props.label), /* @__PURE__ */ import_react32.default.createElement(import_react_chartjs_2.Doughnut, { data, options, plugins: [centerTextPlugin] }));
|
|
1370
|
+
};
|
|
1371
|
+
|
|
1372
|
+
// src/Components/SemiCircleDonut.tsx
|
|
1373
|
+
var import_react33 = __toESM(require("react"));
|
|
1374
|
+
var import_react_chartjs_22 = require("react-chartjs-2");
|
|
1375
|
+
var import_chart2 = require("chart.js");
|
|
1376
|
+
import_chart2.Chart.register(import_chart2.DoughnutController, import_chart2.ArcElement, import_chart2.Tooltip, import_chart2.Legend);
|
|
1377
|
+
var SemiCircleDonut = (props) => {
|
|
1378
|
+
const data = {
|
|
1379
|
+
labels: [
|
|
1380
|
+
"Registration",
|
|
1381
|
+
"Book Appointment",
|
|
1382
|
+
"Diagnostic Tests",
|
|
1383
|
+
"Hospital Facility",
|
|
1384
|
+
"Others, Prescriptions"
|
|
1385
|
+
],
|
|
1386
|
+
datasets: [
|
|
1387
|
+
{
|
|
1388
|
+
label: "Bot Conversation",
|
|
1389
|
+
data: [30, 10, 27, 40, 12],
|
|
1390
|
+
backgroundColor: [
|
|
1391
|
+
"#FFCB8A",
|
|
1392
|
+
"#CADBBF",
|
|
1393
|
+
"#8AC1BB",
|
|
1394
|
+
"#FCB0CB",
|
|
1395
|
+
"#CEB0FA"
|
|
1396
|
+
],
|
|
1397
|
+
borderWidth: 0
|
|
1398
|
+
}
|
|
1399
|
+
]
|
|
1400
|
+
};
|
|
1401
|
+
const options = {
|
|
1402
|
+
responsive: true,
|
|
1403
|
+
circumference: 180,
|
|
1404
|
+
rotation: -90,
|
|
1405
|
+
cutout: "80%",
|
|
1406
|
+
plugins: {
|
|
1407
|
+
legend: {
|
|
1408
|
+
display: false
|
|
1409
|
+
// Disable the legend
|
|
1410
|
+
},
|
|
1411
|
+
tooltip: {
|
|
1412
|
+
enabled: true,
|
|
1413
|
+
callbacks: {
|
|
1414
|
+
label: function(context) {
|
|
1415
|
+
const label = context.label || "";
|
|
1416
|
+
const value = context.raw || 0;
|
|
1417
|
+
return `${label}: ${value}`;
|
|
1418
|
+
}
|
|
1419
|
+
}
|
|
1420
|
+
}
|
|
1421
|
+
}
|
|
1422
|
+
};
|
|
1423
|
+
const centerTextPlugin = {
|
|
1424
|
+
id: "centerText",
|
|
1425
|
+
beforeDraw: (chart) => {
|
|
1426
|
+
const { ctx, chartArea: { left, right, top, bottom } } = chart;
|
|
1427
|
+
const width = right - left;
|
|
1428
|
+
const height = bottom - top;
|
|
1429
|
+
const centerX = left + width / 2;
|
|
1430
|
+
const centerY = top + height / 1.5;
|
|
1431
|
+
const maxWidth = width * 0.8;
|
|
1432
|
+
ctx.save();
|
|
1433
|
+
ctx.fillStyle = "black";
|
|
1434
|
+
ctx.textAlign = "center";
|
|
1435
|
+
ctx.textBaseline = "middle";
|
|
1436
|
+
const drawText = (text, y, fontSize) => {
|
|
1437
|
+
ctx.font = `${fontSize}px Arial`;
|
|
1438
|
+
const textWidth = ctx.measureText(text).width;
|
|
1439
|
+
if (textWidth > maxWidth) {
|
|
1440
|
+
const newFontSize = fontSize * maxWidth / textWidth;
|
|
1441
|
+
ctx.font = `${newFontSize}px Arial`;
|
|
1442
|
+
}
|
|
1443
|
+
ctx.fillText(text, centerX, y);
|
|
1444
|
+
};
|
|
1445
|
+
drawText(props.fillText1, centerY - 10, 16);
|
|
1446
|
+
drawText(props.fillText2, centerY + 20, 8);
|
|
1447
|
+
ctx.restore();
|
|
1448
|
+
}
|
|
1449
|
+
};
|
|
1450
|
+
return /* @__PURE__ */ import_react33.default.createElement("div", { className: props.className }, /* @__PURE__ */ import_react33.default.createElement("h1", { className: props.labelClassName }, props.label), /* @__PURE__ */ import_react33.default.createElement(import_react_chartjs_22.Doughnut, { data, options, plugins: [centerTextPlugin] }));
|
|
1451
|
+
};
|
|
1452
|
+
|
|
1453
|
+
// src/Components/HorizontalBarChart.tsx
|
|
1454
|
+
var import_react34 = __toESM(require("react"));
|
|
1455
|
+
var import_react_chartjs_23 = require("react-chartjs-2");
|
|
1456
|
+
var import_chart3 = require("chart.js");
|
|
1457
|
+
import_chart3.Chart.register(import_chart3.BarElement, import_chart3.CategoryScale, import_chart3.LinearScale, import_chart3.Tooltip);
|
|
1458
|
+
var HorizontalBarChart = (props) => {
|
|
1459
|
+
const data = {
|
|
1460
|
+
labels: ["18-24", "25-34", "35-44", "45-54", "55-64", "65+"],
|
|
1461
|
+
datasets: [
|
|
1462
|
+
{
|
|
1463
|
+
data: [30, 10, 27, 40, 12, 24],
|
|
1464
|
+
backgroundColor: "#6298D5",
|
|
1465
|
+
barThickness: 15
|
|
1466
|
+
}
|
|
1467
|
+
]
|
|
1468
|
+
};
|
|
1469
|
+
const options = {
|
|
1470
|
+
responsive: true,
|
|
1471
|
+
indexAxis: "y",
|
|
1472
|
+
scales: {
|
|
1473
|
+
x: {
|
|
1474
|
+
beginAtZero: true,
|
|
1475
|
+
ticks: {
|
|
1476
|
+
callback: function(value) {
|
|
1477
|
+
return `${value}%`;
|
|
1478
|
+
}
|
|
1479
|
+
}
|
|
1480
|
+
},
|
|
1481
|
+
y: {
|
|
1482
|
+
grid: {
|
|
1483
|
+
display: false
|
|
1484
|
+
}
|
|
1485
|
+
}
|
|
1486
|
+
},
|
|
1487
|
+
plugins: {
|
|
1488
|
+
tooltip: {
|
|
1489
|
+
enabled: true,
|
|
1490
|
+
callbacks: {
|
|
1491
|
+
label: function(context) {
|
|
1492
|
+
const label = context.label || "";
|
|
1493
|
+
const value = context.raw || 0;
|
|
1494
|
+
return `${label}: ${value}`;
|
|
1495
|
+
}
|
|
1496
|
+
}
|
|
1497
|
+
},
|
|
1498
|
+
legend: {
|
|
1499
|
+
display: false
|
|
1500
|
+
}
|
|
1501
|
+
}
|
|
1502
|
+
};
|
|
1503
|
+
return /* @__PURE__ */ import_react34.default.createElement("div", { className: props.className }, /* @__PURE__ */ import_react34.default.createElement("h1", { className: props.labelClassName }, props.label), /* @__PURE__ */ import_react34.default.createElement(import_react_chartjs_23.Bar, { data, options }));
|
|
1504
|
+
};
|
|
1505
|
+
|
|
1506
|
+
// src/Components/LineChart.tsx
|
|
1507
|
+
var import_react35 = __toESM(require("react"));
|
|
1508
|
+
var import_auto = __toESM(require("chart.js/auto"));
|
|
1509
|
+
var LineChart = (props) => {
|
|
1510
|
+
const chartRef = (0, import_react35.useRef)(null);
|
|
1511
|
+
const chartInstance = (0, import_react35.useRef)(null);
|
|
1512
|
+
const data = [
|
|
1513
|
+
{ label: "ROI", data: [10, 13, 20, 15, 10] },
|
|
1514
|
+
{ label: "Engagement Rate", data: [20, 23, 30, 28, 20] },
|
|
1515
|
+
{ label: "Conversion Rate", data: [50, 100, 150, 180, 50] }
|
|
1516
|
+
];
|
|
1517
|
+
const labels = ["Instagram", "Whatsapp", "Messages", "Telegram", "Linkedin"];
|
|
1518
|
+
(0, import_react35.useEffect)(() => {
|
|
1519
|
+
if (chartRef.current) {
|
|
1520
|
+
if (chartInstance.current) {
|
|
1521
|
+
chartInstance.current.destroy();
|
|
1522
|
+
}
|
|
1523
|
+
chartInstance.current = new import_auto.default(chartRef.current, {
|
|
1524
|
+
type: "line",
|
|
1525
|
+
data: {
|
|
1526
|
+
labels,
|
|
1527
|
+
datasets: data.map((dataset, index) => ({
|
|
1528
|
+
label: dataset.label,
|
|
1529
|
+
data: dataset.data,
|
|
1530
|
+
borderColor: index === 0 ? "#FF8F00" : index === 1 ? "#F50057" : "#254AAA",
|
|
1531
|
+
backgroundColor: "rgba(0, 0, 0, 0)",
|
|
1532
|
+
pointBackgroundColor: index === 0 ? "#FF8F00" : index === 1 ? "#F50057" : "#254AAA",
|
|
1533
|
+
pointBorderColor: "white",
|
|
1534
|
+
pointStyle: "circle",
|
|
1535
|
+
pointRadius: 3,
|
|
1536
|
+
tension: 0.1,
|
|
1537
|
+
fill: true
|
|
1538
|
+
}))
|
|
1539
|
+
},
|
|
1540
|
+
options: {
|
|
1541
|
+
plugins: {
|
|
1542
|
+
legend: {
|
|
1543
|
+
labels: {
|
|
1544
|
+
usePointStyle: true
|
|
1545
|
+
}
|
|
1546
|
+
}
|
|
1547
|
+
},
|
|
1548
|
+
scales: {
|
|
1549
|
+
x: {
|
|
1550
|
+
grid: {
|
|
1551
|
+
display: false
|
|
1552
|
+
}
|
|
1553
|
+
},
|
|
1554
|
+
y: {
|
|
1555
|
+
beginAtZero: true,
|
|
1556
|
+
suggestedMax: 200,
|
|
1557
|
+
ticks: {
|
|
1558
|
+
callback: function(value) {
|
|
1559
|
+
return value + "%";
|
|
1560
|
+
}
|
|
1561
|
+
},
|
|
1562
|
+
grid: {
|
|
1563
|
+
display: true
|
|
1564
|
+
}
|
|
1565
|
+
}
|
|
1566
|
+
}
|
|
1567
|
+
}
|
|
1568
|
+
});
|
|
1569
|
+
}
|
|
1570
|
+
return () => {
|
|
1571
|
+
if (chartInstance.current) {
|
|
1572
|
+
chartInstance.current.destroy();
|
|
1573
|
+
}
|
|
1574
|
+
};
|
|
1575
|
+
}, [labels, data]);
|
|
1576
|
+
return /* @__PURE__ */ import_react35.default.createElement("div", { className: props.className }, /* @__PURE__ */ import_react35.default.createElement("canvas", { ref: chartRef }));
|
|
1577
|
+
};
|
|
1578
|
+
|
|
1579
|
+
// src/Components/DoubleBarChart.tsx
|
|
1580
|
+
var import_react36 = __toESM(require("react"));
|
|
1581
|
+
var import_auto2 = __toESM(require("chart.js/auto"));
|
|
1582
|
+
var DoubleBarChart = (props) => {
|
|
1583
|
+
const chartRef = (0, import_react36.useRef)(null);
|
|
1584
|
+
const chartInstance = (0, import_react36.useRef)(null);
|
|
1585
|
+
(0, import_react36.useEffect)(() => {
|
|
1586
|
+
if (chartRef.current) {
|
|
1587
|
+
if (chartInstance.current) {
|
|
1588
|
+
chartInstance.current.destroy();
|
|
1589
|
+
}
|
|
1590
|
+
chartInstance.current = new import_auto2.default(chartRef.current, {
|
|
1591
|
+
type: "bar",
|
|
1592
|
+
data: {
|
|
1593
|
+
labels: [
|
|
1594
|
+
"Summer Health Tips",
|
|
1595
|
+
"New Services Launch",
|
|
1596
|
+
"Discounts on Checkups",
|
|
1597
|
+
"Wellness Webinar",
|
|
1598
|
+
"LinkedIn Insights"
|
|
1599
|
+
],
|
|
1600
|
+
datasets: [
|
|
1601
|
+
{
|
|
1602
|
+
label: "Engagement Rate",
|
|
1603
|
+
data: [60, 70, 50, 80, 65],
|
|
1604
|
+
// Example data for male
|
|
1605
|
+
backgroundColor: "#93B8E2",
|
|
1606
|
+
barThickness: 10
|
|
1607
|
+
},
|
|
1608
|
+
{
|
|
1609
|
+
label: "Conversion Rate",
|
|
1610
|
+
data: [70, 65, 75, 55, 85],
|
|
1611
|
+
// Example data for female
|
|
1612
|
+
backgroundColor: "#4484CD",
|
|
1613
|
+
barThickness: 10
|
|
1614
|
+
}
|
|
1615
|
+
]
|
|
1616
|
+
},
|
|
1617
|
+
options: {
|
|
1618
|
+
scales: {
|
|
1619
|
+
x: {
|
|
1620
|
+
grid: {
|
|
1621
|
+
display: false
|
|
1622
|
+
// Display x-axis grid lines
|
|
1623
|
+
}
|
|
1624
|
+
},
|
|
1625
|
+
y: {
|
|
1626
|
+
beginAtZero: true,
|
|
1627
|
+
suggestedMax: 100,
|
|
1628
|
+
ticks: {
|
|
1629
|
+
callback: function(value) {
|
|
1630
|
+
return value + "%";
|
|
1631
|
+
}
|
|
1632
|
+
},
|
|
1633
|
+
grid: {
|
|
1634
|
+
display: true
|
|
1635
|
+
}
|
|
1636
|
+
}
|
|
1637
|
+
},
|
|
1638
|
+
plugins: {
|
|
1639
|
+
legend: {
|
|
1640
|
+
labels: {
|
|
1641
|
+
usePointStyle: true
|
|
1642
|
+
}
|
|
1643
|
+
}
|
|
1644
|
+
}
|
|
1645
|
+
}
|
|
1646
|
+
});
|
|
1647
|
+
}
|
|
1648
|
+
return () => {
|
|
1649
|
+
if (chartInstance.current) {
|
|
1650
|
+
chartInstance.current.destroy();
|
|
1651
|
+
}
|
|
1652
|
+
};
|
|
1653
|
+
}, []);
|
|
1654
|
+
return /* @__PURE__ */ import_react36.default.createElement("div", { className: props.className }, /* @__PURE__ */ import_react36.default.createElement("h1", { className: props.labelClassName }, props.label), /* @__PURE__ */ import_react36.default.createElement("canvas", { ref: chartRef }));
|
|
1655
|
+
};
|
|
1656
|
+
|
|
1657
|
+
// src/Components/BarChart.tsx
|
|
1658
|
+
var import_react37 = __toESM(require("react"));
|
|
1659
|
+
var import_react_chartjs_24 = require("react-chartjs-2");
|
|
1660
|
+
var import_chart4 = require("chart.js");
|
|
1661
|
+
import_chart4.Chart.register(import_chart4.BarElement, import_chart4.CategoryScale, import_chart4.LinearScale, import_chart4.Tooltip);
|
|
1662
|
+
var BarChart = (props) => {
|
|
1663
|
+
const data = {
|
|
1664
|
+
labels: [
|
|
1665
|
+
"17 June",
|
|
1666
|
+
"18 June",
|
|
1667
|
+
"19 June",
|
|
1668
|
+
"20 June",
|
|
1669
|
+
"21 June",
|
|
1670
|
+
"22 June",
|
|
1671
|
+
"23 June"
|
|
1672
|
+
],
|
|
1673
|
+
datasets: [
|
|
1674
|
+
{
|
|
1675
|
+
data: [30, 100, 270, 140, 120, 240],
|
|
1676
|
+
backgroundColor: "#1565C0",
|
|
1677
|
+
barThickness: 15
|
|
1678
|
+
}
|
|
1679
|
+
]
|
|
1680
|
+
};
|
|
1681
|
+
const options = {
|
|
1682
|
+
responsive: true,
|
|
1683
|
+
scales: {
|
|
1684
|
+
x: {
|
|
1685
|
+
beginAtZero: true,
|
|
1686
|
+
grid: {
|
|
1687
|
+
display: false
|
|
1688
|
+
}
|
|
1689
|
+
},
|
|
1690
|
+
y: {
|
|
1691
|
+
grid: {
|
|
1692
|
+
display: true
|
|
1693
|
+
},
|
|
1694
|
+
ticks: {
|
|
1695
|
+
min: 0,
|
|
1696
|
+
max: 400,
|
|
1697
|
+
stepSize: 200,
|
|
1698
|
+
callback: function(value) {
|
|
1699
|
+
return `${value}`;
|
|
1700
|
+
}
|
|
1701
|
+
}
|
|
1702
|
+
}
|
|
1703
|
+
},
|
|
1704
|
+
plugins: {
|
|
1705
|
+
tooltip: {
|
|
1706
|
+
enabled: true,
|
|
1707
|
+
callbacks: {
|
|
1708
|
+
label: function(context) {
|
|
1709
|
+
const label = context.label || "";
|
|
1710
|
+
const value = context.raw || 0;
|
|
1711
|
+
return ` ${label}: ${value}`;
|
|
1712
|
+
}
|
|
1713
|
+
}
|
|
1714
|
+
},
|
|
1715
|
+
legend: {
|
|
1716
|
+
display: false
|
|
1717
|
+
}
|
|
1718
|
+
}
|
|
1719
|
+
};
|
|
1720
|
+
return /* @__PURE__ */ import_react37.default.createElement("div", { className: props.className }, /* @__PURE__ */ import_react37.default.createElement("h1", { className: props.labelClassName }, props.label), /* @__PURE__ */ import_react37.default.createElement(import_react_chartjs_24.Bar, { data, options }));
|
|
1721
|
+
};
|
|
922
1722
|
// Annotate the CommonJS export names for ESM import in node:
|
|
923
1723
|
0 && (module.exports = {
|
|
924
1724
|
AddMoreTable,
|
|
1725
|
+
BarChart,
|
|
925
1726
|
ButtonElement,
|
|
926
1727
|
CheckboxElement,
|
|
1728
|
+
CircleDonut,
|
|
927
1729
|
CkEditor,
|
|
928
1730
|
DatePickerElement,
|
|
929
1731
|
DateRangePickerElement,
|
|
1732
|
+
DoubleBarChart,
|
|
930
1733
|
DropDownGroup,
|
|
931
1734
|
FileUpload,
|
|
1735
|
+
HorizontalBarChart,
|
|
932
1736
|
Image,
|
|
1737
|
+
LineChart,
|
|
933
1738
|
MultipleSelectElement,
|
|
934
1739
|
Navbar,
|
|
935
1740
|
NumberElement,
|
|
1741
|
+
OtpElement,
|
|
936
1742
|
PasswordElement,
|
|
937
1743
|
RadioElement,
|
|
938
1744
|
SelectElement,
|
|
1745
|
+
SemiCircleDonut,
|
|
939
1746
|
Sidebar,
|
|
940
1747
|
SingleCheckbox,
|
|
941
1748
|
SingleSelectElement,
|
|
@@ -943,5 +1750,6 @@ var SwitchElement = () => /* @__PURE__ */ import_react28.default.createElement(i
|
|
|
943
1750
|
TableElement,
|
|
944
1751
|
TabsElement,
|
|
945
1752
|
TextElement,
|
|
946
|
-
TextareaElement
|
|
1753
|
+
TextareaElement,
|
|
1754
|
+
Upload
|
|
947
1755
|
});
|