@cratis/components 0.1.9 → 0.1.12

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 (258) hide show
  1. package/dist/cjs/CommandForm/CommandFormFields.js +9 -3
  2. package/dist/cjs/CommandForm/CommandFormFields.js.map +1 -1
  3. package/dist/cjs/CommandForm/ValidationMessage.js +24 -0
  4. package/dist/cjs/CommandForm/ValidationMessage.js.map +1 -0
  5. package/dist/cjs/CommandForm/asCommandFormField.js +47 -0
  6. package/dist/cjs/CommandForm/asCommandFormField.js.map +1 -0
  7. package/dist/cjs/CommandForm/fields/CheckboxField.js +13 -0
  8. package/dist/cjs/CommandForm/fields/CheckboxField.js.map +1 -0
  9. package/dist/cjs/CommandForm/fields/DropdownField.js +13 -0
  10. package/dist/cjs/CommandForm/fields/DropdownField.js.map +1 -0
  11. package/dist/cjs/CommandForm/fields/InputTextField.js +13 -0
  12. package/dist/cjs/CommandForm/fields/InputTextField.js.map +1 -0
  13. package/dist/cjs/CommandForm/fields/NumberField.js +13 -0
  14. package/dist/cjs/CommandForm/fields/NumberField.js.map +1 -0
  15. package/dist/cjs/CommandForm/fields/SliderField.js +17 -0
  16. package/dist/cjs/CommandForm/fields/SliderField.js.map +1 -0
  17. package/dist/cjs/CommandForm/fields/TextAreaField.js +13 -0
  18. package/dist/cjs/CommandForm/fields/TextAreaField.js.map +1 -0
  19. package/dist/cjs/CommandForm/index.js +15 -7
  20. package/dist/cjs/CommandForm/index.js.map +1 -1
  21. package/dist/cjs/PivotViewer/PivotViewer.css +1258 -0
  22. package/dist/cjs/PivotViewer/PivotViewer.js +14 -0
  23. package/dist/cjs/PivotViewer/PivotViewer.js.map +1 -1
  24. package/dist/cjs/PivotViewer/components/PivotCanvas.js +33 -10
  25. package/dist/cjs/PivotViewer/components/PivotCanvas.js.map +1 -1
  26. package/dist/cjs/PivotViewer/components/PivotViewerMain.js +1 -1
  27. package/dist/cjs/PivotViewer/components/PivotViewerMain.js.map +1 -1
  28. package/dist/cjs/PivotViewer/components/Spinner.css +77 -0
  29. package/dist/cjs/PivotViewer/components/pivot/sprites.js +79 -15
  30. package/dist/cjs/PivotViewer/components/pivot/sprites.js.map +1 -1
  31. package/dist/cjs/PivotViewer/components/pivot/visibility.js +36 -10
  32. package/dist/cjs/PivotViewer/components/pivot/visibility.js.map +1 -1
  33. package/dist/cjs/PivotViewer/engine/layout.js +2 -1
  34. package/dist/cjs/PivotViewer/engine/layout.js.map +1 -1
  35. package/dist/cjs/PivotViewer/hooks/usePivotEngine.js +37 -2
  36. package/dist/cjs/PivotViewer/hooks/usePivotEngine.js.map +1 -1
  37. package/dist/cjs/PivotViewer/index.js +3 -0
  38. package/dist/cjs/PivotViewer/index.js.map +1 -1
  39. package/dist/cjs/PivotViewer/types.js +22 -0
  40. package/dist/cjs/PivotViewer/types.js.map +1 -0
  41. package/dist/cjs/TimeMachine/EventsView.css +213 -0
  42. package/dist/cjs/TimeMachine/TimeMachine.css +567 -0
  43. package/dist/cjs/TimeMachine/TimeMachine.js +8 -3
  44. package/dist/cjs/TimeMachine/TimeMachine.js.map +1 -1
  45. package/dist/esm/CommandForm/CommandForm.stories.d.ts +1 -0
  46. package/dist/esm/CommandForm/CommandForm.stories.d.ts.map +1 -1
  47. package/dist/esm/CommandForm/CommandForm.stories.js +34 -1
  48. package/dist/esm/CommandForm/CommandForm.stories.js.map +1 -1
  49. package/dist/esm/CommandForm/CommandFormFields.d.ts.map +1 -1
  50. package/dist/esm/CommandForm/CommandFormFields.js +9 -3
  51. package/dist/esm/CommandForm/CommandFormFields.js.map +1 -1
  52. package/dist/esm/CommandForm/UserRegistrationCommand.d.ts +63 -0
  53. package/dist/esm/CommandForm/UserRegistrationCommand.d.ts.map +1 -0
  54. package/dist/esm/CommandForm/UserRegistrationCommand.js +143 -0
  55. package/dist/esm/CommandForm/UserRegistrationCommand.js.map +1 -0
  56. package/dist/esm/CommandForm/ValidationMessage.d.ts +8 -0
  57. package/dist/esm/CommandForm/ValidationMessage.d.ts.map +1 -0
  58. package/dist/esm/CommandForm/ValidationMessage.js +22 -0
  59. package/dist/esm/CommandForm/ValidationMessage.js.map +1 -0
  60. package/dist/esm/CommandForm/asCommandFormField.d.ts +32 -0
  61. package/dist/esm/CommandForm/asCommandFormField.d.ts.map +1 -0
  62. package/dist/esm/CommandForm/asCommandFormField.js +45 -0
  63. package/dist/esm/CommandForm/asCommandFormField.js.map +1 -0
  64. package/dist/esm/CommandForm/fields/CheckboxField.d.ts +10 -0
  65. package/dist/esm/CommandForm/fields/CheckboxField.d.ts.map +1 -0
  66. package/dist/esm/CommandForm/fields/CheckboxField.js +11 -0
  67. package/dist/esm/CommandForm/fields/CheckboxField.js.map +1 -0
  68. package/dist/esm/CommandForm/fields/DropdownField.d.ts +15 -0
  69. package/dist/esm/CommandForm/fields/DropdownField.d.ts.map +1 -0
  70. package/dist/esm/CommandForm/fields/DropdownField.js +11 -0
  71. package/dist/esm/CommandForm/fields/DropdownField.js.map +1 -0
  72. package/dist/esm/CommandForm/fields/InputTextField.d.ts +11 -0
  73. package/dist/esm/CommandForm/fields/InputTextField.d.ts.map +1 -0
  74. package/dist/esm/CommandForm/fields/InputTextField.js +11 -0
  75. package/dist/esm/CommandForm/fields/InputTextField.js.map +1 -0
  76. package/dist/esm/CommandForm/fields/NumberField.d.ts +13 -0
  77. package/dist/esm/CommandForm/fields/NumberField.d.ts.map +1 -0
  78. package/dist/esm/CommandForm/fields/NumberField.js +11 -0
  79. package/dist/esm/CommandForm/fields/NumberField.js.map +1 -0
  80. package/dist/esm/CommandForm/fields/SliderField.d.ts +12 -0
  81. package/dist/esm/CommandForm/fields/SliderField.d.ts.map +1 -0
  82. package/dist/esm/CommandForm/fields/SliderField.js +15 -0
  83. package/dist/esm/CommandForm/fields/SliderField.js.map +1 -0
  84. package/dist/esm/CommandForm/fields/TextAreaField.d.ts +12 -0
  85. package/dist/esm/CommandForm/fields/TextAreaField.d.ts.map +1 -0
  86. package/dist/esm/CommandForm/fields/TextAreaField.js +11 -0
  87. package/dist/esm/CommandForm/fields/TextAreaField.js.map +1 -0
  88. package/dist/esm/CommandForm/fields/index.d.ts +7 -0
  89. package/dist/esm/CommandForm/fields/index.d.ts.map +1 -0
  90. package/dist/esm/CommandForm/fields/index.js +7 -0
  91. package/dist/esm/CommandForm/fields/index.js.map +1 -0
  92. package/dist/esm/CommandForm/index.d.ts +3 -4
  93. package/dist/esm/CommandForm/index.d.ts.map +1 -1
  94. package/dist/esm/CommandForm/index.js +8 -4
  95. package/dist/esm/CommandForm/index.js.map +1 -1
  96. package/dist/esm/PivotViewer/PivotViewer.css +1258 -0
  97. package/dist/esm/PivotViewer/PivotViewer.d.ts.map +1 -1
  98. package/dist/esm/PivotViewer/PivotViewer.js +14 -0
  99. package/dist/esm/PivotViewer/PivotViewer.js.map +1 -1
  100. package/dist/esm/PivotViewer/PivotViewer.stories.d.ts +1 -0
  101. package/dist/esm/PivotViewer/PivotViewer.stories.d.ts.map +1 -1
  102. package/dist/esm/PivotViewer/PivotViewer.stories.js +43 -3
  103. package/dist/esm/PivotViewer/PivotViewer.stories.js.map +1 -1
  104. package/dist/esm/PivotViewer/components/PivotCanvas.d.ts.map +1 -1
  105. package/dist/esm/PivotViewer/components/PivotCanvas.js +33 -10
  106. package/dist/esm/PivotViewer/components/PivotCanvas.js.map +1 -1
  107. package/dist/esm/PivotViewer/components/PivotViewerMain.js +1 -1
  108. package/dist/esm/PivotViewer/components/PivotViewerMain.js.map +1 -1
  109. package/dist/esm/PivotViewer/components/Spinner.css +77 -0
  110. package/dist/esm/PivotViewer/components/pivot/sprites.d.ts.map +1 -1
  111. package/dist/esm/PivotViewer/components/pivot/sprites.js +79 -15
  112. package/dist/esm/PivotViewer/components/pivot/sprites.js.map +1 -1
  113. package/dist/esm/PivotViewer/components/pivot/visibility.d.ts.map +1 -1
  114. package/dist/esm/PivotViewer/components/pivot/visibility.js +36 -10
  115. package/dist/esm/PivotViewer/components/pivot/visibility.js.map +1 -1
  116. package/dist/esm/PivotViewer/engine/layout.js +2 -1
  117. package/dist/esm/PivotViewer/engine/layout.js.map +1 -1
  118. package/dist/esm/PivotViewer/engine/pivot.worker.d.ts.map +1 -1
  119. package/dist/esm/PivotViewer/engine/pivot.worker.js +22 -7
  120. package/dist/esm/PivotViewer/engine/pivot.worker.js.map +1 -1
  121. package/dist/esm/PivotViewer/hooks/useFilteredData.d.ts +2 -2
  122. package/dist/esm/PivotViewer/hooks/useFilteredData.d.ts.map +1 -1
  123. package/dist/esm/PivotViewer/hooks/useFilteredData.js +4 -2
  124. package/dist/esm/PivotViewer/hooks/useFilteredData.js.map +1 -1
  125. package/dist/esm/PivotViewer/hooks/usePivotEngine.d.ts.map +1 -1
  126. package/dist/esm/PivotViewer/hooks/usePivotEngine.js +37 -2
  127. package/dist/esm/PivotViewer/hooks/usePivotEngine.js.map +1 -1
  128. package/dist/esm/PivotViewer/index.d.ts +2 -1
  129. package/dist/esm/PivotViewer/index.d.ts.map +1 -1
  130. package/dist/esm/PivotViewer/index.js +1 -0
  131. package/dist/esm/PivotViewer/index.js.map +1 -1
  132. package/dist/esm/PivotViewer/types.d.ts +4 -1
  133. package/dist/esm/PivotViewer/types.d.ts.map +1 -1
  134. package/dist/esm/PivotViewer/types.js +19 -2
  135. package/dist/esm/PivotViewer/types.js.map +1 -1
  136. package/dist/esm/TimeMachine/EventsView.css +213 -0
  137. package/dist/esm/TimeMachine/TimeMachine.css +567 -0
  138. package/dist/esm/TimeMachine/TimeMachine.d.ts.map +1 -1
  139. package/dist/esm/TimeMachine/TimeMachine.js +8 -3
  140. package/dist/esm/TimeMachine/TimeMachine.js.map +1 -1
  141. package/dist/esm/tsconfig.tsbuildinfo +1 -1
  142. package/package.json +31 -32
  143. package/.storybook/main.ts +0 -24
  144. package/CommandDialog/CommandDialog.stories.tsx +0 -25
  145. package/CommandDialog/CommandDialog.tsx +0 -161
  146. package/CommandDialog/index.ts +0 -4
  147. package/CommandForm/CommandForm.stories.tsx +0 -24
  148. package/CommandForm/CommandForm.tsx +0 -266
  149. package/CommandForm/CommandFormField.tsx +0 -27
  150. package/CommandForm/CommandFormFields.tsx +0 -142
  151. package/CommandForm/DatePickerField.tsx +0 -57
  152. package/CommandForm/DropdownField.tsx +0 -65
  153. package/CommandForm/InputTextField.tsx +0 -62
  154. package/CommandForm/SliderField.tsx +0 -68
  155. package/CommandForm/index.ts +0 -10
  156. package/Common/ErrorBoundary.stories.tsx +0 -10
  157. package/Common/ErrorBoundary.tsx +0 -41
  158. package/Common/FormElement.stories.tsx +0 -10
  159. package/Common/FormElement.tsx +0 -20
  160. package/Common/Page.stories.tsx +0 -10
  161. package/Common/Page.tsx +0 -21
  162. package/Common/index.ts +0 -6
  163. package/DataPage/DataPage.stories.tsx +0 -10
  164. package/DataPage/DataPage.tsx +0 -191
  165. package/DataPage/index.ts +0 -4
  166. package/DataTables/DataTableForObservableQuery.stories.tsx +0 -10
  167. package/DataTables/DataTableForObservableQuery.tsx +0 -97
  168. package/DataTables/DataTableForQuery.stories.tsx +0 -10
  169. package/DataTables/DataTableForQuery.tsx +0 -97
  170. package/DataTables/index.ts +0 -5
  171. package/Dialogs/BusyIndicatorDialog.stories.tsx +0 -26
  172. package/Dialogs/BusyIndicatorDialog.tsx +0 -26
  173. package/Dialogs/ConfirmationDialog.stories.tsx +0 -36
  174. package/Dialogs/ConfirmationDialog.tsx +0 -75
  175. package/Dialogs/index.ts +0 -5
  176. package/Dropdown/Dropdown.tsx +0 -23
  177. package/Dropdown/index.ts +0 -4
  178. package/PivotViewer/PivotViewer.stories.tsx +0 -24
  179. package/PivotViewer/PivotViewer.tsx +0 -791
  180. package/PivotViewer/components/AxisLabels.tsx +0 -69
  181. package/PivotViewer/components/DetailPanel.tsx +0 -108
  182. package/PivotViewer/components/FilterPanel.tsx +0 -189
  183. package/PivotViewer/components/FilterPanelContainer.tsx +0 -10
  184. package/PivotViewer/components/PivotCanvas.tsx +0 -660
  185. package/PivotViewer/components/PivotViewerMain.tsx +0 -229
  186. package/PivotViewer/components/RangeHistogramFilter.tsx +0 -220
  187. package/PivotViewer/components/Spinner.tsx +0 -21
  188. package/PivotViewer/components/Toolbar.tsx +0 -130
  189. package/PivotViewer/components/ToolbarContainer.tsx +0 -10
  190. package/PivotViewer/components/index.ts +0 -12
  191. package/PivotViewer/components/pivot/animation.ts +0 -108
  192. package/PivotViewer/components/pivot/buckets.ts +0 -152
  193. package/PivotViewer/components/pivot/colorResolver.ts +0 -67
  194. package/PivotViewer/components/pivot/constants.ts +0 -46
  195. package/PivotViewer/components/pivot/sprites.ts +0 -265
  196. package/PivotViewer/components/pivot/visibility.ts +0 -319
  197. package/PivotViewer/constants.ts +0 -9
  198. package/PivotViewer/engine/layout.ts +0 -149
  199. package/PivotViewer/engine/pivot.worker.ts +0 -86
  200. package/PivotViewer/engine/store.ts +0 -437
  201. package/PivotViewer/engine/types.ts +0 -255
  202. package/PivotViewer/hooks/index.ts +0 -13
  203. package/PivotViewer/hooks/useContainerDimensions.ts +0 -45
  204. package/PivotViewer/hooks/useDimensionState.ts +0 -53
  205. package/PivotViewer/hooks/useFilterOptions.ts +0 -36
  206. package/PivotViewer/hooks/useFilterPanelDrag.ts +0 -49
  207. package/PivotViewer/hooks/useFilterState.ts +0 -106
  208. package/PivotViewer/hooks/useFilteredData.ts +0 -119
  209. package/PivotViewer/hooks/usePanning.ts +0 -163
  210. package/PivotViewer/hooks/usePivotEngine.ts +0 -252
  211. package/PivotViewer/hooks/useSelectedItem.ts +0 -402
  212. package/PivotViewer/hooks/useWheelZoom.ts +0 -114
  213. package/PivotViewer/hooks/useZoomState.ts +0 -34
  214. package/PivotViewer/index.ts +0 -7
  215. package/PivotViewer/types.ts +0 -59
  216. package/PivotViewer/utils/animations.ts +0 -249
  217. package/PivotViewer/utils/constants.ts +0 -20
  218. package/PivotViewer/utils/index.ts +0 -6
  219. package/PivotViewer/utils/selection.ts +0 -292
  220. package/PivotViewer/utils/utils.ts +0 -259
  221. package/TimeMachine/EventsView.stories.tsx +0 -10
  222. package/TimeMachine/EventsView.tsx +0 -119
  223. package/TimeMachine/Properties.stories.tsx +0 -10
  224. package/TimeMachine/Properties.tsx +0 -98
  225. package/TimeMachine/ReadModelView.stories.tsx +0 -10
  226. package/TimeMachine/ReadModelView.tsx +0 -143
  227. package/TimeMachine/TimeMachine.stories.tsx +0 -10
  228. package/TimeMachine/TimeMachine.tsx +0 -244
  229. package/TimeMachine/index.ts +0 -8
  230. package/TimeMachine/types.ts +0 -23
  231. package/dist/cjs/CommandForm/DatePickerField.js +0 -31
  232. package/dist/cjs/CommandForm/DatePickerField.js.map +0 -1
  233. package/dist/cjs/CommandForm/DropdownField.js +0 -31
  234. package/dist/cjs/CommandForm/DropdownField.js.map +0 -1
  235. package/dist/cjs/CommandForm/InputTextField.js +0 -32
  236. package/dist/cjs/CommandForm/InputTextField.js.map +0 -1
  237. package/dist/cjs/CommandForm/SliderField.js +0 -34
  238. package/dist/cjs/CommandForm/SliderField.js.map +0 -1
  239. package/dist/esm/CommandForm/DatePickerField.d.ts +0 -20
  240. package/dist/esm/CommandForm/DatePickerField.d.ts.map +0 -1
  241. package/dist/esm/CommandForm/DatePickerField.js +0 -29
  242. package/dist/esm/CommandForm/DatePickerField.js.map +0 -1
  243. package/dist/esm/CommandForm/DropdownField.d.ts +0 -24
  244. package/dist/esm/CommandForm/DropdownField.d.ts.map +0 -1
  245. package/dist/esm/CommandForm/DropdownField.js +0 -29
  246. package/dist/esm/CommandForm/DropdownField.js.map +0 -1
  247. package/dist/esm/CommandForm/InputTextField.d.ts +0 -20
  248. package/dist/esm/CommandForm/InputTextField.d.ts.map +0 -1
  249. package/dist/esm/CommandForm/InputTextField.js +0 -30
  250. package/dist/esm/CommandForm/InputTextField.js.map +0 -1
  251. package/dist/esm/CommandForm/SliderField.d.ts +0 -23
  252. package/dist/esm/CommandForm/SliderField.d.ts.map +0 -1
  253. package/dist/esm/CommandForm/SliderField.js +0 -32
  254. package/dist/esm/CommandForm/SliderField.js.map +0 -1
  255. package/global.d.ts +0 -11
  256. package/index.ts +0 -22
  257. package/useOverlayZIndex.ts +0 -32
  258. package/vite.config.ts +0 -80
