@ukhomeoffice/formio-gds-template 2.0.2 → 3.0.0-bravo
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/.github/workflows/build-and-test.yml +3 -3
- package/LICENCE.md +21 -0
- package/README.md +8 -0
- package/eslint.config.mjs +59 -0
- package/lib/components/datamap/GDSDataMap.d.ts +5 -14
- package/lib/components/datamap/GDSDataMap.d.ts.map +1 -0
- package/lib/components/datamap/GDSDataMap.js +9 -29
- package/lib/components/datetime/GDSDatetimeComponent.d.ts +43 -22
- package/lib/components/datetime/GDSDatetimeComponent.d.ts.map +1 -0
- package/lib/components/datetime/GDSDatetimeComponent.js +167 -178
- package/lib/components/index.d.ts +3 -0
- package/lib/components/index.d.ts.map +1 -0
- package/lib/components/index.js +6 -4
- package/lib/components/select/GDSSelect.d.ts +143 -0
- package/lib/components/select/GDSSelect.d.ts.map +1 -0
- package/lib/components/select/GDSSelect.js +340 -0
- package/lib/components/selectboxes/GDSCheckBoxes.d.ts +5 -2
- package/lib/components/selectboxes/GDSCheckBoxes.d.ts.map +1 -0
- package/lib/components/selectboxes/GDSCheckBoxes.js +7 -33
- package/lib/components/time/GDSTimeComponent.d.ts +13 -10
- package/lib/components/time/GDSTimeComponent.d.ts.map +1 -0
- package/lib/components/time/GDSTimeComponent.js +59 -84
- package/lib/components/util/TimeHelper.d.ts +6 -4
- package/lib/components/util/TimeHelper.d.ts.map +1 -0
- package/lib/components/util/TimeHelper.js +13 -16
- package/lib/index.d.ts +4 -2
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +2 -2
- package/lib/templates/gds/button/index.d.ts +1 -0
- package/lib/templates/gds/button/index.d.ts.map +1 -0
- package/lib/templates/gds/button/index.js +1 -1
- package/lib/templates/gds/checkbox/index.d.ts +1 -0
- package/lib/templates/gds/checkbox/index.d.ts.map +1 -0
- package/lib/templates/gds/checkbox/index.js +1 -1
- package/lib/templates/gds/columns/index.d.ts +1 -0
- package/lib/templates/gds/columns/index.d.ts.map +1 -0
- package/lib/templates/gds/columns/index.js +1 -1
- package/lib/templates/gds/component/index.d.ts +1 -0
- package/lib/templates/gds/component/index.d.ts.map +1 -0
- package/lib/templates/gds/component/index.js +1 -1
- package/lib/templates/gds/container/index.d.ts +1 -0
- package/lib/templates/gds/container/index.d.ts.map +1 -0
- package/lib/templates/gds/container/index.js +1 -1
- package/lib/templates/gds/cssClasses.d.ts +1 -0
- package/lib/templates/gds/cssClasses.d.ts.map +1 -0
- package/lib/templates/gds/datagrid/form.ejs.js +2 -2
- package/lib/templates/gds/datagrid/index.d.ts +1 -0
- package/lib/templates/gds/datagrid/index.d.ts.map +1 -0
- package/lib/templates/gds/datagrid/index.js +1 -1
- package/lib/templates/gds/datamap/index.d.ts +1 -0
- package/lib/templates/gds/datamap/index.d.ts.map +1 -0
- package/lib/templates/gds/datamap/index.js +1 -1
- package/lib/templates/gds/datetime/index.d.ts +1 -0
- package/lib/templates/gds/datetime/index.d.ts.map +1 -0
- package/lib/templates/gds/datetime/index.js +1 -1
- package/lib/templates/gds/day/index.d.ts +1 -0
- package/lib/templates/gds/day/index.d.ts.map +1 -0
- package/lib/templates/gds/day/index.js +1 -1
- package/lib/templates/gds/editgrid/index.d.ts +1 -0
- package/lib/templates/gds/editgrid/index.d.ts.map +1 -0
- package/lib/templates/gds/editgrid/index.js +1 -1
- package/lib/templates/gds/field/index.d.ts +1 -0
- package/lib/templates/gds/field/index.d.ts.map +1 -0
- package/lib/templates/gds/field/index.js +1 -1
- package/lib/templates/gds/fieldset/index.d.ts +1 -0
- package/lib/templates/gds/fieldset/index.d.ts.map +1 -0
- package/lib/templates/gds/fieldset/index.js +1 -1
- package/lib/templates/gds/file/index.d.ts +1 -0
- package/lib/templates/gds/file/index.d.ts.map +1 -0
- package/lib/templates/gds/file/index.js +1 -1
- package/lib/templates/gds/iconClass.d.ts +2 -1
- package/lib/templates/gds/iconClass.d.ts.map +1 -0
- package/lib/templates/gds/iconClass.js +3 -3
- package/lib/templates/gds/index.d.ts +3 -2
- package/lib/templates/gds/index.d.ts.map +1 -0
- package/lib/templates/gds/index.js +72 -64
- package/lib/templates/gds/input/index.d.ts +1 -0
- package/lib/templates/gds/input/index.d.ts.map +1 -0
- package/lib/templates/gds/input/index.js +1 -1
- package/lib/templates/gds/label/index.d.ts +1 -0
- package/lib/templates/gds/label/index.d.ts.map +1 -0
- package/lib/templates/gds/label/index.js +1 -1
- package/lib/templates/gds/message/index.d.ts +1 -0
- package/lib/templates/gds/message/index.d.ts.map +1 -0
- package/lib/templates/gds/message/index.js +1 -1
- package/lib/templates/gds/panel/index.d.ts +1 -0
- package/lib/templates/gds/panel/index.d.ts.map +1 -0
- package/lib/templates/gds/panel/index.js +1 -1
- package/lib/templates/gds/radio/index.d.ts +1 -0
- package/lib/templates/gds/radio/index.d.ts.map +1 -0
- package/lib/templates/gds/radio/index.js +1 -1
- package/lib/templates/gds/select/index.d.ts +1 -0
- package/lib/templates/gds/select/index.d.ts.map +1 -0
- package/lib/templates/gds/select/index.js +1 -1
- package/lib/templates/gds/selectOption/index.d.ts +1 -0
- package/lib/templates/gds/selectOption/index.d.ts.map +1 -0
- package/lib/templates/gds/selectOption/index.js +1 -1
- package/lib/templates/gds/selectboxes/index.d.ts +1 -0
- package/lib/templates/gds/selectboxes/index.d.ts.map +1 -0
- package/lib/templates/gds/selectboxes/index.js +1 -1
- package/lib/templates/gds/survey/index.d.ts +1 -0
- package/lib/templates/gds/survey/index.d.ts.map +1 -0
- package/lib/templates/gds/survey/index.js +1 -1
- package/lib/templates/gds/tab/index.d.ts +1 -0
- package/lib/templates/gds/tab/index.d.ts.map +1 -0
- package/lib/templates/gds/tab/index.js +1 -1
- package/lib/templates/gds/table/index.d.ts +1 -0
- package/lib/templates/gds/table/index.d.ts.map +1 -0
- package/lib/templates/gds/table/index.js +1 -1
- package/lib/templates/gds/template.css +27 -0
- package/lib/templates/gds/template.css.map +1 -1
- package/lib/templates/gds/time/index.d.ts +1 -0
- package/lib/templates/gds/time/index.d.ts.map +1 -0
- package/lib/templates/gds/time/index.js +1 -1
- package/lib/templates/gds/warning/index.d.ts +1 -0
- package/lib/templates/gds/warning/index.d.ts.map +1 -0
- package/lib/templates/gds/warning/index.js +1 -1
- package/lib/templates/gds/wizard/index.d.ts +1 -0
- package/lib/templates/gds/wizard/index.d.ts.map +1 -0
- package/lib/templates/gds/wizard/index.js +1 -1
- package/lib/templates/gds/wizardHeader/index.d.ts +1 -0
- package/lib/templates/gds/wizardHeader/index.d.ts.map +1 -0
- package/lib/templates/gds/wizardHeader/index.js +1 -1
- package/lib/templates/gds/wizardNav/index.d.ts +1 -0
- package/lib/templates/gds/wizardNav/index.d.ts.map +1 -0
- package/lib/templates/gds/wizardNav/index.js +1 -1
- package/lib/templates/index.d.ts +3 -2
- package/lib/templates/index.d.ts.map +1 -0
- package/lib/templates/index.js +1 -1
- package/lib/types.d.ts +37 -0
- package/lib/types.d.ts.map +1 -0
- package/lib/types.js +2 -0
- package/package.json +14 -7
- package/src/components/datamap/GDSDataMap.ts +5 -14
- package/src/components/datetime/GDSDatetimeComponent.ts +128 -91
- package/src/components/index.ts +2 -0
- package/src/components/select/GDSSelect.spec.ts +538 -0
- package/src/components/select/GDSSelect.ts +418 -0
- 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/datagrid/form.ejs +1 -2
- package/src/templates/gds/iconClass.ts +1 -1
- package/src/templates/gds/index.ts +43 -33
- package/src/templates/gds/template.scss +48 -1
- package/src/types.ts +56 -0
- package/tsconfig.json +21 -5
- package/webpack.config.js +1 -1
- package/tslint.json +0 -22
|
@@ -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 };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/templates/gds/panel/index.ts"],"names":[],"mappings":";;;AAEA,wBAAwB"}
|
|
@@ -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 };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/templates/gds/radio/index.ts"],"names":[],"mappings":";;;AAEA,wBAAsB"}
|
|
@@ -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 };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/templates/gds/select/index.ts"],"names":[],"mappings":";;;AAEA,wBAAwB"}
|
|
@@ -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 };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/templates/gds/selectOption/index.ts"],"names":[],"mappings":";;;AAEA,wBAAwB"}
|
|
@@ -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 };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/templates/gds/selectboxes/index.ts"],"names":[],"mappings":";;;AAEA,wBAAwB"}
|
|
@@ -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 };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/templates/gds/survey/index.ts"],"names":[],"mappings":";;;AAEA,wBAAwB"}
|
|
@@ -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 };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/templates/gds/tab/index.ts"],"names":[],"mappings":";;;AAEA,wBAAwB"}
|
|
@@ -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 };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/templates/gds/table/index.ts"],"names":[],"mappings":";;;AACA,wBAAwB"}
|
|
@@ -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 };
|
|
@@ -112,6 +112,25 @@
|
|
|
112
112
|
.govuk-details {
|
|
113
113
|
margin-bottom: 0 !important;
|
|
114
114
|
}
|
|
115
|
+
.govuk-details__summary {
|
|
116
|
+
font-weight: 400 !important;
|
|
117
|
+
}
|
|
118
|
+
.govuk-details__summary-text, .govuk-details__summary:hover .govuk-details__summary-text {
|
|
119
|
+
text-decoration: none;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.formio-component-datagrid > [ref=messageContainer],
|
|
123
|
+
.formio-component-editgrid > [ref=messageContainer],
|
|
124
|
+
.formio-component-datamap > [ref=messageContainer],
|
|
125
|
+
.formio-component-panel > [ref=messageContainer],
|
|
126
|
+
.formio-component-container > [ref=messageContainer],
|
|
127
|
+
.formio-component-fieldset > [ref=messageContainer] {
|
|
128
|
+
display: none;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.formio-hidden {
|
|
132
|
+
display: none !important;
|
|
133
|
+
}
|
|
115
134
|
|
|
116
135
|
.small-button {
|
|
117
136
|
padding: 0.25rem 0.5rem;
|
|
@@ -132,6 +151,10 @@
|
|
|
132
151
|
border-top: none;
|
|
133
152
|
}
|
|
134
153
|
|
|
154
|
+
.datagrid-tbody {
|
|
155
|
+
overflow-x: hidden;
|
|
156
|
+
}
|
|
157
|
+
|
|
135
158
|
.gov-accordion-no-bottom {
|
|
136
159
|
border-bottom: none !important;
|
|
137
160
|
}
|
|
@@ -168,4 +191,8 @@
|
|
|
168
191
|
height: auto;
|
|
169
192
|
}
|
|
170
193
|
|
|
194
|
+
.govuk-form-group--error .govuk-form-group {
|
|
195
|
+
overflow: visible;
|
|
196
|
+
}
|
|
197
|
+
|
|
171
198
|
/*# sourceMappingURL=template.css.map */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sourceRoot":"","sources":["../../../src/templates/gds/template.scss","../../../node_modules/govuk-frontend/dist/govuk/vendor/_sass-mq.scss"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKE;EACE;EACA;EACA;;AAGF;AAAA;EAEE;EACA;EACA;;;AAKJ;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;;;AAGF;EACE;IACE;;EAEF;IACE;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;EAGF;IACE;;EAGF;IACE;IACA;;EAGF;IACE;;EAEF;IACE;;;AAKJ;EACE;;;AAGF;EACE;EACA;EACA;;;AAIF;EACE;;AAEA;EACE;EAGA;;;AAKJ;EACE;EACA;;;AAGF;EACE;;;
|
|
1
|
+
{"version":3,"sourceRoot":"","sources":["../../../src/templates/gds/template.scss","../../../node_modules/govuk-frontend/dist/govuk/vendor/_sass-mq.scss"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKE;EACE;EACA;EACA;;AAGF;AAAA;EAEE;EACA;EACA;;;AAKJ;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;;;AAGF;EACE;IACE;;EAEF;IACE;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;EAGF;IACE;;EAGF;IACE;IACA;;EAGF;IACE;;EAEF;IACE;;;AAKJ;EACE;;AAGA;EACE;;AAGF;EAEE;;;AAaF;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;;;AAMJ;EACE;;;AAGF;EACE;EACA;EACA;;;AAIF;EACE;;AAEA;EACE;EAGA;;;AAKJ;EACE;EACA;;;AAMF;EACE;;;AAGF;EACE;;;ACgFM;ED3EJ;IACE;;;;AAMJ;EADF;IAEI;IACA;IACA;IACA;IACA;;;;AAIJ;EACE;EACA;EACA;;;AAGF;EACE;EACA;EACA;;;AAGF;EACE;;;AAQA;EACE","file":"template.css"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/templates/gds/time/index.ts"],"names":[],"mappings":";;;AAEA,wBAAwB"}
|
|
@@ -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 };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/templates/gds/warning/index.ts"],"names":[],"mappings":";;;AAEA,wBAAwB"}
|
|
@@ -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 };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/templates/gds/wizard/index.ts"],"names":[],"mappings":";;;AAEA,wBAAsB"}
|
|
@@ -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 };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/templates/gds/wizardHeader/index.ts"],"names":[],"mappings":";;;AACA,wBAAwB"}
|
|
@@ -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 };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/templates/gds/wizardNav/index.ts"],"names":[],"mappings":";;;AAEA,wBAAsB"}
|
|
@@ -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 };
|
package/lib/templates/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
2
|
gds: {
|
|
3
|
-
transform(type:
|
|
3
|
+
transform(type: string, text: string): string;
|
|
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;
|
|
@@ -106,3 +106,4 @@ declare const _default: {
|
|
|
106
106
|
};
|
|
107
107
|
};
|
|
108
108
|
export default _default;
|
|
109
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/templates/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,wBAEE"}
|
package/lib/templates/index.js
CHANGED
|
@@ -3,7 +3,7 @@ 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 gds_1 = __importDefault(require("./gds"));
|
|
7
7
|
exports.default = {
|
|
8
8
|
gds: gds_1.default,
|
|
9
9
|
};
|
package/lib/types.d.ts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { DayComponent, DateTimeComponent, TimeComponent as CoreTimeComponent, SelectBoxesComponent, DataMapComponent, SelectComponent } from '@formio/core';
|
|
2
|
+
/**
|
|
3
|
+
* Minimal interface for DOM input-like elements.
|
|
4
|
+
* Used as the typed parameter in TimeHelper methods so callers can pass any
|
|
5
|
+
* object that has a writable `.value: string` (e.g. HTMLInputElement).
|
|
6
|
+
*/
|
|
7
|
+
export interface InputElementLike {
|
|
8
|
+
value: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The shape of a single GDS date/time field definition.
|
|
12
|
+
* Extends the base formio field definition with an optional placeholder.
|
|
13
|
+
*/
|
|
14
|
+
export type GDSFieldDefinition = {
|
|
15
|
+
type?: string;
|
|
16
|
+
placeholder?: string;
|
|
17
|
+
required?: boolean;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Component schema for GDSDatetimeComponent.
|
|
21
|
+
*
|
|
22
|
+
* GDSDatetimeComponent extends the formio Day component but adds hour/minute
|
|
23
|
+
* fields (from a datetime hybrid) and uses datePicker / defaultDate from
|
|
24
|
+
* DateTimeComponent. This type captures the full shape of `this.component`
|
|
25
|
+
* as used in GDSDatetimeComponent.
|
|
26
|
+
*/
|
|
27
|
+
export type GDSDatetimeComponentSchema = Omit<DayComponent, 'suffix' | 'fields'> & Pick<DateTimeComponent, 'datePicker' | 'defaultDate'> & {
|
|
28
|
+
/** suffix is set to null in init() — null must be allowed */
|
|
29
|
+
suffix?: string | null;
|
|
30
|
+
/** fields extended with GDS hour/minute additions */
|
|
31
|
+
fields: DayComponent['fields'] & {
|
|
32
|
+
hour?: GDSFieldDefinition;
|
|
33
|
+
minute?: GDSFieldDefinition;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
export type { CoreTimeComponent, SelectBoxesComponent, DataMapComponent, SelectComponent };
|
|
37
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,YAAY,EACZ,iBAAiB,EACjB,aAAa,IAAI,iBAAiB,EAClC,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EAClB,MAAM,cAAc,CAAC;AAEtB;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC7B,KAAK,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,0BAA0B,GAKlC,IAAI,CAAC,YAAY,EAAE,QAAQ,GAAG,QAAQ,CAAC,GACvC,IAAI,CAAC,iBAAiB,EAAE,YAAY,GAAG,aAAa,CAAC,GAAG;IACpD,6DAA6D;IAC7D,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,qDAAqD;IACrD,MAAM,EAAE,YAAY,CAAC,QAAQ,CAAC,GAAG;QAC7B,IAAI,CAAC,EAAE,kBAAkB,CAAC;QAC1B,MAAM,CAAC,EAAE,kBAAkB,CAAC;KAC/B,CAAC;CACL,CAAC;AAKN,YAAY,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,eAAe,EAAE,CAAC"}
|
package/lib/types.js
ADDED
package/package.json
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ukhomeoffice/formio-gds-template",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Gov UK design system formio templates",
|
|
3
|
+
"version": "3.0.0-bravo",
|
|
4
|
+
"description": "Gov UK design system formio templates — upgraded to @formio/js@5.x",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
8
8
|
"main": "lib/index.js",
|
|
9
|
+
"types": "lib/index.d.ts",
|
|
9
10
|
"scripts": {
|
|
11
|
+
"prepack": "npm run build",
|
|
12
|
+
"yalc:push": "npm run build && yalc push",
|
|
10
13
|
"test:coverage": "nyc --reporter=text mocha --reporter spec './{,!(node_modules)/**/}*.spec.js'",
|
|
11
14
|
"test": "mocha --require ts-node/register --reporter spec './{,!(node_modules)/**/}*.spec.ts'",
|
|
12
15
|
"build-sass": "sass src/templates/gds/template.scss lib/templates/gds/template.css",
|
|
@@ -15,8 +18,8 @@
|
|
|
15
18
|
"watch": "concurrently \"npm run watch-ts\" \"npm run watch-sass\"",
|
|
16
19
|
"build": "tsc && gulp templates && npm run build-sass && webpack",
|
|
17
20
|
"tag": "VERSION=$(cat package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[\",]//g' | tr -d '[[:space:]]');git add -A; git commit -nm \"Build $Version\";git push origin master;git tag v$VERSION;git push origin --tags;",
|
|
18
|
-
"lint": "
|
|
19
|
-
"lint:fix": "
|
|
21
|
+
"lint": "eslint 'src/**/*.ts'",
|
|
22
|
+
"lint:fix": "eslint 'src/**/*.ts' --fix",
|
|
20
23
|
"prepublish": "npm run build"
|
|
21
24
|
},
|
|
22
25
|
"pre-commit": [
|
|
@@ -40,13 +43,15 @@
|
|
|
40
43
|
},
|
|
41
44
|
"homepage": "https://github.com/UKHomeOffice/formio-gds-template#readme",
|
|
42
45
|
"peerDependencies": {
|
|
43
|
-
"
|
|
46
|
+
"@formio/core": "^2.0.0",
|
|
47
|
+
"@formio/js": "^5.0.0",
|
|
44
48
|
"govuk-frontend": "^5.0.0"
|
|
45
49
|
},
|
|
46
50
|
"dependencies": {
|
|
47
51
|
"lodash": "4.17.21"
|
|
48
52
|
},
|
|
49
53
|
"devDependencies": {
|
|
54
|
+
"@formio/core": "^2.0.0",
|
|
50
55
|
"@types/chai": "^4.3.16",
|
|
51
56
|
"@types/ejs": "^3.1.5",
|
|
52
57
|
"@types/lodash": "^4.17.5",
|
|
@@ -58,7 +63,7 @@
|
|
|
58
63
|
"chai": "^5.1.1",
|
|
59
64
|
"concurrently": "^8.2.2",
|
|
60
65
|
"css-loader": "^7.1.2",
|
|
61
|
-
"
|
|
66
|
+
"@formio/js": "^5.0.0",
|
|
62
67
|
"govuk-frontend": "^5.4.0",
|
|
63
68
|
"gulp": "^4.0.2",
|
|
64
69
|
"gulp-insert": "^0.5.0",
|
|
@@ -74,7 +79,9 @@
|
|
|
74
79
|
"style-loader": "^4.0.0",
|
|
75
80
|
"ts-node": "^10.9.2",
|
|
76
81
|
"ts-sinon": "^2.0.2",
|
|
77
|
-
"
|
|
82
|
+
"eslint": "^9.0.0",
|
|
83
|
+
"@typescript-eslint/parser": "^8.0.0",
|
|
84
|
+
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
78
85
|
"typed-scss-modules": "^8.0.1",
|
|
79
86
|
"typescript": "^5.5.2",
|
|
80
87
|
"webpack": "^5.92.1",
|
|
@@ -1,23 +1,14 @@
|
|
|
1
|
-
import {Components} from '
|
|
1
|
+
import { Components } from '@formio/js';
|
|
2
|
+
import { DataMapComponent } from '../../types';
|
|
2
3
|
|
|
3
4
|
const Field = Components.components.field;
|
|
4
5
|
const DataMap = Components.components.datamap;
|
|
5
6
|
|
|
6
7
|
export default class GDSDataMap extends DataMap {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
private getGroups: any;
|
|
10
|
-
private visibleColumns: any;
|
|
11
|
-
private hasAddButton: any;
|
|
12
|
-
private hasRemoveButtons: any;
|
|
13
|
-
private hasTopSubmit: any;
|
|
14
|
-
private hasBottomSubmit: any;
|
|
15
|
-
private hasExtraColumn: any;
|
|
16
|
-
private datagridKey: any;
|
|
17
|
-
private allowReorder: any;
|
|
18
|
-
private getColumns: any;
|
|
8
|
+
// Narrow the inherited `component: any` using the @formio/core DataMapComponent schema.
|
|
9
|
+
declare component: DataMapComponent;
|
|
19
10
|
|
|
20
|
-
public render() {
|
|
11
|
+
public render(): string {
|
|
21
12
|
const columns = this.getColumns();
|
|
22
13
|
return Field.prototype.render.call(this, this.renderTemplate('datamap', {
|
|
23
14
|
rows: this.getRows(),
|