@onehat/ui 0.1.2 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (355) hide show
  1. package/ckeditor5/LICENSE.md +49 -0
  2. package/ckeditor5/README.md +68 -0
  3. package/ckeditor5/build/ckeditor.js +6 -0
  4. package/ckeditor5/build/ckeditor.js.map +1 -0
  5. package/ckeditor5/build/translations/af.js +1 -0
  6. package/ckeditor5/build/translations/ar.js +1 -0
  7. package/ckeditor5/build/translations/ast.js +1 -0
  8. package/ckeditor5/build/translations/az.js +1 -0
  9. package/ckeditor5/build/translations/bg.js +1 -0
  10. package/ckeditor5/build/translations/bn.js +1 -0
  11. package/ckeditor5/build/translations/bs.js +1 -0
  12. package/ckeditor5/build/translations/ca.js +1 -0
  13. package/ckeditor5/build/translations/cs.js +1 -0
  14. package/ckeditor5/build/translations/da.js +1 -0
  15. package/ckeditor5/build/translations/de-ch.js +1 -0
  16. package/ckeditor5/build/translations/de.js +1 -0
  17. package/ckeditor5/build/translations/el.js +1 -0
  18. package/ckeditor5/build/translations/en-au.js +1 -0
  19. package/ckeditor5/build/translations/en-gb.js +1 -0
  20. package/ckeditor5/build/translations/eo.js +1 -0
  21. package/ckeditor5/build/translations/es-co.js +1 -0
  22. package/ckeditor5/build/translations/es.js +1 -0
  23. package/ckeditor5/build/translations/et.js +1 -0
  24. package/ckeditor5/build/translations/eu.js +1 -0
  25. package/ckeditor5/build/translations/fa.js +1 -0
  26. package/ckeditor5/build/translations/fi.js +1 -0
  27. package/ckeditor5/build/translations/fr.js +1 -0
  28. package/ckeditor5/build/translations/gl.js +1 -0
  29. package/ckeditor5/build/translations/gu.js +1 -0
  30. package/ckeditor5/build/translations/he.js +1 -0
  31. package/ckeditor5/build/translations/hi.js +1 -0
  32. package/ckeditor5/build/translations/hr.js +1 -0
  33. package/ckeditor5/build/translations/hu.js +1 -0
  34. package/ckeditor5/build/translations/id.js +1 -0
  35. package/ckeditor5/build/translations/it.js +1 -0
  36. package/ckeditor5/build/translations/ja.js +1 -0
  37. package/ckeditor5/build/translations/jv.js +1 -0
  38. package/ckeditor5/build/translations/kk.js +1 -0
  39. package/ckeditor5/build/translations/km.js +1 -0
  40. package/ckeditor5/build/translations/kn.js +1 -0
  41. package/ckeditor5/build/translations/ko.js +1 -0
  42. package/ckeditor5/build/translations/ku.js +1 -0
  43. package/ckeditor5/build/translations/lt.js +1 -0
  44. package/ckeditor5/build/translations/lv.js +1 -0
  45. package/ckeditor5/build/translations/ms.js +1 -0
  46. package/ckeditor5/build/translations/nb.js +1 -0
  47. package/ckeditor5/build/translations/ne.js +1 -0
  48. package/ckeditor5/build/translations/nl.js +1 -0
  49. package/ckeditor5/build/translations/no.js +1 -0
  50. package/ckeditor5/build/translations/oc.js +1 -0
  51. package/ckeditor5/build/translations/pl.js +1 -0
  52. package/ckeditor5/build/translations/pt-br.js +1 -0
  53. package/ckeditor5/build/translations/pt.js +1 -0
  54. package/ckeditor5/build/translations/ro.js +1 -0
  55. package/ckeditor5/build/translations/ru.js +1 -0
  56. package/ckeditor5/build/translations/si.js +1 -0
  57. package/ckeditor5/build/translations/sk.js +1 -0
  58. package/ckeditor5/build/translations/sl.js +1 -0
  59. package/ckeditor5/build/translations/sq.js +1 -0
  60. package/ckeditor5/build/translations/sr-latn.js +1 -0
  61. package/ckeditor5/build/translations/sr.js +1 -0
  62. package/ckeditor5/build/translations/sv.js +1 -0
  63. package/ckeditor5/build/translations/th.js +1 -0
  64. package/ckeditor5/build/translations/tk.js +1 -0
  65. package/ckeditor5/build/translations/tr.js +1 -0
  66. package/ckeditor5/build/translations/tt.js +1 -0
  67. package/ckeditor5/build/translations/ug.js +1 -0
  68. package/ckeditor5/build/translations/uk.js +1 -0
  69. package/ckeditor5/build/translations/ur.js +1 -0
  70. package/ckeditor5/build/translations/uz.js +1 -0
  71. package/ckeditor5/build/translations/vi.js +1 -0
  72. package/ckeditor5/build/translations/zh-cn.js +1 -0
  73. package/ckeditor5/build/translations/zh.js +1 -0
  74. package/ckeditor5/package.json +46 -0
  75. package/ckeditor5/sample/index.html +130 -0
  76. package/ckeditor5/sample/styles.css +496 -0
  77. package/ckeditor5/src/ckeditor.js +138 -0
  78. package/ckeditor5/webpack.config.js +96 -0
  79. package/package.json +19 -23
  80. package/src/Components/Accordion/Accordion.js +144 -0
  81. package/src/Components/Blank.js +14 -0
  82. package/src/Components/Buttons/BackButton.js +16 -0
  83. package/src/Components/Buttons/CartButtonWithBadge.js +25 -0
  84. package/src/Components/Buttons/IconButton.js +42 -0
  85. package/src/Components/Container/Container.js +178 -0
  86. package/src/Components/Container/Splitter.js +61 -0
  87. package/src/Components/Filter/DateRange.js +99 -0
  88. package/src/Components/Filter/NumberRange.js +96 -0
  89. package/src/Components/Form/Field/CKEditor/CKEditor.js +62 -0
  90. package/src/Components/Form/Field/CKEditor/styles.css +503 -0
  91. package/src/Components/Form/Field/CKEditor.js +12 -0
  92. package/src/Components/Form/Field/CheckboxGroup/ArrayCheckboxGroup.js +13 -0
  93. package/src/Components/Form/Field/CheckboxGroup/CheckboxGroup.js +61 -0
  94. package/src/Components/Form/Field/Color.js +226 -0
  95. package/src/Components/Form/Field/Combo/ArrayCombo.js +15 -0
  96. package/src/Components/Form/Field/Combo/BooleanCombo.js +23 -0
  97. package/src/Components/Form/Field/Combo/Combo.js +504 -0
  98. package/src/Components/Form/Field/Combo/ComboEditor.js +22 -0
  99. package/src/Components/Form/Field/Combo/IntervalsCombo.js +18 -0
  100. package/src/Components/Form/Field/Combo/MonthsCombo.js +24 -0
  101. package/src/Components/Form/Field/Combo/PageSizeCombo.js +38 -0
  102. package/src/Components/Form/Field/Combo/Tag.js +12 -0
  103. package/src/Components/Form/Field/Combo/TimezonesCombo.js +432 -0
  104. package/src/Components/Form/Field/Combo/YearsCombo.js +35 -0
  105. package/src/Components/Form/Field/Date.js +370 -0
  106. package/src/Components/Form/Field/DisplayField.js +28 -0
  107. package/src/Components/Form/Field/Field.js +14 -0
  108. package/src/Components/Form/Field/File.js +218 -0
  109. package/src/Components/Form/Field/Input.js +96 -0
  110. package/src/Components/Form/Field/Number.js +151 -0
  111. package/src/Components/Form/Field/RadioGroup/ArrayRadioGroup.js +13 -0
  112. package/src/Components/Form/Field/RadioGroup/RadioGroup.js +62 -0
  113. package/src/Components/Form/Field/Tag.js +11 -0
  114. package/src/Components/Form/Field/Text.js +28 -0
  115. package/src/Components/Form/Field/TextArea.js +26 -0
  116. package/src/Components/Form/Field/Toggle.js +39 -0
  117. package/src/Components/Form/Field/datetime.css +5 -0
  118. package/src/Components/Form/FieldSet.js +64 -0
  119. package/src/Components/Form/FiltersForm.js +66 -0
  120. package/src/Components/Form/Form.js +535 -0
  121. package/src/Components/Form/Label.js +24 -0
  122. package/src/Components/Grid/Grid.js +877 -0
  123. package/src/Components/Grid/GridHeaderRow.js +455 -0
  124. package/src/Components/Grid/GridRow.js +134 -0
  125. package/src/Components/Grid/HeaderReorderHandle.js +29 -0
  126. package/src/Components/Grid/HeaderResizeHandle.js +29 -0
  127. package/src/Components/Grid/NoRecordsFound.js +43 -0
  128. package/src/Components/Grid/ReactGrid.js +468 -0
  129. package/src/Components/Grid/SenchaGrid.js +421 -0
  130. package/src/Components/Grid/reactgrid.css +6 -0
  131. package/src/Components/Hoc/withAlert.js +176 -0
  132. package/src/Components/Hoc/withBlank.js +12 -0
  133. package/src/Components/Hoc/withCollapsible.js +20 -0
  134. package/src/Components/Hoc/withContextMenu.js +127 -0
  135. package/src/Components/Hoc/withData.js +85 -0
  136. package/src/Components/Hoc/withDraggable.js +259 -0
  137. package/src/Components/Hoc/withEditor.js +160 -0
  138. package/src/Components/Hoc/withEvents.js +12 -0
  139. package/src/Components/Hoc/withFilters.js +456 -0
  140. package/src/Components/Hoc/withInlineEditor.js +119 -0
  141. package/src/Components/Hoc/withMultiSelection.js +16 -0
  142. package/src/Components/Hoc/withPresetButtons.js +239 -0
  143. package/src/Components/Hoc/withSelection.js +332 -0
  144. package/src/Components/Hoc/withTooltip.js +21 -0
  145. package/src/Components/Hoc/withValue.js +87 -0
  146. package/src/Components/Hoc/withWindowedEditor.js +51 -0
  147. package/src/Components/Icons/AddressBook.js +14 -0
  148. package/src/Components/Icons/Alt.js +17 -0
  149. package/src/Components/Icons/AngleLeft.js +18 -0
  150. package/src/Components/Icons/AngleRight.js +18 -0
  151. package/src/Components/Icons/AnglesLeft.js +18 -0
  152. package/src/Components/Icons/AnglesRight.js +18 -0
  153. package/src/Components/Icons/Asterisk.js +14 -0
  154. package/src/Components/Icons/Ban.js +18 -0
  155. package/src/Components/Icons/Bars.js +14 -0
  156. package/src/Components/Icons/BigCircle.js +17 -0
  157. package/src/Components/Icons/Book.js +14 -0
  158. package/src/Components/Icons/BookOpen.js +14 -0
  159. package/src/Components/Icons/Bug.js +14 -0
  160. package/src/Components/Icons/Building.js +14 -0
  161. package/src/Components/Icons/Calendar.js +18 -0
  162. package/src/Components/Icons/Calendar2.js +18 -0
  163. package/src/Components/Icons/CalendarDays.js +18 -0
  164. package/src/Components/Icons/Camera.js +18 -0
  165. package/src/Components/Icons/CaretDown.js +18 -0
  166. package/src/Components/Icons/CaretUp.js +18 -0
  167. package/src/Components/Icons/CartPlus.js +14 -0
  168. package/src/Components/Icons/CartShopping.js +14 -0
  169. package/src/Components/Icons/CashRegister.js +14 -0
  170. package/src/Components/Icons/ChartLine.js +14 -0
  171. package/src/Components/Icons/Check.js +14 -0
  172. package/src/Components/Icons/CheckDouble.js +14 -0
  173. package/src/Components/Icons/ChevronDown.js +14 -0
  174. package/src/Components/Icons/ChevronLeft.js +14 -0
  175. package/src/Components/Icons/ChevronRight.js +14 -0
  176. package/src/Components/Icons/ChevronUp.js +14 -0
  177. package/src/Components/Icons/CircleArrowRight.js +14 -0
  178. package/src/Components/Icons/CircleExclamation.js +18 -0
  179. package/src/Components/Icons/CircleInfo.js +14 -0
  180. package/src/Components/Icons/CircleQuestion.js +14 -0
  181. package/src/Components/Icons/CircleXmark.js +14 -0
  182. package/src/Components/Icons/CircleXmarkRegular.js +14 -0
  183. package/src/Components/Icons/Clipboard.js +18 -0
  184. package/src/Components/Icons/Clock.js +14 -0
  185. package/src/Components/Icons/ClockRegular.js +14 -0
  186. package/src/Components/Icons/ClockRotateLeft.js +14 -0
  187. package/src/Components/Icons/Clone.js +14 -0
  188. package/src/Components/Icons/Comment.js +14 -0
  189. package/src/Components/Icons/CommentRegular.js +14 -0
  190. package/src/Components/Icons/Comments.js +14 -0
  191. package/src/Components/Icons/CommentsRegular.js +14 -0
  192. package/src/Components/Icons/Copyright.js +14 -0
  193. package/src/Components/Icons/Duplicate.js +18 -0
  194. package/src/Components/Icons/Edit.js +18 -0
  195. package/src/Components/Icons/EllipsisVertical.js +18 -0
  196. package/src/Components/Icons/Envelope.js +14 -0
  197. package/src/Components/Icons/EnvelopeRegular.js +14 -0
  198. package/src/Components/Icons/Exclamation.js +14 -0
  199. package/src/Components/Icons/Expand.js +14 -0
  200. package/src/Components/Icons/Eye.js +18 -0
  201. package/src/Components/Icons/File.js +18 -0
  202. package/src/Components/Icons/FloppyDiskRegular.js +14 -0
  203. package/src/Components/Icons/Gear.js +18 -0
  204. package/src/Components/Icons/Gift.js +14 -0
  205. package/src/Components/Icons/Grip.js +18 -0
  206. package/src/Components/Icons/GripLines.js +18 -0
  207. package/src/Components/Icons/GripLinesVertical.js +18 -0
  208. package/src/Components/Icons/GripVertical.js +18 -0
  209. package/src/Components/Icons/Hammer.js +14 -0
  210. package/src/Components/Icons/Hand.js +14 -0
  211. package/src/Components/Icons/House.js +14 -0
  212. package/src/Components/Icons/Info.js +14 -0
  213. package/src/Components/Icons/ItunesNote.js +14 -0
  214. package/src/Components/Icons/List.js +14 -0
  215. package/src/Components/Icons/ListCheck.js +14 -0
  216. package/src/Components/Icons/LocationDot.js +14 -0
  217. package/src/Components/Icons/Loop.js +17 -0
  218. package/src/Components/Icons/Loop1.js +18 -0
  219. package/src/Components/Icons/LoopAll.js +18 -0
  220. package/src/Components/Icons/Maximize.js +14 -0
  221. package/src/Components/Icons/Microphone.js +14 -0
  222. package/src/Components/Icons/Minimize.js +14 -0
  223. package/src/Components/Icons/Minus.js +18 -0
  224. package/src/Components/Icons/MobileScreenButton.js +14 -0
  225. package/src/Components/Icons/MoneyBill.js +14 -0
  226. package/src/Components/Icons/MoneyBillWave.js +14 -0
  227. package/src/Components/Icons/Mouth.js +24 -0
  228. package/src/Components/Icons/Music.js +14 -0
  229. package/src/Components/Icons/NoLoop.js +24 -0
  230. package/src/Components/Icons/NoReorderRows.js +25 -0
  231. package/src/Components/Icons/ObjectGroupRegular.js +14 -0
  232. package/src/Components/Icons/Pause.js +14 -0
  233. package/src/Components/Icons/Pencil.js +18 -0
  234. package/src/Components/Icons/Phone.js +14 -0
  235. package/src/Components/Icons/Play.js +14 -0
  236. package/src/Components/Icons/Plus.js +18 -0
  237. package/src/Components/Icons/Presentation.js +19 -0
  238. package/src/Components/Icons/Print.js +18 -0
  239. package/src/Components/Icons/Question.js +14 -0
  240. package/src/Components/Icons/Rate-.25x.js +20 -0
  241. package/src/Components/Icons/Rate-.5x.js +19 -0
  242. package/src/Components/Icons/Rate-.75x.js +19 -0
  243. package/src/Components/Icons/Rate-1.25x.js +20 -0
  244. package/src/Components/Icons/Rate-1.5x.js +19 -0
  245. package/src/Components/Icons/Rate-1.75x.js +19 -0
  246. package/src/Components/Icons/Rate-1x.js +19 -0
  247. package/src/Components/Icons/Rate-2x.js +19 -0
  248. package/src/Components/Icons/RateIcon-.25x.js +20 -0
  249. package/src/Components/Icons/RateIcon-.5x.js +19 -0
  250. package/src/Components/Icons/RateIcon-.75x.js +19 -0
  251. package/src/Components/Icons/RateIcon-1.25x.js +20 -0
  252. package/src/Components/Icons/RateIcon-1.5x.js +19 -0
  253. package/src/Components/Icons/RateIcon-1.75x.js +19 -0
  254. package/src/Components/Icons/RateIcon-1x.js +19 -0
  255. package/src/Components/Icons/RateIcon-2x.js +19 -0
  256. package/src/Components/Icons/RectangleXmark.js +14 -0
  257. package/src/Components/Icons/RectangleXmarkRegular.js +14 -0
  258. package/src/Components/Icons/ReorderRows.js +21 -0
  259. package/src/Components/Icons/RightFromBracket.js +14 -0
  260. package/src/Components/Icons/RightToBracket.js +14 -0
  261. package/src/Components/Icons/Rotate.js +18 -0
  262. package/src/Components/Icons/RotateLeft.js +14 -0
  263. package/src/Components/Icons/RotateRight.js +18 -0
  264. package/src/Components/Icons/ScrewdriverWrench.js +14 -0
  265. package/src/Components/Icons/Scroll.js +14 -0
  266. package/src/Components/Icons/Share.js +14 -0
  267. package/src/Components/Icons/Shop.js +14 -0
  268. package/src/Components/Icons/SortDown.js +18 -0
  269. package/src/Components/Icons/SortUp.js +18 -0
  270. package/src/Components/Icons/Square.js +14 -0
  271. package/src/Components/Icons/SquareCheck.js +14 -0
  272. package/src/Components/Icons/SquareCheckRegular.js +14 -0
  273. package/src/Components/Icons/SquareMinus.js +18 -0
  274. package/src/Components/Icons/SquareRegular.js +14 -0
  275. package/src/Components/Icons/Store.js +14 -0
  276. package/src/Components/Icons/ThumbsDown.js +14 -0
  277. package/src/Components/Icons/ThumbsDownRegular.js +14 -0
  278. package/src/Components/Icons/ThumbsUp.js +14 -0
  279. package/src/Components/Icons/ThumbsUpRegular.js +14 -0
  280. package/src/Components/Icons/Trash.js +18 -0
  281. package/src/Components/Icons/TrashCan.js +18 -0
  282. package/src/Components/Icons/TriangleExclamation.js +18 -0
  283. package/src/Components/Icons/Truck.js +14 -0
  284. package/src/Components/Icons/TruckFast.js +14 -0
  285. package/src/Components/Icons/User.js +14 -0
  286. package/src/Components/Icons/UserGroup.js +14 -0
  287. package/src/Components/Icons/UserSecret.js +14 -0
  288. package/src/Components/Icons/X.js +14 -0
  289. package/src/Components/Icons/Xmark.js +14 -0
  290. package/src/Components/Mask.js +11 -0
  291. package/src/Components/Messages/ConfirmationMessage.js +26 -0
  292. package/src/Components/Messages/ErrorMessage.js +15 -0
  293. package/src/Components/Messages/Loading.js +16 -0
  294. package/src/Components/Messages/OkMessage.js +24 -0
  295. package/src/Components/Messages/WaitMessage.js +18 -0
  296. package/src/Components/Panel/AccordionGridPanel.js +94 -0
  297. package/src/Components/Panel/Footer.js +20 -0
  298. package/src/Components/Panel/FormPanel.js +23 -0
  299. package/src/Components/Panel/GridPanel.js +45 -0
  300. package/src/Components/Panel/Header.js +107 -0
  301. package/src/Components/Panel/Panel.js +152 -0
  302. package/src/Components/Panel/TabPanel.js +331 -0
  303. package/src/Components/Panel/UploadDownload.js +10 -0
  304. package/src/Components/Picker/Picker.js +64 -0
  305. package/src/Components/ScreenContainer.js +71 -0
  306. package/src/Components/Screens/DataMgt.js +250 -0
  307. package/src/Components/Toolbar/FilterToolbar.js +20 -0
  308. package/src/Components/Toolbar/Pagination.js +146 -0
  309. package/src/Components/Toolbar/PaginationToolbar.js +22 -0
  310. package/src/Components/Toolbar/Toolbar.js +18 -0
  311. package/src/Components/WaitModal.js +31 -0
  312. package/src/Components/Window/Editor.js +19 -0
  313. package/src/Constants/Alert.js +3 -0
  314. package/src/Constants/Date.js +3 -0
  315. package/src/Constants/Directions.js +8 -0
  316. package/src/Constants/EditorTypes.js +4 -0
  317. package/src/Constants/File.js +2 -0
  318. package/src/Constants/Grid.js +4 -0
  319. package/src/Constants/Input.js +1 -0
  320. package/src/Constants/Selection.js +5 -0
  321. package/src/Constants/Styles.js +86 -0
  322. package/src/Constants/UiModes.js +2 -0
  323. package/src/Data/Hoc/withRedux.js +48 -0
  324. package/src/Data/useOneHatData.js +75 -0
  325. package/src/Functions/BankersRound.js +11 -0
  326. package/src/Functions/Timer.js +92 -0
  327. package/src/Functions/deleteSecure.js +6 -0
  328. package/src/Functions/emptyFn.js +1 -0
  329. package/src/Functions/getComponentFromType.js +106 -0
  330. package/src/Functions/getIsMobile.js +5 -0
  331. package/src/Functions/getPref.js +7 -0
  332. package/src/Functions/getSecure.js +21 -0
  333. package/src/Functions/getTokenHeaders.js +13 -0
  334. package/src/Functions/inArray.js +5 -0
  335. package/src/Functions/isJson.js +8 -0
  336. package/src/Functions/processImage.js +16 -0
  337. package/src/Functions/setPref.js +14 -0
  338. package/src/Functions/setProgress.js +49 -0
  339. package/src/Functions/setSecure.js +35 -0
  340. package/src/Functions/setUiMode.js +5 -0
  341. package/src/Functions/sleep.js +3 -0
  342. package/src/Functions/testProps.js +24 -0
  343. package/src/Functions/trackEngagementHit.js +11 -0
  344. package/src/Functions/verifyCompleted.js +18 -0
  345. package/src/Functions/waitFor.js +16 -0
  346. package/src/Hooks/useAppState.js +34 -0
  347. package/src/Hooks/useAsync.js +13 -0
  348. package/src/Hooks/useBlocking.js +18 -0
  349. package/src/Hooks/useCameraRoll.js +41 -0
  350. package/src/Hooks/useForceUpdate.js +14 -0
  351. package/src/Hooks/useIsMounted.js +14 -0
  352. package/src/Hooks/useNotifications.js +279 -0
  353. package/src/Styles/StyleSheets.js +14 -0
  354. package/src/Styles/ThemeOverrides.js +264 -0
  355. package/src/UiConfig.js +19 -0
