denwa-react-shared 1.0.74 → 1.0.76

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.
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-DKVThYKU.cjs"),H=require("react"),oa=require("react-dom");function ra(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const n=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,n.get?n:{enumerable:!0,get:()=>e[o]})}}return t.default=e,Object.freeze(t)}const s=ra(H);function sn(e){return e!=null&&e===e.window}const aa=e=>{var t,o;if(typeof window>"u")return 0;let n=0;return sn(e)?n=e.pageYOffset:e instanceof Document?n=e.documentElement.scrollTop:(e instanceof HTMLElement||e)&&(n=e.scrollTop),e&&!sn(e)&&typeof n!="number"&&(n=(o=((t=e.ownerDocument)!==null&&t!==void 0?t:e).documentElement)===null||o===void 0?void 0:o.scrollTop),n};function ia(e,t,o,n){const a=o-t;return e/=n/2,e<1?a/2*e*e*e+t:a/2*((e-=2)*e*e+2)+t}function la(e,t={}){const{getContainer:o=()=>window,callback:n,duration:a=450}=t,i=o(),d=aa(i),l=Date.now(),c=()=>{const p=Date.now()-l,g=ia(p>a?a:p,d,e,a);sn(i)?i.scrollTo(window.pageXOffset,g):i instanceof Document||i.constructor.name==="HTMLDocument"?i.documentElement.scrollTop=g:i.scrollTop=g,p<a?r.wrapperRaf(c):typeof n=="function"&&n()};r.wrapperRaf(c)}const sa=e=>typeof e!="object"&&typeof e!="function"||e===null;var da={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 192H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM104 228a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"bars",theme:"outlined"},ca=function(t,o){return s.createElement(r.Icon$1,r._extends({},t,{ref:o,icon:da}))},To=s.forwardRef(ca);process.env.NODE_ENV!=="production"&&(To.displayName="BarsOutlined");const ua=s.createContext({siderHook:{addSider:()=>null,removeSider:()=>null}}),fa=e=>{const{antCls:t,componentCls:o,colorText:n,footerBg:a,headerHeight:i,headerPadding:d,headerColor:l,footerPadding:c,fontSize:u,bodyBg:p,headerBg:g}=e;return{[o]:{display:"flex",flex:"auto",flexDirection:"column",minHeight:0,background:p,"&, *":{boxSizing:"border-box"},[`&${o}-has-sider`]:{flexDirection:"row",[`> ${o}, > ${o}-content`]:{width:0}},[`${o}-header, &${o}-footer`]:{flex:"0 0 auto"},"&-rtl":{direction:"rtl"}},[`${o}-header`]:{height:i,padding:d,color:l,lineHeight:r.unit(i),background:g,[`${t}-menu`]:{lineHeight:"inherit"}},[`${o}-footer`]:{padding:c,color:n,fontSize:u,background:a},[`${o}-content`]:{flex:"auto",color:n,minHeight:0}}},Do=e=>{const{colorBgLayout:t,controlHeight:o,controlHeightLG:n,colorText:a,controlHeightSM:i,marginXXS:d,colorTextLightSolid:l,colorBgContainer:c}=e,u=n*1.25;return{colorBgHeader:"#001529",colorBgBody:t,colorBgTrigger:"#002140",bodyBg:t,headerBg:"#001529",headerHeight:o*2,headerPadding:`0 ${u}px`,headerColor:a,footerPadding:`${i}px ${u}px`,footerBg:t,siderBg:"#001529",triggerHeight:n+d*2,triggerBg:"#002140",triggerColor:l,zeroTriggerWidth:n,zeroTriggerHeight:n,lightSiderBg:c,lightTriggerBg:c,lightTriggerColor:a}},Bo=[["colorBgBody","bodyBg"],["colorBgHeader","headerBg"],["colorBgTrigger","triggerBg"]];r.genStyleHooks("Layout",e=>[fa(e)],Do,{deprecatedTokens:Bo});const pa=e=>{const{componentCls:t,siderBg:o,motionDurationMid:n,motionDurationSlow:a,antCls:i,triggerHeight:d,triggerColor:l,triggerBg:c,headerHeight:u,zeroTriggerWidth:p,zeroTriggerHeight:g,borderRadiusLG:m,lightSiderBg:f,lightTriggerColor:v,lightTriggerBg:C,bodyBg:h}=e;return{[t]:{position:"relative",minWidth:0,background:o,transition:`all ${n}, background 0s`,"&-has-trigger":{paddingBottom:d},"&-right":{order:1},[`${t}-children`]:{height:"100%",marginTop:-.1,paddingTop:.1,[`${i}-menu${i}-menu-inline-collapsed`]:{width:"auto"}},[`&-zero-width ${t}-children`]:{overflow:"hidden"},[`${t}-trigger`]:{position:"fixed",bottom:0,zIndex:1,height:d,color:l,lineHeight:r.unit(d),textAlign:"center",background:c,cursor:"pointer",transition:`all ${n}`},[`${t}-zero-width-trigger`]:{position:"absolute",top:u,insetInlineEnd:e.calc(p).mul(-1).equal(),zIndex:1,width:p,height:g,color:l,fontSize:e.fontSizeXL,display:"flex",alignItems:"center",justifyContent:"center",background:o,borderRadius:`0 ${r.unit(m)} ${r.unit(m)} 0`,cursor:"pointer",transition:`background ${a} ease`,"&::after":{position:"absolute",inset:0,background:"transparent",transition:`all ${a}`,content:'""'},"&:hover::after":{background:"rgba(255, 255, 255, 0.2)"},"&-right":{insetInlineStart:e.calc(p).mul(-1).equal(),borderRadius:`${r.unit(m)} 0 0 ${r.unit(m)}`}},"&-light":{background:f,[`${t}-trigger`]:{color:v,background:C},[`${t}-zero-width-trigger`]:{color:v,background:C,border:`1px solid ${h}`,borderInlineStart:0}}}}},ma=r.genStyleHooks(["Layout","Sider"],e=>[pa(e)],Do,{deprecatedTokens:Bo});var ga=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(o[n[a]]=e[n[a]]);return o};const Qn={xs:"479.98px",sm:"575.98px",md:"767.98px",lg:"991.98px",xl:"1199.98px",xxl:"1599.98px"},va=e=>!Number.isNaN(Number.parseFloat(e))&&isFinite(e),xn=s.createContext({}),ha=(()=>{let e=0;return(t="")=>(e+=1,`${t}${e}`)})(),ba=s.forwardRef((e,t)=>{const{prefixCls:o,className:n,trigger:a,children:i,defaultCollapsed:d=!1,theme:l="dark",style:c={},collapsible:u=!1,reverseArrow:p=!1,width:g=200,collapsedWidth:m=80,zeroWidthTriggerStyle:f,breakpoint:v,onCollapse:C,onBreakpoint:h}=e,b=ga(e,["prefixCls","className","trigger","children","defaultCollapsed","theme","style","collapsible","reverseArrow","width","collapsedWidth","zeroWidthTriggerStyle","breakpoint","onCollapse","onBreakpoint"]),{siderHook:S}=H.useContext(ua),[x,w]=H.useState("collapsed"in e?e.collapsed:d),[$,N]=H.useState(!1);H.useEffect(()=>{"collapsed"in e&&w(e.collapsed)},[e.collapsed]);const k=(X,de)=>{"collapsed"in e||w(X),C==null||C(X,de)},{getPrefixCls:_,direction:y}=H.useContext(r.ConfigContext),T=_("layout-sider",o),[R,O,P]=ma(T),I=H.useRef(null);I.current=X=>{N(X.matches),h==null||h(X.matches),x!==X.matches&&k(X.matches,"responsive")},H.useEffect(()=>{function X(he){var j;return(j=I.current)===null||j===void 0?void 0:j.call(I,he)}let de;return typeof(window==null?void 0:window.matchMedia)<"u"&&v&&v in Qn&&(de=window.matchMedia(`screen and (max-width: ${Qn[v]})`),r.addMediaQueryListener(de,X),X(de)),()=>{r.removeMediaQueryListener(de,X)}},[v]),H.useEffect(()=>{const X=ha("ant-sider-");return S.addSider(X),()=>S.removeSider(X)},[]);const E=()=>{k(!x,"clickTrigger")},D=r.omit(b,["collapsed"]),B=x?m:g,K=va(B)?`${B}px`:String(B),M=parseFloat(String(m||0))===0?s.createElement("span",{onClick:E,className:r.cn(`${T}-zero-width-trigger`,`${T}-zero-width-trigger-${p?"right":"left"}`),style:f},a||s.createElement(To,null)):null,A=y==="rtl"==!p,Y={expanded:A?s.createElement(r.RefIcon$2,null):s.createElement(r.RefIcon$1,null),collapsed:A?s.createElement(r.RefIcon$1,null):s.createElement(r.RefIcon$2,null)}[x?"collapsed":"expanded"],J=a!==null?M||s.createElement("div",{className:`${T}-trigger`,onClick:E,style:{width:K}},a||Y):null,oe=Object.assign(Object.assign({},c),{flex:`0 0 ${K}`,maxWidth:K,minWidth:K,width:K}),re=r.cn(T,`${T}-${l}`,{[`${T}-collapsed`]:!!x,[`${T}-has-trigger`]:u&&a!==null&&!M,[`${T}-below`]:!!$,[`${T}-zero-width`]:parseFloat(K)===0},n,O,P),Z=s.useMemo(()=>({siderCollapsed:x}),[x]);return R(s.createElement(xn.Provider,{value:Z},s.createElement("aside",Object.assign({className:re},D,{style:oe,ref:t}),s.createElement("div",{className:`${T}-children`},i),u||$&&M?J:null)))});process.env.NODE_ENV!=="production"&&(ba.displayName="Sider");const zt=H.createContext({prefixCls:"",firstLevel:!0,inlineCollapsed:!1});var ya=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(o[n[a]]=e[n[a]]);return o};const Ko=e=>{const{prefixCls:t,className:o,dashed:n}=e,a=ya(e,["prefixCls","className","dashed"]),{getPrefixCls:i}=s.useContext(r.ConfigContext),d=i("menu",t),l=r.cn({[`${d}-item-divider-dashed`]:!!n},o);return s.createElement(r.Divider,Object.assign({className:l},a))},Mo=e=>{var t;const{className:o,children:n,icon:a,title:i,danger:d,extra:l}=e,{prefixCls:c,firstLevel:u,direction:p,disableMenuItemTitleTooltip:g,inlineCollapsed:m}=s.useContext(zt),f=x=>{const w=n==null?void 0:n[0],$=s.createElement("span",{className:r.cn(`${c}-title-content`,{[`${c}-title-content-with-extra`]:!!l||l===0})},n);return(!a||s.isValidElement(n)&&n.type==="span")&&n&&x&&u&&typeof w=="string"?s.createElement("div",{className:`${c}-inline-collapsed-noicon`},w.charAt(0)):$},{siderCollapsed:v}=s.useContext(xn);let C=i;typeof i>"u"?C=u?n:"":i===!1&&(C="");const h={title:C};!v&&!m&&(h.title=null,h.open=!1);const b=r.toArray(n).length;let S=s.createElement(r.MenuItem,Object.assign({},r.omit(e,["title","icon","danger"]),{className:r.cn({[`${c}-item-danger`]:d,[`${c}-item-only-child`]:(a?b+1:b)===1},o),title:typeof i=="string"?i:void 0}),r.cloneElement(a,{className:r.cn(s.isValidElement(a)?(t=a.props)===null||t===void 0?void 0:t.className:"",`${c}-item-icon`)}),f(m));return g||(S=s.createElement(r.Tooltip,Object.assign({},h,{placement:p==="rtl"?"left":"right",classNames:{root:`${c}-inline-collapsed-tooltip`}}),S)),S};var Ca=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(o[n[a]]=e[n[a]]);return o};const jt=s.createContext(null),zo=s.forwardRef((e,t)=>{const{children:o}=e,n=Ca(e,["children"]),a=s.useContext(jt),i=s.useMemo(()=>Object.assign(Object.assign({},a),n),[a,n.prefixCls,n.mode,n.selectable,n.rootClassName]),d=r.supportNodeRef(o),l=r.useComposeRef(t,d?r.getNodeRef(o):null);return s.createElement(jt.Provider,{value:i},s.createElement(r.ContextIsolator,{space:!0},d?s.cloneElement(o,{ref:l}):o))}),xa=e=>{const{componentCls:t,motionDurationSlow:o,horizontalLineHeight:n,colorSplit:a,lineWidth:i,lineType:d,itemPaddingInline:l}=e;return{[`${t}-horizontal`]:{lineHeight:n,border:0,borderBottom:`${r.unit(i)} ${d} ${a}`,boxShadow:"none","&::after":{display:"block",clear:"both",height:0,content:'"\\20"'},[`${t}-item, ${t}-submenu`]:{position:"relative",display:"inline-block",verticalAlign:"bottom",paddingInline:l},[`> ${t}-item:hover,
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-ByDIgGvV.cjs"),H=require("react"),oa=require("react-dom");function ra(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const n=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,n.get?n:{enumerable:!0,get:()=>e[o]})}}return t.default=e,Object.freeze(t)}const s=ra(H);function sn(e){return e!=null&&e===e.window}const aa=e=>{var t,o;if(typeof window>"u")return 0;let n=0;return sn(e)?n=e.pageYOffset:e instanceof Document?n=e.documentElement.scrollTop:(e instanceof HTMLElement||e)&&(n=e.scrollTop),e&&!sn(e)&&typeof n!="number"&&(n=(o=((t=e.ownerDocument)!==null&&t!==void 0?t:e).documentElement)===null||o===void 0?void 0:o.scrollTop),n};function ia(e,t,o,n){const a=o-t;return e/=n/2,e<1?a/2*e*e*e+t:a/2*((e-=2)*e*e+2)+t}function la(e,t={}){const{getContainer:o=()=>window,callback:n,duration:a=450}=t,i=o(),d=aa(i),l=Date.now(),c=()=>{const p=Date.now()-l,g=ia(p>a?a:p,d,e,a);sn(i)?i.scrollTo(window.pageXOffset,g):i instanceof Document||i.constructor.name==="HTMLDocument"?i.documentElement.scrollTop=g:i.scrollTop=g,p<a?r.wrapperRaf(c):typeof n=="function"&&n()};r.wrapperRaf(c)}const sa=e=>typeof e!="object"&&typeof e!="function"||e===null;var da={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 192H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM104 228a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"bars",theme:"outlined"},ca=function(t,o){return s.createElement(r.Icon$1,r._extends({},t,{ref:o,icon:da}))},To=s.forwardRef(ca);process.env.NODE_ENV!=="production"&&(To.displayName="BarsOutlined");const ua=s.createContext({siderHook:{addSider:()=>null,removeSider:()=>null}}),fa=e=>{const{antCls:t,componentCls:o,colorText:n,footerBg:a,headerHeight:i,headerPadding:d,headerColor:l,footerPadding:c,fontSize:u,bodyBg:p,headerBg:g}=e;return{[o]:{display:"flex",flex:"auto",flexDirection:"column",minHeight:0,background:p,"&, *":{boxSizing:"border-box"},[`&${o}-has-sider`]:{flexDirection:"row",[`> ${o}, > ${o}-content`]:{width:0}},[`${o}-header, &${o}-footer`]:{flex:"0 0 auto"},"&-rtl":{direction:"rtl"}},[`${o}-header`]:{height:i,padding:d,color:l,lineHeight:r.unit(i),background:g,[`${t}-menu`]:{lineHeight:"inherit"}},[`${o}-footer`]:{padding:c,color:n,fontSize:u,background:a},[`${o}-content`]:{flex:"auto",color:n,minHeight:0}}},Do=e=>{const{colorBgLayout:t,controlHeight:o,controlHeightLG:n,colorText:a,controlHeightSM:i,marginXXS:d,colorTextLightSolid:l,colorBgContainer:c}=e,u=n*1.25;return{colorBgHeader:"#001529",colorBgBody:t,colorBgTrigger:"#002140",bodyBg:t,headerBg:"#001529",headerHeight:o*2,headerPadding:`0 ${u}px`,headerColor:a,footerPadding:`${i}px ${u}px`,footerBg:t,siderBg:"#001529",triggerHeight:n+d*2,triggerBg:"#002140",triggerColor:l,zeroTriggerWidth:n,zeroTriggerHeight:n,lightSiderBg:c,lightTriggerBg:c,lightTriggerColor:a}},Bo=[["colorBgBody","bodyBg"],["colorBgHeader","headerBg"],["colorBgTrigger","triggerBg"]];r.genStyleHooks("Layout",e=>[fa(e)],Do,{deprecatedTokens:Bo});const pa=e=>{const{componentCls:t,siderBg:o,motionDurationMid:n,motionDurationSlow:a,antCls:i,triggerHeight:d,triggerColor:l,triggerBg:c,headerHeight:u,zeroTriggerWidth:p,zeroTriggerHeight:g,borderRadiusLG:m,lightSiderBg:f,lightTriggerColor:v,lightTriggerBg:C,bodyBg:h}=e;return{[t]:{position:"relative",minWidth:0,background:o,transition:`all ${n}, background 0s`,"&-has-trigger":{paddingBottom:d},"&-right":{order:1},[`${t}-children`]:{height:"100%",marginTop:-.1,paddingTop:.1,[`${i}-menu${i}-menu-inline-collapsed`]:{width:"auto"}},[`&-zero-width ${t}-children`]:{overflow:"hidden"},[`${t}-trigger`]:{position:"fixed",bottom:0,zIndex:1,height:d,color:l,lineHeight:r.unit(d),textAlign:"center",background:c,cursor:"pointer",transition:`all ${n}`},[`${t}-zero-width-trigger`]:{position:"absolute",top:u,insetInlineEnd:e.calc(p).mul(-1).equal(),zIndex:1,width:p,height:g,color:l,fontSize:e.fontSizeXL,display:"flex",alignItems:"center",justifyContent:"center",background:o,borderRadius:`0 ${r.unit(m)} ${r.unit(m)} 0`,cursor:"pointer",transition:`background ${a} ease`,"&::after":{position:"absolute",inset:0,background:"transparent",transition:`all ${a}`,content:'""'},"&:hover::after":{background:"rgba(255, 255, 255, 0.2)"},"&-right":{insetInlineStart:e.calc(p).mul(-1).equal(),borderRadius:`${r.unit(m)} 0 0 ${r.unit(m)}`}},"&-light":{background:f,[`${t}-trigger`]:{color:v,background:C},[`${t}-zero-width-trigger`]:{color:v,background:C,border:`1px solid ${h}`,borderInlineStart:0}}}}},ma=r.genStyleHooks(["Layout","Sider"],e=>[pa(e)],Do,{deprecatedTokens:Bo});var ga=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(o[n[a]]=e[n[a]]);return o};const Qn={xs:"479.98px",sm:"575.98px",md:"767.98px",lg:"991.98px",xl:"1199.98px",xxl:"1599.98px"},va=e=>!Number.isNaN(Number.parseFloat(e))&&isFinite(e),xn=s.createContext({}),ha=(()=>{let e=0;return(t="")=>(e+=1,`${t}${e}`)})(),ba=s.forwardRef((e,t)=>{const{prefixCls:o,className:n,trigger:a,children:i,defaultCollapsed:d=!1,theme:l="dark",style:c={},collapsible:u=!1,reverseArrow:p=!1,width:g=200,collapsedWidth:m=80,zeroWidthTriggerStyle:f,breakpoint:v,onCollapse:C,onBreakpoint:h}=e,b=ga(e,["prefixCls","className","trigger","children","defaultCollapsed","theme","style","collapsible","reverseArrow","width","collapsedWidth","zeroWidthTriggerStyle","breakpoint","onCollapse","onBreakpoint"]),{siderHook:S}=H.useContext(ua),[x,w]=H.useState("collapsed"in e?e.collapsed:d),[$,N]=H.useState(!1);H.useEffect(()=>{"collapsed"in e&&w(e.collapsed)},[e.collapsed]);const k=(X,de)=>{"collapsed"in e||w(X),C==null||C(X,de)},{getPrefixCls:_,direction:y}=H.useContext(r.ConfigContext),T=_("layout-sider",o),[R,O,P]=ma(T),I=H.useRef(null);I.current=X=>{N(X.matches),h==null||h(X.matches),x!==X.matches&&k(X.matches,"responsive")},H.useEffect(()=>{function X(he){var j;return(j=I.current)===null||j===void 0?void 0:j.call(I,he)}let de;return typeof(window==null?void 0:window.matchMedia)<"u"&&v&&v in Qn&&(de=window.matchMedia(`screen and (max-width: ${Qn[v]})`),r.addMediaQueryListener(de,X),X(de)),()=>{r.removeMediaQueryListener(de,X)}},[v]),H.useEffect(()=>{const X=ha("ant-sider-");return S.addSider(X),()=>S.removeSider(X)},[]);const E=()=>{k(!x,"clickTrigger")},D=r.omit(b,["collapsed"]),B=x?m:g,K=va(B)?`${B}px`:String(B),M=parseFloat(String(m||0))===0?s.createElement("span",{onClick:E,className:r.cn(`${T}-zero-width-trigger`,`${T}-zero-width-trigger-${p?"right":"left"}`),style:f},a||s.createElement(To,null)):null,A=y==="rtl"==!p,Y={expanded:A?s.createElement(r.RefIcon$2,null):s.createElement(r.RefIcon$1,null),collapsed:A?s.createElement(r.RefIcon$1,null):s.createElement(r.RefIcon$2,null)}[x?"collapsed":"expanded"],J=a!==null?M||s.createElement("div",{className:`${T}-trigger`,onClick:E,style:{width:K}},a||Y):null,oe=Object.assign(Object.assign({},c),{flex:`0 0 ${K}`,maxWidth:K,minWidth:K,width:K}),re=r.cn(T,`${T}-${l}`,{[`${T}-collapsed`]:!!x,[`${T}-has-trigger`]:u&&a!==null&&!M,[`${T}-below`]:!!$,[`${T}-zero-width`]:parseFloat(K)===0},n,O,P),Z=s.useMemo(()=>({siderCollapsed:x}),[x]);return R(s.createElement(xn.Provider,{value:Z},s.createElement("aside",Object.assign({className:re},D,{style:oe,ref:t}),s.createElement("div",{className:`${T}-children`},i),u||$&&M?J:null)))});process.env.NODE_ENV!=="production"&&(ba.displayName="Sider");const zt=H.createContext({prefixCls:"",firstLevel:!0,inlineCollapsed:!1});var ya=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(o[n[a]]=e[n[a]]);return o};const Ko=e=>{const{prefixCls:t,className:o,dashed:n}=e,a=ya(e,["prefixCls","className","dashed"]),{getPrefixCls:i}=s.useContext(r.ConfigContext),d=i("menu",t),l=r.cn({[`${d}-item-divider-dashed`]:!!n},o);return s.createElement(r.Divider,Object.assign({className:l},a))},Mo=e=>{var t;const{className:o,children:n,icon:a,title:i,danger:d,extra:l}=e,{prefixCls:c,firstLevel:u,direction:p,disableMenuItemTitleTooltip:g,inlineCollapsed:m}=s.useContext(zt),f=x=>{const w=n==null?void 0:n[0],$=s.createElement("span",{className:r.cn(`${c}-title-content`,{[`${c}-title-content-with-extra`]:!!l||l===0})},n);return(!a||s.isValidElement(n)&&n.type==="span")&&n&&x&&u&&typeof w=="string"?s.createElement("div",{className:`${c}-inline-collapsed-noicon`},w.charAt(0)):$},{siderCollapsed:v}=s.useContext(xn);let C=i;typeof i>"u"?C=u?n:"":i===!1&&(C="");const h={title:C};!v&&!m&&(h.title=null,h.open=!1);const b=r.toArray(n).length;let S=s.createElement(r.MenuItem,Object.assign({},r.omit(e,["title","icon","danger"]),{className:r.cn({[`${c}-item-danger`]:d,[`${c}-item-only-child`]:(a?b+1:b)===1},o),title:typeof i=="string"?i:void 0}),r.cloneElement(a,{className:r.cn(s.isValidElement(a)?(t=a.props)===null||t===void 0?void 0:t.className:"",`${c}-item-icon`)}),f(m));return g||(S=s.createElement(r.Tooltip,Object.assign({},h,{placement:p==="rtl"?"left":"right",classNames:{root:`${c}-inline-collapsed-tooltip`}}),S)),S};var Ca=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(o[n[a]]=e[n[a]]);return o};const jt=s.createContext(null),zo=s.forwardRef((e,t)=>{const{children:o}=e,n=Ca(e,["children"]),a=s.useContext(jt),i=s.useMemo(()=>Object.assign(Object.assign({},a),n),[a,n.prefixCls,n.mode,n.selectable,n.rootClassName]),d=r.supportNodeRef(o),l=r.useComposeRef(t,d?r.getNodeRef(o):null);return s.createElement(jt.Provider,{value:i},s.createElement(r.ContextIsolator,{space:!0},d?s.cloneElement(o,{ref:l}):o))}),xa=e=>{const{componentCls:t,motionDurationSlow:o,horizontalLineHeight:n,colorSplit:a,lineWidth:i,lineType:d,itemPaddingInline:l}=e;return{[`${t}-horizontal`]:{lineHeight:n,border:0,borderBottom:`${r.unit(i)} ${d} ${a}`,boxShadow:"none","&::after":{display:"block",clear:"both",height:0,content:'"\\20"'},[`${t}-item, ${t}-submenu`]:{position:"relative",display:"inline-block",verticalAlign:"bottom",paddingInline:l},[`> ${t}-item:hover,
2
2
  > ${t}-item-active,
