guestbell-forms 3.0.18 → 3.0.20

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 (200) hide show
  1. package/.babelrc.js +1 -1
  2. package/build/components/base/input/BaseInput.js +8 -96
  3. package/build/components/base/input/BaseInput.js.map +1 -1
  4. package/build/components/base/input/index.js +0 -2
  5. package/build/components/base/input/index.js.map +1 -1
  6. package/build/components/bookingCalendar/BookingCalendar.d.ts +1 -0
  7. package/build/components/bookingCalendar/BookingCalendar.js +10 -32
  8. package/build/components/bookingCalendar/BookingCalendar.js.map +1 -1
  9. package/build/components/bookingCalendar/bookingCalendarControls/BookingCalendarControls.js +2 -22
  10. package/build/components/bookingCalendar/bookingCalendarControls/BookingCalendarControls.js.map +1 -1
  11. package/build/components/bookingCalendar/bookingCalendarControls/classes.js.map +1 -1
  12. package/build/components/bookingCalendar/bookingCalendarControls/index.js +0 -4
  13. package/build/components/bookingCalendar/bookingCalendarControls/index.js.map +1 -1
  14. package/build/components/bookingCalendar/bookingCalendarDatePicker/BookingCalendarDatePicker.js +6 -19
  15. package/build/components/bookingCalendar/bookingCalendarDatePicker/BookingCalendarDatePicker.js.map +1 -1
  16. package/build/components/bookingCalendar/bookingCalendarDatePicker/classes.js.map +1 -1
  17. package/build/components/bookingCalendar/bookingCalendarDatePicker/index.js +0 -4
  18. package/build/components/bookingCalendar/bookingCalendarDatePicker/index.js.map +1 -1
  19. package/build/components/bookingCalendar/bookingCalendarGrid/BookingCalendarGrid.d.ts +2 -1
  20. package/build/components/bookingCalendar/bookingCalendarGrid/BookingCalendarGrid.js +11 -10
  21. package/build/components/bookingCalendar/bookingCalendarGrid/BookingCalendarGrid.js.map +1 -1
  22. package/build/components/bookingCalendar/bookingCalendarGrid/classes.js.map +1 -1
  23. package/build/components/bookingCalendar/bookingCalendarItem/BookingCalendarItem.js +0 -9
  24. package/build/components/bookingCalendar/bookingCalendarItem/BookingCalendarItem.js.map +1 -1
  25. package/build/components/bookingCalendar/bookingCalendarItem/classes.js.map +1 -1
  26. package/build/components/bookingCalendar/bookingCalendarItem/index.js +0 -4
  27. package/build/components/bookingCalendar/bookingCalendarItem/index.js.map +1 -1
  28. package/build/components/bookingCalendar/bookingCalendarLane/BookingCalendarLane.js +0 -10
  29. package/build/components/bookingCalendar/bookingCalendarLane/BookingCalendarLane.js.map +1 -1
  30. package/build/components/bookingCalendar/bookingCalendarLane/classes.js.map +1 -1
  31. package/build/components/bookingCalendar/bookingCalendarLane/index.js +0 -4
  32. package/build/components/bookingCalendar/bookingCalendarLane/index.js.map +1 -1
  33. package/build/components/bookingCalendar/bookingCalendarLaneHeader/BookingCalendarLaneHeader.js +0 -7
  34. package/build/components/bookingCalendar/bookingCalendarLaneHeader/BookingCalendarLaneHeader.js.map +1 -1
  35. package/build/components/bookingCalendar/bookingCalendarLaneHeader/classes.js.map +1 -1
  36. package/build/components/bookingCalendar/bookingCalendarLaneHeader/index.js +0 -2
  37. package/build/components/bookingCalendar/bookingCalendarLaneHeader/index.js.map +1 -1
  38. package/build/components/bookingCalendar/bookingCalendarLanesHeader/BookingCalendarLanesHeader.js +0 -12
  39. package/build/components/bookingCalendar/bookingCalendarLanesHeader/BookingCalendarLanesHeader.js.map +1 -1
  40. package/build/components/bookingCalendar/bookingCalendarLanesHeader/BookingCalendarLanesHeaderRenderItem.js +0 -9
  41. package/build/components/bookingCalendar/bookingCalendarLanesHeader/BookingCalendarLanesHeaderRenderItem.js.map +1 -1
  42. package/build/components/bookingCalendar/bookingCalendarLanesHeader/classes.js.map +1 -1
  43. package/build/components/bookingCalendar/bookingCalendarLanesHeader/index.js +0 -4
  44. package/build/components/bookingCalendar/bookingCalendarLanesHeader/index.js.map +1 -1
  45. package/build/components/bookingCalendar/bookingCalendarRenderItem/BookingCalendarRenderItem.js +0 -9
  46. package/build/components/bookingCalendar/bookingCalendarRenderItem/BookingCalendarRenderItem.js.map +1 -1
  47. package/build/components/bookingCalendar/bookingCalendarRenderItem/classes.js.map +1 -1
  48. package/build/components/bookingCalendar/bookingCalendarRenderItem/index.js +0 -2
  49. package/build/components/bookingCalendar/bookingCalendarRenderItem/index.js.map +1 -1
  50. package/build/components/bookingCalendar/bookingCalendarSelection/BookingCalendarSelection.js +0 -30
  51. package/build/components/bookingCalendar/bookingCalendarSelection/BookingCalendarSelection.js.map +1 -1
  52. package/build/components/bookingCalendar/bookingCalendarTimeAxis/BookingCalendarTimeAxis.js +0 -7
  53. package/build/components/bookingCalendar/bookingCalendarTimeAxis/BookingCalendarTimeAxis.js.map +1 -1
  54. package/build/components/bookingCalendar/bookingCalendarTimeAxis/classes.js.map +1 -1
  55. package/build/components/bookingCalendar/classes.js.map +1 -1
  56. package/build/components/bookingCalendar/common.js +0 -9
  57. package/build/components/bookingCalendar/common.js.map +1 -1
  58. package/build/components/bookingCalendar/index.js +0 -6
  59. package/build/components/bookingCalendar/index.js.map +1 -1
  60. package/build/components/bookingCalendar/utils.js +5 -50
  61. package/build/components/bookingCalendar/utils.js.map +1 -1
  62. package/build/components/button/Button.js +9 -37
  63. package/build/components/button/Button.js.map +1 -1
  64. package/build/components/button/index.js +0 -4
  65. package/build/components/button/index.js.map +1 -1
  66. package/build/components/checkbox/Checkbox.js +5 -35
  67. package/build/components/checkbox/Checkbox.js.map +1 -1
  68. package/build/components/checkbox/index.js +0 -4
  69. package/build/components/checkbox/index.js.map +1 -1
  70. package/build/components/dropdown/Dropdown.js +1 -15
  71. package/build/components/dropdown/Dropdown.js.map +1 -1
  72. package/build/components/dropdown/index.js +0 -4
  73. package/build/components/dropdown/index.js.map +1 -1
  74. package/build/components/dynamicSubmit/DynamicSubmit.js +7 -39
  75. package/build/components/dynamicSubmit/DynamicSubmit.js.map +1 -1
  76. package/build/components/dynamicSubmit/index.js +0 -4
  77. package/build/components/dynamicSubmit/index.js.map +1 -1
  78. package/build/components/externalValidationComponent/ExternalValidationComponent.js +6 -17
  79. package/build/components/externalValidationComponent/ExternalValidationComponent.js.map +1 -1
  80. package/build/components/externalValidationComponent/index.js +0 -4
  81. package/build/components/externalValidationComponent/index.js.map +1 -1
  82. package/build/components/form/Form.js +8 -46
  83. package/build/components/form/Form.js.map +1 -1
  84. package/build/components/form/FormContext.js +0 -4
  85. package/build/components/form/FormContext.js.map +1 -1
  86. package/build/components/form/FormValidationSummary.js +3 -25
  87. package/build/components/form/FormValidationSummary.js.map +1 -1
  88. package/build/components/form/index.js +0 -10
  89. package/build/components/form/index.js.map +1 -1
  90. package/build/components/form/withFormContext.js +0 -6
  91. package/build/components/form/withFormContext.js.map +1 -1
  92. package/build/components/inputGroup/InputGroup.js +5 -15
  93. package/build/components/inputGroup/InputGroup.js.map +1 -1
  94. package/build/components/inputGroup/index.js +0 -4
  95. package/build/components/inputGroup/index.js.map +1 -1
  96. package/build/components/inputHeader/InputHeader.js +16 -75
  97. package/build/components/inputHeader/InputHeader.js.map +1 -1
  98. package/build/components/inputHeader/InputHeaderContext.js +0 -4
  99. package/build/components/inputHeader/InputHeaderContext.js.map +1 -1
  100. package/build/components/inputHeader/index.js +0 -4
  101. package/build/components/inputHeader/index.js.map +1 -1
  102. package/build/components/inputHeader/withInputHeaderContext.js +0 -6
  103. package/build/components/inputHeader/withInputHeaderContext.js.map +1 -1
  104. package/build/components/money/Money.js +20 -64
  105. package/build/components/money/Money.js.map +1 -1
  106. package/build/components/money/index.js +0 -4
  107. package/build/components/money/index.js.map +1 -1
  108. package/build/components/numberInput/NumberInput.js +13 -44
  109. package/build/components/numberInput/NumberInput.js.map +1 -1
  110. package/build/components/numberInput/index.js +0 -4
  111. package/build/components/numberInput/index.js.map +1 -1
  112. package/build/components/openingHours/openingHoursDay/OpeningHoursDay.js +13 -62
  113. package/build/components/openingHours/openingHoursDay/OpeningHoursDay.js.map +1 -1
  114. package/build/components/openingHours/openingHoursDay/index.js +0 -4
  115. package/build/components/openingHours/openingHoursDay/index.js.map +1 -1
  116. package/build/components/openingHours/openingHoursSpecial/OpeningHoursSpecial.js +18 -49
  117. package/build/components/openingHours/openingHoursSpecial/OpeningHoursSpecial.js.map +1 -1
  118. package/build/components/openingHours/openingHoursSpecial/index.js +0 -4
  119. package/build/components/openingHours/openingHoursSpecial/index.js.map +1 -1
  120. package/build/components/openingHours/openingHoursWeek/OpeningHoursWeek.js +16 -53
  121. package/build/components/openingHours/openingHoursWeek/OpeningHoursWeek.js.map +1 -1
  122. package/build/components/openingHours/openingHoursWeek/index.js +0 -4
  123. package/build/components/openingHours/openingHoursWeek/index.js.map +1 -1
  124. package/build/components/openingHours/utils/OpeningHoursUtil.js +3 -21
  125. package/build/components/openingHours/utils/OpeningHoursUtil.js.map +1 -1
  126. package/build/components/radio/Radio.js +4 -19
  127. package/build/components/radio/Radio.js.map +1 -1
  128. package/build/components/radio/index.js +0 -4
  129. package/build/components/radio/index.js.map +1 -1
  130. package/build/components/radioContainer/RadioContainer.js +2 -13
  131. package/build/components/radioContainer/RadioContainer.js.map +1 -1
  132. package/build/components/radioContainer/index.js +0 -4
  133. package/build/components/radioContainer/index.js.map +1 -1
  134. package/build/components/select/Select.js +6 -53
  135. package/build/components/select/Select.js.map +1 -1
  136. package/build/components/select/index.js +0 -4
  137. package/build/components/select/index.js.map +1 -1
  138. package/build/components/submit/Submit.js +5 -28
  139. package/build/components/submit/Submit.js.map +1 -1
  140. package/build/components/submit/index.js +0 -4
  141. package/build/components/submit/index.js.map +1 -1
  142. package/build/components/submit/subComponents/SubmitValidationSummary.js +0 -9
  143. package/build/components/submit/subComponents/SubmitValidationSummary.js.map +1 -1
  144. package/build/components/tags/Tags.js +34 -119
  145. package/build/components/tags/Tags.js.map +1 -1
  146. package/build/components/tags/index.js +0 -4
  147. package/build/components/tags/index.js.map +1 -1
  148. package/build/components/tags/subComponents/TagsSuggestions.js +0 -14
  149. package/build/components/tags/subComponents/TagsSuggestions.js.map +1 -1
  150. package/build/components/text/Text.js +10 -42
  151. package/build/components/text/Text.js.map +1 -1
  152. package/build/components/text/index.js +0 -4
  153. package/build/components/text/index.js.map +1 -1
  154. package/build/components/textArea/TextArea.js +8 -31
  155. package/build/components/textArea/TextArea.js.map +1 -1
  156. package/build/components/textArea/index.js +0 -4
  157. package/build/components/textArea/index.js.map +1 -1
  158. package/build/components/themeProvider/ThemeContext.js +0 -4
  159. package/build/components/themeProvider/ThemeContext.js.map +1 -1
  160. package/build/components/themeProvider/ThemeProvider.js +2 -6
  161. package/build/components/themeProvider/ThemeProvider.js.map +1 -1
  162. package/build/components/themeProvider/index.js +0 -8
  163. package/build/components/themeProvider/index.js.map +1 -1
  164. package/build/components/themeProvider/withThemeContext.js +0 -8
  165. package/build/components/themeProvider/withThemeContext.js.map +1 -1
  166. package/build/components/time/Time.js +17 -73
  167. package/build/components/time/Time.js.map +1 -1
  168. package/build/components/time/index.js +0 -4
  169. package/build/components/time/index.js.map +1 -1
  170. package/build/components/timeSpan/TimeSpan.js +17 -99
  171. package/build/components/timeSpan/TimeSpan.js.map +1 -1
  172. package/build/components/timeSpan/index.js +0 -4
  173. package/build/components/timeSpan/index.js.map +1 -1
  174. package/build/components/utils/Guid.js +0 -3
  175. package/build/components/utils/Guid.js.map +1 -1
  176. package/build/components/utils/ShallowEqual.js +5 -10
  177. package/build/components/utils/ShallowEqual.js.map +1 -1
  178. package/build/components/utils/TimeUtil.js +1 -3
  179. package/build/components/utils/TimeUtil.js.map +1 -1
  180. package/build/dist/guestbell-forms.css.map +1 -1
  181. package/build/dist/guestbell-forms.js +21 -84
  182. package/build/dist/guestbell-forms.js.map +1 -1
  183. package/build/dist/guestbell-forms.min.js +1 -1
  184. package/build/dist/guestbell-forms.min.js.map +1 -1
  185. package/build/dist/report.html +13 -41
  186. package/build/index.js +0 -48
  187. package/build/index.js.map +1 -1
  188. package/build/validators/EmailValidator.js +0 -4
  189. package/build/validators/EmailValidator.js.map +1 -1
  190. package/build/validators/LatitudeValidator.js +0 -8
  191. package/build/validators/LatitudeValidator.js.map +1 -1
  192. package/build/validators/LongitudeValidator.js +0 -8
  193. package/build/validators/LongitudeValidator.js.map +1 -1
  194. package/build/validators/NumberValidator.js +0 -15
  195. package/build/validators/NumberValidator.js.map +1 -1
  196. package/build/validators/UrlValidator.js +2 -5
  197. package/build/validators/UrlValidator.js.map +1 -1
  198. package/build/validators/index.js +0 -7
  199. package/build/validators/index.js.map +1 -1
  200. package/package.json +19 -19
