@foxy.io/elements 1.29.0-beta.2 → 1.29.0-beta.4

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 (101) hide show
  1. package/dist/cdn/foxy-address-form.js +1 -1
  2. package/dist/cdn/foxy-admin-subscription-form.js +1 -1
  3. package/dist/cdn/foxy-applied-coupon-code-form.js +1 -1
  4. package/dist/cdn/foxy-cart-form.js +2 -2
  5. package/dist/cdn/foxy-client-form.js +1 -1
  6. package/dist/cdn/foxy-coupon-code-form.js +1 -1
  7. package/dist/cdn/foxy-coupon-codes-form.js +1 -1
  8. package/dist/cdn/foxy-coupon-form.js +1 -1
  9. package/dist/cdn/foxy-customer-form.js +1 -1
  10. package/dist/cdn/foxy-customer-portal-settings-form.js +1 -1
  11. package/dist/cdn/foxy-customer-portal.js +1 -1
  12. package/dist/cdn/foxy-customer.js +1 -1
  13. package/dist/cdn/foxy-downloadable-form.js +1 -1
  14. package/dist/cdn/foxy-email-template-form.js +1 -1
  15. package/dist/cdn/foxy-filter-attribute-form.js +1 -1
  16. package/dist/cdn/foxy-generate-codes-form.js +1 -1
  17. package/dist/cdn/foxy-gift-card-code-form.js +1 -1
  18. package/dist/cdn/foxy-gift-card-codes-form.js +1 -1
  19. package/dist/cdn/foxy-gift-card-form.js +1 -1
  20. package/dist/cdn/foxy-integration-form.js +1 -1
  21. package/dist/cdn/foxy-item-category-form.js +1 -1
  22. package/dist/cdn/foxy-item-form.js +2 -2
  23. package/dist/cdn/foxy-item-option-form.js +1 -1
  24. package/dist/cdn/foxy-native-integration-form.js +1 -1
  25. package/dist/cdn/foxy-passkey-form.js +1 -1
  26. package/dist/cdn/foxy-payments-api-fraud-protection-form.js +1 -1
  27. package/dist/cdn/foxy-payments-api-payment-method-form.js +1 -1
  28. package/dist/cdn/foxy-payments-api-payment-preset-form.js +1 -1
  29. package/dist/cdn/foxy-store-form.js +1 -1
  30. package/dist/cdn/foxy-store-shipping-method-form.js +1 -1
  31. package/dist/cdn/foxy-subscription-form.js +1 -1
  32. package/dist/cdn/foxy-subscription-settings-form.js +1 -1
  33. package/dist/cdn/foxy-template-set-form.js +1 -1
  34. package/dist/cdn/foxy-transaction.js +1 -1
  35. package/dist/cdn/foxy-user-form.js +1 -1
  36. package/dist/cdn/foxy-users-table.js +1 -1
  37. package/dist/cdn/foxy-webhook-form.js +1 -1
  38. package/dist/cdn/shared-3ea78c8d.js +1 -0
  39. package/dist/cdn/shared-a8170f94.js +1 -0
  40. package/dist/cdn/shared-cdf20ded.js +1 -0
  41. package/dist/cdn/shared-d393bcd8.js +1 -0
  42. package/dist/cdn/shared-e96c5384.js +1 -0
  43. package/dist/cdn/shared-f07d15d6.js +1 -0
  44. package/dist/cdn/{shared-70a5fad6.js → shared-f8723f3f.js} +1 -1
  45. package/dist/cdn/translations/item-category-form/en.json +181 -148
  46. package/dist/cdn/translations/subscription-settings-form/en.json +85 -61
  47. package/dist/elements/internal/InternalEditableListControl/InternalEditableListControl.d.ts +1 -0
  48. package/dist/elements/internal/InternalEditableListControl/InternalEditableListControl.js +39 -18
  49. package/dist/elements/internal/InternalEditableListControl/InternalEditableListControl.js.map +1 -1
  50. package/dist/elements/internal/InternalEditableListControl/index.d.ts +1 -0
  51. package/dist/elements/internal/InternalEditableListControl/index.js +1 -0
  52. package/dist/elements/internal/InternalEditableListControl/index.js.map +1 -1
  53. package/dist/elements/internal/InternalFrequencyControl/InternalFrequencyControl.js +2 -2
  54. package/dist/elements/internal/InternalFrequencyControl/InternalFrequencyControl.js.map +1 -1
  55. package/dist/elements/internal/InternalNumberControl/InternalNumberControl.d.ts +3 -0
  56. package/dist/elements/internal/InternalNumberControl/InternalNumberControl.js +35 -12
  57. package/dist/elements/internal/InternalNumberControl/InternalNumberControl.js.map +1 -1
  58. package/dist/elements/internal/InternalSelectControl/InternalSelectControl.d.ts +2 -0
  59. package/dist/elements/internal/InternalSelectControl/InternalSelectControl.js +12 -2
  60. package/dist/elements/internal/InternalSelectControl/InternalSelectControl.js.map +1 -1
  61. package/dist/elements/internal/InternalSummaryControl/InternalSummaryControl.js +2 -2
  62. package/dist/elements/internal/InternalSummaryControl/InternalSummaryControl.js.map +1 -1
  63. package/dist/elements/internal/InternalSwitchControl/InternalSwitchControl.d.ts +1 -0
  64. package/dist/elements/internal/InternalSwitchControl/InternalSwitchControl.js +31 -9
  65. package/dist/elements/internal/InternalSwitchControl/InternalSwitchControl.js.map +1 -1
  66. package/dist/elements/internal/InternalSwitchControl/index.d.ts +1 -0
  67. package/dist/elements/internal/InternalSwitchControl/index.js +1 -0
  68. package/dist/elements/internal/InternalSwitchControl/index.js.map +1 -1
  69. package/dist/elements/internal/InternalTextControl/InternalTextControl.d.ts +2 -0
  70. package/dist/elements/internal/InternalTextControl/InternalTextControl.js +14 -3
  71. package/dist/elements/internal/InternalTextControl/InternalTextControl.js.map +1 -1
  72. package/dist/elements/public/CartForm/internal/InternalCartFormAddressSummaryItem/InternalCartFormAddressSummaryItem.js +3 -3
  73. package/dist/elements/public/CartForm/internal/InternalCartFormAddressSummaryItem/InternalCartFormAddressSummaryItem.js.map +1 -1
  74. package/dist/elements/public/ItemCategoryForm/ItemCategoryForm.d.ts +1 -7
  75. package/dist/elements/public/ItemCategoryForm/ItemCategoryForm.js +109 -135
  76. package/dist/elements/public/ItemCategoryForm/ItemCategoryForm.js.map +1 -1
  77. package/dist/elements/public/ItemCategoryForm/index.d.ts +4 -3
  78. package/dist/elements/public/ItemCategoryForm/index.js +4 -3
  79. package/dist/elements/public/ItemCategoryForm/index.js.map +1 -1
  80. package/dist/elements/public/SubscriptionSettingsForm/SubscriptionSettingsForm.d.ts +4 -13
  81. package/dist/elements/public/SubscriptionSettingsForm/SubscriptionSettingsForm.js +105 -115
  82. package/dist/elements/public/SubscriptionSettingsForm/SubscriptionSettingsForm.js.map +1 -1
  83. package/dist/elements/public/SubscriptionSettingsForm/index.d.ts +4 -4
  84. package/dist/elements/public/SubscriptionSettingsForm/index.js +4 -4
  85. package/dist/elements/public/SubscriptionSettingsForm/index.js.map +1 -1
  86. package/dist/elements/public/SubscriptionSettingsForm/types.d.ts +3 -1
  87. package/dist/elements/public/SubscriptionSettingsForm/types.js.map +1 -1
  88. package/package.json +1 -1
  89. package/dist/cdn/shared-292ba15e.js +0 -1
  90. package/dist/cdn/shared-6e355777.js +0 -1
  91. package/dist/cdn/shared-aefac46b.js +0 -1
  92. package/dist/cdn/shared-d4810405.js +0 -1
  93. package/dist/elements/public/SubscriptionSettingsForm/internal/InternalSubscriptionSettingsFormReattemptBypass/InternalSubscriptionSettingsFormReattemptBypass.d.ts +0 -12
  94. package/dist/elements/public/SubscriptionSettingsForm/internal/InternalSubscriptionSettingsFormReattemptBypass/InternalSubscriptionSettingsFormReattemptBypass.js +0 -128
  95. package/dist/elements/public/SubscriptionSettingsForm/internal/InternalSubscriptionSettingsFormReattemptBypass/InternalSubscriptionSettingsFormReattemptBypass.js.map +0 -1
  96. package/dist/elements/public/SubscriptionSettingsForm/internal/InternalSubscriptionSettingsFormReattemptBypass/globalStyles.d.ts +0 -2
  97. package/dist/elements/public/SubscriptionSettingsForm/internal/InternalSubscriptionSettingsFormReattemptBypass/globalStyles.js +0 -26
  98. package/dist/elements/public/SubscriptionSettingsForm/internal/InternalSubscriptionSettingsFormReattemptBypass/globalStyles.js.map +0 -1
  99. package/dist/elements/public/SubscriptionSettingsForm/internal/InternalSubscriptionSettingsFormReattemptBypass/index.d.ts +0 -7
  100. package/dist/elements/public/SubscriptionSettingsForm/internal/InternalSubscriptionSettingsFormReattemptBypass/index.js +0 -13
  101. package/dist/elements/public/SubscriptionSettingsForm/internal/InternalSubscriptionSettingsFormReattemptBypass/index.js.map +0 -1
