@foxy.io/elements 1.14.0-beta.1 → 1.14.0-beta.10

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 (164) hide show
  1. package/README.md +1 -1
  2. package/dist/cdn/foxy-access-recovery-form.js +1 -1
  3. package/dist/cdn/foxy-address-card.js +1 -1
  4. package/dist/cdn/foxy-address-form.js +1 -1
  5. package/dist/cdn/foxy-applied-tax-card.js +1 -1
  6. package/dist/cdn/foxy-attribute-card.js +1 -1
  7. package/dist/cdn/foxy-attribute-form.js +1 -1
  8. package/dist/cdn/foxy-cancellation-form.js +1 -1
  9. package/dist/cdn/foxy-collection-page.js +1 -1
  10. package/dist/cdn/foxy-collection-pages.js +1 -1
  11. package/dist/cdn/foxy-custom-field-card.js +1 -1
  12. package/dist/cdn/foxy-custom-field-form.js +1 -1
  13. package/dist/cdn/foxy-customer-api.js +1 -1
  14. package/dist/cdn/foxy-customer-card.js +1 -1
  15. package/dist/cdn/foxy-customer-form.js +1 -1
  16. package/dist/cdn/foxy-customer-portal-settings.js +18 -18
  17. package/dist/cdn/foxy-customer-portal.js +1 -1
  18. package/dist/cdn/foxy-customer.js +4 -4
  19. package/dist/cdn/foxy-customers-table.js +1 -1
  20. package/dist/cdn/foxy-discount-card.js +1 -1
  21. package/dist/cdn/foxy-donation.js +1 -1
  22. package/dist/cdn/foxy-email-template-form.js +1 -0
  23. package/dist/cdn/foxy-error-entry-card.js +1 -1
  24. package/dist/cdn/foxy-form-dialog.js +1 -1
  25. package/dist/cdn/foxy-i18n.js +1 -1
  26. package/dist/cdn/foxy-items-form.js +1 -1
  27. package/dist/cdn/foxy-nucleon-element.js +1 -1
  28. package/dist/cdn/foxy-payment-card.js +1 -1
  29. package/dist/cdn/foxy-payment-method-card.js +1 -1
  30. package/dist/cdn/foxy-query-builder.js +1 -1
  31. package/dist/cdn/foxy-sign-in-form.js +1 -1
  32. package/dist/cdn/foxy-spinner.js +2 -2
  33. package/dist/cdn/foxy-subscription-card.js +1 -1
  34. package/dist/cdn/foxy-subscription-form.js +26 -9
  35. package/dist/cdn/foxy-subscriptions-table.js +1 -1
  36. package/dist/cdn/foxy-table.js +1 -1
  37. package/dist/cdn/foxy-tax-card.js +1 -1
  38. package/dist/cdn/foxy-tax-form.js +1 -1
  39. package/dist/cdn/foxy-template-config-form.js +1 -0
  40. package/dist/cdn/foxy-template-form.js +1 -1
  41. package/dist/cdn/foxy-transaction-card.js +1 -1
  42. package/dist/cdn/foxy-transactions-table.js +1 -1
  43. package/dist/cdn/foxy-user-form.js +1 -1
  44. package/dist/cdn/foxy-users-table.js +1 -1
  45. package/dist/cdn/{shared-151ca103.js → shared-00070cc4.js} +1 -1
  46. package/dist/cdn/{shared-d4dad105.js → shared-00563cb0.js} +1 -1
  47. package/dist/cdn/shared-007c4e34.js +1 -0
  48. package/dist/cdn/shared-07134f93.js +14 -0
  49. package/dist/cdn/shared-0ced76a0.js +358 -0
  50. package/dist/cdn/shared-0f9809ab.js +1 -0
  51. package/dist/cdn/{shared-f4119f12.js → shared-16f72e27.js} +1 -1
  52. package/dist/cdn/shared-1761daef.js +15 -0
  53. package/dist/cdn/{shared-5fedf5e4.js → shared-200f613b.js} +2 -2
  54. package/dist/cdn/{shared-4059f633.js → shared-218ba06e.js} +1 -1
  55. package/dist/cdn/shared-31d03530.js +264 -0
  56. package/dist/cdn/{shared-e9920617.js → shared-34b2c1e2.js} +1 -1
  57. package/dist/cdn/{shared-cf248335.js → shared-44cfc617.js} +1 -1
  58. package/dist/cdn/{shared-45d647e4.js → shared-46ee137f.js} +1 -1
  59. package/dist/cdn/shared-4ba926ca.js +1 -0
  60. package/dist/cdn/{shared-f0199313.js → shared-593f7e2c.js} +1 -1
  61. package/dist/cdn/shared-59e44f29.js +1 -0
  62. package/dist/cdn/{shared-35415106.js → shared-5d94bacb.js} +1 -1
  63. package/dist/cdn/{shared-cd700eac.js → shared-60126eee.js} +1 -1
  64. package/dist/cdn/{shared-17968c53.js → shared-63eaded9.js} +3 -3
  65. package/dist/cdn/shared-6b7602c7.js +1 -0
  66. package/dist/cdn/{shared-98ee7fad.js → shared-6d45a07b.js} +1 -1
  67. package/dist/cdn/{shared-99f45065.js → shared-7007dedb.js} +1 -1
  68. package/dist/cdn/{shared-84fa75d9.js → shared-9221e6b2.js} +1 -1
  69. package/dist/cdn/{shared-2860a3d3.js → shared-94b0ae99.js} +2 -2
  70. package/dist/cdn/shared-a3d2c48e.js +314 -0
  71. package/dist/cdn/shared-a46edf4b.js +1 -0
  72. package/dist/cdn/{shared-54702b33.js → shared-b0f0e8b5.js} +1 -1
  73. package/dist/cdn/{shared-f2a4fd27.js → shared-b24377bf.js} +1 -1
  74. package/dist/cdn/{shared-ed4ed7a5.js → shared-b710881a.js} +2 -2
  75. package/dist/cdn/{shared-3ae39e52.js → shared-bb824ab4.js} +3 -3
  76. package/dist/cdn/{shared-6783c996.js → shared-c5ae5d33.js} +1 -1
  77. package/dist/cdn/shared-ca7c3b9a.js +1 -0
  78. package/dist/cdn/shared-d01035c5.js +1 -0
  79. package/dist/cdn/{shared-dbbe03f9.js → shared-d05c93a5.js} +1 -1
  80. package/dist/cdn/{shared-5d286626.js → shared-da787055.js} +1 -1
  81. package/dist/cdn/{shared-566252ac.js → shared-daf6b763.js} +1 -1
  82. package/dist/cdn/shared-df573cea.js +12 -0
  83. package/dist/cdn/{shared-e5de8675.js → shared-e7f8ffe9.js} +1 -1
  84. package/dist/cdn/{shared-54c485d2.js → shared-ec861f31.js} +21 -21
  85. package/dist/cdn/{shared-e0248713.js → shared-f0a83bd6.js} +1 -1
  86. package/dist/cdn/shared-fe8a7aa2.js +1 -0
  87. package/dist/cdn/{shared-747b0842.js → shared-ff79f3f9.js} +1 -1
  88. package/dist/cdn/translations/shared/en.json +87 -3
  89. package/dist/elements/private/Checkbox/Checkbox.d.ts +3 -1
  90. package/dist/elements/private/Checkbox/Checkbox.js +45 -12
  91. package/dist/elements/private/Checkbox/Checkbox.js.map +1 -1
  92. package/dist/elements/private/Choice/Choice.js +10 -8
  93. package/dist/elements/private/Choice/Choice.js.map +1 -1
  94. package/dist/elements/private/Group/Group.js +1 -1
  95. package/dist/elements/private/Group/Group.js.map +1 -1
  96. package/dist/elements/private/I18N/I18N.js +1 -1
  97. package/dist/elements/private/I18N/I18N.js.map +1 -1
  98. package/dist/elements/public/AddressForm/AddressForm.js +8 -4
  99. package/dist/elements/public/AddressForm/AddressForm.js.map +1 -1
  100. package/dist/elements/public/AttributeForm/AttributeForm.js +8 -4
  101. package/dist/elements/public/AttributeForm/AttributeForm.js.map +1 -1
  102. package/dist/elements/public/CustomFieldForm/CustomFieldForm.js +8 -4
  103. package/dist/elements/public/CustomFieldForm/CustomFieldForm.js.map +1 -1
  104. package/dist/elements/public/CustomerForm/CustomerForm.js +8 -4
  105. package/dist/elements/public/CustomerForm/CustomerForm.js.map +1 -1
  106. package/dist/elements/public/EmailTemplateForm/EmailTemplateForm.d.ts +46 -0
  107. package/dist/elements/public/EmailTemplateForm/EmailTemplateForm.js +350 -0
  108. package/dist/elements/public/EmailTemplateForm/EmailTemplateForm.js.map +1 -0
  109. package/dist/elements/public/EmailTemplateForm/index.d.ts +9 -0
  110. package/dist/elements/public/EmailTemplateForm/index.js +11 -0
  111. package/dist/elements/public/EmailTemplateForm/index.js.map +1 -0
  112. package/dist/elements/public/EmailTemplateForm/types.d.ts +17 -0
  113. package/dist/elements/public/EmailTemplateForm/types.js +2 -0
  114. package/dist/elements/public/EmailTemplateForm/types.js.map +1 -0
  115. package/dist/elements/public/ItemsForm/ItemsForm.js +2 -2
  116. package/dist/elements/public/ItemsForm/ItemsForm.js.map +1 -1
  117. package/dist/elements/public/NucleonElement/serveFromCache.js +1 -0
  118. package/dist/elements/public/NucleonElement/serveFromCache.js.map +1 -1
  119. package/dist/elements/public/TaxForm/TaxForm.js +8 -4
  120. package/dist/elements/public/TaxForm/TaxForm.js.map +1 -1
  121. package/dist/elements/public/TemplateConfigForm/CountriesList.d.ts +23 -0
  122. package/dist/elements/public/TemplateConfigForm/CountriesList.js +138 -0
  123. package/dist/elements/public/TemplateConfigForm/CountriesList.js.map +1 -0
  124. package/dist/elements/public/TemplateConfigForm/CountryCard.d.ts +22 -0
  125. package/dist/elements/public/TemplateConfigForm/CountryCard.js +157 -0
  126. package/dist/elements/public/TemplateConfigForm/CountryCard.js.map +1 -0
  127. package/dist/elements/public/TemplateConfigForm/TemplateConfigForm.d.ts +88 -0
  128. package/dist/elements/public/TemplateConfigForm/TemplateConfigForm.js +1336 -0
  129. package/dist/elements/public/TemplateConfigForm/TemplateConfigForm.js.map +1 -0
  130. package/dist/elements/public/TemplateConfigForm/defaults.d.ts +2 -0
  131. package/dist/elements/public/TemplateConfigForm/defaults.js +95 -0
  132. package/dist/elements/public/TemplateConfigForm/defaults.js.map +1 -0
  133. package/dist/elements/public/TemplateConfigForm/index.d.ts +9 -0
  134. package/dist/elements/public/TemplateConfigForm/index.js +11 -0
  135. package/dist/elements/public/TemplateConfigForm/index.js.map +1 -0
  136. package/dist/elements/public/TemplateConfigForm/types.d.ts +150 -0
  137. package/dist/elements/public/TemplateConfigForm/types.js +2 -0
  138. package/dist/elements/public/TemplateConfigForm/types.js.map +1 -0
  139. package/dist/elements/public/TemplateForm/TemplateForm.d.ts +23 -1
  140. package/dist/elements/public/TemplateForm/TemplateForm.js +102 -58
  141. package/dist/elements/public/TemplateForm/TemplateForm.js.map +1 -1
  142. package/dist/elements/public/TemplateForm/types.d.ts +14 -0
  143. package/dist/elements/public/TemplateForm/types.js.map +1 -1
  144. package/dist/elements/public/index.d.ts +2 -0
  145. package/dist/elements/public/index.defined.d.ts +2 -0
  146. package/dist/elements/public/index.defined.js +2 -0
  147. package/dist/elements/public/index.defined.js.map +1 -1
  148. package/dist/elements/public/index.js +2 -0
  149. package/dist/elements/public/index.js.map +1 -1
  150. package/dist/mixins/themeable.js +125 -16
  151. package/dist/mixins/themeable.js.map +1 -1
  152. package/package.json +2 -7
  153. package/dist/cdn/shared-35502e88.js +0 -1
  154. package/dist/cdn/shared-50744508.js +0 -15
  155. package/dist/cdn/shared-5388f705.js +0 -1
  156. package/dist/cdn/shared-7f588649.js +0 -1
  157. package/dist/cdn/shared-9467cb31.js +0 -572
  158. package/dist/cdn/shared-b98f88c9.js +0 -369
  159. package/dist/cdn/shared-c0161e6a.js +0 -1
  160. package/dist/cdn/shared-dbcffd8e.js +0 -1
  161. package/dist/cdn/shared-e057788f.js +0 -1
  162. package/dist/cdn/shared-e21a2aac.js +0 -1
  163. package/dist/cdn/shared-ebbef842.js +0 -1
  164. package/dist/cdn/shared-fd5b81be.js +0 -1
