@nocobase/plugin-action-print 2.1.0-alpha.10 → 2.1.0-alpha.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.
@@ -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(){var n,r,o,i={631:function(t){t.exports=function(t,e){return"u">typeof __deoptimization_sideEffect__&&__deoptimization_sideEffect__(t,e),e}},342:function(t){"use strict";t.exports=e},155:function(e){"use strict";e.exports=t}},c={};function u(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,u),n.exports}u.m=i,u.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return u.d(e,{a:e}),e},l=Object.getPrototypeOf?function(t){return Object.getPrototypeOf(t)}:function(t){return t.__proto__},u.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);u.r(n);var r={};a=a||[null,l({}),l([]),l(l)];for(var o=2&e&&t;("object"==typeof o||"function"==typeof o)&&!~a.indexOf(o);o=l(o))Object.getOwnPropertyNames(o).forEach(function(e){r[e]=function(){return t[e]}});return r.default=function(){return t},u.d(n,r),n},u.d=function(t,e){for(var n in e)u.o(e,n)&&!u.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},u.f={},u.e=function(t){return Promise.all(Object.keys(u.f).reduce(function(e,n){return u.f[n](t,e),e},[]))},u.u=function(t){return"e99022b34044e4f9.js"},u.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(t){if("object"==typeof window)return window}}(),u.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},p={},u.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"),a=0;a<c.length;a++){var l=c[a];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,u.nc&&o.setAttribute("nonce",u.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)},u.r=function(t){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},u.g.importScripts&&(f=u.g.location+"");var a,l,p,f,s=u.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 y=b.length-1;y>-1&&(!f||!/^http(s?):/.test(f));)f=b[y--].src}if(!f)throw Error("Automatic publicPath is not supported in this browser");u.p=f.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n={889:0},u.f.j=function(t,e){var r=u.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=u.p+u.u(t),c=Error();u.l(i,function(e){if(u.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],a=e[2],l=0;if(i.some(function(t){return 0!==n[t]})){for(r in c)u.o(c,r)&&(u.m[r]=c[r]);a&&a(u)}for(t&&t(e);l<i.length;l++)o=i[l],u.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 d={};return!function(){"use strict";var t=window.__webpack_public_path__||"/";"/"!==t.charAt(t.length-1)&&(t+="/"),u.p=t+"static/plugins/@nocobase/plugin-action-print/dist/client/"}(),!function(){"use strict";u.r(d),u.d(d,{default:function(){return O},PluginActionPrintClient:function(){return g}});var t=u(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=u(155),i=u.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))},a=u(631);function l(t,e,n,r,o,i,c){try{var u=t[i](c),a=u.value}catch(t){n(t);return}u.done?e(a):Promise.resolve(a).then(r,o)}var p=function(){var e=(0,t.useFormBlockContext)(),n=(0,t.useDetailsBlockContext)().formBlockRef,r=(0,t.useLazy)(function(){return a("imported_19jiev_component",u.e("114").then(u.t.bind(u,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),u=Object.defineProperty;return u(c,"next",{value:a(0)}),u(c,"throw",{value:a(1)}),u(c,"return",{value:a(2)}),"function"==typeof Symbol&&u(c,Symbol.iterator,{value:function(){return this}}),c;function a(u){return function(a){var l=[u,a];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){l(i,r,o,c,u,"next",t)}function u(t){l(i,r,o,c,u,"throw",t)}c(void 0)})})()}}},f=function(e){return i().createElement(t.SchemaComponentOptions,{components:{PrintActionInitializer:c},scope:{useDetailPrintActionProps:p}},e.children)};function s(t,e,n,r,o,i,c){try{var u=t[i](c),a=u.value}catch(t){n(t);return}u.done?e(a):Promise.resolve(a).then(r,o)}function b(t,e,n){return(b=v()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var o=new(Function.bind.apply(t,r));return n&&h(o,n.prototype),o}).apply(null,arguments)}function y(t){return(y=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function h(t,e){return(h=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function m(t){var e="function"==typeof Map?new Map:void 0;return(m=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 b(t,arguments,y(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),h(n,t)})(t)}function v(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(v=function(){return!!t})()}var g=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=y(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,v()?Reflect.construct(t,e||[],y(this).constructor):t.apply(this,e))}return o.prototype=Object.create(t&&t.prototype,{constructor:{value:o,writable:!0,configurable:!0}}),t&&h(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),u=Object.defineProperty;return u(c,"next",{value:a(0)}),u(c,"throw",{value:a(1)}),u(c,"return",{value:a(2)}),"function"==typeof Symbol&&u(c,Symbol.iterator,{value:function(){return this}}),c;function a(u){return function(a){var l=[u,a];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(f),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){s(i,r,o,c,u,"next",t)}function u(t){s(i,r,o,c,u,"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}(m(t.Plugin)),O=g}(),d}()});
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 u(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,u),n.exports}u.m=i,u.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return u.d(e,{a:e}),e},l=Object.getPrototypeOf?function(t){return Object.getPrototypeOf(t)}:function(t){return t.__proto__},u.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);u.r(n);var r={};a=a||[null,l({}),l([]),l(l)];for(var o=2&e&&t;("object"==typeof o||"function"==typeof o)&&!~a.indexOf(o);o=l(o))Object.getOwnPropertyNames(o).forEach(function(e){r[e]=function(){return t[e]}});return r.default=function(){return t},u.d(n,r),n},u.d=function(t,e){for(var n in e)u.o(e,n)&&!u.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},u.f={},u.e=function(t){return Promise.all(Object.keys(u.f).reduce(function(e,n){return u.f[n](t,e),e},[]))},u.u=function(t){return"e99022b34044e4f9.js"},u.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(t){if("object"==typeof window)return window}}(),u.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},p={},u.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"),a=0;a<c.length;a++){var l=c[a];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,u.nc&&o.setAttribute("nonce",u.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)},u.r=function(t){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},u.g.importScripts&&(f=u.g.location+"");var a,l,p,f,s=u.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 y=b.length-1;y>-1&&(!f||!/^http(s?):/.test(f));)f=b[y--].src}if(!f)throw Error("Automatic publicPath is not supported in this browser");u.p=f.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n={889:0},u.f.j=function(t,e){var r=u.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=u.p+u.u(t),c=Error();u.l(i,function(e){if(u.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],a=e[2],l=0;if(i.some(function(t){return 0!==n[t]})){for(r in c)u.o(c,r)&&(u.m[r]=c[r]);a&&a(u)}for(t&&t(e);l<i.length;l++)o=i[l],u.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 d={},h=window.__nocobase_public_path__||"";if(!h&&window.location&&window.location.pathname){var m=window.location.pathname||"/",v=m.indexOf("/v2/");h=v>=0?m.slice(0,v+1):"/"}return h&&(h=h.replace(/\/v2\/?$/,"/")),h||(h="/"),"/"!==h.charAt(h.length-1)&&(h+="/"),u.p=h+"static/plugins/@nocobase/plugin-action-print/dist/client/",!function(){u.r(d),u.d(d,{default:function(){return g},PluginActionPrintClient:function(){return v}});var t=u(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=u(155),i=u.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 a(t,e,n,r,o,i,c){try{var u=t[i](c),a=u.value}catch(t){n(t);return}u.done?e(a):Promise.resolve(a).then(r,o)}var l=function(){var e=(0,t.useFormBlockContext)(),n=(0,t.useDetailsBlockContext)().formBlockRef,r=(0,t.useLazy)(function(){return u.e("114").then(u.t.bind(u,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),u=Object.defineProperty;return u(c,"next",{value:a(0)}),u(c,"throw",{value:a(1)}),u(c,"return",{value:a(2)}),"function"==typeof Symbol&&u(c,Symbol.iterator,{value:function(){return this}}),c;function a(u){return function(a){var l=[u,a];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){a(i,r,o,c,u,"next",t)}function u(t){a(i,r,o,c,u,"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 u=t[i](c),a=u.value}catch(t){n(t);return}u.done?e(a):Promise.resolve(a).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&&y(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 y(t,e){return(y=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}}),y(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&&y(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),u=Object.defineProperty;return u(c,"next",{value:a(0)}),u(c,"throw",{value:a(1)}),u(c,"return",{value:a(2)}),"function"==typeof Symbol&&u(c,Symbol.iterator,{value:function(){return this}}),c;function a(u){return function(a){var l=[u,a];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,u,"next",t)}function u(t){f(i,r,o,c,u,"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}(),d}()});
@@ -8,8 +8,8 @@
8
8
  */
9
9
 
10
10
  module.exports = {
11
- "@nocobase/client": "2.1.0-alpha.10",
11
+ "@nocobase/client": "2.1.0-alpha.11",
12
12
  "react": "18.2.0",
13
- "@nocobase/server": "2.1.0-alpha.10",
14
- "@nocobase/test": "2.1.0-alpha.10"
13
+ "@nocobase/server": "2.1.0-alpha.11",
14
+ "@nocobase/test": "2.1.0-alpha.11"
15
15
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/plugin-action-print",
3
- "version": "2.1.0-alpha.10",
3
+ "version": "2.1.0-alpha.11",
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",
@@ -17,7 +17,7 @@
17
17
  "@nocobase/server": "2.x",
18
18
  "@nocobase/test": "2.x"
19
19
  },
20
- "gitHead": "ce790d46c0a5768ca9618c7d0d77ab8300de75c8",
20
+ "gitHead": "bb96d633a6371afb586072ff516bd0613c757db0",
21
21
  "keywords": [
22
22
  "Actions"
23
23
  ]