formiojs-eorion 0.1.24 → 0.1.26
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/CustomTabs/Tabs.js +27 -16
- package/components/CustomTabs/editForm/Tabs.edit.display.js +9 -0
- package/components/DataChinaGrid/Data.js +28 -13
- package/components/DataChinaGridRow/Data.js +28 -13
- package/components/builder.js +2 -0
- package/components/buttonGroups/ButtonGroups.form.js +19 -0
- package/components/buttonGroups/ButtonGroups.js +141 -0
- package/components/buttonGroups/editForm/ButtonGroups.edit.display.js +122 -0
- package/components/index.js +3 -1
- package/dist/formio.builder.css +2 -2
- 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 +63 -9
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.form.min.js.LICENSE.txt +1 -1
- package/dist/formio.full.css +2 -2
- package/dist/formio.full.js +63 -9
- package/dist/formio.full.min.css +1 -1
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.full.min.js.LICENSE.txt +1 -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 +1 -1
- package/templates/bootstrap/buttonGroups/form.ejs.js +21 -0
- package/templates/bootstrap/buttonGroups/index.js +12 -0
- package/templates/bootstrap/customTab/form.ejs.js +1 -1
- 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.26';
|
|
1728
1728
|
Formio.pathType = '';
|
|
1729
1729
|
Formio.events = new _EventEmitter.default();
|
|
1730
1730
|
Formio.cdn = new _CDN.default();
|
|
@@ -150,19 +150,30 @@ var CustomTabsComponent = /*#__PURE__*/function (_NestedComponent) {
|
|
|
150
150
|
_this5.setTab(index);
|
|
151
151
|
});
|
|
152
152
|
_this5.addEventListener(tabLink, 'mouseover', function (event) {
|
|
153
|
-
tabLink.style.color = _this5.component[
|
|
153
|
+
tabLink.style.color = _this5.component['headerHoverColor'];
|
|
154
154
|
});
|
|
155
155
|
_this5.addEventListener(tabLink, 'mouseout', function (event) {
|
|
156
156
|
if (index === _this5.currentTab) {
|
|
157
|
-
tabLink.style.color = _this5.component[
|
|
157
|
+
tabLink.style.color = _this5.component['headerColor'];
|
|
158
158
|
} else {
|
|
159
|
-
tabLink.style.color = _this5.component[
|
|
159
|
+
tabLink.style.color = _this5.component['headerNormalColor'];
|
|
160
160
|
}
|
|
161
161
|
});
|
|
162
162
|
});
|
|
163
163
|
this.refs[this.tabKey].forEach(function (tab, index) {
|
|
164
164
|
_this5.attachComponents(tab, _this5.tabs[index], _this5.component.components[index].components);
|
|
165
165
|
});
|
|
166
|
+
var tabLineStyleStr = this.component['custom-tab-line-style'];
|
|
167
|
+
if (tabLineStyleStr && tabLineStyleStr.length > 0) {
|
|
168
|
+
try {
|
|
169
|
+
var tabLineStyle = JSON.parse(tabLineStyleStr);
|
|
170
|
+
_lodash.default.forEach(tabLineStyle, function (value, key) {
|
|
171
|
+
_this5.refs.tabLine.style[key] = value;
|
|
172
|
+
});
|
|
173
|
+
} catch (e) {
|
|
174
|
+
console.warn(e);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
166
177
|
this.setTabLine();
|
|
167
178
|
return superAttach;
|
|
168
179
|
}
|
|
@@ -209,22 +220,22 @@ var CustomTabsComponent = /*#__PURE__*/function (_NestedComponent) {
|
|
|
209
220
|
_this7.refs.tabLine.style.width = "".concat(tabLink.offsetWidth, "px");
|
|
210
221
|
_this7.refs.tabLine.style.transform = "translateX(".concat(tabLink.offsetLeft, "px)");
|
|
211
222
|
}
|
|
212
|
-
if (_this7.component[
|
|
213
|
-
tabLink.querySelector(
|
|
214
|
-
tabLink.querySelector(
|
|
215
|
-
tabLink.querySelector(
|
|
216
|
-
tabLink.querySelector(
|
|
223
|
+
if (_this7.component['headerStyle'] === 'pills') {
|
|
224
|
+
tabLink.querySelector('.tab-pills-item').style.color = 'white';
|
|
225
|
+
tabLink.querySelector('.tab-pills-item').style['background-color'] = _this7.component['headerColor'];
|
|
226
|
+
tabLink.querySelector('.tab-pills-item').style.border = "1px solid ".concat(_this7.component['headerColor']);
|
|
227
|
+
tabLink.querySelector('.triangle').style.display = 'flex';
|
|
217
228
|
} else {
|
|
218
|
-
tabLink.style.color = _this7.component[
|
|
229
|
+
tabLink.style.color = _this7.component['headerColor'];
|
|
219
230
|
}
|
|
220
231
|
} else {
|
|
221
|
-
if (_this7.component[
|
|
222
|
-
tabLink.querySelector(
|
|
223
|
-
tabLink.querySelector(
|
|
224
|
-
tabLink.querySelector(
|
|
225
|
-
tabLink.querySelector(
|
|
232
|
+
if (_this7.component['headerStyle'] === 'pills') {
|
|
233
|
+
tabLink.querySelector('.tab-pills-item').style.color = _this7.component['headerNormalColor'];
|
|
234
|
+
tabLink.querySelector('.tab-pills-item').style.border = "1px solid ".concat(_this7.component['headerNormalColor']);
|
|
235
|
+
tabLink.querySelector('.tab-pills-item').style['background-color'] = 'transparent';
|
|
236
|
+
tabLink.querySelector('.triangle').style.display = 'none';
|
|
226
237
|
} else {
|
|
227
|
-
tabLink.style.color = _this7.component[
|
|
238
|
+
tabLink.style.color = _this7.component['headerNormalColor'];
|
|
228
239
|
}
|
|
229
240
|
}
|
|
230
241
|
});
|
|
@@ -331,7 +342,7 @@ var CustomTabsComponent = /*#__PURE__*/function (_NestedComponent) {
|
|
|
331
342
|
if (['data_china_grid_row', 'data_china_grid'].includes(item.type)) {
|
|
332
343
|
item.resetSparkLine();
|
|
333
344
|
}
|
|
334
|
-
if (item.type ===
|
|
345
|
+
if (item.type === 'components') {
|
|
335
346
|
item.components.forEach(function (itemChild) {
|
|
336
347
|
_this11.refreshChild(itemChild);
|
|
337
348
|
});
|
|
@@ -124,5 +124,14 @@ var _default = [{
|
|
|
124
124
|
defaultValue: '#999',
|
|
125
125
|
input: true
|
|
126
126
|
}]
|
|
127
|
+
}, {
|
|
128
|
+
type: 'textarea',
|
|
129
|
+
label: '自定义下标样式',
|
|
130
|
+
key: 'custom-tab-line-style',
|
|
131
|
+
editor: 'ace',
|
|
132
|
+
input: true,
|
|
133
|
+
defaultValue: '',
|
|
134
|
+
tooltip: '自定义的style:json格式,ex:{"border":"none","border-radius":"30px"}',
|
|
135
|
+
weight: 51
|
|
127
136
|
}];
|
|
128
137
|
exports.default = _default;
|
|
@@ -245,24 +245,39 @@ var DataChinaGrid = /*#__PURE__*/function (_Component) {
|
|
|
245
245
|
data: self.rootValue
|
|
246
246
|
});
|
|
247
247
|
element = container.querySelector('.footer-container-value1');
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
248
|
+
var footerContentStr = self.component['footer-content1'];
|
|
249
|
+
if (footerContentStr && footerContentStr.length > 0) {
|
|
250
|
+
element.innerHTML = self.interpolate(self.parseTpl(footerContentStr, {
|
|
251
|
+
data: self.rootValue
|
|
252
|
+
}), {
|
|
253
|
+
data: self.rootValue
|
|
254
|
+
});
|
|
255
|
+
} else {
|
|
256
|
+
element.style.display = 'none';
|
|
257
|
+
}
|
|
253
258
|
element = container.querySelector('.footer-container-value2');
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
data: self.rootValue
|
|
258
|
-
});
|
|
259
|
-
element = container.querySelector('.footer-container-value3');
|
|
260
|
-
if (element) {
|
|
261
|
-
element.innerHTML = self.interpolate(self.parseTpl(self.component['footer-content3'], {
|
|
259
|
+
footerContentStr = self.component['footer-content2'];
|
|
260
|
+
if (footerContentStr && footerContentStr.length > 0) {
|
|
261
|
+
element.innerHTML = self.interpolate(self.parseTpl(footerContentStr, {
|
|
262
262
|
data: self.rootValue
|
|
263
263
|
}), {
|
|
264
264
|
data: self.rootValue
|
|
265
265
|
});
|
|
266
|
+
} else {
|
|
267
|
+
element.style.display = 'none';
|
|
268
|
+
}
|
|
269
|
+
element = container.querySelector('.footer-container-value3');
|
|
270
|
+
if (element) {
|
|
271
|
+
footerContentStr = self.component['footer-content3'];
|
|
272
|
+
if (footerContentStr && footerContentStr.length > 0) {
|
|
273
|
+
element.innerHTML = self.interpolate(self.parseTpl(footerContentStr, {
|
|
274
|
+
data: self.rootValue
|
|
275
|
+
}), {
|
|
276
|
+
data: self.rootValue
|
|
277
|
+
});
|
|
278
|
+
} else {
|
|
279
|
+
element.style.display = 'none';
|
|
280
|
+
}
|
|
266
281
|
}
|
|
267
282
|
// 图标
|
|
268
283
|
self.resetSparkLine();
|
|
@@ -249,24 +249,39 @@ var DataChinaGridRow = /*#__PURE__*/function (_Component) {
|
|
|
249
249
|
data: self.rootValue
|
|
250
250
|
});
|
|
251
251
|
element = container.querySelector('.footer-container-value1');
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
252
|
+
var footerContentStr = self.component['footer-content1'];
|
|
253
|
+
if (footerContentStr && footerContentStr.length > 0) {
|
|
254
|
+
element.innerHTML = self.interpolate(self.parseTpl(footerContentStr, {
|
|
255
|
+
data: self.rootValue
|
|
256
|
+
}), {
|
|
257
|
+
data: self.rootValue
|
|
258
|
+
});
|
|
259
|
+
} else {
|
|
260
|
+
element.style.display = 'none';
|
|
261
|
+
}
|
|
257
262
|
element = container.querySelector('.footer-container-value2');
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
data: self.rootValue
|
|
262
|
-
});
|
|
263
|
-
element = container.querySelector('.footer-container-value3');
|
|
264
|
-
if (element) {
|
|
265
|
-
element.innerHTML = self.interpolate(self.parseTpl(self.component['footer-content3'], {
|
|
263
|
+
footerContentStr = self.component['footer-content2'];
|
|
264
|
+
if (footerContentStr && footerContentStr.length > 0) {
|
|
265
|
+
element.innerHTML = self.interpolate(self.parseTpl(footerContentStr, {
|
|
266
266
|
data: self.rootValue
|
|
267
267
|
}), {
|
|
268
268
|
data: self.rootValue
|
|
269
269
|
});
|
|
270
|
+
} else {
|
|
271
|
+
element.style.display = 'none';
|
|
272
|
+
}
|
|
273
|
+
element = container.querySelector('.footer-container-value3');
|
|
274
|
+
if (element) {
|
|
275
|
+
footerContentStr = self.component['footer-content3'];
|
|
276
|
+
if (footerContentStr && footerContentStr.length > 0) {
|
|
277
|
+
element.innerHTML = self.interpolate(self.parseTpl(footerContentStr, {
|
|
278
|
+
data: self.rootValue
|
|
279
|
+
}), {
|
|
280
|
+
data: self.rootValue
|
|
281
|
+
});
|
|
282
|
+
} else {
|
|
283
|
+
element.style.display = 'none';
|
|
284
|
+
}
|
|
270
285
|
}
|
|
271
286
|
// 图标
|
|
272
287
|
self.resetSparkLine();
|
package/components/builder.js
CHANGED
|
@@ -74,7 +74,9 @@ var _Data3 = _interopRequireDefault(require("./DataChinaGridRow/Data.form"));
|
|
|
74
74
|
var _Tabs2 = _interopRequireDefault(require("./CustomTabs/Tabs.form"));
|
|
75
75
|
var _ECharts = _interopRequireDefault(require("./echarts/ECharts.form"));
|
|
76
76
|
var _IconButton = _interopRequireDefault(require("./iconButton/IconButton.form"));
|
|
77
|
+
var _ButtonGroups = _interopRequireDefault(require("./buttonGroups/ButtonGroups.form"));
|
|
77
78
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
79
|
+
_.default.buttonGroups.editForm = _ButtonGroups.default;
|
|
78
80
|
_.default.iconButton.editForm = _IconButton.default;
|
|
79
81
|
_.default.echarts.editForm = _ECharts.default;
|
|
80
82
|
_.default.customTabs.editForm = _Tabs2.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 _ButtonGroupsEdit = _interopRequireDefault(require("./editForm/ButtonGroups.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: _ButtonGroupsEdit.default
|
|
18
|
+
}]].concat(extend));
|
|
19
|
+
}
|
|
@@ -0,0 +1,141 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", {
|
|
12
|
+
value: true
|
|
13
|
+
});
|
|
14
|
+
exports.default = void 0;
|
|
15
|
+
require("core-js/modules/es.object.to-string.js");
|
|
16
|
+
require("core-js/modules/web.dom-collections.for-each.js");
|
|
17
|
+
require("core-js/modules/es.array.concat.js");
|
|
18
|
+
require("core-js/modules/es.symbol.to-primitive.js");
|
|
19
|
+
require("core-js/modules/es.date.to-primitive.js");
|
|
20
|
+
require("core-js/modules/es.symbol.js");
|
|
21
|
+
require("core-js/modules/es.symbol.description.js");
|
|
22
|
+
require("core-js/modules/es.number.constructor.js");
|
|
23
|
+
var _Field = _interopRequireDefault(require("../_classes/field/Field"));
|
|
24
|
+
var _lodash = _interopRequireDefault(require("lodash"));
|
|
25
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
26
|
+
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); }
|
|
27
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
28
|
+
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); } }
|
|
29
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
30
|
+
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); }
|
|
31
|
+
function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
|
|
32
|
+
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); }
|
|
33
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
34
|
+
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); }; }
|
|
35
|
+
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); }
|
|
36
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
37
|
+
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; } }
|
|
38
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
39
|
+
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; }
|
|
40
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
41
|
+
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); }
|
|
42
|
+
var ButtonGroups = /*#__PURE__*/function (_FieldComponent) {
|
|
43
|
+
_inherits(ButtonGroups, _FieldComponent);
|
|
44
|
+
var _super = _createSuper(ButtonGroups);
|
|
45
|
+
function ButtonGroups(component, options, data) {
|
|
46
|
+
_classCallCheck(this, ButtonGroups);
|
|
47
|
+
return _super.call(this, component, options, data);
|
|
48
|
+
}
|
|
49
|
+
_createClass(ButtonGroups, [{
|
|
50
|
+
key: "render",
|
|
51
|
+
value: function render(children) {
|
|
52
|
+
return _get(_getPrototypeOf(ButtonGroups.prototype), "render", this).call(this, this.renderTemplate('buttonGroups'));
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* After the html string has been mounted into the dom, the dom element is returned here. Use refs to find specific
|
|
57
|
+
* elements to attach functionality to.
|
|
58
|
+
*
|
|
59
|
+
* @param element
|
|
60
|
+
* @returns {Promise}
|
|
61
|
+
*/
|
|
62
|
+
}, {
|
|
63
|
+
key: "attach",
|
|
64
|
+
value: function attach(element) {
|
|
65
|
+
var _this = this;
|
|
66
|
+
var refs = {
|
|
67
|
+
btnOptions: 'multi'
|
|
68
|
+
};
|
|
69
|
+
this.loadRefs(element, refs);
|
|
70
|
+
if (this.refs.btnOptions) {
|
|
71
|
+
var clickEventType = this.component['click-event-type'];
|
|
72
|
+
this.refs.btnOptions.forEach(function (btnOption) {
|
|
73
|
+
_this.addEventListener(btnOption, 'click', function (event) {
|
|
74
|
+
var currentKey = btnOption.getAttribute('data-value');
|
|
75
|
+
// 切换tab
|
|
76
|
+
switch (clickEventType) {
|
|
77
|
+
case 'setTab':
|
|
78
|
+
Formio.forms[_this.currentForm.id].getComponent(_this.component['click-event-tab-id']).setTabByKey(currentKey);
|
|
79
|
+
break;
|
|
80
|
+
}
|
|
81
|
+
_this.refs.btnOptions.forEach(function (item) {
|
|
82
|
+
if (item.getAttribute('data-value') === btnOption.getAttribute('data-value')) {
|
|
83
|
+
item.classList.remove('btn-outline-primary');
|
|
84
|
+
item.classList.add('btn-primary');
|
|
85
|
+
} else {
|
|
86
|
+
item.classList.remove('btn-primary');
|
|
87
|
+
item.classList.add('btn-outline-primary');
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
return _get(_getPrototypeOf(ButtonGroups.prototype), "attach", this).call(this, element);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Get the value of the component from the dom elements.
|
|
98
|
+
*
|
|
99
|
+
* @returns {Array}
|
|
100
|
+
*/
|
|
101
|
+
}, {
|
|
102
|
+
key: "getValue",
|
|
103
|
+
value: function getValue() {
|
|
104
|
+
return this.component.value;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Set the value of the component into the dom elements.
|
|
109
|
+
*
|
|
110
|
+
* @param value
|
|
111
|
+
* @returns {boolean}
|
|
112
|
+
*/
|
|
113
|
+
}, {
|
|
114
|
+
key: "setValue",
|
|
115
|
+
value: function setValue(value) {
|
|
116
|
+
return true;
|
|
117
|
+
}
|
|
118
|
+
}], [{
|
|
119
|
+
key: "schema",
|
|
120
|
+
value: function schema() {
|
|
121
|
+
for (var _len = arguments.length, extend = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
122
|
+
extend[_key] = arguments[_key];
|
|
123
|
+
}
|
|
124
|
+
return _Field.default.schema.apply(_Field.default, [{
|
|
125
|
+
label: 'ButtonGroups',
|
|
126
|
+
key: 'buttonGroups',
|
|
127
|
+
type: 'buttonGroups'
|
|
128
|
+
}].concat(extend));
|
|
129
|
+
}
|
|
130
|
+
}]);
|
|
131
|
+
return ButtonGroups;
|
|
132
|
+
}(_Field.default);
|
|
133
|
+
exports.default = ButtonGroups;
|
|
134
|
+
_defineProperty(ButtonGroups, "builderInfo", {
|
|
135
|
+
title: 'ButtonGroups',
|
|
136
|
+
group: 'advanced',
|
|
137
|
+
icon: 'button',
|
|
138
|
+
weight: 70,
|
|
139
|
+
documentation: 'http://help.form.io/userguide/#buttonGroups',
|
|
140
|
+
schema: ButtonGroups.schema()
|
|
141
|
+
});
|
|
@@ -0,0 +1,122 @@
|
|
|
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
|
+
key: 'buttons',
|
|
23
|
+
type: 'datagrid',
|
|
24
|
+
input: true,
|
|
25
|
+
label: '按钮组',
|
|
26
|
+
weight: 1,
|
|
27
|
+
components: [{
|
|
28
|
+
type: 'textfield',
|
|
29
|
+
input: true,
|
|
30
|
+
key: 'title',
|
|
31
|
+
label: 'Label'
|
|
32
|
+
}, {
|
|
33
|
+
type: 'textfield',
|
|
34
|
+
input: true,
|
|
35
|
+
key: 'key',
|
|
36
|
+
label: 'Key',
|
|
37
|
+
validate: {
|
|
38
|
+
required: true
|
|
39
|
+
}
|
|
40
|
+
}]
|
|
41
|
+
}, {
|
|
42
|
+
type: 'panel',
|
|
43
|
+
title: '点击事件',
|
|
44
|
+
collapsible: true,
|
|
45
|
+
collapsed: false,
|
|
46
|
+
weight: 1,
|
|
47
|
+
components: [{
|
|
48
|
+
key: 'click-event-type',
|
|
49
|
+
data: {
|
|
50
|
+
values: [{
|
|
51
|
+
label: '切换标签',
|
|
52
|
+
value: 'setTab'
|
|
53
|
+
}]
|
|
54
|
+
},
|
|
55
|
+
type: 'select',
|
|
56
|
+
input: true,
|
|
57
|
+
label: '事件类型',
|
|
58
|
+
dataSrc: 'values'
|
|
59
|
+
}, {
|
|
60
|
+
type: 'select',
|
|
61
|
+
input: true,
|
|
62
|
+
key: 'click-event-tab-id',
|
|
63
|
+
label: '选择切换的tabs',
|
|
64
|
+
dataSrc: 'custom',
|
|
65
|
+
valueProperty: 'value',
|
|
66
|
+
data: {
|
|
67
|
+
custom: function custom(context) {
|
|
68
|
+
var values = [];
|
|
69
|
+
context.utils.eachComponent(context.instance.options.editForm.components, function (component, path) {
|
|
70
|
+
if (component.key !== context.data.key && component.type === 'customTabs') {
|
|
71
|
+
values.push({
|
|
72
|
+
label: component.label || component.key,
|
|
73
|
+
value: path
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
}, true);
|
|
77
|
+
return values;
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
conditional: {
|
|
81
|
+
json: {
|
|
82
|
+
in: [{
|
|
83
|
+
var: 'data.click-event-type'
|
|
84
|
+
}, ['setTab']]
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}]
|
|
88
|
+
}, {
|
|
89
|
+
key: 'labelPosition',
|
|
90
|
+
ignore: true
|
|
91
|
+
}, {
|
|
92
|
+
key: 'customClass',
|
|
93
|
+
ignore: false
|
|
94
|
+
}, {
|
|
95
|
+
key: 'placeholder',
|
|
96
|
+
ignore: true
|
|
97
|
+
}, {
|
|
98
|
+
key: 'hidden',
|
|
99
|
+
ignore: true
|
|
100
|
+
}, {
|
|
101
|
+
key: 'modalEdit',
|
|
102
|
+
ignore: true
|
|
103
|
+
}, {
|
|
104
|
+
key: 'tableView',
|
|
105
|
+
ignore: true
|
|
106
|
+
}, {
|
|
107
|
+
key: 'description',
|
|
108
|
+
ignore: true
|
|
109
|
+
}, {
|
|
110
|
+
key: 'autofocus',
|
|
111
|
+
ignore: true
|
|
112
|
+
}, {
|
|
113
|
+
key: 'tooltip',
|
|
114
|
+
ignore: true
|
|
115
|
+
}, {
|
|
116
|
+
key: 'tabindex',
|
|
117
|
+
ignore: true
|
|
118
|
+
}, {
|
|
119
|
+
key: 'disabled',
|
|
120
|
+
ignore: true
|
|
121
|
+
}];
|
|
122
|
+
exports.default = _default;
|
package/components/index.js
CHANGED
|
@@ -83,6 +83,7 @@ var _Tabs2 = _interopRequireDefault(require("./CustomTabs/Tabs"));
|
|
|
83
83
|
var _Progress = _interopRequireDefault(require("./progress/Progress"));
|
|
84
84
|
var _ECharts = _interopRequireDefault(require("./echarts/ECharts"));
|
|
85
85
|
var _IconButton = _interopRequireDefault(require("./iconButton/IconButton"));
|
|
86
|
+
var _ButtonGroups = _interopRequireDefault(require("./buttonGroups/ButtonGroups"));
|
|
86
87
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
87
88
|
var _default = {
|
|
88
89
|
map: _Map.default,
|
|
@@ -164,6 +165,7 @@ var _default = {
|
|
|
164
165
|
customTabs: _Tabs2.default,
|
|
165
166
|
echarts: _ECharts.default,
|
|
166
167
|
progress: _Progress.default,
|
|
167
|
-
iconButton: _IconButton.default
|
|
168
|
+
iconButton: _IconButton.default,
|
|
169
|
+
buttonGroups: _ButtonGroups.default
|
|
168
170
|
};
|
|
169
171
|
exports.default = _default;
|
package/dist/formio.builder.css
CHANGED
|
@@ -2649,8 +2649,8 @@ span[role=link] {
|
|
|
2649
2649
|
cursor: default;
|
|
2650
2650
|
}
|
|
2651
2651
|
.formio-component-customTabs .tab-header .tab-line {
|
|
2652
|
-
height:
|
|
2653
|
-
margin-top:
|
|
2652
|
+
height: 3px;
|
|
2653
|
+
margin-top: 2px;
|
|
2654
2654
|
transition: all 0.3s;
|
|
2655
2655
|
}
|
|
2656
2656
|
.formio-component-customTabs .tab-header .tab-pills-item {
|