@@ -1 +1 @@
1
- {"version":3,"file":"Form.js","names":["Form","React","PureComponent","constructor","props","e","preventDefault","onSubmit","subscribe","bind","unSubscribe","updateCallback","disableComponents","enableComponents","state","contextState","isFormValid","components","componentDidUpdate","prevProps","prevState","snapshot","componentsWithErrors","Object","keys","map","key","filter","component","validation","isValid","name","console","warn","onValidChanged","extraComponents","forEach","componentApi","disableComponent","enableComponent","touchAll","touch","unTouchAll","unTouch","render","id","className","mergeContext","children","getIsFormValid","componentId","componentState","setState","previousState","assign","initialValid","previousComponent","noValidate","showExpandAll","withThemeContext"],"sources":["../../../src/lib/components/form/Form.tsx"],"sourcesContent":["// Libs\r\nimport * as React from 'react';\r\n\r\n// Misc\r\nimport {\r\n FormContextState,\r\n FormComponentContextState,\r\n FormContextProvider,\r\n ComponentsDict,\r\n} from './FormContext';\r\nimport { withThemeContext } from '../themeProvider/withThemeContext';\r\nimport { ThemeContextProps } from '../themeProvider/ThemeContext';\r\n\r\nexport type FormProps = React.PropsWithChildren<\r\n ThemeContextProps & {\r\n id?: string;\r\n className?: string;\r\n noValidate?: boolean;\r\n onSubmit?: () => void;\r\n extraComponents?: ComponentsDict;\r\n component?: keyof JSX.IntrinsicElements;\r\n onValidChanged?: (\r\n isValid: boolean,\r\n errors?: FormComponentContextState[]\r\n ) => void;\r\n }\r\n>;\r\n\r\nexport interface FormState {\r\n contextState: FormContextState;\r\n}\r\n\r\nexport class Form extends React.PureComponent<FormProps, FormState> {\r\n public static defaultProps = {\r\n noValidate: false,\r\n showExpandAll: true,\r\n component: 'form' as keyof JSX.IntrinsicElements,\r\n };\r\n\r\n constructor(props: FormProps) {\r\n super(props);\r\n this.subscribe = this.subscribe.bind(this);\r\n this.unSubscribe = this.unSubscribe.bind(this);\r\n this.updateCallback = this.updateCallback.bind(this);\r\n this.disableComponents = this.disableComponents.bind(this);\r\n this.enableComponents = this.enableComponents.bind(this);\r\n this.state = {\r\n contextState: {\r\n subscribe: this.subscribe,\r\n unSubscribe: this.unSubscribe,\r\n isFormValid: true,\r\n updateCallback: this.updateCallback,\r\n disableComponents: this.disableComponents,\r\n enableComponents: this.enableComponents,\r\n components: {},\r\n },\r\n };\r\n }\r\n\r\n public componentDidUpdate(\r\n prevProps: Readonly<FormProps>,\r\n prevState: Readonly<FormState>,\r\n snapshot?: any\r\n ): void {\r\n if (\r\n this.state.contextState?.isFormValid !==\r\n prevState?.contextState?.isFormValid\r\n ) {\r\n const componentsWithErrors = this.state.contextState\r\n ? Object.keys(this.state.contextState.components)\r\n .map(key => this.state.contextState.components[key])\r\n .filter(component => {\r\n if (!component.validation.isValid && !component.validation.name) {\r\n console.warn(\r\n component,\r\n 'Has validation error. FormValidationSummary is present but the component has no validation name'\r\n );\r\n }\r\n return !component.validation.isValid;\r\n })\r\n : [];\r\n this.props.onValidChanged?.(\r\n this.state.contextState?.isFormValid,\r\n componentsWithErrors\r\n );\r\n }\r\n }\r\n\r\n public disableComponents() {\r\n const components = {\r\n ...this.state.contextState.components,\r\n ...this.props.extraComponents,\r\n };\r\n Object.keys(components).forEach(key => {\r\n const component = components[key];\r\n component &&\r\n component.componentApi &&\r\n component.componentApi.disableComponent &&\r\n component.componentApi.disableComponent();\r\n });\r\n }\r\n\r\n public enableComponents() {\r\n const components = {\r\n ...this.state.contextState.components,\r\n ...this.props.extraComponents,\r\n };\r\n Object.keys(components).forEach(key => {\r\n const component = components[key];\r\n component &&\r\n component.componentApi &&\r\n component.componentApi.enableComponent &&\r\n component.componentApi.enableComponent();\r\n });\r\n }\r\n\r\n public touchAll() {\r\n const components = {\r\n ...this.state.contextState.components,\r\n ...this.props.extraComponents,\r\n };\r\n Object.keys(components).forEach(key => {\r\n const component = components[key];\r\n component &&\r\n component.componentApi &&\r\n component.componentApi.touch &&\r\n component.componentApi.touch();\r\n });\r\n }\r\n\r\n public unTouchAll() {\r\n const components = {\r\n ...this.state.contextState.components,\r\n ...this.props.extraComponents,\r\n };\r\n Object.keys(components).forEach(key => {\r\n const component = components[key];\r\n component &&\r\n component.componentApi &&\r\n component.componentApi.unTouch &&\r\n component.componentApi.unTouch();\r\n });\r\n }\r\n\r\n public render() {\r\n return (\r\n <this.props.component\r\n {...(this.props.id && { id: this.props.id })}\r\n noValidate={true}\r\n role=\"form\"\r\n className={`input__form validation-form ${\r\n this.props.className ? this.props.className : ''\r\n }`}\r\n onSubmit={this.onSubmit}\r\n >\r\n <FormContextProvider value={this.mergeContext()}>\r\n {this.props.children}\r\n </FormContextProvider>\r\n </this.props.component>\r\n );\r\n }\r\n\r\n private mergeContext(): FormContextState {\r\n if (!this.props.extraComponents) {\r\n return this.state.contextState;\r\n }\r\n const isFormValid =\r\n this.state.contextState.isFormValid &&\r\n this.getIsFormValid(this.props.extraComponents);\r\n return {\r\n ...this.state.contextState,\r\n components: {\r\n ...this.state.contextState.components,\r\n ...this.props.extraComponents,\r\n },\r\n isFormValid,\r\n };\r\n }\r\n\r\n private onSubmit = (e: React.FormEvent) => {\r\n e.preventDefault();\r\n this.props.onSubmit && this.props.onSubmit();\r\n };\r\n\r\n private subscribe(\r\n componentId: string,\r\n componentState: FormComponentContextState\r\n ) {\r\n if (componentId) {\r\n this.setState(previousState => {\r\n let components = Object.assign(\r\n {},\r\n previousState.contextState.components\r\n );\r\n if (componentState) {\r\n components[componentId] = componentState;\r\n }\r\n let isFormValid = this.getIsFormValid(components);\r\n return {\r\n contextState: {\r\n ...previousState.contextState,\r\n components,\r\n isFormValid,\r\n },\r\n };\r\n });\r\n }\r\n }\r\n\r\n private unSubscribe(componentId: string) {\r\n if (componentId) {\r\n this.setState(previousState => {\r\n let components = Object.assign(\r\n {},\r\n previousState.contextState.components\r\n );\r\n delete components[componentId];\r\n let isFormValid = this.getIsFormValid(components);\r\n return {\r\n contextState: {\r\n ...previousState.contextState,\r\n components,\r\n isFormValid,\r\n },\r\n };\r\n });\r\n }\r\n }\r\n\r\n private getIsFormValid(\r\n components: ComponentsDict = this.state.contextState.components,\r\n initialValid: boolean = true\r\n ): boolean {\r\n let isFormValid = initialValid;\r\n Object.keys(components).forEach(key => {\r\n const component = components[key];\r\n if (component && component.validation && !component.validation.isValid) {\r\n isFormValid = false;\r\n }\r\n });\r\n return isFormValid;\r\n }\r\n\r\n private updateCallback(\r\n componentId: string,\r\n componentState: FormComponentContextState\r\n ) {\r\n this.setState(previousState => {\r\n let components = Object.assign({}, previousState.contextState.components);\r\n const previousComponent = components[componentId];\r\n if (componentState && previousComponent) {\r\n components[componentId] = {\r\n ...previousComponent,\r\n ...componentState,\r\n validation: {\r\n ...previousComponent.validation,\r\n ...componentState.validation,\r\n },\r\n };\r\n }\r\n let isFormValid = this.getIsFormValid(components);\r\n return {\r\n contextState: {\r\n ...this.state.contextState,\r\n components,\r\n isFormValid,\r\n },\r\n };\r\n });\r\n }\r\n}\r\n\r\nexport default withThemeContext<FormProps, InstanceType<typeof Form>>(\r\n Form,\r\n 'form'\r\n);\r\n"],"mappings":";;;;;;;AACA;;AAGA;;AAMA;;;;;;;;;;;;;;AAsBO,MAAMA,IAAN,SAAmBC,KAAK,CAACC,aAAzB,CAA6D;EAOlEC,WAAW,CAACC,KAAD,EAAmB;IAC5B,MAAMA,KAAN;;IAD4B,kCA4IVC,CAAD,IAAwB;MACzCA,CAAC,CAACC,cAAF;MACA,KAAKF,KAAL,CAAWG,QAAX,IAAuB,KAAKH,KAAL,CAAWG,QAAX,EAAvB;IACD,CA/I6B;;IAE5B,KAAKC,SAAL,GAAiB,KAAKA,SAAL,CAAeC,IAAf,CAAoB,IAApB,CAAjB;IACA,KAAKC,WAAL,GAAmB,KAAKA,WAAL,CAAiBD,IAAjB,CAAsB,IAAtB,CAAnB;IACA,KAAKE,cAAL,GAAsB,KAAKA,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AAD,CAA5B;;MACA,IAAIE,SAAS,IAAIA,SAAS,CAACC,UAAvB,IAAqC,CAACD,SAAS,CAACC,UAAV,CAAqBC,OAA/D,EAAwE;QACtEd,WAAW,GAAG,KAAd;MACD;IACF,CALD;IAMA,OAAOA,WAAP;EACD;;EAEOL,cAAc,CACpBuC,WADoB,EAEpBC,cAFoB,EAGpB;IACA,KAAKC,QAAL,CAAcC,aAAa,IAAI;MAC7B,IAAIpC,UAAU,GAAGM,MAAM,CAAC+B,MAAP,CAAc,EAAd,EAAkBD,aAAa,CAACtC,YAAd,CAA2BE,UAA7C,CAAjB;MACA,MAAMuC,iBAAiB,GAAGvC,UAAU,CAACiC,WAAD,CAApC;;MACA,IAAIC,cAAc,IAAIK,iBAAtB,EAAyC;QACvCvC,UAAU,CAACiC,WAAD,CAAV,iDACKM,iBADL,GAEKL,cAFL;UAGEtB,UAAU,kCACL2B,iBAAiB,CAAC3B,UADb,GAELsB,cAAc,CAACtB,UAFV;QAHZ;MAQD;;MACD,IAAIb,WAAW,GAAG,KAAKiC,cAAL,CAAoBhC,UAApB,CAAlB;MACA,OAAO;QACLF,YAAY,kCACP,KAAKD,KAAL,CAAWC,YADJ;UAEVE,UAFU;UAGVD;QAHU;MADP,CAAP;IAOD,CArBD;EAsBD;;AA7OiE;;;;gBAAvDhB,I,kBACkB;EAC3ByD,UAAU,EAAE,KADe;EAE3BC,aAAa,EAAE,IAFY;EAG3B9B,SAAS,EAAE;AAHgB,C;;eA+OhB,IAAA+B,kCAAA,EACb3D,IADa,EAEb,MAFa,C"}
1
+ {"version":3,"file":"Form.js","names":["React","_interopRequireWildcard","require","_FormContext","_withThemeContext","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_extends","assign","bind","target","i","arguments","length","source","apply","ownKeys","object","enumerableOnly","keys","getOwnPropertySymbols","symbols","filter","sym","enumerable","push","_objectSpread","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","value","_toPropertyKey","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","TypeError","Number","Form","PureComponent","constructor","props","onSubmit","e","preventDefault","subscribe","unSubscribe","updateCallback","disableComponents","enableComponents","state","contextState","isFormValid","components","componentDidUpdate","prevProps","prevState","snapshot","_this$state$contextSt","_prevState$contextSta","_this$props$onValidCh","_this$props","_this$state$contextSt2","componentsWithErrors","map","component","validation","isValid","name","console","warn","onValidChanged","extraComponents","componentApi","disableComponent","enableComponent","touchAll","touch","unTouchAll","unTouch","render","createElement","id","noValidate","role","className","FormContextProvider","mergeContext","children","getIsFormValid","componentId","componentState","setState","previousState","initialValid","previousComponent","exports","defaultProps","showExpandAll","_default","withThemeContext"],"sources":["../../../src/lib/components/form/Form.tsx"],"sourcesContent":["// Libs\r\nimport * as React from 'react';\r\n\r\n// Misc\r\nimport {\r\n FormContextState,\r\n FormComponentContextState,\r\n FormContextProvider,\r\n ComponentsDict,\r\n} from './FormContext';\r\nimport { withThemeContext } from '../themeProvider/withThemeContext';\r\nimport { ThemeContextProps } from '../themeProvider/ThemeContext';\r\n\r\nexport type FormProps = React.PropsWithChildren<\r\n ThemeContextProps & {\r\n id?: string;\r\n className?: string;\r\n noValidate?: boolean;\r\n onSubmit?: () => void;\r\n extraComponents?: ComponentsDict;\r\n component?: keyof JSX.IntrinsicElements;\r\n onValidChanged?: (\r\n isValid: boolean,\r\n errors?: FormComponentContextState[]\r\n ) => void;\r\n }\r\n>;\r\n\r\nexport interface FormState {\r\n contextState: FormContextState;\r\n}\r\n\r\nexport class Form extends React.PureComponent<FormProps, FormState> {\r\n public static defaultProps = {\r\n noValidate: false,\r\n showExpandAll: true,\r\n component: 'form' as keyof JSX.IntrinsicElements,\r\n };\r\n\r\n constructor(props: FormProps) {\r\n super(props);\r\n this.subscribe = this.subscribe.bind(this);\r\n this.unSubscribe = this.unSubscribe.bind(this);\r\n this.updateCallback = this.updateCallback.bind(this);\r\n this.disableComponents = this.disableComponents.bind(this);\r\n this.enableComponents = this.enableComponents.bind(this);\r\n this.state = {\r\n contextState: {\r\n subscribe: this.subscribe,\r\n unSubscribe: this.unSubscribe,\r\n isFormValid: true,\r\n updateCallback: this.updateCallback,\r\n disableComponents: this.disableComponents,\r\n enableComponents: this.enableComponents,\r\n components: {},\r\n },\r\n };\r\n }\r\n\r\n public componentDidUpdate(\r\n prevProps: Readonly<FormProps>,\r\n prevState: Readonly<FormState>,\r\n snapshot?: any\r\n ): void {\r\n if (\r\n this.state.contextState?.isFormValid !==\r\n prevState?.contextState?.isFormValid\r\n ) {\r\n const componentsWithErrors = this.state.contextState\r\n ? Object.keys(this.state.contextState.components)\r\n .map(key => this.state.contextState.components[key])\r\n .filter(component => {\r\n if (!component.validation.isValid && !component.validation.name) {\r\n console.warn(\r\n component,\r\n 'Has validation error. FormValidationSummary is present but the component has no validation name'\r\n );\r\n }\r\n return !component.validation.isValid;\r\n })\r\n : [];\r\n this.props.onValidChanged?.(\r\n this.state.contextState?.isFormValid,\r\n componentsWithErrors\r\n );\r\n }\r\n }\r\n\r\n public disableComponents() {\r\n const components = {\r\n ...this.state.contextState.components,\r\n ...this.props.extraComponents,\r\n };\r\n Object.keys(components).forEach(key => {\r\n const component = components[key];\r\n component &&\r\n component.componentApi &&\r\n component.componentApi.disableComponent &&\r\n component.componentApi.disableComponent();\r\n });\r\n }\r\n\r\n public enableComponents() {\r\n const components = {\r\n ...this.state.contextState.components,\r\n ...this.props.extraComponents,\r\n };\r\n Object.keys(components).forEach(key => {\r\n const component = components[key];\r\n component &&\r\n component.componentApi &&\r\n component.componentApi.enableComponent &&\r\n component.componentApi.enableComponent();\r\n });\r\n }\r\n\r\n public touchAll() {\r\n const components = {\r\n ...this.state.contextState.components,\r\n ...this.props.extraComponents,\r\n };\r\n Object.keys(components).forEach(key => {\r\n const component = components[key];\r\n component &&\r\n component.componentApi &&\r\n component.componentApi.touch &&\r\n component.componentApi.touch();\r\n });\r\n }\r\n\r\n public unTouchAll() {\r\n const components = {\r\n ...this.state.contextState.components,\r\n ...this.props.extraComponents,\r\n };\r\n Object.keys(components).forEach(key => {\r\n const component = components[key];\r\n component &&\r\n component.componentApi &&\r\n component.componentApi.unTouch &&\r\n component.componentApi.unTouch();\r\n });\r\n }\r\n\r\n public render() {\r\n return (\r\n <this.props.component\r\n {...(this.props.id && { id: this.props.id })}\r\n noValidate={true}\r\n role=\"form\"\r\n className={`input__form validation-form ${\r\n this.props.className ? this.props.className : ''\r\n }`}\r\n onSubmit={this.onSubmit}\r\n >\r\n <FormContextProvider value={this.mergeContext()}>\r\n {this.props.children}\r\n </FormContextProvider>\r\n </this.props.component>\r\n );\r\n }\r\n\r\n private mergeContext(): FormContextState {\r\n if (!this.props.extraComponents) {\r\n return this.state.contextState;\r\n }\r\n const isFormValid =\r\n this.state.contextState.isFormValid &&\r\n this.getIsFormValid(this.props.extraComponents);\r\n return {\r\n ...this.state.contextState,\r\n components: {\r\n ...this.state.contextState.components,\r\n ...this.props.extraComponents,\r\n },\r\n isFormValid,\r\n };\r\n }\r\n\r\n private onSubmit = (e: React.FormEvent) => {\r\n e.preventDefault();\r\n this.props.onSubmit && this.props.onSubmit();\r\n };\r\n\r\n private subscribe(\r\n componentId: string,\r\n componentState: FormComponentContextState\r\n ) {\r\n if (componentId) {\r\n this.setState(previousState => {\r\n let components = Object.assign(\r\n {},\r\n previousState.contextState.components\r\n );\r\n if (componentState) {\r\n components[componentId] = componentState;\r\n }\r\n let isFormValid = this.getIsFormValid(components);\r\n return {\r\n contextState: {\r\n ...previousState.contextState,\r\n components,\r\n isFormValid,\r\n },\r\n };\r\n });\r\n }\r\n }\r\n\r\n private unSubscribe(componentId: string) {\r\n if (componentId) {\r\n this.setState(previousState => {\r\n let components = Object.assign(\r\n {},\r\n previousState.contextState.components\r\n );\r\n delete components[componentId];\r\n let isFormValid = this.getIsFormValid(components);\r\n return {\r\n contextState: {\r\n ...previousState.contextState,\r\n components,\r\n isFormValid,\r\n },\r\n };\r\n });\r\n }\r\n }\r\n\r\n private getIsFormValid(\r\n components: ComponentsDict = this.state.contextState.components,\r\n initialValid: boolean = true\r\n ): boolean {\r\n let isFormValid = initialValid;\r\n Object.keys(components).forEach(key => {\r\n const component = components[key];\r\n if (component && component.validation && !component.validation.isValid) {\r\n isFormValid = false;\r\n }\r\n });\r\n return isFormValid;\r\n }\r\n\r\n private updateCallback(\r\n componentId: string,\r\n componentState: FormComponentContextState\r\n ) {\r\n this.setState(previousState => {\r\n let components = Object.assign({}, previousState.contextState.components);\r\n const previousComponent = components[componentId];\r\n if (componentState && previousComponent) {\r\n components[componentId] = {\r\n ...previousComponent,\r\n ...componentState,\r\n validation: {\r\n ...previousComponent.validation,\r\n ...componentState.validation,\r\n },\r\n };\r\n }\r\n let isFormValid = this.getIsFormValid(components);\r\n return {\r\n contextState: {\r\n ...this.state.contextState,\r\n components,\r\n isFormValid,\r\n },\r\n };\r\n });\r\n }\r\n}\r\n\r\nexport default withThemeContext<FormProps, InstanceType<typeof Form>>(\r\n Form,\r\n 'form'\r\n);\r\n"],"mappings":";;;;;;AACA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AAGA,IAAAC,YAAA,GAAAD,OAAA;AAMA,IAAAE,iBAAA,GAAAF,OAAA;AAAqE,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAL,wBAAAS,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,G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,GAAG1C,UAAU,CAACqC,WAAW,CAAC;MACjD,IAAIC,cAAc,IAAII,iBAAiB,EAAE;QACvC1C,UAAU,CAACqC,WAAW,CAAC,GAAAzE,aAAA,CAAAA,aAAA,CAAAA,aAAA,KAClB8E,iBAAiB,GACjBJ,cAAc;UACjBzB,UAAU,EAAAjD,aAAA,CAAAA,aAAA,KACL8E,iBAAiB,CAAC7B,UAAU,GAC5ByB,cAAc,CAACzB,UAAU;QAC7B,EACF;MACH;MACA,IAAId,WAAW,GAAG,IAAI,CAACqC,cAAc,CAACpC,UAAU,CAAC;MACjD,OAAO;QACLF,YAAY,EAAAlC,aAAA,CAAAA,aAAA,KACP,IAAI,CAACiC,KAAK,CAACC,YAAY;UAC1BE,UAAU;UACVD;QAAW;MAEf,CAAC;IACH,CAAC,CAAC;EACJ;AACF;AAAC4C,OAAA,CAAA1D,IAAA,GAAAA,IAAA;AA9OYA,IAAI,CACD2D,YAAY,GAAG;EAC3Bd,UAAU,EAAE,KAAK;EACjBe,aAAa,EAAE,IAAI;EACnBjC,SAAS,EAAE;AACb,CAAC;AAAA,IAAAkC,QAAA,GA2OY,IAAAC,kCAAgB,EAC7B9D,IAAI,EACJ,MACF,CAAC;AAAA0D,OAAA,CAAAjH,OAAA,GAAAoH,QAAA"}
@@ -4,13 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.FormContextProvider = exports.FormContextConsumer = void 0;
7
-
8
7
  var React = _interopRequireWildcard(require("react"));
