@apexcura/ui-components 0.0.15-Beta81 → 0.0.15-Beta83

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.d.mts CHANGED
@@ -17,6 +17,8 @@ type ElementType = {
17
17
  disabled?: boolean;
18
18
  prefix?: React.ReactNode;
19
19
  type?: string;
20
+ checkedChildren?: string;
21
+ unCheckedChildren?: string;
20
22
  firstValue?: string;
21
23
  secondValue?: string;
22
24
  size?: SizeType;
package/dist/index.d.ts CHANGED
@@ -17,6 +17,8 @@ type ElementType = {
17
17
  disabled?: boolean;
18
18
  prefix?: React.ReactNode;
19
19
  type?: string;
20
+ checkedChildren?: string;
21
+ unCheckedChildren?: string;
20
22
  firstValue?: string;
21
23
  secondValue?: string;
22
24
  size?: SizeType;
package/dist/index.js CHANGED
@@ -328,7 +328,7 @@ var import_tinymce_react = require("@tinymce/tinymce-react");
328
328
  var import_react9 = __toESM(require("react"));
329
329
  var CkEditor = (props) => {
330
330
  const editorRef = (0, import_react8.useRef)(null);
331
- const onHandleChange = () => {
331
+ const log = () => {
332
332
  if (editorRef.current) {
333
333
  let content = editorRef.current.getContent();
334
334
  if (props.onChange) {
@@ -369,10 +369,9 @@ var CkEditor = (props) => {
369
369
  ],
370
370
  toolbar: "undo redo | blocks | bold italic forecolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | removeformat | help",
371
371
  content_style: "body { font-family:Helvetica,Arial,sans-serif; font-size:14px }"
372
- },
373
- onChange: onHandleChange
372
+ }
374
373
  }
375
- ));
374
+ ), /* @__PURE__ */ import_react9.default.createElement("button", { onClick: log }, "Log editor content"));
376
375
  };
377
376
 
378
377
  // src/Components/Editor.tsx
@@ -381,73 +380,26 @@ var import_ckeditor5_react = require("@ckeditor/ckeditor5-react");
381
380
  var import_ckeditor5_build_classic = __toESM(require("@ckeditor/ckeditor5-build-classic"));
382
381
  var Editor2 = (props) => {
383
382
  const [ckEditor, setckEditor] = (0, import_react10.useState)(null);
384
- (0, import_react10.useEffect)(() => {
385
- if (ckEditor) {
386
- ckEditor.setData(props.value);
387
- }
388
- }, [props.value, ckEditor]);
383
+ console.log(ckEditor);
389
384
  return /* @__PURE__ */ import_react10.default.createElement(
390
385
  import_ckeditor5_react.CKEditor,
391
386
  {
392
387
  editor: import_ckeditor5_build_classic.default,
393
- config: {
394
- plugins: [
395
- "advlist",
396
- "autolink",
397
- "lists",
398
- "link",
399
- "image",
400
- "charmap",
401
- "preview",
402
- "anchor",
403
- "searchreplace",
404
- "visualblocks",
405
- "code",
406
- "fullscreen",
407
- "insertdatetime",
408
- "media",
409
- "table",
410
- "code",
411
- "help",
412
- "wordcount"
413
- ],
414
- toolbar: {
415
- items: [
416
- "undo",
417
- "redo",
418
- "|",
419
- "bold",
420
- "italic",
421
- "foreColor",
422
- "|",
423
- "alignLeft",
424
- "alignCenter",
425
- "alignRight",
426
- "alignJustify",
427
- "|",
428
- "bulletedList",
429
- "numberedList",
430
- "outdent",
431
- "indent",
432
- "|",
433
- "removeFormat",
434
- "|",
435
- "help"
436
- ]
437
- }
438
- },
388
+ config: { placeholder: `Enter Text`, toolbar: ["bold", "bulletedList", "numberedList"] },
439
389
  data: props.value || "",
440
390
  onReady: (editor) => {
441
391
  try {
442
392
  editor.setData(props.value);
443
393
  setckEditor(editor);
444
394
  } catch (error) {
445
- console.error("Error setting CKEditor data:", error);
446
395
  }
447
396
  },
448
397
  onChange: (event, editor) => {
449
- const data = editor.getData();
450
- props.onChange && props.onChange(data);
398
+ console.log(editor.getData());
399
+ },
400
+ onBlur: (event, editor) => {
401
+ },
402
+ onFocus: (event, editor) => {
451
403
  }
452
404
  }
453
405
  );
@@ -1229,7 +1181,7 @@ var SwitchElement = (props) => {
1229
1181
  const onChange = (checked) => {
1230
1182
  props.onChange && props.onChange(checked);
1231
1183
  };
1232
- return /* @__PURE__ */ import_react29.default.createElement(import_antd20.Switch, { defaultChecked: true, onChange });
1184
+ return /* @__PURE__ */ import_react29.default.createElement(import_antd20.Switch, { defaultChecked: props.value, checkedChildren: props.checkedChildren, unCheckedChildren: props.unCheckedChildren, onChange });
1233
1185
  };
1234
1186
 
1235
1187
  // src/Components/Upload.tsx
package/dist/index.mjs CHANGED
@@ -258,7 +258,7 @@ import { Editor } from "@tinymce/tinymce-react";
258
258
  import React8 from "react";
259
259
  var CkEditor = (props) => {
260
260
  const editorRef = useRef(null);
261
- const onHandleChange = () => {
261
+ const log = () => {
262
262
  if (editorRef.current) {
263
263
  let content = editorRef.current.getContent();
264
264
  if (props.onChange) {
@@ -299,85 +299,37 @@ var CkEditor = (props) => {
299
299
  ],
300
300
  toolbar: "undo redo | blocks | bold italic forecolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | removeformat | help",
301
301
  content_style: "body { font-family:Helvetica,Arial,sans-serif; font-size:14px }"
302
- },
303
- onChange: onHandleChange
302
+ }
304
303
  }
305
- ));
304
+ ), /* @__PURE__ */ React8.createElement("button", { onClick: log }, "Log editor content"));
306
305
  };
