|
16 | 16 | parentProductCode: string; |
17 | 17 | collectionId: string; |
18 | 18 | monthlySubscription: string; |
| 19 | + monthlySubscriptionCurrency: string; |
19 | 20 | rateLimits: { |
20 | 21 | perSecond: string; |
21 | 22 | perMinute: string; |
|
36 | 37 | initialParentProductCode = "", |
37 | 38 | initialCollectionId = "", |
38 | 39 | initialSubscription = "", |
| 40 | + initialSubscriptionCurrency = "EUR", |
39 | 41 | initialRateLimits = { perSecond: "", perMinute: "", perHour: "", perDay: "", perWeek: "", perMonth: "" }, |
40 | 42 | initialCustomAttributes = [], |
41 | 43 | onSubmit, |
|
51 | 53 | initialParentProductCode?: string; |
52 | 54 | initialCollectionId?: string; |
53 | 55 | initialSubscription?: string; |
| 56 | + initialSubscriptionCurrency?: string; |
54 | 57 | initialRateLimits?: { perSecond: string; perMinute: string; perHour: string; perDay: string; perWeek: string; perMonth: string }; |
55 | 58 | initialCustomAttributes?: CustomAttribute[]; |
56 | 59 | onSubmit: (data: ProductFormData) => Promise<void>; |
|
66 | 69 | let parentProductCode = $state(initialParentProductCode); |
67 | 70 | let selectedCollectionId = $state(initialCollectionId); |
68 | 71 | let monthlySubscriptionAmount = $state(initialSubscription); |
| 72 | + let monthlySubscriptionCurrency = $state(initialSubscriptionCurrency); |
69 | 73 | let isSubmitting = $state(false); |
70 | 74 |
|
71 | 75 | // Rate limits |
|
120 | 124 | parentProductCode: parentProductCode.trim(), |
121 | 125 | collectionId: selectedCollectionId.trim(), |
122 | 126 | monthlySubscription: String(monthlySubscriptionAmount || "").trim(), |
| 127 | + monthlySubscriptionCurrency: String(monthlySubscriptionCurrency || "").trim(), |
123 | 128 | rateLimits: { |
124 | 129 | perSecond: String(callsPerSecond || "").trim(), |
125 | 130 | perMinute: String(callsPerMinute || "").trim(), |
|
196 | 201 | <label for="monthly-subscription" class="form-label"> |
197 | 202 | Monthly Subscription |
198 | 203 | </label> |
199 | | - <div class="input-with-prefix"> |
200 | | - <span class="input-prefix">$</span> |
201 | | - <input |
202 | | - id="monthly-subscription" |
203 | | - type="number" |
204 | | - step="0.01" |
205 | | - min="0" |
206 | | - class="form-input with-prefix" |
207 | | - placeholder="e.g., 99.99" |
208 | | - bind:value={monthlySubscriptionAmount} |
| 204 | + <div class="subscription-row"> |
| 205 | + <div class="input-with-prefix subscription-amount"> |
| 206 | + <span class="input-prefix">$</span> |
| 207 | + <input |
| 208 | + id="monthly-subscription" |
| 209 | + type="number" |
| 210 | + step="0.01" |
| 211 | + min="0" |
| 212 | + class="form-input with-prefix" |
| 213 | + placeholder="e.g., 99.99" |
| 214 | + bind:value={monthlySubscriptionAmount} |
| 215 | + disabled={isSubmitting} |
| 216 | + /> |
| 217 | + </div> |
| 218 | + <select |
| 219 | + id="monthly-subscription-currency" |
| 220 | + class="form-input currency-select" |
| 221 | + bind:value={monthlySubscriptionCurrency} |
209 | 222 | disabled={isSubmitting} |
210 | | - /> |
| 223 | + > |
| 224 | + <option value="EUR">EUR</option> |
| 225 | + <option value="USD">USD</option> |
| 226 | + <option value="GBP">GBP</option> |
| 227 | + <option value="CHF">CHF</option> |
| 228 | + <option value="JPY">JPY</option> |
| 229 | + <option value="CAD">CAD</option> |
| 230 | + <option value="AUD">AUD</option> |
| 231 | + </select> |
211 | 232 | </div> |
212 | | - <div class="form-help">Monthly subscription fee</div> |
| 233 | + <div class="form-help">Monthly subscription fee and currency</div> |
213 | 234 | </div> |
214 | 235 | </div> |
215 | 236 |
|
|
672 | 693 | padding-left: 1.75rem; |
673 | 694 | } |
674 | 695 |
|
| 696 | + .subscription-row { |
| 697 | + display: flex; |
| 698 | + gap: 0.5rem; |
| 699 | + } |
| 700 | +
|
| 701 | + .subscription-amount { |
| 702 | + flex: 1; |
| 703 | + } |
| 704 | +
|
| 705 | + .currency-select { |
| 706 | + width: 5rem; |
| 707 | + flex-shrink: 0; |
| 708 | + } |
| 709 | +
|
675 | 710 | .rate-limits-section { |
676 | 711 | padding-top: 1rem; |
677 | 712 | border-top: 1px solid #e5e7eb; |
|
0 commit comments