3
3
  > ${t}-submenu ${t}-submenu-title:hover`]:{backgroundColor:"transparent"},[`${t}-item, ${t}-submenu-title`]:{transition:[`border-color ${o}`,`background ${o}`].join(",")},[`${t}-submenu-arrow`]:{display:"none"}}}},Sa=({componentCls:e,menuArrowOffset:t,calc:o})=>({[`${e}-rtl`]:{direction:"rtl"},[`${e}-submenu-rtl`]:{transformOrigin:"100% 0"},[`${e}-rtl${e}-vertical,
4
4
  ${e}-submenu-rtl ${e}-vertical`]:{[`${e}-submenu-arrow`]:{"&::before":{transform:`rotate(-45deg) translateY(${r.unit(o(t).mul(-1).equal())})`},"&::after":{transform:`rotate(45deg) translateY(${r.unit(t)})`}}}}),Jn=e=>Object.assign({},r.genFocusOutline(e)),eo=(e,t)=>{const{componentCls:o,itemColor:n,itemSelectedColor:a,subMenuItemSelectedColor:i,groupTitleColor:d,itemBg:l,subMenuItemBg:c,itemSelectedBg:u,activeBarHeight:p,activeBarWidth:g,activeBarBorderWidth:m,motionDurationSlow:f,motionEaseInOut:v,motionEaseOut:C,itemPaddingInline:h,motionDurationMid:b,itemHoverColor:S,lineType:x,colorSplit:w,itemDisabledColor:$,dangerItemColor:N,dangerItemHoverColor:k,dangerItemSelectedColor:_,dangerItemActiveBg:y,dangerItemSelectedBg:T,popupBg:R,itemHoverBg:O,itemActiveBg:P,menuSubMenuBg:I,horizontalItemSelectedColor:E,horizontalItemSelectedBg:D,horizontalItemBorderRadius:B,horizontalItemHoverBg:K}=e;return{[`${o}-${t}, ${o}-${t} > ${o}`]:{color:n,background:l,[`&${o}-root:focus-visible`]:Object.assign({},Jn(e)),[`${o}-item`]:{"&-group-title, &-extra":{color:d}},[`${o}-submenu-selected > ${o}-submenu-title`]:{color:i},[`${o}-item, ${o}-submenu-title`]:{color:n,[`&:not(${o}-item-disabled):focus-visible`]:Object.assign({},Jn(e))},[`${o}-item-disabled, ${o}-submenu-disabled`]:{color:`${$} !important`},[`${o}-item:not(${o}-item-selected):not(${o}-submenu-selected)`]:{[`&:hover, > ${o}-submenu-title:hover`]:{color:S}},[`&:not(${o}-horizontal)`]:{[`${o}-item:not(${o}-item-selected)`]:{"&:hover":{backgroundColor:O},"&:active":{backgroundColor:P}},[`${o}-submenu-title`]:{"&:hover":{backgroundColor:O},"&:active":{backgroundColor:P}}},[`${o}-item-danger`]:{color:N,[`&${o}-item:hover`]:{[`&:not(${o}-item-selected):not(${o}-submenu-selected)`]:{color:k}},[`&${o}-item:active`]:{background:y}},[`${o}-item a`]:{"&, &:hover":{color:"inherit"}},[`${o}-item-selected`]:{color:a,[`&${o}-item-danger`]:{color:_},"a, a:hover":{color:"inherit"}},[`& ${o}-item-selected`]:{backgroundColor:u,[`&${o}-item-danger`]:{backgroundColor:T}},[`&${o}-submenu > ${o}`]:{backgroundColor:I},[`&${o}-popup > ${o}`]:{backgroundColor:R},[`&${o}-submenu-popup > ${o}`]:{backgroundColor:R},[`&${o}-horizontal`]:Object.assign(Object.assign({},t==="dark"?{borderBottom:0}:{}),{[`> ${o}-item, > ${o}-submenu`]:{top:m,marginTop:e.calc(m).mul(-1).equal(),marginBottom:0,borderRadius:B,"&::after":{position:"absolute",insetInline:h,bottom:0,borderBottom:`${r.unit(p)} solid transparent`,transition:`border-color ${f} ${v}`,content:'""'},"&:hover, &-active, &-open":{background:K,"&::after":{borderBottomWidth:p,borderBottomColor:E}},"&-selected":{color:E,backgroundColor:D,"&:hover":{backgroundColor:D},"&::after":{borderBottomWidth:p,borderBottomColor:E}}}}),[`&${o}-root`]:{[`&${o}-inline, &${o}-vertical`]:{borderInlineEnd:`${r.unit(m)} ${x} ${w}`}},[`&${o}-inline`]:{[`${o}-sub${o}-inline`]:{background:c},[`${o}-item`]:{position:"relative","&::after":{position:"absolute",insetBlock:0,insetInlineEnd:0,borderInlineEnd:`${r.unit(g)} solid ${a}`,transform:"scaleY(0.0001)",opacity:0,transition:[`transform ${b} ${C}`,`opacity ${b} ${C}`].join(","),content:'""'},[`&${o}-item-danger`]:{"&::after":{borderInlineEndColor:_}}},[`${o}-selected, ${o}-item-selected`]:{"&::after":{transform:"scaleY(1)",opacity:1,transition:[`transform ${b} ${v}`,`opacity ${b} ${v}`].join(",")}}}}}},to=e=>{const{componentCls:t,itemHeight:o,itemMarginInline:n,padding:a,menuArrowSize:i,marginXS:d,itemMarginBlock:l,itemWidth:c,itemPaddingInline:u}=e,p=e.calc(i).add(a).add(d).equal();return{[`${t}-item`]:{position:"relative",overflow:"hidden"},[`${t}-item, ${t}-submenu-title`]:{height:o,lineHeight:r.unit(o),paddingInline:u,overflow:"hidden",textOverflow:"ellipsis",marginInline:n,marginBlock:l,width:c},[`> ${t}-item,
