hrm_ui_lib 0.0.1-beta.2 → 0.0.1-beta.21

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.
Files changed (67) hide show
  1. package/assets/styles/styles.css +1 -1
  2. package/components/Avatar/Avatar.d.ts +1 -1
  3. package/components/Avatar/Avatar.js +2 -1
  4. package/components/Avatar/types.d.ts +1 -0
  5. package/components/Copy/Copy.js +1 -1
  6. package/components/DarkModeSwitcher/DarkModeSwitcher.d.ts +10 -2
  7. package/components/DarkModeSwitcher/DarkModeSwitcher.js +5 -6
  8. package/components/DatePicker/CustomHeader/CustomHeader.js +5 -5
  9. package/components/DatePicker/RangeDatePicker/RangeDatePickerMobile.js +5 -5
  10. package/components/DatePicker/SimpleDatePicker/SimpleDatePickerMobile.js +3 -3
  11. package/components/DatePicker/TimePicker/MobileModalContent.js +2 -2
  12. package/components/FileUpload/DropzoneFileUpload/PreviewItem.js +2 -2
  13. package/components/FileUpload/DropzoneFileUpload/helpers.js +1 -1
  14. package/components/LineChart/LineChart.d.ts +3 -0
  15. package/components/LineChart/LineChart.js +9 -0
  16. package/components/LineChart/index.d.ts +2 -0
  17. package/components/LineChart/index.js +1 -0
  18. package/components/LineChart/types.d.ts +14 -0
  19. package/components/LineChart/types.js +0 -0
  20. package/components/Link/Link.js +2 -2
  21. package/components/Link/types.d.ts +3 -0
  22. package/components/Menu/Menu.js +3 -3
  23. package/components/Menu/NestedMenu.js +3 -3
  24. package/components/Modal/Modal.js +2 -1
  25. package/components/Modal/ModalConfirmation.js +3 -2
  26. package/components/Popover/PopoverMobile.js +2 -2
  27. package/components/SVGIcons/IconBudgetTransfer.d.ts +4 -0
  28. package/components/SVGIcons/IconBudgetTransfer.js +7 -0
  29. package/components/SVGIcons/IconMoon.js +1 -1
  30. package/components/SVGIcons/IconRibbon.d.ts +4 -0
  31. package/components/SVGIcons/IconRibbon.js +1 -0
  32. package/components/SVGIcons/IconSun.js +10 -10
  33. package/components/SVGIcons/IconVacation.d.ts +4 -0
  34. package/components/SVGIcons/IconVacation.js +1 -0
  35. package/components/Select/FilterSelect/FilterSelect.js +4 -4
  36. package/components/Select/MultiSelect/MobileWrapper.js +2 -2
  37. package/components/Select/MultiSelect/MultiBase/MultiBase.js +4 -4
  38. package/components/Select/MultiSelect/MultiSelectGrouped/MultiSelectGrouped.js +7 -7
  39. package/components/Select/MultiSelect/MultiSelectWithTabs/MultiSelectWithTabs.js +7 -7
  40. package/components/Select/Select/Select.js +1 -1
  41. package/components/Select/Select/SelectMobile/MobileTopContent.d.ts +2 -1
  42. package/components/Select/Select/SelectMobile/MobileTopContent.js +2 -2
  43. package/components/Select/Select/SelectMobile/index.js +2 -2
  44. package/components/Select/Select/helpers.d.ts +1 -1
  45. package/components/Select/Select/helpers.js +1 -1
  46. package/components/Select/SharedComponents/InputSelectWrapper/InputSelectWrapper.js +3 -3
  47. package/components/Skeleton/Skeleton.d.ts +3 -0
  48. package/components/Skeleton/Skeleton.js +5 -0
  49. package/components/Skeleton/consts.d.ts +5 -0
  50. package/components/Skeleton/consts.js +1 -0
  51. package/components/Skeleton/index.d.ts +2 -0
  52. package/components/Skeleton/index.js +1 -0
  53. package/components/Skeleton/types.d.ts +24 -0
  54. package/components/Skeleton/types.js +0 -0
  55. package/components/Snackbar/Snackbar.d.ts +0 -1
  56. package/components/Snackbar/Snackbar.js +3 -3
  57. package/components/TableV2/AdvancedPagination.js +1 -1
  58. package/components/Tooltip/Tooltip.js +2 -1
  59. package/consts/index.d.ts +1 -2
  60. package/consts/index.js +1 -1
  61. package/helpers/current-week-work-days-range.d.ts +1 -0
  62. package/helpers/current-week-work-days-range.js +1 -0
  63. package/helpers/format-date.d.ts +3 -0
  64. package/helpers/format-date.js +1 -1
  65. package/package.json +1 -1
  66. package/utils/helpers.d.ts +2 -1
  67. package/utils/helpers.js +1 -1
