@vaadin/hilla-react-crud 24.4.0-alpha1

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 (172) hide show
  1. package/.lintstagedrc.js +6 -0
  2. package/LICENSE +201 -0
  3. package/README.md +27 -0
  4. package/autocrud-dialog.d.ts +11 -0
  5. package/autocrud-dialog.d.ts.map +1 -0
  6. package/autocrud-dialog.js +24 -0
  7. package/autocrud-dialog.js.map +7 -0
  8. package/autocrud-feature.d.ts +4 -0
  9. package/autocrud-feature.d.ts.map +1 -0
  10. package/autocrud-feature.js +8 -0
  11. package/autocrud-feature.js.map +7 -0
  12. package/autocrud.d.ts +82 -0
  13. package/autocrud.d.ts.map +1 -0
  14. package/autocrud.js +94 -0
  15. package/autocrud.js.map +7 -0
  16. package/autocrud.obj.js +6 -0
  17. package/autocrud.obj.js.map +7 -0
  18. package/autoform-feature.d.ts +4 -0
  19. package/autoform-feature.d.ts.map +1 -0
  20. package/autoform-feature.js +8 -0
  21. package/autoform-feature.js.map +7 -0
  22. package/autoform-field.d.ts +122 -0
  23. package/autoform-field.d.ts.map +1 -0
  24. package/autoform-field.js +118 -0
  25. package/autoform-field.js.map +7 -0
  26. package/autoform.d.ts +228 -0
  27. package/autoform.d.ts.map +1 -0
  28. package/autoform.js +178 -0
  29. package/autoform.js.map +7 -0
  30. package/autoform.obj.js +6 -0
  31. package/autoform.obj.js.map +7 -0
  32. package/autogrid-column-context.d.ts +39 -0
  33. package/autogrid-column-context.d.ts.map +1 -0
  34. package/autogrid-column-context.js +8 -0
  35. package/autogrid-column-context.js.map +7 -0
  36. package/autogrid-columns.d.ts +6 -0
  37. package/autogrid-columns.d.ts.map +1 -0
  38. package/autogrid-columns.js +102 -0
  39. package/autogrid-columns.js.map +7 -0
  40. package/autogrid-feature.d.ts +4 -0
  41. package/autogrid-feature.d.ts.map +1 -0
  42. package/autogrid-feature.js +8 -0
  43. package/autogrid-feature.js.map +7 -0
  44. package/autogrid-renderers.d.ts +28 -0
  45. package/autogrid-renderers.d.ts.map +1 -0
  46. package/autogrid-renderers.js +92 -0
  47. package/autogrid-renderers.js.map +7 -0
  48. package/autogrid.d.ts +130 -0
  49. package/autogrid.d.ts.map +1 -0
  50. package/autogrid.js +234 -0
  51. package/autogrid.js.map +7 -0
  52. package/autogrid.obj.js +6 -0
  53. package/autogrid.obj.js.map +7 -0
  54. package/crud.d.js +1 -0
  55. package/crud.d.js.map +7 -0
  56. package/crud.d.ts +17 -0
  57. package/data-provider.d.ts +56 -0
  58. package/data-provider.d.ts.map +1 -0
  59. package/data-provider.js +121 -0
  60. package/data-provider.js.map +7 -0
  61. package/header-filter.d.ts +54 -0
  62. package/header-filter.d.ts.map +1 -0
  63. package/header-filter.js +258 -0
  64. package/header-filter.js.map +7 -0
  65. package/header-sorter.d.ts +3 -0
  66. package/header-sorter.d.ts.map +1 -0
  67. package/header-sorter.js +28 -0
  68. package/header-sorter.js.map +7 -0
  69. package/i18n.d.ts +2 -0
  70. package/i18n.d.ts.map +1 -0
  71. package/i18n.js +5 -0
  72. package/i18n.js.map +7 -0
  73. package/index.d.ts +5 -0
  74. package/index.d.ts.map +1 -0
  75. package/index.js +13 -0
  76. package/index.js.map +7 -0
  77. package/locale.d.ts +19 -0
  78. package/locale.d.ts.map +1 -0
  79. package/locale.js +123 -0
  80. package/locale.js.map +7 -0
  81. package/media-query.d.ts +2 -0
  82. package/media-query.d.ts.map +1 -0
  83. package/media-query.js +16 -0
  84. package/media-query.js.map +7 -0
  85. package/model-info.d.ts +23 -0
  86. package/model-info.d.ts.map +1 -0
  87. package/model-info.js +137 -0
  88. package/model-info.js.map +7 -0
  89. package/package.json +87 -0
  90. package/types/com/vaadin/hilla/crud/filter/AndFilter.d.js +1 -0
  91. package/types/com/vaadin/hilla/crud/filter/AndFilter.d.js.map +7 -0
  92. package/types/com/vaadin/hilla/crud/filter/AndFilter.d.ts +6 -0
  93. package/types/com/vaadin/hilla/crud/filter/AndFilterModel.d.ts +9 -0
  94. package/types/com/vaadin/hilla/crud/filter/AndFilterModel.d.ts.map +1 -0
  95. package/types/com/vaadin/hilla/crud/filter/AndFilterModel.js +13 -0
  96. package/types/com/vaadin/hilla/crud/filter/AndFilterModel.js.map +7 -0
  97. package/types/com/vaadin/hilla/crud/filter/Filter.d.js +1 -0
  98. package/types/com/vaadin/hilla/crud/filter/Filter.d.js.map +7 -0
  99. package/types/com/vaadin/hilla/crud/filter/Filter.d.ts +3 -0
  100. package/types/com/vaadin/hilla/crud/filter/FilterModel.d.ts +7 -0
  101. package/types/com/vaadin/hilla/crud/filter/FilterModel.d.ts.map +1 -0
  102. package/types/com/vaadin/hilla/crud/filter/FilterModel.js +9 -0
  103. package/types/com/vaadin/hilla/crud/filter/FilterModel.js.map +7 -0
  104. package/types/com/vaadin/hilla/crud/filter/FilterUnion.d.js +1 -0
  105. package/types/com/vaadin/hilla/crud/filter/FilterUnion.d.js.map +7 -0
  106. package/types/com/vaadin/hilla/crud/filter/FilterUnion.d.ts +5 -0
  107. package/types/com/vaadin/hilla/crud/filter/OrFilter.d.js +1 -0
  108. package/types/com/vaadin/hilla/crud/filter/OrFilter.d.js.map +7 -0
  109. package/types/com/vaadin/hilla/crud/filter/OrFilter.d.ts +6 -0
  110. package/types/com/vaadin/hilla/crud/filter/OrFilterModel.d.ts +9 -0
  111. package/types/com/vaadin/hilla/crud/filter/OrFilterModel.d.ts.map +1 -0
  112. package/types/com/vaadin/hilla/crud/filter/OrFilterModel.js +13 -0
  113. package/types/com/vaadin/hilla/crud/filter/OrFilterModel.js.map +7 -0
  114. package/types/com/vaadin/hilla/crud/filter/PropertyStringFilter/Matcher.d.ts +8 -0
  115. package/types/com/vaadin/hilla/crud/filter/PropertyStringFilter/Matcher.d.ts.map +1 -0
  116. package/types/com/vaadin/hilla/crud/filter/PropertyStringFilter/Matcher.js +12 -0
  117. package/types/com/vaadin/hilla/crud/filter/PropertyStringFilter/Matcher.js.map +7 -0
  118. package/types/com/vaadin/hilla/crud/filter/PropertyStringFilter/MatcherModel.d.ts +8 -0
  119. package/types/com/vaadin/hilla/crud/filter/PropertyStringFilter/MatcherModel.d.ts.map +1 -0
  120. package/types/com/vaadin/hilla/crud/filter/PropertyStringFilter/MatcherModel.js +11 -0
  121. package/types/com/vaadin/hilla/crud/filter/PropertyStringFilter/MatcherModel.js.map +7 -0
  122. package/types/com/vaadin/hilla/crud/filter/PropertyStringFilter.d.js +1 -0
  123. package/types/com/vaadin/hilla/crud/filter/PropertyStringFilter.d.js.map +7 -0
  124. package/types/com/vaadin/hilla/crud/filter/PropertyStringFilter.d.ts +9 -0
  125. package/types/com/vaadin/hilla/crud/filter/PropertyStringFilterModel.d.ts +12 -0
  126. package/types/com/vaadin/hilla/crud/filter/PropertyStringFilterModel.d.ts.map +1 -0
  127. package/types/com/vaadin/hilla/crud/filter/PropertyStringFilterModel.js +20 -0
  128. package/types/com/vaadin/hilla/crud/filter/PropertyStringFilterModel.js.map +7 -0
  129. package/types/com/vaadin/hilla/mappedtypes/Order.d.js +1 -0
  130. package/types/com/vaadin/hilla/mappedtypes/Order.d.js.map +7 -0
  131. package/types/com/vaadin/hilla/mappedtypes/Order.d.ts +9 -0
  132. package/types/com/vaadin/hilla/mappedtypes/OrderModel.d.ts +13 -0
  133. package/types/com/vaadin/hilla/mappedtypes/OrderModel.d.ts.map +1 -0
  134. package/types/com/vaadin/hilla/mappedtypes/OrderModel.js +23 -0
  135. package/types/com/vaadin/hilla/mappedtypes/OrderModel.js.map +7 -0
  136. package/types/com/vaadin/hilla/mappedtypes/Pageable.d.js +1 -0
  137. package/types/com/vaadin/hilla/mappedtypes/Pageable.d.js.map +7 -0
  138. package/types/com/vaadin/hilla/mappedtypes/Pageable.d.ts +7 -0
  139. package/types/com/vaadin/hilla/mappedtypes/PageableModel.d.ts +11 -0
  140. package/types/com/vaadin/hilla/mappedtypes/PageableModel.d.ts.map +1 -0
  141. package/types/com/vaadin/hilla/mappedtypes/PageableModel.js +19 -0
  142. package/types/com/vaadin/hilla/mappedtypes/PageableModel.js.map +7 -0
  143. package/types/com/vaadin/hilla/mappedtypes/Sort.d.js +1 -0
  144. package/types/com/vaadin/hilla/mappedtypes/Sort.d.js.map +7 -0
  145. package/types/com/vaadin/hilla/mappedtypes/Sort.d.ts +5 -0
  146. package/types/com/vaadin/hilla/mappedtypes/SortModel.d.ts +9 -0
  147. package/types/com/vaadin/hilla/mappedtypes/SortModel.d.ts.map +1 -0
  148. package/types/com/vaadin/hilla/mappedtypes/SortModel.js +13 -0
  149. package/types/com/vaadin/hilla/mappedtypes/SortModel.js.map +7 -0
  150. package/types/org/springframework/data/domain/Sort/Direction.d.ts +6 -0
  151. package/types/org/springframework/data/domain/Sort/Direction.d.ts.map +1 -0
  152. package/types/org/springframework/data/domain/Sort/Direction.js +10 -0
  153. package/types/org/springframework/data/domain/Sort/Direction.js.map +7 -0
  154. package/types/org/springframework/data/domain/Sort/DirectionModel.d.ts +8 -0
  155. package/types/org/springframework/data/domain/Sort/DirectionModel.d.ts.map +1 -0
  156. package/types/org/springframework/data/domain/Sort/DirectionModel.js +11 -0
  157. package/types/org/springframework/data/domain/Sort/DirectionModel.js.map +7 -0
  158. package/types/org/springframework/data/domain/Sort/NullHandling.d.ts +7 -0
  159. package/types/org/springframework/data/domain/Sort/NullHandling.d.ts.map +1 -0
  160. package/types/org/springframework/data/domain/Sort/NullHandling.js +11 -0
  161. package/types/org/springframework/data/domain/Sort/NullHandling.js.map +7 -0
  162. package/types/org/springframework/data/domain/Sort/NullHandlingModel.d.ts +8 -0
  163. package/types/org/springframework/data/domain/Sort/NullHandlingModel.d.ts.map +1 -0
  164. package/types/org/springframework/data/domain/Sort/NullHandlingModel.js +11 -0
  165. package/types/org/springframework/data/domain/Sort/NullHandlingModel.js.map +7 -0
  166. package/types.d.js +1 -0
  167. package/types.d.js.map +7 -0
  168. package/types.d.ts +12 -0
  169. package/util.d.ts +12 -0
  170. package/util.d.ts.map +1 -0
  171. package/util.js +55 -0
  172. package/util.js.map +7 -0
