@nocobase/plugin-action-duplicate 0.18.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/README.md +1 -0
- package/client.d.ts +2 -0
- package/client.js +1 -0
- package/dist/client/DuplicateAction.Settings.d.ts +3 -0
- package/dist/client/DuplicateAction.d.ts +3 -0
- package/dist/client/DuplicateActionInitializer.d.ts +2 -0
- package/dist/client/DuplicatePluginProvider.d.ts +2 -0
- package/dist/client/index.d.ts +6 -0
- package/dist/client/index.js +46 -0
- package/dist/externalVersion.js +12 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +39 -0
- package/dist/server/index.d.ts +1 -0
- package/dist/server/index.js +33 -0
- package/dist/server/plugin.d.ts +11 -0
- package/dist/server/plugin.js +45 -0
- package/package.json +16 -0
- package/server.d.ts +2 -0
- package/server.js +1 -0
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# @nocobase/plugin-action-duplicate
|
package/client.d.ts
ADDED
package/client.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./dist/client/index.js');
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
(function(o,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("@nocobase/client"),require("react/jsx-runtime"),require("@emotion/css"),require("@formily/react"),require("antd"),require("react"),require("react-i18next"),require("@formily/core"),require("lodash")):typeof define=="function"&&define.amd?define(["exports","@nocobase/client","react/jsx-runtime","@emotion/css","@formily/react","antd","react","react-i18next","@formily/core","lodash"],e):(o=typeof globalThis!="undefined"?globalThis:o||self,e(o["@nocobase/plugin-action-duplicate"]={},o["@nocobase/client"],o.jsxRuntime,o["@emotion/css"],o["@formily/react"],o.antd,o.react,o["react-i18next"],o["@formily/core"],o.lodash))})(this,function(o,e,i,u,d,M,b,q,D,z){"use strict";var de=Object.defineProperty,ue=Object.defineProperties;var me=Object.getOwnPropertyDescriptors;var j=Object.getOwnPropertySymbols;var ee=Object.prototype.hasOwnProperty,te=Object.prototype.propertyIsEnumerable;var Z=(o,e,i)=>e in o?de(o,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):o[e]=i,g=(o,e)=>{for(var i in e||(e={}))ee.call(e,i)&&Z(o,i,e[i]);if(j)for(var i of j(e))te.call(e,i)&&Z(o,i,e[i]);return o},y=(o,e)=>ue(o,me(e));var oe=(o,e)=>{var i={};for(var u in o)ee.call(o,u)&&e.indexOf(u)<0&&(i[u]=o[u]);if(o!=null&&j)for(var u of j(o))e.indexOf(u)<0&&te.call(o,u)&&(i[u]=o[u]);return i};var B=(o,e,i)=>new Promise((u,d)=>{var M=D=>{try{q(i.next(D))}catch(z){d(z)}},b=D=>{try{q(i.throw(D))}catch(z){d(z)}},q=D=>D.done?u(D.value):Promise.resolve(D.value).then(M,b);q((i=i.apply(o,e)).next())});const ne=t=>{const c={type:"void","x-action":"duplicate","x-acl-action":"create",title:'{{ t("Duplicate") }}',"x-designer":"Action.Designer","x-component":"Action.Link","x-decorator":"ACLActionProvider","x-component-props":{openMode:"drawer",component:"DuplicateAction"},properties:{drawer:{type:"void",title:'{{ t("Duplicate") }}',"x-component":"Action.Container","x-component-props":{className:"nb-action-popup"},properties:{tabs:{type:"void","x-component":"Tabs","x-component-props":{},"x-initializer":"TabPaneInitializers",properties:{tab1:{type:"void",title:'{{t("Duplicate")}}',"x-component":"Tabs.TabPane","x-designer":"Tabs.Designer","x-component-props":{},properties:{grid:{type:"void","x-component":"Grid","x-initializer":"CreateFormBlockInitializers",properties:{}}}}}}}}}};return i.jsx(e.ActionInitializer,y(g({},t),{schema:c}))},N=u.css`
|
|
2
|
+
position: relative;
|
|
3
|
+
&:hover {
|
|
4
|
+
.general-schema-designer {
|
|
5
|
+
display: block;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
.general-schema-designer {
|
|
9
|
+
position: absolute;
|
|
10
|
+
z-index: 999;
|
|
11
|
+
top: 0;
|
|
12
|
+
bottom: 0;
|
|
13
|
+
left: 0;
|
|
14
|
+
right: 0;
|
|
15
|
+
display: none;
|
|
16
|
+
background: var(--colorBgSettingsHover);
|
|
17
|
+
border: 0;
|
|
18
|
+
top: 0;
|
|
19
|
+
bottom: 0;
|
|
20
|
+
left: 0;
|
|
21
|
+
right: 0;
|
|
22
|
+
pointer-events: none;
|
|
23
|
+
> .general-schema-designer-icons {
|
|
24
|
+
position: absolute;
|
|
25
|
+
right: 2px;
|
|
26
|
+
top: 2px;
|
|
27
|
+
line-height: 16px;
|
|
28
|
+
pointer-events: all;
|
|
29
|
+
.ant-space-item {
|
|
30
|
+
background-color: var(--colorSettings);
|
|
31
|
+
color: #fff;
|
|
32
|
+
line-height: 16px;
|
|
33
|
+
width: 16px;
|
|
34
|
+
padding-left: 1px;
|
|
35
|
+
align-self: stretch;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
`,$=d.observer(t=>{var W,X;const{children:c}=t,{message:m}=M.App.useApp(),n=d.useField(),l=d.useFieldSchema(),x=e.useAPIClient(),a=n.disabled||t.disabled,{designable:k}=e.useDesignable(),[T,A]=b.useState(!1),[h,w]=b.useState(!1),{service:S,__parent:L,block:V}=e.useBlockRequestContext(),{duplicateFields:C,duplicateMode:_="quickDulicate",duplicateCollection:r}=l["x-component-props"],f=e.useRecord(),{id:s,__collection:p}=f,v=e.useActionContext(),{name:P}=e.useCollection(),{getCollectionFields:se}=e.useCollectionManager(),{t:F}=q.useTranslation(),le=se(p||P),re=e.useFormBlockContext(),U={key:"duplicate",dataId:s,default:!0,fields:(C==null?void 0:C.filter(I=>le.find(O=>I.includes(O.name))))||[],collection:p||P},Q=l["x-component"]==="Action.Link",pe=()=>B(this,null,function*(){var I,O,Y;w(!0);try{const K=yield e.fetchTemplateData(x,U,F);yield x.resource(p||P).create({values:g({},K)}),m.success(F("Saved successfully")),V==="form"?(O=(I=L==null?void 0:L.service)==null?void 0:I.refresh)==null||O.call(I):yield(Y=S==null?void 0:S.refresh)==null?void 0:Y.call(S),w(!1)}catch(K){w(!1),console.error(K)}}),J=()=>{!a&&!h&&((C==null?void 0:C.length)>0?_==="quickDulicate"?pe():A(!0):m.error(F("Please configure the duplicate fields")))};return i.jsx("div",{className:u.cx(N,{[u.css`
|
|
40
|
+
.general-schema-designer {
|
|
41
|
+
top: -10px;
|
|
42
|
+
bottom: -10px;
|
|
43
|
+
left: -10px;
|
|
44
|
+
right: -10px;
|
|
45
|
+
}
|
|
46
|
+
`]:Q}),children:i.jsx(e.FormBlockContext.Provider,{value:y(g({},re),{duplicateData:{display:!1,enabled:!0,defaultTemplate:U}}),children:i.jsxs("div",{children:[Q?i.jsx("a",{role:t.role,"aria-label":t["aria-label"],disabled:a,style:{opacity:k&&((W=n==null?void 0:n.data)==null?void 0:W.hidden)&&.1,cursor:h?"not-allowed":"pointer"},onClick:J,children:h?F("Duplicating"):c||F("Duplicate")}):i.jsx(M.Button,y(g({role:t.role,"aria-label":t["aria-label"],disabled:a,style:{opacity:k&&((X=n==null?void 0:n.data)==null?void 0:X.hidden)&&.1}},t),{onClick:J,children:h?F("Duplicating"):c||F("Duplicate")})),i.jsx(e.CollectionProvider,{name:r||P,children:i.jsx(e.RecordProvider,{record:y(g({},f),{__collection:r||p}),children:i.jsx(e.ActionContextProvider,{value:y(g({},v),{visible:T,setVisible:A}),children:i.jsx(d.RecursionField,{schema:l,basePath:n.address,onlyRenderProperties:!0})})})})]})})})},{displayName:"DuplicateAction"}),ie=t=>i.jsx(e.SchemaComponentOptions,{components:{DuplicateActionInitializer:ne,DuplicateAction:$},children:t.children}),E=d.connect(M.Tree,d.mapProps((t,c)=>{b.useEffect(()=>{c.value=t.defaultCheckedKeys||[]},[]);const[m,n]=b.useState(t.defaultCheckedKeys||[]),l=a=>{n(a),c.value=a};c.onCheck=l;const x=d.useForm();return y(g({},t),{checkedKeys:m,onCheck:l,treeData:t==null?void 0:t.treeData.map(a=>{var k;if(x.values.duplicateMode==="quickDulicate"){const T=(k=a==null?void 0:a.children)==null?void 0:k.map(A=>y(g({},A),{disabled:!1}));return y(g({},a),{disabled:!1,children:T})}return a})})})),R=(t,c)=>{for(let n=0;n<(t==null?void 0:t.length);n++){const m=t[n],{children:l}=m,x=oe(m,["children"]);c.push(x.key),l&&R(l,c)}return c},G=t=>t.reduceProperties((m,n)=>n["x-decorator"]==="FormBlockProvider"?n:G(n),null);function ce(){var V,C,_;const{dn:t}=e.useDesignable(),{t:c}=q.useTranslation(),m=d.useField(),n=d.useFieldSchema(),{name:l}=e.useCollection(),{collectionList:x,getEnableFieldTree:a,getOnLoadData:k,getOnCheck:T}=e.useCollectionState(l),A=z.cloneDeep(n["x-component-props"].duplicateFields||[]),h=e.useRecord(),w=b.useCallback((r,f,s)=>{s.query("duplicateFields").take(p=>{p.componentProps.treeData=r,p.componentProps.defaultCheckedKeys=f,p.setInitialValue(f),p==null||p.onCheck(f),s.setValues(y(g({},s.values),{treeData:r}))})},[]),S=r=>({run(){return B(this,null,function*(){r.query("duplicateFields").take(s=>{var v;const p=R(s.componentProps.treeData,[]);s.componentProps.defaultCheckedKeys=p,s.setInitialValue(p),(v=s==null?void 0:s.onCheck)==null||v.call(s,p)})})}}),L=r=>({run(){return B(this,null,function*(){r.query("duplicateFields").take(s=>{s.componentProps.defaultCheckedKeys=[],s.setInitialValue([]),s==null||s.onCheck([])})})}});return i.jsx(e.SchemaSettingsModalItem,{title:c("Duplicate mode"),components:{Tree:E},scope:{getEnableFieldTree:a,collectionName:((V=n["x-component-props"])==null?void 0:V.duplicateCollection)||(h==null?void 0:h.__collection)||l,currentCollection:(h==null?void 0:h.__collection)||l,getOnLoadData:k,getOnCheck:T,treeData:(C=n["x-component-props"])==null?void 0:C.treeData,duplicateValues:A,onFieldInputValueChange:D.onFieldInputValueChange},schema:{type:"object",title:c("Duplicate mode"),properties:{duplicateMode:{"x-decorator":"FormItem","x-component":"Radio.Group",title:c("Duplicate mode"),default:((_=n["x-component-props"])==null?void 0:_.duplicateMode)||"quickDulicate",enum:[{value:"quickDulicate",label:'{{t("Direct duplicate")}}'},{value:"continueduplicate",label:'{{t("Copy into the form and continue to fill in")}}'}]},collection:{type:"string",title:'{{ t("Target collection") }}',required:!0,description:c("If collection inherits, choose inherited collections as templates"),default:"{{ collectionName }}","x-display":x.length>1?"visible":"hidden","x-decorator":"FormItem","x-component":"Select","x-component-props":{options:x},"x-reactions":[{dependencies:[".duplicateMode"],fulfill:{state:{disabled:'{{ $deps[0]==="quickDulicate" }}',value:'{{ $deps[0]==="quickDulicate"? currentCollection:collectionName }}'}}}]},syncFromForm:{type:"void",title:'{{ t("Sync from form fields") }}',"x-component":"Action.Link","x-component-props":{type:"primary",style:{float:"right",position:"relative",zIndex:1200},useAction:()=>{var f;const r=b.useMemo(()=>G(n),[n]);return e.useSyncFromForm(r,((f=n["x-component-props"])==null?void 0:f.duplicateCollection)||(h==null?void 0:h.__collection)||l,w)}},"x-reactions":[{dependencies:[".duplicateMode"],fulfill:{state:{visible:'{{ $deps[0]!=="quickDulicate" }}'}}}]},selectAll:{type:"void",title:'{{ t("Select all") }}',"x-component":"Action.Link","x-reactions":[{dependencies:[".duplicateMode"],fulfill:{state:{visible:'{{ $deps[0]==="quickDulicate"}}'}}}],"x-component-props":{type:"primary",style:{float:"right",position:"relative",zIndex:1200},useAction:()=>{const r=d.useForm();return S(r)}}},unselectAll:{type:"void",title:'{{ t("UnSelect all") }}',"x-component":"Action.Link","x-reactions":[{dependencies:[".duplicateMode",".duplicateFields"],fulfill:{state:{visible:`{{ $deps[0]==="quickDulicate"&&$form.getValuesIn('duplicateFields').length>0 }}`}}}],"x-component-props":{type:"primary",style:{float:"right",position:"relative",zIndex:1200,marginRight:"10px"},useAction:()=>{const r=d.useForm();return L(r)}}},duplicateFields:{type:"array",title:'{{ t("Data fields") }}',required:!0,description:c("Only the selected fields will be used as the initialization data for the form"),"x-decorator":"FormItem","x-component":E,"x-component-props":{defaultCheckedKeys:A,treeData:[],checkable:!0,checkStrictly:!0,selectable:!1,loadData:"{{ getOnLoadData($self) }}",onCheck:"{{ getOnCheck($self) }}",rootStyle:{padding:"8px 0",border:"1px solid #d9d9d9",borderRadius:"2px",maxHeight:"30vh",overflow:"auto",margin:"2px 0"}},"x-reactions":[{dependencies:[".collection",".duplicateMode"],fulfill:{state:{disabled:"{{ !$deps[0] }}",componentProps:{treeData:"{{ getEnableFieldTree($deps[0], $self,treeData) }}"}}}}]}}},onSubmit:({duplicateMode:r,collection:f,duplicateFields:s,treeData:p})=>{var P;const v=Array.isArray(s)?s:s.checked||[];m.componentProps.duplicateMode=r,m.componentProps.duplicateFields=v,n["x-component-props"]=n["x-component-props"]||{},n["x-component-props"].duplicateMode=r,n["x-component-props"].duplicateFields=v,n["x-component-props"].duplicateCollection=f,n["x-component-props"].treeData=p||((P=m.componentProps)==null?void 0:P.treeData),t.emit("patch",{schema:{"x-uid":n["x-uid"],"x-component-props":g({},n["x-component-props"])}}),t.refresh()}})}const ae=new e.SchemaSettings({name:"ActionSettings:duplicate",items:[{name:"Customize",Component:t=>t.children,children:[{name:"editButton",Component:e.ActionDesigner.ButtonEditor,useComponentProps(){const{buttonEditorProps:t}=e.useSchemaToolbar();return t}},{name:"linkageRules",Component:e.SchemaSettingsLinkageRules,useComponentProps(){const{name:t}=e.useCollection(),{linkageRulesProps:c}=e.useSchemaToolbar();return y(g({},c),{collectionName:t})}},{name:"duplicationMode",Component:ce,useVisible(){return d.useFieldSchema()["x-action"]==="duplicate"}},{name:"openMode",Component:e.SchemaSettingOpenModeSchemaItems,useComponentProps(){const t=d.useFieldSchema(),c=["create","update","view","customize:popup","duplicate","customize:create"].includes(t["x-action"]||"");return{openMode:c,openSize:c}}},{name:"remove",sort:100,Component:e.ActionDesigner.RemoveButton,useComponentProps(){const{removeButtonProps:t}=e.useSchemaToolbar();return t}}]}]});class H extends e.Plugin{load(){return B(this,null,function*(){this.app.use(ie),this.app.schemaSettingsManager.add(ae);const c={title:'{{t("Duplicate")}}',Component:"DuplicateActionInitializer",schema:{"x-component":"Action","x-action":"duplicate","x-decorator":"ACLActionProvider","x-component-props":{type:"primary"}},useVisible(){const a=e.useCollection();return(a.template!=="view"||(a==null?void 0:a.writableView))&&a.template!=="file"&&a.template!=="sql"}},m={title:'{{t("Duplicate")}}',Component:"DuplicateActionInitializer",schema:{"x-component":"Action.Link","x-action":"duplicate","x-designer":"Action.Designer","x-settings":"ActionSettings:duplicate","x-decorator":"ACLActionProvider","x-component-props":{type:"primary"}},useVisible(){const a=e.useCollection();return(a.template!=="view"||(a==null?void 0:a.writableView))&&a.template!=="file"&&a.template!=="sql"}},n=this.app.schemaInitializerManager.get("TableActionColumnInitializers");n==null||n.add("actions.duplicate",m);const l=this.app.schemaInitializerManager.get("DetailsActionInitializers");l==null||l.add("enableActions.duplicate",c);const x=this.app.schemaInitializerManager.get("ReadPrettyFormActionInitializers");x==null||x.add("enableActions.duplicate",c)})}}o.DuplicateAction=$,o.DuplicatePlugin=H,o.actionDesignerCss=N,o.default=H,Object.defineProperties(o,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
"react": "18.2.0",
|
|
3
|
+
"@nocobase/client": "0.18.0-alpha.1",
|
|
4
|
+
"@formily/core": "2.3.0",
|
|
5
|
+
"lodash": "4.17.21",
|
|
6
|
+
"antd": "5.12.2",
|
|
7
|
+
"react-i18next": "11.18.6",
|
|
8
|
+
"@formily/react": "2.3.0",
|
|
9
|
+
"@emotion/css": "11.11.2",
|
|
10
|
+
"@nocobase/server": "0.18.0-alpha.1",
|
|
11
|
+
"@nocobase/test": "0.18.0-alpha.1"
|
|
12
|
+
};
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var src_exports = {};
|
|
30
|
+
__export(src_exports, {
|
|
31
|
+
default: () => import_server.default
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(src_exports);
|
|
34
|
+
__reExport(src_exports, require("./server"), module.exports);
|
|
35
|
+
var import_server = __toESM(require("./server"));
|
|
36
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
37
|
+
0 && (module.exports = {
|
|
38
|
+
...require("./server")
|
|
39
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './plugin';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var server_exports = {};
|
|
29
|
+
__export(server_exports, {
|
|
30
|
+
default: () => import_plugin.default
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(server_exports);
|
|
33
|
+
var import_plugin = __toESM(require("./plugin"));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { InstallOptions, Plugin } from '@nocobase/server';
|
|
2
|
+
export declare class PluginActionDuplicateServer extends Plugin {
|
|
3
|
+
afterAdd(): void;
|
|
4
|
+
beforeLoad(): void;
|
|
5
|
+
load(): Promise<void>;
|
|
6
|
+
install(options?: InstallOptions): Promise<void>;
|
|
7
|
+
afterEnable(): Promise<void>;
|
|
8
|
+
afterDisable(): Promise<void>;
|
|
9
|
+
remove(): Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
export default PluginActionDuplicateServer;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var plugin_exports = {};
|
|
19
|
+
__export(plugin_exports, {
|
|
20
|
+
PluginActionDuplicateServer: () => PluginActionDuplicateServer,
|
|
21
|
+
default: () => plugin_default
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(plugin_exports);
|
|
24
|
+
var import_server = require("@nocobase/server");
|
|
25
|
+
class PluginActionDuplicateServer extends import_server.Plugin {
|
|
26
|
+
afterAdd() {
|
|
27
|
+
}
|
|
28
|
+
beforeLoad() {
|
|
29
|
+
}
|
|
30
|
+
async load() {
|
|
31
|
+
}
|
|
32
|
+
async install(options) {
|
|
33
|
+
}
|
|
34
|
+
async afterEnable() {
|
|
35
|
+
}
|
|
36
|
+
async afterDisable() {
|
|
37
|
+
}
|
|
38
|
+
async remove() {
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
var plugin_default = PluginActionDuplicateServer;
|
|
42
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
43
|
+
0 && (module.exports = {
|
|
44
|
+
PluginActionDuplicateServer
|
|
45
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@nocobase/plugin-action-duplicate",
|
|
3
|
+
"version": "0.18.0-alpha.1",
|
|
4
|
+
"main": "dist/server/index.js",
|
|
5
|
+
"displayName": "Data duplicate",
|
|
6
|
+
"displayName.zh-CN": "数据复制",
|
|
7
|
+
"description": "Provides deplicate action",
|
|
8
|
+
"description.zh-CN": "提供复制数据操作",
|
|
9
|
+
"license": "AGPL-3.0",
|
|
10
|
+
"peerDependencies": {
|
|
11
|
+
"@nocobase/client": "0.x",
|
|
12
|
+
"@nocobase/server": "0.x",
|
|
13
|
+
"@nocobase/test": "0.x"
|
|
14
|
+
},
|
|
15
|
+
"gitHead": "0f5f1c0a37dc397a9dc4c8eec0c4ec20fd8107b0"
|
|
16
|
+
}
|
package/server.d.ts
ADDED
package/server.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./dist/server/index.js');
|