funda-ui 4.2.255 → 4.2.445

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.
Files changed (77) hide show
  1. package/CascadingSelect/index.js +1 -1
  2. package/EventCalendar/index.css +3 -0
  3. package/EventCalendar/index.d.ts +4 -1
  4. package/EventCalendar/index.js +16 -4
  5. package/EventCalendarTimeline/index.css +17 -0
  6. package/EventCalendarTimeline/index.d.ts +9 -2
  7. package/EventCalendarTimeline/index.js +77 -22
  8. package/LiveSearch/index.css +12 -0
  9. package/LiveSearch/index.js +1 -1
  10. package/ModalDialog/index.js +1 -1
  11. package/MultilevelDropdownMenu/index.css +2 -2
  12. package/MultilevelDropdownMenu/index.js +54 -46
  13. package/MultipleSelect/index.css +35 -26
  14. package/MultipleSelect/index.d.ts +3 -0
  15. package/MultipleSelect/index.js +366 -134
  16. package/NativeSelect/index.js +75 -47
  17. package/Pagination/index.d.ts +2 -0
  18. package/Pagination/index.js +25 -21
  19. package/Radio/index.js +14 -6
  20. package/RangeSlider/index.css +1 -0
  21. package/Select/index.css +5 -0
  22. package/Select/index.d.ts +1 -0
  23. package/Select/index.js +31 -11
  24. package/Tabs/index.js +13 -2
  25. package/Tree/index.js +90 -56
  26. package/lib/cjs/CascadingSelect/index.js +1 -1
  27. package/lib/cjs/EventCalendar/index.d.ts +4 -1
  28. package/lib/cjs/EventCalendar/index.js +16 -4
  29. package/lib/cjs/EventCalendarTimeline/index.d.ts +9 -2
  30. package/lib/cjs/EventCalendarTimeline/index.js +77 -22
  31. package/lib/cjs/LiveSearch/index.js +1 -1
  32. package/lib/cjs/ModalDialog/index.js +1 -1
  33. package/lib/cjs/MultilevelDropdownMenu/index.js +54 -46
  34. package/lib/cjs/MultipleSelect/index.d.ts +3 -0
  35. package/lib/cjs/MultipleSelect/index.js +366 -134
  36. package/lib/cjs/NativeSelect/index.js +75 -47
  37. package/lib/cjs/Pagination/index.d.ts +2 -0
  38. package/lib/cjs/Pagination/index.js +25 -21
  39. package/lib/cjs/Radio/index.js +14 -6
  40. package/lib/cjs/Select/index.d.ts +1 -0
  41. package/lib/cjs/Select/index.js +31 -11
  42. package/lib/cjs/Tabs/index.js +13 -2
  43. package/lib/cjs/Tree/index.js +90 -56
  44. package/lib/css/EventCalendar/index.css +3 -0
  45. package/lib/css/EventCalendarTimeline/index.css +17 -0
  46. package/lib/css/LiveSearch/index.css +12 -0
  47. package/lib/css/MultilevelDropdownMenu/index.css +2 -2
  48. package/lib/css/MultipleSelect/index.css +35 -26
  49. package/lib/css/RangeSlider/index.css +1 -0
  50. package/lib/css/Select/index.css +5 -0
  51. package/lib/esm/CascadingSelect/index.tsx +1 -1
  52. package/lib/esm/EventCalendar/index.scss +2 -0
  53. package/lib/esm/EventCalendar/index.tsx +23 -6
  54. package/lib/esm/EventCalendarTimeline/index.scss +24 -1
  55. package/lib/esm/EventCalendarTimeline/index.tsx +195 -118
  56. package/lib/esm/LiveSearch/index.scss +14 -1
  57. package/lib/esm/LiveSearch/index.tsx +1 -1
  58. package/lib/esm/ModalDialog/index.tsx +1 -1
  59. package/lib/esm/MultilevelDropdownMenu/{MenuList.tsx → ItemList.tsx} +52 -45
  60. package/lib/esm/MultilevelDropdownMenu/index.scss +2 -2
  61. package/lib/esm/MultilevelDropdownMenu/index.tsx +12 -4
  62. package/lib/esm/MultipleSelect/ItemList.tsx +300 -0
  63. package/lib/esm/MultipleSelect/index.scss +61 -30
  64. package/lib/esm/MultipleSelect/index.tsx +56 -87
  65. package/lib/esm/MultipleSelect/multiple-select-utils/func.ts +29 -0
  66. package/lib/esm/NativeSelect/index.tsx +4 -18
  67. package/lib/esm/NativeSelect/native-select-utils/func.ts +40 -0
  68. package/lib/esm/Pagination/index.tsx +31 -22
  69. package/lib/esm/Radio/index.tsx +19 -6
  70. package/lib/esm/RangeSlider/index.scss +2 -0
  71. package/lib/esm/Select/index.scss +6 -1
  72. package/lib/esm/Select/index.tsx +70 -54
  73. package/lib/esm/Table/Table.tsx +2 -0
  74. package/lib/esm/Tabs/Tabs.tsx +19 -4
  75. package/lib/esm/Tree/TreeList.tsx +61 -54
  76. package/lib/esm/Tree/index.tsx +4 -0
  77. package/package.json +1 -1
