@nocobase/plugin-action-print 2.1.0-beta.32 → 2.1.0-beta.34
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/client-v2.d.ts +2 -0
- package/client-v2.js +1 -0
- package/dist/client-v2/PrintActionModel.d.ts +14 -0
- package/dist/client-v2/index.d.ts +14 -0
- package/dist/client-v2/index.js +10 -0
- package/dist/client-v2/locale.d.ts +10 -0
- package/dist/externalVersion.js +6 -3
- package/package.json +3 -2
package/client-v2.d.ts
ADDED
package/client-v2.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./dist/client-v2/index.js');
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import { ActionModel } from '@nocobase/client-v2';
|
|
10
|
+
import type { ButtonProps } from 'antd/es/button';
|
|
11
|
+
export declare class PrintActionModel extends ActionModel {
|
|
12
|
+
static scene: import("@nocobase/client-v2").ActionSceneType;
|
|
13
|
+
defaultProps: ButtonProps;
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import { Application, Plugin } from '@nocobase/client-v2';
|
|
10
|
+
export declare class PluginActionPrintClient extends Plugin<any, Application> {
|
|
11
|
+
load(): Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
export { PrintActionModel } from './PrintActionModel';
|
|
14
|
+
export default PluginActionPrintClient;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
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}()});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
export declare function useT(): (str: string, options?: any) => string;
|
|
10
|
+
export declare function tExpr(key: string, options?: any): string;
|
package/dist/externalVersion.js
CHANGED
|
@@ -8,8 +8,11 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
|
-
"@nocobase/client": "2.1.0-beta.
|
|
11
|
+
"@nocobase/client": "2.1.0-beta.34",
|
|
12
12
|
"react": "18.2.0",
|
|
13
|
-
"@nocobase/
|
|
14
|
-
"
|
|
13
|
+
"@nocobase/client-v2": "2.1.0-beta.34",
|
|
14
|
+
"antd": "5.24.2",
|
|
15
|
+
"@nocobase/flow-engine": "2.1.0-beta.34",
|
|
16
|
+
"@nocobase/server": "2.1.0-beta.34",
|
|
17
|
+
"@nocobase/test": "2.1.0-beta.34"
|
|
15
18
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/plugin-action-print",
|
|
3
|
-
"version": "2.1.0-beta.
|
|
3
|
+
"version": "2.1.0-beta.34",
|
|
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",
|
|
@@ -14,10 +14,11 @@
|
|
|
14
14
|
"license": "Apache-2.0",
|
|
15
15
|
"peerDependencies": {
|
|
16
16
|
"@nocobase/client": "2.x",
|
|
17
|
+
"@nocobase/client-v2": "2.x",
|
|
17
18
|
"@nocobase/server": "2.x",
|
|
18
19
|
"@nocobase/test": "2.x"
|
|
19
20
|
},
|
|
20
|
-
"gitHead": "
|
|
21
|
+
"gitHead": "ca804833299c547f8d49f8d58f73273a4bfcd03c",
|
|
21
22
|
"keywords": [
|
|
22
23
|
"Actions"
|
|
23
24
|
]
|