@isoftdata/svelte-ecommerce 1.0.0-beta.0 → 1.0.0-beta.1
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.
- package/README.md +56 -58
- package/dist/EcommerceCategoryMapConfiguration.svelte +251 -266
- package/dist/EcommerceCategoryMapConfiguration.svelte.d.ts +6 -4
- package/dist/EcommerceConditionMapConfiguration.svelte +192 -214
- package/dist/EcommerceConditionMapConfiguration.svelte.d.ts +3 -3
- package/dist/EcommerceConfiguration.svelte +199 -195
- package/dist/EcommerceConfiguration.svelte.d.ts +16 -16
- package/dist/EcommerceDefaults.svelte +333 -357
- package/dist/EcommerceDefaults.svelte.d.ts +4 -4
- package/dist/EcommerceListingDetails.svelte +852 -986
- package/dist/EcommerceListingDetails.svelte.d.ts +10 -10
- package/dist/EcommercePartTypeConfig.svelte +277 -305
- package/dist/EcommercePartTypeConfig.svelte.d.ts +7 -8
- package/dist/EcommerceStoreConfiguration.svelte +248 -263
- package/dist/EcommerceStoreConfiguration.svelte.d.ts +5 -5
- package/dist/PolicyList.svelte +54 -66
- package/dist/PolicyList.svelte.d.ts +3 -3
- package/dist/data/ebay.d.ts +4 -4
- package/dist/data/htp.d.ts +3 -3
- package/dist/data/htp.js +1 -1
- package/dist/helpers/listing.js +22 -25
- package/dist/helpers/template.d.ts +2 -2
- package/dist/helpers/template.js +35 -37
- package/dist/helpers/validation.js +4 -4
- package/dist/index.d.ts +1 -1
- package/dist/utils.d.ts +47 -61
- package/package.json +22 -6
|
@@ -1,357 +1,333 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { i18n } from 'i18next'
|
|
3
|
-
|
|
4
|
-
import { getContext } from 'svelte'
|
|
5
|
-
import Input from '@isoftdata/svelte-input'
|
|
6
|
-
import Select from '@isoftdata/svelte-select'
|
|
7
|
-
import Button from '@isoftdata/svelte-button'
|
|
8
|
-
import Textarea from '@isoftdata/svelte-textarea'
|
|
9
|
-
import { translate as defaultTranslate } from '@isoftdata/utility-string'
|
|
10
|
-
|
|
11
|
-
const { t: translate } = getContext<i18n>('i18next') || { t: defaultTranslate }
|
|
12
|
-
|
|
13
|
-
import { ecommercePartnerStaticData } from './data/index.js'
|
|
14
|
-
import PolicyList from './PolicyList.svelte'
|
|
15
|
-
|
|
16
|
-
import type {
|
|
17
|
-
EbayPolicy,
|
|
18
|
-
EcommerceCondition,
|
|
19
|
-
EcommercePartnerConfiguration,
|
|
20
|
-
EcommerceSharedDefaults,
|
|
21
|
-
PolicyRowWithChecked,
|
|
22
|
-
} from './utils.js'
|
|
23
|
-
import type { PackageType } from './data/types.js'
|
|
24
|
-
|
|
25
|
-
interface Props {
|
|
26
|
-
defaults?: EcommerceSharedDefaults
|
|
27
|
-
ebayPolicyList?: EbayPolicy
|
|
28
|
-
ecommerceConditionList: EcommerceCondition
|
|
29
|
-
partnerConfigurationList: EcommercePartnerConfiguration
|
|
30
|
-
defaultsChanged
|
|
31
|
-
selectedEcommercePartnerId: number
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
let {
|
|
35
|
-
defaults = $bindable(),
|
|
36
|
-
ebayPolicyList,
|
|
37
|
-
ecommerceConditionList,
|
|
38
|
-
partnerConfigurationList,
|
|
39
|
-
defaultsChanged
|
|
40
|
-
selectedEcommercePartnerId,
|
|
41
|
-
}: Props = $props()
|
|
42
|
-
|
|
43
|
-
// State variables for all form inputs - initialize from defaults prop if provided
|
|
44
|
-
let brandMapping = $state<string>(defaults?.brandMapping ?? '')
|
|
45
|
-
let conditionDescription = $state<string>(defaults?.conditionDescription ?? '')
|
|
46
|
-
let conditionId = $state<number | null>(defaults?.conditionId ?? null)
|
|
47
|
-
let fulfillmentPolicies = $state<string
|
|
48
|
-
let listingDescriptionTemplate = $state<string>(defaults?.listingDescriptionTemplate ?? '')
|
|
49
|
-
let listingDuration = $state<string>(defaults?.listingDuration ?? '')
|
|
50
|
-
let listingTitleTemplate = $state<string>(defaults?.listingTitleTemplate ?? '')
|
|
51
|
-
let fulfillmentTimeValue = $state<number | null>(defaults?.fulfillmentTimeValue ?? null)
|
|
52
|
-
let fulfillmentTimeUnit = $state<string | null>(defaults?.fulfillmentTimeUnit ?? null)
|
|
53
|
-
let manufacturerPartNumberMapping = $state<string>(defaults?.manufacturerPartNumberMapping ?? '')
|
|
54
|
-
let packageType = $state<string | null>(defaults?.packageType ?? null)
|
|
55
|
-
let paymentPolicies = $state<string
|
|
56
|
-
let returnPolicies = $state<string
|
|
57
|
-
let shippingLengthUnit = $state<string | null>(defaults?.shippingLengthUnit ?? null)
|
|
58
|
-
let shippingWeightUnit = $state<string | null>(defaults?.shippingWeightUnit ?? null)
|
|
59
|
-
|
|
60
|
-
// Computed properties for UI state
|
|
61
|
-
let ecommerceConditions = $derived(ecommerceConditionList) // TODO: why'd I do this?
|
|
62
|
-
let
|
|
63
|
-
let
|
|
64
|
-
let
|
|
65
|
-
let
|
|
66
|
-
let
|
|
67
|
-
let
|
|
68
|
-
let
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
const
|
|
81
|
-
return policies.map(policy => ({
|
|
82
|
-
...policy,
|
|
83
|
-
checked:
|
|
84
|
-
}))
|
|
85
|
-
}
|
|
86
|
-
function getReturnPolicyList(): PolicyRowWithChecked
|
|
87
|
-
const policies = ebayPolicyList?.filter(policy => policy.policyType === 'return') || []
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
emptyText={translate('configuration.ecommerce.selectUnit', 'Select Unit')}
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
{
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
<
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
{
|
|
232
|
-
|
|
233
|
-
{
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
{
|
|
249
|
-
|
|
250
|
-
{
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
</
|
|
254
|
-
|
|
255
|
-
<div class="col">
|
|
256
|
-
<
|
|
257
|
-
label={translate('configuration.ecommerce.
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
{
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
{
|
|
313
|
-
|
|
314
|
-
</div>
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
onchange={handleInputChange}
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
<div class="col
|
|
326
|
-
<
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
}}>{translate('configuration.ecommerce.templateHelp', 'Template Help')}</Button
|
|
335
|
-
>
|
|
336
|
-
</div>
|
|
337
|
-
</div>
|
|
338
|
-
<div class="row">
|
|
339
|
-
<div class="col">
|
|
340
|
-
<Textarea
|
|
341
|
-
label={translate('configuration.ecommerce.titleTemplate', 'Title Template')}
|
|
342
|
-
onchange={handleInputChange}
|
|
343
|
-
rows={10}
|
|
344
|
-
bind:value={listingTitleTemplate}
|
|
345
|
-
disabled={false}
|
|
346
|
-
/>
|
|
347
|
-
</div>
|
|
348
|
-
<div class="col">
|
|
349
|
-
<Textarea
|
|
350
|
-
label={translate('configuration.ecommerce.descriptionTemplate', 'Description Template')}
|
|
351
|
-
onchange={handleInputChange}
|
|
352
|
-
rows={10}
|
|
353
|
-
bind:value={listingDescriptionTemplate}
|
|
354
|
-
disabled={false}
|
|
355
|
-
/>
|
|
356
|
-
</div>
|
|
357
|
-
</div>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { i18n } from 'i18next'
|
|
3
|
+
|
|
4
|
+
import { getContext } from 'svelte'
|
|
5
|
+
import Input from '@isoftdata/svelte-input'
|
|
6
|
+
import Select from '@isoftdata/svelte-select'
|
|
7
|
+
import Button from '@isoftdata/svelte-button'
|
|
8
|
+
import Textarea from '@isoftdata/svelte-textarea'
|
|
9
|
+
import { translate as defaultTranslate } from '@isoftdata/utility-string'
|
|
10
|
+
|
|
11
|
+
const { t: translate } = getContext<i18n>('i18next') || { t: defaultTranslate }
|
|
12
|
+
|
|
13
|
+
import { ecommercePartnerStaticData } from './data/index.js'
|
|
14
|
+
import PolicyList from './PolicyList.svelte'
|
|
15
|
+
|
|
16
|
+
import type {
|
|
17
|
+
EbayPolicy,
|
|
18
|
+
EcommerceCondition,
|
|
19
|
+
EcommercePartnerConfiguration,
|
|
20
|
+
EcommerceSharedDefaults,
|
|
21
|
+
PolicyRowWithChecked,
|
|
22
|
+
} from './utils.js'
|
|
23
|
+
import type { PackageType } from './data/types.js'
|
|
24
|
+
|
|
25
|
+
interface Props {
|
|
26
|
+
defaults?: EcommerceSharedDefaults
|
|
27
|
+
ebayPolicyList?: Array<EbayPolicy>
|
|
28
|
+
ecommerceConditionList: Array<EcommerceCondition>
|
|
29
|
+
partnerConfigurationList: Array<EcommercePartnerConfiguration>
|
|
30
|
+
defaultsChanged?: (() => Promise<void>) | undefined
|
|
31
|
+
selectedEcommercePartnerId: number
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
let {
|
|
35
|
+
defaults = $bindable(),
|
|
36
|
+
ebayPolicyList,
|
|
37
|
+
ecommerceConditionList,
|
|
38
|
+
partnerConfigurationList,
|
|
39
|
+
defaultsChanged,
|
|
40
|
+
selectedEcommercePartnerId,
|
|
41
|
+
}: Props = $props()
|
|
42
|
+
|
|
43
|
+
// State variables for all form inputs - initialize from defaults prop if provided
|
|
44
|
+
let brandMapping = $state<string>(defaults?.brandMapping ?? '')
|
|
45
|
+
let conditionDescription = $state<string>(defaults?.conditionDescription ?? '')
|
|
46
|
+
let conditionId = $state<number | null>(defaults?.conditionId ?? null)
|
|
47
|
+
let fulfillmentPolicies = $state<Array<string>>(defaults?.fulfillmentPolicies ?? [])
|
|
48
|
+
let listingDescriptionTemplate = $state<string>(defaults?.listingDescriptionTemplate ?? '')
|
|
49
|
+
let listingDuration = $state<string>(defaults?.listingDuration ?? '')
|
|
50
|
+
let listingTitleTemplate = $state<string>(defaults?.listingTitleTemplate ?? '')
|
|
51
|
+
let fulfillmentTimeValue = $state<number | null>(defaults?.fulfillmentTimeValue ?? null)
|
|
52
|
+
let fulfillmentTimeUnit = $state<string | null>(defaults?.fulfillmentTimeUnit ?? null)
|
|
53
|
+
let manufacturerPartNumberMapping = $state<string>(defaults?.manufacturerPartNumberMapping ?? '')
|
|
54
|
+
let packageType = $state<string | null>(defaults?.packageType ?? null)
|
|
55
|
+
let paymentPolicies = $state<Array<string>>(defaults?.paymentPolicies ?? [])
|
|
56
|
+
let returnPolicies = $state<Array<string>>(defaults?.returnPolicies ?? [])
|
|
57
|
+
let shippingLengthUnit = $state<string | null>(defaults?.shippingLengthUnit ?? null)
|
|
58
|
+
let shippingWeightUnit = $state<string | null>(defaults?.shippingWeightUnit ?? null)
|
|
59
|
+
|
|
60
|
+
// Computed properties for UI state
|
|
61
|
+
let ecommerceConditions = $derived(ecommerceConditionList) // TODO: why'd I do this?
|
|
62
|
+
let fulfillmentPolicyList = $derived.by(getFulfillmentPolicyList)
|
|
63
|
+
let lengthUnits = $derived.by(getPartnerLengthUnits)
|
|
64
|
+
let packageTypes = $derived.by(getPartnerPackageTypes)
|
|
65
|
+
let paymentPolicyList = $derived.by(getPaymentPolicyList)
|
|
66
|
+
let returnPolicyList = $derived.by(getReturnPolicyList)
|
|
67
|
+
let selectedPartnerConfig = $derived.by(getSelectedPartnerConfig)
|
|
68
|
+
let weightUnits = $derived.by(getPartnerWeightUnits)
|
|
69
|
+
|
|
70
|
+
function getFulfillmentPolicyList(): Array<PolicyRowWithChecked> {
|
|
71
|
+
const policies = ebayPolicyList?.filter(policy => policy.policyType === 'fulfillment') || []
|
|
72
|
+
const fulfillmentPolicySet = new Set(fulfillmentPolicies)
|
|
73
|
+
return policies.map(policy => ({
|
|
74
|
+
...policy,
|
|
75
|
+
checked: fulfillmentPolicySet.has(policy.policyId),
|
|
76
|
+
}))
|
|
77
|
+
}
|
|
78
|
+
function getPaymentPolicyList(): Array<PolicyRowWithChecked> {
|
|
79
|
+
const policies = ebayPolicyList?.filter(policy => policy.policyType === 'payment') || []
|
|
80
|
+
const paymentPolicySet = new Set(paymentPolicies)
|
|
81
|
+
return policies.map(policy => ({
|
|
82
|
+
...policy,
|
|
83
|
+
checked: paymentPolicySet.has(policy.policyId),
|
|
84
|
+
}))
|
|
85
|
+
}
|
|
86
|
+
function getReturnPolicyList(): Array<PolicyRowWithChecked> {
|
|
87
|
+
const policies = ebayPolicyList?.filter(policy => policy.policyType === 'return') || []
|
|
88
|
+
const returnPolicySet = new Set(returnPolicies)
|
|
89
|
+
return policies.map(policy => ({
|
|
90
|
+
...policy,
|
|
91
|
+
checked: returnPolicySet.has(policy.policyId),
|
|
92
|
+
}))
|
|
93
|
+
}
|
|
94
|
+
function getPartnerLengthUnits(): Array<string> {
|
|
95
|
+
const config = getSelectedPartnerConfig()
|
|
96
|
+
const partnerName = config.name
|
|
97
|
+
if (!partnerName || !(partnerName in ecommercePartnerStaticData)) {
|
|
98
|
+
return []
|
|
99
|
+
}
|
|
100
|
+
return ecommercePartnerStaticData[partnerName as keyof typeof ecommercePartnerStaticData].lengthUnits
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function getPartnerPackageTypes(): Array<PackageType> {
|
|
104
|
+
const config = getSelectedPartnerConfig()
|
|
105
|
+
const partnerName = config.name
|
|
106
|
+
if (!partnerName || !(partnerName in ecommercePartnerStaticData)) {
|
|
107
|
+
return []
|
|
108
|
+
}
|
|
109
|
+
return ecommercePartnerStaticData[partnerName as keyof typeof ecommercePartnerStaticData].packageTypes
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function getPartnerWeightUnits(): Array<string> {
|
|
113
|
+
const config = getSelectedPartnerConfig()
|
|
114
|
+
const partnerName = config.name
|
|
115
|
+
if (!partnerName || !(partnerName in ecommercePartnerStaticData)) {
|
|
116
|
+
return []
|
|
117
|
+
}
|
|
118
|
+
return ecommercePartnerStaticData[partnerName as keyof typeof ecommercePartnerStaticData].weightUnits
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function getSelectedPartnerConfig(): EcommercePartnerConfiguration {
|
|
122
|
+
const matchingPartnerConfig = partnerConfigurationList.find(
|
|
123
|
+
row => row.ecommercePartnerId === selectedEcommercePartnerId,
|
|
124
|
+
)
|
|
125
|
+
if (!matchingPartnerConfig) {
|
|
126
|
+
throw new Error('No matching partner config found')
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
return matchingPartnerConfig
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
async function handleInputChange() {
|
|
133
|
+
// Build the defaults object using current input values
|
|
134
|
+
const newDefaults = {
|
|
135
|
+
brandMapping: brandMapping || undefined,
|
|
136
|
+
conditionDescription: conditionDescription || undefined,
|
|
137
|
+
conditionId: conditionId || undefined,
|
|
138
|
+
fulfillmentPolicies: fulfillmentPolicies || [],
|
|
139
|
+
fulfillmentTimeUnit: fulfillmentTimeUnit || undefined,
|
|
140
|
+
fulfillmentTimeValue: fulfillmentTimeValue || undefined,
|
|
141
|
+
listingDescriptionTemplate: listingDescriptionTemplate || undefined,
|
|
142
|
+
listingDuration: listingDuration || undefined,
|
|
143
|
+
listingTitleTemplate: listingTitleTemplate || undefined,
|
|
144
|
+
manufacturerPartNumberMapping: manufacturerPartNumberMapping || undefined,
|
|
145
|
+
packageType: packageType || undefined,
|
|
146
|
+
paymentPolicies: paymentPolicies || [],
|
|
147
|
+
returnPolicies: returnPolicies || [],
|
|
148
|
+
shippingLengthUnit: shippingLengthUnit || undefined,
|
|
149
|
+
shippingWeightUnit: shippingWeightUnit || undefined,
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
defaults = newDefaults
|
|
153
|
+
await defaultsChanged?.()
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
function handleFulfillmentPoliciesChange(selectedIds: Array<string>) {
|
|
157
|
+
fulfillmentPolicies = selectedIds
|
|
158
|
+
handleInputChange()
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
function handlePaymentPoliciesChange(selectedIds: Array<string>) {
|
|
162
|
+
paymentPolicies = selectedIds
|
|
163
|
+
handleInputChange()
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
function handleReturnPoliciesChange(selectedIds: Array<string>) {
|
|
167
|
+
returnPolicies = selectedIds
|
|
168
|
+
handleInputChange()
|
|
169
|
+
}
|
|
170
|
+
</script>
|
|
171
|
+
|
|
172
|
+
<div class="row">
|
|
173
|
+
<div class="col">
|
|
174
|
+
<PolicyList
|
|
175
|
+
title={translate('configuration.ecommerce.fulfillmentPoliciesTitle', 'Fulfillment Policies')}
|
|
176
|
+
policies={fulfillmentPolicyList}
|
|
177
|
+
selectedPolicyIds={fulfillmentPolicies}
|
|
178
|
+
onSelectionChange={handleFulfillmentPoliciesChange}
|
|
179
|
+
/>
|
|
180
|
+
<PolicyList
|
|
181
|
+
title={translate('configuration.ecommerce.paymentPoliciesTitle', 'Payment Policies')}
|
|
182
|
+
policies={paymentPolicyList}
|
|
183
|
+
selectedPolicyIds={paymentPolicies}
|
|
184
|
+
onSelectionChange={handlePaymentPoliciesChange}
|
|
185
|
+
/>
|
|
186
|
+
<PolicyList
|
|
187
|
+
title={translate('configuration.ecommerce.returnPoliciesTitle', 'Return Policies')}
|
|
188
|
+
policies={returnPolicyList}
|
|
189
|
+
selectedPolicyIds={returnPolicies}
|
|
190
|
+
onSelectionChange={handleReturnPoliciesChange}
|
|
191
|
+
/>
|
|
192
|
+
</div>
|
|
193
|
+
</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>
|
|
214
|
+
</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>
|
|
240
|
+
</div>
|
|
241
|
+
</div>
|
|
242
|
+
<div class="row">
|
|
243
|
+
<div class="col">
|
|
244
|
+
<Select
|
|
245
|
+
label={translate('configuration.ecommerce.condition', 'Condition')}
|
|
246
|
+
emptyText="-- {translate('configuration.ecommerce.selectCondition', 'Select Condition')} --"
|
|
247
|
+
bind:value={conditionId}
|
|
248
|
+
onchange={handleInputChange}
|
|
249
|
+
>
|
|
250
|
+
{#each ecommerceConditions as condition}
|
|
251
|
+
<option value={condition.ecommerceConditionId}>{condition.name}</option>
|
|
252
|
+
{/each}
|
|
253
|
+
</Select>
|
|
254
|
+
</div>
|
|
255
|
+
<div class="col">
|
|
256
|
+
<Input
|
|
257
|
+
label={translate('configuration.ecommerce.conditionDescription', 'Condition Description')}
|
|
258
|
+
maxlength={1000}
|
|
259
|
+
bind:value={conditionDescription}
|
|
260
|
+
onchange={handleInputChange}
|
|
261
|
+
/>
|
|
262
|
+
</div>
|
|
263
|
+
</div>
|
|
264
|
+
<div class="row">
|
|
265
|
+
<div class="col">
|
|
266
|
+
<Input
|
|
267
|
+
label={translate('configuration.ecommerce.brand', 'Brand')}
|
|
268
|
+
maxlength={100}
|
|
269
|
+
bind:value={brandMapping}
|
|
270
|
+
onchange={handleInputChange}
|
|
271
|
+
placeholder={'{?PartManufacturer}'}
|
|
272
|
+
/>
|
|
273
|
+
</div>
|
|
274
|
+
<div class="col">
|
|
275
|
+
<Input
|
|
276
|
+
label={translate('configuration.ecommerce.manufacturerPartNumber', 'Manufacturer Part Number')}
|
|
277
|
+
maxlength={100}
|
|
278
|
+
bind:value={manufacturerPartNumberMapping}
|
|
279
|
+
onchange={handleInputChange}
|
|
280
|
+
placeholder={'{?PartModel}'}
|
|
281
|
+
/>
|
|
282
|
+
</div>
|
|
283
|
+
</div>
|
|
284
|
+
<div class="row">
|
|
285
|
+
<div class="col">
|
|
286
|
+
<Select
|
|
287
|
+
label={translate('configuration.ecommerce.packageType', 'Package Type')}
|
|
288
|
+
emptyText="-- {translate('configuration.ecommerce.selectDefaultPackage', 'Select Default Package')} --"
|
|
289
|
+
onchange={handleInputChange}
|
|
290
|
+
bind:value={packageType}
|
|
291
|
+
>
|
|
292
|
+
{#each packageTypes as pkg}
|
|
293
|
+
<option value={pkg.partnerValue}>{pkg.name}</option>
|
|
294
|
+
{/each}
|
|
295
|
+
</Select>
|
|
296
|
+
</div>
|
|
297
|
+
<div class="col">
|
|
298
|
+
<Input
|
|
299
|
+
label={translate('configuration.ecommerce.listingDuration', 'Listing Duration')}
|
|
300
|
+
bind:value={listingDuration}
|
|
301
|
+
onchange={handleInputChange}
|
|
302
|
+
/>
|
|
303
|
+
</div>
|
|
304
|
+
</div>
|
|
305
|
+
<div class="row">
|
|
306
|
+
<div class="col mt-3">
|
|
307
|
+
<Button
|
|
308
|
+
outline
|
|
309
|
+
size="sm"
|
|
310
|
+
href="https://wikido.isoftdata.com//index.php?title=Ebay_templates"
|
|
311
|
+
target="htp_chromium_popout"
|
|
312
|
+
icon="question-circle">{translate('configuration.ecommerce.templateHelp', 'Template Help')}</Button
|
|
313
|
+
>
|
|
314
|
+
</div>
|
|
315
|
+
</div>
|
|
316
|
+
<div class="row">
|
|
317
|
+
<div class="col">
|
|
318
|
+
<Textarea
|
|
319
|
+
label={translate('configuration.ecommerce.titleTemplate', 'Title Template')}
|
|
320
|
+
onchange={handleInputChange}
|
|
321
|
+
rows={10}
|
|
322
|
+
bind:value={listingTitleTemplate}
|
|
323
|
+
/>
|
|
324
|
+
</div>
|
|
325
|
+
<div class="col">
|
|
326
|
+
<Textarea
|
|
327
|
+
label={translate('configuration.ecommerce.descriptionTemplate', 'Description Template')}
|
|
328
|
+
onchange={handleInputChange}
|
|
329
|
+
rows={10}
|
|
330
|
+
bind:value={listingDescriptionTemplate}
|
|
331
|
+
/>
|
|
332
|
+
</div>
|
|
333
|
+
</div>
|