@byteluck-fe/model-driven-engine 2.3.13 → 2.3.16

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.
@@ -17,25 +17,40 @@ function _createClass(Constructor, protoProps, staticProps) {
17
17
  if (staticProps) _defineProperties(Constructor, staticProps);
18
18
  return Constructor;
19
19
  }
20
+ function _defineProperty(obj, key, value) {
21
+ if (key in obj) {
22
+ Object.defineProperty(obj, key, {
23
+ value: value,
24
+ enumerable: true,
25
+ configurable: true,
26
+ writable: true
27
+ });
28
+ } else {
29
+ obj[key] = value;
30
+ }
31
+ return obj;
32
+ }
20
33
  export var StylePlugin = /*#__PURE__*/ function() {
21
34
  "use strict";
22
35
  function StylePlugin(config) {
23
36
  _classCallCheck(this, StylePlugin);
37
+ _defineProperty(this, "config", void 0);
38
+ _defineProperty(this, "engine", void 0);
24
39
  this.config = config;
25
40
  }
26
41
  _createClass(StylePlugin, [
27
42
  {
28
43
  key: "apply",
29
44
  value: function apply(engine) {
30
- var ref;
45
+ var _this_config;
31
46
  this.engine = engine;
32
- var ref1;
33
- var compiledStyle = (ref1 = (ref = this.config) === null || ref === void 0 ? void 0 : ref.source) !== null && ref1 !== void 0 ? ref1 : '';
34
- var style = document.createElement('style');
35
- style.className = 'edit-css';
36
- style.type = 'text/css';
47
+ var _this_config_source;
48
+ var compiledStyle = (_this_config_source = (_this_config = this.config) === null || _this_config === void 0 ? void 0 : _this_config.source) !== null && _this_config_source !== void 0 ? _this_config_source : "";
49
+ var style = document.createElement("style");
50
+ style.className = "edit-css";
51
+ style.type = "text/css";
37
52
  style.innerHTML = compiledStyle;
38
- var dom = document.querySelector('head');
53
+ var dom = document.querySelector("head");
39
54
  dom.appendChild(style);
40
55
  }
41
56
  }
@@ -1,5 +1,5 @@
1
- export * from './ES6ModulePlugin';
2
- export * from './LifecycleEventPlugin';
3
- export * from './ControlsEventPlugin';
4
- export * from './CalcPlugin';
5
- export * from './StylePlugin';
1
+ export * from "./ES6ModulePlugin";
2
+ export * from "./LifecycleEventPlugin";
3
+ export * from "./ControlsEventPlugin";
4
+ export * from "./CalcPlugin";
5
+ export * from "./StylePlugin";
@@ -1 +1 @@
1
- export * from './runtimeUtils';
1
+ export * from "./runtimeUtils";
@@ -1,18 +1,17 @@
1
- import { CONTROL_BASE_TYPE, CONTROL_TYPE } from '@byteluck-fe/model-driven-shared';
1
+ import { CONTROL_BASE_TYPE, CONTROL_TYPE } from "@byteluck-fe/model-driven-shared";
2
2
  export function hasChildrenControl(instance) {
3
3
  return instance.controlType === CONTROL_BASE_TYPE.LAYOUT || instance.controlType === CONTROL_BASE_TYPE.WRAP || instance.controlType === CONTROL_BASE_TYPE.LIST || instance.controlType === CONTROL_BASE_TYPE.SEARCH;
4
4
  }
5
5
  export function loopFormControl(control, callback) {
6
6
  if (Array.isArray(control)) {
7
7
  control.map(function(item) {
8
- //TODO 此处需要再抽象一层 datagrid/datalist
8
+ //TODO 此处需要再抽象一层datagrid/datalist
9
9
  if (item.type === CONTROL_TYPE.SUBTABLE) {
10
10
  // @ts-ignore
11
11
  var children = item.getChildrenFormControl();
12
12
  callback(item, children);
13
13
  } else if (hasChildrenControl(item)) {
14
- var ref;
15
- loopFormControl((ref = item) === null || ref === void 0 ? void 0 : ref.children, callback);
14
+ loopFormControl(item === null || item === void 0 ? void 0 : item.children, callback);
16
15
  // @ts-ignore
17
16
  } else if (item.controlType === CONTROL_BASE_TYPE.FORM) {
18
17
  callback(item);
@@ -27,9 +26,8 @@ callback) {
27
26
  if (item.type === CONTROL_TYPE.DATA_VIEW || item.type === CONTROL_TYPE.SIMPLE_SEARCH) {
28
27
  callback(item);
29
28
  } else if (hasChildrenControl(item)) {
30
- var ref;
31
29
  // @ts-ignore
32
- loopDataViewControl((ref = item) === null || ref === void 0 ? void 0 : ref.children, callback);
30
+ loopDataViewControl(item === null || item === void 0 ? void 0 : item.children, callback);
33
31
  }
34
32
  });
35
33
  }
@@ -37,9 +35,9 @@ callback) {
37
35
  var unique = 0;
38
36
  // uuid生成
39
37
  export function buildUUID() {
40
- var prefix = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : '';
38
+ var prefix = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
41
39
  var time = Date.now();
42
40
  var random = Math.floor(Math.random() * 1000000000);
43
41
  unique++;
44
- return prefix + '_' + random + unique + String(time);
42
+ return prefix + "_" + random + unique + String(time);
45
43
  }