funda-ui 4.7.620 → 4.7.625

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.
@@ -568,6 +568,9 @@ var DynamicFields = function DynamicFields(props) {
568
568
  // exposes the following methods
569
569
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useImperativeHandle)(contentRef, function () {
570
570
  return {
571
+ addNew: function addNew() {
572
+ handleClickAdd(null);
573
+ },
571
574
  showAddBtn: function showAddBtn() {
572
575
  addBtnRef.current.style.setProperty('display', 'inline', 'important');
573
576
  },
@@ -578,7 +581,9 @@ var DynamicFields = function DynamicFields(props) {
578
581
  return rootRef.current.querySelectorAll(PER_ROW_DOM_STRING).length;
579
582
  }
580
583
  };
581
- }, [contentRef]);
584
+ }, [contentRef, handleClickAdd] // required "handleClickAdd"
585
+ );
586
+
582
587
  function updateLastItemCls(el, type) {
583
588
  if (typeof el === 'undefined') return;
584
589
  if (type === 'add') {
@@ -624,8 +629,11 @@ var DynamicFields = function DynamicFields(props) {
624
629
  addBtnRef.current.style.setProperty('display', 'none', 'important');
625
630
  }
626
631
  }
627
- function handleClickAdd(event) {
628
- if (event !== null && typeof event !== 'undefined') event.preventDefault();
632
+ function handleClickAdd() {
633
+ var event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
634
+ if (event !== null) {
635
+ if (typeof event !== 'undefined') event.preventDefault();
636
+ }
629
637
 
630
638
  //button status
631
639
  checkMaxStatus();
@@ -568,6 +568,9 @@ var DynamicFields = function DynamicFields(props) {
568
568
  // exposes the following methods
569
569
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useImperativeHandle)(contentRef, function () {
570
570
  return {
571
+ addNew: function addNew() {
572
+ handleClickAdd(null);
573
+ },
571
574
  showAddBtn: function showAddBtn() {
572
575
  addBtnRef.current.style.setProperty('display', 'inline', 'important');
573
576
  },
@@ -578,7 +581,9 @@ var DynamicFields = function DynamicFields(props) {
578
581
  return rootRef.current.querySelectorAll(PER_ROW_DOM_STRING).length;
579
582
  }
580
583
  };
581
- }, [contentRef]);
584
+ }, [contentRef, handleClickAdd] // required "handleClickAdd"
585
+ );
586
+
582
587
  function updateLastItemCls(el, type) {
583
588
  if (typeof el === 'undefined') return;
584
589
  if (type === 'add') {
@@ -624,8 +629,11 @@ var DynamicFields = function DynamicFields(props) {
624
629
  addBtnRef.current.style.setProperty('display', 'none', 'important');
625
630
  }
626
631
  }
627
- function handleClickAdd(event) {
628
- if (event !== null && typeof event !== 'undefined') event.preventDefault();
632
+ function handleClickAdd() {
633
+ var event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
634
+ if (event !== null) {
635
+ if (typeof event !== 'undefined') event.preventDefault();
636
+ }
629
637
 
630
638
  //button status
631
639
  checkMaxStatus();
@@ -101,6 +101,9 @@ const DynamicFields = (props: DynamicFieldsProps) => {
101
101
  useImperativeHandle(
102
102
  contentRef,
103
103
  () => ({
104
+ addNew: () => {
105
+ handleClickAdd(null);
106
+ },
104
107
  showAddBtn: () => {
105
108
  addBtnRef.current.style.setProperty('display', 'inline', 'important');
106
109
  },
@@ -111,7 +114,7 @@ const DynamicFields = (props: DynamicFieldsProps) => {
111
114
  return rootRef.current.querySelectorAll(PER_ROW_DOM_STRING).length;
112
115
  }
113
116
  }),
114
- [contentRef],
117
+ [contentRef, handleClickAdd], // required "handleClickAdd"
115
118
  );
116
119
 
117
120
  function updateLastItemCls(el: HTMLDivElement, type: string) {
@@ -167,9 +170,11 @@ const DynamicFields = (props: DynamicFieldsProps) => {
167
170
  }
168
171
 
169
172
 
170
- function handleClickAdd(event: any) {
171
- if (event !== null && typeof event !== 'undefined') event.preventDefault();
172
-
173
+ function handleClickAdd(event: any = null) {
174
+ if (event !== null) {
175
+ if (typeof event !== 'undefined') event.preventDefault();
176
+ }
177
+
173
178
  //button status
174
179
  checkMaxStatus();
175
180
 
package/package.json CHANGED
@@ -1 +1 @@
1
- {"author":"UIUX Lab","email":"uiuxlab@gmail.com","name":"funda-ui","version":"4.7.620","description":"React components using pure Bootstrap 5+ which does not contain any external style and script libraries.","repository":{"type":"git","url":"git+https://github.com/xizon/funda-ui.git"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":["bootstrap","react-bootstrap","react-components","components","components-react","react-bootstrap-components","react","funda-ui","fundaui","uikit","ui-kit","ui-components"],"bugs":{"url":"https://github.com/xizon/funda-ui/issues"},"homepage":"https://github.com/xizon/funda-ui#readme","main":"all.js","license":"MIT","dependencies":{"react":"^18.2.0","react-dom":"^18.2.0"},"types":"all.d.ts","publishConfig":{"directory":"lib"},"directories":{"lib":"lib"}}
1
+ {"author":"UIUX Lab","email":"uiuxlab@gmail.com","name":"funda-ui","version":"4.7.625","description":"React components using pure Bootstrap 5+ which does not contain any external style and script libraries.","repository":{"type":"git","url":"git+https://github.com/xizon/funda-ui.git"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":["bootstrap","react-bootstrap","react-components","components","components-react","react-bootstrap-components","react","funda-ui","fundaui","uikit","ui-kit","ui-components"],"bugs":{"url":"https://github.com/xizon/funda-ui/issues"},"homepage":"https://github.com/xizon/funda-ui#readme","main":"all.js","license":"MIT","dependencies":{"react":"^18.2.0","react-dom":"^18.2.0"},"types":"all.d.ts","publishConfig":{"directory":"lib"},"directories":{"lib":"lib"}}