307
306
 
308
307
  // src/Components/Editor.tsx
309
- import React9, { useState as useState4, useEffect } from "react";
308
+ import React9, { useState as useState4 } from "react";
310
309
  import { CKEditor } from "@ckeditor/ckeditor5-react";
311
310
  import ClassicEditor from "@ckeditor/ckeditor5-build-classic";
312
311
  var Editor2 = (props) => {
313
312
  const [ckEditor, setckEditor] = useState4(null);
314
- useEffect(() => {
315
- if (ckEditor) {
316
- ckEditor.setData(props.value);
317
- }
318
- }, [props.value, ckEditor]);
313
+ console.log(ckEditor);
319
314
  return /* @__PURE__ */ React9.createElement(
320
315
  CKEditor,
321
316
  {
322
317
  editor: ClassicEditor,
323
- config: {
324
- plugins: [
325
- "advlist",
326
- "autolink",
327
- "lists",
328
- "link",
329
- "image",
330
- "charmap",
331
- "preview",
332
- "anchor",
333
- "searchreplace",
334
- "visualblocks",
335
- "code",
336
- "fullscreen",
337
- "insertdatetime",
338
- "media",
339
- "table",
340
- "code",
341
- "help",
342
- "wordcount"
343
- ],
344
- toolbar: {
345
- items: [
346
- "undo",
347
- "redo",
348
- "|",
349
- "bold",
350
- "italic",
351
- "foreColor",
352
- "|",
353
- "alignLeft",
354
- "alignCenter",
355
- "alignRight",
356
- "alignJustify",
357
- "|",
358
- "bulletedList",
359
- "numberedList",
360
- "outdent",
361
- "indent",
362
- "|",
363
- "removeFormat",
364
- "|",
365
- "help"
366
- ]
367
- }
368
- },
318
+ config: { placeholder: `Enter Text`, toolbar: ["bold", "bulletedList", "numberedList"] },
369
319
  data: props.value || "",
370
320
  onReady: (editor) => {
371
321
  try {
372
322
  editor.setData(props.value);
373
323
  setckEditor(editor);
374
324
  } catch (error) {
375
- console.error("Error setting CKEditor data:", error);
376
325
  }
377
326
  },
378
327
  onChange: (event, editor) => {
379
- const data = editor.getData();
380
- props.onChange && props.onChange(data);
328
+ console.log(editor.getData());
329
+ },
330
+ onBlur: (event, editor) => {
331
+ },
332
+ onFocus: (event, editor) => {
381
333
  }
382
334
  }
383
335
  );
@@ -596,7 +548,7 @@ var ButtonElement = (props) => {
596
548
  };
597
549
 
598
550
  // src/Components/AddMoreTable.tsx
599
- import React14, { useEffect as useEffect2, useState as useState5 } from "react";
551
+ import React14, { useEffect, useState as useState5 } from "react";
600
552
  import { Table, Button } from "antd";
601
553
  import { PlusOutlined, DeleteOutlined } from "@ant-design/icons";
602
554
  var AddMoreTable = (props) => {
@@ -666,7 +618,7 @@ var AddMoreTable = (props) => {
666
618
  });
667
619
  });
