@longline/aqua-ui 1.0.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 (410) hide show
  1. package/README.md +7 -0
  2. package/Types.d.ts +6 -0
  3. package/Types.js +5 -0
  4. package/containers/Anchor/Anchor.d.ts +63 -0
  5. package/containers/Anchor/Anchor.js +113 -0
  6. package/containers/Anchor/index.d.ts +1 -0
  7. package/containers/Anchor/index.js +1 -0
  8. package/containers/Dock/Dock.d.ts +45 -0
  9. package/containers/Dock/Dock.js +61 -0
  10. package/containers/Dock/Dockable.d.ts +60 -0
  11. package/containers/Dock/Dockable.js +98 -0
  12. package/containers/Dock/index.d.ts +2 -0
  13. package/containers/Dock/index.js +2 -0
  14. package/containers/Form/Field.d.ts +104 -0
  15. package/containers/Form/Field.js +168 -0
  16. package/containers/Form/Form.d.ts +51 -0
  17. package/containers/Form/Form.js +89 -0
  18. package/containers/Form/Validation.d.ts +212 -0
  19. package/containers/Form/Validation.js +232 -0
  20. package/containers/Form/context/FormContext.d.ts +10 -0
  21. package/containers/Form/context/FormContext.js +3 -0
  22. package/containers/Form/context/useForm.d.ts +5 -0
  23. package/containers/Form/context/useForm.js +9 -0
  24. package/containers/Form/elements/BoxWrapper.d.ts +15 -0
  25. package/containers/Form/elements/BoxWrapper.js +35 -0
  26. package/containers/Form/elements/Hint.d.ts +21 -0
  27. package/containers/Form/elements/Hint.js +15 -0
  28. package/containers/Form/elements/Label.d.ts +22 -0
  29. package/containers/Form/elements/Label.js +15 -0
  30. package/containers/Form/elements/SimpleWrapper.d.ts +15 -0
  31. package/containers/Form/elements/SimpleWrapper.js +17 -0
  32. package/containers/GlassPane/GlassPane.d.ts +36 -0
  33. package/containers/GlassPane/GlassPane.js +66 -0
  34. package/containers/GlassPane/index.d.ts +1 -0
  35. package/containers/GlassPane/index.js +1 -0
  36. package/containers/InfoBox/InfoBox.d.ts +34 -0
  37. package/containers/InfoBox/InfoBox.js +45 -0
  38. package/containers/InfoBox/elements/Content.d.ts +23 -0
  39. package/containers/InfoBox/elements/Content.js +37 -0
  40. package/containers/InfoBox/elements/Footer.d.ts +9 -0
  41. package/containers/InfoBox/elements/Footer.js +24 -0
  42. package/containers/InfoBox/elements/Header.d.ts +9 -0
  43. package/containers/InfoBox/elements/Header.js +24 -0
  44. package/containers/List/List.d.ts +45 -0
  45. package/containers/List/List.js +47 -0
  46. package/containers/List/ListCell.d.ts +13 -0
  47. package/containers/List/ListCell.js +24 -0
  48. package/containers/List/ListRow.d.ts +15 -0
  49. package/containers/List/ListRow.js +24 -0
  50. package/containers/List/index.d.ts +3 -0
  51. package/containers/List/index.js +3 -0
  52. package/containers/Tabs/Pane.d.ts +29 -0
  53. package/containers/Tabs/Pane.js +45 -0
  54. package/containers/Tabs/Tabs.d.ts +66 -0
  55. package/containers/Tabs/Tabs.js +144 -0
  56. package/controls/Chip/Chip.d.ts +35 -0
  57. package/controls/Chip/Chip.js +83 -0
  58. package/controls/Fab/Fab.d.ts +73 -0
  59. package/controls/Fab/Fab.js +94 -0
  60. package/controls/Icon/Icon.d.ts +98 -0
  61. package/controls/Icon/Icon.js +79 -0
  62. package/controls/Icon/index.d.ts +1 -0
  63. package/controls/Icon/index.js +1 -0
  64. package/controls/Key/Key.d.ts +22 -0
  65. package/controls/Key/Key.js +74 -0
  66. package/controls/Key/index.d.ts +1 -0
  67. package/controls/Key/index.js +1 -0
  68. package/controls/LinearChart/LinearChart.d.ts +31 -0
  69. package/controls/LinearChart/LinearChart.js +58 -0
  70. package/controls/ListView/Body.d.ts +8 -0
  71. package/controls/ListView/Body.js +24 -0
  72. package/controls/ListView/Column.d.ts +55 -0
  73. package/controls/ListView/Column.js +8 -0
  74. package/controls/ListView/ColumnsManager/ColumnDraggable.d.ts +11 -0
  75. package/controls/ListView/ColumnsManager/ColumnDraggable.js +83 -0
  76. package/controls/ListView/ColumnsManager/ColumnsManager.d.ts +12 -0
  77. package/controls/ListView/ColumnsManager/ColumnsManager.js +63 -0
  78. package/controls/ListView/ColumnsManager/OrderColumns.d.ts +11 -0
  79. package/controls/ListView/ColumnsManager/OrderColumns.js +62 -0
  80. package/controls/ListView/ColumnsManager/SourceColumns.d.ts +10 -0
  81. package/controls/ListView/ColumnsManager/SourceColumns.js +45 -0
  82. package/controls/ListView/Ghost.d.ts +9 -0
  83. package/controls/ListView/Ghost.js +52 -0
  84. package/controls/ListView/Header.d.ts +12 -0
  85. package/controls/ListView/Header.js +35 -0
  86. package/controls/ListView/HeaderButton.d.ts +8 -0
  87. package/controls/ListView/HeaderButton.js +8 -0
  88. package/controls/ListView/HeaderCell.d.ts +20 -0
  89. package/controls/ListView/HeaderCell.js +47 -0
  90. package/controls/ListView/IListViewProps.d.ts +105 -0
  91. package/controls/ListView/IListViewProps.js +1 -0
  92. package/controls/ListView/ListView.d.ts +20 -0
  93. package/controls/ListView/ListView.js +97 -0
  94. package/controls/ListView/NoData.d.ts +19 -0
  95. package/controls/ListView/NoData.js +30 -0
  96. package/controls/ListView/SortButton.d.ts +16 -0
  97. package/controls/ListView/SortButton.js +26 -0
  98. package/controls/ListView/Table.d.ts +18 -0
  99. package/controls/ListView/Table.js +99 -0
  100. package/controls/ListView/Total.d.ts +9 -0
  101. package/controls/ListView/Total.js +28 -0
  102. package/controls/ListView/sortItems.d.ts +6 -0
  103. package/controls/ListView/sortItems.js +35 -0
  104. package/controls/Mouse/Mouse.d.ts +38 -0
  105. package/controls/Mouse/Mouse.js +51 -0
  106. package/controls/Mouse/index.d.ts +1 -0
  107. package/controls/Mouse/index.js +1 -0
  108. package/controls/PrimaryButton/PrimaryButton.d.ts +63 -0
  109. package/controls/PrimaryButton/PrimaryButton.js +83 -0
  110. package/controls/PrimaryButton/index.d.ts +1 -0
  111. package/controls/PrimaryButton/index.js +1 -0
  112. package/controls/Progress/Progress.d.ts +35 -0
  113. package/controls/Progress/Progress.js +49 -0
  114. package/controls/SecondaryButton/SecondaryButton.d.ts +58 -0
  115. package/controls/SecondaryButton/SecondaryButton.js +73 -0
  116. package/controls/SecondaryButton/index.d.ts +1 -0
  117. package/controls/SecondaryButton/index.js +1 -0
  118. package/controls/TabBar/Tab.d.ts +21 -0
  119. package/controls/TabBar/Tab.js +25 -0
  120. package/controls/TabBar/TabBar.d.ts +34 -0
  121. package/controls/TabBar/TabBar.js +134 -0
  122. package/controls/TabBar/Underliner.d.ts +7 -0
  123. package/controls/TabBar/Underliner.js +27 -0
  124. package/controls/TabBar/index.d.ts +1 -0
  125. package/controls/TabBar/index.js +1 -0
  126. package/controls/TertiaryButton/TertiaryButton.d.ts +28 -0
  127. package/controls/TertiaryButton/TertiaryButton.js +65 -0
  128. package/controls/TertiaryButton/index.d.ts +1 -0
  129. package/controls/TertiaryButton/index.js +1 -0
  130. package/controls/View/View.d.ts +35 -0
  131. package/controls/View/View.js +58 -0
  132. package/formatters/Date/DateTime.d.ts +45 -0
  133. package/formatters/Date/DateTime.js +64 -0
  134. package/formatters/Date/elements/Custom.d.ts +18 -0
  135. package/formatters/Date/elements/Custom.js +22 -0
  136. package/formatters/Date/elements/Distance.d.ts +24 -0
  137. package/formatters/Date/elements/Distance.js +45 -0
  138. package/formatters/Date/elements/LongDate.d.ts +17 -0
  139. package/formatters/Date/elements/LongDate.js +11 -0
  140. package/formatters/Date/elements/LongDateTime.d.ts +14 -0
  141. package/formatters/Date/elements/LongDateTime.js +10 -0
  142. package/formatters/Date/elements/LongTime.d.ts +14 -0
  143. package/formatters/Date/elements/LongTime.js +10 -0
  144. package/formatters/Date/elements/ShortDate.d.ts +14 -0
  145. package/formatters/Date/elements/ShortDate.js +10 -0
  146. package/formatters/Date/elements/ShortDateTime.d.ts +14 -0
  147. package/formatters/Date/elements/ShortDateTime.js +10 -0
  148. package/formatters/Date/elements/ShortTime.d.ts +18 -0
  149. package/formatters/Date/elements/ShortTime.js +10 -0
  150. package/formatters/Date/elements/toDate.d.ts +2 -0
  151. package/formatters/Date/elements/toDate.js +13 -0
  152. package/formatters/Filesize/Filesize.d.ts +29 -0
  153. package/formatters/Filesize/Filesize.js +54 -0
  154. package/formatters/GIS/Latitude.d.ts +23 -0
  155. package/formatters/GIS/Latitude.js +13 -0
  156. package/formatters/GIS/Longitude.d.ts +23 -0
  157. package/formatters/GIS/Longitude.js +13 -0
  158. package/formatters/GIS/index.d.ts +2 -0
  159. package/formatters/GIS/index.js +2 -0
  160. package/formatters/GIS/toDMS.d.ts +2 -0
  161. package/formatters/GIS/toDMS.js +16 -0
  162. package/formatters/Highlight/Highlight.d.ts +22 -0
  163. package/formatters/Highlight/Highlight.js +32 -0
  164. package/formatters/Highlight/index.d.ts +1 -0
  165. package/formatters/Highlight/index.js +1 -0
  166. package/formatters/Human/Human.d.ts +18 -0
  167. package/formatters/Human/Human.js +34 -0
  168. package/formatters/Human/index.d.ts +1 -0
  169. package/formatters/Human/index.js +1 -0
  170. package/formatters/Number/Number.d.ts +24 -0
  171. package/formatters/Number/Number.js +36 -0
  172. package/formatters/Number/index.d.ts +1 -0
  173. package/formatters/Number/index.js +1 -0
  174. package/helper/DMS.d.ts +22 -0
  175. package/helper/DMS.js +46 -0
  176. package/helper/HslColor.d.ts +11 -0
  177. package/helper/HslColor.js +47 -0
  178. package/helper/RgbColor.d.ts +43 -0
  179. package/helper/RgbColor.js +162 -0
  180. package/helper/SizeHelper.d.ts +10 -0
  181. package/helper/SizeHelper.js +56 -0
  182. package/helper/darken.d.ts +8 -0
  183. package/helper/darken.js +18 -0
  184. package/helper/guard.d.ts +5 -0
  185. package/helper/guard.js +7 -0
  186. package/helper/lighten.d.ts +8 -0
  187. package/helper/lighten.js +11 -0
  188. package/helper/nameToHex.d.ts +6 -0
  189. package/helper/nameToHex.js +163 -0
  190. package/inputs/DateInput/Body.d.ts +34 -0
  191. package/inputs/DateInput/Body.js +50 -0
  192. package/inputs/DateInput/Calendar.d.ts +15 -0
  193. package/inputs/DateInput/Calendar.js +60 -0
  194. package/inputs/DateInput/DateInput.d.ts +73 -0
  195. package/inputs/DateInput/DateInput.js +143 -0
  196. package/inputs/DateInput/Day.d.ts +32 -0
  197. package/inputs/DateInput/Day.js +33 -0
  198. package/inputs/DateInput/InfiniteList.d.ts +26 -0
  199. package/inputs/DateInput/InfiniteList.js +87 -0
  200. package/inputs/DateInput/Nav.d.ts +11 -0
  201. package/inputs/DateInput/Nav.js +24 -0
  202. package/inputs/DateInput/Navbar.d.ts +16 -0
  203. package/inputs/DateInput/Navbar.js +33 -0
  204. package/inputs/DateInput/NumericInput.d.ts +14 -0
  205. package/inputs/DateInput/NumericInput.js +48 -0
  206. package/inputs/DateInput/Selector.d.ts +47 -0
  207. package/inputs/DateInput/Selector.js +55 -0
  208. package/inputs/DateInput/SimpleList.d.ts +19 -0
  209. package/inputs/DateInput/SimpleList.js +31 -0
  210. package/inputs/Dropdown/Body.d.ts +25 -0
  211. package/inputs/Dropdown/Body.js +14 -0
  212. package/inputs/Dropdown/Column.d.ts +21 -0
  213. package/inputs/Dropdown/Column.js +6 -0
  214. package/inputs/Dropdown/Dropdown.d.ts +136 -0
  215. package/inputs/Dropdown/Dropdown.js +446 -0
  216. package/inputs/Dropdown/Selection.d.ts +11 -0
  217. package/inputs/Dropdown/Selection.js +23 -0
  218. package/inputs/Dropdown/Selector.d.ts +29 -0
  219. package/inputs/Dropdown/Selector.js +16 -0
  220. package/inputs/Editor/Editor.d.ts +45 -0
  221. package/inputs/Editor/Editor.js +60 -0
  222. package/inputs/Editor/buttons/BoldButton.d.ts +7 -0
  223. package/inputs/Editor/buttons/BoldButton.js +7 -0
  224. package/inputs/Editor/buttons/BulletListButton.d.ts +7 -0
  225. package/inputs/Editor/buttons/BulletListButton.js +7 -0
  226. package/inputs/Editor/buttons/CodeBlockButton.d.ts +7 -0
  227. package/inputs/Editor/buttons/CodeBlockButton.js +7 -0
  228. package/inputs/Editor/buttons/CodeButton.d.ts +7 -0
  229. package/inputs/Editor/buttons/CodeButton.js +7 -0
  230. package/inputs/Editor/buttons/ItalicButton.d.ts +7 -0
  231. package/inputs/Editor/buttons/ItalicButton.js +7 -0
  232. package/inputs/Editor/buttons/OrderedListButton.d.ts +7 -0
  233. package/inputs/Editor/buttons/OrderedListButton.js +7 -0
  234. package/inputs/Editor/buttons/StrikethroughButton.d.ts +7 -0
  235. package/inputs/Editor/buttons/StrikethroughButton.js +7 -0
  236. package/inputs/Editor/menu/MenuBar.d.ts +9 -0
  237. package/inputs/Editor/menu/MenuBar.js +44 -0
  238. package/inputs/Editor/menu/MenuButton.d.ts +35 -0
  239. package/inputs/Editor/menu/MenuButton.js +34 -0
  240. package/inputs/Editor/menu/MenuSeparator.d.ts +7 -0
  241. package/inputs/Editor/menu/MenuSeparator.js +24 -0
  242. package/inputs/Input/Clear.d.ts +7 -0
  243. package/inputs/Input/Clear.js +14 -0
  244. package/inputs/Input/Input.d.ts +133 -0
  245. package/inputs/Input/Input.js +64 -0
  246. package/inputs/Input/InputWrapper.d.ts +23 -0
  247. package/inputs/Input/InputWrapper.js +57 -0
  248. package/inputs/Input/index.d.ts +1 -0
  249. package/inputs/Input/index.js +1 -0
  250. package/inputs/Selector/ISelectorProps.d.ts +29 -0
  251. package/inputs/Selector/ISelectorProps.js +1 -0
  252. package/inputs/Selector/Selector.d.ts +29 -0
  253. package/inputs/Selector/Selector.js +77 -0
  254. package/inputs/Selector/index.d.ts +1 -0
  255. package/inputs/Selector/index.js +1 -0
  256. package/inputs/Selector/widgets/Checkbox.d.ts +6 -0
  257. package/inputs/Selector/widgets/Checkbox.js +29 -0
  258. package/inputs/Selector/widgets/Toggle.d.ts +6 -0
  259. package/inputs/Selector/widgets/Toggle.js +24 -0
  260. package/inputs/Slider/Slider.d.ts +63 -0
  261. package/inputs/Slider/Slider.js +198 -0
  262. package/inputs/Textarea/Textarea.d.ts +79 -0
  263. package/inputs/Textarea/Textarea.js +65 -0
  264. package/main.js +32 -0
  265. package/map/Map/Map.d.ts +47 -0
  266. package/map/Map/Map.js +221 -0
  267. package/map/Map/index.d.ts +1 -0
  268. package/map/Map/index.js +1 -0
  269. package/map/PositionsManager/PositionBox.d.ts +14 -0
  270. package/map/PositionsManager/PositionBox.js +86 -0
  271. package/map/PositionsManager/PositionsManager.d.ts +27 -0
  272. package/map/PositionsManager/PositionsManager.js +99 -0
  273. package/map/controls/CompassButton/CompassButton.d.ts +33 -0
  274. package/map/controls/CompassButton/CompassButton.js +88 -0
  275. package/map/controls/FullscreenButton/FullscreenButton.d.ts +21 -0
  276. package/map/controls/FullscreenButton/FullscreenButton.js +62 -0
  277. package/map/controls/Geocoder/Geocoder.d.ts +49 -0
  278. package/map/controls/Geocoder/Geocoder.js +179 -0
  279. package/map/controls/Geocoder/GeocoderApi.d.ts +59 -0
  280. package/map/controls/Geocoder/GeocoderApi.js +68 -0
  281. package/map/controls/Geocoder/GeocoderEntry.d.ts +15 -0
  282. package/map/controls/Geocoder/GeocoderEntry.js +18 -0
  283. package/map/controls/Geocoder/GeocoderList.d.ts +10 -0
  284. package/map/controls/Geocoder/GeocoderList.js +18 -0
  285. package/map/controls/Geocoder/GeocoderSelector.d.ts +16 -0
  286. package/map/controls/Geocoder/GeocoderSelector.js +25 -0
  287. package/map/controls/Graticule/Graticule.d.ts +35 -0
  288. package/map/controls/Graticule/Graticule.js +142 -0
  289. package/map/controls/MapLoader/MapLoader.d.ts +33 -0
  290. package/map/controls/MapLoader/MapLoader.js +73 -0
  291. package/map/controls/ScaleControl/ScaleControl.d.ts +24 -0
  292. package/map/controls/ScaleControl/ScaleControl.js +107 -0
  293. package/map/controls/ZoomInButton/ZoomInButton.d.ts +19 -0
  294. package/map/controls/ZoomInButton/ZoomInButton.js +56 -0
  295. package/map/controls/ZoomOutButton/ZoomOutButton.d.ts +19 -0
  296. package/map/controls/ZoomOutButton/ZoomOutButton.js +56 -0
  297. package/map/controls/base/MapButton/Hint.d.ts +17 -0
  298. package/map/controls/base/MapButton/Hint.js +34 -0
  299. package/map/controls/base/MapButton/MapButton.d.ts +46 -0
  300. package/map/controls/base/MapButton/MapButton.js +71 -0
  301. package/map/controls/base/MapButton/index.d.ts +1 -0
  302. package/map/controls/base/MapButton/index.js +1 -0
  303. package/map/controls/base/MapButtonGroup/MapButtonGroup.d.ts +17 -0
  304. package/map/controls/base/MapButtonGroup/MapButtonGroup.js +24 -0
  305. package/map/controls/base/MapControl/MapControl.d.ts +36 -0
  306. package/map/controls/base/MapControl/MapControl.js +77 -0
  307. package/map/controls/base/MapControl/index.d.ts +1 -0
  308. package/map/controls/base/MapControl/index.js +1 -0
  309. package/map/layers/ClusterLayer/ClusterLayer.d.ts +79 -0
  310. package/map/layers/ClusterLayer/ClusterLayer.js +118 -0
  311. package/map/layers/HtmlMarkerLayer/HtmlMarkerLayer.d.ts +51 -0
  312. package/map/layers/HtmlMarkerLayer/HtmlMarkerLayer.js +151 -0
  313. package/map/layers/InterpolationLayer/ContoursFragmentShader.d.ts +2 -0
  314. package/map/layers/InterpolationLayer/ContoursFragmentShader.js +2 -0
  315. package/map/layers/InterpolationLayer/ContoursVertexShader.d.ts +2 -0
  316. package/map/layers/InterpolationLayer/ContoursVertexShader.js +2 -0
  317. package/map/layers/InterpolationLayer/IGradientStop.d.ts +5 -0
  318. package/map/layers/InterpolationLayer/IGradientStop.js +1 -0
  319. package/map/layers/InterpolationLayer/InterpolationLayer.d.ts +35 -0
  320. package/map/layers/InterpolationLayer/InterpolationLayer.js +256 -0
  321. package/map/layers/InterpolationLayer/LevelsFragmentShader.d.ts +2 -0
  322. package/map/layers/InterpolationLayer/LevelsFragmentShader.js +2 -0
  323. package/map/layers/InterpolationLayer/LevelsVertexShader.d.ts +2 -0
  324. package/map/layers/InterpolationLayer/LevelsVertexShader.js +2 -0
  325. package/map/layers/ParticlesLayer/ParticlesFragmentShader.d.ts +2 -0
  326. package/map/layers/ParticlesLayer/ParticlesFragmentShader.js +2 -0
  327. package/map/layers/ParticlesLayer/ParticlesLayer.d.ts +40 -0
  328. package/map/layers/ParticlesLayer/ParticlesLayer.js +337 -0
  329. package/map/layers/ParticlesLayer/ParticlesVertexShader.d.ts +2 -0
  330. package/map/layers/ParticlesLayer/ParticlesVertexShader.js +2 -0
  331. package/map/layers/ParticlesLayer/UVFragmentShader.d.ts +2 -0
  332. package/map/layers/ParticlesLayer/UVFragmentShader.js +2 -0
  333. package/map/layers/ParticlesLayer/UVVertexShader.d.ts +2 -0
  334. package/map/layers/ParticlesLayer/UVVertexShader.js +2 -0
  335. package/map/markers/ClusterMarker/ClusterMarker.d.ts +36 -0
  336. package/map/markers/ClusterMarker/ClusterMarker.js +99 -0
  337. package/map/markers/ClusterMarker/index.d.ts +1 -0
  338. package/map/markers/ClusterMarker/index.js +1 -0
  339. package/map/markers/RiskMarker/RiskMarker.d.ts +22 -0
  340. package/map/markers/RiskMarker/RiskMarker.js +61 -0
  341. package/modules/MainMenu/Item.d.ts +42 -0
  342. package/modules/MainMenu/Item.js +94 -0
  343. package/modules/MainMenu/MainMenu.d.ts +20 -0
  344. package/modules/MainMenu/MainMenu.js +41 -0
  345. package/modules/MainMenu/index.d.ts +1 -0
  346. package/modules/MainMenu/index.js +1 -0
  347. package/modules/Root/Content.d.ts +16 -0
  348. package/modules/Root/Content.js +25 -0
  349. package/modules/Root/Overlay.d.ts +23 -0
  350. package/modules/Root/Overlay.js +33 -0
  351. package/modules/Root/Root.d.ts +7 -0
  352. package/modules/Root/Root.js +45 -0
  353. package/modules/Root/Shader.d.ts +15 -0
  354. package/modules/Root/Shader.js +24 -0
  355. package/modules/Root/Sidebar.d.ts +13 -0
  356. package/modules/Root/Sidebar.js +24 -0
  357. package/modules/Root/stories/SampleContent.d.ts +7 -0
  358. package/modules/Root/stories/SampleContent.js +44 -0
  359. package/package.json +64 -0
  360. package/services/Dialog/AlertDialog.d.ts +31 -0
  361. package/services/Dialog/AlertDialog.js +29 -0
  362. package/services/Dialog/ConfirmDialog.d.ts +34 -0
  363. package/services/Dialog/ConfirmDialog.js +30 -0
  364. package/services/Dialog/Dialog.d.ts +91 -0
  365. package/services/Dialog/Dialog.js +92 -0
  366. package/services/Dialog/DialogBackground.d.ts +7 -0
  367. package/services/Dialog/DialogBackground.js +12 -0
  368. package/services/Dialog/DialogContent.d.ts +25 -0
  369. package/services/Dialog/DialogContent.js +38 -0
  370. package/services/Dialog/DialogFooter.d.ts +24 -0
  371. package/services/Dialog/DialogFooter.js +50 -0
  372. package/services/Dialog/DialogHeader.d.ts +18 -0
  373. package/services/Dialog/DialogHeader.js +36 -0
  374. package/services/Dialog/DialogWindow.d.ts +13 -0
  375. package/services/Dialog/DialogWindow.js +12 -0
  376. package/services/Dialog/XhrDialog.d.ts +34 -0
  377. package/services/Dialog/XhrDialog.js +321 -0
  378. package/services/Toast/IToastMessage.d.ts +10 -0
  379. package/services/Toast/IToastMessage.js +1 -0
  380. package/services/Toast/IToastProps.d.ts +23 -0
  381. package/services/Toast/IToastProps.js +1 -0
  382. package/services/Toast/Toast.d.ts +21 -0
  383. package/services/Toast/Toast.js +79 -0
  384. package/services/Toast/ToastContainer.d.ts +40 -0
  385. package/services/Toast/ToastContainer.js +65 -0
  386. package/services/Toast/ToastContext.d.ts +22 -0
  387. package/services/Toast/ToastContext.js +7 -0
  388. package/services/Toast/ToastProvider.d.ts +19 -0
  389. package/services/Toast/ToastProvider.js +67 -0
  390. package/services/Toast/index.d.ts +2 -0
  391. package/services/Toast/index.js +2 -0
  392. package/services/Toast/useToast.d.ts +5 -0
  393. package/services/Toast/useToast.js +9 -0
  394. package/spritemap.svg +1 -0
  395. package/styles/NormalTheme.d.ts +3 -0
  396. package/styles/NormalTheme.js +65 -0
  397. package/styles/StyleBase.d.ts +2 -0
  398. package/styles/StyleBase.js +8 -0
  399. package/styles/StyleReset.d.ts +2 -0
  400. package/styles/StyleReset.js +8 -0
  401. package/svg/editor/index.d.ts +10 -0
  402. package/svg/editor/index.js +11 -0
  403. package/svg/file/index.d.ts +5 -0
  404. package/svg/file/index.js +6 -0
  405. package/svg/icons/index.d.ts +36 -0
  406. package/svg/icons/index.js +37 -0
  407. package/svg/index.d.ts +11 -0
  408. package/svg/index.js +5 -0
  409. package/svg/menu/index.d.ts +8 -0
  410. package/svg/menu/index.js +9 -0
