funda-ui 3.8.815 → 3.8.821
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/CascadingSelect/index.js +4 -2
- package/CascadingSelectE2E/index.js +4 -2
- package/Checkbox/index.js +6 -3
- package/ColorPicker/index.js +6 -3
- package/Date/index.js +12 -6
- package/DynamicFields/index.js +4 -2
- package/File/index.js +2 -1
- package/Input/index.js +6 -3
- package/LiveSearch/index.js +6 -3
- package/MultiFuncSelect/index.js +6 -3
- package/Radio/index.js +50 -9
- package/RangeSlider/index.js +6 -3
- package/SearchBar/index.js +6 -3
- package/Select/index.js +6 -3
- package/Switch/index.js +6 -3
- package/Table/index.js +10 -5
- package/TagInput/index.js +6 -3
- package/Textarea/index.js +6 -3
- package/Tree/index.js +6 -3
- package/lib/cjs/CascadingSelect/index.js +4 -2
- package/lib/cjs/CascadingSelectE2E/index.js +4 -2
- package/lib/cjs/Checkbox/index.js +6 -3
- package/lib/cjs/ColorPicker/index.js +6 -3
- package/lib/cjs/Date/index.js +12 -6
- package/lib/cjs/DynamicFields/index.js +4 -2
- package/lib/cjs/File/index.js +2 -1
- package/lib/cjs/Input/index.js +6 -3
- package/lib/cjs/LiveSearch/index.js +6 -3
- package/lib/cjs/MultiFuncSelect/index.js +6 -3
- package/lib/cjs/Radio/index.js +50 -9
- package/lib/cjs/RangeSlider/index.js +6 -3
- package/lib/cjs/SearchBar/index.js +6 -3
- package/lib/cjs/Select/index.js +6 -3
- package/lib/cjs/Switch/index.js +6 -3
- package/lib/cjs/Table/index.js +10 -5
- package/lib/cjs/TagInput/index.js +6 -3
- package/lib/cjs/Textarea/index.js +6 -3
- package/lib/cjs/Tree/index.js +6 -3
- package/lib/esm/CascadingSelect/index.tsx +2 -2
- package/lib/esm/CascadingSelectE2E/index.tsx +2 -2
- package/lib/esm/Checkbox/index.tsx +3 -3
- package/lib/esm/ColorPicker/index.tsx +3 -3
- package/lib/esm/Date/index.tsx +3 -3
- package/lib/esm/DynamicFields/index.tsx +2 -2
- package/lib/esm/File/index.tsx +1 -1
- package/lib/esm/Input/index.tsx +3 -3
- package/lib/esm/MultiFuncSelect/index.tsx +3 -3
- package/lib/esm/Radio/index.tsx +47 -4
- package/lib/esm/SearchBar/index.tsx +3 -3
- package/lib/esm/Select/index.tsx +3 -3
- package/lib/esm/Switch/index.tsx +3 -3
- package/lib/esm/Table/index.tsx +2 -2
- package/lib/esm/TagInput/index.tsx +3 -3
- package/lib/esm/Textarea/index.tsx +3 -3
- package/package.json +1 -1
package/lib/cjs/Table/index.js
CHANGED
|
@@ -334,18 +334,20 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
334
334
|
setVal = _useState2[1]; // Avoid the error "react checkbox changing an uncontrolled input to be controlled"
|
|
335
335
|
|
|
336
336
|
function handleFocus(event) {
|
|
337
|
-
|
|
337
|
+
var _rootRef$current;
|
|
338
|
+
(_rootRef$current = rootRef.current) === null || _rootRef$current === void 0 ? void 0 : _rootRef$current.classList.add('focus');
|
|
338
339
|
|
|
339
340
|
//
|
|
340
341
|
onFocus === null || onFocus === void 0 ? void 0 : onFocus(event);
|
|
341
342
|
}
|
|
342
343
|
function handleChange(event) {
|
|
344
|
+
var _rootRef$current2;
|
|
343
345
|
var _val = event.target.checked;
|
|
344
346
|
setVal(_val);
|
|
345
347
|
|
|
346
348
|
//----
|
|
347
349
|
//remove focus style
|
|
348
|
-
rootRef.current.classList.remove('focus');
|
|
350
|
+
(_rootRef$current2 = rootRef.current) === null || _rootRef$current2 === void 0 ? void 0 : _rootRef$current2.classList.remove('focus');
|
|
349
351
|
|
|
350
352
|
//
|
|
351
353
|
if (typeof onChange === 'function') {
|
|
@@ -353,9 +355,10 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
353
355
|
}
|
|
354
356
|
}
|
|
355
357
|
function handleBlur(event) {
|
|
358
|
+
var _rootRef$current3;
|
|
356
359
|
//----
|
|
357
360
|
//remove focus style
|
|
358
|
-
rootRef.current.classList.remove('focus');
|
|
361
|
+
(_rootRef$current3 = rootRef.current) === null || _rootRef$current3 === void 0 ? void 0 : _rootRef$current3.classList.remove('focus');
|
|
359
362
|
|
|
360
363
|
//
|
|
361
364
|
onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
|
|
@@ -1818,7 +1821,8 @@ var Table = function Table(props) {
|
|
|
1818
1821
|
});
|
|
1819
1822
|
};
|
|
1820
1823
|
function handleTbodyLeave(e) {
|
|
1821
|
-
|
|
1824
|
+
var _tbodyRef$current;
|
|
1825
|
+
(_tbodyRef$current = tbodyRef.current) === null || _tbodyRef$current === void 0 ? void 0 : _tbodyRef$current.classList.remove('drag-trigger-mousedown');
|
|
1822
1826
|
}
|
|
1823
1827
|
|
|
1824
1828
|
// events fired on the drop targets
|
|
@@ -1852,10 +1856,11 @@ var Table = function Table(props) {
|
|
|
1852
1856
|
onDrag === null || onDrag === void 0 ? void 0 : onDrag(dragStart, null);
|
|
1853
1857
|
}, [handledragOver]);
|
|
1854
1858
|
var handleDragEnd = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(function (e) {
|
|
1859
|
+
var _tbodyRef$current2;
|
|
1855
1860
|
draggedObj.style.display = 'table-row';
|
|
1856
1861
|
removePlaceholder();
|
|
1857
1862
|
draggedObj.classList.remove('dragging');
|
|
1858
|
-
tbodyRef.current.classList.remove('drag-trigger-mousedown');
|
|
1863
|
+
(_tbodyRef$current2 = tbodyRef.current) === null || _tbodyRef$current2 === void 0 ? void 0 : _tbodyRef$current2.classList.remove('drag-trigger-mousedown');
|
|
1859
1864
|
if (overObj === null) return;
|
|
1860
1865
|
|
|
1861
1866
|
// update state
|
|
@@ -370,7 +370,8 @@ var TagInput = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(fu
|
|
|
370
370
|
//----
|
|
371
371
|
//remove focus style
|
|
372
372
|
if (val === '') {
|
|
373
|
-
|
|
373
|
+
var _rootRef$current;
|
|
374
|
+
(_rootRef$current = rootRef.current) === null || _rootRef$current === void 0 ? void 0 : _rootRef$current.classList.remove('focus');
|
|
374
375
|
}
|
|
375
376
|
|
|
376
377
|
//
|
|
@@ -389,7 +390,8 @@ var TagInput = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(fu
|
|
|
389
390
|
setUserInput(val);
|
|
390
391
|
}
|
|
391
392
|
function handleFocus(event) {
|
|
392
|
-
|
|
393
|
+
var _rootRef$current2;
|
|
394
|
+
(_rootRef$current2 = rootRef.current) === null || _rootRef$current2 === void 0 ? void 0 : _rootRef$current2.classList.add('focus');
|
|
393
395
|
|
|
394
396
|
//
|
|
395
397
|
onFocus === null || onFocus === void 0 ? void 0 : onFocus(event);
|
|
@@ -401,7 +403,8 @@ var TagInput = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(fu
|
|
|
401
403
|
//----
|
|
402
404
|
//remove focus style
|
|
403
405
|
if (val === '') {
|
|
404
|
-
|
|
406
|
+
var _rootRef$current3;
|
|
407
|
+
(_rootRef$current3 = rootRef.current) === null || _rootRef$current3 === void 0 ? void 0 : _rootRef$current3.classList.remove('focus');
|
|
405
408
|
}
|
|
406
409
|
|
|
407
410
|
//
|
|
@@ -250,8 +250,9 @@ var Textarea = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
|
|
|
250
250
|
// auto size
|
|
251
251
|
utils_useAutosizeTextArea(autoSize ? valRef.current : null, autoSize ? changedVal : '');
|
|
252
252
|
function handleFocus(event) {
|
|
253
|
+
var _rootRef$current;
|
|
253
254
|
var el = event.target;
|
|
254
|
-
rootRef.current.classList.add('focus');
|
|
255
|
+
(_rootRef$current = rootRef.current) === null || _rootRef$current === void 0 ? void 0 : _rootRef$current.classList.add('focus');
|
|
255
256
|
|
|
256
257
|
//
|
|
257
258
|
onFocus === null || onFocus === void 0 ? void 0 : onFocus(event, valRef.current);
|
|
@@ -263,7 +264,8 @@ var Textarea = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
|
|
|
263
264
|
//----
|
|
264
265
|
//remove focus style
|
|
265
266
|
if (val === '') {
|
|
266
|
-
|
|
267
|
+
var _rootRef$current2;
|
|
268
|
+
(_rootRef$current2 = rootRef.current) === null || _rootRef$current2 === void 0 ? void 0 : _rootRef$current2.classList.remove('focus');
|
|
267
269
|
}
|
|
268
270
|
|
|
269
271
|
//
|
|
@@ -283,7 +285,8 @@ var Textarea = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
|
|
|
283
285
|
//----
|
|
284
286
|
//remove focus style
|
|
285
287
|
if (val === '') {
|
|
286
|
-
|
|
288
|
+
var _rootRef$current3;
|
|
289
|
+
(_rootRef$current3 = rootRef.current) === null || _rootRef$current3 === void 0 ? void 0 : _rootRef$current3.classList.remove('focus');
|
|
287
290
|
}
|
|
288
291
|
|
|
289
292
|
//
|
package/lib/cjs/Tree/index.js
CHANGED
|
@@ -334,18 +334,20 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
334
334
|
setVal = _useState2[1]; // Avoid the error "react checkbox changing an uncontrolled input to be controlled"
|
|
335
335
|
|
|
336
336
|
function handleFocus(event) {
|
|
337
|
-
|
|
337
|
+
var _rootRef$current;
|
|
338
|
+
(_rootRef$current = rootRef.current) === null || _rootRef$current === void 0 ? void 0 : _rootRef$current.classList.add('focus');
|
|
338
339
|
|
|
339
340
|
//
|
|
340
341
|
onFocus === null || onFocus === void 0 ? void 0 : onFocus(event);
|
|
341
342
|
}
|
|
342
343
|
function handleChange(event) {
|
|
344
|
+
var _rootRef$current2;
|
|
343
345
|
var _val = event.target.checked;
|
|
344
346
|
setVal(_val);
|
|
345
347
|
|
|
346
348
|
//----
|
|
347
349
|
//remove focus style
|
|
348
|
-
rootRef.current.classList.remove('focus');
|
|
350
|
+
(_rootRef$current2 = rootRef.current) === null || _rootRef$current2 === void 0 ? void 0 : _rootRef$current2.classList.remove('focus');
|
|
349
351
|
|
|
350
352
|
//
|
|
351
353
|
if (typeof onChange === 'function') {
|
|
@@ -353,9 +355,10 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
353
355
|
}
|
|
354
356
|
}
|
|
355
357
|
function handleBlur(event) {
|
|
358
|
+
var _rootRef$current3;
|
|
356
359
|
//----
|
|
357
360
|
//remove focus style
|
|
358
|
-
rootRef.current.classList.remove('focus');
|
|
361
|
+
(_rootRef$current3 = rootRef.current) === null || _rootRef$current3 === void 0 ? void 0 : _rootRef$current3.classList.remove('focus');
|
|
359
362
|
|
|
360
363
|
//
|
|
361
364
|
onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
|
|
@@ -436,7 +436,7 @@ const CascadingSelect = (props: CascadingSelectProps) => {
|
|
|
436
436
|
|
|
437
437
|
|
|
438
438
|
function handleFocus(event: any) {
|
|
439
|
-
rootRef.current
|
|
439
|
+
rootRef.current?.classList.add('focus');
|
|
440
440
|
|
|
441
441
|
//
|
|
442
442
|
handleDisplayOptions(null);
|
|
@@ -450,7 +450,7 @@ const CascadingSelect = (props: CascadingSelectProps) => {
|
|
|
450
450
|
|
|
451
451
|
//----
|
|
452
452
|
//remove focus style
|
|
453
|
-
rootRef.current
|
|
453
|
+
rootRef.current?.classList.remove('focus');
|
|
454
454
|
|
|
455
455
|
|
|
456
456
|
//
|
|
@@ -564,7 +564,7 @@ const CascadingSelectE2E = (props: CascadingSelectE2EProps) => {
|
|
|
564
564
|
|
|
565
565
|
|
|
566
566
|
function handleFocus(event: any) {
|
|
567
|
-
rootRef.current
|
|
567
|
+
rootRef.current?.classList.add('focus');
|
|
568
568
|
|
|
569
569
|
//
|
|
570
570
|
handleDisplayOptions(null);
|
|
@@ -578,7 +578,7 @@ const CascadingSelectE2E = (props: CascadingSelectE2EProps) => {
|
|
|
578
578
|
|
|
579
579
|
//----
|
|
580
580
|
//remove focus style
|
|
581
|
-
rootRef.current
|
|
581
|
+
rootRef.current?.classList.remove('focus');
|
|
582
582
|
|
|
583
583
|
|
|
584
584
|
//
|
|
@@ -59,7 +59,7 @@ const Checkbox = forwardRef((props: CheckboxProps, ref: any) => {
|
|
|
59
59
|
const [val, setVal] = useState<any>(null || false); // Avoid the error "react checkbox changing an uncontrolled input to be controlled"
|
|
60
60
|
|
|
61
61
|
function handleFocus(event: any) {
|
|
62
|
-
rootRef.current
|
|
62
|
+
rootRef.current?.classList.add('focus');
|
|
63
63
|
|
|
64
64
|
//
|
|
65
65
|
onFocus?.(event);
|
|
@@ -73,7 +73,7 @@ const Checkbox = forwardRef((props: CheckboxProps, ref: any) => {
|
|
|
73
73
|
|
|
74
74
|
//----
|
|
75
75
|
//remove focus style
|
|
76
|
-
rootRef.current
|
|
76
|
+
rootRef.current?.classList.remove('focus');
|
|
77
77
|
|
|
78
78
|
//
|
|
79
79
|
if (typeof (onChange) === 'function') {
|
|
@@ -89,7 +89,7 @@ const Checkbox = forwardRef((props: CheckboxProps, ref: any) => {
|
|
|
89
89
|
|
|
90
90
|
//----
|
|
91
91
|
//remove focus style
|
|
92
|
-
rootRef.current
|
|
92
|
+
rootRef.current?.classList.remove('focus');
|
|
93
93
|
|
|
94
94
|
//
|
|
95
95
|
onBlur?.(event);
|
|
@@ -76,7 +76,7 @@ const ColorPicker = forwardRef((props: ColorPickerProps, ref: any) => {
|
|
|
76
76
|
|
|
77
77
|
|
|
78
78
|
function handleFocus(event: ChangeEvent<HTMLInputElement>) {
|
|
79
|
-
rootRef.current
|
|
79
|
+
rootRef.current?.classList.add('focus');
|
|
80
80
|
|
|
81
81
|
//
|
|
82
82
|
onFocus?.(event);
|
|
@@ -91,7 +91,7 @@ const ColorPicker = forwardRef((props: ColorPickerProps, ref: any) => {
|
|
|
91
91
|
//----
|
|
92
92
|
//remove focus style
|
|
93
93
|
if (val === '') {
|
|
94
|
-
rootRef.current
|
|
94
|
+
rootRef.current?.classList.remove('focus');
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
//
|
|
@@ -107,7 +107,7 @@ const ColorPicker = forwardRef((props: ColorPickerProps, ref: any) => {
|
|
|
107
107
|
//----
|
|
108
108
|
//remove focus style
|
|
109
109
|
if (val === '') {
|
|
110
|
-
rootRef.current
|
|
110
|
+
rootRef.current?.classList.remove('focus');
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
//
|
package/lib/esm/Date/index.tsx
CHANGED
|
@@ -466,7 +466,7 @@ const Date = forwardRef((props: DateProps, ref: any) => {
|
|
|
466
466
|
popwinPosHide();
|
|
467
467
|
|
|
468
468
|
//remove focus style
|
|
469
|
-
rootRef.current
|
|
469
|
+
rootRef.current?.classList.remove('focus');
|
|
470
470
|
}
|
|
471
471
|
|
|
472
472
|
}
|
|
@@ -486,7 +486,7 @@ const Date = forwardRef((props: DateProps, ref: any) => {
|
|
|
486
486
|
|
|
487
487
|
|
|
488
488
|
function handleFocus(event: ChangeEvent<HTMLElement>) {
|
|
489
|
-
rootRef.current
|
|
489
|
+
rootRef.current?.classList.add('focus');
|
|
490
490
|
|
|
491
491
|
|
|
492
492
|
//
|
|
@@ -505,7 +505,7 @@ const Date = forwardRef((props: DateProps, ref: any) => {
|
|
|
505
505
|
function handleBlur(event: ChangeEvent<HTMLElement>) {
|
|
506
506
|
|
|
507
507
|
//remove focus style
|
|
508
|
-
rootRef.current
|
|
508
|
+
rootRef.current?.classList.remove('focus');
|
|
509
509
|
|
|
510
510
|
//
|
|
511
511
|
onBlur?.(inputRef.current);
|
|
@@ -130,9 +130,9 @@ const DynamicFields = (props: DynamicFieldsProps) => {
|
|
|
130
130
|
if (innerAppendEmptyContent === '' || typeof innerAppendEmptyContent === 'undefined') return false;
|
|
131
131
|
|
|
132
132
|
if (type === 'add') {
|
|
133
|
-
emptyRef.current
|
|
133
|
+
emptyRef.current?.classList.add(ITEM_HIDE_CLASSNAME);
|
|
134
134
|
} else {
|
|
135
|
-
emptyRef.current
|
|
135
|
+
emptyRef.current?.classList.remove(ITEM_HIDE_CLASSNAME);
|
|
136
136
|
}
|
|
137
137
|
return true;
|
|
138
138
|
}
|
package/lib/esm/File/index.tsx
CHANGED
package/lib/esm/Input/index.tsx
CHANGED
|
@@ -135,7 +135,7 @@ const Input = forwardRef((props: InputProps, ref: any) => {
|
|
|
135
135
|
|
|
136
136
|
|
|
137
137
|
function handleFocus(event: ChangeEvent<HTMLInputElement>) {
|
|
138
|
-
rootRef.current
|
|
138
|
+
rootRef.current?.classList.add('focus');
|
|
139
139
|
|
|
140
140
|
//
|
|
141
141
|
onFocus?.(event, onComposition, valRef.current);
|
|
@@ -150,7 +150,7 @@ const Input = forwardRef((props: InputProps, ref: any) => {
|
|
|
150
150
|
//----
|
|
151
151
|
//remove focus style
|
|
152
152
|
if (val === '') {
|
|
153
|
-
rootRef.current
|
|
153
|
+
rootRef.current?.classList.remove('focus');
|
|
154
154
|
}
|
|
155
155
|
|
|
156
156
|
//
|
|
@@ -173,7 +173,7 @@ const Input = forwardRef((props: InputProps, ref: any) => {
|
|
|
173
173
|
//----
|
|
174
174
|
//remove focus style
|
|
175
175
|
if (val === '') {
|
|
176
|
-
rootRef.current
|
|
176
|
+
rootRef.current?.classList.remove('focus');
|
|
177
177
|
}
|
|
178
178
|
|
|
179
179
|
//
|
|
@@ -1162,7 +1162,7 @@ const MultiFuncSelect = forwardRef((props: MultiFuncSelectProps, ref: any) => {
|
|
|
1162
1162
|
[].slice.call(document.querySelectorAll('.mf-select__wrapper')).forEach((node: any) => {
|
|
1163
1163
|
node.classList.remove('active', 'focus');
|
|
1164
1164
|
});
|
|
1165
|
-
rootRef.current
|
|
1165
|
+
rootRef.current?.classList.add('active', 'focus');
|
|
1166
1166
|
}
|
|
1167
1167
|
|
|
1168
1168
|
|
|
@@ -1187,7 +1187,7 @@ const MultiFuncSelect = forwardRef((props: MultiFuncSelectProps, ref: any) => {
|
|
|
1187
1187
|
|
|
1188
1188
|
//remove focus style
|
|
1189
1189
|
if (!(MULTI_SEL_VALID)) {
|
|
1190
|
-
rootRef.current
|
|
1190
|
+
rootRef.current?.classList.remove('focus');
|
|
1191
1191
|
}
|
|
1192
1192
|
|
|
1193
1193
|
// get options
|
|
@@ -1671,7 +1671,7 @@ const MultiFuncSelect = forwardRef((props: MultiFuncSelectProps, ref: any) => {
|
|
|
1671
1671
|
//
|
|
1672
1672
|
function handleFocus(event: any) {
|
|
1673
1673
|
|
|
1674
|
-
rootRef.current
|
|
1674
|
+
rootRef.current?.classList.add('focus');
|
|
1675
1675
|
|
|
1676
1676
|
// update temporary value
|
|
1677
1677
|
setControlTempValue('');
|
package/lib/esm/Radio/index.tsx
CHANGED
|
@@ -90,13 +90,50 @@ const Radio = (props: RadioProps) => {
|
|
|
90
90
|
const [hasErr, setHasErr] = useState<boolean>(false);
|
|
91
91
|
const [controlValue, setControlValue] = useState<string | undefined>('');
|
|
92
92
|
|
|
93
|
+
function stringlineToHump(str: any) {
|
|
94
|
+
if (typeof str === 'string' && str.length > 0) {
|
|
95
|
+
const re = /-(\w)/g;
|
|
96
|
+
str = str.replace(re, function ($0, $1) {
|
|
97
|
+
return $1.toUpperCase();
|
|
98
|
+
});
|
|
99
|
+
return str;
|
|
100
|
+
} else {
|
|
101
|
+
return str;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
}
|
|
93
105
|
|
|
94
106
|
|
|
107
|
+
function getDataAttributes(node: any) {
|
|
108
|
+
if (node === null) return [];
|
|
109
|
+
|
|
110
|
+
const res: any = {};
|
|
111
|
+
for (const attr of node.attributes) {
|
|
112
|
+
if (/^data-/.test(attr.name)) {
|
|
113
|
+
res[stringlineToHump(attr.name)] = attr.value;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
return res;
|
|
118
|
+
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
|
|
95
122
|
async function fetchData(params: any) {
|
|
96
123
|
|
|
97
124
|
// set default value
|
|
98
125
|
if (typeof value !== 'undefined' && value !== '') rootRef.current.dataset.value = value;
|
|
99
126
|
|
|
127
|
+
|
|
128
|
+
if (rootRef.current) {
|
|
129
|
+
const allControlsData: any[] = [];
|
|
130
|
+
[].slice.call(rootRef.current.querySelectorAll(`[type="radio"]`)).forEach((el: HTMLInputElement, i: number) => {
|
|
131
|
+
allControlsData.push(getDataAttributes(el));
|
|
132
|
+
});
|
|
133
|
+
rootRef.current.setAttribute('data-controls-cus-attrs', JSON.stringify(allControlsData));
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
|
|
100
137
|
//
|
|
101
138
|
if (typeof fetchFuncAsync === 'object') {
|
|
102
139
|
|
|
@@ -223,7 +260,7 @@ const Radio = (props: RadioProps) => {
|
|
|
223
260
|
|
|
224
261
|
//
|
|
225
262
|
function handleFocus(event: any) {
|
|
226
|
-
rootRef.current
|
|
263
|
+
rootRef.current?.classList.add('focus');
|
|
227
264
|
|
|
228
265
|
//
|
|
229
266
|
onFocus?.(event);
|
|
@@ -254,7 +291,7 @@ const Radio = (props: RadioProps) => {
|
|
|
254
291
|
|
|
255
292
|
//----
|
|
256
293
|
//remove focus style
|
|
257
|
-
rootRef.current
|
|
294
|
+
rootRef.current?.classList.remove('focus');
|
|
258
295
|
|
|
259
296
|
|
|
260
297
|
//
|
|
@@ -270,7 +307,7 @@ const Radio = (props: RadioProps) => {
|
|
|
270
307
|
|
|
271
308
|
//----
|
|
272
309
|
//remove focus style
|
|
273
|
-
rootRef.current
|
|
310
|
+
rootRef.current?.classList.remove('focus');
|
|
274
311
|
|
|
275
312
|
//
|
|
276
313
|
onBlur?.(event);
|
|
@@ -374,6 +411,8 @@ const Radio = (props: RadioProps) => {
|
|
|
374
411
|
const _params: any[] = fetchFuncMethodParams || [];
|
|
375
412
|
fetchData((_params).join(','));
|
|
376
413
|
|
|
414
|
+
|
|
415
|
+
|
|
377
416
|
}, [value, options]);
|
|
378
417
|
|
|
379
418
|
|
|
@@ -381,7 +420,11 @@ const Radio = (props: RadioProps) => {
|
|
|
381
420
|
<>
|
|
382
421
|
|
|
383
422
|
|
|
384
|
-
<div
|
|
423
|
+
<div
|
|
424
|
+
id={`radio__wrapper-${idRes}`}
|
|
425
|
+
className={`radio__wrapper ${wrapperClassName || wrapperClassName === '' ? wrapperClassName : 'mb-3 position-relative'}`}
|
|
426
|
+
ref={rootRef}
|
|
427
|
+
>
|
|
385
428
|
{label ? <>{typeof label === 'string' ? <label htmlFor={idRes} className="form-label" dangerouslySetInnerHTML={{ __html: `${label}` }}></label> : <label htmlFor={idRes} className="form-label" >{label}</label>}</> : null}
|
|
386
429
|
<div id={idRes}>
|
|
387
430
|
{!hasErr ? itemsList : null}
|
|
@@ -112,7 +112,7 @@ const SearchBar = forwardRef((props: SearchBarProps, ref: any) => {
|
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
function handleFocus(event: any) {
|
|
115
|
-
rootRef.current
|
|
115
|
+
rootRef.current?.classList.add('focus');
|
|
116
116
|
|
|
117
117
|
//
|
|
118
118
|
onFocus?.(event, onComposition);
|
|
@@ -126,7 +126,7 @@ const SearchBar = forwardRef((props: SearchBarProps, ref: any) => {
|
|
|
126
126
|
//----
|
|
127
127
|
//remove focus style
|
|
128
128
|
if (val === '') {
|
|
129
|
-
rootRef.current
|
|
129
|
+
rootRef.current?.classList.remove('focus');
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
//
|
|
@@ -141,7 +141,7 @@ const SearchBar = forwardRef((props: SearchBarProps, ref: any) => {
|
|
|
141
141
|
//----
|
|
142
142
|
//remove focus style
|
|
143
143
|
if (val === '') {
|
|
144
|
-
rootRef.current
|
|
144
|
+
rootRef.current?.classList.remove('focus');
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
//
|
package/lib/esm/Select/index.tsx
CHANGED
|
@@ -212,7 +212,7 @@ const Select = forwardRef((props: SelectProps, ref: any) => {
|
|
|
212
212
|
|
|
213
213
|
//
|
|
214
214
|
function handleFocus(event: any) {
|
|
215
|
-
rootRef.current
|
|
215
|
+
rootRef.current?.classList.add('focus');
|
|
216
216
|
|
|
217
217
|
//
|
|
218
218
|
onFocus?.(event);
|
|
@@ -229,7 +229,7 @@ const Select = forwardRef((props: SelectProps, ref: any) => {
|
|
|
229
229
|
|
|
230
230
|
//----
|
|
231
231
|
//remove focus style
|
|
232
|
-
rootRef.current
|
|
232
|
+
rootRef.current?.classList.remove('focus');
|
|
233
233
|
|
|
234
234
|
//
|
|
235
235
|
if ( typeof(onChange) === 'function' ) {
|
|
@@ -244,7 +244,7 @@ const Select = forwardRef((props: SelectProps, ref: any) => {
|
|
|
244
244
|
|
|
245
245
|
//----
|
|
246
246
|
//remove focus style
|
|
247
|
-
rootRef.current
|
|
247
|
+
rootRef.current?.classList.remove('focus');
|
|
248
248
|
|
|
249
249
|
//
|
|
250
250
|
onBlur?.(event);
|
package/lib/esm/Switch/index.tsx
CHANGED
|
@@ -54,7 +54,7 @@ const Switch = forwardRef((props: SwitchProps, ref: any) => {
|
|
|
54
54
|
const [val, setVal] = useState<any>(null || false); // Avoid the error "react checkbox changing an uncontrolled input to be controlled"
|
|
55
55
|
|
|
56
56
|
function handleFocus(event: any) {
|
|
57
|
-
rootRef.current
|
|
57
|
+
rootRef.current?.classList.add('focus');
|
|
58
58
|
|
|
59
59
|
//
|
|
60
60
|
onFocus?.(event);
|
|
@@ -68,7 +68,7 @@ const Switch = forwardRef((props: SwitchProps, ref: any) => {
|
|
|
68
68
|
|
|
69
69
|
//----
|
|
70
70
|
//remove focus style
|
|
71
|
-
rootRef.current
|
|
71
|
+
rootRef.current?.classList.remove('focus');
|
|
72
72
|
|
|
73
73
|
//
|
|
74
74
|
if (typeof (onChange) === 'function') {
|
|
@@ -84,7 +84,7 @@ const Switch = forwardRef((props: SwitchProps, ref: any) => {
|
|
|
84
84
|
|
|
85
85
|
//----
|
|
86
86
|
//remove focus style
|
|
87
|
-
rootRef.current
|
|
87
|
+
rootRef.current?.classList.remove('focus');
|
|
88
88
|
|
|
89
89
|
//
|
|
90
90
|
onBlur?.(event);
|
package/lib/esm/Table/index.tsx
CHANGED
|
@@ -370,7 +370,7 @@ const Table = (props: TableProps) => {
|
|
|
370
370
|
};
|
|
371
371
|
|
|
372
372
|
function handleTbodyLeave(e: any) {
|
|
373
|
-
tbodyRef.current
|
|
373
|
+
tbodyRef.current?.classList.remove('drag-trigger-mousedown');
|
|
374
374
|
}
|
|
375
375
|
|
|
376
376
|
// events fired on the drop targets
|
|
@@ -422,7 +422,7 @@ const Table = (props: TableProps) => {
|
|
|
422
422
|
removePlaceholder();
|
|
423
423
|
|
|
424
424
|
draggedObj.classList.remove( 'dragging' );
|
|
425
|
-
tbodyRef.current
|
|
425
|
+
tbodyRef.current?.classList.remove('drag-trigger-mousedown');
|
|
426
426
|
|
|
427
427
|
|
|
428
428
|
if ( overObj === null ) return;
|
|
@@ -160,7 +160,7 @@ const TagInput = forwardRef((props: TagInputProps, ref: any) => {
|
|
|
160
160
|
//----
|
|
161
161
|
//remove focus style
|
|
162
162
|
if (val === '') {
|
|
163
|
-
rootRef.current
|
|
163
|
+
rootRef.current?.classList.remove('focus');
|
|
164
164
|
}
|
|
165
165
|
|
|
166
166
|
//
|
|
@@ -186,7 +186,7 @@ const TagInput = forwardRef((props: TagInputProps, ref: any) => {
|
|
|
186
186
|
|
|
187
187
|
|
|
188
188
|
function handleFocus(event: any) {
|
|
189
|
-
rootRef.current
|
|
189
|
+
rootRef.current?.classList.add('focus');
|
|
190
190
|
|
|
191
191
|
//
|
|
192
192
|
onFocus?.(event);
|
|
@@ -201,7 +201,7 @@ const TagInput = forwardRef((props: TagInputProps, ref: any) => {
|
|
|
201
201
|
//----
|
|
202
202
|
//remove focus style
|
|
203
203
|
if (val === '') {
|
|
204
|
-
rootRef.current
|
|
204
|
+
rootRef.current?.classList.remove('focus');
|
|
205
205
|
}
|
|
206
206
|
|
|
207
207
|
//
|
|
@@ -104,7 +104,7 @@ const Textarea = forwardRef((props: TextareaProps, ref: any) => {
|
|
|
104
104
|
|
|
105
105
|
function handleFocus(event: any) {
|
|
106
106
|
const el = event.target;
|
|
107
|
-
rootRef.current
|
|
107
|
+
rootRef.current?.classList.add('focus');
|
|
108
108
|
|
|
109
109
|
//
|
|
110
110
|
onFocus?.(event, valRef.current);
|
|
@@ -118,7 +118,7 @@ const Textarea = forwardRef((props: TextareaProps, ref: any) => {
|
|
|
118
118
|
//----
|
|
119
119
|
//remove focus style
|
|
120
120
|
if (val === '') {
|
|
121
|
-
rootRef.current
|
|
121
|
+
rootRef.current?.classList.remove('focus');
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
//
|
|
@@ -140,7 +140,7 @@ const Textarea = forwardRef((props: TextareaProps, ref: any) => {
|
|
|
140
140
|
//----
|
|
141
141
|
//remove focus style
|
|
142
142
|
if (val === '') {
|
|
143
|
-
rootRef.current
|
|
143
|
+
rootRef.current?.classList.remove('focus');
|
|
144
144
|
}
|
|
145
145
|
|
|
146
146
|
//
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"author": "UIUX Lab",
|
|
3
3
|
"email": "uiuxlab@gmail.com",
|
|
4
4
|
"name": "funda-ui",
|
|
5
|
-
"version": "3.8.
|
|
5
|
+
"version": "3.8.821",
|
|
6
6
|
"description": "React components using pure Bootstrap 5+ which does not contain any external style and script libraries.",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|