@@ -0,0 +1,11 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { InputText } from 'primereact/inputtext';
3
+ import { asCommandFormField } from '../asCommandFormField.js';
4
+
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
+ defaultValue: '',
7
+ extractValue: (e) => e.target.value
8
+ });
9
+
10
+ export { InputTextField };
11
+ //# sourceMappingURL=InputTextField.js.map
@@ -0,0 +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;;;;"}
@@ -0,0 +1,13 @@
1
+ import { WrappedFieldProps } from '../asCommandFormField';
2
+ interface NumberFieldComponentProps extends WrappedFieldProps<number> {
3
+ placeholder?: string;
4
+ min?: number;
5
+ max?: number;
6
+ step?: number;
7
+ }
8
+ export declare const NumberField: {
9
+ <TCommand>(props: Omit<NumberFieldComponentProps, keyof WrappedFieldProps<unknown>> & import("..").BaseCommandFormFieldProps<TCommand> & import("..").InjectedCommandFormFieldProps): import("react/jsx-runtime").JSX.Element;
10
+ displayName: string;
11
+ };
12
+ export {};
13
+ //# sourceMappingURL=NumberField.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,11 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { InputNumber } from 'primereact/inputnumber';
3
+ import { asCommandFormField } from '../asCommandFormField.js';
4
+
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
+ defaultValue: 0,
7
+ extractValue: (e) => (typeof e === 'number' ? e : 0)
8
+ });
9
+
10
+ export { NumberField };
11
+ //# sourceMappingURL=NumberField.js.map
@@ -0,0 +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;;;;"}
@@ -0,0 +1,12 @@
1
+ import { WrappedFieldProps } from '../asCommandFormField';
2
+ interface RangeComponentProps extends WrappedFieldProps<number> {
3
+ min?: number;
4
+ max?: number;
5
+ step?: number;
6
+ }
7
+ export declare const RangeField: {
8
+ <TCommand>(props: Omit<RangeComponentProps, keyof WrappedFieldProps<unknown>> & import("..").BaseCommandFormFieldProps<TCommand> & import("..").InjectedCommandFormFieldProps): import("react/jsx-runtime").JSX.Element;
9
+ displayName: string;
10
+ };
11
+ export {};
12
+ //# sourceMappingURL=SliderField.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,15 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { asCommandFormField } from '../asCommandFormField.js';
3
+
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
+ }, {
10
+ defaultValue: 0,
11
+ extractValue: (e) => parseFloat(e.target.value)
12
+ });
13
+
14
+ export { RangeField };
15
+ //# sourceMappingURL=SliderField.js.map
@@ -0,0 +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;;;;"}
@@ -0,0 +1,12 @@
1
+ import { WrappedFieldProps } from '../asCommandFormField';
2
+ interface TextAreaFieldComponentProps extends WrappedFieldProps<string> {
3
+ placeholder?: string;
4
+ rows?: number;
5
+ cols?: number;
6
+ }
7
+ export declare const TextAreaField: {
8
+ <TCommand>(props: Omit<TextAreaFieldComponentProps, keyof WrappedFieldProps<unknown>> & import("..").BaseCommandFormFieldProps<TCommand> & import("..").InjectedCommandFormFieldProps): import("react/jsx-runtime").JSX.Element;
9
+ displayName: string;
10
+ };
11
+ export {};
12
+ //# sourceMappingURL=TextAreaField.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,11 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { InputTextarea } from 'primereact/inputtextarea';
3
+ import { asCommandFormField } from '../asCommandFormField.js';
4
+
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
+ defaultValue: '',
7
+ extractValue: (e) => e.target.value
8
+ });
9
+
10
+ export { TextAreaField };
11
+ //# sourceMappingURL=TextAreaField.js.map
@@ -0,0 +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;;;;"}
@@ -0,0 +1,7 @@
1
+ export * from './InputTextField';
2
+ export * from './NumberField';
3
+ export * from './CheckboxField';
4
+ export * from './TextAreaField';
5
+ export { SelectField } from './DropdownField';
6
+ export { RangeField } from './SliderField';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,7 @@
1
+ export * from './InputTextField';
2
+ export * from './NumberField';
3
+ export * from './CheckboxField';
4
+ export * from './TextAreaField';
5
+ export { SelectField } from './DropdownField';
6
+ export { RangeField } from './SliderField';
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +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,8 +1,7 @@
1
1
  export * from './CommandForm';
