hrm_ui_lib 2.0.0-alpha.27 → 2.0.0-alpha.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/FileUpload/DropzoneFileUpload/PreviewItem.js +6 -6
- package/components/Menu/NestedMenu.js +2 -2
- package/components/SVGIcons/index.d.ts +320 -319
- package/components/SVGIcons/index.js +1 -1
- package/consts/index.d.ts +11 -0
- package/consts/index.js +1 -1
- package/helpers/index.d.ts +1 -0
- package/helpers/index.js +1 -1
- package/helpers/logout.d.ts +1 -0
- package/helpers/logout.js +1 -0
- package/index.js +1 -1
- package/package.json +1 -1
- package/utils/helpers.d.ts +1 -0
- package/utils/helpers.js +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{jsxs as
|
|
2
|
-
return
|
|
1
|
+
import{jsxs as l,jsx as e}from"react/jsx-runtime";import{Text as n}from"../../Text/Text.js";import{Button as s}from"../../Button/Button.js";import f from"../../SVGIcons/IconDelete.js";import{useMemo as _}from"react";import{FileUploadMode as t}from"../types.js";import{FilePreview as w}from"./FilePreview.js";import{shortenFileName as v,formatFileSize as z}from"./helpers.js";import h from"../../SVGIcons/IconArrowDownloadFilled.js";import u from"classnames";import"../../../helpers/format-date.js";import{downloadFile as F}from"../../../helpers/download-file.js";import"react-toastify";import"react-toastify/dist/ReactToastify.css";import"dayjs";import"../../../consts/index.js";const B=({file:i,onRemove:o,mode:r})=>{const a=i.type.split("/")[0],m=_(()=>URL.createObjectURL(i),[i.name]);/* @__PURE__ */
|
|
2
|
+
return l("div",{className:u("dz-file-upload__files--item",{"dz-file-upload__files--item--view":r===t.view}),onClick:()=>{r===t.view&&window.open(m,"_blank")},children:[
|
|
3
3
|
/* @__PURE__ */e("div",{className:"dz-file-upload__files--item__preview",children:/* @__PURE__ */e(w,{preview:m,type:a})}),
|
|
4
|
-
/* @__PURE__ */
|
|
5
|
-
/* @__PURE__ */
|
|
6
|
-
/* @__PURE__ */e(n,{weight:"semibold",children:v(i.name,40)}),
|
|
7
|
-
/* @__PURE__ */e("div",{className:"dz-file-upload__files--item__info-size",children:/* @__PURE__ */e(n,{size:"small",children:z(i.size)})})]})]})};export{
|
|
4
|
+
/* @__PURE__ */l("div",{className:"dz-file-upload__files--item__info",children:[
|
|
5
|
+
/* @__PURE__ */l("div",{className:"dz-file-upload__files--item__info-title",children:[
|
|
6
|
+
/* @__PURE__ */e(n,{weight:"semibold",children:v(i.name,40)}),r===t.attach&&/* @__PURE__ */e(s,{size:"small",type:"tertiary",onClick:o,iconProps:{Component:f}}),r===t.view&&/* @__PURE__ */e(s,{size:"small",type:"tertiary",onClick:e=>{e.preventDefault(),e.stopPropagation(),F(m,i.name)},iconProps:{Component:h}})]}),
|
|
7
|
+
/* @__PURE__ */e("div",{className:"dz-file-upload__files--item__info-size",children:/* @__PURE__ */e(n,{size:"small",children:z(i.size)})})]})]})};export{B as PreviewItem};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{jsx as m,Fragment as x}from"react/jsx-runtime";import{useState as y,useId as E,useMemo as H}from"react";import{createPortal as T}from"react-dom";import{useGetElemSizes as h}from"../../hooks/useGetElemSizes.js";import{useGetElemPositions as $}from"../../hooks/useGetElemPositions.js";import{useGetTooltipPosition as j}from"../../hooks/useGetTooltipPosition.js";import{useHideOnScroll as v}from"../../hooks/useHideOnScroll.js";import"../../context/types.js";import{useOnOutsideClick as z}from"../../hooks/useOnOutsideClick.js";import"../../hooks/useScreenSize.js";import"react-hook-form";import C from"classnames";import"motion/react";import"dayjs";import{CollapseGroup as F}from"../Collapse/CollapseGroup/CollapseGroup.js";import{OptionItem as L}from"../../helperComponents/OptionItem/OptionItem.js";const
|
|
1
|
+
import{jsx as m,Fragment as x}from"react/jsx-runtime";import{useState as y,useId as E,useMemo as H}from"react";import{createPortal as T}from"react-dom";import{useGetElemSizes as h}from"../../hooks/useGetElemSizes.js";import{useGetElemPositions as $}from"../../hooks/useGetElemPositions.js";import{useGetTooltipPosition as j}from"../../hooks/useGetTooltipPosition.js";import{useHideOnScroll as v}from"../../hooks/useHideOnScroll.js";import"../../context/types.js";import{useOnOutsideClick as z}from"../../hooks/useOnOutsideClick.js";import"../../hooks/useScreenSize.js";import"react-hook-form";import C from"classnames";import"motion/react";import"dayjs";import"../../consts/index.js";import{CollapseGroup as F}from"../Collapse/CollapseGroup/CollapseGroup.js";import{OptionItem as L}from"../../helperComponents/OptionItem/OptionItem.js";const it=({menuItems:e=[],parentRef:t,onClose:o,isOpen:s,position:i="bottom-right",className:l=""})=>{const[r,a]=y(null);z(r,o,!!s,E()),v(o);const{left:n,top:p}=$(t),{width:u,height:c}=h(t),{width:d,height:f}=h(r),b=j({tooltipRef:r,elemRef:t,initialPosition:i,hasTriangle:!1}),k=H(()=>"bottom-right"===b?{left:n+4,top:p+4+c}:"bottom-left"===b?{right:0,top:p+4+c}:"top-right"===b?{left:n+4,top:p-f-4}:"top-left"===b?{left:n-d+u,top:p-f-4}:{left:n,top:p+4+c},[n,p,u,b,d,c,f]);if(!t||!s)return null;const I=e.map((e,t)=>({...e,content:e.subItems?/* @__PURE__ */m("div",{className:"nested-menu__sub-items select",children:e.subItems.map(({label:e,meta:s,value:i,handler:l,iconProps:r,disabled:a,dataId:n})=>/* @__PURE__ */m(L,{dataId:n,disabled:a,data:{label:e,value:i,meta:s},labelLeftIconProps:r,onClick:()=>{o(),null==l||l()},className:"nested-menu__sub-item"},`${t}-${i}`))}):null}));/* @__PURE__ */
|
|
2
2
|
return m(x,{children:T(
|
|
3
|
-
/* @__PURE__ */m("div",{className:C("nested-menu",l),style:k,ref:a,children:/* @__PURE__ */m(F,{items:I})}),t)})};export{
|
|
3
|
+
/* @__PURE__ */m("div",{className:C("nested-menu",l),style:k,ref:a,children:/* @__PURE__ */m(F,{items:I})}),t)})};export{it as NestedMenu};
|