@next-core/brick-kit 2.198.0 → 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 +50 -12
- package/dist/index.bundle.js.map +1 -1
- package/dist/index.esm.js +46 -8
- 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/package.json +2 -2
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
|
|
|
@@ -10117,6 +10119,7 @@
|
|
|
10117
10119
|
}
|
|
10118
10120
|
}
|
|
10119
10121
|
|
|
10122
|
+
var formContainers = ["forms.general-form", "form.general-form", "eo-form"];
|
|
10120
10123
|
function ExpandCustomForm(formData, brickConf, isPreview, context) {
|
|
10121
10124
|
var formContext = new CustomFormContext();
|
|
10122
10125
|
formData = initFormContext(formData, brickConf, isPreview);
|
|
@@ -10369,7 +10372,7 @@
|
|
|
10369
10372
|
var resultItem = {};
|
|
10370
10373
|
//数据初始化:根据id,字段类型获取默认属性
|
|
10371
10374
|
var defaultProperties = getDefaultProperties(dataItem.id, fields);
|
|
10372
|
-
if (dataItem.brick
|
|
10375
|
+
if (formContainers.includes(dataItem.brick) && isPreview) {
|
|
10373
10376
|
dataItem.properties = _objectSpread__default["default"](_objectSpread__default["default"]({}, dataItem.properties), {}, {
|
|
10374
10377
|
className: "form-preview"
|
|
10375
10378
|
});
|
|
@@ -10419,7 +10422,7 @@
|
|
|
10419
10422
|
return result;
|
|
10420
10423
|
}
|
|
10421
10424
|
function initFormContext(formData, brickConf, isPreview) {
|
|
10422
|
-
if (isPreview && formData.formSchema && formData.formSchema.brick
|
|
10425
|
+
if (isPreview && formData.formSchema && formContainers.includes(formData.formSchema.brick)) {
|
|
10423
10426
|
var _formData$formSchema$;
|
|
10424
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);
|
|
10425
10428
|
}
|
|
@@ -10456,7 +10459,7 @@
|
|
|
10456
10459
|
try {
|
|
10457
10460
|
var formStoryboard = getStoryboard([formData.formSchema], [], formData.fields, isPreview, formContext.id);
|
|
10458
10461
|
formStoryboard[0] = ___default["default"].isEmpty(formStoryboard[0]) ? errorBrick : formStoryboard[0];
|
|
10459
|
-
if (formStoryboard[0].brick
|
|
10462
|
+
if (formContainers.includes(formStoryboard[0].brick) && brickConf.events) {
|
|
10460
10463
|
var _formStoryboard$0$eve;
|
|
10461
10464
|
var brickConfEvents = brickConf.events;
|
|
10462
10465
|
var events = (_formStoryboard$0$eve = formStoryboard[0].events) !== null && _formStoryboard$0$eve !== void 0 ? _formStoryboard$0$eve : {};
|
|
@@ -11693,12 +11696,47 @@
|
|
|
11693
11696
|
return;
|
|
11694
11697
|
};
|
|
11695
11698
|
|
|
11696
|
-
|
|
11697
|
-
|
|
11698
|
-
|
|
11699
|
-
|
|
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];
|
|
11700
11714
|
}
|
|
11701
|
-
|
|
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);
|
|
11702
11740
|
}
|
|
11703
11741
|
|
|
11704
11742
|
var standaloneApps = [];
|