@ikas/popup-renderer 1.0.206 → 1.0.208
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/build/popup-renderer/components/button-element-renderer/index.js +1 -1
- package/build/popup-renderer/components/form-element-renderer/checkbox-item-view/index.js +1 -1
- package/build/popup-renderer/components/form-element-renderer/input-item-view/index.js +1 -1
- package/build/popup-renderer/components/text-element-renderer/index.js +1 -1
- package/build/popup-renderer/helpers/index.d.ts +2 -0
- package/build/popup-renderer/helpers/index.js +1 -1
- package/build/popup-renderer/models/modal/step/elements/form/form-settings/index.d.ts +1 -0
- package/build/popup-renderer/models/modal/step/elements/form/form-settings/index.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e}from'./../../../ext/tslib/tslib.es6.mjs.js';import t from"react";import{observer as n}from"mobx-react";import{ButtonActionTypeEnum as o}from"../../models/modal/step/elements/button/index.js";import{getHorizontalAlignment as r,injectFontScript as i}from"../../helpers/index.js";var
|
|
1
|
+
import{__assign as e}from'./../../../ext/tslib/tslib.es6.mjs.js';import t from"react";import{observer as n}from"mobx-react";import{ButtonActionTypeEnum as o}from"../../models/modal/step/elements/button/index.js";import{getHorizontalAlignment as r,injectFontScript as i,predefinedHtmlTagStyles as l}from"../../helpers/index.js";var c=n((function(n){var c=n.element,a=n.isStandaloneButtonComponent,d=n.onClose,s=n.disableButtonAction,u=t.useRef(null),m=c,f={display:"flex",alignItems:"center",justifyContent:r(m.horizontalAlignment),padding:"".concat(m.outerVerticalPadding,"px ").concat(m.outerHorizontalPadding,"px"),backgroundColor:m.bgColor},p=e({color:m.color,backgroundColor:m.buttonBgColor,fontSize:m.fontSize,fontWeight:m.fontWeight,fontFamily:i(m.fontFamily),textAlign:"center",border:"".concat(m.borderWidth,"px ").concat(m.borderStyle," ").concat(m.borderColor),borderRadius:m.borderRadius,padding:"".concat(m.verticalPadding,"px ").concat(m.horizontalPadding,"px")},l),b={width:"".concat(m.width,"%"),minWidth:"fit-content",cursor:"pointer"},g=t.useCallback((function(){if(u.current&&!s){var e=m.link||void 0;if(!a&&e)u.current.href=e||"",u.current.click();else switch(m.actionType){case o.NAVIGATE_TO_LINK_AND_CLOSE:u.current.href=e||"",null==d||d(!0),u.current.click();break;case o.NAVIGATE_TO_LINK:u.current.href=e||"",u.current.click();break;case o.CLOSE:null==d||d(!0)}}}),[u,u.current]);return t.createElement("div",{style:f},t.createElement("a",{onClick:g,style:b,target:m.openLinkInNewWindow?"_blank":"_self",ref:u},t.createElement("div",{dangerouslySetInnerHTML:{__html:m.text},style:e({},p)})))}));export{c as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"react";import{observer as
|
|
1
|
+
import{__assign as e}from'./../../../../ext/tslib/tslib.es6.mjs.js';import t from"react";import{observer as o}from"mobx-react";import{generateRandomId as n,predefinedHtmlTagStyles as r}from"../../../helpers/index.js";var i=o((function(o){var i=o.checkboxItem,c=o.formInputSettings,a=t.useMemo((function(){return"checkbox-".concat(n())}),[i]);t.useEffect((function(){i.showInCheckedStatus?i.isChecked=!0:i.isChecked=!1}),[i.showInCheckedStatus]);var s=i.requiredToBeChecked,l={width:"16px",height:"16px",cursor:"pointer",position:"relative",top:3,appearance:"none",border:"1px solid ".concat(c.borderColor),borderRadius:"4px",flex:"0 0 16px"},d=t.useCallback((function(){var e=/<pre[^>]*>([\s\S]*?)<\/pre>/.exec(i.text);return e?e[1]:i.text}),[i.text]);return t.createElement("div",{style:{width:"100%",display:"flex",gap:6,flexDirection:"column"}},t.createElement("div",{style:{width:"100%",display:"flex",gap:8,flexDirection:"row",alignItems:"baseline",wordBreak:"break-word"}},t.createElement("input",{style:l,type:"checkbox",checked:i.isChecked,onChange:function(){i.isChecked=!i.isChecked,s&&s.hasError&&i.isChecked&&(s.hasError=!1)},id:a}),t.createElement("div",{style:e({color:c.checkboxTextColor},r),dangerouslySetInnerHTML:{__html:d()}})),!!s&&s.hasError&&t.createElement("div",{style:{color:"red",fontSize:"12px"}},s.validationErrorMessage),t.createElement("style",null,"\n #".concat(a," {\n position: relative; /* so pseudo-element is positioned correctly */\n display: inline-block; /* ensures ::after layering works as expected */\n }\n\n #").concat(a,":checked {\n background-color: ").concat(c.borderColor," !important;\n }\n\n /* Draw a checkmark using ::after */\n #").concat(a,'::after {\n content: "";\n position: absolute;\n top: 2px; /* tweak to position your checkmark within the box */\n left: 5px; /* tweak as needed */\n width: 4px;\n height: 8px;\n border: solid #fff;\n border-width: 0 2px 2px 0;\n transform: rotate(45deg);\n opacity: 0;\n transition: opacity 0.2s ease-in-out;\n }\n\n #').concat(a,":checked::after {\n opacity: 1;\n }\n ")))}));export{i as CheckboxItemView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"react";import{observer as t}from"mobx-react";import{generateRandomId as o}from"../../../helpers/index.js";import{PhoneNumberInput as r}from"../phone-input-item-view/index.js";var n=t((function(t){var n=e.useState(!1),l=n[0],a=n[1];e.useRef(null);var i=e.useMemo((function(){return o()}),[]),c=t.placeholder,s=t.isRequired,u=t.inputLabel;t.updateCurrentInfo;var p=t.validationErrorMessage,d=t.formInputSettings,m=t.value,f=t.onValueChange,x=t.isPhoneInput,h=t.sfProps,v={width:"100%",backgroundColor:d.bgColor?"".concat(d.bgColor):"transparent",border:"".concat(d.borderWidth,"px solid ").concat(l?d.focusBorderColor:d.borderColor),borderRadius:"".concat(d.borderRadius,"px"),fontSize:"14px",padding:"10px 12px",height:"".concat(d.height,"px"),outline:"none"},g=function(e){f(e),s&&s.hasError&&e.length>0&&(s.hasError=!1)},E=s?((null==c?void 0:c.text)||"")+" *":(null==c?void 0:c.text)||"";return e.createElement("div",{style:{width:"100%",display:"flex",gap:2,flexDirection:"column"}},(u||s)&&e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:4,marginBottom:"6px"}},e.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"}},u&&e.createElement("label",{style:{color:d.titleColor,fontSize:"14px"}},u.text)),s&&s.hasError&&e.createElement("div",{style:{color:"red",fontSize:"12px"}},s.validationErrorMessage),!!p&&e.createElement("div",{style:{color:"red",fontSize:"12px"}},p)),x?e.createElement(r,{onChange:function(e){return g(e)},placeholder:E,value:m||"",inputStyle:v,sfProps:h,className:"ikas-form-input-item-view-".concat(i),setIsFocused:a}):e.createElement("input",{type:"text",placeholder:E,value:m||"",onChange:function(e){return g(e.target.value)},style:v,onFocus:function(){return a(!0)},onBlur:function(){return a(!1)},className:"ikas-form-input-item-view-".concat(i)}),e.createElement("style",null,"\n .ikas-form-input-item-view-".concat(i,"::placeholder {\n color: ").concat(d.placeholderColor," !important;\n }\n ")))}));export{n as default};
|
|
1
|
+
import e from"react";import{observer as t}from"mobx-react";import{generateRandomId as o}from"../../../helpers/index.js";import{PhoneNumberInput as r}from"../phone-input-item-view/index.js";var n=t((function(t){var n=e.useState(!1),l=n[0],a=n[1];e.useRef(null);var i=e.useMemo((function(){return o()}),[]),c=t.placeholder,s=t.isRequired,u=t.inputLabel;t.updateCurrentInfo;var p=t.validationErrorMessage,d=t.formInputSettings,m=t.value,f=t.onValueChange,x=t.isPhoneInput,h=t.sfProps,v={width:"100%",backgroundColor:d.bgColor?"".concat(d.bgColor):"transparent",border:"".concat(d.borderWidth,"px solid ").concat(l?d.focusBorderColor:d.borderColor),color:"".concat(d.textColor),borderRadius:"".concat(d.borderRadius,"px"),fontSize:"14px",padding:"10px 12px",height:"".concat(d.height,"px"),outline:"none"},g=function(e){f(e),s&&s.hasError&&e.length>0&&(s.hasError=!1)},E=s?((null==c?void 0:c.text)||"")+" *":(null==c?void 0:c.text)||"";return e.createElement("div",{style:{width:"100%",display:"flex",gap:2,flexDirection:"column"}},(u||s)&&e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:4,marginBottom:"6px"}},e.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"}},u&&e.createElement("label",{style:{color:d.titleColor,fontSize:"14px"}},u.text)),s&&s.hasError&&e.createElement("div",{style:{color:"red",fontSize:"12px"}},s.validationErrorMessage),!!p&&e.createElement("div",{style:{color:"red",fontSize:"12px"}},p)),x?e.createElement(r,{onChange:function(e){return g(e)},placeholder:E,value:m||"",inputStyle:v,sfProps:h,className:"ikas-form-input-item-view-".concat(i),setIsFocused:a}):e.createElement("input",{type:"text",placeholder:E,value:m||"",onChange:function(e){return g(e.target.value)},style:v,onFocus:function(){return a(!0)},onBlur:function(){return a(!1)},className:"ikas-form-input-item-view-".concat(i)}),e.createElement("style",null,"\n // change written input text color\n .ikas-form-input-item-view-".concat(i," {\n color: ").concat(d.textColor," !important;\n }\n\n .ikas-form-input-item-view-").concat(i,"::placeholder {\n color: ").concat(d.placeholderColor," !important;\n }\n ")))}));export{n as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as o}from'./../../../ext/tslib/tslib.es6.mjs.js';import t from"react";import{observer as e}from"mobx-react";import{injectFontScript as r}from"../../helpers/index.js";var
|
|
1
|
+
import{__assign as o}from'./../../../ext/tslib/tslib.es6.mjs.js';import t from"react";import{observer as e}from"mobx-react";import{injectFontScript as r,predefinedHtmlTagStyles as n}from"../../helpers/index.js";var a=e((function(e){var a=e.element,i=a,d={border:"".concat(i.borderWidth,"px ").concat(i.borderStyle," ").concat(i.borderColor),borderRadius:i.borderRadius,padding:"".concat(i.outerVerticalPadding,"px ").concat(i.outerHorizontalPadding,"px")},l=o({color:i.color,fontSize:i.fontSize,fontWeight:i.fontWeight,fontFamily:r(i.fontFamily),textAlign:i.horizontalAlignment,padding:"".concat(i.verticalPadding,"px ").concat(i.horizontalPadding,"px"),backgroundColor:i.bgColor},n);return t.createElement("div",{style:d},t.createElement("div",{dangerouslySetInnerHTML:{__html:a.text},style:o({},l)}))}));export{a as default};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { Popup } from "../models";
|
|
2
3
|
import { ComponentHorizontalAlignmentEnum, IkasPopupRendererFontFamily } from "../models/modal/step/elements/base";
|
|
3
4
|
import { PopupVariantPair } from "../models/modal/step/elements/product";
|
|
@@ -10,3 +11,4 @@ export declare const injectFontScript: (fontFamily: IkasPopupRendererFontFamily)
|
|
|
10
11
|
export declare const validateEmail: (str: string) => boolean;
|
|
11
12
|
export declare const validatePhoneNumber: (phone: string, countryCode?: string) => boolean;
|
|
12
13
|
export declare const generateRandomId: (text?: string) => string;
|
|
14
|
+
export declare const predefinedHtmlTagStyles: import("react").CSSProperties;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__spreadArray as e}from'./../../ext/tslib/tslib.es6.mjs.js';import'./../../ext/libphonenumber-js/es6/PhoneNumberMatcher.js';import'./../../ext/libphonenumber-js/es6/AsYouTypeFormatter.js';import{isValidPhoneNumber as t}from'./../../ext/libphonenumber-js/min/exports/isValidPhoneNumber.js';import'./../../ext/libphonenumber-js/min/exports/PhoneNumberMatcher.js';import'./../../ext/libphonenumber-js/min/exports/AsYouType.js';import'./../../ext/libphonenumber-js/min/exports/Metadata.js';import'./../../ext/libphonenumber-js/es6/findNumbers/isValidCandidate.js';import'./../../ext/libphonenumber-js/index.es6.exports/PhoneNumberSearch.js';import{PopupElementTypeEnum as n,ComponentHorizontalAlignmentEnum as
|
|
1
|
+
import{__spreadArray as e}from'./../../ext/tslib/tslib.es6.mjs.js';import'./../../ext/libphonenumber-js/es6/PhoneNumberMatcher.js';import'./../../ext/libphonenumber-js/es6/AsYouTypeFormatter.js';import{isValidPhoneNumber as t}from'./../../ext/libphonenumber-js/min/exports/isValidPhoneNumber.js';import'./../../ext/libphonenumber-js/min/exports/PhoneNumberMatcher.js';import'./../../ext/libphonenumber-js/min/exports/AsYouType.js';import'./../../ext/libphonenumber-js/min/exports/Metadata.js';import'./../../ext/libphonenumber-js/es6/findNumbers/isValidCandidate.js';import'./../../ext/libphonenumber-js/index.es6.exports/PhoneNumberSearch.js';import{PopupElementTypeEnum as n,ComponentHorizontalAlignmentEnum as i}from"../models/modal/step/elements/base/index.js";var r=function(t){var i=[];return t.modal.steps.forEach((function(t){t.elements.forEach((function(t){if(t.type===n.PRODUCT_LIST){var r=t.variantPairs;r&&(i=e(e([],i,!0),r,!0))}}))})),{variantPairs:i}},o=function(e){var t="";switch(e){case i.LEFT:t="flex-start";break;case i.CENTER:t="center";break;case i.RIGHT:t="flex-end"}return t},a=function(e){if(e.name){var t=e.name.replace(/ /g,"+"),n="";if(e.variants){n+=":";var i=e.variants.some((function(e){return"italic"===e}));if(i&&(n+="ital,"),n+="wght@",i){var r=new RegExp("italic","i");n+=e.variants.reduce((function(e,t){return r.test(t)?e:e+"0,".concat(t.replace("regular","400"),";")}),""),n+=e.variants.reduce((function(e,t){return r.test(t)?e+"1,".concat("italic"===t?"400":t.replace("italic",""),";"):e}),"")}else n+=e.variants.reduce((function(e,t){return e+"".concat(t.replace("regular","400"),";")}),"");n=n.substring(0,n.length-1),n+="&display=swap"}return"https://fonts.googleapis.com/css2?family=".concat(t).concat(n)}},s=function(e){var t="'".concat(e.name,'\', -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif');if(document.getElementById("ikas-popup-font-".concat(e.name)))return t;var n=a(e);if(n){var i=document.createElement("link");return i.setAttribute("id","ikas-popup-font-".concat(e.name)),i.setAttribute("rel","stylesheet"),i.setAttribute("href",n),document.getElementsByTagName("head")[0].appendChild(i),t}},u=function(e){return!(e.length>320)&&/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(e)},m=function(e,n){return t(e,n?n.toUpperCase():"TR")},h=function(e){var t;return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)+(null!==(t=null==e?void 0:e.length)&&void 0!==t?t:0)},l={h1:{fontSize:"inherit",fontWeight:"inherit"},h2:{fontSize:"inherit",fontWeight:"inherit"},h3:{fontSize:"inherit",fontWeight:"inherit"},h4:{fontSize:"inherit",fontWeight:"inherit"},h5:{fontSize:"inherit",fontWeight:"inherit"},h6:{fontSize:"inherit",fontWeight:"inherit"},p:{fontSize:"inherit",fontWeight:"inherit"},blockquote:{fontSize:"inherit",fontWeight:"inherit"},code:{fontSize:"inherit",fontWeight:"inherit"},pre:{fontSize:"inherit",fontWeight:"inherit"}};export{h as generateRandomId,a as getGoogleFontHref,o as getHorizontalAlignment,r as getPopupDynamicData,s as injectFontScript,l as predefinedHtmlTagStyles,u as validateEmail,m as validatePhoneNumber};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{makeObservable as o,observable as r}from"mobx";import{IkasPopupRendererFontFamily as
|
|
1
|
+
import{makeObservable as o,observable as r}from"mobx";import{IkasPopupRendererFontFamily as t}from"../../base/index.js";var e=function(e){var l,h;void 0===e&&(e={}),this.formInputSettings=e.formInputSettings?new i(e.formInputSettings):new i({borderColor:"#E3E8EF",focusBorderColor:"#000000"}),this.gapBetweenItems=null!==(l=e.gapBetweenItems)&&void 0!==l?l:12,this.fontFamily=new t(e.fontFamily),this.fontSize=null!==(h=e.fontSize)&&void 0!==h?h:14,o(this,{formInputSettings:r,gapBetweenItems:r,fontFamily:r,fontSize:r})},i=function(t){var e,i,l;void 0===t&&(t={}),this.bgColor=t.bgColor||"",this.borderWidth=null!==(e=t.borderWidth)&&void 0!==e?e:1,this.borderRadius=null!==(i=t.borderRadius)&&void 0!==i?i:4,this.borderColor=t.borderColor||"",this.focusBorderColor=t.focusBorderColor||"",this.height=null!==(l=t.height)&&void 0!==l?l:40,this.textColor=t.textColor||"#121926",this.placeholderColor=t.placeholderColor?t.placeholderColor:"#697586",this.titleColor=t.titleColor?t.titleColor:"#121926",this.checkboxTextColor=t.checkboxTextColor?t.checkboxTextColor:"#121926",o(this,{bgColor:r,borderWidth:r,borderRadius:r,borderColor:r,focusBorderColor:r,height:r,placeholderColor:r,titleColor:r,checkboxTextColor:r,textColor:r})};export{i as FormInputSettings,e as FormSettings};
|