@next-core/brick-kit 2.150.0 → 2.151.1
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/index.bundle.js +65 -0
- package/dist/index.bundle.js.map +1 -1
- package/dist/index.esm.js +65 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/types/core/CustomForms/ExpandCustomForm.d.ts.map +1 -1
- package/dist/types/getRealValue.d.ts +9 -0
- package/dist/types/getRealValue.d.ts.map +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/index.esm.js
CHANGED
|
@@ -10202,6 +10202,19 @@ function _ExpandCustomForm() {
|
|
|
10202
10202
|
var formContext = new CustomFormContext();
|
|
10203
10203
|
|
|
10204
10204
|
if (Array.isArray(formData.context)) {
|
|
10205
|
+
formData.context.forEach(item => {
|
|
10206
|
+
if (brickConf.properties[item.name] !== undefined) {
|
|
10207
|
+
item.value = brickConf.properties[item.name];
|
|
10208
|
+
}
|
|
10209
|
+
});
|
|
10210
|
+
|
|
10211
|
+
if (brickConf.properties.condition) {
|
|
10212
|
+
formData.context.push({
|
|
10213
|
+
name: "condition",
|
|
10214
|
+
value: brickConf.properties.condition
|
|
10215
|
+
});
|
|
10216
|
+
}
|
|
10217
|
+
|
|
10205
10218
|
yield formContext.formState.define(formData.context, _objectSpread(_objectSpread({}, context), {}, {
|
|
10206
10219
|
formContextId: formContext.id
|
|
10207
10220
|
}), {});
|
|
@@ -10210,6 +10223,20 @@ function _ExpandCustomForm() {
|
|
|
10210
10223
|
try {
|
|
10211
10224
|
var formStoryboard = getStoryboard([formData.formSchema], [], formData.fields, isPreview, formContext.id);
|
|
10212
10225
|
formStoryboard[0] = _.isEmpty(formStoryboard[0]) ? errorBrick : formStoryboard[0];
|
|
10226
|
+
|
|
10227
|
+
if (formStoryboard[0].brick === "forms.general-form" && brickConf.events) {
|
|
10228
|
+
var _formStoryboard$0$eve;
|
|
10229
|
+
|
|
10230
|
+
var brickConfEvents = brickConf.events;
|
|
10231
|
+
var events = (_formStoryboard$0$eve = formStoryboard[0].events) !== null && _formStoryboard$0$eve !== void 0 ? _formStoryboard$0$eve : {};
|
|
10232
|
+
Object.keys(brickConfEvents).forEach(item => {
|
|
10233
|
+
var newEvents = Array.isArray(events[item]) ? events[item] : [events[item]];
|
|
10234
|
+
var itemEvents = Array.isArray(brickConfEvents[item]) ? brickConfEvents[item] : [brickConfEvents[item]];
|
|
10235
|
+
events[item] = _.compact([...newEvents, ...itemEvents]);
|
|
10236
|
+
});
|
|
10237
|
+
formStoryboard[0].events = events;
|
|
10238
|
+
}
|
|
10239
|
+
|
|
10213
10240
|
return _objectSpread(_objectSpread({}, brickConf), {}, {
|
|
10214
10241
|
brick: "div",
|
|
10215
10242
|
slots: {
|
|
@@ -15089,5 +15116,42 @@ function useProvider() {
|
|
|
15089
15116
|
}));
|
|
15090
15117
|
}
|
|
15091
15118
|
|
|
15092
|
-
|
|
15119
|
+
/**
|
|
15120
|
+
* An equivalent of `computeRealValue` but for external usages, with no custom
|
|
15121
|
+
* context or options.
|
|
15122
|
+
*
|
|
15123
|
+
* @param value - Any value which may contains evaluations or placeholders.
|
|
15124
|
+
* @returns Computed real value.
|
|
15125
|
+
*/
|
|
15126
|
+
|
|
15127
|
+
function getRealValue(value) {
|
|
15128
|
+
var compute = (data, ctx) => {
|
|
15129
|
+
if (typeof data === "string") {
|
|
15130
|
+
if (isEvaluable(data)) {
|
|
15131
|
+
var result = evaluate(data);
|
|
15132
|
+
recursiveMarkAsInjected(result);
|
|
15133
|
+
return result;
|
|
15134
|
+
}
|
|
15135
|
+
|
|
15136
|
+
return inject(data, ctx);
|
|
15137
|
+
}
|
|
15138
|
+
|
|
15139
|
+
if (!isObject(data) || haveBeenInjected(value)) {
|
|
15140
|
+
return data;
|
|
15141
|
+
}
|
|
15142
|
+
|
|
15143
|
+
if (Array.isArray(data)) {
|
|
15144
|
+
return data.map(v => compute(v, ctx));
|
|
15145
|
+
}
|
|
15146
|
+
|
|
15147
|
+
return Object.fromEntries(Object.entries(data).map(_ref => {
|
|
15148
|
+
var [k, v] = _ref;
|
|
15149
|
+
return [compute(k, ctx), compute(v, ctx)];
|
|
15150
|
+
}));
|
|
15151
|
+
};
|
|
15152
|
+
|
|
15153
|
+
return compute(value, _internalApiGetCurrentContext());
|
|
15154
|
+
}
|
|
15155
|
+
|
|
15156
|
+
export { BrickAsComponent, BrickWrapper, DisplayByFeatureFlags, EasyopsEmpty, ErrorBoundary, FeatureFlagsProvider, ForwardRefSingleBrickAsComponent, ModalElement, SingleBrickAsComponent, StoryboardFunctionRegistryFactory, UpdatingElement, abortController, authenticate, batchSetAppsLocalTheme, checkIf, checkIfByTransform, createHistory, createRuntime, developHelper, doTransform, event, getAuth, getCssPropertyValue, getCurrentTheme, getHistory, getMockInfo, getRealValue, getRuntime, getRuntimeMisc, handleHttpError, httpErrorToString, i18nText, initI18n, isLoggedIn, logout, looseCheckIf, looseCheckIfByTransform, looseCheckIfOfComputed, method, preprocessTransformProperties, property, reTransformForDevtools, renderEasyopsEmpty, transformElementProperties, transformIntermediateData, transformProperties, useApplyPageTitle, useCurrentApp, useCurrentMode, useCurrentTheme, useFeatureFlags, useLocation, useProvider, useRecentApps };
|
|
15093
15157
|
//# sourceMappingURL=index.esm.js.map
|