@defra/forms-model 3.0.566 → 3.0.568

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.
Files changed (61) hide show
  1. package/dist/module/form/form-definition/helpers.js +12 -0
  2. package/dist/module/form/form-definition/helpers.js.map +1 -0
  3. package/dist/module/form/form-definition/index.js +31 -2
  4. package/dist/module/form/form-definition/index.js.map +1 -1
  5. package/dist/module/form/form-editor/__stubs__/preview.js +128 -1
  6. package/dist/module/form/form-editor/__stubs__/preview.js.map +1 -1
  7. package/dist/module/form/form-editor/index.js +1 -1
  8. package/dist/module/form/form-editor/index.js.map +1 -1
  9. package/dist/module/form/form-editor/macros/types.js.map +1 -1
  10. package/dist/module/form/form-editor/preview/component-elements.js +1 -0
  11. package/dist/module/form/form-editor/preview/component-elements.js.map +1 -1
  12. package/dist/module/form/form-editor/preview/helpers.js +3 -1
  13. package/dist/module/form/form-editor/preview/helpers.js.map +1 -1
  14. package/dist/module/form/form-editor/preview/number-only.js +75 -3
  15. package/dist/module/form/form-editor/preview/number-only.js.map +1 -1
  16. package/dist/module/form/form-editor/preview/question.js +30 -3
  17. package/dist/module/form/form-editor/preview/question.js.map +1 -1
  18. package/dist/module/form/form-editor/preview/types.js.map +1 -1
  19. package/dist/module/form/form-manager/errors.js +23 -0
  20. package/dist/module/form/form-manager/errors.js.map +1 -1
  21. package/dist/module/form/form-manager/types.js +6 -0
  22. package/dist/module/form/form-manager/types.js.map +1 -1
  23. package/dist/module/index.js +1 -0
  24. package/dist/module/index.js.map +1 -1
  25. package/dist/types/form/form-definition/helpers.d.ts +8 -0
  26. package/dist/types/form/form-definition/helpers.d.ts.map +1 -0
  27. package/dist/types/form/form-definition/index.d.ts.map +1 -1
  28. package/dist/types/form/form-editor/__stubs__/preview.d.ts +71 -1
  29. package/dist/types/form/form-editor/__stubs__/preview.d.ts.map +1 -1
  30. package/dist/types/form/form-editor/index.d.ts.map +1 -1
  31. package/dist/types/form/form-editor/macros/types.d.ts +7 -0
  32. package/dist/types/form/form-editor/macros/types.d.ts.map +1 -1
  33. package/dist/types/form/form-editor/preview/component-elements.d.ts.map +1 -1
  34. package/dist/types/form/form-editor/preview/helpers.d.ts.map +1 -1
  35. package/dist/types/form/form-editor/preview/number-only.d.ts +123 -0
  36. package/dist/types/form/form-editor/preview/number-only.d.ts.map +1 -1
  37. package/dist/types/form/form-editor/preview/question.d.ts +13 -0
  38. package/dist/types/form/form-editor/preview/question.d.ts.map +1 -1
  39. package/dist/types/form/form-editor/preview/types.d.ts +8 -0
  40. package/dist/types/form/form-editor/preview/types.d.ts.map +1 -1
  41. package/dist/types/form/form-editor/preview/uk-address.d.ts +7 -0
  42. package/dist/types/form/form-editor/preview/uk-address.d.ts.map +1 -1
  43. package/dist/types/form/form-manager/errors.d.ts.map +1 -1
  44. package/dist/types/form/form-manager/types.d.ts +17 -1
  45. package/dist/types/form/form-manager/types.d.ts.map +1 -1
  46. package/dist/types/index.d.ts +1 -0
  47. package/dist/types/index.d.ts.map +1 -1
  48. package/package.json +1 -1
  49. package/src/form/form-definition/helpers.ts +17 -0
  50. package/src/form/form-definition/index.ts +53 -3
  51. package/src/form/form-editor/__stubs__/preview.js +130 -1
  52. package/src/form/form-editor/index.ts +4 -1
  53. package/src/form/form-editor/macros/types.ts +3 -0
  54. package/src/form/form-editor/preview/component-elements.js +4 -0
  55. package/src/form/form-editor/preview/helpers.js +6 -1
  56. package/src/form/form-editor/preview/number-only.js +72 -3
  57. package/src/form/form-editor/preview/question.js +33 -3
  58. package/src/form/form-editor/preview/types.ts +10 -0
  59. package/src/form/form-manager/errors.ts +30 -0
  60. package/src/form/form-manager/types.ts +23 -1
  61. package/src/index.ts +1 -0
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../../../../src/form/form-editor/preview/types.ts"],"sourcesContent":["import {\n type PagePreviewPanelMacro,\n type QuestionBaseModel\n} from '~/src/form/form-editor/macros/types.js'\nimport { type AutocompleteQuestion } from '~/src/form/form-editor/preview/autocomplete.js'\nimport { type DateInputQuestion } from '~/src/form/form-editor/preview/date-input.js'\nimport { type EmailAddressQuestion } from '~/src/form/form-editor/preview/email-address.js'\nimport { type ListSortableQuestion } from '~/src/form/form-editor/preview/list-sortable.js'\nimport { type LongAnswerQuestion } from '~/src/form/form-editor/preview/long-answer.js'\nimport { type PhoneNumberQuestion } from '~/src/form/form-editor/preview/phone-number.js'\nimport { type Question } from '~/src/form/form-editor/preview/question.js'\nimport { type RadioSortableQuestion } from '~/src/form/form-editor/preview/radio-sortable.js'\nimport { type SelectSortableQuestion } from '~/src/form/form-editor/preview/select-sortable.js'\nimport { type ShortAnswerQuestion } from '~/src/form/form-editor/preview/short-answer.js'\nimport { type UkAddressQuestion } from '~/src/form/form-editor/preview/uk-address.js'\nimport { type ListElement } from '~/src/form/form-editor/types.js'\nexport { type QuestionBaseModel } from '~/src/form/form-editor/macros/types.js'\nexport interface BaseSettings {\n question: string\n hintText: string\n optional: boolean\n shortDesc: string\n items: ListElement[]\n content: string\n attributes?: Record<string, string>\n usePostcodeLookup?: boolean\n}\n\nexport interface DefaultComponent {\n id?: string\n text: string\n classes: string\n isPageHeading?: boolean\n}\n\nexport interface GovukFieldset {\n legend: DefaultComponent\n}\n\nexport type ListenerRow = [\n HTMLInputElement | null,\n (target: HTMLInputElement, e: Event) => void,\n keyof HTMLElementEventMap\n]\n\nexport interface DomElementsBase {\n readonly values?: BaseSettings\n autocompleteOptions?: string\n setPreviewHTML(value: string): void\n setPreviewDOM(element: HTMLElement): void\n}\n\nexport interface QuestionElements extends DomElementsBase {\n readonly values: BaseSettings\n}\n\nexport interface AutocompleteElements extends QuestionElements {\n autocompleteOptions: string\n}\n\nexport interface RenderBase {\n render(questionTemplate: string, renderContext: RenderContext): void\n}\n\nexport interface QuestionRenderContext {\n model: QuestionBaseModel\n}\n\nexport interface PageRenderContext {\n params: PagePreviewPanelMacro\n}\n\nexport type RenderContext = QuestionRenderContext | PageRenderContext\n\nexport interface HTMLBuilder {\n buildHTML(questionTemplate: string, renderContext: RenderContext): string\n}\n\nexport interface QuestionRenderer {\n render(questionTemplate: string, questionBaseModel: QuestionBaseModel): void\n}\n\nexport interface PageRenderer {\n render(pageTemplate: string, pagePreview: PagePreviewPanelMacro): void\n}\n\nexport type Renderer = QuestionRenderer | PageRenderer\n\nexport interface ListElements extends QuestionElements {\n afterInputsHTML: string\n}\n\nexport interface PagePreviewBaseElements {\n heading: string\n guidance: string\n}\n\nexport interface PageOverviewElements extends PagePreviewBaseElements {\n addHeading: boolean\n repeatQuestion: string | undefined\n hasRepeater: boolean\n}\n\nexport interface SummaryPageElements extends PagePreviewBaseElements {\n declaration: boolean\n}\n\nexport type PreviewQuestion =\n | DateInputQuestion\n | EmailAddressQuestion\n | ListSortableQuestion\n | LongAnswerQuestion\n | PhoneNumberQuestion\n | Question\n | RadioSortableQuestion\n | SelectSortableQuestion\n | ShortAnswerQuestion\n | UkAddressQuestion\n | AutocompleteQuestion\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../../../../src/form/form-editor/preview/types.ts"],"sourcesContent":["import {\n type PagePreviewPanelMacro,\n type QuestionBaseModel\n} from '~/src/form/form-editor/macros/types.js'\nimport { type AutocompleteQuestion } from '~/src/form/form-editor/preview/autocomplete.js'\nimport { type DateInputQuestion } from '~/src/form/form-editor/preview/date-input.js'\nimport { type EmailAddressQuestion } from '~/src/form/form-editor/preview/email-address.js'\nimport { type ListSortableQuestion } from '~/src/form/form-editor/preview/list-sortable.js'\nimport { type LongAnswerQuestion } from '~/src/form/form-editor/preview/long-answer.js'\nimport { type PhoneNumberQuestion } from '~/src/form/form-editor/preview/phone-number.js'\nimport { type Question } from '~/src/form/form-editor/preview/question.js'\nimport { type RadioSortableQuestion } from '~/src/form/form-editor/preview/radio-sortable.js'\nimport { type SelectSortableQuestion } from '~/src/form/form-editor/preview/select-sortable.js'\nimport { type ShortAnswerQuestion } from '~/src/form/form-editor/preview/short-answer.js'\nimport { type UkAddressQuestion } from '~/src/form/form-editor/preview/uk-address.js'\nimport { type ListElement } from '~/src/form/form-editor/types.js'\nexport { type QuestionBaseModel } from '~/src/form/form-editor/macros/types.js'\nexport interface BaseSettings {\n question: string\n hintText: string\n optional: boolean\n shortDesc: string\n userClasses: string\n items: ListElement[]\n content: string\n attributes?: Record<string, string>\n usePostcodeLookup?: boolean\n}\n\nexport interface DefaultComponent {\n id?: string\n text: string\n classes: string\n isPageHeading?: boolean\n}\n\nexport interface GovukFieldset {\n legend: DefaultComponent\n}\n\nexport type ListenerRow = [\n HTMLInputElement | null,\n (target: HTMLInputElement, e: Event) => void,\n keyof HTMLElementEventMap\n]\n\nexport interface DomElementsBase {\n readonly values?: BaseSettings\n autocompleteOptions?: string\n setPreviewHTML(value: string): void\n setPreviewDOM(element: HTMLElement): void\n}\n\nexport interface QuestionElements extends DomElementsBase {\n readonly values: BaseSettings\n}\n\nexport interface AutocompleteElements extends QuestionElements {\n autocompleteOptions: string\n}\n\nexport interface NumberSettings extends BaseSettings {\n prefix: string\n suffix: string\n}\n\nexport interface NumberElements extends DomElementsBase {\n readonly values: NumberSettings\n}\n\nexport interface RenderBase {\n render(questionTemplate: string, renderContext: RenderContext): void\n}\n\nexport interface QuestionRenderContext {\n model: QuestionBaseModel\n}\n\nexport interface PageRenderContext {\n params: PagePreviewPanelMacro\n}\n\nexport type RenderContext = QuestionRenderContext | PageRenderContext\n\nexport interface HTMLBuilder {\n buildHTML(questionTemplate: string, renderContext: RenderContext): string\n}\n\nexport interface QuestionRenderer {\n render(questionTemplate: string, questionBaseModel: QuestionBaseModel): void\n}\n\nexport interface PageRenderer {\n render(pageTemplate: string, pagePreview: PagePreviewPanelMacro): void\n}\n\nexport type Renderer = QuestionRenderer | PageRenderer\n\nexport interface ListElements extends QuestionElements {\n afterInputsHTML: string\n}\n\nexport interface PagePreviewBaseElements {\n heading: string\n guidance: string\n}\n\nexport interface PageOverviewElements extends PagePreviewBaseElements {\n addHeading: boolean\n repeatQuestion: string | undefined\n hasRepeater: boolean\n}\n\nexport interface SummaryPageElements extends PagePreviewBaseElements {\n declaration: boolean\n}\n\nexport type PreviewQuestion =\n | DateInputQuestion\n | EmailAddressQuestion\n | ListSortableQuestion\n | LongAnswerQuestion\n | PhoneNumberQuestion\n | Question\n | RadioSortableQuestion\n | SelectSortableQuestion\n | ShortAnswerQuestion\n | UkAddressQuestion\n | AutocompleteQuestion\n"],"mappings":"","ignoreList":[]}
@@ -26,6 +26,13 @@ export const checkErrors = formErrors => {
26
26
  err.local.errorType = FormDefinitionErrorType.Ref;
27
27
  return;
28
28
  }
