@nocobase/plugin-multi-app-share-collection 1.0.0-alpha.2 → 1.0.0-alpha.4

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.
@@ -1,2 +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
+ */
1
9
  import React from 'react';
2
10
  export declare const MultiAppShareCollectionProvider: (props: any) => React.JSX.Element;
@@ -1,3 +1,11 @@
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
+ */
1
9
  import React from 'react';
2
10
  export declare const TableTransfer: React.ForwardRefExoticComponent<Omit<Partial<any>, "ref"> & React.RefAttributes<unknown>>;
3
11
  export default TableTransfer;
@@ -1,3 +1,11 @@
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
+ */
1
9
  import { Plugin } from '@nocobase/client';
2
10
  export declare class PluginMultiAppShareCollectionClient extends Plugin {
3
11
  load(): Promise<void>;
@@ -1,3 +1,12 @@
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
+
1
10
  (function(o,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("@nocobase/client"),require("react/jsx-runtime"),require("@formily/react"),require("@nocobase/plugin-multi-app-manager/client"),require("antd"),require("@nocobase/utils/client"),require("react"),require("react-i18next")):typeof define=="function"&&define.amd?define(["exports","@nocobase/client","react/jsx-runtime","@formily/react","@nocobase/plugin-multi-app-manager/client","antd","@nocobase/utils/client","react","react-i18next"],t):(o=typeof globalThis!="undefined"?globalThis:o||self,t(o["@nocobase/plugin-multi-app-share-collection"]={},o["@nocobase/client"],o.jsxRuntime,o["@formily/react"],o["@nocobase/plugin-multi-app-manager"],o.antd,o["@nocobase/utils"],o.react,o["react-i18next"]))})(this,function(o,t,e,M,y,r,C,d,S){"use strict";var R=Object.defineProperty,$=Object.defineProperties;var ee=Object.getOwnPropertyDescriptors;var O=Object.getOwnPropertySymbols;var te=Object.prototype.hasOwnProperty,oe=Object.prototype.propertyIsEnumerable;var _=(o,t,e)=>t in o?R(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,k=(o,t)=>{for(var e in t||(t={}))te.call(t,e)&&_(o,e,t[e]);if(O)for(var e of O(t))oe.call(t,e)&&_(o,e,t[e]);return o},q=(o,t)=>$(o,ee(t));var G=(o,t,e)=>new Promise((M,y)=>{var r=S=>{try{d(e.next(S))}catch(v){y(v)}},C=S=>{try{d(e.throw(S))}catch(v){y(v)}},d=S=>S.done?M(S.value):Promise.resolve(S.value).then(r,C);d((e=e.apply(o,t)).next())});const v=["users","roles","applications"],B=({removed:n=[]})=>{const{collections:a}=t.useCollectionManager_deprecated(),s=d.useCallback(m=>C.CollectionsGraph.connectedNodes({collections:a,nodes:[m],excludes:v}).filter(c=>n.includes(c)),[n]),i=d.useCallback(m=>C.CollectionsGraph.connectedNodes({collections:a,nodes:[m],excludes:v,direction:"reverse"}).filter(c=>!n.includes(c)),[n]);return{findAddable:s,findRemovable:i}},E=()=>{var l,b;const n=t.useRecord(),[a,s]=d.useState([]),i=t.useRequest({url:`applications/${n.name}/collectionBlacklist:list`,params:{paginate:!1,params:{fields:["name"]}}},{onSuccess(h){var w;s((w=h.data)==null?void 0:w.map(f=>f.name))}}),m=t.useRequest({url:"collections",params:{fields:["name","title","hidden","category.name","category.color","category.sort"],sort:"sort",paginate:!1}}),c=t.useRequest({url:"collectionCategories",params:{sort:"sort",paginate:!1}});return{loading:i.loading||m.loading||c.loading,collections:(((l=m.data)==null?void 0:l.data)||[]).filter(h=>!h.hidden&&!v.includes(h.name)),removed:a,setSelected:s,categories:(((b=c.data)==null?void 0:b.data)||[]).map(h=>({label:h.name,value:h.name}))}},F=(n,a)=>{const s=Array.isArray(a)?a:[a];for(const i of s)if(n.toLowerCase().includes(i))return!0;return!1},W=({collections:n,removed:a})=>{const[s,i]=d.useState({name:"",category:[]}),m=d.useMemo(()=>n.filter(l=>{const{name:b,title:h,category:w=[]}=l,f=[a.includes(l.name)];return s.name&&f.push(F(b,s.name)||F(h,s.name)),s.category.length>0&&f.push(w.some(T=>F(T.name,s.category))),!f.includes(!1)}),[n,a,s]),c=d.useMemo(()=>C.lodash.debounce(l=>{i(q(k({},s),{name:l}))},300),[]);return{dataSource:m,setNameFilter:c,setCategoryFilter:l=>{i(q(k({},s),{category:l}))}}},U=({collections:n,removed:a})=>{const[s,i]=d.useState({name:"",category:[]}),m=n.filter(l=>{const{name:b,title:h,category:w=[]}=l,f=[!a.includes(l.name)];return s.name&&f.push(F(b,s.name)||F(h,s.name)),s.category.length>0&&f.push(w.some(T=>F(T.name,s.category))),!f.includes(!1)}),c=d.useMemo(()=>C.lodash.debounce(l=>{i(q(k({},s),{name:l}))},300),[]);return{dataSource:m,setNameFilter:c,setCategoryFilter:l=>{i(q(k({},s),{category:l}))}}},V=M.connect(n=>{const{onChange:a}=n,{loading:s,collections:i,categories:m,removed:c,setSelected:l}=E(),[b,h]=d.useState([]),[w,f]=d.useState([]),{findAddable:T,findRemovable:Y}=B({removed:c}),K=U({collections:i,removed:c}),j=W({collections:i,removed:c}),{t:g}=S.useTranslation("multi-app-share-collection"),{modal:L}=r.App.useApp(),{token:z}=t.useToken(),I=d.useMemo(()=>[{title:g("Collection display name"),dataIndex:"title"},{title:g("Collection name"),dataIndex:"name"},{title:g("Collection category"),dataIndex:"category",render:u=>u.map(p=>e.jsx(r.Tag,{color:p.color,children:p.name},p.name))}],[]);return s?e.jsx(r.Spin,{}):e.jsx("div",{children:e.jsxs(r.Row,{gutter:24,className:t.css`
2
11
  .ant-table-tbody > tr.ant-table-row:hover > td {
3
12
  background: #e6f7ff;
@@ -1,3 +1,11 @@
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
+ */
1
9
  export declare const usePluginUtils: () => {
2
10
  t: import("react-i18next").TFunction<"multi-app-share-collection", undefined>;
3
11
  };
@@ -1,12 +1,21 @@
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
+
1
10
  module.exports = {
2
11
  "@formily/react": "2.3.0",
3
- "@nocobase/client": "1.0.0-alpha.2",
4
- "@nocobase/plugin-multi-app-manager": "1.0.0-alpha.2",
12
+ "@nocobase/client": "1.0.0-alpha.4",
13
+ "@nocobase/plugin-multi-app-manager": "1.0.0-alpha.4",
5
14
  "antd": "5.12.8",
6
15
  "react": "18.2.0",
7
- "@nocobase/utils": "1.0.0-alpha.2",
16
+ "@nocobase/utils": "1.0.0-alpha.4",
8
17
  "react-i18next": "11.18.6",
9
- "@nocobase/database": "1.0.0-alpha.2",
10
- "@nocobase/server": "1.0.0-alpha.2",
18
+ "@nocobase/database": "1.0.0-alpha.4",
19
+ "@nocobase/server": "1.0.0-alpha.4",
11
20
  "lodash": "4.17.21"
12
21
  };
package/dist/index.d.ts CHANGED
@@ -1,2 +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
+ */
1
9
  export * from './server';
2
10
  export { default } from './server';
package/dist/index.js CHANGED
@@ -1,3 +1,12 @@
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
+
1
10
  var __create = Object.create;
2
11
  var __defProp = Object.defineProperty;
3
12
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -1,3 +1,11 @@
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
+ */
1
9
  declare const _default: {
2
10
  collectionOptions: import("@nocobase/database").CollectionOptions;
3
11
  mergeOptions: import("deepmerge").Options;
@@ -1,3 +1,12 @@
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
+
1
10
  var __defProp = Object.defineProperty;
2
11
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
12
  var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -1,3 +1,11 @@
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
+ */
1
9
  declare const _default: {
2
10
  collectionOptions: import("@nocobase/database").CollectionOptions;
3
11
  mergeOptions: import("deepmerge").Options;
@@ -1,3 +1,12 @@
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
+
1
10
  var __defProp = Object.defineProperty;
2
11
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
12
  var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -1 +1,9 @@
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
+ */
1
9
  export { default } from './plugin';
@@ -1,3 +1,12 @@
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
+
1
10
  var __create = Object.create;
2
11
  var __defProp = Object.defineProperty;
3
12
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -1,3 +1,11 @@
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
+ */
1
9
  import { Migration } from '@nocobase/server';
2
10
  export default class extends Migration {
3
11
  appVersion: string;
@@ -1,3 +1,12 @@
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
+
1
10
  var __defProp = Object.defineProperty;
2
11
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
12
  var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -1,3 +1,11 @@
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
+ */
1
9
  import { Plugin } from '@nocobase/server';
2
10
  export declare class MultiAppShareCollectionPlugin extends Plugin {
3
11
  afterAdd(): void;
@@ -1,3 +1,12 @@
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
+
1
10
  var __create = Object.create;
2
11
  var __defProp = Object.defineProperty;
3
12
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "displayName.zh-CN": "多应用数据表共享",
5
5
  "description": "",
6
6
  "description.zh-CN": "",
7
- "version": "1.0.0-alpha.2",
7
+ "version": "1.0.0-alpha.4",
8
8
  "main": "./dist/server/index.js",
9
9
  "devDependencies": {
10
10
  "@formily/react": "2.x",
@@ -23,7 +23,7 @@
23
23
  "@nocobase/test": "1.x",
24
24
  "@nocobase/utils": "1.x"
25
25
  },
26
- "gitHead": "f89dbc9e67d58404a2e484a5e124f739f340dcf8",
26
+ "gitHead": "7a7005ce3bddf33498580a6486c45b5d9ea64ffb",
27
27
  "keywords": [
28
28
  "System management"
29
29
  ]