@isoftdata/svelte-ecommerce 1.0.0-beta.2 → 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
@@ -8,6 +8,7 @@
8
8
  import Checkbox from '@isoftdata/svelte-checkbox'
9
9
  import Button from '@isoftdata/svelte-button'
10
10
  import Select from '@isoftdata/svelte-select'
11
+ import { translate as defaultTranslate, booleanToYesNo as yesNo } from '@isoftdata/utility-string'
11
12
  import type {
12
13
  EbayLocation,
13
14
  EbayPolicy,
@@ -18,7 +19,6 @@
18
19
  } from './utils.js'
19
20
  import EcommerceDefaults from './EcommerceDefaults.svelte'
20
21
 
21
- import { translate as defaultTranslate } from '@isoftdata/utility-string'
22
22
  const { t: translate } = getContext<i18n>('i18next') || { t: defaultTranslate }
23
23
 
24
24
  interface Props {
@@ -180,7 +180,7 @@
180
180
  <td property="storeId">{row.storeId}</td>
181
181
  <td property="name">{row.name}</td>
182
182
  <td property="merchantLocationKey">{row.merchantLocationKey}</td>
183
- <td property="active">{row.active}</td>
183
+ <td property="active">{yesNo(row.active, translate)}</td>
184
184
  </tr>
185
185
  {/snippet}
186
186
  </Table>
@@ -208,41 +208,44 @@
208
208
  {close}
209
209
  >
210
210
  {#if selectedStoreConfigRow}
211
- <div class="card-body">
212
- <Checkbox
213
- label={translate('ecommerce.configuration.activeOnEbay', 'Active on eBay')}
214
- bind:checked={selectedStoreConfigRow.active}
215
- />
216
-
217
- <Select
218
- label={translate('ecommerce.configuration.store', 'Store')}
219
- emptyText="-- {translate('ecommerce.configuration.selectStore', 'Select Store')} --"
220
- bind:value={selectedStoreConfigRow.storeId}
221
- >
222
- {#each availableStores as store}
223
- <option value={store.storeId}>{store.name}</option>
224
- {/each}
225
- </Select>
226
- {#if selectedStoreConfigRow.storeId}
211
+ <Checkbox
212
+ label={translate('ecommerce.configuration.activeOnEbay', 'Active on eBay')}
213
+ bind:checked={selectedStoreConfigRow.active}
214
+ />
215
+ <div class="row mb-2">
216
+ <div class="col-md-6">
227
217
  <Select
228
- label={translate('ecommerce.configuration.ebayLocation', 'Ebay Location')}
229
- emptyText="-- {translate('ecommerce.configuration.selectLocation', 'Select Location')} --"
230
- bind:value={selectedStoreConfigRow.merchantLocationKey}
218
+ label={translate('ecommerce.configuration.itrackStore', 'ITrack Store')}
219
+ emptyText="-- {translate('ecommerce.configuration.selectStore', 'Select Store')} --"
220
+ bind:value={selectedStoreConfigRow.storeId}
231
221
  >
232
- {#each availableLocations as location}
233
- <option value={location.ebayName}>{location.ebayName}</option>
222
+ {#each availableStores as store}
223
+ <option value={store.storeId}>{store.name}</option>
234
224
  {/each}
235
225
  </Select>
236
- {/if}
237
- {#if selectedStoreConfigRow.merchantLocationKey}
238
- <EcommerceDefaults
239
- bind:defaults={selectedStoreConfigRow.defaults}
240
- {ebayPolicyList}
241
- {ecommerceConditionList}
242
- {partnerConfigurationList}
243
- {selectedEcommercePartnerId}
244
- />
245
- {/if}
226
+ </div>
227
+ <div class="col-md-6">
228
+ {#if selectedStoreConfigRow.storeId}
229
+ <Select
230
+ label={translate('ecommerce.configuration.ebayLocation', 'eBay Location')}
231
+ emptyText="-- {translate('ecommerce.configuration.selectLocation', 'Select Location')} --"
232
+ bind:value={selectedStoreConfigRow.merchantLocationKey}
233
+ >
234
+ {#each availableLocations as location}
235
+ <option value={location.ebayName}>{location.ebayName}</option>
236
+ {/each}
237
+ </Select>
238
+ {/if}
239
+ </div>
246
240
  </div>
241
+ {#if selectedStoreConfigRow.merchantLocationKey}
242
+ <EcommerceDefaults
243
+ bind:defaults={selectedStoreConfigRow.defaults}
244
+ {ebayPolicyList}
245
+ {ecommerceConditionList}
246
+ {partnerConfigurationList}
247
+ {selectedEcommercePartnerId}
248
+ />
249
+ {/if}
247
250
  {/if}
248
251
  </Modal>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@isoftdata/svelte-ecommerce",
3
- "version": "1.0.0-beta.2",
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
  }