@cratis/components 0.1.18 → 1.0.3

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 (294) hide show
  1. package/README.md +83 -0
  2. package/dist/cjs/CommandDialog/CommandDialog.js +14 -25
  3. package/dist/cjs/CommandDialog/CommandDialog.js.map +1 -1
  4. package/dist/cjs/CommandForm/fields/CheckboxField.js +2 -2
  5. package/dist/cjs/CommandForm/fields/CheckboxField.js.map +1 -1
  6. package/dist/cjs/CommandForm/fields/DropdownField.js +5 -5
  7. package/dist/cjs/CommandForm/fields/DropdownField.js.map +1 -1
  8. package/dist/cjs/CommandForm/fields/InputTextField.js +2 -2
  9. package/dist/cjs/CommandForm/fields/InputTextField.js.map +1 -1
  10. package/dist/cjs/CommandForm/fields/NumberField.js +2 -2
  11. package/dist/cjs/CommandForm/fields/NumberField.js.map +1 -1
  12. package/dist/cjs/CommandForm/fields/SliderField.js +5 -9
  13. package/dist/cjs/CommandForm/fields/SliderField.js.map +1 -1
  14. package/dist/cjs/CommandForm/fields/TextAreaField.js +2 -2
  15. package/dist/cjs/CommandForm/fields/TextAreaField.js.map +1 -1
  16. package/dist/cjs/CommandForm/index.js +35 -15
  17. package/dist/cjs/CommandForm/index.js.map +1 -1
  18. package/dist/cjs/Common/ErrorBoundary.js +26 -0
  19. package/dist/cjs/Common/ErrorBoundary.js.map +1 -0
  20. package/dist/cjs/Common/FormElement.js +10 -0
  21. package/dist/cjs/Common/FormElement.js.map +1 -0
  22. package/dist/cjs/Common/index.js +12 -0
  23. package/dist/cjs/Common/index.js.map +1 -0
  24. package/dist/cjs/DataTables/DataTableForObservableQuery.js +53 -1
  25. package/dist/cjs/DataTables/DataTableForObservableQuery.js.map +1 -1
  26. package/dist/cjs/DataTables/DataTableForQuery.js +19 -1
  27. package/dist/cjs/DataTables/DataTableForQuery.js.map +1 -1
  28. package/dist/cjs/Dialogs/BusyIndicatorDialog.js +2 -3
  29. package/dist/cjs/Dialogs/BusyIndicatorDialog.js.map +1 -1
  30. package/dist/cjs/Dialogs/ConfirmationDialog.js +4 -21
  31. package/dist/cjs/Dialogs/ConfirmationDialog.js.map +1 -1
  32. package/dist/cjs/Dialogs/Dialog.js +66 -0
  33. package/dist/cjs/Dialogs/Dialog.js.map +1 -0
  34. package/dist/cjs/Dialogs/index.js +4 -2
  35. package/dist/cjs/Dialogs/index.js.map +1 -1
  36. package/dist/cjs/ObjectContentEditor/ObjectContentEditor.js +156 -0
  37. package/dist/cjs/ObjectContentEditor/ObjectContentEditor.js.map +1 -0
  38. package/dist/cjs/ObjectContentEditor/index.js +8 -0
  39. package/dist/cjs/ObjectContentEditor/index.js.map +1 -0
  40. package/dist/cjs/ObjectNavigationalBar/ObjectNavigationalBar.js +45 -0
  41. package/dist/cjs/ObjectNavigationalBar/ObjectNavigationalBar.js.map +1 -0
  42. package/dist/cjs/ObjectNavigationalBar/index.js +8 -0
  43. package/dist/cjs/ObjectNavigationalBar/index.js.map +1 -0
  44. package/dist/cjs/PivotViewer/components/PivotCanvas.js.map +1 -1
  45. package/dist/cjs/PivotViewer/components/PivotViewerMain.js.map +1 -1
  46. package/dist/cjs/PivotViewer/components/pivot/groups.js +15 -15
  47. package/dist/cjs/PivotViewer/components/pivot/groups.js.map +1 -1
  48. package/dist/cjs/PivotViewer/components/pivot/sprites.js +2 -2
  49. package/dist/cjs/PivotViewer/components/pivot/sprites.js.map +1 -1
  50. package/dist/cjs/PivotViewer/types.js.map +1 -1
  51. package/dist/cjs/SchemaEditor/NameCell.js +38 -0
  52. package/dist/cjs/SchemaEditor/NameCell.js.map +1 -0
  53. package/dist/cjs/SchemaEditor/SchemaEditor.js +352 -0
  54. package/dist/cjs/SchemaEditor/SchemaEditor.js.map +1 -0
  55. package/dist/cjs/SchemaEditor/SchemaEditor.module.css +11 -0
  56. package/dist/cjs/SchemaEditor/TypeCell.js +102 -0
  57. package/dist/cjs/SchemaEditor/TypeCell.js.map +1 -0
  58. package/dist/cjs/SchemaEditor/index.js +10 -0
  59. package/dist/cjs/SchemaEditor/index.js.map +1 -0
  60. package/dist/cjs/TimeMachine/TimeMachine.js +0 -3
  61. package/dist/cjs/TimeMachine/TimeMachine.js.map +1 -1
  62. package/dist/cjs/index.js +20 -12
  63. package/dist/cjs/index.js.map +1 -1
  64. package/dist/cjs/package.json +3 -0
  65. package/dist/cjs/types/TypeFormat.js +20 -0
  66. package/dist/cjs/types/TypeFormat.js.map +1 -0
  67. package/dist/esm/CommandDialog/CommandDialog.d.ts +1 -1
  68. package/dist/esm/CommandDialog/CommandDialog.d.ts.map +1 -1
  69. package/dist/esm/CommandDialog/CommandDialog.js +15 -26
  70. package/dist/esm/CommandDialog/CommandDialog.js.map +1 -1
  71. package/dist/esm/CommandDialog/CommandDialog.stories.d.ts +1 -0
  72. package/dist/esm/CommandDialog/CommandDialog.stories.d.ts.map +1 -1
  73. package/dist/esm/CommandDialog/CommandDialog.stories.js +57 -3
  74. package/dist/esm/CommandDialog/CommandDialog.stories.js.map +1 -1
  75. package/dist/esm/CommandForm/fields/CheckboxField.d.ts +3 -2
  76. package/dist/esm/CommandForm/fields/CheckboxField.d.ts.map +1 -1
  77. package/dist/esm/CommandForm/fields/CheckboxField.js +1 -1
  78. package/dist/esm/CommandForm/fields/CheckboxField.js.map +1 -1
  79. package/dist/esm/CommandForm/fields/DropdownField.d.ts +7 -6
  80. package/dist/esm/CommandForm/fields/DropdownField.d.ts.map +1 -1
  81. package/dist/esm/CommandForm/fields/DropdownField.js +6 -6
  82. package/dist/esm/CommandForm/fields/DropdownField.js.map +1 -1
  83. package/dist/esm/CommandForm/fields/Fields.stories.d.ts +13 -0
  84. package/dist/esm/CommandForm/fields/Fields.stories.d.ts.map +1 -0
  85. package/dist/esm/CommandForm/fields/Fields.stories.js +137 -0
  86. package/dist/esm/CommandForm/fields/Fields.stories.js.map +1 -0
  87. package/dist/esm/CommandForm/fields/InputTextField.d.ts +3 -2
  88. package/dist/esm/CommandForm/fields/InputTextField.d.ts.map +1 -1
  89. package/dist/esm/CommandForm/fields/InputTextField.js +1 -1
  90. package/dist/esm/CommandForm/fields/InputTextField.js.map +1 -1
  91. package/dist/esm/CommandForm/fields/NumberField.d.ts +3 -2
  92. package/dist/esm/CommandForm/fields/NumberField.d.ts.map +1 -1
  93. package/dist/esm/CommandForm/fields/NumberField.js +1 -1
  94. package/dist/esm/CommandForm/fields/NumberField.js.map +1 -1
  95. package/dist/esm/CommandForm/fields/SliderField.d.ts +5 -4
  96. package/dist/esm/CommandForm/fields/SliderField.d.ts.map +1 -1
  97. package/dist/esm/CommandForm/fields/SliderField.js +5 -9
  98. package/dist/esm/CommandForm/fields/SliderField.js.map +1 -1
  99. package/dist/esm/CommandForm/fields/TextAreaField.d.ts +3 -2
  100. package/dist/esm/CommandForm/fields/TextAreaField.d.ts.map +1 -1
  101. package/dist/esm/CommandForm/fields/TextAreaField.js +1 -1
  102. package/dist/esm/CommandForm/fields/TextAreaField.js.map +1 -1
  103. package/dist/esm/CommandForm/fields/index.d.ts +2 -2
  104. package/dist/esm/CommandForm/fields/index.d.ts.map +1 -1
  105. package/dist/esm/CommandForm/fields/index.js +2 -2
  106. package/dist/esm/CommandForm/fields/index.js.map +1 -1
  107. package/dist/esm/CommandForm/index.d.ts +1 -5
  108. package/dist/esm/CommandForm/index.d.ts.map +1 -1
  109. package/dist/esm/CommandForm/index.js +3 -7
  110. package/dist/esm/CommandForm/index.js.map +1 -1
  111. package/dist/esm/Common/ErrorBoundary.d.ts +1 -1
  112. package/dist/esm/Common/ErrorBoundary.js +7 -4
  113. package/dist/esm/Common/ErrorBoundary.js.map +1 -1
  114. package/dist/esm/Common/ErrorBoundary.stories.d.ts +7 -7
  115. package/dist/esm/Common/ErrorBoundary.stories.d.ts.map +1 -1
  116. package/dist/esm/Common/ErrorBoundary.stories.js +21 -5
  117. package/dist/esm/Common/ErrorBoundary.stories.js.map +1 -1
  118. package/dist/esm/Common/FormElement.js +7 -4
  119. package/dist/esm/Common/FormElement.js.map +1 -1
  120. package/dist/esm/Common/FormElement.stories.d.ts +8 -7
  121. package/dist/esm/Common/FormElement.stories.d.ts.map +1 -1
  122. package/dist/esm/Common/FormElement.stories.js +25 -4
  123. package/dist/esm/Common/FormElement.stories.js.map +1 -1
  124. package/dist/esm/Common/Page.stories.d.ts +7 -7
  125. package/dist/esm/Common/Page.stories.d.ts.map +1 -1
  126. package/dist/esm/Common/Page.stories.js +20 -5
  127. package/dist/esm/Common/Page.stories.js.map +1 -1
  128. package/dist/esm/Common/index.js +4 -4
  129. package/dist/esm/Common/index.js.map +1 -1
  130. package/dist/esm/DataPage/DataPage.stories.d.ts +7 -7
  131. package/dist/esm/DataPage/DataPage.stories.d.ts.map +1 -1
  132. package/dist/esm/DataPage/DataPage.stories.js +33 -5
  133. package/dist/esm/DataPage/DataPage.stories.js.map +1 -1
  134. package/dist/esm/DataTables/DataTableForObservableQuery.d.ts +1 -0
  135. package/dist/esm/DataTables/DataTableForObservableQuery.d.ts.map +1 -1
  136. package/dist/esm/DataTables/DataTableForObservableQuery.js +55 -3
  137. package/dist/esm/DataTables/DataTableForObservableQuery.js.map +1 -1
  138. package/dist/esm/DataTables/DataTableForObservableQuery.stories.d.ts +7 -7
  139. package/dist/esm/DataTables/DataTableForObservableQuery.stories.d.ts.map +1 -1
  140. package/dist/esm/DataTables/DataTableForObservableQuery.stories.js +55 -5
  141. package/dist/esm/DataTables/DataTableForObservableQuery.stories.js.map +1 -1
  142. package/dist/esm/DataTables/DataTableForQuery.d.ts +1 -0
  143. package/dist/esm/DataTables/DataTableForQuery.d.ts.map +1 -1
  144. package/dist/esm/DataTables/DataTableForQuery.js +21 -3
  145. package/dist/esm/DataTables/DataTableForQuery.js.map +1 -1
  146. package/dist/esm/DataTables/DataTableForQuery.stories.d.ts +7 -7
  147. package/dist/esm/DataTables/DataTableForQuery.stories.d.ts.map +1 -1
  148. package/dist/esm/DataTables/DataTableForQuery.stories.js +31 -5
  149. package/dist/esm/DataTables/DataTableForQuery.stories.js.map +1 -1
  150. package/dist/esm/Dialogs/BusyIndicatorDialog.d.ts.map +1 -1
  151. package/dist/esm/Dialogs/BusyIndicatorDialog.js +3 -4
  152. package/dist/esm/Dialogs/BusyIndicatorDialog.js.map +1 -1
  153. package/dist/esm/Dialogs/ConfirmationDialog.d.ts.map +1 -1
  154. package/dist/esm/Dialogs/ConfirmationDialog.js +6 -23
  155. package/dist/esm/Dialogs/ConfirmationDialog.js.map +1 -1
  156. package/dist/esm/Dialogs/Dialog.d.ts +23 -0
  157. package/dist/esm/Dialogs/Dialog.d.ts.map +1 -0
  158. package/dist/esm/Dialogs/Dialog.js +64 -0
  159. package/dist/esm/Dialogs/Dialog.js.map +1 -0
  160. package/dist/esm/Dialogs/index.d.ts +2 -1
  161. package/dist/esm/Dialogs/index.d.ts.map +1 -1
  162. package/dist/esm/Dialogs/index.js +2 -1
  163. package/dist/esm/Dialogs/index.js.map +1 -1
  164. package/dist/esm/ObjectContentEditor/ObjectContentEditor.d.ts +8 -0
  165. package/dist/esm/ObjectContentEditor/ObjectContentEditor.d.ts.map +1 -0
  166. package/dist/esm/ObjectContentEditor/ObjectContentEditor.js +135 -0
  167. package/dist/esm/ObjectContentEditor/ObjectContentEditor.js.map +1 -0
  168. package/dist/esm/ObjectContentEditor/ObjectContentEditor.stories.d.ts +10 -0
  169. package/dist/esm/ObjectContentEditor/ObjectContentEditor.stories.d.ts.map +1 -0
  170. package/dist/esm/ObjectContentEditor/ObjectContentEditor.stories.js +144 -0
  171. package/dist/esm/ObjectContentEditor/ObjectContentEditor.stories.js.map +1 -0
  172. package/dist/esm/ObjectContentEditor/index.d.ts +2 -0
  173. package/dist/esm/ObjectContentEditor/index.d.ts.map +1 -0
  174. package/dist/esm/ObjectContentEditor/index.js +2 -0
  175. package/dist/esm/ObjectContentEditor/index.js.map +1 -0
  176. package/dist/esm/ObjectNavigationalBar/ObjectNavigationalBar.d.ts +6 -0
  177. package/dist/esm/ObjectNavigationalBar/ObjectNavigationalBar.d.ts.map +1 -0
  178. package/dist/esm/ObjectNavigationalBar/ObjectNavigationalBar.js +24 -0
  179. package/dist/esm/ObjectNavigationalBar/ObjectNavigationalBar.js.map +1 -0
  180. package/dist/esm/ObjectNavigationalBar/ObjectNavigationalBar.stories.d.ts +10 -0
  181. package/dist/esm/ObjectNavigationalBar/ObjectNavigationalBar.stories.d.ts.map +1 -0
  182. package/dist/esm/ObjectNavigationalBar/ObjectNavigationalBar.stories.js +46 -0
  183. package/dist/esm/ObjectNavigationalBar/ObjectNavigationalBar.stories.js.map +1 -0
  184. package/dist/esm/ObjectNavigationalBar/index.d.ts +2 -0
  185. package/dist/esm/ObjectNavigationalBar/index.d.ts.map +1 -0
  186. package/dist/esm/ObjectNavigationalBar/index.js +2 -0
  187. package/dist/esm/ObjectNavigationalBar/index.js.map +1 -0
  188. package/dist/esm/PivotViewer/components/PivotCanvas.d.ts +2 -2
  189. package/dist/esm/PivotViewer/components/PivotCanvas.d.ts.map +1 -1
  190. package/dist/esm/PivotViewer/components/PivotCanvas.js.map +1 -1
  191. package/dist/esm/PivotViewer/components/PivotViewerMain.d.ts +2 -2
  192. package/dist/esm/PivotViewer/components/PivotViewerMain.d.ts.map +1 -1
  193. package/dist/esm/PivotViewer/components/PivotViewerMain.js.map +1 -1
  194. package/dist/esm/PivotViewer/components/pivot/groups.d.ts.map +1 -1
  195. package/dist/esm/PivotViewer/components/pivot/groups.js +2 -2
  196. package/dist/esm/PivotViewer/components/pivot/groups.js.map +1 -1
  197. package/dist/esm/PivotViewer/components/pivot/sprites.d.ts +4 -4
  198. package/dist/esm/PivotViewer/components/pivot/sprites.d.ts.map +1 -1
  199. package/dist/esm/PivotViewer/components/pivot/sprites.js +2 -2
  200. package/dist/esm/PivotViewer/components/pivot/sprites.js.map +1 -1
  201. package/dist/esm/PivotViewer/types.d.ts +2 -2
  202. package/dist/esm/PivotViewer/types.d.ts.map +1 -1
  203. package/dist/esm/PivotViewer/types.js.map +1 -1
  204. package/dist/esm/SchemaEditor/NameCell.d.ts +9 -0
  205. package/dist/esm/SchemaEditor/NameCell.d.ts.map +1 -0
  206. package/dist/esm/SchemaEditor/NameCell.js +17 -0
  207. package/dist/esm/SchemaEditor/NameCell.js.map +1 -0
  208. package/dist/esm/SchemaEditor/SchemaEditor.d.ts +17 -0
  209. package/dist/esm/SchemaEditor/SchemaEditor.d.ts.map +1 -0
  210. package/dist/esm/SchemaEditor/SchemaEditor.js +331 -0
  211. package/dist/esm/SchemaEditor/SchemaEditor.js.map +1 -0
  212. package/dist/esm/SchemaEditor/SchemaEditor.module.css +11 -0
  213. package/dist/esm/SchemaEditor/SchemaEditor.stories.d.ts +12 -0
  214. package/dist/esm/SchemaEditor/SchemaEditor.stories.d.ts.map +1 -0
  215. package/dist/esm/SchemaEditor/SchemaEditor.stories.js +158 -0
  216. package/dist/esm/SchemaEditor/SchemaEditor.stories.js.map +1 -0
  217. package/dist/esm/SchemaEditor/TypeCell.d.ts +14 -0
  218. package/dist/esm/SchemaEditor/TypeCell.d.ts.map +1 -0
  219. package/dist/esm/SchemaEditor/TypeCell.js +81 -0
  220. package/dist/esm/SchemaEditor/TypeCell.js.map +1 -0
  221. package/dist/esm/SchemaEditor/index.d.ts +4 -0
  222. package/dist/esm/SchemaEditor/index.d.ts.map +1 -0
  223. package/dist/esm/SchemaEditor/index.js +3 -0
  224. package/dist/esm/SchemaEditor/index.js.map +1 -0
  225. package/dist/esm/TimeMachine/EventsView.stories.d.ts +8 -7
  226. package/dist/esm/TimeMachine/EventsView.stories.d.ts.map +1 -1
  227. package/dist/esm/TimeMachine/EventsView.stories.js +80 -4
  228. package/dist/esm/TimeMachine/EventsView.stories.js.map +1 -1
  229. package/dist/esm/TimeMachine/Properties.stories.d.ts +9 -7
  230. package/dist/esm/TimeMachine/Properties.stories.d.ts.map +1 -1
  231. package/dist/esm/TimeMachine/Properties.stories.js +49 -4
  232. package/dist/esm/TimeMachine/Properties.stories.js.map +1 -1
  233. package/dist/esm/TimeMachine/ReadModelView.stories.d.ts +7 -7
  234. package/dist/esm/TimeMachine/ReadModelView.stories.d.ts.map +1 -1
  235. package/dist/esm/TimeMachine/ReadModelView.stories.js +79 -5
  236. package/dist/esm/TimeMachine/ReadModelView.stories.js.map +1 -1
  237. package/dist/esm/TimeMachine/TimeMachine.js +1 -1
  238. package/dist/esm/TimeMachine/TimeMachine.stories.d.ts +8 -7
  239. package/dist/esm/TimeMachine/TimeMachine.stories.d.ts.map +1 -1
  240. package/dist/esm/TimeMachine/TimeMachine.stories.js +113 -4
  241. package/dist/esm/TimeMachine/TimeMachine.stories.js.map +1 -1
  242. package/dist/esm/index.d.ts +7 -3
  243. package/dist/esm/index.d.ts.map +1 -1
  244. package/dist/esm/index.js +20 -12
  245. package/dist/esm/index.js.map +1 -1
  246. package/dist/esm/package.json +3 -0
  247. package/dist/esm/tsconfig.tsbuildinfo +1 -1
  248. package/dist/esm/types/JsonSchema.d.ts +32 -0
  249. package/dist/esm/types/JsonSchema.d.ts.map +1 -0
  250. package/dist/esm/types/JsonSchema.js +2 -0
  251. package/dist/esm/types/JsonSchema.js.map +1 -0
  252. package/dist/esm/types/TypeFormat.d.ts +6 -0
  253. package/dist/esm/types/TypeFormat.d.ts.map +1 -0
  254. package/dist/esm/types/TypeFormat.js +18 -0
  255. package/dist/esm/types/TypeFormat.js.map +1 -0
  256. package/package.json +41 -78
  257. package/dist/cjs/CommandForm/CommandForm.js +0 -183
  258. package/dist/cjs/CommandForm/CommandForm.js.map +0 -1
  259. package/dist/cjs/CommandForm/CommandFormField.js +0 -11
  260. package/dist/cjs/CommandForm/CommandFormField.js.map +0 -1
  261. package/dist/cjs/CommandForm/CommandFormFields.js +0 -73
  262. package/dist/cjs/CommandForm/CommandFormFields.js.map +0 -1
  263. package/dist/cjs/CommandForm/ValidationMessage.js +0 -24
  264. package/dist/cjs/CommandForm/ValidationMessage.js.map +0 -1
  265. package/dist/cjs/CommandForm/asCommandFormField.js +0 -47
  266. package/dist/cjs/CommandForm/asCommandFormField.js.map +0 -1
  267. package/dist/esm/CommandForm/CommandForm.d.ts +0 -49
  268. package/dist/esm/CommandForm/CommandForm.d.ts.map +0 -1
  269. package/dist/esm/CommandForm/CommandForm.js +0 -178
  270. package/dist/esm/CommandForm/CommandForm.js.map +0 -1
  271. package/dist/esm/CommandForm/CommandForm.stories.d.ts +0 -8
  272. package/dist/esm/CommandForm/CommandForm.stories.d.ts.map +0 -1
  273. package/dist/esm/CommandForm/CommandForm.stories.js +0 -45
  274. package/dist/esm/CommandForm/CommandForm.stories.js.map +0 -1
  275. package/dist/esm/CommandForm/CommandFormField.d.ts +0 -18
  276. package/dist/esm/CommandForm/CommandFormField.d.ts.map +0 -1
  277. package/dist/esm/CommandForm/CommandFormField.js +0 -9
  278. package/dist/esm/CommandForm/CommandFormField.js.map +0 -1
  279. package/dist/esm/CommandForm/CommandFormFields.d.ts +0 -11
  280. package/dist/esm/CommandForm/CommandFormFields.d.ts.map +0 -1
  281. package/dist/esm/CommandForm/CommandFormFields.js +0 -71
  282. package/dist/esm/CommandForm/CommandFormFields.js.map +0 -1
  283. package/dist/esm/CommandForm/UserRegistrationCommand.d.ts +0 -63
  284. package/dist/esm/CommandForm/UserRegistrationCommand.d.ts.map +0 -1
  285. package/dist/esm/CommandForm/UserRegistrationCommand.js +0 -143
  286. package/dist/esm/CommandForm/UserRegistrationCommand.js.map +0 -1
  287. package/dist/esm/CommandForm/ValidationMessage.d.ts +0 -8
  288. package/dist/esm/CommandForm/ValidationMessage.d.ts.map +0 -1
  289. package/dist/esm/CommandForm/ValidationMessage.js +0 -22
  290. package/dist/esm/CommandForm/ValidationMessage.js.map +0 -1
  291. package/dist/esm/CommandForm/asCommandFormField.d.ts +0 -32
  292. package/dist/esm/CommandForm/asCommandFormField.d.ts.map +0 -1
  293. package/dist/esm/CommandForm/asCommandFormField.js +0 -45
  294. package/dist/esm/CommandForm/asCommandFormField.js.map +0 -1
