@nocobase/plugin-flow-engine 2.1.0-beta.23 → 2.1.0-beta.25
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/ai/ai-employees/nathan/index.js +1 -0
- package/dist/externalVersion.js +10 -10
- package/dist/node_modules/ses/package.json +1 -1
- package/dist/node_modules/zod/package.json +1 -1
- package/dist/server/flow-surfaces/blueprint/compile-blocks.d.ts +2 -1
- package/dist/server/flow-surfaces/blueprint/compile-blocks.js +142 -22
- package/dist/server/flow-surfaces/blueprint/compile-plan.d.ts +2 -1
- package/dist/server/flow-surfaces/blueprint/compile-plan.js +8 -8
- package/dist/server/flow-surfaces/blueprint/normalize-document.js +5 -14
- package/dist/server/flow-surfaces/blueprint/private-utils.d.ts +0 -1
- package/dist/server/flow-surfaces/blueprint/private-utils.js +0 -3
- package/dist/server/flow-surfaces/blueprint/public-types.d.ts +1 -1
- package/dist/server/flow-surfaces/builder.d.ts +1 -0
- package/dist/server/flow-surfaces/builder.js +167 -53
- package/dist/server/flow-surfaces/catalog.js +59 -3
- package/dist/server/flow-surfaces/compose-compiler.d.ts +0 -1
- package/dist/server/flow-surfaces/compose-compiler.js +0 -1
- package/dist/server/flow-surfaces/configure-options.js +4 -4
- package/dist/server/flow-surfaces/contract-guard.js +11 -3
- package/dist/server/flow-surfaces/default-block-actions.js +11 -10
- package/dist/server/flow-surfaces/field-type-resolver.d.ts +0 -1
- package/dist/server/flow-surfaces/field-type-resolver.js +3 -13
- package/dist/server/flow-surfaces/hidden-popup-calendar.d.ts +86 -0
- package/dist/server/flow-surfaces/hidden-popup-calendar.js +554 -0
- package/dist/server/flow-surfaces/hidden-popup-contract.d.ts +116 -0
- package/dist/server/flow-surfaces/hidden-popup-contract.js +611 -0
- package/dist/server/flow-surfaces/hidden-popup-kanban.d.ts +62 -0
- package/dist/server/flow-surfaces/hidden-popup-kanban.js +651 -0
- package/dist/server/flow-surfaces/placement.js +1 -0
- package/dist/server/flow-surfaces/public-compatibility.d.ts +28 -0
- package/dist/server/flow-surfaces/public-compatibility.js +161 -0
- package/dist/server/flow-surfaces/service-utils.d.ts +0 -1
- package/dist/server/flow-surfaces/service-utils.js +0 -6
- package/dist/server/flow-surfaces/service.d.ts +66 -10
- package/dist/server/flow-surfaces/service.js +1677 -795
- package/dist/swagger/flow-surfaces.d.ts +0 -29
- package/dist/swagger/flow-surfaces.js +8 -17
- package/dist/swagger/index.d.ts +0 -29
- package/package.json +2 -2
|
@@ -0,0 +1,611 @@
|
|
|
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 hidden_popup_contract_exports = {};
|
|
38
|
+
__export(hidden_popup_contract_exports, {
|
|
39
|
+
HIDDEN_POPUP_DISPLAY_KEYS: () => HIDDEN_POPUP_DISPLAY_KEYS,
|
|
40
|
+
HIDDEN_POPUP_TEMPLATE_TARGET_KEYS: () => HIDDEN_POPUP_TEMPLATE_TARGET_KEYS,
|
|
41
|
+
OPEN_VIEW_MODE_ALIASES: () => OPEN_VIEW_MODE_ALIASES,
|
|
42
|
+
attachHiddenPopupDefaults: () => attachHiddenPopupDefaults,
|
|
43
|
+
buildHiddenPopupActionStepParams: () => buildHiddenPopupActionStepParams,
|
|
44
|
+
buildHiddenPopupOpenView: () => buildHiddenPopupOpenView,
|
|
45
|
+
buildHiddenPopupResourceMismatchDisplayFallbackOpenView: () => buildHiddenPopupResourceMismatchDisplayFallbackOpenView,
|
|
46
|
+
buildImplicitHiddenPopupDefaultContent: () => buildImplicitHiddenPopupDefaultContent,
|
|
47
|
+
buildPersistedHiddenPopupSettingsFromOpenView: () => buildPersistedHiddenPopupSettingsFromOpenView,
|
|
48
|
+
getHiddenPopupDisplaySettings: () => getHiddenPopupDisplaySettings,
|
|
49
|
+
getHiddenPopupOpenViewDisplayFallback: () => getHiddenPopupOpenViewDisplayFallback,
|
|
50
|
+
getHiddenPopupOpenViewDisplayOverrides: () => getHiddenPopupOpenViewDisplayOverrides,
|
|
51
|
+
hasExplicitHiddenPopupResourceTargetSettings: () => hasExplicitHiddenPopupResourceTargetSettings,
|
|
52
|
+
hasExplicitHiddenPopupTargetSettings: () => hasExplicitHiddenPopupTargetSettings,
|
|
53
|
+
hiddenPopupHostHasLocalContent: () => hiddenPopupHostHasLocalContent,
|
|
54
|
+
hiddenPopupOpenViewResourceDiffers: () => hiddenPopupOpenViewResourceDiffers,
|
|
55
|
+
mergeHiddenPopupDisplaySettings: () => mergeHiddenPopupDisplaySettings,
|
|
56
|
+
mergeHiddenPopupOpenViewDisplayOverrides: () => mergeHiddenPopupOpenViewDisplayOverrides,
|
|
57
|
+
normalizeBlockHiddenPopupSettings: () => normalizeBlockHiddenPopupSettings,
|
|
58
|
+
normalizeHiddenPopupScalarSettings: () => normalizeHiddenPopupScalarSettings,
|
|
59
|
+
normalizeHiddenPopupSettings: () => normalizeHiddenPopupSettings,
|
|
60
|
+
resolveHiddenPopupHostOpenView: () => resolveHiddenPopupHostOpenView,
|
|
61
|
+
resolveHiddenPopupOpenViewTransition: () => resolveHiddenPopupOpenViewTransition,
|
|
62
|
+
resolveHiddenPopupOpenViewTransitionWithCandidate: () => resolveHiddenPopupOpenViewTransitionWithCandidate,
|
|
63
|
+
resolveHiddenPopupSettingsOverride: () => resolveHiddenPopupSettingsOverride,
|
|
64
|
+
shouldAutoBindHiddenPopupTemplate: () => shouldAutoBindHiddenPopupTemplate,
|
|
65
|
+
shouldPreserveExplicitHiddenPopupTemplateOpenView: () => shouldPreserveExplicitHiddenPopupTemplateOpenView,
|
|
66
|
+
shouldPreserveHiddenPopupOpenView: () => shouldPreserveHiddenPopupOpenView,
|
|
67
|
+
stripHiddenPopupTargetSettings: () => stripHiddenPopupTargetSettings,
|
|
68
|
+
unsetHiddenPopupPayloadPathAndPruneEmptyParents: () => unsetHiddenPopupPayloadPathAndPruneEmptyParents
|
|
69
|
+
});
|
|
70
|
+
module.exports = __toCommonJS(hidden_popup_contract_exports);
|
|
71
|
+
var import_lodash = __toESM(require("lodash"));
|
|
72
|
+
var import_defaults = require("./blueprint/defaults");
|
|
73
|
+
var import_default_block_actions = require("./default-block-actions");
|
|
74
|
+
var import_service_utils = require("./service-utils");
|
|
75
|
+
var import_template_service_utils = require("./template-service-utils");
|
|
76
|
+
const OPEN_VIEW_MODE_ALIASES = {
|
|
77
|
+
modal: "dialog",
|
|
78
|
+
page: "embed"
|
|
79
|
+
};
|
|
80
|
+
const HIDDEN_POPUP_TEMPLATE_TARGET_KEYS = [
|
|
81
|
+
"template",
|
|
82
|
+
"tryTemplate",
|
|
83
|
+
"popupTemplateUid",
|
|
84
|
+
"popupTemplateContext",
|
|
85
|
+
"popupTemplateMode",
|
|
86
|
+
"popupTemplateHasFilterByTk",
|
|
87
|
+
"popupTemplateHasSourceId",
|
|
88
|
+
"associationName",
|
|
89
|
+
"filterByTk",
|
|
90
|
+
"sourceId"
|
|
91
|
+
];
|
|
92
|
+
const HIDDEN_POPUP_DISPLAY_OMIT_KEYS = [
|
|
93
|
+
...HIDDEN_POPUP_TEMPLATE_TARGET_KEYS,
|
|
94
|
+
"uid",
|
|
95
|
+
"collectionName",
|
|
96
|
+
"dataSourceKey"
|
|
97
|
+
];
|
|
98
|
+
const HIDDEN_POPUP_TEMPLATE_CLEAR_KEYS = [
|
|
99
|
+
"popupTemplateUid",
|
|
100
|
+
"popupTemplateContext",
|
|
101
|
+
"popupTemplateMode",
|
|
102
|
+
"popupTemplateHasFilterByTk",
|
|
103
|
+
"popupTemplateHasSourceId",
|
|
104
|
+
"uid"
|
|
105
|
+
];
|
|
106
|
+
const HIDDEN_POPUP_DISPLAY_KEYS = ["mode", "size", "pageModelClass", "title"];
|
|
107
|
+
const HIDDEN_POPUP_RESOURCE_TARGET_KEYS = [
|
|
108
|
+
"template",
|
|
109
|
+
"popupTemplateUid",
|
|
110
|
+
"popupTemplateContext",
|
|
111
|
+
"popupTemplateMode",
|
|
112
|
+
"popupTemplateHasFilterByTk",
|
|
113
|
+
"popupTemplateHasSourceId",
|
|
114
|
+
"collectionName",
|
|
115
|
+
"dataSourceKey",
|
|
116
|
+
"uid",
|
|
117
|
+
"associationName",
|
|
118
|
+
"filterByTk",
|
|
119
|
+
"sourceId"
|
|
120
|
+
];
|
|
121
|
+
function normalizeHiddenPopupScalarSettings(popupSettings) {
|
|
122
|
+
for (const key of [
|
|
123
|
+
"mode",
|
|
124
|
+
"size",
|
|
125
|
+
"pageModelClass",
|
|
126
|
+
"collectionName",
|
|
127
|
+
"dataSourceKey",
|
|
128
|
+
"associationName",
|
|
129
|
+
"filterByTk",
|
|
130
|
+
"sourceId",
|
|
131
|
+
"title",
|
|
132
|
+
"popupTemplateMode"
|
|
133
|
+
]) {
|
|
134
|
+
if (!Object.prototype.hasOwnProperty.call(popupSettings, key)) {
|
|
135
|
+
continue;
|
|
136
|
+
}
|
|
137
|
+
const value = popupSettings[key];
|
|
138
|
+
if (import_lodash.default.isNull(value) || import_lodash.default.isUndefined(value)) {
|
|
139
|
+
delete popupSettings[key];
|
|
140
|
+
continue;
|
|
141
|
+
}
|
|
142
|
+
if (typeof value !== "string") {
|
|
143
|
+
continue;
|
|
144
|
+
}
|
|
145
|
+
const trimmed = value.trim();
|
|
146
|
+
if (!trimmed) {
|
|
147
|
+
delete popupSettings[key];
|
|
148
|
+
continue;
|
|
149
|
+
}
|
|
150
|
+
popupSettings[key] = key === "mode" ? OPEN_VIEW_MODE_ALIASES[trimmed] || trimmed : trimmed;
|
|
151
|
+
}
|
|
152
|
+
if (Object.prototype.hasOwnProperty.call(popupSettings, "uid") && typeof popupSettings.uid === "string") {
|
|
153
|
+
const uidValue = popupSettings.uid.trim();
|
|
154
|
+
if (uidValue) {
|
|
155
|
+
popupSettings.uid = uidValue;
|
|
156
|
+
} else {
|
|
157
|
+
delete popupSettings.uid;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
function attachHiddenPopupDefaults(popup, defaultsMetadata) {
|
|
162
|
+
if (!defaultsMetadata || !import_lodash.default.isPlainObject(popup)) {
|
|
163
|
+
return popup;
|
|
164
|
+
}
|
|
165
|
+
return (0, import_defaults.attachFlowSurfaceApplyBlueprintPopupDefaults)(popup, defaultsMetadata);
|
|
166
|
+
}
|
|
167
|
+
function normalizeBlockHiddenPopupSettings(settings, blockContext, keys, defaultsMetadata, assertPopupObject) {
|
|
168
|
+
if (!import_lodash.default.isPlainObject(settings)) {
|
|
169
|
+
return settings;
|
|
170
|
+
}
|
|
171
|
+
const nextSettings = import_lodash.default.cloneDeep(settings);
|
|
172
|
+
for (const key of keys) {
|
|
173
|
+
if (!Object.prototype.hasOwnProperty.call(settings, key)) {
|
|
174
|
+
continue;
|
|
175
|
+
}
|
|
176
|
+
const value = settings[key];
|
|
177
|
+
if (!import_lodash.default.isPlainObject(value) && !import_lodash.default.isNull(value)) {
|
|
178
|
+
if (assertPopupObject) {
|
|
179
|
+
assertPopupObject(`${blockContext}.settings.${key} must be an object`);
|
|
180
|
+
} else {
|
|
181
|
+
throw new Error(`${blockContext}.settings.${key} must be an object`);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
nextSettings[key] = attachHiddenPopupDefaults(value, defaultsMetadata);
|
|
185
|
+
}
|
|
186
|
+
return nextSettings;
|
|
187
|
+
}
|
|
188
|
+
function clearHiddenPopupTemplateBinding(popupSettings) {
|
|
189
|
+
for (const key of HIDDEN_POPUP_TEMPLATE_CLEAR_KEYS) {
|
|
190
|
+
delete popupSettings[key];
|
|
191
|
+
}
|
|
192
|
+
popupSettings.tryTemplate = false;
|
|
193
|
+
}
|
|
194
|
+
function hasRecordScopedHiddenPopupTemplateBinding(popupSettings) {
|
|
195
|
+
return !!popupSettings.popupTemplateHasFilterByTk || !!popupSettings.popupTemplateHasSourceId || !import_lodash.default.isUndefined(popupSettings.filterByTk) || !import_lodash.default.isUndefined(popupSettings.sourceId) || !!String(popupSettings.associationName || "").trim();
|
|
196
|
+
}
|
|
197
|
+
function normalizeHiddenPopupSettings(popupSettings, options = {}) {
|
|
198
|
+
const nextParams = import_lodash.default.cloneDeep(popupSettings || {});
|
|
199
|
+
delete nextParams[import_defaults.FLOW_SURFACE_APPLY_BLUEPRINT_POPUP_DEFAULTS_KEY];
|
|
200
|
+
normalizeHiddenPopupScalarSettings(nextParams);
|
|
201
|
+
const popupTemplateUidProvided = Object.prototype.hasOwnProperty.call(nextParams, "popupTemplateUid");
|
|
202
|
+
const popupTemplateUid = typeof nextParams.popupTemplateUid === "string" ? nextParams.popupTemplateUid.trim() : nextParams.popupTemplateUid;
|
|
203
|
+
if (popupTemplateUidProvided && (popupTemplateUid === null || popupTemplateUid === "")) {
|
|
204
|
+
clearHiddenPopupTemplateBinding(nextParams);
|
|
205
|
+
}
|
|
206
|
+
if (options.collectionOnly) {
|
|
207
|
+
if (hasRecordScopedHiddenPopupTemplateBinding(nextParams)) {
|
|
208
|
+
clearHiddenPopupTemplateBinding(nextParams);
|
|
209
|
+
}
|
|
210
|
+
delete nextParams.associationName;
|
|
211
|
+
delete nextParams.filterByTk;
|
|
212
|
+
delete nextParams.sourceId;
|
|
213
|
+
}
|
|
214
|
+
const normalizedInvalidUids = new Set(
|
|
215
|
+
(options.invalidUids || []).map((value) => String(value || "").trim()).filter(Boolean)
|
|
216
|
+
);
|
|
217
|
+
if (normalizedInvalidUids.size) {
|
|
218
|
+
const normalizedUid = typeof nextParams.uid === "string" ? nextParams.uid.trim() : nextParams.uid;
|
|
219
|
+
if (!normalizedUid || normalizedInvalidUids.has(String(normalizedUid))) {
|
|
220
|
+
delete nextParams.uid;
|
|
221
|
+
} else {
|
|
222
|
+
nextParams.uid = normalizedUid;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
if (nextParams.tryTemplate !== false) {
|
|
226
|
+
delete nextParams.tryTemplate;
|
|
227
|
+
}
|
|
228
|
+
return nextParams;
|
|
229
|
+
}
|
|
230
|
+
function stripHiddenPopupTargetSettings(popupSettings, options = {}) {
|
|
231
|
+
const nextParams = import_lodash.default.cloneDeep(popupSettings || {});
|
|
232
|
+
for (const key of HIDDEN_POPUP_RESOURCE_TARGET_KEYS) {
|
|
233
|
+
delete nextParams[key];
|
|
234
|
+
}
|
|
235
|
+
if (options.disableTemplateAutoBind || (popupSettings == null ? void 0 : popupSettings.tryTemplate) === false) {
|
|
236
|
+
nextParams.tryTemplate = false;
|
|
237
|
+
}
|
|
238
|
+
return nextParams;
|
|
239
|
+
}
|
|
240
|
+
function normalizeHiddenPopupResourceKey(value) {
|
|
241
|
+
return String(value || "").trim();
|
|
242
|
+
}
|
|
243
|
+
function normalizeHiddenPopupDataSourceKey(value, collectionName) {
|
|
244
|
+
return normalizeHiddenPopupResourceKey(value) || (collectionName ? "main" : "");
|
|
245
|
+
}
|
|
246
|
+
function hiddenPopupOpenViewResourceDiffers(openView, fallbackOpenView) {
|
|
247
|
+
if (!import_lodash.default.isPlainObject(openView) || !import_lodash.default.isPlainObject(fallbackOpenView)) {
|
|
248
|
+
return false;
|
|
249
|
+
}
|
|
250
|
+
const expectedCollectionName = normalizeHiddenPopupResourceKey(fallbackOpenView.collectionName);
|
|
251
|
+
const currentCollectionName = normalizeHiddenPopupResourceKey(openView.collectionName);
|
|
252
|
+
if (expectedCollectionName && currentCollectionName && expectedCollectionName !== currentCollectionName) {
|
|
253
|
+
return true;
|
|
254
|
+
}
|
|
255
|
+
const expectedDataSourceKey = normalizeHiddenPopupDataSourceKey(
|
|
256
|
+
fallbackOpenView.dataSourceKey,
|
|
257
|
+
expectedCollectionName
|
|
258
|
+
);
|
|
259
|
+
const currentDataSourceKey = normalizeHiddenPopupDataSourceKey(openView.dataSourceKey, currentCollectionName);
|
|
260
|
+
return !!expectedDataSourceKey && !!currentDataSourceKey && expectedDataSourceKey !== currentDataSourceKey;
|
|
261
|
+
}
|
|
262
|
+
function buildHiddenPopupOpenView(input) {
|
|
263
|
+
const resourceInit = input.resourceInit || {};
|
|
264
|
+
const defaults = (0, import_service_utils.buildDefinedPayload)({
|
|
265
|
+
mode: "drawer",
|
|
266
|
+
size: "medium",
|
|
267
|
+
pageModelClass: "ChildPageModel",
|
|
268
|
+
uid: input.actionUid,
|
|
269
|
+
collectionName: resourceInit.collectionName,
|
|
270
|
+
dataSourceKey: resourceInit.dataSourceKey || (resourceInit.collectionName ? "main" : void 0)
|
|
271
|
+
});
|
|
272
|
+
const current = input.normalizePopupSettings ? input.normalizePopupSettings(input.popupSettings) : normalizeHiddenPopupSettings(input.popupSettings);
|
|
273
|
+
const openViewSettings = import_lodash.default.omit(current, ["tryTemplate"]);
|
|
274
|
+
return (0, import_service_utils.buildDefinedPayload)({
|
|
275
|
+
...defaults,
|
|
276
|
+
...openViewSettings,
|
|
277
|
+
uid: openViewSettings.uid || defaults.uid,
|
|
278
|
+
collectionName: openViewSettings.collectionName || defaults.collectionName,
|
|
279
|
+
dataSourceKey: openViewSettings.dataSourceKey || defaults.dataSourceKey
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
function hasExplicitHiddenPopupTargetSettings(popupSettings, defaultUid) {
|
|
283
|
+
if (!import_lodash.default.isPlainObject(popupSettings)) {
|
|
284
|
+
return false;
|
|
285
|
+
}
|
|
286
|
+
const normalizedDefaultUid = String(defaultUid || "").trim();
|
|
287
|
+
const uid = String(popupSettings.uid || "").trim();
|
|
288
|
+
if (uid && (!normalizedDefaultUid || uid !== normalizedDefaultUid)) {
|
|
289
|
+
return true;
|
|
290
|
+
}
|
|
291
|
+
return HIDDEN_POPUP_TEMPLATE_TARGET_KEYS.some((key) => {
|
|
292
|
+
if (!Object.prototype.hasOwnProperty.call(popupSettings, key)) {
|
|
293
|
+
return false;
|
|
294
|
+
}
|
|
295
|
+
const value = popupSettings[key];
|
|
296
|
+
if (key === "template") {
|
|
297
|
+
return import_lodash.default.isPlainObject(value) && Object.keys(value).length > 0;
|
|
298
|
+
}
|
|
299
|
+
if (key === "tryTemplate") {
|
|
300
|
+
return value === false;
|
|
301
|
+
}
|
|
302
|
+
return value !== void 0 && value !== null && value !== "";
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
function hasExplicitHiddenPopupResourceTargetSettings(popupSettings, defaultUid) {
|
|
306
|
+
if (!import_lodash.default.isPlainObject(popupSettings)) {
|
|
307
|
+
return false;
|
|
308
|
+
}
|
|
309
|
+
const normalizedDefaultUid = String(defaultUid || "").trim();
|
|
310
|
+
const uid = String(popupSettings.uid || "").trim();
|
|
311
|
+
if (uid && (!normalizedDefaultUid || uid !== normalizedDefaultUid)) {
|
|
312
|
+
return true;
|
|
313
|
+
}
|
|
314
|
+
return HIDDEN_POPUP_RESOURCE_TARGET_KEYS.some((key) => {
|
|
315
|
+
if (key === "uid" || !Object.prototype.hasOwnProperty.call(popupSettings, key)) {
|
|
316
|
+
return false;
|
|
317
|
+
}
|
|
318
|
+
const value = popupSettings[key];
|
|
319
|
+
if (key === "template") {
|
|
320
|
+
return import_lodash.default.isPlainObject(value) && Object.keys(value).length > 0;
|
|
321
|
+
}
|
|
322
|
+
return value !== void 0 && value !== null && value !== "";
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
function shouldPreserveExplicitHiddenPopupTemplateOpenView(openView, popupSettings) {
|
|
326
|
+
if (!import_lodash.default.isPlainObject(openView) || !import_lodash.default.isPlainObject(popupSettings)) {
|
|
327
|
+
return false;
|
|
328
|
+
}
|
|
329
|
+
const expectedTemplateUid = String(
|
|
330
|
+
(import_lodash.default.isPlainObject(popupSettings.template) ? popupSettings.template.uid : popupSettings.popupTemplateUid) || ""
|
|
331
|
+
).trim() || void 0;
|
|
332
|
+
if (!expectedTemplateUid) {
|
|
333
|
+
return false;
|
|
334
|
+
}
|
|
335
|
+
if (String(openView.popupTemplateUid || "").trim() !== expectedTemplateUid) {
|
|
336
|
+
return false;
|
|
337
|
+
}
|
|
338
|
+
const expectedMode = String(
|
|
339
|
+
(import_lodash.default.isPlainObject(popupSettings.template) ? popupSettings.template.mode : popupSettings.popupTemplateMode) || ""
|
|
340
|
+
).trim() || "reference";
|
|
341
|
+
const openViewMode = String(openView.popupTemplateMode || "reference").trim() || "reference";
|
|
342
|
+
if (openViewMode !== expectedMode) {
|
|
343
|
+
return false;
|
|
344
|
+
}
|
|
345
|
+
if (expectedMode === "copy") {
|
|
346
|
+
return !!openView.popupTemplateContext;
|
|
347
|
+
}
|
|
348
|
+
return true;
|
|
349
|
+
}
|
|
350
|
+
function shouldPreserveHiddenPopupOpenView(openView, expectedHostUid, popupSettings, fallbackOpenView) {
|
|
351
|
+
if (!import_lodash.default.isPlainObject(openView)) {
|
|
352
|
+
return false;
|
|
353
|
+
}
|
|
354
|
+
const hostUid = String(openView.uid || "").trim();
|
|
355
|
+
const normalizedExpectedHostUid = String(expectedHostUid || "").trim();
|
|
356
|
+
const hasExternalUid = !!hostUid && !!normalizedExpectedHostUid && hostUid !== normalizedExpectedHostUid;
|
|
357
|
+
const hasTemplateBinding = !!String(openView.popupTemplateUid || "").trim() || !!openView.popupTemplateContext || !!String(openView.popupTemplateMode || "").trim();
|
|
358
|
+
const hasExplicitDisplayOverride = HIDDEN_POPUP_DISPLAY_KEYS.some((key) => {
|
|
359
|
+
if (!Object.prototype.hasOwnProperty.call(openView, key)) {
|
|
360
|
+
return false;
|
|
361
|
+
}
|
|
362
|
+
return !import_lodash.default.isEqual(openView[key], fallbackOpenView == null ? void 0 : fallbackOpenView[key]);
|
|
363
|
+
});
|
|
364
|
+
if (hasExplicitHiddenPopupTargetSettings(popupSettings, expectedHostUid)) {
|
|
365
|
+
if (shouldPreserveExplicitHiddenPopupTemplateOpenView(openView, popupSettings)) {
|
|
366
|
+
return true;
|
|
367
|
+
}
|
|
368
|
+
return hasExplicitDisplayOverride && !hasTemplateBinding && !hasExternalUid;
|
|
369
|
+
}
|
|
370
|
+
return hasTemplateBinding || hasExternalUid || hasExplicitDisplayOverride;
|
|
371
|
+
}
|
|
372
|
+
function getHiddenPopupDisplaySettings(popupSettings, normalizePopupSettings) {
|
|
373
|
+
return import_lodash.default.omit(
|
|
374
|
+
normalizePopupSettings ? normalizePopupSettings(popupSettings || {}) : normalizeHiddenPopupSettings(popupSettings || {}),
|
|
375
|
+
HIDDEN_POPUP_DISPLAY_OMIT_KEYS
|
|
376
|
+
);
|
|
377
|
+
}
|
|
378
|
+
function getHiddenPopupOpenViewDisplayFallback(openView, fallbackOpenView) {
|
|
379
|
+
return (0, import_service_utils.buildDefinedPayload)({
|
|
380
|
+
mode: (openView == null ? void 0 : openView.mode) || (fallbackOpenView == null ? void 0 : fallbackOpenView.mode),
|
|
381
|
+
size: (openView == null ? void 0 : openView.size) || (fallbackOpenView == null ? void 0 : fallbackOpenView.size),
|
|
382
|
+
pageModelClass: (openView == null ? void 0 : openView.pageModelClass) || (fallbackOpenView == null ? void 0 : fallbackOpenView.pageModelClass),
|
|
383
|
+
title: (openView == null ? void 0 : openView.title) || (fallbackOpenView == null ? void 0 : fallbackOpenView.title)
|
|
384
|
+
});
|
|
385
|
+
}
|
|
386
|
+
function mergeHiddenPopupDisplaySettings(input) {
|
|
387
|
+
const displaySettings = getHiddenPopupDisplaySettings(input.popupSettings, input.normalizePopupSettings);
|
|
388
|
+
const merged = (0, import_service_utils.buildDefinedPayload)({
|
|
389
|
+
...input.openView,
|
|
390
|
+
...displaySettings,
|
|
391
|
+
...getHiddenPopupOpenViewDisplayFallback({ ...input.openView, ...displaySettings }, input.fallbackOpenView),
|
|
392
|
+
uid: input.openView.uid,
|
|
393
|
+
collectionName: input.openView.collectionName,
|
|
394
|
+
dataSourceKey: input.openView.dataSourceKey,
|
|
395
|
+
associationName: input.openView.associationName,
|
|
396
|
+
filterByTk: input.openView.filterByTk,
|
|
397
|
+
sourceId: input.openView.sourceId,
|
|
398
|
+
popupTemplateUid: input.openView.popupTemplateUid,
|
|
399
|
+
popupTemplateContext: input.openView.popupTemplateContext,
|
|
400
|
+
popupTemplateMode: input.openView.popupTemplateMode,
|
|
401
|
+
popupTemplateHasFilterByTk: input.openView.popupTemplateHasFilterByTk,
|
|
402
|
+
popupTemplateHasSourceId: input.openView.popupTemplateHasSourceId
|
|
403
|
+
});
|
|
404
|
+
if (input.preserveOpenViewDisplay) {
|
|
405
|
+
const displayFallback = input.preserveOpenViewDisplayFallback || input.fallbackOpenView;
|
|
406
|
+
for (const key of HIDDEN_POPUP_DISPLAY_KEYS) {
|
|
407
|
+
if (Object.prototype.hasOwnProperty.call(input.openView, key) && !import_lodash.default.isEqual(input.openView[key], displayFallback == null ? void 0 : displayFallback[key])) {
|
|
408
|
+
merged[key] = input.openView[key];
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
return (0, import_service_utils.buildDefinedPayload)(merged);
|
|
413
|
+
}
|
|
414
|
+
function getHiddenPopupOpenViewDisplayOverrides(openView, fallbackOpenView) {
|
|
415
|
+
if (!import_lodash.default.isPlainObject(openView)) {
|
|
416
|
+
return {};
|
|
417
|
+
}
|
|
418
|
+
const overrides = {};
|
|
419
|
+
for (const key of HIDDEN_POPUP_DISPLAY_KEYS) {
|
|
420
|
+
if (Object.prototype.hasOwnProperty.call(openView, key) && !import_lodash.default.isEqual(openView[key], fallbackOpenView == null ? void 0 : fallbackOpenView[key])) {
|
|
421
|
+
overrides[key] = openView[key];
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
return (0, import_service_utils.buildDefinedPayload)(overrides);
|
|
425
|
+
}
|
|
426
|
+
function mergeHiddenPopupOpenViewDisplayOverrides(input) {
|
|
427
|
+
const merged = import_lodash.default.cloneDeep(input.openView || {});
|
|
428
|
+
if (!import_lodash.default.isPlainObject(input.displayOpenView)) {
|
|
429
|
+
return (0, import_service_utils.buildDefinedPayload)(merged);
|
|
430
|
+
}
|
|
431
|
+
const displayFallback = input.displayFallbackOpenView || input.fallbackOpenView;
|
|
432
|
+
Object.assign(merged, getHiddenPopupOpenViewDisplayOverrides(input.displayOpenView, displayFallback));
|
|
433
|
+
return (0, import_service_utils.buildDefinedPayload)(merged);
|
|
434
|
+
}
|
|
435
|
+
function resolveHiddenPopupOpenViewTransition(input) {
|
|
436
|
+
var _a;
|
|
437
|
+
const canUseExisting = ((_a = input.existing) == null ? void 0 : _a.uid) === input.expectedUid && input.existing.use === input.expectedUse;
|
|
438
|
+
const normalizedCurrentOpenView = import_lodash.default.isPlainObject(input.normalizedCurrentOpenView) ? input.normalizedCurrentOpenView : {};
|
|
439
|
+
const currentOpenView = import_lodash.default.isPlainObject(input.currentOpenView) ? input.currentOpenView : normalizedCurrentOpenView;
|
|
440
|
+
const preservedOpenView = import_lodash.default.isPlainObject(input.preservedOpenView) ? input.preservedOpenView : normalizedCurrentOpenView;
|
|
441
|
+
const displayFallbackOpenView = input.displayFallbackOpenView || input.seedOpenView;
|
|
442
|
+
const resourceMismatchDisplayFallbackOpenView = input.resourceMismatchDisplayFallbackOpenView || displayFallbackOpenView;
|
|
443
|
+
const shouldRebuildForResourceMismatch = !!input.allowResourceMismatchRebuild && canUseExisting && !hasExplicitHiddenPopupResourceTargetSettings(input.popupSettings, input.expectedUid) && hiddenPopupOpenViewResourceDiffers(normalizedCurrentOpenView, input.seedOpenView);
|
|
444
|
+
const shouldPreservePersistedOpenView = canUseExisting && !shouldRebuildForResourceMismatch && shouldPreserveHiddenPopupOpenView(preservedOpenView, input.expectedUid, input.popupSettings, input.seedOpenView);
|
|
445
|
+
const openView = shouldPreservePersistedOpenView ? input.mergeDisplaySettings(preservedOpenView, input.popupSettings, input.seedOpenView, {
|
|
446
|
+
preserveOpenViewDisplay: true,
|
|
447
|
+
preserveOpenViewDisplayFallback: displayFallbackOpenView
|
|
448
|
+
}) : (0, import_service_utils.buildDefinedPayload)({
|
|
449
|
+
...mergeHiddenPopupOpenViewDisplayOverrides({
|
|
450
|
+
openView: input.candidateOpenView || input.seedOpenView,
|
|
451
|
+
displayOpenView: shouldRebuildForResourceMismatch ? normalizedCurrentOpenView : null,
|
|
452
|
+
fallbackOpenView: input.seedOpenView,
|
|
453
|
+
displayFallbackOpenView: shouldRebuildForResourceMismatch ? resourceMismatchDisplayFallbackOpenView : displayFallbackOpenView
|
|
454
|
+
})
|
|
455
|
+
});
|
|
456
|
+
return {
|
|
457
|
+
openView,
|
|
458
|
+
shouldRebuildForResourceMismatch,
|
|
459
|
+
shouldPreservePersistedOpenView,
|
|
460
|
+
currentOpenView,
|
|
461
|
+
normalizedCurrentOpenView
|
|
462
|
+
};
|
|
463
|
+
}
|
|
464
|
+
async function resolveHiddenPopupOpenViewTransitionWithCandidate(input) {
|
|
465
|
+
const transition = resolveHiddenPopupOpenViewTransition(input);
|
|
466
|
+
if (transition.shouldPreservePersistedOpenView) {
|
|
467
|
+
return transition;
|
|
468
|
+
}
|
|
469
|
+
return resolveHiddenPopupOpenViewTransition({
|
|
470
|
+
...input,
|
|
471
|
+
candidateOpenView: await input.resolveCandidateOpenView()
|
|
472
|
+
});
|
|
473
|
+
}
|
|
474
|
+
function buildHiddenPopupResourceMismatchDisplayFallbackOpenView(input) {
|
|
475
|
+
const normalizedCurrentOpenView = import_lodash.default.isPlainObject(input.normalizedCurrentOpenView) ? input.normalizedCurrentOpenView : {};
|
|
476
|
+
const resourceInit = normalizedCurrentOpenView.collectionName ? (0, import_service_utils.buildDefinedPayload)({
|
|
477
|
+
collectionName: normalizedCurrentOpenView.collectionName,
|
|
478
|
+
dataSourceKey: normalizedCurrentOpenView.dataSourceKey
|
|
479
|
+
}) : input.resourceInit;
|
|
480
|
+
return input.buildOpenView({
|
|
481
|
+
resourceInit,
|
|
482
|
+
popupSettings: input.stripPopupTargetSettingsForResourceChange(input.popupSettings)
|
|
483
|
+
});
|
|
484
|
+
}
|
|
485
|
+
function buildHiddenPopupActionStepParams(existingStepParams, openView) {
|
|
486
|
+
const nextStepParams = import_lodash.default.cloneDeep(existingStepParams || {});
|
|
487
|
+
const popupSettings = import_lodash.default.isPlainObject(nextStepParams.popupSettings) ? import_lodash.default.cloneDeep(nextStepParams.popupSettings) : {};
|
|
488
|
+
popupSettings.openView = import_lodash.default.omit(import_lodash.default.cloneDeep(openView || {}), ["tryTemplate"]);
|
|
489
|
+
nextStepParams.popupSettings = popupSettings;
|
|
490
|
+
return nextStepParams;
|
|
491
|
+
}
|
|
492
|
+
function buildPersistedHiddenPopupSettingsFromOpenView(input) {
|
|
493
|
+
const normalizedOpenView = input.normalizePopupSettings(import_lodash.default.cloneDeep(input.openView || {}));
|
|
494
|
+
const normalizedExpectedHostUid = String(input.expectedHostUid || "").trim();
|
|
495
|
+
const openViewUid = String(normalizedOpenView.uid || "").trim();
|
|
496
|
+
const templateSettings = (0, import_service_utils.buildDefinedPayload)({
|
|
497
|
+
popupTemplateUid: normalizedOpenView.popupTemplateUid,
|
|
498
|
+
popupTemplateContext: normalizedOpenView.popupTemplateContext,
|
|
499
|
+
popupTemplateMode: normalizedOpenView.popupTemplateMode,
|
|
500
|
+
popupTemplateHasFilterByTk: normalizedOpenView.popupTemplateHasFilterByTk,
|
|
501
|
+
popupTemplateHasSourceId: normalizedOpenView.popupTemplateHasSourceId
|
|
502
|
+
});
|
|
503
|
+
const targetSettings = (0, import_service_utils.buildDefinedPayload)({
|
|
504
|
+
...openViewUid && openViewUid !== normalizedExpectedHostUid ? { uid: openViewUid } : {},
|
|
505
|
+
associationName: normalizedOpenView.associationName,
|
|
506
|
+
filterByTk: normalizedOpenView.filterByTk,
|
|
507
|
+
sourceId: normalizedOpenView.sourceId
|
|
508
|
+
});
|
|
509
|
+
const displaySettings = import_lodash.default.pick(input.normalizePopupSettings(input.popupSettings || {}), HIDDEN_POPUP_DISPLAY_KEYS);
|
|
510
|
+
const explicitTryTemplateOptOut = import_lodash.default.isPlainObject(input.popupSettings) && input.popupSettings.tryTemplate === false;
|
|
511
|
+
return input.normalizePopupSettings(
|
|
512
|
+
(0, import_service_utils.buildDefinedPayload)({
|
|
513
|
+
...templateSettings,
|
|
514
|
+
...targetSettings,
|
|
515
|
+
...displaySettings,
|
|
516
|
+
...explicitTryTemplateOptOut ? { tryTemplate: false } : {}
|
|
517
|
+
})
|
|
518
|
+
);
|
|
519
|
+
}
|
|
520
|
+
function unsetHiddenPopupPayloadPathAndPruneEmptyParents(payload, path) {
|
|
521
|
+
import_lodash.default.unset(payload, path);
|
|
522
|
+
for (let index = path.length - 1; index > 0; index -= 1) {
|
|
523
|
+
const parentPath = path.slice(0, index);
|
|
524
|
+
const parentValue = import_lodash.default.get(payload, parentPath);
|
|
525
|
+
if (!import_lodash.default.isPlainObject(parentValue) || Object.keys(parentValue).length > 0) {
|
|
526
|
+
break;
|
|
527
|
+
}
|
|
528
|
+
import_lodash.default.unset(payload, parentPath);
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
function buildImplicitHiddenPopupDefaultContent(popupSettings) {
|
|
532
|
+
if (import_lodash.default.isPlainObject(popupSettings) && popupSettings.tryTemplate === false) {
|
|
533
|
+
return void 0;
|
|
534
|
+
}
|
|
535
|
+
return {
|
|
536
|
+
...import_lodash.default.isPlainObject(popupSettings) ? import_lodash.default.pick(popupSettings, [import_defaults.FLOW_SURFACE_APPLY_BLUEPRINT_POPUP_DEFAULTS_KEY]) : {},
|
|
537
|
+
tryTemplate: true,
|
|
538
|
+
[import_default_block_actions.FLOW_SURFACE_INTERNAL_AUTO_SAVE_DEFAULT_POPUP_TEMPLATE_KEY]: true
|
|
539
|
+
};
|
|
540
|
+
}
|
|
541
|
+
function hiddenPopupHostHasLocalContent(actionNode) {
|
|
542
|
+
var _a, _b, _c, _d;
|
|
543
|
+
const popupPage = (0, import_service_utils.getSingleNodeSubModel)((_a = actionNode == null ? void 0 : actionNode.subModels) == null ? void 0 : _a.page);
|
|
544
|
+
const popupTab = import_lodash.default.castArray(((_b = popupPage == null ? void 0 : popupPage.subModels) == null ? void 0 : _b.tabs) || [])[0];
|
|
545
|
+
const popupGrid = (0, import_service_utils.getSingleNodeSubModel)((_c = popupTab == null ? void 0 : popupTab.subModels) == null ? void 0 : _c.grid);
|
|
546
|
+
return (0, import_service_utils.getNodeSubModelList)((_d = popupGrid == null ? void 0 : popupGrid.subModels) == null ? void 0 : _d.items).length > 0;
|
|
547
|
+
}
|
|
548
|
+
function shouldAutoBindHiddenPopupTemplate(openView, popupSettings, expectedHostUid, options = {}) {
|
|
549
|
+
if (!import_lodash.default.isPlainObject(openView)) {
|
|
550
|
+
return false;
|
|
551
|
+
}
|
|
552
|
+
const rawPopupSettings = import_lodash.default.isPlainObject(popupSettings) ? popupSettings : {};
|
|
553
|
+
if (rawPopupSettings.tryTemplate === false) {
|
|
554
|
+
return false;
|
|
555
|
+
}
|
|
556
|
+
const hostUid = String(openView.uid || "").trim();
|
|
557
|
+
const normalizedExpectedHostUid = String(expectedHostUid || "").trim();
|
|
558
|
+
const hasExternalUid = !!hostUid && !!normalizedExpectedHostUid && hostUid !== normalizedExpectedHostUid;
|
|
559
|
+
if (!hasExternalUid && options.hostHasLocalContent) {
|
|
560
|
+
return false;
|
|
561
|
+
}
|
|
562
|
+
return !String(openView.popupTemplateUid || "").trim() && !openView.popupTemplateContext && !String(openView.popupTemplateMode || "").trim() && !import_lodash.default.isPlainObject(openView.template) && !!hostUid && !hasExternalUid;
|
|
563
|
+
}
|
|
564
|
+
function resolveHiddenPopupHostOpenView(node) {
|
|
565
|
+
for (const [flowKey, stepKey] of import_template_service_utils.POPUP_HOST_STEP_PARAM_PATHS) {
|
|
566
|
+
const openView = import_lodash.default.get(node, ["stepParams", flowKey, stepKey]);
|
|
567
|
+
if (import_lodash.default.isPlainObject(openView)) {
|
|
568
|
+
return openView;
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
return null;
|
|
572
|
+
}
|
|
573
|
+
function resolveHiddenPopupSettingsOverride(overrides, actionKey) {
|
|
574
|
+
if (!overrides || !Object.prototype.hasOwnProperty.call(overrides, actionKey)) {
|
|
575
|
+
return void 0;
|
|
576
|
+
}
|
|
577
|
+
return overrides[actionKey];
|
|
578
|
+
}
|
|
579
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
580
|
+
0 && (module.exports = {
|
|
581
|
+
HIDDEN_POPUP_DISPLAY_KEYS,
|
|
582
|
+
HIDDEN_POPUP_TEMPLATE_TARGET_KEYS,
|
|
583
|
+
OPEN_VIEW_MODE_ALIASES,
|
|
584
|
+
attachHiddenPopupDefaults,
|
|
585
|
+
buildHiddenPopupActionStepParams,
|
|
586
|
+
buildHiddenPopupOpenView,
|
|
587
|
+
buildHiddenPopupResourceMismatchDisplayFallbackOpenView,
|
|
588
|
+
buildImplicitHiddenPopupDefaultContent,
|
|
589
|
+
buildPersistedHiddenPopupSettingsFromOpenView,
|
|
590
|
+
getHiddenPopupDisplaySettings,
|
|
591
|
+
getHiddenPopupOpenViewDisplayFallback,
|
|
592
|
+
getHiddenPopupOpenViewDisplayOverrides,
|
|
593
|
+
hasExplicitHiddenPopupResourceTargetSettings,
|
|
594
|
+
hasExplicitHiddenPopupTargetSettings,
|
|
595
|
+
hiddenPopupHostHasLocalContent,
|
|
596
|
+
hiddenPopupOpenViewResourceDiffers,
|
|
597
|
+
mergeHiddenPopupDisplaySettings,
|
|
598
|
+
mergeHiddenPopupOpenViewDisplayOverrides,
|
|
599
|
+
normalizeBlockHiddenPopupSettings,
|
|
600
|
+
normalizeHiddenPopupScalarSettings,
|
|
601
|
+
normalizeHiddenPopupSettings,
|
|
602
|
+
resolveHiddenPopupHostOpenView,
|
|
603
|
+
resolveHiddenPopupOpenViewTransition,
|
|
604
|
+
resolveHiddenPopupOpenViewTransitionWithCandidate,
|
|
605
|
+
resolveHiddenPopupSettingsOverride,
|
|
606
|
+
shouldAutoBindHiddenPopupTemplate,
|
|
607
|
+
shouldPreserveExplicitHiddenPopupTemplateOpenView,
|
|
608
|
+
shouldPreserveHiddenPopupOpenView,
|
|
609
|
+
stripHiddenPopupTargetSettings,
|
|
610
|
+
unsetHiddenPopupPayloadPathAndPruneEmptyParents
|
|
611
|
+
});
|
|
@@ -0,0 +1,62 @@
|
|
|
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 _ from 'lodash';
|
|
10
|
+
import type { HiddenPopupHostRuntime, HiddenPopupOpenViewNormalizer } from './hidden-popup-calendar';
|
|
11
|
+
export declare const KANBAN_POPUP_ACTION_UID_SUFFIX_BY_KEY: {
|
|
12
|
+
readonly quickCreateAction: "-quick-create-action";
|
|
13
|
+
readonly cardViewAction: "-card-view-action";
|
|
14
|
+
};
|
|
15
|
+
export declare const KANBAN_POPUP_ACTION_KEYS: ("quickCreateAction" | "cardViewAction")[];
|
|
16
|
+
export type KanbanPopupActionKey = (typeof KANBAN_POPUP_ACTION_KEYS)[number];
|
|
17
|
+
export declare const KANBAN_BLOCK_POPUP_PROP_KEYS: readonly ["popupMode", "popupSize", "popupTemplateUid", "popupPageModelClass", "popupTargetUid", "quickCreatePopupSettings"];
|
|
18
|
+
export declare const KANBAN_CARD_POPUP_PROP_KEYS: readonly ["openMode", "popupSize", "popupTemplateUid", "pageModelClass", "popupTargetUid", "cardPopupSettings"];
|
|
19
|
+
export declare function normalizeKanbanPopupSettings(actionKey: KanbanPopupActionKey, popupSettings?: Record<string, any>, blockUid?: string): Record<string, any>;
|
|
20
|
+
export declare function getKanbanInitialPopupSettings(actionKey: KanbanPopupActionKey, settings?: Record<string, any>, blockUid?: string): Record<string, any>;
|
|
21
|
+
export declare function getKanbanInitialPopupSettingsFromProps(actionKey: KanbanPopupActionKey, props?: Record<string, any>, blockUid?: string): Record<string, any>;
|
|
22
|
+
export declare function getKanbanPopupActionUse(actionKey: KanbanPopupActionKey): "KanbanQuickCreateActionModel" | "KanbanCardViewActionModel";
|
|
23
|
+
export declare function getKanbanPopupActionUid(kanbanUid: string, actionKey: KanbanPopupActionKey): string;
|
|
24
|
+
export declare function getKanbanBlockResourceInit(blockNode: any): any;
|
|
25
|
+
export declare function buildKanbanInitialStepParams(input: {
|
|
26
|
+
stepParams?: Record<string, any>;
|
|
27
|
+
props?: Record<string, any>;
|
|
28
|
+
settings?: Record<string, any>;
|
|
29
|
+
}): Record<string, any>;
|
|
30
|
+
export declare function buildKanbanInitialItemProps(input: {
|
|
31
|
+
props?: Record<string, any>;
|
|
32
|
+
settings?: Record<string, any>;
|
|
33
|
+
}): _.Dictionary<any>;
|
|
34
|
+
export declare function buildKanbanInitialItemStepParams(input: {
|
|
35
|
+
stepParams?: Record<string, any>;
|
|
36
|
+
props?: Record<string, any>;
|
|
37
|
+
settings?: Record<string, any>;
|
|
38
|
+
}): Record<string, any>;
|
|
39
|
+
export declare function getKanbanPopupStoredSettings(blockNode: any, actionKey: KanbanPopupActionKey): Record<string, any>;
|
|
40
|
+
export declare function buildKanbanPopupOpenView(input: {
|
|
41
|
+
blockNode: any;
|
|
42
|
+
actionKey: KanbanPopupActionKey;
|
|
43
|
+
resourceInit?: Record<string, any>;
|
|
44
|
+
popupSettings?: Record<string, any>;
|
|
45
|
+
}): _.Dictionary<any>;
|
|
46
|
+
export declare function normalizeKanbanPopupConfigureValue(input: {
|
|
47
|
+
actionName: string;
|
|
48
|
+
blockUid: string;
|
|
49
|
+
actionKey: KanbanPopupActionKey;
|
|
50
|
+
value: any;
|
|
51
|
+
transaction?: any;
|
|
52
|
+
normalizeOpenView: HiddenPopupOpenViewNormalizer;
|
|
53
|
+
}): Promise<Record<string, any>>;
|
|
54
|
+
export declare function resolveKanbanInitialPopupOverride(settings: Record<string, any> | undefined, primaryKey: 'quickCreatePopup' | 'cardPopup', legacyKey: 'quickCreatePopupSettings' | 'cardPopupSettings'): any;
|
|
55
|
+
export declare function mergeKanbanPopupSettings(actionKey: KanbanPopupActionKey, current: any, value: any, blockUid?: string): Record<string, any>;
|
|
56
|
+
export declare function stripKanbanPopupTargetSettingsForResourceChange(actionKey: KanbanPopupActionKey, popupSettings?: Record<string, any>, blockUid?: string): Record<string, any>;
|
|
57
|
+
export declare function replaceKanbanStoredPopupSettings(runtime: Pick<HiddenPopupHostRuntime, 'repository'>, blockNode: any, actionKey: KanbanPopupActionKey, popupSettings: Record<string, any>, transaction?: any): Promise<void>;
|
|
58
|
+
export declare function ensureKanbanBlockPopupHosts(runtime: HiddenPopupHostRuntime, blockNode: any, transaction?: any, popupSettingsOverrides?: Partial<Record<KanbanPopupActionKey, Record<string, any> | undefined>>, options?: {
|
|
59
|
+
displayFallbackOpenViews?: Partial<Record<KanbanPopupActionKey, Record<string, any> | undefined>>;
|
|
60
|
+
}): Promise<any>;
|
|
61
|
+
export declare function projectKanbanBlockPopupHosts<T = any>(node: T): T;
|
|
62
|
+
export declare function projectKanbanBlockPopupHostsInTree<T = any>(node: T): T;
|