@@ -7,12 +7,34 @@ import { NucleonElement } from "../NucleonElement/NucleonElement.js";
7
7
  import { ThemeableMixin } from "../../../mixins/themeable.js";
8
8
  import { TranslatableMixin } from "../../../mixins/translatable.js";
9
9
  import { classMap } from "../../../utils/class-map.js";
10
- import { ifDefined } from 'lit-html/directives/if-defined';
10
+ import { live } from 'lit-html/directives/live';
11
11
  const NS = 'template-form';
12
12
  const Base = ScopedElementsMixin(ThemeableMixin(ConfigurableMixin(TranslatableMixin(NucleonElement, NS))));
13
+ /**
14
+ * Form element for creating or editing templates (`fx:cart_include_template`, `fx:checkout_template`, `fx:cart_template`).
15
+ *
16
+ * @slot description:before
17
+ * @slot description:after
18
+ *
19
+ * @slot content:before
20
+ * @slot content:after
21
+ *
22
+ * @slot timestamps:before
23
+ * @slot timestamps:after
24
+ *
25
+ * @slot create:before
26
+ * @slot create:after
27
+ *
28
+ * @slot delete:before
29
+ * @slot delete:after
30
+ *
31
+ * @element foxy-template-form
32
+ * @since 1.14.0
33
+ */
13
34
  export class TemplateForm extends Base {
14
35
  constructor() {
15
36
  super(...arguments);
37
+ this.templates = {};
16
38
  this.__cacheState = 'idle';
17
39
  this.__contentChoice = 'default';
18
40
  }
@@ -80,13 +102,17 @@ export class TemplateForm extends Base {
80
102
  }
81
103
  __renderDescription() {
82
104
  var _a, _b;
105
+ const scope = 'description';
83
106
  return html `
84
107
  <div>
85
- ${this.renderTemplateOrSlot('description:before')}
108
+ ${this.renderTemplateOrSlot(`${scope}:before`)}
86
109
 
87
110
  <vaadin-text-field
111
+ data-testid=${scope}
88
112
  class="w-full mb-s"
89
- label=${this.t('description')}
113
+ label=${this.t(scope)}
114
+ ?disabled=${!this.in('idle') || this.disabledSelector.matches(scope)}
115
+ ?readonly=${this.readonlySelector.matches(scope)}
90
116
  .value=${(_b = (_a = this.form) === null || _a === void 0 ? void 0 : _a.description) !== null && _b !== void 0 ? _b : ''}
91
117
  @keydown=${(evt) => evt.key === 'Enter' && this.submit()}
92
118
  @input=${(evt) => {
@@ -95,40 +121,50 @@ export class TemplateForm extends Base {
95
121
  >
96
122
  </vaadin-text-field>
97
123
 
98
- ${this.renderTemplateOrSlot('description:after')}
124
+ ${this.renderTemplateOrSlot(`${scope}:after`)}
99
125
  </div>
100
126
  `;
101
127
  }
102
128
  __renderContent() {
103
129
  var _a;
130
+ const scope = 'content';
131
+ const isDisabled = !this.in('idle') || this.disabledSelector.matches(scope);
132
+ const isReadonly = this.readonlySelector.matches(scope);
104
133
  const contentChoice = this.form.content_url
105
134
  ? 'url'
106
135
  : this.form.content
107
136
  ? 'clipboard'
108
137
  : this.__contentChoice;
109
138
  return html `
110
- <div>
111
- ${this.renderTemplateOrSlot('content:before')}
139
+ <div data-testid="content">
140
+ ${this.renderTemplateOrSlot(`${scope}:before`)}
112
141
 
113
142
  <x-group frame>
114
- <foxy-i18n lang=${this.lang} slot="header" key="template" ns=${this.ns}></foxy-i18n>
143
+ <foxy-i18n
144
+ class=${classMap({ 'transition-colors': true, 'text-disabled': isDisabled })}
145
+ lang=${this.lang}
146
+ slot="header"
147
+ key="template"
148
+ ns=${this.ns}
149
+ >
150
+ </foxy-i18n>
115
151
 
116
152
  <x-choice
117
- data-testid="template-type"
153
+ data-testid="content-type"
118
154
  .value=${contentChoice}
119
155
  .items=${['default', 'url', 'clipboard']}
120
- ?readonly=${this.readonlySelector.matches('content', true)}
121
- ?disabled=${this.in('busy') || this.disabledSelector.matches('content', true)}
156
+ ?readonly=${isReadonly}
157
+ ?disabled=${isDisabled}
122
158
  @change=${(evt) => {
123
159
  if (evt instanceof ChoiceChangeEvent) {
124
160
  this.edit({ content: '', content_url: '' });
125
- this.__contentChoice = evt.detail; // TODO
161
+ this.__contentChoice = evt.detail;
126
162
  }
127
163
  }}
128
164
  >
129
165
  ${['default', 'url', 'clipboard'].map(value => {
130
166
  return html `
131
- <div slot="${value}-label" class="py-s">
167
+ <div slot="${value}-label" class="py-s leading-s">
132
168
  <foxy-i18n class="block" lang=${this.lang} key="template_${value}" ns=${this.ns}>
133
169
  </foxy-i18n>
134
170
 
@@ -146,9 +182,12 @@ export class TemplateForm extends Base {
146
182
  <div slot="url" ?hidden=${contentChoice !== 'url'}>
147
183
  <div class="flex items-center mt-0 mb-m">
148
184
  <vaadin-text-field
149
- data-testid="content_url"
150
- value=${ifDefined(this.form.content_url)}
185
+ data-testid="content-url"
151
186
  class="mr-s flex-grow"
187
+ ?readonly=${isReadonly}
188
+ ?disabled=${isDisabled}
189
+ .value=${this.form.content_url}
190
+ @keydown=${(evt) => evt.key === 'Enter' && this.submit()}
152
191
  @input=${(evt) => {
153
192
  const value = evt.currentTarget.value;
154
193
  this.edit({ content: '', content_url: value });
@@ -156,51 +195,51 @@ export class TemplateForm extends Base {
156
195
  >
157
196
  </vaadin-text-field>
158
197
 
159
- ${this.form.content_url === ((_a = this.data) === null || _a === void 0 ? void 0 : _a.content_url)
160
- ? html `
161
- <vaadin-button
162
- class="relative"
163
- ?disabled=${this.__cacheState === 'busy'}
164
- @click=${this.__cache}
165
- >
166
- <foxy-i18n
167
- class=${classMap({
168
- 'relative transition-opacity': true,
169
- 'opacity-0': this.__cacheState !== 'idle',
170
- })}
171
- lang=${this.lang}
172
- key="cache"
173
- ns=${this.ns}
174
- >
175
- </foxy-i18n>
198
+ <vaadin-button
199
+ data-testid="cache"
200
+ class="relative"
201
+ ?hidden=${isReadonly || this.form.content_url !== ((_a = this.data) === null || _a === void 0 ? void 0 : _a.content_url)}
202
+ ?disabled=${isDisabled || this.__cacheState === 'busy'}
203
+ @click=${this.__cache}
204
+ >
205
+ <foxy-i18n
206
+ class=${classMap({
207
+ 'relative transition-opacity': true,
208
+ 'opacity-0': this.__cacheState !== 'idle',
209
+ })}
210
+ lang=${this.lang}
211
+ key="cache"
212
+ ns=${this.ns}
213
+ >
214
+ </foxy-i18n>
176
215
 
177
- <div
178
- class=${classMap({
179
- 'absolute inset-0 flex transition-opacity': true,
180
- 'opacity-0': this.__cacheState === 'idle',
181
- })}
182
- >
183
- <foxy-spinner
184
- layout="no-label"
185
- class="m-auto"
186
- state=${this.__cacheState === 'fail' ? 'error' : 'busy'}
187
- lang=${this.lang}
188
- ns=${this.ns}
189
- >
190
- </foxy-spinner>
191
- </div>
192
- </vaadin-button>
193
- `
194
- : ''}
216
+ <div
217
+ class=${classMap({
218
+ 'absolute inset-0 flex transition-opacity': true,
219
+ 'opacity-0': this.__cacheState === 'idle',
220
+ })}
221
+ >
222
+ <foxy-spinner
223
+ layout="no-label"
224
+ class="m-auto"
225
+ state=${this.__cacheState === 'fail' ? 'error' : 'busy'}
226
+ lang=${this.lang}
227
+ ns=${this.ns}
228
+ >
229
+ </foxy-spinner>
230
+ </div>
231
+ </vaadin-button>
195
232
  </div>
196
233
  </div>
197
234
 
198
235
  <div slot="clipboard" ?hidden=${contentChoice !== 'clipboard'}>
199
236
  <vaadin-text-area
200
237
  id="cached-content"
201
- data-testid="content"
238
+ data-testid="content-clipboard"
202
239
  class="w-full mb-m"
203
- .value=${this.form.content}
240
+ ?readonly=${isReadonly}
241
+ ?disabled=${isDisabled}
242
+ .value=${live(this.form.content)}
204
243
  @input=${(evt) => {
205
244
  const value = evt.currentTarget.value;
206
245
  this.edit({ content: value, content_url: '' });
@@ -211,25 +250,30 @@ export class TemplateForm extends Base {
211
250
  </x-choice>
212
251
  </x-group>
213
252
 
214
- ${this.renderTemplateOrSlot('content:after')}
253
+ ${this.renderTemplateOrSlot(`${scope}:after`)}
215
254
  </div>
216
255
  `;
217
256
  }
218
257
  __renderTimestamps() {
258
+ const scope = 'timestamps';
219
259
  return html `
220
260
  <div>
221
- ${this.renderTemplateOrSlot('timestamps:before')}
261
+ ${this.renderTemplateOrSlot(`${scope}:before`)}
222
262
 
223
263
  <x-property-table
224
264
  data-testid="timestamps"
225
- .items=${['date_modified', 'date_created'].map(field => ({
226
- name: this.t(field),
227
- value: this.data ? this.t('date', { value: new Date(this.data[field]) }) : '',
228
- }))}
265
+ .items=${['date_modified', 'date_created'].map(field => {
266
+ var _a;
267
+ return ({
268
+ name: this.t(field),
269
+ value: ((_a = this.data) === null || _a === void 0 ? void 0 : _a[field]) ? this.t('date', { value: new Date(this.data[field]) })
270
+ : '',
271
+ });
272
+ })}
229
273
  >
230
274
  </x-property-table>
231
275
 
232
- ${this.renderTemplateOrSlot('timestamps:after')}
276
+ ${this.renderTemplateOrSlot(`${scope}:after`)}
233
277
  </div>
234
278
  `;
235
279
  }
@@ -1 +1 @@
1
- {"version":3,"file":"TemplateForm.js","sourceRoot":"","sources":["../../../../src/elements/public/TemplateForm/TemplateForm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwD,GAAG,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAC9F,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,+BAA4B;AACnE,OAAO,EAAqB,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAElF,OAAO,EAAE,iBAAiB,EAAE,gCAA6B;AACzD,OAAO,EAAE,iBAAiB,EAAE,wCAAqC;AAIjE,OAAO,EAAE,cAAc,EAAE,4CAAyC;AAGlE,OAAO,EAAE,cAAc,EAAE,qCAAkC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,wCAAqC;AACjE,OAAO,EAAE,QAAQ,EAAE,oCAAiC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAE3D,MAAM,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,IAAI;YACF,MAAM,GAAG,eAAG,IAAI,CAAC,IAAI,0CAAE,MAAM,CAAC,UAAU,EAAE,IAAI,mCAAI,EAAE,CAAC;YACrD,MAAM,QAAQ,GAAG,MAAM,IAAI,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;YAEjF,IAAI,CAAC,YAAY,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC;SACnD;QAAC,WAAM;YACN,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC;SAC5B;IACH,CAAC;CACF","sourcesContent":["import { CSSResultArray, PropertyDeclarations, TemplateResult, css, html } from 'lit-element';\nimport { Choice, Group, PropertyTable } from '../../private/index';\nimport { ScopedElementsMap, ScopedElementsMixin } from '@open-wc/scoped-elements';\n\nimport { ChoiceChangeEvent } from '../../private/events';\nimport { ConfigurableMixin } from '../../../mixins/configurable';\nimport { Data } from './types';\nimport { DialogHideEvent } from '../../private/Dialog/DialogHideEvent';\nimport { InternalConfirmDialog } from '../../internal/InternalConfirmDialog/InternalConfirmDialog';\nimport { NucleonElement } from '../NucleonElement/NucleonElement';\nimport { TextAreaElement } from '@vaadin/vaadin-text-field/vaadin-text-area';\nimport { TextFieldElement } from '@vaadin/vaadin-text-field';\nimport { ThemeableMixin } from '../../../mixins/themeable';\nimport { TranslatableMixin } from '../../../mixins/translatable';\nimport { classMap } from '../../../utils/class-map';\nimport { ifDefined } from 'lit-html/directives/if-defined';\n\nconst NS = 'template-form';\nconst Base = ScopedElementsMixin(\n ThemeableMixin(ConfigurableMixin(TranslatableMixin(NucleonElement, NS)))\n);\n\nexport class TemplateForm extends Base<Data> {\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n __cacheState: { attribute: false },\n __contentChoice: { attribute: false },\n };\n }\n\n static get styles(): CSSResultArray {\n return [\n ...super.styles,\n css`\n #cached-content::part(input-field) {\n max-height: 15em;\n }\n `,\n ];\n }\n\n static get scopedElements(): ScopedElementsMap {\n return {\n 'foxy-internal-confirm-dialog': customElements.get('foxy-internal-confirm-dialog'),\n 'foxy-internal-sandbox': customElements.get('foxy-internal-sandbox'),\n 'foxy-spinner': customElements.get('foxy-spinner'),\n 'foxy-i18n': customElements.get('foxy-i18n'),\n 'vaadin-text-field': customElements.get('vaadin-text-field'),\n 'vaadin-text-area': customElements.get('vaadin-text-area'),\n 'vaadin-button': customElements.get('vaadin-button'),\n 'x-property-table': PropertyTable,\n 'x-choice': Choice,\n 'x-group': Group,\n };\n }\n\n private __cacheState: 'idle' | 'busy' | 'fail' = 'idle';\n\n private __contentChoice: 'default' | 'url' | 'clipboard' = 'default';\n\n render(): TemplateResult {\n const { hiddenSelector, href, lang, ns } = this;\n const action = href ? 'delete' : 'create';\n const isBusy = this.in('busy');\n const isFail = this.in('fail');\n\n return html`\n <div class=\"space-y-m\">\n ${hiddenSelector.matches('description', true) ? '' : this.__renderDescription()}\n ${hiddenSelector.matches('content', true) ? '' : this.__renderContent()}\n ${hiddenSelector.matches('timestamps', true) || !href ? '' : this.__renderTimestamps()}\n ${hiddenSelector.matches(action) ? '' : this.__renderAction(action)}\n\n <div\n data-testid=\"spinner\"\n class=${classMap({\n 'transition duration-500 ease-in-out absolute inset-0 flex': true,\n 'opacity-0 pointer-events-none': !isBusy && !isFail,\n })}\n >\n <foxy-spinner\n layout=\"vertical\"\n class=\"m-auto p-m bg-base shadow-xs rounded-t-l rounded-b-l\"\n state=${isFail ? 'error' : isBusy ? 'busy' : 'empty'}\n lang=${lang}\n ns=\"${ns} ${customElements.get('foxy-spinner')?.defaultNS ?? ''}\"\n >\n </foxy-spinner>\n </div>\n </div>\n `;\n }\n\n private __renderDescription() {\n return html`\n <div>\n ${this.renderTemplateOrSlot('description:before')}\n\n <vaadin-text-field\n class=\"w-full mb-s\"\n label=${this.t('description')}\n .value=${this.form?.description ?? ''}\n @keydown=${(evt: KeyboardEvent) => evt.key === 'Enter' && this.submit()}\n @input=${(evt: CustomEvent) => {\n this.edit({ description: (evt.currentTarget as TextFieldElement).value });\n }}\n >\n </vaadin-text-field>\n\n ${this.renderTemplateOrSlot('description:after')}\n </div>\n `;\n }\n\n private __renderContent() {\n const contentChoice = this.form.content_url\n ? 'url'\n : this.form.content\n ? 'clipboard'\n : this.__contentChoice;\n\n return html`\n <div>\n ${this.renderTemplateOrSlot('content:before')}\n\n <x-group frame>\n <foxy-i18n lang=${this.lang} slot=\"header\" key=\"template\" ns=${this.ns}></foxy-i18n>\n\n <x-choice\n data-testid=\"template-type\"\n .value=${contentChoice}\n .items=${['default', 'url', 'clipboard']}\n ?readonly=${this.readonlySelector.matches('content', true)}\n ?disabled=${this.in('busy') || this.disabledSelector.matches('content', true)}\n @change=${(evt: Event) => {\n if (evt instanceof ChoiceChangeEvent) {\n this.edit({ content: '', content_url: '' });\n this.__contentChoice = evt.detail as any; // TODO\n }\n }}\n >\n ${['default', 'url', 'clipboard'].map(value => {\n return html`\n <div slot=\"${value}-label\" class=\"py-s\">\n <foxy-i18n class=\"block\" lang=${this.lang} key=\"template_${value}\" ns=${this.ns}>\n </foxy-i18n>\n\n <foxy-i18n\n class=\"block text-s opacity-70\"\n lang=${this.lang}\n key=\"template_${value}_explainer\"\n ns=${this.ns}\n >\n </foxy-i18n>\n </div>\n `;\n })}\n\n <div slot=\"url\" ?hidden=${contentChoice !== 'url'}>\n <div class=\"flex items-center mt-0 mb-m\">\n <vaadin-text-field\n data-testid=\"content_url\"\n value=${ifDefined(this.form.content_url)}\n class=\"mr-s flex-grow\"\n @input=${(evt: CustomEvent) => {\n const value = (evt.currentTarget as TextFieldElement).value;\n this.edit({ content: '', content_url: value });\n }}\n >\n </vaadin-text-field>\n\n ${this.form.content_url === this.data?.content_url\n ? html`\n <vaadin-button\n class=\"relative\"\n ?disabled=${this.__cacheState === 'busy'}\n @click=${this.__cache}\n >\n <foxy-i18n\n class=${classMap({\n 'relative transition-opacity': true,\n 'opacity-0': this.__cacheState !== 'idle',\n })}\n lang=${this.lang}\n key=\"cache\"\n ns=${this.ns}\n >\n </foxy-i18n>\n\n <div\n class=${classMap({\n 'absolute inset-0 flex transition-opacity': true,\n 'opacity-0': this.__cacheState === 'idle',\n })}\n >\n <foxy-spinner\n layout=\"no-label\"\n class=\"m-auto\"\n state=${this.__cacheState === 'fail' ? 'error' : 'busy'}\n lang=${this.lang}\n ns=${this.ns}\n >\n </foxy-spinner>\n </div>\n </vaadin-button>\n `\n : ''}\n </div>\n </div>\n\n <div slot=\"clipboard\" ?hidden=${contentChoice !== 'clipboard'}>\n <vaadin-text-area\n id=\"cached-content\"\n data-testid=\"content\"\n class=\"w-full mb-m\"\n .value=${this.form.content}\n @input=${(evt: CustomEvent) => {\n const value = (evt.currentTarget as TextAreaElement).value;\n this.edit({ content: value, content_url: '' });\n }}\n >\n </vaadin-text-area>\n </div>\n </x-choice>\n </x-group>\n\n ${this.renderTemplateOrSlot('content:after')}\n </div>\n `;\n }\n\n private __renderTimestamps() {\n return html`\n <div>\n ${this.renderTemplateOrSlot('timestamps:before')}\n\n <x-property-table\n data-testid=\"timestamps\"\n .items=${(['date_modified', 'date_created'] as const).map(field => ({\n name: this.t(field),\n value: this.data ? this.t('date', { value: new Date(this.data[field]) }) : '',\n }))}\n >\n </x-property-table>\n\n ${this.renderTemplateOrSlot('timestamps:after')}\n </div>\n `;\n }\n\n private __renderAction(action: string) {\n const { disabledSelector, href, lang, ns } = this;\n\n const isTemplateValid = this.in({ idle: { template: { dirty: 'valid' } } });\n const isSnapshotValid = this.in({ idle: { snapshot: { dirty: 'valid' } } });\n const isDisabled = !this.in('idle') || disabledSelector.matches(action, true);\n const isValid = isTemplateValid || isSnapshotValid;\n\n const handleClick = (evt: Event) => {\n if (action === 'delete') {\n const confirm = this.renderRoot.querySelector('#confirm');\n (confirm as InternalConfirmDialog).show(evt.currentTarget as HTMLElement);\n } else {\n this.submit();\n }\n };\n\n return html`\n <div>\n ${this.renderTemplateOrSlot(`${action}:before`)}\n\n <foxy-internal-confirm-dialog\n message=\"delete_prompt\"\n confirm=\"delete\"\n cancel=\"cancel\"\n header=\"delete\"\n theme=\"primary error\"\n lang=${lang}\n ns=${ns}\n id=\"confirm\"\n data-testid=\"confirm\"\n @hide=${(evt: DialogHideEvent) => {\n if (!evt.detail.cancelled) this.delete();\n }}\n >\n </foxy-internal-confirm-dialog>\n\n <vaadin-button\n class=\"w-full\"\n theme=${this.in('idle') ? `primary ${href ? 'error' : 'success'}` : ''}\n data-testid=${action}\n ?disabled=${(this.in({ idle: 'template' }) && !isValid) || isDisabled}\n @click=${handleClick}\n >\n <foxy-i18n ns=${ns} key=${action} lang=${lang}></foxy-i18n>\n </vaadin-button>\n\n ${this.renderTemplateOrSlot(`${action}:after`)}\n </div>\n `;\n }\n\n private async __cache(): Promise<void> {\n this.__cacheState = 'busy';\n\n try {\n const url = this.data?._links['fx:cache'].href ?? '';\n const response = await new TemplateForm.API(this).fetch(url, { method: 'POST' });\n\n this.__cacheState = response.ok ? 'idle' : 'fail';\n } catch {\n this.__cacheState = 'fail';\n }\n }\n}\n"]}
1
+ {"version":3,"file":"TemplateForm.js","sourceRoot":"","sources":["../../../../src/elements/public/TemplateForm/TemplateForm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwD,GAAG,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAC9F,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,+BAA4B;AAEnE,OAAO,EAAqB,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAElF,OAAO,EAAE,iBAAiB,EAAE,gCAA6B;AACzD,OAAO,EAAE,iBAAiB,EAAE,wCAAqC;AAGjE,OAAO,EAAE,cAAc,EAAE,4CAAyC;AAGlE,OAAO,EAAE,cAAc,EAAE,qCAAkC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,wCAAqC;AACjE,OAAO,EAAE,QAAQ,EAAE,oCAAiC;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ateResult, css, html } from 'lit-element';\nimport { Choice, Group, PropertyTable } from '../../private/index';\nimport { Data, Templates } from './types';\nimport { ScopedElementsMap, ScopedElementsMixin } from '@open-wc/scoped-elements';\n\nimport { ChoiceChangeEvent } from '../../private/events';\nimport { ConfigurableMixin } from '../../../mixins/configurable';\nimport { DialogHideEvent } from '../../private/Dialog/DialogHideEvent';\nimport { InternalConfirmDialog } from '../../internal/InternalConfirmDialog/InternalConfirmDialog';\nimport { NucleonElement } from '../NucleonElement/NucleonElement';\nimport { TextAreaElement } from '@vaadin/vaadin-text-field/vaadin-text-area';\nimport { TextFieldElement } from '@vaadin/vaadin-text-field';\nimport { ThemeableMixin } from '../../../mixins/themeable';\nimport { TranslatableMixin } from '../../../mixins/translatable';\nimport { classMap } from '../../../utils/class-map';\nimport { live } from 'lit-html/directives/live';\n\nconst NS = 'template-form';\nconst Base = ScopedElementsMixin(\n ThemeableMixin(ConfigurableMixin(TranslatableMixin(NucleonElement, NS)))\n);\n\n/**\n * Form element for creating or editing templates (`fx:cart_include_template`, `fx:checkout_template`, `fx:cart_template`).\n *\n * @slot description:before\n * @slot description:after\n *\n * @slot content:before\n * @slot content:after\n *\n * @slot timestamps:before\n * @slot timestamps:after\n *\n * @slot create:before\n * @slot create:after\n *\n * @slot delete:before\n * @slot delete:after\n *\n * @element foxy-template-form\n * @since 1.14.0\n */\nexport class TemplateForm extends Base<Data> {\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n __cacheState: { attribute: false },\n __contentChoice: { attribute: false },\n };\n }\n\n static get styles(): CSSResultArray {\n return [\n ...super.styles,\n css`\n #cached-content::part(input-field) {\n max-height: 15em;\n }\n `,\n ];\n }\n\n static get scopedElements(): ScopedElementsMap {\n return {\n 'foxy-internal-confirm-dialog': customElements.get('foxy-internal-confirm-dialog'),\n 'foxy-internal-sandbox': customElements.get('foxy-internal-sandbox'),\n 'foxy-spinner': customElements.get('foxy-spinner'),\n 'foxy-i18n': customElements.get('foxy-i18n'),\n 'vaadin-text-field': customElements.get('vaadin-text-field'),\n 'vaadin-text-area': customElements.get('vaadin-text-area'),\n 'vaadin-button': customElements.get('vaadin-button'),\n 'x-property-table': PropertyTable,\n 'x-choice': Choice,\n 'x-group': Group,\n };\n }\n\n templates: Templates = {};\n\n private __cacheState: 'idle' | 'busy' | 'fail' = 'idle';\n\n private __contentChoice: 'default' | 'url' | 'clipboard' = 'default';\n\n render(): TemplateResult {\n const { hiddenSelector, href, lang, ns } = this;\n const action = href ? 'delete' : 'create';\n const isBusy = this.in('busy');\n const isFail = this.in('fail');\n\n return html`\n <div class=\"space-y-m\">\n ${hiddenSelector.matches('description', true) ? '' : this.__renderDescription()}\n ${hiddenSelector.matches('content', true) ? '' : this.__renderContent()}\n ${hiddenSelector.matches('timestamps', true) || !href ? '' : this.__renderTimestamps()}\n ${hiddenSelector.matches(action) ? '' : this.__renderAction(action)}\n\n <div\n data-testid=\"spinner\"\n class=${classMap({\n 'transition duration-500 ease-in-out absolute inset-0 flex': true,\n 'opacity-0 pointer-events-none': !isBusy && !isFail,\n })}\n >\n <foxy-spinner\n layout=\"vertical\"\n class=\"m-auto p-m bg-base shadow-xs rounded-t-l rounded-b-l\"\n state=${isFail ? 'error' : isBusy ? 'busy' : 'empty'}\n lang=${lang}\n ns=\"${ns} ${customElements.get('foxy-spinner')?.defaultNS ?? ''}\"\n >\n </foxy-spinner>\n </div>\n </div>\n `;\n }\n\n private __renderDescription() {\n const scope = 'description';\n\n return html`\n <div>\n ${this.renderTemplateOrSlot(`${scope}:before`)}\n\n <vaadin-text-field\n data-testid=${scope}\n class=\"w-full mb-s\"\n label=${this.t(scope)}\n ?disabled=${!this.in('idle') || this.disabledSelector.matches(scope)}\n ?readonly=${this.readonlySelector.matches(scope)}\n .value=${this.form?.description ?? ''}\n @keydown=${(evt: KeyboardEvent) => evt.key === 'Enter' && this.submit()}\n @input=${(evt: CustomEvent) => {\n this.edit({ description: (evt.currentTarget as TextFieldElement).value });\n }}\n >\n </vaadin-text-field>\n\n ${this.renderTemplateOrSlot(`${scope}:after`)}\n </div>\n `;\n }\n\n private __renderContent() {\n const scope = 'content';\n const isDisabled = !this.in('idle') || this.disabledSelector.matches(scope);\n const isReadonly = this.readonlySelector.matches(scope);\n const contentChoice = this.form.content_url\n ? 'url'\n : this.form.content\n ? 'clipboard'\n : this.__contentChoice;\n\n return html`\n <div data-testid=\"content\">\n ${this.renderTemplateOrSlot(`${scope}:before`)}\n\n <x-group frame>\n <foxy-i18n\n class=${classMap({ 'transition-colors': true, 'text-disabled': isDisabled })}\n lang=${this.lang}\n slot=\"header\"\n key=\"template\"\n ns=${this.ns}\n >\n </foxy-i18n>\n\n <x-choice\n data-testid=\"content-type\"\n .value=${contentChoice}\n .items=${['default', 'url', 'clipboard']}\n ?readonly=${isReadonly}\n ?disabled=${isDisabled}\n @change=${(evt: Event) => {\n if (evt instanceof ChoiceChangeEvent) {\n this.edit({ content: '', content_url: '' });\n this.__contentChoice = evt.detail as 'url' | 'clipboard' | 'default';\n }\n }}\n >\n ${['default', 'url', 'clipboard'].map(value => {\n return html`\n <div slot=\"${value}-label\" class=\"py-s leading-s\">\n <foxy-i18n class=\"block\" lang=${this.lang} key=\"template_${value}\" ns=${this.ns}>\n </foxy-i18n>\n\n <foxy-i18n\n class=\"block text-s opacity-70\"\n lang=${this.lang}\n key=\"template_${value}_explainer\"\n ns=${this.ns}\n >\n </foxy-i18n>\n </div>\n `;\n })}\n\n <div slot=\"url\" ?hidden=${contentChoice !== 'url'}>\n <div class=\"flex items-center mt-0 mb-m\">\n <vaadin-text-field\n data-testid=\"content-url\"\n class=\"mr-s flex-grow\"\n ?readonly=${isReadonly}\n ?disabled=${isDisabled}\n .value=${this.form.content_url}\n @keydown=${(evt: KeyboardEvent) => evt.key === 'Enter' && this.submit()}\n @input=${(evt: CustomEvent) => {\n const value = (evt.currentTarget as TextFieldElement).value;\n this.edit({ content: '', content_url: value });\n }}\n >\n </vaadin-text-field>\n\n <vaadin-button\n data-testid=\"cache\"\n class=\"relative\"\n ?hidden=${isReadonly || this.form.content_url !== this.data?.content_url}\n ?disabled=${isDisabled || this.__cacheState === 'busy'}\n @click=${this.__cache}\n >\n <foxy-i18n\n class=${classMap({\n 'relative transition-opacity': true,\n 'opacity-0': this.__cacheState !== 'idle',\n })}\n lang=${this.lang}\n key=\"cache\"\n ns=${this.ns}\n >\n </foxy-i18n>\n\n <div\n class=${classMap({\n 'absolute inset-0 flex transition-opacity': true,\n 'opacity-0': this.__cacheState === 'idle',\n })}\n >\n <foxy-spinner\n layout=\"no-label\"\n class=\"m-auto\"\n state=${this.__cacheState === 'fail' ? 'error' : 'busy'}\n lang=${this.lang}\n ns=${this.ns}\n >\n </foxy-spinner>\n </div>\n </vaadin-button>\n </div>\n </div>\n\n <div slot=\"clipboard\" ?hidden=${contentChoice !== 'clipboard'}>\n <vaadin-text-area\n id=\"cached-content\"\n data-testid=\"content-clipboard\"\n class=\"w-full mb-m\"\n ?readonly=${isReadonly}\n ?disabled=${isDisabled}\n .value=${live(this.form.content)}\n @input=${(evt: CustomEvent) => {\n const value = (evt.currentTarget as TextAreaElement).value;\n this.edit({ content: value, content_url: '' });\n }}\n >\n </vaadin-text-area>\n </div>\n </x-choice>\n </x-group>\n\n ${this.renderTemplateOrSlot(`${scope}:after`)}\n </div>\n `;\n }\n\n private __renderTimestamps() {\n const scope = 'timestamps';\n\n return html`\n <div>\n ${this.renderTemplateOrSlot(`${scope}:before`)}\n\n <x-property-table\n data-testid=\"timestamps\"\n .items=${(['date_modified', 'date_created'] as const).map(field => ({\n name: this.t(field),\n value: this.data?.[field]\n ? this.t('date', { value: new Date(this.data[field] as string) })\n : '',\n }))}\n >\n </x-property-table>\n\n ${this.renderTemplateOrSlot(`${scope}:after`)}\n </div>\n `;\n }\n\n private __renderAction(action: string) {\n const { disabledSelector, href, lang, ns } = this;\n\n const isTemplateValid = this.in({ idle: { template: { dirty: 'valid' } } });\n const isSnapshotValid = this.in({ idle: { snapshot: { dirty: 'valid' } } });\n const isDisabled = !this.in('idle') || disabledSelector.matches(action, true);\n const isValid = isTemplateValid || isSnapshotValid;\n\n const handleClick = (evt: Event) => {\n if (action === 'delete') {\n const confirm = this.renderRoot.querySelector('#confirm');\n (confirm as InternalConfirmDialog).show(evt.currentTarget as HTMLElement);\n } else {\n this.submit();\n }\n };\n\n return html`\n <div>\n ${this.renderTemplateOrSlot(`${action}:before`)}\n\n <foxy-internal-confirm-dialog\n message=\"delete_prompt\"\n confirm=\"delete\"\n cancel=\"cancel\"\n header=\"delete\"\n theme=\"primary error\"\n lang=${lang}\n ns=${ns}\n id=\"confirm\"\n data-testid=\"confirm\"\n @hide=${(evt: DialogHideEvent) => {\n if (!evt.detail.cancelled) this.delete();\n }}\n >\n </foxy-internal-confirm-dialog>\n\n <vaadin-button\n class=\"w-full\"\n theme=${this.in('idle') ? `primary ${href ? 'error' : 'success'}` : ''}\n data-testid=${action}\n ?disabled=${(this.in({ idle: 'template' }) && !isValid) || isDisabled}\n @click=${handleClick}\n >\n <foxy-i18n ns=${ns} key=${action} lang=${lang}></foxy-i18n>\n </vaadin-button>\n\n ${this.renderTemplateOrSlot(`${action}:after`)}\n </div>\n `;\n }\n\n private async __cache(): Promise<void> {\n this.__cacheState = 'busy';\n\n try {\n const url = this.data?._links['fx:cache'].href ?? '';\n const response = await new TemplateForm.API(this).fetch(url, { method: 'POST' });\n\n this.__cacheState = response.ok ? 'idle' : 'fail';\n } catch {\n this.__cacheState = 'fail';\n }\n }\n}\n"]}
@@ -1,3 +1,17 @@
1
1
  import { Rels } from '@foxy.io/sdk/backend';
2
+ import { Renderer } from '../../../mixins/configurable';
2
3
  import { Resource } from '@foxy.io/sdk/core';
4
+ import { TemplateForm } from './TemplateForm';
3
5
  export declare type Data = Resource<Rels.CartIncludeTemplate> | Resource<Rels.CheckoutTemplate> | Resource<Rels.CartTemplate>;
6
+ export declare type Templates = {
7
+ 'description:before'?: Renderer<TemplateForm>;
8
+ 'description:after'?: Renderer<TemplateForm>;
9
+ 'content:before'?: Renderer<TemplateForm>;
10
+ 'content:after'?: Renderer<TemplateForm>;
11
+ 'timestamps:before'?: Renderer<TemplateForm>;
12
+ 'timestamps:after'?: Renderer<TemplateForm>;
13
+ 'create:before'?: Renderer<TemplateForm>;
14
+ 'create:after'?: Renderer<TemplateForm>;
15
+ 'delete:before'?: Renderer<TemplateForm>;
16
+ 'delete:after'?: Renderer<TemplateForm>;
17
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/elements/public/TemplateForm/types.ts"],"names":[],"mappings":"","sourcesContent":["import { Rels } from '@foxy.io/sdk/backend';\nimport { Resource } from '@foxy.io/sdk/core';\n\nexport type Data =\n | Resource<Rels.CartIncludeTemplate>\n | Resource<Rels.CheckoutTemplate>\n | Resource<Rels.CartTemplate>;\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/elements/public/TemplateForm/types.ts"],"names":[],"mappings":"","sourcesContent":["import { Rels } from '@foxy.io/sdk/backend';\nimport { Renderer } from '../../../mixins/configurable';\nimport { Resource } from '@foxy.io/sdk/core';\nimport { TemplateForm } from './TemplateForm';\n\nexport type Data =\n | Resource<Rels.CartIncludeTemplate>\n | Resource<Rels.CheckoutTemplate>\n | Resource<Rels.CartTemplate>;\n\nexport type Templates = {\n 'description:before'?: Renderer<TemplateForm>;\n 'description:after'?: Renderer<TemplateForm>;\n 'content:before'?: Renderer<TemplateForm>;\n 'content:after'?: Renderer<TemplateForm>;\n 'timestamps:before'?: Renderer<TemplateForm>;\n 'timestamps:after'?: Renderer<TemplateForm>;\n 'create:before'?: Renderer<TemplateForm>;\n 'create:after'?: Renderer<TemplateForm>;\n 'delete:before'?: Renderer<TemplateForm>;\n 'delete:after'?: Renderer<TemplateForm>;\n};\n"]}
@@ -18,6 +18,7 @@ export { CustomFieldCard } from './CustomFieldCard/CustomFieldCard';
18
18
  export { CustomFieldForm } from './CustomFieldForm/CustomFieldForm';
19
19
  export { DiscountCard } from './DiscountCard/DiscountCard';
20
20
  export { Donation } from './Donation/Donation';
21
+ export { EmailTemplateForm } from './EmailTemplateForm/EmailTemplateForm';
21
22
  export { ErrorEntryCard } from './ErrorEntryCard/ErrorEntryCard';
22
23
  export { FormDialog } from './FormDialog/FormDialog';
23
24
  export { I18n } from './I18n/I18n';
@@ -35,6 +36,7 @@ export { Table } from './Table/Table';
35
36
  export { TaxCard } from './TaxCard/TaxCard';
36
37
  export { TaxForm } from './TaxForm/TaxForm';
37
38
  export { TemplateForm } from './TemplateForm/TemplateForm';
39
+ export { TemplateConfigForm } from './TemplateConfigForm/TemplateConfigForm';
38
40
  export { TransactionCard } from './TransactionCard/TransactionCard';
39
41
  export { TransactionsTable } from './TransactionsTable/TransactionsTable';
40
42
  export { UserForm } from './UserForm/UserForm';
@@ -18,6 +18,7 @@ export { CustomFieldCard } from './CustomFieldCard/index';
18
18
  export { CustomFieldForm } from './CustomFieldForm/index';
19
19
  export { DiscountCard } from './DiscountCard/index';
20
20
  export { Donation } from './Donation/index';
21
+ export { EmailTemplateForm } from './EmailTemplateForm/index';
21
22
  export { ErrorEntryCard } from './ErrorEntryCard/index';
22
23
  export { FormDialog } from './FormDialog/index';
23
24
  export { I18n } from './I18n/index';
@@ -34,6 +35,7 @@ export { SubscriptionsTable } from './SubscriptionsTable/index';
34
35
  export { Table } from './Table/index';
35
36
  export { TaxCard } from './TaxCard/index';
36
37
  export { TaxForm } from './TaxForm/index';
38
+ export { TemplateConfigForm } from './TemplateConfigForm/index';
37
39
  export { TemplateForm } from './TemplateForm/index';
38
40
  export { TransactionCard } from './TransactionCard/index';
39
41
  export { TransactionsTable } from './TransactionsTable/index';
@@ -18,6 +18,7 @@ export { CustomFieldCard } from "./CustomFieldCard/index.js";
18
18
  export { CustomFieldForm } from "./CustomFieldForm/index.js";
19
19
  export { DiscountCard } from "./DiscountCard/index.js";
20
20
  export { Donation } from "./Donation/index.js";
21
+ export { EmailTemplateForm } from "./EmailTemplateForm/index.js";
21
22
  export { ErrorEntryCard } from "./ErrorEntryCard/index.js";
22
23
  export { FormDialog } from "./FormDialog/index.js";
23
24
  export { I18n } from "./I18n/index.js";
@@ -34,6 +35,7 @@ export { SubscriptionsTable } from "./SubscriptionsTable/index.js";
34
35
  export { Table } from "./Table/index.js";
35
36
  export { TaxCard } from "./TaxCard/index.js";
36
37
  export { TaxForm } from "./TaxForm/index.js";
38
+ export { TemplateConfigForm } from "./TemplateConfigForm/index.js";
37
39
  export { TemplateForm } from "./TemplateForm/index.js";
38
40
  export { TransactionCard } from "./TransactionCard/index.js";
39
41
  export { TransactionsTable } from "./TransactionsTable/index.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.defined.js","sourceRoot":"","sources":["../../../src/elements/public/index.defined.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,sCAAmC;AAChE,OAAO,EAAE,WAAW,EAAE,+BAA4B;AAClD,OAAO,EAAE,WAAW,EAAE,+BAA4B;AAClD,OAAO,EAAE,cAAc,EAAE,kCAA+B;AACxD,OAAO,EAAE,aAAa,EAAE,iCAA8B;AACtD,OAAO,EAAE,aAAa,EAAE,iCAA8B;AACtD,OAAO,EAAE,gBAAgB,EAAE,oCAAiC;AAC5D,OAAO,EAAE,cAAc,EAAE,kCAA+B;AACxD,OAAO,EAAE,eAAe,EAAE,mCAAgC;AAC1D,OAAO,EAAE,QAAQ,EAAE,4BAAyB;AAC5C,OAAO,EAAE,WAAW,EAAE,+BAA4B;AAClD,OAAO,EAAE,YAAY,EAAE,gCAA6B;AACpD,OAAO,EAAE,YAAY,EAAE,gCAA6B;AACpD,OAAO,EAAE,cAAc,EAAE,kCAA+B;AACxD,OAAO,EAAE,sBAAsB,EAAE,0CAAuC;AACxE,OAAO,EAAE,cAAc,EAAE,kCAA+B;AACxD,OAAO,EAAE,eAAe,EAAE,mCAAgC;AAC1D,OAAO,EAAE,eAAe,EAAE,mCAAgC;AAC1D,OAAO,EAAE,YAAY,EAAE,gCAA6B;AACpD,OAAO,EAAE,QAAQ,EAAE,4BAAyB;AAC5C,OAAO,EAAE,cAAc,EAAE,kCAA+B;AACxD,OAAO,EAAE,UAAU,EAAE,8BAA2B;AAChD,OAAO,EAAE,IAAI,EAAE,wBAAqB;AACpC,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,6BAA0B;AACpD,OAAO,EAAE,cAAc,EAAE,kCAA+B;AACxD,OAAO,EAAE,WAAW,EAAE,+BAA4B;AAClD,OAAO,EAAE,iBAAiB,EAAE,qCAAkC;AAC9D,OAAO,EAAE,YAAY,EAAE,gCAA6B;AACpD,OAAO,EAAE,UAAU,EAAE,8BAA2B;AAChD,OAAO,EAAE,OAAO,EAAE,2BAAwB;AAC1C,OAAO,EAAE,gBAAgB,EAAE,oCAAiC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,oCAAiC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,sCAAmC;AAChE,OAAO,EAAE,KAAK,EAAE,yBAAsB;AACtC,OAAO,EAAE,OAAO,EAAE,2BAAwB;AAC1C,OAAO,EAAE,OAAO,EAAE,2BAAwB;AAC1C,OAAO,EAAE,YAAY,EAAE,gCAA6B;AACpD,OAAO,EAAE,eAAe,EAAE,mCAAgC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,qCAAkC;AAC9D,OAAO,EAAE,QAAQ,EAAE,4BAAyB;AAC5C,OAAO,EAAE,UAAU,EAAE,8BAA2B","sourcesContent":["export { AccessRecoveryForm } from './AccessRecoveryForm/index';\nexport { AddressCard } from './AddressCard/index';\nexport { AddressForm } from './AddressForm/index';\nexport { AppliedTaxCard } from './AppliedTaxCard/index';\nexport { AttributeCard } from './AttributeCard/index';\nexport { AttributeForm } from './AttributeForm/index';\nexport { CancellationForm } from './CancellationForm/index';\nexport { CollectionPage } from './CollectionPage/index';\nexport { CollectionPages } from './CollectionPages/index';\nexport { Customer } from './Customer/index';\nexport { CustomerApi } from './CustomerApi/index';\nexport { CustomerCard } from './CustomerCard/index';\nexport { CustomerForm } from './CustomerForm/index';\nexport { CustomerPortal } from './CustomerPortal/index';\nexport { CustomerPortalSettings } from './CustomerPortalSettings/index';\nexport { CustomersTable } from './CustomersTable/index';\nexport { CustomFieldCard } from './CustomFieldCard/index';\nexport { CustomFieldForm } from './CustomFieldForm/index';\nexport { DiscountCard } from './DiscountCard/index';\nexport { Donation } from './Donation/index';\nexport { ErrorEntryCard } from './ErrorEntryCard/index';\nexport { FormDialog } from './FormDialog/index';\nexport { I18n } from './I18n/index';\nexport { ItemsForm, Item } from './ItemsForm/index';\nexport { NucleonElement } from './NucleonElement/index';\nexport { PaymentCard } from './PaymentCard/index';\nexport { PaymentMethodCard } from './PaymentMethodCard/index';\nexport { QueryBuilder } from './QueryBuilder/index';\nexport { SignInForm } from './SignInForm/index';\nexport { Spinner } from './Spinner/index';\nexport { SubscriptionCard } from './SubscriptionCard/index';\nexport { SubscriptionForm } from './SubscriptionForm/index';\nexport { SubscriptionsTable } from './SubscriptionsTable/index';\nexport { Table } from './Table/index';\nexport { TaxCard } from './TaxCard/index';\nexport { TaxForm } from './TaxForm/index';\nexport { TemplateForm } from './TemplateForm/index';\nexport { TransactionCard } from './TransactionCard/index';\nexport { TransactionsTable } from './TransactionsTable/index';\nexport { UserForm } from './UserForm/index';\nexport { UsersTable } from './UsersTable/index';\n"]}
1
+ {"version":3,"file":"index.defined.js","sourceRoot":"","sources":["../../../src/elements/public/index.defined.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,sCAAmC;AAChE,OAAO,EAAE,WAAW,EAAE,+BAA4B;AAClD,OAAO,EAAE,WAAW,EAAE,+BAA4B;AAClD,OAAO,EAAE,cAAc,EAAE,kCAA+B;AACxD,OAAO,EAAE,aAAa,EAAE,iCAA8B;AACtD,OAAO,EAAE,aAAa,EAAE,iCAA8B;AACtD,OAAO,EAAE,gBAAgB,EAAE,oCAAiC;AAC5D,OAAO,EAAE,cAAc,EAAE,kCAA+B;AACxD,OAAO,EAAE,eAAe,E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eAAe,EAAE,mCAAgC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,qCAAkC;AAC9D,OAAO,EAAE,QAAQ,EAAE,4BAAyB;AAC5C,OAAO,EAAE,UAAU,EAAE,8BAA2B","sourcesContent":["export { AccessRecoveryForm } from './AccessRecoveryForm/index';\nexport { AddressCard } from './AddressCard/index';\nexport { AddressForm } from './AddressForm/index';\nexport { AppliedTaxCard } from './AppliedTaxCard/index';\nexport { AttributeCard } from './AttributeCard/index';\nexport { AttributeForm } from './AttributeForm/index';\nexport { CancellationForm } from './CancellationForm/index';\nexport { CollectionPage } from './CollectionPage/index';\nexport { CollectionPages } from './CollectionPages/index';\nexport { Customer } from './Customer/index';\nexport { CustomerApi } from './CustomerApi/index';\nexport { CustomerCard } from './CustomerCard/index';\nexport { CustomerForm } from './CustomerForm/index';\nexport { CustomerPortal } from './CustomerPortal/index';\nexport { CustomerPortalSettings } from './CustomerPortalSettings/index';\nexport { CustomersTable } from './CustomersTable/index';\nexport { CustomFieldCard } from './CustomFieldCard/index';\nexport { CustomFieldForm } from './CustomFieldForm/index';\nexport { DiscountCard } from './DiscountCard/index';\nexport { Donation } from './Donation/index';\nexport { EmailTemplateForm } from './EmailTemplateForm/index';\nexport { ErrorEntryCard } from './ErrorEntryCard/index';\nexport { FormDialog } from './FormDialog/index';\nexport { I18n } from './I18n/index';\nexport { ItemsForm, Item } from './ItemsForm/index';\nexport { NucleonElement } from './NucleonElement/index';\nexport { PaymentCard } from './PaymentCard/index';\nexport { PaymentMethodCard } from './PaymentMethodCard/index';\nexport { QueryBuilder } from './QueryBuilder/index';\nexport { SignInForm } from './SignInForm/index';\nexport { Spinner } from './Spinner/index';\nexport { SubscriptionCard } from './SubscriptionCard/index';\nexport { SubscriptionForm } from './SubscriptionForm/index';\nexport { SubscriptionsTable } from './SubscriptionsTable/index';\nexport { Table } from './Table/index';\nexport { TaxCard } from './TaxCard/index';\nexport { TaxForm } from './TaxForm/index';\nexport { TemplateConfigForm } from './TemplateConfigForm/index';\nexport { TemplateForm } from './TemplateForm/index';\nexport { TransactionCard } from './TransactionCard/index';\nexport { TransactionsTable } from './TransactionsTable/index';\nexport { UserForm } from './UserForm/index';\nexport { UsersTable } from './UsersTable/index';\n"]}
@@ -18,6 +18,7 @@ export { CustomFieldCard } from "./CustomFieldCard/CustomFieldCard.js";
18
18
  export { CustomFieldForm } from "./CustomFieldForm/CustomFieldForm.js";
19
19
  export { DiscountCard } from "./DiscountCard/DiscountCard.js";
20
20
  export { Donation } from "./Donation/Donation.js";
21
+ export { EmailTemplateForm } from "./EmailTemplateForm/EmailTemplateForm.js";
21
22
  export { ErrorEntryCard } from "./ErrorEntryCard/ErrorEntryCard.js";
22
23
  export { FormDialog } from "./FormDialog/FormDialog.js";
23
24
  export { I18n } from "./I18n/I18n.js";
@@ -35,6 +36,7 @@ export { Table } from "./Table/Table.js";
35
36
  export { TaxCard } from "./TaxCard/TaxCard.js";
36
37
  export { TaxForm } from "./TaxForm/TaxForm.js";
37
38
  export { TemplateForm } from "./TemplateForm/TemplateForm.js";
39
+ export { TemplateConfigForm } from "./TemplateConfigForm/TemplateConfigForm.js";
38
40
  export { TransactionCard } from "./TransactionCard/TransactionCard.js";
39
41
  export { TransactionsTable } from "./TransactionsTable/TransactionsTable.js";
40
42
  export { UserForm } from "./UserForm/UserForm.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/elements/public/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,mDAAgD;AAC7E,OAAO,EAAE,WAAW,EAAE,qCAAkC;AACxD,OAAO,EAAE,WAAW,EAAE,qCAAkC;AACxD,OAAO,EAAE,cAAc,EAAE,2CAAwC;AACjE,OAAO,EAAE,aAAa,EAAE,yCAAsC;AAC9D,OAAO,EAAE,aAAa,EAAE,yCAAsC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,+CAA4C;AACvE,OAAO,EAAE,cAAc,EAAE,2CAAwC;AACjE,OA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1E,OAAO,EAAE,QAAQ,EAAE,+BAA4B;AAC/C,OAAO,EAAE,UAAU,EAAE,mCAAgC","sourcesContent":["export { AccessRecoveryForm } from './AccessRecoveryForm/AccessRecoveryForm';\nexport { AddressCard } from './AddressCard/AddressCard';\nexport { AddressForm } from './AddressForm/AddressForm';\nexport { AppliedTaxCard } from './AppliedTaxCard/AppliedTaxCard';\nexport { AttributeCard } from './AttributeCard/AttributeCard';\nexport { AttributeForm } from './AttributeForm/AttributeForm';\nexport { CancellationForm } from './CancellationForm/CancellationForm';\nexport { CollectionPage } from './CollectionPage/CollectionPage';\nexport { CollectionPages } from './CollectionPages/CollectionPages';\nexport { Customer } from './Customer/Customer';\nexport { CustomerApi } from './CustomerApi/CustomerApi';\nexport { CustomerCard } from './CustomerCard/CustomerCard';\nexport { CustomerForm } from './CustomerForm/CustomerForm';\nexport { CustomerPortal } from './CustomerPortal/CustomerPortal';\nexport { CustomerPortalSettings } from './CustomerPortalSettings/CustomerPortalSettings';\nexport { CustomersTable } from './CustomersTable/CustomersTable';\nexport { CustomFieldCard } from './CustomFieldCard/CustomFieldCard';\nexport { CustomFieldForm } from './CustomFieldForm/CustomFieldForm';\nexport { DiscountCard } from './DiscountCard/DiscountCard';\nexport { Donation } from './Donation/Donation';\nexport { ErrorEntryCard } from './ErrorEntryCard/ErrorEntryCard';\nexport { FormDialog } from './FormDialog/FormDialog';\nexport { I18n } from './I18n/I18n';\nexport { ItemsForm, Item } from './ItemsForm/ItemsForm';\nexport { NucleonElement } from './NucleonElement/NucleonElement';\nexport { PaymentCard } from './PaymentCard/PaymentCard';\nexport { PaymentMethodCard } from './PaymentMethodCard/PaymentMethodCard';\nexport { QueryBuilder } from './QueryBuilder/QueryBuilder';\nexport { SignInForm } from './SignInForm/SignInForm';\nexport { Spinner } from './Spinner/Spinner';\nexport { SubscriptionCard } from './SubscriptionCard/SubscriptionCard';\nexport { SubscriptionForm } from './SubscriptionForm/SubscriptionForm';\nexport { SubscriptionsTable } from './SubscriptionsTable/SubscriptionsTable';\nexport { Table } from './Table/Table';\nexport { TaxCard } from './TaxCard/TaxCard';\nexport { TaxForm } from './TaxForm/TaxForm';\nexport { TemplateForm } from './TemplateForm/TemplateForm';\nexport { TransactionCard } from './TransactionCard/TransactionCard';\nexport { TransactionsTable } from './TransactionsTable/TransactionsTable';\nexport { UserForm } from './UserForm/UserForm';\nexport { UsersTable } from './UsersTable/UsersTable';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/elements/public/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,mDAAgD;AAC7E,OAAO,EAAE,WAAW,EAAE,qCAAkC;AACxD,OAAO,EAAE,WAAW,EAAE,qCAAkC;AACxD,OAAO,EAAE,cAAc,EAAE,2CAAwC;AACjE,OAAO,EAAE,aAAa,EAAE,yCAAsC;AAC9D,OAAO,EAAE,aAAa,EAAE,yCAAsC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,+CAA4C;AACvE,OAAO,EAAE,cAAc,EAAE,2CAAwC;AACjE,OAAO,EAAE,eAAe,EAAE,6CAA0C;AACpE,OAAO,EAAE,QAAQ,EAAE,+BAA4B;AAC/C,OAAO,EAAE,WAAW,EAAE,qCAAkC;AACxD,OAAO,EAAE,YAAY,EAAE,uCAAoC;AAC3D,OAAO,EAAE,YAAY,EAAE,uCAAoC;AAC3D,OAAO,EAAE,cAAc,EAAE,2CAAwC;AACjE,OAAO,EAAE,sBAAsB,EAAE,2DAAwD;AACzF,OAAO,EAAE,cAAc,EAAE,2CAAwC;AACjE,OAAO,EAAE,eAAe,EAAE,6CAA0C;AACpE,OAAO,EAAE,eAAe,EAAE,6CAA0C;AACpE,OAAO,EAAE,YAAY,EAAE,uCAAoC;AAC3D,OAAO,EAAE,QAAQ,EAAE,+BAA4B;AAC/C,OAAO,EAAE,iBAAiB,EAAE,iDAA8C;AAC1E,OAAO,EAAE,cAAc,EAAE,2CAAwC;AACjE,OAAO,EAAE,UAAU,EAAE,mCAAgC;AACrD,OAAO,EAAE,IAAI,EAAE,uBAAoB;AACnC,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,iCAA8B;AACxD,OAAO,EAAE,cAAc,EAAE,2CAAwC;AACjE,OAAO,EAAE,WAAW,EAAE,qCAAkC;AACxD,OAAO,EAAE,iBAAiB,EAAE,iDAA8C;AAC1E,OAAO,EAAE,YAAY,EAAE,uCAAoC;AAC3D,OAAO,EAAE,UAAU,EAAE,mCAAgC;AACrD,OAAO,EAAE,OAAO,EAAE,6BAA0B;AAC5C,OAAO,EAAE,gBAAgB,EAAE,+CAA4C;AACvE,OAAO,EAAE,gBAAgB,EAAE,+CAA4C;AACvE,OAAO,EAAE,kBAAkB,EAAE,mDAAgD;AAC7E,OAAO,EAAE,KAAK,EAAE,yBAAsB;AACtC,OAAO,EAAE,OAAO,EAAE,6BAA0B;AAC5C,OAAO,EAAE,OAAO,EAAE,6BAA0B;AAC5C,OAAO,EAAE,YAAY,EAAE,uCAAoC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,mDAAgD;AAC7E,OAAO,EAAE,eAAe,EAAE,6CAA0C;AACpE,OAAO,EAAE,iBAAiB,EAAE,iDAA8C;AAC1E,OAAO,EAAE,QAAQ,EAAE,+BAA4B;AAC/C,OAAO,EAAE,UAAU,EAAE,mCAAgC","sourcesContent":["export { AccessRecoveryForm } from './AccessRecoveryForm/AccessRecoveryForm';\nexport { AddressCard } from './AddressCard/AddressCard';\nexport { AddressForm } from './AddressForm/AddressForm';\nexport { AppliedTaxCard } from './AppliedTaxCard/AppliedTaxCard';\nexport { AttributeCard } from './AttributeCard/AttributeCard';\nexport { AttributeForm } from './AttributeForm/AttributeForm';\nexport { CancellationForm } from './CancellationForm/CancellationForm';\nexport { CollectionPage } from './CollectionPage/CollectionPage';\nexport { CollectionPages } from './CollectionPages/CollectionPages';\nexport { Customer } from './Customer/Customer';\nexport { CustomerApi } from './CustomerApi/CustomerApi';\nexport { CustomerCard } from './CustomerCard/CustomerCard';\nexport { CustomerForm } from './CustomerForm/CustomerForm';\nexport { CustomerPortal } from './CustomerPortal/CustomerPortal';\nexport { CustomerPortalSettings } from './CustomerPortalSettings/CustomerPortalSettings';\nexport { CustomersTable } from './CustomersTable/CustomersTable';\nexport { CustomFieldCard } from './CustomFieldCard/CustomFieldCard';\nexport { CustomFieldForm } from './CustomFieldForm/CustomFieldForm';\nexport { DiscountCard } from './DiscountCard/DiscountCard';\nexport { Donation } from './Donation/Donation';\nexport { EmailTemplateForm } from './EmailTemplateForm/EmailTemplateForm';\nexport { ErrorEntryCard } from './ErrorEntryCard/ErrorEntryCard';\nexport { FormDialog } from './FormDialog/FormDialog';\nexport { I18n } from './I18n/I18n';\nexport { ItemsForm, Item } from './ItemsForm/ItemsForm';\nexport { NucleonElement } from './NucleonElement/NucleonElement';\nexport { PaymentCard } from './PaymentCard/PaymentCard';\nexport { PaymentMethodCard } from './PaymentMethodCard/PaymentMethodCard';\nexport { QueryBuilder } from './QueryBuilder/QueryBuilder';\nexport { SignInForm } from './SignInForm/SignInForm';\nexport { Spinner } from './Spinner/Spinner';\nexport { SubscriptionCard } from './SubscriptionCard/SubscriptionCard';\nexport { SubscriptionForm } from './SubscriptionForm/SubscriptionForm';\nexport { SubscriptionsTable } from './SubscriptionsTable/SubscriptionsTable';\nexport { Table } from './Table/Table';\nexport { TaxCard } from './TaxCard/TaxCard';\nexport { TaxForm } from './TaxForm/TaxForm';\nexport { TemplateForm } from './TemplateForm/TemplateForm';\nexport { TemplateConfigForm } from './TemplateConfigForm/TemplateConfigForm';\nexport { TransactionCard } from './TransactionCard/TransactionCard';\nexport { TransactionsTable } from './TransactionsTable/TransactionsTable';\nexport { UserForm } from './UserForm/UserForm';\nexport { UsersTable } from './UsersTable/UsersTable';\n"]}