@ukhomeoffice/formio-gds-template 2.0.1 → 3.0.0-alpha
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/LICENCE.md +21 -0
- package/README.md +3 -1
- package/eslint.config.mjs +58 -0
- package/lib/components/datamap/GDSDataMap.d.ts +4 -14
- package/lib/components/datamap/GDSDataMap.js +9 -29
- package/lib/components/datetime/GDSDatetimeComponent.d.ts +30 -22
- package/lib/components/datetime/GDSDatetimeComponent.js +172 -176
- package/lib/components/index.js +7 -4
- package/lib/components/selectboxes/GDSCheckBoxes.d.ts +4 -2
- package/lib/components/selectboxes/GDSCheckBoxes.js +7 -33
- package/lib/components/time/GDSTimeComponent.d.ts +12 -10
- package/lib/components/time/GDSTimeComponent.js +62 -84
- package/lib/components/util/TimeHelper.d.ts +5 -4
- package/lib/components/util/TimeHelper.js +13 -16
- package/lib/index.d.ts +2 -2
- package/lib/index.js +5 -2
- package/lib/templates/gds/button/index.js +4 -1
- package/lib/templates/gds/checkbox/index.js +4 -1
- package/lib/templates/gds/columns/index.js +4 -1
- package/lib/templates/gds/component/index.js +4 -1
- package/lib/templates/gds/container/index.js +4 -1
- package/lib/templates/gds/datagrid/form.ejs.js +1 -1
- package/lib/templates/gds/datagrid/index.js +4 -1
- package/lib/templates/gds/datamap/index.js +4 -1
- package/lib/templates/gds/datetime/index.js +4 -1
- package/lib/templates/gds/day/index.js +4 -1
- package/lib/templates/gds/editgrid/index.js +4 -1
- package/lib/templates/gds/field/index.js +4 -1
- package/lib/templates/gds/fieldset/index.js +4 -1
- package/lib/templates/gds/file/index.js +4 -1
- package/lib/templates/gds/iconClass.d.ts +1 -1
- package/lib/templates/gds/iconClass.js +3 -3
- package/lib/templates/gds/index.d.ts +2 -2
- package/lib/templates/gds/index.js +75 -64
- package/lib/templates/gds/input/index.js +4 -1
- package/lib/templates/gds/label/index.js +4 -1
- package/lib/templates/gds/message/index.js +4 -1
- package/lib/templates/gds/panel/index.js +4 -1
- package/lib/templates/gds/radio/index.js +4 -1
- package/lib/templates/gds/select/index.js +4 -1
- package/lib/templates/gds/selectOption/index.js +4 -1
- package/lib/templates/gds/selectboxes/index.js +4 -1
- package/lib/templates/gds/survey/index.js +4 -1
- package/lib/templates/gds/tab/index.js +4 -1
- package/lib/templates/gds/table/index.js +4 -1
- package/lib/templates/gds/template.css +16 -0
- package/lib/templates/gds/template.css.map +1 -1
- package/lib/templates/gds/time/index.js +4 -1
- package/lib/templates/gds/warning/index.js +4 -1
- package/lib/templates/gds/wizard/index.js +4 -1
- package/lib/templates/gds/wizardHeader/index.js +4 -1
- package/lib/templates/gds/wizardNav/index.js +4 -1
- package/lib/templates/index.d.ts +2 -2
- package/lib/templates/index.js +4 -1
- package/lib/types.d.ts +36 -0
- package/lib/types.js +2 -0
- package/package.json +13 -7
- package/src/components/datamap/GDSDataMap.ts +5 -14
- package/src/components/datetime/GDSDatetimeComponent.ts +110 -92
- package/src/components/selectboxes/GDSCheckBoxes.ts +7 -8
- package/src/components/time/GDSTimeComponent.ts +38 -28
- package/src/components/util/TimeHelper.ts +6 -5
- package/src/css.d.ts +4 -0
- package/src/templates/gds/datagrid/form.ejs +1 -1
- package/src/templates/gds/iconClass.ts +1 -1
- package/src/templates/gds/index.ts +43 -33
- package/src/templates/gds/template.scss +30 -1
- package/src/types.ts +55 -0
- package/tsconfig.json +8 -4
- package/webpack.config.js +1 -1
- package/dist/gds.js +0 -2
- package/dist/gds.js.LICENSE.txt +0 -41
- package/tslint.json +0 -22
|
@@ -1,108 +1,86 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
18
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
19
|
-
if (ar || !(i in from)) {
|
|
20
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
21
|
-
ar[i] = from[i];
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
25
4
|
};
|
|
26
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
37
|
-
_this.timeHelper = new TimeHelper_1.default();
|
|
38
|
-
return _this;
|
|
6
|
+
const js_1 = require("@formio/js");
|
|
7
|
+
const moment_1 = __importDefault(require("moment"));
|
|
8
|
+
const TimeHelper_1 = __importDefault(require("../util/TimeHelper"));
|
|
9
|
+
const Field = js_1.Components.components.field;
|
|
10
|
+
const Time = js_1.Components.components.time;
|
|
11
|
+
class GDSTimeComponent extends Time {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
14
|
+
this.timeHelper = new TimeHelper_1.default();
|
|
39
15
|
}
|
|
40
|
-
|
|
41
|
-
|
|
16
|
+
// element typed as `any` to match the base component attach(element: any) override signature
|
|
17
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
18
|
+
attach(element) {
|
|
42
19
|
this.loadRefs(element, {
|
|
43
20
|
hour: 'single',
|
|
44
21
|
minute: 'single',
|
|
45
22
|
});
|
|
46
|
-
this.addEventListener(this.refs.hour, 'input',
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
23
|
+
this.addEventListener(this.refs.hour, 'input', () => {
|
|
24
|
+
this.timeHelper.checkAndValidateHour(this.refs.hour);
|
|
25
|
+
this.setPristine(false);
|
|
26
|
+
this.checkComponentValidity(this.data, true);
|
|
27
|
+
this.updateValue(null, { modified: true });
|
|
51
28
|
});
|
|
52
|
-
this.addEventListener(this.refs.minute, 'input',
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
29
|
+
this.addEventListener(this.refs.minute, 'input', () => {
|
|
30
|
+
this.timeHelper.checkAndValidateMinutes(this.refs.minute);
|
|
31
|
+
this.setPristine(false);
|
|
32
|
+
this.checkComponentValidity(this.data, true);
|
|
33
|
+
this.updateValue(null, { modified: true });
|
|
57
34
|
});
|
|
58
|
-
this.addEventListener(this.refs.hour, 'keypress',
|
|
59
|
-
|
|
35
|
+
this.addEventListener(this.refs.hour, 'keypress', (evt) => {
|
|
36
|
+
this.timeHelper.preventNonNumericKeyPress(evt);
|
|
60
37
|
});
|
|
61
|
-
this.addEventListener(this.refs.minute, 'keypress',
|
|
62
|
-
|
|
38
|
+
this.addEventListener(this.refs.minute, 'keypress', (evt) => {
|
|
39
|
+
this.timeHelper.preventNonNumericKeyPress(evt);
|
|
63
40
|
});
|
|
64
|
-
return
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
83
|
-
|
|
41
|
+
return super.attach(element);
|
|
42
|
+
}
|
|
43
|
+
// elements typed as `any` to match the base Day.setErrorClasses(elements: any, ...) override signature
|
|
44
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
45
|
+
setErrorClasses(elements, dirty, hasError) {
|
|
46
|
+
super.setErrorClasses([this.refs.hour, this.refs.minute, ...elements], dirty, hasError);
|
|
47
|
+
}
|
|
48
|
+
// message/dirty/element typed as `any` to match the base Component.addInputError(message: any, dirty: any, elements: any) signature
|
|
49
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
50
|
+
addInputError(message, dirty, element) {
|
|
51
|
+
super.addInputError(message, dirty, [this.refs.hour, this.refs.minute]);
|
|
52
|
+
super.addInputError(message, dirty, element);
|
|
53
|
+
}
|
|
54
|
+
// elements typed as `any` to match the base Component.removeInputError(elements: any) signature
|
|
55
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
56
|
+
removeInputError(elements) {
|
|
57
|
+
super.removeInputError([this.refs.hour, this.refs.minute]);
|
|
58
|
+
super.removeInputError(elements);
|
|
59
|
+
}
|
|
60
|
+
getValue() {
|
|
84
61
|
if (!this.refs.hour.value || !this.refs.minute.value) {
|
|
85
62
|
return '';
|
|
86
63
|
}
|
|
87
|
-
|
|
88
|
-
return
|
|
89
|
-
}
|
|
90
|
-
|
|
64
|
+
const value = `${this.refs.hour.value}:${this.refs.minute.value}`;
|
|
65
|
+
return (0, moment_1.default)(value, this.component.format).format(this.component.dataFormat);
|
|
66
|
+
}
|
|
67
|
+
// value/flags typed as `any` to match the base Component.setValue(value: any, flags: any) override signature
|
|
68
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
69
|
+
setValue(value, _flags) {
|
|
91
70
|
if (this.refs.hour && this.refs.minute && value) {
|
|
92
|
-
|
|
71
|
+
const parts = value.split(':');
|
|
93
72
|
this.refs.hour.value = parts[0];
|
|
94
73
|
this.refs.minute.value = parts[1];
|
|
95
74
|
return true;
|
|
96
75
|
}
|
|
97
76
|
return false;
|
|
98
|
-
}
|
|
99
|
-
|
|
77
|
+
}
|
|
78
|
+
render() {
|
|
100
79
|
return Field.prototype.render.call(this, this.renderTemplate('time', {
|
|
101
|
-
hour:
|
|
102
|
-
minute:
|
|
80
|
+
hour: super.getValue().split(':')[0],
|
|
81
|
+
minute: super.getValue().split(':')[1],
|
|
103
82
|
}));
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
}(Time));
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
GDSTimeComponent.MAX_LENGTH = 2;
|
|
108
86
|
exports.default = GDSTimeComponent;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { InputElementLike } from '../../types';
|
|
1
2
|
export default class TimeHelper {
|
|
2
3
|
static MAX_LENGTH: number;
|
|
3
|
-
checkAndValidateMinutes(element:
|
|
4
|
-
checkAndValidateHour(element:
|
|
5
|
-
preventNonNumericKeyPress(evt:
|
|
6
|
-
validateDateInput(element:
|
|
4
|
+
checkAndValidateMinutes(element: InputElementLike): void;
|
|
5
|
+
checkAndValidateHour(element: InputElementLike): void;
|
|
6
|
+
preventNonNumericKeyPress(evt: KeyboardEvent): void;
|
|
7
|
+
validateDateInput(element: InputElementLike, length: number): void;
|
|
7
8
|
}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
TimeHelper.prototype.checkAndValidateMinutes = function (element) {
|
|
3
|
+
class TimeHelper {
|
|
4
|
+
checkAndValidateMinutes(element) {
|
|
7
5
|
if (element.value) {
|
|
8
6
|
if (element.value.length > TimeHelper.MAX_LENGTH) {
|
|
9
7
|
element.value = element.value.slice(0, 2);
|
|
10
8
|
}
|
|
11
|
-
|
|
9
|
+
const minuteAsNumber = parseInt(element.value, 10);
|
|
12
10
|
if (minuteAsNumber > 59) {
|
|
13
11
|
element.value = '59';
|
|
14
12
|
}
|
|
@@ -16,13 +14,13 @@ var TimeHelper = /** @class */ (function () {
|
|
|
16
14
|
element.value = '00';
|
|
17
15
|
}
|
|
18
16
|
}
|
|
19
|
-
}
|
|
20
|
-
|
|
17
|
+
}
|
|
18
|
+
checkAndValidateHour(element) {
|
|
21
19
|
if (element.value) {
|
|
22
20
|
if (element.value.length > TimeHelper.MAX_LENGTH) {
|
|
23
21
|
element.value = element.value.slice(0, 2);
|
|
24
22
|
}
|
|
25
|
-
|
|
23
|
+
const hourAsNumber = parseInt(element.value, 10);
|
|
26
24
|
if (hourAsNumber > 23) {
|
|
27
25
|
element.value = '23';
|
|
28
26
|
}
|
|
@@ -30,18 +28,17 @@ var TimeHelper = /** @class */ (function () {
|
|
|
30
28
|
element.value = '00';
|
|
31
29
|
}
|
|
32
30
|
}
|
|
33
|
-
}
|
|
34
|
-
|
|
31
|
+
}
|
|
32
|
+
preventNonNumericKeyPress(evt) {
|
|
35
33
|
if (evt.which !== 8 && evt.which !== 0 && evt.which < 48 || evt.which > 57) {
|
|
36
34
|
evt.preventDefault();
|
|
37
35
|
}
|
|
38
|
-
}
|
|
39
|
-
|
|
36
|
+
}
|
|
37
|
+
validateDateInput(element, length) {
|
|
40
38
|
if (element.value && element.value.length > length) {
|
|
41
39
|
element.value = element.value.slice(0, length);
|
|
42
40
|
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}());
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
TimeHelper.MAX_LENGTH = 2;
|
|
47
44
|
exports.default = TimeHelper;
|
package/lib/index.d.ts
CHANGED
|
@@ -2,9 +2,9 @@ declare const _default: {
|
|
|
2
2
|
framework: string;
|
|
3
3
|
templates: {
|
|
4
4
|
gds: {
|
|
5
|
-
transform(type:
|
|
5
|
+
transform(type: string, text: string): any;
|
|
6
6
|
defaultIconset: string;
|
|
7
|
-
iconClass: (iconset:
|
|
7
|
+
iconClass: (iconset: string, name: string, spinning: boolean) => string;
|
|
8
8
|
cssClasses: {
|
|
9
9
|
'has-error': string;
|
|
10
10
|
'formio-tab-link-container-active': string;
|
package/lib/index.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
6
|
+
const components_1 = __importDefault(require("./components"));
|
|
7
|
+
const templates_1 = __importDefault(require("./templates"));
|
|
5
8
|
exports.default = {
|
|
6
9
|
framework: 'gds',
|
|
7
10
|
templates: templates_1.default,
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
6
|
+
const form_ejs_1 = __importDefault(require("./form.ejs"));
|
|
4
7
|
exports.default = { form: form_ejs_1.default };
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
6
|
+
const form_ejs_1 = __importDefault(require("./form.ejs"));
|
|
4
7
|
exports.default = { form: form_ejs_1.default };
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
6
|
+
const form_ejs_1 = __importDefault(require("./form.ejs"));
|
|
4
7
|
exports.default = { form: form_ejs_1.default };
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
6
|
+
const form_ejs_1 = __importDefault(require("./form.ejs"));
|
|
4
7
|
exports.default = { form: form_ejs_1.default };
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
6
|
+
const form_ejs_1 = __importDefault(require("./form.ejs"));
|
|
4
7
|
exports.default = { form: form_ejs_1.default };
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
6
|
+
const form_ejs_1 = __importDefault(require("./form.ejs"));
|
|
4
7
|
exports.default = { form: form_ejs_1.default };
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
6
|
+
const form_ejs_1 = __importDefault(require("./form.ejs"));
|
|
4
7
|
exports.default = { form: form_ejs_1.default };
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
6
|
+
const form_ejs_1 = __importDefault(require("./form.ejs"));
|
|
4
7
|
exports.default = { form: form_ejs_1.default };
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
6
|
+
const form_ejs_1 = __importDefault(require("./form.ejs"));
|
|
4
7
|
exports.default = { form: form_ejs_1.default };
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
6
|
+
const form_ejs_1 = __importDefault(require("./form.ejs"));
|
|
4
7
|
exports.default = { form: form_ejs_1.default };
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
6
|
+
const form_ejs_1 = __importDefault(require("./form.ejs"));
|
|
4
7
|
exports.default = { form: form_ejs_1.default };
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
6
|
+
const form_ejs_1 = __importDefault(require("./form.ejs"));
|
|
4
7
|
exports.default = { form: form_ejs_1.default };
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
6
|
+
const form_ejs_1 = __importDefault(require("./form.ejs"));
|
|
4
7
|
exports.default = { form: form_ejs_1.default };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: (iconset:
|
|
1
|
+
declare const _default: (iconset: string, name: string, spinning: boolean) => string;
|
|
2
2
|
export default _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = (
|
|
3
|
+
exports.default = (iconset, name, spinning) => {
|
|
4
4
|
if (iconset === 'fa') {
|
|
5
5
|
switch (name) {
|
|
6
6
|
case 'save':
|
|
@@ -26,5 +26,5 @@ exports.default = (function (iconset, name, spinning) {
|
|
|
26
26
|
break;
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
-
return spinning ?
|
|
30
|
-
}
|
|
29
|
+
return spinning ? `${iconset} ${iconset}-${name} ${iconset}-spin` : `${iconset} ${iconset}-${name}`;
|
|
30
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import './template.css';
|
|
2
2
|
declare const _default: {
|
|
3
|
-
transform(type:
|
|
3
|
+
transform(type: string, text: string): any;
|
|
4
4
|
defaultIconset: string;
|
|
5
|
-
iconClass: (iconset:
|
|
5
|
+
iconClass: (iconset: string, name: string, spinning: boolean) => string;
|
|
6
6
|
cssClasses: {
|
|
7
7
|
'has-error': string;
|
|
8
8
|
'formio-tab-link-container-active': string;
|
|
@@ -1,77 +1,88 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
6
|
+
const button_1 = __importDefault(require("./button"));
|
|
7
|
+
const checkbox_1 = __importDefault(require("./checkbox"));
|
|
8
|
+
const columns_1 = __importDefault(require("./columns"));
|
|
9
|
+
const component_1 = __importDefault(require("./component"));
|
|
10
|
+
const container_1 = __importDefault(require("./container"));
|
|
11
|
+
const cssClasses_1 = __importDefault(require("./cssClasses"));
|
|
12
|
+
const datagrid_1 = __importDefault(require("./datagrid"));
|
|
13
|
+
const datamap_1 = __importDefault(require("./datamap"));
|
|
14
|
+
const datetime_1 = __importDefault(require("./datetime"));
|
|
15
|
+
const day_1 = __importDefault(require("./day"));
|
|
16
|
+
const editgrid_1 = __importDefault(require("./editgrid"));
|
|
17
|
+
const field_1 = __importDefault(require("./field"));
|
|
18
|
+
const file_1 = __importDefault(require("./file"));
|
|
19
|
+
const fieldset_1 = __importDefault(require("./fieldset"));
|
|
20
|
+
const iconClass_1 = __importDefault(require("./iconClass"));
|
|
21
|
+
const input_1 = __importDefault(require("./input"));
|
|
22
|
+
const label_1 = __importDefault(require("./label"));
|
|
23
|
+
const message_1 = __importDefault(require("./message"));
|
|
24
|
+
const panel_1 = __importDefault(require("./panel"));
|
|
25
|
+
const radio_1 = __importDefault(require("./radio"));
|
|
26
|
+
const select_1 = __importDefault(require("./select"));
|
|
27
|
+
const selectboxes_1 = __importDefault(require("./selectboxes"));
|
|
28
|
+
const selectOption_1 = __importDefault(require("./selectOption"));
|
|
29
|
+
const survey_1 = __importDefault(require("./survey"));
|
|
30
|
+
const tab_1 = __importDefault(require("./tab"));
|
|
31
|
+
const table_1 = __importDefault(require("./table"));
|
|
29
32
|
require("./template.css");
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
const time_1 = __importDefault(require("./time"));
|
|
34
|
+
const warning_1 = __importDefault(require("./warning"));
|
|
35
|
+
const wizard_1 = __importDefault(require("./wizard"));
|
|
36
|
+
const wizardHeader_1 = __importDefault(require("./wizardHeader"));
|
|
37
|
+
const wizardNav_1 = __importDefault(require("./wizardNav"));
|
|
38
|
+
// Unwrap CJS default exports to handle ESM/CJS interop in Vite.
|
|
39
|
+
// Uses a generic so the return type matches the input type — no `any` needed.
|
|
40
|
+
const unwrap = (mod) => (mod !== null && typeof mod === 'object' && 'default' in mod)
|
|
41
|
+
? mod.default
|
|
42
|
+
: mod;
|
|
35
43
|
exports.default = {
|
|
36
|
-
transform
|
|
44
|
+
transform(type, text) {
|
|
37
45
|
if (!text) {
|
|
38
46
|
return text;
|
|
39
47
|
}
|
|
40
48
|
if (type === 'class') {
|
|
41
|
-
|
|
49
|
+
const key = text.toString();
|
|
50
|
+
return Object.prototype.hasOwnProperty.call(this.cssClasses, key)
|
|
51
|
+
? this.cssClasses[key]
|
|
52
|
+
: text;
|
|
42
53
|
}
|
|
43
54
|
return text;
|
|
44
55
|
},
|
|
45
56
|
defaultIconset: 'fa',
|
|
46
|
-
iconClass: iconClass_1.default,
|
|
47
|
-
cssClasses: cssClasses_1.default,
|
|
48
|
-
button: button_1.default,
|
|
49
|
-
checkbox: checkbox_1.default,
|
|
50
|
-
columns: columns_1.default,
|
|
51
|
-
component: component_1.default,
|
|
52
|
-
container: container_1.default,
|
|
53
|
-
datetime: datetime_1.default,
|
|
54
|
-
day: day_1.default,
|
|
55
|
-
datagrid: datagrid_1.default,
|
|
56
|
-
datamap: datamap_1.default,
|
|
57
|
-
input: input_1.default,
|
|
58
|
-
editgrid: editgrid_1.default,
|
|
59
|
-
field: field_1.default,
|
|
60
|
-
file: file_1.default,
|
|
61
|
-
fieldset: fieldset_1.default,
|
|
62
|
-
label: label_1.default,
|
|
63
|
-
message: message_1.default,
|
|
64
|
-
panel: panel_1.default,
|
|
65
|
-
radio: radio_1.default,
|
|
66
|
-
select: select_1.default,
|
|
67
|
-
selectboxes: selectboxes_1.default,
|
|
68
|
-
selectOption: selectOption_1.default,
|
|
69
|
-
survey: survey_1.default,
|
|
70
|
-
table: table_1.default,
|
|
71
|
-
tab: tab_1.default,
|
|
72
|
-
time: time_1.default,
|
|
73
|
-
warning: warning_1.default,
|
|
74
|
-
wizard: wizard_1.default,
|
|
75
|
-
wizardHeader: wizardHeader_1.default,
|
|
76
|
-
wizardNav: wizardNav_1.default,
|
|
57
|
+
iconClass: unwrap(iconClass_1.default),
|
|
58
|
+
cssClasses: unwrap(cssClasses_1.default),
|
|
59
|
+
button: unwrap(button_1.default),
|
|
60
|
+
checkbox: unwrap(checkbox_1.default),
|
|
61
|
+
columns: unwrap(columns_1.default),
|
|
62
|
+
component: unwrap(component_1.default),
|
|
63
|
+
container: unwrap(container_1.default),
|
|
64
|
+
datetime: unwrap(datetime_1.default),
|
|
65
|
+
day: unwrap(day_1.default),
|
|
66
|
+
datagrid: unwrap(datagrid_1.default),
|
|
67
|
+
datamap: unwrap(datamap_1.default),
|
|
68
|
+
input: unwrap(input_1.default),
|
|
69
|
+
editgrid: unwrap(editgrid_1.default),
|
|
70
|
+
field: unwrap(field_1.default),
|
|
71
|
+
file: unwrap(file_1.default),
|
|
72
|
+
fieldset: unwrap(fieldset_1.default),
|
|
73
|
+
label: unwrap(label_1.default),
|
|
74
|
+
message: unwrap(message_1.default),
|
|
75
|
+
panel: unwrap(panel_1.default),
|
|
76
|
+
radio: unwrap(radio_1.default),
|
|
77
|
+
select: unwrap(select_1.default),
|
|
78
|
+
selectboxes: unwrap(selectboxes_1.default),
|
|
79
|
+
selectOption: unwrap(selectOption_1.default),
|
|
80
|
+
survey: unwrap(survey_1.default),
|
|
81
|
+
table: unwrap(table_1.default),
|
|
82
|
+
tab: unwrap(tab_1.default),
|
|
83
|
+
time: unwrap(time_1.default),
|
|
84
|
+
warning: unwrap(warning_1.default),
|
|
85
|
+
wizard: unwrap(wizard_1.default),
|
|
86
|
+
wizardHeader: unwrap(wizardHeader_1.default),
|
|
87
|
+
wizardNav: unwrap(wizardNav_1.default),
|
|
77
88
|
};
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
6
|
+
const form_ejs_1 = __importDefault(require("./form.ejs"));
|
|
4
7
|
exports.default = { form: form_ejs_1.default };
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
6
|
+
const form_ejs_1 = __importDefault(require("./form.ejs"));
|
|
4
7
|
exports.default = { form: form_ejs_1.default };
|