@ikas/storefront 2.0.27 → 2.0.28
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
|
-
import{__awaiter as t,__generator as e,__assign as i}from'../../../ext/tslib/tslib.es6.js';import{makeAutoObservable as n}from"mobx";import{IkasImage as l}from"../image/index.js";import{IkasStorefrontConfig as s}from"../../../storefront/index.js";import a from'../../../ext/lodash/sortBy.js';var o,u;!function(t){t.CHOICE="CHOICE",t.TEXT="TEXT",t.TEXT_AREA="TEXT_AREA",t.FILE="FILE",t.COLOR_PICKER="COLOR_PICKER",t.DATE_PICKER="DATE_PICKER",t.CHECKBOX="CHECKBOX"}(o||(o={})),function(t){t.SELECT="SELECT",t.BOX="BOX",t.SWATCH="SWATCH"}(u||(u={}));var r=function(t){this.id=t.id||"",this.value=t.value||null,n(this)},h=function(t){var e;this.id=t.id||"",this.name=t.name||null,this.optionalText=t.optionalText||null,this.values=(null===(e=t.values)||void 0===e?void 0:e.map((function(t){return new r(t)})))||[],n(this)},d=function(t){var e;this.locale=t.locale||"",this.options=(null===(e=t.options)||void 0===e?void 0:e.map((function(t){return new h(t)})))||[],n(this)},c=function(t){void 0===t&&(t={}),this.otherPrices=null,this.thumbnailImage=null,this.id=t.id||"",this.order=t.order||0,this.value=t.value||"",this.price=t.price||null,this.otherPrices=t.otherPrices||null,this.thumbnailImageId=t.thumbnailImageId||null,this.colorCode=t.colorCode||null,this.thumbnailImage=this.thumbnailImageId?new l(this.thumbnailImageId):null,n(this)},p=function(t){var e;void 0===t&&(t={}),this.type=t.type||u.BOX,this.minSelect=null!==t.minSelect&&void 0!==t.minSelect?t.minSelect:null,this.maxSelect=null!==t.maxSelect&&void 0!==t.maxSelect?t.maxSelect:null,this.values=a((null===(e=t.values)||void 0===e?void 0:e.map((function(t){return new c(t)})))||[],"order"),n(this)},
|
|
1
|
+
import{__awaiter as t,__generator as e,__assign as i}from'../../../ext/tslib/tslib.es6.js';import{makeAutoObservable as n}from"mobx";import{IkasImage as l}from"../image/index.js";import{IkasStorefrontConfig as s}from"../../../storefront/index.js";import a from'../../../ext/lodash/sortBy.js';var o,u;!function(t){t.CHOICE="CHOICE",t.TEXT="TEXT",t.TEXT_AREA="TEXT_AREA",t.FILE="FILE",t.COLOR_PICKER="COLOR_PICKER",t.DATE_PICKER="DATE_PICKER",t.CHECKBOX="CHECKBOX"}(o||(o={})),function(t){t.SELECT="SELECT",t.BOX="BOX",t.SWATCH="SWATCH"}(u||(u={}));var r=function(t){this.id=t.id||"",this.value=t.value||null,n(this)},h=function(t){var e;this.id=t.id||"",this.name=t.name||null,this.optionalText=t.optionalText||null,this.values=(null===(e=t.values)||void 0===e?void 0:e.map((function(t){return new r(t)})))||[],n(this)},d=function(t){var e;this.locale=t.locale||"",this.options=(null===(e=t.options)||void 0===e?void 0:e.map((function(t){return new h(t)})))||[],n(this)},c=function(t){void 0===t&&(t={}),this.otherPrices=null,this.thumbnailImage=null,this.id=t.id||"",this.order=t.order||0,this.value=t.value||"",this.price=t.price||null,this.otherPrices=t.otherPrices||null,this.thumbnailImageId=t.thumbnailImageId||null,this.colorCode=t.colorCode||null,this.thumbnailImage=this.thumbnailImageId?new l(this.thumbnailImageId):null,n(this)},p=function(t){var e;void 0===t&&(t={}),this.type=t.type||u.BOX,this.minSelect=null!==t.minSelect&&void 0!==t.minSelect?t.minSelect:null,this.maxSelect=null!==t.maxSelect&&void 0!==t.maxSelect?t.maxSelect:null,this.values=a((null===(e=t.values)||void 0===e?void 0:e.map((function(t){return new c(t)})))||[],"order"),n(this)},m=function(t){this.min=t.min||null,this.max=t.max||null,this.minRelativeNextDate=void 0!==t.minRelativeNextDate?t.minRelativeNextDate:null,this.maxRelativeNextDate=void 0!==t.maxRelativeNextDate?t.maxRelativeNextDate:null,n(this)},f=function(t){void 0===t&&(t={}),this.min=null!==t.min&&void 0!==t.min?t.min:null,this.max=null!==t.max&&void 0!==t.max?t.max:null,n(this)},v=function(t){this.allowedExtensions=t.allowedExtensions||null,this.minQuantity=null!==t.minQuantity&&void 0!==t.minQuantity?t.minQuantity:null,this.maxQuantity=null!==t.maxQuantity&&void 0!==t.maxQuantity?t.maxQuantity:null,n(this)},g=function(){function i(i){var l=this;this._values=[],this.childOptions=[],this.productOptionFileUpload=function(i){return t(l,void 0,void 0,(function(){var n,l,a=this;return e(this,(function(o){switch(o.label){case 0:return 0===i.length||this.fileSettings&&this.fileSettings.maxQuantity&&this.fileSettings.maxQuantity<i.length?[2,[]]:(n="".concat(process.env.NEXT_PUBLIC_BASE_URL,"/admin/upload-product-option-file"),l=function(i){return t(a,void 0,void 0,(function(){var t,l,a,o,u,r,h;return e(this,(function(e){switch(e.label){case 0:return l=fetch,a=[n],r={method:"POST",headers:{"x-api-key":s.config.apiKey||"","x-sfid":s.storefrontId||"","x-sfrid":s.storefrontRoutingId||"","Content-Type":"application/json",Accept:"application/json"}},u=(o=JSON).stringify,h={productOptionSetId:this.productOptionSetId,productOptionId:this.id},[4,this.getBase64(i)];case 1:return[4,l.apply(void 0,a.concat([(r.body=u.apply(o,[(h.base64=e.sent(),h.fileName=i.name,h)]),r)]))];case 2:return(t=e.sent()).ok?[4,t.text()]:[2,null];case 3:return[2,e.sent()]}}))}))},[4,Promise.all(i.map((function(t){return l(t)})))]);case 1:return[2,o.sent().filter((function(t){return null!==t}))]}}))}))},this.initValues=function(){l.isOptional||(l.values=[],l.childOptions&&l.childOptions.forEach((function(t){return t.initValues()})))},this.isValidTextOptionValue=function(){var t=l.values[0];return t?!!l.textSettings&&(null===l.textSettings.min||t.length>=l.textSettings.min)&&(null===l.textSettings.max||t.length<=l.textSettings.max):!!l.isOptional},this.isValidChoiceOptionValue=function(){return l.values.length?!!l.selectSettings&&(null===l.selectSettings.minSelect||l.values.length>=l.selectSettings.minSelect)&&(null===l.selectSettings.maxSelect||l.values.length<=l.selectSettings.maxSelect):!!l.isOptional},this.isValidFileOptionValue=function(){return l.values.length?!!l.fileSettings&&(null===l.fileSettings.minQuantity||l.values.length>=l.fileSettings.minQuantity)&&(null===l.fileSettings.maxQuantity||l.values.length<=l.fileSettings.maxQuantity):!!l.isOptional},this.isValidDateOptionValue=function(){if(!l.values.length)return!!l.isOptional;if(l.dateSettings){var t=null,e=null;null!==l.dateSettings.minRelativeNextDate&&(t=new Date,t=l.dateSettings.minRelativeNextDate<0?new Date(t.setDate(t.getDate()-Math.abs(l.dateSettings.minRelativeNextDate))):new Date(t.setDate(t.getDate()+Math.abs(l.dateSettings.minRelativeNextDate))),t=new Date(t.setHours(23,59,0))),null!==l.dateSettings.maxRelativeNextDate&&(e=new Date,e=l.dateSettings.maxRelativeNextDate<0?new Date(e.setDate(e.getDate()-Math.abs(l.dateSettings.maxRelativeNextDate))):new Date(e.setDate(e.getDate()+Math.abs(l.dateSettings.maxRelativeNextDate))),e=new Date(e.setHours(23,59,59)));var i=new Date(new Date(l.values[0]).setHours(23,59,59));return(!t||i.getTime()>=t.getTime())&&(!e||i.getTime()<=e.getTime())}return!0},this.id=i.id||"",this.productOptionSetId=i.productOptionSetId||"",this.name=i.name||"",this.order=i.order||0,this.type=i.type||o.CHOICE,this.selectSettings=i.selectSettings?new p(i.selectSettings||{}):null,this.textSettings=i.textSettings?new f(i.textSettings||{}):null,this.fileSettings=i.fileSettings?new v(i.fileSettings||{}):null,this.dateSettings=i.dateSettings?new m(i.dateSettings||{}):null,this.price=i.price||null,this.otherPrices=i.otherPrices||null,this.isOptional=i.isOptional||!1,this.optionalText=i.optionalText||null,this.requiredOptionId=i.requiredOptionId||null,this.requiredOptionValueIds=i.requiredOptionValueIds||null,this.values=i.values||[],this.childOptions=i.childOptions||[],n(this)}return Object.defineProperty(i.prototype,"displayedChildOptions",{get:function(){var t=this;return a(this.childOptions.filter((function(e){var i;return(null===(i=e.requiredOptionValueIds)||void 0===i?void 0:i.length)?e.requiredOptionValueIds.every((function(e){return t.values.some((function(t){return t===e}))})):t.type===o.CHECKBOX?!!t.values.length&&"true"===t.values[0]:!!t.values.length})),"order")},enumerable:!1,configurable:!0}),i.prototype.getBase64=function(t){return new Promise((function(e){var i=new FileReader;i.addEventListener("load",(function(){return e(i.result)})),i.readAsDataURL(t)}))},Object.defineProperty(i.prototype,"hasValidValues",{get:function(){if(!this.values.length&&!this.isOptional)return!1;var t=!1;switch(this.type){case o.TEXT:case o.TEXT_AREA:t=this.isValidTextOptionValue();break;case o.CHECKBOX:case o.COLOR_PICKER:t=!0;break;case o.CHOICE:t=this.isValidChoiceOptionValue();break;case o.DATE_PICKER:t=this.isValidDateOptionValue();break;case o.FILE:t=this.isValidFileOptionValue()}return t&&this.displayedChildOptions.every((function(t){return t.hasValidValues}))},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"values",{get:function(){return this._values},set:function(t){this._values=t,t.length||this.childOptions.forEach((function(t){return t.values=[]}))},enumerable:!1,configurable:!0}),i}(),x=function(){function l(l){var s,a,o=this;this.initOptionValues=function(){return t(o,void 0,void 0,(function(){return e(this,(function(t){return this.options.forEach((function(t){return t.initValues()})),[2]}))}))},this.id=l.id||"",this.name=l.name||"",this.options=(null===(s=l.options)||void 0===s?void 0:s.map((function(t){return new g(i(i({},t),{productOptionSetId:o.id}))})))||[],this.translations=l.translations?null===(a=l.translations)||void 0===a?void 0:a.map((function(t){return new d(t)})):null,this.setChildOptions(),this.setTranslations(),this.initOptionValues(),n(this)}return Object.defineProperty(l.prototype,"displayedOptions",{get:function(){return a(this.options.filter((function(t){return!t.requiredOptionId})),"order")},enumerable:!1,configurable:!0}),l.prototype.setTranslations=function(){var t,e=this,i=s.getCurrentLocale();if(this.translations&&this.translations.some((function(t){return t.locale===i}))){var n=this.translations.find((function(t){return t.locale===i}));null===(t=null==n?void 0:n.options)||void 0===t||t.forEach((function(t){var i,n=e.options.find((function(e){return e.id===t.id}));n&&(n.name=t.name||n.name,n.optionalText=t.optionalText||n.optionalText,n.type===o.CHOICE&&(null===(i=t.values)||void 0===i||i.forEach((function(t){var e,i=null===(e=n.selectSettings)||void 0===e?void 0:e.values.find((function(e){return e.id===t.id}));i&&(i.value=t.value||i.value)}))))}))}},l.prototype.setChildOptions=function(){var t=this;this.options.forEach((function(e){var i=t.options.filter((function(t){return t.requiredOptionId===e.id}));i.length&&(e.childOptions=i)}))},l}();export{g as IkasProductOption,m as IkasProductOptionDateSettings,v as IkasProductOptionFileSettings,p as IkasProductOptionSelectSettings,u as IkasProductOptionSelectType,c as IkasProductOptionSelectValue,r as IkasProductOptionSelectValueTranslations,x as IkasProductOptionSet,d as IkasProductOptionSetTranslations,f as IkasProductOptionTextSettings,h as IkasProductOptionTranslations,o as IkasProductOptionType};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e,__generator as t}from'../../../ext/tslib/tslib.es6.js';import a from"path";import{createFile as s,deleteDirContent as o}from"../../../utils/fs.js";import"../../../models/data/blog/index.js";import"../../../models/data/brand/index.js";import"../../../models/data/category/index.js";import"../../../models/data/checkout/index.js";import"../../../models/data/customer/address/index.js";import"../../../models/data/customer/index.js";import"../../../models/data/customer-review/index.js";import"../../../models/data/html-meta-data/index.js";import"../../../models/data/image/index.js";import"../../../models/data/installment-info/index.js";import"../../../models/data/order/index.js";import"../../../models/data/order/line-item/index.js";import"mobx";import"../../../api/product-option-file/index.js";import"../../../models/data/product/index.js";import"../../../models/data/variant-type/index.js";import"../../../models/data/product/variant/index.js";import"../../../models/data/product/variant/price/index.js";import"../../../models/data/product-attribute/index.js";import"../../../models/data/product/attribute-value/index.js";import"../../../models/data/product-filter/index.js";import"../../../models/data/variant-type/variant-value/index.js";import"../../../models/data/order-transaction/index.js";import"../../../models/data/product-option-set/index.js";import"../../../models/data/raffle/index.js";import"../../../models/data/product-campaing/campaign/index.js";import"../../../models/theme/theme.js";import"../../../models/theme/page/index.js";import{IkasThemeComponentPropType as r}from"../../../models/theme/component/prop/index.js";import"../../../models/theme/page/component/prop-value/link.js";import"../../../models/ui/brand-list/index.js";import"../../../models/ui/blog-list/index.js";import"../../../models/ui/blog-category-list/index.js";import"../../../models/ui/category-list/index.js";import"../../../models/ui/product-detail/index.js";import"../../../models/ui/product-list/index.js";import"../../../models/ui/product-attribute-detail/index.js";import"../../../models/ui/product-attribute-list/index.js";import"../../../models/ui/customer-review-list/index.js";import"../../../models/ui/validator/index.js";import"../../../models/ui/validator/rules/index.js";import"../../../models/ui/validator/form/login.js";import"../../../models/ui/validator/form/address.js";import"../../../models/ui/validator/form/register.js";import"../../../models/ui/validator/form/contact-form.js";import"../../../models/ui/validator/form/forgot-password.js";import"../../../models/ui/validator/form/recover-password.js";import"../../../models/ui/validator/form/account-info.js";import"../../../models/ui/validator/form/raffle-form.js";import"../../../models/ui/validator/form/customer-review.js";import"../../../models/ui/raffle-list/index.js";import"../../../models/theme/settings/index.js";import"../../../models/theme/custom-data/index.js";import i from'../../../ext/lodash/uniq.js';var n=function(){function n(){}return n.generate=function(r){return e(this,void 0,void 0,(function(){var e,
|
|
1
|
+
import{__awaiter as e,__generator as t}from'../../../ext/tslib/tslib.es6.js';import a from"path";import{createFile as s,deleteDirContent as o}from"../../../utils/fs.js";import"../../../models/data/blog/index.js";import"../../../models/data/brand/index.js";import"../../../models/data/category/index.js";import"../../../models/data/checkout/index.js";import"../../../models/data/customer/address/index.js";import"../../../models/data/customer/index.js";import"../../../models/data/customer-review/index.js";import"../../../models/data/html-meta-data/index.js";import"../../../models/data/image/index.js";import"../../../models/data/installment-info/index.js";import"../../../models/data/order/index.js";import"../../../models/data/order/line-item/index.js";import"mobx";import"../../../api/product-option-file/index.js";import"../../../models/data/product/index.js";import"../../../models/data/variant-type/index.js";import"../../../models/data/product/variant/index.js";import"../../../models/data/product/variant/price/index.js";import"../../../models/data/product-attribute/index.js";import"../../../models/data/product/attribute-value/index.js";import"../../../models/data/product-filter/index.js";import"../../../models/data/variant-type/variant-value/index.js";import"../../../models/data/order-transaction/index.js";import"../../../models/data/product-option-set/index.js";import"../../../models/data/raffle/index.js";import"../../../models/data/product-campaing/campaign/index.js";import"../../../models/theme/theme.js";import"../../../models/theme/page/index.js";import{IkasThemeComponentPropType as r}from"../../../models/theme/component/prop/index.js";import"../../../models/theme/page/component/prop-value/link.js";import"../../../models/ui/brand-list/index.js";import"../../../models/ui/blog-list/index.js";import"../../../models/ui/blog-category-list/index.js";import"../../../models/ui/category-list/index.js";import"../../../models/ui/product-detail/index.js";import"../../../models/ui/product-list/index.js";import"../../../models/ui/product-attribute-detail/index.js";import"../../../models/ui/product-attribute-list/index.js";import"../../../models/ui/customer-review-list/index.js";import"../../../models/ui/validator/index.js";import"../../../models/ui/validator/rules/index.js";import"../../../models/ui/validator/form/login.js";import"../../../models/ui/validator/form/address.js";import"../../../models/ui/validator/form/register.js";import"../../../models/ui/validator/form/contact-form.js";import"../../../models/ui/validator/form/forgot-password.js";import"../../../models/ui/validator/form/recover-password.js";import"../../../models/ui/validator/form/account-info.js";import"../../../models/ui/validator/form/raffle-form.js";import"../../../models/ui/validator/form/customer-review.js";import"../../../models/ui/raffle-list/index.js";import"../../../models/theme/settings/index.js";import"../../../models/theme/custom-data/index.js";import i from'../../../ext/lodash/uniq.js';var n=function(){function n(){}return n.generate=function(r){return e(this,void 0,void 0,(function(){var e,m,c,d,u,l,k;return t(this,(function(t){switch(t.label){case 0:return[4,o(a.join(process.cwd(),"src","components","__generated__","types"))];case 1:t.sent(),e={content:"",imports:[],internalCustomDatas:[]},t.label=2;case 2:t.trys.push([2,5,,6]),r.customData.forEach((function(t){n.generateAllCustomDataTypes(t,e,r)})),m=0,c=0;do{m=e.internalCustomDatas.length,e.internalCustomDatas.forEach((function(t){n.generateAllCustomDataTypes(t,e,r)})),(c=e.internalCustomDatas.length)!==m&&(e.internalCustomDatas=e.internalCustomDatas.splice(m,c))}while(m!==c);return[4,p.generate(r,e)];case 3:return t.sent(),d=a.join(process.cwd(),"src","components","__generated__"),e.imports=i(e.imports),u="import {\r\n",e.imports.forEach((function(e){u+="\t".concat(e,",\r\n")})),l=(u+='} from "@ikas/storefront"\r\n\r\n')+e.content,[4,s(d,"types.ts",l)];case 4:return[2,t.sent()];case 5:return k=t.sent(),console.log(k),[2,!1];case 6:return[2]}}))}))},n.generateAllCustomDataTypes=function(e,t,a){var s=e.type===r.ENUM,o="export ".concat(s?"enum":"type"," ").concat(n.generateTypeName(e)).concat(s?"":" = ","{ \r\n"),i="};\r\n\r\n";e.type!==r.DYNAMIC_LIST&&e.type!==r.STATIC_LIST||!e.nestedData?e.type===r.ENUM&&e.enumOptions?(t.content+=o,e.enumOptions.forEach((function(e){var a=e.value;e.value&&!isNaN(parseInt(e.value))&&(a="_"+e.value),t.content+='\t"'.concat(a,'" = "').concat(null==e?void 0:e.value,'",'),t.content+="\r\n"})),t.content+=i):(t.content+=o,e.nestedData&&e.nestedData.forEach((function(e){n.genenateCustomDataType(e,t,a),t.content+="\r\n"})),t.content+=i):n.generateAllCustomDataTypes(e.nestedData[0],t,a)},n.genenateCustomDataType=function(e,t,a){var s=n.getType(e,t,a);e.key&&e.key[0].match(/^\d/)&&(e.key="_"+e.key),t.content+="\t".concat(e.key).concat(e.isRequired?"":"?",": ").concat(s).concat([r.DYNAMIC_LIST,r.STATIC_LIST].includes(e.type)?"[]":"").concat(e.type===r.ENUM?",":";")},n.getType=function(e,t,a){var s="";switch(e.type){case r.TEXT:case r.RICH_TEXT:case r.COLOR:s="string";break;case r.BOOLEAN:s="boolean";break;case r.IMAGE:s="IkasImage",t.imports.push(s);break;case r.IMAGE_LIST:s="IkasImage[]",t.imports.push("IkasImage");break;case r.LINK:s="IkasNavigationLink",t.imports.push(s);break;case r.LIST_OF_LINK:s="IkasNavigationLink[]",t.imports.push("IkasNavigationLink");break;case r.PRODUCT_DETAIL:s="IkasProductDetail",t.imports.push(s);break;case r.PRODUCT_LIST:s="IkasProductList",t.imports.push("IkasProductList");break;case r.PRODUCT_ATTRIBUTE:s="IkasProductAttribute",t.imports.push(s);break;case r.PRODUCT_ATTRIBUTE_LIST:s="IkasProductAttribute[]",t.imports.push("IkasProductAttribute");break;case r.BRAND:s="IkasBrand",t.imports.push(s);break;case r.BRAND_LIST:s="IkasBrandList",t.imports.push(s);break;case r.CATEGORY:s="IkasCategory",t.imports.push(s);break;case r.CATEGORY_LIST:s="IkasCategoryList",t.imports.push(s);break;case r.CUSTOM:var o=a.customData.find((function(t){return t.id===e.customDataId}));o&&(s=n.generateTypeName(o));break;case r.COMPONENT:s="IkasComponentRenderer",t.imports.push(s);break;case r.COMPONENT_LIST:s="IkasComponentRenderer[]",t.imports.push("IkasComponentRenderer");break;case r.BLOG:s="IkasBlog",t.imports.push(s);break;case r.BLOG_LIST:s="IkasBlogList",t.imports.push(s);break;case r.BLOG_CATEGORY:s="IkasBlogCategory",t.imports.push(s);break;case r.BLOG_CATEGORY_LIST:s="IkasBlogCategoryList",t.imports.push(s);break;case r.RAFFLE:s="IkasRaffle",t.imports.push(s);break;case r.RAFFLE_LIST:s="IkasRaffleList",t.imports.push(s);break;case r.ENUM:s=n.generateTypeName(e),t.content.includes("export enum ".concat(s))||t.internalCustomDatas.push(e);break;case r.OBJECT:s=n.generateTypeName(e);break;case r.DYNAMIC_LIST:case r.STATIC_LIST:e.nestedData&&(e.nestedData[0].type===r.OBJECT||e.nestedData[0].type===r.ENUM?(s=n.generateTypeName(e.nestedData[0]),t.content.includes("export type ".concat(s))||t.internalCustomDatas.push(e.nestedData[0])):s=n.getType(e.nestedData[0],t,a))}return s},n.generateTypeName=function(e){if(e.typescriptName)return e.typescriptName;var t=e.name||"";return(t=(t=t.replace(/\s/g,"")).replace(/\W/g,""))[0].match(/^\d/)&&(t="_"+t),e.type===r.ENUM&&(t+="Enum"),t},n}(),p=function(){function a(){}return a.generate=function(s,o){return e(this,void 0,void 0,(function(){return t(this,(function(e){return s.components.forEach((function(e){e.props.length>0&&"checkout"!==e.id&&(o.content+="export type ".concat(a.generatePropTypeName(e),"Props = {\n"),e.props.forEach((function(e){o.content+="\t".concat(e.name,": ").concat(a.getType(e,s,o),";\n")})),o.content+="};\r\n\r\n")})),[2]}))}))},a.getType=function(e,t,a){var s="";switch(e.type){case r.TEXT:case r.RICH_TEXT:case r.COLOR:s="string";break;case r.BOOLEAN:s="boolean";break;case r.IMAGE:s="IkasImage",a.imports.push(s);break;case r.IMAGE_LIST:s="IkasImage[]",a.imports.push("IkasImage");break;case r.LINK:s="IkasNavigationLink",a.imports.push(s);break;case r.LIST_OF_LINK:s="IkasNavigationLink[]",a.imports.push("IkasNavigationLink");break;case r.PRODUCT_DETAIL:s="IkasProductDetail",a.imports.push(s);break;case r.PRODUCT_LIST:s="IkasProductList",a.imports.push("IkasProductList");break;case r.PRODUCT_ATTRIBUTE:s="IkasProductAttribute",a.imports.push(s);break;case r.PRODUCT_ATTRIBUTE_LIST:s="IkasProductAttribute[]",a.imports.push("IkasProductAttribute");break;case r.BRAND:s="IkasBrand",a.imports.push(s);break;case r.BRAND_LIST:s="IkasBrandList",a.imports.push(s);break;case r.CATEGORY:s="IkasCategory",a.imports.push(s);break;case r.CATEGORY_LIST:s="IkasCategoryList",a.imports.push(s);break;case r.CUSTOM:var o=t.customData.find((function(t){return t.id===e.customDataId}));o&&(s=n.getType(o,a,t),o.type!==r.DYNAMIC_LIST&&o.type!==r.STATIC_LIST||(s+="[]"));break;case r.COMPONENT:s="IkasComponentRenderer",a.imports.push(s);break;case r.COMPONENT_LIST:s="IkasComponentRenderer[]",a.imports.push("IkasComponentRenderer");break;case r.BLOG:s="IkasBlog",a.imports.push(s);break;case r.BLOG_LIST:s="IkasBlogList",a.imports.push(s);break;case r.BLOG_CATEGORY:s="IkasBlogCategory",a.imports.push(s);break;case r.BLOG_CATEGORY_LIST:s="IkasBlogCategoryList",a.imports.push(s);break;case r.RAFFLE:s="IkasRaffle",a.imports.push(s);break;case r.RAFFLE_LIST:s="IkasRaffleList",a.imports.push(s);break;case r.SLIDER:s="IkasSlider",a.imports.push(s)}return s},a.generatePropTypeName=function(e){if(""!==e.displayName){var t=(e.dir||"").split("-"),a="";return t.forEach((function(e,t){return a+=e.charAt(0).toUpperCase()+e.slice(1)})),a[0].match(/^\d/)&&(a="_"+a),a}},a}();export{n as CustomDataTypesGenerator,p as PropTypeGenarator};
|