formiojs-eorion 0.1.60 → 0.1.62
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/datetimeRange/DateTimeRange.form.js +42 -0
- package/components/datetimeRange/DateTimeRange.js +258 -0
- package/components/datetimeRange/editForm/DateTimeRange.edit.data.js +36 -0
- package/components/datetimeRange/editForm/DateTimeRange.edit.date.js +67 -0
- package/components/datetimeRange/editForm/DateTimeRange.edit.display.js +105 -0
- package/components/datetimeRange/editForm/DateTimeRange.edit.time.js +35 -0
- package/components/datetimeRange/editForm/DateTimeRange.edit.validation.js +89 -0
- package/components/index.js +2 -0
- package/dist/formio.contrib.js +13 -2
- 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 +92 -4
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.form.min.js.LICENSE.txt +1 -1
- package/dist/formio.full.js +92 -4
- 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/widgets/CalendarRangeWidget.js +628 -0
- package/widgets/index.js +3 -1
package/Formio.js
CHANGED
|
@@ -1727,7 +1727,7 @@ Formio.projectUrlSet = false;
|
|
|
1727
1727
|
Formio.plugins = [];
|
|
1728
1728
|
Formio.cache = {};
|
|
1729
1729
|
Formio.Providers = _providers.default;
|
|
1730
|
-
Formio.version = '0.1.
|
|
1730
|
+
Formio.version = '0.1.62';
|
|
1731
1731
|
Formio.pathType = '';
|
|
1732
1732
|
Formio.events = new _EventEmitter.default();
|
|
1733
1733
|
Formio.cdn = new _CDN.default();
|
package/components/builder.js
CHANGED
|
@@ -78,7 +78,9 @@ var _IconButton = _interopRequireDefault(require("./iconButton/IconButton.form")
|
|
|
78
78
|
var _ButtonGroups = _interopRequireDefault(require("./buttonGroups/ButtonGroups.form"));
|
|
79
79
|
var _File2 = _interopRequireDefault(require("./file_china_grid/File.form"));
|
|
80
80
|
var _Range = _interopRequireDefault(require("./range/Range.form"));
|
|
81
|
+
var _DateTimeRange = _interopRequireDefault(require("./datetimeRange/DateTimeRange.form"));
|
|
81
82
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
83
|
+
_.default.datetimeRange.editForm = _DateTimeRange.default;
|
|
82
84
|
_.default.range.editForm = _Range.default;
|
|
83
85
|
_.default.fileUds.editForm = _File2.default;
|
|
84
86
|
_.default.buttonGroups.editForm = _ButtonGroups.default;
|
|
@@ -0,0 +1,42 @@
|
|
|
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 _Components = _interopRequireDefault(require("../Components"));
|
|
9
|
+
var _DateTimeRangeEdit = _interopRequireDefault(require("./editForm/DateTimeRange.edit.data"));
|
|
10
|
+
var _DateTimeRangeEdit2 = _interopRequireDefault(require("./editForm/DateTimeRange.edit.date"));
|
|
11
|
+
var _DateTimeRangeEdit3 = _interopRequireDefault(require("./editForm/DateTimeRange.edit.display"));
|
|
12
|
+
var _DateTimeRangeEdit4 = _interopRequireDefault(require("./editForm/DateTimeRange.edit.time"));
|
|
13
|
+
var _DateTimeRangeEdit5 = _interopRequireDefault(require("./editForm/DateTimeRange.edit.validation"));
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
|
+
function _default() {
|
|
16
|
+
for (var _len = arguments.length, extend = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
17
|
+
extend[_key] = arguments[_key];
|
|
18
|
+
}
|
|
19
|
+
return _Components.default.baseEditForm.apply(_Components.default, [[{
|
|
20
|
+
key: 'display',
|
|
21
|
+
components: _DateTimeRangeEdit3.default
|
|
22
|
+
}, {
|
|
23
|
+
label: 'Date',
|
|
24
|
+
key: 'date',
|
|
25
|
+
weight: 1,
|
|
26
|
+
components: _DateTimeRangeEdit2.default
|
|
27
|
+
}, {
|
|
28
|
+
label: 'Time',
|
|
29
|
+
key: 'time',
|
|
30
|
+
weight: 2,
|
|
31
|
+
components: _DateTimeRangeEdit4.default
|
|
32
|
+
}, {
|
|
33
|
+
key: 'data',
|
|
34
|
+
components: _DateTimeRangeEdit.default
|
|
35
|
+
}, {
|
|
36
|
+
key: 'validation',
|
|
37
|
+
components: _DateTimeRangeEdit5.default
|
|
38
|
+
}, {
|
|
39
|
+
key: 'addons',
|
|
40
|
+
ignore: true
|
|
41
|
+
}]].concat(extend));
|
|
42
|
+
}
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
require("core-js/modules/es.symbol.js");
|
|
5
|
+
require("core-js/modules/es.symbol.description.js");
|
|
6
|
+
require("core-js/modules/es.symbol.iterator.js");
|
|
7
|
+
require("core-js/modules/es.symbol.to-primitive.js");
|
|
8
|
+
require("core-js/modules/es.array.filter.js");
|
|
9
|
+
require("core-js/modules/es.array.iterator.js");
|
|
10
|
+
require("core-js/modules/es.date.to-primitive.js");
|
|
11
|
+
require("core-js/modules/es.number.constructor.js");
|
|
12
|
+
require("core-js/modules/es.object.get-own-property-descriptor.js");
|
|
13
|
+
require("core-js/modules/es.object.get-own-property-descriptors.js");
|
|
14
|
+
require("core-js/modules/es.object.get-prototype-of.js");
|
|
15
|
+
require("core-js/modules/es.reflect.construct.js");
|
|
16
|
+
require("core-js/modules/es.reflect.get.js");
|
|
17
|
+
require("core-js/modules/es.string.iterator.js");
|
|
18
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
19
|
+
Object.defineProperty(exports, "__esModule", {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
exports.default = void 0;
|
|
23
|
+
require("core-js/modules/es.array.concat.js");
|
|
24
|
+
require("core-js/modules/es.object.keys.js");
|
|
25
|
+
require("core-js/modules/es.object.to-string.js");
|
|
26
|
+
require("core-js/modules/es.regexp.exec.js");
|
|
27
|
+
require("core-js/modules/es.regexp.to-string.js");
|
|
28
|
+
require("core-js/modules/es.string.match.js");
|
|
29
|
+
require("core-js/modules/es.string.replace.js");
|
|
30
|
+
require("core-js/modules/es.string.trim.js");
|
|
31
|
+
require("core-js/modules/web.dom-collections.for-each.js");
|
|
32
|
+
var _lodash = _interopRequireDefault(require("lodash"));
|
|
33
|
+
var _moment = _interopRequireDefault(require("moment"));
|
|
34
|
+
var _Input2 = _interopRequireDefault(require("../_classes/input/Input"));
|
|
35
|
+
var _utils = _interopRequireDefault(require("../../utils"));
|
|
36
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
37
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
38
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
39
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
40
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
41
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
42
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
43
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
44
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
45
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
46
|
+
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
47
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
48
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
49
|
+
function _superPropGet(t, o, e, r) { var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; }
|
|
50
|
+
function _get() { return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = _superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, _get.apply(null, arguments); }
|
|
51
|
+
function _superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); return t; }
|
|
52
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
53
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
54
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
55
|
+
var DateTimeRangeComponent = exports.default = /*#__PURE__*/function (_Input) {
|
|
56
|
+
function DateTimeRangeComponent(component, options, data) {
|
|
57
|
+
var _this;
|
|
58
|
+
_classCallCheck(this, DateTimeRangeComponent);
|
|
59
|
+
_this = _callSuper(this, DateTimeRangeComponent, [component, options, data]);
|
|
60
|
+
var timezone = _this.component.timezone || _this.options.timezone;
|
|
61
|
+
var time24hr = !_lodash.default.get(_this.component, 'timePicker.showMeridian', true);
|
|
62
|
+
|
|
63
|
+
// Change the format to map to the settings.
|
|
64
|
+
if (!_this.component.enableDate) {
|
|
65
|
+
_this.component.format = _this.component.format.replace(/yyyy-MM-dd /g, '');
|
|
66
|
+
}
|
|
67
|
+
if (!_this.component.enableTime) {
|
|
68
|
+
_this.component.format = _this.component.format.replace(/ hh:mm a$/g, '');
|
|
69
|
+
} else if (time24hr) {
|
|
70
|
+
_this.component.format = _this.component.format.replace(/hh:mm a$/g, 'HH:mm');
|
|
71
|
+
} else {
|
|
72
|
+
_this.component.format = _this.component.format.replace(/HH:mm$/g, 'hh:mm a');
|
|
73
|
+
}
|
|
74
|
+
var customOptions = _this.component.customOptions || {};
|
|
75
|
+
if (typeof customOptions === 'string') {
|
|
76
|
+
try {
|
|
77
|
+
customOptions = JSON.parse(customOptions);
|
|
78
|
+
} catch (err) {
|
|
79
|
+
console.warn(err.message);
|
|
80
|
+
customOptions = {};
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/* eslint-disable camelcase */
|
|
85
|
+
_this.component.widget = _objectSpread({
|
|
86
|
+
type: 'calendarRange',
|
|
87
|
+
timezone: timezone,
|
|
88
|
+
displayInTimezone: _lodash.default.get(_this.component, 'displayInTimezone', 'viewer'),
|
|
89
|
+
locale: _this.options.language,
|
|
90
|
+
useLocaleSettings: _lodash.default.get(_this.component, 'useLocaleSettings', false),
|
|
91
|
+
allowInput: _lodash.default.get(_this.component, 'allowInput', true),
|
|
92
|
+
mode: 'range',
|
|
93
|
+
enableTime: _lodash.default.get(_this.component, 'enableTime', true),
|
|
94
|
+
noCalendar: !_lodash.default.get(_this.component, 'enableDate', true),
|
|
95
|
+
format: _this.component.format,
|
|
96
|
+
hourIncrement: _lodash.default.get(_this.component, 'timePicker.hourStep', 1),
|
|
97
|
+
minuteIncrement: _lodash.default.get(_this.component, 'timePicker.minuteStep', 5),
|
|
98
|
+
time_24hr: time24hr,
|
|
99
|
+
readOnly: _this.options.readOnly,
|
|
100
|
+
minDate: _lodash.default.get(_this.component, 'datePicker.minDate'),
|
|
101
|
+
disabledDates: _lodash.default.get(_this.component, 'datePicker.disable'),
|
|
102
|
+
disableWeekends: _lodash.default.get(_this.component, 'datePicker.disableWeekends'),
|
|
103
|
+
disableWeekdays: _lodash.default.get(_this.component, 'datePicker.disableWeekdays'),
|
|
104
|
+
disableFunction: _lodash.default.get(_this.component, 'datePicker.disableFunction'),
|
|
105
|
+
maxDate: _lodash.default.get(_this.component, 'datePicker.maxDate')
|
|
106
|
+
}, customOptions);
|
|
107
|
+
/* eslint-enable camelcase */
|
|
108
|
+
|
|
109
|
+
// Add the validators date.
|
|
110
|
+
_this.validators.push('date');
|
|
111
|
+
return _this;
|
|
112
|
+
}
|
|
113
|
+
_inherits(DateTimeRangeComponent, _Input);
|
|
114
|
+
return _createClass(DateTimeRangeComponent, [{
|
|
115
|
+
key: "defaultSchema",
|
|
116
|
+
get: function get() {
|
|
117
|
+
return DateTimeRangeComponent.schema();
|
|
118
|
+
}
|
|
119
|
+
}, {
|
|
120
|
+
key: "defaultValue",
|
|
121
|
+
get: function get() {
|
|
122
|
+
var defaultValue = _superPropGet(DateTimeRangeComponent, "defaultValue", this, 1);
|
|
123
|
+
if (!defaultValue || defaultValue.length === 0) {
|
|
124
|
+
var tmpVal = [];
|
|
125
|
+
if (this.component.defaultStartDate) {
|
|
126
|
+
var parsedVal = _utils.default.getDateSetting(this.component.defaultStartDate);
|
|
127
|
+
if (parsedVal) {
|
|
128
|
+
tmpVal.push(parsedVal.toISOString());
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
if (this.component.defaultEndDate) {
|
|
132
|
+
var _parsedVal = _utils.default.getDateSetting(this.component.defaultEndDate);
|
|
133
|
+
if (_parsedVal) {
|
|
134
|
+
tmpVal.push(_parsedVal.toISOString());
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return tmpVal;
|
|
138
|
+
}
|
|
139
|
+
return defaultValue;
|
|
140
|
+
}
|
|
141
|
+
}, {
|
|
142
|
+
key: "emptyValue",
|
|
143
|
+
get: function get() {
|
|
144
|
+
return [];
|
|
145
|
+
}
|
|
146
|
+
}, {
|
|
147
|
+
key: "momentFormat",
|
|
148
|
+
get: function get() {
|
|
149
|
+
return _utils.default.convertFormatToMoment(this.component.format);
|
|
150
|
+
}
|
|
151
|
+
}, {
|
|
152
|
+
key: "isEmpty",
|
|
153
|
+
value: function isEmpty() {
|
|
154
|
+
var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.dataValue;
|
|
155
|
+
if (value && value.toString() === 'Invalid Date') {
|
|
156
|
+
return true;
|
|
157
|
+
}
|
|
158
|
+
if (value.length === 0) {
|
|
159
|
+
return true;
|
|
160
|
+
}
|
|
161
|
+
return _superPropGet(DateTimeRangeComponent, "isEmpty", this, 3)([value]);
|
|
162
|
+
}
|
|
163
|
+
}, {
|
|
164
|
+
key: "formatValue",
|
|
165
|
+
value: function formatValue(input) {
|
|
166
|
+
var result = _moment.default.utc(input).toISOString();
|
|
167
|
+
return result === 'Invalid date' ? input : result;
|
|
168
|
+
}
|
|
169
|
+
}, {
|
|
170
|
+
key: "isEqual",
|
|
171
|
+
value: function isEqual(valueA) {
|
|
172
|
+
var valueB = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.dataValue;
|
|
173
|
+
return this.isEmpty(valueA) && this.isEmpty(valueB) || _moment.default.utc(valueA).format(this.momentFormat) === _moment.default.utc(valueB).format(this.momentFormat);
|
|
174
|
+
}
|
|
175
|
+
}, {
|
|
176
|
+
key: "createWrapper",
|
|
177
|
+
value: function createWrapper() {
|
|
178
|
+
return false;
|
|
179
|
+
}
|
|
180
|
+
}, {
|
|
181
|
+
key: "checkValidity",
|
|
182
|
+
value: function checkValidity(data, dirty, rowData) {
|
|
183
|
+
if (this.refs.input) {
|
|
184
|
+
this.refs.input.forEach(function (input) {
|
|
185
|
+
if (input.widget && input.widget.enteredDate) {
|
|
186
|
+
dirty = true;
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
return _superPropGet(DateTimeRangeComponent, "checkValidity", this, 3)([data, dirty, rowData]);
|
|
191
|
+
}
|
|
192
|
+
}, {
|
|
193
|
+
key: "getValueAsString",
|
|
194
|
+
value: function getValueAsString(value) {
|
|
195
|
+
var format = _utils.default.convertFormatToMoment(this.component.format);
|
|
196
|
+
format += format.match(/z$/) ? '' : ' z';
|
|
197
|
+
var timezone = this.timezone;
|
|
198
|
+
if (value && !this.attached && timezone) {
|
|
199
|
+
return _lodash.default.trim(_utils.default.momentDate(value, format, timezone).format(format));
|
|
200
|
+
}
|
|
201
|
+
return (value ? _lodash.default.trim((0, _moment.default)(value).format(format)) : value) || '';
|
|
202
|
+
}
|
|
203
|
+
}], [{
|
|
204
|
+
key: "schema",
|
|
205
|
+
value: function schema() {
|
|
206
|
+
for (var _len = arguments.length, extend = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
207
|
+
extend[_key] = arguments[_key];
|
|
208
|
+
}
|
|
209
|
+
return _Input2.default.schema.apply(_Input2.default, [{
|
|
210
|
+
type: 'datetimeRange',
|
|
211
|
+
label: 'Date / Time Range',
|
|
212
|
+
key: 'dateTimeRange',
|
|
213
|
+
format: 'yyyy-MM-dd hh:mm a',
|
|
214
|
+
useLocaleSettings: false,
|
|
215
|
+
allowInput: true,
|
|
216
|
+
enableDate: true,
|
|
217
|
+
enableTime: true,
|
|
218
|
+
defaultValue: [],
|
|
219
|
+
defaultStartDate: null,
|
|
220
|
+
defaultEndDate: null,
|
|
221
|
+
displayInTimezone: 'viewer',
|
|
222
|
+
timezone: '',
|
|
223
|
+
datepickerMode: 'day',
|
|
224
|
+
datePicker: {
|
|
225
|
+
showWeeks: true,
|
|
226
|
+
startingDay: 0,
|
|
227
|
+
initDate: '',
|
|
228
|
+
minMode: 'day',
|
|
229
|
+
maxMode: 'year',
|
|
230
|
+
yearRows: 4,
|
|
231
|
+
yearColumns: 5,
|
|
232
|
+
minDate: null,
|
|
233
|
+
maxDate: null
|
|
234
|
+
},
|
|
235
|
+
timePicker: {
|
|
236
|
+
hourStep: 1,
|
|
237
|
+
minuteStep: 1,
|
|
238
|
+
showMeridian: true,
|
|
239
|
+
readonlyInput: false,
|
|
240
|
+
mousewheel: true,
|
|
241
|
+
arrowkeys: true
|
|
242
|
+
},
|
|
243
|
+
customOptions: {}
|
|
244
|
+
}].concat(extend));
|
|
245
|
+
}
|
|
246
|
+
}, {
|
|
247
|
+
key: "builderInfo",
|
|
248
|
+
get: function get() {
|
|
249
|
+
return {
|
|
250
|
+
title: 'Date / Time Range',
|
|
251
|
+
group: 'advanced',
|
|
252
|
+
icon: 'calendar',
|
|
253
|
+
weight: 41,
|
|
254
|
+
schema: DateTimeRangeComponent.schema()
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
}]);
|
|
258
|
+
}(_Input2.default);
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _default = exports.default = [{
|
|
8
|
+
key: 'multiple',
|
|
9
|
+
ignore: true
|
|
10
|
+
}, {
|
|
11
|
+
type: 'textfield',
|
|
12
|
+
input: true,
|
|
13
|
+
key: 'defaultStartDate',
|
|
14
|
+
label: 'Default Start Date',
|
|
15
|
+
placeholder: 'moment()',
|
|
16
|
+
tooltip: 'You can use Moment.js functions to set the default value to a specific date. For example: \n \n moment().subtract(10, \'days\')',
|
|
17
|
+
weight: 6
|
|
18
|
+
}, {
|
|
19
|
+
type: 'textfield',
|
|
20
|
+
input: true,
|
|
21
|
+
key: 'defaultEndDate',
|
|
22
|
+
label: 'Default End Date',
|
|
23
|
+
placeholder: 'moment()',
|
|
24
|
+
tooltip: 'You can use Moment.js functions to set the default value to a specific date. For example: \n \n moment().subtract(10, \'days\')',
|
|
25
|
+
weight: 7
|
|
26
|
+
}, {
|
|
27
|
+
type: 'textarea',
|
|
28
|
+
as: 'json',
|
|
29
|
+
editor: 'ace',
|
|
30
|
+
weight: 28,
|
|
31
|
+
input: true,
|
|
32
|
+
key: 'customOptions',
|
|
33
|
+
label: 'Flatpickr options',
|
|
34
|
+
tooltip: 'A raw JSON object to use as options for the Date / Time component (Flatpickr).',
|
|
35
|
+
defaultValue: {}
|
|
36
|
+
}];
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _Evaluator = _interopRequireDefault(require("../../../utils/Evaluator"));
|
|
8
|
+
var _utils = _interopRequireDefault(require("../../_classes/component/editForm/utils"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
var _default = exports.default = [{
|
|
11
|
+
type: 'checkbox',
|
|
12
|
+
input: true,
|
|
13
|
+
key: 'enableDate',
|
|
14
|
+
label: 'Enable Date Input',
|
|
15
|
+
weight: 0,
|
|
16
|
+
tooltip: 'Enables date input for this field.'
|
|
17
|
+
}, {
|
|
18
|
+
type: 'tags',
|
|
19
|
+
input: true,
|
|
20
|
+
key: 'datePicker.disable',
|
|
21
|
+
label: 'Disable specific dates or dates by range',
|
|
22
|
+
placeholder: '(yyyy-MM-dd) or (yyyy-MM-dd - yyyy-MM-dd)',
|
|
23
|
+
tooltip: 'Add dates that you want to blacklist. For example: \n \n 2025-02-21',
|
|
24
|
+
validate: {
|
|
25
|
+
custom: 'if (_.isEmpty(input)) {\n return true;\n}\nconst dates = _.isArray(input) ?\ninput : input.split(component.delimeter);\nconst isValid = _.every(dates, (data) => \n !!data.match(/\\d{4}-\\d{2}-\\d{2}/g));\nvalid = isValid || \'Invalid date\';'
|
|
26
|
+
},
|
|
27
|
+
weight: 21
|
|
28
|
+
}, {
|
|
29
|
+
type: 'panel',
|
|
30
|
+
title: 'Custom Disabled Dates',
|
|
31
|
+
collapsible: true,
|
|
32
|
+
collapsed: true,
|
|
33
|
+
style: {
|
|
34
|
+
'margin-bottom': '10px'
|
|
35
|
+
},
|
|
36
|
+
key: 'panel-disable-function',
|
|
37
|
+
customConditional: function customConditional() {
|
|
38
|
+
return !_Evaluator.default.noeval || _Evaluator.default.protectedEval;
|
|
39
|
+
},
|
|
40
|
+
components: [_utils.default.logicVariablesTable('<tr><th>date</th><td>The date object.</td></tr>'), {
|
|
41
|
+
type: 'textarea',
|
|
42
|
+
input: true,
|
|
43
|
+
editor: 'ace',
|
|
44
|
+
key: 'datePicker.disableFunction',
|
|
45
|
+
label: 'Disabling dates by a function',
|
|
46
|
+
description: 'For more information check out the <a href="https://flatpickr.js.org/examples/#disabling-dates" target="_blank">Docs</a>',
|
|
47
|
+
weight: 22
|
|
48
|
+
}, {
|
|
49
|
+
type: 'htmlelement',
|
|
50
|
+
tag: 'div',
|
|
51
|
+
content: '<h4>Example</h4>' + "<pre>// Disable all weekends<br>date.getDay() === 0 || date.getDay() === 6</pre>\n "
|
|
52
|
+
}]
|
|
53
|
+
}, {
|
|
54
|
+
type: 'checkbox',
|
|
55
|
+
input: true,
|
|
56
|
+
key: 'datePicker.disableWeekends',
|
|
57
|
+
label: 'Disable weekends',
|
|
58
|
+
tooltip: 'Check to disable weekends',
|
|
59
|
+
weight: 23
|
|
60
|
+
}, {
|
|
61
|
+
type: 'checkbox',
|
|
62
|
+
input: true,
|
|
63
|
+
key: 'datePicker.disableWeekdays',
|
|
64
|
+
label: 'Disable weekdays',
|
|
65
|
+
tooltip: 'Check to disable weekdays',
|
|
66
|
+
weight: 23
|
|
67
|
+
}];
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _default = exports.default = [{
|
|
8
|
+
type: 'select',
|
|
9
|
+
input: true,
|
|
10
|
+
key: 'displayInTimezone',
|
|
11
|
+
label: 'Display in Timezone',
|
|
12
|
+
tooltip: 'This will display the captured date time in the select timezone.',
|
|
13
|
+
weight: 30,
|
|
14
|
+
defaultValue: 'viewer',
|
|
15
|
+
dataSrc: 'values',
|
|
16
|
+
data: {
|
|
17
|
+
values: [{
|
|
18
|
+
label: 'of Viewer',
|
|
19
|
+
value: 'viewer'
|
|
20
|
+
}, {
|
|
21
|
+
label: 'of Submission',
|
|
22
|
+
value: 'submission'
|
|
23
|
+
}, {
|
|
24
|
+
label: 'of Location',
|
|
25
|
+
value: 'location'
|
|
26
|
+
}, {
|
|
27
|
+
label: 'UTC',
|
|
28
|
+
value: 'utc'
|
|
29
|
+
}]
|
|
30
|
+
}
|
|
31
|
+
}, {
|
|
32
|
+
type: 'select',
|
|
33
|
+
input: true,
|
|
34
|
+
key: 'timezone',
|
|
35
|
+
label: 'Select Timezone',
|
|
36
|
+
tooltip: 'Select the timezone you wish to display this Date',
|
|
37
|
+
weight: 31,
|
|
38
|
+
lazyLoad: true,
|
|
39
|
+
defaultValue: '',
|
|
40
|
+
valueProperty: 'name',
|
|
41
|
+
dataSrc: 'url',
|
|
42
|
+
data: {
|
|
43
|
+
url: '{{options.cdnUrl}}/timezones.json'
|
|
44
|
+
},
|
|
45
|
+
template: '<span>{{ item.label }}</span>',
|
|
46
|
+
conditional: {
|
|
47
|
+
json: {
|
|
48
|
+
'===': [{
|
|
49
|
+
var: 'data.displayInTimezone'
|
|
50
|
+
}, 'location']
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}, {
|
|
54
|
+
type: 'checkbox',
|
|
55
|
+
input: true,
|
|
56
|
+
key: 'useLocaleSettings',
|
|
57
|
+
label: 'Use Locale Settings',
|
|
58
|
+
tooltip: 'Use locale settings to display date and time.',
|
|
59
|
+
weight: 51
|
|
60
|
+
}, {
|
|
61
|
+
type: 'checkbox',
|
|
62
|
+
input: true,
|
|
63
|
+
key: 'allowInput',
|
|
64
|
+
label: 'Allow Manual Input',
|
|
65
|
+
tooltip: 'Check this if you would like to allow the user to manually enter in the date.',
|
|
66
|
+
weight: 51
|
|
67
|
+
}, {
|
|
68
|
+
type: 'textfield',
|
|
69
|
+
input: true,
|
|
70
|
+
key: 'format',
|
|
71
|
+
label: 'Format',
|
|
72
|
+
placeholder: 'Format',
|
|
73
|
+
description: 'Use formats provided by <a href="https://github.com/angular-ui/bootstrap/tree/master/src/dateparser/docs#uibdateparsers-format-codes" target="_blank">DateParser Codes</a>',
|
|
74
|
+
tooltip: 'The date format for displaying the datetime value.',
|
|
75
|
+
weight: 52
|
|
76
|
+
}, {
|
|
77
|
+
type: 'editgrid',
|
|
78
|
+
input: true,
|
|
79
|
+
key: 'shortcutButtons',
|
|
80
|
+
label: 'Shortcut Buttons',
|
|
81
|
+
description: 'You can specify few buttons which will be shown above the calendar. Use Label to specify the name of the button and onClick to specify which date/time will be set when user clicks the button. E.g, date = new Date()',
|
|
82
|
+
templates: {
|
|
83
|
+
header: '<div class="row">\n <div class="col-sm-3">Label</div>\n <div class="col-sm-6">onClick</div>\n</div>',
|
|
84
|
+
row: '<div class="row">\n <div class="col-sm-3">\n {{ flattenedComponents.label.getView(row.label) }}\n </div>\n <div class="col-sm-6">\n {{ flattenedComponents.onClick.getView(row.onClick) }}\n </div>\n {% if (!instance.disabled) { %}\n <div class="col-sm-3">\n <div class="btn-group pull-right">\n <button class="btn btn-default btn-light btn-sm editRow"><i class="{{ iconClass("edit") }}"></i></button>\n {% if (!instance.hasRemoveButtons || instance.hasRemoveButtons()) { %}\n <button class="btn btn-danger btn-sm removeRow"><i class="{{ iconClass("trash") }}"></i></button>\n {% } %}\n </div>\n </div>\n {% } %}\n </div>'
|
|
85
|
+
},
|
|
86
|
+
components: [{
|
|
87
|
+
label: 'Label',
|
|
88
|
+
key: 'label',
|
|
89
|
+
type: 'textfield',
|
|
90
|
+
input: true,
|
|
91
|
+
validate: {
|
|
92
|
+
required: true
|
|
93
|
+
}
|
|
94
|
+
}, {
|
|
95
|
+
label: 'onClick',
|
|
96
|
+
key: 'onClick',
|
|
97
|
+
type: 'textarea',
|
|
98
|
+
editor: 'ace',
|
|
99
|
+
input: true,
|
|
100
|
+
validate: {
|
|
101
|
+
required: true
|
|
102
|
+
}
|
|
103
|
+
}],
|
|
104
|
+
defaultValue: []
|
|
105
|
+
}];
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _default = exports.default = [{
|
|
8
|
+
type: 'checkbox',
|
|
9
|
+
input: true,
|
|
10
|
+
key: 'enableTime',
|
|
11
|
+
label: 'Enable Time Input',
|
|
12
|
+
tooltip: 'Enables time input for this field.',
|
|
13
|
+
weight: 0
|
|
14
|
+
}, {
|
|
15
|
+
type: 'number',
|
|
16
|
+
input: true,
|
|
17
|
+
key: 'timePicker.hourStep',
|
|
18
|
+
label: 'Hour Step Size',
|
|
19
|
+
tooltip: 'The number of hours to increment/decrement in the time picker.',
|
|
20
|
+
weight: 10
|
|
21
|
+
}, {
|
|
22
|
+
type: 'number',
|
|
23
|
+
input: true,
|
|
24
|
+
key: 'timePicker.minuteStep',
|
|
25
|
+
label: 'Minute Step Size',
|
|
26
|
+
tooltip: 'The number of minutes to increment/decrement in the time picker.',
|
|
27
|
+
weight: 20
|
|
28
|
+
}, {
|
|
29
|
+
type: 'checkbox',
|
|
30
|
+
input: true,
|
|
31
|
+
key: 'timePicker.showMeridian',
|
|
32
|
+
label: '12 Hour Time (AM/PM)',
|
|
33
|
+
tooltip: 'Display time in 12 hour time with AM/PM.',
|
|
34
|
+
weight: 30
|
|
35
|
+
}];
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _default = exports.default = [{
|
|
8
|
+
type: 'checkbox',
|
|
9
|
+
input: true,
|
|
10
|
+
key: 'enableMinDateInput',
|
|
11
|
+
label: 'Use Input to add moment.js for minDate',
|
|
12
|
+
persistent: false,
|
|
13
|
+
weight: 10,
|
|
14
|
+
tooltip: 'Enables to use input for moment functions instead of calendar.'
|
|
15
|
+
}, {
|
|
16
|
+
type: 'datetime',
|
|
17
|
+
input: true,
|
|
18
|
+
key: 'datePicker.minDate',
|
|
19
|
+
label: 'Use calendar to set minDate',
|
|
20
|
+
skipMerge: true,
|
|
21
|
+
weight: 10,
|
|
22
|
+
tooltip: 'Enables to use calendar to set date.',
|
|
23
|
+
customConditional: function customConditional(_ref) {
|
|
24
|
+
var data = _ref.data,
|
|
25
|
+
component = _ref.component;
|
|
26
|
+
if (component.datePicker && component.datePicker.minDate && component.datePicker.minDate.indexOf('moment') !== -1) {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
return !data.enableMinDateInput;
|
|
30
|
+
}
|
|
31
|
+
}, {
|
|
32
|
+
type: 'textfield',
|
|
33
|
+
input: true,
|
|
34
|
+
enableTime: false,
|
|
35
|
+
key: 'datePicker.minDate',
|
|
36
|
+
skipMerge: true,
|
|
37
|
+
label: 'Minimum Date',
|
|
38
|
+
weight: 10,
|
|
39
|
+
tooltip: 'The minimum date that can be picked. You can also use Moment.js functions. For example: \n \n moment().subtract(10, \'days\')',
|
|
40
|
+
customConditional: function customConditional(_ref2) {
|
|
41
|
+
var data = _ref2.data,
|
|
42
|
+
component = _ref2.component;
|
|
43
|
+
if (component.datePicker && component.datePicker.minDate && component.datePicker.minDate.indexOf('moment') !== -1) {
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
46
|
+
return data.enableMinDateInput;
|
|
47
|
+
}
|
|
48
|
+
}, {
|
|
49
|
+
type: 'checkbox',
|
|
50
|
+
input: true,
|
|
51
|
+
key: 'enableMaxDateInput',
|
|
52
|
+
label: 'Use Input to add moment.js for maxDate',
|
|
53
|
+
persistent: false,
|
|
54
|
+
weight: 20,
|
|
55
|
+
tooltip: 'Enables to use input for moment functions instead of calendar.'
|
|
56
|
+
}, {
|
|
57
|
+
type: 'datetime',
|
|
58
|
+
input: true,
|
|
59
|
+
key: 'datePicker.maxDate',
|
|
60
|
+
skipMerge: true,
|
|
61
|
+
label: 'Use calendar to set maxDate',
|
|
62
|
+
weight: 20,
|
|
63
|
+
tooltip: 'Enables to use calendar to set date.',
|
|
64
|
+
customConditional: function customConditional(_ref3) {
|
|
65
|
+
var data = _ref3.data,
|
|
66
|
+
component = _ref3.component;
|
|
67
|
+
if (component.datePicker && component.datePicker.maxDate && component.datePicker.maxDate.indexOf('moment') !== -1) {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
return !data.enableMaxDateInput;
|
|
71
|
+
}
|
|
72
|
+
}, {
|
|
73
|
+
type: 'textfield',
|
|
74
|
+
input: true,
|
|
75
|
+
enableTime: false,
|
|
76
|
+
key: 'datePicker.maxDate',
|
|
77
|
+
skipMerge: true,
|
|
78
|
+
label: 'Maximum Date',
|
|
79
|
+
tooltip: 'The maximum date that can be picked. You can also use Moment.js functions. For example: \n \n moment().add(10, \'days\')',
|
|
80
|
+
weight: 20,
|
|
81
|
+
customConditional: function customConditional(_ref4) {
|
|
82
|
+
var data = _ref4.data,
|
|
83
|
+
component = _ref4.component;
|
|
84
|
+
if (component.datePicker && component.datePicker.maxDate && component.datePicker.maxDate.indexOf('moment') !== -1) {
|
|
85
|
+
return true;
|
|
86
|
+
}
|
|
87
|
+
return data.enableMaxDateInput;
|
|
88
|
+
}
|
|
89
|
+
}];
|
package/components/index.js
CHANGED
|
@@ -87,8 +87,10 @@ var _IconButton = _interopRequireDefault(require("./iconButton/IconButton"));
|
|
|
87
87
|
var _ButtonGroups = _interopRequireDefault(require("./buttonGroups/ButtonGroups"));
|
|
88
88
|
var _File2 = _interopRequireDefault(require("./file_china_grid/File"));
|
|
89
89
|
var _Range = _interopRequireDefault(require("./range/Range"));
|
|
90
|
+
var _DateTimeRange = _interopRequireDefault(require("./datetimeRange/DateTimeRange"));
|
|
90
91
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
91
92
|
var _default = exports.default = {
|
|
93
|
+
datetimeRange: _DateTimeRange.default,
|
|
92
94
|
range: _Range.default,
|
|
93
95
|
fileUds: _File2.default,
|
|
94
96
|
map: _Map.default,
|