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