9
-
10
8
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
11
-
12
9
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
13
-
14
10
  const FormContext = /*#__PURE__*/React.createContext(undefined);
15
11
  const FormContextProvider = FormContext.Provider;
16
12
  exports.FormContextProvider = FormContextProvider;
@@ -1 +1 @@
1
- {"version":3,"file":"FormContext.js","names":["FormContext","React","createContext","undefined","FormContextProvider","Provider","FormContextConsumer","Consumer"],"sources":["../../../src/lib/components/form/FormContext.ts"],"sourcesContent":["import * as React from 'react';\r\nimport { ValidationError, ComponentApi } from '../base/input';\r\nimport { DeepPartial, PartialBy } from '../utils/Typescript';\r\n\r\nexport type OmitFormContext<P extends FormContextProps> = PartialBy<\r\n P,\r\n 'formContext'\r\n>;\r\n\r\nexport interface FormComponentValidationContextState {\r\n isValid: boolean;\r\n errors: ValidationError[];\r\n name: JSX.Element | string;\r\n}\r\n\r\nexport interface FormComponentContextState {\r\n validation: FormComponentValidationContextState;\r\n componentApi: ComponentApi;\r\n}\r\n\r\nexport interface FormContextProps {\r\n formContext?: FormContextState;\r\n}\r\n\r\nexport type ComponentsDict = {\r\n [componentId: string]: FormComponentContextState;\r\n};\r\n\r\nexport interface FormContextState {\r\n subscribe: (\r\n componentId: string,\r\n componentState: FormComponentContextState\r\n ) => void;\r\n unSubscribe: (componentId: string) => void;\r\n isFormValid: boolean;\r\n updateCallback: (\r\n componentId: string,\r\n newComponentState: DeepPartial<FormComponentContextState>\r\n ) => void;\r\n disableComponents: () => void;\r\n enableComponents: () => void;\r\n components: ComponentsDict;\r\n}\r\n\r\nconst FormContext = React.createContext<FormContextState | undefined>(\r\n undefined\r\n);\r\nexport const FormContextProvider = FormContext.Provider;\r\nexport const FormContextConsumer = FormContext.Consumer;\r\n"],"mappings":";;;;;;;AAAA;;;;;;AA4CA,MAAMA,WAAW,gBAAGC,KAAK,CAACC,aAAN,CAClBC,SADkB,CAApB;AAGO,MAAMC,mBAAmB,GAAGJ,WAAW,CAACK,QAAxC;;AACA,MAAMC,mBAAmB,GAAGN,WAAW,CAACO,QAAxC"}
1
+ {"version":3,"file":"FormContext.js","names":["React","_interopRequireWildcard","require","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","FormContext","createContext","undefined","FormContextProvider","Provider","exports","FormContextConsumer","Consumer"],"sources":["../../../src/lib/components/form/FormContext.ts"],"sourcesContent":["import * as React from 'react';\r\nimport { ValidationError, ComponentApi } from '../base/input';\r\nimport { DeepPartial, PartialBy } from '../utils/Typescript';\r\n\r\nexport type OmitFormContext<P extends FormContextProps> = PartialBy<\r\n P,\r\n 'formContext'\r\n>;\r\n\r\nexport interface FormComponentValidationContextState {\r\n isValid: boolean;\r\n errors: ValidationError[];\r\n name: JSX.Element | string;\r\n}\r\n\r\nexport interface FormComponentContextState {\r\n validation: FormComponentValidationContextState;\r\n componentApi: ComponentApi;\r\n}\r\n\r\nexport interface FormContextProps {\r\n formContext?: FormContextState;\r\n}\r\n\r\nexport type ComponentsDict = {\r\n [componentId: string]: FormComponentContextState;\r\n};\r\n\r\nexport interface FormContextState {\r\n subscribe: (\r\n componentId: string,\r\n componentState: FormComponentContextState\r\n ) => void;\r\n unSubscribe: (componentId: string) => void;\r\n isFormValid: boolean;\r\n updateCallback: (\r\n componentId: string,\r\n newComponentState: DeepPartial<FormComponentContextState>\r\n ) => void;\r\n disableComponents: () => void;\r\n enableComponents: () => void;\r\n components: ComponentsDict;\r\n}\r\n\r\nconst FormContext = React.createContext<FormContextState | undefined>(\r\n undefined\r\n);\r\nexport const FormContextProvider = FormContext.Provider;\r\nexport const FormContextConsumer = FormContext.Consumer;\r\n"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AAA+B,SAAAC,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAH,wBAAAO,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAI,IAAA,KAAAA,IAAA,CAAAV,GAAA,IAAAU,IAAA,CAAAC,GAAA,KAAAR,MAAA,CAAAC,cAAA,CAAAH,MAAA,EAAAK,GAAA,EAAAI,IAAA,YAAAT,MAAA,CAAAK,GAAA,IAAAX,GAAA,CAAAW,GAAA,SAAAL,MAAA,CAAAJ,OAAA,GAAAF,GAAA,MAAAG,KAAA,IAAAA,KAAA,CAAAa,GAAA,CAAAhB,GAAA,EAAAM,MAAA,YAAAA,MAAA;AA4C/B,MAAMW,WAAW,gBAAGzB,KAAK,CAAC0B,aAAa,CACrCC,SACF,CAAC;AACM,MAAMC,mBAAmB,GAAGH,WAAW,CAACI,QAAQ;AAACC,OAAA,CAAAF,mBAAA,GAAAA,mBAAA;AACjD,MAAMG,mBAAmB,GAAGN,WAAW,CAACO,QAAQ;AAACF,OAAA,CAAAC,mBAAA,GAAAA,mBAAA"}
@@ -4,38 +4,25 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.FormValidationSummaryRaw = exports.FormValidationSummary = exports.DefaultComponent = void 0;
7
-
8
7
  var React = _interopRequireWildcard(require("react"));
9
-
10
8
  var _Guid = _interopRequireDefault(require("../utils/Guid"));
11
-
12
9
  var _withFormContext = require("./withFormContext");
13
-
14
10
  var _Button = require("./../button/Button");
15
-
16
11
  var _classnames = _interopRequireDefault(require("classnames"));
17
-
18
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
-
20
13
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
21
-
22
14
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
23
-
24
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
25
-
26
15
  var ArrowIcon = function ArrowIcon(props) {
27
16
  return /*#__PURE__*/React.createElement("svg", props, /*#__PURE__*/React.createElement("path", {
28
17
  d: "M12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm8.94 3A8.994 8.994 0 0 0 13 3.06V1h-2v2.06A8.994 8.994 0 0 0 3.06 11H1v2h2.06A8.994 8.994 0 0 0 11 20.94V23h2v-2.06A8.994 8.994 0 0 0 20.94 13H23v-2h-2.06zM12 19c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z"
29
18
  }));
30
19
  };
31
-
32
20
  ArrowIcon.defaultProps = {
33
21
  xmlns: "http://www.w3.org/2000/svg",
34
22
  width: "24",
35
23
  height: "24",
36
24
  viewBox: "0 0 24 24"
37
25
  };
38
-
39
26
  const DefaultComponent = props => /*#__PURE__*/React.createElement(React.Fragment, null, props.componentsWithErrors.map((component, index) => {
40
27
  return /*#__PURE__*/React.createElement("div", {
41
28
  key: index,
@@ -64,22 +51,17 @@ const DefaultComponent = props => /*#__PURE__*/React.createElement(React.Fragmen
64
51
  }
65
52
  }, /*#__PURE__*/React.createElement(ArrowIcon, null)));
66
53
  }));
67
-
68
54
  exports.DefaultComponent = DefaultComponent;
69
-
70
55
  class FormValidationSummaryRaw extends React.PureComponent {
71
56
  constructor() {
72
57
  super(...arguments);
73
-
74
- _defineProperty(this, "componentId", (0, _Guid.default)());
58
+ this.componentId = (0, _Guid.default)();
75
59
  }
76
-
77
60
  render() {
78
61
  const componentsWithErrors = this.props.formContext ? Object.keys(this.props.formContext.components).map(key => this.props.formContext.components[key]).filter(component => {
79
62
  if (!component.validation.isValid && !component.validation.name) {
80
63
  console.warn(component, 'Has validation error. FormValidationSummary is present but the component has no validation name');
81
64
  }
82
-
83
65
  return !component.validation.isValid;
84
66
  }) : [];
85
67
  const containerClassName = (0, _classnames.default)(this.props.containerClassName);
@@ -95,20 +77,16 @@ class FormValidationSummaryRaw extends React.PureComponent {
95
77
  className: footerClassName
96
78
  }, this.props.footer));
97
79
  }
