@m4l/components 9.79.1 → 9.80.1-beta-docs-autocomplete-async-with-add-mf-sync.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.
Files changed (226) hide show
  1. package/components/MFLoader/MFLoader.d.ts.map +1 -1
  2. package/components/MFLoader/MFLoader.js +124 -112
  3. package/components/MFLoader/hooks/useMFCallbackLifecycle.d.ts +6 -0
  4. package/components/MFLoader/hooks/useMFCallbackLifecycle.d.ts.map +1 -0
  5. package/components/MFLoader/hooks/useMFCallbackLifecycle.js +25 -0
  6. package/components/Pager/subcomponents/CustomTablePagination/CustomTablePagination.d.ts.map +1 -1
  7. package/components/Pager/subcomponents/CustomTablePagination/CustomTablePagination.js +53 -61
  8. package/components/Pager/subcomponents/RowsPerPageSelect/RowsPerPageSelect.d.ts +7 -0
  9. package/components/Pager/subcomponents/RowsPerPageSelect/RowsPerPageSelect.d.ts.map +1 -0
  10. package/components/Pager/subcomponents/RowsPerPageSelect/RowsPerPageSelect.js +28 -0
  11. package/components/Pager/subcomponents/RowsPerPageSelect/types.d.ts +20 -0
  12. package/components/Pager/subcomponents/RowsPerPageSelect/types.d.ts.map +1 -0
  13. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/AreaGridLayout/AreaGridLayout.d.ts.map +1 -1
  14. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/AreaGridLayout/AreaGridLayout.js +49 -47
  15. package/components/areas/components/AreasViewer/test/popupAuthenticationConstants.d.ts +4 -0
  16. package/components/areas/components/AreasViewer/test/popupAuthenticationConstants.d.ts.map +1 -0
  17. package/components/areas/contexts/AreasContext/index.d.ts.map +1 -1
  18. package/components/areas/contexts/AreasContext/index.js +29 -28
  19. package/components/areas/contexts/AreasContext/tests/mfActionSupport.d.ts +22 -0
  20. package/components/areas/contexts/AreasContext/tests/mfActionSupport.d.ts.map +1 -0
  21. package/components/areas/contexts/AreasContext/useMFActionLifecycle.d.ts +4 -0
  22. package/components/areas/contexts/AreasContext/useMFActionLifecycle.d.ts.map +1 -0
  23. package/components/areas/contexts/AreasContext/useMFActionLifecycle.js +49 -0
  24. package/components/datagrids/Datagrid.styles.d.ts.map +1 -1
  25. package/components/datagrids/Datagrid.styles.js +329 -298
  26. package/components/datagrids/components/BaseDataGrid/BaseDataGrid.d.ts.map +1 -1
  27. package/components/datagrids/components/BaseDataGrid/BaseDataGrid.js +101 -95
  28. package/components/datagrids/constants.d.ts +7 -0
  29. package/components/datagrids/constants.d.ts.map +1 -1
  30. package/components/datagrids/constants.js +10 -6
  31. package/components/datagrids/contexts/DataGridContext/DataGridContext.d.ts.map +1 -1
  32. package/components/datagrids/contexts/DataGridContext/DataGridContext.js +112 -102
  33. package/components/datagrids/contexts/DataGridContext/types.d.ts +18 -3
  34. package/components/datagrids/contexts/DataGridContext/types.d.ts.map +1 -1
  35. package/components/datagrids/dictionary.d.ts +4 -0
  36. package/components/datagrids/dictionary.d.ts.map +1 -1
  37. package/components/datagrids/dictionary.js +12 -6
  38. package/components/datagrids/helpers/index.d.ts +5 -0
  39. package/components/datagrids/helpers/index.d.ts.map +1 -1
  40. package/components/datagrids/helpers/normalizeHeaderClickDeferMs.d.ts +5 -0
  41. package/components/datagrids/helpers/normalizeHeaderClickDeferMs.d.ts.map +1 -0
  42. package/components/datagrids/helpers/normalizeHeaderClickDeferMs.js +7 -0
  43. package/components/datagrids/helpers/shared/attachScrollElement/attachScrollElement.d.ts +9 -0
  44. package/components/datagrids/helpers/shared/attachScrollElement/attachScrollElement.d.ts.map +1 -0
  45. package/components/datagrids/helpers/shared/attachScrollElement/attachScrollElement.js +14 -0
  46. package/components/datagrids/helpers/shared/attachScrollElement/index.d.ts +3 -0
  47. package/components/datagrids/helpers/shared/attachScrollElement/index.d.ts.map +1 -0
  48. package/components/datagrids/helpers/shared/attachScrollElement/types.d.ts +14 -0
  49. package/components/datagrids/helpers/shared/attachScrollElement/types.d.ts.map +1 -0
  50. package/components/datagrids/helpers/shared/buildCursorExportPaginationInfo/buildCursorExportPaginationInfo.d.ts +4 -0
  51. package/components/datagrids/helpers/shared/buildCursorExportPaginationInfo/buildCursorExportPaginationInfo.d.ts.map +1 -0
  52. package/components/datagrids/helpers/shared/buildCursorExportPaginationInfo/buildCursorExportPaginationInfo.js +10 -0
  53. package/components/datagrids/helpers/shared/buildCursorExportPaginationInfo/index.d.ts +3 -0
  54. package/components/datagrids/helpers/shared/buildCursorExportPaginationInfo/index.d.ts.map +1 -0
  55. package/components/datagrids/helpers/shared/buildCursorExportPaginationInfo/types.d.ts +7 -0
  56. package/components/datagrids/helpers/shared/buildCursorExportPaginationInfo/types.d.ts.map +1 -0
  57. package/components/datagrids/helpers/shared/getInfinitePageSize/getInfinitePageSize.d.ts +4 -0
  58. package/components/datagrids/helpers/shared/getInfinitePageSize/getInfinitePageSize.d.ts.map +1 -0
  59. package/components/datagrids/helpers/shared/getInfinitePageSize/getInfinitePageSize.js +12 -0
  60. package/components/datagrids/helpers/shared/getInfinitePageSize/index.d.ts +3 -0
  61. package/components/datagrids/helpers/shared/getInfinitePageSize/index.d.ts.map +1 -0
  62. package/components/datagrids/helpers/shared/getInfinitePageSize/types.d.ts +8 -0
  63. package/components/datagrids/helpers/shared/getInfinitePageSize/types.d.ts.map +1 -0
  64. package/components/datagrids/helpers/shared/isNearBottom/index.d.ts +2 -0
  65. package/components/datagrids/helpers/shared/isNearBottom/index.d.ts.map +1 -0
  66. package/components/datagrids/helpers/shared/isNearBottom/isNearBottom.d.ts +15 -0
  67. package/components/datagrids/helpers/shared/isNearBottom/isNearBottom.d.ts.map +1 -0
  68. package/components/datagrids/helpers/shared/isNearBottom/isNearBottom.js +6 -0
  69. package/components/datagrids/hooks/index.d.ts +2 -0
  70. package/components/datagrids/hooks/index.d.ts.map +1 -1
  71. package/components/datagrids/hooks/shared/useInfiniteScroll/index.d.ts +3 -0
  72. package/components/datagrids/hooks/shared/useInfiniteScroll/index.d.ts.map +1 -0
  73. package/components/datagrids/hooks/shared/useInfiniteScroll/types.d.ts +26 -0
  74. package/components/datagrids/hooks/shared/useInfiniteScroll/types.d.ts.map +1 -0
  75. package/components/datagrids/hooks/shared/useInfiniteScroll/useInfiniteScroll.d.ts +13 -0
  76. package/components/datagrids/hooks/shared/useInfiniteScroll/useInfiniteScroll.d.ts.map +1 -0
  77. package/components/datagrids/hooks/shared/useInfiniteScroll/useInfiniteScroll.js +69 -0
  78. package/components/datagrids/hooks/useInfiniteScrollGate/index.d.ts +3 -0
  79. package/components/datagrids/hooks/useInfiniteScrollGate/index.d.ts.map +1 -0
  80. package/components/datagrids/hooks/useInfiniteScrollGate/types.d.ts +32 -0
  81. package/components/datagrids/hooks/useInfiniteScrollGate/types.d.ts.map +1 -0
  82. package/components/datagrids/hooks/useInfiniteScrollGate/useInfiniteScrollGate.d.ts +17 -0
  83. package/components/datagrids/hooks/useInfiniteScrollGate/useInfiniteScrollGate.d.ts.map +1 -0
  84. package/components/datagrids/hooks/useInfiniteScrollGate/useInfiniteScrollGate.js +20 -0
  85. package/components/datagrids/hooks/useRemeasureOnReady/useRemeasureOnReady.d.ts +4 -1
  86. package/components/datagrids/hooks/useRemeasureOnReady/useRemeasureOnReady.d.ts.map +1 -1
  87. package/components/datagrids/hooks/useRemeasureOnReady/useRemeasureOnReady.js +33 -25
  88. package/components/datagrids/index.d.ts +5 -2
  89. package/components/datagrids/index.d.ts.map +1 -1
  90. package/components/datagrids/slots/DataGridEnum.d.ts +4 -0
  91. package/components/datagrids/slots/DataGridEnum.d.ts.map +1 -1
  92. package/components/datagrids/slots/DataGridEnum.js +5 -4
  93. package/components/datagrids/slots/DataGridSlot.d.ts +11 -0
  94. package/components/datagrids/slots/DataGridSlot.d.ts.map +1 -1
  95. package/components/datagrids/slots/DataGridSlot.js +121 -113
  96. package/components/datagrids/subcomponents/InfiniteScrollStatus/InfiniteScrollStatus.d.ts +8 -0
  97. package/components/datagrids/subcomponents/InfiniteScrollStatus/InfiniteScrollStatus.d.ts.map +1 -0
  98. package/components/datagrids/subcomponents/InfiniteScrollStatus/InfiniteScrollStatus.js +46 -0
  99. package/components/datagrids/subcomponents/InfiniteScrollStatus/index.d.ts +3 -0
  100. package/components/datagrids/subcomponents/InfiniteScrollStatus/index.d.ts.map +1 -0
  101. package/components/datagrids/subcomponents/InfiniteScrollStatus/types.d.ts +11 -0
  102. package/components/datagrids/subcomponents/InfiniteScrollStatus/types.d.ts.map +1 -0
  103. package/components/datagrids/subcomponents/index.d.ts +1 -0
  104. package/components/datagrids/subcomponents/index.d.ts.map +1 -1
  105. package/components/datagrids/tests/helpers/InfiniteScrollStory.d.ts +9 -0
  106. package/components/datagrids/tests/helpers/InfiniteScrollStory.d.ts.map +1 -0
  107. package/components/datagrids/tests/helpers/infiniteScrollStoryHelpers.d.ts +22 -0
  108. package/components/datagrids/tests/helpers/infiniteScrollStoryHelpers.d.ts.map +1 -0
  109. package/components/datagrids/types.d.ts +69 -4
  110. package/components/datagrids/types.d.ts.map +1 -1
  111. package/components/datagrids/views/CardsView/CardsView.d.ts.map +1 -1
  112. package/components/datagrids/views/CardsView/CardsView.js +90 -79
  113. package/components/datagrids/views/CardsView/helpers/observeContainerWidth/index.d.ts +3 -0
  114. package/components/datagrids/views/CardsView/helpers/observeContainerWidth/index.d.ts.map +1 -0
  115. package/components/datagrids/views/CardsView/helpers/observeContainerWidth/observeContainerWidth.d.ts +9 -0
  116. package/components/datagrids/views/CardsView/helpers/observeContainerWidth/observeContainerWidth.d.ts.map +1 -0
  117. package/components/datagrids/views/CardsView/helpers/observeContainerWidth/observeContainerWidth.js +13 -0
  118. package/components/datagrids/views/CardsView/helpers/observeContainerWidth/types.d.ts +14 -0
  119. package/components/datagrids/views/CardsView/helpers/observeContainerWidth/types.d.ts.map +1 -0
  120. package/components/datagrids/views/CardsView/hooks/useCardsPerRow/types.d.ts +15 -0
  121. package/components/datagrids/views/CardsView/hooks/useCardsPerRow/types.d.ts.map +1 -0
  122. package/components/datagrids/views/CardsView/hooks/useCardsPerRow/useCardsPerRow.d.ts.map +1 -1
  123. package/components/datagrids/views/CardsView/hooks/useCardsPerRow/useCardsPerRow.js +18 -14
  124. package/components/datagrids/views/ListView/ListView.d.ts.map +1 -1
  125. package/components/datagrids/views/ListView/ListView.js +65 -54
  126. package/components/datagrids/views/TableView/TableView.d.ts.map +1 -1
  127. package/components/datagrids/views/TableView/TableView.js +119 -111
  128. package/components/datagrids/views/TableView/helpers/getDragHeaderRenderer/getDragHeaderRenderer.d.ts +1 -0
  129. package/components/datagrids/views/TableView/helpers/getDragHeaderRenderer/getDragHeaderRenderer.d.ts.map +1 -1
  130. package/components/datagrids/views/TableView/helpers/getDragHeaderRenderer/getDragHeaderRenderer.js +9 -8
  131. package/components/datagrids/views/TableView/hooks/useColumnSortRules/index.d.ts +2 -0
  132. package/components/datagrids/views/TableView/hooks/useColumnSortRules/index.d.ts.map +1 -0
  133. package/components/datagrids/views/TableView/hooks/useColumnSortRules/useColumnSortRules.d.ts +25 -0
  134. package/components/datagrids/views/TableView/hooks/useColumnSortRules/useColumnSortRules.d.ts.map +1 -0
  135. package/components/datagrids/views/TableView/hooks/useColumnSortRules/useColumnSortRules.js +97 -0
  136. package/components/datagrids/views/TableView/hooks/useHeaderMenuActions/useHeaderMenuActions.d.ts.map +1 -1
  137. package/components/datagrids/views/TableView/hooks/useHeaderMenuActions/useHeaderMenuActions.js +117 -138
  138. package/components/datagrids/views/TableView/hooks/useSortColumnsRows/useSortColumnsRows.d.ts.map +1 -1
  139. package/components/datagrids/views/TableView/hooks/useSortColumnsRows/useSortColumnsRows.js +57 -54
  140. package/components/datagrids/views/TableView/subcomponents/DraggableHeaderRenderer/DraggableHeaderRenderer.d.ts.map +1 -1
  141. package/components/datagrids/views/TableView/subcomponents/DraggableHeaderRenderer/DraggableHeaderRenderer.js +108 -82
  142. package/components/datagrids/views/TableView/subcomponents/DraggableHeaderRenderer/types.d.ts +2 -0
  143. package/components/datagrids/views/TableView/subcomponents/DraggableHeaderRenderer/types.d.ts.map +1 -1
  144. package/components/extended/mui/Autocomplete/Autocomplete.d.ts.map +1 -1
  145. package/components/extended/mui/Autocomplete/Autocomplete.js +55 -54
  146. package/components/extended/mui/Autocomplete/hooks/useAutocomplete/useAutocomplete.d.ts.map +1 -1
  147. package/components/extended/mui/Autocomplete/hooks/useAutocomplete/useAutocomplete.js +81 -72
  148. package/components/extended/mui/Autocomplete/types.d.ts +1 -1
  149. package/components/extended/mui/Autocomplete/types.d.ts.map +1 -1
  150. package/components/extended/mui/AutocompleteAsync/AutocompleteAddButton.d.ts +4 -0
  151. package/components/extended/mui/AutocompleteAsync/AutocompleteAddButton.d.ts.map +1 -0
  152. package/components/extended/mui/AutocompleteAsync/AutocompleteAddButton.js +23 -0
  153. package/components/extended/mui/AutocompleteAsync/AutocompleteAsync.d.ts +5 -9
  154. package/components/extended/mui/AutocompleteAsync/AutocompleteAsync.d.ts.map +1 -1
  155. package/components/extended/mui/AutocompleteAsync/AutocompleteAsync.js +87 -56
  156. package/components/extended/mui/AutocompleteAsync/constants.d.ts +4 -1
  157. package/components/extended/mui/AutocompleteAsync/constants.d.ts.map +1 -1
  158. package/components/extended/mui/AutocompleteAsync/constants.js +24 -12
  159. package/components/extended/mui/AutocompleteAsync/hooks/useAutocompleteAdd.d.ts +9 -0
  160. package/components/extended/mui/AutocompleteAsync/hooks/useAutocompleteAdd.d.ts.map +1 -0
  161. package/components/extended/mui/AutocompleteAsync/hooks/useAutocompleteAdd.js +97 -0
  162. package/components/extended/mui/AutocompleteAsync/hooks/useFetchOptions.d.ts.map +1 -1
  163. package/components/extended/mui/AutocompleteAsync/hooks/useFetchOptions.js +47 -46
  164. package/components/extended/mui/AutocompleteAsync/index.d.ts +1 -1
  165. package/components/extended/mui/AutocompleteAsync/index.d.ts.map +1 -1
  166. package/components/extended/mui/AutocompleteAsync/reducer/AutocompleteAsyncReducer.d.ts.map +1 -1
  167. package/components/extended/mui/AutocompleteAsync/reducer/AutocompleteAsyncReducer.js +50 -28
  168. package/components/extended/mui/AutocompleteAsync/slots/addStyled.d.ts +6 -0
  169. package/components/extended/mui/AutocompleteAsync/slots/addStyled.d.ts.map +1 -0
  170. package/components/extended/mui/AutocompleteAsync/slots/addStyled.js +19 -0
  171. package/components/extended/mui/AutocompleteAsync/tests/add/constants.d.ts +5 -0
  172. package/components/extended/mui/AutocompleteAsync/tests/add/constants.d.ts.map +1 -0
  173. package/components/extended/mui/AutocompleteAsync/tests/add/helpers.d.ts +8 -0
  174. package/components/extended/mui/AutocompleteAsync/tests/add/helpers.d.ts.map +1 -0
  175. package/components/extended/mui/AutocompleteAsync/tests/add/types.d.ts +20 -0
  176. package/components/extended/mui/AutocompleteAsync/tests/add/types.d.ts.map +1 -0
  177. package/components/extended/mui/AutocompleteAsync/tests/support/ControlledAsyncField.d.ts +4 -0
  178. package/components/extended/mui/AutocompleteAsync/tests/support/ControlledAsyncField.d.ts.map +1 -0
  179. package/components/extended/mui/AutocompleteAsync/tests/support/constants.d.ts +8 -0
  180. package/components/extended/mui/AutocompleteAsync/tests/support/constants.d.ts.map +1 -0
  181. package/components/extended/mui/AutocompleteAsync/tests/support/createDeferred.d.ts +4 -0
  182. package/components/extended/mui/AutocompleteAsync/tests/support/createDeferred.d.ts.map +1 -0
  183. package/components/extended/mui/AutocompleteAsync/tests/support/mockAutocompleteAnchor.d.ts +3 -0
  184. package/components/extended/mui/AutocompleteAsync/tests/support/mockAutocompleteAnchor.d.ts.map +1 -0
  185. package/components/extended/mui/AutocompleteAsync/tests/support/types.d.ts +21 -0
  186. package/components/extended/mui/AutocompleteAsync/tests/support/types.d.ts.map +1 -0
  187. package/components/extended/mui/AutocompleteAsync/types.d.ts +47 -0
  188. package/components/extended/mui/AutocompleteAsync/types.d.ts.map +1 -1
  189. package/components/extended/mui/AutocompleteAsync/types.js +4 -2
  190. package/components/extended/mui/IconButton/IconButton.styles.d.ts +1 -1
  191. package/components/hook-form/RHFAutocompleteAsync/RHFAutocompleteAsync.d.ts +1 -1
  192. package/components/hook-form/RHFAutocompleteAsync/index.d.ts +1 -0
  193. package/components/hook-form/RHFAutocompleteAsync/index.d.ts.map +1 -1
  194. package/components/hook-form/RHFAutocompleteAsync/tests/addConstants.d.ts +3 -0
  195. package/components/hook-form/RHFAutocompleteAsync/tests/addConstants.d.ts.map +1 -0
  196. package/components/hook-form/RHFAutocompleteAsync/tests/addHelpers.d.ts +4 -0
  197. package/components/hook-form/RHFAutocompleteAsync/tests/addHelpers.d.ts.map +1 -0
  198. package/components/hook-form/RHFAutocompleteAsync/tests/addTypes.d.ts +12 -0
  199. package/components/hook-form/RHFAutocompleteAsync/tests/addTypes.d.ts.map +1 -0
  200. package/components/hook-form/index.d.ts +1 -0
  201. package/components/hook-form/index.d.ts.map +1 -1
  202. package/index.d.ts +1 -0
  203. package/index.d.ts.map +1 -1
  204. package/index.js +764 -746
  205. package/package.json +6 -6
  206. package/utils/mfActions/constants.d.ts +6 -0
  207. package/utils/mfActions/constants.d.ts.map +1 -0
  208. package/utils/mfActions/constants.js +8 -0
  209. package/utils/mfActions/index.d.ts +5 -0
  210. package/utils/mfActions/index.d.ts.map +1 -0
  211. package/utils/mfActions/mfActions.d.ts +10 -0
  212. package/utils/mfActions/mfActions.d.ts.map +1 -0
  213. package/utils/mfActions/mfActions.js +47 -0
  214. package/utils/mfActions/openMFCallbackAction.d.ts +4 -0
  215. package/utils/mfActions/openMFCallbackAction.d.ts.map +1 -0
  216. package/utils/mfActions/openMFCallbackAction.js +36 -0
  217. package/utils/mfActions/tests/callbackHelpers.d.ts +9 -0
  218. package/utils/mfActions/tests/callbackHelpers.d.ts.map +1 -0
  219. package/utils/mfActions/tests/constants.d.ts +6 -0
  220. package/utils/mfActions/tests/constants.d.ts.map +1 -0
  221. package/utils/mfActions/tests/helpers.d.ts +4 -0
  222. package/utils/mfActions/tests/helpers.d.ts.map +1 -0
  223. package/utils/mfActions/tests/types.d.ts +8 -0
  224. package/utils/mfActions/tests/types.d.ts.map +1 -0
  225. package/utils/mfActions/types.d.ts +47 -0
  226. package/utils/mfActions/types.d.ts.map +1 -0
