@planning-inspectorate/dynamic-forms 3.20.2 → 3.20.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@planning-inspectorate/dynamic-forms",
3
- "version": "3.20.2",
3
+ "version": "3.20.3",
4
4
  "description": "This package is for building GDS forms using a configuration-based approach.",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
@@ -61,7 +61,7 @@
61
61
  "prettier": "^3.6.2",
62
62
  "prettier-plugin-organize-imports": "^4.3.0",
63
63
  "prettier-plugin-prisma": "^5.0.0",
64
- "semantic-release": "^25.0.1"
64
+ "semantic-release": "^25.0.9"
65
65
  },
66
66
  "publishConfig": {
67
67
  "access": "public"
@@ -1,3 +1,48 @@
1
- /** @type {Record<string, import('./question.js').Question>} */
2
- export const questionClasses: Record<string, import("./question.js").Question>;
1
+ /**
2
+ * A map of component 'type' (or name') to question class
3
+ *
4
+ * Pass this to `createQuestions` to generate question instances based on the `type` field of `QuestionProps`.
5
+ * To support custom questions, create a new object with these properties and the custom ones,
6
+ * @example
7
+ * ```
8
+ * const classes = {
9
+ * ...questionClasses,
10
+ * ...myCustomQuestions
11
+ * };
12
+ * ```
13
+ */
14
+ export const questionClasses: Readonly<{
15
+ "site-address": typeof AddressQuestion;
16
+ checkbox: typeof CheckboxQuestion;
17
+ boolean: typeof BooleanQuestion;
18
+ radio: typeof RadioQuestion;
19
+ date: typeof DateQuestion;
20
+ "date-period": typeof DatePeriodQuestion;
21
+ "date-time": typeof DateTimeQuestion;
22
+ "text-entry": typeof TextEntryQuestion;
23
+ "text-entry-redact": typeof TextEntryRedactQuestion;
24
+ select: typeof SelectQuestion;
25
+ "single-line-input": typeof SingleLineInputQuestion;
26
+ "multi-field-input": typeof MultiFieldInputQuestion;
27
+ number: typeof NumberEntryQuestion;
28
+ "unit-option": typeof UnitOptionEntryQuestion;
29
+ email: typeof EmailQuestion;
30
+ "manage-list": typeof ManageListQuestion;
31
+ }>;
32
+ import AddressQuestion from '../components/address/question.js';
33
+ import CheckboxQuestion from '../components/checkbox/question.js';
34
+ import BooleanQuestion from '../components/boolean/question.js';
35
+ import RadioQuestion from '../components/radio/question.js';
36
+ import DateQuestion from '../components/date/question.js';
37
+ import DatePeriodQuestion from '../components/date-period/question.js';
38
+ import DateTimeQuestion from '../components/date-time/question.js';
39
+ import TextEntryQuestion from '../components/text-entry/question.js';
40
+ import TextEntryRedactQuestion from '../components/text-entry-redact/question.js';
41
+ import SelectQuestion from '../components/select/question.js';
42
+ import SingleLineInputQuestion from '../components/single-line-input/question.js';
43
+ import MultiFieldInputQuestion from '../components/multi-field-input/question.js';
44
+ import NumberEntryQuestion from '../components/number-entry/question.js';
45
+ import UnitOptionEntryQuestion from '../components/unit-option-entry/question.js';
46
+ import EmailQuestion from '../components/email/question.js';
47
+ import ManageListQuestion from '../components/manage-list/question.js';
3
48
  //# sourceMappingURL=questions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"questions.d.ts","sourceRoot":"","sources":["questions.js"],"names":[],"mappings":"AAsBA,+DAA+D;AAC/D,8BADW,MAAM,CAAC,MAAM,EAAE,OAAO,eAAe,EAAE,QAAQ,CAAC,CAkBxD"}
1
+ {"version":3,"file":"questions.d.ts","sourceRoot":"","sources":["questions.js"],"names":[],"mappings":"AAmBA;;;;;;;;;;;;GAYG;AACH;;;;;;;;;;;;;;;;;GAiBG;4BAjDyB,mCAAmC;6BAClC,oCAAoC;4BACrC,mCAAmC;0BACrC,iCAAiC;yBAClC,gCAAgC;+BAC1B,uCAAuC;6BAWzC,qCAAqC;8BAVpC,sCAAsC;oCAShC,6CAA6C;2BARtD,kCAAkC;oCACzB,6CAA6C;oCAC7C,6CAA6C;gCACjD,wCAAwC;oCACpC,6CAA6C;0BACvD,iCAAiC;+BAK5B,uCAAuC"}
@@ -17,10 +17,19 @@ import TextEntryRedactQuestion from '../components/text-entry-redact/question.js
17
17
  import DateTimeQuestion from '../components/date-time/question.js';
18
18
  import ManageListQuestion from '../components/manage-list/question.js';
19
19
 
20
- // This looks a bit grim because so few of our
21
- // Questions overlap with Question correctly.
22
- // Maybe something to fix at some point
23
- /** @type {Record<string, import('./question.js').Question>} */
20
+ /**
21
+ * A map of component 'type' (or name') to question class
22
+ *
23
+ * Pass this to `createQuestions` to generate question instances based on the `type` field of `QuestionProps`.
24
+ * To support custom questions, create a new object with these properties and the custom ones,
25
+ * @example
26
+ * ```
27
+ * const classes = {
28
+ * ...questionClasses,
29
+ * ...myCustomQuestions
30
+ * };
31
+ * ```
32
+ */
24
33
  export const questionClasses = Object.freeze({
25
34
  [COMPONENT_TYPES.ADDRESS]: AddressQuestion,
26
35
  [COMPONENT_TYPES.CHECKBOX]: CheckboxQuestion,