98
-
99
80
  }
100
-
101
81
  exports.FormValidationSummaryRaw = FormValidationSummaryRaw;
102
-
103
- _defineProperty(FormValidationSummaryRaw, "defaultProps", {
82
+ FormValidationSummaryRaw.defaultProps = {
104
83
  title: 'Hang on',
105
84
  footer: '... needs fixing',
106
85
  Component: DefaultComponent,
107
86
  containerClassName: 'formValidationSummary',
108
87
  headerClassName: 'formValidationSummary__header',
109
88
  footerClassName: 'formValidationSummary__footer'
110
- });
111
-
89
+ };
112
90
  const FormValidationSummary = (0, _withFormContext.withFormContext)(FormValidationSummaryRaw);
113
91
  exports.FormValidationSummary = FormValidationSummary;
114
92
  //# sourceMappingURL=FormValidationSummary.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FormValidationSummary.js","names":["ArrowIcon","DefaultComponent","props","componentsWithErrors","map","component","index","validation","name","errors","err","errIndex","flex","componentApi","focus","scrollTo","FormValidationSummaryRaw","React","PureComponent","guid","render","formContext","Object","keys","components","key","filter","isValid","console","warn","containerClassName","classNames","headerClassName","footerClassName","length","title","footer","Component","FormValidationSummary","withFormContext"],"sources":["../../../src/lib/components/form/FormValidationSummary.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport guid from '../utils/Guid';\r\nimport { withFormContext } from './withFormContext';\r\nimport { FormContextProps, FormComponentContextState } from './FormContext';\r\nimport { Button } from './../button/Button';\r\nimport classNames from 'classnames';\r\n\r\nimport * as ArrowIcon from 'material-design-icons/maps/svg/production/ic_my_location_24px.svg';\r\n\r\nexport interface FormValidationSummaryComponentProps {\r\n componentsWithErrors: FormComponentContextState[];\r\n}\r\n\r\nexport type FormValidationSummaryProps = {\r\n containerClassName?: string;\r\n headerClassName?: string;\r\n footerClassName?: string;\r\n title?: string | JSX.Element;\r\n footer?: string | JSX.Element;\r\n Component?:\r\n | React.ComponentType<FormValidationSummaryComponentProps>\r\n | React.StatelessComponent<FormValidationSummaryComponentProps>;\r\n} & FormContextProps;\r\n\r\nexport interface FormValidationSummaryState {}\r\n\r\nexport const DefaultComponent: React.FC<FormValidationSummaryComponentProps> = props => (\r\n <React.Fragment>\r\n {props.componentsWithErrors.map((component, index) => {\r\n return (\r\n <div key={index} className=\"formValidationSummary__item\">\r\n <div className=\"formValidationSummary__item__header\">\r\n {component.validation.name ? component.validation.name : 'unknown'}\r\n </div>\r\n <div className=\"formValidationSummary__item__errors\">\r\n {component.validation.errors &&\r\n component.validation.errors.map((err, errIndex) => (\r\n <span\r\n className=\"formValidationSummary__item__error\"\r\n key={errIndex}\r\n >\r\n {err}\r\n </span>\r\n ))}\r\n </div>\r\n <div style={{ flex: 'auto' }} />\r\n {component.componentApi &&\r\n component.componentApi.focus &&\r\n component.componentApi.scrollTo && (\r\n <Button\r\n icon={true}\r\n className=\"formValidationSummary__item__locate-button\"\r\n circular={true}\r\n type=\"error\"\r\n small={true}\r\n blank={true}\r\n onClick={() => {\r\n component.componentApi.scrollTo();\r\n component.componentApi.focus();\r\n }}\r\n >\r\n <ArrowIcon />\r\n </Button>\r\n )}\r\n </div>\r\n );\r\n })}\r\n </React.Fragment>\r\n);\r\n\r\nexport class FormValidationSummaryRaw extends React.PureComponent<\r\n FormValidationSummaryProps,\r\n FormValidationSummaryState\r\n> {\r\n public static defaultProps = {\r\n title: 'Hang on',\r\n footer: '... needs fixing',\r\n Component: DefaultComponent,\r\n containerClassName: 'formValidationSummary',\r\n headerClassName: 'formValidationSummary__header',\r\n footerClassName: 'formValidationSummary__footer',\r\n };\r\n\r\n public componentId = guid();\r\n\r\n public render() {\r\n const componentsWithErrors = this.props.formContext\r\n ? Object.keys(this.props.formContext.components)\r\n .map(key => this.props.formContext.components[key])\r\n .filter(component => {\r\n if (!component.validation.isValid && !component.validation.name) {\r\n console.warn(\r\n component,\r\n 'Has validation error. FormValidationSummary is present but the component has no validation name'\r\n );\r\n }\r\n return !component.validation.isValid;\r\n })\r\n : [];\r\n const containerClassName = classNames(this.props.containerClassName);\r\n const headerClassName = classNames(this.props.headerClassName);\r\n const footerClassName = classNames(this.props.footerClassName);\r\n return (\r\n componentsWithErrors.length > 0 && (\r\n <div className={containerClassName}>\r\n {this.props.title && (\r\n <div className={headerClassName}>{this.props.title}</div>\r\n )}\r\n <this.props.Component componentsWithErrors={componentsWithErrors} />\r\n {this.props.footer && (\r\n <div className={footerClassName}>{this.props.footer}</div>\r\n )}\r\n </div>\r\n )\r\n );\r\n }\r\n}\r\n\r\nexport const FormValidationSummary = withFormContext<\r\n FormValidationSummaryProps\r\n>(FormValidationSummaryRaw);\r\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAEA;;AACA;;;;;;;;;;IAEYA,S,YAAAA,S;;;;;;AAAAA,S;;;;;;;AAmBL,MAAMC,gBAA+D,GAAGC,KAAK,iBAClF,oBAAC,KAAD,CAAO,QAAP,QACGA,KAAK,CAACC,oBAAN,CAA2BC,GAA3B,CAA+B,CAACC,SAAD,EAAYC,KAAZ,KAAsB;EACpD,oBACE;IAAK,GAAG,EAAEA,KAAV;IAAiB,SAAS,EAAC;EAA3B,gBACE;IAAK,SAAS,EAAC;EAAf,GACGD,SAAS,CAACE,UAAV,CAAqBC,IAArB,GAA4BH,SAAS,CAACE,UAAV,CAAqBC,IAAjD,GAAwD,SAD3D,CADF,eAIE;IAAK,SAAS,EAAC;EAAf,GACGH,SAAS,CAACE,UAAV,CAAqBE,MAArB,IACCJ,SAAS,CAACE,UAAV,CAAqBE,MAArB,CAA4BL,GAA5B,CAAgC,CAACM,GAAD,EAAMC,QAAN,kBAC9B;IACE,SAAS,EAAC,oCADZ;IAEE,GAAG,EAAEA;EAFP,GAIGD,GAJH,CADF,CAFJ,CAJF,eAeE;IAAK,KAAK,EAAE;MAAEE,IAA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AAAD,mBAAA,EAAW,KAAK7B,KAAL,CAAW8B,eAAtB,CAAxB;IACA,MAAMC,eAAe,GAAG,IAAAF,mBAAA,EAAW,KAAK7B,KAAL,CAAW+B,eAAtB,CAAxB;IACA,OACE9B,oBAAoB,CAAC+B,MAArB,GAA8B,CAA9B,iBACE;MAAK,SAAS,EAAEJ;IAAhB,GACG,KAAK5B,KAAL,CAAWiC,KAAX,iBACC;MAAK,SAAS,EAAEH;IAAhB,GAAkC,KAAK9B,KAAL,CAAWiC,KAA7C,CAFJ,eAIE,yBAAM,KAAN,CAAY,SAAZ;MAAsB,oBAAoB,EAAEhC;IAA5C,EAJF,EAKG,KAAKD,KAAL,CAAWkC,MAAX,iBACC;MAAK,SAAS,EAAEH;IAAhB,GAAkC,KAAK/B,KAAL,CAAWkC,MAA7C,CANJ,CAFJ;EAaD;;AA1CD;;;;gBAHWpB,wB,kBAIkB;EAC3BmB,KAAK,EAAE,SADoB;EAE3BC,MAAM,EAAE,kBAFmB;EAG3BC,SAAS,EAAEpC,gBAHgB;EAI3B6B,kBAAkB,EAAE,uBAJO;EAK3BE,eAAe,EAAE,+BALU;EAM3BC,eAAe,EAAE;AANU,C;;AA4CxB,MAAMK,qBAAqB,GAAG,IAAAC,gCAAA,EAEnCvB,wBAFmC,CAA9B"}