@@ -1,14 +1,14 @@
1
1
  import { jsx as o } from "@emotion/react/jsx-runtime";
2
- import { forwardRef as K, useCallback as i } from "react";
3
- import { useAutocomplete as j } from "./hooks/useAutocomplete/useAutocomplete.js";
4
- import { AUTOCOMPLETE_CLASSES as B } from "./constants.js";
5
- import U from "clsx";
6
- import { PopperComponent as _ } from "./subcomponents/PopperComponent/PopperComponent.js";
7
- import { PaperComponent as v } from "./subcomponents/PaperComponent/PaperComponent.js";
8
- import { SkeletonAutocompleteStyled as G, AutocompleteRootStyled as H } from "./slots/AutocompleteSlots.js";
9
- import { NoOptionsText as J } from "./subcomponents/NoOptionsText/NoOptionsText.js";
10
- import { LoadingText as Q } from "./subcomponents/LoadingText/LoadingText.js";
11
- function X(l, d) {
2
+ import { forwardRef as j, useCallback as i } from "react";
3
+ import { useAutocomplete as B } from "./hooks/useAutocomplete/useAutocomplete.js";
4
+ import { AUTOCOMPLETE_CLASSES as U } from "./constants.js";
5
+ import _ from "clsx";
6
+ import { PopperComponent as v } from "./subcomponents/PopperComponent/PopperComponent.js";
7
+ import { PaperComponent as G } from "./subcomponents/PaperComponent/PaperComponent.js";
8
+ import { SkeletonAutocompleteStyled as H, AutocompleteRootStyled as J } from "./slots/AutocompleteSlots.js";
9
+ import { NoOptionsText as Q } from "./subcomponents/NoOptionsText/NoOptionsText.js";
10
+ import { LoadingText as X } from "./subcomponents/LoadingText/LoadingText.js";
11
+ function Y(l, d) {
12
12
  const {
13
13
  options: f,
14
14
  disabled: C,
@@ -19,87 +19,88 @@ function X(l, d) {
19
19
  className: O,
20
20
  menuMinWidth: h,
21
21
  minWidth: g,
22
- htmlFor: P
22
+ htmlFor: P,
23
+ id: S
23
24
  } = l, {
24
25
  // useAutocomplete values
25
26
  ownerState: t,
26
- isSkeleton: S,
27
- memoizedRenderOption: T,
28
- memoizedRenderInput: V,
27
+ isSkeleton: T,
28
+ memoizedRenderOption: V,
29
+ memoizedRenderInput: w,
29
30
  // useValuesAndHandlers values
30
- open: w,
31
- selectedValue: x,
32
- inputValue: A,
33
- isOptionEqualToValueLocal: z,
34
- handleChange: I,
35
- handleInputChange: y,
36
- onCloseLocal: E,
37
- onOpenLocal: M,
31
+ open: x,
32
+ selectedValue: A,
33
+ inputValue: z,
34
+ isOptionEqualToValueLocal: I,
35
+ handleChange: y,
36
+ handleInputChange: E,
37
+ onCloseLocal: M,
38
+ onOpenLocal: R,
38
39
  getOptionLabelLocal: n,
39
- checkKeyDown: R,
40
+ checkKeyDown: k,
40
41
  scrollPositionOptionsRef: s
41
- } = j(l), u = h ?? g, k = i((e) => /* @__PURE__ */ o(
42
- _,
42
+ } = B(l), u = h ?? g, W = i((e) => /* @__PURE__ */ o(
43
+ v,
43
44
  {
44
45
  ...e,
45
46
  currentSize: t.size,
46
47
  menuMinWidth: u
47
48
  }
48
- ), [t.size, u]), W = i((e) => /* @__PURE__ */ o(
49
- v,
49
+ ), [t.size, u]), b = i((e) => /* @__PURE__ */ o(
50
+ G,
50
51
  {
51
52
  ...e,
52
53
  scrollPositionOptionsRef: s
53
54
  }
54
- ), [s]), b = i((e, D) => {
55
+ ), [s]), D = i((e, N) => {
55
56
  if (p)
56
57
  return e;
57
- const r = D.inputValue.trim().toLowerCase();
58
+ const r = N.inputValue.trim().toLowerCase();
58
59
  return r ? e.filter((c) => {
59
- const N = c, q = n(c).toLowerCase(), F = a?.(N)?.toLowerCase() ?? "";
60
- return q.includes(r) || F.includes(r);
60
+ const q = c, F = n(c).toLowerCase(), K = a?.(q)?.toLowerCase() ?? "";
61
+ return F.includes(r) || K.includes(r);
61
62
  }) : e;
62
63
  }, [a, n, p]);
63
- return S ? /* @__PURE__ */ o(
64
- G,
64
+ return T ? /* @__PURE__ */ o(
65
+ H,
65
66
  {
66
67
  ownerState: t
67
68
  }
68
69
  ) : /* @__PURE__ */ o(
69
- H,
70
+ J,
70
71
  {
71
72
  ownerState: t,
72
- id: P,
73
+ id: P ?? S,
73
74
  multiple: m,
74
- onKeyDown: R,
75
+ onKeyDown: k,
75
76
  ref: d,
76
77
  forcePopupIcon: !1,
77
- className: U(O, m && B.multiple),
78
+ className: _(O, m && U.multiple),
78
79
  autoSelect: !1,
79
80
  options: f,
80
81
  getOptionLabel: n,
81
82
  clearOnBlur: !1,
82
- PopperComponent: k,
83
- PaperComponent: W,
84
- isOptionEqualToValue: z,
85
- value: x,
86
- inputValue: A,
87
- onOpen: M,
88
- onClose: E,
89
- open: w,
90
- onInputChange: y,
91
- onChange: I,
83
+ PopperComponent: W,
84
+ PaperComponent: b,
85
+ isOptionEqualToValue: I,
86
+ value: A,
87
+ inputValue: z,
88
+ onOpen: R,
89
+ onClose: M,
90
+ open: x,
91
+ onInputChange: E,
92
+ onChange: y,
92
93
  loading: L,
93
- loadingText: /* @__PURE__ */ o(Q, {}),
94
+ loadingText: /* @__PURE__ */ o(X, {}),
94
95
  disabled: C,
95
- noOptionsText: /* @__PURE__ */ o(J, {}),
96
- filterOptions: b,
97
- renderOption: T,
98
- renderInput: V
96
+ noOptionsText: /* @__PURE__ */ o(Q, {}),
97
+ filterOptions: D,
98
+ renderOption: V,
99
+ renderInput: w
99
100
  }
100
101
  );
101
102
  }
102
- const pe = K(X);
103
+ const ae = j(Y);
103
104
  export {
104
- pe as Autocomplete
105
+ ae as Autocomplete
105
106
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useAutocomplete.d.ts","sourceRoot":"","sources":["../../../../../../../../../../packages/components/src/components/extended/mui/Autocomplete/hooks/useAutocomplete/useAutocomplete.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAUxE;;GAEG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,QAAQ,SAAS,OAAO,GAAG,SAAS,EAAE,KAAK,EAAE,iBAAiB,CAAC,CAAC,EAAE,QAAQ,CAAC;;;;wCA0FrD,GAAG,UAAU,GAAG;kCA4BtB,GAAG;;;;;;;;;;;;;;;;EA6ErD"}
1
+ {"version":3,"file":"useAutocomplete.d.ts","sourceRoot":"","sources":["../../../../../../../../../../packages/components/src/components/extended/mui/Autocomplete/hooks/useAutocomplete/useAutocomplete.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAUxE;;GAEG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,QAAQ,SAAS,OAAO,GAAG,SAAS,EAAE,KAAK,EAAE,iBAAiB,CAAC,CAAC,EAAE,QAAQ,CAAC;;;;wCA6FrD,GAAG,UAAU,GAAG;kCA4BtB,GAAG;;;;;;;;;;;;;;;;EAmFrD"}
@@ -1,13 +1,13 @@
1
- import { jsx as G } from "@emotion/react/jsx-runtime";
2
- import { useModuleSkeleton as J } from "@m4l/core";
3
- import { useValuesAndHandlers as Q } from "../useValuesAndHandlers.js";
4
- import { useComponentSize as U } from "../../../../../../hooks/useComponentSize/index.js";
5
- import { useMemo as X, useCallback as V } from "react";
6
- import { useMultipleChips as Y } from "../useMultipleChips.js";
7
- import { useEndAdornments as Z } from "../useEndAdornments.js";
8
- import { renderOption as $ } from "../../subcomponents/renderOptions/index.js";
9
- import { RenderInputStyled as ee } from "../../slots/AutocompleteSlots.js";
10
- function me(m) {
1
+ import { jsx as U } from "@emotion/react/jsx-runtime";
2
+ import { useModuleSkeleton as X } from "@m4l/core";
3
+ import { useValuesAndHandlers as Y } from "../useValuesAndHandlers.js";
4
+ import { useComponentSize as Z } from "../../../../../../hooks/useComponentSize/index.js";
5
+ import { useMemo as $, useCallback as N } from "react";
6
+ import { useMultipleChips as ee } from "../useMultipleChips.js";
7
+ import { useEndAdornments as te } from "../useEndAdornments.js";
8
+ import { renderOption as ne } from "../../subcomponents/renderOptions/index.js";
9
+ import { RenderInputStyled as oe } from "../../slots/AutocompleteSlots.js";
10
+ function Ae(m) {
11
11
  const {
12
12
  size: c,
13
13
  variant: i,
@@ -15,89 +15,92 @@ function me(m) {
15
15
  multiple: o,
16
16
  error: u,
17
17
  readOnly: r,
18
- startAdornment: j,
19
- endAdornment: N,
18
+ startAdornment: v,
19
+ endAdornment: D,
20
20
  getOptionStartAdornment: h,
21
- getOptionEndAdornment: d,
21
+ getOptionEndAdornment: p,
22
22
  getOptionDescription: A,
23
- loading: v,
24
- refresh: B,
25
- placeholder: P
23
+ loading: E,
24
+ refresh: M,
25
+ placeholder: P,
26
+ inputRef: g,
27
+ name: z,
28
+ onBlur: I
26
29
  } = m, {
27
- open: g,
30
+ open: b,
28
31
  selectedValue: e,
29
- inputValue: D,
30
- isOptionEqualToValueLocal: p,
31
- handleDelete: z,
32
- handleRefresh: I,
33
- handleChange: E,
34
- handleInputChange: M,
35
- onCloseLocal: w,
36
- onOpenLocal: b,
32
+ inputValue: w,
33
+ isOptionEqualToValueLocal: d,
34
+ handleDelete: L,
35
+ handleRefresh: R,
36
+ handleChange: x,
37
+ handleInputChange: _,
38
+ onCloseLocal: q,
39
+ onOpenLocal: k,
37
40
  getOptionLabelLocal: l,
38
- checkKeyDown: x,
39
- scrollPositionOptionsRef: _
40
- } = Q(m), { currentSize: s } = U(c), q = J(), L = !!m.startAdornment, k = !!(o && Array.isArray(e) && e.length > 0), R = Array.isArray(e) ? e.length > 0 : e != null, a = X(() => ({
41
+ checkKeyDown: H,
42
+ scrollPositionOptionsRef: K
43
+ } = Y(m), { currentSize: s } = Z(c), T = X(), V = !!m.startAdornment, j = !!(o && Array.isArray(e) && e.length > 0), B = Array.isArray(e) ? e.length > 0 : e != null, a = $(() => ({
41
44
  size: s,
42
45
  variant: i,
43
46
  disabled: t,
44
47
  multiple: !!o,
45
48
  error: u,
46
49
  readOnly: r,
47
- startAdornment: L,
48
- hasChips: k,
49
- hasValue: R
50
- }), [s, i, t, o, u, r, L, k, R]), f = Y({
50
+ startAdornment: V,
51
+ hasChips: j,
52
+ hasValue: B
53
+ }), [s, i, t, o, u, r, V, j, B]), f = ee({
51
54
  selectedValue: e,
52
55
  multiple: o,
53
56
  adjustedSize: s,
54
57
  getOptionLabelLocal: l,
55
58
  ownerState: a,
56
- handleDelete: z,
59
+ handleDelete: L,
57
60
  disabled: t,
58
61
  readOnly: r,
59
- startAdornment: j,
62
+ startAdornment: v,
60
63
  getOptionStartAdornment: h,
61
- getOptionEndAdornment: d,
64
+ getOptionEndAdornment: p,
62
65
  getOptionDescription: A
63
- }), C = Z({
64
- loading: v,
66
+ }), C = te({
67
+ loading: E,
65
68
  adjustedSize: s,
66
69
  ownerState: a,
67
- refresh: B,
68
- handleRefresh: I,
70
+ refresh: M,
71
+ handleRefresh: R,
69
72
  disabled: t,
70
- onOpenLocal: b,
71
- open: g,
73
+ onOpenLocal: k,
74
+ open: b,
72
75
  readOnly: r,
73
76
  multiple: o,
74
77
  selectedValue: e,
75
78
  getOptionLabelLocal: l,
76
- getOptionEndAdornment: d,
77
- endAdornment: N
78
- }), H = V((O, n) => {
79
- const S = o ? Array.isArray(e) && e.some((y) => p(n, y)) : p(n, e);
80
- return $(O, {
79
+ getOptionEndAdornment: p,
80
+ endAdornment: D
81
+ }), W = N((O, n) => {
82
+ const S = o ? Array.isArray(e) && e.some((y) => d(n, y)) : d(n, e);
83
+ return ne(O, {
81
84
  ...typeof n == "object" && n !== null ? n : {},
82
85
  label: l(n),
83
86
  selected: S,
84
87
  disabled: t,
85
88
  size: c
86
- }, h, d, A);
89
+ }, h, p, A);
87
90
  }, [
88
91
  o,
89
92
  e,
90
- p,
93
+ d,
91
94
  l,
92
95
  t,
93
96
  c,
94
97
  h,
95
- d,
98
+ p,
96
99
  A
97
- ]), K = V((O) => {
98
- const { InputLabelProps: n, inputProps: S, InputProps: y, ...T } = O, { className: te, ...W } = y, { className: ne, ...F } = S;
99
- return /* @__PURE__ */ G(
100
- ee,
100
+ ]), F = N((O) => {
101
+ const { InputLabelProps: n, inputProps: S, InputProps: y, ...G } = O, { className: re, ...J } = y, { className: se, ...Q } = S;
102
+ return /* @__PURE__ */ U(
103
+ oe,
101
104
  {
102
105
  variant: i,
103
106
  ownerState: a,
@@ -105,12 +108,15 @@ function me(m) {
105
108
  ...n,
106
109
  shrink: !0
107
110
  },
108
- inputProps: { ...F, readOnly: !!r },
111
+ inputProps: { ...Q, readOnly: !!r },
112
+ inputRef: g,
113
+ name: z,
114
+ onBlur: I,
109
115
  error: u,
110
- ...T,
116
+ ...G,
111
117
  autoComplete: "off",
112
118
  InputProps: {
113
- ...W,
119
+ ...J,
114
120
  startAdornment: f,
115
121
  endAdornment: C,
116
122
  readOnly: r
@@ -131,29 +137,32 @@ function me(m) {
131
137
  r,
132
138
  s,
133
139
  t,
134
- P
140
+ P,
141
+ g,
142
+ z,
143
+ I
135
144
  ]);
136
145
  return {
137
146
  // propiedades de useAutocomplete
138
147
  ownerState: a,
139
- isSkeleton: q,
148
+ isSkeleton: T,
140
149
  currentSize: s,
141
- memoizedRenderOption: H,
142
- memoizedRenderInput: K,
150
+ memoizedRenderOption: W,
151
+ memoizedRenderInput: F,
143
152
  // propiedades de useValuesAndHandlers
144
- open: g,
153
+ open: b,
145
154
  selectedValue: e,
146
- inputValue: D,
147
- isOptionEqualToValueLocal: p,
148
- handleDelete: z,
149
- handleRefresh: I,
150
- handleChange: E,
151
- handleInputChange: M,
152
- onCloseLocal: w,
153
- onOpenLocal: b,
155
+ inputValue: w,
156
+ isOptionEqualToValueLocal: d,
157
+ handleDelete: L,
158
+ handleRefresh: R,
159
+ handleChange: x,
160
+ handleInputChange: _,
161
+ onCloseLocal: q,
162
+ onOpenLocal: k,
154
163
  getOptionLabelLocal: l,
155
- checkKeyDown: x,
156
- scrollPositionOptionsRef: _,
164
+ checkKeyDown: H,
165
+ scrollPositionOptionsRef: K,
157
166
  // propiedades de useMultipleChips
158
167
  multipleChips: f,
159
168
  // propiedades de useEndAdornments
@@ -161,5 +170,5 @@ function me(m) {
161
170
  };
162
171
  }
163
172
  export {
164
- me as useAutocomplete
173
+ Ae as useAutocomplete
165
174
  };
@@ -43,7 +43,7 @@ export type AdornmentType = ReactElement | string;
43
43
  * Props for the unified Autocomplete component.
44
44
  * Supports both single and multiple selection, and two types: `text` and `image`.
45
45
  */
46
- export interface AutocompleteProps<T, Multiple extends boolean | undefined> extends Pick<MUIAutocompleteProps<T, Multiple, undefined, false>, 'options' | 'onOpen' | 'onClose' | 'loading' | 'disabled'>, Pick<TextFieldProps, 'error'>, BaseAutocompleteProps {
46
+ export interface AutocompleteProps<T, Multiple extends boolean | undefined> extends Pick<MUIAutocompleteProps<T, Multiple, undefined, false>, 'options' | 'onOpen' | 'onClose' | 'loading' | 'disabled'>, Pick<TextFieldProps, 'error' | 'name' | 'onBlur' | 'inputRef' | 'id'>, BaseAutocompleteProps {
47
47
  /**
48
48
  * Whether the text field is rendered in read-only mode.
49
49
  * readOnly={true}
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/extended/mui/Autocomplete/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,gCAAgC,EAChC,6BAA6B,EAC7B,iBAAiB,IAAI,oBAAoB,EACzC,KAAK,EACN,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,KAAK,MAAM,CAAC;AAC9D,MAAM,MAAM,oBAAoB,GAAG,UAAU,GAAG,MAAM,CAAC;AACvD;;GAEG;AACH,MAAM,MAAM,4BAA4B,CAA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AAc,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,uGAAuG;IACvG,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,EAAE,qBAAqB,CAAC,MAAM,CAAC,CAAC;IACpC,OAAO,EAAE,qBAAqB,CAAC,SAAS,CAAC,CAAC;CAC3C,CAAC;AACF;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,MAAM,OAAO,iBAAiB,CAAC;AACnE;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAC5B,sBAAsB,CACpB,qBAAqB,EACrB,OAAO,0BAA0B,EACjC,KAAK,CACN,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/extended/mui/Autocomplete/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,gCAAgC,EAChC,6BAA6B,EAC7B,iBAAiB,IAAI,oBAAoB,EACzC,KAAK,EACN,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,KAAK,MAAM,CAAC;AAC9D,MAAM,MAAM,oBAAoB,GAAG,UAAU,GAAG,MAAM,CAAC;AACvD;;GAEG;AACH,MAAM,MAAM,4BAA4B,CAAC,CAAC,IAAI;IAC5C,MAAM,EAAE;QACN,KAAK,EAAE,CAAC,GAAG,CAAC,EAAE,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ACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,uGAAuG;IACvG,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,EAAE,qBAAqB,CAAC,MAAM,CAAC,CAAC;IACpC,OAAO,EAAE,qBAAqB,CAAC,SAAS,CAAC,CAAC;CAC3C,CAAC;AACF;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,MAAM,OAAO,iBAAiB,CAAC;AACnE;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAC5B,sBAAsB,CACpB,qBAAqB,EACrB,OAAO,0BAA0B,EACjC,KAAK,CACN,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { AutocompleteAddButtonProps } from './types';
2
+ /** Render the trailing creation action at the same resolved size as the input. */
3
+ export declare function AutocompleteAddButton({ buttonRef, tooltip, size, ...props }: AutocompleteAddButtonProps): import("@emotion/react/jsx-runtime").JSX.Element;
4
+ //# sourceMappingURL=AutocompleteAddButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AutocompleteAddButton.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/extended/mui/AutocompleteAsync/AutocompleteAddButton.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC;AAG1D,kFAAkF;AAClF,wBAAgB,qBAAqB,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,EAAE,0BAA0B,oDAiBvG"}
@@ -0,0 +1,23 @@
1
+ import { jsx as o } from "@emotion/react/jsx-runtime";
2
+ import { ActionsAddOutlined as m } from "@m4l/icons";
3
+ import { Tooltip as c } from "@m4l/base";
4
+ import { useComponentSize as p } from "../../../../hooks/useComponentSize/index.js";
5
+ import { AutocompleteAddIconContainer as d } from "./slots/addStyled.js";
6
+ import { IconButton as l } from "../IconButton/IconButton.js";
7
+ function h({ buttonRef: t, tooltip: r, size: n, ...e }) {
8
+ const { currentSize: i } = p(n);
9
+ return /* @__PURE__ */ o(c, { title: r, placement: "bottom", children: /* @__PURE__ */ o(d, { children: /* @__PURE__ */ o(
10
+ l,
11
+ {
12
+ ...e,
13
+ ref: t,
14
+ size: i,
15
+ variant: "contained",
16
+ color: "primary",
17
+ icon: /* @__PURE__ */ o(m, {})
18
+ }
19
+ ) }) });
20
+ }
21
+ export {
22
+ h as AutocompleteAddButton
23
+ };
@@ -1,11 +1,7 @@
1
+ import { Ref } from 'react';
1
2
  import { AutocompleteAsyncProps } from './types';
2
- /**
3
- * AutocompleteAsync: fetches options from an endpoint and drives open/close/options/loading.
4
- * Use standalone with value/onChange, or wrap with withRHFController for react-hook-form.
5
- *
6
- * - Fetches only when the dropdown is opened (first time or after param change).
7
- * - Supports onChangeFilterParms for search-as-you-type (single selection only).
8
- * - Preserves selected value when it is not in the latest options.
9
- */
10
- export declare function AutocompleteAsync<T>(props: AutocompleteAsyncProps<T>): import("@emotion/react/jsx-runtime").JSX.Element;
3
+ /** Preserve generic option inference while forwarding form focus to the native input. */
4
+ export declare const AutocompleteAsync: <T>(props: AutocompleteAsyncProps<T> & {
5
+ ref?: Ref<HTMLInputElement | HTMLTextAreaElement>;
6
+ }) => JSX.Element;
11
7
  //# sourceMappingURL=AutocompleteAsync.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AutocompleteAsync.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/extended/mui/AutocompleteAsync/AutocompleteAsync.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAe,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAM9D;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,KAAK,EAAE,sBAAsB,CAAC,CAAC,CAAC,oDAyGpE"}
1
+ {"version":3,"file":"AutocompleteAsync.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/extended/mui/AutocompleteAsync/AutocompleteAsync.tsx"],"names":[],"mappings":"AACA,OAAO,EAAc,KAAK,GAAG,EAAuD,MAAM,OAAO,CAAC;AAElG,OAAO,EAAe,sBAAsB,EAAE,MAAM,SAAS,CAAC;AA0L9D,yFAAyF;AACzF,eAAO,MAAM,iBAAiB,EAA6C,CAAC,CAAC,EAC3E,KAAK,EAAE,sBAAsB,CAAC,CAAC,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,GAAG,CAAC,gBAAgB,GAAG,mBAAmB,CAAC,CAAA;CAAE,KACrF,GAAG,CAAC,OAAO,CAAC"}
@@ -1,53 +1,67 @@
1
- import { jsx as P } from "@emotion/react/jsx-runtime";
2
- import S from "lodash-es/debounce";
3
- import { useRef as b, useReducer as L, useCallback as s, useMemo as Y, useEffect as _ } from "react";
1
+ import { jsx as A, jsxs as T } from "@emotion/react/jsx-runtime";
2
+ import D from "lodash-es/debounce";
3
+ import { forwardRef as H, useRef as y, useReducer as Q, useCallback as f, useEffect as R, useMemo as K } from "react";
4
4
  import { actionsType as i } from "./types.js";
5
- import { autocompleteAsyncReducer as j, getInitialStateAutocompleteAsync as x } from "./reducer/AutocompleteAsyncReducer.js";
6
- import { useFetchOptions as N } from "./hooks/useFetchOptions.js";
7
- import { ASYNC_ONLY_KEYS as T } from "./constants.js";
8
- import { AutocompleteAsyncRootStyled as I } from "./slots/AutocompleteAsyncSlots.js";
9
- function q(l) {
5
+ import { autocompleteAsyncReducer as V, getInitialStateAutocompleteAsync as z } from "./reducer/AutocompleteAsyncReducer.js";
6
+ import { useFetchOptions as G } from "./hooks/useFetchOptions.js";
7
+ import { useAutocompleteAdd as J } from "./hooks/useAutocompleteAdd.js";
8
+ import { AutocompleteAddRoot as W, AutocompleteAddRow as X, AutocompleteAddInput as Z, AutocompleteAddStatusText as $ } from "./slots/addStyled.js";
9
+ import { ASYNC_ONLY_KEYS as ee } from "./constants.js";
10
+ import { AutocompleteAsyncRootStyled as te } from "./slots/AutocompleteAsyncSlots.js";
11
+ function oe(p, b) {
10
12
  const {
11
- endPoint: p,
12
- timeout: u = 5e3,
13
- parms: a,
14
- resultField: f = "data",
15
- isRemote: d = !0,
16
- isExternalUrl: h = !1,
17
- onChangeFilterParms: t,
18
- responseToCamelCase: y,
19
- multiple: C,
20
- shouldFetch: o
21
- } = l, m = b(""), E = Object.fromEntries(
22
- Object.entries(l).filter(([e]) => !T.includes(e))
23
- ), [c, n] = L(
24
- j(t),
25
- x({ parms: a, onChangeFilterParms: t })
13
+ add: E,
14
+ endPoint: x,
15
+ timeout: I = 5e3,
16
+ parms: C,
17
+ resultField: j = "data",
18
+ isRemote: B = !0,
19
+ isExternalUrl: N = !1,
20
+ onChangeFilterParms: o,
21
+ responseToCamelCase: Y,
22
+ multiple: h,
23
+ shouldFetch: e,
24
+ resetKey: m,
25
+ retainSelectedOptions: F = !!E,
26
+ value: c,
27
+ isOptionEqualToValue: g
28
+ } = p, l = J(p), d = l.refreshKey, u = y(""), _ = Object.fromEntries(
29
+ Object.entries(p).filter(([t]) => !ee.includes(t))
30
+ ), [s, n] = Q(
31
+ V(o),
32
+ z({ parms: C, onChangeFilterParms: o })
26
33
  );
27
- if (C && t)
34
+ if (h && o)
28
35
  throw new Error(
29
36
  "multiple cannot be enabled when onChangeFilterParms is defined; define the filter in parms if needed."
30
37
  );
31
- N({
32
- state: c,
38
+ G({
39
+ state: s,
33
40
  dispatch: n,
34
- endPoint: p,
35
- timeout: u,
36
- isExternalUrl: h,
37
- parms: a,
38
- responseToCamelCase: y,
39
- isRemote: d,
40
- resultField: f
41
+ endPoint: x,
42
+ timeout: I,
43
+ isExternalUrl: N,
44
+ parms: C,
45
+ responseToCamelCase: Y,
46
+ isRemote: B,
47
+ resultField: j
41
48
  });
42
- const F = s(() => n({ type: i.REFRESH }), []), A = s(() => {
43
- const e = !o || o(m.current);
44
- n({ type: i.OPEN, noFetch: !e });
45
- }, [o]), R = s(() => n({ type: i.CLOSE }), []), r = Y(
46
- () => S(
47
- (e) => {
49
+ const v = f(() => n({ type: i.REFRESH }), []), S = y(d);
50
+ R(() => {
51
+ S.current !== d && (S.current = d, n({
52
+ type: i.INVALIDATE,
53
+ noFetch: !!(e && !e(u.current))
54
+ }));
55
+ }, [d, e]);
56
+ const w = f(() => {
57
+ const t = !e || e(u.current);
58
+ n({ type: i.OPEN, noFetch: !t });
59
+ }, [e]), q = f(() => n({ type: i.CLOSE }), []), r = K(
60
+ () => D(
61
+ (t) => {
48
62
  n({
49
63
  type: i.SET_QUERY_PARAMS,
50
- payload: e
64
+ payload: t
51
65
  });
52
66
  },
53
67
  300,
@@ -55,31 +69,48 @@ function q(l) {
55
69
  ),
56
70
  [n]
57
71
  );
58
- _(
72
+ R(
59
73
  () => () => {
60
74
  r.cancel();
61
75
  },
62
76
  [r]
63
77
  );
64
- const g = s(
65
- (e, O) => {
66
- m.current = e, t && O === "input" && (!o || o(e)) && r(t(e));
78
+ const O = y(m);
79
+ R(() => {
80
+ O.current !== m && (O.current = m, r.cancel(), n({
81
+ type: i.RESET,
82
+ noFetch: !!(e && !e(u.current)),
83
+ queryParams: o?.(u.current)
84
+ }));
85
+ }, [m, e, o, r]);
86
+ const M = f(
87
+ (t, a) => {
88
+ u.current = t, o && a === "input" && (!e || e(t) ? r(o(t)) : r.cancel());
67
89
  },
68
- [t, r, o]
69
- );
70
- return /* @__PURE__ */ P(
71
- I,
90
+ [o, r, e]
91
+ ), U = K(() => !F || s.options.length === 0 ? s.options : (h ? Array.isArray(c) ? c : [] : c == null ? [] : [c]).reduce((a, L) => a.some((k) => g(k, L)) ? a : [...a, L], s.options), [s.options, h, c, g, F]), P = /* @__PURE__ */ A(
92
+ te,
72
93
  {
73
- ...E,
74
- loading: c.loading,
75
- options: c.options,
76
- onChangeFilterParmsLocal: t ? g : void 0,
77
- refresh: F,
78
- onOpen: A,
79
- onClose: R
94
+ ..._,
95
+ inputRef: b ?? p.inputRef,
96
+ onChange: l.onChange,
97
+ loading: s.loading,
98
+ options: U,
99
+ onChangeFilterParmsLocal: o ? M : void 0,
100
+ refresh: v,
101
+ onOpen: w,
102
+ onClose: q
80
103
  }
81
104
  );
105
+ return E ? /* @__PURE__ */ T(W, { children: [
106
+ /* @__PURE__ */ T(X, { children: [
107
+ /* @__PURE__ */ A(Z, { children: P }),
108
+ l.addButton
109
+ ] }),
110
+ l.status && /* @__PURE__ */ A($, { role: "status", "aria-live": "polite", children: l.status })
111
+ ] }) : P;
82
112
  }
113
+ const de = H(oe);
83
114
  export {
84
- q as AutocompleteAsync
115
+ de as AutocompleteAsync
85
116
  };