@nocobase/plugin-action-bulk-edit 1.0.0-alpha.2 → 1.0.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/BulkEditAction.Settings.d.ts +8 -0
- package/dist/client/BulkEditActionInitializer.d.ts +8 -0
- package/dist/client/BulkEditBlockInitializers.d.ts +8 -0
- package/dist/client/BulkEditFormActionInitializers.d.ts +8 -0
- package/dist/client/BulkEditFormItemInitializers.d.ts +8 -0
- package/dist/client/BulkEditSubmitActionInitializer.d.ts +8 -0
- package/dist/client/CreateFormBulkEditBlockInitializer.d.ts +8 -0
- package/dist/client/bulkEditFormItemSettings.d.ts +8 -0
- package/dist/client/component/BulkEditField.d.ts +8 -0
- package/dist/client/createBulkEditBlockUISchema.d.ts +8 -0
- package/dist/client/index.d.ts +8 -0
- package/dist/client/index.js +9 -0
- package/dist/client/locale/index.d.ts +8 -0
- package/dist/client/utils.d.ts +8 -0
- package/dist/externalVersion.js +13 -4
- package/dist/index.d.ts +8 -0
- package/dist/index.js +9 -0
- package/dist/server/index.d.ts +8 -0
- package/dist/server/index.js +9 -0
- package/dist/server/plugin.d.ts +8 -0
- package/dist/server/plugin.js +9 -0
- package/package.json +2 -2
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
1
9
|
import { SchemaSettings } from '@nocobase/client';
|
|
2
10
|
/**
|
|
3
11
|
* @deprecated
|
|
@@ -1,2 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
1
9
|
import React from 'react';
|
|
2
10
|
export declare const BulkEditActionInitializer: () => React.JSX.Element;
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
1
9
|
import { CompatibleSchemaInitializer, SchemaInitializer } from '@nocobase/client';
|
|
2
10
|
/**
|
|
3
11
|
* @deprecated
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
1
9
|
import { CompatibleSchemaInitializer } from '@nocobase/client';
|
|
2
10
|
/**
|
|
3
11
|
* @deprecated
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
1
9
|
import { CompatibleSchemaInitializer } from '@nocobase/client';
|
|
2
10
|
/**
|
|
3
11
|
* @deprecated
|
|
@@ -1,2 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
1
9
|
import React from 'react';
|
|
2
10
|
export declare const BulkEditSubmitActionInitializer: (props: any) => React.JSX.Element;
|
|
@@ -1,2 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
1
9
|
import React from 'react';
|
|
2
10
|
export declare const CreateFormBulkEditBlockInitializer: () => React.JSX.Element;
|
|
@@ -1,2 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
1
9
|
import { SchemaSettings } from '@nocobase/client';
|
|
2
10
|
export declare const bulkEditFormItemSettings: SchemaSettings<{}>;
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
1
9
|
import React from 'react';
|
|
2
10
|
export declare const DeletedField: () => React.JSX.Element;
|
|
3
11
|
export declare enum BulkEditFormItemValueType {
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
1
9
|
import { ISchema } from '@formily/react';
|
|
2
10
|
/**
|
|
3
11
|
* 创建批量编辑表单的 UI Schema
|
package/dist/client/index.d.ts
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
1
9
|
import { Plugin } from '@nocobase/client';
|
|
2
10
|
export declare class PluginActionBulkEditClient extends Plugin {
|
|
3
11
|
load(): Promise<void>;
|
package/dist/client/index.js
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
1
10
|
(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,D,v,w,f,y,ne,G,O,re){"use strict";var Fe=Object.defineProperty,Ie=Object.defineProperties;var ze=Object.getOwnPropertyDescriptors;var P=Object.getOwnPropertySymbols;var te=Object.prototype.hasOwnProperty,oe=Object.prototype.propertyIsEnumerable;var ee=(a,e,s)=>e in a?Fe(a,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):a[e]=s,I=(a,e)=>{for(var s in e||(e={}))te.call(e,s)&&ee(a,s,e[s]);if(P)for(var s of P(e))oe.call(e,s)&&ee(a,s,e[s]);return a},z=(a,e)=>Ie(a,ze(e));var ie=(a,e)=>{var s={};for(var d in a)te.call(a,d)&&e.indexOf(d)<0&&(s[d]=a[d]);if(a!=null&&P)for(var d of P(a))e.indexOf(d)<0&&oe.call(a,d)&&(s[d]=a[d]);return s};var A=(a,e,s)=>new Promise((d,b)=>{var D=f=>{try{w(s.next(f))}catch(y){b(y)}},v=f=>{try{w(s.throw(f))}catch(y){b(y)}},w=f=>f.done?d(f.value):Promise.resolve(f.value).then(D,v);w((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 ae=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}}]}),se=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}}]}),ce=()=>{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(I({},o),{schema:t,item:o}))};function de(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 q=()=>{const h=e.useSchemaInitializerItem(),{onCreateBlockSchema:o,componentType:n,createBlockSchema:i}=h,c=ie(h,["onCreateBlockSchema","componentType","createBlockSchema"]),{insert:p}=e.useSchemaInitializer(),{getTemplateSchemaByMode:m}=e.useSchemaTemplateManager(),u=e.useAssociationName(),l=e.useCollection_deprecated();return s.jsx(e.SchemaInitializerItem,z(I({icon:s.jsx(D.FormOutlined,{})},c),{onClick:k=>A(this,[k],function*({item:r}){if(r.template){const C=yield m(r);if(r.template.componentName==="FormItem"){const S=e.createCreateFormBlockUISchema(u?{association:u,dataSource:l.dataSource,templateSchema:C}:{collectionName:l.name,dataSource:l.dataSource,templateSchema:C});r.mode==="reference"&&(S["x-template-key"]=r.template.key),p(S)}else p(C)}else p(de({association:u,collectionName:l.name,dataSource:l.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:q}]},{type:"itemGroup",title:'{{t("Other blocks")}}',name:"otherBlocks",children:[{name:"markdown",title:'{{t("Markdown")}}',Component:"MarkdownBlockInitializer"}]}]}),_=new e.CompatibleSchemaInitializer({name:"BulkEditBlockInitializers",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:q}]},{type:"itemGroup",title:'{{t("Other blocks")}}',name:"otherBlocks",children:[{name:"markdown",title:'{{t("Markdown")}}',Component:"MarkdownBlockInitializer"}]}]}),pe=new e.CompatibleSchemaInitializer({name:"popup:bulkEdit:addBlock",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:q}]},{type:"itemGroup",title:'{{t("Other blocks")}}',name:"otherBlocks",children:[{name:"markdown",title:'{{t("Markdown")}}',Component:"MarkdownBlockInitializer"}]}]},_),j=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.ActionInitializer,z(I({},t),{schema:o}))},$=new e.CompatibleSchemaInitializer({name:"BulkEditFormActionInitializers",title:'{{t("Configure actions")}}',icon:"SettingOutlined",items:[{type:"itemGroup",title:'{{t("Enable actions")}}',name:"enableActions",children:[{name:"submit",title:'{{t("Submit")}}',Component:j,schema:{"x-action-settings":{}}}]}]}),me=new e.CompatibleSchemaInitializer({name:"bulkEditForm:configureActions",title:'{{t("Configure actions")}}',icon:"SettingOutlined",items:[{type:"itemGroup",title:'{{t("Enable actions")}}',name:"enableActions",children:[{name:"submit",title:'{{t("Submit")}}',Component:j,schema:{"x-action-settings":{}}}]}]},$),U=t=>{const{name:o,fields:n}=e.useCollection_deprecated(),{getInterface:i,getCollection:c}=e.useCollectionManager_deprecated(),p=d.useForm(),{readPretty:m=p.readPretty,block:u="Form"}=t||{},l=e.useRemoveGridFormItem();return y.useMemo(()=>n==null?void 0:n.filter(r=>{var k;return(r==null?void 0:r.interface)&&!((k=r==null?void 0:r.uiSchema)!=null&&k["x-read-pretty"])&&r.interface!=="snapshot"&&r.type!=="sequence"}).map(r=>{var S,g,F;const k=i(r.interface),C={type:"string",name:r.name,title:((S=r==null?void 0:r.uiSchema)==null?void 0:S.title)||r.name,"x-toolbar":"FormItemSchemaToolbar","x-settings":"fieldSettings:BulkEditFormItem","x-component":"BulkEditField","x-decorator":"FormItem","x-collection-field":`${o}.${r.name}`};return{name:((g=r==null?void 0:r.uiSchema)==null?void 0:g.title)||r.name,type:"item",title:((F=r==null?void 0:r.uiSchema)==null?void 0:F.title)||r.name,Component:"CollectionFieldInitializer",remove:l,schemaInitialize:B=>{var E;(E=k==null?void 0:k.schemaInitialize)==null||E.call(k,B,{field:r,block:u,readPretty:m,targetCollection:c(r.target)})},schema:C}}),[n])},ue=()=>{var E,J,H,K;const t=d.useForm(),{t:o}=b.useTranslation(),{field:n,resource:i,__parent:c}=e.useBlockRequestContext(),p=y.useContext(d.SchemaExpressionScopeContext),m=e.useActionContext(),u=ne.useNavigate(),l=e.useCompile(),h=d.useField(),r=e.useTableBlockContext(),{modal:k}=f.App.useApp(),{rowKey:C}=r,S=(K=(H=(J=(E=r.field)==null?void 0:E.data)==null?void 0:J.selectedRowKeys)!=null?H:p==null?void 0:p.selectedRecordKeys)!=null?K:{},{setVisible:g,fieldSchema:F,setSubmitted:B}=m;return{onClick(){return A(this,null,function*(){var Q,X,Y,Z,T,R;const{onSuccess:x,skipValidator:Se,updateMode:be}=(Q=F==null?void 0:F["x-action-settings"])!=null?Q:{},{filter:ye}=(Y=(X=c.service.params)==null?void 0:X[0])!=null?Y:{};Se||(yield t.submit()),h.data=n.data||{},h.data.loading=!0;try{const M={values:t.values,filter:ye,forceUpdate:!1};if(be==="selected"){if(!(S!=null&&S.length)){f.message.error(o("Please select the records to be updated"));return}M.filter={$and:[{[C||"id"]:{$in:S}}]}}if(M.filter||(M.forceUpdate=!0),yield i.update(M),h.data.loading=!1,i instanceof e.TableFieldResource||(R=(T=(Z=c==null?void 0:c.__parent)==null?void 0:Z.service)==null?void 0:T.refresh)==null||R.call(T),g==null||g(!1),B(!0),!(x!=null&&x.successMessage))return;x!=null&&x.manualClose?k.success({title:l(x==null?void 0:x.successMessage),onOk:()=>A(this,null,function*(){yield t.reset(),x!=null&&x.redirecting&&(x!=null&&x.redirectTo)&&(w.isURL(x.redirectTo)?window.location.href=x.redirectTo:u(x.redirectTo))})}):f.message.success(l(x==null?void 0:x.successMessage))}finally{h.data.loading=!1}})}}},W=new e.CompatibleSchemaInitializer({name:"BulkEditFormItemInitializers",wrap:e.gridRowColWrap,icon:"SettingOutlined",title:'{{t("Configure fields")}}',items:[{name:"displayFields",type:"itemGroup",title:'{{t("Display fields")}}',useChildren:U},{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**.")}}'}}}]}),he=new e.CompatibleSchemaInitializer({name:"bulkEditForm:configureFields",wrap:e.gridRowColWrap,icon:"SettingOutlined",title:'{{t("Configure fields")}}',items:[{name:"displayFields",type:"itemGroup",title:'{{t("Display fields")}}',useChildren:U},{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),xe=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:p}=e.useCollection_deprecated(),m=c(i["x-collection-field"],p);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:l}){l&&(n.title=l,i.title=l,o.emit("patch",{schema:{"x-uid":i["x-uid"],title:i.title}})),o.refresh()}}}},{name:"displayTitle",type:"switch",useComponentProps(){var c,p;const{t}=b.useTranslation(),{dn:o}=e.useDesignable(),n=d.useField(),i=d.useFieldSchema();return{title:t("Display title"),checked:(p=(c=i["x-decorator-props"])==null?void 0:c.showTitle)!=null?p:!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(I({},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:p}){n.decoratorProps.tooltip=p,i["x-decorator-props"]=i["x-decorator-props"]||{},i["x-decorator-props"].tooltip=p,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(),p=e.useValidateSchema(),{getCollectionJoinField:m}=e.useCollectionManager_deprecated(),{dataSource:u}=e.useCollection_deprecated(),l=m(n["x-collection-field"],u);return{title:t("Set validation rules"),components:{ArrayCollapse:G.ArrayCollapse,FormLayout:G.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(I({},p),{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 S;const r=[];for(const g of h.rules)r.push(O.pickBy(g,O.identity));const k={"x-uid":n["x-uid"]};if(["percent"].includes(l==null?void 0:l.interface))for(const g of r)(g.maxValue||g.minValue)&&(g.percentMode=!0),g.percentFormat&&(g.percentFormats=!0);const C=O.concat([],((S=l==null?void 0:l.uiSchema)==null?void 0:S["x-validator"])||[],r);o.validator=C,n["x-validator"]=r,k["x-validator"]=r,i.emit("patch",{schema:k}),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"}}}}]}),Ce=t=>{const o=d.useField(),n=d.useFieldSchema(),{uiSchema:i}=e.useCollectionField_deprecated(),c=e.useComponent(i==null?void 0:i["x-component"]),p=e.useCompile(),m=(l,h)=>{o[l]=typeof o[l]=="undefined"?h:o[l]},u=e.useFormBlockContext();return y.useEffect(()=>{u!=null&&u.field&&(u.field.added=u.field.added||new Set,u.field.added.add(n.name))}),y.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 l=p(i["x-component-props"])||{},h=v.merge(l,o.componentProps||{});o.componentProps=h},[JSON.stringify(i)]),i?y.createElement(c,t,t.children):null},fe=d.connect(t=>{const o=d.useFieldSchema();return s.jsx(e.CollectionFieldProvider,{name:o.name,children:s.jsx(Ce,I({},t))})}),ge=t=>{const{t:o}=b.useTranslation(),n=d.useFieldSchema(),i=d.useField(),[c,p]=y.useState(2),[m,u]=y.useState(null),{getField:l}=e.useCollection_deprecated(),h=l(n.name)||{};y.useEffect(()=>{i.value=ke({[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=C=>{p(C),i.required=C===2},k=C=>{var S,g,F,B;u((B=(F=(S=C==null?void 0:C.target)==null?void 0:S.value)!=null?F:(g=C==null?void 0:C.target)==null?void 0:g.checked)!=null?B:C)};return s.jsxs(f.Space,{className:re.css`
|
|
2
11
|
display: flex;
|
|
3
12
|
> .ant-space-item {
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
1
9
|
export declare const NAMESPACE = "@nocobase/plugin-bulk-edit";
|
|
2
10
|
export declare function lang(key: string): string;
|
|
3
11
|
export declare function generateNTemplate(key: string): string;
|
package/dist/client/utils.d.ts
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
1
9
|
import { SchemaInitializerItemType } from '@nocobase/client';
|
|
2
10
|
export declare const useCustomBulkEditFormItemInitializerFields: (options?: any) => SchemaInitializerItemType[];
|
|
3
11
|
export declare const useCustomizeBulkEditActionProps: () => {
|
package/dist/externalVersion.js
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
1
10
|
module.exports = {
|
|
2
11
|
"@formily/react": "2.3.0",
|
|
3
|
-
"@nocobase/client": "1.0.0-alpha.
|
|
12
|
+
"@nocobase/client": "1.0.0-alpha.4",
|
|
4
13
|
"antd": "5.12.8",
|
|
5
14
|
"react": "18.2.0",
|
|
6
15
|
"react-i18next": "11.18.6",
|
|
@@ -9,9 +18,9 @@ module.exports = {
|
|
|
9
18
|
"@formily/core": "2.3.0",
|
|
10
19
|
"lodash": "4.17.21",
|
|
11
20
|
"@formily/shared": "2.3.0",
|
|
12
|
-
"@nocobase/utils": "1.0.0-alpha.
|
|
21
|
+
"@nocobase/utils": "1.0.0-alpha.4",
|
|
13
22
|
"react-router-dom": "6.21.0",
|
|
14
|
-
"@nocobase/server": "1.0.0-alpha.
|
|
15
|
-
"@nocobase/test": "1.0.0-alpha.
|
|
23
|
+
"@nocobase/server": "1.0.0-alpha.4",
|
|
24
|
+
"@nocobase/test": "1.0.0-alpha.4",
|
|
16
25
|
"@emotion/css": "11.11.2"
|
|
17
26
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
1
9
|
export * from './server';
|
|
2
10
|
export { default } from './server';
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
1
10
|
var __create = Object.create;
|
|
2
11
|
var __defProp = Object.defineProperty;
|
|
3
12
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
package/dist/server/index.d.ts
CHANGED
|
@@ -1 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
1
9
|
export { default } from './plugin';
|
package/dist/server/index.js
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
1
10
|
var __create = Object.create;
|
|
2
11
|
var __defProp = Object.defineProperty;
|
|
3
12
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
package/dist/server/plugin.d.ts
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
1
9
|
import { Plugin } from '@nocobase/server';
|
|
2
10
|
export declare class PluginActionBulkEditServer extends Plugin {
|
|
3
11
|
}
|
package/dist/server/plugin.js
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
1
10
|
var __defProp = Object.defineProperty;
|
|
2
11
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
12
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/plugin-action-bulk-edit",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.4",
|
|
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": "
|
|
17
|
+
"gitHead": "7a7005ce3bddf33498580a6486c45b5d9ea64ffb",
|
|
18
18
|
"keywords": [
|
|
19
19
|
"Actions"
|
|
20
20
|
]
|