@isoftdata/svelte-ecommerce 1.0.0-beta.3 → 1.0.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.
@@ -7,6 +7,9 @@
7
7
  import Button from '@isoftdata/svelte-button'
8
8
  import Textarea from '@isoftdata/svelte-textarea'
9
9
  import { translate as defaultTranslate } from '@isoftdata/utility-string'
10
+ import toTitleCase from 'to-title-case'
11
+ import camelCase from 'camelcase'
12
+ import Fieldset from '@isoftdata/svelte-fieldset'
10
13
 
11
14
  const { t: translate } = getContext<i18n>('i18next') || { t: defaultTranslate }
12
15
 
@@ -191,54 +194,70 @@
191
194
  />
192
195
  </div>
193
196
  </div>
194
- <div class="row">
195
- <div class="col">
196
- <Input
197
- label={translate('configuration.ecommerce.fulfillmentTime', 'Fulfillment Time')}
198
- maxlength={3}
199
- type="number"
200
- bind:value={fulfillmentTimeValue}
201
- onchange={handleInputChange}
202
- />
203
-
204
- <Select
205
- label={translate('configuration.ecommerce.fulfillmentUnit', 'Fulfillment Unit')}
206
- emptyText="-- {translate('configuration.ecommerce.selectUnit', 'Select Unit')} --"
207
- onchange={handleInputChange}
208
- bind:value={fulfillmentTimeUnit}
209
- >
210
- {#each ecommercePartnerStaticData.ebay.timeUnits as unit}
211
- <option value={unit}>{unit}</option>
212
- {/each}
213
- </Select>
197
+ <Fieldset label={translate('configuration.ecommerce.fulfillmentTimeFieldset', 'Fulfillment Time')}>
198
+ <div class="row">
199
+ <div class="col-3">
200
+ <Input
201
+ label={translate('common:time', 'Time')}
202
+ maxlength={3}
203
+ type="number"
204
+ bind:value={fulfillmentTimeValue}
205
+ onchange={handleInputChange}
206
+ />
207
+ </div>
208
+ <div class="col-9">
209
+ <Select
210
+ label={translate('common:unit', 'Unit')}
211
+ emptyText="-- {translate('configuration.ecommerce.selectUnit', 'Select Unit')} --"
212
+ onchange={handleInputChange}
213
+ bind:value={fulfillmentTimeUnit}
214
+ >
215
+ {#each ecommercePartnerStaticData.ebay.timeUnits as unit}
216
+ <option value={unit}
217
+ >{translate(`configuration.ecommerce.timeUnits.${camelCase(unit)}`, toTitleCase(unit))}</option
218
+ >
219
+ {/each}
220
+ </Select>
221
+ </div>
214
222
  </div>
215
- </div>
216
- <div class="row">
217
- <div class="col">
218
- <Select
219
- label={translate('configuration.ecommerce.lengthUnit', 'Shipping Length Unit')}
220
- emptyText="-- {translate('configuration.ecommerce.selectUnit', 'Select Unit')} --"
221
- onchange={handleInputChange}
222
- bind:value={shippingLengthUnit}
223
- >
224
- {#each lengthUnits as unit}
225
- <option value={unit}>{unit}</option>
226
- {/each}
227
- </Select>
228
- </div>
229
- <div class="col">
230
- <Select
231
- label={translate('configuration.ecommerce.shippingWeightUnit', 'Shipping Weight Unit')}
232
- emptyText="-- {translate('configuration.ecommerce.selectUnit', 'Select Unit')} --"
233
- onchange={handleInputChange}
234
- bind:value={shippingWeightUnit}
235
- >
236
- {#each weightUnits as unit}
237
- <option value={unit}>{unit}</option>
238
- {/each}
239
- </Select>
223
+ </Fieldset>
224
+
225
+ <Fieldset
226
+ label={translate('configuration.ecommerce.shippingUnits', 'Shipping Units')}
227
+ class="mt-3 mb-3"
228
+ >
229
+ <div class="row">
230
+ <div class="col">
231
+ <Select
232
+ label={translate('common:length', 'Length')}
233
+ emptyText="-- {translate('configuration.ecommerce.selectUnit', 'Select Unit')} --"
234
+ onchange={handleInputChange}
235
+ bind:value={shippingLengthUnit}
236
+ >
237
+ {#each lengthUnits as unit}
238
+ <option value={unit}
239
+ >{translate(`configuration.ecommerce.lengthUnits.${camelCase(unit)}`, toTitleCase(unit))}</option
240
+ >
241
+ {/each}
242
+ </Select>
243
+ </div>
244
+ <div class="col">
245
+ <Select
246
+ label={translate('common:weight', 'Weight')}
247
+ emptyText="-- {translate('configuration.ecommerce.selectUnit', 'Select Unit')} --"
248
+ onchange={handleInputChange}
249
+ bind:value={shippingWeightUnit}
250
+ >
251
+ {#each weightUnits as unit}
252
+ <option value={unit}
253
+ >{translate(`configuration.ecommerce.weightUnits.${camelCase(unit)}`, toTitleCase(unit))}</option
254
+ >
255
+ {/each}
256
+ </Select>
257
+ </div>
240
258
  </div>
241
- </div>
259
+ </Fieldset>
260
+
242
261
  <div class="row">
243
262
  <div class="col">
244
263
  <Select
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@isoftdata/svelte-ecommerce",
3
- "version": "1.0.0-beta.3",
3
+ "version": "1.0.0-beta.4",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build && npm run prepack",
@@ -46,6 +46,7 @@
46
46
  "@sveltejs/package": "^2.0.0",
47
47
  "@sveltejs/vite-plugin-svelte": "^5.0.0",
48
48
  "@types/node": "^22",
49
+ "@types/to-title-case": "^1.0.2",
49
50
  "eslint": "^9.36.0",
50
51
  "eslint-config-prettier": "^10.1.8",
51
52
  "eslint-plugin-svelte": "^3.12.4",
@@ -70,6 +71,7 @@
70
71
  "@isoftdata/svelte-button": "^2.1.1",
71
72
  "@isoftdata/svelte-checkbox": "^2.5.0",
72
73
  "@isoftdata/svelte-currency-input": "^2.0.1",
74
+ "@isoftdata/svelte-fieldset": "^2.0.1",
73
75
  "@isoftdata/svelte-input": "^2.1.1",
74
76
  "@isoftdata/svelte-modal": "^2.0.11",
75
77
  "@isoftdata/svelte-select": "^2.0.4",
@@ -78,7 +80,9 @@
78
80
  "@isoftdata/svelte-user-prompt": "^1.1.0",
79
81
  "@isoftdata/utility-string": "^2.2.0",
80
82
  "@lukeed/uuid": "2.0.1",
83
+ "camelcase": "^9.0.0",
81
84
  "klona": "^2.0.6",
82
- "svelte": "^5.23.2"
85
+ "svelte": "^5.23.2",
86
+ "to-title-case": "^1.0.0"
83
87
  }
84
88
  }