formiojs-eorion 0.1.3 → 0.1.5
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/Formio.js +1 -1
- package/components/builder.js +2 -0
- package/components/echarts/ECharts.form.js +19 -0
- package/components/echarts/ECharts.js +155 -0
- package/components/echarts/editForm/ECharts.edit.display.js +66 -0
- package/components/index.js +3 -1
- package/dist/formio.builder.css +1 -1
- package/dist/formio.builder.min.css +1 -1
- package/dist/formio.contrib.js +24 -3
- package/dist/formio.contrib.min.js +1 -1
- package/dist/formio.contrib.min.js.LICENSE.txt +1 -1
- package/dist/formio.embed.min.js.LICENSE.txt +1 -1
- package/dist/formio.form.js +69 -5
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.form.min.js.LICENSE.txt +26 -1
- package/dist/formio.full.css +1 -1
- package/dist/formio.full.js +69 -5
- package/dist/formio.full.min.css +1 -1
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.full.min.js.LICENSE.txt +26 -1
- package/dist/formio.js +1 -1
- package/dist/formio.min.js +1 -1
- package/dist/formio.min.js.LICENSE.txt +1 -1
- package/dist/formio.utils.min.js.LICENSE.txt +1 -1
- package/package.json +2 -2
- package/templates/bootstrap/dataChinaGridRow/form.ejs.js +2 -2
- package/templates/bootstrap/echarts/form.ejs.js +14 -0
- package/templates/bootstrap/echarts/index.js +12 -0
- package/templates/bootstrap/index.js +3 -1
package/Formio.js
CHANGED
|
@@ -1724,7 +1724,7 @@ Formio.projectUrlSet = false;
|
|
|
1724
1724
|
Formio.plugins = [];
|
|
1725
1725
|
Formio.cache = {};
|
|
1726
1726
|
Formio.Providers = _providers.default;
|
|
1727
|
-
Formio.version = '0.1.
|
|
1727
|
+
Formio.version = '0.1.5';
|
|
1728
1728
|
Formio.pathType = '';
|
|
1729
1729
|
Formio.events = new _EventEmitter.default();
|
|
1730
1730
|
Formio.cdn = new _CDN.default();
|
package/components/builder.js
CHANGED
|
@@ -72,7 +72,9 @@ var _NocodbFile = _interopRequireDefault(require("./NocodbFile/NocodbFile.form")
|
|
|
72
72
|
var _Data2 = _interopRequireDefault(require("./DataChinaGrid/Data.form"));
|
|
73
73
|
var _Data3 = _interopRequireDefault(require("./DataChinaGridRow/Data.form"));
|
|
74
74
|
var _Tabs2 = _interopRequireDefault(require("./CustomTabs/Tabs.form"));
|
|
75
|
+
var _ECharts = _interopRequireDefault(require("./echarts/ECharts.form"));
|
|
75
76
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
77
|
+
_.default.echarts.editForm = _ECharts.default;
|
|
76
78
|
_.default.customTabs.editForm = _Tabs2.default;
|
|
77
79
|
_.default.data_china_grid_row.editForm = _Data3.default;
|
|
78
80
|
_.default.data_china_grid.editForm = _Data2.default;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = _default;
|
|
7
|
+
require("core-js/modules/es.array.concat.js");
|
|
8
|
+
var _Component = _interopRequireDefault(require("../_classes/component/Component.form"));
|
|
9
|
+
var _EChartsEdit = _interopRequireDefault(require("./editForm/ECharts.edit.display"));
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
function _default() {
|
|
12
|
+
for (var _len = arguments.length, extend = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
13
|
+
extend[_key] = arguments[_key];
|
|
14
|
+
}
|
|
15
|
+
return _Component.default.apply(void 0, [[{
|
|
16
|
+
key: 'display',
|
|
17
|
+
components: _EChartsEdit.default
|
|
18
|
+
}]].concat(extend));
|
|
19
|
+
}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.object.get-prototype-of.js");
|
|
4
|
+
require("core-js/modules/es.reflect.construct.js");
|
|
5
|
+
require("core-js/modules/es.reflect.get.js");
|
|
6
|
+
require("core-js/modules/es.object.get-own-property-descriptor.js");
|
|
7
|
+
require("core-js/modules/es.symbol.iterator.js");
|
|
8
|
+
require("core-js/modules/es.array.iterator.js");
|
|
9
|
+
require("core-js/modules/es.string.iterator.js");
|
|
10
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
11
|
+
require("core-js/modules/es.weak-map.js");
|
|
12
|
+
Object.defineProperty(exports, "__esModule", {
|
|
13
|
+
value: true
|
|
14
|
+
});
|
|
15
|
+
exports.default = void 0;
|
|
16
|
+
require("core-js/modules/es.regexp.exec.js");
|
|
17
|
+
require("core-js/modules/es.string.replace.js");
|
|
18
|
+
require("core-js/modules/es.string.trim.js");
|
|
19
|
+
require("core-js/modules/es.array.concat.js");
|
|
20
|
+
require("core-js/modules/es.symbol.to-primitive.js");
|
|
21
|
+
require("core-js/modules/es.date.to-primitive.js");
|
|
22
|
+
require("core-js/modules/es.symbol.js");
|
|
23
|
+
require("core-js/modules/es.symbol.description.js");
|
|
24
|
+
require("core-js/modules/es.object.to-string.js");
|
|
25
|
+
require("core-js/modules/es.number.constructor.js");
|
|
26
|
+
var _Field = _interopRequireDefault(require("../_classes/field/Field"));
|
|
27
|
+
var _lodash = _interopRequireDefault(require("lodash"));
|
|
28
|
+
var echarts = _interopRequireWildcard(require("echarts"));
|
|
29
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
30
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
31
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
32
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
33
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
34
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
35
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
36
|
+
function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
|
|
37
|
+
function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
|
|
38
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
39
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
40
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
41
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
42
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
43
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
44
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
45
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
46
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
47
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
48
|
+
var ECharts = /*#__PURE__*/function (_FieldComponent) {
|
|
49
|
+
_inherits(ECharts, _FieldComponent);
|
|
50
|
+
var _super = _createSuper(ECharts);
|
|
51
|
+
function ECharts(component, options, data) {
|
|
52
|
+
var _this;
|
|
53
|
+
_classCallCheck(this, ECharts);
|
|
54
|
+
_this = _super.call(this, component, options, data);
|
|
55
|
+
_this.chartInstance = null;
|
|
56
|
+
return _this;
|
|
57
|
+
}
|
|
58
|
+
_createClass(ECharts, [{
|
|
59
|
+
key: "render",
|
|
60
|
+
value: function render(children) {
|
|
61
|
+
return _get(_getPrototypeOf(ECharts.prototype), "render", this).call(this, this.renderTemplate('echarts'));
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* After the html string has been mounted into the dom, the dom element is returned here. Use refs to find specific
|
|
66
|
+
* elements to attach functionality to.
|
|
67
|
+
*
|
|
68
|
+
* @param element
|
|
69
|
+
* @returns {Promise}
|
|
70
|
+
*/
|
|
71
|
+
}, {
|
|
72
|
+
key: "attach",
|
|
73
|
+
value: function attach(element) {
|
|
74
|
+
var _this2 = this;
|
|
75
|
+
var refs = {};
|
|
76
|
+
this.loadRefs(element, refs);
|
|
77
|
+
setTimeout(function () {
|
|
78
|
+
_this2.setValue();
|
|
79
|
+
}, 100);
|
|
80
|
+
return _get(_getPrototypeOf(ECharts.prototype), "attach", this).call(this, element);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Get the value of the component from the dom elements.
|
|
85
|
+
*
|
|
86
|
+
* @returns {Array}
|
|
87
|
+
*/
|
|
88
|
+
}, {
|
|
89
|
+
key: "getValue",
|
|
90
|
+
value: function getValue() {
|
|
91
|
+
return this.component.value;
|
|
92
|
+
}
|
|
93
|
+
}, {
|
|
94
|
+
key: "parseTpl",
|
|
95
|
+
value: function parseTpl(template, map) {
|
|
96
|
+
return template.replace(/\$\{.+?}/g, function (match) {
|
|
97
|
+
var path = match.substr(2, match.length - 3).trim();
|
|
98
|
+
var strTmp = _lodash.default.get(map, path);
|
|
99
|
+
if (strTmp === undefined) {
|
|
100
|
+
strTmp = null;
|
|
101
|
+
} else {
|
|
102
|
+
if (_lodash.default.isArray(strTmp) || _lodash.default.isObject(strTmp)) {
|
|
103
|
+
strTmp = JSON.stringify(strTmp);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return strTmp;
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Set the value of the component into the dom elements.
|
|
112
|
+
*
|
|
113
|
+
* @param value
|
|
114
|
+
* @returns {boolean}
|
|
115
|
+
*/
|
|
116
|
+
}, {
|
|
117
|
+
key: "setValue",
|
|
118
|
+
value: function setValue(value) {
|
|
119
|
+
if (!this.chartInstance) {
|
|
120
|
+
// 初始化 ECharts 实例
|
|
121
|
+
var canvas = this.element.querySelector('#echarts-container');
|
|
122
|
+
this.chartInstance = echarts.init(canvas);
|
|
123
|
+
}
|
|
124
|
+
var optionsStr = this.component["option-value"];
|
|
125
|
+
optionsStr = this.parseTpl(optionsStr, {
|
|
126
|
+
data: this.rootValue
|
|
127
|
+
});
|
|
128
|
+
// 使用配置项渲染图表
|
|
129
|
+
this.chartInstance.setOption(JSON.parse(optionsStr), true);
|
|
130
|
+
return true;
|
|
131
|
+
}
|
|
132
|
+
}], [{
|
|
133
|
+
key: "schema",
|
|
134
|
+
value: function schema() {
|
|
135
|
+
for (var _len = arguments.length, extend = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
136
|
+
extend[_key] = arguments[_key];
|
|
137
|
+
}
|
|
138
|
+
return _Field.default.schema.apply(_Field.default, [{
|
|
139
|
+
label: 'ECharts',
|
|
140
|
+
key: 'echarts',
|
|
141
|
+
type: 'echarts'
|
|
142
|
+
}].concat(extend));
|
|
143
|
+
}
|
|
144
|
+
}]);
|
|
145
|
+
return ECharts;
|
|
146
|
+
}(_Field.default);
|
|
147
|
+
exports.default = ECharts;
|
|
148
|
+
_defineProperty(ECharts, "builderInfo", {
|
|
149
|
+
title: 'ECharts',
|
|
150
|
+
group: 'advanced',
|
|
151
|
+
icon: 'chart',
|
|
152
|
+
weight: 70,
|
|
153
|
+
documentation: 'http://help.form.io/userguide/#echarts',
|
|
154
|
+
schema: ECharts.schema()
|
|
155
|
+
});
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _default = [{
|
|
8
|
+
type: 'textfield',
|
|
9
|
+
label: '宽度',
|
|
10
|
+
key: 'width',
|
|
11
|
+
input: true,
|
|
12
|
+
weight: 1,
|
|
13
|
+
defaultValue: "100%"
|
|
14
|
+
}, {
|
|
15
|
+
type: 'textfield',
|
|
16
|
+
label: '高度',
|
|
17
|
+
key: 'height',
|
|
18
|
+
input: true,
|
|
19
|
+
weight: 1,
|
|
20
|
+
defaultValue: "50px"
|
|
21
|
+
}, {
|
|
22
|
+
type: 'textarea',
|
|
23
|
+
label: '配置项',
|
|
24
|
+
key: 'option-value',
|
|
25
|
+
editor: 'ace',
|
|
26
|
+
input: true,
|
|
27
|
+
tooltip: 'echarts配置项(json格式)',
|
|
28
|
+
weight: 1,
|
|
29
|
+
validate: {
|
|
30
|
+
required: true
|
|
31
|
+
}
|
|
32
|
+
}, {
|
|
33
|
+
key: 'labelPosition',
|
|
34
|
+
ignore: true
|
|
35
|
+
}, {
|
|
36
|
+
key: 'customClass',
|
|
37
|
+
ignore: false
|
|
38
|
+
}, {
|
|
39
|
+
key: 'placeholder',
|
|
40
|
+
ignore: true
|
|
41
|
+
}, {
|
|
42
|
+
key: 'hidden',
|
|
43
|
+
ignore: true
|
|
44
|
+
}, {
|
|
45
|
+
key: 'modalEdit',
|
|
46
|
+
ignore: true
|
|
47
|
+
}, {
|
|
48
|
+
key: 'tableView',
|
|
49
|
+
ignore: true
|
|
50
|
+
}, {
|
|
51
|
+
key: 'description',
|
|
52
|
+
ignore: true
|
|
53
|
+
}, {
|
|
54
|
+
key: 'autofocus',
|
|
55
|
+
ignore: true
|
|
56
|
+
}, {
|
|
57
|
+
key: 'tooltip',
|
|
58
|
+
ignore: true
|
|
59
|
+
}, {
|
|
60
|
+
key: 'tabindex',
|
|
61
|
+
ignore: true
|
|
62
|
+
}, {
|
|
63
|
+
key: 'disabled',
|
|
64
|
+
ignore: true
|
|
65
|
+
}];
|
|
66
|
+
exports.default = _default;
|
package/components/index.js
CHANGED
|
@@ -81,6 +81,7 @@ var _Data2 = _interopRequireDefault(require("./DataChinaGrid/Data"));
|
|
|
81
81
|
var _Data3 = _interopRequireDefault(require("./DataChinaGridRow/Data"));
|
|
82
82
|
var _Tabs2 = _interopRequireDefault(require("./CustomTabs/Tabs"));
|
|
83
83
|
var _Progress = _interopRequireDefault(require("./progress/Progress"));
|
|
84
|
+
var _ECharts = _interopRequireDefault(require("./echarts/ECharts"));
|
|
84
85
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
85
86
|
var _default = {
|
|
86
87
|
map: _Map.default,
|
|
@@ -159,6 +160,7 @@ var _default = {
|
|
|
159
160
|
nocodbFile: _NocodbFile.default,
|
|
160
161
|
data_china_grid: _Data2.default,
|
|
161
162
|
data_china_grid_row: _Data3.default,
|
|
162
|
-
customTabs: _Tabs2.default
|
|
163
|
+
customTabs: _Tabs2.default,
|
|
164
|
+
echarts: _ECharts.default
|
|
163
165
|
};
|
|
164
166
|
exports.default = _default;
|