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

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,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,8 +12,7 @@ export function loopFormControl(control, callback) {
12
12
  ;
13
13
  callback(item, children);
14
14
  } else if (hasChildrenControl(item)) {
15
- var ref;
16
- loopFormControl((ref = item) === null || ref === void 0 ? void 0 : ref.children, callback);
15
+ loopFormControl(item === null || item === void 0 ? void 0 : item.children, callback);
17
16
  // @ts-ignore
18
17
  } else if (item.controlType === CONTROL_BASE_TYPE.FORM) {
19
18
  callback(item);
@@ -28,9 +27,8 @@ callback) {
28
27
  if (item.type === CONTROL_TYPE.DATA_VIEW || item.type === CONTROL_TYPE.SIMPLE_SEARCH) {
29
28
  callback(item);
30
29
  } else if (hasChildrenControl(item)) {
31
- var ref;
32
30
  // @ts-ignore
33
- loopDataViewControl((ref = item) === null || ref === void 0 ? void 0 : ref.children, callback);
31
+ loopDataViewControl(item === null || item === void 0 ? void 0 : item.children, callback);
34
32
  }
35
33
  });
36
34
  }
@@ -38,9 +36,9 @@ callback) {
38
36
  var unique = 0;
39
37
  // uuid生成
40
38
  export function buildUUID() {
41
- var prefix = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : '';
39
+ var prefix = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
42
40
  var time = Date.now();
43
41
  var random = Math.floor(Math.random() * 1000000000);
44
42
  unique++;
45
- return prefix + '_' + random + unique + String(time);
43
+ return prefix + "_" + random + unique + String(time);
46
44
  }