@cratis/components 0.1.10 → 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 (158) 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.js +14 -0
  22. package/dist/cjs/PivotViewer/PivotViewer.js.map +1 -1
  23. package/dist/cjs/PivotViewer/components/PivotCanvas.js +33 -10
  24. package/dist/cjs/PivotViewer/components/PivotCanvas.js.map +1 -1
  25. package/dist/cjs/PivotViewer/components/PivotViewerMain.js +1 -1
  26. package/dist/cjs/PivotViewer/components/PivotViewerMain.js.map +1 -1
  27. package/dist/cjs/PivotViewer/components/pivot/sprites.js +79 -15
  28. package/dist/cjs/PivotViewer/components/pivot/sprites.js.map +1 -1
  29. package/dist/cjs/PivotViewer/components/pivot/visibility.js +36 -10
  30. package/dist/cjs/PivotViewer/components/pivot/visibility.js.map +1 -1
  31. package/dist/cjs/PivotViewer/engine/layout.js +2 -1
  32. package/dist/cjs/PivotViewer/engine/layout.js.map +1 -1
  33. package/dist/cjs/PivotViewer/hooks/usePivotEngine.js +37 -2
  34. package/dist/cjs/PivotViewer/hooks/usePivotEngine.js.map +1 -1
  35. package/dist/cjs/PivotViewer/index.js +3 -0
  36. package/dist/cjs/PivotViewer/index.js.map +1 -1
  37. package/dist/cjs/PivotViewer/types.js +22 -0
  38. package/dist/cjs/PivotViewer/types.js.map +1 -0
  39. package/dist/cjs/TimeMachine/TimeMachine.js +8 -3
  40. package/dist/cjs/TimeMachine/TimeMachine.js.map +1 -1
  41. package/dist/esm/CommandForm/CommandForm.stories.d.ts +1 -0
  42. package/dist/esm/CommandForm/CommandForm.stories.d.ts.map +1 -1
  43. package/dist/esm/CommandForm/CommandForm.stories.js +34 -1
  44. package/dist/esm/CommandForm/CommandForm.stories.js.map +1 -1
  45. package/dist/esm/CommandForm/CommandFormFields.d.ts.map +1 -1
  46. package/dist/esm/CommandForm/CommandFormFields.js +9 -3
  47. package/dist/esm/CommandForm/CommandFormFields.js.map +1 -1
  48. package/dist/esm/CommandForm/UserRegistrationCommand.d.ts +63 -0
  49. package/dist/esm/CommandForm/UserRegistrationCommand.d.ts.map +1 -0
  50. package/dist/esm/CommandForm/UserRegistrationCommand.js +143 -0
  51. package/dist/esm/CommandForm/UserRegistrationCommand.js.map +1 -0
  52. package/dist/esm/CommandForm/ValidationMessage.d.ts +8 -0
  53. package/dist/esm/CommandForm/ValidationMessage.d.ts.map +1 -0
  54. package/dist/esm/CommandForm/ValidationMessage.js +22 -0
  55. package/dist/esm/CommandForm/ValidationMessage.js.map +1 -0
  56. package/dist/esm/CommandForm/asCommandFormField.d.ts +32 -0
  57. package/dist/esm/CommandForm/asCommandFormField.d.ts.map +1 -0
  58. package/dist/esm/CommandForm/asCommandFormField.js +45 -0
  59. package/dist/esm/CommandForm/asCommandFormField.js.map +1 -0
  60. package/dist/esm/CommandForm/fields/CheckboxField.d.ts +10 -0
  61. package/dist/esm/CommandForm/fields/CheckboxField.d.ts.map +1 -0
  62. package/dist/esm/CommandForm/fields/CheckboxField.js +11 -0
  63. package/dist/esm/CommandForm/fields/CheckboxField.js.map +1 -0
  64. package/dist/esm/CommandForm/fields/DropdownField.d.ts +15 -0
  65. package/dist/esm/CommandForm/fields/DropdownField.d.ts.map +1 -0
  66. package/dist/esm/CommandForm/fields/DropdownField.js +11 -0
  67. package/dist/esm/CommandForm/fields/DropdownField.js.map +1 -0
  68. package/dist/esm/CommandForm/fields/InputTextField.d.ts +11 -0
  69. package/dist/esm/CommandForm/fields/InputTextField.d.ts.map +1 -0
  70. package/dist/esm/CommandForm/fields/InputTextField.js +11 -0
  71. package/dist/esm/CommandForm/fields/InputTextField.js.map +1 -0
  72. package/dist/esm/CommandForm/fields/NumberField.d.ts +13 -0
  73. package/dist/esm/CommandForm/fields/NumberField.d.ts.map +1 -0
  74. package/dist/esm/CommandForm/fields/NumberField.js +11 -0
  75. package/dist/esm/CommandForm/fields/NumberField.js.map +1 -0
  76. package/dist/esm/CommandForm/fields/SliderField.d.ts +12 -0
  77. package/dist/esm/CommandForm/fields/SliderField.d.ts.map +1 -0
  78. package/dist/esm/CommandForm/fields/SliderField.js +15 -0
  79. package/dist/esm/CommandForm/fields/SliderField.js.map +1 -0
  80. package/dist/esm/CommandForm/fields/TextAreaField.d.ts +12 -0
  81. package/dist/esm/CommandForm/fields/TextAreaField.d.ts.map +1 -0
  82. package/dist/esm/CommandForm/fields/TextAreaField.js +11 -0
  83. package/dist/esm/CommandForm/fields/TextAreaField.js.map +1 -0
  84. package/dist/esm/CommandForm/fields/index.d.ts +7 -0
  85. package/dist/esm/CommandForm/fields/index.d.ts.map +1 -0
  86. package/dist/esm/CommandForm/fields/index.js +7 -0
  87. package/dist/esm/CommandForm/fields/index.js.map +1 -0
  88. package/dist/esm/CommandForm/index.d.ts +3 -4
  89. package/dist/esm/CommandForm/index.d.ts.map +1 -1
  90. package/dist/esm/CommandForm/index.js +8 -4
  91. package/dist/esm/CommandForm/index.js.map +1 -1
  92. package/dist/esm/PivotViewer/PivotViewer.d.ts.map +1 -1
  93. package/dist/esm/PivotViewer/PivotViewer.js +14 -0
  94. package/dist/esm/PivotViewer/PivotViewer.js.map +1 -1
  95. package/dist/esm/PivotViewer/PivotViewer.stories.d.ts +1 -0
  96. package/dist/esm/PivotViewer/PivotViewer.stories.d.ts.map +1 -1
  97. package/dist/esm/PivotViewer/PivotViewer.stories.js +43 -3
  98. package/dist/esm/PivotViewer/PivotViewer.stories.js.map +1 -1
  99. package/dist/esm/PivotViewer/components/PivotCanvas.d.ts.map +1 -1
  100. package/dist/esm/PivotViewer/components/PivotCanvas.js +33 -10
  101. package/dist/esm/PivotViewer/components/PivotCanvas.js.map +1 -1
  102. package/dist/esm/PivotViewer/components/PivotViewerMain.js +1 -1
  103. package/dist/esm/PivotViewer/components/PivotViewerMain.js.map +1 -1
  104. package/dist/esm/PivotViewer/components/pivot/sprites.d.ts.map +1 -1
  105. package/dist/esm/PivotViewer/components/pivot/sprites.js +79 -15
  106. package/dist/esm/PivotViewer/components/pivot/sprites.js.map +1 -1
  107. package/dist/esm/PivotViewer/components/pivot/visibility.d.ts.map +1 -1
  108. package/dist/esm/PivotViewer/components/pivot/visibility.js +36 -10
  109. package/dist/esm/PivotViewer/components/pivot/visibility.js.map +1 -1
  110. package/dist/esm/PivotViewer/engine/layout.js +2 -1
  111. package/dist/esm/PivotViewer/engine/layout.js.map +1 -1
  112. package/dist/esm/PivotViewer/engine/pivot.worker.d.ts.map +1 -1
  113. package/dist/esm/PivotViewer/engine/pivot.worker.js +22 -7
  114. package/dist/esm/PivotViewer/engine/pivot.worker.js.map +1 -1
  115. package/dist/esm/PivotViewer/hooks/useFilteredData.d.ts +2 -2
  116. package/dist/esm/PivotViewer/hooks/useFilteredData.d.ts.map +1 -1
  117. package/dist/esm/PivotViewer/hooks/useFilteredData.js +4 -2
  118. package/dist/esm/PivotViewer/hooks/useFilteredData.js.map +1 -1
  119. package/dist/esm/PivotViewer/hooks/usePivotEngine.d.ts.map +1 -1
  120. package/dist/esm/PivotViewer/hooks/usePivotEngine.js +37 -2
  121. package/dist/esm/PivotViewer/hooks/usePivotEngine.js.map +1 -1
  122. package/dist/esm/PivotViewer/index.d.ts +2 -1
  123. package/dist/esm/PivotViewer/index.d.ts.map +1 -1
  124. package/dist/esm/PivotViewer/index.js +1 -0
  125. package/dist/esm/PivotViewer/index.js.map +1 -1
  126. package/dist/esm/PivotViewer/types.d.ts +4 -1
  127. package/dist/esm/PivotViewer/types.d.ts.map +1 -1
  128. package/dist/esm/PivotViewer/types.js +19 -2
  129. package/dist/esm/PivotViewer/types.js.map +1 -1
  130. package/dist/esm/TimeMachine/TimeMachine.d.ts.map +1 -1
  131. package/dist/esm/TimeMachine/TimeMachine.js +8 -3
  132. package/dist/esm/TimeMachine/TimeMachine.js.map +1 -1
  133. package/dist/esm/tsconfig.tsbuildinfo +1 -1
  134. package/package.json +29 -29
  135. package/dist/cjs/CommandForm/DatePickerField.js +0 -31
  136. package/dist/cjs/CommandForm/DatePickerField.js.map +0 -1
  137. package/dist/cjs/CommandForm/DropdownField.js +0 -31
  138. package/dist/cjs/CommandForm/DropdownField.js.map +0 -1
  139. package/dist/cjs/CommandForm/InputTextField.js +0 -32
  140. package/dist/cjs/CommandForm/InputTextField.js.map +0 -1
  141. package/dist/cjs/CommandForm/SliderField.js +0 -34
  142. package/dist/cjs/CommandForm/SliderField.js.map +0 -1
  143. package/dist/esm/CommandForm/DatePickerField.d.ts +0 -20
  144. package/dist/esm/CommandForm/DatePickerField.d.ts.map +0 -1
  145. package/dist/esm/CommandForm/DatePickerField.js +0 -29
  146. package/dist/esm/CommandForm/DatePickerField.js.map +0 -1
  147. package/dist/esm/CommandForm/DropdownField.d.ts +0 -24
  148. package/dist/esm/CommandForm/DropdownField.d.ts.map +0 -1
  149. package/dist/esm/CommandForm/DropdownField.js +0 -29
  150. package/dist/esm/CommandForm/DropdownField.js.map +0 -1
  151. package/dist/esm/CommandForm/InputTextField.d.ts +0 -20
  152. package/dist/esm/CommandForm/InputTextField.d.ts.map +0 -1
  153. package/dist/esm/CommandForm/InputTextField.js +0 -30
  154. package/dist/esm/CommandForm/InputTextField.js.map +0 -1
  155. package/dist/esm/CommandForm/SliderField.d.ts +0 -23
  156. package/dist/esm/CommandForm/SliderField.d.ts.map +0 -1
  157. package/dist/esm/CommandForm/SliderField.js +0 -32
  158. package/dist/esm/CommandForm/SliderField.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UserRegistrationCommand.d.ts","sourceRoot":"","sources":["../../../CommandForm/UserRegistrationCommand.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAc,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAC9F,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,wBAAwB,CAAC;AAEhC,MAAM,WAAW,wBAAwB;IACrC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,qBAA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aAAa,IAAI,MAAM,CAE1B;IAED,IAAI,aAAa,CAAC,KAAK,EAAE,MAAM,EAG9B;IAED,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED,IAAI,SAAS,CAAC,KAAK,EAAE,MAAM,EAG1B;IAED,IAAI,YAAY,IAAI,OAAO,CAE1B;IAED,IAAI,YAAY,CAAC,KAAK,EAAE,OAAO,EAG9B;IAED,IAAI,eAAe,IAAI,MAAM,CAE5B;IAED,IAAI,eAAe,CAAC,KAAK,EAAE,MAAM,EAGhC;IAED,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,IAAI,IAAI,CAAC,KAAK,EAAE,MAAM,EAGrB;IAED,MAAM,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,wBAAwB,GAAG,CAAC,uBAAuB,EAAE,gBAAgB,CAAC,wBAAwB,CAAC,EAAE,kBAAkB,CAAC;CAGlJ"}
