@next-core/brick-kit 2.197.3 → 2.199.0
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 +54 -13
- package/dist/index.bundle.js.map +1 -1
- package/dist/index.esm.js +50 -9
- package/dist/index.esm.js.map +1 -1
- package/dist/types/core/CustomForms/ExpandCustomForm.d.ts +1 -0
- package/dist/types/core/CustomForms/ExpandCustomForm.d.ts.map +1 -1
- package/dist/types/core/CustomForms/registerFormRenderer.d.ts.map +1 -1
- package/dist/types/core/Runtime.d.ts.map +1 -1
- package/dist/types/core/setAppLocales.d.ts.map +1 -1
- package/package.json +6 -6
package/dist/index.bundle.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('history'), require('@babel/runtime/helpers/objectSpread2'), require('@babel/runtime/helpers/objectWithoutProperties'), require('@babel/runtime/helpers/defineProperty'), require('@babel/runtime/helpers/asyncToGenerator'), require('lodash'), require('@next-core/brick-utils'), require('moment'), require('@next-core/pipes'), require('i18next'), require('react'), require('@next-core/brick-http'), require('@next-core/easyops-analytics'), require('antd'), require('@ant-design/icons'), require('js-yaml'), require('@next-core/loader'), require('react-i18next'), require('@babel/runtime/helpers/esm/extends'), require('@next-core/illustrations'), require('@babel/runtime/helpers/decorate')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', 'history', '@babel/runtime/helpers/objectSpread2', '@babel/runtime/helpers/objectWithoutProperties', '@babel/runtime/helpers/defineProperty', '@babel/runtime/helpers/asyncToGenerator', 'lodash', '@next-core/brick-utils', 'moment', '@next-core/pipes', 'i18next', 'react', '@next-core/brick-http', '@next-core/easyops-analytics', 'antd', '@ant-design/icons', 'js-yaml', '@next-core/loader', 'react-i18next', '@babel/runtime/helpers/esm/extends', '@next-core/illustrations', '@babel/runtime/helpers/decorate'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.BrickKit = {}, global.history$1, global._objectSpread, global._objectWithoutProperties, global._defineProperty$1, global._asyncToGenerator$3, global._, global.brickUtils, global.moment, global.pipes, global.i18next, global.React, global.brickHttp, global.easyopsAnalytics, global.antd, global.icons, global.yaml, global.loader, global.reactI18next, global._extends, global.illustrations, global._decorate));
|
|
5
|
-
})(this, (function (exports, history$1, _objectSpread, _objectWithoutProperties, _defineProperty$1, _asyncToGenerator$3, _, brickUtils, moment, pipes, i18next, React, brickHttp, easyopsAnalytics, antd, icons, yaml, loader, reactI18next, _extends, illustrations, _decorate) { 'use strict';
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('history'), require('@babel/runtime/helpers/objectSpread2'), require('@babel/runtime/helpers/objectWithoutProperties'), require('@babel/runtime/helpers/defineProperty'), require('@babel/runtime/helpers/asyncToGenerator'), require('lodash'), require('@next-core/brick-utils'), require('moment'), require('@next-core/pipes'), require('i18next'), require('react'), require('@next-core/brick-http'), require('@next-core/easyops-analytics'), require('antd'), require('@ant-design/icons'), require('js-yaml'), require('@next-core/loader'), require('@babel/runtime/helpers/classPrivateMethodInitSpec'), require('@babel/runtime/helpers/classPrivateMethodGet'), require('react-i18next'), require('@babel/runtime/helpers/esm/extends'), require('@next-core/illustrations'), require('@babel/runtime/helpers/decorate')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', 'history', '@babel/runtime/helpers/objectSpread2', '@babel/runtime/helpers/objectWithoutProperties', '@babel/runtime/helpers/defineProperty', '@babel/runtime/helpers/asyncToGenerator', 'lodash', '@next-core/brick-utils', 'moment', '@next-core/pipes', 'i18next', 'react', '@next-core/brick-http', '@next-core/easyops-analytics', 'antd', '@ant-design/icons', 'js-yaml', '@next-core/loader', '@babel/runtime/helpers/classPrivateMethodInitSpec', '@babel/runtime/helpers/classPrivateMethodGet', 'react-i18next', '@babel/runtime/helpers/esm/extends', '@next-core/illustrations', '@babel/runtime/helpers/decorate'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.BrickKit = {}, global.history$1, global._objectSpread, global._objectWithoutProperties, global._defineProperty$1, global._asyncToGenerator$3, global._, global.brickUtils, global.moment, global.pipes, global.i18next, global.React, global.brickHttp, global.easyopsAnalytics, global.antd, global.icons, global.yaml, global.loader, global._classPrivateMethodInitSpec, global._classPrivateMethodGet, global.reactI18next, global._extends, global.illustrations, global._decorate));
|
|
5
|
+
})(this, (function (exports, history$1, _objectSpread, _objectWithoutProperties, _defineProperty$1, _asyncToGenerator$3, _, brickUtils, moment, pipes, i18next, React, brickHttp, easyopsAnalytics, antd, icons, yaml, loader, _classPrivateMethodInitSpec, _classPrivateMethodGet, reactI18next, _extends, illustrations, _decorate) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
@@ -15,6 +15,8 @@
|
|
|
15
15
|
var i18next__default = /*#__PURE__*/_interopDefaultLegacy(i18next);
|
|
16
16
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
17
17
|
var yaml__default = /*#__PURE__*/_interopDefaultLegacy(yaml);
|
|
18
|
+
var _classPrivateMethodInitSpec__default = /*#__PURE__*/_interopDefaultLegacy(_classPrivateMethodInitSpec);
|
|
19
|
+
var _classPrivateMethodGet__default = /*#__PURE__*/_interopDefaultLegacy(_classPrivateMethodGet);
|
|
18
20
|
var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
|
|
19
21
|
var _decorate__default = /*#__PURE__*/_interopDefaultLegacy(_decorate);
|
|
20
22
|
|
|
@@ -3954,8 +3956,9 @@
|
|
|
3954
3956
|
// deprecated
|
|
3955
3957
|
}
|
|
3956
3958
|
applyPageTitle(pageTitle) {
|
|
3959
|
+
var _kernel$currentApp;
|
|
3957
3960
|
var baseTitle = this.getBrandSettings().base_title;
|
|
3958
|
-
document.title = pageTitle ? "".concat(pageTitle, " - ").concat(baseTitle) : baseTitle;
|
|
3961
|
+
document.title = pageTitle ? ((_kernel$currentApp = kernel.currentApp) === null || _kernel$currentApp === void 0 ? void 0 : _kernel$currentApp.localeTitle) || "".concat(pageTitle, " - ").concat(baseTitle) : baseTitle;
|
|
3959
3962
|
}
|
|
3960
3963
|
}
|
|
3961
3964
|
|
|
@@ -7108,12 +7111,14 @@
|
|
|
7108
7111
|
});
|
|
7109
7112
|
// Use `app.name` as the fallback `app.localeName`.
|
|
7110
7113
|
app.localeName = i18next__default["default"].getFixedT(null, ns)("name", app.name);
|
|
7114
|
+
app.localeTitle = i18next__default["default"].getFixedT(null, ns)("title", "");
|
|
7111
7115
|
// Remove the temporary i18n resource bundles.
|
|
7112
7116
|
Object.keys(locales).forEach(lang => {
|
|
7113
7117
|
i18next__default["default"].removeResourceBundle(lang, ns);
|
|
7114
7118
|
});
|
|
7115
7119
|
} else {
|
|
7116
7120
|
app.localeName = app.name;
|
|
7121
|
+
app.localeTitle = "";
|
|
7117
7122
|
}
|
|
7118
7123
|
}
|
|
7119
7124
|
|
|
@@ -10114,6 +10119,7 @@
|
|
|
10114
10119
|
}
|
|
10115
10120
|
}
|
|
10116
10121
|
|
|
10122
|
+
var formContainers = ["forms.general-form", "form.general-form", "eo-form"];
|
|
10117
10123
|
function ExpandCustomForm(formData, brickConf, isPreview, context) {
|
|
10118
10124
|
var formContext = new CustomFormContext();
|
|
10119
10125
|
formData = initFormContext(formData, brickConf, isPreview);
|
|
@@ -10366,7 +10372,7 @@
|
|
|
10366
10372
|
var resultItem = {};
|
|
10367
10373
|
//数据初始化:根据id,字段类型获取默认属性
|
|
10368
10374
|
var defaultProperties = getDefaultProperties(dataItem.id, fields);
|
|
10369
|
-
if (dataItem.brick
|
|
10375
|
+
if (formContainers.includes(dataItem.brick) && isPreview) {
|
|
10370
10376
|
dataItem.properties = _objectSpread__default["default"](_objectSpread__default["default"]({}, dataItem.properties), {}, {
|
|
10371
10377
|
className: "form-preview"
|
|
10372
10378
|
});
|
|
@@ -10416,7 +10422,7 @@
|
|
|
10416
10422
|
return result;
|
|
10417
10423
|
}
|
|
10418
10424
|
function initFormContext(formData, brickConf, isPreview) {
|
|
10419
|
-
if (isPreview && formData.formSchema && formData.formSchema.brick
|
|
10425
|
+
if (isPreview && formData.formSchema && formContainers.includes(formData.formSchema.brick)) {
|
|
10420
10426
|
var _formData$formSchema$;
|
|
10421
10427
|
brickConf["properties"] = _objectSpread__default["default"](_objectSpread__default["default"]({}, brickConf.properties), (_formData$formSchema$ = formData.formSchema.properties) === null || _formData$formSchema$ === void 0 ? void 0 : _formData$formSchema$.previewConf);
|
|
10422
10428
|
}
|
|
@@ -10453,7 +10459,7 @@
|
|
|
10453
10459
|
try {
|
|
10454
10460
|
var formStoryboard = getStoryboard([formData.formSchema], [], formData.fields, isPreview, formContext.id);
|
|
10455
10461
|
formStoryboard[0] = ___default["default"].isEmpty(formStoryboard[0]) ? errorBrick : formStoryboard[0];
|
|
10456
|
-
if (formStoryboard[0].brick
|
|
10462
|
+
if (formContainers.includes(formStoryboard[0].brick) && brickConf.events) {
|
|
10457
10463
|
var _formStoryboard$0$eve;
|
|
10458
10464
|
var brickConfEvents = brickConf.events;
|
|
10459
10465
|
var events = (_formStoryboard$0$eve = formStoryboard[0].events) !== null && _formStoryboard$0$eve !== void 0 ? _formStoryboard$0$eve : {};
|
|
@@ -11690,12 +11696,47 @@
|
|
|
11690
11696
|
return;
|
|
11691
11697
|
};
|
|
11692
11698
|
|
|
11693
|
-
|
|
11694
|
-
|
|
11695
|
-
|
|
11696
|
-
|
|
11699
|
+
var _proxyFormMethod = /*#__PURE__*/new WeakSet();
|
|
11700
|
+
class FormElement extends HTMLElement {
|
|
11701
|
+
constructor() {
|
|
11702
|
+
super(...arguments);
|
|
11703
|
+
_classPrivateMethodInitSpec__default["default"](this, _proxyFormMethod);
|
|
11704
|
+
}
|
|
11705
|
+
get $$typeof() {
|
|
11706
|
+
return "formRenderer";
|
|
11707
|
+
}
|
|
11708
|
+
validate() {
|
|
11709
|
+
_classPrivateMethodGet__default["default"](this, _proxyFormMethod, _proxyFormMethod2).call(this, "validate");
|
|
11710
|
+
}
|
|
11711
|
+
setInitValue() {
|
|
11712
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
11713
|
+
args[_key] = arguments[_key];
|
|
11697
11714
|
}
|
|
11698
|
-
|
|
11715
|
+
_classPrivateMethodGet__default["default"](this, _proxyFormMethod, _proxyFormMethod2).call(this, "setInitValue", args);
|
|
11716
|
+
}
|
|
11717
|
+
resetFields() {
|
|
11718
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
11719
|
+
args[_key2] = arguments[_key2];
|
|
11720
|
+
}
|
|
11721
|
+
_classPrivateMethodGet__default["default"](this, _proxyFormMethod, _proxyFormMethod2).call(this, "resetFields", args);
|
|
11722
|
+
}
|
|
11723
|
+
}
|
|
11724
|
+
function _proxyFormMethod2(method) {
|
|
11725
|
+
var _containerElement$tag;
|
|
11726
|
+
var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
11727
|
+
var containerElement = this.firstElementChild;
|
|
11728
|
+
var tagName = containerElement === null || containerElement === void 0 ? void 0 : (_containerElement$tag = containerElement.tagName) === null || _containerElement$tag === void 0 ? void 0 : _containerElement$tag.toLowerCase();
|
|
11729
|
+
if (formContainers.includes(tagName)) {
|
|
11730
|
+
containerElement[method](...args);
|
|
11731
|
+
} else {
|
|
11732
|
+
// eslint-disable-next-line no-console
|
|
11733
|
+
console.error("no ".concat(method, " method in the container element"), {
|
|
11734
|
+
container: tagName
|
|
11735
|
+
});
|
|
11736
|
+
}
|
|
11737
|
+
}
|
|
11738
|
+
function registerFormRenderer() {
|
|
11739
|
+
customElements.get(formRenderer) || customElements.define(formRenderer, FormElement);
|
|
11699
11740
|
}
|
|
11700
11741
|
|
|
11701
11742
|
var standaloneApps = [];
|