@@ -0,0 +1,137 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from 'react';
3
+ import { CommandForm } from '@cratis/arc.react/commands';
4
+ import { Command, CommandValidator } from '@cratis/arc/commands';
5
+ import { PropertyDescriptor } from '@cratis/arc/reflection';
6
+ import { StoryContainer, StorySection, StoryDivider } from '@cratis/arc.react/stories';
7
+ import '@cratis/arc/validation';
8
+ import { InputTextField, NumberField, TextAreaField, CheckboxField, SliderField, DropdownField } from './index';
9
+ const meta = {
10
+ title: 'CommandForm/PrimeReact Fields',
11
+ parameters: {
12
+ layout: 'centered',
13
+ },
14
+ };
15
+ export default meta;
16
+ class FormFieldsCommand extends Command {
17
+ route = '/api/fields';
18
+ validation = new FormFieldsCommandValidator();
19
+ propertyDescriptors = [
20
+ new PropertyDescriptor('textInput', String),
21
+ new PropertyDescriptor('emailInput', String),
22
+ new PropertyDescriptor('passwordInput', String),
23
+ new PropertyDescriptor('numberInput', Number),
24
+ new PropertyDescriptor('textArea', String),
25
+ new PropertyDescriptor('checkbox', Boolean),
26
+ new PropertyDescriptor('slider', Number),
27
+ new PropertyDescriptor('dropdown', String),
28
+ ];
29
+ textInput = '';
30
+ emailInput = '';
31
+ passwordInput = '';
32
+ numberInput = 0;
33
+ textArea = '';
34
+ checkbox = false;
35
+ slider = 50;
36
+ dropdown = '';
37
+ constructor() {
38
+ super(Object, false);
39
+ }
40
+ get requestParameters() {
41
+ return [];
42
+ }
43
+ get properties() {
44
+ return [
45
+ 'textInput',
46
+ 'emailInput',
47
+ 'passwordInput',
48
+ 'numberInput',
49
+ 'textArea',
50
+ 'checkbox',
51
+ 'slider',
52
+ 'dropdown'
53
+ ];
54
+ }
55
+ }
56
+ class FormFieldsCommandValidator extends CommandValidator {
57
+ constructor() {
58
+ super();
59
+ this.ruleFor(c => c.textInput).notEmpty().minLength(3);
60
+ this.ruleFor(c => c.emailInput).notEmpty().emailAddress();
61
+ this.ruleFor(c => c.passwordInput).notEmpty().minLength(6);
62
+ this.ruleFor(c => c.numberInput).greaterThanOrEqual(1).lessThanOrEqual(100);
63
+ this.ruleFor(c => c.dropdown).notEmpty();
64
+ }
65
+ }
66
+ const dropdownOptions = [
67
+ { id: 'option1', name: 'Option 1' },
68
+ { id: 'option2', name: 'Option 2' },
69
+ { id: 'option3', name: 'Option 3' },
70
+ { id: 'option4', name: 'Option 4' }
71
+ ];
72
+ export const AllFields = {
73
+ render: () => {
74
+ const [validationState, setValidationState] = useState({ errors: {}, canSubmit: false });
75
+ return (_jsxs(StoryContainer, { size: "md", asCard: true, children: [_jsx("h1", { children: "PrimeReact Form Fields" }), _jsx("p", { children: "This showcase demonstrates all available PrimeReact-based form fields integrated with CommandForm from @cratis/arc.react." }), _jsx(StoryDivider, {}), _jsxs(CommandForm, { command: FormFieldsCommand, initialValues: {
76
+ textInput: '',
77
+ emailInput: '',
78
+ passwordInput: '',
79
+ numberInput: 25,
80
+ textArea: '',
81
+ checkbox: false,
82
+ slider: 50,
83
+ dropdown: '',
84
+ }, onFieldChange: async (command, fieldName) => {
85
+ const result = await command.validate();
86
+ if (!result.isValid) {
87
+ const fieldError = result.validationResults.find(v => v.members.includes(fieldName));
88
+ if (fieldError) {
89
+ setValidationState(prev => ({
90
+ errors: { ...prev.errors, [fieldName]: fieldError.message },
91
+ canSubmit: false
92
+ }));
93
+ }
94
+ }
95
+ else {
96
+ setValidationState(prev => {
97
+ const { [fieldName]: removed, ...rest } = prev.errors;
98
+ return {
99
+ errors: rest,
100
+ canSubmit: Object.keys(rest).length === 0
101
+ };
102
+ });
103
+ }
104
+ }, children: [_jsxs(StorySection, { children: [_jsx("h3", { children: "Text Inputs" }), _jsx(InputTextField, { value: c => c.textInput, title: "Text Input", placeholder: "Enter at least 3 characters", description: "Standard text input field with validation" }), validationState.errors.textInput && (_jsx("div", { style: { color: 'var(--red-500)', fontSize: '0.875rem', marginTop: '0.25rem', marginBottom: '1rem' }, children: validationState.errors.textInput })), _jsx(InputTextField, { value: c => c.emailInput, title: "Email Input", type: "email", placeholder: "Enter a valid email address", description: "Email input with email validation" }), validationState.errors.emailInput && (_jsx("div", { style: { color: 'var(--red-500)', fontSize: '0.875rem', marginTop: '0.25rem', marginBottom: '1rem' }, children: validationState.errors.emailInput })), _jsx(InputTextField, { value: c => c.passwordInput, title: "Password Input", type: "password", placeholder: "Enter at least 6 characters", description: "Password input field (min 6 characters)" }), validationState.errors.passwordInput && (_jsx("div", { style: { color: 'var(--red-500)', fontSize: '0.875rem', marginTop: '0.25rem', marginBottom: '1rem' }, children: validationState.errors.passwordInput }))] }), _jsx(StoryDivider, {}), _jsxs(StorySection, { children: [_jsx("h3", { children: "Number Input" }), _jsx(NumberField, { value: c => c.numberInput, title: "Number Field", placeholder: "Enter a number (1-100)", description: "Number input with min/max boundaries", min: 1, max: 100, step: 1 }), validationState.errors.numberInput && (_jsx("div", { style: { color: 'var(--red-500)', fontSize: '0.875rem', marginTop: '0.25rem', marginBottom: '1rem' }, children: validationState.errors.numberInput }))] }), _jsx(StoryDivider, {}), _jsxs(StorySection, { children: [_jsx("h3", { children: "Text Area" }), _jsx(TextAreaField, { value: c => c.textArea, title: "Text Area Field", placeholder: "Enter a longer text...", description: "Multi-line text input", rows: 5 })] }), _jsx(StoryDivider, {}), _jsxs(StorySection, { children: [_jsx("h3", { children: "Dropdown" }), _jsx(DropdownField, { value: c => c.dropdown, title: "Dropdown Field", placeholder: "Select an option", description: "PrimeReact dropdown component", options: dropdownOptions, optionValue: "id", optionLabel: "name" }), validationState.errors.dropdown && (_jsx("div", { style: { color: 'var(--red-500)', fontSize: '0.875rem', marginTop: '0.25rem', marginBottom: '1rem' }, children: validationState.errors.dropdown }))] }), _jsx(StoryDivider, {}), _jsxs(StorySection, { children: [_jsx("h3", { children: "Slider" }), _jsx(SliderField, { value: c => c.slider, title: "Slider Field", description: "Slider for numeric values", min: 0, max: 100, step: 5 })] }), _jsx(StoryDivider, {}), _jsxs(StorySection, { children: [_jsx("h3", { children: "Checkbox" }), _jsx(CheckboxField, { value: c => c.checkbox, label: "I agree to the terms and conditions" })] }), _jsx(StoryDivider, {}), _jsxs("div", { style: { marginTop: '1.5rem', display: 'flex', gap: '0.5rem', alignItems: 'center' }, children: [_jsx("button", { type: "submit", disabled: !validationState.canSubmit, className: "p-button p-component", children: "Submit Form" }), !validationState.canSubmit && Object.keys(validationState.errors).length > 0 && (_jsx("span", { style: { color: 'var(--orange-500)', fontSize: '0.875rem' }, children: "Please fix validation errors" }))] })] })] }));
105
+ }
106
+ };
107
+ export const InputTextFieldExample = {
108
+ render: () => {
109
+ return (_jsxs(StoryContainer, { size: "sm", asCard: true, children: [_jsx("h2", { children: "InputTextField" }), _jsx("p", { children: "PrimeReact InputText component wrapped for CommandForm." }), _jsxs(CommandForm, { command: FormFieldsCommand, initialValues: { textInput: '', emailInput: '', passwordInput: '' }, children: [_jsx(InputTextField, { value: c => c.textInput, title: "Standard Text", placeholder: "Type here..." }), _jsx(InputTextField, { value: c => c.emailInput, title: "Email", type: "email", placeholder: "your@email.com" }), _jsx(InputTextField, { value: c => c.passwordInput, title: "Password", type: "password", placeholder: "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022" })] })] }));
110
+ }
111
+ };
112
+ export const NumberFieldExample = {
113
+ render: () => {
114
+ return (_jsxs(StoryContainer, { size: "sm", asCard: true, children: [_jsx("h2", { children: "NumberField" }), _jsx("p", { children: "PrimeReact InputNumber component with spinners and constraints." }), _jsx(CommandForm, { command: FormFieldsCommand, initialValues: { numberInput: 42 }, children: _jsx(NumberField, { value: c => c.numberInput, title: "Quantity", placeholder: "Enter a number", min: 0, max: 100, step: 1 }) })] }));
115
+ }
116
+ };
117
+ export const TextAreaFieldExample = {
118
+ render: () => {
119
+ return (_jsxs(StoryContainer, { size: "sm", asCard: true, children: [_jsx("h2", { children: "TextAreaField" }), _jsx("p", { children: "PrimeReact InputTextarea for multi-line text input." }), _jsx(CommandForm, { command: FormFieldsCommand, initialValues: { textArea: '' }, children: _jsx(TextAreaField, { value: c => c.textArea, title: "Description", placeholder: "Enter a detailed description...", rows: 6 }) })] }));
120
+ }
121
+ };
122
+ export const DropdownFieldExample = {
123
+ render: () => {
124
+ return (_jsxs(StoryContainer, { size: "sm", asCard: true, children: [_jsx("h2", { children: "DropdownField" }), _jsx("p", { children: "PrimeReact Dropdown for selecting from a list of options." }), _jsx(CommandForm, { command: FormFieldsCommand, initialValues: { dropdown: '' }, children: _jsx(DropdownField, { value: c => c.dropdown, title: "Select Option", placeholder: "Choose...", options: dropdownOptions, optionValue: "id", optionLabel: "name" }) })] }));
125
+ }
126
+ };
127
+ export const SliderFieldExample = {
128
+ render: () => {
129
+ return (_jsxs(StoryContainer, { size: "sm", asCard: true, children: [_jsx("h2", { children: "SliderField" }), _jsx("p", { children: "PrimeReact Slider for selecting numeric values visually." }), _jsx(CommandForm, { command: FormFieldsCommand, initialValues: { slider: 75 }, children: _jsx(SliderField, { value: c => c.slider, title: "Volume", min: 0, max: 100, step: 5 }) })] }));
130
+ }
131
+ };
132
+ export const CheckboxFieldExample = {
133
+ render: () => {
134
+ return (_jsxs(StoryContainer, { size: "sm", asCard: true, children: [_jsx("h2", { children: "CheckboxField" }), _jsx("p", { children: "PrimeReact Checkbox for boolean values." }), _jsxs(CommandForm, { command: FormFieldsCommand, initialValues: { checkbox: false }, children: [_jsx(CheckboxField, { value: c => c.checkbox, label: "Enable notifications" }), _jsx(CheckboxField, { value: c => c.checkbox, label: "I have read and agree to the terms" })] })] }));
135
+ }
136
+ };
137
+ //# sourceMappingURL=Fields.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Fields.stories.js","sourceRoot":"","sources":["../../../../CommandForm/fields/Fields.stories.tsx"],"names":[],"mappings":";AAGA,OAAc,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAExC,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,O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a,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,YAE7B,KAAC,WAAW,IACR,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,EACpB,KAAK,EAAC,QAAQ,EACd,GAAG,EAAE,CAAC,EACN,GAAG,EAAE,GAAG,EACR,IAAI,EAAE,CAAC,GACT,GACQ,IACD,CACpB,CAAC;IACN,CAAC;CACJ,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAU;IACvC,MAAM,EAAE,GAAG,EAAE;QACT,OAAO,CACH,MAAC,cAAc,IAAC,IAAI,EAAC,IAAI,EAAC,MAAM,mBAC5B,yCAAsB,EACtB,kEAA8C,EAE9C,MAAC,WAAW,IACR,OAAO,EAAE,iBAAiB,EAC1B,aAAa,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,aAElC,KAAC,aAAa,IACV,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,EACtB,KAAK,EAAC,sBAAsB,GAC9B,EAEF,KAAC,aAAa,IACV,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,EACtB,KAAK,EAAC,oCAAoC,GAC5C,IACQ,IACD,CACpB,CAAC;IACN,CAAC;CACJ,CAAC"}
@@ -1,10 +1,11 @@
1
- import { WrappedFieldProps } from '../asCommandFormField';
1
+ import React from 'react';
2
+ import { WrappedFieldProps } from '@cratis/arc.react/commands';
2
3
  interface InputTextComponentProps extends WrappedFieldProps<string> {
3
4
  type?: 'text' | 'email' | 'password' | 'color' | 'date' | 'datetime-local' | 'time' | 'url' | 'tel' | 'search';
4
5
  placeholder?: string;
5
6
  }