@@ -13,34 +13,15 @@ const Base = TranslatableMixin(InternalForm, NS);
13
13
  export class SubscriptionSettingsForm extends Base {
14
14
  constructor() {
15
15
  super(...arguments);
16
- this.__sendEmailReceiptsForAutomatedBillingOptions = [
17
- { label: 'option_checked', value: 'checked' },
18
- ];
19
- this.__automaticallyChargePastDueAmountOptions = [
20
- { label: 'option_checked', value: 'checked' },
21
- ];
22
- this.__clearPastDueAmountsOnSuccessOptions = [
23
- { label: 'option_checked', value: 'checked' },
24
- ];
25
- this.__resetNextDateOnMakeUpPaymentOptions = [
26
- { label: 'option_checked', value: 'checked' },
27
- ];
28
16
  this.__pastDueAmountHandlingOptions = [
29
17
  { label: 'option_increment', value: 'increment' },
30
18
  { label: 'option_replace', value: 'replace' },
31
- { label: 'option_ignore', value: 'ignore' },
32
19
  ];
33
20
  this.__positiveIntegerInputParams = {
34
21
  type: 'number',
35
22
  step: '1',
36
23
  min: '0',
37
24
  };
38
- this.__sendEmailReceiptsForAutomatedBillingGetValue = () => {
39
- return this.form.send_email_receipts_for_automated_billing ? ['checked'] : [];
40
- };
41
- this.__sendEmailReceiptsForAutomatedBillingSetValue = (newValue) => {
42
- this.edit({ send_email_receipts_for_automated_billing: newValue.includes('checked') });
43
- };
44
25
  this.__expiringSoonPaymentReminderScheduleGetValue = () => {
45
26
  var _a, _b;
46
27
  const days = (_b = (_a = this.form.expiring_soon_payment_reminder_schedule) === null || _a === void 0 ? void 0 : _a.split(',')) !== null && _b !== void 0 ? _b : [];
@@ -55,29 +36,6 @@ export class SubscriptionSettingsForm extends Base {
55
36
  expiring_soon_payment_reminder_schedule: newItems.map(({ value }) => value).join(),
56
37
  });
57
38
  };
58
- this.__automaticallyChargePastDueAmountGetValue = () => {
59
- return this.form.automatically_charge_past_due_amount ? ['checked'] : [];
60
- };
61
- this.__automaticallyChargePastDueAmountSetValue = (newValue) => {
62
- const isChecked = newValue.includes('checked');
63
- this.edit({
64
- automatically_charge_past_due_amount: isChecked,
65
- clear_past_due_amounts_on_success: isChecked ? false : void 0,
66
- reset_nextdate_on_makeup_payment: isChecked ? false : void 0,
67
- });
68
- };
69
- this.__clearPastDueAmountsOnSuccessGetValue = () => {
70
- return this.form.clear_past_due_amounts_on_success ? ['checked'] : [];
71
- };
72
- this.__clearPastDueAmountsOnSuccessSetValue = (newValue) => {
73
- this.edit({ clear_past_due_amounts_on_success: newValue.includes('checked') });
74
- };
75
- this.__resetNextDateOnMakeUpPaymentGetValue = () => {
76
- return this.form.reset_nextdate_on_makeup_payment ? ['checked'] : [];
77
- };
78
- this.__resetNextDateOnMakeUpPaymentSetValue = (newValue) => {
79
- this.edit({ reset_nextdate_on_makeup_payment: newValue.includes('checked') });
80
- };
81
39
  this.__reminderEmailScheduleGetValue = () => {
82
40
  var _a, _b;
83
41
  const days = (_b = (_a = this.form.reminder_email_schedule) === null || _a === void 0 ? void 0 : _a.split(',')) !== null && _b !== void 0 ? _b : [];
@@ -102,6 +60,22 @@ export class SubscriptionSettingsForm extends Base {
102
60
  this.__reattemptScheduleSetValue = (newItems) => {
103
61
  this.edit({ reattempt_schedule: newItems.map(({ value }) => value).join() });
104
62
  };
63
+ this.__getReattemptBypassStringsValue = () => {
64
+ var _a, _b;
65
+ const strings = (_b = (_a = this.form.reattempt_bypass_strings) === null || _a === void 0 ? void 0 : _a.split(',')) !== null && _b !== void 0 ? _b : [];
66
+ return strings
67
+ .map(text => text.trim())
68
+ .filter((text, index, strings) => text && strings.indexOf(text) === index)
69
+ .map(text => ({ value: text }));
70
+ };
71
+ this.__setReattemptBypassStringsValue = (newValue) => {
72
+ this.edit({ reattempt_bypass_strings: newValue.map(({ value }) => value).join() });
73
+ };
74
+ this.__reattemptBypassLogicOptions = [
75
+ { value: '', label: 'option_always_reattempt' },
76
+ { value: 'skip_if_exists', label: 'option_skip_if_exists' },
77
+ { value: 'reattempt_if_exists', label: 'option_reattempt_if_exists' },
78
+ ];
105
79
  }
106
80
  static get v8n() {
107
81
  return [
@@ -120,94 +94,110 @@ export class SubscriptionSettingsForm extends Base {
120
94
  ];
121
95
  }
122
96
  get hiddenSelector() {
123
- return new BooleanSelector(`header:copy-id ${super.hiddenSelector}`.trim());
97
+ const alwaysMatch = ['header:copy-id', super.hiddenSelector.toString()];
98
+ if (!this.form.reattempt_bypass_logic) {
99
+ alwaysMatch.push('reattempts-group:reattempt-bypass-strings');
100
+ }
101
+ return new BooleanSelector(alwaysMatch.join(' ').trim());
124
102
  }
125
103
  renderBody() {
126
104
  return html `
127
105
  ${this.renderHeader()}
128
106
 
129
- <foxy-internal-radio-group-control
130
- infer="past-due-amount-handling"
131
- theme="vertical list"
132
- .options=${this.__pastDueAmountHandlingOptions}
133
- >
134
- </foxy-internal-radio-group-control>
107
+ <foxy-internal-summary-control infer="past-due-amount-group">
108
+ <foxy-internal-select-control
109
+ layout="summary-item"
110
+ infer="past-due-amount-handling"
111
+ .options=${this.__pastDueAmountHandlingOptions}
112
+ >
113
+ </foxy-internal-select-control>
114
+
115
+ <foxy-internal-switch-control
116
+ infer="automatically-charge-past-due-amount"
117
+ helper-text-as-tooltip
118
+ >
119
+ </foxy-internal-switch-control>
135
120
 
136
- <foxy-internal-checkbox-group-control
137
- infer="automatically-charge-past-due-amount"
138
- class="-mt-xs -mb-m"
139
- .getValue=${this.__automaticallyChargePastDueAmountGetValue}
140
- .setValue=${this.__automaticallyChargePastDueAmountSetValue}
141
- .options=${this.__automaticallyChargePastDueAmountOptions}
142
- >
143
- </foxy-internal-checkbox-group-control>
121
+ <foxy-internal-switch-control
122
+ infer="reset-nextdate-on-makeup-payment"
123
+ helper-text-as-tooltip
124
+ >
125
+ </foxy-internal-switch-control>
144
126
 
145
- ${this.form.automatically_charge_past_due_amount
146
- ? ''
147
- : html `
148
- <foxy-internal-checkbox-group-control
149
- infer="clear-past-due-amounts-on-success"
150
- class="-mt-xs -mb-m"
151
- .getValue=${this.__clearPastDueAmountsOnSuccessGetValue}
152
- .setValue=${this.__clearPastDueAmountsOnSuccessSetValue}
153
- .options=${this.__clearPastDueAmountsOnSuccessOptions}
154
- >
155
- </foxy-internal-checkbox-group-control>
127
+ <foxy-internal-switch-control
128
+ infer="prevent-customer-cancel-with-past-due"
129
+ helper-text-as-tooltip
130
+ >
131
+ </foxy-internal-switch-control>
132
+ </foxy-internal-summary-control>
156
133
 
157
- <foxy-internal-checkbox-group-control
158
- infer="reset-nextdate-on-makeup-payment"
159
- class="-mt-xs -mb-m"
160
- .getValue=${this.__resetNextDateOnMakeUpPaymentGetValue}
161
- .setValue=${this.__resetNextDateOnMakeUpPaymentSetValue}
162
- .options=${this.__resetNextDateOnMakeUpPaymentOptions}
163
- >
164
- </foxy-internal-checkbox-group-control>
165
- `}
134
+ <foxy-internal-summary-control infer="reattempts-group">
135
+ <foxy-internal-select-control
136
+ layout="summary-item"
137
+ infer="reattempt-bypass-logic"
138
+ .options=${this.__reattemptBypassLogicOptions}
139
+ >
140
+ </foxy-internal-select-control>
166
141
 
167
- <foxy-internal-subscription-settings-form-reattempt-bypass infer="reattempt-bypass">
168
- </foxy-internal-subscription-settings-form-reattempt-bypass>
142
+ <foxy-internal-editable-list-control
143
+ layout="summary-item"
144
+ infer="reattempt-bypass-strings"
145
+ .getValue=${this.__getReattemptBypassStringsValue}
146
+ .setValue=${this.__setReattemptBypassStringsValue}
147
+ >
148
+ </foxy-internal-editable-list-control>
169
149
 
170
- <foxy-internal-editable-list-control
171
- infer="reattempt-schedule"
172
- .inputParams=${this.__positiveIntegerInputParams}
173
- .getValue=${this.__reattemptScheduleGetValue}
174
- .setValue=${this.__reattemptScheduleSetValue}
175
- >
176
- </foxy-internal-editable-list-control>
150
+ <foxy-internal-editable-list-control
151
+ layout="summary-item"
152
+ infer="reattempt-schedule"
153
+ .inputParams=${this.__positiveIntegerInputParams}
154
+ .getValue=${this.__reattemptScheduleGetValue}
155
+ .setValue=${this.__reattemptScheduleSetValue}
156
+ >
157
+ </foxy-internal-editable-list-control>
158
+ </foxy-internal-summary-control>
177
159
 
178
- <foxy-internal-editable-list-control
179
- infer="reminder-email-schedule"
180
- .inputParams=${this.__positiveIntegerInputParams}
181
- .getValue=${this.__reminderEmailScheduleGetValue}
182
- .setValue=${this.__reminderEmailScheduleSetValue}
183
- >
184
- </foxy-internal-editable-list-control>
160
+ <foxy-internal-summary-control infer="emails-group">
161
+ <foxy-internal-switch-control
162
+ infer="send-email-receipts-for-automated-billing"
163
+ helper-text-as-tooltip
164
+ >
165
+ </foxy-internal-switch-control>
185
166
 
186
- <foxy-internal-editable-list-control
187
- infer="expiring-soon-payment-reminder-schedule"
188
- .inputParams=${this.__positiveIntegerInputParams}
189
- .getValue=${this.__expiringSoonPaymentReminderScheduleGetValue}
190
- .setValue=${this.__expiringSoonPaymentReminderScheduleSetValue}
191
- >
192
- </foxy-internal-editable-list-control>
167
+ <foxy-internal-editable-list-control
168
+ layout="summary-item"
169
+ infer="reminder-email-schedule"
170
+ .inputParams=${this.__positiveIntegerInputParams}
171
+ .getValue=${this.__reminderEmailScheduleGetValue}
172
+ .setValue=${this.__reminderEmailScheduleSetValue}
173
+ >
174
+ </foxy-internal-editable-list-control>
193
175
 
194
- <foxy-internal-checkbox-group-control
195
- infer="send-email-receipts-for-automated-billing"
196
- class="-mt-xs -mb-m"
197
- .options=${this.__sendEmailReceiptsForAutomatedBillingOptions}
198
- .getValue=${this.__sendEmailReceiptsForAutomatedBillingGetValue}
199
- .setValue=${this.__sendEmailReceiptsForAutomatedBillingSetValue}
200
- >
201
- </foxy-internal-checkbox-group-control>
176
+ <foxy-internal-editable-list-control
177
+ layout="summary-item"
178
+ infer="expiring-soon-payment-reminder-schedule"
179
+ .inputParams=${this.__positiveIntegerInputParams}
180
+ .getValue=${this.__expiringSoonPaymentReminderScheduleGetValue}
181
+ .setValue=${this.__expiringSoonPaymentReminderScheduleSetValue}
182
+ >
183
+ </foxy-internal-editable-list-control>
184
+ </foxy-internal-summary-control>
202
185
 
203
- <foxy-internal-integer-control
204
- suffix=${this.__cancellationScheduleSuffix}
205
- infer="cancellation-schedule"
206
- min="1"
207
- >
208
- </foxy-internal-integer-control>
186
+ <foxy-internal-summary-control infer="modification-group">
187
+ <foxy-internal-text-control layout="summary-item" infer="modification-url">
188
+ </foxy-internal-text-control>
189
+ </foxy-internal-summary-control>
209
190
 
210
- <foxy-internal-text-control infer="modification-url"></foxy-internal-text-control>
191
+ <foxy-internal-summary-control infer="cancellation-group">
192
+ <foxy-internal-number-control
193
+ layout="summary-item"
194
+ suffix=${this.__cancellationScheduleSuffix}
195
+ infer="cancellation-schedule"
196
+ step="1"
197
+ min="1"
198
+ >
199
+ </foxy-internal-number-control>
200
+ </foxy-internal-summary-control>
211
201
 
212
202
  ${super.renderBody()}
213
203
  `;
@@ -1 +1 @@
1
- {"version":3,"file":"SubscriptionSettingsForm.js","sourceRoot":"","sources":["../../../../src/elements/public/SubscriptionSettingsForm/SubscriptionSettingsForm.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,iBAAiB,EAAE,wCAAqC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,oDAAiD;AACxE,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEhC,MAAM,EAAE,GAAG,4BAA4B,CAAC;AACxC,MAAM,IAAI,GAAG,iBAAiB,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;AAEjD;;;;;GAKG;AACH,MAAM,OAAO,wBAAyB,SAAQ,IAAU;IAAxD;;QAkBU,kDAA6C,GAAa;YAChE,EAAE,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,SAAS,EAAE;SAC9C,CAAC;QAEM,8CAAyC,GAAa;YAC5D,EAAE,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,SAAS,EAAE;SAC9C,CAAC;QAEM,0CAAqC,GAAa;YACxD,EAAE,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,SAAS,EAAE;SAC9C,CAAC;QAEM,0CAAqC,GAAa;YACxD,EAAE,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,SAAS,EAAE;SAC9C,CAAC;QAEM,mCAA8B,GAAa;YACjD,EAAE,KAAK,EAAE,kBAAkB,EAAE,KAAK,EAAE,WAAW,EAAE;YACjD,EAAE,KAAK,EAAE,gBAAgB,EAAE,KAAK,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C,8CAA8C;;;;;iBAKtD,IAAI,CAAC,4BAA4B;;;;;;;;QAQ1C,KAAK,CAAC,UAAU,EAAE;KACrB,CAAC;IACJ,CAAC;IAED,IAAY,4BAA4B;QACtC,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC;QACjD,OAAO,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,YAAY,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACnE,CAAC;CACF","sourcesContent":["import type { Data } from './types';\nimport type { TemplateResult } from 'lit-html';\nimport type { NucleonV8N } from '../NucleonElement/types';\nimport type { Option } from '../../internal/InternalCheckboxGroupControl/types';\nimport type { Item } from '../../internal/InternalEditableListControl/types';\n\nimport { TranslatableMixin } from '../../../mixins/translatable';\nimport { BooleanSelector } from '@foxy.io/sdk/core';\nimport { InternalForm } from '../../internal/InternalForm/InternalForm';\nimport { html } from 'lit-html';\n\nconst NS = 'subscription-settings-form';\nconst Base = TranslatableMixin(InternalForm, NS);\n\n/**\n * Form element for managing `fx:subscription_settings` resources.\n *\n * @element foxy-subscription-settings-form\n * @since 1.21.0\n */\nexport class SubscriptionSettingsForm extends Base<Data> {\n static get v8n(): NucleonV8N<Data> {\n return [\n ({ expiring_soon_payment_reminder_schedule: v }) => {\n return !v || v.length <= 100 || 'expiring-soon-payment-reminder-schedule:v8n_too_long';\n },\n ({ reattempt_bypass_strings: v }) => {\n return !v || v.length <= 400 || 'reattempt-bypass-strings:v8n_too_long';\n },\n ({ reminder_email_schedule: v }) => {\n return !v || v.length <= 100 || 'reminder-email-schedule:v8n_too_long';\n },\n ({ reattempt_schedule: v }) => {\n return !v || v.length <= 100 || 'reattempt-schedule:v8n_too_long';\n },\n ];\n }\n\n private __sendEmailReceiptsForAutomatedBillingOptions: Option[] = [\n { label: 'option_checked', value: 'checked' },\n ];\n\n private __automaticallyChargePastDueAmountOptions: Option[] = [\n { label: 'option_checked', value: 'checked' },\n ];\n\n private __clearPastDueAmountsOnSuccessOptions: Option[] = [\n { label: 'option_checked', value: 'checked' },\n ];\n\n private __resetNextDateOnMakeUpPaymentOptions: Option[] = [\n { label: 'option_checked', value: 'checked' },\n ];\n\n private __pastDueAmountHandlingOptions: Option[] = [\n { label: 'option_increment', value: 'increment' },\n { label: 'option_replace', value: 'replace' },\n { label: 'option_ignore', value: 'ignore' },\n ];\n\n private __positiveIntegerInputParams = {\n type: 'number',\n step: '1',\n min: '0',\n };\n\n private __sendEmailReceiptsForAutomatedBillingGetValue = () => {\n return this.form.send_email_receipts_for_automated_billing ? ['checked'] : [];\n };\n\n private __sendEmailReceiptsForAutomatedBillingSetValue = (newValue: string[]) => {\n this.edit({ send_email_receipts_for_automated_billing: newValue.includes('checked') });\n };\n\n private __expiringSoonPaymentReminderScheduleGetValue = () => {\n const days = this.form.expiring_soon_payment_reminder_schedule?.split(',') ?? [];\n\n return days\n .map(dayAsString => parseInt(dayAsString))\n .filter((day, index, allDays) => !isNaN(day) && allDays.indexOf(day) === index)\n .sort((dayA, dayB) => dayB - dayA)\n .map(day => ({ value: String(day), label: this.t('day', { count: day }) }));\n };\n\n private __expiringSoonPaymentReminderScheduleSetValue = (newItems: Item[]) => {\n this.edit({\n expiring_soon_payment_reminder_schedule: newItems.map(({ value }) => value).join(),\n });\n };\n\n private __automaticallyChargePastDueAmountGetValue = () => {\n return this.form.automatically_charge_past_due_amount ? ['checked'] : [];\n };\n\n private __automaticallyChargePastDueAmountSetValue = (newValue: string[]) => {\n const isChecked = newValue.includes('checked');\n this.edit({\n automatically_charge_past_due_amount: isChecked,\n clear_past_due_amounts_on_success: isChecked ? false : void 0,\n reset_nextdate_on_makeup_payment: isChecked ? false : void 0,\n });\n };\n\n private __clearPastDueAmountsOnSuccessGetValue = () => {\n return this.form.clear_past_due_amounts_on_success ? ['checked'] : [];\n };\n\n private __clearPastDueAmountsOnSuccessSetValue = (newValue: string[]) => {\n this.edit({ clear_past_due_amounts_on_success: newValue.includes('checked') });\n };\n\n private __resetNextDateOnMakeUpPaymentGetValue = () => {\n return this.form.reset_nextdate_on_makeup_payment ? ['checked'] : [];\n };\n\n private __resetNextDateOnMakeUpPaymentSetValue = (newValue: string[]) => {\n this.edit({ reset_nextdate_on_makeup_payment: newValue.includes('checked') });\n };\n\n private __reminderEmailScheduleGetValue = () => {\n const days = this.form.reminder_email_schedule?.split(',') ?? [];\n\n return days\n .map(dayAsString => parseInt(dayAsString))\n .filter((day, index, allDays) => !isNaN(day) && allDays.indexOf(day) === index)\n .sort((dayA, dayB) => dayA - dayB)\n .map(day => ({ value: String(day), label: this.t('day', { count: day }) }));\n };\n\n private __reminderEmailScheduleSetValue = (newItems: Item[]) => {\n this.edit({ reminder_email_schedule: newItems.map(({ value }) => value).join() });\n };\n\n private __reattemptScheduleGetValue = () => {\n const days = this.form.reattempt_schedule?.split(',') ?? [];\n\n return days\n .map(dayAsString => parseInt(dayAsString))\n .filter((day, index, allDays) => !isNaN(day) && allDays.indexOf(day) === index)\n .sort((dayA, dayB) => dayA - dayB)\n .map(day => ({ value: String(day), label: this.t('day', { count: day }) }));\n };\n\n private __reattemptScheduleSetValue = (newItems: Item[]) => {\n this.edit({ reattempt_schedule: newItems.map(({ value }) => value).join() });\n };\n\n get hiddenSelector(): BooleanSelector {\n return new BooleanSelector(`header:copy-id ${super.hiddenSelector}`.trim());\n }\n\n renderBody(): TemplateResult {\n return html`\n ${this.renderHeader()}\n\n <foxy-internal-radio-group-control\n infer=\"past-due-amount-handling\"\n theme=\"vertical list\"\n .options=${this.__pastDueAmountHandlingOptions}\n >\n </foxy-internal-radio-group-control>\n\n <foxy-internal-checkbox-group-control\n infer=\"automatically-charge-past-due-amount\"\n class=\"-mt-xs -mb-m\"\n .getValue=${this.__automaticallyChargePastDueAmountGetValue}\n .setValue=${this.__automaticallyChargePastDueAmountSetValue}\n .options=${this.__automaticallyChargePastDueAmountOptions}\n >\n </foxy-internal-checkbox-group-control>\n\n ${this.form.automatically_charge_past_due_amount\n ? ''\n : html`\n <foxy-internal-checkbox-group-control\n infer=\"clear-past-due-amounts-on-success\"\n class=\"-mt-xs -mb-m\"\n .getValue=${this.__clearPastDueAmountsOnSuccessGetValue}\n .setValue=${this.__clearPastDueAmountsOnSuccessSetValue}\n .options=${this.__clearPastDueAmountsOnSuccessOptions}\n >\n </foxy-internal-checkbox-group-control>\n\n <foxy-internal-checkbox-group-control\n infer=\"reset-nextdate-on-makeup-payment\"\n class=\"-mt-xs -mb-m\"\n .getValue=${this.__resetNextDateOnMakeUpPaymentGetValue}\n .setValue=${this.__resetNextDateOnMakeUpPaymentSetValue}\n .options=${this.__resetNextDateOnMakeUpPaymentOptions}\n >\n </foxy-internal-checkbox-group-control>\n `}\n\n <foxy-internal-subscription-settings-form-reattempt-bypass infer=\"reattempt-bypass\">\n </foxy-internal-subscription-settings-form-reattempt-bypass>\n\n <foxy-internal-editable-list-control\n infer=\"reattempt-schedule\"\n .inputParams=${this.__positiveIntegerInputParams}\n .getValue=${this.__reattemptScheduleGetValue}\n .setValue=${this.__reattemptScheduleSetValue}\n >\n </foxy-internal-editable-list-control>\n\n <foxy-internal-editable-list-control\n infer=\"reminder-email-schedule\"\n .inputParams=${this.__positiveIntegerInputParams}\n .getValue=${this.__reminderEmailScheduleGetValue}\n .setValue=${this.__reminderEmailScheduleSetValue}\n >\n </foxy-internal-editable-list-control>\n\n <foxy-internal-editable-list-control\n infer=\"expiring-soon-payment-reminder-schedule\"\n .inputParams=${this.__positiveIntegerInputParams}\n .getValue=${this.__expiringSoonPaymentReminderScheduleGetValue}\n .setValue=${this.__expiringSoonPaymentReminderScheduleSetValue}\n >\n </foxy-internal-editable-list-control>\n\n <foxy-internal-checkbox-group-control\n infer=\"send-email-receipts-for-automated-billing\"\n class=\"-mt-xs -mb-m\"\n .options=${this.__sendEmailReceiptsForAutomatedBillingOptions}\n .getValue=${this.__sendEmailReceiptsForAutomatedBillingGetValue}\n .setValue=${this.__sendEmailReceiptsForAutomatedBillingSetValue}\n >\n </foxy-internal-checkbox-group-control>\n\n <foxy-internal-integer-control\n suffix=${this.__cancellationScheduleSuffix}\n infer=\"cancellation-schedule\"\n min=\"1\"\n >\n </foxy-internal-integer-control>\n\n <foxy-internal-text-control infer=\"modification-url\"></foxy-internal-text-control>\n\n ${super.renderBody()}\n `;\n }\n\n private get __cancellationScheduleSuffix() {\n const schedule = this.form.cancellation_schedule;\n return schedule ? this.t('day_suffix', { count: schedule }) : '';\n }\n}\n"]}
1
+ {"version":3,"file":"SubscriptionSettingsForm.js","sourceRoot":"","sources":["../../../../src/elements/public/SubscriptionSettingsForm/SubscriptionSettingsForm.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,iBAAiB,EAAE,wCAAqC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,oDAAiD;AACxE,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEhC,MAAM,EAAE,GAAG,4BAA4B,CAAC;AACxC,MAAM,IAAI,GAAG,iBAAiB,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;AAEjD;;;;;GAKG;AACH,MAAM,OAAO,wBAAyB,SAAQ,IAAU;IAAxD;;QAkBU,mCAA8B,GAAa;YACjD,EAAE,KAAK,EAAE,kBAAkB,EAAE,KAAK,EAAE,WAAW,EAAE;YACjD,EAAE,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,SAAS,EAAE;SAC9C,CAAC;QAEM,iCAA4B,GAAG;YACrC,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,GAAG;YACT,GAAG,EAAE,GAAG;SACT,CAAC;QAEM,kDAA6C,GAAG,GAAG,EAAE;;YAC3D,MAAM,IAAI,eAAG,IAAI,CAAC,IAAI,CAAC,uCAAuC,0CAAE,KAAK,CAAC,GAAG,oCAAK,EAAE,CAAC;YAEjF,OAAO,IAAI;iBACR,GAAG,CAAC,WAAW,CAAC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,IAAI,CAAC,+BAA+B;sBACpC,IAAI,CAAC,+BAA+B;;;;;;;yBAOjC,IAAI,CAAC,4BAA4B;sBACpC,IAAI,CAAC,6CAA6C;sBAClD,IAAI,CAAC,6CAA6C;;;;;;;;;;;;;mBAarD,IAAI,CAAC,4BAA4B;;;;;;;;QAQ5C,KAAK,CAAC,UAAU,EAAE;KACrB,CAAC;IACJ,CAAC;IAED,IAAY,4BAA4B;QACtC,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC;QACjD,OAAO,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,YAAY,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACnE,CAAC;CACF","sourcesContent":["import type { TemplateResult } from 'lit-html';\nimport type { NucleonV8N } from '../NucleonElement/types';\nimport type { Option } from '../../internal/InternalCheckboxGroupControl/types';\nimport type { Item } from '../../internal/InternalEditableListControl/types';\nimport type { Data } from './types';\n\nimport { TranslatableMixin } from '../../../mixins/translatable';\nimport { BooleanSelector } from '@foxy.io/sdk/core';\nimport { InternalForm } from '../../internal/InternalForm/InternalForm';\nimport { html } from 'lit-html';\n\nconst NS = 'subscription-settings-form';\nconst Base = TranslatableMixin(InternalForm, NS);\n\n/**\n * Form element for managing `fx:subscription_settings` resources.\n *\n * @element foxy-subscription-settings-form\n * @since 1.21.0\n */\nexport class SubscriptionSettingsForm extends Base<Data> {\n static get v8n(): NucleonV8N<Data> {\n return [\n ({ expiring_soon_payment_reminder_schedule: v }) => {\n return !v || v.length <= 100 || 'expiring-soon-payment-reminder-schedule:v8n_too_long';\n },\n ({ reattempt_bypass_strings: v }) => {\n return !v || v.length <= 400 || 'reattempt-bypass-strings:v8n_too_long';\n },\n ({ reminder_email_schedule: v }) => {\n return !v || v.length <= 100 || 'reminder-email-schedule:v8n_too_long';\n },\n ({ reattempt_schedule: v }) => {\n return !v || v.length <= 100 || 'reattempt-schedule:v8n_too_long';\n },\n ];\n }\n\n private __pastDueAmountHandlingOptions: Option[] = [\n { label: 'option_increment', value: 'increment' },\n { label: 'option_replace', value: 'replace' },\n ];\n\n private __positiveIntegerInputParams = {\n type: 'number',\n step: '1',\n min: '0',\n };\n\n private __expiringSoonPaymentReminderScheduleGetValue = () => {\n const days = this.form.expiring_soon_payment_reminder_schedule?.split(',') ?? [];\n\n return days\n .map(dayAsString => parseInt(dayAsString))\n .filter((day, index, allDays) => !isNaN(day) && allDays.indexOf(day) === index)\n .sort((dayA, dayB) => dayB - dayA)\n .map(day => ({ value: String(day), label: this.t('day', { count: day }) }));\n };\n\n private __expiringSoonPaymentReminderScheduleSetValue = (newItems: Item[]) => {\n this.edit({\n expiring_soon_payment_reminder_schedule: newItems.map(({ value }) => value).join(),\n });\n };\n\n private __reminderEmailScheduleGetValue = () => {\n const days = this.form.reminder_email_schedule?.split(',') ?? [];\n\n return days\n .map(dayAsString => parseInt(dayAsString))\n .filter((day, index, allDays) => !isNaN(day) && allDays.indexOf(day) === index)\n .sort((dayA, dayB) => dayA - dayB)\n .map(day => ({ value: String(day), label: this.t('day', { count: day }) }));\n };\n\n private __reminderEmailScheduleSetValue = (newItems: Item[]) => {\n this.edit({ reminder_email_schedule: newItems.map(({ value }) => value).join() });\n };\n\n private __reattemptScheduleGetValue = () => {\n const days = this.form.reattempt_schedule?.split(',') ?? [];\n\n return days\n .map(dayAsString => parseInt(dayAsString))\n .filter((day, index, allDays) => !isNaN(day) && allDays.indexOf(day) === index)\n .sort((dayA, dayB) => dayA - dayB)\n .map(day => ({ value: String(day), label: this.t('day', { count: day }) }));\n };\n\n private __reattemptScheduleSetValue = (newItems: Item[]) => {\n this.edit({ reattempt_schedule: newItems.map(({ value }) => value).join() });\n };\n\n private __getReattemptBypassStringsValue = () => {\n const strings = this.form.reattempt_bypass_strings?.split(',') ?? [];\n\n return strings\n .map(text => text.trim())\n .filter((text, index, strings) => text && strings.indexOf(text) === index)\n .map(text => ({ value: text }));\n };\n\n private __setReattemptBypassStringsValue = (newValue: Item[]) => {\n this.edit({ reattempt_bypass_strings: newValue.map(({ value }) => value).join() });\n };\n\n private __reattemptBypassLogicOptions: Option[] = [\n { value: '', label: 'option_always_reattempt' },\n { value: 'skip_if_exists', label: 'option_skip_if_exists' },\n { value: 'reattempt_if_exists', label: 'option_reattempt_if_exists' },\n ];\n\n get hiddenSelector(): BooleanSelector {\n const alwaysMatch = ['header:copy-id', super.hiddenSelector.toString()];\n\n if (!this.form.reattempt_bypass_logic) {\n alwaysMatch.push('reattempts-group:reattempt-bypass-strings');\n }\n\n return new BooleanSelector(alwaysMatch.join(' ').trim());\n }\n\n renderBody(): TemplateResult {\n return html`\n ${this.renderHeader()}\n\n <foxy-internal-summary-control infer=\"past-due-amount-group\">\n <foxy-internal-select-control\n layout=\"summary-item\"\n infer=\"past-due-amount-handling\"\n .options=${this.__pastDueAmountHandlingOptions}\n >\n </foxy-internal-select-control>\n\n <foxy-internal-switch-control\n infer=\"automatically-charge-past-due-amount\"\n helper-text-as-tooltip\n >\n </foxy-internal-switch-control>\n\n <foxy-internal-switch-control\n infer=\"reset-nextdate-on-makeup-payment\"\n helper-text-as-tooltip\n >\n </foxy-internal-switch-control>\n\n <foxy-internal-switch-control\n infer=\"prevent-customer-cancel-with-past-due\"\n helper-text-as-tooltip\n >\n </foxy-internal-switch-control>\n </foxy-internal-summary-control>\n\n <foxy-internal-summary-control infer=\"reattempts-group\">\n <foxy-internal-select-control\n layout=\"summary-item\"\n infer=\"reattempt-bypass-logic\"\n .options=${this.__reattemptBypassLogicOptions}\n >\n </foxy-internal-select-control>\n\n <foxy-internal-editable-list-control\n layout=\"summary-item\"\n infer=\"reattempt-bypass-strings\"\n .getValue=${this.__getReattemptBypassStringsValue}\n .setValue=${this.__setReattemptBypassStringsValue}\n >\n </foxy-internal-editable-list-control>\n\n <foxy-internal-editable-list-control\n layout=\"summary-item\"\n infer=\"reattempt-schedule\"\n .inputParams=${this.__positiveIntegerInputParams}\n .getValue=${this.__reattemptScheduleGetValue}\n .setValue=${this.__reattemptScheduleSetValue}\n >\n </foxy-internal-editable-list-control>\n </foxy-internal-summary-control>\n\n <foxy-internal-summary-control infer=\"emails-group\">\n <foxy-internal-switch-control\n infer=\"send-email-receipts-for-automated-billing\"\n helper-text-as-tooltip\n >\n </foxy-internal-switch-control>\n\n <foxy-internal-editable-list-control\n layout=\"summary-item\"\n infer=\"reminder-email-schedule\"\n .inputParams=${this.__positiveIntegerInputParams}\n .getValue=${this.__reminderEmailScheduleGetValue}\n .setValue=${this.__reminderEmailScheduleSetValue}\n >\n </foxy-internal-editable-list-control>\n\n <foxy-internal-editable-list-control\n layout=\"summary-item\"\n infer=\"expiring-soon-payment-reminder-schedule\"\n .inputParams=${this.__positiveIntegerInputParams}\n .getValue=${this.__expiringSoonPaymentReminderScheduleGetValue}\n .setValue=${this.__expiringSoonPaymentReminderScheduleSetValue}\n >\n </foxy-internal-editable-list-control>\n </foxy-internal-summary-control>\n\n <foxy-internal-summary-control infer=\"modification-group\">\n <foxy-internal-text-control layout=\"summary-item\" infer=\"modification-url\">\n </foxy-internal-text-control>\n </foxy-internal-summary-control>\n\n <foxy-internal-summary-control infer=\"cancellation-group\">\n <foxy-internal-number-control\n layout=\"summary-item\"\n suffix=${this.__cancellationScheduleSuffix}\n infer=\"cancellation-schedule\"\n step=\"1\"\n min=\"1\"\n >\n </foxy-internal-number-control>\n </foxy-internal-summary-control>\n\n ${super.renderBody()}\n `;\n }\n\n private get __cancellationScheduleSuffix() {\n const schedule = this.form.cancellation_schedule;\n return schedule ? this.t('day_suffix', { count: schedule }) : '';\n }\n}\n"]}
@@ -1,9 +1,9 @@
1
- import '../../internal/InternalCheckboxGroupControl/index';
2
1
  import '../../internal/InternalEditableListControl/index';
3
- import '../../internal/InternalRadioGroupControl/index';
4
- import '../../internal/InternalIntegerControl/index';
2
+ import '../../internal/InternalSummaryControl/index';
3
+ import '../../internal/InternalSwitchControl/index';
4
+ import '../../internal/InternalSelectControl/index';
5
+ import '../../internal/InternalNumberControl/index';
5
6
  import '../../internal/InternalTextControl/index';
6
7
  import '../../internal/InternalForm/index';
7
- import './internal/InternalSubscriptionSettingsFormReattemptBypass/index';
8
8
  import { SubscriptionSettingsForm } from './SubscriptionSettingsForm';
9
9
  export { SubscriptionSettingsForm };
@@ -1,10 +1,10 @@
1
- import "../../internal/InternalCheckboxGroupControl/index.js";
2
1
  import "../../internal/InternalEditableListControl/index.js";
3
- import "../../internal/InternalRadioGroupControl/index.js";
4
- import "../../internal/InternalIntegerControl/index.js";
2
+ import "../../internal/InternalSummaryControl/index.js";
3
+ import "../../internal/InternalSwitchControl/index.js";
4
+ import "../../internal/InternalSelectControl/index.js";
5
+ import "../../internal/InternalNumberControl/index.js";
5
6
  import "../../internal/InternalTextControl/index.js";
6
7
  import "../../internal/InternalForm/index.js";
7
- import "./internal/InternalSubscriptionSettingsFormReattemptBypass/index.js";
8
8
  import { SubscriptionSettingsForm } from "./SubscriptionSettingsForm.js";
9
9
  customElements.define('foxy-subscription-settings-form', SubscriptionSettingsForm);
10
10
  export { SubscriptionSettingsForm };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/elements/public/SubscriptionSettingsForm/index.ts"],"names":[],"mappings":"AAAA,8DAA2D;AAC3D,6DAA0D;AAC1D,2DAAwD;AACxD,wDAAqD;AACrD,qDAAkD;AAClD,8CAA2C;AAE3C,6EAA0E;AAE1E,OAAO,EAAE,wBAAwB,EAAE,sCAAmC;AAEtE,cAAc,CAAC,MAAM,CAAC,iCAAiC,EAAE,wBAAwB,CAAC,CAAC;AAEnF,OAAO,EAAE,wBAAwB,EAAE,CAAC","sourcesContent":["import '../../internal/InternalCheckboxGroupControl/index';\nimport '../../internal/InternalEditableListControl/index';\nimport '../../internal/InternalRadioGroupControl/index';\nimport '../../internal/InternalIntegerControl/index';\nimport '../../internal/InternalTextControl/index';\nimport '../../internal/InternalForm/index';\n\nimport './internal/InternalSubscriptionSettingsFormReattemptBypass/index';\n\nimport { SubscriptionSettingsForm } from './SubscriptionSettingsForm';\n\ncustomElements.define('foxy-subscription-settings-form', SubscriptionSettingsForm);\n\nexport { SubscriptionSettingsForm };\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/elements/public/SubscriptionSettingsForm/index.ts"],"names":[],"mappings":"AAAA,6DAA0D;AAC1D,wDAAqD;AACrD,uDAAoD;AACpD,uDAAoD;AACpD,uDAAoD;AACpD,qDAAkD;AAClD,8CAA2C;AAE3C,OAAO,EAAE,wBAAwB,EAAE,sCAAmC;AAEtE,cAAc,CAAC,MAAM,CAAC,iCAAiC,EAAE,wBAAwB,CAAC,CAAC;AAEnF,OAAO,EAAE,wBAAwB,EAAE,CAAC","sourcesContent":["import '../../internal/InternalEditableListControl/index';\nimport '../../internal/InternalSummaryControl/index';\nimport '../../internal/InternalSwitchControl/index';\nimport '../../internal/InternalSelectControl/index';\nimport '../../internal/InternalNumberControl/index';\nimport '../../internal/InternalTextControl/index';\nimport '../../internal/InternalForm/index';\n\nimport { SubscriptionSettingsForm } from './SubscriptionSettingsForm';\n\ncustomElements.define('foxy-subscription-settings-form', SubscriptionSettingsForm);\n\nexport { SubscriptionSettingsForm };\n"]}
@@ -1,3 +1,5 @@
1
1
  import type { Resource } from '@foxy.io/sdk/core';
2
2
  import type { Rels } from '@foxy.io/sdk/backend';
3
- export declare type Data = Resource<Rels.SubscriptionSettings>;
3
+ export declare type Data = Omit<Resource<Rels.SubscriptionSettings>, 'reattempt_bypass_logic'> & {
4
+ reattempt_bypass_logic: 'skip_if_exists' | 'reattempt_if_exists' | '';
5
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/elements/public/SubscriptionSettingsForm/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Resource } from '@foxy.io/sdk/core';\nimport type { Rels } from '@foxy.io/sdk/backend';\n\nexport type Data = Resource<Rels.SubscriptionSettings>;\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/elements/public/SubscriptionSettingsForm/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Resource } from '@foxy.io/sdk/core';\nimport type { Rels } from '@foxy.io/sdk/backend';\n\nexport type Data = Omit<Resource<Rels.SubscriptionSettings>, 'reattempt_bypass_logic'> & {\n // TODO remove once SDK is updated\n reattempt_bypass_logic: 'skip_if_exists' | 'reattempt_if_exists' | '';\n};\n"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@foxy.io/elements",
3
3
  "type": "module",
4
- "version": "1.29.0-beta.2",
4
+ "version": "1.29.0-beta.4",
5
5
  "description": "E-commerce web components by Foxy.",
6
6
  "repository": {
7
7
  "type": "git",
@@ -1 +0,0 @@
1
- import"./shared-df00a537.js";import"./shared-3e03c988.js";import{I as e}from"./shared-7b8ad9c1.js";import{_ as t}from"./shared-0f6e4584.js";import{c as s,h as i,s as a}from"./shared-dc73b9a5.js";import{i as r}from"./shared-9803aa7c.js";import{c as l}from"./shared-4e709717.js";let n,d,o,h,u,m,p=e=>e;customElements.define("foxy-internal-number-control",class extends e{constructor(){super(...arguments),this.layout=null,this.prefix=null,this.suffix=null,this.min=null,this.max=null}static get properties(){return t(t({},super.properties),{},{layout:{},prefix:{},suffix:{},min:{type:Number},max:{type:Number}})}static get styles(){return[...super.styles,s(n||(n=p`input::-webkit-inner-spin-button,input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input{-moz-appearance:textfield}`))]}renderControl(){var e,t;return"summary-item"===this.layout?this.__renderSummaryItemLayout():i(d||(d=p` <vaadin-number-field error-message="${0}" placeholder="${0}" helper-text="${0}" label="${0}" class="w-full" min="${0}" max="${0}" ?disabled="${0}" ?readonly="${0}" .checkValidity="${0}" .value="${0}" clear-button-visible @keydown="${0}" @change="${0}"> ${0} ${0} </vaadin-number-field> `),r(this._errorMessage),this.placeholder,this.helperText,this.label,r(null!==(e=this.min)&&void 0!==e?e:void 0),r(null!==(t=this.max)&&void 0!==t?t:void 0),this.disabled,this.readonly,this._checkValidity,this._value,(e=>{var t;return"Enter"===e.key&&(null===(t=this.nucleon)||void 0===t?void 0:t.submit())}),(e=>{const t=e.currentTarget;this._value=parseFloat(t.value)}),this.prefix?i(o||(o=p`<div slot="prefix">${0}</div>`),this.prefix):"",this.suffix?i(h||(h=p`<div class="pr-s font-medium" slot="suffix">${0}</div>`),this.suffix):"")}__renderSummaryItemLayout(){var e,s;const n={"text-disabled":this.disabled,"text-tertiary":!this.readonly&&!this.disabled,"font-medium":!this.readonly};return i(u||(u=p` <div class="flex items-start gap-m leading-xs"> <div> <label class="text-m text-body" for="input">${0}</label> <p class="text-s text-secondary">${0}</p> <p class="text-s text-error" ?hidden="${0}"> ${0} </p> </div> <div class="flex-1 flex items-center gap-xs"> <span class="${0}"> ${0} </span> <input placeholder="${0}" style="min-width:10ch" class="${0}" type="number" min="${0}" max="${0}" id="input" .value="${0}" ?disabled="${0}" ?readonly="${0}" @keydown="${0}" @input="${0}"> <span class="${0}"> ${0} </span> <button aria-label="${0}" class="${0}" style="width:1em;height:1em" ?disabled="${0}" ?hidden="${0}" @click="${0}"> ${0} </button> </div> </div> `),this.label,this.helperText,this.disabled||this.readonly,this._errorMessage,l(t({"text-secondary":this.readonly},n)),this.prefix,this.placeholder,l({"w-full appearance-none text-right bg-transparent transition-colors":!0,"text-m rounded-s focus-outline-none":!0,"text-secondary":this.readonly,"text-disabled":this.disabled,"font-medium":!this.readonly}),r(null!==(e=this.min)&&void 0!==e?e:void 0),r(null!==(s=this.max)&&void 0!==s?s:void 0),this._value,this.disabled,this.readonly,(e=>{var t;return"Enter"===e.key&&(null===(t=this.nucleon)||void 0===t?void 0:t.submit())}),(e=>{e.stopPropagation(),this._value=e.target.value}),l(t({"text-secondary":this.readonly},n)),this.suffix,this.t("clear"),l({"flex-shrink-0 rounded-full transition-colors":!0,"focus-outline-none focus-ring-2 focus-ring-primary-50":!0,"cursor-pointer text-tertiary hover-text-body":!this.disabled,"cursor-default text-disabled":this.disabled}),this.disabled,this.readonly,(()=>{this._value=0,this.dispatchEvent(new CustomEvent("clear"))}),a(m||(m=p`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" style="width: 1em; height: 1em; transform: scale(1.25); margin-right: -0.16em"><path d="M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z" /></svg>`)))}});
@@ -1 +0,0 @@
1
- import"./shared-3e03c988.js";import{I as e}from"./shared-7b8ad9c1.js";import{_ as t}from"./shared-0f6e4584.js";import{c as s,h as i,s as r}from"./shared-dc73b9a5.js";import{i as a}from"./shared-9803aa7c.js";import{c as l}from"./shared-4e709717.js";let o,n,d,u,h,c,p=e=>e;customElements.define("foxy-internal-text-control",class extends e{constructor(){super(...arguments),this.layout=null,this.prefix=null,this.suffix=null}static get properties(){return t(t({},super.properties),{},{layout:{},prefix:{},suffix:{}})}static get styles(){return[super.styles,s(o||(o=p`input::-webkit-contacts-auto-fill-button{visibility:hidden;display:none!important;pointer-events:none;position:absolute;right:0}`))]}renderControl(){return"summary-item"===this.layout?this.__renderSummaryItemLayout():i(n||(n=p` <vaadin-text-field error-message="${0}" helper-text="${0}" placeholder="${0}" label="${0}" class="w-full" ?clear-button-visible="${0}" ?disabled="${0}" ?readonly="${0}" .checkValidity="${0}" .value="${0}" @keydown="${0}" @input="${0}"> ${0} ${0} </vaadin-text-field> `),a(this._errorMessage),this.helperText,this.placeholder,this.label,!this.suffix,this.disabled,this.readonly,this._checkValidity,this._value,(e=>{var t;return"Enter"===e.key&&(null===(t=this.nucleon)||void 0===t?void 0:t.submit())}),(e=>{const t=e.currentTarget;this._value=t.value}),this.prefix?i(d||(d=p`<div slot="prefix">${0}</div>`),this.prefix):"",this.suffix?i(u||(u=p`<div class="pr-s font-medium" slot="suffix">${0}</div>`),this.suffix):"")}get _value(){var e;return null!==(e=super._value)&&void 0!==e?e:""}set _value(e){super._value=e}__renderSummaryItemLayout(){return i(h||(h=p` <div class="flex items-start gap-m leading-xs"> <div> <label class="text-m text-body" for="input">${0}</label> <p class="text-s text-secondary">${0}</p> <p class="text-s text-error" ?hidden="${0}"> ${0} </p> </div> <div class="flex-1 flex items-center gap-xs"> <input placeholder="${0}" class="${0}" type="text" id="input" .value="${0}" ?disabled="${0}" ?readonly="${0}" @keydown="${0}" @input="${0}"> <button aria-label="${0}" class="${0}" style="width:1em;height:1em" ?disabled="${0}" ?hidden="${0}" @click="${0}"> ${0} </button> </div> </div> `),this.label,this.helperText,this.disabled||this.readonly,this._errorMessage,this.placeholder,l({"w-full appearance-none text-right bg-transparent transition-colors":!0,"text-m rounded-s focus-outline-none":!0,"text-secondary":this.readonly,"text-disabled":this.disabled,"font-medium":!this.readonly}),this._value,this.disabled,this.readonly,(e=>{var t;return"Enter"===e.key&&(null===(t=this.nucleon)||void 0===t?void 0:t.submit())}),(e=>{e.stopPropagation(),this._value=e.target.value}),this.t("clear"),l({"rounded-full transition-colors":!0,"focus-outline-none focus-ring-2 focus-ring-primary-50":!0,"cursor-pointer text-tertiary hover-text-body":!this.disabled,"cursor-default text-disabled":this.disabled}),this.disabled,this.readonly||!this._value,(()=>{this._value="",this.dispatchEvent(new CustomEvent("clear"))}),r(c||(c=p`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" style="width: 1em; height: 1em; transform: scale(1.25); margin-right: -0.16em"><path d="M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z" /></svg>`)))}});