@salla.sa/twilight-components 2.10.7 → 2.11.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/{app-globals-da038c01.js → app-globals-ffcb56c9.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/salla-button_37.cjs.entry.js +226 -107
- package/dist/cjs/twilight.cjs.js +2 -2
- package/dist/collection/components/salla-file-upload/salla-file-upload.js +69 -6
- package/dist/collection/components/salla-gifting/salla-gifting.js +25 -41
- package/dist/collection/components/salla-login-modal/intefaces.js +9 -0
- package/dist/collection/components/salla-login-modal/salla-login-modal.js +61 -3
- package/dist/collection/components/salla-map/salla-map.js +10 -8
- package/dist/collection/components/salla-product-options/salla-product-options.js +72 -58
- package/dist/collection/components/salla-slider/salla-slider.js +63 -23
- package/dist/collection/components/salla-user-menu/salla-user-menu.js +1 -3
- package/dist/components/camera.js +11 -0
- package/dist/components/index.js +1 -1
- package/dist/components/salla-file-upload2.js +35 -3
- package/dist/components/salla-gifting.js +20 -36
- package/dist/components/salla-login-modal.js +81 -6
- package/dist/components/salla-map.js +7 -5
- package/dist/components/salla-product-options.js +61 -53
- package/dist/components/salla-slider2.js +28 -5
- package/dist/components/salla-user-menu.js +1 -3
- package/dist/esm/{app-globals-41701201.js → app-globals-3afeeb74.js} +1 -1
- package/dist/esm/loader.js +2 -2
- package/dist/esm/salla-button_37.entry.js +226 -107
- package/dist/esm/twilight.js +2 -2
- package/dist/esm-es5/{app-globals-41701201.js → app-globals-3afeeb74.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/salla-button_37.entry.js +4 -4
- package/dist/esm-es5/twilight.js +1 -1
- package/dist/twilight/p-9bbacabc.entry.js +30 -0
- package/dist/twilight/{p-88643516.js → p-d4a11dd1.js} +2 -2
- package/dist/twilight/p-d859d898.system.js +4 -0
- package/dist/twilight/{p-25d2fe80.system.js → p-db94f281.system.js} +2 -2
- package/dist/twilight/{p-dcd65bb2.system.entry.js → p-e69f3e88.system.entry.js} +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/twilight/twilight.js +1 -1
- package/dist/types/components/salla-file-upload/salla-file-upload.d.ts +11 -1
- package/dist/types/components/salla-gifting/salla-gifting.d.ts +9 -9
- package/dist/types/components/salla-login-modal/intefaces.d.ts +12 -0
- package/dist/types/components/salla-login-modal/salla-login-modal.d.ts +9 -1
- package/dist/types/components/salla-map/salla-map.d.ts +5 -2
- package/dist/types/components/salla-product-options/interfaces.d.ts +6 -1
- package/dist/types/components/salla-product-options/salla-product-options.d.ts +19 -11
- package/dist/types/components/salla-slider/salla-slider.d.ts +52 -1
- package/dist/types/components/salla-user-menu/salla-user-menu.d.ts +0 -1
- package/dist/types/components.d.ts +85 -14
- package/package.json +4 -4
- package/dist/components/arrow-right.js +0 -11
- package/dist/twilight/p-0110489b.system.js +0 -4
- package/dist/twilight/p-c142b898.entry.js +0 -30
package/dist/cjs/twilight.cjs.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
'use strict';
|
|
5
5
|
|
|
6
6
|
const index = require('./index-1d2b3370.js');
|
|
7
|
-
const appGlobals = require('./app-globals-
|
|
7
|
+
const appGlobals = require('./app-globals-ffcb56c9.js');
|
|
8
8
|
require('./_commonjsHelpers-691dd63b.js');
|
|
9
9
|
|
|
10
10
|
/*
|
|
@@ -78,5 +78,5 @@ const patchDynamicImport = (base, orgScriptElm) => {
|
|
|
78
78
|
|
|
79
79
|
patchBrowser().then(options => {
|
|
80
80
|
appGlobals.globalScripts();
|
|
81
|
-
return index.bootstrapLazy(JSON.parse("[[\"salla-button_37.cjs\",[[4,\"salla-gifting\",{\"productId\":[2,\"product-id\"],\"sectionTitle\":[32],\"sectionSubtitle\":[32],\"sectionBtnText\":[32],\"giftDetails\":[32],\"selectImageForYourGift\":[32],\"selectImageOrUpload\":[32],\"selectGiftMessage\":[32],\"giftCustomText\":[32],\"textId\":[32],\"incorrectGiftText\":[32],\"nextStep\":[32],\"senderNameLabel\":[32],\"receiverNameFieldLabel\":[32],\"receiverMobileFieldLabel\":[32],\"receiverEmailFieldLabel\":[32],\"emailPlaceholder\":[32],\"sendLater\":[32],\"selectSendDateAndTime\":[32],\"canNotEditOrderAfterSelectDate\":[32],\"sendGift\":[32],\"donationRequired\":[32],\"step1Elems\":[32],\"step2Elems\":[32],\"stepsWrapper\":[32],\"textArea\":[32],\"imageCover\":[32],\"textSelect\":[32],\"customTextArea\":[32],\"calendarFormGroup\":[32],\"currentStep\":[32],\"showCalendar\":[32],\"showGiftText\":[32],\"currentLang\":[32],\"parentClass\":[32],\"errors\":[32],\"gift\":[32],\"selectedGiftTextOption\":[32],\"showTextArea\":[32],\"selectedImage\":[32],\"uploadedImage\":[32],\"selectedText\":[32],\"senderName\":[32],\"errorMessage\":[32],\"hasError\":[32],\"quantity\":[32],\"deliveryDate\":[32],\"timeZone\":[32],\"receiverName\":[32],\"receiverMobile\":[32],\"receiverCountryCode\":[32],\"receiverEmail\":[32],\"open\":[64],\"close\":[64],\"goToStep2\":[64]}],[4,\"salla-loyalty\",{\"prizePoints\":[8,\"prize-points\"],\"customerPoints\":[2,\"customer-points\"],\"prizeTitle\":[1,\"prize-title\"],\"allowEmail\":[4,\"allow-email\"],\"allowMobile\":[4,\"allow-mobile\"],\"requireEmail\":[4,\"require-email\"],\"guestMessage\":[1,\"guest-message\"],\"loyaltyProgram\":[32],\"buttonLoading\":[32],\"selectedItem\":[32],\"askConfirmation\":[32],\"is_loggedin\":[32],\"hasError\":[32],\"errorMessage\":[32],\"translationLoaded\":[32],\"open\":[64],\"close\":[64],\"resetExchange\":[64],\"exchangeLoyaltyPoint\":[64]}],[4,\"salla-product-size-guide\",{\"guides\":[32],\"productId\":[32],\"placeholder_title\":[32],\"placeholder_description\":[32],\"modal_title\":[32],\"hasError\":[32],\"open\":[64],\"close\":[64]}],[0,\"salla-offer-modal\",{\"offer\":[32],\"offer_name\":[32],\"offer_message\":[32],\"hasError\":[32],\"errorMessage\":[32],\"productID\":[32],\"translationLoaded\":[32],\"addToCartLabel\":[32],\"open\":[64],\"showOffer\":[64]}],[0,\"salla-rating-modal\",{\"orderId\":[2,\"order-id\"],\"order\":[32],\"hasError\":[32],\"errorMessage\":[32],\"translationLoaded\":[32],\"open\":[64],\"close\":[64]}],[4,\"salla-scopes\",{\"selection\":[1],\"searchDisplayLimit\":[2,\"search-display-limit\"],\"translationLoaded\":[32],\"mode\":[32],\"current_scope\":[32],\"scopes\":[32],\"originalScopesList\":[32],\"selected_scope\":[32],\"isOpenedBefore\":[32],\"hasError\":[32],\"loading\":[32],\"close\":[64],\"open\":[64],\"handleSubmit\":[64]}],[0,\"salla-localization-modal\",{\"language\":[1537],\"currency\":[1537],\"translationLoaded\":[32],\"languages\":[32],\"currencies\":[32],\"hasError\":[32],\"errorMessage\":[32],\"open\":[64],\"close\":[64],\"submit\":[64]}],[4,\"salla-login-modal\",{\"isEmailAllowed\":[1028,\"is-email-allowed\"],\"isMobileAllowed\":[1028,\"is-mobile-allowed\"],\"isEmailRequired\":[1028,\"is-email-required\"],\"supportWebAuth\":[516,\"support-web-auth\"],\"currentTabName\":[32],\"regType\":[32],\"translationLoaded\":[32],\"title\":[32],\"emailErrorMsg\":[32],\"firstNameErrorMsg\":[32],\"lastNameErrorMsg\":[32],\"open\":[64]},[[8,\"verified\",\"onVerified\"]]],[0,\"salla-quick-order\",{\"quickOrderTitle\":[1025,\"quick-order-title\"],\"subTitle\":[1025,\"sub-title\"],\"payButtonTitle\":[1025,\"pay-button-title\"],\"confirmPayButtonTitle\":[1025,\"confirm-pay-button-title\"],\"agreementText\":[1025,\"agreement-text\"],\"isEmailRequired\":[1028,\"is-email-required\"],\"productId\":[1025,\"product-id\"],\"thanksMessage\":[1025,\"thanks-message\"],\"quickOrderStyle\":[1025,\"quick-order-style\"],\"user\":[32],\"isAvailable\":[32],\"oneClick\":[32],\"expanded\":[32],\"isTermsRequired\":[32],\"countryCode\":[32],\"submitSucess\":[32],\"placeHolderEmail\":[32],\"emailOptional\":[32],\"agreementShowText\":[32],\"agreementModalHead\":[32],\"userNameLabel\":[32],\"termsChecked\":[32]}],[0,\"salla-user-settings\",{\"isNotifiable\":[516,\"is-notifiable\"],\"deactivateAccount\":[32],\"promotionalMsgs\":[32],\"deactivateDesc\":[32],\"promotionalMsgsDesc\":[32],\"sorryForLeavingText\":[32],\"warningText\":[32],\"keepAccount\":[32],\"buttonLoading\":[32]}],[4,\"salla-map\",{\"readonly\":[4],\"searchable\":[1028],\"lat\":[1026],\"lng\":[1026],\"apiKey\":[1025,\"api-key\"],\"title\":[1],\"zoom\":[1026],\"theme\":[1025],\"modalActivityTitle\":[32],\"confirmButtonTitle\":[32],\"locateButtonTitle\":[32],\"locateButtonEdit\":[32],\"searchInputValue\":[32],\"geolocationError\":[32],\"searchInput\":[32],\"mapElement\":[32],\"open\":[64]}],[0,\"salla-product-options\",{\"productId\":[2,\"product-id\"],\"options\":[1],\"optionsData\":[32],\"uploadedImage\":[32],\"outOfStockText\":[32],\"donationAmount\":[32]}],[0,\"salla-search\",{\"inline\":[4],\"oval\":[4],\"height\":[2],\"translationLoaded\":[32],\"results\":[32],\"loading\":[32],\"typing\":[32],\"debounce\":[32],\"search_term\":[32]},[[0,\"keydown\",\"handleKeyDown\"]]],[0,\"salla-comment-form\",{\"type\":[1],\"showAvatar\":[4,\"show-avatar\"],\"itemId\":[8,\"item-id\"],\"placeholder\":[32],\"submitText\":[32],\"canComment\":[32]}],[4,\"salla-social-share\",{\"url\":[513],\"urlName\":[513,\"url-name\"],\"platforms\":[513],\"opened\":[32],\"allPlatforms\":[32],\"platformIcons\":[32],\"convertedPlatforms\":[32],\"open\":[64]}],[4,\"salla-cart-summary\",{\"cartSummaryCount\":[32],\"cartSummaryTotal\":[32],\"animateToCart\":[64]}],[4,\"salla-color-picker\",{\"color\":[1],\"placement\":[8],\"format\":[1],\"showCancelButton\":[4,\"show-cancel-button\"],\"showTextField\":[4,\"show-text-field\"],\"enableAlpha\":[4,\"enable-alpha\"],\"widgetColor\":[32],\"setPickerOption\":[64],\"movePopUp\":[64],\"setColorValue\":[64],\"openPicker\":[64],\"closePicker\":[64],\"destroyPicker\":[64]}],[4,\"salla-infinite-scroll\",{\"nextPage\":[1,\"next-page\"],\"autoload\":[1028],\"container\":[1],\"item\":[1],\"loadMore\":[32],\"noMore\":[32],\"failedToLoad\":[32]}],[4,\"salla-quantity-input\",{\"quantity\":[32],\"decrease\":[64],\"increase\":[64],\"setValue\":[64]}],[0,\"salla-user-menu\",{\"inline\":[516],\"avatarOnly\":[516,\"avatar-only\"],\"showHeader\":[516,\"show-header\"],\"relativeDropdown\":[516,\"relative-dropdown\"],\"accountLoading\":[32],\"opened\":[32],\"notifications\":[32],\"orders\":[32],\"pending_orders\":[32],\"wishlist\":[32],\"profile\":[32],\"rating\":[32],\"logout\":[32],\"hello\":[32],\"first_name\":[32],\"last_name\":[32],\"has_red_dot\":[32],\"avatar\":[32],\"badges\":[32],\"OrderUpdate\":[32]}],[0,\"salla-product-availability\",{\"channels\":[1],\"productId\":[2,\"product-id\"],\"isSubscribed\":[1028,\"is-subscribed\"],\"translationLoaded\":[32],\"title_\":[32],\"isVisitorSubscribed\":[32]}],[4,\"salla-verify\",{\"display\":[1],\"type\":[1025],\"autoReload\":[4,\"auto-reload\"],\"supportWebAuth\":[4,\"support-web-auth\"],\"translationLoaded\":[32],\"title\":[32],\"resendAfter\":[32],\"isProfileVerify\":[32],\"getCode\":[64],\"open\":[64]}],[4,\"salla-conditional-fields\",null,[[0,\"change\",\"changeHandler\"]]],[0,\"salla-rating-stars\",{\"name\":[1],\"size\":[1],\"value\":[2]}],[0,\"salla-datetime-picker\",{\"value\":[1025],\"placeholder\":[1],\"allowInput\":[4,\"allow-input\"],\"allowInvalidPreload\":[4,\"allow-invalid-preload\"],\"altFormat\":[1,\"alt-format\"],\"altInput\":[4,\"alt-input\"],\"altInputClass\":[1,\"alt-input-class\"],\"appendTo\":[16],\"ariaDateFormat\":[1,\"aria-date-format\"],\"autoFillDefaultTime\":[4,\"auto-fill-default-time\"],\"clickOpens\":[4,\"click-opens\"],\"closeOnSelect\":[4,\"close-on-select\"],\"conjunction\":[1],\"dateFormat\":[1,\"date-format\"],\"defaultDate\":[8,\"default-date\"],\"defaultHour\":[2,\"default-hour\"],\"defaultMinute\":[2,\"default-minute\"],\"defaultSeconds\":[2,\"default-seconds\"],\"disable\":[16],\"disableMobile\":[4,\"disable-mobile\"],\"enable\":[16],\"enableSeconds\":[4,\"enable-seconds\"],\"enableTime\":[4,\"enable-time\"],\"formatDate\":[16],\"hourIncrement\":[2,\"hour-increment\"],\"inline\":[4],\"locale\":[1],\"maxDate\":[8,\"max-date\"],\"maxTime\":[8,\"max-time\"],\"minDate\":[8,\"min-date\"],\"minTime\":[8,\"min-time\"],\"minuteIncrement\":[2,\"minute-increment\"],\"mode\":[1],\"monthSelectorType\":[1,\"month-selector-type\"],\"nextArrow\":[1,\"next-arrow\"],\"noCalendar\":[4,\"no-calendar\"],\"dateParser\":[16],\"position\":[1],\"positionElement\":[16],\"prevArrow\":[1,\"prev-arrow\"],\"shorthandCurrentMonth\":[4,\"shorthand-current-month\"],\"static\":[4],\"showMonths\":[2,\"show-months\"],\"time_24hr\":[4,\"time_-2-4hr\"],\"weekNumbers\":[4,\"week-numbers\"],\"wrap\":[4]}],[0,\"salla-file-upload\",{\"required\":[4],\"disabled\":[4],\"allowDrop\":[4,\"allow-drop\"],\"allowBrowse\":[4,\"allow-browse\"],\"allowPaste\":[4,\"allow-paste\"],\"allowMultiple\":[4,\"allow-multiple\"],\"allowReplace\":[4,\"allow-replace\"],\"allowRevert\":[4,\"allow-revert\"],\"allowRemove\":[4,\"allow-remove\"],\"allowProcess\":[4,\"allow-process\"],\"allowReorder\":[4,\"allow-reorder\"],\"storeAsFile\":[4,\"store-as-file\"],\"forceRevert\":[4,\"force-revert\"],\"maxFilesCount\":[2,\"max-files-count\"],\"maxParallelUploads\":[2,\"max-parallel-uploads\"],\"checkValidity\":[4,\"check-validity\"],\"itemInsertLocation\":[1,\"item-insert-location\"],\"itemInsertInterval\":[2,\"item-insert-interval\"],\"credits\":[4],\"dropOnPage\":[4,\"drop-on-page\"],\"dropOnElement\":[4,\"drop-on-element\"],\"dropValidation\":[4,\"drop-validation\"],\"ignoredFiles\":[16],\"serverConfig\":[1,\"server-config\"],\"instantUpload\":[4,\"instant-upload\"],\"chunkUploads\":[4,\"chunk-uploads\"],\"chunkForce\":[4,\"chunk-force\"],\"chunkSize\":[2,\"chunk-size\"],\"chunkRetryDelays\":[16],\"labelDecimalSeparator\":[1,\"label-decimal-separator\"],\"labelThousandsSeparator\":[1,\"label-thousands-separator\"],\"labelIdle\":[1,\"label-idle\"],\"labelInvalidField\":[1,\"label-invalid-field\"],\"labelFileWaitingForSize\":[1,\"label-file-waiting-for-size\"],\"labelFileSizeNotAvailable\":[1,\"label-file-size-not-available\"],\"labelFileLoading\":[1,\"label-file-loading\"],\"labelFileLoadError\":[1,\"label-file-load-error\"],\"labelFileProcessing\":[1,\"label-file-processing\"],\"labelFileProcessingComplete\":[1,\"label-file-processing-complete\"],\"labelFileProcessingAborted\":[1,\"label-file-processing-aborted\"],\"labelFileProcessingError\":[1,\"label-file-processing-error\"],\"labelFileProcessingRevertError\":[1,\"label-file-processing-revert-error\"],\"labelFileRemoveError\":[1,\"label-file-remove-error\"],\"labelTapToCancel\":[1,\"label-tap-to-cancel\"],\"labelTapToRetry\":[1,\"label-tap-to-retry\"],\"labelTapToUndo\":[1,\"label-tap-to-undo\"],\"labelButtonRemoveItem\":[1,\"label-button-remove-item\"],\"labelButtonAbortItemLoad\":[1,\"label-button-abort-item-load\"],\"labelButtonRetryItemLoad\":[1,\"label-button-retry-item-load\"],\"labelButtonAbortItemProcessing\":[1,\"label-button-abort-item-processing\"],\"labelButtonUndoItemProcessing\":[1,\"label-button-undo-item-processing\"],\"labelButtonRetryItemProcessing\":[1,\"label-button-retry-item-processing\"],\"labelButtonProcessItem\":[1,\"label-button-process-item\"],\"iconRemove\":[1,\"icon-remove\"],\"iconProcess\":[1,\"icon-process\"],\"iconRetry\":[1,\"icon-retry\"],\"iconUndo\":[1,\"icon-undo\"],\"pond\":[32],\"files\":[32],\"appendFile\":[64]}],[4,\"salla-tab-content\",{\"name\":[1],\"isSelected\":[32],\"getChild\":[64]}],[4,\"salla-tab-header\",{\"name\":[1],\"activeClass\":[1,\"active-class\"],\"height\":[8],\"centered\":[4],\"isSelected\":[32],\"getChild\":[64]}],[4,\"salla-tabs\",{\"backgroundColor\":[1,\"background-color\"],\"vertical\":[4]},[[0,\"tabSelected\",\"onSelectedTab\"]]],[4,\"salla-slider\",{\"blockTitle\":[513,\"block-title\"],\"blockSubtitle\":[513,\"block-subtitle\"],\"displayAllUrl\":[513,\"display-all-url\"],\"verticalThumbs\":[516,\"vertical-thumbs\"],\"autoHeight\":[516,\"auto-height\"],\"showControls\":[516,\"show-controls\"],\"controlsOuter\":[516,\"controls-outer\"],\"showThumbsControls\":[4,\"show-thumbs-controls\"],\"autoPlay\":[4,\"auto-play\"],\"slidesPerView\":[1,\"slides-per-view\"],\"pagination\":[4],\"centered\":[4],\"loop\":[4],\"type\":[1],\"sliderConfig\":[520,\"slider-config\"],\"thumbsConfig\":[520,\"thumbs-config\"],\"currentIndex\":[32],\"isEnd\":[32],\"isBeginning\":[32],\"isRTL\":[32],\"swiperScript\":[32],\"displayAllTitle\":[32],\"slideTo\":[64],\"slideNext\":[64],\"slidePrev\":[64],\"slideToLoop\":[64],\"slideNextLoop\":[64],\"slidePrevLoop\":[64],\"slideReset\":[64],\"slideToClosest\":[64],\"update\":[64],\"updateAutoHeight\":[64],\"updateSlides\":[64],\"updateProgress\":[64],\"updateSlidesClasses\":[64],\"getSlides\":[64]}],[4,\"salla-list-tile\",{\"href\":[1],\"target\":[1]}],[0,\"salla-tel-input\",{\"phone\":[1025],\"name\":[1],\"countryCode\":[1025,\"country-code\"],\"mobileRequired\":[32],\"countryCodeLabel\":[32],\"mobileLabel\":[32],\"tooShort\":[32],\"tooLong\":[32],\"invalidCountryCode\":[32],\"invalidNumber\":[32],\"errorMap\":[32],\"getValues\":[64],\"isValid\":[64]}],[4,\"salla-placeholder\",{\"icon\":[1],\"alignment\":[1],\"iconSize\":[1,\"icon-size\"],\"translationLoaded\":[32]}],[0,\"salla-skeleton\",{\"type\":[1],\"width\":[1],\"height\":[1]}],[4,\"salla-modal\",{\"isClosable\":[1028,\"is-closable\"],\"width\":[513],\"position\":[513],\"visible\":[516],\"hasSkeleton\":[516,\"has-skeleton\"],\"isLoading\":[1540,\"is-loading\"],\"subTitleFirst\":[4,\"sub-title-first\"],\"noPadding\":[4,\"no-padding\"],\"subTitle\":[1,\"sub-title\"],\"centered\":[4],\"iconStyle\":[1,\"icon-style\"],\"modalTitle\":[32],\"open\":[64],\"close\":[64],\"setTitle\":[64],\"loading\":[64],\"stopLoading\":[64]},[[0,\"keyup\",\"handleKeyUp\"]]],[4,\"salla-button\",{\"shape\":[513],\"color\":[513],\"fill\":[513],\"size\":[513],\"width\":[513],\"loading\":[516],\"disabled\":[516],\"loaderPosition\":[1,\"loader-position\"],\"href\":[1],\"load\":[64],\"stop\":[64],\"setText\":[64],\"disable\":[64],\"enable\":[64]}],[0,\"salla-loading\",{\"size\":[8],\"width\":[8],\"color\":[1],\"bgColor\":[1,\"bg-color\"]}]]],[\"salla-add-product-button.cjs\",[[4,\"salla-add-product-button\",{\"channels\":[513],\"quantity\":[514],\"donatingAmount\":[514,\"donating-amount\"],\"productId\":[520,\"product-id\"],\"productStatus\":[513,\"product-status\"],\"productType\":[513,\"product-type\"]}]]],[\"salla-installment.cjs\",[[0,\"salla-installment\",{\"price\":[1],\"language\":[1],\"currency\":[1],\"tamaraIsActive\":[32],\"tabbyIsActive\":[32],\"spotiiIsActive\":[32]}]]],[\"salla-loyalty-prize-item.cjs\",[[0,\"salla-loyalty-prize-item\",{\"item\":[16]}]]],[\"salla-select.cjs\",[[0,\"salla-select\",{\"label\":[1],\"items\":[16],\"itemText\":[1,\"item-text\"],\"itemValue\":[1,\"item-value\"],\"itemDisabled\":[1,\"item-disabled\"],\"size\":[1],\"value\":[1032],\"autofocus\":[4],\"clearable\":[4],\"clearIcon\":[1,\"clear-icon\"],\"color\":[1],\"flat\":[4],\"disabled\":[4],\"loading\":[4],\"loadingColor\":[1,\"loading-color\"],\"hint\":[1],\"persistHint\":[4,\"persist-hint\"],\"placeholder\":[1],\"multiple\":[4],\"autocomplete\":[4],\"required\":[4],\"chips\":[4],\"shape\":[1],\"returnObject\":[4,\"return-object\"],\"hideDetail\":[4,\"hide-detail\"]}]]]]"), options);
|
|
81
|
+
return index.bootstrapLazy(JSON.parse("[[\"salla-button_37.cjs\",[[4,\"salla-gifting\",{\"productId\":[2,\"product-id\"],\"sectionTitle\":[32],\"sectionSubtitle\":[32],\"sectionBtnText\":[32],\"giftDetails\":[32],\"selectImageForYourGift\":[32],\"selectImageOrUpload\":[32],\"selectGiftMessage\":[32],\"giftCustomText\":[32],\"textId\":[32],\"incorrectGiftText\":[32],\"nextStep\":[32],\"senderNameLabel\":[32],\"receiverNameFieldLabel\":[32],\"receiverMobileFieldLabel\":[32],\"receiverEmailFieldLabel\":[32],\"emailPlaceholder\":[32],\"sendLater\":[32],\"selectSendDateAndTime\":[32],\"canNotEditOrderAfterSelectDate\":[32],\"sendGift\":[32],\"donationRequired\":[32],\"currentStep\":[32],\"showCalendar\":[32],\"showGiftText\":[32],\"currentLang\":[32],\"parentClass\":[32],\"errors\":[32],\"gift\":[32],\"selectedGiftTextOption\":[32],\"showTextArea\":[32],\"selectedImage\":[32],\"uploadedImage\":[32],\"selectedText\":[32],\"senderName\":[32],\"errorMessage\":[32],\"hasError\":[32],\"quantity\":[32],\"deliveryDate\":[32],\"timeZone\":[32],\"receiverName\":[32],\"receiverMobile\":[32],\"receiverCountryCode\":[32],\"receiverEmail\":[32],\"open\":[64],\"close\":[64],\"goToStep2\":[64]}],[4,\"salla-loyalty\",{\"prizePoints\":[8,\"prize-points\"],\"customerPoints\":[2,\"customer-points\"],\"prizeTitle\":[1,\"prize-title\"],\"allowEmail\":[4,\"allow-email\"],\"allowMobile\":[4,\"allow-mobile\"],\"requireEmail\":[4,\"require-email\"],\"guestMessage\":[1,\"guest-message\"],\"loyaltyProgram\":[32],\"buttonLoading\":[32],\"selectedItem\":[32],\"askConfirmation\":[32],\"is_loggedin\":[32],\"hasError\":[32],\"errorMessage\":[32],\"translationLoaded\":[32],\"open\":[64],\"close\":[64],\"resetExchange\":[64],\"exchangeLoyaltyPoint\":[64]}],[4,\"salla-product-size-guide\",{\"guides\":[32],\"productId\":[32],\"placeholder_title\":[32],\"placeholder_description\":[32],\"modal_title\":[32],\"hasError\":[32],\"open\":[64],\"close\":[64]}],[4,\"salla-login-modal\",{\"isEmailAllowed\":[1028,\"is-email-allowed\"],\"isMobileAllowed\":[1028,\"is-mobile-allowed\"],\"isEmailRequired\":[1028,\"is-email-required\"],\"supportWebAuth\":[516,\"support-web-auth\"],\"currentTabName\":[32],\"regType\":[32],\"translationLoaded\":[32],\"title\":[32],\"emailErrorMsg\":[32],\"firstNameErrorMsg\":[32],\"lastNameErrorMsg\":[32],\"dragAndDrop\":[32],\"browseFromFiles\":[32],\"customFields\":[32],\"uploadedImage\":[32],\"open\":[64]},[[8,\"verified\",\"onVerified\"]]],[0,\"salla-offer-modal\",{\"offer\":[32],\"offer_name\":[32],\"offer_message\":[32],\"hasError\":[32],\"errorMessage\":[32],\"productID\":[32],\"translationLoaded\":[32],\"addToCartLabel\":[32],\"open\":[64],\"showOffer\":[64]}],[0,\"salla-rating-modal\",{\"orderId\":[2,\"order-id\"],\"order\":[32],\"hasError\":[32],\"errorMessage\":[32],\"translationLoaded\":[32],\"open\":[64],\"close\":[64]}],[4,\"salla-scopes\",{\"selection\":[1],\"searchDisplayLimit\":[2,\"search-display-limit\"],\"translationLoaded\":[32],\"mode\":[32],\"current_scope\":[32],\"scopes\":[32],\"originalScopesList\":[32],\"selected_scope\":[32],\"isOpenedBefore\":[32],\"hasError\":[32],\"loading\":[32],\"close\":[64],\"open\":[64],\"handleSubmit\":[64]}],[0,\"salla-localization-modal\",{\"language\":[1537],\"currency\":[1537],\"translationLoaded\":[32],\"languages\":[32],\"currencies\":[32],\"hasError\":[32],\"errorMessage\":[32],\"open\":[64],\"close\":[64],\"submit\":[64]}],[0,\"salla-quick-order\",{\"quickOrderTitle\":[1025,\"quick-order-title\"],\"subTitle\":[1025,\"sub-title\"],\"payButtonTitle\":[1025,\"pay-button-title\"],\"confirmPayButtonTitle\":[1025,\"confirm-pay-button-title\"],\"agreementText\":[1025,\"agreement-text\"],\"isEmailRequired\":[1028,\"is-email-required\"],\"productId\":[1025,\"product-id\"],\"thanksMessage\":[1025,\"thanks-message\"],\"quickOrderStyle\":[1025,\"quick-order-style\"],\"user\":[32],\"isAvailable\":[32],\"oneClick\":[32],\"expanded\":[32],\"isTermsRequired\":[32],\"countryCode\":[32],\"submitSucess\":[32],\"placeHolderEmail\":[32],\"emailOptional\":[32],\"agreementShowText\":[32],\"agreementModalHead\":[32],\"userNameLabel\":[32],\"termsChecked\":[32]}],[0,\"salla-user-settings\",{\"isNotifiable\":[516,\"is-notifiable\"],\"deactivateAccount\":[32],\"promotionalMsgs\":[32],\"deactivateDesc\":[32],\"promotionalMsgsDesc\":[32],\"sorryForLeavingText\":[32],\"warningText\":[32],\"keepAccount\":[32],\"buttonLoading\":[32]}],[4,\"salla-map\",{\"readonly\":[4],\"searchable\":[1028],\"lat\":[1026],\"lng\":[1026],\"apiKey\":[1025,\"api-key\"],\"modalTitle\":[1,\"modal-title\"],\"zoom\":[1026],\"theme\":[1025],\"modalActivityTitle\":[32],\"confirmButtonTitle\":[32],\"locateButtonTitle\":[32],\"locateButtonEdit\":[32],\"searchInputValue\":[32],\"geolocationError\":[32],\"searchInput\":[32],\"mapElement\":[32],\"open\":[64]}],[0,\"salla-product-options\",{\"productId\":[2,\"product-id\"],\"options\":[1],\"optionsData\":[32],\"uploadedImage\":[32],\"outOfStockText\":[32],\"donationAmount\":[32]}],[0,\"salla-search\",{\"inline\":[4],\"oval\":[4],\"height\":[2],\"translationLoaded\":[32],\"results\":[32],\"loading\":[32],\"typing\":[32],\"debounce\":[32],\"search_term\":[32]},[[0,\"keydown\",\"handleKeyDown\"]]],[0,\"salla-comment-form\",{\"type\":[1],\"showAvatar\":[4,\"show-avatar\"],\"itemId\":[8,\"item-id\"],\"placeholder\":[32],\"submitText\":[32],\"canComment\":[32]}],[4,\"salla-social-share\",{\"url\":[513],\"urlName\":[513,\"url-name\"],\"platforms\":[513],\"opened\":[32],\"allPlatforms\":[32],\"platformIcons\":[32],\"convertedPlatforms\":[32],\"open\":[64]}],[4,\"salla-cart-summary\",{\"cartSummaryCount\":[32],\"cartSummaryTotal\":[32],\"animateToCart\":[64]}],[4,\"salla-color-picker\",{\"color\":[1],\"placement\":[8],\"format\":[1],\"showCancelButton\":[4,\"show-cancel-button\"],\"showTextField\":[4,\"show-text-field\"],\"enableAlpha\":[4,\"enable-alpha\"],\"widgetColor\":[32],\"setPickerOption\":[64],\"movePopUp\":[64],\"setColorValue\":[64],\"openPicker\":[64],\"closePicker\":[64],\"destroyPicker\":[64]}],[4,\"salla-infinite-scroll\",{\"nextPage\":[1,\"next-page\"],\"autoload\":[1028],\"container\":[1],\"item\":[1],\"loadMore\":[32],\"noMore\":[32],\"failedToLoad\":[32]}],[4,\"salla-quantity-input\",{\"quantity\":[32],\"decrease\":[64],\"increase\":[64],\"setValue\":[64]}],[0,\"salla-user-menu\",{\"inline\":[516],\"avatarOnly\":[516,\"avatar-only\"],\"showHeader\":[516,\"show-header\"],\"relativeDropdown\":[516,\"relative-dropdown\"],\"accountLoading\":[32],\"opened\":[32],\"notifications\":[32],\"orders\":[32],\"pending_orders\":[32],\"wishlist\":[32],\"profile\":[32],\"rating\":[32],\"logout\":[32],\"hello\":[32],\"first_name\":[32],\"last_name\":[32],\"avatar\":[32],\"badges\":[32],\"OrderUpdate\":[32]}],[0,\"salla-product-availability\",{\"channels\":[1],\"productId\":[2,\"product-id\"],\"isSubscribed\":[1028,\"is-subscribed\"],\"translationLoaded\":[32],\"title_\":[32],\"isVisitorSubscribed\":[32]}],[4,\"salla-verify\",{\"display\":[1],\"type\":[1025],\"autoReload\":[4,\"auto-reload\"],\"supportWebAuth\":[4,\"support-web-auth\"],\"translationLoaded\":[32],\"title\":[32],\"resendAfter\":[32],\"isProfileVerify\":[32],\"getCode\":[64],\"open\":[64]}],[4,\"salla-conditional-fields\",null,[[0,\"change\",\"changeHandler\"]]],[0,\"salla-rating-stars\",{\"name\":[1],\"size\":[1],\"value\":[2]}],[0,\"salla-datetime-picker\",{\"value\":[1025],\"placeholder\":[1],\"allowInput\":[4,\"allow-input\"],\"allowInvalidPreload\":[4,\"allow-invalid-preload\"],\"altFormat\":[1,\"alt-format\"],\"altInput\":[4,\"alt-input\"],\"altInputClass\":[1,\"alt-input-class\"],\"appendTo\":[16],\"ariaDateFormat\":[1,\"aria-date-format\"],\"autoFillDefaultTime\":[4,\"auto-fill-default-time\"],\"clickOpens\":[4,\"click-opens\"],\"closeOnSelect\":[4,\"close-on-select\"],\"conjunction\":[1],\"dateFormat\":[1,\"date-format\"],\"defaultDate\":[8,\"default-date\"],\"defaultHour\":[2,\"default-hour\"],\"defaultMinute\":[2,\"default-minute\"],\"defaultSeconds\":[2,\"default-seconds\"],\"disable\":[16],\"disableMobile\":[4,\"disable-mobile\"],\"enable\":[16],\"enableSeconds\":[4,\"enable-seconds\"],\"enableTime\":[4,\"enable-time\"],\"formatDate\":[16],\"hourIncrement\":[2,\"hour-increment\"],\"inline\":[4],\"locale\":[1],\"maxDate\":[8,\"max-date\"],\"maxTime\":[8,\"max-time\"],\"minDate\":[8,\"min-date\"],\"minTime\":[8,\"min-time\"],\"minuteIncrement\":[2,\"minute-increment\"],\"mode\":[1],\"monthSelectorType\":[1,\"month-selector-type\"],\"nextArrow\":[1,\"next-arrow\"],\"noCalendar\":[4,\"no-calendar\"],\"dateParser\":[16],\"position\":[1],\"positionElement\":[16],\"prevArrow\":[1,\"prev-arrow\"],\"shorthandCurrentMonth\":[4,\"shorthand-current-month\"],\"static\":[4],\"showMonths\":[2,\"show-months\"],\"time_24hr\":[4,\"time_-2-4hr\"],\"weekNumbers\":[4,\"week-numbers\"],\"wrap\":[4]}],[4,\"salla-tab-content\",{\"name\":[1],\"isSelected\":[32],\"getChild\":[64]}],[4,\"salla-tab-header\",{\"name\":[1],\"activeClass\":[1,\"active-class\"],\"height\":[8],\"centered\":[4],\"isSelected\":[32],\"getChild\":[64]}],[4,\"salla-tabs\",{\"backgroundColor\":[1,\"background-color\"],\"vertical\":[4]},[[0,\"tabSelected\",\"onSelectedTab\"]]],[4,\"salla-slider\",{\"blockTitle\":[513,\"block-title\"],\"blockSubtitle\":[513,\"block-subtitle\"],\"displayAllUrl\":[513,\"display-all-url\"],\"verticalThumbs\":[516,\"vertical-thumbs\"],\"vertical\":[516],\"autoHeight\":[516,\"auto-height\"],\"showControls\":[516,\"show-controls\"],\"controlsOuter\":[516,\"controls-outer\"],\"showThumbsControls\":[4,\"show-thumbs-controls\"],\"autoPlay\":[4,\"auto-play\"],\"slidesPerView\":[1,\"slides-per-view\"],\"pagination\":[4],\"centered\":[4],\"loop\":[4],\"type\":[1],\"sliderConfig\":[520,\"slider-config\"],\"thumbsConfig\":[520,\"thumbs-config\"],\"currentIndex\":[32],\"isEnd\":[32],\"isBeginning\":[32],\"isRTL\":[32],\"swiperScript\":[32],\"displayAllTitle\":[32],\"slideTo\":[64],\"slideNext\":[64],\"slidePrev\":[64],\"slideToLoop\":[64],\"slideNextLoop\":[64],\"slidePrevLoop\":[64],\"slideReset\":[64],\"slideToClosest\":[64],\"update\":[64],\"updateAutoHeight\":[64],\"updateSlides\":[64],\"updateProgress\":[64],\"updateSlidesClasses\":[64],\"getSlides\":[64]}],[0,\"salla-file-upload\",{\"uploadedImage\":[1025,\"uploaded-image\"],\"required\":[4],\"disabled\":[4],\"allowDrop\":[4,\"allow-drop\"],\"allowBrowse\":[4,\"allow-browse\"],\"allowPaste\":[4,\"allow-paste\"],\"allowMultiple\":[4,\"allow-multiple\"],\"allowReplace\":[4,\"allow-replace\"],\"allowRevert\":[4,\"allow-revert\"],\"allowRemove\":[4,\"allow-remove\"],\"allowProcess\":[4,\"allow-process\"],\"allowReorder\":[4,\"allow-reorder\"],\"storeAsFile\":[4,\"store-as-file\"],\"forceRevert\":[4,\"force-revert\"],\"maxFilesCount\":[2,\"max-files-count\"],\"maxParallelUploads\":[2,\"max-parallel-uploads\"],\"checkValidity\":[4,\"check-validity\"],\"itemInsertLocation\":[1,\"item-insert-location\"],\"itemInsertInterval\":[2,\"item-insert-interval\"],\"credits\":[4],\"dropOnPage\":[4,\"drop-on-page\"],\"dropOnElement\":[4,\"drop-on-element\"],\"dropValidation\":[4,\"drop-validation\"],\"ignoredFiles\":[16],\"serverConfig\":[1,\"server-config\"],\"instantUpload\":[4,\"instant-upload\"],\"chunkUploads\":[4,\"chunk-uploads\"],\"chunkForce\":[4,\"chunk-force\"],\"chunkSize\":[2,\"chunk-size\"],\"chunkRetryDelays\":[16],\"labelDecimalSeparator\":[1,\"label-decimal-separator\"],\"labelThousandsSeparator\":[1,\"label-thousands-separator\"],\"labelIdle\":[1,\"label-idle\"],\"labelInvalidField\":[1,\"label-invalid-field\"],\"labelFileWaitingForSize\":[1,\"label-file-waiting-for-size\"],\"labelFileSizeNotAvailable\":[1,\"label-file-size-not-available\"],\"labelFileLoading\":[1,\"label-file-loading\"],\"labelFileLoadError\":[1,\"label-file-load-error\"],\"labelFileProcessing\":[1,\"label-file-processing\"],\"labelFileProcessingComplete\":[1,\"label-file-processing-complete\"],\"labelFileProcessingAborted\":[1,\"label-file-processing-aborted\"],\"labelFileProcessingError\":[1,\"label-file-processing-error\"],\"labelFileProcessingRevertError\":[1,\"label-file-processing-revert-error\"],\"labelFileRemoveError\":[1,\"label-file-remove-error\"],\"labelTapToCancel\":[1,\"label-tap-to-cancel\"],\"labelTapToRetry\":[1,\"label-tap-to-retry\"],\"labelTapToUndo\":[1,\"label-tap-to-undo\"],\"labelButtonRemoveItem\":[1,\"label-button-remove-item\"],\"labelButtonAbortItemLoad\":[1,\"label-button-abort-item-load\"],\"labelButtonRetryItemLoad\":[1,\"label-button-retry-item-load\"],\"labelButtonAbortItemProcessing\":[1,\"label-button-abort-item-processing\"],\"labelButtonUndoItemProcessing\":[1,\"label-button-undo-item-processing\"],\"labelButtonRetryItemProcessing\":[1,\"label-button-retry-item-processing\"],\"labelButtonProcessItem\":[1,\"label-button-process-item\"],\"iconRemove\":[1,\"icon-remove\"],\"iconProcess\":[1,\"icon-process\"],\"iconRetry\":[1,\"icon-retry\"],\"iconUndo\":[1,\"icon-undo\"],\"pond\":[32],\"files\":[32],\"appendFile\":[64]}],[4,\"salla-list-tile\",{\"href\":[1],\"target\":[1]}],[0,\"salla-tel-input\",{\"phone\":[1025],\"name\":[1],\"countryCode\":[1025,\"country-code\"],\"mobileRequired\":[32],\"countryCodeLabel\":[32],\"mobileLabel\":[32],\"tooShort\":[32],\"tooLong\":[32],\"invalidCountryCode\":[32],\"invalidNumber\":[32],\"errorMap\":[32],\"getValues\":[64],\"isValid\":[64]}],[4,\"salla-placeholder\",{\"icon\":[1],\"alignment\":[1],\"iconSize\":[1,\"icon-size\"],\"translationLoaded\":[32]}],[0,\"salla-skeleton\",{\"type\":[1],\"width\":[1],\"height\":[1]}],[4,\"salla-modal\",{\"isClosable\":[1028,\"is-closable\"],\"width\":[513],\"position\":[513],\"visible\":[516],\"hasSkeleton\":[516,\"has-skeleton\"],\"isLoading\":[1540,\"is-loading\"],\"subTitleFirst\":[4,\"sub-title-first\"],\"noPadding\":[4,\"no-padding\"],\"subTitle\":[1,\"sub-title\"],\"centered\":[4],\"iconStyle\":[1,\"icon-style\"],\"modalTitle\":[32],\"open\":[64],\"close\":[64],\"setTitle\":[64],\"loading\":[64],\"stopLoading\":[64]},[[0,\"keyup\",\"handleKeyUp\"]]],[4,\"salla-button\",{\"shape\":[513],\"color\":[513],\"fill\":[513],\"size\":[513],\"width\":[513],\"loading\":[516],\"disabled\":[516],\"loaderPosition\":[1,\"loader-position\"],\"href\":[1],\"load\":[64],\"stop\":[64],\"setText\":[64],\"disable\":[64],\"enable\":[64]}],[0,\"salla-loading\",{\"size\":[8],\"width\":[8],\"color\":[1],\"bgColor\":[1,\"bg-color\"]}]]],[\"salla-add-product-button.cjs\",[[4,\"salla-add-product-button\",{\"channels\":[513],\"quantity\":[514],\"donatingAmount\":[514,\"donating-amount\"],\"productId\":[520,\"product-id\"],\"productStatus\":[513,\"product-status\"],\"productType\":[513,\"product-type\"]}]]],[\"salla-installment.cjs\",[[0,\"salla-installment\",{\"price\":[1],\"language\":[1],\"currency\":[1],\"tamaraIsActive\":[32],\"tabbyIsActive\":[32],\"spotiiIsActive\":[32]}]]],[\"salla-loyalty-prize-item.cjs\",[[0,\"salla-loyalty-prize-item\",{\"item\":[16]}]]],[\"salla-select.cjs\",[[0,\"salla-select\",{\"label\":[1],\"items\":[16],\"itemText\":[1,\"item-text\"],\"itemValue\":[1,\"item-value\"],\"itemDisabled\":[1,\"item-disabled\"],\"size\":[1],\"value\":[1032],\"autofocus\":[4],\"clearable\":[4],\"clearIcon\":[1,\"clear-icon\"],\"color\":[1],\"flat\":[4],\"disabled\":[4],\"loading\":[4],\"loadingColor\":[1,\"loading-color\"],\"hint\":[1],\"persistHint\":[4,\"persist-hint\"],\"placeholder\":[1],\"multiple\":[4],\"autocomplete\":[4],\"required\":[4],\"chips\":[4],\"shape\":[1],\"returnObject\":[4,\"return-object\"],\"hideDetail\":[4,\"hide-detail\"]}]]]]"), options);
|
|
82
82
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import { Component, Prop, State, h, Method, Host, Event } from '@stencil/core';
|
|
4
|
+
import { Component, Prop, State, h, Method, Element, Host, Event } from '@stencil/core';
|
|
5
5
|
import * as FilePond from 'filepond';
|
|
6
6
|
import FilePondPluginFileValidateSize from 'filepond-plugin-file-validate-size';
|
|
7
7
|
import FilePondPluginImageExifOrientation from 'filepond-plugin-image-exif-orientation';
|
|
@@ -10,6 +10,10 @@ import FilePondPluginImageEdit from 'filepond-plugin-image-edit';
|
|
|
10
10
|
import FilePondPluginFileValidateType from 'filepond-plugin-file-validate-type';
|
|
11
11
|
export class SallaFileUpload {
|
|
12
12
|
constructor() {
|
|
13
|
+
/**
|
|
14
|
+
* The uploaded image link or URL
|
|
15
|
+
*/
|
|
16
|
+
this.uploadedImage = undefined;
|
|
13
17
|
/**
|
|
14
18
|
* Sets the required attribute to the output field
|
|
15
19
|
*/
|
|
@@ -115,7 +119,28 @@ export class SallaFileUpload {
|
|
|
115
119
|
/**
|
|
116
120
|
* A server configuration object describing how FilePond should interact with the server.
|
|
117
121
|
*/
|
|
118
|
-
this.serverConfig =
|
|
122
|
+
this.serverConfig = {
|
|
123
|
+
process: async (_fieldName, file, _metadata, load, error, _progress, abort, _transfer, _options) => {
|
|
124
|
+
const formData = new FormData();
|
|
125
|
+
formData.append("image_url", file, file.name);
|
|
126
|
+
return await salla.product.uploadGiftImage(formData)
|
|
127
|
+
.then((resp) => {
|
|
128
|
+
this.uploadedImage = resp.data.url;
|
|
129
|
+
this.uploaded.emit(resp.data.url);
|
|
130
|
+
load('success');
|
|
131
|
+
}).catch(e => {
|
|
132
|
+
console.log(e);
|
|
133
|
+
error('error');
|
|
134
|
+
})
|
|
135
|
+
.finally(() => {
|
|
136
|
+
return {
|
|
137
|
+
abort: () => {
|
|
138
|
+
abort();
|
|
139
|
+
},
|
|
140
|
+
};
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
};
|
|
119
144
|
/**
|
|
120
145
|
* Immediately upload new files to the server
|
|
121
146
|
*/
|
|
@@ -267,7 +292,7 @@ export class SallaFileUpload {
|
|
|
267
292
|
}
|
|
268
293
|
intiFilePond() {
|
|
269
294
|
FilePond.registerPlugin(FilePondPluginImagePreview, FilePondPluginImageExifOrientation, FilePondPluginFileValidateSize, FilePondPluginImageEdit, FilePondPluginFileValidateType);
|
|
270
|
-
return FilePond.create(
|
|
295
|
+
return FilePond.create(this.fileUploader, {
|
|
271
296
|
files: this.files,
|
|
272
297
|
required: this.required,
|
|
273
298
|
disabled: this.disabled,
|
|
@@ -305,13 +330,17 @@ export class SallaFileUpload {
|
|
|
305
330
|
labelFileWaitingForSize: this.labelFileWaitingForSize,
|
|
306
331
|
beforeRemoveFile: (file_deleted) => new Promise((resolve) => {
|
|
307
332
|
this.remove.emit(file_deleted);
|
|
333
|
+
setTimeout(() => {
|
|
334
|
+
// TODO: needs a better way
|
|
335
|
+
this.host.style.height = '120px !important';
|
|
336
|
+
}, 1000);
|
|
308
337
|
resolve(true);
|
|
309
338
|
}),
|
|
310
339
|
});
|
|
311
340
|
}
|
|
312
341
|
render() {
|
|
313
342
|
return (h(Host, { class: "s-file-upload" },
|
|
314
|
-
h("input", { type: "file", class: "s-file-upload-wrapper s-file-upload-input", name: "filepond", accept: "image/png, image/jpeg, image/jpg, image/gif" })));
|
|
343
|
+
h("input", { type: "file", class: "s-file-upload-wrapper s-file-upload-input", ref: ele => this.fileUploader = ele, name: "filepond", accept: "image/png, image/jpeg, image/jpg, image/gif" })));
|
|
315
344
|
}
|
|
316
345
|
static get is() { return "salla-file-upload"; }
|
|
317
346
|
static get originalStyleUrls() { return {
|
|
@@ -321,6 +350,24 @@ export class SallaFileUpload {
|
|
|
321
350
|
"$": ["salla-file-upload.css"]
|
|
322
351
|
}; }
|
|
323
352
|
static get properties() { return {
|
|
353
|
+
"uploadedImage": {
|
|
354
|
+
"type": "string",
|
|
355
|
+
"mutable": true,
|
|
356
|
+
"complexType": {
|
|
357
|
+
"original": "string",
|
|
358
|
+
"resolved": "string",
|
|
359
|
+
"references": {}
|
|
360
|
+
},
|
|
361
|
+
"required": false,
|
|
362
|
+
"optional": false,
|
|
363
|
+
"docs": {
|
|
364
|
+
"tags": [],
|
|
365
|
+
"text": "The uploaded image link or URL"
|
|
366
|
+
},
|
|
367
|
+
"attribute": "uploaded-image",
|
|
368
|
+
"reflect": false,
|
|
369
|
+
"defaultValue": "undefined"
|
|
370
|
+
},
|
|
324
371
|
"required": {
|
|
325
372
|
"type": "boolean",
|
|
326
373
|
"mutable": false,
|
|
@@ -746,7 +793,7 @@ export class SallaFileUpload {
|
|
|
746
793
|
"type": "string",
|
|
747
794
|
"mutable": false,
|
|
748
795
|
"complexType": {
|
|
749
|
-
"original": "string | {\n url?: string\n timeout?: number\n headers?: { [key: string]: string | boolean | number };\n process?: string | ServerUrl | ProcessServerConfigFunction | null;\n revert?: string | ServerUrl | RevertServerConfigFunction | null;\n restore?: string | ServerUrl | RestoreServerConfigFunction | null;\n load?: string | ServerUrl | LoadServerConfigFunction | null;\n fetch?: string | ServerUrl | FetchServerConfigFunction | null;\n remove?: RemoveServerConfigFunction | null;\n }
|
|
796
|
+
"original": "string | {\n url?: string\n timeout?: number\n headers?: { [key: string]: string | boolean | number };\n process?: string | ServerUrl | ProcessServerConfigFunction | null;\n revert?: string | ServerUrl | RevertServerConfigFunction | null;\n restore?: string | ServerUrl | RestoreServerConfigFunction | null;\n load?: string | ServerUrl | LoadServerConfigFunction | null;\n fetch?: string | ServerUrl | FetchServerConfigFunction | null;\n remove?: RemoveServerConfigFunction | null;\n }",
|
|
750
797
|
"resolved": "string | { url?: string; timeout?: number; headers?: { [key: string]: string | number | boolean; }; process?: string | ServerUrl | ProcessServerConfigFunction; revert?: string | ServerUrl | RevertServerConfigFunction; restore?: string | ServerUrl | RestoreServerConfigFunction; load?: string | ServerUrl | LoadServerConfigFunction; fetch?: string | ServerUrl | FetchServerConfigFunction; remove?: RemoveServerConfigFunction; }",
|
|
751
798
|
"references": {
|
|
752
799
|
"ServerUrl": {
|
|
@@ -787,7 +834,7 @@ export class SallaFileUpload {
|
|
|
787
834
|
},
|
|
788
835
|
"attribute": "server-config",
|
|
789
836
|
"reflect": false,
|
|
790
|
-
"defaultValue": "
|
|
837
|
+
"defaultValue": "{\n process: async (_fieldName, file, _metadata, load, error, _progress, abort, _transfer, _options) => {\n const formData = new FormData();\n formData.append(\"image_url\", file, file.name);\n return await salla.product.uploadGiftImage(formData)\n .then((resp) => {\n this.uploadedImage = resp.data.url\n this.uploaded.emit(resp.data.url);\n load('success')\n }).catch(e => {\n console.log(e)\n error('error')\n })\n .finally(() => {\n return {\n abort: () => {\n abort();\n },\n };\n })\n }\n }"
|
|
791
838
|
},
|
|
792
839
|
"instantUpload": {
|
|
793
840
|
"type": "boolean",
|
|
@@ -1391,6 +1438,21 @@ export class SallaFileUpload {
|
|
|
1391
1438
|
"files": {}
|
|
1392
1439
|
}; }
|
|
1393
1440
|
static get events() { return [{
|
|
1441
|
+
"method": "uploaded",
|
|
1442
|
+
"name": "uploaded",
|
|
1443
|
+
"bubbles": true,
|
|
1444
|
+
"cancelable": true,
|
|
1445
|
+
"composed": true,
|
|
1446
|
+
"docs": {
|
|
1447
|
+
"tags": [],
|
|
1448
|
+
"text": "Event emitted when the file has been uploaded and link to the file has been recieved from the server. Returns string value."
|
|
1449
|
+
},
|
|
1450
|
+
"complexType": {
|
|
1451
|
+
"original": "string",
|
|
1452
|
+
"resolved": "string",
|
|
1453
|
+
"references": {}
|
|
1454
|
+
}
|
|
1455
|
+
}, {
|
|
1394
1456
|
"method": "remove",
|
|
1395
1457
|
"name": "remove",
|
|
1396
1458
|
"bubbles": true,
|
|
@@ -1431,4 +1493,5 @@ export class SallaFileUpload {
|
|
|
1431
1493
|
}
|
|
1432
1494
|
}
|
|
1433
1495
|
}; }
|
|
1496
|
+
static get elementRef() { return "host"; }
|
|
1434
1497
|
}
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
import anime from 'animejs';
|
|
5
5
|
import { Component, h, Prop, State, Method } from '@stencil/core';
|
|
6
6
|
import Images from '../../assets/svg/images.svg';
|
|
7
|
-
import RightArrow from '../../assets/svg/arrow-right.svg';
|
|
8
7
|
import LeftArrow from '../../assets/svg/arrow-left.svg';
|
|
9
8
|
import Cancel from '../../assets/svg/cancel.svg';
|
|
10
9
|
import GiftSharing from '../../assets/svg/gift-sharing.svg';
|
|
@@ -29,13 +28,6 @@ export class SallaGifting {
|
|
|
29
28
|
salla.lang.onLoaded(() => {
|
|
30
29
|
this.selectImageOrUpload = salla.lang.get('blocks.buy_as_gift.select_image_or_upload');
|
|
31
30
|
this.selectImageForYourGift = salla.lang.get('blocks.buy_as_gift.select_image_for_your_gift');
|
|
32
|
-
this.step1Elems = document.querySelectorAll('.gift-step-1 .anime-item');
|
|
33
|
-
this.step2Elems = document.querySelectorAll('.gift-step-2 .anime-item');
|
|
34
|
-
this.imageCover = document.querySelector('.s-gifting-modal-uploader');
|
|
35
|
-
this.stepsWrapper = document.querySelector('.steps-wrapper');
|
|
36
|
-
this.textSelect = document.querySelector('.s-gifting-selectText');
|
|
37
|
-
this.customTextArea = document.querySelector('.s-gifting-textarea');
|
|
38
|
-
this.calendarFormGroup = document.querySelector('.s-gifting-calendar');
|
|
39
31
|
this.sectionTitle = salla.lang.get('blocks.buy_as_gift.gift_the_one_you_love');
|
|
40
32
|
this.sectionSubtitle = salla.lang.get('blocks.buy_as_gift.gift_the_one_you_love_message');
|
|
41
33
|
this.sectionBtnText = salla.lang.get('blocks.buy_as_gift.send_as_a_gift');
|
|
@@ -129,25 +121,24 @@ export class SallaGifting {
|
|
|
129
121
|
* Go to the step 2
|
|
130
122
|
*/
|
|
131
123
|
async goToStep2() {
|
|
132
|
-
var _a, _b, _c, _d, _e, _f;
|
|
133
124
|
if (!this.selectedGiftTextOption) {
|
|
134
|
-
|
|
135
|
-
|
|
125
|
+
this.textSelect.classList.add('s-form-has-error');
|
|
126
|
+
this.customTextArea.classList.remove('s-form-has-error');
|
|
136
127
|
return;
|
|
137
128
|
}
|
|
138
129
|
else if (this.selectedGiftTextOption == 'custom' && !this.selectedText) {
|
|
139
|
-
|
|
140
|
-
|
|
130
|
+
this.textSelect.classList.remove('s-form-has-error');
|
|
131
|
+
this.customTextArea.classList.add('s-form-has-error');
|
|
141
132
|
return;
|
|
142
133
|
}
|
|
143
134
|
else {
|
|
144
|
-
|
|
145
|
-
|
|
135
|
+
this.textSelect.classList.remove('s-form-has-error');
|
|
136
|
+
this.customTextArea.classList.remove('s-form-has-error');
|
|
146
137
|
}
|
|
147
138
|
this.setWrapperHeight(2, 600, 0);
|
|
148
139
|
let stepNextAnime = new anime.timeline();
|
|
149
140
|
stepNextAnime.add({
|
|
150
|
-
targets: this.step1Elems,
|
|
141
|
+
targets: this.step1Elems.querySelectorAll('.anime-item'),
|
|
151
142
|
opacity: [1, 0],
|
|
152
143
|
translateX: [0, 50],
|
|
153
144
|
delay: anime.stagger(70),
|
|
@@ -160,13 +151,13 @@ export class SallaGifting {
|
|
|
160
151
|
opacity: [0, 1],
|
|
161
152
|
}, '-=1800')
|
|
162
153
|
.add({
|
|
163
|
-
targets: this.step2Elems,
|
|
154
|
+
targets: this.step2Elems.querySelectorAll('.anime-item'),
|
|
164
155
|
opacity: [0, 1],
|
|
165
156
|
translateX: [-50, 0],
|
|
166
157
|
delay: anime.stagger(70),
|
|
167
158
|
duration: 1200,
|
|
168
159
|
complete: () => {
|
|
169
|
-
this.step2Elems.forEach(item => {
|
|
160
|
+
this.step2Elems.querySelectorAll('.anime-item').forEach(item => {
|
|
170
161
|
item.classList.remove('opacity-0');
|
|
171
162
|
item.removeAttribute('style');
|
|
172
163
|
});
|
|
@@ -179,12 +170,13 @@ export class SallaGifting {
|
|
|
179
170
|
*
|
|
180
171
|
* Go to the step 1
|
|
181
172
|
*/
|
|
182
|
-
goToStep1() {
|
|
173
|
+
goToStep1(e) {
|
|
174
|
+
e.preventDefault();
|
|
183
175
|
let stepBackAnime = new anime.timeline({
|
|
184
176
|
autoplay: false,
|
|
185
177
|
});
|
|
186
178
|
stepBackAnime.add({
|
|
187
|
-
targets: this.step2Elems,
|
|
179
|
+
targets: this.step2Elems.querySelectorAll('.anime-item'),
|
|
188
180
|
opacity: [1, 0],
|
|
189
181
|
translateX: [0, -50],
|
|
190
182
|
delay: anime.stagger(70),
|
|
@@ -197,13 +189,13 @@ export class SallaGifting {
|
|
|
197
189
|
opacity: [0, 1],
|
|
198
190
|
}, '-=1800')
|
|
199
191
|
.add({
|
|
200
|
-
targets: this.step1Elems,
|
|
192
|
+
targets: this.step1Elems.querySelectorAll('.anime-item'),
|
|
201
193
|
opacity: [0, 1],
|
|
202
194
|
translateX: [50, 0],
|
|
203
195
|
delay: anime.stagger(70),
|
|
204
196
|
duration: 1200,
|
|
205
197
|
complete: () => {
|
|
206
|
-
this.step1Elems.forEach(item => {
|
|
198
|
+
this.step1Elems.querySelectorAll('.anime-item').forEach(item => {
|
|
207
199
|
item.classList.remove('opacity-0');
|
|
208
200
|
item.removeAttribute('style');
|
|
209
201
|
});
|
|
@@ -219,19 +211,19 @@ export class SallaGifting {
|
|
|
219
211
|
}
|
|
220
212
|
setPreview(image) {
|
|
221
213
|
var _a, _b;
|
|
222
|
-
(_a = this.
|
|
214
|
+
(_a = this.uploader) === null || _a === void 0 ? void 0 : _a.classList.add('has-bg');
|
|
223
215
|
var bg = document.querySelector('.filepond-bg') ? document.querySelector('.filepond-bg') : document.createElement('div');
|
|
224
216
|
bg.classList.add('filepond-bg');
|
|
225
217
|
bg.classList.remove('s-hidden');
|
|
226
218
|
bg.style.backgroundImage = "url('" + image.url + "')";
|
|
227
|
-
(_b = this.
|
|
219
|
+
(_b = this.uploader) === null || _b === void 0 ? void 0 : _b.querySelector('.filepond--root').appendChild(bg);
|
|
228
220
|
this.uploadedImage = image.url;
|
|
229
221
|
if (!!this.gift && this.gift.gift_images.length) {
|
|
230
222
|
this.setWrapperHeight(1, 150, 0);
|
|
231
223
|
}
|
|
232
224
|
}
|
|
233
225
|
removePreview() {
|
|
234
|
-
this.
|
|
226
|
+
this.uploader.classList.remove('has-bg');
|
|
235
227
|
let bg = document.querySelector('.filepond-bg');
|
|
236
228
|
bg.removeAttribute('style');
|
|
237
229
|
bg.classList.add('s-hidden');
|
|
@@ -383,10 +375,10 @@ export class SallaGifting {
|
|
|
383
375
|
h("span", null, this.currentStep),
|
|
384
376
|
"/2")),
|
|
385
377
|
h("span", null, this.giftDetails)))),
|
|
386
|
-
h("div", { class: "s-gifting-steps-wrapper
|
|
387
|
-
h("div", { class: "s-gifting-step-one gift-step-1" },
|
|
378
|
+
h("div", { class: "s-gifting-steps-wrapper " + this.parentClass, ref: el => this.stepsWrapper = el },
|
|
379
|
+
h("div", { class: "s-gifting-step-one gift-step-1", ref: el => this.step1Elems = el },
|
|
388
380
|
h("div", { class: "s-gifting-modal-uploader-title anime-item" }, this.selectImageForYourGift),
|
|
389
|
-
h("div", { class: "s-gifting-modal-uploader anime-item" },
|
|
381
|
+
h("div", { class: "s-gifting-modal-uploader anime-item", ref: el => this.uploader = el },
|
|
390
382
|
h("span", { class: "s-gifting-remove-preview", onClick: () => this.removePreview(), innerHTML: Cancel }),
|
|
391
383
|
this.selectImageOrUpload && h("salla-file-upload", { "instant-upload": true, labelIdle: this.getFilepondPlaceholder(), serverConfig: this.getServerConfig(), onRemove: () => this.handleRemoveImage() }, " ")),
|
|
392
384
|
h("div", { class: "anime-item" }, !this.uploadedImage && !!this.gift && this.gift.gift_images.length > 0 ?
|
|
@@ -394,20 +386,20 @@ export class SallaGifting {
|
|
|
394
386
|
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}` }))))
|
|
395
387
|
: ""),
|
|
396
388
|
h("div", { class: "anime-item" },
|
|
397
|
-
h("div", { class: "s-form-group s-gifting-selectText" },
|
|
389
|
+
h("div", { class: "s-form-group s-gifting-selectText", ref: el => this.textSelect = el },
|
|
398
390
|
h("label", { htmlFor: "gift-text-selection", class: "s-form-label" }, this.selectGiftMessage),
|
|
399
391
|
h("select", { id: "gift-text-selection", name: "gift-text-selection", class: "s-form-control s-gifting-select", onChange: e => this.toggleGiftText(e) },
|
|
400
392
|
h("option", { "data-id": null, selected: true }, this.selectGiftMessage), (_b = this.gift) === null || _b === void 0 ? void 0 :
|
|
401
393
|
_b.gift_texts.map((txt) => h("option", { "data-id": txt.id, value: txt.text, key: txt.id }, txt.text)),
|
|
402
394
|
h("option", { "data-id": "custom" }, this.giftCustomText))),
|
|
403
|
-
h("div", { class: this.showGiftText ? "s-form-group s-gifting-textarea shown" : "s-form-group s-gifting-textarea hide" },
|
|
395
|
+
h("div", { class: this.showGiftText ? "s-form-group s-gifting-textarea shown" : "s-form-group s-gifting-textarea hide", ref: (el) => this.customTextArea = el },
|
|
404
396
|
h("label", { htmlFor: "gift-custom-text", class: "s-form-label" }, this.giftCustomText),
|
|
405
397
|
h("div", { class: "mt-1" },
|
|
406
398
|
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" })))),
|
|
407
399
|
h("div", { class: "anime-item" },
|
|
408
400
|
h("salla-button", { color: "primary", width: "wide", onClick: () => this.goToStep2() },
|
|
409
401
|
h("span", null, this.nextStep)))),
|
|
410
|
-
h("div", { class: "s-gifting-step-two gift-step-2" },
|
|
402
|
+
h("div", { class: "s-gifting-step-two gift-step-2", ref: el => this.step2Elems = el },
|
|
411
403
|
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" },
|
|
412
404
|
h("label", { htmlFor: "sender_name", class: "s-form-label" }, this.senderNameLabel),
|
|
413
405
|
h("input", { type: "text", class: "s-form-control", name: "sender_name", id: "sender_name", value: this.senderName, onInput: (event) => this.handleSenderName(event), placeholder: "" }),
|
|
@@ -427,12 +419,12 @@ export class SallaGifting {
|
|
|
427
419
|
" ",
|
|
428
420
|
this.sendLater,
|
|
429
421
|
" "))),
|
|
430
|
-
h("div", { class: this.getCalendarClasses() },
|
|
422
|
+
h("div", { class: this.getCalendarClasses(), ref: (el) => this.calendarFormGroup = el },
|
|
431
423
|
h("label", { class: "s-form-label" }, this.selectSendDateAndTime),
|
|
432
424
|
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) }),
|
|
433
425
|
h("span", { class: "s-gifting-calendar-hint" }, this.canNotEditOrderAfterSelectDate)),
|
|
434
426
|
h("div", { class: "s-gifting-step-two-footer anime-item opacity-0" },
|
|
435
|
-
h("a", { href: "#!", innerHTML:
|
|
427
|
+
h("a", { href: "#!", innerHTML: LeftArrow, onClick: (e) => this.goToStep1(e) }),
|
|
436
428
|
h("salla-button", { onClick: () => this.submitForm(), color: "primary", width: 'wide' },
|
|
437
429
|
h("span", null, this.sendGift)))))
|
|
438
430
|
],
|
|
@@ -487,14 +479,6 @@ export class SallaGifting {
|
|
|
487
479
|
"canNotEditOrderAfterSelectDate": {},
|
|
488
480
|
"sendGift": {},
|
|
489
481
|
"donationRequired": {},
|
|
490
|
-
"step1Elems": {},
|
|
491
|
-
"step2Elems": {},
|
|
492
|
-
"stepsWrapper": {},
|
|
493
|
-
"textArea": {},
|
|
494
|
-
"imageCover": {},
|
|
495
|
-
"textSelect": {},
|
|
496
|
-
"customTextArea": {},
|
|
497
|
-
"calendarFormGroup": {},
|
|
498
482
|
"currentStep": {},
|
|
499
483
|
"showCalendar": {},
|
|
500
484
|
"showGiftText": {},
|
|
@@ -5,9 +5,11 @@ import { Component, Element, h, Listen, Method, Prop, State } from '@stencil/cor
|
|
|
5
5
|
import UserIcon from "../../assets/svg/user.svg";
|
|
6
6
|
import PhoneIcon from "../../assets/svg/phone.svg";
|
|
7
7
|
import EmailIcon from "../../assets/svg/mail.svg";
|
|
8
|
+
import CameraIcon from '../../assets/svg/camera.svg';
|
|
8
9
|
import KeyboardArrowRightIcon from "../../assets/svg/keyboard_arrow_right.svg";
|
|
9
10
|
import ArrowRightIcon from "../../assets/svg/arrow-right.svg";
|
|
10
11
|
import Helper from '../../Helpers/Helper';
|
|
12
|
+
import { CustomFieldType } from './intefaces';
|
|
11
13
|
/**
|
|
12
14
|
* @slot footer - The footer of modal
|
|
13
15
|
* @slot before-login-type - placeholder position
|
|
@@ -40,6 +42,11 @@ export class SallaLoginModal {
|
|
|
40
42
|
this.currentTabName = 'home';
|
|
41
43
|
this.regType = 'phone';
|
|
42
44
|
this.translationLoaded = false;
|
|
45
|
+
this.dragAndDrop = salla.lang.get('common.uploader.drag_and_drop');
|
|
46
|
+
this.browseFromFiles = salla.lang.get('common.uploader.browse');
|
|
47
|
+
this.customFields = [];
|
|
48
|
+
this.customFieldsValues = {};
|
|
49
|
+
this.uploadedImage = undefined;
|
|
43
50
|
this.typing = (e, submitMethod = null) => {
|
|
44
51
|
const error = e.target.nextElementSibling;
|
|
45
52
|
e.target.classList.remove('s-has-error');
|
|
@@ -77,6 +84,7 @@ export class SallaLoginModal {
|
|
|
77
84
|
phone: regPhone || this.loginTelInput.phone,
|
|
78
85
|
country_code: countryCode,
|
|
79
86
|
verified_by: this.regType,
|
|
87
|
+
custom_fields: this.customFieldsValues,
|
|
80
88
|
};
|
|
81
89
|
emailValue && (data = Object.assign(Object.assign({}, data), { email: emailValue }));
|
|
82
90
|
this.verifyTab.getCode()
|
|
@@ -95,6 +103,8 @@ export class SallaLoginModal {
|
|
|
95
103
|
salla.lang.onLoaded(() => {
|
|
96
104
|
this.translationLoaded = true;
|
|
97
105
|
this.title = salla.lang.get('blocks.header.login');
|
|
106
|
+
this.dragAndDrop = salla.lang.get('common.uploader.drag_and_drop');
|
|
107
|
+
this.browseFromFiles = salla.lang.get('common.uploader.browse');
|
|
98
108
|
this.updateTranslations();
|
|
99
109
|
});
|
|
100
110
|
salla.event.on('login::open', (event) => this.open(event));
|
|
@@ -108,7 +118,7 @@ export class SallaLoginModal {
|
|
|
108
118
|
* @param {CustomEvent|{details:{case:'new_customer'|'authenticated', redirect_url:string|null}}} event
|
|
109
119
|
*/
|
|
110
120
|
onVerified(event) {
|
|
111
|
-
var _a, _b;
|
|
121
|
+
var _a, _b, _c, _d;
|
|
112
122
|
salla.log('verified', event);
|
|
113
123
|
//there is a case when force login is activated & is new user, it will return case inside error key., so cover it.
|
|
114
124
|
let verifyCase = ((_a = event.detail) === null || _a === void 0 ? void 0 : _a.data.case) || ((_b = event.detail) === null || _b === void 0 ? void 0 : _b.error.case);
|
|
@@ -117,6 +127,7 @@ export class SallaLoginModal {
|
|
|
117
127
|
return;
|
|
118
128
|
}
|
|
119
129
|
if (verifyCase === "new_customer") {
|
|
130
|
+
this.customFields = ((_d = (_c = event.detail) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.custom_fields) || [];
|
|
120
131
|
return this.showTab(this.registrationTab);
|
|
121
132
|
}
|
|
122
133
|
if (!salla.auth.canRedirect()) {
|
|
@@ -194,13 +205,42 @@ export class SallaLoginModal {
|
|
|
194
205
|
}
|
|
195
206
|
async newUserValidation() {
|
|
196
207
|
const isLogByPhone = this.regType == "phone", isLogByEmail = this.regType == "email", emailValue = this.regEmail.value || (isLogByEmail && this.loginEmail.value), isEmailValid = Helper.isValidEmail(emailValue), isFirstNameValid = this.firstName.value.length > 0, isLastNameValid = this.lastName.value.length > 0, isPhoneValid = await this.regTelInput.isValid() || isLogByPhone && await this.loginTelInput.isValid(), emailValidation = (emailValue && isEmailValid) || (!emailValue && !this.isEmailRequired);
|
|
197
|
-
|
|
208
|
+
// Custom Fields Validation
|
|
209
|
+
var isCustomFieldValid = true;
|
|
210
|
+
for (const item of this.customFieldsWrapper.children) {
|
|
211
|
+
if (item.tagName == "SALLA-FILE-UPLOAD") {
|
|
212
|
+
const fileUploader = item;
|
|
213
|
+
this.customFieldsValues[fileUploader.id] = fileUploader.uploadedImage;
|
|
214
|
+
if (fileUploader.required) {
|
|
215
|
+
if (!fileUploader.uploadedImage) {
|
|
216
|
+
isCustomFieldValid = false;
|
|
217
|
+
const errorMsg = salla.lang.get('common.errors.field_required', { attribute: fileUploader.title });
|
|
218
|
+
this.validateField(fileUploader, errorMsg);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
if (item.tagName == "INPUT") {
|
|
223
|
+
const inputItem = item;
|
|
224
|
+
this.customFieldsValues[inputItem.id] = inputItem.value;
|
|
225
|
+
if (inputItem.required) {
|
|
226
|
+
if (inputItem.value.length == 0) {
|
|
227
|
+
isCustomFieldValid = false;
|
|
228
|
+
const errorMsg = salla.lang.get('common.errors.field_required', { attribute: inputItem.title });
|
|
229
|
+
this.validateField(inputItem, errorMsg);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
if (emailValidation && isPhoneValid && isFirstNameValid && isLastNameValid && isCustomFieldValid)
|
|
198
235
|
return;
|
|
199
236
|
!isEmailValid && this.validateField(this.regEmail, this.emailErrorMsg);
|
|
200
237
|
!isFirstNameValid && this.validateField(this.firstName, this.firstNameErrorMsg);
|
|
201
238
|
!isLastNameValid && this.validateField(this.lastName, this.lastNameErrorMsg);
|
|
202
239
|
throw ('Please insert required fields');
|
|
203
240
|
}
|
|
241
|
+
getFilepondPlaceholder() {
|
|
242
|
+
return `<div class="s-login-modal-filepond-placeholder"><span class="s-login-modal-filepond-placeholder-icon">${CameraIcon}</span><p class="s-login-modal-filepond-placeholder-text">${this.dragAndDrop}</p> <span class="filepond--label-action">${this.browseFromFiles}</span></div>`;
|
|
243
|
+
}
|
|
204
244
|
// eslint-disable-next-line @stencil/own-methods-must-be-private
|
|
205
245
|
validateField(field, errorMsg) {
|
|
206
246
|
field.classList.add('s-has-error');
|
|
@@ -282,6 +322,20 @@ export class SallaLoginModal {
|
|
|
282
322
|
h("label", { class: "s-login-modal-label" }, salla.lang.get('common.elements.email')),
|
|
283
323
|
h("input", { type: "email", ref: el => this.regEmail = el, onKeyDown: e => this.typing(e, this.newUser), placeholder: "your@email.com", class: "s-login-modal-input s-ltr" }),
|
|
284
324
|
h("span", { class: "s-login-modal-error-message" })),
|
|
325
|
+
h("div", { class: "s-login-modal-custom-fields", ref: el => this.customFieldsWrapper = el }, this.customFields.map((field) => {
|
|
326
|
+
if (field.type === CustomFieldType.PHOTO) {
|
|
327
|
+
return [
|
|
328
|
+
h("label", { class: "s-login-modal-label" }, field.label),
|
|
329
|
+
h("salla-file-upload", { "instant-upload": true, labelIdle: this.getFilepondPlaceholder(), id: `${field.id}`, title: field.label, required: field.required }),
|
|
330
|
+
h("span", { class: "s-login-modal-error-message" })
|
|
331
|
+
];
|
|
332
|
+
}
|
|
333
|
+
return [
|
|
334
|
+
h("label", { class: "s-login-modal-label" }, field.label),
|
|
335
|
+
h("input", { type: "text", onKeyDown: e => this.typing(e, this.newUser), onInput: el => field.type == CustomFieldType.NUMBER ? salla.helpers.inputDigitsOnly(el.target) : {}, placeholder: field.description, required: field.required, title: field.label, id: `${field.id}`, class: "s-login-modal-input s-ltr" }),
|
|
336
|
+
h("span", { class: "s-login-modal-error-message" })
|
|
337
|
+
];
|
|
338
|
+
})),
|
|
285
339
|
h("salla-button", { "loader-position": 'center', width: "wide", onClick: () => this.newUser(), ref: b => this.regBtn = b }, salla.lang.get('blocks.header.register')),
|
|
286
340
|
h("slot", { name: "after-registration" })))));
|
|
287
341
|
}
|
|
@@ -373,7 +427,11 @@ export class SallaLoginModal {
|
|
|
373
427
|
"title": {},
|
|
374
428
|
"emailErrorMsg": {},
|
|
375
429
|
"firstNameErrorMsg": {},
|
|
376
|
-
"lastNameErrorMsg": {}
|
|
430
|
+
"lastNameErrorMsg": {},
|
|
431
|
+
"dragAndDrop": {},
|
|
432
|
+
"browseFromFiles": {},
|
|
433
|
+
"customFields": {},
|
|
434
|
+
"uploadedImage": {}
|
|
377
435
|
}; }
|
|
378
436
|
static get methods() { return {
|
|
379
437
|
"open": {
|