6
7
  export declare const InputTextField: {
7
- <TCommand>(props: Omit<InputTextComponentProps, keyof WrappedFieldProps<unknown>> & import("..").BaseCommandFormFieldProps<TCommand> & import("..").InjectedCommandFormFieldProps): import("react/jsx-runtime").JSX.Element;
8
+ <TCommand = unknown>(props: import("@cratis/arc.react/commands").CommandFormFieldComponentProps<InputTextComponentProps, TCommand>): React.ReactElement;
8
9
  displayName: string;
9
10
  };
10
11
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"InputTextField.d.ts","sourceRoot":"","sources":["../../../../CommandForm/fields/InputTextField.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAsB,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE9E,UAAU,uBAAwB,SAAQ,iBAAiB,CAAC,MAAM,CAAC;IAC/D,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,OAAO,GAAG,MAAM,GAAG,gBAAgB,GAAG,MAAM,GAAG,KAAK,GAAG,KAAK,GAAG,QAAQ,CAAC;IAC/G,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,cAAc;;;CAe1B,CAAC"}
1
+ {"version":3,"file":"InputTextField.d.ts","sourceRoot":"","sources":["../../../../CommandForm/fields/InputTextField.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAsB,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAEnF,UAAU,uBAAwB,SAAQ,iBAAiB,CAAC,MAAM,CAAC;IAC/D,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,OAAO,GAAG,MAAM,GAAG,gBAAgB,GAAG,MAAM,GAAG,KAAK,GAAG,KAAK,GAAG,QAAQ,CAAC;IAC/G,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,cAAc;;;CAe1B,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
2
  import { InputText } from 'primereact/inputtext';
3
- import { asCommandFormField } from '../asCommandFormField.js';
3
+ import { asCommandFormField } from '@cratis/arc.react/commands';
4
4
 
5
5
  const InputTextField = asCommandFormField((props) => (jsx(InputText, { type: props.type || 'text', value: props.value, onChange: props.onChange, invalid: props.invalid, placeholder: props.placeholder, className: "w-full" })), {
6
6
  defaultValue: '',
@@ -1 +1 @@
1
- {"version":3,"file":"InputTextField.js","sources":["../../../../CommandForm/fields/InputTextField.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { InputText } from 'primereact/inputtext';\nimport React from 'react';\nimport { asCommandFormField, WrappedFieldProps } from '../asCommandFormField';\n\ninterface InputTextComponentProps extends WrappedFieldProps<string> {\n type?: 'text' | 'email' | 'password' | 'color' | 'date' | 'datetime-local' | 'time' | 'url' | 'tel' | 'search';\n placeholder?: string;\n}\n\nexport const InputTextField = asCommandFormField<InputTextComponentProps>(\n (props) => (\n <InputText\n type={props.type || 'text'}\n value={props.value}\n onChange={props.onChange}\n invalid={props.invalid}\n placeholder={props.placeholder}\n className=\"w-full\"\n />\n ),\n {\n defaultValue: '',\n extractValue: (e: React.ChangeEvent<HTMLInputElement>) => e.target.value\n }\n);\n"],"names":["_jsx"],"mappings":";;;;AAYO,MAAM,cAAc,GAAG,kBAAkB,CAC5C,CAAC,KAAK,MACFA,IAAC,SAAS,EAAA,EACN,IAAI,EAAE,KAAK,CAAC,IAAI,IAAI,MAAM,EAC1B,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,WAAW,EAAE,KAAK,CAAC,WAAW,EAC9B,SAAS,EAAC,QAAQ,EAAA,CACpB,CACL,EACD;AACI,IAAA,YAAY,EAAE,EAAE;IAChB,YAAY,EAAE,CAAC,CAAsC,KAAK,CAAC,CAAC,MAAM,CAAC;AACtE,CAAA;;;;"}
1
+ {"version":3,"file":"InputTextField.js","sources":["../../../../CommandForm/fields/InputTextField.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { InputText } from 'primereact/inputtext';\nimport React from 'react';\nimport { asCommandFormField, WrappedFieldProps } from '@cratis/arc.react/commands';\n\ninterface InputTextComponentProps extends WrappedFieldProps<string> {\n type?: 'text' | 'email' | 'password' | 'color' | 'date' | 'datetime-local' | 'time' | 'url' | 'tel' | 'search';\n placeholder?: string;\n}\n\nexport const InputTextField = asCommandFormField<InputTextComponentProps>(\n (props) => (\n <InputText\n type={props.type || 'text'}\n value={props.value}\n onChange={props.onChange}\n invalid={props.invalid}\n placeholder={props.placeholder}\n className=\"w-full\"\n />\n ),\n {\n defaultValue: '',\n extractValue: (e: React.ChangeEvent<HTMLInputElement>) => e.target.value\n }\n);\n"],"names":["_jsx"],"mappings":";;;;AAYO,MAAM,cAAc,GAAG,kBAAkB,CAC5C,CAAC,KAAK,MACFA,IAAC,SAAS,EAAA,EACN,IAAI,EAAE,KAAK,CAAC,IAAI,IAAI,MAAM,EAC1B,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,WAAW,EAAE,KAAK,CAAC,WAAW,EAC9B,SAAS,EAAC,QAAQ,EAAA,CACpB,CACL,EACD;AACI,IAAA,YAAY,EAAE,EAAE;IAChB,YAAY,EAAE,CAAC,CAAsC,KAAK,CAAC,CAAC,MAAM,CAAC;AACtE,CAAA;;;;"}
@@ -1,4 +1,5 @@
1
- import { WrappedFieldProps } from '../asCommandFormField';
1
+ import React from 'react';
2
+ import { WrappedFieldProps } from '@cratis/arc.react/commands';
2
3
  interface NumberFieldComponentProps extends WrappedFieldProps<number> {
3
4
  placeholder?: string;
4
5
  min?: number;
@@ -6,7 +7,7 @@ interface NumberFieldComponentProps extends WrappedFieldProps<number> {
6
7
  step?: number;
7
8
  }
8
9
  export declare const NumberField: {
9
- <TCommand>(props: Omit<NumberFieldComponentProps, keyof WrappedFieldProps<unknown>> & import("..").BaseCommandFormFieldProps<TCommand> & import("..").InjectedCommandFormFieldProps): import("react/jsx-runtime").JSX.Element;
10
+ <TCommand = unknown>(props: import("@cratis/arc.react/commands").CommandFormFieldComponentProps<NumberFieldComponentProps, TCommand>): React.ReactElement;
10
11
  displayName: string;
11
12
  };
12
13
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"NumberField.d.ts","sourceRoot":"","sources":["../../../../CommandForm/fields/NumberField.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAsB,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE9E,UAAU,yBAA0B,SAAQ,iBAAiB,CAAC,MAAM,CAAC;IACjE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,WAAW;;;CAiBvB,CAAC"}
1
+ {"version":3,"file":"NumberField.d.ts","sourceRoot":"","sources":["../../../../CommandForm/fields/NumberField.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAsB,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAEnF,UAAU,yBAA0B,SAAQ,iBAAiB,CAAC,MAAM,CAAC;IACjE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,WAAW;;;CAiBvB,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
2
  import { InputNumber } from 'primereact/inputnumber';
3
- import { asCommandFormField } from '../asCommandFormField.js';
3
+ import { asCommandFormField } from '@cratis/arc.react/commands';
4
4
 
5
5
  const NumberField = asCommandFormField((props) => (jsx(InputNumber, { value: props.value, onValueChange: (e) => props.onChange(e.value ?? 0), invalid: props.invalid, placeholder: props.placeholder, min: props.min, max: props.max, step: props.step, className: "w-full" })), {
6
6
  defaultValue: 0,
@@ -1 +1 @@
1
- {"version":3,"file":"NumberField.js","sources":["../../../../CommandForm/fields/NumberField.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { InputNumber } from 'primereact/inputnumber';\nimport React from 'react';\nimport { asCommandFormField, WrappedFieldProps } from '../asCommandFormField';\n\ninterface NumberFieldComponentProps extends WrappedFieldProps<number> {\n placeholder?: string;\n min?: number;\n max?: number;\n step?: number;\n}\n\nexport const NumberField = asCommandFormField<NumberFieldComponentProps>(\n (props) => (\n <InputNumber\n value={props.value}\n onValueChange={(e) => props.onChange(e.value ?? 0)}\n invalid={props.invalid}\n placeholder={props.placeholder}\n min={props.min}\n max={props.max}\n step={props.step}\n className=\"w-full\"\n />\n ),\n {\n defaultValue: 0,\n extractValue: (e: unknown) => (typeof e === 'number' ? e : 0)\n }\n);\n"],"names":["_jsx"],"mappings":";;;;AAcO,MAAM,WAAW,GAAG,kBAAkB,CACzC,CAAC,KAAK,MACFA,GAAA,CAAC,WAAW,IACR,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,aAAa,EAAE,CAAC,CAAC,KAAK,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,EAClD,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,WAAW,EAAE,KAAK,CAAC,WAAW,EAC9B,GAAG,EAAE,KAAK,CAAC,GAAG,EACd,GAAG,EAAE,KAAK,CAAC,GAAG,EACd,IAAI,EAAE,KAAK,CAAC,IAAI,EAChB,SAAS,EAAC,QAAQ,EAAA,CACpB,CACL,EACD;AACI,IAAA,YAAY,EAAE,CAAC;AACf,IAAA,YAAY,EAAE,CAAC,CAAU,MAAM,OAAO,CAAC,KAAK,QAAQ,GAAG,CAAC,GAAG,CAAC;AAC/D,CAAA;;;;"}
1
+ {"version":3,"file":"NumberField.js","sources":["../../../../CommandForm/fields/NumberField.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { InputNumber } from 'primereact/inputnumber';\nimport React from 'react';\nimport { asCommandFormField, WrappedFieldProps } from '@cratis/arc.react/commands';\n\ninterface NumberFieldComponentProps extends WrappedFieldProps<number> {\n placeholder?: string;\n min?: number;\n max?: number;\n step?: number;\n}\n\nexport const NumberField = asCommandFormField<NumberFieldComponentProps>(\n (props) => (\n <InputNumber\n value={props.value}\n onValueChange={(e) => props.onChange(e.value ?? 0)}\n invalid={props.invalid}\n placeholder={props.placeholder}\n min={props.min}\n max={props.max}\n step={props.step}\n className=\"w-full\"\n />\n ),\n {\n defaultValue: 0,\n extractValue: (e: unknown) => (typeof e === 'number' ? e : 0)\n }\n);\n"],"names":["_jsx"],"mappings":";;;;AAcO,MAAM,WAAW,GAAG,kBAAkB,CACzC,CAAC,KAAK,MACFA,GAAA,CAAC,WAAW,IACR,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,aAAa,EAAE,CAAC,CAAC,KAAK,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,EAClD,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,WAAW,EAAE,KAAK,CAAC,WAAW,EAC9B,GAAG,EAAE,KAAK,CAAC,GAAG,EACd,GAAG,EAAE,KAAK,CAAC,GAAG,EACd,IAAI,EAAE,KAAK,CAAC,IAAI,EAChB,SAAS,EAAC,QAAQ,EAAA,CACpB,CACL,EACD;AACI,IAAA,YAAY,EAAE,CAAC;AACf,IAAA,YAAY,EAAE,CAAC,CAAU,MAAM,OAAO,CAAC,KAAK,QAAQ,GAAG,CAAC,GAAG,CAAC;AAC/D,CAAA;;;;"}
@@ -1,11 +1,12 @@
1
- import { WrappedFieldProps } from '../asCommandFormField';
2
- interface RangeComponentProps extends WrappedFieldProps<number> {
1
+ import React from 'react';
2
+ import { WrappedFieldProps } from '@cratis/arc.react/commands';
3
+ interface SliderFieldComponentProps extends WrappedFieldProps<number> {
3
4
  min?: number;
4
5
  max?: number;
5
6
  step?: number;
6
7
  }
7
- export declare const RangeField: {
8
- <TCommand>(props: Omit<RangeComponentProps, keyof WrappedFieldProps<unknown>> & import("..").BaseCommandFormFieldProps<TCommand> & import("..").InjectedCommandFormFieldProps): import("react/jsx-runtime").JSX.Element;
8
+ export declare const SliderField: {
9
+ <TCommand = unknown>(props: import("@cratis/arc.react/commands").CommandFormFieldComponentProps<SliderFieldComponentProps, TCommand>): React.ReactElement;
9
10
  displayName: string;
10
11
  };
11
12
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"SliderField.d.ts","sourceRoot":"","sources":["../../../../CommandForm/fields/SliderField.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAsB,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE9E,UAAU,mBAAoB,SAAQ,iBAAiB,CAAC,MAAM,CAAC;IAC3D,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,UAAU;;;CA4BtB,CAAC"}
1
+ {"version":3,"file":"SliderField.d.ts","sourceRoot":"","sources":["../../../../CommandForm/fields/SliderField.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAsB,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAEnF,UAAU,yBAA0B,SAAQ,iBAAiB,CAAC,MAAM,CAAC;IACjE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,WAAW;;;CAoBvB,CAAC"}
@@ -1,15 +1,11 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
- import { asCommandFormField } from '../asCommandFormField.js';
2
+ import { Slider } from 'primereact/slider';
3
+ import { asCommandFormField } from '@cratis/arc.react/commands';
3
4
 
4
- const RangeField = asCommandFormField((props) => {
5
- const min = props.min ?? 0;
6
- const max = props.max ?? 100;
7
- const step = props.step ?? 1;
8
- return (jsxs("div", { className: "w-full flex items-center gap-4 p-3 border border-gray-300 rounded-md", children: [jsx("input", { type: "range", value: props.value, onChange: props.onChange, min: min, max: max, step: step, required: props.required, className: "flex-1" }), jsx("span", { className: "min-w-[3rem] text-right font-semibold", children: props.value })] }));
9
- }, {
5
+ const SliderField = asCommandFormField((props) => (jsxs("div", { className: "w-full", children: [jsx(Slider, { value: props.value, onChange: (e) => props.onChange(e.value), min: props.min ?? 0, max: props.max ?? 100, step: props.step ?? 1, className: "w-full" }), jsx("div", { className: "text-center mt-2", children: jsx("span", { className: "font-semibold", children: props.value }) })] })), {
10
6
  defaultValue: 0,
11
- extractValue: (e) => parseFloat(e.target.value)
7
+ extractValue: (e) => (typeof e === 'number' ? e : 0)
12
8
  });
13
9
 
14
- export { RangeField };
10
+ export { SliderField };
15
11
  //# sourceMappingURL=SliderField.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SliderField.js","sources":["../../../../CommandForm/fields/SliderField.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport React from 'react';\nimport { asCommandFormField, WrappedFieldProps } from '../asCommandFormField';\n\ninterface RangeComponentProps extends WrappedFieldProps<number> {\n min?: number;\n max?: number;\n step?: number;\n}\n\nexport const RangeField = asCommandFormField<RangeComponentProps>(\n (props) => {\n const min = props.min ?? 0;\n const max = props.max ?? 100;\n const step = props.step ?? 1;\n\n return (\n <div className=\"w-full flex items-center gap-4 p-3 border border-gray-300 rounded-md\">\n <input\n type=\"range\"\n value={props.value}\n onChange={props.onChange}\n min={min}\n max={max}\n step={step}\n required={props.required}\n className=\"flex-1\"\n />\n <span className=\"min-w-[3rem] text-right font-semibold\">\n {props.value}\n </span>\n </div>\n );\n },\n {\n defaultValue: 0,\n extractValue: (e: React.ChangeEvent<HTMLInputElement>) => parseFloat(e.target.value)\n }\n);\n"],"names":["_jsxs","_jsx"],"mappings":";;;MAYa,UAAU,GAAG,kBAAkB,CACxC,CAAC,KAAK,KAAI;AACN,IAAA,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,IAAI,CAAC;AAC1B,IAAA,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,IAAI,GAAG;AAC5B,IAAA,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,IAAI,CAAC;IAE5B,QACIA,IAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,sEAAsE,EAAA,QAAA,EAAA,CACjFC,GAAA,CAAA,OAAA,EAAA,EACI,IAAI,EAAC,OAAO,EACZ,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,GAAG,EACR,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,SAAS,EAAC,QAAQ,EAAA,CACpB,EACFA,GAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAC,uCAAuC,EAAA,QAAA,EAClD,KAAK,CAAC,KAAK,EAAA,CACT,CAAA,EAAA,CACL;AAEd,CAAC,EACD;AACI,IAAA,YAAY,EAAE,CAAC;AACf,IAAA,YAAY,EAAE,CAAC,CAAsC,KAAK,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK;AACtF,CAAA;;;;"}
1
+ {"version":3,"file":"SliderField.js","sources":["../../../../CommandForm/fields/SliderField.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { Slider } from 'primereact/slider';\nimport React from 'react';\nimport { asCommandFormField, WrappedFieldProps } from '@cratis/arc.react/commands';\n\ninterface SliderFieldComponentProps extends WrappedFieldProps<number> {\n min?: number;\n max?: number;\n step?: number;\n}\n\nexport const SliderField = asCommandFormField<SliderFieldComponentProps>(\n (props) => (\n <div className=\"w-full\">\n <Slider\n value={props.value}\n onChange={(e) => props.onChange(e.value)}\n min={props.min ?? 0}\n max={props.max ?? 100}\n step={props.step ?? 1}\n className=\"w-full\"\n />\n <div className=\"text-center mt-2\">\n <span className=\"font-semibold\">{props.value}</span>\n </div>\n </div>\n ),\n {\n defaultValue: 0,\n extractValue: (e: unknown) => (typeof e === 'number' ? e : 0)\n }\n);\n"],"names":["_jsxs","_jsx"],"mappings":";;;;AAaO,MAAM,WAAW,GAAG,kBAAkB,CACzC,CAAC,KAAK,MACFA,cAAK,SAAS,EAAC,QAAQ,EAAA,QAAA,EAAA,CACnBC,GAAA,CAAC,MAAM,EAAA,EACH,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,QAAQ,EAAE,CAAC,CAAC,KAAK,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,EACxC,GAAG,EAAE,KAAK,CAAC,GAAG,IAAI,CAAC,EACnB,GAAG,EAAE,KAAK,CAAC,GAAG,IAAI,GAAG,EACrB,IAAI,EAAE,KAAK,CAAC,IAAI,IAAI,CAAC,EACrB,SAAS,EAAC,QAAQ,GACpB,EACFA,GAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,kBAAkB,YAC7BA,GAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAC,eAAe,EAAA,QAAA,EAAE,KAAK,CAAC,KAAK,GAAQ,EAAA,CAClD,CAAA,EAAA,CACJ,CACT,EACD;AACI,IAAA,YAAY,EAAE,CAAC;AACf,IAAA,YAAY,EAAE,CAAC,CAAU,MAAM,OAAO,CAAC,KAAK,QAAQ,GAAG,CAAC,GAAG,CAAC;AAC/D,CAAA;;;;"}
@@ -1,11 +1,12 @@
1
- import { WrappedFieldProps } from '../asCommandFormField';
1
+ import React from 'react';
2
+ import { WrappedFieldProps } from '@cratis/arc.react/commands';
2
3
  interface TextAreaFieldComponentProps extends WrappedFieldProps<string> {
3
4
  placeholder?: string;
4
5
  rows?: number;
5
6
  cols?: number;
6
7
  }
7
8
  export declare const TextAreaField: {
8
- <TCommand>(props: Omit<TextAreaFieldComponentProps, keyof WrappedFieldProps<unknown>> & import("..").BaseCommandFormFieldProps<TCommand> & import("..").InjectedCommandFormFieldProps): import("react/jsx-runtime").JSX.Element;
9
+ <TCommand = unknown>(props: import("@cratis/arc.react/commands").CommandFormFieldComponentProps<TextAreaFieldComponentProps, TCommand>): React.ReactElement;
9
10
  displayName: string;
10
11
  };
11
12
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"TextAreaField.d.ts","sourceRoot":"","sources":["../../../../CommandForm/fields/TextAreaField.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAsB,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE9E,UAAU,2BAA4B,SAAQ,iBAAiB,CAAC,MAAM,CAAC;IACnE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,aAAa;;;CAgBzB,CAAC"}
1
+ {"version":3,"file":"TextAreaField.d.ts","sourceRoot":"","sources":["../../../../CommandForm/fields/TextAreaField.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAsB,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAEnF,UAAU,2BAA4B,SAAQ,iBAAiB,CAAC,MAAM,CAAC;IACnE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,aAAa;;;CAgBzB,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
2
  import { InputTextarea } from 'primereact/inputtextarea';
3
- import { asCommandFormField } from '../asCommandFormField.js';
3
+ import { asCommandFormField } from '@cratis/arc.react/commands';
4
4
 
5
5
  const TextAreaField = asCommandFormField((props) => (jsx(InputTextarea, { value: props.value, onChange: props.onChange, invalid: props.invalid, placeholder: props.placeholder, rows: props.rows ?? 5, cols: props.cols, className: "w-full" })), {
6
6
  defaultValue: '',
@@ -1 +1 @@
1
- {"version":3,"file":"TextAreaField.js","sources":["../../../../CommandForm/fields/TextAreaField.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { InputTextarea } from 'primereact/inputtextarea';\nimport React from 'react';\nimport { asCommandFormField, WrappedFieldProps } from '../asCommandFormField';\n\ninterface TextAreaFieldComponentProps extends WrappedFieldProps<string> {\n placeholder?: string;\n rows?: number;\n cols?: number;\n}\n\nexport const TextAreaField = asCommandFormField<TextAreaFieldComponentProps>(\n (props) => (\n <InputTextarea\n value={props.value}\n onChange={props.onChange}\n invalid={props.invalid}\n placeholder={props.placeholder}\n rows={props.rows ?? 5}\n cols={props.cols}\n className=\"w-full\"\n />\n ),\n {\n defaultValue: '',\n extractValue: (e: React.ChangeEvent<HTMLTextAreaElement>) => e.target.value\n }\n);\n"],"names":["_jsx"],"mappings":";;;;AAaO,MAAM,aAAa,GAAG,kBAAkB,CAC3C,CAAC,KAAK,MACFA,GAAA,CAAC,aAAa,EAAA,EACV,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,WAAW,EAAE,KAAK,CAAC,WAAW,EAC9B,IAAI,EAAE,KAAK,CAAC,IAAI,IAAI,CAAC,EACrB,IAAI,EAAE,KAAK,CAAC,IAAI,EAChB,SAAS,EAAC,QAAQ,EAAA,CACpB,CACL,EACD;AACI,IAAA,YAAY,EAAE,EAAE;IAChB,YAAY,EAAE,CAAC,CAAyC,KAAK,CAAC,CAAC,MAAM,CAAC;AACzE,CAAA;;;;"}
1
+ {"version":3,"file":"TextAreaField.js","sources":["../../../../CommandForm/fields/TextAreaField.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { InputTextarea } from 'primereact/inputtextarea';\nimport React from 'react';\nimport { asCommandFormField, WrappedFieldProps } from '@cratis/arc.react/commands';\n\ninterface TextAreaFieldComponentProps extends WrappedFieldProps<string> {\n placeholder?: string;\n rows?: number;\n cols?: number;\n}\n\nexport const TextAreaField = asCommandFormField<TextAreaFieldComponentProps>(\n (props) => (\n <InputTextarea\n value={props.value}\n onChange={props.onChange}\n invalid={props.invalid}\n placeholder={props.placeholder}\n rows={props.rows ?? 5}\n cols={props.cols}\n className=\"w-full\"\n />\n ),\n {\n defaultValue: '',\n extractValue: (e: React.ChangeEvent<HTMLTextAreaElement>) => e.target.value\n }\n);\n"],"names":["_jsx"],"mappings":";;;;AAaO,MAAM,aAAa,GAAG,kBAAkB,CAC3C,CAAC,KAAK,MACFA,GAAA,CAAC,aAAa,EAAA,EACV,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,WAAW,EAAE,KAAK,CAAC,WAAW,EAC9B,IAAI,EAAE,KAAK,CAAC,IAAI,IAAI,CAAC,EACrB,IAAI,EAAE,KAAK,CAAC,IAAI,EAChB,SAAS,EAAC,QAAQ,EAAA,CACpB,CACL,EACD;AACI,IAAA,YAAY,EAAE,EAAE;IAChB,YAAY,EAAE,CAAC,CAAyC,KAAK,CAAC,CAAC,MAAM,CAAC;AACzE,CAAA;;;;"}
@@ -2,6 +2,6 @@ export * from './InputTextField';
2
2
  export * from './NumberField';
3
3
  export * from './CheckboxField';
4
4
  export * from './TextAreaField';
5
- export { SelectField } from './DropdownField';
6
- export { RangeField } from './SliderField';
5
+ export * from './DropdownField';
6
+ export * from './SliderField';
7
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../CommandForm/fields/index.ts"],"names":[],"mappings":"AAGA,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../CommandForm/fields/index.ts"],"names":[],"mappings":"AAGA,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC"}
@@ -2,6 +2,6 @@ export * from './InputTextField';
2
2
  export * from './NumberField';
3
3
  export * from './CheckboxField';
4
4
  export * from './TextAreaField';
5
- export { SelectField } from './DropdownField';
6
- export { RangeField } from './SliderField';
5
+ export * from './DropdownField';
6
+ export * from './SliderField';
7
7
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../CommandForm/fields/index.ts"],"names":[],"mappings":"AAGA,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../CommandForm/fields/index.ts"],"names":[],"mappings":"AAGA,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC"}
@@ -1,7 +1,3 @@
1
- export * from './CommandForm';
2
- export * from './CommandFormField';
3
- export * from './ValidationMessage';
4
- export * from './CommandFormFields';
5
- export * from './asCommandFormField';
1
+ export { CommandForm, CommandFormField, ValidationMessage, CommandFormFields, asCommandFormField, useCommandFormContext, useCommandInstance, useSetCommandResult, type CommandFormProps, type CommandFormFieldProps, type CommandFormFieldComponentProps, type BaseCommandFormFieldProps, type WrappedFieldProps, type CommandFormFieldConfig, type InjectedCommandFormFieldProps, type ColumnInfo } from '@cratis/arc.react/commands';
6
2
  export * from './fields';
7
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../CommandForm/index.ts"],"names":[],"mappings":"AAGA,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../CommandForm/index.ts"],"names":[],"mappings":"AAIA,OAAO,EACH,WAAW,EACX,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,EACnB,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,8BAA8B,EACnC,KAAK,yBAAyB,EAC9B,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,6BAA6B,EAClC,KAAK,UAAU,EAClB,MAAM,4BAA4B,CAAC;AAGpC,cAAc,UAAU,CAAC"}
@@ -1,12 +1,8 @@
1
- export { CommandForm, useCommandFormContext, useCommandInstance, useSetCommandResult } from './CommandForm.js';
2
- export { CommandFormField } from './CommandFormField.js';
3
- export { ValidationMessage } from './ValidationMessage.js';
4
- export { CommandFormFields } from './CommandFormFields.js';
5
- export { asCommandFormField } from './asCommandFormField.js';
1
+ export { CommandForm, CommandFormField, CommandFormFields, ValidationMessage, asCommandFormField, useCommandFormContext, useCommandInstance, useSetCommandResult } from '@cratis/arc.react/commands';
6
2
  export { InputTextField } from './fields/InputTextField.js';
7
3
  export { NumberField } from './fields/NumberField.js';
8
4
  export { CheckboxField } from './fields/CheckboxField.js';
9
5
  export { TextAreaField } from './fields/TextAreaField.js';
10
- export { SelectField } from './fields/DropdownField.js';
11
- export { RangeField } from './fields/SliderField.js';
6
+ export { DropdownField } from './fields/DropdownField.js';
7
+ export { SliderField } from './fields/SliderField.js';
12
8
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
@@ -10,7 +10,7 @@ export declare class ErrorBoundary extends Component<Props, State> {
10
10
  state: State;
11
11
  static getDerivedStateFromError(error: Error): State;
12
12
  componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
13
- render(): string | number | bigint | boolean | import("react/jsx-runtime").JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | null | undefined;
13
+ render(): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
14
14
  }
15
15
  export {};
16
16
  //# sourceMappingURL=ErrorBoundary.d.ts.map
@@ -1,6 +1,7 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import { Component } from 'react';
3
- export class ErrorBoundary extends Component {
3
+
4
+ class ErrorBoundary extends Component {
4
5
  state = {
5
6
  hasError: false,
6
7
  error: new Error(),
@@ -13,9 +14,11 @@ export class ErrorBoundary extends Component {
13
14
  }
14
15
  render() {
15
16
  if (this.state.hasError) {
16
- return (_jsxs("div", { className: 'p-4', children: [_jsx("h1", { className: 'text-3xl m-3', children: "Error" }), _jsx("p", { children: this.state.error.message }), _jsx("p", { children: this.state.error.stack })] }));
17
+ return (jsxs("div", { className: 'p-4', children: [jsx("h1", { className: 'text-3xl m-3', children: "Error" }), jsx("p", { children: this.state.error.message }), jsx("p", { children: this.state.error.stack })] }));
17
18
  }
18
19
  return this.props.children;
19
20
  }
20
21
  }
21
- //# sourceMappingURL=ErrorBoundary.js.map
22
+
23
+ export { ErrorBoundary };
24
+ //# sourceMappingURL=ErrorBoundary.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorBoundary.js","sourceRoot":"","sources":["../../../Common/ErrorBoundary.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,SAAS,EAAwB,MAAM,OAAO,CAAC;AAUxD,MAAM,OAAO,aAAc,SAAQ,SAAuB;IAC/C,KAAK,GAAU;QAClB,QAAQ,EAAE,KAAK;QACf,KAAK,EAAE,IAAI,KAAK,EAAE;KACrB,CAAC;IAEK,MAAM,CAAC,wBAAwB,CAAC,KAAY;QAC/C,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;IAC5C,CAAC;IAEM,iBAAiB,CAAC,KAAY,EAAE,SAAoB;QACvD,OAAO,CAAC,KAAK,CAAC,iBAAiB,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;IACvD,CAAC;IAEM,MAAM;QACT,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;YACtB,OAAO,CACH,eAAK,SAAS,EAAC,KAAK,aAChB,aAAI,SAAS,EAAC,cAAc,sBAAW,EACvC,sBAAI,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,GAAK,EACjC,sBAAI,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,GAAK,IAC7B,CACT,CAAC;QACN,CAAC;QAED,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;IAC/B,CAAC;CACJ"}
1
+ {"version":3,"file":"ErrorBoundary.js","sources":["../../../Common/ErrorBoundary.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { Component, ErrorInfo, ReactNode } from 'react';\n\ninterface Props {\n children: ReactNode;\n}\ninterface State {\n hasError: boolean;\n error: Error;\n}\n\nexport class ErrorBoundary extends Component<Props, State> {\n public state: State = {\n hasError: false,\n error: new Error(),\n };\n\n public static getDerivedStateFromError(error: Error): State {\n return { hasError: true, error: error };\n }\n\n public componentDidCatch(error: Error, errorInfo: ErrorInfo) {\n console.error('Uncaught error:', error, errorInfo);\n }\n\n public render() {\n if (this.state.hasError) {\n return (\n <div className='p-4'>\n <h1 className='text-3xl m-3'>Error</h1>\n <p>{this.state.error.message}</p>\n <p>{this.state.error.stack}</p>\n </div>\n );\n }\n\n return this.props.children;\n }\n}\n"],"names":["_jsxs","_jsx"],"mappings":";;;AAaM,MAAO,aAAc,SAAQ,SAAuB,CAAA;AAC/C,IAAA,KAAK,GAAU;AAClB,QAAA,QAAQ,EAAE,KAAK;QACf,KAAK,EAAE,IAAI,KAAK,EAAE;KACrB;IAEM,OAAO,wBAAwB,CAAC,KAAY,EAAA;QAC/C,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE;IAC3C;IAEO,iBAAiB,CAAC,KAAY,EAAE,SAAoB,EAAA;QACvD,OAAO,CAAC,KAAK,CAAC,iBAAiB,EAAE,KAAK,EAAE,SAAS,CAAC;IACtD;IAEO,MAAM,GAAA;AACT,QAAA,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE;AACrB,YAAA,QACIA,IAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,KAAK,EAAA,QAAA,EAAA,CAChBC,GAAA,CAAA,IAAA,EAAA,EAAI,SAAS,EAAC,cAAc,EAAA,QAAA,EAAA,OAAA,EAAA,CAAW,EACvCA,GAAA,CAAA,GAAA,EAAA,EAAA,QAAA,EAAI,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,EAAA,CAAK,EACjCA,qBAAI,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,EAAA,CAAK,CAAA,EAAA,CAC7B;QAEd;AAEA,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ;IAC9B;AACH;;;;"}
@@ -1,8 +1,8 @@
1
- import React from 'react';
2
- declare const _default: {
3
- title: string;
4
- component: React.ComponentType<Record<string, never>> | undefined;
5
- };
6
- export default _default;
7
- export declare const Default: () => import("react/jsx-runtime").JSX.Element;
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { ErrorBoundary } from './ErrorBoundary';
3
+ declare const meta: Meta<typeof ErrorBoundary>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof ErrorBoundary>;
6
+ export declare const Default: Story;
7
+ export declare const WithError: Story;
8
8
  //# sourceMappingURL=ErrorBoundary.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorBoundary.stories.d.ts","sourceRoot":"","sources":["../../../Common/ErrorBoundary.stories.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;;;;;AAI1B,wBAAuE;AAEvE,eAAO,MAAM,OAAO,+CAA4E,CAAC"}
1
+ {"version":3,"file":"ErrorBoundary.stories.d.ts","sourceRoot":"","sources":["../../../Common/ErrorBoundary.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,aAAa,CAGpC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,aAAa,CAAC,CAAC;AAuB5C,eAAO,MAAM,OAAO,EAAE,KASrB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAMvB,CAAC"}
@@ -1,6 +1,22 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import * as Comp from './ErrorBoundary';
3
- const Component = Comp.default || Object.values(Comp)[0];
4
- export default { title: 'Common/ErrorBoundary', component: Component };
5
- export const Default = () => (Component ? _jsx(Component, {}) : _jsx("div", { children: "Unable to render component" }));
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from 'react';
3
+ import { ErrorBoundary } from './ErrorBoundary';
4
+ const meta = {
5
+ title: 'Common/ErrorBoundary',
6
+ component: ErrorBoundary,
7
+ };
8
+ export default meta;
9
+ const ErrorThrowingComponent = () => {
10
+ const [shouldThrow, setShouldThrow] = useState(false);
11
+ if (shouldThrow) {
12
+ throw new Error('This is a simulated error to demonstrate ErrorBoundary!');
13
+ }
14
+ return (_jsxs("div", { className: "p-4", children: [_jsx("h2", { className: "text-xl mb-3", children: "Click the button to trigger an error" }), _jsx("button", { className: "p-button p-component", onClick: () => setShouldThrow(true), children: "Throw Error" })] }));
15
+ };
16
+ export const Default = {
17
+ render: () => (_jsx(ErrorBoundary, { children: _jsxs("div", { className: "p-4", children: [_jsx("h1", { className: "text-2xl mb-3", children: "Normal Content" }), _jsx("p", { children: "This content is wrapped in an ErrorBoundary. Everything works fine here." })] }) })),
18
+ };
19
+ export const WithError = {
20
+ render: () => (_jsx(ErrorBoundary, { children: _jsx(ErrorThrowingComponent, {}) })),
21
+ };
6
22
  //# sourceMappingURL=ErrorBoundary.stories.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorBoundary.stories.js","sourceRoot":"","sources":["../../../Common/ErrorBoundary.stories.tsx"],"names":[],"mappings":";AAIA,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,SAAS,EAAC,eAAe,+BAAoB,EACjD,mGAA+E,IAC7E,GACM,CACnB;CACJ,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAU;IAC5B,MAAM,EAAE,GAAG,EAAE,CAAC,CACV,KAAC,aAAa,cACV,KAAC,sBAAsB,KAAG,GACd,CACnB;CACJ,CAAC"}
@@ -1,5 +1,8 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- export const FormElement = (props) => {
3
- return (_jsx("div", { className: "card flex flex-column md:flex-row gap-3", children: _jsxs("div", { className: "p-inputgroup flex-1", children: [_jsx("span", { className: "p-inputgroup-addon", children: props.icon }), props.children] }) }));
1
+ import { jsx, jsxs } from 'react/jsx-runtime';
2
+
3
+ const FormElement = (props) => {
4
+ return (jsx("div", { className: "card flex flex-column md:flex-row gap-3", children: jsxs("div", { className: "p-inputgroup flex-1", children: [jsx("span", { className: "p-inputgroup-addon", children: props.icon }), props.children] }) }));
4
5
  };
5
- //# sourceMappingURL=FormElement.js.map
6
+
7
+ export { FormElement };
8
+ //# sourceMappingURL=FormElement.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FormElement.js","sourceRoot":"","sources":["../../../Common/FormElement.tsx"],"names":[],"mappings":";AAQA,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,KAAuB,EAAE,EAAE;IACnD,OAAO,CACH,cAAK,SAAS,EAAC,yCAAyC,YACpD,eAAK,SAAS,EAAC,qBAAqB,aAChC,eAAM,SAAS,EAAC,oBAAoB,YAC/B,KAAK,CAAC,IAAI,GACR,EACN,KAAK,CAAC,QAAQ,IACb,GACJ,CACT,CAAC;AACN,CAAC,CAAC"}
1
+ {"version":3,"file":"FormElement.js","sources":["../../../Common/FormElement.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nexport interface FormElementProps {\n children: React.ReactNode;\n icon: React.ReactNode;\n}\n\nexport const FormElement = (props: FormElementProps) => {\n return (\n <div className=\"card flex flex-column md:flex-row gap-3\">\n <div className=\"p-inputgroup flex-1\">\n <span className=\"p-inputgroup-addon\">\n {props.icon}\n </span>\n {props.children}\n </div>\n </div>\n );\n};\n"],"names":["_jsx","_jsxs"],"mappings":";;AAQO,MAAM,WAAW,GAAG,CAAC,KAAuB,KAAI;IACnD,QACIA,GAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,yCAAyC,EAAA,QAAA,EACpDC,IAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,qBAAqB,EAAA,QAAA,EAAA,CAChCD,GAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAC,oBAAoB,EAAA,QAAA,EAC/B,KAAK,CAAC,IAAI,EAAA,CACR,EACN,KAAK,CAAC,QAAQ,CAAA,EAAA,CACb,EAAA,CACJ;AAEd;;;;"}
@@ -1,8 +1,9 @@
1
- import React from 'react';
2
- declare const _default: {
3
- title: string;
4
- component: React.ComponentType<Record<string, never>> | undefined;
5
- };
6
- export default _default;
7
- export declare const Default: () => import("react/jsx-runtime").JSX.Element;
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { FormElement } from './FormElement';
3
+ declare const meta: Meta<typeof FormElement>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof FormElement>;
6
+ export declare const Default: Story;
7
+ export declare const WithEmailIcon: Story;
8
+ export declare const WithSearchIcon: Story;
8
9
  //# sourceMappingURL=FormElement.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"FormElement.stories.d.ts","sourceRoot":"","sources":["../../../Common/FormElement.stories.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;;;;;AAI1B,wBAAqE;AAErE,eAAO,MAAM,OAAO,+CAA4E,CAAC"}
1
+ {"version":3,"file":"FormElement.stories.d.ts","sourceRoot":"","sources":["../../../Common/FormElement.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5C,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,WAAW,CAGlC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,WAAW,CAAC,CAAC;AAE1C,eAAO,MAAM,OAAO,EAAE,KAWrB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAW3B,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAW5B,CAAC"}