@onehat/ui 0.1.3 → 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
package/package.json CHANGED
@@ -1,16 +1,11 @@
1
1
  {
2
2
  "name": "@onehat/ui",
3
- "version": "0.1.3",
3
+ "version": "0.2.0",
4
4
  "description": "Base UI for OneHat apps",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
7
7
  "scripts": {
8
- "test": "npx cypress open --config-file ../cypress.json",
9
- "docs": "jsdoc -c ./jsdoc.json -t ./node_modules/ink-docstrap/template -R README.md"
10
- },
11
- "repository": {
12
- "type": "git",
13
- "url": "git+https://github.com/OneHatRepo/ui.git"
8
+ "test": "npx cypress open --config-file ../cypress.json"
14
9
  },
15
10
  "keywords": [
16
11
  "onehat",
@@ -22,34 +17,35 @@
22
17
  "company": "OneHat Technologies, LLC",
23
18
  "url": "https://onehat.com"
24
19
  },
25
- "license": "MIT",
26
- "bugs": {
27
- "url": "https://github.com/OneHatRepo/ui/issues"
28
- },
29
- "homepage": "https://github.com/OneHatRepo/ui#readme",
20
+ "license": "UNLICENSED",
30
21
  "dependencies": {
31
- "@onehat/data": "^1.8.27",
32
- "@sencha/sencha-grid": "^2.0.3",
22
+ "@ckeditor/ckeditor5-react": "^5.0.6",
23
+ "@onehat/data": "^1.13.6",
24
+ "browser-or-node": "^2.1.1",
25
+ "ckeditor5-custom-build": "file:ckeditor5",
33
26
  "js-cookie": "^3.0.1",
34
27
  "native-base": "^3.4.25",
35
- "react-hook-form": "^7.40.0"
28
+ "react-hook-form": "^7.43.1"
36
29
  },
37
30
  "peerDependencies": {
38
31
  "react": "*",
32
+ "react-color": "^2.19.3",
33
+ "react-datetime": "^3.2.0",
34
+ "react-draggable": "^4.4.5",
39
35
  "react-dom": "*",
40
36
  "react-native": "*"
41
37
  },
42
38
  "devDependencies": {
43
- "@babel/core": "^7.20.5",
44
- "@babel/node": "^7.20.5",
39
+ "@babel/core": "^7.21.0",
40
+ "@babel/node": "^7.20.7",
45
41
  "@babel/plugin-proposal-class-properties": "^7.18.6",
46
- "@babel/plugin-transform-runtime": "^7.19.6",
42
+ "@babel/plugin-transform-runtime": "^7.21.0",
47
43
  "@babel/preset-env": "^7.20.2",
48
- "@babel/register": "^7.18.9",
49
- "@babel/runtime": "^7.20.6",
50
- "@cypress/webpack-preprocessor": "^5.15.7",
51
- "babel-loader": "^9.1.0",
52
- "cypress": "^12.1.0",
44
+ "@babel/register": "^7.21.0",
45
+ "@babel/runtime": "^7.21.0",
46
+ "@cypress/webpack-preprocessor": "^5.17.0",
47
+ "babel-loader": "^9.1.2",
48
+ "cypress": "^12.6.0",
53
49
  "webpack": "^5.75.0"
54
50
  }
55
51
  }
