@nocobase/plugin-action-bulk-edit 1.2.13-alpha → 1.3.0-alpha.20240710084543

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/plugin-action-bulk-edit",
3
- "version": "1.2.13-alpha",
3
+ "version": "1.3.0-alpha.20240710084543",
4
4
  "main": "dist/server/index.js",
5
5
  "homepage": "https://docs.nocobase.com/handbook/action-bulk-edit",
6
6
  "homepage.zh-CN": "https://docs-cn.nocobase.com/handbook/action-bulk-edit",
@@ -14,7 +14,7 @@
14
14
  "@nocobase/server": "1.x",
15
15
  "@nocobase/test": "1.x"
16
16
  },
17
- "gitHead": "b6a1c2ee330b47c2581ea2ce15ee46210e6220f2",
17
+ "gitHead": "07a8b596fc64a9779a194cb9b0dc2ca7570ed9d4",
18
18
  "keywords": [
19
19
  "Actions"
20
20
  ]
@@ -1,15 +0,0 @@
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
- import { SchemaSettings } from '@nocobase/client';
10
- /**
11
- * @deprecated
12
- * 之所以还保留,仅是为了兼容旧版 schema
13
- */
14
- export declare const deprecatedBulkEditActionSettings: SchemaSettings<{}>;
15
- export declare const bulkEditActionSettings: SchemaSettings<{}>;
@@ -1,10 +0,0 @@
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
- import React from 'react';
10
- export declare const BulkEditActionInitializer: () => React.JSX.Element;
@@ -1,20 +0,0 @@
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
- import { CompatibleSchemaInitializer, SchemaInitializer } from '@nocobase/client';
10
- /**
11
- * @deprecated
12
- * 之所以还保留,仅是为了兼容旧版 schema
13
- */
14
- export declare const CreateFormBulkEditBlockInitializers: SchemaInitializer;
15
- /**
16
- * @deprecated
17
- * use `bulkEditBlockInitializers` instead
18
- */
19
- export declare const BulkEditBlockInitializers_deprecated: CompatibleSchemaInitializer;
20
- export declare const bulkEditBlockInitializers: CompatibleSchemaInitializer;
@@ -1,15 +0,0 @@
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
- import { CompatibleSchemaInitializer } from '@nocobase/client';
10
- /**
11
- * @deprecated
12
- * use `bulkEditFormActionInitializers` instead
13
- */
14
- export declare const BulkEditFormActionInitializers_deprecated: CompatibleSchemaInitializer;
15
- export declare const bulkEditFormActionInitializers: CompatibleSchemaInitializer;
@@ -1,15 +0,0 @@
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
- import { CompatibleSchemaInitializer } from '@nocobase/client';
10
- /**
11
- * @deprecated
12
- * use `bulkEditFormItemInitializers` instead
13
- */
14
- export declare const BulkEditFormItemInitializers_deprecated: CompatibleSchemaInitializer;
15
- export declare const bulkEditFormItemInitializers: CompatibleSchemaInitializer;
@@ -1,10 +0,0 @@
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
- import React from 'react';
10
- export declare const BulkEditSubmitActionInitializer: (props: any) => React.JSX.Element;
@@ -1,10 +0,0 @@
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
- import React from 'react';
10
- export declare const CreateFormBulkEditBlockInitializer: () => React.JSX.Element;
@@ -1,10 +0,0 @@
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
- import { SchemaSettings } from '@nocobase/client';
10
- export declare const bulkEditFormItemSettings: SchemaSettings<{}>;
@@ -1,17 +0,0 @@
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
- import React from 'react';
10
- export declare const DeletedField: () => React.JSX.Element;
11
- export declare enum BulkEditFormItemValueType {
12
- RemainsTheSame = 1,
13
- ChangedTo = 2,
14
- Clear = 3,
15
- AddAttach = 4
16
- }
17
- export declare const BulkEditField: (props: any) => React.JSX.Element;
@@ -1,18 +0,0 @@
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
- import { ISchema } from '@formily/react';
10
- /**
11
- * 创建批量编辑表单的 UI Schema
12
- * @returns
13
- */
14
- export declare function createBulkEditBlockUISchema(options: {
15
- collectionName: string;
16
- dataSource: string;
17
- association?: string;
18
- }): ISchema;
@@ -1,13 +0,0 @@
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
- import { Plugin } from '@nocobase/client';
10
- export declare class PluginActionBulkEditClient extends Plugin {
11
- load(): Promise<void>;
12
- }
13
- export default PluginActionBulkEditClient;
@@ -1,15 +0,0 @@
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
- (function(a,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("@nocobase/client"),require("react/jsx-runtime"),require("@formily/react"),require("react-i18next"),require("@ant-design/icons"),require("@formily/shared"),require("@nocobase/utils/client"),require("antd"),require("react"),require("react-router-dom"),require("@formily/antd-v5"),require("lodash"),require("@emotion/css")):typeof define=="function"&&define.amd?define(["exports","@nocobase/client","react/jsx-runtime","@formily/react","react-i18next","@ant-design/icons","@formily/shared","@nocobase/utils/client","antd","react","react-router-dom","@formily/antd-v5","lodash","@emotion/css"],e):(a=typeof globalThis!="undefined"?globalThis:a||self,e(a["@nocobase/plugin-action-bulk-edit"]={},a["@nocobase/client"],a.jsxRuntime,a["@formily/react"],a["react-i18next"],a["@ant-design/icons"],a["@formily/shared"],a["@nocobase/utils"],a.antd,a.react,a["react-router-dom"],a["@formily/antd-v5"],a.lodash,a["@emotion/css"]))})(this,function(a,e,s,d,b,O,v,E,C,F,re,q,D,ae){"use strict";var ze=Object.defineProperty,Be=Object.defineProperties;var ve=Object.getOwnPropertyDescriptors;var M=Object.getOwnPropertySymbols;var oe=Object.prototype.hasOwnProperty,ie=Object.prototype.propertyIsEnumerable;var te=(a,e,s)=>e in a?ze(a,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):a[e]=s,y=(a,e)=>{for(var s in e||(e={}))oe.call(e,s)&&te(a,s,e[s]);if(M)for(var s of M(e))ie.call(e,s)&&te(a,s,e[s]);return a},z=(a,e)=>Be(a,ve(e));var ne=(a,e)=>{var s={};for(var d in a)oe.call(a,d)&&e.indexOf(d)<0&&(s[d]=a[d]);if(a!=null&&M)for(var d of M(a))e.indexOf(d)<0&&ie.call(a,d)&&(s[d]=a[d]);return s};var w=(a,e,s)=>new Promise((d,b)=>{var O=C=>{try{E(s.next(C))}catch(F){b(F)}},v=C=>{try{E(s.throw(C))}catch(F){b(F)}},E=C=>C.done?d(C.value):Promise.resolve(C.value).then(O,v);E((s=s.apply(a,e)).next())});function N(){var i;const{dn:t}=e.useDesignable(),{t:o}=b.useTranslation(),n=d.useFieldSchema();return s.jsx(e.SchemaSettingsSelectItem,{title:o("Data will be updated"),options:[{label:o("Selected"),value:"selected"},{label:o("All"),value:"all"}],value:(i=n==null?void 0:n["x-action-settings"])==null?void 0:i.updateMode,onChange:c=>{n["x-action-settings"].updateMode=c,t.emit("patch",{schema:{"x-uid":n["x-uid"],"x-action-settings":n["x-action-settings"]}}),t.refresh()}})}function V(t={}){const{t:o}=b.useTranslation(),n=d.useFieldSchema();return!((n==null?void 0:n.parent["x-component"])==="CollectionField")&&s.jsxs(s.Fragment,{children:[s.jsx(e.SchemaSettingsDivider,{}),s.jsx(e.SchemaSettingsRemove,{removeParentsIfNoChildren:!0,breakRemoveOn:c=>c["x-component"]==="Space"||c["x-component"].endsWith("ActionBar"),confirm:{title:o("Delete action"),onOk:t.onConfirmOk}})]})}const se=new e.SchemaSettings({name:"ActionSettings:customize:bulkEdit",items:[{name:"editButton",Component:e.ActionDesigner.ButtonEditor,useComponentProps(){const{buttonEditorProps:t}=e.useSchemaToolbar();return t}},{name:"openMode",Component:e.SchemaInitializerOpenModeSchemaItems,useComponentProps(){const t=d.useFieldSchema(),o=["create","update","view","customize:popup","duplicate","customize:create"].includes(t["x-action"]||"");return{openMode:o,openSize:o}}},{name:"updateMode",Component:N},{name:"remove",sort:100,Component:V,useComponentProps(){const{removeButtonProps:t}=e.useSchemaToolbar();return t}}]}),ce=new e.SchemaSettings({name:"actionSettings:bulkEdit",items:[{name:"editButton",Component:e.ActionDesigner.ButtonEditor,useComponentProps(){const{buttonEditorProps:t}=e.useSchemaToolbar();return t}},{name:"openMode",Component:e.SchemaInitializerOpenModeSchemaItems,useComponentProps(){const t=d.useFieldSchema(),o=["create","update","view","customize:popup","duplicate","customize:create"].includes(t["x-action"]||"");return{openMode:o,openSize:o}}},{name:"updateMode",Component:N},{name:"remove",sort:100,Component:V,useComponentProps(){const{removeButtonProps:t}=e.useSchemaToolbar();return t}}]}),de=()=>{const t={type:"void",title:'{{t("Bulk edit")}}',"x-component":"Action","x-action":"customize:bulkEdit","x-action-settings":{updateMode:"selected"},"x-component-props":{openMode:"drawer",icon:"EditOutlined"},properties:{drawer:{type:"void",title:'{{t("Bulk edit")}}',"x-component":"Action.Container","x-component-props":{className:"nb-action-popup"},properties:{tabs:{type:"void","x-component":"Tabs","x-component-props":{},"x-initializer":"popup:addTab","x-initializer-props":{gridInitializer:"popup:bulkEdit:addBlock"},properties:{tab1:{type:"void",title:'{{t("Bulk edit")}}',"x-component":"Tabs.TabPane","x-designer":"Tabs.Designer","x-component-props":{},properties:{grid:{type:"void","x-component":"Grid","x-initializer":"popup:bulkEdit:addBlock",properties:{}}}}}}}}}},o=e.useSchemaInitializerItem();return s.jsx(e.BlockInitializer,z(y({},o),{schema:t,item:o}))};function pe(t){const{collectionName:o,association:n,dataSource:i}=t,c=n||o;if(!o||!i)throw new Error("collectionName and dataSource are required");return{type:"void","x-acl-action-props":{skipScopeCheck:!0},"x-acl-action":`${c}:update`,"x-decorator":"FormBlockProvider","x-decorator-props":{dataSource:i,collection:o,association:n},"x-toolbar":"BlockSchemaToolbar","x-settings":"blockSettings:createForm","x-component":"CardItem",properties:{[v.uid()]:{type:"void","x-component":"FormV2","x-use-component-props":"useCreateFormBlockProps",properties:{grid:{type:"void","x-component":"Grid","x-initializer":"bulkEditForm:configureFields",properties:{}},[v.uid()]:{type:"void","x-initializer":"bulkEditForm:configureActions","x-component":"ActionBar","x-component-props":{layout:"one-column",style:{marginTop:24}}}}}}}}const G=()=>{const h=e.useSchemaInitializerItem(),{onCreateBlockSchema:o,componentType:n,createBlockSchema:i}=h,c=ne(h,["onCreateBlockSchema","componentType","createBlockSchema"]),{insert:l}=e.useSchemaInitializer(),{getTemplateSchemaByMode:m}=e.useSchemaTemplateManager(),u=e.useAssociationName(),p=e.useCollection_deprecated();return s.jsx(e.SchemaInitializerItem,z(y({icon:s.jsx(O.FormOutlined,{})},c),{onClick:g=>w(this,[g],function*({item:r}){if(r.template){const f=yield m(r);if(r.template.componentName==="FormItem"){const k=e.createCreateFormBlockUISchema(u?{association:u,dataSource:p.dataSource,templateSchema:f}:{collectionName:p.name,dataSource:p.dataSource,templateSchema:f});r.mode==="reference"&&(k["x-template-key"]=r.template.key),l(k)}else l(f)}else l(pe({association:u,collectionName:p.name,dataSource:p.dataSource}))}),items:e.useRecordCollectionDataSourceItems("FormItem")}))},le=new e.SchemaInitializer({name:"CreateFormBulkEditBlockInitializers",wrap:e.gridRowColWrap,title:'{{t("Add block")}}',icon:"PlusOutlined",items:[{type:"itemGroup",title:'{{t("Data blocks")}}',name:"dataBlocks",children:[{name:"form",title:'{{t("Form")}}',Component:G}]},{type:"itemGroup",title:'{{t("Other blocks")}}',name:"otherBlocks",children:[{name:"markdown",title:'{{t("Markdown")}}',Component:"MarkdownBlockInitializer"}]}]}),_={wrap:e.gridRowColWrap,title:'{{t("Add block")}}',icon:"PlusOutlined",items:[{type:"itemGroup",title:'{{t("Data blocks")}}',name:"dataBlocks",children:[{name:"form",title:'{{t("Form")}}',Component:G}]},{type:"itemGroup",title:'{{t("Other blocks")}}',name:"otherBlocks",children:[{name:"markdown",title:'{{t("Markdown")}}',Component:"MarkdownBlockInitializer"}]}]},$=new e.CompatibleSchemaInitializer(y({name:"BulkEditBlockInitializers"},_)),me=new e.CompatibleSchemaInitializer(y({name:"popup:bulkEdit:addBlock"},_),$),j={title:'{{t("Configure actions")}}',icon:"SettingOutlined",items:[{type:"itemGroup",title:'{{t("Enable actions")}}',name:"enableActions",children:[{name:"submit",title:'{{t("Submit")}}',Component:t=>{const o={title:'{{ t("Submit") }}',"x-action":"submit","x-component":"Action","x-use-component-props":"useCustomizeBulkEditActionProps","x-toolbar":"ActionSchemaToolbar","x-settings":"actionSettings:updateSubmit","x-component-props":{type:"primary",htmlType:"submit"}};return s.jsx(e.ActionInitializerItem,z(y({},t),{schema:o}))},schema:{"x-action-settings":{}}}]}]},U=new e.CompatibleSchemaInitializer(y({name:"BulkEditFormActionInitializers"},j)),ue=new e.CompatibleSchemaInitializer(y({name:"bulkEditForm:configureActions"},j),U),he=t=>{const{name:o,fields:n}=e.useCollection_deprecated(),{getInterface:i,getCollection:c}=e.useCollectionManager_deprecated(),l=d.useForm(),{readPretty:m=l.readPretty,block:u="Form"}=t||{},p=e.useRemoveGridFormItem();return F.useMemo(()=>n==null?void 0:n.filter(r=>{var g;return(r==null?void 0:r.interface)&&!((g=r==null?void 0:r.uiSchema)!=null&&g["x-read-pretty"])&&r.interface!=="snapshot"&&r.type!=="sequence"}).map(r=>{var k,S,I;const g=i(r.interface),f={type:"string",name:r.name,title:((k=r==null?void 0:r.uiSchema)==null?void 0:k.title)||r.name,"x-toolbar":"FormItemSchemaToolbar","x-settings":"fieldSettings:BulkEditFormItem","x-component":"BulkEditField","x-decorator":"FormItem","x-collection-field":`${o}.${r.name}`};return{name:((S=r==null?void 0:r.uiSchema)==null?void 0:S.title)||r.name,type:"item",title:((I=r==null?void 0:r.uiSchema)==null?void 0:I.title)||r.name,Component:"CollectionFieldInitializer",remove:p,schemaInitialize:B=>{var A;(A=g==null?void 0:g.schemaInitialize)==null||A.call(g,B,{field:r,block:u,readPretty:m,targetCollection:c(r.target)})},schema:f}}),[n])},xe=()=>{var A,H,K,Q;const t=d.useForm(),{t:o}=b.useTranslation(),{field:n,resource:i,__parent:c}=e.useBlockRequestContext(),l=F.useContext(d.SchemaExpressionScopeContext),m=e.useActionContext(),u=re.useNavigate(),p=e.useCompile(),h=d.useField(),r=e.useTableBlockContext(),{modal:g}=C.App.useApp(),{rowKey:f}=r,k=(Q=(K=(H=(A=r.field)==null?void 0:A.data)==null?void 0:H.selectedRowKeys)!=null?K:l==null?void 0:l.selectedRecordKeys)!=null?Q:{},{setVisible:S,fieldSchema:I,setSubmitted:B}=m;return{onClick(){return w(this,null,function*(){var X,Y,Z,R,T,ee;const{onSuccess:x,skipValidator:ye,updateMode:Fe}=(X=I==null?void 0:I["x-action-settings"])!=null?X:{},{filter:Ie}=(Z=(Y=c.service.params)==null?void 0:Y[0])!=null?Z:{};ye||(yield t.submit()),h.data=n.data||{},h.data.loading=!0;try{const P={values:t.values,filter:Ie,forceUpdate:!1};if(Fe==="selected"){if(!(k!=null&&k.length)){C.message.error(o("Please select the records to be updated"));return}P.filter={$and:[{[f||"id"]:{$in:k}}]}}if(P.filter||(P.forceUpdate=!0),yield i.update(P),h.data.loading=!1,i instanceof e.TableFieldResource||(ee=(T=(R=c==null?void 0:c.__parent)==null?void 0:R.service)==null?void 0:T.refresh)==null||ee.call(T),S==null||S(!1),B(!0),!(x!=null&&x.successMessage))return;x!=null&&x.manualClose?g.success({title:p(x==null?void 0:x.successMessage),onOk:()=>w(this,null,function*(){yield t.reset(),x!=null&&x.redirecting&&(x!=null&&x.redirectTo)&&(E.isURL(x.redirectTo)?window.location.href=x.redirectTo:u(x.redirectTo))})}):C.message.success(p(x==null?void 0:x.successMessage))}finally{h.data.loading=!1}})}}},L={wrap:e.gridRowColWrap,icon:"SettingOutlined",title:'{{t("Configure fields")}}',items:[{name:"displayFields",type:"itemGroup",title:'{{t("Display fields")}}',useChildren:he},{name:"divider",type:"divider"},{name:"addText",title:'{{t("Add text")}}',Component:"BlockItemInitializer",schema:{type:"void","x-editable":!1,"x-decorator":"FormItem","x-toolbar":"FormItemSchemaToolbar","x-settings":"blockSettings:markdown","x-component":"Markdown.Void","x-component-props":{content:'{{t("This is a demo text, **supports Markdown syntax**.")}}'}}}]},W=new e.CompatibleSchemaInitializer(y({name:"BulkEditFormItemInitializers"},L)),fe=new e.CompatibleSchemaInitializer(y({name:"bulkEditForm:configureFields"},L),W),Ce=new e.SchemaSettings({name:"fieldSettings:BulkEditFormItem",items:[{name:"decoratorOptions",type:"itemGroup",hideIfNoChildren:!0,useComponentProps(){const{t}=b.useTranslation();return{title:t("Generic properties")}},useChildren(){return[{name:"editFieldTitle",type:"modal",useComponentProps(){var u;const{t}=b.useTranslation(),{dn:o}=e.useDesignable(),n=d.useField(),i=d.useFieldSchema(),{getCollectionJoinField:c}=e.useCollectionManager_deprecated(),{dataSource:l}=e.useCollection_deprecated(),m=c(i["x-collection-field"],l);return{title:t("Edit field title"),schema:{type:"object",title:t("Edit field title"),properties:{title:{title:t("Field title"),default:n==null?void 0:n.title,description:`${t("Original field title: ")}${(u=m==null?void 0:m.uiSchema)==null?void 0:u.title}`,"x-decorator":"FormItem","x-component":"Input","x-component-props":{}}}},onSubmit({title:p}){p&&(n.title=p,i.title=p,o.emit("patch",{schema:{"x-uid":i["x-uid"],title:i.title}})),o.refresh()}}}},{name:"displayTitle",type:"switch",useComponentProps(){var c,l;const{t}=b.useTranslation(),{dn:o}=e.useDesignable(),n=d.useField(),i=d.useFieldSchema();return{title:t("Display title"),checked:(l=(c=i["x-decorator-props"])==null?void 0:c.showTitle)!=null?l:!0,onChange(m){i["x-decorator-props"]=i["x-decorator-props"]||{},i["x-decorator-props"].showTitle=m,n.decoratorProps.showTitle=m,o.emit("patch",{schema:{"x-uid":i["x-uid"],"x-decorator-props":z(y({},i["x-decorator-props"]),{showTitle:m})}}),o.refresh()}}}},{name:"editDescription",type:"modal",useComponentProps(){const{t}=b.useTranslation(),{dn:o}=e.useDesignable(),n=d.useField(),i=d.useFieldSchema();return{title:t("Edit description"),schema:{type:"object",title:t("Edit description"),properties:{description:{default:n==null?void 0:n.description,"x-decorator":"FormItem","x-component":"Input.TextArea","x-component-props":{}}}},onSubmit({description:c}){n.description=c,i.description=c,o.emit("patch",{schema:{"x-uid":i["x-uid"],description:i.description}}),o.refresh()}}}},{name:"editTooltip",type:"modal",useComponentProps(){var c;const{t}=b.useTranslation(),{dn:o}=e.useDesignable(),n=d.useField(),i=d.useFieldSchema();return{title:t("Edit tooltip"),schema:{type:"object",title:t("Edit tooltip"),properties:{tooltip:{default:(c=i==null?void 0:i["x-decorator-props"])==null?void 0:c.tooltip,"x-decorator":"FormItem","x-component":"Input.TextArea","x-component-props":{}}}},onSubmit({tooltip:l}){n.decoratorProps.tooltip=l,i["x-decorator-props"]=i["x-decorator-props"]||{},i["x-decorator-props"].tooltip=l,o.emit("patch",{schema:{"x-uid":i["x-uid"],"x-decorator-props":i["x-decorator-props"]}}),o.refresh()}}}},{name:"setValidationRules",type:"modal",useComponentProps(){const{t}=b.useTranslation(),o=d.useField(),n=d.useFieldSchema(),{dn:i,refresh:c}=e.useDesignable(),l=e.useValidateSchema(),{getCollectionJoinField:m}=e.useCollectionManager_deprecated(),{dataSource:u}=e.useCollection_deprecated(),p=m(n["x-collection-field"],u);return{title:t("Set validation rules"),components:{ArrayCollapse:q.ArrayCollapse,FormLayout:q.FormLayout},schema:{type:"object",title:t("Set validation rules"),properties:{rules:{type:"array",default:n==null?void 0:n["x-validator"],"x-component":"ArrayCollapse","x-decorator":"FormItem","x-component-props":{accordion:!0},maxItems:3,items:{type:"object","x-component":"ArrayCollapse.CollapsePanel","x-component-props":{header:'{{ t("Validation rule") }}'},properties:{index:{type:"void","x-component":"ArrayCollapse.Index"},layout:{type:"void","x-component":"FormLayout","x-component-props":{labelStyle:{marginTop:"6px"},labelCol:8,wrapperCol:16},properties:z(y({},l),{message:{type:"string",title:'{{ t("Error message") }}',"x-decorator":"FormItem","x-component":"Input.TextArea","x-component-props":{autoSize:{minRows:2,maxRows:2}}}})},remove:{type:"void","x-component":"ArrayCollapse.Remove"},moveUp:{type:"void","x-component":"ArrayCollapse.MoveUp"},moveDown:{type:"void","x-component":"ArrayCollapse.MoveDown"}}},properties:{add:{type:"void",title:'{{ t("Add validation rule") }}',"x-component":"ArrayCollapse.Addition","x-reactions":{dependencies:["rules"],fulfill:{state:{disabled:"{{$deps[0].length >= 3}}"}}}}}}}},onSubmit(h){var k;const r=[];for(const S of h.rules)r.push(D.pickBy(S,D.identity));const g={"x-uid":n["x-uid"]};if(["percent"].includes(p==null?void 0:p.interface))for(const S of r)(S.maxValue||S.minValue)&&(S.percentMode=!0),S.percentFormat&&(S.percentFormats=!0);const f=D.concat([],((k=p==null?void 0:p.uiSchema)==null?void 0:k["x-validator"])||[],r);o.validator=f,n["x-validator"]=r,g["x-validator"]=r,i.emit("patch",{schema:g}),c()}}},useVisible(){const{form:t}=e.useFormBlockContext(),o=e.useIsFormReadPretty(),n=e.useValidateSchema();return t&&!o&&n}}]}},{name:"componentOptions",type:"itemGroup",hideIfNoChildren:!0,useComponentProps(){const{t}=b.useTranslation();return{title:t("Specific properties")}},useChildren(){const t=e.useApp(),o=e.useFieldComponentName(),n=t.schemaSettingsManager.get(`fieldSettings:component:${o}`);return(n==null?void 0:n.items)||[]}},{name:"divider",type:"divider"},{name:"delete",type:"remove",sort:100,useComponentProps(){const{t}=b.useTranslation();return{removeParentsIfNoChildren:!0,confirm:{title:t("Delete field")},breakRemoveOn:{"x-component":"Grid"}}}}]}),Se=t=>{const o=d.useField(),n=d.useFieldSchema(),{uiSchema:i}=e.useCollectionField_deprecated(),c=e.useComponent(i==null?void 0:i["x-component"]),l=e.useCompile(),m=(p,h)=>{o[p]=typeof o[p]=="undefined"?h:o[p]},u=e.useFormBlockContext();return F.useEffect(()=>{u!=null&&u.field&&(u.field.added=u.field.added||new Set,u.field.added.add(n.name))}),F.useEffect(()=>{if(!i)return;m("content",i["x-content"]),m("description",i.description),m("initialValue",i.default),n["x-disabled"]===!0&&(o.disabled=!0),n["x-read-pretty"]===!0&&(o.readPretty=!0),o.required=!0,o.dataSource=i.enum;const p=l(i["x-component-props"])||{},h=v.merge(p,o.componentProps||{});o.componentProps=h},[JSON.stringify(i)]),i?F.createElement(c,t,t.children):null},ge=d.connect(t=>{const o=d.useFieldSchema();return s.jsx(e.CollectionFieldProvider,{name:o.name,children:s.jsx(Se,y({},t))})}),ke=t=>{const{t:o}=b.useTranslation(),n=d.useFieldSchema(),i=d.useField(),[c,l]=F.useState(2),[m,u]=F.useState(null),{getField:p}=e.useCollection_deprecated(),h=p(n.name)||{};F.useEffect(()=>{i.value=be({[c]:m}),i.required&&(i.value?(i.modify(),i.form.clearErrors(i.address)):i.modified&&i.form.validate(i.address))},[i,c,m]);const r=f=>{l(f),i.required=f===2},g=f=>{var k,S,I,B;u((B=(I=(k=f==null?void 0:f.target)==null?void 0:k.value)!=null?I:(S=f==null?void 0:f.target)==null?void 0:S.checked)!=null?B:f)};return s.jsxs(C.Space,{className:ae.css`
11
- display: flex;
12
- > .ant-space-item {
13
- width: 100%;
14
- }
15
- `,children:[s.jsxs(C.Select,{defaultValue:c,value:c,onChange:r,children:[s.jsx(C.Select.Option,{value:1,children:o("Remains the same")}),s.jsx(C.Select.Option,{value:2,children:o("Changed to")}),s.jsx(C.Select.Option,{value:3,children:o("Clear")})]}),[2,4].includes(c)&&(h==null?void 0:h.interface)!=="checkbox"&&s.jsx(ge,z(y({},t),{value:m,onChange:g,style:{minWidth:150}})),[2,4].includes(c)&&(h==null?void 0:h.interface)==="checkbox"&&s.jsx(C.Checkbox,{checked:m,onChange:g})]})};function be(t){if(3 in t)return null;if(2 in t)return t[2];if(1 in t)return}class J extends e.Plugin{load(){return w(this,null,function*(){this.app.addComponents({BulkEditField:ke}),this.app.addScopes({useCustomizeBulkEditActionProps:xe}),this.app.schemaSettingsManager.add(se),this.app.schemaSettingsManager.add(ce),this.app.schemaSettingsManager.add(Ce),this.app.schemaInitializerManager.add(W),this.app.schemaInitializerManager.add(fe),this.app.schemaInitializerManager.add(le),this.app.schemaInitializerManager.add($),this.app.schemaInitializerManager.add(me),this.app.schemaInitializerManager.add(U),this.app.schemaInitializerManager.add(ue);const o={type:"item",title:'{{t("Bulk edit")}}',name:"bulkEdit",Component:de,schema:{"x-align":"right","x-decorator":"ACLActionProvider","x-action":"customize:bulkEdit","x-toolbar":"ActionSchemaToolbar","x-settings":"actionSettings:bulkEdit","x-acl-action":"update","x-acl-action-props":{skipScopeCheck:!0}},useVisible(){const n=e.useCollection_deprecated();return(n.template!=="view"||(n==null?void 0:n.writableView))&&n.template!=="file"&&n.template!=="sql"}};this.app.schemaInitializerManager.addItem("table:configureActions","customize.bulkEdit",o),this.app.schemaInitializerManager.addItem("gantt:configureActions","customize.bulkEdit",o),this.app.schemaInitializerManager.addItem("map:configureActions","customize.bulkEdit",o)})}}a.PluginActionBulkEditClient=J,a.default=J,Object.defineProperties(a,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
@@ -1,12 +0,0 @@
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
- export declare const NAMESPACE = "action-bulk-edit";
10
- export declare function lang(key: string): string;
11
- export declare function generateNTemplate(key: string): string;
12
- export declare function useBulkEditTranslation(): import("react-i18next").UseTranslationResponse<"action-bulk-edit", undefined>;
@@ -1,13 +0,0 @@
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
- import { SchemaInitializerItemType } from '@nocobase/client';
10
- export declare const useCustomBulkEditFormItemInitializerFields: (options?: any) => SchemaInitializerItemType[];
11
- export declare const useCustomizeBulkEditActionProps: () => {
12
- onClick(): Promise<void>;
13
- };
@@ -1,26 +0,0 @@
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
- module.exports = {
11
- "@formily/react": "2.3.0",
12
- "@nocobase/client": "1.2.13-alpha",
13
- "antd": "5.12.8",
14
- "react": "18.2.0",
15
- "react-i18next": "11.18.6",
16
- "@ant-design/icons": "5.2.6",
17
- "@formily/antd-v5": "1.1.9",
18
- "@formily/core": "2.3.0",
19
- "lodash": "4.17.21",
20
- "@formily/shared": "2.3.0",
21
- "@nocobase/utils": "1.2.13-alpha",
22
- "react-router-dom": "6.21.0",
23
- "@nocobase/server": "1.2.13-alpha",
24
- "@nocobase/test": "1.2.13-alpha",
25
- "@emotion/css": "11.11.2"
26
- };
package/dist/index.d.ts DELETED
@@ -1,10 +0,0 @@
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
- export * from './server';
10
- export { default } from './server';
package/dist/index.js DELETED
@@ -1,48 +0,0 @@
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
- var __create = Object.create;
11
- var __defProp = Object.defineProperty;
12
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
13
- var __getOwnPropNames = Object.getOwnPropertyNames;
14
- var __getProtoOf = Object.getPrototypeOf;
15
- var __hasOwnProp = Object.prototype.hasOwnProperty;
16
- var __export = (target, all) => {
17
- for (var name in all)
18
- __defProp(target, name, { get: all[name], enumerable: true });
19
- };
20
- var __copyProps = (to, from, except, desc) => {
21
- if (from && typeof from === "object" || typeof from === "function") {
22
- for (let key of __getOwnPropNames(from))
23
- if (!__hasOwnProp.call(to, key) && key !== except)
24
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
25
- }
26
- return to;
27
- };
28
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
29
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
30
- // If the importer is in node compatibility mode or this is not an ESM
31
- // file that has been converted to a CommonJS file using a Babel-
32
- // compatible transform (i.e. "__esModule" has not been set), then set
33
- // "default" to the CommonJS "module.exports" for node compatibility.
34
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
35
- mod
36
- ));
37
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
38
- var src_exports = {};
39
- __export(src_exports, {
40
- default: () => import_server.default
41
- });
42
- module.exports = __toCommonJS(src_exports);
43
- __reExport(src_exports, require("./server"), module.exports);
44
- var import_server = __toESM(require("./server"));
45
- // Annotate the CommonJS export names for ESM import in node:
46
- 0 && (module.exports = {
47
- ...require("./server")
48
- });
@@ -1,4 +0,0 @@
1
- {
2
- "Bulk edit": "Bulk edit",
3
- "Data will be updated": "Data will be updated"
4
- }
@@ -1,4 +0,0 @@
1
- {
2
- "Bulk edit": "Edición en masa",
3
- "Data will be updated": "Se actualizarán los datos"
4
- }
@@ -1,4 +0,0 @@
1
- {
2
- "Bulk edit": "대량 편집",
3
- "Data will be updated": "데이터가 업데이트됩니다"
4
- }
@@ -1,4 +0,0 @@
1
- {
2
- "Bulk edit": "Edição em massa",
3
- "Data will be updated": "Os dados serão atualizados"
4
- }
@@ -1,4 +0,0 @@
1
- {
2
- "Bulk edit": "批量编辑",
3
- "Data will be updated": "更新的数据"
4
- }
@@ -1,9 +0,0 @@
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
- export { default } from './plugin';
@@ -1,42 +0,0 @@
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
- var __create = Object.create;
11
- var __defProp = Object.defineProperty;
12
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
13
- var __getOwnPropNames = Object.getOwnPropertyNames;
14
- var __getProtoOf = Object.getPrototypeOf;
15
- var __hasOwnProp = Object.prototype.hasOwnProperty;
16
- var __export = (target, all) => {
17
- for (var name in all)
18
- __defProp(target, name, { get: all[name], enumerable: true });
19
- };
20
- var __copyProps = (to, from, except, desc) => {
21
- if (from && typeof from === "object" || typeof from === "function") {
22
- for (let key of __getOwnPropNames(from))
23
- if (!__hasOwnProp.call(to, key) && key !== except)
24
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
25
- }
26
- return to;
27
- };
28
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
29
- // If the importer is in node compatibility mode or this is not an ESM
30
- // file that has been converted to a CommonJS file using a Babel-
31
- // compatible transform (i.e. "__esModule" has not been set), then set
32
- // "default" to the CommonJS "module.exports" for node compatibility.
33
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
34
- mod
35
- ));
36
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
37
- var server_exports = {};
38
- __export(server_exports, {
39
- default: () => import_plugin.default
40
- });
41
- module.exports = __toCommonJS(server_exports);
42
- var import_plugin = __toESM(require("./plugin"));
@@ -1,12 +0,0 @@
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
- import { Plugin } from '@nocobase/server';
10
- export declare class PluginActionBulkEditServer extends Plugin {
11
- }
12
- export default PluginActionBulkEditServer;
@@ -1,40 +0,0 @@
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
- var __defProp = Object.defineProperty;
11
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
- var __getOwnPropNames = Object.getOwnPropertyNames;
13
- var __hasOwnProp = Object.prototype.hasOwnProperty;
14
- var __export = (target, all) => {
15
- for (var name in all)
16
- __defProp(target, name, { get: all[name], enumerable: true });
17
- };
18
- var __copyProps = (to, from, except, desc) => {
19
- if (from && typeof from === "object" || typeof from === "function") {
20
- for (let key of __getOwnPropNames(from))
21
- if (!__hasOwnProp.call(to, key) && key !== except)
22
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23
- }
24
- return to;
25
- };
26
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
- var plugin_exports = {};
28
- __export(plugin_exports, {
29
- PluginActionBulkEditServer: () => PluginActionBulkEditServer,
30
- default: () => plugin_default
31
- });
32
- module.exports = __toCommonJS(plugin_exports);
33
- var import_server = require("@nocobase/server");
34
- class PluginActionBulkEditServer extends import_server.Plugin {
35
- }
36
- var plugin_default = PluginActionBulkEditServer;
37
- // Annotate the CommonJS export names for ESM import in node:
38
- 0 && (module.exports = {
39
- PluginActionBulkEditServer
40
- });