@defra/forms-model 3.0.205 → 3.0.206
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/dist/module/components/component-types.js +0 -1
- package/dist/module/components/component-types.js.map +1 -1
- package/dist/module/components/helpers.js +3 -3
- package/dist/module/components/helpers.js.map +1 -1
- package/dist/module/components/types.js.map +1 -1
- package/dist/module/conditions/condition-operators.js +2 -1
- package/dist/module/conditions/condition-operators.js.map +1 -1
- package/dist/types/components/component-types.d.ts.map +1 -1
- package/dist/types/components/helpers.d.ts +1 -1
- package/dist/types/components/helpers.d.ts.map +1 -1
- package/dist/types/components/types.d.ts +2 -2
- package/dist/types/components/types.d.ts.map +1 -1
- package/dist/types/conditions/condition-operators.d.ts +5 -1
- package/dist/types/conditions/condition-operators.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/component-types.ts +0 -1
- package/src/components/helpers.ts +3 -3
- package/src/components/types.ts +1 -1
- package/src/conditions/condition-operators.ts +4 -3
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"component-types.js","names":["ComponentSubType","ComponentType","ComponentTypes","name","type","TextField","title","subType","Field","hint","options","schema","MultilineTextField","YesNoField","TimeField","DatePartsField","MonthYearField","SelectField","ListField","list","AutocompleteField","RadiosField","CheckboxesField","NumberField","UkAddressField","TelephoneNumberField","EmailAddressField","Html","Content","content","InsetText","Details","List"],"sources":["../../../src/components/component-types.ts"],"sourcesContent":["import { ComponentSubType, ComponentType } from '~/src/components/enums.js'\nimport { type ComponentDef } from '~/src/components/types.js'\n\nexport const ComponentTypes: ComponentDef[] = [\n {\n name: 'TextField',\n type: ComponentType.TextField,\n title: 'Text field',\n subType: ComponentSubType.Field,\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'MultilineTextField',\n type: ComponentType.MultilineTextField,\n title: 'Multiline text field',\n subType: ComponentSubType.Field,\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'YesNoField',\n type: ComponentType.YesNoField,\n title: 'Yes/No field',\n subType: ComponentSubType.Field,\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'TimeField',\n type: ComponentType.TimeField,\n title: 'Time field',\n subType: ComponentSubType.Field,\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'DatePartsField',\n type: ComponentType.DatePartsField,\n title: 'Date field',\n subType: ComponentSubType.Field,\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'MonthYearField',\n type: ComponentType.MonthYearField,\n title: 'Month & year field',\n subType: ComponentSubType.Field,\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'SelectField',\n type: ComponentType.SelectField,\n title: 'Select field',\n subType: ComponentSubType.ListField,\n options: {},\n schema: {},\n list: ''\n },\n {\n name: 'AutocompleteField',\n type: ComponentType.AutocompleteField,\n title: 'Autocomplete field',\n subType: ComponentSubType.ListField,\n options: {},\n schema: {},\n list: ''\n },\n {\n name: 'RadiosField',\n type: ComponentType.RadiosField,\n title: 'Radios field',\n subType: ComponentSubType.ListField,\n options: {},\n schema: {},\n list: ''\n },\n {\n name: 'CheckboxesField',\n type: ComponentType.CheckboxesField,\n title: 'Checkboxes field',\n subType: ComponentSubType.ListField,\n options: {},\n schema: {},\n list: ''\n },\n {\n name: 'NumberField',\n type: ComponentType.NumberField,\n title: 'Number field',\n subType: ComponentSubType.Field,\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'UkAddressField',\n type: ComponentType.UkAddressField,\n title: 'UK address field',\n subType: ComponentSubType.Field,\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'TelephoneNumberField',\n type: ComponentType.TelephoneNumberField,\n title: 'Telephone number field',\n subType: ComponentSubType.Field,\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'EmailAddressField',\n type: ComponentType.EmailAddressField,\n title: 'Email address field',\n subType: ComponentSubType.Field,\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'Html',\n type: ComponentType.Html,\n title: 'Html',\n subType: ComponentSubType.Content,\n content: '',\n options: {},\n schema: {}\n },\n {\n name: 'InsetText',\n type: ComponentType.InsetText,\n title: 'Inset text',\n subType: ComponentSubType.Content,\n content: '',\n options: {},\n schema: {}\n },\n {\n name: 'Details',\n type: ComponentType.Details,\n title: 'Details',\n subType: ComponentSubType.Content,\n content: '',\n options: {},\n schema: {}\n },\n {\n name: 'List',\n type: ComponentType.List,\n title: 'List',\n
|
1
|
+
{"version":3,"file":"component-types.js","names":["ComponentSubType","ComponentType","ComponentTypes","name","type","TextField","title","subType","Field","hint","options","schema","MultilineTextField","YesNoField","TimeField","DatePartsField","MonthYearField","SelectField","ListField","list","AutocompleteField","RadiosField","CheckboxesField","NumberField","UkAddressField","TelephoneNumberField","EmailAddressField","Html","Content","content","InsetText","Details","List"],"sources":["../../../src/components/component-types.ts"],"sourcesContent":["import { ComponentSubType, ComponentType } from '~/src/components/enums.js'\nimport { type ComponentDef } from '~/src/components/types.js'\n\nexport const ComponentTypes: ComponentDef[] = [\n {\n name: 'TextField',\n type: ComponentType.TextField,\n title: 'Text field',\n subType: ComponentSubType.Field,\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'MultilineTextField',\n type: ComponentType.MultilineTextField,\n title: 'Multiline text field',\n subType: ComponentSubType.Field,\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'YesNoField',\n type: ComponentType.YesNoField,\n title: 'Yes/No field',\n subType: ComponentSubType.Field,\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'TimeField',\n type: ComponentType.TimeField,\n title: 'Time field',\n subType: ComponentSubType.Field,\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'DatePartsField',\n type: ComponentType.DatePartsField,\n title: 'Date field',\n subType: ComponentSubType.Field,\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'MonthYearField',\n type: ComponentType.MonthYearField,\n title: 'Month & year field',\n subType: ComponentSubType.Field,\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'SelectField',\n type: ComponentType.SelectField,\n title: 'Select field',\n subType: ComponentSubType.ListField,\n options: {},\n schema: {},\n list: ''\n },\n {\n name: 'AutocompleteField',\n type: ComponentType.AutocompleteField,\n title: 'Autocomplete field',\n subType: ComponentSubType.ListField,\n options: {},\n schema: {},\n list: ''\n },\n {\n name: 'RadiosField',\n type: ComponentType.RadiosField,\n title: 'Radios field',\n subType: ComponentSubType.ListField,\n options: {},\n schema: {},\n list: ''\n },\n {\n name: 'CheckboxesField',\n type: ComponentType.CheckboxesField,\n title: 'Checkboxes field',\n subType: ComponentSubType.ListField,\n options: {},\n schema: {},\n list: ''\n },\n {\n name: 'NumberField',\n type: ComponentType.NumberField,\n title: 'Number field',\n subType: ComponentSubType.Field,\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'UkAddressField',\n type: ComponentType.UkAddressField,\n title: 'UK address field',\n subType: ComponentSubType.Field,\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'TelephoneNumberField',\n type: ComponentType.TelephoneNumberField,\n title: 'Telephone number field',\n subType: ComponentSubType.Field,\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'EmailAddressField',\n type: ComponentType.EmailAddressField,\n title: 'Email address field',\n subType: ComponentSubType.Field,\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'Html',\n type: ComponentType.Html,\n title: 'Html',\n subType: ComponentSubType.Content,\n content: '',\n options: {},\n schema: {}\n },\n {\n name: 'InsetText',\n type: ComponentType.InsetText,\n title: 'Inset text',\n subType: ComponentSubType.Content,\n content: '',\n options: {},\n schema: {}\n },\n {\n name: 'Details',\n type: ComponentType.Details,\n title: 'Details',\n subType: ComponentSubType.Content,\n content: '',\n options: {},\n schema: {}\n },\n {\n name: 'List',\n type: ComponentType.List,\n title: 'List',\n options: {},\n schema: {},\n list: ''\n }\n]\n"],"mappings":"AAAA,SAASA,gBAAgB,EAAEC,aAAa;AAGxC,OAAO,MAAMC,cAA8B,GAAG,CAC5C;EACEC,IAAI,EAAE,WAAW;EACjBC,IAAI,EAAEH,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a,CAAC8B,OAAO;EAC3BzB,KAAK,EAAE,SAAS;EAChBC,OAAO,EAAEP,gBAAgB,CAAC4B,OAAO;EACjCC,OAAO,EAAE,EAAE;EACXnB,OAAO,EAAE,CAAC,CAAC;EACXC,MAAM,EAAE,CAAC;AACX,CAAC,EACD;EACER,IAAI,EAAE,MAAM;EACZC,IAAI,EAAEH,aAAa,CAAC+B,IAAI;EACxB1B,KAAK,EAAE,MAAM;EACbI,OAAO,EAAE,CAAC,CAAC;EACXC,MAAM,EAAE,CAAC,CAAC;EACVQ,IAAI,EAAE;AACR,CAAC,CACF","ignoreList":[]}
|
@@ -6,7 +6,7 @@ export function hasConditionSupport(component) {
|
|
6
6
|
return isConditionalType(component?.type);
|
7
7
|
}
|
8
8
|
export function isConditionalType(type) {
|
9
|
-
const allowedTypes = [ComponentType.CheckboxesField, ComponentType.DatePartsField, ComponentType.EmailAddressField, ComponentType.MultilineTextField, ComponentType.NumberField, ComponentType.TextField, ComponentType.TimeField, ComponentType.YesNoField];
|
9
|
+
const allowedTypes = [ComponentType.RadiosField, ComponentType.CheckboxesField, ComponentType.DatePartsField, ComponentType.EmailAddressField, ComponentType.MultilineTextField, ComponentType.NumberField, ComponentType.TextField, ComponentType.TimeField, ComponentType.YesNoField];
|
10
10
|
return !!type && allowedTypes.includes(type);
|
11
11
|
}
|
12
12
|
|
@@ -14,12 +14,12 @@ export function isConditionalType(type) {
|
|
14
14
|
* Filter known components with content fields
|
15
15
|
*/
|
16
16
|
export function hasContentField(component) {
|
17
|
-
const allowedTypes = [ComponentType.Details, ComponentType.Html, ComponentType.InsetText
|
17
|
+
const allowedTypes = [ComponentType.Details, ComponentType.Html, ComponentType.InsetText];
|
18
18
|
return !!component?.type && allowedTypes.includes(component.type);
|
19
19
|
}
|
20
20
|
|
21
21
|
/**
|
22
|
-
* Filter known components with text editor
|
22
|
+
* Filter known components with text editor or list select
|
23
23
|
*/
|
24
24
|
export function hasEditor(component) {
|
25
25
|
const allowedTypes = [ComponentType.TextField, ComponentType.EmailAddressField, ComponentType.TelephoneNumberField, ComponentType.MultilineTextField, ComponentType.NumberField, ComponentType.AutocompleteField, ComponentType.SelectField, ComponentType.RadiosField, ComponentType.CheckboxesField, ComponentType.List, ComponentType.Details, ComponentType.Html, ComponentType.InsetText, ComponentType.DatePartsField];
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"helpers.js","names":["ComponentType","hasConditionSupport","component","isConditionalType","type","allowedTypes","CheckboxesField","DatePartsField","EmailAddressField","MultilineTextField","NumberField","TextField","TimeField","YesNoField","includes","hasContentField","Details","Html","InsetText","
|
1
|
+
{"version":3,"file":"helpers.js","names":["ComponentType","hasConditionSupport","component","isConditionalType","type","allowedTypes","RadiosField","CheckboxesField","DatePartsField","EmailAddressField","MultilineTextField","NumberField","TextField","TimeField","YesNoField","includes","hasContentField","Details","Html","InsetText","hasEditor","TelephoneNumberField","AutocompleteField","SelectField","List","hasInputField","MonthYearField","UkAddressField","hasListField","hasSelectionFields","hasTitle","deniedTypes"],"sources":["../../../src/components/helpers.ts"],"sourcesContent":["import { ComponentType } from '~/src/components/enums.js'\nimport {\n type InputFieldsComponentsDef,\n type ComponentDef,\n type ConditionalComponentsDef,\n type ConditionalComponentType,\n type ContentComponentsDef,\n type HtmlComponent,\n type InsetTextComponent,\n type ListComponentsDef,\n type SelectionComponentsDef,\n type EditorComponentsDef\n} from '~/src/components/types.js'\n\n/**\n * Filter known components with support for conditions\n */\nexport function hasConditionSupport(\n component?: Partial<ComponentDef>\n): component is ConditionalComponentsDef {\n return isConditionalType(component?.type)\n}\n\nexport function isConditionalType(\n type?: ComponentType\n): type is ConditionalComponentType {\n const allowedTypes = [\n ComponentType.RadiosField,\n ComponentType.CheckboxesField,\n ComponentType.DatePartsField,\n ComponentType.EmailAddressField,\n ComponentType.MultilineTextField,\n ComponentType.NumberField,\n ComponentType.TextField,\n ComponentType.TimeField,\n ComponentType.YesNoField\n ]\n\n return !!type && allowedTypes.includes(type)\n}\n\n/**\n * Filter known components with content fields\n */\nexport function hasContentField(\n component?: Partial<ComponentDef>\n): component is ContentComponentsDef {\n const allowedTypes = [\n ComponentType.Details,\n ComponentType.Html,\n ComponentType.InsetText\n ]\n\n return !!component?.type && allowedTypes.includes(component.type)\n}\n\n/**\n * Filter known components with text editor or list select\n */\nexport function hasEditor(\n component?: Partial<ComponentDef>\n): component is EditorComponentsDef {\n const allowedTypes = [\n ComponentType.TextField,\n ComponentType.EmailAddressField,\n ComponentType.TelephoneNumberField,\n ComponentType.MultilineTextField,\n ComponentType.NumberField,\n ComponentType.AutocompleteField,\n ComponentType.SelectField,\n ComponentType.RadiosField,\n ComponentType.CheckboxesField,\n ComponentType.List,\n ComponentType.Details,\n ComponentType.Html,\n ComponentType.InsetText,\n ComponentType.DatePartsField\n ]\n\n return !!component?.type && allowedTypes.includes(component.type)\n}\n\n/**\n * Filter known components with input fields\n */\nexport function hasInputField(\n component?: Partial<ComponentDef>\n): component is InputFieldsComponentsDef {\n const allowedTypes = [\n ComponentType.TextField,\n ComponentType.EmailAddressField,\n ComponentType.NumberField,\n ComponentType.MultilineTextField,\n ComponentType.TelephoneNumberField,\n ComponentType.YesNoField,\n ComponentType.MonthYearField,\n ComponentType.TimeField,\n ComponentType.UkAddressField\n ]\n\n return !!component?.type && allowedTypes.includes(component.type)\n}\n\n/**\n * Filter known components with lists\n */\nexport function hasListField(\n component?: Partial<ComponentDef>\n): component is ListComponentsDef {\n const allowedTypes = [\n ComponentType.AutocompleteField,\n ComponentType.List,\n ComponentType.RadiosField,\n ComponentType.SelectField,\n ComponentType.CheckboxesField\n ]\n\n return !!component?.type && allowedTypes.includes(component.type)\n}\n\n/**\n * Filter known components with selection fields\n */\nexport function hasSelectionFields(\n component?: Partial<ComponentDef>\n): component is SelectionComponentsDef {\n const allowedTypes = [\n ComponentType.CheckboxesField,\n ComponentType.RadiosField,\n ComponentType.SelectField,\n ComponentType.YesNoField\n ]\n\n return !!component?.type && allowedTypes.includes(component.type)\n}\n\n/**\n * Filter known components with titles\n */\nexport function hasTitle(\n component?: Partial<ComponentDef>\n): component is Exclude<ComponentDef, InsetTextComponent | HtmlComponent> {\n const deniedTypes = [ComponentType.InsetText, ComponentType.Html]\n return !!component?.type && !deniedTypes.includes(component.type)\n}\n"],"mappings":"AAAA,SAASA,aAAa;AActB;AACA;AACA;AACA,OAAO,SAASC,mBAAmBA,CACjCC,SAAiC,EACM;EACvC,OAAOC,iBAAiB,CAACD,SAAS,EAAEE,IAAI,CAAC;AAC3C;AAEA,OAAO,SAASD,iBAAiBA,CAC/BC,IAAoB,EACc;EAClC,MAAMC,YAAY,GAAG,CACnBL,aAAa,CAACM,WAAW,EACzBN,aAAa,CAACO,eAAe,EAC7BP,aAAa,CAACQ,cAAc,EAC5BR,aAAa,CAACS,iBAAiB,EAC/BT,aAAa,CAACU,kBAAkB,EAChCV,aAAa,CAACW,WAAW,EACzBX,aAAa,CAACY,SAAS,EACvBZ,aAAa,CAACa,SAAS,EACvBb,aAAa,CAACc,UAAU,CACzB;EAED,OAAO,CAAC,CAACV,IAAI,IAAIC,YAAY,CAACU,QAAQ,CAACX,IAAI,CAAC;AAC9C;;AAEA;AACA;AACA;AACA,OAAO,SAASY,eAAeA,CAC7Bd,SAAiC,EACE;EACnC,MAAMG,YAAY,GAAG,CACnBL,aAAa,CAACiB,OAAO,EACrBjB,aAAa,CAACkB,IAAI,EAClBlB,aAAa,CAACmB,SAAS,CACxB;EAED,OAAO,CAAC,CAACjB,SAAS,EAAEE,IAAI,IAAIC,YAAY,CAACU,QAAQ,CAACb,SAAS,CAACE,IAAI,CAAC;AACnE;;AAEA;AACA;AACA;AACA,OAAO,SAASgB,SAASA,CACvBlB,SAAiC,EACC;EAClC,MAAMG,YAAY,GAAG,CACnBL,aAAa,CAACY,SAAS,EACvBZ,aAAa,CAACS,iBAAiB,EAC/BT,aAAa,CAACqB,oBAAoB,EAClCrB,aAAa,CAACU,kBAAkB,EAChCV,aAAa,CAACW,WAAW,EACzBX,aAAa,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AAa,CAACO,eAAe,EAC7BP,aAAa,CAACM,WAAW,EACzBN,aAAa,CAACuB,WAAW,EACzBvB,aAAa,CAACc,UAAU,CACzB;EAED,OAAO,CAAC,CAACZ,SAAS,EAAEE,IAAI,IAAIC,YAAY,CAACU,QAAQ,CAACb,SAAS,CAACE,IAAI,CAAC;AACnE;;AAEA;AACA;AACA;AACA,OAAO,SAAS0B,QAAQA,CACtB5B,SAAiC,EACuC;EACxE,MAAM6B,WAAW,GAAG,CAAC/B,aAAa,CAACmB,SAAS,EAAEnB,aAAa,CAACkB,IAAI,CAAC;EACjE,OAAO,CAAC,CAAChB,SAAS,EAAEE,IAAI,IAAI,CAAC2B,WAAW,CAAChB,QAAQ,CAACb,SAAS,CAACE,IAAI,CAAC;AACnE","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../../src/components/types.ts"],"sourcesContent":["import {\n type ComponentSubType,\n type ComponentType\n} from '~/src/components/enums.js'\n\nexport type ConditionalComponentType =\n | ComponentType.CheckboxesField\n | ComponentType.DatePartsField\n | ComponentType.EmailAddressField\n | ComponentType.MultilineTextField\n | ComponentType.NumberField\n | ComponentType.TextField\n | ComponentType.TimeField\n | ComponentType.YesNoField\n\nexport interface ContentOptions {\n condition?: string\n}\n\n/**\n * Types for Components JSON structure which are expected by engine and turned into actual form input/content/lists\n */\ninterface TextFieldBase {\n type:\n | ComponentType.EmailAddressField\n | ComponentType.MultilineTextField\n | ComponentType.NumberField\n | ComponentType.TelephoneNumberField\n | ComponentType.TextField\n | ComponentType.UkAddressField\n | ComponentType.YesNoField\n subType?: ComponentSubType.Field\n name: string\n title: string\n hint?: string\n options: {\n hideTitle?: boolean\n required?: boolean\n optionalText?: boolean\n classes?: string\n allow?: string\n autocomplete?: string\n exposeToContext?: boolean\n }\n schema: {\n max?: number\n min?: number\n length?: number\n regex?: string\n error?: unknown\n }\n}\n\ninterface NumberFieldBase {\n type: ComponentType\n subType?: ComponentSubType.Field\n name: string\n title: string\n hint: string\n options: {\n prefix?: string\n suffix?: string\n exposeToContext?: boolean\n }\n schema: {\n min?: number\n max?: number\n precision?: number\n }\n}\n\ninterface ListFieldBase {\n type:\n | ComponentType.AutocompleteField\n | ComponentType.CheckboxesField\n | ComponentType.List\n | ComponentType.RadiosField\n | ComponentType.SelectField\n subType?: ComponentSubType.Content | ComponentSubType.ListField\n name: string\n title: string\n options: {\n type?: string\n hideTitle?: boolean\n required?: boolean\n optionalText?: boolean\n classes?: string\n bold?: boolean\n exposeToContext?: boolean\n allowPrePopulation?: boolean\n }\n list: string\n schema: object\n}\n\ninterface ContentFieldBase {\n type: ComponentType.Details | ComponentType.Html | ComponentType.InsetText\n subType?: ComponentSubType.Content\n name: string\n title: string\n content: string\n options: ContentOptions\n schema?: object\n}\n\ninterface DateFieldBase {\n type:\n | ComponentType.DatePartsField\n | ComponentType.MonthYearField\n | ComponentType.TimeField\n subType?: ComponentSubType.Field\n name: string\n title: string\n hint: string\n options: {\n hideTitle?: boolean\n required?: boolean\n optionalText?: boolean\n maxDaysInFuture?: number\n maxDaysInPast?: number\n exposeToContext?: boolean\n }\n schema: object\n}\n\n// Text Fields\nexport interface TextFieldComponent extends TextFieldBase {\n type: ComponentType.TextField\n options: TextFieldBase['options'] & {\n customValidationMessage?: string\n }\n}\n\nexport interface EmailAddressFieldComponent extends TextFieldBase {\n type: ComponentType.EmailAddressField\n}\n\nexport interface NumberFieldComponent extends NumberFieldBase {\n type: ComponentType.NumberField\n}\n\nexport interface TelephoneNumberFieldComponent extends TextFieldBase {\n type: ComponentType.TelephoneNumberField\n options: TextFieldBase['options'] & {\n customValidationMessage?: string\n }\n}\n\nexport interface YesNoFieldComponent extends TextFieldBase {\n type: ComponentType.YesNoField\n}\n\nexport interface MultilineTextFieldComponent extends TextFieldBase {\n type: ComponentType.MultilineTextField\n options: TextFieldBase['options'] & {\n customValidationMessage?: string\n rows?: number\n maxWords?: number\n }\n schema: {\n max?: number\n min?: number\n }\n}\n\nexport interface UkAddressFieldComponent extends TextFieldBase {\n type: ComponentType.UkAddressField\n}\n\n// Date Fields\nexport interface DatePartsFieldFieldComponent extends DateFieldBase {\n type: ComponentType.DatePartsField\n}\n\nexport interface MonthYearFieldComponent extends DateFieldBase {\n type: ComponentType.MonthYearField\n}\n\nexport interface TimeFieldComponent extends DateFieldBase {\n type: ComponentType.TimeField\n}\n\n// Content Fields\nexport interface DetailsComponent extends ContentFieldBase {\n type: ComponentType.Details\n}\n\nexport interface HtmlComponent extends ContentFieldBase {\n type: ComponentType.Html\n}\n\nexport interface InsetTextComponent extends ContentFieldBase {\n type: ComponentType.InsetText\n}\n\n// List Fields\nexport interface ListComponent extends ListFieldBase {\n type: ComponentType.List\n}\n\nexport interface AutocompleteFieldComponent extends ListFieldBase {\n type: ComponentType.AutocompleteField\n subType?: ComponentSubType.ListField\n}\n\nexport interface CheckboxesFieldComponent extends ListFieldBase {\n type: ComponentType.CheckboxesField\n subType?: ComponentSubType.ListField\n}\n\nexport interface RadiosFieldComponent extends ListFieldBase {\n type: ComponentType.RadiosField\n subType?: ComponentSubType.ListField\n}\n\nexport interface SelectFieldComponent extends ListFieldBase {\n type: ComponentType.SelectField\n subType?: ComponentSubType.ListField\n options: ListFieldBase['options'] & { autocomplete?: string }\n}\n\nexport type ComponentDef =\n | InsetTextComponent\n | AutocompleteFieldComponent\n | CheckboxesFieldComponent\n | DatePartsFieldFieldComponent\n | MonthYearFieldComponent\n | DetailsComponent\n | EmailAddressFieldComponent\n | HtmlComponent\n | ListComponent\n | MultilineTextFieldComponent\n | NumberFieldComponent\n | RadiosFieldComponent\n | SelectFieldComponent\n | TelephoneNumberFieldComponent\n | TextFieldComponent\n | TimeFieldComponent\n | UkAddressFieldComponent\n | YesNoFieldComponent\n\n// Components that render inputs\nexport type InputFieldsComponentsDef =\n | TextFieldComponent\n | EmailAddressFieldComponent\n | NumberFieldComponent\n | MultilineTextFieldComponent\n | TelephoneNumberFieldComponent\n | YesNoFieldComponent\n | MonthYearFieldComponent\n | TimeFieldComponent\n | UkAddressFieldComponent\n\n// Components that render content\nexport type ContentComponentsDef =\n | DetailsComponent\n | HtmlComponent\n | InsetTextComponent\n
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../src/components/types.ts"],"sourcesContent":["import {\n type ComponentSubType,\n type ComponentType\n} from '~/src/components/enums.js'\n\nexport type ConditionalComponentType =\n | ComponentType.RadiosField\n | ComponentType.CheckboxesField\n | ComponentType.DatePartsField\n | ComponentType.EmailAddressField\n | ComponentType.MultilineTextField\n | ComponentType.NumberField\n | ComponentType.TextField\n | ComponentType.TimeField\n | ComponentType.YesNoField\n\nexport interface ContentOptions {\n condition?: string\n}\n\n/**\n * Types for Components JSON structure which are expected by engine and turned into actual form input/content/lists\n */\ninterface TextFieldBase {\n type:\n | ComponentType.EmailAddressField\n | ComponentType.MultilineTextField\n | ComponentType.NumberField\n | ComponentType.TelephoneNumberField\n | ComponentType.TextField\n | ComponentType.UkAddressField\n | ComponentType.YesNoField\n subType?: ComponentSubType.Field\n name: string\n title: string\n hint?: string\n options: {\n hideTitle?: boolean\n required?: boolean\n optionalText?: boolean\n classes?: string\n allow?: string\n autocomplete?: string\n exposeToContext?: boolean\n }\n schema: {\n max?: number\n min?: number\n length?: number\n regex?: string\n error?: unknown\n }\n}\n\ninterface NumberFieldBase {\n type: ComponentType\n subType?: ComponentSubType.Field\n name: string\n title: string\n hint: string\n options: {\n prefix?: string\n suffix?: string\n exposeToContext?: boolean\n }\n schema: {\n min?: number\n max?: number\n precision?: number\n }\n}\n\ninterface ListFieldBase {\n type:\n | ComponentType.AutocompleteField\n | ComponentType.CheckboxesField\n | ComponentType.List\n | ComponentType.RadiosField\n | ComponentType.SelectField\n subType?: ComponentSubType.Content | ComponentSubType.ListField\n name: string\n title: string\n options: {\n type?: string\n hideTitle?: boolean\n required?: boolean\n optionalText?: boolean\n classes?: string\n bold?: boolean\n exposeToContext?: boolean\n allowPrePopulation?: boolean\n }\n list: string\n schema: object\n}\n\ninterface ContentFieldBase {\n type: ComponentType.Details | ComponentType.Html | ComponentType.InsetText\n subType?: ComponentSubType.Content\n name: string\n title: string\n content: string\n options: ContentOptions\n schema?: object\n}\n\ninterface DateFieldBase {\n type:\n | ComponentType.DatePartsField\n | ComponentType.MonthYearField\n | ComponentType.TimeField\n subType?: ComponentSubType.Field\n name: string\n title: string\n hint: string\n options: {\n hideTitle?: boolean\n required?: boolean\n optionalText?: boolean\n maxDaysInFuture?: number\n maxDaysInPast?: number\n exposeToContext?: boolean\n }\n schema: object\n}\n\n// Text Fields\nexport interface TextFieldComponent extends TextFieldBase {\n type: ComponentType.TextField\n options: TextFieldBase['options'] & {\n customValidationMessage?: string\n }\n}\n\nexport interface EmailAddressFieldComponent extends TextFieldBase {\n type: ComponentType.EmailAddressField\n}\n\nexport interface NumberFieldComponent extends NumberFieldBase {\n type: ComponentType.NumberField\n}\n\nexport interface TelephoneNumberFieldComponent extends TextFieldBase {\n type: ComponentType.TelephoneNumberField\n options: TextFieldBase['options'] & {\n customValidationMessage?: string\n }\n}\n\nexport interface YesNoFieldComponent extends TextFieldBase {\n type: ComponentType.YesNoField\n}\n\nexport interface MultilineTextFieldComponent extends TextFieldBase {\n type: ComponentType.MultilineTextField\n options: TextFieldBase['options'] & {\n customValidationMessage?: string\n rows?: number\n maxWords?: number\n }\n schema: {\n max?: number\n min?: number\n }\n}\n\nexport interface UkAddressFieldComponent extends TextFieldBase {\n type: ComponentType.UkAddressField\n}\n\n// Date Fields\nexport interface DatePartsFieldFieldComponent extends DateFieldBase {\n type: ComponentType.DatePartsField\n}\n\nexport interface MonthYearFieldComponent extends DateFieldBase {\n type: ComponentType.MonthYearField\n}\n\nexport interface TimeFieldComponent extends DateFieldBase {\n type: ComponentType.TimeField\n}\n\n// Content Fields\nexport interface DetailsComponent extends ContentFieldBase {\n type: ComponentType.Details\n}\n\nexport interface HtmlComponent extends ContentFieldBase {\n type: ComponentType.Html\n}\n\nexport interface InsetTextComponent extends ContentFieldBase {\n type: ComponentType.InsetText\n}\n\n// List Fields\nexport interface ListComponent extends ListFieldBase {\n type: ComponentType.List\n}\n\nexport interface AutocompleteFieldComponent extends ListFieldBase {\n type: ComponentType.AutocompleteField\n subType?: ComponentSubType.ListField\n}\n\nexport interface CheckboxesFieldComponent extends ListFieldBase {\n type: ComponentType.CheckboxesField\n subType?: ComponentSubType.ListField\n}\n\nexport interface RadiosFieldComponent extends ListFieldBase {\n type: ComponentType.RadiosField\n subType?: ComponentSubType.ListField\n}\n\nexport interface SelectFieldComponent extends ListFieldBase {\n type: ComponentType.SelectField\n subType?: ComponentSubType.ListField\n options: ListFieldBase['options'] & { autocomplete?: string }\n}\n\nexport type ComponentDef =\n | InsetTextComponent\n | AutocompleteFieldComponent\n | CheckboxesFieldComponent\n | DatePartsFieldFieldComponent\n | MonthYearFieldComponent\n | DetailsComponent\n | EmailAddressFieldComponent\n | HtmlComponent\n | ListComponent\n | MultilineTextFieldComponent\n | NumberFieldComponent\n | RadiosFieldComponent\n | SelectFieldComponent\n | TelephoneNumberFieldComponent\n | TextFieldComponent\n | TimeFieldComponent\n | UkAddressFieldComponent\n | YesNoFieldComponent\n\n// Components that render inputs\nexport type InputFieldsComponentsDef =\n | TextFieldComponent\n | EmailAddressFieldComponent\n | NumberFieldComponent\n | MultilineTextFieldComponent\n | TelephoneNumberFieldComponent\n | YesNoFieldComponent\n | MonthYearFieldComponent\n | TimeFieldComponent\n | UkAddressFieldComponent\n\n// Components that render content\nexport type ContentComponentsDef =\n | DetailsComponent\n | HtmlComponent\n | InsetTextComponent\n\n// Components with editors\nexport type EditorComponentsDef =\n | TextFieldComponent\n | EmailAddressFieldComponent\n | TelephoneNumberFieldComponent\n | MultilineTextFieldComponent\n | NumberFieldComponent\n | AutocompleteFieldComponent\n | SelectFieldComponent\n | RadiosFieldComponent\n | CheckboxesFieldComponent\n | ListComponent\n | DetailsComponent\n | HtmlComponent\n | InsetTextComponent\n | DatePartsFieldFieldComponent\n\n// Components that render lists\nexport type ListComponentsDef =\n | ListComponent\n | AutocompleteFieldComponent\n | CheckboxesFieldComponent\n | RadiosFieldComponent\n | SelectFieldComponent\n\n// Components that have selection fields\nexport type SelectionComponentsDef =\n | CheckboxesFieldComponent\n | RadiosFieldComponent\n | SelectFieldComponent\n | YesNoFieldComponent\n\n// Components that have custom condition operators\nexport type ConditionalComponentsDef =\n | CheckboxesFieldComponent\n | DatePartsFieldFieldComponent\n | EmailAddressFieldComponent\n | MultilineTextFieldComponent\n | NumberFieldComponent\n | TextFieldComponent\n | TimeFieldComponent\n | YesNoFieldComponent\n"],"mappings":"","ignoreList":[]}
|
@@ -27,6 +27,7 @@ const relativeTimeOperators = units => ({
|
|
27
27
|
[OperatorName.IsMoreThan]: relativeTime(Operator.IsLessThan, Operator.IsMoreThan, units)
|
28
28
|
});
|
29
29
|
export const customOperators = {
|
30
|
+
[ComponentType.RadiosField]: defaultOperators,
|
30
31
|
[ComponentType.CheckboxesField]: {
|
31
32
|
[OperatorName.Contains]: reverseInline(Operator.Contains),
|
32
33
|
[OperatorName.DoesNotContain]: not(reverseInline(Operator.Contains))
|
@@ -71,7 +72,7 @@ export function getOperatorConfig(fieldType, operator) {
|
|
71
72
|
return getConditionals(fieldType)?.[operator];
|
72
73
|
}
|
73
74
|
function getConditionals(fieldType) {
|
74
|
-
if (!isConditionalType(fieldType)) {
|
75
|
+
if (!fieldType || !isConditionalType(fieldType)) {
|
75
76
|
return;
|
76
77
|
}
|
77
78
|
return fieldType in customOperators ? customOperators[fieldType] : defaultOperators;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"condition-operators.js","names":["isConditionalType","ComponentType","timeUnits","dateUnits","dateTimeUnits","ConditionValue","RelativeTimeValue","DateDirections","Operator","OperatorName","defaultOperators","Is","inline","IsNot","withDefaults","param","Object","assign","textFieldOperators","IsLongerThan","lengthIs","IsMoreThan","IsShorterThan","IsLessThan","HasLength","absoluteDateTimeOperators","absoluteDateTime","IsBefore","IsAfter","relativeTimeOperators","units","IsAtLeast","relativeTime","IsAtMost","customOperators","CheckboxesField","Contains","reverseInline","DoesNotContain","not","NumberField","TimeField","DatePartsField","TextField","MultilineTextField","EmailAddressField","YesNoField","getOperatorNames","fieldType","conditionals","getConditionals","keys","sort","getExpression","fieldName","operator","value","expression","type","name","getOperatorConfig","field","formatValue","operatorDefinition","toExpression","absoluteDateOrTimeOperatorNames","relativeDateOrTimeOperatorNames","Error","pastOperator","futureOperator","isPast","direction","PAST"],"sources":["../../../src/conditions/condition-operators.ts"],"sourcesContent":["import { isConditionalType } from '../components/helpers.js'\n\nimport { ComponentType } from '~/src/components/enums.js'\nimport { type ComponentDef } from '~/src/components/types.js'\nimport {\n timeUnits,\n dateUnits,\n dateTimeUnits,\n ConditionValue,\n RelativeTimeValue\n} from '~/src/conditions/condition-values.js'\nimport {\n DateDirections,\n Operator,\n OperatorName\n} from '~/src/conditions/enums.js'\nimport {\n type Conditionals,\n type DateUnits,\n type OperatorDefinition,\n type TimeUnits\n} from '~/src/conditions/types.js'\n\nconst defaultOperators = {\n [OperatorName.Is]: inline(Operator.Is),\n [OperatorName.IsNot]: inline(Operator.IsNot)\n}\n\nfunction withDefaults<T>(param: T) {\n return Object.assign({}, param, defaultOperators)\n}\n\nconst textFieldOperators = {\n [OperatorName.IsLongerThan]: lengthIs(Operator.IsMoreThan),\n [OperatorName.IsShorterThan]: lengthIs(Operator.IsLessThan),\n [OperatorName.HasLength]: lengthIs(Operator.Is)\n}\n\nconst absoluteDateTimeOperators = {\n [OperatorName.Is]: absoluteDateTime(Operator.Is),\n [OperatorName.IsNot]: absoluteDateTime(Operator.IsNot),\n [OperatorName.IsBefore]: absoluteDateTime(Operator.IsLessThan),\n [OperatorName.IsAfter]: absoluteDateTime(Operator.IsMoreThan)\n}\n\nconst relativeTimeOperators = (units: DateUnits | TimeUnits) => ({\n [OperatorName.IsAtLeast]: relativeTime(\n Operator.IsAtMost,\n Operator.IsAtLeast,\n units\n ),\n [OperatorName.IsAtMost]: relativeTime(\n Operator.IsAtLeast,\n Operator.IsAtMost,\n units\n ),\n [OperatorName.IsLessThan]: relativeTime(\n Operator.IsMoreThan,\n Operator.IsLessThan,\n units\n ),\n [OperatorName.IsMoreThan]: relativeTime(\n Operator.IsLessThan,\n Operator.IsMoreThan,\n units\n )\n})\n\nexport const customOperators = {\n [ComponentType.CheckboxesField]: {\n [OperatorName.Contains]: reverseInline(Operator.Contains),\n [OperatorName.DoesNotContain]: not(reverseInline(Operator.Contains))\n },\n [ComponentType.NumberField]: withDefaults({\n [OperatorName.IsAtLeast]: inline(Operator.IsAtLeast),\n [OperatorName.IsAtMost]: inline(Operator.IsAtMost),\n [OperatorName.IsLessThan]: inline(Operator.IsLessThan),\n [OperatorName.IsMoreThan]: inline(Operator.IsMoreThan)\n }),\n [ComponentType.TimeField]: {\n ...absoluteDateTimeOperators,\n ...relativeTimeOperators(timeUnits)\n },\n [ComponentType.DatePartsField]: {\n ...absoluteDateTimeOperators,\n ...relativeTimeOperators(dateUnits)\n },\n [ComponentType.TextField]: withDefaults(textFieldOperators),\n [ComponentType.MultilineTextField]: withDefaults(textFieldOperators),\n [ComponentType.EmailAddressField]: withDefaults(textFieldOperators),\n [ComponentType.YesNoField]: defaultOperators\n}\n\nexport function getOperatorNames(fieldType: ComponentType) {\n const conditionals = getConditionals(fieldType)\n if (!conditionals) {\n return []\n }\n\n return Object.keys(conditionals).sort()\n}\n\nexport function getExpression(\n fieldType: ComponentType,\n fieldName: string,\n operator: OperatorName,\n value: ConditionValue | RelativeTimeValue\n) {\n const conditionals = getConditionals(fieldType)\n if (!conditionals) {\n return\n }\n\n return conditionals[operator]?.expression(\n { type: fieldType, name: fieldName },\n value\n )\n}\n\nexport function getOperatorConfig(\n fieldType: ComponentType,\n operator: OperatorName\n) {\n return getConditionals(fieldType)?.[operator]\n}\n\nfunction getConditionals(\n fieldType: ComponentType\n): Partial<Conditionals> | undefined {\n if (!isConditionalType(fieldType)) {\n return\n }\n\n return fieldType in customOperators\n ? customOperators[fieldType]\n : defaultOperators\n}\n\nfunction inline(operator: Operator): OperatorDefinition {\n return {\n expression(field, value) {\n return `${field.name} ${operator} ${formatValue(field, value)}`\n }\n }\n}\n\nfunction lengthIs(operator: Operator): OperatorDefinition {\n return {\n expression(field, value) {\n return `length(${field.name}) ${operator} ${formatValue(field, value)}`\n }\n }\n}\n\nfunction reverseInline(operator: Operator.Contains): OperatorDefinition {\n return {\n expression(field, value) {\n return `${formatValue(field, value)} ${operator} ${field.name}`\n }\n }\n}\n\nfunction not(operatorDefinition: OperatorDefinition): OperatorDefinition {\n return {\n expression(field, value) {\n return `not (${operatorDefinition.expression(field, value)})`\n }\n }\n}\n\nfunction formatValue(\n field: Pick<ComponentDef, 'type'>,\n value: ConditionValue | RelativeTimeValue\n) {\n if (\n 'value' in value &&\n (field.type === ComponentType.YesNoField ||\n field.type === ComponentType.NumberField)\n ) {\n return value.value\n }\n\n return `'${value.toExpression()}'`\n}\n\nexport const absoluteDateOrTimeOperatorNames = Object.keys(\n absoluteDateTimeOperators\n)\n\nexport const relativeDateOrTimeOperatorNames = Object.keys(\n relativeTimeOperators(dateTimeUnits)\n)\n\nfunction absoluteDateTime(operator: Operator): OperatorDefinition {\n return {\n expression(field, value) {\n if (!(value instanceof ConditionValue)) {\n throw new Error(\n \"Expression param 'value' must be ConditionValue instance\"\n )\n }\n\n return `${field.name} ${operator} '${formatValue(field, value)}'`\n }\n }\n}\n\nfunction relativeTime(\n pastOperator: Operator,\n futureOperator: Operator,\n units: DateUnits | TimeUnits\n): OperatorDefinition {\n return {\n units,\n expression(field, value) {\n if (!(value instanceof RelativeTimeValue)) {\n throw new Error(\n \"Expression param 'value' must be RelativeTimeValue instance\"\n )\n }\n\n const isPast = value.direction === DateDirections.PAST\n return `${field.name} ${isPast ? pastOperator : futureOperator} ${value.toExpression()}`\n }\n }\n}\n"],"mappings":"AAAA,SAASA,iBAAiB;AAE1B,SAASC,aAAa;AAEtB,SACEC,SAAS,EACTC,SAAS,E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,QAAkB,EAAsB;EAChE,OAAO;IACLE,UAAUA,CAACI,KAAK,EAAEL,KAAK,EAAE;MACvB,IAAI,EAAEA,KAAK,YAAYnD,cAAc,CAAC,EAAE;QACtC,MAAM,IAAI8D,KAAK,CACb,0DACF,CAAC;MACH;MAEA,OAAO,GAAGN,KAAK,CAACF,IAAI,IAAIJ,QAAQ,KAAKO,WAAW,CAACD,KAAK,EAAEL,KAAK,CAAC,GAAG;IACnE;EACF,CAAC;AACH;AAEA,SAASxB,YAAYA,CACnBoC,YAAsB,EACtBC,cAAwB,EACxBvC,KAA4B,EACR;EACpB,OAAO;IACLA,KAAK;IACL2B,UAAUA,CAACI,KAAK,EAAEL,KAAK,EAAE;MACvB,IAAI,EAAEA,KAAK,YAAYlD,iBAAiB,CAAC,EAAE;QACzC,MAAM,IAAI6D,KAAK,CACb,6DACF,CAAC;MACH;MAEA,MAAMG,MAAM,GAAGd,KAAK,CAACe,SAAS,KAAKhE,cAAc,CAACiE,IAAI;MACtD,OAAO,GAAGX,KAAK,CAACF,IAAI,IAAIW,MAAM,GAAGF,YAAY,GAAGC,cAAc,IAAIb,KAAK,CAACQ,YAAY,CAAC,CAAC,EAAE;IAC1F;EACF,CAAC;AACH","ignoreList":[]}
|
1
|
+
{"version":3,"file":"condition-operators.js","names":["isConditionalType","ComponentType","timeUnits","dateUnits","dateTimeUnits","ConditionValue","RelativeTimeValue","DateDirections","Operator","OperatorName","defaultOperators","Is","inline","IsNot","withDefaults","param","Object","assign","textFieldOperators","IsLongerThan","lengthIs","IsMoreThan","IsShorterThan","IsLessThan","HasLength","absoluteDateTimeOperators","absoluteDateTime","IsBefore","IsAfter","relativeTimeOperators","units","IsAtLeast","relativeTime","IsAtMost","customOperators","RadiosField","CheckboxesField","Contains","reverseInline","DoesNotContain","not","NumberField","TimeField","DatePartsField","TextField","MultilineTextField","EmailAddressField","YesNoField","getOperatorNames","fieldType","conditionals","getConditionals","keys","sort","getExpression","fieldName","operator","value","expression","type","name","getOperatorConfig","field","formatValue","operatorDefinition","toExpression","absoluteDateOrTimeOperatorNames","relativeDateOrTimeOperatorNames","Error","pastOperator","futureOperator","isPast","direction","PAST"],"sources":["../../../src/conditions/condition-operators.ts"],"sourcesContent":["import { isConditionalType } from '../components/helpers.js'\n\nimport { ComponentType } from '~/src/components/enums.js'\nimport { type ComponentDef } from '~/src/components/types.js'\nimport {\n timeUnits,\n dateUnits,\n dateTimeUnits,\n ConditionValue,\n RelativeTimeValue\n} from '~/src/conditions/condition-values.js'\nimport {\n DateDirections,\n Operator,\n OperatorName\n} from '~/src/conditions/enums.js'\nimport {\n type Conditionals,\n type DateUnits,\n type OperatorDefinition,\n type TimeUnits\n} from '~/src/conditions/types.js'\n\nconst defaultOperators = {\n [OperatorName.Is]: inline(Operator.Is),\n [OperatorName.IsNot]: inline(Operator.IsNot)\n}\n\nfunction withDefaults<T>(param: T) {\n return Object.assign({}, param, defaultOperators)\n}\n\nconst textFieldOperators = {\n [OperatorName.IsLongerThan]: lengthIs(Operator.IsMoreThan),\n [OperatorName.IsShorterThan]: lengthIs(Operator.IsLessThan),\n [OperatorName.HasLength]: lengthIs(Operator.Is)\n}\n\nconst absoluteDateTimeOperators = {\n [OperatorName.Is]: absoluteDateTime(Operator.Is),\n [OperatorName.IsNot]: absoluteDateTime(Operator.IsNot),\n [OperatorName.IsBefore]: absoluteDateTime(Operator.IsLessThan),\n [OperatorName.IsAfter]: absoluteDateTime(Operator.IsMoreThan)\n}\n\nconst relativeTimeOperators = (units: DateUnits | TimeUnits) => ({\n [OperatorName.IsAtLeast]: relativeTime(\n Operator.IsAtMost,\n Operator.IsAtLeast,\n units\n ),\n [OperatorName.IsAtMost]: relativeTime(\n Operator.IsAtLeast,\n Operator.IsAtMost,\n units\n ),\n [OperatorName.IsLessThan]: relativeTime(\n Operator.IsMoreThan,\n Operator.IsLessThan,\n units\n ),\n [OperatorName.IsMoreThan]: relativeTime(\n Operator.IsLessThan,\n Operator.IsMoreThan,\n units\n )\n})\n\nexport const customOperators = {\n [ComponentType.RadiosField]: defaultOperators,\n [ComponentType.CheckboxesField]: {\n [OperatorName.Contains]: reverseInline(Operator.Contains),\n [OperatorName.DoesNotContain]: not(reverseInline(Operator.Contains))\n },\n [ComponentType.NumberField]: withDefaults({\n [OperatorName.IsAtLeast]: inline(Operator.IsAtLeast),\n [OperatorName.IsAtMost]: inline(Operator.IsAtMost),\n [OperatorName.IsLessThan]: inline(Operator.IsLessThan),\n [OperatorName.IsMoreThan]: inline(Operator.IsMoreThan)\n }),\n [ComponentType.TimeField]: {\n ...absoluteDateTimeOperators,\n ...relativeTimeOperators(timeUnits)\n },\n [ComponentType.DatePartsField]: {\n ...absoluteDateTimeOperators,\n ...relativeTimeOperators(dateUnits)\n },\n [ComponentType.TextField]: withDefaults(textFieldOperators),\n [ComponentType.MultilineTextField]: withDefaults(textFieldOperators),\n [ComponentType.EmailAddressField]: withDefaults(textFieldOperators),\n [ComponentType.YesNoField]: defaultOperators\n}\n\nexport function getOperatorNames(fieldType?: ComponentType) {\n const conditionals = getConditionals(fieldType)\n if (!conditionals) {\n return []\n }\n\n return Object.keys(conditionals).sort()\n}\n\nexport function getExpression(\n fieldType: ComponentType,\n fieldName: string,\n operator: OperatorName,\n value: ConditionValue | RelativeTimeValue\n) {\n const conditionals = getConditionals(fieldType)\n if (!conditionals) {\n return\n }\n\n return conditionals[operator]?.expression(\n { type: fieldType, name: fieldName },\n value\n )\n}\n\nexport function getOperatorConfig(\n fieldType: ComponentType,\n operator: OperatorName\n) {\n return getConditionals(fieldType)?.[operator]\n}\n\nfunction getConditionals(\n fieldType?: ComponentType\n): Partial<Conditionals> | undefined {\n if (!fieldType || !isConditionalType(fieldType)) {\n return\n }\n\n return fieldType in customOperators\n ? customOperators[fieldType]\n : defaultOperators\n}\n\nfunction inline(operator: Operator): OperatorDefinition {\n return {\n expression(field, value) {\n return `${field.name} ${operator} ${formatValue(field, value)}`\n }\n }\n}\n\nfunction lengthIs(operator: Operator): OperatorDefinition {\n return {\n expression(field, value) {\n return `length(${field.name}) ${operator} ${formatValue(field, value)}`\n }\n }\n}\n\nfunction reverseInline(operator: Operator.Contains): OperatorDefinition {\n return {\n expression(field, value) {\n return `${formatValue(field, value)} ${operator} ${field.name}`\n }\n }\n}\n\nfunction not(operatorDefinition: OperatorDefinition): OperatorDefinition {\n return {\n expression(field, value) {\n return `not (${operatorDefinition.expression(field, value)})`\n }\n }\n}\n\nfunction formatValue(\n field: Pick<ComponentDef, 'type'>,\n value: ConditionValue | RelativeTimeValue\n) {\n if (\n 'value' in value &&\n (field.type === ComponentType.YesNoField ||\n field.type === ComponentType.NumberField)\n ) {\n return value.value\n }\n\n return `'${value.toExpression()}'`\n}\n\nexport const absoluteDateOrTimeOperatorNames = Object.keys(\n absoluteDateTimeOperators\n)\n\nexport const relativeDateOrTimeOperatorNames = Object.keys(\n relativeTimeOperators(dateTimeUnits)\n)\n\nfunction absoluteDateTime(operator: Operator): OperatorDefinition {\n return {\n expression(field, value) {\n if (!(value instanceof ConditionValue)) {\n throw new Error(\n \"Expression param 'value' must be ConditionValue instance\"\n )\n }\n\n return `${field.name} ${operator} '${formatValue(field, value)}'`\n }\n }\n}\n\nfunction relativeTime(\n pastOperator: Operator,\n futureOperator: Operator,\n units: DateUnits | TimeUnits\n): OperatorDefinition {\n return {\n units,\n expression(field, value) {\n if (!(value instanceof RelativeTimeValue)) {\n throw new Error(\n \"Expression param 'value' must be RelativeTimeValue instance\"\n )\n }\n\n const isPast = value.direction === DateDirections.PAST\n return `${field.name} ${isPast ? pastOperator : futureOperator} ${value.toExpression()}`\n }\n }\n}\n"],"mappings":"AAAA,SAASA,iBAAiB;AAE1B,SAASC,aAAa;AAEtB,SACEC,SAAS,EACTC,SAAS,EACTC,aAAa,EACbC,cAAc,EACdC,iBAAiB;AAEnB,SACEC,cAAc,EACdC,QAAQ,EACRC,YAAY;AASd,MAAMC,gBAAgB,GAAG;EACvB,CAACD,YAAY,CAACE,EAAE,GAAGC,MAAM,CAACJ,Q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EA,KAAK,YAAYpD,cAAc,CAAC,EAAE;QACtC,MAAM,IAAI+D,KAAK,CACb,0DACF,CAAC;MACH;MAEA,OAAO,GAAGN,KAAK,CAACF,IAAI,IAAIJ,QAAQ,KAAKO,WAAW,CAACD,KAAK,EAAEL,KAAK,CAAC,GAAG;IACnE;EACF,CAAC;AACH;AAEA,SAASzB,YAAYA,CACnBqC,YAAsB,EACtBC,cAAwB,EACxBxC,KAA4B,EACR;EACpB,OAAO;IACLA,KAAK;IACL4B,UAAUA,CAACI,KAAK,EAAEL,KAAK,EAAE;MACvB,IAAI,EAAEA,KAAK,YAAYnD,iBAAiB,CAAC,EAAE;QACzC,MAAM,IAAI8D,KAAK,CACb,6DACF,CAAC;MACH;MAEA,MAAMG,MAAM,GAAGd,KAAK,CAACe,SAAS,KAAKjE,cAAc,CAACkE,IAAI;MACtD,OAAO,GAAGX,KAAK,CAACF,IAAI,IAAIW,MAAM,GAAGF,YAAY,GAAGC,cAAc,IAAIb,KAAK,CAACQ,YAAY,CAAC,CAAC,EAAE;IAC1F;EACF,CAAC;AACH","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"component-types.d.ts","sourceRoot":"","sources":["../../../src/components/component-types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAE7D,eAAO,MAAM,cAAc,EAAE,YAAY,
|
1
|
+
{"version":3,"file":"component-types.d.ts","sourceRoot":"","sources":["../../../src/components/component-types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAE7D,eAAO,MAAM,cAAc,EAAE,YAAY,EAkKxC,CAAA"}
|
@@ -10,7 +10,7 @@ export declare function isConditionalType(type?: ComponentType): type is Conditi
|
|
10
10
|
*/
|
11
11
|
export declare function hasContentField(component?: Partial<ComponentDef>): component is ContentComponentsDef;
|
12
12
|
/**
|
13
|
-
* Filter known components with text editor
|
13
|
+
* Filter known components with text editor or list select
|
14
14
|
*/
|
15
15
|
export declare function hasEditor(component?: Partial<ComponentDef>): component is EditorComponentsDef;
|
16
16
|
/**
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/components/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AACzD,OAAO,EACL,KAAK,wBAAwB,EAC7B,KAAK,YAAY,EACjB,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACzB,MAAM,2BAA2B,CAAA;AAElC;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,SAAS,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,GAChC,SAAS,IAAI,wBAAwB,CAEvC;AAED,wBAAgB,iBAAiB,CAC/B,IAAI,CAAC,EAAE,aAAa,GACnB,IAAI,IAAI,wBAAwB,
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/components/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AACzD,OAAO,EACL,KAAK,wBAAwB,EAC7B,KAAK,YAAY,EACjB,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACzB,MAAM,2BAA2B,CAAA;AAElC;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,SAAS,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,GAChC,SAAS,IAAI,wBAAwB,CAEvC;AAED,wBAAgB,iBAAiB,CAC/B,IAAI,CAAC,EAAE,aAAa,GACnB,IAAI,IAAI,wBAAwB,CAclC;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC7B,SAAS,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,GAChC,SAAS,IAAI,oBAAoB,CAQnC;AAED;;GAEG;AACH,wBAAgB,SAAS,CACvB,SAAS,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,GAChC,SAAS,IAAI,mBAAmB,CAmBlC;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,SAAS,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,GAChC,SAAS,IAAI,wBAAwB,CAcvC;AAED;;GAEG;AACH,wBAAgB,YAAY,CAC1B,SAAS,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,GAChC,SAAS,IAAI,iBAAiB,CAUhC;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,SAAS,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,GAChC,SAAS,IAAI,sBAAsB,CASrC;AAED;;GAEG;AACH,wBAAgB,QAAQ,CACtB,SAAS,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,GAChC,SAAS,IAAI,OAAO,CAAC,YAAY,EAAE,kBAAkB,GAAG,aAAa,CAAC,CAGxE"}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { type ComponentSubType, type ComponentType } from '../components/enums.js';
|
2
|
-
export type ConditionalComponentType = ComponentType.CheckboxesField | ComponentType.DatePartsField | ComponentType.EmailAddressField | ComponentType.MultilineTextField | ComponentType.NumberField | ComponentType.TextField | ComponentType.TimeField | ComponentType.YesNoField;
|
2
|
+
export type ConditionalComponentType = ComponentType.RadiosField | ComponentType.CheckboxesField | ComponentType.DatePartsField | ComponentType.EmailAddressField | ComponentType.MultilineTextField | ComponentType.NumberField | ComponentType.TextField | ComponentType.TimeField | ComponentType.YesNoField;
|
3
3
|
export interface ContentOptions {
|
4
4
|
condition?: string;
|
5
5
|
}
|
@@ -167,7 +167,7 @@ export interface SelectFieldComponent extends ListFieldBase {
|
|
167
167
|
}
|
168
168
|
export type ComponentDef = InsetTextComponent | AutocompleteFieldComponent | CheckboxesFieldComponent | DatePartsFieldFieldComponent | MonthYearFieldComponent | DetailsComponent | EmailAddressFieldComponent | HtmlComponent | ListComponent | MultilineTextFieldComponent | NumberFieldComponent | RadiosFieldComponent | SelectFieldComponent | TelephoneNumberFieldComponent | TextFieldComponent | TimeFieldComponent | UkAddressFieldComponent | YesNoFieldComponent;
|
169
169
|
export type InputFieldsComponentsDef = TextFieldComponent | EmailAddressFieldComponent | NumberFieldComponent | MultilineTextFieldComponent | TelephoneNumberFieldComponent | YesNoFieldComponent | MonthYearFieldComponent | TimeFieldComponent | UkAddressFieldComponent;
|
170
|
-
export type ContentComponentsDef = DetailsComponent | HtmlComponent | InsetTextComponent
|
170
|
+
export type ContentComponentsDef = DetailsComponent | HtmlComponent | InsetTextComponent;
|
171
171
|
export type EditorComponentsDef = TextFieldComponent | EmailAddressFieldComponent | TelephoneNumberFieldComponent | MultilineTextFieldComponent | NumberFieldComponent | AutocompleteFieldComponent | SelectFieldComponent | RadiosFieldComponent | CheckboxesFieldComponent | ListComponent | DetailsComponent | HtmlComponent | InsetTextComponent | DatePartsFieldFieldComponent;
|
172
172
|
export type ListComponentsDef = ListComponent | AutocompleteFieldComponent | CheckboxesFieldComponent | RadiosFieldComponent | SelectFieldComponent;
|
173
173
|
export type SelectionComponentsDef = CheckboxesFieldComponent | RadiosFieldComponent | SelectFieldComponent | YesNoFieldComponent;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,aAAa,EACnB,MAAM,2BAA2B,CAAA;AAElC,MAAM,MAAM,wBAAwB,GAChC,aAAa,CAAC,eAAe,GAC7B,aAAa,CAAC,cAAc,GAC5B,aAAa,CAAC,iBAAiB,GAC/B,aAAa,CAAC,kBAAkB,GAChC,aAAa,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ACb,kBAAkB,GAClB,4BAA4B,CAAA;AAGhC,MAAM,MAAM,iBAAiB,GACzB,aAAa,GACb,0BAA0B,GAC1B,wBAAwB,GACxB,oBAAoB,GACpB,oBAAoB,CAAA;AAGxB,MAAM,MAAM,sBAAsB,GAC9B,wBAAwB,GACxB,oBAAoB,GACpB,oBAAoB,GACpB,mBAAmB,CAAA;AAGvB,MAAM,MAAM,wBAAwB,GAChC,wBAAwB,GACxB,4BAA4B,GAC5B,0BAA0B,GAC1B,2BAA2B,GAC3B,oBAAoB,GACpB,kBAAkB,GAClB,kBAAkB,GAClB,mBAAmB,CAAA"}
|
@@ -3,6 +3,10 @@ import { ConditionValue, RelativeTimeValue } from '../conditions/condition-value
|
|
3
3
|
import { OperatorName } from '../conditions/enums.js';
|
4
4
|
import { type OperatorDefinition } from '../conditions/types.js';
|
5
5
|
export declare const customOperators: {
|
6
|
+
RadiosField: {
|
7
|
+
is: OperatorDefinition;
|
8
|
+
"is not": OperatorDefinition;
|
9
|
+
};
|
6
10
|
CheckboxesField: {
|
7
11
|
contains: OperatorDefinition;
|
8
12
|
"does not contain": OperatorDefinition;
|
@@ -65,7 +69,7 @@ export declare const customOperators: {
|
|
65
69
|
"is not": OperatorDefinition;
|
66
70
|
};
|
67
71
|
};
|
68
|
-
export declare function getOperatorNames(fieldType
|
72
|
+
export declare function getOperatorNames(fieldType?: ComponentType): string[];
|
69
73
|
export declare function getExpression(fieldType: ComponentType, fieldName: string, operator: OperatorName, value: ConditionValue | RelativeTimeValue): string | undefined;
|
70
74
|
export declare function getOperatorConfig(fieldType: ComponentType, operator: OperatorName): OperatorDefinition | undefined;
|
71
75
|
export declare const absoluteDateOrTimeOperatorNames: string[];
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"condition-operators.d.ts","sourceRoot":"","sources":["../../../src/conditions/condition-operators.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAEzD,OAAO,EAIL,cAAc,EACd,iBAAiB,EAClB,MAAM,sCAAsC,CAAA;AAC7C,OAAO,EAGL,YAAY,EACb,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAGL,KAAK,kBAAkB,EAExB,MAAM,2BAA2B,CAAA;AA+ClC,eAAO,MAAM,eAAe
|
1
|
+
{"version":3,"file":"condition-operators.d.ts","sourceRoot":"","sources":["../../../src/conditions/condition-operators.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAEzD,OAAO,EAIL,cAAc,EACd,iBAAiB,EAClB,MAAM,sCAAsC,CAAA;AAC7C,OAAO,EAGL,YAAY,EACb,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAGL,KAAK,kBAAkB,EAExB,MAAM,2BAA2B,CAAA;AA+ClC,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwB3B,CAAA;AAED,wBAAgB,gBAAgB,CAAC,SAAS,CAAC,EAAE,aAAa,YAOzD;AAED,wBAAgB,aAAa,CAC3B,SAAS,EAAE,aAAa,EACxB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,YAAY,EACtB,KAAK,EAAE,cAAc,GAAG,iBAAiB,sBAW1C;AAED,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,aAAa,EACxB,QAAQ,EAAE,YAAY,kCAGvB;AA6DD,eAAO,MAAM,+BAA+B,UAE3C,CAAA;AAED,eAAO,MAAM,+BAA+B,UAE3C,CAAA"}
|
package/package.json
CHANGED
@@ -25,6 +25,7 @@ export function isConditionalType(
|
|
25
25
|
type?: ComponentType
|
26
26
|
): type is ConditionalComponentType {
|
27
27
|
const allowedTypes = [
|
28
|
+
ComponentType.RadiosField,
|
28
29
|
ComponentType.CheckboxesField,
|
29
30
|
ComponentType.DatePartsField,
|
30
31
|
ComponentType.EmailAddressField,
|
@@ -47,15 +48,14 @@ export function hasContentField(
|
|
47
48
|
const allowedTypes = [
|
48
49
|
ComponentType.Details,
|
49
50
|
ComponentType.Html,
|
50
|
-
ComponentType.InsetText
|
51
|
-
ComponentType.List
|
51
|
+
ComponentType.InsetText
|
52
52
|
]
|
53
53
|
|
54
54
|
return !!component?.type && allowedTypes.includes(component.type)
|
55
55
|
}
|
56
56
|
|
57
57
|
/**
|
58
|
-
* Filter known components with text editor
|
58
|
+
* Filter known components with text editor or list select
|
59
59
|
*/
|
60
60
|
export function hasEditor(
|
61
61
|
component?: Partial<ComponentDef>
|
package/src/components/types.ts
CHANGED
@@ -4,6 +4,7 @@ import {
|
|
4
4
|
} from '~/src/components/enums.js'
|
5
5
|
|
6
6
|
export type ConditionalComponentType =
|
7
|
+
| ComponentType.RadiosField
|
7
8
|
| ComponentType.CheckboxesField
|
8
9
|
| ComponentType.DatePartsField
|
9
10
|
| ComponentType.EmailAddressField
|
@@ -256,7 +257,6 @@ export type ContentComponentsDef =
|
|
256
257
|
| DetailsComponent
|
257
258
|
| HtmlComponent
|
258
259
|
| InsetTextComponent
|
259
|
-
| ListComponent
|
260
260
|
|
261
261
|
// Components with editors
|
262
262
|
export type EditorComponentsDef =
|
@@ -67,6 +67,7 @@ const relativeTimeOperators = (units: DateUnits | TimeUnits) => ({
|
|
67
67
|
})
|
68
68
|
|
69
69
|
export const customOperators = {
|
70
|
+
[ComponentType.RadiosField]: defaultOperators,
|
70
71
|
[ComponentType.CheckboxesField]: {
|
71
72
|
[OperatorName.Contains]: reverseInline(Operator.Contains),
|
72
73
|
[OperatorName.DoesNotContain]: not(reverseInline(Operator.Contains))
|
@@ -91,7 +92,7 @@ export const customOperators = {
|
|
91
92
|
[ComponentType.YesNoField]: defaultOperators
|
92
93
|
}
|
93
94
|
|
94
|
-
export function getOperatorNames(fieldType
|
95
|
+
export function getOperatorNames(fieldType?: ComponentType) {
|
95
96
|
const conditionals = getConditionals(fieldType)
|
96
97
|
if (!conditionals) {
|
97
98
|
return []
|
@@ -125,9 +126,9 @@ export function getOperatorConfig(
|
|
125
126
|
}
|
126
127
|
|
127
128
|
function getConditionals(
|
128
|
-
fieldType
|
129
|
+
fieldType?: ComponentType
|
129
130
|
): Partial<Conditionals> | undefined {
|
130
|
-
if (!isConditionalType(fieldType)) {
|
131
|
+
if (!fieldType || !isConditionalType(fieldType)) {
|
131
132
|
return
|
132
133
|
}
|
133
134
|
|