@zealicsolutions/web-ui 1.0.53-test.8 → 1.0.53-test.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14,6 +14,7 @@ export declare type StyledDrawerProps = DrawerComponentProps & {
14
14
  marginRight?: string;
15
15
  marginBottom?: string;
16
16
  marginLeft?: string;
17
+ positionType?: 'absolute' | 'normal';
17
18
  };
18
19
  export declare const BaseDrawer: import("@emotion/styled").StyledComponent<DrawerComponentProps & {
19
20
  theme?: import("@emotion/react").Theme | undefined;
@@ -29,6 +30,7 @@ export declare const BaseDrawer: import("@emotion/styled").StyledComponent<Drawe
29
30
  marginRight?: string | undefined;
30
31
  marginBottom?: string | undefined;
31
32
  marginLeft?: string | undefined;
33
+ positionType?: "absolute" | "normal" | undefined;
32
34
  }, {}, {}>;
33
35
  export declare type IconWrapperProps = {
34
36
  position?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left';
@@ -1,8 +1,9 @@
1
1
  /// <reference types="react" />
2
2
  export interface DrawerState {
3
3
  width: number;
4
- position: 'left' | 'right';
4
+ position: 'left' | 'right' | 'top' | 'bottom';
5
5
  isOpen: boolean;
6
+ positionType?: 'absolute' | 'normal';
6
7
  }
7
8
  export interface LayoutContextType {
8
9
  drawer: DrawerState;
@@ -1,2 +1,2 @@
1
- import{createContext as r}from"react";var t=r({drawer:{width:0,position:"right",isOpen:!1},updateDrawer:function(){}});export{t as LayoutContext};
1
+ import{createContext as r}from"react";var i=r({drawer:{width:0,position:"right",isOpen:!1,positionType:"normal"},updateDrawer:function(){}});export{i 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","updateDrawer"],"mappings":"sCAgBO,IAAMA,EAAgBC,EAAiC,CAC5DC,OAAQ,CAAEC,MAAO,EAAGC,SAAU,QAASC,QAAQ,GAC/CC,aAAc,WAAQ"}
1
+ {"version":3,"file":"LayoutContext.js","sources":["../../../../../src/contexts/LayoutContext/LayoutContext.ts"],"sourcesContent":[null],"names":["LayoutContext","createContext","drawer","width","position","isOpen","positionType","updateDrawer"],"mappings":"sCAiBO,IAAMA,EAAgBC,EAAiC,CAC5DC,OAAQ,CAAEC,MAAO,EAAGC,SAAU,QAASC,QAAQ,EAAOC,aAAc,UACpEC,aAAc,WAAQ"}
@@ -1,5 +1,6 @@
1
1
  import React, { PropsWithChildren } from 'react';
2
2
  export interface LayoutProviderProps extends PropsWithChildren {
3
+ layoutPosition?: 'normal' | 'absolute';
3
4
  drawerMaxWidthPercent?: number;
4
5
  }
5
6
  export declare const LayoutProvider: React.FC<LayoutProviderProps>;
@@ -1,2 +1,2 @@
1
- import{__assign as r}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 i,useRef as e,useEffect as n,useMemo as o}from"react";import{LayoutContext as d}from"./LayoutContext.js";var u=function(u){var c=u.children,s=u.drawerMaxWidthPercent,a=void 0===s?80:s,h=i({width:0,position:"right",isOpen:!1}),f=h[0],v=h[1],l=e(null);n((function(){if(l.current){var t=function(){var t;if(f.isOpen){var i=(null===(t=l.current)||void 0===t?void 0:t.clientWidth)||0,e=Math.floor(i*(a/100));f.width>e&&v((function(t){return r(r({},t),{width:e})}))}};t();var i=new ResizeObserver((function(){t()}));return i.observe(l.current),function(){i.disconnect()}}}),[f.isOpen,f.width,a]);var m=o((function(){return function(t){v((function(i){var e=void 0!==t.width?t.width:i.width;if(l.current&&(t.isOpen||i.isOpen)){var n=l.current.clientWidth,o=Math.floor(n*(a/100));e=Math.min(e,o)}return r(r(r({},i),t),{width:e})}))}}),[a]),w=o((function(){return{drawer:f,updateDrawer:m}}),[f,m]);return t(d.Provider,r({value:w},{children:t("div",r({ref:l,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden"}},{children:c}))}))};export{u as LayoutProvider};
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 n,useRef as r,useEffect as e,useMemo as o}from"react";import{LayoutContext as d}from"./LayoutContext.js";var u=function(u){var s=u.children,c=u.layoutPosition,a=void 0===c?"normal":c,p=u.drawerMaxWidthPercent,f=void 0===p?80:p,v=n({width:0,position:"right",isOpen:!1,positionType:a}),h=v[0],l=v[1],m=r(null);e((function(){l((function(t){return i(i({},t),{positionType:a})}))}),[a]),e((function(){if(m.current){var t=function(){var t;if(h.isOpen){var n=(null===(t=m.current)||void 0===t?void 0:t.clientWidth)||0,r=Math.floor(n*(f/100));h.width>r&&l((function(t){return i(i({},t),{width:r})}))}};t();var n=new ResizeObserver((function(){t()}));return n.observe(m.current),function(){n.disconnect()}}}),[h.isOpen,h.width,f]);var w=o((function(){return function(t){l((function(n){var r=void 0!==t.width?t.width:n.width;if(m.current&&(t.isOpen||n.isOpen)){var e=m.current.clientWidth,o=Math.floor(e*(f/100));r=Math.min(r,o)}var d=void 0!==t.positionType?t.positionType:n.positionType;return i(i(i({},n),t),{width:r,positionType:d})}))}}),[f]),y=o((function(){return{drawer:h,updateDrawer:w}}),[h,w]);return t(d.Provider,i({value:y},{children:t("div",i({ref:m,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden"}},{children:s}))}))};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","drawerMaxWidthPercent","_c","useState","width","position","isOpen","drawer","setDrawer","containerRef","useRef","useEffect","current","constrainDrawerWidth","containerWidth","clientWidth","maxWidth","Math","floor","__assign","resizeObserver","ResizeObserver","observe","disconnect","updateDrawer","useMemo","props","newWidth","undefined","min","contextValue","_jsx","LayoutContext","Provider","value","ref","style","height","overflow"],"mappings":"uSAQO,IAAMA,EAAgD,SAACC,GAC5D,IAAAC,aACAC,EAAAF,EAAAG,sBAAAA,OAAqB,IAAAD,EAAG,GAAEA,EAGpBE,EAAsBC,EAAsB,CAChDC,MAAO,EACPC,SAAU,QACVC,QAAQ,IAHHC,EAAML,EAAA,GAAEM,OAOTC,EAAeC,EAAuB,MAG5CC,GAAU,WACR,GAAKF,EAAaG,QAAlB,CAGA,IAAMC,EAAuB,iBAC3B,GAAKN,EAAOD,OAAZ,CAEA,IAAMQ,GAAuC,QAAtBhB,EAAAW,EAAaG,eAAS,IAAAd,OAAA,EAAAA,EAAAiB,cAAe,EACtDC,EAAWC,KAAKC,MAAMJ,GAAkBb,EAAwB,MAElEM,EAAOH,MAAQY,GACjBR,GAAU,SAAAI,GAAW,OAChBO,EAAAA,EAAA,CAAA,EAAAP,GACH,CAAAR,MAAOY,GACP,GATuB,CAW7B,EAGAH,IAGA,IAAMO,EAAiB,IAAIC,gBAAe,WACxCR,GACF,IAIA,OAFAO,EAAeE,QAAQb,EAAaG,SAE7B,WACLQ,EAAeG,YACjB,CA7BkC,CA8BpC,GAAG,CAAChB,EAAOD,OAAQC,EAAOH,MAAOH,IAGjC,IAAMuB,EAAeC,GACnB,WAAM,OAAA,SAACC,GACLlB,GAAU,SAAAI,GAER,IAAIe,OAA2BC,IAAhBF,EAAMtB,MAAsBsB,EAAMtB,MAAQQ,EAAQR,MAEjE,GAAIK,EAAaG,UAAYc,EAAMpB,QAAUM,EAAQN,QAAS,CAC5D,IAAMQ,EAAiBL,EAAaG,QAAQG,YACtCC,EAAWC,KAAKC,MAAMJ,GAAkBb,EAAwB,MACtE0B,EAAWV,KAAKY,IAAIF,EAAUX,EAC/B,CAED,OAAAG,EAAAA,EAAAA,EAAA,GACKP,GACAc,IACHtB,MAAOuB,GAEX,GACF,CAAC,GACD,CAAC1B,IAIG6B,EAAeL,GACnB,WAAM,MAAC,CACLlB,OAAMA,EACNiB,aAAYA,KAEd,CAACjB,EAAQiB,IAGX,OACEO,EAACC,EAAcC,YAASC,MAAOJ,GAAY,CAAA/B,SACzCgC,WACEI,IAAK1B,EACL2B,MAAO,CACL/B,SAAU,WACVD,MAAO,OACPiC,OAAQ,OACRC,SAAU,WACX,CAAAvC,SAEAA,OAIT"}
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","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"],"mappings":"uSASO,IAAMA,EAAgD,SAACC,GAC5D,IAAAC,EAAQD,EAAAC,SACRC,EAAyBF,EAAAG,eAAzBA,OAAiB,IAAAD,EAAA,SAAQA,EACzBE,EAA0BJ,EAAAK,sBAA1BA,OAAqB,IAAAD,EAAG,GAAEA,EAGpBE,EAAsBC,EAAsB,CAChDC,MAAO,EACPC,SAAU,QACVC,QAAQ,EACRC,aAAcR,IAJTS,EAAMN,EAAA,GAAEO,OAQTC,EAAeC,EAAuB,MAG5CC,GAAU,WACRH,GAAU,SAACI,GAAY,OAClBC,EAAAA,EAAA,CAAA,EAAAD,GACH,CAAAN,aAAcR,GACd,GACJ,GAAG,CAACA,IAGJa,GAAU,WACR,GAAKF,EAAaG,QAAlB,CAGA,IAAME,EAAuB,iBAC3B,GAAKP,EAAOF,OAAZ,CAEA,IAAMU,GAAuC,QAAtBpB,EAAAc,EAAaG,eAAS,IAAAjB,OAAA,EAAAA,EAAAqB,cAAe,EACtDC,EAAWC,KAAKC,MAAMJ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