@@ -1 +1 @@
1
- import{jsxs as re,jsx as u}from"react/jsx-runtime";import{forwardRef as le,useRef as U,useState as d,useMemo as ae,useCallback as ce,useEffect as ie}from"react";import{useIsMobile as pe}from"../../../hooks/useGetIsMobile.js";import{SelectDesktop as me}from"./SelectDesktop/index.js";import fe from"classnames";import{Input as ue}from"../../Input/Input.js";import{noop as j}from"../../../utils/helpers.js";import{SELECTED_VISIBLE_MIN_COUNT as de}from"../constants.js";import{SelectMobile as Ie}from"./SelectMobile/index.js";import he from"../../SVGIcons/IconChevronUp.js";import Se from"../../SVGIcons/IconChevronDown.js";import{SELECT_TRANSLATIONS as be}from"../localization.js";import{Button as Ce}from"../../Button/Button.js";import{filterOptions as ge}from"./helpers.js";const De=le((e,t)=>{var l,o;const{labelAddons:s,dataId:n,className:a,size:r,label:i,hasError:c,isValid:p,disabled:m,outerHelperText:f,isRequiredField:I,placeHolder:h,selectRightIconProps:S={Component:Se,size:"small"},selectRightIconOpenedProps:b={Component:he,size:"small"},options:v,withSearch:D=!1,setSelectedItem:C,setFieldValue:g,name:x,selectedItem:w,value:E,isMobileFullScreen:V=!0,language:k="en",translations:R,isButtonSelect:M,...N}=e,O=pe(),A=U(null),T=U(null),[L,_]=d(!1),[y,z]=d(""),[B,F]=d(null),[P,q]=d(0),G=()=>_(!0),H=()=>{_(!1),z("")},$=null!=(l=null==B?void 0:B.optionLeftIcon)&&l.Component?{Component:null==(o=null==B?void 0:B.optionLeftIcon)?void 0:o.Component}:null,K=D&&v.length>de,J=e=>{C&&C(e),x&&g&&g(x,e),H()},Q=()=>J(null),W=E||w,X={...be[k],...R},Y=ae(()=>ge(v,y),[y,v]),Z=ce(()=>{const e=v.findIndex(e=>e.value===W);F(v[e]),q(e)},[W,v]);return ie(()=>{Z()},[Z]),/* @__PURE__ */re("div",{"data-id":`${n}-content`,className:fe(`select select--${r}`,a,{"select--opened":L}),ref:A,children:[!M&&/* @__PURE__ */u(ue,{onClick:m?j:e=>{const t=null==e?void 0:e.target,l=null==t?void 0:t.getAttribute("class");if(e&&l&&(-1!==l.indexOf("icon-")||-1!==l.indexOf("svg-icon")))return _(!L),void e.preventDefault();L&&!K?H():G()},size:"large"===r?"large":"small",dataId:n,hasError:c,className:"select__input",label:i,onChange:e=>{F(null),z(e.target.value)},required:I,leftIconProps:$,rightIconProps:L?b:S,placeholder:h,currentValue:y||(null==B?void 0:B.label.toString())||"",isValid:p,disabled:m,helperText:L?"":f,ref:T,labelAddons:s,autoComplete:"false",readOnly:O&&V||!K,onKeyDown:e=>{if(L)switch(e.key){case"ArrowDown":e.preventDefault(),q(e=>Math.min(e+1,Y.length-1));break;case"ArrowUp":e.preventDefault(),q(e=>Math.max(e-1,0));break;case"Enter":e.preventDefault();const t=Y[P];null!=t&&t.disabled||(J(t.value),H());break;case"Escape":H()}}}),M&&/* @__PURE__ */u(Ce,{size:r,type:"secondary",dataId:n,iconProps:S,buttonText:h||"",onClick:m?j:G,className:"select_button"}),O&&V?/* @__PURE__ */u(Ie,{...N,isOpen:L,filteredData:Y,closeDropdown:H,currentSelection:W,isRequiredField:I,onItemDeselect:Q,onItemSelect:J,translations:X,withSearch:D,searchValue:y,setSearchValue:z}):/* @__PURE__ */u(me,{...N,onItemDeselect:Q,onItemSelect:J,currentSelection:W,isRequiredField:I,filteredData:Y,inputRef:T.current,containerRef:A.current,isOpen:L,closeDropdown:H,setCurrentSelectedLabel:Z,searchValue:y,setSearchValue:z,translations:X,activeIndex:P,setActiveIndex:q})]})});De.displayName="Select";export{De as Select};
1
+ import{jsxs as re,jsx as u}from"react/jsx-runtime";import{forwardRef as le,useRef as U,useState as d,useMemo as ae,useCallback as ce,useEffect as ie}from"react";import{useIsMobile as pe}from"../../../hooks/useGetIsMobile.js";import{SelectDesktop as me}from"./SelectDesktop/index.js";import fe from"classnames";import{Input as ue}from"../../Input/Input.js";import{noop as j}from"../../../utils/helpers.js";import{SELECTED_VISIBLE_MIN_COUNT as de}from"../constants.js";import{SelectMobile as he}from"./SelectMobile/index.js";import Ie from"../../SVGIcons/IconChevronUp.js";import Se from"../../SVGIcons/IconChevronDown.js";import{SELECT_TRANSLATIONS as be}from"../localization.js";import{Button as Ce}from"../../Button/Button.js";import{filterSearchData as De}from"./helpers.js";const ge=le((e,t)=>{var l,o;const{labelAddons:s,dataId:n,className:a,size:r="small",label:i,hasError:c,isValid:p,disabled:m,outerHelperText:f,isRequiredField:I,placeHolder:h,selectRightIconProps:S={Component:Se,size:"small"},selectRightIconOpenedProps:b={Component:Ie,size:"small"},options:v,withSearch:D=!1,setSelectedItem:C,setFieldValue:g,name:x,selectedItem:w,value:E,isMobileFullScreen:V=!0,language:k="en",translations:R,isButtonSelect:M,...N}=e,A=pe(),O=U(null),T=U(null),[L,_]=d(!1),[y,z]=d(""),[B,F]=d(null),[P,q]=d(0),G=()=>_(!0),H=()=>{_(!1),z("")},$=null!=(l=null==B?void 0:B.optionLeftIcon)&&l.Component?{Component:null==(o=null==B?void 0:B.optionLeftIcon)?void 0:o.Component}:null,K=D&&v.length>de,J=e=>{C&&C(e),x&&g&&g(x,e),H()},Q=()=>J(null),W=E||w,X={...be[k],...R},Y=ae(()=>De(v,y),[y,v]),Z=ce(()=>{const e=v.findIndex(e=>e.value===W);F(v[e]),q(e)},[W,v]);return ie(()=>{Z()},[Z]),/* @__PURE__ */re("div",{"data-id":`${n}-content`,className:fe(`select select--${r}`,a,{"select--opened":L}),ref:O,children:[!M&&/* @__PURE__ */u(ue,{onClick:m?j:e=>{const t=null==e?void 0:e.target,l=null==t?void 0:t.getAttribute("class");if(e&&l&&(-1!==l.indexOf("icon-")||-1!==l.indexOf("svg-icon")))return _(!L),void e.preventDefault();L&&!K?H():G()},size:r,dataId:n,hasError:c,className:"select__input",label:i,onChange:e=>{F(null),z(e.target.value)},required:I,leftIconProps:$,rightIconProps:L?b:S,placeholder:h,currentValue:y||(null==B?void 0:B.label.toString())||"",isValid:p,disabled:m,helperText:L?"":f,ref:T,labelAddons:s,autoComplete:"false",readOnly:A&&V||!K,onKeyDown:e=>{if(L)switch(e.key){case"ArrowDown":e.preventDefault(),q(e=>Math.min(e+1,Y.length-1));break;case"ArrowUp":e.preventDefault(),q(e=>Math.max(e-1,0));break;case"Enter":e.preventDefault();const t=Y[P];null!=t&&t.disabled||(J(t.value),H());break;case"Escape":H()}}}),M&&/* @__PURE__ */u(Ce,{size:r,type:"secondary",dataId:n,iconProps:S,buttonText:h||"",onClick:m?j:G,className:"select_button"}),A&&V?/* @__PURE__ */u(he,{...N,isOpen:L,filteredData:Y,closeDropdown:H,currentSelection:W,isRequiredField:I,onItemDeselect:Q,onItemSelect:J,translations:X,withSearch:D,searchValue:y,setSearchValue:z}):/* @__PURE__ */u(me,{...N,onItemDeselect:Q,onItemSelect:J,currentSelection:W,isRequiredField:I,filteredData:Y,inputRef:T.current,containerRef:O.current,isOpen:L,closeDropdown:H,setCurrentSelectedLabel:Z,searchValue:y,setSearchValue:z,translations:X,activeIndex:P,setActiveIndex:q})]})});ge.displayName="Select";export{ge as Select};
@@ -4,6 +4,7 @@ type TProps = {
4
4
  setSearchValue: (value: string) => void;
5
5
  onBack: () => void;
6
6
  withSearch: boolean;
7
+ isOpen: boolean;
7
8
  };
