@artibet/react-mui-components 3.8.11 → 3.8.12
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/hooks/index.js +1 -1
- package/package.json +1 -1
package/hooks/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import r,{useState as n,useCallback as e}from"react";import t from"nprogress";import{router as o}from"@inertiajs/react";function i(r,n){(null==n||n>r.length)&&(n=r.length);for(var e=0,t=Array(n);e<n;e++)t[e]=r[e];return t}function s(r,n,e){return(n=function(r){var n=function(r,n){if("object"!=typeof r||!r)return r;var e=r[Symbol.toPrimitive];if(void 0!==e){var t=e.call(r,n);if("object"!=typeof t)return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(r)}(r,"string");return"symbol"==typeof n?n:n+""}(n))in r?Object.defineProperty(r,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):r[n]=e,r}function a(r,n){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(r);n&&(t=t.filter((function(n){return Object.getOwnPropertyDescriptor(r,n).enumerable}))),e.push.apply(e,t)}return e}function u(r){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?a(Object(e),!0).forEach((function(n){s(r,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):a(Object(e)).forEach((function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(e,n))}))}return r}function c(r,n){return function(r){if(Array.isArray(r))return r}(r)||function(r,n){var e=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=e){var t,o,i,s,a=[],u=!0,c=!1;try{if(i=(e=e.call(r)).next,0===n);else for(;!(u=(t=i.call(e)).done)&&(a.push(t.value),a.length!==n);u=!0);}catch(r){c=!0,o=r}finally{try{if(!u&&null!=e.return&&(s=e.return(),Object(s)!==s))return}finally{if(c)throw o}}return a}}(r,n)||function(r,n){if(r){if("string"==typeof r)return i(r,n);var e={}.toString.call(r).slice(8,-1);return"Object"===e&&r.constructor&&(e=r.constructor.name),"Map"===e||"Set"===e?Array.from(r):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?i(r,n):void 0}}(r,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}!function(r,n){void 0===n&&(n={});var e=n.insertAt;if("undefined"!=typeof document){var t=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===e&&t.firstChild?t.insertBefore(o,t.firstChild):t.appendChild(o),o.styleSheet?o.styleSheet.cssText=r:o.appendChild(document.createTextNode(r))}}("#nprogress {\r\n pointer-events: none;\r\n}\r\n\r\n#nprogress .bar {\r\n background: #29d;\r\n position: fixed;\r\n z-index: 99999;\r\n top: 0;\r\n left: 0;\r\n width: 100%;\r\n height: 4px;\r\n}\r\n\r\n/* Fancy blur effect */\r\n#nprogress .peg {\r\n display: block;\r\n position: absolute;\r\n right: 0px;\r\n width: 100px;\r\n height: 100%;\r\n box-shadow: 0 0 10px #29d, 0 0 5px #29d;\r\n opacity: 1.0;\r\n -webkit-transform: rotate(3deg) translate(0px, -4px);\r\n -ms-transform: rotate(3deg) translate(0px, -4px);\r\n transform: rotate(3deg) translate(0px, -4px);\r\n}\r\n\r\n/* Remove these to get rid of the spinner */\r\n#nprogress .spinner {\r\n display: block;\r\n position: fixed;\r\n z-index: 1031;\r\n top: 15px;\r\n right: 15px;\r\n}\r\n\r\n#nprogress .spinner-icon {\r\n width: 18px;\r\n height: 18px;\r\n box-sizing: border-box;\r\n border: solid 2px transparent;\r\n border-top-color: #29d;\r\n border-left-color: #29d;\r\n border-radius: 50%;\r\n -webkit-animation: nprogress-spinner 400ms linear infinite;\r\n animation: nprogress-spinner 400ms linear infinite;\r\n}\r\n\r\n.nprogress-custom-parent {\r\n overflow: hidden;\r\n position: relative;\r\n}\r\n\r\n.nprogress-custom-parent #nprogress .spinner,\r\n.nprogress-custom-parent #nprogress .bar {\r\n position: absolute;\r\n}\r\n\r\n@-webkit-keyframes nprogress-spinner {\r\n 0% {\r\n -webkit-transform: rotate(0deg);\r\n }\r\n\r\n 100% {\r\n -webkit-transform: rotate(360deg);\r\n }\r\n}\r\n\r\n@keyframes nprogress-spinner {\r\n 0% {\r\n transform: rotate(0deg);\r\n }\r\n\r\n 100% {\r\n transform: rotate(360deg);\r\n }\r\n}");var
|
|
1
|
+
import r,{useState as n,useCallback as e}from"react";import t from"nprogress";import{router as o}from"@inertiajs/react";function i(r,n){(null==n||n>r.length)&&(n=r.length);for(var e=0,t=Array(n);e<n;e++)t[e]=r[e];return t}function s(r,n,e){return(n=function(r){var n=function(r,n){if("object"!=typeof r||!r)return r;var e=r[Symbol.toPrimitive];if(void 0!==e){var t=e.call(r,n);if("object"!=typeof t)return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(r)}(r,"string");return"symbol"==typeof n?n:n+""}(n))in r?Object.defineProperty(r,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):r[n]=e,r}function a(r,n){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(r);n&&(t=t.filter((function(n){return Object.getOwnPropertyDescriptor(r,n).enumerable}))),e.push.apply(e,t)}return e}function u(r){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?a(Object(e),!0).forEach((function(n){s(r,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):a(Object(e)).forEach((function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(e,n))}))}return r}function c(r,n){return function(r){if(Array.isArray(r))return r}(r)||function(r,n){var e=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=e){var t,o,i,s,a=[],u=!0,c=!1;try{if(i=(e=e.call(r)).next,0===n);else for(;!(u=(t=i.call(e)).done)&&(a.push(t.value),a.length!==n);u=!0);}catch(r){c=!0,o=r}finally{try{if(!u&&null!=e.return&&(s=e.return(),Object(s)!==s))return}finally{if(c)throw o}}return a}}(r,n)||function(r,n){if(r){if("string"==typeof r)return i(r,n);var e={}.toString.call(r).slice(8,-1);return"Object"===e&&r.constructor&&(e=r.constructor.name),"Map"===e||"Set"===e?Array.from(r):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?i(r,n):void 0}}(r,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}!function(r,n){void 0===n&&(n={});var e=n.insertAt;if("undefined"!=typeof document){var t=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===e&&t.firstChild?t.insertBefore(o,t.firstChild):t.appendChild(o),o.styleSheet?o.styleSheet.cssText=r:o.appendChild(document.createTextNode(r))}}("#nprogress {\r\n pointer-events: none;\r\n}\r\n\r\n#nprogress .bar {\r\n background: #29d;\r\n position: fixed;\r\n z-index: 99999;\r\n top: 0;\r\n left: 0;\r\n width: 100%;\r\n height: 4px;\r\n}\r\n\r\n/* Fancy blur effect */\r\n#nprogress .peg {\r\n display: block;\r\n position: absolute;\r\n right: 0px;\r\n width: 100px;\r\n height: 100%;\r\n box-shadow: 0 0 10px #29d, 0 0 5px #29d;\r\n opacity: 1.0;\r\n -webkit-transform: rotate(3deg) translate(0px, -4px);\r\n -ms-transform: rotate(3deg) translate(0px, -4px);\r\n transform: rotate(3deg) translate(0px, -4px);\r\n}\r\n\r\n/* Remove these to get rid of the spinner */\r\n#nprogress .spinner {\r\n display: block;\r\n position: fixed;\r\n z-index: 1031;\r\n top: 15px;\r\n right: 15px;\r\n}\r\n\r\n#nprogress .spinner-icon {\r\n width: 18px;\r\n height: 18px;\r\n box-sizing: border-box;\r\n border: solid 2px transparent;\r\n border-top-color: #29d;\r\n border-left-color: #29d;\r\n border-radius: 50%;\r\n -webkit-animation: nprogress-spinner 400ms linear infinite;\r\n animation: nprogress-spinner 400ms linear infinite;\r\n}\r\n\r\n.nprogress-custom-parent {\r\n overflow: hidden;\r\n position: relative;\r\n}\r\n\r\n.nprogress-custom-parent #nprogress .spinner,\r\n.nprogress-custom-parent #nprogress .bar {\r\n position: absolute;\r\n}\r\n\r\n@-webkit-keyframes nprogress-spinner {\r\n 0% {\r\n -webkit-transform: rotate(0deg);\r\n }\r\n\r\n 100% {\r\n -webkit-transform: rotate(360deg);\r\n }\r\n}\r\n\r\n@keyframes nprogress-spinner {\r\n 0% {\r\n transform: rotate(0deg);\r\n }\r\n\r\n 100% {\r\n transform: rotate(360deg);\r\n }\r\n}");var l=function(){var n=c(r.useState(!1),2),e=n[0],o=n[1];return{loader:e,startLoader:function(){o(!0),t.start()},stopLoader:function(){o(!1),t.done()}}},p=function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=c(n(!1),2),i=t[0],s=t[1],a=c(n(r),2),l=a[0],p=a[1],f=c(n(!1),2),d=f[0],g=f[1],b=e((function(){p(null),s(!0)}),[]),m=e((function(r){p(r),s(!0)}),[]),h=e((function(){d||(s(!1),p(null))}),[d]);return{isOpen:i,data:l,processing:d,create:b,edit:m,close:h,submit:function(r,n,e){var t=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{preserveScroll:!0};g(!0),o[r](n,e,u(u({},t),{},{onFinish:function(){return g(!1)},onSuccess:function(){return h()}}))},isEdit:!!l}},f=function(){var r=c(n(!1),2),t=r[0],i=r[1],s=c(n(null),2),a=s[0],l=s[1],p=c(n(!1),2),f=p[0],d=p[1],g=e((function(){l(arguments.length>0&&void 0!==arguments[0]?arguments[0]:null),i(!0)}),[]),b=e((function(){f||(i(!1),l(null))}),[f]);return{isOpen:t,data:a,processing:f,open:g,close:b,execute:function(r,n){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{preserveScroll:!0};d(!0),o[r](n,u(u({},e),{},{onSuccess:function(){return b()},onFinish:function(){return d(!1)}}))},putRequest:function(r,n){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{preserveScroll:!0};d(!0),o.put(r,n,u(u({},e),{},{onSuccess:function(){return b()},onFinish:function(){return d(!1)}}))},postRequest:function(r,n){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{preserveScroll:!0};d(!0),o.post(r,n,u(u({},e),{},{onSuccess:function(){return b()},onFinish:function(){return d(!1)}}))},deleteRequest:function(r,n){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{preserveScroll:!0};d(!0),o.delete(n,u(u({},e),{},{onSuccess:function(){return b()},onFinish:function(){return d(!1)}}))}}};export{f as useConfirm,l as useLoader,p as useModalForm};
|