@apexcura/ui-components 0.0.15-Beta7 → 0.0.15-Beta70

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.mjs CHANGED
@@ -18,6 +18,7 @@ var TextElement = (props) => {
18
18
  type: props.type,
19
19
  status: props.status,
20
20
  className: props.className,
21
+ disabled: props.disabled,
21
22
  onChange: (e) => {
22
23
  handleChange(e);
23
24
  }
@@ -51,7 +52,7 @@ var PasswordElement = (props) => {
51
52
  },
52
53
  iconRender: renderVisibilityIcon,
53
54
  visibilityToggle: {
54
- visible: passwordVisible,
55
+ visible: passwordVisible && passwordVisible,
55
56
  onVisibleChange: handleVisibilityToggle
56
57
  }
57
58
  }
@@ -99,20 +100,20 @@ var TextareaElement = (props) => {
99
100
  props.onChange(e.target.value);
100
101
  }
101
102
  };
103
+ const defaultMinRows = 2;
104
+ const defaultMaxRows = 6;
102
105
  return /* @__PURE__ */ React4.createElement("div", { className: props.containerClassName }, props.label && /* @__PURE__ */ React4.createElement("label", { htmlFor: props.name, className: props.labelClassName }, props.label), /* @__PURE__ */ React4.createElement(
103
106
  TextArea,
104
107
  {
105
108
  placeholder: props.placeholder,
106
109
  allowClear: true,
107
- defaultValue: props.defaultValue,
108
110
  disabled: props.disabled,
109
111
  id: props.name,
110
- status: props.status,
112
+ autoSize: { minRows: props.minRows ? props.minRows : defaultMinRows, maxRows: props.maxRows ? props.maxRows : defaultMaxRows },
111
113
  className: props.className,
112
- variant: props.variant,
113
114
  name: props.name,
115
+ value: props.value,
114
116
  showCount: true,
115
- maxLength: props.maxLength,
116
117
  onChange: (e) => {
117
118
  handleChange(e);
118
119
  }
@@ -123,13 +124,14 @@ var TextareaElement = (props) => {
123
124
  // src/Components/SelectElement.tsx
124
125
  import React5 from "react";
125
126
  import { Select } from "antd";
127
+ var filterOptions = (input, option) => {
128
+ return (option?.label ?? "").toLowerCase().includes(input.toLowerCase());
129
+ };
126
130
  var SelectElement = (props) => {
127
131
  const handleChange = (value) => {
128
- console.log("++=====", typeof value);
129
132
  if (props.onChange) {
130
133
  if (typeof value === "string") {
131
134
  const filterOption2 = props.options && props.options.find((eachOption) => eachOption.value === value);
132
- console.log(filterOption2);
133
135
  props.onChange(filterOption2);
134
136
  } else {
135
137
  const selectedOptions = value ? value.map((eachVal) => {
@@ -142,18 +144,15 @@ var SelectElement = (props) => {
142
144
  return /* @__PURE__ */ React5.createElement("div", { className: props.containerClassName }, props.label && /* @__PURE__ */ React5.createElement("label", { htmlFor: props.name, className: props.labelClassName }, props.label), /* @__PURE__ */ React5.createElement(
143
145
  Select,
144
146
  {
145
- mode: props.mode,
146
147
  options: props.options,
147
148
  placeholder: props.placeholder,
148
149
  allowClear: true,
149
- defaultValue: props.defaultValue,
150
- disabled: props.disabled,
151
- id: props.name,
152
- status: props.status,
153
- style: props.styles,
150
+ filterOption: filterOptions,
151
+ showSearch: true,
154
152
  className: props.className,
155
- variant: props.variant,
156
- onChange: handleChange
153
+ onChange: handleChange,
154
+ mode: props.mode,
155
+ value: props.value && props.value
157
156
  }
158
157
  ));
159
158
  };
@@ -168,7 +167,6 @@ var RadioElement = (props) => {
168
167
  const [selectedValue, setSelectedValue] = useState2(props.value);
169
168
  const optionType = props.optionType === "button" ? "button" : void 0;
170
169
  const handleChange = (option) => {
171
- console.log(option);
172
170
  setSelectedValue(option);
173
171
  setIsDisabled(true);
174
172
  if (props.onChange) {
@@ -211,19 +209,23 @@ var CheckboxGroup = Checkbox.Group;
211
209
  var defaultCheckedList = [];
212
210
  var CheckboxElement = (props) => {
213
211
  const [checkedList, setCheckedList] = useState3(defaultCheckedList);
214
- const checkAll = props.options && props.options.length === checkedList.length;
212
+ const options = props.options || [];
213
+ const checkAll = options.length > 0 && options.length === checkedList.length;
215
214
  const handleChange = (list) => {
216
215
  setCheckedList(list);
217
216
  if (props.onChange) {
218
- const selectedOptions = props.options && props.options.filter((option) => list.includes(option.value));
217
+ const selectedOptions = options.filter(
218
+ (option) => list.includes(option.value)
219
+ );
219
220
  props.onChange(selectedOptions);
220
221
  }
221
222
  };
222
223
  const onHandleAllChanges = (e) => {
223
- const newList = e.target.checked ? props.options : [];
224
+ const newList = e.target.checked ? options.map((option) => option.value) : [];
224
225
  setCheckedList(newList);
225
226
  if (props.onChange) {
226
- props.onChange(newList);
227
+ const selectedOptions = e.target.checked ? options : [];
228
+ props.onChange(selectedOptions);
227
229
  }
228
230
  };
229
231
  return /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement(
@@ -243,7 +245,7 @@ var CheckboxElement = (props) => {
243
245
  disabled: props.disabled,
244
246
  style: props.styles,
245
247
  className: props.className,
246
- options: props.options,
248
+ options,
247
249
  value: checkedList,
248
250
  onChange: handleChange
249
251
  }
@@ -251,16 +253,61 @@ var CheckboxElement = (props) => {
251
253
  };
252
254
 
253
255
  // src/Components/CkEditor.tsx
256
+ import { useRef } from "react";
257
+ import { Editor } from "@tinymce/tinymce-react";
254
258
  import React8 from "react";
255
259
  var CkEditor = (props) => {
256
- return /* @__PURE__ */ React8.createElement("div", null);
260
+ const editorRef = useRef(null);
261
+ const log = () => {
262
+ if (editorRef.current) {
263
+ let content = editorRef.current.getContent();
264
+ if (props.onChange) {
265
+ props.onChange(content);
266
+ }
267
+ }
268
+ };
269
+ return /* @__PURE__ */ React8.createElement("div", null, /* @__PURE__ */ React8.createElement(
270
+ Editor,
271
+ {
272
+ apiKey: "rwpgt7maa54n0pe5mglhkl686p7h57sg6z636n6gf2mio1b9",
273
+ onInit: (_evt, editor) => {
274
+ if (editor) editorRef.current = editor;
275
+ },
276
+ initialValue: "<p>This is the initial content of the editor.</p>",
277
+ init: {
278
+ height: 500,
279
+ menubar: false,
280
+ plugins: [
281
+ "advlist",
282
+ "autolink",
283
+ "lists",
284
+ "link",
285
+ "image",
286
+ "charmap",
287
+ "preview",
288
+ "anchor",
289
+ "searchreplace",
290
+ "visualblocks",
291
+ "code",
292
+ "fullscreen",
293
+ "insertdatetime",
294
+ "media",
295
+ "table",
296
+ "code",
297
+ "help",
298
+ "wordcount"
299
+ ],
300
+ toolbar: "undo redo | blocks | bold italic forecolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | removeformat | help",
301
+ content_style: "body { font-family:Helvetica,Arial,sans-serif; font-size:14px }"
302
+ }
303
+ }
304
+ ), /* @__PURE__ */ React8.createElement("button", { onClick: log }, "Log editor content"));
257
305
  };
258
306
 
259
307
  // src/Components/Select/SingleSelectElement.tsx
260
308
  import React9 from "react";
261
309
  import { Select as Select2 } from "antd";
262
310
  var onSearch = (value) => {
263
- console.log("search:", value);
264
311
  };
265
312
  var filterOption = (input, option) => (option?.label ?? "").toLowerCase().includes(input.toLowerCase());
266
313
  var SingleSelectElement = (props) => {
@@ -316,87 +363,166 @@ var MultipleSelectElement = (props) => {
316
363
  };
317
364
 
318
365
  // src/Components/Button.tsx
319
- import React11, { useEffect, useState as useState4 } from "react";
320
- var ButtonElement = (props) => {
321
- const [svgContent, setSvgContent] = useState4(null);
322
- const [originalSvgContent, setOriginalSvgContent] = useState4(null);
323
- const [hoverColor, setHoverColor] = useState4(null);
324
- useEffect(() => {
325
- if (props.icon) {
326
- fetch(props.icon).then((response) => response.text()).then((data) => {
327
- const tempDiv = document.createElement("div");
328
- tempDiv.innerHTML = data;
329
- const svgElement = tempDiv.querySelector("svg");
330
- if (svgElement) {
331
- const textColorClass = props.className?.match(/text-[\w-]+/g)?.[0];
332
- const hoverColorClass = props.className?.match(/hover:text-[\w-]+/g)?.[0];
333
- if (textColorClass) {
334
- const tempSpan = document.createElement("span");
335
- tempSpan.className = textColorClass;
336
- document.body.appendChild(tempSpan);
337
- const computedColor = getComputedStyle(tempSpan).color;
338
- document.body.removeChild(tempSpan);
339
- const paths = svgElement.querySelectorAll("path");
340
- paths.forEach((path) => path.setAttribute("fill", computedColor));
341
- }
342
- if (hoverColorClass) {
343
- const tempSpan = document.createElement("span");
344
- tempSpan.className = hoverColorClass.replace("hover:", "");
345
- document.body.appendChild(tempSpan);
346
- const computedHoverColor = getComputedStyle(tempSpan).color;
347
- document.body.removeChild(tempSpan);
348
- setHoverColor(computedHoverColor);
349
- }
350
- svgElement.setAttribute(
351
- "class",
352
- `${props.className ? props.className : ""}`
353
- );
354
- setSvgContent(tempDiv.innerHTML);
355
- setOriginalSvgContent(tempDiv.innerHTML);
356
- }
357
- }).catch((error) => console.error("Error fetching SVG:", error));
358
- }
359
- }, [props.icon, props.className]);
360
- const handleMouseEnter = () => {
361
- if (hoverColor && originalSvgContent) {
362
- const tempDiv = document.createElement("div");
363
- tempDiv.innerHTML = originalSvgContent;
364
- const svgElement = tempDiv.querySelector("svg");
365
- const paths = svgElement?.querySelectorAll("path");
366
- paths?.forEach((path) => path.setAttribute("fill", hoverColor));
367
- setSvgContent(tempDiv.innerHTML);
366
+ import React12 from "react";
367
+
368
+ // src/constants/icons.tsx
369
+ import React11 from "react";
370
+ var icons = {
371
+ download: /* @__PURE__ */ React11.createElement("svg", { viewBox: "0 0 25 25", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React11.createElement(
372
+ "path",
373
+ {
374
+ 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",
375
+ fill: "#505050"
368
376
  }
369
- };
370
- const handleMouseLeave = () => {
371
- if (originalSvgContent) {
372
- setSvgContent(originalSvgContent);
377
+ )),
378
+ save: /* @__PURE__ */ React11.createElement("svg", { viewBox: "0 0 27 27", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React11.createElement(
379
+ "path",
380
+ {
381
+ 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",
382
+ fill: "#A3A3A3"
373
383
  }
374
- };
375
- return /* @__PURE__ */ React11.createElement(
384
+ )),
385
+ filter: /* @__PURE__ */ React11.createElement("svg", { viewBox: "0 0 25 25", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React11.createElement(
386
+ "path",
387
+ {
388
+ 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",
389
+ fill: "#505050"
390
+ }
391
+ )),
392
+ logout: /* @__PURE__ */ React11.createElement("svg", { viewBox: "0 0 25 25", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React11.createElement(
393
+ "path",
394
+ {
395
+ 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",
396
+ fill: "#505050"
397
+ }
398
+ ), /* @__PURE__ */ React11.createElement(
399
+ "path",
400
+ {
401
+ 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",
402
+ fill: "#505050"
403
+ }
404
+ )),
405
+ patient: /* @__PURE__ */ React11.createElement("svg", { viewBox: "0 0 24 25", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React11.createElement(
406
+ "path",
407
+ {
408
+ 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",
409
+ fill: "#505050"
410
+ }
411
+ )),
412
+ refresh: /* @__PURE__ */ React11.createElement("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React11.createElement(
413
+ "path",
414
+ {
415
+ 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",
416
+ fill: "#595959"
417
+ }
418
+ )),
419
+ scheduler: /* @__PURE__ */ React11.createElement("svg", { viewBox: "0 0 24 25", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React11.createElement(
420
+ "path",
421
+ {
422
+ 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",
423
+ fill: "#505050"
424
+ }
425
+ )),
426
+ add: /* @__PURE__ */ React11.createElement("svg", { viewBox: "0 0 26 27", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React11.createElement(
427
+ "path",
428
+ {
429
+ d: "M21.4869 14.7981H13.9193V22.3657H11.3967V14.7981H3.8291V12.2755H11.3967V4.70789H13.9193V12.2755H21.4869V14.7981Z",
430
+ fill: "white"
431
+ }
432
+ )),
433
+ bot: /* @__PURE__ */ React11.createElement("svg", { viewBox: "0 0 24 25", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React11.createElement(
434
+ "path",
435
+ {
436
+ 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",
437
+ fill: "#505050"
438
+ }
439
+ )),
440
+ campaign: /* @__PURE__ */ React11.createElement("svg", { viewBox: "0 0 24 25", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React11.createElement(
441
+ "path",
442
+ {
443
+ 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",
444
+ fill: "#505050"
445
+ }
446
+ )),
447
+ "chatbot-white-border": /* @__PURE__ */ React11.createElement("svg", { viewBox: "0 0 33 34", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React11.createElement(
448
+ "path",
449
+ {
450
+ 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",
451
+ fill: "#472D7A",
452
+ stroke: "white",
453
+ "stroke-width": "0.850077"
454
+ }
455
+ ), /* @__PURE__ */ React11.createElement(
456
+ "path",
457
+ {
458
+ 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",
459
+ fill: "white"
460
+ }
461
+ ), /* @__PURE__ */ React11.createElement(
462
+ "path",
463
+ {
464
+ 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",
465
+ fill: "white"
466
+ }
467
+ ), /* @__PURE__ */ React11.createElement(
468
+ "path",
469
+ {
470
+ 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",
471
+ fill: "white"
472
+ }
473
+ )),
474
+ dashboard: /* @__PURE__ */ React11.createElement("svg", { viewBox: "0 0 25 25", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React11.createElement(
475
+ "path",
476
+ {
477
+ 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",
478
+ fill: "#505050"
479
+ }
480
+ )),
481
+ discard: /* @__PURE__ */ React11.createElement("svg", { viewBox: "0 0 26 27", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React11.createElement(
482
+ "path",
483
+ {
484
+ 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",
485
+ fill: "#A3A3A3"
486
+ }
487
+ )),
488
+ "discard-red": /* @__PURE__ */ React11.createElement("svg", { viewBox: "0 0 26 26", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React11.createElement(
489
+ "path",
490
+ {
491
+ 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",
492
+ fill: "#D9363E"
493
+ }
494
+ ))
495
+ };
496
+
497
+ // src/Components/Button.tsx
498
+ var ButtonElement = (props) => {
499
+ const textColorClass = props.className?.match(/text-[\w-]+/g)?.[0] === "text-white";
500
+ return /* @__PURE__ */ React12.createElement(
376
501
  "button",
377
502
  {
378
503
  onClick: props.onClick,
379
- className: `${props.className ? props.className : ""}`,
380
- onMouseEnter: handleMouseEnter,
381
- onMouseLeave: handleMouseLeave,
382
- disabled: props.isLoading
383
- },
384
- props.isLoading ? /* @__PURE__ */ React11.createElement(React11.Fragment, null, /* @__PURE__ */ React11.createElement("svg", { className: "animate-spin h-5 w-5 mr-3", viewBox: "0 0 24 24" }), props.label) : /* @__PURE__ */ React11.createElement(React11.Fragment, null, props.isSVGStylesOverride === false ? props.icon && /* @__PURE__ */ React11.createElement("img", { className: props.iconsClassName, src: props.icon, alt: props.label }) : svgContent && /* @__PURE__ */ React11.createElement(
385
- "span",
386
- {
387
- dangerouslySetInnerHTML: { __html: svgContent }
504
+ className: props.className ? props.className : "",
505
+ disabled: props.loading,
506
+ style: {
507
+ cursor: props.loading ? "no-drop" : "pointer"
388
508
  }
389
- ), props.label)
509
+ },
510
+ props.icon ? /* @__PURE__ */ React12.createElement("span", { className: props.iconsClassName }, props.isSVGStylesOverride === false ? /* @__PURE__ */ React12.createElement("img", { src: props.icon, className: props.iconsClassName }) : icons[props.icon], /* @__PURE__ */ React12.createElement("style", null, textColorClass && `.${props.className?.match(/text-[\w-]+/g)?.[0]} path {
511
+ filter: brightness(0) invert(1);
512
+ }`, `.${props.className?.match(/text-[\w-]+/g)?.[0]}:hover path {
513
+ filter: brightness(0) invert(1);
514
+ }`)) : "",
515
+ props.label
390
516
  );
391
517
  };
392
518
 
393
519
  // src/Components/AddMoreTable.tsx
394
- import React12, { useEffect as useEffect2, useState as useState5 } from "react";
520
+ import React13, { useEffect, useState as useState4 } from "react";
395
521
  import { Table, Button } from "antd";
396
522
  import { PlusOutlined, DeleteOutlined } from "@ant-design/icons";
397
523
  var AddMoreTable = (props) => {
398
524
  const { thead, tbody } = props;
399
- const [rows, setRows] = useState5(tbody || []);
525
+ const [rows, setRows] = useState4(tbody || []);
400
526
  const onHandleRows = () => {
401
527
  const newId = rows.length > 0 ? rows[rows.length - 1].id + 1 : 1;
402
528
  let newRow = {
@@ -461,16 +587,15 @@ var AddMoreTable = (props) => {
461
587
  });
462
588
  });
463
589
  };
464
- useEffect2(() => {
465
- console.log(rows);
590
+ useEffect(() => {
466
591
  }, [rows]);
467
592
  const renderInputElement = (element, value) => {
468
593
  if (!element) return null;
469
594
  const { element: type, label } = element;
470
595
  if (type === "single-select") {
471
- return /* @__PURE__ */ React12.createElement(SingleSelectElement, { onChange: (value2) => console.log(label, value2), optionType: "", className: void 0, selectedStyle: false, style: false, options1: [], options2: [], firstOptions: [], secondOptions: [] });
596
+ return /* @__PURE__ */ React13.createElement(SingleSelectElement, { onChange: (value2) => console.log(label, value2), optionType: "", className: void 0, selectedStyle: false, style: false, options1: [], options2: [], firstOptions: [], secondOptions: [] });
472
597
  } else if (type === "textarea") {
473
- return /* @__PURE__ */ React12.createElement(TextareaElement, { onChange: (value2) => console.log(label, value2), optionType: "", className: void 0, selectedStyle: false, style: false, options1: [], options2: [], firstOptions: [], secondOptions: [] });
598
+ return /* @__PURE__ */ React13.createElement(TextareaElement, { onChange: (value2) => console.log(label, value2), optionType: "", className: void 0, selectedStyle: false, style: false, options1: [], options2: [], firstOptions: [], secondOptions: [] });
474
599
  } else {
475
600
  return null;
476
601
  }
@@ -487,13 +612,13 @@ var AddMoreTable = (props) => {
487
612
  eachRow.variable_data.forEach((variable, subIndex) => {
488
613
  Object.keys(variable).forEach((key) => {
489
614
  if (key === "SubRows") {
490
- rowData[`${key}`] = /* @__PURE__ */ React12.createElement("div", { key: subIndex }, eachRow.variable_data.length > 1 && /* @__PURE__ */ React12.createElement(Button, { onClick: () => onHandleSubRowsDelete(rowIndex, subIndex) }, /* @__PURE__ */ React12.createElement(DeleteOutlined, null)), subIndex === eachRow.variable_data.length - 1 && /* @__PURE__ */ React12.createElement(Button, { onClick: () => onHandleSubRowsAdd(rowIndex) }, /* @__PURE__ */ React12.createElement(PlusOutlined, null)));
615
+ rowData[`${key}`] = /* @__PURE__ */ React13.createElement("div", { key: subIndex }, eachRow.variable_data.length > 1 && /* @__PURE__ */ React13.createElement(Button, { onClick: () => onHandleSubRowsDelete(rowIndex, subIndex) }, /* @__PURE__ */ React13.createElement(DeleteOutlined, null)), subIndex === eachRow.variable_data.length - 1 && /* @__PURE__ */ React13.createElement(Button, { onClick: () => onHandleSubRowsAdd(rowIndex) }, /* @__PURE__ */ React13.createElement(PlusOutlined, null)));
491
616
  } else {
492
617
  rowData[`${key}`] = renderInputElement(variable[key]);
493
618
  }
494
619
  });
495
620
  });
496
- rowData.actions = /* @__PURE__ */ React12.createElement("div", null, /* @__PURE__ */ React12.createElement(Button, { onClick: () => onHandleDelete(eachRow.id) }, /* @__PURE__ */ React12.createElement(DeleteOutlined, null)), rowIndex === rows.length - 1 && /* @__PURE__ */ React12.createElement(Button, { onClick: onHandleRows }, /* @__PURE__ */ React12.createElement(PlusOutlined, null)));
621
+ rowData.actions = /* @__PURE__ */ React13.createElement("div", null, /* @__PURE__ */ React13.createElement(Button, { onClick: () => onHandleDelete(eachRow.id) }, /* @__PURE__ */ React13.createElement(DeleteOutlined, null)), rowIndex === rows.length - 1 && /* @__PURE__ */ React13.createElement(Button, { onClick: onHandleRows }, /* @__PURE__ */ React13.createElement(PlusOutlined, null)));
497
622
  console.log("=====rowdata", rowData);
498
623
  return rowData;
499
624
  });
@@ -509,7 +634,7 @@ var AddMoreTable = (props) => {
509
634
  key: "actions"
510
635
  });
511
636
  }
512
- return /* @__PURE__ */ React12.createElement(
637
+ return /* @__PURE__ */ React13.createElement(
513
638
  Table,
514
639
  {
515
640
  columns,
@@ -521,19 +646,19 @@ var AddMoreTable = (props) => {
521
646
  };
522
647
 
523
648
  // src/Components/Sidebar.tsx
524
- import React13 from "react";
649
+ import React14 from "react";
525
650
  var Sidebar = (props) => {
526
651
  const handleChange = (item) => {
527
652
  if (props.onChange) {
528
653
  props.onChange(item);
529
654
  }
530
655
  };
531
- return /* @__PURE__ */ React13.createElement(React13.Fragment, { key: props.name }, /* @__PURE__ */ React13.createElement("div", { className: props.imgClassName }, /* @__PURE__ */ React13.createElement("img", { src: props.img, alt: "logo" })), /* @__PURE__ */ React13.createElement("div", { className: props.listClassName }, props.items?.map((item) => {
532
- return /* @__PURE__ */ React13.createElement(React13.Fragment, { key: item.label }, /* @__PURE__ */ React13.createElement(
656
+ return /* @__PURE__ */ React14.createElement(React14.Fragment, { key: props.name }, /* @__PURE__ */ React14.createElement("div", { className: props.imgClassName }, /* @__PURE__ */ React14.createElement("img", { src: props.img, alt: "logo" })), /* @__PURE__ */ React14.createElement("div", { className: props.listClassName }, props.items?.map((item) => {
657
+ return /* @__PURE__ */ React14.createElement(React14.Fragment, { key: item.label }, /* @__PURE__ */ React14.createElement(
533
658
  ButtonElement,
534
659
  {
535
660
  ...item,
536
- className: `${props.className} ${item.active ? props.activeClassName : ""}`,
661
+ className: item.active ? props.activeClassName : props.className,
537
662
  iconsClassName: props.iconsClassName,
538
663
  onClick: (e) => {
539
664
  e.preventDefault();
@@ -545,29 +670,29 @@ var Sidebar = (props) => {
545
670
  };
546
671
 
547
672
  // src/Components/Navbar.tsx
548
- import React17 from "react";
673
+ import React18 from "react";
549
674
 
550
675
  // src/Components/Notification.tsx
551
- import React14 from "react";
676
+ import React15 from "react";
552
677
  import { Popover, Badge, Button as Button2, Avatar, List } from "antd";
553
678
  import { IoIosNotifications } from "react-icons/io";
554
679
  var popoverContentStyle = {
555
680
  minWidth: "300px",
556
681
  maxWidth: "100%"
557
682
  };
558
- var Notification = (props) => /* @__PURE__ */ React14.createElement(
683
+ var Notification = (props) => /* @__PURE__ */ React15.createElement(
559
684
  Popover,
560
685
  {
561
686
  className: props.className,
562
- content: /* @__PURE__ */ React14.createElement("div", { style: popoverContentStyle }, " ", /* @__PURE__ */ React14.createElement(
687
+ content: /* @__PURE__ */ React15.createElement("div", { style: popoverContentStyle }, " ", /* @__PURE__ */ React15.createElement(
563
688
  List,
564
689
  {
565
690
  itemLayout: "horizontal",
566
691
  dataSource: props.items,
567
- renderItem: (item, index) => /* @__PURE__ */ React14.createElement(List.Item, { key: item.text }, /* @__PURE__ */ React14.createElement(
692
+ renderItem: (item, index) => /* @__PURE__ */ React15.createElement(List.Item, { key: item.text }, /* @__PURE__ */ React15.createElement(
568
693
  List.Item.Meta,
569
694
  {
570
- avatar: /* @__PURE__ */ React14.createElement(Avatar, { src: `https://api.dicebear.com/7.x/miniavs/svg?seed=${index}` }),
695
+ avatar: /* @__PURE__ */ React15.createElement(Avatar, { src: `https://api.dicebear.com/7.x/miniavs/svg?seed=${index}` }),
571
696
  title: item.text,
572
697
  description: item.time
573
698
  }
@@ -577,110 +702,60 @@ var Notification = (props) => /* @__PURE__ */ React14.createElement(
577
702
  trigger: "focus",
578
703
  placement: "bottomRight"
579
704
  },
580
- /* @__PURE__ */ React14.createElement(Button2, { className: props.buttonClassName }, /* @__PURE__ */ React14.createElement(Badge, { size: "small", count: props.count }, /* @__PURE__ */ React14.createElement("span", { className: props.iconsClassName }, /* @__PURE__ */ React14.createElement(IoIosNotifications, null))))
705
+ /* @__PURE__ */ React15.createElement(Button2, { className: props.buttonClassName }, /* @__PURE__ */ React15.createElement(Badge, { size: "small", count: props.count }, /* @__PURE__ */ React15.createElement("span", { className: props.iconsClassName }, /* @__PURE__ */ React15.createElement(IoIosNotifications, null))))
581
706
  );
582
707
 
583
708
  // src/Components/SpanElement.tsx
584
- import React15 from "react";
585
- var SpanElement = (props) => /* @__PURE__ */ React15.createElement("span", { className: props.className }, props.label);
709
+ import React16 from "react";
710
+ var SpanElement = (props) => /* @__PURE__ */ React16.createElement("span", { className: props.className }, props.label);
586
711
 
587
712
  // src/Components/Profile.tsx
588
- import React16 from "react";
713
+ import React17 from "react";
589
714
  import { Avatar as Avatar2 } from "antd";
590
715
  import { UserOutlined } from "@ant-design/icons";
591
- var Profile = (props) => /* @__PURE__ */ React16.createElement("div", { className: props.className }, /* @__PURE__ */ React16.createElement(Avatar2, { style: { backgroundColor: "#87d068", marginRight: "10px" }, icon: /* @__PURE__ */ React16.createElement(UserOutlined, null) }), /* @__PURE__ */ React16.createElement("div", { className: props.profileSubClassName }, /* @__PURE__ */ React16.createElement("p", null, props.primaryText), /* @__PURE__ */ React16.createElement("p", { className: props.secondTextClassName }, " ", props.secondaryText)));
716
+ var Profile = (props) => /* @__PURE__ */ React17.createElement("div", { className: props.className }, /* @__PURE__ */ React17.createElement(Avatar2, { style: { backgroundColor: "#87d068", marginRight: "10px" }, icon: /* @__PURE__ */ React17.createElement(UserOutlined, null) }), /* @__PURE__ */ React17.createElement("div", { className: props.profileSubClassName }, /* @__PURE__ */ React17.createElement("p", null, props.primaryText), /* @__PURE__ */ React17.createElement("p", { className: props.secondTextClassName }, " ", props.secondaryText)));
592
717
 
593
718
  // src/Components/Navbar.tsx
594
719
  var Navbar = (props) => {
595
- return /* @__PURE__ */ React17.createElement("div", { className: `${props.className}`, key: props.name }, props.items && props.items.map((item) => {
720
+ return /* @__PURE__ */ React18.createElement("div", { className: `${props.className}` }, props.items && props.items.map((item) => {
596
721
  if (item.element === "span") {
597
- return /* @__PURE__ */ React17.createElement(SpanElement, { ...item });
722
+ return /* @__PURE__ */ React18.createElement(SpanElement, { key: item.name, ...item });
598
723
  } else if (item.element === "notifications") {
599
- return /* @__PURE__ */ React17.createElement(Notification, { ...item });
724
+ return /* @__PURE__ */ React18.createElement(Notification, { key: item.name, ...item });
600
725
  } else if (item.name === "profile") {
601
- return /* @__PURE__ */ React17.createElement(Profile, { ...item });
726
+ return /* @__PURE__ */ React18.createElement(Profile, { key: item.name, ...item });
602
727
  }
603
728
  return null;
604
729
  }));
605
730
  };
606
731
 
607
732
  // src/Components/TableElement.tsx
608
- import React20, { useState as useState6 } from "react";
733
+ import React19, { useState as useState5, useEffect as useEffect2 } from "react";
609
734
  import { Table as Table2 } from "antd";
610
-
611
- // src/Components/Model.tsx
612
- import React19 from "react";
613
- import { Modal } from "antd";
614
-
615
- // src/Components/ModelBody.tsx
616
- import React18 from "react";
617
- var ModelBody = (props) => {
618
- return /* @__PURE__ */ React18.createElement("div", { className: props.modalContent && props.modalContent.className }, props.modalContent && props.modalContent.fields.map((eachField) => {
619
- if (eachField.element === "div") {
620
- return /* @__PURE__ */ React18.createElement("div", { className: eachField.className }, eachField.label);
621
- } else if (eachField.element === "input-radio") {
622
- return /* @__PURE__ */ React18.createElement("div", { className: eachField.className }, /* @__PURE__ */ React18.createElement(RadioElement, { ...eachField }));
623
- } else if (eachField.element === "button") {
624
- return /* @__PURE__ */ React18.createElement("div", { className: eachField.className }, /* @__PURE__ */ React18.createElement(ButtonElement, { ...eachField }));
625
- } else {
626
- return null;
627
- }
628
- }));
629
- };
630
-
631
- // src/Components/Model.tsx
632
- var ModelElement = (props) => {
633
- const { model, onCancel, selectedRecord, columns } = props;
634
- return /* @__PURE__ */ React19.createElement(
635
- Modal,
636
- {
637
- centered: true,
638
- open: model,
639
- onCancel,
640
- footer: null,
641
- width: 850,
642
- title: /* @__PURE__ */ React19.createElement(
643
- "div",
644
- {
645
- style: {
646
- display: "flex",
647
- flexWrap: "wrap",
648
- padding: "20px",
649
- width: "full",
650
- margin: "-10px"
651
- }
652
- },
653
- Object.entries(selectedRecord).map(([key, value]) => {
654
- const record = columns.filter((eachColumn) => eachColumn.key === key);
655
- return record.length > 0 ? /* @__PURE__ */ React19.createElement("p", { style: { fontWeight: "500", padding: "10px" }, key }, /* @__PURE__ */ React19.createElement("span", { style: { fontWeight: "200", color: "gray", paddingRight: "10px" } }, record[0].title), String(value)) : "";
656
- })
657
- )
658
- },
659
- /* @__PURE__ */ React19.createElement(ModelBody, { ...props })
660
- );
661
- };
662
-
663
- // src/Components/TableElement.tsx
664
735
  var TableElement = (props) => {
665
736
  const { thead, tbody } = props;
666
- const [selectedRecord, setSelectedRecord] = useState6({});
667
- const [model, setModel] = useState6(false);
668
- const handleChange = (record) => {
669
- console.log("record", record);
670
- if (props.onChange) {
671
- props.onChange(record);
737
+ const [dataSource, setDataSource] = useState5([]);
738
+ useEffect2(() => {
739
+ if (tbody) {
740
+ setDataSource(
741
+ tbody.map((row, index) => ({
742
+ ...row,
743
+ key: index,
744
+ index: index + 1
745
+ }))
746
+ );
672
747
  }
673
- };
748
+ }, [tbody]);
674
749
  let columns = [];
675
750
  if (thead) {
676
751
  columns = [
677
752
  {
678
753
  title: "#",
679
- dataIndex: "#",
680
- key: "#",
754
+ dataIndex: "index",
755
+ key: "index",
681
756
  fixed: "left"
682
757
  },
683
- ...thead.map((col, ind) => ({
758
+ ...thead.map((col) => ({
684
759
  title: col.label,
685
760
  dataIndex: col.name,
686
761
  key: col.key,
@@ -688,86 +763,66 @@ var TableElement = (props) => {
688
763
  render: col.render,
689
764
  sorter: {
690
765
  compare: (a, b) => {
691
- if (typeof a[col.key] === "number" && typeof a[col.key] === "number") {
692
- return a[col.key] - b[col.key];
693
- } else if (typeof a[col.key] === "string" && typeof a[col.key] === "string") {
694
- return a[col.key].localeCompare(b[col.key]);
766
+ const aValue = a[col.key];
767
+ const bValue = b[col.key];
768
+ if (typeof aValue === "number" && typeof bValue === "number") {
769
+ return aValue - bValue;
770
+ } else if (typeof aValue === "string" && typeof bValue === "string") {
771
+ return aValue.localeCompare(bValue);
772
+ } else {
773
+ return 0;
695
774
  }
696
775
  }
697
776
  }
698
777
  }))
699
778
  ];
700
- if (props.view) {
701
- columns.push({
702
- title: "View",
703
- dataIndex: "View",
704
- key: "View",
705
- render: (_, record) => /* @__PURE__ */ React20.createElement(
706
- "a",
707
- {
708
- onClick: () => {
709
- setSelectedRecord(record);
710
- handleChange(record);
711
- setModel(true);
712
- }
713
- },
714
- "View"
715
- )
716
- });
717
- }
718
779
  }
719
- const dataSource = tbody && tbody.map((row, index) => ({
720
- ...row,
721
- key: index + 1,
722
- [columns[0].key]: index + 1
723
- }));
724
- const count = dataSource ? dataSource.length : 0;
725
780
  const onChangePage = (page, pageSize) => {
726
781
  if (props.onChange) {
727
782
  props.onChange({ name: "pagination", page, pageSize });
728
783
  }
729
784
  };
730
785
  const rowSelectionConfig = props.rowSelection ? {
731
- onChange: (selectedRowKeys, selectedRows) => {
732
- console.log(`selectedRowKeys: ${selectedRowKeys}`, "selectedRows: ", selectedRows);
786
+ onChange: (selectedRows) => {
733
787
  if (props.onChange) {
734
788
  props.onChange(selectedRows);
735
789
  }
736
790
  }
737
791
  } : void 0;
738
- return /* @__PURE__ */ React20.createElement(React20.Fragment, null, /* @__PURE__ */ React20.createElement(
792
+ return /* @__PURE__ */ React19.createElement(React19.Fragment, null, /* @__PURE__ */ React19.createElement(
739
793
  Table2,
740
794
  {
795
+ loading: props.loading,
741
796
  className: props.className,
742
- pagination: {
797
+ pagination: props.pagination ? {
798
+ current: props.value?.page,
743
799
  showTotal: (total) => `Total: ${total} items`,
744
- total: count,
745
- showSizeChanger: count > 10,
800
+ total: props.count,
801
+ showSizeChanger: props.count ? props.count > 10 : 0 > 10,
746
802
  onChange: onChangePage
747
- },
803
+ } : false,
748
804
  rowSelection: rowSelectionConfig,
749
805
  dataSource,
750
806
  columns,
751
807
  size: props.size,
752
808
  bordered: true
753
809
  }
754
- ), model && /* @__PURE__ */ React20.createElement(ModelElement, { selectedRecord, ...props, columns, model, onCancel: () => setModel(false) }));
810
+ ));
755
811
  };
756
812
 
757
813
  // src/Components/DatePicker.tsx
758
- import React21, { useState as useState7 } from "react";
814
+ import React20, { useState as useState6 } from "react";
759
815
  import { DatePicker } from "antd";
760
816
  import dayjs from "dayjs";
761
817
  import customParseFormat from "dayjs/plugin/customParseFormat.js";
762
818
  dayjs.extend(customParseFormat);
763
819
  var DatePickerElement = (props) => {
764
- const [dateState, setDateState] = useState7("");
820
+ const [dateState, setDateState] = useState6(props.value);
765
821
  const handleChange = (date, dateString) => {
766
822
  if (date) {
767
- const formattedDate = dateString;
768
823
  setDateState(date);
769
824
  if (props.onChange) {
770
- props.onChange(formattedDate);
825
+ props.onChange(dateString);
771
826
  }
772
827
  } else {
773
828
  setDateState("");
@@ -776,47 +831,115 @@ var DatePickerElement = (props) => {
776
831
  }
777
832
  }
778
833
  };
779
- return /* @__PURE__ */ React21.createElement("div", null, /* @__PURE__ */ React21.createElement(
834
+ const disabledDate = (current) => {
835
+ if (props.enabled_dates === "from_today") {
836
+ return current && current < dayjs().startOf("day");
837
+ }
838
+ return current && current > dayjs().endOf("day");
839
+ };
840
+ const disabledTime = (current) => {
841
+ if (!current) return {};
842
+ if (props.enabled_dates === "from_today") {
843
+ if (current.isSame(dayjs(), "day")) {
844
+ const hours = Array.from({ length: 24 }, (_, i) => i < dayjs().hour() ? i : null).filter(
845
+ (v) => v !== null
846
+ );
847
+ const minutes = Array.from({ length: 60 }, (_, i) => i < dayjs().minute() ? i : null).filter(
848
+ (v) => v !== null
849
+ );
850
+ return {
851
+ disabledHours: () => hours,
852
+ disabledMinutes: (selectedHour) => selectedHour === dayjs().hour() ? minutes : []
853
+ };
854
+ }
855
+ } else {
856
+ if (current.isSame(dayjs(), "day")) {
857
+ const hours = Array.from({ length: 24 }, (_, i) => i > dayjs().hour() ? i : null).filter(
858
+ (v) => v !== null
859
+ );
860
+ const minutes = Array.from({ length: 60 }, (_, i) => i > dayjs().minute() ? i : null).filter(
861
+ (v) => v !== null
862
+ );
863
+ return {
864
+ disabledHours: () => hours,
865
+ disabledMinutes: (selectedHour) => selectedHour === dayjs().hour() ? minutes : []
866
+ };
867
+ }
868
+ }
869
+ return {};
870
+ };
871
+ return /* @__PURE__ */ React20.createElement("div", { className: props.containerClassName }, props.label && /* @__PURE__ */ React20.createElement("label", { htmlFor: props.name, className: props.labelClassName }, props.label), /* @__PURE__ */ React20.createElement(
780
872
  DatePicker,
781
873
  {
874
+ disabledTime,
875
+ disabledDate,
876
+ showTime: true,
877
+ className: props.className,
782
878
  placeholder: props.placeholder,
783
879
  value: dateState,
784
- format: { format: "DD-MM-YYYY" },
785
- onChange: handleChange
880
+ format: "DD-MM-YYYY HH:mm",
881
+ onChange: handleChange,
882
+ picker: props.picker
786
883
  }
787
884
  ));
788
885
  };
789
886
 
790
887
  // src/Components/DateRangePickerElement.tsx
791
- import React22 from "react";
888
+ import React21 from "react";
792
889
  import { DatePicker as DatePicker2, Space } from "antd";
793
890
  import dayjs2 from "dayjs";
794
891
  var DateRangePickerElement = (props) => {
892
+ const { value } = props;
795
893
  const { RangePicker } = DatePicker2;
894
+ const dateValues = value ? value.map((date) => dayjs2(date, "DD-MM-YYYY")) : null;
895
+ const today = dayjs2();
796
896
  const handleChange = (dates, dateStrings) => {
797
- if (dates && props.onChange) {
798
- props.onChange(dateStrings);
897
+ if (dates) {
898
+ let [start, end] = dates;
899
+ if (start && start.isBefore(today) && end && end.isAfter(today)) {
900
+ end = today;
901
+ }
902
+ const adjustedDates = [start, end].map(
903
+ (date) => date ? date.format("DD-MM-YYYY") : null
904
+ );
905
+ console.log("1", adjustedDates);
906
+ props.onChange && props.onChange(adjustedDates);
799
907
  } else {
800
- console.log("Clear");
908
+ props.onChange && props.onChange("");
801
909
  }
802
910
  };
803
- const rangePresets = [
804
- { label: "Last 7 Days", value: [dayjs2().add(-7, "d"), dayjs2()] },
805
- { label: "Last 14 Days", value: [dayjs2().add(-14, "d"), dayjs2()] },
806
- { label: "Last 30 Days", value: [dayjs2().add(-30, "d"), dayjs2()] },
807
- { label: "Last 90 Days", value: [dayjs2().add(-90, "d"), dayjs2()] }
911
+ let rangePresets = [
912
+ { label: "Last 7 Days", value: [dayjs2().subtract(6, "d"), today] },
913
+ { label: "Last 14 Days", value: [dayjs2().subtract(13, "d"), today] },
914
+ { label: "Last 30 Days", value: [dayjs2().subtract(29, "d"), today] },
915
+ { label: "Last 90 Days", value: [dayjs2().subtract(89, "d"), today] }
808
916
  ];
809
- return /* @__PURE__ */ React22.createElement(Space, { direction: "vertical", size: 12 }, /* @__PURE__ */ React22.createElement(RangePicker, { presets: rangePresets, onChange: handleChange }));
917
+ const disabledDate = (current) => {
918
+ if (props.weekrange) {
919
+ return current && current < today.subtract(7, "d") || current > today;
920
+ }
921
+ return current && current > today;
922
+ };
923
+ return /* @__PURE__ */ React21.createElement(Space, { direction: "vertical", size: 12 }, /* @__PURE__ */ React21.createElement(
924
+ RangePicker,
925
+ {
926
+ disabledDate,
927
+ ...!props.weekrange && { presets: rangePresets },
928
+ format: "DD-MM-YYYY",
929
+ onChange: handleChange,
930
+ value: dateValues
931
+ }
932
+ ));
810
933
  };
811
934
 
812
935
  // src/Components/Image.tsx
813
- import React23 from "react";
936
+ import React22 from "react";
814
937
  var Image = (props) => {
815
- return /* @__PURE__ */ React23.createElement("img", { className: props.className, src: props.img, alt: "image" });
938
+ return /* @__PURE__ */ React22.createElement("img", { className: props.className, src: props.img, alt: "image" });
816
939
  };
817
940
 
818
941
  // src/Components/SingleCheckbox.tsx
819
- import React24 from "react";
942
+ import React23 from "react";
820
943
  import { Checkbox as Checkbox2 } from "antd";
821
944
  var SingleCheckbox = (props) => {
822
945
  const handleChange = (e) => {
@@ -824,16 +947,16 @@ var SingleCheckbox = (props) => {
824
947
  props.onChange(e.target.checked);
825
948
  }
826
949
  };
827
- return /* @__PURE__ */ React24.createElement(Checkbox2, { onChange: (e) => handleChange(e), className: props.className }, props.label);
950
+ return /* @__PURE__ */ React23.createElement(Checkbox2, { onChange: (e) => handleChange(e), className: props.className }, props.label);
828
951
  };
829
952
 
830
953
  // src/Components/DropDownGroup.tsx
831
- import React25, { useState as useState8 } from "react";
954
+ import React24, { useState as useState7 } from "react";
832
955
  import { Select as Select4 } from "antd";
833
956
  var DropDownGroup = (props) => {
834
- const [selectedValue, setSelectedValue] = useState8({
835
- firstValue: {},
836
- secondValue: {},
957
+ const [selectedValue, setSelectedValue] = useState7({
958
+ firstValue: props.value.firstValue,
959
+ secondValue: props.value.secondValue,
837
960
  temp: ""
838
961
  });
839
962
  const handleFirstChange = (value) => {
@@ -863,32 +986,48 @@ var DropDownGroup = (props) => {
863
986
  return newValue;
864
987
  });
865
988
  };
866
- return /* @__PURE__ */ React25.createElement("div", { className: props.containerClassName }, props.label && /* @__PURE__ */ React25.createElement("label", { htmlFor: props.name, className: props.labelClassName }, props.label), /* @__PURE__ */ React25.createElement("div", { className: props.subContainerClassName }, /* @__PURE__ */ React25.createElement(
989
+ const firstFilterOptions = (input, option) => {
990
+ return (option?.label ?? "").toLowerCase().includes(input.toLowerCase());
991
+ };
992
+ const secondFilterOptions = (input, option) => {
993
+ return (option?.label ?? "").toLowerCase().includes(input.toLowerCase());
994
+ };
995
+ return /* @__PURE__ */ React24.createElement("div", { className: props.containerClassName }, props.label && /* @__PURE__ */ React24.createElement("label", { htmlFor: props.name, className: props.labelClassName }, props.label), /* @__PURE__ */ React24.createElement("div", { className: props.subContainerClassName }, /* @__PURE__ */ React24.createElement(
867
996
  Select4,
868
997
  {
869
998
  onChange: handleFirstChange,
870
999
  variant: props.variant,
871
1000
  options: props.firstOptions,
872
- className: props.className
1001
+ className: props.className,
1002
+ filterOption: firstFilterOptions,
1003
+ placeholder: props.firstPlaceholder,
1004
+ value: props.value.firstValue,
1005
+ showSearch: true
873
1006
  }
874
- ), /* @__PURE__ */ React25.createElement("div", { style: { borderLeft: "1px solid gray", height: "33px" } }), /* @__PURE__ */ React25.createElement(
1007
+ ), /* @__PURE__ */ React24.createElement("div", { style: { borderLeft: "1px solid gray", height: "31px" } }), /* @__PURE__ */ React24.createElement(
875
1008
  Select4,
876
1009
  {
877
1010
  onChange: handleSecondChange,
878
1011
  variant: props.variant,
879
1012
  options: props.secondOptions,
880
- className: props.className
1013
+ className: props.className,
1014
+ filterOption: secondFilterOptions,
1015
+ placeholder: props.secondPlaceholder,
1016
+ value: props.value.secondValue,
1017
+ showSearch: true
881
1018
  }
882
1019
  )));
883
1020
  };
884
1021
 
885
1022
  // src/Components/FilesUpload.tsx
886
- import React26, { useState as useState9 } from "react";
1023
+ import React25, { useState as useState8 } from "react";
887
1024
  import { Upload } from "antd";
888
1025
  import { InboxOutlined } from "@ant-design/icons";
889
1026
  var FileUpload = (props) => {
890
1027
  const { Dragger } = Upload;
891
- const [files, setFiles] = useState9([]);
1028
+ const [files, setFiles] = useState8(
1029
+ props.value && props.value.length > 0 ? props.value : []
1030
+ );
892
1031
  const handleChange = ({ fileList }) => {
893
1032
  setFiles(fileList);
894
1033
  if (props.onChange) {
@@ -903,7 +1042,7 @@ var FileUpload = (props) => {
903
1042
  onSuccess("ok");
904
1043
  }, 0);
905
1044
  };
906
- return /* @__PURE__ */ React26.createElement("div", null, /* @__PURE__ */ React26.createElement(
1045
+ return /* @__PURE__ */ React25.createElement("div", null, /* @__PURE__ */ React25.createElement(
907
1046
  Dragger,
908
1047
  {
909
1048
  action: "",
@@ -916,13 +1055,13 @@ var FileUpload = (props) => {
916
1055
  showUploadList: true,
917
1056
  customRequest
918
1057
  },
919
- /* @__PURE__ */ React26.createElement("p", null, /* @__PURE__ */ React26.createElement(InboxOutlined, null)),
920
- /* @__PURE__ */ React26.createElement("p", null, "Click or drag file to upload")
1058
+ /* @__PURE__ */ React25.createElement("p", null, /* @__PURE__ */ React25.createElement(InboxOutlined, null)),
1059
+ /* @__PURE__ */ React25.createElement("p", null, "Click or drag file to upload")
921
1060
  ));
922
1061
  };
923
1062
 
924
1063
  // src/Components/TabsElement.tsx
925
- import React27 from "react";
1064
+ import React26 from "react";
926
1065
  import { Tabs } from "antd";
927
1066
  var TabsElement = (props) => {
928
1067
  const handleChange = (key) => {
@@ -930,34 +1069,33 @@ var TabsElement = (props) => {
930
1069
  props.onChange(props.options?.find((eachOption) => eachOption.key === key));
931
1070
  }
932
1071
  };
933
- return /* @__PURE__ */ React27.createElement(Tabs, { className: props.containerClassName, items: props.options, onChange: handleChange });
1072
+ return /* @__PURE__ */ React26.createElement(Tabs, { defaultActiveKey: props.value, className: props.containerClassName, items: props.options, onChange: handleChange });
934
1073
  };
935
1074
 
936
1075
  // src/Components/SwitchElement.tsx
937
- import React28 from "react";
1076
+ import React27 from "react";
938
1077
  import { Switch } from "antd";
939
1078
  var onChange = (checked) => {
940
- console.log(`switch to ${checked}`);
941
1079
  };
942
- var SwitchElement = () => /* @__PURE__ */ React28.createElement(Switch, { defaultChecked: true, onChange });
1080
+ var SwitchElement = () => /* @__PURE__ */ React27.createElement(Switch, { defaultChecked: true, onChange });
943
1081
 
944
1082
  // src/Components/Upload.tsx
945
- import React29, { useState as useState10 } from "react";
1083
+ import React28, { useState as useState9 } from "react";
946
1084
  var Upload2 = (props) => {
947
- const [file, setFile] = useState10();
1085
+ const [file, setFile] = useState9();
948
1086
  const handleFileChange = (e) => {
949
1087
  setFile(e.target.files[0]);
950
1088
  if (props.onChange) {
1089
+ console.log(e.target.files[0]);
951
1090
  props.onChange(e.target.files[0]);
952
1091
  }
953
1092
  };
954
1093
  const handleUpload = async () => {
955
1094
  if (!file) {
956
- console.error("No file selected");
957
1095
  return;
958
1096
  }
959
1097
  };
960
- return /* @__PURE__ */ React29.createElement("div", { style: { marginTop: 16 } }, /* @__PURE__ */ React29.createElement("input", { type: "file", onChange: handleFileChange }), /* @__PURE__ */ React29.createElement(
1098
+ return /* @__PURE__ */ React28.createElement("div", { style: { marginTop: 16 } }, /* @__PURE__ */ React28.createElement("input", { type: "file", onChange: handleFileChange }), /* @__PURE__ */ React28.createElement(
961
1099
  "button",
962
1100
  {
963
1101
  type: "button",
@@ -970,12 +1108,12 @@ var Upload2 = (props) => {
970
1108
  };
971
1109
 
972
1110
  // src/Components/OtpElement.tsx
973
- import React30, { useState as useState11, useRef, useEffect as useEffect3 } from "react";
1111
+ import React29, { useState as useState10, useRef as useRef2, useEffect as useEffect3 } from "react";
974
1112
  import { Input as Input3 } from "antd";
975
1113
  var OtpElement = (props) => {
976
1114
  const length = props.length;
977
- const [otp, setOtp] = useState11(Array(length).fill(""));
978
- const inputRefs = useRef([]);
1115
+ const [otp, setOtp] = useState10(Array(length).fill(""));
1116
+ const inputRefs = useRef2([]);
979
1117
  const handleChange = (e, index) => {
980
1118
  const value = e.target.value;
981
1119
  if (/^[0-9]$/.test(value) || value === "") {
@@ -1010,7 +1148,7 @@ var OtpElement = (props) => {
1010
1148
  useEffect3(() => {
1011
1149
  inputRefs.current[0]?.focus();
1012
1150
  }, []);
1013
- return /* @__PURE__ */ React30.createElement("div", { className: props.containerClassName }, Array.from({ length }).map((_, index) => /* @__PURE__ */ React30.createElement(
1151
+ return /* @__PURE__ */ React29.createElement("div", { className: props.containerClassName }, Array.from({ length }).map((_, index) => /* @__PURE__ */ React29.createElement(
1014
1152
  Input3,
1015
1153
  {
1016
1154
  key: index,
@@ -1025,78 +1163,542 @@ var OtpElement = (props) => {
1025
1163
  )));
1026
1164
  };
1027
1165
 
1028
- // src/Components/Donut.tsx
1166
+ // src/Components/CircleDonut.tsx
1167
+ import React30 from "react";
1168
+ import { Doughnut } from "react-chartjs-2";
1169
+ import {
1170
+ Chart as ChartJS,
1171
+ DoughnutController,
1172
+ ArcElement,
1173
+ Tooltip,
1174
+ Legend
1175
+ } from "chart.js";
1176
+ ChartJS.register(DoughnutController, ArcElement, Tooltip, Legend);
1177
+ var CircleDonut = (props) => {
1178
+ const data = {
1179
+ labels: props.labels,
1180
+ datasets: [
1181
+ {
1182
+ label: "Bot Conversation",
1183
+ data: props.data,
1184
+ backgroundColor: [
1185
+ "#FFCB8A",
1186
+ "#CADBBF",
1187
+ "#8AC1BB",
1188
+ "#FCB0CB",
1189
+ "#CEB0FA"
1190
+ ],
1191
+ borderWidth: 0
1192
+ }
1193
+ ]
1194
+ };
1195
+ const options = {
1196
+ responsive: true,
1197
+ cutout: "80%",
1198
+ plugins: {
1199
+ legend: {
1200
+ position: "left",
1201
+ labels: {
1202
+ font: {
1203
+ size: 10
1204
+ },
1205
+ boxWidth: 15,
1206
+ generateLabels: (chart) => {
1207
+ const dataset = chart.data.datasets[0];
1208
+ return chart.data.labels.map((label, index) => {
1209
+ const value = dataset.data[index];
1210
+ return {
1211
+ text: `${label}: ${value}`,
1212
+ fillStyle: dataset.backgroundColor[index]
1213
+ };
1214
+ });
1215
+ }
1216
+ }
1217
+ },
1218
+ tooltip: {
1219
+ enabled: true,
1220
+ callbacks: {
1221
+ label: function(context) {
1222
+ const label = context.label || "";
1223
+ const value = context.raw || 0;
1224
+ return `${label}: ${value}`;
1225
+ }
1226
+ }
1227
+ }
1228
+ }
1229
+ };
1230
+ const centerTextPlugin = {
1231
+ id: "centerText",
1232
+ beforeDraw: (chart) => {
1233
+ const { ctx, chartArea: { left, right, top, bottom } } = chart;
1234
+ const width = right - left;
1235
+ const height = bottom - top;
1236
+ const centerX = left + width / 2;
1237
+ const centerY = top + height / 2;
1238
+ ctx.save();
1239
+ ctx.font = "7px Arial";
1240
+ ctx.fillStyle = "blue";
1241
+ ctx.textAlign = "center";
1242
+ ctx.textBaseline = "middle";
1243
+ ctx.fillText("Total Sessions", centerX, centerY - 10);
1244
+ ctx.font = "25px Arial";
1245
+ ctx.fillStyle = "black";
1246
+ ctx.fillText("85", centerX, centerY + 20);
1247
+ ctx.restore();
1248
+ }
1249
+ };
1250
+ return /* @__PURE__ */ React30.createElement("div", { className: props.className }, /* @__PURE__ */ React30.createElement("h1", { className: props.labelClassName }, props.label), /* @__PURE__ */ React30.createElement(Doughnut, { data, options, plugins: [centerTextPlugin] }));
1251
+ };
1252
+
1253
+ // src/Components/SemiCircleDonut.tsx
1029
1254
  import React31 from "react";
1030
- import Highcharts from "highcharts";
1031
- import HighchartsReact from "highcharts-react-official";
1032
- var HighchartsChart = ({ options }) => {
1033
- return /* @__PURE__ */ React31.createElement(HighchartsReact, { highcharts: Highcharts, options });
1255
+ import { Doughnut as Doughnut2 } from "react-chartjs-2";
1256
+ import {
1257
+ Chart as ChartJS2,
1258
+ DoughnutController as DoughnutController2,
1259
+ ArcElement as ArcElement2,
1260
+ Tooltip as Tooltip2,
1261
+ Legend as Legend2
1262
+ } from "chart.js";
1263
+ ChartJS2.register(DoughnutController2, ArcElement2, Tooltip2, Legend2);
1264
+ var SemiCircleDonut = (props) => {
1265
+ const data = {
1266
+ labels: [
1267
+ "Registration",
1268
+ "Book Appointment",
1269
+ "Diagnostic Tests",
1270
+ "Hospital Facility",
1271
+ "Others, Prescriptions"
1272
+ ],
1273
+ datasets: [
1274
+ {
1275
+ label: "Bot Conversation",
1276
+ data: [30, 10, 27, 40, 12],
1277
+ backgroundColor: [
1278
+ "#FFCB8A",
1279
+ "#CADBBF",
1280
+ "#8AC1BB",
1281
+ "#FCB0CB",
1282
+ "#CEB0FA"
1283
+ ],
1284
+ borderWidth: 0
1285
+ }
1286
+ ]
1287
+ };
1288
+ const options = {
1289
+ responsive: true,
1290
+ circumference: 180,
1291
+ rotation: -90,
1292
+ cutout: "80%",
1293
+ plugins: {
1294
+ legend: {
1295
+ display: false
1296
+ // Disable the legend
1297
+ },
1298
+ tooltip: {
1299
+ enabled: true,
1300
+ callbacks: {
1301
+ label: function(context) {
1302
+ const label = context.label || "";
1303
+ const value = context.raw || 0;
1304
+ return `${label}: ${value}`;
1305
+ }
1306
+ }
1307
+ }
1308
+ }
1309
+ };
1310
+ const centerTextPlugin = {
1311
+ id: "centerText",
1312
+ beforeDraw: (chart) => {
1313
+ const { ctx, chartArea: { left, right, top, bottom } } = chart;
1314
+ const width = right - left;
1315
+ const height = bottom - top;
1316
+ const centerX = left + width / 2;
1317
+ const centerY = top + height / 1.5;
1318
+ const maxWidth = width * 0.8;
1319
+ ctx.save();
1320
+ ctx.fillStyle = "black";
1321
+ ctx.textAlign = "center";
1322
+ ctx.textBaseline = "middle";
1323
+ const drawText = (text, y, fontSize) => {
1324
+ ctx.font = `${fontSize}px Arial`;
1325
+ const textWidth = ctx.measureText(text).width;
1326
+ if (textWidth > maxWidth) {
1327
+ const newFontSize = fontSize * maxWidth / textWidth;
1328
+ ctx.font = `${newFontSize}px Arial`;
1329
+ }
1330
+ ctx.fillText(text, centerX, y);
1331
+ };
1332
+ drawText(props.fillText1, centerY - 10, 16);
1333
+ drawText(props.fillText2, centerY + 20, 8);
1334
+ ctx.restore();
1335
+ }
1336
+ };
1337
+ return /* @__PURE__ */ React31.createElement("div", { className: props.className }, /* @__PURE__ */ React31.createElement("h1", { className: props.labelClassName }, props.label), /* @__PURE__ */ React31.createElement(Doughnut2, { data, options, plugins: [centerTextPlugin] }));
1034
1338
  };
1035
- console.log(HighchartsChart);
1036
- console.log(typeof HighchartsChart);
1037
- var Donut = (props) => {
1038
- const chartOptions = {
1039
- title: {
1040
- text: "Distribution of Students"
1041
- },
1042
- plotOptions: {
1043
- pie: {
1044
- innerSize: "70%",
1045
- dataLabels: {
1046
- enabled: false,
1047
- format: "<b>{point.name}</b>: {point.percentage:.1f} %"
1048
- },
1049
- showInLegend: true
1339
+
1340
+ // src/Components/HorizontalBarChart.tsx
1341
+ import React32 from "react";
1342
+ import { Bar } from "react-chartjs-2";
1343
+ import {
1344
+ Chart as ChartJS3,
1345
+ BarElement,
1346
+ CategoryScale,
1347
+ LinearScale,
1348
+ Tooltip as Tooltip3
1349
+ } from "chart.js";
1350
+ ChartJS3.register(BarElement, CategoryScale, LinearScale, Tooltip3);
1351
+ var HorizontalBarChart = (props) => {
1352
+ const data = {
1353
+ labels: ["18-24", "25-34", "35-44", "45-54", "55-64", "65+"],
1354
+ datasets: [
1355
+ {
1356
+ data: [30, 10, 27, 40, 12, 24],
1357
+ backgroundColor: "#6298D5",
1358
+ barThickness: 15
1359
+ }
1360
+ ]
1361
+ };
1362
+ const options = {
1363
+ responsive: true,
1364
+ indexAxis: "y",
1365
+ scales: {
1366
+ x: {
1367
+ beginAtZero: true,
1368
+ ticks: {
1369
+ callback: function(value) {
1370
+ return `${value}%`;
1371
+ }
1372
+ }
1373
+ },
1374
+ y: {
1375
+ grid: {
1376
+ display: false
1377
+ }
1050
1378
  }
1051
1379
  },
1052
- series: [
1053
- {
1054
- type: "pie",
1055
- name: "Percentage",
1056
- data: [
1057
- {
1058
- name: "Girls",
1059
- y: 20,
1060
- color: "#FF6384"
1061
- // Custom color for Girls
1380
+ plugins: {
1381
+ tooltip: {
1382
+ enabled: true,
1383
+ callbacks: {
1384
+ label: function(context) {
1385
+ const label = context.label || "";
1386
+ const value = context.raw || 0;
1387
+ return `${label}: ${value}`;
1388
+ }
1389
+ }
1390
+ },
1391
+ legend: {
1392
+ display: false
1393
+ }
1394
+ }
1395
+ };
1396
+ return /* @__PURE__ */ React32.createElement("div", { className: props.className }, /* @__PURE__ */ React32.createElement("h1", { className: props.labelClassName }, props.label), /* @__PURE__ */ React32.createElement(Bar, { data, options }));
1397
+ };
1398
+
1399
+ // src/Components/LineChart.tsx
1400
+ import React33, { useEffect as useEffect4, useRef as useRef3 } from "react";
1401
+ import Chart from "chart.js/auto";
1402
+ var LineChart = (props) => {
1403
+ const chartRef = useRef3(null);
1404
+ const chartInstance = useRef3(null);
1405
+ const data = [
1406
+ { label: "ROI", data: [10, 13, 20, 15, 10] },
1407
+ { label: "Engagement Rate", data: [20, 23, 30, 28, 20] },
1408
+ { label: "Conversion Rate", data: [50, 100, 150, 180, 50] }
1409
+ ];
1410
+ const labels = ["Instagram", "Whatsapp", "Messages", "Telegram", "Linkedin"];
1411
+ useEffect4(() => {
1412
+ if (chartRef.current) {
1413
+ if (chartInstance.current) {
1414
+ chartInstance.current.destroy();
1415
+ }
1416
+ chartInstance.current = new Chart(chartRef.current, {
1417
+ type: "line",
1418
+ data: {
1419
+ labels,
1420
+ datasets: data.map((dataset, index) => ({
1421
+ label: dataset.label,
1422
+ data: dataset.data,
1423
+ borderColor: index === 0 ? "#FF8F00" : index === 1 ? "#F50057" : "#254AAA",
1424
+ backgroundColor: "rgba(0, 0, 0, 0)",
1425
+ pointBackgroundColor: index === 0 ? "#FF8F00" : index === 1 ? "#F50057" : "#254AAA",
1426
+ pointBorderColor: "white",
1427
+ pointStyle: "circle",
1428
+ pointRadius: 3,
1429
+ tension: 0.1,
1430
+ fill: true
1431
+ }))
1432
+ },
1433
+ options: {
1434
+ plugins: {
1435
+ legend: {
1436
+ labels: {
1437
+ usePointStyle: true
1438
+ }
1439
+ }
1062
1440
  },
1063
- {
1064
- name: "Boys",
1065
- y: 40,
1066
- color: "#36A2EB"
1067
- // Custom color for Boys
1441
+ scales: {
1442
+ x: {
1443
+ grid: {
1444
+ display: false
1445
+ }
1446
+ },
1447
+ y: {
1448
+ beginAtZero: true,
1449
+ suggestedMax: 200,
1450
+ ticks: {
1451
+ callback: function(value) {
1452
+ return value + "%";
1453
+ }
1454
+ },
1455
+ grid: {
1456
+ display: true
1457
+ }
1458
+ }
1459
+ }
1460
+ }
1461
+ });
1462
+ }
1463
+ return () => {
1464
+ if (chartInstance.current) {
1465
+ chartInstance.current.destroy();
1466
+ }
1467
+ };
1468
+ }, [labels, data]);
1469
+ return /* @__PURE__ */ React33.createElement("div", { className: props.className }, /* @__PURE__ */ React33.createElement("canvas", { ref: chartRef }));
1470
+ };
1471
+
1472
+ // src/Components/DoubleBarChart.tsx
1473
+ import React34, { useEffect as useEffect5, useRef as useRef4 } from "react";
1474
+ import Chart2 from "chart.js/auto";
1475
+ var DoubleBarChart = (props) => {
1476
+ const chartRef = useRef4(null);
1477
+ const chartInstance = useRef4(null);
1478
+ useEffect5(() => {
1479
+ if (chartRef.current) {
1480
+ if (chartInstance.current) {
1481
+ chartInstance.current.destroy();
1482
+ }
1483
+ chartInstance.current = new Chart2(chartRef.current, {
1484
+ type: "bar",
1485
+ data: {
1486
+ labels: [
1487
+ "Summer Health Tips",
1488
+ "New Services Launch",
1489
+ "Discounts on Checkups",
1490
+ "Wellness Webinar",
1491
+ "LinkedIn Insights"
1492
+ ],
1493
+ datasets: [
1494
+ {
1495
+ label: "Engagement Rate",
1496
+ data: [60, 70, 50, 80, 65],
1497
+ // Example data for male
1498
+ backgroundColor: "#93B8E2",
1499
+ barThickness: 10
1500
+ },
1501
+ {
1502
+ label: "Conversion Rate",
1503
+ data: [70, 65, 75, 55, 85],
1504
+ // Example data for female
1505
+ backgroundColor: "#4484CD",
1506
+ barThickness: 10
1507
+ }
1508
+ ]
1509
+ },
1510
+ options: {
1511
+ scales: {
1512
+ x: {
1513
+ grid: {
1514
+ display: false
1515
+ // Display x-axis grid lines
1516
+ }
1517
+ },
1518
+ y: {
1519
+ beginAtZero: true,
1520
+ suggestedMax: 100,
1521
+ ticks: {
1522
+ callback: function(value) {
1523
+ return value + "%";
1524
+ }
1525
+ },
1526
+ grid: {
1527
+ display: true
1528
+ }
1529
+ }
1068
1530
  },
1069
- {
1070
- name: "Students",
1071
- y: 40,
1072
- color: "#FFCE56"
1073
- // Custom color for Students
1531
+ plugins: {
1532
+ legend: {
1533
+ labels: {
1534
+ usePointStyle: true
1535
+ }
1536
+ }
1074
1537
  }
1075
- ]
1538
+ }
1539
+ });
1540
+ }
1541
+ return () => {
1542
+ if (chartInstance.current) {
1543
+ chartInstance.current.destroy();
1544
+ }
1545
+ };
1546
+ }, []);
1547
+ return /* @__PURE__ */ React34.createElement("div", { className: props.className }, /* @__PURE__ */ React34.createElement("h1", { className: props.labelClassName }, props.label), /* @__PURE__ */ React34.createElement("canvas", { ref: chartRef }));
1548
+ };
1549
+
1550
+ // src/Components/BarChart.tsx
1551
+ import React35 from "react";
1552
+ import { Bar as Bar2 } from "react-chartjs-2";
1553
+ import {
1554
+ Chart as ChartJS4,
1555
+ BarElement as BarElement2,
1556
+ CategoryScale as CategoryScale2,
1557
+ LinearScale as LinearScale2,
1558
+ Tooltip as Tooltip4
1559
+ } from "chart.js";
1560
+ ChartJS4.register(BarElement2, CategoryScale2, LinearScale2, Tooltip4);
1561
+ var BarChart = (props) => {
1562
+ const data = {
1563
+ labels: [
1564
+ "17 June",
1565
+ "18 June",
1566
+ "19 June",
1567
+ "20 June",
1568
+ "21 June",
1569
+ "22 June",
1570
+ "23 June"
1571
+ ],
1572
+ datasets: [
1573
+ {
1574
+ data: [30, 100, 270, 140, 120, 240],
1575
+ backgroundColor: "#1565C0",
1576
+ barThickness: 15
1076
1577
  }
1077
1578
  ]
1078
1579
  };
1079
- return /* @__PURE__ */ React31.createElement(React31.Fragment, null, /* @__PURE__ */ React31.createElement(HighchartsChart, { options: chartOptions }));
1580
+ const options = {
1581
+ responsive: true,
1582
+ scales: {
1583
+ x: {
1584
+ beginAtZero: true,
1585
+ grid: {
1586
+ display: false
1587
+ }
1588
+ },
1589
+ y: {
1590
+ grid: {
1591
+ display: true
1592
+ },
1593
+ ticks: {
1594
+ min: 0,
1595
+ max: 400,
1596
+ stepSize: 200,
1597
+ callback: function(value) {
1598
+ return `${value}`;
1599
+ }
1600
+ }
1601
+ }
1602
+ },
1603
+ plugins: {
1604
+ tooltip: {
1605
+ enabled: true,
1606
+ callbacks: {
1607
+ label: function(context) {
1608
+ const label = context.label || "";
1609
+ const value = context.raw || 0;
1610
+ return ` ${label}: ${value}`;
1611
+ }
1612
+ }
1613
+ },
1614
+ legend: {
1615
+ display: false
1616
+ }
1617
+ }
1618
+ };
1619
+ return /* @__PURE__ */ React35.createElement("div", { className: props.className }, /* @__PURE__ */ React35.createElement("h1", { className: props.labelClassName }, props.label), /* @__PURE__ */ React35.createElement(Bar2, { data, options }));
1620
+ };
1621
+
1622
+ // src/Components/DivContainer.tsx
1623
+ import React36 from "react";
1624
+ var DivContainer = (props) => {
1625
+ return /* @__PURE__ */ React36.createElement("div", { className: props.className, onClick: props.onClick }, props.label);
1626
+ };
1627
+
1628
+ // src/Components/ColorPickerElement.tsx
1629
+ import React37 from "react";
1630
+ import { ColorPicker } from "antd";
1631
+ var ColorPickerElement = (props) => {
1632
+ const onHandleChange = (value, hex) => {
1633
+ console.log(hex);
1634
+ props.onChange && props.onChange(hex);
1635
+ };
1636
+ return /* @__PURE__ */ React37.createElement("div", { className: props.containerClassName }, props.label && /* @__PURE__ */ React37.createElement("label", { htmlFor: props.name, className: props.labelClassName }, props.label), /* @__PURE__ */ React37.createElement("br", null), /* @__PURE__ */ React37.createElement(
1637
+ ColorPicker,
1638
+ {
1639
+ className: props.className,
1640
+ showText: true,
1641
+ value: props.value,
1642
+ onChange: onHandleChange
1643
+ }
1644
+ ));
1645
+ };
1646
+
1647
+ // src/Components/NotificationAlert.tsx
1648
+ import React38 from "react";
1649
+ import { notification } from "antd";
1650
+ var NotificationAlert = (props) => {
1651
+ const [api, contextHolder] = notification.useNotification();
1652
+ const openNotificationType = (pauseOnHover, type) => {
1653
+ api[type]({
1654
+ message: props.message,
1655
+ description: props.description,
1656
+ duration: 4.5,
1657
+ pauseOnHover,
1658
+ showProgress: props.showProgress
1659
+ });
1660
+ };
1661
+ const openNotification = (pauseOnHover) => {
1662
+ api.open({
1663
+ message: props.message,
1664
+ description: props.description,
1665
+ duration: 4.5,
1666
+ showProgress: props.showProgress,
1667
+ pauseOnHover
1668
+ });
1669
+ };
1670
+ const handleClick = () => {
1671
+ const notificationType = props.notificationType || "info";
1672
+ props.notificationType ? openNotificationType(true, notificationType) : openNotification(true);
1673
+ };
1674
+ return /* @__PURE__ */ React38.createElement("div", { className: props.containerClassName }, contextHolder, /* @__PURE__ */ React38.createElement(ButtonElement, { ...props, onClick: handleClick }));
1080
1675
  };
1081
- var Donut_default = Donut;
1082
1676
  export {
1083
1677
  AddMoreTable,
1678
+ BarChart,
1084
1679
  ButtonElement,
1085
1680
  CheckboxElement,
1681
+ CircleDonut,
1086
1682
  CkEditor,
1683
+ ColorPickerElement,
1087
1684
  DatePickerElement,
1088
1685
  DateRangePickerElement,
1089
- Donut_default as Donut,
1686
+ DivContainer,
1687
+ DoubleBarChart,
1090
1688
  DropDownGroup,
1091
1689
  FileUpload,
1690
+ HorizontalBarChart,
1092
1691
  Image,
1692
+ LineChart,
1093
1693
  MultipleSelectElement,
1094
1694
  Navbar,
1695
+ NotificationAlert,
1095
1696
  NumberElement,
1096
1697
  OtpElement,
1097
1698
  PasswordElement,
1098
1699
  RadioElement,
1099
1700
  SelectElement,
1701
+ SemiCircleDonut,
1100
1702
  Sidebar,
1101
1703
  SingleCheckbox,
1102
1704
  SingleSelectElement,