1
+ {"version":3,"file":"FormValidationSummary.js","names":["React","_interopRequireWildcard","require","_Guid","_interopRequireDefault","_withFormContext","_Button","_classnames","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","ArrowIcon","props","createElement","d","defaultProps","xmlns","width","height","viewBox","DefaultComponent","Fragment","componentsWithErrors","map","component","index","className","validation","name","errors","err","errIndex","style","flex","componentApi","focus","scrollTo","Button","icon","circular","type","small","blank","onClick","exports","FormValidationSummaryRaw","PureComponent","constructor","arguments","componentId","guid","render","formContext","keys","components","filter","isValid","console","warn","containerClassName","classNames","headerClassName","footerClassName","length","title","Component","footer","FormValidationSummary","withFormContext"],"sources":["../../../src/lib/components/form/FormValidationSummary.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport guid from '../utils/Guid';\r\nimport { withFormContext } from './withFormContext';\r\nimport { FormContextProps, FormComponentContextState } from './FormContext';\r\nimport { Button } from './../button/Button';\r\nimport classNames from 'classnames';\r\n\r\nimport * as ArrowIcon from 'material-design-icons/maps/svg/production/ic_my_location_24px.svg';\r\n\r\nexport interface FormValidationSummaryComponentProps {\r\n componentsWithErrors: FormComponentContextState[];\r\n}\r\n\r\nexport type FormValidationSummaryProps = {\r\n containerClassName?: string;\r\n headerClassName?: string;\r\n footerClassName?: string;\r\n title?: string | JSX.Element;\r\n footer?: string | JSX.Element;\r\n Component?:\r\n | React.ComponentType<FormValidationSummaryComponentProps>\r\n | React.StatelessComponent<FormValidationSummaryComponentProps>;\r\n} & FormContextProps;\r\n\r\nexport interface FormValidationSummaryState {}\r\n\r\nexport const DefaultComponent: React.FC<FormValidationSummaryComponentProps> = props => (\r\n <React.Fragment>\r\n {props.componentsWithErrors.map((component, index) => {\r\n return (\r\n <div key={index} className=\"formValidationSummary__item\">\r\n <div className=\"formValidationSummary__item__header\">\r\n {component.validation.name ? component.validation.name : 'unknown'}\r\n </div>\r\n <div className=\"formValidationSummary__item__errors\">\r\n {component.validation.errors &&\r\n component.validation.errors.map((err, errIndex) => (\r\n <span\r\n className=\"formValidationSummary__item__error\"\r\n key={errIndex}\r\n >\r\n {err}\r\n </span>\r\n ))}\r\n </div>\r\n <div style={{ flex: 'auto' }} />\r\n {component.componentApi &&\r\n component.componentApi.focus &&\r\n component.componentApi.scrollTo && (\r\n <Button\r\n icon={true}\r\n className=\"formValidationSummary__item__locate-button\"\r\n circular={true}\r\n type=\"error\"\r\n small={true}\r\n blank={true}\r\n onClick={() => {\r\n component.componentApi.scrollTo();\r\n component.componentApi.focus();\r\n }}\r\n >\r\n <ArrowIcon />\r\n </Button>\r\n )}\r\n </div>\r\n );\r\n })}\r\n </React.Fragment>\r\n);\r\n\r\nexport class FormValidationSummaryRaw extends React.PureComponent<\r\n FormValidationSummaryProps,\r\n FormValidationSummaryState\r\n> {\r\n public static defaultProps = {\r\n title: 'Hang on',\r\n footer: '... needs fixing',\r\n Component: DefaultComponent,\r\n containerClassName: 'formValidationSummary',\r\n headerClassName: 'formValidationSummary__header',\r\n footerClassName: 'formValidationSummary__footer',\r\n };\r\n\r\n public componentId = guid();\r\n\r\n public render() {\r\n const componentsWithErrors = this.props.formContext\r\n ? Object.keys(this.props.formContext.components)\r\n .map(key => this.props.formContext.components[key])\r\n .filter(component => {\r\n if (!component.validation.isValid && !component.validation.name) {\r\n console.warn(\r\n component,\r\n 'Has validation error. FormValidationSummary is present but the component has no validation name'\r\n );\r\n }\r\n return !component.validation.isValid;\r\n })\r\n : [];\r\n const containerClassName = classNames(this.props.containerClassName);\r\n const headerClassName = classNames(this.props.headerClassName);\r\n const footerClassName = classNames(this.props.footerClassName);\r\n return (\r\n componentsWithErrors.length > 0 && (\r\n <div className={containerClassName}>\r\n {this.props.title && (\r\n <div className={headerClassName}>{this.props.title}</div>\r\n )}\r\n <this.props.Component componentsWithErrors={componentsWithErrors} />\r\n {this.props.footer && (\r\n <div className={footerClassName}>{this.props.footer}</div>\r\n )}\r\n </div>\r\n )\r\n );\r\n }\r\n}\r\n\r\nexport const FormValidationSummary = withFormContext<\r\n FormValidationSummaryProps\r\n>(FormValidationSummaryRaw);\r\n"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,gBAAA,GAAAH,OAAA;AAEA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAH,sBAAA,CAAAF,OAAA;AAAoC,SAAAE,uBAAAI,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAA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AACkD,eAAe,CAAC;IAC9D,OACExC,oBAAoB,CAACyC,MAAM,GAAG,CAAC,iBAC7BlF,KAAA,CAAAgC,aAAA;MAAKa,SAAS,EAAEiC;IAAmB,GAChC,IAAI,CAAC/C,KAAK,CAACoD,KAAK,iBACfnF,KAAA,CAAAgC,aAAA;MAAKa,SAAS,EAAEmC;IAAgB,GAAE,IAAI,CAACjD,KAAK,CAACoD,KAAW,CACzD,eACDnF,KAAA,CAAAgC,aAAA,MAAMD,KAAK,CAACqD,SAAS;MAAC3C,oBAAoB,EAAEA;IAAqB,CAAE,CAAC,EACnE,IAAI,CAACV,KAAK,CAACsD,MAAM,iBAChBrF,KAAA,CAAAgC,aAAA;MAAKa,SAAS,EAAEoC;IAAgB,GAAE,IAAI,CAAClD,KAAK,CAACsD,MAAY,CAExD,CACN;EAEL;AACF;AAACtB,OAAA,CAAAC,wBAAA,GAAAA,wBAAA;AA9CYA,wBAAwB,CAIrB9B,YAAY,GAAG;EAC3BiD,KAAK,EAAE,SAAS;EAChBE,MAAM,EAAE,kBAAkB;EAC1BD,SAAS,EAAE7C,gBAAgB;EAC3BuC,kBAAkB,EAAE,uBAAuB;EAC3CE,eAAe,EAAE,+BAA+B;EAChDC,eAAe,EAAE;AACnB,CAAC;AAqCI,MAAMK,qBAAqB,GAAG,IAAAC,gCAAe,EAElDvB,wBAAwB,CAAC;AAACD,OAAA,CAAAuB,qBAAA,GAAAA,qBAAA"}
@@ -10,9 +10,7 @@ Object.defineProperty(exports, "default", {
10
10
  return _Form.default;
11
11
  }
12
12
  });
13
-
14
13
  var _Form = _interopRequireWildcard(require("./Form"));
15
-
16
14
  Object.keys(_Form).forEach(function (key) {
17
15
  if (key === "default" || key === "__esModule") return;
18
16
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
@@ -24,9 +22,7 @@ Object.keys(_Form).forEach(function (key) {
24
22
  }
25
23
  });
26
24
  });
