wickes-css2 2.98.0-develop.10 → 2.98.0-develop.12

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.
@@ -1 +1 @@
1
- !function n(i,r,c){function l(t,e){if(!r[t]){if(!i[t]){var o="function"==typeof require&&require;if(!e&&o)return o(t,!0);if(a)return a(t,!0);throw(e=new Error("Cannot find module '"+t+"'")).code="MODULE_NOT_FOUND",e}o=r[t]={exports:{}},i[t][0].call(o.exports,function(e){return l(i[t][1][e]||e)},o,o.exports,n,i,r,c)}return r[t].exports}for(var a="function"==typeof require&&require,e=0;e<c.length;e++)l(c[e]);return l}({1:[function(e,t,o){"use strict";var n=e("./utils/copy-to-clipboard"),i=e("./utils/helpers"),r=window.Wick||{};r.MyAccount={el:{$clipboardCode:$(".clipboard-code"),appInfo:".app-info",hideAppInfo:"app-info--hide"},clipboardCodes:{tradeProId:{titleEl:".clipboard-code.trade-pro-id .title",subtitleEl:".clipboard-code.trade-pro-id .subtitle",btnCopy:".btn--trade-pro-id"},discountCode:{titleEl:".clipboard-code.discount-code .title",subtitleEl:".clipboard-code.discount-code .subtitle",btnCopy:".btn--discount-code"}},copyCode:function(e){var e=r.MyAccount.clipboardCodes[e],t=e.titleEl,o=e.subtitleEl,e=e.btnCopy,o=$(o).text().trim(),t=$(t).text().trim();(0,n.copyToClipboard)(o,e),r.SnackBar.show({text:"".concat(t," copied to clipboard"),type:r.SnackBar.types.SUCCESS,withCloseButton:!1,autoClose:!0,delayBeforeClose:1500})},init:function(){Object.keys(r.MyAccount.clipboardCodes).forEach(function(e){var t=r.MyAccount.clipboardCodes[e].btnCopy;$(t).on("click",function(){return r.MyAccount.copyCode(e)})}),$(r.MyAccount.el.appInfo).length&&(0,i.isApp)()&&$(r.MyAccount.el.appInfo).addClass(r.MyAccount.el.hideAppInfo)}},$(document).ready(function(){r.MyAccount.el.$clipboardCode.length&&r.MyAccount.init()})},{"./utils/copy-to-clipboard":2,"./utils/helpers":3}],2:[function(e,t,o){"use strict";Object.defineProperty(o,"__esModule",{value:!0}),o.copyToClipboard=function(e,t){var o=$("<textarea>").css({position:"absolute",top:0,left:0,opacity:0});$(t).parent().append(o);t=e.replace(/(^\w|\s\w)/g,function(e){return e.toUpperCase()}).split(" ").filter(function(e){return""!==e}).join(" ");o.val(t),navigator.userAgent.match(/TradeProMobile_iOS|DIYMobile_iOS/i)?function(e){var e=e.get(0),t=e.contentEditable,o=e.readOnly,n=document.createRange(),i=window.getSelection();e.contentEditable=!0,e.readOnly=!1,n.selectNodeContents(e),i.removeAllRanges(),i.addRange(n),e.setSelectionRange(0,999999),e.contentEditable=t,e.readOnly=o}(o):navigator.userAgent.match(/ipad|ipod|iphone/i)?(o.select(),o[0].setSelectionRange(0,999999)):o.select();document.execCommand("copy"),o.remove()}},{}],3:[function(e,t,o){"use strict";Object.defineProperty(o,"__esModule",{value:!0}),o.countLetters=function(e){e=e.match(/[a-zA-Z]/g);return e?e.length:0},o.createImageElements=function(e,t){return e.map(function(e){return $("<img>").attr("src",e).attr("alt",t)})},o.highlightCharacter=function(e,t,o){return e.includes(t)?(t=new RegExp("\\".concat(t,"+"),"g"),o='<span class="'.concat(o,'">$&</span>'),e.replace(t,o)):e},o.isApp=function(){return navigator.userAgent.match(/TradeProMobile_iOS|TradeProMobile_Android|DIYMobile_iOS|DIYMobile_Android|DIYApp_Guest_Mobile_iOS|DIYApp_Guest_Mobile_Android|AGENT_PLACEHOLDER/i)},o.isHasSymbol=function(e,t){return e.includes(t)},o.isKeyboardOpen=function(){var e=window.innerHeight,t=window.visualViewport.height;return e!==t},o.isTouchDevice=function(){return"ontouchstart"in window},o.scrollToElement=function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:20,e=$(e);0<e.length&&$("html, body").animate({scrollTop:e.offset().top-t},300)},o.scrollToTop=function(e){e.scrollTop(0)},o.trimFields=function(){Wick.AddressBook.getFieldsConfigurations().forEach(function(e){var t=e.input.val().trim();e.input.val(t)})}},{}]},{},[1]);
1
+ !function n(i,r,c){function l(t,e){if(!r[t]){if(!i[t]){var o="function"==typeof require&&require;if(!e&&o)return o(t,!0);if(a)return a(t,!0);throw(e=new Error("Cannot find module '"+t+"'")).code="MODULE_NOT_FOUND",e}o=r[t]={exports:{}},i[t][0].call(o.exports,function(e){return l(i[t][1][e]||e)},o,o.exports,n,i,r,c)}return r[t].exports}for(var a="function"==typeof require&&require,e=0;e<c.length;e++)l(c[e]);return l}({1:[function(e,t,o){"use strict";var n=e("./utils/copy-to-clipboard"),i=e("./utils/helpers"),r=window.Wick||{};r.MyAccount={el:{$clipboardCode:$(".clipboard-code"),appInfo:".app-info",hideAppInfo:"app-info--hide"},clipboardCodes:{tradeProId:{titleEl:".clipboard-code.trade-pro-id .title",subtitleEl:".clipboard-code.trade-pro-id .subtitle",btnCopy:".btn--trade-pro-id"},discountCode:{titleEl:".clipboard-code.discount-code .title",subtitleEl:".clipboard-code.discount-code .subtitle",btnCopy:".btn--discount-code"}},copyCode:function(e){var e=r.MyAccount.clipboardCodes[e],t=e.titleEl,o=e.subtitleEl,e=e.btnCopy,o=$(o).text().trim(),t=$(t).text().trim();(0,n.copyToClipboard)(o,e),r.SnackBar.show({text:"".concat(t," copied to clipboard"),type:r.SnackBar.types.SUCCESS,withCloseButton:!1,autoClose:!0,delayBeforeClose:1500})},init:function(){Object.keys(r.MyAccount.clipboardCodes).forEach(function(e){var t=r.MyAccount.clipboardCodes[e].btnCopy;$(t).on("click",function(){return r.MyAccount.copyCode(e)})}),$(r.MyAccount.el.appInfo).length&&(0,i.isApp)()&&$(r.MyAccount.el.appInfo).addClass(r.MyAccount.el.hideAppInfo)}},$(document).ready(function(){r.MyAccount.el.$clipboardCode.length&&r.MyAccount.init()})},{"./utils/copy-to-clipboard":2,"./utils/helpers":3}],2:[function(e,t,o){"use strict";Object.defineProperty(o,"__esModule",{value:!0}),o.copyToClipboard=function(e,t){var o=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},n=$("<textarea>").css({position:"absolute",top:0,left:0,opacity:0});$(t).parent().append(n),t=o.noUpperCase?e:e.replace(/(^\w|\s\w)/g,function(e){return e.toUpperCase()});o=t.split(" ").filter(function(e){return""!==e}).join(" ");n.val(o),navigator.userAgent.match(/TradeProMobile_iOS|DIYMobile_iOS/i)?function(e){var e=e.get(0),t=e.contentEditable,o=e.readOnly,n=document.createRange(),i=window.getSelection();e.contentEditable=!0,e.readOnly=!1,n.selectNodeContents(e),i.removeAllRanges(),i.addRange(n),e.setSelectionRange(0,999999),e.contentEditable=t,e.readOnly=o}(n):navigator.userAgent.match(/ipad|ipod|iphone/i)?(n.select(),n[0].setSelectionRange(0,999999)):n.select();document.execCommand("copy"),n.remove()}},{}],3:[function(e,t,o){"use strict";Object.defineProperty(o,"__esModule",{value:!0}),o.countLetters=function(e){e=e.match(/[a-zA-Z]/g);return e?e.length:0},o.createImageElements=function(e,t){return e.map(function(e){return $("<img>").attr("src",e).attr("alt",t)})},o.highlightCharacter=function(e,t,o){return e.includes(t)?(t=new RegExp("\\".concat(t,"+"),"g"),o='<span class="'.concat(o,'">$&</span>'),e.replace(t,o)):e},o.isApp=function(){return navigator.userAgent.match(/TradeProMobile_iOS|TradeProMobile_Android|DIYMobile_iOS|DIYMobile_Android|DIYApp_Guest_Mobile_iOS|DIYApp_Guest_Mobile_Android|AGENT_PLACEHOLDER/i)},o.isHasSymbol=function(e,t){return e.includes(t)},o.isKeyboardOpen=function(){var e=window.innerHeight,t=window.visualViewport.height;return e!==t},o.isTouchDevice=function(){return"ontouchstart"in window},o.scrollToElement=function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:20,e=$(e);0<e.length&&$("html, body").animate({scrollTop:e.offset().top-t},300)},o.scrollToTop=function(e){e.scrollTop(0)},o.trimFields=function(){Wick.AddressBook.getFieldsConfigurations().forEach(function(e){var t=e.input.val().trim();e.input.val(t)})}},{}]},{},[1]);
@@ -17,7 +17,7 @@ Wick.TradeProRewards = {
17
17
  var discountCodeValue = discountCode.val().trim();
18
18
  discountCode.removeAttr('disabled').attr('readonly', 'readonly');
19
19
 
20
- copyToClipboard(discountCodeValue, e.currentTarget);
20
+ copyToClipboard(discountCodeValue, e.currentTarget, { noUpperCase: true });
21
21
 
22
22
  discountCode.attr('disabled', 'disabled').removeAttr('readonly');
23
23
  window.getSelection().removeAllRanges();
@@ -1,4 +1,4 @@
1
- export function copyToClipboard(copyValue, currentSelector) {
1
+ export function copyToClipboard(copyValue, currentSelector, options = {}) {
2
2
  const $temp = $('<textarea>').css({
3
3
  position: 'absolute',
4
4
  top: 0,
@@ -8,9 +8,15 @@ export function copyToClipboard(copyValue, currentSelector) {
8
8
 
9
9
  $(currentSelector).parent().append($temp);
10
10
 
11
- const str = copyValue.replace(/(^\w|\s\w)/g, function (m) {
12
- return m.toUpperCase()
13
- });
11
+ let str;
12
+ if (options.noUpperCase) {
13
+ str = copyValue;
14
+ } else {
15
+ str = copyValue.replace(/(^\w|\s\w)/g, function (m) {
16
+ return m.toUpperCase()
17
+ });
18
+ }
19
+
14
20
  const textFiltered = str.split(' ').filter(function (value) {
15
21
  return value !== ''
16
22
  });