@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
@@ -0,0 +1,96 @@
1
+ import React, { useState, useEffect, } from 'react';
2
+ import {
3
+ Row,
4
+ Text,
5
+ } from 'native-base';
6
+ import Number from '../Form/Field/Number';
7
+ import withTooltip from '../Hoc/withTooltip';
8
+ import withValue from '../Hoc/withValue';
9
+ import _ from 'lodash';
10
+
11
+ const
12
+ NumberRange = (props) => {
13
+ const {
14
+ value = {
15
+ low: null,
16
+ high: null,
17
+ },
18
+ setValue,
19
+ tooltip = '',
20
+
21
+ minValue = 0,
22
+ maxValue,
23
+ } = props,
24
+ [low, setLow] = useState(''),
25
+ [high, setHigh] = useState(''),
26
+ onChangeLow = (value) => {
27
+ setLow(value);
28
+ const newValue = {
29
+ low: value,
30
+ high,
31
+ };
32
+ setValue(newValue);
33
+ },
34
+ onChangeHigh = (value) => {
35
+ setHigh(value);
36
+ const newValue = {
37
+ low,
38
+ high: value,
39
+ };
40
+ setValue(newValue);
41
+ };
42
+
43
+ useEffect(() => {
44
+
45
+ // Initialize format of value - needs to be JSON object with combination of two values
46
+ if (value === null || typeof value === 'undefined') {
47
+ setValue({
48
+ low: null,
49
+ high: null,
50
+ });
51
+ return () => {};
52
+ }
53
+
54
+ // Make local value conform to externally changed value
55
+ if (value.low !== low) {
56
+ setLow(value.low);
57
+ }
58
+ if (value.high !== high) {
59
+ setHigh(value.high);
60
+ }
61
+
62
+ }, [value]);
63
+
64
+ return <Row
65
+ justifyContent="center"
66
+ alignItems="center"
67
+ flex={1}
68
+ px={1}
69
+ >
70
+ <Number
71
+ value={low}
72
+ onChangeValue={onChangeLow}
73
+ startingValue={null}
74
+ minValue={minValue}
75
+ maxValue={maxValue}
76
+ tooltip={(tooltip ? tooltip + ' ' : '') + 'Low'}
77
+ />
78
+ <Text px={2} userSelect="none">to</Text>
79
+ <Number
80
+ value={high}
81
+ onChangeValue={onChangeHigh}
82
+ startingValue={null}
83
+ minValue={minValue}
84
+ maxValue={maxValue}
85
+ tooltip={(tooltip ? tooltip + ' ' : '') + 'High'}
86
+ />
87
+ </Row>;
88
+ },
89
+ NumberRangeField = withValue(NumberRange);
90
+
91
+ export default NumberRangeField;
92
+
93
+ // Tooltip needs us to forwardRef
94
+ // export default withTooltip(React.forwardRef((props, ref) => {
95
+ // return <NumberRangeField {...props} outerRef={ref} />;
96
+ // }));
@@ -0,0 +1,62 @@
1
+ import React, { useState, useEffect, useRef, } from 'react';
2
+ import {
3
+ Row,
4
+ } from 'native-base';
5
+ import {
6
+ AUTO_SUBMIT_DELAY,
7
+ } from '../../../../Constants/Input';
8
+ import Editor from 'ckeditor5-custom-build/build/ckeditor'; // built using https://ckeditor.com/ckeditor-5/online-builder/
9
+ import { CKEditor } from '@ckeditor/ckeditor5-react'; // https://ckeditor.com/docs/ckeditor5/latest/installation/frameworks/react.html
10
+ import withValue from '../../../Hoc/withValue';
11
+ import withTooltip from '../../../Hoc/withTooltip';
12
+ import './styles.css';
13
+
14
+ const
15
+ CKEditorElement = (props) => {
16
+ const {
17
+ value,
18
+ setValue,
19
+ h = 150,
20
+ } = props,
21
+ debouncedSetValueRef = useRef(),
22
+ [editor, setEditor] = useState(null),
23
+ config = {
24
+ };
25
+
26
+
27
+ useEffect(() => {
28
+ // Set up debounce fn
29
+ // Have to do this because otherwise, lodash tries to create a debounced version of the fn from only this render
30
+ debouncedSetValueRef.current = _.debounce(setValue, AUTO_SUBMIT_DELAY);
31
+ }, [setValue]);
32
+
33
+ return <Row h={h} flex={1} ref={props.outerRef} {...props}>
34
+ <CKEditor
35
+ editor={Editor}
36
+ config={config}
37
+ data={value}
38
+ onReady={(editor) => {
39
+ setEditor(editor);
40
+ }}
41
+ onChange={(event, editor) => {
42
+ const value = editor.getData();
43
+ debouncedSetValueRef.current(value);
44
+ }}
45
+ // onBlur={(event, editor) => {
46
+ // console.log( 'Blur.', editor);
47
+ // }}
48
+ // onFocus={(event, editor) => {
49
+ // console.log( 'Focus.', editor);
50
+ // }}
51
+ />
52
+ </Row>;
53
+ },
54
+ CKEditorField = withValue(CKEditorElement);
55
+
56
+
57
+ export default CKEditorField;
58
+
59
+ // // Tooltip needs us to forwardRef
60
+ // export default withTooltip(React.forwardRef((props, ref) => {
61
+ // return <CKEditorField {...props} outerRef={ref} />;
62
+ // }));
@@ -0,0 +1,503 @@
1
+ /**
2
+ * @license Copyright (c) 2014-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * This file is licensed under the terms of the MIT License (see LICENSE.md).
4
+ */
5
+
6
+ /* SKOTE MOD */
7
+ .ck-editor__editable {
8
+ min-height: 10px !important;
9
+ padding: 10px !important;
10
+ }
11
+ /* END SKOTE MOD */
12
+
13
+ :root {
14
+ --ck-sample-base-spacing: 2em;
15
+ --ck-sample-color-white: #fff;
16
+ --ck-sample-color-green: #279863;
17
+ --ck-sample-color-blue: #1a9aef;
18
+ --ck-sample-container-width: 1285px;
19
+ --ck-sample-sidebar-width: 350px;
20
+ --ck-sample-editor-min-height: 400px;
21
+ --ck-sample-editor-z-index: 10;
22
+ }
23
+
24
+ /* --------- EDITOR STYLES ---------------------------------------------------------------------------------------- */
25
+
26
+ .editor__editable,
27
+ /* Classic build. */
28
+ main .ck-editor[role='application'] .ck.ck-content,
29
+ /* Decoupled document build. */
30
+ .ck.editor__editable[role='textbox'],
31
+ .ck.ck-editor__editable[role='textbox'],
32
+ /* Inline & Balloon build. */
33
+ .ck.editor[role='textbox'] {
34
+ width: 100%;
35
+ background: #fff;
36
+ font-size: 1em;
37
+ line-height: 1.6em;
38
+ min-height: var(--ck-sample-editor-min-height);
39
+ padding: 1.5em 2em;
40
+ }
41
+
42
+ .ck.ck-editor__editable {
43
+ background: #fff;
44
+ border: 1px solid hsl(0, 0%, 70%);
45
+ width: 100%;
46
+ }
47
+
48
+ /* Because of sidebar `position: relative`, Edge is overriding the outline of a focused editor. */
49
+ .ck.ck-editor__editable {
50
+ position: relative;
51
+ z-index: var(--ck-sample-editor-z-index);
52
+ }
53
+
54
+ .editor-container {
55
+ display: flex;
56
+ flex-direction: row;
57
+ flex-wrap: nowrap;
58
+ position: relative;
59
+ width: 100%;
60
+ justify-content: center;
61
+ }
62
+
63
+ /* --------- DECOUPLED (DOCUMENT) BUILD. ---------------------------------------------*/
64
+ body[data-editor='DecoupledDocumentEditor'] .document-editor__toolbar {
65
+ width: 100%;
66
+ }
67
+
68
+ body[data-editor='DecoupledDocumentEditor'] .collaboration-demo__editable,
69
+ body[data-editor='DecoupledDocumentEditor'] .row-editor .editor {
70
+ /* A pixel is added for each of the border. */
71
+ width: calc(21cm + 2px);
72
+ min-height: calc(29.7cm + 2px);
73
+ /* To avoid having extra scrolls inside the editor container. */
74
+ height: fit-content;
75
+ padding: 2cm 1.2cm;
76
+ margin: 2.5rem;
77
+ border: 1px hsl( 0, 0%, 82.7% ) solid;
78
+ background-color: var(--ck-sample-color-white);
79
+ box-shadow: 0 0 5px hsla( 0, 0%, 0%, .1 );
80
+ box-sizing: border-box;
81
+ }
82
+
83
+ body[data-editor='DecoupledDocumentEditor'] .row-editor {
84
+ display: flex;
85
+ position: relative;
86
+ justify-content: center;
87
+ overflow-y: auto;
88
+ background-color: #f2f2f2;
89
+ border: 1px solid hsl(0, 0%, 77%);
90
+ /* Limit the max-height of the editor to avoid scrolling from bottom to top to see the toolbar. */
91
+ max-height: 700px;
92
+ }
93
+
94
+ body[data-editor='DecoupledDocumentEditor'] .sidebar {
95
+ background: transparent;
96
+ border: 0;
97
+ box-shadow: none;
98
+ }
99
+
100
+ /* --------- COMMENTS & TRACK CHANGES FEATURE ---------------------------------------------------------------------- */
101
+ .sidebar {
102
+ padding: 0 15px;
103
+ position: relative;
104
+ min-width: var(--ck-sample-sidebar-width);
105
+ max-width: var(--ck-sample-sidebar-width);
106
+ font-size: 20px;
107
+ border: 1px solid hsl(0, 0%, 77%);
108
+ background: hsl(0, 0%, 98%);
109
+ border-left: 0;
110
+ overflow: hidden;
111
+ min-height: 100%;
112
+ flex-grow: 1;
113
+ }
114
+
115
+ /* Do not inherit styles related to the editable editor content. See line 25.*/
116
+ .sidebar .ck-content[role='textbox'],
117
+ .ck.ck-annotation-wrapper .ck-content[role='textbox'] {
118
+ min-height: unset;
119
+ width: unset;
120
+ padding: 0;
121
+ background: transparent;
122
+ }
123
+
124
+ .sidebar.narrow {
125
+ min-width: 60px;
126
+ flex-grow: 0;
127
+ }
128
+
129
+ .sidebar.hidden {
130
+ display: none !important;
131
+ }
132
+
133
+ #sidebar-display-toggle {
134
+ position: absolute;
135
+ z-index: 1;
136
+ width: 30px;
137
+ height: 30px;
138
+ text-align: center;
139
+ left: 15px;
140
+ top: 30px;
141
+ border: 0;
142
+ padding: 0;
143
+ color: hsl( 0, 0%, 50% );
144
+ transition: 250ms ease color;
145
+ background-color: transparent;
146
+ }
147
+
148
+ #sidebar-display-toggle:hover {
149
+ color: hsl( 0, 0%, 30% );
150
+ cursor: pointer;
151
+ }
152
+
153
+ #sidebar-display-toggle:focus,
154
+ #sidebar-display-toggle:active {
155
+ outline: none;
156
+ border: 1px solid #a9d29d;
157
+ }
158
+
159
+ #sidebar-display-toggle svg {
160
+ fill: currentColor;
161
+ }
162
+
163
+ /* --------- COLLABORATION FEATURES (USERS) ------------------------------------------------------------------------ */
164
+ .row-presence {
165
+ width: 100%;
166
+ border: 1px solid hsl(0, 0%, 77%);
167
+ border-bottom: 0;
168
+ background: hsl(0, 0%, 98%);
169
+ padding: var(--ck-spacing-small);
170
+
171
+ /* Make `border-bottom` as `box-shadow` to not overlap with the editor border. */
172
+ box-shadow: 0 1px 0 0 hsl(0, 0%, 77%);
173
+
174
+ /* Make `z-index` bigger than `.editor` to properly display tooltips. */
175
+ z-index: 20;
176
+ }
177
+
178
+ .ck.ck-presence-list {
179
+ flex: 1;
180
+ padding: 1.25rem .75rem;
181
+ }
182
+
183
+ .presence .ck.ck-presence-list__counter {
184
+ order: 2;
185
+ margin-left: var(--ck-spacing-large)
186
+ }
187
+
188
+ /* --------- REAL TIME COLLABORATION FEATURES (SHARE TOPBAR CONTAINER) --------------------------------------------- */
189
+ .collaboration-demo__row {
190
+ display: flex;
191
+ position: relative;
192
+ justify-content: center;
193
+ overflow-y: auto;
194
+ background-color: #f2f2f2;
195
+ border: 1px solid hsl(0, 0%, 77%);
196
+ }
197
+
198
+ body[data-editor='InlineEditor'] .collaboration-demo__row {
199
+ border: 0;
200
+ }
201
+
202
+ .collaboration-demo__container {
203
+ max-width: var(--ck-sample-container-width);
204
+ margin: 0 auto;
205
+ padding: 1.25rem;
206
+ }
207
+
208
+ .presence, .collaboration-demo__row {
209
+ transition: .2s opacity;
210
+ }
211
+
212
+ .collaboration-demo__topbar {
213
+ background: #fff;
214
+ border: 1px solid var(--ck-color-toolbar-border);
215
+ display: flex;
216
+ justify-content: space-between;
217
+ align-items: center;
218
+ border-bottom: 0;
219
+ border-radius: 4px 4px 0 0;
220
+ }
221
+
222
+ .collaboration-demo__topbar .btn {
223
+ margin-right: 1em;
224
+ outline-offset: 2px;
225
+ outline-width: 2px;
226
+ background-color: var( --ck-sample-color-blue );
227
+ }
228
+
229
+ .collaboration-demo__topbar .btn:focus,
230
+ .collaboration-demo__topbar .btn:hover {
231
+ border-color: var( --ck-sample-color-blue );
232
+ }
233
+
234
+ .collaboration-demo__share {
235
+ display: flex;
236
+ align-items: center;
237
+ padding: 1.25rem .75rem
238
+ }
239
+
240
+ .collaboration-demo__share-description p {
241
+ margin: 0;
242
+ font-weight: bold;
243
+ font-size: 0.9em;
244
+ }
245
+
246
+ .collaboration-demo__share input {
247
+ height: auto;
248
+ font-size: 0.9em;
249
+ min-width: 220px;
250
+ margin: 0 10px;
251
+ border-radius: 4px;
252
+ border: 1px solid var(--ck-color-toolbar-border)
253
+ }
254
+
255
+ .collaboration-demo__share button,
256
+ .collaboration-demo__share input {
257
+ height: 40px;
258
+ padding: 5px 10px;
259
+ }
260
+
261
+ .collaboration-demo__share button {
262
+ position: relative;
263
+ }
264
+
265
+ .collaboration-demo__share button:focus {
266
+ outline: none;
267
+ }
268
+
269
+ .collaboration-demo__share button[data-tooltip]::before,
270
+ .collaboration-demo__share button[data-tooltip]::after {
271
+ position: absolute;
272
+ visibility: hidden;
273
+ opacity: 0;
274
+ pointer-events: none;
275
+ transition: all .15s cubic-bezier(.5,1,.25,1);
276
+ z-index: 1;
277
+ }
278
+
279
+ .collaboration-demo__share button[data-tooltip]::before {
280
+ content: attr(data-tooltip);
281
+ padding: 5px 15px;
282
+ border-radius: 3px;
283
+ background: #111;
284
+ color: #fff;
285
+ text-align: center;
286
+ font-size: 11px;
287
+ top: 100%;
288
+ left: 50%;
289
+ margin-top: 5px;
290
+ transform: translateX(-50%);
291
+ }
292
+
293
+ .collaboration-demo__share button[data-tooltip]::after {
294
+ content: '';
295
+ border: 5px solid transparent;
296
+ width: 0;
297
+ font-size: 0;
298
+ line-height: 0;
299
+ top: 100%;
300
+ left: 50%;
301
+ transform: translateX(-50%);
302
+ border-bottom: 5px solid #111;
303
+ border-top: none;
304
+ }
305
+
306
+ .collaboration-demo__share button[data-tooltip]:hover:before,
307
+ .collaboration-demo__share button[data-tooltip]:hover:after {
308
+ visibility: visible;
309
+ opacity: 1;
310
+ }
311
+
312
+ .collaboration-demo--ready {
313
+ overflow: visible;
314
+ height: auto;
315
+ }
316
+
317
+ .collaboration-demo--ready .presence,
318
+ .collaboration-demo--ready .collaboration-demo__row {
319
+ opacity: 1;
320
+ }
321
+
322
+ /* --------- PAGINATION FEATURE ------------------------------------------------------------------------------------ */
323
+
324
+ /* Pagination view line must be stacked at least at the same level as the editor,
325
+ otherwise it will be hidden underneath. */
326
+ .ck.ck-pagination-view-line {
327
+ z-index: var(--ck-sample-editor-z-index);
328
+ }
329
+
330
+ /* --------- REVISION HISTORY FEATURE ------------------------------------------------------------------------------ */
331
+
332
+ .revision-viewer-container {
333
+ display: none;
334
+ }
335
+
336
+ .revision-viewer-sidebar {
337
+ position: relative;
338
+ min-width: 310px;
339
+ overflow: hidden;
340
+ background: var(--ck-color-toolbar-background);
341
+ border: 1px solid var(--ck-color-toolbar-border);
342
+ margin-left: -1px;
343
+ }
344
+
345
+ /* A case when Pagination and Revision History features are enabled in the editor. */
346
+ /* Move the square with page number from the Pagination plugin to the left side, so that it does not cover the RH sidebar. */
347
+ body[data-revision-history='true'] .ck.ck-pagination-view-line::after {
348
+ transform: translateX(-100%) !important;
349
+ left: -1px !important;
350
+ right: unset !important;
351
+ }
352
+
353
+ /* --------- SAMPLE GENERIC STYLES (not related to CKEditor) ------------------------------------------------------- */
354
+ body, html {
355
+ padding: 0;
356
+ margin: 0;
357
+
358
+ font-family: sans-serif, Arial, Verdana, "Trebuchet MS", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
359
+ font-size: 16px;
360
+ line-height: 1.5;
361
+ }
362
+
363
+ body {
364
+ height: 100%;
365
+ color: #2D3A4A;
366
+ }
367
+
368
+ body * {
369
+ box-sizing: border-box;
370
+ }
371
+
372
+ a {
373
+ color: #38A5EE;
374
+ }
375
+
376
+ header .centered {
377
+ display: flex;
378
+ flex-flow: row nowrap;
379
+ justify-content: space-between;
380
+ align-items: center;
381
+ min-height: 8em;
382
+ }
383
+
384
+ header h1 a {
385
+ font-size: 20px;
386
+ display: flex;
387
+ align-items: center;
388
+ color: #2D3A4A;
389
+ text-decoration: none;
390
+ }
391
+
392
+ header h1 img {
393
+ display: block;
394
+ height: 64px;
395
+ }
396
+
397
+ header nav ul {
398
+ margin: 0;
399
+ padding: 0;
400
+ list-style-type: none;
401
+ }
402
+
403
+ header nav ul li {
404
+ display: inline-block;
405
+ }
406
+
407
+ header nav ul li + li {
408
+ margin-left: 1em;
409
+ }
410
+
411
+ header nav ul li a {
412
+ font-weight: bold;
413
+ text-decoration: none;
414
+ color: #2D3A4A;
415
+ }
416
+
417
+ header nav ul li a:hover {
418
+ text-decoration: underline;
419
+ }
420
+
421
+ main .message {
422
+ padding: 0 0 var(--ck-sample-base-spacing);
423
+ background: var(--ck-sample-color-green);
424
+ color: var(--ck-sample-color-white);
425
+ }
426
+
427
+ main .message::after {
428
+ content: "";
429
+ z-index: -1;
430
+ display: block;
431
+ height: 10em;
432
+ width: 100%;
433
+ background: var(--ck-sample-color-green);
434
+ position: absolute;
435
+ left: 0;
436
+ }
437
+
438
+ main .message h2 {
439
+ position: relative;
440
+ padding-top: 1em;
441
+ font-size: 2em;
442
+ }
443
+
444
+ .centered {
445
+ /* Hide overlapping comments. */
446
+ overflow: hidden;
447
+ max-width: var(--ck-sample-container-width);
448
+ margin: 0 auto;
449
+ padding: 0 var(--ck-sample-base-spacing);
450
+ }
451
+
452
+ .row {
453
+ display: flex;
454
+ position: relative;
455
+ }
456
+
457
+ .btn {
458
+ cursor: pointer;
459
+ padding: 8px 16px;
460
+ font-size: 1rem;
461
+ user-select: none;
462
+ border-radius: 4px;
463
+ transition: color .2s ease-in-out,background-color .2s ease-in-out,border-color .2s ease-in-out,opacity .2s ease-in-out;
464
+ background-color: var(--ck-sample-color-button-blue);
465
+ border-color: var(--ck-sample-color-button-blue);
466
+ color: var(--ck-sample-color-white);
467
+ display: inline-block;
468
+ }
469
+
470
+ .btn--tiny {
471
+ padding: 6px 12px;
472
+ font-size: .8rem;
473
+ }
474
+
475
+ footer {
476
+ margin: calc(2*var(--ck-sample-base-spacing)) var(--ck-sample-base-spacing);
477
+ font-size: .8em;
478
+ text-align: center;
479
+ color: rgba(0,0,0,.4);
480
+ }
481
+
482
+ /* --------- RWD --------------------------------------------------------------------------------------------------- */
483
+ @media screen and ( max-width: 800px ) {
484
+ :root {
485
+ --ck-sample-base-spacing: 1em;
486
+ }
487
+
488
+ header h1 {
489
+ width: 100%;
490
+ }
491
+
492
+ header h1 img {
493
+ height: 40px;
494
+ }
495
+
496
+ header nav ul {
497
+ text-align: right;
498
+ }
499
+
500
+ main .message h2 {
501
+ font-size: 1.5em;
502
+ }
503
+ }
@@ -0,0 +1,12 @@
1
+ import {
2
+ Box,
3
+ } from 'native-base';
4
+ import _ from 'lodash';
5
+
6
+ export default function CKEditor(props) {
7
+
8
+ // See ExtJS compatible OneBuild implementation for ideas.
9
+ // Also see es6 folder in Venpal
10
+
11
+ throw new Error('not yet implemented');
12
+ }
@@ -0,0 +1,13 @@
1
+ import CheckboxGroup from './CheckboxGroup';
2
+
3
+ // This is a building block for other CheckboxGroups,
4
+ // which store their data as a JSON array, not a data repository.
5
+ // Need to supply data prop from outer component.
6
+ export default function ArrayCheckboxGroup(props) {
7
+ return <CheckboxGroup
8
+ idField="id"
9
+ displayField="value"
10
+ fields={['id', 'value']}
11
+ {...props}
12
+ />;
13
+ }