@coreui/react-pro 5.18.0 → 5.19.0
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/README.md +1 -1
- package/dist/cjs/components/autocomplete/CAutocomplete.d.ts +16 -2
- package/dist/cjs/components/autocomplete/CAutocomplete.js +99 -86
- package/dist/cjs/components/autocomplete/CAutocomplete.js.map +1 -1
- package/dist/cjs/components/calendar/utils.d.ts +0 -11
- package/dist/cjs/components/calendar/utils.js.map +1 -1
- package/dist/cjs/components/multi-select/CMultiSelect.d.ts +6 -0
- package/dist/cjs/components/multi-select/CMultiSelect.js +13 -12
- package/dist/cjs/components/multi-select/CMultiSelect.js.map +1 -1
- package/dist/cjs/components/multi-select/CMultiSelectOptions.js +6 -5
- package/dist/cjs/components/multi-select/CMultiSelectOptions.js.map +1 -1
- package/dist/cjs/components/multi-select/CMultiSelectSelection.js +1 -1
- package/dist/cjs/components/multi-select/CMultiSelectSelection.js.map +1 -1
- package/dist/cjs/components/multi-select/utils.d.ts +0 -2
- package/dist/cjs/components/multi-select/utils.js +0 -26
- package/dist/cjs/components/multi-select/utils.js.map +1 -1
- package/dist/cjs/utils/getNextSibling.js +3 -0
- package/dist/cjs/utils/getNextSibling.js.map +1 -1
- package/dist/cjs/utils/getPreviousSibling.js +3 -0
- package/dist/cjs/utils/getPreviousSibling.js.map +1 -1
- package/dist/esm/components/autocomplete/CAutocomplete.d.ts +16 -2
- package/dist/esm/components/autocomplete/CAutocomplete.js +99 -86
- package/dist/esm/components/autocomplete/CAutocomplete.js.map +1 -1
- package/dist/esm/components/calendar/utils.d.ts +0 -11
- package/dist/esm/components/calendar/utils.js.map +1 -1
- package/dist/esm/components/multi-select/CMultiSelect.d.ts +6 -0
- package/dist/esm/components/multi-select/CMultiSelect.js +14 -13
- package/dist/esm/components/multi-select/CMultiSelect.js.map +1 -1
- package/dist/esm/components/multi-select/CMultiSelectOptions.js +4 -3
- package/dist/esm/components/multi-select/CMultiSelectOptions.js.map +1 -1
- package/dist/esm/components/multi-select/CMultiSelectSelection.js +1 -1
- package/dist/esm/components/multi-select/CMultiSelectSelection.js.map +1 -1
- package/dist/esm/components/multi-select/utils.d.ts +0 -2
- package/dist/esm/components/multi-select/utils.js +1 -25
- package/dist/esm/components/multi-select/utils.js.map +1 -1
- package/dist/esm/utils/getNextSibling.js +3 -0
- package/dist/esm/utils/getNextSibling.js.map +1 -1
- package/dist/esm/utils/getPreviousSibling.js +3 -0
- package/dist/esm/utils/getPreviousSibling.js.map +1 -1
- package/package.json +7 -7
- package/src/components/autocomplete/CAutocomplete.tsx +190 -146
- package/src/components/calendar/utils.ts +0 -26
- package/src/components/multi-select/CMultiSelect.tsx +23 -4
- package/src/components/multi-select/CMultiSelectOptions.tsx +8 -5
- package/src/components/multi-select/CMultiSelectSelection.tsx +3 -3
- package/src/components/multi-select/utils.ts +0 -34
|
@@ -29,7 +29,7 @@ export const CMultiSelectSelection = forwardRef<HTMLSpanElement, CMultiSelectSel
|
|
|
29
29
|
selectionType,
|
|
30
30
|
selectionTypeCounterText,
|
|
31
31
|
},
|
|
32
|
-
ref
|
|
32
|
+
ref
|
|
33
33
|
) => {
|
|
34
34
|
return (
|
|
35
35
|
<span
|
|
@@ -56,7 +56,7 @@ export const CMultiSelectSelection = forwardRef<HTMLSpanElement, CMultiSelectSel
|
|
|
56
56
|
className="form-multi-select-tag-delete"
|
|
57
57
|
type="button"
|
|
58
58
|
aria-label="Close"
|
|
59
|
-
onClick={() => onRemove
|
|
59
|
+
onClick={() => onRemove?.(option)}
|
|
60
60
|
/>
|
|
61
61
|
)}
|
|
62
62
|
</span>
|
|
@@ -76,7 +76,7 @@ export const CMultiSelectSelection = forwardRef<HTMLSpanElement, CMultiSelectSel
|
|
|
76
76
|
{children}
|
|
77
77
|
</span>
|
|
78
78
|
)
|
|
79
|
-
}
|
|
79
|
+
}
|
|
80
80
|
)
|
|
81
81
|
|
|
82
82
|
CMultiSelectSelection.propTypes = {
|
|
@@ -66,46 +66,12 @@ export const flattenOptionsArray = (
|
|
|
66
66
|
return optionsList
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
export const getNextSibling = (elem: HTMLElement, selector?: string) => {
|
|
70
|
-
// Get the next sibling element
|
|
71
|
-
let sibling = elem.nextElementSibling
|
|
72
|
-
|
|
73
|
-
// If there's no selector, return the first sibling
|
|
74
|
-
if (!selector) return sibling
|
|
75
|
-
|
|
76
|
-
// If the sibling matches our selector, use it
|
|
77
|
-
// If not, jump to the next sibling and continue the loop
|
|
78
|
-
while (sibling) {
|
|
79
|
-
if (sibling.matches(selector)) return sibling
|
|
80
|
-
sibling = sibling.nextElementSibling
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
return
|
|
84
|
-
}
|
|
85
|
-
|
|
86
69
|
export const getOptionsList = (container: HTMLElement): HTMLElement[] => {
|
|
87
70
|
return Array.from(
|
|
88
71
|
container.querySelectorAll('.form-multi-select-option:not(.disabled):not(:disabled)'),
|
|
89
72
|
)
|
|
90
73
|
}
|
|
91
74
|
|
|
92
|
-
export const getPreviousSibling = (elem: HTMLElement, selector?: string) => {
|
|
93
|
-
// Get the next sibling element
|
|
94
|
-
let sibling = elem.previousElementSibling
|
|
95
|
-
|
|
96
|
-
// If there's no selector, return the first sibling
|
|
97
|
-
if (!selector) return sibling
|
|
98
|
-
|
|
99
|
-
// If the sibling matches our selector, use it
|
|
100
|
-
// If not, jump to the next sibling and continue the loop
|
|
101
|
-
while (sibling) {
|
|
102
|
-
if (sibling.matches(selector)) return sibling
|
|
103
|
-
sibling = sibling.previousElementSibling
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
return
|
|
107
|
-
}
|
|
108
|
-
|
|
109
75
|
export const isExternalSearch = (search: Search): boolean => {
|
|
110
76
|
return (
|
|
111
77
|
(typeof search === 'string' && search === 'external') ||
|