|
| 1 | +import { AccordionSettingValues } from '../accordion'; |
| 2 | +import { AttachmentSettingValues } from '../attachment'; |
| 3 | +import { TextSize } from '../text'; |
| 4 | +import { PrefillKey } from './prefill'; |
| 5 | + |
| 6 | +export type AddressType = 'NORWEGIAN_ADDRESS' | 'POST_OFFICE_BOX' | 'FOREIGN_ADDRESS'; |
| 7 | +export type InputMode = 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search'; |
| 8 | + |
| 9 | +type ComponentDataSrc = 'values' | 'url' | 'json' | 'custom' | 'resource'; |
| 10 | +export interface ComponentData { |
| 11 | + values?: ComponentValue[]; |
| 12 | + url?: string; |
| 13 | + custom?: any; |
| 14 | +} |
| 15 | + |
| 16 | +export type AttachmentType = 'default' | 'other'; |
| 17 | +export interface ComponentValue { |
| 18 | + value: string; |
| 19 | + label: string; |
| 20 | + description?: string; |
| 21 | +} |
| 22 | + |
| 23 | +export interface CustomLabels { |
| 24 | + [key: string]: string; |
| 25 | +} |
| 26 | + |
| 27 | +export interface Component { |
| 28 | + id?: string; |
| 29 | + navId?: string; |
| 30 | + key: string; |
| 31 | + label: string; |
| 32 | + customLabels?: CustomLabels; |
| 33 | + type: string; |
| 34 | + content?: string; |
| 35 | + calculateValue?: string; |
| 36 | + allowCalculateOverride?: boolean; |
| 37 | + data?: ComponentData; |
| 38 | + dataSrc?: ComponentDataSrc; |
| 39 | + validate?: ComponentValidate; |
| 40 | + conditional?: ComponentConditional; |
| 41 | + customConditional?: string; |
| 42 | + valueProperty?: string; |
| 43 | + labelProperty?: string; |
| 44 | + properties?: ComponentProperties; |
| 45 | + component?: Component; |
| 46 | + components?: Component[]; |
| 47 | + otherDocumentation?: boolean; |
| 48 | + isAttachmentPanel?: boolean; |
| 49 | + prefillKey?: PrefillKey; |
| 50 | + values?: ComponentValue[]; |
| 51 | + attachmentValues?: AttachmentSettingValues; |
| 52 | + accordionValues?: AccordionSettingValues; |
| 53 | + attachmentType?: AttachmentType; |
| 54 | + hideLabel?: boolean; |
| 55 | + description?: string; |
| 56 | + suffix?: string; |
| 57 | + prefix?: string; |
| 58 | + title?: string; |
| 59 | + html?: string; |
| 60 | + legend?: string; |
| 61 | + additionalDescriptionLabel?: string; |
| 62 | + additionalDescriptionText?: string; |
| 63 | + contentForPdf?: string; |
| 64 | + altText?: string; |
| 65 | + buttonText?: string; |
| 66 | + addAnother?: string; |
| 67 | + removeAnother?: string; |
| 68 | + input?: boolean; |
| 69 | + readOnly?: boolean; |
| 70 | + weight?: number; |
| 71 | + tag?: string; |
| 72 | + collapsible?: boolean; |
| 73 | + collapsed?: boolean; |
| 74 | + fieldSize?: string; |
| 75 | + titleSize?: TextSize; |
| 76 | + autocomplete?: string; |
| 77 | + spellCheck?: boolean; |
| 78 | + rows?: number; |
| 79 | + editor?: string; |
| 80 | + wysiwyg?: object | boolean; |
| 81 | + as?: string; |
| 82 | + style?: object; |
| 83 | + theme?: string; |
| 84 | + defaultValue?: string | number | boolean | any[] | object; |
| 85 | + tooltip?: string; |
| 86 | + reorder?: boolean; |
| 87 | + dataGridLabel?: boolean; |
| 88 | + alerttype?: string; |
| 89 | + fileMaxSize?: string; |
| 90 | + storage?: string; |
| 91 | + image?: any; |
| 92 | + filePattern?: string; |
| 93 | + webcam?: boolean; |
| 94 | + multiple?: boolean; |
| 95 | + customDefaultValue?: string; |
| 96 | + keyLabel?: string; |
| 97 | + valueComponent?: Component; |
| 98 | + isInline?: boolean; |
| 99 | + textDisplay?: 'form' | 'formPdf' | 'pdf'; |
| 100 | + autoExpand?: boolean; |
| 101 | + customClass?: string; |
| 102 | + validateOn?: string; |
| 103 | + isNavDataGrid?: boolean; |
| 104 | + hidden?: boolean; |
| 105 | + clearOnHide?: boolean; |
| 106 | + specificEarliestAllowedDate?: string; |
| 107 | + specificLatestAllowedDate?: string; |
| 108 | + beforeDateInputKey?: string; |
| 109 | + mayBeEqual?: string; |
| 110 | + earliestAllowedDate?: string; |
| 111 | + latestAllowedDate?: string; |
| 112 | + getValue?: () => string; |
| 113 | + rerender?: () => void; |
| 114 | + onChange?: (props) => void; |
| 115 | + inputType?: InputMode; |
| 116 | + ignoreNorway?: boolean; |
| 117 | + tree?: boolean; |
| 118 | + path?: string; |
| 119 | + protected?: boolean; |
| 120 | + disableAddingRemovingRows?: boolean; |
| 121 | + addressPriority?: 'bostedsadresse' | 'oppholdsadresse' | 'kontaktadresse'; |
| 122 | + addressType?: AddressType; |
| 123 | + prefillValue?: string | object; |
| 124 | + protectedApiKey?: boolean; |
| 125 | + yourInformation?: boolean; |
| 126 | + widthPercent?: number; |
| 127 | +} |
| 128 | + |
| 129 | +export interface ComponentProperties { |
| 130 | + vedleggstittel?: string; |
| 131 | + vedleggskode?: string; |
| 132 | + vedleggskjema?: string; |
| 133 | +} |
| 134 | + |
| 135 | +export interface Attachment { |
| 136 | + vedleggstittel?: string; |
| 137 | + vedleggskode?: string; |
| 138 | + label?: string; |
| 139 | +} |
| 140 | + |
| 141 | +export interface Panel extends Component { |
| 142 | + title: string; |
| 143 | +} |
| 144 | + |
| 145 | +export interface ComponentValidate { |
| 146 | + custom?: string; |
| 147 | + json?: string; |
| 148 | + required?: boolean; |
| 149 | + pattern?: string; |
| 150 | + patternMessage?: string; |
| 151 | + min?: number; |
| 152 | + max?: number; |
| 153 | + minLength?: number; |
| 154 | + maxLength?: number; |
| 155 | + minYear?: number; |
| 156 | + maxYear?: number; |
| 157 | + digitsOnly?: number; |
| 158 | +} |
| 159 | + |
| 160 | +export interface ComponentConditional { |
| 161 | + when?: string; |
| 162 | + json?: object; |
| 163 | +} |
0 commit comments