@@ -0,0 +1,14 @@
1
+ // Font Awesome Pro 6.2.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc.
2
+ import * as React from "react"
3
+ import Svg, { Path } from "react-native-svg"
4
+ import { Icon } from 'native-base';
5
+
6
+ function SvgComponent(props) {
7
+ return (
8
+ <Icon xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512" {...props}>
9
+ <Path d="M48 0C21.5 0 0 21.5 0 48v320c0 26.5 21.5 48 48 48h16c0 53 43 96 96 96s96-43 96-96h128c0 53 43 96 96 96s96-43 96-96h32c17.7 0 32-14.3 32-32s-14.3-32-32-32V237.3c0-17-6.7-33.3-18.7-45.3L512 114.7c-12-12-28.3-18.7-45.3-18.7H416V48c0-26.5-21.5-48-48-48H48zm368 160h50.7l77.3 77.3V256H416v-96zM208 416c0 26.5-21.5 48-48 48s-48-21.5-48-48 21.5-48 48-48 48 21.5 48 48zm272 48c-26.5 0-48-21.5-48-48s21.5-48 48-48 48 21.5 48 48-21.5 48-48 48z" />
10
+ </Icon>
11
+ )
12
+ }
13
+
14
+ export default SvgComponent
@@ -0,0 +1,14 @@
1
+ // Font Awesome Pro 6.2.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc.
2
+ import * as React from "react"
3
+ import Svg, { Path } from "react-native-svg"
4
+ import { Icon } from 'native-base';
5
+
6
+ function SvgComponent(props) {
7
+ return (
8
+ <Icon xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512" {...props}>
9
+ <Path d="M112 0C85.5 0 64 21.5 64 48v48H16c-8.8 0-16 7.2-16 16s7.2 16 16 16h256c8.8 0 16 7.2 16 16s-7.2 16-16 16H48c-8.8 0-16 7.2-16 16s7.2 16 16 16h192c8.8 0 16 7.2 16 16s-7.2 16-16 16H16c-8.8 0-16 7.2-16 16s7.2 16 16 16h192c8.8 0 16 7.2 16 16s-7.2 16-16 16H64v128c0 53 43 96 96 96s96-43 96-96h128c0 53 43 96 96 96s96-43 96-96h32c17.7 0 32-14.3 32-32s-14.3-32-32-32V237.3c0-17-6.7-33.3-18.7-45.3L512 114.7c-12-12-28.3-18.7-45.3-18.7H416V48c0-26.5-21.5-48-48-48H112zm432 237.3V256H416v-96h50.7l77.3 77.3zM160 464c-26.5 0-48-21.5-48-48s21.5-48 48-48 48 21.5 48 48-21.5 48-48 48zm368-48c0 26.5-21.5 48-48 48s-48-21.5-48-48 21.5-48 48-48 48 21.5 48 48z" />
10
+ </Icon>
11
+ )
12
+ }
13
+
14
+ export default SvgComponent
@@ -0,0 +1,14 @@
1
+ // Font Awesome Pro 6.2.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc.
2
+ import * as React from "react"
3
+ import Svg, { Path } from "react-native-svg"
4
+ import { Icon } from 'native-base';
5
+
6
+ function SvgComponent(props) {
7
+ return (
8
+ <Icon xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" {...props}>
9
+ <Path d="M224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm-45.7 48C79.8 304 0 383.8 0 482.3 0 498.7 13.3 512 29.7 512h388.6c16.4 0 29.7-13.3 29.7-29.7 0-98.5-79.8-178.3-178.3-178.3h-91.4z" />
10
+ </Icon>
11
+ )
12
+ }
13
+
14
+ export default SvgComponent
@@ -0,0 +1,14 @@
1
+ // Font Awesome Pro 6.2.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc.
2
+ import * as React from "react"
3
+ import Svg, { Path } from "react-native-svg"
4
+ import { Icon } from 'native-base';
5
+
6
+ function SvgComponent(props) {
7
+ return (
8
+ <Icon xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512" {...props}>
9
+ <Path d="M352 128c0 70.7-57.3 128-128 128S96 198.7 96 128 153.3 0 224 0s128 57.3 128 128zM0 482.3C0 383.8 79.8 304 178.3 304h91.4c98.5 0 178.3 79.8 178.3 178.3 0 16.4-13.3 29.7-29.7 29.7H29.7C13.3 512 0 498.7 0 482.3zM609.3 512H471.4c5.4-9.4 8.6-20.3 8.6-32v-8c0-60.7-27.1-115.2-69.8-151.8 2.4-.1 4.7-.2 7.1-.2h61.4c89.1 0 161.3 72.2 161.3 161.3 0 17-13.8 30.7-30.7 30.7zM432 256c-31 0-59-12.6-79.3-32.9 19.7-26.6 31.3-59.5 31.3-95.1 0-26.8-6.6-52.1-18.3-74.3C384.3 40.1 407.2 32 432 32c61.9 0 112 50.1 112 112s-50.1 112-112 112z" />
10
+ </Icon>
11
+ )
12
+ }
13
+
14
+ export default SvgComponent
@@ -0,0 +1,14 @@
1
+ // Font Awesome Pro 6.2.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc.
2
+ import * as React from "react"
3
+ import Svg, { Path } from "react-native-svg"
4
+ import { Icon } from 'native-base';
5
+
6
+ function SvgComponent(props) {
7
+ return (
8
+ <Icon xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" {...props}>
9
+ <Path d="M224 16c-6.7 0-10.8-2.8-15.5-6.1C201.9 5.4 194 0 176 0c-30.5 0-52 43.7-66 89.4-47.3 8.7-78 22.8-78 38.6 0 14.3 25 27.1 64.6 35.9-.4 4-.6 8-.6 12.1 0 17 3.3 33.2 9.3 48H45.4C38 224 32 230 32 237.4c0 1.7.3 3.4 1 5l38.8 96.9C28.2 371.8 0 423.8 0 482.3 0 498.7 13.3 512 29.7 512h388.6c16.4 0 29.7-13.3 29.7-29.7 0-58.5-28.2-110.4-71.7-143l38.7-96.9c.6-1.6 1-3.3 1-5 0-7.4-6-13.4-13.4-13.4h-59.9c6-14.8 9.3-31 9.3-48 0-4.1-.2-8.1-.6-12.1C391 155.1 416 142.3 416 128c0-15.8-30.7-29.9-78-38.6C324 43.7 302.5 0 272 0c-18 0-25.9 5.4-32.5 9.9-4.7 3.3-8.8 6.1-15.5 6.1zm56 208h-12.4c-16.5 0-31.1-10.6-36.3-26.2-2.3-7-12.2-7-14.5 0-5.2 15.6-19.9 26.2-36.3 26.2H168c-22.1 0-40-17.9-40-40v-14.4c28.2 4.1 61 6.4 96 6.4s67.8-2.3 96-6.4V184c0 22.1-17.9 40-40 40zm-88 96l16 32-32 128-48-192 64 32zm128-32l-48 192-32-128 16-32 64-32z" />
10
+ </Icon>
11
+ )
12
+ }
13
+
14
+ export default SvgComponent
@@ -0,0 +1,14 @@
1
+ // Font Awesome Pro 6.2.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc.
2
+ import * as React from "react"
3
+ import Svg, { Path } from "react-native-svg"
4
+ import { Icon } from 'native-base';
5
+
6
+ function SvgComponent(props) {
7
+ return (
8
+ <Icon xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512" {...props}>
9
+ <Path d="M376.6 84.5c11.3-13.6 9.5-33.8-4.1-45.1s-33.8-9.5-45.1 4.1L192 206 56.6 43.5c-11.3-13.6-31.5-15.4-45.1-4.1S-3.9 70.9 7.4 84.5L150.3 256 7.4 427.5c-11.3 13.6-9.5 33.8 4.1 45.1s33.8 9.5 45.1-4.1L192 306l135.4 162.5c11.3 13.6 31.5 15.4 45.1 4.1s15.4-31.5 4.1-45.1L233.7 256 376.6 84.5z" />
10
+ </Icon>
11
+ )
12
+ }
13
+
14
+ export default SvgComponent
@@ -0,0 +1,14 @@
1
+ // Font Awesome Pro 6.2.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc.
2
+ import * as React from "react"
3
+ import Svg, { Path } from "react-native-svg"
4
+ import { Icon } from 'native-base';
5
+
6
+ function SvgComponent(props) {
7
+ return (
8
+ <Icon xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512" {...props}>
9
+ <Path d="M310.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L160 210.7 54.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L114.7 256 9.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 301.3l105.4 105.3c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L205.3 256l105.3-105.4z" />
10
+ </Icon>
11
+ )
12
+ }
13
+
14
+ export default SvgComponent
@@ -0,0 +1,11 @@
1
+ import {
2
+ Box,
3
+ } from 'native-base';
4
+ import _ from 'lodash';
5
+
6
+ export default function Mask(props) {
7
+ const propsToPass = _.omit(props, 'children');
8
+ return <Box bg="trueGray.400" {...propsToPass} testID="mask">
9
+ {props.children}
10
+ </Box>;
11
+ }
@@ -0,0 +1,26 @@
1
+ import {
2
+ Button,
3
+ Modal,
4
+ Text,
5
+ } from 'native-base';
6
+ import emptyFn from '../../Functions/emptyFn';
7
+
8
+ export default function ConfirmationMessage(props) {
9
+ const {
10
+ textMessage,
11
+ onCancel = emptyFn,
12
+ onOk = emptyFn,
13
+ } = props;
14
+
15
+ return <Modal {...props} _backdrop={{ bg: "#000" }}>
16
+ <Modal.Content maxWidth="400px">
17
+ <Modal.Body p={5} pb={0} borderTopWidth={0}>
18
+ <Text color="#000">{textMessage}</Text>
19
+ </Modal.Body>
20
+ <Modal.Footer p={0} pr={4} borderTopWidth={0}>
21
+ <Button variant="ghost" color="primary.800" onPress={onCancel}>Cancel</Button>
22
+ <Button variant="ghost" color="primary.800" onPress={onOk}>OK</Button>
23
+ </Modal.Footer>
24
+ </Modal.Content>
25
+ </Modal>;
26
+ }
@@ -0,0 +1,15 @@
1
+ import {
2
+ Icon,
3
+ Row,
4
+ Text,
5
+ } from 'native-base';
6
+ import TriangleExclamation from '../Icons/TriangleExclamation';
7
+
8
+ export default function ErrorMsg(props) {
9
+ return <Row justifyContent="center" alignItems="center" my={2} w="100%">
10
+ <Icon as={TriangleExclamation} color="red.500" size="sm" mr={1} />
11
+ <Text color="red.500">
12
+ {props.children}
13
+ </Text>
14
+ </Row>;
15
+ }
@@ -0,0 +1,16 @@
1
+ import {
2
+ Row,
3
+ Spinner,
4
+ } from 'native-base';
5
+ // import ScreenContainer from '../ScreenContainer';
6
+
7
+ export default function Loading(props) {
8
+ // if (props.isScreen) {
9
+ // return <ScreenContainer {...props}>
10
+ // <Spinner flex={1} color="primary.500" />
11
+ // </ScreenContainer>;
12
+ // }
13
+ return <Row justifyContent="center" minHeight={100} {...props}>
14
+ <Spinner flex={1} color="primary.500" />
15
+ </Row>;
16
+ }
@@ -0,0 +1,24 @@
1
+ import {
2
+ Button,
3
+ Modal,
4
+ Row,
5
+ Text,
6
+ } from 'native-base';
7
+
8
+ export default function OkMessage(props) {
9
+ const {
10
+ textMessage,
11
+ onClose,
12
+ } = props;
13
+
14
+ return <Modal {...props} _backdrop={{ bg: "#000" }}>
15
+ <Modal.Content maxWidth="400px">
16
+ <Modal.Body p={5} pb={0} borderTopWidth={0}>
17
+ <Text color="#000">{textMessage}</Text>
18
+ </Modal.Body>
19
+ <Modal.Footer p={0} pr={4} borderTopWidth={0}>
20
+ <Button variant="ghost" color="primary.800" onPress={onClose}>OK</Button>
21
+ </Modal.Footer>
22
+ </Modal.Content>
23
+ </Modal>;
24
+ }
@@ -0,0 +1,18 @@
1
+ import {
2
+ Row,
3
+ Text,
4
+ } from 'native-base';
5
+ import Loading from './Loading';
6
+
7
+ export default function WaitMessage(props) {
8
+ const {
9
+ textMessage = 'Please wait...',
10
+ } = props;
11
+
12
+ return <Row position="absolute" width="100%" top="40" left="0" _backdrop={{ bg: "#000" }} justifyContent="center" alignItems="center" pb={20} {...props}>
13
+ <Row bg="#fff" p={3} width="50%" justifyContent="center" alignItems="center" borderColor="#000" borderRadius={5}>
14
+ <Loading minHeight="auto" h={5} w={5} mr={2} />
15
+ <Text color="#000">{textMessage}</Text>
16
+ </Row>
17
+ </Row>;
18
+ }
@@ -0,0 +1,94 @@
1
+ import { useState, } from 'react';
2
+ import {
3
+ Column,
4
+ ScrollView,
5
+ } from 'native-base';
6
+ import Accordion from 'react-native-collapsible/Accordion'; // https://www.npmjs.com/package/react-native-collapsible
7
+ import testProps from '../../Functions/testProps';
8
+ import Footer from './Footer';
9
+ import Toolbar from '../Toolbar/Toolbar';
10
+ import PaginationToolbar from '../Toolbar/PaginationToolbar';
11
+ import NoRecordsFound from './NoRecordsFound';
12
+ import GridPanel from './GridPanel';
13
+ import _ from 'lodash';
14
+
15
+ export default function AccordionGridPanel(props) {
16
+
17
+ // const {
18
+ // sections = [],
19
+ // Repository = null,
20
+ // topToolbar = null,
21
+ // bottomToolbar = 'pagination',
22
+ // columns = [],
23
+ // getRowProps = () => {
24
+ // return {
25
+ // bg: '#fff',
26
+ // p: 2,
27
+ // };
28
+ // },
29
+ // renderSectionHeader = (section, ix, isActive) => {},
30
+ // onChangeSelection = () => {},
31
+ // noneFoundText,
32
+ // containerStyle = {},
33
+ // hideRightColumn = false,
34
+ // activeSectionIndexes = [0],
35
+ // } = props,
36
+ // [activeSections, setActiveSections] = useState(activeSectionIndexes);
37
+
38
+ // return <Column
39
+ // {...testProps('AccorionGridPanel')}
40
+ // flex={1}
41
+ // w="100%"
42
+ // {...containerStyle}
43
+ // >
44
+ // {topToolbar && <Toolbar>{topToolbar}</Toolbar>}
45
+
46
+ // <ScrollView
47
+ // keyboardShouldPersistTaps="always"
48
+ // flex={1}
49
+ // w="100%"
50
+ // >
51
+ // <Accordion
52
+ // activeSections={activeSections}
53
+ // sections={sections}
54
+ // onChange={setActiveSections}
55
+ // renderHeader={renderSectionHeader}
56
+ // renderContent={(section) => {
57
+ // if (!section.data.length) {
58
+ // return <NoRecordsFound text={noneFoundText} />;
59
+ // }
60
+ // return <GridPanel
61
+ // flatListProps={{
62
+ // scrollEnabled: false,
63
+ // ...testProps(section.title),
64
+ // }}
65
+ // noneFoundText="No items found."
66
+ // Repository={{ // Simulated repository
67
+ // entities: section.data,
68
+ // schema: section.schema,
69
+ // }}
70
+ // flex={1}
71
+ // w="100%"
72
+ // getRowProps={getRowProps}
73
+ // pullToRefresh={false}
74
+ // columns={columns}
75
+ // onChangeSelection={onChangeSelection}
76
+ // bottomToolbar={false}
77
+ // hideRightColumn={hideRightColumn}
78
+ // />;
79
+ // }}
80
+ // />
81
+ // </ScrollView>
82
+
83
+ // {bottomToolbar && (bottomToolbar !== 'pagination' || Repository.entities.length > 5) && /* Only show pagination toolbar if >5 items to display */ (
84
+ // <Footer>
85
+ // {(
86
+ // bottomToolbar === 'pagination' ?
87
+ // <PaginationToolbar Repository={Repository} /> :
88
+ // <Toolbar>{bottomToolbar}</Toolbar>
89
+ // )}
90
+ // </Footer>
91
+ // )}
92
+ // </Column>;
93
+ }
94
+
@@ -0,0 +1,20 @@
1
+ import {
2
+ Row,
3
+ } from 'native-base';
4
+ import styles from '../../Constants/Styles';
5
+
6
+ export default function Footer(props) {
7
+ return <Row
8
+ alignItems="center"
9
+ justifyContent="center"
10
+ alignSelf="flex-end"
11
+ bg={styles.PANEL_FOOTER_BG}
12
+ testID="footer"
13
+ w="100%"
14
+ p={2}
15
+ safeAreaBottom
16
+ {...props}
17
+ >
18
+ {props.children}
19
+ </Row>;
20
+ }
@@ -0,0 +1,23 @@
1
+ import {
2
+ Text,
3
+ } from 'native-base';
4
+ import Panel from './Panel';
5
+ import Form, { FormEditor } from '../Form/Form';
6
+ import withData from '../Hoc/withData';
7
+ import _ from 'lodash';
8
+
9
+ export function FormPanel(props) {
10
+ const {
11
+ instructions,
12
+ isEditor = false,
13
+ _panel = {},
14
+ _form = {},
15
+ } = props,
16
+ WhichForm = isEditor ? FormEditor : Form;
17
+ return <Panel isCollapsible={false} {...props} {..._panel}>
18
+ {instructions && <Text px={5} pt={3} fontStyle="italic">{instructions}</Text>}
19
+ <WhichForm px={3} pt={6} {...props} {..._form}/>
20
+ </Panel>;
21
+ }
22
+
23
+ export default withData(FormPanel);
@@ -0,0 +1,45 @@
1
+ import { useEffect, useState, } from 'react';
2
+ import Panel from './Panel';
3
+ import Grid, { InlineGridEditor, } from '../Grid/Grid';
4
+ import {
5
+ EDITOR_TYPE_INLINE,
6
+ EDITOR_TYPE_WINDOWED,
7
+ } from '../../Constants/EditorTypes';
8
+ import _ from 'lodash';
9
+
10
+ export function GridPanel(props) {
11
+ const {
12
+ editorType,
13
+ disableTitleChange = false,
14
+ selectorSelected,
15
+ } = props,
16
+ originalTitle = props.title,
17
+ WhichGrid = (editorType === EDITOR_TYPE_INLINE) ? InlineGridEditor : Grid,
18
+ [isReady, setIsReady] = useState(disableTitleChange),
19
+ [title, setTitle] = useState(originalTitle);
20
+
21
+ useEffect(() => {
22
+ if (!disableTitleChange && originalTitle) {
23
+ let newTitle = originalTitle;
24
+ if (selectorSelected?.[0]?.displayValue) {
25
+ newTitle = originalTitle + ' for ' + selectorSelected[0].displayValue;
26
+ }
27
+ if (newTitle !== title) {
28
+ setTitle(newTitle);
29
+ }
30
+ }
31
+ if (!isReady) {
32
+ setIsReady(true);
33
+ }
34
+ }, [selectorSelected, disableTitleChange, originalTitle]);
35
+
36
+ if (!isReady) {
37
+ return null;
38
+ }
39
+
40
+ return <Panel {...props} title={title}>
41
+ <WhichGrid {...props} />
42
+ </Panel>;
43
+ }
44
+
45
+ export default GridPanel;
@@ -0,0 +1,107 @@
1
+ import React from 'react';
2
+ import {
3
+ Column,
4
+ Row,
5
+ Text,
6
+ } from 'native-base';
7
+ import {
8
+ FaTimes,
9
+ FaMinus,
10
+ FaPlus,
11
+ } from 'react-icons/fa';
12
+ import {
13
+ HORIZONTAL,
14
+ VERTICAL,
15
+ } from '../../Constants/Directions';
16
+ import {
17
+ UI_MODE_WEB,
18
+ UI_MODE_REACT_NATIVE,
19
+ } from '../../Constants/UiModes';
20
+ import UiConfig from '../../UiConfig';
21
+ import styles from '../../Constants/Styles';
22
+ import emptyFn from '../../Functions/emptyFn';
23
+ import IconButton from '../Buttons/IconButton';
24
+
25
+ export default function Header(props) {
26
+
27
+ if (UiConfig.mode === UI_MODE_REACT_NATIVE) {
28
+ throw new Error('Not yet implemented for RN.');
29
+ }
30
+
31
+ const {
32
+ testID = 'Header',
33
+ title = '',
34
+ isClosable = true,
35
+ onClose = emptyFn,
36
+ isCollapsible = true,
37
+ collapseDirection = VERTICAL,
38
+ isCollapsed = false,
39
+ onToggleCollapse = emptyFn,
40
+ } = props;
41
+
42
+ let closeBtn = null,
43
+ collapseBtn = null;
44
+ if (isClosable) {
45
+ closeBtn = <IconButton
46
+ icon={<FaTimes size={styles.PANEL_HEADER_ICON_SIZE} color={styles.HEADER_ICON_COLOR} />}
47
+ onPress={onClose}
48
+ testID="closeBtn"
49
+ alignSelf="center"
50
+ mr={1}
51
+ />;
52
+ }
53
+ if (isCollapsible) {
54
+ collapseBtn = <IconButton
55
+ icon={isCollapsed ? <FaPlus size={styles.PANEL_HEADER_ICON_SIZE} color={styles.HEADER_ICON_COLOR} /> : <FaMinus size={styles.PANEL_HEADER_ICON_SIZE} color={styles.HEADER_ICON_COLOR} />}
56
+ onPress={onToggleCollapse}
57
+ testID="collapseBtn"
58
+ alignSelf="center"
59
+ ml={1}
60
+ h="20px"
61
+ w="30px"
62
+ />;
63
+ }
64
+
65
+ const doubleClickStyle = {};
66
+ if (isCollapsible) {
67
+ doubleClickStyle.cursor = 'pointer';
68
+ }
69
+
70
+ if (isCollapsed) {
71
+ if (collapseDirection === HORIZONTAL) {
72
+ collapseBtn = React.cloneElement(collapseBtn, { my: 2, mr: 1, });
73
+ return <div
74
+ className="header"
75
+ style={{ flex: 1, width: '100%', userSelect: 'none', ...doubleClickStyle, }}
76
+ onClick={(e) => {
77
+ if (isCollapsible && e.detail === 2) { // double-click
78
+ onToggleCollapse(e);
79
+ }
80
+ }}
81
+ >
82
+ <Column alignItems="center" justifyContent="flex-start" h="100%" w="100%" bg={styles.PANEL_HEADER_BG_VERTICAL} style={{ userSelect: 'none', }} testID={testID}>
83
+ {collapseBtn}
84
+ <div style={{ textOrientation: 'mixed', writingMode: 'vertical-rl', }}>
85
+ <Text flex={1} fontSize={styles.PANEL_HEADER_TEXT_FONTSIZE} color={styles.PANEL_HEADER_TEXT_COLOR} numberOfLines={1} ellipsizeMode="head" testID="text">{title}</Text>
86
+ </div>
87
+ </Column>
88
+ </div>;
89
+ }
90
+ }
91
+
92
+ return <div
93
+ className="header"
94
+ style={{ width: '100%', userSelect: 'none', ...doubleClickStyle, }}
95
+ onClick={(e) => {
96
+ if (isCollapsible && e.detail === 2) { // double-click
97
+ onToggleCollapse(e);
98
+ }
99
+ }}
100
+ >
101
+ <Row alignItems="center" justifyContent="flex-start" px={styles.PANEL_HEADER_PX} py={styles.PANEL_HEADER_PY} bg={styles.PANEL_HEADER_BG} style={{ userSelect: 'none', }} testID={testID}>
102
+ {closeBtn}
103
+ <Text flex={1} fontSize={styles.PANEL_HEADER_TEXT_FONTSIZE} color={styles.PANEL_HEADER_TEXT_COLOR} numberOfLines={1} ellipsizeMode="head" testID="text">{title}</Text>
104
+ {collapseBtn}
105
+ </Row>
106
+ </div>;
107
+ }
@@ -0,0 +1,152 @@
1
+ import { useState, } from 'react';
2
+ import {
3
+ Column,
4
+ Row,
5
+ ScrollView,
6
+ Text,
7
+ } from 'native-base';
8
+ import {
9
+ HORIZONTAL,
10
+ VERTICAL,
11
+ } from '../../Constants/Directions';
12
+ import {
13
+ UI_MODE_WEB,
14
+ UI_MODE_REACT_NATIVE,
15
+ } from '../../Constants/UiModes';
16
+ import UiConfig from '../../UiConfig';
17
+ import Header from './Header';
18
+ import withCollapsible from '../Hoc/withCollapsible';
19
+ import emptyFn from '../../Functions/emptyFn';
20
+ import _ from 'lodash';
21
+
22
+ // Note on collapseDirections:
23
+ // HORIZONTAL means the Panel collapses along the X axis.
24
+ // VERTICAL means the Panel collapses along the Y axis.
25
+
26
+ function Panel(props) {
27
+
28
+ if (UiConfig.mode === UI_MODE_REACT_NATIVE) {
29
+ throw new Error('Not yet implemented for RN.');
30
+ }
31
+ const {
32
+ isDisabled = false,
33
+ frame = false,
34
+ isScrollable = false,
35
+ h,
36
+ maxHeight,
37
+ w,
38
+ maxWidth,
39
+ flex,
40
+ onLayout = null,
41
+
42
+ // Header
43
+ title = props.model,
44
+ titleSuffix = '',
45
+ showHeader = true,
46
+ header = null,
47
+ isClosable = false,
48
+ onClose = emptyFn,
49
+ isCollapsible = true,
50
+ isCollapsed = false,
51
+ setIsCollapsed,
52
+ collapseDirection = VERTICAL, // HORIZONTAL, VERTICAL
53
+
54
+ // Content
55
+ topToolbar = null,
56
+ children = null,
57
+ bottomToolbar = null,
58
+ footer = null,
59
+
60
+ ...propsToPass
61
+ } = props,
62
+ onToggleCollapse = () => {
63
+ setIsCollapsed(!isCollapsed);
64
+ };
65
+
66
+ let headerComponent = header;
67
+ if (showHeader && title) {
68
+ headerComponent = <Header
69
+ title={title + titleSuffix}
70
+ isClosable={isClosable}
71
+ onClose={onClose}
72
+ isCollapsible={isCollapsible}
73
+ isCollapsed={isCollapsed}
74
+ collapseDirection={collapseDirection}
75
+ onToggleCollapse={onToggleCollapse}
76
+ />;
77
+ }
78
+
79
+ const sizeProps = {};
80
+ if (!flex && !h && !w) {
81
+ sizeProps.flex = 1;
82
+ } else {
83
+ if (h) {
84
+ sizeProps.h = h;
85
+ }
86
+ if (w) {
87
+ sizeProps.w = w;
88
+ }
89
+ if (flex) {
90
+ sizeProps.flex = flex;
91
+ }
92
+ }
93
+ if (maxWidth) {
94
+ sizeProps.maxWidth = maxWidth;
95
+ }
96
+ if (maxHeight) {
97
+ sizeProps.maxHeight = maxHeight;
98
+ }
99
+ // if (propsToPass.h && isCollapsed) {
100
+ // delete propsToPass.h;
101
+ // }
102
+
103
+ const
104
+ borderProps = {
105
+ borderTopColor: 'primary.600',
106
+ borderBottomColor: 'primary.600',
107
+ borderLeftColor: 'primary.600',
108
+ borderRightColor: 'primary.600',
109
+ },
110
+ nonFrameProps = {
111
+ ...borderProps,
112
+ borderTopWidth: 1,
113
+ borderBottomWidth: 1,
114
+ borderLeftWidth: 1,
115
+ borderRightWidth: 1,
116
+ },
117
+ frameProps = {
118
+ ...borderProps,
119
+ borderTopWidth: 3,
120
+ borderBottomWidth: 3,
121
+ borderLeftWidth: 3,
122
+ borderRightWidth: 3,
123
+ };
124
+ let framePropsToUse = nonFrameProps;
125
+ if (frame) {
126
+ framePropsToUse = frameProps;
127
+ }
128
+ if (isCollapsed) {
129
+ if (collapseDirection !== VERTICAL) {
130
+ return <Column overflow="hidden" {...framePropsToUse} w="33px" height="100%">
131
+ {isDisabled && <div className="mask"></div>}
132
+ {headerComponent}
133
+ </Column>;
134
+ }
135
+ return <Column overflow="hidden" {...framePropsToUse}>
136
+ {isDisabled && <div className="mask"></div>}
137
+ {headerComponent}
138
+ </Column>;
139
+ }
140
+ return <Column overflow="hidden" onLayout={onLayout} {...framePropsToUse} {...sizeProps}>
141
+ {isDisabled && <div className="mask"></div>}
142
+ {headerComponent}
143
+ {topToolbar}
144
+ <Column flex={1} w="100%" overflow="hidden" {...propsToPass}>
145
+ {isScrollable ? <ScrollView>{children}</ScrollView> : children}
146
+ </Column>
147
+ {bottomToolbar}
148
+ {footer}
149
+ </Column>;
150
+ }
151
+
152
+ export default withCollapsible(Panel);