29
+ if (errorDetails.type === FormDefinitionErrorType.Incompatible && err.code === 'custom.incompatible'
30
+ // Match any key
31
+ ) {
32
+ err.local.errorCode = formError;
33
+ err.local.errorType = FormDefinitionErrorType.Incompatible;
34
+ return;
35
+ }
29
36
  err.local.errorType = FormDefinitionErrorType.Type;
30
37
  }
31
38
  });
@@ -60,6 +67,22 @@ export function getErrors(validationError) {
60
67
  }
61
68
  };
62
69
  }
70
+ if (detail.context?.errorType === FormDefinitionErrorType.Incompatible && detail.context.errorCode) {
71
+ return {
72
+ id: /** @type {FormDefinitionError} */detail.context.errorCode,
73
+ type: FormDefinitionErrorType.Incompatible,
74
+ message: detail.message,
75
+ detail: {
76
+ path: detail.path,
77
+ key: detail.context.key,
78
+ valueKey: detail.context.valueKey,
79
+ value: detail.context.value,
80
+ label: detail.context.label,
81
+ incompatibleObject: detail.context.incompatibleObject,
82
+ reason: detail.context.reason
83
+ }
84
+ };
85
+ }
63
86
 
64
87
  // Catch all others
65
88
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","names":["FormDefinitionError","FormDefinitionErrorType","formDefinitionErrors","checkErrors","formErrors","possibleErrors","Array","isArray","errors","forEach","err","local","errorType","formError","errorDetails","keyMatch","key","path","type","Unique","code","errorCode","Ref","Type","getErrors","validationError","details","map","detail","context","id","message","pos","dupePos","Other"],"sources":["../../../../src/form/form-manager/errors.ts"],"sourcesContent":["import type Joi from 'joi'\nimport { type ValidationError } from 'joi'\n\nimport {\n FormDefinitionError,\n FormDefinitionErrorType,\n formDefinitionErrors,\n type FormDefinitionErrorCause\n} from '~/src/form/form-manager/types.js'\n\n/**\n * Checks and applies an `errorType` and also an `errorCode` for known errors\n */\nexport const checkErrors = (\n formErrors: FormDefinitionError | FormDefinitionError[]\n) => {\n const possibleErrors = Array.isArray(formErrors) ? formErrors : [formErrors]\n\n return function (errors: Joi.ErrorReport[]) {\n errors.forEach((err) => {\n if (err.local.errorType) {\n return\n }\n\n for (const formError of possibleErrors) {\n const errorDetails = formDefinitionErrors[formError]\n\n // Joi's `context.key` will be the index for arrays\n // in which case use the path, otherwise use the key\n const keyMatch =\n typeof err.local.key === 'number' ? err.local.path : err.local.key\n\n if (\n errorDetails.type === FormDefinitionErrorType.Unique &&\n err.code === 'array.unique' &&\n keyMatch === errorDetails.key\n ) {\n err.local.errorCode = formError\n err.local.errorType = FormDefinitionErrorType.Unique\n return\n }\n\n if (\n errorDetails.type === FormDefinitionErrorType.Ref &&\n err.code === 'any.only' &&\n keyMatch === errorDetails.key\n ) {\n err.local.errorCode = formError\n err.local.errorType = FormDefinitionErrorType.Ref\n return\n }\n\n err.local.errorType = FormDefinitionErrorType.Type\n }\n })\n return errors\n }\n}\n\n/**\n * Get the custom errors from a form definition joi validation error\n */\nexport function getErrors(\n validationError: ValidationError | undefined\n): FormDefinitionErrorCause[] {\n return (\n validationError?.details.map((detail) => {\n if (\n detail.context?.errorType === FormDefinitionErrorType.Unique &&\n detail.context.errorCode\n ) {\n return {\n id: /** @type {FormDefinitionError} */ detail.context.errorCode,\n type: FormDefinitionErrorType.Unique,\n message: detail.message,\n detail: {\n path: detail.path,\n pos: detail.context.pos,\n dupePos: detail.context.dupePos\n }\n }\n }\n\n if (\n detail.context?.errorType === FormDefinitionErrorType.Ref &&\n detail.context.errorCode\n ) {\n return {\n id: /** @type {FormDefinitionError} */ detail.context.errorCode,\n type: FormDefinitionErrorType.Ref,\n message: detail.message,\n detail: {\n path: detail.path\n }\n }\n }\n\n // Catch all others\n return {\n id: FormDefinitionError.Other,\n type: FormDefinitionErrorType.Type,\n message: detail.message,\n detail: detail.context\n }\n }) ?? []\n )\n}\n"],"mappings":"AAGA,SACEA,mBAAmB,EACnBC,uBAAuB,EACvBC,oBAAoB;;AAItB;AACA;AACA;AACA,OAAO,MAAMC,WAAW,GACtBC,UAAuD,IACpD;EACH,MAAMC,cAAc,GAAGC,KAAK,CAACC,OAAO,CAACH,UAAU,CAAC,GAAGA,UAAU,GAAG,CAACA,UAAU,CAAC;EAE5E,OAAO,UAAUI,MAAyB,EAAE;IAC1CA,MAAM,CAACC,OAAO,CAAEC,GAAG,IAAK;MACtB,IAAIA,GAAG,CAACC,KAAK,CAACC,SAAS,EAAE;QACvB;MACF;MAEA,KAAK,MAAMC,SAAS,IAAIR,cAAc,EAAE;QACtC,MAAMS,YAAY,GAAGZ,oBAAoB,CAACW,SAAS,CAAC;;QAEpD;QACA;QACA,MAAME,QAAQ,GACZ,OAAOL,GAAG,CAACC,KAAK,CAACK,GAAG,KAAK,QAAQ,GAAGN,GAAG,CAACC,KAAK,CAACM,IAAI,GAAGP,GAAG,CAACC,KAAK,CAACK,GAAG;QAEpE,IACEF,YAAY,CAACI,IAAI,KAAKjB,uBAAuB,CAACkB,MAAM,IACpDT,GAAG,CAACU,IAAI,KAAK,cAAc,IAC3BL,QAAQ,KAAKD,YAAY,CAACE,GAAG,EAC7B;UACAN,GAAG,CAACC,KAAK,CAACU,SAAS,GAAGR,SAAS;UAC/BH,GAAG,CAACC,KAAK,CAACC,SAAS,GAAGX,uBAAuB,CAACkB,MAAM;UACpD;QACF;QAEA,IACEL,YAAY,CAACI,IAAI,KAAKjB,uBAAuB,CAACqB,GAAG,IACjDZ,GAAG,CAACU,IAAI,KAAK,UAAU,IACvBL,QAAQ,KAAKD,YAAY,CAACE,GAAG,EAC7B;UACAN,GAAG,CAACC,KAAK,CAACU,S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B,IAAI;MAClCQ,OAAO,EAAEH,MAAM,CAACG,OAAO;MACvBH,MAAM,EAAEA,MAAM,CAACC;IACjB,CAAC;EACH,CAAC,CAAC,IAAI,EAAE;AAEZ","ignoreList":[]}
1
+ {"version":3,"file":"errors.js","names":["FormDefinitionError","FormDefinitionErrorType","formDefinitionErrors","checkErrors","formErrors","possibleErrors","Array","isArray","errors","forEach","err","local","errorType","formError","errorDetails","keyMatch","key","path","type","Unique","code","errorCode","Ref","Incompatible","Type","getErrors","validationError","details","map","detail","context","id","message","pos","dupePos","valueKey","value","label","incompatibleObject","reason","Other"],"sources":["../../../../src/form/form-manager/errors.ts"],"sourcesContent":["import type Joi from 'joi'\nimport { type ValidationError } from 'joi'\n\nimport {\n FormDefinitionError,\n FormDefinitionErrorType,\n formDefinitionErrors,\n type FormDefinitionErrorCause\n} from '~/src/form/form-manager/types.js'\n\n/**\n * Checks and applies an `errorType` and also an `errorCode` for known errors\n */\nexport const checkErrors = (\n formErrors: FormDefinitionError | FormDefinitionError[]\n) => {\n const possibleErrors = Array.isArray(formErrors) ? formErrors : [formErrors]\n\n return function (errors: Joi.ErrorReport[]) {\n errors.forEach((err) => {\n if (err.local.errorType) {\n return\n }\n\n for (const formError of possibleErrors) {\n const errorDetails = formDefinitionErrors[formError]\n\n // Joi's `context.key` will be the index for arrays\n // in which case use the path, otherwise use the key\n const keyMatch =\n typeof err.local.key === 'number' ? err.local.path : err.local.key\n\n if (\n errorDetails.type === FormDefinitionErrorType.Unique &&\n err.code === 'array.unique' &&\n keyMatch === errorDetails.key\n ) {\n err.local.errorCode = formError\n err.local.errorType = FormDefinitionErrorType.Unique\n return\n }\n\n if (\n errorDetails.type === FormDefinitionErrorType.Ref &&\n err.code === 'any.only' &&\n keyMatch === errorDetails.key\n ) {\n err.local.errorCode = formError\n err.local.errorType = FormDefinitionErrorType.Ref\n return\n }\n\n if (\n errorDetails.type === FormDefinitionErrorType.Incompatible &&\n err.code === 'custom.incompatible'\n // Match any key\n ) {\n err.local.errorCode = formError\n err.local.errorType = FormDefinitionErrorType.Incompatible\n return\n }\n\n err.local.errorType = FormDefinitionErrorType.Type\n }\n })\n return errors\n }\n}\n\n/**\n * Get the custom errors from a form definition joi validation error\n */\nexport function getErrors(\n validationError: ValidationError | undefined\n): FormDefinitionErrorCause[] {\n return (\n validationError?.details.map((detail) => {\n if (\n detail.context?.errorType === FormDefinitionErrorType.Unique &&\n detail.context.errorCode\n ) {\n return {\n id: /** @type {FormDefinitionError} */ detail.context.errorCode,\n type: FormDefinitionErrorType.Unique,\n message: detail.message,\n detail: {\n path: detail.path,\n pos: detail.context.pos,\n dupePos: detail.context.dupePos\n }\n }\n }\n\n if (\n detail.context?.errorType === FormDefinitionErrorType.Ref &&\n detail.context.errorCode\n ) {\n return {\n id: /** @type {FormDefinitionError} */ detail.context.errorCode,\n type: FormDefinitionErrorType.Ref,\n message: detail.message,\n detail: {\n path: detail.path\n }\n }\n }\n\n if (\n detail.context?.errorType === FormDefinitionErrorType.Incompatible &&\n detail.context.errorCode\n ) {\n return {\n id: /** @type {FormDefinitionError} */ detail.context.errorCode,\n type: FormDefinitionErrorType.Incompatible,\n message: detail.message,\n detail: {\n path: detail.path,\n key: detail.context.key,\n valueKey: detail.context.valueKey,\n value: detail.context.value,\n label: detail.context.label,\n incompatibleObject: detail.context.incompatibleObject,\n reason: detail.context.reason\n }\n }\n }\n\n // Catch all others\n return {\n id: FormDefinitionError.Other,\n type: FormDefinitionErrorType.Type,\n message: detail.message,\n detail: detail.context\n }\n }) ?? []\n )\n}\n"],"mappings":"AAGA,SACEA,mBAAmB,EACnBC,uBAAuB,EACvBC,oBAAoB;;AAItB;AACA;AACA;AACA,OAAO,MAAMC,WAAW,GACtBC,UAAuD,IACpD;EACH,MAAMC,cAAc,GAAGC,KAAK,CAACC,OAAO,CAACH,UAAU,CAAC,GAAGA,UAAU,GAAG,CAACA,UAAU,CAAC;EAE5E,OAAO,UAAUI,MAAyB,EAAE;IAC1CA,MAAM,CAACC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Z,IAAI,EAAEY,MAAM,CAACZ,IAAI;UACjBD,GAAG,EAAEa,MAAM,CAACC,OAAO,CAACd,GAAG;UACvBmB,QAAQ,EAAEN,MAAM,CAACC,OAAO,CAACK,QAAQ;UACjCC,KAAK,EAAEP,MAAM,CAACC,OAAO,CAACM,KAAK;UAC3BC,KAAK,EAAER,MAAM,CAACC,OAAO,CAACO,KAAK;UAC3BC,kBAAkB,EAAET,MAAM,CAACC,OAAO,CAACQ,kBAAkB;UACrDC,MAAM,EAAEV,MAAM,CAACC,OAAO,CAACS;QACzB;MACF,CAAC;IACH;;IAEA;IACA,OAAO;MACLR,EAAE,EAAE/B,mBAAmB,CAACwC,KAAK;MAC7BtB,IAAI,EAAEjB,uBAAuB,CAACuB,IAAI;MAClCQ,OAAO,EAAEH,MAAM,CAACG,OAAO;MACvBH,MAAM,EAAEA,MAAM,CAACC;IACjB,CAAC;EACH,CAAC,CAAC,IAAI,EAAE;AAEZ","ignoreList":[]}
@@ -3,6 +3,7 @@ export let FormDefinitionErrorType = /*#__PURE__*/function (FormDefinitionErrorT
3
3
  FormDefinitionErrorType["Unique"] = "unique";
4
4
  FormDefinitionErrorType["Ref"] = "ref";
5
5
  FormDefinitionErrorType["Type"] = "type";
6
+ FormDefinitionErrorType["Incompatible"] = "incompatible";
6
7
  return FormDefinitionErrorType;
7
8
  }({});
8
9
 
@@ -28,6 +29,7 @@ export let FormDefinitionError = /*#__PURE__*/function (FormDefinitionError) {
28
29
  FormDefinitionError["RefConditionItemId"] = "ref_condition_item_id";
29
30
  FormDefinitionError["RefConditionConditionId"] = "ref_condition_condition_id";
30
31
  FormDefinitionError["RefPageComponentList"] = "ref_page_component_list";
32
+ FormDefinitionError["IncompatibleConditionComponentType"] = "incompatible_condition_component_type";
31
33
  FormDefinitionError["Other"] = "other";
32
34
  return FormDefinitionError;
33
35
  }({});
@@ -113,6 +115,10 @@ export const formDefinitionErrors = {
113
115
  key: 'list',
114
116
  type: FormDefinitionErrorType.Ref
115
117
  },
118
+ [FormDefinitionError.IncompatibleConditionComponentType]: {
119
+ key: 'componentId',
120
+ type: FormDefinitionErrorType.Incompatible
121
+ },
116
122
  [FormDefinitionError.Other]: {
117
123
  key: '',
118
124
  type: FormDefinitionErrorType.Type
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":["FormDefinitionErrorType","FormDefinitionError","formDefinitionErrors","UniquePagePath","key","type","Unique","UniquePageId","UniquePageComponentId","UniquePageComponentName","UniqueSectionName","UniqueSectionTitle","UniqueListId","UniqueListTitle","UniqueListName","UniqueConditionDisplayName","UniqueConditionId","UniqueListItemId","UniqueListItemText","UniqueListItemValue","RefPageCondition","Ref","RefConditionComponentId","RefConditionListId","RefConditionItemId","RefConditionConditionId","RefPageComponentList","Other","Type"],"sources":["../../../../src/form/form-manager/types.ts"],"sourcesContent":["import { type Context } from 'joi'\n\nimport { type Repeat } from '~/src/form/form-definition/types.js'\nimport { type ControllerType } from '~/src/pages/enums.js'\n\nexport interface PatchPageFields {\n title?: string\n path?: string\n controller?: ControllerType | null\n repeat?: Repeat\n condition?: string | null\n}\n\nexport interface AddComponentQueryOptions {\n prepend?: boolean\n}\n\n// Enum of error types that can be raised through validating the form definition\nexport enum FormDefinitionErrorType {\n Unique = 'unique', // Unique constraint\n Ref = 'ref', // Referential integrity\n Type = 'type' // General schema type error\n}\n\n// Enum for errors that can exist in a form definition\nexport enum FormDefinitionError {\n UniquePageId = 'unique_page_id',\n UniquePagePath = 'unique_page_path',\n UniquePageComponentId = 'unique_page_component_id',\n UniquePageComponentName = 'unique_page_component_name',\n UniqueSectionName = 'unique_section_name',\n UniqueSectionTitle = 'unique_section_title',\n UniqueListId = 'unique_list_id',\n UniqueListTitle = 'unique_list_title',\n UniqueListName = 'unique_list_name',\n UniqueConditionId = 'unique_condition_id',\n UniqueConditionDisplayName = 'unique_condition_displayname',\n UniqueListItemId = 'unique_list_item_id',\n UniqueListItemText = 'unique_list_item_text',\n UniqueListItemValue = 'unique_list_item_value',\n RefPageCondition = 'ref_page_condition',\n RefConditionComponentId = 'ref_condition_component_id',\n RefConditionListId = 'ref_condition_list_id',\n RefConditionItemId = 'ref_condition_item_id',\n RefConditionConditionId = 'ref_condition_condition_id',\n RefPageComponentList = 'ref_page_component_list',\n Other = 'other'\n}\n\nexport interface ErrorMatchValue {\n key: string\n type: FormDefinitionErrorType\n}\n\nexport type FormDefinitionErrors = Record<FormDefinitionError, ErrorMatchValue>\n\n// The errors that can exist in the form definition\nexport const formDefinitionErrors: FormDefinitionErrors = {\n [FormDefinitionError.UniquePagePath]: {\n key: 'path',\n type: FormDefinitionErrorType.Unique\n },\n [FormDefinitionError.UniquePageId]: {\n key: 'id',\n type: FormDefinitionErrorType.Unique\n },\n [FormDefinitionError.UniquePageComponentId]: {\n key: 'id',\n type: FormDefinitionErrorType.Unique\n },\n [FormDefinitionError.UniquePageComponentName]: {\n key: 'name',\n type: FormDefinitionErrorType.Unique\n },\n [FormDefinitionError.UniqueSectionName]: {\n key: 'name',\n type: FormDefinitionErrorType.Unique\n },\n [FormDefinitionError.UniqueSectionTitle]: {\n key: 'title',\n type: FormDefinitionErrorType.Unique\n },\n [FormDefinitionError.UniqueListId]: {\n key: 'id',\n type: FormDefinitionErrorType.Unique\n },\n [FormDefinitionError.UniqueListTitle]: {\n key: 'title',\n type: FormDefinitionErrorType.Unique\n },\n [FormDefinitionError.UniqueListName]: {\n key: 'name',\n type: FormDefinitionErrorType.Unique\n },\n [FormDefinitionError.UniqueConditionDisplayName]: {\n key: 'displayName',\n type: FormDefinitionErrorType.Unique\n },\n [FormDefinitionError.UniqueConditionId]: {\n key: 'id',\n type: FormDefinitionErrorType.Unique\n },\n [FormDefinitionError.UniqueListItemId]: {\n key: 'id',\n type: FormDefinitionErrorType.Unique\n },\n [FormDefinitionError.UniqueListItemText]: {\n key: 'text',\n type: FormDefinitionErrorType.Unique\n },\n [FormDefinitionError.UniqueListItemValue]: {\n key: 'value',\n type: FormDefinitionErrorType.Unique\n },\n [FormDefinitionError.RefPageCondition]: {\n key: 'condition',\n type: FormDefinitionErrorType.Ref\n },\n [FormDefinitionError.RefConditionComponentId]: {\n key: 'componentId',\n type: FormDefinitionErrorType.Ref\n },\n [FormDefinitionError.RefConditionListId]: {\n key: 'listId',\n type: FormDefinitionErrorType.Ref\n },\n [FormDefinitionError.RefConditionItemId]: {\n key: 'itemId',\n type: FormDefinitionErrorType.Ref\n },\n [FormDefinitionError.RefConditionConditionId]: {\n key: 'conditionId',\n type: FormDefinitionErrorType.Ref\n },\n [FormDefinitionError.RefPageComponentList]: {\n key: 'list',\n type: FormDefinitionErrorType.Ref\n },\n [FormDefinitionError.Other]: {\n key: '',\n type: FormDefinitionErrorType.Type\n }\n}\n\nexport type FormDefinitionErrorCauseDetailPath = (string | number)[]\n\nexport interface FormDefinitionErrorCauseDetailUnique {\n path: FormDefinitionErrorCauseDetailPath\n pos: number\n dupePos: number\n}\n\nexport interface FormDefinitionErrorCauseDetailRef {\n path: FormDefinitionErrorCauseDetailPath\n}\n\nexport type FormDefinitionErrorCause =\n | {\n id: FormDefinitionError\n type: FormDefinitionErrorType.Unique\n message: string\n detail: FormDefinitionErrorCauseDetailUnique\n }\n | {\n id: FormDefinitionError\n type: FormDefinitionErrorType.Ref\n message: string\n detail: FormDefinitionErrorCauseDetailRef\n }\n | {\n id: FormDefinitionError\n type: FormDefinitionErrorType.Type\n message: string\n detail: Context | undefined\n }\n"],"mappings":"AAiBA;AACA,WAAYA,uBAAuB,0BAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAA,OAAvBA,uBAAuB;AAAA;;AAMnC;AACA,WAAYC,mBAAmB,0BAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBA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,uBAAuB,CAACqB;EAChC,CAAC;EACD,CAACpB,mBAAmB,CAAC0B,KAAK,GAAG;IAC3BvB,GAAG,EAAE,EAAE;IACPC,IAAI,EAAEL,uBAAuB,CAAC4B;EAChC;AACF,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":["FormDefinitionErrorType","FormDefinitionError","formDefinitionErrors","UniquePagePath","key","type","Unique","UniquePageId","UniquePageComponentId","UniquePageComponentName","UniqueSectionName","UniqueSectionTitle","UniqueListId","UniqueListTitle","UniqueListName","UniqueConditionDisplayName","UniqueConditionId","UniqueListItemId","UniqueListItemText","UniqueListItemValue","RefPageCondition","Ref","RefConditionComponentId","RefConditionListId","RefConditionItemId","RefConditionConditionId","RefPageComponentList","IncompatibleConditionComponentType","Incompatible","Other","Type"],"sources":["../../../../src/form/form-manager/types.ts"],"sourcesContent":["import { type Context } from 'joi'\n\nimport { type Repeat } from '~/src/form/form-definition/types.js'\nimport { type ControllerType } from '~/src/pages/enums.js'\n\nexport interface PatchPageFields {\n title?: string\n path?: string\n controller?: ControllerType | null\n repeat?: Repeat\n condition?: string | null\n}\n\nexport interface AddComponentQueryOptions {\n prepend?: boolean\n}\n\n// Enum of error types that can be raised through validating the form definition\nexport enum FormDefinitionErrorType {\n Unique = 'unique', // Unique constraint\n Ref = 'ref', // Referential integrity\n Type = 'type', // General schema type error\n Incompatible = 'incompatible' // Data values/types that are not compatible\n}\n\n// Enum for errors that can exist in a form definition\nexport enum FormDefinitionError {\n UniquePageId = 'unique_page_id',\n UniquePagePath = 'unique_page_path',\n UniquePageComponentId = 'unique_page_component_id',\n UniquePageComponentName = 'unique_page_component_name',\n UniqueSectionName = 'unique_section_name',\n UniqueSectionTitle = 'unique_section_title',\n UniqueListId = 'unique_list_id',\n UniqueListTitle = 'unique_list_title',\n UniqueListName = 'unique_list_name',\n UniqueConditionId = 'unique_condition_id',\n UniqueConditionDisplayName = 'unique_condition_displayname',\n UniqueListItemId = 'unique_list_item_id',\n UniqueListItemText = 'unique_list_item_text',\n UniqueListItemValue = 'unique_list_item_value',\n RefPageCondition = 'ref_page_condition',\n RefConditionComponentId = 'ref_condition_component_id',\n RefConditionListId = 'ref_condition_list_id',\n RefConditionItemId = 'ref_condition_item_id',\n RefConditionConditionId = 'ref_condition_condition_id',\n RefPageComponentList = 'ref_page_component_list',\n IncompatibleConditionComponentType = 'incompatible_condition_component_type',\n Other = 'other'\n}\n\nexport interface ErrorMatchValue {\n key: string\n type: FormDefinitionErrorType\n}\n\nexport type FormDefinitionErrors = Record<FormDefinitionError, ErrorMatchValue>\n\n// The errors that can exist in the form definition\nexport const formDefinitionErrors: FormDefinitionErrors = {\n [FormDefinitionError.UniquePagePath]: {\n key: 'path',\n type: FormDefinitionErrorType.Unique\n },\n [FormDefinitionError.UniquePageId]: {\n key: 'id',\n type: FormDefinitionErrorType.Unique\n },\n [FormDefinitionError.UniquePageComponentId]: {\n key: 'id',\n type: FormDefinitionErrorType.Unique\n },\n [FormDefinitionError.UniquePageComponentName]: {\n key: 'name',\n type: FormDefinitionErrorType.Unique\n },\n [FormDefinitionError.UniqueSectionName]: {\n key: 'name',\n type: FormDefinitionErrorType.Unique\n },\n [FormDefinitionError.UniqueSectionTitle]: {\n key: 'title',\n type: FormDefinitionErrorType.Unique\n },\n [FormDefinitionError.UniqueListId]: {\n key: 'id',\n type: FormDefinitionErrorType.Unique\n },\n [FormDefinitionError.UniqueListTitle]: {\n key: 'title',\n type: FormDefinitionErrorType.Unique\n },\n [FormDefinitionError.UniqueListName]: {\n key: 'name',\n type: FormDefinitionErrorType.Unique\n },\n [FormDefinitionError.UniqueConditionDisplayName]: {\n key: 'displayName',\n type: FormDefinitionErrorType.Unique\n },\n [FormDefinitionError.UniqueConditionId]: {\n key: 'id',\n type: FormDefinitionErrorType.Unique\n },\n [FormDefinitionError.UniqueListItemId]: {\n key: 'id',\n type: FormDefinitionErrorType.Unique\n },\n [FormDefinitionError.UniqueListItemText]: {\n key: 'text',\n type: FormDefinitionErrorType.Unique\n },\n [FormDefinitionError.UniqueListItemValue]: {\n key: 'value',\n type: FormDefinitionErrorType.Unique\n },\n [FormDefinitionError.RefPageCondition]: {\n key: 'condition',\n type: FormDefinitionErrorType.Ref\n },\n [FormDefinitionError.RefConditionComponentId]: {\n key: 'componentId',\n type: FormDefinitionErrorType.Ref\n },\n [FormDefinitionError.RefConditionListId]: {\n key: 'listId',\n type: FormDefinitionErrorType.Ref\n },\n [FormDefinitionError.RefConditionItemId]: {\n key: 'itemId',\n type: FormDefinitionErrorType.Ref\n },\n [FormDefinitionError.RefConditionConditionId]: {\n key: 'conditionId',\n type: FormDefinitionErrorType.Ref\n },\n [FormDefinitionError.RefPageComponentList]: {\n key: 'list',\n type: FormDefinitionErrorType.Ref\n },\n [FormDefinitionError.IncompatibleConditionComponentType]: {\n key: 'componentId',\n type: FormDefinitionErrorType.Incompatible\n },\n [FormDefinitionError.Other]: {\n key: '',\n type: FormDefinitionErrorType.Type\n }\n}\n\nexport type FormDefinitionErrorCauseDetailPath = (string | number)[]\n\nexport interface FormDefinitionErrorCauseDetailUnique {\n path: FormDefinitionErrorCauseDetailPath\n pos: number\n dupePos: number\n}\n\nexport interface FormDefinitionErrorCauseDetailRef {\n path: FormDefinitionErrorCauseDetailPath\n}\n\nexport interface FormDefinitionErrorCauseDetailIncompatible {\n path: FormDefinitionErrorCauseDetailPath\n valueKey?: string\n incompatibleObject: {\n key?: string\n value?: unknown\n }\n reason: string\n}\n\nexport type FormDefinitionErrorCause =\n | {\n id: FormDefinitionError\n type: FormDefinitionErrorType.Unique\n message: string\n detail: FormDefinitionErrorCauseDetailUnique\n }\n | {\n id: FormDefinitionError\n type: FormDefinitionErrorType.Ref\n message: string\n detail: FormDefinitionErrorCauseDetailRef\n }\n | {\n id: FormDefinitionError\n type: FormDefinitionErrorType.Type\n message: string\n detail: Context | undefined\n }\n | {\n id: FormDefinitionError\n type: FormDefinitionErrorType.Incompatible\n message: string\n detail: FormDefinitionErrorCauseDetailIncompatible\n }\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IACxCnB,GAAG,EAAE,QAAQ;IACbC,IAAI,EAAEL,uBAAuB,CAACqB;EAChC,CAAC;EACD,CAACpB,mBAAmB,CAACuB,kBAAkB,GAAG;IACxCpB,GAAG,EAAE,QAAQ;IACbC,IAAI,EAAEL,uBAAuB,CAACqB;EAChC,CAAC;EACD,CAACpB,mBAAmB,CAACwB,uBAAuB,GAAG;IAC7CrB,GAAG,EAAE,aAAa;IAClBC,IAAI,EAAEL,uBAAuB,CAACqB;EAChC,CAAC;EACD,CAACpB,mBAAmB,CAACyB,oBAAoB,GAAG;IAC1CtB,GAAG,EAAE,MAAM;IACXC,IAAI,EAAEL,uBAAuB,CAACqB;EAChC,CAAC;EACD,CAACpB,mBAAmB,CAAC0B,kCAAkC,GAAG;IACxDvB,GAAG,EAAE,aAAa;IAClBC,IAAI,EAAEL,uBAAuB,CAAC4B;EAChC,CAAC;EACD,CAAC3B,mBAAmB,CAAC4B,KAAK,GAAG;IAC3BzB,GAAG,EAAE,EAAE;IACPC,IAAI,EAAEL,uBAAuB,CAAC8B;EAChC;AACF,CAAC","ignoreList":[]}
@@ -8,6 +8,7 @@ export * from "./components/index.js";
8
8
  export * from "./conditions/index.js";
9
9
  export * from "./form/form-definition/index.js";
10
10
  export * from "./form/form-definition/types.js";
11
+ export * from "./form/form-definition/helpers.js";
11
12
  export * from "./form/form-metadata/index.js";
12
13
  export * from "./form/form-submission/index.js";
13
14
  export * from "./form/form-submission/enums.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/index.ts"],"sourcesContent":["export * from '~/src/common/enums.js'\nexport * from '~/src/common/random-id.js'\nexport * from '~/src/common/schema.js'\nexport * from '~/src/common/pagination/index.js'\nexport * from '~/src/common/search/index.js'\nexport * from '~/src/common/sorting/index.js'\nexport * from '~/src/components/index.js'\nexport * from '~/src/conditions/index.js'\nexport * from '~/src/form/form-definition/index.js'\nexport * from '~/src/form/form-definition/types.js'\nexport * from '~/src/form/form-metadata/index.js'\nexport * from '~/src/form/form-submission/index.js'\nexport * from '~/src/form/form-submission/enums.js'\nexport * from '~/src/form/utils/index.js'\nexport * from '~/src/form/form-editor/index.js'\nexport * from '~/src/form/form-editor/preview/index.js'\nexport * from '~/src/form/form-manager/types.js'\nexport * from '~/src/form/form-manager/errors.js'\nexport * from '~/src/manage/roles.js'\nexport * from '~/src/manage/users.js'\nexport * from '~/src/pages/index.js'\nexport * from '~/src/utils/helpers.js'\nexport * from '~/src/utils/markdown.js'\nexport * from '~/src/form/form-audit/index.js'\nexport * from '~/src/form/form-audit/enums.js'\n\nexport type * from '~/src/common/types.js'\nexport type * from '~/src/common/pagination/types.js'\nexport type * from '~/src/common/search/types.js'\nexport type * from '~/src/common/sorting/types.js'\nexport type * from '~/src/components/types.js'\nexport type * from '~/src/conditions/types.js'\nexport type * from '~/src/form/form-definition/types.js'\nexport type * from '~/src/form/form-metadata/types.js'\nexport type * from '~/src/form/form-submission/types.js'\nexport type * from '~/src/form/form-editor/preview/types.js'\nexport type * from '~/src/form/form-editor/types.js'\nexport type * from '~/src/form/form-editor/macros/types.js'\nexport type * from '~/src/form/form-audit/types.js'\nexport type * from '~/src/manage/types.js'\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/index.ts"],"sourcesContent":["export * from '~/src/common/enums.js'\nexport * from '~/src/common/random-id.js'\nexport * from '~/src/common/schema.js'\nexport * from '~/src/common/pagination/index.js'\nexport * from '~/src/common/search/index.js'\nexport * from '~/src/common/sorting/index.js'\nexport * from '~/src/components/index.js'\nexport * from '~/src/conditions/index.js'\nexport * from '~/src/form/form-definition/index.js'\nexport * from '~/src/form/form-definition/types.js'\nexport * from '~/src/form/form-definition/helpers.js'\nexport * from '~/src/form/form-metadata/index.js'\nexport * from '~/src/form/form-submission/index.js'\nexport * from '~/src/form/form-submission/enums.js'\nexport * from '~/src/form/utils/index.js'\nexport * from '~/src/form/form-editor/index.js'\nexport * from '~/src/form/form-editor/preview/index.js'\nexport * from '~/src/form/form-manager/types.js'\nexport * from '~/src/form/form-manager/errors.js'\nexport * from '~/src/manage/roles.js'\nexport * from '~/src/manage/users.js'\nexport * from '~/src/pages/index.js'\nexport * from '~/src/utils/helpers.js'\nexport * from '~/src/utils/markdown.js'\nexport * from '~/src/form/form-audit/index.js'\nexport * from '~/src/form/form-audit/enums.js'\n\nexport type * from '~/src/common/types.js'\nexport type * from '~/src/common/pagination/types.js'\nexport type * from '~/src/common/search/types.js'\nexport type * from '~/src/common/sorting/types.js'\nexport type * from '~/src/components/types.js'\nexport type * from '~/src/conditions/types.js'\nexport type * from '~/src/form/form-definition/types.js'\nexport type * from '~/src/form/form-metadata/types.js'\nexport type * from '~/src/form/form-submission/types.js'\nexport type * from '~/src/form/form-editor/preview/types.js'\nexport type * from '~/src/form/form-editor/types.js'\nexport type * from '~/src/form/form-editor/macros/types.js'\nexport type * from '~/src/form/form-audit/types.js'\nexport type * from '~/src/manage/types.js'\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
@@ -0,0 +1,8 @@
1
+ import { type FormDefinition } from '../../form/form-definition/types.js';
2
+ /**
3
+ * TypeGuard to check if component is a ListComponentsDef
4
+ * @param { FormDefinition | undefined } definition
5
+ * @returns { definition is FormDefinition }
6
+ */
7
+ export declare function isFormDefinition(definition: FormDefinition | undefined): definition is FormDefinition;
8
+ //# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../src/form/form-definition/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,MA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AAM,YAAY,4BAIiB,CAAA;AAsD1C;;;GAGG;AACH,eAAO,MAAM,oBAAoB,sCAgG7B,CAAA;AAEJ,eAAO,MAAM,sBAAsB,sCA2CY,CAAA;AAI/C,eAAO,MAAM,MAAM,sCAAuB,CAAA"}
@@ -59,7 +59,7 @@ export class QuestionPreviewElements implements ListElements {
59
59
  /**
60
60
  * @param {BaseSettings} baseSettings
61
61
  */
62
- constructor({ question, hintText, optional, shortDesc, usePostcodeLookup, items, content }: BaseSettings);
62
+ constructor({ question, hintText, optional, shortDesc, userClasses, usePostcodeLookup, items, content }: BaseSettings);
63
63
  /**
64
64
  * @protected
65
65
  */
@@ -73,6 +73,11 @@ export class QuestionPreviewElements implements ListElements {
73
73
  * @protected
74
74
  */
75
75
  protected _shortDesc: string;
76
+ /**
77
+ * @type {string}
78
+ * @protected
79
+ */
80
+ protected _userClasses: string;
76
81
  /**
77
82
  * @type {string}
78
83
  * @protected
@@ -134,6 +139,7 @@ export class PagePreviewElements implements PageOverviewElements {
134
139
  hasRepeater: boolean;
135
140
  }
136
141
  export const baseElements: BaseSettings;
142
+ export const numberElements: NumberSettings;
137
143
  export namespace listElementsStub {
138
144
  export { list1Id };
139
145
  export { list2Id };
@@ -141,6 +147,69 @@ export namespace listElementsStub {
141
147
  export { list4Id };
142
148
  export { listElementsBase as baseElements };
143
149
  }
150
+ export class NumberPreviewElements {
151
+ /**
152
+ * @param {NumberSettings} baseSettings
153
+ */
154
+ constructor({ question, hintText, optional, shortDesc, userClasses, prefix, suffix, usePostcodeLookup, items, content }: NumberSettings);
155
+ /**
156
+ * @protected
157
+ */
158
+ protected _question: string;
159
+ /** @protected */
160
+ protected _hintText: string;
161
+ /** @protected */
162
+ protected _optional: boolean;
163
+ /**
164
+ * @type {string}
165
+ * @protected
166
+ */
167
+ protected _shortDesc: string;
168
+ /**
169
+ * @type {string}
170
+ * @protected
171
+ */
172
+ protected _userClasses: string;
173
+ /**
174
+ * @type {string}
175
+ * @protected
176
+ */
177
+ protected _prefix: string;
178
+ /**
179
+ * @type {string}
180
+ * @protected
181
+ */
182
+ protected _suffix: string;
183
+ /**
184
+ * @type {string}
185
+ * @protected
186
+ */
187
+ protected _content: string;
188
+ /**
189
+ *
190
+ * @type {ListElement[]}
191
+ * @private
192
+ */
193
+ private _items;
194
+ /**
195
+ * @protected
196
+ * @type {boolean}
197
+ */
198
+ protected _usePostcodeLookup: boolean;
199
+ afterInputsHTML: string;
200
+ /**
201
+ * @returns {NumberSettings}
202
+ */
203
+ get values(): NumberSettings;
204
+ /**
205
+ * @param {string} _value
206
+ */
207
+ setPreviewHTML(_value: string): void;
208
+ /**
209
+ * @param {HTMLElement} _value
210
+ */
211
+ setPreviewDOM(_value: HTMLElement): void;
212
+ }
144
213
  import type { BaseSettings } from '../../../form/form-editor/preview/types.js';
145
214
  import type { QuestionBaseModel } from '../../../form/form-editor/preview/types.js';
146
215
  import { Question } from '../../../form/form-editor/preview/question.js';
@@ -151,6 +220,7 @@ import type { PagePreviewPanelMacro } from '../../../form/form-editor/macros/typ
151
220
  import type { ListElements } from '../../../form/form-editor/preview/types.js';
152
221
  import type { AutocompleteElements } from '../../../form/form-editor/preview/types.js';
153
222
  import type { PageOverviewElements } from '../../../form/form-editor/preview/types.js';
223
+ import type { NumberSettings } from '../../../form/form-editor/preview/types.js';
154
224
  declare const list1Id: "414d82a3-4cab-416a-bd54-6b86fbd51120";
155
225
  declare const list2Id: "801385a4-81e6-4171-96c3-6c6727d97f22";
156
226
  declare const list3Id: "e6e3f621-b875-4ca3-a054-cca9149149dd";
@@ -1 +1 @@
1
- {"version":3,"file":"preview.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/__stubs__/preview.js"],"names":[],"mappings":"AA8PA;;;;GAIG;AACH,6DAJW,OAAO,CAAC,YAAY,CAAC,cACrB,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC,GAC1C,QAAQ,CAUpB;AAzQD;;GAEG;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;;GAEG;AACH;IAOE;;;;;;OAMG;IACH,qBANW,MAAM,aACN,MAAM,eACN,OAAO,mBACP,MAAM,gBACN,OAAO,EAcjB;IAzBD,iBAAQ;IACR,gBAAO;IACP,oBAAU;IACV,uBAAc;IACd,qBAAW;CAsBZ;AAED,2BAAuC,YAAY,CAQjD;;;;;;;;kCA+D8K,yCAAyC;uCAAzC,yCAAyC;yBAhRhM,4CAA4C;sCAgR2G,yCAAyC;mCAAzC,yCAAyC;kCAAzC,yCAAyC;2CAD/K,wCAAwC;kCAC8F,yCAAyC;0CAAzC,yCAAyC;0CAAzC,yCAAyC;AA7DzN,uBAAgB,sCAAsC,CAAA;AACtD,uBAAgB,sCAAsC,CAAA;AACtD,uBAAgB,sCAAsC,CAAA;AACtD,uBAAgB,sCAAsC,CAAA;AAEtD,gCAAoC,YAAY,CA4B9C"}
1
+ {"version":3,"file":"preview.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/__stubs__/preview.js"],"names":[],"mappings":"AAoRA;;;;GAIG;AACH,6DAJW,OAAO,CAAC,YAAY,CAAC,cACrB,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC,GAC1C,QAAQ,CAUpB;AA/RD;;GAEG;AACH;IAqBE;;;;OAIG;IACH,oCAHW,MAAM,kBACN,aAAa,GAFX,MAAM,CAMlB;IAtBD;;OAEG;IACH,wBAFW,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC,EAItD;IAVD;;OAEG;IACH,YAFU,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC,CAE5C;IASV;;;OAGG;IACH,yBAHW,MAAM,qBACN,iBAAiB,QAI3B;CAUF;AAED;;GAEG;AACH;IAqBE;;;;OAIG;IACH,oCAHW,MAAM,kBACN,aAAa,GAFX,MAAM,CAMlB;IAtBD;;OAEG;IACH,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ormGroupAfterInput;
49
49
  type?: 'text' | 'number' | 'boolean';
50
50
  classes?: string;
51
+ previewClasses?: string;
52
+ prefix?: {
53
+ text: string;
54
+ };
55
+ suffix?: {
56
+ text: string;
57
+ };
51
58
  }
52
59
  export interface AppPreviewPanelMacro extends AppPreviewPanelTabsMacro {
53
60
  model: QuestionBaseModel;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/macros/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAC9D,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,aAAa,EACnB,MAAM,yCAAyC,CAAA;AAChD,OAAO,EACL,KAAK,QAAQ,EACb,KAAK,UAAU,EACf,KAAK,gBAAgB,EACtB,MAAM,iCAAiC,CAAA;AAExC,MAAM,WAAW,sCAAsC;IACrD,sBAAsB,EAAE,EAAE,CAAA;IAC1B,UAAU,EAAE;QAAE,QAAQ,EAAE,OAAO,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;CAClD;AAED,MAAM,WAAW,yBAAyB;IACxC,cAAc,EAAE,sCAAsC,CAAA;IACtD,YAAY,EAAE;QACZ,WAAW,EAAE,UAAU,EAAE,CAAA;QACzB,cAAc,EAAE,UAAU,EAAE,CAAA;KAC7B,CAAA;IACD,YAAY,EAAE,aAAa,CAAA;CAC5B;AAED,MAAM,WAAW,wBAAwB;IACvC,YAAY,EAAE,aAAa,CAAA;IAC3B,cAAc,EAAE,MAAM,CAAA;IACtB,gBAAgB,EAAE,MAAM,CAAA;IACxB,cAAc,EAAE,sCAAsC,CAAA;IACtD,WAAW,EAAE,UAAU,EAAE,CAAA;IACzB,cAAc,EAAE,UAAU,EAAE,CAAA;CAC7B;AAED,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;CAC7B;AACD,MAAM,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AA;CACzB;AAED,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,iBAAiB,CAAA;IACxB,YAAY,EAAE,aAAa,CAAA;CAC5B;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,SAAS,EAAE;QAClB,IAAI,EAAE,MAAM,CAAA;QACZ,OAAO,EAAE,MAAM,CAAA;KAChB,CAAA;IACD,QAAQ,CAAC,QAAQ,EAAE;QACjB,IAAI,EAAE,MAAM,CAAA;QACZ,OAAO,EAAE,MAAM,CAAA;KAChB,CAAA;IACD,QAAQ,CAAC,UAAU,EAAE,oBAAoB,EAAE,CAAA;IAC3C,QAAQ,CAAC,YAAY,CAAC,EAAE;QACtB,IAAI,EAAE,MAAM,CAAA;QACZ,OAAO,EAAE,MAAM,CAAA;KAChB,CAAA;IACD,QAAQ,CAAC,cAAc,CAAC,EAAE;QACxB,IAAI,EAAE,MAAM,CAAA;QACZ,OAAO,EAAE,MAAM,CAAA;KAChB,CAAA;CACF;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,kBAAkB,EAAE,MAAM,CAAA;CAC3B;AAED,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;IACrB,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;IACvB,OAAO,EAAE;QACP,KAAK,EAAE,oBAAoB,EAAE,CAAA;KAC9B,CAAA;CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"component-elements.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/preview/component-elements.js"],"names":[],"mappings":"AAAA;;GAEG;AACH;IAME;;OAEG;IACH,uBAFW,YAAY,EAItB;IAVD;;;OAGG;IACH,sBAHU,YAAY,CAGZ;IAQV;;;OAGG;IACH,wBAFa,YAAY,CAaxB;IAED;;OAEG;IACH,cAFa,YAAY,CAKxB;IAED;;OAEG;IACH,wBAFW,WAAW,QAIrB;IAED;;OAEG;IACH,uBAFW,MAAM,QAIhB;CACF;sCAGqI,yCAAyC;kCACrG,2BAA2B;kCADiC,yCAAyC"}
1
+ {"version":3,"file":"component-elements.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/preview/component-elements.js"],"names":[],"mappings":"AAAA;;GAEG;AACH;IAME;;OAEG;IACH,uBAFW,YAAY,EAItB;IAVD;;;OAGG;IACH,sBAHU,YAAY,CAGZ;IAQV;;;OAGG;IACH,wBAFa,YAAY,CAiBxB;IAED;;OAEG;IACH,cAFa,YAAY,CAKxB;IAED;;OAEG;IACH,wBAFW,WAAW,QAIrB;IAED;;OAEG;IACH,uBAFW,MAAM,QAIhB;CACF;sCAGqI,yCAAyC;kCACrG,2BAA2B;kCADiC,yCAAyC"}
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/preview/helpers.js"],"names":[],"mappings":"AA2DA;;;;GAIG;AACH,gEAJW,gBAAgB,cAChB,cAAc,GACZ,CAAC,SAAS,EAAE,YAAY,KAAK,QAAQ,CA0CjD;sCAGsD,yCAAyC;oCAG7D,qCAAqC;kCACvC,2BAA2B;8BAH/B,4CAA4C"}
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/preview/helpers.js"],"names":[],"mappings":"AA8DA;;;;GAIG;AACH,gEAJW,gBAAgB,cAChB,cAAc,GACZ,CAAC,SAAS,EAAE,YAAY,KAAK,QAAQ,CA4CjD;sCAGsD,yCAAyC;oCAG7D,qCAAqC;kCACvC,2BAA2B;8BAH/B,4CAA4C"}
@@ -1,4 +1,127 @@
1
+ /**
2
+ * @implements {QuestionElements}
3
+ */
4
+ export class NumberComponentPreviewElements extends QuestionComponentElements implements QuestionElements {
5
+ /**
6
+ * @param {NumberFieldComponent} component
7
+ */
8
+ constructor(component: NumberFieldComponent);
9
+ _prefix: string | undefined;
10
+ _suffix: string | undefined;
11
+ /**
12
+ * @protected
13
+ * @returns {NumberSettings}
14
+ */
15
+ protected _getValues(): NumberSettings;
16
+ }
1
17
  export class NumberOnlyQuestion extends Question {
18
+ /**
19
+ * @param {NumberElements} htmlElements
20
+ * @param {QuestionRenderer} questionRenderer
21
+ */
22
+ constructor(htmlElements: NumberElements, questionRenderer: QuestionRenderer);
23
+ _prefix: string;
24
+ _suffix: string;
25
+ /**
26
+ * @param {string} val
27
+ */
28
+ set prefix(val: string);
29
+ get prefix(): string;
30
+ /**
31
+ * @param {string} val
32
+ */
33
+ set suffix(val: string);
34
+ get suffix(): string;
35
+ /**
36
+ * @protected
37
+ */
38
+ protected _renderInput(): {
39
+ suffix: {
40
+ text: string;
41
+ };
42
+ prefix: {
43
+ text: string;
44
+ };
45
+ id?: string;
46
+ name?: string;
47
+ content?: string;
48
+ attributes?: Record<string, string>;
49
+ label?: import("../../../form/form-editor/preview/types.js").DefaultComponent;
50
+ hint?: import("../../../form/form-editor/preview/types.js").DefaultComponent;
51
+ fieldset?: import("../../../form/form-editor/preview/types.js").GovukFieldset;
52
+ items?: import("../types.js").ListItemReadonly[] | import("../types.js").DateItem[];
53
+ text?: string;
54
+ formGroup?: import("../macros/types.js").FormGroupAfterInput;
55
+ type?: "text" | "number" | "boolean";
56
+ classes?: string;
57
+ previewClasses?: string;
58
+ } | {
59
+ suffix?: {
60
+ text: string;
61
+ };
62
+ prefix: {
63
+ text: string;
64
+ };
65
+ id?: string;
66
+ name?: string;
67
+ content?: string;
68
+ attributes?: Record<string, string>;
69
+ label?: import("../../../form/form-editor/preview/types.js").DefaultComponent;
70
+ hint?: import("../../../form/form-editor/preview/types.js").DefaultComponent;
71
+ fieldset?: import("../../../form/form-editor/preview/types.js").GovukFieldset;
72
+ items?: import("../types.js").ListItemReadonly[] | import("../types.js").DateItem[];
73
+ text?: string;
74
+ formGroup?: import("../macros/types.js").FormGroupAfterInput;
75
+ type?: "text" | "number" | "boolean";
76
+ classes?: string;
77
+ previewClasses?: string;
78
+ } | {
79
+ suffix: {
80
+ text: string;
81
+ };
82
+ prefix?: {
83
+ text: string;
84
+ };
85
+ id?: string;
86
+ name?: string;
87
+ content?: string;
88
+ attributes?: Record<string, string>;
89
+ label?: import("../../../form/form-editor/preview/types.js").DefaultComponent;
90
+ hint?: import("../../../form/form-editor/preview/types.js").DefaultComponent;
91
+ fieldset?: import("../../../form/form-editor/preview/types.js").GovukFieldset;
92
+ items?: import("../types.js").ListItemReadonly[] | import("../types.js").DateItem[];
93
+ text?: string;
94
+ formGroup?: import("../macros/types.js").FormGroupAfterInput;
95
+ type?: "text" | "number" | "boolean";
96
+ classes?: string;
97
+ previewClasses?: string;
98
+ } | {
99
+ suffix?: {
100
+ text: string;
101
+ };
102
+ prefix?: {
103
+ text: string;
104
+ };
105
+ id?: string;
106
+ name?: string;
107
+ content?: string;
108
+ attributes?: Record<string, string>;
109
+ label?: import("../../../form/form-editor/preview/types.js").DefaultComponent;
110
+ hint?: import("../../../form/form-editor/preview/types.js").DefaultComponent;
111
+ fieldset?: import("../../../form/form-editor/preview/types.js").GovukFieldset;
112
+ items?: import("../types.js").ListItemReadonly[] | import("../types.js").DateItem[];
113
+ text?: string;
114
+ formGroup?: import("../macros/types.js").FormGroupAfterInput;
115
+ type?: "text" | "number" | "boolean";
116
+ classes?: string;
117
+ previewClasses?: string;
118
+ };
2
119
  }
120
+ import type { QuestionElements } from '../../../form/form-editor/preview/types.js';
121
+ import { QuestionComponentElements } from '../../../form/form-editor/preview/question.js';
122
+ import type { NumberSettings } from '../../../form/form-editor/preview/types.js';
123
+ import type { NumberFieldComponent } from '../../../components/types.js';
3
124
  import { Question } from '../../../form/form-editor/preview/question.js';
125
+ import type { NumberElements } from '../../../form/form-editor/preview/types.js';
126
+ import type { QuestionRenderer } from '../../../form/form-editor/preview/types.js';
4
127
  //# sourceMappingURL=number-only.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"number-only.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/preview/number-only.js"],"names":[],"mappings":"AAGA;CAuBC;yBAzBwB,4CAA4C"}
1
+ {"version":3,"file":"number-only.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/preview/number-only.js"],"names":[],"mappings":"AAMA;;GAEG;AACH;IACE;;OAEG;IACH,uBAFW,oBAAoB,EAM9B;IAFC,4BAAuC;IACvC,4BAAuC;IAGzC;;;OAGG;IACH,wBAFa,cAAc,CAQ1B;CACF;AAED;IAME;;;OAGG;IACH,0BAHW,cAAc,oBACd,gBAAgB,EAO1B;IAFC,gBAAyC;IACzC,gBAAyC;IAgB3C;;OAEG;IACH,gBAFW,MAAM,EAKhB;IAVD,cAKW,MAAM,CAHhB;IAcD;;OAEG;IACH,gBAFW,MAAM,EAKhB;IAVD,cAKW,MAAM,CAHhB;IAUD;;OAEG;IACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAQC;CACF;sCAGyG,yCAAyC;0CA7F5I,4CAA4C;oCA6FuD,yCAAyC;0CAC1G,2BAA2B;yBA9F7D,4CAA4C;oCA6FuD,yCAAyC;sCAAzC,yCAAyC"}
@@ -28,6 +28,11 @@ export class Question extends PreviewComponent {
28
28
  * @private
29
29
  */
30
30
  private _hintText;
31
+ /**
32
+ * @type {string}
33
+ * @private
34
+ */
35
+ private _userClasses;
31
36
  /**
32
37
  * @type {DefaultComponent}
33
38
  * @protected
@@ -41,6 +46,14 @@ export class Question extends PreviewComponent {
41
46
  * @type {string}
42
47
  */
43
48
  get hintText(): string;
49
+ /**
50
+ * @param {string} value
51
+ */
52
+ set userClasses(value: string);
53
+ /**
54
+ * @type {string}
55
+ */
56
+ get userClasses(): string;
44
57
  }
45
58
  import type { QuestionElements } from '../../../form/form-editor/preview/types.js';
46
59
  import { ComponentElements } from '../../../form/form-editor/preview/component-elements.js';
@@ -1 +1 @@
1
- {"version":3,"file":"question.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/preview/question.js"],"names":[],"mappings":"AAIA;;GAEG;AACH;IAME;;OAEG;IACH,uBAFW,iBAAiB,EAK3B;IAXD;;;OAGG;IACH,sBAHU,iBAAiB,CAGjB;CAoBX;AAED;;;;;;;;;GASG;AACH;IAwBI;;;OAGG;IACH,kBAAyB;IAG3B;;;OAGG;IACH,sBAHU,gBAAgB,CAazB;IAiBD;;OAEG;IACH,oBAFW,MAAM,EAKhB;IAbD;;OAEG;IACH,gBAFU,MAAM,CAIf;CASF;sCAGyG,yCAAyC;kCAnHjH,sDAAsD;uCAoHlD,2BAA2B;iCAnHhC,2CAA2C;sCAkH8B,yCAAyC"}
1
+ {"version":3,"file":"question.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/preview/question.js"],"names":[],"mappings":"AAIA;;GAEG;AACH;IAME;;OAEG;IACH,uBAFW,iBAAiB,EAK3B;IAXD;;;OAGG;IACH,sBAHU,iBAAiB,CAGjB;CAqBX;AAED;;;;;;;;;GASG;AACH;IAwBI;;;OAGG;IACH,kBAAyB;IACzB;;;OAGG;IACH,qBAA+B;IAGjC;;;OAGG;IACH,sBAHU,gBAAgB,CAazB;IA0BD;;OAEG;IACH,oBAFW,MAAM,EAKhB;IAbD;;OAEG;IACH,gBAFU,MAAM,CAIf;IAiBD;;OAEG;IACH,uBAFW,MAAM,EAKhB;IAbD;;OAEG;IACH,mBAFU,MAAM,CAIf;CASF;sCAGyG,yCAAyC;kCAjJjH,sDAAsD;uCAkJlD,2BAA2B;iCAjJhC,2CAA2C;sCAgJ8B,yCAAyC"}
@@ -17,6 +17,7 @@ export interface BaseSettings {
17
17
  hintText: string;
18
18
  optional: boolean;
19
19
  shortDesc: string;
20
+ userClasses: string;
20
21
  items: ListElement[];
21
22
  content: string;
22
23
  attributes?: Record<string, string>;
@@ -48,6 +49,13 @@ export interface QuestionElements extends DomElementsBase {
48
49
  export interface AutocompleteElements extends QuestionElements {
49
50
  autocompleteOptions: string;
50
51
  }
52
+ export interface NumberSettings extends BaseSettings {
53
+ prefix: string;
54
+ suffix: string;
55
+ }
56
+ export interface NumberElements extends DomElementsBase {
57
+ readonly values: NumberSettings;
58
+ }
51
59
  export interface RenderBase {
52
60
  render(questionTemplate: string, renderContext: RenderContext): void;
53
61
  }
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/preview/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACvB,MAAM,wCAAwC,CAAA;AAC/C,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,gDAAgD,CAAA;AAC1F,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,8CAA8C,CAAA;AACrF,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,iDAAiD,CAAA;AAC3F,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,iDAAiD,CAAA;AAC3F,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,+CAA+C,CAAA;AACvF,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,gDAAgD,CAAA;AACzF,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,4CAA4C,CAAA;AAC1E,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,kDAAkD,CAAA;AAC7F,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,mDAAmD,CAAA;AAC/F,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,gDAAgD,CAAA;AACzF,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,8CAA8C,CAAA;AACrF,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,iCAAiC,CAAA;AAClE,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,wCAAwC,CAAA;AAC/E,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,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A;CAC9B;AAED,MAAM,MAAM,aAAa,GAAG,qBAAqB,GAAG,iBAAiB,CAAA;AAErE,MAAM,WAAW,WAAW;IAC1B,SAAS,CAAC,gBAAgB,EAAE,MAAM,EAAE,aAAa,EAAE,aAAa,GAAG,MAAM,CAAA;CAC1E;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,CAAC,gBAAgB,EAAE,MAAM,EAAE,iBAAiB,EAAE,iBAAiB,GAAG,IAAI,CAAA;CAC7E;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE,qBAAqB,GAAG,IAAI,CAAA;CACvE;AAED,MAAM,MAAM,QAAQ,GAAG,gBAAgB,GAAG,YAAY,CAAA;AAEtD,MAAM,WAAW,YAAa,SAAQ,gBAAgB;IACpD,eAAe,EAAE,MAAM,CAAA;CACxB;AAED,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,oBAAqB,SAAQ,uBAAuB;IACnE,UAAU,EAAE,OAAO,CAAA;IACnB,cAAc,EAAE,MAAM,GAAG,SAAS,CAAA;IAClC,WAAW,EAAE,OAAO,CAAA;CACrB;AAED,MAAM,WAAW,mBAAoB,SAAQ,uBAAuB;IAClE,WAAW,EAAE,OAAO,CAAA;CACrB;AAED,MAAM,MAAM,eAAe,GACvB,iBAAiB,GACjB,oBAAoB,GACpB,oBAAoB,GACpB,kBAAkB,GAClB,mBAAmB,GACnB,QAAQ,GACR,qBAAqB,GACrB,sBAAsB,GACtB,mBAAmB,GACnB,iBAAiB,GACjB,oBAAoB,CAAA"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/preview/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACvB,MAAM,wCAAwC,CAAA;AAC/C,OAAO,EAAE,KA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G,MAAM,CAAA;CAC1E;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,CAAC,gBAAgB,EAAE,MAAM,EAAE,iBAAiB,EAAE,iBAAiB,GAAG,IAAI,CAAA;CAC7E;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE,qBAAqB,GAAG,IAAI,CAAA;CACvE;AAED,MAAM,MAAM,QAAQ,GAAG,gBAAgB,GAAG,YAAY,CAAA;AAEtD,MAAM,WAAW,YAAa,SAAQ,gBAAgB;IACpD,eAAe,EAAE,MAAM,CAAA;CACxB;AAED,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,oBAAqB,SAAQ,uBAAuB;IACnE,UAAU,EAAE,OAAO,CAAA;IACnB,cAAc,EAAE,MAAM,GAAG,SAAS,CAAA;IAClC,WAAW,EAAE,OAAO,CAAA;CACrB;AAED,MAAM,WAAW,mBAAoB,SAAQ,uBAAuB;IAClE,WAAW,EAAE,OAAO,CAAA;CACrB;AAED,MAAM,MAAM,eAAe,GACvB,iBAAiB,GACjB,oBAAoB,GACpB,oBAAoB,GACpB,kBAAkB,GAClB,mBAAmB,GACnB,QAAQ,GACR,qBAAqB,GACrB,sBAAsB,GACtB,mBAAmB,GACnB,iBAAiB,GACjB,oBAAoB,CAAA"}
@@ -32,6 +32,13 @@ export class UkAddressQuestion extends FieldsetQuestion {
32
32
  formGroup?: import("../macros/types.js").FormGroupAfterInput;
33
33
  type?: "text" | "number" | "boolean";
34
34
  classes?: string;
35
+ previewClasses?: string;
36
+ prefix?: {
37
+ text: string;
38
+ };
39
+ suffix?: {
40
+ text: string;
41
+ };
35
42
  };
36
43
  }
37
44
  import type { QuestionElements } from '../../../form/form-editor/preview/types.js';