@nocobase/plugin-file-manager 2.1.0-beta.8 → 2.2.0-alpha.1
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/867ada653cd02a3e.mjs +6 -0
- package/dist/client/876.ca16d7a6e6387862.js +11 -0
- package/dist/client/index.d.ts +2 -1
- package/dist/client/index.js +1 -1
- package/dist/client/locale/index.d.ts +2 -1
- package/dist/client/previewer/filePreviewTypes.d.ts +1 -31
- package/dist/client/templates/file.d.ts +1 -1
- package/dist/client-v2/125.0b8eef1f19b87042.js +10 -0
- package/dist/client-v2/229.bd72c2d7aa088310.js +10 -0
- package/dist/client-v2/336.1dd1b32466d0c778.js +10 -0
- package/dist/client-v2/43.eb45d53ba3e9828b.js +10 -0
- package/dist/client-v2/450.30cc3ed6973d8c4d.js +10 -0
- package/dist/client-v2/867ada653cd02a3e.mjs +6 -0
- package/dist/client-v2/876.22cd8e41ac8631ed.js +11 -0
- package/dist/client-v2/929.d7e783304cc1f236.js +10 -0
- package/dist/client-v2/942.f36d807d763a1b53.js +10 -0
- package/dist/{client/StorageOptions.d.ts → client-v2/components/BaseUrlField.d.ts} +1 -1
- package/dist/client-v2/components/DefaultField.d.ts +18 -0
- package/dist/client-v2/components/FileSizeField.d.ts +10 -0
- package/dist/client-v2/components/MimetypeField.d.ts +10 -0
- package/dist/client-v2/components/NameField.d.ts +10 -0
- package/dist/client-v2/components/ParanoidField.d.ts +10 -0
- package/dist/client-v2/components/PathField.d.ts +18 -0
- package/dist/client-v2/components/RenameModeField.d.ts +10 -0
- package/dist/client-v2/components/TitleField.d.ts +10 -0
- package/dist/client-v2/components/index.d.ts +17 -0
- package/dist/client-v2/index.d.ts +17 -0
- package/dist/client-v2/index.js +10 -0
- package/dist/client-v2/locale.d.ts +10 -0
- package/dist/{client → client-v2}/models/DisplayPreviewFieldModel.d.ts +1 -1
- package/dist/{client → client-v2}/models/UploadActionModel.d.ts +4 -3
- package/dist/{client → client-v2}/models/UploadFieldModel.d.ts +1 -1
- package/dist/client-v2/models/index.d.ts +11 -0
- package/dist/client-v2/models/uploadFieldUtils.d.ts +64 -0
- package/dist/client-v2/pages/FileStoragePage.d.ts +10 -0
- package/dist/client-v2/plugin.d.ts +89 -0
- package/dist/client-v2/previewer/filePreviewTypes.d.ts +46 -0
- package/dist/client-v2/storage-forms/AliOssStorageForm.d.ts +10 -0
- package/dist/client-v2/storage-forms/LocalStorageForm.d.ts +10 -0
- package/dist/client-v2/storage-forms/S3StorageForm.d.ts +10 -0
- package/dist/client-v2/storage-forms/TxCosStorageForm.d.ts +10 -0
- package/dist/common/collections/attachments.d.ts +1 -0
- package/dist/common/collections/attachments.js +1 -0
- package/dist/common/collections/storages.d.ts +1 -0
- package/dist/common/collections/storages.js +1 -0
- package/dist/externalVersion.js +12 -12
- package/dist/locale/de-DE.json +3 -0
- package/dist/locale/en-US.json +4 -0
- package/dist/locale/es-ES.json +3 -0
- package/dist/locale/fr-FR.json +3 -0
- package/dist/locale/hu-HU.json +4 -1
- package/dist/locale/id-ID.json +4 -1
- package/dist/locale/it-IT.json +3 -0
- package/dist/locale/ja-JP.json +3 -0
- package/dist/locale/ko-KR.json +3 -0
- package/dist/locale/nl-NL.json +3 -0
- package/dist/locale/pt-BR.json +3 -0
- package/dist/locale/ru-RU.json +3 -0
- package/dist/locale/tr-TR.json +3 -0
- package/dist/locale/uk-UA.json +3 -0
- package/dist/locale/vi-VN.json +4 -1
- package/dist/locale/zh-CN.json +4 -0
- package/dist/locale/zh-TW.json +3 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/index.js +190 -190
- package/dist/node_modules/@aws-sdk/client-s3/package.json +1 -1
- package/dist/node_modules/@aws-sdk/lib-storage/dist-cjs/index.js +195 -195
- package/dist/node_modules/@aws-sdk/lib-storage/node_modules/buffer/index.d.ts +186 -0
- package/dist/node_modules/@aws-sdk/lib-storage/node_modules/buffer/index.js +1794 -0
- package/dist/node_modules/@aws-sdk/lib-storage/node_modules/buffer/package.json +82 -0
- package/dist/node_modules/@aws-sdk/lib-storage/package.json +1 -1
- package/dist/node_modules/ali-oss/lib/client.js +14 -14
- package/dist/node_modules/ali-oss/package.json +1 -1
- package/dist/node_modules/cos-nodejs-sdk-v5/.github/workflows/auto-changelog.yml +55 -0
- package/dist/node_modules/cos-nodejs-sdk-v5/.prettierrc +10 -0
- package/dist/node_modules/cos-nodejs-sdk-v5/.travis.yml +16 -0
- package/dist/node_modules/cos-nodejs-sdk-v5/LICENSE +21 -0
- package/dist/node_modules/cos-nodejs-sdk-v5/demo/crc64.js +9 -0
- package/dist/node_modules/cos-nodejs-sdk-v5/demo/demo-sts-scope.js +75 -0
- package/dist/node_modules/cos-nodejs-sdk-v5/demo/demo-sts.js +65 -0
- package/dist/node_modules/cos-nodejs-sdk-v5/demo/demo.js +4542 -0
- package/dist/node_modules/cos-nodejs-sdk-v5/demo/util.js +135 -0
- package/dist/node_modules/cos-nodejs-sdk-v5/index.d.ts +2610 -0
- package/dist/node_modules/cos-nodejs-sdk-v5/index.js +220 -0
- package/dist/node_modules/cos-nodejs-sdk-v5/package.json +1 -0
- package/dist/node_modules/cos-nodejs-sdk-v5/sdk/advance.js +1659 -0
- package/dist/node_modules/cos-nodejs-sdk-v5/sdk/async.js +59 -0
- package/dist/node_modules/cos-nodejs-sdk-v5/sdk/base.js +4404 -0
- package/dist/node_modules/cos-nodejs-sdk-v5/sdk/cos.js +137 -0
- package/dist/node_modules/cos-nodejs-sdk-v5/sdk/event.js +34 -0
- package/dist/node_modules/cos-nodejs-sdk-v5/sdk/select-stream.js +181 -0
- package/dist/node_modules/cos-nodejs-sdk-v5/sdk/session.js +126 -0
- package/dist/node_modules/cos-nodejs-sdk-v5/sdk/task.js +255 -0
- package/dist/node_modules/cos-nodejs-sdk-v5/sdk/util.js +776 -0
- package/dist/node_modules/cos-nodejs-sdk-v5/test/csp.js +1302 -0
- package/dist/node_modules/cos-nodejs-sdk-v5/test/test.js +6119 -0
- package/dist/node_modules/mime-match/index.js +1 -1
- package/dist/node_modules/mime-match/package.json +1 -1
- package/dist/node_modules/mime-types/index.js +3 -3
- package/dist/node_modules/mime-types/package.json +1 -1
- package/dist/node_modules/mkdirp/index.js +1 -1
- package/dist/node_modules/mkdirp/package.json +1 -1
- package/dist/node_modules/url-join/lib/url-join.js +1 -1
- package/dist/node_modules/url-join/package.json +1 -1
- package/dist/server/actions/attachments.js +2 -2
- package/dist/server/actions/index.js +8 -1
- package/dist/server/actions/storage-validation.d.ts +10 -0
- package/dist/server/actions/storage-validation.js +73 -0
- package/dist/server/commands/repair-filenames.d.ts +55 -0
- package/dist/server/commands/repair-filenames.js +283 -0
- package/dist/server/index.d.ts +1 -1
- package/dist/server/index.js +2 -0
- package/dist/server/server.d.ts +5 -2
- package/dist/server/server.js +19 -7
- package/dist/server/storages/ali-oss.d.ts +3 -1
- package/dist/server/storages/ali-oss.js +23 -2
- package/dist/server/storages/index.d.ts +7 -1
- package/dist/server/storages/index.js +8 -1
- package/dist/server/storages/local.d.ts +6 -0
- package/dist/server/storages/local.js +76 -11
- package/dist/server/storages/s3.d.ts +2 -0
- package/dist/server/storages/s3.js +26 -0
- package/dist/server/storages/tx-cos.d.ts +18 -1
- package/dist/server/storages/tx-cos.js +138 -10
- package/dist/server/utils.d.ts +3 -0
- package/dist/server/utils.js +72 -4
- package/package.json +8 -3
- package/dist/node_modules/multer-cos/LICENSE +0 -24
- package/dist/node_modules/multer-cos/demo/index.js +0 -39
- package/dist/node_modules/multer-cos/demo/myMulter.js +0 -88
- package/dist/node_modules/multer-cos/index.js +0 -220
- package/dist/node_modules/multer-cos/package.json +0 -1
|
@@ -6,34 +6,4 @@
|
|
|
6
6
|
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
|
-
|
|
10
|
-
export interface FilePreviewerProps {
|
|
11
|
-
file: any;
|
|
12
|
-
index: number;
|
|
13
|
-
list: any[];
|
|
14
|
-
open?: boolean;
|
|
15
|
-
onOpenChange?: (open: boolean) => void;
|
|
16
|
-
onSwitchIndex?: (index: number) => void;
|
|
17
|
-
onClose?: () => void;
|
|
18
|
-
onDownload: (file: any) => void;
|
|
19
|
-
}
|
|
20
|
-
export interface FilePreviewType {
|
|
21
|
-
match(file: any): boolean;
|
|
22
|
-
getThumbnailURL?: (file: any) => string | null;
|
|
23
|
-
Previewer?: React.ComponentType<FilePreviewerProps>;
|
|
24
|
-
}
|
|
25
|
-
export declare class FilePreviewTypes {
|
|
26
|
-
types: FilePreviewType[];
|
|
27
|
-
add(type: FilePreviewType): void;
|
|
28
|
-
getTypeByFile(file: any): Omit<FilePreviewType, 'match'> | undefined;
|
|
29
|
-
}
|
|
30
|
-
export declare const filePreviewTypes: FilePreviewTypes;
|
|
31
|
-
export declare function normalizePreviewFile(file: any): any;
|
|
32
|
-
export declare function getPreviewFileUrl(file: any): any;
|
|
33
|
-
export declare function getFileUrl(file: any): any;
|
|
34
|
-
export declare const getFileExt: (file: any, url?: string) => string;
|
|
35
|
-
export declare const getFileName: (file: any, url?: string) => any;
|
|
36
|
-
export declare const getFallbackIcon: (file: any, url?: string) => string;
|
|
37
|
-
export declare const getPreviewThumbnailUrl: (file: any) => string;
|
|
38
|
-
export declare const wrapWithModalPreviewer: (Previewer: React.ComponentType<FilePreviewerProps>) => (props: FilePreviewerProps) => React.JSX.Element;
|
|
39
|
-
export declare const FilePreviewRenderer: (props: FilePreviewerProps) => React.JSX.Element;
|
|
9
|
+
export * from '../../client-v2/previewer/filePreviewTypes';
|
|
@@ -124,10 +124,10 @@ export declare class FileCollectionTemplate extends CollectionTemplate {
|
|
|
124
124
|
initPrimaryKeyFiledInterface(properties: any): void;
|
|
125
125
|
};
|
|
126
126
|
configurableProperties: {
|
|
127
|
+
title: any;
|
|
127
128
|
name: any;
|
|
128
129
|
createdAt: any;
|
|
129
130
|
updatedAt: any;
|
|
130
|
-
title: any;
|
|
131
131
|
description: any;
|
|
132
132
|
updatedBy: any;
|
|
133
133
|
createdBy: any;
|
|
@@ -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
|
+
"use strict";(self.webpackChunk_nocobase_plugin_file_manager_client_v2=self.webpackChunk_nocobase_plugin_file_manager_client_v2||[]).push([["125"],{212:function(e,t,r){r.r(t),r.d(t,{DisplayPreviewFieldModel:function(){return P}});var n=r(477),o=r(485),l=r(694),a=r(59),i=r(773),c=r(155),u=r.n(c),s=r(953),f=r(23);function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function b(e,t,r,n,o,l,a){try{var i=e[l](a),c=i.value}catch(e){r(e);return}i.done?t(c):Promise.resolve(c).then(n,o)}function y(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function h(e,t){return null!=t&&"u">typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}function m(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){y(e,t,r[t])})}return e}function v(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}function w(e,t){return(w=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function g(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var l=[],a=!0,i=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(l.push(r.value),!t||l.length!==t);a=!0);}catch(e){i=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(i)throw n}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return p(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return p(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function O(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(O=function(){return!!e})()}function j(){var e,t,r=(e=["\n .ant-image-img {\n border: 1px solid #d9d9d9;\n padding: 2px;\n }\n "],t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return j=function(){return r},r}var k=function(e){var t=e.file,r=e.size,o=e.showFileName,l=e.onClick,i=(0,f._H)(t),c=(0,f.q)(i);if(!c)return null;var s=(0,f.WP)(i,c),p=(0,f._Y)(i,c),b=(0,f.qk)(i)||p,y=u().createElement("div",{className:(0,n.css)(j())},u().createElement(a.Image,{src:b,fallback:p,width:r,height:r,preview:!1,style:{borderRadius:4,objectFit:"cover",boxShadow:"0 0 0 2px #fff"}}));return u().createElement("div",{onClick:l,style:{textAlign:"center",width:r,wordBreak:"break-all",cursor:l?"pointer":"default"}},y,o&&u().createElement(a.Tooltip,{title:s},u().createElement("div",{style:{fontSize:12,marginTop:4,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%"}},s)))},S=function(e){var t=e.value,r=void 0===t?[]:t,n=e.size,o=void 0===n?28:n,l=e.showFileName,c=(0,s.useTranslation)().t,p=g(u().useState(0),2),y=p[0],d=p[1],h=g(u().useState(!1),2),m=h[0],v=h[1],w=u().useMemo(function(){return(0,i.castArray)(r).filter(Boolean).map(f._H).filter(function(e){return(0,f.q)(e)})},[r]);u().useEffect(function(){y>=w.length&&w.length&&d(0)},[y,w.length]),u().useEffect(function(){!w.length&&m&&v(!1)},[w.length,m]);var O=u().useCallback(function(e){var t;return(t=function(){var t,r,n,o,l,i,u;return function(e,t){var r,n,o,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),i=Object.defineProperty;return i(a,"next",{value:c(0)}),i(a,"throw",{value:c(1)}),i(a,"return",{value:c(2)}),"function"==typeof Symbol&&i(a,Symbol.iterator,{value:function(){return this}}),a;function c(i){return function(c){var u=[i,c];if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(l=0)),l;)try{if(r=1,n&&(o=2&u[0]?n.return:u[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;switch(n=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return l.label++,{value:u[1],done:!1};case 5:l.label++,n=u[1],u=[0];continue;case 7:u=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){l=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){l.label=u[1];break}if(6===u[0]&&l.label<o[1]){l.label=o[1],o=u;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(u);break}o[2]&&l.ops.pop(),l.trys.pop();continue}u=t.call(e,l)}catch(e){u=[6,e],n=0}finally{r=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,function(s){switch(s.label){case 0:if(!(t=e||w[y])||!(r=t.url||t.preview))return[2];n=(0,f.ub)(t,r),s.label=1;case 1:return s.trys.push([1,4,5,6]),[4,fetch(r)];case 2:if(!(i=s.sent()).ok)throw Error("Download failed with status ".concat(i.status));return[4,i.blob()];case 3:return u=s.sent(),o=URL.createObjectURL(u),(l=document.createElement("a")).href=o,l.download=n,document.body.appendChild(l),l.click(),[3,6];case 4:return console.error("File download failed:",s.sent()),a.message.error(c("file-manager:File download failed")),[3,6];case 5:return l&&l.remove(),o&&setTimeout(function(){URL.revokeObjectURL(o)},1e3),[7];case 6:return[2]}})},function(){var e=this,r=arguments;return new Promise(function(n,o){var l=t.apply(e,r);function a(e){b(l,n,o,a,i,"next",e)}function i(e){b(l,n,o,a,i,"throw",e)}a(void 0)})})()},[y,w,c]),j=u().useCallback(function(e){d(e),v(!0)},[]),S=u().useCallback(function(e){e<0||e>=w.length||d(e)},[w.length]);return u().createElement(u().Fragment,null,u().createElement(a.Space,{wrap:!0},w.map(function(e,t){return u().createElement(k,{file:e,size:o,key:t,showFileName:l,onClick:function(){return j(t)}})})),w[y]?u().createElement(f.Mo,{open:m,file:w[y],index:y,list:w,onOpenChange:v,onClose:function(){return v(!1)},onSwitchIndex:S,onDownload:O}):null)},P=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function r(){var e,t,n;if(!(this instanceof r))throw TypeError("Cannot call a class as a function");return t=r,n=arguments,t=d(t),y(e=function(e,t){var r;if(t&&("object"==((r=t)&&"u">typeof Symbol&&r.constructor===Symbol?"symbol":typeof r)||"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(t,n||[],d(this).constructor):t.apply(this,n)),"disableTitleField",!0),e}return r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),e&&w(r,e),t=[{key:"render",value:function(){var e=this,t=this.props,r=t.value,n=t.titleField,o=t.template,l=t.target;return n&&"file"!==o&&"attachments"!==l?(0,i.castArray)(r).flatMap(function(t,r){var o=null==t?void 0:t[n],l=o?u().createElement(S,v(m({key:r},e.props),{value:(0,i.castArray)(o).filter(Boolean)})):u().createElement("span",{key:r},"N/A");return 0===r?[l]:[u().createElement("span",{key:"sep-".concat(r)},", "),l]}):u().createElement(S,v(m({},this.props),{value:(0,i.castArray)(r).filter(Boolean)}))}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(r.prototype,t),r}(o.FieldModel);P.registerFlow({key:"previewReadPrettySetting",sort:500,title:(0,l.tExpr)("Preview Settings"),steps:{size:{title:(0,l.tExpr)("Size"),uiMode:function(e){var t=e.t;return{type:"select",key:"size",props:{options:[{value:300,label:t("Large")},{value:100,label:t("Middle")},{value:28,label:t("Small")}]}}},hideInSettings:function(e){return h(e.model.parent,o.TableColumnModel)},defaultParams:function(e){return{size:h(e.model.parent,o.DetailsItemModel)?100:28}},handler:function(e,t){e.model.setProps("size",t.size)}},showFileName:{title:(0,l.tExpr)("Show file name"),uiMode:{type:"switch",key:"showFileName"},hideInSettings:function(e){return h(e.model.parent,o.TableColumnModel)},defaultParams:{showFileName:!1},handler:function(e,t){e.model.setProps("showFileName",t.showFileName)}}}}),P.define({label:(0,l.tExpr)("Preview")}),l.DisplayItemModel.bindModelToInterface("DisplayPreviewFieldModel",["url","attachment","attachmentURL","m2m","m2o","o2o","o2m","oho","obo","mbm"],{isDefault:!0,when:function(e,t){return!t.targetCollection||"file"===t.targetCollection.template}})}}]);
|
|
@@ -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
|
+
"use strict";(self.webpackChunk_nocobase_plugin_file_manager_client_v2=self.webpackChunk_nocobase_plugin_file_manager_client_v2||[]).push([["229"],{316:function(e,l,n){n.r(l),n.d(l,{default:function(){return o}});var t=n(485),a=n(59),r=n(155),c=n.n(r),m=n(564),u=n(488);function o(){var e=(0,u.k)(),l=[{required:!0,message:e("The field value is required")}];return c().createElement(c().Fragment,null,c().createElement(m.Lg,null),c().createElement(m.om,null),c().createElement(m.BL,null),c().createElement(a.Form.Item,{name:["options","Region"],label:"".concat(e("Region")," :"),rules:l},c().createElement(t.EnvVariableInput,null)),c().createElement(a.Form.Item,{name:["options","SecretId"],label:"".concat(e("SecretId")," :"),rules:l},c().createElement(t.EnvVariableInput,null)),c().createElement(a.Form.Item,{name:["options","SecretKey"],label:"".concat(e("SecretKey")," :"),rules:l},c().createElement(t.EnvVariableInput,{password:!0})),c().createElement(a.Form.Item,{name:["options","Bucket"],label:"".concat(e("Bucket")," :"),rules:l},c().createElement(t.EnvVariableInput,null)),c().createElement(a.Form.Item,{name:["options","thumbnailRule"],label:"".concat(e("Thumbnail rule")," :")},c().createElement(t.EnvVariableInput,{placeholder:"?imageMogr2/thumbnail/!50p"})),c().createElement(m.Sx,null),c().createElement(m.OC,null),c().createElement(m.KT,null),c().createElement(m.Lq,null),c().createElement(m.mt,null),c().createElement(m.tp,null))}}}]);
|
|
@@ -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
|
+
"use strict";(self.webpackChunk_nocobase_plugin_file_manager_client_v2=self.webpackChunk_nocobase_plugin_file_manager_client_v2||[]).push([["336"],{595:function(e,n,t){t.r(n),t.d(n,{default:function(){return o}});var l=t(485),a=t(59),r=t(155),c=t.n(r),m=t(564),u=t(488);function o(){var e=(0,u.k)(),n=[{required:!0,message:e("The field value is required")}];return c().createElement(c().Fragment,null,c().createElement(m.Lg,null),c().createElement(m.om,null),c().createElement(m.BL,null),c().createElement(a.Form.Item,{name:["options","region"],label:"".concat(e("Region")," :"),rules:n},c().createElement(l.EnvVariableInput,null)),c().createElement(a.Form.Item,{name:["options","accessKeyId"],label:"".concat(e("AccessKey ID")," :"),rules:n},c().createElement(l.EnvVariableInput,null)),c().createElement(a.Form.Item,{name:["options","secretAccessKey"],label:"".concat(e("AccessKey Secret")," :"),rules:n},c().createElement(l.EnvVariableInput,{password:!0})),c().createElement(a.Form.Item,{name:["options","bucket"],label:"".concat(e("Bucket")," :"),rules:n},c().createElement(l.EnvVariableInput,null)),c().createElement(a.Form.Item,{name:["options","endpoint"],label:"".concat(e("Endpoint")," :")},c().createElement(l.EnvVariableInput,null)),c().createElement(m.Sx,null),c().createElement(m.OC,null),c().createElement(m.KT,null),c().createElement(m.Lq,null),c().createElement(m.mt,null),c().createElement(m.tp,null))}}}]);
|
|
@@ -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
|
+
"use strict";(self.webpackChunk_nocobase_plugin_file_manager_client_v2=self.webpackChunk_nocobase_plugin_file_manager_client_v2||[]).push([["43"],{574:function(e,t,n){n.r(t),n.d(t,{default:function(){return s}});var l=n(485),a=n(59),r=n(155),c=n.n(r),o=n(564),m=n(488);function s(){var e=(0,m.k)(),t=[{required:!0,message:e("The field value is required")}];return c().createElement(c().Fragment,null,c().createElement(o.Lg,null),c().createElement(o.om,null),c().createElement(o.BL,null),c().createElement(a.Form.Item,{name:["options","region"],label:"".concat(e("Region")," :"),rules:t,extra:e('Aliyun OSS region part of the bucket. For example: "oss-cn-beijing".')},c().createElement(l.EnvVariableInput,null)),c().createElement(a.Form.Item,{name:["options","accessKeyId"],label:"".concat(e("AccessKey ID")," :"),rules:t},c().createElement(l.EnvVariableInput,null)),c().createElement(a.Form.Item,{name:["options","accessKeySecret"],label:"".concat(e("AccessKey Secret")," :"),rules:t},c().createElement(l.EnvVariableInput,{password:!0})),c().createElement(a.Form.Item,{name:["options","bucket"],label:"".concat(e("Bucket")," :"),rules:t},c().createElement(l.EnvVariableInput,null)),c().createElement(a.Form.Item,{name:["options","timeout"],label:"".concat(e("Timeout")," :"),extra:e("Upload timeout for a single file in milliseconds. Default is 600000.")},c().createElement(a.InputNumber,{style:{width:"100%"}})),c().createElement(a.Form.Item,{name:["options","thumbnailRule"],label:"".concat(e("File pre-process parameters")," :")},c().createElement(l.EnvVariableInput,{placeholder:"?x-oss-process=image/auto-orient,1/resize,m_fill,w_94,h_94/quality,q_90"})),c().createElement(o.Sx,null),c().createElement(o.OC,null),c().createElement(o.KT,null),c().createElement(o.Lq,null),c().createElement(o.mt,null),c().createElement(o.tp,null),c().createElement(a.Form.Item,{name:["settings","requestOptions"],label:"".concat(e("Request options")," :"),extra:e("Additional options for HTTP requests when fetching files from remote storage on server side, such as headers.")},c().createElement(l.JsonTextArea,{autoSize:{minRows:5}})))}}}]);
|
|
@@ -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
|
+
"use strict";(self.webpackChunk_nocobase_plugin_file_manager_client_v2=self.webpackChunk_nocobase_plugin_file_manager_client_v2||[]).push([["450"],{177:function(e,t,n){n.r(t),n.d(t,{UploadActionModel:function(){return F},useBeforeUpload:function(){return U},useStorageCfg:function(){return M},useStorageUploadProps:function(){return _},useStorage:function(){return B},validate:function(){return A}});var r=n(375),o=n(485),i=n(694),l=n(625),a=n(59);let u="bits",c="bytes",s="jedec",p={iec:{bits:["bit","Kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],bytes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},jedec:{bits:["bit","Kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],bytes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]}},f={iec:["","kibi","mebi","gibi","tebi","pebi","exbi","zebi","yobi"],jedec:["","kilo","mega","giga","tera","peta","exa","zetta","yotta"]};var d=n(484),b=n.n(d),y=n(155),v=n.n(y),m=n(953);function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function h(e,t,n,r,o,i,l){try{var a=e[i](l),u=a.value}catch(e){n(e);return}a.done?t(u):Promise.resolve(u).then(r,o)}function w(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function O(e,t,n){return(O="u">typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=S(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n||e):o.value}})(e,t,n||e)}function S(e){return(S=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function k(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){w(e,t,n[t])})}return e}function x(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function E(e,t){return(E=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function j(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],l=!0,a=!1;try{for(o=o.call(e);!(l=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);l=!0);}catch(e){a=!0,r=e}finally{try{l||null==o.return||o.return()}finally{if(a)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return g(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return g(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function P(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(P=function(){return!!e})()}function T(e){return e&&"main"!==e?{"x-data-source":e}:{}}var C=function(e){var t,n,r,o=(0,i.useFlowContext)(),l=(0,y.useMemo)(function(){var t="".concat(e.context.collection.name,":create"),n=null==(r=e.context.blockModel.association)?void 0:r.resourceName;if((null==(l=o.view)||null==(i=l.inputArgs)?void 0:i.sourceId)&&n){var r,i,l,a,u=j(n.split("."),2),c=u[0],s=u[1];t="".concat(c,"/").concat(null==(a=o.view)?void 0:a.inputArgs.sourceId,"/").concat(s,":create")}return t},[null==(t=e.context.blockModel.association)?void 0:t.resourceName,e.context.collection.name,null==(r=o.view)||null==(n=r.inputArgs)?void 0:n.sourceId]),a={},u=0,c={action:l,onChange:function(t){var n=t.fileList;n.forEach(function(t){if("uploading"!==t.status||a[t.uid]||(u++,a[t.uid]=!0),"uploading"!==t.status&&a[t.uid]&&(delete a[t.uid],0==--u)){var n,r;null==(n=(r=e.context.blockModel.resource).refresh)||n.call(r)}}),n.every(function(e){return"done"===e.status})&&o.view.close()}},s=_(c,e);return k({},c,s)};function B(e,t){var n=null!=e?e:"",r="storages:getBasicInfo/".concat(n),o=(0,i.useFlowContext)(),a=(0,l.useRequest)(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:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),a=Object.defineProperty;return a(l,"next",{value:u(0)}),a(l,"throw",{value:u(1)}),a(l,"return",{value:u(2)}),"function"==typeof Symbol&&a(l,Symbol.iterator,{value:function(){return this}}),l;function u(a){return function(u){var c=[a,u];if(n)throw TypeError("Generator is already executing.");for(;l&&(l=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(n){switch(n.label){case 0:return[4,o.api.request({url:r,headers:T(t),skipNotify:!0})];case 1:return[2,null==(e=n.sent())?void 0:e.data]}})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function l(e){h(i,r,o,l,a,"next",e)}function a(e){h(i,r,o,l,a,"throw",e)}l(void 0)})})()},{manual:!0,refreshDeps:[n,t],cacheKey:"".concat(t||"main",":").concat(r)}),u=a.loading,c=a.data,s=a.run;return(0,y.useEffect)(function(){s()},[s]),!u&&(null==c?void 0:c.data)||null}function M(e){var t,n,r,o,l=(0,i.useFlowContext)(),a=l.collectionField,u=null==(r=l.collectionField)?void 0:r.targetCollection,c=l.app.pm.get("@nocobase/plugin-file-manager"),s=e.context.blockModel.collection,p=(null==(t=e.context.collection)?void 0:t.dataSourceKey)||(null==(n=e.context.blockModel.collection)?void 0:n.dataSourceKey)||(null==(o=l.collection)?void 0:o.dataSourceKey),f=B((null==a?void 0:a.storage)||s.storage||u.storage,p),d=c.getStorageType(null==f?void 0:f.type);return{storage:f,storageType:d,dataSourceKey:p}}function _(e,t){var n=M(t),r=n.storage,o=n.storageType,i=n.dataSourceKey,l=null==o?void 0:o.useUploadProps,a=(null==l?void 0:l(k({storage:r,rules:r.rules},e)))||{},u=k({},T(i),a.headers);return x(k({rules:null==r?void 0:r.rules},a),{headers:u})}var I={size:function(e,t){var n=null!=t?t:0x1400000;return 0===n||e.size<=n?null:"File size exceeds the limit"},mimetype:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"*",n=t.toString().trim();return n&&"*"!==n?n.split(",").filter(Boolean).some(b()(e.type))?null:"File type is not allowed":null}};function A(e,t){if(!t)return null;var n=Object.keys(t);if(!n.length)return null;var r=!0,o=!1,i=void 0;try{for(var l,a=n[Symbol.iterator]();!(r=(l=a.next()).done);r=!0){var u=l.value,c=I[u](e,t[u]);if(c)return c}}catch(e){o=!0,i=e}finally{try{r||null==a.return||a.return()}finally{if(o)throw i}}return null}function U(e){var t=(0,m.useTranslation)().t;return(0,y.useCallback)(function(n,r){var o=A(n,e);return o?(n.status="error",n.response=t(o)):"error"===n.status&&(delete n.status,delete n.response),!o&&Promise.resolve(n)},[e,t])}function z(e){var t,n,o,l,d,b,g=e.model,h=(0,i.useFlowContext)(),w=C(g),O=w.rules,S=null!=O?O:{},E=S.size;S.mimetype;var P=(t=null!=E?E:0x1400000,o=(n=(0,m.useTranslation)()).t,l=function(e,{bits:t=!1,pad:n=!1,base:r=-1,round:o=2,locale:i="",localeOptions:l={},separator:a="",spacer:d=" ",symbols:b={},standard:y="",output:v="string",fullform:m=!1,fullforms:g=[],exponent:h=-1,roundingMethod:w="round",precision:O=0}={}){let S=h,k=Number(e),x=[],E=0,j="";"si"===y?(r=10,y=s):"iec"===y||y===s?r=2:2===r?y="iec":(r=10,y=s);let P=10===r?1e3:1024,T=k<0,C=Math[w];if("bigint"!=typeof e&&isNaN(e))throw TypeError("Invalid number");if("function"!=typeof C)throw TypeError("Invalid rounding method");if(T&&(k=-k),(-1===S||isNaN(S))&&(S=Math.floor(Math.log(k)/Math.log(P)))<0&&(S=0),S>8&&(O>0&&(O+=8-S),S=8),"exponent"===v)return S;if(0===k)x[0]=0,j=x[1]=p[y][t?u:c][S];else{E=k/(2===r?Math.pow(2,10*S):Math.pow(1e3,S)),t&&(E*=8)>=P&&S<8&&(E/=P,S++);let e=Math.pow(10,S>0?o:0);x[0]=C(E*e)/e,x[0]===P&&S<8&&-1===h&&(x[0]=1,S++),j=x[1]=10===r&&1===S?t?"kbit":"kB":p[y][t?u:c][S]}if(T&&(x[0]=-x[0]),O>0&&(x[0]=x[0].toPrecision(O)),x[1]=b[x[1]]||x[1],!0===i?x[0]=x[0].toLocaleString():i.length>0?x[0]=x[0].toLocaleString(i,l):a.length>0&&(x[0]=x[0].toString().replace(".",a)),n&&o>0){let e=x[0].toString(),t=a||(e.match(/(\D)/g)||[]).pop()||".",n=e.toString().split(t),r=n[1]||"",i=r.length;x[0]=`${n[0]}${t}${r.padEnd(i+(o-i),"0")}`}return!0===m&&(x[1]=g[S]?g[S]:f[y][S]+(t?"bit":"byte")+(1===x[0]?"":"s")),"array"===v?x:"object"===v?{value:x[0],symbol:x[1],exponent:S,unit:j}:x.join(d)}(t,{base:2,standard:"jedec",locale:n.i18n.language}),0!==t?o("File size should not exceed {{size}}.",{size:l}):""),T=j((0,y.useState)(!1),2),B=T[0],M=T[1],_=(0,y.useCallback)(function(e){e.fileList.some(function(e){return"uploading"===e.status})?M(!0):M(!1)},[]),I=h.view.Header,A=U(O);return v().createElement("div",null,v().createElement(I,{title:h.t("Upload file")}),v().createElement("div",{style:{height:"50vh"},onClick:function(e){return e.stopPropagation()}},v().createElement(a.Upload.Dragger,k({multiple:!0,listType:"picture"},(d=x(k({},w),{handleChange:_,beforeUpload:A}),b=(0,i.useFlowContext)(),k({customRequest:function(e){var t=e.action,n=e.data,r=e.file,o=e.filename,i=e.headers,l=e.onError,a=e.onProgress,u=e.onSuccess,c=e.withCredentials,s=new FormData;return n&&Object.keys(n).forEach(function(e){s.append(e,n[e])}),s.append(o,r),b.api.axios.post(t,s,{withCredentials:c,headers:i,onUploadProgress:function(e){var t=e.total;a({percent:Math.round(e.loaded/t*100).toFixed(2)},r)}}).then(function(e){u(e.data,r)}).catch(l).finally(function(){}),{abort:function(){console.log("upload progress is aborted.")}}}},d))),v().createElement("p",{className:"ant-upload-drag-icon"},B?v().createElement(r.LoadingOutlined,{style:{fontSize:36},spin:!0}):v().createElement(r.InboxOutlined,null)),v().createElement("p",{className:"ant-upload-text"},h.t("Click or drag file to this area to upload")),v().createElement("ul",{style:{listStyleType:"none"}},v().createElement("li",{className:"ant-upload-hint"},h.t("Support for a single or bulk upload.")),v().createElement("li",{className:"ant-upload-hint"},P)))))}var F=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,r;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return t=n,r=arguments,t=S(t),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,P()?Reflect.construct(t,r||[],S(this).constructor):t.apply(this,r)),"defaultProps",{type:"primary",title:(0,i.escapeT)("Upload"),icon:"UploadOutlined"}),e}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&E(n,e),t=[{key:"getAclActionName",value:function(){return"create"}},{key:"onInit",value:function(e){var t=this;O(S(n.prototype),"onInit",this).call(this,e),this.onUploadClick=function(e){t.dispatchEvent("openView",{event:e})}}},{key:"onUploadClick",set:function(e){this.setProps({onUploadClick:e})}},{key:"render",value:function(){var e=this.props,t=e.icon?v().createElement(o.Icon,{type:e.icon}):void 0;return v().createElement(a.Button,x(k({},e),{onClick:this.props.onUploadClick,icon:t}),e.children||e.title)}}],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}(o.ActionModel);w(F,"scene",o.ActionSceneEnum.collection),F.define({label:(0,i.escapeT)("Upload"),hide:function(e){var t;return(null==(t=e.collection)?void 0:t.template)!=="file"}}),F.registerFlow({key:"selectExitRecordSettings",title:(0,i.escapeT)("Selector setting"),on:{eventName:"openView"},steps:{openView:{title:(0,i.escapeT)("Edit popup"),uiSchema:function(e){return{mode:{type:"string",title:(0,i.escapeT)("Open mode"),enum:[{label:(0,i.escapeT)("Drawer"),value:"drawer"},{label:(0,i.escapeT)("Dialog"),value:"dialog"}],"x-decorator":"FormItem","x-component":"Radio.Group"},size:{type:"string",title:(0,i.escapeT)("Popup size"),enum:[{label:(0,i.escapeT)("Small"),value:"small"},{label:(0,i.escapeT)("Medium"),value:"medium"},{label:(0,i.escapeT)("Large"),value:"large"}],"x-decorator":"FormItem","x-component":"Radio.Group"}}},defaultParams:{mode:"drawer",size:"medium"},handler:function(e,t){var n,r=e.inputArgs.mode||t.mode||"drawer",o=e.inputArgs.size||t.size||"medium";e.viewer.open({type:r,width:{drawer:{small:"30%",medium:"50%",large:"70%"},dialog:{small:"40%",medium:"50%",large:"80%"},embed:{}}[r][o],inheritContext:!1,target:e.layoutContentElement,inputArgs:{sourceId:null==(n=e.resource)?void 0:n.getSourceId()},content:function(){return v().createElement(z,{model:e.model})},styles:{content:k({padding:0,backgroundColor:e.model.flowEngine.context.themeToken.colorBgLayout},"embed"===r?{position:"absolute",top:0,left:0,right:0,bottom:0}:{})}})}}}})}}]);
|