668
620
  };
669
- useEffect2(() => {
621
+ useEffect(() => {
670
622
  }, [rows]);
671
623
  const renderInputElement = (element, value) => {
672
624
  if (!element) return null;
@@ -809,12 +761,12 @@ var Navbar = (props) => {
809
761
  };
810
762
 
811
763
  // src/Components/TableElement.tsx
812
- import React20, { useState as useState6, useEffect as useEffect3 } from "react";
764
+ import React20, { useState as useState6, useEffect as useEffect2 } from "react";
813
765
  import { Table as Table2 } from "antd";
814
766
  var TableElement = (props) => {
815
767
  const { thead, tbody } = props;
816
768
  const [dataSource, setDataSource] = useState6([]);
817
- useEffect3(() => {
769
+ useEffect2(() => {
818
770
  if (tbody) {
819
771
  setDataSource(
820
772
  tbody.map((row, index) => ({
@@ -1159,7 +1111,7 @@ var SwitchElement = (props) => {
1159
1111
  const onChange = (checked) => {
1160
1112
  props.onChange && props.onChange(checked);
1161
1113
  };
1162
- return /* @__PURE__ */ React28.createElement(Switch, { defaultChecked: true, onChange });
1114
+ return /* @__PURE__ */ React28.createElement(Switch, { defaultChecked: props.value, checkedChildren: props.checkedChildren, unCheckedChildren: props.unCheckedChildren, onChange });
1163
1115
  };
1164
1116
 
1165
1117
  // src/Components/Upload.tsx
@@ -1191,7 +1143,7 @@ var Upload2 = (props) => {
1191
1143
  };
1192
1144
 
1193
1145
  // src/Components/OtpElement.tsx
1194
- import React30, { useState as useState11, useRef as useRef2, useEffect as useEffect4 } from "react";
1146
+ import React30, { useState as useState11, useRef as useRef2, useEffect as useEffect3 } from "react";
1195
1147
  import { Input as Input3 } from "antd";
1196
1148
  var OtpElement = (props) => {
1197
1149
  const length = props.length;
@@ -1228,7 +1180,7 @@ var OtpElement = (props) => {
1228
1180
  });
1229
1181
  }
1230
1182
  };
1231
- useEffect4(() => {
1183
+ useEffect3(() => {
1232
1184
  inputRefs.current[0]?.focus();
1233
1185
  }, []);
1234
1186
  return /* @__PURE__ */ React30.createElement("div", { className: props.containerClassName }, Array.from({ length }).map((_, index) => /* @__PURE__ */ React30.createElement(
@@ -1480,7 +1432,7 @@ var HorizontalBarChart = (props) => {
1480
1432
  };
1481
1433
 
1482
1434
  // src/Components/LineChart.tsx
1483
- import React34, { useEffect as useEffect5, useRef as useRef3 } from "react";
1435
+ import React34, { useEffect as useEffect4, useRef as useRef3 } from "react";
1484
1436
  import Chart from "chart.js/auto";
1485
1437
  var LineChart = (props) => {
1486
1438
  const chartRef = useRef3(null);
@@ -1491,7 +1443,7 @@ var LineChart = (props) => {
1491
1443
  { label: "Conversion Rate", data: [50, 100, 150, 180, 50] }
1492
1444
  ];
1493
1445
  const labels = ["Instagram", "Whatsapp", "Messages", "Telegram", "Linkedin"];
1494
- useEffect5(() => {
1446
+ useEffect4(() => {
1495
1447
  if (chartRef.current) {
1496
1448
  if (chartInstance.current) {
1497
1449
  chartInstance.current.destroy();
@@ -1553,12 +1505,12 @@ var LineChart = (props) => {
1553
1505
  };
1554
1506
 
1555
1507
  // src/Components/DoubleBarChart.tsx
1556
- import React35, { useEffect as useEffect6, useRef as useRef4 } from "react";
1508
+ import React35, { useEffect as useEffect5, useRef as useRef4 } from "react";
1557
1509
  import Chart2 from "chart.js/auto";
1558
1510
  var DoubleBarChart = (props) => {
1559
1511
  const chartRef = useRef4(null);
1560
1512
  const chartInstance = useRef4(null);
1561
- useEffect6(() => {
1513
+ useEffect5(() => {
1562
1514
  if (chartRef.current) {
1563
1515
  if (chartInstance.current) {
1564
1516
  chartInstance.current.destroy();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apexcura/ui-components",
3
- "version": "0.0.15-Beta81",
3
+ "version": "0.0.15-Beta83",
4
4
  "description": "Apex cura React components library",
5
5
  "keywords": [
6
6
  "apex cura",