@bikdotai/bik-component-library 0.0.678 → 0.0.679-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/components/QueryBuilder/Triggers/EVENTS/components/EventsTrigger.d.ts +1 -1
- package/dist/cjs/components/QueryBuilder/Triggers/EVENTS/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
- package/dist/cjs/components/QueryBuilder/Triggers/IG/components/IGTrigger.d.ts +1 -1
- package/dist/cjs/components/QueryBuilder/Triggers/IG/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
- package/dist/cjs/components/QueryBuilder/Triggers/components/BaseTriggerQueryBuilderNode.d.ts +2 -2
- package/dist/cjs/components/QueryBuilder/redux/queryBuilder.reducer.js +1 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.d.ts +0 -11
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.js +1 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js +1 -1
- package/dist/cjs/components/bik-layout/MockMenus.d.ts +1 -0
- package/dist/cjs/components/checkBox/CheckBox.d.ts +0 -1
- package/dist/cjs/components/checkBox/CheckBox.js +1 -1
- package/dist/cjs/components/country-code-picker/CountryCodePicker.d.ts +2 -0
- package/dist/cjs/components/country-code-picker/CountryCodePicker.js +1 -1
- package/dist/cjs/components/data-source-panel/DataSourcePanel.d.ts +1 -2
- package/dist/cjs/components/data-source-panel/DataSourcePanel.js +1 -1
- package/dist/cjs/components/data-source-panel/DataSourcePanel.style.js +3 -40
- package/dist/cjs/components/data-source-panel/model.d.ts +0 -8
- package/dist/cjs/components/discount-modal/DiscountModal.d.ts +0 -2
- package/dist/cjs/components/discount-modal/DiscountModal.js +1 -1
- package/dist/cjs/components/discount-modal/DynamicCoupon/DynamicCoupon.js +1 -1
- package/dist/cjs/components/dropdown/ChipInput.d.ts +0 -2
- package/dist/cjs/components/dropdown/ChipInput.js +1 -1
- package/dist/cjs/components/dropdown/Common.styled.d.ts +1 -3
- package/dist/cjs/components/dropdown/Common.styled.js +4 -4
- package/dist/cjs/components/dropdown/Dropdown.d.ts +0 -1
- package/dist/cjs/components/dropdown/Dropdown.js +1 -1
- package/dist/cjs/components/input/Input.d.ts +1 -0
- package/dist/cjs/components/input/Input.js +1 -1
- package/dist/cjs/components/input/Input.styled.d.ts +1 -0
- package/dist/cjs/components/input/Input.styled.js +1 -1
- package/dist/cjs/components/modals/Modal.d.ts +0 -2
- package/dist/cjs/components/modals/Modal.js +1 -1
- package/dist/cjs/components/modals/modal.styled.d.ts +0 -6
- package/dist/cjs/components/modals/modal.styled.js +1 -1
- package/dist/cjs/components/modals/styledModal.d.ts +0 -2
- package/dist/cjs/components/modals/styledModal.js +1 -1
- package/dist/cjs/components/product-picker-v2/collectionScreen.d.ts +1 -3
- package/dist/cjs/components/product-picker-v2/collectionScreen.js +1 -1
- package/dist/cjs/components/product-picker-v2/modal.d.ts +5 -7
- package/dist/cjs/components/product-picker-v2/modal.js +1 -1
- package/dist/cjs/components/product-picker-v2/productScreen.d.ts +3 -5
- package/dist/cjs/components/product-picker-v2/productScreen.js +1 -1
- package/dist/cjs/components/product-picker-v2/rearrangeScreen.d.ts +1 -3
- package/dist/cjs/components/product-picker-v2/rearrangeScreen.js +1 -1
- package/dist/cjs/components/product-picker-v2/searchScreen.d.ts +1 -3
- package/dist/cjs/components/product-picker-v2/searchScreen.js +1 -1
- package/dist/cjs/components/product-picker-v2/selectedScreen.d.ts +1 -3
- package/dist/cjs/components/product-picker-v2/selectedScreen.js +1 -1
- package/dist/cjs/components/product-picker-v2/utility.d.ts +1 -2
- package/dist/cjs/components/product-picker-v2/utility.js +1 -1
- package/dist/cjs/components/states-modal/StateModalComponent.d.ts +0 -1
- package/dist/cjs/components/states-modal/StateModalComponent.js +1 -1
- package/dist/cjs/components/tag/Tag.d.ts +1 -1
- package/dist/cjs/components/tag/Tag.js +1 -1
- package/dist/cjs/components/tag/model.d.ts +1 -12
- package/dist/cjs/components/template-context-mapper/modalElements/WhatsAppTemplateCardButtonV2.js +1 -1
- package/dist/esm/components/QueryBuilder/Triggers/EVENTS/components/EventsTrigger.d.ts +1 -1
- package/dist/esm/components/QueryBuilder/Triggers/EVENTS/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
- package/dist/esm/components/QueryBuilder/Triggers/IG/components/IGTrigger.d.ts +1 -1
- package/dist/esm/components/QueryBuilder/Triggers/IG/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
- package/dist/esm/components/QueryBuilder/Triggers/components/BaseTriggerQueryBuilderNode.d.ts +2 -2
- package/dist/esm/components/QueryBuilder/redux/queryBuilder.reducer.js +1 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.d.ts +0 -11
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.js +1 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js +1 -1
- package/dist/esm/components/bik-layout/MockMenus.d.ts +1 -0
- package/dist/esm/components/checkBox/CheckBox.d.ts +0 -1
- package/dist/esm/components/checkBox/CheckBox.js +1 -1
- package/dist/esm/components/country-code-picker/CountryCodePicker.d.ts +2 -0
- package/dist/esm/components/country-code-picker/CountryCodePicker.js +1 -1
- package/dist/esm/components/data-source-panel/DataSourcePanel.d.ts +1 -2
- package/dist/esm/components/data-source-panel/DataSourcePanel.js +1 -1
- package/dist/esm/components/data-source-panel/DataSourcePanel.style.js +3 -40
- package/dist/esm/components/data-source-panel/model.d.ts +0 -8
- package/dist/esm/components/discount-modal/DiscountModal.d.ts +0 -2
- package/dist/esm/components/discount-modal/DiscountModal.js +1 -1
- package/dist/esm/components/discount-modal/DynamicCoupon/DynamicCoupon.js +1 -1
- package/dist/esm/components/dropdown/ChipInput.d.ts +0 -2
- package/dist/esm/components/dropdown/ChipInput.js +1 -1
- package/dist/esm/components/dropdown/Common.styled.d.ts +1 -3
- package/dist/esm/components/dropdown/Common.styled.js +1 -1
- package/dist/esm/components/dropdown/Dropdown.d.ts +0 -1
- package/dist/esm/components/dropdown/Dropdown.js +1 -1
- package/dist/esm/components/input/Input.d.ts +1 -0
- package/dist/esm/components/input/Input.js +1 -1
- package/dist/esm/components/input/Input.styled.d.ts +1 -0
- package/dist/esm/components/input/Input.styled.js +1 -1
- package/dist/esm/components/modals/Modal.d.ts +0 -2
- package/dist/esm/components/modals/Modal.js +1 -1
- package/dist/esm/components/modals/modal.styled.d.ts +0 -6
- package/dist/esm/components/modals/modal.styled.js +1 -1
- package/dist/esm/components/modals/styledModal.d.ts +0 -2
- package/dist/esm/components/modals/styledModal.js +1 -1
- package/dist/esm/components/product-picker-v2/collectionScreen.d.ts +1 -3
- package/dist/esm/components/product-picker-v2/collectionScreen.js +1 -1
- package/dist/esm/components/product-picker-v2/modal.d.ts +5 -7
- package/dist/esm/components/product-picker-v2/modal.js +1 -1
- package/dist/esm/components/product-picker-v2/productScreen.d.ts +3 -5
- package/dist/esm/components/product-picker-v2/productScreen.js +1 -1
- package/dist/esm/components/product-picker-v2/rearrangeScreen.d.ts +1 -3
- package/dist/esm/components/product-picker-v2/rearrangeScreen.js +1 -1
- package/dist/esm/components/product-picker-v2/searchScreen.d.ts +1 -3
- package/dist/esm/components/product-picker-v2/searchScreen.js +1 -1
- package/dist/esm/components/product-picker-v2/selectedScreen.d.ts +1 -3
- package/dist/esm/components/product-picker-v2/selectedScreen.js +1 -1
- package/dist/esm/components/product-picker-v2/utility.d.ts +1 -2
- package/dist/esm/components/product-picker-v2/utility.js +1 -1
- package/dist/esm/components/states-modal/StateModalComponent.d.ts +0 -1
- package/dist/esm/components/states-modal/StateModalComponent.js +1 -1
- package/dist/esm/components/tag/Tag.d.ts +1 -1
- package/dist/esm/components/tag/Tag.js +1 -1
- package/dist/esm/components/tag/model.d.ts +1 -12
- package/dist/esm/components/template-context-mapper/modalElements/WhatsAppTemplateCardButtonV2.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/components/data-source-panel/Modals/DescriptionModal.d.ts +0 -8
- package/dist/cjs/components/data-source-panel/Modals/DescriptionModal.js +0 -48
- package/dist/cjs/components/tag/Tag.stories.d.ts +0 -22
- package/dist/esm/components/data-source-panel/Modals/DescriptionModal.d.ts +0 -8
- package/dist/esm/components/data-source-panel/Modals/DescriptionModal.js +0 -48
- package/dist/esm/components/tag/Tag.stories.d.ts +0 -22
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../assets/icons/arrow_left.svg.js"),r=require("../../assets/icons/box.svg.js"),c=require("../../assets/icons/search.svg.js"),o=require("lodash"),s=require("react"),n=require("../../constants/Theme.js"),i=require("../checkBox/CheckBox.js"),l=require("../icon-button/IconButton.js"),d=require("../InfiniteScroll/InfiniteScroll.js"),u=require("../input/Input.js"),a=require("../spinner/Spinner.js"),h=require("../TypographyStyle.js"),p=require("./emptyState.js"),j=require("./product.js"),v=require("./ProductPickerShimmer.js"),g=require("./reducers.js"),y=require("./style.js"),O=require("./type.js"),b=require("./utility.js");exports.ProductsScreen=f=>{var k,C;const{data:P,collectionsDispatch:x,selectedData:S,selectedCollectionsDispatch:I,productFetcher:m,storeId:q,setScreen:A,setSaveDisabled:D,hideInCollectionSearch:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../assets/icons/arrow_left.svg.js"),r=require("../../assets/icons/box.svg.js"),c=require("../../assets/icons/search.svg.js"),o=require("lodash"),s=require("react"),n=require("../../constants/Theme.js"),i=require("../checkBox/CheckBox.js"),l=require("../icon-button/IconButton.js"),d=require("../InfiniteScroll/InfiniteScroll.js"),u=require("../input/Input.js"),a=require("../spinner/Spinner.js"),h=require("../TypographyStyle.js"),p=require("./emptyState.js"),j=require("./product.js"),v=require("./ProductPickerShimmer.js"),g=require("./reducers.js"),y=require("./style.js"),O=require("./type.js"),b=require("./utility.js");exports.ProductsScreen=f=>{var k,C;const{data:P,collectionsDispatch:x,selectedData:S,selectedCollectionsDispatch:I,productFetcher:m,storeId:q,setScreen:A,setSaveDisabled:D,hideInCollectionSearch:E,customCollectionRestriction:T,hideProductCheckbox:R,outOfStockAction:V=O.OUT_OF_STOCK_ACTION.BLUR,hideVariantCheckbox:L=!1,selectProductsFromCustomCollection:F=!1,pickerType:w,hideProductVariants:B,fbStatusFetcher:_,onProductDetailClick:U,showProductDetailInfoIcon:K,scrollContainerRef:M}=f,N=s.useContext(g.CollectionIdContext),H=s.useRef(0),J=s.useRef(!1),[W,z]=s.useState(""),[G,Q]=s.useState(!1),[X,Y]=s.useState(P),Z=s.useRef(!0),$=s.useRef(!1);s.useEffect((()=>{if(Z.current)return void(Z.current=!1);const e=setTimeout((()=>{W.length?(Q(!0),f.searchInCollectionFetcher(q,N,W).then((e=>{const t=o.cloneDeep(P);t.products=e,Y(t);const r=b.getVariantIdsToFetchAtProductLevel(null!=e?e:{});te(r,null!=e?e:{},!0),D(!1),Q(!1)}))):Y(P)}),800);return()=>clearTimeout(e)}),[W]);s.useEffect((()=>{var e,t,r,c;$.current=!1,H.current=Math.floor((null===(t=Object.keys(null!==(e=P.products)&&void 0!==e?e:{}))||void 0===t?void 0:t.length)/10);const o=b.getVariantIdsToFetchAtProductLevel(null!==(r=P.products)&&void 0!==r?r:{});te(o,null!==(c=P.products)&&void 0!==c?c:{})}),[N]);const ee=!!T&&P.isSmartCollection;s.useEffect((()=>{(null==P?void 0:P.products)||re(10)}),[]);const te=(e,t,r)=>{_||(r?b.markVariantsAsApprovedProductsLevel(t,x,N,X,Y):b.markVariantsAsApprovedProductsLevel(t,x,N)),e.length>0&&_&&_(q,e).then((e=>{const c=Object.assign({},t);Object.keys(t).forEach((r=>{var o,s;Object.keys(null!==(s=null===(o=null==t?void 0:t[r])||void 0===o?void 0:o.variants)&&void 0!==s?s:{}).forEach((o=>{var s,n;const i=null===(s=null==t?void 0:t[r].variants)||void 0===s?void 0:s[o];i&&"REJECTED"===e[o]?i.fbStatus="REJECTED":i&&"APPROVED"===e[o]&&(i.fbStatus="APPROVED");const l=null===(n=null==c?void 0:c[r])||void 0===n?void 0:n.variants;l&&l[o]&&(l[o]=i)}))})),r?(Y((e=>{const t=Object.assign({},e);return t.products=c,t})),x({type:"productsPaged",data:{collectionId:N,products:c}})):x({type:"productsPaged",data:{collectionId:N,products:c}})})).catch((e=>{r?b.markVariantsAsApprovedProductsLevel(t,x,N,X,Y):b.markVariantsAsApprovedProductsLevel(t,x,N)}))},re=e=>{D(!0),Q(!0),m(N,q,e,0).then((t=>{if(Object.keys(t).length||($.current=!0),Object.keys(t).length){Y(Object.assign(Object.assign({},X),{products:t}));const e=b.getVariantIdsToFetchAtProductLevel(t);te(e,t),H.current=1}e||I({type:"selected",data:{id:N,val:Object.assign(Object.assign({},P),{products:t})}}),D(!1),Q(!1)})).catch()},ce=(e,t)=>{const r=b.liftTheStateUp(t,P);I({type:e,data:Object.assign(Object.assign({},r),{isRestricted:T})})},oe=!!(null==S?void 0:S[N])&&!!Object.keys(null!==(C=null===(k=null==S?void 0:S[N])||void 0===k?void 0:k.products)&&void 0!==C?C:{}).length;return e.jsxs("div",{children:[e.jsxs(y.ProductScreenHeader,{children:[e.jsx(l.IconButton,{Icon:t.default,height:16,onClick:()=>{A("collections")}}),e.jsx(h.BodyCaption,Object.assign({style:{color:n.COLORS.content.secondary}},{children:P.name}))]}),!E&&e.jsx("div",Object.assign({style:{padding:16,height:"76px",borderBottom:"1px solid #E0E0E0"}},{children:e.jsx(u.Input,{noKeyDownChange:!0,noErrorHint:!0,rightIcon:{icon:()=>G&&W.length?e.jsx(a.Spinner,{size:"small",color:n.COLORS.content.primary}):e.jsx(c.default,{})},id:"listInput",height:"24px",type:"text",value:W,onChangeText:e=>{e.length&&e.trim().length?z(e):z("")},placeholder:"Search using ID, Name or SKU ID"})})),Object.keys((null==X?void 0:X.products)||[]).length>0&&!ee&&!W.length&&!R&&"-1"!==N&&e.jsxs(y.ProductScreenCollectionCardStyle,{children:[e.jsx(i.CheckBox,{isChecked:oe,isPartiallyChecked:b.isCollectionPartiallyChecked(N,X,S,B),onValueChange:function(e){e?re():I({type:"unselected",data:{id:N}})}}),e.jsx("div",Object.assign({style:{width:40,height:40}},{children:e.jsx(r.default,{})})),e.jsx(h.TitleRegular,{children:"All Products"})]}),e.jsx(d.InfiniteScroll,Object.assign({hasData:!(Object.keys((null==X?void 0:X.products)||[]).length<10)&&!!Object.keys((null==X?void 0:X.products)||[]).length,fetchMore:()=>(J.current=!0,m(N,q,10,H.current).then((e=>{let t=!1;if(Object.keys(e).length||(t=!0),Object.keys(e).length){const t=X;t.products=Object.assign(Object.assign({},X.products),e),Y(Object.assign({},t));const r=b.getVariantIdsToFetchAtProductLevel(e);te(r,e)}return D(!1),J.current=!1,H.current+=1,t}))),containerRef:M},{children:Object.keys((null==X?void 0:X.products)||[]).length?Object.keys(X.products||[]).map((t=>e.jsx(j.ProductGroup,{outOfStockAction:V,collectionId:N,isProductPartiallyChecked:b.isProductPartiallyChecked(N,t,S,X,B),productId:t,data:X.products[t],selectedData:S,selectedCollectionsDispatch:I,viewOnly:!F&&!!ee,upliftAdditions:ce,hideProductCheckbox:R,hideVariantCheckbox:L,hideProductVariants:B,pickerType:w,onProductDetailClick:U,showProductDetailInfoIcon:K},t))):G?e.jsx(v.ProductPickerShimmer,{limit:10}):e.jsx(p.EmptyState,{title:"No products to show",subtitle:W.length?"We couldn't find the product you were looking for":"We couldn’t find any product in this collection."})}))]})};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ApplicationType } from '@bikdotai/bik-models/growth/models/bik-store';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
import { FbStatusFetcherReturn, SelectedItems } from '.';
|
|
4
3
|
import { SelectedCollectionsActions } from './reducers';
|
|
@@ -11,8 +10,7 @@ interface RearrangeScreenInterface {
|
|
|
11
10
|
outOfStockAction?: OUT_OF_STOCK_ACTION;
|
|
12
11
|
scrollContainerRef: React.RefObject<HTMLDivElement>;
|
|
13
12
|
storeId: string;
|
|
14
|
-
|
|
15
|
-
fbStatusFetcher?: (storeId: string, variantIds: string[], appType: ApplicationType) => FbStatusFetcherReturn;
|
|
13
|
+
fbStatusFetcher?: (storeId: string, variantIds: string[]) => FbStatusFetcherReturn;
|
|
16
14
|
}
|
|
17
15
|
/**
|
|
18
16
|
* Screen will be opened on two conditions -
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../assets/icons/arrow_left.svg.js"),r=require("react"),s=require("react-beautiful-dnd"),c=require("../../constants/Theme.js"),o=require("../icon-button/IconButton.js"),i=require("../TypographyStyle.js"),n=require("./emptyState.js"),a=require("./helpers/ProductHelper.js"),l=require("./style.js"),d=require("./utility.js"),u=require("./variantComponents.js");exports.RearrangeScreen=p=>{const{selectedCollections:j,selectedCollectionsDispatch:S,setScreen:h,rearrangeViewType:y,outOfStockAction:f,scrollContainerRef:x,storeId:q,fbStatusFetcher:C
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../assets/icons/arrow_left.svg.js"),r=require("react"),s=require("react-beautiful-dnd"),c=require("../../constants/Theme.js"),o=require("../icon-button/IconButton.js"),i=require("../TypographyStyle.js"),n=require("./emptyState.js"),a=require("./helpers/ProductHelper.js"),l=require("./style.js"),d=require("./utility.js"),u=require("./variantComponents.js");exports.RearrangeScreen=p=>{const{selectedCollections:j,selectedCollectionsDispatch:S,setScreen:h,rearrangeViewType:y,outOfStockAction:f,scrollContainerRef:x,storeId:q,fbStatusFetcher:C}=p,[O,g]=r.useState(a.parseSelectedVariantsToArray(j));r.useEffect((()=>{g(a.parseSelectedVariantsToArray(j))}),[j]),r.useEffect((()=>{var e;null===(e=null==x?void 0:x.current)||void 0===e||e.scrollTo({top:0}),d.fetchFbStatusCollection(j,q,S,C,"update")}),[]);return e.jsxs(s.DragDropContext,Object.assign({onDragEnd:e=>{if(!e.destination)return;const t=O,[r]=t.splice(e.source.index,1);t.splice(e.destination.index,0,r),t.forEach(((e,t)=>{e.displayOrder=t})),g(t)}},{children:[e.jsxs(l.SelectedScreenHeader,{children:[e.jsx(o.IconButton,{Icon:t.default,width:16,height:16,color:c.COLORS.content.secondary,onClick:()=>{h("collections")}}),e.jsx(i.BodyCaption,Object.assign({color:c.COLORS.content.secondary},{children:"All Products"}))]}),Object.keys(j).length>0?"list"===y?e.jsx(u.VariantsList,{selectedVariants:O,setSelectedVariants:g,selectedCollectionsDispatch:S,outOfStockAction:f}):e.jsx(u.VariantsGrid,{selectedVariants:O,setSelectedVariants:g,selectedCollectionsDispatch:S}):e.jsx(n.EmptyState,{title:"No Products Selected",subtitle:"Selected products will appear here"})]}))};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { ApplicationType } from '@bikdotai/bik-models/growth/models/bik-store';
|
|
3
2
|
import { Collection, FbStatusFetcherReturn, SearchedItems, SelectedItems } from '.';
|
|
4
3
|
import { SearchReducerActions, SelectedCollectionsActions } from './reducers';
|
|
5
4
|
import { OUT_OF_STOCK_ACTION } from './type';
|
|
@@ -21,8 +20,7 @@ interface SearchScreenInterface {
|
|
|
21
20
|
hideProductVariants?: boolean;
|
|
22
21
|
hideProductCheckbox?: boolean;
|
|
23
22
|
storeId: string;
|
|
24
|
-
|
|
25
|
-
fbStatusFetcher?: (storeId: string, variantIds: string[], appType: ApplicationType) => FbStatusFetcherReturn;
|
|
23
|
+
fbStatusFetcher?: (storeId: string, variantIds: string[]) => FbStatusFetcherReturn;
|
|
26
24
|
hideCollectionCheckbox?: boolean;
|
|
27
25
|
renderWithoutModal?: boolean;
|
|
28
26
|
outOfStockAction?: OUT_OF_STOCK_ACTION;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../assets/icons/arrow_left.svg.js"),o=require("react"),l=require("../icon-button/IconButton.js"),c=require("../TypographyStyle.js"),i=require("./collectionScreen.js"),s=require("./emptyState.js"),d=require("./product.js"),r=require("./style.js"),n=require("./utility.js");exports.SearchScreen=u=>{var a;const{customCollectionRestriction:h,selectedCollections:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../assets/icons/arrow_left.svg.js"),o=require("react"),l=require("../icon-button/IconButton.js"),c=require("../TypographyStyle.js"),i=require("./collectionScreen.js"),s=require("./emptyState.js"),d=require("./product.js"),r=require("./style.js"),n=require("./utility.js");exports.SearchScreen=u=>{var a;const{customCollectionRestriction:h,selectedCollections:v,searchedCollections:p,searchedCollectionsDispatch:C,selectedCollectionsDispatch:j,setScreen:k,collections:y,onBackPress:b,hideVariantCheckbox:x,pickerType:S,hideProductVariants:P,hideProductCheckbox:f,storeId:m,fbStatusFetcher:O,setCollectionId:g,setSelectedCollectionId:I,hideCollectionCheckbox:q,renderWithoutModal:D,outOfStockAction:F}=u;o.useEffect((()=>{var e;n.fetchFbStatusCollection(null!==(e=p.products)&&void 0!==e?e:{},m,C,O,"setProducts")}),[null==p?void 0:p.products]);const T=!!h&&(null==v?void 0:v.isCustom);return e.jsxs("div",{children:[e.jsxs(r.SelectedScreenHeader,{children:[e.jsx(l.IconButton,{Icon:t.default,onClick:()=>{k("collections"),b()}}),e.jsx(c.BodyCaption,{children:(null===(a=Object.keys(null==p?void 0:p.collections))||void 0===a?void 0:a.length)?"Searched Collections & Products":"Searched Products"})]}),e.jsx("div",{children:Object.keys(null==p?void 0:p.products).length||Object.keys(null==p?void 0:p.collections).length?e.jsxs(e.Fragment,{children:[e.jsx(e.Fragment,{children:Object.keys(null==p?void 0:p.collections).map((t=>e.jsx(i.CollectionCard,{customCollectionRestriction:h,data:null==y?void 0:y[t],isDisabled:T&&!(null==v?void 0:v[t]),isChecked:!!(null==v?void 0:v[t]),isPartiallyChecked:n.isCollectionPartiallyChecked(t,null==y?void 0:y[t],v,P),selectedCollectionsDispatch:j,setCollectionId:g,setSelectedCollectionId:I,setScreen:k,id:t,hideCollectionCheckbox:q||"-1"===t,selectedCollections:v,renderWithoutModal:D,pickerType:S,usedInSearch:!0},t)))}),e.jsx(e.Fragment,{children:Object.keys(null==p?void 0:p.products).map((t=>{var o,l;return Object.keys((null===(l=null===(o=null==p?void 0:p.products)||void 0===o?void 0:o[t])||void 0===l?void 0:l.products)||[]).map((o=>{var l,c,i;let s=!1;return(null===(l=null==p?void 0:p.products)||void 0===l?void 0:l.isCustom)&&(s=!0),e.jsx(d.ProductGroup,{collectionId:t,upliftAdditions:(e,o)=>((e,t,o)=>{var l;const c=n.liftTheStateUp(o,null===(l=null==p?void 0:p.products)||void 0===l?void 0:l[e]);j({type:t,data:Object.assign(Object.assign({},c),{isRestricted:h})})})(t,e,o),productId:o,data:(null===(c=null==p?void 0:p.products)||void 0===c?void 0:c[t].products)[o],isProductPartiallyChecked:n.isProductPartiallyChecked(t,o,v,null===(i=p.products)||void 0===i?void 0:i[t],P),selectedData:v,selectedCollectionsDispatch:j,viewOnly:s,hideProductCheckbox:f,hideVariantCheckbox:x,hideProductVariants:P,pickerType:S,outOfStockAction:F},o)}))}))})]}):e.jsx(s.EmptyState,{title:"No search results found",subtitle:"We couldn’t find the product you were looking for."})})]})};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { ApplicationType } from '@bikdotai/bik-models/growth/models/bik-store';
|
|
3
2
|
import { Collection, FbStatusFetcherReturn, SelectedItems } from '.';
|
|
4
3
|
import { SelectedCollectionsActions } from './reducers';
|
|
5
4
|
import { OUT_OF_STOCK_ACTION } from './type';
|
|
@@ -13,8 +12,7 @@ interface SelectedScreenInterface {
|
|
|
13
12
|
hideProductVariants?: boolean;
|
|
14
13
|
outOfStockAction?: OUT_OF_STOCK_ACTION;
|
|
15
14
|
storeId: string;
|
|
16
|
-
|
|
17
|
-
fbStatusFetcher?: (storeId: string, variantIds: string[], appType: ApplicationType) => FbStatusFetcherReturn;
|
|
15
|
+
fbStatusFetcher?: (storeId: string, variantIds: string[]) => FbStatusFetcherReturn;
|
|
18
16
|
}
|
|
19
17
|
export declare const SelectedScreen: (props: SelectedScreenInterface) => import("react/jsx-runtime").JSX.Element;
|
|
20
18
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../assets/icons/arrow_left.svg.js"),r=require("react"),c=require("../icon-button/IconButton.js"),s=require("../TypographyStyle.js"),n=require("./emptyState.js"),i=require("./product.js"),o=require("./reducers.js"),u=require("./style.js"),l=require("./utility.js");exports.SelectedScreen=d=>{const{selectedCollections:a,selectedCollectionsDispatch:p,setScreen:j,collections:f,hideProductVariants:h=!1,outOfStockAction:y,storeId:S,fbStatusFetcher:v
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../assets/icons/arrow_left.svg.js"),r=require("react"),c=require("../icon-button/IconButton.js"),s=require("../TypographyStyle.js"),n=require("./emptyState.js"),i=require("./product.js"),o=require("./reducers.js"),u=require("./style.js"),l=require("./utility.js");exports.SelectedScreen=d=>{const{selectedCollections:a,selectedCollectionsDispatch:p,setScreen:j,collections:f,hideProductVariants:h=!1,outOfStockAction:y,storeId:S,fbStatusFetcher:v}=d,b=r.useRef(0),x=r.useRef(null),[g,q]=r.useReducer(o.paginationReducer,{});r.useEffect((()=>{b.current=0;const e=l.paginateSelectedItems(a,10,0);q({type:"paginate",data:e}),l.fetchFbStatusCollection(e,S,q,v,"set"),b.current+=1}),[]),r.useEffect((()=>{q({type:"filter",data:a})}),[a]),r.useEffect((()=>{const e=new IntersectionObserver((e=>{if(e[0].isIntersecting&&b.current>0){const e=l.paginateSelectedItems(a,10,b.current);q({type:"paginate",data:e}),l.fetchFbStatusCollection(e,S,q,v,"update"),b.current+=1}}),{threshold:1});return x.current&&e.observe(x.current),()=>{x.current&&e.unobserve(x.current)}}),[x,a]);const C=a;return e.jsxs("div",{children:[e.jsxs(u.SelectedScreenHeader,{children:[e.jsx(c.IconButton,{Icon:t.default,onClick:()=>{j("collections")}}),e.jsx(s.BodyCaption,{children:"Selected Products"})]}),e.jsxs("div",{children:[Object.keys(g).length>0?e.jsx(e.Fragment,{children:Object.keys(g).map((t=>{var r;return Object.keys((null===(r=null==g?void 0:g[t])||void 0===r?void 0:r.products)||[]).map((r=>{let c=!1;return(null==C?void 0:C.isCustom)&&(c=!0),e.jsx(i.ProductGroup,{upliftAdditions:null,collectionId:t,productId:r,data:g[t].products[r],isProductPartiallyChecked:l.isProductPartiallyChecked(t,r,C,null==f?void 0:f[t],h),selectedData:C,selectedCollectionsDispatch:p,viewOnly:c,hideProductVariants:h,outOfStockAction:y},r)}))}))}):e.jsx(n.EmptyState,{title:"No Products Selected",subtitle:"Select products will appear here"}),e.jsx("div",{ref:x})]})]})};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ApplicationType } from '@bikdotai/bik-models/growth/models/bik-store';
|
|
2
1
|
import { Collection, FbStatusFetcherReturn, Product, ProductVariant, SearchedItems, SelectedItems } from './modal';
|
|
3
2
|
import { CollectionsActions } from './reducers';
|
|
4
3
|
export declare const liftTheStateUp: (payload: any, data: any) => any;
|
|
@@ -13,7 +12,7 @@ export declare function paginateSelectedItems(selectedItems: SelectedItems, limi
|
|
|
13
12
|
*
|
|
14
13
|
* We first get the variant ids to fetch and only if we have variant ids, we call api.
|
|
15
14
|
*/
|
|
16
|
-
export declare const fetchFbStatusCollection: (data: SelectedItems, storeId: string,
|
|
15
|
+
export declare const fetchFbStatusCollection: (data: SelectedItems, storeId: string, dispatcher: any, fbStatusFetcher?: ((storeId: string, variantIds: string[]) => FbStatusFetcherReturn) | undefined, dispatchType?: string) => void;
|
|
17
16
|
/**
|
|
18
17
|
* Instead of collection level, we do it product level.
|
|
19
18
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var o=require("lodash");function l(o,l,t){if(!o)return{};const i=Object.keys(o).slice(t,t+l),n={};return i.forEach((l=>{n[l]=o[l]})),n}const t=(o,l,t)=>{Object.keys(o).forEach((l=>{var t,i;const n=null!==(i=null===(t=o[l])||void 0===t?void 0:t.products)&&void 0!==i?i:{};Object.keys(n).forEach((t=>{var i,n,d,v;const s=null!==(v=null===(d=null===(n=null===(i=o[l])||void 0===i?void 0:i.products)||void 0===n?void 0:n[t])||void 0===d?void 0:d.variants)&&void 0!==v?v:{};Object.keys(s).forEach((i=>{var n,d,v,s;const e=null===(s=null===(v=null===(d=null===(n=o[l])||void 0===n?void 0:n.products)||void 0===d?void 0:d[t])||void 0===v?void 0:v.variants)||void 0===s?void 0:s[i];e&&!e.fbStatus&&(e.fbStatus="APPROVED")}))}))})),l({type:t,data:o})};exports.fetchFbStatusCollection=function(o,l,i,n
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var o=require("lodash");function l(o,l,t){if(!o)return{};const i=Object.keys(o).slice(t,t+l),n={};return i.forEach((l=>{n[l]=o[l]})),n}const t=(o,l,t)=>{Object.keys(o).forEach((l=>{var t,i;const n=null!==(i=null===(t=o[l])||void 0===t?void 0:t.products)&&void 0!==i?i:{};Object.keys(n).forEach((t=>{var i,n,d,v;const s=null!==(v=null===(d=null===(n=null===(i=o[l])||void 0===i?void 0:i.products)||void 0===n?void 0:n[t])||void 0===d?void 0:d.variants)&&void 0!==v?v:{};Object.keys(s).forEach((i=>{var n,d,v,s;const e=null===(s=null===(v=null===(d=null===(n=o[l])||void 0===n?void 0:n.products)||void 0===d?void 0:d[t])||void 0===v?void 0:v.variants)||void 0===s?void 0:s[i];e&&!e.fbStatus&&(e.fbStatus="APPROVED")}))}))})),l({type:t,data:o})};exports.fetchFbStatusCollection=function(o,l,i,n){let d=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"paged";n||t(o,i,d);const v=(o=>{const l=[];return Object.keys(o).forEach((t=>{var i,n;const d=null!==(n=null===(i=o[t])||void 0===i?void 0:i.products)&&void 0!==n?n:{};Object.keys(d).forEach((i=>{var n,d,v,s;const e=null!==(s=null===(v=null===(d=null===(n=o[t])||void 0===n?void 0:n.products)||void 0===d?void 0:d[i])||void 0===v?void 0:v.variants)&&void 0!==s?s:{};Object.keys(e).forEach((n=>{var d,v,s,e;const u=null===(e=null===(s=null===(v=null===(d=o[t])||void 0===d?void 0:d.products)||void 0===v?void 0:v[i])||void 0===s?void 0:s.variants)||void 0===e?void 0:e[n];(null==u?void 0:u.fbStatus)||l.push(n)}))}))})),l})(o);v.length>0&&n&&n(l,v).then((l=>{const t=Object.assign({},o);Object.keys(t).forEach((o=>{var i,n;const d=null!==(n=null===(i=t[o])||void 0===i?void 0:i.products)&&void 0!==n?n:{};Object.keys(d).forEach((i=>{var n,d,v,s;const e=null!==(s=null===(v=null===(d=null===(n=t[o])||void 0===n?void 0:n.products)||void 0===d?void 0:d[i])||void 0===v?void 0:v.variants)&&void 0!==s?s:{};Object.keys(e).forEach((n=>{var d,v,s,e;const u=null===(e=null===(s=null===(v=null===(d=t[o])||void 0===d?void 0:d.products)||void 0===v?void 0:v[i])||void 0===s?void 0:s.variants)||void 0===e?void 0:e[n];u&&"REJECTED"===l[n]?u.fbStatus="REJECTED":u&&"APPROVED"===l[n]&&(u.fbStatus="APPROVED")}))}))})),i({type:d,data:t})})).catch((l=>{console.error("Error in fbStatusFetcher",l),t(o,i,d)}))},exports.getSkuId=(o,l)=>{var t;if(l)return o.skuId;const i=Object.values(null!==(t=null==o?void 0:o.variants)&&void 0!==t?t:{});return 1===i.length&&i[0].name.includes(o.name)?i[0].skuId:""},exports.getVariantIdsToFetchAtProductLevel=(o,l)=>{const t=[];return Object.keys(null!=o?o:{}).forEach((i=>{var n,d;const v=null!==(d=null===(n=null==o?void 0:o[i])||void 0===n?void 0:n.variants)&&void 0!==d?d:{};Object.keys(v).forEach((n=>{var d,v,s,e,u;let r;r=l?null===(s=null===(v=null===(d=null==l?void 0:l.products)||void 0===d?void 0:d[i])||void 0===v?void 0:v.variants)||void 0===s?void 0:s[n]:null===(u=null===(e=null==o?void 0:o[i])||void 0===e?void 0:e.variants)||void 0===u?void 0:u[n],(null==r?void 0:r.fbStatus)||t.push(n)}))})),t},exports.isCollectionPartiallyChecked=function(o,l,t){var i,n,d,v;let s=0,e=0;if(arguments.length>3&&void 0!==arguments[3]&&arguments[3]){const v=null!==(i=null==l?void 0:l.products)&&void 0!==i?i:{};s=Object.keys(v).length;const u=null!==(d=null===(n=t[o])||void 0===n?void 0:n.products)&&void 0!==d?d:{};e=Object.keys(u).length}else if(t[o]){const i=null==l?void 0:l.products;i&&Object.keys(i).forEach((o=>{var l;const t=null===(l=i[o])||void 0===l?void 0:l.variants;t&&Object.keys(t).forEach((o=>s+=1))}));const n=null===(v=t[o])||void 0===v?void 0:v.products;if(n&&Object.keys(n).forEach((o=>{var l;const t=null===(l=n[o])||void 0===l?void 0:l.variants;t&&Object.keys(t).forEach((o=>e+=1))})),s<=0&&e>0)return!1}return e>0&&s!==e},exports.isProductPartiallyChecked=(o,l,t,i,n)=>{var d,v,s,e,u,r,c,a,p,b,O,f,j,h,y,g,k,E,P;let D=0,S=0;if(null===(v=null===(d=null==t?void 0:t[o])||void 0===d?void 0:d.products)||void 0===v?void 0:v[l]){if(n)return!1;const d=(null===(u=null===(e=null===(s=null==t?void 0:t[o])||void 0===s?void 0:s.products)||void 0===e?void 0:e[l])||void 0===u?void 0:u.variants)||[];if(1===Object.keys(d).length)for(const i in d){const n=null===(c=null===(r=null==t?void 0:t[o])||void 0===r?void 0:r.products)||void 0===c?void 0:c[l],d=null===(O=null===(b=null===(p=null===(a=null==t?void 0:t[o])||void 0===a?void 0:a.products)||void 0===p?void 0:p[l])||void 0===b?void 0:b.variants)||void 0===O?void 0:O[i];if(null===(f=null==d?void 0:d.name)||void 0===f?void 0:f.includes(null!==(j=null==n?void 0:n.name)&&void 0!==j?j:""))return!1}if(null===(g=Object.keys((null===(y=null===(h=null==i?void 0:i.products)||void 0===h?void 0:h[l])||void 0===y?void 0:y.variants)||[]))||void 0===g||g.forEach((()=>S++)),Object.keys((null===(P=null===(E=null===(k=null==t?void 0:t[o])||void 0===k?void 0:k.products)||void 0===E?void 0:E[l])||void 0===P?void 0:P.variants)||[]).forEach((()=>D++)),D>0&&S!==D)return!0}return!1},exports.liftTheStateUp=(l,t)=>{const i=o.cloneDeep(t);if(delete i.products,(l=Object.assign(Object.assign({},l),{catalogOnlyData:i})).productId&&t.products){const n=o.cloneDeep(t.products[l.productId]);(null==n?void 0:n.variants)&&delete n.variants,l=Object.assign(Object.assign({},l),{catalogOnlyData:i,productOnlyData:n})}return l},exports.markVariantsAsApprovedProductsLevel=(o,l,t,i,n)=>{const d=Object.assign({},o);if(Object.keys(o).forEach((l=>{var t,i;Object.keys(null!==(i=null===(t=null==o?void 0:o[l])||void 0===t?void 0:t.variants)&&void 0!==i?i:{}).forEach((t=>{var i,n;const v=null===(i=null==o?void 0:o[l].variants)||void 0===i?void 0:i[t];v&&(v.fbStatus="APPROVED");const s=null===(n=null==d?void 0:d[l])||void 0===n?void 0:n.variants;s&&s[t]&&(s[t]=v)}))})),i&&n){const o=Object.assign({},i);o.products=d,n(o),l({type:"productsPaged",data:{collectionId:t,products:d}})}else l({type:"productsPaged",data:{collectionId:t,products:d}})},exports.paginateSelectedItems=function(o,t,i){var n;const d={};let v=0;for(const s in o)if(Object.prototype.hasOwnProperty.call(o,s)){const e=o[s],u=l(e.products,t,i-v);u&&Object.keys(u).length>0&&(d[s]=Object.assign(Object.assign({},e),{products:u})),v+=Object.keys(null!==(n=e.products)&&void 0!==n?n:{}).length}return d},exports.shouldShowVariant=o=>{const l=Object.keys(o.variants||[]);let t=!1;return!(l.length<=1)||(l.forEach((l=>{var i,n;t=null!==(n=null===(i=o.variants)||void 0===i?void 0:i[l].name.includes(o.name))&&void 0!==n&&n})),!t)},exports.updateAllVariantsForSelectedProducts=(l,t,i)=>Object.keys(l).reduce(((n,d)=>{var v;return d in t?(n[d]=Object.assign(Object.assign({},l[d]),{products:Object.keys(null!==(v=l[d].products)&&void 0!==v?v:{}).reduce(((n,v)=>{var s,e,u,r,c,a,p,b,O,f;const j=null===(s=t[d].products)||void 0===s?void 0:s[v],h=null===(r=null===(u=null===(e=null==i?void 0:i.products)||void 0===e?void 0:e[d])||void 0===u?void 0:u.products)||void 0===r?void 0:r[v];return j?n[v]=Object.assign(Object.assign({},(null===(c=l[d].products)||void 0===c?void 0:c[v])||{}),{allVariants:o.cloneDeep(j.variants)}):h?n[v]=Object.assign(Object.assign({},(null===(a=l[d].products)||void 0===a?void 0:a[v])||{}),{allVariants:o.cloneDeep(h.variants)}):(null===(b=null===(p=l[d].products)||void 0===p?void 0:p[v])||void 0===b?void 0:b.allVariants)&&(n[v]=Object.assign(Object.assign({},(null===(O=l[d].products)||void 0===O?void 0:O[v])||{}),{allVariants:o.cloneDeep(null===(f=l[d].products)||void 0===f?void 0:f[v].allVariants)})),n}),{})}),n):n}),{});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),n=require("../../constants/zindex.js"),s=require("../../assets/icons/errorIcon.svg.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),n=require("../../constants/zindex.js"),s=require("../../assets/icons/errorIcon.svg.js"),i=require("../../assets/icons/successIcon.svg.js"),o=require("../../assets/icons/warningIcon.svg.js"),a=require("../modals/styledModal.js"),r=require("../spinner/Spinner.js"),c=require("../states/StateComponent.js");exports.StateModalComponent=d=>{const l=()=>u==c.StateInterface.SUCCESS?e.jsx(i.default,{}):u==c.StateInterface.WARNING?e.jsx(o.default,{}):u==c.StateInterface.ERROR?e.jsx(s.default,{}):u===c.StateInterface.LOADING?e.jsx(r.Spinner,{size:"large"}):void 0,{states:u,heading:I,subline:j,icon:S=l(),isButtonEnabled:g,type:p,buttonText:x,onButtonClick:h,leadingIcon:C,width:f,zIndex:y,headerImage:O,iconHeight:b,iconWidth:m,closeButtonType:q}=d,[B,v]=t.useState(!0);return e.jsx(a.StyledModal,Object.assign({"data-test":d["data-test"],open:B,onClose:function(){d.onClose&&d.onClose(),v(!1)},closeOnOutsideClick:!(u===c.StateInterface.LOADING),centralContainerStyles:{display:"flex",alignItems:"center",justifyContent:"center",width:f},hideCrossButton:u===c.StateInterface.LOADING,zIndex:y||n.ComponentZindex.STATE_MODAL},{children:e.jsx(c.StateComponent,Object.assign({states:u,heading:I,subline:j,isButtonEnabled:g,leadingIcon:C,type:p,buttonText:x,onButtonClick:h,icon:S,width:f||400,headerImage:O,iconHeight:b,iconWidth:m,closeButtonType:q},{children:d.children}))}))};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TagProps } from './model';
|
|
2
2
|
export declare const Tag: {
|
|
3
|
-
({ tagText, LeadingIcon, TrailingIcon, onLeadingIconClicked, leadingIconId, trailingIconId, onTrailingIconClicked, theme, type, variant, version, cursor, alignIcon, noBorder, tagHtmlText, contentPadding,
|
|
3
|
+
({ tagText, LeadingIcon, TrailingIcon, onLeadingIconClicked, leadingIconId, trailingIconId, onTrailingIconClicked, theme, type, variant, version, cursor, alignIcon, noBorder, tagHtmlText, contentPadding, }: TagProps): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
displayName: string;
|
|
5
5
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),i=require("react"),n=require("../
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),i=require("react"),n=require("../TypographyStyle.js"),t=require("./model.js"),a=require("./Tag.styled.js"),r=require("./themes.js");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=s(i);const o=i=>{let{tagText:s,LeadingIcon:o,TrailingIcon:l,onLeadingIconClicked:d,leadingIconId:g,trailingIconId:p,onTrailingIconClicked:j,theme:u="light",type:h="neutral",variant:m="regular",version:y,cursor:b,alignIcon:x,noBorder:T,tagHtmlText:I,contentPadding:O}=i,C=s;const f=u;let v=h;t.ValidTagTypeMap[m][h]||(v="neutral"),"circle"===m&&"number"==typeof C&&C>99&&(C="99+");const q={height:"compressed"===m?12:16,width:"compressed"===m?12:16,color:r.getTagIconColor(u,v),style:{display:"block"}};return e.jsx(a.Tag,Object.assign({cursor:b,theme:f,type:h,variant:m,version:y,alignIcon:x,noBorder:T,contentPadding:O},{children:e.jsxs("div",Object.assign({className:"container"},{children:[o&&e.jsx("button",Object.assign({className:"icon-leading",onClick:d,id:`${g}-wrapper`||"leading-icon-wrapper"},{children:c.default.createElement(o,Object.assign(Object.assign({},q),{id:g||"leading-icon"}))})),I&&("ai"===h&&"light"===u?e.jsx(n.AiBodyCaption,{children:I}):e.jsx(n.BodyCaption,Object.assign({className:"text"},{children:I}))),!I&&""!==C&&("ai"===h&&"light"===u?e.jsx(n.AiBodyCaption,{children:C}):e.jsx(n.BodyCaption,Object.assign({className:"text"},{children:C}))),l&&e.jsx("button",Object.assign({className:"icon-trailing",onClick:j,id:`${p}-wrapper`||"trailing-icon-wrapper"},{children:c.default.createElement(l,Object.assign(Object.assign({},q),{id:p||"trailing-icon"}))}))]}))}))};o.displayName="Tag",exports.Tag=o;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { MouseEventHandler } from 'react';
|
|
3
|
-
import { TooltipProps } from '../tooltips/Tooltip';
|
|
4
3
|
export type TagTheme = 'light' | 'dark';
|
|
5
4
|
export type TagVariant = 'regular' | 'circle' | 'compressed';
|
|
6
5
|
export type TagType = 'negative' | 'warning' | 'positive' | 'neutral' | 'white' | 'purple' | 'blue' | 'grey' | 'ai';
|
|
@@ -63,14 +62,9 @@ export interface TagProps extends React.BaseHTMLAttributes<HTMLDivElement> {
|
|
|
63
62
|
*/
|
|
64
63
|
trailingIconId?: string;
|
|
65
64
|
/**
|
|
66
|
-
* The
|
|
65
|
+
* The left icon on click event, defaults to () => {}
|
|
67
66
|
*/
|
|
68
67
|
onTrailingIconClicked?: MouseEventHandler<HTMLButtonElement>;
|
|
69
|
-
/**
|
|
70
|
-
* Tooltip props for the trailing icon
|
|
71
|
-
* @default undefined
|
|
72
|
-
*/
|
|
73
|
-
trailingIconTooltip?: Omit<TooltipProps, 'children'>;
|
|
74
68
|
/**
|
|
75
69
|
* The icon component that is to the left of the text
|
|
76
70
|
* Referred to https://ozzie.sh/passing-icons-as-props-in-a-consistent-way-using-react
|
|
@@ -86,11 +80,6 @@ export interface TagProps extends React.BaseHTMLAttributes<HTMLDivElement> {
|
|
|
86
80
|
* @default leading-icon
|
|
87
81
|
*/
|
|
88
82
|
leadingIconId?: string;
|
|
89
|
-
/**
|
|
90
|
-
* Tooltip props for the leading icon
|
|
91
|
-
* @default undefined
|
|
92
|
-
*/
|
|
93
|
-
leadingIconTooltip?: Omit<TooltipProps, 'children'>;
|
|
94
83
|
tagText: string | number;
|
|
95
84
|
version?: '1.0' | '2.0';
|
|
96
85
|
cursor?: string;
|
package/dist/cjs/components/template-context-mapper/modalElements/WhatsAppTemplateCardButtonV2.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("lodash"),l=require("react"),s=require("../../dropdown/Dropdown.js"),a=require("../../input/Input.js"),n=require("../../template-preview/constants/regexPatterns.js"),i=require("../../template-preview/models/TemplateMeta.js"),o=require("../../template-preview/models/WhatsAppTemplate.js"),r=require("../../TypographyStyle.js"),u=require("../../../constants/Theme.js"),c=require("../context/templateModalContext.js"),d=require("../utils/constants.js"),b=require("../utils/validateIsUrl.js"),p=require("./VariableConnector.js");exports.default=j=>{let{variableListIndex:v,button:O,updateSelectedURLTemplateBtn:m,updateSelectedQRBTemplateBtn:g,currentVariableList:x,CTAoptions:f,QRBoptions:y,disableEdit:L}=j;var R,U,T,h,C;const[I,V]=l.useState(""),[_,q]=l.useState(),E=null==f?void 0:f.map((e=>Object.assign(Object.assign({},e),{selected:(null==_?void 0:_.value)===e.value
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("lodash"),l=require("react"),s=require("../../dropdown/Dropdown.js"),a=require("../../input/Input.js"),n=require("../../template-preview/constants/regexPatterns.js"),i=require("../../template-preview/models/TemplateMeta.js"),o=require("../../template-preview/models/WhatsAppTemplate.js"),r=require("../../TypographyStyle.js"),u=require("../../../constants/Theme.js"),c=require("../context/templateModalContext.js"),d=require("../utils/constants.js"),b=require("../utils/validateIsUrl.js"),p=require("./VariableConnector.js");exports.default=j=>{let{variableListIndex:v,button:O,updateSelectedURLTemplateBtn:m,updateSelectedQRBTemplateBtn:g,currentVariableList:x,CTAoptions:f,QRBoptions:y,disableEdit:L}=j;var R,U,T,h,C;const[I,V]=l.useState(""),[_,q]=l.useState(),E=null==f?void 0:f.map((e=>Object.assign(Object.assign({},e),{selected:(null==_?void 0:_.value)===e.value}))),P=null==y?void 0:y.map((e=>Object.assign(Object.assign({},e),{selected:(null==_?void 0:_.value)===e.value}))),{isError:w,disableEditVariable:N,pod:S,selectedCarouselIndex:A,originalVariableList:B,setOriginalVariableList:H,isProductCarouselType:M,ctaOptionsErrors:Q,setCtaOptionsErrors:k}=c.useTemplateModalContext();function D(e){if(V(e),null!=A&&A>-1&&M){const l=t.cloneDeep(B);if("URL"===O.type){const t=l.cards.map((t=>{let l=t.buttons.filter((e=>"URL"===e.type))[v];l=Object.assign(Object.assign({},l),{buttonVariable:"((customPlaceholderName))",example:[`https://${e}`]});const s=t.buttons.map((e=>"URL"===e.type&&(null==e?void 0:e.text)===(null==l?void 0:l.text)?l:e));return Object.assign(Object.assign({},t),{buttons:s})}));null==H||H((e=>Object.assign(Object.assign({},e),{cards:t}))),null==m||m(`https://${e}`,"custom",v)}return}let l=x.buttons.filter((e=>"URL"===e.type))[v];l=Object.assign(Object.assign({},l),{buttonVariable:"((customPlaceholderName))",example:[`https://${e}`]});const s=x.buttons.map((e=>"URL"===e.type&&(null==e?void 0:e.text)===(null==l?void 0:l.text)?l:e)),a=Object.assign({},null!=A&&A>-1?B.cards[A]:B);if(a.buttons=s,null!=A&&A>-1){const e=[...B.cards];e[A]=a,null==H||H((t=>Object.assign(Object.assign({},t),{cards:e})))}else null==H||H((e=>Object.assign(Object.assign({},e),{buttons:[...s]})));null==m||m(`https://${e}`,"custom",v)}return l.useEffect((()=>{var e;if(O.buttonVariable&&n.editableVarPattern.test(O.buttonVariable))O.buttonVariable===d.STATIC_URL_VARIABLE_NAME?q(i.STATIC_URL_CTA_OPTION):q(i.CUSTOM_URL_NAME),V((null===(e=O.example)||void 0===e?void 0:e[0].split("https://")[1])||"");else{let e=-1;const t="URL"===O.type?f:y;e="URL"===O.type?t.findIndex((e=>e.placeHolder===O.buttonVariable)):t.findIndex((e=>e.label===O.flowName)),e>-1?q(t[e]):null==k||k((e=>Object.assign(Object.assign({},e),{[v]:"Required field!"})))}}),[]),S!==o.POD.CHATBOT?e.jsxs(p.Container,{children:[e.jsx("div",Object.assign({style:{marginBottom:8}},{children:e.jsxs(r.BodySecondary,Object.assign({style:{color:u.COLORS.content.primary}},{children:[O.text," button"]}))})),e.jsx("div",Object.assign({style:{marginBottom:12}},{children:e.jsx(s.Dropdown,{disabled:N||L,truncatedText:!1,options:"URL"===O.type?"static_link"===(null==_?void 0:_.value)?[i.STATIC_URL_CTA_OPTION]:E:P,isSearchable:!0,onSelect:function(e,l){null==k||k((e=>(delete e[v],Object.assign({},e))));const s=e;q(s);const a=("URL"===O.type?f:y).find((e=>e.placeHolder===s.placeHolder));if(a)if("custom_link"!==a.value){if(null!=A&&A>-1&&M){const e=t.cloneDeep(B);if("URL"===O.type){const t=e.cards.map((e=>{let t=e.buttons.filter((e=>"URL"===e.type))[v];t=Object.assign(Object.assign({},t),{buttonVariable:s.placeHolder});const l=e.buttons.map((e=>"URL"===e.type&&(null==e?void 0:e.text)===(null==t?void 0:t.text)?t:e));return Object.assign(Object.assign({},e),{buttons:l})}));null==m||m({defaultValue:a.value,placeHolder:a.placeHolder},"placeholder",v),null==H||H((e=>Object.assign(Object.assign({},e),{cards:t})))}else if("QUICK_REPLY"===O.type){const t=e.cards.map((e=>{let t=e.buttons.filter((e=>"QUICK_REPLY"===e.type))[v];t=Object.assign(Object.assign({},t),{flowName:s.label,flowId:s.value});const l=e.buttons.map((e=>"QUICK_REPLY"===e.type&&(null==e?void 0:e.text)===(null==t?void 0:t.text)?t:e));return Object.assign(Object.assign({},e),{buttons:l})}));null==g||g({flowName:s.label,flowId:s.value},"placeholder",v),null==H||H((e=>Object.assign(Object.assign({},e),{cards:t})))}return}let e;if("URL"===O.type){let t=x.buttons.filter((e=>"URL"===e.type))[v];t=Object.assign(Object.assign({},t),{buttonVariable:s.placeHolder,example:[(null==s?void 0:s.value)||"https://d.bik.ai/"]}),e=x.buttons.map((e=>"URL"===e.type&&(null==e?void 0:e.text)===(null==t?void 0:t.text)?t:e)),null==m||m({defaultValue:a.value,placeHolder:a.placeHolder},"placeholder",v)}else{let t=x.buttons.filter((e=>"QUICK_REPLY"===e.type))[v];t=Object.assign(Object.assign({},t),{flowName:s.label,flowId:s.value}),e=x.buttons.map((e=>"QUICK_REPLY"===e.type&&(null==e?void 0:e.text)===(null==t?void 0:t.text)?t:e)),null==g||g({flowName:s.label,flowId:s.value},"placeholder",v)}const l=Object.assign({},null!=A&&A>-1?B.cards[A]:B);if(l.buttons=e,null!=A&&A>-1){const e=[...B.cards];e[A]=l,null==H||H((t=>Object.assign(Object.assign({},t),{cards:e})))}else null==H||H((t=>Object.assign(Object.assign({},t),{buttons:[...e]})))}else D("")},defaultOptions:_?[Object.assign(Object.assign({},_),{selected:!0})]:[],error:w?null==Q?void 0:Q[v]:void 0})})),("custom_link"===(null==_?void 0:_.value)||"static_link"===(null==_?void 0:_.value))&&e.jsx("div",Object.assign({style:{marginBottom:20}},{children:e.jsx(a.Input,{state:N||L?"disabled":"none",errorMessage:w?I?b.validateIsUrl(I)?"":"Enter valid URL":"Required field":"",value:I,prefixText:"https://",placeholder:"Enter custom URL here",onChangeText:D,maxCharLimit:2e3})}))]}):e.jsx(p.default,{index:v,variable:{variableName:null!==(R=O.text)&&void 0!==R?R:"",updatedValue:"((customPlaceholderName))"===O.buttonVariable?`${null===(U=O.example)||void 0===U?void 0:U[0]}`:null!==(T=O.buttonVariable)&&void 0!==T?T:"",type:"link",isEditableVariable:!0,index:null!==(h=O.index)&&void 0!==h?h:0,queryParams:null!==(C=O.queryParams)&&void 0!==C?C:[]},showVariableModal:!0,componentType:"BUTTONS",buttonType:O.type,CTAoptions:f})};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { QueryBuilderNodeProps } from "../../../
|
|
2
|
+
import { QueryBuilderNodeProps } from "../../../Types/QueryBuilderNodeProps.type";
|
|
3
3
|
declare const EventsTrigger: React.FC<QueryBuilderNodeProps>;
|
|
4
4
|
export default EventsTrigger;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { QueryBuilderAPIData } from "../../../
|
|
1
|
+
import { QueryBuilderAPIData } from "../../../Types/QueryBuilderAPI.type";
|
|
2
2
|
export declare const useIGTriggerNameCacheSelector: () => QueryBuilderAPIData[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { QueryBuilderNodeProps } from "../../../
|
|
2
|
+
import { QueryBuilderNodeProps } from "../../../Types/QueryBuilderNodeProps.type";
|
|
3
3
|
declare const IGTrigger: React.FC<QueryBuilderNodeProps>;
|
|
4
4
|
export default IGTrigger;
|
package/dist/esm/components/QueryBuilder/Triggers/IG/selectors/useIGTriggerNameCacheSelector.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { QueryBuilderAPIData } from "../../../
|
|
1
|
+
import { QueryBuilderAPIData } from "../../../Types/QueryBuilderAPI.type";
|
|
2
2
|
export declare const useIGTriggerNameCacheSelector: () => QueryBuilderAPIData[];
|
package/dist/esm/components/QueryBuilder/Triggers/components/BaseTriggerQueryBuilderNode.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { DropdownOption } from "../../../dropdown/type";
|
|
3
|
-
import { QueryBuilderProperty } from "../../
|
|
4
|
-
import { QueryBuilderNodeProps } from "../../
|
|
3
|
+
import { QueryBuilderProperty } from "../../Types/QueryBuilder.type";
|
|
4
|
+
import { QueryBuilderNodeProps } from "../../Types/QueryBuilderNodeProps.type";
|
|
5
5
|
declare const BaseTriggerQueryBuilderNode: React.FC<QueryBuilderNodeProps & {
|
|
6
6
|
cacheKey: string;
|
|
7
7
|
propertyAddBtnText: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createSlice as e}from"../../../node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js";import
|
|
1
|
+
import{createSlice as e}from"../../../node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js";import o from"react-native-uuid";import{QueryBuilderJoinOperators as d}from"../types/QueryBuilder.type.js";const t=o.v4,s={nodes:[{_id:t(),properties:[],metas:[]}]},n=o=>e({name:null!=o?o:"queryBuilder",initialState:s,reducers:{clearProperty(e,o){const d=e.nodes.findIndex((e=>e._id===o.payload.nodeID));d>-1&&(e.nodes[d].properties=[])},fillState:(e,o)=>Object.assign({},o.payload),initQueryBuilder(e,o){const s={type:o.payload.type,properties:[],metas:[],_id:t(),PropertyOperator:d.AND};e.nodes=[s],e.operator=d.AND},addNode(e,o){const s={type:o.payload.type,properties:[],metas:[],_id:t(),PropertyOperator:d.AND},n=e.nodes;e.nodes=[...n,s]},deleteNode(e,o){const d=e.nodes.filter((e=>e._id!==o.payload.nodeID));e.nodes=[...d]},clearNode(e,o){var d;const s=[...null!==(d=e.nodes)&&void 0!==d?d:[]];if(0===s.length){const e={type:o.payload.type,properties:[],metas:[],_id:t()};s.push(e)}e.nodes=s},createProperty(e,o){var d;const s=e.nodes.findIndex((e=>e._id===o.payload.nodeID));if(s>-1){const n=null!==(d=e.nodes[s].properties)&&void 0!==d?d:[],a=Object.assign(Object.assign({},o.payload.property),{_id:t()});e.nodes[s].properties=[...n,a]}},updateProperty(e,o){var d;const t=e.nodes.findIndex((e=>e._id===o.payload.nodeID));if(t>-1){const s=(null!==(d=e.nodes[t].properties)&&void 0!==d?d:[]).map((e=>e._id===o.payload.property._id?Object.assign(Object.assign({},e),o.payload.property):e));e.nodes[t].properties=[...s]}},deleteProperty(e,o){var d;const t=e.nodes.findIndex((e=>e._id===o.payload.nodeID));if(t>-1){const s=(null!==(d=e.nodes[t].properties)&&void 0!==d?d:[]).filter((e=>e._id!==o.payload.property._id));e.nodes[t].properties=[...s]}},createMeta(e,o){var d;const t=e.nodes.findIndex((e=>e._id===o.payload.nodeID));if(t>-1){const s=null!==(d=e.nodes[t].metas)&&void 0!==d?d:[],n=Object.assign({},o.payload.meta);e.nodes[t].metas=[...s,n]}},updateMeta(e,o){var d;const t=e.nodes.findIndex((e=>e._id===o.payload.nodeID));if(t>-1){const s=(null!==(d=e.nodes[t].metas)&&void 0!==d?d:[]).map((e=>e.key===o.payload.meta.key?Object.assign(Object.assign({},e),o.payload.meta):e));e.nodes[t].metas=[...s]}},selectPropertyJoinOperator(e,o){const d=e.nodes.findIndex((e=>e._id===o.payload.nodeID));if(-1!==d){const t=e.nodes[d];e.nodes[d]=Object.assign(Object.assign({},t),{PropertyOperator:o.payload.joinOperator})}},selectJoinOperator(e,o){e.operator=o.payload.joinOperator},selectType(e,o){const t=e.nodes.findIndex((e=>e._id===o.payload.nodeID));if(-1!==t){const s=e.nodes[t];e.nodes[t]={_id:s._id,type:o.payload.type,properties:[],metas:[],PropertyOperator:d.AND}}}}});export{n as queryBuilderSlice};
|
|
@@ -11,18 +11,14 @@ export type LineChartProps = {
|
|
|
11
11
|
legend?: string;
|
|
12
12
|
lineWidth?: number;
|
|
13
13
|
squareLegends?: boolean;
|
|
14
|
-
useSecondYAxis?: boolean;
|
|
15
14
|
}[];
|
|
16
15
|
labels: Array<string>;
|
|
17
16
|
scaleText?: {
|
|
18
17
|
x?: string;
|
|
19
18
|
y?: string;
|
|
20
19
|
yPrefix?: string;
|
|
21
|
-
y2?: string;
|
|
22
|
-
y2Prefix?: string;
|
|
23
20
|
xDrawBorder?: boolean;
|
|
24
21
|
yDrawBorder?: boolean;
|
|
25
|
-
y2DrawBorder?: boolean;
|
|
26
22
|
};
|
|
27
23
|
legends: Array<string>;
|
|
28
24
|
stepSize?: number;
|
|
@@ -43,12 +39,5 @@ export type LineChartProps = {
|
|
|
43
39
|
customYHeaders?: any;
|
|
44
40
|
legendsAndIconDirection?: 'row-reverse' | 'row';
|
|
45
41
|
headerIcons?: React.ReactNode[];
|
|
46
|
-
hasSecondYAxis?: boolean;
|
|
47
|
-
min2?: number;
|
|
48
|
-
max2?: number;
|
|
49
|
-
stepSize2?: number;
|
|
50
|
-
prefixCurrencyInY2Axis?: string;
|
|
51
|
-
useKFormat2?: boolean;
|
|
52
|
-
customY2Headers?: any;
|
|
53
42
|
};
|
|
54
43
|
export declare const LineChart: React.FC<LineChartProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t,Fragment as l}from"react/jsx-runtime";import{Chart as
|
|
1
|
+
import{jsxs as e,jsx as t,Fragment as l}from"react/jsx-runtime";import{Chart as n,CategoryScale as o,LinearScale as r,PointElement as i,BarElement as a,LineElement as s,ArcElement as d,Filler as c,Title as u,Tooltip as p,Legend as g}from"chart.js";import{useState as b,useRef as y,useEffect as m}from"react";import{Line as v}from"react-chartjs-2";import{BodyTiny as h}from"../../../TypographyStyle.js";import{COLORS as f}from"../../../../constants/Theme.js";import{truncateValueForInternationalStore as x,truncateValueForIndianStore as k}from"../utils/calcPercentage.js";import{LegendWrapper as C,LegendContainer as j,LegendColor as w}from"./LineChart.styled.js";n.register(o,r,i,a,s,d,c,u,p,g);const O=n=>{let{scaleText:o,labels:r,canvasHeight:i,datas:a,maintainAspectRatio:s=!1,stepSize:d,min:c,max:u,isZeroState:p,tension:g,isNewStyles:O,prefixCurrencyInYAxis:B,pointRadius:S,useKFormat:z,lineThickness:D,ticksLabelCallback:I,labelCallback:T,afterBodyCallBack:$,titleTooltipCallback:A,isInternationalStore:F,customYHeaders:R,headerIcons:q=[],legendsAndIconDirection:L="row"}=n;var P,E,H;const[W,Y]=b(null),Z=y();m((()=>{var e,t,l,n;if(null===(n=null===(l=null===(t=null===(e=Z.current)||void 0===e?void 0:e.scales)||void 0===t?void 0:t.y)||void 0===l?void 0:l.ticks)||void 0===n?void 0:n.length){const e=38*Z.current.scales.y.ticks.length;Y(e)}}),[Z]);const G=a.map((e=>({text:e.legend,color:e.lineColor?e.lineColor:e.dotted?f.content.placeholder:f.background.brand,square:e.squareLegends}))),K={labels:r,datasets:a.map(((e,t)=>{var l,n,o;return Object.assign(Object.assign({tension:null!=g?g:.4,fill:e.gradient?"start":0},((e,t)=>{const l={borderColor:e||(t?f.content.placeholder:f.background.brand)};return O?Object.assign({pointStyle:"circle",pointRadius:S||(r&&r.length>10?2.5:4),pointBorderColor:"transparent",pointBackgroundColor:e||(t?f.content.placeholder:f.background.brand)},l):Object.assign({pointRadius:null!=S?S:1},l)})(e.lineColor,e.dotted)),{borderDash:e.dotted?[8,3]:void 0,data:e.data,borderWidth:null!==(n=null!==(l=e.lineWidth)&&void 0!==l?l:D)&&void 0!==n?n:2,backgroundColor:e.gradient?e=>{const t=e.chart.ctx.createLinearGradient(0,0,0,W?W-75:150);return t.addColorStop(0,"#F1EEFB"),t.addColorStop(1,"rgba(127, 86, 217, 0)"),t}:null!==(o=e.backgroundColor)&&void 0!==o?o:"transparent",legend:e.legend})}))},N={maintainAspectRatio:s,responsive:!0,plugins:{legend:{display:!1},title:{display:!1},tooltip:{displayColors:null!=O&&O,titleFont:()=>({weight:"600",size:14,family:"inter"}),titleColor:()=>f.content.primaryInverse,backgroundColor:f.content.primary,callbacks:{labelTextColor:()=>f.content.primaryInverse,title:A,label:T,afterBody:$},bodyFont:()=>({weight:"400",size:14,family:"inter"})}},scales:{y:{beginAtZero:!0,min:p?0:c,max:p?10:u,ticks:{color:f.content.secondary,callback:e=>{var t,l;return z?`${null!==(t=null==o?void 0:o.yPrefix)&&void 0!==t?t:""}${F?x(e):k(e)}${null!=B?B:""}`:R&&Object.keys(R).length>0?R[e]:`${null!==(l=null==o?void 0:o.yPrefix)&&void 0!==l?l:""}${e}${null!=B?B:""}`},font:{family:"inter",size:12,weight:"400"},stepSize:p?1:d,padding:O?24:0},title:{display:!!(null==o?void 0:o.y),text:null==o?void 0:o.y},grid:{color:f.background.base,drawBorder:null===(P=null==o?void 0:o.yDrawBorder)||void 0===P||P}},x:{ticks:{callback:I,color:f.content.secondary,font:{family:"inter",size:12,weight:"400"}},title:{display:!!(null==o?void 0:o.x),text:null==o?void 0:o.x},grid:{display:!1,drawBorder:null!==(E=null==o?void 0:o.xDrawBorder)&&void 0!==E&&E}}}};return e("div",Object.assign({style:Object.assign(Object.assign({},s?{}:{height:null!==(H=null!=i?i:W)&&void 0!==H?H:204}),{display:"flex",flexDirection:"column",gap:2,width:"100%"})},{children:[e("div",Object.assign({style:{display:"flex",justifyContent:"space-between",width:"100%",flexDirection:L}},{children:[t(C,{children:q.map(((e,l)=>t(j,{children:e},l)))}),t(C,{children:G.map(((n,o)=>{let{text:r,color:i,square:a}=n;return r?e(j,{children:[t(w,{color:i,square:a,newStyle:O}),t(h,Object.assign({color:"#667085"},{children:r}))]},o):t(l,{})}))})]})),t("div",Object.assign({style:{flex:1}},{children:t(v,{ref:Z,options:N,data:K})}))]}))};export{O as LineChart};
|