amotify 0.3.26 → 0.3.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -20,9 +20,22 @@ declare namespace RootViewController {
|
|
|
20
20
|
fn: FNs;
|
|
21
21
|
};
|
|
22
22
|
type Base = Box.DefaultInput & {
|
|
23
|
+
/**
|
|
24
|
+
* @deprecated Use `topNav` instead
|
|
25
|
+
*/
|
|
23
26
|
topNavigation?: ReactElement;
|
|
27
|
+
/**
|
|
28
|
+
* @deprecated Use `leftNav` instead
|
|
29
|
+
*/
|
|
24
30
|
sideNavigation?: ReactElement;
|
|
31
|
+
/**
|
|
32
|
+
* @deprecated Use `footerNav` instead
|
|
33
|
+
*/
|
|
25
34
|
footerNavigation?: ReactElement;
|
|
35
|
+
topNav?: ReactElement;
|
|
36
|
+
leftNav?: ReactElement;
|
|
37
|
+
rightNav?: ReactElement;
|
|
38
|
+
footerNav?: ReactElement;
|
|
26
39
|
};
|
|
27
40
|
type Button = Button.Input<ButtonTypes.ClearColors> & {
|
|
28
41
|
path?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as
|
|
1
|
+
import{b as g,c as y,d as c}from"../chunk-C5N2D3ZX.js";import{jsx as h,jsxs as _}from"react/jsx-runtime";import{useState as P,useEffect as x}from"react";import a,{UUID as w}from"jmini";import{$$fromRoot as m,Config as A,pageRouter as E}from"../@utils";import{Box as R,Flex as B,Column as T}from"../atoms";import{Button as V}from"./Button";import{LayoutClasses as N}from"../@styles/componentClasses";const t={Base:o=>{let u=o,{topNavigation:i,sideNavigation:e,footerNavigation:r,topNav:l,leftNav:s,rightNav:f,footerNav:v,children:d,className:n}=u,p=c(u,["topNavigation","sideNavigation","footerNavigation","topNav","leftNav","rightNav","footerNav","children","className"]);x(()=>{t.fn.updateCSSProperty.reset(),setTimeout(()=>{t.fn.updateCSSProperty.reset()},100);let C="ResizeCB",H="RemovePageEventCB";return a(window).onEvent("resize",()=>{A.get().screen.isPhonepoint()||a.interval.once(()=>{t.fn.updateCSSProperty.reset()},300,"__RVC_calcHeights")},{eventID:C}),()=>{a(window).removeEvent(H),a(window).removeEvent(C)}},[]);let S=d;return _(T,y(g({className:[n,N("RootViewController")].join(" "),backgroundColor:"layer.1",gap:0,minHeight:"viewHeight"},p),{children:[l||i,_(B,{className:N("Body"),flexWrap:!1,position:"relative",flexSizing:0,children:[s||e,h(R,{className:N("Content"),position:"relative",flexSizing:0,width:0,children:S}),f]}),v||r]}))},TopNavigation:o=>{let s=o,{className:i,children:e}=s,r=c(s,["className","children"]),[l]=P(w());return x(()=>{t.fn.updateCSSProperty.topNav()},[]),h(B,y(g({"data-id":l,flexSizing:"none",flexType:"col",position:"sticky",top:0,backgroundColor:"layer.1"},r),{id:"__RVC_TopNavigation",className:[i,N("TopNav")].join(" "),children:e}),l)},SideNavigation:o=>{let r=o,{className:i=""}=r,e=c(r,["className"]);return x(()=>{t.fn.updateCSSProperty.sideNav()},[]),h(R,y(g({className:[i,N("SideNav")].join(" "),flexSizing:"none",minHeight:"sideNavigationHeight"},e),{id:"__RVC_SideNavigation"}))},FooterNavigation:o=>{let s=o,{className:i="",baseStyles:e}=s,r=c(s,["className","baseStyles"]),[l]=P(w());return x(()=>{t.fn.updateCSSProperty.footer()},[]),h(B,y(g({"data-id":l,borderTop:!0,position:"sticky",bottom:0,overflow:"auto",backgroundColor:"layer.1",paddingBottom:"safeAreaBottom"},e),{id:"__RVC_FooterNavigation",className:[N("FooterNav"),i].join(" "),children:h(B,g({gap:1,flexWrap:!1,padding:"2/3",margin:"auto",width:1},r))}))},Comps:{Button:o=>{let d=o,{isActive:i,path:e,pathGroup:r,currentPath:l}=d,s=c(d,["isActive","path","pathGroup","currentPath"]),f=a.Arrayify(r),v=l||location.pathname;{let n=!1;a.scope(()=>{a.isString(e)&&(a.isNullish(e)||(n=v.replace(/^\//,"").replace(/\/$/,"")==e.replace(/^\//,"").replace(/\/$/,"")))}),a.scope(()=>{if(!n&&f.length)for(let p of f){if(n)break;a.isNullish(p)||(a.isString(p)&&(p=String(p).escapeRegExChar()),v.match(new RegExp(p))&&(n=!0))}}),i=i!=null?i:n}return h(V.Clear,g({isActive:i,isActiveStyles:{fontColor:"theme",backgroundColor:"cloud"},onClick:n=>{a.isExist(e)&&a.isString(e)&&E.push(e,n.ctrlKey||n.metaKey)},color:"cloud",padding:["3/4",1],display:"flex",gap:"1/2",fontColor:"inherit",flexSizing:"none",flexWrap:!1,ssEffectsOnActive:"ripple.cloud",verticalAlign:"center",textAlign:"left",isSemiBoldFont:!0},s))},Bar:o=>h(R,g({flexSizing:"none",backgroundColor:"layer.4.opa.middle",unitHeight:"1/3",margin:["2/3",1],isRounded:!0},o)),Title:o=>h(R,g({fontSize:"3.paragraph",isSemiBoldFont:!0,padding:[0,1]},o))},fn:{updateCSSProperty:{topNav:()=>{let o=a(document.body),i=m("#__RVC_TopNavigation"),e=i.position().height||0,r=e;i.getStyleProperty("position")!="sticky"&&(r=0),t.fn.topNavHeight=e,t.fn.topBase=r,o.setStyleProperty("--topNavHeight",e+"px").setStyleProperty("--topBase",r+"px")},footer:()=>{let o=a(document.body),e=m("#__RVC_FooterNavigation").position().height||0;t.fn.footerNavHeight=e,o.setStyleProperty("--footerNavHeight",e+"px")},sideNav:()=>{let o=a(document.body),e=m("#__RVC_SideNavigation").position().width||0;t.fn.sideNavHeight=e,o.setStyleProperty("--sideNavWidth",e+"px")},reset:()=>{let o=a(document.body),i=m("#__RVC_TopNavigation"),e=m("#__RVC_FooterNavigation"),r=m("#__RVC_SideNavigation"),l=i.position().height||0,s=l,f=e.position().height||0,v=r.position().width||0;i.getStyleProperty("position")!="sticky"&&(s=0);let d=window.innerHeight,n=window.innerWidth,p=d-l-f,S=n-v;t.fn.viewHeight=d,t.fn.viewWidth=n,t.fn.contentHeight=p,t.fn.contentWidth=S,t.fn.topBase=s,t.fn.sideNavHeight=v,t.fn.topNavHeight=l,t.fn.footerNavHeight=f;{let u=getComputedStyle(document.documentElement),C=u.getPropertyValue("--safe-area-top"),H=u.getPropertyValue("--safe-area-bottom"),b=u.getPropertyValue("--safe-area-left"),F=u.getPropertyValue("--safe-area-right");t.fn.safeAreaTop=parseInt(C,10)||0,t.fn.safeAreaBottom=parseInt(H,10)||0,t.fn.safeAreaLeft=parseInt(b,10)||0,t.fn.safeAreaRight=parseInt(F,10)||0}o.setStyleProperty("--viewHeight",d+"px").setStyleProperty("--viewWidth",n+"px").setStyleProperty("--contentHeight",p+"px").setStyleProperty("--contentWidth",S+"px").setStyleProperty("--topBase",s+"px").setStyleProperty("--topNavHeight",l+"px").setStyleProperty("--footerNavHeight",f+"px").setStyleProperty("--sideNavHeight",p+"px")}},viewHeight:0,viewWidth:0,contentHeight:0,contentWidth:0,topBase:0,sideNavHeight:0,topNavHeight:0,footerNavHeight:0,safeAreaTop:0,safeAreaBottom:0,safeAreaLeft:0,safeAreaRight:0}};export{t as RootViewController,t as default};
|
package/dist/mols/Accordion.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { ReactElement } from '../@declares';
|
|
2
|
+
import { ReactElement, StyleProps } from '../@declares';
|
|
3
3
|
import { Box } from '../atoms';
|
|
4
4
|
declare namespace Accordion {
|
|
5
5
|
type Input = Box.DefaultInput & {
|
|
@@ -7,7 +7,12 @@ declare namespace Accordion {
|
|
|
7
7
|
override?: boolean;
|
|
8
8
|
accordionID?: string;
|
|
9
9
|
slideAnimation?: 'none' | 'fast' | 'slow';
|
|
10
|
+
wrapperStyles?: StyleProps.BasicElement;
|
|
10
11
|
children: ReactElement;
|
|
12
|
+
onLabelRender?: React.FC<{
|
|
13
|
+
isOpen: boolean;
|
|
14
|
+
onToggle(): void;
|
|
15
|
+
}>;
|
|
11
16
|
onToggleEvent?: {
|
|
12
17
|
(open: boolean): void;
|
|
13
18
|
};
|
package/dist/mols/Accordion.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as
|
|
1
|
+
import{b as l,c as b,d as H}from"../chunk-C5N2D3ZX.js";import{jsx as A,jsxs as L}from"react/jsx-runtime";import d,{UUID as w,useStore as c}from"jmini";import{useState as p,useEffect as y,useRef as B}from"react";import{$$fromRoot as f}from"../@utils";import{Box as E,Column as S}from"../atoms";import{AccordionClasses as N}from"../@styles/componentClasses";const $=o=>{o=l({},o);let C=o,{accordionID:e="",slideAnimation:I="fast",defaultOpen:g=!1,override:F=!1,onLabelRender:x,onToggleEvent:O,wrapperStyles:a}=C,T=H(C,["accordionID","slideAnimation","defaultOpen","override","onLabelRender","onToggleEvent","wrapperStyles"]),[m]=p(w()),[u]=p(w()),[i,s]=p(g),[h,D]=p(0);F&&i!=g&&s(g);const R=B(!1);return y(()=>{d.scope(()=>{let t=f('[data-accordion-content-id="'+u+'"]')[0];if(!t)return;let r=t.offsetHeight,n=0;I=="fast"?(n=r/1e3,n=Math.max(n,.2)):I=="slow"&&(n=r/300),D(r),f("#"+m).css({transition:n+"s"})}),d.scope(()=>{e&&c.set({["Accordion-"+e]:{open:()=>{s(!0)},close:()=>{s(!1)},toggle:()=>{s(t=>!t)}}})})},[]),c.update({["Accordion-"+e]:{isOpen:!!i}}),y(()=>{let t=f("#"+m),r=f('[data-accordion-content-id="'+u+'"]')[0];R.current||(R.current=!0),d.scope(()=>{if(!r||d.isNullish(h))return;O&&O(i);let n=r.offsetHeight;h!=n&&D(n),h&&t.css({maxHeight:n+1+"px"}).await(100),i?t.css({maxHeight:"unset",overflow:(o==null?void 0:o.overflow)||"unset"}):t.css({maxHeight:"0px",overflow:"hidden"})})},[i]),L(S,b(l({gap:0},a),{className:[N("Wrap"),(a==null?void 0:a.className)||""].join(" "),children:[x&&A(x,{isOpen:i,onToggle:()=>{s(t=>!t)}}),A(E,{id:m,className:N("Open_"+i),children:A(E,l({"data-accordion-content-id":u},T))})]}))},v=$;v.fn={open:o=>{let e=c.get("Accordion-"+o);!e||e.open()},close:o=>{let e=c.get("Accordion-"+o);!e||e.close()},toggle:o=>{let e=c.get("Accordion-"+o);!e||e.toggle()},isOpen:o=>{let e=c.get("Accordion-"+o);if(e)return e.isOpen}};export{v as Accordion,v as default};
|