@ukhomeoffice/formio-gds-template 2.0.2 → 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/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 +148 -178
- package/lib/components/index.js +4 -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 +59 -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 +2 -2
- package/lib/templates/gds/button/index.js +1 -1
- package/lib/templates/gds/checkbox/index.js +1 -1
- package/lib/templates/gds/columns/index.js +1 -1
- package/lib/templates/gds/component/index.js +1 -1
- package/lib/templates/gds/container/index.js +1 -1
- package/lib/templates/gds/datagrid/index.js +1 -1
- package/lib/templates/gds/datamap/index.js +1 -1
- package/lib/templates/gds/datetime/index.js +1 -1
- package/lib/templates/gds/day/index.js +1 -1
- package/lib/templates/gds/editgrid/index.js +1 -1
- package/lib/templates/gds/field/index.js +1 -1
- package/lib/templates/gds/fieldset/index.js +1 -1
- package/lib/templates/gds/file/index.js +1 -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 +72 -64
- package/lib/templates/gds/input/index.js +1 -1
- package/lib/templates/gds/label/index.js +1 -1
- package/lib/templates/gds/message/index.js +1 -1
- package/lib/templates/gds/panel/index.js +1 -1
- package/lib/templates/gds/radio/index.js +1 -1
- package/lib/templates/gds/select/index.js +1 -1
- package/lib/templates/gds/selectOption/index.js +1 -1
- package/lib/templates/gds/selectboxes/index.js +1 -1
- package/lib/templates/gds/survey/index.js +1 -1
- package/lib/templates/gds/tab/index.js +1 -1
- package/lib/templates/gds/table/index.js +1 -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 +1 -1
- package/lib/templates/gds/warning/index.js +1 -1
- package/lib/templates/gds/wizard/index.js +1 -1
- package/lib/templates/gds/wizardHeader/index.js +1 -1
- package/lib/templates/gds/wizardNav/index.js +1 -1
- package/lib/templates/index.d.ts +2 -2
- package/lib/templates/index.js +1 -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 +109 -91
- package/src/components/selectboxes/GDSCheckBoxes.ts +7 -8
- package/src/components/time/GDSTimeComponent.ts +37 -27
- package/src/components/util/TimeHelper.ts +6 -5
- package/src/css.d.ts +4 -0
- 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 +6 -3
- package/webpack.config.js +1 -1
- package/tslint.json +0 -22
|
@@ -1,111 +1,86 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
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));
|
|
25
|
-
};
|
|
26
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
27
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
28
4
|
};
|
|
29
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
40
|
-
_this.timeHelper = new TimeHelper_1.default();
|
|
41
|
-
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();
|
|
42
15
|
}
|
|
43
|
-
|
|
44
|
-
|
|
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) {
|
|
45
19
|
this.loadRefs(element, {
|
|
46
20
|
hour: 'single',
|
|
47
21
|
minute: 'single',
|
|
48
22
|
});
|
|
49
|
-
this.addEventListener(this.refs.hour, 'input',
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
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 });
|
|
54
28
|
});
|
|
55
|
-
this.addEventListener(this.refs.minute, 'input',
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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 });
|
|
60
34
|
});
|
|
61
|
-
this.addEventListener(this.refs.hour, 'keypress',
|
|
62
|
-
|
|
35
|
+
this.addEventListener(this.refs.hour, 'keypress', (evt) => {
|
|
36
|
+
this.timeHelper.preventNonNumericKeyPress(evt);
|
|
63
37
|
});
|
|
64
|
-
this.addEventListener(this.refs.minute, 'keypress',
|
|
65
|
-
|
|
38
|
+
this.addEventListener(this.refs.minute, 'keypress', (evt) => {
|
|
39
|
+
this.timeHelper.preventNonNumericKeyPress(evt);
|
|
66
40
|
});
|
|
67
|
-
return
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}
|
|
86
|
-
|
|
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() {
|
|
87
61
|
if (!this.refs.hour.value || !this.refs.minute.value) {
|
|
88
62
|
return '';
|
|
89
63
|
}
|
|
90
|
-
|
|
64
|
+
const value = `${this.refs.hour.value}:${this.refs.minute.value}`;
|
|
91
65
|
return (0, moment_1.default)(value, this.component.format).format(this.component.dataFormat);
|
|
92
|
-
}
|
|
93
|
-
|
|
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) {
|
|
94
70
|
if (this.refs.hour && this.refs.minute && value) {
|
|
95
|
-
|
|
71
|
+
const parts = value.split(':');
|
|
96
72
|
this.refs.hour.value = parts[0];
|
|
97
73
|
this.refs.minute.value = parts[1];
|
|
98
74
|
return true;
|
|
99
75
|
}
|
|
100
76
|
return false;
|
|
101
|
-
}
|
|
102
|
-
|
|
77
|
+
}
|
|
78
|
+
render() {
|
|
103
79
|
return Field.prototype.render.call(this, this.renderTemplate('time', {
|
|
104
|
-
hour:
|
|
105
|
-
minute:
|
|
80
|
+
hour: super.getValue().split(':')[0],
|
|
81
|
+
minute: super.getValue().split(':')[1],
|
|
106
82
|
}));
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
}(Time));
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
GDSTimeComponent.MAX_LENGTH = 2;
|
|
111
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
|
@@ -3,8 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
const components_1 = __importDefault(require("./components"));
|
|
7
|
+
const templates_1 = __importDefault(require("./templates"));
|
|
8
8
|
exports.default = {
|
|
9
9
|
framework: 'gds',
|
|
10
10
|
templates: templates_1.default,
|
|
@@ -3,5 +3,5 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
6
|
+
const form_ejs_1 = __importDefault(require("./form.ejs"));
|
|
7
7
|
exports.default = { form: form_ejs_1.default };
|
|
@@ -3,5 +3,5 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
6
|
+
const form_ejs_1 = __importDefault(require("./form.ejs"));
|
|
7
7
|
exports.default = { form: form_ejs_1.default };
|
|
@@ -3,5 +3,5 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
6
|
+
const form_ejs_1 = __importDefault(require("./form.ejs"));
|
|
7
7
|
exports.default = { form: form_ejs_1.default };
|
|
@@ -3,5 +3,5 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
6
|
+
const form_ejs_1 = __importDefault(require("./form.ejs"));
|
|
7
7
|
exports.default = { form: form_ejs_1.default };
|
|
@@ -3,5 +3,5 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
6
|
+
const form_ejs_1 = __importDefault(require("./form.ejs"));
|
|
7
7
|
exports.default = { form: form_ejs_1.default };
|
|
@@ -3,5 +3,5 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
6
|
+
const form_ejs_1 = __importDefault(require("./form.ejs"));
|
|
7
7
|
exports.default = { form: form_ejs_1.default };
|
|
@@ -3,5 +3,5 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
6
|
+
const form_ejs_1 = __importDefault(require("./form.ejs"));
|
|
7
7
|
exports.default = { form: form_ejs_1.default };
|
|
@@ -3,5 +3,5 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
6
|
+
const form_ejs_1 = __importDefault(require("./form.ejs"));
|
|
7
7
|
exports.default = { form: form_ejs_1.default };
|
|
@@ -3,5 +3,5 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
6
|
+
const form_ejs_1 = __importDefault(require("./form.ejs"));
|
|
7
7
|
exports.default = { form: form_ejs_1.default };
|
|
@@ -3,5 +3,5 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
6
|
+
const form_ejs_1 = __importDefault(require("./form.ejs"));
|
|
7
7
|
exports.default = { form: form_ejs_1.default };
|
|
@@ -3,5 +3,5 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
6
|
+
const form_ejs_1 = __importDefault(require("./form.ejs"));
|
|
7
7
|
exports.default = { form: form_ejs_1.default };
|
|
@@ -3,5 +3,5 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
6
|
+
const form_ejs_1 = __importDefault(require("./form.ejs"));
|
|
7
7
|
exports.default = { form: form_ejs_1.default };
|
|
@@ -3,5 +3,5 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
6
|
+
const form_ejs_1 = __importDefault(require("./form.ejs"));
|
|
7
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;
|
|
@@ -3,78 +3,86 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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"));
|
|
32
32
|
require("./template.css");
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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;
|
|
38
43
|
exports.default = {
|
|
39
|
-
transform
|
|
44
|
+
transform(type, text) {
|
|
40
45
|
if (!text) {
|
|
41
46
|
return text;
|
|
42
47
|
}
|
|
43
48
|
if (type === 'class') {
|
|
44
|
-
|
|
49
|
+
const key = text.toString();
|
|
50
|
+
return Object.prototype.hasOwnProperty.call(this.cssClasses, key)
|
|
51
|
+
? this.cssClasses[key]
|
|
52
|
+
: text;
|
|
45
53
|
}
|
|
46
54
|
return text;
|
|
47
55
|
},
|
|
48
56
|
defaultIconset: 'fa',
|
|
49
|
-
iconClass: iconClass_1.default,
|
|
50
|
-
cssClasses: cssClasses_1.default,
|
|
51
|
-
button: button_1.default,
|
|
52
|
-
checkbox: checkbox_1.default,
|
|
53
|
-
columns: columns_1.default,
|
|
54
|
-
component: component_1.default,
|
|
55
|
-
container: container_1.default,
|
|
56
|
-
datetime: datetime_1.default,
|
|
57
|
-
day: day_1.default,
|
|
58
|
-
datagrid: datagrid_1.default,
|
|
59
|
-
datamap: datamap_1.default,
|
|
60
|
-
input: input_1.default,
|
|
61
|
-
editgrid: editgrid_1.default,
|
|
62
|
-
field: field_1.default,
|
|
63
|
-
file: file_1.default,
|
|
64
|
-
fieldset: fieldset_1.default,
|
|
65
|
-
label: label_1.default,
|
|
66
|
-
message: message_1.default,
|
|
67
|
-
panel: panel_1.default,
|
|
68
|
-
radio: radio_1.default,
|
|
69
|
-
select: select_1.default,
|
|
70
|
-
selectboxes: selectboxes_1.default,
|
|
71
|
-
selectOption: selectOption_1.default,
|
|
72
|
-
survey: survey_1.default,
|
|
73
|
-
table: table_1.default,
|
|
74
|
-
tab: tab_1.default,
|
|
75
|
-
time: time_1.default,
|
|
76
|
-
warning: warning_1.default,
|
|
77
|
-
wizard: wizard_1.default,
|
|
78
|
-
wizardHeader: wizardHeader_1.default,
|
|
79
|
-
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),
|
|
80
88
|
};
|
|
@@ -3,5 +3,5 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
6
|
+
const form_ejs_1 = __importDefault(require("./form.ejs"));
|
|
7
7
|
exports.default = { form: form_ejs_1.default };
|
|
@@ -3,5 +3,5 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
6
|
+
const form_ejs_1 = __importDefault(require("./form.ejs"));
|
|
7
7
|
exports.default = { form: form_ejs_1.default };
|
|
@@ -3,5 +3,5 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
6
|
+
const form_ejs_1 = __importDefault(require("./form.ejs"));
|
|
7
7
|
exports.default = { form: form_ejs_1.default };
|
|
@@ -3,5 +3,5 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
6
|
+
const form_ejs_1 = __importDefault(require("./form.ejs"));
|
|
7
7
|
exports.default = { form: form_ejs_1.default };
|
|
@@ -3,5 +3,5 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
6
|
+
const form_ejs_1 = __importDefault(require("./form.ejs"));
|
|
7
7
|
exports.default = { form: form_ejs_1.default };
|
|
@@ -3,5 +3,5 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
6
|
+
const form_ejs_1 = __importDefault(require("./form.ejs"));
|
|
7
7
|
exports.default = { form: form_ejs_1.default };
|
|
@@ -3,5 +3,5 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
6
|
+
const form_ejs_1 = __importDefault(require("./form.ejs"));
|
|
7
7
|
exports.default = { form: form_ejs_1.default };
|