@lmb-it/kitsconcerto-native 0.1.277 → 0.1.285

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 (236) hide show
  1. package/apps/mobile/src/Core/AutoComplete/index.cjs +12 -4
  2. package/apps/mobile/src/Core/AutoComplete/index.cjs.map +1 -1
  3. package/apps/mobile/src/Core/AutoComplete/index.js +12 -4
  4. package/apps/mobile/src/Core/AutoComplete/index.js.map +1 -1
  5. package/apps/mobile/src/Core/MultiSelect/index.cjs +7 -4
  6. package/apps/mobile/src/Core/MultiSelect/index.cjs.map +1 -1
  7. package/apps/mobile/src/Core/MultiSelect/index.js +7 -4
  8. package/apps/mobile/src/Core/MultiSelect/index.js.map +1 -1
  9. package/components/Avatar/index.cjs +1 -0
  10. package/components/Avatar/index.cjs.map +1 -1
  11. package/components/Avatar/index.js +1 -0
  12. package/components/Avatar/index.js.map +1 -1
  13. package/components/Banner/banner.cjs +1 -0
  14. package/components/Banner/banner.cjs.map +1 -1
  15. package/components/Banner/banner.js +1 -0
  16. package/components/Banner/banner.js.map +1 -1
  17. package/components/BottomTabBar/index.cjs +1 -0
  18. package/components/BottomTabBar/index.cjs.map +1 -1
  19. package/components/BottomTabBar/index.js +1 -0
  20. package/components/BottomTabBar/index.js.map +1 -1
  21. package/components/BreadCrumb/index.cjs.map +1 -1
  22. package/components/BreadCrumb/index.js.map +1 -1
  23. package/components/Button/Button.cjs +1 -0
  24. package/components/Button/Button.cjs.map +1 -1
  25. package/components/Button/Button.js +1 -0
  26. package/components/Button/Button.js.map +1 -1
  27. package/components/Carousel/index.cjs +1 -0
  28. package/components/Carousel/index.cjs.map +1 -1
  29. package/components/Carousel/index.js +1 -0
  30. package/components/Carousel/index.js.map +1 -1
  31. package/components/ChatBubble/index.cjs +1 -0
  32. package/components/ChatBubble/index.cjs.map +1 -1
  33. package/components/ChatBubble/index.js +1 -0
  34. package/components/ChatBubble/index.js.map +1 -1
  35. package/components/Chip/index.cjs +1 -0
  36. package/components/Chip/index.cjs.map +1 -1
  37. package/components/Chip/index.js +1 -0
  38. package/components/Chip/index.js.map +1 -1
  39. package/components/DateSeparator/index.cjs +1 -0
  40. package/components/DateSeparator/index.cjs.map +1 -1
  41. package/components/DateSeparator/index.js +1 -0
  42. package/components/DateSeparator/index.js.map +1 -1
  43. package/components/DetailsList/index.cjs +1 -0
  44. package/components/DetailsList/index.cjs.map +1 -1
  45. package/components/DetailsList/index.js +1 -0
  46. package/components/DetailsList/index.js.map +1 -1
  47. package/components/EmptyState/index.cjs +1 -0
  48. package/components/EmptyState/index.cjs.map +1 -1
  49. package/components/EmptyState/index.js +1 -0
  50. package/components/EmptyState/index.js.map +1 -1
  51. package/components/Gallery/index.cjs +1 -0
  52. package/components/Gallery/index.cjs.map +1 -1
  53. package/components/Gallery/index.js +1 -0
  54. package/components/Gallery/index.js.map +1 -1
  55. package/components/MessageComposer/index.cjs +1 -0
  56. package/components/MessageComposer/index.cjs.map +1 -1
  57. package/components/MessageComposer/index.js +1 -0
  58. package/components/MessageComposer/index.js.map +1 -1
  59. package/components/MessageReceipt/index.cjs +1 -0
  60. package/components/MessageReceipt/index.cjs.map +1 -1
  61. package/components/MessageReceipt/index.js +1 -0
  62. package/components/MessageReceipt/index.js.map +1 -1
  63. package/components/ProgressBar/index.cjs +1 -0
  64. package/components/ProgressBar/index.cjs.map +1 -1
  65. package/components/ProgressBar/index.js +1 -0
  66. package/components/ProgressBar/index.js.map +1 -1
  67. package/components/SegmentedControl/index.cjs +1 -0
  68. package/components/SegmentedControl/index.cjs.map +1 -1
  69. package/components/SegmentedControl/index.js +1 -0
  70. package/components/SegmentedControl/index.js.map +1 -1
  71. package/components/StatCard/index.cjs +1 -0
  72. package/components/StatCard/index.cjs.map +1 -1
  73. package/components/StatCard/index.js +1 -0
  74. package/components/StatCard/index.js.map +1 -1
  75. package/components/Stepper/index.cjs +1 -0
  76. package/components/Stepper/index.cjs.map +1 -1
  77. package/components/Stepper/index.js +1 -0
  78. package/components/Stepper/index.js.map +1 -1
  79. package/components/Tabs/index.cjs +1 -0
  80. package/components/Tabs/index.cjs.map +1 -1
  81. package/components/Tabs/index.js +1 -0
  82. package/components/Tabs/index.js.map +1 -1
  83. package/components/Timeline/index.cjs +1 -0
  84. package/components/Timeline/index.cjs.map +1 -1
  85. package/components/Timeline/index.js +1 -0
  86. package/components/Timeline/index.js.map +1 -1
  87. package/components/Translate/index.cjs +1 -0
  88. package/components/Translate/index.cjs.map +1 -1
  89. package/components/Translate/index.js +1 -0
  90. package/components/Translate/index.js.map +1 -1
  91. package/components/TypingIndicator/index.cjs +1 -0
  92. package/components/TypingIndicator/index.cjs.map +1 -1
  93. package/components/TypingIndicator/index.js +1 -0
  94. package/components/TypingIndicator/index.js.map +1 -1
  95. package/components/overlay/ConfirmDialog/index.cjs +1 -0
  96. package/components/overlay/ConfirmDialog/index.cjs.map +1 -1
  97. package/components/overlay/ConfirmDialog/index.js +1 -0
  98. package/components/overlay/ConfirmDialog/index.js.map +1 -1
  99. package/components/overlay/Dialog/index.cjs +1 -0
  100. package/components/overlay/Dialog/index.cjs.map +1 -1
  101. package/components/overlay/Dialog/index.js +1 -0
  102. package/components/overlay/Dialog/index.js.map +1 -1
  103. package/contexts/BreadcrumbContext.cjs +33 -0
  104. package/contexts/BreadcrumbContext.cjs.map +1 -0
  105. package/contexts/BreadcrumbContext.js +28 -0
  106. package/contexts/BreadcrumbContext.js.map +1 -0
  107. package/form/controls/Checkbox/index.cjs +1 -0
  108. package/form/controls/Checkbox/index.cjs.map +1 -1
  109. package/form/controls/Checkbox/index.js +1 -0
  110. package/form/controls/Checkbox/index.js.map +1 -1
  111. package/form/controls/RadioButton/radio.cjs +1 -0
  112. package/form/controls/RadioButton/radio.cjs.map +1 -1
  113. package/form/controls/RadioButton/radio.js +1 -0
  114. package/form/controls/RadioButton/radio.js.map +1 -1
  115. package/form/controls/TriStateCheckbox/index.cjs +1 -0
  116. package/form/controls/TriStateCheckbox/index.cjs.map +1 -1
  117. package/form/controls/TriStateCheckbox/index.js +1 -0
  118. package/form/controls/TriStateCheckbox/index.js.map +1 -1
  119. package/form/file-pickers/index.cjs +1 -0
  120. package/form/file-pickers/index.cjs.map +1 -1
  121. package/form/file-pickers/index.js +1 -0
  122. package/form/file-pickers/index.js.map +1 -1
  123. package/form/helpers/FormContainer/index.cjs +13 -2
  124. package/form/helpers/FormContainer/index.cjs.map +1 -1
  125. package/form/helpers/FormContainer/index.js +13 -2
  126. package/form/helpers/FormContainer/index.js.map +1 -1
  127. package/form/inputs/ColorPicker/index.cjs +1 -0
  128. package/form/inputs/ColorPicker/index.cjs.map +1 -1
  129. package/form/inputs/ColorPicker/index.js +1 -0
  130. package/form/inputs/ColorPicker/index.js.map +1 -1
  131. package/form/inputs/Datepicker/index.cjs +1 -0
  132. package/form/inputs/Datepicker/index.cjs.map +1 -1
  133. package/form/inputs/Datepicker/index.js +1 -0
  134. package/form/inputs/Datepicker/index.js.map +1 -1
  135. package/form/inputs/InputLocation/index.cjs +1 -0
  136. package/form/inputs/InputLocation/index.cjs.map +1 -1
  137. package/form/inputs/InputLocation/index.js +1 -0
  138. package/form/inputs/InputLocation/index.js.map +1 -1
  139. package/form/inputs/InputMask/index.cjs +1 -0
  140. package/form/inputs/InputMask/index.cjs.map +1 -1
  141. package/form/inputs/InputMask/index.js +1 -0
  142. package/form/inputs/InputMask/index.js.map +1 -1
  143. package/form/inputs/InputNumber/index.cjs +1 -0
  144. package/form/inputs/InputNumber/index.cjs.map +1 -1
  145. package/form/inputs/InputNumber/index.js +1 -0
  146. package/form/inputs/InputNumber/index.js.map +1 -1
  147. package/form/inputs/InputPassword/index.cjs +1 -0
  148. package/form/inputs/InputPassword/index.cjs.map +1 -1
  149. package/form/inputs/InputPassword/index.js +1 -0
  150. package/form/inputs/InputPassword/index.js.map +1 -1
  151. package/form/inputs/InputSwitch/index.cjs +1 -0
  152. package/form/inputs/InputSwitch/index.cjs.map +1 -1
  153. package/form/inputs/InputSwitch/index.js +1 -0
  154. package/form/inputs/InputSwitch/index.js.map +1 -1
  155. package/form/inputs/InputText/index.cjs +1 -0
  156. package/form/inputs/InputText/index.cjs.map +1 -1
  157. package/form/inputs/InputText/index.js +1 -0
  158. package/form/inputs/InputText/index.js.map +1 -1
  159. package/form/inputs/InputTextarea/index.cjs +1 -0
  160. package/form/inputs/InputTextarea/index.cjs.map +1 -1
  161. package/form/inputs/InputTextarea/index.js +1 -0
  162. package/form/inputs/InputTextarea/index.js.map +1 -1
  163. package/form/inputs/PhoneInput/index.cjs +1 -0
  164. package/form/inputs/PhoneInput/index.cjs.map +1 -1
  165. package/form/inputs/PhoneInput/index.js +1 -0
  166. package/form/inputs/PhoneInput/index.js.map +1 -1
  167. package/form/selects/AutoComplete/index.cjs +11 -1
  168. package/form/selects/AutoComplete/index.cjs.map +1 -1
  169. package/form/selects/AutoComplete/index.js +12 -2
  170. package/form/selects/AutoComplete/index.js.map +1 -1
  171. package/form/selects/CascadeSelect/index.cjs +1 -0
  172. package/form/selects/CascadeSelect/index.cjs.map +1 -1
  173. package/form/selects/CascadeSelect/index.js +1 -0
  174. package/form/selects/CascadeSelect/index.js.map +1 -1
  175. package/form/selects/Dropdown/index.cjs +1 -0
  176. package/form/selects/Dropdown/index.cjs.map +1 -1
  177. package/form/selects/Dropdown/index.js +1 -0
  178. package/form/selects/Dropdown/index.js.map +1 -1
  179. package/form/selects/ListBox/index.cjs +1 -0
  180. package/form/selects/ListBox/index.cjs.map +1 -1
  181. package/form/selects/ListBox/index.js +1 -0
  182. package/form/selects/ListBox/index.js.map +1 -1
  183. package/form/selects/MultiSelect/index.cjs +9 -1
  184. package/form/selects/MultiSelect/index.cjs.map +1 -1
  185. package/form/selects/MultiSelect/index.js +10 -2
  186. package/form/selects/MultiSelect/index.js.map +1 -1
  187. package/form/selects/TreeSelect/index.cjs +1 -0
  188. package/form/selects/TreeSelect/index.cjs.map +1 -1
  189. package/form/selects/TreeSelect/index.js +1 -0
  190. package/form/selects/TreeSelect/index.js.map +1 -1
  191. package/form/selects/helpers/SelectPopupOverlay.cjs +1 -0
  192. package/form/selects/helpers/SelectPopupOverlay.cjs.map +1 -1
  193. package/form/selects/helpers/SelectPopupOverlay.js +1 -0
  194. package/form/selects/helpers/SelectPopupOverlay.js.map +1 -1
  195. package/form-renderer/components/fields/FileUploader/index.cjs +1 -0
  196. package/form-renderer/components/fields/FileUploader/index.cjs.map +1 -1
  197. package/form-renderer/components/fields/FileUploader/index.js +1 -0
  198. package/form-renderer/components/fields/FileUploader/index.js.map +1 -1
  199. package/form-renderer/components/fields/Group/index.cjs +1 -0
  200. package/form-renderer/components/fields/Group/index.cjs.map +1 -1
  201. package/form-renderer/components/fields/Group/index.js +1 -0
  202. package/form-renderer/components/fields/Group/index.js.map +1 -1
  203. package/form-renderer/components/fields/Radios/index.cjs +1 -0
  204. package/form-renderer/components/fields/Radios/index.cjs.map +1 -1
  205. package/form-renderer/components/fields/Radios/index.js +1 -0
  206. package/form-renderer/components/fields/Radios/index.js.map +1 -1
  207. package/form-renderer/components/fields/Select/index.cjs +1 -0
  208. package/form-renderer/components/fields/Select/index.cjs.map +1 -1
  209. package/form-renderer/components/fields/Select/index.js +1 -0
  210. package/form-renderer/components/fields/Select/index.js.map +1 -1
  211. package/hooks/main.cjs +1 -0
  212. package/hooks/main.cjs.map +1 -1
  213. package/hooks/main.js +1 -0
  214. package/hooks/main.js.map +1 -1
  215. package/hooks/useBreadcrumbTrail.cjs +21 -0
  216. package/hooks/useBreadcrumbTrail.cjs.map +1 -0
  217. package/hooks/useBreadcrumbTrail.js +16 -0
  218. package/hooks/useBreadcrumbTrail.js.map +1 -0
  219. package/hooks/useComponentDefaults.cjs +50 -8
  220. package/hooks/useComponentDefaults.cjs.map +1 -1
  221. package/hooks/useComponentDefaults.js +50 -8
  222. package/hooks/useComponentDefaults.js.map +1 -1
  223. package/index.cjs +5 -0
  224. package/index.cjs.map +1 -1
  225. package/index.d.ts +245 -19
  226. package/index.js +2 -0
  227. package/index.js.map +1 -1
  228. package/package.json +1 -1
  229. package/packages/types/src/Theme/defaultTheme.cjs +24 -4
  230. package/packages/types/src/Theme/defaultTheme.cjs.map +1 -1
  231. package/packages/types/src/Theme/defaultTheme.js +24 -4
  232. package/packages/types/src/Theme/defaultTheme.js.map +1 -1
  233. package/primitives/Card/index.cjs +1 -0
  234. package/primitives/Card/index.cjs.map +1 -1
  235. package/primitives/Card/index.js +1 -0
  236. package/primitives/Card/index.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"SelectPopupOverlay.js","sources":["../../../../../src/form/selects/helpers/SelectPopupOverlay.native.tsx"],"sourcesContent":["import React from 'react';\nimport {Pressable, StyleSheet, Text, View, useWindowDimensions} from 'react-native';\nimport {useSafeAreaInsets} from 'react-native-safe-area-context';\nimport {readerEdge, useKeyboardHeight} from '@lmb-it/kitsconcertomobile';\nimport KitsDialogControlled from '../../../components/overlay/Dialog';\nimport {useKitsTheme} from '../../../contexts/Theme';\nimport {useLanguage} from '../../../hooks';\nimport useThemedFont from '../../../hooks/useThemedFont';\n\n/**\n * The container a select's options live in when `popup` is on.\n *\n * ⛔ THIS IS NOT A SECOND OVERLAY MECHANISM. It is the library's own\n * `KitsDialogControlled` in bottom-sheet position, so the scrim, the slide\n * animation, the safe-area insets, `dismissableMask` and Android's hardware\n * back all come from the one place that already owns them. The only thing\n * this file adds is the header row and the sizing a picker needs.\n *\n * ⛔ IT USES `content` MODE ON PURPOSE. The Dialog's default template puts its\n * children inside a ScrollView with `maxHeight: 400`. A FlatList inside a\n * ScrollView scrolls badly and warns, and a 400pt cap is the very thing the\n * popup exists to escape. `content` replaces the whole header/body/footer\n * template, so the caller's search field can be pinned and its list can own\n * the remaining height.\n *\n * WHY A FIXED FRACTION OF THE SCREEN. The popup's whole purpose is that its\n * height does not depend on where the trigger happens to sit or on whether the\n * keyboard is up. It takes a fixed share of the window, the search field sits\n * at the top of it, and the list takes the rest.\n */\n\nexport interface ISelectPopupOverlayProps {\n /** Open state. */\n visible: boolean;\n /** Called for every dismissal route — the ✕, the scrim, Android back. */\n onClose: () => void;\n /** Title shown beside the close control. Falls back to the field's label. */\n title?: React.ReactNode;\n /** The search field and the list. */\n children: React.ReactNode;\n}\n\n/** Share of the window height the sheet occupies when the keyboard is down. */\nconst SHEET_HEIGHT_RATIO = 0.75;\n/** Never shorter than this, even on a small screen with the keyboard up. */\nconst SHEET_MIN_HEIGHT = 240;\n\nconst SelectPopupOverlay = ({visible, onClose, title, children}: ISelectPopupOverlayProps) => {\n const {resolveToken} = useKitsTheme();\n const {isRTL} = useLanguage();\n /* Physical edges to write so the header lands where the reader starts. */\n const edge = readerEdge(isRTL);\n const insets = useSafeAreaInsets();\n const {height: windowHeight} = useWindowDimensions();\n /* Raw RN <Text> does not inherit `fontFamily` through View parents, so a\n consumer that swaps the theme font would see it everywhere except here.\n See useThemedFont's own note. */\n const headingFont = useThemedFont('heading');\n const keyboardHeight = useKeyboardHeight();\n\n /*\n * ⛔ \"OWNS THE SCREEN\" MEANS ABOVE THE KEYBOARD, NOT BEHIND IT. A sheet\n * pinned to the bottom at a fixed 75% still has its lower half under the\n * keyboard the moment the search field takes focus, and the list is back to\n * competing for the gap — the exact fault the popup exists to escape, one\n * layer along. The sheet is capped to what is actually visible.\n *\n * The keyboard replaces the bottom inset rather than adding to it: it\n * covers the home indicator.\n */\n const visibleHeight = windowHeight - Math.max(insets.bottom, keyboardHeight) - insets.top;\n const sheetHeight = Math.max(\n Math.min(SHEET_MIN_HEIGHT, visibleHeight),\n Math.min(Math.round(windowHeight * SHEET_HEIGHT_RATIO), visibleHeight),\n );\n\n const textColor = resolveToken('text');\n const borderColor = resolveToken('border');\n const grabberColor = resolveToken('gray.300');\n const subtextColor = resolveToken('gray.500');\n\n return (\n <KitsDialogControlled\n onHide={onClose}\n state={{\n visible,\n position: 'bottom',\n // Tap-outside dismiss. `onRequestClose` inside the Dialog gives\n // Android's back button the same route.\n dismissableMask: true,\n onClose,\n style: {\n height: sheetHeight,\n // The keyboard already clears the home indicator, so the\n // inset is only owed when the keyboard is down.\n paddingBottom: keyboardHeight > 0 ? 0 : insets.bottom,\n marginBottom: keyboardHeight,\n },\n content: ({hide}: {hide: () => void}) => (\n <View style={styles.root}>\n <View style={[styles.grabber, {backgroundColor: grabberColor}]} />\n <View\n style={[\n styles.header,\n {borderBottomColor: borderColor},\n /* ⛔ THE PHYSICAL EDGE IS COMPUTED, NEVER NAMED.\n React Native mirrors `flexDirection: 'row'`\n and `textAlign` when the process is RTL — the\n App calls `I18nManager.forceRTL` — so naming\n the RTL edge for an RTL reader asks for it\n twice and lands on the LTR one. That is why\n this header drew its title LEFT and its ✕\n RIGHT in Arabic while the option rows below\n it, which already went through `readerEdge`,\n were correct. See `readerEdge`. */\n {flexDirection: edge.flexDirection},\n ]}>\n <Text\n numberOfLines={1}\n style={[\n styles.title,\n {color: textColor, fontFamily: headingFont},\n {\n textAlign: edge.textAlign,\n /* `writingDirection` is NOT mirrored — it\n orders glyphs inside the line, so it\n takes the reader's own direction. */\n writingDirection: isRTL ? ('rtl' as const) : ('ltr' as const),\n },\n ]}>\n {title}\n </Text>\n <Pressable onPress={hide} hitSlop={12} accessibilityRole=\"button\">\n <Text style={[styles.close, {color: subtextColor}]}>✕</Text>\n </Pressable>\n </View>\n {children}\n </View>\n ),\n }}\n />\n );\n};\n\nconst styles = StyleSheet.create({\n root: {\n flex: 1,\n minHeight: 0,\n },\n grabber: {\n width: 40,\n height: 4,\n borderRadius: 2,\n alignSelf: 'center',\n marginTop: 8,\n marginBottom: 4,\n },\n header: {\n alignItems: 'center',\n paddingHorizontal: 16,\n paddingVertical: 12,\n borderBottomWidth: 1,\n gap: 12,\n },\n title: {\n flex: 1,\n fontSize: 17,\n fontWeight: '700',\n },\n close: {\n fontSize: 18,\n },\n});\n\nexport default SelectPopupOverlay;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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C,IAAA,EAAA,EAAK,OAAO,CAAC,MAAA,CAAO,OAAO,EAAC,KAAA,EAAO,cAAa,CAAA,EAAG,oBAAC,CAAA,EACzD;AAAA;AAAA;AAAA,WACJ;AAAA,UACC;AAAA,SAAA,EACL;AAAA;AAER;AAAA,GACJ;AAER;AAEA,MAAM,MAAA,GAAS,WAAW,MAAA,CAAO;AAAA,EAC7B,IAAA,EAAM;AAAA,IACF,IAAA,EAAM,CAAA;AAAA,IACN,SAAA,EAAW;AAAA,GACf;AAAA,EACA,OAAA,EAAS;AAAA,IACL,KAAA,EAAO,EAAA;AAAA,IACP,MAAA,EAAQ,CAAA;AAAA,IACR,YAAA,EAAc,CAAA;AAAA,IACd,SAAA,EAAW,QAAA;AAAA,IACX,SAAA,EAAW,CAAA;AAAA,IACX,YAAA,EAAc;AAAA,GAClB;AAAA,EACA,MAAA,EAAQ;AAAA,IACJ,UAAA,EAAY,QAAA;AAAA,IACZ,iBAAA,EAAmB,EAAA;AAAA,IACnB,eAAA,EAAiB,EAAA;AAAA,IACjB,iBAAA,EAAmB,CAAA;AAAA,IACnB,GAAA,EAAK;AAAA,GACT;AAAA,EACA,KAAA,EAAO;AAAA,IACH,IAAA,EAAM,CAAA;AAAA,IACN,QAAA,EAAU,EAAA;AAAA,IACV,UAAA,EAAY;AAAA,GAChB;AAAA,EACA,KAAA,EAAO;AAAA,IACH,QAAA,EAAU;AAAA;AAElB,CAAC,CAAA;;;;"}
