@salla.sa/twilight-components 2.9.48 → 2.10.0
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/dist/cjs/{index-4700898c.js → app-globals-a24e299c.js} +31 -2
- package/dist/cjs/index-1d2b3370.js +0 -4
- package/dist/cjs/loader.cjs.js +3 -2
- package/dist/cjs/salla-add-product-button.cjs.entry.js +7 -3
- package/dist/cjs/salla-button_35.cjs.entry.js +595 -1903
- package/dist/cjs/twilight.cjs.js +3 -2
- package/dist/collection/collection-manifest.json +0 -1
- package/dist/collection/components/salla-add-product-button/salla-add-product-button.js +9 -5
- package/dist/collection/components/salla-button/salla-button.js +5 -1
- package/dist/collection/components/salla-cart-summary/salla-cart-summary.js +3 -3
- package/dist/collection/components/salla-file-upload/salla-file-upload.js +9 -8
- package/dist/collection/components/salla-gifting/salla-gifting.js +18 -14
- package/dist/collection/components/salla-loyalty/salla-loyalty.js +5 -3
- package/dist/collection/components/salla-offer-modal/salla-offer-modal.js +6 -5
- package/dist/collection/components/salla-rating-stars/salla-rating-stars.js +14 -10
- package/dist/collection/components/salla-slider/salla-slider.css +242 -0
- package/dist/collection/components/salla-slider/salla-slider.js +403 -110
- package/dist/collection/components/salla-user-menu/salla-user-menu.js +8 -1
- package/dist/collection/global/app-dev.js +2 -1
- package/dist/collection/global/app.js +15 -0
- package/dist/components/index.d.ts +0 -1
- package/dist/components/index.js +31 -3
- package/dist/components/salla-add-product-button.js +7 -3
- package/dist/components/salla-button2.js +5 -1
- package/dist/components/salla-cart-summary.js +3 -3
- package/dist/components/salla-file-upload2.js +249 -3
- package/dist/components/salla-gifting.js +26 -16
- package/dist/components/salla-loyalty.js +3 -3
- package/dist/components/salla-offer-modal.js +5 -4
- package/dist/components/salla-rating-stars2.js +8 -4
- package/dist/components/salla-slider2.js +229 -1806
- package/dist/components/salla-user-menu.js +8 -1
- package/dist/esm/{index-55e33cdf.js → app-globals-1619c0de.js} +31 -2
- package/dist/esm/index-f1d446ac.js +0 -4
- package/dist/esm/loader.js +3 -2
- package/dist/esm/salla-add-product-button.entry.js +7 -3
- package/dist/esm/salla-button_35.entry.js +594 -1902
- package/dist/esm/twilight.js +3 -2
- package/dist/esm-es5/{index-55e33cdf.js → app-globals-1619c0de.js} +2 -2
- package/dist/esm-es5/index-f1d446ac.js +2 -2
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/salla-add-product-button.entry.js +1 -1
- package/dist/esm-es5/salla-button_35.entry.js +11 -5
- package/dist/esm-es5/twilight.js +1 -1
- package/dist/twilight/p-0f839b43.system.js +4 -0
- package/dist/twilight/p-3420f00c.entry.js +30 -0
- package/dist/twilight/p-5207a10c.system.js +24 -0
- package/dist/twilight/{p-486ce499.system.entry.js → p-5a1197bb.system.entry.js} +1 -1
- package/dist/twilight/p-5b30b649.system.entry.js +47 -0
- package/dist/twilight/p-97614f6d.js +24 -0
- package/dist/twilight/{p-6f41faf8.entry.js → p-dbb379ce.entry.js} +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/twilight/twilight.js +1 -1
- package/dist/types/components/salla-cart-summary/salla-cart-summary.d.ts +3 -3
- package/dist/types/components/salla-slider/salla-slider.d.ts +73 -14
- package/dist/types/components/salla-user-menu/salla-user-menu.d.ts +1 -0
- package/dist/types/components.d.ts +83 -60
- package/dist/types/global/app-dev.d.ts +0 -1
- package/package.json +6 -4
- package/dist/cjs/core-c7a9fb22.js +0 -4982
- package/dist/cjs/salla-swiper.cjs.entry.js +0 -62
- package/dist/collection/components/salla-swiper/salla-swiper.css +0 -177
- package/dist/collection/components/salla-swiper/salla-swiper.js +0 -152
- package/dist/components/arrow-left.js +0 -11
- package/dist/components/core.js +0 -4959
- package/dist/components/salla-swiper.d.ts +0 -11
- package/dist/components/salla-swiper.js +0 -92
- package/dist/esm/core-572aabd0.js +0 -4973
- package/dist/esm/salla-swiper.entry.js +0 -58
- package/dist/esm-es5/core-572aabd0.js +0 -4
- package/dist/esm-es5/salla-swiper.entry.js +0 -4
- package/dist/twilight/p-00e66d1a.system.js +0 -4
- package/dist/twilight/p-0cf11465.system.js +0 -4
- package/dist/twilight/p-0de275dc.system.entry.js +0 -41
- package/dist/twilight/p-37381192.entry.js +0 -30
- package/dist/twilight/p-684a004a.system.entry.js +0 -4
- package/dist/twilight/p-6b7896e1.system.js +0 -24
- package/dist/twilight/p-6ed7d3a2.js +0 -4
- package/dist/twilight/p-e8c3c209.entry.js +0 -4
- package/dist/twilight/p-f286c803.js +0 -24
- package/dist/types/components/salla-swiper/salla-swiper.d.ts +0 -31
- package/dist/types/index.d.ts +0 -7
|
@@ -14231,6 +14231,252 @@ var filepondPluginImageEdit = createCommonjsModule(function (module, exports) {
|
|
|
14231
14231
|
});
|
|
14232
14232
|
});
|
|
14233
14233
|
|
|
14234
|
+
var filepondPluginFileValidateType = createCommonjsModule(function (module, exports) {
|
|
14235
|
+
/*!
|
|
14236
|
+
* FilePondPluginFileValidateType 1.2.8
|
|
14237
|
+
* Licensed under MIT, https://opensource.org/licenses/MIT/
|
|
14238
|
+
* Please visit https://pqina.nl/filepond/ for details.
|
|
14239
|
+
*/
|
|
14240
|
+
|
|
14241
|
+
/* eslint-disable */
|
|
14242
|
+
|
|
14243
|
+
(function(global, factory) {
|
|
14244
|
+
(module.exports = factory())
|
|
14245
|
+
;
|
|
14246
|
+
})(commonjsGlobal, function() {
|
|
14247
|
+
|
|
14248
|
+
var plugin = function plugin(_ref) {
|
|
14249
|
+
var addFilter = _ref.addFilter,
|
|
14250
|
+
utils = _ref.utils;
|
|
14251
|
+
// get quick reference to Type utils
|
|
14252
|
+
var Type = utils.Type,
|
|
14253
|
+
isString = utils.isString,
|
|
14254
|
+
replaceInString = utils.replaceInString,
|
|
14255
|
+
guesstimateMimeType = utils.guesstimateMimeType,
|
|
14256
|
+
getExtensionFromFilename = utils.getExtensionFromFilename,
|
|
14257
|
+
getFilenameFromURL = utils.getFilenameFromURL;
|
|
14258
|
+
|
|
14259
|
+
var mimeTypeMatchesWildCard = function mimeTypeMatchesWildCard(
|
|
14260
|
+
mimeType,
|
|
14261
|
+
wildcard
|
|
14262
|
+
) {
|
|
14263
|
+
var mimeTypeGroup = (/^[^/]+/.exec(mimeType) || []).pop(); // image/png -> image
|
|
14264
|
+
var wildcardGroup = wildcard.slice(0, -2); // image/* -> image
|
|
14265
|
+
return mimeTypeGroup === wildcardGroup;
|
|
14266
|
+
};
|
|
14267
|
+
|
|
14268
|
+
var isValidMimeType = function isValidMimeType(
|
|
14269
|
+
acceptedTypes,
|
|
14270
|
+
userInputType
|
|
14271
|
+
) {
|
|
14272
|
+
return acceptedTypes.some(function(acceptedType) {
|
|
14273
|
+
// accepted is wildcard mime type
|
|
14274
|
+
if (/\*$/.test(acceptedType)) {
|
|
14275
|
+
return mimeTypeMatchesWildCard(userInputType, acceptedType);
|
|
14276
|
+
}
|
|
14277
|
+
|
|
14278
|
+
// is normal mime type
|
|
14279
|
+
return acceptedType === userInputType;
|
|
14280
|
+
});
|
|
14281
|
+
};
|
|
14282
|
+
|
|
14283
|
+
var getItemType = function getItemType(item) {
|
|
14284
|
+
// if the item is a url we guess the mime type by the extension
|
|
14285
|
+
var type = '';
|
|
14286
|
+
if (isString(item)) {
|
|
14287
|
+
var filename = getFilenameFromURL(item);
|
|
14288
|
+
var extension = getExtensionFromFilename(filename);
|
|
14289
|
+
if (extension) {
|
|
14290
|
+
type = guesstimateMimeType(extension);
|
|
14291
|
+
}
|
|
14292
|
+
} else {
|
|
14293
|
+
type = item.type;
|
|
14294
|
+
}
|
|
14295
|
+
|
|
14296
|
+
return type;
|
|
14297
|
+
};
|
|
14298
|
+
|
|
14299
|
+
var validateFile = function validateFile(
|
|
14300
|
+
item,
|
|
14301
|
+
acceptedFileTypes,
|
|
14302
|
+
typeDetector
|
|
14303
|
+
) {
|
|
14304
|
+
// no types defined, everything is allowed \o/
|
|
14305
|
+
if (acceptedFileTypes.length === 0) {
|
|
14306
|
+
return true;
|
|
14307
|
+
}
|
|
14308
|
+
|
|
14309
|
+
// gets the item type
|
|
14310
|
+
var type = getItemType(item);
|
|
14311
|
+
|
|
14312
|
+
// no type detector, test now
|
|
14313
|
+
if (!typeDetector) {
|
|
14314
|
+
return isValidMimeType(acceptedFileTypes, type);
|
|
14315
|
+
}
|
|
14316
|
+
|
|
14317
|
+
// use type detector
|
|
14318
|
+
return new Promise(function(resolve, reject) {
|
|
14319
|
+
typeDetector(item, type)
|
|
14320
|
+
.then(function(detectedType) {
|
|
14321
|
+
if (isValidMimeType(acceptedFileTypes, detectedType)) {
|
|
14322
|
+
resolve();
|
|
14323
|
+
} else {
|
|
14324
|
+
reject();
|
|
14325
|
+
}
|
|
14326
|
+
})
|
|
14327
|
+
.catch(reject);
|
|
14328
|
+
});
|
|
14329
|
+
};
|
|
14330
|
+
|
|
14331
|
+
var applyMimeTypeMap = function applyMimeTypeMap(map) {
|
|
14332
|
+
return function(acceptedFileType) {
|
|
14333
|
+
return map[acceptedFileType] === null
|
|
14334
|
+
? false
|
|
14335
|
+
: map[acceptedFileType] || acceptedFileType;
|
|
14336
|
+
};
|
|
14337
|
+
};
|
|
14338
|
+
|
|
14339
|
+
// setup attribute mapping for accept
|
|
14340
|
+
addFilter('SET_ATTRIBUTE_TO_OPTION_MAP', function(map) {
|
|
14341
|
+
return Object.assign(map, {
|
|
14342
|
+
accept: 'acceptedFileTypes'
|
|
14343
|
+
});
|
|
14344
|
+
});
|
|
14345
|
+
|
|
14346
|
+
// filtering if an item is allowed in hopper
|
|
14347
|
+
addFilter('ALLOW_HOPPER_ITEM', function(file, _ref2) {
|
|
14348
|
+
var query = _ref2.query;
|
|
14349
|
+
// if we are not doing file type validation exit
|
|
14350
|
+
if (!query('GET_ALLOW_FILE_TYPE_VALIDATION')) {
|
|
14351
|
+
return true;
|
|
14352
|
+
}
|
|
14353
|
+
|
|
14354
|
+
// we validate the file against the accepted file types
|
|
14355
|
+
return validateFile(file, query('GET_ACCEPTED_FILE_TYPES'));
|
|
14356
|
+
});
|
|
14357
|
+
|
|
14358
|
+
// called for each file that is loaded
|
|
14359
|
+
// right before it is set to the item state
|
|
14360
|
+
// should return a promise
|
|
14361
|
+
addFilter('LOAD_FILE', function(file, _ref3) {
|
|
14362
|
+
var query = _ref3.query;
|
|
14363
|
+
return new Promise(function(resolve, reject) {
|
|
14364
|
+
if (!query('GET_ALLOW_FILE_TYPE_VALIDATION')) {
|
|
14365
|
+
resolve(file);
|
|
14366
|
+
return;
|
|
14367
|
+
}
|
|
14368
|
+
|
|
14369
|
+
var acceptedFileTypes = query('GET_ACCEPTED_FILE_TYPES');
|
|
14370
|
+
|
|
14371
|
+
// custom type detector method
|
|
14372
|
+
var typeDetector = query('GET_FILE_VALIDATE_TYPE_DETECT_TYPE');
|
|
14373
|
+
|
|
14374
|
+
// if invalid, exit here
|
|
14375
|
+
var validationResult = validateFile(
|
|
14376
|
+
file,
|
|
14377
|
+
acceptedFileTypes,
|
|
14378
|
+
typeDetector
|
|
14379
|
+
);
|
|
14380
|
+
|
|
14381
|
+
var handleRejection = function handleRejection() {
|
|
14382
|
+
var acceptedFileTypesMapped = acceptedFileTypes
|
|
14383
|
+
.map(
|
|
14384
|
+
applyMimeTypeMap(
|
|
14385
|
+
query('GET_FILE_VALIDATE_TYPE_LABEL_EXPECTED_TYPES_MAP')
|
|
14386
|
+
)
|
|
14387
|
+
)
|
|
14388
|
+
.filter(function(label) {
|
|
14389
|
+
return label !== false;
|
|
14390
|
+
});
|
|
14391
|
+
|
|
14392
|
+
var acceptedFileTypesMapped_unique = acceptedFileTypesMapped.filter(
|
|
14393
|
+
function(item, index) {
|
|
14394
|
+
return acceptedFileTypesMapped.indexOf(item) === index;
|
|
14395
|
+
}
|
|
14396
|
+
);
|
|
14397
|
+
|
|
14398
|
+
reject({
|
|
14399
|
+
status: {
|
|
14400
|
+
main: query('GET_LABEL_FILE_TYPE_NOT_ALLOWED'),
|
|
14401
|
+
sub: replaceInString(
|
|
14402
|
+
query('GET_FILE_VALIDATE_TYPE_LABEL_EXPECTED_TYPES'),
|
|
14403
|
+
{
|
|
14404
|
+
allTypes: acceptedFileTypesMapped_unique.join(', '),
|
|
14405
|
+
allButLastType: acceptedFileTypesMapped_unique
|
|
14406
|
+
.slice(0, -1)
|
|
14407
|
+
.join(', '),
|
|
14408
|
+
lastType:
|
|
14409
|
+
acceptedFileTypesMapped_unique[
|
|
14410
|
+
acceptedFileTypesMapped.length - 1
|
|
14411
|
+
]
|
|
14412
|
+
}
|
|
14413
|
+
)
|
|
14414
|
+
}
|
|
14415
|
+
});
|
|
14416
|
+
};
|
|
14417
|
+
|
|
14418
|
+
// has returned new filename immidiately
|
|
14419
|
+
if (typeof validationResult === 'boolean') {
|
|
14420
|
+
if (!validationResult) {
|
|
14421
|
+
return handleRejection();
|
|
14422
|
+
}
|
|
14423
|
+
return resolve(file);
|
|
14424
|
+
}
|
|
14425
|
+
|
|
14426
|
+
// is promise
|
|
14427
|
+
validationResult
|
|
14428
|
+
.then(function() {
|
|
14429
|
+
resolve(file);
|
|
14430
|
+
})
|
|
14431
|
+
.catch(handleRejection);
|
|
14432
|
+
});
|
|
14433
|
+
});
|
|
14434
|
+
|
|
14435
|
+
// expose plugin
|
|
14436
|
+
return {
|
|
14437
|
+
// default options
|
|
14438
|
+
options: {
|
|
14439
|
+
// Enable or disable file type validation
|
|
14440
|
+
allowFileTypeValidation: [true, Type.BOOLEAN],
|
|
14441
|
+
|
|
14442
|
+
// What file types to accept
|
|
14443
|
+
acceptedFileTypes: [[], Type.ARRAY],
|
|
14444
|
+
// - must be comma separated
|
|
14445
|
+
// - mime types: image/png, image/jpeg, image/gif
|
|
14446
|
+
// - extensions: .png, .jpg, .jpeg ( not enabled yet )
|
|
14447
|
+
// - wildcards: image/*
|
|
14448
|
+
|
|
14449
|
+
// label to show when a type is not allowed
|
|
14450
|
+
labelFileTypeNotAllowed: ['File is of invalid type', Type.STRING],
|
|
14451
|
+
|
|
14452
|
+
// nicer label
|
|
14453
|
+
fileValidateTypeLabelExpectedTypes: [
|
|
14454
|
+
'Expects {allButLastType} or {lastType}',
|
|
14455
|
+
Type.STRING
|
|
14456
|
+
],
|
|
14457
|
+
|
|
14458
|
+
// map mime types to extensions
|
|
14459
|
+
fileValidateTypeLabelExpectedTypesMap: [{}, Type.OBJECT],
|
|
14460
|
+
|
|
14461
|
+
// Custom function to detect type of file
|
|
14462
|
+
fileValidateTypeDetectType: [null, Type.FUNCTION]
|
|
14463
|
+
}
|
|
14464
|
+
};
|
|
14465
|
+
};
|
|
14466
|
+
|
|
14467
|
+
// fire pluginloaded event if running in browser, this allows registering the plugin when using async script tags
|
|
14468
|
+
var isBrowser =
|
|
14469
|
+
typeof window !== 'undefined' && typeof window.document !== 'undefined';
|
|
14470
|
+
if (isBrowser) {
|
|
14471
|
+
document.dispatchEvent(
|
|
14472
|
+
new CustomEvent('FilePond:pluginloaded', { detail: plugin })
|
|
14473
|
+
);
|
|
14474
|
+
}
|
|
14475
|
+
|
|
14476
|
+
return plugin;
|
|
14477
|
+
});
|
|
14478
|
+
});
|
|
14479
|
+
|
|
14234
14480
|
const sallaFileUploadCss = "/*!\n * FilePond 4.30.4\n * Licensed under MIT, https://opensource.org/licenses/MIT/\n * Please visit https://pqina.nl/filepond/ for details.\n */.filepond--assistant{position:absolute;overflow:hidden;height:1px;width:1px;padding:0;border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);white-space:nowrap}.filepond--browser.filepond--browser{position:absolute;margin:0;padding:0;left:1em;top:1.75em;width:calc(100% - 2em);opacity:0;font-size:0}.filepond--data{position:absolute;width:0;height:0;padding:0;margin:0;border:none;visibility:hidden;pointer-events:none;contain:strict}.filepond--drip{position:absolute;top:0;left:0;right:0;bottom:0;overflow:hidden;opacity:.1;pointer-events:none;border-radius:.5em;background:rgba(0,0,0,.01)}.filepond--drip-blob{-webkit-transform-origin:center center;transform-origin:center center;width:8em;height:8em;margin-left:-4em;margin-top:-4em;background:#292625;border-radius:50%}.filepond--drip-blob,.filepond--drop-label{position:absolute;top:0;left:0;will-change:transform,opacity}.filepond--drop-label{right:0;margin:0;color:#4f4f4f;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;height:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.filepond--drop-label.filepond--drop-label label{display:block;margin:0;padding:.5em}.filepond--drop-label label{cursor:default;font-size:.875em;font-weight:400;text-align:center;line-height:1.5}.filepond--label-action{text-decoration:underline;-webkit-text-decoration-skip:ink;text-decoration-skip-ink:auto;-webkit-text-decoration-color:#a7a4a4;text-decoration-color:#a7a4a4;cursor:pointer}.filepond--root[data-disabled] .filepond--drop-label label{opacity:.5}.filepond--file-action-button.filepond--file-action-button{font-size:1em;width:1.625em;height:1.625em;font-family:inherit;line-height:inherit;margin:0;padding:0;border:none;outline:none;will-change:transform,opacity}.filepond--file-action-button.filepond--file-action-button span{position:absolute;overflow:hidden;height:1px;width:1px;padding:0;border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);white-space:nowrap}.filepond--file-action-button.filepond--file-action-button svg{width:100%;height:100%}.filepond--file-action-button.filepond--file-action-button:after{position:absolute;left:-.75em;right:-.75em;top:-.75em;bottom:-.75em;content:\"\"}.filepond--file-action-button{cursor:auto;color:#fff;border-radius:50%;background-color:rgba(0,0,0,.5);background-image:none;-webkit-box-shadow:0 0 0 0 hsla(0,0%,100%,0);box-shadow:0 0 0 0 hsla(0,0%,100%,0);-webkit-transition:-webkit-box-shadow .25s ease-in;transition:-webkit-box-shadow .25s ease-in;transition:box-shadow .25s ease-in;transition:box-shadow .25s ease-in, -webkit-box-shadow .25s ease-in}.filepond--file-action-button:focus,.filepond--file-action-button:hover{-webkit-box-shadow:0 0 0 .125em hsla(0,0%,100%,.9);box-shadow:0 0 0 .125em hsla(0,0%,100%,.9)}.filepond--file-action-button[disabled]{color:hsla(0,0%,100%,.5);background-color:rgba(0,0,0,.25)}.filepond--file-action-button[hidden]{display:none}.filepond--action-edit-item.filepond--action-edit-item{width:2em;height:2em;padding:.1875em}.filepond--action-edit-item.filepond--action-edit-item[data-align*=center]{margin-left:-.1875em}.filepond--action-edit-item.filepond--action-edit-item[data-align*=bottom]{margin-bottom:-.1875em}.filepond--action-edit-item-alt{border:none;line-height:inherit;background:transparent;font-family:inherit;color:inherit;outline:none;padding:0;margin:0 0 0 .25em;pointer-events:all;position:absolute}.filepond--action-edit-item-alt svg{width:1.3125em;height:1.3125em}.filepond--action-edit-item-alt span{font-size:0;opacity:0}.filepond--file-info{position:static;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:start;align-items:flex-start;-ms-flex:1;flex:1;margin:0 .5em 0 0;min-width:0;will-change:transform,opacity;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.filepond--file-info *{margin:0}.filepond--file-info .filepond--file-info-main{font-size:.75em;line-height:1.2;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;width:100%}.filepond--file-info .filepond--file-info-sub{font-size:.625em;opacity:.5;-webkit-transition:opacity .25s ease-in-out;transition:opacity .25s ease-in-out;white-space:nowrap}.filepond--file-info .filepond--file-info-sub:empty{display:none}.filepond--file-status{position:static;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:end;align-items:flex-end;-ms-flex-positive:0;flex-grow:0;-ms-flex-negative:0;flex-shrink:0;margin:0;min-width:2.25em;text-align:right;will-change:transform,opacity;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.filepond--file-status *{margin:0;white-space:nowrap}.filepond--file-status .filepond--file-status-main{font-size:.75em;line-height:1.2}.filepond--file-status .filepond--file-status-sub{font-size:.625em;opacity:.5;-webkit-transition:opacity .25s ease-in-out;transition:opacity .25s ease-in-out}.filepond--file-wrapper.filepond--file-wrapper{border:none;margin:0;padding:0;min-width:0;height:100%}.filepond--file-wrapper.filepond--file-wrapper>legend{position:absolute;overflow:hidden;height:1px;width:1px;padding:0;border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);white-space:nowrap}.filepond--file{position:static;display:-ms-flexbox;display:flex;height:100%;-ms-flex-align:start;align-items:flex-start;padding:.5625em;color:#fff;border-radius:.5em}.filepond--file .filepond--file-status{margin-left:auto;margin-right:2.25em}.filepond--file .filepond--processing-complete-indicator{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:3}.filepond--file .filepond--file-action-button,.filepond--file .filepond--processing-complete-indicator,.filepond--file .filepond--progress-indicator{position:absolute}.filepond--file [data-align*=left]{left:.5625em}.filepond--file [data-align*=right]{right:.5625em}.filepond--file [data-align*=center]{left:calc(50% - .8125em)}.filepond--file [data-align*=bottom]{bottom:1.125em}.filepond--file [data-align=center]{top:calc(50% - .8125em)}.filepond--file .filepond--progress-indicator{margin-top:.1875em}.filepond--file .filepond--progress-indicator[data-align*=right]{margin-right:.1875em}.filepond--file .filepond--progress-indicator[data-align*=left]{margin-left:.1875em}[data-filepond-item-state*=error] .filepond--file-info,[data-filepond-item-state*=invalid] .filepond--file-info,[data-filepond-item-state=cancelled] .filepond--file-info{margin-right:2.25em}[data-filepond-item-state~=processing] .filepond--file-status-sub{opacity:0}[data-filepond-item-state~=processing] .filepond--action-abort-item-processing~.filepond--file-status .filepond--file-status-sub{opacity:.5}[data-filepond-item-state=processing-error] .filepond--file-status-sub{opacity:0}[data-filepond-item-state=processing-error] .filepond--action-retry-item-processing~.filepond--file-status .filepond--file-status-sub{opacity:.5}[data-filepond-item-state=processing-complete] .filepond--action-revert-item-processing svg{-webkit-animation:fall .5s linear .125s both;animation:fall .5s linear .125s both}[data-filepond-item-state=processing-complete] .filepond--file-status-sub{opacity:.5}[data-filepond-item-state=processing-complete] .filepond--file-info-sub,[data-filepond-item-state=processing-complete] .filepond--processing-complete-indicator:not([style*=hidden])~.filepond--file-status .filepond--file-status-sub{opacity:0}[data-filepond-item-state=processing-complete] .filepond--action-revert-item-processing~.filepond--file-info .filepond--file-info-sub{opacity:.5}[data-filepond-item-state*=error] .filepond--file-wrapper,[data-filepond-item-state*=error] .filepond--panel,[data-filepond-item-state*=invalid] .filepond--file-wrapper,[data-filepond-item-state*=invalid] .filepond--panel{-webkit-animation:shake .65s linear both;animation:shake .65s linear both}[data-filepond-item-state*=busy] .filepond--progress-indicator svg{-webkit-animation:spin 1s linear infinite;animation:spin 1s linear infinite}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@-webkit-keyframes shake{10%,90%{-webkit-transform:translateX(-.0625em);transform:translateX(-.0625em)}20%,80%{-webkit-transform:translateX(.125em);transform:translateX(.125em)}30%,50%,70%{-webkit-transform:translateX(-.25em);transform:translateX(-.25em)}40%,60%{-webkit-transform:translateX(.25em);transform:translateX(.25em)}}@keyframes shake{10%,90%{-webkit-transform:translateX(-.0625em);transform:translateX(-.0625em)}20%,80%{-webkit-transform:translateX(.125em);transform:translateX(.125em)}30%,50%,70%{-webkit-transform:translateX(-.25em);transform:translateX(-.25em)}40%,60%{-webkit-transform:translateX(.25em);transform:translateX(.25em)}}@-webkit-keyframes fall{0%{opacity:0;-webkit-transform:scale(.5);transform:scale(.5);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}70%{opacity:1;-webkit-transform:scale(1.1);transform:scale(1.1);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}to{-webkit-transform:scale(1);transform:scale(1);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}@keyframes fall{0%{opacity:0;-webkit-transform:scale(.5);transform:scale(.5);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}70%{opacity:1;-webkit-transform:scale(1.1);transform:scale(1.1);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}to{-webkit-transform:scale(1);transform:scale(1);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}.filepond--hopper[data-hopper-state=drag-over]>*{pointer-events:none}.filepond--hopper[data-hopper-state=drag-over]:after{content:\"\";position:absolute;left:0;top:0;right:0;bottom:0;z-index:100}.filepond--progress-indicator{z-index:103}.filepond--file-action-button{z-index:102}.filepond--file-status{z-index:101}.filepond--file-info{z-index:100}.filepond--item{position:absolute;top:0;left:0;right:0;z-index:1;padding:0;margin:.25em;will-change:transform,opacity}.filepond--item>.filepond--panel{z-index:-1}.filepond--item>.filepond--panel .filepond--panel-bottom{-webkit-box-shadow:0 .0625em .125em -.0625em rgba(0,0,0,.25);box-shadow:0 .0625em .125em -.0625em rgba(0,0,0,.25)}.filepond--item>.filepond--file-wrapper,.filepond--item>.filepond--panel{-webkit-transition:opacity .15s ease-out;transition:opacity .15s ease-out}.filepond--item[data-drag-state]{cursor:-webkit-grab;cursor:grab}.filepond--item[data-drag-state]>.filepond--panel{-webkit-transition:-webkit-box-shadow .125s ease-in-out;transition:-webkit-box-shadow .125s ease-in-out;transition:box-shadow .125s ease-in-out;transition:box-shadow .125s ease-in-out, -webkit-box-shadow .125s ease-in-out;-webkit-box-shadow:0 0 0 transparent;box-shadow:0 0 0 transparent}.filepond--item[data-drag-state=drag]{cursor:-webkit-grabbing;cursor:grabbing}.filepond--item[data-drag-state=drag]>.filepond--panel{-webkit-box-shadow:0 .125em .3125em rgba(0,0,0,.325);box-shadow:0 .125em .3125em rgba(0,0,0,.325)}.filepond--item[data-drag-state]:not([data-drag-state=idle]){z-index:2}.filepond--item-panel{background-color:#64605e}[data-filepond-item-state=processing-complete] .filepond--item-panel{background-color:#369763}[data-filepond-item-state*=error] .filepond--item-panel,[data-filepond-item-state*=invalid] .filepond--item-panel{background-color:#c44e47}.filepond--item-panel{border-radius:.5em;-webkit-transition:background-color .25s;transition:background-color .25s}.filepond--list-scroller{position:absolute;top:0;left:0;right:0;margin:0;will-change:transform}.filepond--list-scroller[data-state=overflow] .filepond--list{bottom:0;right:0}.filepond--list-scroller[data-state=overflow]{overflow-y:scroll;overflow-x:hidden;-webkit-overflow-scrolling:touch;-webkit-mask:-webkit-gradient(linear,left top, left bottom,from(#000),to(transparent));-webkit-mask:linear-gradient(180deg,#000 calc(100% - .5em),transparent);mask:-webkit-gradient(linear,left top, left bottom,from(#000),to(transparent));mask:linear-gradient(180deg,#000 calc(100% - .5em),transparent)}.filepond--list-scroller::-webkit-scrollbar{background:transparent}.filepond--list-scroller::-webkit-scrollbar:vertical{width:1em}.filepond--list-scroller::-webkit-scrollbar:horizontal{height:0}.filepond--list-scroller::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.3);border-radius:99999px;border:.3125em solid transparent;background-clip:content-box}.filepond--list.filepond--list{position:absolute;top:0;margin:0;padding:0;list-style-type:none;will-change:transform}.filepond--list{left:.75em;right:.75em}.filepond--root[data-style-panel-layout~=integrated]{width:100%;height:100%;max-width:none;margin:0}.filepond--root[data-style-panel-layout~=circle] .filepond--panel-root,.filepond--root[data-style-panel-layout~=integrated] .filepond--panel-root{border-radius:0}.filepond--root[data-style-panel-layout~=circle] .filepond--panel-root>*,.filepond--root[data-style-panel-layout~=integrated] .filepond--panel-root>*{display:none}.filepond--root[data-style-panel-layout~=circle] .filepond--drop-label,.filepond--root[data-style-panel-layout~=integrated] .filepond--drop-label{bottom:0;height:auto;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;z-index:7}.filepond--root[data-style-panel-layout~=circle] .filepond--item-panel,.filepond--root[data-style-panel-layout~=integrated] .filepond--item-panel{display:none}.filepond--root[data-style-panel-layout~=compact] .filepond--list-scroller,.filepond--root[data-style-panel-layout~=integrated] .filepond--list-scroller{overflow:hidden;height:100%;margin-top:0;margin-bottom:0}.filepond--root[data-style-panel-layout~=compact] .filepond--list,.filepond--root[data-style-panel-layout~=integrated] .filepond--list{left:0;right:0;height:100%}.filepond--root[data-style-panel-layout~=compact] .filepond--item,.filepond--root[data-style-panel-layout~=integrated] .filepond--item{margin:0}.filepond--root[data-style-panel-layout~=compact] .filepond--file-wrapper,.filepond--root[data-style-panel-layout~=integrated] .filepond--file-wrapper{height:100%}.filepond--root[data-style-panel-layout~=compact] .filepond--drop-label,.filepond--root[data-style-panel-layout~=integrated] .filepond--drop-label{z-index:7}.filepond--root[data-style-panel-layout~=circle]{border-radius:99999rem;overflow:hidden}.filepond--root[data-style-panel-layout~=circle]>.filepond--panel{border-radius:inherit}.filepond--root[data-style-panel-layout~=circle]>.filepond--panel>*{display:none}.filepond--root[data-style-panel-layout~=circle] .filepond--file-info,.filepond--root[data-style-panel-layout~=circle] .filepond--file-status{display:none}.filepond--root[data-style-panel-layout~=circle] .filepond--action-edit-item{opacity:1!important;visibility:visible!important}@media not all and (-webkit-min-device-pixel-ratio:0), not all and (min-resolution:0.001dpcm){@supports (-webkit-appearance:none) and (stroke-color:transparent){.filepond--root[data-style-panel-layout~=circle]{will-change:transform}}}.filepond--panel-root{border-radius:.5em;background-color:#f1f0ef}.filepond--panel{position:absolute;left:0;top:0;right:0;margin:0;height:100%!important;pointer-events:none}.filepond-panel:not([data-scalable=false]){height:auto!important}.filepond--panel[data-scalable=false]>div{display:none}.filepond--panel[data-scalable=true]{-webkit-transform-style:preserve-3d;transform-style:preserve-3d;background-color:transparent!important;border:none!important}.filepond--panel-bottom,.filepond--panel-center,.filepond--panel-top{position:absolute;left:0;top:0;right:0;margin:0;padding:0}.filepond--panel-bottom,.filepond--panel-top{height:.5em}.filepond--panel-top{border-bottom-left-radius:0!important;border-bottom-right-radius:0!important;border-bottom:none!important}.filepond--panel-top:after{content:\"\";position:absolute;height:2px;left:0;right:0;bottom:-1px;background-color:inherit}.filepond--panel-bottom,.filepond--panel-center{will-change:transform;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-transform-origin:left top;transform-origin:left top;-webkit-transform:translate3d(0,.5em,0);transform:translate3d(0,.5em,0)}.filepond--panel-bottom{border-top-left-radius:0!important;border-top-right-radius:0!important;border-top:none!important}.filepond--panel-bottom:before{content:\"\";position:absolute;height:2px;left:0;right:0;top:-1px;background-color:inherit}.filepond--panel-center{height:100px!important;border-top:none!important;border-bottom:none!important;border-radius:0!important}.filepond--panel-center:not([style]){visibility:hidden}.filepond--progress-indicator{position:static;width:1.25em;height:1.25em;color:#fff;margin:0;pointer-events:none;will-change:transform,opacity}.filepond--progress-indicator svg{width:100%;height:100%;vertical-align:top;transform-box:fill-box}.filepond--progress-indicator path{fill:none;stroke:currentColor}.filepond--list-scroller{z-index:6}.filepond--drop-label{z-index:5}.filepond--drip{z-index:3}.filepond--root>.filepond--panel{z-index:2}.filepond--browser{z-index:1}.filepond--root{-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;margin-bottom:1em;font-size:1rem;line-height:normal;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;font-weight:450;text-align:left;text-rendering:optimizeLegibility;direction:ltr;contain:layout style size}.filepond--root *{-webkit-box-sizing:inherit;box-sizing:inherit;line-height:inherit}.filepond--root :not(text){font-size:inherit}.filepond--root[data-disabled]{pointer-events:none}.filepond--root[data-disabled] .filepond--list-scroller{pointer-events:all}.filepond--root[data-disabled] .filepond--list{pointer-events:none}.filepond--root .filepond--drop-label{min-height:4.75em}.filepond--root .filepond--list-scroller{margin-top:1em;margin-bottom:1em}.filepond--root .filepond--credits{position:absolute;right:0;opacity:.175;line-height:.85;font-size:11px;color:inherit;text-decoration:none;z-index:3;bottom:-14px}.filepond--root .filepond--credits[style]{top:0;bottom:auto;margin-top:14px}/*!\n * FilePondPluginImagePreview 4.6.11\n * Licensed under MIT, https://opensource.org/licenses/MIT/\n * Please visit https://pqina.nl/filepond/ for details.\n */.filepond--image-preview-markup{position:absolute;left:0;top:0}.filepond--image-preview-wrapper{z-index:2}.filepond--image-preview-overlay{display:block;position:absolute;left:0;top:0;width:100%;min-height:5rem;max-height:7rem;margin:0;opacity:0;z-index:2;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.filepond--image-preview-overlay svg{width:100%;height:auto;color:inherit;max-height:inherit}.filepond--image-preview-overlay-idle{mix-blend-mode:multiply;color:rgba(40, 40, 40, 0.85)}.filepond--image-preview-overlay-success{mix-blend-mode:normal;color:rgba(54, 151, 99, 1)}.filepond--image-preview-overlay-failure{mix-blend-mode:normal;color:rgba(196, 78, 71, 1)}@supports (-webkit-marquee-repetition: infinite) and\n ((-o-object-fit: fill) or (object-fit: fill)){.filepond--image-preview-overlay-idle{mix-blend-mode:normal}}.filepond--image-preview-wrapper{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:absolute;left:0;top:0;right:0;height:100%;margin:0;border-radius:0.45em;overflow:hidden;background:rgba(0, 0, 0, 0.01)}.filepond--image-preview{position:absolute;left:0;top:0;z-index:1;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;height:100%;width:100%;pointer-events:none;background:#222;will-change:transform, opacity}.filepond--image-clip{position:relative;overflow:hidden;margin:0 auto;}.filepond--image-clip[data-transparency-indicator='grid'] img,.filepond--image-clip[data-transparency-indicator='grid'] canvas{background-color:#fff;background-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg' fill='%23eee'%3E%3Cpath d='M0 0 H50 V50 H0'/%3E%3Cpath d='M50 50 H100 V100 H50'/%3E%3C/svg%3E\");background-size:1.25em 1.25em}.filepond--image-bitmap,.filepond--image-vector{position:absolute;left:0;top:0;will-change:transform}.filepond--root[data-style-panel-layout~='integrated'] .filepond--image-preview-wrapper{border-radius:0}.filepond--root[data-style-panel-layout~='integrated'] .filepond--image-preview{height:100%;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}.filepond--root[data-style-panel-layout~='circle'] .filepond--image-preview-wrapper{border-radius:99999rem}.filepond--root[data-style-panel-layout~='circle'] .filepond--image-preview-overlay{top:auto;bottom:0;-webkit-transform:scaleY(-1);transform:scaleY(-1)}.filepond--root[data-style-panel-layout~='circle'] .filepond--file .filepond--file-action-button[data-align*='bottom']:not([data-align*='center']){margin-bottom:0.325em}.filepond--root[data-style-panel-layout~='circle'] .filepond--file [data-align*='left']{left:calc(50% - 3em)}.filepond--root[data-style-panel-layout~='circle'] .filepond--file [data-align*='right']{right:calc(50% - 3em)}.filepond--root[data-style-panel-layout~='circle'] .filepond--progress-indicator[data-align*='bottom'][data-align*='left'],.filepond--root[data-style-panel-layout~='circle'] .filepond--progress-indicator[data-align*='bottom'][data-align*='right']{margin-bottom:calc(0.325em + 0.1875em)}.filepond--root[data-style-panel-layout~='circle'] .filepond--progress-indicator[data-align*='bottom'][data-align*='center']{margin-top:0;margin-bottom:0.1875em;margin-left:0.1875em}/*!\n * FilePondPluginImageEdit 1.6.3\n * Licensed under MIT, https://opensource.org/licenses/MIT/\n * Please visit https://pqina.nl/filepond/ for details.\n */.filepond--action-edit-item.filepond--action-edit-item{width:2em;height:2em;padding:0.1875em}.filepond--action-edit-item.filepond--action-edit-item[data-align*='center']{margin-left:-0.1875em}.filepond--action-edit-item.filepond--action-edit-item[data-align*='bottom']{margin-bottom:-0.1875em}.filepond--action-edit-item-alt{border:none;line-height:inherit;background:transparent;font-family:inherit;color:inherit;outline:none;padding:0;margin:0 0 0 0.25em;pointer-events:all;position:absolute}.filepond--action-edit-item-alt svg{width:1.3125em;height:1.3125em}.filepond--action-edit-item-alt span{font-size:0;opacity:0}.filepond--root[data-style-panel-layout~='circle'] .filepond--action-edit-item{opacity:1 !important;visibility:visible !important}";
|
|
14235
14481
|
|
|
14236
14482
|
const SallaFileUpload = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement$1 {
|
|
@@ -14484,7 +14730,6 @@ const SallaFileUpload = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
14484
14730
|
*/
|
|
14485
14731
|
this.files = [];
|
|
14486
14732
|
}
|
|
14487
|
-
;
|
|
14488
14733
|
/**
|
|
14489
14734
|
* Append intial file
|
|
14490
14735
|
*/
|
|
@@ -14495,7 +14740,7 @@ const SallaFileUpload = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
14495
14740
|
this.pond = this.intiFilePond();
|
|
14496
14741
|
}
|
|
14497
14742
|
intiFilePond() {
|
|
14498
|
-
filepond.registerPlugin(FilePondPluginImagePreview, filepondPluginImageExifOrientation, filepondPluginFileValidateSize, filepondPluginImageEdit);
|
|
14743
|
+
filepond.registerPlugin(FilePondPluginImagePreview, filepondPluginImageExifOrientation, filepondPluginFileValidateSize, filepondPluginImageEdit, filepondPluginFileValidateType);
|
|
14499
14744
|
return filepond.create(document.querySelector('.s-file-upload-input'), {
|
|
14500
14745
|
files: this.files,
|
|
14501
14746
|
required: this.required,
|
|
@@ -14529,6 +14774,7 @@ const SallaFileUpload = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
14529
14774
|
labelDecimalSeparator: this.labelDecimalSeparator,
|
|
14530
14775
|
labelThousandsSeparator: this.labelThousandsSeparator,
|
|
14531
14776
|
labelIdle: this.labelIdle,
|
|
14777
|
+
acceptedFileTypes: ['image/jpg', 'image/png', 'image/jpeg', 'image/gif', 'video/*'],
|
|
14532
14778
|
labelInvalidField: this.labelInvalidField,
|
|
14533
14779
|
labelFileWaitingForSize: this.labelFileWaitingForSize,
|
|
14534
14780
|
beforeRemoveFile: (file_deleted) => new Promise((resolve) => {
|
|
@@ -14538,7 +14784,7 @@ const SallaFileUpload = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
14538
14784
|
});
|
|
14539
14785
|
}
|
|
14540
14786
|
render() {
|
|
14541
|
-
return (h(Host, { class: "s-file-upload" }, h("input", { type: "file", class: "s-file-upload-wrapper s-file-upload-input", name: "filepond" })));
|
|
14787
|
+
return (h(Host, { class: "s-file-upload" }, h("input", { type: "file", class: "s-file-upload-wrapper s-file-upload-input", name: "filepond", accept: "image/png, image/jpeg, image/jpg, image/gif" })));
|
|
14542
14788
|
}
|
|
14543
14789
|
static get style() { return sallaFileUploadCss; }
|
|
14544
14790
|
}, [0, "salla-file-upload", {
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
5
5
|
import { a as anime } from './anime.es.js';
|
|
6
6
|
import { A as ArrowRightIcon } from './arrow-right.js';
|
|
7
|
-
import { A as ArrowLeftIcon } from './arrow-left.js';
|
|
8
7
|
import { C as Cancel } from './cancel.js';
|
|
9
8
|
import { d as defineCustomElement$b } from './salla-button2.js';
|
|
10
9
|
import { d as defineCustomElement$a } from './salla-datetime-picker2.js';
|
|
@@ -23,6 +22,13 @@ const Images = `<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32"
|
|
|
23
22
|
</svg>
|
|
24
23
|
`;
|
|
25
24
|
|
|
25
|
+
const LeftArrow = `<!-- Generated by IcoMoon.io -->
|
|
26
|
+
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
|
|
27
|
+
<title>arrow-left</title>
|
|
28
|
+
<path d="M28 14.667h-20.452l7.996-6.997c0.555-0.485 0.611-1.327 0.125-1.881-0.485-0.553-1.327-0.611-1.881-0.125l-10.667 9.333c-0.011 0.009-0.015 0.024-0.025 0.033-0.096 0.089-0.167 0.199-0.232 0.313-0.025 0.043-0.063 0.076-0.081 0.121-0.073 0.165-0.116 0.345-0.116 0.536s0.043 0.371 0.116 0.535c0.020 0.045 0.057 0.079 0.081 0.121 0.067 0.115 0.136 0.224 0.232 0.313 0.011 0.009 0.015 0.024 0.025 0.033l10.667 9.333c0.253 0.221 0.567 0.331 0.879 0.331 0.371 0 0.74-0.155 1.004-0.455 0.485-0.555 0.429-1.396-0.125-1.881l-7.997-6.997h20.452c0.736 0 1.333-0.597 1.333-1.333s-0.597-1.333-1.333-1.333z"></path>
|
|
29
|
+
</svg>
|
|
30
|
+
`;
|
|
31
|
+
|
|
26
32
|
const GiftSharing = `<!-- Generated by IcoMoon.io -->
|
|
27
33
|
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
|
|
28
34
|
<title>gift-sharing</title>
|
|
@@ -132,7 +138,8 @@ const SallaGifting$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
132
138
|
this.setWrapperHeight(2, 150, 0);
|
|
133
139
|
}
|
|
134
140
|
toggleGiftText(event) {
|
|
135
|
-
|
|
141
|
+
var _a;
|
|
142
|
+
(_a = this.textSelect) === null || _a === void 0 ? void 0 : _a.classList.remove('s-form-has-error');
|
|
136
143
|
let dataID = event.target.children[event.target.selectedIndex].getAttribute('data-id');
|
|
137
144
|
let customID = dataID == "custom";
|
|
138
145
|
this.showGiftText = customID;
|
|
@@ -154,19 +161,20 @@ const SallaGifting$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
154
161
|
* Go to the step 2
|
|
155
162
|
*/
|
|
156
163
|
async goToStep2() {
|
|
164
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
157
165
|
if (!this.selectedGiftTextOption) {
|
|
158
|
-
this.textSelect.classList.add('s-form-has-error');
|
|
159
|
-
this.customTextArea.classList.remove('s-form-has-error');
|
|
166
|
+
(_a = this.textSelect) === null || _a === void 0 ? void 0 : _a.classList.add('s-form-has-error');
|
|
167
|
+
(_b = this.customTextArea) === null || _b === void 0 ? void 0 : _b.classList.remove('s-form-has-error');
|
|
160
168
|
return;
|
|
161
169
|
}
|
|
162
170
|
else if (this.selectedGiftTextOption == 'custom' && !this.selectedText) {
|
|
163
|
-
this.textSelect.classList.remove('s-form-has-error');
|
|
164
|
-
this.customTextArea.classList.add('s-form-has-error');
|
|
171
|
+
(_c = this.textSelect) === null || _c === void 0 ? void 0 : _c.classList.remove('s-form-has-error');
|
|
172
|
+
(_d = this.customTextArea) === null || _d === void 0 ? void 0 : _d.classList.add('s-form-has-error');
|
|
165
173
|
return;
|
|
166
174
|
}
|
|
167
175
|
else {
|
|
168
|
-
this.textSelect.classList.remove('s-form-has-error');
|
|
169
|
-
this.customTextArea.classList.remove('s-form-has-error');
|
|
176
|
+
(_e = this.textSelect) === null || _e === void 0 ? void 0 : _e.classList.remove('s-form-has-error');
|
|
177
|
+
(_f = this.customTextArea) === null || _f === void 0 ? void 0 : _f.classList.remove('s-form-has-error');
|
|
170
178
|
}
|
|
171
179
|
this.setWrapperHeight(2, 600, 0);
|
|
172
180
|
let stepNextAnime = new anime.timeline();
|
|
@@ -197,14 +205,15 @@ const SallaGifting$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
197
205
|
}
|
|
198
206
|
}, '-=1200');
|
|
199
207
|
this.currentStep = 2;
|
|
200
|
-
this.stepsWrapper.classList.remove('is-current-step-1', 'is-current-step-2');
|
|
201
|
-
this.stepsWrapper.classList.add(`is-current-step-${this.currentStep}`);
|
|
208
|
+
(_g = this.stepsWrapper) === null || _g === void 0 ? void 0 : _g.classList.remove('is-current-step-1', 'is-current-step-2');
|
|
209
|
+
(_h = this.stepsWrapper) === null || _h === void 0 ? void 0 : _h.classList.add(`is-current-step-${this.currentStep}`);
|
|
202
210
|
}
|
|
203
211
|
/**
|
|
204
212
|
*
|
|
205
213
|
* Go to the step 1
|
|
206
214
|
*/
|
|
207
215
|
goToStep1() {
|
|
216
|
+
var _a, _b;
|
|
208
217
|
let stepBackAnime = new anime.timeline({
|
|
209
218
|
autoplay: false,
|
|
210
219
|
});
|
|
@@ -237,19 +246,20 @@ const SallaGifting$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
237
246
|
stepBackAnime.play();
|
|
238
247
|
this.setWrapperHeight(1, 600, 0);
|
|
239
248
|
this.currentStep = 1;
|
|
240
|
-
this.stepsWrapper.classList.remove('is-current-step-1', 'is-current-step-2');
|
|
241
|
-
this.stepsWrapper.classList.add(`is-current-step-${this.currentStep}`);
|
|
249
|
+
(_a = this.stepsWrapper) === null || _a === void 0 ? void 0 : _a.classList.remove('is-current-step-1', 'is-current-step-2');
|
|
250
|
+
(_b = this.stepsWrapper) === null || _b === void 0 ? void 0 : _b.classList.add(`is-current-step-${this.currentStep}`);
|
|
242
251
|
}
|
|
243
252
|
getFilepondPlaceholder() {
|
|
244
253
|
return `<div class="s-gifting-filepond-placeholder"><span class="s-gifting-filepond-placeholder-icon">${Images}</span><p class="s-gifting-filepond-placeholder-text">${this.selectImageOrUpload ? this.selectImageOrUpload : ''}</p></div>`;
|
|
245
254
|
}
|
|
246
255
|
setPreview(image) {
|
|
247
|
-
|
|
256
|
+
var _a, _b;
|
|
257
|
+
(_a = this.imageCover) === null || _a === void 0 ? void 0 : _a.classList.add('has-bg');
|
|
248
258
|
var bg = document.querySelector('.filepond-bg') ? document.querySelector('.filepond-bg') : document.createElement('div');
|
|
249
259
|
bg.classList.add('filepond-bg');
|
|
250
260
|
bg.classList.remove('s-hidden');
|
|
251
261
|
bg.style.backgroundImage = "url('" + image.url + "')";
|
|
252
|
-
this.imageCover.querySelector('.filepond--root').appendChild(bg);
|
|
262
|
+
(_b = this.imageCover) === null || _b === void 0 ? void 0 : _b.querySelector('.filepond--root').appendChild(bg);
|
|
253
263
|
this.uploadedImage = image.url;
|
|
254
264
|
if (!!this.gift && this.gift.gift_images.length) {
|
|
255
265
|
this.setWrapperHeight(1, 150, 0);
|
|
@@ -372,9 +382,9 @@ const SallaGifting$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
372
382
|
[
|
|
373
383
|
h("div", { class: "s-gifting-modal-header" }, h("span", { class: "s-gifting-modal-icon" }, h("span", { innerHTML: GiftSharing })), h("h2", { class: "s-gifting-modal-title" }, h("div", { class: "s-gifting-modal-badge-wrapper" }, h("div", { class: "s-gifting-modal-badge" }, h("span", null, h("span", null, this.currentStep), "/2")), h("span", null, this.giftDetails)))),
|
|
374
384
|
h("div", { class: "s-gifting-steps-wrapper steps-wrapper" }, h("div", { class: "s-gifting-step-one gift-step-1" }, h("div", { class: "s-gifting-modal-uploader-title anime-item" }, this.selectImageForYourGift), h("div", { class: "s-gifting-modal-uploader anime-item" }, h("span", { class: "s-gifting-remove-preview", onClick: () => this.removePreview(), innerHTML: Cancel }), this.selectImageOrUpload && h("salla-file-upload", { "instant-upload": true, labelIdle: this.getFilepondPlaceholder(), serverConfig: this.getServerConfig(), onRemove: () => this.handleRemoveImage() }, " ")), h("div", { class: "anime-item" }, !this.uploadedImage && !!this.gift && this.gift.gift_images.length > 0 ?
|
|
375
|
-
h("salla-slider", { type: "carousel" }, h("div", { slot: "items" }, (_a = this.gift) === null || _a === void 0 ? void 0 : _a.gift_images.map((item) => h("img", { class: "s-gifting-image s-gifting-clickable", src: item.url, onClick: () => this.setPreview(item), alt: `${item.id}` }))))
|
|
385
|
+
h("salla-slider", { id: "gifting-slider", loop: false, "controls-outer": true, class: "s-gifting-slider", type: "carousel" }, h("div", { slot: "items" }, (_a = this.gift) === null || _a === void 0 ? void 0 : _a.gift_images.map((item) => h("img", { class: "s-gifting-image s-gifting-clickable", src: item.url, onClick: () => this.setPreview(item), alt: `${item.id}` }))))
|
|
376
386
|
: ""), h("div", { class: "anime-item" }, h("div", { class: "s-form-group s-gifting-selectText" }, h("label", { htmlFor: "gift-text-selection", class: "s-form-label" }, this.selectGiftMessage), h("select", { id: "gift-text-selection", name: "gift-text-selection", class: "s-form-control s-gifting-select", onChange: e => this.toggleGiftText(e) }, h("option", { "data-id": null, selected: true }, this.selectGiftMessage), (_b = this.gift) === null || _b === void 0 ? void 0 :
|
|
377
|
-
_b.gift_texts.map((txt) => h("option", { "data-id": txt.id, value: txt.text, key: txt.id }, txt.text)), h("option", { "data-id": "custom" }, this.giftCustomText))), h("div", { class: this.showGiftText ? "s-form-group s-gifting-textarea shown" : "s-form-group s-gifting-textarea hide" }, h("label", { htmlFor: "gift-custom-text", class: "s-form-label" }, this.giftCustomText), h("div", { class: "mt-1" }, h("textarea", { onInput: (event) => this.handleTextAreaChange(event), rows: 4, ref: (el) => this.textArea = el, name: "gift-custom-text", id: "gift-custom-text", class: "s-form-control" })))), h("div", { class: "anime-item" }, h("salla-button", { color: "primary", width: "wide", onClick: () => this.goToStep2() }, h("span", null, this.nextStep)))), h("div", { class: "s-gifting-step-two gift-step-2" }, h("div", { class: this.errors && this.errors['sender_name'] ? "s-form-group s-form-has-error anime-item opacity-0" : "s-form-group anime-item opacity-0" }, h("label", { htmlFor: "sender_name", class: "s-form-label" }, this.senderNameLabel), h("input", { type: "text", class: "s-form-control", name: "sender_name", id: "sender_name", value: this.senderName, onInput: (event) => this.handleSenderName(event), placeholder: "" }), this.errors && this.errors['sender_name'] ? h("span", { class: "text-danger text-xs" }, this.errors['sender_name']) : ''), h("div", { class: this.errors && this.errors['receiver.name'] ? "s-form-group s-form-has-error anime-item opacity-0" : "s-form-group anime-item opacity-0" }, h("label", { htmlFor: "receiver_name", class: "s-form-label" }, this.receiverNameFieldLabel), h("input", { type: "text", class: "s-form-control", name: "receiver_name", id: "receiver_name", value: "", onInput: (event) => this.handleReceiverName(event), placeholder: "" }), this.errors && this.errors['receiver.name'] ? h("span", { class: "text-danger text-xs" }, this.errors['receiver.name']) : ''), h("div", { class: this.errors && this.errors['receiver.mobile'] ? "s-form-group s-form-has-error anime-item opacity-0" : "s-form-group anime-item opacity-0" }, h("label", { class: "s-form-label" }, this.receiverMobileFieldLabel), h("salla-tel-input", { class: "s-gifting-tel-input", phone: this.receiverMobile, countryCode: this.receiverCountryCode, onPhoneEntered: (e) => this.handlePhoneInputChange(e) }), this.errors && this.errors['receiver.mobile'] ? h("span", { class: "text-danger text-xs" }, this.errors['receiver.mobile']) : ''), h("div", { class: "anime-item opacity-0" }, h("label", { class: "s-gifting-schedule s-gifting-clickable", htmlFor: "schedule" }, h("input", { type: "checkbox", name: 'schedule', id: 'schedule', onChange: () => this.toggleCalendar(), class: "s-checkbox" }), h("span", { class: "s-form-label" }, " ", this.sendLater, " "))), h("div", { class: this.getCalendarClasses() }, h("label", { class: "s-form-label" }, this.selectSendDateAndTime), h("salla-datetime-picker", { value: this.deliveryDate, placeholder: this.selectSendDateAndTime, "enable-time": true, "date-format": "Y-m-d h:i K", onPicked: (event) => this.handleDateTimePicker(event) }), h("span", { class: "s-gifting-calendar-hint" }, this.canNotEditOrderAfterSelectDate)), h("div", { class: "s-gifting-step-two-footer anime-item opacity-0" }, h("a", { href: "#!", innerHTML: this.currentLang == 'ar' ? ArrowRightIcon :
|
|
387
|
+
_b.gift_texts.map((txt) => h("option", { "data-id": txt.id, value: txt.text, key: txt.id }, txt.text)), h("option", { "data-id": "custom" }, this.giftCustomText))), h("div", { class: this.showGiftText ? "s-form-group s-gifting-textarea shown" : "s-form-group s-gifting-textarea hide" }, h("label", { htmlFor: "gift-custom-text", class: "s-form-label" }, this.giftCustomText), h("div", { class: "mt-1" }, h("textarea", { onInput: (event) => this.handleTextAreaChange(event), rows: 4, ref: (el) => this.textArea = el, name: "gift-custom-text", id: "gift-custom-text", class: "s-form-control" })))), h("div", { class: "anime-item" }, h("salla-button", { color: "primary", width: "wide", onClick: () => this.goToStep2() }, h("span", null, this.nextStep)))), h("div", { class: "s-gifting-step-two gift-step-2" }, h("div", { class: this.errors && this.errors['sender_name'] ? "s-form-group s-form-has-error anime-item opacity-0" : "s-form-group anime-item opacity-0" }, h("label", { htmlFor: "sender_name", class: "s-form-label" }, this.senderNameLabel), h("input", { type: "text", class: "s-form-control", name: "sender_name", id: "sender_name", value: this.senderName, onInput: (event) => this.handleSenderName(event), placeholder: "" }), this.errors && this.errors['sender_name'] ? h("span", { class: "text-danger text-xs" }, this.errors['sender_name']) : ''), h("div", { class: this.errors && this.errors['receiver.name'] ? "s-form-group s-form-has-error anime-item opacity-0" : "s-form-group anime-item opacity-0" }, h("label", { htmlFor: "receiver_name", class: "s-form-label" }, this.receiverNameFieldLabel), h("input", { type: "text", class: "s-form-control", name: "receiver_name", id: "receiver_name", value: "", onInput: (event) => this.handleReceiverName(event), placeholder: "" }), this.errors && this.errors['receiver.name'] ? h("span", { class: "text-danger text-xs" }, this.errors['receiver.name']) : ''), h("div", { class: this.errors && this.errors['receiver.mobile'] ? "s-form-group s-form-has-error anime-item opacity-0" : "s-form-group anime-item opacity-0" }, h("label", { class: "s-form-label" }, this.receiverMobileFieldLabel), h("salla-tel-input", { class: "s-gifting-tel-input", phone: this.receiverMobile, countryCode: this.receiverCountryCode, onPhoneEntered: (e) => this.handlePhoneInputChange(e) }), this.errors && this.errors['receiver.mobile'] ? h("span", { class: "text-danger text-xs" }, this.errors['receiver.mobile']) : ''), h("div", { class: "anime-item opacity-0" }, h("label", { class: "s-gifting-schedule s-gifting-clickable", htmlFor: "schedule" }, h("input", { type: "checkbox", name: 'schedule', id: 'schedule', onChange: () => this.toggleCalendar(), class: "s-checkbox" }), h("span", { class: "s-form-label" }, " ", this.sendLater, " "))), h("div", { class: this.getCalendarClasses() }, h("label", { class: "s-form-label" }, this.selectSendDateAndTime), h("salla-datetime-picker", { value: this.deliveryDate, placeholder: this.selectSendDateAndTime, "enable-time": true, "date-format": "Y-m-d h:i K", onPicked: (event) => this.handleDateTimePicker(event) }), h("span", { class: "s-gifting-calendar-hint" }, this.canNotEditOrderAfterSelectDate)), h("div", { class: "s-gifting-step-two-footer anime-item opacity-0" }, h("a", { href: "#!", innerHTML: this.currentLang == 'ar' ? ArrowRightIcon : LeftArrow, onClick: () => this.goToStep1() }), h("salla-button", { onClick: () => this.submitForm(), color: "primary", width: 'wide' }, h("span", null, this.sendGift)))))
|
|
378
388
|
], h("slot", { name: "footer" })))
|
|
379
389
|
];
|
|
380
390
|
}
|
|
@@ -137,7 +137,7 @@ const SallaLoyalty$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
137
137
|
getConfirmationModal() {
|
|
138
138
|
var _a, _b;
|
|
139
139
|
return [
|
|
140
|
-
h("salla-placeholder", { alignment: "center", icon: Star3, class: "s-loyalty-confirmation-modal-content" }, h("div", { slot: "title", class: "s-loyalty-confirmation-title" }, salla.lang.get('pages.loyalty_program.exchange_points')), h("div", { slot: "description" }, salla.lang.get('pages.loyalty_program.are_you_sure_to_exchange'), " ( ", h("strong", null, (_a = this.selectedItem) === null || _a === void 0 ? void 0 : _a.cost_points), " ) ", salla.lang.get('pages.loyalty_program.for'), " ( ", h("strong", null, (_b = this.selectedItem) === null || _b === void 0 ? void 0 : _b.name), " )")),
|
|
140
|
+
h("salla-placeholder", { alignment: "center", icon: Star3, class: "s-loyalty-confirmation-modal-content" }, h("div", { slot: "title", class: "s-loyalty-confirmation-title" }, salla.lang.get('pages.loyalty_program.exchange_points')), h("div", { slot: "description" }, salla.lang.get('pages.loyalty_program.are_you_sure_to_exchange'), " ( ", h("strong", null, (_a = this.selectedItem) === null || _a === void 0 ? void 0 : _a.cost_points), " ", salla.lang.get('pages.loyalty_program.point'), " ) ", salla.lang.get('pages.loyalty_program.for'), " ( ", h("strong", null, (_b = this.selectedItem) === null || _b === void 0 ? void 0 : _b.name), " )")),
|
|
141
141
|
h("div", { class: "s-loyalty-confirmation-actions" }, h("salla-button", { fill: 'outline', width: "wide", onClick: () => this.cancelProcess() }, salla.lang.get('pages.loyalty_program.cancellation')), h("salla-button", { loading: this.buttonLoading, width: "wide", onClick: () => this.exchangeLoyaltyPoint() }, salla.lang.get('pages.loyalty_program.confirm')))
|
|
142
142
|
];
|
|
143
143
|
}
|
|
@@ -227,10 +227,10 @@ const SallaLoyalty$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
227
227
|
h("salla-list-tile", { class: 's-loyalty-widget' }, h("div", { slot: "icon", class: "s-loyalty-widget-icon", innerHTML: Rate }), h("div", { slot: "subtitle" }, this.is_loggedin ? salla.lang.get('pages.loyalty_program.cart_total_point_summary', { "balance": this.customerPoints }) : (this.guestMessage || salla.lang.get('pages.loyalty_program.guest_message')), h("salla-button", { shape: "link", color: "primary", onClick: () => salla.event.dispatch("loyalty::open") }, this.is_loggedin ? salla.lang.get('pages.loyalty_program.cart_point_exchange_now') : salla.lang.get('blocks.header.login')))) :
|
|
228
228
|
''),
|
|
229
229
|
h("salla-modal", { noPadding: true, width: "sm", ref: modal => this.confirmationModal = modal }, this.getConfirmationModal()),
|
|
230
|
-
h("salla-modal", { isLoading: true, "has-skeleton": true, width: "md", ref: modal => this.modal = modal }, h("div", { slot: "loading" }, h("div", { class: "s-loyalty-skeleton" }, h("salla-list-tile", { class: "s-loyalty-header" }, h("div", { slot: "icon", class: "s-loyalty-header-icon" }, h("salla-skeleton", { type: "circle", height: '6rem', width: '6rem' })), h("div", { slot: "title", class: "s-loyalty-header-title mb-5" }, h("salla-skeleton", { height: '15px', width: '50%' })), h("div", { slot: "subtitle", class: "s-loyalty-header-subtitle" }, h("salla-skeleton", { height: '10px' }), h("salla-skeleton", { height: '10px', width: '75%' }))), h("div", { class: "s-loyalty-skeleton-cards" }, [...Array(3)].map(() => h("div", { class: "s-loyalty-prize-item" }, h("salla-skeleton", { height: '9rem' }), h("div", { class: "s-loyalty-prize-item-title" }, h("salla-skeleton", { height: '15px', width: '75%' })), h("div", { class: "s-loyalty-prize-item-subtitle" }, h("salla-skeleton", { height: '10px', width: '50%' }), h("salla-skeleton", { height: '10px', width: '25%' })), h("div", { class: "s-loyalty-prize-item-points" }, h("salla-skeleton", { height: '15px', width: '100px' }), h("div", { class: "s-loyalty-prize-item-check" }, h("salla-skeleton", { height: '1rem', width: '1rem', type: 'circle' })))))))), !this.hasError && !!this.loyaltyProgram ?
|
|
230
|
+
h("salla-modal", { isLoading: true, "has-skeleton": true, width: "md", ref: modal => this.modal = modal }, h("div", { slot: "loading" }, h("div", { class: "s-loyalty-skeleton" }, h("salla-list-tile", { class: "s-loyalty-header" }, h("div", { slot: "icon", class: "s-loyalty-header-icon" }, h("salla-skeleton", { type: "circle", height: '6rem', width: '6rem' })), h("div", { slot: "title", class: "s-loyalty-header-title mb-5" }, h("salla-skeleton", { height: '15px', width: '50%' })), h("div", { slot: "subtitle", class: "s-loyalty-header-subtitle" }, h("salla-skeleton", { height: '10px' }), h("salla-skeleton", { height: '10px', width: '75%' }))), h("div", { class: "s-loyalty-skeleton-cards" }, [...Array(3)].map(() => h("div", { class: "s-loyalty-prize-item swiper-slide" }, h("salla-skeleton", { height: '9rem' }), h("div", { class: "s-loyalty-prize-item-title" }, h("salla-skeleton", { height: '15px', width: '75%' })), h("div", { class: "s-loyalty-prize-item-subtitle" }, h("salla-skeleton", { height: '10px', width: '50%' }), h("salla-skeleton", { height: '10px', width: '25%' })), h("div", { class: "s-loyalty-prize-item-points" }, h("salla-skeleton", { height: '15px', width: '100px' }), h("div", { class: "s-loyalty-prize-item-check" }, h("salla-skeleton", { height: '1rem', width: '1rem', type: 'circle' })))))))), !this.hasError && !!this.loyaltyProgram ?
|
|
231
231
|
[
|
|
232
232
|
h("salla-list-tile", { id: 's-loyalty-header', class: "s-loyalty-header" }, h("div", { slot: "icon", class: "s-loyalty-header-icon", innerHTML: GiftImg }), h("div", { slot: "title", class: "s-loyalty-header-title" }, this.loyaltyProgram.prize_promotion_title), h("div", { slot: "subtitle", class: "s-loyalty-header-subtitle" }, this.loyaltyProgram.prize_promotion_description)),
|
|
233
|
-
h("salla-tabs", null, this.loyaltyProgram.prizes.map((prize) => h("salla-tab-header", { slot: "header", name: prize.title }, h("span", null, prize.title))), this.loyaltyProgram.prizes.map((prize) => h("salla-tab-content", { slot: "content", name: prize.title }, h("salla-slider", { class: "s-loyalty-slider", type: "carousel" }, h("div", { slot: 'items' }, prize.items.map((item) => this.prizeItem(item))))))),
|
|
233
|
+
h("salla-tabs", null, this.loyaltyProgram.prizes.map((prize) => h("salla-tab-header", { slot: "header", name: prize.title }, h("span", null, prize.title))), this.loyaltyProgram.prizes.map((prize, index) => h("salla-tab-content", { slot: "content", name: prize.title }, h("salla-slider", { class: "s-loyalty-slider", loop: false, "controls-outer": true, id: 'loyalty-popup-slider-' + index, type: "carousel" }, h("div", { slot: 'items' }, prize.items.map((item) => this.prizeItem(item))))))),
|
|
234
234
|
h("salla-button", { disabled: !this.selectedItem, width: "wide", class: "s-loyalty-program-redeem-btn", onClick: () => this.openConfirmation() }, salla.lang.get('pages.loyalty_program.exchange_points')),
|
|
235
235
|
]
|
|
236
236
|
: h("salla-placeholder", { class: "s-loyalty-placeholder", alignment: "center" }, !!this.errorMessage ? h("span", { slot: "description" }, this.errorMessage) : '')),
|
|
@@ -63,6 +63,7 @@ const SallaOfferModal$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
|
|
|
63
63
|
async open(product_id) {
|
|
64
64
|
this.productID = product_id;
|
|
65
65
|
//TODO:: make sure there is only one offer
|
|
66
|
+
this.hasError = false;
|
|
66
67
|
this.modal.open();
|
|
67
68
|
return await salla.api.withoutNotifier(() => salla.product.offers(product_id))
|
|
68
69
|
.then(response => this.showOffer(response.data[0]))
|
|
@@ -93,7 +94,7 @@ const SallaOfferModal$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
|
|
|
93
94
|
getOfferContent() {
|
|
94
95
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
95
96
|
if ((_a = this.offer.get.products) === null || _a === void 0 ? void 0 : _a.length) {
|
|
96
|
-
return h("salla-slider", { type: "carousel", class: { "s-offer-modal-slider-centered": ((_b = this.offer.get.products) === null || _b === void 0 ? void 0 : _b.length) <= 2, "s-offer-modal-slider": true }, "show-controls": ((_c = this.offer.get.products) === null || _c === void 0 ? void 0 : _c.length) <= 2 ? 'false' : 'true' }, h("div", { slot: 'items' }, (_d = this.offer.get.products) === null || _d === void 0 ? void 0 : _d.map(product => h("div", { class: {
|
|
97
|
+
return h("salla-slider", { type: "carousel", class: { "s-offer-modal-slider-centered": ((_b = this.offer.get.products) === null || _b === void 0 ? void 0 : _b.length) <= 2, "s-offer-modal-slider": true }, id: "offer-modal-slider", "controls-outer": true, "show-controls": ((_c = this.offer.get.products) === null || _c === void 0 ? void 0 : _c.length) <= 2 ? 'false' : 'true' }, h("div", { slot: 'items' }, (_d = this.offer.get.products) === null || _d === void 0 ? void 0 : _d.map(product => h("div", { class: {
|
|
97
98
|
"s-offer-modal-product": true,
|
|
98
99
|
"s-offer-modal-slider-item": true,
|
|
99
100
|
"s-offer-modal-not-available": !product.is_available
|
|
@@ -102,11 +103,11 @@ const SallaOfferModal$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
|
|
|
102
103
|
.replace(/\{url\}/g, product.url)
|
|
103
104
|
.replace(/\{image\}/g, product.thumbnail)
|
|
104
105
|
.replace(/\{price\}/g, product.has_special_price
|
|
105
|
-
? salla.money(product.price) + '
|
|
106
|
+
? '<span class="s-offer-modal-product-sale-price">' + salla.money(product.price) + '</span><span class="s-offer-modal-product-old-price">' + salla.money(product.regular_price) + '</span>'
|
|
106
107
|
: salla.money(product.price)) }, h("div", { class: "s-offer-modal-btn-wrap" }, h("salla-button", { width: "wide", fill: 'outline', "data-id": product.id, disabled: !product.is_available, "loader-position": "center", onClick: this.addItem }, product.is_available ? salla.lang.get('pages.cart.add_to_cart') : salla.lang.get('pages.products.out_of_stock')))))));
|
|
107
108
|
}
|
|
108
109
|
else if ((_e = this.offer.get.categories) === null || _e === void 0 ? void 0 : _e.length) {
|
|
109
|
-
return h("salla-slider", { type: "carousel", class: { "s-offer-modal-slider-centered": ((_f = this.offer.get.categories) === null || _f === void 0 ? void 0 : _f.length) <= 2, "s-offer-modal-slider": true }, "show-controls": ((_g = this.offer.get.categories) === null || _g === void 0 ? void 0 : _g.length) <= 2 ? 'false' : 'true' }, h("div", { slot: 'items' }, this.offer.get.categories.map(category => h("a", { href: category.urls.customer, class: "s-offer-modal-badge s-offer-modal-slider-item", innerHTML: this.categorySlot
|
|
110
|
+
return h("salla-slider", { type: "carousel", class: { "s-offer-modal-slider-centered": ((_f = this.offer.get.categories) === null || _f === void 0 ? void 0 : _f.length) <= 2, "s-offer-modal-slider": true }, id: "offer-modal-slider", "controls-outer": true, "show-controls": ((_g = this.offer.get.categories) === null || _g === void 0 ? void 0 : _g.length) <= 2 ? 'false' : 'true' }, h("div", { slot: 'items' }, this.offer.get.categories.map(category => h("a", { href: category.urls.customer, class: "s-offer-modal-badge s-offer-modal-slider-item s-offer-modal-cat-item", innerHTML: this.categorySlot
|
|
110
111
|
.replace(/\{tagIcon\}/g, Tag)
|
|
111
112
|
.replace(/\{name\}/g, category.name)
|
|
112
113
|
.replace(/\{url\}/g, category.urls.customer) }))));
|
|
@@ -131,7 +132,7 @@ const SallaOfferModal$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
|
|
|
131
132
|
'</div>';
|
|
132
133
|
}
|
|
133
134
|
render() {
|
|
134
|
-
return h("salla-modal", { "
|
|
135
|
+
return h("salla-modal", { "has-skeleton": true, "sub-title": this.offer_message, ref: modal => this.modal = modal, isLoading: true }, h("div", { slot: 'loading' }, h("div", { class: "s-offer-modal-skeleton" }, h("div", { class: "s-offer-modal-skeleton-header" }, h("salla-skeleton", { type: 'circle', height: '80px', width: '80px' }), h("salla-skeleton", { height: '15px', width: '50%' }), h("salla-skeleton", { height: '10px', width: '30%' })), h("div", { class: "s-offer-modal-skeleton-items" }, [...Array(3)].map(() => h("div", { class: "s-offer-modal-skeleton-item" }, h("salla-skeleton", { height: '9rem' }), h("div", { class: "s-offer-modal-skeleton-item-title" }, h("salla-skeleton", { height: '15px', width: '100%' })), h("div", { class: "s-offer-modal-skeleton-item-subtitle" }, h("salla-skeleton", { height: '9px', width: '50%' }), h("div", { innerHTML: Cart2 }))))), h("div", { class: "s-offer-modal-skeleton-footer" }, h("salla-skeleton", { height: '15px', width: '50%' }), h("salla-skeleton", { height: '15px', width: '30%' })))), !this.hasError && this.offer !== null
|
|
135
136
|
? [h("span", { slot: 'icon', class: "s-offer-modal-header-icon", innerHTML: SpecialDiscountIcon }), this.getOfferContent(), h("div", { class: "s-offer-modal-footer", slot: "footer" }, this.offer.formatted_date ?
|
|
136
137
|
h("p", { class: "s-offer-modal-expiry" }, salla.lang.get('pages.products.offer_expires_in'), " ", this.offer.formatted_date)
|
|
137
138
|
: '', h("label", { class: "s-offer-modal-remember-label" }, h("input", { type: "checkbox", onChange: e => this.rememberMe(e), class: "s-offer-modal-remember-input" }), "\u00A0 ", salla.lang.get('common.elements.remember_my_choice'))),
|
|
@@ -64,10 +64,14 @@ const SallaRatingStars = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
|
|
|
64
64
|
return stars;
|
|
65
65
|
}
|
|
66
66
|
render() {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
67
|
+
var _a;
|
|
68
|
+
//TODO:: find a better fix, this is a patch for issue that duplicates the stars twice @see the screenshot inside this folder
|
|
69
|
+
return ((_a = this.host.closest('.swiper-slide')) === null || _a === void 0 ? void 0 : _a.classList.contains('swiper-slide-duplicate'))
|
|
70
|
+
? ''
|
|
71
|
+
: (h(Host, null, this.value || this.value == 0 ?
|
|
72
|
+
h("div", { class: "s-rating-stars-wrapper" }, " ", this.createStars(this.value), " ")
|
|
73
|
+
:
|
|
74
|
+
h("div", { class: "s-rating-stars-element", ref: (el) => this.startsElem = el }, h("input", { type: "hidden", class: "rating_hidden_input", name: this.name, value: "" }), [1, 2, 3, 4, 5].map(star => h("button", { class: `s-rating-stars-btn-star s-rating-stars-` + this.size, "data-star": star }, h("span", { innerHTML: Rate }))))));
|
|
71
75
|
}
|
|
72
76
|
componentDidLoad() {
|
|
73
77
|
this.initiateRating();
|