@defra/forms-model 3.0.439 → 3.0.441

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.
@@ -3,10 +3,10 @@ export let FormStatus = /*#__PURE__*/function (FormStatus) {
3
3
  FormStatus["Live"] = "live";
4
4
  return FormStatus;
5
5
  }({});
6
- export let ApiErrorFunctionCode = /*#__PURE__*/function (ApiErrorFunctionCode) {
7
- ApiErrorFunctionCode["General"] = "General";
8
- ApiErrorFunctionCode["DuplicatePagePathPage"] = "DuplicatePagePathPage";
9
- ApiErrorFunctionCode["DuplicatePagePathQuestion"] = "DuplicatePagePathQuestion";
10
- return ApiErrorFunctionCode;
6
+ export let ApiErrorCode = /*#__PURE__*/function (ApiErrorCode) {
7
+ ApiErrorCode["General"] = "General";
8
+ ApiErrorCode["DuplicatePagePathPage"] = "DuplicatePagePathPage";
9
+ ApiErrorCode["DuplicatePagePathComponent"] = "DuplicatePagePathComponent";
10
+ return ApiErrorCode;
11
11
  }({});
12
12
  //# sourceMappingURL=enums.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"enums.js","names":["FormStatus","ApiErrorFunctionCode"],"sources":["../../../src/common/enums.ts"],"sourcesContent":["export enum FormStatus {\n Draft = 'draft',\n Live = 'live'\n}\n\nexport enum ApiErrorFunctionCode {\n General = 'General',\n DuplicatePagePathPage = 'DuplicatePagePathPage',\n DuplicatePagePathQuestion = 'DuplicatePagePathQuestion'\n}\n"],"mappings":"AAAA,WAAYA,UAAU,0BAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAA,OAAVA,UAAU;AAAA;AAKtB,WAAYC,oBAAoB,0BAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAAA,OAApBA,oBAAoB;AAAA","ignoreList":[]}
1
+ {"version":3,"file":"enums.js","names":["FormStatus","ApiErrorCode"],"sources":["../../../src/common/enums.ts"],"sourcesContent":["export enum FormStatus {\n Draft = 'draft',\n Live = 'live'\n}\n\nexport enum ApiErrorCode {\n General = 'General',\n DuplicatePagePathPage = 'DuplicatePagePathPage',\n DuplicatePagePathComponent = 'DuplicatePagePathComponent'\n}\n"],"mappings":"AAAA,WAAYA,UAAU,0BAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAA,OAAVA,UAAU;AAAA;AAKtB,WAAYC,YAAY,0BAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAA,OAAZA,YAAY;AAAA","ignoreList":[]}
@@ -0,0 +1,48 @@
1
+ export const allDocumentTypes = [{
2
+ value: 'pdf',
3
+ text: 'PDF',
4
+ mimeType: 'application/pdf'
5
+ }, {
6
+ value: 'doc',
7
+ text: 'DOC',
8
+ mimeType: 'application/msword'
9
+ }, {
10
+ value: 'docx',
11
+ text: 'DOCX',
12
+ mimeType: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
13
+ }, {
14
+ value: 'odt',
15
+ text: 'ODT',
16
+ mimeType: 'application/vnd.oasis.opendocument.text'
17
+ }, {
18
+ value: 'txt',
19
+ text: 'TXT',
20
+ mimeType: 'text/plain'
21
+ }];
22
+ export const allImageTypes = [{
23
+ value: 'jpg',
24
+ text: 'JPG',
25
+ mimeType: 'image/jpeg'
26
+ }, {
27
+ value: 'png',
28
+ text: 'PNG',
29
+ mimeType: 'image/png'
30
+ }];
31
+ export const allTabularDataTypes = [{
32
+ value: 'xls',
33
+ text: 'XLS',
34
+ mimeType: 'application/vnd.ms-excel'
35
+ }, {
36
+ value: 'xlsx',
37
+ text: 'XLSX',
38
+ mimeType: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
39
+ }, {
40
+ value: 'csv',
41
+ text: 'CSV',
42
+ mimeType: 'text/csv'
43
+ }, {
44
+ value: 'ods',
45
+ text: 'ODS',
46
+ mimeType: 'application/vnd.oasis.opendocument.spreadsheet'
47
+ }];
48
+ //# sourceMappingURL=file-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-types.js","names":["allDocumentTypes","value","text","mimeType","allImageTypes","allTabularDataTypes"],"sources":["../../../src/components/file-types.ts"],"sourcesContent":["export const allDocumentTypes = [\n { value: 'pdf', text: 'PDF', mimeType: 'application/pdf' },\n { value: 'doc', text: 'DOC', mimeType: 'application/msword' },\n {\n value: 'docx',\n text: 'DOCX',\n mimeType:\n 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'\n },\n {\n value: 'odt',\n text: 'ODT',\n mimeType: 'application/vnd.oasis.opendocument.text'\n },\n { value: 'txt', text: 'TXT', mimeType: 'text/plain' }\n]\n\nexport const allImageTypes = [\n { value: 'jpg', text: 'JPG', mimeType: 'image/jpeg' },\n { value: 'png', text: 'PNG', mimeType: 'image/png' }\n]\nexport const allTabularDataTypes = [\n { value: 'xls', text: 'XLS', mimeType: 'application/vnd.ms-excel' },\n {\n value: 'xlsx',\n text: 'XLSX',\n mimeType:\n 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'\n },\n { value: 'csv', text: 'CSV', mimeType: 'text/csv' },\n {\n value: 'ods',\n text: 'ODS',\n mimeType: 'application/vnd.oasis.opendocument.spreadsheet'\n }\n]\n"],"mappings":"AAAA,OAAO,MAAMA,gBAAgB,GAAG,CAC9B;EAAEC,KAAK,EAAE,KAAK;EAAEC,IAAI,EAAE,KAAK;EAAEC,QAAQ,EAAE;AAAkB,CAAC,EAC1D;EAAEF,KAAK,EAAE,KAAK;EAAEC,IAAI,EAAE,KAAK;EAAEC,QAAQ,EAAE;AAAqB,CAAC,EAC7D;EACEF,KAAK,EAAE,MAAM;EACbC,IAAI,EAAE,MAAM;EACZC,QAAQ,EACN;AACJ,CAAC,EACD;EACEF,KAAK,EAAE,KAAK;EACZC,IAAI,EAAE,KAAK;EACXC,QAAQ,EAAE;AACZ,CAAC,EACD;EAAEF,KAAK,EAAE,KAAK;EAAEC,IAAI,EAAE,KAAK;EAAEC,QAAQ,EAAE;AAAa,CAAC,CACtD;AAED,OAAO,MAAMC,aAAa,GAAG,CAC3B;EAAEH,KAAK,EAAE,KAAK;EAAEC,IAAI,EAAE,KAAK;EAAEC,QAAQ,EAAE;AAAa,CAAC,EACrD;EAAEF,KAAK,EAAE,KAAK;EAAEC,IAAI,EAAE,KAAK;EAAEC,QAAQ,EAAE;AAAY,CAAC,CACrD;AACD,OAAO,MAAME,mBAAmB,GAAG,CACjC;EAAEJ,KAAK,EAAE,KAAK;EAAEC,IAAI,EAAE,KAAK;EAAEC,QAAQ,EAAE;AAA2B,CAAC,EACnE;EACEF,KAAK,EAAE,MAAM;EACbC,IAAI,EAAE,MAAM;EACZC,QAAQ,EACN;AACJ,CAAC,EACD;EAAEF,KAAK,EAAE,KAAK;EAAEC,IAAI,EAAE,KAAK;EAAEC,QAAQ,EAAE;AAAW,CAAC,EACnD;EACEF,KAAK,EAAE,KAAK;EACZC,IAAI,EAAE,KAAK;EACXC,QAAQ,EAAE;AACZ,CAAC,CACF","ignoreList":[]}
@@ -1,4 +1,5 @@
1
1
  export { ComponentTypes } from "./component-types.js";
2
2
  export { getComponentDefaults, hasConditionSupport, hasContent, hasContentField, hasFormField, hasHint, hasInputField, hasListField, hasSelectionFields, hasTitle, isConditionalType, isContentType, isFormType, isListType } from "./helpers.js";
3
+ export { allDocumentTypes, allImageTypes, allTabularDataTypes } from "./file-types.js";
3
4
  export { ComponentType } from "./enums.js";
4
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["ComponentTypes","getComponentDefaults","hasConditionSupport","hasContent","hasContentField","hasFormField","hasHint","hasInputField","hasListField","hasSelectionFields","hasTitle","isConditionalType","isContentType","isFormType","isListType","ComponentType"],"sources":["../../../src/components/index.ts"],"sourcesContent":["export { ComponentTypes } from '~/src/components/component-types.js'\nexport {\n getComponentDefaults,\n hasConditionSupport,\n hasContent,\n hasContentField,\n hasFormField,\n hasHint,\n hasInputField,\n hasListField,\n hasSelectionFields,\n hasTitle,\n isConditionalType,\n isContentType,\n isFormType,\n isListType\n} from '~/src/components/helpers.js'\n\nexport { ComponentType } from '~/src/components/enums.js'\n"],"mappings":"AAAA,SAASA,cAAc;AACvB,SACEC,oBAAoB,EACpBC,mBAAmB,EACnBC,UAAU,EACVC,eAAe,EACfC,YAAY,EACZC,OAAO,EACPC,aAAa,EACbC,YAAY,EACZC,kBAAkB,EAClBC,QAAQ,EACRC,iBAAiB,EACjBC,aAAa,EACbC,UAAU,EACVC,UAAU;AAGZ,SAASC,aAAa","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["ComponentTypes","getComponentDefaults","hasConditionSupport","hasContent","hasContentField","hasFormField","hasHint","hasInputField","hasListField","hasSelectionFields","hasTitle","isConditionalType","isContentType","isFormType","isListType","allDocumentTypes","allImageTypes","allTabularDataTypes","ComponentType"],"sources":["../../../src/components/index.ts"],"sourcesContent":["export { ComponentTypes } from '~/src/components/component-types.js'\nexport {\n getComponentDefaults,\n hasConditionSupport,\n hasContent,\n hasContentField,\n hasFormField,\n hasHint,\n hasInputField,\n hasListField,\n hasSelectionFields,\n hasTitle,\n isConditionalType,\n isContentType,\n isFormType,\n isListType\n} from '~/src/components/helpers.js'\nexport {\n allDocumentTypes,\n allImageTypes,\n allTabularDataTypes\n} from '~/src/components/file-types.js'\nexport { ComponentType } from '~/src/components/enums.js'\n"],"mappings":"AAAA,SAASA,cAAc;AACvB,SACEC,oBAAoB,EACpBC,mBAAmB,EACnBC,UAAU,EACVC,eAAe,EACfC,YAAY,EACZC,OAAO,EACPC,aAAa,EACbC,YAAY,EACZC,kBAAkB,EAClBC,QAAQ,EACRC,iBAAiB,EACjBC,aAAa,EACbC,UAAU,EACVC,UAAU;AAEZ,SACEC,gBAAgB,EAChBC,aAAa,EACbC,mBAAmB;AAErB,SAASC,aAAa","ignoreList":[]}
@@ -2,9 +2,9 @@ export declare enum FormStatus {
2
2
  Draft = "draft",
3
3
  Live = "live"
4
4
  }
5
- export declare enum ApiErrorFunctionCode {
5
+ export declare enum ApiErrorCode {
6
6
  General = "General",
7
7
  DuplicatePagePathPage = "DuplicatePagePathPage",
8
- DuplicatePagePathQuestion = "DuplicatePagePathQuestion"
8
+ DuplicatePagePathComponent = "DuplicatePagePathComponent"
9
9
  }
10
10
  //# sourceMappingURL=enums.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"enums.d.ts","sourceRoot":"","sources":["../../../src/common/enums.ts"],"names":[],"mappings":"AAAA,oBAAY,UAAU;IACpB,KAAK,UAAU;IACf,IAAI,SAAS;CACd;AAED,oBAAY,oBAAoB;IAC9B,OAAO,YAAY;IACnB,qBAAqB,0BAA0B;IAC/C,yBAAyB,8BAA8B;CACxD"}
1
+ {"version":3,"file":"enums.d.ts","sourceRoot":"","sources":["../../../src/common/enums.ts"],"names":[],"mappings":"AAAA,oBAAY,UAAU;IACpB,KAAK,UAAU;IACf,IAAI,SAAS;CACd;AAED,oBAAY,YAAY;IACtB,OAAO,YAAY;IACnB,qBAAqB,0BAA0B;IAC/C,0BAA0B,+BAA+B;CAC1D"}
@@ -0,0 +1,16 @@
1
+ export declare const allDocumentTypes: {
2
+ value: string;
3
+ text: string;
4
+ mimeType: string;
5
+ }[];
6
+ export declare const allImageTypes: {
7
+ value: string;
8
+ text: string;
9
+ mimeType: string;
10
+ }[];
11
+ export declare const allTabularDataTypes: {
12
+ value: string;
13
+ text: string;
14
+ mimeType: string;
15
+ }[];
16
+ //# sourceMappingURL=file-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-types.d.ts","sourceRoot":"","sources":["../../../src/components/file-types.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB;;;;GAe5B,CAAA;AAED,eAAO,MAAM,aAAa;;;;GAGzB,CAAA;AACD,eAAO,MAAM,mBAAmB;;;;GAc/B,CAAA"}
@@ -1,4 +1,5 @@
1
1
  export { ComponentTypes } from '../components/component-types.js';
2
2
  export { getComponentDefaults, hasConditionSupport, hasContent, hasContentField, hasFormField, hasHint, hasInputField, hasListField, hasSelectionFields, hasTitle, isConditionalType, isContentType, isFormType, isListType } from '../components/helpers.js';
3
+ export { allDocumentTypes, allImageTypes, allTabularDataTypes } from '../components/file-types.js';
3
4
  export { ComponentType } from '../components/enums.js';
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAA;AACpE,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,UAAU,EACV,eAAe,EACf,YAAY,EACZ,OAAO,EACP,aAAa,EACb,YAAY,EACZ,kBAAkB,EAClB,QAAQ,EACR,iBAAiB,EACjB,aAAa,EACb,UAAU,EACV,UAAU,EACX,MAAM,6BAA6B,CAAA;AAEpC,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAA;AACpE,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,UAAU,EACV,eAAe,EACf,YAAY,EACZ,OAAO,EACP,aAAa,EACb,YAAY,EACZ,kBAAkB,EAClB,QAAQ,EACR,iBAAiB,EACjB,aAAa,EACb,UAAU,EACV,UAAU,EACX,MAAM,6BAA6B,CAAA;AACpC,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,mBAAmB,EACpB,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defra/forms-model",
3
- "version": "3.0.439",
3
+ "version": "3.0.441",
4
4
  "description": "A hapi plugin providing the model for Defra forms",
5
5
  "homepage": "https://github.com/DEFRA/forms-designer/tree/main/model#readme",
6
6
  "repository": {
@@ -3,8 +3,8 @@ export enum FormStatus {
3
3
  Live = 'live'
4
4
  }
5
5
 
6
- export enum ApiErrorFunctionCode {
6
+ export enum ApiErrorCode {
7
7
  General = 'General',
8
8
  DuplicatePagePathPage = 'DuplicatePagePathPage',
9
- DuplicatePagePathQuestion = 'DuplicatePagePathQuestion'
9
+ DuplicatePagePathComponent = 'DuplicatePagePathComponent'
10
10
  }
@@ -0,0 +1,36 @@
1
+ export const allDocumentTypes = [
2
+ { value: 'pdf', text: 'PDF', mimeType: 'application/pdf' },
3
+ { value: 'doc', text: 'DOC', mimeType: 'application/msword' },
4
+ {
5
+ value: 'docx',
6
+ text: 'DOCX',
7
+ mimeType:
8
+ 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
9
+ },
10
+ {
11
+ value: 'odt',
12
+ text: 'ODT',
13
+ mimeType: 'application/vnd.oasis.opendocument.text'
14
+ },
15
+ { value: 'txt', text: 'TXT', mimeType: 'text/plain' }
16
+ ]
17
+
18
+ export const allImageTypes = [
19
+ { value: 'jpg', text: 'JPG', mimeType: 'image/jpeg' },
20
+ { value: 'png', text: 'PNG', mimeType: 'image/png' }
21
+ ]
22
+ export const allTabularDataTypes = [
23
+ { value: 'xls', text: 'XLS', mimeType: 'application/vnd.ms-excel' },
24
+ {
25
+ value: 'xlsx',
26
+ text: 'XLSX',
27
+ mimeType:
28
+ 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
29
+ },
30
+ { value: 'csv', text: 'CSV', mimeType: 'text/csv' },
31
+ {
32
+ value: 'ods',
33
+ text: 'ODS',
34
+ mimeType: 'application/vnd.oasis.opendocument.spreadsheet'
35
+ }
36
+ ]
@@ -15,5 +15,9 @@ export {
15
15
  isFormType,
16
16
  isListType
17
17
  } from '~/src/components/helpers.js'
18
-
18
+ export {
19
+ allDocumentTypes,
20
+ allImageTypes,
21
+ allTabularDataTypes
22
+ } from '~/src/components/file-types.js'
19
23
  export { ComponentType } from '~/src/components/enums.js'