@bikdotai/bik-component-library 0.0.783-beta.7 → 0.0.783-beta.9
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/Filters/CustomField/components/CustomField.js +1 -1
- package/dist/cjs/components/QueryBuilder/Filters/Event/components/EventFilter.js +1 -1
- package/dist/cjs/components/QueryBuilder/Filters/Segment/components/SegmentFilter.js +1 -1
- package/dist/cjs/components/QueryBuilder/Filters/UserProperty/components/UserPropertyFilter.js +1 -1
- package/dist/cjs/components/QueryBuilder/Triggers/EVENTS/components/EventsTrigger.js +1 -1
- package/dist/cjs/components/QueryBuilder/Triggers/components/BaseTriggerQueryBuilderNode.js +1 -1
- package/dist/cjs/components/QueryBuilder/components/Connectors/Components/InTheLast.js +1 -1
- package/dist/cjs/components/QueryBuilder/components/Connectors/Components/InTwoLast.js +1 -1
- package/dist/cjs/components/QueryBuilder/components/Connectors/Components/MultiselectDropdownFreeText.js +1 -1
- package/dist/cjs/components/QueryBuilder/components/Connectors/Components/SingleselectDropdownFreeText.js +1 -1
- package/dist/cjs/components/QueryBuilder/components/Connectors/Connector.js +1 -1
- package/dist/cjs/components/QueryBuilder/components/DropdownWrapper.d.ts +1 -3
- package/dist/cjs/components/QueryBuilder/components/DropdownWrapper.js +1 -1
- package/dist/cjs/components/QueryBuilder/components/QueryBuilderNode/Property/PropertyNode.js +1 -1
- package/dist/cjs/components/QueryBuilder/types/QueryBuilderConnector.type.d.ts +0 -5
- package/dist/cjs/components/SearchFilter/components/SearchFilterItem.js +1 -1
- package/dist/cjs/components/TablePagination/TablePagination.d.ts +0 -1
- package/dist/cjs/components/TablePagination/TablePagination.js +1 -1
- package/dist/cjs/components/WhatsAppTextEditor/CustomEditor.styled.d.ts +0 -13
- package/dist/cjs/components/WhatsAppTextEditor/CustomEditor.styled.js +1 -1
- package/dist/cjs/components/WhatsAppTextEditor/WhatsAppTextEditor.d.ts +3 -128
- package/dist/cjs/components/WhatsAppTextEditor/WhatsAppTextEditor.js +1 -5
- package/dist/cjs/components/WhatsAppTextEditor/WhatsAppTextEditorHeader.d.ts +1 -42
- package/dist/cjs/components/WhatsAppTextEditor/WhatsAppTextEditorHeader.js +1 -1
- package/dist/cjs/components/alerts/Alert.styled.js +0 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/AnalyticsDropdown.js +1 -1
- package/dist/cjs/components/bik-layout/MockMenus.d.ts +1 -0
- package/dist/cjs/components/country-code-picker/CountryCodePicker.js +1 -1
- package/dist/cjs/components/country-code-picker/CountryPicker.js +1 -1
- package/dist/cjs/components/custom-date-time/CustomDateTime.js +1 -1
- package/dist/cjs/components/custom-date-time/DateSelector/DateSelector.js +1 -1
- package/dist/cjs/components/datePicker/TimePicker.js +1 -1
- package/dist/cjs/components/discount-modal/CouponExpiration/CouponExpiration.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/discount-modal/DynamicCoupon/MinimumRequirementComponent.js +1 -1
- package/dist/cjs/components/dropdown/Dropdown.d.ts +1 -0
- package/dist/cjs/components/dropdown/Dropdown.js +1 -1
- package/dist/cjs/components/dropdown/OpenedDropdown/components/OpennedDropdown.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 +5 -5
- 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/searchbox/SearchZeroState.d.ts +0 -2
- package/dist/cjs/components/dropdown/OpenedDropdown/components/searchbox/SearchZeroState.js +1 -1
- package/dist/cjs/components/dropdown/hooks/useDropdown.d.ts +0 -2
- package/dist/cjs/components/dropdown/hooks/useDropdown.js +1 -1
- package/dist/cjs/components/dropdown/type.d.ts +0 -11
- package/dist/cjs/components/dropdown-button/DropdownButton.js +1 -1
- package/dist/cjs/components/feature-announcements/MajorUpdatePopup.js +1 -1
- package/dist/cjs/components/feature-announcements/MinorUpdatePopup.js +1 -1
- package/dist/cjs/components/input/Input-helper.d.ts +0 -2
- package/dist/cjs/components/input/Input-helper.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/multi-level-dropdown/GroupedMenuList.d.ts +0 -4
- package/dist/cjs/components/multi-level-dropdown/GroupedMenuList.js +1 -1
- package/dist/cjs/components/multi-level-dropdown/MenuItem.d.ts +0 -3
- package/dist/cjs/components/multi-level-dropdown/MenuItem.js +1 -1
- package/dist/cjs/components/multi-level-dropdown/MenuList.d.ts +0 -4
- package/dist/cjs/components/multi-level-dropdown/MenuList.js +1 -1
- package/dist/cjs/components/multi-level-dropdown/MultiLevelDropdown.js +1 -1
- package/dist/cjs/components/multi-level-dropdown/type.d.ts +0 -3
- package/dist/cjs/components/radioButton/RadioButton.d.ts +0 -1
- package/dist/cjs/components/radioButton/RadioButton.js +1 -1
- package/dist/cjs/components/tag/Tag.styled.js +1 -1
- package/dist/cjs/components/template-preview/TemplatePreview.js +1 -1
- package/dist/cjs/components/zeroState/ZeroState.js +1 -2
- package/dist/cjs/helpers/BaseWhatsappContentLang.helper.js +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/esm/components/QueryBuilder/Filters/CustomField/components/CustomField.js +1 -1
- package/dist/esm/components/QueryBuilder/Filters/Event/components/EventFilter.js +1 -1
- package/dist/esm/components/QueryBuilder/Filters/Segment/components/SegmentFilter.js +1 -1
- package/dist/esm/components/QueryBuilder/Filters/UserProperty/components/UserPropertyFilter.js +1 -1
- package/dist/esm/components/QueryBuilder/Triggers/EVENTS/components/EventsTrigger.js +1 -1
- package/dist/esm/components/QueryBuilder/Triggers/components/BaseTriggerQueryBuilderNode.js +1 -1
- package/dist/esm/components/QueryBuilder/components/Connectors/Components/InTheLast.js +1 -1
- package/dist/esm/components/QueryBuilder/components/Connectors/Components/InTwoLast.js +1 -1
- package/dist/esm/components/QueryBuilder/components/Connectors/Components/MultiselectDropdownFreeText.js +1 -1
- package/dist/esm/components/QueryBuilder/components/Connectors/Components/SingleselectDropdownFreeText.js +1 -1
- package/dist/esm/components/QueryBuilder/components/Connectors/Connector.js +1 -1
- package/dist/esm/components/QueryBuilder/components/DropdownWrapper.d.ts +1 -3
- package/dist/esm/components/QueryBuilder/components/DropdownWrapper.js +1 -1
- package/dist/esm/components/QueryBuilder/components/QueryBuilderNode/Property/PropertyNode.js +1 -1
- package/dist/esm/components/QueryBuilder/types/QueryBuilderConnector.type.d.ts +0 -5
- package/dist/esm/components/SearchFilter/components/SearchFilterItem.js +1 -1
- package/dist/esm/components/TablePagination/TablePagination.d.ts +0 -1
- package/dist/esm/components/TablePagination/TablePagination.js +1 -1
- package/dist/esm/components/WhatsAppTextEditor/CustomEditor.styled.d.ts +0 -13
- package/dist/esm/components/WhatsAppTextEditor/CustomEditor.styled.js +1 -1
- package/dist/esm/components/WhatsAppTextEditor/WhatsAppTextEditor.d.ts +3 -128
- package/dist/esm/components/WhatsAppTextEditor/WhatsAppTextEditor.js +1 -5
- package/dist/esm/components/WhatsAppTextEditor/WhatsAppTextEditorHeader.d.ts +1 -42
- package/dist/esm/components/WhatsAppTextEditor/WhatsAppTextEditorHeader.js +1 -1
- package/dist/esm/components/alerts/Alert.styled.js +8 -9
- package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsDropdown.js +1 -1
- package/dist/esm/components/bik-layout/MockMenus.d.ts +1 -0
- package/dist/esm/components/country-code-picker/CountryCodePicker.js +1 -1
- package/dist/esm/components/country-code-picker/CountryPicker.js +1 -1
- package/dist/esm/components/custom-date-time/CustomDateTime.js +1 -1
- package/dist/esm/components/custom-date-time/DateSelector/DateSelector.js +1 -1
- package/dist/esm/components/datePicker/TimePicker.js +1 -1
- package/dist/esm/components/discount-modal/CouponExpiration/CouponExpiration.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/discount-modal/DynamicCoupon/MinimumRequirementComponent.js +1 -1
- package/dist/esm/components/dropdown/Dropdown.d.ts +1 -0
- package/dist/esm/components/dropdown/Dropdown.js +1 -1
- package/dist/esm/components/dropdown/OpenedDropdown/components/OpennedDropdown.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 +11 -11
- 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/searchbox/SearchZeroState.d.ts +0 -2
- package/dist/esm/components/dropdown/OpenedDropdown/components/searchbox/SearchZeroState.js +1 -1
- package/dist/esm/components/dropdown/hooks/useDropdown.d.ts +0 -2
- package/dist/esm/components/dropdown/hooks/useDropdown.js +1 -1
- package/dist/esm/components/dropdown/type.d.ts +0 -11
- package/dist/esm/components/dropdown-button/DropdownButton.js +1 -1
- package/dist/esm/components/feature-announcements/MajorUpdatePopup.js +1 -1
- package/dist/esm/components/feature-announcements/MinorUpdatePopup.js +1 -1
- package/dist/esm/components/input/Input-helper.d.ts +0 -2
- package/dist/esm/components/input/Input-helper.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/multi-level-dropdown/GroupedMenuList.d.ts +0 -4
- package/dist/esm/components/multi-level-dropdown/GroupedMenuList.js +1 -1
- package/dist/esm/components/multi-level-dropdown/MenuItem.d.ts +0 -3
- package/dist/esm/components/multi-level-dropdown/MenuItem.js +1 -1
- package/dist/esm/components/multi-level-dropdown/MenuList.d.ts +0 -4
- package/dist/esm/components/multi-level-dropdown/MenuList.js +1 -1
- package/dist/esm/components/multi-level-dropdown/MultiLevelDropdown.js +1 -1
- package/dist/esm/components/multi-level-dropdown/type.d.ts +0 -3
- package/dist/esm/components/radioButton/RadioButton.d.ts +0 -1
- package/dist/esm/components/radioButton/RadioButton.js +1 -1
- package/dist/esm/components/tag/Tag.styled.js +1 -1
- package/dist/esm/components/template-preview/TemplatePreview.js +1 -1
- package/dist/esm/components/zeroState/ZeroState.js +1 -2
- package/dist/esm/helpers/BaseWhatsappContentLang.helper.js +1 -1
- package/dist/esm/index.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/assets/icons/magic-line.svg.js +0 -1
- package/dist/cjs/assets/icons/refresh-purple.svg.js +0 -1
- package/dist/cjs/assets/icons/rewind.svg.js +0 -1
- package/dist/cjs/assets/icons/thumbs_down.svg.js +0 -1
- package/dist/cjs/assets/icons/thumbs_up.svg.js +0 -1
- package/dist/cjs/components/WhatsAppTextEditor/AIRephrase.styled.d.ts +0 -10
- package/dist/cjs/components/WhatsAppTextEditor/AIRephrase.styled.js +0 -1
- package/dist/cjs/components/WhatsAppTextEditor/AIRephraseButton.d.ts +0 -17
- package/dist/cjs/components/WhatsAppTextEditor/AIRephraseButton.js +0 -1
- package/dist/cjs/components/WhatsAppTextEditor/BorderAnimation.d.ts +0 -11
- package/dist/cjs/components/WhatsAppTextEditor/BorderAnimation.js +0 -1
- package/dist/cjs/components/WhatsAppTextEditor/ai/actionRegistry.d.ts +0 -14
- package/dist/cjs/components/WhatsAppTextEditor/ai/actionRegistry.js +0 -1
- package/dist/cjs/components/WhatsAppTextEditor/ai/aiTag.d.ts +0 -63
- package/dist/cjs/components/WhatsAppTextEditor/ai/aiTag.js +0 -1
- package/dist/cjs/components/WhatsAppTextEditor/ai/api.d.ts +0 -22
- package/dist/cjs/components/WhatsAppTextEditor/ai/api.js +0 -1
- package/dist/esm/assets/icons/magic-line.svg.js +0 -1
- package/dist/esm/assets/icons/refresh-purple.svg.js +0 -1
- package/dist/esm/assets/icons/rewind.svg.js +0 -1
- package/dist/esm/assets/icons/thumbs_down.svg.js +0 -1
- package/dist/esm/assets/icons/thumbs_up.svg.js +0 -1
- package/dist/esm/components/WhatsAppTextEditor/AIRephrase.styled.d.ts +0 -10
- package/dist/esm/components/WhatsAppTextEditor/AIRephrase.styled.js +0 -1
- package/dist/esm/components/WhatsAppTextEditor/AIRephraseButton.d.ts +0 -17
- package/dist/esm/components/WhatsAppTextEditor/AIRephraseButton.js +0 -1
- package/dist/esm/components/WhatsAppTextEditor/BorderAnimation.d.ts +0 -11
- package/dist/esm/components/WhatsAppTextEditor/BorderAnimation.js +0 -1
- package/dist/esm/components/WhatsAppTextEditor/ai/actionRegistry.d.ts +0 -14
- package/dist/esm/components/WhatsAppTextEditor/ai/actionRegistry.js +0 -1
- package/dist/esm/components/WhatsAppTextEditor/ai/aiTag.d.ts +0 -63
- package/dist/esm/components/WhatsAppTextEditor/ai/aiTag.js +0 -1
- package/dist/esm/components/WhatsAppTextEditor/ai/api.d.ts +0 -22
- package/dist/esm/components/WhatsAppTextEditor/ai/api.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as t}from"react/jsx-runtime";import{ZeroState as e}from"../../../../zeroState/ZeroState.js";const
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{ZeroState as e}from"../../../../zeroState/ZeroState.js";const i=i=>{let{searchedString:r,height:n,isLoading:o,containerWidth:s}=i;return t("div",Object.assign({style:{height:n,display:"flex",alignItems:"center"}},{children:t(e,{isLoading:o,title:"No results found",subTitle:`Sorry we could not find any results for "${null!=r?r:""}"`,containerWidth:s})}))};export{i as SearchZeroState};
|
|
@@ -7,8 +7,6 @@ export declare const useDropdown: (version: string | undefined, options: Dropdow
|
|
|
7
7
|
search: (searchKey: string) => void;
|
|
8
8
|
searchedString: string;
|
|
9
9
|
searchedOptions: DropdownOption[];
|
|
10
|
-
searchError: string | undefined;
|
|
11
|
-
retrySearch: () => void;
|
|
12
10
|
onApplyHandler: (optionSelect: SingleOption, returnOnly?: boolean) => ({
|
|
13
11
|
label: string;
|
|
14
12
|
value: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"lodash/debounce";import{useState as t,useRef as s,useEffect as l,useCallback as n,useMemo as c}from"react";import{iterateOnOptionsRaw as i,iterateOnOptions as o}from"../OpenedDropdown/utils/iterationOnOptions.js";const a=function(){let a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"1.0",r=arguments.length>1?arguments[1]:void 0,u=arguments.length>2?arguments[2]:void 0,d=arguments.length>3?arguments[3]:void 0,v=arguments.length>4?arguments[4]:void 0,f=arguments.length>5?arguments[5]:void 0,p=arguments.length>6?arguments[6]:void 0,b=arguments.length>7&&void 0!==arguments[7]?arguments[7]:[],g=arguments.length>8?arguments[8]:void 0;const[O,j]=t(null!=r?r:[]),[h,m]=t([]),[w,C]=t(""),S=s(O),F=s(f);l((()=>{F.current=f}),[f]),l((()=>{if(S.current=O,h.length&&w&&f){let e=[...h];const t=O.map((e=>{if(e.options)return e.options.map((e=>({value:e.value,selected:e.selected})));const t=e;return{value:t.value,selected:t.selected}})).flat();e=e.map((e=>{const s=t.find((t=>e.value===t.value));return s?Object.assign(Object.assign({},e),{selected:s.selected}):e})),p&&(e=e.map((e=>Object.assign(Object.assign({},e),{disabled:!b.includes(e.value)})))),m(v&&!d?[...e.sort((e=>e.selected?-1:1))]:[...e])}}),[O]),l((()=>{if(r){const e=[...r];j(v&&!d?[...e.sort((e=>e.selected?-1:1))]:[...e])}}),[r]);const L=e=>{const t=[];return e.forEach((e=>{if(e.options){const s=e.options.filter((e=>!0===e.selected));t.push(Object.assign(Object.assign({},e),{options:[...s]}))}else e.selected&&t.push(Object.assign({},e))})),t},A=e=>{let t=0;return e.forEach((e=>{e.options?t+=e.options.filter((e=>!0===e.selected)).length:e.selected&&t++})),t},E=e=>!(!v||!g&&0!==g)&&A(e)>=g,x=n((e=>{const t=F.current;if(!e||!t)return;const s=[];i(S.current,(e=>{e.selected&&!s.includes(e.value)&&s.push(e.value)})),t(e).then((e=>{if(e){const t=e.map((e=>{if(e.options){const t=e;return Object.assign(Object.assign({},t),{options:t.options.map((e=>Object.assign(Object.assign({},e),{selected:s.includes(e.value)})))})}return Object.assign(Object.assign({},e),{selected:s.includes(e.value)})}));m([...t])}}))}),[]),M=c((()=>e(x,300)),[x]);function y(e,t){if(v){if(e.selected&&g&&E(O))return;if(h.length&&w&&f)if(e.selected){if(g&&E(O))return;let s=!1;const l=o(O,{selected:e.selected},(t=>t.value===e.value&&(s=!0,!0)));if(s||l.push(e),t)return[...l];j([...l]),"2.0"===a&&D(l)}else{let s=!1,l=o(O,{selected:e.selected},(t=>t.value===e.value&&(s=!0,!0)));if(s&&(l=l.filter((t=>t.value!==e.value))),t)return[...l];j([...l]),"2.0"===a&&D(l)}else{const s=o(O,{selected:e.selected},(t=>t.value===e.value));if(t)return[...s];j([...s]),"2.0"===a&&D(s)}}else null==u||u(e)}function D(e){const t=L(null!=e?e:S.current);null==u||u([...t])}return l((()=>()=>null==M?void 0:M.cancel()),[M]),{latestDropdownOptionsRef:S,dropdownOptions:O,search:function(e){C(e),m([]),e?M(e):null==M||M.cancel()},searchedString:w,searchedOptions:h,onApplyHandler:y,selectAllHandler:function(e){if(h.length&&w&&f)"selectAll"===e?function(e){let t=[...O];if(e&&g&&g>0){const e=A(t),s=g-e;if(s<=0)return;let l=0;h.forEach((e=>{if(l>=s)return;let n=!1;t=t.map((t=>{const s=e;return t.selected||t.disabled?t:void 0!==s.value&&s.value===t.value?(n=!0,l++,Object.assign(Object.assign({},t),{selected:!0})):t})),!n&&l<s&&(e.disabled||(t.push(Object.assign(Object.assign({},e),{selected:!0})),l++))})),j([...t]),"2.0"===a&&D(t)}}(!0):function(e){let t=[...O];e?h.forEach((e=>{let s=!1;t=t.map((t=>{const l=e;return void 0!==l.value&&l.value===t.value?(s=!0,Object.assign(Object.assign({},t),{selected:!0})):t})),s||t.push(Object.assign(Object.assign({},e),{selected:!0}))})):h.forEach((e=>{t=t.map((t=>{const s=e;return void 0!==s.value&&s.value===t.value?Object.assign(Object.assign({},t),{selected:!1}):t}))})),j([...t]),"2.0"===a&&D(t)}(!1);else if("selectAll"===e)if(g&&g>0){const e=A(O),t=g-e;if(t<=0)return;let s=0;const l=O.map((e=>{var l;if(e.options){const l=e;return Object.assign(Object.assign({},l),{options:l.options.map((e=>{var l;return e.disabled||e.selected||w&&!(null===(l=e.label)||void 0===l?void 0:l.toLowerCase().includes(w.toLowerCase()))?e:s<t?(s++,Object.assign(Object.assign({},e),{selected:!0})):e}))})}{const n=e;return n.disabled||(n.selected||w&&!(null===(l=n.label)||void 0===l?void 0:l.toLowerCase().includes(w.toLowerCase())))?e:s<t?(s++,Object.assign(Object.assign({},e),{selected:!0})):e}}));j([...l]),"2.0"===a&&D(l)}else{const e=o(O,{selected:!0},(e=>{var t;return w?(null===(t=e.label)||void 0===t?void 0:t.toLowerCase().includes(w.toLowerCase()))&&!e.disabled:!e.disabled}));j([...e]),"2.0"===a&&D(e)}else if("notSelected"===e){const e=o(O,{selected:!1},(e=>!e.disabled));j([...e]),"2.0"===a&&D(e)}},onMultiSelectClear:function(){const e=o(O,{selected:!1});j([...e]),"2.0"===a&&D(e)},onFreeFormSelect:function(e){if(!v)return void y({label:w,value:w,isFreeForm:!0,selected:!0});const t=O.map((t=>t.options?t:Object.assign(Object.assign({},t),{selected:t.label===w&&t.value===w?e:t.selected})));e&&(t.some((e=>e.label===w&&e.value===w))||t.unshift({label:w,value:w,isFreeForm:!0,selected:!0})),j([...t]),"2.0"===a&&D(t)},onMultiSelectApply:D,getSelectedOptions:L,getCurrentSelectionCount:A,isMaxSelectionsReached:E,maxSelections:g}};export{a as useDropdown};
|
|
@@ -27,15 +27,6 @@ export interface OpenDropdownProps {
|
|
|
27
27
|
onDropdownItemClick?: (option: DropdownOption) => void;
|
|
28
28
|
buttonOptions?: ButtonOptions;
|
|
29
29
|
isSearchLoading?: boolean;
|
|
30
|
-
isOptionsLoading?: boolean;
|
|
31
|
-
optionsErrorState?: {
|
|
32
|
-
Icon?: React.ReactNode;
|
|
33
|
-
IconHolderStyle?: React.CSSProperties;
|
|
34
|
-
actionButton?: ButtonProps;
|
|
35
|
-
buttonWidth?: number;
|
|
36
|
-
title?: string;
|
|
37
|
-
subTitle?: string;
|
|
38
|
-
};
|
|
39
30
|
disableSearchOptions?: boolean;
|
|
40
31
|
disableSearchedOptionExcept?: string[];
|
|
41
32
|
useDefaultCursor?: boolean;
|
|
@@ -56,8 +47,6 @@ export interface OpenDropdownProps {
|
|
|
56
47
|
onOptionsReorder?: (reorderedOptions: DropdownOption[]) => void;
|
|
57
48
|
/** z-index of the dropdown popover. Defaults to 3. */
|
|
58
49
|
dropdownZIndex?: number;
|
|
59
|
-
/** When true, renders a checkbox alongside the customComponent in multiselect mode */
|
|
60
|
-
showCheckboxForCustomElement?: boolean;
|
|
61
50
|
}
|
|
62
51
|
export type GroupedOption = {
|
|
63
52
|
label?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest as o}from"../../_virtual/_tslib.js";import{jsxs as t,jsx as n}from"react/jsx-runtime";import{DropdownPopover as r}from"../dropdown/DropdownPopover/index.js";import"../dropdown/Dropdown.js";import"../dropdown/ChipDropdown.js";import"react";import"../zeroState/ZeroState.js";import"
|
|
1
|
+
import{__rest as o}from"../../_virtual/_tslib.js";import{jsxs as t,jsx as n}from"react/jsx-runtime";import{DropdownPopover as r}from"../dropdown/DropdownPopover/index.js";import"../dropdown/Dropdown.js";import"../dropdown/ChipDropdown.js";import"react";import"../zeroState/ZeroState.js";import"lodash/debounce";import"../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 as e}from"../button/Button.js";import"../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js";import"../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js";import"../icon-button/IconButton.js";import"../input/Input.js";import"../dropdown/MenuItem/MenuItem.js";import{SpinnerColorMap as p}from"../button/themes.js";import{Spinner as s}from"../spinner/Spinner.js";import{DropdownButtonStyle as i,LoaderContainer as d}from"./DropdownButton.style.js";const m=m=>{var u,l;const a=m.buttonProps,c=o(a,["onClick"]);return t(i,Object.assign({type:m.buttonProps.buttonType,disabled:m.buttonProps.disabled},{children:[(null===(u=m.buttonProps)||void 0===u?void 0:u.isLoading)&&n(d,{children:n(s,{className:"spinner",size:"small",color:p(m.buttonProps.buttonType||"primary",m.buttonProps.inverse)})}),n(e,Object.assign({},m.buttonProps,{isLoading:!1,style:{borderRadius:"0px",borderTopLeftRadius:"4px",borderBottomLeftRadius:"4px",borderRight:"0px"}})),n("div",{className:"dd-button-divider"}),n(r,Object.assign({},m.dropdownProps,{isChildLoading:null===(l=m.buttonProps)||void 0===l?void 0:l.isLoading},{children:n(e,Object.assign({},c,{isLoading:!1,buttonText:"",TrailingIcon:m.iconProps,style:{borderRadius:"0px",borderTopRightRadius:"4px",borderBottomRightRadius:"4px"}}))}))]}))};export{m as DropdownButton};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as t,jsxs as e,Fragment as n}from"react/jsx-runtime";import{useState as o,useRef as r,useEffect as s}from"react";import a from"../../assets/icons/chevronRight2.svg.js";import i from"../../assets/icons/play.svg.js";import{TEXT as l}from"./constants/index.js";import{getMajorPopupStyles as c}from"./styles/majorPopup.styles.js";import"../../constants/Theme.js";import"./constants/animations.js";import{decodeHTMLEntities as u}from"./utils/htmlHelpers.js";import{hideJoyrideArrow as d,calculateCloseTransform as p,executeAfterAnimation as g}from"./utils/animationHelpers.js";import{findWhatsNewButton as y}from"./utils/elementHelpers.js";const b=b=>{let{feature:v,currentIndex:h,totalFeatures:m,onSkip:f,onExplore:j,onPrevious:O,onNext:B,setIsClosing:T,onSecondaryAction:k,ratio:x="16:9",padding:M}=b;var E,P,C,L,w;const[U,W]=o(!1),[_,I]=o(!1),[D,H]=o(""),S=r(null),[A,R]=o(!1),[V,F]=o(!0),N=r(null),[z,G]=o(x),K=r(null);s((()=>{U&&I(!0)}),[U]);const X=t=>{var e,n;t.preventDefault(),t.stopPropagation();const o=null===(e=v.secondaryButton)||void 0===e?void 0:e.action
|
|
1
|
+
import{jsx as t,jsxs as e,Fragment as n}from"react/jsx-runtime";import{useState as o,useRef as r,useEffect as s}from"react";import a from"../../assets/icons/chevronRight2.svg.js";import i from"../../assets/icons/play.svg.js";import{TEXT as l}from"./constants/index.js";import{getMajorPopupStyles as c}from"./styles/majorPopup.styles.js";import"../../constants/Theme.js";import"./constants/animations.js";import{decodeHTMLEntities as u}from"./utils/htmlHelpers.js";import{hideJoyrideArrow as d,calculateCloseTransform as p,executeAfterAnimation as g}from"./utils/animationHelpers.js";import{findWhatsNewButton as y}from"./utils/elementHelpers.js";const b=b=>{let{feature:v,currentIndex:h,totalFeatures:m,onSkip:f,onExplore:j,onPrevious:O,onNext:B,setIsClosing:T,onSecondaryAction:k,ratio:x="16:9",padding:M}=b;var E,P,C,L,w;const[U,W]=o(!1),[_,I]=o(!1),[D,H]=o(""),S=r(null),[A,R]=o(!1),[V,F]=o(!0),N=r(null),[z,G]=o(x),K=r(null);s((()=>{U&&I(!0)}),[U]);const X=t=>{var e,n;t.preventDefault(),t.stopPropagation();const o=null===(e=v.secondaryButton)||void 0===e?void 0:e.action;if("Open link"===o){const t=null===(n=v.secondaryButton)||void 0===n?void 0:n.redirectionUrl;if(t){t.startsWith("http")?window.open(t,"_blank","noopener,noreferrer"):window.location.href=t}}else"Close popup"!==o&&""!==o||k&&k();d(S.current);const r=y();if(r&&S.current){const t=p(S.current,r);H(t)}else H("scale(0)");null==T||T(!0),W(!0)},$=c(_,D,z,M||v.padding,null===(E=v.primaryButton)||void 0===E?void 0:E.style,null===(P=v.secondaryButton)||void 0===P?void 0:P.style);return t("div",Object.assign({style:$.outerWrapper},{children:e("div",Object.assign({ref:S,style:Object.assign(Object.assign({},$.container),{opacity:_?0:1,transition:"opacity 0.2s ease-in-out, transform 0.3s ease"})},{children:[t("style",{children:"\n\t\t\t\t[data-popup-content] ul {\n\t\t\t\t\tmargin: 0;\n\t\t\t\t\tpadding-left: 20px;\n\t\t\t\t\tlist-style-type: disc;\n\t\t\t\t}\n\t\t\t\t[data-popup-content] ul li {\n\t\t\t\t\tmargin-bottom: 8px;\n\t\t\t\t\tcolor: rgba(255, 255, 255, 0.8);\n\t\t\t\t\tfont-size: 12px;\n\t\t\t\t\tline-height: 16px;\n\t\t\t\t\tfont-family: Inter, sans-serif;\n\t\t\t\t}\n\t\t\t"}),e("div",Object.assign({style:$.contentWrapper},{children:[t("div",Object.assign({style:$.imageContainer},{children:v.productVideo?e(n,{children:[t("video",{ref:N,src:v.productVideo,style:$.image,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,controls:!0,"aria-label":`Product video for ${v.title}`,onLoadedMetadata:t=>{const e=t.currentTarget,n=e.videoWidth,o=e.videoHeight;if(n&&o){const t=n/o;Math.abs(t-16/9)<.1?G("16:9"):Math.abs(t-1)<.1?G("1:1"):Math.abs(t-4/3)<.1?G("4:3"):G(t>1.5?"16:9":t<.9?"4:3":"1:1")}}}),(A||V)&&t("div",Object.assign({style:$.videoOverlay,onClick:t=>{t.stopPropagation(),N.current&&(N.current.paused?(N.current.play(),R(!1),F(!1)):(N.current.pause(),R(!0),F(!0)))},role:"button",tabIndex:0,"aria-label":A?"Play video":"Pause video",onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),t.stopPropagation(),N.current&&(N.current.paused?(N.current.play(),R(!1),F(!1)):(N.current.pause(),R(!0),F(!0))))}},{children:t(i,{width:20,height:20})}))]}):v.displayImage?t("img",{ref:K,src:v.displayImage,alt:v.title,style:$.image,onLoad:t=>{const e=t.currentTarget,n=e.naturalWidth,o=e.naturalHeight;if(n&&o){const t=n/o;Math.abs(t-16/9)<.1?G("16:9"):Math.abs(t-1)<.1?G("1:1"):Math.abs(t-4/3)<.1?G("4:3"):G(t>1.5?"16:9":t<.9?"4:3":"1:1")}},onError:t=>{v.image&&(t.target.src=v.image)}}):t("div",Object.assign({style:$.imagePlaceholder},{children:l.FEATURE_PREVIEW_PLACEHOLDER}))})),e("div",Object.assign({style:$.contentContainer},{children:[t("div",Object.assign({style:$.skipButtonContainer},{children:t("button",Object.assign({onClick:t=>{t.preventDefault(),t.stopPropagation(),(t=>{d(S.current);const e=y();if(e&&S.current){const t=p(S.current,e);H(t)}else H("scale(0)");null==T||T(!0),W(!0),g(t)})(f)},style:$.skipButton.base,onMouseEnter:t=>Object.assign(t.currentTarget.style,$.skipButton.hover),onMouseLeave:t=>Object.assign(t.currentTarget.style,$.skipButton.base),"aria-label":"Skip feature announcement"},{children:"Skip"}))})),t("h3",Object.assign({style:$.title},{children:v.title})),t("div",{"data-popup-content":!0,style:$.content,dangerouslySetInnerHTML:{__html:u(v.content||v.body||"")}}),e("div",Object.assign({style:$.actionsWrapper},{children:[e("div",Object.assign({style:$.buttonsGroup},{children:[t("button",Object.assign({onClick:()=>{var t,e;const n=null===(t=v.primaryButton)||void 0===t?void 0:t.action;if("Play Video"===n)j();else if("Open link"===n){const t=(null===(e=v.primaryButton)||void 0===e?void 0:e.redirectionUrl)||v.redirectUrl;if(t){t.startsWith("http")?window.open(t,"_blank","noopener,noreferrer"):window.location.href=t}}else j();d(S.current);const o=y();if(o&&S.current){const t=p(S.current,o);H(t)}else H("scale(0)");null==T||T(!0),W(!0)},style:$.exploreButton.base,onMouseEnter:t=>Object.assign(t.currentTarget.style,$.exploreButton.hover),onMouseLeave:t=>Object.assign(t.currentTarget.style,$.exploreButton.base)},{children:(null===(C=v.primaryButton)||void 0===C?void 0:C.text)||v.buttonText||l.DEFAULT_BUTTON_TEXT})),(null===(L=v.secondaryButton)||void 0===L?void 0:L.text)&&((null===(w=v.secondaryButton)||void 0===w?void 0:w.redirectionUrl)?t("a",Object.assign({href:v.secondaryButton.redirectionUrl,target:v.secondaryButton.redirectionUrl.startsWith("http")?"_blank":"_self",rel:v.secondaryButton.redirectionUrl.startsWith("http")?"noopener noreferrer":void 0,onClick:X,style:$.secondaryButton.base,onMouseEnter:t=>Object.assign(t.currentTarget.style,$.secondaryButton.hover),onMouseLeave:t=>Object.assign(t.currentTarget.style,$.secondaryButton.base)},{children:v.secondaryButton.text})):t("button",Object.assign({onClick:X,style:$.secondaryButton.base,onMouseEnter:t=>Object.assign(t.currentTarget.style,$.secondaryButton.hover),onMouseLeave:t=>Object.assign(t.currentTarget.style,$.secondaryButton.base)},{children:v.secondaryButton.text})))]})),m>1&&e("div",Object.assign({style:$.navigationContainer},{children:[t("button",Object.assign({onClick:t=>{t.preventDefault(),t.stopPropagation(),O()},disabled:0===h,style:$.navigationButton(0===h).base,onMouseEnter:t=>{0!==h&&Object.assign(t.currentTarget.style,$.navigationButton(!1).hover)},onMouseLeave:t=>{0!==h&&Object.assign(t.currentTarget.style,$.navigationButton(!1).base)},"aria-label":"Previous feature"},{children:t(a,{style:{transform:"rotate(180deg)"}})})),t("button",Object.assign({onClick:t=>{t.preventDefault(),t.stopPropagation(),B()},disabled:h===m-1,style:$.navigationButton(h===m-1).base,onMouseEnter:t=>{h!==m-1&&Object.assign(t.currentTarget.style,$.navigationButton(!1).hover)},onMouseLeave:t=>{h!==m-1&&Object.assign(t.currentTarget.style,$.navigationButton(h===m-1).base)},"aria-label":"Next feature"},{children:t(a,{})}))]}))]}))]}))]}))]}))}))};export{b as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useState as n,useRef as r,useEffect as o}from"react";import{TEXT as i}from"./constants/index.js";import"../../constants/Theme.js";import"./constants/animations.js";import{getMinorPopupStyles as s}from"./styles/minorPopup.styles.js";import{decodeHTMLEntities as l}from"./utils/htmlHelpers.js";import{hideJoyrideArrow as a,calculateCloseTransform as c
|
|
1
|
+
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useState as n,useRef as r,useEffect as o}from"react";import{TEXT as i}from"./constants/index.js";import"../../constants/Theme.js";import"./constants/animations.js";import{getMinorPopupStyles as s}from"./styles/minorPopup.styles.js";import{decodeHTMLEntities as l}from"./utils/htmlHelpers.js";import{hideJoyrideArrow as a,calculateCloseTransform as c}from"./utils/animationHelpers.js";import{findFeatureTagElement as d}from"./utils/elementHelpers.js";const u=u=>{let{feature:m,currentIndex:p,totalFeatures:f,onSkip:g,onExplore:y,onPrevious:v,onNext:h,setIsClosing:T}=u;var j,b;const[O,x]=n(!1),[B,E]=n(!1),[w,C]=n(""),_=r(null);o((()=>{O&&E(!0)}),[O]);const k=s(B,w);return e("div",Object.assign({ref:_,style:k.container},{children:[t("div",Object.assign({style:k.imageContainer},{children:m.displayImage?t("div",Object.assign({style:k.imageWrapper},{children:t("img",{src:m.displayImage,alt:m.title,style:k.image,onError:e=>{m.image&&(e.target.src=m.image)}})})):t("div",Object.assign({style:k.imagePlaceholder},{children:i.FEATURE_PREVIEW_PLACEHOLDER}))})),e("div",Object.assign({style:k.contentContainer},{children:[e("div",{children:[t("h3",Object.assign({style:k.title},{children:m.title})),t("div",{style:k.content,dangerouslySetInnerHTML:{__html:l(m.content||m.body||"")}})]}),e("div",Object.assign({style:k.actionsContainer},{children:[(null===(j=m.secondaryButton)||void 0===j?void 0:j.text)&&t("span",Object.assign({onClick:()=>{var e,t,n;const r=null===(e=m.secondaryButton)||void 0===e?void 0:e.action;if("Open link"===r){const e=null===(t=m.secondaryButton)||void 0===t?void 0:t.redirectionUrl;if(e){e.startsWith("http")?window.open(e,"_blank","noopener,noreferrer"):window.location.href=e}}else"Close popup"!==r&&""!==r||null===(n=m.secondaryButton)||void 0===n||n.action;if(a(_.current),_.current&&m.featureTag){const e=d(m.featureTag);if(e){const t=c(_.current,e);C(t)}else C("scale(0)")}else C("scale(0)");null==T||T(!0),x(!0)},style:k.understoodText},{children:m.secondaryButton.text})),t("button",Object.assign({onClick:()=>{var e,t;const n=null===(e=m.primaryButton)||void 0===e?void 0:e.action;if("Play Video"===n)y();else if("Open link"===n){const e=(null===(t=m.primaryButton)||void 0===t?void 0:t.redirectionUrl)||m.redirectUrl;if(e){e.startsWith("http")?window.open(e,"_blank","noopener,noreferrer"):window.location.href=e}}else y();if(a(_.current),_.current&&m.featureTag){const e=m.featureTag.startsWith("#")||m.featureTag.startsWith(".")||m.featureTag.startsWith("[")?m.featureTag:`#${m.featureTag}`,t=document.querySelector(e);if(t){const e=c(_.current,t);C(e)}else C("scale(0)")}else C("scale(0)");null==T||T(!0),x(!0)},style:k.exploreButton},{children:(null===(b=m.primaryButton)||void 0===b?void 0:b.text)||m.buttonText||i.DEFAULT_BUTTON_TEXT}))]}))]}))]}))};export{u as default};
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { InputTypeI } from "./Input";
|
|
2
2
|
export declare const isFunction: (fn: any) => boolean;
|
|
3
|
-
export declare const sanitizeUnsafeInput: (input: string) => string;
|
|
4
|
-
export declare const shouldSanitizeForType: (type: InputTypeI) => boolean;
|
|
5
3
|
export declare const validateInput: (inputText: string | number, type: InputTypeI, rangeValidation?: {
|
|
6
4
|
min?: number;
|
|
7
5
|
max?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{phone as
|
|
1
|
+
import{phone as n}from"phone";const e=n=>n&&"function"==typeof n,r=function(e,r){let t,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const a=["phonenumber","zip","number"].includes(r),l=a?e?Number(e):null:e;if(null==l||""===l)return[!0,""];if(a&&String(l).length&&(i.min&&l<i.min||i.max&&l>i.max))return[!1,`Enter valid number between ${i.min} and ${i.max}`];if("email"===r)return t=/(.+)@(.+){2,}\.(.+){2,}/,l.match(t)?[!0,""]:[!1,"Enter a valid email id"];if("url"===r)return t=/^https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_\+.~#?&\/=]*)$/,l.match(t)?[!0,""]:[!1,"Enter a valid url"];if("number"===r)return l>=0?[!0,""]:[!1,"Enter a valid number"];if("zip"===r)return 6===String(l).trim().length?[!0,""]:[!1,"Enter a valid zip code"];if("phonenumber"===r){const{isValid:e}=n("+"+String(l));return e?[!0,""]:[!1,"Enter a valid phonenumber"]}return(null==l?void 0:l.trim().length)>0?[!0,""]:[!1,"Enter a valid data"]};export{e as isFunction,r as validateInput};
|
|
@@ -69,6 +69,5 @@ export interface InputProps {
|
|
|
69
69
|
inputWrapperStyles?: React.CSSProperties;
|
|
70
70
|
minCharsToTrigger?: number;
|
|
71
71
|
isDisabled?: boolean;
|
|
72
|
-
allowUnsafeInput?: boolean;
|
|
73
72
|
}
|
|
74
73
|
export declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement | HTMLTextAreaElement | null>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n from"../../assets/icons/info.svg.js";import{forwardRef as l,useState as r,useContext as o,useRef as a,useEffect as s}from"react";import{Button as c}from"../button/Button.js";import{isFunction as h,
|
|
1
|
+
import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n from"../../assets/icons/info.svg.js";import{forwardRef as l,useState as r,useContext as o,useRef as a,useEffect as s}from"react";import{Button as c}from"../button/Button.js";import{isFunction as h,validateInput as d}from"./Input-helper.js";import{Tooltip as u}from"../tooltips/Tooltip.js";import{TitleSmall as v,BodySecondary as g}from"../TypographyStyle.js";import{COLORS as p}from"../../constants/Theme.js";import m from"../../assets/icons/errorInfo.svg.js";import{InputStyleContext as b}from"./context/InputStyleProvider.js";import{RootContainer as x,InputFooter as f,MaxCharStyle as y,InputWrapper as j,IconHolder as C,PrefixHolder as T,InputContainer as O,InputContainerSmall as w,SuffixHolder as I,InputHeader as k}from"./Input.styled.js";const B=l(((l,B)=>{var L,H,D,E,M,P,S,z;const{placeholder:A,leftIcon:F,rightIcon:K,labelText:N,maxCharLimit:R,isRequired:G,hintText:W,type:_,state:q,validate:V,variant:$,button:J,suffixText:Q,prefixText:U,onChangeText:X,value:Y,noErrorHint:Z,reset:ee,rangeValidation:te,noKeyDownChange:ie,version:ne,noMaxCharCheck:le,labelElement:re,autoGrow:oe,minHeight:ae,maxHeight:se,labelTextBold:ce,truncateText:he,maxCharLimitPosition:de,hightlightInputColor:ue,onKeyDownEvent:ve,hideInputHeader:ge,hideBorder:pe,inputWrapperStyles:me,minCharsToTrigger:be,isDisabled:xe=!1}=Object.assign({maxCharLimit:0,type:"text",variant:"default",maxCharLimitPosition:"TOP",minCharsToTrigger:0},l),fe=null==F?void 0:F.icon,ye=null==K?void 0:K.icon,[je,Ce]=r(!1),[Te,Oe]=r(!1),[we,Ie]=r(),ke="x-small"===$?"12px":"small"===$?"18px":"22px",Be=o(b),[Le,He]=r(""),De=a(null),Ee=null!=B?B:De;s((()=>{He(Y||""),!Y&&oe&&(Ee.current.style.height=ae||"48px")}),[Y]),s((()=>{var e;Ee.current&&(null===(e=l.onReferenceInit)||void 0===e||e.call(l,Ee.current))}),[Ee]),s((()=>{const e=Ee.current;if(e&&["phonenumber","zip","number"].includes(_))return e.addEventListener("wheel",ze,{passive:!1}),()=>{e.removeEventListener("wheel",ze)}}),[]),s((()=>{ee&&He("")}),[ee]),s((()=>{var e;Oe(!!l.isActive),l.isActive&&(null===(e=Ee.current)||void 0===e||e.focus())}),[l.isActive]),s((()=>{Ie(l.errorMessage)}),[l.errorMessage]),s((()=>{var e;Ce(!1),("invalid"===l.state||we||"disabled-invalid"===l.state)&&Ce(!0),"active"===l.state&&(null===(e=Ee.current)||void 0===e||e.focus())}),[l.state,we]),s((()=>{Ce(!!we||"invalid"===l.state)}),[we,l.state]);const Me=function(e){if(h(e)){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];e(...i)}},Pe=()=>"zip"===_?6:2e3,Se=e=>{const t=0!==R?R:Pe(),i=be,n=e.target.value;ve&&(!n.length||n.length>=i)&&ve(e),ie||n.length&&!(n.length>=i)||X(Y||"",e),le||![8].includes(e.which)&&t>0&&n.length>=t&&e.preventDefault()},ze=e=>{e.preventDefault()},Ae=e=>{let t=e.target.value;const i=0!==R?R+1:Pe(),n=be;if(!le&&i>0&&t.length>=i&&(t=t.substring(0,i-1)),l.textControl||He(t||""),n&&t&&t.length<n)return;X(t,e),oe&&(Ee.current.style.height=`${Ee.current.scrollHeight}px`,t||(Ee.current.style.height=ae||"48px"));const r=V||d;if(!r||!h(r))return;const[o,a]=r(t,_,te);Ce(!o),Ie(l.errorMessage?l.errorMessage:a)},Fe=e=>{var t;l.skipFocus||Oe(!0),Me(null===(t=l.onFocus)||void 0===t?void 0:t.call(l,e))},Ke=e=>{var t;l.skipFocus||Oe(!1),Me(null===(t=l.onBlur)||void 0===t?void 0:t.call(l,e))},Ne=()=>{var n;return e(i,{children:["multiline"!==_&&t("input",{className:he?"truncate-class":"","data-test":l["data-test"],id:l.id,style:null!==(n=null==Be?void 0:Be.input)&&void 0!==n?n:{},ref:Ee,disabled:xe,type:["phonenumber","zip","number"].includes(_)?"number":_,value:Le,onFocus:e=>Fe(e),onBlur:e=>Ke(e),placeholder:A||"Enter here",onChange:Ae,onClick:e=>Me(l.onClick),onKeyDown:e=>Se(e)}),"multiline"===_&&t("textarea",{"data-test":l["data-test"],value:Le,ref:Ee,onFocus:e=>Fe(e),onBlur:e=>Ke(e),onClick:e=>Me(l.onClick),disabled:xe,placeholder:A||"Enter here",onChange:Ae,onKeyDown:e=>Se(e),maxLength:R>0?R:void 0})]})};return e(x,Object.assign({width:l.width,height:l.height,state:q,type:_,style:null!==(L=null==Be?void 0:Be.RootContainer)&&void 0!==L?L:{}},{children:[e("div",Object.assign({className:"flex-align-center"},{children:[!Z&&(!!W||!!we)&&e(f,Object.assign({invalid:!!we},{children:[!!we&&t(m,{width:16,height:16}),we||W]})),R>0&&"BOTTOM"===de&&e(y,Object.assign({position:"BOTTOM"},{children:[null!==(D=null===(H=(null!=Y?Y:"").toString())||void 0===H?void 0:H.length)&&void 0!==D?D:0,"/",R]}))]})),e(j,Object.assign({variant:$,state:q,width:l.width,isActive:"active"===q||Te,isInvalid:je,style:null!==(M=null!==(E=null==Be?void 0:Be.InputWrapper)&&void 0!==E?E:me)&&void 0!==M?M:{},version:ne,height:l.height,hightlightInputColor:ue,hideBorder:pe},{children:[!!fe&&t(C,Object.assign({variant:$,iconSize:ke,onClick:()=>Me(null==F?void 0:F.callback),isLeft:!0,style:null!==(P=null==Be?void 0:Be.IconHolder)&&void 0!==P?P:{}},{children:t(fe,{})})),!!U&&t(T,Object.assign({variant:$},{children:U})),"default"===$&&t(O,Object.assign({height:l.height,type:l.type,minHeight:ae,maxHeight:se,autoGrow:oe},{children:Ne()})),["x-small","small"].includes($)&&t(w,Object.assign({height:l.height,type:l.type},{children:Ne()})),!!ye&&t(C,Object.assign({variant:$,iconSize:ke,onClick:()=>Me(null==K?void 0:K.callback),isLeft:!1},{children:t(ye,{})})),!!Q&&t(I,Object.assign({variant:$},{children:Q})),J&&J.text&&t(c,{buttonText:J.text,onClick:()=>Me(null==J?void 0:J.onClick)}),J&&J.buttonProps&&t(c,Object.assign({},J.buttonProps))]})),!ge&&(!!N||!!R)&&e(k,Object.assign({invalid:je},{children:[re&&re,e("div",Object.assign({className:"label__container"},{children:[e(ce?v:g,{children:[N,G?t("span",{children:"*"}):""]}),l.tooltipText&&t(u,Object.assign({body:l.tooltipText,placement:"top"},{children:t("span",{children:t(n,{style:{marginTop:-3},width:18,height:18,color:je?p.content.negative:p.content.primary})})}))]})),R>0&&"TOP"===de&&e(y,{children:[null!==(z=null===(S=(null!=Y?Y:"").toString())||void 0===S?void 0:S.length)&&void 0!==z?z:0,"/",R]})]}))]}))}));B.displayName="Input";export{B as Input};
|
|
@@ -5,8 +5,4 @@ export declare const GroupedMenuList: React.FC<{
|
|
|
5
5
|
onDropdownItemClick?: (option: MultiLevelDropdownOption, parents: MultiLevelDropdownOption[]) => void;
|
|
6
6
|
option: GroupedOption;
|
|
7
7
|
parents: MultiLevelDropdownOption[];
|
|
8
|
-
allowParentSelection?: boolean;
|
|
9
|
-
maxLevels?: number;
|
|
10
|
-
hideGroupLabel?: boolean;
|
|
11
|
-
currentLevel: number;
|
|
12
8
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as
|
|
1
|
+
import{jsxs as o,jsx as t}from"react/jsx-runtime";import{COLORS as r}from"../../constants/Theme.js";import{BodyTiny as e}from"../TypographyStyle.js";import{MenuItem as p}from"./MenuItem.js";import{GroupedMenuListContainer as n}from"./MultiLevelDropdown.styled.js";const i=i=>{let{width:l,onDropdownItemClick:m,option:s,parents:c}=i;return o(n,{children:[t(e,Object.assign({style:{padding:"4px 8px 4px 12px",cursor:"default"},color:r.content.placeholder},{children:s.label})),s.options.map(((o,r)=>t(p,{width:l,onDropdownItemClick:m,option:o,parents:c},r)))]})};export{i as GroupedMenuList};
|
|
@@ -5,7 +5,4 @@ export declare const MenuItem: React.FC<{
|
|
|
5
5
|
onDropdownItemClick?: (option: MultiLevelDropdownOption, parents: MultiLevelDropdownOption[]) => void;
|
|
6
6
|
option: SingleOption;
|
|
7
7
|
parents: MultiLevelDropdownOption[];
|
|
8
|
-
allowParentSelection?: boolean;
|
|
9
|
-
maxLevels?: number;
|
|
10
|
-
currentLevel: number;
|
|
11
8
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import
|
|
1
|
+
import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i from"../../assets/icons/chevronRight2.svg.js";import o,{useRef as l,Suspense as r}from"react";import{COLORS as s}from"../../constants/Theme.js";import{BodyCaption as d,BodyTiny as c}from"../TypographyStyle.js";import{MenuItemWrapper as a,MenuItemContainer as p,ContentContainer as h,LeadingIconContainer as u,TrailingIconContainer as m,SubMenuContainer as g,StyledSubMenuWrapper as v,SubMenuListContainer as b}from"./MultiLevelDropdown.styled.js";const f=o.lazy((()=>import("./MenuList.js").then((e=>({default:e.MenuList}))))),j=j=>{let{width:y,onDropdownItemClick:w,option:M,parents:O}=j;var C,I,L,S,T,k,x;const[D,E]=o.useState(!1),[R,z]=o.useState(!1),[B,H]=o.useState({top:0,left:0}),N=l({top:0,left:0});return e(a,Object.assign({onMouseEnter:e=>{E(!0),(e=>{const t=e.currentTarget.getBoundingClientRect();H({top:t.top,left:t.right}),N.current={top:t.top,left:t.right}})(e)},onMouseLeave:()=>{E(!1)},onClick:()=>{var e,t;!w||null!==(e=M.disabled)&&void 0!==e&&e||(null===(t=M.children)||void 0===t?void 0:t.length)||w(M,O)},id:"menuItemWrapper",style:{cursor:null!==(C=M.disabled)&&void 0!==C&&C?"not-allowed":"pointer",backgroundColor:null!==(I=M.disabled)&&void 0!==I&&I?s.surface.standard:"transparent"}},{children:[M.customComponent?M.customComponent:e(p,Object.assign({isSelected:M.selected,isSubMenuOpen:D,isHovered:R,isDisabled:null!==(L=M.disabled)&&void 0!==L&&L},{children:[e(h,{children:[M.leadingIcon&&t(u,{children:M.leadingIcon}),e("div",{children:[t(d,Object.assign({style:{color:null!==(S=M.disabled)&&void 0!==S&&S?s.content.inactive:M.selected||R?s.content.positive:s.content.primary}},{children:M.label})),M.subText&&t(c,Object.assign({style:{color:null!==(T=M.disabled)&&void 0!==T&&T?s.content.inactive:M.selected||R?s.content.positive:s.content.secondary,marginTop:"2px"}},{children:M.subText}))]})]}),M.children&&M.children.length>0?t(m,{children:t(i,{width:16,height:16,color:null!==(k=M.disabled)&&void 0!==k&&k?s.content.inactive:M.selected||R?s.content.positive:s.content.primary})}):M.trailingIcon?t(m,{children:M.trailingIcon}):t(n,{})]})),!(null!==(x=M.disabled)&&void 0!==x&&x)&&M.children&&M.children.length>0&&D&&t(g,Object.assign({width:y,className:"submenu",onMouseEnter:()=>z(!0),onMouseLeave:()=>z(!1)},{children:t(v,Object.assign({width:y,top:B.top,left:B.left},{children:t(b,{children:t(r,Object.assign({fallback:t("div",{children:"Loading..."})},{children:t(f,{width:y,onDropdownItemClick:w,options:M.children,parents:[...O,M]})}))})}))}))]}))};export{j as MenuItem};
|
|
@@ -5,8 +5,4 @@ export declare const MenuList: React.FC<{
|
|
|
5
5
|
onDropdownItemClick?: (option: MultiLevelDropdownOption, parents: MultiLevelDropdownOption[]) => void;
|
|
6
6
|
options: MultiLevelDropdownOption[];
|
|
7
7
|
parents: MultiLevelDropdownOption[];
|
|
8
|
-
allowParentSelection?: boolean;
|
|
9
|
-
maxLevels?: number;
|
|
10
|
-
hideGroupLabel?: boolean;
|
|
11
|
-
currentLevel: number;
|
|
12
8
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import{GroupedMenuList as t}from"./GroupedMenuList.js";import{MenuItem as n}from"./MenuItem.js";import{StyledMenuList as i}from"./MultiLevelDropdown.styled.js";const r=r=>{let{width:e,onDropdownItemClick:p,options:m,parents:s}=r;return o(i,{children:m.map(((i,r)=>"value"in i?o(n,{width:e,onDropdownItemClick:p,option:i,parents:s},r):"options"in i&&i.options.length>0?o(t,{width:e,onDropdownItemClick:p,option:i,parents:s},r):void 0))})};export{r as MenuList};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as n}from"react/jsx-runtime";import t,{useState as o,useEffect as r}from"react";import{ZeroState as s}from"../zeroState/ZeroState.js";import{COLORS as i}from"../../constants/Theme.js";import{SearchBox as l}from"../dropdown/OpenedDropdown/components/searchbox/SearchBox.js";import{Floater as c}from"../floater/floater.js";import{MenuList as
|
|
1
|
+
import{jsx as e,jsxs as n}from"react/jsx-runtime";import t,{useState as o,useEffect as r}from"react";import{ZeroState as s}from"../zeroState/ZeroState.js";import{COLORS as i}from"../../constants/Theme.js";import{SearchBox as l}from"../dropdown/OpenedDropdown/components/searchbox/SearchBox.js";import{Floater as c}from"../floater/floater.js";import{MenuList as d}from"./MenuList.js";import{DropdownContainer as a,OptionsContainer as p,NoResultsContainer as u}from"./MultiLevelDropdown.styled.js";const f=f=>{let{options:h,width:m,isSearchable:w,onDropdownItemClick:g,refElement:b,topOffset:j,leftOffset:O,isDropdownOpen:x,onDropdownOutsideClick:y}=f;const v=t.useRef(null),[S,C]=o(h),D=e=>{const n=Array.isArray(h)?[...h]:[],t=[];for(;n.length>0;){const o=n.shift();o&&o.label.toLowerCase().includes(e.toLowerCase())&&t.push(o),o&&"children"in o&&o.children?n.push(...o.children):o&&"options"in o&&o.options&&n.push(...o.options)}const o=e=>e.map((e=>{if(t.includes(e))return e;if("children"in e&&e.children){const n=o(e.children);if(n.length>0)return Object.assign(Object.assign({},e),{children:n})}if("options"in e&&e.options){const n=o(e.options);if(n.length>0)return Object.assign(Object.assign({},e),{options:n})}return null})).filter((e=>null!==e));C(o(h))},L=e=>{v.current&&!v.current.contains(e.target)?y&&y(!0):y&&y(!1)};return r((()=>{x&&D("")}),[x]),r((()=>(document.addEventListener("mousedown",L),()=>{document.removeEventListener("mousedown",L)})),[]),r((()=>{C(h)}),[h]),e(c,Object.assign({refElement:b,topOffset:j,leftOffset:O},{children:x&&e("div",Object.assign({ref:v,style:{backgroundColor:i.surface.standard,zIndex:99999,borderRadius:"8px",whiteSpace:"normal"}},{children:n(a,Object.assign({width:m},{children:[w&&e("div",Object.assign({style:{padding:"4px",width:null!=m?m:"200px"}},{children:e(l,{onSearch:D,version:"2.0"})})),e(p,Object.assign({width:m},{children:(null!=S?S:[]).length>0&&e(d,{width:null!=m?m:"200px",onDropdownItemClick:g,options:S,parents:[]})})),0===(null!=S?S:[]).length&&e(u,Object.assign({style:{width:null!=m?m:"200px"}},{children:e(s,{title:"No results found!",subTitle:"Sorry, we are unable to find any results for your search."})}))]}))}))}))};export{f as MultiLevelDropdown};
|
|
@@ -5,9 +5,6 @@ export interface MultiLevelDropdownProps extends FloaterProps {
|
|
|
5
5
|
width?: string;
|
|
6
6
|
isSearchable?: boolean;
|
|
7
7
|
isDropdownOpen?: boolean;
|
|
8
|
-
allowParentSelection?: boolean;
|
|
9
|
-
maxLevels?: number;
|
|
10
|
-
hideGroupLabel?: boolean;
|
|
11
8
|
onDropdownOutsideClick?: (isOutsideClick: any) => void;
|
|
12
9
|
onDropdownItemClick?: (option: MultiLevelDropdownOption, parents: MultiLevelDropdownOption[]) => void;
|
|
13
10
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as i,jsx as e,Fragment as s}from"react/jsx-runtime";import{useState as l,useEffect as t,useMemo as a}from"react";import{RadioButtonContainer as o,RadioButtonIcon as c}from"./RadioButton.styled.js";import{BodyCaption as
|
|
1
|
+
import{jsxs as i,jsx as e,Fragment as s}from"react/jsx-runtime";import{useState as l,useEffect as t,useMemo as a}from"react";import{RadioButtonContainer as o,RadioButtonIcon as c}from"./RadioButton.styled.js";import{BodyCaption as r,TitleSmall as n,BodySecondary as d,BodyPrimary as b}from"../TypographyStyle.js";import{COLORS as m}from"../../constants/Theme.js";const v=s=>{const l=a((()=>(null==s?void 0:s.activeColor)||m.background.positive.vibrant),[s.activeColor]),t=a((()=>s.isDisabled?m.content.inactive:s.isActive?l:m.content.primary),[s.isDisabled,s.isActive,l]);return i("svg",Object.assign({width:s.isSmall?"16":"20",height:s.isSmall?"16":"20",viewBox:s.isSmall?"0 0 16 16":"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:[e("circle",{cx:s.isSmall?"8":"10",cy:s.isSmall?"8":"10",r:s.isSmall?6:9,stroke:t,strokeWidth:s.isSmall?1.5:2}),s.isActive&&e("circle",{cx:s.isSmall?"8":"10",cy:s.isSmall?"8":"10",r:s.isSmall?3:5,fill:s.isDisabled?m.content.inactive:l})]}))},p=a=>{const[p,h]=l(a.isActive||!1),[g,x]=l(!1),[S,y]=l(!1);t((()=>{h(a.isActive)}),[a.isActive]);return i(o,Object.assign({onClick:()=>{var i;if(!a.skipSelectingOff&&!a.isDisabled){const e=!p;h(e),null===(i=a.onValueChange)||void 0===i||i.call(a,e,a.value)}},onMouseEnter:()=>x(!a.skipHoverState),onMouseLeave:()=>x(!1),onMouseDown:()=>y(!a.skipHoverState),onMouseUp:()=>y(!1),style:a.caption?{alignItems:"flex-start"}:{}},{children:[e(c,Object.assign({checked:p,hovered:g,clicked:S,isDisabled:a.isDisabled||!1,size:a.size,style:a.caption?{margin:"2px 0"}:{}},{children:e(v,{isSmall:"SMALL"===a.size,isActive:p,isDisabled:a.isDisabled||!1,activeColor:a.activeColor})})),i("div",{children:[a.label?a.boldOnChecked&&p||a.alwaysBold?e(n,Object.assign({color:a.isDisabled?m.text.disabled:m.text.primary},{children:a.label})):"SMALL"===a.size?e(r,Object.assign({color:a.isDisabled?m.text.disabled:m.text.primary},{children:a.label})):"MEDIUM"===a.labelSize?e(d,Object.assign({color:a.isDisabled?m.text.disabled:m.text.primary},{children:a.label})):e(b,Object.assign({color:a.isDisabled?m.text.disabled:m.text.primary},{children:a.label})):e(s,{}),a.caption&&e(r,Object.assign({color:a.isDisabled?m.text.disabled:m.text.secondary},{children:a.caption}))]})]}))};export{p as RadioButton};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import c from"@emotion/styled/base";import{getPadding as I,getBackgroundColor as
|
|
1
|
+
import c from"@emotion/styled/base";import{getPadding as I,getBackgroundColor as l,generateBorder as b,getTextColor as g}from"./themes.js";const i=c("div","production"===process.env.NODE_ENV?{target:"e930jd90"}:{target:"e930jd90",label:"Tag"})("cursor:",(c=>{var I;return null!==(I=c.cursor)&&void 0!==I?I:"default"}),";",(c=>"small"!==c.size&&("regular"===c.variant?"display: block;\n\t\t min-height: 26px;\n\t\t":"min-height: 20px;"))," .container{display:flex;align-items:",(c=>c.alignIcon?c.alignIcon:"center"),";gap:6px;",(c=>"small"===c.size?"height: 16px; box-sizing: border-box;":"")," padding:",(c=>"small"===c.size?"2px 6px":c.contentPadding?c.contentPadding:I(c.variant)),";background:",(c=>{var I;return null!==(I=c.backgroundColor)&&void 0!==I?I:l(c.theme,c.type)}),";border-radius:",(c=>void 0!==c.borderRadius?"number"==typeof c.borderRadius?`${c.borderRadius}px`:c.borderRadius:"regular"===c.variant?"4px":"12px"),";",(c=>!c.noBorder&&"light"===c.theme&&`border: ${"2.0"===c.version?.5:1}px solid ${b(c.type,c.theme)};`)," .text{color:",(c=>g(c.theme,c.type)),";}.icon-trailing{all:unset;display:flex;}.icon-leading{all:unset;display:flex;}}"+("production"===process.env.NODE_ENV?"":"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlRhZy5zdHlsZWQudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUU4QiIsImZpbGUiOiJUYWcuc3R5bGVkLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcclxuaW1wb3J0IHsgZ2VuZXJhdGVCb3JkZXIsIGdldEJhY2tncm91bmRDb2xvciwgZ2V0UGFkZGluZywgZ2V0VGV4dENvbG9yLCB9IGZyb20gJy4vdGhlbWVzJztcclxuZXhwb3J0IGNvbnN0IFRhZyA9IHN0eWxlZC5kaXYgYFxuXHRjdXJzb3I6ICR7KHByb3BzKSA9PiB7IHZhciBfYTsgcmV0dXJuIChfYSA9IHByb3BzLmN1cnNvcikgIT09IG51bGwgJiYgX2EgIT09IHZvaWQgMCA/IF9hIDogJ2RlZmF1bHQnOyB9fTtcblx0JHsocHJvcHMpID0+IHByb3BzLnNpemUgIT09ICdzbWFsbCcgJiZcclxuICAgIChwcm9wcy52YXJpYW50ID09PSAncmVndWxhcidcclxuICAgICAgICA/IGBkaXNwbGF5OiBibG9jaztcblx0XHQgICAgIG1pbi1oZWlnaHQ6IDI2cHg7XG5cdFx0YFxyXG4gICAgICAgIDogYG1pbi1oZWlnaHQ6IDIwcHg7YCl9XG5cdC5jb250YWluZXIge1xuXHRcdGRpc3BsYXk6IGZsZXg7XG5cdFx0YWxpZ24taXRlbXM6ICR7KHByb3BzKSA9PiAocHJvcHMuYWxpZ25JY29uID8gcHJvcHMuYWxpZ25JY29uIDogJ2NlbnRlcicpfTtcblx0XHRnYXA6IDZweDtcblx0XHQkeyhwcm9wcykgPT4gcHJvcHMuc2l6ZSA9PT0gJ3NtYWxsJyA/ICdoZWlnaHQ6IDE2cHg7IGJveC1zaXppbmc6IGJvcmRlci1ib3g7JyA6ICcnfVxuXHRcdHBhZGRpbmc6ICR7KHByb3BzKSA9PiBwcm9wcy5zaXplID09PSAnc21hbGwnXHJcbiAgICA/ICcycHggNnB4J1xyXG4gICAgOiBwcm9wcy5jb250ZW50UGFkZGluZ1xyXG4gICAgICAgID8gcHJvcHMuY29udGVudFBhZGRpbmdcclxuICAgICAgICA6IGdldFBhZGRpbmcocHJvcHMudmFyaWFudCl9O1xuXHRcdGJhY2tncm91bmQ6ICR7KHByb3BzKSA9PiB7IHZhciBfYTsgcmV0dXJuIChfYSA9IHByb3BzLmJhY2tncm91bmRDb2xvcikgIT09IG51bGwgJiYgX2EgIT09IHZvaWQgMCA/IF9hIDogZ2V0QmFja2dyb3VuZENvbG9yKHByb3BzLnRoZW1lLCBwcm9wcy50eXBlKTsgfX07XG5cblx0XHRib3JkZXItcmFkaXVzOiAkeyhwcm9wcykgPT4gcHJvcHMuYm9yZGVyUmFkaXVzICE9PSB1bmRlZmluZWRcclxuICAgID8gdHlwZW9mIHByb3BzLmJvcmRlclJhZGl1cyA9PT0gJ251bWJlcidcclxuICAgICAgICA/IGAke3Byb3BzLmJvcmRlclJhZGl1c31weGBcclxuICAgICAgICA6IHByb3BzLmJvcmRlclJhZGl1c1xyXG4gICAgOiBwcm9wcy52YXJpYW50ID09PSAncmVndWxhcidcclxuICAgICAgICA/ICc0cHgnXHJcbiAgICAgICAgOiAnMTJweCd9O1xuXG5cdFx0JHsocHJvcHMpID0+ICFwcm9wcy5ub0JvcmRlciAmJlxyXG4gICAgcHJvcHMudGhlbWUgPT09ICdsaWdodCcgJiZcclxuICAgIGBib3JkZXI6ICR7cHJvcHMudmVyc2lvbiA9PT0gJzIuMCcgPyAwLjUgOiAxfXB4IHNvbGlkICR7Z2VuZXJhdGVCb3JkZXIocHJvcHMudHlwZSwgcHJvcHMudGhlbWUpfTtgfVxuXG5cdFx0LnRleHQge1xuXHRcdFx0Y29sb3I6ICR7KHByb3BzKSA9PiBnZXRUZXh0Q29sb3IocHJvcHMudGhlbWUsIHByb3BzLnR5cGUpfTtcblx0XHR9XG5cblx0XHQuaWNvbi10cmFpbGluZyB7XG5cdFx0XHRhbGw6IHVuc2V0O1xuXHRcdFx0ZGlzcGxheTogZmxleDtcblx0XHR9XG5cblx0XHQuaWNvbi1sZWFkaW5nIHtcblx0XHRcdGFsbDogdW5zZXQ7XG5cdFx0XHRkaXNwbGF5OiBmbGV4O1xuXHRcdH1cblx0fVxuYDtcclxuLy8jIHNvdXJjZU1hcHBpbmdVUkw9VGFnLnN0eWxlZC5qcy5tYXAiXX0= */"));export{i as Tag};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t,Fragment as i}from"react/jsx-runtime";import{useTemplateModalContext as l}from"../template-context-mapper/context/templateModalContext.js";import n from"../../utils/StringUtils.js";import{COLORS as o}from"../../constants/Theme.js";import a from"../../assets/icons/aiContentIcon.svg.js";import{TitleRegular as s}from"../TypographyStyle.js";import r from"./EmailTemplateThumbnailPreview.js";import{CHANNEL_TYPE as d}from"./models/Channels.js";import p from"./SmsTemplatePreview.js";import m from"./webpush/WebpushPreview.js";import u from"./WhatsAppTemplatePreview.js";const c=c=>{let{template:h,channel:g,whatsAppSpecificMeta:C,templateCreationsInfo:b,hideHeader:y,size:S,onlyTemplateContent:j,emailSpecificMeta:f,smsSpecificMeta:w,showSampleValues:T,carouselCardIndex:x,isWhatsappCarousel:O,isPreview:P,applyBorderBottom:I,webPushSpecificMeta:W,hidePointerEvents:H}=c;var A,B;const{setSelectedCarouselIndex:E}=l();return g===d.SMS?e("div",Object.assign({style:Object.assign({marginTop:b?16:0,border:b?`1px solid ${o.stroke.primary}`:"none",borderRadius:4},null==w?void 0:w.templateContainerStyles)},{children:e(p,{template:h,hideHeader:y,onlyTemplateContent:j,size:null!=S?S:"large",variableStore:null==w?void 0:w.smsVariableStore,display_content:null==w?void 0:w.smsDisplayContent,uniqueId:null==w?void 0:w.uniqueId})})):g===d.EMAIL?e("div",Object.assign({style:Object.assign({marginTop:b?16:0},null==f?void 0:f.templateContainerStyles)},{children:e(r,{template:h,handleViewTemplate:()=>{var e;null===(e=null==f?void 0:f.handleViewTemplate)||void 0===e||e.call(f)},hideHeader:y,hideViewButton:null==f?void 0:f.hideViewButtonForEmail,containerStyle:null==f?void 0:f.containerStyle,emailDisplayContent:null==f?void 0:f.emailDisplayContent,emailHtmlContainerId:null==f?void 0:f.emailHtmlContainerId,applyBorderBottom:I,hidePointerEvents:H})})):g===d.WHATSAPP||g===d.RCS?t("div",Object.assign({style:Object.assign(Object.assign(Object.assign({},null==C?void 0:C.templateContainerStyles),b?v.WhatsAppWrapper:{}),{position:"relative"}),onClick:()=>{var e,t;if(E&&O){if(-1===x&&!(null===(t=null===(e=null==h?void 0:h.mapping)||void 0===e?void 0:e.body)||void 0===t?void 0:t.length))return;E(null!=x?x:-1)}}},{children:[b?e("div",Object.assign({style:{padding:16}},{children:e(s,{children:n.convertToTitleCase(null!==(A=null==h?void 0:h.label)&&void 0!==A?A:"")})})):e(i,{}),e(u,{showSampleValues:T,showHeader:null==C?void 0:C.showWhatsAppHeader,extras:null==C?void 0:C.whatsAppExtras,template:h,size:b?"small":null!=S?S:"large",containerStyle:Object.assign(Object.assign({borderWidth:b?0:1,borderTopWidth:1},null!==(B=null==C?void 0:C.containerStyle)&&void 0!==B?B:{}),{height:"100%"}),zeroStateComponent:null==C?void 0:C.zeroStateComponent,usePlaceHolderName:null==C?void 0:C.usePlaceHolderName,carouselCardIndex:x,isWhatsappCarousel:O,isPreview:P,channel:g}),(!!(null==h?void 0:h.aiContentConfigId)||!!(null==h?void 0:h.isAiGenerated))&&e("div",Object.assign({style:{position:"absolute",top:0,right:
|
|
1
|
+
import{jsx as e,jsxs as t,Fragment as i}from"react/jsx-runtime";import{useTemplateModalContext as l}from"../template-context-mapper/context/templateModalContext.js";import n from"../../utils/StringUtils.js";import{COLORS as o}from"../../constants/Theme.js";import a from"../../assets/icons/aiContentIcon.svg.js";import{TitleRegular as s}from"../TypographyStyle.js";import r from"./EmailTemplateThumbnailPreview.js";import{CHANNEL_TYPE as d}from"./models/Channels.js";import p from"./SmsTemplatePreview.js";import m from"./webpush/WebpushPreview.js";import u from"./WhatsAppTemplatePreview.js";const c=c=>{let{template:h,channel:g,whatsAppSpecificMeta:C,templateCreationsInfo:b,hideHeader:y,size:S,onlyTemplateContent:j,emailSpecificMeta:f,smsSpecificMeta:w,showSampleValues:T,carouselCardIndex:x,isWhatsappCarousel:O,isPreview:P,applyBorderBottom:I,webPushSpecificMeta:W,hidePointerEvents:H}=c;var A,B;const{setSelectedCarouselIndex:E}=l();return g===d.SMS?e("div",Object.assign({style:Object.assign({marginTop:b?16:0,border:b?`1px solid ${o.stroke.primary}`:"none",borderRadius:4},null==w?void 0:w.templateContainerStyles)},{children:e(p,{template:h,hideHeader:y,onlyTemplateContent:j,size:null!=S?S:"large",variableStore:null==w?void 0:w.smsVariableStore,display_content:null==w?void 0:w.smsDisplayContent,uniqueId:null==w?void 0:w.uniqueId})})):g===d.EMAIL?e("div",Object.assign({style:Object.assign({marginTop:b?16:0},null==f?void 0:f.templateContainerStyles)},{children:e(r,{template:h,handleViewTemplate:()=>{var e;null===(e=null==f?void 0:f.handleViewTemplate)||void 0===e||e.call(f)},hideHeader:y,hideViewButton:null==f?void 0:f.hideViewButtonForEmail,containerStyle:null==f?void 0:f.containerStyle,emailDisplayContent:null==f?void 0:f.emailDisplayContent,emailHtmlContainerId:null==f?void 0:f.emailHtmlContainerId,applyBorderBottom:I,hidePointerEvents:H})})):g===d.WHATSAPP||g===d.RCS?t("div",Object.assign({style:Object.assign(Object.assign(Object.assign({},null==C?void 0:C.templateContainerStyles),b?v.WhatsAppWrapper:{}),{position:"relative"}),onClick:()=>{var e,t;if(E&&O){if(-1===x&&!(null===(t=null===(e=null==h?void 0:h.mapping)||void 0===e?void 0:e.body)||void 0===t?void 0:t.length))return;E(null!=x?x:-1)}}},{children:[b?e("div",Object.assign({style:{padding:16}},{children:e(s,{children:n.convertToTitleCase(null!==(A=null==h?void 0:h.label)&&void 0!==A?A:"")})})):e(i,{}),e(u,{showSampleValues:T,showHeader:null==C?void 0:C.showWhatsAppHeader,extras:null==C?void 0:C.whatsAppExtras,template:h,size:b?"small":null!=S?S:"large",containerStyle:Object.assign(Object.assign({borderWidth:b?0:1,borderTopWidth:1},null!==(B=null==C?void 0:C.containerStyle)&&void 0!==B?B:{}),{height:"100%"}),zeroStateComponent:null==C?void 0:C.zeroStateComponent,usePlaceHolderName:null==C?void 0:C.usePlaceHolderName,carouselCardIndex:x,isWhatsappCarousel:O,isPreview:P,channel:g}),(!!(null==h?void 0:h.aiContentConfigId)||!!(null==h?void 0:h.isAiGenerated))&&e("div",Object.assign({style:{position:"absolute",top:0,right:0,display:"flex",alignItems:"center",justifyContent:"center",width:48,height:48,zIndex:4}},{children:e(a,{width:48,height:48})}))]})):g==d.WEBPUSH?e("div",Object.assign({style:Object.assign({},null==W?void 0:W.containerStyle)},{children:e(m,{template:h,extraContainerCss:null==W?void 0:W.extraContainerCss})})):e(i,{})},v={WhatsAppWrapper:{backgroundColor:o.surface.standard,borderRadius:4,border:`1px solid ${o.background.inactive}`,marginTop:16}};export{c as TemplatePreview};
|
|
@@ -5,7 +5,6 @@ import{__rest as t}from"../../_virtual/_tslib.js";import{jsxs as e,jsx as n}from
|
|
|
5
5
|
align-items: center;
|
|
6
6
|
justify-content: center;
|
|
7
7
|
flex: 1;
|
|
8
|
-
gap: 6px;
|
|
9
8
|
`,m=i.div`
|
|
10
9
|
background: ${c.background.base};
|
|
11
10
|
width: 48px;
|
|
@@ -15,4 +14,4 @@ import{__rest as t}from"../../_virtual/_tslib.js";import{jsxs as e,jsx as n}from
|
|
|
15
14
|
align-items: center;
|
|
16
15
|
justify-content: center;
|
|
17
16
|
border-radius: 24px;
|
|
18
|
-
`,p=i=>{var{subTitle:p,title:g,IconHolderStyle:h,style:y,isLoading:b,containerWidth:f}=i,j=t(i,["subTitle","title","IconHolderStyle","style","isLoading","containerWidth"]);let x=l;const v=f?parseFloat(f):0;return v&&!isNaN(v)&&v<=150&&(x=s),e(u,Object.assign({style:null!=y?y:{}},{children:[b?n(o,{size:"large",color:c.stroke.brand}):n(m,Object.assign({style:null!=h?h:{}},{children:(null==j?void 0:j.Icon)||n(a,{color:c.content.placeholder,height:24,width:24})})),n(x,Object.assign({style:{color:c.content.primary}},{children:b?"Loading...":g||"No results found"})),!!p&&!b&&n(r,Object.assign({style:{color:c.content.secondary,textAlign:"center",maxWidth:184}},{children:p})),!!(null==j?void 0:j.actionButton)&&n("div",Object.assign({style:(null==j?void 0:j.buttonWidth)?{width:null==j?void 0:j.buttonWidth,display:"flex"}:{}},{children:n(d,Object.assign({},null==j?void 0:j.actionButton))}))]}))};export{p as ZeroState};
|
|
17
|
+
`,p=i=>{var{subTitle:p,title:g,IconHolderStyle:h,style:y,isLoading:b,containerWidth:f}=i,j=t(i,["subTitle","title","IconHolderStyle","style","isLoading","containerWidth"]);let x=l;const v=f?parseFloat(f):0;return v&&!isNaN(v)&&v<=150&&(x=s),e(u,Object.assign({style:null!=y?y:{}},{children:[b?n(o,{size:"large",color:c.stroke.brand}):n(m,Object.assign({style:null!=h?h:{}},{children:(null==j?void 0:j.Icon)||n(a,{color:c.content.placeholder,height:24,width:24})})),n(x,Object.assign({style:{marginTop:8,color:c.content.primary}},{children:b?"Loading...":g||"No results found"})),!!p&&!b&&n(r,Object.assign({style:{marginTop:4,color:c.content.secondary,textAlign:"center",maxWidth:184}},{children:p})),!!(null==j?void 0:j.actionButton)&&n("div",Object.assign({style:(null==j?void 0:j.buttonWidth)?{width:null==j?void 0:j.buttonWidth,display:"flex"}:{}},{children:n(d,Object.assign({},null==j?void 0:j.actionButton))}))]}))};export{p as ZeroState};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isAplhanumeric as t}from"../utils/isAlphanumeric.js";class
|
|
1
|
+
import{isAplhanumeric as t}from"../utils/isAlphanumeric.js";class e{getHTML(t){let e=t;return e=this.whatsappStyles(e,"_","<i>","</i>"),e=this.whatsappStyles(e,"*","<b>","</b>"),e=this.whatsappStyles(e,"~","<s>","</s>"),e=this.whatsappStylesMonospace(e,'<code style="color: black;">',"</code>"),e&&(e=e.replace(/\n/gi,"<br>")),e=this.whatsappLinkStyle(e),e}whatsappStyles(e,s,p,a){const h=[];if(e)for(let p=0;p<e.length;p++)e[p]===s?h.length%2?" "!==e[p-1]&&((void 0===e[p+1]||!t(e[p+1]))&&h.push(p)):void 0!==e[p+1]&&(" "!==e[p+1]&&((void 0===e[p-1]||!t(e[p-1]))&&h.push(p))):10===e.charCodeAt(p)&&h.length%2&&h.pop();h.length%2&&h.pop();let l=0;return h.forEach((function(t,s){const h=s%2?a:p;t+=l,e=e.substr(0,t)+h+e.substr(t+1),l+=h.length-1})),e}whatsappStylesMonospace(e,s,p){const a=[];if(e)for(let s=0;s<e.length;s++)"`"===e[s]&&"`"===e[s+1]&&"`"===e[s+2]?a.length%2?" "===e[s-3]||(void 0===e[s+3]?a.push(s):t(e[s+3])?a.length%2==1&&a.pop():a.push(s)):void 0===e[s+3]||" "===e[s+3]||(void 0===e[s-1]||" "===e[s-1]?a.push(s):t(e[s-1])?a.length%2==1&&a.pop():a.push(s)):10===e.charCodeAt(s)&&a.length%2&&a.pop();a.length%2&&a.pop();let h=0;return a.forEach((function(t,a){const l=a%2?p:s;t+=h,e=e.substr(0,t)+l+e.substr(t+3),h+=l.length-3})),e}whatsappLinkStyle(t){const e=t;return new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i").test(e)?`<a href="${e}" target="_blank" rel="noreferrer">${e}</a>`:e}wrappWildcard(t,e,s,p){return t<0||t>e?p:p.slice(0,t)+s+p.slice(t,e)+s+p.slice(e)}}export{e as BaseWhatsappContentLangHelper};
|