@zealicsolutions/web-ui 1.0.53-test.38 → 1.0.53-test.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/contexts/LayoutContext/LayoutContext.d.ts +2 -0
- package/dist/cjs/contexts/LayoutContext/LayoutContextProvider.d.ts +1 -0
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/contexts/LayoutContext/LayoutContext.d.ts +2 -0
- package/dist/esm/contexts/LayoutContext/LayoutContext.js +1 -1
- package/dist/esm/contexts/LayoutContext/LayoutContext.js.map +1 -1
- package/dist/esm/contexts/LayoutContext/LayoutContextProvider.d.ts +1 -0
- package/dist/esm/contexts/LayoutContext/LayoutContextProvider.js +1 -1
- package/dist/esm/contexts/LayoutContext/LayoutContextProvider.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/package.json +1 -1
@@ -10,5 +10,7 @@ export interface LayoutContextType {
|
|
10
10
|
updateDrawer: (props: Partial<DrawerState>) => void;
|
11
11
|
drawerContainerRef?: Element | null;
|
12
12
|
setDrawerContainerRef?: (ref: Element | null) => void;
|
13
|
+
headerHeight?: string;
|
14
|
+
setHeaderHeight?: (height: string) => void;
|
13
15
|
}
|
14
16
|
export declare const LayoutContext: import("react").Context<LayoutContextType>;
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{createContext as
|
1
|
+
import{createContext as e}from"react";var r=e({drawer:{width:0,position:"right",isOpen:!1,positionType:"normal"},updateDrawer:function(){},drawerContainerRef:void 0,setDrawerContainerRef:function(){},headerHeight:"0px",setHeaderHeight:function(){}});export{r as LayoutContext};
|
2
2
|
//# sourceMappingURL=LayoutContext.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"LayoutContext.js","sources":["../../../../../src/contexts/LayoutContext/LayoutContext.ts"],"sourcesContent":[null],"names":["LayoutContext","createContext","drawer","width","position","isOpen","positionType","updateDrawer","drawerContainerRef","undefined","setDrawerContainerRef"],"mappings":"
|
1
|
+
{"version":3,"file":"LayoutContext.js","sources":["../../../../../src/contexts/LayoutContext/LayoutContext.ts"],"sourcesContent":[null],"names":["LayoutContext","createContext","drawer","width","position","isOpen","positionType","updateDrawer","drawerContainerRef","undefined","setDrawerContainerRef","headerHeight","setHeaderHeight"],"mappings":"sCAqBO,IAAMA,EAAgBC,EAAiC,CAC5DC,OAAQ,CAAEC,MAAO,EAAGC,SAAU,QAASC,QAAQ,EAAOC,aAAc,UACpEC,aAAc,WAAS,EACvBC,wBAAoBC,EACpBC,sBAAuB,WAAS,EAChCC,aAAc,MACdC,gBAAiB,WAAS"}
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import React, { PropsWithChildren } from 'react';
|
2
2
|
export interface LayoutProviderProps extends PropsWithChildren {
|
3
3
|
layoutPosition?: 'normal' | 'absolute';
|
4
|
+
headerHeight?: string;
|
4
5
|
drawerMaxWidthPercent?: number;
|
5
6
|
}
|
6
7
|
export declare const LayoutProvider: React.FC<LayoutProviderProps>;
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{__assign as i}from"../../node_modules/tslib/tslib.es6.js";import{jsx as t}from"../../node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.esm.js";import{useState as
|
1
|
+
import{__assign as i}from"../../node_modules/tslib/tslib.es6.js";import{jsx as t}from"../../node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.esm.js";import{useState as r,useRef as n,useEffect as e,useMemo as o}from"react";import{LayoutContext as d}from"./LayoutContext.js";var u=function(u){var a=u.children,s=u.layoutPosition,c=void 0===s?"normal":s,p=u.drawerMaxWidthPercent,f=void 0===p?80:p,h=u.headerHeight,v=void 0===h?"0px":h,l=r({width:0,position:"right",isOpen:!1,positionType:c}),m=l[0],w=l[1],y=n(null),T=r(null),x=T[0],O=T[1];e((function(){w((function(t){return i(i({},t),{positionType:c})}))}),[c]),e((function(){if(y.current){var t=function(){var t;if(m.isOpen){var r=(null===(t=y.current)||void 0===t?void 0:t.clientWidth)||0,n=Math.floor(r*(f/100));m.width>n&&w((function(t){return i(i({},t),{width:n})}))}};t();var r=new ResizeObserver((function(){t()}));return r.observe(y.current),function(){r.disconnect()}}}),[m.isOpen,m.width,f]);var j=o((function(){return function(t){w((function(r){var n=void 0!==t.width?t.width:r.width;if(y.current&&(t.isOpen||r.isOpen)){var e=y.current.clientWidth,o=Math.floor(e*(f/100));n=Math.min(n,o)}var d=void 0!==t.positionType?t.positionType:r.positionType;return i(i(i({},r),t),{width:n,positionType:d})}))}}),[f]),b=o((function(){return{drawer:m,updateDrawer:j,drawerContainerRef:x,setDrawerContainerRef:O}}),[m,j,x]);return t(d.Provider,i({value:b},{children:t("div",i({ref:y,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",marginTop:v}},{children:a}))}))};export{u as LayoutProvider};
|
2
2
|
//# sourceMappingURL=LayoutContextProvider.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"LayoutContextProvider.js","sources":["../../../../../src/contexts/LayoutContext/LayoutContextProvider.tsx"],"sourcesContent":[null],"names":["LayoutProvider","_a","children","_b","layoutPosition","_c","drawerMaxWidthPercent","_d","useState","width","position","isOpen","positionType","drawer","setDrawer","containerRef","useRef","
|
1
|
+
{"version":3,"file":"LayoutContextProvider.js","sources":["../../../../../src/contexts/LayoutContext/LayoutContextProvider.tsx"],"sourcesContent":[null],"names":["LayoutProvider","_a","children","_b","layoutPosition","_c","drawerMaxWidthPercent","_d","headerHeight","_e","useState","width","position","isOpen","positionType","drawer","setDrawer","containerRef","useRef","_f","drawerContainerRef","setDrawerContainerRef","useEffect","current","__assign","constrainDrawerWidth","containerWidth","clientWidth","maxWidth","Math","floor","resizeObserver","ResizeObserver","observe","disconnect","updateDrawer","useMemo","props","newWidth","undefined","min","newPositionType","contextValue","_jsx","LayoutContext","Provider","value","ref","style","height","overflow","marginTop"],"mappings":"uSAUO,IAAMA,EAAgD,SAACC,GAC5D,IAAAC,aACAC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KAAKC,MAAMJ,GAAkBpB,EAAwB,MAEtEgC,EAAWT,KAAKW,IAAIF,EAAUV,EAC/B,CAGD,IAAMa,OACmBF,IAAvBF,EAAMvB,aAA6BuB,EAAMvB,aAAeS,EAAQT,aAElE,OACKU,EAAAA,EAAAA,EAAA,CAAA,EAAAD,GACAc,GACH,CAAA1B,MAAO2B,EACPxB,aAAc2B,GAElB,GACF,CAAC,GACD,CAACnC,IAIGoC,EAAeN,GACnB,WAAM,MAAC,CACLrB,OAAMA,EACNoB,aAAYA,EACZf,mBAAkBA,EAClBC,sBAAqBA,EACrB,GACF,CAACN,EAAQoB,EAAcf,IAGzB,OACEuB,EAACC,EAAcC,YAASC,MAAOJ,GAAY,CAAAxC,SACzCyC,WACEI,IAAK9B,EACL+B,MAAO,CACLpC,SAAU,WACVD,MAAO,OACPsC,OAAQ,OACRC,SAAU,SACVC,UAAW3C,IACZ,CAAAN,SAEAA,OAIT"}
|
package/dist/index.d.ts
CHANGED
@@ -710,11 +710,14 @@ interface LayoutContextType {
|
|
710
710
|
updateDrawer: (props: Partial<DrawerState>) => void;
|
711
711
|
drawerContainerRef?: Element | null;
|
712
712
|
setDrawerContainerRef?: (ref: Element | null) => void;
|
713
|
+
headerHeight?: string;
|
714
|
+
setHeaderHeight?: (height: string) => void;
|
713
715
|
}
|
714
716
|
declare const LayoutContext: react.Context<LayoutContextType>;
|
715
717
|
|
716
718
|
interface LayoutProviderProps extends PropsWithChildren {
|
717
719
|
layoutPosition?: 'normal' | 'absolute';
|
720
|
+
headerHeight?: string;
|
718
721
|
drawerMaxWidthPercent?: number;
|
719
722
|
}
|
720
723
|
declare const LayoutProvider: react__default.FC<LayoutProviderProps>;
|