@@ -0,0 +1,79 @@
1
+ import { GetErrorType, IResultFile, IServerFile, IServerFileForm, IServerImage, IServerImageForm, IUploadImage, UploadFile } from '../types';
2
+ /**
3
+ * @description Создает url картинки
4
+ * @param {string} name - название картинки
5
+ * @param {string} extension - расширение картинки
6
+ * @param {string} entityId - id сущности
7
+ * @param {string} prefixe - префикс файла
8
+ * @param {string | undefined} folder - название подпапки
9
+ * @param {string} uploadUrl - url бакета
10
+ * @param bucketFolder - enum с папкой бакета
11
+ * @response Возвращает url
12
+ */
13
+ export declare const getUploadImageUrl: <T>({ name, extension, entityId, prefixe, folder, bucketFolder, uploadUrl, }: {
14
+ name: string;
15
+ extension: string;
16
+ entityId: string;
17
+ prefixe: string;
18
+ folder?: string;
19
+ uploadUrl: string;
20
+ bucketFolder: T;
21
+ }) => string;
22
+ /**
23
+ * @description Создает url файла
24
+ * @param {string} fullName - название файла
25
+ * @param {string} entityId - id сущности
26
+ * @param {string | undefined} folder - название подпапки
27
+ * @param {string} uploadUrl - url бакета
28
+ * @param bucketFolder - enum с папкой бакета
29
+ * @response Возвращает url
30
+ */
31
+ export declare const getUploadFileUrl: <T>({ fullName, entityId, folder, bucketFolder, uploadUrl, }: {
32
+ fullName: string;
33
+ entityId: string;
34
+ folder?: string;
35
+ uploadUrl: string;
36
+ bucketFolder: T;
37
+ }) => string;
38
+ /**
39
+ * @description Проверяет валидность объекта картинки по схеме
40
+ * @param {object} object - объект с информацией о картинке
41
+ * @response Возвращает true/false
42
+ */
43
+ export declare const checkCorrectImageObject: (object: IServerImage, getError: GetErrorType) => boolean;
44
+ /**
45
+ * @description Проверяет валидность объекта файла по схеме
46
+ * @param {object} object - объект с информацией о файле
47
+ * @response Возвращает true/false
48
+ */
49
+ export declare const checkCorrectFileObject: (object: IServerFile, getError: GetErrorType) => boolean;
50
+ /**
51
+ * @description Сортирует массив файлов по порядку из примера
52
+ * @param {array} array - объект с файлоами
53
+ * @param {string[]} reference - массив в порядком uid
54
+ * @response Возвращает отсортированный массив файлов
55
+ */
56
+ export declare const sortFilesArrayByReference: <T extends IResultFile>(array: T[], reference: string[]) => T[];
57
+ /**
58
+ * @description Преобразует файлы с сервера в формат для работы с формой
59
+ * @param {string | undefined | null} files - json stringify строка с информацией
60
+ * @param bucketFolder - название папки в бакете
61
+ * @param uploadUrl - Ссылка на бакет
62
+ * @response Возвращает массив с подготовленными файлами
63
+ */
64
+ export declare const prepareServerFiles: <T>(files: string | undefined | null, bucketFolder: T, uploadUrl: string, getError: GetErrorType) => {
65
+ serverFiles: IServerFileForm[];
66
+ uploadFiles: UploadFile[];
67
+ };
68
+ /**
69
+ * @description Преобразует фотографии с сервера в формат для работы с формой
70
+ * @param {string | undefined | null} images - json stringify строка с информацией
71
+ * @param bucketFolder - название папки в бакете
72
+ * @param uploadUrl - Ссылка на бакет
73
+ * @response Возвращает массив с подготовленными картинками
74
+ */
75
+ export declare const prepareServerImages: <T>(images: string | undefined | null, bucketFolder: T, uploadUrl: string, getError: GetErrorType) => {
76
+ serverImages: IServerImageForm[];
77
+ uploadImages: IUploadImage[];
78
+ };
79
+ export declare const getImagePrefix: (prefixes: string[], type: "original" | "0.25hd" | "0.5hd" | "1hd" | "2hd" | "4hd") => string;
@@ -1,4 +1,4 @@
1
- import { FileType, IAllImages, IFormImage, IServerImageForm, ITempImages, IUploadImage, IUploadStore, Languages, LanguagesTypes } from '../types';
1
+ import { FileType, IAllFiles, IAllImages, IFormFile, IServerFileForm, IServerImageForm, ITempFiles, ITempImages, IUploadImage, IUploadImagesStore, Languages, LanguagesTypes } from '../types';
2
2
  import { TranslateTextType } from './types';
