@adminui-dev/layout 1.1.3 → 1.1.5
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/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var n=require("react/jsx-runtime"),e=require("react");function r(n,e){void 0===e&&(e={});var r=e.insertAt;if(n&&"undefined"!=typeof document){var t=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===r&&t.firstChild?t.insertBefore(o,t.firstChild):t.appendChild(o),o.styleSheet?o.styleSheet.cssText=n:o.appendChild(document.createTextNode(n))}}var t="Layout-module_rootBackground__j3UVG";r("@layer base {\r\n html, body {\r\n padding: 0;\r\n margin: 0;\r\n border: 0;\r\n width: 100%; \r\n height: 100%;\r\n }\r\n #root { \r\n text-align: initial;\r\n width: 100%;\r\n height:100%\r\n } \r\n}\r\n*, *:before, *:after {\r\n box-sizing: border-box;\r\n}\r\n.Layout-module_rootBox__3JHjy {\r\n text-rendering: optimizeLegibility;\r\n -webkit-font-smoothing: antialiased;\r\n -moz-osx-font-smoothing: grayscale;\r\n text-align: initial;\r\n width: 100%;\r\n min-height: 100%;\r\n}\r\n.Layout-module_rootBackground__j3UVG {\r\n box-sizing: border-box; \r\n pointer-events: none;\r\n inset-block-start:0;\r\n inset-inline-start:0; \r\n width: 100%; \r\n min-width: 100vw;\r\n height:100%;\r\n min-height: 100vh;\r\n overflow: hidden;\r\n position: fixed;\r\n z-index: 0;\r\n}\r\n.Layout-module_rootBackground__j3UVG>div{\r\n width:100%;\r\n height: 100%;\r\n overflow: hidden;\r\n}\r\n.Layout-module_rootLayout__jVEEF {\r\n position: relative;\r\n z-index: 1;\r\n box-sizing: border-box; \r\n width: 100%;\r\n min-height: 100%;\r\n display: flex; \r\n flex-flow: row;\r\n background-color: transparent;\r\n container-type: inline-size;\r\n}\r\n\r\n.Layout-module_mainLayout__6W9W9 {\r\n box-sizing: border-box; \r\n display: flex;\r\n flex-flow: column; \r\n width: 100%;\r\n min-width: 0px;\r\n}\r\n");const o=Symbol("LayoutAside"),i=Symbol("LayoutContent"),a=Symbol("LayoutHeader"),l=Symbol("LayoutBackground"),s=e.createContext({setLayoutConfig:()=>{},setLocale:()=>{}}),d=e.createContext({locale:"en-US",languages:[],layoutConfig:{},themeSkinMap:{tidy:[],rich:[]}}),u=()=>e.useContext(d);function c(e){return n.jsx("div",{className:t,children:n.jsx(n.Fragment,{children:e.children})})}function h(e){return n.jsx(n.Fragment,{children:e.children})}function m(e){return n.jsx(n.Fragment,{children:e.children})}function g(e){return n.jsx(n.Fragment,{children:e.children})}c.displayName="LayoutBackground",c.role=l,h.displayName="LayoutContent",h.role=i,m.displayName="LayoutAside",m.role=o,g.displayName="LayoutHeader",g.role=a;var x="layout-module_rootBox__Y8bEx",y="layout-module_rootLayout__TePvr",f="layout-module_mainLayout__a8Tb9";function b(r){let t=null,s=null,d=null,u=null;return e.Children.forEach(r.children,n=>{const e=n.type.role;e===a?t=n:e===i?s=n:e===o?d=n:e===l&&(u=n)}),n.jsx(n.Fragment,{children:n.jsxs("div",{ref:r.ref,className:x,style:{...r.style},children:[u,n.jsxs("div",{className:y,children:[d,n.jsxs("div",{className:f,children:[t,s]})]})]})})}r("@layer base {\r\n html, body {\r\n padding: 0;\r\n margin: 0;\r\n border: 0;\r\n width: 100%; \r\n height: 100%;\r\n }\r\n #root { \r\n text-align: initial;\r\n width: 100%;\r\n height:100%\r\n } \r\n}\r\n*, *:before, *:after {\r\n box-sizing: border-box;\r\n}\r\n.layout-module_rootBox__Y8bEx {\r\n text-rendering: optimizeLegibility;\r\n -webkit-font-smoothing: antialiased;\r\n -moz-osx-font-smoothing: grayscale;\r\n text-align: initial;\r\n width: 100%;\r\n min-height: 100%;\r\n}\r\n.layout-module_rootBackground__vEs6e {\r\n box-sizing: border-box; \r\n pointer-events: none;\r\n inset-block-start:0;\r\n inset-inline-start:0; \r\n width: 100%; \r\n min-width: 100vw;\r\n height:100%;\r\n min-height: 100vh;\r\n overflow: hidden;\r\n position: fixed;\r\n z-index: 0;\r\n}\r\n.layout-module_rootBackground__vEs6e>div{\r\n width:100%;\r\n height: 100%;\r\n overflow: hidden;\r\n}\r\n.layout-module_rootLayout__TePvr {\r\n position: relative;\r\n z-index: 1;\r\n box-sizing: border-box; \r\n width: 100%;\r\n min-height: 100%;\r\n display: flex; \r\n flex-flow: row;\r\n background-color: transparent;\r\n container-type: inline-size;\r\n}\r\n\r\n.layout-module_mainLayout__a8Tb9 {\r\n box-sizing: border-box; \r\n display: flex;\r\n flex-flow: column; \r\n width: 100%;\r\n min-width: 0px;\r\n}\r\n"),b.Aside=m,b.Content=h,b.Header=g,b.Background=c;const p=n=>({r:parseInt(n.slice(1,3),16),g:parseInt(n.slice(3,5),16),b:parseInt(n.slice(5,7),16),a:9===n.length?(parseInt(n.slice(7,9),16)/255).toFixed(2):1});exports.BaseLayout=b,exports.FullScreenButton=function(r){const t=!!document.fullscreenElement,[o,i]=e.useState(t),a=()=>{i(!!document.fullscreenElement)},l=n=>{"F11"===n.code&&(n.preventDefault(),s())};e.useEffect(()=>(document.addEventListener("fullscreenchange",a),document.addEventListener("keydown",l,!0),()=>{document.removeEventListener("fullscreenchange",a),document.removeEventListener("keydown",l)}),[]);const s=()=>{o?document.exitFullscreen():document.documentElement.requestFullscreen()};if(!r.buttons||r.buttons.length<2)return n.jsx(n.Fragment,{});const[d,u]=r.buttons,c=o?d:u;return e.cloneElement(c,{onClick:n=>{console.log(n),s()}})},exports.LayoutBackground=c,exports.createConfigActionContext=()=>s,exports.createConfigStateContext=()=>d,exports.defaultConfig={headerHeight:50,asideWidth:260,layoutType:"leftMenu",collapsedPosition:"bottom",avatarPosition:"rightTop",theme:"system",visibleBreadcrumbIcon:"none",primaryColor:"#417ffb"},exports.defineConfig=function(n){return n},exports.getAvatarInitials=function(n){if(!n)return"";const e=Array.from(n);if(0===e.length)return"";const r=e[0];return function(n){if(0===n.length)return!1;const e=n.codePointAt(0);return e>=19968&&e<=40959||e>=13312&&e<=19903||e>=12352&&e<=12543||e>=44032&&e<=55215||e>=65280&&e<=65519||e>=126976&&e<=129791||e>=127744&&e<=128511||e>=128640&&e<=128767||e>=129280&&e<=129535||e>=9728&&e<=9983||e>=9984&&e<=10175}(r)?r:e.slice(0,2).join("")},exports.getLayoutTheme=n=>{if("system"==n){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}return n},exports.hexToRgb=n=>{const{r:e,g:r,b:t}=p(n);return{r:e,g:r,b:t}},exports.hexToRgbaString=(n,e)=>{const{r:r,g:t,b:o,a:i}=p(n);return`rgba(${r}, ${t}, ${o}, ${e??i})`},exports.useConfigAction=()=>e.useContext(s),exports.useConfigState=u,exports.useTheme=()=>u().layoutConfig.theme;
|
package/dist/index.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as n,Fragment as e,jsxs as r}from"react/jsx-runtime";import t,{createContext as o,useContext as i,useState as l,useEffect as a}from"react";function d(n,e){void 0===e&&(e={});var r=e.insertAt;if(n&&"undefined"!=typeof document){var t=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===r&&t.firstChild?t.insertBefore(o,t.firstChild):t.appendChild(o),o.styleSheet?o.styleSheet.cssText=n:o.appendChild(document.createTextNode(n))}}var s="Layout-module_rootBackground__j3UVG";function u(n){return n}d("@layer base {\r\n html, body {\r\n padding: 0;\r\n margin: 0;\r\n border: 0;\r\n width: 100%; \r\n height: 100%;\r\n }\r\n #root { \r\n text-align: initial;\r\n width: 100%;\r\n height:100%\r\n } \r\n}\r\n*, *:before, *:after {\r\n box-sizing: border-box;\r\n}\r\n.Layout-module_rootBox__3JHjy {\r\n text-rendering: optimizeLegibility;\r\n -webkit-font-smoothing: antialiased;\r\n -moz-osx-font-smoothing: grayscale;\r\n text-align: initial;\r\n width: 100%;\r\n min-height: 100%;\r\n}\r\n.Layout-module_rootBackground__j3UVG {\r\n box-sizing: border-box; \r\n pointer-events: none;\r\n inset-block-start:0;\r\n inset-inline-start:0; \r\n width: 100%; \r\n min-width: 100vw;\r\n height:100%;\r\n min-height: 100vh;\r\n overflow: hidden;\r\n position: fixed;\r\n z-index: 0;\r\n}\r\n.Layout-module_rootBackground__j3UVG>div{\r\n width:100%;\r\n height: 100%;\r\n overflow: hidden;\r\n}\r\n.Layout-module_rootLayout__jVEEF {\r\n position: relative;\r\n z-index: 1;\r\n box-sizing: border-box; \r\n width: 100%;\r\n min-height: 100%;\r\n display: flex; \r\n flex-flow: row;\r\n background-color: transparent;\r\n container-type: inline-size;\r\n}\r\n\r\n.Layout-module_mainLayout__6W9W9 {\r\n box-sizing: border-box; \r\n display: flex;\r\n flex-flow: column; \r\n width: 100%;\r\n}\r\n");const c=Symbol("LayoutAside"),h=Symbol("LayoutContent"),m=Symbol("LayoutHeader"),g=Symbol("LayoutBackground"),y={headerHeight:50,asideWidth:260,layoutType:"leftMenu",collapsedPosition:"bottom",avatarPosition:"rightTop",theme:"system",visibleBreadcrumbIcon:"none",primaryColor:"#417ffb"},f=o({setLayoutConfig:()=>{},setLocale:()=>{}}),b=o({locale:"en-US",languages:[],layoutConfig:{},themeSkinMap:{tidy:[],rich:[]}}),x=()=>f,p=()=>b,_=()=>i(b),v=()=>i(f),w=()=>_().layoutConfig.theme;function L(r){return n("div",{className:s,children:n(e,{children:r.children})})}function k(r){return n(e,{children:r.children})}function z(r){return n(e,{children:r.children})}function E(r){return n(e,{children:r.children})}L.displayName="LayoutBackground",L.role=g,k.displayName="LayoutContent",k.role=h,z.displayName="LayoutAside",z.role=c,E.displayName="LayoutHeader",E.role=m;var B="layout-module_rootBox__Y8bEx",C="layout-module_rootLayout__TePvr",N="layout-module_mainLayout__a8Tb9";function T(o){let i=null,l=null,a=null,d=null;return t.Children.forEach(o.children,n=>{const e=n.type.role;e===m?i=n:e===h?l=n:e===c?a=n:e===g&&(d=n)}),n(e,{children:r("div",{ref:o.ref,className:B,style:{...o.style},children:[d,r("div",{className:C,children:[a,r("div",{className:N,children:[i,l]})]})]})})}function S(r){const o=!!document.fullscreenElement,[i,d]=l(o),s=()=>{d(!!document.fullscreenElement)},u=n=>{"F11"===n.code&&(n.preventDefault(),c())};a(()=>(document.addEventListener("fullscreenchange",s),document.addEventListener("keydown",u,!0),()=>{document.removeEventListener("fullscreenchange",s),document.removeEventListener("keydown",u)}),[]);const c=()=>{i?document.exitFullscreen():document.documentElement.requestFullscreen()};if(!r.buttons||r.buttons.length<2)return n(e,{});const[h,m]=r.buttons,g=i?h:m;return t.cloneElement(g,{onClick:n=>{console.log(n),c()}})}function j(n){if(!n)return"";const e=Array.from(n);if(0===e.length)return"";const r=e[0];return function(n){if(0===n.length)return!1;const e=n.codePointAt(0);return e>=19968&&e<=40959||e>=13312&&e<=19903||e>=12352&&e<=12543||e>=44032&&e<=55215||e>=65280&&e<=65519||e>=126976&&e<=129791||e>=127744&&e<=128511||e>=128640&&e<=128767||e>=129280&&e<=129535||e>=9728&&e<=9983||e>=9984&&e<=10175}(r)?r:e.slice(0,2).join("")}d("@layer base {\r\n html, body {\r\n padding: 0;\r\n margin: 0;\r\n border: 0;\r\n width: 100%; \r\n height: 100%;\r\n }\r\n #root { \r\n text-align: initial;\r\n width: 100%;\r\n height:100%\r\n } \r\n}\r\n*, *:before, *:after {\r\n box-sizing: border-box;\r\n}\r\n.layout-module_rootBox__Y8bEx {\r\n text-rendering: optimizeLegibility;\r\n -webkit-font-smoothing: antialiased;\r\n -moz-osx-font-smoothing: grayscale;\r\n text-align: initial;\r\n width: 100%;\r\n min-height: 100%;\r\n}\r\n.layout-module_rootBackground__vEs6e {\r\n box-sizing: border-box; \r\n pointer-events: none;\r\n inset-block-start:0;\r\n inset-inline-start:0; \r\n width: 100%; \r\n min-width: 100vw;\r\n height:100%;\r\n min-height: 100vh;\r\n overflow: hidden;\r\n position: fixed;\r\n z-index: 0;\r\n}\r\n.layout-module_rootBackground__vEs6e>div{\r\n width:100%;\r\n height: 100%;\r\n overflow: hidden;\r\n}\r\n.layout-module_rootLayout__TePvr {\r\n position: relative;\r\n z-index: 1;\r\n box-sizing: border-box; \r\n width: 100%;\r\n min-height: 100%;\r\n display: flex; \r\n flex-flow: row;\r\n background-color: transparent;\r\n container-type: inline-size;\r\n}\r\n\r\n.layout-module_mainLayout__a8Tb9 {\r\n box-sizing: border-box; \r\n display: flex;\r\n flex-flow: column; \r\n width: 100%;\r\n}\r\n"),T.Aside=z,T.Content=k,T.Header=E,T.Background=L;const A=n=>({r:parseInt(n.slice(1,3),16),g:parseInt(n.slice(3,5),16),b:parseInt(n.slice(5,7),16),a:9===n.length?(parseInt(n.slice(7,9),16)/255).toFixed(2):1}),F=n=>{const{r:e,g:r,b:t}=A(n);return{r:e,g:r,b:t}},H=(n,e)=>{const{r:r,g:t,b:o,a:i}=A(n);return`rgba(${r}, ${t}, ${o}, ${e??i})`},I=n=>{if("system"==n){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}return n};export{T as BaseLayout,S as FullScreenButton,L as LayoutBackground,x as createConfigActionContext,p as createConfigStateContext,y as defaultConfig,u as defineConfig,j as getAvatarInitials,I as getLayoutTheme,F as hexToRgb,H as hexToRgbaString,v as useConfigAction,_ as useConfigState,w as useTheme};
|
|
1
|
+
import{jsx as n,Fragment as e,jsxs as r}from"react/jsx-runtime";import t,{createContext as o,useContext as i,useState as l,useEffect as a}from"react";function d(n,e){void 0===e&&(e={});var r=e.insertAt;if(n&&"undefined"!=typeof document){var t=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===r&&t.firstChild?t.insertBefore(o,t.firstChild):t.appendChild(o),o.styleSheet?o.styleSheet.cssText=n:o.appendChild(document.createTextNode(n))}}var s="Layout-module_rootBackground__j3UVG";function u(n){return n}d("@layer base {\r\n html, body {\r\n padding: 0;\r\n margin: 0;\r\n border: 0;\r\n width: 100%; \r\n height: 100%;\r\n }\r\n #root { \r\n text-align: initial;\r\n width: 100%;\r\n height:100%\r\n } \r\n}\r\n*, *:before, *:after {\r\n box-sizing: border-box;\r\n}\r\n.Layout-module_rootBox__3JHjy {\r\n text-rendering: optimizeLegibility;\r\n -webkit-font-smoothing: antialiased;\r\n -moz-osx-font-smoothing: grayscale;\r\n text-align: initial;\r\n width: 100%;\r\n min-height: 100%;\r\n}\r\n.Layout-module_rootBackground__j3UVG {\r\n box-sizing: border-box; \r\n pointer-events: none;\r\n inset-block-start:0;\r\n inset-inline-start:0; \r\n width: 100%; \r\n min-width: 100vw;\r\n height:100%;\r\n min-height: 100vh;\r\n overflow: hidden;\r\n position: fixed;\r\n z-index: 0;\r\n}\r\n.Layout-module_rootBackground__j3UVG>div{\r\n width:100%;\r\n height: 100%;\r\n overflow: hidden;\r\n}\r\n.Layout-module_rootLayout__jVEEF {\r\n position: relative;\r\n z-index: 1;\r\n box-sizing: border-box; \r\n width: 100%;\r\n min-height: 100%;\r\n display: flex; \r\n flex-flow: row;\r\n background-color: transparent;\r\n container-type: inline-size;\r\n}\r\n\r\n.Layout-module_mainLayout__6W9W9 {\r\n box-sizing: border-box; \r\n display: flex;\r\n flex-flow: column; \r\n width: 100%;\r\n min-width: 0px;\r\n}\r\n");const c=Symbol("LayoutAside"),h=Symbol("LayoutContent"),m=Symbol("LayoutHeader"),g=Symbol("LayoutBackground"),y={headerHeight:50,asideWidth:260,layoutType:"leftMenu",collapsedPosition:"bottom",avatarPosition:"rightTop",theme:"system",visibleBreadcrumbIcon:"none",primaryColor:"#417ffb"},f=o({setLayoutConfig:()=>{},setLocale:()=>{}}),b=o({locale:"en-US",languages:[],layoutConfig:{},themeSkinMap:{tidy:[],rich:[]}}),x=()=>f,p=()=>b,_=()=>i(b),v=()=>i(f),w=()=>_().layoutConfig.theme;function L(r){return n("div",{className:s,children:n(e,{children:r.children})})}function k(r){return n(e,{children:r.children})}function z(r){return n(e,{children:r.children})}function E(r){return n(e,{children:r.children})}L.displayName="LayoutBackground",L.role=g,k.displayName="LayoutContent",k.role=h,z.displayName="LayoutAside",z.role=c,E.displayName="LayoutHeader",E.role=m;var B="layout-module_rootBox__Y8bEx",C="layout-module_rootLayout__TePvr",N="layout-module_mainLayout__a8Tb9";function T(o){let i=null,l=null,a=null,d=null;return t.Children.forEach(o.children,n=>{const e=n.type.role;e===m?i=n:e===h?l=n:e===c?a=n:e===g&&(d=n)}),n(e,{children:r("div",{ref:o.ref,className:B,style:{...o.style},children:[d,r("div",{className:C,children:[a,r("div",{className:N,children:[i,l]})]})]})})}function S(r){const o=!!document.fullscreenElement,[i,d]=l(o),s=()=>{d(!!document.fullscreenElement)},u=n=>{"F11"===n.code&&(n.preventDefault(),c())};a(()=>(document.addEventListener("fullscreenchange",s),document.addEventListener("keydown",u,!0),()=>{document.removeEventListener("fullscreenchange",s),document.removeEventListener("keydown",u)}),[]);const c=()=>{i?document.exitFullscreen():document.documentElement.requestFullscreen()};if(!r.buttons||r.buttons.length<2)return n(e,{});const[h,m]=r.buttons,g=i?h:m;return t.cloneElement(g,{onClick:n=>{console.log(n),c()}})}function j(n){if(!n)return"";const e=Array.from(n);if(0===e.length)return"";const r=e[0];return function(n){if(0===n.length)return!1;const e=n.codePointAt(0);return e>=19968&&e<=40959||e>=13312&&e<=19903||e>=12352&&e<=12543||e>=44032&&e<=55215||e>=65280&&e<=65519||e>=126976&&e<=129791||e>=127744&&e<=128511||e>=128640&&e<=128767||e>=129280&&e<=129535||e>=9728&&e<=9983||e>=9984&&e<=10175}(r)?r:e.slice(0,2).join("")}d("@layer base {\r\n html, body {\r\n padding: 0;\r\n margin: 0;\r\n border: 0;\r\n width: 100%; \r\n height: 100%;\r\n }\r\n #root { \r\n text-align: initial;\r\n width: 100%;\r\n height:100%\r\n } \r\n}\r\n*, *:before, *:after {\r\n box-sizing: border-box;\r\n}\r\n.layout-module_rootBox__Y8bEx {\r\n text-rendering: optimizeLegibility;\r\n -webkit-font-smoothing: antialiased;\r\n -moz-osx-font-smoothing: grayscale;\r\n text-align: initial;\r\n width: 100%;\r\n min-height: 100%;\r\n}\r\n.layout-module_rootBackground__vEs6e {\r\n box-sizing: border-box; \r\n pointer-events: none;\r\n inset-block-start:0;\r\n inset-inline-start:0; \r\n width: 100%; \r\n min-width: 100vw;\r\n height:100%;\r\n min-height: 100vh;\r\n overflow: hidden;\r\n position: fixed;\r\n z-index: 0;\r\n}\r\n.layout-module_rootBackground__vEs6e>div{\r\n width:100%;\r\n height: 100%;\r\n overflow: hidden;\r\n}\r\n.layout-module_rootLayout__TePvr {\r\n position: relative;\r\n z-index: 1;\r\n box-sizing: border-box; \r\n width: 100%;\r\n min-height: 100%;\r\n display: flex; \r\n flex-flow: row;\r\n background-color: transparent;\r\n container-type: inline-size;\r\n}\r\n\r\n.layout-module_mainLayout__a8Tb9 {\r\n box-sizing: border-box; \r\n display: flex;\r\n flex-flow: column; \r\n width: 100%;\r\n min-width: 0px;\r\n}\r\n"),T.Aside=z,T.Content=k,T.Header=E,T.Background=L;const A=n=>({r:parseInt(n.slice(1,3),16),g:parseInt(n.slice(3,5),16),b:parseInt(n.slice(5,7),16),a:9===n.length?(parseInt(n.slice(7,9),16)/255).toFixed(2):1}),F=n=>{const{r:e,g:r,b:t}=A(n);return{r:e,g:r,b:t}},H=(n,e)=>{const{r:r,g:t,b:o,a:i}=A(n);return`rgba(${r}, ${t}, ${o}, ${e??i})`},I=n=>{if("system"==n){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}return n};export{T as BaseLayout,S as FullScreenButton,L as LayoutBackground,x as createConfigActionContext,p as createConfigStateContext,y as defaultConfig,u as defineConfig,j as getAvatarInitials,I as getLayoutTheme,F as hexToRgb,H as hexToRgbaString,v as useConfigAction,_ as useConfigState,w as useTheme};
|