@@ -0,0 +1,446 @@
1
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
2
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
3
+ return cooked;
4
+ };
5
+ var __assign = (this && this.__assign) || function () {
6
+ __assign = Object.assign || function(t) {
7
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
8
+ s = arguments[i];
9
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
10
+ t[p] = s[p];
11
+ }
12
+ return t;
13
+ };
14
+ return __assign.apply(this, arguments);
15
+ };
16
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
17
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
18
+ return new (P || (P = Promise))(function (resolve, reject) {
19
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
20
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
21
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
22
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
23
+ });
24
+ };
25
+ var __generator = (this && this.__generator) || function (thisArg, body) {
26
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
27
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
28
+ function verb(n) { return function (v) { return step([n, v]); }; }
29
+ function step(op) {
30
+ if (f) throw new TypeError("Generator is already executing.");
31
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
32
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
33
+ if (y = 0, t) op = [op[0] & 2, t.value];
34
+ switch (op[0]) {
35
+ case 0: case 1: t = op; break;
36
+ case 4: _.label++; return { value: op[1], done: false };
37
+ case 5: _.label++; y = op[1]; op = [0]; continue;
38
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
39
+ default:
40
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
41
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
42
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
43
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
44
+ if (t[2]) _.ops.pop();
45
+ _.trys.pop(); continue;
46
+ }
47
+ op = body.call(thisArg, _);
48
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
49
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
50
+ }
51
+ };
52
+ var __rest = (this && this.__rest) || function (s, e) {
53
+ var t = {};
54
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
55
+ t[p] = s[p];
56
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
57
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
58
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
59
+ t[p[i]] = s[p[i]];
60
+ }
61
+ return t;
62
+ };
63
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
64
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
65
+ if (ar || !(i in from)) {
66
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
67
+ ar[i] = from[i];
68
+ }
69
+ }
70
+ return to.concat(ar || Array.prototype.slice.call(from));
71
+ };
72
+ import * as React from 'react';
73
+ import styled, { css } from 'styled-components';
74
+ import AwesomeDebouncePromise from 'awesome-debounce-promise';
75
+ // Other controls
76
+ import { Column } from './Column';
77
+ import { Body } from './Body';
78
+ import { Selector } from './Selector';
79
+ import { Selection } from './Selection';
80
+ import { ListRow } from '../../containers/List/ListRow';
81
+ import { ListCell } from '../../containers/List';
82
+ var DropdownBase = function (props) {
83
+ // Current value. Keeps track of current value without waiting for new
84
+ // value from form, in case there is no form parent.
85
+ var _a = React.useState(props.value), value = _a[0], setValue = _a[1];
86
+ // Ref to wrapper:
87
+ var wrapperRef = React.useRef(null);
88
+ // Ref to scrollable body content:
89
+ var bodyRef = React.useRef(null);
90
+ // Is dropdown currently open?
91
+ var _b = React.useState(false), open = _b[0], setOpen = _b[1];
92
+ // Does the Dropdown open upwards? This happens when it is on the lower half
93
+ // of the viewport.
94
+ var _c = React.useState(false), upwards = _c[0], setUpwards = _c[1];
95
+ // Current search query.
96
+ var _d = React.useState(null), search = _d[0], setSearch = _d[1];
97
+ // A mousedown event listener is attached to the document. When the document
98
+ // is clicked anywhere but this Dropdown, the Dropdown closes.
99
+ React.useEffect(function () {
100
+ // Listen for document-wide mousedown/keydown events when Dropdown mounts.
101
+ document.addEventListener('mousedown', handleClickOutside);
102
+ return function () {
103
+ // Clean up document-wide mousedown/keydown events when Dropdown unmounts.
104
+ document.removeEventListener('mousedown', handleClickOutside);
105
+ };
106
+ }, []);
107
+ // When value props changes, change local state value also.
108
+ React.useEffect(function () {
109
+ setValue(props.value);
110
+ }, [props.value]);
111
+ // Handle document-wide mousedown event by closing the Dropdown.
112
+ var handleClickOutside = function (event) {
113
+ var elem = event.target;
114
+ if (wrapperRef.current && !wrapperRef.current.contains(elem)) {
115
+ doClose();
116
+ }
117
+ };
118
+ var findScrollingParentRecursive = function (node) {
119
+ var overflowY = window.getComputedStyle(node).overflowY;
120
+ if (overflowY == 'scroll' || overflowY == 'auto')
121
+ return node;
122
+ if (node.parentElement)
123
+ return findScrollingParentRecursive(node.parentElement);
124
+ return null;
125
+ };
126
+ // Return my nearest parent that's scrolling (frames are not supported). If
127
+ // no parent is found, null is returned.
128
+ var findScrollingParent = function () {
129
+ return findScrollingParentRecursive(wrapperRef.current.parentElement);
130
+ };
131
+ // Returns true if the input is in the lower half of its scrolling parent.
132
+ // (if direction == parent), or in the lower half of the viewport if no
133
+ // scrolling parent is found.
134
+ var isInLowerViewport = function () {
135
+ var scrollingParent = findScrollingParent();
136
+ if (scrollingParent == null || props.direction !== 'parent') {
137
+ return wrapperRef.current.getBoundingClientRect().top > window.innerHeight / 2;
138
+ }
139
+ else {
140
+ var myY = wrapperRef.current.getBoundingClientRect().top;
141
+ var containerY = scrollingParent.getBoundingClientRect().top;
142
+ var containerHeight = scrollingParent.getBoundingClientRect().height;
143
+ var offset = myY - containerY;
144
+ return offset > containerHeight / 2;
145
+ }
146
+ };
147
+ // Open the dropdown.
148
+ var doOpen = function () {
149
+ // Is the Dropdown below the middle of the viewport?
150
+ var below = isInLowerViewport();
151
+ // Set opening direction.
152
+ if (props.direction === 'down')
153
+ setUpwards(false);
154
+ else if (props.direction === 'up')
155
+ setUpwards(true);
156
+ else
157
+ setUpwards(below);
158
+ setOpen(true);
159
+ // If reset on open is specified, then the search query is reset whenever the
160
+ // dropdown opens or reopens.
161
+ if (props.resetOnOpen)
162
+ setSearch(null);
163
+ // If a search box is present, move focus to it:
164
+ if (props.onSearch) {
165
+ var input = wrapperRef.current.querySelector('input');
166
+ input.focus();
167
+ // In IE/Chrome, body content scrolls up a little when setting focus
168
+ // to search input. Scroll it back to top.
169
+ wrapperRef.current.children[1].scrollTop = 0;
170
+ }
171
+ };
172
+ // Close the dropdown.
173
+ var doClose = function () {
174
+ setOpen(false);
175
+ // When the dropdown is closed, an onClose event may be fired.
176
+ // It is fired 300ms after dropdown closure to give the close
177
+ // animation a chance to run, before any changes are made
178
+ // to the dropdown's contents.
179
+ if (props.onClose) {
180
+ setTimeout(props.onClose, 300);
181
+ }
182
+ };
183
+ // The selector was clicked, open the Dropdown, or close
184
+ // it if it was open.
185
+ var handleSelectorClicked = function () {
186
+ // Disabled or ghosted input cannot be clicked.
187
+ if (props.disabled || props.ghost)
188
+ return;
189
+ if (open) {
190
+ doClose();
191
+ }
192
+ else {
193
+ doOpen();
194
+ }
195
+ };
196
+ //
197
+ // Given a single character, find the first data item that starts with
198
+ // that character. If such an item is found, it is made the current selection.
199
+ //
200
+ // Data items are compared by converting them to strings. If a data item is
201
+ // an object, all its keys are converted to strings and compared.
202
+ //
203
+ var selectItemByCharacter = function (c) {
204
+ c = c.toLowerCase();
205
+ // Go through all (non-null) data records:
206
+ var idx = props.data.filter(function (r) { return r != null; }).findIndex(function (row) {
207
+ // Build a list of strings contained in the data row:
208
+ var strings = [];
209
+ // If data row is an object, convert all its keys to string.
210
+ if (typeof row === 'object' && row != null) {
211
+ for (var p in row)
212
+ strings.push(row[p].toString());
213
+ // If data row is not an object, just convert its value to a string.
214
+ }
215
+ else {
216
+ strings.push(row.toString());
217
+ }
218
+ return strings.find(function (s) { return s.length > 0 && s.charAt(0).toLowerCase() == c; });
219
+ });
220
+ // Was a matching row found?
221
+ if (idx != -1) {
222
+ handleClick(props.data[idx]);
223
+ }
224
+ };
225
+ var selectPreviousItem = function () {
226
+ var prevIndex = props.data.indexOf(value) - 1;
227
+ if (prevIndex < 0)
228
+ prevIndex = 0;
229
+ if (props.data.length <= prevIndex)
230
+ return;
231
+ updateValue(props.data[prevIndex]);
232
+ bodyRef.current.children[prevIndex].scrollIntoView({ block: 'start', inline: 'nearest' });
233
+ };
234
+ var selectNextItem = function () {
235
+ var nextIndex = props.data.indexOf(value) + 1;
236
+ if (props.data.length <= nextIndex)
237
+ return;
238
+ updateValue(props.data[nextIndex]);
239
+ bodyRef.current.children[nextIndex].scrollIntoView({ block: 'end', inline: 'nearest' });
240
+ };
241
+ //
242
+ // A key was pressed while the selector had focus.
243
+ //
244
+ var handleKeyDown = function (e) {
245
+ if (document.activeElement != wrapperRef.current)
246
+ return;
247
+ if (props.disabled || props.ghost)
248
+ return;
249
+ var key = e.key;
250
+ if (key == 'Escape' || key == 'Tab') {
251
+ e.stopPropagation();
252
+ if (!open)
253
+ return;
254
+ doClose();
255
+ }
256
+ if (key == 'Enter') {
257
+ e.stopPropagation();
258
+ if (!open)
259
+ return;
260
+ doClose();
261
+ }
262
+ if (key == ' ') {
263
+ e.stopPropagation();
264
+ if (open)
265
+ return;
266
+ doOpen();
267
+ }
268
+ if (key == 'ArrowUp') {
269
+ e.stopPropagation();
270
+ selectPreviousItem();
271
+ }
272
+ if (key == 'ArrowDown') {
273
+ e.stopPropagation();
274
+ selectNextItem();
275
+ }
276
+ // Is a letter or a digit pressed?
277
+ if (key.length == 1 && key.match(/[a-z0-9]/i)) {
278
+ e.stopPropagation();
279
+ selectItemByCharacter(key);
280
+ }
281
+ // Any other key's propagation is not stopped (most importantly
282
+ // the TAB key to navigate to the next control).
283
+ };
284
+ var updateValue = function (item) {
285
+ setValue(item);
286
+ if (props.onChange) {
287
+ props.onChange(item);
288
+ }
289
+ };
290
+ var updateValueAndClose = function (item) {
291
+ doClose();
292
+ updateValue(item);
293
+ };
294
+ // An item was clicked. Close Dropdown and call onChange.
295
+ var handleClick = function (item) {
296
+ // Is this a multiple-selection dropdown?
297
+ if (props.multiple) {
298
+ var array = value;
299
+ if (array == null)
300
+ array = [];
301
+ // Compare the new item with the existing selection items
302
+ // using deep comparision.
303
+ var newItem_1 = JSON.stringify(item);
304
+ if (array.find(function (x) { return JSON.stringify(x) == newItem_1; })) {
305
+ // Item already in selection. Just re-set the
306
+ // existing selection.
307
+ updateValueAndClose(array);
308
+ }
309
+ else {
310
+ // Item not in selection. Add it.
311
+ array.push(item);
312
+ updateValueAndClose(array);
313
+ }
314
+ }
315
+ // Not a multiple-selection dropdown. Simply
316
+ // set the selection to the new item.
317
+ else {
318
+ updateValueAndClose(item);
319
+ }
320
+ };
321
+ // Remove item from selection.
322
+ var handleDelete = function (item) {
323
+ // Find item in value array:
324
+ var array = value;
325
+ var toDelete = JSON.stringify(item);
326
+ var index = array.findIndex(function (x) { return JSON.stringify(x) == toDelete; });
327
+ // Remove item from selection:
328
+ array.splice(index, 1);
329
+ // Set new selection:
330
+ updateValueAndClose(__spreadArray([], array, true));
331
+ };
332
+ var handleClear = function () {
333
+ if (props.multiple) {
334
+ updateValueAndClose([]);
335
+ }
336
+ else {
337
+ updateValueAndClose(null);
338
+ }
339
+ };
340
+ // Search is debounced by 350ms:
341
+ var doSearch = function (value) { return props.onSearch(value); };
342
+ var doSearchBebounced = AwesomeDebouncePromise(doSearch, 350);
343
+ var handleSearch = function (value) { return __awaiter(void 0, void 0, void 0, function () {
344
+ return __generator(this, function (_a) {
345
+ setSearch(value);
346
+ doSearchBebounced(value);
347
+ return [2 /*return*/];
348
+ });
349
+ }); };
350
+ // Determine body rows:
351
+ var getBodyChildren = function () {
352
+ var columns = React.Children.map(props.children, function (child) {
353
+ // Only Column children are considered:
354
+ if (child.type && child.type === Column)
355
+ return child;
356
+ });
357
+ var activeIndex = props.data.indexOf(value);
358
+ return props.data.map(function (row, index) {
359
+ return (React.createElement(ListRow, { active: index == activeIndex, key: index + 1, gap: props.gap, onClick: function () { return handleClick(row); } }, columns.map(function (child, index) {
360
+ return (React.createElement(ListCell, { key: index, width: child.props.width, align: child.props.align }, row !== null && child.props.children(row)));
361
+ })));
362
+ });
363
+ };
364
+ // Determine label:
365
+ // By default, we use the placeholder.
366
+ var label = props.placeholder;
367
+ var showPlaceholder = true;
368
+ // Single-selection dropdowns:
369
+ // If the Dropdown has a value, format it and use as label.
370
+ if (!props.multiple) {
371
+ if (value !== null && value !== undefined) {
372
+ label = props.label(value);
373
+ showPlaceholder = false;
374
+ }
375
+ }
376
+ // Multiple-selection dropdowns:
377
+ if (props.multiple) {
378
+ // Warn if value is not an array, and not null:
379
+ if (!Array.isArray(value) && value !== null && value !== undefined) {
380
+ console.error("In a multiple-selection checkbox, value should be an array.");
381
+ }
382
+ // Is the value not the empty array, and not null?
383
+ if (value != null && value.length > 0) {
384
+ showPlaceholder = false;
385
+ // Turn value elements into Selections.
386
+ label = value.map(function (item, index) {
387
+ return React.createElement(Selection, { key: index, onClick: function () { return handleDelete(item); } }, props.label(item));
388
+ });
389
+ }
390
+ }
391
+ // If Dropdown is clicked, then click Selector.
392
+ var handleClickDropdown = function () {
393
+ wrapperRef.current.children[0].click();
394
+ };
395
+ var children = getBodyChildren();
396
+ return (React.createElement("div", { className: props.className, tabIndex: props.disabled ? -1 : 0, ref: wrapperRef, onKeyDown: handleKeyDown, onClick: handleClickDropdown },
397
+ React.createElement(Selector, { open: open, error: props.error, disabled: props.disabled, upwards: upwards, transparent: props.transparent, ghost: props.ghost, multiple: props.multiple, onClick: handleSelectorClicked, onClear: (props.clearable && !showPlaceholder) ? handleClear : null, placeholder: showPlaceholder }, label),
398
+ React.createElement(Body, { ref: bodyRef, upwards: upwards, open: open, transparent: props.transparent, maxItems: props.maxItems, onSearch: props.onSearch ? handleSearch : null, search: search, tall: props.tall }, children)));
399
+ };
400
+ var DropdownStyled = styled(DropdownBase)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n position: relative;\n // Dropdown has a minimum width. \n width: 250px;\n // A fluid Dropdown occupies full horizontal width. \n ", " \n outline: none;\n user-select: none;\n font: ", ";\n color: ", ";\n"], ["\n position: relative;\n // Dropdown has a minimum width. \n width: 250px;\n // A fluid Dropdown occupies full horizontal width. \n ", " \n outline: none;\n user-select: none;\n font: ", ";\n color: ", ";\n"
401
+ /**
402
+ * A `Dropdown` is a replacement for `<select>` (select). It opens upwards or
403
+ * downwards depending on its position in the viewport. Its selection and
404
+ * dropdown items are formatted using a formatting function. A Dropdown can
405
+ * also take an `onSearch` callback, which tells provides its subscriber with
406
+ * a search query in order to provide the `Dropdown` with new items.
407
+ *
408
+ * ```jsx
409
+ * <Dropdown
410
+ * data={[{id: 1, name: 'One'}, {id: 2, name: 'Two'}, {id: 3, name: 'Three'}]}
411
+ * label={(item: any) => item.name}
412
+ * placeholder="Select one"
413
+ * >
414
+ * <Dropdown.Column>{(item: any) => item.name}</Dropdown.Column>
415
+ * </Dropdown>
416
+ * ```
417
+ */
418
+ ])), function (p) { return p.fluid && css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["width: 100%;"], ["width: 100%;"]))); }, function (p) { return p.theme.font.bodyLarge; }, function (p) { return p.theme.colors.neutral[30]; });
419
+ /**
420
+ * A `Dropdown` is a replacement for `<select>` (select). It opens upwards or
421
+ * downwards depending on its position in the viewport. Its selection and
422
+ * dropdown items are formatted using a formatting function. A Dropdown can
423
+ * also take an `onSearch` callback, which tells provides its subscriber with
424
+ * a search query in order to provide the `Dropdown` with new items.
425
+ *
426
+ * ```jsx
427
+ * <Dropdown
428
+ * data={[{id: 1, name: 'One'}, {id: 2, name: 'Two'}, {id: 3, name: 'Three'}]}
429
+ * label={(item: any) => item.name}
430
+ * placeholder="Select one"
431
+ * >
432
+ * <Dropdown.Column>{(item: any) => item.name}</Dropdown.Column>
433
+ * </Dropdown>
434
+ * ```
435
+ */
436
+ var Dropdown = function (_a) {
437
+ var _b = _a.direction, direction = _b === void 0 ? 'none' : _b, _c = _a.fluid, fluid = _c === void 0 ? false : _c, _d = _a.clearable, clearable = _d === void 0 ? false : _d, _e = _a.disabled, disabled = _e === void 0 ? false : _e, _f = _a.transparent, transparent = _f === void 0 ? false : _f, _g = _a.error, error = _g === void 0 ? false : _g, _h = _a.multiple, multiple = _h === void 0 ? false : _h, _j = _a.resetOnOpen, resetOnOpen = _j === void 0 ? false : _j, _k = _a.gap, gap = _k === void 0 ? 16 : _k, _l = _a.maxItems, maxItems = _l === void 0 ? 6 : _l, _m = _a.tall, tall = _m === void 0 ? false : _m, _o = _a.label, label = _o === void 0 ? function (item) { return item; } : _o, props = __rest(_a, ["direction", "fluid", "clearable", "disabled", "transparent", "error", "multiple", "resetOnOpen", "gap", "maxItems", "tall", "label"]);
438
+ return React.createElement(DropdownStyled, __assign({ direction: direction, fluid: fluid, clearable: clearable, disabled: disabled, transparent: transparent, error: error, multiple: multiple, resetOnOpen: resetOnOpen, gap: gap, maxItems: maxItems, tall: tall, label: label }, props));
439
+ };
440
+ /**
441
+ * A Dropdown.Column's child is an item formatter function. A column can
442
+ * optionally take a weight and an alignment.
443
+ */
444
+ Dropdown.Column = Column;
445
+ export { Dropdown };
446
+ var templateObject_1, templateObject_2;
@@ -0,0 +1,11 @@
1
+ import * as React from 'react';
2
+ interface IProps {
3
+ /** @ignore */
4
+ className?: string;
5
+ /** @ignore */
6
+ children?: React.ReactNode;
7
+ /** Fired when selection is clicked. */
8
+ onClick: () => void;
9
+ }
10
+ declare const Selection: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<IProps, never>> & string & Omit<(props: IProps) => React.JSX.Element, keyof React.Component<any, {}, any>>;
11
+ export { Selection };
@@ -0,0 +1,23 @@
1
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
2
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
3
+ return cooked;
4
+ };
5
+ import * as React from 'react';
6
+ import styled from 'styled-components';
7
+ import { SVG } from '../../svg';
8
+ var SelectionBase = function (props) {
9
+ // Handle clicks locally so that they don't propagate
10
+ // to the Selector, then send them on to the subscriber.
11
+ var handleClick = function (e) {
12
+ e.stopPropagation();
13
+ props.onClick();
14
+ };
15
+ // Item function is only called when item is not null.
16
+ return (React.createElement("div", { className: props.className, onClick: handleClick },
17
+ props.children,
18
+ React.createElement("svg", null,
19
+ React.createElement("use", { xlinkHref: SVG.Icons.Cross }))));
20
+ };
21
+ var Selection = styled(SelectionBase)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n display: inline-block;\n align-items: center;\n box-sizing: border-box;\n border-radius: ", "px;\n background-color: ", ";\n color: ", ";\n padding: 2px 20px 2px 8px;\n margin-right: 4px;\n white-space: nowrap;\n user-select: none;\n\n &>svg {\n position: absolute;\n right: 5px;\n top: 4px;\n width: 14px;\n height: 14px; \n fill: ", ";\n transition: fill ", "ms ease;\n }\n\n transition: background-color ", "ms ease;\n &:hover {\n background-color: ", ";\n &>svg {\n fill: #fff;\n }\n }\n\n &.item-enter {\n opacity: 0;\n }\n &.item-enter-active {\n opacity: 1;\n transition: opacity 300ms ease-in;\n }\n &.item-exit {\n opacity: 1;\n }\n &.item-exit-active {\n opacity: 0;\n transition: opacity 300ms ease-in;\n } \n"], ["\n position: relative;\n display: inline-block;\n align-items: center;\n box-sizing: border-box;\n border-radius: ", "px;\n background-color: ", ";\n color: ", ";\n padding: 2px 20px 2px 8px;\n margin-right: 4px;\n white-space: nowrap;\n user-select: none;\n\n &>svg {\n position: absolute;\n right: 5px;\n top: 4px;\n width: 14px;\n height: 14px; \n fill: ", ";\n transition: fill ", "ms ease;\n }\n\n transition: background-color ", "ms ease;\n &:hover {\n background-color: ", ";\n &>svg {\n fill: #fff;\n }\n }\n\n &.item-enter {\n opacity: 0;\n }\n &.item-enter-active {\n opacity: 1;\n transition: opacity 300ms ease-in;\n }\n &.item-exit {\n opacity: 1;\n }\n &.item-exit-active {\n opacity: 0;\n transition: opacity 300ms ease-in;\n } \n"])), function (p) { return p.theme.radius.normal; }, function (p) { return p.theme.colors.primary[2]; }, function (p) { return p.theme.colors.font; }, function (p) { return p.theme.colors.font; }, function (p) { return p.theme.animation.duration; }, function (p) { return p.theme.animation.duration; }, function (p) { return p.theme.colors.primary[1]; });
22
+ export { Selection };
23
+ var templateObject_1;
@@ -0,0 +1,29 @@
1
+ import * as React from 'react';
2
+ interface IProps {
3
+ /** @ignore */
4
+ className?: string;
5
+ /** @ignore */
6
+ children?: React.ReactNode;
7
+ /** Dropdown currently disabled? */
8
+ disabled?: boolean;
9
+ /** Is the Dropdown currently open? */
10
+ open: boolean;
11
+ /** A Dropbox can open upwards, which affects its styles. */
12
+ upwards: boolean;
13
+ /** Is the Dropdown transparent, i.e. without a border? */
14
+ transparent?: boolean;
15
+ /** Is the Dropdown ghosted? */
16
+ ghost?: boolean;
17
+ /** Is this label a placeholder? Then it will be lighter in color. */
18
+ placeholder?: boolean;
19
+ /** Error state? */
20
+ error?: boolean;
21
+ /** Multiple selection? This will result in smaller padding to accommodate <Selection> items. */
22
+ multiple?: boolean;
23
+ /** Fired when selector is clicked. */
24
+ onClick: () => void;
25
+ /** Fired when clear icon is clicked. */
26
+ onClear?: () => void;
27
+ }
28
+ declare const Selector: (props: IProps) => React.JSX.Element;
29
+ export { Selector };
@@ -0,0 +1,16 @@
1
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
2
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
3
+ return cooked;
4
+ };
5
+ import * as React from 'react';
6
+ import styled, { css } from 'styled-components';
7
+ // Helpers
8
+ import { SVG } from '../../svg';
9
+ import { InputWrapper } from '../Input/InputWrapper';
10
+ var Selector = function (props) {
11
+ return (React.createElement(InputWrapper, { fluid: true, ghost: props.ghost, error: props.error, disabled: props.disabled, transparent: props.transparent, onClick: props.onClick, onClear: props.onClear, icon: props.onClear ? null : SVG.Icons.Caret, iconPosition: 'right' },
12
+ React.createElement(Selection, { tabIndex: -1, "$multiple": props.multiple, "$placeholder": props.placeholder }, props.children)));
13
+ };
14
+ var Selection = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n width: calc(100% - 50px) !important;\n outline: none;\n overflow-x: hidden;\n overflow-y: hidden;\n white-space: nowrap;\n ", " \n // Add ellipsis to selection text:\n ", " \n"], ["\n width: calc(100% - 50px) !important;\n outline: none;\n overflow-x: hidden;\n overflow-y: hidden;\n white-space: nowrap;\n ", " \n // Add ellipsis to selection text:\n ", " \n"])), function (p) { return p.$placeholder && css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n color: rgb(from ", " r g b / 50%);\n "], ["\n color: rgb(from ", " r g b / 50%);\n "])), function (p) { return p.theme.colors.primary[3]; }); }, function (p) { return !p.$multiple && css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["text-overflow: ellipsis;"], ["text-overflow: ellipsis;"]))); });
15
+ export { Selector };
16
+ var templateObject_1, templateObject_2, templateObject_3;
@@ -0,0 +1,45 @@
1
+ import * as React from 'react';
2
+ interface IProps {
3
+ /** @ignore */
4
+ className?: string;
5
+ /**
6
+ * Editor name.
7
+ */
8
+ name?: string;
9
+ /**
10
+ * Current Editor value.
11
+ */
12
+ value?: any;
13
+ /**
14
+ * A fluid Editor takes up all available horizontal space available to it.
15
+ * @default false
16
+ */
17
+ fluid?: boolean;
18
+ /**
19
+ * An Editor can show an error state.
20
+ * @default false
21
+ */
22
+ error?: boolean;
23
+ /**
24
+ * Marks Editor as disabled. Disabled editors cannot be interacted with.
25
+ * @default false
26
+ */
27
+ disabled?: boolean;
28
+ /**
29
+ * Removes Editor border and makes background transparent. This is useful
30
+ * for placing an editor in a `Field`.
31
+ * @default false
32
+ */
33
+ transparent?: boolean;
34
+ /**
35
+ * An Editor can be in a ghost state, where content is being loaded.
36
+ * @default false
37
+ */
38
+ ghost?: boolean;
39
+ /**
40
+ * Listeners are notified whenever the user interacts with the Editor.
41
+ */
42
+ onChange?: (value: any) => void;
43
+ }
44
+ declare const Editor: ({ fluid, error, disabled, transparent, ghost, ...props }: IProps) => React.JSX.Element;
45
+ export { Editor };
@@ -0,0 +1,60 @@
1
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
2
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
3
+ return cooked;
4
+ };
5
+ var __assign = (this && this.__assign) || function () {
6
+ __assign = Object.assign || function(t) {
7
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
8
+ s = arguments[i];
9
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
10
+ t[p] = s[p];
11
+ }
12
+ return t;
13
+ };
14
+ return __assign.apply(this, arguments);
15
+ };
16
+ var __rest = (this && this.__rest) || function (s, e) {
17
+ var t = {};
18
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
19
+ t[p] = s[p];
20
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
21
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
22
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
23
+ t[p[i]] = s[p[i]];
24
+ }
25
+ return t;
26
+ };
27
+ import * as React from 'react';
28
+ import { useEditor, EditorContent } from '@tiptap/react';
29
+ import StarterKit from '@tiptap/starter-kit';
30
+ import styled from 'styled-components';
31
+ import { MenuBar } from './menu/MenuBar';
32
+ import { InputWrapper } from '../Input/InputWrapper';
33
+ // define your extension array
34
+ var extensions = [StarterKit];
35
+ var EditorBase = function (props) {
36
+ var handleUpdate = function (p) {
37
+ if (props.onChange)
38
+ props.onChange(p.editor.getHTML());
39
+ };
40
+ var editor = useEditor({
41
+ extensions: extensions,
42
+ content: props.value,
43
+ injectCSS: false,
44
+ onUpdate: handleUpdate
45
+ });
46
+ React.useEffect(function () {
47
+ editor.commands.setContent(props.value, true, { preserveWhitespace: "full" });
48
+ }, [props.value]);
49
+ return (React.createElement(InputWrapper, { fluid: props.fluid, ghost: props.ghost, error: props.error, disabled: props.disabled, transparent: props.transparent },
50
+ React.createElement("div", { className: props.className },
51
+ React.createElement(MenuBar, { editor: editor }),
52
+ React.createElement(EditorContent, { editor: editor }))));
53
+ };
54
+ var EditorStyled = styled(EditorBase)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n box-sizing: border-box;\n width: 100%;\n\n .tiptap {\n border: none;\n outline: none;\n // Define colors for placeholder text.\n ::placeholder {\n color: rgb(from ", " r g b / 50%);\n opacity: 1 !important; /* Firefox applies opacity */\n }\n // Define colors for selected text.\n ::selection {\n background-color: ", ";\n color: ", ";\n } \n }\n\n // Content styles:\n .tiptap {\n code {\n background-color: ", ";\n color: ", ";\n outline: solid 1px ", ";\n border-radius: 4px;\n padding: 0 4px 0px 4px;\n }\n\n pre {\n background-color: ", ";\n border-radius: 4px;\n color: ", ";\n outline: solid 1px ", ";\n padding: 8px 12px 8px 12px;\n code {\n background-color: transparent;\n outline: none;\n border-radius: none;\n padding: 0 0 0 0;\n }\n }\n }\n"], ["\n position: relative;\n box-sizing: border-box;\n width: 100%;\n\n .tiptap {\n border: none;\n outline: none;\n // Define colors for placeholder text.\n ::placeholder {\n color: rgb(from ", " r g b / 50%);\n opacity: 1 !important; /* Firefox applies opacity */\n }\n // Define colors for selected text.\n ::selection {\n background-color: ", ";\n color: ", ";\n } \n }\n\n // Content styles:\n .tiptap {\n code {\n background-color: ", ";\n color: ", ";\n outline: solid 1px ", ";\n border-radius: 4px;\n padding: 0 4px 0px 4px;\n }\n\n pre {\n background-color: ", ";\n border-radius: 4px;\n color: ", ";\n outline: solid 1px ", ";\n padding: 8px 12px 8px 12px;\n code {\n background-color: transparent;\n outline: none;\n border-radius: none;\n padding: 0 0 0 0;\n }\n }\n }\n"])), function (p) { return p.theme.colors.primary[3]; }, function (p) { return p.theme.colors.primary[2]; }, function (p) { return p.theme.colors.neutral[100]; }, function (p) { return p.theme.colors.primary[3]; }, function (p) { return p.theme.colors.neutral[100]; }, function (p) { return p.theme.colors.primary[1]; }, function (p) { return p.theme.colors.primary[3]; }, function (p) { return p.theme.colors.neutral[100]; }, function (p) { return p.theme.colors.primary[1]; });
55
+ var Editor = function (_a) {
56
+ var _b = _a.fluid, fluid = _b === void 0 ? false : _b, _c = _a.error, error = _c === void 0 ? false : _c, _d = _a.disabled, disabled = _d === void 0 ? false : _d, _e = _a.transparent, transparent = _e === void 0 ? false : _e, _f = _a.ghost, ghost = _f === void 0 ? false : _f, props = __rest(_a, ["fluid", "error", "disabled", "transparent", "ghost"]);
57
+ return React.createElement(EditorStyled, __assign({ fluid: fluid, error: error, disabled: disabled, transparent: transparent, ghost: ghost }, props));
58
+ };
59
+ export { Editor };
60
+ var templateObject_1;
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+ import { Editor } from '@tiptap/react';
3
+ interface IProps {
4
+ editor: Editor;
5
+ }
6
+ declare const BoldButton: (props: IProps) => React.JSX.Element;
7
+ export { BoldButton };
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+ import { MenuButton } from '../menu/MenuButton';
3
+ import { SVG } from '../../../svg';
4
+ var BoldButton = function (props) {
5
+ return (React.createElement(MenuButton, { editor: props.editor, hint: "Bold", keys: ["Ctrl", "B"], onClick: function () { return props.editor.chain().focus().toggleBold().run(); }, disabled: !props.editor.can().chain().focus().toggleBold().run(), active: props.editor.isActive('bold'), icon: SVG.Editor.Bold }));
6
+ };
7
+ export { BoldButton };