8
- export declare const MobileTopContent: ({ onBack, setSearchValue, searchValue, withSearch }: TProps) => ReactElement;
9
+ export declare const MobileTopContent: ({ onBack, setSearchValue, searchValue, withSearch, isOpen }: TProps) => ReactElement;
9
10
  export {};
@@ -1,2 +1,2 @@
1
- import{jsxs as i,jsx as r}from"react/jsx-runtime";import m from"../../../SVGIcons/IconChevronLeft.js";import{Input as s}from"../../../Input/Input.js";import c from"../../../SVGIcons/IconDismissFilled.js";import p from"../../../SVGIcons/IconSearchFilled.js";const I=({onBack:e,setSearchValue:o,searchValue:n,withSearch:a})=>/* @__PURE__ */i("div",{className:"flexbox mobile_top_content",children:[
2
- /* @__PURE__ */r(m,{onClick:e,size:"large"}),a&&/* @__PURE__ */r(s,{currentValue:n,handleChange:s=>{o(s.target.value)},className:"ml-8",size:"small",rightIconProps:{Component:n?c:p,size:n?"xsmall":"small",onClick:()=>{o("")}}})]});export{I as MobileTopContent};
1
+ import{jsxs as c,jsx as n}from"react/jsx-runtime";import{useRef as f,useEffect as p}from"react";import u from"../../../SVGIcons/IconChevronLeft.js";import{Input as a}from"../../../Input/Input.js";import x from"../../../SVGIcons/IconDismissFilled.js";import C from"../../../SVGIcons/IconSearchFilled.js";const F=({onBack:e,setSearchValue:s,searchValue:o,withSearch:r,isOpen:t})=>{const l=f(null);return p(()=>{l&&l.current&&l.current.focus()},[l.current]),/* @__PURE__ */c("div",{className:"flexbox mobile_top_content",children:[
2
+ /* @__PURE__ */n(u,{onClick:e,size:"large"}),r&&/* @__PURE__ */n(a,{currentValue:o,handleChange:e=>{s(e.target.value)},className:"ml-8",size:"small",ref:l,rightIconProps:{Component:o?x:C,size:o?"xsmall":"small",onClick:()=>{s("")}}})]})};export{F as MobileTopContent};
@@ -1,5 +1,5 @@
1
- import{jsxs as m,jsx as e}from"react/jsx-runtime";import{OptionItem as R}from"../../../../helperComponents/OptionItem/OptionItem.js";import{Empty as E}from"../../../Empty/Empty.js";import{Modal as H}from"../../../Modal/Modal.js";import"react";import"classnames";import"../../../../consts/index.js";import"../../../../context/types.js";import"../../../../hooks/useScreenSize.js";import"react-hook-form";import{Text as O}from"../../../Text/Text.js";import{ITEM_SIZE_MOBILE as T}from"../../constants.js";import"../../../Checkbox/Checkbox.js";import"react-dom";import"motion/react";import"dayjs";import"../../../Collapse/CollapseGroup/CollapseGroup.js";import"../../SharedComponents/ContentTop.js";import{Loading as k}from"../../SharedComponents/Loading.js";import"../../../Input/Input.js";import{MobileTopContent as D}from"./MobileTopContent.js";import{FixedSizeList as F}from"react-window";const re=o=>{const{translations:t,currentSelection:n,isOpen:i,closeDropdown:s,isLoading:a,dataId:r,innerHelperText:l,filteredData:p,isRequiredField:d,onItemSelect:c,onItemDeselect:h,tooltipAddons:u,labelLeftIconProps:C,optionRightIconComponent:I,labelRightIconComponent:j,withSearch:g,searchValue:S,setSearchValue:b}=o,f=e=>({value:o})=>{b(""),e?d||h():c(o)},x=window.innerHeight,w=window.innerWidth;/* @__PURE__ */
1
+ import{jsxs as m,jsx as e}from"react/jsx-runtime";import{OptionItem as R}from"../../../../helperComponents/OptionItem/OptionItem.js";import{Empty as E}from"../../../Empty/Empty.js";import{Modal as H}from"../../../Modal/Modal.js";import"react";import"classnames";import"../../../../consts/index.js";import"../../../../context/types.js";import"../../../../hooks/useScreenSize.js";import"react-hook-form";import{Text as O}from"../../../Text/Text.js";import"react-dom";import{ITEM_SIZE_MOBILE as T}from"../../constants.js";import"../../../Checkbox/Checkbox.js";import"motion/react";import"dayjs";import"../../../Collapse/CollapseGroup/CollapseGroup.js";import"../../SharedComponents/ContentTop.js";import{Loading as k}from"../../SharedComponents/Loading.js";import"../../../Input/Input.js";import{MobileTopContent as D}from"./MobileTopContent.js";import{FixedSizeList as F}from"react-window";const re=o=>{const{translations:t,currentSelection:n,isOpen:i,closeDropdown:s,isLoading:a,dataId:r,innerHelperText:l,filteredData:p,isRequiredField:d,onItemSelect:c,onItemDeselect:h,tooltipAddons:u,labelLeftIconProps:C,optionRightIconComponent:I,labelRightIconComponent:j,withSearch:g,searchValue:S,setSearchValue:b}=o,f=e=>({value:o})=>{b(""),e?d||h():c(o)},x=window.innerHeight,w=window.innerWidth;/* @__PURE__ */
2
2
  return m(H,{isOpen:i,onClose:s,isMobileFullScreen:!0,children:[
3
- /* @__PURE__ */e(D,{searchValue:S,setSearchValue:b,onBack:()=>{s(),b("")},withSearch:g}),
3
+ /* @__PURE__ */e(D,{searchValue:S,setSearchValue:b,onBack:()=>{s(),b("")},withSearch:g,isOpen:i}),
4
4
  /* @__PURE__ */m("div",{className:"mobile_options_content",children:[l?/* @__PURE__ */e(O,{size:"xsmall",type:"secondary",className:"mobile_options_content__label",children:l}):null,a?/* @__PURE__ */e(k,{}):/* @__PURE__ */m("div",{"data-id":`${r}-options-content`,children:[p.length>0&&/* @__PURE__ */e(F,{height:x-30-32-24,itemCount:p.length,itemSize:T,width:w,style:{width:"100%",overflowX:"hidden",overflowY:"auto",willChange:"auto"},children:({index:o,style:t})=>{const i=p[o],s=i.value===n;/* @__PURE__ */
5
5
  return e(R,{size:"large",tooltipAddons:u,data:i,onClick:f(s),labelLeftIconProps:C,OptionRightIconComponent:I,LabelRightIconComponent:j,disabled:i.disabled,isSelected:s,dataId:i.dataId,style:t},i.value)}}),0===p.length?/* @__PURE__ */e(E,{size:"small",mainMessage:null==t?void 0:t.emptyListMainMessage}):null]})]})]})};export{re as SelectMobile};
@@ -1 +1 @@
1
- export declare const filterOptions: (options: TSelectOptions, searchValue: string) => TSelectOptions;
1
+ export declare const filterSearchData: (data: TSelectOptions, searchString: string) => TSelectOptions;
@@ -1 +1 @@
1
- const l=(e,l)=>l?e.filter(e=>"string"==typeof e.label&&e.label.toLowerCase().includes(l.toLowerCase())):e;export{l as filterOptions};
1
+ function s(t,e){return e.reduce(({contains:t,sourceStr:e},r)=>{const n=e.replace(r,"");return{contains:t&&n.length<e.length,sourceStr:n}},{contains:!0,sourceStr:t}).contains}const c=(t,e)=>{if(!e)return t;const r=e.toLowerCase().split(/\s+/).filter(Boolean).sort((t,e)=>e.length-t.length);return t.filter(({label:t})=>s(t.toString().toLowerCase(),r))};export{c as filterSearchData};
@@ -1,3 +1,3 @@
1
- import{jsxs as A,jsx as l,Fragment as B}from"react/jsx-runtime";import{useRef as M,useCallback as T,useMemo as q}from"react";import F from"classnames";import{Input as G}from"../../../Input/Input.js";import{useGetElemSizes as H}from"../../../../hooks/useGetElemSizes.js";import"../../../../consts/index.js";import"../../../../context/types.js";import"../../../../hooks/useScreenSize.js";import{useGetHasBottomSpace as P}from"../../../../hooks/useGetHasBottomSpace.js";import"react-hook-form";import{getStringWidth as _,setTranslationValue as E,noop as U}from"../../../../utils/helpers.js";import{useChangePositionsOnScroll as J}from"../../../../hooks/useChangePositionsOnScroll.js";import{MobileWrapper as K}from"../../MultiSelect/MobileWrapper.js";import{DesktopWrapper as Q}from"../../MultiSelect/DesktopWrapper.js";import X from"../../../SVGIcons/IconChevronUp.js";import Y from"../../../SVGIcons/IconChevronDown.js";const fe=e=>{const{isMobile:o,children:s,options:t,label:r,placeHolder:n,isRequiredField:i,labelAddons:a,disabled:p,className:c="",dropdownWidth:m,align:d="left",size:u,dropdownRef:f,setDropdownRef:h,containerRef:S,setIsOpen:j,isOpen:g,selectedValues:b,setContainerRef:I,overflowText:x,hasError:v,modalApplyButtonText:w,applySelectedItems:R,hideSelectedOptions:k=!1}=e,O=M(null),{width:C}=H(S),W=T(e=>_(e,14)>C-80,[C]),D=q(()=>{if(!b||!b.length)return"";const e=b.map(e=>e.label).join(", ");return W(e)?E(x||"",b.length):e},[t,b,W]),{hasBottomSpace:y}=P({element:f,input:O.current});return J(null==O?void 0:O.current,f,y),/* @__PURE__ */A("div",{className:F("select select--multi",c),ref:I,children:[
2
- /* @__PURE__ */l("div",{onClick:p?U:e=>{const o=null==e?void 0:e.target,s=null==o?void 0:o.getAttribute("class");e&&s&&(-1!==s.indexOf("icon-")||-1!==s.indexOf("svg-icon"))?(j(!g),e.preventDefault()):j(!0)},children:/* @__PURE__ */l(G,{readonly:!0,label:r,ref:O,hasError:v,className:"select__input",placeholder:n,required:i,currentValue:k?"":D,rightIconProps:{Component:g?X:Y,size:"small"},labelAddons:a,disabled:p,size:"large"===u?"large":"small"})}),
3
- /* @__PURE__ */l(B,{children:o?/* @__PURE__ */l(K,{applySelectedItems:R,isOpen:g,closeDrodown:()=>j(!1),modalApplyButtonText:w,children:s}):/* @__PURE__ */l(Q,{setDropdownRef:h,isOpen:g,align:d,dropdownWidth:m,inputRef:O.current,dropdownRef:f,containerRef:S,children:s})})]})};export{fe as InputSelectWrapper};
1
+ import{jsxs as A,jsx as n,Fragment as B}from"react/jsx-runtime";import{useRef as M,useCallback as T,useMemo as q}from"react";import F from"classnames";import{Input as G}from"../../../Input/Input.js";import{useGetElemSizes as H}from"../../../../hooks/useGetElemSizes.js";import"../../../../consts/index.js";import"../../../../context/types.js";import"../../../../hooks/useScreenSize.js";import{useGetHasBottomSpace as P}from"../../../../hooks/useGetHasBottomSpace.js";import"react-hook-form";import{getStringWidth as _,setTranslationValue as E,noop as U}from"../../../../utils/helpers.js";import{useChangePositionsOnScroll as J}from"../../../../hooks/useChangePositionsOnScroll.js";import{MobileWrapper as K}from"../../MultiSelect/MobileWrapper.js";import{DesktopWrapper as Q}from"../../MultiSelect/DesktopWrapper.js";import X from"../../../SVGIcons/IconChevronUp.js";import Y from"../../../SVGIcons/IconChevronDown.js";const fe=e=>{const{isMobile:o,children:s,options:t,label:r,placeHolder:l,isRequiredField:i,labelAddons:a,disabled:p,className:c="",dropdownWidth:m,align:d="left",size:u="small",dropdownRef:f,setDropdownRef:h,containerRef:S,setIsOpen:j,isOpen:g,selectedValues:b,setContainerRef:I,overflowText:x,hasError:v,modalApplyButtonText:w,applySelectedItems:R,hideSelectedOptions:k=!1}=e,O=M(null),{width:C}=H(S),W=T(e=>_(e,14)>C-80,[C]),D=q(()=>{if(!b||!b.length)return"";const e=b.map(e=>e.label).join(", ");return W(e)?E(x||"",b.length):e},[t,b,W]),{hasBottomSpace:y}=P({element:f,input:O.current});return J(null==O?void 0:O.current,f,y),/* @__PURE__ */A("div",{className:F("select select--multi",c),ref:I,children:[
2
+ /* @__PURE__ */n("div",{onClick:p?U:e=>{const o=null==e?void 0:e.target,s=null==o?void 0:o.getAttribute("class");e&&s&&(-1!==s.indexOf("icon-")||-1!==s.indexOf("svg-icon"))?(j(!g),e.preventDefault()):j(!0)},children:/* @__PURE__ */n(G,{readonly:!0,label:r,ref:O,hasError:v,className:"select__input",placeholder:l,required:i,currentValue:k?"":D,rightIconProps:{Component:g?X:Y,size:"small"},labelAddons:a,disabled:p,size:u})}),
3
+ /* @__PURE__ */n(B,{children:o?/* @__PURE__ */n(K,{applySelectedItems:R,isOpen:g,closeDrodown:()=>j(!1),modalApplyButtonText:w,children:s}):/* @__PURE__ */n(Q,{setDropdownRef:h,isOpen:g,align:d,dropdownWidth:m,inputRef:O.current,dropdownRef:f,containerRef:S,children:s})})]})};export{fe as InputSelectWrapper};
@@ -0,0 +1,3 @@
1
+ import { ReactElement } from 'react';
2
+ import { TSkeletonPropTypes } from './types';
3
+ export declare const Skeleton: (props: TSkeletonPropTypes) => ReactElement;
@@ -0,0 +1,5 @@
1
+ import{jsx as s}from"react/jsx-runtime";import v from"classnames";import{DEFAULT_VARIANT as g,DEFAULT_ANIMATION as y}from"./consts.js";const u=s=>{if(null!=s)return"number"==typeof s?`${s}px`:s},C=e=>{const{variant:a=g,animation:t=y,width:n,height:i,count:l=1,children:o,style:r,className:d="",dataId:c=""}=e,h=null!=o,m=l>1?l:1,p={...void 0!==n?{width:u(n)}:null,...void 0!==i?{height:u(i)}:null,...r},k=v("skeleton",`skeleton--${a}`,`skeleton--anim-${t}`,{"skeleton--has-children":h,"skeleton--auto-height":h&&void 0===i,"skeleton--auto-width":h&&void 0===n},d);if(h)/* @__PURE__ */
2
+ return s("span",{className:k,style:p,"data-id":c,children:/* @__PURE__ */s("span",{className:"skeleton__children","aria-hidden":"true",children:o})});if(1===m)/* @__PURE__ */
3
+ return s("span",{className:k,style:p,"data-id":c,role:"status","aria-label":"Loading"});const N=[];for(let e=0;e<m;e+=1)N.push(
4
+ /* @__PURE__ */s("span",{className:k,style:p,"data-id":c?`${c}-${e}`:"","aria-hidden":0!==e||void 0,role:0===e?"status":void 0,"aria-label":0===e?"Loading":void 0},e));/* @__PURE__ */
5
+ return s("span",{className:"skeleton-group",children:N})};export{C as Skeleton};
@@ -0,0 +1,5 @@
1
+ import { TSkeletonAnimation, TSkeletonVariant } from './types';
2
+ export declare const SKELETON_VARIANTS: TSkeletonVariant[];
3
+ export declare const SKELETON_ANIMATIONS: TSkeletonAnimation[];
4
+ export declare const DEFAULT_VARIANT: TSkeletonVariant;
5
+ export declare const DEFAULT_ANIMATION: TSkeletonAnimation;
@@ -0,0 +1 @@
1
+ const t=["text","circular","rectangular","rounded"],A=["pulse","wave","none"],e="text",n="pulse";export{n as DEFAULT_ANIMATION,e as DEFAULT_VARIANT,A as SKELETON_ANIMATIONS,t as SKELETON_VARIANTS};
@@ -0,0 +1,2 @@
1
+ export * from './Skeleton';
2
+ export * from './types';
@@ -0,0 +1 @@
1
+ import{Skeleton as r}from"./Skeleton.js";export{r as Skeleton};
@@ -0,0 +1,24 @@
1
+ import { CSSProperties, ReactNode } from 'react';
2
+ export type TSkeletonVariant = 'text' | 'circular' | 'rectangular' | 'rounded';
3
+ export type TSkeletonAnimation = 'pulse' | 'wave' | 'none';
4
+ export interface TSkeletonPropTypes {
5
+ /** Visual shape of the placeholder. */
6
+ variant?: TSkeletonVariant;
7
+ /** Animation style. Pass `'none'` to disable. */
8
+ animation?: TSkeletonAnimation;
9
+ /** Width as a number (px) or any valid CSS length / percentage. */
10
+ width?: number | string;
11
+ /** Height as a number (px) or any valid CSS length / percentage. */
12
+ height?: number | string;
13
+ /** Render N stacked skeletons. Useful for placeholder paragraphs. */
14
+ count?: number;
15
+ /**
16
+ * If provided, the skeleton wraps the children and infers its size from them
17
+ * while the children remain invisible (used as a layout guide).
18
+ */
19
+ children?: ReactNode;
20
+ /** Inline style overrides applied to every rendered skeleton element. */
21
+ style?: CSSProperties;
22
+ className?: string;
23
+ dataId?: string;
24
+ }
File without changes
@@ -1,5 +1,4 @@
1
1
  import { ReactElement } from 'react';
2
2
  import { TSnackbarProps, TToastProps } from './types';
3
- import 'react-toastify/dist/ReactToastify.css';
4
3
  export declare const notify: (toastProps: TToastProps) => void;
5
4
  export declare const Snackbar: (props: TSnackbarProps) => ReactElement;
@@ -1,5 +1,5 @@
1
- import{jsx as s,jsxs as o}from"react/jsx-runtime";import{toast as m,ToastContainer as l,Slide as d}from"react-toastify";import{Text as c}from"../Text/Text.js";import{Button as u}from"../Button/Button.js";import{DEFAULT_DURATION as f,TYPE_MAPPING as C,ICONS_MAPPING as h}from"./consts.js";import{IconDynamicComponent as N}from"../../helperComponents/IconDynamicComponent/IconDynamicComponent.js";import"react-toastify/dist/ReactToastify.css";const g=({actionProps:t,toastId:a,type:n="information",text:e})=>/* @__PURE__ */o("div",{"data-id":`${n}-toast-message`,className:"snackbar",children:[
1
+ import{jsx as s,jsxs as o}from"react/jsx-runtime";import{toast as m,ToastContainer as l,Slide as d}from"react-toastify";import{Text as c}from"../Text/Text.js";import{Button as u}from"../Button/Button.js";import{DEFAULT_DURATION as f,TYPE_MAPPING as C,ICONS_MAPPING as h}from"./consts.js";import{IconDynamicComponent as N}from"../../helperComponents/IconDynamicComponent/IconDynamicComponent.js";const g=({actionProps:t,toastId:a,type:n="information",text:e})=>/* @__PURE__ */o("div",{"data-id":`${n}-toast-message`,className:"snackbar",children:[
2
2
  /* @__PURE__ */o("div",{className:"snackbar__content",children:[
3
3
  /* @__PURE__ */s(N,{Component:h[n],type:C[n],size:"medium"}),
4
- /* @__PURE__ */s(c,{className:"snackbar__text pl-16 pr-8",type:"primary",size:"standard",weight:"regular",lineHeight:"large",children:e})]}),t?/* @__PURE__ */s(u,{size:"small",type:"tertiary",...t,onClick:s=>{var o;m.dismiss(a),null==(o=null==t?void 0:t.onClick)||o.call(t,s)}}):null]},a),y=t=>{const{toastId:s,closeSnackbar:o,actionProps:a,duration:n=f}=t;m(g(t),{className:"_container",toastId:s,autoClose:!a&&n}),m.onChange(t=>{"removed"===t.status&&(null==o||o(t.id))})},A=t=>{const{duration:o=1e3,position:a="bottom-center"}=t;/* @__PURE__ */
5
- return s(l,{className:"snackbar-wrapper",theme:"light",hideProgressBar:!0,transition:d,position:a,autoClose:o,closeButton:()=>null})};export{A as Snackbar,y as notify};
4
+ /* @__PURE__ */s(c,{className:"snackbar__text pl-16 pr-8",type:"primary",size:"standard",weight:"regular",lineHeight:"large",children:e})]}),t?/* @__PURE__ */s(u,{size:"small",type:"tertiary",...t,onClick:s=>{var o;m.dismiss(a),null==(o=null==t?void 0:t.onClick)||o.call(t,s)}}):null]},a),I=t=>{const{toastId:s,closeSnackbar:o,actionProps:a,duration:n=f}=t;m(g(t),{className:"_container",toastId:s,autoClose:!a&&n}),m.onChange(t=>{"removed"===t.status&&(null==o||o(t.id))})},y=t=>{const{duration:o=1e3,position:a="bottom-center"}=t;/* @__PURE__ */
5
+ return s(l,{className:"snackbar-wrapper",theme:"light",hideProgressBar:!0,transition:d,position:a,autoClose:o,closeButton:()=>null})};export{y as Snackbar,I as notify};
@@ -1,4 +1,4 @@
1
- import{jsxs as r,jsx as i}from"react/jsx-runtime";import{useState as v,useEffect as C}from"react";import{Input as x}from"../Input/Input.js";import{Button as N}from"../Button/Button.js";import{Select as _}from"../Select/Select/Select.js";import"../Select/MultiSelect/MultiSelect.js";import I from"classnames";import{Text as z}from"../Text/Text.js";import"../../consts/index.js";import"../../context/types.js";import"../../hooks/useScreenSize.js";import"react-hook-form";import"dayjs";import"../../helperComponents/ErrorMessage/consts.js";import"../FileUpload/DropzoneFileUpload/DropzoneFileUpload.js";import"../Checkbox/Checkbox.js";import"react-dom";import"motion/react";import S from"../SVGIcons/IconChevronRight.js";import"../Collapse/CollapseGroup/CollapseGroup.js";import m from"../SVGIcons/IconMore.js";import"../Select/SharedComponents/ContentTop.js";import{OPTIONS as k}from"./constants/index.js";import $ from"../SVGIcons/IconChevronLeft.js";import y from"../SVGIcons/IconChevronDoubleLeft.js";import T from"../SVGIcons/IconChevronDoubleRight.js";function oe({table:e,totalCount:t,buttonText:o}){const[a,n]=v("1"),s=e.getState().pagination.pageIndex,l=e.getState().pagination.pageSize;return C(()=>{e.getPageCount()<Number(a)&&n("1")},[e.getPageCount(),e.getState().pagination]),/* @__PURE__ */r("div",{className:"advanced-table__pagination",children:[
1
+ import{jsxs as r,jsx as i}from"react/jsx-runtime";import{useState as v,useEffect as C}from"react";import{Input as x}from"../Input/Input.js";import{Button as N}from"../Button/Button.js";import{Select as _}from"../Select/Select/Select.js";import"../Select/MultiSelect/MultiSelect.js";import I from"classnames";import{Text as z}from"../Text/Text.js";import"../../consts/index.js";import"../../context/types.js";import"../../hooks/useScreenSize.js";import"react-hook-form";import"dayjs";import"../../helperComponents/ErrorMessage/consts.js";import"../FileUpload/DropzoneFileUpload/DropzoneFileUpload.js";import"react-dom";import"../Checkbox/Checkbox.js";import"motion/react";import S from"../SVGIcons/IconChevronRight.js";import"../Collapse/CollapseGroup/CollapseGroup.js";import m from"../SVGIcons/IconMore.js";import"../Select/SharedComponents/ContentTop.js";import{OPTIONS as k}from"./constants/index.js";import $ from"../SVGIcons/IconChevronLeft.js";import y from"../SVGIcons/IconChevronDoubleLeft.js";import T from"../SVGIcons/IconChevronDoubleRight.js";function oe({table:e,totalCount:t,buttonText:o}){const[a,n]=v("1"),s=e.getState().pagination.pageIndex,l=e.getState().pagination.pageSize;return C(()=>{e.getPageCount()<Number(a)&&n("1")},[e.getPageCount(),e.getState().pagination]),/* @__PURE__ */r("div",{className:"advanced-table__pagination",children:[
2
2
  /* @__PURE__ */i(_,{setSelectedItem:t=>(t=>{t&&e.setPagination({pageIndex:0,pageSize:Number(t)})})(t),selectedItem:`${l}`,className:"no-border",options:k}),
3
3
  /* @__PURE__ */r("div",{className:"advanced-table__pagination__right",children:[
4
4
  /* @__PURE__ */r(z,{type:"tertiary",children:[s*l+1," - ",(s+1)*l," / ",t]}),
@@ -1 +1,2 @@
1
- import{jsx as p}from"react/jsx-runtime";import{useRef as H,useState as l,useEffect as n}from"react";import I from"classnames";import{Text as N}from"../Text/Text.js";import{useGetTooltipStyles as $}from"../../hooks/useGetTooltipStyles.js";import{useHideOnScroll as M}from"../../hooks/useHideOnScroll.js";import"../../context/types.js";import"../../hooks/useScreenSize.js";import"react-hook-form";import{Positions as O}from"./types.js";const G=e=>{const t=H(null),{size:o="large",text:s,className:i="",position:r=O.BOTTOM_LEFT,dataId:a="",id:m,elemRef:u,hovered:c=!1}=e,[d,f]=l(c),[v,h]=l(u||null),[x,T]=l(0);n(()=>{if(m){const e=document.getElementById(m.toString());h(e)}},[m]);const y=()=>{f(!0)},S=()=>f(!1);M(S);const{tooltipStyles:j,tooltipPosition:E}=$({elemRef:v,tooltipRef:t.current,initialPosition:r,toolTipCurrentWidth:x});return n(()=>(v&&(v.addEventListener("mouseenter",y),v.addEventListener("mouseleave",S)),()=>{null==v||v.removeEventListener("mouseenter",y),null==v||v.removeEventListener("mouseleave",S)}),[v]),n(()=>{var e;T(d&&(null==(e=null==t?void 0:t.current)?void 0:e.clientWidth)||0)},[d]),d?/* @__PURE__ */p("div",{style:j,"data-id":a,className:I(`tooltip tooltip--${o} tooltip--${E}`,i),ref:t,children:/* @__PURE__ */p(N,{dataId:`${a}-text`,className:"tooltip__inner",type:"primary",weight:"regular",lineHeight:"small",size:""+("small"==o?"xsmall":"small"),children:s})}):null};export{G as Tooltip};
1
+ import{jsx as p}from"react/jsx-runtime";import{useRef as H,useState as l,useEffect as n}from"react";import I from"classnames";import{Text as N}from"../Text/Text.js";import{useGetTooltipStyles as P}from"../../hooks/useGetTooltipStyles.js";import{useHideOnScroll as $}from"../../hooks/useHideOnScroll.js";import"../../context/types.js";import"../../hooks/useScreenSize.js";import"react-hook-form";import{Positions as M}from"./types.js";import{createPortal as O}from"react-dom";const k=e=>{const t=H(null),{size:o="large",text:s,className:i="",position:r=M.BOTTOM_LEFT,dataId:a="",id:m,elemRef:u,hovered:c=!1}=e,[d,f]=l(c),[v,h]=l(u||null),[x,y]=l(0);n(()=>{if(m){const e=document.getElementById(m.toString());h(e)}},[m]);const T=()=>{f(!0)},S=()=>f(!1);$(S);const{tooltipStyles:j,tooltipPosition:E}=P({elemRef:v,tooltipRef:t.current,initialPosition:r,toolTipCurrentWidth:x});return n(()=>(v&&(v.addEventListener("mouseenter",T),v.addEventListener("mouseleave",S)),()=>{null==v||v.removeEventListener("mouseenter",T),null==v||v.removeEventListener("mouseleave",S)}),[v]),n(()=>{var e;y(d&&(null==(e=null==t?void 0:t.current)?void 0:e.clientWidth)||0)},[d]),d?O(
2
+ /* @__PURE__ */p("div",{style:j,"data-id":a,className:I(`tooltip tooltip--${o} tooltip--${E}`,i),ref:t,children:/* @__PURE__ */p(N,{dataId:`${a}-text`,className:"tooltip__inner",type:"primary",weight:"regular",lineHeight:"small",size:""+("small"==o?"xsmall":"small"),children:s})}),document.body):null};export{k as Tooltip};
package/consts/index.d.ts CHANGED
@@ -38,8 +38,7 @@ export declare enum STORE_KEYS {
38
38
  isAuthenticated = "isAuthenticated",
39
39
  personId = "personId",
40
40
  isMobile = "isMobile",
41
- staffListColumns = "staffListColumns",
42
- themeMode = "themeMode"
41
+ staffListColumns = "staffListColumns"
43
42
  }
44
43
  export declare enum ThemeMode {
45
44
  Light = "light",
package/consts/index.js CHANGED
@@ -1 +1 @@
1
- import{FileTypeEnum as a}from"../type/file-upload.js";const s=["image/jpeg","image/png","application/pdf"],u=["image/jpeg","image/jpg","image/png","image/heic","image/heif","application/pdf"],c=[".jpeg",".jpg",".png",".heic",".heif",".pdf"],l={SMALL:768,MEDIUM:992,LARGE:1200},p=l.SMALL;var n=/* @__PURE__ */(e=>(e[e.size=0]="size",e[e.type=1]="type",e))(n||{}),i=/* @__PURE__ */(e=>(e.cardRadio="cardRadio",e.card="card",e))(i||{});const d="Custom scroll event has fired",g="CUSTOM_SCROLL_EVENT",M=[{label:"January",value:0},{label:"February",value:1},{label:"March",value:2},{label:"April",value:3},{label:"May",value:4},{label:"June",value:5},{label:"July",value:6},{label:"August",value:7},{label:"September",value:8},{label:"October",value:9},{label:"November",value:10},{label:"December",value:11}],m=10,v={[a.PDF]:["application/pdf"],[a.IMAGE]:["image/jpeg","image/png"],[a.DOC]:[".doc,.docx,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document"]};var o=/* @__PURE__ */(e=>(e.selectedLanguage="selectedLanguage",e.theme="theme",e.userActiveRole="userActiveRole",e.roleInfo="roleInfo",e.userInfo="userInfo",e.navigationInfo="navigationInfo",e.isNavMenuExpanded="isNavMenuExpanded",e.isAuthenticated="isAuthenticated",e.personId="personId",e.isMobile="isMobile",e.staffListColumns="staffListColumns",e.themeMode="themeMode",e))(o||{}),t=/* @__PURE__ */(e=>(e.Light="light",e.Dark="dark",e))(t||{});export{i as CARD_SELECT_TYPES,d as CUSTOM_SCROLL_MESSAGE,g as CUSTOM_SCROLL_NAME,m as DROPDOWN_AND_INPUT_GAP,v as FILE_ACCEPT_TYPE,n as FILE_UPLOAD_ERRORS,c as IMAGE_MIME_TYPE,s as IMAGE_MIME_TYPES,u as IMAGE_MIME_TYPES_FOR_PREVIEW,p as MOBILE_POINT,M as MONTHS,l as SCREEN_SIZES,o as STORE_KEYS,t as ThemeMode};
1
+ import{FileTypeEnum as a}from"../type/file-upload.js";const s=["image/jpeg","image/png","application/pdf"],u=["image/jpeg","image/jpg","image/png","image/heic","image/heif","application/pdf"],c=[".jpeg",".jpg",".png",".heic",".heif",".pdf"],l={SMALL:768,MEDIUM:992,LARGE:1200},p=l.SMALL;var n=/* @__PURE__ */(e=>(e[e.size=0]="size",e[e.type=1]="type",e))(n||{}),i=/* @__PURE__ */(e=>(e.cardRadio="cardRadio",e.card="card",e))(i||{});const g="Custom scroll event has fired",d="CUSTOM_SCROLL_EVENT",M=[{label:"January",value:0},{label:"February",value:1},{label:"March",value:2},{label:"April",value:3},{label:"May",value:4},{label:"June",value:5},{label:"July",value:6},{label:"August",value:7},{label:"September",value:8},{label:"October",value:9},{label:"November",value:10},{label:"December",value:11}],m=10,v={[a.PDF]:["application/pdf"],[a.IMAGE]:["image/jpeg","image/png"],[a.DOC]:[".doc,.docx,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document"]};var o=/* @__PURE__ */(e=>(e.selectedLanguage="selectedLanguage",e.theme="theme",e.userActiveRole="userActiveRole",e.roleInfo="roleInfo",e.userInfo="userInfo",e.navigationInfo="navigationInfo",e.isNavMenuExpanded="isNavMenuExpanded",e.isAuthenticated="isAuthenticated",e.personId="personId",e.isMobile="isMobile",e.staffListColumns="staffListColumns",e))(o||{}),t=/* @__PURE__ */(e=>(e.Light="light",e.Dark="dark",e))(t||{});export{i as CARD_SELECT_TYPES,g as CUSTOM_SCROLL_MESSAGE,d as CUSTOM_SCROLL_NAME,m as DROPDOWN_AND_INPUT_GAP,v as FILE_ACCEPT_TYPE,n as FILE_UPLOAD_ERRORS,c as IMAGE_MIME_TYPE,s as IMAGE_MIME_TYPES,u as IMAGE_MIME_TYPES_FOR_PREVIEW,p as MOBILE_POINT,M as MONTHS,l as SCREEN_SIZES,o as STORE_KEYS,t as ThemeMode};
@@ -0,0 +1 @@
1
+ export declare const getCurrentWeekWorkdaysRange: () => [Date, Date];
@@ -0,0 +1 @@
1
+ const s=()=>{const e=/* @__PURE__ */new Date,t=new Date(e),a=new Date(e),n=e.getDay(),s=0===n?-6:1-n;return t.setDate(e.getDate()+s),[t,a]};export{s as getCurrentWeekWorkdaysRange};
@@ -1,2 +1,5 @@
1
+ import 'dayjs/locale/hy-am';
2
+ import 'dayjs/locale/ru';
3
+ import 'dayjs/locale/en';
1
4
  export declare const formatDate: (value: string | Date | null | undefined, format: string, defaultValue?: string) => string;
2
5
  export declare const formatDateUTC: (value: string | Date | null | undefined, format: string, defaultValue?: string) => string;
@@ -1 +1 @@
1
- import r from"dayjs";import m from"dayjs/plugin/utc";import{getDayJSLocale as a}from"./locale.js";r.extend(m);const n=(o,t,m="")=>r(o).isValid()&&o?r(o).locale(a()).format(t):m,d=(o,t,m="")=>r(o).isValid()&&o?r.utc(o).locale(a()).format(t):m;export{n as formatDate,d as formatDateUTC};
1
+ import r from"dayjs";import s from"dayjs/plugin/utc";import{getDayJSLocale as a}from"./locale.js";import"dayjs/locale/hy-am";import"dayjs/locale/ru";import"dayjs/locale/en";r.extend(s);const p=(o,t,l="")=>r(o).isValid()&&o?r(o).locale(a()).format(t):l,V=(o,t,l="")=>r(o).isValid()&&o?r.utc(o).locale(a()).format(t):l;export{p as formatDate,V as formatDateUTC};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hrm_ui_lib",
3
- "version": "0.0.1-beta.2",
3
+ "version": "0.0.1-beta.21",
4
4
  "description": "UI library for Dino",
5
5
  "main": "./index.cjs",
6
6
  "module": "./index.js",
@@ -1,3 +1,4 @@
1
+ import { STORE_KEYS } from '../consts';
1
2
  export declare const noop: () => void;
2
3
  export declare const checkIsAllowedFileSize: (allowedSize: number, fileSize: number) => boolean;
3
4
  export declare const openFileInNewWindow: ({ e, file, handleFileClick }: {
@@ -13,4 +14,4 @@ export declare const setTranslationValue: (translation: string, value: string |
13
14
  export declare const getYearOptions: (startYear: number, lastYear: number) => TSelectOptions;
14
15
  export declare const isSameDay: (date1?: Date, date2?: Date) => boolean;
15
16
  export declare const generateDataTestId: (postfix: string, dataId?: string) => string;
16
- export declare const clearStorage: () => void;
17
+ export declare const clearStorage: (preservedKeys?: STORE_KEYS[]) => void;
package/utils/helpers.js CHANGED
@@ -1 +1 @@
1
- import s from"dayjs";import{STORE_KEYS as c}from"../consts/index.js";const l=()=>{},u=(e,o)=>o<=e,d=({e:e,file:o,handleFileClick:t})=>{if(e.preventDefault(),t&&t(o),o)if(o instanceof Blob){const e=URL.createObjectURL(o);window.open(e)}else console.error("The provided object is not a File or Blob.");else console.error("No file provided.")},p=e=>{const o=[];for(let t=0;t<e.length;t++){const s=new FileReader;s.onloadend=()=>{console.log(s.result)},s.readAsDataURL(e[t]),o.push(s)}return o},f=e=>e.filter((e,o,t)=>o===t.findIndex(o=>o.name===e.name)),m=(e,o)=>e.includes(o),g=(e,o)=>{const t=document.createElement("canvas").getContext("2d");return t?(t.font=o+"px Arial",t.measureText(e).width):0},v=(e,o)=>e.replace("%s",o.toString()),w=(e,o)=>{const t=[];for(;e<=o;)t.push({value:o,label:o}),o--;return t},S=(e,o)=>!(!e||!o)&&s(e).isSame(o,"day"),h=(e,o)=>o?`${o}-${e}`:"",x=()=>{for(const e in c)localStorage.removeItem(e)};export{u as checkIsAllowedFileSize,m as checkIsAllowedTypes,x as clearStorage,h as generateDataTestId,p as getFormattedValues,g as getStringWidth,w as getYearOptions,S as isSameDay,l as noop,d as openFileInNewWindow,v as setTranslationValue,f as uniqueFiles};
1
+ import c from"dayjs";import{STORE_KEYS as r}from"../consts/index.js";const l=()=>{},u=(e,o)=>o<=e,d=({e:e,file:o,handleFileClick:t})=>{if(e.preventDefault(),t&&t(o),o)if(o instanceof Blob){const e=URL.createObjectURL(o);window.open(e)}else console.error("The provided object is not a File or Blob.");else console.error("No file provided.")},f=e=>{const o=[];for(let t=0;t<e.length;t++){const a=new FileReader;a.onloadend=()=>{console.log(a.result)},a.readAsDataURL(e[t]),o.push(a)}return o},m=e=>e.filter((e,o,t)=>o===t.findIndex(o=>o.name===e.name)),p=(e,o)=>e.includes(o),g=(e,o)=>{const t=document.createElement("canvas").getContext("2d");return t?(t.font=o+"px Arial",t.measureText(e).width):0},h=(e,o)=>e.replace("%s",o.toString()),v=(e,o)=>{const t=[];for(;e<=o;)t.push({value:o,label:o}),o--;return t},w=(e,o)=>!(!e||!o)&&c(e).isSame(o,"day"),S=(e,o)=>o?`${o}-${e}`:"",b=(e=[r.theme])=>{Object.values(r).forEach(o=>{e.includes(o)||localStorage.removeItem(o)})};export{u as checkIsAllowedFileSize,p as checkIsAllowedTypes,b as clearStorage,S as generateDataTestId,f as getFormattedValues,g as getStringWidth,v as getYearOptions,w as isSameDay,l as noop,d as openFileInNewWindow,h as setTranslationValue,m as uniqueFiles};