@nocobase/plugin-multi-app-share-collection 1.5.0-beta.1 → 1.6.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/dist/client/index.js +1 -18
- package/dist/externalVersion.js +5 -5
- package/package.json +2 -2
package/dist/client/index.js
CHANGED
|
@@ -7,21 +7,4 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
|
|
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`
|
|
11
|
-
.ant-table-tbody > tr.ant-table-row:hover > td {
|
|
12
|
-
background: #e6f7ff;
|
|
13
|
-
cursor: pointer;
|
|
14
|
-
}
|
|
15
|
-
`,children:[e.jsxs(r.Col,{span:12,children:[e.jsxs("div",{className:t.css`
|
|
16
|
-
display: flex;
|
|
17
|
-
justify-content: space-between;
|
|
18
|
-
align-items: center;
|
|
19
|
-
width: 100%;
|
|
20
|
-
margin-bottom: 8px;
|
|
21
|
-
`,children:[e.jsx("strong",{style:{fontSize:z.fontSizeLG,color:z.colorText},children:g("Unshared collections")}),e.jsxs(r.Input.Group,{compact:!0,style:{width:360},children:[e.jsx(r.Select,{popupMatchSelectWidth:!1,onChange:u=>{j.setCategoryFilter(u)},mode:"multiple",style:{width:"35%"},size:"middle",placeholder:g("All categories"),options:m,allowClear:!0}),e.jsx(r.Input,{onChange:u=>j.setNameFilter(u.target.value),style:{width:"65%"},placeholder:g("Enter name or title..."),allowClear:!0})]})]}),e.jsx(r.Table,{bordered:!0,rowKey:"name",rowSelection:{type:"checkbox",selectedRowKeys:b,onChange(u){const p=c.filter(x=>!u.includes(x));l(p),a(p),h([])}},pagination:!1,size:"small",columns:I,dataSource:j.dataSource,scroll:{y:"calc(100vh - 260px)"},onRow:({name:u,disabled:p})=>({onClick:()=>{if(p)return;const x=T(u),A=()=>{const N=c.filter(Z=>!x.includes(Z));l(N),a(N)};if(x.length===1)return A();L.confirm({title:g("Are you sure to add the following collections?"),width:"60%",content:e.jsx("div",{children:e.jsx(r.Table,{size:"small",columns:I,dataSource:i.filter(N=>x.includes(N.name)),pagination:!1,scroll:{y:"60vh"}})}),onOk(){A()}})}})})]}),e.jsxs(r.Col,{span:12,children:[e.jsxs("div",{className:t.css`
|
|
22
|
-
display: flex;
|
|
23
|
-
justify-content: space-between;
|
|
24
|
-
align-items: center;
|
|
25
|
-
width: 100%;
|
|
26
|
-
margin-bottom: 8px;
|
|
27
|
-
`,children:[e.jsx("strong",{style:{fontSize:z.fontSizeLG,color:z.colorText},children:g("Shared collections")}),e.jsxs(r.Input.Group,{compact:!0,style:{width:360},children:[e.jsx(r.Select,{popupMatchSelectWidth:!1,onChange:u=>{K.setCategoryFilter(u)},mode:"multiple",style:{width:"35%"},size:"middle",placeholder:g("All categories"),options:m,allowClear:!0}),e.jsx(r.Input,{onChange:u=>K.setNameFilter(u.target.value),style:{width:"65%"},placeholder:g("Enter name or title..."),allowClear:!0})]})]}),e.jsx(r.Table,{bordered:!0,rowKey:"name",rowSelection:{type:"checkbox",selectedRowKeys:w,onChange(u){const p=C.lodash.uniq(c.concat(u));l(p),a(p),f([])}},pagination:!1,size:"small",columns:I,dataSource:K.dataSource,scroll:{y:"calc(100vh - 260px)"},onRow:({name:u})=>({onClick:()=>{const p=Y(u),x=()=>{c.push(...p);const A=C.lodash.uniq([...c]);l(A),a(A)};if(p.length===1)return x();L.confirm({title:g("Are you sure to remove the following collections?"),width:"60%",content:e.jsx("div",{children:e.jsx(r.Table,{size:"small",columns:I,dataSource:i.filter(A=>p.includes(A.name)),pagination:!1,scroll:{y:"60vh"}})}),onOk(){x()}})}})})]})]})})}),D=n=>`{{t("${n}", { ns: 'multi-app-share-collection' })}}`,H=()=>{const n=M.useForm(),a=t.useActionContext(),s=t.useAPIClient(),i=t.useRecord();return{run(){return G(this,null,function*(){console.log(n.values.names),yield s.request({url:`applications/${i.name}/collectionBlacklist`,data:n.values.names,method:"post"}),a.setVisible(!1),n.reset(),r.message.success("Saved successfully")})}}},J=y.tableActionColumnSchema.properties.update,Q=y.tableActionColumnSchema.properties.delete;delete y.tableActionColumnSchema.properties.update,delete y.tableActionColumnSchema.properties.delete,y.tableActionColumnSchema.properties.collection={type:"void",title:D("Share collections"),"x-component":"Action.Link","x-component-props":{},properties:{drawer:{type:"void","x-component":"Action.Drawer","x-component-props":{width:"95vw"},"x-decorator":"Form",title:D("Share collections"),properties:{names:{type:"array","x-component":V,"x-decorator":"FormItem"},footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{cancel:{title:'{{t("Cancel")}}',"x-component":"Action","x-component-props":{useAction:"{{ cm.useCancelAction }}"}},submit:{title:'{{t("Submit")}}',"x-component":"Action","x-component-props":{type:"primary",useAction:H}}}}}}}},y.tableActionColumnSchema.properties.update=J,y.tableActionColumnSchema.properties.delete=Q;const X=n=>e.jsx(e.Fragment,{children:n.children});class P extends t.Plugin{load(){return G(this,null,function*(){this.app.use(X)})}}o.PluginMultiAppShareCollectionClient=P,o.default=P,Object.defineProperties(o,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
10
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react-i18next"),require("@formily/react"),require("@nocobase/utils/client"),require("@nocobase/plugin-multi-app-manager/client"),require("@nocobase/client"),require("react"),require("antd")):"function"==typeof define&&define.amd?define("@nocobase/plugin-multi-app-share-collection",["react-i18next","@formily/react","@nocobase/utils/client","@nocobase/plugin-multi-app-manager/client","@nocobase/client","react","antd"],t):"object"==typeof exports?exports["@nocobase/plugin-multi-app-share-collection"]=t(require("react-i18next"),require("@formily/react"),require("@nocobase/utils/client"),require("@nocobase/plugin-multi-app-manager/client"),require("@nocobase/client"),require("react"),require("antd")):e["@nocobase/plugin-multi-app-share-collection"]=t(e["react-i18next"],e["@formily/react"],e["@nocobase/utils/client"],e["@nocobase/plugin-multi-app-manager/client"],e["@nocobase/client"],e.react,e.antd)}(self,function(e,t,n,r,o,a,i){return function(){"use strict";var c={505:function(e){e.exports=t},772:function(e){e.exports=o},801:function(e){e.exports=r},584:function(e){e.exports=n},721:function(e){e.exports=i},156:function(e){e.exports=a},238:function(t){t.exports=e}},l={};function u(e){var t=l[e];if(void 0!==t)return t.exports;var n=l[e]={exports:{}};return c[e](n,n.exports,u),n.exports}u.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return u.d(t,{a:t}),t},u.d=function(e,t){for(var n in t)u.o(t,n)&&!u.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},u.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},u.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var s={};u.r(s),u.d(s,{PluginMultiAppShareCollectionClient:function(){return H},default:function(){return J}});var f=u("772"),p=u("505"),d=u("801"),m=u("721"),y=u("156"),b=u.n(y),h=u("584"),v=u("238");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 w(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,o,a;r=e,o=t,a=n[t],o in r?Object.defineProperty(r,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):r[o]=a})}return e}function S(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function x(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,c=!1;try{for(o=o.call(e);!(i=(n=o.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(e){c=!0,r=e}finally{try{!i&&null!=o.return&&o.return()}finally{if(c)throw r}}return a}}(e,t)||j(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(e,t){return!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function C(e){return function(e){if(Array.isArray(e))return g(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||j(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function j(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)}}function A(){var e=O(["\n .ant-table-tbody > tr.ant-table-row:hover > td {\n background: #e6f7ff;\n cursor: pointer;\n }\n "]);return A=function(){return e},e}function E(){var e=O(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n margin-bottom: 8px;\n "]);return E=function(){return e},e}function P(){var e=O(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n margin-bottom: 8px;\n "]);return P=function(){return e},e}var k=["users","roles","applications"],q=function(e){var t=e.removed,n=void 0===t?[]:t,r=(0,f.useCollectionManager_deprecated)().collections;return{findAddable:(0,y.useCallback)(function(e){return h.CollectionsGraph.connectedNodes({collections:r,nodes:[e],excludes:k}).filter(function(e){return n.includes(e)})},[n]),findRemovable:(0,y.useCallback)(function(e){return h.CollectionsGraph.connectedNodes({collections:r,nodes:[e],excludes:k,direction:"reverse"}).filter(function(e){return!n.includes(e)})},[n])}},T=function(){var e,t,n=(0,f.useRecord)(),r=x((0,y.useState)([]),2),o=r[0],a=r[1],i=(0,f.useRequest)({url:"applications/".concat(n.name,"/collectionBlacklist:list"),params:{paginate:!1,params:{fields:["name"]}}},{onSuccess:function(e){var t;a(null===(t=e.data)||void 0===t?void 0:t.map(function(e){return e.name}))}}),c=(0,f.useRequest)({url:"collections",params:{fields:["name","title","hidden","category.name","category.color","category.sort"],sort:"sort",paginate:!1}}),l=(0,f.useRequest)({url:"collectionCategories",params:{sort:"sort",paginate:!1}});return{loading:i.loading||c.loading||l.loading,collections:((null===(e=c.data)||void 0===e?void 0:e.data)||[]).filter(function(e){return!e.hidden&&!k.includes(e.name)}),removed:o,setSelected:a,categories:((null===(t=l.data)||void 0===t?void 0:t.data)||[]).map(function(e){return{label:e.name,value:e.name}})}},R=function(e,t){var n=Array.isArray(t)?t:[t],r=!0,o=!1,a=void 0;try{for(var i,c=n[Symbol.iterator]();!(r=(i=c.next()).done);r=!0){var l=i.value;if(e.toLowerCase().includes(l))return!0}}catch(e){o=!0,a=e}finally{try{!r&&null!=c.return&&c.return()}finally{if(o)throw a}}return!1},F=function(e){var t=e.collections,n=e.removed,r=x((0,y.useState)({name:"",category:[]}),2),o=r[0],a=r[1];return{dataSource:(0,y.useMemo)(function(){return t.filter(function(e){var t=e.name,r=e.title,a=e.category,i=[n.includes(e.name)];return o.name&&i.push(R(t,o.name)||R(r,o.name)),o.category.length>0&&i.push((void 0===a?[]:a).some(function(e){return R(e.name,o.category)})),!i.includes(!1)})},[t,n,o]),setNameFilter:(0,y.useMemo)(function(){return h.lodash.debounce(function(e){a(S(w({},o),{name:e}))},300)},[]),setCategoryFilter:function(e){a(S(w({},o),{category:e}))}}},I=function(e){var t=e.collections,n=e.removed,r=x((0,y.useState)({name:"",category:[]}),2),o=r[0],a=r[1];return{dataSource:t.filter(function(e){var t=e.name,r=e.title,a=e.category,i=[!n.includes(e.name)];return o.name&&i.push(R(t,o.name)||R(r,o.name)),o.category.length>0&&i.push((void 0===a?[]:a).some(function(e){return R(e.name,o.category)})),!i.includes(!1)}),setNameFilter:(0,y.useMemo)(function(){return h.lodash.debounce(function(e){a(S(w({},o),{name:e}))},300)},[]),setCategoryFilter:function(e){a(S(w({},o),{category:e}))}}},M=(0,p.connect)(function(e){var t=e.onChange,n=T(),r=n.loading,o=n.collections,a=n.categories,i=n.removed,c=n.setSelected,l=x((0,y.useState)([]),2),u=l[0],s=l[1],p=x((0,y.useState)([]),2),d=p[0],g=p[1],w=q({removed:i}),S=w.findAddable,O=w.findRemovable,j=I({collections:o,removed:i}),k=F({collections:o,removed:i}),R=(0,v.useTranslation)("multi-app-share-collection").t,M=m.App.useApp().modal,_=(0,f.useToken)().token,z=(0,y.useMemo)(function(){return[{title:R("Collection display name"),dataIndex:"title"},{title:R("Collection name"),dataIndex:"name"},{title:R("Collection category"),dataIndex:"category",render:function(e){return e.map(function(e){return b().createElement(m.Tag,{key:e.name,color:e.color},e.name)})}}]},[]);return r?b().createElement(m.Spin,null):b().createElement("div",null,b().createElement(m.Row,{gutter:24,className:(0,f.css)(A())},b().createElement(m.Col,{span:12},b().createElement("div",{className:(0,f.css)(E())},b().createElement("strong",{style:{fontSize:_.fontSizeLG,color:_.colorText}},R("Unshared collections")),b().createElement(m.Input.Group,{compact:!0,style:{width:360}},b().createElement(m.Select,{popupMatchSelectWidth:!1,onChange:function(e){k.setCategoryFilter(e)},mode:"multiple",style:{width:"35%"},size:"middle",placeholder:R("All categories"),options:a,allowClear:!0}),b().createElement(m.Input,{onChange:function(e){return k.setNameFilter(e.target.value)},style:{width:"65%"},placeholder:R("Enter name or title..."),allowClear:!0}))),b().createElement(m.Table,{bordered:!0,rowKey:"name",rowSelection:{type:"checkbox",selectedRowKeys:u,onChange:function(e){var n=i.filter(function(t){return!e.includes(t)});c(n),t(n),s([])}},pagination:!1,size:"small",columns:z,dataSource:k.dataSource,scroll:{y:"calc(100vh - 260px)"},onRow:function(e){var n=e.name,r=e.disabled;return{onClick:function(){if(!r){var e=S(n),a=function(){var n=i.filter(function(t){return!e.includes(t)});c(n),t(n)};if(1===e.length)return a();M.confirm({title:R("Are you sure to add the following collections?"),width:"60%",content:b().createElement("div",null,b().createElement(m.Table,{size:"small",columns:z,dataSource:o.filter(function(t){return e.includes(t.name)}),pagination:!1,scroll:{y:"60vh"}})),onOk:function(){a()}})}}}}})),b().createElement(m.Col,{span:12},b().createElement("div",{className:(0,f.css)(P())},b().createElement("strong",{style:{fontSize:_.fontSizeLG,color:_.colorText}},R("Shared collections")),b().createElement(m.Input.Group,{compact:!0,style:{width:360}},b().createElement(m.Select,{popupMatchSelectWidth:!1,onChange:function(e){j.setCategoryFilter(e)},mode:"multiple",style:{width:"35%"},size:"middle",placeholder:R("All categories"),options:a,allowClear:!0}),b().createElement(m.Input,{onChange:function(e){return j.setNameFilter(e.target.value)},style:{width:"65%"},placeholder:R("Enter name or title..."),allowClear:!0}))),b().createElement(m.Table,{bordered:!0,rowKey:"name",rowSelection:{type:"checkbox",selectedRowKeys:d,onChange:function(e){var n=h.lodash.uniq(i.concat(e));c(n),t(n),g([])}},pagination:!1,size:"small",columns:z,dataSource:j.dataSource,scroll:{y:"calc(100vh - 260px)"},onRow:function(e){var n=e.name;return{onClick:function(){var e=O(n),r=function(){i.push.apply(i,C(e));var n=h.lodash.uniq(C(i));c(n),t(n)};if(1===e.length)return r();M.confirm({title:R("Are you sure to remove the following collections?"),width:"60%",content:b().createElement("div",null,b().createElement(m.Table,{size:"small",columns:z,dataSource:o.filter(function(t){return e.includes(t.name)}),pagination:!1,scroll:{y:"60vh"}})),onOk:function(){r()}})}}}}))))}),_=function(e){return'{{t("'.concat(e,"\", { ns: 'multi-app-share-collection' })}}")};function z(e,t,n,r,o,a,i){try{var c=e[a](i),l=c.value}catch(e){n(e);return}c.done?t(l):Promise.resolve(l).then(r,o)}var N=d.tableActionColumnSchema.properties.update,G=d.tableActionColumnSchema.properties.delete;delete d.tableActionColumnSchema.properties.update,delete d.tableActionColumnSchema.properties.delete,d.tableActionColumnSchema.properties.collection={type:"void",title:_("Share collections"),"x-component":"Action.Link","x-component-props":{},properties:{drawer:{type:"void","x-component":"Action.Drawer","x-component-props":{width:"95vw"},"x-decorator":"Form",title:_("Share collections"),properties:{names:{type:"array","x-component":M,"x-decorator":"FormItem"},footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{cancel:{title:'{{t("Cancel")}}',"x-component":"Action","x-component-props":{useAction:"{{ cm.useCancelAction }}"}},submit:{title:'{{t("Submit")}}',"x-component":"Action","x-component-props":{type:"primary",useAction:function(){var e=(0,p.useForm)(),t=(0,f.useActionContext)(),n=(0,f.useAPIClient)(),r=(0,f.useRecord)();return{run:function(){var o;return(o=function(){return function(e,t){var n,r,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function c(a){return function(c){return function(a){if(n)throw TypeError("Generator is already executing.");for(;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}}([a,c])}}}(this,function(o){switch(o.label){case 0:return console.log(e.values.names),[4,n.request({url:"applications/".concat(r.name,"/collectionBlacklist"),data:e.values.names,method:"post"})];case 1:return o.sent(),t.setVisible(!1),e.reset(),m.message.success("Saved successfully"),[2]}})},function(){var e=this,t=arguments;return new Promise(function(n,r){var a=o.apply(e,t);function i(e){z(a,n,r,i,c,"next",e)}function c(e){z(a,n,r,i,c,"throw",e)}i(void 0)})})()}}}}}}}}}}},d.tableActionColumnSchema.properties.update=N,d.tableActionColumnSchema.properties.delete=G;var D=function(e){return b().createElement(b().Fragment,null,e.children)};function B(e,t,n,r,o,a,i){try{var c=e[a](i),l=c.value}catch(e){n(e);return}c.done?t(l):Promise.resolve(l).then(r,o)}function K(e,t,n){return(K=$()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&W(o,n.prototype),o}).apply(null,arguments)}function L(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)}}function U(e){return(U=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function W(e,t){return(W=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function V(e){var t="function"==typeof Map?new Map:void 0;return(V=function(e){var n;if(null===e||(n=e,-1===Function.toString.call(n).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,r)}function r(){return K(e,arguments,U(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),W(r,e)})(e)}function $(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return($=function(){return!!e})()}var H=function(e){var t,n,r;function o(){var e,t,n;return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,o),e=this,t=o,n=arguments,t=U(t),function(e,t){return t&&("object"===function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}(t)||"function"==typeof t)?t:function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,$()?Reflect.construct(t,n||[],U(e).constructor):t.apply(e,n))}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&W(e,t)}(o,e),t=o,n=[{key:"load",value:function(){var e,t=this;return(e=function(){return function(e,t){var n,r,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function c(a){return function(c){return function(a){if(n)throw TypeError("Generator is already executing.");for(;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}}([a,c])}}}(this,function(e){return t.app.use(D),[2]})},function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function i(e){B(a,r,o,i,c,"next",e)}function c(e){B(a,r,o,i,c,"throw",e)}i(void 0)})})()}}],L(t.prototype,n),o}(V(f.Plugin)),J=H;return s}()});
|
package/dist/externalVersion.js
CHANGED
|
@@ -9,13 +9,13 @@
|
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
11
|
"@formily/react": "2.3.0",
|
|
12
|
-
"@nocobase/client": "1.
|
|
13
|
-
"@nocobase/plugin-multi-app-manager": "1.
|
|
12
|
+
"@nocobase/client": "1.6.0-alpha.1",
|
|
13
|
+
"@nocobase/plugin-multi-app-manager": "1.6.0-alpha.1",
|
|
14
14
|
"antd": "5.12.8",
|
|
15
15
|
"react": "18.2.0",
|
|
16
|
-
"@nocobase/utils": "1.
|
|
16
|
+
"@nocobase/utils": "1.6.0-alpha.1",
|
|
17
17
|
"react-i18next": "11.18.6",
|
|
18
|
-
"@nocobase/database": "1.
|
|
19
|
-
"@nocobase/server": "1.
|
|
18
|
+
"@nocobase/database": "1.6.0-alpha.1",
|
|
19
|
+
"@nocobase/server": "1.6.0-alpha.1",
|
|
20
20
|
"lodash": "4.17.21"
|
|
21
21
|
};
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"displayName.zh-CN": "多应用数据表共享",
|
|
5
5
|
"description": "",
|
|
6
6
|
"description.zh-CN": "",
|
|
7
|
-
"version": "1.
|
|
7
|
+
"version": "1.6.0-alpha.1",
|
|
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": "
|
|
26
|
+
"gitHead": "a4c91015e34ec0c9a427451b5fbdfb5fedc4f3d7",
|
|
27
27
|
"keywords": [
|
|
28
28
|
"System management"
|
|
29
29
|
]
|