@nocobase/plugin-action-print 2.1.0-alpha.40 → 2.1.0-alpha.46

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.
@@ -7,4 +7,4 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
 
10
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react"),require("@nocobase/client")):"function"==typeof define&&define.amd?define("@nocobase/plugin-action-print",["react","@nocobase/client"],e):"object"==typeof exports?exports["@nocobase/plugin-action-print"]=e(require("react"),require("@nocobase/client")):t["@nocobase/plugin-action-print"]=e(t.react,t["@nocobase/client"])}(self,function(t,e){return function(){"use strict";var n,r,o,i={342:function(t){t.exports=e},155:function(e){e.exports=t}},c={};function a(t){var e=c[t];if(void 0!==e)return e.exports;var n=c[t]={exports:{}};return i[t].call(n.exports,n,n.exports,a),n.exports}a.m=i,a.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return a.d(e,{a:e}),e},l=Object.getPrototypeOf?function(t){return Object.getPrototypeOf(t)}:function(t){return t.__proto__},a.t=function(t,e){if(1&e&&(t=this(t)),8&e||"object"==typeof t&&t&&(4&e&&t.__esModule||16&e&&"function"==typeof t.then))return t;var n=Object.create(null);a.r(n);var r={};u=u||[null,l({}),l([]),l(l)];for(var o=2&e&&t;("object"==typeof o||"function"==typeof o)&&!~u.indexOf(o);o=l(o))Object.getOwnPropertyNames(o).forEach(function(e){r[e]=function(){return t[e]}});return r.default=function(){return t},a.d(n,r),n},a.d=function(t,e){for(var n in e)a.o(e,n)&&!a.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},a.f={},a.e=function(t){return Promise.all(Object.keys(a.f).reduce(function(e,n){return a.f[n](t,e),e},[]))},a.u=function(t){return""+t+".a3d862419a3711a2.js"},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(t){if("object"==typeof window)return window}}(),a.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},p={},a.l=function(t,e,n,r){if(p[t])return void p[t].push(e);if(void 0!==n)for(var o,i,c=document.getElementsByTagName("script"),u=0;u<c.length;u++){var l=c[u];if(l.getAttribute("src")==t||l.getAttribute("data-rspack")=="@nocobase/plugin-action-print:"+n){o=l;break}}o||(i=!0,(o=document.createElement("script")).timeout=120,a.nc&&o.setAttribute("nonce",a.nc),o.setAttribute("data-rspack","@nocobase/plugin-action-print:"+n),o.src=t),p[t]=[e];var f=function(e,n){o.onerror=o.onload=null,clearTimeout(s);var r=p[t];if(delete p[t],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(t){return t(n)}),e)return e(n)},s=setTimeout(f.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=f.bind(null,o.onerror),o.onload=f.bind(null,o.onload),i&&document.head.appendChild(o)},a.r=function(t){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},a.g.importScripts&&(f=a.g.location+"");var u,l,p,f,s=a.g.document;if(!f&&s&&(s.currentScript&&"SCRIPT"===s.currentScript.tagName.toUpperCase()&&(f=s.currentScript.src),!f)){var b=s.getElementsByTagName("script");if(b.length)for(var d=b.length-1;d>-1&&(!f||!/^http(s?):/.test(f));)f=b[d--].src}if(!f)throw Error("Automatic publicPath is not supported in this browser");a.p=f.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n={889:0},a.f.j=function(t,e){var r=a.o(n,t)?n[t]:void 0;if(0!==r)if(r)e.push(r[2]);else{var o=new Promise(function(e,o){r=n[t]=[e,o]});e.push(r[2]=o);var i=a.p+a.u(t),c=Error();a.l(i,function(e){if(a.o(n,t)&&(0!==(r=n[t])&&(n[t]=void 0),r)){var o=e&&("load"===e.type?"missing":e.type),i=e&&e.target&&e.target.src;c.message="Loading chunk "+t+" failed.\n("+o+": "+i+")",c.name="ChunkLoadError",c.type=o,c.request=i,r[1](c)}},"chunk-"+t,t)}},r=function(t,e){var r,o,i=e[0],c=e[1],u=e[2],l=0;if(i.some(function(t){return 0!==n[t]})){for(r in c)a.o(c,r)&&(a.m[r]=c[r]);u&&u(a)}for(t&&t(e);l<i.length;l++)o=i[l],a.o(n,o)&&n[o]&&n[o][0](),n[o]=0},(o=self.webpackChunk_nocobase_plugin_action_print=self.webpackChunk_nocobase_plugin_action_print||[]).forEach(r.bind(null,0)),o.push=r.bind(null,o.push.bind(o));var y={};return!function(){var t="",e="u">typeof document?document.currentScript:null;if(e&&e.src&&(t=e.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")),!t){var n=window.__webpack_public_path__||"";n&&("/"!==n.charAt(n.length-1)&&(n+="/"),t=n+"static/plugins/@nocobase/plugin-action-print/dist/client/")}if(!t){if(!(t=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var r=window.location.pathname||"/",o=r.indexOf("/v2/");t=o>=0?r.slice(0,o+1):"/"}t&&(t=t.replace(/\/v2\/?$/,"/")),t||(t="/"),"/"!==t.charAt(t.length-1)&&(t+="/"),t+="static/plugins/@nocobase/plugin-action-print/dist/client/"}a.p=t}(),!function(){a.r(y),a.d(y,{default:function(){return g},PluginActionPrintClient:function(){return v}});var t=a(342),e=[{name:"Customize",Component:function(t){return t.children},children:[{name:"editButton",Component:t.ActionDesigner.ButtonEditor,useComponentProps:function(){return(0,t.useSchemaToolbar)().buttonEditorProps}},{name:"linkageRules",Component:t.SchemaSettingsLinkageRules,useComponentProps:function(){return function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),r.forEach(function(e){var r;r=n[e],e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r})}return t}({},(0,t.useSchemaToolbar)().linkageRulesProps)}},{name:"remove",sort:100,Component:t.ActionDesigner.RemoveButton,useComponentProps:function(){return(0,t.useSchemaToolbar)().removeButtonProps}}]}],n=new t.SchemaSettings({name:"ActionSettings:print",items:e}),r=new t.SchemaSettings({name:"actionSettings:print",items:e}),o=a(155),i=a.n(o),c=function(e){var n,r;return i().createElement(t.ActionInitializer,(n=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),r.forEach(function(e){var r;r=n[e],e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r})}return t}({},e),r=r={schema:{title:'{{ t("Print") }}',"x-action":"print","x-component":"Action","x-use-component-props":"useDetailPrintActionProps","x-component-props":{icon:"PrinterOutlined"}}},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):(function(t){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e.push.apply(e,n)}return e})(Object(r)).forEach(function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(r,t))}),n))};function u(t,e,n,r,o,i,c){try{var a=t[i](c),u=a.value}catch(t){n(t);return}a.done?e(u):Promise.resolve(u).then(r,o)}var l=function(){var e=(0,t.useFormBlockContext)(),n=(0,t.useDetailsBlockContext)().formBlockRef,r=(0,t.useLazy)(function(){return a.e("114").then(a.t.bind(a,457,23))},"useReactToPrint")({content:function(){var t,r=(null==e||null==(t=e.formBlockRef)?void 0:t.current)||(null==n?void 0:n.current);return r&&r.querySelector(".nb-grid")?r.querySelector(".nb-grid"):null},pageStyle:"@media print {\n * {\n margin: 0;\n }\n .nb-grid {\n padding-top: 20px !important;\n }\n :not(.ant-formily-item-control-content-component) > div.ant-formily-layout div.nb-action-bar { {\n overflow: hidden; height: 0;\n }\n }"});return{onClick:function(){var t;return(t=function(){return function(t,e){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),a=Object.defineProperty;return a(c,"next",{value:u(0)}),a(c,"throw",{value:u(1)}),a(c,"return",{value:u(2)}),"function"==typeof Symbol&&a(c,Symbol.iterator,{value:function(){return this}}),c;function u(a){return function(u){var l=[a,u];if(n)throw TypeError("Generator is already executing.");for(;c&&(c=0,l[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=e.call(t,i)}catch(t){l=[6,t],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}(this,function(t){return r(),[2]})},function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function c(t){u(i,r,o,c,a,"next",t)}function a(t){u(i,r,o,c,a,"throw",t)}c(void 0)})})()}}},p=function(e){return i().createElement(t.SchemaComponentOptions,{components:{PrintActionInitializer:c},scope:{useDetailPrintActionProps:l}},e.children)};function f(t,e,n,r,o,i,c){try{var a=t[i](c),u=a.value}catch(t){n(t);return}a.done?e(u):Promise.resolve(u).then(r,o)}function s(t,e,n){return(s=m()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var o=new(Function.bind.apply(t,r));return n&&d(o,n.prototype),o}).apply(null,arguments)}function b(t){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function d(t,e){return(d=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function h(t){var e="function"==typeof Map?new Map:void 0;return(h=function(t){if(null===t||-1===Function.toString.call(t).indexOf("[native code]"))return t;if("function"!=typeof t)throw TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return s(t,arguments,b(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),d(n,t)})(t)}function m(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(m=function(){return!!t})()}var v=function(t){var e;if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");function o(){var t,e;if(!(this instanceof o))throw TypeError("Cannot call a class as a function");return t=o,e=arguments,t=b(t),function(t,e){var n;if(e&&("object"==((n=e)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof e))return e;if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(this,m()?Reflect.construct(t,e||[],b(this).constructor):t.apply(this,e))}return o.prototype=Object.create(t&&t.prototype,{constructor:{value:o,writable:!0,configurable:!0}}),t&&d(o,t),e=[{key:"load",value:function(){var t;return(t=function(){var t;return function(t,e){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),a=Object.defineProperty;return a(c,"next",{value:u(0)}),a(c,"throw",{value:u(1)}),a(c,"return",{value:u(2)}),"function"==typeof Symbol&&a(c,Symbol.iterator,{value:function(){return this}}),c;function u(a){return function(u){var l=[a,u];if(n)throw TypeError("Generator is already executing.");for(;c&&(c=0,l[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=e.call(t,i)}catch(t){l=[6,t],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}(this,function(e){return this.app.use(p),this.app.schemaSettingsManager.add(n),this.app.schemaSettingsManager.add(r),t={title:'{{t("Print")}}',Component:"PrintActionInitializer",schema:{"x-component":"Action","x-toolbar":"ActionSchemaToolbar","x-settings":"actionSettings:print","x-action":"print"}},this.app.schemaInitializerManager.addItem("details:configureActions","enableActions.print",t),this.app.schemaInitializerManager.addItem("CalendarFormActionInitializers","enableActions.print",t),[2]})},function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function c(t){f(i,r,o,c,a,"next",t)}function a(t){f(i,r,o,c,a,"throw",t)}c(void 0)})}).call(this)}}],function(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}(o.prototype,e),o}(h(t.Plugin)),g=v}(),y}()});
10
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("@nocobase/client")):"function"==typeof define&&define.amd?define("@nocobase/plugin-action-print",["react","@nocobase/client"],t):"object"==typeof exports?exports["@nocobase/plugin-action-print"]=t(require("react"),require("@nocobase/client")):e["@nocobase/plugin-action-print"]=t(e.react,e["@nocobase/client"])}(self,function(e,t){return function(){"use strict";var n,r,o,i={342:function(e){e.exports=t},155:function(t){t.exports=e}},c={};function a(e){var t=c[e];if(void 0!==t)return t.exports;var n=c[e]={exports:{}};return i[e].call(n.exports,n,n.exports,a),n.exports}a.m=i,a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,{a:t}),t},l=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},a.t=function(e,t){if(1&t&&(e=this(e)),8&t||"object"==typeof e&&e&&(4&t&&e.__esModule||16&t&&"function"==typeof e.then))return e;var n=Object.create(null);a.r(n);var r={};u=u||[null,l({}),l([]),l(l)];for(var o=2&t&&e;("object"==typeof o||"function"==typeof o)&&!~u.indexOf(o);o=l(o))Object.getOwnPropertyNames(o).forEach(function(t){r[t]=function(){return e[t]}});return r.default=function(){return e},a.d(n,r),n},a.d=function(e,t){for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.f={},a.e=function(e){return Promise.all(Object.keys(a.f).reduce(function(t,n){return a.f[n](e,t),t},[]))},a.u=function(e){return""+e+".a3d862419a3711a2.js"},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},p={},a.l=function(e,t,n,r){if(p[e])return void p[e].push(t);if(void 0!==n)for(var o,i,c=document.getElementsByTagName("script"),u=0;u<c.length;u++){var l=c[u];if(l.getAttribute("src")==e||l.getAttribute("data-rspack")=="@nocobase/plugin-action-print:"+n){o=l;break}}o||(i=!0,(o=document.createElement("script")).timeout=120,a.nc&&o.setAttribute("nonce",a.nc),o.setAttribute("data-rspack","@nocobase/plugin-action-print:"+n),o.src=e),p[e]=[t];var f=function(t,n){o.onerror=o.onload=null,clearTimeout(s);var r=p[e];if(delete p[e],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(e){return e(n)}),t)return t(n)},s=setTimeout(f.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=f.bind(null,o.onerror),o.onload=f.bind(null,o.onload),i&&document.head.appendChild(o)},a.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.g.importScripts&&(f=a.g.location+"");var u,l,p,f,s=a.g.document;if(!f&&s&&(s.currentScript&&"SCRIPT"===s.currentScript.tagName.toUpperCase()&&(f=s.currentScript.src),!f)){var b=s.getElementsByTagName("script");if(b.length)for(var d=b.length-1;d>-1&&(!f||!/^http(s?):/.test(f));)f=b[d--].src}if(!f)throw Error("Automatic publicPath is not supported in this browser");a.p=f.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n={889:0},a.f.j=function(e,t){var r=a.o(n,e)?n[e]:void 0;if(0!==r)if(r)t.push(r[2]);else{var o=new Promise(function(t,o){r=n[e]=[t,o]});t.push(r[2]=o);var i=a.p+a.u(e),c=Error();a.l(i,function(t){if(a.o(n,e)&&(0!==(r=n[e])&&(n[e]=void 0),r)){var o=t&&("load"===t.type?"missing":t.type),i=t&&t.target&&t.target.src;c.message="Loading chunk "+e+" failed.\n("+o+": "+i+")",c.name="ChunkLoadError",c.type=o,c.request=i,r[1](c)}},"chunk-"+e,e)}},r=function(e,t){var r,o,i=t[0],c=t[1],u=t[2],l=0;if(i.some(function(e){return 0!==n[e]})){for(r in c)a.o(c,r)&&(a.m[r]=c[r]);u&&u(a)}for(e&&e(t);l<i.length;l++)o=i[l],a.o(n,o)&&n[o]&&n[o][0](),n[o]=0},(o=self.webpackChunk_nocobase_plugin_action_print=self.webpackChunk_nocobase_plugin_action_print||[]).forEach(r.bind(null,0)),o.push=r.bind(null,o.push.bind(o));var y={};return!function(){var e="",t="u">typeof document?document.currentScript:null;if(t&&t.src&&(e=t.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")),!e){var n=window.__webpack_public_path__||"";n&&("/"!==n.charAt(n.length-1)&&(n+="/"),e=n+"static/plugins/@nocobase/plugin-action-print/dist/client/")}if(!e){var r=window.__nocobase_modern_client_prefix__||"v",o="/"+(r=String(r).replace(/^\/+|\/+$/g,"")||"v")+"/";if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var i=window.location.pathname||"/",c=i.indexOf(o);e=c>=0?i.slice(0,c+1):"/"}e&&(e=e.replace(RegExp("/"+r+"/?$"),"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/@nocobase/plugin-action-print/dist/client/"}a.p=e}(),!function(){a.r(y),a.d(y,{default:function(){return g},PluginActionPrintClient:function(){return v}});var e=a(342),t=[{name:"Customize",Component:function(e){return e.children},children:[{name:"editButton",Component:e.ActionDesigner.ButtonEditor,useComponentProps:function(){return(0,e.useSchemaToolbar)().buttonEditorProps}},{name:"linkageRules",Component:e.SchemaSettingsLinkageRules,useComponentProps:function(){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},(0,e.useSchemaToolbar)().linkageRulesProps)}},{name:"remove",sort:100,Component:e.ActionDesigner.RemoveButton,useComponentProps:function(){return(0,e.useSchemaToolbar)().removeButtonProps}}]}],n=new e.SchemaSettings({name:"ActionSettings:print",items:t}),r=new e.SchemaSettings({name:"actionSettings:print",items:t}),o=a(155),i=a.n(o),c=function(t){var n,r;return i().createElement(e.ActionInitializer,(n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},t),r=r={schema:{title:'{{ t("Print") }}',"x-action":"print","x-component":"Action","x-use-component-props":"useDetailPrintActionProps","x-component-props":{icon:"PrinterOutlined"}}},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(r)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}),n))};function u(e,t,n,r,o,i,c){try{var a=e[i](c),u=a.value}catch(e){n(e);return}a.done?t(u):Promise.resolve(u).then(r,o)}var l=function(){var t=(0,e.useFormBlockContext)(),n=(0,e.useDetailsBlockContext)().formBlockRef,r=(0,e.useLazy)(function(){return a.e("114").then(a.t.bind(a,457,23))},"useReactToPrint")({content:function(){var e,r=(null==t||null==(e=t.formBlockRef)?void 0:e.current)||(null==n?void 0:n.current);return r&&r.querySelector(".nb-grid")?r.querySelector(".nb-grid"):null},pageStyle:"@media print {\n * {\n margin: 0;\n }\n .nb-grid {\n padding-top: 20px !important;\n }\n :not(.ant-formily-item-control-content-component) > div.ant-formily-layout div.nb-action-bar { {\n overflow: hidden; height: 0;\n }\n }"});return{onClick:function(){var e;return(e=function(){return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),a=Object.defineProperty;return a(c,"next",{value:u(0)}),a(c,"throw",{value:u(1)}),a(c,"return",{value:u(2)}),"function"==typeof Symbol&&a(c,Symbol.iterator,{value:function(){return this}}),c;function u(a){return function(u){var l=[a,u];if(n)throw TypeError("Generator is already executing.");for(;c&&(c=0,l[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}(this,function(e){return r(),[2]})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function c(e){u(i,r,o,c,a,"next",e)}function a(e){u(i,r,o,c,a,"throw",e)}c(void 0)})})()}}},p=function(t){return i().createElement(e.SchemaComponentOptions,{components:{PrintActionInitializer:c},scope:{useDetailPrintActionProps:l}},t.children)};function f(e,t,n,r,o,i,c){try{var a=e[i](c),u=a.value}catch(e){n(e);return}a.done?t(u):Promise.resolve(u).then(r,o)}function s(e,t,n){return(s=m()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&d(o,n.prototype),o}).apply(null,arguments)}function b(e){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function d(e,t){return(d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function h(e){var t="function"==typeof Map?new Map:void 0;return(h=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return s(e,arguments,b(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),d(n,e)})(e)}function m(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(m=function(){return!!e})()}var v=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function o(){var e,t;if(!(this instanceof o))throw TypeError("Cannot call a class as a function");return e=o,t=arguments,e=b(e),function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,m()?Reflect.construct(e,t||[],b(this).constructor):e.apply(this,t))}return o.prototype=Object.create(e&&e.prototype,{constructor:{value:o,writable:!0,configurable:!0}}),e&&d(o,e),t=[{key:"load",value:function(){var e;return(e=function(){var e;return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),a=Object.defineProperty;return a(c,"next",{value:u(0)}),a(c,"throw",{value:u(1)}),a(c,"return",{value:u(2)}),"function"==typeof Symbol&&a(c,Symbol.iterator,{value:function(){return this}}),c;function u(a){return function(u){var l=[a,u];if(n)throw TypeError("Generator is already executing.");for(;c&&(c=0,l[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}(this,function(t){return this.app.use(p),this.app.schemaSettingsManager.add(n),this.app.schemaSettingsManager.add(r),e={title:'{{t("Print")}}',Component:"PrintActionInitializer",schema:{"x-component":"Action","x-toolbar":"ActionSchemaToolbar","x-settings":"actionSettings:print","x-action":"print"}},this.app.schemaInitializerManager.addItem("details:configureActions","enableActions.print",e),this.app.schemaInitializerManager.addItem("CalendarFormActionInitializers","enableActions.print",e),[2]})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function c(e){f(i,r,o,c,a,"next",e)}function a(e){f(i,r,o,c,a,"throw",e)}c(void 0)})}).call(this)}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(o.prototype,t),o}(h(e.Plugin)),g=v}(),y}()});
@@ -7,4 +7,4 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
 
10
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@nocobase/client-v2"),require("@nocobase/flow-engine")):"function"==typeof define&&define.amd?define("@nocobase/plugin-action-print/client-v2",["@nocobase/client-v2","@nocobase/flow-engine"],t):"object"==typeof exports?exports["@nocobase/plugin-action-print/client-v2"]=t(require("@nocobase/client-v2"),require("@nocobase/flow-engine")):e["@nocobase/plugin-action-print/client-v2"]=t(e["@nocobase/client-v2"],e["@nocobase/flow-engine"])}(self,function(e,t){return function(){"use strict";var n={485:function(t){t.exports=e},694:function(e){e.exports=t}},r={};function o(e){var t=r[e];if(void 0!==t)return t.exports;var i=r[e]={exports:{}};return n[e](i,i.exports,o),i.exports}o.d=function(e,t){for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.g.importScripts&&(i=o.g.location+"");var i,c=o.g.document;if(!i&&c&&(c.currentScript&&"SCRIPT"===c.currentScript.tagName.toUpperCase()&&(i=c.currentScript.src),!i)){var l=c.getElementsByTagName("script");if(l.length)for(var u=l.length-1;u>-1&&(!i||!/^http(s?):/.test(i));)i=l[u--].src}if(!i)throw Error("Automatic publicPath is not supported in this browser");o.p=i.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/");var a={};return!function(){var e="",t="u">typeof document?document.currentScript:null;if(t&&t.src&&(e=t.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")),!e){var n=window.__webpack_public_path__||"";n&&("/"!==n.charAt(n.length-1)&&(n+="/"),e=n+"static/plugins/@nocobase/plugin-action-print/dist/client-v2/")}if(!e){if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var r=window.location.pathname||"/",i=r.indexOf("/v2/");e=i>=0?r.slice(0,i+1):"/"}e&&(e=e.replace(/\/v2\/?$/,"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/@nocobase/plugin-action-print/dist/client-v2/"}o.p=e}(),!function(){o.r(a),o.d(a,{PrintActionModel:function(){return y},default:function(){return j},PluginActionPrintClient:function(){return P}});var e=o(485),t=o(694),n=JSON.parse('{"UU":"@nocobase/plugin-action-print"}');function r(e,r){return(0,t.tExpr)(e,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({ns:[n.UU,"client"],nsMode:"fallback"},r))}function i(e,t,n,r,o,i,c){try{var l=e[i](c),u=l.value}catch(e){n(e);return}l.done?t(u):Promise.resolve(u).then(r,o)}function c(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var c=e.apply(t,n);function l(e){i(c,r,o,l,u,"next",e)}function u(e){i(c,r,o,l,u,"throw",e)}l(void 0)})}}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function f(e,t){return(f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(p=function(){return!!e})()}function s(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(c,"next",{value:u(0)}),l(c,"throw",{value:u(1)}),l(c,"return",{value:u(2)}),"function"==typeof Symbol&&l(c,Symbol.iterator,{value:function(){return this}}),c;function u(l){return function(u){var a=[l,u];if(n)throw TypeError("Generator is already executing.");for(;c&&(c=0,a[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}}}var d=function(e,t){var n=t.head;e.querySelectorAll('link[rel="stylesheet"]').forEach(function(e){n.appendChild(e.cloneNode(!0))}),e.querySelectorAll("style").forEach(function(e){n.appendChild(e.cloneNode(!0))})},b=function(e){var t,n,r=null==e||null==(t=e.subModels)?void 0:t.grid,o=null==r||null==(n=r.gridContainerRef)?void 0:n.current;return o?o.querySelector("[data-grid-root]")||o:null},y=function(e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function t(){var e,n,o;if(!(this instanceof t))throw TypeError("Cannot call a class as a function");return n=t,o=arguments,n=u(n),l(e=function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,p()?Reflect.construct(n,o||[],u(this).constructor):n.apply(this,o)),"defaultProps",{type:"link",title:r("Print"),icon:"PrinterOutlined"}),e}return t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&f(t,e),t}(e.ActionModel);function h(e,t,n,r,o,i,c){try{var l=e[i](c),u=l.value}catch(e){n(e);return}l.done?t(u):Promise.resolve(u).then(r,o)}function v(e,t,n){return(v=O()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&g(o,n.prototype),o}).apply(null,arguments)}l(y,"scene",e.ActionSceneEnum.record),y.define({label:r("Print"),hide:function(e){var t,n=null==e?void 0:e.blockModel;return(null==n||null==(t=n.constructor)?void 0:t.name)!=="DetailsBlockModel"}}),y.registerFlow({key:"hideInTableRowActions",on:"beforeRender",steps:{apply:{hideInSettings:function(){return!0},handler:function(e){var t,n=null==e?void 0:e.blockModel;e.model.setHidden((null==n||null==(t=n.constructor)?void 0:t.name)!=="DetailsBlockModel")}}}}),y.registerFlow({key:"print",title:r("Print"),on:"click",steps:{print:{handler:function(e){return c(function(){var t,n,r;return s(this,function(o){switch(o.label){case 0:if(!(r=b((null==e?void 0:e.blockModel)||(null==e||null==(n=e.model)||null==(t=n.context)?void 0:t.blockModel))))return window.print(),[2];return[4,c(function(){var e,t,n,o,i,c;return s(this,function(l){switch(l.label){case 0:if((e=document.createElement("iframe")).setAttribute("aria-hidden","true"),e.style.position="fixed",e.style.right="0",e.style.bottom="0",e.style.width="0",e.style.height="0",e.style.border="0",e.style.visibility="hidden",document.body.appendChild(e),t=e.contentWindow,n=e.contentDocument||(null==t?void 0:t.document),!t||!n)return e.remove(),window.print(),[2];return n.open(),n.write('<!doctype html><html><head><meta charset="utf-8" /></head><body></body></html>'),n.close(),d(window.document,n),(o=n.createElement("style")).textContent="\n@media print {\n html, body { margin: 0; padding: 0; }\n body { background: #fff; }\n [data-grid-root] { padding-top: 20px !important; }\n}\n",n.head.appendChild(o),(i=n.createElement("div")).style.padding="0",i.appendChild(r.cloneNode(!0)),n.body.appendChild(i),[4,new Promise(function(e){return setTimeout(e,50)})];case 1:return l.sent(),c=function(){return e.remove()},t.addEventListener("afterprint",c,{once:!0}),t.focus(),t.print(),setTimeout(c,200),[2]}})})()];case 1:return o.sent(),[2]}})})()}}}});function w(e){return(w=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function g(e,t){return(g=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function m(e){var t="function"==typeof Map?new Map:void 0;return(m=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return v(e,arguments,w(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),g(n,e)})(e)}function O(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(O=function(){return!!e})()}var P=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(){var e,t;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return e=n,t=arguments,e=w(e),function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,O()?Reflect.construct(e,t||[],w(this).constructor):e.apply(this,t))}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&g(n,e),t=[{key:"load",value:function(){var e;return(e=function(){return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(c,"next",{value:u(0)}),l(c,"throw",{value:u(1)}),l(c,"return",{value:u(2)}),"function"==typeof Symbol&&l(c,Symbol.iterator,{value:function(){return this}}),c;function u(l){return function(u){var a=[l,u];if(n)throw TypeError("Generator is already executing.");for(;c&&(c=0,a[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}}}(this,function(e){return this.flowEngine.registerModels({PrintActionModel:y}),[2]})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function c(e){h(i,r,o,c,l,"next",e)}function l(e){h(i,r,o,c,l,"throw",e)}c(void 0)})}).call(this)}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(n.prototype,t),n}(m(e.Plugin)),j=P}(),a}()});
10
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@nocobase/client-v2"),require("@nocobase/flow-engine")):"function"==typeof define&&define.amd?define("@nocobase/plugin-action-print/client-v2",["@nocobase/client-v2","@nocobase/flow-engine"],t):"object"==typeof exports?exports["@nocobase/plugin-action-print/client-v2"]=t(require("@nocobase/client-v2"),require("@nocobase/flow-engine")):e["@nocobase/plugin-action-print/client-v2"]=t(e["@nocobase/client-v2"],e["@nocobase/flow-engine"])}(self,function(e,t){return function(){"use strict";var n={485:function(t){t.exports=e},694:function(e){e.exports=t}},r={};function o(e){var t=r[e];if(void 0!==t)return t.exports;var i=r[e]={exports:{}};return n[e](i,i.exports,o),i.exports}o.d=function(e,t){for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.g.importScripts&&(i=o.g.location+"");var i,c=o.g.document;if(!i&&c&&(c.currentScript&&"SCRIPT"===c.currentScript.tagName.toUpperCase()&&(i=c.currentScript.src),!i)){var l=c.getElementsByTagName("script");if(l.length)for(var u=l.length-1;u>-1&&(!i||!/^http(s?):/.test(i));)i=l[u--].src}if(!i)throw Error("Automatic publicPath is not supported in this browser");o.p=i.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/");var a={};return!function(){var e="",t="u">typeof document?document.currentScript:null;if(t&&t.src&&(e=t.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")),!e){var n=window.__webpack_public_path__||"";n&&("/"!==n.charAt(n.length-1)&&(n+="/"),e=n+"static/plugins/@nocobase/plugin-action-print/dist/client-v2/")}if(!e){var r=window.__nocobase_modern_client_prefix__||"v",i="/"+(r=String(r).replace(/^\/+|\/+$/g,"")||"v")+"/";if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var c=window.location.pathname||"/",l=c.indexOf(i);e=l>=0?c.slice(0,l+1):"/"}e&&(e=e.replace(RegExp("/"+r+"/?$"),"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/@nocobase/plugin-action-print/dist/client-v2/"}o.p=e}(),!function(){o.r(a),o.d(a,{PrintActionModel:function(){return y},default:function(){return P},PluginActionPrintClient:function(){return _}});var e=o(485),t=o(694),n=JSON.parse('{"UU":"@nocobase/plugin-action-print"}');function r(e,r){return(0,t.tExpr)(e,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({ns:[n.UU,"client"],nsMode:"fallback"},r))}function i(e,t,n,r,o,i,c){try{var l=e[i](c),u=l.value}catch(e){n(e);return}l.done?t(u):Promise.resolve(u).then(r,o)}function c(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var c=e.apply(t,n);function l(e){i(c,r,o,l,u,"next",e)}function u(e){i(c,r,o,l,u,"throw",e)}l(void 0)})}}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function f(e,t){return(f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(p=function(){return!!e})()}function s(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(c,"next",{value:u(0)}),l(c,"throw",{value:u(1)}),l(c,"return",{value:u(2)}),"function"==typeof Symbol&&l(c,Symbol.iterator,{value:function(){return this}}),c;function u(l){return function(u){var a=[l,u];if(n)throw TypeError("Generator is already executing.");for(;c&&(c=0,a[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}}}var d=function(e,t){var n=t.head;e.querySelectorAll('link[rel="stylesheet"]').forEach(function(e){n.appendChild(e.cloneNode(!0))}),e.querySelectorAll("style").forEach(function(e){n.appendChild(e.cloneNode(!0))})},b=function(e){var t,n,r=null==e||null==(t=e.subModels)?void 0:t.grid,o=null==r||null==(n=r.gridContainerRef)?void 0:n.current;return o?o.querySelector("[data-grid-root]")||o:null},y=function(e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function t(){var e,n,o;if(!(this instanceof t))throw TypeError("Cannot call a class as a function");return n=t,o=arguments,n=u(n),l(e=function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,p()?Reflect.construct(n,o||[],u(this).constructor):n.apply(this,o)),"defaultProps",{type:"link",title:r("Print"),icon:"PrinterOutlined"}),e}return t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&f(t,e),t}(e.ActionModel);function h(e,t,n,r,o,i,c){try{var l=e[i](c),u=l.value}catch(e){n(e);return}l.done?t(u):Promise.resolve(u).then(r,o)}function v(e,t,n){return(v=O()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&w(o,n.prototype),o}).apply(null,arguments)}l(y,"scene",e.ActionSceneEnum.record),y.define({label:r("Print"),hide:function(e){var t,n=null==e?void 0:e.blockModel;return(null==n||null==(t=n.constructor)?void 0:t.name)!=="DetailsBlockModel"}}),y.registerFlow({key:"hideInTableRowActions",on:"beforeRender",steps:{apply:{hideInSettings:function(){return!0},handler:function(e){var t,n=null==e?void 0:e.blockModel;e.model.setHidden((null==n||null==(t=n.constructor)?void 0:t.name)!=="DetailsBlockModel")}}}}),y.registerFlow({key:"print",title:r("Print"),on:"click",steps:{print:{handler:function(e){return c(function(){var t,n,r;return s(this,function(o){switch(o.label){case 0:if(!(r=b((null==e?void 0:e.blockModel)||(null==e||null==(n=e.model)||null==(t=n.context)?void 0:t.blockModel))))return window.print(),[2];return[4,c(function(){var e,t,n,o,i,c;return s(this,function(l){switch(l.label){case 0:if((e=document.createElement("iframe")).setAttribute("aria-hidden","true"),e.style.position="fixed",e.style.right="0",e.style.bottom="0",e.style.width="0",e.style.height="0",e.style.border="0",e.style.visibility="hidden",document.body.appendChild(e),t=e.contentWindow,n=e.contentDocument||(null==t?void 0:t.document),!t||!n)return e.remove(),window.print(),[2];return n.open(),n.write('<!doctype html><html><head><meta charset="utf-8" /></head><body></body></html>'),n.close(),d(window.document,n),(o=n.createElement("style")).textContent="\n@media print {\n html, body { margin: 0; padding: 0; }\n body { background: #fff; }\n [data-grid-root] { padding-top: 20px !important; }\n}\n",n.head.appendChild(o),(i=n.createElement("div")).style.padding="0",i.appendChild(r.cloneNode(!0)),n.body.appendChild(i),[4,new Promise(function(e){return setTimeout(e,50)})];case 1:return l.sent(),c=function(){return e.remove()},t.addEventListener("afterprint",c,{once:!0}),t.focus(),t.print(),setTimeout(c,200),[2]}})})()];case 1:return o.sent(),[2]}})})()}}}});function g(e){return(g=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function w(e,t){return(w=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function m(e){var t="function"==typeof Map?new Map:void 0;return(m=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return v(e,arguments,g(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),w(n,e)})(e)}function O(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(O=function(){return!!e})()}var _=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(){var e,t;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return e=n,t=arguments,e=g(e),function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,O()?Reflect.construct(e,t||[],g(this).constructor):e.apply(this,t))}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&w(n,e),t=[{key:"load",value:function(){var e;return(e=function(){return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(c,"next",{value:u(0)}),l(c,"throw",{value:u(1)}),l(c,"return",{value:u(2)}),"function"==typeof Symbol&&l(c,Symbol.iterator,{value:function(){return this}}),c;function u(l){return function(u){var a=[l,u];if(n)throw TypeError("Generator is already executing.");for(;c&&(c=0,a[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}}}(this,function(e){return this.flowEngine.registerModels({PrintActionModel:y}),[2]})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function c(e){h(i,r,o,c,l,"next",e)}function l(e){h(i,r,o,c,l,"throw",e)}c(void 0)})}).call(this)}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(n.prototype,t),n}(m(e.Plugin)),P=_}(),a}()});
@@ -8,11 +8,11 @@
8
8
  */
9
9
 
10
10
  module.exports = {
11
- "@nocobase/client": "2.1.0-alpha.40",
11
+ "@nocobase/client": "2.1.0-alpha.46",
12
12
  "react": "18.2.0",
13
- "@nocobase/client-v2": "2.1.0-alpha.40",
13
+ "@nocobase/client-v2": "2.1.0-alpha.46",
14
14
  "antd": "5.24.2",
15
- "@nocobase/flow-engine": "2.1.0-alpha.40",
16
- "@nocobase/server": "2.1.0-alpha.40",
17
- "@nocobase/test": "2.1.0-alpha.40"
15
+ "@nocobase/flow-engine": "2.1.0-alpha.46",
16
+ "@nocobase/server": "2.1.0-alpha.46",
17
+ "@nocobase/test": "2.1.0-alpha.46"
18
18
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/plugin-action-print",
3
- "version": "2.1.0-alpha.40",
3
+ "version": "2.1.0-alpha.46",
4
4
  "main": "dist/server/index.js",
5
5
  "homepage": "https://docs.nocobase.com/handbook/action-print",
6
6
  "homepage.ru-RU": "https://docs.nocobase.ru/handbook/action-print",
@@ -18,7 +18,7 @@
18
18
  "@nocobase/server": "2.x",
19
19
  "@nocobase/test": "2.x"
20
20
  },
21
- "gitHead": "e73f99dd0abefe847f2e50ff0fea1f41a82fd048",
21
+ "gitHead": "42b269944cdd1908d7a848c0af4936fe94c03bb7",
22
22
  "keywords": [
23
23
  "Actions"
24
24
  ]