@@ -0,0 +1,6 @@
1
+ import { commands, extensions } from '../../../.lintstagedrc.js';
2
+
3
+ export default {
4
+ [`src/**/*.{${extensions}}`]: commands,
5
+ [`test/**/*.{${extensions}}`]: commands,
6
+ };
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,27 @@
1
+ # Hilla React CRUD
2
+
3
+ [API documentation ↗](https://hilla.dev/docs/)
4
+
5
+ [![Latest Stable
6
+ Version](https://img.shields.io/npm/v/@hilla/react-crud.svg)](https://www.npmjs.com/package/@vaadin/hilla-react-crud)
7
+
8
+ A set of utilities for building CRUDs with TypeScript and React.
9
+
10
+ A part of the Hilla project.
11
+
12
+ ## Installation
13
+
14
+ ```bash
15
+ $ npm install @vaadin/hilla-react-crud
16
+ ```
17
+
18
+ ## Contribution
19
+
20
+ Read the [contributing guide](https://vaadin.com/docs/latest/contributing-docs/overview) to learn about our development process, how to propose bugfixes and improvements, and how to test your changes.
21
+
22
+ ## License
23
+
24
+ Apache License 2.0
25
+
26
+ Vaadin collects development time usage statistics to improve this product.
27
+ For details and to opt-out, see https://github.com/vaadin/vaadin-usage-statistics.
@@ -0,0 +1,11 @@
1
+ import type { JSX } from 'react';
2
+ import '@vaadin/vaadin-lumo-styles/vaadin-iconset.js';
3
+ interface AutoCrudDialogProps {
4
+ header: JSX.Element | null | undefined;
5
+ children: React.ReactElement;
6
+ opened: boolean;
7
+ onClose: () => void;
8
+ }
9
+ export declare function AutoCrudDialog(props: AutoCrudDialogProps): JSX.Element;
10
+ export {};
11
+ //# sourceMappingURL=autocrud-dialog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"autocrud-dialog.d.ts","sourceRoot":"","sources":["src/autocrud-dialog.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAGjC,OAAO,8CAA8C,CAAC;AAEtD,UAAU,mBAAmB;IAC3B,MAAM,EAAE,GAAG,CAAC,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC;IACvC,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC;IAC7B,MAAM,EAAE,OAAO,CAAC;IAEhB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,GAAG,GAAG,CAAC,OAAO,CAkBtE"}
@@ -0,0 +1,24 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { Button } from "@vaadin/react-components/Button";
3
+ import { Dialog } from "@vaadin/react-components/Dialog";
4
+ import { Icon } from "@vaadin/react-components/Icon";
5
+ import "@vaadin/vaadin-lumo-styles/vaadin-iconset.js";
6
+ function AutoCrudDialog(props) {
7
+ const { header, children, opened, onClose } = props;
8
+ return /* @__PURE__ */ jsx(
9
+ Dialog,
10
+ {
11
+ overlayClass: "auto-crud-dialog",
12
+ opened,
13
+ headerRenderer: () => /* @__PURE__ */ jsxs("div", { className: "auto-crud-dialog-header", children: [
14
+ header,
15
+ /* @__PURE__ */ jsx(Button, { theme: "tertiary", onClick: onClose, "aria-label": "Close", children: /* @__PURE__ */ jsx(Icon, { icon: "lumo:cross", style: { height: "var(--lumo-icon-size-l)", width: "var(--lumo-icon-size-l)" } }) })
16
+ ] }),
17
+ children
18
+ }
19
+ );
20
+ }
21
+ export {
22
+ AutoCrudDialog
23
+ };
24
+ //# sourceMappingURL=autocrud-dialog.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["src/autocrud-dialog.tsx"],
4
+ "sourcesContent": ["import { Button } from '@vaadin/react-components/Button';\nimport { Dialog } from '@vaadin/react-components/Dialog';\nimport { Icon } from '@vaadin/react-components/Icon';\nimport type { JSX } from 'react';\n\n// eslint-disable-next-line\nimport '@vaadin/vaadin-lumo-styles/vaadin-iconset.js';\n\ninterface AutoCrudDialogProps {\n header: JSX.Element | null | undefined;\n children: React.ReactElement;\n opened: boolean;\n // eslint-disable-next-line @typescript-eslint/method-signature-style\n onClose: () => void;\n}\n\nexport function AutoCrudDialog(props: AutoCrudDialogProps): JSX.Element {\n const { header, children, opened, onClose } = props;\n return (\n <Dialog\n overlayClass=\"auto-crud-dialog\"\n opened={opened}\n headerRenderer={() => (\n <div className=\"auto-crud-dialog-header\">\n {header}\n <Button theme=\"tertiary\" onClick={onClose} aria-label=\"Close\">\n <Icon icon=\"lumo:cross\" style={{ height: 'var(--lumo-icon-size-l)', width: 'var(--lumo-icon-size-l)' }} />\n </Button>\n </div>\n )}\n >\n {children}\n </Dialog>\n );\n}\n"],
5
+ "mappings": "AAuBQ,SAGI,KAHJ;AAvBR,SAAS,cAAc;AACvB,SAAS,cAAc;AACvB,SAAS,YAAY;AAIrB,OAAO;AAUA,SAAS,eAAe,OAAyC;AACtE,QAAM,EAAE,QAAQ,UAAU,QAAQ,QAAQ,IAAI;AAC9C,SACE;AAAA,IAAC;AAAA;AAAA,MACC,cAAa;AAAA,MACb;AAAA,MACA,gBAAgB,MACd,qBAAC,SAAI,WAAU,2BACZ;AAAA;AAAA,QACD,oBAAC,UAAO,OAAM,YAAW,SAAS,SAAS,cAAW,SACpD,8BAAC,QAAK,MAAK,cAAa,OAAO,EAAE,QAAQ,2BAA2B,OAAO,0BAA0B,GAAG,GAC1G;AAAA,SACF;AAAA,MAGD;AAAA;AAAA,EACH;AAEJ;",
6
+ "names": []
7
+ }
@@ -0,0 +1,4 @@
1
+ import { AutoCrud as _AutoCrud } from './autocrud.js';
2
+ export * from './autocrud.js';
3
+ export declare const AutoCrud: typeof _AutoCrud;
4
+ //# sourceMappingURL=autocrud-feature.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"autocrud-feature.d.ts","sourceRoot":"","sources":["src/autocrud-feature.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,IAAI,SAAS,EAAE,MAAM,eAAe,CAAC;AAGtD,cAAc,eAAe,CAAC;AAE9B,eAAO,MAAM,QAAQ,EAAE,OAAO,SAAsD,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { AutoCrud as _AutoCrud } from "./autocrud.js";
2
+ import { featureRegistration } from "./util";
3
+ export * from "./autocrud.js";
4
+ const AutoCrud = featureRegistration(_AutoCrud, "AutoCrud");
5
+ export {
6
+ AutoCrud
7
+ };
8
+ //# sourceMappingURL=autocrud-feature.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["src/autocrud-feature.ts"],
4
+ "sourcesContent": ["/* eslint-disable import/export */\nimport { AutoCrud as _AutoCrud } from './autocrud.js';\nimport { featureRegistration } from './util';\n\nexport * from './autocrud.js';\n\nexport const AutoCrud: typeof _AutoCrud = featureRegistration(_AutoCrud, 'AutoCrud');\n"],
5
+ "mappings": "AACA,SAAS,YAAY,iBAAiB;AACtC,SAAS,2BAA2B;AAEpC,cAAc;AAEP,MAAM,WAA6B,oBAAoB,WAAW,UAAU;",
6
+ "names": []
7
+ }
package/autocrud.d.ts ADDED
@@ -0,0 +1,82 @@
1
+ import type { AbstractModel, DetachedModelConstructor, Value } from '@vaadin/hilla-lit-form';
2
+ import { type JSX } from 'react';
3
+ import { type AutoFormProps } from './autoform.js';
4
+ import { type AutoGridProps } from './autogrid.js';
5
+ import type { CrudService } from './crud.js';
6
+ import { type ComponentStyleProps } from './util.js';
7
+ export type AutoCrudFormHeaderRenderer<TItem> = (editedItem: TItem | null, disabled: boolean) => JSX.Element | null | undefined;
8
+ export type AutoCrudFormProps<TModel extends AbstractModel> = Omit<Partial<AutoFormProps<TModel>>, 'disabled' | 'item' | 'model' | 'onDeleteSuccess' | 'onSubmitSuccess' | 'service'> & Readonly<{
9
+ /**
10
+ * A custom renderer function to create the header for the form. The
11
+ * function receives the edited item as the first parameter, and a boolean
12
+ * indicating whether the form is disabled as the second parameter. The
13
+ * edited item is `null` when creating a new item.
14
+ *
15
+ * By default, the header shows "New item" when creating a new item, and
16
+ * "Edit item" when editing an existing item.
17
+ */
18
+ headerRenderer?: AutoCrudFormHeaderRenderer<Value<TModel>>;
19
+ }>;
20
+ export type AutoCrudGridProps<TItem> = Omit<Partial<AutoGridProps<TItem>>, 'model' | 'onActiveItemChanged' | 'selectedItems' | 'service'>;
21
+ export type AutoCrudProps<TModel extends AbstractModel = AbstractModel> = ComponentStyleProps & Readonly<{
22
+ /**
23
+ * The service to use for fetching the data, as well saving and deleting
24
+ * items. This must be a TypeScript service that has been generated by Hilla
25
+ * from a backend Java service that implements the
26
+ * `com.vaadin.hilla.crud.CrudService` interface.
27
+ */
28
+ service: CrudService<Value<TModel>>;
29
+ /**
30
+ * The entity model to use for the CRUD. This determines which columns to
31
+ * show in the grid, and which fields to show in the form. This must be a
32
+ * Typescript model class that has been generated by Hilla from a backend
33
+ * Java class. The model must match with the type of the items returned by
34
+ * the service. For example, a `PersonModel` can be used with a service that
35
+ * returns `Person` instances.
36
+ *
37
+ * By default, the grid shows columns for all properties of the model which
38
+ * have a type that is supported. Use the `gridProps.visibleColumns` option
39
+ * to customize which columns to show and in which order.
40
+ *
41
+ * By default, the form shows fields for all properties of the model which
42
+ * have a type that is supported. Use the `formProps.visibleFields`
43
+ * option to customize which fields to show and in which order.
44
+ */
45
+ model: DetachedModelConstructor<TModel>;
46
+ /**
47
+ * The property to use to detect an item's ID. The item ID is required for
48
+ * deleting items via the `CrudService.delete` method as well as keeping the
49
+ * selection state after reloading the grid.
50
+ *
51
+ * By default, the component uses the property annotated with
52
+ * `jakarta.persistence.Id`, or a property named `id`, in that order.
53
+ * This option can be used to override the default behavior, or define the ID
54
+ * property in case a class doesn't have a property matching the defaults.
55
+ */
56
+ itemIdProperty?: string;
57
+ /**
58
+ * Props to pass to the form. See the `AutoForm` component for details.
59
+ */
60
+ formProps?: AutoCrudFormProps<TModel>;
61
+ /**
62
+ * Props to pass to the grid. See the `AutoGrid` component for details.
63
+ */
64
+ gridProps?: AutoCrudGridProps<Value<TModel>>;
65
+ }>;
66
+ /**
67
+ * Auto CRUD is a component that provides CRUD (create, read, update, delete)
68
+ * functionality based on a Java backend service. It automatically generates a
69
+ * grid that shows data from the service, and a form for creating, updating and
70
+ * deleting items.
71
+ *
72
+ * Example usage:
73
+ * ```tsx
74
+ * import { AutoCrud } from '@hilla/react-crud';
75
+ * import PersonService from 'Frontend/generated/endpoints';
76
+ * import PersonModel from 'Frontend/generated/com/example/application/Person';
77
+ *
78
+ * <AutoCrud service={PersonService} model={PersonModel} />
79
+ * ```
80
+ */
81
+ export declare function AutoCrud<TModel extends AbstractModel>({ service, model, itemIdProperty, formProps, gridProps, style, id, className, }: AutoCrudProps<TModel>): JSX.Element;
82
+ //# sourceMappingURL=autocrud.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"autocrud.d.ts","sourceRoot":"","sources":["src/autocrud.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,wBAAwB,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAG7F,OAAO,EAAE,KAAK,GAAG,EAAoB,MAAM,OAAO,CAAC;AAGnD,OAAO,EAAE,KAAK,aAAa,EAAuB,MAAM,eAAe,CAAC;AACxE,OAAO,EAAE,KAAK,aAAa,EAA8B,MAAM,eAAe,CAAC;AAC/E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAE7C,OAAO,EAAE,KAAK,mBAAmB,EAAsB,MAAM,WAAW,CAAC;AAIzE,MAAM,MAAM,0BAA0B,CAAC,KAAK,IAAI,CAC9C,UAAU,EAAE,KAAK,GAAG,IAAI,EACxB,QAAQ,EAAE,OAAO,KACd,GAAG,CAAC,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC;AAEpC,MAAM,MAAM,iBAAiB,CAAC,MAAM,SAAS,aAAa,IAAI,IAAI,CAChE,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,EAC9B,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,iBAAiB,GAAG,iBAAiB,GAAG,SAAS,CAClF,GACC,QAAQ,CAAC;IACP;;;;;;;;OAQG;IACH,cAAc,CAAC,EAAE,0BAA0B,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;CAC5D,CAAC,CAAC;AAEL,MAAM,MAAM,iBAAiB,CAAC,KAAK,IAAI,IAAI,CACzC,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,EAC7B,OAAO,GAAG,qBAAqB,GAAG,eAAe,GAAG,SAAS,CAC9D,CAAC;AAEF,MAAM,MAAM,aAAa,CAAC,MAAM,SAAS,aAAa,GAAG,aAAa,IAAI,mBAAmB,GAC3F,QAAQ,CAAC;IACP;;;;;OAKG;IACH,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;IACpC;;;;;;;;;;;;;;;OAeG;IACH,KAAK,EAAE,wBAAwB,CAAC,MAAM,CAAC,CAAC;IACxC;;;;;;;;;OASG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,SAAS,CAAC,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC;IACtC;;OAEG;IACH,SAAS,CAAC,EAAE,iBAAiB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;CAC9C,CAAC,CAAC;AAOL;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,QAAQ,CAAC,MAAM,SAAS,aAAa,EAAE,EACrD,OAAO,EACP,KAAK,EACL,cAAc,EACd,SAAS,EACT,SAAS,EACT,KAAK,EACL,EAAE,EACF,SAAS,GACV,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC,OAAO,CAoFrC"}
package/autocrud.js ADDED
@@ -0,0 +1,94 @@
1
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
+ import { Button } from "@vaadin/react-components/Button.js";
3
+ import { SplitLayout } from "@vaadin/react-components/SplitLayout.js";
4
+ import { useRef, useState } from "react";
5
+ import { AutoCrudDialog } from "./autocrud-dialog.js";
6
+ import css from "./autocrud.obj.js";
7
+ import { emptyItem, AutoForm } from "./autoform.js";
8
+ import { AutoGrid } from "./autogrid.js";
9
+ import { useMediaQuery } from "./media-query.js";
10
+ import { registerStylesheet } from "./util.js";
11
+ registerStylesheet(css);
12
+ function defaultFormHeaderRenderer(editedItem, disabled) {
13
+ const style = { color: disabled ? "var(--lumo-disabled-text-color)" : "var(--lumo-text-color)" };
14
+ return editedItem ? /* @__PURE__ */ jsx("h3", { style, children: "Edit item" }) : /* @__PURE__ */ jsx("h3", { style, children: "New item" });
15
+ }
16
+ function AutoCrud({
17
+ service,
18
+ model,
19
+ itemIdProperty,
20
+ formProps,
21
+ gridProps,
22
+ style,
23
+ id,
24
+ className
25
+ }) {
26
+ const [item, setItem] = useState(void 0);
27
+ const fullScreen = useMediaQuery("(max-width: 600px), (max-height: 600px)");
28
+ const autoGridRef = useRef(null);
29
+ const { headerRenderer: customFormHeaderRenderer, ...autoFormProps } = formProps ?? {};
30
+ const formHeaderRenderer = customFormHeaderRenderer ?? defaultFormHeaderRenderer;
31
+ function refreshGrid() {
32
+ autoGridRef.current?.refresh();
33
+ }
34
+ function handleCancel() {
35
+ setItem(void 0);
36
+ }
37
+ const formHeader = item && item !== emptyItem ? formHeaderRenderer(item, !item) : formHeaderRenderer(null, !item);
38
+ const mainSection = /* @__PURE__ */ jsxs("div", { className: "auto-crud-main", children: [
39
+ /* @__PURE__ */ jsx(
40
+ AutoGrid,
41
+ {
42
+ ...gridProps,
43
+ service,
44
+ model,
45
+ itemIdProperty,
46
+ selectedItems: item && item !== emptyItem ? [item] : [],
47
+ onActiveItemChanged: (e) => {
48
+ const activeItem = e.detail.value;
49
+ setItem(activeItem ?? void 0);
50
+ },
51
+ ref: autoGridRef
52
+ }
53
+ ),
54
+ /* @__PURE__ */ jsx("div", { className: "auto-crud-toolbar", children: /* @__PURE__ */ jsx(Button, { theme: "primary", onClick: () => setItem(emptyItem), children: "+ New" }) })
55
+ ] });
56
+ const autoForm = /* @__PURE__ */ jsx(
57
+ AutoForm,
58
+ {
59
+ deleteButtonVisible: true,
60
+ ...autoFormProps,
61
+ disabled: !item,
62
+ service,
63
+ model,
64
+ itemIdProperty,
65
+ item,
66
+ onSubmitSuccess: ({ item: submittedItem }) => {
67
+ if (fullScreen) {
68
+ setItem(void 0);
69
+ } else {
70
+ setItem(submittedItem);
71
+ }
72
+ refreshGrid();
73
+ },
74
+ onDeleteSuccess: () => {
75
+ setItem(void 0);
76
+ refreshGrid();
77
+ }
78
+ }
79
+ );
80
+ return /* @__PURE__ */ jsx("div", { className: `auto-crud ${className ?? ""}`, id, style, children: fullScreen ? /* @__PURE__ */ jsxs(Fragment, { children: [
81
+ mainSection,
82
+ /* @__PURE__ */ jsx(AutoCrudDialog, { opened: !!item, header: formHeader, onClose: handleCancel, children: autoForm })
83
+ ] }) : /* @__PURE__ */ jsxs(SplitLayout, { theme: "small", children: [
84
+ mainSection,
85
+ /* @__PURE__ */ jsxs("div", { className: "auto-crud-form", children: [
86
+ /* @__PURE__ */ jsx("div", { className: "auto-crud-form-header", children: formHeader }),
87
+ autoForm
88
+ ] })
89
+ ] }) });
90
+ }
91
+ export {
92
+ AutoCrud
93
+ };
94
+ //# sourceMappingURL=autocrud.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["src/autocrud.tsx"],
4
+ "sourcesContent": ["import type { AbstractModel, DetachedModelConstructor, Value } from '@vaadin/hilla-lit-form';\nimport { Button } from '@vaadin/react-components/Button.js';\nimport { SplitLayout } from '@vaadin/react-components/SplitLayout.js';\nimport { type JSX, useRef, useState } from 'react';\nimport { AutoCrudDialog } from './autocrud-dialog.js';\nimport css from './autocrud.obj.js';\nimport { type AutoFormProps, emptyItem, AutoForm } from './autoform.js';\nimport { type AutoGridProps, AutoGrid, type AutoGridRef } from './autogrid.js';\nimport type { CrudService } from './crud.js';\nimport { useMediaQuery } from './media-query.js';\nimport { type ComponentStyleProps, registerStylesheet } from './util.js';\n\nregisterStylesheet(css);\n\nexport type AutoCrudFormHeaderRenderer<TItem> = (\n editedItem: TItem | null,\n disabled: boolean,\n) => JSX.Element | null | undefined;\n\nexport type AutoCrudFormProps<TModel extends AbstractModel> = Omit<\n Partial<AutoFormProps<TModel>>,\n 'disabled' | 'item' | 'model' | 'onDeleteSuccess' | 'onSubmitSuccess' | 'service'\n> &\n Readonly<{\n /**\n * A custom renderer function to create the header for the form. The\n * function receives the edited item as the first parameter, and a boolean\n * indicating whether the form is disabled as the second parameter. The\n * edited item is `null` when creating a new item.\n *\n * By default, the header shows \"New item\" when creating a new item, and\n * \"Edit item\" when editing an existing item.\n */\n headerRenderer?: AutoCrudFormHeaderRenderer<Value<TModel>>;\n }>;\n\nexport type AutoCrudGridProps<TItem> = Omit<\n Partial<AutoGridProps<TItem>>,\n 'model' | 'onActiveItemChanged' | 'selectedItems' | 'service'\n>;\n\nexport type AutoCrudProps<TModel extends AbstractModel = AbstractModel> = ComponentStyleProps &\n Readonly<{\n /**\n * The service to use for fetching the data, as well saving and deleting\n * items. This must be a TypeScript service that has been generated by Hilla\n * from a backend Java service that implements the\n * `com.vaadin.hilla.crud.CrudService` interface.\n */\n service: CrudService<Value<TModel>>;\n /**\n * The entity model to use for the CRUD. This determines which columns to\n * show in the grid, and which fields to show in the form. This must be a\n * Typescript model class that has been generated by Hilla from a backend\n * Java class. The model must match with the type of the items returned by\n * the service. For example, a `PersonModel` can be used with a service that\n * returns `Person` instances.\n *\n * By default, the grid shows columns for all properties of the model which\n * have a type that is supported. Use the `gridProps.visibleColumns` option\n * to customize which columns to show and in which order.\n *\n * By default, the form shows fields for all properties of the model which\n * have a type that is supported. Use the `formProps.visibleFields`\n * option to customize which fields to show and in which order.\n */\n model: DetachedModelConstructor<TModel>;\n /**\n * The property to use to detect an item's ID. The item ID is required for\n * deleting items via the `CrudService.delete` method as well as keeping the\n * selection state after reloading the grid.\n *\n * By default, the component uses the property annotated with\n * `jakarta.persistence.Id`, or a property named `id`, in that order.\n * This option can be used to override the default behavior, or define the ID\n * property in case a class doesn't have a property matching the defaults.\n */\n itemIdProperty?: string;\n /**\n * Props to pass to the form. See the `AutoForm` component for details.\n */\n formProps?: AutoCrudFormProps<TModel>;\n /**\n * Props to pass to the grid. See the `AutoGrid` component for details.\n */\n gridProps?: AutoCrudGridProps<Value<TModel>>;\n }>;\n\nfunction defaultFormHeaderRenderer<TItem>(editedItem: TItem | null, disabled: boolean): JSX.Element | null | undefined {\n const style = { color: disabled ? 'var(--lumo-disabled-text-color)' : 'var(--lumo-text-color)' };\n return editedItem ? <h3 style={style}>Edit item</h3> : <h3 style={style}>New item</h3>;\n}\n\n/**\n * Auto CRUD is a component that provides CRUD (create, read, update, delete)\n * functionality based on a Java backend service. It automatically generates a\n * grid that shows data from the service, and a form for creating, updating and\n * deleting items.\n *\n * Example usage:\n * ```tsx\n * import { AutoCrud } from '@hilla/react-crud';\n * import PersonService from 'Frontend/generated/endpoints';\n * import PersonModel from 'Frontend/generated/com/example/application/Person';\n *\n * <AutoCrud service={PersonService} model={PersonModel} />\n * ```\n */\nexport function AutoCrud<TModel extends AbstractModel>({\n service,\n model,\n itemIdProperty,\n formProps,\n gridProps,\n style,\n id,\n className,\n}: AutoCrudProps<TModel>): JSX.Element {\n const [item, setItem] = useState<Value<TModel> | typeof emptyItem | undefined>(undefined);\n const fullScreen = useMediaQuery('(max-width: 600px), (max-height: 600px)');\n const autoGridRef = useRef<AutoGridRef>(null);\n const { headerRenderer: customFormHeaderRenderer, ...autoFormProps } = formProps ?? {};\n const formHeaderRenderer: AutoCrudFormHeaderRenderer<Value<TModel>> =\n customFormHeaderRenderer ?? defaultFormHeaderRenderer;\n\n function refreshGrid() {\n autoGridRef.current?.refresh();\n }\n\n function handleCancel() {\n setItem(undefined);\n }\n\n const formHeader = item && item !== emptyItem ? formHeaderRenderer(item, !item) : formHeaderRenderer(null, !item);\n\n const mainSection = (\n <div className=\"auto-crud-main\">\n <AutoGrid\n {...gridProps}\n service={service}\n model={model as DetachedModelConstructor<AbstractModel<Value<TModel>>>}\n itemIdProperty={itemIdProperty}\n selectedItems={item && item !== emptyItem ? [item] : []}\n onActiveItemChanged={(e) => {\n const activeItem = e.detail.value;\n setItem(activeItem ?? undefined);\n }}\n ref={autoGridRef}\n ></AutoGrid>\n <div className=\"auto-crud-toolbar\">\n <Button theme=\"primary\" onClick={() => setItem(emptyItem)}>\n + New\n </Button>\n </div>\n </div>\n );\n\n const autoForm = (\n <AutoForm\n deleteButtonVisible={true}\n {...autoFormProps}\n disabled={!item}\n service={service}\n model={model}\n itemIdProperty={itemIdProperty}\n item={item}\n onSubmitSuccess={({ item: submittedItem }) => {\n if (fullScreen) {\n setItem(undefined);\n } else {\n setItem(submittedItem);\n }\n refreshGrid();\n }}\n onDeleteSuccess={() => {\n setItem(undefined);\n refreshGrid();\n }}\n />\n );\n\n return (\n <div className={`auto-crud ${className ?? ''}`} id={id} style={style}>\n {fullScreen ? (\n <>\n {mainSection}\n <AutoCrudDialog opened={!!item} header={formHeader} onClose={handleCancel}>\n {autoForm}\n </AutoCrudDialog>\n </>\n ) : (\n <SplitLayout theme=\"small\">\n {mainSection}\n <div className=\"auto-crud-form\">\n <div className=\"auto-crud-form-header\">{formHeader}</div>\n {autoForm}\n </div>\n </SplitLayout>\n )}\n </div>\n );\n}\n"],
5
+ "mappings": "AA0FsB,SA8Fd,UA9Fc,KA8ClB,YA9CkB;AAzFtB,SAAS,cAAc;AACvB,SAAS,mBAAmB;AAC5B,SAAmB,QAAQ,gBAAgB;AAC3C,SAAS,sBAAsB;AAC/B,OAAO,SAAS;AAChB,SAA6B,WAAW,gBAAgB;AACxD,SAA6B,gBAAkC;AAE/D,SAAS,qBAAqB;AAC9B,SAAmC,0BAA0B;AAE7D,mBAAmB,GAAG;AA4EtB,SAAS,0BAAiC,YAA0B,UAAmD;AACrH,QAAM,QAAQ,EAAE,OAAO,WAAW,oCAAoC,yBAAyB;AAC/F,SAAO,aAAa,oBAAC,QAAG,OAAc,uBAAS,IAAQ,oBAAC,QAAG,OAAc,sBAAQ;AACnF;AAiBO,SAAS,SAAuC;AAAA,EACrD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAuC;AACrC,QAAM,CAAC,MAAM,OAAO,IAAI,SAAuD,MAAS;AACxF,QAAM,aAAa,cAAc,yCAAyC;AAC1E,QAAM,cAAc,OAAoB,IAAI;AAC5C,QAAM,EAAE,gBAAgB,0BAA0B,GAAG,cAAc,IAAI,aAAa,CAAC;AACrF,QAAM,qBACJ,4BAA4B;AAE9B,WAAS,cAAc;AACrB,gBAAY,SAAS,QAAQ;AAAA,EAC/B;AAEA,WAAS,eAAe;AACtB,YAAQ,MAAS;AAAA,EACnB;AAEA,QAAM,aAAa,QAAQ,SAAS,YAAY,mBAAmB,MAAM,CAAC,IAAI,IAAI,mBAAmB,MAAM,CAAC,IAAI;AAEhH,QAAM,cACJ,qBAAC,SAAI,WAAU,kBACb;AAAA;AAAA,MAAC;AAAA;AAAA,QACE,GAAG;AAAA,QACJ;AAAA,QACA;AAAA,QACA;AAAA,QACA,eAAe,QAAQ,SAAS,YAAY,CAAC,IAAI,IAAI,CAAC;AAAA,QACtD,qBAAqB,CAAC,MAAM;AAC1B,gBAAM,aAAa,EAAE,OAAO;AAC5B,kBAAQ,cAAc,MAAS;AAAA,QACjC;AAAA,QACA,KAAK;AAAA;AAAA,IACN;AAAA,IACD,oBAAC,SAAI,WAAU,qBACb,8BAAC,UAAO,OAAM,WAAU,SAAS,MAAM,QAAQ,SAAS,GAAG,mBAE3D,GACF;AAAA,KACF;AAGF,QAAM,WACJ;AAAA,IAAC;AAAA;AAAA,MACC,qBAAqB;AAAA,MACpB,GAAG;AAAA,MACJ,UAAU,CAAC;AAAA,MACX;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,iBAAiB,CAAC,EAAE,MAAM,cAAc,MAAM;AAC5C,YAAI,YAAY;AACd,kBAAQ,MAAS;AAAA,QACnB,OAAO;AACL,kBAAQ,aAAa;AAAA,QACvB;AACA,oBAAY;AAAA,MACd;AAAA,MACA,iBAAiB,MAAM;AACrB,gBAAQ,MAAS;AACjB,oBAAY;AAAA,MACd;AAAA;AAAA,EACF;AAGF,SACE,oBAAC,SAAI,WAAW,aAAa,aAAa,EAAE,IAAI,IAAQ,OACrD,uBACC,iCACG;AAAA;AAAA,IACD,oBAAC,kBAAe,QAAQ,CAAC,CAAC,MAAM,QAAQ,YAAY,SAAS,cAC1D,oBACH;AAAA,KACF,IAEA,qBAAC,eAAY,OAAM,SAChB;AAAA;AAAA,IACD,qBAAC,SAAI,WAAU,kBACb;AAAA,0BAAC,SAAI,WAAU,yBAAyB,sBAAW;AAAA,MAClD;AAAA,OACH;AAAA,KACF,GAEJ;AAEJ;",
6
+ "names": []
7
+ }
@@ -0,0 +1,6 @@
1
+ const css = new CSSStyleSheet();
2
+ css.replaceSync(`.auto-crud{border:1px solid var(--lumo-contrast-20pct);display:flex;overflow:hidden}.auto-crud vaadin-split-layout{flex:1 1 100%}.auto-crud vaadin-split-layout::part(splitter){border-left:1px solid var(--lumo-contrast-20pct);border-top:1px solid var(--lumo-contrast-20pct)}.auto-crud-main{display:flex;flex:1 1 100%;flex-direction:column;min-width:200px}.auto-crud-main vaadin-grid{border:none}.auto-crud-toolbar{align-items:baseline;background-color:var(--lumo-contrast-5pct);border-top:1px solid var(--lumo-contrast-10pct);display:flex;flex-shrink:0;justify-content:flex-end;padding:var(--lumo-space-s) var(--lumo-space-m)}.auto-crud-form{align-items:stretch;display:flex;flex-direction:column;min-width:300px;width:40%}.auto-crud .auto-crud-form:before{box-shadow:var(--lumo-box-shadow-s);content:"";height:100%;pointer-events:none;position:absolute;width:100%;z-index:1}.auto-crud-form-header{padding:var(--lumo-space-m) var(--lumo-space-m) var(--lumo-space-s) var(--lumo-space-m)}.auto-crud .auto-form,.auto-crud-dialog .auto-form{align-items:stretch;display:flex;flex:1 1 0;flex-direction:column}.auto-crud .auto-form-fields,.auto-crud-dialog .auto-form-fields{flex:1 1 0;min-height:0;overflow-y:auto;padding:0 var(--lumo-space-m)}.auto-crud .auto-form-toolbar,.auto-crud-dialog .auto-form-toolbar{background-color:var(--lumo-contrast-5pct);border-top:1px solid var(--lumo-contrast-10pct);flex:0 0 auto;padding:var(--lumo-space-s) var(--lumo-space-m)}.auto-crud-dialog{bottom:0;left:0;right:0;top:0}.auto-crud-dialog::part(overlay){border-radius:0;height:100%;width:100%}.auto-crud-dialog::part(content){padding:0}.auto-crud-dialog .auto-crud-dialog-header{align-items:center;display:flex;justify-content:space-between;width:100%}.auto-crud-dialog .auto-form{height:100%;width:100%}`);
3
+ export {
4
+ css as default
5
+ };
6
+ //# sourceMappingURL=autocrud.obj.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["src/autocrud.obj.css"],
4
+ "sourcesContent": ["const css = new CSSStyleSheet();css.replaceSync(`.auto-crud{border:1px solid var(--lumo-contrast-20pct);display:flex;overflow:hidden}.auto-crud vaadin-split-layout{flex:1 1 100%}.auto-crud vaadin-split-layout::part(splitter){border-left:1px solid var(--lumo-contrast-20pct);border-top:1px solid var(--lumo-contrast-20pct)}.auto-crud-main{display:flex;flex:1 1 100%;flex-direction:column;min-width:200px}.auto-crud-main vaadin-grid{border:none}.auto-crud-toolbar{align-items:baseline;background-color:var(--lumo-contrast-5pct);border-top:1px solid var(--lumo-contrast-10pct);display:flex;flex-shrink:0;justify-content:flex-end;padding:var(--lumo-space-s) var(--lumo-space-m)}.auto-crud-form{align-items:stretch;display:flex;flex-direction:column;min-width:300px;width:40%}.auto-crud .auto-crud-form:before{box-shadow:var(--lumo-box-shadow-s);content:\"\";height:100%;pointer-events:none;position:absolute;width:100%;z-index:1}.auto-crud-form-header{padding:var(--lumo-space-m) var(--lumo-space-m) var(--lumo-space-s) var(--lumo-space-m)}.auto-crud .auto-form,.auto-crud-dialog .auto-form{align-items:stretch;display:flex;flex:1 1 0;flex-direction:column}.auto-crud .auto-form-fields,.auto-crud-dialog .auto-form-fields{flex:1 1 0;min-height:0;overflow-y:auto;padding:0 var(--lumo-space-m)}.auto-crud .auto-form-toolbar,.auto-crud-dialog .auto-form-toolbar{background-color:var(--lumo-contrast-5pct);border-top:1px solid var(--lumo-contrast-10pct);flex:0 0 auto;padding:var(--lumo-space-s) var(--lumo-space-m)}.auto-crud-dialog{bottom:0;left:0;right:0;top:0}.auto-crud-dialog::part(overlay){border-radius:0;height:100%;width:100%}.auto-crud-dialog::part(content){padding:0}.auto-crud-dialog .auto-crud-dialog-header{align-items:center;display:flex;justify-content:space-between;width:100%}.auto-crud-dialog .auto-form{height:100%;width:100%}`);export { css as default };"],
5
+ "mappings": "AAAA,MAAM,MAAM,IAAI,cAAc;AAAE,IAAI,YAAY,8vDAA8vD;",
6
+ "names": []
7
+ }
@@ -0,0 +1,4 @@
1
+ import { AutoForm as _AutoForm } from './autoform.js';
2
+ export * from './autoform.js';
3
+ export declare const AutoForm: typeof _AutoForm;
4
+ //# sourceMappingURL=autoform-feature.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"autoform-feature.d.ts","sourceRoot":"","sources":["src/autoform-feature.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,IAAI,SAAS,EAAE,MAAM,eAAe,CAAC;AAGtD,cAAc,eAAe,CAAC;AAE9B,eAAO,MAAM,QAAQ,EAAE,OAAO,SAAsD,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { AutoForm as _AutoForm } from "./autoform.js";
2
+ import { featureRegistration } from "./util";
3
+ export * from "./autoform.js";
4
+ const AutoForm = featureRegistration(_AutoForm, "AutoForm");
5
+ export {
6
+ AutoForm
7
+ };
8
+ //# sourceMappingURL=autoform-feature.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["src/autoform-feature.ts"],
4
+ "sourcesContent": ["/* eslint-disable import/export */\nimport { AutoForm as _AutoForm } from './autoform.js';\nimport { featureRegistration } from './util';\n\nexport * from './autoform.js';\n\nexport const AutoForm: typeof _AutoForm = featureRegistration(_AutoForm, 'AutoForm');\n"],
5
+ "mappings": "AACA,SAAS,YAAY,iBAAiB;AACtC,SAAS,2BAA2B;AAEpC,cAAc;AAEP,MAAM,WAA6B,oBAAoB,WAAW,UAAU;",
6
+ "names": []
7
+ }