2
2
  export * from './CommandFormField';
3
+ export * from './ValidationMessage';
3
4
  export * from './CommandFormFields';
4
- export * from './InputTextField';
5
- export * from './DatePickerField';
6
- export * from './DropdownField';
7
- export * from './SliderField';
5
+ export * from './asCommandFormField';
6
+ export * from './fields';
8
7
  //# 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,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC"}
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,8 +1,12 @@
1
1
  export { CommandForm, useCommandFormContext, useCommandInstance, useSetCommandResult } from './CommandForm.js';
2
2
  export { CommandFormField } from './CommandFormField.js';
3
+ export { ValidationMessage } from './ValidationMessage.js';
3
4
  export { CommandFormFields } from './CommandFormFields.js';
4
- export { InputTextField } from './InputTextField.js';
5
- export { DatePickerField } from './DatePickerField.js';
6
- export { DropdownField } from './DropdownField.js';
7
- export { SliderField } from './SliderField.js';
5
+ export { asCommandFormField } from './asCommandFormField.js';
6
+ export { InputTextField } from './fields/InputTextField.js';
7
+ export { NumberField } from './fields/NumberField.js';
8
+ export { CheckboxField } from './fields/CheckboxField.js';
9
+ export { TextAreaField } from './fields/TextAreaField.js';
10
+ export { SelectField } from './fields/DropdownField.js';
11
+ export { RangeField } from './fields/SliderField.js';
8
12
  //# 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":";;;;;;;;;;"}