3
3
  import { ITranslateContentNode } from '../ui/text-editor';
4
4
  /**
@@ -27,13 +27,13 @@ export declare const formatPhoneToNumber: (phone: string) => string;
27
27
  */
28
28
  export declare const fileToBase64: (file: FileType) => Promise<string>;
29
29
  /**
30
- * @description Создать upload store для zustand
31
- * @return {IUploadStore} Возвращает структуру store
30
+ * @description Создать upload image store для zustand
31
+ * @return {IUploadImagesStore} Возвращает структуру store
32
32
  */
33
- export declare const createUploadStore: (set: {
34
- (partial: IUploadStore | Partial<IUploadStore> | ((state: IUploadStore) => IUploadStore | Partial<IUploadStore>), replace?: false): void;
35
- (state: IUploadStore | ((state: IUploadStore) => IUploadStore), replace: true): void;
36
- }) => IUploadStore;
33
+ export declare const createUploadImagesStore: (set: {
34
+ (partial: IUploadImagesStore | Partial<IUploadImagesStore> | ((state: IUploadImagesStore) => IUploadImagesStore | Partial<IUploadImagesStore>), replace?: false): void;
35
+ (state: IUploadImagesStore | ((state: IUploadImagesStore) => IUploadImagesStore), replace: true): void;
36
+ }) => IUploadImagesStore;
37
37
  /**
38
38
  * @description Переводит массив с данными в объект для select
39
39
  * @param {object[]} array - Исходный массив
@@ -44,8 +44,16 @@ export declare const objectArrayToOptions: (array: object[], label: string, valu
44
44
  label: string;
45
45
  value: string;
46
46
  }[];
47
+ /**
48
+ * @description Подготавливает фотографии к отправке
49
+ * @param newImages- Новые фотографии
50
+ * @param serverImages- Фотографии с сервера
51
+ * @param imagesOrder - Порядок фотографий
52
+ * @param imagesData - Фотографии из стейта
53
+ * @param limit - Лимит фотографий
54
+ */
47
55
  export declare const prepareImagesToSubmit: ({ newImages, serverImages, imagesOrder, imagesData, limit, }: {
48
- newImages: IFormImage[];
56
+ newImages: IFormFile[];
49
57
  serverImages: IServerImageForm[];
50
58
  imagesOrder: string[];
51
59
  imagesData: IUploadImage[];
@@ -54,6 +62,22 @@ export declare const prepareImagesToSubmit: ({ newImages, serverImages, imagesOr
54
62
  tempImages: ITempImages[];
55
63
  allImages: IAllImages[];
56
64
  };
65
+ /**
66
+ * @description Подготавливает файлы к отправке
67
+ * @param newFiles- Новые файлы
68
+ * @param serverFiles- Файлы с сервера
69
+ * @param filesOrder - Порядок файлов
70
+ * @param limit - Лимит фотографий
71
+ */
72
+ export declare const prepareFilesToSubmit: ({ newFiles, serverFiles, filesOrder, limit, }: {
73
+ newFiles: IFormFile[];
74
+ serverFiles: IServerFileForm[];
75
+ filesOrder: string[];
76
+ limit?: number;
77
+ }) => {
78
+ tempFiles: ITempFiles[];
79
+ allFiles: IAllFiles[];
80
+ };
57
81
  /**
58
82
  * @description Проверка валидности url
59
83
  * @param {string} string - строка
@@ -1,7 +1,7 @@
1
1
  export * from './provider-composer';
2
2
  export * from './hooks';
3
3
  export * from './form';
4
- export * from './images';
4
+ export * from './files';
5
5
  export * from './storage';
6
6
  export * from './utils';
7
7
  export * from './types';
@@ -142,6 +142,56 @@ export declare const uploadTempSchema: z.ZodObject<{
142
142
  }, {
143
143
  tempFiles: string[];
144
144
  }>;
145
+ export declare const serverImageSchema: z.ZodObject<{
146
+ altRU: z.ZodNullable<z.ZodOptional<z.ZodString>>;
147
+ altEN: z.ZodNullable<z.ZodOptional<z.ZodString>>;
148
+ altAR: z.ZodNullable<z.ZodOptional<z.ZodString>>;
149
+ name: z.ZodString;
150
+ originalFileExtension: z.ZodString;
151
+ fileExtensions: z.ZodArray<z.ZodString, "many">;
152
+ prefixes: z.ZodArray<z.ZodString, "many">;
153
+ folder: z.ZodOptional<z.ZodString>;
154
+ }, "strip", z.ZodTypeAny, {
155
+ name: string;
156
+ originalFileExtension: string;
157
+ fileExtensions: string[];
158
+ prefixes: string[];
159
+ altRU?: string | null | undefined;
160
+ altEN?: string | null | undefined;
161
+ altAR?: string | null | undefined;
162
+ folder?: string | undefined;
163
+ }, {
164
+ name: string;
165
+ originalFileExtension: string;
166
+ fileExtensions: string[];
167
+ prefixes: string[];
168
+ altRU?: string | null | undefined;
169
+ altEN?: string | null | undefined;
170
+ altAR?: string | null | undefined;
171
+ folder?: string | undefined;
172
+ }>;
173
+ export declare const serverFileSchema: z.ZodObject<{
174
+ name: z.ZodString;
175
+ fullName: z.ZodString;
176
+ extension: z.ZodString;
177
+ entityId: z.ZodString;
178
+ fullPathExample: z.ZodString;
179
+ folder: z.ZodOptional<z.ZodString>;
180
+ }, "strip", z.ZodTypeAny, {
181
+ name: string;
182
+ fullName: string;
183
+ extension: string;
184
+ entityId: string;
185
+ fullPathExample: string;
186
+ folder?: string | undefined;
187
+ }, {
188
+ name: string;
189
+ fullName: string;
190
+ extension: string;
191
+ entityId: string;
192
+ fullPathExample: string;
193
+ folder?: string | undefined;
194
+ }>;
145
195
  export declare const uploadImageSchema: z.ZodObject<{
146
196
  files: z.ZodArray<z.ZodObject<{
147
197
  imageName: z.ZodString;
@@ -152,39 +202,81 @@ export declare const uploadImageSchema: z.ZodObject<{
152
202
  fileExtensions: z.ZodArray<z.ZodString, "many">;
153
203
  prefixes: z.ZodArray<z.ZodString, "many">;
154
204
  }, "strip", z.ZodTypeAny, {
155
- entityId: string;
156
205
  originalFileExtension: string;
157
206
  fileExtensions: string[];
158
207
  prefixes: string[];
159
- imageName: string;
208
+ entityId: string;
160
209
  fullPathExample: string;
210
+ imageName: string;
161
211
  folder?: string | undefined;
162
212
  }, {
163
- entityId: string;
164
213
  originalFileExtension: string;
165
214
  fileExtensions: string[];
166
215
  prefixes: string[];
167
- imageName: string;
216
+ entityId: string;
168
217
  fullPathExample: string;
218
+ imageName: string;
169
219
  folder?: string | undefined;
170
220
  }>, "many">;
171
221
  }, "strip", z.ZodTypeAny, {
172
222
  files: {
173
- entityId: string;
174
223
  originalFileExtension: string;
175
224
  fileExtensions: string[];
176
225
  prefixes: string[];
177
- imageName: string;
226
+ entityId: string;
178
227
  fullPathExample: string;
228
+ imageName: string;
179
229
  folder?: string | undefined;
180
230
  }[];
181
231
  }, {
182
232
  files: {
183
- entityId: string;
184
233
  originalFileExtension: string;
185
234
  fileExtensions: string[];
186
235
  prefixes: string[];
236
+ entityId: string;
237
+ fullPathExample: string;
187
238
  imageName: string;
239
+ folder?: string | undefined;
240
+ }[];
241
+ }>;
242
+ export declare const uploadFilesSchema: z.ZodObject<{
243
+ files: z.ZodArray<z.ZodObject<{
244
+ name: z.ZodString;
245
+ fullName: z.ZodString;
246
+ extension: z.ZodString;
247
+ entityId: z.ZodString;
248
+ fullPathExample: z.ZodString;
249
+ folder: z.ZodOptional<z.ZodString>;
250
+ }, "strip", z.ZodTypeAny, {
251
+ name: string;
252
+ fullName: string;
253
+ extension: string;
254
+ entityId: string;
255
+ fullPathExample: string;
256
+ folder?: string | undefined;
257
+ }, {
258
+ name: string;
259
+ fullName: string;
260
+ extension: string;
261
+ entityId: string;
262
+ fullPathExample: string;
263
+ folder?: string | undefined;
264
+ }>, "many">;
265
+ }, "strip", z.ZodTypeAny, {
266
+ files: {
267
+ name: string;
268
+ fullName: string;
269
+ extension: string;
270
+ entityId: string;
271
+ fullPathExample: string;
272
+ folder?: string | undefined;
273
+ }[];
274
+ }, {
275
+ files: {
276
+ name: string;
277
+ fullName: string;
278
+ extension: string;
279
+ entityId: string;
188
280
  fullPathExample: string;
189
281
  folder?: string | undefined;
190
282
  }[];
@@ -44,53 +44,74 @@ export interface IServerImage {
44
44
  fullPathExample: string;
45
45
  prefixes: string[];
46
46
  fileExtensions: string[];
47
+ folder?: string;
47
48
  }
48
- export interface IFormImage {
49
+ export interface IServerFile {
50
+ name: string;
51
+ fullName: string;
52
+ extension: string;
53
+ entityId: string;
54
+ fullPathExample: string;
55
+ folder?: string;
56
+ }
57
+ export interface IFormFile {
49
58
  tempName: string;
50
59
  uid: string;
51
60
  }
52
- export interface ITempImages {
61
+ export interface ITempFiles {
53
62
  tempName: string;
63
+ }
64
+ export interface ITempImages extends ITempFiles {
54
65
  altRU?: string;
55
66
  altEN?: string;
56
67
  altAR?: string;
57
68
  }
58
- export interface IAllImages {
69
+ export interface IAllFiles {
59
70
  name: string | null;
60
71
  tempName: string | null;
72
+ }
73
+ export interface IAllImages extends IAllFiles {
61
74
  altRU?: string | null;
62
75
  altEN?: string | null;
63
76
  altAR?: string | null;
64
77
  }
65
- export interface IServerImageForm {
78
+ export interface IServerFileForm {
66
79
  uid?: string;
67
80
  url?: string;
81
+ }
82
+ export interface IServerImageForm extends IServerFileForm {
68
83
  altRU?: string | null;
69
84
  altEN?: string | null;
70
85
  altAR?: string | null;
71
86
  }
72
- export interface IResultImage {
87
+ export interface IResultFile {
73
88
  tempName?: string;
74
89
  uid?: string;
75
90
  url?: string;
91
+ }
92
+ export interface IResultImage extends IResultFile {
76
93
  altRU?: string | null;
77
94
  altEN?: string | null;
78
95
  altAR?: string | null;
79
96
  }
80
- export interface IAllImages {
97
+ export interface IAllFiles {
81
98
  name: string | null;
82
99
  tempName: string | null;
100
+ }
101
+ export interface IAllImages extends IAllFiles {
83
102
  altRU?: string | null;
84
103
  altEN?: string | null;
85
104
  altAR?: string | null;
86
105
  }
87
- export interface IUploadImage {
106
+ export interface UploadFile {
88
107
  uid: string;
89
108
  name: string;
109
+ isError?: boolean;
110
+ }
111
+ export interface IUploadImage extends UploadFile {
90
112
  altRU?: string;
91
113
  altEN?: string;
92
114
  altAR?: string;
93
- isError?: boolean;
94
115
  }
95
116
  export declare enum Languages {
96
117
  'russian' = "ru",
@@ -123,7 +144,7 @@ export interface AdminDrawerFormProps<T> {
123
144
  onClose?: () => void;
124
145
  onRefetch?: () => void;
125
146
  }
126
- export interface IUploadStore {
147
+ export interface IUploadImagesStore {
127
148
  images: IUploadImage[];
128
149
  updatedImages: IUploadImage[];
129
150
  onUpdateData: (data: IUploadImage) => void;
@@ -138,6 +159,7 @@ export interface IImageFile {
138
159
  fullPathExample: string;
139
160
  prefixes: string[];
140
161
  fileExtensions: string[];
162
+ folder?: string;
141
163
  }
142
164
  export type GetErrorType = ({ error, message }: {
143
165
  error?: unknown;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index-DKVThYKU.cjs"),K=require("react");function me(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const i in e)if(i!=="default"){const a=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,a.get?a:{enumerable:!0,get:()=>e[i]})}}return t.default=e,Object.freeze(t)}const o=me(K);var J=function(t,i){if(!t)return null;var a={left:t.offsetLeft,right:t.parentElement.clientWidth-t.clientWidth-t.offsetLeft,width:t.clientWidth,top:t.offsetTop,bottom:t.parentElement.clientHeight-t.clientHeight-t.offsetTop,height:t.clientHeight};return i?{left:0,right:0,width:0,top:a.top,bottom:a.bottom,height:a.height}:{left:a.left,right:a.right,width:a.width,top:0,bottom:0,height:0}},T=function(t){return t!==void 0?"".concat(t,"px"):void 0};function fe(e){var t=e.prefixCls,i=e.containerRef,a=e.value,r=e.getValueIndex,s=e.motionName,p=e.onMotionStart,h=e.onMotionEnd,b=e.direction,S=e.vertical,d=S===void 0?!1:S,$=o.useRef(null),w=o.useState(a),R=n._slicedToArray(w,2),v=R[0],M=R[1],C=function(P){var m,B=r(P),_=(m=i.current)===null||m===void 0?void 0:m.querySelectorAll(".".concat(t,"-item"))[B];return(_==null?void 0:_.offsetParent)&&_},E=o.useState(null),f=n._slicedToArray(E,2),l=f[0],N=f[1],V=o.useState(null),x=n._slicedToArray(V,2),c=x[0],I=x[1];n.useLayoutEffect(function(){if(v!==a){var u=C(v),P=C(a),m=J(u,d),B=J(P,d);M(a),N(m),I(B),u&&P?p():h()}},[a]);var y=o.useMemo(function(){if(d){var u;return T((u=l==null?void 0:l.top)!==null&&u!==void 0?u:0)}return T(b==="rtl"?-(l==null?void 0:l.right):l==null?void 0:l.left)},[d,b,l]),O=o.useMemo(function(){if(d){var u;return T((u=c==null?void 0:c.top)!==null&&u!==void 0?u:0)}return T(b==="rtl"?-(c==null?void 0:c.right):c==null?void 0:c.left)},[d,b,c]),D=function(){return d?{transform:"translateY(var(--thumb-start-top))",height:"var(--thumb-start-height)"}:{transform:"translateX(var(--thumb-start-left))",width:"var(--thumb-start-width)"}},H=function(){return d?{transform:"translateY(var(--thumb-active-top))",height:"var(--thumb-active-height)"}:{transform:"translateX(var(--thumb-active-left))",width:"var(--thumb-active-width)"}},A=function(){N(null),I(null),h()};return!l||!c?null:o.createElement(n.CSSMotion,{visible:!0,motionName:s,motionAppear:!0,onAppearStart:D,onAppearActive:H,onVisibleChanged:A},function(u,P){var m=u.className,B=u.style,_=n._objectSpread2(n._objectSpread2({},B),{},{"--thumb-start-left":y,"--thumb-start-width":T(l==null?void 0:l.width),"--thumb-active-left":O,"--thumb-active-width":T(c==null?void 0:c.width),"--thumb-start-top":y,"--thumb-start-height":T(l==null?void 0:l.height),"--thumb-active-top":O,"--thumb-active-height":T(c==null?void 0:c.height)}),F={ref:n.composeRef($,P),style:_,className:n.cn("".concat(t,"-thumb"),m)};return process.env.NODE_ENV==="test"&&(F["data-test-style"]=JSON.stringify(_)),o.createElement("div",F)})}var ve=["prefixCls","direction","vertical","options","disabled","defaultValue","value","name","onChange","className","motionName"];function ge(e){if(typeof e.title<"u")return e.title;if(n._typeof(e.label)!=="object"){var t;return(t=e.label)===null||t===void 0?void 0:t.toString()}}function he(e){return e.map(function(t){if(n._typeof(t)==="object"&&t!==null){var i=ge(t);return n._objectSpread2(n._objectSpread2({},t),{},{title:i})}return{label:t==null?void 0:t.toString(),title:t==null?void 0:t.toString(),value:t}})}var be=function(t){var i=t.prefixCls,a=t.className,r=t.disabled,s=t.checked,p=t.label,h=t.title,b=t.value,S=t.name,d=t.onChange,$=t.onFocus,w=t.onBlur,R=t.onKeyDown,v=t.onKeyUp,M=t.onMouseDown,C=function(f){r||d(f,b)};return o.createElement("label",{className:n.cn(a,n._defineProperty({},"".concat(i,"-item-disabled"),r)),onMouseDown:M},o.createElement("input",{name:S,className:"".concat(i,"-item-input"),type:"radio",disabled:r,checked:s,onChange:C,onFocus:$,onBlur:w,onKeyDown:R,onKeyUp:v}),o.createElement("div",{className:"".concat(i,"-item-label"),title:h,"aria-selected":s},p))},ee=o.forwardRef(function(e,t){var i,a,r=e.prefixCls,s=r===void 0?"rc-segmented":r,p=e.direction,h=e.vertical,b=e.options,S=b===void 0?[]:b,d=e.disabled,$=e.defaultValue,w=e.value,R=e.name,v=e.onChange,M=e.className,C=M===void 0?"":M,E=e.motionName,f=E===void 0?"thumb-motion":E,l=n._objectWithoutProperties(e,ve),N=o.useRef(null),V=o.useMemo(function(){return n.composeRef(N,t)},[N,t]),x=o.useMemo(function(){return he(S)},[S]),c=n.useMergedState((i=x[0])===null||i===void 0?void 0:i.value,{value:w,defaultValue:$}),I=n._slicedToArray(c,2),y=I[0],O=I[1],D=o.useState(!1),H=n._slicedToArray(D,2),A=H[0],u=H[1],P=function(j,z){O(z),v==null||v(z)},m=n.omit(l,["children"]),B=o.useState(!1),_=n._slicedToArray(B,2),F=_[0],X=_[1],ae=o.useState(!1),q=n._slicedToArray(ae,2),ie=q[0],U=q[1],oe=function(){U(!0)},re=function(){U(!1)},le=function(){X(!1)},se=function(j){j.key==="Tab"&&X(!0)},G=function(j){var z=x.findIndex(function(de){return de.value===y}),Y=x.length,ue=(z+j+Y)%Y,L=x[ue];L&&(O(L.value),v==null||v(L.value))},ce=function(j){switch(j.key){case"ArrowLeft":case"ArrowUp":G(-1);break;case"ArrowRight":case"ArrowDown":G(1);break}};return o.createElement("div",n._extends({role:"radiogroup","aria-label":"segmented control",tabIndex:d?void 0:0},m,{className:n.cn(s,(a={},n._defineProperty(a,"".concat(s,"-rtl"),p==="rtl"),n._defineProperty(a,"".concat(s,"-disabled"),d),n._defineProperty(a,"".concat(s,"-vertical"),h),a),C),ref:V}),o.createElement("div",{className:"".concat(s,"-group")},o.createElement(fe,{vertical:h,prefixCls:s,value:y,containerRef:N,motionName:"".concat(s,"-").concat(f),direction:p,getValueIndex:function(j){return x.findIndex(function(z){return z.value===j})},onMotionStart:function(){u(!0)},onMotionEnd:function(){u(!1)}}),x.map(function(g){var j;return o.createElement(be,n._extends({},g,{name:R,key:g.value,prefixCls:s,className:n.cn(g.className,"".concat(s,"-item"),(j={},n._defineProperty(j,"".concat(s,"-item-selected"),g.value===y&&!A),n._defineProperty(j,"".concat(s,"-item-focused"),ie&&F&&g.value===y),j)),checked:g.value===y,onChange:P,onFocus:oe,onBlur:re,onKeyDown:ce,onKeyUp:se,onMouseDown:le,disabled:!!d||!!g.disabled}))})))});process.env.NODE_ENV!=="production"&&(ee.displayName="Segmented");var pe=ee;function Z(e,t){return{[`${e}, ${e}:hover, ${e}:focus`]:{color:t.colorTextDisabled,cursor:"not-allowed"}}}function Q(e){return{backgroundColor:e.itemSelectedBg,boxShadow:e.boxShadowTertiary}}const xe=Object.assign({overflow:"hidden"},n.textEllipsis),Se=e=>{const{componentCls:t}=e,i=e.calc(e.controlHeight).sub(e.calc(e.trackPadding).mul(2)).equal(),a=e.calc(e.controlHeightLG).sub(e.calc(e.trackPadding).mul(2)).equal(),r=e.calc(e.controlHeightSM).sub(e.calc(e.trackPadding).mul(2)).equal();return{[t]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},n.resetComponent(e)),{display:"inline-block",padding:e.trackPadding,color:e.itemColor,background:e.trackBg,borderRadius:e.borderRadius,transition:`all ${e.motionDurationMid} ${e.motionEaseInOut}`}),n.genFocusStyle(e)),{[`${t}-group`]:{position:"relative",display:"flex",alignItems:"stretch",justifyItems:"flex-start",flexDirection:"row",width:"100%"},[`&${t}-rtl`]:{direction:"rtl"},[`&${t}-vertical`]:{[`${t}-group`]:{flexDirection:"column"},[`${t}-thumb`]:{width:"100%",height:0,padding:`0 ${n.unit(e.paddingXXS)}`}},[`&${t}-block`]:{display:"flex"},[`&${t}-block ${t}-item`]:{flex:1,minWidth:0},[`${t}-item`]:{position:"relative",textAlign:"center",cursor:"pointer",transition:`color ${e.motionDurationMid} ${e.motionEaseInOut}`,borderRadius:e.borderRadiusSM,transform:"translateZ(0)","&-selected":Object.assign(Object.assign({},Q(e)),{color:e.itemSelectedColor}),"&-focused":Object.assign({},n.genFocusOutline(e)),"&::after":{content:'""',position:"absolute",zIndex:-1,width:"100%",height:"100%",top:0,insetInlineStart:0,borderRadius:"inherit",opacity:0,transition:`opacity ${e.motionDurationMid}`,pointerEvents:"none"},[`&:hover:not(${t}-item-selected):not(${t}-item-disabled)`]:{color:e.itemHoverColor,"&::after":{opacity:1,backgroundColor:e.itemHoverBg}},[`&:active:not(${t}-item-selected):not(${t}-item-disabled)`]:{color:e.itemHoverColor,"&::after":{opacity:1,backgroundColor:e.itemActiveBg}},"&-label":Object.assign({minHeight:i,lineHeight:n.unit(i),padding:`0 ${n.unit(e.segmentedPaddingHorizontal)}`},xe),"&-icon + *":{marginInlineStart:e.calc(e.marginSM).div(2).equal()},"&-input":{position:"absolute",insetBlockStart:0,insetInlineStart:0,width:0,height:0,opacity:0,pointerEvents:"none"}},[`${t}-thumb`]:Object.assign(Object.assign({},Q(e)),{position:"absolute",insetBlockStart:0,insetInlineStart:0,width:0,height:"100%",padding:`${n.unit(e.paddingXXS)} 0`,borderRadius:e.borderRadiusSM,transition:`transform ${e.motionDurationSlow} ${e.motionEaseInOut}, height ${e.motionDurationSlow} ${e.motionEaseInOut}`,[`& ~ ${t}-item:not(${t}-item-selected):not(${t}-item-disabled)::after`]:{backgroundColor:"transparent"}}),[`&${t}-lg`]:{borderRadius:e.borderRadiusLG,[`${t}-item-label`]:{minHeight:a,lineHeight:n.unit(a),padding:`0 ${n.unit(e.segmentedPaddingHorizontal)}`,fontSize:e.fontSizeLG},[`${t}-item, ${t}-thumb`]:{borderRadius:e.borderRadius}},[`&${t}-sm`]:{borderRadius:e.borderRadiusSM,[`${t}-item-label`]:{minHeight:r,lineHeight:n.unit(r),padding:`0 ${n.unit(e.segmentedPaddingHorizontalSM)}`},[`${t}-item, ${t}-thumb`]:{borderRadius:e.borderRadiusXS}}}),Z(`&-disabled ${t}-item`,e)),Z(`${t}-item-disabled`,e)),{[`${t}-thumb-motion-appear-active`]:{transition:`transform ${e.motionDurationSlow} ${e.motionEaseInOut}, width ${e.motionDurationSlow} ${e.motionEaseInOut}`,willChange:"transform, width"},[`&${t}-shape-round`]:{borderRadius:9999,[`${t}-item, ${t}-thumb`]:{borderRadius:9999}}})}},ye=e=>{const{colorTextLabel:t,colorText:i,colorFillSecondary:a,colorBgElevated:r,colorFill:s,lineWidthBold:p,colorBgLayout:h}=e;return{trackPadding:p,trackBg:h,itemColor:t,itemHoverColor:i,itemHoverBg:a,itemSelectedBg:r,itemActiveBg:s,itemSelectedColor:i}},je=n.genStyleHooks("Segmented",e=>{const{lineWidth:t,calc:i}=e,a=n.merge(e,{segmentedPaddingHorizontal:i(e.controlPaddingHorizontal).sub(t).equal(),segmentedPaddingHorizontalSM:i(e.controlPaddingHorizontalSM).sub(t).equal()});return[Se(a)]},ye);var k=function(e,t){var i={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(i[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,a=Object.getOwnPropertySymbols(e);r<a.length;r++)t.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(e,a[r])&&(i[a[r]]=e[a[r]]);return i};function $e(e){return typeof e=="object"&&!!(e!=null&&e.icon)}const we=o.forwardRef((e,t)=>{const i=n.useId(),{prefixCls:a,className:r,rootClassName:s,block:p,options:h=[],size:b="middle",style:S,vertical:d,shape:$="default",name:w=i}=e,R=k(e,["prefixCls","className","rootClassName","block","options","size","style","vertical","shape","name"]),{getPrefixCls:v,direction:M,className:C,style:E}=n.useComponentConfig("segmented"),f=v("segmented",a),[l,N,V]=je(f),x=n.useSize(b),c=o.useMemo(()=>h.map(O=>{if($e(O)){const{icon:D,label:H}=O,A=k(O,["icon","label"]);return Object.assign(Object.assign({},A),{label:o.createElement(o.Fragment,null,o.createElement("span",{className:`${f}-item-icon`},D),H&&o.createElement("span",null,H))})}return O}),[h,f]),I=n.cn(r,s,C,{[`${f}-block`]:p,[`${f}-sm`]:x==="small",[`${f}-lg`]:x==="large",[`${f}-vertical`]:d,[`${f}-shape-${$}`]:$==="round"},N,V),y=Object.assign(Object.assign({},E),S);return l(o.createElement(pe,Object.assign({},R,{name:w,className:I,style:y,options:c,ref:t,prefixCls:f,direction:M,vertical:d})))}),te=we;process.env.NODE_ENV!=="production"&&(te.displayName="Segmented");var Re={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M758.2 839.1C851.8 765.9 912 651.9 912 523.9 912 303 733.5 124.3 512.6 124 291.4 123.7 112 302.8 112 523.9c0 125.2 57.5 236.9 147.6 310.2 3.5 2.8 8.6 2.2 11.4-1.3l39.4-50.5c2.7-3.4 2.1-8.3-1.2-11.1-8.1-6.6-15.9-13.7-23.4-21.2a318.64 318.64 0 01-68.6-101.7C200.4 609 192 567.1 192 523.9s8.4-85.1 25.1-124.5c16.1-38.1 39.2-72.3 68.6-101.7 29.4-29.4 63.6-52.5 101.7-68.6C426.9 212.4 468.8 204 512 204s85.1 8.4 124.5 25.1c38.1 16.1 72.3 39.2 101.7 68.6 29.4 29.4 52.5 63.6 68.6 101.7 16.7 39.4 25.1 81.3 25.1 124.5s-8.4 85.1-25.1 124.5a318.64 318.64 0 01-68.6 101.7c-9.3 9.3-19.1 18-29.3 26L668.2 724a8 8 0 00-14.1 3l-39.6 162.2c-1.2 5 2.6 9.9 7.7 9.9l167 .8c6.7 0 10.5-7.7 6.3-12.9l-37.3-47.9z"}}]},name:"redo",theme:"outlined"};function W(){return W=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(e[a]=i[a])}return e},W.apply(this,arguments)}const Ce=(e,t)=>o.createElement(n.Icon,W({},e,{ref:t,icon:Re})),ne=o.forwardRef(Ce);process.env.NODE_ENV!=="production"&&(ne.displayName="RedoOutlined");const Oe=({datePickerComponent:e,searchText:t,noDateText:i,emptyText:a,searchSelect:r,radioOptions:s,searchOptions:p,searchType:h,textSearchValue:b="",dateSearchValue:S,numberSearchValue:d,multiselectSearchValue:$,multiselectOptions:w,onChangeSearch:R,onChangeTextSearch:v,onChangeRadioSearch:M,onChangeDateSearch:C,onChangeNumberSearch:E,onChangeMultiselectSearch:f})=>{const[l,N]=K.useState(b),{token:{borderRadius:V,colorBgBase:x,paddingXXS:c}}=n.theme.useToken(),{isMobileMaxWidth:I}=n.useMobileViewPort(),{isSmallMaxWidth:y}=n.useSmallViewPort(),O=K.useMemo(()=>y?2:I?5:15,[I,y]);n.useDebounce(()=>{v==null||v(l)},n.TIME.milliseconds.milliseconds500,[l]);const D=()=>{N("")},H=m=>{R(m),D()},A=m=>{N(m.target.value.replace(/"/g,""))},u=m=>{C==null||C(m)},P=m=>{!m&&m!==0||E==null||E(+m)};return n.jsxRuntimeExports.jsxs(n.Flex,{className:n.styles.flex,gap:"small",style:{padding:c,borderRadius:V,background:x},children:[n.jsxRuntimeExports.jsx(n.Select,{defaultValue:r,value:r,style:{width:120,minWidth:120},options:p,onChange:H}),{text:n.jsxRuntimeExports.jsx(n.Input,{placeholder:t,value:l,allowClear:!0,onChange:A}),radio:n.jsxRuntimeExports.jsx(te,{options:s,defaultValue:n.searchRadioDefaultValue,onChange:M}),date:K.createElement(e,{noDateText:i,currentValue:S??"",onChangeDate:u}),number:n.jsxRuntimeExports.jsx(n.BaseInputNumber,{emptyText:a,value:d,placeholder:t,min:0,max:2147483647,onChange:P}),multiselect:n.jsxRuntimeExports.jsx(n.Select,{className:n.styles.select,mode:"multiple",placeholder:t,maxTagCount:1,maxTagTextLength:O,showSearch:!1,allowClear:!0,options:w,value:$,onChange:f})}[h]]})},Ee=({sortTooltipText:e,updateDataText:t,refreshText:i,createText:a,createNewElementText:r,order:s,orderOptions:p,createButtonTooltip:h,searchProps:b,isCanCreate:S,isHiddenCreate:d,onCreate:$,onRefetch:w,onChangeOrder:R})=>n.jsxRuntimeExports.jsxs(n.Flex,{gap:"middle",justify:"space-between",wrap:"wrap",style:{marginBottom:n.THEME.OFFSET[1]},children:[n.jsxRuntimeExports.jsxs(n.Flex,{align:"center",gap:"middle",wrap:"wrap",children:[n.jsxRuntimeExports.jsx(Oe,{...b}),n.jsxRuntimeExports.jsx(n.Tooltip,{title:e,children:n.jsxRuntimeExports.jsx(n.Select,{className:n.styles.sort,value:s,options:p,onChange:R})})]}),n.jsxRuntimeExports.jsxs(n.Flex,{className:n.styles.buttonsContainer,gap:"small",align:"center",children:[w&&n.jsxRuntimeExports.jsx(n.Tooltip,{title:t,children:n.jsxRuntimeExports.jsx(n.Button,{className:n.styles.button,icon:n.jsxRuntimeExports.jsx(ne,{}),onClick:w,children:i})}),!d&&S&&n.jsxRuntimeExports.jsx(n.Tooltip,{title:h??r,children:n.jsxRuntimeExports.jsx(n.Button,{className:n.styles.button,type:"primary",icon:n.jsxRuntimeExports.jsx(n.RefIcon,{}),onClick:$,children:a})})]})]});exports.TableHead=Ee;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index-ByDIgGvV.cjs"),K=require("react");function me(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const i in e)if(i!=="default"){const a=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,a.get?a:{enumerable:!0,get:()=>e[i]})}}return t.default=e,Object.freeze(t)}const o=me(K);var J=function(t,i){if(!t)return null;var a={left:t.offsetLeft,right:t.parentElement.clientWidth-t.clientWidth-t.offsetLeft,width:t.clientWidth,top:t.offsetTop,bottom:t.parentElement.clientHeight-t.clientHeight-t.offsetTop,height:t.clientHeight};return i?{left:0,right:0,width:0,top:a.top,bottom:a.bottom,height:a.height}:{left:a.left,right:a.right,width:a.width,top:0,bottom:0,height:0}},T=function(t){return t!==void 0?"".concat(t,"px"):void 0};function fe(e){var t=e.prefixCls,i=e.containerRef,a=e.value,r=e.getValueIndex,s=e.motionName,p=e.onMotionStart,h=e.onMotionEnd,b=e.direction,S=e.vertical,d=S===void 0?!1:S,$=o.useRef(null),w=o.useState(a),R=n._slicedToArray(w,2),v=R[0],M=R[1],C=function(P){var m,B=r(P),_=(m=i.current)===null||m===void 0?void 0:m.querySelectorAll(".".concat(t,"-item"))[B];return(_==null?void 0:_.offsetParent)&&_},E=o.useState(null),f=n._slicedToArray(E,2),l=f[0],N=f[1],V=o.useState(null),x=n._slicedToArray(V,2),c=x[0],I=x[1];n.useLayoutEffect(function(){if(v!==a){var u=C(v),P=C(a),m=J(u,d),B=J(P,d);M(a),N(m),I(B),u&&P?p():h()}},[a]);var y=o.useMemo(function(){if(d){var u;return T((u=l==null?void 0:l.top)!==null&&u!==void 0?u:0)}return T(b==="rtl"?-(l==null?void 0:l.right):l==null?void 0:l.left)},[d,b,l]),O=o.useMemo(function(){if(d){var u;return T((u=c==null?void 0:c.top)!==null&&u!==void 0?u:0)}return T(b==="rtl"?-(c==null?void 0:c.right):c==null?void 0:c.left)},[d,b,c]),D=function(){return d?{transform:"translateY(var(--thumb-start-top))",height:"var(--thumb-start-height)"}:{transform:"translateX(var(--thumb-start-left))",width:"var(--thumb-start-width)"}},H=function(){return d?{transform:"translateY(var(--thumb-active-top))",height:"var(--thumb-active-height)"}:{transform:"translateX(var(--thumb-active-left))",width:"var(--thumb-active-width)"}},A=function(){N(null),I(null),h()};return!l||!c?null:o.createElement(n.CSSMotion,{visible:!0,motionName:s,motionAppear:!0,onAppearStart:D,onAppearActive:H,onVisibleChanged:A},function(u,P){var m=u.className,B=u.style,_=n._objectSpread2(n._objectSpread2({},B),{},{"--thumb-start-left":y,"--thumb-start-width":T(l==null?void 0:l.width),"--thumb-active-left":O,"--thumb-active-width":T(c==null?void 0:c.width),"--thumb-start-top":y,"--thumb-start-height":T(l==null?void 0:l.height),"--thumb-active-top":O,"--thumb-active-height":T(c==null?void 0:c.height)}),F={ref:n.composeRef($,P),style:_,className:n.cn("".concat(t,"-thumb"),m)};return process.env.NODE_ENV==="test"&&(F["data-test-style"]=JSON.stringify(_)),o.createElement("div",F)})}var ve=["prefixCls","direction","vertical","options","disabled","defaultValue","value","name","onChange","className","motionName"];function ge(e){if(typeof e.title<"u")return e.title;if(n._typeof(e.label)!=="object"){var t;return(t=e.label)===null||t===void 0?void 0:t.toString()}}function he(e){return e.map(function(t){if(n._typeof(t)==="object"&&t!==null){var i=ge(t);return n._objectSpread2(n._objectSpread2({},t),{},{title:i})}return{label:t==null?void 0:t.toString(),title:t==null?void 0:t.toString(),value:t}})}var be=function(t){var i=t.prefixCls,a=t.className,r=t.disabled,s=t.checked,p=t.label,h=t.title,b=t.value,S=t.name,d=t.onChange,$=t.onFocus,w=t.onBlur,R=t.onKeyDown,v=t.onKeyUp,M=t.onMouseDown,C=function(f){r||d(f,b)};return o.createElement("label",{className:n.cn(a,n._defineProperty({},"".concat(i,"-item-disabled"),r)),onMouseDown:M},o.createElement("input",{name:S,className:"".concat(i,"-item-input"),type:"radio",disabled:r,checked:s,onChange:C,onFocus:$,onBlur:w,onKeyDown:R,onKeyUp:v}),o.createElement("div",{className:"".concat(i,"-item-label"),title:h,"aria-selected":s},p))},ee=o.forwardRef(function(e,t){var i,a,r=e.prefixCls,s=r===void 0?"rc-segmented":r,p=e.direction,h=e.vertical,b=e.options,S=b===void 0?[]:b,d=e.disabled,$=e.defaultValue,w=e.value,R=e.name,v=e.onChange,M=e.className,C=M===void 0?"":M,E=e.motionName,f=E===void 0?"thumb-motion":E,l=n._objectWithoutProperties(e,ve),N=o.useRef(null),V=o.useMemo(function(){return n.composeRef(N,t)},[N,t]),x=o.useMemo(function(){return he(S)},[S]),c=n.useMergedState((i=x[0])===null||i===void 0?void 0:i.value,{value:w,defaultValue:$}),I=n._slicedToArray(c,2),y=I[0],O=I[1],D=o.useState(!1),H=n._slicedToArray(D,2),A=H[0],u=H[1],P=function(j,z){O(z),v==null||v(z)},m=n.omit(l,["children"]),B=o.useState(!1),_=n._slicedToArray(B,2),F=_[0],X=_[1],ae=o.useState(!1),q=n._slicedToArray(ae,2),ie=q[0],U=q[1],oe=function(){U(!0)},re=function(){U(!1)},le=function(){X(!1)},se=function(j){j.key==="Tab"&&X(!0)},G=function(j){var z=x.findIndex(function(de){return de.value===y}),Y=x.length,ue=(z+j+Y)%Y,L=x[ue];L&&(O(L.value),v==null||v(L.value))},ce=function(j){switch(j.key){case"ArrowLeft":case"ArrowUp":G(-1);break;case"ArrowRight":case"ArrowDown":G(1);break}};return o.createElement("div",n._extends({role:"radiogroup","aria-label":"segmented control",tabIndex:d?void 0:0},m,{className:n.cn(s,(a={},n._defineProperty(a,"".concat(s,"-rtl"),p==="rtl"),n._defineProperty(a,"".concat(s,"-disabled"),d),n._defineProperty(a,"".concat(s,"-vertical"),h),a),C),ref:V}),o.createElement("div",{className:"".concat(s,"-group")},o.createElement(fe,{vertical:h,prefixCls:s,value:y,containerRef:N,motionName:"".concat(s,"-").concat(f),direction:p,getValueIndex:function(j){return x.findIndex(function(z){return z.value===j})},onMotionStart:function(){u(!0)},onMotionEnd:function(){u(!1)}}),x.map(function(g){var j;return o.createElement(be,n._extends({},g,{name:R,key:g.value,prefixCls:s,className:n.cn(g.className,"".concat(s,"-item"),(j={},n._defineProperty(j,"".concat(s,"-item-selected"),g.value===y&&!A),n._defineProperty(j,"".concat(s,"-item-focused"),ie&&F&&g.value===y),j)),checked:g.value===y,onChange:P,onFocus:oe,onBlur:re,onKeyDown:ce,onKeyUp:se,onMouseDown:le,disabled:!!d||!!g.disabled}))})))});process.env.NODE_ENV!=="production"&&(ee.displayName="Segmented");var pe=ee;function Z(e,t){return{[`${e}, ${e}:hover, ${e}:focus`]:{color:t.colorTextDisabled,cursor:"not-allowed"}}}function Q(e){return{backgroundColor:e.itemSelectedBg,boxShadow:e.boxShadowTertiary}}const xe=Object.assign({overflow:"hidden"},n.textEllipsis),Se=e=>{const{componentCls:t}=e,i=e.calc(e.controlHeight).sub(e.calc(e.trackPadding).mul(2)).equal(),a=e.calc(e.controlHeightLG).sub(e.calc(e.trackPadding).mul(2)).equal(),r=e.calc(e.controlHeightSM).sub(e.calc(e.trackPadding).mul(2)).equal();return{[t]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},n.resetComponent(e)),{display:"inline-block",padding:e.trackPadding,color:e.itemColor,background:e.trackBg,borderRadius:e.borderRadius,transition:`all ${e.motionDurationMid} ${e.motionEaseInOut}`}),n.genFocusStyle(e)),{[`${t}-group`]:{position:"relative",display:"flex",alignItems:"stretch",justifyItems:"flex-start",flexDirection:"row",width:"100%"},[`&${t}-rtl`]:{direction:"rtl"},[`&${t}-vertical`]:{[`${t}-group`]:{flexDirection:"column"},[`${t}-thumb`]:{width:"100%",height:0,padding:`0 ${n.unit(e.paddingXXS)}`}},[`&${t}-block`]:{display:"flex"},[`&${t}-block ${t}-item`]:{flex:1,minWidth:0},[`${t}-item`]:{position:"relative",textAlign:"center",cursor:"pointer",transition:`color ${e.motionDurationMid} ${e.motionEaseInOut}`,borderRadius:e.borderRadiusSM,transform:"translateZ(0)","&-selected":Object.assign(Object.assign({},Q(e)),{color:e.itemSelectedColor}),"&-focused":Object.assign({},n.genFocusOutline(e)),"&::after":{content:'""',position:"absolute",zIndex:-1,width:"100%",height:"100%",top:0,insetInlineStart:0,borderRadius:"inherit",opacity:0,transition:`opacity ${e.motionDurationMid}`,pointerEvents:"none"},[`&:hover:not(${t}-item-selected):not(${t}-item-disabled)`]:{color:e.itemHoverColor,"&::after":{opacity:1,backgroundColor:e.itemHoverBg}},[`&:active:not(${t}-item-selected):not(${t}-item-disabled)`]:{color:e.itemHoverColor,"&::after":{opacity:1,backgroundColor:e.itemActiveBg}},"&-label":Object.assign({minHeight:i,lineHeight:n.unit(i),padding:`0 ${n.unit(e.segmentedPaddingHorizontal)}`},xe),"&-icon + *":{marginInlineStart:e.calc(e.marginSM).div(2).equal()},"&-input":{position:"absolute",insetBlockStart:0,insetInlineStart:0,width:0,height:0,opacity:0,pointerEvents:"none"}},[`${t}-thumb`]:Object.assign(Object.assign({},Q(e)),{position:"absolute",insetBlockStart:0,insetInlineStart:0,width:0,height:"100%",padding:`${n.unit(e.paddingXXS)} 0`,borderRadius:e.borderRadiusSM,transition:`transform ${e.motionDurationSlow} ${e.motionEaseInOut}, height ${e.motionDurationSlow} ${e.motionEaseInOut}`,[`& ~ ${t}-item:not(${t}-item-selected):not(${t}-item-disabled)::after`]:{backgroundColor:"transparent"}}),[`&${t}-lg`]:{borderRadius:e.borderRadiusLG,[`${t}-item-label`]:{minHeight:a,lineHeight:n.unit(a),padding:`0 ${n.unit(e.segmentedPaddingHorizontal)}`,fontSize:e.fontSizeLG},[`${t}-item, ${t}-thumb`]:{borderRadius:e.borderRadius}},[`&${t}-sm`]:{borderRadius:e.borderRadiusSM,[`${t}-item-label`]:{minHeight:r,lineHeight:n.unit(r),padding:`0 ${n.unit(e.segmentedPaddingHorizontalSM)}`},[`${t}-item, ${t}-thumb`]:{borderRadius:e.borderRadiusXS}}}),Z(`&-disabled ${t}-item`,e)),Z(`${t}-item-disabled`,e)),{[`${t}-thumb-motion-appear-active`]:{transition:`transform ${e.motionDurationSlow} ${e.motionEaseInOut}, width ${e.motionDurationSlow} ${e.motionEaseInOut}`,willChange:"transform, width"},[`&${t}-shape-round`]:{borderRadius:9999,[`${t}-item, ${t}-thumb`]:{borderRadius:9999}}})}},ye=e=>{const{colorTextLabel:t,colorText:i,colorFillSecondary:a,colorBgElevated:r,colorFill:s,lineWidthBold:p,colorBgLayout:h}=e;return{trackPadding:p,trackBg:h,itemColor:t,itemHoverColor:i,itemHoverBg:a,itemSelectedBg:r,itemActiveBg:s,itemSelectedColor:i}},je=n.genStyleHooks("Segmented",e=>{const{lineWidth:t,calc:i}=e,a=n.merge(e,{segmentedPaddingHorizontal:i(e.controlPaddingHorizontal).sub(t).equal(),segmentedPaddingHorizontalSM:i(e.controlPaddingHorizontalSM).sub(t).equal()});return[Se(a)]},ye);var k=function(e,t){var i={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(i[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,a=Object.getOwnPropertySymbols(e);r<a.length;r++)t.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(e,a[r])&&(i[a[r]]=e[a[r]]);return i};function $e(e){return typeof e=="object"&&!!(e!=null&&e.icon)}const we=o.forwardRef((e,t)=>{const i=n.useId(),{prefixCls:a,className:r,rootClassName:s,block:p,options:h=[],size:b="middle",style:S,vertical:d,shape:$="default",name:w=i}=e,R=k(e,["prefixCls","className","rootClassName","block","options","size","style","vertical","shape","name"]),{getPrefixCls:v,direction:M,className:C,style:E}=n.useComponentConfig("segmented"),f=v("segmented",a),[l,N,V]=je(f),x=n.useSize(b),c=o.useMemo(()=>h.map(O=>{if($e(O)){const{icon:D,label:H}=O,A=k(O,["icon","label"]);return Object.assign(Object.assign({},A),{label:o.createElement(o.Fragment,null,o.createElement("span",{className:`${f}-item-icon`},D),H&&o.createElement("span",null,H))})}return O}),[h,f]),I=n.cn(r,s,C,{[`${f}-block`]:p,[`${f}-sm`]:x==="small",[`${f}-lg`]:x==="large",[`${f}-vertical`]:d,[`${f}-shape-${$}`]:$==="round"},N,V),y=Object.assign(Object.assign({},E),S);return l(o.createElement(pe,Object.assign({},R,{name:w,className:I,style:y,options:c,ref:t,prefixCls:f,direction:M,vertical:d})))}),te=we;process.env.NODE_ENV!=="production"&&(te.displayName="Segmented");var Re={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M758.2 839.1C851.8 765.9 912 651.9 912 523.9 912 303 733.5 124.3 512.6 124 291.4 123.7 112 302.8 112 523.9c0 125.2 57.5 236.9 147.6 310.2 3.5 2.8 8.6 2.2 11.4-1.3l39.4-50.5c2.7-3.4 2.1-8.3-1.2-11.1-8.1-6.6-15.9-13.7-23.4-21.2a318.64 318.64 0 01-68.6-101.7C200.4 609 192 567.1 192 523.9s8.4-85.1 25.1-124.5c16.1-38.1 39.2-72.3 68.6-101.7 29.4-29.4 63.6-52.5 101.7-68.6C426.9 212.4 468.8 204 512 204s85.1 8.4 124.5 25.1c38.1 16.1 72.3 39.2 101.7 68.6 29.4 29.4 52.5 63.6 68.6 101.7 16.7 39.4 25.1 81.3 25.1 124.5s-8.4 85.1-25.1 124.5a318.64 318.64 0 01-68.6 101.7c-9.3 9.3-19.1 18-29.3 26L668.2 724a8 8 0 00-14.1 3l-39.6 162.2c-1.2 5 2.6 9.9 7.7 9.9l167 .8c6.7 0 10.5-7.7 6.3-12.9l-37.3-47.9z"}}]},name:"redo",theme:"outlined"};function W(){return W=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(e[a]=i[a])}return e},W.apply(this,arguments)}const Ce=(e,t)=>o.createElement(n.Icon,W({},e,{ref:t,icon:Re})),ne=o.forwardRef(Ce);process.env.NODE_ENV!=="production"&&(ne.displayName="RedoOutlined");const Oe=({datePickerComponent:e,searchText:t,noDateText:i,emptyText:a,searchSelect:r,radioOptions:s,searchOptions:p,searchType:h,textSearchValue:b="",dateSearchValue:S,numberSearchValue:d,multiselectSearchValue:$,multiselectOptions:w,onChangeSearch:R,onChangeTextSearch:v,onChangeRadioSearch:M,onChangeDateSearch:C,onChangeNumberSearch:E,onChangeMultiselectSearch:f})=>{const[l,N]=K.useState(b),{token:{borderRadius:V,colorBgBase:x,paddingXXS:c}}=n.theme.useToken(),{isMobileMaxWidth:I}=n.useMobileViewPort(),{isSmallMaxWidth:y}=n.useSmallViewPort(),O=K.useMemo(()=>y?2:I?5:15,[I,y]);n.useDebounce(()=>{v==null||v(l)},n.TIME.milliseconds.milliseconds500,[l]);const D=()=>{N("")},H=m=>{R(m),D()},A=m=>{N(m.target.value.replace(/"/g,""))},u=m=>{C==null||C(m)},P=m=>{!m&&m!==0||E==null||E(+m)};return n.jsxRuntimeExports.jsxs(n.Flex,{className:n.styles.flex,gap:"small",style:{padding:c,borderRadius:V,background:x},children:[n.jsxRuntimeExports.jsx(n.Select,{defaultValue:r,value:r,style:{width:120,minWidth:120},options:p,onChange:H}),{text:n.jsxRuntimeExports.jsx(n.Input,{placeholder:t,value:l,allowClear:!0,onChange:A}),radio:n.jsxRuntimeExports.jsx(te,{options:s,defaultValue:n.searchRadioDefaultValue,onChange:M}),date:K.createElement(e,{noDateText:i,currentValue:S??"",onChangeDate:u}),number:n.jsxRuntimeExports.jsx(n.BaseInputNumber,{emptyText:a,value:d,placeholder:t,min:0,max:2147483647,onChange:P}),multiselect:n.jsxRuntimeExports.jsx(n.Select,{className:n.styles.select,mode:"multiple",placeholder:t,maxTagCount:1,maxTagTextLength:O,showSearch:!1,allowClear:!0,options:w,value:$,onChange:f})}[h]]})},Ee=({sortTooltipText:e,updateDataText:t,refreshText:i,createText:a,createNewElementText:r,order:s,orderOptions:p,createButtonTooltip:h,searchProps:b,isCanCreate:S,isHiddenCreate:d,onCreate:$,onRefetch:w,onChangeOrder:R})=>n.jsxRuntimeExports.jsxs(n.Flex,{gap:"middle",justify:"space-between",wrap:"wrap",style:{marginBottom:n.THEME.OFFSET[1]},children:[n.jsxRuntimeExports.jsxs(n.Flex,{align:"center",gap:"middle",wrap:"wrap",children:[n.jsxRuntimeExports.jsx(Oe,{...b}),n.jsxRuntimeExports.jsx(n.Tooltip,{title:e,children:n.jsxRuntimeExports.jsx(n.Select,{className:n.styles.sort,value:s,options:p,onChange:R})})]}),n.jsxRuntimeExports.jsxs(n.Flex,{className:n.styles.buttonsContainer,gap:"small",align:"center",children:[w&&n.jsxRuntimeExports.jsx(n.Tooltip,{title:t,children:n.jsxRuntimeExports.jsx(n.Button,{className:n.styles.button,icon:n.jsxRuntimeExports.jsx(ne,{}),onClick:w,children:i})}),!d&&S&&n.jsxRuntimeExports.jsx(n.Tooltip,{title:h??r,children:n.jsxRuntimeExports.jsx(n.Button,{className:n.styles.button,type:"primary",icon:n.jsxRuntimeExports.jsx(n.RefIcon,{}),onClick:$,children:a})})]})]});exports.TableHead=Ee;
@@ -1,4 +1,4 @@
1
- import { _ as F, u as Ce, C as Re, a as G, c as X, b as de, d as je, e as Oe, o as Ne, f as ie, g as L, h as ue, i as Me, m as Ee, r as Ie, j as He, k as B, l as Pe, t as Ve, n as De, p as Be, q as Te, I as Ae, s as _e, v as ze, w as Fe, x as Ke, T as Le, y as v, F as U, z as W, S as Z, B as We, A as Xe, D as qe, E as Ue, G as J, H as oe, R as Ge } from "./index-CckU_0ua.js";
1
+ import { _ as F, u as Ce, C as Re, a as G, c as X, b as de, d as je, e as Oe, o as Ne, f as ie, g as L, h as ue, i as Me, m as Ee, r as Ie, j as He, k as B, l as Pe, t as Ve, n as De, p as Be, q as Te, I as Ae, s as _e, v as ze, w as Fe, x as Ke, T as Le, y as v, F as U, z as W, S as Z, B as We, A as Xe, D as qe, E as Ue, G as J, H as oe, R as Ge } from "./index-DDl30-8L.js";
2
2
  import * as i from "react";
3
3
  import { useState as Ye, useMemo as Je, createElement as Ze } from "react";
4
4
  var le = function(t, n) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "denwa-react-shared",
3
3
  "private": false,
4
- "version": "1.0.74",
4
+ "version": "1.0.76",
5
5
  "type": "module",
6
6
  "author": "Denwa",
7
7
  "main": "dist/denwa-react-shared.umd.js",
@@ -1,45 +0,0 @@
1
- import { GetErrorType, IResultImage, IServerImage, IServerImageForm, IUploadImage } from '../types';
2
- /**
3
- * @description Создает url картинки
4
- * @param {string} name - название картинки
5
- * @param {string} extension - расширение картинки
6
- * @param {string} entityId - id сущности
7
- * @param {string} bucketName - название бакета картинки
8
- * @param {string} prefixe - префикс файла
9
- * @param {string} uploadUrl - url бакета
10
- * @param bucketFolder - enum с папкой бакета
11
- * @response Возвращает url
12
- */
13
- export declare const getUploadImageUrl: <T>({ name, extension, entityId, prefixe, bucketFolder, uploadUrl, }: {
14
- name: string;
15
- extension: string;
16
- entityId: string;
17
- prefixe: string;
18
- uploadUrl: string;
19
- bucketFolder: T;
20
- }) => string;
21
- /**
22
- * @description Проверяет валидность объекта картинки по схеме
23
- * @param {object} object - объект с информацией о картинке
24
- * @response Возвращает true/false
25
- */
26
- export declare const checkCorrectImageObject: (object: IServerImage, getError: GetErrorType) => boolean;
27
- /**
28
- * @description Сортирует массив картинок по порядку из примера
29
- * @param {array} array - объект с картинками
30
- * @param {string[]} reference - массив в порядком uid
31
- * @response Возвращает отсортированный массив картинок
32
- */
33
- export declare const sortImagesArrayByReference: (array: IResultImage[], reference: string[]) => IResultImage[];
34
- /**
35
- * @description Преобразует фотографии с сервера в формат для работы с формой
36
- * @param {string | undefined | null} images - json stringify строка с информацией
37
- * @param bucketFolder - название папки в бакете
38
- * @param uploadUrl - Ссылка на бакет
39
- * @response Возвращает массив с подготовленными картинками
40
- */
41
- export declare const prepareServerImages: <T>(images: string | undefined | null, bucketFolder: T, uploadUrl: string, getError: GetErrorType) => {
42
- serverImages: IServerImageForm[];
43
- uploadImages: IUploadImage[];
44
- };
45
- export declare const getImagePrefix: (prefixes: string[], type: "original" | "0.25hd" | "0.5hd" | "1hd" | "2hd" | "4hd") => string;