@ikas/popup-renderer 1.0.207 → 1.0.209
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/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/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{__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
|
|
1
|
+
import{__spreadArray as t}from'./../../ext/tslib/tslib.es6.mjs.js';import'./../../ext/libphonenumber-js/es6/PhoneNumberMatcher.js';import'./../../ext/libphonenumber-js/es6/AsYouTypeFormatter.js';import{isValidPhoneNumber as e}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(e){var i=[];return e.modal.steps.forEach((function(e){e.elements.forEach((function(e){if(e.type===n.PRODUCT_LIST){var r=e.variantPairs;r&&(i=t(t([],i,!0),r,!0))}}))})),{variantPairs:i}},o=function(t){var e="";switch(t){case i.LEFT:e="flex-start";break;case i.CENTER:e="center";break;case i.RIGHT:e="flex-end"}return e},a=function(t){if(t.name){var e=t.name.replace(/ /g,"+"),n="";if(t.variants){n+=":";var i=t.variants.some((function(t){return"italic"===t}));if(i&&(n+="ital,"),n+="wght@",i){var r=new RegExp("italic","i");n+=t.variants.reduce((function(t,e){return r.test(e)?t:t+"0,".concat(e.replace("regular","400"),";")}),""),n+=t.variants.reduce((function(t,e){return r.test(e)?t+"1,".concat("italic"===e?"400":e.replace("italic",""),";"):t}),"")}else n+=t.variants.reduce((function(t,e){return t+"".concat(e.replace("regular","400"),";")}),"");n=n.substring(0,n.length-1),n+="&display=swap"}return"https://fonts.googleapis.com/css2?family=".concat(e).concat(n)}},s=function(t){var e="'".concat(t.name,'\', -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif');if(document.getElementById("ikas-popup-font-".concat(t.name)))return e;var n=a(t);if(n){var i=document.createElement("link");return i.setAttribute("id","ikas-popup-font-".concat(t.name)),i.setAttribute("rel","stylesheet"),i.setAttribute("href",n),document.getElementsByTagName("head")[0].appendChild(i),e}},m=function(t){return!(t.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(t)},p=function(t,n){return e(t,n?n.toUpperCase():"TR")},u=function(t){var e;return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)+(null!==(e=null==t?void 0:t.length)&&void 0!==e?e:0)},h={h1:{fontSize:"inherit !important",fontWeight:"inherit !important"},h2:{fontSize:"inherit !important",fontWeight:"inherit !important"},h3:{fontSize:"inherit !important",fontWeight:"inherit !important"},h4:{fontSize:"inherit !important",fontWeight:"inherit !important"},h5:{fontSize:"inherit !important",fontWeight:"inherit !important"},h6:{fontSize:"inherit !important",fontWeight:"inherit !important"},p:{fontSize:"inherit !important",fontWeight:"inherit !important"},blockquote:{fontSize:"inherit !important",fontWeight:"inherit !important"},code:{fontSize:"inherit !important",fontWeight:"inherit !important"},pre:{fontSize:"inherit !important",fontWeight:"inherit !important"}};export{u as generateRandomId,a as getGoogleFontHref,o as getHorizontalAlignment,r as getPopupDynamicData,s as injectFontScript,h as predefinedHtmlTagStyles,m as validateEmail,p as validatePhoneNumber};
|