@@ -0,0 +1,143 @@
1
+ import { Command, CommandValidator } from '@cratis/arc/commands';
2
+ import { useCommand } from '@cratis/arc.react/commands';
3
+ import { PropertyDescriptor } from '@cratis/arc/reflection';
4
+ import '@cratis/arc/validation';
5
+ export class UserRegistrationCommandValidator extends CommandValidator {
6
+ constructor() {
7
+ super();
8
+ this.ruleFor(c => c.username).notEmpty().minLength(3).maxLength(20);
9
+ this.ruleFor(c => c.email).notEmpty().emailAddress();
10
+ this.ruleFor(c => c.password).notEmpty().minLength(8);
11
+ this.ruleFor(c => c.age).greaterThanOrEqual(13).lessThanOrEqual(120);
12
+ }
13
+ }
14
+ export class UserRegistrationCommand extends Command {
15
+ route = '/api/users/register';
16
+ validation = new UserRegistrationCommandValidator();
17
+ propertyDescriptors = [
18
+ new PropertyDescriptor('username', String),
19
+ new PropertyDescriptor('email', String),
20
+ new PropertyDescriptor('password', String),
21
+ new PropertyDescriptor('confirmPassword', String),
22
+ new PropertyDescriptor('age', Number),
23
+ new PropertyDescriptor('bio', String),
24
+ new PropertyDescriptor('favoriteColor', String),
25
+ new PropertyDescriptor('birthDate', String),
26
+ new PropertyDescriptor('agreeToTerms', Boolean),
27
+ new PropertyDescriptor('experienceLevel', Number),
28
+ new PropertyDescriptor('role', String),
29
+ ];
30
+ _username;
31
+ _email;
32
+ _password;
33
+ _confirmPassword;
34
+ _age;
35
+ _bio;
36
+ _favoriteColor;
37
+ _birthDate;
38
+ _agreeToTerms;
39
+ _experienceLevel;
40
+ _role;
41
+ constructor() {
42
+ super(Object, false);
43
+ }
44
+ get requestParameters() {
45
+ return [];
46
+ }
47
+ get properties() {
48
+ return [
49
+ 'username',
50
+ 'email',
51
+ 'password',
52
+ 'confirmPassword',
53
+ 'age',
54
+ 'bio',
55
+ 'favoriteColor',
56
+ 'birthDate',
57
+ 'agreeToTerms',
58
+ 'experienceLevel',
59
+ 'role',
60
+ ];
61
+ }
62
+ get username() {
63
+ return this._username;
64
+ }
65
+ set username(value) {
66
+ this._username = value;
67
+ this.propertyChanged('username');
68
+ }
69
+ get email() {
70
+ return this._email;
71
+ }
72
+ set email(value) {
73
+ this._email = value;
74
+ this.propertyChanged('email');
75
+ }
76
+ get password() {
77
+ return this._password;
78
+ }
79
+ set password(value) {
80
+ this._password = value;
81
+ this.propertyChanged('password');
82
+ }
83
+ get confirmPassword() {
84
+ return this._confirmPassword;
85
+ }
86
+ set confirmPassword(value) {
87
+ this._confirmPassword = value;
88
+ this.propertyChanged('confirmPassword');
89
+ }
90
+ get age() {
91
+ return this._age;
92
+ }
93
+ set age(value) {
94
+ this._age = value;
95
+ this.propertyChanged('age');
96
+ }
97
+ get bio() {
98
+ return this._bio;
99
+ }
100
+ set bio(value) {
101
+ this._bio = value;
102
+ this.propertyChanged('bio');
103
+ }
104
+ get favoriteColor() {
105
+ return this._favoriteColor;
106
+ }
107
+ set favoriteColor(value) {
108
+ this._favoriteColor = value;
109
+ this.propertyChanged('favoriteColor');
110
+ }
111
+ get birthDate() {
112
+ return this._birthDate;
113
+ }
114
+ set birthDate(value) {
115
+ this._birthDate = value;
116
+ this.propertyChanged('birthDate');
117
+ }
118
+ get agreeToTerms() {
119
+ return this._agreeToTerms;
120
+ }
121
+ set agreeToTerms(value) {
122
+ this._agreeToTerms = value;
123
+ this.propertyChanged('agreeToTerms');
124
+ }
125
+ get experienceLevel() {
126
+ return this._experienceLevel;
127
+ }
128
+ set experienceLevel(value) {
129
+ this._experienceLevel = value;
130
+ this.propertyChanged('experienceLevel');
131
+ }
132
+ get role() {
133
+ return this._role;
134
+ }
135
+ set role(value) {
136
+ this._role = value;
137
+ this.propertyChanged('role');
138
+ }
139
+ static use(initialValues) {
140
+ return useCommand(UserRegistrationCommand, initialValues);
141
+ }
142
+ }
143
+ //# sourceMappingURL=UserRegistrationCommand.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UserRegistrationCommand.js","sourceRoot":"","sources":["../../../CommandForm/UserRegistrationCommand.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,UAAU,EAAwC,MAAM,4BAA4B,CAAC;AAC9F,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,wBAAwB,CAAC;AAgBhC,MAAM,OAAO,gCAAiC,SAAQ,gBAA0C;IAC5F;QACI,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;QACpE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,CAAC,YAAY,EAAE,CAAC;QACrD,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QACt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@
1
+ export interface ValidationMessageProps<TCommand> {
2
+ value: (command: TCommand) => unknown;
3
+ }
4
+ export declare const ValidationMessage: {
5
+ <TCommand>(props: ValidationMessageProps<TCommand>): import("react/jsx-runtime").JSX.Element | null;
6
+ displayName: string;
7
+ };
8
+ //# sourceMappingURL=ValidationMessage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ValidationMessage.d.ts","sourceRoot":"","sources":["../../../CommandForm/ValidationMessage.tsx"],"names":[],"mappings":"AAMA,MAAM,WAAW,sBAAsB,CAAC,QAAQ;IAC5C,KAAK,EAAE,CAAC,OAAO,EAAE,QAAQ,KAAK,OAAO,CAAC;CACzC;AAED,eAAO,MAAM,iBAAiB;KAAI,QAAQ,SAAU,sBAAsB,CAAC,QAAQ,CAAC;;CAqBnF,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { useCommandFormContext } from './CommandForm.js';
3
+
4
+ const ValidationMessage = (props) => {
5
+ const context = useCommandFormContext();
6
+ const propertyAccessor = props.value;
7
+ const getPropertyName = (accessor) => {
8
+ const fnStr = accessor.toString();
9
+ const match = fnStr.match(/\.([a-zA-Z_$][a-zA-Z0-9_$]*)/);
10
+ return match ? match[1] : '';
11
+ };
12
+ const propertyName = getPropertyName(propertyAccessor);
13
+ const errorMessage = propertyName ? context.getFieldError(propertyName) : undefined;
14
+ if (!errorMessage) {
15
+ return null;
16
+ }
17
+ return (jsx("small", { className: "p-error block mt-1", children: errorMessage }));
18
+ };
19
+ ValidationMessage.displayName = 'ValidationMessage';
20
+
21
+ export { ValidationMessage };
22
+ //# sourceMappingURL=ValidationMessage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ValidationMessage.js","sources":["../../../CommandForm/ValidationMessage.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 { useCommandFormContext } from './CommandForm';\n\nexport interface ValidationMessageProps<TCommand> {\n value: (command: TCommand) => unknown;\n}\n\nexport const ValidationMessage = <TCommand,>(props: ValidationMessageProps<TCommand>) => {\n const context = useCommandFormContext<TCommand>();\n const propertyAccessor = props.value;\n \n // Get the property name from the accessor function\n const getPropertyName = (accessor: (obj: TCommand) => unknown): string => {\n const fnStr = accessor.toString();\n const match = fnStr.match(/\\.([a-zA-Z_$][a-zA-Z0-9_$]*)/);\n return match ? match[1] : '';\n };\n \n const propertyName = getPropertyName(propertyAccessor);\n const errorMessage = propertyName ? context.getFieldError(propertyName) : undefined;\n \n if (!errorMessage) {\n return null;\n }\n \n return (\n <small className=\"p-error block mt-1\">{errorMessage}</small>\n );\n};\n\nValidationMessage.displayName = 'ValidationMessage';\n"],"names":["_jsx"],"mappings":";;;AAUO,MAAM,iBAAiB,GAAG,CAAY,KAAuC,KAAI;AACpF,IAAA,MAAM,OAAO,GAAG,qBAAqB,EAAY;AACjD,IAAA,MAAM,gBAAgB,GAAG,KAAK,CAAC,KAAK;AAGpC,IAAA,MAAM,eAAe,GAAG,CAAC,QAAoC,KAAY;AACrE,QAAA,MAAM,KAAK,GAAG,QAAQ,CAAC,QAAQ,EAAE;QACjC,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,8BAA8B,CAAC;AACzD,QAAA,OAAO,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,EAAE;AAChC,IAAA,CAAC;AAED,IAAA,MAAM,YAAY,GAAG,eAAe,CAAC,gBAAgB,CAAC;AACtD,IAAA,MAAM,YAAY,GAAG,YAAY,GAAG,OAAO,CAAC,aAAa,CAAC,YAAY,CAAC,GAAG,SAAS;IAEnF,IAAI,CAAC,YAAY,EAAE;AACf,QAAA,OAAO,IAAI;IACf;IAEA,QACIA,eAAO,SAAS,EAAC,oBAAoB,EAAA,QAAA,EAAE,YAAY,EAAA,CAAS;AAEpE;AAEA,iBAAiB,CAAC,WAAW,GAAG,mBAAmB;;;;"}
@@ -0,0 +1,32 @@
1
+ import { PropertyAccessor } from '@cratis/fundamentals';
2
+ import { PropertyDescriptor } from '@cratis/arc/reflection';
3
+ import React, { ComponentType } from 'react';
4
+ export interface InjectedCommandFormFieldProps {
5
+ currentValue?: unknown;
6
+ onValueChange?: (value: unknown) => void;
7
+ propertyDescriptor?: PropertyDescriptor;
8
+ fieldName?: string;
9
+ }
10
+ export interface BaseCommandFormFieldProps<TCommand> {
11
+ icon?: React.ReactElement;
12
+ value: PropertyAccessor<TCommand>;
13
+ required?: boolean;
14
+ title?: string;
15
+ description?: string;
16
+ }
17
+ export interface CommandFormFieldConfig<TValue = unknown> {
18
+ defaultValue: TValue;
19
+ extractValue?: (event: unknown) => TValue;
20
+ }
21
+ export interface WrappedFieldProps<TValue = unknown> {
22
+ value: TValue;
23
+ onChange: (valueOrEvent: TValue | unknown) => void;
24
+ invalid: boolean;
25
+ required: boolean;
26
+ errors: string[];
27
+ }
28
+ export declare function asCommandFormField<TComponentProps extends WrappedFieldProps<unknown>>(component: ComponentType<TComponentProps> | ((props: TComponentProps) => React.ReactElement), config: CommandFormFieldConfig<TComponentProps['value']>): {
29
+ <TCommand>(props: Omit<TComponentProps, keyof WrappedFieldProps> & BaseCommandFormFieldProps<TCommand> & InjectedCommandFormFieldProps): import("react/jsx-runtime").JSX.Element;
30
+ displayName: string;
31
+ };
32
+ //# sourceMappingURL=asCommandFormField.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asCommandFormField.d.ts","sourceRoot":"","sources":["../../../CommandForm/asCommandFormField.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,KAAK,EAAE,EAAuB,aAAa,EAAE,MAAM,OAAO,CAAC;AAMlE,MAAM,WAAW,6BAA6B;IAC1C,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,aAAa,CAAC,EAAE,CAAC,KAAK,EA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ormContext } from './CommandForm.js';
4
+
5
+ function asCommandFormField(component, config) {
6
+ const { defaultValue, extractValue } = config;
7
+ const Component = typeof component === 'function' && !component.prototype?.render
8
+ ? component
9
+ : component;
10
+ const WrappedField = (props) => {
11
+ const { currentValue, onValueChange, fieldName, required = true, ...componentProps } = props;
12
+ const [localValue, setLocalValue] = useState(currentValue ?? defaultValue);
13
+ const { getFieldError, customFieldErrors } = useCommandFormContext();
14
+ const serverError = fieldName ? getFieldError(fieldName) : undefined;
15
+ const customError = fieldName ? customFieldErrors[fieldName] : undefined;
16
+ const errors = [];
17
+ if (serverError)
18
+ errors.push(serverError);
19
+ if (customError)
20
+ errors.push(customError);
21
+ const isInvalid = errors.length > 0;
22
+ useEffect(() => {
23
+ setLocalValue(currentValue ?? defaultValue);
24
+ }, [currentValue]);
25
+ const handleChange = (valueOrEvent) => {
26
+ const newValue = extractValue ? extractValue(valueOrEvent) : valueOrEvent;
27
+ setLocalValue(newValue);
28
+ onValueChange?.(newValue);
29
+ };
30
+ const wrappedProps = {
31
+ ...componentProps,
32
+ value: localValue,
33
+ onChange: handleChange,
34
+ invalid: isInvalid,
35
+ required,
36
+ errors
37
+ };
38
+ return jsx(Component, { ...wrappedProps });
39
+ };
40
+ WrappedField.displayName = 'CommandFormField';
41
+ return WrappedField;
42
+ }
43
+
44
+ export { asCommandFormField };
45
+ //# sourceMappingURL=asCommandFormField.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asCommandFormField.js","sources":["../../../CommandForm/asCommandFormField.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 { PropertyAccessor } from '@cratis/fundamentals';\nimport { PropertyDescriptor } from '@cratis/arc/reflection';\nimport React, { useState, useEffect, ComponentType } from 'react';\nimport { useCommandFormContext } from './CommandForm';\n\n/**\n * Props that will be injected by CommandFormFields into your wrapped component\n */\nexport interface InjectedCommandFormFieldProps {\n currentValue?: unknown;\n onValueChange?: (value: unknown) => void;\n propertyDescriptor?: PropertyDescriptor;\n fieldName?: string;\n}\n\n/**\n * Props that your field component should accept (excluding the injected ones)\n */\nexport interface BaseCommandFormFieldProps<TCommand> {\n icon?: React.ReactElement;\n value: PropertyAccessor<TCommand>;\n required?: boolean;\n title?: string;\n description?: string;\n}\n\n/**\n * Configuration for the field wrapper\n */\nexport interface CommandFormFieldConfig<TValue = unknown> {\n /** Default value when currentValue is undefined */\n defaultValue: TValue;\n /** Value extractor from the change event */\n extractValue?: (event: unknown) => TValue;\n}\n\n/**\n * Props that your wrapped component will receive\n */\nexport interface WrappedFieldProps<TValue = unknown> {\n value: TValue;\n onChange: (valueOrEvent: TValue | unknown) => void;\n invalid: boolean;\n required: boolean;\n errors: string[];\n}\n\n/**\n * Wraps a field component to work with CommandForm, handling all integration automatically.\n * \n * @example\n * ```typescript\n * interface MyInputProps extends WrappedFieldProps<string> {\n * placeholder?: string;\n * }\n * \n * export const MyInputField = asCommandFormField<MyInputProps>(\n * (props) => (\n * <div>\n * <input\n * value={props.value}\n * onChange={props.onChange}\n * placeholder={props.placeholder}\n * className={props.invalid ? 'invalid' : ''}\n * />\n * {props.errors.length > 0 && (\n * <div className=\"error-messages\">\n * {props.errors.map((error, idx) => (\n * <small key={idx} className=\"p-error\">{error}</small>\n * ))}\n * </div>\n * )}\n * </div>\n * ),\n * {\n * defaultValue: '',\n * extractValue: (e) => e.target.value\n * }\n * );\n * ```\n */\nexport function asCommandFormField<TComponentProps extends WrappedFieldProps<unknown>>(\n component: ComponentType<TComponentProps> | ((props: TComponentProps) => React.ReactElement),\n config: CommandFormFieldConfig<TComponentProps['value']>\n) {\n const { defaultValue, extractValue } = config;\n const Component = typeof component === 'function' && !component.prototype?.render \n ? component \n : component as ComponentType<TComponentProps>;\n\n const WrappedField = <TCommand,>(\n props: Omit<TComponentProps, keyof WrappedFieldProps> & \n BaseCommandFormFieldProps<TCommand> & \n InjectedCommandFormFieldProps\n ) => {\n const { \n currentValue, \n onValueChange, \n fieldName, \n required = true,\n ...componentProps \n } = props;\n\n const [localValue, setLocalValue] = useState(currentValue ?? defaultValue);\n const { getFieldError, customFieldErrors } = useCommandFormContext();\n\n const serverError = fieldName ? getFieldError(fieldName) : undefined;\n const customError = fieldName ? customFieldErrors[fieldName] : undefined;\n \n const errors: string[] = [];\n if (serverError) errors.push(serverError);\n if (customError) errors.push(customError);\n\n const isInvalid = errors.length > 0;\n\n useEffect(() => {\n setLocalValue(currentValue ?? defaultValue);\n }, [currentValue]);\n\n const handleChange = (valueOrEvent: unknown) => {\n const newValue = extractValue ? extractValue(valueOrEvent) : valueOrEvent;\n setLocalValue(newValue);\n onValueChange?.(newValue);\n };\n\n const wrappedProps = {\n ...componentProps,\n value: localValue,\n onChange: handleChange,\n invalid: isInvalid,\n required,\n errors\n } as TComponentProps;\n\n return <Component {...wrappedProps} />;\n };\n\n WrappedField.displayName = 'CommandFormField';\n\n return WrappedField;\n}\n"],"names":["_jsx"],"mappings":";;;;AAoFM,SAAU,kBAAkB,CAC9B,SAA4F,EAC5F,MAAwD,EAAA;AAExD,IAAA,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,GAAG,MAAM;AAC7C,IAAA,MAAM,SAAS,GAAG,OAAO,SAAS,KAAK,UAAU,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE;AACvE,UAAE;UACA,SAA2C;AAEjD,IAAA,MAAM,YAAY,GAAG,CACjB,KAEoC,KACpC;AACA,QAAA,MAAM,EACF,YAAY,EACZ,aAAa,EACb,SAAS,EACT,QAAQ,GAAG,IAAI,EACf,GAAG,cAAc,EACpB,GAAG,KAAK;AAET,QAAA,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,YAAY,IAAI,YAAY,CAAC;QAC1E,MAAM,EAAE,aAAa,EAAE,iBAAiB,EAAE,GAAG,qBAAqB,EAAE;AAEpE,QAAA,MAAM,WAAW,GAAG,SAAS,GAAG,aAAa,CAAC,SAAS,CAAC,GAAG,SAAS;AACpE,QAAA,MAAM,WAAW,GAAG,SAAS,GAAG,iBAAiB,CAAC,SAAS,CAAC,GAAG,SAAS;QAExE,MAAM,MAAM,GAAa,EAAE;AAC3B,QAAA,IAAI,WAAW;AAAE,YAAA,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC;AACzC,QAAA,IAAI,WAAW;AAAE,YAAA,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC;AAEzC,QAAA,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,GAAG,CAAC;QAEnC,SAAS,CAAC,MAAK;AACX,YAAA,aAAa,CAAC,YAAY,IAAI,YAAY,CAAC;AAC/C,QAAA,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC;AAElB,QAAA,MAAM,YAAY,GAAG,CAAC,YAAqB,KAAI;AAC3C,YAAA,MAAM,QAAQ,GAAG,YAAY,GAAG,YAAY,CAAC,YAAY,CAAC,GAAG,YAAY;YACzE,aAAa,CAAC,QAAQ,CAAC;AACvB,YAAA,aAAa,GAAG,QAAQ,CAAC;AAC7B,QAAA,CAAC;AAED,QAAA,MAAM,YAAY,GAAG;AACjB,YAAA,GAAG,cAAc;AACjB,YAAA,KAAK,EAAE,UAAU;AACjB,YAAA,QAAQ,EAAE,YAAY;AACtB,YAAA,OAAO,EAAE,SAAS;YAClB,QAAQ;YACR;SACgB;AAEpB,QAAA,OAAOA,GAAA,CAAC,SAAS,EAAA,EAAA,GAAK,YAAY,GAAI;AAC1C,IAAA,CAAC;AAED,IAAA,YAAY,CAAC,WAAW,GAAG,kBAAkB;AAE7C,IAAA,OAAO,YAAY;AACvB;;;;"}
@@ -0,0 +1,10 @@
1
+ import { WrappedFieldProps } from '../asCommandFormField';
2
+ interface CheckboxFieldComponentProps extends WrappedFieldProps<boolean> {
3
+ label?: string;
4
+ }
5
+ export declare const CheckboxField: {
6
+ <TCommand>(props: Omit<CheckboxFieldComponentProps, keyof WrappedFieldProps<unknown>> & import("..").BaseCommandFormFieldProps<TCommand> & import("..").InjectedCommandFormFieldProps): import("react/jsx-runtime").JSX.Element;
7
+ displayName: string;
8
+ };
9
+ export {};
10
+ //# sourceMappingURL=CheckboxField.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CheckboxField.d.ts","sourceRoot":"","sources":["../../../../CommandForm/fields/CheckboxField.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAsB,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE9E,UAAU,2BAA4B,SAAQ,iBAAiB,CAAC,OAAO,CAAC;IACpE,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,aAAa;;;CAezB,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { Checkbox } from 'primereact/checkbox';
3
+ import { asCommandFormField } from '../asCommandFormField.js';
4
+
5
+ const CheckboxField = asCommandFormField((props) => (jsxs("div", { className: "flex align-items-center", children: [jsx(Checkbox, { checked: props.value, onChange: props.onChange, invalid: props.invalid }), props.label && jsx("label", { className: "ml-2", children: props.label })] })), {
6
+ defaultValue: false,
7
+ extractValue: (e) => e.checked
8
+ });
9
+
10
+ export { CheckboxField };
11
+ //# sourceMappingURL=CheckboxField.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CheckboxField.js","sources":["../../../../CommandForm/fields/CheckboxField.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 { Checkbox } from 'primereact/checkbox';\nimport React from 'react';\nimport { asCommandFormField, WrappedFieldProps } from '../asCommandFormField';\n\ninterface CheckboxFieldComponentProps extends WrappedFieldProps<boolean> {\n label?: string;\n}\n\nexport const CheckboxField = asCommandFormField<CheckboxFieldComponentProps>(\n (props) => (\n <div className=\"flex align-items-center\">\n <Checkbox\n checked={props.value}\n onChange={props.onChange}\n invalid={props.invalid}\n />\n {props.label && <label className=\"ml-2\">{props.label}</label>}\n </div>\n ),\n {\n defaultValue: false,\n extractValue: (e: { checked: boolean }) => e.checked\n }\n);\n"],"names":["_jsxs","_jsx"],"mappings":";;;;AAWO,MAAM,aAAa,GAAG,kBAAkB,CAC3C,CAAC,KAAK,MACFA,cAAK,SAAS,EAAC,yBAAyB,EAAA,QAAA,EAAA,CACpCC,GAAA,CAAC,QAAQ,EAAA,EACL,OAAO,EAAE,KAAK,CAAC,KAAK,EACpB,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,OAAO,EAAE,KAAK,CAAC,OAAO,EAAA,CACxB,EACD,KAAK,CAAC,KAAK,IAAIA,GAAA,CAAA,OAAA,EAAA,EAAO,SAAS,EAAC,MAAM,EAAA,QAAA,EAAE,KAAK,CAAC,KAAK,EAAA,CAAS,CAAA,EAAA,CAC3D,CACT,EACD;AACI,IAAA,YAAY,EAAE,KAAK;IACnB,YAAY,EAAE,CAAC,CAAuB,KAAK,CAAC,CAAC;AAChD,CAAA;;;;"}
@@ -0,0 +1,15 @@
1
+ import { WrappedFieldProps } from '../asCommandFormField';
2
+ interface SelectComponentProps extends WrappedFieldProps<string> {
3
+ options: Array<{
4
+ [key: string]: unknown;
5
+ }>;
6
+ optionIdField: string;
7
+ optionLabelField: string;
8
+ placeholder?: string;
9
+ }
10
+ export declare const SelectField: {
11
+ <TCommand>(props: Omit<SelectComponentProps, keyof WrappedFieldProps<unknown>> & import("..").BaseCommandFormFieldProps<TCommand> & import("..").InjectedCommandFormFieldProps): import("react/jsx-runtime").JSX.Element;
12
+ displayName: string;
13
+ };
14
+ export {};
15
+ //# sourceMappingURL=DropdownField.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DropdownField.d.ts","sourceRoot":"","sources":["../../../../CommandForm/fields/DropdownField.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAsB,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE9E,UAAU,oBAAqB,SAAQ,iBAAiB,CAAC,MAAM,CAAC;IAC5D,OAAO,EAAE,KAAK,CAAC;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC,CAAC;IAC3C,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAkBD,eAAO,MAAM,WAAW;;;CAMvB,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { asCommandFormField } from '../asCommandFormField.js';
3
+
4
+ const SelectComponent = (props) => (jsxs("select", { value: props.value || '', onChange: props.onChange, required: props.required, className: `w-full p-3 rounded-md text-base ${props.invalid ? 'border border-red-500' : 'border border-gray-300'}`, children: [props.placeholder && jsx("option", { value: "", children: props.placeholder }), props.options.map((option, index) => (jsx("option", { value: String(option[props.optionIdField]), children: String(option[props.optionLabelField]) }, index)))] }));
5
+ const SelectField = asCommandFormField(SelectComponent, {
6
+ defaultValue: '',
7
+ extractValue: (e) => e.target.value
8
+ });
9
+
10
+ export { SelectField };
11
+ //# sourceMappingURL=DropdownField.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DropdownField.js","sources":["../../../../CommandForm/fields/DropdownField.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 SelectComponentProps extends WrappedFieldProps<string> {\n options: Array<{ [key: string]: unknown }>;\n optionIdField: string;\n optionLabelField: string;\n placeholder?: string;\n}\n\nconst SelectComponent = (props: SelectComponentProps) => (\n <select\n value={props.value || ''}\n onChange={props.onChange}\n required={props.required}\n className={`w-full p-3 rounded-md text-base ${props.invalid ? 'border border-red-500' : 'border border-gray-300'}`}\n >\n {props.placeholder && <option value=\"\">{props.placeholder}</option>}\n {props.options.map((option, index) => (\n <option key={index} value={String(option[props.optionIdField])}>\n {String(option[props.optionLabelField])}\n </option>\n ))}\n </select>\n);\n\nexport const SelectField = asCommandFormField<SelectComponentProps>(\n SelectComponent,\n {\n defaultValue: '',\n extractValue: (e: React.ChangeEvent<HTMLSelectElement>) => e.target.value\n }\n);\n"],"names":["_jsxs","_jsx"],"mappings":";;;AAaA,MAAM,eAAe,GAAG,CAAC,KAA2B,MAChDA,IAAA,CAAA,QAAA,EAAA,EACI,KAAK,EAAE,KAAK,CAAC,KAAK,IAAI,EAAE,EACxB,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,SAAS,EAAE,CAAA,gCAAA,EAAmC,KAAK,CAAC,OAAO,GAAG,uBAAuB,GAAG,wBAAwB,CAAA,CAAE,aAEjH,KAAK,CAAC,WAAW,IAAIC,GAAA,CAAA,QAAA,EAAA,EAAQ,KAAK,EAAC,EAAE,EAAA,QAAA,EAAE,KAAK,CAAC,WAAW,GAAU,EAClE,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,MAC7BA,GAAA,CAAA,QAAA,EAAA,EAAoB,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,EAAA,QAAA,EACzD,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,EAAA,EAD9B,KAAK,CAET,CACZ,CAAC,CAAA,EAAA,CACG,CACZ;AAEM,MAAM,WAAW,GAAG,kBAAkB,CACzC,eAAe,EACf;AACI,IAAA,YAAY,EAAE,EAAE;IAChB,YAAY,EAAE,CAAC,CAAuC,KAAK,CAAC,CAAC,MAAM,CAAC;AACvE,CAAA;;;;"}
@@ -0,0 +1,11 @@
1
+ import { WrappedFieldProps } from '../asCommandFormField';
2
+ interface InputTextComponentProps extends WrappedFieldProps<string> {
3
+ type?: 'text' | 'email' | 'password' | 'color' | 'date' | 'datetime-local' | 'time' | 'url' | 'tel' | 'search';
4
+ placeholder?: string;
5
+ }
6
+ export declare const InputTextField: {
7
+ <TCommand>(props: Omit<InputTextComponentProps, keyof WrappedFieldProps<unknown>> & import("..").BaseCommandFormFieldProps<TCommand> & import("..").InjectedCommandFormFieldProps): import("react/jsx-runtime").JSX.Element;
8
+ displayName: string;
9
+ };
10
+ export {};
11
+ //# sourceMappingURL=InputTextField.d.ts.map
@@ -0,0 +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"}
@@ -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":";;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"PivotViewer.d.ts","sourceRoot":"","sources":["../../../PivotViewer/PivotViewer.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAiBhD,OAAO,mBAAmB,CAAC;AAQ3B,wBAAgB,WAAW,CAAC,KAAK,SAAS,MAAM,EAAE,EAC9C,IAAI,EACJ,UAAU,EACV,OAAO,EACP,mBAAmB,EACnB,YAAY,EACZ,SAAS,EACT,YAAY,EACZ,SAAS,EACT,YAAY,EACZ,SAAiB,GACpB,EAAE,gBAAgB,CAAC,KAAK,CAAC,2CA8uBzB"}
1
+ {"version":3,"file":"PivotViewer.d.ts","sourceRoot":"","sources":["../../../PivotViewer/PivotViewer.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAiBhD,OAAO,mBAAmB,CAAC;AAQ3B,wBAAgB,WAAW,CAAC,KAAK,SAAS,MAAM,EAAE,EAC9C,IAAI,EACJ,UAAU,EACV,OAAO,EACP,mBAAmB,EACnB,YAAY,EACZ,SAAS,EACT,YAAY,EACZ,SAAS,EACT,YAAY,EACZ,SAAiB,GACpB,EAAE,gBAAgB,CAAC,KAAK,CAAC,2CAgwBzB"}