@@ -0,0 +1,144 @@
1
+ import { useState, useEffect, useRef, } from 'react';
2
+ import {
3
+ Box,
4
+ Column,
5
+ Pressable,
6
+ Row,
7
+ ScrollView,
8
+ Text,
9
+ } from 'native-base';
10
+ import inArray from '../../Functions/inArray';
11
+ import emptyFn from '../../Functions/emptyFn';
12
+ import _ from 'lodash';
13
+
14
+ // The Accordion has two modes.
15
+ // In the first (onlyOne), only one section can be expanded at a time.
16
+ // Otherwise, any section can be expanded—multiple at a time.
17
+ // In the first, the section which is newly expanded will scroll to the top,
18
+ // and extra padding down below will be added. In the other mode,
19
+ // no auto scrolling will take place
20
+ //
21
+ // If you want to scroll in the second mode…
22
+ // Every time I expand or collapse a section, get the new height of each section.
23
+ // That way you can still calculate the top position for any sections scrolling
24
+ // Might be able to do a delta since last calsulation.
25
+
26
+ export default function Accordion(props) {
27
+ const {
28
+ sections = [],
29
+ activeSections = [],
30
+ setActiveSections = emptyFn,
31
+ renderHeader = emptyFn,
32
+ renderContent = emptyFn,
33
+ onAnimationEnd = emptyFn,
34
+ onLayout,
35
+ onlyOne = true,
36
+ ...propsToPass
37
+ } = props,
38
+ scrollViewRef = useRef(),
39
+ refs = {},
40
+ [isRendered, setIsRendered] = useState(false),
41
+ [containerInitialHeight, setContainerInitialHeight] = useState(0),
42
+ sectionHeight = containerInitialHeight / (sections?.length || 1), // protect against divide by zero
43
+ calculateExtraPadding = () => {
44
+ // this adds extra padding to the bottom, depending on what's active
45
+ // so that scrollTo can scroll the active header all the way downto the top
46
+ let extraPadding = 0;
47
+ const activeIx = activeSections[0];
48
+ if (isRendered && activeIx) {
49
+ // when the first section is active, we don't need to add any padding.
50
+ // For each subsequent section, we need to add more and more padding
51
+ // until when the last section is active, we need to add padding equal to
52
+ // the container height
53
+ extraPadding = (activeIx +2) * sectionHeight;
54
+ }
55
+ return extraPadding;
56
+ },
57
+ items = _.map(sections, (section, ix) => {
58
+
59
+ const itemVar = 'item' + ix;
60
+ refs[itemVar] = useRef(); // so we have refs for each section - e.g. refs.item0
61
+
62
+ const
63
+ isActive = inArray(ix, activeSections),
64
+ header = renderHeader(section, ix, isActive),
65
+ content = renderContent(section, ix, isActive, refs[itemVar]),
66
+ rowProps = {};
67
+
68
+ // TODO: Animate height. Possible help here: https://stackoverflow.com/a/57333550 and https://stackoverflow.com/a/64797961
69
+ if (isActive) {
70
+ rowProps.flex = 1;
71
+ } else {
72
+ rowProps.h = 0;
73
+ rowProps.overflow = 'hidden'; // otherwise some elements mistakenly show
74
+ }
75
+
76
+ return <Column key={ix}>
77
+ <Pressable
78
+ onPress={(e) => {
79
+ let newActiveSections = [];
80
+ if (onlyOne) {
81
+ if (!isActive) {
82
+ newActiveSections = [ix];
83
+ }
84
+ } else {
85
+ if (isActive) {
86
+ newActiveSections = _.without(activeSections, ix);
87
+ } else {
88
+ newActiveSections = _.clone(activeSections);
89
+ newActiveSections.push(ix);
90
+ }
91
+ }
92
+ setActiveSections(newActiveSections);
93
+ }}
94
+ >
95
+ {header}
96
+ </Pressable>
97
+ <Row {...rowProps} bg="#f00">
98
+ {content}
99
+ </Row>
100
+ </Column>;
101
+ });
102
+
103
+ useEffect(() => {
104
+ if (!isRendered) {
105
+ return () => {};
106
+ }
107
+ if (!onlyOne) {
108
+ return () => {}; // Don't animate if !onlyOne
109
+ }
110
+
111
+ const
112
+ scrollView = scrollViewRef.current,
113
+ activeIx = activeSections[0];
114
+
115
+ let scrollTo = 0;
116
+ if (activeSections?.length && sections?.length) {
117
+ scrollTo = sectionHeight * activeIx;
118
+ }
119
+ setTimeout(()=> {
120
+ scrollView.scrollTo({ x: 0, y: scrollTo, animated: true });
121
+ }, 10); // delay so render can finish
122
+
123
+ }, [activeSections, isRendered]);
124
+
125
+ return <ScrollView ref={scrollViewRef} keyboardShouldPersistTaps="always" flex={1} w="100%">
126
+ <Column
127
+ {...propsToPass}
128
+ pb={(onlyOne ? calculateExtraPadding() : 0) + 'px'}
129
+ onLayout={(e) => {
130
+ if (!containerInitialHeight) {
131
+ const { height } = e.nativeEvent.layout;
132
+ setContainerInitialHeight(height);
133
+ console.log('height', height);
134
+ }
135
+ if (onLayout) {
136
+ onLayout(e);
137
+ }
138
+ setIsRendered(true);
139
+ }}
140
+ >
141
+ {items}
142
+ </Column>
143
+ </ScrollView>;
144
+ }
@@ -0,0 +1,14 @@
1
+ import {
2
+ Box,
3
+ } from 'native-base';
4
+ import _ from 'lodash';
5
+
6
+ export default function Blank(props) {
7
+ const {
8
+ children,
9
+ ...propsToPass
10
+ } = props;
11
+ return <Box {...propsToPass}>
12
+ {children}
13
+ </Box>;
14
+ }
@@ -0,0 +1,16 @@
1
+ import {
2
+ Icon,
3
+ Pressable,
4
+ Text,
5
+ } from 'native-base';
6
+ import AngleLeft from '../Icons/AngleLeft';
7
+ import { goBack } from '../../RootNavigation';
8
+ import testProps from '../../Functions/testProps';
9
+
10
+ export default function BackButton(props) {
11
+ return <Pressable onPress={props.goBack || goBack} flexDirection="row" justifyContent="flex-start" alignItems="center" pr={5} {...testProps('backBtn')}>
12
+ <Icon as={AngleLeft} color="#2563eb" size="sm" />
13
+ <Text fontSize={20} color="#2563eb" left={-1}>Back</Text>
14
+ </Pressable>;
15
+ }
16
+
@@ -0,0 +1,25 @@
1
+ import {
2
+ Badge,
3
+ Icon,
4
+ Pressable,
5
+ Text,
6
+ } from 'native-base';
7
+ import {
8
+ Ionicons,
9
+ } from '@expo/vector-icons';
10
+ import testProps from '../../Functions/testProps';
11
+
12
+ export default function CartButtonWithBadge(props) {
13
+ const {
14
+ badgeMsg,
15
+ onPress,
16
+ } = props;
17
+ return <Pressable onPress={onPress} flexDirection="row" justifyContent="center" pr={5} {...testProps('cartBtn')}>
18
+ <Icon as={Ionicons} name="cart" color="primary.800" size="xl" pb={1} />
19
+ {badgeMsg > 0 &&
20
+ <Badge position="absolute" right={2} top={-10} colorScheme="danger" rounded="20px" variant="solid" {...testProps('cartBadge')}>
21
+ <Text fontSize={12} fontWeight="bold" color="lightText">{badgeMsg}</Text>
22
+ </Badge>}
23
+ </Pressable>
24
+ }
25
+
@@ -0,0 +1,42 @@
1
+ import React from 'react';
2
+ import {
3
+ Icon,
4
+ Pressable,
5
+ Spinner,
6
+ Tooltip,
7
+ } from 'native-base';
8
+
9
+ const IconButton = React.forwardRef((props, ref) => {
10
+ const {
11
+ // _icon, // props for the icon component
12
+ // icon, // The actual icon component to use
13
+ _spinner,
14
+ isLoading = false,
15
+ tooltip,
16
+ tooltipPlacement = 'bottom',
17
+ } = props;
18
+ const propsIcon = props._icon || {};
19
+ let icon = props.icon || <Icon {...propsIcon} />;
20
+ if (isLoading) {
21
+ icon = <Spinner {..._spinner} />;
22
+ }
23
+ const pressable = <Pressable
24
+ ref={ref}
25
+ borderRadius="md"
26
+ colorScheme="primary"
27
+ flexDirection="row"
28
+ justifyContent="center"
29
+ alignItems="center"
30
+ p={2}
31
+ {...props}
32
+ >
33
+ {icon}
34
+ </Pressable>;
35
+ let ret = pressable;
36
+ if (tooltip) {
37
+ ret = <Tooltip label={tooltip} placement={tooltipPlacement}>{pressable}</Tooltip>;
38
+ }
39
+ return ret;
40
+ });
41
+
42
+ export default IconButton;
@@ -0,0 +1,178 @@
1
+ import React, { useState, } from 'react';
2
+ import {
3
+ Column,
4
+ Row,
5
+ } from 'native-base';
6
+ import {
7
+ HORIZONTAL,
8
+ VERTICAL,
9
+ } from '../../Constants/Directions';
10
+ import Splitter from './Splitter';
11
+
12
+ export default function Container(props) {
13
+ const {
14
+ center,
15
+ north,
16
+ south,
17
+ east,
18
+ west,
19
+
20
+ isNorthCollapsed,
21
+ setIsNorthCollapsed,
22
+ isSouthCollapsed,
23
+ setIsSouthCollapsed,
24
+ isEastCollapsed,
25
+ setIsEastCollapsed,
26
+ isWestCollapsed,
27
+ setIsWestCollapsed,
28
+ } = props,
29
+ [localIsNorthCollapsed, setLocalIsNorthCollapsed] = useState(north ? north.props.startsCollapsed : false),
30
+ [localIsSouthCollapsed, setLocalIsSouthCollapsed] = useState(south ? south.props.startsCollapsed : false),
31
+ [localIsEastCollapsed, setLocalIsEastCollapsed] = useState(east ? east.props.startsCollapsed : false),
32
+ [localIsWestCollapsed, setLocalIsWestCollapsed] = useState(west ? west.props.startsCollapsed : false),
33
+ [northHeight, setNorthHeight] = useState(north ? north.props.h : 0),
34
+ [southHeight, setSouthHeight] = useState(south ? south.props.h : 0),
35
+ [eastWidth, setEastWidth] = useState(east ? east.props.w : 0),
36
+ [westWidth, setWestWidth] = useState(west ? west.props.w : 0),
37
+ onNorthResize = (delta) => {
38
+ const newHeight = northHeight + delta;
39
+ setNorthHeight(newHeight);
40
+ },
41
+ onSouthResize = (delta) => {
42
+ const newHeight = southHeight - delta; // minus
43
+ setSouthHeight(newHeight);
44
+ },
45
+ onEastResize = (delta) => {
46
+ const newWidth = eastWidth - delta; // minus
47
+ setEastWidth(newWidth);
48
+ },
49
+ onWestResize = (delta) => {
50
+ const newWidth = westWidth + delta;
51
+ setWestWidth(newWidth);
52
+ };
53
+
54
+ let componentProps = {},
55
+ centerComponent = null,
56
+ northComponent = null,
57
+ northSplitter = null,
58
+ southComponent = null,
59
+ southSplitter = null,
60
+ eastComponent = null,
61
+ eastSplitter = null,
62
+ westComponent = null,
63
+ westSplitter = null;
64
+
65
+ centerComponent = React.cloneElement(center, { isCollapsible: false, });
66
+ if (north) {
67
+ componentProps.collapseDirection = VERTICAL;
68
+ if (!north.props.h && !north.props.flex) {
69
+ componentProps.flex = 50;
70
+ }
71
+ if (north.props.isResizable) {
72
+ if (northHeight) {
73
+ componentProps.h = northHeight;
74
+ componentProps.flex = null;
75
+ }
76
+ componentProps.w = '100%';
77
+ componentProps.isCollapsed = setIsNorthCollapsed ? isNorthCollapsed : localIsNorthCollapsed;
78
+ componentProps.setIsCollapsed = setIsNorthCollapsed || setLocalIsNorthCollapsed;
79
+ componentProps.onLayout = (e) => {
80
+ const height = parseFloat(e.nativeEvent.layout.height);
81
+ if (height !== northHeight) {
82
+ setNorthHeight(height);
83
+ }
84
+ };
85
+ northSplitter = <Splitter mode={VERTICAL} onDragStop={onNorthResize} />;
86
+ }
87
+ northComponent = React.cloneElement(north, { ...componentProps, w: '100%', });
88
+ componentProps = {};
89
+ }
90
+ if (south) {
91
+ componentProps.collapseDirection = VERTICAL;
92
+ if (!south.props.h && !south.props.flex) {
93
+ componentProps.flex = 50;
94
+ }
95
+ if (south.props.isResizable) {
96
+ if (southHeight) {
97
+ componentProps.h = southHeight;
98
+ componentProps.flex = null;
99
+ }
100
+ componentProps.w = '100%';
101
+ componentProps.isCollapsed = setIsSouthCollapsed ? isSouthCollapsed : localIsSouthCollapsed;
102
+ componentProps.setIsCollapsed = setIsSouthCollapsed || setLocalIsSouthCollapsed;
103
+ componentProps.onLayout = (e) => {
104
+ const height = parseFloat(e.nativeEvent.layout.height);
105
+ if (height !== southHeight) {
106
+ setSouthHeight(height);
107
+ }
108
+ };
109
+ southSplitter = <Splitter mode={VERTICAL} onDragStop={onSouthResize} />;
110
+ }
111
+ southComponent = React.cloneElement(south, { ...componentProps, w: '100%', });
112
+ componentProps = {};
113
+ }
114
+ if (east) {
115
+ componentProps.collapseDirection = HORIZONTAL;
116
+ if (!east.props.h && !east.props.flex) {
117
+ componentProps.flex = 50;
118
+ }
119
+ if (east.props.isResizable) {
120
+ if (eastWidth) {
121
+ componentProps.w = eastWidth;
122
+ componentProps.flex = null;
123
+ }
124
+ componentProps.h = '100%';
125
+ componentProps.isCollapsed = setIsEastCollapsed ? isEastCollapsed : localIsEastCollapsed;
126
+ componentProps.setIsCollapsed = setIsEastCollapsed || setLocalIsEastCollapsed;
127
+ componentProps.onLayout = (e) => {
128
+ const width = parseFloat(e.nativeEvent.layout.width);
129
+ if (width !== eastWidth) {
130
+ setEastWidth(width);
131
+ }
132
+ };
133
+ eastSplitter = <Splitter mode={HORIZONTAL} onDragStop={onEastResize} />;
134
+ }
135
+ eastComponent = React.cloneElement(east, { ...componentProps, h: '100%', });
136
+ componentProps = {};
137
+ }
138
+ if (west) {
139
+ componentProps.collapseDirection = HORIZONTAL;
140
+ if (!west.props.h && !west.props.flex) {
141
+ componentProps.flex = 50;
142
+ }
143
+ if (west.props.isResizable) {
144
+ if (westWidth) {
145
+ componentProps.w = westWidth;
146
+ componentProps.flex = null;
147
+ }
148
+ componentProps.h = '100%';
149
+ componentProps.isCollapsed = setIsWestCollapsed ? isWestCollapsed : localIsWestCollapsed;
150
+ componentProps.setIsCollapsed = setIsWestCollapsed || setLocalIsWestCollapsed;
151
+ componentProps.onLayout = (e) => {
152
+ const width = parseFloat(e.nativeEvent.layout.width);
153
+ if (width !== westWidth) {
154
+ setWestWidth(width);
155
+ }
156
+ };
157
+ westSplitter = <Splitter mode={HORIZONTAL} onDragStop={onWestResize} />;
158
+ }
159
+ westComponent = React.cloneElement(west, { ...componentProps, h: '100%', });
160
+ componentProps = {};
161
+ }
162
+
163
+ return <Column w="100%" flex={1}>
164
+ {northComponent}
165
+ {(!isNorthCollapsed && !localIsNorthCollapsed) && northSplitter}
166
+ <Row w="100%" flex={100}>
167
+ {westComponent}
168
+ {(!isWestCollapsed && !localIsWestCollapsed) && westSplitter}
169
+ <Column h="100%" flex={100}>
170
+ {centerComponent}
171
+ </Column>
172
+ {(!isEastCollapsed && !localIsEastCollapsed) && eastSplitter}
173
+ {eastComponent}
174
+ </Row>
175
+ {(!isSouthCollapsed && !localIsSouthCollapsed) && southSplitter}
176
+ {southComponent}
177
+ </Column>;
178
+ }
@@ -0,0 +1,61 @@
1
+ import {
2
+ Column,
3
+ Row,
4
+ Text,
5
+ } from 'native-base';
6
+ import {
7
+ HORIZONTAL,
8
+ VERTICAL,
9
+ } from '../../Constants/Directions';
10
+ import styles from '../../Styles/StyleSheets';
11
+ import withDraggable from '../Hoc/withDraggable';
12
+
13
+ // Note on modes:
14
+ // HORIZONTAL means the Splitter moves along the X axis.
15
+ // VERTICAL means the Splitter moves along the Y axis.
16
+
17
+ function Splitter(props) {
18
+ const {
19
+ mode = HORIZONTAL, // HORIZONTAL, VERTICAL
20
+ isDragging,
21
+ } = props;
22
+
23
+ if (mode === VERTICAL) {
24
+ return <Row
25
+ testID="Splitter"
26
+ bg={isDragging ? 'secondary.600' : 'primary.600'}
27
+ h="3px"
28
+ w="100%"
29
+ alignItems="center"
30
+ justifyContent="center"
31
+ >
32
+ <Row testID="handle" h="2px" w="10%" bg="#ccc"></Row>
33
+ </Row>;
34
+ }
35
+ return <Column
36
+ testID="Splitter"
37
+ bg={isDragging ? 'secondary.600' : 'primary.600'}
38
+ h="100%"
39
+ w="3px"
40
+ alignItems="center"
41
+ justifyContent="center"
42
+ style={styles.ewResize}
43
+ >
44
+ <Column testID="handle" w="2px" h="10%" bg="#ccc"></Column>
45
+ </Column>;
46
+ }
47
+
48
+ // Need a hoc to specifically deliver the 'getParentNode' prop
49
+ function withParentNode(WrappedComponent) {
50
+ return (props) => {
51
+ const {
52
+ getParentNode = (node) => node.parentElement.parentElement,
53
+ } = props;
54
+ return <WrappedComponent
55
+ getParentNode={getParentNode}
56
+ {...props}
57
+ />;
58
+ };
59
+ }
60
+
61
+ export default withParentNode(withDraggable(Splitter));
@@ -0,0 +1,99 @@
1
+ import { useState, useEffect } from 'react';
2
+ import {
3
+ Row,
4
+ Text,
5
+ } from 'native-base';
6
+ import Date from '../Form/Field/Date';
7
+ import withTooltip from '../Hoc/withTooltip';
8
+ import withValue from '../Hoc/withValue';
9
+ import _ from 'lodash';
10
+
11
+ const
12
+ DateRange = (props) => {
13
+ const {
14
+ value = {
15
+ low: null,
16
+ high: null,
17
+ },
18
+ setValue,
19
+ mode,
20
+ tooltip = '',
21
+
22
+ minValue = 0,
23
+ maxValue,
24
+ } = props,
25
+ [low, setLow] = useState(''),
26
+ [high, setHigh] = useState(''),
27
+ onChangeLow = (value) => {
28
+ setLow(value);
29
+ const newValue = {
30
+ low: value,
31
+ high,
32
+ };
33
+ setValue(newValue);
34
+ },
35
+ onChangeHigh = (value) => {
36
+ setHigh(value);
37
+ const newValue = {
38
+ low,
39
+ high: value,
40
+ };
41
+ setValue(newValue);
42
+ };
43
+
44
+ useEffect(() => {
45
+
46
+ // Initialize format of value - needs to be JSON object with combination of two values
47
+ if (value === null || typeof value === 'undefined') {
48
+ setValue({
49
+ low: null,
50
+ high: null,
51
+ });
52
+ return () => {};
53
+ }
54
+
55
+ // Make local value conform to externally changed value
56
+ if (value.low !== low) {
57
+ setLow(value.low);
58
+ }
59
+ if (value.high !== high) {
60
+ setHigh(value.high);
61
+ }
62
+
63
+ }, [value]);
64
+
65
+ return <Row
66
+ justifyContent="center"
67
+ alignItems="center"
68
+ flex={1}
69
+ px={1}
70
+ >
71
+ <Date
72
+ value={low}
73
+ onChangeValue={onChangeLow}
74
+ mode={mode}
75
+ startingValue={null}
76
+ // minValue={minValue}
77
+ // maxValue={maxValue}
78
+ tooltip={(tooltip ? tooltip + ' ' : '') + 'Low'}
79
+ />
80
+ <Text px={2} userSelect="none">to</Text>
81
+ <Date
82
+ value={high}
83
+ onChangeValue={onChangeHigh}
84
+ mode={mode}
85
+ startingValue={null}
86
+ // minValue={minValue}
87
+ // maxValue={maxValue}
88
+ tooltip={(tooltip ? tooltip + ' ' : '') + 'High'}
89
+ />
90
+ </Row>;
91
+ },
92
+ DateRangeField = withValue(DateRange);
93
+
94
+ export default DateRangeField;
95
+
96
+ // Tooltip needs us to forwardRef
97
+ // export default withTooltip(React.forwardRef((props, ref) => {
98
+ // return <DateField {...props} outerRef={ref} />;
99
+ // }));