@nocobase/plugin-action-bulk-update 1.3.15-beta → 1.3.17-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/client/index.js
CHANGED
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
(function(s,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("@nocobase/client"),require("react/jsx-runtime"),require("@formily/react"),require("@formily/shared"),require("react-i18next"),require("@nocobase/utils/client"),require("antd"),require("react")):typeof define=="function"&&define.amd?define(["exports","@nocobase/client","react/jsx-runtime","@formily/react","@formily/shared","react-i18next","@nocobase/utils/client","antd","react"],e):(s=typeof globalThis!="undefined"?globalThis:s||self,e(s["@nocobase/plugin-action-bulk-update"]={},s["@nocobase/client"],s.jsxRuntime,s["@formily/react"],s["@formily/shared"],s["react-i18next"],s["@nocobase/utils"],s.antd,s.react))})(this,function(s,e,
|
|
10
|
+
(function(s,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("@nocobase/client"),require("react/jsx-runtime"),require("@formily/react"),require("@formily/shared"),require("react-i18next"),require("@nocobase/utils/client"),require("antd"),require("react")):typeof define=="function"&&define.amd?define(["exports","@nocobase/client","react/jsx-runtime","@formily/react","@formily/shared","react-i18next","@nocobase/utils/client","antd","react"],e):(s=typeof globalThis!="undefined"?globalThis:s||self,e(s["@nocobase/plugin-action-bulk-update"]={},s["@nocobase/client"],s.jsxRuntime,s["@formily/react"],s["@formily/shared"],s["react-i18next"],s["@nocobase/utils"],s.antd,s.react))})(this,function(s,e,a,c,A,h,k,l,u){"use strict";var ae=Object.defineProperty,ne=Object.defineProperties;var re=Object.getOwnPropertyDescriptors;var _=Object.getOwnPropertySymbols;var ce=Object.prototype.hasOwnProperty,ue=Object.prototype.propertyIsEnumerable;var H=(s,e,a)=>e in s?ae(s,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):s[e]=a,v=(s,e)=>{for(var a in e||(e={}))ce.call(e,a)&&H(s,a,e[a]);if(_)for(var a of _(e))ue.call(e,a)&&H(s,a,e[a]);return s},P=(s,e)=>ne(s,re(e));var m=(s,e,a)=>new Promise((c,A)=>{var h=u=>{try{l(a.next(u))}catch(x){A(x)}},k=u=>{try{l(a.throw(u))}catch(x){A(x)}},l=u=>u.done?c(u.value):Promise.resolve(u.value).then(h,k);l((a=a.apply(s,e)).next())});function x(){var d;const{dn:i}=e.useDesignable(),{t:o}=h.useTranslation(),n=c.useFieldSchema();return a.jsx(e.SchemaSettingsSelectItem,{title:o("Data will be updated"),options:[{label:o("Selected"),value:"selected"},{label:o("Entire collection",{ns:"action-bulk-edit"}),value:"all"}],value:(d=n==null?void 0:n["x-action-settings"])==null?void 0:d.updateMode,onChange:p=>{n["x-action-settings"].updateMode=p,i.emit("patch",{schema:{"x-uid":n["x-uid"],"x-action-settings":n["x-action-settings"]}}),i.refresh()}})}function J(){var d;const{dn:i}=e.useDesignable(),{t:o}=h.useTranslation(),n=c.useFieldSchema();return a.jsx(e.SchemaSettingsModalItem,{title:o("After successful submission"),initialValues:(d=n==null?void 0:n["x-action-settings"])==null?void 0:d.onSuccess,schema:{type:"object",title:o("After successful submission"),properties:{successMessage:{title:o("Popup message"),"x-decorator":"FormItem","x-component":"Input.TextArea","x-component-props":{}},manualClose:{title:o("Popup close method"),enum:[{label:o("Automatic close"),value:!1},{label:o("Manually close"),value:!0}],"x-decorator":"FormItem","x-component":"Radio.Group","x-component-props":{}},redirecting:{title:o("Then"),enum:[{label:o("Stay on current page"),value:!1},{label:o("Redirect to"),value:!0}],"x-decorator":"FormItem","x-component":"Radio.Group","x-component-props":{},"x-reactions":{target:"redirectTo",fulfill:{state:{visible:"{{!!$self.value}}"}}}},redirectTo:{title:o("Link"),"x-decorator":"FormItem","x-component":"Input","x-component-props":{}}}},onSubmit:p=>{n["x-action-settings"].onSuccess=p,i.emit("patch",{schema:{"x-uid":n["x-uid"],"x-action-settings":n["x-action-settings"]}})}})}const V=[{name:"editButton",Component:e.ActionDesigner.ButtonEditor,useComponentProps(){const{buttonEditorProps:i}=e.useSchemaToolbar();return i}},{name:"updateMode",Component:x,useVisible(){const i=c.useFieldSchema();return["customize:bulkUpdate","customize:bulkEdit"].includes(i["x-action"])}},{name:"assignFieldValues",Component:e.AssignedFieldValues},{name:"afterSuccess",Component:J,useVisible(){var o;const i=c.useFieldSchema();return A.isValid((o=i==null?void 0:i["x-action-settings"])==null?void 0:o.onSuccess)}},{name:"refreshDataBlockRequest",Component:e.RefreshDataBlockRequest,useComponentProps(){return{isPopupAction:!1}}},{name:"remove",sort:100,Component:e.ActionDesigner.RemoveButton,useComponentProps(){const{removeButtonProps:i}=e.useSchemaToolbar();return i}}],Q=new e.SchemaSettings({name:"ActionSettings:customize:bulkUpdate",items:V}),W=new e.SchemaSettings({name:"actionSettings:bulkUpdate",items:V}),X=()=>{const i=e.useSchemaInitializerItem(),o={type:"void",title:'{{ t("Bulk update") }}',"x-component":"Action","x-use-component-props":"useCustomizeBulkUpdateActionProps","x-align":"right","x-acl-action":"update","x-decorator":"ACLActionProvider","x-acl-action-props":{skipScopeCheck:!0},"x-action":"customize:bulkUpdate","x-toolbar":"ActionSchemaToolbar","x-settings":"actionSettings:bulkUpdate","x-action-settings":{assignedValues:{},updateMode:"selected",onSuccess:{manualClose:!0,redirecting:!1,successMessage:'{{t("Updated successfully")}}'}},"x-component-props":{icon:"EditOutlined"}};return a.jsx(e.BlockInitializer,P(v({},i),{schema:o,item:i}))},Y=()=>{const i=e.useSchemaInitializerItem();return a.jsx(e.BlockInitializer,P(v({},i),{item:i}))},Z="action-bulk-update";function ee(){return h.useTranslation(Z,{nsMode:"fallback"})}const F=()=>{const{field:i,resource:o,__parent:n,service:d}=e.useBlockRequestContext(),p=u.useContext(c.SchemaExpressionScopeContext),y=c.useFieldSchema(),w=e.useTableBlockContext(),{rowKey:te}=w,q=e.useNavigateNoUpdate(),R=e.useCompile(),{t:U}=ee(),b=c.useField(),{modal:D}=l.App.useApp(),I=e.useVariables(),{name:le,getField:se}=e.useCollection_deprecated(),oe=e.useLocalVariables();return{onClick(de,M){return m(this,null,function*(){var L,O,N,G,K;const{assignedValues:j={},onSuccess:t,updateMode:E}=(L=y==null?void 0:y["x-action-settings"])!=null?L:{};b.data=i.data||{},b.data.loading=!0;const S=(K=(G=(N=(O=w.field)==null?void 0:O.data)==null?void 0:N.selectedRowKeys)!=null?G:p==null?void 0:p.selectedRecordKeys)!=null?K:{},z={},ie=Object.keys(j).map(f=>m(this,null,function*(){const r=j[f],T=se(f);if(e.isVariable(r)){const C=yield I==null?void 0:I.parseVariable(r,oe).then(({value:g})=>g);C&&(z[f]=e.transformVariableValue(C,{targetCollectionField:T}))}else r!=null&&r!==""&&(z[f]=r)}));yield Promise.all(ie),D.confirm({title:U("Bulk update",{ns:"client"}),content:E==="selected"?U("Update selected data?",{ns:"client"}):U("Update all data?",{ns:"client"}),onOk(){return m(this,null,function*(){var T,C,g,$;const{filter:f}=(C=(T=d.params)==null?void 0:T[0])!=null?C:{},r={values:v({},z),filter:f,forceUpdate:!1};if(E==="selected"){if(!(S!=null&&S.length)){l.message.error(U("Please select the records to be updated")),b.data.loading=!1;return}r.filter={$and:[{[te||"id"]:{$in:S}}]}}r.filter||(r.forceUpdate=!0);try{yield o.update(r)}catch(pe){}finally{b.data.loading=!1}M&&(M==null||M()),o instanceof e.TableFieldResource||($=(g=n==null?void 0:n.service)==null?void 0:g.refresh)==null||$.call(g),t!=null&&t.successMessage&&(t!=null&&t.manualClose?D.success({title:R(t==null?void 0:t.successMessage),onOk:()=>m(this,null,function*(){t!=null&&t.redirecting&&(t!=null&&t.redirectTo)&&(k.isURL(t.redirectTo)?window.location.href=t.redirectTo:q(t.redirectTo))})}):(l.message.success(R(t==null?void 0:t.successMessage)),t!=null&&t.redirecting&&(t!=null&&t.redirectTo)&&(k.isURL(t.redirectTo)?window.location.href=t.redirectTo:q(t.redirectTo))))})},onCancel(){return m(this,null,function*(){b.data.loading=!1})}})})}}};class B extends e.Plugin{load(){return m(this,null,function*(){this.app.addComponents({CustomizeActionInitializer:Y}),this.app.addScopes({useCustomizeBulkUpdateActionProps:F}),this.app.addScopes({useCustomizeBulkUpdateActionProps:F}),this.app.schemaSettingsManager.add(Q),this.app.schemaSettingsManager.add(W);const o={title:'{{t("Bulk update")}}',Component:X,name:"bulkUpdate",useVisible:()=>e.useActionAvailable("updateMany")};this.app.schemaInitializerManager.addItem("table:configureActions","customize.bulkUpdate",o),this.app.schemaInitializerManager.addItem("gantt:configureActions","customize.bulkUpdate",o),this.app.schemaInitializerManager.addItem("map:configureActions","customize.bulkUpdate",o)})}}s.PluginActionBulkUpdateClient=B,s.default=B,Object.defineProperties(s,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/dist/externalVersion.js
CHANGED
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
module.exports = {
|
|
11
11
|
"@formily/react": "2.3.0",
|
|
12
12
|
"@formily/shared": "2.3.0",
|
|
13
|
-
"@nocobase/client": "1.3.
|
|
13
|
+
"@nocobase/client": "1.3.17-beta",
|
|
14
14
|
"react-i18next": "11.18.6",
|
|
15
15
|
"react": "18.2.0",
|
|
16
|
-
"@nocobase/utils": "1.3.
|
|
16
|
+
"@nocobase/utils": "1.3.17-beta",
|
|
17
17
|
"antd": "5.12.8",
|
|
18
|
-
"@nocobase/server": "1.3.
|
|
19
|
-
"@nocobase/test": "1.3.
|
|
18
|
+
"@nocobase/server": "1.3.17-beta",
|
|
19
|
+
"@nocobase/test": "1.3.17-beta"
|
|
20
20
|
};
|
package/dist/locale/zh-CN.d.ts
CHANGED
package/dist/locale/zh-CN.js
CHANGED
|
@@ -32,5 +32,6 @@ module.exports = __toCommonJS(zh_CN_exports);
|
|
|
32
32
|
var zh_CN_default = {
|
|
33
33
|
"Bulk update": "\u6279\u91CF\u66F4\u65B0",
|
|
34
34
|
"After successful bulk update": "\u6279\u91CF\u6210\u529F\u66F4\u65B0\u540E",
|
|
35
|
-
"Please select the records to be updated": "\u8BF7\u9009\u62E9\u8981\u66F4\u65B0\u7684\u8BB0\u5F55"
|
|
35
|
+
"Please select the records to be updated": "\u8BF7\u9009\u62E9\u8981\u66F4\u65B0\u7684\u8BB0\u5F55",
|
|
36
|
+
"Entire collection": "\u5168\u8868"
|
|
36
37
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/plugin-action-bulk-update",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.17-beta",
|
|
4
4
|
"main": "dist/server/index.js",
|
|
5
5
|
"homepage": "https://docs.nocobase.com/handbook/action-bulk-update",
|
|
6
6
|
"homepage.zh-CN": "https://docs-cn.nocobase.com/handbook/action-bulk-update",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"@nocobase/server": "1.x",
|
|
15
15
|
"@nocobase/test": "1.x"
|
|
16
16
|
},
|
|
17
|
-
"gitHead": "
|
|
17
|
+
"gitHead": "9c2f4d3b7b8d920f75a6c1514de047f36ec66ecc",
|
|
18
18
|
"keywords": [
|
|
19
19
|
"Actions"
|
|
20
20
|
]
|