@byteluck-fe/model-driven-engine 2.7.0-alpha.17 → 2.7.0-alpha.18

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,40 +17,25 @@ 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
- }
33
20
  export var StylePlugin = /*#__PURE__*/ function() {
34
21
  "use strict";
35
22
  function StylePlugin(config) {
36
23
  _classCallCheck(this, StylePlugin);
37
- _defineProperty(this, "config", void 0);
38
- _defineProperty(this, "engine", void 0);
39
24
  this.config = config;
40
25
  }
41
26
  _createClass(StylePlugin, [
42
27
  {
43
28
  key: "apply",
44
29
  value: function apply(engine) {
45
- var _this_config;
30
+ var ref;
46
31
  this.engine = engine;
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";
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';
52
37
  style.innerHTML = compiledStyle;
53
- var dom = document.querySelector("head");
38
+ var dom = document.querySelector('head');
54
39
  dom.appendChild(style);
55
40
  }
56
41
  }
@@ -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,4 +1,4 @@
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
  }
@@ -12,7 +12,8 @@ export function loopFormControl(control, callback) {
12
12
  ;
13
13
  callback(item, children);
14
14
  } else if (hasChildrenControl(item)) {
15
- loopFormControl(item === null || item === void 0 ? void 0 : item.children, callback);
15
+ var ref;
16
+ loopFormControl((ref = item) === null || ref === void 0 ? void 0 : ref.children, callback);
16
17
  // @ts-ignore
17
18
  } else if (item.controlType === CONTROL_BASE_TYPE.FORM) {
18
19
  callback(item);
@@ -27,8 +28,9 @@ callback) {
27
28
  if (item.type === CONTROL_TYPE.DATA_VIEW || item.type === CONTROL_TYPE.SIMPLE_SEARCH) {
28
29
  callback(item);
29
30
  } else if (hasChildrenControl(item)) {
31
+ var ref;
30
32
  // @ts-ignore
31
- loopDataViewControl(item === null || item === void 0 ? void 0 : item.children, callback);
33
+ loopDataViewControl((ref = item) === null || ref === void 0 ? void 0 : ref.children, callback);
32
34
  }
33
35
  });
34
36
  }
@@ -36,9 +38,9 @@ callback) {
36
38
  var unique = 0;
37
39
  // uuid生成
38
40
  export function buildUUID() {
39
- var prefix = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
41
+ var prefix = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : '';
40
42
  var time = Date.now();
41
43
  var random = Math.floor(Math.random() * 1000000000);
42
44
  unique++;
43
- return prefix + "_" + random + unique + String(time);
45
+ return prefix + '_' + random + unique + String(time);
44
46
  }