/**
 * This file is part of the NocoBase (R) project.
 * Copyright (c) 2020-2024 NocoBase Co., Ltd.
 * Authors: NocoBase Team.
 *
 * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
 * For more information, please refer to: https://www.nocobase.com/agreement.
 */

"use strict";(self.webpackChunk_nocobase_plugin_workflow=self.webpackChunk_nocobase_plugin_workflow||[]).push([["635"],{8950:function(e,l,n){n.d(l,{UpdateFieldset:function(){return g},UpdatePresetFieldset:function(){return p}});var t=n(9155),o=n.n(t),a=n(2059),i=n(2235),r=n(8198),s=n(9785),c=n(9488),u=n(5329),d=n(6855),m=function(e){return!(0,r.Cg)(e)||"belongsTo"===e.type};function f(){var e,l=(0,c.kj)(),n=a.Form.useFormInstance(),i=a.Form.useWatch(["config","collection"]),u=a.Form.useWatch(["config","params","individualHooks"],n),f=[{label:(e=(0,c.kj)())("Update in a batch"),value:!1,tooltip:e("Update all eligible data at one time, which has better performance when the amount of data is large. But association fields are not supported (unless foreign key in current collection), and the updated data will not trigger other workflows.")},{label:e("Update one by one"),value:!0,tooltip:e("The updated data can trigger other workflows, and the audit log will also be recorded. But it is usually only applicable to several or dozens of pieces of data, otherwise there will be performance problems.")}],g=!0!==u;return((0,t.useEffect)(function(){i&&(n.setFieldValue(["config","usingAssignFormSchema"],void 0),n.setFieldValue(["config","assignFormSchema"],void 0),void 0===n.getFieldValue(["config","params","individualHooks"])&&n.setFieldValue(["config","params","individualHooks"],!1))},[i,n]),i)?o().createElement(o().Fragment,null,o().createElement(a.Form.Item,{name:["config","params","individualHooks"],label:l("Update mode")},o().createElement(s.$,{options:f})),o().createElement(d.F,{collection:i,label:l("Only update records matching conditions")}),o().createElement(a.Form.Item,{name:["config","params","values"],label:l("Fields values")},o().createElement(r.XH,{collection:i,fieldFilter:g?m:void 0,pruneFilteredValues:g}))):null}function g(){var e,l=(0,i.TA)(),n=a.Form.useFormInstance();return o().createElement(o().Fragment,null,o().createElement(u.F,{disabled:!!(null==l||null==(e=l.config)?void 0:e.collection),onCollectionChanged:function(){n.setFieldValue(["config","params","filter"],{}),n.setFieldValue(["config","params","values"],{}),n.setFieldValue(["config","usingAssignFormSchema"],void 0),n.setFieldValue(["config","assignFormSchema"],void 0)}}),o().createElement(f,null))}function p(){return o().createElement(u.F,null)}}}]);