jclib-ui 1.1.2 → 1.1.3
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/jclib-ui.umd.js
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
border-radius: 99px;
|
|
19
19
|
pointer-events: none;
|
|
20
20
|
z-index: 9999999;
|
|
21
|
-
`,y=" 🔴 ",k=" 🟢 ";function _(){t.useEffect(()=>{("localhost"==window.location.hostname||"127.0.0.1"==window.location.hostname||"[::1]"==window.location.hostname||window.location.hostname.startsWith("192.168."))&&!document.title.includes(y)&&(document.title=`${y}${document.title}`)},[])}function C(e){function r(){const t=e?[].concat(e):["test.","test-"];return Boolean(t.some(e=>window.location.hostname.includes(e)))}if(t.useEffect(()=>{r()&&!document.title.includes(k)&&(document.title=`${k}${document.title}`)},[e]),r()&&n.isMobile())return b.jsx(x,{})}const j=t.createContext({modalList:[],theme:"light",toggleTheme:()=>{},versionApp:"",addModal:(e,t)=>{},removeModal:e=>{},clearModals:()=>{},showBtnTop:!1,setShowBtnTop:()=>{},globalApiConfig:null,setTheme:()=>{},canChangeTheme:!1,reportType:0,setReportType:e=>{}}),w="sys/theme";function S(){const e=t.useContext(j);if(!(null==e?void 0:e.addModal))throw new Error("'ModalProvider' não encontrado!");return e}const E=1,N=2,A=3,T="jc-alert-hide-sb";function I({type:e=N,onConfirm:o,onCancel:i,title:a,text:s="",children:l,defaultBtn:u=2}){const c=t.useRef(),d=t.useRef(),{addModal:p,removeModal:h}=S(),[f]=t.useState("alert-"+n.random()),m=r.useDragControls();let g="jc-erro";switch(e){case N:g="jc-aviso";break;case A:g="jc-conf"}const v=t.useCallback(t=>{e===A&&("KeyS"===t.code&&o&&o(),"KeyN"===t.code&&i&&i())},[i,o,e]);return t.useEffect(()=>(p(f,e===A?i:o),()=>h(f)),[]),t.useEffect(()=>{var e;null==(e=null==c?void 0:c.current)||e.focus()},[c]),t.useEffect(()=>(document.addEventListener("keydown",v,!1),document.body.classList.add(T),()=>{document.removeEventListener("keydown",v,!1),document.body.classList.remove(T)}),[v]),b.jsx(r.motion.div,{className:"jc-alert--container",ref:d,children:b.jsxs(r.motion.div,{className:"jc-alert "+g,drag:!0,dragConstraints:d,dragElastic:.1,dragMomentum:!1,dragControls:m,dragListener:!1,animate:{scale:1},transition:{ease:"easeOut",duration:.3},children:[b.jsx("div",{className:"jc-close-button",onClick:function(){e===A?i():o()},children:b.jsx("i",{className:"fa-solid fa-xmark"})}),b.jsxs("div",{className:"jc-alert-header",onPointerDown:function(e){n.isMobile()||m.start(e)},children:[b.jsxs("div",{className:"icon",children:[e===N&&b.jsx("i",{className:"fa-solid fa-check"}),e===E&&b.jsx("i",{className:"fa-solid fa-triangle-exclamation"}),e===A&&b.jsx("i",{className:"fas fa-question"})]}),b.jsx("div",{className:"jc-alert-title",children:a})]}),b.jsx("div",{className:"jc-alert-body",children:s&&"string"==typeof s?b.jsx("span",{children:s.split("\n").map((e,n,r)=>b.jsxs(t.Fragment,{children:[e,n<r.length-1&&b.jsx("br",{})]},n))}):b.jsx(b.Fragment,{children:s||l})}),b.jsxs("div",{className:"jc-alert-buttons",children:[(e===E||e===N)&&b.jsx("button",{ref:c,type:"button",className:"btn btn-confirm",onClick:o,children:"OK"}),e===A&&b.jsxs(b.Fragment,{children:[b.jsxs("button",{type:"button",className:"btn btn-confirm",onClick:o,tabIndex:99,ref:1===u?c:null,children:[b.jsx("u",{children:"S"}),"im"]}),b.jsxs("button",{type:"button",className:"btn btn-confirm btn-nao",onClick:i,tabIndex:98,ref:2===u?c:null,children:[b.jsx("u",{children:"N"}),"ão"]})]})]})]})})}function F({onConfirm:e,text:t="",children:n}){return b.jsx(I,{type:E,title:"Atenção!",text:t,onConfirm:e,children:n})}const D={baseURL:"",timeout:3e4,auth:{username:"",password:"",header:"x-auth",prefix:"Bearer"},version:"",ident:"",loginRoute:"/",refreshRoute:"",isProductionMode:!0,withCredentials:!1,getToken:()=>"",
|
|
21
|
+
`,y=" 🔴 ",k=" 🟢 ";function _(){t.useEffect(()=>{("localhost"==window.location.hostname||"127.0.0.1"==window.location.hostname||"[::1]"==window.location.hostname||window.location.hostname.startsWith("192.168."))&&!document.title.includes(y)&&(document.title=`${y}${document.title}`)},[])}function C(e){function r(){const t=e?[].concat(e):["test.","test-"];return Boolean(t.some(e=>window.location.hostname.includes(e)))}if(t.useEffect(()=>{r()&&!document.title.includes(k)&&(document.title=`${k}${document.title}`)},[e]),r()&&n.isMobile())return b.jsx(x,{})}const j=t.createContext({modalList:[],theme:"light",toggleTheme:()=>{},versionApp:"",addModal:(e,t)=>{},removeModal:e=>{},clearModals:()=>{},showBtnTop:!1,setShowBtnTop:()=>{},globalApiConfig:null,setTheme:()=>{},canChangeTheme:!1,reportType:0,setReportType:e=>{}}),w="sys/theme";function S(){const e=t.useContext(j);if(!(null==e?void 0:e.addModal))throw new Error("'ModalProvider' não encontrado!");return e}const E=1,N=2,A=3,T="jc-alert-hide-sb";function I({type:e=N,onConfirm:o,onCancel:i,title:a,text:s="",children:l,defaultBtn:u=2}){const c=t.useRef(),d=t.useRef(),{addModal:p,removeModal:h}=S(),[f]=t.useState("alert-"+n.random()),m=r.useDragControls();let g="jc-erro";switch(e){case N:g="jc-aviso";break;case A:g="jc-conf"}const v=t.useCallback(t=>{e===A&&("KeyS"===t.code&&o&&o(),"KeyN"===t.code&&i&&i())},[i,o,e]);return t.useEffect(()=>(p(f,e===A?i:o),()=>h(f)),[]),t.useEffect(()=>{var e;null==(e=null==c?void 0:c.current)||e.focus()},[c]),t.useEffect(()=>(document.addEventListener("keydown",v,!1),document.body.classList.add(T),()=>{document.removeEventListener("keydown",v,!1),document.body.classList.remove(T)}),[v]),b.jsx(r.motion.div,{className:"jc-alert--container",ref:d,children:b.jsxs(r.motion.div,{className:"jc-alert "+g,drag:!0,dragConstraints:d,dragElastic:.1,dragMomentum:!1,dragControls:m,dragListener:!1,animate:{scale:1},transition:{ease:"easeOut",duration:.3},children:[b.jsx("div",{className:"jc-close-button",onClick:function(){e===A?i():o()},children:b.jsx("i",{className:"fa-solid fa-xmark"})}),b.jsxs("div",{className:"jc-alert-header",onPointerDown:function(e){n.isMobile()||m.start(e)},children:[b.jsxs("div",{className:"icon",children:[e===N&&b.jsx("i",{className:"fa-solid fa-check"}),e===E&&b.jsx("i",{className:"fa-solid fa-triangle-exclamation"}),e===A&&b.jsx("i",{className:"fas fa-question"})]}),b.jsx("div",{className:"jc-alert-title",children:a})]}),b.jsx("div",{className:"jc-alert-body",children:s&&"string"==typeof s?b.jsx("span",{children:s.split("\n").map((e,n,r)=>b.jsxs(t.Fragment,{children:[e,n<r.length-1&&b.jsx("br",{})]},n))}):b.jsx(b.Fragment,{children:s||l})}),b.jsxs("div",{className:"jc-alert-buttons",children:[(e===E||e===N)&&b.jsx("button",{ref:c,type:"button",className:"btn btn-confirm",onClick:o,children:"OK"}),e===A&&b.jsxs(b.Fragment,{children:[b.jsxs("button",{type:"button",className:"btn btn-confirm",onClick:o,tabIndex:99,ref:1===u?c:null,children:[b.jsx("u",{children:"S"}),"im"]}),b.jsxs("button",{type:"button",className:"btn btn-confirm btn-nao",onClick:i,tabIndex:98,ref:2===u?c:null,children:[b.jsx("u",{children:"N"}),"ão"]})]})]})]})})}function F({onConfirm:e,text:t="",children:n}){return b.jsx(I,{type:E,title:"Atenção!",text:t,onConfirm:e,children:n})}const D={baseURL:"",timeout:3e4,auth:{username:"",password:"",header:"x-auth",prefix:"Bearer"},version:"",ident:"",loginRoute:"/",refreshRoute:"",isProductionMode:!0,withCredentials:!1,getToken:()=>"",afterRequest:e=>{}};const O=o.div`
|
|
22
22
|
@media (max-width: 767px) {
|
|
23
23
|
overflow-x: auto;
|
|
24
24
|
}
|