@bikdotai/bik-component-library 0.0.201-beta-inbox-v3-21 → 0.0.201
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/components/Connectors/Components/InTheLast.js +1 -1
- package/dist/cjs/components/QueryBuilder/redux/queryBuilder.reducer.js +1 -1
- package/dist/cjs/components/accordion/Accordion.d.ts +2 -6
- package/dist/cjs/components/accordion/Accordion.js +1 -1
- package/dist/cjs/components/accordion/Accordion.style.d.ts +0 -2
- package/dist/cjs/components/accordion/Accordion.style.js +4 -8
- package/dist/cjs/components/accordion/AccordionArrow.d.ts +2 -5
- package/dist/cjs/components/accordion/AccordionArrow.js +1 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js +1 -1
- package/dist/cjs/components/avatar/Avatar.js +1 -1
- package/dist/cjs/components/avatar/Avatar.styled.d.ts +1 -2
- package/dist/cjs/components/avatar/Avatar.styled.js +3 -3
- package/dist/cjs/components/avatar/index.d.ts +0 -1
- package/dist/cjs/components/bik-layout/CommonStyles.js +1 -1
- package/dist/cjs/components/bik-layout/MockMenus.d.ts +0 -1
- package/dist/cjs/components/carousel-secondary/CarouselSecondary.js +1 -1
- package/dist/cjs/components/checkBox/CheckBox.d.ts +0 -2
- package/dist/cjs/components/checkBox/CheckBox.js +1 -1
- package/dist/cjs/components/checkBox/CheckBox.styled.d.ts +0 -1
- package/dist/cjs/components/checkBox/CheckBox.styled.js +12 -13
- package/dist/cjs/components/country-code-picker/CountryCodePicker.d.ts +0 -1
- package/dist/cjs/components/country-code-picker/CountryCodePicker.js +1 -1
- package/dist/cjs/components/custom-date-time/CustomDateTime.js +1 -1
- 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/Common.styled.d.ts +1 -3
- package/dist/cjs/components/dropdown/Common.styled.js +4 -4
- package/dist/cjs/components/dropdown/DropdownPopover/index.js +1 -1
- package/dist/cjs/components/dropdown/MenuItem/MenuItem.js +2 -2
- package/dist/cjs/components/dropdown/OpenedDropdown/components/OpennedDropdown.js +1 -1
- package/dist/cjs/components/dropdown/OpenedDropdown/components/OpennedDropdown.styled.d.ts +1 -3
- package/dist/cjs/components/dropdown/OpenedDropdown/components/OpennedDropdown.styled.js +24 -10
- package/dist/cjs/components/dropdown/OpenedDropdown/components/description/Description.d.ts +0 -1
- package/dist/cjs/components/dropdown/OpenedDropdown/components/description/Description.js +1 -1
- package/dist/cjs/components/dropdown/OpenedDropdown/components/description/Description.styled.d.ts +1 -3
- package/dist/cjs/components/dropdown/OpenedDropdown/components/description/Description.styled.js +1 -2
- package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/FreeFormMenu.d.ts +0 -1
- package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/FreeFormMenu.js +1 -1
- package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuItem.d.ts +0 -1
- package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuItem.js +3 -4
- package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuList.d.ts +0 -1
- package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuList.js +1 -1
- package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuList.styled.d.ts +0 -2
- package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuList.styled.js +4 -5
- package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/SelectAllMenu.d.ts +0 -1
- package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/SelectAllMenu.js +1 -1
- package/dist/cjs/components/dropdown/OpenedDropdown/components/searchbox/SearchBox.d.ts +0 -1
- package/dist/cjs/components/dropdown/OpenedDropdown/components/searchbox/SearchBox.js +1 -1
- package/dist/cjs/components/dropdown/OpenedDropdown/components/searchbox/SearchZeroState.d.ts +0 -1
- package/dist/cjs/components/dropdown/OpenedDropdown/components/searchbox/SearchZeroState.js +1 -1
- package/dist/cjs/components/dropdown/type.d.ts +1 -3
- package/dist/cjs/components/fab-menu/FABMenu.d.ts +0 -1
- package/dist/cjs/components/fab-menu/FABMenu.js +1 -1
- package/dist/cjs/components/input/Input.d.ts +0 -1
- package/dist/cjs/components/input/Input.js +1 -1
- package/dist/cjs/components/list-item/ListItem.d.ts +0 -1
- package/dist/cjs/components/list-item/ListItem.js +1 -1
- package/dist/cjs/components/list-item/ListItem.styled.d.ts +0 -1
- package/dist/cjs/components/list-item/ListItem.styled.js +1 -1
- package/dist/cjs/components/list-item/themes.d.ts +1 -1
- package/dist/cjs/components/list-item/themes.js +1 -1
- package/dist/cjs/components/product-picker-v2/collectionScreen.js +1 -1
- package/dist/cjs/components/product-picker-v2/modal.js +1 -1
- package/dist/cjs/components/product-picker-v2/style.js +0 -1
- package/dist/cjs/components/radioButton/RadioButton.d.ts +0 -2
- package/dist/cjs/components/radioButton/RadioButton.js +1 -1
- package/dist/cjs/components/radioButton/RadioButton.styled.d.ts +0 -1
- package/dist/cjs/components/radioButton/RadioButton.styled.js +7 -8
- package/dist/cjs/components/states/StateComponent.d.ts +0 -1
- package/dist/cjs/components/states/StateComponent.js +1 -1
- package/dist/cjs/components/states/StateComponent.styled.d.ts +2 -6
- package/dist/cjs/components/states/StateComponent.styled.js +6 -9
- package/dist/cjs/components/stepper/WorkingStepper.d.ts +0 -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/Tag.styled.d.ts +0 -2
- package/dist/cjs/components/tag/Tag.styled.js +1 -1
- package/dist/cjs/components/tag/model.d.ts +0 -2
- package/dist/cjs/index.d.ts +0 -2
- package/dist/cjs/index.js +1 -1
- package/dist/esm/components/QueryBuilder/components/Connectors/Components/InTheLast.js +1 -1
- package/dist/esm/components/QueryBuilder/redux/queryBuilder.reducer.js +1 -1
- package/dist/esm/components/accordion/Accordion.d.ts +2 -6
- package/dist/esm/components/accordion/Accordion.js +1 -1
- package/dist/esm/components/accordion/Accordion.style.d.ts +0 -2
- package/dist/esm/components/accordion/Accordion.style.js +4 -8
- package/dist/esm/components/accordion/AccordionArrow.d.ts +2 -5
- package/dist/esm/components/accordion/AccordionArrow.js +1 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js +1 -1
- package/dist/esm/components/avatar/Avatar.js +1 -1
- package/dist/esm/components/avatar/Avatar.styled.d.ts +1 -2
- package/dist/esm/components/avatar/Avatar.styled.js +3 -3
- package/dist/esm/components/avatar/index.d.ts +0 -1
- package/dist/esm/components/bik-layout/CommonStyles.js +1 -1
- package/dist/esm/components/bik-layout/MockMenus.d.ts +0 -1
- package/dist/esm/components/carousel-secondary/CarouselSecondary.js +1 -1
- package/dist/esm/components/checkBox/CheckBox.d.ts +0 -2
- package/dist/esm/components/checkBox/CheckBox.js +1 -1
- package/dist/esm/components/checkBox/CheckBox.styled.d.ts +0 -1
- package/dist/esm/components/checkBox/CheckBox.styled.js +6 -7
- package/dist/esm/components/country-code-picker/CountryCodePicker.d.ts +0 -1
- package/dist/esm/components/country-code-picker/CountryCodePicker.js +1 -1
- package/dist/esm/components/custom-date-time/CustomDateTime.js +1 -1
- 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/Common.styled.d.ts +1 -3
- package/dist/esm/components/dropdown/Common.styled.js +6 -6
- package/dist/esm/components/dropdown/DropdownPopover/index.js +1 -1
- package/dist/esm/components/dropdown/MenuItem/MenuItem.js +2 -2
- package/dist/esm/components/dropdown/OpenedDropdown/components/OpennedDropdown.js +1 -1
- package/dist/esm/components/dropdown/OpenedDropdown/components/OpennedDropdown.styled.d.ts +1 -3
- package/dist/esm/components/dropdown/OpenedDropdown/components/OpennedDropdown.styled.js +24 -10
- package/dist/esm/components/dropdown/OpenedDropdown/components/description/Description.d.ts +0 -1
- package/dist/esm/components/dropdown/OpenedDropdown/components/description/Description.js +1 -1
- package/dist/esm/components/dropdown/OpenedDropdown/components/description/Description.styled.d.ts +1 -3
- package/dist/esm/components/dropdown/OpenedDropdown/components/description/Description.styled.js +1 -2
- package/dist/esm/components/dropdown/OpenedDropdown/components/menu/FreeFormMenu.d.ts +0 -1
- package/dist/esm/components/dropdown/OpenedDropdown/components/menu/FreeFormMenu.js +1 -1
- package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuItem.d.ts +0 -1
- package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuItem.js +3 -4
- package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuList.d.ts +0 -1
- package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuList.js +1 -1
- package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuList.styled.d.ts +0 -2
- package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuList.styled.js +5 -6
- package/dist/esm/components/dropdown/OpenedDropdown/components/menu/SelectAllMenu.d.ts +0 -1
- package/dist/esm/components/dropdown/OpenedDropdown/components/menu/SelectAllMenu.js +1 -1
- package/dist/esm/components/dropdown/OpenedDropdown/components/searchbox/SearchBox.d.ts +0 -1
- package/dist/esm/components/dropdown/OpenedDropdown/components/searchbox/SearchBox.js +1 -1
- package/dist/esm/components/dropdown/OpenedDropdown/components/searchbox/SearchZeroState.d.ts +0 -1
- package/dist/esm/components/dropdown/OpenedDropdown/components/searchbox/SearchZeroState.js +1 -1
- package/dist/esm/components/dropdown/type.d.ts +1 -3
- package/dist/esm/components/fab-menu/FABMenu.d.ts +0 -1
- package/dist/esm/components/fab-menu/FABMenu.js +1 -1
- package/dist/esm/components/input/Input.d.ts +0 -1
- package/dist/esm/components/input/Input.js +1 -1
- package/dist/esm/components/list-item/ListItem.d.ts +0 -1
- package/dist/esm/components/list-item/ListItem.js +1 -1
- package/dist/esm/components/list-item/ListItem.styled.d.ts +0 -1
- package/dist/esm/components/list-item/ListItem.styled.js +1 -1
- package/dist/esm/components/list-item/themes.d.ts +1 -1
- package/dist/esm/components/list-item/themes.js +1 -1
- package/dist/esm/components/product-picker-v2/collectionScreen.js +1 -1
- package/dist/esm/components/product-picker-v2/modal.js +1 -1
- package/dist/esm/components/product-picker-v2/style.js +0 -1
- package/dist/esm/components/radioButton/RadioButton.d.ts +0 -2
- package/dist/esm/components/radioButton/RadioButton.js +1 -1
- package/dist/esm/components/radioButton/RadioButton.styled.d.ts +0 -1
- package/dist/esm/components/radioButton/RadioButton.styled.js +7 -8
- package/dist/esm/components/states/StateComponent.d.ts +0 -1
- package/dist/esm/components/states/StateComponent.js +1 -1
- package/dist/esm/components/states/StateComponent.styled.d.ts +2 -6
- package/dist/esm/components/states/StateComponent.styled.js +6 -9
- package/dist/esm/components/stepper/WorkingStepper.d.ts +0 -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/Tag.styled.d.ts +0 -2
- package/dist/esm/components/tag/Tag.styled.js +1 -1
- package/dist/esm/components/tag/model.d.ts +0 -2
- package/dist/esm/index.d.ts +0 -2
- package/dist/esm/index.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/components/dropdown-button/DropdownButton.d.ts +0 -9
- package/dist/cjs/components/dropdown-button/DropdownButton.js +0 -1
- package/dist/cjs/components/dropdown-button/DropdownButton.style.d.ts +0 -5
- package/dist/cjs/components/dropdown-button/DropdownButton.style.js +0 -9
- package/dist/cjs/components/dropdown-button/index.d.ts +0 -1
- package/dist/esm/components/dropdown-button/DropdownButton.d.ts +0 -9
- package/dist/esm/components/dropdown-button/DropdownButton.js +0 -1
- package/dist/esm/components/dropdown-button/DropdownButton.style.d.ts +0 -5
- package/dist/esm/components/dropdown-button/DropdownButton.style.js +0 -9
- package/dist/esm/components/dropdown-button/index.d.ts +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as t,jsx as e}from"react/jsx-runtime";import r from"../../assets/icons/chevronLeft.svg.js";import
|
|
1
|
+
import{jsxs as t,jsx as e}from"react/jsx-runtime";import r from"../../assets/icons/chevronLeft.svg.js";import o from"../../assets/icons/chevronRight.svg.js";import{useState as n,useRef as i,useEffect as s}from"react";import{Button as c}from"../button/Button.js";import{CarouselContainer as l,CarouselBody as a,CarouselPage as m,CarouselFooter as u,PageIndicator as h,Indicator as d}from"./CarouselSecondary.style.js";const g=g=>{let{pages:p,onComplete:f,textAlign:b}=g;const[y,j]=n(0),v=i(null);return s((()=>{v.current&&v.current.scrollTo({left:v.current.offsetWidth*y,behavior:"smooth"})}),[y]),t(l,{children:[e(a,Object.assign({ref:v,textAlign:b},{children:p.map(((t,r)=>e(m,Object.assign({isActive:r===y},{children:t}),r)))})),t(u,{children:[e(c,{buttonText:"Back",buttonType:"tertiaryGray",onClick:()=>{j((t=>0===t?t:t-1))},size:"medium",LeadingIcon:r,disabled:!y}),e(h,{children:p.map(((t,r)=>e(d,{isActive:r===y,onClick:()=>{j(r)}},r)))}),e(c,{buttonText:y===p.length-1?"Get started":"Next",buttonType:"tertiaryGray",onClick:()=>{j((t=>t===p.length-1?t:t+1)),y===p.length-1&&f()},size:"medium",TrailingIcon:o})]})]})};export{g as CarouselSecondary};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as
|
|
1
|
+
import{jsxs as e,jsx as i}from"react/jsx-runtime";import{useState as s,useEffect as l}from"react";import{CheckboxContainer as t,CheckboxIcon as o}from"./CheckBox.styled.js";import{BodyPrimary as a}from"../TypographyStyle.js";import{COLORS as r}from"../../constants/Theme.js";const n=s=>e("svg",Object.assign({width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:[i("rect",{x:"0",y:"0",width:"18",height:"18",rx:"4",fill:s.isDisabled?r.content.inactive:r.background.positive.vibrant}),!s.isPartial&&i("svg",Object.assign({width:"10",height:"9",x:"4",y:"4",viewBox:"0 0 10 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:i("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.68189 1.06043C10.0724 1.45096 10.0724 2.08412 9.68189 2.47464L4.02501 8.13152C3.63449 8.52205 3.00132 8.52205 2.6108 8.13152L0.489684 6.01041C0.0991601 5.61988 0.0991598 4.98672 0.489684 4.59619C0.880209 4.20567 1.51337 4.20567 1.9039 4.59619L3.31791 6.0102L8.26768 1.06043C8.6582 0.669907 9.29137 0.669907 9.68189 1.06043Z",fill:"white"})})),s.isPartial&&i("rect",{x:"5",y:"8",width:"8",height:"2",rx:"1",fill:r.surface.standard})]})),d=d=>{var c;const[h,b]=s(d.isChecked||!1),[g,v]=s(d.isDisabled||!1),[w,m]=s(!1),[p,u]=s(!1);return l((()=>{b(d.isChecked)}),[d.isChecked]),l((()=>{v(d.isDisabled||!1)}),[d.isDisabled]),e(t,Object.assign({onClick:()=>{var e;if(!d.isDisabled){const i=!h;b(i),null===(e=d.onValueChange)||void 0===e||e.call(d,i,d.value)}},onMouseEnter:()=>m(!0),onMouseLeave:()=>m(!1),onMouseDown:()=>u(!0),onMouseUp:()=>u(!1)},{children:[i(o,Object.assign({checked:h,hovered:w,clicked:p,isDisabled:g},{children:h&&i(n,{isPartial:null!==(c=d.isPartiallyChecked)&&void 0!==c&&c,isDisabled:g})})),d.label&&i(a,Object.assign({color:d.isDisabled?r.text.disabled:r.text.primary},{children:d.label}))]}))};export{d as CheckBox};
|
|
@@ -3,9 +3,9 @@ import e,{css as i}from"styled-components";import{COLORS as o}from"../../constan
|
|
|
3
3
|
gap: 8px;
|
|
4
4
|
align-items: center;
|
|
5
5
|
cursor: pointer;
|
|
6
|
-
`,
|
|
7
|
-
width:
|
|
8
|
-
height:
|
|
6
|
+
`,r=e.div`
|
|
7
|
+
width: 14px;
|
|
8
|
+
height: 14px;
|
|
9
9
|
border-radius: 4px;
|
|
10
10
|
border: 2px solid black;
|
|
11
11
|
display: flex;
|
|
@@ -13,10 +13,9 @@ import e,{css as i}from"styled-components";import{COLORS as o}from"../../constan
|
|
|
13
13
|
align-items: center;
|
|
14
14
|
box-sizing: content-box;
|
|
15
15
|
${e=>e.isDisabled?i`
|
|
16
|
-
border: ${
|
|
17
|
-
${o.content.inactive};
|
|
16
|
+
border: 2px solid ${o.content.inactive};
|
|
18
17
|
`:i`
|
|
19
|
-
border:
|
|
18
|
+
border: 2px solid black;
|
|
20
19
|
`}
|
|
21
20
|
${e=>e.checked&&i`
|
|
22
21
|
border: 0px;
|
|
@@ -31,4 +30,4 @@ import e,{css as i}from"styled-components";import{COLORS as o}from"../../constan
|
|
|
31
30
|
${e.checked?o.stroke.positive.lightAlt:o.surface.hovered};
|
|
32
31
|
outline-offset: 2px;
|
|
33
32
|
`}
|
|
34
|
-
`;export{t as CheckboxContainer,
|
|
33
|
+
`;export{t as CheckboxContainer,r as CheckboxIcon};
|
|
@@ -2,7 +2,6 @@ import { Placement, PositioningStrategy } from '@popperjs/core';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { CountryCode } from "./CountryCodePicker.modal";
|
|
4
4
|
export declare const CountryCodePicker: React.FC<{
|
|
5
|
-
version: '1.0' | '2.0';
|
|
6
5
|
onCountrySelect: (country: CountryCode) => void;
|
|
7
6
|
selectedCountry: CountryCode;
|
|
8
7
|
popoverWidth?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as o,jsxs as e}from"react/jsx-runtime";import t from"../../assets/icons/chevronDown.svg.js";import{useState as n,useEffect as r}from"react";import{CountriesData as d}from"./CountryCodePicker.modal.js";import{StyledCountryPickerWrapper as s,StyledCountryPickerOption as
|
|
1
|
+
import{jsx as o,jsxs as e}from"react/jsx-runtime";import t from"../../assets/icons/chevronDown.svg.js";import{useState as n,useEffect as r}from"react";import{CountriesData as d}from"./CountryCodePicker.modal.js";import{StyledCountryPickerWrapper as s,StyledCountryPickerOption as p}from"./CountryCodePicker.styled.js";import"../dropdown/Dropdown.js";import{DropdownPopover as i}from"../dropdown/DropdownPopover/index.js";import"../zeroState/ZeroState.js";import{BodySecondary as c}from"../TypographyStyle.js";import{COLORS as m}from"../../constants/Theme.js";import"../dropdown/OpenedDropdown/components/description/Description.styled.js";import"../checkBox/CheckBox.styled.js";import"../list-item/ListItem.js";import"../dropdown/OpenedDropdown/components/menu/FreeFormMenu.styled.js";import"../dropdown/OpenedDropdown/components/menu/MenuItem.js";import"../dropdown/OpenedDropdown/components/menu/MenuList.styled.js";import"../dropdown/OpenedDropdown/components/menu/SelectAllMenu.js";import"../button/Button.js";import"../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js";import"../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js";import"../input/Input.js";import"../dropdown/MenuItem/MenuItem.js";const l=l=>{var a,u,w,h,j,y;const[v,g]=n(null!==(a=l.selectedCountry)&&void 0!==a?a:{name:"India",dial:"+91",code:"IN"}),f=`https://flagcdn.com/${null===(u=v.code)||void 0===u?void 0:u.toLowerCase()}.svg`;r((()=>{l.selectedCountry&&g(l.selectedCountry)}),[null===(w=l.selectedCountry)||void 0===w?void 0:w.code]);return o(i,Object.assign({isSearchable:!0,width:null!==(h=l.popoverWidth)&&void 0!==h?h:"200px",placement:null!==(j=l.placement)&&void 0!==j?j:"bottom-start",strategy:null!==(y=l.placementStrategy)&&void 0!==y?y:"absolute",options:d.map((t=>{var n;const r=`https://flagcdn.com/${null===(n=t.code)||void 0===n?void 0:n.toLowerCase()}.svg`;return{value:t.code,label:t.dial,searchKey:t.name,customComponent:e(p,{children:[o("img",{src:r,className:"country-flag__option",alt:t.name}),e(c,{children:[t.code," ",t.dial]})]}),selected:v.code===t.code}})),onSelect:o=>{const e=d.filter((e=>e.code===o.value));g(e[0]),l.onCountrySelect(e[0])}},{children:e(s,Object.assign({height:l.height},{children:[e("div",Object.assign({className:"content__wrapper"},{children:[o("img",{src:f,className:"country-flag__selected-option",alt:v.name}),o(c,{children:v.dial})]})),o(t,{width:24,height:24,color:m.content.primary})]}))}))};export{l as CountryCodePicker};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as o}from"react/jsx-runtime";import{format as t,isToday as r}from"date-fns";import{useState as n,useEffect as s}from"react";import i from"./DateSelector/DateSelector.js";import"../dropdown/Dropdown.js";import{DropdownPopover as m}from"../dropdown/DropdownPopover/index.js";import"../zeroState/ZeroState.js";import{BodySecondary as p}from"../TypographyStyle.js";import"../../constants/Theme.js";import"../dropdown/OpenedDropdown/components/description/Description.styled.js";import"../checkBox/CheckBox.styled.js";import"../list-item/ListItem.js";import"../dropdown/OpenedDropdown/components/menu/FreeFormMenu.styled.js";import"../dropdown/OpenedDropdown/components/menu/MenuItem.js";import"../dropdown/OpenedDropdown/components/menu/MenuList.styled.js";import"../button/Button.js";import"../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js";import"../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js";import{Input as d}from"../input/Input.js";import"../dropdown/MenuItem/MenuItem.js";import l from"../../utils/DateUtils.js";import c from"../../assets/icons/chevronDown.svg.js";import a from"../../assets/icons/clock.svg.js";import{CustomDateTimeStyle as u}from"./CustomDateTime.styled.js";const j=()=>{const e=[];for(let o=0;o<2;o++)for(let t=0;t<12;t++){let r;r=0===t?"12":t<10?`0${t}`:`${t}`;const n=`${r}:00 ${0===o?"AM":"PM"}`,s=`${r}:30 ${0===o?"AM":"PM"}`;e.push({label:n,value:n,selected:!1},{label:s,value:s,selected:!1})}return e},w=w=>{const[D,f]=n(w.time),[h,v]=n(w.date);s((()=>{w.setError(void 0);const e=l.convert12HourTimeTo24Hour(D),o=t(new Date,"HH:mm:ss");if(r(h)&&e<o)return void w.setError("Selected time should be later than current time");w.setError(void 0);const[n,s]=e.split(":"),i=new Date(h.getTime());i.setHours(+n,+s),w.onChange(i)}),[h,D]);return e(u,{children:[e("div",Object.assign({style:{display:"flex",gap:16}},{children:[o("div",Object.assign({style:{flex:1}},{children:o(i,{customDate:h,setCustomDate:v,placement:w.placement,minDate:w.minDate})})),o("div",Object.assign({style:{flex:1}},{children:o(m,Object.assign({options:j(),onSelect:e=>{f(e.value)}},{children:o(d,{value:D,leftIcon:{icon:a},rightIcon:{icon:c},onChangeText:e=>(e=>{if(l.timeFormatValidation(e)){const o=l.convert12HourTimeTo24Hour(e),n=t(new Date,"HH:mm:ss");if(r(h)&&o<n)return void w.setError("Selected time should be later than current time");w.setError(void 0),f(e)}else w.setError('Format of time should be "HH:MM AM" or "HH:MM PM"')})(e)})}))}))]})),w.error&&o(p,Object.assign({style:{paddingTop:8}},{children:w.error}))]})};export{w as CustomDateTime};
|
|
1
|
+
import{jsxs as e,jsx as o}from"react/jsx-runtime";import{format as t,isToday as r}from"date-fns";import{useState as n,useEffect as s}from"react";import i from"./DateSelector/DateSelector.js";import"../dropdown/Dropdown.js";import{DropdownPopover as m}from"../dropdown/DropdownPopover/index.js";import"../zeroState/ZeroState.js";import{BodySecondary as p}from"../TypographyStyle.js";import"../../constants/Theme.js";import"../dropdown/OpenedDropdown/components/description/Description.styled.js";import"../checkBox/CheckBox.styled.js";import"../list-item/ListItem.js";import"../dropdown/OpenedDropdown/components/menu/FreeFormMenu.styled.js";import"../dropdown/OpenedDropdown/components/menu/MenuItem.js";import"../dropdown/OpenedDropdown/components/menu/MenuList.styled.js";import"../dropdown/OpenedDropdown/components/menu/SelectAllMenu.js";import"../button/Button.js";import"../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js";import"../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js";import{Input as d}from"../input/Input.js";import"../dropdown/MenuItem/MenuItem.js";import l from"../../utils/DateUtils.js";import c from"../../assets/icons/chevronDown.svg.js";import a from"../../assets/icons/clock.svg.js";import{CustomDateTimeStyle as u}from"./CustomDateTime.styled.js";const j=()=>{const e=[];for(let o=0;o<2;o++)for(let t=0;t<12;t++){let r;r=0===t?"12":t<10?`0${t}`:`${t}`;const n=`${r}:00 ${0===o?"AM":"PM"}`,s=`${r}:30 ${0===o?"AM":"PM"}`;e.push({label:n,value:n,selected:!1},{label:s,value:s,selected:!1})}return e},w=w=>{const[D,f]=n(w.time),[h,v]=n(w.date);s((()=>{w.setError(void 0);const e=l.convert12HourTimeTo24Hour(D),o=t(new Date,"HH:mm:ss");if(r(h)&&e<o)return void w.setError("Selected time should be later than current time");w.setError(void 0);const[n,s]=e.split(":"),i=new Date(h.getTime());i.setHours(+n,+s),w.onChange(i)}),[h,D]);return e(u,{children:[e("div",Object.assign({style:{display:"flex",gap:16}},{children:[o("div",Object.assign({style:{flex:1}},{children:o(i,{customDate:h,setCustomDate:v,placement:w.placement,minDate:w.minDate})})),o("div",Object.assign({style:{flex:1}},{children:o(m,Object.assign({options:j(),onSelect:e=>{f(e.value)}},{children:o(d,{value:D,leftIcon:{icon:a},rightIcon:{icon:c},onChangeText:e=>(e=>{if(l.timeFormatValidation(e)){const o=l.convert12HourTimeTo24Hour(e),n=t(new Date,"HH:mm:ss");if(r(h)&&o<n)return void w.setError("Selected time should be later than current time");w.setError(void 0),f(e)}else w.setError('Format of time should be "HH:MM AM" or "HH:MM PM"')})(e)})}))}))]})),w.error&&o(p,Object.assign({style:{paddingTop:8}},{children:w.error}))]})};export{w as CustomDateTime};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as t,jsx as e,Fragment as o}from"react/jsx-runtime";import{useState as i,useEffect as n}from"react";import{MIN_PURCHASE_REQUIREMENT as r,DISCOUNT_TARGET_TYPES as d,DISCOUNT_TYPES as s,DISCOUNT_TARGET_SELECTION as a,DISCOUNT_VALUE_TYPES as c}from"./type.js";import{Dropdown as l}from"../dropdown/Dropdown.js";import"../dropdown/DropdownPopover/index.js";import"../zeroState/ZeroState.js";import{TitleSmall as p,BodyCaption as u}from"../TypographyStyle.js";import{DEFAULT_THEME as m}from"../../constants/Theme.js";import"../dropdown/OpenedDropdown/components/description/Description.styled.js";import"../checkBox/CheckBox.styled.js";import"../list-item/ListItem.js";import"../dropdown/OpenedDropdown/components/menu/FreeFormMenu.styled.js";import"../dropdown/OpenedDropdown/components/menu/MenuItem.js";import"../dropdown/OpenedDropdown/components/menu/MenuList.styled.js";import"../button/Button.js";import"../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js";import"../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js";import"../input/Input.js";import"../dropdown/MenuItem/MenuItem.js";import{StyledModal as b}from"../modals/styledModal.js";import{ProductPickerContent as y}from"../product-picker/ProductPickerModal.js";import{Tag as E}from"../tag/Tag.js";import{Tooltip as v}from"../tooltips/Tooltip.js";import P from"../../assets/icons/triangle_error.svg.js";import{StyledDiscountDialogueContainer as T,CouponTypeContainerStyled as g}from"./DiscountModal.styled.js";import{validateDiscountData as I}from"./DiscountUtils.js";import j,{DISCOUNT_PRODUCTS as C}from"./DynamicCoupon/DynamicCoupon.js";import h from"./StaticCoupon/StaticCoupon.js";const S=S=>{var O,D,N,_;const[w,f]=i(),[A,q]=i(null!==(O=S.data)&&void 0!==O?O:{}),[G,M]=i(((null===(D=S.data)||void 0===D?void 0:D.isStaticCoupon)||S.allowStaticCoupon)&&!(null===(N=S.data)||void 0===N?void 0:N.targetSelection)),[L,x]=i(!0),[R,k]=i(),[F,B]=i(r.NA),[U,X]=i([]),[Y,H]=i([]),[Q,V]=i(0);n((()=>{let t;S.hideProbability||(t=$()),x(I(A,F,R,S.hideProbability||!1,t,G)),S.hideProbability||$()}),[]),n((()=>{let t;S.hideProbability||(t=$()),x(I(A,F,R,S.hideProbability||!1,t,G))}),[G,A,Q,R,F]),n((()=>{var t,e;if(S.products){if(null===(t=S.data)||void 0===t?void 0:t.entitledProductIds){const t=S.products.filter((t=>{var e,o;return null===(o=null===(e=S.data)||void 0===e?void 0:e.entitledProductIds)||void 0===o?void 0:o.includes(parseInt(t.id))}));H(t)}if(null===(e=S.data)||void 0===e?void 0:e.prerequisiteProductIds){const t=S.products.filter((t=>{var e,o;return null===(o=null===(e=S.data)||void 0===e?void 0:e.prerequisiteProductIds)||void 0===o?void 0:o.includes(parseInt(t.id))}));X(t)}}}),[]),n((()=>{const t=Y.map((t=>parseInt(t.id)));q(Object.assign(Object.assign({},A),{entitledProductIds:t}))}),[Y]),n((()=>{const t=U.map((t=>parseInt(t.id)));q(Object.assign(Object.assign({},A),{prerequisiteProductIds:t}))}),[U]),n((()=>{A.targetType===d.SHIPPING_LINE?k(s.FREE_SHIPPING):A.targetSelection===a.ENTITLED?k(s.BUY_X_GET_Y):A.valueType===c.FIXED_AMOUNT?k(s.FIXED_AMOUNT):A.valueType===c.PERCENTAGE&&k(s.PERCENTAGE)}),[]);const z=[{value:s.FIXED_AMOUNT,label:"Fixed Amount",selected:R===s.FIXED_AMOUNT},{value:s.PERCENTAGE,label:"Percentage",selected:R===s.PERCENTAGE},{value:s.BUY_X_GET_Y,label:"Buy X Get Y FREE",selected:R===s.BUY_X_GET_Y},{value:s.FREE_SHIPPING,label:"Free shipping",selected:R===s.FREE_SHIPPING}],$=()=>{if(!S.quadrant||!S.probability)return;const t=[...S.probability];let e=[];t.length>=S.quadrant&&t.splice(S.quadrant-1,1),e=t;const o=e.reduce(((t,e)=>t+e),0)+(A.probability||0);return V(o),o},K=t=>{const e=t.value;k(e),e===s.FREE_SHIPPING?(X([]),H([]),q(Object.assign(Object.assign({},A),{value:100,targetSelection:a.ALL,targetType:d.SHIPPING_LINE,valueType:c.PERCENTAGE,entitledQuantity:void 0,prerequisiteQuantity:void 0,entitledProductIds:void 0,prerequisiteProductIds:void 0}))):e===s.BUY_X_GET_Y?q(Object.assign(Object.assign({},A),{targetSelection:a.ENTITLED,targetType:d.LINE_ITEM,valueType:c.PERCENTAGE})):e===s.PERCENTAGE?(X([]),H([]),q(Object.assign(Object.assign({},A),{targetSelection:a.ALL,targetType:d.LINE_ITEM,valueType:c.PERCENTAGE,entitledQuantity:void 0,prerequisiteQuantity:void 0,entitledProductIds:void 0,prerequisiteProductIds:void 0}))):e===s.FIXED_AMOUNT&&(X([]),H([]),q(Object.assign(Object.assign({},A),{targetSelection:a.ALL,targetType:d.LINE_ITEM,valueType:c.FIXED_AMOUNT,entitledQuantity:void 0,prerequisiteQuantity:void 0,entitledProductIds:void 0,prerequisiteProductIds:void 0})))};return t(b,Object.assign({open:S.isOpen,headingTitle:w?"Select Products":S.title,headingSubtitle:w?void 0:S.subTitle,footerLeftCustomElement:!S.quadrant||S.hideProbability?e(o,{}):Q<=1?e(E,{theme:"light",tagText:`Current probability sum: ${Q}`,type:"white"}):e(v,Object.assign({body:"Probability sum should not exceed 1",placement:"top"},{children:e("div",{children:e(E,{style:{cursor:"pointer"},theme:"light",tagText:`Current probability sum: ${Q}`,type:"negative",LeadingIcon:P})})})),headerRightCustomElement:S.allowStaticCoupon||w?void 0:e(l,{options:z,width:"200px",placement:"bottom-start",size:"small",onSelect:t=>{K(t)}}),onClose:S.onClose,footerShadow:!0,primaryButton:w?{buttonType:"primary",onClick:()=>{f(void 0)},buttonText:"Add"}:{buttonType:"primary",buttonText:"Add code",disabled:L,onClick:()=>{A.isStaticCoupon?S.onSaveClicked({quadrant:A.quadrant,couponCode:A.couponCode,description:A.description,isStaticCoupon:A.isStaticCoupon,probability:A.probability,title:A.title}):S.onSaveClicked(A),q({})}},secondaryButton:w?{buttonType:"tertiaryGray",onClick:()=>{f(void 0)},buttonText:"Back"}:{buttonType:"tertiaryGray",onClick:S.onClose,buttonText:"Close"}},{children:[!w&&t(T,{children:[S.allowStaticCoupon&&!w&&t(g,Object.assign({selectedDiv:G?1:2},{children:[t("div",Object.assign({className:"coupon-type__container",onClick:()=>{M(!0),q({isStaticCoupon:!0,couponCode:A.couponCode,description:A.description,quadrant:A.quadrant})}},{children:[e(p,Object.assign({style:G?{color:m.colorsV2.content.brand}:{}},{children:"Static code"})),e(u,Object.assign({style:G?{color:m.colorsV2.content.brand}:{}},{children:"One static code for all customers"}))]})),t("div",Object.assign({className:"coupon-type__container",onClick:()=>{q(Object.assign(Object.assign({},A),{isStaticCoupon:!1})),M(!1)}},{children:[e(p,Object.assign({style:G?{}:{color:m.colorsV2.content.brand}},{children:"Dynamic code"})),e(u,Object.assign({style:G?{}:{color:m.colorsV2.content.brand}},{children:"New code generated for everyone"}))]}))]})),G&&!w&&e(h,{discountData:A,setDiscountData:q,hideProbability:S.hideProbability||!1,discountAdminUrl:S.discountAdminUrl}),!G&&!w&&e(j,{currency:S.currency,entitledProducts:Y,prerequisiteProducts:U,setEntitledProducts:H,setPrerequisiteProducts:X,discountData:A,productPickerOpen:w,setIsProductPickerOpen:f,setDiscountData:q,selectedCouponType:R,setSelectedCouponType:k,selectedMinimumRequirement:F,setSelectedMinimumRequirement:B,hideProbability:S.hideProbability||!1,hideExpiration:S.hideExpiration||!1,allowStaticCoupon:S.allowStaticCoupon,onChangeCouponType:K})]}),!!w&&e("div",Object.assign({style:{padding:"12px 0"}},{children:e(y,{show:!0,onSave:()=>{},products:null!==(_=S.products)&&void 0!==_?_:[],title:"Select Products",onClose:()=>{f(void 0)},selectedProducts:w===C.ENTITLED?Y:U,setSelectedProducts:w===C.ENTITLED?H:X,onSearchKeyChange:S.onProductSearch})}))]}))};export{S as DiscountModal};
|
|
1
|
+
import{jsxs as t,jsx as e,Fragment as o}from"react/jsx-runtime";import{useState as i,useEffect as n}from"react";import{MIN_PURCHASE_REQUIREMENT as r,DISCOUNT_TARGET_TYPES as d,DISCOUNT_TYPES as s,DISCOUNT_TARGET_SELECTION as a,DISCOUNT_VALUE_TYPES as c}from"./type.js";import{Dropdown as l}from"../dropdown/Dropdown.js";import"../dropdown/DropdownPopover/index.js";import"../zeroState/ZeroState.js";import{TitleSmall as p,BodyCaption as u}from"../TypographyStyle.js";import{DEFAULT_THEME as m}from"../../constants/Theme.js";import"../dropdown/OpenedDropdown/components/description/Description.styled.js";import"../checkBox/CheckBox.styled.js";import"../list-item/ListItem.js";import"../dropdown/OpenedDropdown/components/menu/FreeFormMenu.styled.js";import"../dropdown/OpenedDropdown/components/menu/MenuItem.js";import"../dropdown/OpenedDropdown/components/menu/MenuList.styled.js";import"../dropdown/OpenedDropdown/components/menu/SelectAllMenu.js";import"../button/Button.js";import"../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js";import"../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js";import"../input/Input.js";import"../dropdown/MenuItem/MenuItem.js";import{StyledModal as b}from"../modals/styledModal.js";import{ProductPickerContent as y}from"../product-picker/ProductPickerModal.js";import{Tag as E}from"../tag/Tag.js";import{Tooltip as v}from"../tooltips/Tooltip.js";import P from"../../assets/icons/triangle_error.svg.js";import{StyledDiscountDialogueContainer as T,CouponTypeContainerStyled as g}from"./DiscountModal.styled.js";import{validateDiscountData as I}from"./DiscountUtils.js";import j,{DISCOUNT_PRODUCTS as C}from"./DynamicCoupon/DynamicCoupon.js";import h from"./StaticCoupon/StaticCoupon.js";const S=S=>{var O,D,N,_;const[w,f]=i(),[A,q]=i(null!==(O=S.data)&&void 0!==O?O:{}),[G,M]=i(((null===(D=S.data)||void 0===D?void 0:D.isStaticCoupon)||S.allowStaticCoupon)&&!(null===(N=S.data)||void 0===N?void 0:N.targetSelection)),[L,x]=i(!0),[R,k]=i(),[F,B]=i(r.NA),[U,X]=i([]),[Y,H]=i([]),[Q,V]=i(0);n((()=>{let t;S.hideProbability||(t=$()),x(I(A,F,R,S.hideProbability||!1,t,G)),S.hideProbability||$()}),[]),n((()=>{let t;S.hideProbability||(t=$()),x(I(A,F,R,S.hideProbability||!1,t,G))}),[G,A,Q,R,F]),n((()=>{var t,e;if(S.products){if(null===(t=S.data)||void 0===t?void 0:t.entitledProductIds){const t=S.products.filter((t=>{var e,o;return null===(o=null===(e=S.data)||void 0===e?void 0:e.entitledProductIds)||void 0===o?void 0:o.includes(parseInt(t.id))}));H(t)}if(null===(e=S.data)||void 0===e?void 0:e.prerequisiteProductIds){const t=S.products.filter((t=>{var e,o;return null===(o=null===(e=S.data)||void 0===e?void 0:e.prerequisiteProductIds)||void 0===o?void 0:o.includes(parseInt(t.id))}));X(t)}}}),[]),n((()=>{const t=Y.map((t=>parseInt(t.id)));q(Object.assign(Object.assign({},A),{entitledProductIds:t}))}),[Y]),n((()=>{const t=U.map((t=>parseInt(t.id)));q(Object.assign(Object.assign({},A),{prerequisiteProductIds:t}))}),[U]),n((()=>{A.targetType===d.SHIPPING_LINE?k(s.FREE_SHIPPING):A.targetSelection===a.ENTITLED?k(s.BUY_X_GET_Y):A.valueType===c.FIXED_AMOUNT?k(s.FIXED_AMOUNT):A.valueType===c.PERCENTAGE&&k(s.PERCENTAGE)}),[]);const z=[{value:s.FIXED_AMOUNT,label:"Fixed Amount",selected:R===s.FIXED_AMOUNT},{value:s.PERCENTAGE,label:"Percentage",selected:R===s.PERCENTAGE},{value:s.BUY_X_GET_Y,label:"Buy X Get Y FREE",selected:R===s.BUY_X_GET_Y},{value:s.FREE_SHIPPING,label:"Free shipping",selected:R===s.FREE_SHIPPING}],$=()=>{if(!S.quadrant||!S.probability)return;const t=[...S.probability];let e=[];t.length>=S.quadrant&&t.splice(S.quadrant-1,1),e=t;const o=e.reduce(((t,e)=>t+e),0)+(A.probability||0);return V(o),o},K=t=>{const e=t.value;k(e),e===s.FREE_SHIPPING?(X([]),H([]),q(Object.assign(Object.assign({},A),{value:100,targetSelection:a.ALL,targetType:d.SHIPPING_LINE,valueType:c.PERCENTAGE,entitledQuantity:void 0,prerequisiteQuantity:void 0,entitledProductIds:void 0,prerequisiteProductIds:void 0}))):e===s.BUY_X_GET_Y?q(Object.assign(Object.assign({},A),{targetSelection:a.ENTITLED,targetType:d.LINE_ITEM,valueType:c.PERCENTAGE})):e===s.PERCENTAGE?(X([]),H([]),q(Object.assign(Object.assign({},A),{targetSelection:a.ALL,targetType:d.LINE_ITEM,valueType:c.PERCENTAGE,entitledQuantity:void 0,prerequisiteQuantity:void 0,entitledProductIds:void 0,prerequisiteProductIds:void 0}))):e===s.FIXED_AMOUNT&&(X([]),H([]),q(Object.assign(Object.assign({},A),{targetSelection:a.ALL,targetType:d.LINE_ITEM,valueType:c.FIXED_AMOUNT,entitledQuantity:void 0,prerequisiteQuantity:void 0,entitledProductIds:void 0,prerequisiteProductIds:void 0})))};return t(b,Object.assign({open:S.isOpen,headingTitle:w?"Select Products":S.title,headingSubtitle:w?void 0:S.subTitle,footerLeftCustomElement:!S.quadrant||S.hideProbability?e(o,{}):Q<=1?e(E,{theme:"light",tagText:`Current probability sum: ${Q}`,type:"white"}):e(v,Object.assign({body:"Probability sum should not exceed 1",placement:"top"},{children:e("div",{children:e(E,{style:{cursor:"pointer"},theme:"light",tagText:`Current probability sum: ${Q}`,type:"negative",LeadingIcon:P})})})),headerRightCustomElement:S.allowStaticCoupon||w?void 0:e(l,{options:z,width:"200px",placement:"bottom-start",size:"small",onSelect:t=>{K(t)}}),onClose:S.onClose,footerShadow:!0,primaryButton:w?{buttonType:"primary",onClick:()=>{f(void 0)},buttonText:"Add"}:{buttonType:"primary",buttonText:"Add code",disabled:L,onClick:()=>{A.isStaticCoupon?S.onSaveClicked({quadrant:A.quadrant,couponCode:A.couponCode,description:A.description,isStaticCoupon:A.isStaticCoupon,probability:A.probability,title:A.title}):S.onSaveClicked(A),q({})}},secondaryButton:w?{buttonType:"tertiaryGray",onClick:()=>{f(void 0)},buttonText:"Back"}:{buttonType:"tertiaryGray",onClick:S.onClose,buttonText:"Close"}},{children:[!w&&t(T,{children:[S.allowStaticCoupon&&!w&&t(g,Object.assign({selectedDiv:G?1:2},{children:[t("div",Object.assign({className:"coupon-type__container",onClick:()=>{M(!0),q({isStaticCoupon:!0,couponCode:A.couponCode,description:A.description,quadrant:A.quadrant})}},{children:[e(p,Object.assign({style:G?{color:m.colorsV2.content.brand}:{}},{children:"Static code"})),e(u,Object.assign({style:G?{color:m.colorsV2.content.brand}:{}},{children:"One static code for all customers"}))]})),t("div",Object.assign({className:"coupon-type__container",onClick:()=>{q(Object.assign(Object.assign({},A),{isStaticCoupon:!1})),M(!1)}},{children:[e(p,Object.assign({style:G?{}:{color:m.colorsV2.content.brand}},{children:"Dynamic code"})),e(u,Object.assign({style:G?{}:{color:m.colorsV2.content.brand}},{children:"New code generated for everyone"}))]}))]})),G&&!w&&e(h,{discountData:A,setDiscountData:q,hideProbability:S.hideProbability||!1,discountAdminUrl:S.discountAdminUrl}),!G&&!w&&e(j,{currency:S.currency,entitledProducts:Y,prerequisiteProducts:U,setEntitledProducts:H,setPrerequisiteProducts:X,discountData:A,productPickerOpen:w,setIsProductPickerOpen:f,setDiscountData:q,selectedCouponType:R,setSelectedCouponType:k,selectedMinimumRequirement:F,setSelectedMinimumRequirement:B,hideProbability:S.hideProbability||!1,hideExpiration:S.hideExpiration||!1,allowStaticCoupon:S.allowStaticCoupon,onChangeCouponType:K})]}),!!w&&e("div",Object.assign({style:{padding:"12px 0"}},{children:e(y,{show:!0,onSave:()=>{},products:null!==(_=S.products)&&void 0!==_?_:[],title:"Select Products",onClose:()=>{f(void 0)},selectedProducts:w===C.ENTITLED?Y:U,setSelectedProducts:w===C.ENTITLED?H:X,onSearchKeyChange:S.onProductSearch})}))]}))};export{S as DiscountModal};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useEffect as n}from"react";import{Button as s}from"../../button/Button.js";import{DISCOUNT_TYPES as a,MIN_PURCHASE_REQUIREMENT as o}from"../type.js";import{Dropdown as r}from"../../dropdown/Dropdown.js";import"../../dropdown/DropdownPopover/index.js";import"../../zeroState/ZeroState.js";import{TitleRegular as l,BodySecondary as c,TitleMedium as d,BodyPrimary as u,TitleSmall as p}from"../../TypographyStyle.js";import{DEFAULT_THEME as m}from"../../../constants/Theme.js";import"../../dropdown/OpenedDropdown/components/description/Description.styled.js";import"../../checkBox/CheckBox.styled.js";import"../../list-item/ListItem.js";import"../../dropdown/OpenedDropdown/components/menu/FreeFormMenu.styled.js";import"../../dropdown/OpenedDropdown/components/menu/MenuItem.js";import"../../dropdown/OpenedDropdown/components/menu/MenuList.styled.js";import"../../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js";import"../../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js";import{Input as b}from"../../input/Input.js";import g from"../../../assets/icons/cross.svg.js";import"../../dropdown/MenuItem/MenuItem.js";import"../../modals/styledModal.js";import"../../../node_modules/lodash.debounce/index.js";import"../../bik-layout/CommonStyles.js";import"../../product-picker/ProductPicker.styled.js";import"../../../utils/DateUtils.js";import"../../tag/Tag.js";import"@tippyjs/react";import"../../tooltips/TooltipInternal.js";import{DynamicCouponContainer as v}from"../DiscountModal.styled.js";import{CouponExpiration as j}from"../CouponExpiration/CouponExpiration.js";import{RadioButton as D}from"../../radioButton/RadioButton.js";import h from"../../../assets/icons/cursor.svg.js";import y from"../../../assets/icons/plus.svg.js";var T;function O(){return null}!function(e){e.ENTITLED="entitled",e.PREREQUISITE="prerequisite"}(T||(T={}));const x=x=>{var E;n((()=>{x.setDiscountData(Object.assign(Object.assign({},x.discountData),{isStaticCoupon:!1}))}),[]);const _=[{value:a.FIXED_AMOUNT,label:"Fixed Amount",selected:x.selectedCouponType===a.FIXED_AMOUNT},{value:a.PERCENTAGE,label:"Percentage",selected:x.selectedCouponType===a.PERCENTAGE},{value:a.BUY_X_GET_Y,label:"Buy X Get Y FREE",selected:x.selectedCouponType===a.BUY_X_GET_Y},{value:a.FREE_SHIPPING,label:"Free shipping",selected:x.selectedCouponType===a.FREE_SHIPPING}],C=[{selected:x.selectedMinimumRequirement===o.NA,label:"No minimum requirements",value:o.NA},{selected:x.selectedMinimumRequirement===o.AMOUNT,label:`Minimum purchase amount (${null!==(E=x.currency)&&void 0!==E?E:"₹"})`,value:o.AMOUNT},{selected:x.selectedMinimumRequirement===o.QUANTITY,label:"Minimum quantity of items",value:o.QUANTITY}],N=()=>{var i,n,s,a;return e("div",Object.assign({className:"input__rows"},{children:[e("div",Object.assign({className:"input__wrapper"},{children:[t(c,Object.assign({style:{marginBottom:10}},{children:"Min purchase requirements"})),t(r,{options:C,placement:"bottom-start",onSelect:e=>{const t=e.value;x.setSelectedMinimumRequirement(t),x.setDiscountData(Object.assign(Object.assign({},x.discountData),{minQuantity:void 0,minAmount:void 0}))}})]})),t("div",Object.assign({className:"input__wrapper"},{children:x.selectedMinimumRequirement!==o.NA&&t(b,{value:x.selectedMinimumRequirement===o.AMOUNT?null!==(n=null===(i=x.discountData.minAmount)||void 0===i?void 0:i.toString())&&void 0!==n?n:"":null!==(a=null===(s=x.discountData.minQuantity)||void 0===s?void 0:s.toString())&&void 0!==a?a:"",onChangeText:e=>{x.selectedMinimumRequirement===o.AMOUNT?x.setDiscountData(Object.assign(Object.assign({},x.discountData),{minAmount:parseInt(e)})):x.selectedMinimumRequirement===o.QUANTITY&&x.setDiscountData(Object.assign(Object.assign({},x.discountData),{minQuantity:parseInt(e)}))},labelText:x.selectedMinimumRequirement===o.AMOUNT?"Minimum purchase amount":"Minimum purchase quantity",type:"number",placeholder:x.selectedMinimumRequirement===o.AMOUNT?"1000.00":"2"})}))]}))},f=n=>{var a,o;const r=n===T.ENTITLED?x.entitledProducts:x.prerequisiteProducts;return e(i,{children:[t(l,{children:n===T.PREREQUISITE?"Customer spends":"Customer gets"}),e("div",Object.assign({className:"input__rows"},{children:[t("div",Object.assign({className:"input__wrapper"},{children:t(b,{value:n===T.ENTITLED?null===(a=x.discountData.entitledQuantity)||void 0===a?void 0:a.toString():null===(o=x.discountData.prerequisiteQuantity)||void 0===o?void 0:o.toString(),type:"number",onChangeText:e=>{n===T.ENTITLED?x.setDiscountData(Object.assign(Object.assign({},x.discountData),{entitledQuantity:parseInt(e)})):x.setDiscountData(Object.assign(Object.assign({},x.discountData),{prerequisiteQuantity:parseInt(e)}))},labelText:"Add quantity",placeholder:"Add quantity"})})),t("div",{className:"input__wrapper"})]})),t("div",{children:t(s,{buttonText:"Add product",buttonType:"tertiary",LeadingIcon:y,onClick:()=>{x.setIsProductPickerOpen(n)}})}),r.map((i=>e("div",Object.assign({style:{padding:"20px 0 12px 0",borderBottom:`1px solid ${m.colorsV2.stroke.primary}`,display:"flex"}},{children:[e("div",Object.assign({style:{display:"flex",gap:16,alignItems:"center",flex:.8}},{children:[t("img",{src:i.image,onError:e=>{e.target.onerror=null,e.target.src="https://jkfenner.com/wp-content/uploads/2019/11/default.jpg"},style:{height:40,width:40,objectFit:"cover",borderRadius:4}}),t(p,{children:i.name})]})),t("div",Object.assign({style:{flex:.2,display:"flex",justifyContent:"flex-end",alignItems:"center"}},{children:t("div",Object.assign({style:{cursor:"pointer"},onClick:()=>{const e=r.filter((e=>e.id!==i.id));n===T.ENTITLED?x.setEntitledProducts(e):x.setPrerequisiteProducts(e)}},{children:t(g,{width:14,color:m.colorsV2.content.primary})}))}))]}),i.id)))]})};return e(v,{children:[x.allowStaticCoupon&&e("div",Object.assign({className:"input__rows"},{children:[t("div",Object.assign({className:"input__wrapper"},{children:t(r,{options:_,width:"290px",placement:"bottom-start",onSelect:e=>{x.onChangeCouponType(e)}})})),t("div",{className:"input__wrapper"})]})),(x.selectedCouponType===a.PERCENTAGE||x.selectedCouponType===a.FIXED_AMOUNT)&&(()=>{var n,s,o,r;return e(i,{children:[e("div",Object.assign({className:"input__rows"},{children:[t("div",Object.assign({className:"input__wrapper"},{children:t(b,{value:x.discountData.title,onChangeText:e=>{x.setDiscountData(Object.assign(Object.assign({},x.discountData),{title:e}))},maxCharLimit:18,labelText:"Code title",placeholder:"eg: Flat 50% Off"})})),t("div",Object.assign({className:"input__wrapper"},{children:t(b,{value:null===(s=null===(n=x.discountData)||void 0===n?void 0:n.value)||void 0===s?void 0:s.toString(),labelText:"Discount code value",type:"number",onChangeText:e=>{x.setDiscountData(Object.assign(Object.assign({},x.discountData),{value:parseInt(e)}))},placeholder:x.selectedCouponType===a.FIXED_AMOUNT?"0.00":"Enter a value",prefixText:x.selectedCouponType===a.FIXED_AMOUNT?null!==(o=x.currency)&&void 0!==o?o:"₹":void 0,suffixText:x.selectedCouponType===a.PERCENTAGE?"%":void 0})}))]})),N(),!x.hideProbability&&e("div",Object.assign({className:"input__rows"},{children:[t("div",Object.assign({className:"input__wrapper"},{children:t(b,{type:"number",value:null===(r=x.discountData.probability)||void 0===r?void 0:r.toString(),onChangeText:e=>{x.setDiscountData(Object.assign(Object.assign({},x.discountData),{probability:e.startsWith(".")?parseFloat(`0${e}`):parseFloat(e)}))},labelText:"Probability",placeholder:"Enter probability in decimals eg: 0.2, 0.5, 0.75"})})),t("div",{className:"input__wrapper"})]}))]})})(),x.selectedCouponType===a.FREE_SHIPPING&&(()=>{var n;return e(i,{children:[e("div",Object.assign({className:"input__rows"},{children:[t("div",Object.assign({className:"input__wrapper"},{children:t(b,{value:x.discountData.title,onChangeText:e=>{x.setDiscountData(Object.assign(Object.assign({},x.discountData),{title:e}))},labelText:"Code title",placeholder:"eg: Flat 50% Off",maxCharLimit:18})})),t("div",Object.assign({className:"input__wrapper"},{children:!x.hideProbability&&t(b,{value:null===(n=x.discountData.probability)||void 0===n?void 0:n.toString(),type:"number",onChangeText:e=>{x.setDiscountData(Object.assign(Object.assign({},x.discountData),{probability:e.startsWith(".")?parseFloat(`0${e}`):parseFloat(e)}))},labelText:"Probability",placeholder:"Enter probability in decimals eg: 0.2, 0.5, 0.75"})}))]})),N()]})})(),x.selectedCouponType===a.BUY_X_GET_Y&&(()=>{var i;return e(v,{children:[t("div",Object.assign({className:"input__rows"},{children:e("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:20,flex:1}},{children:[t(b,{value:x.discountData.title,onChangeText:e=>{x.setDiscountData(Object.assign(Object.assign({},x.discountData),{title:e}))},maxCharLimit:18,labelText:"Code title",placeholder:"eg: Flat 50% Off"}),!x.hideProbability&&t(b,{value:null===(i=x.discountData.probability)||void 0===i?void 0:i.toString(),type:"number",onChangeText:e=>{x.setDiscountData(Object.assign(Object.assign({},x.discountData),{probability:e.startsWith(".")?parseFloat(`0${e}`):parseFloat(e)}))},labelText:"Probability",placeholder:"Enter probability in decimals eg: 0.2, 0.5, 0.75"})]}))})),t(O,{}),f(T.PREREQUISITE),t(O,{}),f(T.ENTITLED),t(O,{}),t(l,{children:"At a discount value"}),e("div",Object.assign({style:{display:"flex",gap:18,alignItems:"center"}},{children:[t(D,{isActive:100!==x.discountData.value,onValueChange:e=>{x.setDiscountData(Object.assign(Object.assign({},x.discountData),{value:void 0}))}}),t(c,{children:"Percentage"}),100!==x.discountData.value&&t(b,{variant:"small",onChangeText:e=>{x.setDiscountData(Object.assign(Object.assign({},x.discountData),{value:parseInt(e)}))},type:"number",placeholder:"Enter percentage eg: 10%",suffixText:"%",width:"238px"})]})),e("div",Object.assign({style:{display:"flex",gap:18}},{children:[t(D,{isActive:100===x.discountData.value,onValueChange:e=>{e?x.setDiscountData(Object.assign(Object.assign({},x.discountData),{value:100})):x.setDiscountData(Object.assign(Object.assign({},x.discountData),{value:void 0}))}}),t(c,{children:"Free"})]}))]})})(),x.selectedCouponType&&!x.hideExpiration&&e(i,{children:[t("div",{style:{height:6,borderTop:`1px solid ${m.colorsV2.stroke.primary}`,marginTop:12}}),t(j,{discountData:x.discountData,setDiscountData:x.setDiscountData})]}),!x.selectedCouponType&&e("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:10,padding:"40px 0",justifyContent:"center",alignItems:"center"}},{children:[t("div",Object.assign({style:{height:52,width:52,backgroundColor:m.colorsV2.background.inverse,borderRadius:"50%",display:"flex",justifyContent:"center",alignItems:"center"}},{children:t(h,{width:32,color:m.colorsV2.content.primaryInverse})})),t(d,{children:"No discount has been selected"}),t(u,{children:"Please select a discount type"})]}))]})};export{T as DISCOUNT_PRODUCTS,x as default};
|
|
1
|
+
import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useEffect as n}from"react";import{Button as s}from"../../button/Button.js";import{DISCOUNT_TYPES as a,MIN_PURCHASE_REQUIREMENT as o}from"../type.js";import{Dropdown as r}from"../../dropdown/Dropdown.js";import"../../dropdown/DropdownPopover/index.js";import"../../zeroState/ZeroState.js";import{TitleRegular as l,BodySecondary as c,TitleMedium as d,BodyPrimary as u,TitleSmall as p}from"../../TypographyStyle.js";import{DEFAULT_THEME as m}from"../../../constants/Theme.js";import"../../dropdown/OpenedDropdown/components/description/Description.styled.js";import"../../checkBox/CheckBox.styled.js";import"../../list-item/ListItem.js";import"../../dropdown/OpenedDropdown/components/menu/FreeFormMenu.styled.js";import"../../dropdown/OpenedDropdown/components/menu/MenuItem.js";import"../../dropdown/OpenedDropdown/components/menu/MenuList.styled.js";import"../../dropdown/OpenedDropdown/components/menu/SelectAllMenu.js";import"../../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js";import"../../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js";import{Input as b}from"../../input/Input.js";import g from"../../../assets/icons/cross.svg.js";import"../../dropdown/MenuItem/MenuItem.js";import"../../modals/styledModal.js";import"../../../node_modules/lodash.debounce/index.js";import"../../bik-layout/CommonStyles.js";import"../../product-picker/ProductPicker.styled.js";import"../../../utils/DateUtils.js";import"../../tag/Tag.js";import"@tippyjs/react";import"../../tooltips/TooltipInternal.js";import{DynamicCouponContainer as v}from"../DiscountModal.styled.js";import{CouponExpiration as j}from"../CouponExpiration/CouponExpiration.js";import{RadioButton as D}from"../../radioButton/RadioButton.js";import h from"../../../assets/icons/cursor.svg.js";import y from"../../../assets/icons/plus.svg.js";var O;function T(){return null}!function(e){e.ENTITLED="entitled",e.PREREQUISITE="prerequisite"}(O||(O={}));const x=x=>{var E;n((()=>{x.setDiscountData(Object.assign(Object.assign({},x.discountData),{isStaticCoupon:!1}))}),[]);const _=[{value:a.FIXED_AMOUNT,label:"Fixed Amount",selected:x.selectedCouponType===a.FIXED_AMOUNT},{value:a.PERCENTAGE,label:"Percentage",selected:x.selectedCouponType===a.PERCENTAGE},{value:a.BUY_X_GET_Y,label:"Buy X Get Y FREE",selected:x.selectedCouponType===a.BUY_X_GET_Y},{value:a.FREE_SHIPPING,label:"Free shipping",selected:x.selectedCouponType===a.FREE_SHIPPING}],C=[{selected:x.selectedMinimumRequirement===o.NA,label:"No minimum requirements",value:o.NA},{selected:x.selectedMinimumRequirement===o.AMOUNT,label:`Minimum purchase amount (${null!==(E=x.currency)&&void 0!==E?E:"₹"})`,value:o.AMOUNT},{selected:x.selectedMinimumRequirement===o.QUANTITY,label:"Minimum quantity of items",value:o.QUANTITY}],N=()=>{var i,n,s,a;return e("div",Object.assign({className:"input__rows"},{children:[e("div",Object.assign({className:"input__wrapper"},{children:[t(c,Object.assign({style:{marginBottom:10}},{children:"Min purchase requirements"})),t(r,{options:C,placement:"bottom-start",onSelect:e=>{const t=e.value;x.setSelectedMinimumRequirement(t),x.setDiscountData(Object.assign(Object.assign({},x.discountData),{minQuantity:void 0,minAmount:void 0}))}})]})),t("div",Object.assign({className:"input__wrapper"},{children:x.selectedMinimumRequirement!==o.NA&&t(b,{value:x.selectedMinimumRequirement===o.AMOUNT?null!==(n=null===(i=x.discountData.minAmount)||void 0===i?void 0:i.toString())&&void 0!==n?n:"":null!==(a=null===(s=x.discountData.minQuantity)||void 0===s?void 0:s.toString())&&void 0!==a?a:"",onChangeText:e=>{x.selectedMinimumRequirement===o.AMOUNT?x.setDiscountData(Object.assign(Object.assign({},x.discountData),{minAmount:parseInt(e)})):x.selectedMinimumRequirement===o.QUANTITY&&x.setDiscountData(Object.assign(Object.assign({},x.discountData),{minQuantity:parseInt(e)}))},labelText:x.selectedMinimumRequirement===o.AMOUNT?"Minimum purchase amount":"Minimum purchase quantity",type:"number",placeholder:x.selectedMinimumRequirement===o.AMOUNT?"1000.00":"2"})}))]}))},f=n=>{var a,o;const r=n===O.ENTITLED?x.entitledProducts:x.prerequisiteProducts;return e(i,{children:[t(l,{children:n===O.PREREQUISITE?"Customer spends":"Customer gets"}),e("div",Object.assign({className:"input__rows"},{children:[t("div",Object.assign({className:"input__wrapper"},{children:t(b,{value:n===O.ENTITLED?null===(a=x.discountData.entitledQuantity)||void 0===a?void 0:a.toString():null===(o=x.discountData.prerequisiteQuantity)||void 0===o?void 0:o.toString(),type:"number",onChangeText:e=>{n===O.ENTITLED?x.setDiscountData(Object.assign(Object.assign({},x.discountData),{entitledQuantity:parseInt(e)})):x.setDiscountData(Object.assign(Object.assign({},x.discountData),{prerequisiteQuantity:parseInt(e)}))},labelText:"Add quantity",placeholder:"Add quantity"})})),t("div",{className:"input__wrapper"})]})),t("div",{children:t(s,{buttonText:"Add product",buttonType:"tertiary",LeadingIcon:y,onClick:()=>{x.setIsProductPickerOpen(n)}})}),r.map((i=>e("div",Object.assign({style:{padding:"20px 0 12px 0",borderBottom:`1px solid ${m.colorsV2.stroke.primary}`,display:"flex"}},{children:[e("div",Object.assign({style:{display:"flex",gap:16,alignItems:"center",flex:.8}},{children:[t("img",{src:i.image,onError:e=>{e.target.onerror=null,e.target.src="https://jkfenner.com/wp-content/uploads/2019/11/default.jpg"},style:{height:40,width:40,objectFit:"cover",borderRadius:4}}),t(p,{children:i.name})]})),t("div",Object.assign({style:{flex:.2,display:"flex",justifyContent:"flex-end",alignItems:"center"}},{children:t("div",Object.assign({style:{cursor:"pointer"},onClick:()=>{const e=r.filter((e=>e.id!==i.id));n===O.ENTITLED?x.setEntitledProducts(e):x.setPrerequisiteProducts(e)}},{children:t(g,{width:14,color:m.colorsV2.content.primary})}))}))]}),i.id)))]})};return e(v,{children:[x.allowStaticCoupon&&e("div",Object.assign({className:"input__rows"},{children:[t("div",Object.assign({className:"input__wrapper"},{children:t(r,{options:_,width:"290px",placement:"bottom-start",onSelect:e=>{x.onChangeCouponType(e)}})})),t("div",{className:"input__wrapper"})]})),(x.selectedCouponType===a.PERCENTAGE||x.selectedCouponType===a.FIXED_AMOUNT)&&(()=>{var n,s,o,r;return e(i,{children:[e("div",Object.assign({className:"input__rows"},{children:[t("div",Object.assign({className:"input__wrapper"},{children:t(b,{value:x.discountData.title,onChangeText:e=>{x.setDiscountData(Object.assign(Object.assign({},x.discountData),{title:e}))},maxCharLimit:18,labelText:"Code title",placeholder:"eg: Flat 50% Off"})})),t("div",Object.assign({className:"input__wrapper"},{children:t(b,{value:null===(s=null===(n=x.discountData)||void 0===n?void 0:n.value)||void 0===s?void 0:s.toString(),labelText:"Discount code value",type:"number",onChangeText:e=>{x.setDiscountData(Object.assign(Object.assign({},x.discountData),{value:parseInt(e)}))},placeholder:x.selectedCouponType===a.FIXED_AMOUNT?"0.00":"Enter a value",prefixText:x.selectedCouponType===a.FIXED_AMOUNT?null!==(o=x.currency)&&void 0!==o?o:"₹":void 0,suffixText:x.selectedCouponType===a.PERCENTAGE?"%":void 0})}))]})),N(),!x.hideProbability&&e("div",Object.assign({className:"input__rows"},{children:[t("div",Object.assign({className:"input__wrapper"},{children:t(b,{type:"number",value:null===(r=x.discountData.probability)||void 0===r?void 0:r.toString(),onChangeText:e=>{x.setDiscountData(Object.assign(Object.assign({},x.discountData),{probability:e.startsWith(".")?parseFloat(`0${e}`):parseFloat(e)}))},labelText:"Probability",placeholder:"Enter probability in decimals eg: 0.2, 0.5, 0.75"})})),t("div",{className:"input__wrapper"})]}))]})})(),x.selectedCouponType===a.FREE_SHIPPING&&(()=>{var n;return e(i,{children:[e("div",Object.assign({className:"input__rows"},{children:[t("div",Object.assign({className:"input__wrapper"},{children:t(b,{value:x.discountData.title,onChangeText:e=>{x.setDiscountData(Object.assign(Object.assign({},x.discountData),{title:e}))},labelText:"Code title",placeholder:"eg: Flat 50% Off",maxCharLimit:18})})),t("div",Object.assign({className:"input__wrapper"},{children:!x.hideProbability&&t(b,{value:null===(n=x.discountData.probability)||void 0===n?void 0:n.toString(),type:"number",onChangeText:e=>{x.setDiscountData(Object.assign(Object.assign({},x.discountData),{probability:e.startsWith(".")?parseFloat(`0${e}`):parseFloat(e)}))},labelText:"Probability",placeholder:"Enter probability in decimals eg: 0.2, 0.5, 0.75"})}))]})),N()]})})(),x.selectedCouponType===a.BUY_X_GET_Y&&(()=>{var i;return e(v,{children:[t("div",Object.assign({className:"input__rows"},{children:e("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:20,flex:1}},{children:[t(b,{value:x.discountData.title,onChangeText:e=>{x.setDiscountData(Object.assign(Object.assign({},x.discountData),{title:e}))},maxCharLimit:18,labelText:"Code title",placeholder:"eg: Flat 50% Off"}),!x.hideProbability&&t(b,{value:null===(i=x.discountData.probability)||void 0===i?void 0:i.toString(),type:"number",onChangeText:e=>{x.setDiscountData(Object.assign(Object.assign({},x.discountData),{probability:e.startsWith(".")?parseFloat(`0${e}`):parseFloat(e)}))},labelText:"Probability",placeholder:"Enter probability in decimals eg: 0.2, 0.5, 0.75"})]}))})),t(T,{}),f(O.PREREQUISITE),t(T,{}),f(O.ENTITLED),t(T,{}),t(l,{children:"At a discount value"}),e("div",Object.assign({style:{display:"flex",gap:18,alignItems:"center"}},{children:[t(D,{isActive:100!==x.discountData.value,onValueChange:e=>{x.setDiscountData(Object.assign(Object.assign({},x.discountData),{value:void 0}))}}),t(c,{children:"Percentage"}),100!==x.discountData.value&&t(b,{variant:"small",onChangeText:e=>{x.setDiscountData(Object.assign(Object.assign({},x.discountData),{value:parseInt(e)}))},type:"number",placeholder:"Enter percentage eg: 10%",suffixText:"%",width:"238px"})]})),e("div",Object.assign({style:{display:"flex",gap:18}},{children:[t(D,{isActive:100===x.discountData.value,onValueChange:e=>{e?x.setDiscountData(Object.assign(Object.assign({},x.discountData),{value:100})):x.setDiscountData(Object.assign(Object.assign({},x.discountData),{value:void 0}))}}),t(c,{children:"Free"})]}))]})})(),x.selectedCouponType&&!x.hideExpiration&&e(i,{children:[t("div",{style:{height:6,borderTop:`1px solid ${m.colorsV2.stroke.primary}`,marginTop:12}}),t(j,{discountData:x.discountData,setDiscountData:x.setDiscountData})]}),!x.selectedCouponType&&e("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:10,padding:"40px 0",justifyContent:"center",alignItems:"center"}},{children:[t("div",Object.assign({style:{height:52,width:52,backgroundColor:m.colorsV2.background.inverse,borderRadius:"50%",display:"flex",justifyContent:"center",alignItems:"center"}},{children:t(h,{width:32,color:m.colorsV2.content.primaryInverse})})),t(d,{children:"No discount has been selected"}),t(u,{children:"Please select a discount type"})]}))]})};export{O as DISCOUNT_PRODUCTS,x as default};
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
export declare const OverLapAbs: import("styled-components").StyledComponent<"div", any, {
|
|
2
|
-
disabled?: boolean | undefined;
|
|
3
|
-
}, never>;
|
|
1
|
+
export declare const OverLapAbs: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
2
|
export declare const OpenDropdownContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
5
3
|
export declare const LoadingContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import o from"styled-components";import{COLORS as
|
|
1
|
+
import o from"styled-components";import{COLORS as r}from"../../constants/Theme.js";const e=o.div`
|
|
2
2
|
position: absolute;
|
|
3
3
|
left: 0px;
|
|
4
4
|
top: 0px;
|
|
5
5
|
width: 100%;
|
|
6
6
|
height: 100%;
|
|
7
7
|
z-index: 2;
|
|
8
|
-
cursor:
|
|
9
|
-
`,
|
|
8
|
+
cursor: pointer;
|
|
9
|
+
`,i=o.div`
|
|
10
10
|
margin-top: 8px;
|
|
11
11
|
margin-bottom: 8px;
|
|
12
12
|
`;o.div`
|
|
@@ -14,7 +14,7 @@ import o from"styled-components";import{COLORS as e}from"../../constants/Theme.j
|
|
|
14
14
|
flex-direction: row;
|
|
15
15
|
align-items: center;
|
|
16
16
|
padding: 6px 8px;
|
|
17
|
-
background: ${
|
|
18
|
-
border: 1px solid ${
|
|
17
|
+
background: ${r.surface.hovered};
|
|
18
|
+
border: 1px solid ${r.stroke.primary};
|
|
19
19
|
border-radius: 4px;
|
|
20
|
-
`;export{
|
|
20
|
+
`;export{i as OpenDropdownContainer,e as OverLapAbs};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest as
|
|
1
|
+
import{__rest as o}from"../../../_virtual/_tslib.js";import{jsxs as e,Fragment as r,jsx as n}from"react/jsx-runtime";import t,{useState as l,useImperativeHandle as i,useEffect as s}from"react";import{usePopper as p}from"react-popper";import d from"../../dropShadow/DropShadow.js";import{OverLapAbs as a,OpenDropdownContainer as c}from"../Common.styled.js";import{OpenedDropdown as m}from"../OpenedDropdown/components/OpennedDropdown.js";const u=t.forwardRef(((t,u)=>{var{children:f,onDropdownVisbilityChange:v}=t,b=o(t,["children","onDropdownVisbilityChange"]);const j=u,[w,g]=l(!1),[h,y]=l(null),[D,O]=l(null),{styles:C,attributes:S}=p(h,D,{placement:b.placement,strategy:b.strategy});return i(j,(()=>({openDropdown:w})),[]),s((()=>{(null==j?void 0:j.current)&&(j.current.openDropdown=w)}),[w]),s((()=>{null==v||v(w)}),[w]),e(r,{children:[e("div",Object.assign({style:{position:"relative"},ref:y},{children:[n(a,{onClick:o=>{w?o.preventDefault():b.disabled||g(!0)}}),f]})),w&&n(c,Object.assign({ref:O,style:Object.assign(Object.assign({},C.popper),{zIndex:3})},S.popper,{children:n(d,Object.assign({level:"z2",position:"down",style:{borderRadius:4}},{children:n(m,Object.assign({},b,{onSelect:o=>{var e;null===(e=b.onSelect)||void 0===e||e.call(b,o),g(!1)},onClose:function(){var o;g(!1),null===(o=null==b?void 0:b.onClose)||void 0===o||o.call(b)}}))}))}))]})}));u.displayName="DropdownPopover";export{u as DropdownPopover};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{jsx as o}from"react/jsx-runtime";import
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import e from"../../../assets/icons/horizontal_dots.svg.js";import t from"../../../assets/icons/vertical_dots.svg.js";import n from"styled-components";import"../Dropdown.js";import{DropdownPopover as r}from"../DropdownPopover/index.js";import"react";import"../../zeroState/ZeroState.js";import"../../TypographyStyle.js";import{COLORS as s}from"../../../constants/Theme.js";import"../OpenedDropdown/components/description/Description.styled.js";import"../../checkBox/CheckBox.styled.js";import"../../list-item/ListItem.js";import"../OpenedDropdown/components/menu/FreeFormMenu.styled.js";import"../OpenedDropdown/components/menu/MenuItem.js";import"../OpenedDropdown/components/menu/MenuList.styled.js";import"../OpenedDropdown/components/menu/SelectAllMenu.js";import"../../button/Button.js";import"../OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js";import"../OpenedDropdown/components/OpennedDropdown.styled.js";import"../../input/Input.js";import{IconButton as p}from"../../icon-button/IconButton.js";const i=n.div`
|
|
2
2
|
:hover {
|
|
3
3
|
background: ${s.surface.subdued};
|
|
4
4
|
}
|
|
5
|
-
`,m=n=>o(i,{children:o(r,Object.assign({},n,{children:o("div",{children:o(p,{Icon:n.isHorizontal?t
|
|
5
|
+
`,m=n=>o(i,{children:o(r,Object.assign({},n,{children:o("div",{children:o(p,{Icon:n.isHorizontal?e:t,bordered:!(null==n?void 0:n.hideBorder)})})}))});m.displayName="MenuItemDropdown";export{m as MenuItemDropdown};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useState as o,useEffect as
|
|
1
|
+
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useState as o,useEffect as l,useRef as s}from"react";import{ZeroState as i}from"../../../zeroState/ZeroState.js";import{useOutside as n}from"../../../../hooks/useOutside.js";import{iterateOnOptions as r}from"../utils/iterationOnOptions.js";import{Description as c}from"./description/Description.js";import{FreeFormMenu as a}from"./menu/FreeFormMenu.js";import{MenuList as u}from"./menu/MenuList.js";import{SelectAllMenu as d}from"./menu/SelectAllMenu.js";import p from"./multiSelect/MultiSelectDropdownBottomBar.js";import{OpennedDropdownContainer as f,MenuListContainer as m}from"./OpennedDropdown.styled.js";import{SearchBox as h}from"./searchbox/SearchBox.js";import{SearchZeroState as b}from"./searchbox/SearchZeroState.js";const g=304,j=290,v=v=>{let{options:S,isSearchable:w,isMultiSelect:y,width:O,allowFreeForm:x,height:C,onClose:L,onSelect:F}=v;const[M,D]=o(null!=S?S:[]);l((()=>{if(S){const e=[...S];D(y?[...e.sort((e=>e.selected?-1:1))]:[...e])}}),[S]);const[k,A]=o(null!=O?O:j),[B,H]=o(""),[Z,q]=o(null),z=s(null);n(z,(()=>{q(null),null==L||L()}));const E=null!=C?C:g,I="number"==typeof E?w&&y?E-96:w&&!y||!w&&y?E-48:E:E;function K(e){if(y){const t=r(M,{selected:e.selected},(t=>t.value===e.value));D([...t])}else null==F||F(e)}l((()=>{const e=null!=O?O:j;if(null===Z)A(e);else if("number"==typeof e)A(2*e);else if("string"==typeof e&&e.endsWith("px")){const t=2*parseInt(e.replace("px",""));A(t)}}),[Z]);const N=[],P=M.map((e=>{var t,o;if(B){if(e.options){const t=Object.assign({},e);return t.options=t.options.filter((e=>{var t;return!!(null===(t=e.label)||void 0===t?void 0:t.toLowerCase().includes(B.toLowerCase()))&&(N.push(!B||e.label===B),!0)})),t.options.length>0?t:null}return(null===(t=e.label)||void 0===t?void 0:t.toLowerCase().includes(B.toLowerCase()))||(null===(o=e.searchKey)||void 0===o?void 0:o.toLowerCase().includes(B.toLowerCase()))?(N.push(!B||e.label===B),e):null}return e})).filter((e=>null!==e)),T=!!w&&B&&0===P.length;return e(f,Object.assign({ref:z,style:{width:k}},{children:[e("div",Object.assign({style:{width:Z?"50%":"100%",display:"flex",flexDirection:"column",background:"white"}},{children:[!!w&&t(h,{onSearch:function(e){H(e)}}),P.length||B?e(m,Object.assign({minHeight:E,maxHeight:I},{children:[!!y&&!T&&t(d,{options:M,onSelect:function(e){if("selectAll"===e){const e=r(M,{selected:!0},(e=>{var t;return B?(null===(t=e.label)||void 0===t?void 0:t.toLowerCase().includes(B.toLowerCase()))&&!e.disabled:!e.disabled}));D([...e])}else if("notSelected"===e){const e=r(M,{selected:!1},(e=>!e.disabled));D([...e])}}}),!x&&T&&t(b,{searchedString:B}),x&&(T||!!N.length&&N.every((e=>!1===e)))&&t(a,{isMultiSelect:y,onSelect:function(e){if(!y)return void K({label:B,value:B,isFreeForm:!0,selected:!0});const t=M.map((t=>t.options?t:Object.assign(Object.assign({},t),{selected:t.label===B&&t.value===B?e:t.selected})));e&&(t.some((e=>e.label===B&&e.value===B))||t.unshift({label:B,value:B,isFreeForm:!0,selected:!0})),D([...t])},searchedString:B}),t(u,{onSelect:K,showDescription:function(e,t){q(e&&t?{title:e,description:t}:null)},isMultiSelect:y,options:P})]})):t("div",Object.assign({style:{height:E,display:"flex"}},{children:t(i,{title:"No results found",subTitle:"Please try again later or contact us at support@bik.ai if you require further assistance."})})),!!y&&!(!P.length&&!B)&&t(p,{onClear:function(){const e=r(M,{selected:!1});D([...e])},onApply:function(){const e=[];M.forEach((t=>{if(t.options){const o=t.options.filter((e=>!0===e.selected));e.push(Object.assign(Object.assign({},t),{options:[...o]}))}else t.selected&&e.push(Object.assign({},t))})),null==F||F([...e])},list:M})]})),!!Z&&t(c,{title:Z.title,description:Z.description})]}))};export{v as OpenedDropdown};
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
export declare const OpennedDropdownContainer: import("styled-components").StyledComponent<"div", any, {
|
|
2
|
-
version?: "1.0" | "2.0" | undefined;
|
|
3
|
-
}, never>;
|
|
1
|
+
export declare const OpennedDropdownContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
2
|
export declare const ItemContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
5
3
|
export declare const MenuListContainer: import("styled-components").StyledComponent<"div", any, {
|
|
6
4
|
maxHeight: number | string;
|
|
@@ -1,25 +1,39 @@
|
|
|
1
|
-
import o from"styled-components";import{COLORS as
|
|
2
|
-
border-radius:
|
|
3
|
-
border: ${
|
|
4
|
-
${e.stroke.primary};
|
|
1
|
+
import o from"styled-components";import{COLORS as r}from"../../../../constants/Theme.js";const t=o.div`
|
|
2
|
+
border-radius: 4px;
|
|
3
|
+
border: 1px solid ${r.stroke.primary};
|
|
5
4
|
max-height: 640px;
|
|
6
5
|
overflow: hidden;
|
|
7
6
|
display: flex;
|
|
8
7
|
flex-direction: row;
|
|
9
8
|
position: relative;
|
|
10
|
-
padding: ${o=>"2.0"===o.version?4:0}px;
|
|
11
|
-
background-color: ${e.surface.standard};
|
|
12
9
|
`;o.div`
|
|
13
10
|
padding: 14px 16px 14px 18px;
|
|
14
11
|
flex-direction: row;
|
|
15
12
|
align-items: center;
|
|
16
13
|
border-bottom-width: 1px;
|
|
17
14
|
border-bottom-style: solid;
|
|
18
|
-
border-bottom-color: ${
|
|
15
|
+
border-bottom-color: ${r.stroke.primary};
|
|
19
16
|
width: 100%;
|
|
20
17
|
height: 100%;
|
|
21
|
-
`;const
|
|
18
|
+
`;const e=o.div`
|
|
22
19
|
max-height: ${o=>"number"==typeof o.maxHeight?`${o.maxHeight}px`:o.maxHeight};
|
|
23
|
-
overflow-y:
|
|
20
|
+
overflow-y: hidden;
|
|
24
21
|
position: relative;
|
|
25
|
-
|
|
22
|
+
&:hover {
|
|
23
|
+
overflow-y: scroll;
|
|
24
|
+
}
|
|
25
|
+
&::-webkit-scrollbar-thumb {
|
|
26
|
+
border-radius: 4px;
|
|
27
|
+
width: 6px;
|
|
28
|
+
}
|
|
29
|
+
&::-webkit-scrollbar {
|
|
30
|
+
width: 6px;
|
|
31
|
+
}
|
|
32
|
+
&::-webkit-scrollbar-track {
|
|
33
|
+
width: 6px;
|
|
34
|
+
}
|
|
35
|
+
&:hover::-webkit-scrollbar-thumb {
|
|
36
|
+
background-color: #777;
|
|
37
|
+
width: 6px;
|
|
38
|
+
}
|
|
39
|
+
`;export{e as MenuListContainer,t as OpennedDropdownContainer};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as t,jsxs as
|
|
1
|
+
import{jsx as t,jsxs as r}from"react/jsx-runtime";import{TitleRegular as e,BodySecondary as o}from"../../../../TypographyStyle.js";import{COLORS as i}from"../../../../../constants/Theme.js";import{DescriptionContainer as n}from"./Description.styled.js";const s=s=>{let{title:c,description:l}=s;return t(n,{children:r("div",Object.assign({style:{padding:24}},{children:[t(e,Object.assign({style:{color:i.content.primary,marginBottom:4}},{children:c})),t(o,Object.assign({style:{color:i.content.secondary}},{children:l}))]}))})};export{s as Description};
|
package/dist/esm/components/dropdown/OpenedDropdown/components/description/Description.styled.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import o from"styled-components";import{COLORS as r}from"../../../../../constants/Theme.js";const t=o.div`
|
|
2
2
|
background: ${r.surface.standard};
|
|
3
|
-
border-left: ${
|
|
4
|
-
${r.stroke.primary};
|
|
3
|
+
border-left: 1px solid ${r.stroke.primary};
|
|
5
4
|
width: 50%;
|
|
6
5
|
`;export{t as DescriptionContainer};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,Fragment as t}from"react/jsx-runtime";import{useState as o}from"react";import{CheckBox as r}from"../../../../checkBox/CheckBox.js";import{ListItem as
|
|
1
|
+
import{jsx as e,Fragment as t}from"react/jsx-runtime";import{useState as o}from"react";import{CheckBox as r}from"../../../../checkBox/CheckBox.js";import{ListItem as n}from"../../../../list-item/ListItem.js";import{BodyCaption as i}from"../../../../TypographyStyle.js";import{COLORS as c}from"../../../../../constants/Theme.js";import{FreeFormContainer as m}from"./FreeFormMenu.styled.js";const s=s=>{let{searchedString:l,onSelect:a,isMultiSelect:p}=s;const[f,h]=o(!1);function u(){h(!f),a(!f)}return e(n,{onClick:e=>{e.preventDefault(),u()},listItem:{label:l,value:l},leadingIcon:p?e(r,{isChecked:f,onValueChange:u}):e(t,{}),trailingIcon:e(m,{children:e(i,Object.assign({style:{color:c.content.secondary}},{children:"Freeform"}))})})};export{s as FreeFormMenu};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import{jsx as e,Fragment as t}from"react/jsx-runtime";import o from"styled-components";import{CheckBox as i}from"../../../../checkBox/CheckBox.js";import{ListItem as n}from"../../../../list-item/ListItem.js";import{BodyCaption as
|
|
2
|
-
padding:
|
|
1
|
+
import{jsx as e,Fragment as t}from"react/jsx-runtime";import o from"styled-components";import{CheckBox as i}from"../../../../checkBox/CheckBox.js";import{ListItem as n}from"../../../../list-item/ListItem.js";import{BodyCaption as r}from"../../../../TypographyStyle.js";import{COLORS as s}from"../../../../../constants/Theme.js";import{FreeFormContainer as l}from"./FreeFormMenu.styled.js";const c=o(n)`
|
|
2
|
+
padding: 14px 16px !important;
|
|
3
3
|
cursor: pointer;
|
|
4
|
-
|
|
5
|
-
`,a=o=>{let{option:n,isMultiSelect:a,showDescription:d,onSelect:m,last:p,version:u}=o;var b;function g(e){n.disabled||m(Object.assign(Object.assign({},n),{selected:e}))}return e(c,{version:u,style:p?{borderBottom:0}:{},onClick:e=>{e.preventDefault(),g(!n.selected)},onMouseOver:function(){n.description?d(n.label,n.description):d()},listItem:{value:n.value,label:n.label},subText:n.subText,leadingIcon:a?e("div",Object.assign({style:{width:18}},{children:e(i,{size:"2.0"===u?"SMALL":"DEFAULT",isDisabled:null!==(b=n.disabled)&&void 0!==b&&b,isChecked:!!n.selected,onValueChange:g})})):n.leadingIcon?e(t,{children:n.leadingIcon}):e(t,{}),customComponent:n.customComponent,trailingIcon:n.isFreeForm?e(l,{children:e(s,Object.assign({style:{color:r.content.secondary}},{children:"Freeform"}))}):n.trailingIcon?e(t,{children:n.trailingIcon}):e(t,{}),variant:n.disabled?"inactive":n.selected?"selected":"default"})};export{a as MenuItem};
|
|
4
|
+
`,a=o=>{let{option:n,isMultiSelect:a,showDescription:d,onSelect:m,last:p}=o;var u;function b(e){n.disabled||m(Object.assign(Object.assign({},n),{selected:e}))}return e(c,{style:p?{borderBottom:0}:{},onClick:e=>{e.preventDefault(),b(!n.selected)},onMouseOver:function(){n.description?d(n.label,n.description):d()},listItem:{value:n.value,label:n.label},subText:n.subText,leadingIcon:a?e(i,{isDisabled:null!==(u=n.disabled)&&void 0!==u&&u,isChecked:!!n.selected,onValueChange:b}):n.leadingIcon?e(t,{children:n.leadingIcon}):e(t,{}),customComponent:n.customComponent,trailingIcon:n.isFreeForm?e(l,{children:e(r,Object.assign({style:{color:s.content.secondary}},{children:"Freeform"}))}):n.trailingIcon?e(t,{children:n.trailingIcon}):e(t,{}),variant:n.disabled?"inactive":n.selected?"selected":"default"})};export{a as MenuItem};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as t,Fragment as e,jsxs as
|
|
1
|
+
import{jsx as t,Fragment as e,jsxs as o}from"react/jsx-runtime";import{MenuItem as i}from"./MenuItem.js";import{StyledGroupedLabel as n}from"./MenuList.styled.js";const s=s=>{let{options:r,isMultiSelect:l,showDescription:c,onSelect:p}=s;return t(e,{children:r.map(((e,s)=>{const m=s===r.length-1;if(e.options){const r=e;return o("div",{children:[t(n,{children:r.label}),r.options.map(((e,o)=>t(i,{last:m,onSelect:p,showDescription:c,isMultiSelect:l,option:e},o)))]},s)}return t(i,{last:m,onSelect:p,showDescription:c,isMultiSelect:l,option:e},s)}))})};export{s as MenuList};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import o from"styled-components";import{BodyCaption as r}from"../../../../TypographyStyle.js";import{COLORS as
|
|
2
|
-
padding: 8px
|
|
3
|
-
color: ${
|
|
4
|
-
background-color: ${
|
|
5
|
-
|
|
6
|
-
`;export{e as StyledGroupedLabel};
|
|
1
|
+
import o from"styled-components";import{BodyCaption as r}from"../../../../TypographyStyle.js";import{COLORS as t}from"../../../../../constants/Theme.js";const n=o(r)`
|
|
2
|
+
padding: 8px 16px;
|
|
3
|
+
color: ${t.content.secondary};
|
|
4
|
+
background-color: ${t.background.base};
|
|
5
|
+
`;export{n as StyledGroupedLabel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{useState as t,useEffect as l}from"react";import{CheckBox as
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{useState as t,useEffect as l}from"react";import o from"styled-components";import{CheckBox as c}from"../../../../checkBox/CheckBox.js";import{ListItem as i}from"../../../../list-item/ListItem.js";const r=o(i)``,n=o=>{let{options:i,onSelect:n}=o;const[a,s]=t("notSelected");function d(){"partiallySelected"===a&&n("notSelected"),"selectAll"===a&&n("notSelected"),"notSelected"===a&&n("selectAll")}return l((()=>{const e=[];i.filter((e=>!e.disabled)).forEach((t=>{t.options?t.options.filter((e=>!e.disabled)).forEach((t=>{e.push(t.selected||!1)})):e.push(t.selected||!1)})),e.every(Boolean)?s("selectAll"):e.filter(Boolean).length>0?s("partiallySelected"):s("notSelected")}),[i]),e(r,{onClick:e=>{e.preventDefault(),d()},listItem:{label:"Select All",value:"All"},leadingIcon:e(c,{isChecked:"selectAll"===a||"partiallySelected"===a,isPartiallyChecked:"partiallySelected"===a,onValueChange:d}),variant:"default"})};export{n as SelectAllMenu};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as r,Fragment as o}from"react/jsx-runtime";import{useState as t}from"react";import{Input as e}from"../../../../input/Input.js";import{InputStyleContext as n}from"../../../../input/context/InputStyleProvider.js";import{COLORS as i}from"../../../../../constants/Theme.js";import s from"../../../../../assets/icons/cross.svg.js";import c from"../../../../../assets/icons/search.svg.js";const p=p=>{let{onSearch:m}=p;const[a,h]=t(""),[d,l]=t(!1);return r(n.Provider,Object.assign({value:{InputWrapper:{borderRadius:0,border:0,borderBottom:"1px solid "+i.stroke.primary,padding:"14px 16px"},IconHolder:{marginLeft:0},input:{marginLeft:4,minHeight:"100%"}}},{children:r(e,{placeholder:"Search",leftIcon:{icon:()=>r(c,{width:24,height:24,color:i.content.placeholder})},rightIcon:{icon:()=>a?r(s,{onClick:()=>{l(!0),m(""),h("")},width:24,height:24,color:i.content.placeholder}):r(o,{})},reset:d,onChangeText:r=>{l(!1),h(r),m(r)}})}))};export{p as SearchBox};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{ZeroState as r}from"../../../../zeroState/ZeroState.js";const e=e=>{let{searchedString:o}=e;return t("div",Object.assign({style:{margin:"28px auto"}},{children:t(r,{title:"No results found",subTitle:`Sorry we could not find any results for "${null!=o?o:""}"`})}))};export{e as SearchZeroState};
|
|
@@ -9,12 +9,10 @@ export interface OpenDropdownProps {
|
|
|
9
9
|
width?: string;
|
|
10
10
|
height?: number | string;
|
|
11
11
|
allowFreeForm?: boolean;
|
|
12
|
-
onClose?: (
|
|
12
|
+
onClose?: () => void;
|
|
13
13
|
onSelect?: (option: DropdownOption | DropdownOption[]) => void;
|
|
14
14
|
placement?: Placement;
|
|
15
15
|
strategy?: PositioningStrategy;
|
|
16
|
-
version?: '1.0' | '2.0';
|
|
17
|
-
skipSorting?: boolean;
|
|
18
16
|
}
|
|
19
17
|
export type GroupedOption = {
|
|
20
18
|
label?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as t}from"react/jsx-runtime";import{OpenedDropdown as o}from"../dropdown/OpenedDropdown/components/OpennedDropdown.js";import{FloatingActionButton as n}from"../floating-action-button/FloatingActionButton.js";import"../floating-action-button/FloatingActionButton.styles.js";const i=i=>{const{onSelect:e,menuOptions:d,buttonWidth:r,buttonHeight:l,buttonColor:p,buttonPosition:u,menuWidth:
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{OpenedDropdown as o}from"../dropdown/OpenedDropdown/components/OpennedDropdown.js";import{FloatingActionButton as n}from"../floating-action-button/FloatingActionButton.js";import"../floating-action-button/FloatingActionButton.styles.js";const i=i=>{const{onSelect:e,menuOptions:d,buttonWidth:r,buttonHeight:l,buttonColor:p,buttonPosition:u,menuWidth:c,menuHeight:s,buttonIcon:a,buttonPaddingHorizontal:m,buttonPaddingVertical:g,tooltipPlacement:h,tooltipText:b,zIndex:P,isRound:x,dropPosition:f,menuAligment:j,tooltipWidth:w}=i;return t("div",{children:t(n,Object.assign({icon:a,width:r,height:l,color:p,position:u,buttonPaddingHorizontal:m,buttonPaddingVertical:g,tooltipPlacement:h,tooltipText:b,zIndex:P,isRound:x,dropPosition:f,menuAligment:j,tootipWidth:w},{children:t(o,{options:d,height:s||90,width:`${c}px`,onSelect:e})}))})};export{i as FABMenu};
|