@apexcura/ui-components 0.0.14-Beta28 → 0.0.14-Beta280

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
@@ -13,6 +13,7 @@ var TextElement = (props) => {
13
13
  placeholder: props.placeholder,
14
14
  allowClear: true,
15
15
  id: props.name,
16
+ value: props.value,
16
17
  prefix: props.prefix,
17
18
  type: props.type,
18
19
  status: props.status,
@@ -72,8 +73,7 @@ var NumberElement = (props) => {
72
73
  {
73
74
  placeholder: props.placeholder,
74
75
  addonBefore: props.addonBefore,
75
- allowClear: true,
76
- defaultValue: props.defaultValue,
76
+ value: props.value,
77
77
  disabled: props.disabled,
78
78
  id: props.name,
79
79
  prefix: props.prefix,
@@ -99,20 +99,19 @@ var TextareaElement = (props) => {
99
99
  props.onChange(e.target.value);
100
100
  }
101
101
  };
102
+ const defaultMinRows = 2;
103
+ const defaultMaxRows = 6;
102
104
  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
105
  TextArea,
104
106
  {
105
107
  placeholder: props.placeholder,
106
108
  allowClear: true,
107
- defaultValue: props.defaultValue,
108
109
  disabled: props.disabled,
109
110
  id: props.name,
110
- status: props.status,
111
+ autoSize: { minRows: props.minRows ? props.minRows : defaultMinRows, maxRows: props.maxRows ? props.maxRows : defaultMaxRows },
111
112
  className: props.className,
112
- variant: props.variant,
113
113
  name: props.name,
114
114
  showCount: true,
115
- maxLength: props.maxLength,
116
115
  onChange: (e) => {
117
116
  handleChange(e);
118
117
  }
@@ -123,13 +122,14 @@ var TextareaElement = (props) => {
123
122
  // src/Components/SelectElement.tsx
124
123
  import React5 from "react";
125
124
  import { Select } from "antd";
125
+ var filterOptions = (input, option) => {
126
+ return (option?.label ?? "").toLowerCase().includes(input.toLowerCase());
127
+ };
126
128
  var SelectElement = (props) => {
127
129
  const handleChange = (value) => {
128
- console.log("++=====", typeof value);
129
130
  if (props.onChange) {
130
131
  if (typeof value === "string") {
131
132
  const filterOption2 = props.options && props.options.find((eachOption) => eachOption.value === value);
132
- console.log(filterOption2);
133
133
  props.onChange(filterOption2);
134
134
  } else {
135
135
  const selectedOptions = value ? value.map((eachVal) => {
@@ -139,21 +139,17 @@ var SelectElement = (props) => {
139
139
  }
140
140
  }
141
141
  };
142
- 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(
142
+ return /* @__PURE__ */ React5.createElement("div", { className: props.containerClassName }, props.label && /* @__PURE__ */ React5.createElement("label", { htmlFor: props.name, className: props.className }, props.label), /* @__PURE__ */ React5.createElement(
143
143
  Select,
144
144
  {
145
- mode: props.mode,
146
145
  options: props.options,
147
146
  placeholder: props.placeholder,
148
147
  allowClear: true,
149
- defaultValue: props.defaultValue,
150
- disabled: props.disabled,
151
- id: props.name,
152
- status: props.status,
153
- style: props.styles,
148
+ filterOption: filterOptions,
149
+ showSearch: true,
154
150
  className: props.className,
155
- variant: props.variant,
156
- onChange: handleChange
151
+ onChange: handleChange,
152
+ mode: props.mode
157
153
  }
158
154
  ));
159
155
  };
@@ -168,7 +164,6 @@ var RadioElement = (props) => {
168
164
  const [selectedValue, setSelectedValue] = useState2(props.value);
169
165
  const optionType = props.optionType === "button" ? "button" : void 0;
170
166
  const handleChange = (option) => {
171
- console.log(option);
172
167
  setSelectedValue(option);
173
168
  setIsDisabled(true);
174
169
  if (props.onChange) {
@@ -260,7 +255,6 @@ var CkEditor = (props) => {
260
255
  import React9 from "react";
261
256
  import { Select as Select2 } from "antd";
262
257
  var onSearch = (value) => {
263
- console.log("search:", value);
264
258
  };
265
259
  var filterOption = (input, option) => (option?.label ?? "").toLowerCase().includes(input.toLowerCase());
266
260
  var SingleSelectElement = (props) => {
@@ -316,21 +310,161 @@ var MultipleSelectElement = (props) => {
316
310
  };
317
311
 
318
312
  // src/Components/Button.tsx
313
+ import React12 from "react";
314
+
315
+ // src/constants/icons.tsx
319
316
  import React11 from "react";
317
+ var icons = {
318
+ download: /* @__PURE__ */ React11.createElement("svg", { viewBox: "0 0 25 25", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React11.createElement(
319
+ "path",
320
+ {
321
+ 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",
322
+ fill: "#505050"
323
+ }
324
+ )),
325
+ save: /* @__PURE__ */ React11.createElement("svg", { viewBox: "0 0 27 27", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React11.createElement(
326
+ "path",
327
+ {
328
+ 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",
329
+ fill: "#A3A3A3"
330
+ }
331
+ )),
332
+ filter: /* @__PURE__ */ React11.createElement("svg", { viewBox: "0 0 25 25", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React11.createElement(
333
+ "path",
334
+ {
335
+ 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",
336
+ fill: "#505050"
337
+ }
338
+ )),
339
+ logout: /* @__PURE__ */ React11.createElement("svg", { viewBox: "0 0 25 25", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React11.createElement(
340
+ "path",
341
+ {
342
+ 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",
343
+ fill: "#505050"
344
+ }
345
+ ), /* @__PURE__ */ React11.createElement(
346
+ "path",
347
+ {
348
+ 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",
349
+ fill: "#505050"
350
+ }
351
+ )),
352
+ patient: /* @__PURE__ */ React11.createElement("svg", { viewBox: "0 0 24 25", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React11.createElement(
353
+ "path",
354
+ {
355
+ 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",
356
+ fill: "#505050"
357
+ }
358
+ )),
359
+ refresh: /* @__PURE__ */ React11.createElement("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React11.createElement(
360
+ "path",
361
+ {
362
+ 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",
363
+ fill: "#595959"
364
+ }
365
+ )),
366
+ scheduler: /* @__PURE__ */ React11.createElement("svg", { viewBox: "0 0 24 25", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React11.createElement(
367
+ "path",
368
+ {
369
+ 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",
370
+ fill: "#505050"
371
+ }
372
+ )),
373
+ add: /* @__PURE__ */ React11.createElement("svg", { viewBox: "0 0 26 27", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React11.createElement(
374
+ "path",
375
+ {
376
+ d: "M21.4869 14.7981H13.9193V22.3657H11.3967V14.7981H3.8291V12.2755H11.3967V4.70789H13.9193V12.2755H21.4869V14.7981Z",
377
+ fill: "white"
378
+ }
379
+ )),
380
+ bot: /* @__PURE__ */ React11.createElement("svg", { viewBox: "0 0 24 25", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React11.createElement(
381
+ "path",
382
+ {
383
+ 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",
384
+ fill: "#505050"
385
+ }
386
+ )),
387
+ campaign: /* @__PURE__ */ React11.createElement("svg", { viewBox: "0 0 24 25", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React11.createElement(
388
+ "path",
389
+ {
390
+ 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",
391
+ fill: "#505050"
392
+ }
393
+ )),
394
+ "chatbot-white-border": /* @__PURE__ */ React11.createElement("svg", { viewBox: "0 0 33 34", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React11.createElement(
395
+ "path",
396
+ {
397
+ 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",
398
+ fill: "#472D7A",
399
+ stroke: "white",
400
+ "stroke-width": "0.850077"
401
+ }
402
+ ), /* @__PURE__ */ React11.createElement(
403
+ "path",
404
+ {
405
+ 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",
406
+ fill: "white"
407
+ }
408
+ ), /* @__PURE__ */ React11.createElement(
409
+ "path",
410
+ {
411
+ 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",
412
+ fill: "white"
413
+ }
414
+ ), /* @__PURE__ */ React11.createElement(
415
+ "path",
416
+ {
417
+ 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",
418
+ fill: "white"
419
+ }
420
+ )),
421
+ dashboard: /* @__PURE__ */ React11.createElement("svg", { viewBox: "0 0 25 25", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React11.createElement(
422
+ "path",
423
+ {
424
+ 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",
425
+ fill: "#505050"
426
+ }
427
+ )),
428
+ discard: /* @__PURE__ */ React11.createElement("svg", { viewBox: "0 0 26 27", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React11.createElement(
429
+ "path",
430
+ {
431
+ 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",
432
+ fill: "#A3A3A3"
433
+ }
434
+ )),
435
+ "discard-red": /* @__PURE__ */ React11.createElement("svg", { viewBox: "0 0 26 26", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React11.createElement(
436
+ "path",
437
+ {
438
+ 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",
439
+ fill: "#D9363E"
440
+ }
441
+ ))
442
+ };
443
+
444
+ // src/Components/Button.tsx
320
445
  var ButtonElement = (props) => {
321
- return /* @__PURE__ */ React11.createElement(
446
+ const textColorClass = props.className?.match(/text-[\w-]+/g)?.[0] === "text-white";
447
+ return /* @__PURE__ */ React12.createElement(
322
448
  "button",
323
449
  {
324
- onClick: () => props.onClick && props.onClick(),
325
- className: `${props.className ? props.className : ""}`
450
+ onClick: props.onClick,
451
+ className: props.className ? props.className : "",
452
+ disabled: props.loading,
453
+ style: {
454
+ cursor: props.loading ? "no-drop" : "pointer"
455
+ }
326
456
  },
327
- props.icon && /* @__PURE__ */ React11.createElement("img", { className: props.iconsClassName, src: props.icon }),
457
+ /* @__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 {
458
+ filter: brightness(0) invert(1);
459
+ }`, `.${props.className?.match(/text-[\w-]+/g)?.[0]}:hover path {
460
+ filter: brightness(0) invert(1);
461
+ }`)),
328
462
  props.label
329
463
  );
330
464
  };
331
465
 
332
466
  // src/Components/AddMoreTable.tsx
333
- import React12, { useEffect, useState as useState4 } from "react";
467
+ import React13, { useEffect, useState as useState4 } from "react";
334
468
  import { Table, Button } from "antd";
335
469
  import { PlusOutlined, DeleteOutlined } from "@ant-design/icons";
336
470
  var AddMoreTable = (props) => {
@@ -401,15 +535,14 @@ var AddMoreTable = (props) => {
401
535
  });
402
536
  };
403
537
  useEffect(() => {
404
- console.log(rows);
405
538
  }, [rows]);
406
539
  const renderInputElement = (element, value) => {
407
540
  if (!element) return null;
408
541
  const { element: type, label } = element;
409
542
  if (type === "single-select") {
410
- return /* @__PURE__ */ React12.createElement(SingleSelectElement, { onChange: (value2) => console.log(label, value2), optionType: "", className: void 0, selectedStyle: false, style: false, options1: [], options2: [], firstOptions: [], secondOptions: [] });
543
+ return /* @__PURE__ */ React13.createElement(SingleSelectElement, { onChange: (value2) => console.log(label, value2), optionType: "", className: void 0, selectedStyle: false, style: false, options1: [], options2: [], firstOptions: [], secondOptions: [] });
411
544
  } else if (type === "textarea") {
412
- return /* @__PURE__ */ React12.createElement(TextareaElement, { onChange: (value2) => console.log(label, value2), optionType: "", className: void 0, selectedStyle: false, style: false, options1: [], options2: [], firstOptions: [], secondOptions: [] });
545
+ return /* @__PURE__ */ React13.createElement(TextareaElement, { onChange: (value2) => console.log(label, value2), optionType: "", className: void 0, selectedStyle: false, style: false, options1: [], options2: [], firstOptions: [], secondOptions: [] });
413
546
  } else {
414
547
  return null;
415
548
  }
@@ -426,13 +559,13 @@ var AddMoreTable = (props) => {
426
559
  eachRow.variable_data.forEach((variable, subIndex) => {
427
560
  Object.keys(variable).forEach((key) => {
428
561
  if (key === "SubRows") {
429
- 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)));
562
+ 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)));
430
563
  } else {
431
564
  rowData[`${key}`] = renderInputElement(variable[key]);
432
565
  }
433
566
  });
434
567
  });
435
- 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)));
568
+ 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)));
436
569
  console.log("=====rowdata", rowData);
437
570
  return rowData;
438
571
  });
@@ -448,7 +581,7 @@ var AddMoreTable = (props) => {
448
581
  key: "actions"
449
582
  });
450
583
  }
451
- return /* @__PURE__ */ React12.createElement(
584
+ return /* @__PURE__ */ React13.createElement(
452
585
  Table,
453
586
  {
454
587
  columns,
@@ -460,44 +593,53 @@ var AddMoreTable = (props) => {
460
593
  };
461
594
 
462
595
  // src/Components/Sidebar.tsx
463
- import React13 from "react";
596
+ import React14 from "react";
464
597
  var Sidebar = (props) => {
465
598
  const handleChange = (item) => {
466
599
  if (props.onChange) {
467
600
  props.onChange(item);
468
601
  }
469
602
  };
470
- return /* @__PURE__ */ React13.createElement("div", { className: props.className, key: props.name }, /* @__PURE__ */ React13.createElement("div", null, /* @__PURE__ */ React13.createElement("img", { src: props.img, alt: "logo" })), /* @__PURE__ */ React13.createElement("ul", { className: props.listClassName }, props.items?.map((item) => {
471
- return /* @__PURE__ */ React13.createElement("li", { onClick: () => {
472
- handleChange(item);
473
- }, key: item.label, className: `${props.listItemClassName} ${item.active && props.activeClassName}` }, /* @__PURE__ */ React13.createElement("img", { src: item.icon, className: props.className }), /* @__PURE__ */ React13.createElement("p", null, item.label));
603
+ 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) => {
604
+ return /* @__PURE__ */ React14.createElement(React14.Fragment, { key: item.label }, /* @__PURE__ */ React14.createElement(
605
+ ButtonElement,
606
+ {
607
+ ...item,
608
+ className: item.active ? props.activeClassName : props.className,
609
+ iconsClassName: props.iconsClassName,
610
+ onClick: (e) => {
611
+ e.preventDefault();
612
+ handleChange(item);
613
+ }
614
+ }
615
+ ));
474
616
  })));
475
617
  };
476
618
 
477
619
  // src/Components/Navbar.tsx
478
- import React17 from "react";
620
+ import React18 from "react";
479
621
 
480
622
  // src/Components/Notification.tsx
481
- import React14 from "react";
623
+ import React15 from "react";
482
624
  import { Popover, Badge, Button as Button2, Avatar, List } from "antd";
483
625
  import { IoIosNotifications } from "react-icons/io";
484
626
  var popoverContentStyle = {
485
627
  minWidth: "300px",
486
628
  maxWidth: "100%"
487
629
  };
488
- var Notification = (props) => /* @__PURE__ */ React14.createElement(
630
+ var Notification = (props) => /* @__PURE__ */ React15.createElement(
489
631
  Popover,
490
632
  {
491
633
  className: props.className,
492
- content: /* @__PURE__ */ React14.createElement("div", { style: popoverContentStyle }, " ", /* @__PURE__ */ React14.createElement(
634
+ content: /* @__PURE__ */ React15.createElement("div", { style: popoverContentStyle }, " ", /* @__PURE__ */ React15.createElement(
493
635
  List,
494
636
  {
495
637
  itemLayout: "horizontal",
496
638
  dataSource: props.items,
497
- renderItem: (item, index) => /* @__PURE__ */ React14.createElement(List.Item, { key: item.text }, /* @__PURE__ */ React14.createElement(
639
+ renderItem: (item, index) => /* @__PURE__ */ React15.createElement(List.Item, { key: item.text }, /* @__PURE__ */ React15.createElement(
498
640
  List.Item.Meta,
499
641
  {
500
- avatar: /* @__PURE__ */ React14.createElement(Avatar, { src: `https://api.dicebear.com/7.x/miniavs/svg?seed=${index}` }),
642
+ avatar: /* @__PURE__ */ React15.createElement(Avatar, { src: `https://api.dicebear.com/7.x/miniavs/svg?seed=${index}` }),
501
643
  title: item.text,
502
644
  description: item.time
503
645
  }
@@ -507,190 +649,133 @@ var Notification = (props) => /* @__PURE__ */ React14.createElement(
507
649
  trigger: "focus",
508
650
  placement: "bottomRight"
509
651
  },
510
- /* @__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))))
652
+ /* @__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))))
511
653
  );
512
654
 
513
655
  // src/Components/SpanElement.tsx
514
- import React15 from "react";
515
- var SpanElement = (props) => /* @__PURE__ */ React15.createElement("span", { className: props.className }, props.label);
656
+ import React16 from "react";
657
+ var SpanElement = (props) => /* @__PURE__ */ React16.createElement("span", { className: props.className }, props.label);
516
658
 
517
659
  // src/Components/Profile.tsx
518
- import React16 from "react";
660
+ import React17 from "react";
519
661
  import { Avatar as Avatar2 } from "antd";
520
662
  import { UserOutlined } from "@ant-design/icons";
521
- 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)));
663
+ 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)));
522
664
 
523
665
  // src/Components/Navbar.tsx
524
666
  var Navbar = (props) => {
525
- return /* @__PURE__ */ React17.createElement("div", { className: `${props.className}`, key: props.name }, props.items && props.items.map((item) => {
667
+ return /* @__PURE__ */ React18.createElement("div", { className: `${props.className}`, key: props.name }, props.items && props.items.map((item) => {
526
668
  if (item.element === "span") {
527
- return /* @__PURE__ */ React17.createElement(SpanElement, { ...item });
669
+ return /* @__PURE__ */ React18.createElement(SpanElement, { ...item });
528
670
  } else if (item.element === "notifications") {
529
- return /* @__PURE__ */ React17.createElement(Notification, { ...item });
671
+ return /* @__PURE__ */ React18.createElement(Notification, { ...item });
530
672
  } else if (item.name === "profile") {
531
- return /* @__PURE__ */ React17.createElement(Profile, { ...item });
673
+ return /* @__PURE__ */ React18.createElement(Profile, { ...item });
532
674
  }
533
675
  return null;
534
676
  }));
535
677
  };
536
678
 
537
679
  // src/Components/TableElement.tsx
538
- import React20, { useState as useState5 } from "react";
680
+ import React19, { useState as useState5, useEffect as useEffect2 } from "react";
539
681
  import { Table as Table2 } from "antd";
540
-
541
- // src/Components/Model.tsx
542
- import React19 from "react";
543
- import { Modal } from "antd";
544
-
545
- // src/Components/ModelBody.tsx
546
- import React18 from "react";
547
- var ModelBody = (props) => {
548
- return /* @__PURE__ */ React18.createElement("div", { className: props.modalContent && props.modalContent.className }, props.modalContent && props.modalContent.fields.map((eachField) => {
549
- if (eachField.element === "div") {
550
- return /* @__PURE__ */ React18.createElement("div", { className: eachField.className }, eachField.label);
551
- } else if (eachField.element === "input-radio") {
552
- return /* @__PURE__ */ React18.createElement("div", { className: eachField.className }, /* @__PURE__ */ React18.createElement(RadioElement, { ...eachField }));
553
- } else if (eachField.element === "button") {
554
- return /* @__PURE__ */ React18.createElement("div", { className: eachField.className }, /* @__PURE__ */ React18.createElement(ButtonElement, { ...eachField }));
555
- } else {
556
- return null;
557
- }
558
- }));
559
- };
560
-
561
- // src/Components/Model.tsx
562
- var ModelElement = (props) => {
563
- const { model, onCancel, selectedRecord, columns } = props;
564
- return /* @__PURE__ */ React19.createElement(
565
- Modal,
566
- {
567
- centered: true,
568
- open: model,
569
- onCancel,
570
- footer: null,
571
- width: 850,
572
- title: /* @__PURE__ */ React19.createElement(
573
- "div",
574
- {
575
- style: {
576
- display: "flex",
577
- flexWrap: "wrap",
578
- padding: "20px",
579
- width: "full",
580
- margin: "-10px"
581
- }
582
- },
583
- Object.entries(selectedRecord).map(([key, value]) => {
584
- const record = columns.filter((eachColumn) => eachColumn.key === key);
585
- 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)) : "";
586
- })
587
- )
588
- },
589
- /* @__PURE__ */ React19.createElement(ModelBody, { ...props })
590
- );
591
- };
592
-
593
- // src/Components/TableElement.tsx
594
682
  var TableElement = (props) => {
595
683
  const { thead, tbody } = props;
596
- const [selectedRecord, setSelectedRecord] = useState5({});
597
- const [model, setModel] = useState5(false);
598
- const [selectedRowKeys, setSelectedRowKeys] = useState5([]);
599
- const handleChange = (record) => {
600
- console.log("record", record);
601
- if (props.onChange) {
602
- props.onChange(record);
684
+ const [dataSource, setDataSource] = useState5([]);
685
+ useEffect2(() => {
686
+ if (tbody) {
687
+ setDataSource(
688
+ tbody.map((row, index) => ({
689
+ ...row,
690
+ key: index,
691
+ index: index + 1
692
+ }))
693
+ );
603
694
  }
604
- };
695
+ }, [tbody]);
605
696
  let columns = [];
606
697
  if (thead) {
607
698
  columns = [
608
699
  {
609
700
  title: "#",
610
- dataIndex: "#",
611
- key: "#"
701
+ dataIndex: "index",
702
+ key: "index",
703
+ fixed: "left"
612
704
  },
613
705
  ...thead.map((col, ind) => ({
614
706
  title: col.label,
615
707
  dataIndex: col.name,
616
708
  key: col.key,
709
+ ellipsis: col.ellipsis,
617
710
  render: col.render,
618
711
  sorter: {
619
712
  compare: (a, b) => {
620
- if (typeof a[col.key] === "number" && typeof a[col.key] === "number") {
713
+ if (typeof a[col.key] === "number" && typeof b[col.key] === "number") {
621
714
  return a[col.key] - b[col.key];
622
- } else if (typeof a[col.key] === "string" && typeof a[col.key] === "string") {
715
+ } else if (typeof a[col.key] === "string" && typeof b[col.key] === "string") {
623
716
  return a[col.key].localeCompare(b[col.key]);
624
717
  }
625
718
  }
626
719
  }
627
- })),
628
- {
629
- title: "View",
630
- dataIndex: "View",
631
- key: "View",
632
- render: (_, record) => /* @__PURE__ */ React20.createElement(
633
- "a",
634
- {
635
- onClick: () => {
636
- setSelectedRecord(record);
637
- handleChange(record);
638
- setModel(true);
639
- }
640
- },
641
- "View"
642
- )
643
- }
720
+ }))
644
721
  ];
645
722
  }
646
- const dataSource = tbody && tbody.map((row, index) => ({
647
- ...row,
648
- [columns[0].key]: index + 1
649
- }));
650
- const count = dataSource ? dataSource.length : 0;
723
+ const onChangeTable = (pagination, filters, sorter, extra) => {
724
+ if (extra && extra.currentDataSource) {
725
+ setDataSource(
726
+ extra.currentDataSource.map((row, index) => ({
727
+ ...row,
728
+ index: index + 1
729
+ }))
730
+ );
731
+ }
732
+ };
651
733
  const onChangePage = (page, pageSize) => {
652
734
  if (props.onChange) {
653
735
  props.onChange({ name: "pagination", page, pageSize });
654
736
  }
655
737
  };
656
- const onSelectChange = (newSelectedRowKeys) => {
657
- console.log("selectedRowKeys changed: ", newSelectedRowKeys);
658
- setSelectedRowKeys(newSelectedRowKeys);
659
- };
660
738
  const rowSelectionConfig = props.rowSelection ? {
661
- selectedRowKeys,
662
- onChange: onSelectChange
739
+ onChange: (selectedRowKeys, selectedRows) => {
740
+ if (props.onChange) {
741
+ props.onChange(selectedRows);
742
+ }
743
+ }
663
744
  } : void 0;
664
- return /* @__PURE__ */ React20.createElement(React20.Fragment, null, /* @__PURE__ */ React20.createElement(
745
+ return /* @__PURE__ */ React19.createElement(React19.Fragment, null, /* @__PURE__ */ React19.createElement(
665
746
  Table2,
666
747
  {
667
- pagination: {
748
+ loading: props.loading,
749
+ className: props.className,
750
+ pagination: props.pagination ? {
751
+ current: props.value && props.value.page && props.value.page,
668
752
  showTotal: (total) => `Total: ${total} items`,
669
- total: count,
670
- showSizeChanger: count > 10,
753
+ total: props.count,
754
+ showSizeChanger: props.count ? props.count > 10 : 0 > 10,
671
755
  onChange: onChangePage
672
- },
756
+ } : false,
757
+ rowSelection: rowSelectionConfig,
673
758
  dataSource,
674
759
  columns,
760
+ size: props.size,
675
761
  bordered: true,
676
- rowSelection: rowSelectionConfig,
677
- size: props.size && props.size
762
+ onChange: onChangeTable
678
763
  }
679
- ), model && /* @__PURE__ */ React20.createElement(ModelElement, { selectedRecord, ...props, columns, model, onCancel: () => setModel(false) }));
764
+ ));
680
765
  };
681
766
 
682
767
  // src/Components/DatePicker.tsx
683
- import React21, { useState as useState6 } from "react";
768
+ import React20, { useState as useState6 } from "react";
684
769
  import { DatePicker } from "antd";
685
770
  import dayjs from "dayjs";
686
771
  import customParseFormat from "dayjs/plugin/customParseFormat.js";
772
+ import moment from "moment";
687
773
  dayjs.extend(customParseFormat);
688
774
  var DatePickerElement = (props) => {
689
775
  const [dateState, setDateState] = useState6("");
690
- const dateFormat = "DD/MM/YYYY";
691
776
  const handleChange = (date, dateString) => {
692
777
  if (date) {
693
- const formattedDate = date.format(dateFormat);
778
+ const formattedDate = dateString;
694
779
  setDateState(date);
695
780
  if (props.onChange) {
696
781
  props.onChange(formattedDate);
@@ -702,48 +787,105 @@ var DatePickerElement = (props) => {
702
787
  }
703
788
  }
704
789
  };
705
- return /* @__PURE__ */ React21.createElement("div", null, /* @__PURE__ */ React21.createElement(
790
+ const disabledDate = (current) => {
791
+ return current && current > moment();
792
+ };
793
+ return /* @__PURE__ */ React20.createElement("div", null, /* @__PURE__ */ React20.createElement(
706
794
  DatePicker,
707
795
  {
796
+ disabledDate,
708
797
  placeholder: props.placeholder,
709
- value: dayjs(dateState, dateFormat),
710
- format: dateFormat,
711
- variant: "borderless",
712
- onChange: handleChange
798
+ value: dateState,
799
+ format: { format: "DD-MM-YYYY" },
800
+ onChange: handleChange,
801
+ picker: props.picker
713
802
  }
714
803
  ));
715
804
  };
716
805
 
717
806
  // src/Components/DateRangePickerElement.tsx
718
- import React22 from "react";
807
+ import React21 from "react";
719
808
  import { DatePicker as DatePicker2, Space } from "antd";
720
809
  import dayjs2 from "dayjs";
810
+ import moment2 from "moment";
721
811
  var DateRangePickerElement = (props) => {
812
+ const { value } = props;
722
813
  const { RangePicker } = DatePicker2;
814
+ const dateValues = value ? value.map((date) => dayjs2(date, "DD-MM-YYYY")) : null;
723
815
  const handleChange = (dates, dateStrings) => {
724
- if (dates && props.onChange) {
725
- props.onChange(dateStrings);
816
+ if (dates) {
817
+ let [start, end] = dates;
818
+ const today2 = dayjs2();
819
+ if (end && end.isAfter(today2)) {
820
+ end = today2;
821
+ }
822
+ if (start && start.isAfter(today2)) {
823
+ start = today2;
824
+ }
825
+ const adjustedDates = [start, end].map((date) => date ? date.format("DD-MM-YYYY") : null);
826
+ props.onChange && props.onChange(adjustedDates);
726
827
  } else {
727
- console.log("Clear");
828
+ props.onChange && props.onChange("");
728
829
  }
729
830
  };
730
- const rangePresets = [
731
- { label: "Last 7 Days", value: [dayjs2().add(-7, "d"), dayjs2()] },
732
- { label: "Last 14 Days", value: [dayjs2().add(-14, "d"), dayjs2()] },
733
- { label: "Last 30 Days", value: [dayjs2().add(-30, "d"), dayjs2()] },
734
- { label: "Last 90 Days", value: [dayjs2().add(-90, "d"), dayjs2()] }
831
+ const today = dayjs2();
832
+ let rangePresets = [
833
+ { label: "Last 7 Days", value: [dayjs2().subtract(6, "d"), today] },
834
+ { label: "Last 14 Days", value: [dayjs2().subtract(13, "d"), today] },
835
+ { label: "Last 30 Days", value: [dayjs2().subtract(29, "d"), today] },
836
+ { label: "Last 90 Days", value: [dayjs2().subtract(89, "d"), today] }
735
837
  ];
736
- return /* @__PURE__ */ React22.createElement(Space, { direction: "vertical", size: 12 }, /* @__PURE__ */ React22.createElement(RangePicker, { presets: rangePresets, onChange: handleChange }));
838
+ let disabledDate;
839
+ if (props.weekrange) {
840
+ disabledDate = (current) => {
841
+ if (props.weekrange) {
842
+ return current && (current < today.subtract(7, "d") || current > today.add(7, "d"));
843
+ }
844
+ return current && (current > today.add(7, "d") || current < today.subtract(7, "d"));
845
+ };
846
+ } else {
847
+ disabledDate = (current) => {
848
+ return current && current > moment2();
849
+ };
850
+ }
851
+ const handleCalendarChange = (dates) => {
852
+ if (dates) {
853
+ let [start, end] = dates;
854
+ const today2 = dayjs2();
855
+ if (end && end.isAfter(today2)) {
856
+ end = today2;
857
+ }
858
+ if (start && start.isAfter(today2)) {
859
+ start = today2;
860
+ }
861
+ if (start && start.isBefore(today2)) {
862
+ end = today2;
863
+ }
864
+ const adjustedDates = [start, end].map((date) => date ? date : null);
865
+ props.onChange && props.onChange(adjustedDates);
866
+ }
867
+ };
868
+ return /* @__PURE__ */ React21.createElement(Space, { direction: "vertical", size: 12 }, /* @__PURE__ */ React21.createElement(
869
+ RangePicker,
870
+ {
871
+ disabledDate,
872
+ ...!props.weekrange && { presets: rangePresets },
873
+ format: "DD-MM-YYYY",
874
+ onChange: handleChange,
875
+ onCalendarChange: handleCalendarChange,
876
+ value: dateValues
877
+ }
878
+ ));
737
879
  };
738
880
 
739
881
  // src/Components/Image.tsx
740
- import React23 from "react";
882
+ import React22 from "react";
741
883
  var Image = (props) => {
742
- return /* @__PURE__ */ React23.createElement("div", null, /* @__PURE__ */ React23.createElement("img", { className: props.className, src: props.img, alt: "image" }));
884
+ return /* @__PURE__ */ React22.createElement("img", { className: props.className, src: props.img, alt: "image" });
743
885
  };
744
886
 
745
887
  // src/Components/SingleCheckbox.tsx
746
- import React24 from "react";
888
+ import React23 from "react";
747
889
  import { Checkbox as Checkbox2 } from "antd";
748
890
  var SingleCheckbox = (props) => {
749
891
  const handleChange = (e) => {
@@ -751,11 +893,11 @@ var SingleCheckbox = (props) => {
751
893
  props.onChange(e.target.checked);
752
894
  }
753
895
  };
754
- return /* @__PURE__ */ React24.createElement(Checkbox2, { onChange: (e) => handleChange(e), className: props.className }, props.label);
896
+ return /* @__PURE__ */ React23.createElement(Checkbox2, { onChange: (e) => handleChange(e), className: props.className }, props.label);
755
897
  };
756
898
 
757
899
  // src/Components/DropDownGroup.tsx
758
- import React25, { useState as useState7 } from "react";
900
+ import React24, { useState as useState7 } from "react";
759
901
  import { Select as Select4 } from "antd";
760
902
  var DropDownGroup = (props) => {
761
903
  const [selectedValue, setSelectedValue] = useState7({
@@ -790,27 +932,37 @@ var DropDownGroup = (props) => {
790
932
  return newValue;
791
933
  });
792
934
  };
793
- 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(
935
+ const firstFilterOptions = (input, option) => {
936
+ return (option?.label ?? "").toLowerCase().includes(input.toLowerCase());
937
+ };
938
+ const secondFilterOptions = (input, option) => {
939
+ return (option?.label ?? "").toLowerCase().includes(input.toLowerCase());
940
+ };
941
+ 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(
794
942
  Select4,
795
943
  {
796
944
  onChange: handleFirstChange,
797
945
  variant: props.variant,
798
946
  options: props.firstOptions,
799
- className: props.className
947
+ className: props.className,
948
+ filterOption: firstFilterOptions,
949
+ showSearch: true
800
950
  }
801
- ), /* @__PURE__ */ React25.createElement("div", { style: { borderLeft: "1px solid gray", height: "33px" } }), /* @__PURE__ */ React25.createElement(
951
+ ), /* @__PURE__ */ React24.createElement("div", { style: { borderLeft: "1px solid gray", height: "33px" } }), /* @__PURE__ */ React24.createElement(
802
952
  Select4,
803
953
  {
804
954
  onChange: handleSecondChange,
805
955
  variant: props.variant,
806
956
  options: props.secondOptions,
807
- className: props.className
957
+ className: props.className,
958
+ filterOption: secondFilterOptions,
959
+ showSearch: true
808
960
  }
809
961
  )));
810
962
  };
811
963
 
812
964
  // src/Components/FilesUpload.tsx
813
- import React26, { useState as useState8 } from "react";
965
+ import React25, { useState as useState8 } from "react";
814
966
  import { Upload } from "antd";
815
967
  import { InboxOutlined } from "@ant-design/icons";
816
968
  var FileUpload = (props) => {
@@ -830,7 +982,7 @@ var FileUpload = (props) => {
830
982
  onSuccess("ok");
831
983
  }, 0);
832
984
  };
833
- return /* @__PURE__ */ React26.createElement("div", null, /* @__PURE__ */ React26.createElement(
985
+ return /* @__PURE__ */ React25.createElement("div", null, /* @__PURE__ */ React25.createElement(
834
986
  Dragger,
835
987
  {
836
988
  action: "",
@@ -843,13 +995,13 @@ var FileUpload = (props) => {
843
995
  showUploadList: true,
844
996
  customRequest
845
997
  },
846
- /* @__PURE__ */ React26.createElement("p", null, /* @__PURE__ */ React26.createElement(InboxOutlined, null)),
847
- /* @__PURE__ */ React26.createElement("p", null, "Click or drag file to upload")
998
+ /* @__PURE__ */ React25.createElement("p", null, /* @__PURE__ */ React25.createElement(InboxOutlined, null)),
999
+ /* @__PURE__ */ React25.createElement("p", null, "Click or drag file to upload")
848
1000
  ));
849
1001
  };
850
1002
 
851
1003
  // src/Components/TabsElement.tsx
852
- import React27 from "react";
1004
+ import React26 from "react";
853
1005
  import { Tabs } from "antd";
854
1006
  var TabsElement = (props) => {
855
1007
  const handleChange = (key) => {
@@ -857,32 +1009,584 @@ var TabsElement = (props) => {
857
1009
  props.onChange(props.options?.find((eachOption) => eachOption.key === key));
858
1010
  }
859
1011
  };
860
- return /* @__PURE__ */ React27.createElement(Tabs, { className: props.containerClassName, items: props.options, onChange: handleChange });
1012
+ return /* @__PURE__ */ React26.createElement(Tabs, { className: props.containerClassName, items: props.options, onChange: handleChange });
861
1013
  };
862
1014
 
863
1015
  // src/Components/SwitchElement.tsx
864
- import React28 from "react";
1016
+ import React27 from "react";
865
1017
  import { Switch } from "antd";
866
1018
  var onChange = (checked) => {
867
- console.log(`switch to ${checked}`);
868
1019
  };
869
- var SwitchElement = () => /* @__PURE__ */ React28.createElement(Switch, { defaultChecked: true, onChange });
1020
+ var SwitchElement = () => /* @__PURE__ */ React27.createElement(Switch, { defaultChecked: true, onChange });
1021
+
1022
+ // src/Components/Upload.tsx
1023
+ import React28, { useState as useState9 } from "react";
1024
+ var Upload2 = (props) => {
1025
+ const [file, setFile] = useState9();
1026
+ const handleFileChange = (e) => {
1027
+ setFile(e.target.files[0]);
1028
+ if (props.onChange) {
1029
+ props.onChange(e.target.files[0]);
1030
+ }
1031
+ };
1032
+ const handleUpload = async () => {
1033
+ if (!file) {
1034
+ return;
1035
+ }
1036
+ };
1037
+ return /* @__PURE__ */ React28.createElement("div", { style: { marginTop: 16 } }, /* @__PURE__ */ React28.createElement("input", { type: "file", onChange: handleFileChange }), /* @__PURE__ */ React28.createElement(
1038
+ "button",
1039
+ {
1040
+ type: "button",
1041
+ onClick: handleUpload,
1042
+ disabled: !file,
1043
+ style: { marginTop: 16 }
1044
+ },
1045
+ "Upload"
1046
+ ));
1047
+ };
1048
+
1049
+ // src/Components/OtpElement.tsx
1050
+ import React29, { useState as useState10, useRef, useEffect as useEffect3 } from "react";
1051
+ import { Input as Input3 } from "antd";
1052
+ var OtpElement = (props) => {
1053
+ const length = props.length;
1054
+ const [otp, setOtp] = useState10(Array(length).fill(""));
1055
+ const inputRefs = useRef([]);
1056
+ const handleChange = (e, index) => {
1057
+ const value = e.target.value;
1058
+ if (/^[0-9]$/.test(value) || value === "") {
1059
+ const newOtp = [...otp];
1060
+ newOtp[index] = value;
1061
+ setOtp(newOtp);
1062
+ props.onChange && props.onChange(newOtp.join(""));
1063
+ if (value && index < length - 1) {
1064
+ inputRefs.current[index + 1]?.focus();
1065
+ }
1066
+ }
1067
+ };
1068
+ const handleKeyDown = (e, index) => {
1069
+ if (e.key === "Backspace" && !otp[index] && index > 0) {
1070
+ inputRefs.current[index - 1]?.focus();
1071
+ }
1072
+ };
1073
+ const handlePaste = (e) => {
1074
+ e.preventDefault();
1075
+ const pasteData = e.clipboardData.getData("text");
1076
+ if (/^\d+$/.test(pasteData)) {
1077
+ const newOtp = pasteData.split("").slice(0, length);
1078
+ setOtp(newOtp.concat(Array(length - newOtp.length).fill("")));
1079
+ props.onChange && props.onChange(newOtp.join(""));
1080
+ newOtp.forEach((_, idx) => {
1081
+ if (inputRefs.current[idx]) {
1082
+ inputRefs.current[idx]?.focus();
1083
+ }
1084
+ });
1085
+ }
1086
+ };
1087
+ useEffect3(() => {
1088
+ inputRefs.current[0]?.focus();
1089
+ }, []);
1090
+ return /* @__PURE__ */ React29.createElement("div", { className: props.containerClassName }, Array.from({ length }).map((_, index) => /* @__PURE__ */ React29.createElement(
1091
+ Input3,
1092
+ {
1093
+ key: index,
1094
+ className: props.className,
1095
+ maxLength: 1,
1096
+ value: otp[index],
1097
+ onChange: (e) => handleChange(e, index),
1098
+ onKeyDown: (e) => handleKeyDown(e, index),
1099
+ onPaste: handlePaste,
1100
+ ref: (el) => inputRefs.current[index] = el
1101
+ }
1102
+ )));
1103
+ };
1104
+
1105
+ // src/Components/CircleDonut.tsx
1106
+ import React30 from "react";
1107
+ import { Doughnut } from "react-chartjs-2";
1108
+ import {
1109
+ Chart as ChartJS,
1110
+ DoughnutController,
1111
+ ArcElement,
1112
+ Tooltip,
1113
+ Legend
1114
+ } from "chart.js";
1115
+ ChartJS.register(DoughnutController, ArcElement, Tooltip, Legend);
1116
+ var CircleDonut = (props) => {
1117
+ const data = {
1118
+ labels: props.labels,
1119
+ datasets: [
1120
+ {
1121
+ label: "Bot Conversation",
1122
+ data: props.data,
1123
+ backgroundColor: [
1124
+ "#FFCB8A",
1125
+ "#CADBBF",
1126
+ "#8AC1BB",
1127
+ "#FCB0CB",
1128
+ "#CEB0FA"
1129
+ ],
1130
+ borderWidth: 0
1131
+ }
1132
+ ]
1133
+ };
1134
+ const options = {
1135
+ responsive: true,
1136
+ cutout: "80%",
1137
+ plugins: {
1138
+ legend: {
1139
+ position: "left",
1140
+ labels: {
1141
+ font: {
1142
+ size: 10
1143
+ },
1144
+ boxWidth: 15,
1145
+ generateLabels: (chart) => {
1146
+ const dataset = chart.data.datasets[0];
1147
+ return chart.data.labels.map((label, index) => {
1148
+ const value = dataset.data[index];
1149
+ return {
1150
+ text: `${label}: ${value}`,
1151
+ fillStyle: dataset.backgroundColor[index]
1152
+ };
1153
+ });
1154
+ }
1155
+ }
1156
+ },
1157
+ tooltip: {
1158
+ enabled: true,
1159
+ callbacks: {
1160
+ label: function(context) {
1161
+ const label = context.label || "";
1162
+ const value = context.raw || 0;
1163
+ return `${label}: ${value}`;
1164
+ }
1165
+ }
1166
+ }
1167
+ }
1168
+ };
1169
+ const centerTextPlugin = {
1170
+ id: "centerText",
1171
+ beforeDraw: (chart) => {
1172
+ const { ctx, chartArea: { left, right, top, bottom } } = chart;
1173
+ const width = right - left;
1174
+ const height = bottom - top;
1175
+ const centerX = left + width / 2;
1176
+ const centerY = top + height / 2;
1177
+ ctx.save();
1178
+ ctx.font = "7px Arial";
1179
+ ctx.fillStyle = "blue";
1180
+ ctx.textAlign = "center";
1181
+ ctx.textBaseline = "middle";
1182
+ ctx.fillText("Total Sessions", centerX, centerY - 10);
1183
+ ctx.font = "25px Arial";
1184
+ ctx.fillStyle = "black";
1185
+ ctx.fillText("85", centerX, centerY + 20);
1186
+ ctx.restore();
1187
+ }
1188
+ };
1189
+ 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] }));
1190
+ };
1191
+
1192
+ // src/Components/SemiCircleDonut.tsx
1193
+ import React31 from "react";
1194
+ import { Doughnut as Doughnut2 } from "react-chartjs-2";
1195
+ import {
1196
+ Chart as ChartJS2,
1197
+ DoughnutController as DoughnutController2,
1198
+ ArcElement as ArcElement2,
1199
+ Tooltip as Tooltip2,
1200
+ Legend as Legend2
1201
+ } from "chart.js";
1202
+ ChartJS2.register(DoughnutController2, ArcElement2, Tooltip2, Legend2);
1203
+ var SemiCircleDonut = (props) => {
1204
+ const data = {
1205
+ labels: [
1206
+ "Registration",
1207
+ "Book Appointment",
1208
+ "Diagnostic Tests",
1209
+ "Hospital Facility",
1210
+ "Others, Prescriptions"
1211
+ ],
1212
+ datasets: [
1213
+ {
1214
+ label: "Bot Conversation",
1215
+ data: [30, 10, 27, 40, 12],
1216
+ backgroundColor: [
1217
+ "#FFCB8A",
1218
+ "#CADBBF",
1219
+ "#8AC1BB",
1220
+ "#FCB0CB",
1221
+ "#CEB0FA"
1222
+ ],
1223
+ borderWidth: 0
1224
+ }
1225
+ ]
1226
+ };
1227
+ const options = {
1228
+ responsive: true,
1229
+ circumference: 180,
1230
+ rotation: -90,
1231
+ cutout: "80%",
1232
+ plugins: {
1233
+ legend: {
1234
+ display: false
1235
+ // Disable the legend
1236
+ },
1237
+ tooltip: {
1238
+ enabled: true,
1239
+ callbacks: {
1240
+ label: function(context) {
1241
+ const label = context.label || "";
1242
+ const value = context.raw || 0;
1243
+ return `${label}: ${value}`;
1244
+ }
1245
+ }
1246
+ }
1247
+ }
1248
+ };
1249
+ const centerTextPlugin = {
1250
+ id: "centerText",
1251
+ beforeDraw: (chart) => {
1252
+ const { ctx, chartArea: { left, right, top, bottom } } = chart;
1253
+ const width = right - left;
1254
+ const height = bottom - top;
1255
+ const centerX = left + width / 2;
1256
+ const centerY = top + height / 1.5;
1257
+ const maxWidth = width * 0.8;
1258
+ ctx.save();
1259
+ ctx.fillStyle = "black";
1260
+ ctx.textAlign = "center";
1261
+ ctx.textBaseline = "middle";
1262
+ const drawText = (text, y, fontSize) => {
1263
+ ctx.font = `${fontSize}px Arial`;
1264
+ const textWidth = ctx.measureText(text).width;
1265
+ if (textWidth > maxWidth) {
1266
+ const newFontSize = fontSize * maxWidth / textWidth;
1267
+ ctx.font = `${newFontSize}px Arial`;
1268
+ }
1269
+ ctx.fillText(text, centerX, y);
1270
+ };
1271
+ drawText(props.fillText1, centerY - 10, 16);
1272
+ drawText(props.fillText2, centerY + 20, 8);
1273
+ ctx.restore();
1274
+ }
1275
+ };
1276
+ 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] }));
1277
+ };
1278
+
1279
+ // src/Components/HorizontalBarChart.tsx
1280
+ import React32 from "react";
1281
+ import { Bar } from "react-chartjs-2";
1282
+ import {
1283
+ Chart as ChartJS3,
1284
+ BarElement,
1285
+ CategoryScale,
1286
+ LinearScale,
1287
+ Tooltip as Tooltip3
1288
+ } from "chart.js";
1289
+ ChartJS3.register(BarElement, CategoryScale, LinearScale, Tooltip3);
1290
+ var HorizontalBarChart = (props) => {
1291
+ const data = {
1292
+ labels: ["18-24", "25-34", "35-44", "45-54", "55-64", "65+"],
1293
+ datasets: [
1294
+ {
1295
+ data: [30, 10, 27, 40, 12, 24],
1296
+ backgroundColor: "#6298D5",
1297
+ barThickness: 15
1298
+ }
1299
+ ]
1300
+ };
1301
+ const options = {
1302
+ responsive: true,
1303
+ indexAxis: "y",
1304
+ scales: {
1305
+ x: {
1306
+ beginAtZero: true,
1307
+ ticks: {
1308
+ callback: function(value) {
1309
+ return `${value}%`;
1310
+ }
1311
+ }
1312
+ },
1313
+ y: {
1314
+ grid: {
1315
+ display: false
1316
+ }
1317
+ }
1318
+ },
1319
+ plugins: {
1320
+ tooltip: {
1321
+ enabled: true,
1322
+ callbacks: {
1323
+ label: function(context) {
1324
+ const label = context.label || "";
1325
+ const value = context.raw || 0;
1326
+ return `${label}: ${value}`;
1327
+ }
1328
+ }
1329
+ },
1330
+ legend: {
1331
+ display: false
1332
+ }
1333
+ }
1334
+ };
1335
+ return /* @__PURE__ */ React32.createElement("div", { className: props.className }, /* @__PURE__ */ React32.createElement("h1", { className: props.labelClassName }, props.label), /* @__PURE__ */ React32.createElement(Bar, { data, options }));
1336
+ };
1337
+
1338
+ // src/Components/LineChart.tsx
1339
+ import React33, { useEffect as useEffect4, useRef as useRef2 } from "react";
1340
+ import Chart from "chart.js/auto";
1341
+ var LineChart = (props) => {
1342
+ const chartRef = useRef2(null);
1343
+ const chartInstance = useRef2(null);
1344
+ const data = [
1345
+ { label: "ROI", data: [10, 13, 20, 15, 10] },
1346
+ { label: "Engagement Rate", data: [20, 23, 30, 28, 20] },
1347
+ { label: "Conversion Rate", data: [50, 100, 150, 180, 50] }
1348
+ ];
1349
+ const labels = ["Instagram", "Whatsapp", "Messages", "Telegram", "Linkedin"];
1350
+ useEffect4(() => {
1351
+ if (chartRef.current) {
1352
+ if (chartInstance.current) {
1353
+ chartInstance.current.destroy();
1354
+ }
1355
+ chartInstance.current = new Chart(chartRef.current, {
1356
+ type: "line",
1357
+ data: {
1358
+ labels,
1359
+ datasets: data.map((dataset, index) => ({
1360
+ label: dataset.label,
1361
+ data: dataset.data,
1362
+ borderColor: index === 0 ? "#FF8F00" : index === 1 ? "#F50057" : "#254AAA",
1363
+ backgroundColor: "rgba(0, 0, 0, 0)",
1364
+ pointBackgroundColor: index === 0 ? "#FF8F00" : index === 1 ? "#F50057" : "#254AAA",
1365
+ pointBorderColor: "white",
1366
+ pointStyle: "circle",
1367
+ pointRadius: 3,
1368
+ tension: 0.1,
1369
+ fill: true
1370
+ }))
1371
+ },
1372
+ options: {
1373
+ plugins: {
1374
+ legend: {
1375
+ labels: {
1376
+ usePointStyle: true
1377
+ }
1378
+ }
1379
+ },
1380
+ scales: {
1381
+ x: {
1382
+ grid: {
1383
+ display: false
1384
+ }
1385
+ },
1386
+ y: {
1387
+ beginAtZero: true,
1388
+ suggestedMax: 200,
1389
+ ticks: {
1390
+ callback: function(value) {
1391
+ return value + "%";
1392
+ }
1393
+ },
1394
+ grid: {
1395
+ display: true
1396
+ }
1397
+ }
1398
+ }
1399
+ }
1400
+ });
1401
+ }
1402
+ return () => {
1403
+ if (chartInstance.current) {
1404
+ chartInstance.current.destroy();
1405
+ }
1406
+ };
1407
+ }, [labels, data]);
1408
+ return /* @__PURE__ */ React33.createElement("div", { className: props.className }, /* @__PURE__ */ React33.createElement("canvas", { ref: chartRef }));
1409
+ };
1410
+
1411
+ // src/Components/DoubleBarChart.tsx
1412
+ import React34, { useEffect as useEffect5, useRef as useRef3 } from "react";
1413
+ import Chart2 from "chart.js/auto";
1414
+ var DoubleBarChart = (props) => {
1415
+ const chartRef = useRef3(null);
1416
+ const chartInstance = useRef3(null);
1417
+ useEffect5(() => {
1418
+ if (chartRef.current) {
1419
+ if (chartInstance.current) {
1420
+ chartInstance.current.destroy();
1421
+ }
1422
+ chartInstance.current = new Chart2(chartRef.current, {
1423
+ type: "bar",
1424
+ data: {
1425
+ labels: [
1426
+ "Summer Health Tips",
1427
+ "New Services Launch",
1428
+ "Discounts on Checkups",
1429
+ "Wellness Webinar",
1430
+ "LinkedIn Insights"
1431
+ ],
1432
+ datasets: [
1433
+ {
1434
+ label: "Engagement Rate",
1435
+ data: [60, 70, 50, 80, 65],
1436
+ // Example data for male
1437
+ backgroundColor: "#93B8E2",
1438
+ barThickness: 10
1439
+ },
1440
+ {
1441
+ label: "Conversion Rate",
1442
+ data: [70, 65, 75, 55, 85],
1443
+ // Example data for female
1444
+ backgroundColor: "#4484CD",
1445
+ barThickness: 10
1446
+ }
1447
+ ]
1448
+ },
1449
+ options: {
1450
+ scales: {
1451
+ x: {
1452
+ grid: {
1453
+ display: false
1454
+ // Display x-axis grid lines
1455
+ }
1456
+ },
1457
+ y: {
1458
+ beginAtZero: true,
1459
+ suggestedMax: 100,
1460
+ ticks: {
1461
+ callback: function(value) {
1462
+ return value + "%";
1463
+ }
1464
+ },
1465
+ grid: {
1466
+ display: true
1467
+ }
1468
+ }
1469
+ },
1470
+ plugins: {
1471
+ legend: {
1472
+ labels: {
1473
+ usePointStyle: true
1474
+ }
1475
+ }
1476
+ }
1477
+ }
1478
+ });
1479
+ }
1480
+ return () => {
1481
+ if (chartInstance.current) {
1482
+ chartInstance.current.destroy();
1483
+ }
1484
+ };
1485
+ }, []);
1486
+ return /* @__PURE__ */ React34.createElement("div", { className: props.className }, /* @__PURE__ */ React34.createElement("h1", { className: props.labelClassName }, props.label), /* @__PURE__ */ React34.createElement("canvas", { ref: chartRef }));
1487
+ };
1488
+
1489
+ // src/Components/BarChart.tsx
1490
+ import React35 from "react";
1491
+ import { Bar as Bar2 } from "react-chartjs-2";
1492
+ import {
1493
+ Chart as ChartJS4,
1494
+ BarElement as BarElement2,
1495
+ CategoryScale as CategoryScale2,
1496
+ LinearScale as LinearScale2,
1497
+ Tooltip as Tooltip4
1498
+ } from "chart.js";
1499
+ ChartJS4.register(BarElement2, CategoryScale2, LinearScale2, Tooltip4);
1500
+ var BarChart = (props) => {
1501
+ const data = {
1502
+ labels: [
1503
+ "17 June",
1504
+ "18 June",
1505
+ "19 June",
1506
+ "20 June",
1507
+ "21 June",
1508
+ "22 June",
1509
+ "23 June"
1510
+ ],
1511
+ datasets: [
1512
+ {
1513
+ data: [30, 100, 270, 140, 120, 240],
1514
+ backgroundColor: "#1565C0",
1515
+ barThickness: 15
1516
+ }
1517
+ ]
1518
+ };
1519
+ const options = {
1520
+ responsive: true,
1521
+ scales: {
1522
+ x: {
1523
+ beginAtZero: true,
1524
+ grid: {
1525
+ display: false
1526
+ }
1527
+ },
1528
+ y: {
1529
+ grid: {
1530
+ display: true
1531
+ },
1532
+ ticks: {
1533
+ min: 0,
1534
+ max: 400,
1535
+ stepSize: 200,
1536
+ callback: function(value) {
1537
+ return `${value}`;
1538
+ }
1539
+ }
1540
+ }
1541
+ },
1542
+ plugins: {
1543
+ tooltip: {
1544
+ enabled: true,
1545
+ callbacks: {
1546
+ label: function(context) {
1547
+ const label = context.label || "";
1548
+ const value = context.raw || 0;
1549
+ return ` ${label}: ${value}`;
1550
+ }
1551
+ }
1552
+ },
1553
+ legend: {
1554
+ display: false
1555
+ }
1556
+ }
1557
+ };
1558
+ return /* @__PURE__ */ React35.createElement("div", { className: props.className }, /* @__PURE__ */ React35.createElement("h1", { className: props.labelClassName }, props.label), /* @__PURE__ */ React35.createElement(Bar2, { data, options }));
1559
+ };
1560
+
1561
+ // src/Components/DivContainer.tsx
1562
+ import React36 from "react";
1563
+ var DivContainer = (props) => {
1564
+ return /* @__PURE__ */ React36.createElement("div", { className: props.className, onClick: props.onClick }, props.label);
1565
+ };
870
1566
  export {
871
1567
  AddMoreTable,
1568
+ BarChart,
872
1569
  ButtonElement,
873
1570
  CheckboxElement,
1571
+ CircleDonut,
874
1572
  CkEditor,
875
1573
  DatePickerElement,
876
1574
  DateRangePickerElement,
1575
+ DivContainer,
1576
+ DoubleBarChart,
877
1577
  DropDownGroup,
878
1578
  FileUpload,
1579
+ HorizontalBarChart,
879
1580
  Image,
1581
+ LineChart,
880
1582
  MultipleSelectElement,
881
1583
  Navbar,
882
1584
  NumberElement,
1585
+ OtpElement,
883
1586
  PasswordElement,
884
1587
  RadioElement,
885
1588
  SelectElement,
1589
+ SemiCircleDonut,
886
1590
  Sidebar,
887
1591
  SingleCheckbox,
888
1592
  SingleSelectElement,
@@ -890,5 +1594,6 @@ export {
890
1594
  TableElement,
891
1595
  TabsElement,
892
1596
  TextElement,
893
- TextareaElement
1597
+ TextareaElement,
1598
+ Upload2 as Upload
894
1599
  };