rox-react-components 0.0.9 → 0.0.11

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 +1 @@
1
- import{__extends as e,__assign as t}from"tslib";import{css as o}from"aphrodite/no-important";import l,{Component as r}from"react";import{createRoot as n}from"react-dom/client";import i from"./Inner.js";import a from"./dom.js";import u from"./styles.js";var d=function(r){function d(){var e=null!==r&&r.apply(this,arguments)||this;return e.state={},e}return e(d,r),d.show=function(e){d.el||(d.el=document.createElement("div"),a.addClass(d.el,o(u.fixed)),document.body.appendChild(d.el),n(d.el).render(l.createElement(d,t({},e,{children:null,visible:!0}))))},d.hide=function(){try{if(!d.el)return;document.body.removeChild(d.el),d.el=null}catch(e){d.el=null}},d.prototype.render=function(){var e=this.props,t=e.visible,r=e.bg,n=e.customLoading,a=e.loadingStyle,d=e.children;return l.createElement("div",{className:o(u.relative,u.w_full,u.h_full,u.border_box)},d,t&&(n||l.createElement("div",{className:o(u.absolute,u.top_0,u.left_0,u.w_full,u.h_full,u.z_99),style:{backgroundColor:r}},l.createElement(i,{style:a}))))},d.getDerivedStateFromProps=function(e,t){return null},d.prototype.getSnapshotBeforeUpdate=function(e,t){return null},d.prototype.componentDidUpdate=function(e,t,o){},d.prototype.componentWillUnmount=function(){d.hide()},d.defaultProps={visible:!0,bg:"rgba(0,0,0,.7)",customLoading:null,loadingStyle:{}},d.el=null,d}(r);export{d as default};
1
+ import{__extends as e,__assign as t}from"tslib";import{css as l}from"aphrodite/no-important";import o,{Component as r}from"react";import{createRoot as n}from"react-dom/client";import i from"./Inner.js";import u from"./dom.js";import a from"./styles.js";var d=function(r){function d(){var e=null!==r&&r.apply(this,arguments)||this;return e.state={},e}return e(d,r),d.show=function(e){d.el||(d.el=document.createElement("div"),u.addClass(d.el,l(a.fixed)),document.body.appendChild(d.el),n(d.el).render(o.createElement(d,t({},e,{children:null,visible:!0}))))},d.hide=function(){try{if(!d.el)return;document.body.removeChild(d.el),d.el=null}catch(e){d.el=null}},d.prototype.render=function(){var e=this.props,t=e.visible,r=e.bg,n=e.customLoading,u=e.loadingStyle,d=e.children;return o.createElement("div",{className:l(a.relative,a.w_full,a.h_full,a.border_box)},d,t?o.createElement("div",{className:l(a.absolute,a.top_0,a.left_0,a.w_full,a.h_full,a.z_99,a.center),style:{backgroundColor:r}},n||o.createElement(i,{style:u})):null)},d.getDerivedStateFromProps=function(e,t){return null},d.prototype.getSnapshotBeforeUpdate=function(e,t){return null},d.prototype.componentDidUpdate=function(e,t,l){},d.prototype.componentWillUnmount=function(){d.hide()},d.defaultProps={visible:!0,bg:"rgba(0,0,0,.7)",customLoading:null,loadingStyle:{}},d.el=null,d}(r);export{d as default};
@@ -1,5 +1,6 @@
1
1
  declare const styles: {
2
2
  relative: object;
3
+ center: object;
3
4
  absolute: object;
4
5
  top_0: object;
5
6
  left_0: object;
@@ -1 +1 @@
1
- import{StyleSheet as t}from"aphrodite/no-important";var e=t.create({relative:{position:"relative"},absolute:{position:"absolute"},top_0:{top:"0px"},left_0:{left:"0px"},w_full:{width:"100%"},h_full:{height:"100%"},border_box:{boxSizing:"border-box"},z_99:{zIndex:99},inner_box:{display:"flex",width:"100%",height:"100%",textAlign:"center",fontSize:"10px",alignItems:"center",justifyContent:"center"},inner_box_item:{height:"var(--height)",width:"var(--width)",margin:"var(--margin)",backgroundColor:"var(--bg)",animationName:[{"0%, 40%, 100%":{transform:"scaleY(0.4)","-webkit-transform":"scaleY(0.4)"},"20%":{transform:"scaleY(1.0)","-webkit-transform":"scaleY(1.0)"}}],animationDelay:"var(--delay)",animationDuration:"1.2s",animationIterationCount:"infinite"},fixed:{position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",top:"0",left:"0",width:"100%",height:"100%",zIndex:99}});export{e as default};
1
+ import{StyleSheet as t}from"aphrodite/no-important";var e=t.create({relative:{position:"relative"},center:{display:"flex",alignItems:"center",justifyContent:"center"},absolute:{position:"absolute"},top_0:{top:"0px"},left_0:{left:"0px"},w_full:{width:"100%"},h_full:{height:"100%"},border_box:{boxSizing:"border-box"},z_99:{zIndex:99},inner_box:{display:"flex",width:"100%",height:"100%",textAlign:"center",fontSize:"10px",alignItems:"center",justifyContent:"center"},inner_box_item:{height:"var(--height)",width:"var(--width)",margin:"var(--margin)",backgroundColor:"var(--bg)",animationName:[{"0%, 40%, 100%":{transform:"scaleY(0.4)","-webkit-transform":"scaleY(0.4)"},"20%":{transform:"scaleY(1.0)","-webkit-transform":"scaleY(1.0)"}}],animationDelay:"var(--delay)",animationDuration:"1.2s",animationIterationCount:"infinite"},fixed:{position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",top:"0",left:"0",width:"100%",height:"100%",zIndex:99}});export{e as default};
@@ -1 +1 @@
1
- import{__assign as e}from"tslib";import{css as t}from"aphrodite/no-important";import r,{createContext as n,useState as i,useEffect as a,useContext as c,useCallback as o}from"react";import l from"../Card/Card.js";import d from"./styles.js";var u={data:[],renderItem:function(){return null},onChange:function(){return null},subItemStyle:{paddingLeft:"25px"},activeStyle:{color:"skyblue"},active:"0",isMultipleExpand:!1,iconSize:"10px",iconStrokeWidth:"2px",iconColor:"#333"};function m(n){var i=e(e({},u),n),a=i.iconSize,c=i.iconStrokeWidth,o=i.iconColor,l=i.down;return r.createElement("div",{style:{"--size":a,"--strokeWidth":c,"--color":o},className:"".concat(t(d.arrow_right)," ").concat(l?t(d.arrow_down):"")})}var s=n({active:"0",changeActive:function(){return null}}),v=function(n){var h=e(e({},u),n),f=h.renderItem,p=h.item,y=h.subItemStyle,g=h.index,E=h.isMultipleExpand,x=h.icon,A=h.activeIcon,b=i(!1),S=b[0],C=b[1],k=c(s),w=k.active,I=k.changeActive,W=o((function(e){e.stopPropagation(),I(g),h.onChange(p,g),p.children&&Array.isArray(p.children)&&C((function(e){return!e}))}),[I,g,p]);return a((function(){if(void 0!==w){var e=w.split("-"),t=g.split("-");w.startsWith(g)&&e.length>t.length&&g.length<w.length?C(!0):w.startsWith(g)&&g.startsWith(w)||E||C(!1)}}),[w,g]),r.createElement("div",{className:t(d.w_full,d.border_box),onClick:W},r.createElement("div",{className:t(d.item)},f(p)," ",Array.isArray(p.children)&&p.children.length?S?A||r.createElement(m,{down:!0}):x||r.createElement(m,null):null),Array.isArray(p.children)?p.children.map((function(n,i){return r.createElement("div",{key:i,className:t(d.w_full,d.border_box),style:e(e({},u.subItemStyle),y)},r.createElement(l,{expand:S},r.createElement(v,e({},h,{index:g+"-"+i,item:n}))))})):null)},h=function(t){var n=e(e({},u),t),c=i(n.active),o=c[0],l=c[1];return a((function(){if(n.data.length&&void 0!==n.active){var e=n.active.split("-").map((function(e){return Number(e)})),t=n.data,r={};e.forEach((function(e){Array.isArray(t)&&(r=t[e]||{},t=r.children)})),n.onChange(r,n.active)}l(n.active)}),[n.active,n.data]),r.createElement(s.Provider,{value:{active:o,changeActive:l}},n.data.map((function(t,i){return r.createElement(v,e({key:i,index:i.toString()},n,{item:t}))})))};export{h as default};
1
+ import{__assign as e}from"tslib";import{css as t}from"aphrodite/no-important";import r,{createContext as n,useState as i,useEffect as a,useContext as c,useCallback as o}from"react";import l from"../Card/Card.js";import d from"./styles.js";var u={data:[],renderItem:function(){return null},onChange:function(){return null},subItemStyle:{paddingLeft:"25px"},activeStyle:{color:"skyblue"},active:"0",isMultipleExpand:!1,iconSize:"10px",iconStrokeWidth:"2px",iconColor:"#333"};function m(n){var i=e(e({},u),n),a=i.iconSize,c=i.iconStrokeWidth,o=i.iconColor,l=i.down;return r.createElement("div",{style:{"--size":a,"--strokeWidth":c,"--color":o},className:"".concat(t(d.arrow_right)," ").concat(l?t(d.arrow_down):"")})}var s=n({active:"0",changeActive:function(){return null}}),v=function(n){var h=e(e({},u),n),f=h.renderItem,p=h.item,y=h.subItemStyle,g=h.index,E=h.isMultipleExpand,x=h.icon,A=h.activeIcon,b=i(!1),S=b[0],C=b[1],k=c(s),w=k.active,I=k.changeActive,W=o((function(e){e.stopPropagation(),I(g),h.onChange(p,g),p.children&&Array.isArray(p.children)&&C((function(e){return!e}))}),[I,g,p]);return a((function(){if(void 0!==w){var e=w.split("-"),t=g.split("-");w.startsWith(g)&&e.length>t.length&&g.length<w.length?C(!0):w.startsWith(g)&&g.startsWith(w)||E||C(!1)}}),[w,g]),r.createElement("div",{className:t(d.w_full,d.border_box),onClick:W},r.createElement("div",{className:t(d.item)},f(p)," ",Array.isArray(p.children)&&p.children.length?S?A||r.createElement(m,e({},h,{down:!0})):x||r.createElement(m,e({},h)):null),Array.isArray(p.children)?p.children.map((function(n,i){return r.createElement("div",{key:i,className:t(d.w_full,d.border_box),style:e(e({},u.subItemStyle),y)},r.createElement(l,{expand:S},r.createElement(v,e({},h,{index:g+"-"+i,item:n}))))})):null)},h=function(t){var n=e(e({},u),t),c=i(n.active),o=c[0],l=c[1];return a((function(){if(n.data.length&&void 0!==n.active){var e=n.active.split("-").map((function(e){return Number(e)})),t=n.data,r={};e.forEach((function(e){Array.isArray(t)&&(r=t[e]||{},t=r.children)})),n.onChange(r,n.active)}l(n.active)}),[n.active,n.data]),r.createElement(s.Provider,{value:{active:o,changeActive:l}},n.data.map((function(t,i){return r.createElement(v,e({key:i,index:i.toString()},n,{item:t}))})))};export{h as default};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("aphrodite/no-important"),l=require("react"),r=require("react-dom/client"),n=require("./Inner.js"),o=require("./dom.js"),u=require("./styles.js"),a=function(a){function d(){var e=null!==a&&a.apply(this,arguments)||this;return e.state={},e}return e.__extends(d,a),d.show=function(n){d.el||(d.el=document.createElement("div"),o.default.addClass(d.el,t.css(u.default.fixed)),document.body.appendChild(d.el),r.createRoot(d.el).render(l.createElement(d,e.__assign({},n,{children:null,visible:!0}))))},d.hide=function(){try{if(!d.el)return;document.body.removeChild(d.el),d.el=null}catch(e){d.el=null}},d.prototype.render=function(){var e=this.props,r=e.visible,o=e.bg,a=e.customLoading,d=e.loadingStyle,i=e.children;return l.createElement("div",{className:t.css(u.default.relative,u.default.w_full,u.default.h_full,u.default.border_box)},i,r&&(a||l.createElement("div",{className:t.css(u.default.absolute,u.default.top_0,u.default.left_0,u.default.w_full,u.default.h_full,u.default.z_99),style:{backgroundColor:o}},l.createElement(n.default,{style:d}))))},d.getDerivedStateFromProps=function(e,t){return null},d.prototype.getSnapshotBeforeUpdate=function(e,t){return null},d.prototype.componentDidUpdate=function(e,t,l){},d.prototype.componentWillUnmount=function(){d.hide()},d.defaultProps={visible:!0,bg:"rgba(0,0,0,.7)",customLoading:null,loadingStyle:{}},d.el=null,d}(l.Component);exports.default=a;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("aphrodite/no-important"),l=require("react"),r=require("react-dom/client"),n=require("./Inner.js"),u=require("./dom.js"),o=require("./styles.js"),a=function(a){function d(){var e=null!==a&&a.apply(this,arguments)||this;return e.state={},e}return e.__extends(d,a),d.show=function(n){d.el||(d.el=document.createElement("div"),u.default.addClass(d.el,t.css(o.default.fixed)),document.body.appendChild(d.el),r.createRoot(d.el).render(l.createElement(d,e.__assign({},n,{children:null,visible:!0}))))},d.hide=function(){try{if(!d.el)return;document.body.removeChild(d.el),d.el=null}catch(e){d.el=null}},d.prototype.render=function(){var e=this.props,r=e.visible,u=e.bg,a=e.customLoading,d=e.loadingStyle,i=e.children;return l.createElement("div",{className:t.css(o.default.relative,o.default.w_full,o.default.h_full,o.default.border_box)},i,r?l.createElement("div",{className:t.css(o.default.absolute,o.default.top_0,o.default.left_0,o.default.w_full,o.default.h_full,o.default.z_99,o.default.center),style:{backgroundColor:u}},a||l.createElement(n.default,{style:d})):null)},d.getDerivedStateFromProps=function(e,t){return null},d.prototype.getSnapshotBeforeUpdate=function(e,t){return null},d.prototype.componentDidUpdate=function(e,t,l){},d.prototype.componentWillUnmount=function(){d.hide()},d.defaultProps={visible:!0,bg:"rgba(0,0,0,.7)",customLoading:null,loadingStyle:{}},d.el=null,d}(l.Component);exports.default=a;
@@ -1,5 +1,6 @@
1
1
  declare const styles: {
2
2
  relative: object;
3
+ center: object;
3
4
  absolute: object;
4
5
  top_0: object;
5
6
  left_0: object;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("aphrodite/no-important").StyleSheet.create({relative:{position:"relative"},absolute:{position:"absolute"},top_0:{top:"0px"},left_0:{left:"0px"},w_full:{width:"100%"},h_full:{height:"100%"},border_box:{boxSizing:"border-box"},z_99:{zIndex:99},inner_box:{display:"flex",width:"100%",height:"100%",textAlign:"center",fontSize:"10px",alignItems:"center",justifyContent:"center"},inner_box_item:{height:"var(--height)",width:"var(--width)",margin:"var(--margin)",backgroundColor:"var(--bg)",animationName:[{"0%, 40%, 100%":{transform:"scaleY(0.4)","-webkit-transform":"scaleY(0.4)"},"20%":{transform:"scaleY(1.0)","-webkit-transform":"scaleY(1.0)"}}],animationDelay:"var(--delay)",animationDuration:"1.2s",animationIterationCount:"infinite"},fixed:{position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",top:"0",left:"0",width:"100%",height:"100%",zIndex:99}});exports.default=e;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("aphrodite/no-important").StyleSheet.create({relative:{position:"relative"},center:{display:"flex",alignItems:"center",justifyContent:"center"},absolute:{position:"absolute"},top_0:{top:"0px"},left_0:{left:"0px"},w_full:{width:"100%"},h_full:{height:"100%"},border_box:{boxSizing:"border-box"},z_99:{zIndex:99},inner_box:{display:"flex",width:"100%",height:"100%",textAlign:"center",fontSize:"10px",alignItems:"center",justifyContent:"center"},inner_box_item:{height:"var(--height)",width:"var(--width)",margin:"var(--margin)",backgroundColor:"var(--bg)",animationName:[{"0%, 40%, 100%":{transform:"scaleY(0.4)","-webkit-transform":"scaleY(0.4)"},"20%":{transform:"scaleY(1.0)","-webkit-transform":"scaleY(1.0)"}}],animationDelay:"var(--delay)",animationDuration:"1.2s",animationIterationCount:"infinite"},fixed:{position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",top:"0",left:"0",width:"100%",height:"100%",zIndex:99}});exports.default=e;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("aphrodite/no-important"),n=require("react"),r=require("../Card/Card.js"),a=require("./styles.js"),i={data:[],renderItem:function(){return null},onChange:function(){return null},subItemStyle:{paddingLeft:"25px"},activeStyle:{color:"skyblue"},active:"0",isMultipleExpand:!1,iconSize:"10px",iconStrokeWidth:"2px",iconColor:"#333"};function c(r){var c=e.__assign(e.__assign({},i),r),l=c.iconSize,s=c.iconStrokeWidth,o=c.iconColor,u=c.down;return n.createElement("div",{style:{"--size":l,"--strokeWidth":s,"--color":o},className:"".concat(t.css(a.default.arrow_right)," ").concat(u?t.css(a.default.arrow_down):"")})}var l=n.createContext({active:"0",changeActive:function(){return null}}),s=function(o){var u=e.__assign(e.__assign({},i),o),d=u.renderItem,f=u.item,v=u.subItemStyle,h=u.index,m=u.isMultipleExpand,_=u.icon,g=u.activeIcon,p=n.useState(!1),y=p[0],x=p[1],E=n.useContext(l),b=E.active,A=E.changeActive,C=n.useCallback((function(e){e.stopPropagation(),A(h),u.onChange(f,h),f.children&&Array.isArray(f.children)&&x((function(e){return!e}))}),[A,h,f]);return n.useEffect((function(){if(void 0!==b){var e=b.split("-"),t=h.split("-");b.startsWith(h)&&e.length>t.length&&h.length<b.length?x(!0):b.startsWith(h)&&h.startsWith(b)||m||x(!1)}}),[b,h]),n.createElement("div",{className:t.css(a.default.w_full,a.default.border_box),onClick:C},n.createElement("div",{className:t.css(a.default.item)},d(f)," ",Array.isArray(f.children)&&f.children.length?y?g||n.createElement(c,{down:!0}):_||n.createElement(c,null):null),Array.isArray(f.children)?f.children.map((function(c,l){return n.createElement("div",{key:l,className:t.css(a.default.w_full,a.default.border_box),style:e.__assign(e.__assign({},i.subItemStyle),v)},n.createElement(r.default,{expand:y},n.createElement(s,e.__assign({},u,{index:h+"-"+l,item:c}))))})):null)};exports.default=function(t){var r=e.__assign(e.__assign({},i),t),a=n.useState(r.active),c=a[0],o=a[1];return n.useEffect((function(){if(r.data.length&&void 0!==r.active){var e=r.active.split("-").map((function(e){return Number(e)})),t=r.data,n={};e.forEach((function(e){Array.isArray(t)&&(n=t[e]||{},t=n.children)})),r.onChange(n,r.active)}o(r.active)}),[r.active,r.data]),n.createElement(l.Provider,{value:{active:c,changeActive:o}},r.data.map((function(t,a){return n.createElement(s,e.__assign({key:a,index:a.toString()},r,{item:t}))})))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("aphrodite/no-important"),n=require("react"),a=require("../Card/Card.js"),r=require("./styles.js"),i={data:[],renderItem:function(){return null},onChange:function(){return null},subItemStyle:{paddingLeft:"25px"},activeStyle:{color:"skyblue"},active:"0",isMultipleExpand:!1,iconSize:"10px",iconStrokeWidth:"2px",iconColor:"#333"};function s(a){var s=e.__assign(e.__assign({},i),a),c=s.iconSize,l=s.iconStrokeWidth,o=s.iconColor,u=s.down;return n.createElement("div",{style:{"--size":c,"--strokeWidth":l,"--color":o},className:"".concat(t.css(r.default.arrow_right)," ").concat(u?t.css(r.default.arrow_down):"")})}var c=n.createContext({active:"0",changeActive:function(){return null}}),l=function(o){var u=e.__assign(e.__assign({},i),o),d=u.renderItem,f=u.item,_=u.subItemStyle,v=u.index,g=u.isMultipleExpand,h=u.icon,m=u.activeIcon,p=n.useState(!1),y=p[0],x=p[1],E=n.useContext(c),b=E.active,A=E.changeActive,C=n.useCallback((function(e){e.stopPropagation(),A(v),u.onChange(f,v),f.children&&Array.isArray(f.children)&&x((function(e){return!e}))}),[A,v,f]);return n.useEffect((function(){if(void 0!==b){var e=b.split("-"),t=v.split("-");b.startsWith(v)&&e.length>t.length&&v.length<b.length?x(!0):b.startsWith(v)&&v.startsWith(b)||g||x(!1)}}),[b,v]),n.createElement("div",{className:t.css(r.default.w_full,r.default.border_box),onClick:C},n.createElement("div",{className:t.css(r.default.item)},d(f)," ",Array.isArray(f.children)&&f.children.length?y?m||n.createElement(s,e.__assign({},u,{down:!0})):h||n.createElement(s,e.__assign({},u)):null),Array.isArray(f.children)?f.children.map((function(s,c){return n.createElement("div",{key:c,className:t.css(r.default.w_full,r.default.border_box),style:e.__assign(e.__assign({},i.subItemStyle),_)},n.createElement(a.default,{expand:y},n.createElement(l,e.__assign({},u,{index:v+"-"+c,item:s}))))})):null)};exports.default=function(t){var a=e.__assign(e.__assign({},i),t),r=n.useState(a.active),s=r[0],o=r[1];return n.useEffect((function(){if(a.data.length&&void 0!==a.active){var e=a.active.split("-").map((function(e){return Number(e)})),t=a.data,n={};e.forEach((function(e){Array.isArray(t)&&(n=t[e]||{},t=n.children)})),a.onChange(n,a.active)}o(a.active)}),[a.active,a.data]),n.createElement(c.Provider,{value:{active:s,changeActive:o}},a.data.map((function(t,r){return n.createElement(l,e.__assign({key:r,index:r.toString()},a,{item:t}))})))};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rox-react-components",
3
- "version": "0.0.9",
3
+ "version": "0.0.11",
4
4
  "main": "dist/lib/index.js",
5
5
  "module": "dist/es/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -16,6 +16,8 @@
16
16
  "mobile carousel",
17
17
  "ps carousel",
18
18
  "menu",
19
+ "loading",
20
+ "container with ratio",
19
21
  "react swiper carousel pc mobile touch mouse"
20
22
  ],
21
23
  "files": [