@@ -13,6 +13,10 @@ import {
13
13
 
14
14
 
15
15
 
16
+ import { multiSelControlOptionExist } from './multiple-select-utils/func';
17
+ import ItemList from './ItemList';
18
+
19
+
16
20
  export interface OptionConfig {
17
21
  [propName: string]: string | number | boolean;
18
22
  }
@@ -20,6 +24,7 @@ export interface OptionConfig {
20
24
 
21
25
  type MultipleSelectProps = {
22
26
  wrapperClassName?: string;
27
+ childClassName?: string;
23
28
  wrapperMinHeight?: string;
24
29
  wrapperMinWidth?: string;
25
30
  availableHeaderTitle?: string;
@@ -32,6 +37,8 @@ type MultipleSelectProps = {
32
37
  hierarchical?: boolean;
33
38
  indentation?: string;
34
39
  doubleIndent?: boolean;
40
+ alternateCollapse?: boolean;
41
+ arrow?: React.ReactNode;
35
42
  value?: string;
36
43
  label?: React.ReactNode | string;
37
44
  name?: string;
@@ -59,6 +66,7 @@ type MultipleSelectProps = {
59
66
  const MultipleSelect = forwardRef((props: MultipleSelectProps, externalRef: any) => {
60
67
  const {
61
68
  wrapperClassName,
69
+ childClassName,
62
70
  wrapperMinHeight,
63
71
  wrapperMinWidth,
64
72
  availableHeaderTitle,
@@ -71,6 +79,8 @@ const MultipleSelect = forwardRef((props: MultipleSelectProps, externalRef: any)
71
79
  hierarchical,
72
80
  indentation,
73
81
  doubleIndent,
82
+ alternateCollapse,
83
+ arrow,
74
84
  options,
75
85
  disabled,
76
86
  required,
@@ -117,12 +127,6 @@ const MultipleSelect = forwardRef((props: MultipleSelectProps, externalRef: any)
117
127
  const [hasErr, setHasErr] = useState<boolean>(false);
118
128
 
119
129
 
120
- const multiSelControlOptionExist = (arr: any[], val: any) => {
121
- const _data = arr.filter(Boolean);
122
- return _data.map((v: any) => v.toString()).includes(val.toString());
123
- };
124
-
125
-
126
130
  async function fetchData(params: any) {
127
131
 
128
132
  // set default value
@@ -170,6 +174,12 @@ const MultipleSelect = forwardRef((props: MultipleSelectProps, externalRef: any)
170
174
  return _ORGIN_DATA;
171
175
  } else {
172
176
 
177
+ // Set hierarchical categories ( with sub-categories )
178
+ if ( hierarchical ) {
179
+ optionsDataInit = addTreeDepth(optionsDataInit);
180
+ addTreeIndent(optionsDataInit, INDENT_PLACEHOLDER, INDENT_LAST_PLACEHOLDER, 'label');
181
+ }
182
+
173
183
 
174
184
  // remove Duplicate objects from JSON Array
175
185
  optionsDataInit = removeArrDuplicateItems(optionsDataInit, 'value');
@@ -460,49 +470,26 @@ const MultipleSelect = forwardRef((props: MultipleSelectProps, externalRef: any)
460
470
 
461
471
  <a href="#" className="m-select__btn--add-all" onClick={handleSelectAll}>{addAllBtnLabel || 'Add all'}</a>
462
472
  </div>
463
- <ul className="m-select__available m-select__options-contentlist" ref={availableListRef}>
464
-
465
- {/* OPTIONS LIST */}
466
- {dataInit ? dataInit.map((item: any, i: number) => {
467
-
468
-
469
- return <li
470
- key={'item' + i}
471
- className={`${item.disabled ? 'disabled' : ''} ${multiSelControlOptionExist(valSelected, item.value) ? 'hide' : ''}`}
472
- data-index={i}
473
- data-value={`${item.value}`}
474
- data-label={`${item.label}`}
475
- data-list-item-label={`${typeof item.listItemLabel === 'undefined' ? '' : item.listItemLabel}`}
476
- data-disabled={item.disabled || 'false'}
477
- data-querystring={`${typeof item.queryString === 'undefined' ? '' : item.queryString}`}
478
- data-itemdata={JSON.stringify(item)}
479
- >
480
-
481
- <span>
482
- <strong dangerouslySetInnerHTML={{
483
- __html: typeof item.listItemLabel === 'undefined' ? item.label : item.listItemLabel
484
- }}></strong>
485
- <a
486
- href="#"
487
- className="m-select__item-action"
488
- ></a>
489
- </span>
490
- <i
491
- onClick={(e: React.MouseEvent) => {
492
- selectItem((e.target as any).closest('li'));
493
- }}>
494
- {iconAdd ? <>{iconAdd}</> : <><svg width="15px" height="15px" viewBox="0 0 24 24" fill="none"><path d="M12 2C6.49 2 2 6.49 2 12C2 17.51 6.49 22 12 22C17.51 22 22 17.51 22 12C22 6.49 17.51 2 12 2ZM16 12.75H12.75V16C12.75 16.41 12.41 16.75 12 16.75C11.59 16.75 11.25 16.41 11.25 16V12.75H8C7.59 12.75 7.25 12.41 7.25 12C7.25 11.59 7.59 11.25 8 11.25H11.25V8C11.25 7.59 11.59 7.25 12 7.25C12.41 7.25 12.75 7.59 12.75 8V11.25H16C16.41 11.25 16.75 11.59 16.75 12C16.75 12.41 16.41 12.75 16 12.75Z" fill="#000" /></svg></>}
495
-
496
-
497
- </i>
498
-
499
- </li>;
500
- }) : null}
501
-
502
- {/* /OPTIONS LIST */}
503
-
504
-
505
- </ul>
473
+
474
+
475
+
476
+ {/* OPTIONS LIST */}
477
+ <ItemList
478
+ root={rootRef.current}
479
+ listContainerClassName="m-select__available m-select__options-contentlist"
480
+ ref={availableListRef}
481
+ indentStr={INDENT_LAST_PLACEHOLDER}
482
+ valSelected={valSelected}
483
+ iconAdd={iconAdd}
484
+ onSelect={selectItem}
485
+ alternateCollapse={alternateCollapse}
486
+ first={true}
487
+ arrow={arrow}
488
+ data={dataInit}
489
+ childClassName={childClassName || 'm-select__options-contentlist-custom'}
490
+ />
491
+ {/* /OPTIONS LIST */}
492
+
506
493
  </div>
507
494
 
508
495
 
@@ -517,44 +504,26 @@ const MultipleSelect = forwardRef((props: MultipleSelectProps, externalRef: any)
517
504
  <span className="m-select__title" dangerouslySetInnerHTML={{__html: `${selectedHeaderTitle || ''}`}}></span>
518
505
  <a href="#" className="m-select__btn--remove-all" onClick={handleRemoveAll}>{removeAllBtnLabel || 'Remove all'}</a>
519
506
  </div>
520
- <ul className="m-select__selected m-select__options-contentlist--sortable m-select__options-contentlist" ref={selectedListRef}>
521
-
522
- {/* OPTIONS LIST */}
523
- {valSelectedData ? valSelectedData.map((item: any, i: number) => {
524
- return <li
525
- key={'item-selected' + i}
526
- className="selected"
527
- data-index={i}
528
- data-value={`${item.value}`}
529
- data-label={`${item.label}`}
530
- data-list-item-label={`${typeof item.listItemLabel === 'undefined' ? '' : item.listItemLabel}`}
531
- data-disabled={item.disabled || 'false'}
532
- data-querystring={`${typeof item.queryString === 'undefined' ? '' : item.queryString}`}
533
- data-itemdata={JSON.stringify(item)}
534
- >
535
-
536
- <span>
537
- <strong dangerouslySetInnerHTML={{
538
- __html: typeof item.listItemLabel === 'undefined' ? item.label : item.listItemLabel
539
- }}></strong>
540
- <a
541
- href="#"
542
- className="m-select__item-action"
543
- ></a>
544
- </span>
545
- <i
546
- onClick={(e: React.MouseEvent) => {
547
- removeItem((e.target as any).closest('li'));
548
- }}>
549
- {iconRemove ? <>{iconRemove}</> : <><svg width="15px" height="15px" viewBox="0 0 24 24" fill="none"><path fillRule="evenodd" clipRule="evenodd" d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10ZM8 11a1 1 0 1 0 0 2h8a1 1 0 1 0 0-2H8Z" fill="#000" /></svg></>}
550
-
551
- </i>
552
-
553
- </li>;
554
- }) : null}
555
- {/* /OPTIONS LIST */}
556
-
557
- </ul>
507
+
508
+
509
+ {/* OPTIONS LIST */}
510
+ <ItemList
511
+ root={rootRef.current}
512
+ listContainerClassName="m-select__selected m-select__options-contentlist--sortable m-select__options-contentlist"
513
+ ref={selectedListRef}
514
+ indentStr={INDENT_LAST_PLACEHOLDER}
515
+ valSelected={valSelected}
516
+ iconRemove={iconRemove}
517
+ onSelect={removeItem}
518
+ alternateCollapse={alternateCollapse}
519
+ first={true}
520
+ arrow={arrow}
521
+ data={valSelectedData}
522
+ childClassName={childClassName || 'm-select__options-contentlist--custom'}
523
+ selected
524
+ />
525
+ {/* /OPTIONS LIST */}
526
+
558
527
  </div>
559
528
 
560
529
 
@@ -0,0 +1,29 @@
1
+
2
+ /**
3
+ * Format indent value
4
+ * @param {String|Array} inputData
5
+ * @param {String} placeholder
6
+ * @returns {String|Array}
7
+ */
8
+ export function formatIndentVal(inputData: any, placeholder: string) {
9
+ const reVar = new RegExp(placeholder, 'g');
10
+ if (Array.isArray(inputData)) {
11
+ return inputData.map((s: any) => String(s).replace(reVar, '').replace(/\&nbsp;/ig, ''));
12
+ } else {
13
+ const _txt: any = typeof inputData === 'string' ? inputData : inputData.toString();
14
+ return _txt.replace(reVar, '').replace(/\&nbsp;/ig, '');
15
+ }
16
+
17
+ }
18
+
19
+
20
+ /**
21
+ * Determine whether the option exists
22
+ * @param val
23
+ * @returns
24
+ */
25
+ export function multiSelControlOptionExist(arr: any[], val: any) {
26
+ const _data = arr.filter(Boolean);
27
+ return _data.map((v: any) => v.toString()).includes(val.toString());
28
+
29
+ }
@@ -1,5 +1,7 @@
1
1
  import React, { useEffect, useState, useRef, forwardRef } from 'react';
2
2
 
3
+ import { optionsFlat } from './native-select-utils/func';
4
+
3
5
  import {
4
6
  useComId,
5
7
  isJSON,
@@ -157,23 +159,6 @@ const NativeSelect = forwardRef((props: NativeSelectProps, externalRef: any) =>
157
159
 
158
160
  }
159
161
 
160
-
161
- /**
162
- * Format indent value
163
- * @param {String|Array} str
164
- * @returns {String|Array}
165
- */
166
- function formatIndentVal(str: any) {
167
- const reVar = new RegExp(INDENT_LAST_PLACEHOLDER, 'g');
168
- if (Array.isArray(str)) {
169
- return str.map((s: string) => s.replace(reVar,'').replace(/\&nbsp;/ig,''));
170
- } else {
171
- return str.replace(reVar,'').replace(/\&nbsp;/ig,'');
172
- }
173
-
174
- }
175
-
176
-
177
162
  //
178
163
  function handleFocus(event: any) {
179
164
  rootRef.current?.classList.add('focus');
@@ -197,7 +182,8 @@ const NativeSelect = forwardRef((props: NativeSelectProps, externalRef: any) =>
197
182
 
198
183
  //
199
184
  if ( typeof(onChange) === 'function' ) {
200
- onChange(event, dataInit[event.target.selectedIndex].value, dataInit[event.target.selectedIndex], event.target.selectedIndex);
185
+ console.log('---', event.target.selectedIndex)
186
+ onChange(event, optionsFlat(dataInit)[event.target.selectedIndex].value, optionsFlat(dataInit)[event.target.selectedIndex], event.target.selectedIndex);
201
187
 
202
188
  event.target.blur();
203
189
  }
@@ -0,0 +1,40 @@
1
+
2
+ /**
3
+ * Format indent value
4
+ * @param {String|Array} inputData
5
+ * @param {String} placeholder
6
+ * @returns {String|Array}
7
+ */
8
+ export function formatIndentVal(inputData: any, placeholder: string) {
9
+ const reVar = new RegExp(placeholder, 'g');
10
+ if (Array.isArray(inputData)) {
11
+ return inputData.map((s: any) => String(s).replace(reVar, '').replace(/\&nbsp;/ig, ''));
12
+ } else {
13
+ const _txt: any = typeof inputData === 'string' ? inputData : inputData.toString();
14
+ return _txt.replace(reVar, '').replace(/\&nbsp;/ig, '');
15
+ }
16
+
17
+ }
18
+
19
+ /**
20
+ * Flat options
21
+ * @param {Array}allData
22
+ * @returns {Array}
23
+ */
24
+ export function optionsFlat(allData: any[]) {
25
+
26
+ const flatItems: any[] = [];
27
+
28
+ allData.forEach((item: any) => {
29
+ if (typeof item.optgroup !== 'undefined') {
30
+ item.optgroup.forEach((opt: any) => {
31
+ flatItems.push(opt);
32
+ });
33
+ } else {
34
+ flatItems.push(item);
35
+ }
36
+ });
37
+
38
+ return flatItems;
39
+ }
40
+
@@ -1,4 +1,4 @@
1
- import React, { forwardRef, useImperativeHandle } from 'react';
1
+ import React, { useRef, forwardRef, useImperativeHandle } from 'react';
2
2
  import { paginationNavigators } from './pagination-navigators';
3
3
 
4
4
 
@@ -7,6 +7,8 @@ type PaginationProps = {
7
7
  wrapperClassName?: string;
8
8
  /** The class name of the navigation */
9
9
  navClassName?: string;
10
+ /** The class name of each item */
11
+ navItemClassName?: string;
10
12
  /** An API URL Path. Use `{page}` characters to place a placeholder. such as `/mypage/{page}` */
11
13
  apiUrl: string;
12
14
  /** The range of pages displayed */
@@ -56,6 +58,7 @@ const Pagination = forwardRef((props: PaginationProps, externalRef: any) => {
56
58
  const {
57
59
  wrapperClassName,
58
60
  navClassName,
61
+ navItemClassName,
59
62
  apiUrl,
60
63
  pageRangeDisplayed,
61
64
  activePage,
@@ -79,6 +82,11 @@ const Pagination = forwardRef((props: PaginationProps, externalRef: any) => {
79
82
  } = props;
80
83
 
81
84
 
85
+ const rootRef = useRef<any>(null);
86
+ const visibleNavigators = pageRangeDisplayed ? pageRangeDisplayed : 3;
87
+
88
+
89
+
82
90
 
83
91
  // exposes the following methods
84
92
  useImperativeHandle(
@@ -105,11 +113,10 @@ const Pagination = forwardRef((props: PaginationProps, externalRef: any) => {
105
113
  });
106
114
  }
107
115
  }),
108
- [externalRef, activePage],
116
+ [externalRef, totalPages, activePage],
109
117
  );
110
118
 
111
119
 
112
- const visibleNavigators = pageRangeDisplayed ? pageRangeDisplayed : 3;
113
120
 
114
121
  let alignClassName = '';
115
122
  switch (align) {
@@ -124,12 +131,13 @@ const Pagination = forwardRef((props: PaginationProps, externalRef: any) => {
124
131
  break;
125
132
  }
126
133
 
127
- const _activeClassNameName = activeClassName ? activeClassName : 'active',
128
- _previousClassNameName = previousClassName ? previousClassName : 'prev',
129
- _nextClassNameName = nextClassName ? nextClassName : 'next',
130
- _firstClassNameName = firstClassName ? firstClassName : 'first',
131
- _lastClassNameName = lastClassName ? lastClassName : 'last',
132
- _disabledClassNameName = disabledClassName ? disabledClassName : 'disabled',
134
+ const _activeClassName = activeClassName || 'active',
135
+ _previousClassName = previousClassName || 'prev',
136
+ _nextClassName = nextClassName || 'next',
137
+ _firstClassName = firstClassName || 'first',
138
+ _lastClassName = lastClassName || 'last',
139
+ _disabledClassName = disabledClassName || 'disabled',
140
+ _itemClassName = navItemClassName || 'page-item',
133
141
  _onlyPrevNextButtons = typeof (onlyPrevNext) === 'undefined' ? false : onlyPrevNext,
134
142
  _symmetry = typeof (symmetry) === 'undefined' ? false : symmetry;
135
143
 
@@ -158,8 +166,8 @@ const Pagination = forwardRef((props: PaginationProps, externalRef: any) => {
158
166
  _ellipsisEnabled = true;
159
167
 
160
168
  return (
161
- <li key={i} className={activePage === item ? `page-item ${_activeClassNameName}` : `page-item`}>
162
- <a className="page-link" data-page={item} href={apiUrl.replace('{page}', item)} onClick={(e) => {
169
+ <li key={i} className={activePage === item ? `${_itemClassName} ${_activeClassName}` : `${_itemClassName}`}>
170
+ <a className="page-link" data-page={item} href={apiUrl?.replace('{page}', item)} onClick={(e) => {
163
171
  e.preventDefault();
164
172
  onChange?.(Number(item), Number(totalPages));
165
173
  }}>{item}</a>
@@ -203,21 +211,22 @@ const Pagination = forwardRef((props: PaginationProps, externalRef: any) => {
203
211
  <>
204
212
 
205
213
  <nav
214
+ ref={rootRef}
206
215
  className={wrapperClassName || wrapperClassName === '' ? wrapperClassName : "mb-3 position-relative"}
207
216
  style={style}
208
217
  >
209
218
  <ul className={navClassName || navClassName === '' ? `${navClassName} ${alignClassName}` : `pagination ${alignClassName}`}>
210
219
  {firstLabel ? (
211
- <li className={activePage > 1 ? `page-item ${_firstClassNameName}` : `page-item ${_firstClassNameName} ${_disabledClassNameName}`}>
212
- <a tabIndex={activePage > 1 ? 0 : -1} aria-disabled={activePage > 1 ? 'false' : 'true'} className="page-link" data-page={1} href={apiUrl.replace('{page}', '1')} onClick={(e) => { e.preventDefault(); handleClick('first'); }}>
220
+ <li className={activePage > 1 ? `${_itemClassName} ${_firstClassName}` : `${_itemClassName} ${_firstClassName} ${_disabledClassName}`}>
221
+ <a tabIndex={activePage > 1 ? 0 : -1} aria-disabled={activePage > 1 ? 'false' : 'true'} className="page-link" data-page={1} href={apiUrl?.replace('{page}', '1')} onClick={(e) => { e.preventDefault(); handleClick('first'); }}>
213
222
  {firstLabel || null}
214
223
  </a>
215
224
  </li>
216
225
  ) : ''}
217
226
 
218
227
  {previousLabel ? (
219
- <li className={activePage > 1 ? `page-item ${_previousClassNameName}` : `page-item ${_previousClassNameName} ${_disabledClassNameName}`}>
220
- <a tabIndex={activePage > 1 ? 0 : -1} aria-disabled={activePage > 1 ? 'false' : 'true'} className="page-link" data-page={activePage - 1} href={apiUrl.replace('{page}', (activePage - 1) as any)} onClick={(e) => { e.preventDefault(); handleClick('prev'); }}>
228
+ <li className={activePage > 1 ? `${_itemClassName} ${_previousClassName}` : `${_itemClassName} ${_previousClassName} ${_disabledClassName}`}>
229
+ <a tabIndex={activePage > 1 ? 0 : -1} aria-disabled={activePage > 1 ? 'false' : 'true'} className="page-link" data-page={activePage - 1} href={apiUrl?.replace('{page}', (activePage - 1) as any)} onClick={(e) => { e.preventDefault(); handleClick('prev'); }}>
221
230
  {previousLabel || null}
222
231
  </a>
223
232
  </li>
@@ -228,8 +237,8 @@ const Pagination = forwardRef((props: PaginationProps, externalRef: any) => {
228
237
  navArr.map((item: any, i: number) => {
229
238
  if (item > 0 && item <= totalPages && !_onlyPrevNextButtons) {
230
239
  return (
231
- <li key={i} className={activePage === item ? `page-item ${_activeClassNameName}` : `page-item`}>
232
- <a className="page-link" data-page={item} href={apiUrl.replace('{page}', item)} onClick={(e) => {
240
+ <li key={i} className={activePage === item ? `${_itemClassName} ${_activeClassName}` : `${_itemClassName}`}>
241
+ <a className="page-link" data-page={item} href={apiUrl?.replace('{page}', item)} onClick={(e) => {
233
242
  e.preventDefault();
234
243
  onChange?.(Number(item), Number(totalPages));
235
244
  }}>{item}</a>
@@ -241,12 +250,12 @@ const Pagination = forwardRef((props: PaginationProps, externalRef: any) => {
241
250
  }
242
251
 
243
252
 
244
- {_ellipsis !== '' && _ellipsisEnabled ? <><li className="page-item"><span className="page-link">{_ellipsis}</span></li></> : ''}
253
+ {_ellipsis !== '' && _ellipsisEnabled ? <><li className={_itemClassName}><span className="page-link">{_ellipsis}</span></li></> : ''}
245
254
  {_ellipsisElements}
246
255
 
247
256
  {nextLabel ? (
248
- <li className={activePage < totalPages ? `page-item ${_nextClassNameName}` : `page-item ${_nextClassNameName} ${_disabledClassNameName}`}>
249
- <a tabIndex={activePage < totalPages ? 0 : -1} aria-disabled={activePage < totalPages ? 'false' : 'true'} className="page-link" data-page={activePage + 1} href={apiUrl.replace('{page}', (activePage + 1) as any)} onClick={(e) => { e.preventDefault(); handleClick('next'); }}>
257
+ <li className={activePage < totalPages ? `${_itemClassName} ${_nextClassName}` : `${_itemClassName} ${_nextClassName} ${_disabledClassName}`}>
258
+ <a tabIndex={activePage < totalPages ? 0 : -1} aria-disabled={activePage < totalPages ? 'false' : 'true'} className="page-link" data-page={activePage + 1} href={apiUrl?.replace('{page}', (activePage + 1) as any)} onClick={(e) => { e.preventDefault(); handleClick('next'); }}>
250
259
  {nextLabel || null}
251
260
  </a>
252
261
  </li>
@@ -254,8 +263,8 @@ const Pagination = forwardRef((props: PaginationProps, externalRef: any) => {
254
263
 
255
264
 
256
265
  {lastLabel ? (
257
- <li className={activePage < totalPages ? `page-item ${_lastClassNameName}` : `page-item ${_lastClassNameName} ${_disabledClassNameName}`}>
258
- <a tabIndex={activePage < totalPages ? 0 : -1} aria-disabled={activePage < totalPages ? 'false' : 'true'} className="page-link" data-page={totalPages} href={apiUrl.replace('{page}', totalPages as any)} onClick={(e) => { e.preventDefault(); handleClick('last'); }}>
266
+ <li className={activePage < totalPages ? `${_itemClassName} ${_lastClassName}` : `${_itemClassName} ${_lastClassName} ${_disabledClassName}`}>
267
+ <a tabIndex={activePage < totalPages ? 0 : -1} aria-disabled={activePage < totalPages ? 'false' : 'true'} className="page-link" data-page={totalPages} href={apiUrl?.replace('{page}', totalPages as any)} onClick={(e) => { e.preventDefault(); handleClick('last'); }}>
259
268
  {lastLabel || null}
260
269
  </a>
261
270
  </li>
@@ -8,6 +8,7 @@ import {
8
8
  } from 'funda-utils';
9
9
 
10
10
 
11
+
11
12
  export interface OptionConfig {
12
13
  [propName: string]: string | number | React.ReactNode | boolean;
13
14
  }
@@ -358,6 +359,12 @@ const Radio = forwardRef((props: RadioProps, externalRef: any) => {
358
359
  return Array.isArray(dataInit) ? dataInit.map((item: any, index: number) => {
359
360
  const requiredVal = index === 0 ? required || null : null;
360
361
 
362
+ const _formatItem = {};
363
+ Object.keys(item).forEach((key: string) => {
364
+ if (key !== 'extends') _formatItem[key] = item[key];
365
+ });
366
+
367
+
361
368
  const _groupEl = () => {
362
369
  return <>
363
370
  {/* GROUP LABEL */}
@@ -366,6 +373,12 @@ const Radio = forwardRef((props: RadioProps, externalRef: any) => {
366
373
 
367
374
  {item.optgroup.map((opt: any, optIndex: number) => {
368
375
 
376
+ const _formatOpt = {};
377
+ Object.keys(item).forEach((key: string) => {
378
+ if (key !== 'extends') _formatOpt[key] = item[key];
379
+ });
380
+
381
+
369
382
  return <div key={'option-' + optIndex} className={`${inline ? `form-check form-check-inline` : `form-check`} ${controlValue == opt.value ? (itemSelectedClassName || 'item-selected') : ''}`}>
370
383
  <div className="d-inline-block">
371
384
  <input
@@ -382,7 +395,7 @@ const Radio = forwardRef((props: RadioProps, externalRef: any) => {
382
395
  data-list-item-label={`${typeof opt.listItemLabel === 'undefined' ? '' : opt.listItemLabel}`}
383
396
  data-value={opt.value}
384
397
  data-disabled={disabled || (typeof opt.disabled !== 'undefined' ? `${opt.disabled}` : 'false')}
385
- data-optiondata={JSON.stringify(opt)}
398
+ data-optiondata={JSON.stringify(_formatOpt)}
386
399
  value={`${opt.value}`}
387
400
  required={requiredVal}
388
401
  disabled={disabled || (typeof opt.disabled !== 'undefined' ? opt.disabled : null)}
@@ -424,7 +437,7 @@ const Radio = forwardRef((props: RadioProps, externalRef: any) => {
424
437
  data-list-item-label={`${typeof item.listItemLabel === 'undefined' ? '' : item.listItemLabel}`}
425
438
  data-value={item.value}
426
439
  data-disabled={disabled || (typeof item.disabled !== 'undefined' ? `${item.disabled}` : 'false')}
427
- data-optiondata={JSON.stringify(item)}
440
+ data-optiondata={JSON.stringify(_formatItem)}
428
441
  value={`${item.value}`}
429
442
  required={requiredVal}
430
443
  disabled={disabled || (typeof item.disabled !== 'undefined' ? item.disabled : null)}
@@ -456,7 +469,7 @@ const Radio = forwardRef((props: RadioProps, externalRef: any) => {
456
469
  colSpan={1}
457
470
  className={`radio-group__wrapper ${groupWrapperClassName || ''} ${tableLayoutCellClassName || ''}`}
458
471
  key={'optgroup-' + index}
459
- data-optiondata={JSON.stringify(item)}
472
+ data-optiondata={JSON.stringify(_formatItem)}
460
473
  >
461
474
  {_groupEl()}
462
475
  </td>;
@@ -466,7 +479,7 @@ const Radio = forwardRef((props: RadioProps, externalRef: any) => {
466
479
  colSpan={1}
467
480
  className={`${inline ? `form-check form-check-inline` : `form-check`} ${controlValue == item.value ? (itemSelectedClassName || 'item-selected') : ''} ${tableLayoutCellClassName || ''}`}
468
481
  key={'option-' + index}
469
- data-optiondata={JSON.stringify(item)}
482
+ data-optiondata={JSON.stringify(_formatItem)}
470
483
  >
471
484
  {_normalEl()}
472
485
  </td>;
@@ -477,7 +490,7 @@ const Radio = forwardRef((props: RadioProps, externalRef: any) => {
477
490
  return <div
478
491
  className={`radio-group__wrapper ${groupWrapperClassName || ''}`}
479
492
  key={'optgroup-' + index}
480
- data-optiondata={JSON.stringify(item)}
493
+ data-optiondata={JSON.stringify(_formatItem)}
481
494
  >
482
495
  {_groupEl()}
483
496
  </div>;
@@ -486,7 +499,7 @@ const Radio = forwardRef((props: RadioProps, externalRef: any) => {
486
499
  return <div
487
500
  className={`${inline ? `form-check form-check-inline` : `form-check`} ${controlValue == item.value ? (itemSelectedClassName || 'item-selected') : ''}`}
488
501
  key={'option-' + index}
489
- data-optiondata={JSON.stringify(item)}
502
+ data-optiondata={JSON.stringify(_formatItem)}
490
503
  >
491
504
  {_normalEl()}
492
505
  </div>;
@@ -33,7 +33,9 @@ $control-height: 0.75rem;
33
33
  --range-slider-rail: #e9ecef;
34
34
  --range-slider-inner-rail: #0d6efd;
35
35
 
36
+ position: relative; /* Required */
36
37
 
38
+
37
39
  > div:not(.range-slider__control-wrapper) {
38
40
  width: 49% !important;
39
41
  display: inline-block !important;
@@ -4,7 +4,6 @@
4
4
 
5
5
  .custom-select__wrapper {
6
6
 
7
-
8
7
  --cus-sel-focus-border-color:#86b7fe;
9
8
  --cus-sel-focus-box-shadow: 0 0 0 0.25rem rgba(13,110,253,.25);
10
9
  --cus-sel-placeholder-color: rgba(33, 37, 41, 0.75);
@@ -18,6 +17,8 @@
18
17
  --cus-sel-removebtn-fill: #000;
19
18
  --cus-sel-removebtn-hover-fill: #f00;
20
19
 
20
+ position: relative; /* Required */
21
+
21
22
 
22
23
 
23
24
  /*------ Placeholder for input ------*/
@@ -306,6 +307,10 @@
306
307
 
307
308
  /*------ Search button ------*/
308
309
  .custom-select-multi__control-searchbtn {
310
+ position: absolute;
311
+ right: 0;
312
+ top: 50%;
313
+ transform: translateY(-50%);
309
314
  z-index: 5;
310
315
  pointer-events: auto;
311
316