27
-
28
25
  var _FormValidationSummary = require("./FormValidationSummary");
29
-
30
26
  Object.keys(_FormValidationSummary).forEach(function (key) {
31
27
  if (key === "default" || key === "__esModule") return;
32
28
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
@@ -38,9 +34,7 @@ Object.keys(_FormValidationSummary).forEach(function (key) {
38
34
  }
39
35
  });
40
36
  });
41
-
42
37
  var _FormContext = require("./FormContext");
43
-
44
38
  Object.keys(_FormContext).forEach(function (key) {
45
39
  if (key === "default" || key === "__esModule") return;
46
40
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
@@ -52,9 +46,7 @@ Object.keys(_FormContext).forEach(function (key) {
52
46
  }
53
47
  });
54
48
  });
55
-
56
49
  var _withFormContext = require("./withFormContext");
57
-
58
50
  Object.keys(_withFormContext).forEach(function (key) {
59
51
  if (key === "default" || key === "__esModule") return;
60
52
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
@@ -66,8 +58,6 @@ Object.keys(_withFormContext).forEach(function (key) {
66
58
  }
67
59
  });
68
60
  });
69
-
70
61
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
71
-
72
62
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
73
63
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../src/lib/components/form/index.tsx"],"sourcesContent":["export * from './Form';\r\nexport * from './FormValidationSummary';\r\nexport * from './FormContext';\r\nexport * from './withFormContext';\r\nexport { default } from './Form';\r\n"],"mappings":";;;;;;;;;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
1
+ {"version":3,"file":"index.js","names":["_Form","_interopRequireWildcard","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_FormValidationSummary","_FormContext","_withFormContext","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","newObj","hasPropertyDescriptor","getOwnPropertyDescriptor","desc","set"],"sources":["../../../src/lib/components/form/index.tsx"],"sourcesContent":["export * from './Form';\r\nexport * from './FormValidationSummary';\r\nexport * from './FormContext';\r\nexport * from './withFormContext';\r\nexport { default } from './Form';\r\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAJ,KAAA,EAAAK,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAN,KAAA,CAAAM,GAAA;EAAA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B,GAAA,CAAAjB,GAAA,SAAAsB,MAAA,CAAAH,OAAA,GAAAF,GAAA,MAAAG,KAAA,IAAAA,KAAA,CAAAM,GAAA,CAAAT,GAAA,EAAAK,MAAA,YAAAA,MAAA"}
@@ -4,17 +4,11 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.withFormContext = withFormContext;
7
-
8
7
  var React = _interopRequireWildcard(require("react"));
9
-
10
8
  var _FormContext = require("./FormContext");
11
-
12
9
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
13
-
14
10
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
15
-
16
11
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
17
-
18
12
  function withFormContext(Component) {
19
13
  const WithFormContext = /*#__PURE__*/React.forwardRef((props, ref) => {
20
14
  return /*#__PURE__*/React.createElement(_FormContext.FormContextConsumer, null, value => /*#__PURE__*/React.createElement(Component, _extends({
@@ -1 +1 @@
1
- {"version":3,"file":"withFormContext.js","names":["withFormContext","Component","WithFormContext","React","forwardRef","props","ref","value"],"sources":["../../../src/lib/components/form/withFormContext.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport { FormContextConsumer, FormContextProps } from './FormContext';\r\n\r\nexport function withFormContext<P extends FormContextProps>(\r\n Component: React.ComponentClass<P>\r\n): React.ForwardRefExoticComponent<\r\n React.RefAttributes<InstanceType<typeof Component>> &\r\n React.PropsWithoutRef<React.PropsWithChildren<P>>\r\n> {\r\n const WithFormContext = React.forwardRef<InstanceType<typeof Component>, P>(\r\n (props, ref) => {\r\n return (\r\n <FormContextConsumer>\r\n {value => <Component ref={ref} {...props} formContext={value} />}\r\n </FormContextConsumer>\r\n );\r\n }\r\n );\r\n return WithFormContext;\r\n}\r\n"],"mappings":";;;;;;;AAAA;;AACA;;;;;;;;AAEO,SAASA,eAAT,CACLC,SADK,EAKL;EACA,MAAMC,eAAe,gBAAGC,KAAK,CAACC,UAAN,CACtB,CAACC,KAAD,EAAQC,GAAR,KAAgB;IACd,oBACE,oBAAC,gCAAD,QACGC,KAAK,iBAAI,oBAAC,SAAD;MAAW,GAAG,EAAED;IAAhB,GAAyBD,KAAzB;MAAgC,WAAW,EAAEE;IAA7C,GADZ,CADF;EAKD,CAPqB,CAAxB;EASA,OAAOL,eAAP;AACD"}
1
+ {"version":3,"file":"withFormContext.js","names":["React","_interopRequireWildcard","require","_FormContext","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_extends","assign","bind","target","i","arguments","length","source","apply","withFormContext","Component","WithFormContext","forwardRef","props","ref","createElement","FormContextConsumer","value","formContext"],"sources":["../../../src/lib/components/form/withFormContext.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport { FormContextConsumer, FormContextProps } from './FormContext';\r\n\r\nexport function withFormContext<P extends FormContextProps>(\r\n Component: React.ComponentClass<P>\r\n): React.ForwardRefExoticComponent<\r\n React.RefAttributes<InstanceType<typeof Component>> &\r\n React.PropsWithoutRef<React.PropsWithChildren<P>>\r\n> {\r\n const WithFormContext = React.forwardRef<InstanceType<typeof Component>, P>(\r\n (props, ref) => {\r\n return (\r\n <FormContextConsumer>\r\n {value => <Component ref={ref} {...props} formContext={value} />}\r\n </FormContextConsumer>\r\n );\r\n }\r\n );\r\n return WithFormContext;\r\n}\r\n"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAAsE,SAAAE,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAJ,wBAAAQ,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAI,IAAA,KAAAA,IAAA,CAAAV,GAAA,IAAAU,IAAA,CAAAC,GAAA,KAAAR,MAAA,CAAAC,cAAA,CAAAH,MAAA,EAAAK,GAAA,EAAAI,IAAA,YAAAT,MAAA,CAAAK,GAAA,IAAAX,GAAA,CAAAW,GAAA,SAAAL,MAAA,CAAAJ,OAAA,GAAAF,GAAA,MAAAG,KAAA,IAAAA,KAAA,CAAAa,GAAA,CAAAhB,GAAA,EAAAM,MAAA,YAAAA,MAAA;AAAA,SAAAW,SAAA,IAAAA,QAAA,GAAAT,MAAA,CAAAU,MAAA,GAAAV,MAAA,CAAAU,MAAA,CAAAC,IAAA,eAAAC,MAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAF,CAAA,UAAAG,MAAA,GAAAF,SAAA,CAAAD,CAAA,YAAAV,GAAA,IAAAa,MAAA,QAAAhB,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAU,MAAA,EAAAb,GAAA,KAAAS,MAAA,CAAAT,GAAA,IAAAa,MAAA,CAAAb,GAAA,gBAAAS,MAAA,YAAAH,QAAA,CAAAQ,KAAA,OAAAH,SAAA;AAE/D,SAASI,eAAeA,CAC7BC,SAAkC,EAIlC;EACA,MAAMC,eAAe,gBAAGrC,KAAK,CAACsC,UAAU,CACtC,CAACC,KAAK,EAAEC,GAAG,KAAK;IACd,oBACExC,KAAA,CAAAyC,aAAA,CAACtC,YAAA,CAAAuC,mBAAmB,QACjBC,KAAK,iBAAI3C,KAAA,CAAAyC,aAAA,CAACL,SAAS,EAAAV,QAAA;MAACc,GAAG,EAAEA;IAAI,GAAKD,KAAK;MAAEK,WAAW,EAAED;IAAM,EAAE,CAC5C,CAAC;EAE1B,CACF,CAAC;EACD,OAAON,eAAe;AACxB"}
@@ -4,25 +4,19 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = exports.InputGroup = void 0;
7
-
8
7
  var React = _interopRequireWildcard(require("react"));
9
-
10
8
  var _BaseInput = require("../base/input/BaseInput");
11
-
12
9
  var _withThemeContext = require("../themeProvider/withThemeContext");
13
-
14
10
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
15
-
16
11
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
12
+ // Libs
17
13
 
18
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
14
+ // Misc
19
15
 
20
16
  class InputGroup extends _BaseInput.BaseInput {
21
- // tslint:disable-next-line:no-any
22
17
  constructor(props) {
23
18
  super(props);
24
19
  }
25
-
26
20
  render() {
27
21
  return this.props.title ? /*#__PURE__*/React.createElement("div", {
28
22
  className: `inputGroup input__group__border ` + (this.props.className ? this.props.className : '')
@@ -32,16 +26,12 @@ class InputGroup extends _BaseInput.BaseInput {
32
26
  className: "inputGroup__body"
33
27
  }, this.props.children)) : this.props.children;
34
28
  }
35
-
36
29
  }
37
-
38
30
  exports.InputGroup = InputGroup;
39
-
40
- _defineProperty(InputGroup, "defaultProps", {
31
+ // tslint:disable-next-line:no-any
32
+ InputGroup.defaultProps = {
41
33
  ignoreContext: true
42
- });
43
-
34
+ };
44
35
  var _default = (0, _withThemeContext.withThemeContext)(InputGroup, 'inputGroup');
45
-
46
36
  exports.default = _default;
47
37
  //# sourceMappingURL=InputGroup.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"InputGroup.js","names":["InputGroup","BaseInput","constructor","props","render","title","className","renderTitle","React","Children","count","children","ignoreContext","withThemeContext"],"sources":["../../../src/lib/components/inputGroup/InputGroup.tsx"],"sourcesContent":["// Libs\r\nimport * as React from 'react';\r\nimport {\r\n BaseInputProps,\r\n BaseInputState,\r\n BaseInput,\r\n} from '../base/input/BaseInput';\r\nimport { withThemeContext } from '../themeProvider/withThemeContext';\r\nimport { ThemeContextProps } from '../themeProvider/ThemeContext';\r\n\r\n// Misc\r\n\r\nexport type InputGroupProps = React.PropsWithChildren<\r\n Pick<\r\n BaseInputProps<never>,\r\n 'title' | 'className' | 'tooltip' | 'formContext'\r\n > &\r\n ThemeContextProps\r\n>;\r\n\r\nexport interface InputGroupState extends BaseInputState {}\r\n\r\nexport class InputGroup extends BaseInput<\r\n InputGroupProps,\r\n InputGroupState,\r\n never\r\n> {\r\n // tslint:disable-next-line:no-any\r\n public static defaultProps: any = {\r\n ignoreContext: true,\r\n };\r\n\r\n constructor(props: InputGroupProps) {\r\n super(props);\r\n }\r\n\r\n public render() {\r\n return this.props.title ? (\r\n <div\r\n className={\r\n `inputGroup input__group__border ` +\r\n (this.props.className ? this.props.className : '')\r\n }\r\n >\r\n {this.props.title && (\r\n <div className=\"inputGroup__header\">{this.renderTitle()}</div>\r\n )}\r\n {React.Children.count(this.props.children) > 0 && (\r\n <div className=\"inputGroup__body\">{this.props.children}</div>\r\n )}\r\n </div>\r\n ) : (\r\n this.props.children\r\n );\r\n }\r\n}\r\nexport default withThemeContext<\r\n InputGroupProps,\r\n InstanceType<typeof InputGroup>\r\n>(InputGroup, 'inputGroup');\r\n"],"mappings":";;;;;;;AACA;;AACA;;AAKA;;;;;;;;AAeO,MAAMA,UAAN,SAAyBC,oBAAzB,CAIL;EACA;EAKAC,WAAW,CAACC,KAAD,EAAyB;IAClC,MAAMA,KAAN;EACD;;EAEMC,MAAM,GAAG;IACd,OAAO,KAAKD,KAAL,CAAWE,KAAX,gBACL;MACE,SAAS,EACN,kCAAD,IACC,KAAKF,KAAL,CAAWG,SAAX,GAAuB,KAAKH,KAAL,CAAWG,SAAlC,GAA8C,EAD/C;IAFJ,GAMG,KAAKH,KAAL,CAAWE,KAAX,iBACC;MAAK,SAAS,EAAC;IAAf,GAAqC,KAAKE,WAAL,EAArC,CAPJ,EASGC,KAAK,CAACC,QAAN,CAAeC,KAAf,CAAqB,KAAKP,KAAL,CAAWQ,QAAhC,IAA4C,CAA5C,iBACC;MAAK,SAAS,EAAC;IAAf,GAAmC,KAAKR,KAAL,CAAWQ,QAA9C,CAVJ,CADK,GAeL,KAAKR,KAAL,CAAWQ,QAfb;EAiBD;;AA5BD;;;;gBAJWX,U,kBAMuB;EAChCY,aAAa,EAAE;AADiB,C;;eA4BrB,IAAAC,kCAAA,EAGbb,UAHa,EAGD,YAHC,C"}
1
+ {"version":3,"file":"InputGroup.js","names":["React","_interopRequireWildcard","require","_BaseInput","_withThemeContext","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","InputGroup","BaseInput","constructor","props","render","title","createElement","className","renderTitle","Children","count","children","exports","defaultProps","ignoreContext","_default","withThemeContext"],"sources":["../../../src/lib/components/inputGroup/InputGroup.tsx"],"sourcesContent":["// Libs\r\nimport * as React from 'react';\r\nimport {\r\n BaseInputProps,\r\n BaseInputState,\r\n BaseInput,\r\n} from '../base/input/BaseInput';\r\nimport { withThemeContext } from '../themeProvider/withThemeContext';\r\nimport { ThemeContextProps } from '../themeProvider/ThemeContext';\r\n\r\n// Misc\r\n\r\nexport type InputGroupProps = React.PropsWithChildren<\r\n Pick<\r\n BaseInputProps<never>,\r\n 'title' | 'className' | 'tooltip' | 'formContext'\r\n > &\r\n ThemeContextProps\r\n>;\r\n\r\nexport interface InputGroupState extends BaseInputState {}\r\n\r\nexport class InputGroup extends BaseInput<\r\n InputGroupProps,\r\n InputGroupState,\r\n never\r\n> {\r\n // tslint:disable-next-line:no-any\r\n public static defaultProps: any = {\r\n ignoreContext: true,\r\n };\r\n\r\n constructor(props: InputGroupProps) {\r\n super(props);\r\n }\r\n\r\n public render() {\r\n return this.props.title ? (\r\n <div\r\n className={\r\n `inputGroup input__group__border ` +\r\n (this.props.className ? this.props.className : '')\r\n }\r\n >\r\n {this.props.title && (\r\n <div className=\"inputGroup__header\">{this.renderTitle()}</div>\r\n )}\r\n {React.Children.count(this.props.children) > 0 && (\r\n <div className=\"inputGroup__body\">{this.props.children}</div>\r\n )}\r\n </div>\r\n ) : (\r\n this.props.children\r\n );\r\n }\r\n}\r\nexport default withThemeContext<\r\n InputGroupProps,\r\n InstanceType<typeof InputGroup>\r\n>(InputGroup, 'inputGroup');\r\n"],"mappings":";;;;;;AACA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAKA,IAAAE,iBAAA,GAAAF,OAAA;AAAqE,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAL,wBAAAS,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OA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Q,CAAC,GAAG,CAAC,iBAC5CtC,KAAA,CAAAiC,aAAA;MAAKC,SAAS,EAAC;IAAkB,GAAE,IAAI,CAACJ,KAAK,CAACQ,QAAc,CAE3D,CAAC,GAEN,IAAI,CAACR,KAAK,CAACQ,QACZ;EACH;AACF;AAACC,OAAA,CAAAZ,UAAA,GAAAA,UAAA;AA5BC;AALWA,UAAU,CAMPa,YAAY,GAAQ;EAChCC,aAAa,EAAE;AACjB,CAAC;AAAA,IAAAC,QAAA,GA0BY,IAAAC,kCAAgB,EAG7BhB,UAAU,EAAE,YAAY,CAAC;AAAAY,OAAA,CAAA3B,OAAA,GAAA8B,QAAA"}
@@ -10,9 +10,7 @@ Object.defineProperty(exports, "default", {
10
10
  return _InputGroup.default;
11
11
  }
12
12
  });
13
-
14
13
  var _InputGroup = _interopRequireWildcard(require("./InputGroup"));
15
-
16
14
  Object.keys(_InputGroup).forEach(function (key) {
17
15
  if (key === "default" || key === "__esModule") return;
18
16
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
@@ -24,8 +22,6 @@ Object.keys(_InputGroup).forEach(function (key) {
24
22
  }
25
23
  });
26
24
  });
27
-
28
25
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
29
-
30
26
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
31
27
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../src/lib/components/inputGroup/index.tsx"],"sourcesContent":["export * from './InputGroup';\r\nexport { default } from './InputGroup';\r\n"],"mappings":";;;;;;;;;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
1
+ {"version":3,"file":"index.js","names":["_InputGroup","_interopRequireWildcard","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","newObj","hasPropertyDescriptor","getOwnPropertyDescriptor","desc","set"],"sources":["../../../src/lib/components/inputGroup/index.tsx"],"sourcesContent":["export * from './InputGroup';\r\nexport { default } from './InputGroup';\r\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,WAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAJ,WAAA,EAAAK,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAN,WAAA,CAAAM,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAd,WAAA,CAAAM,GAAA;IAAA;EAAA;AAAA;AAA6B,SAAAS,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,O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