@tachybase/plugin-action-duplicate 1.3.15 → 1.3.17

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.
@@ -36,7 +36,7 @@
36
36
  }
37
37
  }
38
38
  }
39
- `,k=p.observer(t=>{var Y,Z;const{children:a}=t,{message:s}=q.App.useApp(),n=p.useField(),d=p.useFieldSchema(),D=e.useAPIClient(),u=n.disabled||t.disabled,{designable:S}=e.useDesignable(),[I,v]=r.useState(!1),[m,T]=r.useState(!1),{service:A,__parent:_,block:L}=e.useBlockRequestContext(),{duplicateFields:C,duplicateMode:V="quickDulicate",duplicateCollection:w}=d["x-component-props"],l=e.useRecord(),f=e.useCollectionParentRecordData(),{__collection:c}=l,h=e.useActionContext(),{name:b}=e.useCollection_deprecated(),{getCollectionFields:$}=e.useCollectionManager_deprecated(),{t:P}=B.useTranslation(),re=$(c||b),pe=e.useFormBlockContext(),O=e.useCollection(),de=O==null?void 0:O.getPrimaryKey(),J={key:"duplicate",dataId:l[de],default:!0,fields:(C==null?void 0:C.filter(F=>re.find(K=>F.includes(K.name))))||[],collection:c||b},W=d["x-component"]==="Action.Link",ue=()=>z(this,null,function*(){var F,K,ee;T(!0);try{const j=yield e.fetchTemplateData(D,J,P);yield D.resource(c||b).create({values:x({},j)}),s.success(P("Saved successfully")),L==="form"?(K=(F=_==null?void 0:_.service)==null?void 0:F.refresh)==null||K.call(F):yield(ee=A==null?void 0:A.refresh)==null?void 0:ee.call(A),T(!1)}catch(j){T(!1),console.error(j)}}),X=()=>{!u&&!m&&((C==null?void 0:C.length)>0?V==="quickDulicate"?ue():v(!0):s.error(P("Please configure the duplicate fields")))};return i.jsx("div",{className:e.cx(y,{[e.css`
39
+ `,k=p.observer(t=>{var Y,Z;const{children:a}=t,{message:s}=q.App.useApp(),n=p.useField(),d=p.useFieldSchema(),D=e.useAPIClient(),u=n.disabled||t.disabled,{designable:S}=e.useDesignable(),[I,v]=r.useState(!1),[m,T]=r.useState(!1),{service:A,__parent:_,block:L}=e.useBlockRequestContext(),{duplicateFields:C,duplicateMode:V="quickDulicate",duplicateCollection:w}=d["x-component-props"],l=e.useRecord(),f=e.useCollectionParentRecordData(),{__collection:c}=l,h=e.useActionContext(),{name:b}=e.useCollection_deprecated(),{getCollectionFields:$}=e.useCollectionManager_deprecated(),{t:P}=B.useTranslation(),re=$(c||b),pe=e.useFormBlockContext(),O=e.useCollection(),de=O==null?void 0:O.getPrimaryKey(),J={key:"duplicate",dataId:l[de],default:!0,fields:(C==null?void 0:C.filter(F=>re.find(K=>F.includes(K.name))))||[],collection:c||b},W=d["x-component"]==="Action.Link",ue=()=>z(null,null,function*(){var F,K,ee;T(!0);try{const j=yield e.fetchTemplateData(D,J,P);yield D.resource(c||b).create({values:x({},j)}),s.success(P("Saved successfully")),L==="form"?(K=(F=_==null?void 0:_.service)==null?void 0:F.refresh)==null||K.call(F):yield(ee=A==null?void 0:A.refresh)==null?void 0:ee.call(A),T(!1)}catch(j){T(!1),console.error(j)}}),X=()=>{!u&&!m&&((C==null?void 0:C.length)>0?V==="quickDulicate"?ue():v(!0):s.error(P("Please configure the duplicate fields")))};return i.jsx("div",{className:e.cx(y,{[e.css`
40
40
  .general-schema-designer {
41
41
  top: -10px;
42
42
  bottom: -10px;
@@ -1,10 +1,10 @@
1
1
  module.exports = {
2
2
  "react": "18.3.1",
3
- "@tachybase/client": "1.3.15",
4
- "@tachybase/schema": "1.3.15",
3
+ "@tachybase/client": "1.3.17",
4
+ "@tachybase/schema": "1.3.17",
5
5
  "antd": "5.22.5",
6
6
  "lodash": "4.17.21",
7
7
  "react-i18next": "15.2.0",
8
- "@tachybase/server": "1.3.15",
9
- "@tachybase/test": "1.3.15"
8
+ "@tachybase/server": "1.3.17",
9
+ "@tachybase/test": "1.3.17"
10
10
  };
package/dist/index.js CHANGED
@@ -26,12 +26,12 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  mod
27
27
  ));
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var src_exports = {};
30
- __export(src_exports, {
29
+ var index_exports = {};
30
+ __export(index_exports, {
31
31
  default: () => import_server.default
32
32
  });
33
- module.exports = __toCommonJS(src_exports);
34
- __reExport(src_exports, require("./server"), module.exports);
33
+ module.exports = __toCommonJS(index_exports);
34
+ __reExport(index_exports, require("./server"), module.exports);
35
35
  var import_server = __toESM(require("./server"));
36
36
  // Annotate the CommonJS export names for ESM import in node:
37
37
  0 && (module.exports = {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tachybase/plugin-action-duplicate",
3
3
  "displayName": "Action: Duplicate record",
4
- "version": "1.3.15",
4
+ "version": "1.3.17",
5
5
  "description": "Duplicate a record, you can either duplicate it into a form and edit it before saving it, or you can duplicate it directly to generate a new record.",
6
6
  "keywords": [
7
7
  "Actions"
@@ -13,12 +13,12 @@
13
13
  "antd": "5.22.5",
14
14
  "lodash": "4.17.21",
15
15
  "react-i18next": "^15.2.0",
16
- "@tachybase/schema": "1.3.15"
16
+ "@tachybase/schema": "1.3.17"
17
17
  },
18
18
  "peerDependencies": {
19
- "@tachybase/client": "1.3.15",
20
- "@tachybase/test": "1.3.15",
21
- "@tachybase/server": "1.3.15"
19
+ "@tachybase/server": "1.3.17",
20
+ "@tachybase/test": "1.3.17",
21
+ "@tachybase/client": "1.3.17"
22
22
  },
23
23
  "description.zh-CN": "复制一条记录,可以复制到表单中编辑后再提交,也可以直接复制并生成一条新记录。",
24
24
  "displayName.zh-CN": "操作:复制记录",