1
+ {"version":3,"file":"SelectPopupOverlay.js","sources":["../../../../../src/form/selects/helpers/SelectPopupOverlay.native.tsx"],"sourcesContent":["import React from 'react';\nimport {Pressable, StyleSheet, Text, View, useWindowDimensions} from 'react-native';\nimport {useSafeAreaInsets} from 'react-native-safe-area-context';\nimport {readerEdge, useKeyboardHeight} from '@lmb-it/kitsconcertomobile';\nimport KitsDialogControlled from '../../../components/overlay/Dialog';\nimport {useKitsTheme} from '../../../contexts/Theme';\nimport {useLanguage} from '../../../hooks';\nimport useThemedFont from '../../../hooks/useThemedFont';\n\n/**\n * The container a select's options live in when `popup` is on.\n *\n * ⛔ THIS IS NOT A SECOND OVERLAY MECHANISM. It is the library's own\n * `KitsDialogControlled` in bottom-sheet position, so the scrim, the slide\n * animation, the safe-area insets, `dismissableMask` and Android's hardware\n * back all come from the one place that already owns them. The only thing\n * this file adds is the header row and the sizing a picker needs.\n *\n * ⛔ IT USES `content` MODE ON PURPOSE. The Dialog's default template puts its\n * children inside a ScrollView with `maxHeight: 400`. A FlatList inside a\n * ScrollView scrolls badly and warns, and a 400pt cap is the very thing the\n * popup exists to escape. `content` replaces the whole header/body/footer\n * template, so the caller's search field can be pinned and its list can own\n * the remaining height.\n *\n * WHY A FIXED FRACTION OF THE SCREEN. The popup's whole purpose is that its\n * height does not depend on where the trigger happens to sit or on whether the\n * keyboard is up. It takes a fixed share of the window, the search field sits\n * at the top of it, and the list takes the rest.\n */\n\nexport interface ISelectPopupOverlayProps {\n /** Open state. */\n visible: boolean;\n /** Called for every dismissal route — the ✕, the scrim, Android back. */\n onClose: () => void;\n /** Title shown beside the close control. Falls back to the field's label. */\n title?: React.ReactNode;\n /** The search field and the list. */\n children: React.ReactNode;\n}\n\n/** Share of the window height the sheet occupies when the keyboard is down. */\nconst SHEET_HEIGHT_RATIO = 0.75;\n/** Never shorter than this, even on a small screen with the keyboard up. */\nconst SHEET_MIN_HEIGHT = 240;\n\nconst SelectPopupOverlay = ({visible, onClose, title, children}: ISelectPopupOverlayProps) => {\n const {resolveToken} = useKitsTheme();\n const {isRTL} = useLanguage();\n /* Physical edges to write so the header lands where the reader starts. */\n const edge = readerEdge(isRTL);\n const insets = useSafeAreaInsets();\n const {height: windowHeight} = useWindowDimensions();\n /* Raw RN <Text> does not inherit `fontFamily` through View parents, so a\n consumer that swaps the theme font would see it everywhere except here.\n See useThemedFont's own note. */\n const headingFont = useThemedFont('heading');\n const keyboardHeight = useKeyboardHeight();\n\n /*\n * ⛔ \"OWNS THE SCREEN\" MEANS ABOVE THE KEYBOARD, NOT BEHIND IT. A sheet\n * pinned to the bottom at a fixed 75% still has its lower half under the\n * keyboard the moment the search field takes focus, and the list is back to\n * competing for the gap — the exact fault the popup exists to escape, one\n * layer along. The sheet is capped to what is actually visible.\n *\n * The keyboard replaces the bottom inset rather than adding to it: it\n * covers the home indicator.\n */\n const visibleHeight = windowHeight - Math.max(insets.bottom, keyboardHeight) - insets.top;\n const sheetHeight = Math.max(\n Math.min(SHEET_MIN_HEIGHT, visibleHeight),\n Math.min(Math.round(windowHeight * SHEET_HEIGHT_RATIO), visibleHeight),\n );\n\n const textColor = resolveToken('text');\n const borderColor = resolveToken('border');\n const grabberColor = resolveToken('gray.300');\n const subtextColor = resolveToken('gray.500');\n\n return (\n <KitsDialogControlled\n onHide={onClose}\n state={{\n visible,\n position: 'bottom',\n // Tap-outside dismiss. `onRequestClose` inside the Dialog gives\n // Android's back button the same route.\n dismissableMask: true,\n onClose,\n style: {\n height: sheetHeight,\n // The keyboard already clears the home indicator, so the\n // inset is only owed when the keyboard is down.\n paddingBottom: keyboardHeight > 0 ? 0 : insets.bottom,\n marginBottom: keyboardHeight,\n },\n content: ({hide}: {hide: () => void}) => (\n <View style={styles.root}>\n <View style={[styles.grabber, {backgroundColor: grabberColor}]} />\n <View\n style={[\n styles.header,\n {borderBottomColor: borderColor},\n /* ⛔ THE PHYSICAL EDGE IS COMPUTED, NEVER NAMED.\n React Native mirrors `flexDirection: 'row'`\n and `textAlign` when the process is RTL — the\n App calls `I18nManager.forceRTL` — so naming\n the RTL edge for an RTL reader asks for it\n twice and lands on the LTR one. That is why\n this header drew its title LEFT and its ✕\n RIGHT in Arabic while the option rows below\n it, which already went through `readerEdge`,\n were correct. See `readerEdge`. */\n {flexDirection: edge.flexDirection},\n ]}>\n <Text\n numberOfLines={1}\n style={[\n styles.title,\n {color: textColor, fontFamily: headingFont},\n {\n textAlign: edge.textAlign,\n /* `writingDirection` is NOT mirrored — it\n orders glyphs inside the line, so it\n takes the reader's own direction. */\n writingDirection: isRTL ? ('rtl' as const) : ('ltr' as const),\n },\n ]}>\n {title}\n </Text>\n <Pressable onPress={hide} hitSlop={12} accessibilityRole=\"button\">\n <Text style={[styles.close, {color: subtextColor}]}>✕</Text>\n </Pressable>\n </View>\n {children}\n </View>\n ),\n }}\n />\n );\n};\n\nconst styles = StyleSheet.create({\n root: {\n flex: 1,\n minHeight: 0,\n },\n grabber: {\n width: 40,\n height: 4,\n borderRadius: 2,\n alignSelf: 'center',\n marginTop: 8,\n marginBottom: 4,\n },\n header: {\n alignItems: 'center',\n paddingHorizontal: 16,\n paddingVertical: 12,\n borderBottomWidth: 1,\n gap: 12,\n },\n title: {\n flex: 1,\n fontSize: 17,\n fontWeight: '700',\n },\n close: {\n fontSize: 18,\n },\n});\n\nexport default SelectPopupOverlay;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2CA,MAAM,kBAAA,GAAqB,IAAA;AAE3B,MAAM,gBAAA,GAAmB,GAAA;AAEzB,MAAM,qBAAqB,CAAC,EAAC,SAAS,OAAA,EAAS,KAAA,EAAO,UAAQ,KAAgC;AAC1F,EAAA,MAAM,EAAC,YAAA,EAAY,GAAI,YAAA,EAAa;AACpC,EAAA,MAAM,EAAC,KAAA,EAAK,GAAI,WAAA,EAAY;AAE5B,EAAA,MAAM,IAAA,GAAO,WAAW,KAAK,CAAA;AAC7B,EAAA,MAAM,SAAS,iBAAA,EAAkB;AACjC,EAAA,MAAM,EAAC,MAAA,EAAQ,YAAA,EAAY,GAAI,mBAAA,EAAoB;AAInD,EAAA,MAAM,WAAA,GAAc,cAAc,SAAS,CAAA;AAC3C,EAAA,MAAM,iBAAiB,iBAAA,EAAkB;AAYzC,EAAA,MAAM,aAAA,GAAgB,eAAe,IAAA,CAAK,GAAA,CAAI,OAAO,MAAA,EAAQ,cAAc,IAAI,MAAA,CAAO,GAAA;AAC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B,iBAAA,EAAmB,CAAA;AAAA,IACnB,GAAA,EAAK;AAAA,GACT;AAAA,EACA,KAAA,EAAO;AAAA,IACH,IAAA,EAAM,CAAA;AAAA,IACN,QAAA,EAAU,EAAA;AAAA,IACV,UAAA,EAAY;AAAA,GAChB;AAAA,EACA,KAAA,EAAO;AAAA,IACH,QAAA,EAAU;AAAA;AAElB,CAAC,CAAA;;;;"}
@@ -9,6 +9,7 @@ require('react');
9
9
  require('axios');
10
10
  require('../../../../contexts/DialogContext.cjs');
11
11
  require('../../../../contexts/PermissionsContext.cjs');
12
+ require('../../../../contexts/BreadcrumbContext.cjs');
12
13
  require('../../../../form/selects/SelectContext.cjs');
13
14
 
14
15
  const FileUploader = ({
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../../../../../../src/form-renderer/components/fields/FileUploader/index.tsx"],"sourcesContent":["// components/fields/FileUploader.tsx\n\nimport React from 'react';\nimport {type FieldValues, useFormContext} from 'react-hook-form';\nimport {KitsFilePicker} from \"../../../../_compat\";\nimport type {IFile, UseFieldLogicElementProps} from '@lmb-it/kitsconcerto-types';\n\n/**\n * Renders a file or image uploader.\n * It uses useFieldLogic for standard field state and useFormContext for form-level\n * configurations like outputFormat and error handling.\n */\nexport const FileUploader = <T extends FieldValues>({\n element,\n control,\n getValues,\n fieldLogic,\n }: UseFieldLogicElementProps<T>) => {\n\n // 1. Get form-level context for special properties.\n // We need to know the outputFormat to correctly structure the onChange payload.\n // We also need setError and clearErrors for the custom onError handler.\n const {setError, clearErrors, getValues: getFormConfig} = useFormContext();\n const outputFormat = (getFormConfig() as any).outputFormat || 'Json'; // Get form's output format\n\n // 2. Get field-level state and props from the central logic hook.\n const {\n field,\n fieldState,\n label,\n isDisabled,\n isRequired,\n helperText,\n placeholder,\n attached,\n style: elementStyle,\n slots,\n } = fieldLogic\n\n // 3. Cast the element to its specific type to access unique properties.\n const fileElement = element as IFile<T>;\n const {\n type,\n multiple,\n limit,\n acceptedTypes,\n maxFileSize,\n minFileSize,\n classicUploader,\n children,\n } = fileElement;\n\n // 4. Define the specific handlers for this component.\n const handleOnChange = (files: File[], base64Data: any[]) => {\n if (outputFormat === 'FormData') {\n field.onChange(multiple ? files : files[0]);\n } else {\n field.onChange(multiple ? base64Data : base64Data[0]);\n }\n };\n\n const handleError = (errorMessage: string) => {\n if (errorMessage === 'clear') {\n clearErrors(field.name);\n } else {\n setError(field.name, {type: 'custom', message: errorMessage});\n }\n };\n\n // 5. Render the \"dumb\" UI component with the resolved props.\n return (\n <KitsFilePicker\n id={field.name}\n value={field.value}\n //@ts-ignore\n onChange={handleOnChange}\n onError={handleError}\n\n // --- Resolved props ---\n label={label}\n disabled={isDisabled}\n required={isRequired}\n invalid={fieldState.invalid}\n errors={fieldState.error?.message}\n helperText={helperText}\n placeholder={placeholder}\n attached={attached}\n\n // --- Props from element definition ---\n type={type}\n multiple={multiple}\n limit={limit}\n acceptedTypes={acceptedTypes}\n maxFileSize={maxFileSize}\n minFileSize={minFileSize}\n classicUploader={classicUploader}\n isJsonOutput={outputFormat === 'Json'}\n children={children}\n style={elementStyle?.input}\n containerStyle={elementStyle?.container}\n slots={slots}\n />\n );\n};\n\nexport default FileUploader;\n"],"names":["useFormContext","jsx","KitsFilePicker"],"mappings":";;;;;;;;;;;;;AAYO,MAAM,eAAe,CAAwB;AAAA,EACI,OAAA;AAAA,EACA,OAAA;AAAA,EACA,SAAA;AAAA,EACA;AACJ,CAAA,KAAoC;AAKpF,EAAA,MAAM,EAAC,QAAA,EAAU,WAAA,EAAa,SAAA,EAAW,aAAA,KAAiBA,4BAAA,EAAe;AACzE,EAAA,MAAM,YAAA,GAAgB,aAAA,EAAc,CAAU,YAAA,IAAgB,MAAA;AAG9D,EAAA,MAAM;AAAA,IACF,KAAA;AAAA,IACA,UAAA;AAAA,IACA,KAAA;AAAA,IACA,UAAA;AAAA,IACA,UAAA;AAAA,IACA,UAAA;AAAA,IACA,WAAA;AAAA,IACA,QAAA;AAAA,IACA,KAAA,EA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;AAAA,MACA,WAAA;AAAA,MACA,QAAA;AAAA,MAGA,IAAA;AAAA,MACA,QAAA;AAAA,MACA,KAAA;AAAA,MACA,aAAA;AAAA,MACA,WAAA;AAAA,MACA,WAAA;AAAA,MACA,eAAA;AAAA,MACA,cAAc,YAAA,KAAiB,MAAA;AAAA,MAC/B,QAAA;AAAA,MACA,OAAO,YAAA,EAAc,KAAA;AAAA,MACrB,gBAAgB,YAAA,EAAc,SAAA;AAAA,MAC9B;AAAA;AAAA,GACJ;AAER;;;;;"}
1
+ {"version":3,"file":"index.cjs","sources":["../../../../../../src/form-renderer/components/fields/FileUploader/index.tsx"],"sourcesContent":["// components/fields/FileUploader.tsx\n\nimport React from 'react';\nimport {type FieldValues, useFormContext} from 'react-hook-form';\nimport {KitsFilePicker} from \"../../../../_compat\";\nimport type {IFile, UseFieldLogicElementProps} from '@lmb-it/kitsconcerto-types';\n\n/**\n * Renders a file or image uploader.\n * It uses useFieldLogic for standard field state and useFormContext for form-level\n * configurations like outputFormat and error handling.\n */\nexport const FileUploader = <T extends FieldValues>({\n element,\n control,\n getValues,\n fieldLogic,\n }: UseFieldLogicElementProps<T>) => {\n\n // 1. Get form-level context for special properties.\n // We need to know the outputFormat to correctly structure the onChange payload.\n // We also need setError and clearErrors for the custom onError handler.\n const {setError, clearErrors, getValues: getFormConfig} = useFormContext();\n const outputFormat = (getFormConfig() as any).outputFormat || 'Json'; // Get form's output format\n\n // 2. Get field-level state and props from the central logic hook.\n const {\n field,\n fieldState,\n label,\n isDisabled,\n isRequired,\n helperText,\n placeholder,\n attached,\n style: elementStyle,\n slots,\n } = fieldLogic\n\n // 3. Cast the element to its specific type to access unique properties.\n const fileElement = element as IFile<T>;\n const {\n type,\n multiple,\n limit,\n acceptedTypes,\n maxFileSize,\n minFileSize,\n classicUploader,\n children,\n } = fileElement;\n\n // 4. Define the specific handlers for this component.\n const handleOnChange = (files: File[], base64Data: any[]) => {\n if (outputFormat === 'FormData') {\n field.onChange(multiple ? files : files[0]);\n } else {\n field.onChange(multiple ? base64Data : base64Data[0]);\n }\n };\n\n const handleError = (errorMessage: string) => {\n if (errorMessage === 'clear') {\n clearErrors(field.name);\n } else {\n setError(field.name, {type: 'custom', message: errorMessage});\n }\n };\n\n // 5. Render the \"dumb\" UI component with the resolved props.\n return (\n <KitsFilePicker\n id={field.name}\n value={field.value}\n //@ts-ignore\n onChange={handleOnChange}\n onError={handleError}\n\n // --- Resolved props ---\n label={label}\n disabled={isDisabled}\n required={isRequired}\n invalid={fieldState.invalid}\n errors={fieldState.error?.message}\n helperText={helperText}\n placeholder={placeholder}\n attached={attached}\n\n // --- Props from element definition ---\n type={type}\n multiple={multiple}\n limit={limit}\n acceptedTypes={acceptedTypes}\n maxFileSize={maxFileSize}\n minFileSize={minFileSize}\n classicUploader={classicUploader}\n isJsonOutput={outputFormat === 'Json'}\n children={children}\n style={elementStyle?.input}\n containerStyle={elementStyle?.container}\n slots={slots}\n />\n );\n};\n\nexport default FileUploader;\n"],"names":["useFormContext","jsx","KitsFilePicker"],"mappings":";;;;;;;;;;;;;;AAYO,MAAM,eAAe,CAAwB;AAAA,EACI,OAAA;AAAA,EACA,OAAA;AAAA,EACA,SAAA;AAAA,EACA;AACJ,CAAA,KAAoC;AAKpF,EAAA,MAAM,EAAC,QAAA,EAAU,WAAA,EAAa,SAAA,EAAW,aAAA,KAAiBA,4BAAA,EAAe;AACzE,EAAA,MAAM,YAAA,GAAgB,aAAA,EAAc,CAAU,YAAA,IAAgB,MAAA;AAG9D,EAAA,MAAM;AAAA,IACF,KAAA;AAAA,IACA,UAAA;AAAA,IACA,KAAA;AAAA,IACA,UAAA;AAAA,IACA,UAAA;AAAA,IACA,UAAA;AAAA,IACA,WAAA;AAAA,IACA,QAAA;AAAA,IACA,KAAA,EAAO,YAAA;AAAA,IACP;AAAA,GACJ,GAAI,UAAA;AAGJ,EAAA,MAAM,WAAA,GAAc,OAAA;AACpB,EAAA,MAAM;AAAA,IACF,IAAA;AAAA,IACA,QAA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WAAA;AAAA,MACA,eAAA;AAAA,MACA,cAAc,YAAA,KAAiB,MAAA;AAAA,MAC/B,QAAA;AAAA,MACA,OAAO,YAAA,EAAc,KAAA;AAAA,MACrB,gBAAgB,YAAA,EAAc,SAAA;AAAA,MAC9B;AAAA;AAAA,GACJ;AAER;;;;;"}
@@ -5,6 +5,7 @@ import 'react';
5
5
  import 'axios';
6
6
  import '../../../../contexts/DialogContext.js';
7
7
  import '../../../../contexts/PermissionsContext.js';
8
+ import '../../../../contexts/BreadcrumbContext.js';
8
9
  import '../../../../form/selects/SelectContext.js';
9
10
 
10
11
  const FileUploader = ({
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../../src/form-renderer/components/fields/FileUploader/index.tsx"],"sourcesContent":["// components/fields/FileUploader.tsx\n\nimport React from 'react';\nimport {type FieldValues, useFormContext} from 'react-hook-form';\nimport {KitsFilePicker} from \"../../../../_compat\";\nimport type {IFile, UseFieldLogicElementProps} from '@lmb-it/kitsconcerto-types';\n\n/**\n * Renders a file or image uploader.\n * It uses useFieldLogic for standard field state and useFormContext for form-level\n * configurations like outputFormat and error handling.\n */\nexport const FileUploader = <T extends FieldValues>({\n element,\n control,\n getValues,\n fieldLogic,\n }: UseFieldLogicElementProps<T>) => {\n\n // 1. Get form-level context for special properties.\n // We need to know the outputFormat to correctly structure the onChange payload.\n // We also need setError and clearErrors for the custom onError handler.\n const {setError, clearErrors, getValues: getFormConfig} = useFormContext();\n const outputFormat = (getFormConfig() as any).outputFormat || 'Json'; // Get form's output format\n\n // 2. Get field-level state and props from the central logic hook.\n const {\n field,\n fieldState,\n label,\n isDisabled,\n isRequired,\n helperText,\n placeholder,\n attached,\n style: elementStyle,\n slots,\n } = fieldLogic\n\n // 3. Cast the element to its specific type to access unique properties.\n const fileElement = element as IFile<T>;\n const {\n type,\n multiple,\n limit,\n acceptedTypes,\n maxFileSize,\n minFileSize,\n classicUploader,\n children,\n } = fileElement;\n\n // 4. Define the specific handlers for this component.\n const handleOnChange = (files: File[], base64Data: any[]) => {\n if (outputFormat === 'FormData') {\n field.onChange(multiple ? files : files[0]);\n } else {\n field.onChange(multiple ? base64Data : base64Data[0]);\n }\n };\n\n const handleError = (errorMessage: string) => {\n if (errorMessage === 'clear') {\n clearErrors(field.name);\n } else {\n setError(field.name, {type: 'custom', message: errorMessage});\n }\n };\n\n // 5. Render the \"dumb\" UI component with the resolved props.\n return (\n <KitsFilePicker\n id={field.name}\n value={field.value}\n //@ts-ignore\n onChange={handleOnChange}\n onError={handleError}\n\n // --- Resolved props ---\n label={label}\n disabled={isDisabled}\n required={isRequired}\n invalid={fieldState.invalid}\n errors={fieldState.error?.message}\n helperText={helperText}\n placeholder={placeholder}\n attached={attached}\n\n // --- Props from element definition ---\n type={type}\n multiple={multiple}\n limit={limit}\n acceptedTypes={acceptedTypes}\n maxFileSize={maxFileSize}\n minFileSize={minFileSize}\n classicUploader={classicUploader}\n isJsonOutput={outputFormat === 'Json'}\n children={children}\n style={elementStyle?.input}\n containerStyle={elementStyle?.container}\n slots={slots}\n />\n );\n};\n\nexport default FileUploader;\n"],"names":["KitsFilePicker"],"mappings":";;;;;;;;;AAYO,MAAM,eAAe,CAAwB;AAAA,EACI,OAAA;AAAA,EACA,OAAA;AAAA,EACA,SAAA;AAAA,EACA;AACJ,CAAA,KAAoC;AAKpF,EAAA,MAAM,EAAC,QAAA,EAAU,WAAA,EAAa,SAAA,EAAW,aAAA,KAAiB,cAAA,EAAe;AACzE,EAAA,MAAM,YAAA,GAAgB,aAAA,EAAc,CAAU,YAAA,IAAgB,MAAA;AAG9D,EAAA,MAAM;AAAA,IACF,KAAA;AAAA,IACA,UAAA;AAAA,IACA,KAAA;AAAA,IACA,UAAA;AAAA,IACA,UAAA;AAAA,IACA,UAAA;AAAA,IACA,WAAA;AAAA,IACA,QAAA;AAAA,IACA,KAAA,EAAO,YAAA;AAAA,IACP;AAAA,GACJ,GAAI,UAAA;AAGJ,EAAA,MAAM,WAAA,GAAc,OAAA;A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;AAAA,MACA,aAAA;AAAA,MACA,WAAA;AAAA,MACA,WAAA;AAAA,MACA,eAAA;AAAA,MACA,cAAc,YAAA,KAAiB,MAAA;AAAA,MAC/B,QAAA;AAAA,MACA,OAAO,YAAA,EAAc,KAAA;AAAA,MACrB,gBAAgB,YAAA,EAAc,SAAA;AAAA,MAC9B;AAAA;AAAA,GACJ;AAER;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../../src/form-renderer/components/fields/FileUploader/index.tsx"],"sourcesContent":["// components/fields/FileUploader.tsx\n\nimport React from 'react';\nimport {type FieldValues, useFormContext} from 'react-hook-form';\nimport {KitsFilePicker} from \"../../../../_compat\";\nimport type {IFile, UseFieldLogicElementProps} from '@lmb-it/kitsconcerto-types';\n\n/**\n * Renders a file or image uploader.\n * It uses useFieldLogic for standard field state and useFormContext for form-level\n * configurations like outputFormat and error handling.\n */\nexport const FileUploader = <T extends FieldValues>({\n element,\n control,\n getValues,\n fieldLogic,\n }: UseFieldLogicElementProps<T>) => {\n\n // 1. Get form-level context for special properties.\n // We need to know the outputFormat to correctly structure the onChange payload.\n // We also need setError and clearErrors for the custom onError handler.\n const {setError, clearErrors, getValues: getFormConfig} = useFormContext();\n const outputFormat = (getFormConfig() as any).outputFormat || 'Json'; // Get form's output format\n\n // 2. Get field-level state and props from the central logic hook.\n const {\n field,\n fieldState,\n label,\n isDisabled,\n isRequired,\n helperText,\n placeholder,\n attached,\n style: elementStyle,\n slots,\n } = fieldLogic\n\n // 3. Cast the element to its specific type to access unique properties.\n const fileElement = element as IFile<T>;\n const {\n type,\n multiple,\n limit,\n acceptedTypes,\n maxFileSize,\n minFileSize,\n classicUploader,\n children,\n } = fileElement;\n\n // 4. Define the specific handlers for this component.\n const handleOnChange = (files: File[], base64Data: any[]) => {\n if (outputFormat === 'FormData') {\n field.onChange(multiple ? files : files[0]);\n } else {\n field.onChange(multiple ? base64Data : base64Data[0]);\n }\n };\n\n const handleError = (errorMessage: string) => {\n if (errorMessage === 'clear') {\n clearErrors(field.name);\n } else {\n setError(field.name, {type: 'custom', message: errorMessage});\n }\n };\n\n // 5. Render the \"dumb\" UI component with the resolved props.\n return (\n <KitsFilePicker\n id={field.name}\n value={field.value}\n //@ts-ignore\n onChange={handleOnChange}\n onError={handleError}\n\n // --- Resolved props ---\n label={label}\n disabled={isDisabled}\n required={isRequired}\n invalid={fieldState.invalid}\n errors={fieldState.error?.message}\n helperText={helperText}\n placeholder={placeholder}\n attached={attached}\n\n // --- Props from element definition ---\n type={type}\n multiple={multiple}\n limit={limit}\n acceptedTypes={acceptedTypes}\n maxFileSize={maxFileSize}\n minFileSize={minFileSize}\n classicUploader={classicUploader}\n isJsonOutput={outputFormat === 'Json'}\n children={children}\n style={elementStyle?.input}\n containerStyle={elementStyle?.container}\n slots={slots}\n />\n );\n};\n\nexport default FileUploader;\n"],"names":["KitsFilePicker"],"mappings":";;;;;;;;;;AAYO,MAAM,eAAe,CAAwB;AAAA,EACI,OAAA;AAAA,EACA,OAAA;AAAA,EACA,SAAA;AAAA,EACA;AACJ,CAAA,KAAoC;AAKpF,EAAA,MAAM,EAAC,QAAA,EAAU,WAAA,EAAa,SAAA,EAAW,aAAA,KAAiB,cAAA,EAAe;AACzE,EAAA,MAAM,YAAA,GAAgB,aAAA,EAAc,CAAU,YAAA,IAAgB,MAAA;AAG9D,EAAA,MAAM;AAAA,IACF,KAAA;AAAA,IACA,UAAA;AAAA,IACA,KAAA;AAAA,IACA,UAAA;AAAA,IACA,UAAA;AAAA,IACA,UAAA;AAAA,IACA,WAAA;AAAA,IACA,QAAA;AAAA,IACA,KAAA,EAAO,YAAA;AAAA,IACP;AAAA,GACJ,GAAI,UAAA;AAGJ,EAAA,MAAM,WAAA,GAAc,OAAA;AACpB,EAAA,MAAM;AAAA,IACF,IAAA;AAAA,IACA,QAAA;AAAA,IACA,KAAA;AAAA,IACA,aAAA;AAAA,IACA,WAAA;AAAA,IACA,WAAA;AAAA,IACA,eAAA;AAAA,IACA;AAAA,GACJ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A;AAAA,MACrB,gBAAgB,YAAA,EAAc,SAAA;AAAA,MAC9B;AAAA;AAAA,GACJ;AAER;;;;"}
@@ -9,6 +9,7 @@ var index_native = require('../../../../form/helpers/FormContainer/index.cjs');
9
9
  var index_native$1 = require('../../FormRenderer/index.cjs');
10
10
  require('../../../../contexts/DialogContext.cjs');
11
11
  require('../../../../contexts/PermissionsContext.cjs');
12
+ require('../../../../contexts/BreadcrumbContext.cjs');
12
13
  var useComponentDefaults = require('../../../../hooks/useComponentDefaults.cjs');
13
14
  var useResolvedElementStyles = require('../../../../hooks/useResolvedElementStyles.cjs');
14
15
  var helpers = require('../../../utils/helpers.cjs');
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../../../../../../src/form-renderer/components/fields/Group/index.native.tsx"],"sourcesContent":["// components/fields/Group.tsx\n\nimport React, {useCallback, useEffect, useImperativeHandle, useMemo, useState} from 'react';\nimport {type FieldArrayWithId, type FieldValues, useFieldArray} from 'react-hook-form';\nimport type {IFormElement, IGroup, UseFieldLogicElementProps} from \"@lmb-it/kitsconcerto-types\";\nimport {Box, Flex} from \"../../../../_compat\";\nimport KitsContainer from \"../../../../form/helpers/FormContainer\";\nimport {FormRenderer} from \"../../FormRenderer\";\nimport {useComponentDefaults, useResolvedElementStyles} from \"../../../../hooks\";\nimport {flattenSlotStyles} from \"../../../utils\";\n\n/**\n * Renders a repeatable group of fields (a field array), preserving all the logic\n * for default values, min/max repeats, and custom action buttons.\n */\nexport const Group = <T extends FieldValues>({\n element,\n control,\n getValues,\n groupField,\n focusedField,\n setFocusedField,\n fieldLogic,\n rowGap,\n }: UseFieldLogicElementProps<T>) => { // Ensure UseFieldLogicProps is updated to pass focus props\n // 1. Get the group's own dynamic state (visibility, layout, label) from the logic hook.\n const {isShown, label, elements, helperText: groupHelperText, fieldState, hideError, isRequired, slots} = fieldLogic;\n\n // Fallback focus state, used only when the parent form doesn't supply\n // focusedField/setFocusedField — web passes the props straight through.\n const [_focusedField, _setFocusedField] = useState<string>('');\n\n const groupElement = element as IGroup<T>;\n const {groupsSettings} = groupElement;\n\n // Resolve groupSlots (dynamic or static) and merge with theme Group defaults\n const resolvedGroupSlots = useMemo(() => {\n const gs = groupElement.groupSlots;\n if (!gs) return undefined;\n if (typeof gs === 'function') {\n return (gs as any)(fieldLogic.watchedValues, fieldLogic.formContext.getValues(), fieldLogic.formContext, groupField);\n }\n return gs;\n }, [groupElement.groupSlots, fieldLogic.watchedValues, fieldLogic.formContext, groupField]);\n\n const {elementStyles: groupStyles} = useComponentDefaults('Group', {\n slots: resolvedGroupSlots,\n } as any);\n const elStyles = useResolvedElementStyles(groupStyles);\n\n // Element-level `slots` (the outer KitsContainer's container/label/helperText/\n // error) arrive in the nested IElementSlotConfig shape; flatten to the flat\n // { [slot]: styleRecord } map KitsContainer expects. (groupSlots above drive\n // the inner repeatable list — root/body/row — and are already flattened.)\n const containerSlots = useMemo(() => flattenSlotStyles(slots), [slots]);\n\n // 2. Initialize react-hook-form's field array management.\n const fieldArray = useFieldArray({\n control,\n name: element.id as any,\n });\n const {fields, append, remove} = fieldArray;\n\n // console.log('hitted', element, {fields}, element.id)\n // 3. Process group settings with defaults, exactly like the original component.\n const settings = useMemo(() => ({\n grid: groupsSettings?.grid,\n repeatable: {\n minRepeats: groupsSettings?.repeatable?.minRepeats || 0,\n maxRepeats: groupsSettings?.repeatable?.maxRepeats || Infinity,\n plusButton: groupsSettings?.repeatable?.plusButton,\n minusButton: groupsSettings?.repeatable?.minusButton,\n },\n removeButtonRow: groupsSettings?.removeButtonRow,\n }), [groupsSettings]);\n\n // 4. Replicate the logic to build a default item object for new rows.\n const createDefaultItem = (): FieldValues => {\n const item: FieldValues = {};\n elements?.forEach(el => {\n if (\"displayOnly\" in el && el.displayOnly) return;\n\n if (\"initialUri\" in el) {\n item[el.id as string] = (el as any).initialUri;\n } else if (\"initialValue\" in el && el.initialValue !== undefined) {\n item[el.id as string] = el.initialValue;\n }\n });\n return item;\n };\n\n const handleAppend = (count = 1) => {\n const max = settings.repeatable.maxRepeats;\n\n if (max && fields.length >= max) {\n return;\n }\n const itemsToAdd = Array(count).fill(0).map(() => createDefaultItem());\n append(itemsToAdd as any, {shouldFocus: true});\n };\n\n const handleRemove = (index: number) => {\n if (fields.length > (settings.repeatable.minRepeats || 0)) {\n remove(index);\n }\n };\n useEffect(() => {\n const generateGroupElements = () => {\n const min = settings.repeatable.minRepeats || 0;\n if (fields.length < min) {\n const itemsToAppend = min - fields.length;\n // console.log({itemsToAppend, current: fields.length})\n\n handleAppend(itemsToAppend);\n }\n };\n\n // This pattern correctly avoids the infinite loop by not depending on `append` or `fields`.\n // The timeout gives react-hook-form time to initialize before we check the length.\n const timer = setTimeout(generateGroupElements, 100);\n return () => clearTimeout(timer);\n\n }, [element.id, settings.repeatable.minRepeats]); // Stable dependencies\n\n // 6. Replicate the `useImperativeHandle` logic to expose the ref.\n useImperativeHandle(groupsSettings?.ref, () => fieldArray, [fieldArray]);\n\n\n const reBuildElements = useCallback((field: FieldArrayWithId, index: number) => {\n return elements?.map((childElement) => {\n const toArray = Object.entries(field);\n\n const findField = toArray.find(([name]) => name == childElement.id);\n\n return {\n ...childElement,\n initialValue: findField ? findField[1] : undefined,\n };\n }) as IFormElement<any>[];\n }, [element, elements]);\n\n\n if (!isShown) {\n return null;\n }\n\n return (\n <KitsContainer\n id={element.id.toString()}\n label={label}\n helperText={groupHelperText}\n errors={fieldState?.error?.message}\n invalid={fieldState?.invalid}\n hideError={hideError}\n required={isRequired}\n bare\n elementStyles={containerSlots}\n >\n <Flex w=\"full\" flexDirection=\"column\" gap={6} mb={4}\n style={elStyles.root || undefined}>\n\n <Box style={elStyles.body || undefined}>\n {fields.map((field, index) => (\n <Flex key={field.id} w=\"full\" position=\"relative\" flexDirection=\"column\"\n rowGap={6}\n columnGap={8}\n style={elStyles.row || undefined}>\n\n <FormRenderer\n /* ⛔ THE SAME REASON AS `Object`: a repeated item's\n fields go through this nested renderer, so without\n this the form's `rowGap` never reaches the rows\n inside a repeatable card. The `rowGap={6}` on the\n Flex above is NOT this — it separates the item's\n fields from its remove button, and is deliberately\n left alone. */\n rowGap={rowGap}\n elements={reBuildElements(field, index)}\n control={control}\n groupField={{\n index,\n name: element.id.toString(),\n // Use the path-arg form of getValues so a Group nested inside\n // an Object resolves correctly: the FormRenderer rewrites this\n // Group's id to a dotted path (e.g. \"addressGroup.addresses\"),\n // and getValues()[dottedKey] would be undefined (→ crash on\n // [index]). getValues(path) traverses the nesting instead.\n values: (getValues(element.id as any) as any)?.[index],\n append: handleAppend,\n remove: () => handleRemove(index),\n }}\n getValues={getValues}\n parentPath={`${element.id.toString()}.${index}.`}\n focusedField={(focusedField ?? _focusedField)!}\n setFocusedField={(setFocusedField ?? _setFocusedField)!}\n grid={groupsSettings?.grid}\n />\n\n {settings.removeButtonRow && (\n <Box style={{zIndex: 1, ...(elStyles.removeButton || {})}}>\n {settings.removeButtonRow(fields.length, () => handleRemove(index), index)}\n </Box>\n )}\n\n\n {settings.repeatable.minusButton && fields.length > settings.repeatable.minRepeats && (\n <Box style={{zIndex: 1, ...(elStyles.removeButton || {})}}>\n {settings.repeatable.minusButton(fields.length, () => handleRemove(index))}\n </Box>\n )}\n </Flex>\n ))}\n </Box>\n\n {settings.repeatable.plusButton && (\n <Flex justifyContent=\"flex-start\" w=\"full\" mt={8}\n style={elStyles.addButton || undefined}>\n {settings.repeatable.plusButton(fields.length, handleAppend)}\n </Flex>\n )}\n </Flex>\n </KitsContainer>\n );\n};\n\nexport default Group;\n"],"names":["useState","useMemo","useComponentDefaults","useResolvedElementStyles","flattenSlotStyles","useFieldArray","useEffect","useImperativeHandle","useCallback","jsx","KitsContainer","jsxs","Flex","Box","index","FormRenderer"],"mappings":";;;;;;;;;;;;;;;;;;AAeO,MAAM,QAAQ,CAAwB;AAAA,EACI,OAAA;AAAA,EACA,OAAA;AAAA,EACA,SAAA;AAAA,EACA,UAAA;AAAA,EACA,YAAA;AAAA,EACA,eAAA;AAAA,EACA,UAAA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EL,cAAA,CAACI,eAAA,EAAA,EAAI,KAAA,EAAO,EAAC,MAAA,EAAQ,CAAA,EAAG,GAAI,QAAA,CAAS,YAAA,IAAgB,EAAC,EAAE,EACnD,QAAA,EAAA,QAAA,CAAS,UAAA,CAAW,WAAA,CAAY,MAAA,CAAO,MAAA,EAAQ,MAAM,YAAA,CAAaC,OAAK,CAAC,CAAA,EAC7E;AAAA;AAAA,eAAA;AAAA,cA7CG,KAAA,CAAM;AAAA,aAgDpB,CAAA,EACL,CAAA;AAAA,YAEC,QAAA,CAAS,WAAW,UAAA,oBACjBL,cAAA;AAAA,cAACG,aAAA;AAAA,cAAA;AAAA,gBAAK,cAAA,EAAe,YAAA;AAAA,gBAAa,CAAA,EAAE,MAAA;AAAA,gBAAO,EAAA,EAAI,CAAA;AAAA,gBACzC,KAAA,EAAO,SAAS,SAAA,IAAa,MAAA;AAAA,gBAC9B,QAAA,EAAA,QAAA,CAAS,UAAA,CAAW,UAAA,CAAW,MAAA,CAAO,QAAQ,YAAY;AAAA;AAAA;AAC/D;AAAA;AAAA;AAER;AAAA,GACJ;AAER;;;;;"}
1
+ {"version":3,"file":"index.cjs","sources":["../../../../../../src/form-renderer/components/fields/Group/index.native.tsx"],"sourcesContent":["// components/fields/Group.tsx\n\nimport React, {useCallback, useEffect, useImperativeHandle, useMemo, useState} from 'react';\nimport {type FieldArrayWithId, type FieldValues, useFieldArray} from 'react-hook-form';\nimport type {IFormElement, IGroup, UseFieldLogicElementProps} from \"@lmb-it/kitsconcerto-types\";\nimport {Box, Flex} from \"../../../../_compat\";\nimport KitsContainer from \"../../../../form/helpers/FormContainer\";\nimport {FormRenderer} from \"../../FormRenderer\";\nimport {useComponentDefaults, useResolvedElementStyles} from \"../../../../hooks\";\nimport {flattenSlotStyles} from \"../../../utils\";\n\n/**\n * Renders a repeatable group of fields (a field array), preserving all the logic\n * for default values, min/max repeats, and custom action buttons.\n */\nexport const Group = <T extends FieldValues>({\n element,\n control,\n getValues,\n groupField,\n focusedField,\n setFocusedField,\n fieldLogic,\n rowGap,\n }: UseFieldLogicElementProps<T>) => { // Ensure UseFieldLogicProps is updated to pass focus props\n // 1. Get the group's own dynamic state (visibility, layout, label) from the logic hook.\n const {isShown, label, elements, helperText: groupHelperText, fieldState, hideError, isRequired, slots} = fieldLogic;\n\n // Fallback focus state, used only when the parent form doesn't supply\n // focusedField/setFocusedField — web passes the props straight through.\n const [_focusedField, _setFocusedField] = useState<string>('');\n\n const groupElement = element as IGroup<T>;\n const {groupsSettings} = groupElement;\n\n // Resolve groupSlots (dynamic or static) and merge with theme Group defaults\n const resolvedGroupSlots = useMemo(() => {\n const gs = groupElement.groupSlots;\n if (!gs) return undefined;\n if (typeof gs === 'function') {\n return (gs as any)(fieldLogic.watchedValues, fieldLogic.formContext.getValues(), fieldLogic.formContext, groupField);\n }\n return gs;\n }, [groupElement.groupSlots, fieldLogic.watchedValues, fieldLogic.formContext, groupField]);\n\n const {elementStyles: groupStyles} = useComponentDefaults('Group', {\n slots: resolvedGroupSlots,\n } as any);\n const elStyles = useResolvedElementStyles(groupStyles);\n\n // Element-level `slots` (the outer KitsContainer's container/label/helperText/\n // error) arrive in the nested IElementSlotConfig shape; flatten to the flat\n // { [slot]: styleRecord } map KitsContainer expects. (groupSlots above drive\n // the inner repeatable list — root/body/row — and are already flattened.)\n const containerSlots = useMemo(() => flattenSlotStyles(slots), [slots]);\n\n // 2. Initialize react-hook-form's field array management.\n const fieldArray = useFieldArray({\n control,\n name: element.id as any,\n });\n const {fields, append, remove} = fieldArray;\n\n // console.log('hitted', element, {fields}, element.id)\n // 3. Process group settings with defaults, exactly like the original component.\n const settings = useMemo(() => ({\n grid: groupsSettings?.grid,\n repeatable: {\n minRepeats: groupsSettings?.repeatable?.minRepeats || 0,\n maxRepeats: groupsSettings?.repeatable?.maxRepeats || Infinity,\n plusButton: groupsSettings?.repeatable?.plusButton,\n minusButton: groupsSettings?.repeatable?.minusButton,\n },\n removeButtonRow: groupsSettings?.removeButtonRow,\n }), [groupsSettings]);\n\n // 4. Replicate the logic to build a default item object for new rows.\n const createDefaultItem = (): FieldValues => {\n const item: FieldValues = {};\n elements?.forEach(el => {\n if (\"displayOnly\" in el && el.displayOnly) return;\n\n if (\"initialUri\" in el) {\n item[el.id as string] = (el as any).initialUri;\n } else if (\"initialValue\" in el && el.initialValue !== undefined) {\n item[el.id as string] = el.initialValue;\n }\n });\n return item;\n };\n\n const handleAppend = (count = 1) => {\n const max = settings.repeatable.maxRepeats;\n\n if (max && fields.length >= max) {\n return;\n }\n const itemsToAdd = Array(count).fill(0).map(() => createDefaultItem());\n append(itemsToAdd as any, {shouldFocus: true});\n };\n\n const handleRemove = (index: number) => {\n if (fields.length > (settings.repeatable.minRepeats || 0)) {\n remove(index);\n }\n };\n useEffect(() => {\n const generateGroupElements = () => {\n const min = settings.repeatable.minRepeats || 0;\n if (fields.length < min) {\n const itemsToAppend = min - fields.length;\n // console.log({itemsToAppend, current: fields.length})\n\n handleAppend(itemsToAppend);\n }\n };\n\n // This pattern correctly avoids the infinite loop by not depending on `append` or `fields`.\n // The timeout gives react-hook-form time to initialize before we check the length.\n const timer = setTimeout(generateGroupElements, 100);\n return () => clearTimeout(timer);\n\n }, [element.id, settings.repeatable.minRepeats]); // Stable dependencies\n\n // 6. Replicate the `useImperativeHandle` logic to expose the ref.\n useImperativeHandle(groupsSettings?.ref, () => fieldArray, [fieldArray]);\n\n\n const reBuildElements = useCallback((field: FieldArrayWithId, index: number) => {\n return elements?.map((childElement) => {\n const toArray = Object.entries(field);\n\n const findField = toArray.find(([name]) => name == childElement.id);\n\n return {\n ...childElement,\n initialValue: findField ? findField[1] : undefined,\n };\n }) as IFormElement<any>[];\n }, [element, elements]);\n\n\n if (!isShown) {\n return null;\n }\n\n return (\n <KitsContainer\n id={element.id.toString()}\n label={label}\n helperText={groupHelperText}\n errors={fieldState?.error?.message}\n invalid={fieldState?.invalid}\n hideError={hideError}\n required={isRequired}\n bare\n elementStyles={containerSlots}\n >\n <Flex w=\"full\" flexDirection=\"column\" gap={6} mb={4}\n style={elStyles.root || undefined}>\n\n <Box style={elStyles.body || undefined}>\n {fields.map((field, index) => (\n <Flex key={field.id} w=\"full\" position=\"relative\" flexDirection=\"column\"\n rowGap={6}\n columnGap={8}\n style={elStyles.row || undefined}>\n\n <FormRenderer\n /* ⛔ THE SAME REASON AS `Object`: a repeated item's\n fields go through this nested renderer, so without\n this the form's `rowGap` never reaches the rows\n inside a repeatable card. The `rowGap={6}` on the\n Flex above is NOT this — it separates the item's\n fields from its remove button, and is deliberately\n left alone. */\n rowGap={rowGap}\n elements={reBuildElements(field, index)}\n control={control}\n groupField={{\n index,\n name: element.id.toString(),\n // Use the path-arg form of getValues so a Group nested inside\n // an Object resolves correctly: the FormRenderer rewrites this\n // Group's id to a dotted path (e.g. \"addressGroup.addresses\"),\n // and getValues()[dottedKey] would be undefined (→ crash on\n // [index]). getValues(path) traverses the nesting instead.\n values: (getValues(element.id as any) as any)?.[index],\n append: handleAppend,\n remove: () => handleRemove(index),\n }}\n getValues={getValues}\n parentPath={`${element.id.toString()}.${index}.`}\n focusedField={(focusedField ?? _focusedField)!}\n setFocusedField={(setFocusedField ?? _setFocusedField)!}\n grid={groupsSettings?.grid}\n />\n\n {settings.removeButtonRow && (\n <Box style={{zIndex: 1, ...(elStyles.removeButton || {})}}>\n {settings.removeButtonRow(fields.length, () => handleRemove(index), index)}\n </Box>\n )}\n\n\n {settings.repeatable.minusButton && fields.length > settings.repeatable.minRepeats && (\n <Box style={{zIndex: 1, ...(elStyles.removeButton || {})}}>\n {settings.repeatable.minusButton(fields.length, () => handleRemove(index))}\n </Box>\n )}\n </Flex>\n ))}\n </Box>\n\n {settings.repeatable.plusButton && (\n <Flex justifyContent=\"flex-start\" w=\"full\" mt={8}\n style={elStyles.addButton || undefined}>\n {settings.repeatable.plusButton(fields.length, handleAppend)}\n </Flex>\n )}\n </Flex>\n </KitsContainer>\n );\n};\n\nexport default Group;\n"],"names":["useState","useMemo","useComponentDefaults","useResolvedElementStyles","flattenSlotStyles","useFieldArray","useEffect","useImperativeHandle","useCallback","jsx","KitsContainer","jsxs","Flex","Box","index","FormRenderer"],"mappings":";;;;;;;;;;;;;;;;;;;AAeO,MAAM,QAAQ,CAAwB;AAAA,EACI,OAAA;AAAA,EACA,OAAA;AAAA,EACA,SAAA;AAAA,EACA,UAAA;AAAA,EACA,YAAA;AAAA,EACA,eAAA;AAAA,EACA,UAAA;AAAA,EACA;AACJ,CAAA,KAAoC;AAE7E,EAAA,MAAM,EAAC,OAAA,EAAS,KAAA,EAAO,QAAA,EAAU,UAAA,EAAY,iBAAiB,UAAA,EAAY,SAAA,EAAW,UAAA,EAAY,KAAA,EAAK,GAAI,UAAA;AAI1G,EAAA,MAAM,CAAC,aAAA,EAAe,gBAAgB,CAAA,GAAIA,eAAiB,EAAE,CAAA;AAE7D,EAAA,MAAM,YAAA,GAAe,OAAA;AACrB,EAAA,MAAM,EAAC,gBAAc,GAAI,YAAA;AAGzB,EAAA,MAAM,kBAAA,GAAqBC,cAAQ,MAAM;AACrC,IAAA,MAAM,KAAK,YAAA,CAAa,UAAA;AACxB,IAAA,IAAI,CAAC,IAAI,OAAO,MAAA;AAChB,IAAA,IAAI,OAAO,OAAO,UAAA,EAAY;AAC1B,MAAA,OAAQ,EAAA,CAAW,WAAW,aAAA,EAAe,UAAA,CAAW,YAAY,SAAA,EAAU,EAAG,UAAA,CAAW,WAAA,EAAa,UAAU,CAAA;AAAA,IACvH;AACA,IAAA,OAAO,EAAA;AAAA,EACX,CAAA,EAAG,CAAC,YAAA,CAAa,UAAA,EAAY,WAAW,aAAA,EAAe,UAAA,CAAW,WAAA,EAAa,UAAU,CAAC,CAAA;AAE1F,EAAA,MAAM,EAAC,aAAA,EAAe,WAAA,EAAW,GAAIC,6BAAqB,OAAA,EAAS;AAAA,IAC/D,KAAA,EAAO;AAAA,GACH,CAAA;AACR,EAAA,MAAM,QAAA,GAAWC,iCAAyB,WAAW,CAAA;AAMrD,EAAA,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CAAS,YAAA,IAAgB,EAAC,EAAE,EACnD,QAAA,EAAA,QAAA,CAAS,eAAA,CAAgB,MAAA,CAAO,MAAA,EAAQ,MAAM,YAAA,CAAaC,OAAK,CAAA,EAAGA,OAAK,CAAA,EAC7E,CAAA;AAAA,kBAIH,QAAA,CAAS,UAAA,CAAW,WAAA,IAAe,MAAA,CAAO,MAAA,GAAS,QAAA,CAAS,UAAA,CAAW,UAAA,oBACpEL,cAAA,CAACI,eAAA,EAAA,EAAI,KAAA,EAAO,EAAC,MAAA,EAAQ,CAAA,EAAG,GAAI,QAAA,CAAS,YAAA,IAAgB,EAAC,EAAE,EACnD,QAAA,EAAA,QAAA,CAAS,UAAA,CAAW,WAAA,CAAY,MAAA,CAAO,MAAA,EAAQ,MAAM,YAAA,CAAaC,OAAK,CAAC,CAAA,EAC7E;AAAA;AAAA,eAAA;AAAA,cA7CG,KAAA,CAAM;AAAA,aAgDpB,CAAA,EACL,CAAA;AAAA,YAEC,QAAA,CAAS,WAAW,UAAA,oBACjBL,cAAA;AAAA,cAACG,aAAA;AAAA,cAAA;AAAA,gBAAK,cAAA,EAAe,YAAA;AAAA,gBAAa,CAAA,EAAE,MAAA;AAAA,gBAAO,EAAA,EAAI,CAAA;AAAA,gBACzC,KAAA,EAAO,SAAS,SAAA,IAAa,MAAA;AAAA,gBAC9B,QAAA,EAAA,QAAA,CAAS,UAAA,CAAW,UAAA,CAAW,MAAA,CAAO,QAAQ,YAAY;AAAA;AAAA;AAC/D;AAAA;AAAA;AAER;AAAA,GACJ;AAER;;;;;"}
@@ -5,6 +5,7 @@ import KitsContainer from '../../../../form/helpers/FormContainer/index.js';
5
5
  import { FormRenderer } from '../../FormRenderer/index.js';
6
6
  import '../../../../contexts/DialogContext.js';
7
7
  import '../../../../contexts/PermissionsContext.js';
8
+ import '../../../../contexts/BreadcrumbContext.js';
8
9
  import useComponentDefaults from '../../../../hooks/useComponentDefaults.js';
9
10
  import useResolvedElementStyles from '../../../../hooks/useResolvedElementStyles.js';
10
11
  import { flattenSlotStyles } from '../../../utils/helpers.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../../src/form-renderer/components/fields/Group/index.native.tsx"],"sourcesContent":["// components/fields/Group.tsx\n\nimport React, {useCallback, useEffect, useImperativeHandle, useMemo, useState} from 'react';\nimport {type FieldArrayWithId, type FieldValues, useFieldArray} from 'react-hook-form';\nimport type {IFormElement, IGroup, UseFieldLogicElementProps} from \"@lmb-it/kitsconcerto-types\";\nimport {Box, Flex} from \"../../../../_compat\";\nimport KitsContainer from \"../../../../form/helpers/FormContainer\";\nimport {FormRenderer} from \"../../FormRenderer\";\nimport {useComponentDefaults, useResolvedElementStyles} from \"../../../../hooks\";\nimport {flattenSlotStyles} from \"../../../utils\";\n\n/**\n * Renders a repeatable group of fields (a field array), preserving all the logic\n * for default values, min/max repeats, and custom action buttons.\n */\nexport const Group = <T extends FieldValues>({\n element,\n control,\n getValues,\n groupField,\n focusedField,\n setFocusedField,\n fieldLogic,\n rowGap,\n }: UseFieldLogicElementProps<T>) => { // Ensure UseFieldLogicProps is updated to pass focus props\n // 1. Get the group's own dynamic state (visibility, layout, label) from the logic hook.\n const {isShown, label, elements, helperText: groupHelperText, fieldState, hideError, isRequired, slots} = fieldLogic;\n\n // Fallback focus state, used only when the parent form doesn't supply\n // focusedField/setFocusedField — web passes the props straight through.\n const [_focusedField, _setFocusedField] = useState<string>('');\n\n const groupElement = element as IGroup<T>;\n const {groupsSettings} = groupElement;\n\n // Resolve groupSlots (dynamic or static) and merge with theme Group defaults\n const resolvedGroupSlots = useMemo(() => {\n const gs = groupElement.groupSlots;\n if (!gs) return undefined;\n if (typeof gs === 'function') {\n return (gs as any)(fieldLogic.watchedValues, fieldLogic.formContext.getValues(), fieldLogic.formContext, groupField);\n }\n return gs;\n }, [groupElement.groupSlots, fieldLogic.watchedValues, fieldLogic.formContext, groupField]);\n\n const {elementStyles: groupStyles} = useComponentDefaults('Group', {\n slots: resolvedGroupSlots,\n } as any);\n const elStyles = useResolvedElementStyles(groupStyles);\n\n // Element-level `slots` (the outer KitsContainer's container/label/helperText/\n // error) arrive in the nested IElementSlotConfig shape; flatten to the flat\n // { [slot]: styleRecord } map KitsContainer expects. (groupSlots above drive\n // the inner repeatable list — root/body/row — and are already flattened.)\n const containerSlots = useMemo(() => flattenSlotStyles(slots), [slots]);\n\n // 2. Initialize react-hook-form's field array management.\n const fieldArray = useFieldArray({\n control,\n name: element.id as any,\n });\n const {fields, append, remove} = fieldArray;\n\n // console.log('hitted', element, {fields}, element.id)\n // 3. Process group settings with defaults, exactly like the original component.\n const settings = useMemo(() => ({\n grid: groupsSettings?.grid,\n repeatable: {\n minRepeats: groupsSettings?.repeatable?.minRepeats || 0,\n maxRepeats: groupsSettings?.repeatable?.maxRepeats || Infinity,\n plusButton: groupsSettings?.repeatable?.plusButton,\n minusButton: groupsSettings?.repeatable?.minusButton,\n },\n removeButtonRow: groupsSettings?.removeButtonRow,\n }), [groupsSettings]);\n\n // 4. Replicate the logic to build a default item object for new rows.\n const createDefaultItem = (): FieldValues => {\n const item: FieldValues = {};\n elements?.forEach(el => {\n if (\"displayOnly\" in el && el.displayOnly) return;\n\n if (\"initialUri\" in el) {\n item[el.id as string] = (el as any).initialUri;\n } else if (\"initialValue\" in el && el.initialValue !== undefined) {\n item[el.id as string] = el.initialValue;\n }\n });\n return item;\n };\n\n const handleAppend = (count = 1) => {\n const max = settings.repeatable.maxRepeats;\n\n if (max && fields.length >= max) {\n return;\n }\n const itemsToAdd = Array(count).fill(0).map(() => createDefaultItem());\n append(itemsToAdd as any, {shouldFocus: true});\n };\n\n const handleRemove = (index: number) => {\n if (fields.length > (settings.repeatable.minRepeats || 0)) {\n remove(index);\n }\n };\n useEffect(() => {\n const generateGroupElements = () => {\n const min = settings.repeatable.minRepeats || 0;\n if (fields.length < min) {\n const itemsToAppend = min - fields.length;\n // console.log({itemsToAppend, current: fields.length})\n\n handleAppend(itemsToAppend);\n }\n };\n\n // This pattern correctly avoids the infinite loop by not depending on `append` or `fields`.\n // The timeout gives react-hook-form time to initialize before we check the length.\n const timer = setTimeout(generateGroupElements, 100);\n return () => clearTimeout(timer);\n\n }, [element.id, settings.repeatable.minRepeats]); // Stable dependencies\n\n // 6. Replicate the `useImperativeHandle` logic to expose the ref.\n useImperativeHandle(groupsSettings?.ref, () => fieldArray, [fieldArray]);\n\n\n const reBuildElements = useCallback((field: FieldArrayWithId, index: number) => {\n return elements?.map((childElement) => {\n const toArray = Object.entries(field);\n\n const findField = toArray.find(([name]) => name == childElement.id);\n\n return {\n ...childElement,\n initialValue: findField ? findField[1] : undefined,\n };\n }) as IFormElement<any>[];\n }, [element, elements]);\n\n\n if (!isShown) {\n return null;\n }\n\n return (\n <KitsContainer\n id={element.id.toString()}\n label={label}\n helperText={groupHelperText}\n errors={fieldState?.error?.message}\n invalid={fieldState?.invalid}\n hideError={hideError}\n required={isRequired}\n bare\n elementStyles={containerSlots}\n >\n <Flex w=\"full\" flexDirection=\"column\" gap={6} mb={4}\n style={elStyles.root || undefined}>\n\n <Box style={elStyles.body || undefined}>\n {fields.map((field, index) => (\n <Flex key={field.id} w=\"full\" position=\"relative\" flexDirection=\"column\"\n rowGap={6}\n columnGap={8}\n style={elStyles.row || undefined}>\n\n <FormRenderer\n /* ⛔ THE SAME REASON AS `Object`: a repeated item's\n fields go through this nested renderer, so without\n this the form's `rowGap` never reaches the rows\n inside a repeatable card. The `rowGap={6}` on the\n Flex above is NOT this — it separates the item's\n fields from its remove button, and is deliberately\n left alone. */\n rowGap={rowGap}\n elements={reBuildElements(field, index)}\n control={control}\n groupField={{\n index,\n name: element.id.toString(),\n // Use the path-arg form of getValues so a Group nested inside\n // an Object resolves correctly: the FormRenderer rewrites this\n // Group's id to a dotted path (e.g. \"addressGroup.addresses\"),\n // and getValues()[dottedKey] would be undefined (→ crash on\n // [index]). getValues(path) traverses the nesting instead.\n values: (getValues(element.id as any) as any)?.[index],\n append: handleAppend,\n remove: () => handleRemove(index),\n }}\n getValues={getValues}\n parentPath={`${element.id.toString()}.${index}.`}\n focusedField={(focusedField ?? _focusedField)!}\n setFocusedField={(setFocusedField ?? _setFocusedField)!}\n grid={groupsSettings?.grid}\n />\n\n {settings.removeButtonRow && (\n <Box style={{zIndex: 1, ...(elStyles.removeButton || {})}}>\n {settings.removeButtonRow(fields.length, () => handleRemove(index), index)}\n </Box>\n )}\n\n\n {settings.repeatable.minusButton && fields.length > settings.repeatable.minRepeats && (\n <Box style={{zIndex: 1, ...(elStyles.removeButton || {})}}>\n {settings.repeatable.minusButton(fields.length, () => handleRemove(index))}\n </Box>\n )}\n </Flex>\n ))}\n </Box>\n\n {settings.repeatable.plusButton && (\n <Flex justifyContent=\"flex-start\" w=\"full\" mt={8}\n style={elStyles.addButton || undefined}>\n {settings.repeatable.plusButton(fields.length, handleAppend)}\n </Flex>\n )}\n </Flex>\n </KitsContainer>\n );\n};\n\nexport default Group;\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAeO,MAAM,QAAQ,CAAwB;AAAA,EACI,OAAA;AAAA,EACA,OAAA;AAAA,EACA,SAAA;AAAA,EACA,UAAA;AAAA,EACA,YAAA;AAAA,EACA,eAAA;AAAA,EACA,UAAA;AAAA,EACA;AACJ,CAAA,KAAoC;AAE7E,EAAA,MAAM,EAAC,OAAA,EAAS,KAAA,EAAO,QAAA,EAAU,UAAA,EAAY,iBAAiB,UAAA,EAAY,SAAA,EAAW,UAAA,EAAY,KAAA,EAAK,GAAI,UAAA;AAI1G,EAAA,MAAM,CAAC,aAAA,EAAe,gBAAgB,CAAA,GAAI,SAAiB,EAAE,CAAA;AAE7D,EAAA,MAAM,YAAA,GAAe,OAAA;AACrB,EAAA,MAAM,EAAC,gBAAc,GAAI,YAAA;AAGzB,EAAA,MAAM,kBAAA,GAAqB,QAAQ,MAAM;AACrC,IAAA,MAAM,KAAK,YAAA,CAAa,UAAA;AACxB,IAAA,IAAI,CAAC,IAAI,OAAO,MAAA;AAChB,IAAA,IAAI,OAAO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SAAA,IAAa,MAAA;AAAA,gBAC9B,QAAA,EAAA,QAAA,CAAS,UAAA,CAAW,UAAA,CAAW,MAAA,CAAO,QAAQ,YAAY;AAAA;AAAA;AAC/D;AAAA;AAAA;AAER;AAAA,GACJ;AAER;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../../src/form-renderer/components/fields/Group/index.native.tsx"],"sourcesContent":["// components/fields/Group.tsx\n\nimport React, {useCallback, useEffect, useImperativeHandle, useMemo, useState} from 'react';\nimport {type FieldArrayWithId, type FieldValues, useFieldArray} from 'react-hook-form';\nimport type {IFormElement, IGroup, UseFieldLogicElementProps} from \"@lmb-it/kitsconcerto-types\";\nimport {Box, Flex} from \"../../../../_compat\";\nimport KitsContainer from \"../../../../form/helpers/FormContainer\";\nimport {FormRenderer} from \"../../FormRenderer\";\nimport {useComponentDefaults, useResolvedElementStyles} from \"../../../../hooks\";\nimport {flattenSlotStyles} from \"../../../utils\";\n\n/**\n * Renders a repeatable group of fields (a field array), preserving all the logic\n * for default values, min/max repeats, and custom action buttons.\n */\nexport const Group = <T extends FieldValues>({\n element,\n control,\n getValues,\n groupField,\n focusedField,\n setFocusedField,\n fieldLogic,\n rowGap,\n }: UseFieldLogicElementProps<T>) => { // Ensure UseFieldLogicProps is updated to pass focus props\n // 1. Get the group's own dynamic state (visibility, layout, label) from the logic hook.\n const {isShown, label, elements, helperText: groupHelperText, fieldState, hideError, isRequired, slots} = fieldLogic;\n\n // Fallback focus state, used only when the parent form doesn't supply\n // focusedField/setFocusedField — web passes the props straight through.\n const [_focusedField, _setFocusedField] = useState<string>('');\n\n const groupElement = element as IGroup<T>;\n const {groupsSettings} = groupElement;\n\n // Resolve groupSlots (dynamic or static) and merge with theme Group defaults\n const resolvedGroupSlots = useMemo(() => {\n const gs = groupElement.groupSlots;\n if (!gs) return undefined;\n if (typeof gs === 'function') {\n return (gs as any)(fieldLogic.watchedValues, fieldLogic.formContext.getValues(), fieldLogic.formContext, groupField);\n }\n return gs;\n }, [groupElement.groupSlots, fieldLogic.watchedValues, fieldLogic.formContext, groupField]);\n\n const {elementStyles: groupStyles} = useComponentDefaults('Group', {\n slots: resolvedGroupSlots,\n } as any);\n const elStyles = useResolvedElementStyles(groupStyles);\n\n // Element-level `slots` (the outer KitsContainer's container/label/helperText/\n // error) arrive in the nested IElementSlotConfig shape; flatten to the flat\n // { [slot]: styleRecord } map KitsContainer expects. (groupSlots above drive\n // the inner repeatable list — root/body/row — and are already flattened.)\n const containerSlots = useMemo(() => flattenSlotStyles(slots), [slots]);\n\n // 2. Initialize react-hook-form's field array management.\n const fieldArray = useFieldArray({\n control,\n name: element.id as any,\n });\n const {fields, append, remove} = fieldArray;\n\n // console.log('hitted', element, {fields}, element.id)\n // 3. Process group settings with defaults, exactly like the original component.\n const settings = useMemo(() => ({\n grid: groupsSettings?.grid,\n repeatable: {\n minRepeats: groupsSettings?.repeatable?.minRepeats || 0,\n maxRepeats: groupsSettings?.repeatable?.maxRepeats || Infinity,\n plusButton: groupsSettings?.repeatable?.plusButton,\n minusButton: groupsSettings?.repeatable?.minusButton,\n },\n removeButtonRow: groupsSettings?.removeButtonRow,\n }), [groupsSettings]);\n\n // 4. Replicate the logic to build a default item object for new rows.\n const createDefaultItem = (): FieldValues => {\n const item: FieldValues = {};\n elements?.forEach(el => {\n if (\"displayOnly\" in el && el.displayOnly) return;\n\n if (\"initialUri\" in el) {\n item[el.id as string] = (el as any).initialUri;\n } else if (\"initialValue\" in el && el.initialValue !== undefined) {\n item[el.id as string] = el.initialValue;\n }\n });\n return item;\n };\n\n const handleAppend = (count = 1) => {\n const max = settings.repeatable.maxRepeats;\n\n if (max && fields.length >= max) {\n return;\n }\n const itemsToAdd = Array(count).fill(0).map(() => createDefaultItem());\n append(itemsToAdd as any, {shouldFocus: true});\n };\n\n const handleRemove = (index: number) => {\n if (fields.length > (settings.repeatable.minRepeats || 0)) {\n remove(index);\n }\n };\n useEffect(() => {\n const generateGroupElements = () => {\n const min = settings.repeatable.minRepeats || 0;\n if (fields.length < min) {\n const itemsToAppend = min - fields.length;\n // console.log({itemsToAppend, current: fields.length})\n\n handleAppend(itemsToAppend);\n }\n };\n\n // This pattern correctly avoids the infinite loop by not depending on `append` or `fields`.\n // The timeout gives react-hook-form time to initialize before we check the length.\n const timer = setTimeout(generateGroupElements, 100);\n return () => clearTimeout(timer);\n\n }, [element.id, settings.repeatable.minRepeats]); // Stable dependencies\n\n // 6. Replicate the `useImperativeHandle` logic to expose the ref.\n useImperativeHandle(groupsSettings?.ref, () => fieldArray, [fieldArray]);\n\n\n const reBuildElements = useCallback((field: FieldArrayWithId, index: number) => {\n return elements?.map((childElement) => {\n const toArray = Object.entries(field);\n\n const findField = toArray.find(([name]) => name == childElement.id);\n\n return {\n ...childElement,\n initialValue: findField ? findField[1] : undefined,\n };\n }) as IFormElement<any>[];\n }, [element, elements]);\n\n\n if (!isShown) {\n return null;\n }\n\n return (\n <KitsContainer\n id={element.id.toString()}\n label={label}\n helperText={groupHelperText}\n errors={fieldState?.error?.message}\n invalid={fieldState?.invalid}\n hideError={hideError}\n required={isRequired}\n bare\n elementStyles={containerSlots}\n >\n <Flex w=\"full\" flexDirection=\"column\" gap={6} mb={4}\n style={elStyles.root || undefined}>\n\n <Box style={elStyles.body || undefined}>\n {fields.map((field, index) => (\n <Flex key={field.id} w=\"full\" position=\"relative\" flexDirection=\"column\"\n rowGap={6}\n columnGap={8}\n style={elStyles.row || undefined}>\n\n <FormRenderer\n /* ⛔ THE SAME REASON AS `Object`: a repeated item's\n fields go through this nested renderer, so without\n this the form's `rowGap` never reaches the rows\n inside a repeatable card. The `rowGap={6}` on the\n Flex above is NOT this — it separates the item's\n fields from its remove button, and is deliberately\n left alone. */\n rowGap={rowGap}\n elements={reBuildElements(field, index)}\n control={control}\n groupField={{\n index,\n name: element.id.toString(),\n // Use the path-arg form of getValues so a Group nested inside\n // an Object resolves correctly: the FormRenderer rewrites this\n // Group's id to a dotted path (e.g. \"addressGroup.addresses\"),\n // and getValues()[dottedKey] would be undefined (→ crash on\n // [index]). getValues(path) traverses the nesting instead.\n values: (getValues(element.id as any) as any)?.[index],\n append: handleAppend,\n remove: () => handleRemove(index),\n }}\n getValues={getValues}\n parentPath={`${element.id.toString()}.${index}.`}\n focusedField={(focusedField ?? _focusedField)!}\n setFocusedField={(setFocusedField ?? _setFocusedField)!}\n grid={groupsSettings?.grid}\n />\n\n {settings.removeButtonRow && (\n <Box style={{zIndex: 1, ...(elStyles.removeButton || {})}}>\n {settings.removeButtonRow(fields.length, () => handleRemove(index), index)}\n </Box>\n )}\n\n\n {settings.repeatable.minusButton && fields.length > settings.repeatable.minRepeats && (\n <Box style={{zIndex: 1, ...(elStyles.removeButton || {})}}>\n {settings.repeatable.minusButton(fields.length, () => handleRemove(index))}\n </Box>\n )}\n </Flex>\n ))}\n </Box>\n\n {settings.repeatable.plusButton && (\n <Flex justifyContent=\"flex-start\" w=\"full\" mt={8}\n style={elStyles.addButton || undefined}>\n {settings.repeatable.plusButton(fields.length, handleAppend)}\n </Flex>\n )}\n </Flex>\n </KitsContainer>\n );\n};\n\nexport default Group;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAeO,MAAM,QAAQ,CAAwB;AAAA,EACI,OAAA;AAAA,EACA,OAAA;AAAA,EACA,SAAA;AAAA,EACA,UAAA;AAAA,EACA,YAAA;AAAA,EACA,eAAA;AAAA,EACA,UAAA;AAAA,EACA;AACJ,CAAA,KAAoC;AAE7E,EAAA,MAAM,EAAC,OAAA,EAAS,KAAA,EAAO,QAAA,EAAU,UAAA,EAAY,iBAAiB,UAAA,EAAY,SAAA,EAAW,UAAA,EAAY,KAAA,EAAK,GAAI,UAAA;AAI1G,EAAA,MAAM,CAAC,aAAA,EAAe,gBAAgB,CAAA,GAAI,SAAiB,EAAE,CAAA;AAE7D,EAAA,MAAM,YAAA,GAAe,OAAA;AACrB,EAAA,MAAM,EAAC,gBAAc,GAAI,YAAA;AAGzB,EAAA,MAAM,kBAAA,GAAqB,QAAQ,MAAM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A,EAAe,YAAA;AAAA,gBAAa,CAAA,EAAE,MAAA;AAAA,gBAAO,EAAA,EAAI,CAAA;AAAA,gBACzC,KAAA,EAAO,SAAS,SAAA,IAAa,MAAA;AAAA,gBAC9B,QAAA,EAAA,QAAA,CAAS,UAAA,CAAW,UAAA,CAAW,MAAA,CAAO,QAAQ,YAAY;AAAA;AAAA;AAC/D;AAAA;AAAA;AAER;AAAA,GACJ;AAER;;;;"}
@@ -7,6 +7,7 @@ var radio_native = require('../../../../form/controls/RadioButton/radio.cjs');
7
7
  require('react');
8
8
  require('../../../../contexts/DialogContext.cjs');
9
9
  require('../../../../contexts/PermissionsContext.cjs');
10
+ require('../../../../contexts/BreadcrumbContext.cjs');
10
11
 
11
12
  const Radios = ({
12
13
  element,
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../../../../../../src/form-renderer/components/fields/Radios/index.tsx"],"sourcesContent":["// components/fields/Checkboxes.tsx\n\nimport React from 'react';\nimport type {FieldValues} from 'react-hook-form';\nimport type {ICheckbox, UseFieldLogicElementProps} from \"@lmb-it/kitsconcerto-types\";\nimport {Flex, KitsRadios} from \"../../../../_compat\";\nimport type {IRadioCheckboxListItem} from \"@lmb-it/kitsconcerto-types\";\n\n/**\n * Renders a group of checkboxes.\n\n */\nexport const Radios = <T extends FieldValues>({\n element,\n control,\n getValues,\n fieldLogic,\n }: UseFieldLogicElementProps<T>) => {\n\n // 1. The central hook provides all the necessary state and resolved props.\n const {\n field,\n fieldState,\n label,\n isDisabled,\n isRequired,\n helperText,\n hideError,\n list,\n attached,\n style: elementStyle,\n slots,\n } = fieldLogic\n\n\n\n // 2. Cast the element to its specific type to access unique properties.\n const checkboxElement = element as ICheckbox<T>;\n const {vertical} = checkboxElement;\n\n // 3. The component is now only responsible for rendering the UI.\n return (\n <KitsRadios<T>\n // --- Core react-hook-form props ---\n {...field} // Spreads `onChange`, `onBlur`, `value`, `ref`\n\n onChange={(checked, event)=>{\n field.onChange({\n target:{\n value:event.value\n }\n });\n }}\n // --- Resolved props from useFieldLogic ---\n id={field.name}\n label={label}\n hideError={hideError}\n disabled={isDisabled}\n required={isRequired}\n invalid={fieldState.invalid}\n errors={fieldState.error?.message}\n helperText={helperText}\n item={list as IRadioCheckboxListItem[]}\n attached={attached}\n appearanceMode={vertical ? 'vertical' : 'horizontal'}\n style={elementStyle?.input}\n containerStyle={elementStyle?.container}\n slots={slots}\n />\n );\n};\n\nexport default Radios;\n"],"names":["jsx","KitsRadios"],"mappings":";;;;;;;;;;AAYO,MAAM,SAAS,CAAwB;AAAA,EACI,OAAA;AAAA,EACA,OAAA;AAAA,EACA,SAAA;AAAA,EACA;AACJ,CAAA,KAAoC;AAG9E,EAAA,MAAM;AAAA,IACF,KAAA;AAAA,IACA,UAAA;AAAA,IACA,KAAA;AAAA,IACA,UAAA;AAAA,IACA,UAAA;AAAA,IACA,UAAA;AAAA,IACA,SAAA;AAAA,IACA,IAAA;AAAA,IACA,QAAA;AAAA,IACA,KAAA,EAAO,YAAA;AAAA,IACP;AAAA,GACJ,GAAI,UAAA;AAKJ,EAAA,MAAM,eAAA,GAAkB,OAAA;AACxB,EAAA,MAAM,EAAC,UAAQ,GAAI,eAAA;AAGnB,EAAA,uBACIA,cAAA;AAAA,IAACC,oBAAA;AAAA,IAAA;AAAA,MAEI,GAAG,KAAA;AAAA,MAEJ,QAAA,EAAU,CAAC,OAAA,EAAS,KAAA,KAAQ;AACxB,QAAA,KAAA,CAAM,QAAA,CAAS;AAAA,UACX,MAAA,EAAO;AAAA,YACH,OAAM,KAAA,CAAM;AAAA;AAChB,SACH,CAAA;AAAA,MACL,CAAA;AAAA,MAEA,IAAI,KAAA,CAAM,IAAA;AAAA,MACV,KAAA;AAAA,MACA,SAAA;AAAA,MACA,QAAA,EAAU,UAAA;AAAA,MACV,QAAA,EAAU,UAAA;AAAA,MACV,SAAS,UAAA,CAAW,OAAA;AAAA,MACpB,MAAA,EAAQ,WAAW,KAAA,EAAO,OAAA;AAAA,MAC1B,UAAA;AAAA,MACA,IAAA,EAAM,IAAA;AAAA,MACN,QAAA;AAAA,MACA,cAAA,EAAgB,WAAW,UAAA,GAAa,YAAA;AAAA,MACxC,OAAO,YAAA,EAAc,KAAA;AAAA,MACrB,gBAAgB,YAAA,EAAc,SAAA;AAAA,MAC9B;AAAA;AAAA,GACJ;AAER;;;;;"}
1
+ {"version":3,"file":"index.cjs","sources":["../../../../../../src/form-renderer/components/fields/Radios/index.tsx"],"sourcesContent":["// components/fields/Checkboxes.tsx\n\nimport React from 'react';\nimport type {FieldValues} from 'react-hook-form';\nimport type {ICheckbox, UseFieldLogicElementProps} from \"@lmb-it/kitsconcerto-types\";\nimport {Flex, KitsRadios} from \"../../../../_compat\";\nimport type {IRadioCheckboxListItem} from \"@lmb-it/kitsconcerto-types\";\n\n/**\n * Renders a group of checkboxes.\n\n */\nexport const Radios = <T extends FieldValues>({\n element,\n control,\n getValues,\n fieldLogic,\n }: UseFieldLogicElementProps<T>) => {\n\n // 1. The central hook provides all the necessary state and resolved props.\n const {\n field,\n fieldState,\n label,\n isDisabled,\n isRequired,\n helperText,\n hideError,\n list,\n attached,\n style: elementStyle,\n slots,\n } = fieldLogic\n\n\n\n // 2. Cast the element to its specific type to access unique properties.\n const checkboxElement = element as ICheckbox<T>;\n const {vertical} = checkboxElement;\n\n // 3. The component is now only responsible for rendering the UI.\n return (\n <KitsRadios<T>\n // --- Core react-hook-form props ---\n {...field} // Spreads `onChange`, `onBlur`, `value`, `ref`\n\n onChange={(checked, event)=>{\n field.onChange({\n target:{\n value:event.value\n }\n });\n }}\n // --- Resolved props from useFieldLogic ---\n id={field.name}\n label={label}\n hideError={hideError}\n disabled={isDisabled}\n required={isRequired}\n invalid={fieldState.invalid}\n errors={fieldState.error?.message}\n helperText={helperText}\n item={list as IRadioCheckboxListItem[]}\n attached={attached}\n appearanceMode={vertical ? 'vertical' : 'horizontal'}\n style={elementStyle?.input}\n containerStyle={elementStyle?.container}\n slots={slots}\n />\n );\n};\n\nexport default Radios;\n"],"names":["jsx","KitsRadios"],"mappings":";;;;;;;;;;;AAYO,MAAM,SAAS,CAAwB;AAAA,EACI,OAAA;AAAA,EACA,OAAA;AAAA,EACA,SAAA;AAAA,EACA;AACJ,CAAA,KAAoC;AAG9E,EAAA,MAAM;AAAA,IACF,KAAA;AAAA,IACA,UAAA;AAAA,IACA,KAAA;AAAA,IACA,UAAA;AAAA,IACA,UAAA;AAAA,IACA,UAAA;AAAA,IACA,SAAA;AAAA,IACA,IAAA;AAAA,IACA,QAAA;AAAA,IACA,KAAA,EAAO,YAAA;AAAA,IACP;AAAA,GACJ,GAAI,UAAA;AAKJ,EAAA,MAAM,eAAA,GAAkB,OAAA;AACxB,EAAA,MAAM,EAAC,UAAQ,GAAI,eAAA;AAGnB,EAAA,uBACIA,cAAA;AAAA,IAACC,oBAAA;AAAA,IAAA;AAAA,MAEI,GAAG,KAAA;AAAA,MAEJ,QAAA,EAAU,CAAC,OAAA,EAAS,KAAA,KAAQ;AACxB,QAAA,KAAA,CAAM,QAAA,CAAS;AAAA,UACX,MAAA,EAAO;AAAA,YACH,OAAM,KAAA,CAAM;AAAA;AAChB,SACH,CAAA;AAAA,MACL,CAAA;AAAA,MAEA,IAAI,KAAA,CAAM,IAAA;AAAA,MACV,KAAA;AAAA,MACA,SAAA;AAAA,MACA,QAAA,EAAU,UAAA;AAAA,MACV,QAAA,EAAU,UAAA;AAAA,MACV,SAAS,UAAA,CAAW,OAAA;AAAA,MACpB,MAAA,EAAQ,WAAW,KAAA,EAAO,OAAA;AAAA,MAC1B,UAAA;AAAA,MACA,IAAA,EAAM,IAAA;AAAA,MACN,QAAA;AAAA,MACA,cAAA,EAAgB,WAAW,UAAA,GAAa,YAAA;AAAA,MACxC,OAAO,YAAA,EAAc,KAAA;AAAA,MACrB,gBAAgB,YAAA,EAAc,SAAA;AAAA,MAC9B;AAAA;AAAA,GACJ;AAER;;;;;"}
@@ -3,6 +3,7 @@ import KitsRadio from '../../../../form/controls/RadioButton/radio.js';
3
3
  import 'react';
4
4
  import '../../../../contexts/DialogContext.js';
5
5
  import '../../../../contexts/PermissionsContext.js';
6
+ import '../../../../contexts/BreadcrumbContext.js';
6
7
 
7
8
  const Radios = ({
8
9
  element,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../../src/form-renderer/components/fields/Radios/index.tsx"],"sourcesContent":["// components/fields/Checkboxes.tsx\n\nimport React from 'react';\nimport type {FieldValues} from 'react-hook-form';\nimport type {ICheckbox, UseFieldLogicElementProps} from \"@lmb-it/kitsconcerto-types\";\nimport {Flex, KitsRadios} from \"../../../../_compat\";\nimport type {IRadioCheckboxListItem} from \"@lmb-it/kitsconcerto-types\";\n\n/**\n * Renders a group of checkboxes.\n\n */\nexport const Radios = <T extends FieldValues>({\n element,\n control,\n getValues,\n fieldLogic,\n }: UseFieldLogicElementProps<T>) => {\n\n // 1. The central hook provides all the necessary state and resolved props.\n const {\n field,\n fieldState,\n label,\n isDisabled,\n isRequired,\n helperText,\n hideError,\n list,\n attached,\n style: elementStyle,\n slots,\n } = fieldLogic\n\n\n\n // 2. Cast the element to its specific type to access unique properties.\n const checkboxElement = element as ICheckbox<T>;\n const {vertical} = checkboxElement;\n\n // 3. The component is now only responsible for rendering the UI.\n return (\n <KitsRadios<T>\n // --- Core react-hook-form props ---\n {...field} // Spreads `onChange`, `onBlur`, `value`, `ref`\n\n onChange={(checked, event)=>{\n field.onChange({\n target:{\n value:event.value\n }\n });\n }}\n // --- Resolved props from useFieldLogic ---\n id={field.name}\n label={label}\n hideError={hideError}\n disabled={isDisabled}\n required={isRequired}\n invalid={fieldState.invalid}\n errors={fieldState.error?.message}\n helperText={helperText}\n item={list as IRadioCheckboxListItem[]}\n attached={attached}\n appearanceMode={vertical ? 'vertical' : 'horizontal'}\n style={elementStyle?.input}\n containerStyle={elementStyle?.container}\n slots={slots}\n />\n );\n};\n\nexport default Radios;\n"],"names":["KitsRadios"],"mappings":";;;;;;AAYO,MAAM,SAAS,CAAwB;AAAA,EACI,OAAA;AAAA,EACA,OAAA;AAAA,EACA,SAAA;AAAA,EACA;AACJ,CAAA,KAAoC;AAG9E,EAAA,MAAM;AAAA,IACF,KAAA;AAAA,IACA,UAAA;AAAA,IACA,KAAA;AAAA,IACA,UAAA;AAAA,IACA,UAAA;AAAA,IACA,UAAA;AAAA,IACA,SAAA;AAAA,IACA,IAAA;AAAA,IACA,QAAA;AAAA,IACA,KAAA,EAAO,YAAA;AAAA,IACP;AAAA,GACJ,GAAI,UAAA;AAKJ,EAAA,MAAM,eAAA,GAAkB,OAAA;AACxB,EAAA,MAAM,EAAC,UAAQ,GAAI,eAAA;AAGnB,EAAA,uBACI,GAAA;AAAA,IAACA,SAAA;AAAA,IAAA;AAAA,MAEI,GAAG,KAAA;AAAA,MAEJ,QAAA,EAAU,CAAC,OAAA,EAAS,KAAA,KAAQ;AACxB,QAAA,KAAA,CAAM,QAAA,CAAS;AAAA,UACX,MAAA,EAAO;AAAA,YACH,OAAM,KAAA,CAAM;AAAA;AAChB,SACH,CAAA;AAAA,MACL,CAAA;AAAA,MAEA,IAAI,KAAA,CAAM,IAAA;AAAA,MACV,KAAA;AAAA,MACA,SAAA;AAAA,MACA,QAAA,EAAU,UAAA;AAAA,MACV,QAAA,EAAU,UAAA;AAAA,MACV,SAAS,UAAA,CAAW,OAAA;AAAA,MACpB,MAAA,EAAQ,WAAW,KAAA,EAAO,OAAA;AAAA,MAC1B,UAAA;AAAA,MACA,IAAA,EAAM,IAAA;AAAA,MACN,QAAA;AAAA,MACA,cAAA,EAAgB,WAAW,UAAA,GAAa,YAAA;AAAA,MACxC,OAAO,YAAA,EAAc,KAAA;AAAA,MACrB,gBAAgB,YAAA,EAAc,SAAA;AAAA,MAC9B;AAAA;AAAA,GACJ;AAER;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../../src/form-renderer/components/fields/Radios/index.tsx"],"sourcesContent":["// components/fields/Checkboxes.tsx\n\nimport React from 'react';\nimport type {FieldValues} from 'react-hook-form';\nimport type {ICheckbox, UseFieldLogicElementProps} from \"@lmb-it/kitsconcerto-types\";\nimport {Flex, KitsRadios} from \"../../../../_compat\";\nimport type {IRadioCheckboxListItem} from \"@lmb-it/kitsconcerto-types\";\n\n/**\n * Renders a group of checkboxes.\n\n */\nexport const Radios = <T extends FieldValues>({\n element,\n control,\n getValues,\n fieldLogic,\n }: UseFieldLogicElementProps<T>) => {\n\n // 1. The central hook provides all the necessary state and resolved props.\n const {\n field,\n fieldState,\n label,\n isDisabled,\n isRequired,\n helperText,\n hideError,\n list,\n attached,\n style: elementStyle,\n slots,\n } = fieldLogic\n\n\n\n // 2. Cast the element to its specific type to access unique properties.\n const checkboxElement = element as ICheckbox<T>;\n const {vertical} = checkboxElement;\n\n // 3. The component is now only responsible for rendering the UI.\n return (\n <KitsRadios<T>\n // --- Core react-hook-form props ---\n {...field} // Spreads `onChange`, `onBlur`, `value`, `ref`\n\n onChange={(checked, event)=>{\n field.onChange({\n target:{\n value:event.value\n }\n });\n }}\n // --- Resolved props from useFieldLogic ---\n id={field.name}\n label={label}\n hideError={hideError}\n disabled={isDisabled}\n required={isRequired}\n invalid={fieldState.invalid}\n errors={fieldState.error?.message}\n helperText={helperText}\n item={list as IRadioCheckboxListItem[]}\n attached={attached}\n appearanceMode={vertical ? 'vertical' : 'horizontal'}\n style={elementStyle?.input}\n containerStyle={elementStyle?.container}\n slots={slots}\n />\n );\n};\n\nexport default Radios;\n"],"names":["KitsRadios"],"mappings":";;;;;;;AAYO,MAAM,SAAS,CAAwB;AAAA,EACI,OAAA;AAAA,EACA,OAAA;AAAA,EACA,SAAA;AAAA,EACA;AACJ,CAAA,KAAoC;AAG9E,EAAA,MAAM;AAAA,IACF,KAAA;AAAA,IACA,UAAA;AAAA,IACA,KAAA;AAAA,IACA,UAAA;AAAA,IACA,UAAA;AAAA,IACA,UAAA;AAAA,IACA,SAAA;AAAA,IACA,IAAA;AAAA,IACA,QAAA;AAAA,IACA,KAAA,EAAO,YAAA;AAAA,IACP;AAAA,GACJ,GAAI,UAAA;AAKJ,EAAA,MAAM,eAAA,GAAkB,OAAA;AACxB,EAAA,MAAM,EAAC,UAAQ,GAAI,eAAA;AAGnB,EAAA,uBACI,GAAA;AAAA,IAACA,SAAA;AAAA,IAAA;AAAA,MAEI,GAAG,KAAA;AAAA,MAEJ,QAAA,EAAU,CAAC,OAAA,EAAS,KAAA,KAAQ;AACxB,QAAA,KAAA,CAAM,QAAA,CAAS;AAAA,UACX,MAAA,EAAO;AAAA,YACH,OAAM,KAAA,CAAM;AAAA;AAChB,SACH,CAAA;AAAA,MACL,CAAA;AAAA,MAEA,IAAI,KAAA,CAAM,IAAA;AAAA,MACV,KAAA;AAAA,MACA,SAAA;AAAA,MACA,QAAA,EAAU,UAAA;AAAA,MACV,QAAA,EAAU,UAAA;AAAA,MACV,SAAS,UAAA,CAAW,OAAA;AAAA,MACpB,MAAA,EAAQ,WAAW,KAAA,EAAO,OAAA;AAAA,MAC1B,UAAA;AAAA,MACA,IAAA,EAAM,IAAA;AAAA,MACN,QAAA;AAAA,MACA,cAAA,EAAgB,WAAW,UAAA,GAAa,YAAA;AAAA,MACxC,OAAO,YAAA,EAAc,KAAA;AAAA,MACrB,gBAAgB,YAAA,EAAc,SAAA;AAAA,MAC9B;AAAA;AAAA,GACJ;AAER;;;;"}
@@ -8,6 +8,7 @@ require('react');
8
8
  require('axios');
9
9
  require('../../../../contexts/DialogContext.cjs');
10
10
  require('../../../../contexts/PermissionsContext.cjs');
11
+ require('../../../../contexts/BreadcrumbContext.cjs');
11
12
 
12
13
  const Select = ({
13
14
  element,
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../../../../../../src/form-renderer/components/fields/Select/index.tsx"],"sourcesContent":["import React from 'react';\nimport type {FieldValues} from 'react-hook-form';\nimport type {Shapes, UseFieldLogicElementProps} from \"@lmb-it/kitsconcerto-types\";\nimport {FormSelect} from \"../../../../_compat\";\nimport type {IListItem} from \"@lmb-it/kitsconcerto-types\";\n\nexport const Select = <T extends FieldValues>({\n element,\n control,\n getValues,\n fieldLogic,\n }: UseFieldLogicElementProps<T>) => {\n\n const {\n field,\n fieldState,\n label,\n placeholder,\n isDisabled,\n isRequired,\n helperText,\n watchedValues,\n list,\n attached,\n style: elementStyle,\n slots,\n } = fieldLogic;\n\n // Map form element type → FormSelect shape\n const shapeMap: Record<string, Shapes> = {\n Select: 'dropdown',\n Multiselect: 'multiselect',\n Tags: 'autocomplete',\n ListBox: 'listBox',\n TreeSelect: 'treeSelect',\n };\n\n const shape: Shapes = shapeMap[element.type as keyof typeof shapeMap] || 'dropdown';\n\n const {\n // Common\n labelKey,\n valueKey,\n outputValueKey,\n childrenKey,\n withFilter,\n filterBy,\n virtualScroll,\n showClear,\n popup,\n // Specific\n withArrow,\n isMultiple,\n forceSelection,\n completeMethod,\n valueMode,\n selectionLimit,\n hideError,\n // TreeSelect specific\n onlyParentsWithChildren,\n isStructured,\n } = element as any;\n\n // No key regeneration needed here.\n // SelectContext already handles list changes reactively via its own useEffect([list]).\n // All underlying components (Dropdown, AutoComplete, etc.) react to prop changes natively.\n // A key change would force a full remount — destroying focus state and any user interaction.\n\n return (\n <FormSelect\n {...field}\n id={field.name}\n shape={shape}\n label={label}\n placeholder={placeholder}\n disabled={isDisabled}\n required={isRequired}\n invalid={fieldState.invalid}\n errors={fieldState.error?.message}\n helperText={helperText}\n list={list as IListItem[]}\n hideError={hideError}\n attached={attached}\n style={elementStyle?.input}\n containerStyle={elementStyle?.container}\n slots={slots}\n labelKey={labelKey}\n valueKey={valueKey}\n outputValueKey={outputValueKey}\n childrenKey={childrenKey}\n withFilter={withFilter}\n filterBy={filterBy}\n virtualScroll={virtualScroll}\n showClear={showClear}\n /* ⛔ A PROP IS ONLY AS GOOD AS ITS NARROWEST GATE. This renderer\n forwards a NAMED list, not a spread, so a select prop that is not\n listed here never reaches the component however correct the rest\n of the chain is. `popup` was added to the type, the wrapper and\n the native component and still did nothing, because of this line's\n absence. */\n popup={popup}\n withArrow={withArrow}\n isMultiple={isMultiple}\n forceSelection={forceSelection}\n completeMethod={completeMethod}\n valueMode={valueMode}\n selectionLimit={selectionLimit}\n onlyParentsWithChildren={onlyParentsWithChildren}\n isStructured={isStructured}\n />\n );\n};\n\nexport default Select;\n"],"names":["jsx","FormSelect"],"mappings":";;;;;;;;;;;AAMO,MAAM,SAAS,CAAwB;AAAA,EACI,OAAA;AAAA,EACA,OAAA;AAAA,EACA,SAAA;AAAA,EACA;AACJ,CAAA,KAAoC;AAE9E,EAAA,MAAM;AAAA,IACF,KAAA;AAAA,IACA,UAAA;AAAA,IACA,KAAA;AAAA,IACA,WAAA;AAAA,IACA,UAAA;AAAA,IACA,UAAA;AAAA,IACA,UAAA;AAAA,IACA,aAAA;AAAA,IACA,IAAA;AAAA,IACA,QAAA;AAAA,IACA,KAAA,EAAO,YAAA;AAAA,IACP;AAAA,GACJ,GAAI,UAAA;AAGJ,EAAA,MAAM,QAAA,GAAmC;AAAA,IACrC,MAAA,EAAQ,UAAA;AAAA,IACR,WAAA,EAAa,aAAA;AAAA,IACb,IAAA,EAAM,cAAA;AAAA,IACN,OAAA,EAAS,SAAA;AAAA,IACT,UAAA,EAAY;AAAA,GAChB;AAEA,EAAA,MAAM,KAAA,GAAgB,QAAA,CAAS,OAAA,CAAQ,IAA6B,CAAA,IAAK,UAAA;AAEzE,EAAA,MAAM;AAAA;AAAA,IAEF,QAAA;AAAA,IACA,QAAA;AAAA,IACA,cAAA;AAAA,IACA,WAAA;AAAA,IACA,UAAA;AAAA,IACA,QAAA;AAAA,IACA,aAAA;AAAA,IACA,SAAA;AAAA,IACA,KAAA;AAAA;AAAA,IAEA,SAAA;AAAA,IACA,UAAA;AAAA,IACA,cAAA;AAAA,IACA,cAAA;AAAA,IACA,SAAA;AAAA,IACA,cAAA;AAAA,IACA,SAAA;AAAA;AAAA,IAEA,uBAAA;AAAA,IACA;AAAA,GACJ,GAAI,OAAA;AAOJ,EAAA,uBACIA,cAAA;AAAA,IAACC,qBAAA;AAAA,IAAA;AAAA,MACI,GAAG,KAAA;AAAA,MACJ,IAAI,KAAA,CAAM,IAAA;AAAA,MACV,KAAA;AAAA,MACA,KAAA;AAAA,MACA,WAAA;AAAA,MACA,QAAA,EAAU,UAAA;AAAA,MACV,QAAA,EAAU,UAAA;AAAA,MACV,SAAS,UAAA,CAAW,OAAA;AAAA,MACpB,MAAA,EAAQ,WAAW,KAAA,EAAO,OAAA;AAAA,MAC1B,UAAA;AAAA,MACA,IAAA;AAAA,MACA,SAAA;AAAA,MACA,QAAA;AAAA,MACA,OAAO,YAAA,EAAc,KAAA;AAAA,MACrB,gBAAgB,YAAA,EAAc,SAAA;AAAA,MAC9B,KAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAA;AAAA,MACA,cAAA;AAAA,MACA,WAAA;AAAA,MACA,UAAA;AAAA,MACA,QAAA;AAAA,MACA,aAAA;AAAA,MACA,SAAA;AAAA,MAOA,KAAA;AAAA,MACA,SAAA;AAAA,MACA,UAAA;AAAA,MACA,cAAA;AAAA,MACA,cAAA;AAAA,MACA,SAAA;AAAA,MACA,cAAA;AAAA,MACA,uBAAA;AAAA,MACA;AAAA;AAAA,GACJ;AAER;;;;;"}
1
+ {"version":3,"file":"index.cjs","sources":["../../../../../../src/form-renderer/components/fields/Select/index.tsx"],"sourcesContent":["import React from 'react';\nimport type {FieldValues} from 'react-hook-form';\nimport type {Shapes, UseFieldLogicElementProps} from \"@lmb-it/kitsconcerto-types\";\nimport {FormSelect} from \"../../../../_compat\";\nimport type {IListItem} from \"@lmb-it/kitsconcerto-types\";\n\nexport const Select = <T extends FieldValues>({\n element,\n control,\n getValues,\n fieldLogic,\n }: UseFieldLogicElementProps<T>) => {\n\n const {\n field,\n fieldState,\n label,\n placeholder,\n isDisabled,\n isRequired,\n helperText,\n watchedValues,\n list,\n attached,\n style: elementStyle,\n slots,\n } = fieldLogic;\n\n // Map form element type → FormSelect shape\n const shapeMap: Record<string, Shapes> = {\n Select: 'dropdown',\n Multiselect: 'multiselect',\n Tags: 'autocomplete',\n ListBox: 'listBox',\n TreeSelect: 'treeSelect',\n };\n\n const shape: Shapes = shapeMap[element.type as keyof typeof shapeMap] || 'dropdown';\n\n const {\n // Common\n labelKey,\n valueKey,\n outputValueKey,\n childrenKey,\n withFilter,\n filterBy,\n virtualScroll,\n showClear,\n popup,\n // Specific\n withArrow,\n isMultiple,\n forceSelection,\n completeMethod,\n valueMode,\n selectionLimit,\n hideError,\n // TreeSelect specific\n onlyParentsWithChildren,\n isStructured,\n } = element as any;\n\n // No key regeneration needed here.\n // SelectContext already handles list changes reactively via its own useEffect([list]).\n // All underlying components (Dropdown, AutoComplete, etc.) react to prop changes natively.\n // A key change would force a full remount — destroying focus state and any user interaction.\n\n return (\n <FormSelect\n {...field}\n id={field.name}\n shape={shape}\n label={label}\n placeholder={placeholder}\n disabled={isDisabled}\n required={isRequired}\n invalid={fieldState.invalid}\n errors={fieldState.error?.message}\n helperText={helperText}\n list={list as IListItem[]}\n hideError={hideError}\n attached={attached}\n style={elementStyle?.input}\n containerStyle={elementStyle?.container}\n slots={slots}\n labelKey={labelKey}\n valueKey={valueKey}\n outputValueKey={outputValueKey}\n childrenKey={childrenKey}\n withFilter={withFilter}\n filterBy={filterBy}\n virtualScroll={virtualScroll}\n showClear={showClear}\n /* ⛔ A PROP IS ONLY AS GOOD AS ITS NARROWEST GATE. This renderer\n forwards a NAMED list, not a spread, so a select prop that is not\n listed here never reaches the component however correct the rest\n of the chain is. `popup` was added to the type, the wrapper and\n the native component and still did nothing, because of this line's\n absence. */\n popup={popup}\n withArrow={withArrow}\n isMultiple={isMultiple}\n forceSelection={forceSelection}\n completeMethod={completeMethod}\n valueMode={valueMode}\n selectionLimit={selectionLimit}\n onlyParentsWithChildren={onlyParentsWithChildren}\n isStructured={isStructured}\n />\n );\n};\n\nexport default Select;\n"],"names":["jsx","FormSelect"],"mappings":";;;;;;;;;;;;AAMO,MAAM,SAAS,CAAwB;AAAA,EACI,OAAA;AA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W,KAAA,EAAO,OAAA;AAAA,MAC1B,UAAA;AAAA,MACA,IAAA;AAAA,MACA,SAAA;AAAA,MACA,QAAA;AAAA,MACA,OAAO,YAAA,EAAc,KAAA;AAAA,MACrB,gBAAgB,YAAA,EAAc,SAAA;AAAA,MAC9B,KAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAA;AAAA,MACA,cAAA;AAAA,MACA,WAAA;AAAA,MACA,UAAA;AAAA,MACA,QAAA;AAAA,MACA,aAAA;AAAA,MACA,SAAA;AAAA,MAOA,KAAA;AAAA,MACA,SAAA;AAAA,MACA,UAAA;AAAA,MACA,cAAA;AAAA,MACA,cAAA;AAAA,MACA,SAAA;AAAA,MACA,cAAA;AAAA,MACA,uBAAA;AAAA,MACA;AAAA;AAAA,GACJ;AAER;;;;;"}
@@ -4,6 +4,7 @@ import 'react';
4
4
  import 'axios';
5
5
  import '../../../../contexts/DialogContext.js';
6
6
  import '../../../../contexts/PermissionsContext.js';
7
+ import '../../../../contexts/BreadcrumbContext.js';
7
8
 
8
9
  const Select = ({
9
10
  element,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../../src/form-renderer/components/fields/Select/index.tsx"],"sourcesContent":["import React from 'react';\nimport type {FieldValues} from 'react-hook-form';\nimport type {Shapes, UseFieldLogicElementProps} from \"@lmb-it/kitsconcerto-types\";\nimport {FormSelect} from \"../../../../_compat\";\nimport type {IListItem} from \"@lmb-it/kitsconcerto-types\";\n\nexport const Select = <T extends FieldValues>({\n element,\n control,\n getValues,\n fieldLogic,\n }: UseFieldLogicElementProps<T>) => {\n\n const {\n field,\n fieldState,\n label,\n placeholder,\n isDisabled,\n isRequired,\n helperText,\n watchedValues,\n list,\n attached,\n style: elementStyle,\n slots,\n } = fieldLogic;\n\n // Map form element type → FormSelect shape\n const shapeMap: Record<string, Shapes> = {\n Select: 'dropdown',\n Multiselect: 'multiselect',\n Tags: 'autocomplete',\n ListBox: 'listBox',\n TreeSelect: 'treeSelect',\n };\n\n const shape: Shapes = shapeMap[element.type as keyof typeof shapeMap] || 'dropdown';\n\n const {\n // Common\n labelKey,\n valueKey,\n outputValueKey,\n childrenKey,\n withFilter,\n filterBy,\n virtualScroll,\n showClear,\n popup,\n // Specific\n withArrow,\n isMultiple,\n forceSelection,\n completeMethod,\n valueMode,\n selectionLimit,\n hideError,\n // TreeSelect specific\n onlyParentsWithChildren,\n isStructured,\n } = element as any;\n\n // No key regeneration needed here.\n // SelectContext already handles list changes reactively via its own useEffect([list]).\n // All underlying components (Dropdown, AutoComplete, etc.) react to prop changes natively.\n // A key change would force a full remount — destroying focus state and any user interaction.\n\n return (\n <FormSelect\n {...field}\n id={field.name}\n shape={shape}\n label={label}\n placeholder={placeholder}\n disabled={isDisabled}\n required={isRequired}\n invalid={fieldState.invalid}\n errors={fieldState.error?.message}\n helperText={helperText}\n list={list as IListItem[]}\n hideError={hideError}\n attached={attached}\n style={elementStyle?.input}\n containerStyle={elementStyle?.container}\n slots={slots}\n labelKey={labelKey}\n valueKey={valueKey}\n outputValueKey={outputValueKey}\n childrenKey={childrenKey}\n withFilter={withFilter}\n filterBy={filterBy}\n virtualScroll={virtualScroll}\n showClear={showClear}\n /* ⛔ A PROP IS ONLY AS GOOD AS ITS NARROWEST GATE. This renderer\n forwards a NAMED list, not a spread, so a select prop that is not\n listed here never reaches the component however correct the rest\n of the chain is. `popup` was added to the type, the wrapper and\n the native component and still did nothing, because of this line's\n absence. */\n popup={popup}\n withArrow={withArrow}\n isMultiple={isMultiple}\n forceSelection={forceSelection}\n completeMethod={completeMethod}\n valueMode={valueMode}\n selectionLimit={selectionLimit}\n onlyParentsWithChildren={onlyParentsWithChildren}\n isStructured={isStructured}\n />\n );\n};\n\nexport default Select;\n"],"names":[],"mappings":";;;;;;;AAMO,MAAM,SAAS,CAAwB;AAAA,EACI,OAAA;AAAA,EACA,OAAA;AAAA,EACA,SAAA;AAAA,EACA;AACJ,CAAA,KAAoC;AAE9E,EAAA,MAAM;AAAA,IACF,KAA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ACA,OAAO,YAAA,EAAc,KAAA;AAAA,MACrB,gBAAgB,YAAA,EAAc,SAAA;AAAA,MAC9B,KAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAA;AAAA,MACA,cAAA;AAAA,MACA,WAAA;AAAA,MACA,UAAA;AAAA,MACA,QAAA;AAAA,MACA,aAAA;AAAA,MACA,SAAA;AAAA,MAOA,KAAA;AAAA,MACA,SAAA;AAAA,MACA,UAAA;AAAA,MACA,cAAA;AAAA,MACA,cAAA;AAAA,MACA,SAAA;AAAA,MACA,cAAA;AAAA,MACA,uBAAA;AAAA,MACA;AAAA;AAAA,GACJ;AAER;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../../src/form-renderer/components/fields/Select/index.tsx"],"sourcesContent":["import React from 'react';\nimport type {FieldValues} from 'react-hook-form';\nimport type {Shapes, UseFieldLogicElementProps} from \"@lmb-it/kitsconcerto-types\";\nimport {FormSelect} from \"../../../../_compat\";\nimport type {IListItem} from \"@lmb-it/kitsconcerto-types\";\n\nexport const Select = <T extends FieldValues>({\n element,\n control,\n getValues,\n fieldLogic,\n }: UseFieldLogicElementProps<T>) => {\n\n const {\n field,\n fieldState,\n label,\n placeholder,\n isDisabled,\n isRequired,\n helperText,\n watchedValues,\n list,\n attached,\n style: elementStyle,\n slots,\n } = fieldLogic;\n\n // Map form element type → FormSelect shape\n const shapeMap: Record<string, Shapes> = {\n Select: 'dropdown',\n Multiselect: 'multiselect',\n Tags: 'autocomplete',\n ListBox: 'listBox',\n TreeSelect: 'treeSelect',\n };\n\n const shape: Shapes = shapeMap[element.type as keyof typeof shapeMap] || 'dropdown';\n\n const {\n // Common\n labelKey,\n valueKey,\n outputValueKey,\n childrenKey,\n withFilter,\n filterBy,\n virtualScroll,\n showClear,\n popup,\n // Specific\n withArrow,\n isMultiple,\n forceSelection,\n completeMethod,\n valueMode,\n selectionLimit,\n hideError,\n // TreeSelect specific\n onlyParentsWithChildren,\n isStructured,\n } = element as any;\n\n // No key regeneration needed here.\n // SelectContext already handles list changes reactively via its own useEffect([list]).\n // All underlying components (Dropdown, AutoComplete, etc.) react to prop changes natively.\n // A key change would force a full remount — destroying focus state and any user interaction.\n\n return (\n <FormSelect\n {...field}\n id={field.name}\n shape={shape}\n label={label}\n placeholder={placeholder}\n disabled={isDisabled}\n required={isRequired}\n invalid={fieldState.invalid}\n errors={fieldState.error?.message}\n helperText={helperText}\n list={list as IListItem[]}\n hideError={hideError}\n attached={attached}\n style={elementStyle?.input}\n containerStyle={elementStyle?.container}\n slots={slots}\n labelKey={labelKey}\n valueKey={valueKey}\n outputValueKey={outputValueKey}\n childrenKey={childrenKey}\n withFilter={withFilter}\n filterBy={filterBy}\n virtualScroll={virtualScroll}\n showClear={showClear}\n /* ⛔ A PROP IS ONLY AS GOOD AS ITS NARROWEST GATE. This renderer\n forwards a NAMED list, not a spread, so a select prop that is not\n listed here never reaches the component however correct the rest\n of the chain is. `popup` was added to the type, the wrapper and\n the native component and still did nothing, because of this line's\n absence. */\n popup={popup}\n withArrow={withArrow}\n isMultiple={isMultiple}\n forceSelection={forceSelection}\n completeMethod={completeMethod}\n valueMode={valueMode}\n selectionLimit={selectionLimit}\n onlyParentsWithChildren={onlyParentsWithChildren}\n isStructured={isStructured}\n />\n );\n};\n\nexport default Select;\n"],"names":[],"mappings":";;;;;;;;AAMO,MAAM,SAAS,CAAwB;AAAA,EACI,OAAA;AAAA,EACA,OAAA;AAAA,EACA,SAAA;AAAA,EACA;AACJ,CAAA,KAAoC;AAE9E,EAAA,MAAM;AAAA,IACF,KAAA;AAAA,IACA,UAAA;AAAA,IACA,KAAA;AAAA,IACA,WAAA;AAAA,IACA,UAAA;AAAA,IACA,UAAA;AAAA,IACA,UAAA;AAAA,IACA,aAAA;AAAA,IACA,IAAA;AAAA,IACA,QAAA;AAAA,IACA,KAAA,EAAO,YAAA;AAAA,IACP;AAAA,GACJ,GAAI,UAAA;AAGJ,EAAA,MAAM,QAAA,GAAmC;AAAA,IACrC,MAAA,EAAQ,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A,MACA,cAAA;AAAA,MACA,cAAA;AAAA,MACA,SAAA;AAAA,MACA,cAAA;AAAA,MACA,uBAAA;AAAA,MACA;AAAA;AAAA,GACJ;AAER;;;;"}
package/hooks/main.cjs CHANGED
@@ -4,6 +4,7 @@ var React = require('react');
4
4
  var index_native = require('../contexts/Main/index.cjs');
5
5
  require('../contexts/DialogContext.cjs');
6
6
  require('../contexts/PermissionsContext.cjs');
7
+ require('../contexts/BreadcrumbContext.cjs');
7
8
 
8
9
  const useKitsConcerto = () => React.useContext(index_native.MainContext);
9
10
 
@@ -1 +1 @@
1
- {"version":3,"file":"main.cjs","sources":["../../../src/hooks/main.ts"],"sourcesContent":["import {useContext} from \"react\";\nimport {MainContext} from \"../contexts\";\n\nexport const useKitsConcerto = () => useContext(MainContext);\n"],"names":["useContext","MainContext"],"mappings":";;;;;;;AAGO,MAAM,eAAA,GAAkB,MAAMA,gBAAA,CAAWC,wBAAW;;;;"}
1
+ {"version":3,"file":"main.cjs","sources":["../../../src/hooks/main.ts"],"sourcesContent":["import {useContext} from \"react\";\nimport {MainContext} from \"../contexts\";\n\nexport const useKitsConcerto = () => useContext(MainContext);\n"],"names":["useContext","MainContext"],"mappings":";;;;;;;;AAGO,MAAM,eAAA,GAAkB,MAAMA,gBAAA,CAAWC,wBAAW;;;;"}
package/hooks/main.js CHANGED
@@ -2,6 +2,7 @@ import { useContext } from 'react';
2
2
  import { MainContext } from '../contexts/Main/index.js';
3
3
  import '../contexts/DialogContext.js';
4
4
  import '../contexts/PermissionsContext.js';
5
+ import '../contexts/BreadcrumbContext.js';
5
6
 
6
7
  const useKitsConcerto = () => useContext(MainContext);
7
8
 
package/hooks/main.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"main.js","sources":["../../../src/hooks/main.ts"],"sourcesContent":["import {useContext} from \"react\";\nimport {MainContext} from \"../contexts\";\n\nexport const useKitsConcerto = () => useContext(MainContext);\n"],"names":[],"mappings":";;;;;AAGO,MAAM,eAAA,GAAkB,MAAM,UAAA,CAAW,WAAW;;;;"}
1
+ {"version":3,"file":"main.js","sources":["../../../src/hooks/main.ts"],"sourcesContent":["import {useContext} from \"react\";\nimport {MainContext} from \"../contexts\";\n\nexport const useKitsConcerto = () => useContext(MainContext);\n"],"names":[],"mappings":";;;;;;AAGO,MAAM,eAAA,GAAkB,MAAM,UAAA,CAAW,WAAW;;;;"}
@@ -0,0 +1,21 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var React = require('react');
6
+ var BreadcrumbContext = require('../contexts/BreadcrumbContext.cjs');
7
+
8
+ function useBreadcrumbTrail(crumbs) {
9
+ const { setTrailingCrumbs } = BreadcrumbContext.useBreadcrumb();
10
+ const signature = JSON.stringify(
11
+ (crumbs ?? []).map((c) => [c.label, c.url ?? null])
12
+ );
13
+ React.useEffect(() => {
14
+ setTrailingCrumbs(crumbs ?? null);
15
+ return () => setTrailingCrumbs(null);
16
+ }, [signature, setTrailingCrumbs]);
17
+ }
18
+
19
+ exports.default = useBreadcrumbTrail;
20
+ exports.useBreadcrumbTrail = useBreadcrumbTrail;
21
+ //# sourceMappingURL=useBreadcrumbTrail.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useBreadcrumbTrail.cjs","sources":["../../../src/hooks/useBreadcrumbTrail.ts"],"sourcesContent":["import {useEffect} from 'react';\nimport type {IBreadcrumbCrumb} from '@lmb-it/kitsconcerto-types';\nimport {useBreadcrumb} from '../contexts/BreadcrumbContext';\n\n/**\n * Names, in the app breadcrumb, the record this page has open — and takes the\n * name back down when the page goes away.\n *\n * ```tsx\n * useBreadcrumbTrail(doc ? [{label: doc.label}] : null);\n * ```\n *\n * A crumb with no `url` renders as plain text, which is what the record a\n * person is already looking at should be.\n *\n * ⛔ THE CLEANUP IS THE POINT OF THE HOOK. Setting the trail is one line and a\n * page could do it inline; forgetting to clear it is invisible, because the\n * stale label keeps rendering on the NEXT screen and reads as a correct\n * breadcrumb for the wrong page. The provider sits above the routed content,\n * so nothing else unmounts it.\n *\n * ⚠️ THE ARGUMENT IS COMPARED BY ITS CONTENT, NOT BY IDENTITY. A page that\n * builds the array inline — which is the obvious way to call this — produces a\n * new array every render, and depending on the reference would set state on\n * every one of them and spin. The serialisation below is the dependency, so an\n * unchanged label is an unchanged dependency.\n *\n * ⚠️ AND IT IS `JSON.stringify`, NOT A JOIN ON SEPARATORS. A draft joined on\n * `\\u0000`/`\\u0001`, which two different arrays can collide on if a label ever\n * contains one of them (Codex, on review) — a collision means the breadcrumb\n * silently keeps the previous name. Unlikely in a UI label is not the same as\n * impossible, and the sound version costs nothing.\n */\nexport function useBreadcrumbTrail(crumbs: IBreadcrumbCrumb[] | null | undefined) {\n const {setTrailingCrumbs} = useBreadcrumb();\n\n const signature = JSON.stringify(\n (crumbs ?? []).map((c) => [c.label, c.url ?? null]),\n );\n\n useEffect(() => {\n setTrailingCrumbs(crumbs ?? null);\n return () => setTrailingCrumbs(null);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [signature, setTrailingCrumbs]);\n}\n\nexport default useBreadcrumbTrail;\n"],"names":["useBreadcrumb","useEffect"],"mappings":";;;;;;;AAiCO,SAAS,mBAAmB,MAAA,EAA+C;AAC9E,EAAA,MAAM,EAAC,iBAAA,EAAiB,GAAIA,+BAAA,EAAc;AAE1C,EAAA,MAAM,YAAY,IAAA,CAAK,SAAA;AAAA,IAAA,CAClB,MAAA,IAAU,EAAC,EAAG,GAAA,CAAI,CAAC,CAAA,KAAM,CAAC,CAAA,CAAE,KAAA,EAAO,CAAA,CAAE,GAAA,IAAO,IAAI,CAAC;AAAA,GACtD;AAEA,EAAAC,eAAA,CAAU,MAAM;AACZ,IAAA,iBAAA,CAAkB,UAAU,IAAI,CAAA;AAChC,IAAA,OAAO,MAAM,kBAAkB,IAAI,CAAA;AAAA,EAEvC,CAAA,EAAG,CAAC,SAAA,EAAW,iBAAiB,CAAC,CAAA;AACrC;;;;;"}
@@ -0,0 +1,16 @@
1
+ import { useEffect } from 'react';
2
+ import { useBreadcrumb } from '../contexts/BreadcrumbContext.js';
3
+
4
+ function useBreadcrumbTrail(crumbs) {
5
+ const { setTrailingCrumbs } = useBreadcrumb();
6
+ const signature = JSON.stringify(
7
+ (crumbs ?? []).map((c) => [c.label, c.url ?? null])
8
+ );
9
+ useEffect(() => {
10
+ setTrailingCrumbs(crumbs ?? null);
11
+ return () => setTrailingCrumbs(null);
12
+ }, [signature, setTrailingCrumbs]);
13
+ }
14
+
15
+ export { useBreadcrumbTrail as default, useBreadcrumbTrail };
16
+ //# sourceMappingURL=useBreadcrumbTrail.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useBreadcrumbTrail.js","sources":["../../../src/hooks/useBreadcrumbTrail.ts"],"sourcesContent":["import {useEffect} from 'react';\nimport type {IBreadcrumbCrumb} from '@lmb-it/kitsconcerto-types';\nimport {useBreadcrumb} from '../contexts/BreadcrumbContext';\n\n/**\n * Names, in the app breadcrumb, the record this page has open — and takes the\n * name back down when the page goes away.\n *\n * ```tsx\n * useBreadcrumbTrail(doc ? [{label: doc.label}] : null);\n * ```\n *\n * A crumb with no `url` renders as plain text, which is what the record a\n * person is already looking at should be.\n *\n * ⛔ THE CLEANUP IS THE POINT OF THE HOOK. Setting the trail is one line and a\n * page could do it inline; forgetting to clear it is invisible, because the\n * stale label keeps rendering on the NEXT screen and reads as a correct\n * breadcrumb for the wrong page. The provider sits above the routed content,\n * so nothing else unmounts it.\n *\n * ⚠️ THE ARGUMENT IS COMPARED BY ITS CONTENT, NOT BY IDENTITY. A page that\n * builds the array inline — which is the obvious way to call this — produces a\n * new array every render, and depending on the reference would set state on\n * every one of them and spin. The serialisation below is the dependency, so an\n * unchanged label is an unchanged dependency.\n *\n * ⚠️ AND IT IS `JSON.stringify`, NOT A JOIN ON SEPARATORS. A draft joined on\n * `\\u0000`/`\\u0001`, which two different arrays can collide on if a label ever\n * contains one of them (Codex, on review) — a collision means the breadcrumb\n * silently keeps the previous name. Unlikely in a UI label is not the same as\n * impossible, and the sound version costs nothing.\n */\nexport function useBreadcrumbTrail(crumbs: IBreadcrumbCrumb[] | null | undefined) {\n const {setTrailingCrumbs} = useBreadcrumb();\n\n const signature = JSON.stringify(\n (crumbs ?? []).map((c) => [c.label, c.url ?? null]),\n );\n\n useEffect(() => {\n setTrailingCrumbs(crumbs ?? null);\n return () => setTrailingCrumbs(null);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [signature, setTrailingCrumbs]);\n}\n\nexport default useBreadcrumbTrail;\n"],"names":[],"mappings":";;;AAiCO,SAAS,mBAAmB,MAAA,EAA+C;AAC9E,EAAA,MAAM,EAAC,iBAAA,EAAiB,GAAI,aAAA,EAAc;AAE1C,EAAA,MAAM,YAAY,IAAA,CAAK,SAAA;AAAA,IAAA,CAClB,MAAA,IAAU,EAAC,EAAG,GAAA,CAAI,CAAC,CAAA,KAAM,CAAC,CAAA,CAAE,KAAA,EAAO,CAAA,CAAE,GAAA,IAAO,IAAI,CAAC;AAAA,GACtD;AAEA,EAAA,SAAA,CAAU,MAAM;AACZ,IAAA,iBAAA,CAAkB,UAAU,IAAI,CAAA;AAChC,IAAA,OAAO,MAAM,kBAAkB,IAAI,CAAA;AAAA,EAEvC,CAAA,EAAG,CAAC,SAAA,EAAW,iBAAiB,CAAC,CAAA;AACrC;;;;"}