@ng-formworks/core 20.6.7 → 20.6.9
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/fesm2022/ng-formworks-core.mjs +365 -169
- package/fesm2022/ng-formworks-core.mjs.map +1 -1
- package/index.d.ts +30 -9
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-formworks-core.mjs","sources":["../../../../projects/ng-formworks-core/src/lib/framework-library/framework.ts","../../../../projects/ng-formworks-core/src/lib/locale/de-validation-messages.ts","../../../../projects/ng-formworks-core/src/lib/locale/en-validation-messages.ts","../../../../projects/ng-formworks-core/src/lib/locale/es-validation-messages.ts","../../../../projects/ng-formworks-core/src/lib/locale/fr-validation-messages.ts","../../../../projects/ng-formworks-core/src/lib/locale/it-validation-messages.ts","../../../../projects/ng-formworks-core/src/lib/locale/pt-validation-messages.ts","../../../../projects/ng-formworks-core/src/lib/locale/zh-validation-messages.ts","../../../../projects/ng-formworks-core/src/lib/shared/validator.functions.ts","../../../../projects/ng-formworks-core/src/lib/shared/utility.functions.ts","../../../../projects/ng-formworks-core/src/lib/shared/jsonpointer.functions.ts","../../../../projects/ng-formworks-core/src/lib/shared/format-regex.constants.ts","../../../../projects/ng-formworks-core/src/lib/shared/json.validators.ts","../../../../projects/ng-formworks-core/src/lib/shared/merge-schemas.function.ts","../../../../projects/ng-formworks-core/src/lib/shared/json-schema.functions.ts","../../../../projects/ng-formworks-core/src/lib/shared/convert-schema-to-draft6.function.ts","../../../../projects/ng-formworks-core/src/lib/shared/form-group.functions.ts","../../../../projects/ng-formworks-core/src/lib/shared/layout.functions.ts","../../../../projects/ng-formworks-core/src/lib/shared/index.ts","../../../../projects/ng-formworks-core/src/lib/json-schema-form.service.ts","../../../../projects/ng-formworks-core/src/lib/widget-library/select-widget.component.ts","../../../../projects/ng-formworks-core/src/lib/framework-library/no-framework.component.ts","../../../../projects/ng-formworks-core/src/lib/framework-library/no-framework.component.html","../../../../projects/ng-formworks-core/src/lib/framework-library/no.framework.ts","../../../../projects/ng-formworks-core/src/lib/widget-library/element-attribute.directive.ts","../../../../projects/ng-formworks-core/src/lib/widget-library/stop-propagation.directive.ts","../../../../projects/ng-formworks-core/src/lib/widget-library/add-reference.component.ts","../../../../projects/ng-formworks-core/src/lib/widget-library/button.component.ts","../../../../projects/ng-formworks-core/src/lib/widget-library/checkbox.component.ts","../../../../projects/ng-formworks-core/src/lib/widget-library/checkboxes.component.ts","../../../../projects/ng-formworks-core/src/lib/widget-library/file.component.ts","../../../../projects/ng-formworks-core/src/lib/widget-library/hidden.component.ts","../../../../projects/ng-formworks-core/src/lib/widget-library/input.component.ts","../../../../projects/ng-formworks-core/src/lib/widget-library/message.component.ts","../../../../projects/ng-formworks-core/src/lib/widget-library/none.component.ts","../../../../projects/ng-formworks-core/src/lib/widget-library/number.component.ts","../../../../projects/ng-formworks-core/src/lib/widget-library/select-framework.component.ts","../../../../projects/ng-formworks-core/src/lib/widget-library/tabs.component.ts","../../../../projects/ng-formworks-core/src/lib/widget-library/one-of.component.ts","../../../../projects/ng-formworks-core/src/lib/widget-library/radios.component.ts","../../../../projects/ng-formworks-core/src/lib/widget-library/root.component.ts","../../../../projects/ng-formworks-core/src/lib/widget-library/section.component.ts","../../../../projects/ng-formworks-core/src/lib/widget-library/select.component.ts","../../../../projects/ng-formworks-core/src/lib/widget-library/submit.component.ts","../../../../projects/ng-formworks-core/src/lib/widget-library/template.component.ts","../../../../projects/ng-formworks-core/src/lib/widget-library/textarea.component.ts","../../../../projects/ng-formworks-core/src/lib/widget-library/widget-library.service.ts","../../../../projects/ng-formworks-core/src/lib/framework-library/framework-library.service.ts","../../../../projects/ng-formworks-core/src/lib/widget-library/selectcheckbox.component.ts","../../../../projects/ng-formworks-core/src/lib/widget-library/tab.component.ts","../../../../projects/ng-formworks-core/src/lib/widget-library/orderable.directive.ts","../../../../projects/ng-formworks-core/src/lib/widget-library/index.ts","../../../../projects/ng-formworks-core/src/lib/widget-library/widget-library.module.ts","../../../../projects/ng-formworks-core/src/lib/framework-library/no-framework.module.ts","../../../../projects/ng-formworks-core/src/lib/json-schema-form.component.ts","../../../../projects/ng-formworks-core/src/lib/json-schema-form.component.html","../../../../projects/ng-formworks-core/src/lib/json-schema-form.module.ts","../../../../projects/ng-formworks-core/src/public_api.ts","../../../../projects/ng-formworks-core/src/ng-formworks-core.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\r\n\r\n@Injectable()\r\nexport class Framework {\r\n name: string;\r\n text:string;\r\n framework: any;\r\n widgets?: { [key: string]: any } = {};\r\n stylesheets?: string[] = [];\r\n scripts?: string[] = [];\r\n}\r\n","export const deValidationMessages: any = { // Default German error messages\r\n required: 'Darf nicht leer sein',\r\n minLength: 'Mindestens {{minimumLength}} Zeichen benötigt (aktuell: {{currentLength}})',\r\n maxLength: 'Maximal {{maximumLength}} Zeichen erlaubt (aktuell: {{currentLength}})',\r\n pattern: 'Entspricht nicht diesem regulären Ausdruck: {{requiredPattern}}',\r\n format: function (error) {\r\n switch (error.requiredFormat) {\r\n case 'date':\r\n return 'Muss ein Datum sein, z. B. \"2000-12-31\"';\r\n case 'time':\r\n return 'Muss eine Zeitangabe sein, z. B. \"16:20\" oder \"03:14:15.9265\"';\r\n case 'date-time':\r\n return 'Muss Datum mit Zeit beinhalten, z. B. \"2000-03-14T01:59\" oder \"2000-03-14T01:59:26.535Z\"';\r\n case 'email':\r\n return 'Keine gültige E-Mail-Adresse (z. B. \"name@example.com\")';\r\n case 'hostname':\r\n return 'Kein gültiger Hostname (z. B. \"example.com\")';\r\n case 'ipv4':\r\n return 'Keine gültige IPv4-Adresse (z. B. \"127.0.0.1\")';\r\n case 'ipv6':\r\n return 'Keine gültige IPv6-Adresse (z. B. \"1234:5678:9ABC:DEF0:1234:5678:9ABC:DEF0\")';\r\n // TODO: add examples for 'uri', 'uri-reference', and 'uri-template'\r\n // case 'uri': case 'uri-reference': case 'uri-template':\r\n case 'url':\r\n return 'Keine gültige URL (z. B. \"http://www.example.com/page.html\")';\r\n case 'uuid':\r\n return 'Keine gültige UUID (z. B. \"12345678-9ABC-DEF0-1234-56789ABCDEF0\")';\r\n case 'color':\r\n return 'Kein gültiger Farbwert (z. B. \"#FFFFFF\")';\r\n case 'json-pointer':\r\n return 'Kein gültiger JSON-Pointer (z. B. \"/pointer/to/something\")';\r\n case 'relative-json-pointer':\r\n return 'Kein gültiger relativer JSON-Pointer (z. B. \"2/pointer/to/something\")';\r\n case 'regex':\r\n return 'Kein gültiger regulärer Ausdruck (z. B. \"(1-)?\\\\d{3}-\\\\d{3}-\\\\d{4}\")';\r\n case 'duration':\r\n return \"Muss eine gültige ISO 8601-Dauer sein (z. B. 'PT1H30M')\"; \r\n default:\r\n return 'Muss diesem Format entsprechen: ' + error.requiredFormat;\r\n }\r\n },\r\n minimum: 'Muss mindestens {{minimumValue}} sein',\r\n exclusiveMinimum: 'Muss größer als {{exclusiveMinimumValue}} sein',\r\n maximum: 'Darf maximal {{maximumValue}} sein',\r\n exclusiveMaximum: 'Muss kleiner als {{exclusiveMaximumValue}} sein',\r\n multipleOf: function (error) {\r\n if ((1 / error.multipleOfValue) % 10 === 0) {\r\n const decimals = Math.log10(1 / error.multipleOfValue);\r\n return `Maximal ${decimals} Dezimalstellen erlaubt`;\r\n } else {\r\n return `Muss ein Vielfaches von ${error.multipleOfValue} sein`;\r\n }\r\n },\r\n minProperties: 'Mindestens {{minimumProperties}} Attribute erforderlich (aktuell: {{currentProperties}})',\r\n maxProperties: 'Maximal {{maximumProperties}} Attribute erlaubt (aktuell: {{currentProperties}})',\r\n minItems: 'Mindestens {{minimumItems}} Werte erforderlich (aktuell: {{currentItems}})',\r\n maxItems: 'Maximal {{maximumItems}} Werte erlaubt (aktuell: {{currentItems}})',\r\n uniqueItems: 'Alle Werte müssen eindeutig sein',\r\n // Note: No default error messages for 'type', 'const', 'enum', or 'dependencies'\r\n};\r\n","export const enValidationMessages: any = { // Default English error messages\r\n required: 'This field is required.',\r\n minLength: 'Must be {{minimumLength}} characters or longer (current length: {{currentLength}})',\r\n maxLength: 'Must be {{maximumLength}} characters or shorter (current length: {{currentLength}})',\r\n pattern: 'Must match pattern: {{requiredPattern}}',\r\n format: function (error) {\r\n switch (error.requiredFormat) {\r\n case 'date':\r\n return 'Must be a date, like \"2000-12-31\"';\r\n case 'time':\r\n return 'Must be a time, like \"16:20\" or \"03:14:15.9265\"';\r\n case 'date-time':\r\n return 'Must be a date-time, like \"2000-03-14T01:59\" or \"2000-03-14T01:59:26.535Z\"';\r\n case 'email':\r\n return 'Must be an email address, like \"name@example.com\"';\r\n case 'hostname':\r\n return 'Must be a hostname, like \"example.com\"';\r\n case 'ipv4':\r\n return 'Must be an IPv4 address, like \"127.0.0.1\"';\r\n case 'ipv6':\r\n return 'Must be an IPv6 address, like \"1234:5678:9ABC:DEF0:1234:5678:9ABC:DEF0\"';\r\n // TODO: add examples for 'uri', 'uri-reference', and 'uri-template'\r\n // case 'uri': case 'uri-reference': case 'uri-template':\r\n case 'url':\r\n return 'Must be a url, like \"http://www.example.com/page.html\"';\r\n case 'uuid':\r\n return 'Must be a uuid, like \"12345678-9ABC-DEF0-1234-56789ABCDEF0\"';\r\n case 'color':\r\n return 'Must be a color, like \"#FFFFFF\"';\r\n case 'json-pointer':\r\n return 'Must be a JSON Pointer, like \"/pointer/to/something\"';\r\n case 'relative-json-pointer':\r\n return 'Must be a relative JSON Pointer, like \"2/pointer/to/something\"';\r\n case 'regex':\r\n return 'Must be a regular expression, like \"(1-)?\\\\d{3}-\\\\d{3}-\\\\d{4}\"';\r\n case 'duration':\r\n return \"Must be a valid ISO 8601 duration (e.g., 'PT1H30M')\";\r\n default:\r\n return 'Must be a correctly formatted ' + error.requiredFormat;\r\n }\r\n },\r\n minimum: 'Must be {{minimumValue}} or more',\r\n exclusiveMinimum: 'Must be more than {{exclusiveMinimumValue}}',\r\n maximum: 'Must be {{maximumValue}} or less',\r\n exclusiveMaximum: 'Must be less than {{exclusiveMaximumValue}}',\r\n multipleOf: function (error) {\r\n if ((1 / error.multipleOfValue) % 10 === 0) {\r\n const decimals = Math.log10(1 / error.multipleOfValue);\r\n return `Must have ${decimals} or fewer decimal places.`;\r\n } else {\r\n return `Must be a multiple of ${error.multipleOfValue}.`;\r\n }\r\n },\r\n minProperties: 'Must have {{minimumProperties}} or more items (current items: {{currentProperties}})',\r\n maxProperties: 'Must have {{maximumProperties}} or fewer items (current items: {{currentProperties}})',\r\n minItems: 'Must have {{minimumItems}} or more items (current items: {{currentItems}})',\r\n maxItems: 'Must have {{maximumItems}} or fewer items (current items: {{currentItems}})',\r\n uniqueItems: 'All items must be unique',\r\n // Note: No default error messages for 'type', 'const', 'enum', or 'dependencies'\r\n};\r\n","export const esValidationMessages: any = { // Default Spanish error messages\r\n required: 'Este campo está requerido.',\r\n minLength: 'Debe tener {{minimumLength}} caracteres o más longitud (longitud actual: {{currentLength}})',\r\n maxLength: 'Debe tener {{maximumLength}} caracteres o menos longitud (longitud actual: {{currentLength}})',\r\n pattern: 'Must match pattern: {{requiredPattern}}',\r\n format: function (error) {\r\n switch (error.requiredFormat) {\r\n case 'date':\r\n return 'Debe tener una fecha, ej \"2000-12-31\"';\r\n case 'time':\r\n return 'Debe tener una hora, ej \"16:20\" o \"03:14:15.9265\"';\r\n case 'date-time':\r\n return 'Debe tener fecha y hora, ej \"2000-03-14T01:59\" o \"2000-03-14T01:59:26.535Z\"';\r\n case 'email':\r\n return 'No hay dirección de correo electrónico válida, ej \"name@example.com\"';\r\n case 'hostname':\r\n return 'Debe ser un nombre de host válido, ej \"example.com\"';\r\n case 'ipv4':\r\n return 'Debe ser una dirección de IPv4, ej \"127.0.0.1\"';\r\n case 'ipv6':\r\n return 'Debe ser una dirección de IPv6, ej \"1234:5678:9ABC:DEF0:1234:5678:9ABC:DEF0\"';\r\n case 'url':\r\n return 'Debe ser una URL, ej \"http://www.example.com/page.html\"';\r\n case 'uuid':\r\n return 'Debe ser un UUID, ej \"12345678-9ABC-DEF0-1234-56789ABCDEF0\"';\r\n case 'color':\r\n return 'Debe ser un color, ej \"#FFFFFF\"';\r\n case 'json-pointer':\r\n return 'Debe ser un JSON Pointer, ej \"/pointer/to/something\"';\r\n case 'relative-json-pointer':\r\n return 'Debe ser un JSON Pointer relativo, ej \"2/pointer/to/something\"';\r\n case 'regex':\r\n return 'Debe ser una expresión regular, ej \"(1-)?\\\\d{3}-\\\\d{3}-\\\\d{4}\"';\r\n case 'duration':\r\n return \"Debe ser una duración válida en formato ISO 8601 (p. ej., 'PT1H30M')\"; \r\n default:\r\n return 'Debe tener el formato correcto ' + error.requiredFormat;\r\n }\r\n },\r\n minimum: 'Debe ser {{minimumValue}} o más',\r\n exclusiveMinimum: 'Debe ser superior a {{exclusiveMinimumValue}}',\r\n maximum: 'Debe ser {{maximumValue}} o menos',\r\n exclusiveMaximum: 'Debe ser menor que {{exclusiveMaximumValue}}',\r\n multipleOf: function (error) {\r\n if ((1 / error.multipleOfValue) % 10 === 0) {\r\n const decimals = Math.log10(1 / error.multipleOfValue);\r\n return `Se permite un máximo de ${decimals} decimales`;\r\n } else {\r\n return `Debe ser múltiplo de ${error.multipleOfValue}.`;\r\n }\r\n },\r\n minProperties: 'Debe tener {{minimumProperties}} o más elementos (elementos actuales: {{currentProperties}})',\r\n maxProperties: 'Debe tener {{maximumProperties}} o menos elementos (elementos actuales: {{currentProperties}})',\r\n minItems: 'Debe tener {{minimumItems}} o más elementos (elementos actuales: {{currentItems}})',\r\n maxItems: 'Debe tener {{maximumItems}} o menos elementos (elementos actuales: {{currentItems}})',\r\n uniqueItems: 'Todos los elementos deben ser únicos',\r\n};\r\n","export const frValidationMessages: any = { // French error messages\r\n required: 'Est obligatoire.',\r\n minLength: 'Doit avoir minimum {{minimumLength}} caractères (actuellement: {{currentLength}})',\r\n maxLength: 'Doit avoir maximum {{maximumLength}} caractères (actuellement: {{currentLength}})',\r\n pattern: 'Doit respecter: {{requiredPattern}}',\r\n format: function (error) {\r\n switch (error.requiredFormat) {\r\n case 'date':\r\n return 'Doit être une date, tel que \"2000-12-31\"';\r\n case 'time':\r\n return 'Doit être une heure, tel que \"16:20\" ou \"03:14:15.9265\"';\r\n case 'date-time':\r\n return 'Doit être une date et une heure, tel que \"2000-03-14T01:59\" ou \"2000-03-14T01:59:26.535Z\"';\r\n case 'email':\r\n return 'Doit être une adresse e-mail, tel que \"name@example.com\"';\r\n case 'hostname':\r\n return 'Doit être un nom de domaine, tel que \"example.com\"';\r\n case 'ipv4':\r\n return 'Doit être une adresse IPv4, tel que \"127.0.0.1\"';\r\n case 'ipv6':\r\n return 'Doit être une adresse IPv6, tel que \"1234:5678:9ABC:DEF0:1234:5678:9ABC:DEF0\"';\r\n // TODO: add examples for 'uri', 'uri-reference', and 'uri-template'\r\n // case 'uri': case 'uri-reference': case 'uri-template':\r\n case 'url':\r\n return 'Doit être une URL, tel que \"http://www.example.com/page.html\"';\r\n case 'uuid':\r\n return 'Doit être un UUID, tel que \"12345678-9ABC-DEF0-1234-56789ABCDEF0\"';\r\n case 'color':\r\n return 'Doit être une couleur, tel que \"#FFFFFF\"';\r\n case 'json-pointer':\r\n return 'Doit être un JSON Pointer, tel que \"/pointer/to/something\"';\r\n case 'relative-json-pointer':\r\n return 'Doit être un relative JSON Pointer, tel que \"2/pointer/to/something\"';\r\n case 'regex':\r\n return 'Doit être une expression régulière, tel que \"(1-)?\\\\d{3}-\\\\d{3}-\\\\d{4}\"';\r\n case 'duration':\r\n return \"Doit être une durée valide au format ISO 8601 (par ex., 'PT1H30M')\";\r\n default:\r\n return 'Doit être avoir le format correct: ' + error.requiredFormat;\r\n }\r\n },\r\n minimum: 'Doit être supérieur à {{minimumValue}}',\r\n exclusiveMinimum: 'Doit avoir minimum {{exclusiveMinimumValue}} charactères',\r\n maximum: 'Doit être inférieur à {{maximumValue}}',\r\n exclusiveMaximum: 'Doit avoir maximum {{exclusiveMaximumValue}} charactères',\r\n multipleOf: function (error) {\r\n if ((1 / error.multipleOfValue) % 10 === 0) {\r\n const decimals = Math.log10(1 / error.multipleOfValue);\r\n return `Doit comporter ${decimals} ou moins de decimales.`;\r\n } else {\r\n return `Doit être un multiple de ${error.multipleOfValue}.`;\r\n }\r\n },\r\n minProperties: 'Doit comporter au minimum {{minimumProperties}} éléments',\r\n maxProperties: 'Doit comporter au maximum {{maximumProperties}} éléments',\r\n minItems: 'Doit comporter au minimum {{minimumItems}} éléments',\r\n maxItems: 'Doit comporter au maximum {{minimumItems}} éléments',\r\n uniqueItems: 'Tous les éléments doivent être uniques',\r\n // Note: No default error messages for 'type', 'const', 'enum', or 'dependencies'\r\n};\r\n","export const itValidationMessages: any = { // Default Italian error messages\r\n required: 'Il campo è obbligatorio',\r\n minLength: 'Deve inserire almeno {{minimumLength}} caratteri (lunghezza corrente: {{currentLength}})',\r\n maxLength: 'Il numero massimo di caratteri consentito è {{maximumLength}} (lunghezza corrente: {{currentLength}})',\r\n pattern: 'Devi rispettare il pattern : {{requiredPattern}}',\r\n format: function (error) {\r\n switch (error.requiredFormat) {\r\n case 'date':\r\n return 'Deve essere una data, come \"31-12-2000\"';\r\n case 'time':\r\n return 'Deve essere un orario, come \"16:20\" o \"03:14:15.9265\"';\r\n case 'date-time':\r\n return 'Deve essere data-orario, come \"14-03-2000T01:59\" or \"14-03-2000T01:59:26.535Z\"';\r\n case 'email':\r\n return 'Deve essere un indirzzo email, come \"name@example.com\"';\r\n case 'hostname':\r\n return 'Deve essere un hostname, come \"example.com\"';\r\n case 'ipv4':\r\n return 'Deve essere un indirizzo IPv4, come \"127.0.0.1\"';\r\n case 'ipv6':\r\n return 'Deve essere un indirizzo IPv6, come \"1234:5678:9ABC:DEF0:1234:5678:9ABC:DEF0\"';\r\n // TODO: add examples for 'uri', 'uri-reference', and 'uri-template'\r\n // case 'uri': case 'uri-reference': case 'uri-template':\r\n case 'url':\r\n return 'Deve essere un url, come \"http://www.example.com/page.html\"';\r\n case 'uuid':\r\n return 'Deve essere un uuid, come \"12345678-9ABC-DEF0-1234-56789ABCDEF0\"';\r\n case 'color':\r\n return 'Deve essere un colore, come \"#FFFFFF\"';\r\n case 'json-pointer':\r\n return 'Deve essere un JSON Pointer, come \"/pointer/to/something\"';\r\n case 'relative-json-pointer':\r\n return 'Deve essere un JSON Pointer relativo, come \"2/pointer/to/something\"';\r\n case 'regex':\r\n return 'Deve essere una regular expression, come \"(1-)?\\\\d{3}-\\\\d{3}-\\\\d{4}\"';\r\n case 'duration':\r\n return \"Deve essere una durata valida nel formato ISO 8601 (es. 'PT1H30M')\"; \r\n default:\r\n return 'Deve essere formattato correttamente ' + error.requiredFormat;\r\n }\r\n },\r\n minimum: 'Deve essere {{minimumValue}} o più',\r\n exclusiveMinimum: 'Deve essere più di {{exclusiveMinimumValue}}',\r\n maximum: 'Deve essere {{maximumValue}} o meno',\r\n exclusiveMaximum: 'Deve essere minore di {{exclusiveMaximumValue}}',\r\n multipleOf: function (error) {\r\n if ((1 / error.multipleOfValue) % 10 === 0) {\r\n const decimals = Math.log10(1 / error.multipleOfValue);\r\n return `Deve avere ${decimals} o meno decimali.`;\r\n } else {\r\n return `Deve essere multiplo di ${error.multipleOfValue}.`;\r\n }\r\n },\r\n minProperties: 'Deve avere {{minimumProperties}} o più elementi (elementi correnti: {{currentProperties}})',\r\n maxProperties: 'Deve avere {{maximumProperties}} o meno elementi (elementi correnti: {{currentProperties}})',\r\n minItems: 'Deve avere {{minimumItems}} o più elementi (elementi correnti: {{currentItems}})',\r\n maxItems: 'Deve avere {{maximumItems}} o meno elementi (elementi correnti: {{currentItems}})',\r\n uniqueItems: 'Tutti gli elementi devono essere unici',\r\n // Note: No default error messages for 'type', 'const', 'enum', or 'dependencies'\r\n};\r\n","export const ptValidationMessages: any = { // Brazilian Portuguese error messages\r\n required: 'Este campo é obrigatório.',\r\n minLength: 'É preciso no mínimo {{minimumLength}} caracteres ou mais (tamanho atual: {{currentLength}})',\r\n maxLength: 'É preciso no máximo {{maximumLength}} caracteres ou menos (tamanho atual: {{currentLength}})',\r\n pattern: 'Tem que ajustar ao formato: {{requiredPattern}}',\r\n format: function (error) {\r\n switch (error.requiredFormat) {\r\n case 'date':\r\n return 'Tem que ser uma data, por exemplo \"2000-12-31\"';\r\n case 'time':\r\n return 'Tem que ser horário, por exemplo \"16:20\" ou \"03:14:15.9265\"';\r\n case 'date-time':\r\n return 'Tem que ser data e hora, por exemplo \"2000-03-14T01:59\" ou \"2000-03-14T01:59:26.535Z\"';\r\n case 'email':\r\n return 'Tem que ser um email, por exemplo \"fulano@exemplo.com.br\"';\r\n case 'hostname':\r\n return 'Tem que ser uma nome de domínio, por exemplo \"exemplo.com.br\"';\r\n case 'ipv4':\r\n return 'Tem que ser um endereço IPv4, por exemplo \"127.0.0.1\"';\r\n case 'ipv6':\r\n return 'Tem que ser um endereço IPv6, por exemplo \"1234:5678:9ABC:DEF0:1234:5678:9ABC:DEF0\"';\r\n // TODO: add examples for 'uri', 'uri-reference', and 'uri-template'\r\n // case 'uri': case 'uri-reference': case 'uri-template':\r\n case 'url':\r\n return 'Tem que ser uma URL, por exemplo \"http://www.exemplo.com.br/pagina.html\"';\r\n case 'uuid':\r\n return 'Tem que ser um uuid, por exemplo \"12345678-9ABC-DEF0-1234-56789ABCDEF0\"';\r\n case 'color':\r\n return 'Tem que ser uma cor, por exemplo \"#FFFFFF\"';\r\n case 'json-pointer':\r\n return 'Tem que ser um JSON Pointer, por exemplo \"/referencia/para/algo\"';\r\n case 'relative-json-pointer':\r\n return 'Tem que ser um JSON Pointer relativo, por exemplo \"2/referencia/para/algo\"';\r\n case 'regex':\r\n return 'Tem que ser uma expressão regular, por exemplo \"(1-)?\\\\d{3}-\\\\d{3}-\\\\d{4}\"';\r\n case 'duration':\r\n return \"Deve ser uma duração válida no formato ISO 8601 (ex.: 'PT1H30M')\";\r\n default:\r\n return 'Tem que ser no formato: ' + error.requiredFormat;\r\n }\r\n },\r\n minimum: 'Tem que ser {{minimumValue}} ou mais',\r\n exclusiveMinimum: 'Tem que ser mais que {{exclusiveMinimumValue}}',\r\n maximum: 'Tem que ser {{maximumValue}} ou menos',\r\n exclusiveMaximum: 'Tem que ser menor que {{exclusiveMaximumValue}}',\r\n multipleOf: function (error) {\r\n if ((1 / error.multipleOfValue) % 10 === 0) {\r\n const decimals = Math.log10(1 / error.multipleOfValue);\r\n return `Tem que ter ${decimals} ou menos casas decimais.`;\r\n } else {\r\n return `Tem que ser um múltiplo de ${error.multipleOfValue}.`;\r\n }\r\n },\r\n minProperties: 'Deve ter {{minimumProperties}} ou mais itens (itens até o momento: {{currentProperties}})',\r\n maxProperties: 'Deve ter {{maximumProperties}} ou menos intens (itens até o momento: {{currentProperties}})',\r\n minItems: 'Deve ter {{minimumItems}} ou mais itens (itens até o momento: {{currentItems}})',\r\n maxItems: 'Deve ter {{maximumItems}} ou menos itens (itens até o momento: {{currentItems}})',\r\n uniqueItems: 'Todos os itens devem ser únicos',\r\n // Note: No default error messages for 'type', 'const', 'enum', or 'dependencies'\r\n};\r\n","export const zhValidationMessages: any = { // Chinese error messages\r\n required: '必填字段.',\r\n minLength: '字符长度必须大于或者等于 {{minimumLength}} (当前长度: {{currentLength}})',\r\n maxLength: '字符长度必须小于或者等于 {{maximumLength}} (当前长度: {{currentLength}})',\r\n pattern: '必须匹配正则表达式: {{requiredPattern}}',\r\n format: function (error) {\r\n switch (error.requiredFormat) {\r\n case 'date':\r\n return '必须为日期格式, 比如 \"2000-12-31\"';\r\n case 'time':\r\n return '必须为时间格式, 比如 \"16:20\" 或者 \"03:14:15.9265\"';\r\n case 'date-time':\r\n return '必须为日期时间格式, 比如 \"2000-03-14T01:59\" 或者 \"2000-03-14T01:59:26.535Z\"';\r\n case 'email':\r\n return '必须为邮箱地址, 比如 \"name@example.com\"';\r\n case 'hostname':\r\n return '必须为主机名, 比如 \"example.com\"';\r\n case 'ipv4':\r\n return '必须为 IPv4 地址, 比如 \"127.0.0.1\"';\r\n case 'ipv6':\r\n return '必须为 IPv6 地址, 比如 \"1234:5678:9ABC:DEF0:1234:5678:9ABC:DEF0\"';\r\n // TODO: add examples for 'uri', 'uri-reference', and 'uri-template'\r\n // case 'uri': case 'uri-reference': case 'uri-template':\r\n case 'url':\r\n return '必须为 url, 比如 \"http://www.example.com/page.html\"';\r\n case 'uuid':\r\n return '必须为 uuid, 比如 \"12345678-9ABC-DEF0-1234-56789ABCDEF0\"';\r\n case 'color':\r\n return '必须为颜色值, 比如 \"#FFFFFF\"';\r\n case 'json-pointer':\r\n return '必须为 JSON Pointer, 比如 \"/pointer/to/something\"';\r\n case 'relative-json-pointer':\r\n return '必须为相对的 JSON Pointer, 比如 \"2/pointer/to/something\"';\r\n case 'regex':\r\n return '必须为正则表达式, 比如 \"(1-)?\\\\d{3}-\\\\d{3}-\\\\d{4}\"';\r\n case 'duration':\r\n return \"必须是有效的 ISO 8601 持续时间(例如:'PT1H30M')\"; \r\n default:\r\n return '必须为格式正确的 ' + error.requiredFormat;\r\n }\r\n },\r\n minimum: '必须大于或者等于最小值: {{minimumValue}}',\r\n exclusiveMinimum: '必须大于最小值: {{exclusiveMinimumValue}}',\r\n maximum: '必须小于或者等于最大值: {{maximumValue}}',\r\n exclusiveMaximum: '必须小于最大值: {{exclusiveMaximumValue}}',\r\n multipleOf: function (error) {\r\n if ((1 / error.multipleOfValue) % 10 === 0) {\r\n const decimals = Math.log10(1 / error.multipleOfValue);\r\n return `必须有 ${decimals} 位或更少的小数位`;\r\n } else {\r\n return `必须为 ${error.multipleOfValue} 的倍数`;\r\n }\r\n },\r\n minProperties: '项目数必须大于或者等于 {{minimumProperties}} (当前项目数: {{currentProperties}})',\r\n maxProperties: '项目数必须小于或者等于 {{maximumProperties}} (当前项目数: {{currentProperties}})',\r\n minItems: '项目数必须大于或者等于 {{minimumItems}} (当前项目数: {{currentItems}})',\r\n maxItems: '项目数必须小于或者等于 {{maximumItems}} (当前项目数: {{currentItems}})',\r\n uniqueItems: '所有项目必须是唯一的',\r\n // Note: No default error messages for 'type', 'const', 'enum', or 'dependencies'\r\n};\r\n","import { AbstractControl } from '@angular/forms';\r\nimport { from, Observable } from 'rxjs';\r\n\r\n/**\r\n * Validator utility function library:\r\n *\r\n * Validator and error utilities:\r\n * _executeValidators, _executeAsyncValidators, _mergeObjects, _mergeErrors\r\n *\r\n * Individual value checking:\r\n * isDefined, hasValue, isEmpty\r\n *\r\n * Individual type checking:\r\n * isString, isNumber, isInteger, isBoolean, isFunction, isObject, isArray,\r\n * isMap, isSet, isPromise, isObservable\r\n *\r\n * Multiple type checking and fixing:\r\n * getType, isType, isPrimitive, toJavaScriptType, toSchemaType,\r\n * _toPromise, toObservable\r\n *\r\n * Utility functions:\r\n * inArray, xor\r\n *\r\n * Typescript types and interfaces:\r\n * SchemaPrimitiveType, SchemaType, JavaScriptPrimitiveType, JavaScriptType,\r\n * PrimitiveValue, PlainObject, IValidatorFn, AsyncIValidatorFn\r\n *\r\n * Note: 'IValidatorFn' is short for 'invertable validator function',\r\n * which is a validator functions that accepts an optional second\r\n * argument which, if set to TRUE, causes the validator to perform\r\n * the opposite of its original function.\r\n */\r\n\r\nexport type SchemaPrimitiveType =\r\n 'string' | 'number' | 'integer' | 'boolean' | 'null';\r\nexport type SchemaType =\r\n 'string' | 'number' | 'integer' | 'boolean' | 'null' | 'object' | 'array';\r\nexport type JavaScriptPrimitiveType =\r\n 'string' | 'number' | 'boolean' | 'null' | 'undefined';\r\nexport type JavaScriptType =\r\n 'string' | 'number' | 'boolean' | 'null' | 'undefined' | 'object' | 'array' |\r\n 'map' | 'set' | 'arguments' | 'date' | 'error' | 'function' | 'json' |\r\n 'math' | 'regexp'; // Note: this list is incomplete\r\nexport type PrimitiveValue = string | number | boolean | null | undefined;\r\nexport interface PlainObject { [k: string]: any; }\r\n\r\nexport type IValidatorFn = (c: AbstractControl, i?: boolean) => PlainObject;\r\nexport type AsyncIValidatorFn = (c: AbstractControl, i?: boolean) => any;\r\n\r\n/**\r\n * '_executeValidators' utility function\r\n *\r\n * Validates a control against an array of validators, and returns\r\n * an array of the same length containing a combination of error messages\r\n * (from invalid validators) and null values (from valid validators)\r\n *\r\n * // { AbstractControl } control - control to validate\r\n * // { IValidatorFn[] } validators - array of validators\r\n * // { boolean } invert - invert?\r\n * // { PlainObject[] } - array of nulls and error message\r\n */\r\nexport function _executeValidators(control, validators, invert = false) {\r\n return validators.map(validator => validator(control, invert));\r\n}\r\n\r\n/**\r\n * '_executeAsyncValidators' utility function\r\n *\r\n * Validates a control against an array of async validators, and returns\r\n * an array of observabe results of the same length containing a combination of\r\n * error messages (from invalid validators) and null values (from valid ones)\r\n *\r\n * // { AbstractControl } control - control to validate\r\n * // { AsyncIValidatorFn[] } validators - array of async validators\r\n * // { boolean } invert - invert?\r\n * // - array of observable nulls and error message\r\n */\r\nexport function _executeAsyncValidators(control, validators, invert = false) {\r\n return validators.map(validator => validator(control, invert));\r\n}\r\n\r\n/**\r\n * '_mergeObjects' utility function\r\n *\r\n * Recursively Merges one or more objects into a single object with combined keys.\r\n * Automatically detects and ignores null and undefined inputs.\r\n * Also detects duplicated boolean 'not' keys and XORs their values.\r\n *\r\n * // { PlainObject[] } objects - one or more objects to merge\r\n * // { PlainObject } - merged object\r\n */\r\nexport function _mergeObjects(...objects) {\r\n const mergedObject: PlainObject = { };\r\n for (const currentObject of objects) {\r\n if (isObject(currentObject)) {\r\n for (const key of Object.keys(currentObject)) {\r\n const currentValue = currentObject[key];\r\n const mergedValue = mergedObject[key];\r\n mergedObject[key] = !isDefined(mergedValue) ? currentValue :\r\n key === 'not' && isBoolean(mergedValue, 'strict') &&\r\n isBoolean(currentValue, 'strict') ? xor(mergedValue, currentValue) :\r\n getType(mergedValue) === 'object' && getType(currentValue) === 'object' ?\r\n _mergeObjects(mergedValue, currentValue) :\r\n currentValue;\r\n }\r\n }\r\n }\r\n return mergedObject;\r\n}\r\n\r\n/**\r\n * '_mergeErrors' utility function\r\n *\r\n * Merges an array of objects.\r\n * Used for combining the validator errors returned from 'executeValidators'\r\n *\r\n * // { PlainObject[] } arrayOfErrors - array of objects\r\n * // { PlainObject } - merged object, or null if no usable input objectcs\r\n */\r\nexport function _mergeErrors(arrayOfErrors) {\r\n const mergedErrors = _mergeObjects(...arrayOfErrors);\r\n return isEmpty(mergedErrors) ? null : mergedErrors;\r\n}\r\n\r\n/**\r\n * 'isDefined' utility function\r\n *\r\n * Checks if a variable contains a value of any type.\r\n * Returns true even for otherwise 'falsey' values of 0, '', and false.\r\n *\r\n * // value - the value to check\r\n * // { boolean } - false if undefined or null, otherwise true\r\n */\r\nexport function isDefined(value) {\r\n return value !== undefined && value !== null;\r\n}\r\n\r\n/**\r\n * 'hasValue' utility function\r\n *\r\n * Checks if a variable contains a value.\r\n * Returs false for null, undefined, or a zero-length strng, '',\r\n * otherwise returns true.\r\n * (Stricter than 'isDefined' because it also returns false for '',\r\n * though it stil returns true for otherwise 'falsey' values 0 and false.)\r\n *\r\n * // value - the value to check\r\n * // { boolean } - false if undefined, null, or '', otherwise true\r\n */\r\nexport function hasValue(value) {\r\n return value !== undefined && value !== null && value !== '';\r\n}\r\n\r\n/**\r\n * 'isEmpty' utility function\r\n *\r\n * Similar to !hasValue, but also returns true for empty arrays and objects.\r\n *\r\n * // value - the value to check\r\n * // { boolean } - false if undefined, null, or '', otherwise true\r\n */\r\nexport function isEmpty(value) {\r\n if (isArray(value)) { return !value.length; }\r\n if (isObject(value)) { return !Object.keys(value).length; }\r\n return value === undefined || value === null || value === '';\r\n}\r\n\r\n/**\r\n * 'isString' utility function\r\n *\r\n * Checks if a value is a string.\r\n *\r\n * // value - the value to check\r\n * // { boolean } - true if string, false if not\r\n */\r\nexport function isString(value) {\r\n return typeof value === 'string';\r\n}\r\n\r\n/**\r\n * 'isNumber' utility function\r\n *\r\n * Checks if a value is a regular number, numeric string, or JavaScript Date.\r\n *\r\n * // value - the value to check\r\n * // { any = false } strict - if truthy, also checks JavaScript tyoe\r\n * // { boolean } - true if number, false if not\r\n */\r\nexport function isNumber(value, strict: any = false) {\r\n if (strict && typeof value !== 'number') { return false; }\r\n return !isNaN(value) && value !== value / 0;\r\n}\r\n\r\n/**\r\n * 'isInteger' utility function\r\n *\r\n * Checks if a value is an integer.\r\n *\r\n * // value - the value to check\r\n * // { any = false } strict - if truthy, also checks JavaScript tyoe\r\n * // {boolean } - true if number, false if not\r\n */\r\nexport function isInteger(value, strict: any = false) {\r\n if (strict && typeof value !== 'number') { return false; }\r\n return !isNaN(value) && value !== value / 0 && value % 1 === 0;\r\n}\r\n\r\n/**\r\n * 'isBoolean' utility function\r\n *\r\n * Checks if a value is a boolean.\r\n *\r\n * // value - the value to check\r\n * // { any = null } option - if 'strict', also checks JavaScript type\r\n * if TRUE or FALSE, checks only for that value\r\n * // { boolean } - true if boolean, false if not\r\n */\r\nexport function isBoolean(value, option: any = null) {\r\n if (option === 'strict') { return value === true || value === false; }\r\n if (option === true) {\r\n return value === true || value === 1 || value === 'true' || value === '1';\r\n }\r\n if (option === false) {\r\n return value === false || value === 0 || value === 'false' || value === '0';\r\n }\r\n return value === true || value === 1 || value === 'true' || value === '1' ||\r\n value === false || value === 0 || value === 'false' || value === '0';\r\n}\r\n\r\nexport function isFunction(item: any): boolean {\r\n return typeof item === 'function';\r\n}\r\n\r\nexport function isObject(item: any): boolean {\r\n return item !== null && typeof item === 'object';\r\n}\r\n\r\nexport function isArray(item: any): boolean {\r\n return Array.isArray(item);\r\n}\r\n\r\nexport function isDate(item: any): boolean {\r\n return !!item && Object.prototype.toString.call(item) === '[object Date]';\r\n}\r\n\r\nexport function isMap(item: any): boolean {\r\n return !!item && Object.prototype.toString.call(item) === '[object Map]';\r\n}\r\n\r\nexport function isSet(item: any): boolean {\r\n return !!item && Object.prototype.toString.call(item) === '[object Set]';\r\n}\r\n\r\nexport function isSymbol(item: any): boolean {\r\n return typeof item === 'symbol';\r\n}\r\n\r\n/**\r\n * 'getType' function\r\n *\r\n * Detects the JSON Schema Type of a value.\r\n * By default, detects numbers and integers even if formatted as strings.\r\n * (So all integers are also numbers, and any number may also be a string.)\r\n * However, it only detects true boolean values (to detect boolean values\r\n * in non-boolean formats, use isBoolean() instead).\r\n *\r\n * If passed a second optional parameter of 'strict', it will only detect\r\n * numbers and integers if they are formatted as JavaScript numbers.\r\n *\r\n * Examples:\r\n * getType('10.5') = 'number'\r\n * getType(10.5) = 'number'\r\n * getType('10') = 'integer'\r\n * getType(10) = 'integer'\r\n * getType('true') = 'string'\r\n * getType(true) = 'boolean'\r\n * getType(null) = 'null'\r\n * getType({ }) = 'object'\r\n * getType([]) = 'array'\r\n *\r\n * getType('10.5', 'strict') = 'string'\r\n * getType(10.5, 'strict') = 'number'\r\n * getType('10', 'strict') = 'string'\r\n * getType(10, 'strict') = 'integer'\r\n * getType('true', 'strict') = 'string'\r\n * getType(true, 'strict') = 'boolean'\r\n *\r\n * // value - value to check\r\n * // { any = false } strict - if truthy, also checks JavaScript tyoe\r\n * // { SchemaType }\r\n */\r\nexport function getType(value, strict: any = false) {\r\n if (!isDefined(value)) { return 'null'; }\r\n if (isArray(value)) { return 'array'; }\r\n if (isObject(value)) { return 'object'; }\r\n if (isBoolean(value, 'strict')) { return 'boolean'; }\r\n if (isInteger(value, strict)) { return 'integer'; }\r\n if (isNumber(value, strict)) { return 'number'; }\r\n if (isString(value) || (!strict && isDate(value))) { return 'string'; }\r\n return null;\r\n}\r\n\r\n/**\r\n * 'isType' function\r\n *\r\n * Checks wether an input (probably string) value contains data of\r\n * a specified JSON Schema type\r\n *\r\n * // { PrimitiveValue } value - value to check\r\n * // { SchemaPrimitiveType } type - type to check\r\n * // { boolean }\r\n */\r\nexport function isType(value, type) {\r\n switch (type) {\r\n case 'string':\r\n return isString(value) || isDate(value);\r\n case 'number':\r\n return isNumber(value);\r\n case 'integer':\r\n return isInteger(value);\r\n case 'boolean':\r\n return isBoolean(value);\r\n case 'null':\r\n return !hasValue(value);\r\n default:\r\n console.error(`isType error: \"${type}\" is not a recognized type.`);\r\n return null;\r\n }\r\n}\r\n\r\n/**\r\n * 'isPrimitive' function\r\n *\r\n * Checks wether an input value is a JavaScript primitive type:\r\n * string, number, boolean, or null.\r\n *\r\n * // value - value to check\r\n * // { boolean }\r\n */\r\nexport function isPrimitive(value) {\r\n return (isString(value) || isNumber(value) ||\r\n isBoolean(value, 'strict') || value === null);\r\n}\r\n\r\n/**\r\n * \r\n * @param date \r\n * @returns {string}\r\n * exmaple:\r\n * toDateString('2018-01-01') = '2018-01-01'\r\n * toDateString('2018-01-30T00:00:00.000Z') = '2018-01-30'\r\n */\r\nexport const toIsoString = (date: Date) => {\r\n const day = date.getDate();\r\n const month = date.getMonth() + 1;\r\n const year = date.getFullYear();\r\n return `${year}-${month < 10 ? '0' + month : month}-${day < 10 ? '0' + day : day}`;\r\n}\r\n\r\n/**\r\n * 'toJavaScriptType' function\r\n *\r\n * Converts an input (probably string) value to a JavaScript primitive type -\r\n * 'string', 'number', 'boolean', or 'null' - before storing in a JSON object.\r\n *\r\n * Does not coerce values (other than null), and only converts the types\r\n * of values that would otherwise be valid.\r\n *\r\n * If the optional third parameter 'strictIntegers' is TRUE, and the\r\n * JSON Schema type 'integer' is specified, it also verifies the input value\r\n * is an integer and, if it is, returns it as a JaveScript number.\r\n * If 'strictIntegers' is FALSE (or not set) the type 'integer' is treated\r\n * exactly the same as 'number', and allows decimals.\r\n *\r\n * Valid Examples:\r\n * toJavaScriptType('10', 'number' ) = 10 // '10' is a number\r\n * toJavaScriptType('10', 'integer') = 10 // '10' is also an integer\r\n * toJavaScriptType( 10, 'integer') = 10 // 10 is still an integer\r\n * toJavaScriptType( 10, 'string' ) = '10' // 10 can be made into a string\r\n * toJavaScriptType('10.5', 'number' ) = 10.5 // '10.5' is a number\r\n *\r\n * Invalid Examples:\r\n * toJavaScriptType('10.5', 'integer') = null // '10.5' is not an integer\r\n * toJavaScriptType( 10.5, 'integer') = null // 10.5 is still not an integer\r\n *\r\n * // { PrimitiveValue } value - value to convert\r\n * // { SchemaPrimitiveType | SchemaPrimitiveType[] } types - types to convert to\r\n * // { boolean = false } strictIntegers - if FALSE, treat integers as numbers\r\n * // { PrimitiveValue }\r\n */\r\nexport function toJavaScriptType(value, types, strictIntegers = true) {\r\n if (!isDefined(value)) { return null; }\r\n if (isString(types)) { types = [types]; }\r\n if (strictIntegers && inArray('integer', types)) {\r\n if (isInteger(value, 'strict')) { return value; }\r\n if (isInteger(value)) { return parseInt(value, 10); }\r\n }\r\n if (inArray('number', types) || (!strictIntegers && inArray('integer', types))) {\r\n if (isNumber(value, 'strict')) { return value; }\r\n if (isNumber(value)) { return parseFloat(value); }\r\n }\r\n if (inArray('string', types)) {\r\n if (isString(value)) { return value; }\r\n // If value is a date, and types includes 'string',\r\n // convert the date to a string\r\n if (isDate(value)) { return toIsoString(value); }\r\n if (isNumber(value)) { return value.toString(); }\r\n }\r\n // If value is a date, and types includes 'integer' or 'number',\r\n // but not 'string', convert the date to a number\r\n if (isDate(value) && (inArray('integer', types) || inArray('number', types))) {\r\n return value.getTime();\r\n }\r\n if (inArray('boolean', types)) {\r\n if (isBoolean(value, true)) { return true; }\r\n if (isBoolean(value, false)) { return false; }\r\n }\r\n return null;\r\n}\r\n\r\n/**\r\n * 'toSchemaType' function\r\n *\r\n * Converts an input (probably string) value to the \"best\" JavaScript\r\n * equivalent available from an allowed list of JSON Schema types, which may\r\n * contain 'string', 'number', 'integer', 'boolean', and/or 'null'.\r\n * If necssary, it does progressively agressive type coersion.\r\n * It will not return null unless null is in the list of allowed types.\r\n *\r\n * Number conversion examples:\r\n * toSchemaType('10', ['number','integer','string']) = 10 // integer\r\n * toSchemaType('10', ['number','string']) = 10 // number\r\n * toSchemaType('10', ['string']) = '10' // string\r\n * toSchemaType('10.5', ['number','integer','string']) = 10.5 // number\r\n * toSchemaType('10.5', ['integer','string']) = '10.5' // string\r\n * toSchemaType('10.5', ['integer']) = 10 // integer\r\n * toSchemaType(10.5, ['null','boolean','string']) = '10.5' // string\r\n * toSchemaType(10.5, ['null','boolean']) = true // boolean\r\n *\r\n * String conversion examples:\r\n * toSchemaType('1.5x', ['boolean','number','integer','string']) = '1.5x' // string\r\n * toSchemaType('1.5x', ['boolean','number','integer']) = '1.5' // number\r\n * toSchemaType('1.5x', ['boolean','integer']) = '1' // integer\r\n * toSchemaType('1.5x', ['boolean']) = true // boolean\r\n * toSchemaType('xyz', ['number','integer','boolean','null']) = true // boolean\r\n * toSchemaType('xyz', ['number','integer','null']) = null // null\r\n * toSchemaType('xyz', ['number','integer']) = 0 // number\r\n *\r\n * Boolean conversion examples:\r\n * toSchemaType('1', ['integer','number','string','boolean']) = 1 // integer\r\n * toSchemaType('1', ['number','string','boolean']) = 1 // number\r\n * toSchemaType('1', ['string','boolean']) = '1' // string\r\n * toSchemaType('1', ['boolean']) = true // boolean\r\n * toSchemaType('true', ['number','string','boolean']) = 'true' // string\r\n * toSchemaType('true', ['boolean']) = true // boolean\r\n * toSchemaType('true', ['number']) = 0 // number\r\n * toSchemaType(true, ['number','string','boolean']) = true // boolean\r\n * toSchemaType(true, ['number','string']) = 'true' // string\r\n * toSchemaType(true, ['number']) = 1 // number\r\n *\r\n * // { PrimitiveValue } value - value to convert\r\n * // { SchemaPrimitiveType | SchemaPrimitiveType[] } types - allowed types to convert to\r\n * // { PrimitiveValue }\r\n */\r\nexport function toSchemaType(value, types) {\r\n if (!isArray(<SchemaPrimitiveType>types)) {\r\n types = <SchemaPrimitiveType[]>[types];\r\n }\r\n if ((<SchemaPrimitiveType[]>types).includes('null') && !hasValue(value)) {\r\n return null;\r\n }\r\n if ((<SchemaPrimitiveType[]>types).includes('boolean') && !isBoolean(value, 'strict')) {\r\n return value;\r\n }\r\n if ((<SchemaPrimitiveType[]>types).includes('integer')) {\r\n const testValue = toJavaScriptType(value, 'integer');\r\n if (testValue !== null) { return +testValue; }\r\n }\r\n if ((<SchemaPrimitiveType[]>types).includes('number')) {\r\n const testValue = toJavaScriptType(value, 'number');\r\n if (testValue !== null) { return +testValue; }\r\n }\r\n if (\r\n (isString(value) || isNumber(value, 'strict')) &&\r\n (<SchemaPrimitiveType[]>types).includes('string')\r\n ) { // Convert number to string\r\n return toJavaScriptType(value, 'string');\r\n }\r\n if ((<SchemaPrimitiveType[]>types).includes('boolean') && isBoolean(value)) {\r\n return toJavaScriptType(value, 'boolean');\r\n }\r\n if ((<SchemaPrimitiveType[]>types).includes('string')) { // Convert null & boolean to string\r\n if (value === null) { return ''; }\r\n const testValue = toJavaScriptType(value, 'string');\r\n if (testValue !== null) { return testValue; }\r\n }\r\n if ((\r\n (<SchemaPrimitiveType[]>types).includes('number') ||\r\n (<SchemaPrimitiveType[]>types).includes('integer'))\r\n ) {\r\n if (value === true) { return 1; } // Convert boolean & null to number\r\n if (value === false || value === null || value === '') { return 0; }\r\n }\r\n if ((<SchemaPrimitiveType[]>types).includes('number')) { // Convert mixed string to number\r\n const testValue = parseFloat(<string>value);\r\n if (!!testValue) { return testValue; }\r\n }\r\n if ((<SchemaPrimitiveType[]>types).includes('integer')) { // Convert string or number to integer\r\n const testValue = parseInt(<string>value, 10);\r\n if (!!testValue) { return testValue; }\r\n }\r\n if ((<SchemaPrimitiveType[]>types).includes('boolean')) { // Convert anything to boolean\r\n return !!value;\r\n }\r\n if ((\r\n (<SchemaPrimitiveType[]>types).includes('number') ||\r\n (<SchemaPrimitiveType[]>types).includes('integer')\r\n ) && !(<SchemaPrimitiveType[]>types).includes('null')\r\n ) {\r\n return 0; // If null not allowed, return 0 for non-convertable values\r\n }\r\n}\r\n\r\n/**\r\n * 'isPromise' function\r\n *\r\n * // object\r\n * // { boolean }\r\n */\r\nexport function isPromise(object): object is Promise<any> {\r\n return !!object && typeof object.then === 'function';\r\n}\r\n\r\n/**\r\n * 'isObservable' function\r\n *\r\n * // object\r\n * // { boolean }\r\n */\r\nexport function isObservable(object): object is Observable<any> {\r\n return !!object && typeof object.subscribe === 'function';\r\n}\r\n\r\n/**\r\n * '_toPromise' function\r\n *\r\n * // { object } object\r\n * // { Promise<any> }\r\n */\r\nexport function _toPromise(object): Promise<any> {\r\n return isPromise(object) ? object : object.toPromise();\r\n}\r\n\r\n/**\r\n * 'toObservable' function\r\n *\r\n * // { object } object\r\n * // { Observable<any> }\r\n */\r\nexport function toObservable(object): Observable<any> {\r\n const observable = isPromise(object) ? from(object) : object;\r\n if (isObservable(observable)) { return observable; }\r\n console.error('toObservable error: Expected validator to return Promise or Observable.');\r\n return new Observable();\r\n}\r\n\r\n/**\r\n * 'inArray' function\r\n *\r\n * Searches an array for an item, or one of a list of items, and returns true\r\n * as soon as a match is found, or false if no match.\r\n *\r\n * If the optional third parameter allIn is set to TRUE, and the item to find\r\n * is an array, then the function returns true only if all elements from item\r\n * are found in the array list, and false if any element is not found. If the\r\n * item to find is not an array, setting allIn to TRUE has no effect.\r\n *\r\n * // { any|any[] } item - the item to search for\r\n * // array - the array to search\r\n * // { boolean = false } allIn - if TRUE, all items must be in array\r\n * // { boolean } - true if item(s) in array, false otherwise\r\n */\r\nexport function inArray(item, array, allIn = false) {\r\n if (!isDefined(item) || !isArray(array)) { return false; }\r\n return isArray(item) ?\r\n item[allIn ? 'every' : 'some'](subItem => array.includes(subItem)) :\r\n array.includes(item);\r\n}\r\n\r\n/**\r\n * 'xor' utility function - exclusive or\r\n *\r\n * Returns true if exactly one of two values is truthy.\r\n *\r\n * // value1 - first value to check\r\n * // value2 - second value to check\r\n * // { boolean } - true if exactly one input value is truthy, false if not\r\n */\r\nexport function xor(value1, value2) {\r\n return (!!value1 && !value2) || (!value1 && !!value2);\r\n}\r\n","import { isNil, some } from 'lodash';\r\nimport { hasValue, inArray, isArray, isDefined, isEmpty, isMap, isObject, isSet, isString, PlainObject } from './validator.functions';\r\n\r\n/**\r\n * Utility function library:\r\n *\r\n * addClasses, copy, forEach, forEachCopy, hasOwn, mergeFilteredObject,\r\n * uniqueItems, commonItems, fixTitle, toTitleCase\r\n*/\r\n\r\n/**\r\n * 'addClasses' function\r\n *\r\n * Merges two space-delimited lists of CSS classes and removes duplicates.\r\n *\r\n * // {string | string[] | Set<string>} oldClasses\r\n * // {string | string[] | Set<string>} newClasses\r\n * // {string | string[] | Set<string>} - Combined classes\r\n */\r\nexport function addClasses(\r\n oldClasses: string | string[] | Set<string>,\r\n newClasses: string | string[] | Set<string>\r\n): string | string[] | Set<string> {\r\n const badType = i => !isSet(i) && !isArray(i) && !isString(i);\r\n if (badType(newClasses)) { return oldClasses; }\r\n if (badType(oldClasses)) { oldClasses = ''; }\r\n const toSet = i => isSet(i) ? i : isArray(i) ? new Set(i) : new Set(i.split(' '));\r\n const combinedSet: Set<any> = toSet(oldClasses);\r\n const newSet: Set<any> = toSet(newClasses);\r\n newSet.forEach(c => combinedSet.add(c));\r\n if (isSet(oldClasses)) { return combinedSet; }\r\n if (isArray(oldClasses)) { return Array.from(combinedSet); }\r\n return Array.from(combinedSet).join(' ');\r\n}\r\n\r\n/**\r\n * 'copy' function\r\n *\r\n * Makes a shallow copy of a JavaScript object, array, Map, or Set.\r\n * If passed a JavaScript primitive value (string, number, boolean, or null),\r\n * it returns the value.\r\n *\r\n * // {Object|Array|string|number|boolean|null} object - The object to copy\r\n * // {boolean = false} errors - Show errors?\r\n * // {Object|Array|string|number|boolean|null} - The copied object\r\n */\r\nexport function copy(object: any, errors = false): any {\r\n if (typeof object !== 'object' || object === null) { return object; }\r\n if (isMap(object)) { return new Map(object); }\r\n if (isSet(object)) { return new Set(object); }\r\n if (isArray(object)) { return [ ...object ]; }\r\n if (isObject(object)) { return { ...object }; }\r\n if (errors) {\r\n console.error('copy error: Object to copy must be a JavaScript object or value.');\r\n }\r\n return object;\r\n}\r\n\r\n/**\r\n * 'forEach' function\r\n *\r\n * Iterates over all items in the first level of an object or array\r\n * and calls an iterator funciton on each item.\r\n *\r\n * The iterator function is called with four values:\r\n * 1. The current item's value\r\n * 2. The current item's key\r\n * 3. The parent object, which contains the current item\r\n * 4. The root object\r\n *\r\n * Setting the optional third parameter to 'top-down' or 'bottom-up' will cause\r\n * it to also recursively iterate over items in sub-objects or sub-arrays in the\r\n * specified direction.\r\n *\r\n * // {Object|Array} object - The object or array to iterate over\r\n * // {function} fn - the iterator funciton to call on each item\r\n * // {boolean = false} errors - Show errors?\r\n * // {void}\r\n */\r\nexport function forEach(\r\n object: any, fn: (v: any, k?: string | number, c?: any, rc?: any) => any,\r\n recurse: boolean | string = false, rootObject: any = object, errors = false\r\n): void {\r\n if (isEmpty(object)) { return; }\r\n if ((isObject(object) || isArray(object)) && typeof fn === 'function') {\r\n for (const key of Object.keys(object)) {\r\n const value = object[key];\r\n if (recurse === 'bottom-up' && (isObject(value) || isArray(value))) {\r\n forEach(value, fn, recurse, rootObject);\r\n }\r\n fn(value, key, object, rootObject);\r\n if (recurse === 'top-down' && (isObject(value) || isArray(value))) {\r\n forEach(value, fn, recurse, rootObject);\r\n }\r\n }\r\n }\r\n if (errors) {\r\n if (typeof fn !== 'function') {\r\n console.error('forEach error: Iterator must be a function.');\r\n console.error('function', fn);\r\n }\r\n if (!isObject(object) && !isArray(object)) {\r\n console.error('forEach error: Input object must be an object or array.');\r\n console.error('object', object);\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * 'forEachCopy' function\r\n *\r\n * Iterates over all items in the first level of an object or array\r\n * and calls an iterator function on each item. Returns a new object or array\r\n * with the same keys or indexes as the original, and values set to the results\r\n * of the iterator function.\r\n *\r\n * Does NOT recursively iterate over items in sub-objects or sub-arrays.\r\n *\r\n * // {Object | Array} object - The object or array to iterate over\r\n * // {function} fn - The iterator funciton to call on each item\r\n * // {boolean = false} errors - Show errors?\r\n * // {Object | Array} - The resulting object or array\r\n */\r\nexport function forEachCopy(\r\n object: any, fn: (v: any, k?: string | number, o?: any, p?: string) => any,\r\n errors = false\r\n): any {\r\n if (!hasValue(object)) { return; }\r\n if ((isObject(object) || isArray(object)) && typeof object !== 'function') {\r\n const newObject: any = isArray(object) ? [] : {};\r\n for (const key of Object.keys(object)) {\r\n newObject[key] = fn(object[key], key, object);\r\n }\r\n return newObject;\r\n }\r\n if (errors) {\r\n if (typeof fn !== 'function') {\r\n console.error('forEachCopy error: Iterator must be a function.');\r\n console.error('function', fn);\r\n }\r\n if (!isObject(object) && !isArray(object)) {\r\n console.error('forEachCopy error: Input object must be an object or array.');\r\n console.error('object', object);\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * 'hasOwn' utility function\r\n *\r\n * Checks whether an object or array has a particular property.\r\n *\r\n * // {any} object - the object to check\r\n * // {string} property - the property to look for\r\n * // {boolean} - true if object has property, false if not\r\n */\r\nexport function hasOwn(object: any, property: string): boolean {\r\n if (!object || !['number', 'string', 'symbol'].includes(typeof property) ||\r\n (!isObject(object) && !isArray(object) && !isMap(object) && !isSet(object))\r\n ) { return false; }\r\n if (isMap(object) || isSet(object)) { return object.has(property); }\r\n if (typeof property === 'number') {\r\n if (isArray(object)) { return object[<number>property]; }\r\n property = property + '';\r\n }\r\n return object.hasOwnProperty(property);\r\n}\r\n\r\n/**\r\n * Types of possible expressions which the app is able to evaluate.\r\n */\r\nexport enum ExpressionType {\r\n EQUALS,\r\n NOT_EQUALS,\r\n NOT_AN_EXPRESSION\r\n}\r\n\r\n/**\r\n * Detects the type of expression from the given candidate. `==` for equals,\r\n * `!=` for not equals. If none of these are contained in the candidate, the candidate\r\n * is not considered to be an expression at all and thus `NOT_AN_EXPRESSION` is returned.\r\n * // {expressionCandidate} expressionCandidate - potential expression\r\n */\r\nexport function getExpressionType(expressionCandidate: string): ExpressionType {\r\n if (expressionCandidate.indexOf('==') !== -1) {\r\n return ExpressionType.EQUALS;\r\n }\r\n\r\n if (expressionCandidate.toString().indexOf('!=') !== -1) {\r\n return ExpressionType.NOT_EQUALS;\r\n }\r\n\r\n return ExpressionType.NOT_AN_EXPRESSION;\r\n}\r\n\r\nexport function isEqual(expressionType) {\r\n return expressionType as ExpressionType === ExpressionType.EQUALS;\r\n}\r\n\r\nexport function isNotEqual(expressionType) {\r\n return expressionType as ExpressionType === ExpressionType.NOT_EQUALS;\r\n}\r\n\r\nexport function isNotExpression(expressionType) {\r\n return expressionType as ExpressionType === ExpressionType.NOT_AN_EXPRESSION;\r\n}\r\n\r\n/**\r\n * Splits the expression key by the expressionType on a pair of values\r\n * before and after the equals or nor equals sign.\r\n * // {expressionType} enum of an expression type\r\n * // {key} the given key from a for loop iver all conditions\r\n */\r\nexport function getKeyAndValueByExpressionType(expressionType: ExpressionType, key: string) {\r\n if (isEqual(expressionType)) {\r\n return key.split('==', 2);\r\n }\r\n\r\n if (isNotEqual(expressionType)) {\r\n return key.split('!=', 2);\r\n }\r\n\r\n return null;\r\n}\r\n\r\nexport function cleanValueOfQuotes(keyAndValue): String {\r\n if (keyAndValue.charAt(0) === '\\'' && keyAndValue.charAt(keyAndValue.length - 1) === '\\'') {\r\n return keyAndValue.replace('\\'', '').replace('\\'', '');\r\n }\r\n return keyAndValue;\r\n}\r\n\r\n/**\r\n * 'mergeFilteredObject' utility function\r\n *\r\n * Shallowly merges two objects, setting key and values from source object\r\n * in target object, excluding specified keys.\r\n *\r\n * Optionally, it can also use functions to transform the key names and/or\r\n * the values of the merging object.\r\n *\r\n * // {PlainObject} targetObject - Target object to add keys and values to\r\n * // {PlainObject} sourceObject - Source object to copy keys and values from\r\n * // {string[]} excludeKeys - Array of keys to exclude\r\n * // {(string: string) => string = (k) => k} keyFn - Function to apply to keys\r\n * // {(any: any) => any = (v) => v} valueFn - Function to apply to values\r\n * // {PlainObject} - Returns targetObject\r\n */\r\nexport function mergeFilteredObject(\r\n targetObject: PlainObject,\r\n sourceObject: PlainObject,\r\n excludeKeys = <string[]>[],\r\n keyFn = (key: string): string => key,\r\n valFn = (val: any): any => val\r\n): PlainObject {\r\n if (!isObject(sourceObject)) { return targetObject; }\r\n if (!isObject(targetObject)) { targetObject = {}; }\r\n for (const key of Object.keys(sourceObject)) {\r\n if (!inArray(key, excludeKeys) && isDefined(sourceObject[key])) {\r\n targetObject[keyFn(key)] = valFn(sourceObject[key]);\r\n }\r\n }\r\n return targetObject;\r\n}\r\n\r\n/**\r\n * 'uniqueItems' function\r\n *\r\n * Accepts any number of string value inputs,\r\n * and returns an array of all input vaues, excluding duplicates.\r\n *\r\n * // {...string} ...items -\r\n * // {string[]} -\r\n */\r\nexport function uniqueItems(...items): string[] {\r\n const returnItems = [];\r\n for (const item of items) {\r\n if (!returnItems.includes(item)) { returnItems.push(item); }\r\n }\r\n return returnItems;\r\n}\r\n\r\n/**\r\n * 'commonItems' function\r\n *\r\n * Accepts any number of strings or arrays of string values,\r\n * and returns a single array containing only values present in all inputs.\r\n *\r\n * // {...string|string[]} ...arrays -\r\n * // {string[]} -\r\n */\r\nexport function commonItems(...arrays): string[] {\r\n let returnItems = null;\r\n for (let array of arrays) {\r\n if (isString(array)) { array = [array]; }\r\n returnItems = returnItems === null ? [ ...array ] :\r\n returnItems.filter(item => array.includes(item));\r\n if (!returnItems.length) { return []; }\r\n }\r\n return returnItems;\r\n}\r\n\r\n/**\r\n * 'fixTitle' function\r\n *\r\n *\r\n * // {string} input -\r\n * // {string} -\r\n */\r\nexport function fixTitle(name: string): string {\r\n return name && toTitleCase(name.replace(/([a-z])([A-Z])/g, '$1 $2').replace(/_/g, ' '));\r\n}\r\n\r\n/**\r\n * 'toTitleCase' function\r\n *\r\n * Intelligently converts an input string to Title Case.\r\n *\r\n * Accepts an optional second parameter with a list of additional\r\n * words and abbreviations to force into a particular case.\r\n *\r\n * This function is built on prior work by John Gruber and David Gouch:\r\n * http://daringfireball.net/2008/08/title_case_update\r\n * https://github.com/gouch/to-title-case\r\n *\r\n * // {string} input -\r\n * // {string|string[]} forceWords? -\r\n * // {string} -\r\n */\r\nexport function toTitleCase(input: string, forceWords?: string|string[]): string {\r\n if (!isString(input)) { return input; }\r\n let forceArray: string[] = ['a', 'an', 'and', 'as', 'at', 'but', 'by', 'en',\r\n 'for', 'if', 'in', 'nor', 'of', 'on', 'or', 'per', 'the', 'to', 'v', 'v.',\r\n 'vs', 'vs.', 'via'];\r\n if (isString(forceWords)) { forceWords = (<string>forceWords).split('|'); }\r\n if (isArray(forceWords)) { forceArray = forceArray.concat(forceWords); }\r\n const forceArrayLower: string[] = forceArray.map(w => w.toLowerCase());\r\n const noInitialCase: boolean =\r\n input === input.toUpperCase() || input === input.toLowerCase();\r\n let prevLastChar = '';\r\n input = input.trim();\r\n return input.replace(/[A-Za-z0-9\\u00C0-\\u00FF]+[^\\s-]*/g, (word, idx) => {\r\n if (!noInitialCase && word.slice(1).search(/[A-Z]|\\../) !== -1) {\r\n return word;\r\n } else {\r\n let newWord: string;\r\n const forceWord: string =\r\n forceArray[forceArrayLower.indexOf(word.toLowerCase())];\r\n if (!forceWord) {\r\n if (noInitialCase) {\r\n if (word.slice(1).search(/\\../) !== -1) {\r\n newWord = word.toLowerCase();\r\n } else {\r\n newWord = word[0].toUpperCase() + word.slice(1).toLowerCase();\r\n }\r\n } else {\r\n newWord = word[0].toUpperCase() + word.slice(1);\r\n }\r\n } else if (\r\n forceWord === forceWord.toLowerCase() && (\r\n idx === 0 || idx + word.length === input.length ||\r\n prevLastChar === ':' || input[idx - 1].search(/[^\\s-]/) !== -1 ||\r\n (input[idx - 1] !== '-' && input[idx + word.length] === '-')\r\n )\r\n ) {\r\n newWord = forceWord[0].toUpperCase() + forceWord.slice(1);\r\n } else {\r\n newWord = forceWord;\r\n }\r\n prevLastChar = word.slice(-1);\r\n return newWord;\r\n }\r\n });\r\n}\r\n\r\n\r\n/**\r\n * Recursively checks if at least one property of the given object (including nested objects)\r\n * has a non-null and non-undefined value.\r\n *\r\n * @param obj - The object to check.\r\n * @returns `true` if at least one property has a non-null and non-undefined value, otherwise `false`.\r\n *\r\n * @example\r\n * const testObj = { a: null, b: { b1: null, b2: undefined } };\r\n * console.log(hasNonNullValue(testObj)); // Output: false\r\n * \r\n * const testObj2 = { a: 1, b: { b1: null, b2: undefined } };\r\n * console.log(hasNonNullValue(testObj2)); // Output: true\r\n */\r\nexport function hasNonNullValue(obj: Record<string, any>): boolean {\r\n // If the object is null or not an object, return false immediately\r\n if (obj === null || typeof obj !== 'object') {\r\n return false;\r\n }\r\n\r\n // _.some checks if at least one element passes the given condition.\r\n return some(obj, (value: any): boolean => {\r\n // If value is an object, recurse deeper into the object.\r\n if (isObject(value)) {\r\n return hasNonNullValue(value);\r\n }\r\n // Check if value is neither null nor undefined.\r\n return !isNil(value);\r\n });\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport {\r\n cleanValueOfQuotes,\r\n copy,\r\n ExpressionType,\r\n getExpressionType,\r\n getKeyAndValueByExpressionType,\r\n hasOwn,\r\n isEqual,\r\n isNotEqual,\r\n isNotExpression\r\n} from './utility.functions';\r\nimport { isArray, isDefined, isEmpty, isMap, isNumber, isObject, isString } from './validator.functions';\r\n\r\n/**\r\n * 'JsonPointer' class\r\n *\r\n * Some utilities for using JSON Pointers with JSON objects\r\n * https://tools.ietf.org/html/rfc6901\r\n *\r\n * get, getCopy, getFirst, set, setCopy, insert, insertCopy, remove, has, dict,\r\n * forEachDeep, forEachDeepCopy, escape, unescape, parse, compile, toKey,\r\n * isJsonPointer, isSubPointer, toIndexedPointer, toGenericPointer,\r\n * toControlPointer, toSchemaPointer, toDataPointer, parseObjectPath\r\n *\r\n * Some functions based on manuelstofer's json-pointer utilities\r\n * https://github.com/manuelstofer/json-pointer\r\n */\r\nexport type Pointer = string | string[];\r\n\r\n@Injectable()\r\nexport class JsonPointer {\r\n\r\n /**\r\n * 'get' function\r\n *\r\n * Uses a JSON Pointer to retrieve a value from an object.\r\n *\r\n * // { object } object - Object to get value from\r\n * // { Pointer } pointer - JSON Pointer (string or array)\r\n * // { number = 0 } startSlice - Zero-based index of first Pointer key to use\r\n * // { number } endSlice - Zero-based index of last Pointer key to use\r\n * // { boolean = false } getBoolean - Return only true or false?\r\n * // { boolean = false } errors - Show error if not found?\r\n * // { object } - Located value (or true or false if getBoolean = true)\r\n */\r\n static get(\r\n object, pointer, startSlice = 0, endSlice: number = null,\r\n getBoolean = false, errors = false\r\n ) {\r\n if (object === null) { return getBoolean ? false : undefined; }\r\n let keyArray: any[] = this.parse(pointer, errors);\r\n if (typeof object === 'object' && keyArray !== null) {\r\n let subObject = object;\r\n if (startSlice >= keyArray.length || endSlice <= -keyArray.length) { return object; }\r\n if (startSlice <= -keyArray.length) { startSlice = 0; }\r\n if (!isDefined(endSlice) || endSlice >= keyArray.length) { endSlice = keyArray.length; }\r\n keyArray = keyArray.slice(startSlice, endSlice);\r\n for (let key of keyArray) {\r\n if (key === '-' && isArray(subObject) && subObject.length) {\r\n key = subObject.length - 1;\r\n }\r\n if (isMap(subObject) && subObject.has(key)) {\r\n subObject = subObject.get(key);\r\n } else if (typeof subObject === 'object' && subObject !== null &&\r\n hasOwn(subObject, key)\r\n ) {\r\n subObject = subObject[key];\r\n } else {\r\n const evaluatedExpression = JsonPointer.evaluateExpression(subObject, key);\r\n if (evaluatedExpression.passed) {\r\n subObject = evaluatedExpression.key ? subObject[evaluatedExpression.key] : subObject;\r\n } else {\r\n this.logErrors(errors, key, pointer, object);\r\n return getBoolean ? false : undefined;\r\n }\r\n }\r\n }\r\n return getBoolean ? true : subObject;\r\n }\r\n if (errors && keyArray === null) {\r\n console.error(`get error: Invalid JSON Pointer: ${pointer}`);\r\n }\r\n if (errors && typeof object !== 'object') {\r\n console.error('get error: Invalid object:');\r\n console.error(object);\r\n }\r\n return getBoolean ? false : undefined;\r\n }\r\n\r\n private static logErrors(errors, key, pointer, object) {\r\n if (errors) {\r\n console.error(`get error: \"${key}\" key not found in object.`);\r\n console.error(pointer);\r\n console.error(object);\r\n }\r\n }\r\n\r\n /**\r\n * Evaluates conditional expression in form of `model.<property>==<value>` or\r\n * `model.<property>!=<value>` where the first one means that the value must match to be\r\n * shown in a form, while the former shows the property only when the property value is not\r\n * set, or does not equal the given value.\r\n *\r\n * // { subObject } subObject - an object containing the data values of properties\r\n * // { key } key - the key from the for loop in a form of `<property>==<value>`\r\n *\r\n * Returns the object with two properties. The property passed informs whether\r\n * the expression evaluated successfully and the property key returns either the same\r\n * key if it is not contained inside the subObject or the key of the property if it is contained.\r\n */\r\n static evaluateExpression(subObject: Object, key: any) {\r\n const defaultResult = {passed: false, key: key};\r\n const keysAndExpression = this.parseKeysAndExpression(key, subObject);\r\n if (!keysAndExpression) {\r\n return defaultResult;\r\n }\r\n\r\n const ownCheckResult = this.doOwnCheckResult(subObject, keysAndExpression);\r\n if (ownCheckResult) {\r\n return ownCheckResult;\r\n }\r\n\r\n const cleanedValue = cleanValueOfQuotes(keysAndExpression.keyAndValue[1]);\r\n\r\n const evaluatedResult = this.performExpressionOnValue(keysAndExpression, cleanedValue, subObject);\r\n if (evaluatedResult) {\r\n return evaluatedResult;\r\n }\r\n\r\n return defaultResult;\r\n }\r\n\r\n /**\r\n * Performs the actual evaluation on the given expression with given values and keys.\r\n * // { cleanedValue } cleanedValue - the given valued cleaned of quotes if it had any\r\n * // { subObject } subObject - the object with properties values\r\n * // { keysAndExpression } keysAndExpression - an object holding the expressions with\r\n */\r\n private static performExpressionOnValue(keysAndExpression: any, cleanedValue: String, subObject: Object) {\r\n const propertyByKey = subObject[keysAndExpression.keyAndValue[0]];\r\n if (this.doComparisonByExpressionType(keysAndExpression.expressionType, propertyByKey, cleanedValue)) {\r\n return {passed: true, key: keysAndExpression.keyAndValue[0]};\r\n }\r\n\r\n return null;\r\n }\r\n\r\n private static doComparisonByExpressionType(expressionType: ExpressionType, propertyByKey, cleanedValue: String): Boolean {\r\n if (isEqual(expressionType)) {\r\n return propertyByKey === cleanedValue;\r\n }\r\n if (isNotEqual(expressionType)) {\r\n return propertyByKey !== cleanedValue;\r\n }\r\n return false;\r\n }\r\n\r\n /**\r\n * Does the checks when the parsed key is actually no a property inside subObject.\r\n * That would mean that the equal comparison makes no sense and thus the negative result\r\n * is returned, and the not equal comparison is not necessary because it doesn't equal\r\n * obviously. Returns null when the given key is a real property inside the subObject.\r\n * // { subObject } subObject - the object with properties values\r\n * // { keysAndExpression } keysAndExpression - an object holding the expressions with\r\n * the associated keys.\r\n */\r\n private static doOwnCheckResult(subObject: Object, keysAndExpression) {\r\n let ownCheckResult = null;\r\n if (!hasOwn(subObject, keysAndExpression.keyAndValue[0])) {\r\n if (isEqual(keysAndExpression.expressionType)) {\r\n ownCheckResult = {passed: false, key: null};\r\n }\r\n if (isNotEqual(keysAndExpression.expressionType)) {\r\n ownCheckResult = {passed: true, key: null};\r\n }\r\n }\r\n return ownCheckResult;\r\n }\r\n\r\n /**\r\n * Does the basic checks and tries to parse an expression and a pair\r\n * of key and value.\r\n * // { key } key - the original for loop created value containing key and value in one string\r\n * // { subObject } subObject - the object with properties values\r\n */\r\n private static parseKeysAndExpression(key: string, subObject) {\r\n if (this.keyOrSubObjEmpty(key, subObject)) {\r\n return null;\r\n }\r\n const expressionType = getExpressionType(key.toString());\r\n if (isNotExpression(expressionType)) {\r\n return null;\r\n }\r\n const keyAndValue = getKeyAndValueByExpressionType(expressionType, key);\r\n if (!keyAndValue || !keyAndValue[0] || !keyAndValue[1]) {\r\n return null;\r\n }\r\n return {expressionType: expressionType, keyAndValue: keyAndValue};\r\n }\r\n\r\n private static keyOrSubObjEmpty(key: any, subObject: Object) {\r\n return !key || !subObject;\r\n }\r\n\r\n /**\r\n * 'getCopy' function\r\n *\r\n * Uses a JSON Pointer to deeply clone a value from an object.\r\n *\r\n * // { object } object - Object to get value from\r\n * // { Pointer } pointer - JSON Pointer (string or array)\r\n * // { number = 0 } startSlice - Zero-based index of first Pointer key to use\r\n * // { number } endSlice - Zero-based index of last Pointer key to use\r\n * // { boolean = false } getBoolean - Return only true or false?\r\n * // { boolean = false } errors - Show error if not found?\r\n * // { object } - Located value (or true or false if getBoolean = true)\r\n */\r\n static getCopy(\r\n object, pointer, startSlice = 0, endSlice: number = null,\r\n getBoolean = false, errors = false\r\n ) {\r\n const objectToCopy =\r\n this.get(object, pointer, startSlice, endSlice, getBoolean, errors);\r\n return this.forEachDeepCopy(objectToCopy);\r\n }\r\n\r\n /**\r\n * 'getFirst' function\r\n *\r\n * Takes an array of JSON Pointers and objects,\r\n * checks each object for a value specified by the pointer,\r\n * and returns the first value found.\r\n *\r\n * // { [object, pointer][] } items - Array of objects and pointers to check\r\n * // { any = null } defaultValue - Value to return if nothing found\r\n * // { boolean = false } getCopy - Return a copy instead?\r\n * // - First value found\r\n */\r\n static getFirst(items, defaultValue: any = null, getCopy = false) {\r\n if (isEmpty(items)) { return; }\r\n if (isArray(items)) {\r\n for (const item of items) {\r\n if (isEmpty(item)) { continue; }\r\n if (isArray(item) && item.length >= 2) {\r\n if (isEmpty(item[0]) || isEmpty(item[1])) { continue; }\r\n const value = getCopy ?\r\n this.getCopy(item[0], item[1]) :\r\n this.get(item[0], item[1]);\r\n if (value) { return value; }\r\n continue;\r\n }\r\n console.error('getFirst error: Input not in correct format.\\n' +\r\n 'Should be: [ [ object1, pointer1 ], [ object 2, pointer2 ], etc... ]');\r\n return;\r\n }\r\n return defaultValue;\r\n }\r\n if (isMap(items)) {\r\n for (const [object, pointer] of items) {\r\n if (object === null || !this.isJsonPointer(pointer)) { continue; }\r\n const value = getCopy ?\r\n this.getCopy(object, pointer) :\r\n this.get(object, pointer);\r\n if (value) { return value; }\r\n }\r\n return defaultValue;\r\n }\r\n console.error('getFirst error: Input not in correct format.\\n' +\r\n 'Should be: [ [ object1, pointer1 ], [ object 2, pointer2 ], etc... ]');\r\n return defaultValue;\r\n }\r\n\r\n /**\r\n * 'getFirstCopy' function\r\n *\r\n * Similar to getFirst, but always returns a copy.\r\n *\r\n * // { [object, pointer][] } items - Array of objects and pointers to check\r\n * // { any = null } defaultValue - Value to return if nothing found\r\n * // - Copy of first value found\r\n */\r\n static getFirstCopy(items, defaultValue: any = null) {\r\n const firstCopy = this.getFirst(items, defaultValue, true);\r\n return firstCopy;\r\n }\r\n\r\n /**\r\n * 'set' function\r\n *\r\n * Uses a JSON Pointer to set a value on an object.\r\n * Also creates any missing sub objects or arrays to contain that value.\r\n *\r\n * If the optional fourth parameter is TRUE and the inner-most container\r\n * is an array, the function will insert the value as a new item at the\r\n * specified location in the array, rather than overwriting the existing\r\n * value (if any) at that location.\r\n *\r\n * So set([1, 2, 3], '/1', 4) => [1, 4, 3]\r\n * and\r\n * So set([1, 2, 3], '/1', 4, true) => [1, 4, 2, 3]\r\n *\r\n * // { object } object - The object to set value in\r\n * // { Pointer } pointer - The JSON Pointer (string or array)\r\n * // value - The new value to set\r\n * // { boolean } insert - insert value?\r\n * // { object } - The original object, modified with the set value\r\n */\r\n static set(object, pointer, value, insert = false) {\r\n const keyArray = this.parse(pointer);\r\n if (keyArray !== null && keyArray.length) {\r\n let subObject = object;\r\n for (let i = 0; i < keyArray.length - 1; ++i) {\r\n let key = keyArray[i];\r\n if (key === '-' && isArray(subObject)) {\r\n key = subObject.length;\r\n }\r\n if (isMap(subObject) && subObject.has(key)) {\r\n subObject = subObject.get(key);\r\n } else {\r\n if (!hasOwn(subObject, key)) {\r\n subObject[key] = (keyArray[i + 1].match(/^(\\d+|-)$/)) ? [] : {};\r\n }\r\n subObject = subObject[key];\r\n }\r\n }\r\n const lastKey = keyArray[keyArray.length - 1];\r\n if (isArray(subObject) && lastKey === '-') {\r\n subObject.push(value);\r\n } else if (insert && isArray(subObject) && !isNaN(+lastKey)) {\r\n subObject.splice(lastKey, 0, value);\r\n } else if (isMap(subObject)) {\r\n subObject.set(lastKey, value);\r\n } else {\r\n subObject[lastKey] = value;\r\n }\r\n return object;\r\n }\r\n console.error(`set error: Invalid JSON Pointer: ${pointer}`);\r\n return object;\r\n }\r\n\r\n /**\r\n * 'setCopy' function\r\n *\r\n * Copies an object and uses a JSON Pointer to set a value on the copy.\r\n * Also creates any missing sub objects or arrays to contain that value.\r\n *\r\n * If the optional fourth parameter is TRUE and the inner-most container\r\n * is an array, the function will insert the value as a new item at the\r\n * specified location in the array, rather than overwriting the existing value.\r\n *\r\n * // { object } object - The object to copy and set value in\r\n * // { Pointer } pointer - The JSON Pointer (string or array)\r\n * // value - The value to set\r\n * // { boolean } insert - insert value?\r\n * // { object } - The new object with the set value\r\n */\r\n static setCopy(object, pointer, value, insert = false) {\r\n const keyArray = this.parse(pointer);\r\n if (keyArray !== null) {\r\n const newObject = copy(object);\r\n let subObject = newObject;\r\n for (let i = 0; i < keyArray.length - 1; ++i) {\r\n let key = keyArray[i];\r\n if (key === '-' && isArray(subObject)) {\r\n key = subObject.length;\r\n }\r\n if (isMap(subObject) && subObject.has(key)) {\r\n subObject.set(key, copy(subObject.get(key)));\r\n subObject = subObject.get(key);\r\n } else {\r\n if (!hasOwn(subObject, key)) {\r\n subObject[key] = (keyArray[i + 1].match(/^(\\d+|-)$/)) ? [] : {};\r\n }\r\n subObject[key] = copy(subObject[key]);\r\n subObject = subObject[key];\r\n }\r\n }\r\n const lastKey = keyArray[keyArray.length - 1];\r\n if (isArray(subObject) && lastKey === '-') {\r\n subObject.push(value);\r\n } else if (insert && isArray(subObject) && !isNaN(+lastKey)) {\r\n subObject.splice(lastKey, 0, value);\r\n } else if (isMap(subObject)) {\r\n subObject.set(lastKey, value);\r\n } else {\r\n subObject[lastKey] = value;\r\n }\r\n return newObject;\r\n }\r\n console.error(`setCopy error: Invalid JSON Pointer: ${pointer}`);\r\n return object;\r\n }\r\n\r\n /**\r\n * 'insert' function\r\n *\r\n * Calls 'set' with insert = TRUE\r\n *\r\n * // { object } object - object to insert value in\r\n * // { Pointer } pointer - JSON Pointer (string or array)\r\n * // value - value to insert\r\n * // { object }\r\n */\r\n static insert(object, pointer, value) {\r\n const updatedObject = this.set(object, pointer, value, true);\r\n return updatedObject;\r\n }\r\n\r\n /**\r\n * 'insertCopy' function\r\n *\r\n * Calls 'setCopy' with insert = TRUE\r\n *\r\n * // { object } object - object to insert value in\r\n * // { Pointer } pointer - JSON Pointer (string or array)\r\n * // value - value to insert\r\n * // { object }\r\n */\r\n static insertCopy(object, pointer, value) {\r\n const updatedObject = this.setCopy(object, pointer, value, true);\r\n return updatedObject;\r\n }\r\n\r\n /**\r\n * 'remove' function\r\n *\r\n * Uses a JSON Pointer to remove a key and its attribute from an object\r\n *\r\n * // { object } object - object to delete attribute from\r\n * // { Pointer } pointer - JSON Pointer (string or array)\r\n * // { object }\r\n */\r\n static remove(object, pointer) {\r\n const keyArray = this.parse(pointer);\r\n if (keyArray !== null && keyArray.length) {\r\n let lastKey = keyArray.pop();\r\n const parentObject = this.get(object, keyArray);\r\n if (isArray(parentObject)) {\r\n if (lastKey === '-') { lastKey = parentObject.length - 1; }\r\n parentObject.splice(lastKey, 1);\r\n } else if (isObject(parentObject)) {\r\n delete parentObject[lastKey];\r\n }\r\n return object;\r\n }\r\n console.error(`remove error: Invalid JSON Pointer: ${pointer}`);\r\n return object;\r\n }\r\n\r\n /**\r\n * 'has' function\r\n *\r\n * Tests if an object has a value at the location specified by a JSON Pointer\r\n *\r\n * // { object } object - object to chek for value\r\n * // { Pointer } pointer - JSON Pointer (string or array)\r\n * // { boolean }\r\n */\r\n static has(object, pointer) {\r\n const hasValue = this.get(object, pointer, 0, null, true);\r\n return hasValue;\r\n }\r\n\r\n /**\r\n * 'dict' function\r\n *\r\n * Returns a (pointer -> value) dictionary for an object\r\n *\r\n * // { object } object - The object to create a dictionary from\r\n * // { object } - The resulting dictionary object\r\n */\r\n static dict(object) {\r\n const results: any = {};\r\n this.forEachDeep(object, (value, pointer) => {\r\n if (typeof value !== 'object') { results[pointer] = value; }\r\n });\r\n return results;\r\n }\r\n\r\n /**\r\n * 'forEachDeep' function\r\n *\r\n * Iterates over own enumerable properties of an object or items in an array\r\n * and invokes an iteratee function for each key/value or index/value pair.\r\n * By default, iterates over items within objects and arrays after calling\r\n * the iteratee function on the containing object or array itself.\r\n *\r\n * The iteratee is invoked with three arguments: (value, pointer, rootObject),\r\n * where pointer is a JSON pointer indicating the location of the current\r\n * value within the root object, and rootObject is the root object initially\r\n * submitted to th function.\r\n *\r\n * If a third optional parameter 'bottomUp' is set to TRUE, the iterator\r\n * function will be called on sub-objects and arrays after being\r\n * called on their contents, rather than before, which is the default.\r\n *\r\n * This function can also optionally be called directly on a sub-object by\r\n * including optional 4th and 5th parameterss to specify the initial\r\n * root object and pointer.\r\n *\r\n * // { object } object - the initial object or array\r\n * // { (v: any, p?: string, o?: any) => any } function - iteratee function\r\n * // { boolean = false } bottomUp - optional, set to TRUE to reverse direction\r\n * // { object = object } rootObject - optional, root object or array\r\n * // { string = '' } pointer - optional, JSON Pointer to object within rootObject\r\n * // { object } - The modified object\r\n */\r\n static forEachDeep(\r\n object, fn: (v: any, p?: string, o?: any) => any = (v) => v,\r\n bottomUp = false, pointer = '', rootObject = object\r\n ) {\r\n if (typeof fn !== 'function') {\r\n console.error(`forEachDeep error: Iterator is not a function:`, fn);\r\n return;\r\n }\r\n if (!bottomUp) { fn(object, pointer, rootObject); }\r\n if (isObject(object) || isArray(object)) {\r\n for (const key of Object.keys(object)) {\r\n const newPointer = pointer + '/' + this.escape(key);\r\n this.forEachDeep(object[key], fn, bottomUp, newPointer, rootObject);\r\n }\r\n }\r\n if (bottomUp) { fn(object, pointer, rootObject); }\r\n }\r\n\r\n /**\r\n * 'forEachDeepCopy' function\r\n *\r\n * Similar to forEachDeep, but returns a copy of the original object, with\r\n * the same keys and indexes, but with values replaced with the result of\r\n * the iteratee function.\r\n *\r\n * // { object } object - the initial object or array\r\n * // { (v: any, k?: string, o?: any, p?: any) => any } function - iteratee function\r\n * // { boolean = false } bottomUp - optional, set to TRUE to reverse direction\r\n * // { object = object } rootObject - optional, root object or array\r\n * // { string = '' } pointer - optional, JSON Pointer to object within rootObject\r\n * // { object } - The copied object\r\n */\r\n static forEachDeepCopy(\r\n object, fn: (v: any, p?: string, o?: any) => any = (v) => v,\r\n bottomUp = false, pointer = '', rootObject = object\r\n ) {\r\n if (typeof fn !== 'function') {\r\n console.error(`forEachDeepCopy error: Iterator is not a function:`, fn);\r\n return null;\r\n }\r\n if (isObject(object) || isArray(object)) {\r\n let newObject = isArray(object) ? [ ...object ] : { ...object };\r\n if (!bottomUp) { newObject = fn(newObject, pointer, rootObject); }\r\n for (const key of Object.keys(newObject)) {\r\n const newPointer = pointer + '/' + this.escape(key);\r\n newObject[key] = this.forEachDeepCopy(\r\n newObject[key], fn, bottomUp, newPointer, rootObject\r\n );\r\n }\r\n if (bottomUp) { newObject = fn(newObject, pointer, rootObject); }\r\n return newObject;\r\n } else {\r\n return fn(object, pointer, rootObject);\r\n }\r\n }\r\n\r\n /**\r\n * 'escape' function\r\n *\r\n * Escapes a string reference key\r\n *\r\n * // { string } key - string key to escape\r\n * // { string } - escaped key\r\n */\r\n static escape(key) {\r\n const escaped = key.toString().replace(/~/g, '~0').replace(/\\//g, '~1');\r\n return escaped;\r\n }\r\n\r\n /**\r\n * 'unescape' function\r\n *\r\n * Unescapes a string reference key\r\n *\r\n * // { string } key - string key to unescape\r\n * // { string } - unescaped key\r\n */\r\n static unescape(key) {\r\n const unescaped = key.toString().replace(/~1/g, '/').replace(/~0/g, '~');\r\n return unescaped;\r\n }\r\n\r\n /**\r\n * 'parse' function\r\n *\r\n * Converts a string JSON Pointer into a array of keys\r\n * (if input is already an an array of keys, it is returned unchanged)\r\n *\r\n * // { Pointer } pointer - JSON Pointer (string or array)\r\n * // { boolean = false } errors - Show error if invalid pointer?\r\n * // { string[] } - JSON Pointer array of keys\r\n */\r\n static parse(pointer, errors = false) {\r\n if (!this.isJsonPointer(pointer)) {\r\n if (errors) { console.error(`parse error: Invalid JSON Pointer: ${pointer}`); }\r\n return null;\r\n }\r\n if (isArray(pointer)) { return <string[]>pointer; }\r\n if (typeof pointer === 'string') {\r\n if ((<string>pointer)[0] === '#') { pointer = pointer.slice(1); }\r\n if (<string>pointer === '' || <string>pointer === '/') { return []; }\r\n return (<string>pointer).slice(1).split('/').map(this.unescape);\r\n }\r\n }\r\n\r\n /**\r\n * 'compile' function\r\n *\r\n * Converts an array of keys into a JSON Pointer string\r\n * (if input is already a string, it is normalized and returned)\r\n *\r\n * The optional second parameter is a default which will replace any empty keys.\r\n *\r\n * // { Pointer } pointer - JSON Pointer (string or array)\r\n * // { string | number = '' } defaultValue - Default value\r\n * // { boolean = false } errors - Show error if invalid pointer?\r\n * // { string } - JSON Pointer string\r\n */\r\n static compile(pointer, defaultValue = '', errors = false) {\r\n if (pointer === '#') { return ''; }\r\n if (!this.isJsonPointer(pointer)) {\r\n if (errors) { console.error(`compile error: Invalid JSON Pointer: ${pointer}`); }\r\n return null;\r\n }\r\n if (isArray(pointer)) {\r\n if ((<string[]>pointer).length === 0) { return ''; }\r\n return '/' + (<string[]>pointer).map(\r\n key => key === '' ? defaultValue : this.escape(key)\r\n ).join('/');\r\n }\r\n if (typeof pointer === 'string') {\r\n if (pointer[0] === '#') { pointer = pointer.slice(1); }\r\n return pointer;\r\n }\r\n }\r\n\r\n /**\r\n * 'toKey' function\r\n *\r\n * Extracts name of the final key from a JSON Pointer.\r\n *\r\n * // { Pointer } pointer - JSON Pointer (string or array)\r\n * // { boolean = false } errors - Show error if invalid pointer?\r\n * // { string } - the extracted key\r\n */\r\n static toKey(pointer, errors = false) {\r\n const keyArray = this.parse(pointer, errors);\r\n if (keyArray === null) { return null; }\r\n if (!keyArray.length) { return ''; }\r\n return keyArray[keyArray.length - 1];\r\n }\r\n\r\n /**\r\n * 'isJsonPointer' function\r\n *\r\n * Checks a string or array value to determine if it is a valid JSON Pointer.\r\n * Returns true if a string is empty, or starts with '/' or '#/'.\r\n * Returns true if an array contains only string values.\r\n *\r\n * // value - value to check\r\n * // { boolean } - true if value is a valid JSON Pointer, otherwise false\r\n */\r\n static isJsonPointer(value) {\r\n if (isArray(value)) {\r\n return value.every(key => typeof key === 'string');\r\n } else if (isString(value)) {\r\n if (value === '' || value === '#') { return true; }\r\n if (value[0] === '/' || value.slice(0, 2) === '#/') {\r\n return !/(~[^01]|~$)/g.test(value);\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n /**\r\n * 'isSubPointer' function\r\n *\r\n * Checks whether one JSON Pointer is a subset of another.\r\n *\r\n * // { Pointer } shortPointer - potential subset JSON Pointer\r\n * // { Pointer } longPointer - potential superset JSON Pointer\r\n * // { boolean = false } trueIfMatching - return true if pointers match?\r\n * // { boolean = false } errors - Show error if invalid pointer?\r\n * // { boolean } - true if shortPointer is a subset of longPointer, false if not\r\n */\r\n static isSubPointer(\r\n shortPointer, longPointer, trueIfMatching = false, errors = false\r\n ) {\r\n if (!this.isJsonPointer(shortPointer) || !this.isJsonPointer(longPointer)) {\r\n if (errors) {\r\n let invalid = '';\r\n if (!this.isJsonPointer(shortPointer)) { invalid += ` 1: ${shortPointer}`; }\r\n if (!this.isJsonPointer(longPointer)) { invalid += ` 2: ${longPointer}`; }\r\n console.error(`isSubPointer error: Invalid JSON Pointer ${invalid}`);\r\n }\r\n return;\r\n }\r\n shortPointer = this.compile(shortPointer, '', errors);\r\n longPointer = this.compile(longPointer, '', errors);\r\n return shortPointer === longPointer ? trueIfMatching :\r\n `${shortPointer}/` === longPointer.slice(0, shortPointer.length + 1);\r\n }\r\n\r\n /**\r\n * 'toIndexedPointer' function\r\n *\r\n * Merges an array of numeric indexes and a generic pointer to create an\r\n * indexed pointer for a specific item.\r\n *\r\n * For example, merging the generic pointer '/foo/-/bar/-/baz' and\r\n * the array [4, 2] would result in the indexed pointer '/foo/4/bar/2/baz'\r\n *\r\n *\r\n * // { Pointer } genericPointer - The generic pointer\r\n * // { number[] } indexArray - The array of numeric indexes\r\n * // { Map<string, number> } arrayMap - An optional array map\r\n * // { string } - The merged pointer with indexes\r\n */\r\n static toIndexedPointer(\r\n genericPointer, indexArray, arrayMap: Map<string, number> = null\r\n ) {\r\n if (this.isJsonPointer(genericPointer) && isArray(indexArray)) {\r\n let indexedPointer = this.compile(genericPointer);\r\n if (isMap(arrayMap)) {\r\n let arrayIndex = 0;\r\n return indexedPointer.replace(/\\/\\-(?=\\/|$)/g, (key, stringIndex) =>\r\n arrayMap.has((<string>indexedPointer).slice(0, stringIndex)) ?\r\n '/' + indexArray[arrayIndex++] : key\r\n );\r\n } else {\r\n for (const pointerIndex of indexArray) {\r\n indexedPointer = indexedPointer.replace('/-', '/' + pointerIndex);\r\n }\r\n return indexedPointer;\r\n }\r\n }\r\n if (!this.isJsonPointer(genericPointer)) {\r\n console.error(`toIndexedPointer error: Invalid JSON Pointer: ${genericPointer}`);\r\n }\r\n if (!isArray(indexArray)) {\r\n console.error(`toIndexedPointer error: Invalid indexArray: ${indexArray}`);\r\n }\r\n }\r\n\r\n /**\r\n * 'toGenericPointer' function\r\n *\r\n * Compares an indexed pointer to an array map and removes list array\r\n * indexes (but leaves tuple arrray indexes and all object keys, including\r\n * numeric keys) to create a generic pointer.\r\n *\r\n * For example, using the indexed pointer '/foo/1/bar/2/baz/3' and\r\n * the arrayMap [['/foo', 0], ['/foo/-/bar', 3], ['/foo/-/bar/-/baz', 0]]\r\n * would result in the generic pointer '/foo/-/bar/2/baz/-'\r\n * Using the indexed pointer '/foo/1/bar/4/baz/3' and the same arrayMap\r\n * would result in the generic pointer '/foo/-/bar/-/baz/-'\r\n * (the bar array has 3 tuple items, so index 2 is retained, but 4 is removed)\r\n *\r\n * The structure of the arrayMap is: [['path to array', number of tuple items]...]\r\n *\r\n *\r\n * // { Pointer } indexedPointer - The indexed pointer (array or string)\r\n * // { Map<string, number> } arrayMap - The optional array map (for preserving tuple indexes)\r\n * // { string } - The generic pointer with indexes removed\r\n */\r\n static toGenericPointer(indexedPointer, arrayMap = new Map<string, number>()) {\r\n if (this.isJsonPointer(indexedPointer) && isMap(arrayMap)) {\r\n const pointerArray = this.parse(indexedPointer);\r\n for (let i = 1; i < pointerArray.length; i++) {\r\n const subPointer = this.compile(pointerArray.slice(0, i));\r\n if (arrayMap.has(subPointer) &&\r\n arrayMap.get(subPointer) <= +pointerArray[i]\r\n ) {\r\n pointerArray[i] = '-';\r\n }\r\n }\r\n return this.compile(pointerArray);\r\n }\r\n if (!this.isJsonPointer(indexedPointer)) {\r\n console.error(`toGenericPointer error: invalid JSON Pointer: ${indexedPointer}`);\r\n }\r\n if (!isMap(arrayMap)) {\r\n console.error(`toGenericPointer error: invalid arrayMap: ${arrayMap}`);\r\n }\r\n }\r\n\r\n /**\r\n * 'toControlPointer' function\r\n *\r\n * Accepts a JSON Pointer for a data object and returns a JSON Pointer for the\r\n * matching control in an Angular FormGroup.\r\n *\r\n * // { Pointer } dataPointer - JSON Pointer (string or array) to a data object\r\n * // { FormGroup } formGroup - Angular FormGroup to get value from\r\n * // { boolean = false } controlMustExist - Only return if control exists?\r\n * // { Pointer } - JSON Pointer (string) to the formGroup object\r\n */\r\n static toControlPointer(dataPointer, formGroup, controlMustExist = false) {\r\n const dataPointerArray = this.parse(dataPointer);\r\n const controlPointerArray: string[] = [];\r\n let subGroup = formGroup;\r\n if (dataPointerArray !== null) {\r\n for (const key of dataPointerArray) {\r\n if (hasOwn(subGroup, 'controls')) {\r\n controlPointerArray.push('controls');\r\n subGroup = subGroup.controls;\r\n }\r\n if (isArray(subGroup) && (key === '-')) {\r\n controlPointerArray.push((subGroup.length - 1).toString());\r\n subGroup = subGroup[subGroup.length - 1];\r\n } else if (hasOwn(subGroup, key)) {\r\n controlPointerArray.push(key);\r\n subGroup = subGroup[key];\r\n } else if (controlMustExist) {\r\n console.error(`toControlPointer error: Unable to find \"${key}\" item in FormGroup.`);\r\n console.error(dataPointer);\r\n console.error(formGroup);\r\n return;\r\n } else {\r\n controlPointerArray.push(key);\r\n subGroup = { controls: {} };\r\n }\r\n }\r\n return this.compile(controlPointerArray);\r\n }\r\n console.error(`toControlPointer error: Invalid JSON Pointer: ${dataPointer}`);\r\n }\r\n\r\n /**\r\n * 'toSchemaPointer' function\r\n *\r\n * Accepts a JSON Pointer to a value inside a data object and a JSON schema\r\n * for that object.\r\n *\r\n * Returns a Pointer to the sub-schema for the value inside the object's schema.\r\n *\r\n * // { Pointer } dataPointer - JSON Pointer (string or array) to an object\r\n * // schema - JSON schema for the object\r\n * // { Pointer } - JSON Pointer (string) to the object's schema\r\n */\r\n static toSchemaPointer(dataPointer, schema) {\r\n if (this.isJsonPointer(dataPointer) && typeof schema === 'object') {\r\n const pointerArray = this.parse(dataPointer);\r\n if (!pointerArray.length) { return ''; }\r\n const firstKey = pointerArray.shift();\r\n if (schema.type === 'object' || schema.properties || schema.additionalProperties) {\r\n if ((schema.properties || {})[firstKey]) {\r\n return `/properties/${this.escape(firstKey)}` +\r\n this.toSchemaPointer(pointerArray, schema.properties[firstKey]);\r\n } else if (schema.additionalProperties) {\r\n return '/additionalProperties' +\r\n this.toSchemaPointer(pointerArray, schema.additionalProperties);\r\n }\r\n }\r\n if ((schema.type === 'array' || schema.items) &&\r\n (isNumber(firstKey) || firstKey === '-' || firstKey === '')\r\n ) {\r\n const arrayItem = firstKey === '-' || firstKey === '' ? 0 : +firstKey;\r\n if (isArray(schema.items)) {\r\n if (arrayItem < schema.items.length) {\r\n return '/items/' + arrayItem +\r\n this.toSchemaPointer(pointerArray, schema.items[arrayItem]);\r\n } else if (schema.additionalItems) {\r\n return '/additionalItems' +\r\n this.toSchemaPointer(pointerArray, schema.additionalItems);\r\n }\r\n } else if (isObject(schema.items)) {\r\n return '/items' + this.toSchemaPointer(pointerArray, schema.items);\r\n } else if (isObject(schema.additionalItems)) {\r\n return '/additionalItems' +\r\n this.toSchemaPointer(pointerArray, schema.additionalItems);\r\n }\r\n }\r\n console.error(`toSchemaPointer error: Data pointer ${dataPointer} ` +\r\n `not compatible with schema ${schema}`);\r\n return null;\r\n }\r\n if (!this.isJsonPointer(dataPointer)) {\r\n console.error(`toSchemaPointer error: Invalid JSON Pointer: ${dataPointer}`);\r\n }\r\n if (typeof schema !== 'object') {\r\n console.error(`toSchemaPointer error: Invalid JSON Schema: ${schema}`);\r\n }\r\n return null;\r\n }\r\n\r\n /**\r\n * 'toDataPointer' function\r\n *\r\n * Accepts a JSON Pointer to a sub-schema inside a JSON schema and the schema.\r\n *\r\n * If possible, returns a generic Pointer to the corresponding value inside\r\n * the data object described by the JSON schema.\r\n *\r\n * Returns null if the sub-schema is in an ambiguous location (such as\r\n * definitions or additionalProperties) where the corresponding value\r\n * location cannot be determined.\r\n *\r\n * // { Pointer } schemaPointer - JSON Pointer (string or array) to a JSON schema\r\n * // schema - the JSON schema\r\n * // { boolean = false } errors - Show errors?\r\n * // { Pointer } - JSON Pointer (string) to the value in the data object\r\n */\r\n static toDataPointer(schemaPointer, schema, errors = false) {\r\n if (this.isJsonPointer(schemaPointer) && typeof schema === 'object' &&\r\n this.has(schema, schemaPointer)\r\n ) {\r\n const pointerArray = this.parse(schemaPointer);\r\n if (!pointerArray.length) { return ''; }\r\n const firstKey = pointerArray.shift();\r\n if (firstKey === 'properties' ||\r\n (firstKey === 'items' && isArray(schema.items))\r\n ) {\r\n const secondKey = pointerArray.shift();\r\n const pointerSuffix = this.toDataPointer(pointerArray, schema[firstKey][secondKey]);\r\n return pointerSuffix === null ? null : '/' + secondKey + pointerSuffix;\r\n } else if (firstKey === 'additionalItems' ||\r\n (firstKey === 'items' && isObject(schema.items))\r\n ) {\r\n const pointerSuffix = this.toDataPointer(pointerArray, schema[firstKey]);\r\n return pointerSuffix === null ? null : '/-' + pointerSuffix;\r\n } else if (['allOf', 'anyOf', 'oneOf'].includes(firstKey)) {\r\n const secondKey = pointerArray.shift();\r\n return this.toDataPointer(pointerArray, schema[firstKey][secondKey]);\r\n } else if (firstKey === 'not') {\r\n return this.toDataPointer(pointerArray, schema[firstKey]);\r\n } else if (['contains', 'definitions', 'dependencies', 'additionalItems',\r\n 'additionalProperties', 'patternProperties', 'propertyNames'].includes(firstKey)\r\n ) {\r\n if (errors) { console.error(`toDataPointer error: Ambiguous location`); }\r\n }\r\n return '';\r\n }\r\n if (errors) {\r\n if (!this.isJsonPointer(schemaPointer)) {\r\n console.error(`toDataPointer error: Invalid JSON Pointer: ${schemaPointer}`);\r\n }\r\n if (typeof schema !== 'object') {\r\n console.error(`toDataPointer error: Invalid JSON Schema: ${schema}`);\r\n }\r\n if (typeof schema !== 'object') {\r\n console.error(`toDataPointer error: Pointer ${schemaPointer} invalid for Schema: ${schema}`);\r\n }\r\n }\r\n return null;\r\n }\r\n\r\n /**\r\n * 'parseObjectPath' function\r\n *\r\n * Parses a JavaScript object path into an array of keys, which\r\n * can then be passed to compile() to convert into a string JSON Pointer.\r\n *\r\n * Based on mike-marcacci's excellent objectpath parse function:\r\n * https://github.com/mike-marcacci/objectpath\r\n *\r\n * // { Pointer } path - The object path to parse\r\n * // { string[] } - The resulting array of keys\r\n */\r\n static parseObjectPath(path) {\r\n if (isArray(path)) { return <string[]>path; }\r\n if (this.isJsonPointer(path)) { return this.parse(path); }\r\n if (typeof path === 'string') {\r\n let index = 0;\r\n const parts: string[] = [];\r\n while (index < path.length) {\r\n const nextDot = path.indexOf('.', index);\r\n const nextOB = path.indexOf('[', index); // next open bracket\r\n if (nextDot === -1 && nextOB === -1) { // last item\r\n parts.push(path.slice(index));\r\n index = path.length;\r\n } else if (nextDot !== -1 && (nextDot < nextOB || nextOB === -1)) { // dot notation\r\n parts.push(path.slice(index, nextDot));\r\n index = nextDot + 1;\r\n } else { // bracket notation\r\n if (nextOB > index) {\r\n parts.push(path.slice(index, nextOB));\r\n index = nextOB;\r\n }\r\n const quote = path.charAt(nextOB + 1);\r\n if (quote === '\"' || quote === '\\'') { // enclosing quotes\r\n let nextCB = path.indexOf(quote + ']', nextOB); // next close bracket\r\n while (nextCB !== -1 && path.charAt(nextCB - 1) === '\\\\') {\r\n nextCB = path.indexOf(quote + ']', nextCB + 2);\r\n }\r\n if (nextCB === -1) { nextCB = path.length; }\r\n parts.push(path.slice(index + 2, nextCB)\r\n .replace(new RegExp('\\\\' + quote, 'g'), quote));\r\n index = nextCB + 2;\r\n } else { // no enclosing quotes\r\n let nextCB = path.indexOf(']', nextOB); // next close bracket\r\n if (nextCB === -1) { nextCB = path.length; }\r\n parts.push(path.slice(index + 1, nextCB));\r\n index = nextCB + 1;\r\n }\r\n if (path.charAt(index) === '.') { index++; }\r\n }\r\n }\r\n return parts;\r\n }\r\n console.error('parseObjectPath error: Input object path must be a string.');\r\n }\r\n}\r\n","// updated from AJV fast format regular expressions:\r\n// https://github.com/epoberezkin/ajv/blob/master/lib/compile/formats.js\r\n\r\nexport const jsonSchemaFormatTests = {\r\n\r\n 'date': /^\\d\\d\\d\\d-[0-1]\\d-[0-3]\\d$/,\r\n\r\n 'time': /^[0-2]\\d:[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:z|[+-]\\d\\d:\\d\\d)?$/i,\r\n\r\n // Modified to allow incomplete entries, such as\r\n // \"2000-03-14T01:59:26.535\" (needs \"Z\") or \"2000-03-14T01:59\" (needs \":00Z\")\r\n 'date-time': /^\\d\\d\\d\\d-[0-1]\\d-[0-3]\\d[t\\s][0-2]\\d:[0-5]\\d(?::[0-5]\\d)?(?:\\.\\d+)?(?:z|[+-]\\d\\d:\\d\\d)?$/i,\r\n\r\n // \"2000-03-14T01:59:26.535\" (doesn't need \"Z\") or \"2000-03-14T01:59\" (needs \":00Z\")\r\n //'iso-date-time':^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(Z|([+-]\\d{2}:\\d{2}))?$\r\n //for now same as 'date-time' until better tested\r\n 'iso-date-time': /^\\d\\d\\d\\d-[0-1]\\d-[0-3]\\d[t\\s][0-2]\\d:[0-5]\\d(?::[0-5]\\d)?(?:\\.\\d+)?(?:z|[+-]\\d\\d:\\d\\d)?$/i,\r\n\r\n // email (sources from jsen validator):\r\n // http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address#answer-8829363\r\n // http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'willful violation')\r\n 'email': /^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,\r\n\r\n 'hostname': /^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*$/i,\r\n\r\n // optimized https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html\r\n 'ipv4': /^(?:(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)$/,\r\n\r\n // optimized http://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses\r\n // tslint:disable-next-line:max-line-length\r\n 'ipv6': /^\\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:)))(?:%.+)?\\s*$/i,\r\n\r\n // uri: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js\r\n 'uri': /^(?:[a-z][a-z0-9+-.]*)(?::|\\/)\\/?[^\\s]*$/i,\r\n\r\n // uri fragment: https://tools.ietf.org/html/rfc3986#appendix-A\r\n 'uri-reference': /^(?:(?:[a-z][a-z0-9+-.]*:)?\\/\\/)?[^\\s]*$/i,\r\n\r\n // uri-template: https://tools.ietf.org/html/rfc6570\r\n // tslint:disable-next-line:max-line-length\r\n 'uri-template': /^(?:(?:[^\\x00-\\x20\"'<>%\\\\^`{|}]|%[0-9a-f]{2})|\\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\\*)?)*\\})*$/i,\r\n\r\n // For the source: https://gist.github.com/dperini/729294\r\n // For test cases: https://mathiasbynens.be/demo/url-regex\r\n // tslint:disable-next-line:max-line-length\r\n // @todo Delete current URL in favour of the commented out URL rule when this ajv issue is fixed https://github.com/eslint/eslint/issues/7983.\r\n // tslint:disable-next-line:max-line-length\r\n // URL: /^(?:(?:https?|ftp):\\/\\/)(?:\\S+(?::\\S*)?@)?(?:(?!10(?:\\.\\d{1,3}){3})(?!127(?:\\.\\d{1,3}){3})(?!169\\.254(?:\\.\\d{1,3}){2})(?!192\\.168(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u{00a1}-\\u{ffff}0-9]+-?)*[a-z\\u{00a1}-\\u{ffff}0-9]+)(?:\\.(?:[a-z\\u{00a1}-\\u{ffff}0-9]+-?)*[a-z\\u{00a1}-\\u{ffff}0-9]+)*(?:\\.(?:[a-z\\u{00a1}-\\u{ffff}]{2,})))(?::\\d{2,5})?(?:\\/[^\\s]*)?$/iu,\r\n // tslint:disable-next-line:max-line-length\r\n 'url': /^(?:(?:http[s\\u017F]?|ftp):\\/\\/)(?:(?:[\\0-\\x08\\x0E-\\x1F!-\\x9F\\xA1-\\u167F\\u1681-\\u1FFF\\u200B-\\u2027\\u202A-\\u202E\\u2030-\\u205E\\u2060-\\u2FFF\\u3001-\\uD7FF\\uE000-\\uFEFE\\uFF00-\\uFFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])+(?::(?:[\\0-\\x08\\x0E-\\x1F!-\\x9F\\xA1-\\u167F\\u1681-\\u1FFF\\u200B-\\u2027\\u202A-\\u202E\\u2030-\\u205E\\u2060-\\u2FFF\\u3001-\\uD7FF\\uE000-\\uFEFE\\uFF00-\\uFFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])*)?@)?(?:(?!10(?:\\.[0-9]{1,3}){3})(?!127(?:\\.[0-9]{1,3}){3})(?!169\\.254(?:\\.[0-9]{1,3}){2})(?!192\\.168(?:\\.[0-9]{1,3}){2})(?!172\\.(?:1[6-9]|2[0-9]|3[01])(?:\\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\\xA1-\\uD7FF\\uE000-\\uFFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])+-?)*(?:[0-9KSa-z\\xA1-\\uD7FF\\uE000-\\uFFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])+)(?:\\.(?:(?:[0-9KSa-z\\xA1-\\uD7FF\\uE000-\\uFFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])+-?)*(?:[0-9KSa-z\\xA1-\\uD7FF\\uE000-\\uFFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])+)*(?:\\.(?:(?:[KSa-z\\xA1-\\uD7FF\\uE000-\\uFFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\\/(?:[\\0-\\x08\\x0E-\\x1F!-\\x9F\\xA1-\\u167F\\u1681-\\u1FFF\\u200B-\\u2027\\u202A-\\u202E\\u2030-\\u205E\\u2060-\\u2FFF\\u3001-\\uD7FF\\uE000-\\uFEFE\\uFF00-\\uFFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])*)?$/i,\r\n\r\n // uuid: http://tools.ietf.org/html/rfc4122\r\n 'uuid': /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,\r\n\r\n // optimized https://gist.github.com/olmokramer/82ccce673f86db7cda5e\r\n // tslint:disable-next-line:max-line-length\r\n 'color': /^\\s*(#(?:[\\da-f]{3}){1,2}|rgb\\((?:\\d{1,3},\\s*){2}\\d{1,3}\\)|rgba\\((?:\\d{1,3},\\s*){3}\\d*\\.?\\d+\\)|hsl\\(\\d{1,3}(?:,\\s*\\d{1,3}%){2}\\)|hsla\\(\\d{1,3}(?:,\\s*\\d{1,3}%){2},\\s*\\d*\\.?\\d+\\))\\s*$/gi,\r\n\r\n // JSON-pointer: https://tools.ietf.org/html/rfc6901\r\n 'json-pointer': /^(?:\\/(?:[^~/]|~0|~1)*)*$|^#(?:\\/(?:[a-z0-9_\\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,\r\n\r\n 'relative-json-pointer': /^(?:0|[1-9][0-9]*)(?:#|(?:\\/(?:[^~/]|~0|~1)*)*)$/,\r\n\r\n 'duration':/^P(?!$)(\\d+Y)?(\\d+M)?(\\d+D)?(T(\\d+H)?(\\d+M)?(\\d+S)?)?$/,\r\n\r\n 'regex': function (str) {\r\n if (/[^\\\\]\\\\Z/.test(str)) { return false; }\r\n try {\r\n return true;\r\n } catch (e) {\r\n return false;\r\n }\r\n }\r\n\r\n};\r\n\r\nexport type JsonSchemaFormatNames =\r\n 'date' | 'time' | 'date-time' | 'email' | 'hostname' | 'ipv4' | 'ipv6' |\r\n 'uri' | 'uri-reference' | 'uri-template' | 'url' | 'uuid' | 'color' |\r\n 'json-pointer' | 'relative-json-pointer' | 'duration' |'regex';\r\n","import { AbstractControl, ValidationErrors, ValidatorFn } from '@angular/forms';\r\nimport isEqual from 'lodash/isEqual';\r\nimport { forkJoin } from 'rxjs';\r\nimport { map } from 'rxjs/operators';\r\nimport { JsonSchemaFormatNames, jsonSchemaFormatTests } from './format-regex.constants';\r\nimport { forEachCopy } from './utility.functions';\r\nimport {\r\n _executeAsyncValidators,\r\n _executeValidators,\r\n _mergeErrors,\r\n _mergeObjects,\r\n AsyncIValidatorFn,\r\n getType,\r\n hasValue,\r\n isArray,\r\n isBoolean,\r\n isDefined,\r\n isEmpty,\r\n isNumber,\r\n isString,\r\n isType,\r\n IValidatorFn,\r\n SchemaPrimitiveType,\r\n toJavaScriptType,\r\n toObservable,\r\n xor\r\n} from './validator.functions';\r\n\r\n\r\n\r\n/**\r\n * 'JsonValidators' class\r\n *\r\n * Provides an extended set of validators to be used by form controls,\r\n * compatible with standard JSON Schema validation options.\r\n * http://json-schema.org/latest/json-schema-validation.html\r\n *\r\n * Note: This library is designed as a drop-in replacement for the Angular\r\n * Validators library, and except for one small breaking change to the 'pattern'\r\n * validator (described below) it can even be imported as a substitute, like so:\r\n *\r\n * import { JsonValidators as Validators } from 'json-validators';\r\n *\r\n * and it should work with existing code as a complete replacement.\r\n *\r\n * The one exception is the 'pattern' validator, which has been changed to\r\n * matche partial values by default (the standard 'pattern' validator wrapped\r\n * all patterns in '^' and '$', forcing them to always match an entire value).\r\n * However, the old behavior can be restored by simply adding '^' and '$'\r\n * around your patterns, or by passing an optional second parameter of TRUE.\r\n * This change is to make the 'pattern' validator match the behavior of a\r\n * JSON Schema pattern, which allows partial matches, rather than the behavior\r\n * of an HTML input control pattern, which does not.\r\n *\r\n * This library replaces Angular's validators and combination functions\r\n * with the following validators and transformation functions:\r\n *\r\n * Validators:\r\n * For all formControls: required (*), type, enum, const\r\n * For text formControls: minLength (*), maxLength (*), pattern (*), format\r\n * For numeric formControls: maximum, exclusiveMaximum,\r\n * minimum, exclusiveMinimum, multipleOf\r\n * For formGroup objects: minProperties, maxProperties, dependencies\r\n * For formArray arrays: minItems, maxItems, uniqueItems, contains\r\n * Not used by JSON Schema: min (*), max (*), requiredTrue (*), email (*)\r\n * (Validators originally included with Angular are maked with (*).)\r\n *\r\n * NOTE / TODO: The dependencies validator is not complete.\r\n * NOTE / TODO: The contains validator is not complete.\r\n *\r\n * Validators not used by JSON Schema (but included for compatibility)\r\n * and their JSON Schema equivalents:\r\n *\r\n * Angular validator | JSON Schema equivalent\r\n * ------------------|-----------------------\r\n * min(number) | minimum(number)\r\n * max(number) | maximum(number)\r\n * requiredTrue() | const(true)\r\n * email() | format('email')\r\n *\r\n * Validator transformation functions:\r\n * composeAnyOf, composeOneOf, composeAllOf, composeNot\r\n * (Angular's original combination funciton, 'compose', is also included for\r\n * backward compatibility, though it is functionally equivalent to composeAllOf,\r\n * asside from its more generic error message.)\r\n *\r\n * All validators have also been extended to accept an optional second argument\r\n * which, if passed a TRUE value, causes the validator to perform the opposite\r\n * of its original finction. (This is used internally to enable 'not' and\r\n * 'composeOneOf' to function and return useful error messages.)\r\n *\r\n * The 'required' validator has also been overloaded so that if called with\r\n * a boolean parameter (or no parameters) it returns the original validator\r\n * function (rather than executing it). However, if it is called with an\r\n * AbstractControl parameter (as was previously required), it behaves\r\n * exactly as before.\r\n *\r\n * This enables all validators (including 'required') to be constructed in\r\n * exactly the same way, so they can be automatically applied using the\r\n * equivalent key names and values taken directly from a JSON Schema.\r\n *\r\n * This source code is partially derived from Angular,\r\n * which is Copyright (c) 2014-2017 Google, Inc.\r\n * Use of this source code is therefore governed by the same MIT-style license\r\n * that can be found in the LICENSE file at https://angular.io/license\r\n *\r\n * Original Angular Validators:\r\n * https://github.com/angular/angular/blob/master/packages/forms/src/validators.ts\r\n */\r\nexport class JsonValidators {\r\n\r\n /**\r\n * Validator functions:\r\n *\r\n * For all formControls: required, type, enum, const\r\n * For text formControls: minLength, maxLength, pattern, format\r\n * For numeric formControls: maximum, exclusiveMaximum,\r\n * minimum, exclusiveMinimum, multipleOf\r\n * For formGroup objects: minProperties, maxProperties, dependencies\r\n * For formArray arrays: minItems, maxItems, uniqueItems, contains\r\n *\r\n * TODO: finish dependencies validator\r\n */\r\n\r\n /**\r\n * 'required' validator\r\n *\r\n * This validator is overloaded, compared to the default required validator.\r\n * If called with no parameters, or TRUE, this validator returns the\r\n * 'required' validator function (rather than executing it). This matches\r\n * the behavior of all other validators in this library.\r\n *\r\n * If this validator is called with an AbstractControl parameter\r\n * (as was previously required) it behaves the same as Angular's default\r\n * required validator, and returns an error if the control is empty.\r\n *\r\n * Old behavior: (if input type = AbstractControl)\r\n * // {AbstractControl} control - required control\r\n * // {{[key: string]: boolean}} - returns error message if no input\r\n *\r\n * New behavior: (if no input, or input type = boolean)\r\n * // {boolean = true} required? - true to validate, false to disable\r\n * // {IValidatorFn} - returns the 'required' validator function itself\r\n */\r\n static required(input: AbstractControl): ValidationErrors|null;\r\n static required(input?: boolean): IValidatorFn;\r\n\r\n static required(input?: AbstractControl|boolean): ValidationErrors|null|IValidatorFn {\r\n if (input === undefined) { input = true; }\r\n switch (input) {\r\n case true: // Return required function (do not execute it yet)\r\n return (control: AbstractControl, invert = false): ValidationErrors|null => {\r\n if (invert) { return null; } // if not required, always return valid\r\n return hasValue(control.value) ? null : { 'required': true };\r\n };\r\n case false: // Do nothing (if field is not required, it is always valid)\r\n return JsonValidators.nullValidator;\r\n default: // Execute required function\r\n return hasValue((<AbstractControl>input).value) ? null : { 'required': true };\r\n }\r\n }\r\n\r\n /**\r\n * 'type' validator\r\n *\r\n * Requires a control to only accept values of a specified type,\r\n * or one of an array of types.\r\n *\r\n * Note: SchemaPrimitiveType = 'string'|'number'|'integer'|'boolean'|'null'\r\n *\r\n * // {SchemaPrimitiveType|SchemaPrimitiveType[]} type - type(s) to accept\r\n * // {IValidatorFn}\r\n */\r\n static type(requiredType: SchemaPrimitiveType|SchemaPrimitiveType[]): IValidatorFn {\r\n if (!hasValue(requiredType)) { return JsonValidators.nullValidator; }\r\n return (control: AbstractControl, invert = false): ValidationErrors|null => {\r\n if (isEmpty(control.value)) { return null; }\r\n const currentValue: any = control.value;\r\n const isValid = isArray(requiredType) ?\r\n (<SchemaPrimitiveType[]>requiredType).some(type => isType(currentValue, type)) :\r\n isType(currentValue, <SchemaPrimitiveType>requiredType);\r\n return xor(isValid, invert) ?\r\n null : { 'type': { requiredType, currentValue } };\r\n };\r\n }\r\n\r\n /**\r\n * 'enum' validator\r\n *\r\n * Requires a control to have a value from an enumerated list of values.\r\n *\r\n * Converts types as needed to allow string inputs to still correctly\r\n * match number, boolean, and null enum values.\r\n *\r\n * // {any[]} allowedValues - array of acceptable values\r\n * // {IValidatorFn}\r\n */\r\n static enum(allowedValues: any[]): IValidatorFn {\r\n if (!isArray(allowedValues)) { return JsonValidators.nullValidator; }\r\n return (control: AbstractControl, invert = false): ValidationErrors|null => {\r\n if (isEmpty(control.value)) { return null; }\r\n const currentValue: any = control.value;\r\n const isEqualVal = (enumValue, inputValue) =>\r\n enumValue === inputValue ||\r\n (isNumber(enumValue) && +inputValue === +enumValue) ||\r\n (isBoolean(enumValue, 'strict') &&\r\n toJavaScriptType(inputValue, 'boolean') === enumValue) ||\r\n (enumValue === null && !hasValue(inputValue)) ||\r\n isEqual(enumValue, inputValue);\r\n const isValid = isArray(currentValue) ?\r\n currentValue.every(inputValue => allowedValues.some(enumValue =>\r\n isEqualVal(enumValue, inputValue)\r\n )) :\r\n allowedValues.some(enumValue => isEqualVal(enumValue, currentValue));\r\n return xor(isValid, invert) ?\r\n null : { 'enum': { allowedValues, currentValue } };\r\n };\r\n }\r\n\r\n /**\r\n * 'const' validator\r\n *\r\n * Requires a control to have a specific value.\r\n *\r\n * Converts types as needed to allow string inputs to still correctly\r\n * match number, boolean, and null values.\r\n *\r\n * TODO: modify to work with objects\r\n *\r\n * // {any[]} requiredValue - required value\r\n * // {IValidatorFn}\r\n */\r\n static const(requiredValue: any): IValidatorFn {\r\n if (!hasValue(requiredValue)) { return JsonValidators.nullValidator; }\r\n return (control: AbstractControl, invert = false): ValidationErrors|null => {\r\n if (isEmpty(control.value)) { return null; }\r\n const currentValue: any = control.value;\r\n const isEqualVal = (constValue, inputValue) =>\r\n constValue === inputValue ||\r\n isNumber(constValue) && +inputValue === +constValue ||\r\n isBoolean(constValue, 'strict') &&\r\n toJavaScriptType(inputValue, 'boolean') === constValue ||\r\n constValue === null && !hasValue(inputValue);\r\n const isValid = isEqualVal(requiredValue, currentValue);\r\n return xor(isValid, invert) ?\r\n null : { 'const': { requiredValue, currentValue } };\r\n };\r\n }\r\n\r\n /**\r\n * 'minLength' validator\r\n *\r\n * Requires a control's text value to be greater than a specified length.\r\n *\r\n * // {number} minimumLength - minimum allowed string length\r\n * // {boolean = false} invert - instead return error object only if valid\r\n * // {IValidatorFn}\r\n */\r\n static minLength(minimumLength: number): IValidatorFn {\r\n if (!hasValue(minimumLength)) { return JsonValidators.nullValidator; }\r\n return (control: AbstractControl, invert = false): ValidationErrors|null => {\r\n if (isEmpty(control.value)) { return null; }\r\n const currentLength = isString(control.value) ? control.value.length : 0;\r\n const isValid = currentLength >= minimumLength;\r\n return xor(isValid, invert) ?\r\n null : { 'minLength': { minimumLength, currentLength } };\r\n };\r\n }\r\n\r\n /**\r\n * 'maxLength' validator\r\n *\r\n * Requires a control's text value to be less than a specified length.\r\n *\r\n * // {number} maximumLength - maximum allowed string length\r\n * // {boolean = false} invert - instead return error object only if valid\r\n * // {IValidatorFn}\r\n */\r\n static maxLength(maximumLength: number): IValidatorFn {\r\n if (!hasValue(maximumLength)) { return JsonValidators.nullValidator; }\r\n return (control: AbstractControl, invert = false): ValidationErrors|null => {\r\n const currentLength = isString(control.value) ? control.value.length : 0;\r\n const isValid = currentLength <= maximumLength;\r\n return xor(isValid, invert) ?\r\n null : { 'maxLength': { maximumLength, currentLength } };\r\n };\r\n }\r\n\r\n /**\r\n * 'pattern' validator\r\n *\r\n * Note: NOT the same as Angular's default pattern validator.\r\n *\r\n * Requires a control's value to match a specified regular expression pattern.\r\n *\r\n * This validator changes the behavior of default pattern validator\r\n * by replacing RegExp(`^${pattern}$`) with RegExp(`${pattern}`),\r\n * which allows for partial matches.\r\n *\r\n * To return to the default funcitonality, and match the entire string,\r\n * pass TRUE as the optional second parameter.\r\n *\r\n * // {string} pattern - regular expression pattern\r\n * // {boolean = false} wholeString - match whole value string?\r\n * // {IValidatorFn}\r\n */\r\n static pattern(pattern: string|RegExp, wholeString = false): IValidatorFn {\r\n if (!hasValue(pattern)) { return JsonValidators.nullValidator; }\r\n return (control: AbstractControl, invert = false): ValidationErrors|null => {\r\n if (isEmpty(control.value)) { return null; }\r\n let regex: RegExp;\r\n let requiredPattern: string;\r\n if (typeof pattern === 'string') {\r\n requiredPattern = (wholeString) ? `^${pattern}$` : pattern;\r\n regex = new RegExp(requiredPattern);\r\n } else {\r\n requiredPattern = pattern.toString();\r\n regex = pattern;\r\n }\r\n const currentValue: string = control.value;\r\n const isValid = isString(currentValue) ? regex.test(currentValue) : false;\r\n return xor(isValid, invert) ?\r\n null : { 'pattern': { requiredPattern, currentValue } };\r\n };\r\n }\r\n\r\n /**\r\n * 'format' validator\r\n *\r\n * Requires a control to have a value of a certain format.\r\n *\r\n * This validator currently checks the following formsts:\r\n * date, time, date-time, email, hostname, ipv4, ipv6,\r\n * uri, uri-reference, uri-template, url, uuid, color,\r\n * json-pointer, relative-json-pointer,duration, regex\r\n *\r\n * Fast format regular expressions copied from AJV:\r\n * https://github.com/epoberezkin/ajv/blob/master/lib/compile/formats.js\r\n *\r\n * // {JsonSchemaFormatNames} requiredFormat - format to check\r\n * // {IValidatorFn}\r\n */\r\n static format(requiredFormat: JsonSchemaFormatNames): IValidatorFn {\r\n if (!hasValue(requiredFormat)) { return JsonValidators.nullValidator; }\r\n return (control: AbstractControl, invert = false): ValidationErrors|null => {\r\n if (isEmpty(control.value)) { return null; }\r\n let isValid: boolean;\r\n const currentValue: string|Date = control.value;\r\n if (isString(currentValue)) {\r\n //TODO fix-Reg exp last index problem\r\n //see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/test\r\n //before every call to .test it needs to be reset\r\n //use either formatTest.lastIndex = 0; // Reset the lastIndex before each test\r\n //or new RegExp(formatTest.source, formatTest.flags);\r\n \r\n const formatTest: Function|RegExp = jsonSchemaFormatTests[requiredFormat];\r\n if (typeof formatTest === 'object') {\r\n isValid = new RegExp((<RegExp>formatTest).source,(<RegExp>formatTest).flags).test(<string>currentValue);\r\n } else if (typeof formatTest === 'function') {\r\n isValid = (<Function>formatTest)(<string>currentValue);\r\n } else {\r\n console.error(`format validator error: \"${requiredFormat}\" is not a recognized format.`);\r\n isValid = true;\r\n }\r\n } else {\r\n // Allow JavaScript Date objects\r\n isValid = ['date', 'time', 'iso-date-time'].includes(requiredFormat) &&\r\n Object.prototype.toString.call(currentValue) === '[object Date]';\r\n }\r\n return xor(isValid, invert) ?\r\n null : { 'format': { requiredFormat, currentValue } };\r\n };\r\n }\r\n\r\n /**\r\n * 'minimum' validator\r\n *\r\n * Requires a control's numeric value to be greater than or equal to\r\n * a minimum amount.\r\n *\r\n * Any non-numeric value is also valid (according to the HTML forms spec,\r\n * a non-numeric value doesn't have a minimum).\r\n * https://www.w3.org/TR/html5/forms.html#attr-input-max\r\n *\r\n * // {number} minimum - minimum allowed value\r\n * // {IValidatorFn}\r\n */\r\n static minimum(minimumValue: number): IValidatorFn {\r\n if (!hasValue(minimumValue)) { return JsonValidators.nullValidator; }\r\n return (control: AbstractControl, invert = false): ValidationErrors|null => {\r\n if (isEmpty(control.value)) { return null; }\r\n const currentValue = control.value;\r\n const isValid = !isNumber(currentValue) || currentValue >= minimumValue;\r\n return xor(isValid, invert) ?\r\n null : { 'minimum': { minimumValue, currentValue } };\r\n };\r\n }\r\n\r\n /**\r\n * 'exclusiveMinimum' validator\r\n *\r\n * Requires a control's numeric value to be less than a maximum amount.\r\n *\r\n * Any non-numeric value is also valid (according to the HTML forms spec,\r\n * a non-numeric value doesn't have a maximum).\r\n * https://www.w3.org/TR/html5/forms.html#attr-input-max\r\n *\r\n * // {number} exclusiveMinimumValue - maximum allowed value\r\n * // {IValidatorFn}\r\n */\r\n static exclusiveMinimum(exclusiveMinimumValue: number): IValidatorFn {\r\n if (!hasValue(exclusiveMinimumValue)) { return JsonValidators.nullValidator; }\r\n return (control: AbstractControl, invert = false): ValidationErrors|null => {\r\n if (isEmpty(control.value)) { return null; }\r\n const currentValue = control.value;\r\n const isValid = !isNumber(currentValue) || +currentValue < exclusiveMinimumValue;\r\n return xor(isValid, invert) ?\r\n null : { 'exclusiveMinimum': { exclusiveMinimumValue, currentValue } };\r\n };\r\n }\r\n\r\n /**\r\n * 'maximum' validator\r\n *\r\n * Requires a control's numeric value to be less than or equal to\r\n * a maximum amount.\r\n *\r\n * Any non-numeric value is also valid (according to the HTML forms spec,\r\n * a non-numeric value doesn't have a maximum).\r\n * https://www.w3.org/TR/html5/forms.html#attr-input-max\r\n *\r\n * // {number} maximumValue - maximum allowed value\r\n * // {IValidatorFn}\r\n */\r\n static maximum(maximumValue: number): IValidatorFn {\r\n if (!hasValue(maximumValue)) { return JsonValidators.nullValidator; }\r\n return (control: AbstractControl, invert = false): ValidationErrors|null => {\r\n if (isEmpty(control.value)) { return null; }\r\n const currentValue = control.value;\r\n const isValid = !isNumber(currentValue) || +currentValue <= maximumValue;\r\n return xor(isValid, invert) ?\r\n null : { 'maximum': { maximumValue, currentValue } };\r\n };\r\n }\r\n\r\n /**\r\n * 'exclusiveMaximum' validator\r\n *\r\n * Requires a control's numeric value to be less than a maximum amount.\r\n *\r\n * Any non-numeric value is also valid (according to the HTML forms spec,\r\n * a non-numeric value doesn't have a maximum).\r\n * https://www.w3.org/TR/html5/forms.html#attr-input-max\r\n *\r\n * // {number} exclusiveMaximumValue - maximum allowed value\r\n * // {IValidatorFn}\r\n */\r\n static exclusiveMaximum(exclusiveMaximumValue: number): IValidatorFn {\r\n if (!hasValue(exclusiveMaximumValue)) { return JsonValidators.nullValidator; }\r\n return (control: AbstractControl, invert = false): ValidationErrors|null => {\r\n if (isEmpty(control.value)) { return null; }\r\n const currentValue = control.value;\r\n const isValid = !isNumber(currentValue) || +currentValue < exclusiveMaximumValue;\r\n return xor(isValid, invert) ?\r\n null : { 'exclusiveMaximum': { exclusiveMaximumValue, currentValue } };\r\n };\r\n }\r\n\r\n /**\r\n * 'multipleOf' validator\r\n *\r\n * Requires a control to have a numeric value that is a multiple\r\n * of a specified number.\r\n *\r\n * // {number} multipleOfValue - number value must be a multiple of\r\n * // {IValidatorFn}\r\n */\r\n static multipleOf(multipleOfValue: number): IValidatorFn {\r\n if (!hasValue(multipleOfValue)) { return JsonValidators.nullValidator; }\r\n return (control: AbstractControl, invert = false): ValidationErrors|null => {\r\n if (isEmpty(control.value)) { return null; }\r\n const currentValue = control.value;\r\n const isValid = isNumber(currentValue) &&\r\n currentValue % multipleOfValue === 0;\r\n return xor(isValid, invert) ?\r\n null : { 'multipleOf': { multipleOfValue, currentValue } };\r\n };\r\n }\r\n\r\n /**\r\n * 'minProperties' validator\r\n *\r\n * Requires a form group to have a minimum number of properties (i.e. have\r\n * values entered in a minimum number of controls within the group).\r\n *\r\n * // {number} minimumProperties - minimum number of properties allowed\r\n * // {IValidatorFn}\r\n */\r\n static minProperties(minimumProperties: number): IValidatorFn {\r\n if (!hasValue(minimumProperties)) { return JsonValidators.nullValidator; }\r\n return (control: AbstractControl, invert = false): ValidationErrors|null => {\r\n if (isEmpty(control.value)) { return null; }\r\n const currentProperties = Object.keys(control.value).length || 0;\r\n const isValid = currentProperties >= minimumProperties;\r\n return xor(isValid, invert) ?\r\n null : { 'minProperties': { minimumProperties, currentProperties } };\r\n };\r\n }\r\n\r\n /**\r\n * 'maxProperties' validator\r\n *\r\n * Requires a form group to have a maximum number of properties (i.e. have\r\n * values entered in a maximum number of controls within the group).\r\n *\r\n * Note: Has no effect if the form group does not contain more than the\r\n * maximum number of controls.\r\n *\r\n * // {number} maximumProperties - maximum number of properties allowed\r\n * // {IValidatorFn}\r\n */\r\n static maxProperties(maximumProperties: number): IValidatorFn {\r\n if (!hasValue(maximumProperties)) { return JsonValidators.nullValidator; }\r\n return (control: AbstractControl, invert = false): ValidationErrors|null => {\r\n const currentProperties = Object.keys(control.value).length || 0;\r\n const isValid = currentProperties <= maximumProperties;\r\n return xor(isValid, invert) ?\r\n null : { 'maxProperties': { maximumProperties, currentProperties } };\r\n };\r\n }\r\n\r\n /**\r\n * 'dependencies' validator\r\n *\r\n * Requires the controls in a form group to meet additional validation\r\n * criteria, depending on the values of other controls in the group.\r\n *\r\n * Examples:\r\n * https://spacetelescope.github.io/understanding-json-schema/reference/object.html#dependencies\r\n *\r\n * // {any} dependencies - required dependencies\r\n * // {IValidatorFn}\r\n */\r\n static dependencies(dependencies: any): IValidatorFn {\r\n if (getType(dependencies) !== 'object' || isEmpty(dependencies)) {\r\n return JsonValidators.nullValidator;\r\n }\r\n return (control: AbstractControl, invert = false): ValidationErrors|null => {\r\n if (isEmpty(control.value)) { return null; }\r\n const allErrors = _mergeObjects(\r\n forEachCopy(dependencies, (value, requiringField) => {\r\n if (!hasValue(control.value[requiringField])) { return null; }\r\n let requiringFieldErrors: ValidationErrors = { };\r\n let requiredFields: string[];\r\n let properties: ValidationErrors = { };\r\n if (getType(dependencies[requiringField]) === 'array') {\r\n requiredFields = dependencies[requiringField];\r\n } else if (getType(dependencies[requiringField]) === 'object') {\r\n requiredFields = dependencies[requiringField]['required'] || [];\r\n properties = dependencies[requiringField]['properties'] || { };\r\n }\r\n\r\n // Validate property dependencies\r\n for (const requiredField of requiredFields) {\r\n if (xor(!hasValue(control.value[requiredField]), invert)) {\r\n requiringFieldErrors[requiredField] = { 'required': true };\r\n }\r\n }\r\n\r\n // Validate schema dependencies\r\n requiringFieldErrors = _mergeObjects(requiringFieldErrors,\r\n forEachCopy(properties, (requirements, requiredField) => {\r\n const requiredFieldErrors = _mergeObjects(\r\n forEachCopy(requirements, (requirement, parameter) => {\r\n let validator: IValidatorFn = null;\r\n if (requirement === 'maximum' || requirement === 'minimum') {\r\n const exclusive = !!requirements['exclusiveM' + requirement.slice(1)];\r\n validator = JsonValidators[requirement](parameter, exclusive);\r\n } else if (typeof JsonValidators[requirement] === 'function') {\r\n validator = JsonValidators[requirement](parameter);\r\n }\r\n return !isDefined(validator) ?\r\n null : validator(control.value[requiredField]);\r\n })\r\n );\r\n return isEmpty(requiredFieldErrors) ?\r\n null : { [requiredField]: requiredFieldErrors };\r\n })\r\n );\r\n return isEmpty(requiringFieldErrors) ?\r\n null : { [requiringField]: requiringFieldErrors };\r\n })\r\n );\r\n return isEmpty(allErrors) ? null : allErrors;\r\n };\r\n }\r\n\r\n /**\r\n * 'minItems' validator\r\n *\r\n * Requires a form array to have a minimum number of values.\r\n *\r\n * // {number} minimumItems - minimum number of items allowed\r\n * // {IValidatorFn}\r\n */\r\n static minItems(minimumItems: number): IValidatorFn {\r\n if (!hasValue(minimumItems)) { return JsonValidators.nullValidator; }\r\n return (control: AbstractControl, invert = false): ValidationErrors|null => {\r\n if (isEmpty(control.value)) { return null; }\r\n const currentItems = isArray(control.value) ? control.value.length : 0;\r\n const isValid = currentItems >= minimumItems;\r\n return xor(isValid, invert) ?\r\n null : { 'minItems': { minimumItems, currentItems } };\r\n };\r\n }\r\n\r\n /**\r\n * 'maxItems' validator\r\n *\r\n * Requires a form array to have a maximum number of values.\r\n *\r\n * // {number} maximumItems - maximum number of items allowed\r\n * // {IValidatorFn}\r\n */\r\n static maxItems(maximumItems: number): IValidatorFn {\r\n if (!hasValue(maximumItems)) { return JsonValidators.nullValidator; }\r\n return (control: AbstractControl, invert = false): ValidationErrors|null => {\r\n const currentItems = isArray(control.value) ? control.value.length : 0;\r\n const isValid = currentItems <= maximumItems;\r\n return xor(isValid, invert) ?\r\n null : { 'maxItems': { maximumItems, currentItems } };\r\n };\r\n }\r\n\r\n /**\r\n * 'uniqueItems' validator\r\n *\r\n * Requires values in a form array to be unique.\r\n *\r\n * // {boolean = true} unique? - true to validate, false to disable\r\n * // {IValidatorFn}\r\n */\r\n static uniqueItems(unique = true): IValidatorFn {\r\n if (!unique) { return JsonValidators.nullValidator; }\r\n return (control: AbstractControl, invert = false): ValidationErrors|null => {\r\n if (isEmpty(control.value)) { return null; }\r\n const sorted: any[] = control.value.slice().sort();\r\n const duplicateItems = [];\r\n for (let i = 1; i < sorted.length; i++) {\r\n if (sorted[i - 1] === sorted[i] && duplicateItems.includes(sorted[i])) {\r\n duplicateItems.push(sorted[i]);\r\n }\r\n }\r\n const isValid = !duplicateItems.length;\r\n return xor(isValid, invert) ?\r\n null : { 'uniqueItems': { duplicateItems } };\r\n };\r\n }\r\n\r\n /**\r\n * 'contains' validator\r\n *\r\n * TODO: Complete this validator\r\n *\r\n * Requires values in a form array to be unique.\r\n *\r\n * // {boolean = true} unique? - true to validate, false to disable\r\n * // {IValidatorFn}\r\n */\r\n static contains(requiredItem = true): IValidatorFn {\r\n if (!requiredItem) { return JsonValidators.nullValidator; }\r\n return (control: AbstractControl, invert = false): ValidationErrors|null => {\r\n if (isEmpty(control.value) || !isArray(control.value)) { return null; }\r\n const currentItems = control.value;\r\n // const isValid = currentItems.some(item =>\r\n //\r\n // );\r\n const isValid = true;\r\n return xor(isValid, invert) ?\r\n null : { 'contains': { requiredItem, currentItems } };\r\n };\r\n }\r\n\r\n /**\r\n * No-op validator. Included for backward compatibility.\r\n */\r\n static nullValidator(control: AbstractControl): ValidationErrors|null {\r\n return null;\r\n }\r\n\r\n /**\r\n * Validator transformation functions:\r\n * composeAnyOf, composeOneOf, composeAllOf, composeNot,\r\n * compose, composeAsync\r\n *\r\n * TODO: Add composeAnyOfAsync, composeOneOfAsync,\r\n * composeAllOfAsync, composeNotAsync\r\n */\r\n\r\n /**\r\n * 'composeAnyOf' validator combination function\r\n *\r\n * Accepts an array of validators and returns a single validator that\r\n * evaluates to valid if any one or more of the submitted validators are\r\n * valid. If every validator is invalid, it returns combined errors from\r\n * all validators.\r\n *\r\n * // {IValidatorFn[]} validators - array of validators to combine\r\n * // {IValidatorFn} - single combined validator function\r\n */\r\n static composeAnyOf(validators: IValidatorFn[]): IValidatorFn {\r\n if (!validators) { return null; }\r\n const presentValidators = validators.filter(isDefined);\r\n if (presentValidators.length === 0) { return null; }\r\n return (control: AbstractControl, invert = false): ValidationErrors|null => {\r\n const arrayOfErrors =\r\n _executeValidators(control, presentValidators, invert).filter(isDefined);\r\n const isValid = validators.length > arrayOfErrors.length;\r\n return xor(isValid, invert) ?\r\n null : _mergeObjects(...arrayOfErrors, { 'anyOf': !invert });\r\n };\r\n }\r\n\r\n /**\r\n * 'composeOneOf' validator combination function\r\n *\r\n * Accepts an array of validators and returns a single validator that\r\n * evaluates to valid only if exactly one of the submitted validators\r\n * is valid. Otherwise returns combined information from all validators,\r\n * both valid and invalid.\r\n *\r\n * // {IValidatorFn[]} validators - array of validators to combine\r\n * // {IValidatorFn} - single combined validator function\r\n */\r\n static composeOneOf(validators: IValidatorFn[]): IValidatorFn {\r\n if (!validators) { return null; }\r\n const presentValidators = validators.filter(isDefined);\r\n if (presentValidators.length === 0) { return null; }\r\n return (control: AbstractControl, invert = false): ValidationErrors|null => {\r\n const arrayOfErrors =\r\n _executeValidators(control, presentValidators);\r\n const validControls =\r\n validators.length - arrayOfErrors.filter(isDefined).length;\r\n const isValid = validControls === 1;\r\n if (xor(isValid, invert)) { return null; }\r\n const arrayOfValids =\r\n _executeValidators(control, presentValidators, invert);\r\n return _mergeObjects(...arrayOfErrors, ...arrayOfValids, { 'oneOf': !invert });\r\n };\r\n }\r\n\r\n /**\r\n * 'composeAllOf' validator combination function\r\n *\r\n * Accepts an array of validators and returns a single validator that\r\n * evaluates to valid only if all the submitted validators are individually\r\n * valid. Otherwise it returns combined errors from all invalid validators.\r\n *\r\n * // {IValidatorFn[]} validators - array of validators to combine\r\n * // {IValidatorFn} - single combined validator function\r\n */\r\n static composeAllOf(validators: IValidatorFn[]): IValidatorFn {\r\n if (!validators) { return null; }\r\n const presentValidators = validators.filter(isDefined);\r\n if (presentValidators.length === 0) { return null; }\r\n return (control: AbstractControl, invert = false): ValidationErrors|null => {\r\n const combinedErrors = _mergeErrors(\r\n _executeValidators(control, presentValidators, invert)\r\n );\r\n const isValid = combinedErrors === null;\r\n return (xor(isValid, invert)) ?\r\n null : _mergeObjects(combinedErrors, { 'allOf': !invert });\r\n };\r\n }\r\n\r\n /**\r\n * 'composeNot' validator inversion function\r\n *\r\n * Accepts a single validator function and inverts its result.\r\n * Returns valid if the submitted validator is invalid, and\r\n * returns invalid if the submitted validator is valid.\r\n * (Note: this function can itself be inverted\r\n * - e.g. composeNot(composeNot(validator)) -\r\n * but this can be confusing and is therefore not recommended.)\r\n *\r\n * // {IValidatorFn[]} validators - validator(s) to invert\r\n * // {IValidatorFn} - new validator function that returns opposite result\r\n */\r\n static composeNot(validator: IValidatorFn): IValidatorFn {\r\n if (!validator) { return null; }\r\n return (control: AbstractControl, invert = false): ValidationErrors|null => {\r\n if (isEmpty(control.value)) { return null; }\r\n const error = validator(control, !invert);\r\n const isValid = error === null;\r\n return (xor(isValid, invert)) ?\r\n null : _mergeObjects(error, { 'not': !invert });\r\n };\r\n }\r\n\r\n /**\r\n * 'compose' validator combination function\r\n *\r\n * // {IValidatorFn[]} validators - array of validators to combine\r\n * // {IValidatorFn} - single combined validator function\r\n */\r\n static compose(validators: IValidatorFn[]): IValidatorFn {\r\n if (!validators) { return null; }\r\n const presentValidators = validators.filter(isDefined);\r\n if (presentValidators.length === 0) { return null; }\r\n return (control: AbstractControl, invert = false): ValidationErrors|null =>\r\n _mergeErrors(_executeValidators(control, presentValidators, invert));\r\n }\r\n\r\n /**\r\n * 'composeAsync' async validator combination function\r\n *\r\n * // {AsyncIValidatorFn[]} async validators - array of async validators\r\n * // {AsyncIValidatorFn} - single combined async validator function\r\n */\r\n static composeAsync(validators: AsyncIValidatorFn[]): AsyncIValidatorFn {\r\n if (!validators) { return null; }\r\n const presentValidators = validators.filter(isDefined);\r\n if (presentValidators.length === 0) { return null; }\r\n return (control: AbstractControl) => {\r\n const observables =\r\n _executeAsyncValidators(control, presentValidators).map(toObservable);\r\n return map.call(forkJoin(observables), _mergeErrors);\r\n };\r\n }\r\n\r\n // Additional angular validators (not used by Angualr JSON Schema Form)\r\n // From https://github.com/angular/angular/blob/master/packages/forms/src/validators.ts\r\n\r\n /**\r\n * Validator that requires controls to have a value greater than a number.\r\n */\r\n static min(min: number): ValidatorFn {\r\n if (!hasValue(min)) { return JsonValidators.nullValidator; }\r\n return (control: AbstractControl): ValidationErrors|null => {\r\n // don't validate empty values to allow optional controls\r\n if (isEmpty(control.value) || isEmpty(min)) { return null; }\r\n const value = parseFloat(control.value);\r\n const actual = control.value;\r\n // Controls with NaN values after parsing should be treated as not having a\r\n // minimum, per the HTML forms spec: https://www.w3.org/TR/html5/forms.html#attr-input-min\r\n return isNaN(value) || value >= min ? null : { 'min': { min, actual } };\r\n };\r\n }\r\n\r\n /**\r\n * Validator that requires controls to have a value less than a number.\r\n */\r\n static max(max: number): ValidatorFn {\r\n if (!hasValue(max)) { return JsonValidators.nullValidator; }\r\n return (control: AbstractControl): ValidationErrors|null => {\r\n // don't validate empty values to allow optional controls\r\n if (isEmpty(control.value) || isEmpty(max)) { return null; }\r\n const value = parseFloat(control.value);\r\n const actual = control.value;\r\n // Controls with NaN values after parsing should be treated as not having a\r\n // maximum, per the HTML forms spec: https://www.w3.org/TR/html5/forms.html#attr-input-max\r\n return isNaN(value) || value <= max ? null : { 'max': { max, actual } };\r\n };\r\n }\r\n\r\n /**\r\n * Validator that requires control value to be true.\r\n */\r\n static requiredTrue(control: AbstractControl): ValidationErrors|null {\r\n if (!control) { return JsonValidators.nullValidator; }\r\n return control.value === true ? null : { 'required': true };\r\n }\r\n\r\n /**\r\n * Validator that performs email validation.\r\n */\r\n static email(control: AbstractControl): ValidationErrors|null {\r\n if (!control) { return JsonValidators.nullValidator; }\r\n const EMAIL_REGEXP =\r\n // tslint:disable-next-line:max-line-length\r\n /^(?=.{1,254}$)(?=.{1,64}@)[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+(\\.[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+)*@[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?(\\.[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*$/;\r\n return EMAIL_REGEXP.test(control.value) ? null : { 'email': true };\r\n }\r\n}\r\n","import isEqual from 'lodash/isEqual';\r\n\r\nimport {\r\n isArray, isEmpty, isNumber, isObject, isString\r\n} from './validator.functions';\r\nimport { hasOwn, uniqueItems, commonItems } from './utility.functions';\r\nimport { JsonPointer, Pointer } from './jsonpointer.functions';\r\n\r\n/**\r\n * 'mergeSchemas' function\r\n *\r\n * Merges multiple JSON schemas into a single schema with combined rules.\r\n *\r\n * If able to logically merge properties from all schemas,\r\n * returns a single schema object containing all merged properties.\r\n *\r\n * Example: ({ a: b, max: 1 }, { c: d, max: 2 }) => { a: b, c: d, max: 1 }\r\n *\r\n * If unable to logically merge, returns an allOf schema object containing\r\n * an array of the original schemas;\r\n *\r\n * Example: ({ a: b }, { a: d }) => { allOf: [ { a: b }, { a: d } ] }\r\n *\r\n * // schemas - one or more input schemas\r\n * // - merged schema\r\n */\r\nexport function mergeSchemas(...schemas) {\r\n schemas = schemas.filter(schema => !isEmpty(schema));\r\n if (schemas.some(schema => !isObject(schema))) { return null; }\r\n const combinedSchema: any = {};\r\n for (const schema of schemas) {\r\n for (const key of Object.keys(schema)) {\r\n const combinedValue = combinedSchema[key];\r\n const schemaValue = schema[key];\r\n if (!hasOwn(combinedSchema, key) || isEqual(combinedValue, schemaValue)) {\r\n combinedSchema[key] = schemaValue;\r\n } else {\r\n switch (key) {\r\n case 'allOf':\r\n // Combine all items from both arrays\r\n if (isArray(combinedValue) && isArray(schemaValue)) {\r\n combinedSchema.allOf = mergeSchemas(...combinedValue, ...schemaValue);\r\n } else {\r\n return { allOf: [ ...schemas ] };\r\n }\r\n break;\r\n case 'additionalItems': case 'additionalProperties':\r\n case 'contains': case 'propertyNames':\r\n // Merge schema objects\r\n if (isObject(combinedValue) && isObject(schemaValue)) {\r\n combinedSchema[key] = mergeSchemas(combinedValue, schemaValue);\r\n // additionalProperties == false in any schema overrides all other values\r\n } else if (\r\n key === 'additionalProperties' &&\r\n (combinedValue === false || schemaValue === false)\r\n ) {\r\n combinedSchema.combinedSchema = false;\r\n } else {\r\n return { allOf: [ ...schemas ] };\r\n }\r\n break;\r\n case 'anyOf': case 'oneOf': case 'enum':\r\n // Keep only items that appear in both arrays\r\n if (isArray(combinedValue) && isArray(schemaValue)) {\r\n combinedSchema[key] = combinedValue.filter(item1 =>\r\n schemaValue.findIndex(item2 => isEqual(item1, item2)) > -1\r\n );\r\n if (!combinedSchema[key].length) { return { allOf: [ ...schemas ] }; }\r\n } else {\r\n return { allOf: [ ...schemas ] };\r\n }\r\n break;\r\n case 'definitions':\r\n // Combine keys from both objects\r\n if (isObject(combinedValue) && isObject(schemaValue)) {\r\n const combinedObject = { ...combinedValue };\r\n for (const subKey of Object.keys(schemaValue)) {\r\n if (!hasOwn(combinedObject, subKey) ||\r\n isEqual(combinedObject[subKey], schemaValue[subKey])\r\n ) {\r\n combinedObject[subKey] = schemaValue[subKey];\r\n // Don't combine matching keys with different values\r\n } else {\r\n return { allOf: [ ...schemas ] };\r\n }\r\n }\r\n combinedSchema.definitions = combinedObject;\r\n } else {\r\n return { allOf: [ ...schemas ] };\r\n }\r\n break;\r\n case 'dependencies':\r\n // Combine all keys from both objects\r\n // and merge schemas on matching keys,\r\n // converting from arrays to objects if necessary\r\n if (isObject(combinedValue) && isObject(schemaValue)) {\r\n const combinedObject = { ...combinedValue };\r\n for (const subKey of Object.keys(schemaValue)) {\r\n if (!hasOwn(combinedObject, subKey) ||\r\n isEqual(combinedObject[subKey], schemaValue[subKey])\r\n ) {\r\n combinedObject[subKey] = schemaValue[subKey];\r\n // If both keys are arrays, include all items from both arrays,\r\n // excluding duplicates\r\n } else if (\r\n isArray(schemaValue[subKey]) && isArray(combinedObject[subKey])\r\n ) {\r\n combinedObject[subKey] =\r\n uniqueItems(...combinedObject[subKey], ...schemaValue[subKey]);\r\n // If either key is an object, merge the schemas\r\n } else if (\r\n (isArray(schemaValue[subKey]) || isObject(schemaValue[subKey])) &&\r\n (isArray(combinedObject[subKey]) || isObject(combinedObject[subKey]))\r\n ) {\r\n // If either key is an array, convert it to an object first\r\n const required = isArray(combinedSchema.required) ?\r\n combinedSchema.required : [];\r\n const combinedDependency = isArray(combinedObject[subKey]) ?\r\n { required: uniqueItems(...required, combinedObject[subKey]) } :\r\n combinedObject[subKey];\r\n const schemaDependency = isArray(schemaValue[subKey]) ?\r\n { required: uniqueItems(...required, schemaValue[subKey]) } :\r\n schemaValue[subKey];\r\n combinedObject[subKey] =\r\n mergeSchemas(combinedDependency, schemaDependency);\r\n } else {\r\n return { allOf: [ ...schemas ] };\r\n }\r\n }\r\n combinedSchema.dependencies = combinedObject;\r\n } else {\r\n return { allOf: [ ...schemas ] };\r\n }\r\n break;\r\n case 'items':\r\n // If arrays, keep only items that appear in both arrays\r\n if (isArray(combinedValue) && isArray(schemaValue)) {\r\n combinedSchema.items = combinedValue.filter(item1 =>\r\n schemaValue.findIndex(item2 => isEqual(item1, item2)) > -1\r\n );\r\n if (!combinedSchema.items.length) { return { allOf: [ ...schemas ] }; }\r\n // If both keys are objects, merge them\r\n } else if (isObject(combinedValue) && isObject(schemaValue)) {\r\n combinedSchema.items = mergeSchemas(combinedValue, schemaValue);\r\n // If object + array, combine object with each array item\r\n } else if (isArray(combinedValue) && isObject(schemaValue)) {\r\n combinedSchema.items =\r\n combinedValue.map(item => mergeSchemas(item, schemaValue));\r\n } else if (isObject(combinedValue) && isArray(schemaValue)) {\r\n combinedSchema.items =\r\n schemaValue.map(item => mergeSchemas(item, combinedValue));\r\n } else {\r\n return { allOf: [ ...schemas ] };\r\n }\r\n break;\r\n case 'multipleOf':\r\n // TODO: Adjust to correctly handle decimal values\r\n // If numbers, set to least common multiple\r\n if (isNumber(combinedValue) && isNumber(schemaValue)) {\r\n const gcd = (x, y) => !y ? x : gcd(y, x % y);\r\n const lcm = (x, y) => (x * y) / gcd(x, y);\r\n combinedSchema.multipleOf = lcm(combinedValue, schemaValue);\r\n } else {\r\n return { allOf: [ ...schemas ] };\r\n }\r\n break;\r\n case 'maximum': case 'exclusiveMaximum': case 'maxLength':\r\n case 'maxItems': case 'maxProperties':\r\n // If numbers, set to lowest value\r\n if (isNumber(combinedValue) && isNumber(schemaValue)) {\r\n combinedSchema[key] = Math.min(combinedValue, schemaValue);\r\n } else {\r\n return { allOf: [ ...schemas ] };\r\n }\r\n break;\r\n case 'minimum': case 'exclusiveMinimum': case 'minLength':\r\n case 'minItems': case 'minProperties':\r\n // If numbers, set to highest value\r\n if (isNumber(combinedValue) && isNumber(schemaValue)) {\r\n combinedSchema[key] = Math.max(combinedValue, schemaValue);\r\n } else {\r\n return { allOf: [ ...schemas ] };\r\n }\r\n break;\r\n case 'not':\r\n // Combine not values into anyOf array\r\n if (isObject(combinedValue) && isObject(schemaValue)) {\r\n const notAnyOf = [combinedValue, schemaValue]\r\n .reduce((notAnyOfArray, notSchema) =>\r\n isArray(notSchema.anyOf) &&\r\n Object.keys(notSchema).length === 1 ?\r\n [ ...notAnyOfArray, ...notSchema.anyOf ] :\r\n [ ...notAnyOfArray, notSchema ]\r\n , []);\r\n // TODO: Remove duplicate items from array\r\n combinedSchema.not = { anyOf: notAnyOf };\r\n } else {\r\n return { allOf: [ ...schemas ] };\r\n }\r\n break;\r\n case 'patternProperties':\r\n // Combine all keys from both objects\r\n // and merge schemas on matching keys\r\n if (isObject(combinedValue) && isObject(schemaValue)) {\r\n const combinedObject = { ...combinedValue };\r\n for (const subKey of Object.keys(schemaValue)) {\r\n if (!hasOwn(combinedObject, subKey) ||\r\n isEqual(combinedObject[subKey], schemaValue[subKey])\r\n ) {\r\n combinedObject[subKey] = schemaValue[subKey];\r\n // If both keys are objects, merge them\r\n } else if (\r\n isObject(schemaValue[subKey]) && isObject(combinedObject[subKey])\r\n ) {\r\n combinedObject[subKey] =\r\n mergeSchemas(combinedObject[subKey], schemaValue[subKey]);\r\n } else {\r\n return { allOf: [ ...schemas ] };\r\n }\r\n }\r\n combinedSchema.patternProperties = combinedObject;\r\n } else {\r\n return { allOf: [ ...schemas ] };\r\n }\r\n break;\r\n case 'properties':\r\n // Combine all keys from both objects\r\n // unless additionalProperties === false\r\n // and merge schemas on matching keys\r\n if (isObject(combinedValue) && isObject(schemaValue)) {\r\n const combinedObject = { ...combinedValue };\r\n // If new schema has additionalProperties,\r\n // merge or remove non-matching property keys in combined schema\r\n if (hasOwn(schemaValue, 'additionalProperties')) {\r\n Object.keys(combinedValue)\r\n .filter(combinedKey => !Object.keys(schemaValue).includes(combinedKey))\r\n .forEach(nonMatchingKey => {\r\n if (schemaValue.additionalProperties === false) {\r\n delete combinedObject[nonMatchingKey];\r\n } else if (isObject(schemaValue.additionalProperties)) {\r\n combinedObject[nonMatchingKey] = mergeSchemas(\r\n combinedObject[nonMatchingKey],\r\n schemaValue.additionalProperties\r\n );\r\n }\r\n });\r\n }\r\n for (const subKey of Object.keys(schemaValue)) {\r\n if (isEqual(combinedObject[subKey], schemaValue[subKey]) || (\r\n !hasOwn(combinedObject, subKey) &&\r\n !hasOwn(combinedObject, 'additionalProperties')\r\n )) {\r\n combinedObject[subKey] = schemaValue[subKey];\r\n // If combined schema has additionalProperties,\r\n // merge or ignore non-matching property keys in new schema\r\n } else if (\r\n !hasOwn(combinedObject, subKey) &&\r\n hasOwn(combinedObject, 'additionalProperties')\r\n ) {\r\n // If combinedObject.additionalProperties === false,\r\n // do nothing (don't set key)\r\n // If additionalProperties is object, merge with new key\r\n if (isObject(combinedObject.additionalProperties)) {\r\n combinedObject[subKey] = mergeSchemas(\r\n combinedObject.additionalProperties, schemaValue[subKey]\r\n );\r\n }\r\n // If both keys are objects, merge them\r\n } else if (\r\n isObject(schemaValue[subKey]) &&\r\n isObject(combinedObject[subKey])\r\n ) {\r\n combinedObject[subKey] =\r\n mergeSchemas(combinedObject[subKey], schemaValue[subKey]);\r\n } else {\r\n return { allOf: [ ...schemas ] };\r\n }\r\n }\r\n combinedSchema.properties = combinedObject;\r\n } else {\r\n return { allOf: [ ...schemas ] };\r\n }\r\n break;\r\n case 'required':\r\n // If arrays, include all items from both arrays, excluding duplicates\r\n if (isArray(combinedValue) && isArray(schemaValue)) {\r\n combinedSchema.required = uniqueItems(...combinedValue, ...schemaValue);\r\n // If booleans, aet true if either true\r\n } else if (\r\n typeof schemaValue === 'boolean' &&\r\n typeof combinedValue === 'boolean'\r\n ) {\r\n combinedSchema.required = !!combinedValue || !!schemaValue;\r\n } else {\r\n return { allOf: [ ...schemas ] };\r\n }\r\n break;\r\n case '$schema': case '$id': case 'id':\r\n // Don't combine these keys\r\n break;\r\n case 'title': case 'description': case '$comment':\r\n // Return the last value, overwriting any previous one\r\n // These properties are not used for validation, so conflicts don't matter\r\n combinedSchema[key] = schemaValue;\r\n break;\r\n case 'type':\r\n if (\r\n (isArray(schemaValue) || isString(schemaValue)) &&\r\n (isArray(combinedValue) || isString(combinedValue))\r\n ) {\r\n const combinedTypes = commonItems(combinedValue, schemaValue);\r\n if (!combinedTypes.length) { return { allOf: [ ...schemas ] }; }\r\n combinedSchema.type = combinedTypes.length > 1 ? combinedTypes : combinedTypes[0];\r\n } else {\r\n return { allOf: [ ...schemas ] };\r\n }\r\n break;\r\n case 'uniqueItems':\r\n // Set true if either true\r\n combinedSchema.uniqueItems = !!combinedValue || !!schemaValue;\r\n break;\r\n default:\r\n return { allOf: [ ...schemas ] };\r\n }\r\n }\r\n }\r\n }\r\n return combinedSchema;\r\n}\r\n","import { isEmpty } from 'lodash';\r\nimport cloneDeep from 'lodash/cloneDeep';\r\nimport omit from 'lodash/omit';\r\nimport { JsonPointer } from './jsonpointer.functions';\r\nimport { mergeSchemas } from './merge-schemas.function';\r\nimport { forEach, hasOwn, mergeFilteredObject } from './utility.functions';\r\nimport {\r\n getType,\r\n hasValue,\r\n inArray,\r\n isArray,\r\n isNumber,\r\n isObject,\r\n isString\r\n} from './validator.functions';\r\n\r\n\r\n/**\r\n * JSON Schema function library:\r\n *\r\n * buildSchemaFromLayout: TODO: Write this function\r\n *\r\n * buildSchemaFromData:\r\n *\r\n * getFromSchema:\r\n *\r\n * removeRecursiveReferences:\r\n *\r\n * getInputType:\r\n *\r\n * checkInlineType:\r\n *\r\n * isInputRequired:\r\n *\r\n * updateInputOptions:\r\n *\r\n * getTitleMapFromOneOf:\r\n *\r\n * getControlValidators:\r\n *\r\n * resolveSchemaReferences:\r\n *\r\n * getSubSchema:\r\n *\r\n * combineAllOf:\r\n *\r\n * fixRequiredArrayProperties:\r\n */\r\n\r\n/**\r\n * 'buildSchemaFromLayout' function\r\n *\r\n * TODO: Build a JSON Schema from a JSON Form layout\r\n *\r\n * // layout - The JSON Form layout\r\n * // - The new JSON Schema\r\n */\r\nexport function buildSchemaFromLayout(layout) {\r\n return;\r\n // let newSchema: any = { };\r\n // const walkLayout = (layoutItems: any[], callback: Function): any[] => {\r\n // let returnArray: any[] = [];\r\n // for (let layoutItem of layoutItems) {\r\n // const returnItem: any = callback(layoutItem);\r\n // if (returnItem) { returnArray = returnArray.concat(callback(layoutItem)); }\r\n // if (layoutItem.items) {\r\n // returnArray = returnArray.concat(walkLayout(layoutItem.items, callback));\r\n // }\r\n // }\r\n // return returnArray;\r\n // };\r\n // walkLayout(layout, layoutItem => {\r\n // let itemKey: string;\r\n // if (typeof layoutItem === 'string') {\r\n // itemKey = layoutItem;\r\n // } else if (layoutItem.key) {\r\n // itemKey = layoutItem.key;\r\n // }\r\n // if (!itemKey) { return; }\r\n // //\r\n // });\r\n}\r\n\r\n/**\r\n * 'buildSchemaFromData' function\r\n *\r\n * Build a JSON Schema from a data object\r\n *\r\n * // data - The data object\r\n * // { boolean = false } requireAllFields - Require all fields?\r\n * // { boolean = true } isRoot - is root\r\n * // - The new JSON Schema\r\n */\r\nexport function buildSchemaFromData(\r\n data, requireAllFields = false, isRoot = true\r\n) {\r\n const newSchema: any = {};\r\n const getFieldType = (value: any): string => {\r\n const fieldType = getType(value, 'strict');\r\n return { integer: 'number', null: 'string' }[fieldType] || fieldType;\r\n };\r\n const buildSubSchema = (value) =>\r\n buildSchemaFromData(value, requireAllFields, false);\r\n if (isRoot) { newSchema.$schema = 'http://json-schema.org/draft-06/schema#'; }\r\n newSchema.type = getFieldType(data);\r\n if (newSchema.type === 'object') {\r\n newSchema.properties = {};\r\n if (requireAllFields) { newSchema.required = []; }\r\n for (const key of Object.keys(data)) {\r\n newSchema.properties[key] = buildSubSchema(data[key]);\r\n if (requireAllFields) { newSchema.required.push(key); }\r\n }\r\n } else if (newSchema.type === 'array') {\r\n newSchema.items = data.map(buildSubSchema);\r\n // If all items are the same type, use an object for items instead of an array\r\n if ((new Set(data.map(getFieldType))).size === 1) {\r\n newSchema.items = newSchema.items.reduce((a, b) => ({ ...a, ...b }), {});\r\n }\r\n if (requireAllFields) { newSchema.minItems = 1; }\r\n }\r\n return newSchema;\r\n}\r\n\r\n/**\r\n * 'getFromSchema' function\r\n *\r\n * Uses a JSON Pointer for a value within a data object to retrieve\r\n * the schema for that value within schema for the data object.\r\n *\r\n * The optional third parameter can also be set to return something else:\r\n * 'schema' (default): the schema for the value indicated by the data pointer\r\n * 'parentSchema': the schema for the value's parent object or array\r\n * 'schemaPointer': a pointer to the value's schema within the object's schema\r\n * 'parentSchemaPointer': a pointer to the schema for the value's parent object or array\r\n *\r\n * // schema - The schema to get the sub-schema from\r\n * // { Pointer } dataPointer - JSON Pointer (string or array)\r\n * // { string = 'schema' } returnType - what to return?\r\n * // - The located sub-schema\r\n */\r\nexport function getFromSchema(schema, dataPointer, returnType = 'schema') {\r\n const dataPointerArray: any[] = JsonPointer.parse(dataPointer);\r\n if (dataPointerArray === null) {\r\n console.error(`getFromSchema error: Invalid JSON Pointer: ${dataPointer}`);\r\n return null;\r\n }\r\n let subSchema = schema;\r\n const schemaPointer = [];\r\n const length = dataPointerArray.length;\r\n if (returnType.slice(0, 6) === 'parent') { dataPointerArray.length--; }\r\n for (let i = 0; i < length; ++i) {\r\n const parentSchema = subSchema;\r\n const key = dataPointerArray[i];\r\n let subSchemaFound = false;\r\n if (typeof subSchema !== 'object') {\r\n console.error(`getFromSchema error: Unable to find \"${key}\" key in schema.`);\r\n console.error(schema);\r\n console.error(dataPointer);\r\n return null;\r\n }\r\n if (subSchema.type === 'array' && (!isNaN(key) || key === '-')) {\r\n if (hasOwn(subSchema, 'items')) {\r\n if (isObject(subSchema.items)) {\r\n subSchemaFound = true;\r\n subSchema = subSchema.items;\r\n schemaPointer.push('items');\r\n } else if (isArray(subSchema.items)) {\r\n if (!isNaN(key) && subSchema.items.length >= +key) {\r\n subSchemaFound = true;\r\n subSchema = subSchema.items[+key];\r\n schemaPointer.push('items', key);\r\n }\r\n }\r\n }\r\n if (!subSchemaFound && isObject(subSchema.additionalItems)) {\r\n subSchemaFound = true;\r\n subSchema = subSchema.additionalItems;\r\n schemaPointer.push('additionalItems');\r\n } else if (subSchema.additionalItems !== false) {\r\n subSchemaFound = true;\r\n subSchema = { };\r\n schemaPointer.push('additionalItems');\r\n }\r\n } else if (subSchema.type === 'object') {\r\n if (isObject(subSchema.properties) && hasOwn(subSchema.properties, key)) {\r\n subSchemaFound = true;\r\n subSchema = subSchema.properties[key];\r\n schemaPointer.push('properties', key);\r\n } else if (isObject(subSchema.additionalProperties)) {\r\n subSchemaFound = true;\r\n subSchema = subSchema.additionalProperties;\r\n schemaPointer.push('additionalProperties');\r\n } else if (subSchema.additionalProperties !== false) {\r\n subSchemaFound = true;\r\n subSchema = { };\r\n schemaPointer.push('additionalProperties');\r\n }\r\n }\r\n if (!subSchemaFound) {\r\n console.error(`getFromSchema error: Unable to find \"${key}\" item in schema.`);\r\n console.error(schema);\r\n console.error(dataPointer);\r\n return;\r\n }\r\n }\r\n return returnType.slice(-7) === 'Pointer' ? schemaPointer : subSchema;\r\n}\r\n\r\n/**\r\n * 'removeRecursiveReferences' function\r\n *\r\n * Checks a JSON Pointer against a map of recursive references and returns\r\n * a JSON Pointer to the shallowest equivalent location in the same object.\r\n *\r\n * Using this functions enables an object to be constructed with unlimited\r\n * recursion, while maintaing a fixed set of metadata, such as field data types.\r\n * The object can grow as large as it wants, and deeply recursed nodes can\r\n * just refer to the metadata for their shallow equivalents, instead of having\r\n * to add additional redundant metadata for each recursively added node.\r\n *\r\n * Example:\r\n *\r\n * pointer: '/stuff/and/more/and/more/and/more/and/more/stuff'\r\n * recursiveRefMap: [['/stuff/and/more/and/more', '/stuff/and/more/']]\r\n * returned: '/stuff/and/more/stuff'\r\n *\r\n * // { Pointer } pointer -\r\n * // { Map<string, string> } recursiveRefMap -\r\n * // { Map<string, number> = new Map() } arrayMap - optional\r\n * // { string } -\r\n */\r\nexport function removeRecursiveReferences(\r\n pointer, recursiveRefMap, arrayMap = new Map()\r\n) {\r\n if (!pointer) { return ''; }\r\n let genericPointer =\r\n JsonPointer.toGenericPointer(JsonPointer.compile(pointer), arrayMap);\r\n if (genericPointer.indexOf('/') === -1) { return genericPointer; }\r\n let possibleReferences = true;\r\n while (possibleReferences) {\r\n possibleReferences = false;\r\n recursiveRefMap.forEach((toPointer, fromPointer) => {\r\n if (JsonPointer.isSubPointer(toPointer, fromPointer)) {\r\n while (JsonPointer.isSubPointer(fromPointer, genericPointer, true)) {\r\n genericPointer = JsonPointer.toGenericPointer(\r\n toPointer + genericPointer.slice(fromPointer.length), arrayMap\r\n );\r\n possibleReferences = true;\r\n }\r\n }\r\n });\r\n }\r\n return genericPointer;\r\n}\r\n\r\n/**\r\n * 'getInputType' function\r\n *\r\n * // schema\r\n * // { any = null } layoutNode\r\n * // { string }\r\n */\r\nexport function getInputType(schema, layoutNode: any = null) {\r\n // x-schema-form = Angular Schema Form compatibility\r\n // widget & component = React Jsonschema Form compatibility\r\n const controlType = JsonPointer.getFirst([\r\n [schema, '/x-schema-form/type'],\r\n [schema, '/x-schema-form/widget/component'],\r\n [schema, '/x-schema-form/widget'],\r\n [schema, '/widget/component'],\r\n [schema, '/widget']\r\n ]);\r\n if (isString(controlType)) { return checkInlineType(controlType, schema, layoutNode); }\r\n let schemaType = schema.type;\r\n if (schemaType) {\r\n if (isArray(schemaType)) { // If multiple types listed, use most inclusive type\r\n schemaType =\r\n inArray('object', schemaType) && hasOwn(schema, 'properties') ? 'object' :\r\n inArray('array', schemaType) && hasOwn(schema, 'items') ? 'array' :\r\n inArray('array', schemaType) && hasOwn(schema, 'additionalItems') ? 'array' :\r\n inArray('string', schemaType) ? 'string' :\r\n inArray('number', schemaType) ? 'number' :\r\n inArray('integer', schemaType) ? 'integer' :\r\n inArray('boolean', schemaType) ? 'boolean' : 'unknown';\r\n }\r\n if (schemaType === 'boolean') { return 'checkbox'; }\r\n if (schemaType === 'object') {\r\n if (hasOwn(schema, 'properties') || hasOwn(schema, 'additionalProperties')) {\r\n return 'section';\r\n }\r\n // TODO: Figure out how to handle additionalProperties\r\n if (hasOwn(schema, '$ref')) { return '$ref'; }\r\n }\r\n if (schemaType === 'array') {\r\n const itemsObject = JsonPointer.getFirst([\r\n [schema, '/items'],\r\n [schema, '/additionalItems']\r\n ]) || {};\r\n return hasOwn(itemsObject, 'enum') && schema.maxItems !== 1 ?\r\n checkInlineType('checkboxes', schema, layoutNode) : 'array';\r\n }\r\n if (schemaType === 'null') { return 'none'; }\r\n if (JsonPointer.has(layoutNode, '/options/titleMap') ||\r\n hasOwn(schema, 'enum') || getTitleMapFromOneOf(schema, null, true)\r\n ) { return 'select'; }\r\n if (schemaType === 'number' || schemaType === 'integer') {\r\n return (schemaType === 'integer' || hasOwn(schema, 'multipleOf')) &&\r\n hasOwn(schema, 'maximum') && hasOwn(schema, 'minimum') ? 'range' : schemaType;\r\n }\r\n if (schemaType === 'string') {\r\n return {\r\n 'color': 'color',\r\n 'date': 'date',\r\n //as per ajv date-time requires a timezone but input \r\n //datetime-local doesn't \r\n //'date-time': 'datetime-local',\r\n 'iso-date-time':'datetime-local',\r\n 'email': 'email',\r\n 'uri': 'url',\r\n }[schema.format] || 'text';\r\n }\r\n }\r\n if (hasOwn(schema, '$ref')) { return '$ref'; }\r\n //if (isArray(schema.anyOf)) { return 'any-of'; }//treated as allOf\r\n if (isArray(schema.oneOf) ) { return 'one-of'; }//{ return 'tabarray'; }\r\n if (hasOwn(schema, 'if')) { return 'if'; }\r\n if (hasOwn(schema, 'then')) { return 'then'; }\r\n if (hasOwn(schema, 'else')) { return 'else'; }\r\n console.error(`getInputType error: Unable to determine input type for ${schemaType}`);\r\n console.error('schema', schema);\r\n if (layoutNode) { console.error('layoutNode', layoutNode); }\r\n return 'none';\r\n}\r\n\r\n/**\r\n * 'checkInlineType' function\r\n *\r\n * Checks layout and schema nodes for 'inline: true', and converts\r\n * 'radios' or 'checkboxes' to 'radios-inline' or 'checkboxes-inline'\r\n *\r\n * // { string } controlType -\r\n * // schema -\r\n * // { any = null } layoutNode -\r\n * // { string }\r\n */\r\nexport function checkInlineType(controlType, schema, layoutNode: any = null) {\r\n if (!isString(controlType) || (\r\n controlType.slice(0, 8) !== 'checkbox' && controlType.slice(0, 5) !== 'radio'\r\n )) {\r\n return controlType;\r\n }\r\n if (\r\n JsonPointer.getFirst([\r\n [layoutNode, '/inline'],\r\n [layoutNode, '/options/inline'],\r\n [schema, '/inline'],\r\n [schema, '/x-schema-form/inline'],\r\n [schema, '/x-schema-form/options/inline'],\r\n [schema, '/x-schema-form/widget/inline'],\r\n [schema, '/x-schema-form/widget/component/inline'],\r\n [schema, '/x-schema-form/widget/component/options/inline'],\r\n [schema, '/widget/inline'],\r\n [schema, '/widget/component/inline'],\r\n [schema, '/widget/component/options/inline'],\r\n ]) === true\r\n ) {\r\n return controlType.slice(0, 5) === 'radio' ?\r\n 'radios-inline' : 'checkboxes-inline';\r\n } else {\r\n return controlType;\r\n }\r\n}\r\n\r\n/**\r\n * 'isInputRequired' function\r\n *\r\n * Checks a JSON Schema to see if an item is required\r\n *\r\n * // schema - the schema to check\r\n * // { string } schemaPointer - the pointer to the item to check\r\n * // { boolean } - true if the item is required, false if not\r\n */\r\nexport function isInputRequired(schema, schemaPointer) {\r\n if (!isObject(schema)) {\r\n console.error('isInputRequired error: Input schema must be an object.');\r\n return false;\r\n }\r\n const listPointerArray = JsonPointer.parse(schemaPointer);\r\n if (isArray(listPointerArray)) {\r\n if (!listPointerArray.length) { return schema.required === true; }\r\n const keyName = listPointerArray.pop();\r\n const nextToLastKey = listPointerArray[listPointerArray.length - 1];\r\n if (['properties', 'additionalProperties', 'patternProperties', 'items', 'additionalItems']\r\n .includes(nextToLastKey)\r\n ) {\r\n listPointerArray.pop();\r\n }\r\n const parentSchema = JsonPointer.get(schema, listPointerArray) || {};\r\n if (isArray(parentSchema.required)) {\r\n return parentSchema.required.includes(keyName);\r\n }\r\n if (parentSchema.type === 'array') {\r\n return hasOwn(parentSchema, 'minItems') &&\r\n isNumber(keyName) &&\r\n +parentSchema.minItems > +keyName;\r\n }\r\n }\r\n return false;\r\n}\r\n\r\n/**\r\n * 'updateInputOptions' function\r\n *\r\n * // layoutNode\r\n * // schema\r\n * // jsf\r\n * // { void }\r\n */\r\nexport function updateInputOptions(layoutNode, schema, jsf) {\r\n if (!isObject(layoutNode) || !isObject(layoutNode.options)) { return; }\r\n\r\n // Set all option values in layoutNode.options\r\n const newOptions: any = { };\r\n const fixUiKeys = key => key.slice(0, 3).toLowerCase() === 'ui:' ? key.slice(3) : key;\r\n mergeFilteredObject(newOptions, jsf.formOptions.defaultWidgetOptions, [], fixUiKeys);\r\n [ [ JsonPointer.get(schema, '/ui:widget/options'), [] ],\r\n [ JsonPointer.get(schema, '/ui:widget'), [] ],\r\n [ schema, [\r\n 'additionalProperties', 'additionalItems', 'properties', 'items',\r\n 'required', 'type', 'x-schema-form', '$ref'\r\n ] ],\r\n [ JsonPointer.get(schema, '/x-schema-form/options'), [] ],\r\n [ JsonPointer.get(schema, '/x-schema-form'), ['items', 'options'] ],\r\n [ layoutNode, [\r\n '_id', '$ref', 'arrayItem', 'arrayItemType', 'dataPointer', 'dataType',\r\n 'items', 'key', 'name', 'options', 'recursiveReference', 'type', 'widget'\r\n ] ],\r\n [ layoutNode.options, [] ],\r\n ].forEach(([ object, excludeKeys ]) =>\r\n mergeFilteredObject(newOptions, object, excludeKeys, fixUiKeys)\r\n );\r\n if (!hasOwn(newOptions, 'titleMap')) {\r\n let newTitleMap: any = null;\r\n newTitleMap = getTitleMapFromOneOf(schema, newOptions.flatList);\r\n if (newTitleMap) { newOptions.titleMap = newTitleMap; }\r\n if (!hasOwn(newOptions, 'titleMap') && !hasOwn(newOptions, 'enum') && hasOwn(schema, 'items')) {\r\n if (JsonPointer.has(schema, '/items/titleMap')) {\r\n newOptions.titleMap = schema.items.titleMap;\r\n } else if (JsonPointer.has(schema, '/items/enum')) {\r\n newOptions.enum = schema.items.enum;\r\n if (!hasOwn(newOptions, 'enumNames') && JsonPointer.has(schema, '/items/enumNames')) {\r\n newOptions.enumNames = schema.items.enumNames;\r\n }\r\n } else if (JsonPointer.has(schema, '/items/oneOf')) {\r\n newTitleMap = getTitleMapFromOneOf(schema.items, newOptions.flatList);\r\n if (newTitleMap) { newOptions.titleMap = newTitleMap; }\r\n }\r\n }\r\n }\r\n\r\n // If schema type is integer, enforce by setting multipleOf = 1\r\n if (schema.type === 'integer' && !hasValue(newOptions.multipleOf)) {\r\n newOptions.multipleOf = 1;\r\n }\r\n\r\n // Copy any typeahead word lists to options.typeahead.source\r\n if (JsonPointer.has(newOptions, '/autocomplete/source')) {\r\n newOptions.typeahead = newOptions.autocomplete;\r\n } else if (JsonPointer.has(newOptions, '/tagsinput/source')) {\r\n newOptions.typeahead = newOptions.tagsinput;\r\n } else if (JsonPointer.has(newOptions, '/tagsinput/typeahead/source')) {\r\n newOptions.typeahead = newOptions.tagsinput.typeahead;\r\n }\r\n\r\n layoutNode.options = newOptions;\r\n}\r\n\r\n/**\r\n * 'getTitleMapFromOneOf' function\r\n *\r\n * // { schema } schema\r\n * // { boolean = null } flatList\r\n * // { boolean = false } validateOnly\r\n * // { validators }\r\n */\r\nexport function getTitleMapFromOneOf(\r\n schema: any = {}, flatList: boolean = null, validateOnly = false\r\n) {\r\n let titleMap = null;\r\n const oneOf = schema.oneOf || schema.anyOf || null;\r\n if (isArray(oneOf) && oneOf.every(item => item.title)) {\r\n if (oneOf.every(item => isArray(item.enum) && item.enum.length === 1)) {\r\n if (validateOnly) { return true; }\r\n titleMap = oneOf.map(item => ({ name: item.title, value: item.enum[0] }));\r\n } else if (oneOf.every(item => item.const)) {\r\n if (validateOnly) { return true; }\r\n titleMap = oneOf.map(item => ({ name: item.title, value: item.const }));\r\n }\r\n\r\n // if flatList !== false and some items have colons, make grouped map\r\n if (flatList !== false && (titleMap || [])\r\n .filter(title => ((title || {}).name || '').indexOf(': ')).length > 1\r\n ) {\r\n\r\n // Split name on first colon to create grouped map (name -> group: name)\r\n const newTitleMap = titleMap.map(title => {\r\n const [group, name] = title.name.split(/: (.+)/);\r\n return group && name ? { ...title, group, name } : title;\r\n });\r\n\r\n // If flatList === true or at least one group has multiple items, use grouped map\r\n if (flatList === true || newTitleMap.some((title, index) => index &&\r\n hasOwn(title, 'group') && title.group === newTitleMap[index - 1].group\r\n )) {\r\n titleMap = newTitleMap;\r\n }\r\n }\r\n }\r\n return validateOnly ? false : titleMap;\r\n}\r\n\r\n/**\r\n * 'getControlValidators' function\r\n *\r\n * // schema\r\n * // { validators }\r\n */\r\nexport function getControlValidators(schema) {\r\n if (!isObject(schema)) { return null; }\r\n const validators: any = { };\r\n if (hasOwn(schema, 'type')) {\r\n switch (schema.type) {\r\n case 'string':\r\n forEach(['pattern', 'format', 'minLength', 'maxLength'], (prop) => {\r\n if (hasOwn(schema, prop)) { validators[prop] = [schema[prop]]; }\r\n });\r\n break;\r\n case 'number': case 'integer':\r\n forEach(['Minimum', 'Maximum'], (ucLimit) => {\r\n const eLimit = 'exclusive' + ucLimit;\r\n const limit = ucLimit.toLowerCase();\r\n if (hasOwn(schema, limit)) {\r\n const exclusive = hasOwn(schema, eLimit) && schema[eLimit] === true;\r\n validators[limit] = [schema[limit], exclusive];\r\n }\r\n });\r\n forEach(['multipleOf', 'type'], (prop) => {\r\n if (hasOwn(schema, prop)) { validators[prop] = [schema[prop]]; }\r\n });\r\n break;\r\n case 'object':\r\n forEach(['minProperties', 'maxProperties', 'dependencies'], (prop) => {\r\n if (hasOwn(schema, prop)) { validators[prop] = [schema[prop]]; }\r\n });\r\n break;\r\n case 'array':\r\n forEach(['minItems', 'maxItems', 'uniqueItems'], (prop) => {\r\n if (hasOwn(schema, prop)) { validators[prop] = [schema[prop]]; }\r\n });\r\n break;\r\n }\r\n }\r\n if (hasOwn(schema, 'enum')) { validators.enum = [schema.enum]; }\r\n return validators;\r\n}\r\n\r\n/**\r\n * 'resolveSchemaReferences' function\r\n *\r\n * Find all $ref links in schema and save links and referenced schemas in\r\n * schemaRefLibrary, schemaRecursiveRefMap, and dataRecursiveRefMap\r\n *\r\n * // schema\r\n * // schemaRefLibrary\r\n * // { Map<string, string> } schemaRecursiveRefMap\r\n * // { Map<string, string> } dataRecursiveRefMap\r\n * // { Map<string, number> } arrayMap\r\n * //\r\n */\r\nexport function resolveSchemaReferences(\r\n schema, schemaRefLibrary, schemaRecursiveRefMap, dataRecursiveRefMap, arrayMap\r\n) {\r\n if (!isObject(schema)) {\r\n console.error('resolveSchemaReferences error: schema must be an object.');\r\n return;\r\n }\r\n const refLinks = new Set<string>();\r\n const refMapSet = new Set<string>();\r\n const refMap = new Map<string, string>();\r\n const recursiveRefMap = new Map<string, string>();\r\n const refLibrary: any = {};\r\n\r\n // Search schema for all $ref links, and build full refLibrary\r\n JsonPointer.forEachDeep(schema, (subSchema, subSchemaPointer) => {\r\n if (hasOwn(subSchema, '$ref') && isString(subSchema['$ref'])) {\r\n const refPointer = JsonPointer.compile(subSchema['$ref']);\r\n refLinks.add(refPointer);\r\n refMapSet.add(subSchemaPointer + '~~' + refPointer);\r\n refMap.set(subSchemaPointer, refPointer);\r\n }\r\n });\r\n refLinks.forEach(ref => refLibrary[ref] = getSubSchema(schema, ref));\r\n\r\n // Follow all ref links and save in refMapSet,\r\n // to find any multi-link recursive refernces\r\n let checkRefLinks = true;\r\n while (checkRefLinks) {\r\n checkRefLinks = false;\r\n Array.from(refMap).forEach(([fromRef1, toRef1]) => Array.from(refMap)\r\n .filter(([fromRef2, toRef2]) =>\r\n JsonPointer.isSubPointer(toRef1, fromRef2, true) &&\r\n !JsonPointer.isSubPointer(toRef2, toRef1, true) &&\r\n !refMapSet.has(fromRef1 + fromRef2.slice(toRef1.length) + '~~' + toRef2)\r\n )\r\n .forEach(([fromRef2, toRef2]) => {\r\n refMapSet.add(fromRef1 + fromRef2.slice(toRef1.length) + '~~' + toRef2);\r\n checkRefLinks = true;\r\n })\r\n );\r\n }\r\n\r\n // Build full recursiveRefMap\r\n // First pass - save all internally recursive refs from refMapSet\r\n Array.from(refMapSet)\r\n .map(refLink => refLink.split('~~'))\r\n .filter(([fromRef, toRef]) => JsonPointer.isSubPointer(toRef, fromRef))\r\n .forEach(([fromRef, toRef]) => recursiveRefMap.set(fromRef, toRef));\r\n // Second pass - create recursive versions of any other refs that link to recursive refs\r\n Array.from(refMap)\r\n .filter(([fromRef1, toRef1]) => Array.from(recursiveRefMap.keys())\r\n .every(fromRef2 => !JsonPointer.isSubPointer(fromRef1, fromRef2, true))\r\n )\r\n .forEach(([fromRef1, toRef1]) => Array.from(recursiveRefMap)\r\n .filter(([fromRef2, toRef2]) =>\r\n !recursiveRefMap.has(fromRef1 + fromRef2.slice(toRef1.length)) &&\r\n JsonPointer.isSubPointer(toRef1, fromRef2, true) &&\r\n !JsonPointer.isSubPointer(toRef1, fromRef1, true)\r\n )\r\n .forEach(([fromRef2, toRef2]) => recursiveRefMap.set(\r\n fromRef1 + fromRef2.slice(toRef1.length),\r\n fromRef1 + toRef2.slice(toRef1.length)\r\n ))\r\n );\r\n\r\n // Create compiled schema by replacing all non-recursive $ref links with\r\n // thieir linked schemas and, where possible, combining schemas in allOf arrays.\r\n let compiledSchema = { ...schema };\r\n delete compiledSchema.definitions;\r\n compiledSchema =\r\n getSubSchema(compiledSchema, '', refLibrary, recursiveRefMap);\r\n\r\n // Make sure all remaining schema $refs are recursive, and build final\r\n // schemaRefLibrary, schemaRecursiveRefMap, dataRecursiveRefMap, & arrayMap\r\n JsonPointer.forEachDeep(compiledSchema, (subSchema, subSchemaPointer) => {\r\n if (isString(subSchema['$ref'])) {\r\n let refPointer = JsonPointer.compile(subSchema['$ref']);\r\n if (!JsonPointer.isSubPointer(refPointer, subSchemaPointer, true)) {\r\n refPointer = removeRecursiveReferences(subSchemaPointer, recursiveRefMap);\r\n JsonPointer.set(compiledSchema, subSchemaPointer, { $ref: `#${refPointer}` });\r\n }\r\n if (!hasOwn(schemaRefLibrary, 'refPointer')) {\r\n schemaRefLibrary[refPointer] = !refPointer.length ? compiledSchema :\r\n getSubSchema(compiledSchema, refPointer, schemaRefLibrary, recursiveRefMap);\r\n }\r\n if (!schemaRecursiveRefMap.has(subSchemaPointer)) {\r\n schemaRecursiveRefMap.set(subSchemaPointer, refPointer);\r\n }\r\n const fromDataRef = JsonPointer.toDataPointer(subSchemaPointer, compiledSchema);\r\n if (!dataRecursiveRefMap.has(fromDataRef)) {\r\n const toDataRef = JsonPointer.toDataPointer(refPointer, compiledSchema);\r\n dataRecursiveRefMap.set(fromDataRef, toDataRef);\r\n }\r\n }\r\n if (subSchema.type === 'array' &&\r\n (hasOwn(subSchema, 'items') || hasOwn(subSchema, 'additionalItems'))\r\n ) {\r\n const dataPointer = JsonPointer.toDataPointer(subSchemaPointer, compiledSchema);\r\n if (!arrayMap.has(dataPointer)) {\r\n const tupleItems = isArray(subSchema.items) ? subSchema.items.length : 0;\r\n arrayMap.set(dataPointer, tupleItems);\r\n }\r\n }\r\n }, true);\r\n return compiledSchema;\r\n}\r\n\r\n/**\r\n * 'getSubSchema' function\r\n *\r\n * // schema\r\n * // { Pointer } pointer\r\n * // { object } schemaRefLibrary\r\n * // { Map<string, string> } schemaRecursiveRefMap\r\n * // { string[] = [] } usedPointers\r\n * //\r\n */\r\nexport function getSubSchema(\r\n schema, pointer, schemaRefLibrary = null,\r\n schemaRecursiveRefMap: Map<string, string> = null, usedPointers: string[] = []\r\n) {\r\n if (!schemaRefLibrary || !schemaRecursiveRefMap) {\r\n return JsonPointer.getCopy(schema, pointer);\r\n }\r\n if (typeof pointer !== 'string') { pointer = JsonPointer.compile(pointer); }\r\n usedPointers = [ ...usedPointers, pointer ];\r\n let newSchema: any = null;\r\n if (pointer === '') {\r\n newSchema = cloneDeep(schema);\r\n } else {\r\n const shortPointer = removeRecursiveReferences(pointer, schemaRecursiveRefMap);\r\n if (shortPointer !== pointer) { usedPointers = [ ...usedPointers, shortPointer ]; }\r\n newSchema = JsonPointer.getFirstCopy([\r\n [schemaRefLibrary, [shortPointer]],\r\n [schema, pointer],\r\n [schema, shortPointer]\r\n ]);\r\n }\r\n return JsonPointer.forEachDeepCopy(newSchema, (subSchema, subPointer) => {\r\n if (isObject(subSchema)) {\r\n\r\n // Replace non-recursive $ref links with referenced schemas\r\n if (isString(subSchema.$ref)) {\r\n const refPointer = JsonPointer.compile(subSchema.$ref);\r\n if (refPointer.length && usedPointers.every(ptr =>\r\n !JsonPointer.isSubPointer(refPointer, ptr, true)\r\n )) {\r\n const refSchema = getSubSchema(\r\n schema, refPointer, schemaRefLibrary, schemaRecursiveRefMap, usedPointers\r\n );\r\n if (Object.keys(subSchema).length === 1) {\r\n return refSchema;\r\n } else {\r\n const extraKeys = { ...subSchema };\r\n delete extraKeys.$ref;\r\n return mergeSchemas(refSchema, extraKeys);\r\n }\r\n }\r\n }\r\n\r\n // TODO: Convert schemas with 'type' arrays to 'oneOf'\r\n\r\n // Combine allOf subSchemas\r\n if (isArray(subSchema.allOf)) { return combineAllOf(subSchema); }\r\n\r\n // Fix incorrectly placed array object required lists\r\n if (subSchema.type === 'array' && isArray(subSchema.required)) {\r\n return fixRequiredArrayProperties(subSchema);\r\n }\r\n }\r\n return subSchema;\r\n }, true, <string>pointer);\r\n}\r\n\r\n\r\nexport function omitKeys<T extends object>(objects: T[], keysToOmit: (keyof T)[]): Omit<T, keyof T>[] {\r\n return objects.map((obj) => omit(obj, keysToOmit));\r\n}\r\n\r\n\r\n\r\nexport function combineAllOfITE(schema){\r\n if(schema && schema.allOf){\r\n const allITE=schema.allOf.map(item=>{return item.if && {if:item.if}})\r\n }\r\n \r\n}\r\n\r\n/**\r\n * 'combineAllOf' function\r\n *\r\n * Attempt to convert an allOf schema object into\r\n * a non-allOf schema object with equivalent rules.\r\n *\r\n * // schema - allOf schema object\r\n * // - converted schema object\r\n */\r\nexport function combineAllOf(schema) {\r\n if (!isObject(schema) || !isArray(schema.allOf)) { return schema; }\r\n const allITE=schema.allOf.map(item=>{return item.if && item})\r\n .filter(item => !isEmpty(item));\r\n //adaped to accomodate ITE by merging all non ITE field\r\n //then readding the allOf key with only ITE\r\n let schemaITEOmitted=omitKeys(schema.allOf,['if','then','else']);\r\n let mergedSchema = mergeSchemas(...schemaITEOmitted);\r\n //mergeSchemas(...schema.allOf);\r\n if (Object.keys(schema).length > 1) {\r\n const extraKeys = { ...schema };\r\n delete extraKeys.allOf;\r\n //TODO Test-changed order to preserve originial order\r\n mergedSchema = mergeSchemas(extraKeys,mergedSchema);\r\n //mergeSchemas(mergedSchema, extraKeys);\r\n //need to put it back if ITE \r\n if(allITE && allITE.length>0){\r\n mergedSchema.allOf=mergedSchema.allOf||[];\r\n mergedSchema.allOf.push(...allITE);\r\n }\r\n }\r\n return mergedSchema;\r\n}\r\n\r\n/**\r\n * 'fixRequiredArrayProperties' function\r\n *\r\n * Fixes an incorrectly placed required list inside an array schema, by moving\r\n * it into items.properties or additionalItems.properties, where it belongs.\r\n *\r\n * // schema - allOf schema object\r\n * // - converted schema object\r\n */\r\nexport function fixRequiredArrayProperties(schema) {\r\n if (schema.type === 'array' && isArray(schema.required)) {\r\n const itemsObject = hasOwn(schema.items, 'properties') ? 'items' :\r\n hasOwn(schema.additionalItems, 'properties') ? 'additionalItems' : null;\r\n if (itemsObject && !hasOwn(schema[itemsObject], 'required') && (\r\n hasOwn(schema[itemsObject], 'additionalProperties') ||\r\n schema.required.every(key => hasOwn(schema[itemsObject].properties, key))\r\n )) {\r\n schema = cloneDeep(schema);\r\n schema[itemsObject].required = schema.required;\r\n delete schema.required;\r\n }\r\n }\r\n return schema;\r\n}\r\n\r\n /**\r\n * 'convertJSONSchemaIfToCondition' function\r\n * converts something like \r\n * \"if\": {\r\n * \"properties\": {\r\n * \"animal\": {\r\n * \"const\": \"Cat\"\r\n * },\r\n * \"habitat\":{\r\n * \"const\": \"City\"\r\n * }\r\n * }\r\n * }\r\n * to \"model.animal=='Cat' && habitat=='City\" contion\r\n * @param schema:any \r\n * @param negate:boolean=false\r\n * @returns \r\n */\r\n //TODO also handle ifs with mixed conditional such as allOf/oneOf etc\r\n /*\r\n\r\n \"if\": {\r\n \"allOf\": [\r\n {\r\n \"properties\": {\r\n \"animalType\": {\r\n \"enum\": [\"Cat\", \"Fish\"]\r\n }\r\n }\r\n },\r\n {\r\n \"properties\": {\r\n \"color\": {\r\n \"const\": \"orange\"\r\n }\r\n }\r\n }\r\n ]\r\n }\r\n\r\n\r\n\r\n */\r\nexport function convertJSONSchemaIfToCondition(schema:any,layoutNode:any,negate=false){\r\n let conditionFun=\"\";\r\n let condition={};\r\n let notOp=negate?\"!\":\"\";\r\n // expects \"dataPointer\" to be like \"/a/b/c\"\r\n //TODO-test\r\n //dataPointer can be something like /cities/-/name\r\n //must end up like model.cities[arrayIndices].name\r\n //also check can possibly be nested array like /cities/-/sites/-/siteName\r\n //in this case must probably end up like \r\n // /cities/arrayIndices[0]/sites/arrayIndices[1]/siteName\r\n //but it seems evaluatCondition support only one level for now\r\n //and uses arrayIndices as the last index only -check?\r\n let parentPath=layoutNode.dataPointer?layoutNode.dataPointer\r\n .split(\"/\")\r\n .slice(1,-1)\r\n .map((part,ind)=>{\r\n let sep=ind==0?\"\":\".\";\r\n let ret=part==\"-\"?\"[arrayIndices]\":sep+part;\r\n return ret;\r\n })\r\n .join(\"\")\r\n :\"\";\r\n let modelPath=parentPath?`model.${parentPath}`:\"model\";\r\n let checkPath=modelPath.split('.')\r\n .map((_, index, array) => {\r\n return array.slice(0, index + 1).join('.'); // Build each part of the path dynamically\r\n }).join(' && '); // Join the parts with '&&'\r\n \r\n // .reduce((accumulator, currentPart, index) => {\r\n // const currentExpression = index === 0 ? currentPart : `${accumulator}.${currentPart}`;\r\n // return index === 0 ? currentExpression : `${accumulator} && ${currentExpression}`;\r\n // }, '');\r\n if(schema.if){\r\n Object.keys(schema.if.properties).forEach((ifProp,ind)=>{\r\n let amper=ind>0?\"&\":\"\";\r\n //Note the model value is first converted to string and so is the condition\r\n //so that booleans and numbers can also be compared \r\n //changed to an includesList to handle cases such as \r\n const includesList=hasOwn(schema.if.properties[ifProp],\"const\")?[schema.if.properties[ifProp].const]\r\n :hasOwn(schema.if.properties[ifProp],\"enum\")?schema.if.properties[ifProp].enum\r\n :[]\r\n const includesListAsStr=includesList.map(val=>{return `\"${val}\"`});\r\n conditionFun+=`${amper} ${checkPath} && [${includesListAsStr}].includes(${modelPath}.${ifProp}+\"\")`\r\n //conditionFun+=`${amper} ${checkPath} && ${modelPath}.${ifProp}+\"\"=='${schema.if.properties[ifProp].const}'`\r\n })\r\n }\r\n condition[\"functionBody\"]=`return ${notOp}(${conditionFun})`\r\n return condition;\r\n }","import cloneDeep from 'lodash/cloneDeep';\r\n\r\n/**\r\n * 'convertSchemaToDraft6' function\r\n *\r\n * Converts a JSON Schema from draft 1 through 4 format to draft 6 format\r\n *\r\n * Inspired by on geraintluff's JSON Schema 3 to 4 compatibility function:\r\n * https://github.com/geraintluff/json-schema-compatibility\r\n * Also uses suggestions from AJV's JSON Schema 4 to 6 migration guide:\r\n * https://github.com/epoberezkin/ajv/releases/tag/5.0.0\r\n * And additional details from the official JSON Schema documentation:\r\n * http://json-schema.org\r\n *\r\n * // { object } originalSchema - JSON schema (draft 1, 2, 3, 4, or 6)\r\n * // { OptionObject = {} } options - options: parent schema changed?, schema draft number?\r\n * // { object } - JSON schema (draft 6)\r\n */\r\nexport interface OptionObject { changed?: boolean; draft?: number; }\r\nexport function convertSchemaToDraft6(schema, options: OptionObject = {}) {\r\n let draft: number = options.draft || null;\r\n let changed: boolean = options.changed || false;\r\n\r\n if (typeof schema !== 'object') { return schema; }\r\n if (typeof schema.map === 'function') {\r\n return [...schema.map(subSchema => convertSchemaToDraft6(subSchema, { changed, draft }))];\r\n }\r\n let newSchema = { ...schema };\r\n const simpleTypes = ['array', 'boolean', 'integer', 'null', 'number', 'object', 'string'];\r\n\r\n if (typeof newSchema.$schema === 'string' &&\r\n /http\\:\\/\\/json\\-schema\\.org\\/draft\\-0\\d\\/schema\\#/.test(newSchema.$schema)\r\n ) {\r\n draft = newSchema.$schema[30];\r\n }\r\n\r\n // Convert v1-v2 'contentEncoding' to 'media.binaryEncoding'\r\n // Note: This is only used in JSON hyper-schema (not regular JSON schema)\r\n if (newSchema.contentEncoding) {\r\n newSchema.media = { binaryEncoding: newSchema.contentEncoding };\r\n delete newSchema.contentEncoding;\r\n changed = true;\r\n }\r\n\r\n // Convert v1-v3 'extends' to 'allOf'\r\n if (typeof newSchema.extends === 'object') {\r\n newSchema.allOf = typeof newSchema.extends.map === 'function' ?\r\n newSchema.extends.map(subSchema => convertSchemaToDraft6(subSchema, { changed, draft })) :\r\n [convertSchemaToDraft6(newSchema.extends, { changed, draft })];\r\n delete newSchema.extends;\r\n changed = true;\r\n }\r\n\r\n // Convert v1-v3 'disallow' to 'not'\r\n if (newSchema.disallow) {\r\n if (typeof newSchema.disallow === 'string') {\r\n newSchema.not = { type: newSchema.disallow };\r\n } else if (typeof newSchema.disallow.map === 'function') {\r\n newSchema.not = {\r\n anyOf: newSchema.disallow\r\n .map(type => typeof type === 'object' ? type : { type })\r\n };\r\n }\r\n delete newSchema.disallow;\r\n changed = true;\r\n }\r\n\r\n // Convert v3 string 'dependencies' properties to arrays\r\n if (typeof newSchema.dependencies === 'object' &&\r\n Object.keys(newSchema.dependencies)\r\n .some(key => typeof newSchema.dependencies[key] === 'string')\r\n ) {\r\n newSchema.dependencies = { ...newSchema.dependencies };\r\n Object.keys(newSchema.dependencies)\r\n .filter(key => typeof newSchema.dependencies[key] === 'string')\r\n .forEach(key => newSchema.dependencies[key] = [newSchema.dependencies[key]]);\r\n changed = true;\r\n }\r\n\r\n // Convert v1 'maxDecimal' to 'multipleOf'\r\n if (typeof newSchema.maxDecimal === 'number') {\r\n newSchema.multipleOf = 1 / Math.pow(10, newSchema.maxDecimal);\r\n delete newSchema.divisibleBy;\r\n changed = true;\r\n if (!draft || draft === 2) { draft = 1; }\r\n }\r\n\r\n // Convert v2-v3 'divisibleBy' to 'multipleOf'\r\n if (typeof newSchema.divisibleBy === 'number') {\r\n newSchema.multipleOf = newSchema.divisibleBy;\r\n delete newSchema.divisibleBy;\r\n changed = true;\r\n }\r\n\r\n // Convert v1-v2 boolean 'minimumCanEqual' to 'exclusiveMinimum'\r\n if (typeof newSchema.minimum === 'number' && newSchema.minimumCanEqual === false) {\r\n newSchema.exclusiveMinimum = newSchema.minimum;\r\n delete newSchema.minimum;\r\n changed = true;\r\n if (!draft) { draft = 2; }\r\n } else if (typeof newSchema.minimumCanEqual === 'boolean') {\r\n delete newSchema.minimumCanEqual;\r\n changed = true;\r\n if (!draft) { draft = 2; }\r\n }\r\n\r\n // Convert v3-v4 boolean 'exclusiveMinimum' to numeric\r\n if (typeof newSchema.minimum === 'number' && newSchema.exclusiveMinimum === true) {\r\n newSchema.exclusiveMinimum = newSchema.minimum;\r\n delete newSchema.minimum;\r\n changed = true;\r\n } else if (typeof newSchema.exclusiveMinimum === 'boolean') {\r\n delete newSchema.exclusiveMinimum;\r\n changed = true;\r\n }\r\n\r\n // Convert v1-v2 boolean 'maximumCanEqual' to 'exclusiveMaximum'\r\n if (typeof newSchema.maximum === 'number' && newSchema.maximumCanEqual === false) {\r\n newSchema.exclusiveMaximum = newSchema.maximum;\r\n delete newSchema.maximum;\r\n changed = true;\r\n if (!draft) { draft = 2; }\r\n } else if (typeof newSchema.maximumCanEqual === 'boolean') {\r\n delete newSchema.maximumCanEqual;\r\n changed = true;\r\n if (!draft) { draft = 2; }\r\n }\r\n\r\n // Convert v3-v4 boolean 'exclusiveMaximum' to numeric\r\n if (typeof newSchema.maximum === 'number' && newSchema.exclusiveMaximum === true) {\r\n newSchema.exclusiveMaximum = newSchema.maximum;\r\n delete newSchema.maximum;\r\n changed = true;\r\n } else if (typeof newSchema.exclusiveMaximum === 'boolean') {\r\n delete newSchema.exclusiveMaximum;\r\n changed = true;\r\n }\r\n\r\n // Search object 'properties' for 'optional', 'required', and 'requires' items,\r\n // and convert them into object 'required' arrays and 'dependencies' objects\r\n if (typeof newSchema.properties === 'object') {\r\n const properties = { ...newSchema.properties };\r\n const requiredKeys = Array.isArray(newSchema.required) ?\r\n new Set(newSchema.required) : new Set();\r\n\r\n // Convert v1-v2 boolean 'optional' properties to 'required' array\r\n if (draft === 1 || draft === 2 ||\r\n Object.keys(properties).some(key => properties[key].optional === true)\r\n ) {\r\n Object.keys(properties)\r\n .filter(key => properties[key].optional !== true)\r\n .forEach(key => requiredKeys.add(key));\r\n changed = true;\r\n if (!draft) { draft = 2; }\r\n }\r\n\r\n // Convert v3 boolean 'required' properties to 'required' array\r\n if (Object.keys(properties).some(key => properties[key].required === true)) {\r\n Object.keys(properties)\r\n .filter(key => properties[key].required === true)\r\n .forEach(key => requiredKeys.add(key));\r\n changed = true;\r\n }\r\n\r\n if (requiredKeys.size) { newSchema.required = Array.from(requiredKeys); }\r\n\r\n // Convert v1-v2 array or string 'requires' properties to 'dependencies' object\r\n if (Object.keys(properties).some(key => properties[key].requires)) {\r\n const dependencies = typeof newSchema.dependencies === 'object' ?\r\n { ...newSchema.dependencies } : {};\r\n Object.keys(properties)\r\n .filter(key => properties[key].requires)\r\n .forEach(key => dependencies[key] =\r\n typeof properties[key].requires === 'string' ?\r\n [properties[key].requires] : properties[key].requires\r\n );\r\n newSchema.dependencies = dependencies;\r\n changed = true;\r\n if (!draft) { draft = 2; }\r\n }\r\n\r\n newSchema.properties = properties;\r\n }\r\n\r\n // Revove v1-v2 boolean 'optional' key\r\n if (typeof newSchema.optional === 'boolean') {\r\n delete newSchema.optional;\r\n changed = true;\r\n if (!draft) { draft = 2; }\r\n }\r\n\r\n // Revove v1-v2 'requires' key\r\n if (newSchema.requires) {\r\n delete newSchema.requires;\r\n }\r\n\r\n // Revove v3 boolean 'required' key\r\n if (typeof newSchema.required === 'boolean') {\r\n delete newSchema.required;\r\n }\r\n\r\n // Convert id to $id\r\n if (typeof newSchema.id === 'string' && !newSchema.$id) {\r\n if (newSchema.id.slice(-1) === '#') {\r\n newSchema.id = newSchema.id.slice(0, -1);\r\n }\r\n newSchema.$id = newSchema.id + '-CONVERTED-TO-DRAFT-06#';\r\n delete newSchema.id;\r\n changed = true;\r\n }\r\n\r\n // Check if v1-v3 'any' or object types will be converted\r\n if (newSchema.type && (typeof newSchema.type.every === 'function' ?\r\n !newSchema.type.every(type => simpleTypes.includes(type)) :\r\n !simpleTypes.includes(newSchema.type)\r\n )) {\r\n changed = true;\r\n }\r\n\r\n // If schema changed, update or remove $schema identifier\r\n if (typeof newSchema.$schema === 'string' &&\r\n /http\\:\\/\\/json\\-schema\\.org\\/draft\\-0[1-4]\\/schema\\#/.test(newSchema.$schema)\r\n ) {\r\n newSchema.$schema = 'http://json-schema.org/draft-06/schema#';\r\n changed = true;\r\n } else if (changed && typeof newSchema.$schema === 'string') {\r\n const addToDescription = 'Converted to draft 6 from ' + newSchema.$schema;\r\n if (typeof newSchema.description === 'string' && newSchema.description.length) {\r\n newSchema.description += '\\n' + addToDescription;\r\n } else {\r\n newSchema.description = addToDescription;\r\n }\r\n delete newSchema.$schema;\r\n }\r\n\r\n // Convert v1-v3 'any' and object types\r\n if (newSchema.type && (typeof newSchema.type.every === 'function' ?\r\n !newSchema.type.every(type => simpleTypes.includes(type)) :\r\n !simpleTypes.includes(newSchema.type)\r\n )) {\r\n if (newSchema.type.length === 1) { newSchema.type = newSchema.type[0]; }\r\n if (typeof newSchema.type === 'string') {\r\n // Convert string 'any' type to array of all standard types\r\n if (newSchema.type === 'any') {\r\n newSchema.type = simpleTypes;\r\n // Delete non-standard string type\r\n } else {\r\n delete newSchema.type;\r\n }\r\n } else if (typeof newSchema.type === 'object') {\r\n if (typeof newSchema.type.every === 'function') {\r\n // If array of strings, only allow standard types\r\n if (newSchema.type.every(type => typeof type === 'string')) {\r\n newSchema.type = newSchema.type.some(type => type === 'any') ?\r\n newSchema.type = simpleTypes :\r\n newSchema.type.filter(type => simpleTypes.includes(type));\r\n // If type is an array with objects, convert the current schema to an 'anyOf' array\r\n } else if (newSchema.type.length > 1) {\r\n const arrayKeys = ['additionalItems', 'items', 'maxItems', 'minItems', 'uniqueItems', 'contains'];\r\n const numberKeys = ['multipleOf', 'maximum', 'exclusiveMaximum', 'minimum', 'exclusiveMinimum'];\r\n const objectKeys = ['maxProperties', 'minProperties', 'required', 'additionalProperties',\r\n 'properties', 'patternProperties', 'dependencies', 'propertyNames'];\r\n const stringKeys = ['maxLength', 'minLength', 'pattern', 'format'];\r\n const filterKeys = {\r\n 'array': [...numberKeys, ...objectKeys, ...stringKeys],\r\n 'integer': [...arrayKeys, ...objectKeys, ...stringKeys],\r\n 'number': [...arrayKeys, ...objectKeys, ...stringKeys],\r\n 'object': [...arrayKeys, ...numberKeys, ...stringKeys],\r\n 'string': [...arrayKeys, ...numberKeys, ...objectKeys],\r\n 'all': [...arrayKeys, ...numberKeys, ...objectKeys, ...stringKeys],\r\n };\r\n const anyOf = [];\r\n for (const type of newSchema.type) {\r\n const newType = typeof type === 'string' ? { type } : { ...type };\r\n Object.keys(newSchema)\r\n .filter(key => !newType.hasOwnProperty(key) &&\r\n ![...(filterKeys[newType.type] || filterKeys.all), 'type', 'default']\r\n .includes(key)\r\n )\r\n .forEach(key => newType[key] = newSchema[key]);\r\n anyOf.push(newType);\r\n }\r\n newSchema = newSchema.hasOwnProperty('default') ?\r\n { anyOf, default: newSchema.default } : { anyOf };\r\n // If type is an object, merge it with the current schema\r\n } else {\r\n const typeSchema = newSchema.type;\r\n delete newSchema.type;\r\n Object.assign(newSchema, typeSchema);\r\n }\r\n }\r\n } else {\r\n delete newSchema.type;\r\n }\r\n }\r\n\r\n // Convert sub schemas\r\n Object.keys(newSchema)\r\n .filter(key => typeof newSchema[key] === 'object')\r\n .forEach(key => {\r\n if (\r\n ['definitions', 'dependencies', 'properties', 'patternProperties']\r\n .includes(key) && typeof newSchema[key].map !== 'function'\r\n ) {\r\n const newKey = {};\r\n Object.keys(newSchema[key]).forEach(subKey => newKey[subKey] =\r\n convertSchemaToDraft6(newSchema[key][subKey], { changed, draft })\r\n );\r\n newSchema[key] = newKey;\r\n } else if (\r\n ['items', 'additionalItems', 'additionalProperties',\r\n 'allOf', 'anyOf', 'oneOf', 'not'].includes(key)\r\n ) {\r\n newSchema[key] = convertSchemaToDraft6(newSchema[key], { changed, draft });\r\n } else {\r\n newSchema[key] = cloneDeep(newSchema[key]);\r\n }\r\n });\r\n\r\n return newSchema;\r\n}\r\n","import {\r\n AbstractControl,\r\n UntypedFormArray,\r\n UntypedFormControl,\r\n UntypedFormGroup,\r\n ValidatorFn\r\n} from '@angular/forms';\r\nimport cloneDeep from 'lodash/cloneDeep';\r\nimport filter from 'lodash/filter';\r\nimport map from 'lodash/map';\r\nimport { getControlValidators, removeRecursiveReferences } from './json-schema.functions';\r\nimport { JsonValidators } from './json.validators';\r\nimport { JsonPointer, Pointer } from './jsonpointer.functions';\r\nimport { forEach, hasOwn } from './utility.functions';\r\nimport {\r\n SchemaPrimitiveType,\r\n hasValue,\r\n inArray,\r\n isArray,\r\n isDate,\r\n isDefined,\r\n isEmpty,\r\n isObject,\r\n isPrimitive,\r\n toJavaScriptType,\r\n toSchemaType\r\n} from './validator.functions';\r\n\r\n/**\r\n * path2ControlKey takes a datapointer path like /some/pointer/path\r\n * and returns something like $some$pointer$path\r\n * used mainly to convert paths so it can be used as keys in FormGroups\r\n * fot ITE scenarios\r\n * @param path \r\n * @returns string\r\n */\r\nexport function path2ControlKey(path: string) {\r\n return path.replace(/\\//g, \"$\")\r\n}\r\n\r\n\r\n/**\r\n * FormGroup function library:\r\n *\r\n * buildFormGroupTemplate: Builds a FormGroupTemplate from schema\r\n *\r\n * buildFormGroup: Builds an Angular FormGroup from a FormGroupTemplate\r\n *\r\n * mergeValues:\r\n *\r\n * setRequiredFields:\r\n *\r\n * formatFormData:\r\n *\r\n * getControl:\r\n *\r\n * ---- TODO: ----\r\n * TODO: add buildFormGroupTemplateFromLayout function\r\n * buildFormGroupTemplateFromLayout: Builds a FormGroupTemplate from a form layout\r\n */\r\n\r\n/**\r\n * 'buildFormGroupTemplate' function\r\n *\r\n * Builds a template for an Angular FormGroup from a JSON Schema.\r\n *\r\n * TODO: add support for pattern properties\r\n * https://spacetelescope.github.io/understanding-json-schema/reference/object.html\r\n *\r\n * // {any} jsf -\r\n * // {any = null} nodeValue -\r\n * // {boolean = true} mapArrays -\r\n * // {string = ''} schemaPointer -\r\n * // {string = ''} dataPointer -\r\n * // {any = ''} templatePointer -\r\n * // {any} -\r\n */\r\n\r\nexport function buildFormGroupTemplate(\r\n jsf: any, nodeValue: any = null, setValues = true,\r\n schemaPointer = '', dataPointer = '', templatePointer = ''\r\n) {\r\n const schema = JsonPointer.get(jsf.schema, schemaPointer);\r\n if (setValues) {\r\n if (!isDefined(nodeValue) && (\r\n jsf.formOptions.setSchemaDefaults === true ||\r\n (jsf.formOptions.setSchemaDefaults === 'auto' && isEmpty(jsf.formValues))\r\n )) {\r\n nodeValue = JsonPointer.get(jsf.schema, schemaPointer + '/default');\r\n }\r\n } else {\r\n nodeValue = null;\r\n }\r\n // TODO: If nodeValue still not set, check layout for default value\r\n const schemaType: string | string[] = JsonPointer.get(schema, '/type');\r\n const isIfThenElse = hasOwn(schema, 'if') || hasOwn(schema, 'then') || hasOwn(schema, 'else');\r\n const controlType = isIfThenElse && !schemaType ? 'IfThenElse' :\r\n (hasOwn(schema, 'properties') || hasOwn(schema, 'additionalProperties')\r\n\r\n ) &&\r\n schemaType === 'object' ? 'FormGroup' :\r\n (hasOwn(schema, 'items') || hasOwn(schema, 'additionalItems')) &&\r\n schemaType === 'array' ? 'FormArray' :\r\n !schemaType && hasOwn(schema, '$ref') ? '$ref' : 'FormControl';\r\n const shortDataPointer =\r\n removeRecursiveReferences(dataPointer, jsf.dataRecursiveRefMap, jsf.arrayMap);\r\n if (!jsf.dataMap.has(shortDataPointer)) {\r\n jsf.dataMap.set(shortDataPointer, new Map());\r\n }\r\n const nodeOptions = jsf.dataMap.get(shortDataPointer);\r\n if (!nodeOptions.has('schemaType')) {\r\n nodeOptions.set('schemaPointer', schemaPointer);\r\n nodeOptions.set('schemaType', schema.type);\r\n if (schema.format) {\r\n nodeOptions.set('schemaFormat', schema.format);\r\n if (!schema.type) { nodeOptions.set('schemaType', 'string'); }\r\n }\r\n if (controlType) {\r\n nodeOptions.set('templatePointer', templatePointer);\r\n nodeOptions.set('templateType', controlType);\r\n }\r\n }\r\n let controls: any;\r\n const validators = getControlValidators(schema);\r\n switch (controlType) {\r\n\r\n case 'FormGroup':\r\n controls = {};\r\n if (hasOwn(schema, 'ui:order') || hasOwn(schema, 'properties')) {\r\n const propertyKeys = schema['ui:order'] || Object.keys(schema.properties);\r\n if (propertyKeys.includes('*') && !hasOwn(schema.properties, '*')) {\r\n const unnamedKeys = Object.keys(schema.properties)\r\n .filter(key => !propertyKeys.includes(key));\r\n for (let i = propertyKeys.length - 1; i >= 0; i--) {\r\n if (propertyKeys[i] === '*') {\r\n propertyKeys.splice(i, 1, ...unnamedKeys);\r\n }\r\n }\r\n }\r\n propertyKeys\r\n .filter(key => hasOwn(schema.properties, key) ||\r\n hasOwn(schema, 'additionalProperties')\r\n )\r\n .forEach(key => {\r\n controls[key] = buildFormGroupTemplate(\r\n jsf, JsonPointer.get(nodeValue, [<string>key]), setValues,\r\n schemaPointer + (hasOwn(schema.properties, key) ?\r\n '/properties/' + key : '/additionalProperties'\r\n ),\r\n dataPointer + '/' + key,\r\n templatePointer + '/controls/' + key\r\n );\r\n //add the $<control> type to the root\r\n //so it can be flattened and acceses directly in the formgroup\r\n //by its full '$' path\r\n [\"allOf\", \"anyOf\",\"oneOf\"].forEach(ofType => {\r\n if(controls[key].controls && controls[key].controls[`_${ofType}`]){\r\n Object.keys(controls[key].controls[`_${ofType}`]).forEach($key=>{\r\n controls[$key]=controls[key].controls[`_${ofType}`][$key];\r\n delete controls[key].controls[$key];\r\n })\r\n delete controls[key].controls[`_${ofType}`]\r\n }\r\n })\r\n } \r\n );\r\n\r\n if (hasOwn(schema, \"if\")) {\r\n [\"then\", \"else\"].forEach(con => {\r\n if (hasOwn(schema, con)) {\r\n const keySchemaPointer = `/${con}`;\r\n\r\n let thenFGTemplate = buildFormGroupTemplate(\r\n jsf, nodeValue, setValues,//false,//JsonPointer.get(nodeValue, keySchemaPointer), setValues,\r\n schemaPointer + keySchemaPointer,\r\n dataPointer,\r\n templatePointer + `/controls/${con}`\r\n );\r\n Object.assign(controls, thenFGTemplate.controls);\r\n }\r\n });\r\n }\r\n\r\n /* treat allOf the same as any of but need to add an extra\r\n condition for which anyOf item is to be rendered \r\n let allOfControls = {}\r\n let allOfAllowedKeys = [\"allOf\", \"anyOf\", \"oneOf\", \"if\", \"then\", \"else\", \"type\", \"properties\", \"items\"];\r\n if (hasOwn(schema, \"allOf\") && isArray(schema.allOf)) {\r\n schema.allOf.forEach((allOfItem, ind) => {\r\n let aoItemKeys = Object.keys(allOfItem);\r\n let foundKeys = allOfAllowedKeys.filter(value =>\r\n aoItemKeys.includes(value)\r\n );\r\n if (foundKeys && foundKeys.length > 0) {\r\n const keySchemaPointer = `/allOf/${ind}`;\r\n //console.log(`found:${keySchemaPointer}`);\r\n let allOfFGTemplate = buildFormGroupTemplate(\r\n jsf, JsonPointer.get(nodeValue, keySchemaPointer), setValues,\r\n schemaPointer + keySchemaPointer,\r\n dataPointer,\r\n templatePointer + '/controls/' + ind\r\n );\r\n if (allOfFGTemplate.controls) {\r\n Object.keys(allOfFGTemplate.controls).forEach(key => {\r\n let controlKey = allOfFGTemplate.controls[key].schemaPointer || `${schemaPointer}${keySchemaPointer}/${key}`;\r\n controlKey = path2ControlKey(controlKey);\r\n controls[controlKey] = {\r\n key: key,\r\n schemaPointer: schemaPointer + keySchemaPointer,\r\n controls: allOfFGTemplate.controls[key]\r\n }\r\n controls[controlKey] = allOfFGTemplate.controls[key];\r\n controls[controlKey].key = key;\r\n controls[controlKey].schemaPointer = allOfFGTemplate.controls[key].schemaPointer || schemaPointer + keySchemaPointer;\r\n\r\n controls[key] = allOfFGTemplate.controls[key];\r\n })\r\n }\r\n //add ui type items to controls\r\n if (allOfItem[\"type\"] || allOfItem[\"properties\"] || allOfItem[\"items\"]) {\r\n allOfControls[ind] = allOfFGTemplate\r\n }\r\n\r\n }\r\n\r\n })\r\n controls[\"allOf\"] = allOfControls;\r\n }\r\n */\r\n\r\n\r\n let ofAllowedKeys = [\"allOf\", \"anyOf\", \"oneOf\", \"if\", \"then\", \"else\", \"type\", \"properties\", \"items\"];\r\n [\"allOf\", \"anyOf\",\"oneOf\"].forEach(ofType => {\r\n if (hasOwn(schema, ofType) && isArray(schema[ofType])) {\r\n schema[ofType].forEach((ofItem, ind) => {\r\n let aoItemKeys = Object.keys(ofItem);\r\n let foundKeys = ofAllowedKeys.filter(value =>\r\n aoItemKeys.includes(value)\r\n );\r\n if (foundKeys && foundKeys.length > 0) {\r\n const keySchemaPointer = `/${ofType}/${ind}`;\r\n //console.log(`found:${keySchemaPointer}`);\r\n let newNodeValue=nodeValue;\r\n //JsonPointer.get(nodeValue, dataPointer);\r\n //JsonPointer.get(nodeValue, keySchemaPointer);\r\n if(ofType==\"oneOf\"){\r\n newNodeValue=nodeValue;\r\n }\r\n let allOfFGTemplate = buildFormGroupTemplate(\r\n jsf, newNodeValue, setValues,\r\n schemaPointer + keySchemaPointer,\r\n dataPointer,\r\n templatePointer + '/controls/' + ind\r\n );\r\n if (allOfFGTemplate.controls) {\r\n Object.keys(allOfFGTemplate.controls).forEach(key => {\r\n const l2SchemaPointer = hasOwn(schema,'properties') ?\r\n '/properties/' +key:key;\r\n let controlKey = allOfFGTemplate.controls[key].schemaPointer || `${schemaPointer}${keySchemaPointer}${l2SchemaPointer}`;\r\n controlKey = path2ControlKey(controlKey);\r\n /*\r\n controls[controlKey] = {\r\n key: key,\r\n schemaPointer: `${schemaPointer}${keySchemaPointer}/${key}`,//schemaPointer + keySchemaPointer,\r\n controls: allOfFGTemplate.controls[key]\r\n }\r\n */\r\n \r\n let controlItem=cloneDeep(allOfFGTemplate.controls[key]);\r\n controlItem.key = key;\r\n controlItem.schemaPointer = controlItem.schemaPointer|| `${schemaPointer}${keySchemaPointer}${l2SchemaPointer}`;\r\n \r\n controls[controlKey]=controlItem\r\n //need to test if value matches schema,\r\n //as the same oneOf item will be assigned to the same value\r\n //if key is a $oneOf key then it was inserted at the root of the controls\r\n //as form control name will be the full(escaped) path \r\n const pointerPath=key.startsWith('$oneOf')?controlItem.schemaPointer:keySchemaPointer\r\n let oneOfItemSchema=JsonPointer.get(jsf.schema,controlItem.schemaPointer);\r\n //JsonPointer.get(schema,pointerPath);\r\n let dPointer= controlItem.schemaPointer.replace(/(anyOf|allOf|oneOf|none)\\/[\\d]+\\//g, '')\r\n .replace(/(if|then|else|properties)\\//g, '').replace(/\\/items\\//g,'/-/');\r\n dPointer=dPointer.indexOf(dataPointer)==0\r\n ?dPointer.substring(dataPointer.length):dPointer;\r\n //dataPointer+\"/\"+controlItem.schemaPointer.split(\"/\").slice(-1)[0];\r\n ////controlItem.schemaPointer.replace(/(anyOf|allOf|oneOf|none)\\/[\\d]+\\//g, '')\r\n ////.replace(/(if|then|else|properties)\\//g, '').replace(/\\/items\\//g,'/-/');\r\n //JsonPointer.toDataPointer(controlItem.schemaPointer,jsf.schema);\r\n //console.log(`dataPointer:${dataPointer}\\ndPointer:${dPointer}`)\r\n let dVal=//JsonPointer.get(jsf.formValues,dPointer);\r\n JsonPointer.get(nodeValue,dPointer);\r\n let fkey=key;\r\n let oneOfItemValue=dVal;\r\n /*\r\n if(hasOwn(oneOfItemSchema,\"if\") && controlItem.schemaPointer\r\n && controlItem.schemaPointer.indexOf(keySchemaPointer)==0){\r\n let parts=controlItem.schemaPointer\r\n .split(keySchemaPointer).join('').split(\"/\")\r\n let thenOrElse=parts[1];\r\n fkey=parts[parts.length-1];\r\n oneOfItemSchema=oneOfItemSchema[thenOrElse];\r\n }\r\n \r\n if(oneOfItemSchema.properties && jsf.formValues===undefined){\r\n //check if no form data values were supplied\r\n //then set it to default otherwise to its nodevalue\r\n oneOfItemValue=oneOfItemSchema.default\r\n oneOfItemValue[fkey]=oneOfItemSchema.properties[fkey]?.default;\r\n }\r\n if(oneOfItemSchema.properties && jsf.formValues!=undefined){\r\n oneOfItemValue ={};\r\n //nodeValue||{};\r\n oneOfItemValue[fkey]=nodeValue&&nodeValue[fkey];\r\n }\r\n if(!oneOfItemSchema.properties && jsf.formValues==undefined){\r\n oneOfItemValue=oneOfItemSchema.default;\r\n }\r\n */\r\n if(hasOwn(controlItem,\"value\")){\r\n if(!jsf.ajv.validate(oneOfItemSchema,oneOfItemValue)){\r\n controlItem.value.value=null;\r\n }else{\r\n ///controlItem.value.value=oneOfItemValue[fkey];\r\n controlItem.value.value=oneOfItemSchema.properties?oneOfItemValue[fkey]:oneOfItemValue;\r\n } \r\n }\r\n\r\n //controls[controlKey] = controlItem;\r\n\r\n //allOfFGTemplate.controls[key].schemaPointer ||`${schemaPointer}${keySchemaPointer}/${key}`;\r\n //allOfFGTemplate.controls[key].schemaPointer || schemaPointer + keySchemaPointer;\r\n \r\n ///////controls[key] = cloneDeep(allOfFGTemplate.controls[key]);\r\n //add schemacontrol to root \r\n //controls[controlKey]=controlItem\r\n controls[`_${ofType}`]=controls[`_${ofType}`]||{};\r\n controls[`_${ofType}`][controlKey]=controlItem\r\n //allOfFGTemplate.controls[key];\r\n })\r\n }\r\n \r\n }\r\n \r\n })\r\n }\r\n })\r\n\r\n\r\n\r\n jsf.formOptions.fieldsRequired = setRequiredFields(schema, controls);\r\n }\r\n return { controlType, controls, validators,schemaPointer };\r\n\r\n case 'FormArray':\r\n controls = [];\r\n const minItems =\r\n Math.max(schema.minItems || 0, nodeOptions.get('minItems') || 0);\r\n const maxItems =\r\n Math.min(schema.maxItems || 1000, nodeOptions.get('maxItems') || 1000);\r\n let additionalItemsPointer: string = null;\r\n if (isArray(schema.items)) { // 'items' is an array = tuple items\r\n const tupleItems = nodeOptions.get('tupleItems') ||\r\n (isArray(schema.items) ? Math.min(schema.items.length, maxItems) : 0);\r\n for (let i = 0; i < tupleItems; i++) {\r\n if (i < minItems) {\r\n controls.push(buildFormGroupTemplate(\r\n jsf, isArray(nodeValue) ? nodeValue[i] : nodeValue, setValues,\r\n schemaPointer + '/items/' + i,\r\n dataPointer + '/' + i,\r\n templatePointer + '/controls/' + i\r\n ));\r\n } else {\r\n const schemaRefPointer = removeRecursiveReferences(\r\n schemaPointer + '/items/' + i, jsf.schemaRecursiveRefMap\r\n );\r\n const itemRefPointer = removeRecursiveReferences(\r\n shortDataPointer + '/' + i, jsf.dataRecursiveRefMap, jsf.arrayMap\r\n );\r\n const itemRecursive = itemRefPointer !== shortDataPointer + '/' + i;\r\n //if is in templateLibrary then need to check if its a conditional\r\n //and conditional pointers match orthewise create a new ref\r\n let conditionalRefPointer=`${itemRefPointer}@${schemaPointer}`;\r\n let templateRefToUse=itemRefPointer;\r\n if(hasOwn(jsf.templateRefLibrary, itemRefPointer)\r\n && !hasOwn(jsf.templateRefLibrary, conditionalRefPointer)){\r\n jsf.templateRefLibrary[conditionalRefPointer]=buildFormGroupTemplate(\r\n jsf, null, setValues,\r\n schemaRefPointer,\r\n itemRefPointer,\r\n templatePointer + '/controls/' + i\r\n );\r\n templateRefToUse=conditionalRefPointer;\r\n }\r\n if (!hasOwn(jsf.templateRefLibrary, itemRefPointer)) {\r\n jsf.templateRefLibrary[itemRefPointer] = null;\r\n jsf.templateRefLibrary[itemRefPointer] = buildFormGroupTemplate(\r\n jsf, null, setValues,\r\n schemaRefPointer,\r\n itemRefPointer,\r\n templatePointer + '/controls/' + i\r\n );\r\n jsf.templateRefLibrary[conditionalRefPointer]=jsf.templateRefLibrary[itemRefPointer];\r\n }\r\n controls.push(\r\n isArray(nodeValue) ?\r\n buildFormGroupTemplate(\r\n jsf, nodeValue[i], setValues,\r\n schemaPointer + '/items/' + i,\r\n dataPointer + '/' + i,\r\n templatePointer + '/controls/' + i\r\n ) :\r\n itemRecursive ?\r\n null : cloneDeep(jsf.templateRefLibrary[templateRefToUse])\r\n );\r\n }\r\n }\r\n\r\n // If 'additionalItems' is an object = additional list items (after tuple items)\r\n if (schema.items.length < maxItems && isObject(schema.additionalItems)) {\r\n additionalItemsPointer = schemaPointer + '/additionalItems';\r\n }\r\n\r\n // If 'items' is an object = list items only (no tuple items)\r\n } else {\r\n additionalItemsPointer = schemaPointer + '/items';\r\n }\r\n\r\n if (additionalItemsPointer) {\r\n const schemaRefPointer = removeRecursiveReferences(\r\n additionalItemsPointer, jsf.schemaRecursiveRefMap\r\n );\r\n const itemRefPointer = removeRecursiveReferences(\r\n shortDataPointer + '/-', jsf.dataRecursiveRefMap, jsf.arrayMap\r\n );\r\n const itemRecursive = itemRefPointer !== shortDataPointer + '/-';\r\n //if is in templateLibrary then need to check if its a conditional\r\n //and conditional pointers match orthewise create a new ref\r\n let conditionalRefPointer=`${itemRefPointer}@${schemaPointer}`;\r\n let templateRefToUse=itemRefPointer;\r\n if(hasOwn(jsf.templateRefLibrary, itemRefPointer)\r\n && !hasOwn(jsf.templateRefLibrary, conditionalRefPointer)){\r\n jsf.templateRefLibrary[conditionalRefPointer]=buildFormGroupTemplate(\r\n jsf, null, setValues,\r\n schemaRefPointer,\r\n itemRefPointer,\r\n templatePointer + '/controls/-' \r\n );\r\n templateRefToUse=conditionalRefPointer;\r\n }\r\n if (!hasOwn(jsf.templateRefLibrary, itemRefPointer)) {\r\n jsf.templateRefLibrary[itemRefPointer] = null;\r\n jsf.templateRefLibrary[itemRefPointer] = buildFormGroupTemplate(\r\n jsf, null, setValues,\r\n schemaRefPointer,\r\n itemRefPointer,\r\n templatePointer + '/controls/-'\r\n );\r\n jsf.templateRefLibrary[conditionalRefPointer]=jsf.templateRefLibrary[itemRefPointer];\r\n }\r\n // const itemOptions = jsf.dataMap.get(itemRefPointer) || new Map();\r\n const itemOptions = nodeOptions;\r\n if (!itemRecursive || hasOwn(validators, 'required')) {\r\n const arrayLength = Math.min(Math.max(\r\n itemRecursive ? 0 :\r\n (itemOptions.get('tupleItems') + itemOptions.get('listItems')) || 0,\r\n isArray(nodeValue) ? nodeValue.length : 0\r\n ), maxItems);\r\n for (let i = controls.length; i < arrayLength; i++) {\r\n controls.push(\r\n isArray(nodeValue) ?\r\n buildFormGroupTemplate(\r\n jsf, nodeValue[i], setValues,\r\n schemaRefPointer,\r\n dataPointer + '/-',\r\n templatePointer + '/controls/-'\r\n ) :\r\n itemRecursive ?\r\n null : cloneDeep(jsf.templateRefLibrary[templateRefToUse])\r\n );\r\n }\r\n }\r\n }\r\n return { controlType, controls, validators,schemaPointer };\r\n\r\n case '$ref':\r\n const schemaRef = JsonPointer.compile(schema.$ref);\r\n const dataRef = JsonPointer.toDataPointer(schemaRef, schema);\r\n const refPointer = removeRecursiveReferences(\r\n dataRef, jsf.dataRecursiveRefMap, jsf.arrayMap\r\n );\r\n if (refPointer && !hasOwn(jsf.templateRefLibrary, refPointer)) {\r\n // Set to null first to prevent recursive reference from causing endless loop\r\n jsf.templateRefLibrary[refPointer] = null;\r\n const newTemplate = buildFormGroupTemplate(jsf, setValues, setValues, schemaRef);\r\n if (newTemplate) {\r\n jsf.templateRefLibrary[refPointer] = newTemplate;\r\n } else {\r\n delete jsf.templateRefLibrary[refPointer];\r\n }\r\n }\r\n return null;\r\n\r\n case 'FormControl':\r\n const value = {\r\n value: setValues && isPrimitive(nodeValue) ? nodeValue : null,\r\n disabled: nodeOptions.get('disabled') || false\r\n };\r\n return { controlType, value, validators,schemaPointer };\r\n\r\n //TODO may make an IFThenElse widget or integrate it with the section\r\n //widget \r\n case 'IfThenElse':\r\n controls = {};\r\n let conditionType;\r\n if (hasOwn(schema, \"if\")) {\r\n [\"then\", \"else\"].forEach(con => {\r\n if (hasOwn(schema, con)) {\r\n const keySchemaPointer = `/${con}`;\r\n let thenTFGTemplate = buildFormGroupTemplate(\r\n jsf, nodeValue, setValues,//false,\r\n schemaPointer + keySchemaPointer,\r\n dataPointer,\r\n templatePointer + `/controls/${con}`\r\n );\r\n //NB same property can be in both then and else\r\n //so key must be the unique path to control\r\n \r\n //let ifItemSchema=JsonPointer.get(schema,keySchemaPointer);\r\n //let ifItemValue;\r\n if(hasOwn(thenTFGTemplate,'controls')){\r\n Object.keys(thenTFGTemplate.controls).forEach(key => {\r\n let controlKey = thenTFGTemplate.controls[key].schemaPointer;\r\n if(controlKey){\r\n controlKey = path2ControlKey(controlKey);\r\n let cItem = Object.assign({}, thenTFGTemplate.controls[key]);\r\n \r\n controls[controlKey] = cItem;\r\n } \r\n })\r\n }\r\n\r\n }\r\n });\r\n }\r\n return { controlType, controls, validators,schemaPointer };\r\n default:\r\n return null;\r\n }\r\n}\r\n\r\n/**\r\n * 'buildFormGroup' function\r\n *\r\n * // {any} template -\r\n * // {AbstractControl}\r\n*/\r\nexport function buildFormGroup(template: any): AbstractControl {\r\n const validatorFns: ValidatorFn[] = [];\r\n let validatorFn: ValidatorFn = null;\r\n if (hasOwn(template, 'validators')) {\r\n forEach(template.validators, (parameters, validator) => {\r\n if (typeof JsonValidators[validator] === 'function') {\r\n validatorFns.push(JsonValidators[validator].apply(null, parameters));\r\n }\r\n });\r\n if (validatorFns.length &&\r\n inArray(template.controlType, ['FormGroup', 'FormArray'])\r\n ) {\r\n validatorFn = validatorFns.length > 1 ?\r\n JsonValidators.compose(validatorFns) : validatorFns[0];\r\n }\r\n }\r\n if (hasOwn(template, 'controlType')) {\r\n switch (template.controlType) {\r\n case 'FormGroup':\r\n\r\n const groupControls: { [key: string]: AbstractControl } = {};\r\n forEach(template.controls, (controls, key) => {\r\n const newControl: AbstractControl = buildFormGroup(controls);\r\n //if (newControl) { groupControls[key] = newControl; }\r\n if (newControl) {\r\n\r\n /* experimental idea was to try to be able to switch\r\n conditional controls dynamically based on their schema pointer\r\n (not datapointer as that only maps to one control)\r\n Object.defineProperty(groupControls, key, {\r\n get: () => {\r\n //console.log(`Accessed control: ${key}`);\r\n //add switch logic here\r\n return ncontrol; \r\n },\r\n set:(value)=>{\r\n ncontrol=value\r\n },\r\n enumerable: true\r\n })\r\n */\r\n groupControls[key] = newControl;\r\n }\r\n });\r\n return new UntypedFormGroup(groupControls, validatorFn);\r\n case 'FormArray':\r\n return new UntypedFormArray(filter(map(template.controls,\r\n controls => buildFormGroup(controls)\r\n )), validatorFn);\r\n case 'FormControl':\r\n return new UntypedFormControl(template.value, validatorFns);\r\n }\r\n }\r\n return null;\r\n}\r\n\r\n/**\r\n * 'mergeValues' function\r\n *\r\n * // {any[]} ...valuesToMerge - Multiple values to merge\r\n * // {any} - Merged values\r\n */\r\nexport function mergeValues(...valuesToMerge) {\r\n let mergedValues: any = null;\r\n for (const currentValue of valuesToMerge) {\r\n if (!isEmpty(currentValue)) {\r\n if (typeof currentValue === 'object' &&\r\n (isEmpty(mergedValues) || typeof mergedValues !== 'object')\r\n ) {\r\n if (isArray(currentValue)) {\r\n mergedValues = [...currentValue];\r\n } else if (isObject(currentValue)) {\r\n mergedValues = { ...currentValue };\r\n }\r\n } else if (typeof currentValue !== 'object') {\r\n mergedValues = currentValue;\r\n } else if (isObject(mergedValues) && isObject(currentValue)) {\r\n Object.assign(mergedValues, currentValue);\r\n } else if (isObject(mergedValues) && isArray(currentValue)) {\r\n const newValues = [];\r\n for (const value of currentValue) {\r\n newValues.push(mergeValues(mergedValues, value));\r\n }\r\n mergedValues = newValues;\r\n } else if (isArray(mergedValues) && isObject(currentValue)) {\r\n const newValues = [];\r\n for (const value of mergedValues) {\r\n newValues.push(mergeValues(value, currentValue));\r\n }\r\n mergedValues = newValues;\r\n } else if (isArray(mergedValues) && isArray(currentValue)) {\r\n const newValues = [];\r\n for (let i = 0; i < Math.max(mergedValues.length, currentValue.length); i++) {\r\n if (i < mergedValues.length && i < currentValue.length) {\r\n newValues.push(mergeValues(mergedValues[i], currentValue[i]));\r\n } else if (i < mergedValues.length) {\r\n newValues.push(mergedValues[i]);\r\n } else if (i < currentValue.length) {\r\n newValues.push(currentValue[i]);\r\n }\r\n }\r\n mergedValues = newValues;\r\n }\r\n }\r\n }\r\n return mergedValues;\r\n}\r\n\r\n/**\r\n * 'setRequiredFields' function\r\n *\r\n * // {schema} schema - JSON Schema\r\n * // {object} formControlTemplate - Form Control Template object\r\n * // {boolean} - true if any fields have been set to required, false if not\r\n */\r\nexport function setRequiredFields(schema: any, formControlTemplate: any): boolean {\r\n let fieldsRequired = false;\r\n if (hasOwn(schema, 'required') && !isEmpty(schema.required)) {\r\n fieldsRequired = true;\r\n let requiredArray = isArray(schema.required) ? schema.required : [schema.required];\r\n requiredArray = forEach(requiredArray,\r\n key => JsonPointer.set(formControlTemplate, '/' + key + '/validators/required', [])\r\n );\r\n }\r\n return fieldsRequired;\r\n\r\n // TODO: Add support for patternProperties\r\n // https://spacetelescope.github.io/understanding-json-schema/reference/object.html#pattern-properties\r\n}\r\n\r\n/**\r\n * 'formatFormData' function\r\n *\r\n * // {any} formData - Angular FormGroup data object\r\n * // {Map<string, any>} dataMap -\r\n * // {Map<string, string>} recursiveRefMap -\r\n * // {Map<string, number>} arrayMap -\r\n * // {boolean = false} fixErrors - if TRUE, tries to fix data\r\n * // {any} - formatted data object\r\n */\r\nexport function formatFormData(\r\n formData: any, dataMap: Map<string, any>,\r\n recursiveRefMap: Map<string, string>, arrayMap: Map<string, number>,\r\n returnEmptyFields = false, fixErrors = false\r\n): any {\r\n if (formData === null || typeof formData !== 'object') { return formData; }\r\n const formattedData = isArray(formData) ? [] : {};\r\n JsonPointer.forEachDeep(formData, (value, dataPointer) => {\r\n\r\n // If returnEmptyFields === true,\r\n // add empty arrays and objects to all allowed keys\r\n if (returnEmptyFields && isArray(value)) {\r\n JsonPointer.set(formattedData, dataPointer, []);\r\n } else if (returnEmptyFields && isObject(value) && !isDate(value)) {\r\n JsonPointer.set(formattedData, dataPointer, {});\r\n } else {\r\n const genericPointer =\r\n JsonPointer.has(dataMap, [dataPointer, 'schemaType']) ? dataPointer :\r\n removeRecursiveReferences(dataPointer, recursiveRefMap, arrayMap);\r\n if (JsonPointer.has(dataMap, [genericPointer, 'schemaType'])) {\r\n const schemaType: SchemaPrimitiveType | SchemaPrimitiveType[] =\r\n dataMap.get(genericPointer).get('schemaType');\r\n if (schemaType === 'null') {\r\n JsonPointer.set(formattedData, dataPointer, null);\r\n } else if ((hasValue(value) || returnEmptyFields) &&\r\n inArray(schemaType, ['string', 'integer', 'number', 'boolean'])\r\n ) {\r\n const newValue = (fixErrors || (value === null && returnEmptyFields)) ?\r\n toSchemaType(value, schemaType) : toJavaScriptType(value, schemaType);\r\n if (isDefined(newValue) || returnEmptyFields) {\r\n JsonPointer.set(formattedData, dataPointer, newValue);\r\n }\r\n }\r\n\r\n\r\n // commented out completely as value can be 'null' if not entered\r\n\r\n // Finish incomplete 'date-time' entries\r\n // if (dataMap.get(genericPointer).get('schemaFormat') === 'date-time') {\r\n\r\n // /* commented out-should use same format as datetime-local input\r\n // for initial data to bind back to the input\r\n // // \"2000-03-14T01:59:26.535\" -> \"2000-03-14T01:59:26.535Z\" (add \"Z\")\r\n // if (/^\\d\\d\\d\\d-[0-1]\\d-[0-3]\\d[t\\s][0-2]\\d:[0-5]\\d:[0-5]\\d(?:\\.\\d+)?$/i.test(value)) {\r\n // JsonPointer.set(formattedData, dataPointer, `${value}Z`);\r\n // // \"2000-03-14T01:59\" -> \"2000-03-14T01:59:00Z\" (add \":00Z\")\r\n // } else if (/^\\d\\d\\d\\d-[0-1]\\d-[0-3]\\d[t\\s][0-2]\\d:[0-5]\\d$/i.test(value)) {\r\n // JsonPointer.set(formattedData, dataPointer, `${value}:00Z`);\r\n // // \"2000-03-14\" -> \"2000-03-14T00:00:00Z\" (add \"T00:00:00Z\")\r\n // } else if (fixErrors && /^\\d\\d\\d\\d-[0-1]\\d-[0-3]\\d$/i.test(value)) {\r\n // JsonPointer.set(formattedData, dataPointer, `${value}:00:00:00Z`);\r\n // }\r\n // */\r\n // JsonPointer.set(formattedData, dataPointer, `${value}`);\r\n // }\r\n } else if (typeof value !== 'object' || isDate(value) ||\r\n (value === null && returnEmptyFields)\r\n ) {\r\n if (genericPointer.indexOf(\"/$\")>=0) {\r\n return formattedData;\r\n }\r\n console.error('formatFormData error: ' +\r\n `Schema type not found for form value at ${genericPointer}`);\r\n console.error('dataMap', dataMap);\r\n console.error('recursiveRefMap', recursiveRefMap);\r\n console.error('genericPointer', genericPointer);\r\n }\r\n }\r\n });\r\n return formattedData;\r\n}\r\n\r\n/**\r\n * 'getControl' function\r\n *\r\n * Uses a JSON Pointer for a data object to retrieve a control from\r\n * an Angular formGroup or formGroup template. (Note: though a formGroup\r\n * template is much simpler, its basic structure is idential to a formGroup).\r\n *\r\n * If the optional third parameter 'returnGroup' is set to TRUE, the group\r\n * containing the control is returned, rather than the control itself.\r\n *\r\n * // {FormGroup} formGroup - Angular FormGroup to get value from\r\n * // {Pointer} dataPointer - JSON Pointer (string or array)\r\n * // {boolean = false} returnGroup - If true, return group containing control\r\n * // {group} - Located value (or null, if no control found)\r\n * // {string} schemaPointer - string used for conditional controls coming from schema if/then/else\r\n */\r\nexport function getControl(\r\n formGroup: any, dataPointer: Pointer, returnGroup = false, schemaPointer?: string\r\n): any {\r\n if (!isObject(formGroup) || !JsonPointer.isJsonPointer(dataPointer)) {\r\n if (!JsonPointer.isJsonPointer(dataPointer)) {\r\n // If dataPointer input is not a valid JSON pointer, check to\r\n // see if it is instead a valid object path, using dot notaion\r\n if (typeof dataPointer === 'string') {\r\n const controlPath=!!schemaPointer?path2ControlKey(schemaPointer):dataPointer\r\n const formControl = formGroup.get(controlPath);\r\n if (formControl) { return formControl; }\r\n }\r\n console.error(`getControl error: Invalid JSON Pointer: ${dataPointer}`);\r\n }\r\n if (!isObject(formGroup)) {\r\n console.error(`getControl error: Invalid formGroup: ${formGroup}`);\r\n }\r\n return null;\r\n }\r\n let dataPointerArray = JsonPointer.parse(dataPointer);\r\n if (returnGroup) { dataPointerArray = dataPointerArray.slice(0, -1); }\r\n\r\n // If formGroup input is a real formGroup (not a formGroup template)\r\n // try using formGroup.get() to return the control\r\n if (typeof formGroup.get === 'function' &&\r\n dataPointerArray.every(key => key.indexOf('.') === -1)\r\n ) {\r\n const controlPath=!!schemaPointer?path2ControlKey(schemaPointer):dataPointerArray.join('.');\r\n const formControl = formGroup.get(controlPath);\r\n if (formControl) { return formControl; }\r\n }\r\n\r\n // If formGroup input is a formGroup template,\r\n // or formGroup.get() failed to return the control,\r\n // search the formGroup object for dataPointer's control\r\n\r\n let subGroup = formGroup;\r\n //if schemapointer provided but no control matched\r\n //it could mean the schema pointer is a nested child\r\n //for example this could be in form group\r\n //formGroup.controls.$allOf$0$then$properties$foo\r\n //but schemapointer provided is '/allOf/0/then/properties/foo/items/properties/name'\r\n //and dataPointer is '/foo/0/name'\r\n //then need to look in formGroup.controls.$allOf$0$then$properties$foo\r\n //for control path /0/name\r\n if(schemaPointer){\r\n let controlPointer=JsonPointer.toControlPointer(dataPointer,{});\r\n let schemaPointerArray=schemaPointer.split('/')\r\n let controlPointerArray=JsonPointer.parse(dataPointer);\r\n //controlPointer.split('/').splice(1);\r\n\r\n let currSPAKey;\r\n let spFormGroup;\r\n while(schemaPointerArray.length>0){\r\n currSPAKey=schemaPointerArray.pop();\r\n let ckey=path2ControlKey(schemaPointerArray.join(\"/\"));\r\n spFormGroup=formGroup.get(ckey);\r\n if(controlPointerArray[0]==schemaPointerArray[schemaPointerArray.length-1]){\r\n controlPointerArray.shift();\r\n }\r\n if(spFormGroup){\r\n break;\r\n }\r\n }\r\n subGroup=spFormGroup||subGroup;\r\n dataPointerArray=spFormGroup?controlPointerArray:dataPointerArray;\r\n\r\n }\r\n for (const key of dataPointerArray) {\r\n if (hasOwn(subGroup, 'controls')) { subGroup = subGroup.controls; }\r\n if (schemaPointer && hasOwn(subGroup, path2ControlKey(schemaPointer ))) {\r\n subGroup = subGroup[path2ControlKey(schemaPointer )];\r\n return subGroup;\r\n } else if (isArray(subGroup) && (key === '-')) {\r\n subGroup = subGroup[subGroup.length - 1];\r\n } else if (hasOwn(subGroup, key)) {\r\n subGroup = subGroup[key];\r\n } else {\r\n console.error(`getControl error: Unable to find \"${key}\" item in FormGroup.`);\r\n console.error(dataPointer);\r\n console.error(formGroup);\r\n return;\r\n }\r\n }\r\n return subGroup;\r\n}\r\n\r\n\r\n/**\r\n * 'setControl' function\r\n *\r\n * Uses a JSON Pointer for a data object to retrieve a control from\r\n * an Angular formGroup or formGroup template. (Note: though a formGroup\r\n * template is much simpler, its basic structure is idential to a formGroup).\r\n *\r\n * If the optional third parameter 'returnGroup' is set to TRUE, the group\r\n * containing the control is returned, rather than the control itself.\r\n *\r\n * // {FormGroup} formGroup - Angular FormGroup to get value from\r\n * // {Pointer} dataPointer - JSON Pointer (string or array)\r\n * // {AbstractControl} control - control used to replace existing or add\r\n * // {targetKey} - optional string used as the new key-not implemented as yet\r\n */\r\nexport function setControl(\r\n formGroup: any, dataPointer: Pointer, control: AbstractControl, targetKey?: string,\r\n): any {\r\n\r\n let dataPointerArray = JsonPointer.parse(dataPointer);\r\n\r\n\r\n // If formGroup input is a real formGroup (not a formGroup template)\r\n // try using formGroup.get() to return the control\r\n /*\r\n if (typeof formGroup.get === 'function' &&\r\n dataPointerArray.every(key => key.indexOf('.') === -1)\r\n ) {\r\n formGroup.setControl(dataPointerArray.join('.'), control);\r\n return;\r\n }\r\n */\r\n let currentGroup: any= formGroup;\r\n for (let i = 0; i < dataPointerArray.length - 1; i++) {\r\n // Navigate down the form structure to find the correct nested FormGroup\r\n currentGroup = currentGroup.get(dataPointerArray[i]);\r\n \r\n // If it's not a FormGroup, we throw an error since we can't set a control in a non-group.\r\n if (!(typeof currentGroup.setControl=== 'function' )) {\r\n throw new Error(`Path '${dataPointerArray[i]}' is not a valid FormGroup or FormArray.`);\r\n }\r\n }\r\n \r\n // Now we are at the parent FormGroup, set the control at the last part of the path\r\n const lastPart = dataPointerArray[dataPointerArray.length - 1];\r\n \r\n // Set the control at the final path (like 'name' inside 'state')\r\n currentGroup.setControl(lastPart, control);\r\n \r\n \r\n\r\n // If formGroup input is a formGroup template,\r\n // or formGroup.get() failed to return the control,\r\n // search the formGroup object for dataPointer's control\r\n //TODO needs to be adapted to setControl\r\n /*\r\n let subGroup = formGroup;\r\n for (const key of dataPointerArray) {\r\n if (hasOwn(subGroup, 'controls')) { subGroup = subGroup.controls; }\r\n if (isArray(subGroup) && (key === '-')) {\r\n subGroup = subGroup[subGroup.length - 1];\r\n } else if (hasOwn(subGroup, key)) {\r\n subGroup = subGroup[key];\r\n } else {\r\n console.error(`getControl error: Unable to find \"${key}\" item in FormGroup.`);\r\n console.error(dataPointer);\r\n console.error(formGroup);\r\n return;\r\n }\r\n }\r\n return subGroup;\r\n */\r\n}\r\n","import cloneDeep from 'lodash/cloneDeep';\r\nimport _isArray from 'lodash/isArray';\r\nimport _isPlainObject from 'lodash/isPlainObject';\r\nimport uniqueId from 'lodash/uniqueId';\r\nimport { TitleMapItem } from '../json-schema-form.service';\r\nimport {\r\n checkInlineType,\r\n convertJSONSchemaIfToCondition,\r\n getFromSchema,\r\n getInputType,\r\n isInputRequired,\r\n removeRecursiveReferences,\r\n updateInputOptions\r\n} from './json-schema.functions';\r\nimport { JsonPointer } from './jsonpointer.functions';\r\nimport {\r\n copy,\r\n fixTitle,\r\n forEach,\r\n hasOwn\r\n} from './utility.functions';\r\nimport {\r\n inArray,\r\n isArray,\r\n isDefined,\r\n isEmpty,\r\n isNumber,\r\n isObject,\r\n isString\r\n} from './validator.functions';\r\n\r\n\r\n\r\n\r\n/**\r\n * Layout function library:\r\n *\r\n * buildLayout: Builds a complete layout from an input layout and schema\r\n *\r\n * buildLayoutFromSchema: Builds a complete layout entirely from an input schema\r\n *\r\n * mapLayout:\r\n *\r\n * getLayoutNode:\r\n *\r\n * buildTitleMap:\r\n */\r\n\r\n/**\r\n * 'buildLayout' function\r\n *\r\n * // jsf\r\n * // widgetLibrary\r\n * //\r\n */\r\nexport function buildLayout_original(jsf, widgetLibrary) {\r\n let hasSubmitButton = !JsonPointer.get(jsf, '/formOptions/addSubmit');\r\n const formLayout = mapLayout(jsf.layout, (layoutItem, index, layoutPointer) => {\r\n const newNode: any = {\r\n _id: uniqueId(),\r\n options: {},\r\n };\r\n if (isObject(layoutItem)) {\r\n Object.assign(newNode, layoutItem);\r\n Object.keys(newNode)\r\n .filter(option => !inArray(option, [\r\n '_id', '$ref', 'arrayItem', 'arrayItemType', 'dataPointer', 'dataType',\r\n 'items', 'key', 'name', 'options', 'recursiveReference', 'type', 'widget'\r\n ]))\r\n .forEach(option => {\r\n newNode.options[option] = newNode[option];\r\n delete newNode[option];\r\n });\r\n if (!hasOwn(newNode, 'type') && isString(newNode.widget)) {\r\n newNode.type = newNode.widget;\r\n delete newNode.widget;\r\n }\r\n if (!hasOwn(newNode.options, 'title')) {\r\n if (hasOwn(newNode.options, 'legend')) {\r\n newNode.options.title = newNode.options.legend;\r\n delete newNode.options.legend;\r\n }\r\n }\r\n if (!hasOwn(newNode.options, 'validationMessages')) {\r\n if (hasOwn(newNode.options, 'errorMessages')) {\r\n newNode.options.validationMessages = newNode.options.errorMessages;\r\n delete newNode.options.errorMessages;\r\n\r\n // Convert Angular Schema Form (AngularJS) 'validationMessage' to\r\n // Angular JSON Schema Form 'validationMessages'\r\n // TV4 codes from https://github.com/geraintluff/tv4/blob/master/source/api.js\r\n } else if (hasOwn(newNode.options, 'validationMessage')) {\r\n if (typeof newNode.options.validationMessage === 'string') {\r\n newNode.options.validationMessages = newNode.options.validationMessage;\r\n } else {\r\n newNode.options.validationMessages = {};\r\n Object.keys(newNode.options.validationMessage).forEach(key => {\r\n const code = key + '';\r\n const newKey =\r\n code === '0' ? 'type' :\r\n code === '1' ? 'enum' :\r\n code === '100' ? 'multipleOf' :\r\n code === '101' ? 'minimum' :\r\n code === '102' ? 'exclusiveMinimum' :\r\n code === '103' ? 'maximum' :\r\n code === '104' ? 'exclusiveMaximum' :\r\n code === '200' ? 'minLength' :\r\n code === '201' ? 'maxLength' :\r\n code === '202' ? 'pattern' :\r\n code === '300' ? 'minProperties' :\r\n code === '301' ? 'maxProperties' :\r\n code === '302' ? 'required' :\r\n code === '304' ? 'dependencies' :\r\n code === '400' ? 'minItems' :\r\n code === '401' ? 'maxItems' :\r\n code === '402' ? 'uniqueItems' :\r\n code === '500' ? 'format' : code + '';\r\n newNode.options.validationMessages[newKey] = newNode.options.validationMessage[key];\r\n });\r\n }\r\n delete newNode.options.validationMessage;\r\n }\r\n }\r\n } else if (JsonPointer.isJsonPointer(layoutItem)) {\r\n newNode.dataPointer = layoutItem;\r\n } else if (isString(layoutItem)) {\r\n newNode.key = layoutItem;\r\n } else {\r\n console.error('buildLayout error: Form layout element not recognized:');\r\n console.error(layoutItem);\r\n return null;\r\n }\r\n let nodeSchema: any = null;\r\n\r\n // If newNode does not have a dataPointer, try to find an equivalent\r\n if (!hasOwn(newNode, 'dataPointer')) {\r\n\r\n // If newNode has a key, change it to a dataPointer\r\n if (hasOwn(newNode, 'key')) {\r\n newNode.dataPointer = newNode.key === '*' ? newNode.key :\r\n JsonPointer.compile(JsonPointer.parseObjectPath(newNode.key), '-');\r\n delete newNode.key;\r\n\r\n // If newNode is an array, search for dataPointer in child nodes\r\n } else if (hasOwn(newNode, 'type') && newNode.type.slice(-5) === 'array') {\r\n const findDataPointer = (items) => {\r\n if (items === null || typeof items !== 'object') { return; }\r\n if (hasOwn(items, 'dataPointer')) { return items.dataPointer; }\r\n if (isArray(items.items)) {\r\n for (const item of items.items) {\r\n if (hasOwn(item, 'dataPointer') && item.dataPointer.indexOf('/-') !== -1) {\r\n return item.dataPointer;\r\n }\r\n if (hasOwn(item, 'items')) {\r\n const searchItem = findDataPointer(item);\r\n if (searchItem) { return searchItem; }\r\n }\r\n }\r\n }\r\n };\r\n const childDataPointer = findDataPointer(newNode);\r\n if (childDataPointer) {\r\n newNode.dataPointer =\r\n childDataPointer.slice(0, childDataPointer.lastIndexOf('/-'));\r\n }\r\n }\r\n }\r\n\r\n if (hasOwn(newNode, 'dataPointer')) {\r\n if (newNode.dataPointer === '*') {\r\n return buildLayoutFromSchema(jsf, widgetLibrary, jsf.formValues);\r\n }\r\n const nodeValue =\r\n JsonPointer.get(jsf.formValues, newNode.dataPointer.replace(/\\/-/g, '/1'));\r\n\r\n // TODO: Create function getFormValues(jsf, dataPointer, forRefLibrary)\r\n // check formOptions.setSchemaDefaults and formOptions.setLayoutDefaults\r\n // then set apropriate values from initialVaues, schema, or layout\r\n\r\n newNode.dataPointer =\r\n JsonPointer.toGenericPointer(newNode.dataPointer, jsf.arrayMap);\r\n const LastKey = JsonPointer.toKey(newNode.dataPointer);\r\n if (!newNode.name && isString(LastKey) && LastKey !== '-') {\r\n newNode.name = LastKey;\r\n }\r\n const shortDataPointer = removeRecursiveReferences(\r\n newNode.dataPointer, jsf.dataRecursiveRefMap, jsf.arrayMap\r\n );\r\n const recursive = !shortDataPointer.length ||\r\n shortDataPointer !== newNode.dataPointer;\r\n let schemaPointer: string;\r\n if (!jsf.dataMap.has(shortDataPointer)) {\r\n jsf.dataMap.set(shortDataPointer, new Map());\r\n }\r\n const nodeDataMap = jsf.dataMap.get(shortDataPointer);\r\n if (nodeDataMap.has('schemaPointer')) {\r\n schemaPointer = nodeDataMap.get('schemaPointer');\r\n } else {\r\n schemaPointer = JsonPointer.toSchemaPointer(shortDataPointer, jsf.schema);\r\n nodeDataMap.set('schemaPointer', schemaPointer);\r\n }\r\n \r\n nodeSchema = JsonPointer.get(jsf.schema, schemaPointer);\r\n if (nodeSchema) {\r\n if (!hasOwn(newNode, 'type')) {\r\n newNode.type = getInputType(nodeSchema, newNode);\r\n } else if (!widgetLibrary.hasWidget(newNode.type)) {\r\n const oldWidgetType = newNode.type;\r\n newNode.type = getInputType(nodeSchema, newNode);\r\n console.error(`error: widget type \"${oldWidgetType}\" ` +\r\n `not found in library. Replacing with \"${newNode.type}\".`);\r\n } else {\r\n newNode.type = checkInlineType(newNode.type, nodeSchema, newNode);\r\n }\r\n if (nodeSchema.type === 'object' && isArray(nodeSchema.required)) {\r\n nodeDataMap.set('required', nodeSchema.required);\r\n }\r\n newNode.dataType =\r\n nodeSchema.type || (hasOwn(nodeSchema, '$ref') ? '$ref' : null);\r\n updateInputOptions(newNode, nodeSchema, jsf);\r\n nodeDataMap.set('disabled', !!newNode.options.disabled);\r\n // Present checkboxes as single control, rather than array\r\n if (newNode.type === 'checkboxes' && hasOwn(nodeSchema, 'items')) {\r\n updateInputOptions(newNode, nodeSchema.items, jsf);\r\n } else if (newNode.dataType === 'array') {\r\n newNode.options.maxItems = Math.min(\r\n nodeSchema.maxItems || 1000, newNode.options.maxItems || 1000\r\n );\r\n newNode.options.minItems = Math.max(\r\n nodeSchema.minItems || 0, newNode.options.minItems || 0\r\n );\r\n newNode.options.listItems = Math.max(\r\n newNode.options.listItems || 0, isArray(nodeValue) ? nodeValue.length : 0\r\n );\r\n newNode.options.tupleItems =\r\n isArray(nodeSchema.items) ? nodeSchema.items.length : 0;\r\n if (newNode.options.maxItems < newNode.options.tupleItems) {\r\n newNode.options.tupleItems = newNode.options.maxItems;\r\n newNode.options.listItems = 0;\r\n } else if (newNode.options.maxItems <\r\n newNode.options.tupleItems + newNode.options.listItems\r\n ) {\r\n newNode.options.listItems =\r\n newNode.options.maxItems - newNode.options.tupleItems;\r\n } else if (newNode.options.minItems >\r\n newNode.options.tupleItems + newNode.options.listItems\r\n ) {\r\n newNode.options.listItems =\r\n newNode.options.minItems - newNode.options.tupleItems;\r\n }\r\n if (!nodeDataMap.has('maxItems')) {\r\n nodeDataMap.set('maxItems', newNode.options.maxItems);\r\n nodeDataMap.set('minItems', newNode.options.minItems);\r\n nodeDataMap.set('tupleItems', newNode.options.tupleItems);\r\n nodeDataMap.set('listItems', newNode.options.listItems);\r\n }\r\n if (!jsf.arrayMap.has(shortDataPointer)) {\r\n jsf.arrayMap.set(shortDataPointer, newNode.options.tupleItems);\r\n }\r\n }\r\n if (isInputRequired(jsf.schema, schemaPointer)) {\r\n newNode.options.required = true;\r\n jsf.fieldsRequired = true;\r\n }\r\n } else {\r\n // TODO: create item in FormGroup model from layout key (?)\r\n updateInputOptions(newNode, {}, jsf);\r\n }\r\n\r\n if (!newNode.options.title && !/^\\d+$/.test(newNode.name)) {\r\n newNode.options.title = fixTitle(newNode.name);\r\n }\r\n\r\n if (hasOwn(newNode.options, 'copyValueTo')) {\r\n if (typeof newNode.options.copyValueTo === 'string') {\r\n newNode.options.copyValueTo = [newNode.options.copyValueTo];\r\n }\r\n if (isArray(newNode.options.copyValueTo)) {\r\n newNode.options.copyValueTo = newNode.options.copyValueTo.map(item =>\r\n JsonPointer.compile(JsonPointer.parseObjectPath(item), '-')\r\n );\r\n }\r\n }\r\n\r\n newNode.widget = widgetLibrary.getWidget(newNode.type);\r\n nodeDataMap.set('inputType', newNode.type);\r\n nodeDataMap.set('widget', newNode.widget);\r\n\r\n if (newNode.dataType === 'array' &&\r\n (hasOwn(newNode, 'items') || hasOwn(newNode, 'additionalItems'))\r\n ) {\r\n const itemRefPointer = removeRecursiveReferences(\r\n newNode.dataPointer + '/-', jsf.dataRecursiveRefMap, jsf.arrayMap\r\n );\r\n if (!jsf.dataMap.has(itemRefPointer)) {\r\n jsf.dataMap.set(itemRefPointer, new Map());\r\n }\r\n jsf.dataMap.get(itemRefPointer).set('inputType', 'section');\r\n\r\n // Fix insufficiently nested array item groups\r\n if (newNode.items.length > 1) {\r\n const arrayItemGroup = [];\r\n for (let i = newNode.items.length - 1; i >= 0; i--) {\r\n const subItem = newNode.items[i];\r\n if (hasOwn(subItem, 'dataPointer') &&\r\n subItem.dataPointer.slice(0, itemRefPointer.length) === itemRefPointer\r\n ) {\r\n const arrayItem = newNode.items.splice(i, 1)[0];\r\n arrayItem.dataPointer = newNode.dataPointer + '/-' +\r\n arrayItem.dataPointer.slice(itemRefPointer.length);\r\n arrayItemGroup.unshift(arrayItem);\r\n } else {\r\n subItem.arrayItem = true;\r\n // TODO: Check schema to get arrayItemType and removable\r\n subItem.arrayItemType = 'list';\r\n subItem.removable = newNode.options.removable !== false;\r\n }\r\n }\r\n if (arrayItemGroup.length) {\r\n newNode.items.push({\r\n _id: uniqueId(),\r\n arrayItem: true,\r\n arrayItemType: newNode.options.tupleItems > newNode.items.length ?\r\n 'tuple' : 'list',\r\n items: arrayItemGroup,\r\n options: { removable: newNode.options.removable !== false, },\r\n dataPointer: newNode.dataPointer + '/-',\r\n type: 'section',\r\n widget: widgetLibrary.getWidget('section'),\r\n });\r\n }\r\n } else {\r\n // TODO: Fix to hndle multiple items\r\n newNode.items[0].arrayItem = true;\r\n if (!newNode.items[0].dataPointer) {\r\n newNode.items[0].dataPointer =\r\n JsonPointer.toGenericPointer(itemRefPointer, jsf.arrayMap);\r\n }\r\n if (!JsonPointer.has(newNode, '/items/0/options/removable')) {\r\n newNode.items[0].options.removable = true;\r\n }\r\n if (newNode.options.orderable === false) {\r\n newNode.items[0].options.orderable = false;\r\n }\r\n newNode.items[0].arrayItemType =\r\n newNode.options.tupleItems ? 'tuple' : 'list';\r\n }\r\n\r\n if (isArray(newNode.items)) {\r\n const arrayListItems =\r\n newNode.items.filter(item => item.type !== '$ref').length -\r\n newNode.options.tupleItems;\r\n if (arrayListItems > newNode.options.listItems) {\r\n newNode.options.listItems = arrayListItems;\r\n nodeDataMap.set('listItems', arrayListItems);\r\n }\r\n }\r\n\r\n if (!hasOwn(jsf.layoutRefLibrary, itemRefPointer)) {\r\n jsf.layoutRefLibrary[itemRefPointer] =\r\n cloneDeep(newNode.items[newNode.items.length - 1]);\r\n if (recursive) {\r\n jsf.layoutRefLibrary[itemRefPointer].recursiveReference = true;\r\n }\r\n forEach(jsf.layoutRefLibrary[itemRefPointer], (item, key) => {\r\n if (hasOwn(item, '_id')) { item._id = null; }\r\n if (recursive) {\r\n if (hasOwn(item, 'dataPointer')) {\r\n item.dataPointer = item.dataPointer.slice(itemRefPointer.length);\r\n }\r\n }\r\n }, 'top-down');\r\n }\r\n\r\n // Add any additional default items\r\n if (!newNode.recursiveReference || newNode.options.required) {\r\n const arrayLength = Math.min(Math.max(\r\n newNode.options.tupleItems + newNode.options.listItems,\r\n isArray(nodeValue) ? nodeValue.length : 0\r\n ), newNode.options.maxItems);\r\n for (let i = newNode.items.length; i < arrayLength; i++) {\r\n newNode.items.push(getLayoutNode({\r\n $ref: itemRefPointer,\r\n dataPointer: newNode.dataPointer,\r\n recursiveReference: newNode.recursiveReference,\r\n }, jsf, widgetLibrary));\r\n }\r\n }\r\n\r\n // If needed, add button to add items to array\r\n if (newNode.options.addable !== false &&\r\n newNode.options.minItems < newNode.options.maxItems &&\r\n (newNode.items[newNode.items.length - 1] || {}).type !== '$ref'\r\n ) {\r\n let buttonText = 'Add';\r\n if (newNode.options.title) {\r\n if (/^add\\b/i.test(newNode.options.title)) {\r\n buttonText = newNode.options.title;\r\n } else {\r\n buttonText += ' ' + newNode.options.title;\r\n }\r\n } else if (newNode.name && !/^\\d+$/.test(newNode.name)) {\r\n if (/^add\\b/i.test(newNode.name)) {\r\n buttonText += ' ' + fixTitle(newNode.name);\r\n } else {\r\n buttonText = fixTitle(newNode.name);\r\n }\r\n\r\n // If newNode doesn't have a title, look for title of parent array item\r\n } else {\r\n const parentSchema =\r\n getFromSchema(jsf.schema, newNode.dataPointer, 'parentSchema');\r\n if (hasOwn(parentSchema, 'title')) {\r\n buttonText += ' to ' + parentSchema.title;\r\n } else {\r\n const pointerArray = JsonPointer.parse(newNode.dataPointer);\r\n buttonText += ' to ' + fixTitle(pointerArray[pointerArray.length - 2]);\r\n }\r\n }\r\n newNode.items.push({\r\n _id: uniqueId(),\r\n arrayItem: true,\r\n arrayItemType: 'list',\r\n dataPointer: newNode.dataPointer + '/-',\r\n options: {\r\n listItems: newNode.options.listItems,\r\n maxItems: newNode.options.maxItems,\r\n minItems: newNode.options.minItems,\r\n removable: false,\r\n title: buttonText,\r\n tupleItems: newNode.options.tupleItems,\r\n },\r\n recursiveReference: recursive,\r\n type: '$ref',\r\n widget: widgetLibrary.getWidget('$ref'),\r\n $ref: itemRefPointer,\r\n });\r\n if (isString(JsonPointer.get(newNode, '/style/add'))) {\r\n newNode.items[newNode.items.length - 1].options.fieldStyle =\r\n newNode.style.add;\r\n delete newNode.style.add;\r\n if (isEmpty(newNode.style)) { delete newNode.style; }\r\n }\r\n }\r\n } else {\r\n newNode.arrayItem = false;\r\n }\r\n } else if (hasOwn(newNode, 'type') || hasOwn(newNode, 'items')) {\r\n const parentType: string =\r\n JsonPointer.get(jsf.layout, layoutPointer, 0, -2).type;\r\n if (!hasOwn(newNode, 'type')) {\r\n newNode.type =\r\n inArray(parentType, ['tabs', 'tabarray']) ? 'tab' : 'array';\r\n }\r\n newNode.arrayItem = parentType === 'array';\r\n newNode.widget = widgetLibrary.getWidget(newNode.type);\r\n updateInputOptions(newNode, {}, jsf);\r\n }\r\n if (newNode.type === 'submit') { hasSubmitButton = true; }\r\n return newNode;\r\n });\r\n if (jsf.hasRootReference) {\r\n const fullLayout = cloneDeep(formLayout);\r\n if (fullLayout[fullLayout.length - 1].type === 'submit') { fullLayout.pop(); }\r\n jsf.layoutRefLibrary[''] = {\r\n _id: null,\r\n dataPointer: '',\r\n dataType: 'object',\r\n items: fullLayout,\r\n name: '',\r\n options: cloneDeep(jsf.formOptions.defaultWidgetOptions),\r\n recursiveReference: true,\r\n required: false,\r\n type: 'section',\r\n widget: widgetLibrary.getWidget('section'),\r\n };\r\n }\r\n if (!hasSubmitButton) {\r\n formLayout.push({\r\n _id: uniqueId(),\r\n options: { title: 'Submit' },\r\n type: 'submit',\r\n widget: widgetLibrary.getWidget('submit'),\r\n });\r\n }\r\n return formLayout;\r\n}\r\n\r\n//TODO-review:this implements a quick 'post' fix rather than an\r\n//integrared ideal fix\r\nexport function buildLayout(jsf, widgetLibrary) {\r\n let layout = buildLayout_original(jsf, widgetLibrary);\r\n if (jsf.formValues) {\r\n let fixedLayout = fixNestedArrayLayout({\r\n builtLayout: layout,\r\n formData: jsf.formValues\r\n });\r\n }\r\n return layout;\r\n}\r\n\r\n\r\n\r\nfunction fixNestedArrayLayout(options: any) {\r\n let { builtLayout, formData } = options;\r\n let arrLengths = {};\r\n let traverseObj = function (obj, path, onValue?) {\r\n if (_isArray(obj)) {\r\n onValue && onValue(obj, path);\r\n obj.forEach((item, ind) => {\r\n onValue && onValue(item, path + \"/\" + ind);\r\n traverseObj(item, path + \"/\" + ind, onValue);\r\n });\r\n return;\r\n }\r\n if (_isPlainObject(obj)) {\r\n onValue && onValue(obj, path);\r\n Object.keys(obj).forEach(key => {\r\n onValue && onValue(obj[key], path + \"/\" + key);\r\n traverseObj(obj[key], path + \"/\" + key, onValue);\r\n });\r\n return\r\n }\r\n }\r\n traverseObj(formData, \"\", (value, path) => {\r\n if (_isArray(value)) {\r\n arrLengths[path] = arrLengths[path] || value.length;\r\n }\r\n });\r\n\r\n let getDataSize = (options: any) => {\r\n let { data, dataPointer, indexArray } = options;\r\n let dashCount = 0;\r\n let dpInstance = dataPointer.substring(1).split(\"/\").map((part, pind) => {\r\n if (part == \"-\" && indexArray[dashCount] != undefined) {\r\n return indexArray[dashCount++];\r\n }\r\n return part;\r\n })\r\n .join(\"/\");\r\n dpInstance = \"/\" + dpInstance;\r\n let arrSize = arrLengths[dpInstance];\r\n return arrSize;\r\n }\r\n //still too buggy\r\n let createNonRefItem = (nodeWithRef: any) => {\r\n let templateNode = {\r\n \"type\": \"section\", //check this could also be array?\r\n \"recursiveReference\": false,//check this \r\n \"items\": []\r\n }\r\n let clone = cloneDeep(nodeWithRef);\r\n //commented out for now so that it behaves as ususal\r\n //_.merge(clone,templateNode);\r\n return clone;\r\n }\r\n\r\n let rebuildLayout = (options: any) => {\r\n let { builtLayout, indices, parentDataPointer, indexPos } = options;\r\n indices = indices || [];\r\n indexPos = indexPos == undefined ? indexPos = -1 : indexPos;\r\n if (_isArray(builtLayout)) {\r\n builtLayout.forEach((item, index) => {\r\n rebuildLayout({\r\n builtLayout: item,\r\n indices: indices,\r\n indexPos: indexPos,\r\n parentDataPointer: parentDataPointer\r\n //TODO-test \r\n //commented out builtLayout.dataPointer condition\r\n //-Angular 18/TS 5.5 compiliation error\r\n //builtLayout.dataPointer || parentDataPointer\r\n })\r\n })\r\n return;\r\n }\r\n\r\n let dataTypes = [\"array\"];//check only array for now\r\n //for now added condition to ignore recursive references\r\n if (builtLayout.items && dataTypes.indexOf(builtLayout.dataType) >= 0\r\n && builtLayout.dataPointer\r\n && !builtLayout.recursiveReference\r\n ) {\r\n let numDataItems: any = getDataSize({\r\n data: formData,\r\n dataPointer: builtLayout.dataPointer,\r\n indexArray: indices\r\n });\r\n let numActualItems = builtLayout.items.length;\r\n //check if there's ref items, if so ignore it and therefore\r\n //decrement the item count\r\n builtLayout.items.forEach(item => {\r\n if (item.type && item.type == \"$ref\") {\r\n numActualItems--;\r\n }\r\n });\r\n numActualItems = Math.max(numActualItems, 0);//avoid dealing with negatives\r\n if (numActualItems < numDataItems) {\r\n\r\n let numItemsNeeded = numDataItems - numActualItems;\r\n //added to ignore recursive references\r\n if (numActualItems == 0 && builtLayout.items[0].recursiveReference) {\r\n numItemsNeeded = 0\r\n }\r\n for (let i = 0; i < numItemsNeeded; i++) {\r\n //node must not be of type \"type\": \"$ref\"\r\n //if it is then manufacture our own\r\n let isRefNode = builtLayout.items[0].type && builtLayout.items[0].type == \"$ref\";\r\n let newItem = isRefNode\r\n ? createNonRefItem(builtLayout.items[0])\r\n : cloneDeep(builtLayout.items[0]);//copy first\r\n newItem._id = uniqueId(\"new_\");\r\n builtLayout.items.unshift(newItem);\r\n }\r\n if (builtLayout.options.listItems) {\r\n builtLayout.options.listItems = numDataItems;\r\n }\r\n }\r\n indices[builtLayout.dataPointer] = indices[builtLayout.dataPointer] || -1;\r\n indexPos++;\r\n builtLayout.items.forEach((item, index) => {\r\n indices[indexPos] = index\r\n rebuildLayout({\r\n builtLayout: item,\r\n indices: indices,\r\n parentDataPointer: builtLayout.dataPointer,\r\n indexPos: indexPos\r\n })\r\n })\r\n indexPos--;\r\n } else {\r\n if (builtLayout.items) {\r\n builtLayout.items.forEach((item, index) => {\r\n rebuildLayout({\r\n builtLayout: item,\r\n indices: indices,\r\n parentDataPointer: parentDataPointer,\r\n indexPos: indexPos\r\n })\r\n })\r\n\r\n }\r\n }\r\n\r\n\r\n }\r\n rebuildLayout({\r\n builtLayout: builtLayout\r\n });\r\n //NB original is mutated\r\n let fixedLayout = builtLayout;\r\n return fixedLayout;\r\n}\r\n\r\n/**\r\n * 'buildLayoutFromSchema' function\r\n *\r\n * // jsf -\r\n * // widgetLibrary -\r\n * // nodeValue -\r\n * // { string = '' } schemaPointer -\r\n * // { string = '' } dataPointer -\r\n * // { boolean = false } arrayItem -\r\n * // { string = null } arrayItemType -\r\n * // { boolean = null } removable -\r\n * // { boolean = false } forRefLibrary -\r\n * // { string = '' } dataPointerPrefix -\r\n * //\r\n */\r\nexport function buildLayoutFromSchema(\r\n jsf, widgetLibrary, nodeValue = null, schemaPointer = '',\r\n dataPointer = '', arrayItem = false, arrayItemType: string = null,\r\n removable: boolean = null, forRefLibrary = false, dataPointerPrefix = '',\r\n jsonSchema?\r\n) {\r\n function applyITEConditions(builtLayout,schPointer,keySchemaPointer,negateClause,parentLayout?){\r\n if (builtLayout) {\r\n const parentCondition=parentLayout && parentLayout.isITEItem && parentLayout.options.condition;\r\n if(parentCondition){\r\n //builtLayout.isITEItem=true;\r\n return;\r\n }\r\n if (isArray(builtLayout)) {\r\n builtLayout.forEach(item => {\r\n item.isITEItem=true;\r\n item.options.condition =parentCondition?null:convertJSONSchemaIfToCondition(schema,item, negateClause);\r\n applyITEConditions(item,schPointer,keySchemaPointer,negateClause,builtLayout)\r\n //item.schemaPointer = schPointer + keySchemaPointer + item.dataPointer;\r\n //item.options.condition = convertJSONSchemaIfToCondition(schema, negateClause);\r\n //newSection.push(item);\r\n });\r\n }else if(hasOwn(builtLayout,\"items\")){\r\n applyITEConditions(builtLayout.items,schPointer,keySchemaPointer,negateClause,builtLayout)\r\n // builtLayout.items.forEach(item => {\r\n // item.isITEItem=true;\r\n // item.options.condition = convertJSONSchemaIfToCondition(schema,item, negateClause);\r\n // applyITEConditions(item,schPointer,keySchemaPointer,negateClause)\r\n // });\r\n }else {\r\n\r\n builtLayout.isITEItem=true;\r\n //builtLayout.schemaPointer = `${schPointer}${keySchemaPointer}/${builtLayout.name}`;\r\n \r\n builtLayout.options.condition =parentCondition?null: convertJSONSchemaIfToCondition(schema,builtLayout, negateClause);\r\n //newSection.push(builtLayout)\r\n }\r\n }\r\n }\r\n const jsSchema=jsonSchema||jsf.schema;\r\n const schema = JsonPointer.get(jsSchema, schemaPointer);\r\n //JsonPointer.get(jsf.schema, schemaPointer);\r\n if (!hasOwn(schema, 'type') && !hasOwn(schema, '$ref') &&\r\n !hasOwn(schema, 'x-schema-form')\r\n && !hasOwn(schema, 'if') && !hasOwn(schema, 'then') && !hasOwn(schema, 'else')\r\n ) { return null; }\r\n const newNodeType: string = getInputType(schema);\r\n if (!isDefined(nodeValue) && (\r\n jsf.formOptions.setSchemaDefaults === true ||\r\n (jsf.formOptions.setSchemaDefaults === 'auto' && isEmpty(jsf.formValues))\r\n )) {\r\n nodeValue = JsonPointer.get(jsSchema, schemaPointer + '/default');\r\n }\r\n let newNode: any = {\r\n _id: forRefLibrary ? null : uniqueId(),\r\n arrayItem: arrayItem,\r\n dataPointer: JsonPointer.toGenericPointer(dataPointer, jsf.arrayMap),\r\n dataType: schema.type || (hasOwn(schema, '$ref') ? '$ref' : null),\r\n options: {},\r\n required: isInputRequired(jsSchema, schemaPointer),\r\n type: newNodeType,\r\n widget: widgetLibrary.getWidget(newNodeType),\r\n };\r\n const lastDataKey = JsonPointer.toKey(newNode.dataPointer);\r\n if (lastDataKey !== '-') { newNode.name = lastDataKey; }\r\n if (newNode.arrayItem) {\r\n newNode.arrayItemType = arrayItemType;\r\n newNode.options.removable = removable !== false;\r\n }\r\n const shortDataPointer = removeRecursiveReferences(\r\n dataPointerPrefix + dataPointer, jsf.dataRecursiveRefMap, jsf.arrayMap\r\n );\r\n const recursive = !shortDataPointer.length ||\r\n shortDataPointer !== dataPointerPrefix + dataPointer;\r\n if (!jsf.dataMap.has(shortDataPointer)) {\r\n jsf.dataMap.set(shortDataPointer, new Map());\r\n }\r\n updateInputOptions(newNode, schema, jsf);\r\n const nodeDataMap = jsf.dataMap.get(shortDataPointer);\r\n if (!nodeDataMap.has('inputType')) {\r\n nodeDataMap.set('schemaPointer', schemaPointer);\r\n nodeDataMap.set('inputType', newNode.type);\r\n nodeDataMap.set('widget', newNode.widget);\r\n nodeDataMap.set('disabled', !!newNode.options.disabled);\r\n }\r\n //updateInputOptions(newNode, schema, jsf);\r\n if (!newNode.options.title && newNode.name && !/^\\d+$/.test(newNode.name)) {\r\n newNode.options.title = fixTitle(newNode.name);\r\n }\r\n\r\n if (newNode.dataType === 'object') {\r\n if (isArray(schema.required) && !nodeDataMap.has('required')) {\r\n nodeDataMap.set('required', schema.required);\r\n }\r\n if (isObject(schema.properties)) {\r\n const newSection: any[] = [];\r\n const propertyKeys = schema['ui:order'] || Object.keys(schema.properties);\r\n if (propertyKeys.includes('*') && !hasOwn(schema.properties, '*')) {\r\n const unnamedKeys = Object.keys(schema.properties)\r\n .filter(key => !propertyKeys.includes(key));\r\n for (let i = propertyKeys.length - 1; i >= 0; i--) {\r\n if (propertyKeys[i] === '*') {\r\n propertyKeys.splice(i, 1, ...unnamedKeys);\r\n }\r\n }\r\n }\r\n propertyKeys\r\n .filter(key => hasOwn(schema.properties, key) ||\r\n hasOwn(schema, 'additionalProperties')\r\n )\r\n .forEach(key => {\r\n const keySchemaPointer = hasOwn(schema.properties, key) ?\r\n '/properties/' + key : '/additionalProperties';\r\n const innerItem = buildLayoutFromSchema(\r\n jsf, widgetLibrary, isObject(nodeValue) ? nodeValue[key] : null,\r\n schemaPointer + keySchemaPointer,\r\n dataPointer + '/' + key,\r\n false, null, null, forRefLibrary, dataPointerPrefix\r\n );\r\n if (innerItem) {\r\n innerItem.schemaPointer=schemaPointer + keySchemaPointer;\r\n if (isInputRequired(schema, '/' + key)) {\r\n innerItem.options.required = true;\r\n jsf.fieldsRequired = true;\r\n }\r\n newSection.push(innerItem);\r\n }\r\n });\r\n\r\n //treat allOf the same as any of but need to add an extra\r\n //condition for which anyOf item is to be rendered \r\n [\"allOf\", \"anyOf\",\"oneOf\"].forEach(ofType => {\r\n if (hasOwn(schema, ofType) && isArray(schema[ofType])) {\r\n\r\n let outerOneOfItem; \r\n \r\n if(ofType==\"oneOf\"){\r\n outerOneOfItem = buildLayoutFromSchema(\r\n jsf, widgetLibrary, schema.oneOf,//{type:\"tabarray\",items:schema.oneOf},\r\n \"/\",//schemaPointer + `/${ofType}`,\r\n dataPointer,\r\n false, null, null, forRefLibrary, dataPointerPrefix,\r\n //{type:\"tabarray\",items:schema.oneOf,oneOf:schema.oneOf}\r\n {type:\"one-of\",items:schema.oneOf,oneOf:schema.oneOf}\r\n );\r\n //outerItem.items=cloneDeep(newSection);\r\n //newSection.length=0;\r\n newSection.push(outerOneOfItem);\r\n \r\n }\r\n \r\n schema[ofType].forEach((ofItem, ind) => {\r\n const keySchemaPointer = `/${ofType}/${ind}`;\r\n const innerItem = buildLayoutFromSchema(\r\n jsf, widgetLibrary, ofItem,\r\n schemaPointer + keySchemaPointer,\r\n dataPointer,\r\n false, null, null, ofType==\"oneOf\"/*forRefLibrary*/, dataPointerPrefix\r\n );\r\n if (innerItem) {\r\n //newSection.push(innerItem);\r\n if(innerItem.items){\r\n innerItem.items.forEach(innerItemLevel2=>{\r\n const l2SchemaPointer = hasOwn(ofItem,'properties') ?\r\n '/properties/' +innerItemLevel2.name:innerItemLevel2.name;\r\n //innerItemLevel2.oneOfPointer = schemaPointer + keySchemaPointer + l2SchemaPointer;\r\n // innerItemLevel2.schemaPointer=innerItemLevel2.schemaPointer; \r\n const ofPointer={anyOf:\"anyOfPointer\",oneOf:\"oneOfPointer\"}[ofType];\r\n innerItemLevel2[ofPointer]=ofPointer?innerItemLevel2.schemaPointer:undefined;\r\n })\r\n\r\n }\r\n //TODO review-will never reach here if forRefLibrary==true\r\n if (isArray(innerItem)) {\r\n let outerOneOfItemTpl=cloneDeep(newNode);\r\n outerOneOfItemTpl\r\n innerItem.forEach(item => {\r\n const l2SchemaPointer = hasOwn(ofItem,'properties') ?\r\n '/properties/' +item.name:item.name;\r\n if(ofType==\"anyOf\"){\r\n item.anyOfPointer=item.schemaPointer;\r\n }\r\n if(outerOneOfItem){\r\n ////item.oneOfPointer = schemaPointer + keySchemaPointer + l2SchemaPointer;\r\n //schemaPointer + keySchemaPointer + item.dataPointer;\r\n ////item.schemaPointer=item.oneOfPointer; \r\n\r\n /*\r\n outerOneOfItem.items=outerOneOfItem.items||[];\r\n outerOneOfItem.items.push(item);\r\n */\r\n outerOneOfItemTpl.items=outerOneOfItemTpl.items||[];\r\n outerOneOfItemTpl.items.push(item);\r\n \r\n }else{\r\n newSection.push(item);\r\n }\r\n\r\n });\r\n if(outerOneOfItem){\r\n outerOneOfItem.items=outerOneOfItem.items||[];\r\n outerOneOfItem.items.push(outerOneOfItemTpl);\r\n }\r\n //TODO test-might not work for more than 2 levels of nesting\r\n }else {\r\n if(outerOneOfItem){\r\n const ofPointer={anyOf:\"anyOfPointer\",oneOf:\"oneOfPointer\"}[ofType];\r\n innerItem[ofPointer]=ofPointer?schemaPointer + keySchemaPointer:undefined;\r\n ////innerItem.schemaPointer=innerItem.oneOfPointer; \r\n outerOneOfItem.items=outerOneOfItem.items||[];\r\n outerOneOfItem.items.push(innerItem);\r\n }else{\r\n newSection.push(innerItem)\r\n }\r\n }\r\n }\r\n })\r\n\r\n }\r\n })\r\n\r\n if (hasOwn(schema, \"if\")) {\r\n [\"then\", \"else\"].forEach(con => {\r\n if (hasOwn(schema, con)) {\r\n const keySchemaPointer = `/${con}`;\r\n const negateClause = con == \"else\";\r\n const innerItem = buildLayoutFromSchema(\r\n jsf, widgetLibrary, nodeValue[con],\r\n schemaPointer + keySchemaPointer,\r\n dataPointer,\r\n false, null, null, forRefLibrary, dataPointerPrefix\r\n );\r\n if (innerItem) {\r\n applyITEConditions(innerItem,schemaPointer,keySchemaPointer,negateClause)\r\n if (isArray(innerItem)) {\r\n innerItem.forEach(item => {\r\n //item.schemaPointer = schemaPointer + keySchemaPointer + item.dataPointer;\r\n //item.options.condition = convertJSONSchemaIfToCondition(schema, negateClause);\r\n newSection.push(item);\r\n });\r\n }\r\n else {\r\n //innerItem.schemaPointer = schemaPointer + keySchemaPointer + innerItem.dataPointer;\r\n //innerItem.options.condition = convertJSONSchemaIfToCondition(schema, negateClause);\r\n newSection.push(innerItem)\r\n }\r\n }\r\n }\r\n })\r\n\r\n\r\n }\r\n\r\n if (dataPointer === '' && !forRefLibrary) {\r\n newNode = newSection;\r\n } else {\r\n newNode.items = newSection;\r\n }\r\n }\r\n // TODO: Add patternProperties and additionalProperties inputs?\r\n // ... possibly provide a way to enter both key names and values?\r\n // if (isObject(schema.patternProperties)) { }\r\n // if (isObject(schema.additionalProperties)) { }\r\n\r\n } else if (newNode.dataType === 'array') {\r\n newNode.items = [];\r\n newNode.options.maxItems = Math.min(\r\n schema.maxItems || 1000, newNode.options.maxItems || 1000\r\n );\r\n newNode.options.minItems = Math.max(\r\n schema.minItems || 0, newNode.options.minItems || 0\r\n );\r\n if (!newNode.options.minItems && isInputRequired(jsSchema, schemaPointer)) {\r\n newNode.options.minItems = 1;\r\n }\r\n if (!hasOwn(newNode.options, 'listItems')) { newNode.options.listItems = 1; }\r\n newNode.options.tupleItems = isArray(schema.items) ? schema.items.length : 0;\r\n if (newNode.options.maxItems <= newNode.options.tupleItems) {\r\n newNode.options.tupleItems = newNode.options.maxItems;\r\n newNode.options.listItems = 0;\r\n } else if (newNode.options.maxItems <\r\n newNode.options.tupleItems + newNode.options.listItems\r\n ) {\r\n newNode.options.listItems = newNode.options.maxItems - newNode.options.tupleItems;\r\n } else if (newNode.options.minItems >\r\n newNode.options.tupleItems + newNode.options.listItems\r\n ) {\r\n newNode.options.listItems = newNode.options.minItems - newNode.options.tupleItems;\r\n }\r\n if (!nodeDataMap.has('maxItems')) {\r\n nodeDataMap.set('maxItems', newNode.options.maxItems);\r\n nodeDataMap.set('minItems', newNode.options.minItems);\r\n nodeDataMap.set('tupleItems', newNode.options.tupleItems);\r\n nodeDataMap.set('listItems', newNode.options.listItems);\r\n }\r\n if (!jsf.arrayMap.has(shortDataPointer)) {\r\n jsf.arrayMap.set(shortDataPointer, newNode.options.tupleItems);\r\n }\r\n removable = newNode.options.removable !== false;\r\n let additionalItemsSchemaPointer: string = null;\r\n\r\n // If 'items' is an array = tuple items\r\n if (isArray(schema.items)) {\r\n newNode.items = [];\r\n for (let i = 0; i < newNode.options.tupleItems; i++) {\r\n let newItem: any;\r\n const itemRefPointer = removeRecursiveReferences(\r\n shortDataPointer + '/' + i, jsf.dataRecursiveRefMap, jsf.arrayMap\r\n );\r\n const itemRecursive = !itemRefPointer.length ||\r\n itemRefPointer !== shortDataPointer + '/' + i;\r\n\r\n // If removable, add tuple item layout to layoutRefLibrary\r\n if (removable && i >= newNode.options.minItems) {\r\n let conditionalRefPointer=`${itemRefPointer}@${schemaPointer}`;\r\n let templateRefToUse=itemRefPointer;\r\n if (hasOwn(jsf.layoutRefLibrary, itemRefPointer)\r\n && !hasOwn(jsf.layoutRefLibrary, conditionalRefPointer)) {\r\n jsf.layoutRefLibrary[conditionalRefPointer] = buildLayoutFromSchema(\r\n jsf, widgetLibrary, isArray(nodeValue) ? nodeValue[i] : null,\r\n schemaPointer + '/items/' + i,\r\n itemRecursive ? '' : dataPointer + '/' + i,\r\n true, 'tuple', true, true, itemRecursive ? dataPointer + '/' + i : ''\r\n );\r\n templateRefToUse=conditionalRefPointer;\r\n }\r\n if (!hasOwn(jsf.layoutRefLibrary, itemRefPointer)) {\r\n // Set to null first to prevent recursive reference from causing endless loop\r\n jsf.layoutRefLibrary[itemRefPointer] = null;\r\n jsf.layoutRefLibrary[itemRefPointer] = buildLayoutFromSchema(\r\n jsf, widgetLibrary, isArray(nodeValue) ? nodeValue[i] : null,\r\n schemaPointer + '/items/' + i,\r\n itemRecursive ? '' : dataPointer + '/' + i,\r\n true, 'tuple', true, true, itemRecursive ? dataPointer + '/' + i : ''\r\n );\r\n if (itemRecursive) {\r\n jsf.layoutRefLibrary[itemRefPointer].recursiveReference = true;\r\n }\r\n jsf.layoutRefLibrary[conditionalRefPointer]=jsf.layoutRefLibrary[itemRefPointer];\r\n }\r\n newItem = getLayoutNode({\r\n $ref: templateRefToUse,\r\n dataPointer: dataPointer + '/' + i,\r\n recursiveReference: itemRecursive,\r\n }, jsf, widgetLibrary, isArray(nodeValue) ? nodeValue[i] : null);\r\n } else {\r\n newItem = buildLayoutFromSchema(\r\n jsf, widgetLibrary, isArray(nodeValue) ? nodeValue[i] : null,\r\n schemaPointer + '/items/' + i,\r\n dataPointer + '/' + i,\r\n true, 'tuple', false, forRefLibrary, dataPointerPrefix\r\n );\r\n }\r\n if (newItem) { newNode.items.push(newItem); }\r\n }\r\n\r\n // If 'additionalItems' is an object = additional list items, after tuple items\r\n if (isObject(schema.additionalItems)) {\r\n additionalItemsSchemaPointer = schemaPointer + '/additionalItems';\r\n }\r\n\r\n // If 'items' is an object = list items only (no tuple items)\r\n } else if (isObject(schema.items)) {\r\n additionalItemsSchemaPointer = schemaPointer + '/items';\r\n }\r\n\r\n if (additionalItemsSchemaPointer) {\r\n const itemRefPointer = removeRecursiveReferences(\r\n shortDataPointer + '/-', jsf.dataRecursiveRefMap, jsf.arrayMap\r\n );\r\n const itemRecursive = !itemRefPointer.length ||\r\n itemRefPointer !== shortDataPointer + '/-';\r\n const itemSchemaPointer = removeRecursiveReferences(\r\n additionalItemsSchemaPointer, jsf.schemaRecursiveRefMap, jsf.arrayMap\r\n );\r\n let conditionalRefPointer=`${itemRefPointer}@${schemaPointer}`;\r\n let templateRefToUse=itemRefPointer;\r\n if (hasOwn(jsf.layoutRefLibrary, itemRefPointer)\r\n && !hasOwn(jsf.layoutRefLibrary, conditionalRefPointer)) {\r\n jsf.layoutRefLibrary[conditionalRefPointer] = buildLayoutFromSchema(\r\n jsf, widgetLibrary, null,\r\n itemSchemaPointer,\r\n itemRecursive ? '' : dataPointer + '/-',\r\n true, 'list', removable, true, itemRecursive ? dataPointer + '/-' : ''\r\n )\r\n templateRefToUse=conditionalRefPointer;\r\n }\r\n // Add list item layout to layoutRefLibrary\r\n if (itemRefPointer.length && !hasOwn(jsf.layoutRefLibrary, itemRefPointer)) {\r\n // Set to null first to prevent recursive reference from causing endless loop\r\n jsf.layoutRefLibrary[itemRefPointer] = null;\r\n jsf.layoutRefLibrary[itemRefPointer] = buildLayoutFromSchema(\r\n jsf, widgetLibrary, null,\r\n itemSchemaPointer,\r\n itemRecursive ? '' : dataPointer + '/-',\r\n true, 'list', removable, true, itemRecursive ? dataPointer + '/-' : ''\r\n );\r\n if (itemRecursive) {\r\n jsf.layoutRefLibrary[itemRefPointer].recursiveReference = true;\r\n }\r\n jsf.layoutRefLibrary[conditionalRefPointer]=jsf.layoutRefLibrary[itemRefPointer];\r\n }\r\n\r\n // Add any additional default items\r\n if (!itemRecursive || newNode.options.required) {\r\n const arrayLength = Math.min(Math.max(\r\n itemRecursive ? 0 :\r\n newNode.options.tupleItems + newNode.options.listItems,\r\n isArray(nodeValue) ? nodeValue.length : 0\r\n ), newNode.options.maxItems);\r\n if (newNode.items.length < arrayLength) {\r\n for (let i = newNode.items.length; i < arrayLength; i++) {\r\n newNode.items.push(getLayoutNode({\r\n $ref: templateRefToUse,\r\n dataPointer: dataPointer + '/-',\r\n recursiveReference: itemRecursive,\r\n }, jsf, widgetLibrary, isArray(nodeValue) ? nodeValue[i] : null));\r\n }\r\n }\r\n }\r\n\r\n // If needed, add button to add items to array\r\n if (newNode.options.addable !== false &&\r\n newNode.options.minItems < newNode.options.maxItems &&\r\n (newNode.items[newNode.items.length - 1] || {}).type !== '$ref'\r\n ) {\r\n let buttonText =\r\n ((jsf.layoutRefLibrary[itemRefPointer] || {}).options || {}).title;\r\n const prefix = buttonText ? 'Add ' : 'Add to ';\r\n if (!buttonText) {\r\n buttonText = schema.title || fixTitle(JsonPointer.toKey(dataPointer));\r\n }\r\n if (!/^add\\b/i.test(buttonText)) { buttonText = prefix + buttonText; }\r\n newNode.items.push({\r\n _id: uniqueId(),\r\n arrayItem: true,\r\n arrayItemType: 'list',\r\n dataPointer: newNode.dataPointer + '/-',\r\n options: {\r\n listItems: newNode.options.listItems,\r\n maxItems: newNode.options.maxItems,\r\n minItems: newNode.options.minItems,\r\n removable: false,\r\n title: buttonText,\r\n tupleItems: newNode.options.tupleItems,\r\n },\r\n recursiveReference: itemRecursive,\r\n type: '$ref',\r\n widget: widgetLibrary.getWidget('$ref'),\r\n $ref: templateRefToUse//itemRefPointer,\r\n });\r\n }\r\n }\r\n\r\n } else if (newNode.dataType === '$ref') {\r\n const schemaRef = JsonPointer.compile(schema.$ref);\r\n const dataRef = JsonPointer.toDataPointer(schemaRef, jsSchema);\r\n let buttonText = '';\r\n\r\n // Get newNode title\r\n if (newNode.options.add) {\r\n buttonText = newNode.options.add;\r\n } else if (newNode.name && !/^\\d+$/.test(newNode.name)) {\r\n buttonText =\r\n (/^add\\b/i.test(newNode.name) ? '' : 'Add ') + fixTitle(newNode.name);\r\n\r\n // If newNode doesn't have a title, look for title of parent array item\r\n } else {\r\n const parentSchema =\r\n JsonPointer.get(jsSchema, schemaPointer, 0, -1);\r\n if (hasOwn(parentSchema, 'title')) {\r\n buttonText = 'Add to ' + parentSchema.title;\r\n } else {\r\n const pointerArray = JsonPointer.parse(newNode.dataPointer);\r\n buttonText = 'Add to ' + fixTitle(pointerArray[pointerArray.length - 2]);\r\n }\r\n }\r\n Object.assign(newNode, {\r\n recursiveReference: true,\r\n widget: widgetLibrary.getWidget('$ref'),\r\n $ref: dataRef,\r\n });\r\n Object.assign(newNode.options, {\r\n removable: false,\r\n title: buttonText,\r\n });\r\n if (isNumber(JsonPointer.get(jsSchema, schemaPointer, 0, -1).maxItems)) {\r\n newNode.options.maxItems =\r\n JsonPointer.get(jsSchema, schemaPointer, 0, -1).maxItems;\r\n }\r\n\r\n // Add layout template to layoutRefLibrary\r\n if (dataRef.length) {\r\n if (!hasOwn(jsf.layoutRefLibrary, dataRef)) {\r\n // Set to null first to prevent recursive reference from causing endless loop\r\n jsf.layoutRefLibrary[dataRef] = null;\r\n const newLayout = buildLayoutFromSchema(\r\n jsf, widgetLibrary, null, schemaRef, '',\r\n newNode.arrayItem, newNode.arrayItemType, true, true, dataPointer\r\n );\r\n if (newLayout) {\r\n newLayout.recursiveReference = true;\r\n jsf.layoutRefLibrary[dataRef] = newLayout;\r\n } else {\r\n delete jsf.layoutRefLibrary[dataRef];\r\n }\r\n } else if (!jsf.layoutRefLibrary[dataRef].recursiveReference) {\r\n jsf.layoutRefLibrary[dataRef].recursiveReference = true;\r\n }\r\n }\r\n }else if (newNode.type === 'if') {\r\n const newSection: any[] = [];\r\n [\"then\", \"else\"].forEach(con => {\r\n if (hasOwn(schema, con)) {\r\n\r\n const keySchemaPointer = `/${con}`;\r\n const negateClause = con == \"else\";\r\n const innerItem = buildLayoutFromSchema(\r\n jsf, widgetLibrary, nodeValue[con],\r\n schemaPointer + keySchemaPointer,\r\n dataPointer,\r\n false, null, null, forRefLibrary, dataPointerPrefix\r\n );\r\n if (innerItem) {\r\n applyITEConditions(innerItem,schemaPointer,keySchemaPointer,negateClause)\r\n if (isArray(innerItem)) {\r\n innerItem.forEach(item => {\r\n //item.schemaPointer = schemaPointer + keySchemaPointer + item.dataPointer;\r\n //item.options.condition = convertJSONSchemaIfToCondition(schema, negateClause);\r\n newSection.push(item);\r\n /////// newNode = newSection\r\n });\r\n } else {\r\n //innerItem.schemaPointer = schemaPointer + keySchemaPointer + innerItem.dataPointer;\r\n //innerItem.options.condition = convertJSONSchemaIfToCondition(schema, negateClause);\r\n ///////newNode = innerItem\r\n newSection.push(innerItem);\r\n }\r\n }\r\n }\r\n })\r\n newNode = newSection;\r\n }\r\n\r\n return newNode;\r\n}\r\n\r\n/**\r\n * 'mapLayout' function\r\n *\r\n * Creates a new layout by running each element in an existing layout through\r\n * an iteratee. Recursively maps within array elements 'items' and 'tabs'.\r\n * The iteratee is invoked with four arguments: (value, index, layout, path)\r\n *\r\n * The returned layout may be longer (or shorter) then the source layout.\r\n *\r\n * If an item from the source layout returns multiple items (as '*' usually will),\r\n * this function will keep all returned items in-line with the surrounding items.\r\n *\r\n * If an item from the source layout causes an error and returns null, it is\r\n * skipped without error, and the function will still return all non-null items.\r\n *\r\n * // layout - the layout to map\r\n * // { (v: any, i?: number, l?: any, p?: string) => any }\r\n * function - the funciton to invoke on each element\r\n * // { string|string[] = '' } layoutPointer - the layoutPointer to layout, inside rootLayout\r\n * // { any[] = layout } rootLayout - the root layout, which conatins layout\r\n * //\r\n */\r\nexport function mapLayout(layout, fn, layoutPointer = '', rootLayout = layout) {\r\n let indexPad = 0;\r\n let newLayout: any[] = [];\r\n forEach(layout, (item, index) => {\r\n const realIndex = +index + indexPad;\r\n const newLayoutPointer = layoutPointer + '/' + realIndex;\r\n let newNode: any = copy(item);\r\n let itemsArray: any[] = [];\r\n if (isObject(item)) {\r\n if (hasOwn(item, 'tabs')) {\r\n item.items = item.tabs;\r\n delete item.tabs;\r\n }\r\n if (hasOwn(item, 'items')) {\r\n itemsArray = isArray(item.items) ? item.items : [item.items];\r\n }\r\n }\r\n if (itemsArray.length) {\r\n newNode.items = mapLayout(itemsArray, fn, newLayoutPointer + '/items', rootLayout);\r\n }\r\n newNode = fn(newNode, realIndex, newLayoutPointer, rootLayout);\r\n if (!isDefined(newNode)) {\r\n indexPad--;\r\n } else {\r\n if (isArray(newNode)) { indexPad += newNode.length - 1; }\r\n newLayout = newLayout.concat(newNode);\r\n }\r\n });\r\n return newLayout;\r\n}\r\n\r\n/**\r\n * 'getLayoutNode' function\r\n * Copy a new layoutNode from layoutRefLibrary\r\n *\r\n * // refNode -\r\n * // layoutRefLibrary -\r\n * // { any = null } widgetLibrary -\r\n * // { any = null } nodeValue -\r\n * // copied layoutNode\r\n */\r\nexport function getLayoutNode(\r\n refNode, jsf, widgetLibrary: any = null, nodeValue: any = null\r\n) {\r\n\r\n // If recursive reference and building initial layout, return Add button\r\n if (refNode.recursiveReference && widgetLibrary) {\r\n const newLayoutNode = cloneDeep(refNode);\r\n if (!newLayoutNode.options) { newLayoutNode.options = {}; }\r\n Object.assign(newLayoutNode, {\r\n recursiveReference: true,\r\n widget: widgetLibrary.getWidget('$ref'),\r\n });\r\n Object.assign(newLayoutNode.options, {\r\n removable: false,\r\n title: 'Add ' + newLayoutNode.$ref,\r\n });\r\n return newLayoutNode;\r\n\r\n // Otherwise, return referenced layout\r\n } else {\r\n let newLayoutNode = jsf.layoutRefLibrary[refNode.$ref];\r\n // If value defined, build new node from schema (to set array lengths)\r\n if (isDefined(nodeValue)) {\r\n newLayoutNode = buildLayoutFromSchema(\r\n jsf, widgetLibrary, nodeValue,\r\n JsonPointer.toSchemaPointer(refNode.$ref, jsf.schema),\r\n refNode.$ref, newLayoutNode.arrayItem,\r\n newLayoutNode.arrayItemType, newLayoutNode.options.removable, false\r\n );\r\n } else {\r\n // If value not defined, copy node from layoutRefLibrary\r\n newLayoutNode = cloneDeep(newLayoutNode);\r\n JsonPointer.forEachDeep(newLayoutNode, (subNode, pointer) => {\r\n\r\n // Reset all _id's in newLayoutNode to unique values\r\n if (hasOwn(subNode, '_id')) { subNode._id = uniqueId(); }\r\n\r\n // If adding a recursive item, prefix current dataPointer\r\n // to all dataPointers in new layoutNode\r\n if (refNode.recursiveReference && hasOwn(subNode, 'dataPointer')) {\r\n subNode.dataPointer = refNode.dataPointer + subNode.dataPointer;\r\n }\r\n });\r\n }\r\n return newLayoutNode;\r\n }\r\n}\r\n\r\n/**\r\n * 'buildTitleMap' function\r\n *\r\n * // titleMap -\r\n * // enumList -\r\n * // { boolean = true } fieldRequired -\r\n * // { boolean = true } flatList -\r\n * // { TitleMapItem[] }\r\n */\r\nexport function buildTitleMap(\r\n titleMap, enumList, fieldRequired = true, flatList = true\r\n) {\r\n let newTitleMap: TitleMapItem[] = [];\r\n let hasEmptyValue = false;\r\n if (titleMap) {\r\n if (isArray(titleMap)) {\r\n if (enumList) {\r\n for (const i of Object.keys(titleMap)) {\r\n if (isObject(titleMap[i])) { // JSON Form style\r\n const value = titleMap[i].value;\r\n if (enumList.includes(value)) {\r\n const name = titleMap[i].name;\r\n newTitleMap.push({ name, value });\r\n if (value === undefined || value === null) { hasEmptyValue = true; }\r\n }\r\n } else if (isString(titleMap[i])) { // React Jsonschema Form style\r\n if (i < enumList.length) {\r\n const name = titleMap[i];\r\n const value = enumList[i];\r\n newTitleMap.push({ name, value });\r\n if (value === undefined || value === null) { hasEmptyValue = true; }\r\n }\r\n }\r\n }\r\n } else { // If array titleMap and no enum list, just return the titleMap - Angular Schema Form style\r\n newTitleMap = titleMap;\r\n if (!fieldRequired) {\r\n hasEmptyValue = !!newTitleMap\r\n .filter(i => i.value === undefined || i.value === null)\r\n .length;\r\n }\r\n }\r\n } else if (enumList) { // Alternate JSON Form style, with enum list\r\n for (const i of Object.keys(enumList)) {\r\n const value = enumList[i];\r\n if (hasOwn(titleMap, value)) {\r\n const name = titleMap[value];\r\n newTitleMap.push({ name, value });\r\n if (value === undefined || value === null) { hasEmptyValue = true; }\r\n }\r\n }\r\n } else { // Alternate JSON Form style, without enum list\r\n for (const value of Object.keys(titleMap)) {\r\n const name = titleMap[value];\r\n newTitleMap.push({ name, value });\r\n if (value === undefined || value === null) { hasEmptyValue = true; }\r\n }\r\n }\r\n } else if (enumList) { // Build map from enum list alone\r\n for (const i of Object.keys(enumList)) {\r\n const name = enumList[i];\r\n const value = enumList[i];\r\n newTitleMap.push({ name, value });\r\n if (value === undefined || value === null) { hasEmptyValue = true; }\r\n }\r\n } else { // If no titleMap and no enum list, return default map of boolean values\r\n newTitleMap = [{ name: 'True', value: true }, { name: 'False', value: false }];\r\n }\r\n\r\n // Does titleMap have groups?\r\n if (newTitleMap.some(title => hasOwn(title, 'group'))) {\r\n hasEmptyValue = false;\r\n\r\n // If flatList = true, flatten items & update name to group: name\r\n if (flatList) {\r\n newTitleMap = newTitleMap.reduce((groupTitleMap, title) => {\r\n if (hasOwn(title, 'group')) {\r\n if (isArray(title.items)) {\r\n groupTitleMap = [\r\n ...groupTitleMap,\r\n ...title.items.map(item =>\r\n ({ ...item, ...{ name: `${title.group}: ${item.name}` } })\r\n )\r\n ];\r\n if (title.items.some(item => item.value === undefined || item.value === null)) {\r\n hasEmptyValue = true;\r\n }\r\n }\r\n if (hasOwn(title, 'name') && hasOwn(title, 'value')) {\r\n title.name = `${title.group}: ${title.name}`;\r\n delete title.group;\r\n groupTitleMap.push(title);\r\n if (title.value === undefined || title.value === null) {\r\n hasEmptyValue = true;\r\n }\r\n }\r\n } else {\r\n groupTitleMap.push(title);\r\n if (title.value === undefined || title.value === null) {\r\n hasEmptyValue = true;\r\n }\r\n }\r\n return groupTitleMap;\r\n }, []);\r\n\r\n // If flatList = false, combine items from matching groups\r\n } else {\r\n newTitleMap = newTitleMap.reduce((groupTitleMap, title) => {\r\n if (hasOwn(title, 'group')) {\r\n if (title.group !== (groupTitleMap[groupTitleMap.length - 1] || {}).group) {\r\n groupTitleMap.push({ group: title.group, items: title.items || [] });\r\n }\r\n if (hasOwn(title, 'name') && hasOwn(title, 'value')) {\r\n groupTitleMap[groupTitleMap.length - 1].items\r\n .push({ name: title.name, value: title.value });\r\n if (title.value === undefined || title.value === null) {\r\n hasEmptyValue = true;\r\n }\r\n }\r\n } else {\r\n groupTitleMap.push(title);\r\n if (title.value === undefined || title.value === null) {\r\n hasEmptyValue = true;\r\n }\r\n }\r\n return groupTitleMap;\r\n }, []);\r\n }\r\n }\r\n if (!fieldRequired && !hasEmptyValue) {\r\n newTitleMap.unshift({ name: '<em>None</em>', value: null });\r\n }\r\n return newTitleMap;\r\n}\r\n","// Warning: Changing the following order may cause errors if the new order\r\n// causes a library to be imported before another library it depends on.\r\n\r\nexport {\r\n _executeAsyncValidators, _executeValidators, _mergeErrors, _mergeObjects, _toPromise, AsyncIValidatorFn, getType, hasValue, inArray, isArray, isBoolean, isDate, isDefined, isEmpty, isFunction, isInteger, isMap, isNumber, isObject, isObservable, isPrimitive, isPromise, isSet, isString, isType, IValidatorFn, JavaScriptPrimitiveType,\r\n JavaScriptType, PlainObject, PrimitiveValue, SchemaPrimitiveType, SchemaType, toJavaScriptType, toObservable, toSchemaType, xor\r\n} from './validator.functions';\r\n\r\nexport {\r\n addClasses, commonItems, copy, fixTitle, forEach, forEachCopy, hasNonNullValue, hasOwn, mergeFilteredObject, toTitleCase, uniqueItems\r\n} from './utility.functions';\r\n\r\nexport { JsonPointer, Pointer } from './jsonpointer.functions';\r\n\r\nexport { JsonValidators } from './json.validators';\r\n\r\nexport { buildSchemaFromData, buildSchemaFromLayout, checkInlineType, combineAllOf, fixRequiredArrayProperties, getControlValidators, getFromSchema, getInputType, getSubSchema, getTitleMapFromOneOf, isInputRequired, removeRecursiveReferences, resolveSchemaReferences, updateInputOptions } from './json-schema.functions';\r\n\r\nexport { convertSchemaToDraft6 } from './convert-schema-to-draft6.function';\r\n\r\nexport { mergeSchemas } from './merge-schemas.function';\r\n\r\nexport {\r\n buildFormGroup, buildFormGroupTemplate, formatFormData,\r\n getControl, path2ControlKey, setControl, setRequiredFields\r\n} from './form-group.functions';\r\n\r\nexport {\r\n buildLayout, buildLayoutFromSchema, buildTitleMap, getLayoutNode, mapLayout\r\n} from './layout.functions';\r\n\r\n","import { Injectable, OnDestroy, Signal } from '@angular/core';\r\nimport { AbstractControl, UntypedFormArray, UntypedFormGroup } from '@angular/forms';\r\n//import Ajv, { ErrorObject, Options } from 'ajv';\r\nimport addFormats from \"ajv-formats\";\r\nimport Ajv2019, { ErrorObject, Options, ValidateFunction } from 'ajv/dist/2019';\r\nimport jsonDraft6 from 'ajv/lib/refs/json-schema-draft-06.json';\r\nimport jsonDraft7 from 'ajv/lib/refs/json-schema-draft-07.json';\r\nimport cloneDeep from 'lodash/cloneDeep';\r\nimport { BehaviorSubject, Subject, Subscription } from 'rxjs';\r\nimport {\r\n deValidationMessages,\r\n enValidationMessages,\r\n esValidationMessages,\r\n frValidationMessages,\r\n itValidationMessages,\r\n ptValidationMessages,\r\n zhValidationMessages\r\n} from './locale';\r\nimport {\r\n JsonPointer,\r\n buildFormGroup,\r\n buildFormGroupTemplate,\r\n buildLayout,\r\n buildSchemaFromData,\r\n buildSchemaFromLayout,\r\n fixTitle,\r\n forEach,\r\n formatFormData,\r\n getControl,\r\n getLayoutNode,\r\n hasOwn,\r\n hasValue,\r\n isArray,\r\n isDefined,\r\n isEmpty,\r\n isObject,\r\n removeRecursiveReferences,\r\n toTitleCase\r\n} from './shared';\r\n\r\nimport { default as _isEqual, default as isEqual } from 'lodash/isEqual';\r\nimport { setControl } from './shared/form-group.functions';\r\n\r\n\r\nexport type WidgetContext={\r\n formControl?:AbstractControl;\r\n layoutNode?: Signal<any>;\r\n layoutIndex?: Signal<number[]>;\r\n dataIndex?: Signal<number[]>;\r\n options?:any;\r\n controlValue?:any;\r\n boundControl?:boolean;\r\n controlName?:string;\r\n controlDisabled?:boolean\r\n}\r\n\r\nexport type AJVRegistryItem={\r\n [name: string]:{\r\n name:string,\r\n ajvInstance:Ajv2019\r\n ajvValidator:ValidateFunction\r\n }\r\n}\r\n\r\nexport interface TitleMapItem {\r\n name?: string;\r\n value?: any;\r\n checked?: boolean;\r\n group?: string;\r\n items?: TitleMapItem[];\r\n}\r\nexport interface ErrorMessages {\r\n [control_name: string]: {\r\n message: string | Function | Object;\r\n code: string;\r\n }[];\r\n}\r\n\r\n@Injectable()\r\nexport class JsonSchemaFormService implements OnDestroy {\r\n JsonFormCompatibility = false;\r\n ReactJsonSchemaFormCompatibility = false;\r\n AngularSchemaFormCompatibility = false;\r\n tpldata: any = {};\r\n\r\n ajvOptions: Options = {\r\n allErrors: true,\r\n //validateFormats:false,\r\n strict:false\r\n \r\n };\r\n ajv:any = new Ajv2019(this.ajvOptions); // AJV: Another JSON Schema Validator\r\n \r\n //Being replaced by getAjvValidator()\r\n validateFormData: any = null; // Compiled AJV function to validate active form's schema\r\n\r\n formValues: any = {}; // Internal form data (may not have correct types)\r\n data: any = {}; // Output form data (formValues, formatted with correct data types)\r\n schema: any = {}; // Internal JSON Schema\r\n layout: any[] = []; // Internal form layout\r\n formGroupTemplate: any = {}; // Template used to create formGroup\r\n formGroup: any = null; // Angular formGroup, which powers the reactive form\r\n framework: any = null; // Active framework component\r\n formOptions: any; // Active options, used to configure the form\r\n\r\n validData: any = null; // Valid form data (or null) (=== isValid ? data : null)\r\n isValid: boolean = null; // Is current form data valid?\r\n ajvErrors: ErrorObject[] = null; // Ajv errors for current data\r\n validationErrors: any = null; // Any validation errors for current data\r\n dataErrors: any = new Map(); //\r\n formValueSubscription: any = null; // Subscription to formGroup.valueChanges observable (for un- and re-subscribing)\r\n dataChanges: Subject<any> = new Subject(); // Form data observable\r\n isValidChanges: Subject<any> = new Subject(); // isValid observable\r\n validationErrorChanges: Subject<any> = new Subject(); // validationErrors observable\r\n\r\n arrayMap: Map<string, number> = new Map(); // Maps arrays in data object and number of tuple values\r\n dataMap: Map<string, any> = new Map(); // Maps paths in form data to schema and formGroup paths\r\n dataRecursiveRefMap: Map<string, string> = new Map(); // Maps recursive reference points in form data\r\n schemaRecursiveRefMap: Map<string, string> = new Map(); // Maps recursive reference points in schema\r\n schemaRefLibrary: any = {}; // Library of schemas for resolving schema $refs\r\n layoutRefLibrary: any = { '': null }; // Library of layout nodes for adding to form\r\n templateRefLibrary: any = {}; // Library of formGroup templates for adding to form\r\n hasRootReference = false; // Does the form include a recursive reference to itself?\r\n\r\n language = 'en-US'; // Does the form include a recursive reference to itself?\r\n\r\n // Default global form options\r\n defaultFormOptions: any = {\r\n autocomplete: true, // Allow the web browser to remember previous form submission values as defaults\r\n addSubmit: 'auto', // Add a submit button if layout does not have one?\r\n // for addSubmit: true = always, false = never,\r\n // 'auto' = only if layout is undefined (form is built from schema alone)\r\n debug: false, // Show debugging output?\r\n disableInvalidSubmit: true, // Disable submit if form invalid?\r\n formDisabled: false, // Set entire form as disabled? (not editable, and disables outputs)\r\n formReadonly: false, // Set entire form as read only? (not editable, but outputs still enabled)\r\n fieldsRequired: false, // (set automatically) Are there any required fields in the form?\r\n framework: 'no-framework', // The framework to load\r\n loadExternalAssets: false, // Load external css and JavaScript for framework?\r\n pristine: { errors: true, success: true },\r\n supressPropertyTitles: false,\r\n setSchemaDefaults: 'auto', // Set fefault values from schema?\r\n // true = always set (unless overridden by layout default or formValues)\r\n // false = never set\r\n // 'auto' = set in addable components, and everywhere if formValues not set\r\n setLayoutDefaults: 'auto', // Set fefault values from layout?\r\n // true = always set (unless overridden by formValues)\r\n // false = never set\r\n // 'auto' = set in addable components, and everywhere if formValues not set\r\n validateOnRender: 'auto', // Validate fields immediately, before they are touched?\r\n // true = validate all fields immediately\r\n // false = only validate fields after they are touched by user\r\n // 'auto' = validate fields with values immediately, empty fields after they are touched\r\n widgets: {}, // Any custom widgets to load\r\n defaultWidgetOptions: {\r\n // Default options for form control widgets\r\n listItems: 1, // Number of list items to initially add to arrays with no default value\r\n addable: true, // Allow adding items to an array or $ref point?\r\n orderable: true, // Allow reordering items within an array?\r\n removable: true, // Allow removing items from an array or $ref point?\r\n enableErrorState: true, // Apply 'has-error' class when field fails validation?\r\n // disableErrorState: false, // Don't apply 'has-error' class when field fails validation?\r\n enableSuccessState: true, // Apply 'has-success' class when field validates?\r\n // disableSuccessState: false, // Don't apply 'has-success' class when field validates?\r\n feedback: false, // Show inline feedback icons?\r\n feedbackOnRender: false, // Show errorMessage on Render?\r\n notitle: false, // Hide title?\r\n disabled: false, // Set control as disabled? (not editable, and excluded from output)\r\n readonly: false, // Set control as read only? (not editable, but included in output)\r\n returnEmptyFields: true, // return values for fields that contain no data?\r\n validationMessages: {} // set by setLanguage()\r\n }\r\n };\r\n\r\n fcValueChangesSubs:Subscription;\r\n fcStatusChangesSubs:Subscription;\r\n\r\n //TODO-review,may not be needed as sortablejs replaces dnd\r\n //this has been added to enable or disable the dragabble state of a component\r\n //using the OrderableDirective, mainly when an <input type=\"range\"> \r\n //elements are present, as the draggable attribute makes it difficult to\r\n //slide the range sliders and end up dragging\r\n //NB this will be set globally for all OrderableDirective instances\r\n //and will only be enabled when/if the caller sets the value back to true \r\n private draggableStateSubject = new BehaviorSubject<boolean>(true); // Default value true\r\n draggableState$ = this.draggableStateSubject.asObservable();\r\n\r\n setDraggableState(value: boolean) {\r\n this.draggableStateSubject.next(value); // Update the draggable value\r\n }\r\n\r\n createAjvInstance(ajvOptions){\r\n let ajvInstance=new Ajv2019(ajvOptions); \r\n ajvInstance.addMetaSchema(jsonDraft6);\r\n ajvInstance.addMetaSchema(jsonDraft7);\r\n addFormats(ajvInstance);\r\n return ajvInstance;\r\n }\r\n\r\n createAndRegisterAjvInstance(ajvOptions,name?:string){\r\n const intanceName=name||`ajv_${Date.now()}`;\r\n if(this.ajvRegistry[intanceName]){\r\n throw new Error(`ajv instance with name:'${intanceName}' has already been registered`);\r\n }\r\n const ajvInstance=this.createAjvInstance(ajvOptions);\r\n this.ajvRegistry[intanceName]={\r\n name:intanceName,\r\n ajvInstance:ajvInstance,\r\n ajvValidator:null\r\n };\r\n return this.ajvRegistry[intanceName];\r\n }\r\n\r\n ajvRegistry:AJVRegistryItem={}\r\n\r\n getAjvInstance(name='default'){\r\n return this.ajvRegistry[name].ajvInstance;\r\n }\r\n getAjvValidator(name='default'){\r\n return this.ajvRegistry[name]?.ajvValidator;\r\n }\r\n\r\n constructor() {\r\n this.setLanguage(this.language);\r\n this.ajv.addMetaSchema(jsonDraft6);\r\n this.ajv.addMetaSchema(jsonDraft7);\r\n addFormats(this.ajv);\r\n this.ajvRegistry['default']={name:'default',ajvInstance:this.ajv,ajvValidator:null};\r\n // Add custom 'duration' format using a regex\r\n/* \r\nthis.ajv.addFormat(\"duration\", {\r\n type: \"string\",\r\n validate: (duration) => /^P(?!$)(\\d+Y)?(\\d+M)?(\\d+D)?(T(\\d+H)?(\\d+M)?(\\d+S)?)?$/.test(duration)\r\n});\r\n*/\r\n }\r\n ngOnDestroy(): void {\r\n this.fcValueChangesSubs?.unsubscribe();\r\n this.fcStatusChangesSubs?.unsubscribe();\r\n this.formValueSubscription?.unsubscribe();\r\n this.fcValueChangesSubs=null;\r\n this.fcStatusChangesSubs=null;\r\n this.formValueSubscription=null;\r\n\r\n }\r\n\r\n setLanguage(language: string = 'en-US') {\r\n this.language = language;\r\n const languageValidationMessages = {\r\n de: deValidationMessages,\r\n en: enValidationMessages,\r\n es: esValidationMessages,\r\n fr: frValidationMessages,\r\n it: itValidationMessages,\r\n pt: ptValidationMessages,\r\n zh: zhValidationMessages,\r\n };\r\n const languageCode = language.slice(0, 2);\r\n\r\n const validationMessages = languageValidationMessages[languageCode];\r\n\r\n this.defaultFormOptions.defaultWidgetOptions.validationMessages = cloneDeep(\r\n validationMessages\r\n );\r\n }\r\n\r\n getData() {\r\n return this.data;\r\n }\r\n\r\n getSchema() {\r\n return this.schema;\r\n }\r\n\r\n getLayout() {\r\n return this.layout;\r\n }\r\n\r\n resetAllValues() {\r\n this.JsonFormCompatibility = false;\r\n this.ReactJsonSchemaFormCompatibility = false;\r\n this.AngularSchemaFormCompatibility = false;\r\n this.tpldata = {};\r\n this.validateFormData = null;//Being replaced by getAjvValidator()\r\n this.formValues = {};\r\n this.schema = {};\r\n this.layout = [];\r\n this.formGroupTemplate = {};\r\n this.formGroup = null;\r\n this.framework = null;\r\n this.data = {};\r\n this.validData = null;\r\n this.isValid = null;\r\n this.validationErrors = null;\r\n this.arrayMap = new Map();\r\n this.dataMap = new Map();\r\n this.dataRecursiveRefMap = new Map();\r\n this.schemaRecursiveRefMap = new Map();\r\n this.layoutRefLibrary = {};\r\n this.schemaRefLibrary = {};\r\n this.templateRefLibrary = {};\r\n this.formOptions = cloneDeep(this.defaultFormOptions);\r\n this.ajvRegistry={};\r\n this.ajvRegistry['default']={name:'default',ajvInstance:this.ajv,ajvValidator:null};\r\n }\r\n\r\n /**\r\n * 'buildRemoteError' function\r\n *\r\n * Example errors:\r\n * {\r\n * last_name: [ {\r\n * message: 'Last name must by start with capital letter.',\r\n * code: 'capital_letter'\r\n * } ],\r\n * email: [ {\r\n * message: 'Email must be from example.com domain.',\r\n * code: 'special_domain'\r\n * }, {\r\n * message: 'Email must contain an @ symbol.',\r\n * code: 'at_symbol'\r\n * } ]\r\n * }\r\n * //{ErrorMessages} errors\r\n */\r\n buildRemoteError(errors: ErrorMessages) {\r\n forEach(errors, (value, key) => {\r\n if (key in this.formGroup.controls) {\r\n for (const error of value) {\r\n const err = {};\r\n err[error['code']] = error['message'];\r\n this.formGroup.get(key).setErrors(err, { emitEvent: true });\r\n }\r\n }\r\n });\r\n }\r\n\r\n validateData(newValue: any, updateSubscriptions = true,ajvInstanceName='default'): void {\r\n // Format raw form data to correct data types\r\n this.data = formatFormData(\r\n newValue,\r\n this.dataMap,\r\n this.dataRecursiveRefMap,\r\n this.arrayMap,\r\n this.formOptions.returnEmptyFields\r\n );\r\n this.isValid = this.getAjvValidator(ajvInstanceName)(this.data);\r\n this.validData = this.isValid ? this.data : null;\r\n const compileErrors = (errors:ErrorObject[]) => {\r\n const compiledErrors = {};\r\n (errors || []).forEach(error => {\r\n //TODO review-seems to be a change in newer versions\r\n //of ajv giving '' as instancePath for root objects\r\n let errorPath=error.instancePath||\"ROOT\";\r\n if (!compiledErrors[errorPath]) {\r\n compiledErrors[errorPath] = [];\r\n }\r\n compiledErrors[errorPath].push(error.message);\r\n });\r\n return compiledErrors;\r\n };\r\n //TODO:store avjErrors per ajvInstance in registry\r\n this.ajvErrors = this.getAjvValidator(ajvInstanceName).errors;\r\n this.validationErrors = compileErrors(this.ajvErrors);\r\n if (updateSubscriptions) {\r\n this.dataChanges.next(this.data);\r\n this.isValidChanges.next(this.isValid);\r\n this.validationErrorChanges.next(this.ajvErrors);\r\n }\r\n }\r\n\r\n buildFormGroupTemplate(formValues: any = null, setValues = true) {\r\n this.formGroupTemplate = buildFormGroupTemplate(\r\n this,\r\n formValues,\r\n setValues\r\n );\r\n }\r\n\r\n buildFormGroup(ajvInstanceName?:string) {\r\n this.formGroup = <UntypedFormGroup>buildFormGroup(this.formGroupTemplate);\r\n if (this.formGroup) {\r\n this.compileAjvSchema(ajvInstanceName);\r\n this.validateData(this.formGroup.getRawValue(),true,ajvInstanceName);\r\n\r\n // Set up observables to emit data and validation info when form data changes\r\n if (this.formValueSubscription) {\r\n this.formValueSubscription.unsubscribe();\r\n }\r\n this.formValueSubscription = this.formGroup.valueChanges.subscribe(\r\n formValue => this.validateData(this.formGroup.getRawValue(),true,ajvInstanceName)\r\n );\r\n }\r\n }\r\n\r\n buildLayout(widgetLibrary: any) {\r\n this.layout = buildLayout(this, widgetLibrary);\r\n }\r\n\r\n setOptions(newOptions: any) {\r\n if (isObject(newOptions)) {\r\n const addOptions = cloneDeep(newOptions);\r\n // Backward compatibility for 'defaultOptions' (renamed 'defaultWidgetOptions')\r\n if (isObject(addOptions.defaultOptions)) {\r\n Object.assign(\r\n this.formOptions.defaultWidgetOptions,\r\n addOptions.defaultOptions\r\n );\r\n delete addOptions.defaultOptions;\r\n }\r\n if (isObject(addOptions.defaultWidgetOptions)) {\r\n Object.assign(\r\n this.formOptions.defaultWidgetOptions,\r\n addOptions.defaultWidgetOptions\r\n );\r\n delete addOptions.defaultWidgetOptions;\r\n }\r\n Object.assign(this.formOptions, addOptions);\r\n\r\n // convert disableErrorState / disableSuccessState to enable...\r\n const globalDefaults = this.formOptions.defaultWidgetOptions;\r\n ['ErrorState', 'SuccessState']\r\n .filter(suffix => hasOwn(globalDefaults, 'disable' + suffix))\r\n .forEach(suffix => {\r\n globalDefaults['enable' + suffix] = !globalDefaults[\r\n 'disable' + suffix\r\n ];\r\n delete globalDefaults['disable' + suffix];\r\n });\r\n }\r\n }\r\n\r\n compileAjvSchema(ajvInstanceName='default') {\r\n let ajvValidator=this.getAjvValidator(ajvInstanceName);\r\n if (!ajvValidator) {\r\n // if 'ui:order' exists in properties, move it to root before compiling with ajv\r\n if (Array.isArray(this.schema.properties['ui:order'])) {\r\n this.schema['ui:order'] = this.schema.properties['ui:order'];\r\n delete this.schema.properties['ui:order'];\r\n }\r\n this.getAjvInstance(ajvInstanceName).removeSchema(this.schema);\r\n \r\n ajvValidator = this.getAjvInstance(ajvInstanceName).compile(this.schema);\r\n this.ajvRegistry[ajvInstanceName].ajvValidator=ajvValidator;\r\n\r\n }\r\n }\r\n\r\n buildSchemaFromData(data?: any, requireAllFields = false): any {\r\n if (data) {\r\n return buildSchemaFromData(data, requireAllFields);\r\n }\r\n this.schema = buildSchemaFromData(this.formValues, requireAllFields);\r\n }\r\n\r\n buildSchemaFromLayout(layout?: any): any {\r\n if (layout) {\r\n return buildSchemaFromLayout(layout);\r\n }\r\n this.schema = buildSchemaFromLayout(this.layout);\r\n }\r\n\r\n setTpldata(newTpldata: any = {}): void {\r\n this.tpldata = newTpldata;\r\n }\r\n\r\n parseText(\r\n text = '',\r\n value: any = {},\r\n values: any = {},\r\n key: number | string = null\r\n ): string {\r\n if (!text || !/{{.+?}}/.test(text)) {\r\n return text;\r\n }\r\n return text.replace(/{{(.+?)}}/g, (...a) =>\r\n this.parseExpression(a[1], value, values, key, this.tpldata)\r\n );\r\n }\r\n\r\n parseExpression(\r\n expression = '',\r\n value: any = {},\r\n values: any = {},\r\n key: number | string = null,\r\n tpldata: any = null\r\n ) {\r\n if (typeof expression !== 'string') {\r\n return '';\r\n }\r\n const index = typeof key === 'number' ? key + 1 + '' : key || '';\r\n expression = expression.trim();\r\n if (\r\n (expression[0] === \"'\" || expression[0] === '\"') &&\r\n expression[0] === expression[expression.length - 1] &&\r\n expression.slice(1, expression.length - 1).indexOf(expression[0]) === -1\r\n ) {\r\n return expression.slice(1, expression.length - 1);\r\n }\r\n if (expression === 'idx' || expression === '$index') {\r\n return index;\r\n }\r\n if (expression === 'value' && !hasOwn(values, 'value')) {\r\n return value;\r\n }\r\n if (\r\n ['\"', \"'\", ' ', '||', '&&', '+'].every(\r\n delim => expression.indexOf(delim) === -1\r\n )\r\n ) {\r\n const pointer = JsonPointer.parseObjectPath(expression);\r\n return pointer[0] === 'value' && JsonPointer.has(value, pointer.slice(1))\r\n ? JsonPointer.get(value, pointer.slice(1))\r\n : pointer[0] === 'values' && JsonPointer.has(values, pointer.slice(1))\r\n ? JsonPointer.get(values, pointer.slice(1))\r\n : pointer[0] === 'tpldata' && JsonPointer.has(tpldata, pointer.slice(1))\r\n ? JsonPointer.get(tpldata, pointer.slice(1))\r\n : JsonPointer.has(values, pointer)\r\n ? JsonPointer.get(values, pointer)\r\n : '';\r\n }\r\n if (expression.indexOf('[idx]') > -1) {\r\n expression = expression.replace(/\\[idx\\]/g, <string>index);\r\n }\r\n if (expression.indexOf('[$index]') > -1) {\r\n expression = expression.replace(/\\[$index\\]/g, <string>index);\r\n }\r\n // TODO: Improve expression evaluation by parsing quoted strings first\r\n // let expressionArray = expression.match(/([^\"']+|\"[^\"]+\"|'[^']+')/g);\r\n if (expression.indexOf('||') > -1) {\r\n return expression\r\n .split('||')\r\n .reduce(\r\n (all, term) =>\r\n all || this.parseExpression(term, value, values, key, tpldata),\r\n ''\r\n );\r\n }\r\n if (expression.indexOf('&&') > -1) {\r\n return expression\r\n .split('&&')\r\n .reduce(\r\n (all, term) =>\r\n all && this.parseExpression(term, value, values, key, tpldata),\r\n ' '\r\n )\r\n .trim();\r\n }\r\n if (expression.indexOf('+') > -1) {\r\n return expression\r\n .split('+')\r\n .map(term => this.parseExpression(term, value, values, key, tpldata))\r\n .join('');\r\n }\r\n return '';\r\n }\r\n\r\n //TODO fix- if template has value in title\r\n // \"items\": {\r\n // \"title\": \"{{ 'Input ' + $index+value }}\",\r\n // \"type\": \"string\"\r\n // }\r\n // result on button will be \"Add Input [object Object]\"\r\n setArrayItemTitle(\r\n parentCtx: any = {},\r\n childNode: any = null,\r\n index: number = null\r\n ): string {\r\n //for legacy compatibility, parentCtx.layoutNode could either be a value\r\n //or have been converted to use Signals\r\n let parentCtxAsSignals:any={\r\n layoutNode:()=>{\r\n if(isObject(parentCtx.layoutNode)){\r\n return parentCtx.layoutNode\r\n }\r\n return parentCtx.layoutNode();\r\n },\r\n dataIndex:()=>{\r\n if(isObject(parentCtx.dataIndex)){\r\n return parentCtx.dataIndex\r\n }\r\n return parentCtx.dataIndex();\r\n }\r\n }\r\n const parentNode = parentCtxAsSignals.layoutNode();\r\n const parentValues: any = this.getFormControlValue(parentCtxAsSignals);\r\n const isArrayItem =\r\n (parentNode.type || '').slice(-5) === 'array' && isArray(parentValues);\r\n const text = JsonPointer.getFirst(\r\n isArrayItem && childNode.type !== '$ref'\r\n ? [\r\n [childNode, '/options/legend'],\r\n [childNode, '/options/title'],\r\n [parentNode, '/options/title'],\r\n [parentNode, '/options/legend']\r\n ]\r\n : [\r\n [childNode, '/options/title'],\r\n [childNode, '/options/legend'],\r\n [parentNode, '/options/title'],\r\n [parentNode, '/options/legend']\r\n ]\r\n );\r\n if (!text) {\r\n return text;\r\n }\r\n const childValue =\r\n isArray(parentValues) && index < parentValues.length\r\n ? parentValues[index]\r\n : parentValues;\r\n return this.parseText(text, childValue, parentValues, index);\r\n }\r\n\r\n setItemTitle(ctx: WidgetContext) {\r\n return !ctx.options.title && /^(\\d+|-)$/.test(ctx.layoutNode().name)\r\n ? null\r\n : this.parseText(\r\n ctx.options.title || toTitleCase(ctx.layoutNode().name),\r\n this.getFormControlValue(ctx),\r\n (this.getFormControlGroup(ctx) || <any>{}).value,\r\n ctx.dataIndex()[ctx.dataIndex().length - 1]\r\n );\r\n }\r\n\r\n evaluateCondition(layoutNode: any, dataIndex: number[]): boolean {\r\n const arrayIndex = dataIndex && dataIndex[dataIndex.length - 1];\r\n let result = true;\r\n if (hasValue((layoutNode.options || {}).condition)) {\r\n if (typeof layoutNode.options.condition === 'string') {\r\n let pointer = layoutNode.options.condition;\r\n if (hasValue(arrayIndex)) {\r\n pointer = pointer.replace('[arrayIndex]', `[${arrayIndex}]`);\r\n }\r\n pointer = JsonPointer.parseObjectPath(pointer);\r\n result = !!JsonPointer.get(this.data, pointer);\r\n if (!result && pointer[0] === 'model') {\r\n result = !!JsonPointer.get({ model: this.data }, pointer);\r\n }\r\n } else if (typeof layoutNode.options.condition === 'function') {\r\n result = layoutNode.options.condition(this.data);\r\n } else if (\r\n typeof layoutNode.options.condition.functionBody === 'string'\r\n ) {\r\n try {\r\n const dynFn = new Function(\r\n 'model',\r\n 'arrayIndices',\r\n layoutNode.options.condition.functionBody\r\n );\r\n result = dynFn(this.data, dataIndex);\r\n } catch (e) {\r\n result = true;\r\n console.error(\r\n 'condition functionBody errored out on evaluation: ' +\r\n layoutNode.options.condition.functionBody\r\n );\r\n }\r\n }\r\n }\r\n return result;\r\n }\r\n\r\n initializeControl(ctx: WidgetContext, bind = true): boolean {\r\n if (!isObject(ctx)) {\r\n return false;\r\n }\r\n const layoutNode=ctx.layoutNode();\r\n if (isEmpty(ctx.options)) {\r\n ctx.options = !isEmpty((layoutNode || {}).options)\r\n ? layoutNode.options\r\n : cloneDeep(this.formOptions);\r\n }\r\n ctx.formControl = this.getFormControl(ctx);\r\n //introduced to check if the node is part of ITE conditional\r\n //then change or add the control\r\n if(layoutNode?.schemaPointer && layoutNode.isITEItem || \r\n (layoutNode?.schemaPointer && layoutNode?.oneOfPointer) ||\r\n layoutNode?.schemaPointer && layoutNode.anyOfPointer ){\r\n //before changing control, need to set the new data type for data formatting\r\n const schemaType=this.dataMap.get(layoutNode?.dataPointer).get(\"schemaType\");\r\n if(schemaType!=layoutNode.dataType){\r\n this.dataMap.get(layoutNode?.dataPointer).set(\"schemaType\",layoutNode.dataType)\r\n }\r\n this.setFormControl(ctx,ctx.formControl);\r\n }\r\n ctx.boundControl = bind && !!ctx.formControl;\r\n if (ctx.formControl) {\r\n ctx.controlName = this.getFormControlName(ctx);\r\n ctx.controlValue = ctx.formControl.value;\r\n ctx.controlDisabled = ctx.formControl.disabled;\r\n ctx.options.errorMessage =\r\n ctx.formControl.status === 'VALID'\r\n ? null\r\n : this.formatErrors(\r\n ctx.formControl.errors,\r\n ctx.options.validationMessages\r\n );\r\n ctx.options.showErrors =\r\n this.formOptions.validateOnRender === true ||\r\n (this.formOptions.validateOnRender === 'auto' &&\r\n hasValue(ctx.controlValue));\r\n this.fcStatusChangesSubs=ctx.formControl.statusChanges.subscribe(\r\n status =>\r\n (ctx.options.errorMessage =\r\n status === 'VALID'\r\n ? null\r\n : this.formatErrors(\r\n ctx.formControl.errors,\r\n ctx.options.validationMessages\r\n ))\r\n );\r\n this.fcValueChangesSubs=ctx.formControl.valueChanges.subscribe(value => {\r\n if (!_isEqual(ctx.controlValue, value)) { \r\n ctx.controlValue = value \r\n }\r\n\r\n });\r\n } else {\r\n ctx.controlName = layoutNode.name;\r\n ctx.controlValue = layoutNode.value || null;\r\n const dataPointer = this.getDataPointer(ctx);\r\n if (bind && dataPointer) {\r\n console.error(\r\n `warning: control \"${dataPointer}\" is not bound to the Angular FormGroup.`\r\n );\r\n }\r\n }\r\n //if this is a ITE conditional field, the value would not have been\r\n //set, as the control would only be initialized when the condition is true \r\n //TODO-review need to decide which of the data sets between data,formValues and default \r\n //to use for the value\r\n //TODO try maybe marking descendants in applyITEConditions\r\n let isITEDescendant=layoutNode?.schemaPointer?.split(\"/\")\r\n .some(elt=>[\"then\",\"else\"].includes(elt));\r\n if(ctx.options?.condition || layoutNode?.oneOfPointer || layoutNode?.anyOfPointer || isITEDescendant){\r\n const dataPointer = this.getDataPointer(ctx);\r\n const controlValue=ctx.formControl?.value;\r\n const dataValue=JsonPointer.has(this.data,dataPointer)?\r\n JsonPointer.get(this.data,dataPointer):undefined;\r\n const formValue=JsonPointer.has(this.formValues,dataPointer)?\r\n JsonPointer.get(this.formValues,dataPointer):undefined;\r\n const schemaDefault=ctx.options?.default;\r\n //if initial formValues was supplied and controlValue matches formValue then likely\r\n //control was initially created with the formValue then set value to data value\r\n \r\n //if no formValues was supplied and controlValue matches schemaDefault then likely\r\n //control was initially created with the default then set value to data value\r\n const value=this.formValues && isEqual(formValue,controlValue)?dataValue\r\n :!this.formValues && isEqual(schemaDefault,controlValue)?dataValue\r\n :schemaDefault;\r\n ctx.formControl?.patchValue(value)\r\n }\r\n return ctx.boundControl;\r\n }\r\n\r\n formatErrors(errors: any, validationMessages: any = {}): string {\r\n if (isEmpty(errors)) {\r\n return null;\r\n }\r\n if (!isObject(validationMessages)) {\r\n validationMessages = {};\r\n }\r\n const addSpaces = string =>\r\n string[0].toUpperCase() +\r\n (string.slice(1) || '')\r\n .replace(/([a-z])([A-Z])/g, '$1 $2')\r\n .replace(/_/g, ' ');\r\n const formatError = error =>\r\n typeof error === 'object'\r\n ? Object.keys(error)\r\n .map(key =>\r\n error[key] === true\r\n ? addSpaces(key)\r\n : error[key] === false\r\n ? 'Not ' + addSpaces(key)\r\n : addSpaces(key) + ': ' + formatError(error[key])\r\n )\r\n .join(', ')\r\n : addSpaces(error.toString());\r\n const messages = [];\r\n return (\r\n Object.keys(errors)\r\n // Hide 'required' error, unless it is the only one\r\n .filter(\r\n errorKey =>\r\n errorKey !== 'required' || Object.keys(errors).length === 1\r\n )\r\n .map(errorKey =>\r\n // If validationMessages is a string, return it\r\n typeof validationMessages === 'string'\r\n ? validationMessages\r\n : // If custom error message is a function, return function result\r\n typeof validationMessages[errorKey] === 'function'\r\n ? validationMessages[errorKey](errors[errorKey])\r\n : // If custom error message is a string, replace placeholders and return\r\n typeof validationMessages[errorKey] === 'string'\r\n ? // Does error message have any {{property}} placeholders?\r\n !/{{.+?}}/.test(validationMessages[errorKey])\r\n ? validationMessages[errorKey]\r\n : // Replace {{property}} placeholders with values\r\n Object.keys(errors[errorKey]).reduce(\r\n (errorMessage, errorProperty) =>\r\n errorMessage.replace(\r\n new RegExp('{{' + errorProperty + '}}', 'g'),\r\n errors[errorKey][errorProperty]\r\n ),\r\n validationMessages[errorKey]\r\n )\r\n : // If no custom error message, return formatted error data instead\r\n addSpaces(errorKey) + ' Error: ' + formatError(errors[errorKey])\r\n )\r\n .join('<br>')\r\n );\r\n }\r\n\r\n updateValue(ctx: WidgetContext, value: any): void {\r\n // Set value of current control\r\n ctx.controlValue = value;\r\n if (ctx.boundControl) {\r\n ctx.formControl.setValue(value);\r\n ctx.formControl.markAsDirty();\r\n }\r\n ctx.layoutNode().value = value;\r\n\r\n // Set values of any related controls in copyValueTo array\r\n if (isArray(ctx.options.copyValueTo)) {\r\n for (const item of ctx.options.copyValueTo) {\r\n const targetControl = getControl(this.formGroup, item);\r\n if (\r\n isObject(targetControl) &&\r\n typeof targetControl.setValue === 'function'\r\n ) {\r\n targetControl.setValue(value);\r\n targetControl.markAsDirty();\r\n }\r\n }\r\n }\r\n }\r\n\r\n updateArrayCheckboxList(ctx: WidgetContext, checkboxList: TitleMapItem[]): void {\r\n const formArray = <UntypedFormArray>this.getFormControl(ctx);\r\n\r\n // Remove all existing items\r\n while (formArray.value.length) {\r\n formArray.removeAt(0);\r\n }\r\n\r\n // Re-add an item for each checked box\r\n const refPointer = removeRecursiveReferences(\r\n ctx.layoutNode().dataPointer + '/-',\r\n this.dataRecursiveRefMap,\r\n this.arrayMap\r\n );\r\n for (const checkboxItem of checkboxList) {\r\n if (checkboxItem.checked) {\r\n const newFormControl = buildFormGroup(\r\n this.templateRefLibrary[refPointer]\r\n );\r\n newFormControl.setValue(checkboxItem.value);\r\n formArray.push(newFormControl);\r\n }\r\n }\r\n formArray.markAsDirty();\r\n }\r\n\r\n updateArrayMultiSelectList(ctx: WidgetContext, selectList: TitleMapItem[]): void {\r\n this.updateArrayCheckboxList(ctx,selectList);\r\n /* const formArray = <UntypedFormArray>this.getFormControl(ctx);\r\n\r\n // Remove all existing items\r\n while (formArray.value.length) {\r\n formArray.removeAt(0);\r\n }\r\n\r\n // Re-add an item for each checked box\r\n const refPointer = removeRecursiveReferences(\r\n ctx.layoutNode().dataPointer + '/-',\r\n this.dataRecursiveRefMap,\r\n this.arrayMap\r\n );\r\n for (const selectItem of selectList) {\r\n if (selectItem.value) {\r\n const newFormControl = buildFormGroup(\r\n this.templateRefLibrary[refPointer]\r\n );\r\n newFormControl.setValue(selectItem.value);\r\n formArray.push(newFormControl);\r\n }\r\n }\r\n formArray.markAsDirty();\r\n */\r\n }\r\n getFormControl(ctx: WidgetContext): AbstractControl {\r\n if (\r\n !ctx || !ctx.layoutNode ||\r\n !isDefined(ctx.layoutNode().dataPointer) ||\r\n ctx.layoutNode().type === '$ref'\r\n ) {\r\n return null;\r\n }\r\n const schemaPointer=ctx.layoutNode()?.isITEItem?ctx.layoutNode()?.schemaPointer:null;\r\n const oneOfPointer=ctx.layoutNode()?.oneOfPointer;\r\n const anyOfPointer=ctx.layoutNode()?.anyOfPointer;\r\n return getControl(this.formGroup, this.getDataPointer(ctx),false,schemaPointer||oneOfPointer||anyOfPointer);\r\n }\r\n\r\n setFormControl(ctx: WidgetContext,control:AbstractControl): AbstractControl {\r\n if (\r\n !ctx || !ctx.layoutNode ||\r\n !isDefined(ctx.layoutNode().dataPointer) ||\r\n ctx.layoutNode().type === '$ref'\r\n ) {\r\n return null;\r\n }\r\n return setControl(this.formGroup, this.getDataPointer(ctx),control);\r\n }\r\n\r\n getFormControlValue(ctx: WidgetContext): AbstractControl {\r\n\r\n if (!ctx || !ctx.layoutNode || \r\n !isDefined(ctx.layoutNode().dataPointer) ||\r\n ctx.layoutNode().type === '$ref'\r\n ) {\r\n return null;\r\n }\r\n const schemaPointer=ctx.layoutNode()?.isITEItem?ctx.layoutNode()?.schemaPointer:null;\r\n const oneOfPointer=ctx.layoutNode()?.oneOfPointer;\r\n const anyOfPointer=ctx.layoutNode()?.anyOfPointer;\r\n const control = getControl(this.formGroup, this.getDataPointer(ctx),false,schemaPointer||oneOfPointer||anyOfPointer);\r\n return control ? control.value : null;\r\n }\r\n\r\n getFormControlGroup(ctx: WidgetContext): UntypedFormArray | UntypedFormGroup {\r\n if (!ctx || !ctx.layoutNode || !isDefined(ctx.layoutNode().dataPointer)) {\r\n return null;\r\n }\r\n const schemaPointer=ctx.layoutNode()?.isITEItem?ctx.layoutNode()?.schemaPointer:null;\r\n const oneOfPointer=ctx.layoutNode()?.oneOfPointer;\r\n const anyOfPointer=ctx.layoutNode()?.anyOfPointer;\r\n return getControl(this.formGroup, this.getDataPointer(ctx), true,schemaPointer||oneOfPointer||anyOfPointer);\r\n }\r\n\r\n getFormControlName(ctx: WidgetContext): string {\r\n if (\r\n !ctx || !ctx.layoutNode ||\r\n !isDefined(ctx.layoutNode().dataPointer) ||\r\n !hasValue(ctx.dataIndex())\r\n ) {\r\n return null;\r\n }\r\n return JsonPointer.toKey(this.getDataPointer(ctx));\r\n }\r\n\r\n getLayoutArray(ctx: WidgetContext): any[] {\r\n return JsonPointer.get(this.layout, this.getLayoutPointer(ctx), 0, -1);\r\n }\r\n\r\n getParentNode(ctx: WidgetContext): any {\r\n return JsonPointer.get(this.layout, this.getLayoutPointer(ctx), 0, -2);\r\n }\r\n\r\n getDataPointer(ctx: WidgetContext): string {\r\n if (\r\n !ctx || !ctx.layoutNode ||\r\n !isDefined(ctx.layoutNode().dataPointer) ||\r\n !hasValue(ctx.dataIndex())\r\n ) {\r\n return null;\r\n }\r\n return JsonPointer.toIndexedPointer(\r\n ctx.layoutNode().dataPointer,\r\n ctx.dataIndex(),\r\n this.arrayMap\r\n );\r\n }\r\n\r\n getLayoutPointer(ctx: WidgetContext): string {\r\n if (!hasValue(ctx.layoutIndex())) {\r\n return null;\r\n }\r\n return '/' + ctx.layoutIndex().join('/items/');\r\n }\r\n\r\n isControlBound(ctx: WidgetContext): boolean {\r\n if (\r\n !ctx || !ctx.layoutNode ||\r\n !isDefined(ctx.layoutNode().dataPointer) ||\r\n !hasValue(ctx.dataIndex())\r\n ) {\r\n return false;\r\n }\r\n const controlGroup = this.getFormControlGroup(ctx);\r\n const name = this.getFormControlName(ctx);\r\n return controlGroup ? hasOwn(controlGroup.controls, name) : false;\r\n }\r\n\r\n addItem(ctx: WidgetContext, name?: string): boolean {\r\n if (\r\n !ctx || !ctx.layoutNode ||\r\n !isDefined(ctx.layoutNode().$ref) ||\r\n !hasValue(ctx.dataIndex()) ||\r\n !hasValue(ctx.layoutIndex())\r\n ) {\r\n return false;\r\n }\r\n\r\n // Create a new Angular form control from a template in templateRefLibrary\r\n const newFormGroup = buildFormGroup(\r\n this.templateRefLibrary[ctx.layoutNode().$ref]\r\n );\r\n\r\n // Add the new form control to the parent formArray or formGroup\r\n if (ctx.layoutNode().arrayItem) {\r\n // Add new array item to formArray\r\n (<UntypedFormArray>this.getFormControlGroup(ctx)).push(newFormGroup);\r\n } else {\r\n // Add new $ref item to formGroup\r\n (<UntypedFormGroup>this.getFormControlGroup(ctx)).addControl(\r\n name || this.getFormControlName(ctx),\r\n newFormGroup\r\n );\r\n }\r\n\r\n // Copy a new layoutNode from layoutRefLibrary\r\n const newLayoutNode = getLayoutNode(ctx.layoutNode(), this);\r\n newLayoutNode.arrayItem = ctx.layoutNode().arrayItem;\r\n if (ctx.layoutNode().arrayItemType) {\r\n newLayoutNode.arrayItemType = ctx.layoutNode().arrayItemType;\r\n } else {\r\n delete newLayoutNode.arrayItemType;\r\n }\r\n if (name) {\r\n newLayoutNode.name = name;\r\n newLayoutNode.dataPointer += '/' + JsonPointer.escape(name);\r\n newLayoutNode.options.title = fixTitle(name);\r\n }\r\n\r\n // Add the new layoutNode to the form layout\r\n JsonPointer.insert(this.layout, this.getLayoutPointer(ctx), newLayoutNode);\r\n\r\n return true;\r\n }\r\n\r\n moveArrayItem(ctx: WidgetContext, oldIndex: number, newIndex: number,moveLayout:boolean=true): boolean {\r\n if (\r\n !ctx || !ctx.layoutNode ||\r\n !isDefined(ctx.layoutNode().dataPointer) ||\r\n !hasValue(ctx.dataIndex()) ||\r\n !hasValue(ctx.layoutIndex()) ||\r\n !isDefined(oldIndex) ||\r\n !isDefined(newIndex) ||\r\n oldIndex === newIndex\r\n ) {\r\n return false;\r\n }\r\n\r\n // Move item in the formArray\r\n const formArray = <UntypedFormArray>this.getFormControlGroup(ctx);\r\n if(oldIndex >=formArray.length){\r\n return false;\r\n }\r\n const arrayItem = formArray.at(oldIndex);\r\n formArray.removeAt(oldIndex);\r\n formArray.insert(newIndex, arrayItem);\r\n formArray.updateValueAndValidity();\r\n\r\n // Move layout item\r\n if(moveLayout){\r\n const layoutArray = this.getLayoutArray(ctx);\r\n layoutArray.splice(newIndex, 0, layoutArray.splice(oldIndex, 1)[0]);\r\n }\r\n\r\n return true;\r\n }\r\n\r\n removeItem(ctx: WidgetContext): boolean {\r\n if (\r\n !ctx || !ctx.layoutNode ||\r\n !isDefined(ctx.layoutNode().dataPointer) ||\r\n !hasValue(ctx.dataIndex()) ||\r\n !hasValue(ctx.layoutIndex())\r\n ) {\r\n return false;\r\n }\r\n\r\n // Remove the Angular form control from the parent formArray or formGroup\r\n if (ctx.layoutNode().arrayItem) {\r\n // Remove array item from formArray\r\n (<UntypedFormArray>this.getFormControlGroup(ctx)).removeAt(\r\n ctx.dataIndex()[ctx.dataIndex().length - 1]\r\n );\r\n } else {\r\n // Remove $ref item from formGroup\r\n (<UntypedFormGroup>this.getFormControlGroup(ctx)).removeControl(\r\n this.getFormControlName(ctx)\r\n );\r\n }\r\n\r\n // Remove layoutNode from layout\r\n JsonPointer.remove(this.layout, this.getLayoutPointer(ctx));\r\n return true;\r\n }\r\n}\r\n","import { Component, ComponentRef, OnChanges, OnInit, SimpleChanges, ViewContainerRef, inject, input, viewChild } from '@angular/core';\r\n\r\nimport { JsonSchemaFormService } from '../json-schema-form.service';\r\n\r\n@Component({\r\n // tslint:disable-next-line:component-selector\r\n selector: 'select-widget-widget',\r\n template: `<div #widgetContainer></div>`,\r\n standalone: false\r\n})\r\nexport class SelectWidgetComponent implements OnChanges, OnInit {\r\n\r\n private jsf = inject(JsonSchemaFormService);\r\n\r\n newComponent: ComponentRef<any> = null;\r\n readonly layoutNode = input<any>(undefined);\r\n readonly layoutIndex = input<number[]>(undefined);\r\n readonly dataIndex = input<number[]>(undefined);\r\n readonly widgetContainer = viewChild('widgetContainer', { read: ViewContainerRef });\r\n\r\n ngOnInit() {\r\n this.updateComponent();\r\n }\r\n\r\n ngOnChanges(changes:SimpleChanges) {\r\n this.updateComponent();\r\n }\r\n\r\n updateComponent() {\r\n const widgetContainer = this.widgetContainer();\r\n if (widgetContainer && !this.newComponent && (this.layoutNode() || {}).widget) {\r\n this.newComponent = widgetContainer.createComponent((this.layoutNode().widget)\r\n );\r\n }\r\n if (this.newComponent) {\r\n for (const inp of ['layoutNode', 'layoutIndex', 'dataIndex']) {\r\n //this.newComponent.instance[inp] = this[inp];\r\n this.newComponent.setInput(inp,this[inp]());\r\n }\r\n }\r\n }\r\n}\r\n","import { Component, input } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'no-framework',\r\n templateUrl: './no-framework.component.html',\r\n standalone: false\r\n})\r\nexport class NoFrameworkComponent {\r\n readonly layoutNode = input<any>(undefined);\r\n readonly layoutIndex = input<number[]>(undefined);\r\n readonly dataIndex = input<number[]>(undefined);\r\n}\r\n","<select-widget-widget [dataIndex]=\"dataIndex()\" [layoutIndex]=\"layoutIndex()\" [layoutNode]=\"layoutNode()\">\r\n</select-widget-widget>","import { Injectable } from '@angular/core';\r\nimport { Framework } from './framework';\r\nimport { NoFrameworkComponent } from './no-framework.component';\r\n// No framework - plain HTML controls (styles from form layout only)\r\n\r\n@Injectable()\r\nexport class NoFramework extends Framework {\r\n name = 'no-framework';\r\n text ='None (plain HTML)';\r\n framework = NoFrameworkComponent;\r\n}\r\n","import { Directive, ElementRef, Input, Renderer2, SimpleChanges } from '@angular/core';\r\n\r\n@Directive({\r\n selector: '[attributes]',\r\n standalone: false\r\n})\r\nexport class ElementAttributeDirective {\r\n\r\n \r\n @Input()\r\n public attributes: { [key: string]: any; };\r\n\r\n constructor(\r\n private renderer: Renderer2,\r\n private elementRef: ElementRef\r\n ) { }\r\n\r\n public ngOnChanges(changes: SimpleChanges): void {\r\n if (changes.attributes) {\r\n for (let attributeName in this.attributes) {\r\n const attributeValue = this.attributes[attributeName];\r\n if (attributeValue) {\r\n this.renderer.setAttribute(this.elementRef.nativeElement, attributeName, attributeValue);\r\n } else {\r\n this.renderer.removeAttribute(this.elementRef.nativeElement, attributeName);\r\n }\r\n }\r\n }\r\n }\r\n\r\n}\r\n","import { Directive, ElementRef, Input, OnDestroy, OnInit, Renderer2 } from '@angular/core';\r\n\r\n@Directive({\r\n selector: '[appStopPropagation]', standalone:false\r\n})\r\n\r\n//TODO review:stopPropagation used as a workaround \r\n//to prevent dragging onMouseDown and onTouchStart events\r\nexport class StopPropagationDirective implements OnInit, OnDestroy {\r\n // The input property to receive an array of event names\r\n @Input('appStopPropagation') events: string[] = [];\r\n\r\n // An array to hold the unsubscribe functions for each event listener\r\n private unsubscribeFunctions: Function[] = [];\r\n\r\n constructor(private el: ElementRef, private renderer: Renderer2) {}\r\n\r\n ngOnInit() {\r\n // If the input array is empty, default to 'mousedown'\r\n const eventsToListen = this.events.length > 0 ? this.events : ['mousedown'];\r\n\r\n // Loop through the array of event names and set up a listener for each\r\n eventsToListen.forEach(eventName => {\r\n const unsub = this.renderer.listen(this.el.nativeElement, eventName, (event) => {\r\n event.stopPropagation();\r\n });\r\n // Store the unsubscribe function to be called on destruction\r\n this.unsubscribeFunctions.push(unsub);\r\n });\r\n }\r\n\r\n ngOnDestroy() {\r\n // Call each stored unsubscribe function to clean up listeners\r\n this.unsubscribeFunctions.forEach(unsub => unsub());\r\n }\r\n}\r\n","import { ChangeDetectionStrategy, Component, OnInit, inject, input } from '@angular/core';\r\nimport { JsonSchemaFormService } from '../json-schema-form.service';\r\n\r\n\r\n@Component({\r\n // tslint:disable-next-line:component-selector\r\n selector: 'add-reference-widget',\r\n template: `\r\n <section [class]=\"options?.htmlClass || ''\" align=\"end\">\r\n <button *ngIf=\"showAddButton\"\r\n [class]=\"options?.fieldHtmlClass || ''\"\r\n [disabled]=\"options?.readonly\"\r\n (click)=\"addItem($event)\"\r\n [appStopPropagation]=\"['mousedown', 'touchstart']\"\r\n >\r\n <span *ngIf=\"options?.icon\" [class]=\"options?.icon\"></span>\r\n <span *ngIf=\"options?.title\" [innerHTML]=\"buttonText\"></span>\r\n \r\n </button>\r\n </section>`,\r\n changeDetection: ChangeDetectionStrategy.Default,\r\n standalone: false\r\n})\r\nexport class AddReferenceComponent implements OnInit {\r\n private jsf = inject(JsonSchemaFormService);\r\n\r\n options: any;\r\n itemCount: number;\r\n previousLayoutIndex: number[];\r\n previousDataIndex: number[];\r\n readonly layoutNode = input<any>(undefined);\r\n readonly layoutIndex = input<number[]>(undefined);\r\n readonly dataIndex = input<number[]>(undefined);\r\n\r\n\r\n ngOnInit() {\r\n this.options = this.layoutNode().options || {};\r\n }\r\n\r\n get showAddButton(): boolean {\r\n return !this.layoutNode().arrayItem ||\r\n this.layoutIndex()[this.layoutIndex().length - 1] < this.options.maxItems;\r\n }\r\n\r\n addItem(event) {\r\n event.preventDefault();\r\n this.jsf.addItem(this);\r\n }\r\n\r\n get buttonText(): string {\r\n const parent: any = {\r\n dataIndex: this.dataIndex().slice(0, -1),\r\n layoutIndex: this.layoutIndex().slice(0, -1),\r\n layoutNode: this.jsf.getParentNode(this)\r\n };\r\n return parent.layoutNode.add ||\r\n this.jsf.setArrayItemTitle(parent, this.layoutNode(), this.itemCount);\r\n }\r\n}\r\n","import { Component, inject, input, OnDestroy, OnInit } from '@angular/core';\r\nimport { AbstractControl } from '@angular/forms';\r\nimport { JsonSchemaFormService } from '../json-schema-form.service';\r\n\r\n\r\n@Component({\r\n // tslint:disable-next-line:component-selector\r\n selector: 'button-widget',\r\n template: `\r\n <div\r\n [class]=\"options?.htmlClass || ''\">\r\n <button\r\n [attr.readonly]=\"options?.readonly ? 'readonly' : null\"\r\n [attr.aria-describedby]=\"'control' + layoutNode()?._id + 'Status'\"\r\n [class]=\"options?.fieldHtmlClass || ''\"\r\n [disabled]=\"controlDisabled\"\r\n [name]=\"controlName\"\r\n [type]=\"layoutNode()?.type\"\r\n [value]=\"controlValue\"\r\n (click)=\"updateValue($event)\"\r\n [appStopPropagation]=\"['mousedown', 'touchstart']\"\r\n >\r\n <span *ngIf=\"options?.icon || options?.title\"\r\n [class]=\"options?.icon\"\r\n [innerHTML]=\"options?.title\"></span>\r\n </button>\r\n </div>`,\r\n standalone: false\r\n})\r\nexport class ButtonComponent implements OnInit,OnDestroy {\r\n private jsf = inject(JsonSchemaFormService);\r\n\r\n formControl: AbstractControl;\r\n controlName: string;\r\n controlValue: any;\r\n controlDisabled = false;\r\n boundControl = false;\r\n options: any;\r\n readonly layoutNode = input<any>(undefined);\r\n readonly layoutIndex = input<number[]>(undefined);\r\n readonly dataIndex = input<number[]>(undefined);\r\n\r\n ngOnInit() {\r\n this.options = this.layoutNode().options || {};\r\n this.jsf.initializeControl(this);\r\n }\r\n\r\n updateValue(event) {\r\n if (typeof this.options.onClick === 'function') {\r\n this.options.onClick(event);\r\n } else {\r\n this.jsf.updateValue(this, event.target.value);\r\n }\r\n }\r\n\r\n ngOnDestroy () {\r\n this.jsf.updateValue(this, null);\r\n }\r\n}\r\n","import { Component, inject, input, OnDestroy, OnInit } from '@angular/core';\r\nimport { AbstractControl } from '@angular/forms';\r\nimport { JsonSchemaFormService } from '../json-schema-form.service';\r\n\r\n///NB issue caused by sortablejs when it its destroyed\r\n//this mainly affects checkboxes coupled with conditions\r\n//-the value is rechecked\r\n//-see https://github.com/SortableJS/Sortable/issues/1052#issuecomment-369613072\r\n//-switched to angular cdk for dnd\r\n@Component({\r\n // tslint:disable-next-line:component-selector\r\n selector: 'checkbox-widget',\r\n template: `\r\n <label\r\n [attr.for]=\"'control' + layoutNode()?._id\"\r\n [class]=\"options?.itemLabelHtmlClass || ''\">\r\n <input *ngIf=\"boundControl\"\r\n [formControl]=\"formControl\"\r\n [attr.aria-describedby]=\"'control' + layoutNode()?._id + 'Status'\"\r\n [class]=\"(options?.fieldHtmlClass || '') + (isChecked ?\r\n (' ' + (options?.activeClass || '') + ' ' + (options?.style?.selected || '')) :\r\n (' ' + (options?.style?.unselected || '')))\"\r\n [id]=\"'control' + layoutNode()?._id\"\r\n [name]=\"controlName\"\r\n [readonly]=\"options?.readonly ? 'readonly' : null\"\r\n type=\"checkbox\">\r\n <input *ngIf=\"!boundControl\"\r\n [attr.aria-describedby]=\"'control' + layoutNode()?._id + 'Status'\"\r\n [checked]=\"isChecked\"\r\n [class]=\"(options?.fieldHtmlClass || '') + (isChecked ?\r\n (' ' + (options?.activeClass || '') + ' ' + (options?.style?.selected || '')) :\r\n (' ' + (options?.style?.unselected || '')))\"\r\n [disabled]=\"controlDisabled\"\r\n [id]=\"'control' + layoutNode()?._id\"\r\n [name]=\"controlName\"\r\n [readonly]=\"options?.readonly ? 'readonly' : null\"\r\n [value]=\"controlValue\"\r\n type=\"checkbox\"\r\n (change)=\"updateValue($event)\">\r\n <span *ngIf=\"options?.title\"\r\n [style.display]=\"options?.notitle ? 'none' : ''\"\r\n [innerHTML]=\"options?.title\"></span>\r\n </label>`,\r\n standalone: false\r\n})\r\nexport class CheckboxComponent implements OnInit,OnDestroy {\r\n private jsf = inject(JsonSchemaFormService);\r\n\r\n formControl: AbstractControl;\r\n controlName: string;\r\n controlValue: any;\r\n controlDisabled = false;\r\n boundControl = false;\r\n options: any;\r\n trueValue: any = true;\r\n falseValue: any = false;\r\n readonly layoutNode = input<any>(undefined);\r\n readonly layoutIndex = input<number[]>(undefined);\r\n readonly dataIndex = input<number[]>(undefined);\r\n\r\n ngOnInit() {\r\n this.options = this.layoutNode().options || {};\r\n this.jsf.initializeControl(this);\r\n if (this.controlValue === null || this.controlValue === undefined) {\r\n this.controlValue = false;\r\n this.jsf.updateValue(this, this.falseValue);\r\n }\r\n }\r\n\r\n updateValue(event) {\r\n event.preventDefault();\r\n this.jsf.updateValue(this, event.target.checked ? this.trueValue : this.falseValue);\r\n }\r\n\r\n get isChecked() {\r\n return this.jsf.getFormControlValue(this) === this.trueValue;\r\n }\r\n\r\n ngOnDestroy () {\r\n this.jsf.updateValue(this, null);\r\n }\r\n\r\n}\r\n","import { Component, inject, input, OnDestroy, OnInit } from '@angular/core';\r\nimport { AbstractControl } from '@angular/forms';\r\nimport { JsonSchemaFormService, TitleMapItem } from '../json-schema-form.service';\r\nimport { buildTitleMap } from '../shared';\r\n\r\n\r\n@Component({\r\n // tslint:disable-next-line:component-selector\r\n selector: 'checkboxes-widget',\r\n template: `\r\n <label *ngIf=\"options?.title\"\r\n [class]=\"options?.labelHtmlClass || ''\"\r\n [style.display]=\"options?.notitle ? 'none' : ''\"\r\n [innerHTML]=\"options?.title\"></label>\r\n\r\n <!-- 'horizontal' = checkboxes-inline or checkboxbuttons -->\r\n <div *ngIf=\"layoutOrientation === 'horizontal'\" [class]=\"options?.htmlClass || ''\">\r\n <label *ngFor=\"let checkboxItem of checkboxList\"\r\n [attr.for]=\"'control' + layoutNode()?._id + '/' + checkboxItem.value\"\r\n [class]=\"(options?.itemLabelHtmlClass || '') + (checkboxItem.checked ?\r\n (' ' + (options?.activeClass || '') + ' ' + (options?.style?.selected || '')) :\r\n (' ' + (options?.style?.unselected || '')))\">\r\n <input type=\"checkbox\"\r\n [attr.required]=\"options?.required\"\r\n [checked]=\"checkboxItem.checked\"\r\n [class]=\"options?.fieldHtmlClass || ''\"\r\n [disabled]=\"controlDisabled\"\r\n [id]=\"'control' + layoutNode()?._id + '/' + checkboxItem.value\"\r\n [name]=\"checkboxItem?.name\"\r\n [readonly]=\"options?.readonly ? 'readonly' : null\"\r\n [value]=\"checkboxItem.value\"\r\n (change)=\"updateValue($event)\">\r\n <span [innerHTML]=\"checkboxItem.name\"></span>\r\n </label>\r\n </div>\r\n\r\n <!-- 'vertical' = regular checkboxes -->\r\n <div *ngIf=\"layoutOrientation === 'vertical'\">\r\n <div *ngFor=\"let checkboxItem of checkboxList\" [class]=\"options?.htmlClass || ''\">\r\n <label\r\n [attr.for]=\"'control' + layoutNode()?._id + '/' + checkboxItem.value\"\r\n [class]=\"(options?.itemLabelHtmlClass || '') + (checkboxItem.checked ?\r\n (' ' + (options?.activeClass || '') + ' ' + (options?.style?.selected || '')) :\r\n (' ' + (options?.style?.unselected || '')))\">\r\n <input type=\"checkbox\"\r\n [attr.required]=\"options?.required\"\r\n [checked]=\"checkboxItem.checked\"\r\n [class]=\"options?.fieldHtmlClass || ''\"\r\n [disabled]=\"controlDisabled\"\r\n [id]=\"options?.name + '/' + checkboxItem.value\"\r\n [name]=\"checkboxItem?.name\"\r\n [readonly]=\"options?.readonly ? 'readonly' : null\"\r\n [value]=\"checkboxItem.value\"\r\n (change)=\"updateValue($event)\">\r\n <span [innerHTML]=\"checkboxItem?.name\"></span>\r\n </label>\r\n </div>\r\n </div>`,\r\n standalone: false\r\n})\r\nexport class CheckboxesComponent implements OnInit,OnDestroy {\r\n private jsf = inject(JsonSchemaFormService);\r\n\r\n formControl: AbstractControl;\r\n controlName: string;\r\n controlValue: any;\r\n controlDisabled = false;\r\n boundControl = false;\r\n options: any;\r\n layoutOrientation: string;\r\n formArray: AbstractControl;\r\n checkboxList: TitleMapItem[] = [];\r\n readonly layoutNode = input<any>(undefined);\r\n readonly layoutIndex = input<number[]>(undefined);\r\n readonly dataIndex = input<number[]>(undefined);\r\n\r\n ngOnInit() {\r\n this.options = this.layoutNode().options || {};\r\n const layoutNode = this.layoutNode();\r\n this.layoutOrientation = (layoutNode.type === 'checkboxes-inline' ||\r\n layoutNode.type === 'checkboxbuttons') ? 'horizontal' : 'vertical';\r\n this.jsf.initializeControl(this);\r\n this.checkboxList = buildTitleMap(\r\n this.options.titleMap || this.options.enumNames, this.options.enum, true\r\n );\r\n if (this.boundControl) {\r\n const formArray = this.jsf.getFormControl(this);\r\n this.checkboxList.forEach(checkboxItem =>\r\n checkboxItem.checked = formArray.value.includes(checkboxItem.value)\r\n );\r\n }\r\n }\r\n\r\n updateValue(event) {\r\n for (const checkboxItem of this.checkboxList) {\r\n if (event.target.value === checkboxItem.value) {\r\n checkboxItem.checked = event.target.checked;\r\n }\r\n }\r\n if (this.boundControl) {\r\n this.jsf.updateArrayCheckboxList(this, this.checkboxList);\r\n }\r\n }\r\n\r\n //TODO review this\r\n ngOnDestroy () {\r\n //this.jsf.updateValue(this, null);\r\n let nullVal=[];\r\n this.formControl.reset(nullVal)\r\n this.controlValue=null;\r\n }\r\n\r\n}\r\n","import { Component, inject, input, OnDestroy, OnInit } from '@angular/core';\r\nimport { AbstractControl } from '@angular/forms';\r\nimport { JsonSchemaFormService } from '../json-schema-form.service';\r\n\r\n\r\n// TODO: Add this control\r\n\r\n@Component({\r\n // tslint:disable-next-line:component-selector\r\n selector: 'file-widget',\r\n template: ``,\r\n standalone: false\r\n})\r\nexport class FileComponent implements OnInit,OnDestroy {\r\n private jsf = inject(JsonSchemaFormService);\r\n\r\n formControl: AbstractControl;\r\n controlName: string;\r\n controlValue: any;\r\n controlDisabled = false;\r\n boundControl = false;\r\n options: any;\r\n readonly layoutNode = input<any>(undefined);\r\n readonly layoutIndex = input<number[]>(undefined);\r\n readonly dataIndex = input<number[]>(undefined);\r\n\r\n ngOnInit() {\r\n this.options = this.layoutNode().options || {};\r\n this.jsf.initializeControl(this);\r\n }\r\n\r\n updateValue(event) {\r\n this.jsf.updateValue(this, event.target.value);\r\n }\r\n\r\n ngOnDestroy () {\r\n this.jsf.updateValue(this, null);\r\n }\r\n}\r\n","import { Component, inject, input, OnDestroy, OnInit } from '@angular/core';\r\nimport { AbstractControl } from '@angular/forms';\r\nimport { JsonSchemaFormService } from '../json-schema-form.service';\r\n\r\n\r\n@Component({\r\n // tslint:disable-next-line:component-selector\r\n selector: 'hidden-widget',\r\n template: `\r\n <input *ngIf=\"boundControl\"\r\n [formControl]=\"formControl\"\r\n [id]=\"'control' + layoutNode()?._id\"\r\n [name]=\"controlName\"\r\n type=\"hidden\">\r\n <input *ngIf=\"!boundControl\"\r\n [disabled]=\"controlDisabled\"\r\n [name]=\"controlName\"\r\n [id]=\"'control' + layoutNode()?._id\"\r\n type=\"hidden\"\r\n [value]=\"controlValue\">`,\r\n standalone: false\r\n})\r\nexport class HiddenComponent implements OnInit,OnDestroy {\r\n private jsf = inject(JsonSchemaFormService);\r\n\r\n formControl: AbstractControl;\r\n controlName: string;\r\n controlValue: any;\r\n controlDisabled = false;\r\n boundControl = false;\r\n readonly layoutNode = input<any>(undefined);\r\n readonly layoutIndex = input<number[]>(undefined);\r\n readonly dataIndex = input<number[]>(undefined);\r\n\r\n ngOnInit() {\r\n this.jsf.initializeControl(this);\r\n }\r\n\r\n ngOnDestroy () {\r\n this.jsf.updateValue(this, null);\r\n }\r\n\r\n}\r\n","import { Component, OnDestroy, OnInit, inject, input } from '@angular/core';\r\nimport { AbstractControl } from '@angular/forms';\r\nimport { JsonSchemaFormService } from '../json-schema-form.service';\r\n\r\n\r\n@Component({\r\n // tslint:disable-next-line:component-selector\r\n selector: 'input-widget',\r\n template: `\r\n <div [class]=\"options?.htmlClass || ''\" >\r\n <label *ngIf=\"options?.title\"\r\n [attr.for]=\"'control' + layoutNode()?._id\"\r\n [class]=\"options?.labelHtmlClass || ''\"\r\n [style.display]=\"options?.notitle ? 'none' : ''\"\r\n [innerHTML]=\"options?.title\"></label>\r\n <input *ngIf=\"boundControl\"\r\n [formControl]=\"formControl\"\r\n [attr.aria-describedby]=\"'control' + layoutNode()?._id + 'Status'\"\r\n [attr.list]=\"'control' + layoutNode()?._id + 'Autocomplete'\"\r\n [attr.maxlength]=\"options?.maxLength\"\r\n [attr.minlength]=\"options?.minLength\"\r\n [attr.pattern]=\"options?.pattern\"\r\n [attr.placeholder]=\"options?.placeholder\"\r\n [attr.required]=\"options?.required\"\r\n [class]=\"options?.fieldHtmlClass || ''\"\r\n [id]=\"'control' + layoutNode()?._id\"\r\n [name]=\"controlName\"\r\n [readonly]=\"options?.readonly ? 'readonly' : null\"\r\n [type]=\"layoutNode()?.type\"\r\n [attributes]=\"inputAttributes\"\r\n [appStopPropagation]=\"['mousedown', 'touchstart']\"\r\n >\r\n <input *ngIf=\"!boundControl\"\r\n [attr.aria-describedby]=\"'control' + layoutNode()?._id + 'Status'\"\r\n [attr.list]=\"'control' + layoutNode()?._id + 'Autocomplete'\"\r\n [attr.maxlength]=\"options?.maxLength\"\r\n [attr.minlength]=\"options?.minLength\"\r\n [attr.pattern]=\"options?.pattern\"\r\n [attr.placeholder]=\"options?.placeholder\"\r\n [attr.required]=\"options?.required\"\r\n [class]=\"options?.fieldHtmlClass || ''\"\r\n [disabled]=\"controlDisabled\"\r\n [id]=\"'control' + layoutNode()?._id\"\r\n [name]=\"controlName\"\r\n [readonly]=\"options?.readonly ? 'readonly' : null\"\r\n [type]=\"layoutNode()?.type\"\r\n [value]=\"controlValue\"\r\n (input)=\"updateValue($event)\"\r\n [attributes]=\"inputAttributes\"\r\n [appStopPropagation]=\"['mousedown', 'touchstart']\"\r\n >\r\n <datalist *ngIf=\"options?.typeahead?.source\"\r\n [id]=\"'control' + layoutNode()?._id + 'Autocomplete'\">\r\n <option *ngFor=\"let word of options?.typeahead?.source\" [value]=\"word\">\r\n </datalist>\r\n </div>`,\r\n standalone: false\r\n})\r\nexport class InputComponent implements OnInit, OnDestroy {\r\n private jsf = inject(JsonSchemaFormService);\r\n\r\n formControl: AbstractControl;\r\n controlName: string;\r\n controlValue: string;\r\n controlDisabled = false;\r\n boundControl = false;\r\n options: any;\r\n autoCompleteList: string[] = [];\r\n readonly layoutNode = input<any>(undefined);\r\n readonly layoutIndex = input<number[]>(undefined);\r\n readonly dataIndex = input<number[]>(undefined);\r\n\r\n //needed as templates don't accept something like [attributes]=\"options?.['x-inputAttributes']\"\r\n get inputAttributes() {\r\n return this.options?.['x-inputAttributes'];\r\n }\r\n\r\n ngOnInit() {\r\n this.options = this.layoutNode().options || {};\r\n this.jsf.initializeControl(this);\r\n }\r\n\r\n updateValue(event) {\r\n this.jsf.updateValue(this, event.target.value);\r\n }\r\n\r\n ngOnDestroy () {\r\n this.jsf.updateValue(this, null);\r\n }\r\n\r\n}\r\n","import { Component, OnInit, input, inject } from '@angular/core';\r\nimport { JsonSchemaFormService } from '../json-schema-form.service';\r\n\r\n\r\n@Component({\r\n // tslint:disable-next-line:component-selector\r\n selector: 'message-widget',\r\n template: `\r\n <span *ngIf=\"message\"\r\n [class]=\"options?.labelHtmlClass || ''\"\r\n [innerHTML]=\"message\"></span>`,\r\n standalone: false\r\n})\r\nexport class MessageComponent implements OnInit {\r\n private jsf = inject(JsonSchemaFormService);\r\n\r\n options: any;\r\n message: string = null;\r\n readonly layoutNode = input<any>(undefined);\r\n readonly layoutIndex = input<number[]>(undefined);\r\n readonly dataIndex = input<number[]>(undefined);\r\n\r\n ngOnInit() {\r\n this.options = this.layoutNode().options || {};\r\n this.message = this.options.help || this.options.helpvalue ||\r\n this.options.msg || this.options.message;\r\n }\r\n}\r\n","import { Component, input } from '@angular/core';\r\n\r\n@Component({\r\n // tslint:disable-next-line:component-selector\r\n selector: 'none-widget',\r\n template: ``,\r\n standalone: false\r\n})\r\nexport class NoneComponent {\r\n readonly layoutNode = input<any>(undefined);\r\n readonly layoutIndex = input<number[]>(undefined);\r\n readonly dataIndex = input<number[]>(undefined);\r\n}\r\n","import { Component, ElementRef, OnDestroy, OnInit, ViewChild, inject, input } from '@angular/core';\r\nimport { AbstractControl } from '@angular/forms';\r\n\r\nimport { JsonSchemaFormService } from '../json-schema-form.service';\r\n\r\n@Component({\r\n // tslint:disable-next-line:component-selector\r\n selector: 'number-widget',\r\n template: `\r\n <div #divElt [class]=\"options?.htmlClass || ''\" >\r\n <label *ngIf=\"options?.title\"\r\n [attr.for]=\"'control' + layoutNode()?._id\"\r\n [class]=\"options?.labelHtmlClass || ''\"\r\n [style.display]=\"options?.notitle ? 'none' : ''\"\r\n [innerHTML]=\"options?.title\"></label>\r\n <input #inputControl *ngIf=\"boundControl\"\r\n [formControl]=\"formControl\"\r\n [attr.aria-describedby]=\"'control' + layoutNode()?._id + 'Status'\"\r\n [attr.max]=\"options?.maximum\"\r\n [attr.min]=\"options?.minimum\"\r\n [attr.placeholder]=\"options?.placeholder\"\r\n [attr.required]=\"options?.required\"\r\n [attr.readonly]=\"options?.readonly ? 'readonly' : null\"\r\n [attr.step]=\"options?.multipleOf || options?.step || 'any'\"\r\n [class]=\"options?.fieldHtmlClass || ''\"\r\n [id]=\"'control' + layoutNode()?._id\"\r\n [name]=\"controlName\"\r\n [readonly]=\"options?.readonly ? 'readonly' : null\"\r\n [title]=\"lastValidNumber\"\r\n [type]=\"layoutNode()?.type === 'range' ? 'range' : 'number'\"\r\n [attributes]=\"inputAttributes\"\r\n [appStopPropagation]=\"['mousedown', 'touchstart']\"\r\n >\r\n <input #inputControl *ngIf=\"!boundControl\"\r\n [attr.aria-describedby]=\"'control' + layoutNode()?._id + 'Status'\"\r\n [attr.max]=\"options?.maximum\"\r\n [attr.min]=\"options?.minimum\"\r\n [attr.placeholder]=\"options?.placeholder\"\r\n [attr.required]=\"options?.required\"\r\n [attr.readonly]=\"options?.readonly ? 'readonly' : null\"\r\n [attr.step]=\"options?.multipleOf || options?.step || 'any'\"\r\n [class]=\"options?.fieldHtmlClass || ''\"\r\n [disabled]=\"controlDisabled\"\r\n [id]=\"'control' + layoutNode()?._id\"\r\n [name]=\"controlName\"\r\n [readonly]=\"options?.readonly ? 'readonly' : null\"\r\n [title]=\"lastValidNumber\"\r\n [type]=\"layoutNode()?.type === 'range' ? 'range' : 'number'\"\r\n [value]=\"controlValue\"\r\n (input)=\"updateValue($event)\"\r\n [attributes]=\"inputAttributes\"\r\n [appStopPropagation]=\"['mousedown', 'touchstart']\"\r\n >\r\n <span *ngIf=\"layoutNode()?.type === 'range'\" [innerHTML]=\"controlValue\"></span>\r\n </div>`,\r\n standalone: false\r\n})\r\n//TODO look at reusing InputComponent\r\nexport class NumberComponent implements OnInit,OnDestroy {\r\n private jsf = inject(JsonSchemaFormService);\r\n\r\n formControl: AbstractControl;\r\n controlName: string;\r\n controlValue: any;\r\n controlDisabled = false;\r\n boundControl = false;\r\n options: any;\r\n allowNegative = true;\r\n allowDecimal = true;\r\n allowExponents = false;\r\n lastValidNumber = '';\r\n readonly layoutNode = input<any>(undefined);\r\n readonly layoutIndex = input<number[]>(undefined);\r\n readonly dataIndex = input<number[]>(undefined);\r\n\r\n //needed as templates don't accept something like [attributes]=\"options?.['x-inputAttributes']\"\r\n get inputAttributes() {\r\n return this.options?.['x-inputAttributes'];\r\n }\r\n @ViewChild('inputControl', {})\r\n inputControl: ElementRef;\r\n\r\n @ViewChild('divElt', {})\r\n div: ElementRef;\r\n\r\n ngOnInit() {\r\n this.options = this.layoutNode().options || {};\r\n this.jsf.initializeControl(this);\r\n if (this.layoutNode().dataType === 'integer') { this.allowDecimal = false; }\r\n }\r\n\r\n updateValue(event) {\r\n this.jsf.updateValue(this, event.target.value);\r\n }\r\n\r\n ngOnDestroy () {\r\n this.jsf.updateValue(this, null);\r\n }\r\n \r\n}\r\n","import { ChangeDetectorRef, Component, ComponentRef, OnChanges, OnInit, ViewContainerRef, inject, input, viewChild } from '@angular/core';\r\n\r\nimport { JsonSchemaFormService } from '../json-schema-form.service';\r\n\r\n@Component({\r\n // tslint:disable-next-line:component-selector\r\n selector: 'select-framework-widget',\r\n template: `<div #widgetContainer></div>`,\r\n standalone: false\r\n})\r\nexport class SelectFrameworkComponent implements OnChanges, OnInit {\r\n private jsf = inject(JsonSchemaFormService);\r\n private changeDetectorRef = inject(ChangeDetectorRef);\r\n newComponent: ComponentRef<any> = null;\r\n readonly layoutNode = input<any>(undefined);\r\n readonly layoutIndex = input<number[]>(undefined);\r\n readonly dataIndex = input<number[]>(undefined);\r\n readonly widgetContainer = viewChild('widgetContainer', { read: ViewContainerRef });\r\n\r\n ngOnInit() {\r\n this.updateComponent();\r\n }\r\n\r\n ngOnChanges(changes) {\r\n this.updateComponent();\r\n }\r\n\r\n updateComponent() {\r\n const widgetContainer = this.widgetContainer();\r\n if (widgetContainer && !this.newComponent && this.jsf.framework) {\r\n this.newComponent = widgetContainer.createComponent((this.jsf.framework)\r\n );\r\n //TODO fix all deprecated calls and test \r\n //this.widgetContainer.createComponent<any>(this.jsf.framework)\r\n }\r\n if (this.newComponent) {\r\n for (const inp of ['layoutNode', 'layoutIndex', 'dataIndex']) {\r\n //this.newComponent.instance[inp] = this[inp];\r\n this.newComponent.setInput(inp,this[inp]());\r\n }\r\n // Manually trigger change detection after updating inputs\r\n //this.changeDetectorRef.detectChanges();\r\n }\r\n }\r\n}\r\n","import { Component, OnInit, inject, input, signal } from '@angular/core';\r\nimport { JsonSchemaFormService } from '../json-schema-form.service';\r\n\r\n\r\n@Component({\r\n // tslint:disable-next-line:component-selector\r\n selector: 'tabs-widget',\r\n template: `\r\n <ul\r\n [class]=\"options?.labelHtmlClass || ''\">\r\n <li *ngFor=\"let item of layoutNode()?.items; let i = index\"\r\n [class]=\"(options?.itemLabelHtmlClass || '') + (selectedItem === i ?\r\n (' ' + (options?.activeClass || '') + ' ' + (options?.style?.selected || '')) :\r\n (' ' + options?.style?.unselected))\"\r\n role=\"presentation\"\r\n data-tabs>\r\n <a *ngIf=\"showAddTab || item.type !== '$ref'\"\r\n [class]=\"'nav-link' + (selectedItem === i ? (' ' + options?.activeClass + ' ' + options?.style?.selected) :\r\n (' ' + options?.style?.unselected))\"\r\n (click)=\"select(i)\">\r\n <input type=\"radio\" [value]=\"i\" *ngIf=\"options?.tabMode=='oneOfMode'\" \r\n name=\"tabSelection\" \r\n [(ngModel)]=\"selectedItem\"\r\n [class]=\"(options?.widget_radioClass || '')\"\r\n [value]=\"i\" \r\n (change)=\"select(i)\"\r\n />\r\n {{setTabTitle(item, i)}}\r\n </a>\r\n </li>\r\n </ul>\r\n\r\n <div *ngFor=\"let layoutItem of layoutNode()?.items; let i = index\"\r\n [class]=\"(options?.htmlClass || '') + (selectedItem != i?' ngf-hidden':'') \">\r\n <!--for now the only difference between oneOfMode and the default \r\n is that oneOfMode uses the *ngIf=\"selectedItem === i\" clause, which automatically\r\n destroys the tabs that are not rendered while default mode only hide them\r\n the upshot is that only the active tabs value will be used\r\n -->\r\n <ng-container *ngIf=\"options?.tabMode=='oneOfMode'\">\r\n <select-framework-widget *ngIf=\"selectedItem === i\"\r\n [class]=\"(options?.fieldHtmlClass || '') +\r\n ' ' + (options?.activeClass || '') +\r\n ' ' + (options?.style?.selected || '')\"\r\n [dataIndex]=\"layoutNode()?.dataType === 'array' ? (dataIndex() || []).concat(i) : dataIndex()\"\r\n [layoutIndex]=\"(layoutIndex() || []).concat(i)\"\r\n [layoutNode]=\"layoutItem\"></select-framework-widget>\r\n </ng-container> \r\n <ng-container *ngIf=\"options?.tabMode !='oneOfMode'\">\r\n <select-framework-widget \r\n [class]=\"(options?.fieldHtmlClass || '') +\r\n ' ' + (options?.activeClass || '') +\r\n ' ' + (options?.style?.selected || '')\"\r\n [dataIndex]=\"layoutNode()?.dataType === 'array' ? (dataIndex() || []).concat(i) : dataIndex()\"\r\n [layoutIndex]=\"(layoutIndex() || []).concat(i)\"\r\n [layoutNode]=\"layoutItem\"></select-framework-widget>\r\n </ng-container> \r\n </div>`,\r\n styles: [` a { cursor: pointer; } \r\n .ngf-hidden{display:none}\r\n `],\r\n standalone: false\r\n})\r\nexport class TabsComponent implements OnInit {\r\n private jsf = inject(JsonSchemaFormService);\r\n\r\n options: any;\r\n itemCount: number;\r\n selectedItem = 0;\r\n showAddTab = true;\r\n readonly layoutNode = input<any>(undefined);\r\n readonly layoutIndex = input<number[]>(undefined);\r\n readonly dataIndex = input<number[]>(undefined);\r\n\r\n ngOnInit() {\r\n this.options = this.layoutNode().options || {};\r\n if(this.options.selectedTab){\r\n this.selectedItem = this.options.selectedTab;\r\n }\r\n this.itemCount = this.layoutNode().items.length - 1;\r\n this.updateControl();\r\n }\r\n\r\n select(index) {\r\n const layoutNode = this.layoutNode();\r\n if (layoutNode.items[index].type === '$ref') {\r\n this.itemCount = layoutNode.items.length;\r\n this.jsf.addItem({\r\n layoutNode: signal(layoutNode.items[index]),\r\n layoutIndex: signal(this.layoutIndex().concat(index)),\r\n dataIndex: signal(this.dataIndex().concat(index))\r\n });\r\n this.updateControl();\r\n }\r\n this.selectedItem = index;\r\n }\r\n\r\n updateControl() {\r\n const lastItem = this.layoutNode().items[this.layoutNode().items.length - 1];\r\n if (lastItem.type === '$ref' &&\r\n this.itemCount >= (lastItem.options.maxItems || 1000)\r\n ) {\r\n this.showAddTab = false;\r\n }\r\n }\r\n\r\n setTabTitle(item: any, index: number): string {\r\n return this.jsf.setArrayItemTitle(this, item, index);\r\n }\r\n}\r\n","import { Component, inject, input, OnDestroy, OnInit } from '@angular/core';\r\nimport { AbstractControl } from '@angular/forms';\r\n\r\nimport { isEqual, isObject, pick } from 'lodash';\r\nimport { JsonSchemaFormService } from '../json-schema-form.service';\r\nimport { hasNonNullValue, hasOwn, JsonPointer, path2ControlKey } from '../shared';\r\n\r\n// TODO: Add this control\r\n\r\n@Component({\r\n // tslint:disable-next-line:component-selector\r\n selector: 'one-of-widget',\r\n template: `<h4>{{this.options?.description}}</h4>\r\n <tabs-widget #tabs [layoutNode]=\"layoutNode()\" \r\n [layoutIndex]=\"layoutIndex()\" \r\n [dataIndex]=\"dataIndex()\" >\r\n </tabs-widget>`,\r\n standalone: false\r\n})\r\nexport class OneOfComponent implements OnInit,OnDestroy {\r\n private jsf = inject(JsonSchemaFormService);\r\n\r\n formControl: AbstractControl;\r\n controlName: string;\r\n controlValue: any;\r\n controlDisabled = false;\r\n boundControl = false;\r\n options: any;\r\n readonly layoutNode = input<any>(undefined);\r\n readonly layoutIndex = input<number[]>(undefined);\r\n readonly dataIndex = input<number[]>(undefined);\r\n\r\n ngOnInit() {\r\n this.options = this.layoutNode().options || {};\r\n this.options.tabMode=\"oneOfMode\";\r\n this.options.selectedTab=this.findSelectedTab();\r\n //this.options.description=this.options.description||\"choose one of\";\r\n this.jsf.initializeControl(this);\r\n }\r\n\r\n findSelectedTab(){\r\n //TODO test- this.jsf.formValues seems to be the initial data supplied to the form\r\n //while the jsf.formGroup value is derived from the actual controls\r\n //let formValue=this.jsf.getFormControlValue(this);\r\n let foundInd=-1;\r\n //seach for non null value\r\n if(this.layoutNode().items){\r\n this.layoutNode().items.forEach((layoutItem,ind)=>{\r\n let formValue=JsonPointer.get(this.jsf.formValues,layoutItem.dataPointer);\r\n if(layoutItem.oneOfPointer){\r\n let controlKey=path2ControlKey(layoutItem.oneOfPointer);\r\n let fname=layoutItem.name;\r\n if(hasOwn(this.jsf.formGroup.controls,controlKey)&&\r\n (formValue || hasNonNullValue(this.jsf.formGroup.controls[controlKey].value))\r\n //hasOwn(formValue,fname) && hasOwn(this.jsf.formGroup.controls,controlKey) \r\n // && (formValue[fname] || this.jsf.formGroup.controls[controlKey].value)\r\n //&&isEqual(formValue[fname],this.jsf.formGroup.controls[controlKey].value)\r\n ){\r\n foundInd=ind;\r\n }\r\n //foundInd=formValue[controlKey]!=null?ind:foundInd;\r\n //if no exact match found, then search in descendant values\r\n //to see which one of item matches\r\n if(foundInd==-1){\r\n //find all descendant oneof paths\r\n let descendantOneOfControlNames=Object.keys(this.jsf.formGroup.controls).filter(controlName=>{\r\n return controlName.startsWith(controlKey);\r\n })\r\n descendantOneOfControlNames.forEach(controlName=>{\r\n let parts=controlName.split('$');\r\n let fieldName=parts[parts.length-1];\r\n let controlValue=this.jsf.formGroup.controls[controlName].value;\r\n let controlSchema=JsonPointer.get(this.jsf.schema,parts.join(\"/\"));\r\n let schemaPointer=parts.join(\"/\");\r\n let dPointer=schemaPointer.replace(/(anyOf|allOf|oneOf|none)\\/[\\d]+\\//g, '')\r\n .replace(/(if|then|else|properties)\\//g, '').replace(/\\/items\\//g,'/-/');\r\n //JsonPointer.toDataPointer(parts.join(\"/\"),this.jsf.schema);\r\n let dVal=JsonPointer.get(this.jsf.formValues,dPointer);\r\n let compareVal=dVal;//formValue;\r\n //compare only values that are in the subschema properties\r\n if(controlSchema && controlSchema.properties){\r\n compareVal=isObject(dVal) && hasOwn(dVal,fieldName)?\r\n pick(dVal[fieldName],Object.keys(controlSchema.properties))\r\n :pick(dVal,Object.keys(controlSchema.properties))\r\n }\r\n /*\r\n if(isObject(compareVal) && hasOwn(compareVal,fieldName) && \r\n isEqual(compareVal[fieldName],controlValue)\r\n ){\r\n foundInd=ind;\r\n }else //if(formValue || controlValue){\r\n if(isEqual(compareVal,controlValue)){\r\n foundInd=ind;\r\n }\r\n */\r\n if(isEqual(compareVal,controlValue)){\r\n foundInd=ind;\r\n }\r\n })\r\n //now need to compare values\r\n }\r\n }\r\n })\r\n }\r\n return Math.max(foundInd,0);\r\n }\r\n\r\n updateValue(event) {\r\n this.jsf.updateValue(this, event.target.value);\r\n }\r\n\r\n ngOnDestroy () {\r\n //this.jsf.updateValue(this, null);\r\n }\r\n}\r\n","import { Component, inject, input, OnDestroy, OnInit } from '@angular/core';\r\nimport { AbstractControl } from '@angular/forms';\r\nimport { JsonSchemaFormService } from '../json-schema-form.service';\r\nimport { buildTitleMap } from '../shared';\r\n\r\n\r\n@Component({\r\n // tslint:disable-next-line:component-selector\r\n selector: 'radios-widget',\r\n template: `\r\n <label *ngIf=\"options?.title\"\r\n [attr.for]=\"'control' + layoutNode()?._id\"\r\n [class]=\"options?.labelHtmlClass || ''\"\r\n [style.display]=\"options?.notitle ? 'none' : ''\"\r\n [innerHTML]=\"options?.title\"></label>\r\n\r\n <!-- 'horizontal' = radios-inline or radiobuttons -->\r\n <div *ngIf=\"layoutOrientation === 'horizontal'\"\r\n [class]=\"options?.htmlClass || ''\">\r\n <label *ngFor=\"let radioItem of radiosList\"\r\n [attr.for]=\"'control' + layoutNode()?._id + '/' + radioItem?.value\"\r\n [class]=\"(options?.itemLabelHtmlClass || '') +\r\n ((controlValue + '' === radioItem?.value + '') ?\r\n (' ' + (options?.activeClass || '') + ' ' + (options?.style?.selected || '')) :\r\n (' ' + (options?.style?.unselected || '')))\">\r\n <input type=\"radio\"\r\n [attr.aria-describedby]=\"'control' + layoutNode()?._id + 'Status'\"\r\n [attr.readonly]=\"options?.readonly ? 'readonly' : null\"\r\n [attr.required]=\"options?.required\"\r\n [checked]=\"radioItem?.value === controlValue\"\r\n [class]=\"options?.fieldHtmlClass || ''\"\r\n [disabled]=\"controlDisabled\"\r\n [id]=\"'control' + layoutNode()?._id + '/' + radioItem?.value\"\r\n [name]=\"controlName\"\r\n [value]=\"radioItem?.value\"\r\n (change)=\"updateValue($event)\">\r\n <span [innerHTML]=\"radioItem?.name\"></span>\r\n </label>\r\n </div>\r\n\r\n <!-- 'vertical' = regular radios -->\r\n <div *ngIf=\"layoutOrientation !== 'horizontal'\">\r\n <div *ngFor=\"let radioItem of radiosList\"\r\n [class]=\"options?.htmlClass || ''\">\r\n <label\r\n [attr.for]=\"'control' + layoutNode()?._id + '/' + radioItem?.value\"\r\n [class]=\"(options?.itemLabelHtmlClass || '') +\r\n ((controlValue + '' === radioItem?.value + '') ?\r\n (' ' + (options?.activeClass || '') + ' ' + (options?.style?.selected || '')) :\r\n (' ' + (options?.style?.unselected || '')))\">\r\n <input type=\"radio\"\r\n [attr.aria-describedby]=\"'control' + layoutNode()?._id + 'Status'\"\r\n [attr.readonly]=\"options?.readonly ? 'readonly' : null\"\r\n [attr.required]=\"options?.required\"\r\n [checked]=\"radioItem?.value === controlValue\"\r\n [class]=\"options?.fieldHtmlClass || ''\"\r\n [disabled]=\"controlDisabled\"\r\n [id]=\"'control' + layoutNode()?._id + '/' + radioItem?.value\"\r\n [name]=\"controlName\"\r\n [value]=\"radioItem?.value\"\r\n (change)=\"updateValue($event)\">\r\n <span [innerHTML]=\"radioItem?.name\"></span>\r\n </label>\r\n </div>\r\n </div>`,\r\n standalone: false\r\n})\r\nexport class RadiosComponent implements OnInit,OnDestroy {\r\n private jsf = inject(JsonSchemaFormService);\r\n\r\n formControl: AbstractControl;\r\n controlName: string;\r\n controlValue: any;\r\n controlDisabled = false;\r\n boundControl = false;\r\n options: any;\r\n layoutOrientation = 'vertical';\r\n radiosList: any[] = [];\r\n readonly layoutNode = input<any>(undefined);\r\n readonly layoutIndex = input<number[]>(undefined);\r\n readonly dataIndex = input<number[]>(undefined);\r\n\r\n ngOnInit() {\r\n this.options = this.layoutNode().options || {};\r\n const layoutNode = this.layoutNode();\r\n if (layoutNode.type === 'radios-inline' ||\r\n layoutNode.type === 'radiobuttons'\r\n ) {\r\n this.layoutOrientation = 'horizontal';\r\n }\r\n this.radiosList = buildTitleMap(\r\n this.options.titleMap || this.options.enumNames,\r\n this.options.enum, true\r\n );\r\n this.jsf.initializeControl(this);\r\n }\r\n\r\n updateValue(event) {\r\n this.jsf.updateValue(this, event.target.value);\r\n }\r\n\r\n ngOnDestroy () {\r\n this.jsf.updateValue(this, null);\r\n }\r\n\r\n}\r\n","import { CdkDrag, CdkDragDrop } from '@angular/cdk/drag-drop';\r\nimport { ChangeDetectionStrategy, Component, inject, input, OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core';\r\nimport { memoize } from 'lodash';\r\nimport { Subscription } from 'rxjs';\r\nimport { JsonSchemaFormService } from '../json-schema-form.service';\r\n@Component({\r\n // tslint:disable-next-line:component-selector\r\n selector: 'root-widget',\r\n template: `\r\n <div cdkDropList (cdkDropListDropped)=\"drop($event)\" \r\n [class.flex-inherit]=\"true\"\r\n [cdkDropListSortPredicate]=\"sortPredicate\"\r\n >\r\n <!-- -for now left out\r\n cdkDragHandle directive, by itself, does not disable the \r\n default drag behavior of its parent cdkDrag element. \r\n You must explicitly disable dragging on the main element \r\n and re-enable it only when using the handle.\r\n -->\r\n <div *ngFor=\"let layoutItem of layout(); let i = index;trackBy: trackByFn\"\r\n cdkDrag [cdkDragStartDelay]=\"{touch:1000,mouse:0}\"\r\n [cdkDragDisabled]=\"!isDraggable(layoutItem)\"\r\n [class.form-flex-item]=\"isFlexItem()\"\r\n [style.align-self]=\"(layoutItem.options || {})['align-self']\"\r\n [style.flex-basis]=\"getFlexAttribute(layoutItem, 'flex-basis')\"\r\n [style.flex-grow]=\"getFlexAttribute(layoutItem, 'flex-grow')\"\r\n [style.flex-shrink]=\"getFlexAttribute(layoutItem, 'flex-shrink')\"\r\n [style.order]=\"(layoutItem.options || {}).order\"\r\n >\r\n\r\n <!-- workaround to disbale dragging of input fields -->\r\n <!--\r\n <div *ngIf=\"layoutItem?.dataType !='object'\" cdkDragHandle>\r\n <p>Drag Handle {{layoutItem?.dataType}}</p>\r\n </div>\r\n -->\r\n <!--NB orderable directive is not used but has been left in for now and set to false\r\n otherwise the compiler won't recognize dataIndex and other dependent attributes\r\n -->\r\n <!--\r\n <div \r\n [dataIndex]=\"layoutItem?.arrayItem ? (dataIndex() || []).concat(i) : (dataIndex() || [])\"\r\n [layoutIndex]=\"(layoutIndex() || []).concat(i)\"\r\n [layoutNode]=\"layoutItem\"\r\n [orderable]=\"false\"\r\n >\r\n <select-framework-widget *ngIf=\"showWidget(layoutItem)\"\r\n [dataIndex]=\"layoutItem?.arrayItem ? (dataIndex() || []).concat(i) : (dataIndex() || [])\"\r\n [layoutIndex]=\"(layoutIndex() || []).concat(i)\"\r\n [layoutNode]=\"layoutItem\"></select-framework-widget>\r\n </div>\r\n -->\r\n <select-framework-widget *ngIf=\"showWidget(layoutItem)\"\r\n [dataIndex]=\"getSelectFrameworkInputs(layoutItem,i).dataIndex\"\r\n [layoutIndex]=\"getSelectFrameworkInputs(layoutItem,i).layoutIndex\"\r\n [layoutNode]=\"getSelectFrameworkInputs(layoutItem,i).layoutNode\">\r\n\t\t </select-framework-widget>\r\n </div>\r\n </div>\r\n `,\r\n styles: [`\r\n [draggable=true] {\r\n transition: all 150ms cubic-bezier(.4, 0, .2, 1);\r\n }\r\n [draggable=true]:hover {\r\n cursor: move;\r\n box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);\r\n position: relative; z-index: 10;\r\n margin-top: -1px;\r\n margin-left: -1px;\r\n margin-right: 1px;\r\n margin-bottom: 1px;\r\n }\r\n [draggable=true].drag-target-top {\r\n box-shadow: 0 -2px 0 #000;\r\n position: relative; z-index: 20;\r\n }\r\n [draggable=true].drag-target-bottom {\r\n box-shadow: 0 2px 0 #000;\r\n position: relative; z-index: 20;\r\n }\r\n .flex-inherit{\r\n display:inherit;\r\n flex-flow:inherit;\r\n flex-wrap:inherit;\r\n flex-direction:inherit;\r\n width:100%\r\n }\r\n `],\r\n changeDetection:ChangeDetectionStrategy.OnPush,\r\n standalone: false\r\n})\r\nexport class RootComponent implements OnInit, OnDestroy,OnChanges {\r\n\r\n private jsf = inject(JsonSchemaFormService);\r\n\r\n options: any;\r\n readonly dataIndex = input<number[]>(undefined);\r\n readonly layoutIndex = input<number[]>(undefined);\r\n readonly layout = input<any[]>(undefined);\r\n readonly isOrderable = input<boolean>(undefined);\r\n readonly isFlexItem = input(false);\r\n readonly memoizationEnabled= input<boolean>(true);\r\n\r\n dataChangesSubs:Subscription;\r\n\r\n drop(event: CdkDragDrop<string[]>) {\r\n // most likely why this event is used is to get the dragging element's current index\r\n let srcInd=event.previousIndex;\r\n let trgInd=event.currentIndex;\r\n let layoutItem=this.layout()[trgInd];\r\n let dataInd=layoutItem?.arrayItem ? (this.dataIndex() || []).concat(trgInd) : (this.dataIndex() || []);\r\n let layoutInd=(this.layoutIndex() || []).concat(trgInd)\r\n let itemCtx:any={\r\n dataIndex:()=>{return dataInd},\r\n layoutIndex:()=>{return layoutInd},\r\n layoutNode:()=>{return layoutItem},\r\n }\r\n this.jsf.moveArrayItem(itemCtx, srcInd, trgInd,true);\r\n }\r\n\r\n isDraggable(node: any): boolean {\r\n let result=node.arrayItem && node.type !== '$ref' &&\r\n node.arrayItemType === 'list' && this.isOrderable() !== false\r\n && node.type !=='submit'\r\n return result;\r\n }\r\n\r\n //TODO also need to think of other types such as button which can be\r\n //created by an arbitrary layout\r\n isFixed(node: any): boolean {\r\n let result=node.type == '$ref';\r\n return result;\r\n }\r\n\r\n /**\r\n * Predicate function that disallows '$ref' item sorts\r\n * NB declared as a var instead of a function \r\n * like sortPredicate(index: number, item: CdkDrag<number>){..}\r\n * since 'this' is bound to the draglist and doesn't reference the\r\n * FlexLayoutRootComponent instance\r\n */\r\n //TODO also need to think of other types such as button which can be\r\n //created by an arbitrary layout\r\n //might not be needed added condition to [cdkDragDisabled]\r\n sortPredicate=(index: number, item: CdkDrag<number>)=> {\r\n let layoutItem=this.layout()[index];\r\n let result=this.isDraggable(layoutItem);\r\n //layoutItem.type != '$ref';\r\n return result;\r\n }\r\n\r\n // Set attributes for flexbox child\r\n // (container attributes are set in section.component)\r\n getFlexAttribute(node: any, attribute: string) {\r\n const index = ['flex-grow', 'flex-shrink', 'flex-basis'].indexOf(attribute);\r\n return ((node.options || {}).flex || '').split(/\\s+/)[index] ||\r\n (node.options || {})[attribute] || ['1', '1', 'auto'][index];\r\n }\r\n\r\n //private selectframeworkInputCache = new Map<string, { dataIndex: any[], layoutIndex: any[], layoutNode: any }>();\r\n\r\n //TODO review caching-if form field values change, the changes are not propagated\r\n\r\n /*\r\n getSelectFrameworkInputs(layoutItem: any, i: number) {\r\n // Create a unique key based on the layoutItem and index\r\n const cacheKey = `${layoutItem._id}-${i}`;\r\n \r\n // If the result is already in the cache, return it\r\n if(this.enableCaching){\r\n if (this.selectframeworkInputCache.has(cacheKey)) {\r\n return this.selectframeworkInputCache.get(cacheKey);\r\n }\r\n }\r\n\r\n\r\n // If not cached, calculate the values (assuming dataIndex() and layoutIndex() are functions)\r\n const dataIndex = layoutItem?.arrayItem ? (this.dataIndex() || []).concat(i) : (this.dataIndex() || []);\r\n const layoutIndex = (this.layoutIndex() || []).concat(i);\r\n\r\n // Save the result in the cache\r\n const result = { dataIndex, layoutIndex, layoutNode: layoutItem };\r\n if(this.enableCaching){\r\n this.selectframeworkInputCache.set(cacheKey, result);\r\n }\r\n\r\n return result;\r\n }\r\n */\r\n\r\n private _getSelectFrameworkInputsRaw = (layoutItem: any, i: number) => {\r\n const dataIndexValue = this.dataIndex() || [];\r\n const layoutIndexValue = this.layoutIndex() || [];\r\n\r\n return {\r\n layoutNode: layoutItem,\r\n layoutIndex: [...layoutIndexValue, i],\r\n dataIndex: layoutItem?.arrayItem ? [...dataIndexValue, i] : dataIndexValue,\r\n };\r\n };\r\n\r\n // Define a separate function to hold the memoized version\r\n private _getSelectFrameworkInputsMemoized = memoize(\r\n this._getSelectFrameworkInputsRaw,\r\n (layoutItem: any, i: number) => {\r\n const layoutItemKey = layoutItem?.id ?? JSON.stringify(layoutItem);\r\n return `${layoutItemKey}-${i}`;\r\n }\r\n );\r\n\r\n // This is the public function that the template calls\r\n getSelectFrameworkInputs(layoutItem: any, i: number) {\r\n if (this.memoizationEnabled) {\r\n return this._getSelectFrameworkInputsMemoized(layoutItem, i);\r\n } else {\r\n return this._getSelectFrameworkInputsRaw(layoutItem, i);\r\n }\r\n }\r\n trackByFn(index: number, item: any): any {\r\n return item._id ?? index;\r\n }\r\n\r\n \r\n\r\n /*\r\n ngOnChanges(changes: SimpleChanges): void {\r\n // If any of the input properties change, clear the cache\r\n if (changes.dataIndex || changes.layoutIndex || changes.layout) {\r\n this.selectframeworkInputCache?.clear(); // Clear the entire cache\r\n }\r\n }\r\n */\r\n ngOnChanges(changes: SimpleChanges): void {\r\n if (changes['layout'] || changes['dataIndex'] || changes['layoutIndex']) {\r\n // Clear the entire cache of the memoized function\r\n this._getSelectFrameworkInputsMemoized.cache.clear();\r\n }\r\n }\r\n\r\n\r\n showWidget(layoutNode: any): boolean {\r\n return this.jsf.evaluateCondition(layoutNode, this.dataIndex());\r\n }\r\n ngOnInit(): void {\r\n if(this.memoizationEnabled){\r\n this.jsf.dataChanges.subscribe((val)=>{\r\n //this.selectframeworkInputCache?.clear();\r\n this._getSelectFrameworkInputsMemoized.cache.clear();\r\n })\r\n }\r\n\r\n }\r\n ngOnDestroy(): void {\r\n //this.selectframeworkInputCache?.clear()\r\n //this.selectframeworkInputCache=null;\r\n this._getSelectFrameworkInputsMemoized.cache.clear();\r\n this.dataChangesSubs?.unsubscribe();\r\n }\r\n \r\n\r\n}\r\n","import { Component, OnInit, inject, input } from '@angular/core';\r\nimport { JsonSchemaFormService } from '../json-schema-form.service';\r\n\r\n\r\n@Component({\r\n // tslint:disable-next-line:component-selector\r\n selector: 'section-widget',\r\n template: `\r\n <div *ngIf=\"containerType === 'div'\"\r\n [class]=\"options?.htmlClass || ''\"\r\n [class.expandable]=\"options?.expandable && !expanded\"\r\n [class.expanded]=\"options?.expandable && expanded\">\r\n <label *ngIf=\"sectionTitle\"\r\n class=\"legend\"\r\n [class]=\"options?.labelHtmlClass || ''\"\r\n [innerHTML]=\"sectionTitle\"\r\n (click)=\"toggleExpanded()\"></label>\r\n <root-widget \r\n [dataIndex]=\"dataIndex()\"\r\n [layout]=\"layoutNode().items\"\r\n [layoutIndex]=\"layoutIndex()\"\r\n [isFlexItem]=\"getFlexAttribute('is-flex')\"\r\n [isOrderable]=\"options?.orderable\"\r\n [class.form-flex-column]=\"getFlexAttribute('flex-direction') === 'column'\"\r\n [class.form-flex-row]=\"getFlexAttribute('flex-direction') === 'row'\"\r\n [style.align-content]=\"getFlexAttribute('align-content')\"\r\n [style.align-items]=\"getFlexAttribute('align-items')\"\r\n [style.display]=\"!expanded?'none':getFlexAttribute('display')\"\r\n [style.flex-direction]=\"getFlexAttribute('flex-direction')\"\r\n [style.flex-wrap]=\"getFlexAttribute('flex-wrap')\"\r\n [style.justify-content]=\"getFlexAttribute('justify-content')\"></root-widget>\r\n </div>\r\n <fieldset *ngIf=\"containerType === 'fieldset'\"\r\n [class]=\"options?.htmlClass || ''\"\r\n [class.expandable]=\"options?.expandable && !expanded\"\r\n [class.expanded]=\"options?.expandable && expanded\"\r\n [disabled]=\"options?.readonly\">\r\n <legend *ngIf=\"sectionTitle\"\r\n class=\"legend\"\r\n [class]=\"options?.labelHtmlClass || ''\"\r\n [innerHTML]=\"sectionTitle\"\r\n (click)=\"toggleExpanded()\"></legend>\r\n <div *ngIf=\"options?.messageLocation !== 'bottom'\">\r\n <p *ngIf=\"options?.description\"\r\n class=\"help-block\"\r\n [class]=\"options?.labelHelpBlockClass || ''\"\r\n [innerHTML]=\"options?.description\"></p>\r\n </div>\r\n <root-widget \r\n [dataIndex]=\"dataIndex()\"\r\n [layout]=\"layoutNode().items\"\r\n [layoutIndex]=\"layoutIndex()\"\r\n [isFlexItem]=\"getFlexAttribute('is-flex')\"\r\n [isOrderable]=\"options?.orderable\"\r\n [class.form-flex-column]=\"getFlexAttribute('flex-direction') === 'column'\"\r\n [class.form-flex-row]=\"getFlexAttribute('flex-direction') === 'row'\"\r\n [style.align-content]=\"getFlexAttribute('align-content')\"\r\n [style.align-items]=\"getFlexAttribute('align-items')\"\r\n [style.display]=\"!expanded?'none':getFlexAttribute('display')\"\r\n [style.flex-direction]=\"getFlexAttribute('flex-direction')\"\r\n [style.flex-wrap]=\"getFlexAttribute('flex-wrap')\"\r\n [style.justify-content]=\"getFlexAttribute('justify-content')\"></root-widget>\r\n <div *ngIf=\"options?.messageLocation === 'bottom'\">\r\n <p *ngIf=\"options?.description\"\r\n class=\"help-block\"\r\n [class]=\"options?.labelHelpBlockClass || ''\"\r\n [innerHTML]=\"options?.description\"></p>\r\n </div>\r\n </fieldset>`,\r\n styles: [`\r\n .legend { font-weight: bold; }\r\n .expandable > legend:before, .expandable > label:before { content: '▶'; padding-right: .3em; font-family:auto }\r\n .expanded > legend:before, .expanded > label:before { content: '▼'; padding-right: .2em; }\r\n `],\r\n standalone: false\r\n})\r\nexport class SectionComponent implements OnInit {\r\n private jsf = inject(JsonSchemaFormService);\r\n\r\n options: any;\r\n expanded = true;\r\n containerType: string;\r\n readonly layoutNode = input<any>(undefined);\r\n readonly layoutIndex = input<number[]>(undefined);\r\n readonly dataIndex = input<number[]>(undefined);\r\n\r\n get sectionTitle() {\r\n return this.options.notitle ? null : this.jsf.setItemTitle(this);\r\n }\r\n\r\n\r\n\r\n ngOnInit() {\r\n this.jsf.initializeControl(this);\r\n this.options = this.layoutNode().options || {};\r\n this.expanded = typeof this.options.expanded === 'boolean' ?\r\n this.options.expanded : !this.options.expandable;\r\n switch (this.layoutNode().type) {\r\n case 'fieldset': case 'array': case 'tab': case 'advancedfieldset':\r\n case 'authfieldset': case 'optionfieldset': case 'selectfieldset':\r\n this.containerType = 'fieldset';\r\n break;\r\n default: // 'div', 'flex', 'section', 'conditional', 'actions', 'tagsinput'\r\n this.containerType = 'div';\r\n break;\r\n }\r\n }\r\n\r\n toggleExpanded() {\r\n if (this.options.expandable) { this.expanded = !this.expanded; }\r\n }\r\n\r\n // Set attributes for flexbox container\r\n // (child attributes are set in root.component)\r\n getFlexAttribute(attribute: string) {\r\n const flexActive: boolean =\r\n this.layoutNode().type === 'flex' ||\r\n !!this.options.displayFlex ||\r\n this.options.display === 'flex';\r\n if (attribute !== 'flex' && !flexActive) { return null; }\r\n switch (attribute) {\r\n case 'is-flex':\r\n return flexActive;\r\n case 'display':\r\n return flexActive ? 'flex' : 'initial';\r\n case 'flex-direction': case 'flex-wrap':\r\n const index = ['flex-direction', 'flex-wrap'].indexOf(attribute);\r\n return (this.options['flex-flow'] || '').split(/\\s+/)[index] ||\r\n this.options[attribute] || ['column', 'nowrap'][index];\r\n case 'justify-content': case 'align-items': case 'align-content':\r\n return this.options[attribute];\r\n }\r\n }\r\n}\r\n","import { Component, inject, input, OnDestroy, OnInit } from '@angular/core';\r\nimport { AbstractControl } from '@angular/forms';\r\nimport { JsonSchemaFormService } from '../json-schema-form.service';\r\nimport { buildTitleMap, isArray } from '../shared';\r\n\r\n\r\n@Component({\r\n // tslint:disable-next-line:component-selector\r\n selector: 'select-widget',\r\n template: `\r\n <div\r\n [class]=\"options?.htmlClass || ''\">\r\n <label *ngIf=\"options?.title\"\r\n [attr.for]=\"'control' + layoutNode()?._id\"\r\n [class]=\"options?.labelHtmlClass || ''\"\r\n [style.display]=\"options?.notitle ? 'none' : ''\"\r\n [innerHTML]=\"options?.title\"></label>\r\n <select *ngIf=\"boundControl && !options?.multiple\"\r\n [formControl]=\"formControl\"\r\n [attr.aria-describedby]=\"'control' + layoutNode()?._id + 'Status'\"\r\n [attr.readonly]=\"options?.readonly ? 'readonly' : null\"\r\n [attr.required]=\"options?.required\"\r\n [class]=\"options?.fieldHtmlClass || ''\"\r\n [id]=\"'control' + layoutNode()?._id\"\r\n [name]=\"controlName\">\r\n <ng-template ngFor let-selectItem [ngForOf]=\"selectList\">\r\n <option *ngIf=\"!isArray(selectItem?.items)\"\r\n [ngValue]=\"selectItem?.value\">\r\n <span [innerHTML]=\"selectItem?.name\"></span>\r\n </option>\r\n <optgroup *ngIf=\"isArray(selectItem?.items)\"\r\n [label]=\"selectItem?.group\">\r\n <option *ngFor=\"let subItem of selectItem.items\"\r\n [ngValue]=\"subItem?.value\">\r\n <span [innerHTML]=\"subItem?.name\"></span>\r\n </option>\r\n </optgroup>\r\n </ng-template>\r\n </select>\r\n <select *ngIf=\"!boundControl\"\r\n [attr.aria-describedby]=\"'control' + layoutNode()?._id + 'Status'\"\r\n [attr.readonly]=\"options?.readonly ? 'readonly' : null\"\r\n [attr.required]=\"options?.required\"\r\n [class]=\"options?.fieldHtmlClass || ''\"\r\n [disabled]=\"controlDisabled\"\r\n [id]=\"'control' + layoutNode()?._id\"\r\n [name]=\"controlName\"\r\n (change)=\"updateValue($event)\">\r\n <ng-template ngFor let-selectItem [ngForOf]=\"selectList\">\r\n <option *ngIf=\"!isArray(selectItem?.items)\"\r\n [selected]=\"selectItem?.value === controlValue\"\r\n [ngValue]=\"selectItem?.value\">\r\n <span [innerHTML]=\"selectItem?.name\"></span>\r\n </option>\r\n <optgroup *ngIf=\"isArray(selectItem?.items)\"\r\n [label]=\"selectItem?.group\">\r\n <option *ngFor=\"let subItem of selectItem.items\"\r\n [attr.selected]=\"subItem?.value === controlValue\"\r\n [ngValue]=\"subItem?.value\">\r\n <span [innerHTML]=\"subItem?.name\"></span>\r\n </option>\r\n </optgroup>\r\n </ng-template>\r\n </select>\r\n <select *ngIf=\"boundControl && options?.multiple\"\r\n [attr.aria-describedby]=\"'control' + layoutNode()?._id + 'Status'\"\r\n [attr.readonly]=\"options?.readonly ? 'readonly' : null\"\r\n [attr.required]=\"options?.required\"\r\n [class]=\"options?.fieldHtmlClass || ''\"\r\n [disabled]=\"controlDisabled\"\r\n [id]=\"'control' + layoutNode()?._id\"\r\n [multiple]=\"options?.multiple\"\r\n [name]=\"controlName\"\r\n [(ngModel)]=\"controlValue\"\r\n (change)=\"updateValue($event)\">\r\n <ng-template ngFor let-selectItem [ngForOf]=\"selectList\">\r\n <option *ngIf=\"!isArray(selectItem?.items)\"\r\n [selected]=\"selectItem?.value === controlValue\"\r\n [ngValue]=\"selectItem?.value\">\r\n <span [innerHTML]=\"selectItem?.name\"></span>\r\n </option>\r\n <optgroup *ngIf=\"isArray(selectItem?.items)\"\r\n [label]=\"selectItem?.group\">\r\n <option *ngFor=\"let subItem of selectItem.items\"\r\n [attr.selected]=\"subItem?.value === controlValue\"\r\n [ngValue]=\"subItem?.value\">\r\n <span [innerHTML]=\"subItem?.name\"></span>\r\n </option>\r\n </optgroup>\r\n </ng-template>\r\n </select>\r\n </div>`,\r\n standalone: false\r\n})\r\nexport class SelectComponent implements OnInit, OnDestroy {\r\n private jsf = inject(JsonSchemaFormService);\r\n\r\n formControl: AbstractControl;\r\n controlName: string;\r\n controlValue: any;\r\n controlDisabled = false;\r\n boundControl = false;\r\n options: any;\r\n selectList: any[] = [];\r\n selectListFlatGroup: any[] = [];\r\n isArray = isArray;\r\n readonly layoutNode = input<any>(undefined);\r\n readonly layoutIndex = input<number[]>(undefined);\r\n readonly dataIndex = input<number[]>(undefined);\r\n\r\n ngOnInit() {\r\n this.options = this.layoutNode().options || {};\r\n this.selectList = buildTitleMap(\r\n this.options.titleMap || this.options.enumNames,\r\n this.options.enum, !!this.options.required, !!this.options.flatList\r\n );\r\n //the selectListFlatGroup array will be used to update the formArray values\r\n //while the selectList array will be bound to the form select\r\n //as either a grouped select or a flat select\r\n this.selectListFlatGroup = buildTitleMap(\r\n this.options.titleMap || this.options.enumNames,\r\n this.options.enum, !!this.options.required, true\r\n )\r\n this.jsf.initializeControl(this);\r\n }\r\n\r\n deselectAll() {\r\n this.selectListFlatGroup.forEach(selItem => {\r\n selItem.checked = false;\r\n })\r\n }\r\n\r\n updateValue(event) {\r\n this.options.showErrors = true;\r\n if (this.options.multiple) {\r\n if (this.controlValue?.includes(null)) {\r\n this.deselectAll();\r\n //this.control.setValue([]); // Reset the form control to an empty array\r\n //this.selectList=JSON.parse(JSON.stringify(this.selectList));\r\n this.jsf.updateArrayMultiSelectList(this, []);\r\n } else {\r\n this.selectListFlatGroup.forEach(selItem => {\r\n selItem.checked = this.controlValue?.indexOf(selItem.value) >= 0 ? true : false;\r\n })\r\n this.jsf.updateArrayMultiSelectList(this, this.selectListFlatGroup);\r\n }\r\n return;\r\n }\r\n this.jsf.updateValue(this, this.controlValue);\r\n }\r\n\r\n ngOnDestroy() {\r\n let nullVal=this.options.multiple?[null]:null;\r\n this.formControl.reset(nullVal)\r\n this.controlValue=null;\r\n }\r\n}\r\n","import { Component, OnDestroy, OnInit, inject, input } from '@angular/core';\r\nimport { AbstractControl } from '@angular/forms';\r\nimport { Subscription } from 'rxjs';\r\nimport { JsonSchemaFormService } from '../json-schema-form.service';\r\nimport { hasOwn } from '../shared/utility.functions';\r\n\r\n\r\n@Component({\r\n // tslint:disable-next-line:component-selector\r\n selector: 'submit-widget',\r\n template: `\r\n <div\r\n [class]=\"options?.htmlClass || ''\">\r\n <input\r\n [attr.aria-describedby]=\"'control' + layoutNode()?._id + 'Status'\"\r\n [attr.readonly]=\"options?.readonly ? 'readonly' : null\"\r\n [attr.required]=\"options?.required\"\r\n [class]=\"options?.fieldHtmlClass || ''\"\r\n [disabled]=\"controlDisabled\"\r\n [id]=\"'control' + layoutNode()?._id\"\r\n [name]=\"controlName\"\r\n [type]=\"layoutNode()?.type\"\r\n [value]=\"controlValue\"\r\n (click)=\"updateValue($event)\"\r\n [appStopPropagation]=\"['mousedown', 'touchstart']\"\r\n >\r\n </div>`,\r\n standalone: false\r\n})\r\nexport class SubmitComponent implements OnInit,OnDestroy {\r\n private jsf = inject(JsonSchemaFormService);\r\n\r\n formControl: AbstractControl;\r\n controlName: string;\r\n controlValue: any;\r\n controlDisabled = false;\r\n boundControl = false;\r\n options: any;\r\n readonly layoutNode = input<any>(undefined);\r\n readonly layoutIndex = input<number[]>(undefined);\r\n readonly dataIndex = input<number[]>(undefined);\r\n\r\n isValidChangesSubs:Subscription;\r\n ngOnDestroy(): void {\r\n this.isValidChangesSubs?.unsubscribe();\r\n this.isValidChangesSubs=null;\r\n this.updateValue({target:{value:null}});\r\n }\r\n\r\n ngOnInit() {\r\n this.options = this.layoutNode().options || {};\r\n this.jsf.initializeControl(this);\r\n if (hasOwn(this.options, 'disabled')) {\r\n this.controlDisabled = this.options.disabled;\r\n } else if (this.jsf.formOptions.disableInvalidSubmit) {\r\n this.controlDisabled = !this.jsf.isValid;\r\n this.isValidChangesSubs=this.jsf.isValidChanges.subscribe(isValid => this.controlDisabled = !isValid);\r\n }\r\n if (this.controlValue === null || this.controlValue === undefined) {\r\n this.controlValue = this.options.title;\r\n }\r\n }\r\n\r\n updateValue(event) {\r\n if (typeof this.options.onClick === 'function') {\r\n this.options.onClick(event);\r\n } else {\r\n this.jsf.updateValue(this, event.target.value);\r\n }\r\n }\r\n}\r\n","import { Component, ComponentRef, OnChanges, OnInit, ViewContainerRef, inject, input, viewChild } from '@angular/core';\r\nimport { JsonSchemaFormService } from '../json-schema-form.service';\r\n\r\n\r\n@Component({\r\n // tslint:disable-next-line:component-selector\r\n selector: 'template-widget',\r\n template: `<div #widgetContainer></div>`,\r\n standalone: false\r\n})\r\nexport class TemplateComponent implements OnInit, OnChanges {\r\n private jsf = inject(JsonSchemaFormService);\r\n\r\n newComponent: ComponentRef<any> = null;\r\n readonly layoutNode = input<any>(undefined);\r\n readonly layoutIndex = input<number[]>(undefined);\r\n readonly dataIndex = input<number[]>(undefined);\r\n readonly widgetContainer = viewChild('widgetContainer', { read: ViewContainerRef });\r\n\r\n ngOnInit() {\r\n this.updateComponent();\r\n }\r\n\r\n ngOnChanges() {\r\n this.updateComponent();\r\n }\r\n\r\n updateComponent() {\r\n const layoutNode = this.layoutNode();\r\n const widgetContainer = this.widgetContainer();\r\n if (widgetContainer && !this.newComponent && layoutNode.options.template) {\r\n this.newComponent = widgetContainer.createComponent((layoutNode.options.template)\r\n );\r\n }\r\n if (this.newComponent) {\r\n for (const input of ['layoutNode', 'layoutIndex', 'dataIndex']) {\r\n this.newComponent.instance[input] = this[input];\r\n }\r\n }\r\n }\r\n}\r\n","import { Component, inject, input, OnDestroy, OnInit } from '@angular/core';\r\nimport { AbstractControl } from '@angular/forms';\r\nimport { JsonSchemaFormService } from '../json-schema-form.service';\r\n\r\n\r\n@Component({\r\n // tslint:disable-next-line:component-selector\r\n selector: 'textarea-widget',\r\n template: `\r\n <div\r\n [class]=\"options?.htmlClass || ''\">\r\n <label *ngIf=\"options?.title\"\r\n [attr.for]=\"'control' + layoutNode()?._id\"\r\n [class]=\"options?.labelHtmlClass || ''\"\r\n [style.display]=\"options?.notitle ? 'none' : ''\"\r\n [innerHTML]=\"options?.title\"></label>\r\n <textarea *ngIf=\"boundControl\"\r\n [formControl]=\"formControl\"\r\n [attr.aria-describedby]=\"'control' + layoutNode()?._id + 'Status'\"\r\n [attr.maxlength]=\"options?.maxLength\"\r\n [attr.minlength]=\"options?.minLength\"\r\n [attr.pattern]=\"options?.pattern\"\r\n [attr.placeholder]=\"options?.placeholder\"\r\n [attr.readonly]=\"options?.readonly ? 'readonly' : null\"\r\n [attr.required]=\"options?.required\"\r\n [class]=\"options?.fieldHtmlClass || ''\"\r\n [id]=\"'control' + layoutNode()?._id\"\r\n [name]=\"controlName\"></textarea>\r\n <textarea *ngIf=\"!boundControl\"\r\n [attr.aria-describedby]=\"'control' + layoutNode()?._id + 'Status'\"\r\n [attr.maxlength]=\"options?.maxLength\"\r\n [attr.minlength]=\"options?.minLength\"\r\n [attr.pattern]=\"options?.pattern\"\r\n [attr.placeholder]=\"options?.placeholder\"\r\n [attr.readonly]=\"options?.readonly ? 'readonly' : null\"\r\n [attr.required]=\"options?.required\"\r\n [class]=\"options?.fieldHtmlClass || ''\"\r\n [disabled]=\"controlDisabled\"\r\n [id]=\"'control' + layoutNode()?._id\"\r\n [name]=\"controlName\"\r\n [value]=\"controlValue\"\r\n (input)=\"updateValue($event)\">{{controlValue}}</textarea>\r\n </div>`,\r\n standalone: false\r\n})\r\nexport class TextareaComponent implements OnInit,OnDestroy {\r\n private jsf = inject(JsonSchemaFormService);\r\n\r\n formControl: AbstractControl;\r\n controlName: string;\r\n controlValue: any;\r\n controlDisabled = false;\r\n boundControl = false;\r\n options: any;\r\n readonly layoutNode = input<any>(undefined);\r\n readonly layoutIndex = input<number[]>(undefined);\r\n readonly dataIndex = input<number[]>(undefined);\r\n\r\n ngOnInit() {\r\n this.options = this.layoutNode().options || {};\r\n this.jsf.initializeControl(this);\r\n }\r\n\r\n updateValue(event) {\r\n this.jsf.updateValue(this, event.target.value);\r\n }\r\n \r\n ngOnDestroy () {\r\n this.jsf.updateValue(this, null);\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport { hasOwn } from '../shared/utility.functions';\r\nimport { AddReferenceComponent } from './add-reference.component';\r\nimport { ButtonComponent } from './button.component';\r\nimport { CheckboxComponent } from './checkbox.component';\r\nimport { CheckboxesComponent } from './checkboxes.component';\r\nimport { FileComponent } from './file.component';\r\nimport { InputComponent } from './input.component';\r\nimport { MessageComponent } from './message.component';\r\nimport { NoneComponent } from './none.component';\r\nimport { NumberComponent } from './number.component';\r\nimport { OneOfComponent } from './one-of.component';\r\nimport { RadiosComponent } from './radios.component';\r\nimport { RootComponent } from './root.component';\r\nimport { SectionComponent } from './section.component';\r\nimport { SelectFrameworkComponent } from './select-framework.component';\r\nimport { SelectWidgetComponent } from './select-widget.component';\r\nimport { SelectComponent } from './select.component';\r\nimport { SelectCheckboxComponent } from './selectcheckbox.component';\r\nimport { SubmitComponent } from './submit.component';\r\nimport { TabsComponent } from './tabs.component';\r\nimport { TemplateComponent } from './template.component';\r\nimport { TextareaComponent } from './textarea.component';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class WidgetLibraryService {\r\n\r\n defaultWidget = 'text';\r\n widgetLibrary: any = {\r\n\r\n // Angular JSON Schema Form administrative widgets\r\n 'none': NoneComponent, // Placeholder, for development - displays nothing\r\n 'root': RootComponent, // Form root, renders a complete layout\r\n 'select-framework': SelectFrameworkComponent, // Applies the selected framework to a specified widget\r\n 'select-widget': SelectWidgetComponent, // Displays a specified widget\r\n '$ref': AddReferenceComponent, // Button to add a new array item or $ref element\r\n\r\n // Free-form text HTML 'input' form control widgets <input type=\"...\">\r\n 'email': 'text',\r\n 'integer': 'number', // Note: 'integer' is not a recognized HTML input type\r\n 'number': NumberComponent,\r\n 'password': 'text',\r\n 'search': 'text',\r\n 'tel': 'text',\r\n 'text': InputComponent,\r\n 'url': 'text',\r\n\r\n // Controlled text HTML 'input' form control widgets <input type=\"...\">\r\n 'color': 'text',\r\n 'date': 'text',\r\n 'datetime': 'text',\r\n 'datetime-local': 'text',\r\n 'month': 'text',\r\n 'range': 'number',\r\n 'time': 'text',\r\n 'week': 'text',\r\n\r\n // Non-text HTML 'input' form control widgets <input type=\"...\">\r\n // 'button': <input type=\"button\"> not used, use <button> instead\r\n 'checkbox': CheckboxComponent, // TODO: Set ternary = true for 3-state ??\r\n 'file': FileComponent, // TODO: Finish 'file' widget\r\n 'hidden': 'text',\r\n 'image': 'text', // TODO: Figure out how to handle these\r\n 'radio': 'radios',\r\n 'reset': 'submit', // TODO: Figure out how to handle these\r\n 'submit': SubmitComponent,\r\n\r\n // Other (non-'input') HTML form control widgets\r\n 'button': ButtonComponent,\r\n 'select': SelectComponent,\r\n // 'option': automatically generated by select widgets\r\n // 'optgroup': automatically generated by select widgets\r\n 'textarea': TextareaComponent,\r\n\r\n // HTML form control widget sets\r\n 'checkboxes': CheckboxesComponent, // Grouped list of checkboxes\r\n 'checkboxes-inline': 'checkboxes', // Checkboxes in one line\r\n 'checkboxbuttons': 'checkboxes', // Checkboxes as html buttons\r\n 'radios': RadiosComponent, // Grouped list of radio buttons\r\n 'radios-inline': 'radios', // Radio controls in one line\r\n 'radiobuttons': 'radios', // Radio controls as html buttons\r\n\r\n // HTML Layout widgets\r\n // 'label': automatically added to data widgets\r\n // 'legend': automatically added to fieldsets\r\n 'section': SectionComponent, // Just a div <div>\r\n 'div': 'section', // Still just a div <div>\r\n 'fieldset': 'section', // A fieldset, with an optional legend <fieldset>\r\n 'flex': 'section', // A flexbox container <div style=\"display: flex\">\r\n\r\n // Non-HTML layout widgets\r\n 'one-of': OneOfComponent, // A select box that changes another input\r\n // TODO: Finish 'one-of' widget\r\n 'array': 'section', // A list you can add, remove and reorder <fieldset>\r\n 'tabarray': 'tabs', // A tabbed version of array\r\n 'tab': 'section', // A tab group, similar to a fieldset or section <fieldset>\r\n 'tabs': TabsComponent, // A tabbed set of panels with different controls\r\n 'message': MessageComponent, // Insert arbitrary html\r\n 'help': 'message', // Insert arbitrary html\r\n 'msg': 'message', // Insert arbitrary html\r\n 'html': 'message', // Insert arbitrary html\r\n 'template': TemplateComponent, // Insert a custom Angular component\r\n\r\n // Widgets included for compatibility with JSON Form API\r\n 'advancedfieldset': 'section', // Adds 'Advanced settings' title <fieldset>\r\n 'authfieldset': 'section', // Adds 'Authentication settings' title <fieldset>\r\n 'optionfieldset': 'one-of', // Option control, displays selected sub-item <fieldset>\r\n 'selectfieldset': 'one-of', // Select control, displays selected sub-item <fieldset>\r\n 'conditional': 'section', // Identical to 'section' (depeciated) <div>\r\n 'actions': 'section', // Horizontal button list, can only submit, uses buttons as items <div>\r\n 'tagsinput': 'section', // For entering short text tags <div>\r\n // See: http://ulion.github.io/jsonform/playground/?example=fields-checkboxbuttons\r\n\r\n // Widgets included for compatibility with React JSON Schema Form API\r\n 'updown': 'number',\r\n //'date-time': 'datetime-local',\r\n //as per ajv date-time requires a timezone but input \r\n //datetime-local doesn't \r\n 'iso-date-time':'datetime-local',\r\n 'alt-datetime': 'datetime-local',\r\n 'alt-date': 'date',\r\n\r\n // Widgets included for compatibility with Angular Schema Form API\r\n 'wizard': 'section', // TODO: Sequential panels with \"Next\" and \"Previous\" buttons\r\n\r\n // Widgets included for compatibility with other libraries\r\n 'textline': 'text',\r\n\r\n 'selectcheckbox': SelectCheckboxComponent,\r\n\r\n // Recommended 3rd-party add-on widgets (TODO: create wrappers for these...)\r\n // 'ng2-select': Select control replacement - http://valor-software.com/ng2-select/\r\n // 'flatpickr': Flatpickr date picker - https://github.com/chmln/flatpickr\r\n // 'pikaday': Pikaday date picker - https://github.com/dbushell/Pikaday\r\n // 'spectrum': Spectrum color picker - http://bgrins.github.io/spectrum\r\n // 'bootstrap-slider': Bootstrap Slider range control - https://github.com/seiyria/bootstrap-slider\r\n // 'ace': ACE code editor - https://ace.c9.io\r\n // 'ckeditor': CKEditor HTML / rich text editor - http://ckeditor.com\r\n // 'tinymce': TinyMCE HTML / rich text editor - https://www.tinymce.com\r\n // 'imageselect': Bootstrap drop-down image selector - http://silviomoreto.github.io/bootstrap-select\r\n // 'wysihtml5': HTML editor - http://jhollingworth.github.io/bootstrap-wysihtml5\r\n // 'quill': Quill HTML / rich text editor (?) - https://quilljs.com\r\n };\r\n registeredWidgets: any = { };\r\n frameworkWidgets: any = { };\r\n activeWidgets: any = { };\r\n\r\n constructor() {\r\n this.setActiveWidgets();\r\n }\r\n\r\n setActiveWidgets(): boolean {\r\n this.activeWidgets = Object.assign(\r\n { }, this.widgetLibrary, this.frameworkWidgets, this.registeredWidgets\r\n );\r\n for (const widgetName of Object.keys(this.activeWidgets)) {\r\n let widget: any = this.activeWidgets[widgetName];\r\n // Resolve aliases\r\n if (typeof widget === 'string') {\r\n const usedAliases: string[] = [];\r\n while (typeof widget === 'string' && !usedAliases.includes(widget)) {\r\n usedAliases.push(widget);\r\n widget = this.activeWidgets[widget];\r\n }\r\n if (typeof widget !== 'string') {\r\n this.activeWidgets[widgetName] = widget;\r\n }\r\n }\r\n }\r\n return true;\r\n }\r\n\r\n setDefaultWidget(type: string): boolean {\r\n if (!this.hasWidget(type)) { return false; }\r\n this.defaultWidget = type;\r\n return true;\r\n }\r\n\r\n hasWidget(type: string, widgetSet = 'activeWidgets'): boolean {\r\n if (!type || typeof type !== 'string') { return false; }\r\n return hasOwn(this[widgetSet], type);\r\n }\r\n\r\n hasDefaultWidget(type: string): boolean {\r\n return this.hasWidget(type, 'widgetLibrary');\r\n }\r\n\r\n registerWidget(type: string, widget: any): boolean {\r\n if (!type || !widget || typeof type !== 'string') { return false; }\r\n this.registeredWidgets[type] = widget;\r\n return this.setActiveWidgets();\r\n }\r\n\r\n unRegisterWidget(type: string): boolean {\r\n if (!hasOwn(this.registeredWidgets, type)) { return false; }\r\n delete this.registeredWidgets[type];\r\n return this.setActiveWidgets();\r\n }\r\n\r\n unRegisterAllWidgets(unRegisterFrameworkWidgets = true): boolean {\r\n this.registeredWidgets = { };\r\n if (unRegisterFrameworkWidgets) { this.frameworkWidgets = { }; }\r\n return this.setActiveWidgets();\r\n }\r\n\r\n registerFrameworkWidgets(widgets: any): boolean {\r\n if (widgets === null || typeof widgets !== 'object') { widgets = { }; }\r\n this.frameworkWidgets = widgets;\r\n return this.setActiveWidgets();\r\n }\r\n\r\n unRegisterFrameworkWidgets(): boolean {\r\n if (Object.keys(this.frameworkWidgets).length) {\r\n this.frameworkWidgets = { };\r\n return this.setActiveWidgets();\r\n }\r\n return false;\r\n }\r\n\r\n getWidget(type?: string, widgetSet = 'activeWidgets'): any {\r\n if (this.hasWidget(type, widgetSet)) {\r\n return this[widgetSet][type];\r\n } else if (this.hasWidget(this.defaultWidget, widgetSet)) {\r\n return this[widgetSet][this.defaultWidget];\r\n } else {\r\n return null;\r\n }\r\n }\r\n\r\n getAllWidgets(): any {\r\n return {\r\n widgetLibrary: this.widgetLibrary,\r\n registeredWidgets: this.registeredWidgets,\r\n frameworkWidgets: this.frameworkWidgets,\r\n activeWidgets: this.activeWidgets,\r\n };\r\n }\r\n}\r\n","import { HttpClient } from '@angular/common/http';\r\nimport { Inject, Injectable, inject } from '@angular/core';\r\nimport { Observable, Subject, lastValueFrom } from 'rxjs';\r\nimport { hasOwn } from '../shared/utility.functions';\r\nimport { WidgetLibraryService } from '../widget-library/widget-library.service';\r\nimport { Framework } from './framework';\r\n\r\n// Possible future frameworks:\r\n// - Foundation 6:\r\n// http://justindavis.co/2017/06/15/using-foundation-6-in-angular-4/\r\n// https://github.com/zurb/foundation-sites\r\n// - Semantic UI:\r\n// https://github.com/edcarroll/ng2-semantic-ui\r\n// https://github.com/vladotesanovic/ngSemantic\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class FrameworkLibraryService {\r\n //private frameworks = inject(Framework);\r\n private widgetLibrary = inject<WidgetLibraryService>(WidgetLibraryService);\r\n private http = inject(HttpClient);\r\n\r\n activeFramework: Framework = null;\r\n stylesheets: (HTMLStyleElement|HTMLLinkElement)[];\r\n scripts: HTMLScriptElement[];\r\n loadExternalAssets = false;\r\n defaultFramework: string;\r\n frameworkLibrary: { [name: string]: Framework } = {};\r\n\r\n activeFrameworkName$: Observable<string>;\r\n private activeFrameworkNameSubject: Subject<string>;\r\n private activeFrameworkName:string;\r\n\r\n constructor(@Inject(Framework) private frameworks: any[],) {\r\n this.frameworks.forEach(framework =>\r\n this.frameworkLibrary[framework.name] = framework\r\n );\r\n this.defaultFramework = this.frameworks[0].name;\r\n //this.setFramework(this.defaultFramework);\r\n \r\n this.activeFrameworkName=this.defaultFramework;\r\n this.activeFrameworkNameSubject = new Subject<string>();\r\n this.activeFrameworkName$ = this.activeFrameworkNameSubject.asObservable();\r\n this.setFramework(this.defaultFramework);\r\n }\r\n\r\n public setLoadExternalAssets(loadExternalAssets = true): void {\r\n this.loadExternalAssets = !!loadExternalAssets;\r\n }\r\n\r\n public setFramework(\r\n framework: string|Framework = this.defaultFramework,\r\n loadExternalAssets = this.loadExternalAssets\r\n ): boolean {\r\n this.activeFramework =\r\n typeof framework === 'string' && this.hasFramework(framework) ?\r\n this.frameworkLibrary[framework] :\r\n typeof framework === 'object' && hasOwn(framework, 'framework') ?\r\n framework :\r\n this.frameworkLibrary[this.defaultFramework];\r\n if(this.activeFramework.name !=this.activeFrameworkName){\r\n this.activeFrameworkName=this.activeFramework.name;\r\n this.activeFrameworkNameSubject.next(this.activeFrameworkName);\r\n }\r\n return this.registerFrameworkWidgets(this.activeFramework);\r\n }\r\n\r\n registerFrameworkWidgets(framework: Framework): boolean {\r\n return hasOwn(framework, 'widgets') ?\r\n this.widgetLibrary.registerFrameworkWidgets(framework.widgets) :\r\n this.widgetLibrary.unRegisterFrameworkWidgets();\r\n }\r\n\r\n public hasFramework(type: string): boolean {\r\n return hasOwn(this.frameworkLibrary, type);\r\n }\r\n\r\n public getFramework(): any {\r\n if (!this.activeFramework) { this.setFramework('default', true); }\r\n return this.activeFramework.framework;\r\n }\r\n\r\n public getFrameworkList():{name:string,text:string}[] {\r\n return this.frameworks.map(fw=>{\r\n return {name:fw.name,text:fw.text};\r\n })\r\n \r\n }\r\n\r\n public getFrameworkWidgets(): any {\r\n return this.activeFramework.widgets || {};\r\n }\r\n\r\n \r\n\r\n public getFrameworkStylesheets(load: boolean = this.loadExternalAssets): string[] {\r\n return (load && this.activeFramework.stylesheets) || [];\r\n }\r\n\r\n public getFrameworkScripts(load: boolean = this.loadExternalAssets): string[] {\r\n return (load && this.activeFramework.scripts) || [];\r\n }\r\n\r\n //applies to CssFramework classes\r\n public getFrameworkConfig(existingFramework?:any): any {\r\n let actFramework:Framework& { [key: string]: any; }=existingFramework||this.activeFramework;\r\n return actFramework.config;\r\n }\r\n\r\n //this will load the list of assets to be loaded at runtime in case the dependent framework\r\n //scripts and styles are include locally with the parent app\r\n public getFrameworkAssetConfig(existingFramework?:any,useAssetRelPath=true):Promise<{stylesheets:string[],scripts:string[]}>{\r\n let actFramework:Framework& { [key: string]: any; }=existingFramework||this.activeFramework;\r\n //TODO move this into config\r\n const assetConfigPath = `assets/${actFramework.name}/cssframework`\r\n const assetConfigURL = `${assetConfigPath}/assets.json`;\r\n let subs=this.http\r\n .get(assetConfigURL, { responseType: 'text' })\r\n //.subscribe(assetConfig => {\r\n // assetConfig\r\n //})\r\n \r\n return lastValueFrom(subs).then(assetCfgText=>{\r\n let assetCfg=JSON.parse(assetCfgText);\r\n if(useAssetRelPath){\r\n assetCfg.stylesheets=assetCfg.stylesheets.map(styleLink=>{\r\n //ignore relative path if url starts with known protocol or //\r\n let nonRelPrefixes=[\"/\",\"//\",\"http:\",\"https:\"];//\"//\" list for completeness \r\n let isNonRel=false;\r\n nonRelPrefixes.forEach(prefix=>{\r\n isNonRel=isNonRel||styleLink.indexOf(prefix)==0;\r\n })\r\n if(isNonRel){\r\n return styleLink;\r\n }\r\n return `${assetConfigPath}/${styleLink}`;\r\n })\r\n assetCfg.scripts=assetCfg.scripts.map(scriptLink=>{\r\n return `${assetConfigPath}/${scriptLink}`;\r\n })\r\n } \r\n return assetCfg\r\n });\r\n }\r\n\r\n //applies to CssFramework classes\r\n public getFrameworkThemes():{name:string,text:string}[] {\r\n let cssfwConfig=this.getFrameworkConfig();\r\n let themes;\r\n if(cssfwConfig){\r\n themes=cssfwConfig?.widgetstyles?.__themes__||[]\r\n }\r\n return themes\r\n }\r\n\r\n //applies to CssFramework classes\r\n public requestThemeChange(name:string,validateThemeExists:boolean=false,existingFramework?:any){\r\n let actFramework:Framework& { [key: string]: any; }=existingFramework||this.activeFramework;\r\n if(actFramework.requestThemeChange){\r\n if(validateThemeExists){ \r\n let themes=this.getFrameworkThemes();\r\n let foundThemes=themes.filter(thm=>{return thm.name==name});\r\n if(!foundThemes|| foundThemes.length==0){\r\n return false;\r\n }\r\n }\r\n actFramework.requestThemeChange(name);\r\n return true;\r\n }\r\n }\r\n //applies to CssFramework classes\r\n public getActiveTheme(existingFramework?:any):{name:string,text:string}{\r\n let actFramework:Framework& { [key: string]: any; }=existingFramework||this.activeFramework;\r\n if(actFramework.getActiveTheme){\r\n return actFramework.getActiveTheme();\r\n }\r\n }\r\n\r\n //applies to CssFramework classes\r\n public registerTheme(newTheme:{name:string,text:string},existingFramework?:any):boolean{\r\n let actFramework:Framework& { [key: string]: any; }=existingFramework||this.activeFramework;\r\n if(actFramework.registerTheme){\r\n return actFramework.registerTheme(newTheme);\r\n }\r\n }\r\n\r\n //applies to CssFramework classes\r\n public unregisterTheme(name:string,existingFramework?:any):boolean{\r\n let actFramework:Framework& { [key: string]: any; }=existingFramework||this.activeFramework;\r\n if(actFramework.registerTheme){\r\n return actFramework.unregisterTheme(name);\r\n }\r\n }\r\n}\r\n","import { Component, inject, input, OnDestroy, OnInit } from '@angular/core';\r\nimport { AbstractControl } from '@angular/forms';\r\nimport { FrameworkLibraryService } from '../framework-library/framework-library.service';\r\nimport { JsonSchemaFormService } from '../json-schema-form.service';\r\nimport { buildTitleMap, isArray } from '../shared';\r\n\r\n//component created as a fallback for the checkbox/sortabljs issue\r\n//its meant to display a select as a checkbox\r\n@Component({\r\n // tslint:disable-next-line:component-selector\r\n selector: 'selectcheckbox-widget',\r\n template: `\r\n <div \r\n [class]=\"options?.htmlClass || ''\">\r\n <select *ngIf=\"boundControl\"\r\n [attr.aria-describedby]=\"'control' + layoutNode()?._id + 'Status'\"\r\n [attr.readonly]=\"options?.readonly ? 'readonly' : null\"\r\n [attr.required]=\"options?.required\"\r\n [class]=\" frameworkStyles[activeFramework].selectClass\"\r\n [multiple]=\"true\"\r\n [id]=\"'control' + layoutNode()?._id\"\r\n [name]=\"controlName\"\r\n [ngModel]=\"selectValue\" \r\n >\r\n <ng-template ngFor let-selectItem [ngForOf]=\"selectList\">\r\n <option *ngIf=\"!isArray(selectItem?.items)\"\r\n [class]=\"frameworkStyles[activeFramework].optionClass\"\r\n [class.active]=\"selectItem?.value === controlValue\"\r\n [class.unchecked-notusing]=\"selectItem?.value != controlValue\"\r\n [value]=\"selectItem?.value\"\r\n (click)=\"onSelectClicked($event)\"\r\n type=\"checkbox\"\r\n >\r\n </option>\r\n <!--NB the text is out of the option element to display besides the checkbox-->\r\n <span [innerHTML]=\"selectItem?.name\"></span>\r\n </ng-template>\r\n </select>\r\n <select *ngIf=\"!boundControl\"\r\n [attr.aria-describedby]=\"'control' + layoutNode()?._id + 'Status'\"\r\n [attr.readonly]=\"options?.readonly ? 'readonly' : null\"\r\n [attr.required]=\"options?.required\"\r\n [class]=\"frameworkStyles[activeFramework].selectClass +' select-box'\"\r\n [multiple]=\"true\"\r\n [disabled]=\"controlDisabled\"\r\n [id]=\"'control' + layoutNode()?._id\"\r\n [name]=\"controlName\"\r\n (change)=\"updateValue($event)\">\r\n <ng-template ngFor let-selectItem [ngForOf]=\"selectList\">\r\n <option *ngIf=\"!isArray(selectItem?.items)\"\r\n [selected]=\"selectItem?.value === controlValue\"\r\n [class]=\"frameworkStyles[activeFramework].optionClass\"\r\n [class.checked-notusing]=\"selectItem?.value === controlValue\"\r\n [class.unchecked-notusing]]=\"selectItem?.value != controlValue\"\r\n [value]=\"selectItem?.value\"\r\n type=\"checkbox\">\r\n </option>\r\n <!--NB the text is out of the option element to display besides the checkbox-->\r\n <span [innerHTML]=\"selectItem?.name\"></span>\r\n </ng-template>\r\n </select>\r\n \r\n </div>`,\r\n styles:[`\r\n /* Style the select element */\r\n .select-box {\r\n font-size: 16px;\r\n border: none;\r\n appearance: none;\r\n -webkit-appearance: none;\r\n -moz-appearance: none;\r\n height: 25px; /*Height equal to the size of a single option */\r\n overflow: hidden; /* Hide scrollbars */\r\n text-overflow: ellipsis; /* For overflowing text inside options */\r\n background-color: white; /* Set background to white */\r\n color: black; /* Ensure text is black */\r\n /* White gradient background */\r\n /*\r\n background-image: linear-gradient(0deg, white 0%, white 100%); \r\n */\r\n background-color:transparent;\r\n }\r\n\r\n /* Remove the default focus outline */\r\n .select-box:focus {\r\n outline: none;\r\n }\r\n\r\n /* Style the option element */\r\n .select-option {\r\n font-size: 20px; /* Adjust size of the checkbox */\r\n color: black; /* Ensure text color is black */\r\n background-color: white; /* Ensure background is white */\r\n display:inline-block;\r\n }\r\n\r\n /* Empty box when unchecked */\r\n .unchecked::before {\r\n content: '☐'; /* Empty box Unicode */\r\n left: 5px;\r\n top: 50%;\r\n transform: translateY(-50%);\r\n font-size: 30px; /* Adjust size */\r\n }\r\n\r\n /* Checked box when selected */\r\n .checked::before {\r\n content: '☑'; /* Checked box with tick Unicode */\r\n left: 5px;\r\n top: 50%;\r\n transform: translateY(-50%);\r\n font-size: 30px;\r\n }\r\n\r\n /* Maintain the text and background color when the option is selected */\r\n .select-option:checked {\r\n background-image: linear-gradient(0deg, white 0%, white 100%);\r\n color: black;\r\n }\r\n\r\n /* Style the select element when focused */\r\n .select-box[multiple]:focus {\r\n /*\r\n background-image: linear-gradient(0deg, white 0%, white 100%);\r\n */\r\n background-color:transparent;\r\n color: blue;\r\n -webkit-text-fill-color: black;\r\n }\r\n \r\n .display-inline-block{\r\n display:inline-block;\r\n }\r\n\r\n .bs4-option, .bs3-option{\r\n width: 14px;\r\n height: 14px;\r\n border: solid 1px;\r\n color: darkgrey;\r\n min-block-size: auto;\r\n border-radius: 3px;\r\n \r\n }\r\n .bs4-option:checked[type=checkbox], .bs3-option:checked[type=checkbox] {\r\n \r\n background-image: url(data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3C!--%20License%3A%20MIT.%20Made%20by%20jaynewey%3A%20https%3A%2F%2Fgithub.com%2Fjaynewey%2Fcharm-icons%20--%3E%3Csvg%20viewBox%3D%220%200%2016%2016%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20fill%3D%22none%22%20stroke%3D%22%23000000%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20stroke-width%3D%222.5%22%3E%3Cpolyline%20points%3D%224%208.75%2C6.25%2012.25%2C13.25%203.5%22%2F%3E%3C%2Fsvg%3E);\r\n background-color:darkturquoise;\r\n }\r\n \r\n `],\r\n standalone: false\r\n})\r\nexport class SelectCheckboxComponent implements OnInit, OnDestroy {\r\n private jsf = inject(JsonSchemaFormService);\r\n private jsfFLService = inject(FrameworkLibraryService);\r\n\r\n formControl: AbstractControl;\r\n controlName: string;\r\n controlValue: any;\r\n controlDisabled = false;\r\n boundControl = false;\r\n options: any;\r\n selectList: any[] = [];\r\n selectListFlatGroup: any[] = [];\r\n selectValue: any;\r\n isArray = isArray;\r\n readonly layoutNode = input<any>(undefined);\r\n readonly layoutIndex = input<number[]>(undefined);\r\n readonly dataIndex = input<number[]>(undefined);\r\n\r\n frameworkStyles={\r\n daisyui:{selectClass:\"select-box\",optionClass:\"checkbox tw:dui-checkbox\",optionChecked:\"active\",optionUnchecked:\"\"},\r\n \"bootstrap-3\":{selectClass:\"select-box\",optionClass:\"bs3-option checkbox display-inline-block\",optionChecked:\"active\",optionUnchecked:\"\"},\r\n \"bootstrap-4\":{selectClass:\"select-box\",optionClass:\"bs4-option checkbox display-inline-block\",optionChecked:\"active\",optionUnchecked:\"\"},\r\n \"bootstrap-5\":{selectClass:\" select-box\",optionClass:\"form-check-input display-inline-block\",optionChecked:\"active\",optionUnchecked:\"\"},\r\n //\"material-design\":{selectClass:\" \",optionClass:\" \"}\r\n\r\n }\r\n\r\n activeFramework:string;\r\n\r\n ngOnInit() {\r\n this.options = this.layoutNode().options || {};\r\n this.activeFramework= this.jsfFLService.activeFramework.name;\r\n this.selectList = buildTitleMap(\r\n //this.options.titleMap || this.options.enumNames,\r\n //TODO review-title is set to null in the setTitle() method of CssFrameworkComponent\r\n this.options.enumNames || (this.options?.title && [this.options?.title]) \r\n || [this.layoutNode().name],\r\n //this.options.enum, \r\n [true],\r\n //make required true to avoid creating 'none' select option\r\n true, !!this.options.flatList\r\n );\r\n\r\n\r\n\r\n\r\n //the selectListFlatGroup array will be used to update the formArray values\r\n //while the selectList array will be bound to the form select\r\n //as either a grouped select or a flat select\r\n /*\r\n this.selectListFlatGroup = buildTitleMap(\r\n this.options.titleMap || this.options.enumNames,\r\n this.options.enum, !!this.options.required, true\r\n )\r\n */\r\n \r\n this.jsf.initializeControl(this);\r\n this.selectValue=[this.controlValue];\r\n }\r\n\r\n deselectAll() {\r\n this.selectListFlatGroup.forEach(selItem => {\r\n selItem.checked = false;\r\n })\r\n }\r\n\r\n updateValue(event) {\r\n this.options.showErrors = true;\r\n this.controlValue=this.selectValue[0];\r\n this.jsf.updateValue(this, this.controlValue);\r\n }\r\n\r\n onSelectClicked($event){\r\n this.selectValue=this.selectValue && this.selectValue[0]?[false]:[true];\r\n this.controlValue=this.selectValue[0];\r\n this.jsf.updateValue(this, this.controlValue);\r\n }\r\n\r\n ngOnDestroy() {\r\n let nullVal=this.options.multiple?[null]:null;\r\n this.formControl.reset(nullVal)\r\n this.controlValue=null;\r\n }\r\n}\r\n","import { Component, OnInit, input, inject } from '@angular/core';\r\nimport { JsonSchemaFormService } from '../json-schema-form.service';\r\n\r\n\r\n@Component({\r\n // tslint:disable-next-line:component-selector\r\n selector: 'tab-widget',\r\n template: `\r\n <div [class]=\"options?.htmlClass || ''\">\r\n <root-widget\r\n [dataIndex]=\"dataIndex()\"\r\n [layoutIndex]=\"layoutIndex()\"\r\n [layout]=\"layoutNode().items\"></root-widget>\r\n </div>`,\r\n standalone: false\r\n})\r\nexport class TabComponent implements OnInit {\r\n private jsf = inject(JsonSchemaFormService);\r\n\r\n options: any;\r\n readonly layoutNode = input<any>(undefined);\r\n readonly layoutIndex = input<number[]>(undefined);\r\n readonly dataIndex = input<number[]>(undefined);\r\n\r\n ngOnInit() {\r\n this.options = this.layoutNode().options || {};\r\n }\r\n}\r\n","import { Directive, ElementRef, NgZone, OnDestroy, OnInit, inject, input } from '@angular/core';\r\nimport { Subscription } from 'rxjs';\r\nimport { JsonSchemaFormService } from '../json-schema-form.service';\r\n\r\n\r\n/**\r\n * OrderableDirective\r\n *\r\n * Enables array elements to be reordered by dragging and dropping.\r\n *\r\n * Only works for arrays that have at least two elements.\r\n *\r\n * Also detects arrays-within-arrays, and correctly moves either\r\n * the child array element or the parent array element,\r\n * depending on the drop targert.\r\n *\r\n * Listeners for movable element being dragged:\r\n * - dragstart: add 'dragging' class to element, set effectAllowed = 'move'\r\n * - dragover: set dropEffect = 'move'\r\n * - dragend: remove 'dragging' class from element\r\n *\r\n * Listeners for stationary items being dragged over:\r\n * - dragenter: add 'drag-target-...' classes to element\r\n * - dragleave: remove 'drag-target-...' classes from element\r\n * - drop: remove 'drag-target-...' classes from element, move dropped array item\r\n */\r\n@Directive({\r\n // tslint:disable-next-line:directive-selector\r\n selector: '[orderable]',\r\n standalone: false\r\n})\r\nexport class OrderableDirective implements OnInit,OnDestroy {\r\n\r\n private elementRef = inject(ElementRef);\r\n private jsf = inject(JsonSchemaFormService);\r\n private ngZone = inject(NgZone);\r\n\r\n arrayLayoutIndex: string;\r\n element: any;\r\n overParentElement = false;\r\n overChildElement = false;\r\n readonly orderable = input<boolean>(undefined);\r\n readonly layoutNode = input<any>(undefined);\r\n readonly layoutIndex = input<number[]>(undefined);\r\n readonly dataIndex = input<number[]>(undefined);\r\n\r\n private draggableStateSubscription: Subscription;\r\n ngOnInit() {\r\n const layoutIndex = this.layoutIndex();\r\n if (this.orderable() && this.layoutNode() && layoutIndex && this.dataIndex()) {\r\n this.element = this.elementRef.nativeElement;\r\n this.element.draggable = true;\r\n this.arrayLayoutIndex = 'move:' + layoutIndex.slice(0, -1).toString();\r\n\r\n this.ngZone.runOutsideAngular(() => {\r\n\r\n // Listeners for movable element being dragged:\r\n\r\n this.element.addEventListener('dragstart', (event) => {\r\n event.dataTransfer.effectAllowed = 'move';\r\n event.dataTransfer.setData('text', '');\r\n // Hack to bypass stupid HTML drag-and-drop dataTransfer protection\r\n // so drag source info will be available on dragenter\r\n const sourceArrayIndex = this.dataIndex()[this.dataIndex().length - 1];\r\n sessionStorage.setItem(this.arrayLayoutIndex, sourceArrayIndex + '');\r\n });\r\n\r\n this.element.addEventListener('dragover', (event) => {\r\n if (event.preventDefault) { event.preventDefault(); }\r\n event.dataTransfer.dropEffect = 'move';\r\n return false;\r\n });\r\n\r\n // Listeners for stationary items being dragged over:\r\n\r\n this.element.addEventListener('dragenter', (event) => {\r\n // Part 1 of a hack, inspired by Dragster, to simulate mouseover and mouseout\r\n // behavior while dragging items - http://bensmithett.github.io/dragster/\r\n if (this.overParentElement) {\r\n return this.overChildElement = true;\r\n } else {\r\n this.overParentElement = true;\r\n }\r\n\r\n const sourceArrayIndex = sessionStorage.getItem(this.arrayLayoutIndex);\r\n if (sourceArrayIndex !== null) {\r\n if (this.dataIndex()[this.dataIndex().length - 1] < +sourceArrayIndex) {\r\n this.element.classList.add('drag-target-top');\r\n } else if (this.dataIndex()[this.dataIndex().length - 1] > +sourceArrayIndex) {\r\n this.element.classList.add('drag-target-bottom');\r\n }\r\n }\r\n });\r\n\r\n this.element.addEventListener('dragleave', (event) => {\r\n // Part 2 of the Dragster hack\r\n if (this.overChildElement) {\r\n this.overChildElement = false;\r\n } else if (this.overParentElement) {\r\n this.overParentElement = false;\r\n }\r\n\r\n const sourceArrayIndex = sessionStorage.getItem(this.arrayLayoutIndex);\r\n if (!this.overParentElement && !this.overChildElement && sourceArrayIndex !== null) {\r\n this.element.classList.remove('drag-target-top');\r\n this.element.classList.remove('drag-target-bottom');\r\n }\r\n });\r\n\r\n this.element.addEventListener('drop', (event) => {\r\n this.element.classList.remove('drag-target-top');\r\n this.element.classList.remove('drag-target-bottom');\r\n // Confirm that drop target is another item in the same array as source item\r\n const sourceArrayIndex = sessionStorage.getItem(this.arrayLayoutIndex);\r\n const destArrayIndex = this.dataIndex()[this.dataIndex().length - 1];\r\n if (sourceArrayIndex !== null && +sourceArrayIndex !== destArrayIndex) {\r\n // Move array item\r\n this.jsf.moveArrayItem(this, +sourceArrayIndex, destArrayIndex);\r\n }\r\n sessionStorage.removeItem(this.arrayLayoutIndex);\r\n return false;\r\n });\r\n\r\n });\r\n // Subscribe to the draggable state\r\n this.draggableStateSubscription = this.jsf.draggableState$.subscribe(\r\n (value) => {\r\n this.element.draggable = value;\r\n }\r\n );\r\n }\r\n }\r\n ngOnDestroy(): void {\r\n if (this.draggableStateSubscription) {\r\n this.draggableStateSubscription.unsubscribe();\r\n }\r\n }\r\n}\r\n","import { AddReferenceComponent } from './add-reference.component';\r\nimport { ButtonComponent } from './button.component';\r\nimport { CheckboxComponent } from './checkbox.component';\r\nimport { CheckboxesComponent } from './checkboxes.component';\r\nimport { FileComponent } from './file.component';\r\nimport { HiddenComponent } from './hidden.component';\r\nimport { InputComponent } from './input.component';\r\nimport { MessageComponent } from './message.component';\r\nimport { NoneComponent } from './none.component';\r\nimport { NumberComponent } from './number.component';\r\nimport { OneOfComponent } from './one-of.component';\r\nimport { RadiosComponent } from './radios.component';\r\nimport { RootComponent } from './root.component';\r\nimport { SectionComponent } from './section.component';\r\nimport { SelectFrameworkComponent } from './select-framework.component';\r\nimport { SelectWidgetComponent } from './select-widget.component';\r\nimport { SelectComponent } from './select.component';\r\nimport { SelectCheckboxComponent } from './selectcheckbox.component';\r\nimport { SubmitComponent } from './submit.component';\r\nimport { TabComponent } from './tab.component';\r\nimport { TabsComponent } from './tabs.component';\r\nimport { TemplateComponent } from './template.component';\r\nimport { TextareaComponent } from './textarea.component';\r\n\r\nexport const BASIC_WIDGETS = [\r\n AddReferenceComponent, OneOfComponent, ButtonComponent, CheckboxComponent,\r\n CheckboxesComponent, FileComponent, HiddenComponent, InputComponent,\r\n MessageComponent, NoneComponent, NumberComponent, RadiosComponent,\r\n RootComponent, SectionComponent, SelectComponent, SelectFrameworkComponent,\r\n SelectWidgetComponent, SubmitComponent, TabComponent, TabsComponent,\r\n TemplateComponent, TextareaComponent,SelectCheckboxComponent\r\n];\r\n\r\nexport { AddReferenceComponent } from './add-reference.component';\r\nexport { ButtonComponent } from './button.component';\r\nexport { CheckboxComponent } from './checkbox.component';\r\nexport { CheckboxesComponent } from './checkboxes.component';\r\nexport { ElementAttributeDirective } from './element-attribute.directive';\r\nexport { FileComponent } from './file.component';\r\nexport { HiddenComponent } from './hidden.component';\r\nexport { InputComponent } from './input.component';\r\nexport { MessageComponent } from './message.component';\r\nexport { NoneComponent } from './none.component';\r\nexport { NumberComponent } from './number.component';\r\nexport { OneOfComponent } from './one-of.component';\r\nexport { OrderableDirective } from './orderable.directive';\r\nexport { RadiosComponent } from './radios.component';\r\nexport { RootComponent } from './root.component';\r\nexport { SectionComponent } from './section.component';\r\nexport { SelectFrameworkComponent } from './select-framework.component';\r\nexport { SelectWidgetComponent } from './select-widget.component';\r\nexport { SelectComponent } from './select.component';\r\nexport { SelectCheckboxComponent } from './selectcheckbox.component';\r\nexport { StopPropagationDirective } from './stop-propagation.directive';\r\nexport { SubmitComponent } from './submit.component';\r\nexport { TabComponent } from './tab.component';\r\nexport { TabsComponent } from './tabs.component';\r\nexport { TemplateComponent } from './template.component';\r\nexport { TextareaComponent } from './textarea.component';\r\nexport { WidgetLibraryService } from './widget-library.service';\r\n\r\n","import { DragDropModule } from '@angular/cdk/drag-drop';\r\nimport { CommonModule } from '@angular/common';\r\nimport { NgModule } from '@angular/core';\r\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\r\nimport { ElementAttributeDirective } from './element-attribute.directive';\r\nimport { BASIC_WIDGETS } from './index';\r\nimport { OrderableDirective } from './orderable.directive';\r\nimport { StopPropagationDirective } from './stop-propagation.directive';\r\n\r\n@NgModule({\r\n imports: [CommonModule, FormsModule, ReactiveFormsModule,DragDropModule\r\n ],\r\n declarations: [...BASIC_WIDGETS, OrderableDirective,ElementAttributeDirective,StopPropagationDirective],\r\n exports: [...BASIC_WIDGETS, OrderableDirective,ElementAttributeDirective,StopPropagationDirective]\r\n})\r\nexport class WidgetLibraryModule {\r\n}\r\n","import { CommonModule } from '@angular/common';\r\nimport { Framework } from './framework';\r\nimport { NgModule } from '@angular/core';\r\nimport { NoFramework } from './no.framework';\r\nimport { NoFrameworkComponent } from './no-framework.component';\r\nimport { WidgetLibraryModule } from '../widget-library/widget-library.module';\r\n\r\n// No framework - plain HTML controls (styles from form layout only)\r\n\r\n@NgModule({\r\n imports: [CommonModule, WidgetLibraryModule],\r\n declarations: [NoFrameworkComponent],\r\n exports: [NoFrameworkComponent],\r\n providers: [\r\n { provide: Framework, useClass: NoFramework, multi: true }\r\n ]\r\n})\r\nexport class NoFrameworkModule { }\r\n","import cloneDeep from 'lodash/cloneDeep';\r\nimport isEqual from 'lodash/isEqual';\r\n\r\nimport { ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, OnChanges, OnDestroy, OnInit, SimpleChanges, forwardRef, inject, input, output } from '@angular/core';\r\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\r\nimport { Subject, Subscription } from 'rxjs';\r\nimport { takeUntil } from 'rxjs/operators';\r\nimport { FrameworkLibraryService } from './framework-library/framework-library.service';\r\nimport { JsonSchemaFormService } from './json-schema-form.service';\r\nimport { convertSchemaToDraft6 } from './shared/convert-schema-to-draft6.function';\r\nimport { resolveSchemaReferences } from './shared/json-schema.functions';\r\nimport { JsonPointer } from './shared/jsonpointer.functions';\r\nimport { forEach, hasOwn } from './shared/utility.functions';\r\nimport {\r\n hasValue,\r\n inArray,\r\n isArray,\r\n isEmpty,\r\n isObject\r\n} from './shared/validator.functions';\r\nimport { WidgetLibraryService } from './widget-library/widget-library.service';\r\n\r\nexport const JSON_SCHEMA_FORM_VALUE_ACCESSOR: any = {\r\n provide: NG_VALUE_ACCESSOR,\r\n useExisting: forwardRef(() => JsonSchemaFormComponent),\r\n multi: true,\r\n};\r\n\r\n/**\r\n * @module 'JsonSchemaFormComponent' - Angular JSON Schema Form\r\n *\r\n * Root module of the Angular JSON Schema Form client-side library,\r\n * an Angular library which generates an HTML form from a JSON schema\r\n * structured data model and/or a JSON Schema Form layout description.\r\n *\r\n * This library also validates input data by the user, using both validators on\r\n * individual controls to provide real-time feedback while the user is filling\r\n * out the form, and then validating the entire input against the schema when\r\n * the form is submitted to make sure the returned JSON data object is valid.\r\n *\r\n * This library is similar to, and mostly API compatible with:\r\n *\r\n * - JSON Schema Form's Angular Schema Form library for AngularJs\r\n * http://schemaform.io\r\n * http://schemaform.io/examples/bootstrap-example.html (examples)\r\n *\r\n * - Mozilla's react-jsonschema-form library for React\r\n * https://github.com/mozilla-services/react-jsonschema-form\r\n * https://mozilla-services.github.io/react-jsonschema-form (examples)\r\n *\r\n * - Joshfire's JSON Form library for jQuery\r\n * https://github.com/joshfire/jsonform\r\n * http://ulion.github.io/jsonform/playground (examples)\r\n *\r\n * This library depends on:\r\n * - Angular (obviously) https://angular.io\r\n * - lodash, JavaScript utility library https://github.com/lodash/lodash\r\n * - ajv, Another JSON Schema validator https://github.com/epoberezkin/ajv\r\n *\r\n * In addition, the Example Playground also depends on:\r\n * - brace, Browserified Ace editor http://thlorenz.github.io/brace\r\n */\r\n@Component({\r\n // tslint:disable-next-line:component-selector\r\n selector: 'json-schema-form',\r\n templateUrl: './json-schema-form.component.html',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n // Adding 'JsonSchemaFormService' here, instead of in the module,\r\n // creates a separate instance of the service for each component\r\n providers: [JsonSchemaFormService, JSON_SCHEMA_FORM_VALUE_ACCESSOR],\r\n standalone: false\r\n})\r\nexport class JsonSchemaFormComponent implements ControlValueAccessor, OnChanges, OnInit,OnDestroy {\r\n private changeDetector = inject(ChangeDetectorRef);\r\n private frameworkLibrary = inject(FrameworkLibraryService);\r\n private widgetLibrary = inject(WidgetLibraryService);\r\n jsf = inject(JsonSchemaFormService);\r\n\r\n // TODO: quickfix to avoid subscribing twice to the same emitters\r\n private unsubscribeOnActivateForm$ = new Subject<void>();\r\n\r\n debugOutput: any; // Debug information, if requested\r\n formValueSubscription: any = null;\r\n formInitialized = false;\r\n objectWrap = false; // Is non-object input schema wrapped in an object?\r\n\r\n formValuesInput: string; // Name of the input providing the form data\r\n previousInputs: { // Previous input values, to detect which input triggers onChanges\r\n schema: any, layout: any[], data: any, options: any, framework: any | string,\r\n widgets: any, form: any, model: any, JSONSchema: any, UISchema: any,\r\n formData: any, loadExternalAssets: boolean, debug: boolean,ajvOptions:any\r\n } = {\r\n schema: null, layout: null, data: null, options: null, framework: null,\r\n widgets: null, form: null, model: null, JSONSchema: null, UISchema: null,\r\n formData: null, loadExternalAssets: null, debug: null,ajvOptions:null\r\n };\r\n\r\n // Recommended inputs\r\n readonly schema = input<any>(undefined); // The JSON Schema\r\n readonly layout = input<any[]>(undefined); // The form layout\r\n readonly data = input<any>(undefined); // The form data\r\n readonly options = input<any>(undefined); // The global form options\r\n readonly framework = input<any | string>(undefined); // The framework to load\r\n readonly widgets = input<any>(undefined); // Any custom widgets to load\r\n\r\n // Alternate combined single input\r\n readonly form = input<any>(undefined); // For testing, and JSON Schema Form API compatibility\r\n\r\n // Angular Schema Form API compatibility input\r\n readonly model = input<any>(undefined); // Alternate input for form data\r\n\r\n // React JSON Schema Form API compatibility inputs\r\n readonly JSONSchema = input<any>(undefined); // Alternate input for JSON Schema\r\n readonly UISchema = input<any>(undefined); // UI schema - alternate form layout format\r\n readonly formData = input<any>(undefined); // Alternate input for form data\r\n\r\n readonly ngModel = input<any>(undefined); // Alternate input for Angular forms\r\n\r\n readonly language = input<string>(undefined); // Language\r\n\r\n // Development inputs, for testing and debugging\r\n readonly loadExternalAssets = input<boolean>(undefined); // Load external framework assets?\r\n readonly debug = input<boolean>(undefined); // Show debug information?\r\n\r\n readonly theme = input<string>(undefined); // Theme\r\n\r\n readonly ajvOptions = input<any>(undefined); // ajvOptions\r\n\r\n private ajvInstanceName:string;\r\n\r\n @Input()\r\n get value(): any {\r\n return this.objectWrap ? this.jsf.data['1'] : this.jsf.data;\r\n }\r\n set value(value: any) {\r\n this.setFormValues(value, false);\r\n }\r\n\r\n // Outputs\r\n readonly onChanges = output<any>(); // Live unvalidated internal form data\r\n readonly onSubmit = output<any>(); // Complete validated form data\r\n readonly isValid = output<boolean>(); // Is current data valid?\r\n readonly validationErrors = output<any>(); // Validation errors (if any)\r\n readonly formSchema = output<any>(); // Final schema used to create form\r\n readonly formLayout = output<any>(); // Final layout used to create form\r\n\r\n // Outputs for possible 2-way data binding\r\n // Only the one input providing the initial form data will be bound.\r\n // If there is no inital data, input '{}' to activate 2-way data binding.\r\n // There is no 2-way binding if inital data is combined inside the 'form' input.\r\n readonly dataChange = output<any>();\r\n readonly modelChange = output<any>();\r\n readonly formDataChange = output<any>();\r\n readonly ngModelChange = output<any>();\r\n\r\n onChange: Function;\r\n onTouched: Function;\r\n\r\n //TODO-review,maybe use takeUntilDestroyed rxjs op\r\n dataChangesSubs:Subscription;\r\n statusChangesSubs:Subscription;\r\n isValidChangesSubs:Subscription;\r\n validationErrorChangesSubs:Subscription;\r\n ngOnDestroy(): void {\r\n this.dataChangesSubs?.unsubscribe();\r\n this.statusChangesSubs?.unsubscribe();\r\n this.isValidChangesSubs?.unsubscribe();\r\n this.validationErrorChangesSubs?.unsubscribe();\r\n this.dataChangesSubs=null;\r\n this.statusChangesSubs=null;\r\n this.isValidChangesSubs=null;\r\n this.validationErrorChangesSubs=null;\r\n }\r\n\r\n\r\n private getInputValue(inputKey:string){\r\n //TODO review if the value is meant to be a function and not a signal,\r\n //it might inadvertently be called!\r\n if(typeof this[inputKey]==\"function\"){\r\n return this[inputKey]();\r\n }\r\n return this[inputKey];\r\n }\r\n\r\n private resetScriptsAndStyleSheets() {\r\n document.querySelectorAll('.ajsf').forEach(element => element.remove());\r\n }\r\n private loadScripts(scriptList?:string[]) {\r\n const scripts = scriptList||this.frameworkLibrary.getFrameworkScripts();\r\n scripts.map(script => {\r\n const scriptTag: HTMLScriptElement = document.createElement('script');\r\n scriptTag.src = script;\r\n scriptTag.type = 'text/javascript';\r\n scriptTag.async = true;\r\n scriptTag.setAttribute('class', 'ajsf');\r\n document.getElementsByTagName('head')[0].appendChild(scriptTag);\r\n });\r\n }\r\n private loadStyleSheets(styleList?:string[]) {\r\n const stylesheets = styleList||this.frameworkLibrary.getFrameworkStylesheets();\r\n stylesheets.map(stylesheet => {\r\n const linkTag: HTMLLinkElement = document.createElement('link');\r\n linkTag.rel = 'stylesheet';\r\n linkTag.href = stylesheet;\r\n linkTag.setAttribute('class', 'ajsf');\r\n document.getElementsByTagName('head')[0].appendChild(linkTag);\r\n });\r\n }\r\n private loadAssets() {\r\n this.frameworkLibrary.getFrameworkAssetConfig().then(assetCfg=>{\r\n this.resetScriptsAndStyleSheets();\r\n this.loadScripts(assetCfg.scripts);\r\n this.loadStyleSheets(assetCfg.stylesheets);\r\n }).catch(err=>{\r\n console.log(err);\r\n this.resetScriptsAndStyleSheets();\r\n this.loadScripts();\r\n this.loadStyleSheets();\r\n })\r\n\r\n }\r\n ngOnInit() {\r\n this.updateForm();\r\n this.loadAssets();\r\n }\r\n\r\n ngOnChanges(changes: SimpleChanges) {\r\n this.updateForm();\r\n // Check if there's changes in Framework then load assets if that's the\r\n if (changes.framework) {\r\n if (!changes.framework.isFirstChange() &&\r\n (changes.framework.previousValue !== changes.framework.currentValue)) {\r\n this.loadAssets();\r\n }\r\n }\r\n }\r\n\r\n writeValue(value: any) {\r\n this.setFormValues(value, false);\r\n if (!this.formValuesInput) { this.formValuesInput = 'ngModel'; }\r\n }\r\n\r\n registerOnChange(fn: Function) {\r\n this.onChange = fn;\r\n }\r\n\r\n registerOnTouched(fn: Function) {\r\n this.onTouched = fn;\r\n }\r\n\r\n //see note\r\n //https://angular.io/guide/update-to-version-15#v15-bc-06\r\n setDisabledState(isDisabled: boolean) {\r\n if (this.jsf.formOptions.formDisabled !== !!isDisabled) {\r\n this.jsf.formOptions.formDisabled = !!isDisabled;\r\n this.initializeForm();\r\n }\r\n }\r\n\r\n updateForm() {\r\n let changedData;\r\n const language = this.language();\r\n if (!this.formInitialized || !this.formValuesInput ||\r\n (language && language !== this.jsf.language)\r\n \r\n ) {\r\n this.initializeForm();\r\n } else {\r\n if (language && language !== this.jsf.language) {\r\n this.jsf.setLanguage(language);\r\n }\r\n\r\n // Get names of changed inputs\r\n let changedInput = Object.keys(this.previousInputs)\r\n .filter(input => this.previousInputs[input] !== this.getInputValue(input));\r\n let resetFirst = true;\r\n if (changedInput.length === 1 && changedInput[0] === 'form' &&\r\n this.formValuesInput.startsWith('form.')\r\n ) {\r\n // If only 'form' input changed, get names of changed keys\r\n changedInput = Object.keys(this.previousInputs.form || {})\r\n .filter(key => !isEqual(this.previousInputs.form[key], this.form()[key]))\r\n .map(key => `form.${key}`);\r\n resetFirst = false;\r\n }\r\n\r\n // If only input values have changed, update the form values\r\n if (changedInput.length === 1 && changedInput[0] === this.formValuesInput) {\r\n if (this.formValuesInput.indexOf('.') === -1) {\r\n changedData=this.getInputValue(this.formValuesInput)\r\n //this[this.formValuesInput];\r\n this.setFormValues(changedData, resetFirst);\r\n } else {\r\n const [input, key] = this.formValuesInput.split('.');\r\n changedData=this.getInputValue(input)[key];\r\n this.setFormValues(changedData, resetFirst);\r\n }\r\n\r\n // If anything else has changed, re-render the entire form\r\n } else if (changedInput.length) {\r\n this.initializeForm(changedData);\r\n if (this.onChange) { this.onChange(this.jsf.formValues); }\r\n if (this.onTouched) { this.onTouched(this.jsf.formValues); }\r\n }\r\n \r\n //set framework theme\r\n const theme = this.theme();\r\n if (theme && theme !== this.frameworkLibrary.getActiveTheme()?.name) {\r\n this.frameworkLibrary.requestThemeChange(theme);\r\n }\r\n\r\n // Update previous inputs\r\n Object.keys(this.previousInputs)\r\n .filter(input => this.previousInputs[input] !== this.getInputValue(input))\r\n .forEach(input => this.previousInputs[input] = this.getInputValue(input));\r\n }\r\n }\r\n\r\n setFormValues(formValues: any, resetFirst = true) {\r\n if (formValues) {\r\n const newFormValues = this.objectWrap ? formValues['1'] : formValues;\r\n if (!this.jsf.formGroup) {\r\n this.jsf.formValues = formValues;\r\n this.activateForm();\r\n } else if (resetFirst) {//changed to avoid reset events\r\n this.jsf.formGroup.reset({},{emitEvent:false});\r\n }\r\n if (this.jsf.formGroup) {//changed to avoid reset events\r\n this.jsf.formGroup.patchValue(newFormValues,{emitEvent:false});\r\n }\r\n if (this.onChange) { this.onChange(newFormValues); }\r\n if (this.onTouched) { this.onTouched(newFormValues); }\r\n } else {\r\n this.jsf.formGroup.reset();\r\n }\r\n }\r\n\r\n submitForm() {\r\n const validData = this.jsf.validData;\r\n this.onSubmit.emit(this.objectWrap ? validData['1'] : validData);\r\n }\r\n\r\n /**\r\n * 'initializeForm' function\r\n *\r\n * - Update 'schema', 'layout', and 'formValues', from inputs.\r\n *\r\n * - Create 'schemaRefLibrary' and 'schemaRecursiveRefMap'\r\n * to resolve schema $ref links, including recursive $ref links.\r\n *\r\n * - Create 'dataRecursiveRefMap' to resolve recursive links in data\r\n * and corectly set output formats for recursively nested values.\r\n *\r\n * - Create 'layoutRefLibrary' and 'templateRefLibrary' to store\r\n * new layout nodes and formGroup elements to use when dynamically\r\n * adding form components to arrays and recursive $ref points.\r\n *\r\n * - Create 'dataMap' to map the data to the schema and template.\r\n *\r\n * - Create the master 'formGroupTemplate' then from it 'formGroup'\r\n * the Angular formGroup used to control the reactive form.\r\n */\r\n initializeForm(initialData?:any) {\r\n if (\r\n this.schema() || this.layout() || this.data() || this.form() || this.model() ||\r\n this.JSONSchema() || this.UISchema() || this.formData() || this.ngModel() ||\r\n this.jsf.data\r\n ) {\r\n // Reset all form values to defaults\r\n this.jsf.resetAllValues();\r\n this.initializeAjv();\r\n this.initializeOptions(); // Update options\r\n this.initializeSchema(); // Update schema, schemaRefLibrary,\r\n // schemaRecursiveRefMap, & dataRecursiveRefMap\r\n this.initializeLayout(); // Update layout, layoutRefLibrary,\r\n this.initializeData(); // Update formValues\r\n if(initialData){\r\n this.jsf.formValues=initialData;\r\n }\r\n this.activateForm(); // Update dataMap, templateRefLibrary,\r\n // formGroupTemplate, formGroup\r\n\r\n // Uncomment individual lines to output debugging information to console:\r\n // (These always work.)\r\n // console.log('loading form...');\r\n // console.log('schema', this.jsf.schema);\r\n // console.log('layout', this.jsf.layout);\r\n // console.log('options', this.options);\r\n // console.log('formValues', this.jsf.formValues);\r\n // console.log('formGroupTemplate', this.jsf.formGroupTemplate);\r\n // console.log('formGroup', this.jsf.formGroup);\r\n // console.log('formGroup.value', this.jsf.formGroup.value);\r\n // console.log('schemaRefLibrary', this.jsf.schemaRefLibrary);\r\n // console.log('layoutRefLibrary', this.jsf.layoutRefLibrary);\r\n // console.log('templateRefLibrary', this.jsf.templateRefLibrary);\r\n // console.log('dataMap', this.jsf.dataMap);\r\n // console.log('arrayMap', this.jsf.arrayMap);\r\n // console.log('schemaRecursiveRefMap', this.jsf.schemaRecursiveRefMap);\r\n // console.log('dataRecursiveRefMap', this.jsf.dataRecursiveRefMap);\r\n\r\n // Uncomment individual lines to output debugging information to browser:\r\n // (These only work if the 'debug' option has also been set to 'true'.)\r\n if (this.debug() || this.jsf.formOptions.debug) {\r\n const vars: any[] = [];\r\n // vars.push(this.jsf.schema);\r\n // vars.push(this.jsf.layout);\r\n // vars.push(this.options);\r\n // vars.push(this.jsf.formValues);\r\n // vars.push(this.jsf.formGroup.value);\r\n // vars.push(this.jsf.formGroupTemplate);\r\n // vars.push(this.jsf.formGroup);\r\n // vars.push(this.jsf.schemaRefLibrary);\r\n // vars.push(this.jsf.layoutRefLibrary);\r\n // vars.push(this.jsf.templateRefLibrary);\r\n // vars.push(this.jsf.dataMap);\r\n // vars.push(this.jsf.arrayMap);\r\n // vars.push(this.jsf.schemaRecursiveRefMap);\r\n // vars.push(this.jsf.dataRecursiveRefMap);\r\n this.debugOutput = vars.map(v => JSON.stringify(v, null, 2)).join('\\n');\r\n }\r\n this.formInitialized = true;\r\n }\r\n }\r\n\r\n /**\r\n * 'initializeAjv' function\r\n *\r\n * Initialize ajv from 'ajvOptions'\r\n */\r\n private initializeAjv() {\r\n const form = this.form();\r\n const ajvOptions=cloneDeep(this.ajvOptions())||\r\n (form && hasOwn(form, 'ajvOptions') && isObject(form.ajvOptions)\r\n &&cloneDeep(form.ajvOptions));\r\n if(ajvOptions){\r\n this.ajvInstanceName=this.jsf.createAndRegisterAjvInstance(ajvOptions).name;\r\n }\r\n }\r\n\r\n /**\r\n * 'initializeOptions' function\r\n *\r\n * Initialize 'options' (global form options) and set framework\r\n * Combine available inputs:\r\n * 1. options - recommended\r\n * 2. form.options - Single input style\r\n */\r\n private initializeOptions() {\r\n const language = this.language();\r\n if (language && language !== this.jsf.language) {\r\n this.jsf.setLanguage(language);\r\n }\r\n this.jsf.setOptions({ debug: !!this.debug() });\r\n let loadExternalAssets: boolean = this.loadExternalAssets() || false;\r\n let framework: any = this.framework() || 'default';\r\n const options = this.options();\r\n if (isObject(options)) {\r\n this.jsf.setOptions(options);\r\n loadExternalAssets = options.loadExternalAssets || loadExternalAssets;\r\n framework = options.framework || framework;\r\n }\r\n const form = this.form();\r\n if (isObject(form) && isObject(form.options)) {\r\n this.jsf.setOptions(form.options);\r\n loadExternalAssets = form.options.loadExternalAssets || loadExternalAssets;\r\n framework = form.options.framework || framework;\r\n }\r\n const widgets = this.widgets();\r\n if (isObject(widgets)) {\r\n this.jsf.setOptions({ widgets: widgets });\r\n }\r\n this.frameworkLibrary.setLoadExternalAssets(loadExternalAssets);\r\n this.frameworkLibrary.setFramework(framework);\r\n this.jsf.framework = this.frameworkLibrary.getFramework();\r\n if (isObject(this.jsf.formOptions.widgets)) {\r\n for (const widget of Object.keys(this.jsf.formOptions.widgets)) {\r\n this.widgetLibrary.registerWidget(widget, this.jsf.formOptions.widgets[widget]);\r\n }\r\n }\r\n if (isObject(form) && isObject(form.tpldata)) {\r\n this.jsf.setTpldata(form.tpldata);\r\n }\r\n const theme = this.theme();\r\n if (theme) {\r\n this.frameworkLibrary.requestThemeChange(theme);\r\n }\r\n }\r\n\r\n\r\n /**\r\n * 'initializeSchema' function\r\n *\r\n * Initialize 'schema'\r\n * Use first available input:\r\n * 1. schema - recommended / Angular Schema Form style\r\n * 2. form.schema - Single input / JSON Form style\r\n * 3. JSONSchema - React JSON Schema Form style\r\n * 4. form.JSONSchema - For testing single input React JSON Schema Forms\r\n * 5. form - For testing single schema-only inputs\r\n *\r\n * ... if no schema input found, the 'activateForm' function, below,\r\n * will make two additional attempts to build a schema\r\n * 6. If layout input - build schema from layout\r\n * 7. If data input - build schema from data\r\n */\r\n private initializeSchema() {\r\n\r\n // TODO: update to allow non-object schemas\r\n\r\n const form = this.form();\r\n const schema = this.schema();\r\n const JSONSchema = this.JSONSchema();\r\n if (isObject(schema)) {\r\n this.jsf.AngularSchemaFormCompatibility = true;\r\n this.jsf.schema = cloneDeep(schema);\r\n } else if (hasOwn(form, 'schema') && isObject(form.schema)) {\r\n this.jsf.schema = cloneDeep(form.schema);\r\n } else if (isObject(JSONSchema)) {\r\n this.jsf.ReactJsonSchemaFormCompatibility = true;\r\n this.jsf.schema = cloneDeep(JSONSchema);\r\n } else if (hasOwn(form, 'JSONSchema') && isObject(form.JSONSchema)) {\r\n this.jsf.ReactJsonSchemaFormCompatibility = true;\r\n this.jsf.schema = cloneDeep(form.JSONSchema);\r\n } else if (hasOwn(form, 'properties') && isObject(form.properties)) {\r\n this.jsf.schema = cloneDeep(form);\r\n } else if (isObject(form)) {\r\n // TODO: Handle other types of form input\r\n }\r\n\r\n if (!isEmpty(this.jsf.schema)) {\r\n\r\n // If other types also allowed, render schema as an object\r\n if (inArray('object', this.jsf.schema.type)) {\r\n this.jsf.schema.type = 'object';\r\n }\r\n\r\n // Wrap non-object schemas in object.\r\n if (hasOwn(this.jsf.schema, 'type') && this.jsf.schema.type !== 'object') {\r\n this.jsf.schema = {\r\n 'type': 'object',\r\n 'properties': { 1: this.jsf.schema }\r\n };\r\n this.objectWrap = true;\r\n } else if (!hasOwn(this.jsf.schema, 'type')) {\r\n\r\n // Add type = 'object' if missing\r\n if (isObject(this.jsf.schema.properties) ||\r\n isObject(this.jsf.schema.patternProperties) ||\r\n isObject(this.jsf.schema.additionalProperties)\r\n ) {\r\n this.jsf.schema.type = 'object';\r\n\r\n // Fix JSON schema shorthand (JSON Form style)\r\n } else {\r\n this.jsf.JsonFormCompatibility = true;\r\n this.jsf.schema = {\r\n 'type': 'object',\r\n 'properties': this.jsf.schema\r\n };\r\n }\r\n }\r\n\r\n // If needed, update JSON Schema to draft 6 format, including\r\n // draft 3 (JSON Form style) and draft 4 (Angular Schema Form style)\r\n this.jsf.schema = convertSchemaToDraft6(this.jsf.schema);\r\n\r\n // Initialize ajv and compile schema\r\n //this.jsf.compileAjvSchema();\r\n //moved to initializeAjv()\r\n\r\n // Create schemaRefLibrary, schemaRecursiveRefMap, dataRecursiveRefMap, & arrayMap\r\n this.jsf.schema = resolveSchemaReferences(\r\n this.jsf.schema, this.jsf.schemaRefLibrary, this.jsf.schemaRecursiveRefMap,\r\n this.jsf.dataRecursiveRefMap, this.jsf.arrayMap\r\n );\r\n if (hasOwn(this.jsf.schemaRefLibrary, '')) {\r\n this.jsf.hasRootReference = true;\r\n }\r\n\r\n // TODO: (?) Resolve external $ref links\r\n // // Create schemaRefLibrary & schemaRecursiveRefMap\r\n // this.parser.bundle(this.schema)\r\n // .then(schema => this.schema = resolveSchemaReferences(\r\n // schema, this.jsf.schemaRefLibrary,\r\n // this.jsf.schemaRecursiveRefMap, this.jsf.dataRecursiveRefMap\r\n // ));\r\n }\r\n }\r\n\r\n /**\r\n * 'initializeData' function\r\n *\r\n * Initialize 'formValues'\r\n * defulat or previously submitted values used to populate form\r\n * Use first available input:\r\n * 1. data - recommended\r\n * 2. model - Angular Schema Form style\r\n * 3. form.value - JSON Form style\r\n * 4. form.data - Single input style\r\n * 5. formData - React JSON Schema Form style\r\n * 6. form.formData - For easier testing of React JSON Schema Forms\r\n * 7. (none) no data - initialize data from schema and layout defaults only\r\n */\r\n private initializeData() {\r\n const form = this.form();\r\n const data = this.data();\r\n const model = this.model();\r\n const ngModel = this.ngModel();\r\n if (hasValue(data)) {\r\n this.jsf.formValues = cloneDeep(data);\r\n this.formValuesInput = 'data';\r\n } else if (hasValue(model)) {\r\n this.jsf.AngularSchemaFormCompatibility = true;\r\n this.jsf.formValues = cloneDeep(model);\r\n this.formValuesInput = 'model';\r\n } else if (hasValue(ngModel)) {\r\n this.jsf.AngularSchemaFormCompatibility = true;\r\n this.jsf.formValues = cloneDeep(ngModel);\r\n this.formValuesInput = 'ngModel';\r\n } else if (isObject(form) && hasValue(form.value)) {\r\n this.jsf.JsonFormCompatibility = true;\r\n this.jsf.formValues = cloneDeep(form.value);\r\n this.formValuesInput = 'form.value';\r\n } else if (isObject(form) && hasValue(form.data)) {\r\n this.jsf.formValues = cloneDeep(form.data);\r\n this.formValuesInput = 'form.data';\r\n } else if (hasValue(this.formData())) {\r\n this.jsf.ReactJsonSchemaFormCompatibility = true;\r\n this.formValuesInput = 'formData';\r\n } else if (hasOwn(form, 'formData') && hasValue(form.formData)) {\r\n this.jsf.ReactJsonSchemaFormCompatibility = true;\r\n this.jsf.formValues = cloneDeep(form.formData);\r\n this.formValuesInput = 'form.formData';\r\n } else {\r\n this.formValuesInput = \"data\";//null;\r\n }\r\n }\r\n\r\n /**\r\n * 'initializeLayout' function\r\n *\r\n * Initialize 'layout'\r\n * Use first available array input:\r\n * 1. layout - recommended\r\n * 2. form - Angular Schema Form style\r\n * 3. form.form - JSON Form style\r\n * 4. form.layout - Single input style\r\n * 5. (none) no layout - set default layout instead\r\n * (full layout will be built later from the schema)\r\n *\r\n * Also, if alternate layout formats are available,\r\n * import from 'UISchema' or 'customFormItems'\r\n * used for React JSON Schema Form and JSON Form API compatibility\r\n * Use first available input:\r\n * 1. UISchema - React JSON Schema Form style\r\n * 2. form.UISchema - For testing single input React JSON Schema Forms\r\n * 2. form.customFormItems - JSON Form style\r\n * 3. (none) no input - don't import\r\n */\r\n private initializeLayout() {\r\n\r\n // Rename JSON Form-style 'options' lists to\r\n // Angular Schema Form-style 'titleMap' lists.\r\n const fixJsonFormOptions = (layout: any): any => {\r\n if (isObject(layout) || isArray(layout)) {\r\n forEach(layout, (value, key) => {\r\n if (hasOwn(value, 'options') && isObject(value.options)) {\r\n value.titleMap = value.options;\r\n delete value.options;\r\n }\r\n }, 'top-down');\r\n }\r\n return layout;\r\n };\r\n\r\n // Check for layout inputs and, if found, initialize form layout\r\n const form = this.form();\r\n const layoutValue = this.layout();\r\n if (isArray(layoutValue)) {\r\n this.jsf.layout = cloneDeep(layoutValue);\r\n } else if (isArray(form)) {\r\n this.jsf.AngularSchemaFormCompatibility = true;\r\n this.jsf.layout = cloneDeep(form);\r\n } else if (form && isArray(form.form)) {\r\n this.jsf.JsonFormCompatibility = true;\r\n this.jsf.layout = fixJsonFormOptions(cloneDeep(form.form));\r\n } else if (form && isArray(form.layout)) {\r\n this.jsf.layout = cloneDeep(form.layout);\r\n } else {\r\n this.jsf.layout = ['*'];\r\n }\r\n\r\n // Check for alternate layout inputs\r\n let alternateLayout: any = null;\r\n const formValue = this.form();\r\n const UISchema = this.UISchema();\r\n if (isObject(UISchema)) {\r\n this.jsf.ReactJsonSchemaFormCompatibility = true;\r\n alternateLayout = cloneDeep(UISchema);\r\n } else if (hasOwn(formValue, 'UISchema')) {\r\n this.jsf.ReactJsonSchemaFormCompatibility = true;\r\n alternateLayout = cloneDeep(formValue.UISchema);\r\n } else if (hasOwn(formValue, 'uiSchema')) {\r\n this.jsf.ReactJsonSchemaFormCompatibility = true;\r\n alternateLayout = cloneDeep(formValue.uiSchema);\r\n } else if (hasOwn(formValue, 'customFormItems')) {\r\n this.jsf.JsonFormCompatibility = true;\r\n alternateLayout = fixJsonFormOptions(cloneDeep(formValue.customFormItems));\r\n }\r\n\r\n // if alternate layout found, copy alternate layout options into schema\r\n if (alternateLayout) {\r\n JsonPointer.forEachDeep(alternateLayout, (value, pointer) => {\r\n const schemaPointer = pointer\r\n .replace(/\\//g, '/properties/')\r\n .replace(/\\/properties\\/items\\/properties\\//g, '/items/properties/')\r\n .replace(/\\/properties\\/titleMap\\/properties\\//g, '/titleMap/properties/');\r\n if (hasValue(value) && hasValue(pointer)) {\r\n let key = JsonPointer.toKey(pointer);\r\n const groupPointer = (JsonPointer.parse(schemaPointer) || []).slice(0, -2);\r\n let itemPointer: string | string[];\r\n\r\n // If 'ui:order' object found, copy into object schema root\r\n if (key.toLowerCase() === 'ui:order') {\r\n itemPointer = [...groupPointer, 'ui:order'];\r\n\r\n // Copy other alternate layout options to schema 'x-schema-form',\r\n // (like Angular Schema Form options) and remove any 'ui:' prefixes\r\n } else {\r\n if (key.slice(0, 3).toLowerCase() === 'ui:') { key = key.slice(3); }\r\n itemPointer = [...groupPointer, 'x-schema-form', key];\r\n }\r\n if (JsonPointer.has(this.jsf.schema, groupPointer) &&\r\n !JsonPointer.has(this.jsf.schema, itemPointer)\r\n ) {\r\n JsonPointer.set(this.jsf.schema, itemPointer, value);\r\n }\r\n }\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * 'activateForm' function\r\n *\r\n * ...continued from 'initializeSchema' function, above\r\n * If 'schema' has not been initialized (i.e. no schema input found)\r\n * 6. If layout input - build schema from layout input\r\n * 7. If data input - build schema from data input\r\n *\r\n * Create final layout,\r\n * build the FormGroup template and the Angular FormGroup,\r\n * subscribe to changes,\r\n * and activate the form.\r\n */\r\n private activateForm() {\r\n this.unsubscribeOnActivateForm$.next();\r\n // If 'schema' not initialized\r\n if (isEmpty(this.jsf.schema)) {\r\n\r\n // TODO: If full layout input (with no '*'), build schema from layout\r\n // if (!this.jsf.layout.includes('*')) {\r\n // this.jsf.buildSchemaFromLayout();\r\n // } else\r\n\r\n // If data input, build schema from data\r\n if (!isEmpty(this.jsf.formValues)) {\r\n this.jsf.buildSchemaFromData();\r\n }\r\n }\r\n\r\n if (!isEmpty(this.jsf.schema)) {\r\n\r\n // If not already initialized, initialize ajv and compile schema\r\n //this.jsf.compileAjvSchema();\r\n //moved to initializeAjv()\r\n\r\n // Update all layout elements, add values, widgets, and validators,\r\n // replace any '*' with a layout built from all schema elements,\r\n // and update the FormGroup template with any new validators\r\n this.jsf.buildLayout(this.widgetLibrary);\r\n\r\n // Build the Angular FormGroup template from the schema\r\n this.jsf.buildFormGroupTemplate(this.jsf.formValues);\r\n\r\n // Build the real Angular FormGroup from the FormGroup template\r\n this.jsf.buildFormGroup(this.ajvInstanceName);\r\n }\r\n\r\n if (this.jsf.formGroup) {\r\n\r\n // Reset initial form values\r\n if (!isEmpty(this.jsf.formValues) &&\r\n this.jsf.formOptions.setSchemaDefaults !== true &&\r\n this.jsf.formOptions.setLayoutDefaults !== true\r\n ) {\r\n this.setFormValues(this.jsf.formValues);\r\n }\r\n\r\n // TODO: Figure out how to display calculated values without changing object data\r\n // See http://ulion.github.io/jsonform/playground/?example=templating-values\r\n // Calculate references to other fields\r\n // if (!isEmpty(this.jsf.formGroup.value)) {\r\n // forEach(this.jsf.formGroup.value, (value, key, object, rootObject) => {\r\n // if (typeof value === 'string') {\r\n // object[key] = this.jsf.parseText(value, value, rootObject, key);\r\n // }\r\n // }, 'top-down');\r\n // }\r\n\r\n // Subscribe to form changes to output live data, validation, and errors\r\n this.dataChangesSubs=this.jsf.dataChanges.pipe(takeUntil(this.unsubscribeOnActivateForm$)).subscribe(data => {\r\n this.onChanges.emit(this.objectWrap ? data['1'] : data);\r\n if (this.formValuesInput && this.formValuesInput.indexOf('.') === -1) {\r\n this[`${this.formValuesInput}Change`].emit(this.objectWrap ? data['1'] : data);\r\n }\r\n });\r\n\r\n // Trigger change detection on statusChanges to show updated errors\r\n this.statusChangesSubs= this.jsf.formGroup.statusChanges.pipe(takeUntil(this.unsubscribeOnActivateForm$)).subscribe(() => this.changeDetector.markForCheck());\r\n this.isValidChangesSubs=this.jsf.isValidChanges.pipe(takeUntil(this.unsubscribeOnActivateForm$)).subscribe(isValid => this.isValid.emit(isValid));\r\n this.validationErrorChangesSubs=this.jsf.validationErrorChanges.pipe(takeUntil(this.unsubscribeOnActivateForm$)).subscribe(err => this.validationErrors.emit(err));\r\n\r\n // Output final schema, final layout, and initial data\r\n this.formSchema.emit(this.jsf.schema);\r\n this.formLayout.emit(this.jsf.layout);\r\n this.onChanges.emit(this.objectWrap ? this.jsf.data['1'] : this.jsf.data);\r\n\r\n // If validateOnRender, output initial validation and any errors\r\n const validateOnRender =\r\n JsonPointer.get(this.jsf, '/formOptions/validateOnRender');\r\n if (validateOnRender) { // validateOnRender === 'auto' || true\r\n const touchAll = (control) => {\r\n if (validateOnRender === true || hasValue(control.value)) {\r\n control.markAsTouched();\r\n }\r\n Object.keys(control.controls || {})\r\n .forEach(key => touchAll(control.controls[key]));\r\n };\r\n touchAll(this.jsf.formGroup);\r\n this.isValid.emit(this.jsf.isValid);\r\n this.validationErrors.emit(this.jsf.ajvErrors);\r\n }\r\n }\r\n }\r\n\r\n}\r\n","<form [autocomplete]=\"jsf?.formOptions?.autocomplete ? 'on' : 'off'\" class=\"json-schema-form\" (ngSubmit)=\"submitForm()\">\r\n <root-widget [layout]=\"jsf?.layout\"></root-widget>\r\n</form>\r\n<div *ngIf=\"debug() || jsf?.formOptions?.debug\">\r\n Debug output:\r\n <pre>{{debugOutput}}</pre>\r\n</div>","import { CommonModule } from '@angular/common';\r\nimport { NgModule } from '@angular/core';\r\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\r\nimport { NoFrameworkModule } from './framework-library/no-framework.module';\r\nimport { JsonSchemaFormComponent } from './json-schema-form.component';\r\nimport { WidgetLibraryModule } from './widget-library/widget-library.module';\r\n\r\n@NgModule({\r\n imports: [\r\n CommonModule, FormsModule, ReactiveFormsModule,\r\n WidgetLibraryModule, NoFrameworkModule\r\n ],\r\n declarations: [JsonSchemaFormComponent],\r\n exports: [JsonSchemaFormComponent, WidgetLibraryModule]\r\n})\r\nexport class JsonSchemaFormModule {\r\n}\r\n","/*\r\n * Public API Surface of json-schema-form\r\n */\r\n\r\nexport { JsonSchemaFormModule } from './lib/json-schema-form.module';\r\nexport { TitleMapItem, ErrorMessages, JsonSchemaFormService } from './lib/json-schema-form.service';\r\nexport { JsonSchemaFormComponent } from './lib/json-schema-form.component';\r\nexport { Framework } from './lib/framework-library/framework';\r\nexport { FrameworkLibraryService } from './lib/framework-library/framework-library.service';\r\nexport {\r\n deValidationMessages,\r\n enValidationMessages,\r\n esValidationMessages,\r\n frValidationMessages,\r\n itValidationMessages,\r\n ptValidationMessages,\r\n zhValidationMessages\r\n } from './lib/locale';\r\nexport * from './lib/widget-library';\r\nexport * from './lib/widget-library/widget-library.module';\r\nexport * from './lib/shared';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["isEqual","isEmpty","map","_isEqual","i1.SelectWidgetComponent","i2.StopPropagationDirective","i3.ElementAttributeDirective","i4.StopPropagationDirective","i3.SelectFrameworkComponent","isObject","i1.TabsComponent","i2","i2.RootComponent","i1.StopPropagationDirective","i1.RootComponent","i1.AddReferenceComponent","i2.OneOfComponent","i3.ButtonComponent","i4.CheckboxComponent","i5.CheckboxesComponent","i6.FileComponent","i7.HiddenComponent","i8.InputComponent","i9.MessageComponent","i10.NoneComponent","i11.NumberComponent","i12.RadiosComponent","i13.RootComponent","i14.SectionComponent","i15.SelectComponent","i16.SelectFrameworkComponent","i17.SelectWidgetComponent","i18.SubmitComponent","i19.TabComponent","i20.TabsComponent","i21.TemplateComponent","i22.TextareaComponent","i23.SelectCheckboxComponent","i3.RootComponent"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;MAGa,SAAS,CAAA;AADtB,IAAA,WAAA,GAAA;QAKE,IAAA,CAAA,OAAO,GAA4B,EAAE;QACrC,IAAA,CAAA,WAAW,GAAc,EAAE;QAC3B,IAAA,CAAA,OAAO,GAAc,EAAE;AACxB;8GAPY,SAAS,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAAT,SAAS,EAAA,CAAA,CAAA;;2FAAT,SAAS,EAAA,UAAA,EAAA,CAAA;kBADrB;;;ACFM,MAAM,oBAAoB,GAAQ;AACvC,IAAA,QAAQ,EAAE,sBAAsB;AAChC,IAAA,SAAS,EAAE,4EAA4E;AACvF,IAAA,SAAS,EAAE,wEAAwE;AACnF,IAAA,OAAO,EAAE,iEAAiE;IAC1E,MAAM,EAAE,UAAU,KAAK,EAAA;AACrB,QAAA,QAAQ,KAAK,CAAC,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AO,EAAE,CAAC,uBAAuB,EAAE,mBAAmB;AACvD,iBAAA;;;ACdD;;AAEG;;ACFH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ng-formworks-core.mjs","sources":["../../../../projects/ng-formworks-core/src/lib/framework-library/framework.ts","../../../../projects/ng-formworks-core/src/lib/locale/de-validation-messages.ts","../../../../projects/ng-formworks-core/src/lib/locale/en-validation-messages.ts","../../../../projects/ng-formworks-core/src/lib/locale/es-validation-messages.ts","../../../../projects/ng-formworks-core/src/lib/locale/fr-validation-messages.ts","../../../../projects/ng-formworks-core/src/lib/locale/it-validation-messages.ts","../../../../projects/ng-formworks-core/src/lib/locale/pt-validation-messages.ts","../../../../projects/ng-formworks-core/src/lib/locale/zh-validation-messages.ts","../../../../projects/ng-formworks-core/src/lib/shared/validator.functions.ts","../../../../projects/ng-formworks-core/src/lib/shared/utility.functions.ts","../../../../projects/ng-formworks-core/src/lib/shared/jsonpointer.functions.ts","../../../../projects/ng-formworks-core/src/lib/shared/format-regex.constants.ts","../../../../projects/ng-formworks-core/src/lib/shared/json.validators.ts","../../../../projects/ng-formworks-core/src/lib/shared/merge-schemas.function.ts","../../../../projects/ng-formworks-core/src/lib/shared/json-schema.functions.ts","../../../../projects/ng-formworks-core/src/lib/shared/convert-schema-to-draft6.function.ts","../../../../projects/ng-formworks-core/src/lib/shared/form-group.functions.ts","../../../../projects/ng-formworks-core/src/lib/shared/layout.functions.ts","../../../../projects/ng-formworks-core/src/lib/shared/index.ts","../../../../projects/ng-formworks-core/src/lib/json-schema-form.service.ts","../../../../projects/ng-formworks-core/src/lib/widget-library/select-widget.component.ts","../../../../projects/ng-formworks-core/src/lib/framework-library/no-framework.component.ts","../../../../projects/ng-formworks-core/src/lib/framework-library/no-framework.component.html","../../../../projects/ng-formworks-core/src/lib/framework-library/no.framework.ts","../../../../projects/ng-formworks-core/src/lib/widget-library/element-attribute.directive.ts","../../../../projects/ng-formworks-core/src/lib/widget-library/stop-propagation.directive.ts","../../../../projects/ng-formworks-core/src/lib/widget-library/add-reference.component.ts","../../../../projects/ng-formworks-core/src/lib/widget-library/button.component.ts","../../../../projects/ng-formworks-core/src/lib/widget-library/checkbox.component.ts","../../../../projects/ng-formworks-core/src/lib/widget-library/checkboxes.component.ts","../../../../projects/ng-formworks-core/src/lib/widget-library/file.component.ts","../../../../projects/ng-formworks-core/src/lib/widget-library/hidden.component.ts","../../../../projects/ng-formworks-core/src/lib/widget-library/input.component.ts","../../../../projects/ng-formworks-core/src/lib/widget-library/item-title.component.ts","../../../../projects/ng-formworks-core/src/lib/widget-library/message.component.ts","../../../../projects/ng-formworks-core/src/lib/widget-library/none.component.ts","../../../../projects/ng-formworks-core/src/lib/widget-library/number.component.ts","../../../../projects/ng-formworks-core/src/lib/widget-library/select-framework.component.ts","../../../../projects/ng-formworks-core/src/lib/widget-library/tabs.component.ts","../../../../projects/ng-formworks-core/src/lib/widget-library/one-of.component.ts","../../../../projects/ng-formworks-core/src/lib/widget-library/radios.component.ts","../../../../projects/ng-formworks-core/src/lib/widget-library/root.component.ts","../../../../projects/ng-formworks-core/src/lib/widget-library/section.component.ts","../../../../projects/ng-formworks-core/src/lib/widget-library/select.component.ts","../../../../projects/ng-formworks-core/src/lib/widget-library/submit.component.ts","../../../../projects/ng-formworks-core/src/lib/widget-library/template.component.ts","../../../../projects/ng-formworks-core/src/lib/widget-library/textarea.component.ts","../../../../projects/ng-formworks-core/src/lib/widget-library/widget-library.service.ts","../../../../projects/ng-formworks-core/src/lib/framework-library/framework-library.service.ts","../../../../projects/ng-formworks-core/src/lib/widget-library/selectcheckbox.component.ts","../../../../projects/ng-formworks-core/src/lib/widget-library/tab.component.ts","../../../../projects/ng-formworks-core/src/lib/widget-library/orderable.directive.ts","../../../../projects/ng-formworks-core/src/lib/widget-library/index.ts","../../../../projects/ng-formworks-core/src/lib/widget-library/widget-library.module.ts","../../../../projects/ng-formworks-core/src/lib/framework-library/no-framework.module.ts","../../../../projects/ng-formworks-core/src/lib/json-schema-form.component.ts","../../../../projects/ng-formworks-core/src/lib/json-schema-form.component.html","../../../../projects/ng-formworks-core/src/lib/json-schema-form.module.ts","../../../../projects/ng-formworks-core/src/public_api.ts","../../../../projects/ng-formworks-core/src/ng-formworks-core.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\r\n\r\n@Injectable()\r\nexport class Framework {\r\n name: string;\r\n text:string;\r\n framework: any;\r\n widgets?: { [key: string]: any } = {};\r\n stylesheets?: string[] = [];\r\n scripts?: string[] = [];\r\n}\r\n","export const deValidationMessages: any = { // Default German error messages\r\n required: 'Darf nicht leer sein',\r\n minLength: 'Mindestens {{minimumLength}} Zeichen benötigt (aktuell: {{currentLength}})',\r\n maxLength: 'Maximal {{maximumLength}} Zeichen erlaubt (aktuell: {{currentLength}})',\r\n pattern: 'Entspricht nicht diesem regulären Ausdruck: {{requiredPattern}}',\r\n format: function (error) {\r\n switch (error.requiredFormat) {\r\n case 'date':\r\n return 'Muss ein Datum sein, z. B. \"2000-12-31\"';\r\n case 'time':\r\n return 'Muss eine Zeitangabe sein, z. B. \"16:20\" oder \"03:14:15.9265\"';\r\n case 'date-time':\r\n return 'Muss Datum mit Zeit beinhalten, z. B. \"2000-03-14T01:59\" oder \"2000-03-14T01:59:26.535Z\"';\r\n case 'email':\r\n return 'Keine gültige E-Mail-Adresse (z. B. \"name@example.com\")';\r\n case 'hostname':\r\n return 'Kein gültiger Hostname (z. B. \"example.com\")';\r\n case 'ipv4':\r\n return 'Keine gültige IPv4-Adresse (z. B. \"127.0.0.1\")';\r\n case 'ipv6':\r\n return 'Keine gültige IPv6-Adresse (z. B. \"1234:5678:9ABC:DEF0:1234:5678:9ABC:DEF0\")';\r\n // TODO: add examples for 'uri', 'uri-reference', and 'uri-template'\r\n // case 'uri': case 'uri-reference': case 'uri-template':\r\n case 'url':\r\n return 'Keine gültige URL (z. B. \"http://www.example.com/page.html\")';\r\n case 'uuid':\r\n return 'Keine gültige UUID (z. B. \"12345678-9ABC-DEF0-1234-56789ABCDEF0\")';\r\n case 'color':\r\n return 'Kein gültiger Farbwert (z. B. \"#FFFFFF\")';\r\n case 'json-pointer':\r\n return 'Kein gültiger JSON-Pointer (z. B. \"/pointer/to/something\")';\r\n case 'relative-json-pointer':\r\n return 'Kein gültiger relativer JSON-Pointer (z. B. \"2/pointer/to/something\")';\r\n case 'regex':\r\n return 'Kein gültiger regulärer Ausdruck (z. B. \"(1-)?\\\\d{3}-\\\\d{3}-\\\\d{4}\")';\r\n case 'duration':\r\n return \"Muss eine gültige ISO 8601-Dauer sein (z. B. 'PT1H30M')\"; \r\n default:\r\n return 'Muss diesem Format entsprechen: ' + error.requiredFormat;\r\n }\r\n },\r\n minimum: 'Muss mindestens {{minimumValue}} sein',\r\n exclusiveMinimum: 'Muss größer als {{exclusiveMinimumValue}} sein',\r\n maximum: 'Darf maximal {{maximumValue}} sein',\r\n exclusiveMaximum: 'Muss kleiner als {{exclusiveMaximumValue}} sein',\r\n multipleOf: function (error) {\r\n if ((1 / error.multipleOfValue) % 10 === 0) {\r\n const decimals = Math.log10(1 / error.multipleOfValue);\r\n return `Maximal ${decimals} Dezimalstellen erlaubt`;\r\n } else {\r\n return `Muss ein Vielfaches von ${error.multipleOfValue} sein`;\r\n }\r\n },\r\n minProperties: 'Mindestens {{minimumProperties}} Attribute erforderlich (aktuell: {{currentProperties}})',\r\n maxProperties: 'Maximal {{maximumProperties}} Attribute erlaubt (aktuell: {{currentProperties}})',\r\n minItems: 'Mindestens {{minimumItems}} Werte erforderlich (aktuell: {{currentItems}})',\r\n maxItems: 'Maximal {{maximumItems}} Werte erlaubt (aktuell: {{currentItems}})',\r\n uniqueItems: 'Alle Werte müssen eindeutig sein',\r\n // Note: No default error messages for 'type', 'const', 'enum', or 'dependencies'\r\n};\r\n","export const enValidationMessages: any = { // Default English error messages\r\n required: 'This field is required.',\r\n minLength: 'Must be {{minimumLength}} characters or longer (current length: {{currentLength}})',\r\n maxLength: 'Must be {{maximumLength}} characters or shorter (current length: {{currentLength}})',\r\n pattern: 'Must match pattern: {{requiredPattern}}',\r\n format: function (error) {\r\n switch (error.requiredFormat) {\r\n case 'date':\r\n return 'Must be a date, like \"2000-12-31\"';\r\n case 'time':\r\n return 'Must be a time, like \"16:20\" or \"03:14:15.9265\"';\r\n case 'date-time':\r\n return 'Must be a date-time, like \"2000-03-14T01:59\" or \"2000-03-14T01:59:26.535Z\"';\r\n case 'email':\r\n return 'Must be an email address, like \"name@example.com\"';\r\n case 'hostname':\r\n return 'Must be a hostname, like \"example.com\"';\r\n case 'ipv4':\r\n return 'Must be an IPv4 address, like \"127.0.0.1\"';\r\n case 'ipv6':\r\n return 'Must be an IPv6 address, like \"1234:5678:9ABC:DEF0:1234:5678:9ABC:DEF0\"';\r\n // TODO: add examples for 'uri', 'uri-reference', and 'uri-template'\r\n // case 'uri': case 'uri-reference': case 'uri-template':\r\n case 'url':\r\n return 'Must be a url, like \"http://www.example.com/page.html\"';\r\n case 'uuid':\r\n return 'Must be a uuid, like \"12345678-9ABC-DEF0-1234-56789ABCDEF0\"';\r\n case 'color':\r\n return 'Must be a color, like \"#FFFFFF\"';\r\n case 'json-pointer':\r\n return 'Must be a JSON Pointer, like \"/pointer/to/something\"';\r\n case 'relative-json-pointer':\r\n return 'Must be a relative JSON Pointer, like \"2/pointer/to/something\"';\r\n case 'regex':\r\n return 'Must be a regular expression, like \"(1-)?\\\\d{3}-\\\\d{3}-\\\\d{4}\"';\r\n case 'duration':\r\n return \"Must be a valid ISO 8601 duration (e.g., 'PT1H30M')\";\r\n default:\r\n return 'Must be a correctly formatted ' + error.requiredFormat;\r\n }\r\n },\r\n minimum: 'Must be {{minimumValue}} or more',\r\n exclusiveMinimum: 'Must be more than {{exclusiveMinimumValue}}',\r\n maximum: 'Must be {{maximumValue}} or less',\r\n exclusiveMaximum: 'Must be less than {{exclusiveMaximumValue}}',\r\n multipleOf: function (error) {\r\n if ((1 / error.multipleOfValue) % 10 === 0) {\r\n const decimals = Math.log10(1 / error.multipleOfValue);\r\n return `Must have ${decimals} or fewer decimal places.`;\r\n } else {\r\n return `Must be a multiple of ${error.multipleOfValue}.`;\r\n }\r\n },\r\n minProperties: 'Must have {{minimumProperties}} or more items (current items: {{currentProperties}})',\r\n maxProperties: 'Must have {{maximumProperties}} or fewer items (current items: {{currentProperties}})',\r\n minItems: 'Must have {{minimumItems}} or more items (current items: {{currentItems}})',\r\n maxItems: 'Must have {{maximumItems}} or fewer items (current items: {{currentItems}})',\r\n uniqueItems: 'All items must be unique',\r\n // Note: No default error messages for 'type', 'const', 'enum', or 'dependencies'\r\n};\r\n","export const esValidationMessages: any = { // Default Spanish error messages\r\n required: 'Este campo está requerido.',\r\n minLength: 'Debe tener {{minimumLength}} caracteres o más longitud (longitud actual: {{currentLength}})',\r\n maxLength: 'Debe tener {{maximumLength}} caracteres o menos longitud (longitud actual: {{currentLength}})',\r\n pattern: 'Must match pattern: {{requiredPattern}}',\r\n format: function (error) {\r\n switch (error.requiredFormat) {\r\n case 'date':\r\n return 'Debe tener una fecha, ej \"2000-12-31\"';\r\n case 'time':\r\n return 'Debe tener una hora, ej \"16:20\" o \"03:14:15.9265\"';\r\n case 'date-time':\r\n return 'Debe tener fecha y hora, ej \"2000-03-14T01:59\" o \"2000-03-14T01:59:26.535Z\"';\r\n case 'email':\r\n return 'No hay dirección de correo electrónico válida, ej \"name@example.com\"';\r\n case 'hostname':\r\n return 'Debe ser un nombre de host válido, ej \"example.com\"';\r\n case 'ipv4':\r\n return 'Debe ser una dirección de IPv4, ej \"127.0.0.1\"';\r\n case 'ipv6':\r\n return 'Debe ser una dirección de IPv6, ej \"1234:5678:9ABC:DEF0:1234:5678:9ABC:DEF0\"';\r\n case 'url':\r\n return 'Debe ser una URL, ej \"http://www.example.com/page.html\"';\r\n case 'uuid':\r\n return 'Debe ser un UUID, ej \"12345678-9ABC-DEF0-1234-56789ABCDEF0\"';\r\n case 'color':\r\n return 'Debe ser un color, ej \"#FFFFFF\"';\r\n case 'json-pointer':\r\n return 'Debe ser un JSON Pointer, ej \"/pointer/to/something\"';\r\n case 'relative-json-pointer':\r\n return 'Debe ser un JSON Pointer relativo, ej \"2/pointer/to/something\"';\r\n case 'regex':\r\n return 'Debe ser una expresión regular, ej \"(1-)?\\\\d{3}-\\\\d{3}-\\\\d{4}\"';\r\n case 'duration':\r\n return \"Debe ser una duración válida en formato ISO 8601 (p. ej., 'PT1H30M')\"; \r\n default:\r\n return 'Debe tener el formato correcto ' + error.requiredFormat;\r\n }\r\n },\r\n minimum: 'Debe ser {{minimumValue}} o más',\r\n exclusiveMinimum: 'Debe ser superior a {{exclusiveMinimumValue}}',\r\n maximum: 'Debe ser {{maximumValue}} o menos',\r\n exclusiveMaximum: 'Debe ser menor que {{exclusiveMaximumValue}}',\r\n multipleOf: function (error) {\r\n if ((1 / error.multipleOfValue) % 10 === 0) {\r\n const decimals = Math.log10(1 / error.multipleOfValue);\r\n return `Se permite un máximo de ${decimals} decimales`;\r\n } else {\r\n return `Debe ser múltiplo de ${error.multipleOfValue}.`;\r\n }\r\n },\r\n minProperties: 'Debe tener {{minimumProperties}} o más elementos (elementos actuales: {{currentProperties}})',\r\n maxProperties: 'Debe tener {{maximumProperties}} o menos elementos (elementos actuales: {{currentProperties}})',\r\n minItems: 'Debe tener {{minimumItems}} o más elementos (elementos actuales: {{currentItems}})',\r\n maxItems: 'Debe tener {{maximumItems}} o menos elementos (elementos actuales: {{currentItems}})',\r\n uniqueItems: 'Todos los elementos deben ser únicos',\r\n};\r\n","export const frValidationMessages: any = { // French error messages\r\n required: 'Est obligatoire.',\r\n minLength: 'Doit avoir minimum {{minimumLength}} caractères (actuellement: {{currentLength}})',\r\n maxLength: 'Doit avoir maximum {{maximumLength}} caractères (actuellement: {{currentLength}})',\r\n pattern: 'Doit respecter: {{requiredPattern}}',\r\n format: function (error) {\r\n switch (error.requiredFormat) {\r\n case 'date':\r\n return 'Doit être une date, tel que \"2000-12-31\"';\r\n case 'time':\r\n return 'Doit être une heure, tel que \"16:20\" ou \"03:14:15.9265\"';\r\n case 'date-time':\r\n return 'Doit être une date et une heure, tel que \"2000-03-14T01:59\" ou \"2000-03-14T01:59:26.535Z\"';\r\n case 'email':\r\n return 'Doit être une adresse e-mail, tel que \"name@example.com\"';\r\n case 'hostname':\r\n return 'Doit être un nom de domaine, tel que \"example.com\"';\r\n case 'ipv4':\r\n return 'Doit être une adresse IPv4, tel que \"127.0.0.1\"';\r\n case 'ipv6':\r\n return 'Doit être une adresse IPv6, tel que \"1234:5678:9ABC:DEF0:1234:5678:9ABC:DEF0\"';\r\n // TODO: add examples for 'uri', 'uri-reference', and 'uri-template'\r\n // case 'uri': case 'uri-reference': case 'uri-template':\r\n case 'url':\r\n return 'Doit être une URL, tel que \"http://www.example.com/page.html\"';\r\n case 'uuid':\r\n return 'Doit être un UUID, tel que \"12345678-9ABC-DEF0-1234-56789ABCDEF0\"';\r\n case 'color':\r\n return 'Doit être une couleur, tel que \"#FFFFFF\"';\r\n case 'json-pointer':\r\n return 'Doit être un JSON Pointer, tel que \"/pointer/to/something\"';\r\n case 'relative-json-pointer':\r\n return 'Doit être un relative JSON Pointer, tel que \"2/pointer/to/something\"';\r\n case 'regex':\r\n return 'Doit être une expression régulière, tel que \"(1-)?\\\\d{3}-\\\\d{3}-\\\\d{4}\"';\r\n case 'duration':\r\n return \"Doit être une durée valide au format ISO 8601 (par ex., 'PT1H30M')\";\r\n default:\r\n return 'Doit être avoir le format correct: ' + error.requiredFormat;\r\n }\r\n },\r\n minimum: 'Doit être supérieur à {{minimumValue}}',\r\n exclusiveMinimum: 'Doit avoir minimum {{exclusiveMinimumValue}} charactères',\r\n maximum: 'Doit être inférieur à {{maximumValue}}',\r\n exclusiveMaximum: 'Doit avoir maximum {{exclusiveMaximumValue}} charactères',\r\n multipleOf: function (error) {\r\n if ((1 / error.multipleOfValue) % 10 === 0) {\r\n const decimals = Math.log10(1 / error.multipleOfValue);\r\n return `Doit comporter ${decimals} ou moins de decimales.`;\r\n } else {\r\n return `Doit être un multiple de ${error.multipleOfValue}.`;\r\n }\r\n },\r\n minProperties: 'Doit comporter au minimum {{minimumProperties}} éléments',\r\n maxProperties: 'Doit comporter au maximum {{maximumProperties}} éléments',\r\n minItems: 'Doit comporter au minimum {{minimumItems}} éléments',\r\n maxItems: 'Doit comporter au maximum {{minimumItems}} éléments',\r\n uniqueItems: 'Tous les éléments doivent être uniques',\r\n // Note: No default error messages for 'type', 'const', 'enum', or 'dependencies'\r\n};\r\n","export const itValidationMessages: any = { // Default Italian error messages\r\n required: 'Il campo è obbligatorio',\r\n minLength: 'Deve inserire almeno {{minimumLength}} caratteri (lunghezza corrente: {{currentLength}})',\r\n maxLength: 'Il numero massimo di caratteri consentito è {{maximumLength}} (lunghezza corrente: {{currentLength}})',\r\n pattern: 'Devi rispettare il pattern : {{requiredPattern}}',\r\n format: function (error) {\r\n switch (error.requiredFormat) {\r\n case 'date':\r\n return 'Deve essere una data, come \"31-12-2000\"';\r\n case 'time':\r\n return 'Deve essere un orario, come \"16:20\" o \"03:14:15.9265\"';\r\n case 'date-time':\r\n return 'Deve essere data-orario, come \"14-03-2000T01:59\" or \"14-03-2000T01:59:26.535Z\"';\r\n case 'email':\r\n return 'Deve essere un indirzzo email, come \"name@example.com\"';\r\n case 'hostname':\r\n return 'Deve essere un hostname, come \"example.com\"';\r\n case 'ipv4':\r\n return 'Deve essere un indirizzo IPv4, come \"127.0.0.1\"';\r\n case 'ipv6':\r\n return 'Deve essere un indirizzo IPv6, come \"1234:5678:9ABC:DEF0:1234:5678:9ABC:DEF0\"';\r\n // TODO: add examples for 'uri', 'uri-reference', and 'uri-template'\r\n // case 'uri': case 'uri-reference': case 'uri-template':\r\n case 'url':\r\n return 'Deve essere un url, come \"http://www.example.com/page.html\"';\r\n case 'uuid':\r\n return 'Deve essere un uuid, come \"12345678-9ABC-DEF0-1234-56789ABCDEF0\"';\r\n case 'color':\r\n return 'Deve essere un colore, come \"#FFFFFF\"';\r\n case 'json-pointer':\r\n return 'Deve essere un JSON Pointer, come \"/pointer/to/something\"';\r\n case 'relative-json-pointer':\r\n return 'Deve essere un JSON Pointer relativo, come \"2/pointer/to/something\"';\r\n case 'regex':\r\n return 'Deve essere una regular expression, come \"(1-)?\\\\d{3}-\\\\d{3}-\\\\d{4}\"';\r\n case 'duration':\r\n return \"Deve essere una durata valida nel formato ISO 8601 (es. 'PT1H30M')\"; \r\n default:\r\n return 'Deve essere formattato correttamente ' + error.requiredFormat;\r\n }\r\n },\r\n minimum: 'Deve essere {{minimumValue}} o più',\r\n exclusiveMinimum: 'Deve essere più di {{exclusiveMinimumValue}}',\r\n maximum: 'Deve essere {{maximumValue}} o meno',\r\n exclusiveMaximum: 'Deve essere minore di {{exclusiveMaximumValue}}',\r\n multipleOf: function (error) {\r\n if ((1 / error.multipleOfValue) % 10 === 0) {\r\n const decimals = Math.log10(1 / error.multipleOfValue);\r\n return `Deve avere ${decimals} o meno decimali.`;\r\n } else {\r\n return `Deve essere multiplo di ${error.multipleOfValue}.`;\r\n }\r\n },\r\n minProperties: 'Deve avere {{minimumProperties}} o più elementi (elementi correnti: {{currentProperties}})',\r\n maxProperties: 'Deve avere {{maximumProperties}} o meno elementi (elementi correnti: {{currentProperties}})',\r\n minItems: 'Deve avere {{minimumItems}} o più elementi (elementi correnti: {{currentItems}})',\r\n maxItems: 'Deve avere {{maximumItems}} o meno elementi (elementi correnti: {{currentItems}})',\r\n uniqueItems: 'Tutti gli elementi devono essere unici',\r\n // Note: No default error messages for 'type', 'const', 'enum', or 'dependencies'\r\n};\r\n","export const ptValidationMessages: any = { // Brazilian Portuguese error messages\r\n required: 'Este campo é obrigatório.',\r\n minLength: 'É preciso no mínimo {{minimumLength}} caracteres ou mais (tamanho atual: {{currentLength}})',\r\n maxLength: 'É preciso no máximo {{maximumLength}} caracteres ou menos (tamanho atual: {{currentLength}})',\r\n pattern: 'Tem que ajustar ao formato: {{requiredPattern}}',\r\n format: function (error) {\r\n switch (error.requiredFormat) {\r\n case 'date':\r\n return 'Tem que ser uma data, por exemplo \"2000-12-31\"';\r\n case 'time':\r\n return 'Tem que ser horário, por exemplo \"16:20\" ou \"03:14:15.9265\"';\r\n case 'date-time':\r\n return 'Tem que ser data e hora, por exemplo \"2000-03-14T01:59\" ou \"2000-03-14T01:59:26.535Z\"';\r\n case 'email':\r\n return 'Tem que ser um email, por exemplo \"fulano@exemplo.com.br\"';\r\n case 'hostname':\r\n return 'Tem que ser uma nome de domínio, por exemplo \"exemplo.com.br\"';\r\n case 'ipv4':\r\n return 'Tem que ser um endereço IPv4, por exemplo \"127.0.0.1\"';\r\n case 'ipv6':\r\n return 'Tem que ser um endereço IPv6, por exemplo \"1234:5678:9ABC:DEF0:1234:5678:9ABC:DEF0\"';\r\n // TODO: add examples for 'uri', 'uri-reference', and 'uri-template'\r\n // case 'uri': case 'uri-reference': case 'uri-template':\r\n case 'url':\r\n return 'Tem que ser uma URL, por exemplo \"http://www.exemplo.com.br/pagina.html\"';\r\n case 'uuid':\r\n return 'Tem que ser um uuid, por exemplo \"12345678-9ABC-DEF0-1234-56789ABCDEF0\"';\r\n case 'color':\r\n return 'Tem que ser uma cor, por exemplo \"#FFFFFF\"';\r\n case 'json-pointer':\r\n return 'Tem que ser um JSON Pointer, por exemplo \"/referencia/para/algo\"';\r\n case 'relative-json-pointer':\r\n return 'Tem que ser um JSON Pointer relativo, por exemplo \"2/referencia/para/algo\"';\r\n case 'regex':\r\n return 'Tem que ser uma expressão regular, por exemplo \"(1-)?\\\\d{3}-\\\\d{3}-\\\\d{4}\"';\r\n case 'duration':\r\n return \"Deve ser uma duração válida no formato ISO 8601 (ex.: 'PT1H30M')\";\r\n default:\r\n return 'Tem que ser no formato: ' + error.requiredFormat;\r\n }\r\n },\r\n minimum: 'Tem que ser {{minimumValue}} ou mais',\r\n exclusiveMinimum: 'Tem que ser mais que {{exclusiveMinimumValue}}',\r\n maximum: 'Tem que ser {{maximumValue}} ou menos',\r\n exclusiveMaximum: 'Tem que ser menor que {{exclusiveMaximumValue}}',\r\n multipleOf: function (error) {\r\n if ((1 / error.multipleOfValue) % 10 === 0) {\r\n const decimals = Math.log10(1 / error.multipleOfValue);\r\n return `Tem que ter ${decimals} ou menos casas decimais.`;\r\n } else {\r\n return `Tem que ser um múltiplo de ${error.multipleOfValue}.`;\r\n }\r\n },\r\n minProperties: 'Deve ter {{minimumProperties}} ou mais itens (itens até o momento: {{currentProperties}})',\r\n maxProperties: 'Deve ter {{maximumProperties}} ou menos intens (itens até o momento: {{currentProperties}})',\r\n minItems: 'Deve ter {{minimumItems}} ou mais itens (itens até o momento: {{currentItems}})',\r\n maxItems: 'Deve ter {{maximumItems}} ou menos itens (itens até o momento: {{currentItems}})',\r\n uniqueItems: 'Todos os itens devem ser únicos',\r\n // Note: No default error messages for 'type', 'const', 'enum', or 'dependencies'\r\n};\r\n","export const zhValidationMessages: any = { // Chinese error messages\r\n required: '必填字段.',\r\n minLength: '字符长度必须大于或者等于 {{minimumLength}} (当前长度: {{currentLength}})',\r\n maxLength: '字符长度必须小于或者等于 {{maximumLength}} (当前长度: {{currentLength}})',\r\n pattern: '必须匹配正则表达式: {{requiredPattern}}',\r\n format: function (error) {\r\n switch (error.requiredFormat) {\r\n case 'date':\r\n return '必须为日期格式, 比如 \"2000-12-31\"';\r\n case 'time':\r\n return '必须为时间格式, 比如 \"16:20\" 或者 \"03:14:15.9265\"';\r\n case 'date-time':\r\n return '必须为日期时间格式, 比如 \"2000-03-14T01:59\" 或者 \"2000-03-14T01:59:26.535Z\"';\r\n case 'email':\r\n return '必须为邮箱地址, 比如 \"name@example.com\"';\r\n case 'hostname':\r\n return '必须为主机名, 比如 \"example.com\"';\r\n case 'ipv4':\r\n return '必须为 IPv4 地址, 比如 \"127.0.0.1\"';\r\n case 'ipv6':\r\n return '必须为 IPv6 地址, 比如 \"1234:5678:9ABC:DEF0:1234:5678:9ABC:DEF0\"';\r\n // TODO: add examples for 'uri', 'uri-reference', and 'uri-template'\r\n // case 'uri': case 'uri-reference': case 'uri-template':\r\n case 'url':\r\n return '必须为 url, 比如 \"http://www.example.com/page.html\"';\r\n case 'uuid':\r\n return '必须为 uuid, 比如 \"12345678-9ABC-DEF0-1234-56789ABCDEF0\"';\r\n case 'color':\r\n return '必须为颜色值, 比如 \"#FFFFFF\"';\r\n case 'json-pointer':\r\n return '必须为 JSON Pointer, 比如 \"/pointer/to/something\"';\r\n case 'relative-json-pointer':\r\n return '必须为相对的 JSON Pointer, 比如 \"2/pointer/to/something\"';\r\n case 'regex':\r\n return '必须为正则表达式, 比如 \"(1-)?\\\\d{3}-\\\\d{3}-\\\\d{4}\"';\r\n case 'duration':\r\n return \"必须是有效的 ISO 8601 持续时间(例如:'PT1H30M')\"; \r\n default:\r\n return '必须为格式正确的 ' + error.requiredFormat;\r\n }\r\n },\r\n minimum: '必须大于或者等于最小值: {{minimumValue}}',\r\n exclusiveMinimum: '必须大于最小值: {{exclusiveMinimumValue}}',\r\n maximum: '必须小于或者等于最大值: {{maximumValue}}',\r\n exclusiveMaximum: '必须小于最大值: {{exclusiveMaximumValue}}',\r\n multipleOf: function (error) {\r\n if ((1 / error.multipleOfValue) % 10 === 0) {\r\n const decimals = Math.log10(1 / error.multipleOfValue);\r\n return `必须有 ${decimals} 位或更少的小数位`;\r\n } else {\r\n return `必须为 ${error.multipleOfValue} 的倍数`;\r\n }\r\n },\r\n minProperties: '项目数必须大于或者等于 {{minimumProperties}} (当前项目数: {{currentProperties}})',\r\n maxProperties: '项目数必须小于或者等于 {{maximumProperties}} (当前项目数: {{currentProperties}})',\r\n minItems: '项目数必须大于或者等于 {{minimumItems}} (当前项目数: {{currentItems}})',\r\n maxItems: '项目数必须小于或者等于 {{maximumItems}} (当前项目数: {{currentItems}})',\r\n uniqueItems: '所有项目必须是唯一的',\r\n // Note: No default error messages for 'type', 'const', 'enum', or 'dependencies'\r\n};\r\n","import { AbstractControl } from '@angular/forms';\r\nimport { from, Observable } from 'rxjs';\r\n\r\n/**\r\n * Validator utility function library:\r\n *\r\n * Validator and error utilities:\r\n * _executeValidators, _executeAsyncValidators, _mergeObjects, _mergeErrors\r\n *\r\n * Individual value checking:\r\n * isDefined, hasValue, isEmpty\r\n *\r\n * Individual type checking:\r\n * isString, isNumber, isInteger, isBoolean, isFunction, isObject, isArray,\r\n * isMap, isSet, isPromise, isObservable\r\n *\r\n * Multiple type checking and fixing:\r\n * getType, isType, isPrimitive, toJavaScriptType, toSchemaType,\r\n * _toPromise, toObservable\r\n *\r\n * Utility functions:\r\n * inArray, xor\r\n *\r\n * Typescript types and interfaces:\r\n * SchemaPrimitiveType, SchemaType, JavaScriptPrimitiveType, JavaScriptType,\r\n * PrimitiveValue, PlainObject, IValidatorFn, AsyncIValidatorFn\r\n *\r\n * Note: 'IValidatorFn' is short for 'invertable validator function',\r\n * which is a validator functions that accepts an optional second\r\n * argument which, if set to TRUE, causes the validator to perform\r\n * the opposite of its original function.\r\n */\r\n\r\nexport type SchemaPrimitiveType =\r\n 'string' | 'number' | 'integer' | 'boolean' | 'null';\r\nexport type SchemaType =\r\n 'string' | 'number' | 'integer' | 'boolean' | 'null' | 'object' | 'array';\r\nexport type JavaScriptPrimitiveType =\r\n 'string' | 'number' | 'boolean' | 'null' | 'undefined';\r\nexport type JavaScriptType =\r\n 'string' | 'number' | 'boolean' | 'null' | 'undefined' | 'object' | 'array' |\r\n 'map' | 'set' | 'arguments' | 'date' | 'error' | 'function' | 'json' |\r\n 'math' | 'regexp'; // Note: this list is incomplete\r\nexport type PrimitiveValue = string | number | boolean | null | undefined;\r\nexport interface PlainObject { [k: string]: any; }\r\n\r\nexport type IValidatorFn = (c: AbstractControl, i?: boolean) => PlainObject;\r\nexport type AsyncIValidatorFn = (c: AbstractControl, i?: boolean) => any;\r\n\r\n/**\r\n * '_executeValidators' utility function\r\n *\r\n * Validates a control against an array of validators, and returns\r\n * an array of the same length containing a combination of error messages\r\n * (from invalid validators) and null values (from valid validators)\r\n *\r\n * // { AbstractControl } control - control to validate\r\n * // { IValidatorFn[] } validators - array of validators\r\n * // { boolean } invert - invert?\r\n * // { PlainObject[] } - array of nulls and error message\r\n */\r\nexport function _executeValidators(control, validators, invert = false) {\r\n return validators.map(validator => validator(control, invert));\r\n}\r\n\r\n/**\r\n * '_executeAsyncValidators' utility function\r\n *\r\n * Validates a control against an array of async validators, and returns\r\n * an array of observabe results of the same length containing a combination of\r\n * error messages (from invalid validators) and null values (from valid ones)\r\n *\r\n * // { AbstractControl } control - control to validate\r\n * // { AsyncIValidatorFn[] } validators - array of async validators\r\n * // { boolean } invert - invert?\r\n * // - array of observable nulls and error message\r\n */\r\nexport function _executeAsyncValidators(control, validators, invert = false) {\r\n return validators.map(validator => validator(control, invert));\r\n}\r\n\r\n/**\r\n * '_mergeObjects' utility function\r\n *\r\n * Recursively Merges one or more objects into a single object with combined keys.\r\n * Automatically detects and ignores null and undefined inputs.\r\n * Also detects duplicated boolean 'not' keys and XORs their values.\r\n *\r\n * // { PlainObject[] } objects - one or more objects to merge\r\n * // { PlainObject } - merged object\r\n */\r\nexport function _mergeObjects(...objects) {\r\n const mergedObject: PlainObject = { };\r\n for (const currentObject of objects) {\r\n if (isObject(currentObject)) {\r\n for (const key of Object.keys(currentObject)) {\r\n const currentValue = currentObject[key];\r\n const mergedValue = mergedObject[key];\r\n mergedObject[key] = !isDefined(mergedValue) ? currentValue :\r\n key === 'not' && isBoolean(mergedValue, 'strict') &&\r\n isBoolean(currentValue, 'strict') ? xor(mergedValue, currentValue) :\r\n getType(mergedValue) === 'object' && getType(currentValue) === 'object' ?\r\n _mergeObjects(mergedValue, currentValue) :\r\n currentValue;\r\n }\r\n }\r\n }\r\n return mergedObject;\r\n}\r\n\r\n/**\r\n * '_mergeErrors' utility function\r\n *\r\n * Merges an array of objects.\r\n * Used for combining the validator errors returned from 'executeValidators'\r\n *\r\n * // { PlainObject[] } arrayOfErrors - array of objects\r\n * // { PlainObject } - merged object, or null if no usable input objectcs\r\n */\r\nexport function _mergeErrors(arrayOfErrors) {\r\n const mergedErrors = _mergeObjects(...arrayOfErrors);\r\n return isEmpty(mergedErrors) ? null : mergedErrors;\r\n}\r\n\r\n/**\r\n * 'isDefined' utility function\r\n *\r\n * Checks if a variable contains a value of any type.\r\n * Returns true even for otherwise 'falsey' values of 0, '', and false.\r\n *\r\n * // value - the value to check\r\n * // { boolean } - false if undefined or null, otherwise true\r\n */\r\nexport function isDefined(value) {\r\n return value !== undefined && value !== null;\r\n}\r\n\r\n/**\r\n * 'hasValue' utility function\r\n *\r\n * Checks if a variable contains a value.\r\n * Returs false for null, undefined, or a zero-length strng, '',\r\n * otherwise returns true.\r\n * (Stricter than 'isDefined' because it also returns false for '',\r\n * though it stil returns true for otherwise 'falsey' values 0 and false.)\r\n *\r\n * // value - the value to check\r\n * // { boolean } - false if undefined, null, or '', otherwise true\r\n */\r\nexport function hasValue(value) {\r\n return value !== undefined && value !== null && value !== '';\r\n}\r\n\r\n/**\r\n * 'isEmpty' utility function\r\n *\r\n * Similar to !hasValue, but also returns true for empty arrays and objects.\r\n *\r\n * // value - the value to check\r\n * // { boolean } - false if undefined, null, or '', otherwise true\r\n */\r\nexport function isEmpty(value) {\r\n if (isArray(value)) { return !value.length; }\r\n if (isObject(value)) { return !Object.keys(value).length; }\r\n return value === undefined || value === null || value === '';\r\n}\r\n\r\n/**\r\n * 'isString' utility function\r\n *\r\n * Checks if a value is a string.\r\n *\r\n * // value - the value to check\r\n * // { boolean } - true if string, false if not\r\n */\r\nexport function isString(value) {\r\n return typeof value === 'string';\r\n}\r\n\r\n/**\r\n * 'isNumber' utility function\r\n *\r\n * Checks if a value is a regular number, numeric string, or JavaScript Date.\r\n *\r\n * // value - the value to check\r\n * // { any = false } strict - if truthy, also checks JavaScript tyoe\r\n * // { boolean } - true if number, false if not\r\n */\r\nexport function isNumber(value, strict: any = false) {\r\n if (strict && typeof value !== 'number') { return false; }\r\n return !isNaN(value) && value !== value / 0;\r\n}\r\n\r\n/**\r\n * 'isInteger' utility function\r\n *\r\n * Checks if a value is an integer.\r\n *\r\n * // value - the value to check\r\n * // { any = false } strict - if truthy, also checks JavaScript tyoe\r\n * // {boolean } - true if number, false if not\r\n */\r\nexport function isInteger(value, strict: any = false) {\r\n if (strict && typeof value !== 'number') { return false; }\r\n return !isNaN(value) && value !== value / 0 && value % 1 === 0;\r\n}\r\n\r\n/**\r\n * 'isBoolean' utility function\r\n *\r\n * Checks if a value is a boolean.\r\n *\r\n * // value - the value to check\r\n * // { any = null } option - if 'strict', also checks JavaScript type\r\n * if TRUE or FALSE, checks only for that value\r\n * // { boolean } - true if boolean, false if not\r\n */\r\nexport function isBoolean(value, option: any = null) {\r\n if (option === 'strict') { return value === true || value === false; }\r\n if (option === true) {\r\n return value === true || value === 1 || value === 'true' || value === '1';\r\n }\r\n if (option === false) {\r\n return value === false || value === 0 || value === 'false' || value === '0';\r\n }\r\n return value === true || value === 1 || value === 'true' || value === '1' ||\r\n value === false || value === 0 || value === 'false' || value === '0';\r\n}\r\n\r\nexport function isFunction(item: any): boolean {\r\n return typeof item === 'function';\r\n}\r\n\r\nexport function isObject(item: any): boolean {\r\n return item !== null && typeof item === 'object';\r\n}\r\n\r\nexport function isArray(item: any): boolean {\r\n return Array.isArray(item);\r\n}\r\n\r\nexport function isDate(item: any): boolean {\r\n return !!item && Object.prototype.toString.call(item) === '[object Date]';\r\n}\r\n\r\nexport function isMap(item: any): boolean {\r\n return !!item && Object.prototype.toString.call(item) === '[object Map]';\r\n}\r\n\r\nexport function isSet(item: any): boolean {\r\n return !!item && Object.prototype.toString.call(item) === '[object Set]';\r\n}\r\n\r\nexport function isSymbol(item: any): boolean {\r\n return typeof item === 'symbol';\r\n}\r\n\r\n/**\r\n * 'getType' function\r\n *\r\n * Detects the JSON Schema Type of a value.\r\n * By default, detects numbers and integers even if formatted as strings.\r\n * (So all integers are also numbers, and any number may also be a string.)\r\n * However, it only detects true boolean values (to detect boolean values\r\n * in non-boolean formats, use isBoolean() instead).\r\n *\r\n * If passed a second optional parameter of 'strict', it will only detect\r\n * numbers and integers if they are formatted as JavaScript numbers.\r\n *\r\n * Examples:\r\n * getType('10.5') = 'number'\r\n * getType(10.5) = 'number'\r\n * getType('10') = 'integer'\r\n * getType(10) = 'integer'\r\n * getType('true') = 'string'\r\n * getType(true) = 'boolean'\r\n * getType(null) = 'null'\r\n * getType({ }) = 'object'\r\n * getType([]) = 'array'\r\n *\r\n * getType('10.5', 'strict') = 'string'\r\n * getType(10.5, 'strict') = 'number'\r\n * getType('10', 'strict') = 'string'\r\n * getType(10, 'strict') = 'integer'\r\n * getType('true', 'strict') = 'string'\r\n * getType(true, 'strict') = 'boolean'\r\n *\r\n * // value - value to check\r\n * // { any = false } strict - if truthy, also checks JavaScript tyoe\r\n * // { SchemaType }\r\n */\r\nexport function getType(value, strict: any = false) {\r\n if (!isDefined(value)) { return 'null'; }\r\n if (isArray(value)) { return 'array'; }\r\n if (isObject(value)) { return 'object'; }\r\n if (isBoolean(value, 'strict')) { return 'boolean'; }\r\n if (isInteger(value, strict)) { return 'integer'; }\r\n if (isNumber(value, strict)) { return 'number'; }\r\n if (isString(value) || (!strict && isDate(value))) { return 'string'; }\r\n return null;\r\n}\r\n\r\n/**\r\n * 'isType' function\r\n *\r\n * Checks wether an input (probably string) value contains data of\r\n * a specified JSON Schema type\r\n *\r\n * // { PrimitiveValue } value - value to check\r\n * // { SchemaPrimitiveType } type - type to check\r\n * // { boolean }\r\n */\r\nexport function isType(value, type) {\r\n switch (type) {\r\n case 'string':\r\n return isString(value) || isDate(value);\r\n case 'number':\r\n return isNumber(value);\r\n case 'integer':\r\n return isInteger(value);\r\n case 'boolean':\r\n return isBoolean(value);\r\n case 'null':\r\n return !hasValue(value);\r\n default:\r\n console.error(`isType error: \"${type}\" is not a recognized type.`);\r\n return null;\r\n }\r\n}\r\n\r\n/**\r\n * 'isPrimitive' function\r\n *\r\n * Checks wether an input value is a JavaScript primitive type:\r\n * string, number, boolean, or null.\r\n *\r\n * // value - value to check\r\n * // { boolean }\r\n */\r\nexport function isPrimitive(value) {\r\n return (isString(value) || isNumber(value) ||\r\n isBoolean(value, 'strict') || value === null);\r\n}\r\n\r\n/**\r\n * \r\n * @param date \r\n * @returns {string}\r\n * exmaple:\r\n * toDateString('2018-01-01') = '2018-01-01'\r\n * toDateString('2018-01-30T00:00:00.000Z') = '2018-01-30'\r\n */\r\nexport const toIsoString = (date: Date) => {\r\n const day = date.getDate();\r\n const month = date.getMonth() + 1;\r\n const year = date.getFullYear();\r\n return `${year}-${month < 10 ? '0' + month : month}-${day < 10 ? '0' + day : day}`;\r\n}\r\n\r\n/**\r\n * 'toJavaScriptType' function\r\n *\r\n * Converts an input (probably string) value to a JavaScript primitive type -\r\n * 'string', 'number', 'boolean', or 'null' - before storing in a JSON object.\r\n *\r\n * Does not coerce values (other than null), and only converts the types\r\n * of values that would otherwise be valid.\r\n *\r\n * If the optional third parameter 'strictIntegers' is TRUE, and the\r\n * JSON Schema type 'integer' is specified, it also verifies the input value\r\n * is an integer and, if it is, returns it as a JaveScript number.\r\n * If 'strictIntegers' is FALSE (or not set) the type 'integer' is treated\r\n * exactly the same as 'number', and allows decimals.\r\n *\r\n * Valid Examples:\r\n * toJavaScriptType('10', 'number' ) = 10 // '10' is a number\r\n * toJavaScriptType('10', 'integer') = 10 // '10' is also an integer\r\n * toJavaScriptType( 10, 'integer') = 10 // 10 is still an integer\r\n * toJavaScriptType( 10, 'string' ) = '10' // 10 can be made into a string\r\n * toJavaScriptType('10.5', 'number' ) = 10.5 // '10.5' is a number\r\n *\r\n * Invalid Examples:\r\n * toJavaScriptType('10.5', 'integer') = null // '10.5' is not an integer\r\n * toJavaScriptType( 10.5, 'integer') = null // 10.5 is still not an integer\r\n *\r\n * // { PrimitiveValue } value - value to convert\r\n * // { SchemaPrimitiveType | SchemaPrimitiveType[] } types - types to convert to\r\n * // { boolean = false } strictIntegers - if FALSE, treat integers as numbers\r\n * // { PrimitiveValue }\r\n */\r\nexport function toJavaScriptType(value, types, strictIntegers = true) {\r\n if (!isDefined(value)) { return null; }\r\n if (isString(types)) { types = [types]; }\r\n if (strictIntegers && inArray('integer', types)) {\r\n if (isInteger(value, 'strict')) { return value; }\r\n if (isInteger(value)) { return parseInt(value, 10); }\r\n }\r\n if (inArray('number', types) || (!strictIntegers && inArray('integer', types))) {\r\n if (isNumber(value, 'strict')) { return value; }\r\n if (isNumber(value)) { return parseFloat(value); }\r\n }\r\n if (inArray('string', types)) {\r\n if (isString(value)) { return value; }\r\n // If value is a date, and types includes 'string',\r\n // convert the date to a string\r\n if (isDate(value)) { return toIsoString(value); }\r\n if (isNumber(value)) { return value.toString(); }\r\n }\r\n // If value is a date, and types includes 'integer' or 'number',\r\n // but not 'string', convert the date to a number\r\n if (isDate(value) && (inArray('integer', types) || inArray('number', types))) {\r\n return value.getTime();\r\n }\r\n if (inArray('boolean', types)) {\r\n if (isBoolean(value, true)) { return true; }\r\n if (isBoolean(value, false)) { return false; }\r\n }\r\n return null;\r\n}\r\n\r\n/**\r\n * 'toSchemaType' function\r\n *\r\n * Converts an input (probably string) value to the \"best\" JavaScript\r\n * equivalent available from an allowed list of JSON Schema types, which may\r\n * contain 'string', 'number', 'integer', 'boolean', and/or 'null'.\r\n * If necssary, it does progressively agressive type coersion.\r\n * It will not return null unless null is in the list of allowed types.\r\n *\r\n * Number conversion examples:\r\n * toSchemaType('10', ['number','integer','string']) = 10 // integer\r\n * toSchemaType('10', ['number','string']) = 10 // number\r\n * toSchemaType('10', ['string']) = '10' // string\r\n * toSchemaType('10.5', ['number','integer','string']) = 10.5 // number\r\n * toSchemaType('10.5', ['integer','string']) = '10.5' // string\r\n * toSchemaType('10.5', ['integer']) = 10 // integer\r\n * toSchemaType(10.5, ['null','boolean','string']) = '10.5' // string\r\n * toSchemaType(10.5, ['null','boolean']) = true // boolean\r\n *\r\n * String conversion examples:\r\n * toSchemaType('1.5x', ['boolean','number','integer','string']) = '1.5x' // string\r\n * toSchemaType('1.5x', ['boolean','number','integer']) = '1.5' // number\r\n * toSchemaType('1.5x', ['boolean','integer']) = '1' // integer\r\n * toSchemaType('1.5x', ['boolean']) = true // boolean\r\n * toSchemaType('xyz', ['number','integer','boolean','null']) = true // boolean\r\n * toSchemaType('xyz', ['number','integer','null']) = null // null\r\n * toSchemaType('xyz', ['number','integer']) = 0 // number\r\n *\r\n * Boolean conversion examples:\r\n * toSchemaType('1', ['integer','number','string','boolean']) = 1 // integer\r\n * toSchemaType('1', ['number','string','boolean']) = 1 // number\r\n * toSchemaType('1', ['string','boolean']) = '1' // string\r\n * toSchemaType('1', ['boolean']) = true // boolean\r\n * toSchemaType('true', ['number','string','boolean']) = 'true' // string\r\n * toSchemaType('true', ['boolean']) = true // boolean\r\n * toSchemaType('true', ['number']) = 0 // number\r\n * toSchemaType(true, ['number','string','boolean']) = true // boolean\r\n * toSchemaType(true, ['number','string']) = 'true' // string\r\n * toSchemaType(true, ['number']) = 1 // number\r\n *\r\n * // { PrimitiveValue } value - value to convert\r\n * // { SchemaPrimitiveType | SchemaPrimitiveType[] } types - allowed types to convert to\r\n * // { PrimitiveValue }\r\n */\r\nexport function toSchemaType(value, types) {\r\n if (!isArray(<SchemaPrimitiveType>types)) {\r\n types = <SchemaPrimitiveType[]>[types];\r\n }\r\n if ((<SchemaPrimitiveType[]>types).includes('null') && !hasValue(value)) {\r\n return null;\r\n }\r\n if ((<SchemaPrimitiveType[]>types).includes('boolean') && !isBoolean(value, 'strict')) {\r\n return value;\r\n }\r\n if ((<SchemaPrimitiveType[]>types).includes('integer')) {\r\n const testValue = toJavaScriptType(value, 'integer');\r\n if (testValue !== null) { return +testValue; }\r\n }\r\n if ((<SchemaPrimitiveType[]>types).includes('number')) {\r\n const testValue = toJavaScriptType(value, 'number');\r\n if (testValue !== null) { return +testValue; }\r\n }\r\n if (\r\n (isString(value) || isNumber(value, 'strict')) &&\r\n (<SchemaPrimitiveType[]>types).includes('string')\r\n ) { // Convert number to string\r\n return toJavaScriptType(value, 'string');\r\n }\r\n if ((<SchemaPrimitiveType[]>types).includes('boolean') && isBoolean(value)) {\r\n return toJavaScriptType(value, 'boolean');\r\n }\r\n if ((<SchemaPrimitiveType[]>types).includes('string')) { // Convert null & boolean to string\r\n if (value === null) { return ''; }\r\n const testValue = toJavaScriptType(value, 'string');\r\n if (testValue !== null) { return testValue; }\r\n }\r\n if ((\r\n (<SchemaPrimitiveType[]>types).includes('number') ||\r\n (<SchemaPrimitiveType[]>types).includes('integer'))\r\n ) {\r\n if (value === true) { return 1; } // Convert boolean & null to number\r\n if (value === false || value === null || value === '') { return 0; }\r\n }\r\n if ((<SchemaPrimitiveType[]>types).includes('number')) { // Convert mixed string to number\r\n const testValue = parseFloat(<string>value);\r\n if (!!testValue) { return testValue; }\r\n }\r\n if ((<SchemaPrimitiveType[]>types).includes('integer')) { // Convert string or number to integer\r\n const testValue = parseInt(<string>value, 10);\r\n if (!!testValue) { return testValue; }\r\n }\r\n if ((<SchemaPrimitiveType[]>types).includes('boolean')) { // Convert anything to boolean\r\n return !!value;\r\n }\r\n if ((\r\n (<SchemaPrimitiveType[]>types).includes('number') ||\r\n (<SchemaPrimitiveType[]>types).includes('integer')\r\n ) && !(<SchemaPrimitiveType[]>types).includes('null')\r\n ) {\r\n return 0; // If null not allowed, return 0 for non-convertable values\r\n }\r\n}\r\n\r\n/**\r\n * 'isPromise' function\r\n *\r\n * // object\r\n * // { boolean }\r\n */\r\nexport function isPromise(object): object is Promise<any> {\r\n return !!object && typeof object.then === 'function';\r\n}\r\n\r\n/**\r\n * 'isObservable' function\r\n *\r\n * // object\r\n * // { boolean }\r\n */\r\nexport function isObservable(object): object is Observable<any> {\r\n return !!object && typeof object.subscribe === 'function';\r\n}\r\n\r\n/**\r\n * '_toPromise' function\r\n *\r\n * // { object } object\r\n * // { Promise<any> }\r\n */\r\nexport function _toPromise(object): Promise<any> {\r\n return isPromise(object) ? object : object.toPromise();\r\n}\r\n\r\n/**\r\n * 'toObservable' function\r\n *\r\n * // { object } object\r\n * // { Observable<any> }\r\n */\r\nexport function toObservable(object): Observable<any> {\r\n const observable = isPromise(object) ? from(object) : object;\r\n if (isObservable(observable)) { return observable; }\r\n console.error('toObservable error: Expected validator to return Promise or Observable.');\r\n return new Observable();\r\n}\r\n\r\n/**\r\n * 'inArray' function\r\n *\r\n * Searches an array for an item, or one of a list of items, and returns true\r\n * as soon as a match is found, or false if no match.\r\n *\r\n * If the optional third parameter allIn is set to TRUE, and the item to find\r\n * is an array, then the function returns true only if all elements from item\r\n * are found in the array list, and false if any element is not found. If the\r\n * item to find is not an array, setting allIn to TRUE has no effect.\r\n *\r\n * // { any|any[] } item - the item to search for\r\n * // array - the array to search\r\n * // { boolean = false } allIn - if TRUE, all items must be in array\r\n * // { boolean } - true if item(s) in array, false otherwise\r\n */\r\nexport function inArray(item, array, allIn = false) {\r\n if (!isDefined(item) || !isArray(array)) { return false; }\r\n return isArray(item) ?\r\n item[allIn ? 'every' : 'some'](subItem => array.includes(subItem)) :\r\n array.includes(item);\r\n}\r\n\r\n/**\r\n * 'xor' utility function - exclusive or\r\n *\r\n * Returns true if exactly one of two values is truthy.\r\n *\r\n * // value1 - first value to check\r\n * // value2 - second value to check\r\n * // { boolean } - true if exactly one input value is truthy, false if not\r\n */\r\nexport function xor(value1, value2) {\r\n return (!!value1 && !value2) || (!value1 && !!value2);\r\n}\r\n","import { isNil, some } from 'lodash';\r\nimport { hasValue, inArray, isArray, isDefined, isEmpty, isMap, isObject, isSet, isString, PlainObject } from './validator.functions';\r\n\r\n/**\r\n * Utility function library:\r\n *\r\n * addClasses, copy, forEach, forEachCopy, hasOwn, mergeFilteredObject,\r\n * uniqueItems, commonItems, fixTitle, toTitleCase\r\n*/\r\n\r\n/**\r\n * 'addClasses' function\r\n *\r\n * Merges two space-delimited lists of CSS classes and removes duplicates.\r\n *\r\n * // {string | string[] | Set<string>} oldClasses\r\n * // {string | string[] | Set<string>} newClasses\r\n * // {string | string[] | Set<string>} - Combined classes\r\n */\r\nexport function addClasses(\r\n oldClasses: string | string[] | Set<string>,\r\n newClasses: string | string[] | Set<string>\r\n): string | string[] | Set<string> {\r\n const badType = i => !isSet(i) && !isArray(i) && !isString(i);\r\n if (badType(newClasses)) { return oldClasses; }\r\n if (badType(oldClasses)) { oldClasses = ''; }\r\n const toSet = i => isSet(i) ? i : isArray(i) ? new Set(i) : new Set(i.split(' '));\r\n const combinedSet: Set<any> = toSet(oldClasses);\r\n const newSet: Set<any> = toSet(newClasses);\r\n newSet.forEach(c => combinedSet.add(c));\r\n if (isSet(oldClasses)) { return combinedSet; }\r\n if (isArray(oldClasses)) { return Array.from(combinedSet); }\r\n return Array.from(combinedSet).join(' ');\r\n}\r\n\r\n/**\r\n * 'copy' function\r\n *\r\n * Makes a shallow copy of a JavaScript object, array, Map, or Set.\r\n * If passed a JavaScript primitive value (string, number, boolean, or null),\r\n * it returns the value.\r\n *\r\n * // {Object|Array|string|number|boolean|null} object - The object to copy\r\n * // {boolean = false} errors - Show errors?\r\n * // {Object|Array|string|number|boolean|null} - The copied object\r\n */\r\nexport function copy(object: any, errors = false): any {\r\n if (typeof object !== 'object' || object === null) { return object; }\r\n if (isMap(object)) { return new Map(object); }\r\n if (isSet(object)) { return new Set(object); }\r\n if (isArray(object)) { return [ ...object ]; }\r\n if (isObject(object)) { return { ...object }; }\r\n if (errors) {\r\n console.error('copy error: Object to copy must be a JavaScript object or value.');\r\n }\r\n return object;\r\n}\r\n\r\n/**\r\n * 'forEach' function\r\n *\r\n * Iterates over all items in the first level of an object or array\r\n * and calls an iterator funciton on each item.\r\n *\r\n * The iterator function is called with four values:\r\n * 1. The current item's value\r\n * 2. The current item's key\r\n * 3. The parent object, which contains the current item\r\n * 4. The root object\r\n *\r\n * Setting the optional third parameter to 'top-down' or 'bottom-up' will cause\r\n * it to also recursively iterate over items in sub-objects or sub-arrays in the\r\n * specified direction.\r\n *\r\n * // {Object|Array} object - The object or array to iterate over\r\n * // {function} fn - the iterator funciton to call on each item\r\n * // {boolean = false} errors - Show errors?\r\n * // {void}\r\n */\r\nexport function forEach(\r\n object: any, fn: (v: any, k?: string | number, c?: any, rc?: any) => any,\r\n recurse: boolean | string = false, rootObject: any = object, errors = false\r\n): void {\r\n if (isEmpty(object)) { return; }\r\n if ((isObject(object) || isArray(object)) && typeof fn === 'function') {\r\n for (const key of Object.keys(object)) {\r\n const value = object[key];\r\n if (recurse === 'bottom-up' && (isObject(value) || isArray(value))) {\r\n forEach(value, fn, recurse, rootObject);\r\n }\r\n fn(value, key, object, rootObject);\r\n if (recurse === 'top-down' && (isObject(value) || isArray(value))) {\r\n forEach(value, fn, recurse, rootObject);\r\n }\r\n }\r\n }\r\n if (errors) {\r\n if (typeof fn !== 'function') {\r\n console.error('forEach error: Iterator must be a function.');\r\n console.error('function', fn);\r\n }\r\n if (!isObject(object) && !isArray(object)) {\r\n console.error('forEach error: Input object must be an object or array.');\r\n console.error('object', object);\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * 'forEachCopy' function\r\n *\r\n * Iterates over all items in the first level of an object or array\r\n * and calls an iterator function on each item. Returns a new object or array\r\n * with the same keys or indexes as the original, and values set to the results\r\n * of the iterator function.\r\n *\r\n * Does NOT recursively iterate over items in sub-objects or sub-arrays.\r\n *\r\n * // {Object | Array} object - The object or array to iterate over\r\n * // {function} fn - The iterator funciton to call on each item\r\n * // {boolean = false} errors - Show errors?\r\n * // {Object | Array} - The resulting object or array\r\n */\r\nexport function forEachCopy(\r\n object: any, fn: (v: any, k?: string | number, o?: any, p?: string) => any,\r\n errors = false\r\n): any {\r\n if (!hasValue(object)) { return; }\r\n if ((isObject(object) || isArray(object)) && typeof object !== 'function') {\r\n const newObject: any = isArray(object) ? [] : {};\r\n for (const key of Object.keys(object)) {\r\n newObject[key] = fn(object[key], key, object);\r\n }\r\n return newObject;\r\n }\r\n if (errors) {\r\n if (typeof fn !== 'function') {\r\n console.error('forEachCopy error: Iterator must be a function.');\r\n console.error('function', fn);\r\n }\r\n if (!isObject(object) && !isArray(object)) {\r\n console.error('forEachCopy error: Input object must be an object or array.');\r\n console.error('object', object);\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * 'hasOwn' utility function\r\n *\r\n * Checks whether an object or array has a particular property.\r\n *\r\n * // {any} object - the object to check\r\n * // {string} property - the property to look for\r\n * // {boolean} - true if object has property, false if not\r\n */\r\nexport function hasOwn(object: any, property: string): boolean {\r\n if (!object || !['number', 'string', 'symbol'].includes(typeof property) ||\r\n (!isObject(object) && !isArray(object) && !isMap(object) && !isSet(object))\r\n ) { return false; }\r\n if (isMap(object) || isSet(object)) { return object.has(property); }\r\n if (typeof property === 'number') {\r\n if (isArray(object)) { return object[<number>property]; }\r\n property = property + '';\r\n }\r\n return object.hasOwnProperty(property);\r\n}\r\n\r\n/**\r\n * Types of possible expressions which the app is able to evaluate.\r\n */\r\nexport enum ExpressionType {\r\n EQUALS,\r\n NOT_EQUALS,\r\n NOT_AN_EXPRESSION\r\n}\r\n\r\n/**\r\n * Detects the type of expression from the given candidate. `==` for equals,\r\n * `!=` for not equals. If none of these are contained in the candidate, the candidate\r\n * is not considered to be an expression at all and thus `NOT_AN_EXPRESSION` is returned.\r\n * // {expressionCandidate} expressionCandidate - potential expression\r\n */\r\nexport function getExpressionType(expressionCandidate: string): ExpressionType {\r\n if (expressionCandidate.indexOf('==') !== -1) {\r\n return ExpressionType.EQUALS;\r\n }\r\n\r\n if (expressionCandidate.toString().indexOf('!=') !== -1) {\r\n return ExpressionType.NOT_EQUALS;\r\n }\r\n\r\n return ExpressionType.NOT_AN_EXPRESSION;\r\n}\r\n\r\nexport function isEqual(expressionType) {\r\n return expressionType as ExpressionType === ExpressionType.EQUALS;\r\n}\r\n\r\nexport function isNotEqual(expressionType) {\r\n return expressionType as ExpressionType === ExpressionType.NOT_EQUALS;\r\n}\r\n\r\nexport function isNotExpression(expressionType) {\r\n return expressionType as ExpressionType === ExpressionType.NOT_AN_EXPRESSION;\r\n}\r\n\r\n/**\r\n * Splits the expression key by the expressionType on a pair of values\r\n * before and after the equals or nor equals sign.\r\n * // {expressionType} enum of an expression type\r\n * // {key} the given key from a for loop iver all conditions\r\n */\r\nexport function getKeyAndValueByExpressionType(expressionType: ExpressionType, key: string) {\r\n if (isEqual(expressionType)) {\r\n return key.split('==', 2);\r\n }\r\n\r\n if (isNotEqual(expressionType)) {\r\n return key.split('!=', 2);\r\n }\r\n\r\n return null;\r\n}\r\n\r\nexport function cleanValueOfQuotes(keyAndValue): String {\r\n if (keyAndValue.charAt(0) === '\\'' && keyAndValue.charAt(keyAndValue.length - 1) === '\\'') {\r\n return keyAndValue.replace('\\'', '').replace('\\'', '');\r\n }\r\n return keyAndValue;\r\n}\r\n\r\n/**\r\n * 'mergeFilteredObject' utility function\r\n *\r\n * Shallowly merges two objects, setting key and values from source object\r\n * in target object, excluding specified keys.\r\n *\r\n * Optionally, it can also use functions to transform the key names and/or\r\n * the values of the merging object.\r\n *\r\n * // {PlainObject} targetObject - Target object to add keys and values to\r\n * // {PlainObject} sourceObject - Source object to copy keys and values from\r\n * // {string[]} excludeKeys - Array of keys to exclude\r\n * // {(string: string) => string = (k) => k} keyFn - Function to apply to keys\r\n * // {(any: any) => any = (v) => v} valueFn - Function to apply to values\r\n * // {PlainObject} - Returns targetObject\r\n */\r\nexport function mergeFilteredObject(\r\n targetObject: PlainObject,\r\n sourceObject: PlainObject,\r\n excludeKeys = <string[]>[],\r\n keyFn = (key: string): string => key,\r\n valFn = (val: any): any => val\r\n): PlainObject {\r\n if (!isObject(sourceObject)) { return targetObject; }\r\n if (!isObject(targetObject)) { targetObject = {}; }\r\n for (const key of Object.keys(sourceObject)) {\r\n if (!inArray(key, excludeKeys) && isDefined(sourceObject[key])) {\r\n targetObject[keyFn(key)] = valFn(sourceObject[key]);\r\n }\r\n }\r\n return targetObject;\r\n}\r\n\r\n/**\r\n * 'uniqueItems' function\r\n *\r\n * Accepts any number of string value inputs,\r\n * and returns an array of all input vaues, excluding duplicates.\r\n *\r\n * // {...string} ...items -\r\n * // {string[]} -\r\n */\r\nexport function uniqueItems(...items): string[] {\r\n const returnItems = [];\r\n for (const item of items) {\r\n if (!returnItems.includes(item)) { returnItems.push(item); }\r\n }\r\n return returnItems;\r\n}\r\n\r\n/**\r\n * 'commonItems' function\r\n *\r\n * Accepts any number of strings or arrays of string values,\r\n * and returns a single array containing only values present in all inputs.\r\n *\r\n * // {...string|string[]} ...arrays -\r\n * // {string[]} -\r\n */\r\nexport function commonItems(...arrays): string[] {\r\n let returnItems = null;\r\n for (let array of arrays) {\r\n if (isString(array)) { array = [array]; }\r\n returnItems = returnItems === null ? [ ...array ] :\r\n returnItems.filter(item => array.includes(item));\r\n if (!returnItems.length) { return []; }\r\n }\r\n return returnItems;\r\n}\r\n\r\n/**\r\n * 'fixTitle' function\r\n *\r\n *\r\n * // {string} input -\r\n * // {string} -\r\n */\r\nexport function fixTitle(name: string): string {\r\n return name && toTitleCase(name.replace(/([a-z])([A-Z])/g, '$1 $2').replace(/_/g, ' '));\r\n}\r\n\r\n/**\r\n * 'toTitleCase' function\r\n *\r\n * Intelligently converts an input string to Title Case.\r\n *\r\n * Accepts an optional second parameter with a list of additional\r\n * words and abbreviations to force into a particular case.\r\n *\r\n * This function is built on prior work by John Gruber and David Gouch:\r\n * http://daringfireball.net/2008/08/title_case_update\r\n * https://github.com/gouch/to-title-case\r\n *\r\n * // {string} input -\r\n * // {string|string[]} forceWords? -\r\n * // {string} -\r\n */\r\nexport function toTitleCase(input: string, forceWords?: string|string[]): string {\r\n if (!isString(input)) { return input; }\r\n let forceArray: string[] = ['a', 'an', 'and', 'as', 'at', 'but', 'by', 'en',\r\n 'for', 'if', 'in', 'nor', 'of', 'on', 'or', 'per', 'the', 'to', 'v', 'v.',\r\n 'vs', 'vs.', 'via'];\r\n if (isString(forceWords)) { forceWords = (<string>forceWords).split('|'); }\r\n if (isArray(forceWords)) { forceArray = forceArray.concat(forceWords); }\r\n const forceArrayLower: string[] = forceArray.map(w => w.toLowerCase());\r\n const noInitialCase: boolean =\r\n input === input.toUpperCase() || input === input.toLowerCase();\r\n let prevLastChar = '';\r\n input = input.trim();\r\n return input.replace(/[A-Za-z0-9\\u00C0-\\u00FF]+[^\\s-]*/g, (word, idx) => {\r\n if (!noInitialCase && word.slice(1).search(/[A-Z]|\\../) !== -1) {\r\n return word;\r\n } else {\r\n let newWord: string;\r\n const forceWord: string =\r\n forceArray[forceArrayLower.indexOf(word.toLowerCase())];\r\n if (!forceWord) {\r\n if (noInitialCase) {\r\n if (word.slice(1).search(/\\../) !== -1) {\r\n newWord = word.toLowerCase();\r\n } else {\r\n newWord = word[0].toUpperCase() + word.slice(1).toLowerCase();\r\n }\r\n } else {\r\n newWord = word[0].toUpperCase() + word.slice(1);\r\n }\r\n } else if (\r\n forceWord === forceWord.toLowerCase() && (\r\n idx === 0 || idx + word.length === input.length ||\r\n prevLastChar === ':' || input[idx - 1].search(/[^\\s-]/) !== -1 ||\r\n (input[idx - 1] !== '-' && input[idx + word.length] === '-')\r\n )\r\n ) {\r\n newWord = forceWord[0].toUpperCase() + forceWord.slice(1);\r\n } else {\r\n newWord = forceWord;\r\n }\r\n prevLastChar = word.slice(-1);\r\n return newWord;\r\n }\r\n });\r\n}\r\n\r\n\r\n/**\r\n * Recursively checks if at least one property of the given object (including nested objects)\r\n * has a non-null and non-undefined value.\r\n *\r\n * @param obj - The object to check.\r\n * @returns `true` if at least one property has a non-null and non-undefined value, otherwise `false`.\r\n *\r\n * @example\r\n * const testObj = { a: null, b: { b1: null, b2: undefined } };\r\n * console.log(hasNonNullValue(testObj)); // Output: false\r\n * \r\n * const testObj2 = { a: 1, b: { b1: null, b2: undefined } };\r\n * console.log(hasNonNullValue(testObj2)); // Output: true\r\n */\r\nexport function hasNonNullValue(obj: Record<string, any>): boolean {\r\n // If the object is null or not an object, return false immediately\r\n if (obj === null || typeof obj !== 'object') {\r\n return false;\r\n }\r\n\r\n // _.some checks if at least one element passes the given condition.\r\n return some(obj, (value: any): boolean => {\r\n // If value is an object, recurse deeper into the object.\r\n if (isObject(value)) {\r\n return hasNonNullValue(value);\r\n }\r\n // Check if value is neither null nor undefined.\r\n return !isNil(value);\r\n });\r\n}\r\n/**\r\n * Recursively compares array sizes of nested arrays\r\n *\r\n * @param obj1 - The object to check.\r\n * @param obj2 - The object to check.\r\n * @returns `false` if at least one nested array size mismatches`.\r\n *\r\n * @example\r\n * const obj1 = { a: ['a','aa'], b:{c:[1,11,11]} };\r\n * const obj2 = { a: ['ee','dd'], b:{c:[2]} };\r\n * \r\n * console.log(compareObjectArraySizes(obj1,obj1)); // Output: false\r\n * mismatch will be on path b/c\r\n */\r\n export function compareObjectArraySizes(obj1: any, obj2: any, comparePath = \"\") {\r\n if (isArray(obj1) && isArray(obj2)) {\r\n if (obj1.length != obj2.length) {\r\n console.log(`size mismatch at ${comparePath}` );\r\n return false; // immediately return false on mismatch\r\n } else {\r\n for (let ind = 0; ind < obj1.length; ind++) {\r\n const item1 = obj1[ind];\r\n const item2 = obj2[ind];\r\n const result = compareObjectArraySizes(item1, item2, `${comparePath}/${ind}`);\r\n if (result === false) {\r\n return false; // propagate false if mismatch is found\r\n }\r\n }\r\n }\r\n }\r\n \r\n if (isObject(obj1) && !isArray(obj1)) {\r\n for (let key in obj1) {\r\n if (obj2.hasOwnProperty(key)) {\r\n const result = compareObjectArraySizes(obj1[key], obj2[key], `${comparePath}/${key}`);\r\n if (result === false) {\r\n return false; // propagate false if mismatch is found\r\n }\r\n }\r\n }\r\n }\r\n \r\n return true; // all checks passed\r\n }\r\n \r\n\r\n\r\n\r\n","import { Injectable } from '@angular/core';\r\nimport {\r\n cleanValueOfQuotes,\r\n copy,\r\n ExpressionType,\r\n getExpressionType,\r\n getKeyAndValueByExpressionType,\r\n hasOwn,\r\n isEqual,\r\n isNotEqual,\r\n isNotExpression\r\n} from './utility.functions';\r\nimport { isArray, isDefined, isEmpty, isMap, isNumber, isObject, isString } from './validator.functions';\r\n\r\n/**\r\n * 'JsonPointer' class\r\n *\r\n * Some utilities for using JSON Pointers with JSON objects\r\n * https://tools.ietf.org/html/rfc6901\r\n *\r\n * get, getCopy, getFirst, set, setCopy, insert, insertCopy, remove, has, dict,\r\n * forEachDeep, forEachDeepCopy, escape, unescape, parse, compile, toKey,\r\n * isJsonPointer, isSubPointer, toIndexedPointer, toGenericPointer,\r\n * toControlPointer, toSchemaPointer, toDataPointer, parseObjectPath\r\n *\r\n * Some functions based on manuelstofer's json-pointer utilities\r\n * https://github.com/manuelstofer/json-pointer\r\n */\r\nexport type Pointer = string | string[];\r\n\r\n@Injectable()\r\nexport class JsonPointer {\r\n\r\n /**\r\n * 'get' function\r\n *\r\n * Uses a JSON Pointer to retrieve a value from an object.\r\n *\r\n * // { object } object - Object to get value from\r\n * // { Pointer } pointer - JSON Pointer (string or array)\r\n * // { number = 0 } startSlice - Zero-based index of first Pointer key to use\r\n * // { number } endSlice - Zero-based index of last Pointer key to use\r\n * // { boolean = false } getBoolean - Return only true or false?\r\n * // { boolean = false } errors - Show error if not found?\r\n * // { object } - Located value (or true or false if getBoolean = true)\r\n */\r\n static get(\r\n object, pointer, startSlice = 0, endSlice: number = null,\r\n getBoolean = false, errors = false\r\n ) {\r\n if (object === null) { return getBoolean ? false : undefined; }\r\n let keyArray: any[] = this.parse(pointer, errors);\r\n if (typeof object === 'object' && keyArray !== null) {\r\n let subObject = object;\r\n if (startSlice >= keyArray.length || endSlice <= -keyArray.length) { return object; }\r\n if (startSlice <= -keyArray.length) { startSlice = 0; }\r\n if (!isDefined(endSlice) || endSlice >= keyArray.length) { endSlice = keyArray.length; }\r\n keyArray = keyArray.slice(startSlice, endSlice);\r\n for (let key of keyArray) {\r\n if (key === '-' && isArray(subObject) && subObject.length) {\r\n key = subObject.length - 1;\r\n }\r\n if (isMap(subObject) && subObject.has(key)) {\r\n subObject = subObject.get(key);\r\n } else if (typeof subObject === 'object' && subObject !== null &&\r\n hasOwn(subObject, key)\r\n ) {\r\n subObject = subObject[key];\r\n } else {\r\n const evaluatedExpression = JsonPointer.evaluateExpression(subObject, key);\r\n if (evaluatedExpression.passed) {\r\n subObject = evaluatedExpression.key ? subObject[evaluatedExpression.key] : subObject;\r\n } else {\r\n this.logErrors(errors, key, pointer, object);\r\n return getBoolean ? false : undefined;\r\n }\r\n }\r\n }\r\n return getBoolean ? true : subObject;\r\n }\r\n if (errors && keyArray === null) {\r\n console.error(`get error: Invalid JSON Pointer: ${pointer}`);\r\n }\r\n if (errors && typeof object !== 'object') {\r\n console.error('get error: Invalid object:');\r\n console.error(object);\r\n }\r\n return getBoolean ? false : undefined;\r\n }\r\n\r\n private static logErrors(errors, key, pointer, object) {\r\n if (errors) {\r\n console.error(`get error: \"${key}\" key not found in object.`);\r\n console.error(pointer);\r\n console.error(object);\r\n }\r\n }\r\n\r\n /**\r\n * Evaluates conditional expression in form of `model.<property>==<value>` or\r\n * `model.<property>!=<value>` where the first one means that the value must match to be\r\n * shown in a form, while the former shows the property only when the property value is not\r\n * set, or does not equal the given value.\r\n *\r\n * // { subObject } subObject - an object containing the data values of properties\r\n * // { key } key - the key from the for loop in a form of `<property>==<value>`\r\n *\r\n * Returns the object with two properties. The property passed informs whether\r\n * the expression evaluated successfully and the property key returns either the same\r\n * key if it is not contained inside the subObject or the key of the property if it is contained.\r\n */\r\n static evaluateExpression(subObject: Object, key: any) {\r\n const defaultResult = {passed: false, key: key};\r\n const keysAndExpression = this.parseKeysAndExpression(key, subObject);\r\n if (!keysAndExpression) {\r\n return defaultResult;\r\n }\r\n\r\n const ownCheckResult = this.doOwnCheckResult(subObject, keysAndExpression);\r\n if (ownCheckResult) {\r\n return ownCheckResult;\r\n }\r\n\r\n const cleanedValue = cleanValueOfQuotes(keysAndExpression.keyAndValue[1]);\r\n\r\n const evaluatedResult = this.performExpressionOnValue(keysAndExpression, cleanedValue, subObject);\r\n if (evaluatedResult) {\r\n return evaluatedResult;\r\n }\r\n\r\n return defaultResult;\r\n }\r\n\r\n /**\r\n * Performs the actual evaluation on the given expression with given values and keys.\r\n * // { cleanedValue } cleanedValue - the given valued cleaned of quotes if it had any\r\n * // { subObject } subObject - the object with properties values\r\n * // { keysAndExpression } keysAndExpression - an object holding the expressions with\r\n */\r\n private static performExpressionOnValue(keysAndExpression: any, cleanedValue: String, subObject: Object) {\r\n const propertyByKey = subObject[keysAndExpression.keyAndValue[0]];\r\n if (this.doComparisonByExpressionType(keysAndExpression.expressionType, propertyByKey, cleanedValue)) {\r\n return {passed: true, key: keysAndExpression.keyAndValue[0]};\r\n }\r\n\r\n return null;\r\n }\r\n\r\n private static doComparisonByExpressionType(expressionType: ExpressionType, propertyByKey, cleanedValue: String): Boolean {\r\n if (isEqual(expressionType)) {\r\n return propertyByKey === cleanedValue;\r\n }\r\n if (isNotEqual(expressionType)) {\r\n return propertyByKey !== cleanedValue;\r\n }\r\n return false;\r\n }\r\n\r\n /**\r\n * Does the checks when the parsed key is actually no a property inside subObject.\r\n * That would mean that the equal comparison makes no sense and thus the negative result\r\n * is returned, and the not equal comparison is not necessary because it doesn't equal\r\n * obviously. Returns null when the given key is a real property inside the subObject.\r\n * // { subObject } subObject - the object with properties values\r\n * // { keysAndExpression } keysAndExpression - an object holding the expressions with\r\n * the associated keys.\r\n */\r\n private static doOwnCheckResult(subObject: Object, keysAndExpression) {\r\n let ownCheckResult = null;\r\n if (!hasOwn(subObject, keysAndExpression.keyAndValue[0])) {\r\n if (isEqual(keysAndExpression.expressionType)) {\r\n ownCheckResult = {passed: false, key: null};\r\n }\r\n if (isNotEqual(keysAndExpression.expressionType)) {\r\n ownCheckResult = {passed: true, key: null};\r\n }\r\n }\r\n return ownCheckResult;\r\n }\r\n\r\n /**\r\n * Does the basic checks and tries to parse an expression and a pair\r\n * of key and value.\r\n * // { key } key - the original for loop created value containing key and value in one string\r\n * // { subObject } subObject - the object with properties values\r\n */\r\n private static parseKeysAndExpression(key: string, subObject) {\r\n if (this.keyOrSubObjEmpty(key, subObject)) {\r\n return null;\r\n }\r\n const expressionType = getExpressionType(key.toString());\r\n if (isNotExpression(expressionType)) {\r\n return null;\r\n }\r\n const keyAndValue = getKeyAndValueByExpressionType(expressionType, key);\r\n if (!keyAndValue || !keyAndValue[0] || !keyAndValue[1]) {\r\n return null;\r\n }\r\n return {expressionType: expressionType, keyAndValue: keyAndValue};\r\n }\r\n\r\n private static keyOrSubObjEmpty(key: any, subObject: Object) {\r\n return !key || !subObject;\r\n }\r\n\r\n /**\r\n * 'getCopy' function\r\n *\r\n * Uses a JSON Pointer to deeply clone a value from an object.\r\n *\r\n * // { object } object - Object to get value from\r\n * // { Pointer } pointer - JSON Pointer (string or array)\r\n * // { number = 0 } startSlice - Zero-based index of first Pointer key to use\r\n * // { number } endSlice - Zero-based index of last Pointer key to use\r\n * // { boolean = false } getBoolean - Return only true or false?\r\n * // { boolean = false } errors - Show error if not found?\r\n * // { object } - Located value (or true or false if getBoolean = true)\r\n */\r\n static getCopy(\r\n object, pointer, startSlice = 0, endSlice: number = null,\r\n getBoolean = false, errors = false\r\n ) {\r\n const objectToCopy =\r\n this.get(object, pointer, startSlice, endSlice, getBoolean, errors);\r\n return this.forEachDeepCopy(objectToCopy);\r\n }\r\n\r\n /**\r\n * 'getFirst' function\r\n *\r\n * Takes an array of JSON Pointers and objects,\r\n * checks each object for a value specified by the pointer,\r\n * and returns the first value found.\r\n *\r\n * // { [object, pointer][] } items - Array of objects and pointers to check\r\n * // { any = null } defaultValue - Value to return if nothing found\r\n * // { boolean = false } getCopy - Return a copy instead?\r\n * // - First value found\r\n */\r\n static getFirst(items, defaultValue: any = null, getCopy = false) {\r\n if (isEmpty(items)) { return; }\r\n if (isArray(items)) {\r\n for (const item of items) {\r\n if (isEmpty(item)) { continue; }\r\n if (isArray(item) && item.length >= 2) {\r\n if (isEmpty(item[0]) || isEmpty(item[1])) { continue; }\r\n const value = getCopy ?\r\n this.getCopy(item[0], item[1]) :\r\n this.get(item[0], item[1]);\r\n if (value) { return value; }\r\n continue;\r\n }\r\n console.error('getFirst error: Input not in correct format.\\n' +\r\n 'Should be: [ [ object1, pointer1 ], [ object 2, pointer2 ], etc... ]');\r\n return;\r\n }\r\n return defaultValue;\r\n }\r\n if (isMap(items)) {\r\n for (const [object, pointer] of items) {\r\n if (object === null || !this.isJsonPointer(pointer)) { continue; }\r\n const value = getCopy ?\r\n this.getCopy(object, pointer) :\r\n this.get(object, pointer);\r\n if (value) { return value; }\r\n }\r\n return defaultValue;\r\n }\r\n console.error('getFirst error: Input not in correct format.\\n' +\r\n 'Should be: [ [ object1, pointer1 ], [ object 2, pointer2 ], etc... ]');\r\n return defaultValue;\r\n }\r\n\r\n /**\r\n * 'getFirstCopy' function\r\n *\r\n * Similar to getFirst, but always returns a copy.\r\n *\r\n * // { [object, pointer][] } items - Array of objects and pointers to check\r\n * // { any = null } defaultValue - Value to return if nothing found\r\n * // - Copy of first value found\r\n */\r\n static getFirstCopy(items, defaultValue: any = null) {\r\n const firstCopy = this.getFirst(items, defaultValue, true);\r\n return firstCopy;\r\n }\r\n\r\n /**\r\n * 'set' function\r\n *\r\n * Uses a JSON Pointer to set a value on an object.\r\n * Also creates any missing sub objects or arrays to contain that value.\r\n *\r\n * If the optional fourth parameter is TRUE and the inner-most container\r\n * is an array, the function will insert the value as a new item at the\r\n * specified location in the array, rather than overwriting the existing\r\n * value (if any) at that location.\r\n *\r\n * So set([1, 2, 3], '/1', 4) => [1, 4, 3]\r\n * and\r\n * So set([1, 2, 3], '/1', 4, true) => [1, 4, 2, 3]\r\n *\r\n * // { object } object - The object to set value in\r\n * // { Pointer } pointer - The JSON Pointer (string or array)\r\n * // value - The new value to set\r\n * // { boolean } insert - insert value?\r\n * // { object } - The original object, modified with the set value\r\n */\r\n static set(object, pointer, value, insert = false) {\r\n const keyArray = this.parse(pointer);\r\n if (keyArray !== null && keyArray.length) {\r\n let subObject = object;\r\n for (let i = 0; i < keyArray.length - 1; ++i) {\r\n let key = keyArray[i];\r\n if (key === '-' && isArray(subObject)) {\r\n key = subObject.length;\r\n }\r\n if (isMap(subObject) && subObject.has(key)) {\r\n subObject = subObject.get(key);\r\n } else {\r\n if (!hasOwn(subObject, key)) {\r\n subObject[key] = (keyArray[i + 1].match(/^(\\d+|-)$/)) ? [] : {};\r\n }\r\n subObject = subObject[key];\r\n }\r\n }\r\n const lastKey = keyArray[keyArray.length - 1];\r\n if (isArray(subObject) && lastKey === '-') {\r\n subObject.push(value);\r\n } else if (insert && isArray(subObject) && !isNaN(+lastKey)) {\r\n subObject.splice(lastKey, 0, value);\r\n } else if (isMap(subObject)) {\r\n subObject.set(lastKey, value);\r\n } else {\r\n subObject[lastKey] = value;\r\n }\r\n return object;\r\n }\r\n console.error(`set error: Invalid JSON Pointer: ${pointer}`);\r\n return object;\r\n }\r\n\r\n /**\r\n * 'setCopy' function\r\n *\r\n * Copies an object and uses a JSON Pointer to set a value on the copy.\r\n * Also creates any missing sub objects or arrays to contain that value.\r\n *\r\n * If the optional fourth parameter is TRUE and the inner-most container\r\n * is an array, the function will insert the value as a new item at the\r\n * specified location in the array, rather than overwriting the existing value.\r\n *\r\n * // { object } object - The object to copy and set value in\r\n * // { Pointer } pointer - The JSON Pointer (string or array)\r\n * // value - The value to set\r\n * // { boolean } insert - insert value?\r\n * // { object } - The new object with the set value\r\n */\r\n static setCopy(object, pointer, value, insert = false) {\r\n const keyArray = this.parse(pointer);\r\n if (keyArray !== null) {\r\n const newObject = copy(object);\r\n let subObject = newObject;\r\n for (let i = 0; i < keyArray.length - 1; ++i) {\r\n let key = keyArray[i];\r\n if (key === '-' && isArray(subObject)) {\r\n key = subObject.length;\r\n }\r\n if (isMap(subObject) && subObject.has(key)) {\r\n subObject.set(key, copy(subObject.get(key)));\r\n subObject = subObject.get(key);\r\n } else {\r\n if (!hasOwn(subObject, key)) {\r\n subObject[key] = (keyArray[i + 1].match(/^(\\d+|-)$/)) ? [] : {};\r\n }\r\n subObject[key] = copy(subObject[key]);\r\n subObject = subObject[key];\r\n }\r\n }\r\n const lastKey = keyArray[keyArray.length - 1];\r\n if (isArray(subObject) && lastKey === '-') {\r\n subObject.push(value);\r\n } else if (insert && isArray(subObject) && !isNaN(+lastKey)) {\r\n subObject.splice(lastKey, 0, value);\r\n } else if (isMap(subObject)) {\r\n subObject.set(lastKey, value);\r\n } else {\r\n subObject[lastKey] = value;\r\n }\r\n return newObject;\r\n }\r\n console.error(`setCopy error: Invalid JSON Pointer: ${pointer}`);\r\n return object;\r\n }\r\n\r\n /**\r\n * 'insert' function\r\n *\r\n * Calls 'set' with insert = TRUE\r\n *\r\n * // { object } object - object to insert value in\r\n * // { Pointer } pointer - JSON Pointer (string or array)\r\n * // value - value to insert\r\n * // { object }\r\n */\r\n static insert(object, pointer, value) {\r\n const updatedObject = this.set(object, pointer, value, true);\r\n return updatedObject;\r\n }\r\n\r\n /**\r\n * 'insertCopy' function\r\n *\r\n * Calls 'setCopy' with insert = TRUE\r\n *\r\n * // { object } object - object to insert value in\r\n * // { Pointer } pointer - JSON Pointer (string or array)\r\n * // value - value to insert\r\n * // { object }\r\n */\r\n static insertCopy(object, pointer, value) {\r\n const updatedObject = this.setCopy(object, pointer, value, true);\r\n return updatedObject;\r\n }\r\n\r\n /**\r\n * 'remove' function\r\n *\r\n * Uses a JSON Pointer to remove a key and its attribute from an object\r\n *\r\n * // { object } object - object to delete attribute from\r\n * // { Pointer } pointer - JSON Pointer (string or array)\r\n * // { object }\r\n */\r\n static remove(object, pointer) {\r\n const keyArray = this.parse(pointer);\r\n if (keyArray !== null && keyArray.length) {\r\n let lastKey = keyArray.pop();\r\n const parentObject = this.get(object, keyArray);\r\n if (isArray(parentObject)) {\r\n if (lastKey === '-') { lastKey = parentObject.length - 1; }\r\n parentObject.splice(lastKey, 1);\r\n } else if (isObject(parentObject)) {\r\n delete parentObject[lastKey];\r\n }\r\n return object;\r\n }\r\n console.error(`remove error: Invalid JSON Pointer: ${pointer}`);\r\n return object;\r\n }\r\n\r\n /**\r\n * 'has' function\r\n *\r\n * Tests if an object has a value at the location specified by a JSON Pointer\r\n *\r\n * // { object } object - object to chek for value\r\n * // { Pointer } pointer - JSON Pointer (string or array)\r\n * // { boolean }\r\n */\r\n static has(object, pointer) {\r\n const hasValue = this.get(object, pointer, 0, null, true);\r\n return hasValue;\r\n }\r\n\r\n /**\r\n * 'dict' function\r\n *\r\n * Returns a (pointer -> value) dictionary for an object\r\n *\r\n * // { object } object - The object to create a dictionary from\r\n * // { object } - The resulting dictionary object\r\n */\r\n static dict(object) {\r\n const results: any = {};\r\n this.forEachDeep(object, (value, pointer) => {\r\n if (typeof value !== 'object') { results[pointer] = value; }\r\n });\r\n return results;\r\n }\r\n\r\n /**\r\n * 'forEachDeep' function\r\n *\r\n * Iterates over own enumerable properties of an object or items in an array\r\n * and invokes an iteratee function for each key/value or index/value pair.\r\n * By default, iterates over items within objects and arrays after calling\r\n * the iteratee function on the containing object or array itself.\r\n *\r\n * The iteratee is invoked with three arguments: (value, pointer, rootObject),\r\n * where pointer is a JSON pointer indicating the location of the current\r\n * value within the root object, and rootObject is the root object initially\r\n * submitted to th function.\r\n *\r\n * If a third optional parameter 'bottomUp' is set to TRUE, the iterator\r\n * function will be called on sub-objects and arrays after being\r\n * called on their contents, rather than before, which is the default.\r\n *\r\n * This function can also optionally be called directly on a sub-object by\r\n * including optional 4th and 5th parameterss to specify the initial\r\n * root object and pointer.\r\n *\r\n * // { object } object - the initial object or array\r\n * // { (v: any, p?: string, o?: any) => any } function - iteratee function\r\n * // { boolean = false } bottomUp - optional, set to TRUE to reverse direction\r\n * // { object = object } rootObject - optional, root object or array\r\n * // { string = '' } pointer - optional, JSON Pointer to object within rootObject\r\n * // { object } - The modified object\r\n */\r\n static forEachDeep(\r\n object, fn: (v: any, p?: string, o?: any) => any = (v) => v,\r\n bottomUp = false, pointer = '', rootObject = object\r\n ) {\r\n if (typeof fn !== 'function') {\r\n console.error(`forEachDeep error: Iterator is not a function:`, fn);\r\n return;\r\n }\r\n if (!bottomUp) { fn(object, pointer, rootObject); }\r\n if (isObject(object) || isArray(object)) {\r\n for (const key of Object.keys(object)) {\r\n const newPointer = pointer + '/' + this.escape(key);\r\n this.forEachDeep(object[key], fn, bottomUp, newPointer, rootObject);\r\n }\r\n }\r\n if (bottomUp) { fn(object, pointer, rootObject); }\r\n }\r\n\r\n /**\r\n * 'forEachDeepCopy' function\r\n *\r\n * Similar to forEachDeep, but returns a copy of the original object, with\r\n * the same keys and indexes, but with values replaced with the result of\r\n * the iteratee function.\r\n *\r\n * // { object } object - the initial object or array\r\n * // { (v: any, k?: string, o?: any, p?: any) => any } function - iteratee function\r\n * // { boolean = false } bottomUp - optional, set to TRUE to reverse direction\r\n * // { object = object } rootObject - optional, root object or array\r\n * // { string = '' } pointer - optional, JSON Pointer to object within rootObject\r\n * // { object } - The copied object\r\n */\r\n static forEachDeepCopy(\r\n object, fn: (v: any, p?: string, o?: any) => any = (v) => v,\r\n bottomUp = false, pointer = '', rootObject = object\r\n ) {\r\n if (typeof fn !== 'function') {\r\n console.error(`forEachDeepCopy error: Iterator is not a function:`, fn);\r\n return null;\r\n }\r\n if (isObject(object) || isArray(object)) {\r\n let newObject = isArray(object) ? [ ...object ] : { ...object };\r\n if (!bottomUp) { newObject = fn(newObject, pointer, rootObject); }\r\n for (const key of Object.keys(newObject)) {\r\n const newPointer = pointer + '/' + this.escape(key);\r\n newObject[key] = this.forEachDeepCopy(\r\n newObject[key], fn, bottomUp, newPointer, rootObject\r\n );\r\n }\r\n if (bottomUp) { newObject = fn(newObject, pointer, rootObject); }\r\n return newObject;\r\n } else {\r\n return fn(object, pointer, rootObject);\r\n }\r\n }\r\n\r\n /**\r\n * 'escape' function\r\n *\r\n * Escapes a string reference key\r\n *\r\n * // { string } key - string key to escape\r\n * // { string } - escaped key\r\n */\r\n static escape(key) {\r\n const escaped = key.toString().replace(/~/g, '~0').replace(/\\//g, '~1');\r\n return escaped;\r\n }\r\n\r\n /**\r\n * 'unescape' function\r\n *\r\n * Unescapes a string reference key\r\n *\r\n * // { string } key - string key to unescape\r\n * // { string } - unescaped key\r\n */\r\n static unescape(key) {\r\n const unescaped = key.toString().replace(/~1/g, '/').replace(/~0/g, '~');\r\n return unescaped;\r\n }\r\n\r\n /**\r\n * 'parse' function\r\n *\r\n * Converts a string JSON Pointer into a array of keys\r\n * (if input is already an an array of keys, it is returned unchanged)\r\n *\r\n * // { Pointer } pointer - JSON Pointer (string or array)\r\n * // { boolean = false } errors - Show error if invalid pointer?\r\n * // { string[] } - JSON Pointer array of keys\r\n */\r\n static parse(pointer, errors = false) {\r\n if (!this.isJsonPointer(pointer)) {\r\n if (errors) { console.error(`parse error: Invalid JSON Pointer: ${pointer}`); }\r\n return null;\r\n }\r\n if (isArray(pointer)) { return <string[]>pointer; }\r\n if (typeof pointer === 'string') {\r\n if ((<string>pointer)[0] === '#') { pointer = pointer.slice(1); }\r\n if (<string>pointer === '' || <string>pointer === '/') { return []; }\r\n return (<string>pointer).slice(1).split('/').map(this.unescape);\r\n }\r\n }\r\n\r\n /**\r\n * 'compile' function\r\n *\r\n * Converts an array of keys into a JSON Pointer string\r\n * (if input is already a string, it is normalized and returned)\r\n *\r\n * The optional second parameter is a default which will replace any empty keys.\r\n *\r\n * // { Pointer } pointer - JSON Pointer (string or array)\r\n * // { string | number = '' } defaultValue - Default value\r\n * // { boolean = false } errors - Show error if invalid pointer?\r\n * // { string } - JSON Pointer string\r\n */\r\n static compile(pointer, defaultValue = '', errors = false) {\r\n if (pointer === '#') { return ''; }\r\n if (!this.isJsonPointer(pointer)) {\r\n if (errors) { console.error(`compile error: Invalid JSON Pointer: ${pointer}`); }\r\n return null;\r\n }\r\n if (isArray(pointer)) {\r\n if ((<string[]>pointer).length === 0) { return ''; }\r\n return '/' + (<string[]>pointer).map(\r\n key => key === '' ? defaultValue : this.escape(key)\r\n ).join('/');\r\n }\r\n if (typeof pointer === 'string') {\r\n if (pointer[0] === '#') { pointer = pointer.slice(1); }\r\n return pointer;\r\n }\r\n }\r\n\r\n /**\r\n * 'toKey' function\r\n *\r\n * Extracts name of the final key from a JSON Pointer.\r\n *\r\n * // { Pointer } pointer - JSON Pointer (string or array)\r\n * // { boolean = false } errors - Show error if invalid pointer?\r\n * // { string } - the extracted key\r\n */\r\n static toKey(pointer, errors = false) {\r\n const keyArray = this.parse(pointer, errors);\r\n if (keyArray === null) { return null; }\r\n if (!keyArray.length) { return ''; }\r\n return keyArray[keyArray.length - 1];\r\n }\r\n\r\n /**\r\n * 'isJsonPointer' function\r\n *\r\n * Checks a string or array value to determine if it is a valid JSON Pointer.\r\n * Returns true if a string is empty, or starts with '/' or '#/'.\r\n * Returns true if an array contains only string values.\r\n *\r\n * // value - value to check\r\n * // { boolean } - true if value is a valid JSON Pointer, otherwise false\r\n */\r\n static isJsonPointer(value) {\r\n if (isArray(value)) {\r\n return value.every(key => typeof key === 'string');\r\n } else if (isString(value)) {\r\n if (value === '' || value === '#') { return true; }\r\n if (value[0] === '/' || value.slice(0, 2) === '#/') {\r\n return !/(~[^01]|~$)/g.test(value);\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n /**\r\n * 'isSubPointer' function\r\n *\r\n * Checks whether one JSON Pointer is a subset of another.\r\n *\r\n * // { Pointer } shortPointer - potential subset JSON Pointer\r\n * // { Pointer } longPointer - potential superset JSON Pointer\r\n * // { boolean = false } trueIfMatching - return true if pointers match?\r\n * // { boolean = false } errors - Show error if invalid pointer?\r\n * // { boolean } - true if shortPointer is a subset of longPointer, false if not\r\n */\r\n static isSubPointer(\r\n shortPointer, longPointer, trueIfMatching = false, errors = false\r\n ) {\r\n if (!this.isJsonPointer(shortPointer) || !this.isJsonPointer(longPointer)) {\r\n if (errors) {\r\n let invalid = '';\r\n if (!this.isJsonPointer(shortPointer)) { invalid += ` 1: ${shortPointer}`; }\r\n if (!this.isJsonPointer(longPointer)) { invalid += ` 2: ${longPointer}`; }\r\n console.error(`isSubPointer error: Invalid JSON Pointer ${invalid}`);\r\n }\r\n return;\r\n }\r\n shortPointer = this.compile(shortPointer, '', errors);\r\n longPointer = this.compile(longPointer, '', errors);\r\n return shortPointer === longPointer ? trueIfMatching :\r\n `${shortPointer}/` === longPointer.slice(0, shortPointer.length + 1);\r\n }\r\n\r\n /**\r\n * 'toIndexedPointer' function\r\n *\r\n * Merges an array of numeric indexes and a generic pointer to create an\r\n * indexed pointer for a specific item.\r\n *\r\n * For example, merging the generic pointer '/foo/-/bar/-/baz' and\r\n * the array [4, 2] would result in the indexed pointer '/foo/4/bar/2/baz'\r\n *\r\n *\r\n * // { Pointer } genericPointer - The generic pointer\r\n * // { number[] } indexArray - The array of numeric indexes\r\n * // { Map<string, number> } arrayMap - An optional array map\r\n * // { string } - The merged pointer with indexes\r\n */\r\n static toIndexedPointer(\r\n genericPointer, indexArray, arrayMap: Map<string, number> = null\r\n ) {\r\n if (this.isJsonPointer(genericPointer) && isArray(indexArray)) {\r\n let indexedPointer = this.compile(genericPointer);\r\n if (isMap(arrayMap)) {\r\n let arrayIndex = 0;\r\n return indexedPointer.replace(/\\/\\-(?=\\/|$)/g, (key, stringIndex) =>\r\n arrayMap.has((<string>indexedPointer).slice(0, stringIndex)) ?\r\n '/' + indexArray[arrayIndex++] : key\r\n );\r\n } else {\r\n for (const pointerIndex of indexArray) {\r\n indexedPointer = indexedPointer.replace('/-', '/' + pointerIndex);\r\n }\r\n return indexedPointer;\r\n }\r\n }\r\n if (!this.isJsonPointer(genericPointer)) {\r\n console.error(`toIndexedPointer error: Invalid JSON Pointer: ${genericPointer}`);\r\n }\r\n if (!isArray(indexArray)) {\r\n console.error(`toIndexedPointer error: Invalid indexArray: ${indexArray}`);\r\n }\r\n }\r\n\r\n /**\r\n * 'toGenericPointer' function\r\n *\r\n * Compares an indexed pointer to an array map and removes list array\r\n * indexes (but leaves tuple arrray indexes and all object keys, including\r\n * numeric keys) to create a generic pointer.\r\n *\r\n * For example, using the indexed pointer '/foo/1/bar/2/baz/3' and\r\n * the arrayMap [['/foo', 0], ['/foo/-/bar', 3], ['/foo/-/bar/-/baz', 0]]\r\n * would result in the generic pointer '/foo/-/bar/2/baz/-'\r\n * Using the indexed pointer '/foo/1/bar/4/baz/3' and the same arrayMap\r\n * would result in the generic pointer '/foo/-/bar/-/baz/-'\r\n * (the bar array has 3 tuple items, so index 2 is retained, but 4 is removed)\r\n *\r\n * The structure of the arrayMap is: [['path to array', number of tuple items]...]\r\n *\r\n *\r\n * // { Pointer } indexedPointer - The indexed pointer (array or string)\r\n * // { Map<string, number> } arrayMap - The optional array map (for preserving tuple indexes)\r\n * // { string } - The generic pointer with indexes removed\r\n */\r\n static toGenericPointer(indexedPointer, arrayMap = new Map<string, number>()) {\r\n if (this.isJsonPointer(indexedPointer) && isMap(arrayMap)) {\r\n const pointerArray = this.parse(indexedPointer);\r\n for (let i = 1; i < pointerArray.length; i++) {\r\n const subPointer = this.compile(pointerArray.slice(0, i));\r\n if (arrayMap.has(subPointer) &&\r\n arrayMap.get(subPointer) <= +pointerArray[i]\r\n ) {\r\n pointerArray[i] = '-';\r\n }\r\n }\r\n return this.compile(pointerArray);\r\n }\r\n if (!this.isJsonPointer(indexedPointer)) {\r\n console.error(`toGenericPointer error: invalid JSON Pointer: ${indexedPointer}`);\r\n }\r\n if (!isMap(arrayMap)) {\r\n console.error(`toGenericPointer error: invalid arrayMap: ${arrayMap}`);\r\n }\r\n }\r\n\r\n /**\r\n * 'toControlPointer' function\r\n *\r\n * Accepts a JSON Pointer for a data object and returns a JSON Pointer for the\r\n * matching control in an Angular FormGroup.\r\n *\r\n * // { Pointer } dataPointer - JSON Pointer (string or array) to a data object\r\n * // { FormGroup } formGroup - Angular FormGroup to get value from\r\n * // { boolean = false } controlMustExist - Only return if control exists?\r\n * // { Pointer } - JSON Pointer (string) to the formGroup object\r\n */\r\n static toControlPointer(dataPointer, formGroup, controlMustExist = false) {\r\n const dataPointerArray = this.parse(dataPointer);\r\n const controlPointerArray: string[] = [];\r\n let subGroup = formGroup;\r\n if (dataPointerArray !== null) {\r\n for (const key of dataPointerArray) {\r\n if (hasOwn(subGroup, 'controls')) {\r\n controlPointerArray.push('controls');\r\n subGroup = subGroup.controls;\r\n }\r\n if (isArray(subGroup) && (key === '-')) {\r\n controlPointerArray.push((subGroup.length - 1).toString());\r\n subGroup = subGroup[subGroup.length - 1];\r\n } else if (hasOwn(subGroup, key)) {\r\n controlPointerArray.push(key);\r\n subGroup = subGroup[key];\r\n } else if (controlMustExist) {\r\n console.error(`toControlPointer error: Unable to find \"${key}\" item in FormGroup.`);\r\n console.error(dataPointer);\r\n console.error(formGroup);\r\n return;\r\n } else {\r\n controlPointerArray.push(key);\r\n subGroup = { controls: {} };\r\n }\r\n }\r\n return this.compile(controlPointerArray);\r\n }\r\n console.error(`toControlPointer error: Invalid JSON Pointer: ${dataPointer}`);\r\n }\r\n\r\n /**\r\n * 'toSchemaPointer' function\r\n *\r\n * Accepts a JSON Pointer to a value inside a data object and a JSON schema\r\n * for that object.\r\n *\r\n * Returns a Pointer to the sub-schema for the value inside the object's schema.\r\n *\r\n * // { Pointer } dataPointer - JSON Pointer (string or array) to an object\r\n * // schema - JSON schema for the object\r\n * // { Pointer } - JSON Pointer (string) to the object's schema\r\n */\r\n static toSchemaPointer(dataPointer, schema) {\r\n if (this.isJsonPointer(dataPointer) && typeof schema === 'object') {\r\n const pointerArray = this.parse(dataPointer);\r\n if (!pointerArray.length) { return ''; }\r\n const firstKey = pointerArray.shift();\r\n if (schema.type === 'object' || schema.properties || schema.additionalProperties) {\r\n if ((schema.properties || {})[firstKey]) {\r\n return `/properties/${this.escape(firstKey)}` +\r\n this.toSchemaPointer(pointerArray, schema.properties[firstKey]);\r\n } else if (schema.additionalProperties) {\r\n return '/additionalProperties' +\r\n this.toSchemaPointer(pointerArray, schema.additionalProperties);\r\n }\r\n }\r\n if ((schema.type === 'array' || schema.items) &&\r\n (isNumber(firstKey) || firstKey === '-' || firstKey === '')\r\n ) {\r\n const arrayItem = firstKey === '-' || firstKey === '' ? 0 : +firstKey;\r\n if (isArray(schema.items)) {\r\n if (arrayItem < schema.items.length) {\r\n return '/items/' + arrayItem +\r\n this.toSchemaPointer(pointerArray, schema.items[arrayItem]);\r\n } else if (schema.additionalItems) {\r\n return '/additionalItems' +\r\n this.toSchemaPointer(pointerArray, schema.additionalItems);\r\n }\r\n } else if (isObject(schema.items)) {\r\n return '/items' + this.toSchemaPointer(pointerArray, schema.items);\r\n } else if (isObject(schema.additionalItems)) {\r\n return '/additionalItems' +\r\n this.toSchemaPointer(pointerArray, schema.additionalItems);\r\n }\r\n }\r\n console.error(`toSchemaPointer error: Data pointer ${dataPointer} ` +\r\n `not compatible with schema ${schema}`);\r\n return null;\r\n }\r\n if (!this.isJsonPointer(dataPointer)) {\r\n console.error(`toSchemaPointer error: Invalid JSON Pointer: ${dataPointer}`);\r\n }\r\n if (typeof schema !== 'object') {\r\n console.error(`toSchemaPointer error: Invalid JSON Schema: ${schema}`);\r\n }\r\n return null;\r\n }\r\n\r\n /**\r\n * 'toDataPointer' function\r\n *\r\n * Accepts a JSON Pointer to a sub-schema inside a JSON schema and the schema.\r\n *\r\n * If possible, returns a generic Pointer to the corresponding value inside\r\n * the data object described by the JSON schema.\r\n *\r\n * Returns null if the sub-schema is in an ambiguous location (such as\r\n * definitions or additionalProperties) where the corresponding value\r\n * location cannot be determined.\r\n *\r\n * // { Pointer } schemaPointer - JSON Pointer (string or array) to a JSON schema\r\n * // schema - the JSON schema\r\n * // { boolean = false } errors - Show errors?\r\n * // { Pointer } - JSON Pointer (string) to the value in the data object\r\n */\r\n static toDataPointer(schemaPointer, schema, errors = false) {\r\n if (this.isJsonPointer(schemaPointer) && typeof schema === 'object' &&\r\n this.has(schema, schemaPointer)\r\n ) {\r\n const pointerArray = this.parse(schemaPointer);\r\n if (!pointerArray.length) { return ''; }\r\n const firstKey = pointerArray.shift();\r\n if (firstKey === 'properties' ||\r\n (firstKey === 'items' && isArray(schema.items))\r\n ) {\r\n const secondKey = pointerArray.shift();\r\n const pointerSuffix = this.toDataPointer(pointerArray, schema[firstKey][secondKey]);\r\n return pointerSuffix === null ? null : '/' + secondKey + pointerSuffix;\r\n } else if (firstKey === 'additionalItems' ||\r\n (firstKey === 'items' && isObject(schema.items))\r\n ) {\r\n const pointerSuffix = this.toDataPointer(pointerArray, schema[firstKey]);\r\n return pointerSuffix === null ? null : '/-' + pointerSuffix;\r\n } else if (['allOf', 'anyOf', 'oneOf'].includes(firstKey)) {\r\n const secondKey = pointerArray.shift();\r\n return this.toDataPointer(pointerArray, schema[firstKey][secondKey]);\r\n } else if (firstKey === 'not') {\r\n return this.toDataPointer(pointerArray, schema[firstKey]);\r\n } else if (['contains', 'definitions', 'dependencies', 'additionalItems',\r\n 'additionalProperties', 'patternProperties', 'propertyNames'].includes(firstKey)\r\n ) {\r\n if (errors) { console.error(`toDataPointer error: Ambiguous location`); }\r\n }\r\n return '';\r\n }\r\n if (errors) {\r\n if (!this.isJsonPointer(schemaPointer)) {\r\n console.error(`toDataPointer error: Invalid JSON Pointer: ${schemaPointer}`);\r\n }\r\n if (typeof schema !== 'object') {\r\n console.error(`toDataPointer error: Invalid JSON Schema: ${schema}`);\r\n }\r\n if (typeof schema !== 'object') {\r\n console.error(`toDataPointer error: Pointer ${schemaPointer} invalid for Schema: ${schema}`);\r\n }\r\n }\r\n return null;\r\n }\r\n\r\n /**\r\n * 'parseObjectPath' function\r\n *\r\n * Parses a JavaScript object path into an array of keys, which\r\n * can then be passed to compile() to convert into a string JSON Pointer.\r\n *\r\n * Based on mike-marcacci's excellent objectpath parse function:\r\n * https://github.com/mike-marcacci/objectpath\r\n *\r\n * // { Pointer } path - The object path to parse\r\n * // { string[] } - The resulting array of keys\r\n */\r\n static parseObjectPath(path) {\r\n if (isArray(path)) { return <string[]>path; }\r\n if (this.isJsonPointer(path)) { return this.parse(path); }\r\n if (typeof path === 'string') {\r\n let index = 0;\r\n const parts: string[] = [];\r\n while (index < path.length) {\r\n const nextDot = path.indexOf('.', index);\r\n const nextOB = path.indexOf('[', index); // next open bracket\r\n if (nextDot === -1 && nextOB === -1) { // last item\r\n parts.push(path.slice(index));\r\n index = path.length;\r\n } else if (nextDot !== -1 && (nextDot < nextOB || nextOB === -1)) { // dot notation\r\n parts.push(path.slice(index, nextDot));\r\n index = nextDot + 1;\r\n } else { // bracket notation\r\n if (nextOB > index) {\r\n parts.push(path.slice(index, nextOB));\r\n index = nextOB;\r\n }\r\n const quote = path.charAt(nextOB + 1);\r\n if (quote === '\"' || quote === '\\'') { // enclosing quotes\r\n let nextCB = path.indexOf(quote + ']', nextOB); // next close bracket\r\n while (nextCB !== -1 && path.charAt(nextCB - 1) === '\\\\') {\r\n nextCB = path.indexOf(quote + ']', nextCB + 2);\r\n }\r\n if (nextCB === -1) { nextCB = path.length; }\r\n parts.push(path.slice(index + 2, nextCB)\r\n .replace(new RegExp('\\\\' + quote, 'g'), quote));\r\n index = nextCB + 2;\r\n } else { // no enclosing quotes\r\n let nextCB = path.indexOf(']', nextOB); // next close bracket\r\n if (nextCB === -1) { nextCB = path.length; }\r\n parts.push(path.slice(index + 1, nextCB));\r\n index = nextCB + 1;\r\n }\r\n if (path.charAt(index) === '.') { index++; }\r\n }\r\n }\r\n return parts;\r\n }\r\n console.error('parseObjectPath error: Input object path must be a string.');\r\n }\r\n}\r\n","// updated from AJV fast format regular expressions:\r\n// https://github.com/epoberezkin/ajv/blob/master/lib/compile/formats.js\r\n\r\nexport const jsonSchemaFormatTests = {\r\n\r\n 'date': /^\\d\\d\\d\\d-[0-1]\\d-[0-3]\\d$/,\r\n\r\n 'time': /^[0-2]\\d:[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:z|[+-]\\d\\d:\\d\\d)?$/i,\r\n\r\n // Modified to allow incomplete entries, such as\r\n // \"2000-03-14T01:59:26.535\" (needs \"Z\") or \"2000-03-14T01:59\" (needs \":00Z\")\r\n 'date-time': /^\\d\\d\\d\\d-[0-1]\\d-[0-3]\\d[t\\s][0-2]\\d:[0-5]\\d(?::[0-5]\\d)?(?:\\.\\d+)?(?:z|[+-]\\d\\d:\\d\\d)?$/i,\r\n\r\n // \"2000-03-14T01:59:26.535\" (doesn't need \"Z\") or \"2000-03-14T01:59\" (needs \":00Z\")\r\n //'iso-date-time':^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(Z|([+-]\\d{2}:\\d{2}))?$\r\n //for now same as 'date-time' until better tested\r\n 'iso-date-time': /^\\d\\d\\d\\d-[0-1]\\d-[0-3]\\d[t\\s][0-2]\\d:[0-5]\\d(?::[0-5]\\d)?(?:\\.\\d+)?(?:z|[+-]\\d\\d:\\d\\d)?$/i,\r\n\r\n // email (sources from jsen validator):\r\n // http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address#answer-8829363\r\n // http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'willful violation')\r\n 'email': /^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,\r\n\r\n 'hostname': /^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*$/i,\r\n\r\n // optimized https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html\r\n 'ipv4': /^(?:(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)$/,\r\n\r\n // optimized http://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses\r\n // tslint:disable-next-line:max-line-length\r\n 'ipv6': /^\\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:)))(?:%.+)?\\s*$/i,\r\n\r\n // uri: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js\r\n 'uri': /^(?:[a-z][a-z0-9+-.]*)(?::|\\/)\\/?[^\\s]*$/i,\r\n\r\n // uri fragment: https://tools.ietf.org/html/rfc3986#appendix-A\r\n 'uri-reference': /^(?:(?:[a-z][a-z0-9+-.]*:)?\\/\\/)?[^\\s]*$/i,\r\n\r\n // uri-template: https://tools.ietf.org/html/rfc6570\r\n // tslint:disable-next-line:max-line-length\r\n 'uri-template': /^(?:(?:[^\\x00-\\x20\"'<>%\\\\^`{|}]|%[0-9a-f]{2})|\\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\\*)?)*\\})*$/i,\r\n\r\n // For the source: https://gist.github.com/dperini/729294\r\n // For test cases: https://mathiasbynens.be/demo/url-regex\r\n // tslint:disable-next-line:max-line-length\r\n // @todo Delete current URL in favour of the commented out URL rule when this ajv issue is fixed https://github.com/eslint/eslint/issues/7983.\r\n // tslint:disable-next-line:max-line-length\r\n // URL: /^(?:(?:https?|ftp):\\/\\/)(?:\\S+(?::\\S*)?@)?(?:(?!10(?:\\.\\d{1,3}){3})(?!127(?:\\.\\d{1,3}){3})(?!169\\.254(?:\\.\\d{1,3}){2})(?!192\\.168(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u{00a1}-\\u{ffff}0-9]+-?)*[a-z\\u{00a1}-\\u{ffff}0-9]+)(?:\\.(?:[a-z\\u{00a1}-\\u{ffff}0-9]+-?)*[a-z\\u{00a1}-\\u{ffff}0-9]+)*(?:\\.(?:[a-z\\u{00a1}-\\u{ffff}]{2,})))(?::\\d{2,5})?(?:\\/[^\\s]*)?$/iu,\r\n // tslint:disable-next-line:max-line-length\r\n 'url': /^(?:(?:http[s\\u017F]?|ftp):\\/\\/)(?:(?:[\\0-\\x08\\x0E-\\x1F!-\\x9F\\xA1-\\u167F\\u1681-\\u1FFF\\u200B-\\u2027\\u202A-\\u202E\\u2030-\\u205E\\u2060-\\u2FFF\\u3001-\\uD7FF\\uE000-\\uFEFE\\uFF00-\\uFFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])+(?::(?:[\\0-\\x08\\x0E-\\x1F!-\\x9F\\xA1-\\u167F\\u1681-\\u1FFF\\u200B-\\u2027\\u202A-\\u202E\\u2030-\\u205E\\u2060-\\u2FFF\\u3001-\\uD7FF\\uE000-\\uFEFE\\uFF00-\\uFFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])*)?@)?(?:(?!10(?:\\.[0-9]{1,3}){3})(?!127(?:\\.[0-9]{1,3}){3})(?!169\\.254(?:\\.[0-9]{1,3}){2})(?!192\\.168(?:\\.[0-9]{1,3}){2})(?!172\\.(?:1[6-9]|2[0-9]|3[01])(?:\\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\\xA1-\\uD7FF\\uE000-\\uFFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])+-?)*(?:[0-9KSa-z\\xA1-\\uD7FF\\uE000-\\uFFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])+)(?:\\.(?:(?:[0-9KSa-z\\xA1-\\uD7FF\\uE000-\\uFFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])+-?)*(?:[0-9KSa-z\\xA1-\\uD7FF\\uE000-\\uFFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])+)*(?:\\.(?:(?:[KSa-z\\xA1-\\uD7FF\\uE000-\\uFFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\\/(?:[\\0-\\x08\\x0E-\\x1F!-\\x9F\\xA1-\\u167F\\u1681-\\u1FFF\\u200B-\\u2027\\u202A-\\u202E\\u2030-\\u205E\\u2060-\\u2FFF\\u3001-\\uD7FF\\uE000-\\uFEFE\\uFF00-\\uFFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])*)?$/i,\r\n\r\n // uuid: http://tools.ietf.org/html/rfc4122\r\n 'uuid': /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,\r\n\r\n // optimized https://gist.github.com/olmokramer/82ccce673f86db7cda5e\r\n // tslint:disable-next-line:max-line-length\r\n 'color': /^\\s*(#(?:[\\da-f]{3}){1,2}|rgb\\((?:\\d{1,3},\\s*){2}\\d{1,3}\\)|rgba\\((?:\\d{1,3},\\s*){3}\\d*\\.?\\d+\\)|hsl\\(\\d{1,3}(?:,\\s*\\d{1,3}%){2}\\)|hsla\\(\\d{1,3}(?:,\\s*\\d{1,3}%){2},\\s*\\d*\\.?\\d+\\))\\s*$/gi,\r\n\r\n // JSON-pointer: https://tools.ietf.org/html/rfc6901\r\n 'json-pointer': /^(?:\\/(?:[^~/]|~0|~1)*)*$|^#(?:\\/(?:[a-z0-9_\\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,\r\n\r\n 'relative-json-pointer': /^(?:0|[1-9][0-9]*)(?:#|(?:\\/(?:[^~/]|~0|~1)*)*)$/,\r\n\r\n 'duration':/^P(?!$)(\\d+Y)?(\\d+M)?(\\d+D)?(T(\\d+H)?(\\d+M)?(\\d+S)?)?$/,\r\n\r\n 'regex': function (str) {\r\n if (/[^\\\\]\\\\Z/.test(str)) { return false; }\r\n try {\r\n return true;\r\n } catch (e) {\r\n return false;\r\n }\r\n }\r\n\r\n};\r\n\r\nexport type JsonSchemaFormatNames =\r\n 'date' | 'time' | 'date-time' | 'email' | 'hostname' | 'ipv4' | 'ipv6' |\r\n 'uri' | 'uri-reference' | 'uri-template' | 'url' | 'uuid' | 'color' |\r\n 'json-pointer' | 'relative-json-pointer' | 'duration' |'regex';\r\n","import { AbstractControl, ValidationErrors, ValidatorFn } from '@angular/forms';\r\nimport isEqual from 'lodash/isEqual';\r\nimport { forkJoin } from 'rxjs';\r\nimport { map } from 'rxjs/operators';\r\nimport { JsonSchemaFormatNames, jsonSchemaFormatTests } from './format-regex.constants';\r\nimport { forEachCopy } from './utility.functions';\r\nimport {\r\n _executeAsyncValidators,\r\n _executeValidators,\r\n _mergeErrors,\r\n _mergeObjects,\r\n AsyncIValidatorFn,\r\n getType,\r\n hasValue,\r\n isArray,\r\n isBoolean,\r\n isDefined,\r\n isEmpty,\r\n isNumber,\r\n isString,\r\n isType,\r\n IValidatorFn,\r\n SchemaPrimitiveType,\r\n toJavaScriptType,\r\n toObservable,\r\n xor\r\n} from './validator.functions';\r\n\r\n\r\n\r\n/**\r\n * 'JsonValidators' class\r\n *\r\n * Provides an extended set of validators to be used by form controls,\r\n * compatible with standard JSON Schema validation options.\r\n * http://json-schema.org/latest/json-schema-validation.html\r\n *\r\n * Note: This library is designed as a drop-in replacement for the Angular\r\n * Validators library, and except for one small breaking change to the 'pattern'\r\n * validator (described below) it can even be imported as a substitute, like so:\r\n *\r\n * import { JsonValidators as Validators } from 'json-validators';\r\n *\r\n * and it should work with existing code as a complete replacement.\r\n *\r\n * The one exception is the 'pattern' validator, which has been changed to\r\n * matche partial values by default (the standard 'pattern' validator wrapped\r\n * all patterns in '^' and '$', forcing them to always match an entire value).\r\n * However, the old behavior can be restored by simply adding '^' and '$'\r\n * around your patterns, or by passing an optional second parameter of TRUE.\r\n * This change is to make the 'pattern' validator match the behavior of a\r\n * JSON Schema pattern, which allows partial matches, rather than the behavior\r\n * of an HTML input control pattern, which does not.\r\n *\r\n * This library replaces Angular's validators and combination functions\r\n * with the following validators and transformation functions:\r\n *\r\n * Validators:\r\n * For all formControls: required (*), type, enum, const\r\n * For text formControls: minLength (*), maxLength (*), pattern (*), format\r\n * For numeric formControls: maximum, exclusiveMaximum,\r\n * minimum, exclusiveMinimum, multipleOf\r\n * For formGroup objects: minProperties, maxProperties, dependencies\r\n * For formArray arrays: minItems, maxItems, uniqueItems, contains\r\n * Not used by JSON Schema: min (*), max (*), requiredTrue (*), email (*)\r\n * (Validators originally included with Angular are maked with (*).)\r\n *\r\n * NOTE / TODO: The dependencies validator is not complete.\r\n * NOTE / TODO: The contains validator is not complete.\r\n *\r\n * Validators not used by JSON Schema (but included for compatibility)\r\n * and their JSON Schema equivalents:\r\n *\r\n * Angular validator | JSON Schema equivalent\r\n * ------------------|-----------------------\r\n * min(number) | minimum(number)\r\n * max(number) | maximum(number)\r\n * requiredTrue() | const(true)\r\n * email() | format('email')\r\n *\r\n * Validator transformation functions:\r\n * composeAnyOf, composeOneOf, composeAllOf, composeNot\r\n * (Angular's original combination funciton, 'compose', is also included for\r\n * backward compatibility, though it is functionally equivalent to composeAllOf,\r\n * asside from its more generic error message.)\r\n *\r\n * All validators have also been extended to accept an optional second argument\r\n * which, if passed a TRUE value, causes the validator to perform the opposite\r\n * of its original finction. (This is used internally to enable 'not' and\r\n * 'composeOneOf' to function and return useful error messages.)\r\n *\r\n * The 'required' validator has also been overloaded so that if called with\r\n * a boolean parameter (or no parameters) it returns the original validator\r\n * function (rather than executing it). However, if it is called with an\r\n * AbstractControl parameter (as was previously required), it behaves\r\n * exactly as before.\r\n *\r\n * This enables all validators (including 'required') to be constructed in\r\n * exactly the same way, so they can be automatically applied using the\r\n * equivalent key names and values taken directly from a JSON Schema.\r\n *\r\n * This source code is partially derived from Angular,\r\n * which is Copyright (c) 2014-2017 Google, Inc.\r\n * Use of this source code is therefore governed by the same MIT-style license\r\n * that can be found in the LICENSE file at https://angular.io/license\r\n *\r\n * Original Angular Validators:\r\n * https://github.com/angular/angular/blob/master/packages/forms/src/validators.ts\r\n */\r\nexport class JsonValidators {\r\n\r\n /**\r\n * Validator functions:\r\n *\r\n * For all formControls: required, type, enum, const\r\n * For text formControls: minLength, maxLength, pattern, format\r\n * For numeric formControls: maximum, exclusiveMaximum,\r\n * minimum, exclusiveMinimum, multipleOf\r\n * For formGroup objects: minProperties, maxProperties, dependencies\r\n * For formArray arrays: minItems, maxItems, uniqueItems, contains\r\n *\r\n * TODO: finish dependencies validator\r\n */\r\n\r\n /**\r\n * 'required' validator\r\n *\r\n * This validator is overloaded, compared to the default required validator.\r\n * If called with no parameters, or TRUE, this validator returns the\r\n * 'required' validator function (rather than executing it). This matches\r\n * the behavior of all other validators in this library.\r\n *\r\n * If this validator is called with an AbstractControl parameter\r\n * (as was previously required) it behaves the same as Angular's default\r\n * required validator, and returns an error if the control is empty.\r\n *\r\n * Old behavior: (if input type = AbstractControl)\r\n * // {AbstractControl} control - required control\r\n * // {{[key: string]: boolean}} - returns error message if no input\r\n *\r\n * New behavior: (if no input, or input type = boolean)\r\n * // {boolean = true} required? - true to validate, false to disable\r\n * // {IValidatorFn} - returns the 'required' validator function itself\r\n */\r\n static required(input: AbstractControl): ValidationErrors|null;\r\n static required(input?: boolean): IValidatorFn;\r\n\r\n static required(input?: AbstractControl|boolean): ValidationErrors|null|IValidatorFn {\r\n if (input === undefined) { input = true; }\r\n switch (input) {\r\n case true: // Return required function (do not execute it yet)\r\n return (control: AbstractControl, invert = false): ValidationErrors|null => {\r\n if (invert) { return null; } // if not required, always return valid\r\n return hasValue(control.value) ? null : { 'required': true };\r\n };\r\n case false: // Do nothing (if field is not required, it is always valid)\r\n return JsonValidators.nullValidator;\r\n default: // Execute required function\r\n return hasValue((<AbstractControl>input).value) ? null : { 'required': true };\r\n }\r\n }\r\n\r\n /**\r\n * 'type' validator\r\n *\r\n * Requires a control to only accept values of a specified type,\r\n * or one of an array of types.\r\n *\r\n * Note: SchemaPrimitiveType = 'string'|'number'|'integer'|'boolean'|'null'\r\n *\r\n * // {SchemaPrimitiveType|SchemaPrimitiveType[]} type - type(s) to accept\r\n * // {IValidatorFn}\r\n */\r\n static type(requiredType: SchemaPrimitiveType|SchemaPrimitiveType[]): IValidatorFn {\r\n if (!hasValue(requiredType)) { return JsonValidators.nullValidator; }\r\n return (control: AbstractControl, invert = false): ValidationErrors|null => {\r\n if (isEmpty(control.value)) { return null; }\r\n const currentValue: any = control.value;\r\n const isValid = isArray(requiredType) ?\r\n (<SchemaPrimitiveType[]>requiredType).some(type => isType(currentValue, type)) :\r\n isType(currentValue, <SchemaPrimitiveType>requiredType);\r\n return xor(isValid, invert) ?\r\n null : { 'type': { requiredType, currentValue } };\r\n };\r\n }\r\n\r\n /**\r\n * 'enum' validator\r\n *\r\n * Requires a control to have a value from an enumerated list of values.\r\n *\r\n * Converts types as needed to allow string inputs to still correctly\r\n * match number, boolean, and null enum values.\r\n *\r\n * // {any[]} allowedValues - array of acceptable values\r\n * // {IValidatorFn}\r\n */\r\n static enum(allowedValues: any[]): IValidatorFn {\r\n if (!isArray(allowedValues)) { return JsonValidators.nullValidator; }\r\n return (control: AbstractControl, invert = false): ValidationErrors|null => {\r\n if (isEmpty(control.value)) { return null; }\r\n const currentValue: any = control.value;\r\n const isEqualVal = (enumValue, inputValue) =>\r\n enumValue === inputValue ||\r\n (isNumber(enumValue) && +inputValue === +enumValue) ||\r\n (isBoolean(enumValue, 'strict') &&\r\n toJavaScriptType(inputValue, 'boolean') === enumValue) ||\r\n (enumValue === null && !hasValue(inputValue)) ||\r\n isEqual(enumValue, inputValue);\r\n const isValid = isArray(currentValue) ?\r\n currentValue.every(inputValue => allowedValues.some(enumValue =>\r\n isEqualVal(enumValue, inputValue)\r\n )) :\r\n allowedValues.some(enumValue => isEqualVal(enumValue, currentValue));\r\n return xor(isValid, invert) ?\r\n null : { 'enum': { allowedValues, currentValue } };\r\n };\r\n }\r\n\r\n /**\r\n * 'const' validator\r\n *\r\n * Requires a control to have a specific value.\r\n *\r\n * Converts types as needed to allow string inputs to still correctly\r\n * match number, boolean, and null values.\r\n *\r\n * TODO: modify to work with objects\r\n *\r\n * // {any[]} requiredValue - required value\r\n * // {IValidatorFn}\r\n */\r\n static const(requiredValue: any): IValidatorFn {\r\n if (!hasValue(requiredValue)) { return JsonValidators.nullValidator; }\r\n return (control: AbstractControl, invert = false): ValidationErrors|null => {\r\n if (isEmpty(control.value)) { return null; }\r\n const currentValue: any = control.value;\r\n const isEqualVal = (constValue, inputValue) =>\r\n constValue === inputValue ||\r\n isNumber(constValue) && +inputValue === +constValue ||\r\n isBoolean(constValue, 'strict') &&\r\n toJavaScriptType(inputValue, 'boolean') === constValue ||\r\n constValue === null && !hasValue(inputValue);\r\n const isValid = isEqualVal(requiredValue, currentValue);\r\n return xor(isValid, invert) ?\r\n null : { 'const': { requiredValue, currentValue } };\r\n };\r\n }\r\n\r\n /**\r\n * 'minLength' validator\r\n *\r\n * Requires a control's text value to be greater than a specified length.\r\n *\r\n * // {number} minimumLength - minimum allowed string length\r\n * // {boolean = false} invert - instead return error object only if valid\r\n * // {IValidatorFn}\r\n */\r\n static minLength(minimumLength: number): IValidatorFn {\r\n if (!hasValue(minimumLength)) { return JsonValidators.nullValidator; }\r\n return (control: AbstractControl, invert = false): ValidationErrors|null => {\r\n if (isEmpty(control.value)) { return null; }\r\n const currentLength = isString(control.value) ? control.value.length : 0;\r\n const isValid = currentLength >= minimumLength;\r\n return xor(isValid, invert) ?\r\n null : { 'minLength': { minimumLength, currentLength } };\r\n };\r\n }\r\n\r\n /**\r\n * 'maxLength' validator\r\n *\r\n * Requires a control's text value to be less than a specified length.\r\n *\r\n * // {number} maximumLength - maximum allowed string length\r\n * // {boolean = false} invert - instead return error object only if valid\r\n * // {IValidatorFn}\r\n */\r\n static maxLength(maximumLength: number): IValidatorFn {\r\n if (!hasValue(maximumLength)) { return JsonValidators.nullValidator; }\r\n return (control: AbstractControl, invert = false): ValidationErrors|null => {\r\n const currentLength = isString(control.value) ? control.value.length : 0;\r\n const isValid = currentLength <= maximumLength;\r\n return xor(isValid, invert) ?\r\n null : { 'maxLength': { maximumLength, currentLength } };\r\n };\r\n }\r\n\r\n /**\r\n * 'pattern' validator\r\n *\r\n * Note: NOT the same as Angular's default pattern validator.\r\n *\r\n * Requires a control's value to match a specified regular expression pattern.\r\n *\r\n * This validator changes the behavior of default pattern validator\r\n * by replacing RegExp(`^${pattern}$`) with RegExp(`${pattern}`),\r\n * which allows for partial matches.\r\n *\r\n * To return to the default funcitonality, and match the entire string,\r\n * pass TRUE as the optional second parameter.\r\n *\r\n * // {string} pattern - regular expression pattern\r\n * // {boolean = false} wholeString - match whole value string?\r\n * // {IValidatorFn}\r\n */\r\n static pattern(pattern: string|RegExp, wholeString = false): IValidatorFn {\r\n if (!hasValue(pattern)) { return JsonValidators.nullValidator; }\r\n return (control: AbstractControl, invert = false): ValidationErrors|null => {\r\n if (isEmpty(control.value)) { return null; }\r\n let regex: RegExp;\r\n let requiredPattern: string;\r\n if (typeof pattern === 'string') {\r\n requiredPattern = (wholeString) ? `^${pattern}$` : pattern;\r\n regex = new RegExp(requiredPattern);\r\n } else {\r\n requiredPattern = pattern.toString();\r\n regex = pattern;\r\n }\r\n const currentValue: string = control.value;\r\n const isValid = isString(currentValue) ? regex.test(currentValue) : false;\r\n return xor(isValid, invert) ?\r\n null : { 'pattern': { requiredPattern, currentValue } };\r\n };\r\n }\r\n\r\n /**\r\n * 'format' validator\r\n *\r\n * Requires a control to have a value of a certain format.\r\n *\r\n * This validator currently checks the following formsts:\r\n * date, time, date-time, email, hostname, ipv4, ipv6,\r\n * uri, uri-reference, uri-template, url, uuid, color,\r\n * json-pointer, relative-json-pointer,duration, regex\r\n *\r\n * Fast format regular expressions copied from AJV:\r\n * https://github.com/epoberezkin/ajv/blob/master/lib/compile/formats.js\r\n *\r\n * // {JsonSchemaFormatNames} requiredFormat - format to check\r\n * // {IValidatorFn}\r\n */\r\n static format(requiredFormat: JsonSchemaFormatNames): IValidatorFn {\r\n if (!hasValue(requiredFormat)) { return JsonValidators.nullValidator; }\r\n return (control: AbstractControl, invert = false): ValidationErrors|null => {\r\n if (isEmpty(control.value)) { return null; }\r\n let isValid: boolean;\r\n const currentValue: string|Date = control.value;\r\n if (isString(currentValue)) {\r\n //TODO fix-Reg exp last index problem\r\n //see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/test\r\n //before every call to .test it needs to be reset\r\n //use either formatTest.lastIndex = 0; // Reset the lastIndex before each test\r\n //or new RegExp(formatTest.source, formatTest.flags);\r\n \r\n const formatTest: Function|RegExp = jsonSchemaFormatTests[requiredFormat];\r\n if (typeof formatTest === 'object') {\r\n isValid = new RegExp((<RegExp>formatTest).source,(<RegExp>formatTest).flags).test(<string>currentValue);\r\n } else if (typeof formatTest === 'function') {\r\n isValid = (<Function>formatTest)(<string>currentValue);\r\n } else {\r\n console.error(`format validator error: \"${requiredFormat}\" is not a recognized format.`);\r\n isValid = true;\r\n }\r\n } else {\r\n // Allow JavaScript Date objects\r\n isValid = ['date', 'time', 'iso-date-time'].includes(requiredFormat) &&\r\n Object.prototype.toString.call(currentValue) === '[object Date]';\r\n }\r\n return xor(isValid, invert) ?\r\n null : { 'format': { requiredFormat, currentValue } };\r\n };\r\n }\r\n\r\n /**\r\n * 'minimum' validator\r\n *\r\n * Requires a control's numeric value to be greater than or equal to\r\n * a minimum amount.\r\n *\r\n * Any non-numeric value is also valid (according to the HTML forms spec,\r\n * a non-numeric value doesn't have a minimum).\r\n * https://www.w3.org/TR/html5/forms.html#attr-input-max\r\n *\r\n * // {number} minimum - minimum allowed value\r\n * // {IValidatorFn}\r\n */\r\n static minimum(minimumValue: number): IValidatorFn {\r\n if (!hasValue(minimumValue)) { return JsonValidators.nullValidator; }\r\n return (control: AbstractControl, invert = false): ValidationErrors|null => {\r\n if (isEmpty(control.value)) { return null; }\r\n const currentValue = control.value;\r\n const isValid = !isNumber(currentValue) || currentValue >= minimumValue;\r\n return xor(isValid, invert) ?\r\n null : { 'minimum': { minimumValue, currentValue } };\r\n };\r\n }\r\n\r\n /**\r\n * 'exclusiveMinimum' validator\r\n *\r\n * Requires a control's numeric value to be less than a maximum amount.\r\n *\r\n * Any non-numeric value is also valid (according to the HTML forms spec,\r\n * a non-numeric value doesn't have a maximum).\r\n * https://www.w3.org/TR/html5/forms.html#attr-input-max\r\n *\r\n * // {number} exclusiveMinimumValue - maximum allowed value\r\n * // {IValidatorFn}\r\n */\r\n static exclusiveMinimum(exclusiveMinimumValue: number): IValidatorFn {\r\n if (!hasValue(exclusiveMinimumValue)) { return JsonValidators.nullValidator; }\r\n return (control: AbstractControl, invert = false): ValidationErrors|null => {\r\n if (isEmpty(control.value)) { return null; }\r\n const currentValue = control.value;\r\n const isValid = !isNumber(currentValue) || +currentValue < exclusiveMinimumValue;\r\n return xor(isValid, invert) ?\r\n null : { 'exclusiveMinimum': { exclusiveMinimumValue, currentValue } };\r\n };\r\n }\r\n\r\n /**\r\n * 'maximum' validator\r\n *\r\n * Requires a control's numeric value to be less than or equal to\r\n * a maximum amount.\r\n *\r\n * Any non-numeric value is also valid (according to the HTML forms spec,\r\n * a non-numeric value doesn't have a maximum).\r\n * https://www.w3.org/TR/html5/forms.html#attr-input-max\r\n *\r\n * // {number} maximumValue - maximum allowed value\r\n * // {IValidatorFn}\r\n */\r\n static maximum(maximumValue: number): IValidatorFn {\r\n if (!hasValue(maximumValue)) { return JsonValidators.nullValidator; }\r\n return (control: AbstractControl, invert = false): ValidationErrors|null => {\r\n if (isEmpty(control.value)) { return null; }\r\n const currentValue = control.value;\r\n const isValid = !isNumber(currentValue) || +currentValue <= maximumValue;\r\n return xor(isValid, invert) ?\r\n null : { 'maximum': { maximumValue, currentValue } };\r\n };\r\n }\r\n\r\n /**\r\n * 'exclusiveMaximum' validator\r\n *\r\n * Requires a control's numeric value to be less than a maximum amount.\r\n *\r\n * Any non-numeric value is also valid (according to the HTML forms spec,\r\n * a non-numeric value doesn't have a maximum).\r\n * https://www.w3.org/TR/html5/forms.html#attr-input-max\r\n *\r\n * // {number} exclusiveMaximumValue - maximum allowed value\r\n * // {IValidatorFn}\r\n */\r\n static exclusiveMaximum(exclusiveMaximumValue: number): IValidatorFn {\r\n if (!hasValue(exclusiveMaximumValue)) { return JsonValidators.nullValidator; }\r\n return (control: AbstractControl, invert = false): ValidationErrors|null => {\r\n if (isEmpty(control.value)) { return null; }\r\n const currentValue = control.value;\r\n const isValid = !isNumber(currentValue) || +currentValue < exclusiveMaximumValue;\r\n return xor(isValid, invert) ?\r\n null : { 'exclusiveMaximum': { exclusiveMaximumValue, currentValue } };\r\n };\r\n }\r\n\r\n /**\r\n * 'multipleOf' validator\r\n *\r\n * Requires a control to have a numeric value that is a multiple\r\n * of a specified number.\r\n *\r\n * // {number} multipleOfValue - number value must be a multiple of\r\n * // {IValidatorFn}\r\n */\r\n static multipleOf(multipleOfValue: number): IValidatorFn {\r\n if (!hasValue(multipleOfValue)) { return JsonValidators.nullValidator; }\r\n return (control: AbstractControl, invert = false): ValidationErrors|null => {\r\n if (isEmpty(control.value)) { return null; }\r\n const currentValue = control.value;\r\n const isValid = isNumber(currentValue) &&\r\n currentValue % multipleOfValue === 0;\r\n return xor(isValid, invert) ?\r\n null : { 'multipleOf': { multipleOfValue, currentValue } };\r\n };\r\n }\r\n\r\n /**\r\n * 'minProperties' validator\r\n *\r\n * Requires a form group to have a minimum number of properties (i.e. have\r\n * values entered in a minimum number of controls within the group).\r\n *\r\n * // {number} minimumProperties - minimum number of properties allowed\r\n * // {IValidatorFn}\r\n */\r\n static minProperties(minimumProperties: number): IValidatorFn {\r\n if (!hasValue(minimumProperties)) { return JsonValidators.nullValidator; }\r\n return (control: AbstractControl, invert = false): ValidationErrors|null => {\r\n if (isEmpty(control.value)) { return null; }\r\n const currentProperties = Object.keys(control.value).length || 0;\r\n const isValid = currentProperties >= minimumProperties;\r\n return xor(isValid, invert) ?\r\n null : { 'minProperties': { minimumProperties, currentProperties } };\r\n };\r\n }\r\n\r\n /**\r\n * 'maxProperties' validator\r\n *\r\n * Requires a form group to have a maximum number of properties (i.e. have\r\n * values entered in a maximum number of controls within the group).\r\n *\r\n * Note: Has no effect if the form group does not contain more than the\r\n * maximum number of controls.\r\n *\r\n * // {number} maximumProperties - maximum number of properties allowed\r\n * // {IValidatorFn}\r\n */\r\n static maxProperties(maximumProperties: number): IValidatorFn {\r\n if (!hasValue(maximumProperties)) { return JsonValidators.nullValidator; }\r\n return (control: AbstractControl, invert = false): ValidationErrors|null => {\r\n const currentProperties = Object.keys(control.value).length || 0;\r\n const isValid = currentProperties <= maximumProperties;\r\n return xor(isValid, invert) ?\r\n null : { 'maxProperties': { maximumProperties, currentProperties } };\r\n };\r\n }\r\n\r\n /**\r\n * 'dependencies' validator\r\n *\r\n * Requires the controls in a form group to meet additional validation\r\n * criteria, depending on the values of other controls in the group.\r\n *\r\n * Examples:\r\n * https://spacetelescope.github.io/understanding-json-schema/reference/object.html#dependencies\r\n *\r\n * // {any} dependencies - required dependencies\r\n * // {IValidatorFn}\r\n */\r\n static dependencies(dependencies: any): IValidatorFn {\r\n if (getType(dependencies) !== 'object' || isEmpty(dependencies)) {\r\n return JsonValidators.nullValidator;\r\n }\r\n return (control: AbstractControl, invert = false): ValidationErrors|null => {\r\n if (isEmpty(control.value)) { return null; }\r\n const allErrors = _mergeObjects(\r\n forEachCopy(dependencies, (value, requiringField) => {\r\n if (!hasValue(control.value[requiringField])) { return null; }\r\n let requiringFieldErrors: ValidationErrors = { };\r\n let requiredFields: string[];\r\n let properties: ValidationErrors = { };\r\n if (getType(dependencies[requiringField]) === 'array') {\r\n requiredFields = dependencies[requiringField];\r\n } else if (getType(dependencies[requiringField]) === 'object') {\r\n requiredFields = dependencies[requiringField]['required'] || [];\r\n properties = dependencies[requiringField]['properties'] || { };\r\n }\r\n\r\n // Validate property dependencies\r\n for (const requiredField of requiredFields) {\r\n if (xor(!hasValue(control.value[requiredField]), invert)) {\r\n requiringFieldErrors[requiredField] = { 'required': true };\r\n }\r\n }\r\n\r\n // Validate schema dependencies\r\n requiringFieldErrors = _mergeObjects(requiringFieldErrors,\r\n forEachCopy(properties, (requirements, requiredField) => {\r\n const requiredFieldErrors = _mergeObjects(\r\n forEachCopy(requirements, (requirement, parameter) => {\r\n let validator: IValidatorFn = null;\r\n if (requirement === 'maximum' || requirement === 'minimum') {\r\n const exclusive = !!requirements['exclusiveM' + requirement.slice(1)];\r\n validator = JsonValidators[requirement](parameter, exclusive);\r\n } else if (typeof JsonValidators[requirement] === 'function') {\r\n validator = JsonValidators[requirement](parameter);\r\n }\r\n return !isDefined(validator) ?\r\n null : validator(control.value[requiredField]);\r\n })\r\n );\r\n return isEmpty(requiredFieldErrors) ?\r\n null : { [requiredField]: requiredFieldErrors };\r\n })\r\n );\r\n return isEmpty(requiringFieldErrors) ?\r\n null : { [requiringField]: requiringFieldErrors };\r\n })\r\n );\r\n return isEmpty(allErrors) ? null : allErrors;\r\n };\r\n }\r\n\r\n /**\r\n * 'minItems' validator\r\n *\r\n * Requires a form array to have a minimum number of values.\r\n *\r\n * // {number} minimumItems - minimum number of items allowed\r\n * // {IValidatorFn}\r\n */\r\n static minItems(minimumItems: number): IValidatorFn {\r\n if (!hasValue(minimumItems)) { return JsonValidators.nullValidator; }\r\n return (control: AbstractControl, invert = false): ValidationErrors|null => {\r\n if (isEmpty(control.value)) { return null; }\r\n const currentItems = isArray(control.value) ? control.value.length : 0;\r\n const isValid = currentItems >= minimumItems;\r\n return xor(isValid, invert) ?\r\n null : { 'minItems': { minimumItems, currentItems } };\r\n };\r\n }\r\n\r\n /**\r\n * 'maxItems' validator\r\n *\r\n * Requires a form array to have a maximum number of values.\r\n *\r\n * // {number} maximumItems - maximum number of items allowed\r\n * // {IValidatorFn}\r\n */\r\n static maxItems(maximumItems: number): IValidatorFn {\r\n if (!hasValue(maximumItems)) { return JsonValidators.nullValidator; }\r\n return (control: AbstractControl, invert = false): ValidationErrors|null => {\r\n const currentItems = isArray(control.value) ? control.value.length : 0;\r\n const isValid = currentItems <= maximumItems;\r\n return xor(isValid, invert) ?\r\n null : { 'maxItems': { maximumItems, currentItems } };\r\n };\r\n }\r\n\r\n /**\r\n * 'uniqueItems' validator\r\n *\r\n * Requires values in a form array to be unique.\r\n *\r\n * // {boolean = true} unique? - true to validate, false to disable\r\n * // {IValidatorFn}\r\n */\r\n static uniqueItems(unique = true): IValidatorFn {\r\n if (!unique) { return JsonValidators.nullValidator; }\r\n return (control: AbstractControl, invert = false): ValidationErrors|null => {\r\n if (isEmpty(control.value)) { return null; }\r\n const sorted: any[] = control.value.slice().sort();\r\n const duplicateItems = [];\r\n for (let i = 1; i < sorted.length; i++) {\r\n if (sorted[i - 1] === sorted[i] && duplicateItems.includes(sorted[i])) {\r\n duplicateItems.push(sorted[i]);\r\n }\r\n }\r\n const isValid = !duplicateItems.length;\r\n return xor(isValid, invert) ?\r\n null : { 'uniqueItems': { duplicateItems } };\r\n };\r\n }\r\n\r\n /**\r\n * 'contains' validator\r\n *\r\n * TODO: Complete this validator\r\n *\r\n * Requires values in a form array to be unique.\r\n *\r\n * // {boolean = true} unique? - true to validate, false to disable\r\n * // {IValidatorFn}\r\n */\r\n static contains(requiredItem = true): IValidatorFn {\r\n if (!requiredItem) { return JsonValidators.nullValidator; }\r\n return (control: AbstractControl, invert = false): ValidationErrors|null => {\r\n if (isEmpty(control.value) || !isArray(control.value)) { return null; }\r\n const currentItems = control.value;\r\n // const isValid = currentItems.some(item =>\r\n //\r\n // );\r\n const isValid = true;\r\n return xor(isValid, invert) ?\r\n null : { 'contains': { requiredItem, currentItems } };\r\n };\r\n }\r\n\r\n /**\r\n * No-op validator. Included for backward compatibility.\r\n */\r\n static nullValidator(control: AbstractControl): ValidationErrors|null {\r\n return null;\r\n }\r\n\r\n /**\r\n * Validator transformation functions:\r\n * composeAnyOf, composeOneOf, composeAllOf, composeNot,\r\n * compose, composeAsync\r\n *\r\n * TODO: Add composeAnyOfAsync, composeOneOfAsync,\r\n * composeAllOfAsync, composeNotAsync\r\n */\r\n\r\n /**\r\n * 'composeAnyOf' validator combination function\r\n *\r\n * Accepts an array of validators and returns a single validator that\r\n * evaluates to valid if any one or more of the submitted validators are\r\n * valid. If every validator is invalid, it returns combined errors from\r\n * all validators.\r\n *\r\n * // {IValidatorFn[]} validators - array of validators to combine\r\n * // {IValidatorFn} - single combined validator function\r\n */\r\n static composeAnyOf(validators: IValidatorFn[]): IValidatorFn {\r\n if (!validators) { return null; }\r\n const presentValidators = validators.filter(isDefined);\r\n if (presentValidators.length === 0) { return null; }\r\n return (control: AbstractControl, invert = false): ValidationErrors|null => {\r\n const arrayOfErrors =\r\n _executeValidators(control, presentValidators, invert).filter(isDefined);\r\n const isValid = validators.length > arrayOfErrors.length;\r\n return xor(isValid, invert) ?\r\n null : _mergeObjects(...arrayOfErrors, { 'anyOf': !invert });\r\n };\r\n }\r\n\r\n /**\r\n * 'composeOneOf' validator combination function\r\n *\r\n * Accepts an array of validators and returns a single validator that\r\n * evaluates to valid only if exactly one of the submitted validators\r\n * is valid. Otherwise returns combined information from all validators,\r\n * both valid and invalid.\r\n *\r\n * // {IValidatorFn[]} validators - array of validators to combine\r\n * // {IValidatorFn} - single combined validator function\r\n */\r\n static composeOneOf(validators: IValidatorFn[]): IValidatorFn {\r\n if (!validators) { return null; }\r\n const presentValidators = validators.filter(isDefined);\r\n if (presentValidators.length === 0) { return null; }\r\n return (control: AbstractControl, invert = false): ValidationErrors|null => {\r\n const arrayOfErrors =\r\n _executeValidators(control, presentValidators);\r\n const validControls =\r\n validators.length - arrayOfErrors.filter(isDefined).length;\r\n const isValid = validControls === 1;\r\n if (xor(isValid, invert)) { return null; }\r\n const arrayOfValids =\r\n _executeValidators(control, presentValidators, invert);\r\n return _mergeObjects(...arrayOfErrors, ...arrayOfValids, { 'oneOf': !invert });\r\n };\r\n }\r\n\r\n /**\r\n * 'composeAllOf' validator combination function\r\n *\r\n * Accepts an array of validators and returns a single validator that\r\n * evaluates to valid only if all the submitted validators are individually\r\n * valid. Otherwise it returns combined errors from all invalid validators.\r\n *\r\n * // {IValidatorFn[]} validators - array of validators to combine\r\n * // {IValidatorFn} - single combined validator function\r\n */\r\n static composeAllOf(validators: IValidatorFn[]): IValidatorFn {\r\n if (!validators) { return null; }\r\n const presentValidators = validators.filter(isDefined);\r\n if (presentValidators.length === 0) { return null; }\r\n return (control: AbstractControl, invert = false): ValidationErrors|null => {\r\n const combinedErrors = _mergeErrors(\r\n _executeValidators(control, presentValidators, invert)\r\n );\r\n const isValid = combinedErrors === null;\r\n return (xor(isValid, invert)) ?\r\n null : _mergeObjects(combinedErrors, { 'allOf': !invert });\r\n };\r\n }\r\n\r\n /**\r\n * 'composeNot' validator inversion function\r\n *\r\n * Accepts a single validator function and inverts its result.\r\n * Returns valid if the submitted validator is invalid, and\r\n * returns invalid if the submitted validator is valid.\r\n * (Note: this function can itself be inverted\r\n * - e.g. composeNot(composeNot(validator)) -\r\n * but this can be confusing and is therefore not recommended.)\r\n *\r\n * // {IValidatorFn[]} validators - validator(s) to invert\r\n * // {IValidatorFn} - new validator function that returns opposite result\r\n */\r\n static composeNot(validator: IValidatorFn): IValidatorFn {\r\n if (!validator) { return null; }\r\n return (control: AbstractControl, invert = false): ValidationErrors|null => {\r\n if (isEmpty(control.value)) { return null; }\r\n const error = validator(control, !invert);\r\n const isValid = error === null;\r\n return (xor(isValid, invert)) ?\r\n null : _mergeObjects(error, { 'not': !invert });\r\n };\r\n }\r\n\r\n /**\r\n * 'compose' validator combination function\r\n *\r\n * // {IValidatorFn[]} validators - array of validators to combine\r\n * // {IValidatorFn} - single combined validator function\r\n */\r\n static compose(validators: IValidatorFn[]): IValidatorFn {\r\n if (!validators) { return null; }\r\n const presentValidators = validators.filter(isDefined);\r\n if (presentValidators.length === 0) { return null; }\r\n return (control: AbstractControl, invert = false): ValidationErrors|null =>\r\n _mergeErrors(_executeValidators(control, presentValidators, invert));\r\n }\r\n\r\n /**\r\n * 'composeAsync' async validator combination function\r\n *\r\n * // {AsyncIValidatorFn[]} async validators - array of async validators\r\n * // {AsyncIValidatorFn} - single combined async validator function\r\n */\r\n static composeAsync(validators: AsyncIValidatorFn[]): AsyncIValidatorFn {\r\n if (!validators) { return null; }\r\n const presentValidators = validators.filter(isDefined);\r\n if (presentValidators.length === 0) { return null; }\r\n return (control: AbstractControl) => {\r\n const observables =\r\n _executeAsyncValidators(control, presentValidators).map(toObservable);\r\n return map.call(forkJoin(observables), _mergeErrors);\r\n };\r\n }\r\n\r\n // Additional angular validators (not used by Angualr JSON Schema Form)\r\n // From https://github.com/angular/angular/blob/master/packages/forms/src/validators.ts\r\n\r\n /**\r\n * Validator that requires controls to have a value greater than a number.\r\n */\r\n static min(min: number): ValidatorFn {\r\n if (!hasValue(min)) { return JsonValidators.nullValidator; }\r\n return (control: AbstractControl): ValidationErrors|null => {\r\n // don't validate empty values to allow optional controls\r\n if (isEmpty(control.value) || isEmpty(min)) { return null; }\r\n const value = parseFloat(control.value);\r\n const actual = control.value;\r\n // Controls with NaN values after parsing should be treated as not having a\r\n // minimum, per the HTML forms spec: https://www.w3.org/TR/html5/forms.html#attr-input-min\r\n return isNaN(value) || value >= min ? null : { 'min': { min, actual } };\r\n };\r\n }\r\n\r\n /**\r\n * Validator that requires controls to have a value less than a number.\r\n */\r\n static max(max: number): ValidatorFn {\r\n if (!hasValue(max)) { return JsonValidators.nullValidator; }\r\n return (control: AbstractControl): ValidationErrors|null => {\r\n // don't validate empty values to allow optional controls\r\n if (isEmpty(control.value) || isEmpty(max)) { return null; }\r\n const value = parseFloat(control.value);\r\n const actual = control.value;\r\n // Controls with NaN values after parsing should be treated as not having a\r\n // maximum, per the HTML forms spec: https://www.w3.org/TR/html5/forms.html#attr-input-max\r\n return isNaN(value) || value <= max ? null : { 'max': { max, actual } };\r\n };\r\n }\r\n\r\n /**\r\n * Validator that requires control value to be true.\r\n */\r\n static requiredTrue(control: AbstractControl): ValidationErrors|null {\r\n if (!control) { return JsonValidators.nullValidator; }\r\n return control.value === true ? null : { 'required': true };\r\n }\r\n\r\n /**\r\n * Validator that performs email validation.\r\n */\r\n static email(control: AbstractControl): ValidationErrors|null {\r\n if (!control) { return JsonValidators.nullValidator; }\r\n const EMAIL_REGEXP =\r\n // tslint:disable-next-line:max-line-length\r\n /^(?=.{1,254}$)(?=.{1,64}@)[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+(\\.[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+)*@[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?(\\.[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*$/;\r\n return EMAIL_REGEXP.test(control.value) ? null : { 'email': true };\r\n }\r\n}\r\n","import isEqual from 'lodash/isEqual';\r\n\r\nimport {\r\n isArray, isEmpty, isNumber, isObject, isString\r\n} from './validator.functions';\r\nimport { hasOwn, uniqueItems, commonItems } from './utility.functions';\r\nimport { JsonPointer, Pointer } from './jsonpointer.functions';\r\n\r\n/**\r\n * 'mergeSchemas' function\r\n *\r\n * Merges multiple JSON schemas into a single schema with combined rules.\r\n *\r\n * If able to logically merge properties from all schemas,\r\n * returns a single schema object containing all merged properties.\r\n *\r\n * Example: ({ a: b, max: 1 }, { c: d, max: 2 }) => { a: b, c: d, max: 1 }\r\n *\r\n * If unable to logically merge, returns an allOf schema object containing\r\n * an array of the original schemas;\r\n *\r\n * Example: ({ a: b }, { a: d }) => { allOf: [ { a: b }, { a: d } ] }\r\n *\r\n * // schemas - one or more input schemas\r\n * // - merged schema\r\n */\r\nexport function mergeSchemas(...schemas) {\r\n schemas = schemas.filter(schema => !isEmpty(schema));\r\n if (schemas.some(schema => !isObject(schema))) { return null; }\r\n const combinedSchema: any = {};\r\n for (const schema of schemas) {\r\n for (const key of Object.keys(schema)) {\r\n const combinedValue = combinedSchema[key];\r\n const schemaValue = schema[key];\r\n if (!hasOwn(combinedSchema, key) || isEqual(combinedValue, schemaValue)) {\r\n combinedSchema[key] = schemaValue;\r\n } else {\r\n switch (key) {\r\n case 'allOf':\r\n // Combine all items from both arrays\r\n if (isArray(combinedValue) && isArray(schemaValue)) {\r\n combinedSchema.allOf = mergeSchemas(...combinedValue, ...schemaValue);\r\n } else {\r\n return { allOf: [ ...schemas ] };\r\n }\r\n break;\r\n case 'additionalItems': case 'additionalProperties':\r\n case 'contains': case 'propertyNames':\r\n // Merge schema objects\r\n if (isObject(combinedValue) && isObject(schemaValue)) {\r\n combinedSchema[key] = mergeSchemas(combinedValue, schemaValue);\r\n // additionalProperties == false in any schema overrides all other values\r\n } else if (\r\n key === 'additionalProperties' &&\r\n (combinedValue === false || schemaValue === false)\r\n ) {\r\n combinedSchema.combinedSchema = false;\r\n } else {\r\n return { allOf: [ ...schemas ] };\r\n }\r\n break;\r\n case 'anyOf': case 'oneOf': case 'enum':\r\n // Keep only items that appear in both arrays\r\n if (isArray(combinedValue) && isArray(schemaValue)) {\r\n combinedSchema[key] = combinedValue.filter(item1 =>\r\n schemaValue.findIndex(item2 => isEqual(item1, item2)) > -1\r\n );\r\n if (!combinedSchema[key].length) { return { allOf: [ ...schemas ] }; }\r\n } else {\r\n return { allOf: [ ...schemas ] };\r\n }\r\n break;\r\n case 'definitions':\r\n // Combine keys from both objects\r\n if (isObject(combinedValue) && isObject(schemaValue)) {\r\n const combinedObject = { ...combinedValue };\r\n for (const subKey of Object.keys(schemaValue)) {\r\n if (!hasOwn(combinedObject, subKey) ||\r\n isEqual(combinedObject[subKey], schemaValue[subKey])\r\n ) {\r\n combinedObject[subKey] = schemaValue[subKey];\r\n // Don't combine matching keys with different values\r\n } else {\r\n return { allOf: [ ...schemas ] };\r\n }\r\n }\r\n combinedSchema.definitions = combinedObject;\r\n } else {\r\n return { allOf: [ ...schemas ] };\r\n }\r\n break;\r\n case 'dependencies':\r\n // Combine all keys from both objects\r\n // and merge schemas on matching keys,\r\n // converting from arrays to objects if necessary\r\n if (isObject(combinedValue) && isObject(schemaValue)) {\r\n const combinedObject = { ...combinedValue };\r\n for (const subKey of Object.keys(schemaValue)) {\r\n if (!hasOwn(combinedObject, subKey) ||\r\n isEqual(combinedObject[subKey], schemaValue[subKey])\r\n ) {\r\n combinedObject[subKey] = schemaValue[subKey];\r\n // If both keys are arrays, include all items from both arrays,\r\n // excluding duplicates\r\n } else if (\r\n isArray(schemaValue[subKey]) && isArray(combinedObject[subKey])\r\n ) {\r\n combinedObject[subKey] =\r\n uniqueItems(...combinedObject[subKey], ...schemaValue[subKey]);\r\n // If either key is an object, merge the schemas\r\n } else if (\r\n (isArray(schemaValue[subKey]) || isObject(schemaValue[subKey])) &&\r\n (isArray(combinedObject[subKey]) || isObject(combinedObject[subKey]))\r\n ) {\r\n // If either key is an array, convert it to an object first\r\n const required = isArray(combinedSchema.required) ?\r\n combinedSchema.required : [];\r\n const combinedDependency = isArray(combinedObject[subKey]) ?\r\n { required: uniqueItems(...required, combinedObject[subKey]) } :\r\n combinedObject[subKey];\r\n const schemaDependency = isArray(schemaValue[subKey]) ?\r\n { required: uniqueItems(...required, schemaValue[subKey]) } :\r\n schemaValue[subKey];\r\n combinedObject[subKey] =\r\n mergeSchemas(combinedDependency, schemaDependency);\r\n } else {\r\n return { allOf: [ ...schemas ] };\r\n }\r\n }\r\n combinedSchema.dependencies = combinedObject;\r\n } else {\r\n return { allOf: [ ...schemas ] };\r\n }\r\n break;\r\n case 'items':\r\n // If arrays, keep only items that appear in both arrays\r\n if (isArray(combinedValue) && isArray(schemaValue)) {\r\n combinedSchema.items = combinedValue.filter(item1 =>\r\n schemaValue.findIndex(item2 => isEqual(item1, item2)) > -1\r\n );\r\n if (!combinedSchema.items.length) { return { allOf: [ ...schemas ] }; }\r\n // If both keys are objects, merge them\r\n } else if (isObject(combinedValue) && isObject(schemaValue)) {\r\n combinedSchema.items = mergeSchemas(combinedValue, schemaValue);\r\n // If object + array, combine object with each array item\r\n } else if (isArray(combinedValue) && isObject(schemaValue)) {\r\n combinedSchema.items =\r\n combinedValue.map(item => mergeSchemas(item, schemaValue));\r\n } else if (isObject(combinedValue) && isArray(schemaValue)) {\r\n combinedSchema.items =\r\n schemaValue.map(item => mergeSchemas(item, combinedValue));\r\n } else {\r\n return { allOf: [ ...schemas ] };\r\n }\r\n break;\r\n case 'multipleOf':\r\n // TODO: Adjust to correctly handle decimal values\r\n // If numbers, set to least common multiple\r\n if (isNumber(combinedValue) && isNumber(schemaValue)) {\r\n const gcd = (x, y) => !y ? x : gcd(y, x % y);\r\n const lcm = (x, y) => (x * y) / gcd(x, y);\r\n combinedSchema.multipleOf = lcm(combinedValue, schemaValue);\r\n } else {\r\n return { allOf: [ ...schemas ] };\r\n }\r\n break;\r\n case 'maximum': case 'exclusiveMaximum': case 'maxLength':\r\n case 'maxItems': case 'maxProperties':\r\n // If numbers, set to lowest value\r\n if (isNumber(combinedValue) && isNumber(schemaValue)) {\r\n combinedSchema[key] = Math.min(combinedValue, schemaValue);\r\n } else {\r\n return { allOf: [ ...schemas ] };\r\n }\r\n break;\r\n case 'minimum': case 'exclusiveMinimum': case 'minLength':\r\n case 'minItems': case 'minProperties':\r\n // If numbers, set to highest value\r\n if (isNumber(combinedValue) && isNumber(schemaValue)) {\r\n combinedSchema[key] = Math.max(combinedValue, schemaValue);\r\n } else {\r\n return { allOf: [ ...schemas ] };\r\n }\r\n break;\r\n case 'not':\r\n // Combine not values into anyOf array\r\n if (isObject(combinedValue) && isObject(schemaValue)) {\r\n const notAnyOf = [combinedValue, schemaValue]\r\n .reduce((notAnyOfArray, notSchema) =>\r\n isArray(notSchema.anyOf) &&\r\n Object.keys(notSchema).length === 1 ?\r\n [ ...notAnyOfArray, ...notSchema.anyOf ] :\r\n [ ...notAnyOfArray, notSchema ]\r\n , []);\r\n // TODO: Remove duplicate items from array\r\n combinedSchema.not = { anyOf: notAnyOf };\r\n } else {\r\n return { allOf: [ ...schemas ] };\r\n }\r\n break;\r\n case 'patternProperties':\r\n // Combine all keys from both objects\r\n // and merge schemas on matching keys\r\n if (isObject(combinedValue) && isObject(schemaValue)) {\r\n const combinedObject = { ...combinedValue };\r\n for (const subKey of Object.keys(schemaValue)) {\r\n if (!hasOwn(combinedObject, subKey) ||\r\n isEqual(combinedObject[subKey], schemaValue[subKey])\r\n ) {\r\n combinedObject[subKey] = schemaValue[subKey];\r\n // If both keys are objects, merge them\r\n } else if (\r\n isObject(schemaValue[subKey]) && isObject(combinedObject[subKey])\r\n ) {\r\n combinedObject[subKey] =\r\n mergeSchemas(combinedObject[subKey], schemaValue[subKey]);\r\n } else {\r\n return { allOf: [ ...schemas ] };\r\n }\r\n }\r\n combinedSchema.patternProperties = combinedObject;\r\n } else {\r\n return { allOf: [ ...schemas ] };\r\n }\r\n break;\r\n case 'properties':\r\n // Combine all keys from both objects\r\n // unless additionalProperties === false\r\n // and merge schemas on matching keys\r\n if (isObject(combinedValue) && isObject(schemaValue)) {\r\n const combinedObject = { ...combinedValue };\r\n // If new schema has additionalProperties,\r\n // merge or remove non-matching property keys in combined schema\r\n if (hasOwn(schemaValue, 'additionalProperties')) {\r\n Object.keys(combinedValue)\r\n .filter(combinedKey => !Object.keys(schemaValue).includes(combinedKey))\r\n .forEach(nonMatchingKey => {\r\n if (schemaValue.additionalProperties === false) {\r\n delete combinedObject[nonMatchingKey];\r\n } else if (isObject(schemaValue.additionalProperties)) {\r\n combinedObject[nonMatchingKey] = mergeSchemas(\r\n combinedObject[nonMatchingKey],\r\n schemaValue.additionalProperties\r\n );\r\n }\r\n });\r\n }\r\n for (const subKey of Object.keys(schemaValue)) {\r\n if (isEqual(combinedObject[subKey], schemaValue[subKey]) || (\r\n !hasOwn(combinedObject, subKey) &&\r\n !hasOwn(combinedObject, 'additionalProperties')\r\n )) {\r\n combinedObject[subKey] = schemaValue[subKey];\r\n // If combined schema has additionalProperties,\r\n // merge or ignore non-matching property keys in new schema\r\n } else if (\r\n !hasOwn(combinedObject, subKey) &&\r\n hasOwn(combinedObject, 'additionalProperties')\r\n ) {\r\n // If combinedObject.additionalProperties === false,\r\n // do nothing (don't set key)\r\n // If additionalProperties is object, merge with new key\r\n if (isObject(combinedObject.additionalProperties)) {\r\n combinedObject[subKey] = mergeSchemas(\r\n combinedObject.additionalProperties, schemaValue[subKey]\r\n );\r\n }\r\n // If both keys are objects, merge them\r\n } else if (\r\n isObject(schemaValue[subKey]) &&\r\n isObject(combinedObject[subKey])\r\n ) {\r\n combinedObject[subKey] =\r\n mergeSchemas(combinedObject[subKey], schemaValue[subKey]);\r\n } else {\r\n return { allOf: [ ...schemas ] };\r\n }\r\n }\r\n combinedSchema.properties = combinedObject;\r\n } else {\r\n return { allOf: [ ...schemas ] };\r\n }\r\n break;\r\n case 'required':\r\n // If arrays, include all items from both arrays, excluding duplicates\r\n if (isArray(combinedValue) && isArray(schemaValue)) {\r\n combinedSchema.required = uniqueItems(...combinedValue, ...schemaValue);\r\n // If booleans, aet true if either true\r\n } else if (\r\n typeof schemaValue === 'boolean' &&\r\n typeof combinedValue === 'boolean'\r\n ) {\r\n combinedSchema.required = !!combinedValue || !!schemaValue;\r\n } else {\r\n return { allOf: [ ...schemas ] };\r\n }\r\n break;\r\n case '$schema': case '$id': case 'id':\r\n // Don't combine these keys\r\n break;\r\n case 'title': case 'description': case '$comment':\r\n // Return the last value, overwriting any previous one\r\n // These properties are not used for validation, so conflicts don't matter\r\n combinedSchema[key] = schemaValue;\r\n break;\r\n case 'type':\r\n if (\r\n (isArray(schemaValue) || isString(schemaValue)) &&\r\n (isArray(combinedValue) || isString(combinedValue))\r\n ) {\r\n const combinedTypes = commonItems(combinedValue, schemaValue);\r\n if (!combinedTypes.length) { return { allOf: [ ...schemas ] }; }\r\n combinedSchema.type = combinedTypes.length > 1 ? combinedTypes : combinedTypes[0];\r\n } else {\r\n return { allOf: [ ...schemas ] };\r\n }\r\n break;\r\n case 'uniqueItems':\r\n // Set true if either true\r\n combinedSchema.uniqueItems = !!combinedValue || !!schemaValue;\r\n break;\r\n default:\r\n return { allOf: [ ...schemas ] };\r\n }\r\n }\r\n }\r\n }\r\n return combinedSchema;\r\n}\r\n","import { isEmpty } from 'lodash';\r\nimport cloneDeep from 'lodash/cloneDeep';\r\nimport omit from 'lodash/omit';\r\nimport { JsonPointer } from './jsonpointer.functions';\r\nimport { mergeSchemas } from './merge-schemas.function';\r\nimport { forEach, hasOwn, mergeFilteredObject } from './utility.functions';\r\nimport {\r\n getType,\r\n hasValue,\r\n inArray,\r\n isArray,\r\n isNumber,\r\n isObject,\r\n isString\r\n} from './validator.functions';\r\n\r\n\r\n/**\r\n * JSON Schema function library:\r\n *\r\n * buildSchemaFromLayout: TODO: Write this function\r\n *\r\n * buildSchemaFromData:\r\n *\r\n * getFromSchema:\r\n *\r\n * removeRecursiveReferences:\r\n *\r\n * getInputType:\r\n *\r\n * checkInlineType:\r\n *\r\n * isInputRequired:\r\n *\r\n * updateInputOptions:\r\n *\r\n * getTitleMapFromOneOf:\r\n *\r\n * getControlValidators:\r\n *\r\n * resolveSchemaReferences:\r\n *\r\n * getSubSchema:\r\n *\r\n * combineAllOf:\r\n *\r\n * fixRequiredArrayProperties:\r\n */\r\n\r\n/**\r\n * 'buildSchemaFromLayout' function\r\n *\r\n * TODO: Build a JSON Schema from a JSON Form layout\r\n *\r\n * // layout - The JSON Form layout\r\n * // - The new JSON Schema\r\n */\r\nexport function buildSchemaFromLayout(layout) {\r\n return;\r\n // let newSchema: any = { };\r\n // const walkLayout = (layoutItems: any[], callback: Function): any[] => {\r\n // let returnArray: any[] = [];\r\n // for (let layoutItem of layoutItems) {\r\n // const returnItem: any = callback(layoutItem);\r\n // if (returnItem) { returnArray = returnArray.concat(callback(layoutItem)); }\r\n // if (layoutItem.items) {\r\n // returnArray = returnArray.concat(walkLayout(layoutItem.items, callback));\r\n // }\r\n // }\r\n // return returnArray;\r\n // };\r\n // walkLayout(layout, layoutItem => {\r\n // let itemKey: string;\r\n // if (typeof layoutItem === 'string') {\r\n // itemKey = layoutItem;\r\n // } else if (layoutItem.key) {\r\n // itemKey = layoutItem.key;\r\n // }\r\n // if (!itemKey) { return; }\r\n // //\r\n // });\r\n}\r\n\r\n/**\r\n * 'buildSchemaFromData' function\r\n *\r\n * Build a JSON Schema from a data object\r\n *\r\n * // data - The data object\r\n * // { boolean = false } requireAllFields - Require all fields?\r\n * // { boolean = true } isRoot - is root\r\n * // - The new JSON Schema\r\n */\r\nexport function buildSchemaFromData(\r\n data, requireAllFields = false, isRoot = true\r\n) {\r\n const newSchema: any = {};\r\n const getFieldType = (value: any): string => {\r\n const fieldType = getType(value, 'strict');\r\n return { integer: 'number', null: 'string' }[fieldType] || fieldType;\r\n };\r\n const buildSubSchema = (value) =>\r\n buildSchemaFromData(value, requireAllFields, false);\r\n if (isRoot) { newSchema.$schema = 'http://json-schema.org/draft-06/schema#'; }\r\n newSchema.type = getFieldType(data);\r\n if (newSchema.type === 'object') {\r\n newSchema.properties = {};\r\n if (requireAllFields) { newSchema.required = []; }\r\n for (const key of Object.keys(data)) {\r\n newSchema.properties[key] = buildSubSchema(data[key]);\r\n if (requireAllFields) { newSchema.required.push(key); }\r\n }\r\n } else if (newSchema.type === 'array') {\r\n newSchema.items = data.map(buildSubSchema);\r\n // If all items are the same type, use an object for items instead of an array\r\n if ((new Set(data.map(getFieldType))).size === 1) {\r\n newSchema.items = newSchema.items.reduce((a, b) => ({ ...a, ...b }), {});\r\n }\r\n if (requireAllFields) { newSchema.minItems = 1; }\r\n }\r\n return newSchema;\r\n}\r\n\r\n/**\r\n * 'getFromSchema' function\r\n *\r\n * Uses a JSON Pointer for a value within a data object to retrieve\r\n * the schema for that value within schema for the data object.\r\n *\r\n * The optional third parameter can also be set to return something else:\r\n * 'schema' (default): the schema for the value indicated by the data pointer\r\n * 'parentSchema': the schema for the value's parent object or array\r\n * 'schemaPointer': a pointer to the value's schema within the object's schema\r\n * 'parentSchemaPointer': a pointer to the schema for the value's parent object or array\r\n *\r\n * // schema - The schema to get the sub-schema from\r\n * // { Pointer } dataPointer - JSON Pointer (string or array)\r\n * // { string = 'schema' } returnType - what to return?\r\n * // - The located sub-schema\r\n */\r\nexport function getFromSchema(schema, dataPointer, returnType = 'schema') {\r\n const dataPointerArray: any[] = JsonPointer.parse(dataPointer);\r\n if (dataPointerArray === null) {\r\n console.error(`getFromSchema error: Invalid JSON Pointer: ${dataPointer}`);\r\n return null;\r\n }\r\n let subSchema = schema;\r\n const schemaPointer = [];\r\n const length = dataPointerArray.length;\r\n if (returnType.slice(0, 6) === 'parent') { dataPointerArray.length--; }\r\n for (let i = 0; i < length; ++i) {\r\n const parentSchema = subSchema;\r\n const key = dataPointerArray[i];\r\n let subSchemaFound = false;\r\n if (typeof subSchema !== 'object') {\r\n console.error(`getFromSchema error: Unable to find \"${key}\" key in schema.`);\r\n console.error(schema);\r\n console.error(dataPointer);\r\n return null;\r\n }\r\n if (subSchema.type === 'array' && (!isNaN(key) || key === '-')) {\r\n if (hasOwn(subSchema, 'items')) {\r\n if (isObject(subSchema.items)) {\r\n subSchemaFound = true;\r\n subSchema = subSchema.items;\r\n schemaPointer.push('items');\r\n } else if (isArray(subSchema.items)) {\r\n if (!isNaN(key) && subSchema.items.length >= +key) {\r\n subSchemaFound = true;\r\n subSchema = subSchema.items[+key];\r\n schemaPointer.push('items', key);\r\n }\r\n }\r\n }\r\n if (!subSchemaFound && isObject(subSchema.additionalItems)) {\r\n subSchemaFound = true;\r\n subSchema = subSchema.additionalItems;\r\n schemaPointer.push('additionalItems');\r\n } else if (subSchema.additionalItems !== false) {\r\n subSchemaFound = true;\r\n subSchema = { };\r\n schemaPointer.push('additionalItems');\r\n }\r\n } else if (subSchema.type === 'object') {\r\n if (isObject(subSchema.properties) && hasOwn(subSchema.properties, key)) {\r\n subSchemaFound = true;\r\n subSchema = subSchema.properties[key];\r\n schemaPointer.push('properties', key);\r\n } else if (isObject(subSchema.additionalProperties)) {\r\n subSchemaFound = true;\r\n subSchema = subSchema.additionalProperties;\r\n schemaPointer.push('additionalProperties');\r\n } else if (subSchema.additionalProperties !== false) {\r\n subSchemaFound = true;\r\n subSchema = { };\r\n schemaPointer.push('additionalProperties');\r\n }\r\n }\r\n if (!subSchemaFound) {\r\n console.error(`getFromSchema error: Unable to find \"${key}\" item in schema.`);\r\n console.error(schema);\r\n console.error(dataPointer);\r\n return;\r\n }\r\n }\r\n return returnType.slice(-7) === 'Pointer' ? schemaPointer : subSchema;\r\n}\r\n\r\n/**\r\n * 'removeRecursiveReferences' function\r\n *\r\n * Checks a JSON Pointer against a map of recursive references and returns\r\n * a JSON Pointer to the shallowest equivalent location in the same object.\r\n *\r\n * Using this functions enables an object to be constructed with unlimited\r\n * recursion, while maintaing a fixed set of metadata, such as field data types.\r\n * The object can grow as large as it wants, and deeply recursed nodes can\r\n * just refer to the metadata for their shallow equivalents, instead of having\r\n * to add additional redundant metadata for each recursively added node.\r\n *\r\n * Example:\r\n *\r\n * pointer: '/stuff/and/more/and/more/and/more/and/more/stuff'\r\n * recursiveRefMap: [['/stuff/and/more/and/more', '/stuff/and/more/']]\r\n * returned: '/stuff/and/more/stuff'\r\n *\r\n * // { Pointer } pointer -\r\n * // { Map<string, string> } recursiveRefMap -\r\n * // { Map<string, number> = new Map() } arrayMap - optional\r\n * // { string } -\r\n */\r\nexport function removeRecursiveReferences(\r\n pointer, recursiveRefMap, arrayMap = new Map()\r\n) {\r\n if (!pointer) { return ''; }\r\n let genericPointer =\r\n JsonPointer.toGenericPointer(JsonPointer.compile(pointer), arrayMap);\r\n if (genericPointer.indexOf('/') === -1) { return genericPointer; }\r\n let possibleReferences = true;\r\n while (possibleReferences) {\r\n possibleReferences = false;\r\n recursiveRefMap.forEach((toPointer, fromPointer) => {\r\n if (JsonPointer.isSubPointer(toPointer, fromPointer)) {\r\n while (JsonPointer.isSubPointer(fromPointer, genericPointer, true)) {\r\n genericPointer = JsonPointer.toGenericPointer(\r\n toPointer + genericPointer.slice(fromPointer.length), arrayMap\r\n );\r\n possibleReferences = true;\r\n }\r\n }\r\n });\r\n }\r\n return genericPointer;\r\n}\r\n\r\n/**\r\n * 'getInputType' function\r\n *\r\n * // schema\r\n * // { any = null } layoutNode\r\n * // { string }\r\n */\r\nexport function getInputType(schema, layoutNode: any = null) {\r\n // x-schema-form = Angular Schema Form compatibility\r\n // widget & component = React Jsonschema Form compatibility\r\n const controlType = JsonPointer.getFirst([\r\n [schema, '/x-schema-form/type'],\r\n [schema, '/x-schema-form/widget/component'],\r\n [schema, '/x-schema-form/widget'],\r\n [schema, '/widget/component'],\r\n [schema, '/widget']\r\n ]);\r\n if (isString(controlType)) { return checkInlineType(controlType, schema, layoutNode); }\r\n let schemaType = schema.type;\r\n if (schemaType) {\r\n if (isArray(schemaType)) { // If multiple types listed, use most inclusive type\r\n schemaType =\r\n inArray('object', schemaType) && hasOwn(schema, 'properties') ? 'object' :\r\n inArray('array', schemaType) && hasOwn(schema, 'items') ? 'array' :\r\n inArray('array', schemaType) && hasOwn(schema, 'additionalItems') ? 'array' :\r\n inArray('string', schemaType) ? 'string' :\r\n inArray('number', schemaType) ? 'number' :\r\n inArray('integer', schemaType) ? 'integer' :\r\n inArray('boolean', schemaType) ? 'boolean' : 'unknown';\r\n }\r\n if (schemaType === 'boolean') { return 'checkbox'; }\r\n if (schemaType === 'object') {\r\n if (hasOwn(schema, 'properties') || hasOwn(schema, 'additionalProperties')) {\r\n return 'section';\r\n }\r\n // TODO: Figure out how to handle additionalProperties\r\n if (hasOwn(schema, '$ref')) { return '$ref'; }\r\n }\r\n if (schemaType === 'array') {\r\n const itemsObject = JsonPointer.getFirst([\r\n [schema, '/items'],\r\n [schema, '/additionalItems']\r\n ]) || {};\r\n return hasOwn(itemsObject, 'enum') && schema.maxItems !== 1 ?\r\n checkInlineType('checkboxes', schema, layoutNode) : 'array';\r\n }\r\n if (schemaType === 'null') { return 'none'; }\r\n if (JsonPointer.has(layoutNode, '/options/titleMap') ||\r\n hasOwn(schema, 'enum') || getTitleMapFromOneOf(schema, null, true)\r\n ) { return 'select'; }\r\n if (schemaType === 'number' || schemaType === 'integer') {\r\n return (schemaType === 'integer' || hasOwn(schema, 'multipleOf')) &&\r\n hasOwn(schema, 'maximum') && hasOwn(schema, 'minimum') ? 'range' : schemaType;\r\n }\r\n if (schemaType === 'string') {\r\n return {\r\n 'color': 'color',\r\n 'date': 'date',\r\n //as per ajv date-time requires a timezone but input \r\n //datetime-local doesn't \r\n //'date-time': 'datetime-local',\r\n 'iso-date-time':'datetime-local',\r\n 'email': 'email',\r\n 'uri': 'url',\r\n }[schema.format] || 'text';\r\n }\r\n }\r\n if (hasOwn(schema, '$ref')) { return '$ref'; }\r\n //if (isArray(schema.anyOf)) { return 'any-of'; }//treated as allOf\r\n if (isArray(schema.oneOf) ) { return 'one-of'; }//{ return 'tabarray'; }\r\n if (hasOwn(schema, 'if')) { return 'if'; }\r\n if (hasOwn(schema, 'then')) { return 'then'; }\r\n if (hasOwn(schema, 'else')) { return 'else'; }\r\n console.error(`getInputType error: Unable to determine input type for ${schemaType}`);\r\n console.error('schema', schema);\r\n if (layoutNode) { console.error('layoutNode', layoutNode); }\r\n return 'none';\r\n}\r\n\r\n/**\r\n * 'checkInlineType' function\r\n *\r\n * Checks layout and schema nodes for 'inline: true', and converts\r\n * 'radios' or 'checkboxes' to 'radios-inline' or 'checkboxes-inline'\r\n *\r\n * // { string } controlType -\r\n * // schema -\r\n * // { any = null } layoutNode -\r\n * // { string }\r\n */\r\nexport function checkInlineType(controlType, schema, layoutNode: any = null) {\r\n if (!isString(controlType) || (\r\n controlType.slice(0, 8) !== 'checkbox' && controlType.slice(0, 5) !== 'radio'\r\n )) {\r\n return controlType;\r\n }\r\n if (\r\n JsonPointer.getFirst([\r\n [layoutNode, '/inline'],\r\n [layoutNode, '/options/inline'],\r\n [schema, '/inline'],\r\n [schema, '/x-schema-form/inline'],\r\n [schema, '/x-schema-form/options/inline'],\r\n [schema, '/x-schema-form/widget/inline'],\r\n [schema, '/x-schema-form/widget/component/inline'],\r\n [schema, '/x-schema-form/widget/component/options/inline'],\r\n [schema, '/widget/inline'],\r\n [schema, '/widget/component/inline'],\r\n [schema, '/widget/component/options/inline'],\r\n ]) === true\r\n ) {\r\n return controlType.slice(0, 5) === 'radio' ?\r\n 'radios-inline' : 'checkboxes-inline';\r\n } else {\r\n return controlType;\r\n }\r\n}\r\n\r\n/**\r\n * 'isInputRequired' function\r\n *\r\n * Checks a JSON Schema to see if an item is required\r\n *\r\n * // schema - the schema to check\r\n * // { string } schemaPointer - the pointer to the item to check\r\n * // { boolean } - true if the item is required, false if not\r\n */\r\nexport function isInputRequired(schema, schemaPointer) {\r\n if (!isObject(schema)) {\r\n console.error('isInputRequired error: Input schema must be an object.');\r\n return false;\r\n }\r\n const listPointerArray = JsonPointer.parse(schemaPointer);\r\n if (isArray(listPointerArray)) {\r\n if (!listPointerArray.length) { return schema.required === true; }\r\n const keyName = listPointerArray.pop();\r\n const nextToLastKey = listPointerArray[listPointerArray.length - 1];\r\n if (['properties', 'additionalProperties', 'patternProperties', 'items', 'additionalItems']\r\n .includes(nextToLastKey)\r\n ) {\r\n listPointerArray.pop();\r\n }\r\n const parentSchema = JsonPointer.get(schema, listPointerArray) || {};\r\n if (isArray(parentSchema.required)) {\r\n return parentSchema.required.includes(keyName);\r\n }\r\n if (parentSchema.type === 'array') {\r\n return hasOwn(parentSchema, 'minItems') &&\r\n isNumber(keyName) &&\r\n +parentSchema.minItems > +keyName;\r\n }\r\n }\r\n return false;\r\n}\r\n\r\n/**\r\n * 'updateInputOptions' function\r\n *\r\n * // layoutNode\r\n * // schema\r\n * // jsf\r\n * // { void }\r\n */\r\nexport function updateInputOptions(layoutNode, schema, jsf) {\r\n if (!isObject(layoutNode) || !isObject(layoutNode.options)) { return; }\r\n\r\n // Set all option values in layoutNode.options\r\n const newOptions: any = { };\r\n const fixUiKeys = key => key.slice(0, 3).toLowerCase() === 'ui:' ? key.slice(3) : key;\r\n mergeFilteredObject(newOptions, jsf.formOptions.defaultWidgetOptions, [], fixUiKeys);\r\n [ [ JsonPointer.get(schema, '/ui:widget/options'), [] ],\r\n [ JsonPointer.get(schema, '/ui:widget'), [] ],\r\n [ schema, [\r\n 'additionalProperties', 'additionalItems', 'properties', 'items',\r\n 'required', 'type', 'x-schema-form', '$ref'\r\n ] ],\r\n [ JsonPointer.get(schema, '/x-schema-form/options'), [] ],\r\n [ JsonPointer.get(schema, '/x-schema-form'), ['items', 'options'] ],\r\n [ layoutNode, [\r\n '_id', '$ref', 'arrayItem', 'arrayItemType', 'dataPointer', 'dataType',\r\n 'items', 'key', 'name', 'options', 'recursiveReference', 'type', 'widget'\r\n ] ],\r\n [ layoutNode.options, [] ],\r\n ].forEach(([ object, excludeKeys ]) =>\r\n mergeFilteredObject(newOptions, object, excludeKeys, fixUiKeys)\r\n );\r\n if (!hasOwn(newOptions, 'titleMap')) {\r\n let newTitleMap: any = null;\r\n newTitleMap = getTitleMapFromOneOf(schema, newOptions.flatList);\r\n if (newTitleMap) { newOptions.titleMap = newTitleMap; }\r\n if (!hasOwn(newOptions, 'titleMap') && !hasOwn(newOptions, 'enum') && hasOwn(schema, 'items')) {\r\n if (JsonPointer.has(schema, '/items/titleMap')) {\r\n newOptions.titleMap = schema.items.titleMap;\r\n } else if (JsonPointer.has(schema, '/items/enum')) {\r\n newOptions.enum = schema.items.enum;\r\n if (!hasOwn(newOptions, 'enumNames') && JsonPointer.has(schema, '/items/enumNames')) {\r\n newOptions.enumNames = schema.items.enumNames;\r\n }\r\n } else if (JsonPointer.has(schema, '/items/oneOf')) {\r\n newTitleMap = getTitleMapFromOneOf(schema.items, newOptions.flatList);\r\n if (newTitleMap) { newOptions.titleMap = newTitleMap; }\r\n }\r\n }\r\n }\r\n\r\n // If schema type is integer, enforce by setting multipleOf = 1\r\n if (schema.type === 'integer' && !hasValue(newOptions.multipleOf)) {\r\n newOptions.multipleOf = 1;\r\n }\r\n\r\n // Copy any typeahead word lists to options.typeahead.source\r\n if (JsonPointer.has(newOptions, '/autocomplete/source')) {\r\n newOptions.typeahead = newOptions.autocomplete;\r\n } else if (JsonPointer.has(newOptions, '/tagsinput/source')) {\r\n newOptions.typeahead = newOptions.tagsinput;\r\n } else if (JsonPointer.has(newOptions, '/tagsinput/typeahead/source')) {\r\n newOptions.typeahead = newOptions.tagsinput.typeahead;\r\n }\r\n\r\n layoutNode.options = newOptions;\r\n}\r\n\r\n/**\r\n * 'getTitleMapFromOneOf' function\r\n *\r\n * // { schema } schema\r\n * // { boolean = null } flatList\r\n * // { boolean = false } validateOnly\r\n * // { validators }\r\n */\r\nexport function getTitleMapFromOneOf(\r\n schema: any = {}, flatList: boolean = null, validateOnly = false\r\n) {\r\n let titleMap = null;\r\n const oneOf = schema.oneOf || schema.anyOf || null;\r\n if (isArray(oneOf) && oneOf.every(item => item.title)) {\r\n if (oneOf.every(item => isArray(item.enum) && item.enum.length === 1)) {\r\n if (validateOnly) { return true; }\r\n titleMap = oneOf.map(item => ({ name: item.title, value: item.enum[0] }));\r\n } else if (oneOf.every(item => item.const)) {\r\n if (validateOnly) { return true; }\r\n titleMap = oneOf.map(item => ({ name: item.title, value: item.const }));\r\n }\r\n\r\n // if flatList !== false and some items have colons, make grouped map\r\n if (flatList !== false && (titleMap || [])\r\n .filter(title => ((title || {}).name || '').indexOf(': ')).length > 1\r\n ) {\r\n\r\n // Split name on first colon to create grouped map (name -> group: name)\r\n const newTitleMap = titleMap.map(title => {\r\n const [group, name] = title.name.split(/: (.+)/);\r\n return group && name ? { ...title, group, name } : title;\r\n });\r\n\r\n // If flatList === true or at least one group has multiple items, use grouped map\r\n if (flatList === true || newTitleMap.some((title, index) => index &&\r\n hasOwn(title, 'group') && title.group === newTitleMap[index - 1].group\r\n )) {\r\n titleMap = newTitleMap;\r\n }\r\n }\r\n }\r\n return validateOnly ? false : titleMap;\r\n}\r\n\r\n/**\r\n * 'getControlValidators' function\r\n *\r\n * // schema\r\n * // { validators }\r\n */\r\nexport function getControlValidators(schema) {\r\n if (!isObject(schema)) { return null; }\r\n const validators: any = { };\r\n if (hasOwn(schema, 'type')) {\r\n switch (schema.type) {\r\n case 'string':\r\n forEach(['pattern', 'format', 'minLength', 'maxLength'], (prop) => {\r\n if (hasOwn(schema, prop)) { validators[prop] = [schema[prop]]; }\r\n });\r\n break;\r\n case 'number': case 'integer':\r\n forEach(['Minimum', 'Maximum'], (ucLimit) => {\r\n const eLimit = 'exclusive' + ucLimit;\r\n const limit = ucLimit.toLowerCase();\r\n if (hasOwn(schema, limit)) {\r\n const exclusive = hasOwn(schema, eLimit) && schema[eLimit] === true;\r\n validators[limit] = [schema[limit], exclusive];\r\n }\r\n });\r\n forEach(['multipleOf', 'type'], (prop) => {\r\n if (hasOwn(schema, prop)) { validators[prop] = [schema[prop]]; }\r\n });\r\n break;\r\n case 'object':\r\n forEach(['minProperties', 'maxProperties', 'dependencies'], (prop) => {\r\n if (hasOwn(schema, prop)) { validators[prop] = [schema[prop]]; }\r\n });\r\n break;\r\n case 'array':\r\n forEach(['minItems', 'maxItems', 'uniqueItems'], (prop) => {\r\n if (hasOwn(schema, prop)) { validators[prop] = [schema[prop]]; }\r\n });\r\n break;\r\n }\r\n }\r\n if (hasOwn(schema, 'enum')) { validators.enum = [schema.enum]; }\r\n return validators;\r\n}\r\n\r\n/**\r\n * 'resolveSchemaReferences' function\r\n *\r\n * Find all $ref links in schema and save links and referenced schemas in\r\n * schemaRefLibrary, schemaRecursiveRefMap, and dataRecursiveRefMap\r\n *\r\n * // schema\r\n * // schemaRefLibrary\r\n * // { Map<string, string> } schemaRecursiveRefMap\r\n * // { Map<string, string> } dataRecursiveRefMap\r\n * // { Map<string, number> } arrayMap\r\n * //\r\n */\r\nexport function resolveSchemaReferences(\r\n schema, schemaRefLibrary, schemaRecursiveRefMap, dataRecursiveRefMap, arrayMap\r\n) {\r\n if (!isObject(schema)) {\r\n console.error('resolveSchemaReferences error: schema must be an object.');\r\n return;\r\n }\r\n const refLinks = new Set<string>();\r\n const refMapSet = new Set<string>();\r\n const refMap = new Map<string, string>();\r\n const recursiveRefMap = new Map<string, string>();\r\n const refLibrary: any = {};\r\n\r\n // Search schema for all $ref links, and build full refLibrary\r\n JsonPointer.forEachDeep(schema, (subSchema, subSchemaPointer) => {\r\n if (hasOwn(subSchema, '$ref') && isString(subSchema['$ref'])) {\r\n const refPointer = JsonPointer.compile(subSchema['$ref']);\r\n refLinks.add(refPointer);\r\n refMapSet.add(subSchemaPointer + '~~' + refPointer);\r\n refMap.set(subSchemaPointer, refPointer);\r\n }\r\n });\r\n refLinks.forEach(ref => refLibrary[ref] = getSubSchema(schema, ref));\r\n\r\n // Follow all ref links and save in refMapSet,\r\n // to find any multi-link recursive refernces\r\n let checkRefLinks = true;\r\n while (checkRefLinks) {\r\n checkRefLinks = false;\r\n Array.from(refMap).forEach(([fromRef1, toRef1]) => Array.from(refMap)\r\n .filter(([fromRef2, toRef2]) =>\r\n JsonPointer.isSubPointer(toRef1, fromRef2, true) &&\r\n !JsonPointer.isSubPointer(toRef2, toRef1, true) &&\r\n !refMapSet.has(fromRef1 + fromRef2.slice(toRef1.length) + '~~' + toRef2)\r\n )\r\n .forEach(([fromRef2, toRef2]) => {\r\n refMapSet.add(fromRef1 + fromRef2.slice(toRef1.length) + '~~' + toRef2);\r\n checkRefLinks = true;\r\n })\r\n );\r\n }\r\n\r\n // Build full recursiveRefMap\r\n // First pass - save all internally recursive refs from refMapSet\r\n Array.from(refMapSet)\r\n .map(refLink => refLink.split('~~'))\r\n .filter(([fromRef, toRef]) => JsonPointer.isSubPointer(toRef, fromRef))\r\n .forEach(([fromRef, toRef]) => recursiveRefMap.set(fromRef, toRef));\r\n // Second pass - create recursive versions of any other refs that link to recursive refs\r\n Array.from(refMap)\r\n .filter(([fromRef1, toRef1]) => Array.from(recursiveRefMap.keys())\r\n .every(fromRef2 => !JsonPointer.isSubPointer(fromRef1, fromRef2, true))\r\n )\r\n .forEach(([fromRef1, toRef1]) => Array.from(recursiveRefMap)\r\n .filter(([fromRef2, toRef2]) =>\r\n !recursiveRefMap.has(fromRef1 + fromRef2.slice(toRef1.length)) &&\r\n JsonPointer.isSubPointer(toRef1, fromRef2, true) &&\r\n !JsonPointer.isSubPointer(toRef1, fromRef1, true)\r\n )\r\n .forEach(([fromRef2, toRef2]) => recursiveRefMap.set(\r\n fromRef1 + fromRef2.slice(toRef1.length),\r\n fromRef1 + toRef2.slice(toRef1.length)\r\n ))\r\n );\r\n\r\n // Create compiled schema by replacing all non-recursive $ref links with\r\n // thieir linked schemas and, where possible, combining schemas in allOf arrays.\r\n let compiledSchema = { ...schema };\r\n delete compiledSchema.definitions;\r\n compiledSchema =\r\n getSubSchema(compiledSchema, '', refLibrary, recursiveRefMap);\r\n\r\n // Make sure all remaining schema $refs are recursive, and build final\r\n // schemaRefLibrary, schemaRecursiveRefMap, dataRecursiveRefMap, & arrayMap\r\n JsonPointer.forEachDeep(compiledSchema, (subSchema, subSchemaPointer) => {\r\n if (isString(subSchema['$ref'])) {\r\n let refPointer = JsonPointer.compile(subSchema['$ref']);\r\n if (!JsonPointer.isSubPointer(refPointer, subSchemaPointer, true)) {\r\n refPointer = removeRecursiveReferences(subSchemaPointer, recursiveRefMap);\r\n JsonPointer.set(compiledSchema, subSchemaPointer, { $ref: `#${refPointer}` });\r\n }\r\n if (!hasOwn(schemaRefLibrary, 'refPointer')) {\r\n schemaRefLibrary[refPointer] = !refPointer.length ? compiledSchema :\r\n getSubSchema(compiledSchema, refPointer, schemaRefLibrary, recursiveRefMap);\r\n }\r\n if (!schemaRecursiveRefMap.has(subSchemaPointer)) {\r\n schemaRecursiveRefMap.set(subSchemaPointer, refPointer);\r\n }\r\n const fromDataRef = JsonPointer.toDataPointer(subSchemaPointer, compiledSchema);\r\n if (!dataRecursiveRefMap.has(fromDataRef)) {\r\n const toDataRef = JsonPointer.toDataPointer(refPointer, compiledSchema);\r\n dataRecursiveRefMap.set(fromDataRef, toDataRef);\r\n }\r\n }\r\n if (subSchema.type === 'array' &&\r\n (hasOwn(subSchema, 'items') || hasOwn(subSchema, 'additionalItems'))\r\n ) {\r\n const dataPointer = JsonPointer.toDataPointer(subSchemaPointer, compiledSchema);\r\n if (!arrayMap.has(dataPointer)) {\r\n const tupleItems = isArray(subSchema.items) ? subSchema.items.length : 0;\r\n arrayMap.set(dataPointer, tupleItems);\r\n }\r\n }\r\n }, true);\r\n return compiledSchema;\r\n}\r\n\r\n/**\r\n * 'getSubSchema' function\r\n *\r\n * // schema\r\n * // { Pointer } pointer\r\n * // { object } schemaRefLibrary\r\n * // { Map<string, string> } schemaRecursiveRefMap\r\n * // { string[] = [] } usedPointers\r\n * //\r\n */\r\nexport function getSubSchema(\r\n schema, pointer, schemaRefLibrary = null,\r\n schemaRecursiveRefMap: Map<string, string> = null, usedPointers: string[] = []\r\n) {\r\n if (!schemaRefLibrary || !schemaRecursiveRefMap) {\r\n return JsonPointer.getCopy(schema, pointer);\r\n }\r\n if (typeof pointer !== 'string') { pointer = JsonPointer.compile(pointer); }\r\n usedPointers = [ ...usedPointers, pointer ];\r\n let newSchema: any = null;\r\n if (pointer === '') {\r\n newSchema = cloneDeep(schema);\r\n } else {\r\n const shortPointer = removeRecursiveReferences(pointer, schemaRecursiveRefMap);\r\n if (shortPointer !== pointer) { usedPointers = [ ...usedPointers, shortPointer ]; }\r\n newSchema = JsonPointer.getFirstCopy([\r\n [schemaRefLibrary, [shortPointer]],\r\n [schema, pointer],\r\n [schema, shortPointer]\r\n ]);\r\n }\r\n return JsonPointer.forEachDeepCopy(newSchema, (subSchema, subPointer) => {\r\n if (isObject(subSchema)) {\r\n\r\n // Replace non-recursive $ref links with referenced schemas\r\n if (isString(subSchema.$ref)) {\r\n const refPointer = JsonPointer.compile(subSchema.$ref);\r\n if (refPointer.length && usedPointers.every(ptr =>\r\n !JsonPointer.isSubPointer(refPointer, ptr, true)\r\n )) {\r\n const refSchema = getSubSchema(\r\n schema, refPointer, schemaRefLibrary, schemaRecursiveRefMap, usedPointers\r\n );\r\n if (Object.keys(subSchema).length === 1) {\r\n return refSchema;\r\n } else {\r\n const extraKeys = { ...subSchema };\r\n delete extraKeys.$ref;\r\n return mergeSchemas(refSchema, extraKeys);\r\n }\r\n }\r\n }\r\n\r\n // TODO: Convert schemas with 'type' arrays to 'oneOf'\r\n\r\n // Combine allOf subSchemas\r\n if (isArray(subSchema.allOf)) { return combineAllOf(subSchema); }\r\n\r\n // Fix incorrectly placed array object required lists\r\n if (subSchema.type === 'array' && isArray(subSchema.required)) {\r\n return fixRequiredArrayProperties(subSchema);\r\n }\r\n }\r\n return subSchema;\r\n }, true, <string>pointer);\r\n}\r\n\r\n\r\nexport function omitKeys<T extends object>(objects: T[], keysToOmit: (keyof T)[]): Omit<T, keyof T>[] {\r\n return objects.map((obj) => omit(obj, keysToOmit));\r\n}\r\n\r\n\r\n\r\nexport function combineAllOfITE(schema){\r\n if(schema && schema.allOf){\r\n const allITE=schema.allOf.map(item=>{return item.if && {if:item.if}})\r\n }\r\n \r\n}\r\n\r\n/**\r\n * 'combineAllOf' function\r\n *\r\n * Attempt to convert an allOf schema object into\r\n * a non-allOf schema object with equivalent rules.\r\n *\r\n * // schema - allOf schema object\r\n * // - converted schema object\r\n */\r\nexport function combineAllOf(schema) {\r\n if (!isObject(schema) || !isArray(schema.allOf)) { return schema; }\r\n const allITE=schema.allOf.map(item=>{return item.if && item})\r\n .filter(item => !isEmpty(item));\r\n //adaped to accomodate ITE by merging all non ITE field\r\n //then readding the allOf key with only ITE\r\n let schemaITEOmitted=omitKeys(schema.allOf,['if','then','else']);\r\n let mergedSchema = mergeSchemas(...schemaITEOmitted);\r\n //mergeSchemas(...schema.allOf);\r\n if (Object.keys(schema).length > 1) {\r\n const extraKeys = { ...schema };\r\n delete extraKeys.allOf;\r\n //TODO Test-changed order to preserve originial order\r\n mergedSchema = mergeSchemas(extraKeys,mergedSchema);\r\n //mergeSchemas(mergedSchema, extraKeys);\r\n //need to put it back if ITE \r\n if(allITE && allITE.length>0){\r\n mergedSchema.allOf=mergedSchema.allOf||[];\r\n mergedSchema.allOf.push(...allITE);\r\n }\r\n }\r\n return mergedSchema;\r\n}\r\n\r\n/**\r\n * 'fixRequiredArrayProperties' function\r\n *\r\n * Fixes an incorrectly placed required list inside an array schema, by moving\r\n * it into items.properties or additionalItems.properties, where it belongs.\r\n *\r\n * // schema - allOf schema object\r\n * // - converted schema object\r\n */\r\nexport function fixRequiredArrayProperties(schema) {\r\n if (schema.type === 'array' && isArray(schema.required)) {\r\n const itemsObject = hasOwn(schema.items, 'properties') ? 'items' :\r\n hasOwn(schema.additionalItems, 'properties') ? 'additionalItems' : null;\r\n if (itemsObject && !hasOwn(schema[itemsObject], 'required') && (\r\n hasOwn(schema[itemsObject], 'additionalProperties') ||\r\n schema.required.every(key => hasOwn(schema[itemsObject].properties, key))\r\n )) {\r\n schema = cloneDeep(schema);\r\n schema[itemsObject].required = schema.required;\r\n delete schema.required;\r\n }\r\n }\r\n return schema;\r\n}\r\n\r\n /**\r\n * 'convertJSONSchemaIfToCondition' function\r\n * converts something like \r\n * \"if\": {\r\n * \"properties\": {\r\n * \"animal\": {\r\n * \"const\": \"Cat\"\r\n * },\r\n * \"habitat\":{\r\n * \"const\": \"City\"\r\n * }\r\n * }\r\n * }\r\n * to \"model.animal=='Cat' && habitat=='City\" contion\r\n * @param schema:any \r\n * @param negate:boolean=false\r\n * @returns \r\n */\r\n //TODO also handle ifs with mixed conditional such as allOf/oneOf etc\r\n /*\r\n\r\n \"if\": {\r\n \"allOf\": [\r\n {\r\n \"properties\": {\r\n \"animalType\": {\r\n \"enum\": [\"Cat\", \"Fish\"]\r\n }\r\n }\r\n },\r\n {\r\n \"properties\": {\r\n \"color\": {\r\n \"const\": \"orange\"\r\n }\r\n }\r\n }\r\n ]\r\n }\r\n\r\n\r\n\r\n */\r\nexport function convertJSONSchemaIfToCondition(schema:any,layoutNode:any,negate=false){\r\n let conditionFun=\"\";\r\n let condition={};\r\n let notOp=negate?\"!\":\"\";\r\n // expects \"dataPointer\" to be like \"/a/b/c\"\r\n //TODO-test\r\n //dataPointer can be something like /cities/-/name\r\n //must end up like model.cities[arrayIndices].name\r\n //also check can possibly be nested array like /cities/-/sites/-/siteName\r\n //in this case must probably end up like \r\n // /cities/arrayIndices[0]/sites/arrayIndices[1]/siteName\r\n //but it seems evaluatCondition support only one level for now\r\n //and uses arrayIndices as the last index only -check?\r\n let parentPath=layoutNode.dataPointer?layoutNode.dataPointer\r\n .split(\"/\")\r\n .slice(1,-1)\r\n .map((part,ind)=>{\r\n let sep=ind==0?\"\":\".\";\r\n let ret=part==\"-\"?\"[arrayIndices]\":sep+part;\r\n return ret;\r\n })\r\n .join(\"\")\r\n :\"\";\r\n let modelPath=parentPath?`model.${parentPath}`:\"model\";\r\n let checkPath=modelPath.replace(/\\[/g,\".[\").split('.').join(\"?.\")\r\n if(schema.if){\r\n Object.keys(schema.if.properties).forEach((ifProp,ind)=>{\r\n let amper=ind>0?\"&\":\"\";\r\n //Note the model value is first converted to string and so is the condition\r\n //so that booleans and numbers can also be compared \r\n //changed to an includesList to handle cases such as \r\n const includesList=hasOwn(schema.if.properties[ifProp],\"const\")?[schema.if.properties[ifProp].const]\r\n :hasOwn(schema.if.properties[ifProp],\"enum\")?schema.if.properties[ifProp].enum\r\n :[]\r\n const includesListAsStr=includesList.map(val=>{return `\"${val}\"`});\r\n conditionFun+=`${amper} ${checkPath} && [${includesListAsStr}].includes(${modelPath}.${ifProp}+\"\")`\r\n //conditionFun+=`${amper} ${checkPath} && ${modelPath}.${ifProp}+\"\"=='${schema.if.properties[ifProp].const}'`\r\n })\r\n }\r\n condition[\"functionBody\"]=`return ${notOp}(${conditionFun})`\r\n return condition;\r\n }","import cloneDeep from 'lodash/cloneDeep';\r\n\r\n/**\r\n * 'convertSchemaToDraft6' function\r\n *\r\n * Converts a JSON Schema from draft 1 through 4 format to draft 6 format\r\n *\r\n * Inspired by on geraintluff's JSON Schema 3 to 4 compatibility function:\r\n * https://github.com/geraintluff/json-schema-compatibility\r\n * Also uses suggestions from AJV's JSON Schema 4 to 6 migration guide:\r\n * https://github.com/epoberezkin/ajv/releases/tag/5.0.0\r\n * And additional details from the official JSON Schema documentation:\r\n * http://json-schema.org\r\n *\r\n * // { object } originalSchema - JSON schema (draft 1, 2, 3, 4, or 6)\r\n * // { OptionObject = {} } options - options: parent schema changed?, schema draft number?\r\n * // { object } - JSON schema (draft 6)\r\n */\r\nexport interface OptionObject { changed?: boolean; draft?: number; }\r\nexport function convertSchemaToDraft6(schema, options: OptionObject = {}) {\r\n let draft: number = options.draft || null;\r\n let changed: boolean = options.changed || false;\r\n\r\n if (typeof schema !== 'object') { return schema; }\r\n if (typeof schema.map === 'function') {\r\n return [...schema.map(subSchema => convertSchemaToDraft6(subSchema, { changed, draft }))];\r\n }\r\n let newSchema = { ...schema };\r\n const simpleTypes = ['array', 'boolean', 'integer', 'null', 'number', 'object', 'string'];\r\n\r\n if (typeof newSchema.$schema === 'string' &&\r\n /http\\:\\/\\/json\\-schema\\.org\\/draft\\-0\\d\\/schema\\#/.test(newSchema.$schema)\r\n ) {\r\n draft = newSchema.$schema[30];\r\n }\r\n\r\n // Convert v1-v2 'contentEncoding' to 'media.binaryEncoding'\r\n // Note: This is only used in JSON hyper-schema (not regular JSON schema)\r\n if (newSchema.contentEncoding) {\r\n newSchema.media = { binaryEncoding: newSchema.contentEncoding };\r\n delete newSchema.contentEncoding;\r\n changed = true;\r\n }\r\n\r\n // Convert v1-v3 'extends' to 'allOf'\r\n if (typeof newSchema.extends === 'object') {\r\n newSchema.allOf = typeof newSchema.extends.map === 'function' ?\r\n newSchema.extends.map(subSchema => convertSchemaToDraft6(subSchema, { changed, draft })) :\r\n [convertSchemaToDraft6(newSchema.extends, { changed, draft })];\r\n delete newSchema.extends;\r\n changed = true;\r\n }\r\n\r\n // Convert v1-v3 'disallow' to 'not'\r\n if (newSchema.disallow) {\r\n if (typeof newSchema.disallow === 'string') {\r\n newSchema.not = { type: newSchema.disallow };\r\n } else if (typeof newSchema.disallow.map === 'function') {\r\n newSchema.not = {\r\n anyOf: newSchema.disallow\r\n .map(type => typeof type === 'object' ? type : { type })\r\n };\r\n }\r\n delete newSchema.disallow;\r\n changed = true;\r\n }\r\n\r\n // Convert v3 string 'dependencies' properties to arrays\r\n if (typeof newSchema.dependencies === 'object' &&\r\n Object.keys(newSchema.dependencies)\r\n .some(key => typeof newSchema.dependencies[key] === 'string')\r\n ) {\r\n newSchema.dependencies = { ...newSchema.dependencies };\r\n Object.keys(newSchema.dependencies)\r\n .filter(key => typeof newSchema.dependencies[key] === 'string')\r\n .forEach(key => newSchema.dependencies[key] = [newSchema.dependencies[key]]);\r\n changed = true;\r\n }\r\n\r\n // Convert v1 'maxDecimal' to 'multipleOf'\r\n if (typeof newSchema.maxDecimal === 'number') {\r\n newSchema.multipleOf = 1 / Math.pow(10, newSchema.maxDecimal);\r\n delete newSchema.divisibleBy;\r\n changed = true;\r\n if (!draft || draft === 2) { draft = 1; }\r\n }\r\n\r\n // Convert v2-v3 'divisibleBy' to 'multipleOf'\r\n if (typeof newSchema.divisibleBy === 'number') {\r\n newSchema.multipleOf = newSchema.divisibleBy;\r\n delete newSchema.divisibleBy;\r\n changed = true;\r\n }\r\n\r\n // Convert v1-v2 boolean 'minimumCanEqual' to 'exclusiveMinimum'\r\n if (typeof newSchema.minimum === 'number' && newSchema.minimumCanEqual === false) {\r\n newSchema.exclusiveMinimum = newSchema.minimum;\r\n delete newSchema.minimum;\r\n changed = true;\r\n if (!draft) { draft = 2; }\r\n } else if (typeof newSchema.minimumCanEqual === 'boolean') {\r\n delete newSchema.minimumCanEqual;\r\n changed = true;\r\n if (!draft) { draft = 2; }\r\n }\r\n\r\n // Convert v3-v4 boolean 'exclusiveMinimum' to numeric\r\n if (typeof newSchema.minimum === 'number' && newSchema.exclusiveMinimum === true) {\r\n newSchema.exclusiveMinimum = newSchema.minimum;\r\n delete newSchema.minimum;\r\n changed = true;\r\n } else if (typeof newSchema.exclusiveMinimum === 'boolean') {\r\n delete newSchema.exclusiveMinimum;\r\n changed = true;\r\n }\r\n\r\n // Convert v1-v2 boolean 'maximumCanEqual' to 'exclusiveMaximum'\r\n if (typeof newSchema.maximum === 'number' && newSchema.maximumCanEqual === false) {\r\n newSchema.exclusiveMaximum = newSchema.maximum;\r\n delete newSchema.maximum;\r\n changed = true;\r\n if (!draft) { draft = 2; }\r\n } else if (typeof newSchema.maximumCanEqual === 'boolean') {\r\n delete newSchema.maximumCanEqual;\r\n changed = true;\r\n if (!draft) { draft = 2; }\r\n }\r\n\r\n // Convert v3-v4 boolean 'exclusiveMaximum' to numeric\r\n if (typeof newSchema.maximum === 'number' && newSchema.exclusiveMaximum === true) {\r\n newSchema.exclusiveMaximum = newSchema.maximum;\r\n delete newSchema.maximum;\r\n changed = true;\r\n } else if (typeof newSchema.exclusiveMaximum === 'boolean') {\r\n delete newSchema.exclusiveMaximum;\r\n changed = true;\r\n }\r\n\r\n // Search object 'properties' for 'optional', 'required', and 'requires' items,\r\n // and convert them into object 'required' arrays and 'dependencies' objects\r\n if (typeof newSchema.properties === 'object') {\r\n const properties = { ...newSchema.properties };\r\n const requiredKeys = Array.isArray(newSchema.required) ?\r\n new Set(newSchema.required) : new Set();\r\n\r\n // Convert v1-v2 boolean 'optional' properties to 'required' array\r\n if (draft === 1 || draft === 2 ||\r\n Object.keys(properties).some(key => properties[key].optional === true)\r\n ) {\r\n Object.keys(properties)\r\n .filter(key => properties[key].optional !== true)\r\n .forEach(key => requiredKeys.add(key));\r\n changed = true;\r\n if (!draft) { draft = 2; }\r\n }\r\n\r\n // Convert v3 boolean 'required' properties to 'required' array\r\n if (Object.keys(properties).some(key => properties[key].required === true)) {\r\n Object.keys(properties)\r\n .filter(key => properties[key].required === true)\r\n .forEach(key => requiredKeys.add(key));\r\n changed = true;\r\n }\r\n\r\n if (requiredKeys.size) { newSchema.required = Array.from(requiredKeys); }\r\n\r\n // Convert v1-v2 array or string 'requires' properties to 'dependencies' object\r\n if (Object.keys(properties).some(key => properties[key].requires)) {\r\n const dependencies = typeof newSchema.dependencies === 'object' ?\r\n { ...newSchema.dependencies } : {};\r\n Object.keys(properties)\r\n .filter(key => properties[key].requires)\r\n .forEach(key => dependencies[key] =\r\n typeof properties[key].requires === 'string' ?\r\n [properties[key].requires] : properties[key].requires\r\n );\r\n newSchema.dependencies = dependencies;\r\n changed = true;\r\n if (!draft) { draft = 2; }\r\n }\r\n\r\n newSchema.properties = properties;\r\n }\r\n\r\n // Revove v1-v2 boolean 'optional' key\r\n if (typeof newSchema.optional === 'boolean') {\r\n delete newSchema.optional;\r\n changed = true;\r\n if (!draft) { draft = 2; }\r\n }\r\n\r\n // Revove v1-v2 'requires' key\r\n if (newSchema.requires) {\r\n delete newSchema.requires;\r\n }\r\n\r\n // Revove v3 boolean 'required' key\r\n if (typeof newSchema.required === 'boolean') {\r\n delete newSchema.required;\r\n }\r\n\r\n // Convert id to $id\r\n if (typeof newSchema.id === 'string' && !newSchema.$id) {\r\n if (newSchema.id.slice(-1) === '#') {\r\n newSchema.id = newSchema.id.slice(0, -1);\r\n }\r\n newSchema.$id = newSchema.id + '-CONVERTED-TO-DRAFT-06#';\r\n delete newSchema.id;\r\n changed = true;\r\n }\r\n\r\n // Check if v1-v3 'any' or object types will be converted\r\n if (newSchema.type && (typeof newSchema.type.every === 'function' ?\r\n !newSchema.type.every(type => simpleTypes.includes(type)) :\r\n !simpleTypes.includes(newSchema.type)\r\n )) {\r\n changed = true;\r\n }\r\n\r\n // If schema changed, update or remove $schema identifier\r\n if (typeof newSchema.$schema === 'string' &&\r\n /http\\:\\/\\/json\\-schema\\.org\\/draft\\-0[1-4]\\/schema\\#/.test(newSchema.$schema)\r\n ) {\r\n newSchema.$schema = 'http://json-schema.org/draft-06/schema#';\r\n changed = true;\r\n } else if (changed && typeof newSchema.$schema === 'string') {\r\n const addToDescription = 'Converted to draft 6 from ' + newSchema.$schema;\r\n if (typeof newSchema.description === 'string' && newSchema.description.length) {\r\n newSchema.description += '\\n' + addToDescription;\r\n } else {\r\n newSchema.description = addToDescription;\r\n }\r\n delete newSchema.$schema;\r\n }\r\n\r\n // Convert v1-v3 'any' and object types\r\n if (newSchema.type && (typeof newSchema.type.every === 'function' ?\r\n !newSchema.type.every(type => simpleTypes.includes(type)) :\r\n !simpleTypes.includes(newSchema.type)\r\n )) {\r\n if (newSchema.type.length === 1) { newSchema.type = newSchema.type[0]; }\r\n if (typeof newSchema.type === 'string') {\r\n // Convert string 'any' type to array of all standard types\r\n if (newSchema.type === 'any') {\r\n newSchema.type = simpleTypes;\r\n // Delete non-standard string type\r\n } else {\r\n delete newSchema.type;\r\n }\r\n } else if (typeof newSchema.type === 'object') {\r\n if (typeof newSchema.type.every === 'function') {\r\n // If array of strings, only allow standard types\r\n if (newSchema.type.every(type => typeof type === 'string')) {\r\n newSchema.type = newSchema.type.some(type => type === 'any') ?\r\n newSchema.type = simpleTypes :\r\n newSchema.type.filter(type => simpleTypes.includes(type));\r\n // If type is an array with objects, convert the current schema to an 'anyOf' array\r\n } else if (newSchema.type.length > 1) {\r\n const arrayKeys = ['additionalItems', 'items', 'maxItems', 'minItems', 'uniqueItems', 'contains'];\r\n const numberKeys = ['multipleOf', 'maximum', 'exclusiveMaximum', 'minimum', 'exclusiveMinimum'];\r\n const objectKeys = ['maxProperties', 'minProperties', 'required', 'additionalProperties',\r\n 'properties', 'patternProperties', 'dependencies', 'propertyNames'];\r\n const stringKeys = ['maxLength', 'minLength', 'pattern', 'format'];\r\n const filterKeys = {\r\n 'array': [...numberKeys, ...objectKeys, ...stringKeys],\r\n 'integer': [...arrayKeys, ...objectKeys, ...stringKeys],\r\n 'number': [...arrayKeys, ...objectKeys, ...stringKeys],\r\n 'object': [...arrayKeys, ...numberKeys, ...stringKeys],\r\n 'string': [...arrayKeys, ...numberKeys, ...objectKeys],\r\n 'all': [...arrayKeys, ...numberKeys, ...objectKeys, ...stringKeys],\r\n };\r\n const anyOf = [];\r\n for (const type of newSchema.type) {\r\n const newType = typeof type === 'string' ? { type } : { ...type };\r\n Object.keys(newSchema)\r\n .filter(key => !newType.hasOwnProperty(key) &&\r\n ![...(filterKeys[newType.type] || filterKeys.all), 'type', 'default']\r\n .includes(key)\r\n )\r\n .forEach(key => newType[key] = newSchema[key]);\r\n anyOf.push(newType);\r\n }\r\n newSchema = newSchema.hasOwnProperty('default') ?\r\n { anyOf, default: newSchema.default } : { anyOf };\r\n // If type is an object, merge it with the current schema\r\n } else {\r\n const typeSchema = newSchema.type;\r\n delete newSchema.type;\r\n Object.assign(newSchema, typeSchema);\r\n }\r\n }\r\n } else {\r\n delete newSchema.type;\r\n }\r\n }\r\n\r\n // Convert sub schemas\r\n Object.keys(newSchema)\r\n .filter(key => typeof newSchema[key] === 'object')\r\n .forEach(key => {\r\n if (\r\n ['definitions', 'dependencies', 'properties', 'patternProperties']\r\n .includes(key) && typeof newSchema[key].map !== 'function'\r\n ) {\r\n const newKey = {};\r\n Object.keys(newSchema[key]).forEach(subKey => newKey[subKey] =\r\n convertSchemaToDraft6(newSchema[key][subKey], { changed, draft })\r\n );\r\n newSchema[key] = newKey;\r\n } else if (\r\n ['items', 'additionalItems', 'additionalProperties',\r\n 'allOf', 'anyOf', 'oneOf', 'not'].includes(key)\r\n ) {\r\n newSchema[key] = convertSchemaToDraft6(newSchema[key], { changed, draft });\r\n } else {\r\n newSchema[key] = cloneDeep(newSchema[key]);\r\n }\r\n });\r\n\r\n return newSchema;\r\n}\r\n","import {\r\n AbstractControl,\r\n UntypedFormArray,\r\n UntypedFormControl,\r\n UntypedFormGroup,\r\n ValidatorFn\r\n} from '@angular/forms';\r\nimport cloneDeep from 'lodash/cloneDeep';\r\nimport filter from 'lodash/filter';\r\nimport map from 'lodash/map';\r\nimport { getControlValidators, removeRecursiveReferences } from './json-schema.functions';\r\nimport { JsonValidators } from './json.validators';\r\nimport { JsonPointer, Pointer } from './jsonpointer.functions';\r\nimport { forEach, hasOwn } from './utility.functions';\r\nimport {\r\n SchemaPrimitiveType,\r\n hasValue,\r\n inArray,\r\n isArray,\r\n isDate,\r\n isDefined,\r\n isEmpty,\r\n isObject,\r\n isPrimitive,\r\n toJavaScriptType,\r\n toSchemaType\r\n} from './validator.functions';\r\n\r\n/**\r\n * path2ControlKey takes a datapointer path like /some/pointer/path\r\n * and returns something like $some$pointer$path\r\n * used mainly to convert paths so it can be used as keys in FormGroups\r\n * fot ITE scenarios\r\n * @param path \r\n * @returns string\r\n */\r\nexport function path2ControlKey(path: string) {\r\n return path.replace(/\\//g, \"$\")\r\n}\r\n\r\n\r\n/**\r\n * FormGroup function library:\r\n *\r\n * buildFormGroupTemplate: Builds a FormGroupTemplate from schema\r\n *\r\n * buildFormGroup: Builds an Angular FormGroup from a FormGroupTemplate\r\n *\r\n * mergeValues:\r\n *\r\n * setRequiredFields:\r\n *\r\n * formatFormData:\r\n *\r\n * getControl:\r\n *\r\n * ---- TODO: ----\r\n * TODO: add buildFormGroupTemplateFromLayout function\r\n * buildFormGroupTemplateFromLayout: Builds a FormGroupTemplate from a form layout\r\n */\r\n\r\n/**\r\n * 'buildFormGroupTemplate' function\r\n *\r\n * Builds a template for an Angular FormGroup from a JSON Schema.\r\n *\r\n * TODO: add support for pattern properties\r\n * https://spacetelescope.github.io/understanding-json-schema/reference/object.html\r\n *\r\n * // {any} jsf -\r\n * // {any = null} nodeValue -\r\n * // {boolean = true} mapArrays -\r\n * // {string = ''} schemaPointer -\r\n * // {string = ''} dataPointer -\r\n * // {any = ''} templatePointer -\r\n * // {any} -\r\n */\r\n\r\nexport function buildFormGroupTemplate(\r\n jsf: any, nodeValue: any = null, setValues = true,\r\n schemaPointer = '', dataPointer = '', templatePointer = ''\r\n) {\r\n const schema = JsonPointer.get(jsf.schema, schemaPointer);\r\n if (setValues) {\r\n if (!isDefined(nodeValue) && (\r\n jsf.formOptions.setSchemaDefaults === true ||\r\n (jsf.formOptions.setSchemaDefaults === 'auto' && isEmpty(jsf.formValues))\r\n )) {\r\n nodeValue = JsonPointer.get(jsf.schema, schemaPointer + '/default');\r\n }\r\n } else {\r\n nodeValue = null;\r\n }\r\n // TODO: If nodeValue still not set, check layout for default value\r\n const schemaType: string | string[] = JsonPointer.get(schema, '/type');\r\n const isIfThenElse = hasOwn(schema, 'if') || hasOwn(schema, 'then') || hasOwn(schema, 'else');\r\n const controlType = isIfThenElse && !schemaType ? 'IfThenElse' :\r\n (hasOwn(schema, 'properties') || hasOwn(schema, 'additionalProperties')\r\n\r\n ) &&\r\n schemaType === 'object' ? 'FormGroup' :\r\n (hasOwn(schema, 'items') || hasOwn(schema, 'additionalItems')) &&\r\n schemaType === 'array' ? 'FormArray' :\r\n !schemaType && hasOwn(schema, '$ref') ? '$ref' : 'FormControl';\r\n const shortDataPointer =\r\n removeRecursiveReferences(dataPointer, jsf.dataRecursiveRefMap, jsf.arrayMap);\r\n if (!jsf.dataMap.has(shortDataPointer)) {\r\n jsf.dataMap.set(shortDataPointer, new Map());\r\n }\r\n const nodeOptions = jsf.dataMap.get(shortDataPointer);\r\n if (!nodeOptions.has('schemaType')) {\r\n nodeOptions.set('schemaPointer', schemaPointer);\r\n nodeOptions.set('schemaType', schema.type);\r\n if (schema.format) {\r\n nodeOptions.set('schemaFormat', schema.format);\r\n if (!schema.type) { nodeOptions.set('schemaType', 'string'); }\r\n }\r\n if (controlType) {\r\n nodeOptions.set('templatePointer', templatePointer);\r\n nodeOptions.set('templateType', controlType);\r\n }\r\n }\r\n let controls: any;\r\n const validators = getControlValidators(schema);\r\n switch (controlType) {\r\n\r\n case 'FormGroup':\r\n controls = {};\r\n if (hasOwn(schema, 'ui:order') || hasOwn(schema, 'properties')) {\r\n const propertyKeys = schema['ui:order'] || Object.keys(schema.properties);\r\n if (propertyKeys.includes('*') && !hasOwn(schema.properties, '*')) {\r\n const unnamedKeys = Object.keys(schema.properties)\r\n .filter(key => !propertyKeys.includes(key));\r\n for (let i = propertyKeys.length - 1; i >= 0; i--) {\r\n if (propertyKeys[i] === '*') {\r\n propertyKeys.splice(i, 1, ...unnamedKeys);\r\n }\r\n }\r\n }\r\n propertyKeys\r\n .filter(key => hasOwn(schema.properties, key) ||\r\n hasOwn(schema, 'additionalProperties')\r\n )\r\n .forEach(key => {\r\n controls[key] = buildFormGroupTemplate(\r\n jsf, JsonPointer.get(nodeValue, [<string>key]), setValues,\r\n schemaPointer + (hasOwn(schema.properties, key) ?\r\n '/properties/' + key : '/additionalProperties'\r\n ),\r\n dataPointer + '/' + key,\r\n templatePointer + '/controls/' + key\r\n );\r\n //add the $<control> type to the root\r\n //so it can be flattened and acceses directly in the formgroup\r\n //by its full '$' path\r\n [\"allOf\", \"anyOf\",\"oneOf\"].forEach(ofType => {\r\n if(controls[key].controls && controls[key].controls[`_${ofType}`]){\r\n Object.keys(controls[key].controls[`_${ofType}`]).forEach($key=>{\r\n controls[$key]=controls[key].controls[`_${ofType}`][$key];\r\n delete controls[key].controls[$key];\r\n })\r\n delete controls[key].controls[`_${ofType}`]\r\n }\r\n })\r\n } \r\n );\r\n\r\n if (hasOwn(schema, \"if\")) {\r\n [\"then\", \"else\"].forEach(con => {\r\n if (hasOwn(schema, con)) {\r\n const keySchemaPointer = `/${con}`;\r\n\r\n let thenFGTemplate = buildFormGroupTemplate(\r\n jsf, nodeValue, setValues,//false,//JsonPointer.get(nodeValue, keySchemaPointer), setValues,\r\n schemaPointer + keySchemaPointer,\r\n dataPointer,\r\n templatePointer + `/controls/${con}`\r\n );\r\n Object.assign(controls, thenFGTemplate.controls);\r\n }\r\n });\r\n }\r\n\r\n /* treat allOf the same as any of but need to add an extra\r\n condition for which anyOf item is to be rendered \r\n let allOfControls = {}\r\n let allOfAllowedKeys = [\"allOf\", \"anyOf\", \"oneOf\", \"if\", \"then\", \"else\", \"type\", \"properties\", \"items\"];\r\n if (hasOwn(schema, \"allOf\") && isArray(schema.allOf)) {\r\n schema.allOf.forEach((allOfItem, ind) => {\r\n let aoItemKeys = Object.keys(allOfItem);\r\n let foundKeys = allOfAllowedKeys.filter(value =>\r\n aoItemKeys.includes(value)\r\n );\r\n if (foundKeys && foundKeys.length > 0) {\r\n const keySchemaPointer = `/allOf/${ind}`;\r\n //console.log(`found:${keySchemaPointer}`);\r\n let allOfFGTemplate = buildFormGroupTemplate(\r\n jsf, JsonPointer.get(nodeValue, keySchemaPointer), setValues,\r\n schemaPointer + keySchemaPointer,\r\n dataPointer,\r\n templatePointer + '/controls/' + ind\r\n );\r\n if (allOfFGTemplate.controls) {\r\n Object.keys(allOfFGTemplate.controls).forEach(key => {\r\n let controlKey = allOfFGTemplate.controls[key].schemaPointer || `${schemaPointer}${keySchemaPointer}/${key}`;\r\n controlKey = path2ControlKey(controlKey);\r\n controls[controlKey] = {\r\n key: key,\r\n schemaPointer: schemaPointer + keySchemaPointer,\r\n controls: allOfFGTemplate.controls[key]\r\n }\r\n controls[controlKey] = allOfFGTemplate.controls[key];\r\n controls[controlKey].key = key;\r\n controls[controlKey].schemaPointer = allOfFGTemplate.controls[key].schemaPointer || schemaPointer + keySchemaPointer;\r\n\r\n controls[key] = allOfFGTemplate.controls[key];\r\n })\r\n }\r\n //add ui type items to controls\r\n if (allOfItem[\"type\"] || allOfItem[\"properties\"] || allOfItem[\"items\"]) {\r\n allOfControls[ind] = allOfFGTemplate\r\n }\r\n\r\n }\r\n\r\n })\r\n controls[\"allOf\"] = allOfControls;\r\n }\r\n */\r\n\r\n\r\n let ofAllowedKeys = [\"allOf\", \"anyOf\", \"oneOf\", \"if\", \"then\", \"else\", \"type\", \"properties\", \"items\"];\r\n [\"allOf\", \"anyOf\",\"oneOf\"].forEach(ofType => {\r\n if (hasOwn(schema, ofType) && isArray(schema[ofType])) {\r\n schema[ofType].forEach((ofItem, ind) => {\r\n let aoItemKeys = Object.keys(ofItem);\r\n let foundKeys = ofAllowedKeys.filter(value =>\r\n aoItemKeys.includes(value)\r\n );\r\n if (foundKeys && foundKeys.length > 0) {\r\n const keySchemaPointer = `/${ofType}/${ind}`;\r\n //console.log(`found:${keySchemaPointer}`);\r\n let newNodeValue=nodeValue;\r\n //JsonPointer.get(nodeValue, dataPointer);\r\n //JsonPointer.get(nodeValue, keySchemaPointer);\r\n if(ofType==\"oneOf\"){\r\n newNodeValue=nodeValue;\r\n }\r\n let allOfFGTemplate = buildFormGroupTemplate(\r\n jsf, newNodeValue, setValues,\r\n schemaPointer + keySchemaPointer,\r\n dataPointer,\r\n templatePointer + '/controls/' + ind\r\n );\r\n if (allOfFGTemplate.controls) {\r\n Object.keys(allOfFGTemplate.controls).forEach(key => {\r\n const l2SchemaPointer = hasOwn(schema,'properties') ?\r\n '/properties/' +key:key;\r\n let controlKey = allOfFGTemplate.controls[key].schemaPointer || `${schemaPointer}${keySchemaPointer}${l2SchemaPointer}`;\r\n controlKey = path2ControlKey(controlKey);\r\n /*\r\n controls[controlKey] = {\r\n key: key,\r\n schemaPointer: `${schemaPointer}${keySchemaPointer}/${key}`,//schemaPointer + keySchemaPointer,\r\n controls: allOfFGTemplate.controls[key]\r\n }\r\n */\r\n \r\n let controlItem=cloneDeep(allOfFGTemplate.controls[key]);\r\n controlItem.key = key;\r\n controlItem.schemaPointer = controlItem.schemaPointer|| `${schemaPointer}${keySchemaPointer}${l2SchemaPointer}`;\r\n \r\n controls[controlKey]=controlItem\r\n //need to test if value matches schema,\r\n //as the same oneOf item will be assigned to the same value\r\n //if key is a $oneOf key then it was inserted at the root of the controls\r\n //as form control name will be the full(escaped) path \r\n const pointerPath=key.startsWith('$oneOf')?controlItem.schemaPointer:keySchemaPointer\r\n let oneOfItemSchema=JsonPointer.get(jsf.schema,controlItem.schemaPointer);\r\n //JsonPointer.get(schema,pointerPath);\r\n let dPointer= controlItem.schemaPointer.replace(/(anyOf|allOf|oneOf|none)\\/[\\d]+\\//g, '')\r\n .replace(/(if|then|else|properties)\\//g, '').replace(/\\/items\\//g,'/-/');\r\n dPointer=dPointer.indexOf(dataPointer)==0\r\n ?dPointer.substring(dataPointer.length):dPointer;\r\n //dataPointer+\"/\"+controlItem.schemaPointer.split(\"/\").slice(-1)[0];\r\n ////controlItem.schemaPointer.replace(/(anyOf|allOf|oneOf|none)\\/[\\d]+\\//g, '')\r\n ////.replace(/(if|then|else|properties)\\//g, '').replace(/\\/items\\//g,'/-/');\r\n //JsonPointer.toDataPointer(controlItem.schemaPointer,jsf.schema);\r\n //console.log(`dataPointer:${dataPointer}\\ndPointer:${dPointer}`)\r\n let dVal=//JsonPointer.get(jsf.formValues,dPointer);\r\n JsonPointer.get(nodeValue,dPointer);\r\n let fkey=key;\r\n let oneOfItemValue=dVal;\r\n /*\r\n if(hasOwn(oneOfItemSchema,\"if\") && controlItem.schemaPointer\r\n && controlItem.schemaPointer.indexOf(keySchemaPointer)==0){\r\n let parts=controlItem.schemaPointer\r\n .split(keySchemaPointer).join('').split(\"/\")\r\n let thenOrElse=parts[1];\r\n fkey=parts[parts.length-1];\r\n oneOfItemSchema=oneOfItemSchema[thenOrElse];\r\n }\r\n \r\n if(oneOfItemSchema.properties && jsf.formValues===undefined){\r\n //check if no form data values were supplied\r\n //then set it to default otherwise to its nodevalue\r\n oneOfItemValue=oneOfItemSchema.default\r\n oneOfItemValue[fkey]=oneOfItemSchema.properties[fkey]?.default;\r\n }\r\n if(oneOfItemSchema.properties && jsf.formValues!=undefined){\r\n oneOfItemValue ={};\r\n //nodeValue||{};\r\n oneOfItemValue[fkey]=nodeValue&&nodeValue[fkey];\r\n }\r\n if(!oneOfItemSchema.properties && jsf.formValues==undefined){\r\n oneOfItemValue=oneOfItemSchema.default;\r\n }\r\n */\r\n if(hasOwn(controlItem,\"value\")){\r\n if(!jsf.ajv.validate(oneOfItemSchema,oneOfItemValue)){\r\n controlItem.value.value=null;\r\n }else{\r\n ///controlItem.value.value=oneOfItemValue[fkey];\r\n controlItem.value.value=oneOfItemSchema.properties?oneOfItemValue[fkey]:oneOfItemValue;\r\n } \r\n }\r\n\r\n //controls[controlKey] = controlItem;\r\n\r\n //allOfFGTemplate.controls[key].schemaPointer ||`${schemaPointer}${keySchemaPointer}/${key}`;\r\n //allOfFGTemplate.controls[key].schemaPointer || schemaPointer + keySchemaPointer;\r\n \r\n ///////controls[key] = cloneDeep(allOfFGTemplate.controls[key]);\r\n //add schemacontrol to root \r\n //controls[controlKey]=controlItem\r\n controls[`_${ofType}`]=controls[`_${ofType}`]||{};\r\n controls[`_${ofType}`][controlKey]=controlItem\r\n //allOfFGTemplate.controls[key];\r\n })\r\n }\r\n \r\n }\r\n \r\n })\r\n }\r\n })\r\n\r\n\r\n\r\n jsf.formOptions.fieldsRequired = setRequiredFields(schema, controls);\r\n }\r\n return { controlType, controls, validators,schemaPointer };\r\n\r\n case 'FormArray':\r\n controls = [];\r\n const minItems =\r\n Math.max(schema.minItems || 0, nodeOptions.get('minItems') || 0);\r\n const maxItems =\r\n Math.min(schema.maxItems || 1000, nodeOptions.get('maxItems') || 1000);\r\n let additionalItemsPointer: string = null;\r\n if (isArray(schema.items)) { // 'items' is an array = tuple items\r\n const tupleItems = nodeOptions.get('tupleItems') ||\r\n (isArray(schema.items) ? Math.min(schema.items.length, maxItems) : 0);\r\n for (let i = 0; i < tupleItems; i++) {\r\n if (i < minItems) {\r\n controls.push(buildFormGroupTemplate(\r\n jsf, isArray(nodeValue) ? nodeValue[i] : nodeValue, setValues,\r\n schemaPointer + '/items/' + i,\r\n dataPointer + '/' + i,\r\n templatePointer + '/controls/' + i\r\n ));\r\n } else {\r\n const schemaRefPointer = removeRecursiveReferences(\r\n schemaPointer + '/items/' + i, jsf.schemaRecursiveRefMap\r\n );\r\n const itemRefPointer = removeRecursiveReferences(\r\n shortDataPointer + '/' + i, jsf.dataRecursiveRefMap, jsf.arrayMap\r\n );\r\n const itemRecursive = itemRefPointer !== shortDataPointer + '/' + i;\r\n //if is in templateLibrary then need to check if its a conditional\r\n //and conditional pointers match orthewise create a new ref\r\n let conditionalRefPointer=`${itemRefPointer}@${schemaPointer}`;\r\n let templateRefToUse=itemRefPointer;\r\n if(hasOwn(jsf.templateRefLibrary, itemRefPointer)\r\n && !hasOwn(jsf.templateRefLibrary, conditionalRefPointer)){\r\n jsf.templateRefLibrary[conditionalRefPointer]=buildFormGroupTemplate(\r\n jsf, null, setValues,\r\n schemaRefPointer,\r\n itemRefPointer,\r\n templatePointer + '/controls/' + i\r\n );\r\n templateRefToUse=conditionalRefPointer;\r\n }\r\n if (!hasOwn(jsf.templateRefLibrary, itemRefPointer)) {\r\n jsf.templateRefLibrary[itemRefPointer] = null;\r\n jsf.templateRefLibrary[itemRefPointer] = buildFormGroupTemplate(\r\n jsf, null, setValues,\r\n schemaRefPointer,\r\n itemRefPointer,\r\n templatePointer + '/controls/' + i\r\n );\r\n jsf.templateRefLibrary[conditionalRefPointer]=jsf.templateRefLibrary[itemRefPointer];\r\n }\r\n controls.push(\r\n isArray(nodeValue) ?\r\n buildFormGroupTemplate(\r\n jsf, nodeValue[i], setValues,\r\n schemaPointer + '/items/' + i,\r\n dataPointer + '/' + i,\r\n templatePointer + '/controls/' + i\r\n ) :\r\n itemRecursive ?\r\n null : cloneDeep(jsf.templateRefLibrary[templateRefToUse])\r\n );\r\n }\r\n }\r\n\r\n // If 'additionalItems' is an object = additional list items (after tuple items)\r\n if (schema.items.length < maxItems && isObject(schema.additionalItems)) {\r\n additionalItemsPointer = schemaPointer + '/additionalItems';\r\n }\r\n\r\n // If 'items' is an object = list items only (no tuple items)\r\n } else {\r\n additionalItemsPointer = schemaPointer + '/items';\r\n }\r\n\r\n if (additionalItemsPointer) {\r\n const schemaRefPointer = removeRecursiveReferences(\r\n additionalItemsPointer, jsf.schemaRecursiveRefMap\r\n );\r\n const itemRefPointer = removeRecursiveReferences(\r\n shortDataPointer + '/-', jsf.dataRecursiveRefMap, jsf.arrayMap\r\n );\r\n const itemRecursive = itemRefPointer !== shortDataPointer + '/-';\r\n //if is in templateLibrary then need to check if its a conditional\r\n //and conditional pointers match orthewise create a new ref\r\n let conditionalRefPointer=`${itemRefPointer}@${schemaPointer}`;\r\n let templateRefToUse=itemRefPointer;\r\n if(hasOwn(jsf.templateRefLibrary, itemRefPointer)\r\n && !hasOwn(jsf.templateRefLibrary, conditionalRefPointer)){\r\n jsf.templateRefLibrary[conditionalRefPointer]=buildFormGroupTemplate(\r\n jsf, null, setValues,\r\n schemaRefPointer,\r\n itemRefPointer,\r\n templatePointer + '/controls/-' \r\n );\r\n templateRefToUse=conditionalRefPointer;\r\n }\r\n if (!hasOwn(jsf.templateRefLibrary, itemRefPointer)) {\r\n jsf.templateRefLibrary[itemRefPointer] = null;\r\n jsf.templateRefLibrary[itemRefPointer] = buildFormGroupTemplate(\r\n jsf, null, setValues,\r\n schemaRefPointer,\r\n itemRefPointer,\r\n templatePointer + '/controls/-'\r\n );\r\n jsf.templateRefLibrary[conditionalRefPointer]=jsf.templateRefLibrary[itemRefPointer];\r\n }\r\n // const itemOptions = jsf.dataMap.get(itemRefPointer) || new Map();\r\n const itemOptions = nodeOptions;\r\n if (!itemRecursive || hasOwn(validators, 'required')) {\r\n const arrayLength = Math.min(Math.max(\r\n itemRecursive ? 0 :\r\n (itemOptions.get('tupleItems') + itemOptions.get('listItems')) || 0,\r\n isArray(nodeValue) ? nodeValue.length : 0\r\n ), maxItems);\r\n for (let i = controls.length; i < arrayLength; i++) {\r\n controls.push(\r\n isArray(nodeValue) ?\r\n buildFormGroupTemplate(\r\n jsf, nodeValue[i], setValues,\r\n schemaRefPointer,\r\n dataPointer + '/-',\r\n templatePointer + '/controls/-'\r\n ) :\r\n itemRecursive ?\r\n null : cloneDeep(jsf.templateRefLibrary[templateRefToUse])\r\n );\r\n }\r\n }\r\n }\r\n return { controlType, controls, validators,schemaPointer };\r\n\r\n case '$ref':\r\n const schemaRef = JsonPointer.compile(schema.$ref);\r\n const dataRef = JsonPointer.toDataPointer(schemaRef, schema);\r\n const refPointer = removeRecursiveReferences(\r\n dataRef, jsf.dataRecursiveRefMap, jsf.arrayMap\r\n );\r\n if (refPointer && !hasOwn(jsf.templateRefLibrary, refPointer)) {\r\n // Set to null first to prevent recursive reference from causing endless loop\r\n jsf.templateRefLibrary[refPointer] = null;\r\n const newTemplate = buildFormGroupTemplate(jsf, setValues, setValues, schemaRef);\r\n if (newTemplate) {\r\n jsf.templateRefLibrary[refPointer] = newTemplate;\r\n } else {\r\n delete jsf.templateRefLibrary[refPointer];\r\n }\r\n }\r\n return null;\r\n\r\n case 'FormControl':\r\n const value = {\r\n value: setValues && isPrimitive(nodeValue) ? nodeValue : null,\r\n disabled: nodeOptions.get('disabled') || false\r\n };\r\n return { controlType, value, validators,schemaPointer };\r\n\r\n //TODO may make an IFThenElse widget or integrate it with the section\r\n //widget \r\n case 'IfThenElse':\r\n controls = {};\r\n let conditionType;\r\n if (hasOwn(schema, \"if\")) {\r\n [\"then\", \"else\"].forEach(con => {\r\n if (hasOwn(schema, con)) {\r\n const keySchemaPointer = `/${con}`;\r\n let thenTFGTemplate = buildFormGroupTemplate(\r\n jsf, nodeValue, setValues,//false,\r\n schemaPointer + keySchemaPointer,\r\n dataPointer,\r\n templatePointer + `/controls/${con}`\r\n );\r\n //NB same property can be in both then and else\r\n //so key must be the unique path to control\r\n \r\n //let ifItemSchema=JsonPointer.get(schema,keySchemaPointer);\r\n //let ifItemValue;\r\n if(hasOwn(thenTFGTemplate,'controls')){\r\n Object.keys(thenTFGTemplate.controls).forEach(key => {\r\n let controlKey = thenTFGTemplate.controls[key].schemaPointer;\r\n if(controlKey){\r\n controlKey = path2ControlKey(controlKey);\r\n let cItem = Object.assign({}, thenTFGTemplate.controls[key]);\r\n \r\n controls[controlKey] = cItem;\r\n } \r\n })\r\n }\r\n\r\n }\r\n });\r\n }\r\n return { controlType, controls, validators,schemaPointer };\r\n default:\r\n return null;\r\n }\r\n}\r\n\r\n/**\r\n * 'buildFormGroup' function\r\n *\r\n * // {any} template -\r\n * // {AbstractControl}\r\n*/\r\nexport function buildFormGroup(template: any): AbstractControl {\r\n const validatorFns: ValidatorFn[] = [];\r\n let validatorFn: ValidatorFn = null;\r\n if (hasOwn(template, 'validators')) {\r\n forEach(template.validators, (parameters, validator) => {\r\n if (typeof JsonValidators[validator] === 'function') {\r\n validatorFns.push(JsonValidators[validator].apply(null, parameters));\r\n }\r\n });\r\n if (validatorFns.length &&\r\n inArray(template.controlType, ['FormGroup', 'FormArray'])\r\n ) {\r\n validatorFn = validatorFns.length > 1 ?\r\n JsonValidators.compose(validatorFns) : validatorFns[0];\r\n }\r\n }\r\n if (hasOwn(template, 'controlType')) {\r\n switch (template.controlType) {\r\n case 'FormGroup':\r\n\r\n const groupControls: { [key: string]: AbstractControl } = {};\r\n forEach(template.controls, (controls, key) => {\r\n const newControl: AbstractControl = buildFormGroup(controls);\r\n //if (newControl) { groupControls[key] = newControl; }\r\n if (newControl) {\r\n\r\n /* experimental idea was to try to be able to switch\r\n conditional controls dynamically based on their schema pointer\r\n (not datapointer as that only maps to one control)\r\n Object.defineProperty(groupControls, key, {\r\n get: () => {\r\n //console.log(`Accessed control: ${key}`);\r\n //add switch logic here\r\n return ncontrol; \r\n },\r\n set:(value)=>{\r\n ncontrol=value\r\n },\r\n enumerable: true\r\n })\r\n */\r\n groupControls[key] = newControl;\r\n }\r\n });\r\n return new UntypedFormGroup(groupControls, validatorFn);\r\n case 'FormArray':\r\n return new UntypedFormArray(filter(map(template.controls,\r\n controls => buildFormGroup(controls)\r\n )), validatorFn);\r\n case 'FormControl':\r\n return new UntypedFormControl(template.value, validatorFns);\r\n }\r\n }\r\n return null;\r\n}\r\n\r\n/**\r\n * 'mergeValues' function\r\n *\r\n * // {any[]} ...valuesToMerge - Multiple values to merge\r\n * // {any} - Merged values\r\n */\r\nexport function mergeValues(...valuesToMerge) {\r\n let mergedValues: any = null;\r\n for (const currentValue of valuesToMerge) {\r\n if (!isEmpty(currentValue)) {\r\n if (typeof currentValue === 'object' &&\r\n (isEmpty(mergedValues) || typeof mergedValues !== 'object')\r\n ) {\r\n if (isArray(currentValue)) {\r\n mergedValues = [...currentValue];\r\n } else if (isObject(currentValue)) {\r\n mergedValues = { ...currentValue };\r\n }\r\n } else if (typeof currentValue !== 'object') {\r\n mergedValues = currentValue;\r\n } else if (isObject(mergedValues) && isObject(currentValue)) {\r\n Object.assign(mergedValues, currentValue);\r\n } else if (isObject(mergedValues) && isArray(currentValue)) {\r\n const newValues = [];\r\n for (const value of currentValue) {\r\n newValues.push(mergeValues(mergedValues, value));\r\n }\r\n mergedValues = newValues;\r\n } else if (isArray(mergedValues) && isObject(currentValue)) {\r\n const newValues = [];\r\n for (const value of mergedValues) {\r\n newValues.push(mergeValues(value, currentValue));\r\n }\r\n mergedValues = newValues;\r\n } else if (isArray(mergedValues) && isArray(currentValue)) {\r\n const newValues = [];\r\n for (let i = 0; i < Math.max(mergedValues.length, currentValue.length); i++) {\r\n if (i < mergedValues.length && i < currentValue.length) {\r\n newValues.push(mergeValues(mergedValues[i], currentValue[i]));\r\n } else if (i < mergedValues.length) {\r\n newValues.push(mergedValues[i]);\r\n } else if (i < currentValue.length) {\r\n newValues.push(currentValue[i]);\r\n }\r\n }\r\n mergedValues = newValues;\r\n }\r\n }\r\n }\r\n return mergedValues;\r\n}\r\n\r\n/**\r\n * 'setRequiredFields' function\r\n *\r\n * // {schema} schema - JSON Schema\r\n * // {object} formControlTemplate - Form Control Template object\r\n * // {boolean} - true if any fields have been set to required, false if not\r\n */\r\nexport function setRequiredFields(schema: any, formControlTemplate: any): boolean {\r\n let fieldsRequired = false;\r\n if (hasOwn(schema, 'required') && !isEmpty(schema.required)) {\r\n fieldsRequired = true;\r\n let requiredArray = isArray(schema.required) ? schema.required : [schema.required];\r\n requiredArray = forEach(requiredArray,\r\n key => JsonPointer.set(formControlTemplate, '/' + key + '/validators/required', [])\r\n );\r\n }\r\n return fieldsRequired;\r\n\r\n // TODO: Add support for patternProperties\r\n // https://spacetelescope.github.io/understanding-json-schema/reference/object.html#pattern-properties\r\n}\r\n\r\n/**\r\n * 'formatFormData' function\r\n *\r\n * // {any} formData - Angular FormGroup data object\r\n * // {Map<string, any>} dataMap -\r\n * // {Map<string, string>} recursiveRefMap -\r\n * // {Map<string, number>} arrayMap -\r\n * // {boolean = false} fixErrors - if TRUE, tries to fix data\r\n * // {any} - formatted data object\r\n */\r\nexport function formatFormData(\r\n formData: any, dataMap: Map<string, any>,\r\n recursiveRefMap: Map<string, string>, arrayMap: Map<string, number>,\r\n returnEmptyFields = false, fixErrors = false\r\n): any {\r\n if (formData === null || typeof formData !== 'object') { return formData; }\r\n const formattedData = isArray(formData) ? [] : {};\r\n JsonPointer.forEachDeep(formData, (value, dataPointer) => {\r\n\r\n // If returnEmptyFields === true,\r\n // add empty arrays and objects to all allowed keys\r\n if (returnEmptyFields && isArray(value)) {\r\n JsonPointer.set(formattedData, dataPointer, []);\r\n } else if (returnEmptyFields && isObject(value) && !isDate(value)) {\r\n JsonPointer.set(formattedData, dataPointer, {});\r\n } else {\r\n const genericPointer =\r\n JsonPointer.has(dataMap, [dataPointer, 'schemaType']) ? dataPointer :\r\n removeRecursiveReferences(dataPointer, recursiveRefMap, arrayMap);\r\n if (JsonPointer.has(dataMap, [genericPointer, 'schemaType'])) {\r\n const schemaType: SchemaPrimitiveType | SchemaPrimitiveType[] =\r\n dataMap.get(genericPointer).get('schemaType');\r\n if (schemaType === 'null') {\r\n JsonPointer.set(formattedData, dataPointer, null);\r\n } else if ((hasValue(value) || returnEmptyFields) &&\r\n inArray(schemaType, ['string', 'integer', 'number', 'boolean'])\r\n ) {\r\n const newValue = (fixErrors || (value === null && returnEmptyFields)) ?\r\n toSchemaType(value, schemaType) : toJavaScriptType(value, schemaType);\r\n if (isDefined(newValue) || returnEmptyFields) {\r\n JsonPointer.set(formattedData, dataPointer, newValue);\r\n }\r\n }\r\n\r\n\r\n // commented out completely as value can be 'null' if not entered\r\n\r\n // Finish incomplete 'date-time' entries\r\n // if (dataMap.get(genericPointer).get('schemaFormat') === 'date-time') {\r\n\r\n // /* commented out-should use same format as datetime-local input\r\n // for initial data to bind back to the input\r\n // // \"2000-03-14T01:59:26.535\" -> \"2000-03-14T01:59:26.535Z\" (add \"Z\")\r\n // if (/^\\d\\d\\d\\d-[0-1]\\d-[0-3]\\d[t\\s][0-2]\\d:[0-5]\\d:[0-5]\\d(?:\\.\\d+)?$/i.test(value)) {\r\n // JsonPointer.set(formattedData, dataPointer, `${value}Z`);\r\n // // \"2000-03-14T01:59\" -> \"2000-03-14T01:59:00Z\" (add \":00Z\")\r\n // } else if (/^\\d\\d\\d\\d-[0-1]\\d-[0-3]\\d[t\\s][0-2]\\d:[0-5]\\d$/i.test(value)) {\r\n // JsonPointer.set(formattedData, dataPointer, `${value}:00Z`);\r\n // // \"2000-03-14\" -> \"2000-03-14T00:00:00Z\" (add \"T00:00:00Z\")\r\n // } else if (fixErrors && /^\\d\\d\\d\\d-[0-1]\\d-[0-3]\\d$/i.test(value)) {\r\n // JsonPointer.set(formattedData, dataPointer, `${value}:00:00:00Z`);\r\n // }\r\n // */\r\n // JsonPointer.set(formattedData, dataPointer, `${value}`);\r\n // }\r\n } else if (typeof value !== 'object' || isDate(value) ||\r\n (value === null && returnEmptyFields)\r\n ) {\r\n if (genericPointer.indexOf(\"/$\")>=0) {\r\n return formattedData;\r\n }\r\n console.error('formatFormData error: ' +\r\n `Schema type not found for form value at ${genericPointer}`);\r\n console.error('dataMap', dataMap);\r\n console.error('recursiveRefMap', recursiveRefMap);\r\n console.error('genericPointer', genericPointer);\r\n }\r\n }\r\n });\r\n return formattedData;\r\n}\r\n\r\n/**\r\n * 'getControl' function\r\n *\r\n * Uses a JSON Pointer for a data object to retrieve a control from\r\n * an Angular formGroup or formGroup template. (Note: though a formGroup\r\n * template is much simpler, its basic structure is idential to a formGroup).\r\n *\r\n * If the optional third parameter 'returnGroup' is set to TRUE, the group\r\n * containing the control is returned, rather than the control itself.\r\n *\r\n * // {FormGroup} formGroup - Angular FormGroup to get value from\r\n * // {Pointer} dataPointer - JSON Pointer (string or array)\r\n * // {boolean = false} returnGroup - If true, return group containing control\r\n * // {group} - Located value (or null, if no control found)\r\n * // {string} schemaPointer - string used for conditional controls coming from schema if/then/else\r\n */\r\nexport function getControl(\r\n formGroup: any, dataPointer: Pointer, returnGroup = false, schemaPointer?: string\r\n): any {\r\n if (!isObject(formGroup) || !JsonPointer.isJsonPointer(dataPointer)) {\r\n if (!JsonPointer.isJsonPointer(dataPointer)) {\r\n // If dataPointer input is not a valid JSON pointer, check to\r\n // see if it is instead a valid object path, using dot notaion\r\n if (typeof dataPointer === 'string') {\r\n const controlPath=!!schemaPointer?path2ControlKey(schemaPointer):dataPointer\r\n const formControl = formGroup.get(controlPath);\r\n if (formControl) { return formControl; }\r\n }\r\n console.error(`getControl error: Invalid JSON Pointer: ${dataPointer}`);\r\n }\r\n if (!isObject(formGroup)) {\r\n console.error(`getControl error: Invalid formGroup: ${formGroup}`);\r\n }\r\n return null;\r\n }\r\n let dataPointerArray = JsonPointer.parse(dataPointer);\r\n if (returnGroup) { dataPointerArray = dataPointerArray.slice(0, -1); }\r\n\r\n // If formGroup input is a real formGroup (not a formGroup template)\r\n // try using formGroup.get() to return the control\r\n if (typeof formGroup.get === 'function' &&\r\n dataPointerArray.every(key => key.indexOf('.') === -1)\r\n ) {\r\n const controlPath=!!schemaPointer?path2ControlKey(schemaPointer):dataPointerArray.join('.');\r\n const formControl = formGroup.get(controlPath);\r\n if (formControl) { return formControl; }\r\n }\r\n\r\n // If formGroup input is a formGroup template,\r\n // or formGroup.get() failed to return the control,\r\n // search the formGroup object for dataPointer's control\r\n\r\n let subGroup = formGroup;\r\n //if schemapointer provided but no control matched\r\n //it could mean the schema pointer is a nested child\r\n //for example this could be in form group\r\n //formGroup.controls.$allOf$0$then$properties$foo\r\n //but schemapointer provided is '/allOf/0/then/properties/foo/items/properties/name'\r\n //and dataPointer is '/foo/0/name'\r\n //then need to look in formGroup.controls.$allOf$0$then$properties$foo\r\n //for control path /0/name\r\n if(schemaPointer){\r\n let controlPointer=JsonPointer.toControlPointer(dataPointer,{});\r\n let schemaPointerArray=schemaPointer.split('/')\r\n let controlPointerArray=JsonPointer.parse(dataPointer);\r\n //controlPointer.split('/').splice(1);\r\n\r\n let currSPAKey;\r\n let spFormGroup;\r\n while(schemaPointerArray.length>0){\r\n currSPAKey=schemaPointerArray.pop();\r\n let ckey=path2ControlKey(schemaPointerArray.join(\"/\"));\r\n spFormGroup=formGroup.get(ckey);\r\n if(controlPointerArray[0]==schemaPointerArray[schemaPointerArray.length-1]){\r\n controlPointerArray.shift();\r\n }\r\n if(spFormGroup){\r\n break;\r\n }\r\n }\r\n subGroup=spFormGroup||subGroup;\r\n dataPointerArray=spFormGroup?controlPointerArray:dataPointerArray;\r\n\r\n }\r\n for (const key of dataPointerArray) {\r\n if (hasOwn(subGroup, 'controls')) { subGroup = subGroup.controls; }\r\n if (schemaPointer && hasOwn(subGroup, path2ControlKey(schemaPointer ))) {\r\n subGroup = subGroup[path2ControlKey(schemaPointer )];\r\n return subGroup;\r\n } else if (isArray(subGroup) && (key === '-')) {\r\n subGroup = subGroup[subGroup.length - 1];\r\n } else if (hasOwn(subGroup, key)) {\r\n subGroup = subGroup[key];\r\n } else {\r\n console.error(`getControl error: Unable to find \"${key}\" item in FormGroup.`);\r\n console.error(dataPointer);\r\n console.error(formGroup);\r\n return;\r\n }\r\n }\r\n return subGroup;\r\n}\r\n\r\n\r\n/**\r\n * 'setControl' function\r\n *\r\n * Uses a JSON Pointer for a data object to retrieve a control from\r\n * an Angular formGroup or formGroup template. (Note: though a formGroup\r\n * template is much simpler, its basic structure is idential to a formGroup).\r\n *\r\n * If the optional third parameter 'returnGroup' is set to TRUE, the group\r\n * containing the control is returned, rather than the control itself.\r\n *\r\n * // {FormGroup} formGroup - Angular FormGroup to get value from\r\n * // {Pointer} dataPointer - JSON Pointer (string or array)\r\n * // {AbstractControl} control - control used to replace existing or add\r\n * // {targetKey} - optional string used as the new key-not implemented as yet\r\n */\r\nexport function setControl(\r\n formGroup: any, dataPointer: Pointer, control: AbstractControl, targetKey?: string,\r\n): any {\r\n\r\n let dataPointerArray = JsonPointer.parse(dataPointer);\r\n\r\n\r\n // If formGroup input is a real formGroup (not a formGroup template)\r\n // try using formGroup.get() to return the control\r\n /*\r\n if (typeof formGroup.get === 'function' &&\r\n dataPointerArray.every(key => key.indexOf('.') === -1)\r\n ) {\r\n formGroup.setControl(dataPointerArray.join('.'), control);\r\n return;\r\n }\r\n */\r\n let currentGroup: any= formGroup;\r\n for (let i = 0; i < dataPointerArray.length - 1; i++) {\r\n // Navigate down the form structure to find the correct nested FormGroup\r\n currentGroup = currentGroup.get(dataPointerArray[i]);\r\n \r\n // If it's not a FormGroup, we throw an error since we can't set a control in a non-group.\r\n if (!(typeof currentGroup.setControl=== 'function' )) {\r\n throw new Error(`Path '${dataPointerArray[i]}' is not a valid FormGroup or FormArray.`);\r\n }\r\n }\r\n \r\n // Now we are at the parent FormGroup, set the control at the last part of the path\r\n const lastPart = dataPointerArray[dataPointerArray.length - 1];\r\n \r\n // Set the control at the final path (like 'name' inside 'state')\r\n currentGroup.setControl(lastPart, control);\r\n \r\n \r\n\r\n // If formGroup input is a formGroup template,\r\n // or formGroup.get() failed to return the control,\r\n // search the formGroup object for dataPointer's control\r\n //TODO needs to be adapted to setControl\r\n /*\r\n let subGroup = formGroup;\r\n for (const key of dataPointerArray) {\r\n if (hasOwn(subGroup, 'controls')) { subGroup = subGroup.controls; }\r\n if (isArray(subGroup) && (key === '-')) {\r\n subGroup = subGroup[subGroup.length - 1];\r\n } else if (hasOwn(subGroup, key)) {\r\n subGroup = subGroup[key];\r\n } else {\r\n console.error(`getControl error: Unable to find \"${key}\" item in FormGroup.`);\r\n console.error(dataPointer);\r\n console.error(formGroup);\r\n return;\r\n }\r\n }\r\n return subGroup;\r\n */\r\n}\r\n","import cloneDeep from 'lodash/cloneDeep';\r\nimport _isArray from 'lodash/isArray';\r\nimport _isPlainObject from 'lodash/isPlainObject';\r\nimport uniqueId from 'lodash/uniqueId';\r\nimport { TitleMapItem } from '../json-schema-form.service';\r\nimport {\r\n checkInlineType,\r\n convertJSONSchemaIfToCondition,\r\n getFromSchema,\r\n getInputType,\r\n isInputRequired,\r\n removeRecursiveReferences,\r\n updateInputOptions\r\n} from './json-schema.functions';\r\nimport { JsonPointer } from './jsonpointer.functions';\r\nimport {\r\n copy,\r\n fixTitle,\r\n forEach,\r\n hasOwn\r\n} from './utility.functions';\r\nimport {\r\n inArray,\r\n isArray,\r\n isDefined,\r\n isEmpty,\r\n isNumber,\r\n isObject,\r\n isString\r\n} from './validator.functions';\r\n\r\n\r\n\r\n\r\n/**\r\n * Layout function library:\r\n *\r\n * buildLayout: Builds a complete layout from an input layout and schema\r\n *\r\n * buildLayoutFromSchema: Builds a complete layout entirely from an input schema\r\n *\r\n * mapLayout:\r\n *\r\n * getLayoutNode:\r\n *\r\n * buildTitleMap:\r\n */\r\n\r\n/**\r\n * 'buildLayout' function\r\n *\r\n * // jsf\r\n * // widgetLibrary\r\n * //\r\n */\r\nexport function buildLayout_original(jsf, widgetLibrary) {\r\n let hasSubmitButton = !JsonPointer.get(jsf, '/formOptions/addSubmit');\r\n const formLayout = mapLayout(jsf.layout, (layoutItem, index, layoutPointer) => {\r\n const newNode: any = {\r\n _id: uniqueId(),\r\n options: {},\r\n };\r\n if (isObject(layoutItem)) {\r\n Object.assign(newNode, layoutItem);\r\n Object.keys(newNode)\r\n .filter(option => !inArray(option, [\r\n '_id', '$ref', 'arrayItem', 'arrayItemType', 'dataPointer', 'dataType',\r\n 'items', 'key', 'name', 'options', 'recursiveReference', 'type', 'widget'\r\n ]))\r\n .forEach(option => {\r\n newNode.options[option] = newNode[option];\r\n delete newNode[option];\r\n });\r\n if (!hasOwn(newNode, 'type') && isString(newNode.widget)) {\r\n newNode.type = newNode.widget;\r\n delete newNode.widget;\r\n }\r\n if (!hasOwn(newNode.options, 'title')) {\r\n if (hasOwn(newNode.options, 'legend')) {\r\n newNode.options.title = newNode.options.legend;\r\n delete newNode.options.legend;\r\n }\r\n }\r\n if (!hasOwn(newNode.options, 'validationMessages')) {\r\n if (hasOwn(newNode.options, 'errorMessages')) {\r\n newNode.options.validationMessages = newNode.options.errorMessages;\r\n delete newNode.options.errorMessages;\r\n\r\n // Convert Angular Schema Form (AngularJS) 'validationMessage' to\r\n // Angular JSON Schema Form 'validationMessages'\r\n // TV4 codes from https://github.com/geraintluff/tv4/blob/master/source/api.js\r\n } else if (hasOwn(newNode.options, 'validationMessage')) {\r\n if (typeof newNode.options.validationMessage === 'string') {\r\n newNode.options.validationMessages = newNode.options.validationMessage;\r\n } else {\r\n newNode.options.validationMessages = {};\r\n Object.keys(newNode.options.validationMessage).forEach(key => {\r\n const code = key + '';\r\n const newKey =\r\n code === '0' ? 'type' :\r\n code === '1' ? 'enum' :\r\n code === '100' ? 'multipleOf' :\r\n code === '101' ? 'minimum' :\r\n code === '102' ? 'exclusiveMinimum' :\r\n code === '103' ? 'maximum' :\r\n code === '104' ? 'exclusiveMaximum' :\r\n code === '200' ? 'minLength' :\r\n code === '201' ? 'maxLength' :\r\n code === '202' ? 'pattern' :\r\n code === '300' ? 'minProperties' :\r\n code === '301' ? 'maxProperties' :\r\n code === '302' ? 'required' :\r\n code === '304' ? 'dependencies' :\r\n code === '400' ? 'minItems' :\r\n code === '401' ? 'maxItems' :\r\n code === '402' ? 'uniqueItems' :\r\n code === '500' ? 'format' : code + '';\r\n newNode.options.validationMessages[newKey] = newNode.options.validationMessage[key];\r\n });\r\n }\r\n delete newNode.options.validationMessage;\r\n }\r\n }\r\n } else if (JsonPointer.isJsonPointer(layoutItem)) {\r\n newNode.dataPointer = layoutItem;\r\n } else if (isString(layoutItem)) {\r\n newNode.key = layoutItem;\r\n } else {\r\n console.error('buildLayout error: Form layout element not recognized:');\r\n console.error(layoutItem);\r\n return null;\r\n }\r\n let nodeSchema: any = null;\r\n\r\n // If newNode does not have a dataPointer, try to find an equivalent\r\n if (!hasOwn(newNode, 'dataPointer')) {\r\n\r\n // If newNode has a key, change it to a dataPointer\r\n if (hasOwn(newNode, 'key')) {\r\n newNode.dataPointer = newNode.key === '*' ? newNode.key :\r\n JsonPointer.compile(JsonPointer.parseObjectPath(newNode.key), '-');\r\n delete newNode.key;\r\n\r\n // If newNode is an array, search for dataPointer in child nodes\r\n } else if (hasOwn(newNode, 'type') && newNode.type.slice(-5) === 'array') {\r\n const findDataPointer = (items) => {\r\n if (items === null || typeof items !== 'object') { return; }\r\n if (hasOwn(items, 'dataPointer')) { return items.dataPointer; }\r\n if (isArray(items.items)) {\r\n for (const item of items.items) {\r\n if (hasOwn(item, 'dataPointer') && item.dataPointer.indexOf('/-') !== -1) {\r\n return item.dataPointer;\r\n }\r\n if (hasOwn(item, 'items')) {\r\n const searchItem = findDataPointer(item);\r\n if (searchItem) { return searchItem; }\r\n }\r\n }\r\n }\r\n };\r\n const childDataPointer = findDataPointer(newNode);\r\n if (childDataPointer) {\r\n newNode.dataPointer =\r\n childDataPointer.slice(0, childDataPointer.lastIndexOf('/-'));\r\n }\r\n }\r\n }\r\n\r\n if (hasOwn(newNode, 'dataPointer')) {\r\n if (newNode.dataPointer === '*') {\r\n return buildLayoutFromSchema(jsf, widgetLibrary, jsf.formValues);\r\n }\r\n const nodeValue =\r\n JsonPointer.get(jsf.formValues, newNode.dataPointer.replace(/\\/-/g, '/1'));\r\n\r\n // TODO: Create function getFormValues(jsf, dataPointer, forRefLibrary)\r\n // check formOptions.setSchemaDefaults and formOptions.setLayoutDefaults\r\n // then set apropriate values from initialVaues, schema, or layout\r\n\r\n newNode.dataPointer =\r\n JsonPointer.toGenericPointer(newNode.dataPointer, jsf.arrayMap);\r\n const LastKey = JsonPointer.toKey(newNode.dataPointer);\r\n if (!newNode.name && isString(LastKey) && LastKey !== '-') {\r\n newNode.name = LastKey;\r\n }\r\n const shortDataPointer = removeRecursiveReferences(\r\n newNode.dataPointer, jsf.dataRecursiveRefMap, jsf.arrayMap\r\n );\r\n const recursive = !shortDataPointer.length ||\r\n shortDataPointer !== newNode.dataPointer;\r\n let schemaPointer: string;\r\n if (!jsf.dataMap.has(shortDataPointer)) {\r\n jsf.dataMap.set(shortDataPointer, new Map());\r\n }\r\n const nodeDataMap = jsf.dataMap.get(shortDataPointer);\r\n if (nodeDataMap.has('schemaPointer')) {\r\n schemaPointer = nodeDataMap.get('schemaPointer');\r\n } else {\r\n schemaPointer = JsonPointer.toSchemaPointer(shortDataPointer, jsf.schema);\r\n nodeDataMap.set('schemaPointer', schemaPointer);\r\n }\r\n \r\n nodeSchema = JsonPointer.get(jsf.schema, schemaPointer);\r\n if (nodeSchema) {\r\n if (!hasOwn(newNode, 'type')) {\r\n newNode.type = getInputType(nodeSchema, newNode);\r\n } else if (!widgetLibrary.hasWidget(newNode.type)) {\r\n const oldWidgetType = newNode.type;\r\n newNode.type = getInputType(nodeSchema, newNode);\r\n console.error(`error: widget type \"${oldWidgetType}\" ` +\r\n `not found in library. Replacing with \"${newNode.type}\".`);\r\n } else {\r\n newNode.type = checkInlineType(newNode.type, nodeSchema, newNode);\r\n }\r\n if (nodeSchema.type === 'object' && isArray(nodeSchema.required)) {\r\n nodeDataMap.set('required', nodeSchema.required);\r\n }\r\n newNode.dataType =\r\n nodeSchema.type || (hasOwn(nodeSchema, '$ref') ? '$ref' : null);\r\n updateInputOptions(newNode, nodeSchema, jsf);\r\n nodeDataMap.set('disabled', !!newNode.options.disabled);\r\n // Present checkboxes as single control, rather than array\r\n if (newNode.type === 'checkboxes' && hasOwn(nodeSchema, 'items')) {\r\n updateInputOptions(newNode, nodeSchema.items, jsf);\r\n } else if (newNode.dataType === 'array') {\r\n newNode.options.maxItems = Math.min(\r\n nodeSchema.maxItems || 1000, newNode.options.maxItems || 1000\r\n );\r\n newNode.options.minItems = Math.max(\r\n nodeSchema.minItems || 0, newNode.options.minItems || 0\r\n );\r\n newNode.options.listItems = Math.max(\r\n newNode.options.listItems || 0, isArray(nodeValue) ? nodeValue.length : 0\r\n );\r\n newNode.options.tupleItems =\r\n isArray(nodeSchema.items) ? nodeSchema.items.length : 0;\r\n if (newNode.options.maxItems < newNode.options.tupleItems) {\r\n newNode.options.tupleItems = newNode.options.maxItems;\r\n newNode.options.listItems = 0;\r\n } else if (newNode.options.maxItems <\r\n newNode.options.tupleItems + newNode.options.listItems\r\n ) {\r\n newNode.options.listItems =\r\n newNode.options.maxItems - newNode.options.tupleItems;\r\n } else if (newNode.options.minItems >\r\n newNode.options.tupleItems + newNode.options.listItems\r\n ) {\r\n newNode.options.listItems =\r\n newNode.options.minItems - newNode.options.tupleItems;\r\n }\r\n if (!nodeDataMap.has('maxItems')) {\r\n nodeDataMap.set('maxItems', newNode.options.maxItems);\r\n nodeDataMap.set('minItems', newNode.options.minItems);\r\n nodeDataMap.set('tupleItems', newNode.options.tupleItems);\r\n nodeDataMap.set('listItems', newNode.options.listItems);\r\n }\r\n if (!jsf.arrayMap.has(shortDataPointer)) {\r\n jsf.arrayMap.set(shortDataPointer, newNode.options.tupleItems);\r\n }\r\n }\r\n if (isInputRequired(jsf.schema, schemaPointer)) {\r\n newNode.options.required = true;\r\n jsf.fieldsRequired = true;\r\n }\r\n } else {\r\n // TODO: create item in FormGroup model from layout key (?)\r\n updateInputOptions(newNode, {}, jsf);\r\n }\r\n\r\n if (!newNode.options.title && !/^\\d+$/.test(newNode.name)) {\r\n newNode.options.title = fixTitle(newNode.name);\r\n }\r\n\r\n if (hasOwn(newNode.options, 'copyValueTo')) {\r\n if (typeof newNode.options.copyValueTo === 'string') {\r\n newNode.options.copyValueTo = [newNode.options.copyValueTo];\r\n }\r\n if (isArray(newNode.options.copyValueTo)) {\r\n newNode.options.copyValueTo = newNode.options.copyValueTo.map(item =>\r\n JsonPointer.compile(JsonPointer.parseObjectPath(item), '-')\r\n );\r\n }\r\n }\r\n\r\n newNode.widget = widgetLibrary.getWidget(newNode.type);\r\n nodeDataMap.set('inputType', newNode.type);\r\n nodeDataMap.set('widget', newNode.widget);\r\n\r\n if (newNode.dataType === 'array' &&\r\n (hasOwn(newNode, 'items') || hasOwn(newNode, 'additionalItems'))\r\n ) {\r\n const itemRefPointer = removeRecursiveReferences(\r\n newNode.dataPointer + '/-', jsf.dataRecursiveRefMap, jsf.arrayMap\r\n );\r\n if (!jsf.dataMap.has(itemRefPointer)) {\r\n jsf.dataMap.set(itemRefPointer, new Map());\r\n }\r\n jsf.dataMap.get(itemRefPointer).set('inputType', 'section');\r\n\r\n // Fix insufficiently nested array item groups\r\n if (newNode.items.length > 1) {\r\n const arrayItemGroup = [];\r\n for (let i = newNode.items.length - 1; i >= 0; i--) {\r\n const subItem = newNode.items[i];\r\n if (hasOwn(subItem, 'dataPointer') &&\r\n subItem.dataPointer.slice(0, itemRefPointer.length) === itemRefPointer\r\n ) {\r\n const arrayItem = newNode.items.splice(i, 1)[0];\r\n arrayItem.dataPointer = newNode.dataPointer + '/-' +\r\n arrayItem.dataPointer.slice(itemRefPointer.length);\r\n arrayItemGroup.unshift(arrayItem);\r\n } else {\r\n subItem.arrayItem = true;\r\n // TODO: Check schema to get arrayItemType and removable\r\n subItem.arrayItemType = 'list';\r\n subItem.removable = newNode.options.removable !== false;\r\n }\r\n }\r\n if (arrayItemGroup.length) {\r\n newNode.items.push({\r\n _id: uniqueId(),\r\n arrayItem: true,\r\n arrayItemType: newNode.options.tupleItems > newNode.items.length ?\r\n 'tuple' : 'list',\r\n items: arrayItemGroup,\r\n options: { removable: newNode.options.removable !== false, },\r\n dataPointer: newNode.dataPointer + '/-',\r\n type: 'section',\r\n widget: widgetLibrary.getWidget('section'),\r\n });\r\n }\r\n } else {\r\n // TODO: Fix to hndle multiple items\r\n newNode.items[0].arrayItem = true;\r\n if (!newNode.items[0].dataPointer) {\r\n newNode.items[0].dataPointer =\r\n JsonPointer.toGenericPointer(itemRefPointer, jsf.arrayMap);\r\n }\r\n if (!JsonPointer.has(newNode, '/items/0/options/removable')) {\r\n newNode.items[0].options.removable = true;\r\n }\r\n if (newNode.options.orderable === false) {\r\n newNode.items[0].options.orderable = false;\r\n }\r\n newNode.items[0].arrayItemType =\r\n newNode.options.tupleItems ? 'tuple' : 'list';\r\n }\r\n\r\n if (isArray(newNode.items)) {\r\n const arrayListItems =\r\n newNode.items.filter(item => item.type !== '$ref').length -\r\n newNode.options.tupleItems;\r\n if (arrayListItems > newNode.options.listItems) {\r\n newNode.options.listItems = arrayListItems;\r\n nodeDataMap.set('listItems', arrayListItems);\r\n }\r\n }\r\n\r\n if (!hasOwn(jsf.layoutRefLibrary, itemRefPointer)) {\r\n jsf.layoutRefLibrary[itemRefPointer] =\r\n cloneDeep(newNode.items[newNode.items.length - 1]);\r\n if (recursive) {\r\n jsf.layoutRefLibrary[itemRefPointer].recursiveReference = true;\r\n }\r\n forEach(jsf.layoutRefLibrary[itemRefPointer], (item, key) => {\r\n if (hasOwn(item, '_id')) { item._id = null; }\r\n if (recursive) {\r\n if (hasOwn(item, 'dataPointer')) {\r\n item.dataPointer = item.dataPointer.slice(itemRefPointer.length);\r\n }\r\n }\r\n }, 'top-down');\r\n }\r\n\r\n // Add any additional default items\r\n if (!newNode.recursiveReference || newNode.options.required) {\r\n const arrayLength = Math.min(Math.max(\r\n newNode.options.tupleItems + newNode.options.listItems,\r\n isArray(nodeValue) ? nodeValue.length : 0\r\n ), newNode.options.maxItems);\r\n for (let i = newNode.items.length; i < arrayLength; i++) {\r\n newNode.items.push(getLayoutNode({\r\n $ref: itemRefPointer,\r\n dataPointer: newNode.dataPointer,\r\n recursiveReference: newNode.recursiveReference,\r\n }, jsf, widgetLibrary));\r\n }\r\n }\r\n\r\n // If needed, add button to add items to array\r\n if (newNode.options.addable !== false &&\r\n newNode.options.minItems < newNode.options.maxItems &&\r\n (newNode.items[newNode.items.length - 1] || {}).type !== '$ref'\r\n ) {\r\n let buttonText = 'Add';\r\n if (newNode.options.title) {\r\n if (/^add\\b/i.test(newNode.options.title)) {\r\n buttonText = newNode.options.title;\r\n } else {\r\n buttonText += ' ' + newNode.options.title;\r\n }\r\n } else if (newNode.name && !/^\\d+$/.test(newNode.name)) {\r\n if (/^add\\b/i.test(newNode.name)) {\r\n buttonText += ' ' + fixTitle(newNode.name);\r\n } else {\r\n buttonText = fixTitle(newNode.name);\r\n }\r\n\r\n // If newNode doesn't have a title, look for title of parent array item\r\n } else {\r\n const parentSchema =\r\n getFromSchema(jsf.schema, newNode.dataPointer, 'parentSchema');\r\n if (hasOwn(parentSchema, 'title')) {\r\n buttonText += ' to ' + parentSchema.title;\r\n } else {\r\n const pointerArray = JsonPointer.parse(newNode.dataPointer);\r\n buttonText += ' to ' + fixTitle(pointerArray[pointerArray.length - 2]);\r\n }\r\n }\r\n newNode.items.push({\r\n _id: uniqueId(),\r\n arrayItem: true,\r\n arrayItemType: 'list',\r\n dataPointer: newNode.dataPointer + '/-',\r\n options: {\r\n listItems: newNode.options.listItems,\r\n maxItems: newNode.options.maxItems,\r\n minItems: newNode.options.minItems,\r\n removable: false,\r\n title: buttonText,\r\n tupleItems: newNode.options.tupleItems,\r\n },\r\n recursiveReference: recursive,\r\n type: '$ref',\r\n widget: widgetLibrary.getWidget('$ref'),\r\n $ref: itemRefPointer,\r\n });\r\n if (isString(JsonPointer.get(newNode, '/style/add'))) {\r\n newNode.items[newNode.items.length - 1].options.fieldStyle =\r\n newNode.style.add;\r\n delete newNode.style.add;\r\n if (isEmpty(newNode.style)) { delete newNode.style; }\r\n }\r\n }\r\n } else {\r\n newNode.arrayItem = false;\r\n }\r\n } else if (hasOwn(newNode, 'type') || hasOwn(newNode, 'items')) {\r\n const parentType: string =\r\n JsonPointer.get(jsf.layout, layoutPointer, 0, -2).type;\r\n if (!hasOwn(newNode, 'type')) {\r\n newNode.type =\r\n inArray(parentType, ['tabs', 'tabarray']) ? 'tab' : 'array';\r\n }\r\n newNode.arrayItem = parentType === 'array';\r\n newNode.widget = widgetLibrary.getWidget(newNode.type);\r\n updateInputOptions(newNode, {}, jsf);\r\n }\r\n if (newNode.type === 'submit') { hasSubmitButton = true; }\r\n return newNode;\r\n });\r\n if (jsf.hasRootReference) {\r\n const fullLayout = cloneDeep(formLayout);\r\n if (fullLayout[fullLayout.length - 1].type === 'submit') { fullLayout.pop(); }\r\n jsf.layoutRefLibrary[''] = {\r\n _id: null,\r\n dataPointer: '',\r\n dataType: 'object',\r\n items: fullLayout,\r\n name: '',\r\n options: cloneDeep(jsf.formOptions.defaultWidgetOptions),\r\n recursiveReference: true,\r\n required: false,\r\n type: 'section',\r\n widget: widgetLibrary.getWidget('section'),\r\n };\r\n }\r\n if (!hasSubmitButton) {\r\n formLayout.push({\r\n _id: uniqueId(),\r\n options: { title: 'Submit' },\r\n type: 'submit',\r\n widget: widgetLibrary.getWidget('submit'),\r\n });\r\n }\r\n return formLayout;\r\n}\r\n\r\n//TODO-review:this implements a quick 'post' fix rather than an\r\n//integrated ideal fix\r\nexport function buildLayout(jsf, widgetLibrary) {\r\n let layout = buildLayout_original(jsf, widgetLibrary);\r\n if (jsf.formValues) {\r\n let fixedLayout = fixNestedArrayLayout({\r\n builtLayout: layout,\r\n formData: jsf.formValues\r\n });\r\n }\r\n return layout;\r\n}\r\n\r\n\r\n\r\nexport function fixNestedArrayLayout(options: any) {\r\n let { builtLayout, formData } = options;\r\n let arrLengths = {};\r\n let traverseObj = function (obj, path, onValue?) {\r\n if (_isArray(obj)) {\r\n onValue && onValue(obj, path);\r\n obj.forEach((item, ind) => {\r\n onValue && onValue(item, path + \"/\" + ind);\r\n traverseObj(item, path + \"/\" + ind, onValue);\r\n });\r\n return;\r\n }\r\n if (_isPlainObject(obj)) {\r\n onValue && onValue(obj, path);\r\n Object.keys(obj).forEach(key => {\r\n onValue && onValue(obj[key], path + \"/\" + key);\r\n traverseObj(obj[key], path + \"/\" + key, onValue);\r\n });\r\n return\r\n }\r\n }\r\n traverseObj(formData, \"\", (value, path) => {\r\n if (_isArray(value)) {\r\n arrLengths[path] = arrLengths[path] || value.length;\r\n }\r\n });\r\n\r\n let getDataSize = (options: any) => {\r\n let { data, dataPointer, indexArray } = options;\r\n let dashCount = 0;\r\n let dpInstance = dataPointer.substring(1).split(\"/\").map((part, pind) => {\r\n if (part == \"-\" && indexArray[dashCount] != undefined) {\r\n return indexArray[dashCount++];\r\n }\r\n return part;\r\n })\r\n .join(\"/\");\r\n dpInstance = \"/\" + dpInstance;\r\n let arrSize = arrLengths[dpInstance];\r\n return arrSize;\r\n }\r\n //still too buggy\r\n let createNonRefItem = (nodeWithRef: any) => {\r\n let templateNode = {\r\n \"type\": \"section\", //check this could also be array?\r\n \"recursiveReference\": false,//check this \r\n \"items\": []\r\n }\r\n let clone = cloneDeep(nodeWithRef);\r\n //commented out for now so that it behaves as ususal\r\n //_.merge(clone,templateNode);\r\n return clone;\r\n }\r\n\r\n let rebuildLayout = (options: any) => {\r\n let { builtLayout, indices, parentDataPointer, indexPos } = options;\r\n indices = indices || [];\r\n indexPos = indexPos == undefined ? indexPos = -1 : indexPos;\r\n if (_isArray(builtLayout)) {\r\n builtLayout.forEach((item, index) => {\r\n rebuildLayout({\r\n builtLayout: item,\r\n indices: indices,\r\n indexPos: indexPos,\r\n parentDataPointer: parentDataPointer\r\n //TODO-test \r\n //commented out builtLayout.dataPointer condition\r\n //-Angular 18/TS 5.5 compiliation error\r\n //builtLayout.dataPointer || parentDataPointer\r\n })\r\n })\r\n return;\r\n }\r\n\r\n let dataTypes = [\"array\"];//check only array for now\r\n //for now added condition to ignore recursive references\r\n if (builtLayout.items && dataTypes.indexOf(builtLayout.dataType) >= 0\r\n && builtLayout.dataPointer\r\n && !builtLayout.recursiveReference\r\n ) {\r\n let numDataItems: any = getDataSize({\r\n data: formData,\r\n dataPointer: builtLayout.dataPointer,\r\n indexArray: indices\r\n });\r\n let numActualItems = builtLayout.items.length;\r\n //check if there's ref items, if so ignore it and therefore\r\n //decrement the item count\r\n builtLayout.items.forEach(item => {\r\n if (item.type && item.type == \"$ref\") {\r\n numActualItems--;\r\n }\r\n });\r\n numActualItems = Math.max(numActualItems, 0);//avoid dealing with negatives\r\n if (numActualItems < numDataItems) {\r\n\r\n let numItemsNeeded = numDataItems - numActualItems;\r\n //added to ignore recursive references\r\n if (numActualItems == 0 && builtLayout.items[0].recursiveReference) {\r\n numItemsNeeded = 0\r\n }\r\n for (let i = 0; i < numItemsNeeded; i++) {\r\n //node must not be of type \"type\": \"$ref\"\r\n //if it is then manufacture our own\r\n let isRefNode = builtLayout.items[0].type && builtLayout.items[0].type == \"$ref\";\r\n let newItem = isRefNode\r\n ? createNonRefItem(builtLayout.items[0])\r\n : cloneDeep(builtLayout.items[0]);//copy first\r\n newItem._id = uniqueId(\"new_\");\r\n builtLayout.items.unshift(newItem);\r\n // builtLayout.items=[newItem, ...builtLayout.items];\r\n \r\n }\r\n }else if (numActualItems > numDataItems) {\r\n let numItemsToRemove = numActualItems-numDataItems;\r\n for (let i = 0; i < numItemsToRemove; i++) {\r\n builtLayout.items.pop();\r\n //builtLayout.items=builtLayout.items.slice(0, -1);\r\n //builtLayout.items.slice(0, -1);\r\n }\r\n }\r\n if (builtLayout.options.listItems) {\r\n builtLayout.options.listItems = numDataItems;\r\n }\r\n //builtLayout.items=[...builtLayout.items];\r\n \r\n indices[builtLayout.dataPointer] = indices[builtLayout.dataPointer] || -1;\r\n indexPos++;\r\n builtLayout.items.forEach((item, index) => {\r\n indices[indexPos] = index\r\n rebuildLayout({\r\n builtLayout: item,\r\n indices: indices,\r\n parentDataPointer: builtLayout.dataPointer,\r\n indexPos: indexPos\r\n })\r\n })\r\n indexPos--;\r\n } else {\r\n if (builtLayout.items) {\r\n builtLayout.items.forEach((item, index) => {\r\n rebuildLayout({\r\n builtLayout: item,\r\n indices: indices,\r\n parentDataPointer: parentDataPointer,\r\n indexPos: indexPos\r\n })\r\n })\r\n\r\n }\r\n }\r\n\r\n\r\n }\r\n rebuildLayout({\r\n builtLayout: builtLayout\r\n });\r\n //NB original is mutated\r\n let fixedLayout = builtLayout;\r\n return fixedLayout;\r\n}\r\n\r\n/**\r\n * 'buildLayoutFromSchema' function\r\n *\r\n * // jsf -\r\n * // widgetLibrary -\r\n * // nodeValue -\r\n * // { string = '' } schemaPointer -\r\n * // { string = '' } dataPointer -\r\n * // { boolean = false } arrayItem -\r\n * // { string = null } arrayItemType -\r\n * // { boolean = null } removable -\r\n * // { boolean = false } forRefLibrary -\r\n * // { string = '' } dataPointerPrefix -\r\n * //\r\n */\r\nexport function buildLayoutFromSchema(\r\n jsf, widgetLibrary, nodeValue = null, schemaPointer = '',\r\n dataPointer = '', arrayItem = false, arrayItemType: string = null,\r\n removable: boolean = null, forRefLibrary = false, dataPointerPrefix = '',\r\n jsonSchema?\r\n) {\r\n function applyITEConditions(builtLayout,schPointer,keySchemaPointer,negateClause,parentLayout?){\r\n if (builtLayout) {\r\n const parentCondition=parentLayout && parentLayout.isITEItem && parentLayout.options.condition;\r\n if(parentCondition){\r\n //builtLayout.isITEItem=true;\r\n return;\r\n }\r\n if (isArray(builtLayout)) {\r\n builtLayout.forEach(item => {\r\n item.isITEItem=true;\r\n item.options.condition =parentCondition?null:convertJSONSchemaIfToCondition(schema,item, negateClause);\r\n applyITEConditions(item,schPointer,keySchemaPointer,negateClause,builtLayout)\r\n //item.schemaPointer = schPointer + keySchemaPointer + item.dataPointer;\r\n //item.options.condition = convertJSONSchemaIfToCondition(schema, negateClause);\r\n //newSection.push(item);\r\n });\r\n }else if(hasOwn(builtLayout,\"items\")){\r\n applyITEConditions(builtLayout.items,schPointer,keySchemaPointer,negateClause,builtLayout)\r\n // builtLayout.items.forEach(item => {\r\n // item.isITEItem=true;\r\n // item.options.condition = convertJSONSchemaIfToCondition(schema,item, negateClause);\r\n // applyITEConditions(item,schPointer,keySchemaPointer,negateClause)\r\n // });\r\n }else {\r\n\r\n builtLayout.isITEItem=true;\r\n //builtLayout.schemaPointer = `${schPointer}${keySchemaPointer}/${builtLayout.name}`;\r\n \r\n builtLayout.options.condition =parentCondition?null: convertJSONSchemaIfToCondition(schema,builtLayout, negateClause);\r\n //newSection.push(builtLayout)\r\n }\r\n }\r\n }\r\n const jsSchema=jsonSchema||jsf.schema;\r\n const schema = JsonPointer.get(jsSchema, schemaPointer);\r\n //JsonPointer.get(jsf.schema, schemaPointer);\r\n if (!hasOwn(schema, 'type') && !hasOwn(schema, '$ref') &&\r\n !hasOwn(schema, 'x-schema-form')\r\n && !hasOwn(schema, 'if') && !hasOwn(schema, 'then') && !hasOwn(schema, 'else')\r\n ) { return null; }\r\n const newNodeType: string = getInputType(schema);\r\n if (!isDefined(nodeValue) && (\r\n jsf.formOptions.setSchemaDefaults === true ||\r\n (jsf.formOptions.setSchemaDefaults === 'auto' && isEmpty(jsf.formValues))\r\n )) {\r\n nodeValue = JsonPointer.get(jsSchema, schemaPointer + '/default');\r\n }\r\n let newNode: any = {\r\n _id: forRefLibrary ? null : uniqueId(),\r\n arrayItem: arrayItem,\r\n dataPointer: JsonPointer.toGenericPointer(dataPointer, jsf.arrayMap),\r\n dataType: schema.type || (hasOwn(schema, '$ref') ? '$ref' : null),\r\n options: {},\r\n required: isInputRequired(jsSchema, schemaPointer),\r\n type: newNodeType,\r\n widget: widgetLibrary.getWidget(newNodeType),\r\n };\r\n const lastDataKey = JsonPointer.toKey(newNode.dataPointer);\r\n if (lastDataKey !== '-') { newNode.name = lastDataKey; }\r\n if (newNode.arrayItem) {\r\n newNode.arrayItemType = arrayItemType;\r\n newNode.options.removable = removable !== false;\r\n }\r\n const shortDataPointer = removeRecursiveReferences(\r\n dataPointerPrefix + dataPointer, jsf.dataRecursiveRefMap, jsf.arrayMap\r\n );\r\n const recursive = !shortDataPointer.length ||\r\n shortDataPointer !== dataPointerPrefix + dataPointer;\r\n if (!jsf.dataMap.has(shortDataPointer)) {\r\n jsf.dataMap.set(shortDataPointer, new Map());\r\n }\r\n updateInputOptions(newNode, schema, jsf);\r\n const nodeDataMap = jsf.dataMap.get(shortDataPointer);\r\n if (!nodeDataMap.has('inputType')) {\r\n nodeDataMap.set('schemaPointer', schemaPointer);\r\n nodeDataMap.set('inputType', newNode.type);\r\n nodeDataMap.set('widget', newNode.widget);\r\n nodeDataMap.set('disabled', !!newNode.options.disabled);\r\n }\r\n //updateInputOptions(newNode, schema, jsf);\r\n if (!newNode.options.title && newNode.name && !/^\\d+$/.test(newNode.name)) {\r\n newNode.options.title = fixTitle(newNode.name);\r\n }\r\n\r\n if (newNode.dataType === 'object') {\r\n if (isArray(schema.required) && !nodeDataMap.has('required')) {\r\n nodeDataMap.set('required', schema.required);\r\n }\r\n if (isObject(schema.properties)) {\r\n const newSection: any[] = [];\r\n const propertyKeys = schema['ui:order'] || Object.keys(schema.properties);\r\n if (propertyKeys.includes('*') && !hasOwn(schema.properties, '*')) {\r\n const unnamedKeys = Object.keys(schema.properties)\r\n .filter(key => !propertyKeys.includes(key));\r\n for (let i = propertyKeys.length - 1; i >= 0; i--) {\r\n if (propertyKeys[i] === '*') {\r\n propertyKeys.splice(i, 1, ...unnamedKeys);\r\n }\r\n }\r\n }\r\n propertyKeys\r\n .filter(key => hasOwn(schema.properties, key) ||\r\n hasOwn(schema, 'additionalProperties')\r\n )\r\n .forEach(key => {\r\n const keySchemaPointer = hasOwn(schema.properties, key) ?\r\n '/properties/' + key : '/additionalProperties';\r\n const innerItem = buildLayoutFromSchema(\r\n jsf, widgetLibrary, isObject(nodeValue) ? nodeValue[key] : null,\r\n schemaPointer + keySchemaPointer,\r\n dataPointer + '/' + key,\r\n false, null, null, forRefLibrary, dataPointerPrefix\r\n );\r\n if (innerItem) {\r\n innerItem.schemaPointer=schemaPointer + keySchemaPointer;\r\n if (isInputRequired(schema, '/' + key)) {\r\n innerItem.options.required = true;\r\n jsf.fieldsRequired = true;\r\n }\r\n newSection.push(innerItem);\r\n }\r\n });\r\n\r\n //treat allOf the same as any of but need to add an extra\r\n //condition for which anyOf item is to be rendered \r\n [\"allOf\", \"anyOf\",\"oneOf\"].forEach(ofType => {\r\n if (hasOwn(schema, ofType) && isArray(schema[ofType])) {\r\n\r\n let outerOneOfItem; \r\n \r\n if(ofType==\"oneOf\"){\r\n outerOneOfItem = buildLayoutFromSchema(\r\n jsf, widgetLibrary, schema.oneOf,//{type:\"tabarray\",items:schema.oneOf},\r\n \"/\",//schemaPointer + `/${ofType}`,\r\n dataPointer,\r\n false, null, null, forRefLibrary, dataPointerPrefix,\r\n //{type:\"tabarray\",items:schema.oneOf,oneOf:schema.oneOf}\r\n {type:\"one-of\",items:schema.oneOf,oneOf:schema.oneOf}\r\n );\r\n //outerItem.items=cloneDeep(newSection);\r\n //newSection.length=0;\r\n newSection.push(outerOneOfItem);\r\n \r\n }\r\n \r\n schema[ofType].forEach((ofItem, ind) => {\r\n const keySchemaPointer = `/${ofType}/${ind}`;\r\n const innerItem = buildLayoutFromSchema(\r\n jsf, widgetLibrary, ofItem,\r\n schemaPointer + keySchemaPointer,\r\n dataPointer,\r\n false, null, null, ofType==\"oneOf\"/*forRefLibrary*/, dataPointerPrefix\r\n );\r\n if (innerItem) {\r\n //newSection.push(innerItem);\r\n if(innerItem.items){\r\n innerItem.items.forEach(innerItemLevel2=>{\r\n const l2SchemaPointer = hasOwn(ofItem,'properties') ?\r\n '/properties/' +innerItemLevel2.name:innerItemLevel2.name;\r\n //innerItemLevel2.oneOfPointer = schemaPointer + keySchemaPointer + l2SchemaPointer;\r\n // innerItemLevel2.schemaPointer=innerItemLevel2.schemaPointer; \r\n const ofPointer={anyOf:\"anyOfPointer\",oneOf:\"oneOfPointer\"}[ofType];\r\n innerItemLevel2[ofPointer]=ofPointer?innerItemLevel2.schemaPointer:undefined;\r\n })\r\n\r\n }\r\n //TODO review-will never reach here if forRefLibrary==true\r\n if (isArray(innerItem)) {\r\n let outerOneOfItemTpl=cloneDeep(newNode);\r\n outerOneOfItemTpl\r\n innerItem.forEach(item => {\r\n const l2SchemaPointer = hasOwn(ofItem,'properties') ?\r\n '/properties/' +item.name:item.name;\r\n if(ofType==\"anyOf\"){\r\n item.anyOfPointer=item.schemaPointer;\r\n }\r\n if(outerOneOfItem){\r\n ////item.oneOfPointer = schemaPointer + keySchemaPointer + l2SchemaPointer;\r\n //schemaPointer + keySchemaPointer + item.dataPointer;\r\n ////item.schemaPointer=item.oneOfPointer; \r\n\r\n /*\r\n outerOneOfItem.items=outerOneOfItem.items||[];\r\n outerOneOfItem.items.push(item);\r\n */\r\n outerOneOfItemTpl.items=outerOneOfItemTpl.items||[];\r\n outerOneOfItemTpl.items.push(item);\r\n \r\n }else{\r\n newSection.push(item);\r\n }\r\n\r\n });\r\n if(outerOneOfItem){\r\n outerOneOfItem.items=outerOneOfItem.items||[];\r\n outerOneOfItem.items.push(outerOneOfItemTpl);\r\n }\r\n //TODO test-might not work for more than 2 levels of nesting\r\n }else {\r\n if(outerOneOfItem){\r\n const ofPointer={anyOf:\"anyOfPointer\",oneOf:\"oneOfPointer\"}[ofType];\r\n innerItem[ofPointer]=ofPointer?schemaPointer + keySchemaPointer:undefined;\r\n ////innerItem.schemaPointer=innerItem.oneOfPointer; \r\n outerOneOfItem.items=outerOneOfItem.items||[];\r\n outerOneOfItem.items.push(innerItem);\r\n }else{\r\n newSection.push(innerItem)\r\n }\r\n }\r\n }\r\n })\r\n\r\n }\r\n })\r\n\r\n if (hasOwn(schema, \"if\")) {\r\n [\"then\", \"else\"].forEach(con => {\r\n if (hasOwn(schema, con)) {\r\n const keySchemaPointer = `/${con}`;\r\n const negateClause = con == \"else\";\r\n const innerItem = buildLayoutFromSchema(\r\n jsf, widgetLibrary, nodeValue[con],\r\n schemaPointer + keySchemaPointer,\r\n dataPointer,\r\n false, null, null, forRefLibrary, dataPointerPrefix\r\n );\r\n if (innerItem) {\r\n applyITEConditions(innerItem,schemaPointer,keySchemaPointer,negateClause)\r\n if (isArray(innerItem)) {\r\n innerItem.forEach(item => {\r\n //item.schemaPointer = schemaPointer + keySchemaPointer + item.dataPointer;\r\n //item.options.condition = convertJSONSchemaIfToCondition(schema, negateClause);\r\n newSection.push(item);\r\n });\r\n }\r\n else {\r\n //innerItem.schemaPointer = schemaPointer + keySchemaPointer + innerItem.dataPointer;\r\n //innerItem.options.condition = convertJSONSchemaIfToCondition(schema, negateClause);\r\n newSection.push(innerItem)\r\n }\r\n }\r\n }\r\n })\r\n\r\n\r\n }\r\n\r\n if (dataPointer === '' && !forRefLibrary) {\r\n newNode = newSection;\r\n } else {\r\n newNode.items = newSection;\r\n }\r\n }\r\n // TODO: Add patternProperties and additionalProperties inputs?\r\n // ... possibly provide a way to enter both key names and values?\r\n // if (isObject(schema.patternProperties)) { }\r\n // if (isObject(schema.additionalProperties)) { }\r\n\r\n } else if (newNode.dataType === 'array') {\r\n newNode.items = [];\r\n newNode.options.maxItems = Math.min(\r\n schema.maxItems || 1000, newNode.options.maxItems || 1000\r\n );\r\n newNode.options.minItems = Math.max(\r\n schema.minItems || 0, newNode.options.minItems || 0\r\n );\r\n if (!newNode.options.minItems && isInputRequired(jsSchema, schemaPointer)) {\r\n newNode.options.minItems = 1;\r\n }\r\n if (!hasOwn(newNode.options, 'listItems')) { newNode.options.listItems = 1; }\r\n newNode.options.tupleItems = isArray(schema.items) ? schema.items.length : 0;\r\n if (newNode.options.maxItems <= newNode.options.tupleItems) {\r\n newNode.options.tupleItems = newNode.options.maxItems;\r\n newNode.options.listItems = 0;\r\n } else if (newNode.options.maxItems <\r\n newNode.options.tupleItems + newNode.options.listItems\r\n ) {\r\n newNode.options.listItems = newNode.options.maxItems - newNode.options.tupleItems;\r\n } else if (newNode.options.minItems >\r\n newNode.options.tupleItems + newNode.options.listItems\r\n ) {\r\n newNode.options.listItems = newNode.options.minItems - newNode.options.tupleItems;\r\n }\r\n if (!nodeDataMap.has('maxItems')) {\r\n nodeDataMap.set('maxItems', newNode.options.maxItems);\r\n nodeDataMap.set('minItems', newNode.options.minItems);\r\n nodeDataMap.set('tupleItems', newNode.options.tupleItems);\r\n nodeDataMap.set('listItems', newNode.options.listItems);\r\n }\r\n if (!jsf.arrayMap.has(shortDataPointer)) {\r\n jsf.arrayMap.set(shortDataPointer, newNode.options.tupleItems);\r\n }\r\n removable = newNode.options.removable !== false;\r\n let additionalItemsSchemaPointer: string = null;\r\n\r\n // If 'items' is an array = tuple items\r\n if (isArray(schema.items)) {\r\n newNode.items = [];\r\n for (let i = 0; i < newNode.options.tupleItems; i++) {\r\n let newItem: any;\r\n const itemRefPointer = removeRecursiveReferences(\r\n shortDataPointer + '/' + i, jsf.dataRecursiveRefMap, jsf.arrayMap\r\n );\r\n const itemRecursive = !itemRefPointer.length ||\r\n itemRefPointer !== shortDataPointer + '/' + i;\r\n\r\n // If removable, add tuple item layout to layoutRefLibrary\r\n if (removable && i >= newNode.options.minItems) {\r\n let conditionalRefPointer=`${itemRefPointer}@${schemaPointer}`;\r\n let templateRefToUse=itemRefPointer;\r\n if (hasOwn(jsf.layoutRefLibrary, itemRefPointer)\r\n && !hasOwn(jsf.layoutRefLibrary, conditionalRefPointer)) {\r\n jsf.layoutRefLibrary[conditionalRefPointer] = buildLayoutFromSchema(\r\n jsf, widgetLibrary, isArray(nodeValue) ? nodeValue[i] : null,\r\n schemaPointer + '/items/' + i,\r\n itemRecursive ? '' : dataPointer + '/' + i,\r\n true, 'tuple', true, true, itemRecursive ? dataPointer + '/' + i : ''\r\n );\r\n templateRefToUse=conditionalRefPointer;\r\n }\r\n if (!hasOwn(jsf.layoutRefLibrary, itemRefPointer)) {\r\n // Set to null first to prevent recursive reference from causing endless loop\r\n jsf.layoutRefLibrary[itemRefPointer] = null;\r\n jsf.layoutRefLibrary[itemRefPointer] = buildLayoutFromSchema(\r\n jsf, widgetLibrary, isArray(nodeValue) ? nodeValue[i] : null,\r\n schemaPointer + '/items/' + i,\r\n itemRecursive ? '' : dataPointer + '/' + i,\r\n true, 'tuple', true, true, itemRecursive ? dataPointer + '/' + i : ''\r\n );\r\n if (itemRecursive) {\r\n jsf.layoutRefLibrary[itemRefPointer].recursiveReference = true;\r\n }\r\n jsf.layoutRefLibrary[conditionalRefPointer]=jsf.layoutRefLibrary[itemRefPointer];\r\n }\r\n newItem = getLayoutNode({\r\n $ref: templateRefToUse,\r\n dataPointer: dataPointer + '/' + i,\r\n recursiveReference: itemRecursive,\r\n }, jsf, widgetLibrary, isArray(nodeValue) ? nodeValue[i] : null);\r\n } else {\r\n newItem = buildLayoutFromSchema(\r\n jsf, widgetLibrary, isArray(nodeValue) ? nodeValue[i] : null,\r\n schemaPointer + '/items/' + i,\r\n dataPointer + '/' + i,\r\n true, 'tuple', false, forRefLibrary, dataPointerPrefix\r\n );\r\n }\r\n if (newItem) { newNode.items.push(newItem); }\r\n }\r\n\r\n // If 'additionalItems' is an object = additional list items, after tuple items\r\n if (isObject(schema.additionalItems)) {\r\n additionalItemsSchemaPointer = schemaPointer + '/additionalItems';\r\n }\r\n\r\n // If 'items' is an object = list items only (no tuple items)\r\n } else if (isObject(schema.items)) {\r\n additionalItemsSchemaPointer = schemaPointer + '/items';\r\n }\r\n\r\n if (additionalItemsSchemaPointer) {\r\n const itemRefPointer = removeRecursiveReferences(\r\n shortDataPointer + '/-', jsf.dataRecursiveRefMap, jsf.arrayMap\r\n );\r\n const itemRecursive = !itemRefPointer.length ||\r\n itemRefPointer !== shortDataPointer + '/-';\r\n const itemSchemaPointer = removeRecursiveReferences(\r\n additionalItemsSchemaPointer, jsf.schemaRecursiveRefMap, jsf.arrayMap\r\n );\r\n let conditionalRefPointer=`${itemRefPointer}@${schemaPointer}`;\r\n let templateRefToUse=itemRefPointer;\r\n if (hasOwn(jsf.layoutRefLibrary, itemRefPointer)\r\n && !hasOwn(jsf.layoutRefLibrary, conditionalRefPointer)) {\r\n jsf.layoutRefLibrary[conditionalRefPointer] = buildLayoutFromSchema(\r\n jsf, widgetLibrary, null,\r\n itemSchemaPointer,\r\n itemRecursive ? '' : dataPointer + '/-',\r\n true, 'list', removable, true, itemRecursive ? dataPointer + '/-' : ''\r\n )\r\n templateRefToUse=conditionalRefPointer;\r\n }\r\n // Add list item layout to layoutRefLibrary\r\n if (itemRefPointer.length && !hasOwn(jsf.layoutRefLibrary, itemRefPointer)) {\r\n // Set to null first to prevent recursive reference from causing endless loop\r\n jsf.layoutRefLibrary[itemRefPointer] = null;\r\n jsf.layoutRefLibrary[itemRefPointer] = buildLayoutFromSchema(\r\n jsf, widgetLibrary, null,\r\n itemSchemaPointer,\r\n itemRecursive ? '' : dataPointer + '/-',\r\n true, 'list', removable, true, itemRecursive ? dataPointer + '/-' : ''\r\n );\r\n if (itemRecursive) {\r\n jsf.layoutRefLibrary[itemRefPointer].recursiveReference = true;\r\n }\r\n jsf.layoutRefLibrary[conditionalRefPointer]=jsf.layoutRefLibrary[itemRefPointer];\r\n }\r\n\r\n // Add any additional default items\r\n if (!itemRecursive || newNode.options.required) {\r\n const arrayLength = Math.min(Math.max(\r\n itemRecursive ? 0 :\r\n newNode.options.tupleItems + newNode.options.listItems,\r\n isArray(nodeValue) ? nodeValue.length : 0\r\n ), newNode.options.maxItems);\r\n if (newNode.items.length < arrayLength) {\r\n for (let i = newNode.items.length; i < arrayLength; i++) {\r\n newNode.items.push(getLayoutNode({\r\n $ref: templateRefToUse,\r\n dataPointer: dataPointer + '/-',\r\n recursiveReference: itemRecursive,\r\n }, jsf, widgetLibrary, isArray(nodeValue) ? nodeValue[i] : null));\r\n }\r\n }\r\n }\r\n\r\n // If needed, add button to add items to array\r\n if (newNode.options.addable !== false &&\r\n newNode.options.minItems < newNode.options.maxItems &&\r\n (newNode.items[newNode.items.length - 1] || {}).type !== '$ref'\r\n ) {\r\n let buttonText =\r\n ((jsf.layoutRefLibrary[itemRefPointer] || {}).options || {}).title;\r\n const prefix = buttonText ? 'Add ' : 'Add to ';\r\n if (!buttonText) {\r\n buttonText = schema.title || fixTitle(JsonPointer.toKey(dataPointer));\r\n }\r\n if (!/^add\\b/i.test(buttonText)) { buttonText = prefix + buttonText; }\r\n newNode.items.push({\r\n _id: uniqueId(),\r\n arrayItem: true,\r\n arrayItemType: 'list',\r\n dataPointer: newNode.dataPointer + '/-',\r\n options: {\r\n listItems: newNode.options.listItems,\r\n maxItems: newNode.options.maxItems,\r\n minItems: newNode.options.minItems,\r\n removable: false,\r\n title: buttonText,\r\n tupleItems: newNode.options.tupleItems,\r\n },\r\n recursiveReference: itemRecursive,\r\n type: '$ref',\r\n widget: widgetLibrary.getWidget('$ref'),\r\n $ref: templateRefToUse//itemRefPointer,\r\n });\r\n }\r\n }\r\n\r\n } else if (newNode.dataType === '$ref') {\r\n const schemaRef = JsonPointer.compile(schema.$ref);\r\n const dataRef = JsonPointer.toDataPointer(schemaRef, jsSchema);\r\n let buttonText = '';\r\n\r\n // Get newNode title\r\n if (newNode.options.add) {\r\n buttonText = newNode.options.add;\r\n } else if (newNode.name && !/^\\d+$/.test(newNode.name)) {\r\n buttonText =\r\n (/^add\\b/i.test(newNode.name) ? '' : 'Add ') + fixTitle(newNode.name);\r\n\r\n // If newNode doesn't have a title, look for title of parent array item\r\n } else {\r\n const parentSchema =\r\n JsonPointer.get(jsSchema, schemaPointer, 0, -1);\r\n if (hasOwn(parentSchema, 'title')) {\r\n buttonText = 'Add to ' + parentSchema.title;\r\n } else {\r\n const pointerArray = JsonPointer.parse(newNode.dataPointer);\r\n buttonText = 'Add to ' + fixTitle(pointerArray[pointerArray.length - 2]);\r\n }\r\n }\r\n Object.assign(newNode, {\r\n recursiveReference: true,\r\n widget: widgetLibrary.getWidget('$ref'),\r\n $ref: dataRef,\r\n });\r\n Object.assign(newNode.options, {\r\n removable: false,\r\n title: buttonText,\r\n });\r\n if (isNumber(JsonPointer.get(jsSchema, schemaPointer, 0, -1).maxItems)) {\r\n newNode.options.maxItems =\r\n JsonPointer.get(jsSchema, schemaPointer, 0, -1).maxItems;\r\n }\r\n\r\n // Add layout template to layoutRefLibrary\r\n if (dataRef.length) {\r\n if (!hasOwn(jsf.layoutRefLibrary, dataRef)) {\r\n // Set to null first to prevent recursive reference from causing endless loop\r\n jsf.layoutRefLibrary[dataRef] = null;\r\n const newLayout = buildLayoutFromSchema(\r\n jsf, widgetLibrary, null, schemaRef, '',\r\n newNode.arrayItem, newNode.arrayItemType, true, true, dataPointer\r\n );\r\n if (newLayout) {\r\n newLayout.recursiveReference = true;\r\n jsf.layoutRefLibrary[dataRef] = newLayout;\r\n } else {\r\n delete jsf.layoutRefLibrary[dataRef];\r\n }\r\n } else if (!jsf.layoutRefLibrary[dataRef].recursiveReference) {\r\n jsf.layoutRefLibrary[dataRef].recursiveReference = true;\r\n }\r\n }\r\n }else if (newNode.type === 'if') {\r\n const newSection: any[] = [];\r\n [\"then\", \"else\"].forEach(con => {\r\n if (hasOwn(schema, con)) {\r\n\r\n const keySchemaPointer = `/${con}`;\r\n const negateClause = con == \"else\";\r\n const innerItem = buildLayoutFromSchema(\r\n jsf, widgetLibrary, nodeValue[con],\r\n schemaPointer + keySchemaPointer,\r\n dataPointer,\r\n false, null, null, forRefLibrary, dataPointerPrefix\r\n );\r\n if (innerItem) {\r\n applyITEConditions(innerItem,schemaPointer,keySchemaPointer,negateClause)\r\n if (isArray(innerItem)) {\r\n innerItem.forEach(item => {\r\n //item.schemaPointer = schemaPointer + keySchemaPointer + item.dataPointer;\r\n //item.options.condition = convertJSONSchemaIfToCondition(schema, negateClause);\r\n newSection.push(item);\r\n /////// newNode = newSection\r\n });\r\n } else {\r\n //innerItem.schemaPointer = schemaPointer + keySchemaPointer + innerItem.dataPointer;\r\n //innerItem.options.condition = convertJSONSchemaIfToCondition(schema, negateClause);\r\n ///////newNode = innerItem\r\n newSection.push(innerItem);\r\n }\r\n }\r\n }\r\n })\r\n newNode = newSection;\r\n }\r\n\r\n return newNode;\r\n}\r\n\r\n/**\r\n * 'mapLayout' function\r\n *\r\n * Creates a new layout by running each element in an existing layout through\r\n * an iteratee. Recursively maps within array elements 'items' and 'tabs'.\r\n * The iteratee is invoked with four arguments: (value, index, layout, path)\r\n *\r\n * The returned layout may be longer (or shorter) then the source layout.\r\n *\r\n * If an item from the source layout returns multiple items (as '*' usually will),\r\n * this function will keep all returned items in-line with the surrounding items.\r\n *\r\n * If an item from the source layout causes an error and returns null, it is\r\n * skipped without error, and the function will still return all non-null items.\r\n *\r\n * // layout - the layout to map\r\n * // { (v: any, i?: number, l?: any, p?: string) => any }\r\n * function - the funciton to invoke on each element\r\n * // { string|string[] = '' } layoutPointer - the layoutPointer to layout, inside rootLayout\r\n * // { any[] = layout } rootLayout - the root layout, which conatins layout\r\n * //\r\n */\r\nexport function mapLayout(layout, fn, layoutPointer = '', rootLayout = layout) {\r\n let indexPad = 0;\r\n let newLayout: any[] = [];\r\n forEach(layout, (item, index) => {\r\n const realIndex = +index + indexPad;\r\n const newLayoutPointer = layoutPointer + '/' + realIndex;\r\n let newNode: any = copy(item);\r\n let itemsArray: any[] = [];\r\n if (isObject(item)) {\r\n if (hasOwn(item, 'tabs')) {\r\n item.items = item.tabs;\r\n delete item.tabs;\r\n }\r\n if (hasOwn(item, 'items')) {\r\n itemsArray = isArray(item.items) ? item.items : [item.items];\r\n }\r\n }\r\n if (itemsArray.length) {\r\n newNode.items = mapLayout(itemsArray, fn, newLayoutPointer + '/items', rootLayout);\r\n }\r\n newNode = fn(newNode, realIndex, newLayoutPointer, rootLayout);\r\n if (!isDefined(newNode)) {\r\n indexPad--;\r\n } else {\r\n if (isArray(newNode)) { indexPad += newNode.length - 1; }\r\n newLayout = newLayout.concat(newNode);\r\n }\r\n });\r\n return newLayout;\r\n}\r\n\r\n/**\r\n * 'getLayoutNode' function\r\n * Copy a new layoutNode from layoutRefLibrary\r\n *\r\n * // refNode -\r\n * // layoutRefLibrary -\r\n * // { any = null } widgetLibrary -\r\n * // { any = null } nodeValue -\r\n * // copied layoutNode\r\n */\r\nexport function getLayoutNode(\r\n refNode, jsf, widgetLibrary: any = null, nodeValue: any = null\r\n) {\r\n\r\n // If recursive reference and building initial layout, return Add button\r\n if (refNode.recursiveReference && widgetLibrary) {\r\n const newLayoutNode = cloneDeep(refNode);\r\n if (!newLayoutNode.options) { newLayoutNode.options = {}; }\r\n Object.assign(newLayoutNode, {\r\n recursiveReference: true,\r\n widget: widgetLibrary.getWidget('$ref'),\r\n });\r\n Object.assign(newLayoutNode.options, {\r\n removable: false,\r\n title: 'Add ' + newLayoutNode.$ref,\r\n });\r\n return newLayoutNode;\r\n\r\n // Otherwise, return referenced layout\r\n } else {\r\n let newLayoutNode = jsf.layoutRefLibrary[refNode.$ref];\r\n // If value defined, build new node from schema (to set array lengths)\r\n if (isDefined(nodeValue)) {\r\n newLayoutNode = buildLayoutFromSchema(\r\n jsf, widgetLibrary, nodeValue,\r\n JsonPointer.toSchemaPointer(refNode.$ref, jsf.schema),\r\n refNode.$ref, newLayoutNode.arrayItem,\r\n newLayoutNode.arrayItemType, newLayoutNode.options.removable, false\r\n );\r\n } else {\r\n // If value not defined, copy node from layoutRefLibrary\r\n newLayoutNode = cloneDeep(newLayoutNode);\r\n JsonPointer.forEachDeep(newLayoutNode, (subNode, pointer) => {\r\n\r\n // Reset all _id's in newLayoutNode to unique values\r\n if (hasOwn(subNode, '_id')) { subNode._id = uniqueId(); }\r\n\r\n // If adding a recursive item, prefix current dataPointer\r\n // to all dataPointers in new layoutNode\r\n if (refNode.recursiveReference && hasOwn(subNode, 'dataPointer')) {\r\n subNode.dataPointer = refNode.dataPointer + subNode.dataPointer;\r\n }\r\n });\r\n }\r\n return newLayoutNode;\r\n }\r\n}\r\n\r\n/**\r\n * 'buildTitleMap' function\r\n *\r\n * // titleMap -\r\n * // enumList -\r\n * // { boolean = true } fieldRequired -\r\n * // { boolean = true } flatList -\r\n * // { TitleMapItem[] }\r\n */\r\nexport function buildTitleMap(\r\n titleMap, enumList, fieldRequired = true, flatList = true\r\n) {\r\n let newTitleMap: TitleMapItem[] = [];\r\n let hasEmptyValue = false;\r\n if (titleMap) {\r\n if (isArray(titleMap)) {\r\n if (enumList) {\r\n for (const i of Object.keys(titleMap)) {\r\n if (isObject(titleMap[i])) { // JSON Form style\r\n const value = titleMap[i].value;\r\n if (enumList.includes(value)) {\r\n const name = titleMap[i].name;\r\n newTitleMap.push({ name, value });\r\n if (value === undefined || value === null) { hasEmptyValue = true; }\r\n }\r\n } else if (isString(titleMap[i])) { // React Jsonschema Form style\r\n if (i < enumList.length) {\r\n const name = titleMap[i];\r\n const value = enumList[i];\r\n newTitleMap.push({ name, value });\r\n if (value === undefined || value === null) { hasEmptyValue = true; }\r\n }\r\n }\r\n }\r\n } else { // If array titleMap and no enum list, just return the titleMap - Angular Schema Form style\r\n newTitleMap = titleMap;\r\n if (!fieldRequired) {\r\n hasEmptyValue = !!newTitleMap\r\n .filter(i => i.value === undefined || i.value === null)\r\n .length;\r\n }\r\n }\r\n } else if (enumList) { // Alternate JSON Form style, with enum list\r\n for (const i of Object.keys(enumList)) {\r\n const value = enumList[i];\r\n if (hasOwn(titleMap, value)) {\r\n const name = titleMap[value];\r\n newTitleMap.push({ name, value });\r\n if (value === undefined || value === null) { hasEmptyValue = true; }\r\n }\r\n }\r\n } else { // Alternate JSON Form style, without enum list\r\n for (const value of Object.keys(titleMap)) {\r\n const name = titleMap[value];\r\n newTitleMap.push({ name, value });\r\n if (value === undefined || value === null) { hasEmptyValue = true; }\r\n }\r\n }\r\n } else if (enumList) { // Build map from enum list alone\r\n for (const i of Object.keys(enumList)) {\r\n const name = enumList[i];\r\n const value = enumList[i];\r\n newTitleMap.push({ name, value });\r\n if (value === undefined || value === null) { hasEmptyValue = true; }\r\n }\r\n } else { // If no titleMap and no enum list, return default map of boolean values\r\n newTitleMap = [{ name: 'True', value: true }, { name: 'False', value: false }];\r\n }\r\n\r\n // Does titleMap have groups?\r\n if (newTitleMap.some(title => hasOwn(title, 'group'))) {\r\n hasEmptyValue = false;\r\n\r\n // If flatList = true, flatten items & update name to group: name\r\n if (flatList) {\r\n newTitleMap = newTitleMap.reduce((groupTitleMap, title) => {\r\n if (hasOwn(title, 'group')) {\r\n if (isArray(title.items)) {\r\n groupTitleMap = [\r\n ...groupTitleMap,\r\n ...title.items.map(item =>\r\n ({ ...item, ...{ name: `${title.group}: ${item.name}` } })\r\n )\r\n ];\r\n if (title.items.some(item => item.value === undefined || item.value === null)) {\r\n hasEmptyValue = true;\r\n }\r\n }\r\n if (hasOwn(title, 'name') && hasOwn(title, 'value')) {\r\n title.name = `${title.group}: ${title.name}`;\r\n delete title.group;\r\n groupTitleMap.push(title);\r\n if (title.value === undefined || title.value === null) {\r\n hasEmptyValue = true;\r\n }\r\n }\r\n } else {\r\n groupTitleMap.push(title);\r\n if (title.value === undefined || title.value === null) {\r\n hasEmptyValue = true;\r\n }\r\n }\r\n return groupTitleMap;\r\n }, []);\r\n\r\n // If flatList = false, combine items from matching groups\r\n } else {\r\n newTitleMap = newTitleMap.reduce((groupTitleMap, title) => {\r\n if (hasOwn(title, 'group')) {\r\n if (title.group !== (groupTitleMap[groupTitleMap.length - 1] || {}).group) {\r\n groupTitleMap.push({ group: title.group, items: title.items || [] });\r\n }\r\n if (hasOwn(title, 'name') && hasOwn(title, 'value')) {\r\n groupTitleMap[groupTitleMap.length - 1].items\r\n .push({ name: title.name, value: title.value });\r\n if (title.value === undefined || title.value === null) {\r\n hasEmptyValue = true;\r\n }\r\n }\r\n } else {\r\n groupTitleMap.push(title);\r\n if (title.value === undefined || title.value === null) {\r\n hasEmptyValue = true;\r\n }\r\n }\r\n return groupTitleMap;\r\n }, []);\r\n }\r\n }\r\n if (!fieldRequired && !hasEmptyValue) {\r\n newTitleMap.unshift({ name: '<em>None</em>', value: null });\r\n }\r\n return newTitleMap;\r\n}\r\n","// Warning: Changing the following order may cause errors if the new order\r\n// causes a library to be imported before another library it depends on.\r\n\r\nexport {\r\n _executeAsyncValidators, _executeValidators, _mergeErrors, _mergeObjects, _toPromise, AsyncIValidatorFn, getType, hasValue, inArray, isArray, isBoolean, isDate, isDefined, isEmpty, isFunction, isInteger, isMap, isNumber, isObject, isObservable, isPrimitive, isPromise, isSet, isString, isType, IValidatorFn, JavaScriptPrimitiveType,\r\n JavaScriptType, PlainObject, PrimitiveValue, SchemaPrimitiveType, SchemaType, toJavaScriptType, toObservable, toSchemaType, xor\r\n} from './validator.functions';\r\n\r\nexport {\r\n addClasses, commonItems, copy, fixTitle, forEach, forEachCopy, hasNonNullValue, hasOwn, mergeFilteredObject, toTitleCase, uniqueItems\r\n} from './utility.functions';\r\n\r\nexport { JsonPointer, Pointer } from './jsonpointer.functions';\r\n\r\nexport { JsonValidators } from './json.validators';\r\n\r\nexport { buildSchemaFromData, buildSchemaFromLayout, checkInlineType, combineAllOf, fixRequiredArrayProperties, getControlValidators, getFromSchema, getInputType, getSubSchema, getTitleMapFromOneOf, isInputRequired, removeRecursiveReferences, resolveSchemaReferences, updateInputOptions } from './json-schema.functions';\r\n\r\nexport { convertSchemaToDraft6 } from './convert-schema-to-draft6.function';\r\n\r\nexport { mergeSchemas } from './merge-schemas.function';\r\n\r\nexport {\r\n buildFormGroup, buildFormGroupTemplate, formatFormData,\r\n getControl, path2ControlKey, setControl, setRequiredFields\r\n} from './form-group.functions';\r\n\r\nexport {\r\n buildLayout, buildLayoutFromSchema, buildTitleMap, getLayoutNode, mapLayout\r\n} from './layout.functions';\r\n\r\n","import { Injectable, OnDestroy, Signal } from '@angular/core';\r\nimport { AbstractControl, UntypedFormArray, UntypedFormGroup } from '@angular/forms';\r\n//import Ajv, { ErrorObject, Options } from 'ajv';\r\nimport addFormats from \"ajv-formats\";\r\nimport Ajv2019, { ErrorObject, Options, ValidateFunction } from 'ajv/dist/2019';\r\nimport jsonDraft6 from 'ajv/lib/refs/json-schema-draft-06.json';\r\nimport jsonDraft7 from 'ajv/lib/refs/json-schema-draft-07.json';\r\nimport cloneDeep from 'lodash/cloneDeep';\r\nimport _isArray from 'lodash/isArray';\r\nimport { BehaviorSubject, Subject, Subscription } from 'rxjs';\r\nimport {\r\n deValidationMessages,\r\n enValidationMessages,\r\n esValidationMessages,\r\n frValidationMessages,\r\n itValidationMessages,\r\n ptValidationMessages,\r\n zhValidationMessages\r\n} from './locale';\r\nimport {\r\n JsonPointer,\r\n buildFormGroup,\r\n buildFormGroupTemplate,\r\n buildLayout,\r\n buildSchemaFromData,\r\n buildSchemaFromLayout,\r\n fixTitle,\r\n forEach,\r\n formatFormData,\r\n getControl,\r\n getLayoutNode,\r\n hasOwn,\r\n hasValue,\r\n isArray,\r\n isDefined,\r\n isEmpty,\r\n isObject,\r\n removeRecursiveReferences,\r\n toTitleCase\r\n} from './shared';\r\n\r\nimport { default as _isEqual, default as isEqual } from 'lodash/isEqual';\r\nimport { setControl } from './shared/form-group.functions';\r\n\r\n\r\nexport type WidgetContext={\r\n formControl?:AbstractControl;\r\n layoutNode?: Signal<any>;\r\n layoutIndex?: Signal<number[]>;\r\n dataIndex?: Signal<number[]>;\r\n options?:any;\r\n controlValue?:any;\r\n boundControl?:boolean;\r\n controlName?:string;\r\n controlDisabled?:boolean\r\n}\r\n\r\nexport type AJVRegistryItem={\r\n [name: string]:{\r\n name:string,\r\n ajvInstance:Ajv2019\r\n ajvValidator:ValidateFunction\r\n }\r\n}\r\n\r\nexport interface TitleMapItem {\r\n name?: string;\r\n value?: any;\r\n checked?: boolean;\r\n group?: string;\r\n items?: TitleMapItem[];\r\n}\r\nexport interface ErrorMessages {\r\n [control_name: string]: {\r\n message: string | Function | Object;\r\n code: string;\r\n }[];\r\n}\r\n\r\n@Injectable()\r\nexport class JsonSchemaFormService implements OnDestroy {\r\n JsonFormCompatibility = false;\r\n ReactJsonSchemaFormCompatibility = false;\r\n AngularSchemaFormCompatibility = false;\r\n tpldata: any = {};\r\n\r\n ajvOptions: Options = {\r\n allErrors: true,\r\n //validateFormats:false,\r\n strict:false\r\n \r\n };\r\n ajv:any = new Ajv2019(this.ajvOptions); // AJV: Another JSON Schema Validator\r\n \r\n //Being replaced by getAjvValidator()\r\n validateFormData: any = null; // Compiled AJV function to validate active form's schema\r\n\r\n formValues: any = {}; // Internal form data (may not have correct types)\r\n data: any = {}; // Output form data (formValues, formatted with correct data types)\r\n schema: any = {}; // Internal JSON Schema\r\n layout: any[] = []; // Internal form layout\r\n formGroupTemplate: any = {}; // Template used to create formGroup\r\n formGroup: any = null; // Angular formGroup, which powers the reactive form\r\n framework: any = null; // Active framework component\r\n formOptions: any; // Active options, used to configure the form\r\n\r\n validData: any = null; // Valid form data (or null) (=== isValid ? data : null)\r\n isValid: boolean = null; // Is current form data valid?\r\n ajvErrors: ErrorObject[] = null; // Ajv errors for current data\r\n validationErrors: any = null; // Any validation errors for current data\r\n dataErrors: any = new Map(); //\r\n formValueSubscription: any = null; // Subscription to formGroup.valueChanges observable (for un- and re-subscribing)\r\n dataChanges: Subject<any> = new Subject(); // Form data observable\r\n isValidChanges: Subject<any> = new Subject(); // isValid observable\r\n validationErrorChanges: Subject<any> = new Subject(); // validationErrors observable\r\n\r\n arrayMap: Map<string, number> = new Map(); // Maps arrays in data object and number of tuple values\r\n dataMap: Map<string, any> = new Map(); // Maps paths in form data to schema and formGroup paths\r\n dataRecursiveRefMap: Map<string, string> = new Map(); // Maps recursive reference points in form data\r\n schemaRecursiveRefMap: Map<string, string> = new Map(); // Maps recursive reference points in schema\r\n schemaRefLibrary: any = {}; // Library of schemas for resolving schema $refs\r\n layoutRefLibrary: any = { '': null }; // Library of layout nodes for adding to form\r\n templateRefLibrary: any = {}; // Library of formGroup templates for adding to form\r\n hasRootReference = false; // Does the form include a recursive reference to itself?\r\n\r\n language = 'en-US'; // Does the form include a recursive reference to itself?\r\n\r\n // Default global form options\r\n defaultFormOptions: any = {\r\n autocomplete: true, // Allow the web browser to remember previous form submission values as defaults\r\n addSubmit: 'auto', // Add a submit button if layout does not have one?\r\n // for addSubmit: true = always, false = never,\r\n // 'auto' = only if layout is undefined (form is built from schema alone)\r\n debug: false, // Show debugging output?\r\n disableInvalidSubmit: true, // Disable submit if form invalid?\r\n formDisabled: false, // Set entire form as disabled? (not editable, and disables outputs)\r\n formReadonly: false, // Set entire form as read only? (not editable, but outputs still enabled)\r\n fieldsRequired: false, // (set automatically) Are there any required fields in the form?\r\n framework: 'no-framework', // The framework to load\r\n loadExternalAssets: false, // Load external css and JavaScript for framework?\r\n pristine: { errors: true, success: true },\r\n supressPropertyTitles: false,\r\n setSchemaDefaults: 'auto', // Set fefault values from schema?\r\n // true = always set (unless overridden by layout default or formValues)\r\n // false = never set\r\n // 'auto' = set in addable components, and everywhere if formValues not set\r\n setLayoutDefaults: 'auto', // Set fefault values from layout?\r\n // true = always set (unless overridden by formValues)\r\n // false = never set\r\n // 'auto' = set in addable components, and everywhere if formValues not set\r\n validateOnRender: 'auto', // Validate fields immediately, before they are touched?\r\n // true = validate all fields immediately\r\n // false = only validate fields after they are touched by user\r\n // 'auto' = validate fields with values immediately, empty fields after they are touched\r\n widgets: {}, // Any custom widgets to load\r\n defaultWidgetOptions: {\r\n // Default options for form control widgets\r\n listItems: 1, // Number of list items to initially add to arrays with no default value\r\n addable: true, // Allow adding items to an array or $ref point?\r\n orderable: true, // Allow reordering items within an array?\r\n removable: true, // Allow removing items from an array or $ref point?\r\n enableErrorState: true, // Apply 'has-error' class when field fails validation?\r\n // disableErrorState: false, // Don't apply 'has-error' class when field fails validation?\r\n enableSuccessState: true, // Apply 'has-success' class when field validates?\r\n // disableSuccessState: false, // Don't apply 'has-success' class when field validates?\r\n feedback: false, // Show inline feedback icons?\r\n feedbackOnRender: false, // Show errorMessage on Render?\r\n notitle: false, // Hide title?\r\n disabled: false, // Set control as disabled? (not editable, and excluded from output)\r\n readonly: false, // Set control as read only? (not editable, but included in output)\r\n returnEmptyFields: true, // return values for fields that contain no data?\r\n validationMessages: {} // set by setLanguage()\r\n }\r\n };\r\n\r\n fcValueChangesSubs:Subscription;\r\n fcStatusChangesSubs:Subscription;\r\n\r\n //TODO-review,may not be needed as sortablejs replaces dnd\r\n //this has been added to enable or disable the dragabble state of a component\r\n //using the OrderableDirective, mainly when an <input type=\"range\"> \r\n //elements are present, as the draggable attribute makes it difficult to\r\n //slide the range sliders and end up dragging\r\n //NB this will be set globally for all OrderableDirective instances\r\n //and will only be enabled when/if the caller sets the value back to true \r\n private draggableStateSubject = new BehaviorSubject<boolean>(true); // Default value true\r\n draggableState$ = this.draggableStateSubject.asObservable();\r\n\r\n setDraggableState(value: boolean) {\r\n this.draggableStateSubject.next(value); // Update the draggable value\r\n }\r\n\r\n createAjvInstance(ajvOptions){\r\n let ajvInstance=new Ajv2019(ajvOptions); \r\n ajvInstance.addMetaSchema(jsonDraft6);\r\n ajvInstance.addMetaSchema(jsonDraft7);\r\n addFormats(ajvInstance);\r\n return ajvInstance;\r\n }\r\n\r\n createAndRegisterAjvInstance(ajvOptions,name?:string){\r\n const intanceName=name||`ajv_${Date.now()}`;\r\n if(this.ajvRegistry[intanceName]){\r\n throw new Error(`ajv instance with name:'${intanceName}' has already been registered`);\r\n }\r\n const ajvInstance=this.createAjvInstance(ajvOptions);\r\n this.ajvRegistry[intanceName]={\r\n name:intanceName,\r\n ajvInstance:ajvInstance,\r\n ajvValidator:null\r\n };\r\n return this.ajvRegistry[intanceName];\r\n }\r\n\r\n ajvRegistry:AJVRegistryItem={}\r\n\r\n getAjvInstance(name='default'){\r\n return this.ajvRegistry[name].ajvInstance;\r\n }\r\n getAjvValidator(name='default'){\r\n return this.ajvRegistry[name]?.ajvValidator;\r\n }\r\n\r\n constructor() {\r\n this.setLanguage(this.language);\r\n this.ajv.addMetaSchema(jsonDraft6);\r\n this.ajv.addMetaSchema(jsonDraft7);\r\n addFormats(this.ajv);\r\n this.ajvRegistry['default']={name:'default',ajvInstance:this.ajv,ajvValidator:null};\r\n // Add custom 'duration' format using a regex\r\n/* \r\nthis.ajv.addFormat(\"duration\", {\r\n type: \"string\",\r\n validate: (duration) => /^P(?!$)(\\d+Y)?(\\d+M)?(\\d+D)?(T(\\d+H)?(\\d+M)?(\\d+S)?)?$/.test(duration)\r\n});\r\n*/\r\n }\r\n ngOnDestroy(): void {\r\n this.fcValueChangesSubs?.unsubscribe();\r\n this.fcStatusChangesSubs?.unsubscribe();\r\n this.formValueSubscription?.unsubscribe();\r\n this.fcValueChangesSubs=null;\r\n this.fcStatusChangesSubs=null;\r\n this.formValueSubscription=null;\r\n\r\n }\r\n\r\n setLanguage(language: string = 'en-US') {\r\n this.language = language;\r\n const languageValidationMessages = {\r\n de: deValidationMessages,\r\n en: enValidationMessages,\r\n es: esValidationMessages,\r\n fr: frValidationMessages,\r\n it: itValidationMessages,\r\n pt: ptValidationMessages,\r\n zh: zhValidationMessages,\r\n };\r\n const languageCode = language.slice(0, 2);\r\n\r\n const validationMessages = languageValidationMessages[languageCode];\r\n\r\n this.defaultFormOptions.defaultWidgetOptions.validationMessages = cloneDeep(\r\n validationMessages\r\n );\r\n }\r\n\r\n getData() {\r\n return this.data;\r\n }\r\n\r\n getSchema() {\r\n return this.schema;\r\n }\r\n\r\n getLayout() {\r\n return this.layout;\r\n }\r\n\r\n resetAllValues() {\r\n this.JsonFormCompatibility = false;\r\n this.ReactJsonSchemaFormCompatibility = false;\r\n this.AngularSchemaFormCompatibility = false;\r\n this.tpldata = {};\r\n this.validateFormData = null;//Being replaced by getAjvValidator()\r\n this.formValues = {};\r\n this.schema = {};\r\n this.layout = [];\r\n this.formGroupTemplate = {};\r\n this.formGroup = null;\r\n this.framework = null;\r\n this.data = {};\r\n this.validData = null;\r\n this.isValid = null;\r\n this.validationErrors = null;\r\n this.arrayMap = new Map();\r\n this.dataMap = new Map();\r\n this.dataRecursiveRefMap = new Map();\r\n this.schemaRecursiveRefMap = new Map();\r\n this.layoutRefLibrary = {};\r\n this.schemaRefLibrary = {};\r\n this.templateRefLibrary = {};\r\n this.formOptions = cloneDeep(this.defaultFormOptions);\r\n this.ajvRegistry={};\r\n this.ajvRegistry['default']={name:'default',ajvInstance:this.ajv,ajvValidator:null};\r\n }\r\n\r\n /**\r\n * 'buildRemoteError' function\r\n *\r\n * Example errors:\r\n * {\r\n * last_name: [ {\r\n * message: 'Last name must by start with capital letter.',\r\n * code: 'capital_letter'\r\n * } ],\r\n * email: [ {\r\n * message: 'Email must be from example.com domain.',\r\n * code: 'special_domain'\r\n * }, {\r\n * message: 'Email must contain an @ symbol.',\r\n * code: 'at_symbol'\r\n * } ]\r\n * }\r\n * //{ErrorMessages} errors\r\n */\r\n buildRemoteError(errors: ErrorMessages) {\r\n forEach(errors, (value, key) => {\r\n if (key in this.formGroup.controls) {\r\n for (const error of value) {\r\n const err = {};\r\n err[error['code']] = error['message'];\r\n this.formGroup.get(key).setErrors(err, { emitEvent: true });\r\n }\r\n }\r\n });\r\n }\r\n\r\n validateData(newValue: any, updateSubscriptions = true,ajvInstanceName='default'): void {\r\n // Format raw form data to correct data types\r\n this.data = formatFormData(\r\n newValue,\r\n this.dataMap,\r\n this.dataRecursiveRefMap,\r\n this.arrayMap,\r\n this.formOptions.returnEmptyFields\r\n );\r\n this.isValid = this.getAjvValidator(ajvInstanceName)(this.data);\r\n this.validData = this.isValid ? this.data : null;\r\n const compileErrors = (errors:ErrorObject[]) => {\r\n const compiledErrors = {};\r\n (errors || []).forEach(error => {\r\n //TODO review-seems to be a change in newer versions\r\n //of ajv giving '' as instancePath for root objects\r\n let errorPath=error.instancePath||\"ROOT\";\r\n if (!compiledErrors[errorPath]) {\r\n compiledErrors[errorPath] = [];\r\n }\r\n compiledErrors[errorPath].push(error.message);\r\n });\r\n return compiledErrors;\r\n };\r\n //TODO:store avjErrors per ajvInstance in registry\r\n this.ajvErrors = this.getAjvValidator(ajvInstanceName).errors;\r\n this.validationErrors = compileErrors(this.ajvErrors);\r\n if (updateSubscriptions) {\r\n this.dataChanges.next(this.data);\r\n this.isValidChanges.next(this.isValid);\r\n this.validationErrorChanges.next(this.ajvErrors);\r\n }\r\n }\r\n\r\n buildFormGroupTemplate(formValues: any = null, setValues = true) {\r\n this.formGroupTemplate = buildFormGroupTemplate(\r\n this,\r\n formValues,\r\n setValues\r\n );\r\n }\r\n\r\n buildFormGroup(ajvInstanceName?:string) {\r\n this.formGroup = <UntypedFormGroup>buildFormGroup(this.formGroupTemplate);\r\n if (this.formGroup) {\r\n this.compileAjvSchema(ajvInstanceName);\r\n this.validateData(this.formGroup.getRawValue(),true,ajvInstanceName);\r\n\r\n // Set up observables to emit data and validation info when form data changes\r\n if (this.formValueSubscription) {\r\n this.formValueSubscription.unsubscribe();\r\n }\r\n this.formValueSubscription = this.formGroup.valueChanges.subscribe(\r\n formValue => this.validateData(this.formGroup.getRawValue(),true,ajvInstanceName)\r\n );\r\n }\r\n }\r\n\r\n buildLayout(widgetLibrary: any) {\r\n this.layout = buildLayout(this, widgetLibrary);\r\n }\r\n\r\n setOptions(newOptions: any) {\r\n if (isObject(newOptions)) {\r\n const addOptions = cloneDeep(newOptions);\r\n // Backward compatibility for 'defaultOptions' (renamed 'defaultWidgetOptions')\r\n if (isObject(addOptions.defaultOptions)) {\r\n Object.assign(\r\n this.formOptions.defaultWidgetOptions,\r\n addOptions.defaultOptions\r\n );\r\n delete addOptions.defaultOptions;\r\n }\r\n if (isObject(addOptions.defaultWidgetOptions)) {\r\n Object.assign(\r\n this.formOptions.defaultWidgetOptions,\r\n addOptions.defaultWidgetOptions\r\n );\r\n delete addOptions.defaultWidgetOptions;\r\n }\r\n Object.assign(this.formOptions, addOptions);\r\n\r\n // convert disableErrorState / disableSuccessState to enable...\r\n const globalDefaults = this.formOptions.defaultWidgetOptions;\r\n ['ErrorState', 'SuccessState']\r\n .filter(suffix => hasOwn(globalDefaults, 'disable' + suffix))\r\n .forEach(suffix => {\r\n globalDefaults['enable' + suffix] = !globalDefaults[\r\n 'disable' + suffix\r\n ];\r\n delete globalDefaults['disable' + suffix];\r\n });\r\n }\r\n }\r\n\r\n compileAjvSchema(ajvInstanceName='default') {\r\n let ajvValidator=this.getAjvValidator(ajvInstanceName);\r\n if (!ajvValidator) {\r\n // if 'ui:order' exists in properties, move it to root before compiling with ajv\r\n if (Array.isArray(this.schema.properties['ui:order'])) {\r\n this.schema['ui:order'] = this.schema.properties['ui:order'];\r\n delete this.schema.properties['ui:order'];\r\n }\r\n this.getAjvInstance(ajvInstanceName).removeSchema(this.schema);\r\n \r\n ajvValidator = this.getAjvInstance(ajvInstanceName).compile(this.schema);\r\n this.ajvRegistry[ajvInstanceName].ajvValidator=ajvValidator;\r\n\r\n }\r\n }\r\n\r\n buildSchemaFromData(data?: any, requireAllFields = false): any {\r\n if (data) {\r\n return buildSchemaFromData(data, requireAllFields);\r\n }\r\n this.schema = buildSchemaFromData(this.formValues, requireAllFields);\r\n }\r\n\r\n buildSchemaFromLayout(layout?: any): any {\r\n if (layout) {\r\n return buildSchemaFromLayout(layout);\r\n }\r\n this.schema = buildSchemaFromLayout(this.layout);\r\n }\r\n\r\n setTpldata(newTpldata: any = {}): void {\r\n this.tpldata = newTpldata;\r\n }\r\n\r\n parseText(\r\n text = '',\r\n value: any = {},\r\n values: any = {},\r\n key: number | string = null\r\n ): string {\r\n if (!text || !/{{.+?}}/.test(text)) {\r\n return text;\r\n }\r\n return text.replace(/{{(.+?)}}/g, (...a) =>\r\n this.parseExpression(a[1], value, values, key, this.tpldata)\r\n );\r\n }\r\n\r\n parseExpression(\r\n expression = '',\r\n value: any = {},\r\n values: any = {},\r\n key: number | string = null,\r\n tpldata: any = null\r\n ) {\r\n if (typeof expression !== 'string') {\r\n return '';\r\n }\r\n const index = typeof key === 'number' ? key + 1 + '' : key || '';\r\n expression = expression.trim();\r\n if (\r\n (expression[0] === \"'\" || expression[0] === '\"') &&\r\n expression[0] === expression[expression.length - 1] &&\r\n expression.slice(1, expression.length - 1).indexOf(expression[0]) === -1\r\n ) {\r\n return expression.slice(1, expression.length - 1);\r\n }\r\n if (expression === 'idx' || expression === '$index') {\r\n return index;\r\n }\r\n if (expression === 'value' && !hasOwn(values, 'value')) {\r\n return value;\r\n }\r\n if (\r\n ['\"', \"'\", ' ', '||', '&&', '+'].every(\r\n delim => expression.indexOf(delim) === -1\r\n )\r\n ) {\r\n const pointer = JsonPointer.parseObjectPath(expression);\r\n return pointer[0] === 'value' && JsonPointer.has(value, pointer.slice(1))\r\n ? JsonPointer.get(value, pointer.slice(1))\r\n : pointer[0] === 'values' && JsonPointer.has(values, pointer.slice(1))\r\n ? JsonPointer.get(values, pointer.slice(1))\r\n : pointer[0] === 'tpldata' && JsonPointer.has(tpldata, pointer.slice(1))\r\n ? JsonPointer.get(tpldata, pointer.slice(1))\r\n : JsonPointer.has(values, pointer)\r\n ? JsonPointer.get(values, pointer)\r\n : '';\r\n }\r\n if (expression.indexOf('[idx]') > -1) {\r\n expression = expression.replace(/\\[idx\\]/g, <string>index);\r\n }\r\n if (expression.indexOf('[$index]') > -1) {\r\n expression = expression.replace(/\\[$index\\]/g, <string>index);\r\n }\r\n // TODO: Improve expression evaluation by parsing quoted strings first\r\n // let expressionArray = expression.match(/([^\"']+|\"[^\"]+\"|'[^']+')/g);\r\n if (expression.indexOf('||') > -1) {\r\n return expression\r\n .split('||')\r\n .reduce(\r\n (all, term) =>\r\n all || this.parseExpression(term, value, values, key, tpldata),\r\n ''\r\n );\r\n }\r\n if (expression.indexOf('&&') > -1) {\r\n return expression\r\n .split('&&')\r\n .reduce(\r\n (all, term) =>\r\n all && this.parseExpression(term, value, values, key, tpldata),\r\n ' '\r\n )\r\n .trim();\r\n }\r\n if (expression.indexOf('+') > -1) {\r\n return expression\r\n .split('+')\r\n .map(term => this.parseExpression(term, value, values, key, tpldata))\r\n .join('');\r\n }\r\n return '';\r\n }\r\n\r\n //TODO fix- if template has value in title\r\n // \"items\": {\r\n // \"title\": \"{{ 'Input ' + $index+value }}\",\r\n // \"type\": \"string\"\r\n // }\r\n // result on button will be \"Add Input [object Object]\"\r\n setArrayItemTitle(\r\n parentCtx: any = {},\r\n childNode: any = null,\r\n index: number = null\r\n ): string {\r\n //for legacy compatibility, parentCtx.layoutNode could either be a value\r\n //or have been converted to use Signals\r\n let parentCtxAsSignals:any={\r\n layoutNode:()=>{\r\n if(isObject(parentCtx.layoutNode)){\r\n return parentCtx.layoutNode\r\n }\r\n return parentCtx.layoutNode();\r\n },\r\n dataIndex:()=>{\r\n if(isObject(parentCtx.dataIndex)){\r\n return parentCtx.dataIndex\r\n }\r\n return parentCtx.dataIndex();\r\n }\r\n }\r\n const parentNode = parentCtxAsSignals.layoutNode();\r\n const parentValues: any = this.getFormControlValue(parentCtxAsSignals);\r\n const isArrayItem =\r\n (parentNode.type || '').slice(-5) === 'array' && isArray(parentValues);\r\n const text = JsonPointer.getFirst(\r\n isArrayItem && childNode.type !== '$ref'\r\n ? [\r\n [childNode, '/options/legend'],\r\n [childNode, '/options/title'],\r\n [parentNode, '/options/title'],\r\n [parentNode, '/options/legend']\r\n ]\r\n : [\r\n [childNode, '/options/title'],\r\n [childNode, '/options/legend'],\r\n [parentNode, '/options/title'],\r\n [parentNode, '/options/legend']\r\n ]\r\n );\r\n if (!text) {\r\n return text;\r\n }\r\n const childValue =\r\n isArray(parentValues) && index < parentValues.length\r\n ? parentValues[index]\r\n : parentValues;\r\n return this.parseText(text, childValue, parentValues, index);\r\n }\r\n\r\n setItemTitle(ctx: WidgetContext) {\r\n return !ctx.options.title && /^(\\d+|-)$/.test(ctx.layoutNode().name)\r\n ? null\r\n : this.parseText(\r\n ctx.options.title || toTitleCase(ctx.layoutNode().name),\r\n this.getFormControlValue(ctx),\r\n (this.getFormControlGroup(ctx) || <any>{}).value,\r\n ctx.dataIndex()[ctx.dataIndex().length - 1]\r\n );\r\n }\r\n\r\n evaluateCondition(layoutNode: any, dataIndex: number[]): boolean {\r\n const arrayIndex = dataIndex && dataIndex[dataIndex.length - 1];\r\n let result = true;\r\n if (hasValue((layoutNode.options || {}).condition)) {\r\n if (typeof layoutNode.options.condition === 'string') {\r\n let pointer = layoutNode.options.condition;\r\n if (hasValue(arrayIndex)) {\r\n pointer = pointer.replace('[arrayIndex]', `[${arrayIndex}]`);\r\n }\r\n pointer = JsonPointer.parseObjectPath(pointer);\r\n result = !!JsonPointer.get(this.data, pointer);\r\n if (!result && pointer[0] === 'model') {\r\n result = !!JsonPointer.get({ model: this.data }, pointer);\r\n }\r\n } else if (typeof layoutNode.options.condition === 'function') {\r\n result = layoutNode.options.condition(this.data);\r\n } else if (\r\n typeof layoutNode.options.condition.functionBody === 'string'\r\n ) {\r\n try {\r\n const dynFn = new Function(\r\n 'model',\r\n 'arrayIndices',\r\n layoutNode.options.condition.functionBody\r\n );\r\n result = dynFn(this.data, dataIndex);\r\n } catch (e) {\r\n result = true;\r\n console.error(\r\n 'condition functionBody errored out on evaluation: ' +\r\n layoutNode.options.condition.functionBody\r\n );\r\n }\r\n }\r\n }\r\n return result;\r\n }\r\n\r\n initializeControl(ctx: WidgetContext, bind = true): boolean {\r\n if (!isObject(ctx)) {\r\n return false;\r\n }\r\n const layoutNode=ctx.layoutNode();\r\n if (isEmpty(ctx.options)) {\r\n ctx.options = !isEmpty((layoutNode || {}).options)\r\n ? layoutNode.options\r\n : cloneDeep(this.formOptions);\r\n }\r\n ctx.formControl = this.getFormControl(ctx);\r\n //introduced to check if the node is part of ITE conditional\r\n //then change or add the control\r\n if(layoutNode?.schemaPointer && layoutNode.isITEItem || \r\n (layoutNode?.schemaPointer && layoutNode?.oneOfPointer) ||\r\n layoutNode?.schemaPointer && layoutNode.anyOfPointer ){\r\n //before changing control, need to set the new data type for data formatting\r\n const schemaType=this.dataMap.get(layoutNode?.dataPointer).get(\"schemaType\");\r\n if(schemaType!=layoutNode.dataType){\r\n this.dataMap.get(layoutNode?.dataPointer).set(\"schemaType\",layoutNode.dataType)\r\n }\r\n this.setFormControl(ctx,ctx.formControl);\r\n }\r\n ctx.boundControl = bind && !!ctx.formControl;\r\n if (ctx.formControl) {\r\n ctx.controlName = this.getFormControlName(ctx);\r\n ctx.controlValue = ctx.formControl.value;\r\n ctx.controlDisabled = ctx.formControl.disabled;\r\n ctx.options.errorMessage =\r\n ctx.formControl.status === 'VALID'\r\n ? null\r\n : this.formatErrors(\r\n ctx.formControl.errors,\r\n ctx.options.validationMessages\r\n );\r\n ctx.options.showErrors =\r\n this.formOptions.validateOnRender === true ||\r\n (this.formOptions.validateOnRender === 'auto' &&\r\n hasValue(ctx.controlValue));\r\n this.fcStatusChangesSubs=ctx.formControl.statusChanges.subscribe(\r\n status =>\r\n (ctx.options.errorMessage =\r\n status === 'VALID'\r\n ? null\r\n : this.formatErrors(\r\n ctx.formControl.errors,\r\n ctx.options.validationMessages\r\n ))\r\n );\r\n this.fcValueChangesSubs=ctx.formControl.valueChanges.subscribe(value => {\r\n if (!_isEqual(ctx.controlValue, value)) { \r\n ctx.controlValue = value \r\n }\r\n\r\n });\r\n } else {\r\n ctx.controlName = layoutNode.name;\r\n ctx.controlValue = layoutNode.value || null;\r\n const dataPointer = this.getDataPointer(ctx);\r\n if (bind && dataPointer) {\r\n console.error(\r\n `warning: control \"${dataPointer}\" is not bound to the Angular FormGroup.`\r\n );\r\n }\r\n }\r\n //if this is a ITE conditional field, the value would not have been\r\n //set, as the control would only be initialized when the condition is true \r\n //TODO-review need to decide which of the data sets between data,formValues and default \r\n //to use for the value\r\n //TODO try maybe marking descendants in applyITEConditions\r\n let isITEDescendant=layoutNode?.schemaPointer?.split(\"/\")\r\n .some(elt=>[\"then\",\"else\"].includes(elt));\r\n if(ctx.options?.condition || layoutNode?.oneOfPointer || layoutNode?.anyOfPointer || isITEDescendant){\r\n const dataPointer = this.getDataPointer(ctx);\r\n const controlValue=ctx.formControl?.value;\r\n const dataValue=JsonPointer.has(this.data,dataPointer)?\r\n JsonPointer.get(this.data,dataPointer):undefined;\r\n const formValue=JsonPointer.has(this.formValues,dataPointer)?\r\n JsonPointer.get(this.formValues,dataPointer):undefined;\r\n const schemaDefault=ctx.options?.default;\r\n //if initial formValues was supplied and controlValue matches formValue then likely\r\n //control was initially created with the formValue then set value to data value\r\n \r\n //if no formValues was supplied and controlValue matches schemaDefault then likely\r\n //control was initially created with the default then set value to data value\r\n const value=this.formValues && isEqual(formValue,controlValue)?dataValue\r\n :!this.formValues && isEqual(schemaDefault,controlValue)?dataValue\r\n :schemaDefault;\r\n ctx.formControl?.patchValue(value)\r\n }\r\n return ctx.boundControl;\r\n }\r\n\r\n formatErrors(errors: any, validationMessages: any = {}): string {\r\n if (isEmpty(errors)) {\r\n return null;\r\n }\r\n if (!isObject(validationMessages)) {\r\n validationMessages = {};\r\n }\r\n const addSpaces = string =>\r\n string[0].toUpperCase() +\r\n (string.slice(1) || '')\r\n .replace(/([a-z])([A-Z])/g, '$1 $2')\r\n .replace(/_/g, ' ');\r\n const formatError = error =>\r\n typeof error === 'object'\r\n ? Object.keys(error)\r\n .map(key =>\r\n error[key] === true\r\n ? addSpaces(key)\r\n : error[key] === false\r\n ? 'Not ' + addSpaces(key)\r\n : addSpaces(key) + ': ' + formatError(error[key])\r\n )\r\n .join(', ')\r\n : addSpaces(error.toString());\r\n const messages = [];\r\n return (\r\n Object.keys(errors)\r\n // Hide 'required' error, unless it is the only one\r\n .filter(\r\n errorKey =>\r\n errorKey !== 'required' || Object.keys(errors).length === 1\r\n )\r\n .map(errorKey =>\r\n // If validationMessages is a string, return it\r\n typeof validationMessages === 'string'\r\n ? validationMessages\r\n : // If custom error message is a function, return function result\r\n typeof validationMessages[errorKey] === 'function'\r\n ? validationMessages[errorKey](errors[errorKey])\r\n : // If custom error message is a string, replace placeholders and return\r\n typeof validationMessages[errorKey] === 'string'\r\n ? // Does error message have any {{property}} placeholders?\r\n !/{{.+?}}/.test(validationMessages[errorKey])\r\n ? validationMessages[errorKey]\r\n : // Replace {{property}} placeholders with values\r\n Object.keys(errors[errorKey]).reduce(\r\n (errorMessage, errorProperty) =>\r\n errorMessage.replace(\r\n new RegExp('{{' + errorProperty + '}}', 'g'),\r\n errors[errorKey][errorProperty]\r\n ),\r\n validationMessages[errorKey]\r\n )\r\n : // If no custom error message, return formatted error data instead\r\n addSpaces(errorKey) + ' Error: ' + formatError(errors[errorKey])\r\n )\r\n .join('<br>')\r\n );\r\n }\r\n\r\n updateValue(ctx: WidgetContext, value: any): void {\r\n // Set value of current control\r\n ctx.controlValue = value;\r\n if (ctx.boundControl) {\r\n ctx.formControl.setValue(value);\r\n ctx.formControl.markAsDirty();\r\n }\r\n ctx.layoutNode().value = value;\r\n\r\n // Set values of any related controls in copyValueTo array\r\n if (isArray(ctx.options.copyValueTo)) {\r\n for (const item of ctx.options.copyValueTo) {\r\n const targetControl = this.formGroup && getControl(this.formGroup, item);\r\n if (\r\n isObject(targetControl) &&\r\n typeof targetControl.setValue === 'function'\r\n ) {\r\n targetControl.setValue(value);\r\n targetControl.markAsDirty();\r\n }\r\n }\r\n }\r\n }\r\n\r\n updateArrayCheckboxList(ctx: WidgetContext, checkboxList: TitleMapItem[]): void {\r\n const formArray = <UntypedFormArray>this.getFormControl(ctx);\r\n\r\n // Remove all existing items\r\n while (formArray.value.length) {\r\n formArray.removeAt(0);\r\n }\r\n\r\n // Re-add an item for each checked box\r\n const refPointer = removeRecursiveReferences(\r\n ctx.layoutNode().dataPointer + '/-',\r\n this.dataRecursiveRefMap,\r\n this.arrayMap\r\n );\r\n for (const checkboxItem of checkboxList) {\r\n if (checkboxItem.checked) {\r\n const newFormControl = buildFormGroup(\r\n this.templateRefLibrary[refPointer]\r\n );\r\n newFormControl.setValue(checkboxItem.value);\r\n formArray.push(newFormControl);\r\n }\r\n }\r\n formArray.markAsDirty();\r\n }\r\n\r\n updateArrayMultiSelectList(ctx: WidgetContext, selectList: TitleMapItem[]): void {\r\n this.updateArrayCheckboxList(ctx,selectList);\r\n /* const formArray = <UntypedFormArray>this.getFormControl(ctx);\r\n\r\n // Remove all existing items\r\n while (formArray.value.length) {\r\n formArray.removeAt(0);\r\n }\r\n\r\n // Re-add an item for each checked box\r\n const refPointer = removeRecursiveReferences(\r\n ctx.layoutNode().dataPointer + '/-',\r\n this.dataRecursiveRefMap,\r\n this.arrayMap\r\n );\r\n for (const selectItem of selectList) {\r\n if (selectItem.value) {\r\n const newFormControl = buildFormGroup(\r\n this.templateRefLibrary[refPointer]\r\n );\r\n newFormControl.setValue(selectItem.value);\r\n formArray.push(newFormControl);\r\n }\r\n }\r\n formArray.markAsDirty();\r\n */\r\n }\r\n getFormControl(ctx: WidgetContext): AbstractControl {\r\n if (\r\n !ctx || !ctx.layoutNode ||\r\n !isDefined(ctx.layoutNode().dataPointer) ||\r\n ctx.layoutNode().type === '$ref'\r\n ) {\r\n return null;\r\n }\r\n const schemaPointer=ctx.layoutNode()?.isITEItem?ctx.layoutNode()?.schemaPointer:null;\r\n const oneOfPointer=ctx.layoutNode()?.oneOfPointer;\r\n const anyOfPointer=ctx.layoutNode()?.anyOfPointer;\r\n return getControl(this.formGroup, this.getDataPointer(ctx),false,schemaPointer||oneOfPointer||anyOfPointer);\r\n }\r\n\r\n setFormControl(ctx: WidgetContext,control:AbstractControl): AbstractControl {\r\n if (\r\n !ctx || !ctx.layoutNode ||\r\n !isDefined(ctx.layoutNode().dataPointer) ||\r\n ctx.layoutNode().type === '$ref'\r\n ) {\r\n return null;\r\n }\r\n return setControl(this.formGroup, this.getDataPointer(ctx),control);\r\n }\r\n\r\n getFormControlValue(ctx: WidgetContext): AbstractControl {\r\n\r\n if (!ctx || !ctx.layoutNode || \r\n !isDefined(ctx.layoutNode().dataPointer) ||\r\n ctx.layoutNode().type === '$ref'\r\n ||this.formGroup==null\r\n ) {\r\n return null;\r\n }\r\n const schemaPointer=ctx.layoutNode()?.isITEItem?ctx.layoutNode()?.schemaPointer:null;\r\n const oneOfPointer=ctx.layoutNode()?.oneOfPointer;\r\n const anyOfPointer=ctx.layoutNode()?.anyOfPointer;\r\n const control = getControl(this.formGroup, this.getDataPointer(ctx),false,schemaPointer||oneOfPointer||anyOfPointer);\r\n return control ? control.value : null;\r\n }\r\n\r\n getFormControlGroup(ctx: WidgetContext): UntypedFormArray | UntypedFormGroup {\r\n if (!ctx || !ctx.layoutNode || !isDefined(ctx.layoutNode().dataPointer) ||this.formGroup==null) {\r\n return null;\r\n }\r\n const schemaPointer=ctx.layoutNode()?.isITEItem?ctx.layoutNode()?.schemaPointer:null;\r\n const oneOfPointer=ctx.layoutNode()?.oneOfPointer;\r\n const anyOfPointer=ctx.layoutNode()?.anyOfPointer;\r\n return getControl(this.formGroup, this.getDataPointer(ctx), true,schemaPointer||oneOfPointer||anyOfPointer);\r\n }\r\n\r\n getFormControlName(ctx: WidgetContext): string {\r\n if (\r\n !ctx || !ctx.layoutNode ||\r\n !isDefined(ctx.layoutNode().dataPointer) ||\r\n !hasValue(ctx.dataIndex())\r\n ) {\r\n return null;\r\n }\r\n return JsonPointer.toKey(this.getDataPointer(ctx));\r\n }\r\n\r\n getLayoutArray(ctx: WidgetContext): any[] {\r\n return JsonPointer.get(this.layout, this.getLayoutPointer(ctx), 0, -1);\r\n }\r\n\r\n getParentNode(ctx: WidgetContext): any {\r\n return JsonPointer.get(this.layout, this.getLayoutPointer(ctx), 0, -2);\r\n }\r\n\r\n getDataPointer(ctx: WidgetContext): string {\r\n if (\r\n !ctx || !ctx.layoutNode ||\r\n !isDefined(ctx.layoutNode().dataPointer) ||\r\n !hasValue(ctx.dataIndex())\r\n ) {\r\n return null;\r\n }\r\n return JsonPointer.toIndexedPointer(\r\n ctx.layoutNode().dataPointer,\r\n ctx.dataIndex(),\r\n this.arrayMap\r\n );\r\n }\r\n\r\n getLayoutPointer(ctx: WidgetContext): string {\r\n if (!hasValue(ctx.layoutIndex())) {\r\n return null;\r\n }\r\n return '/' + ctx.layoutIndex().join('/items/');\r\n }\r\n\r\n isControlBound(ctx: WidgetContext): boolean {\r\n if (\r\n !ctx || !ctx.layoutNode ||\r\n !isDefined(ctx.layoutNode().dataPointer) ||\r\n !hasValue(ctx.dataIndex())\r\n ) {\r\n return false;\r\n }\r\n const controlGroup = this.getFormControlGroup(ctx);\r\n const name = this.getFormControlName(ctx);\r\n return controlGroup ? hasOwn(controlGroup.controls, name) : false;\r\n }\r\n\r\n addItem(ctx: WidgetContext, name?: string): boolean {\r\n if (\r\n !ctx || !ctx.layoutNode ||\r\n !isDefined(ctx.layoutNode().$ref) ||\r\n !hasValue(ctx.dataIndex()) ||\r\n !hasValue(ctx.layoutIndex())\r\n ) {\r\n return false;\r\n }\r\n\r\n // Create a new Angular form control from a template in templateRefLibrary\r\n const newFormGroup = buildFormGroup(\r\n this.templateRefLibrary[ctx.layoutNode().$ref]\r\n );\r\n\r\n // Add the new form control to the parent formArray or formGroup\r\n if (ctx.layoutNode().arrayItem) {\r\n // Add new array item to formArray\r\n (<UntypedFormArray>this.getFormControlGroup(ctx)).push(newFormGroup);\r\n } else {\r\n // Add new $ref item to formGroup\r\n (<UntypedFormGroup>this.getFormControlGroup(ctx)).addControl(\r\n name || this.getFormControlName(ctx),\r\n newFormGroup\r\n );\r\n }\r\n\r\n // Copy a new layoutNode from layoutRefLibrary\r\n const newLayoutNode = getLayoutNode(ctx.layoutNode(), this);\r\n newLayoutNode.arrayItem = ctx.layoutNode().arrayItem;\r\n if (ctx.layoutNode().arrayItemType) {\r\n newLayoutNode.arrayItemType = ctx.layoutNode().arrayItemType;\r\n } else {\r\n delete newLayoutNode.arrayItemType;\r\n }\r\n if (name) {\r\n newLayoutNode.name = name;\r\n newLayoutNode.dataPointer += '/' + JsonPointer.escape(name);\r\n newLayoutNode.options.title = fixTitle(name);\r\n }\r\n\r\n // Add the new layoutNode to the form layout\r\n JsonPointer.insert(this.layout, this.getLayoutPointer(ctx), newLayoutNode);\r\n\r\n return true;\r\n }\r\n\r\n moveArrayItem(ctx: WidgetContext, oldIndex: number, newIndex: number,moveLayout:boolean=true): boolean {\r\n if (\r\n !ctx || !ctx.layoutNode ||\r\n !isDefined(ctx.layoutNode().dataPointer) ||\r\n !hasValue(ctx.dataIndex()) ||\r\n !hasValue(ctx.layoutIndex()) ||\r\n !isDefined(oldIndex) ||\r\n !isDefined(newIndex) ||\r\n oldIndex === newIndex\r\n ) {\r\n return false;\r\n }\r\n\r\n // Move item in the formArray\r\n const formArray = <UntypedFormArray>this.getFormControlGroup(ctx);\r\n if(oldIndex >=formArray.length){\r\n return false;\r\n }\r\n const arrayItem = formArray.at(oldIndex);\r\n formArray.removeAt(oldIndex);\r\n formArray.insert(newIndex, arrayItem);\r\n formArray.updateValueAndValidity();\r\n\r\n // Move layout item\r\n if(moveLayout){\r\n const layoutArray = this.getLayoutArray(ctx);\r\n layoutArray.splice(newIndex, 0, layoutArray.splice(oldIndex, 1)[0]);\r\n }\r\n\r\n return true;\r\n }\r\n\r\n removeItem(ctx: WidgetContext): boolean {\r\n if (\r\n !ctx || !ctx.layoutNode ||\r\n !isDefined(ctx.layoutNode().dataPointer) ||\r\n !hasValue(ctx.dataIndex()) ||\r\n !hasValue(ctx.layoutIndex())\r\n ) {\r\n return false;\r\n }\r\n\r\n // Remove the Angular form control from the parent formArray or formGroup\r\n if (ctx.layoutNode().arrayItem) {\r\n // Remove array item from formArray\r\n (<UntypedFormArray>this.getFormControlGroup(ctx)).removeAt(\r\n ctx.dataIndex()[ctx.dataIndex().length - 1]\r\n );\r\n } else {\r\n // Remove $ref item from formGroup\r\n (<UntypedFormGroup>this.getFormControlGroup(ctx)).removeControl(\r\n this.getFormControlName(ctx)\r\n );\r\n }\r\n\r\n // Remove layoutNode from layout\r\n JsonPointer.remove(this.layout, this.getLayoutPointer(ctx));\r\n return true;\r\n }\r\n\r\n //TODO fix-doesnt seem to work for nested array\r\n adjustLayout(layout:any, newData: any,currLayoutIndex=[0],currDataIndex=[]) {\r\n const createWidgetCtx=(layoutNode:any,layoutIndex:any,dataIndex:any):any=>{\r\n return {\r\n layoutNode: ()=>{return layoutNode},\r\n layoutIndex: ()=>{return layoutIndex},\r\n dataIndex: ()=>{return dataIndex},\r\n }\r\n }\r\n // console.log(`adjustLayout currLayoutIndex:${currLayoutIndex}`);\r\n if(layout.items && _isArray(newData)){\r\n let ctx=createWidgetCtx(\r\n {//add a ref node to be that of first items datapointer\r\n\r\n ...layout,\r\n $ref:layout.$ref||layout.items[0]?.dataPointer,\r\n dataPointer:layout.items[0]?.dataPointer,\r\n arrayItem: true,\r\n arrayItemType: \"list\"\r\n \r\n }\r\n ,[...currLayoutIndex.slice(0, currLayoutIndex.length - 1),layout.items.length-1]\r\n ,[...currDataIndex.slice(0, currDataIndex.length - 1),layout.items.length-1]);\r\n const lengthDifference = newData.length - layout.items.filter(litem=>{\r\n return litem?.type!=\"$ref\"\r\n }).length;\r\n if (lengthDifference > 0) {\r\n // Add missing controls if newData has more items\r\n for (let i = 0; i < lengthDifference; i++) {\r\n this.addItem(ctx)\r\n }\r\n } else if (lengthDifference < 0) {\r\n let numToRemove=layout.items.filter(litem=>{\r\n return litem?.type!=\"$ref\"\r\n })\r\n .length-newData.length;\r\n // Remove extra controls if newData has fewer items\r\n for (let i = 0; i< numToRemove; i++) {\r\n \r\n let oldDataIndex=ctx.dataIndex();\r\n let lastDataIndex=oldDataIndex[oldDataIndex.length-1];\r\n let updatedLayoutIndex=[...currLayoutIndex.slice(0, currLayoutIndex.length - 1),0]\r\n let updatedDataIndex=[...oldDataIndex.slice(0, oldDataIndex.length - 1),0];\r\n ctx=createWidgetCtx(ctx.layoutNode(),updatedLayoutIndex,updatedDataIndex)\r\n let removed=this.removeItem(ctx);\r\n // if(removed){\r\n\r\n //}\r\n\r\n }\r\n }\r\n return \r\n }\r\n if(_isArray(layout) ){\r\n layout.forEach((layoutNode,ind)=>{\r\n //if(layoutNode.items){\r\n let layoutMappedData=layoutNode.dataPointer?JsonPointer.get(newData,layoutNode.dataPointer)\r\n :undefined;\r\n this.adjustLayout(layoutNode,layoutMappedData,[...currLayoutIndex,ind],[...currDataIndex,ind]);\r\n ///}\r\n })\r\n }\r\n\r\n }\r\n\r\n \r\n}\r\n","import { Component, ComponentRef, OnChanges, OnInit, SimpleChanges, ViewContainerRef, inject, input, viewChild } from '@angular/core';\r\n\r\nimport { JsonSchemaFormService } from '../json-schema-form.service';\r\n\r\n@Component({\r\n // tslint:disable-next-line:component-selector\r\n selector: 'select-widget-widget',\r\n template: `<div #widgetContainer></div>`,\r\n standalone: false\r\n})\r\nexport class SelectWidgetComponent implements OnChanges, OnInit {\r\n\r\n private jsf = inject(JsonSchemaFormService);\r\n\r\n newComponent: ComponentRef<any> = null;\r\n readonly layoutNode = input<any>(undefined);\r\n readonly layoutIndex = input<number[]>(undefined);\r\n readonly dataIndex = input<number[]>(undefined);\r\n readonly widgetContainer = viewChild('widgetContainer', { read: ViewContainerRef });\r\n\r\n ngOnInit() {\r\n this.updateComponent();\r\n }\r\n\r\n ngOnChanges(changes:SimpleChanges) {\r\n this.updateComponent();\r\n }\r\n\r\n updateComponent() {\r\n const widgetContainer = this.widgetContainer();\r\n if (widgetContainer && !this.newComponent && (this.layoutNode() || {}).widget) {\r\n this.newComponent = widgetContainer.createComponent((this.layoutNode().widget)\r\n );\r\n }\r\n if (this.newComponent) {\r\n for (const inp of ['layoutNode', 'layoutIndex', 'dataIndex']) {\r\n //this.newComponent.instance[inp] = this[inp];\r\n this.newComponent.setInput(inp,this[inp]());\r\n }\r\n }\r\n }\r\n}\r\n","import { Component, input } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'no-framework',\r\n templateUrl: './no-framework.component.html',\r\n standalone: false\r\n})\r\nexport class NoFrameworkComponent {\r\n readonly layoutNode = input<any>(undefined);\r\n readonly layoutIndex = input<number[]>(undefined);\r\n readonly dataIndex = input<number[]>(undefined);\r\n}\r\n","<select-widget-widget [dataIndex]=\"dataIndex()\" [layoutIndex]=\"layoutIndex()\" [layoutNode]=\"layoutNode()\">\r\n</select-widget-widget>","import { Injectable } from '@angular/core';\r\nimport { Framework } from './framework';\r\nimport { NoFrameworkComponent } from './no-framework.component';\r\n// No framework - plain HTML controls (styles from form layout only)\r\n\r\n@Injectable()\r\nexport class NoFramework extends Framework {\r\n name = 'no-framework';\r\n text ='None (plain HTML)';\r\n framework = NoFrameworkComponent;\r\n}\r\n","import { Directive, ElementRef, Input, Renderer2, SimpleChanges } from '@angular/core';\r\n\r\n@Directive({\r\n selector: '[attributes]',\r\n standalone: false\r\n})\r\nexport class ElementAttributeDirective {\r\n\r\n \r\n @Input()\r\n public attributes: { [key: string]: any; };\r\n\r\n constructor(\r\n private renderer: Renderer2,\r\n private elementRef: ElementRef\r\n ) { }\r\n\r\n public ngOnChanges(changes: SimpleChanges): void {\r\n if (changes.attributes) {\r\n for (let attributeName in this.attributes) {\r\n const attributeValue = this.attributes[attributeName];\r\n if (attributeValue) {\r\n this.renderer.setAttribute(this.elementRef.nativeElement, attributeName, attributeValue);\r\n } else {\r\n this.renderer.removeAttribute(this.elementRef.nativeElement, attributeName);\r\n }\r\n }\r\n }\r\n }\r\n\r\n}\r\n","import { Directive, ElementRef, Input, OnDestroy, OnInit, Renderer2 } from '@angular/core';\r\n\r\n@Directive({\r\n selector: '[appStopPropagation]', standalone:false\r\n})\r\n\r\n//TODO review:stopPropagation used as a workaround \r\n//to prevent dragging onMouseDown and onTouchStart events\r\nexport class StopPropagationDirective implements OnInit, OnDestroy {\r\n // The input property to receive an array of event names\r\n @Input('appStopPropagation') events: string[] = [];\r\n\r\n // An array to hold the unsubscribe functions for each event listener\r\n private unsubscribeFunctions: Function[] = [];\r\n\r\n constructor(private el: ElementRef, private renderer: Renderer2) {}\r\n\r\n ngOnInit() {\r\n // If the input array is empty, default to 'mousedown'\r\n const eventsToListen = this.events.length > 0 ? this.events : ['mousedown'];\r\n\r\n // Loop through the array of event names and set up a listener for each\r\n eventsToListen.forEach(eventName => {\r\n const unsub = this.renderer.listen(this.el.nativeElement, eventName, (event) => {\r\n event.stopPropagation();\r\n });\r\n // Store the unsubscribe function to be called on destruction\r\n this.unsubscribeFunctions.push(unsub);\r\n });\r\n }\r\n\r\n ngOnDestroy() {\r\n // Call each stored unsubscribe function to clean up listeners\r\n this.unsubscribeFunctions.forEach(unsub => unsub());\r\n }\r\n}\r\n","import { ChangeDetectionStrategy, Component, OnInit, inject, input } from '@angular/core';\r\nimport { JsonSchemaFormService } from '../json-schema-form.service';\r\n\r\n\r\n@Component({\r\n // tslint:disable-next-line:component-selector\r\n selector: 'add-reference-widget',\r\n template: `\r\n <section [class]=\"options?.htmlClass || ''\" align=\"end\">\r\n <button *ngIf=\"showAddButton\"\r\n [class]=\"options?.fieldHtmlClass || ''\"\r\n [disabled]=\"options?.readonly\"\r\n (click)=\"addItem($event)\"\r\n [appStopPropagation]=\"['mousedown', 'touchstart']\"\r\n >\r\n <span *ngIf=\"options?.icon\" [class]=\"options?.icon\"></span>\r\n <span *ngIf=\"options?.title\" [innerHTML]=\"buttonText\"></span>\r\n \r\n </button>\r\n </section>`,\r\n changeDetection: ChangeDetectionStrategy.Default,\r\n standalone: false\r\n})\r\nexport class AddReferenceComponent implements OnInit {\r\n private jsf = inject(JsonSchemaFormService);\r\n\r\n options: any;\r\n itemCount: number;\r\n previousLayoutIndex: number[];\r\n previousDataIndex: number[];\r\n readonly layoutNode = input<any>(undefined);\r\n readonly layoutIndex = input<number[]>(undefined);\r\n readonly dataIndex = input<number[]>(undefined);\r\n\r\n\r\n ngOnInit() {\r\n this.options = this.layoutNode().options || {};\r\n }\r\n\r\n get showAddButton(): boolean {\r\n return !this.layoutNode().arrayItem ||\r\n this.layoutIndex()[this.layoutIndex().length - 1] < this.options.maxItems;\r\n }\r\n\r\n addItem(event) {\r\n event.preventDefault();\r\n this.jsf.addItem(this);\r\n }\r\n\r\n get buttonText(): string {\r\n const parent: any = {\r\n dataIndex: this.dataIndex().slice(0, -1),\r\n layoutIndex: this.layoutIndex().slice(0, -1),\r\n layoutNode: this.jsf.getParentNode(this)\r\n };\r\n return parent.layoutNode && (parent.layoutNode.add ||\r\n this.jsf.setArrayItemTitle(parent, this.layoutNode(), this.itemCount));\r\n }\r\n}\r\n","import { Component, inject, input, OnDestroy, OnInit } from '@angular/core';\r\nimport { AbstractControl } from '@angular/forms';\r\nimport { JsonSchemaFormService } from '../json-schema-form.service';\r\n\r\n\r\n@Component({\r\n // tslint:disable-next-line:component-selector\r\n selector: 'button-widget',\r\n template: `\r\n <div\r\n [class]=\"options?.htmlClass || ''\">\r\n <button\r\n [attr.readonly]=\"options?.readonly ? 'readonly' : null\"\r\n [attr.aria-describedby]=\"'control' + layoutNode()?._id + 'Status'\"\r\n [class]=\"options?.fieldHtmlClass || ''\"\r\n [disabled]=\"controlDisabled\"\r\n [name]=\"controlName\"\r\n [type]=\"layoutNode()?.type\"\r\n [value]=\"controlValue\"\r\n (click)=\"updateValue($event)\"\r\n [appStopPropagation]=\"['mousedown', 'touchstart']\"\r\n >\r\n <span *ngIf=\"options?.icon || options?.title\"\r\n [class]=\"options?.icon\"\r\n [innerHTML]=\"options?.title\"></span>\r\n </button>\r\n </div>`,\r\n standalone: false\r\n})\r\nexport class ButtonComponent implements OnInit,OnDestroy {\r\n private jsf = inject(JsonSchemaFormService);\r\n\r\n formControl: AbstractControl;\r\n controlName: string;\r\n controlValue: any;\r\n controlDisabled = false;\r\n boundControl = false;\r\n options: any;\r\n readonly layoutNode = input<any>(undefined);\r\n readonly layoutIndex = input<number[]>(undefined);\r\n readonly dataIndex = input<number[]>(undefined);\r\n\r\n ngOnInit() {\r\n this.options = this.layoutNode().options || {};\r\n this.jsf.initializeControl(this);\r\n }\r\n\r\n updateValue(event) {\r\n if (typeof this.options.onClick === 'function') {\r\n this.options.onClick(event);\r\n } else {\r\n this.jsf.updateValue(this, event.target.value);\r\n }\r\n }\r\n\r\n ngOnDestroy () {\r\n this.jsf.updateValue(this, null);\r\n }\r\n}\r\n","import { Component, inject, input, OnDestroy, OnInit } from '@angular/core';\r\nimport { AbstractControl } from '@angular/forms';\r\nimport { JsonSchemaFormService } from '../json-schema-form.service';\r\n\r\n///NB issue caused by sortablejs when it its destroyed\r\n//this mainly affects checkboxes coupled with conditions\r\n//-the value is rechecked\r\n//-see https://github.com/SortableJS/Sortable/issues/1052#issuecomment-369613072\r\n//-switched to angular cdk for dnd\r\n@Component({\r\n // tslint:disable-next-line:component-selector\r\n selector: 'checkbox-widget',\r\n template: `\r\n <label\r\n [attr.for]=\"'control' + layoutNode()?._id\"\r\n [class]=\"options?.itemLabelHtmlClass || ''\">\r\n <input *ngIf=\"boundControl\"\r\n [formControl]=\"formControl\"\r\n [attr.aria-describedby]=\"'control' + layoutNode()?._id + 'Status'\"\r\n [class]=\"(options?.fieldHtmlClass || '') + (isChecked ?\r\n (' ' + (options?.activeClass || '') + ' ' + (options?.style?.selected || '')) :\r\n (' ' + (options?.style?.unselected || '')))\"\r\n [id]=\"'control' + layoutNode()?._id\"\r\n [name]=\"controlName\"\r\n [readonly]=\"options?.readonly ? 'readonly' : null\"\r\n type=\"checkbox\">\r\n <input *ngIf=\"!boundControl\"\r\n [attr.aria-describedby]=\"'control' + layoutNode()?._id + 'Status'\"\r\n [checked]=\"isChecked\"\r\n [class]=\"(options?.fieldHtmlClass || '') + (isChecked ?\r\n (' ' + (options?.activeClass || '') + ' ' + (options?.style?.selected || '')) :\r\n (' ' + (options?.style?.unselected || '')))\"\r\n [disabled]=\"controlDisabled\"\r\n [id]=\"'control' + layoutNode()?._id\"\r\n [name]=\"controlName\"\r\n [readonly]=\"options?.readonly ? 'readonly' : null\"\r\n [value]=\"controlValue\"\r\n type=\"checkbox\"\r\n (change)=\"updateValue($event)\">\r\n <span *ngIf=\"options?.title\"\r\n [style.display]=\"options?.notitle ? 'none' : ''\"\r\n [innerHTML]=\"options?.title\"></span>\r\n </label>`,\r\n standalone: false\r\n})\r\nexport class CheckboxComponent implements OnInit,OnDestroy {\r\n private jsf = inject(JsonSchemaFormService);\r\n\r\n formControl: AbstractControl;\r\n controlName: string;\r\n controlValue: any;\r\n controlDisabled = false;\r\n boundControl = false;\r\n options: any;\r\n trueValue: any = true;\r\n falseValue: any = false;\r\n readonly layoutNode = input<any>(undefined);\r\n readonly layoutIndex = input<number[]>(undefined);\r\n readonly dataIndex = input<number[]>(undefined);\r\n\r\n ngOnInit() {\r\n this.options = this.layoutNode().options || {};\r\n this.jsf.initializeControl(this);\r\n if (this.controlValue === null || this.controlValue === undefined) {\r\n this.controlValue = false;\r\n this.jsf.updateValue(this, this.falseValue);\r\n }\r\n }\r\n\r\n updateValue(event) {\r\n event.preventDefault();\r\n this.jsf.updateValue(this, event.target.checked ? this.trueValue : this.falseValue);\r\n }\r\n\r\n get isChecked() {\r\n return this.jsf.getFormControlValue(this) === this.trueValue;\r\n }\r\n\r\n ngOnDestroy () {\r\n this.jsf.updateValue(this, null);\r\n }\r\n\r\n}\r\n","import { Component, inject, input, OnDestroy, OnInit } from '@angular/core';\r\nimport { AbstractControl } from '@angular/forms';\r\nimport { JsonSchemaFormService, TitleMapItem } from '../json-schema-form.service';\r\nimport { buildTitleMap } from '../shared';\r\n\r\n\r\n@Component({\r\n // tslint:disable-next-line:component-selector\r\n selector: 'checkboxes-widget',\r\n template: `\r\n <label *ngIf=\"options?.title\"\r\n [class]=\"options?.labelHtmlClass || ''\"\r\n [style.display]=\"options?.notitle ? 'none' : ''\"\r\n [innerHTML]=\"options?.title\"></label>\r\n\r\n <!-- 'horizontal' = checkboxes-inline or checkboxbuttons -->\r\n <div *ngIf=\"layoutOrientation === 'horizontal'\" [class]=\"options?.htmlClass || ''\">\r\n <label *ngFor=\"let checkboxItem of checkboxList\"\r\n [attr.for]=\"'control' + layoutNode()?._id + '/' + checkboxItem.value\"\r\n [class]=\"(options?.itemLabelHtmlClass || '') + (checkboxItem.checked ?\r\n (' ' + (options?.activeClass || '') + ' ' + (options?.style?.selected || '')) :\r\n (' ' + (options?.style?.unselected || '')))\">\r\n <input type=\"checkbox\"\r\n [attr.required]=\"options?.required\"\r\n [checked]=\"checkboxItem.checked\"\r\n [class]=\"options?.fieldHtmlClass || ''\"\r\n [disabled]=\"controlDisabled\"\r\n [id]=\"'control' + layoutNode()?._id + '/' + checkboxItem.value\"\r\n [name]=\"checkboxItem?.name\"\r\n [readonly]=\"options?.readonly ? 'readonly' : null\"\r\n [value]=\"checkboxItem.value\"\r\n (change)=\"updateValue($event)\">\r\n <span [innerHTML]=\"checkboxItem.name\"></span>\r\n </label>\r\n </div>\r\n\r\n <!-- 'vertical' = regular checkboxes -->\r\n <div *ngIf=\"layoutOrientation === 'vertical'\">\r\n <div *ngFor=\"let checkboxItem of checkboxList\" [class]=\"options?.htmlClass || ''\">\r\n <label\r\n [attr.for]=\"'control' + layoutNode()?._id + '/' + checkboxItem.value\"\r\n [class]=\"(options?.itemLabelHtmlClass || '') + (checkboxItem.checked ?\r\n (' ' + (options?.activeClass || '') + ' ' + (options?.style?.selected || '')) :\r\n (' ' + (options?.style?.unselected || '')))\">\r\n <input type=\"checkbox\"\r\n [attr.required]=\"options?.required\"\r\n [checked]=\"checkboxItem.checked\"\r\n [class]=\"options?.fieldHtmlClass || ''\"\r\n [disabled]=\"controlDisabled\"\r\n [id]=\"options?.name + '/' + checkboxItem.value\"\r\n [name]=\"checkboxItem?.name\"\r\n [readonly]=\"options?.readonly ? 'readonly' : null\"\r\n [value]=\"checkboxItem.value\"\r\n (change)=\"updateValue($event)\">\r\n <span [innerHTML]=\"checkboxItem?.name\"></span>\r\n </label>\r\n </div>\r\n </div>`,\r\n standalone: false\r\n})\r\nexport class CheckboxesComponent implements OnInit,OnDestroy {\r\n private jsf = inject(JsonSchemaFormService);\r\n\r\n formControl: AbstractControl;\r\n controlName: string;\r\n controlValue: any;\r\n controlDisabled = false;\r\n boundControl = false;\r\n options: any;\r\n layoutOrientation: string;\r\n formArray: AbstractControl;\r\n checkboxList: TitleMapItem[] = [];\r\n readonly layoutNode = input<any>(undefined);\r\n readonly layoutIndex = input<number[]>(undefined);\r\n readonly dataIndex = input<number[]>(undefined);\r\n\r\n ngOnInit() {\r\n this.options = this.layoutNode().options || {};\r\n const layoutNode = this.layoutNode();\r\n this.layoutOrientation = (layoutNode.type === 'checkboxes-inline' ||\r\n layoutNode.type === 'checkboxbuttons') ? 'horizontal' : 'vertical';\r\n this.jsf.initializeControl(this);\r\n this.checkboxList = buildTitleMap(\r\n this.options.titleMap || this.options.enumNames, this.options.enum, true\r\n );\r\n if (this.boundControl) {\r\n const formArray = this.jsf.getFormControl(this);\r\n this.checkboxList.forEach(checkboxItem =>\r\n checkboxItem.checked = formArray.value.includes(checkboxItem.value)\r\n );\r\n }\r\n }\r\n\r\n updateValue(event) {\r\n for (const checkboxItem of this.checkboxList) {\r\n if (event.target.value === checkboxItem.value) {\r\n checkboxItem.checked = event.target.checked;\r\n }\r\n }\r\n if (this.boundControl) {\r\n this.jsf.updateArrayCheckboxList(this, this.checkboxList);\r\n }\r\n }\r\n\r\n //TODO review this\r\n ngOnDestroy () {\r\n //this.jsf.updateValue(this, null);\r\n let nullVal=[];\r\n this.formControl.reset(nullVal)\r\n this.controlValue=null;\r\n }\r\n\r\n}\r\n","import { Component, inject, input, OnDestroy, OnInit } from '@angular/core';\r\nimport { AbstractControl } from '@angular/forms';\r\nimport { JsonSchemaFormService } from '../json-schema-form.service';\r\n\r\n\r\n// TODO: Add this control\r\n\r\n@Component({\r\n // tslint:disable-next-line:component-selector\r\n selector: 'file-widget',\r\n template: ``,\r\n standalone: false\r\n})\r\nexport class FileComponent implements OnInit,OnDestroy {\r\n private jsf = inject(JsonSchemaFormService);\r\n\r\n formControl: AbstractControl;\r\n controlName: string;\r\n controlValue: any;\r\n controlDisabled = false;\r\n boundControl = false;\r\n options: any;\r\n readonly layoutNode = input<any>(undefined);\r\n readonly layoutIndex = input<number[]>(undefined);\r\n readonly dataIndex = input<number[]>(undefined);\r\n\r\n ngOnInit() {\r\n this.options = this.layoutNode().options || {};\r\n this.jsf.initializeControl(this);\r\n }\r\n\r\n updateValue(event) {\r\n this.jsf.updateValue(this, event.target.value);\r\n }\r\n\r\n ngOnDestroy () {\r\n this.jsf.updateValue(this, null);\r\n }\r\n}\r\n","import { Component, inject, input, OnDestroy, OnInit } from '@angular/core';\r\nimport { AbstractControl } from '@angular/forms';\r\nimport { JsonSchemaFormService } from '../json-schema-form.service';\r\n\r\n\r\n@Component({\r\n // tslint:disable-next-line:component-selector\r\n selector: 'hidden-widget',\r\n template: `\r\n <input *ngIf=\"boundControl\"\r\n [formControl]=\"formControl\"\r\n [id]=\"'control' + layoutNode()?._id\"\r\n [name]=\"controlName\"\r\n type=\"hidden\">\r\n <input *ngIf=\"!boundControl\"\r\n [disabled]=\"controlDisabled\"\r\n [name]=\"controlName\"\r\n [id]=\"'control' + layoutNode()?._id\"\r\n type=\"hidden\"\r\n [value]=\"controlValue\">`,\r\n standalone: false\r\n})\r\nexport class HiddenComponent implements OnInit,OnDestroy {\r\n private jsf = inject(JsonSchemaFormService);\r\n\r\n formControl: AbstractControl;\r\n controlName: string;\r\n controlValue: any;\r\n controlDisabled = false;\r\n boundControl = false;\r\n readonly layoutNode = input<any>(undefined);\r\n readonly layoutIndex = input<number[]>(undefined);\r\n readonly dataIndex = input<number[]>(undefined);\r\n\r\n ngOnInit() {\r\n this.jsf.initializeControl(this);\r\n }\r\n\r\n ngOnDestroy () {\r\n this.jsf.updateValue(this, null);\r\n }\r\n\r\n}\r\n","import { Component, OnDestroy, OnInit, inject, input } from '@angular/core';\r\nimport { AbstractControl } from '@angular/forms';\r\nimport { JsonSchemaFormService } from '../json-schema-form.service';\r\n\r\n\r\n@Component({\r\n // tslint:disable-next-line:component-selector\r\n selector: 'input-widget',\r\n template: `\r\n <div [class]=\"options?.htmlClass || ''\" >\r\n <label *ngIf=\"options?.title\"\r\n [attr.for]=\"'control' + layoutNode()?._id\"\r\n [class]=\"options?.labelHtmlClass || ''\"\r\n [style.display]=\"options?.notitle ? 'none' : ''\"\r\n [innerHTML]=\"options?.title\"></label>\r\n <input *ngIf=\"boundControl\"\r\n [formControl]=\"formControl\"\r\n [attr.aria-describedby]=\"'control' + layoutNode()?._id + 'Status'\"\r\n [attr.list]=\"'control' + layoutNode()?._id + 'Autocomplete'\"\r\n [attr.maxlength]=\"options?.maxLength\"\r\n [attr.minlength]=\"options?.minLength\"\r\n [attr.pattern]=\"options?.pattern\"\r\n [attr.placeholder]=\"options?.placeholder\"\r\n [attr.required]=\"options?.required\"\r\n [class]=\"options?.fieldHtmlClass || ''\"\r\n [id]=\"'control' + layoutNode()?._id\"\r\n [name]=\"controlName\"\r\n [readonly]=\"options?.readonly ? 'readonly' : null\"\r\n [type]=\"layoutNode()?.type\"\r\n [attributes]=\"inputAttributes\"\r\n [appStopPropagation]=\"['mousedown', 'touchstart']\"\r\n >\r\n <input *ngIf=\"!boundControl\"\r\n [attr.aria-describedby]=\"'control' + layoutNode()?._id + 'Status'\"\r\n [attr.list]=\"'control' + layoutNode()?._id + 'Autocomplete'\"\r\n [attr.maxlength]=\"options?.maxLength\"\r\n [attr.minlength]=\"options?.minLength\"\r\n [attr.pattern]=\"options?.pattern\"\r\n [attr.placeholder]=\"options?.placeholder\"\r\n [attr.required]=\"options?.required\"\r\n [class]=\"options?.fieldHtmlClass || ''\"\r\n [disabled]=\"controlDisabled\"\r\n [id]=\"'control' + layoutNode()?._id\"\r\n [name]=\"controlName\"\r\n [readonly]=\"options?.readonly ? 'readonly' : null\"\r\n [type]=\"layoutNode()?.type\"\r\n [value]=\"controlValue\"\r\n (input)=\"updateValue($event)\"\r\n [attributes]=\"inputAttributes\"\r\n [appStopPropagation]=\"['mousedown', 'touchstart']\"\r\n >\r\n <datalist *ngIf=\"options?.typeahead?.source\"\r\n [id]=\"'control' + layoutNode()?._id + 'Autocomplete'\">\r\n <option *ngFor=\"let word of options?.typeahead?.source\" [value]=\"word\">\r\n </datalist>\r\n </div>`,\r\n standalone: false\r\n})\r\nexport class InputComponent implements OnInit, OnDestroy {\r\n private jsf = inject(JsonSchemaFormService);\r\n\r\n formControl: AbstractControl;\r\n controlName: string;\r\n controlValue: string;\r\n controlDisabled = false;\r\n boundControl = false;\r\n options: any;\r\n autoCompleteList: string[] = [];\r\n readonly layoutNode = input<any>(undefined);\r\n readonly layoutIndex = input<number[]>(undefined);\r\n readonly dataIndex = input<number[]>(undefined);\r\n\r\n //needed as templates don't accept something like [attributes]=\"options?.['x-inputAttributes']\"\r\n get inputAttributes() {\r\n return this.options?.['x-inputAttributes'];\r\n }\r\n\r\n ngOnInit() {\r\n this.options = this.layoutNode().options || {};\r\n this.jsf.initializeControl(this);\r\n }\r\n\r\n updateValue(event) {\r\n this.jsf.updateValue(this, event.target.value);\r\n }\r\n\r\n ngOnDestroy () {\r\n //needed to be done in timeout for when dynamic/condition based\r\n //titles depend on the formControls value but the formControl\r\n //is also destroyed\r\n setTimeout(()=>{\r\n this.jsf.updateValue(this, null);\r\n })\r\n }\r\n\r\n}\r\n","// item-title.component.ts\r\nimport { Component, Input, OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core';\r\nimport { Subscription } from 'rxjs';\r\nimport { JsonSchemaFormService } from '../json-schema-form.service';\r\n\r\n@Component({\r\n selector: 'item-title',\r\n template: `<div>{{ title }}</div>`,\r\n standalone:false\r\n // Consider using ChangeDetectionStrategy.OnPush here for maximum efficiency\r\n\r\n})\r\nexport class ItemTitleComponent implements OnInit, OnChanges,OnDestroy {\r\n @Input() item: any;\r\n @Input() index: number;\r\n @Input() ctx: any;\r\n\r\n title: string;\r\n dataChangesSubs:Subscription;\r\n constructor(private jsf: JsonSchemaFormService) {\r\n\r\n }\r\n ngOnChanges(changes: SimpleChanges): void {\r\n this.updateTitle();\r\n }\r\n ngOnInit() {\r\n // Calculate the title once on init, or subscribe to changes here\r\n this.updateTitle();\r\n this.dataChangesSubs=this.jsf.dataChanges.subscribe((val)=>{\r\n this.updateTitle();\r\n \r\n })\r\n }\r\n\r\n updateTitle() {\r\n this.title = this.jsf.setArrayItemTitle(this.ctx, this.item, this.index);\r\n }\r\n ngOnDestroy(): void {\r\n this.dataChangesSubs?.unsubscribe();\r\n }\r\n}\r\n","import { Component, OnInit, input, inject } from '@angular/core';\r\nimport { JsonSchemaFormService } from '../json-schema-form.service';\r\n\r\n\r\n@Component({\r\n // tslint:disable-next-line:component-selector\r\n selector: 'message-widget',\r\n template: `\r\n <span *ngIf=\"message\"\r\n [class]=\"options?.labelHtmlClass || ''\"\r\n [innerHTML]=\"message\"></span>`,\r\n standalone: false\r\n})\r\nexport class MessageComponent implements OnInit {\r\n private jsf = inject(JsonSchemaFormService);\r\n\r\n options: any;\r\n message: string = null;\r\n readonly layoutNode = input<any>(undefined);\r\n readonly layoutIndex = input<number[]>(undefined);\r\n readonly dataIndex = input<number[]>(undefined);\r\n\r\n ngOnInit() {\r\n this.options = this.layoutNode().options || {};\r\n this.message = this.options.help || this.options.helpvalue ||\r\n this.options.msg || this.options.message;\r\n }\r\n}\r\n","import { Component, input } from '@angular/core';\r\n\r\n@Component({\r\n // tslint:disable-next-line:component-selector\r\n selector: 'none-widget',\r\n template: ``,\r\n standalone: false\r\n})\r\nexport class NoneComponent {\r\n readonly layoutNode = input<any>(undefined);\r\n readonly layoutIndex = input<number[]>(undefined);\r\n readonly dataIndex = input<number[]>(undefined);\r\n}\r\n","import { Component, ElementRef, OnDestroy, OnInit, ViewChild, inject, input } from '@angular/core';\r\nimport { AbstractControl } from '@angular/forms';\r\n\r\nimport { JsonSchemaFormService } from '../json-schema-form.service';\r\n\r\n@Component({\r\n // tslint:disable-next-line:component-selector\r\n selector: 'number-widget',\r\n template: `\r\n <div #divElt [class]=\"options?.htmlClass || ''\" >\r\n <label *ngIf=\"options?.title\"\r\n [attr.for]=\"'control' + layoutNode()?._id\"\r\n [class]=\"options?.labelHtmlClass || ''\"\r\n [style.display]=\"options?.notitle ? 'none' : ''\"\r\n [innerHTML]=\"options?.title\"></label>\r\n <input #inputControl *ngIf=\"boundControl\"\r\n [formControl]=\"formControl\"\r\n [attr.aria-describedby]=\"'control' + layoutNode()?._id + 'Status'\"\r\n [attr.max]=\"options?.maximum\"\r\n [attr.min]=\"options?.minimum\"\r\n [attr.placeholder]=\"options?.placeholder\"\r\n [attr.required]=\"options?.required\"\r\n [attr.readonly]=\"options?.readonly ? 'readonly' : null\"\r\n [attr.step]=\"options?.multipleOf || options?.step || 'any'\"\r\n [class]=\"options?.fieldHtmlClass || ''\"\r\n [id]=\"'control' + layoutNode()?._id\"\r\n [name]=\"controlName\"\r\n [readonly]=\"options?.readonly ? 'readonly' : null\"\r\n [title]=\"lastValidNumber\"\r\n [type]=\"layoutNode()?.type === 'range' ? 'range' : 'number'\"\r\n [attributes]=\"inputAttributes\"\r\n [appStopPropagation]=\"['mousedown', 'touchstart']\"\r\n >\r\n <input #inputControl *ngIf=\"!boundControl\"\r\n [attr.aria-describedby]=\"'control' + layoutNode()?._id + 'Status'\"\r\n [attr.max]=\"options?.maximum\"\r\n [attr.min]=\"options?.minimum\"\r\n [attr.placeholder]=\"options?.placeholder\"\r\n [attr.required]=\"options?.required\"\r\n [attr.readonly]=\"options?.readonly ? 'readonly' : null\"\r\n [attr.step]=\"options?.multipleOf || options?.step || 'any'\"\r\n [class]=\"options?.fieldHtmlClass || ''\"\r\n [disabled]=\"controlDisabled\"\r\n [id]=\"'control' + layoutNode()?._id\"\r\n [name]=\"controlName\"\r\n [readonly]=\"options?.readonly ? 'readonly' : null\"\r\n [title]=\"lastValidNumber\"\r\n [type]=\"layoutNode()?.type === 'range' ? 'range' : 'number'\"\r\n [value]=\"controlValue\"\r\n (input)=\"updateValue($event)\"\r\n [attributes]=\"inputAttributes\"\r\n [appStopPropagation]=\"['mousedown', 'touchstart']\"\r\n >\r\n <span *ngIf=\"layoutNode()?.type === 'range'\" [innerHTML]=\"controlValue\"></span>\r\n </div>`,\r\n standalone: false\r\n})\r\n//TODO look at reusing InputComponent\r\nexport class NumberComponent implements OnInit,OnDestroy {\r\n private jsf = inject(JsonSchemaFormService);\r\n\r\n formControl: AbstractControl;\r\n controlName: string;\r\n controlValue: any;\r\n controlDisabled = false;\r\n boundControl = false;\r\n options: any;\r\n allowNegative = true;\r\n allowDecimal = true;\r\n allowExponents = false;\r\n lastValidNumber = '';\r\n readonly layoutNode = input<any>(undefined);\r\n readonly layoutIndex = input<number[]>(undefined);\r\n readonly dataIndex = input<number[]>(undefined);\r\n\r\n //needed as templates don't accept something like [attributes]=\"options?.['x-inputAttributes']\"\r\n get inputAttributes() {\r\n return this.options?.['x-inputAttributes'];\r\n }\r\n @ViewChild('inputControl', {})\r\n inputControl: ElementRef;\r\n\r\n @ViewChild('divElt', {})\r\n div: ElementRef;\r\n\r\n ngOnInit() {\r\n this.options = this.layoutNode().options || {};\r\n this.jsf.initializeControl(this);\r\n if (this.layoutNode().dataType === 'integer') { this.allowDecimal = false; }\r\n }\r\n\r\n updateValue(event) {\r\n this.jsf.updateValue(this, event.target.value);\r\n }\r\n\r\n ngOnDestroy () {\r\n //see cpmments in input component\r\n setTimeout(()=>{\r\n this.jsf.updateValue(this, null);\r\n })\r\n }\r\n \r\n}\r\n","import { ChangeDetectorRef, Component, ComponentRef, OnChanges, OnInit, ViewContainerRef, inject, input, viewChild } from '@angular/core';\r\n\r\nimport { JsonSchemaFormService } from '../json-schema-form.service';\r\n\r\n@Component({\r\n // tslint:disable-next-line:component-selector\r\n selector: 'select-framework-widget',\r\n template: `<div #widgetContainer></div>`,\r\n standalone: false\r\n})\r\nexport class SelectFrameworkComponent implements OnChanges, OnInit {\r\n private jsf = inject(JsonSchemaFormService);\r\n private changeDetectorRef = inject(ChangeDetectorRef);\r\n newComponent: ComponentRef<any> = null;\r\n readonly layoutNode = input<any>(undefined);\r\n readonly layoutIndex = input<number[]>(undefined);\r\n readonly dataIndex = input<number[]>(undefined);\r\n readonly widgetContainer = viewChild('widgetContainer', { read: ViewContainerRef });\r\n\r\n ngOnInit() {\r\n this.updateComponent();\r\n }\r\n\r\n ngOnChanges(changes) {\r\n this.updateComponent();\r\n }\r\n\r\n updateComponent() {\r\n const widgetContainer = this.widgetContainer();\r\n if (widgetContainer && !this.newComponent && this.jsf.framework) {\r\n this.newComponent = widgetContainer.createComponent((this.jsf.framework)\r\n );\r\n //TODO fix all deprecated calls and test \r\n //this.widgetContainer.createComponent<any>(this.jsf.framework)\r\n }\r\n if (this.newComponent) {\r\n for (const inp of ['layoutNode', 'layoutIndex', 'dataIndex']) {\r\n //this.newComponent.instance[inp] = this[inp];\r\n this.newComponent.setInput(inp,this[inp]());\r\n }\r\n // Manually trigger change detection after updating inputs\r\n //this.changeDetectorRef.detectChanges();\r\n }\r\n }\r\n}\r\n","import { ChangeDetectorRef, Component, OnDestroy, OnInit, inject, input, signal } from '@angular/core';\r\nimport { Subscription } from 'rxjs';\r\nimport { JsonSchemaFormService } from '../json-schema-form.service';\r\n\r\n\r\n@Component({\r\n // tslint:disable-next-line:component-selector\r\n selector: 'tabs-widget',\r\n template: `\r\n <ul\r\n [class]=\"options?.labelHtmlClass || ''\">\r\n <li *ngFor=\"let item of layoutNode()?.items; let i = index\"\r\n [class]=\"(options?.itemLabelHtmlClass || '') + (selectedItem === i ?\r\n (' ' + (options?.activeClass || '') + ' ' + (options?.style?.selected || '')) :\r\n (' ' + options?.style?.unselected))\"\r\n role=\"presentation\"\r\n data-tabs>\r\n <a *ngIf=\"showAddTab || item.type !== '$ref'\"\r\n [class]=\"'nav-link' + (selectedItem === i ? (' ' + options?.activeClass + ' ' + options?.style?.selected) :\r\n (' ' + options?.style?.unselected))\"\r\n (click)=\"select(i)\">\r\n <input type=\"radio\" [value]=\"i\" *ngIf=\"options?.tabMode=='oneOfMode'\" \r\n name=\"tabSelection\" \r\n [(ngModel)]=\"selectedItem\"\r\n [class]=\"(options?.widget_radioClass || '')\"\r\n [value]=\"i\" \r\n (change)=\"select(i)\"\r\n />\r\n {{setTabTitle(item, i)}}\r\n </a>\r\n \r\n </li>\r\n </ul>\r\n\r\n <div *ngFor=\"let layoutItem of layoutNode()?.items; let i = index\"\r\n [class]=\"(options?.htmlClass || '') + (selectedItem != i?' ngf-hidden':'') \">\r\n <!--for now the only difference between oneOfMode and the default \r\n is that oneOfMode uses the *ngIf=\"selectedItem === i\" clause, which automatically\r\n destroys the tabs that are not rendered while default mode only hide them\r\n the upshot is that only the active tabs value will be used\r\n -->\r\n <ng-container *ngIf=\"options?.tabMode=='oneOfMode'\">\r\n <select-framework-widget *ngIf=\"selectedItem === i\"\r\n [class]=\"(options?.fieldHtmlClass || '') +\r\n ' ' + (options?.activeClass || '') +\r\n ' ' + (options?.style?.selected || '')\"\r\n [dataIndex]=\"layoutNode()?.dataType === 'array' ? (dataIndex() || []).concat(i) : dataIndex()\"\r\n [layoutIndex]=\"(layoutIndex() || []).concat(i)\"\r\n [layoutNode]=\"layoutItem\"></select-framework-widget>\r\n </ng-container> \r\n <ng-container *ngIf=\"options?.tabMode !='oneOfMode'\">\r\n <select-framework-widget \r\n [class]=\"(options?.fieldHtmlClass || '') +\r\n ' ' + (options?.activeClass || '') +\r\n ' ' + (options?.style?.selected || '')\"\r\n [dataIndex]=\"layoutNode()?.dataType === 'array' ? (dataIndex() || []).concat(i) : dataIndex()\"\r\n [layoutIndex]=\"(layoutIndex() || []).concat(i)\"\r\n [layoutNode]=\"layoutItem\"></select-framework-widget>\r\n </ng-container> \r\n </div>`,\r\n styles: [` a { cursor: pointer; } \r\n .ngf-hidden{display:none}\r\n `],\r\n standalone: false\r\n})\r\nexport class TabsComponent implements OnInit,OnDestroy {\r\n private jsf = inject(JsonSchemaFormService);\r\n private cdr = inject(ChangeDetectorRef);\r\n options: any;\r\n itemCount: number;\r\n selectedItem = 0;\r\n showAddTab = true;\r\n readonly layoutNode = input<any>(undefined);\r\n readonly layoutIndex = input<number[]>(undefined);\r\n readonly dataIndex = input<number[]>(undefined);\r\n dataChangesSubs:Subscription;\r\n ngOnInit() {\r\n this.options = this.layoutNode().options || {};\r\n if(this.options.selectedTab){\r\n this.selectedItem = this.options.selectedTab;\r\n }\r\n this.itemCount = this.layoutNode().items.length - 1;\r\n this.updateControl();\r\n //TODO review/test-introduced to fix dynamic titles not updating\r\n //when their conditional linked field is destroyed\r\n //-forces change detection!\r\n //-commented out, causing other issues\r\n this.dataChangesSubs=this.jsf.dataChanges.subscribe((val)=>{\r\n //this.cdr.detectChanges();\r\n })\r\n }\r\n\r\n select(index) {\r\n const layoutNode = this.layoutNode();\r\n if (layoutNode.items[index].type === '$ref') {\r\n this.itemCount = layoutNode.items.length;\r\n this.jsf.addItem({\r\n layoutNode: signal(layoutNode.items[index]),\r\n layoutIndex: signal(this.layoutIndex().concat(index)),\r\n dataIndex: signal(this.dataIndex().concat(index))\r\n });\r\n this.updateControl();\r\n }\r\n this.selectedItem = index;\r\n }\r\n\r\n updateControl() {\r\n const lastItem = this.layoutNode().items[this.layoutNode().items.length - 1];\r\n if (lastItem.type === '$ref' &&\r\n this.itemCount >= (lastItem.options.maxItems || 1000)\r\n ) {\r\n this.showAddTab = false;\r\n }\r\n }\r\n\r\n setTabTitle(item: any, index: number): string {\r\n return this.jsf.setArrayItemTitle(this, item, index);\r\n }\r\n\r\n ngOnDestroy(): void {\r\n this.dataChangesSubs?.unsubscribe();\r\n }\r\n}\r\n","import { Component, inject, input, OnDestroy, OnInit } from '@angular/core';\r\nimport { AbstractControl } from '@angular/forms';\r\n\r\nimport { isEqual, isObject, pick } from 'lodash';\r\nimport { JsonSchemaFormService } from '../json-schema-form.service';\r\nimport { hasNonNullValue, hasOwn, JsonPointer, path2ControlKey } from '../shared';\r\n\r\n// TODO: Add this control\r\n\r\n@Component({\r\n // tslint:disable-next-line:component-selector\r\n selector: 'one-of-widget',\r\n template: `<h4>{{this.options?.description}}</h4>\r\n <tabs-widget #tabs [layoutNode]=\"layoutNode()\" \r\n [layoutIndex]=\"layoutIndex()\" \r\n [dataIndex]=\"dataIndex()\" >\r\n </tabs-widget>`,\r\n standalone: false\r\n})\r\nexport class OneOfComponent implements OnInit,OnDestroy {\r\n private jsf = inject(JsonSchemaFormService);\r\n\r\n formControl: AbstractControl;\r\n controlName: string;\r\n controlValue: any;\r\n controlDisabled = false;\r\n boundControl = false;\r\n options: any;\r\n readonly layoutNode = input<any>(undefined);\r\n readonly layoutIndex = input<number[]>(undefined);\r\n readonly dataIndex = input<number[]>(undefined);\r\n\r\n ngOnInit() {\r\n this.options = this.layoutNode().options || {};\r\n this.options.tabMode=\"oneOfMode\";\r\n this.options.selectedTab=this.findSelectedTab();\r\n //this.options.description=this.options.description||\"choose one of\";\r\n this.jsf.initializeControl(this);\r\n }\r\n\r\n findSelectedTab(){\r\n //TODO test- this.jsf.formValues seems to be the initial data supplied to the form\r\n //while the jsf.formGroup value is derived from the actual controls\r\n //let formValue=this.jsf.getFormControlValue(this);\r\n let foundInd=-1;\r\n //seach for non null value\r\n if(this.layoutNode().items){\r\n this.layoutNode().items.forEach((layoutItem,ind)=>{\r\n let formValue=JsonPointer.get(this.jsf.formValues,layoutItem.dataPointer);\r\n if(layoutItem.oneOfPointer){\r\n let controlKey=path2ControlKey(layoutItem.oneOfPointer);\r\n let fname=layoutItem.name;\r\n if(hasOwn(this.jsf.formGroup.controls,controlKey)&&\r\n (formValue || hasNonNullValue(this.jsf.formGroup.controls[controlKey].value))\r\n //hasOwn(formValue,fname) && hasOwn(this.jsf.formGroup.controls,controlKey) \r\n // && (formValue[fname] || this.jsf.formGroup.controls[controlKey].value)\r\n //&&isEqual(formValue[fname],this.jsf.formGroup.controls[controlKey].value)\r\n ){\r\n foundInd=ind;\r\n }\r\n //foundInd=formValue[controlKey]!=null?ind:foundInd;\r\n //if no exact match found, then search in descendant values\r\n //to see which one of item matches\r\n if(foundInd==-1){\r\n //find all descendant oneof paths\r\n let descendantOneOfControlNames=Object.keys(this.jsf.formGroup.controls).filter(controlName=>{\r\n return controlName.startsWith(controlKey);\r\n })\r\n descendantOneOfControlNames.forEach(controlName=>{\r\n let parts=controlName.split('$');\r\n let fieldName=parts[parts.length-1];\r\n let controlValue=this.jsf.formGroup.controls[controlName].value;\r\n let controlSchema=JsonPointer.get(this.jsf.schema,parts.join(\"/\"));\r\n let schemaPointer=parts.join(\"/\");\r\n let dPointer=schemaPointer.replace(/(anyOf|allOf|oneOf|none)\\/[\\d]+\\//g, '')\r\n .replace(/(if|then|else|properties)\\//g, '').replace(/\\/items\\//g,'/-/');\r\n //JsonPointer.toDataPointer(parts.join(\"/\"),this.jsf.schema);\r\n let dVal=JsonPointer.get(this.jsf.formValues,dPointer);\r\n let compareVal=dVal;//formValue;\r\n //compare only values that are in the subschema properties\r\n if(controlSchema && controlSchema.properties){\r\n compareVal=isObject(dVal) && hasOwn(dVal,fieldName)?\r\n pick(dVal[fieldName],Object.keys(controlSchema.properties))\r\n :pick(dVal,Object.keys(controlSchema.properties))\r\n }\r\n /*\r\n if(isObject(compareVal) && hasOwn(compareVal,fieldName) && \r\n isEqual(compareVal[fieldName],controlValue)\r\n ){\r\n foundInd=ind;\r\n }else //if(formValue || controlValue){\r\n if(isEqual(compareVal,controlValue)){\r\n foundInd=ind;\r\n }\r\n */\r\n if(isEqual(compareVal,controlValue)){\r\n foundInd=ind;\r\n }\r\n })\r\n //now need to compare values\r\n }\r\n }\r\n })\r\n }\r\n return Math.max(foundInd,0);\r\n }\r\n\r\n updateValue(event) {\r\n this.jsf.updateValue(this, event.target.value);\r\n }\r\n\r\n ngOnDestroy () {\r\n //this.jsf.updateValue(this, null);\r\n }\r\n}\r\n","import { Component, inject, input, OnDestroy, OnInit } from '@angular/core';\r\nimport { AbstractControl } from '@angular/forms';\r\nimport { JsonSchemaFormService } from '../json-schema-form.service';\r\nimport { buildTitleMap } from '../shared';\r\n\r\n\r\n@Component({\r\n // tslint:disable-next-line:component-selector\r\n selector: 'radios-widget',\r\n template: `\r\n <label *ngIf=\"options?.title\"\r\n [attr.for]=\"'control' + layoutNode()?._id\"\r\n [class]=\"options?.labelHtmlClass || ''\"\r\n [style.display]=\"options?.notitle ? 'none' : ''\"\r\n [innerHTML]=\"options?.title\"></label>\r\n\r\n <!-- 'horizontal' = radios-inline or radiobuttons -->\r\n <div *ngIf=\"layoutOrientation === 'horizontal'\"\r\n [class]=\"options?.htmlClass || ''\">\r\n <label *ngFor=\"let radioItem of radiosList\"\r\n [attr.for]=\"'control' + layoutNode()?._id + '/' + radioItem?.value\"\r\n [class]=\"(options?.itemLabelHtmlClass || '') +\r\n ((controlValue + '' === radioItem?.value + '') ?\r\n (' ' + (options?.activeClass || '') + ' ' + (options?.style?.selected || '')) :\r\n (' ' + (options?.style?.unselected || '')))\">\r\n <input type=\"radio\"\r\n [attr.aria-describedby]=\"'control' + layoutNode()?._id + 'Status'\"\r\n [attr.readonly]=\"options?.readonly ? 'readonly' : null\"\r\n [attr.required]=\"options?.required\"\r\n [checked]=\"radioItem?.value === controlValue\"\r\n [class]=\"options?.fieldHtmlClass || ''\"\r\n [disabled]=\"controlDisabled\"\r\n [id]=\"'control' + layoutNode()?._id + '/' + radioItem?.value\"\r\n [name]=\"controlName\"\r\n [value]=\"radioItem?.value\"\r\n (change)=\"updateValue($event)\">\r\n <span [innerHTML]=\"radioItem?.name\"></span>\r\n </label>\r\n </div>\r\n\r\n <!-- 'vertical' = regular radios -->\r\n <div *ngIf=\"layoutOrientation !== 'horizontal'\">\r\n <div *ngFor=\"let radioItem of radiosList\"\r\n [class]=\"options?.htmlClass || ''\">\r\n <label\r\n [attr.for]=\"'control' + layoutNode()?._id + '/' + radioItem?.value\"\r\n [class]=\"(options?.itemLabelHtmlClass || '') +\r\n ((controlValue + '' === radioItem?.value + '') ?\r\n (' ' + (options?.activeClass || '') + ' ' + (options?.style?.selected || '')) :\r\n (' ' + (options?.style?.unselected || '')))\">\r\n <input type=\"radio\"\r\n [attr.aria-describedby]=\"'control' + layoutNode()?._id + 'Status'\"\r\n [attr.readonly]=\"options?.readonly ? 'readonly' : null\"\r\n [attr.required]=\"options?.required\"\r\n [checked]=\"radioItem?.value === controlValue\"\r\n [class]=\"options?.fieldHtmlClass || ''\"\r\n [disabled]=\"controlDisabled\"\r\n [id]=\"'control' + layoutNode()?._id + '/' + radioItem?.value\"\r\n [name]=\"controlName\"\r\n [value]=\"radioItem?.value\"\r\n (change)=\"updateValue($event)\">\r\n <span [innerHTML]=\"radioItem?.name\"></span>\r\n </label>\r\n </div>\r\n </div>`,\r\n standalone: false\r\n})\r\nexport class RadiosComponent implements OnInit,OnDestroy {\r\n private jsf = inject(JsonSchemaFormService);\r\n\r\n formControl: AbstractControl;\r\n controlName: string;\r\n controlValue: any;\r\n controlDisabled = false;\r\n boundControl = false;\r\n options: any;\r\n layoutOrientation = 'vertical';\r\n radiosList: any[] = [];\r\n readonly layoutNode = input<any>(undefined);\r\n readonly layoutIndex = input<number[]>(undefined);\r\n readonly dataIndex = input<number[]>(undefined);\r\n\r\n ngOnInit() {\r\n this.options = this.layoutNode().options || {};\r\n const layoutNode = this.layoutNode();\r\n if (layoutNode.type === 'radios-inline' ||\r\n layoutNode.type === 'radiobuttons'\r\n ) {\r\n this.layoutOrientation = 'horizontal';\r\n }\r\n this.radiosList = buildTitleMap(\r\n this.options.titleMap || this.options.enumNames,\r\n this.options.enum, true\r\n );\r\n this.jsf.initializeControl(this);\r\n }\r\n\r\n updateValue(event) {\r\n this.jsf.updateValue(this, event.target.value);\r\n }\r\n\r\n ngOnDestroy () {\r\n this.jsf.updateValue(this, null);\r\n }\r\n\r\n}\r\n","import { CdkDrag, CdkDragDrop } from '@angular/cdk/drag-drop';\r\nimport { ChangeDetectionStrategy, ChangeDetectorRef, Component, inject, input, OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core';\r\nimport { memoize } from 'lodash';\r\nimport { Subscription } from 'rxjs';\r\nimport { JsonSchemaFormService } from '../json-schema-form.service';\r\n@Component({\r\n // tslint:disable-next-line:component-selector\r\n selector: 'root-widget',\r\n template: `\r\n <div cdkDropList (cdkDropListDropped)=\"drop($event)\" \r\n [class.flex-inherit]=\"true\"\r\n [cdkDropListSortPredicate]=\"sortPredicate\"\r\n >\r\n <!-- -for now left out\r\n cdkDragHandle directive, by itself, does not disable the \r\n default drag behavior of its parent cdkDrag element. \r\n You must explicitly disable dragging on the main element \r\n and re-enable it only when using the handle.\r\n -->\r\n <div *ngFor=\"let layoutItem of layout(); let i = index;\"\r\n cdkDrag [cdkDragStartDelay]=\"{touch:1000,mouse:0}\"\r\n [cdkDragDisabled]=\"!isDraggable(layoutItem)\"\r\n [class.form-flex-item]=\"isFlexItem()\"\r\n [style.align-self]=\"(layoutItem.options || {})['align-self']\"\r\n [style.flex-basis]=\"getFlexAttribute(layoutItem, 'flex-basis')\"\r\n [style.flex-grow]=\"getFlexAttribute(layoutItem, 'flex-grow')\"\r\n [style.flex-shrink]=\"getFlexAttribute(layoutItem, 'flex-shrink')\"\r\n [style.order]=\"(layoutItem.options || {}).order\"\r\n >\r\n\r\n <!-- workaround to disbale dragging of input fields -->\r\n <!--\r\n <div *ngIf=\"layoutItem?.dataType !='object'\" cdkDragHandle>\r\n <p>Drag Handle {{layoutItem?.dataType}}</p>\r\n </div>\r\n -->\r\n <!--NB orderable directive is not used but has been left in for now and set to false\r\n otherwise the compiler won't recognize dataIndex and other dependent attributes\r\n -->\r\n <!--\r\n <div \r\n [dataIndex]=\"layoutItem?.arrayItem ? (dataIndex() || []).concat(i) : (dataIndex() || [])\"\r\n [layoutIndex]=\"(layoutIndex() || []).concat(i)\"\r\n [layoutNode]=\"layoutItem\"\r\n [orderable]=\"false\"\r\n >\r\n <select-framework-widget *ngIf=\"showWidget(layoutItem)\"\r\n [dataIndex]=\"layoutItem?.arrayItem ? (dataIndex() || []).concat(i) : (dataIndex() || [])\"\r\n [layoutIndex]=\"(layoutIndex() || []).concat(i)\"\r\n [layoutNode]=\"layoutItem\"></select-framework-widget>\r\n </div>\r\n -->\r\n <select-framework-widget *ngIf=\"showWidget(layoutItem)\"\r\n [dataIndex]=\"getSelectFrameworkInputs(layoutItem,i).dataIndex\"\r\n [layoutIndex]=\"getSelectFrameworkInputs(layoutItem,i).layoutIndex\"\r\n [layoutNode]=\"getSelectFrameworkInputs(layoutItem,i).layoutNode\">\r\n\t\t </select-framework-widget>\r\n </div>\r\n </div>\r\n `,\r\n styles: [`\r\n [draggable=true] {\r\n transition: all 150ms cubic-bezier(.4, 0, .2, 1);\r\n }\r\n [draggable=true]:hover {\r\n cursor: move;\r\n box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);\r\n position: relative; z-index: 10;\r\n margin-top: -1px;\r\n margin-left: -1px;\r\n margin-right: 1px;\r\n margin-bottom: 1px;\r\n }\r\n [draggable=true].drag-target-top {\r\n box-shadow: 0 -2px 0 #000;\r\n position: relative; z-index: 20;\r\n }\r\n [draggable=true].drag-target-bottom {\r\n box-shadow: 0 2px 0 #000;\r\n position: relative; z-index: 20;\r\n }\r\n .flex-inherit{\r\n display:inherit;\r\n flex-flow:inherit;\r\n flex-wrap:inherit;\r\n flex-direction:inherit;\r\n width:100%\r\n }\r\n `],\r\n changeDetection:ChangeDetectionStrategy.OnPush,\r\n standalone: false\r\n})\r\nexport class RootComponent implements OnInit, OnDestroy,OnChanges {\r\n\r\n private jsf = inject(JsonSchemaFormService);\r\n private cdr = inject(ChangeDetectorRef);\r\n options: any;\r\n readonly dataIndex = input<number[]>(undefined);\r\n readonly layoutIndex = input<number[]>(undefined);\r\n readonly layout = input<any[]>(undefined);\r\n readonly isOrderable = input<boolean>(undefined);\r\n readonly isFlexItem = input(false);\r\n readonly memoizationEnabled= input<boolean>(true);\r\n\r\n dataChangesSubs:Subscription;\r\n\r\n drop(event: CdkDragDrop<string[]>) {\r\n // most likely why this event is used is to get the dragging element's current index\r\n let srcInd=event.previousIndex;\r\n let trgInd=event.currentIndex;\r\n let layoutItem=this.layout()[trgInd];\r\n let dataInd=layoutItem?.arrayItem ? (this.dataIndex() || []).concat(trgInd) : (this.dataIndex() || []);\r\n let layoutInd=(this.layoutIndex() || []).concat(trgInd)\r\n let itemCtx:any={\r\n dataIndex:()=>{return dataInd},\r\n layoutIndex:()=>{return layoutInd},\r\n layoutNode:()=>{return layoutItem},\r\n }\r\n this.jsf.moveArrayItem(itemCtx, srcInd, trgInd,true);\r\n }\r\n\r\n isDraggable(node: any): boolean {\r\n let result=node.arrayItem && node.type !== '$ref' &&\r\n node.arrayItemType === 'list' && this.isOrderable() !== false\r\n && node.type !=='submit'\r\n return result;\r\n }\r\n\r\n //TODO also need to think of other types such as button which can be\r\n //created by an arbitrary layout\r\n isFixed(node: any): boolean {\r\n let result=node.type == '$ref';\r\n return result;\r\n }\r\n\r\n /**\r\n * Predicate function that disallows '$ref' item sorts\r\n * NB declared as a var instead of a function \r\n * like sortPredicate(index: number, item: CdkDrag<number>){..}\r\n * since 'this' is bound to the draglist and doesn't reference the\r\n * FlexLayoutRootComponent instance\r\n */\r\n //TODO also need to think of other types such as button which can be\r\n //created by an arbitrary layout\r\n //might not be needed added condition to [cdkDragDisabled]\r\n sortPredicate=(index: number, item: CdkDrag<number>)=> {\r\n let layoutItem=this.layout()[index];\r\n let result=this.isDraggable(layoutItem);\r\n //layoutItem.type != '$ref';\r\n return result;\r\n }\r\n\r\n // Set attributes for flexbox child\r\n // (container attributes are set in section.component)\r\n getFlexAttribute(node: any, attribute: string) {\r\n const index = ['flex-grow', 'flex-shrink', 'flex-basis'].indexOf(attribute);\r\n return ((node.options || {}).flex || '').split(/\\s+/)[index] ||\r\n (node.options || {})[attribute] || ['1', '1', 'auto'][index];\r\n }\r\n\r\n //private selectframeworkInputCache = new Map<string, { dataIndex: any[], layoutIndex: any[], layoutNode: any }>();\r\n\r\n //TODO review caching-if form field values change, the changes are not propagated\r\n\r\n /*\r\n getSelectFrameworkInputs(layoutItem: any, i: number) {\r\n // Create a unique key based on the layoutItem and index\r\n const cacheKey = `${layoutItem._id}-${i}`;\r\n \r\n // If the result is already in the cache, return it\r\n if(this.enableCaching){\r\n if (this.selectframeworkInputCache.has(cacheKey)) {\r\n return this.selectframeworkInputCache.get(cacheKey);\r\n }\r\n }\r\n\r\n\r\n // If not cached, calculate the values (assuming dataIndex() and layoutIndex() are functions)\r\n const dataIndex = layoutItem?.arrayItem ? (this.dataIndex() || []).concat(i) : (this.dataIndex() || []);\r\n const layoutIndex = (this.layoutIndex() || []).concat(i);\r\n\r\n // Save the result in the cache\r\n const result = { dataIndex, layoutIndex, layoutNode: layoutItem };\r\n if(this.enableCaching){\r\n this.selectframeworkInputCache.set(cacheKey, result);\r\n }\r\n\r\n return result;\r\n }\r\n */\r\n\r\n private _getSelectFrameworkInputsRaw = (layoutItem: any, i: number) => {\r\n const dataIndexValue = this.dataIndex() || [];\r\n const layoutIndexValue = this.layoutIndex() || [];\r\n\r\n return {\r\n layoutNode: layoutItem,\r\n layoutIndex: [...layoutIndexValue, i],\r\n dataIndex: layoutItem?.arrayItem ? [...dataIndexValue, i] : dataIndexValue,\r\n };\r\n };\r\n\r\n // Define a separate function to hold the memoized version\r\n private _getSelectFrameworkInputsMemoized = memoize(\r\n this._getSelectFrameworkInputsRaw,\r\n (layoutItem: any, i: number) => {\r\n const layoutItemKey = layoutItem?.id ?? JSON.stringify(layoutItem);\r\n return `${layoutItemKey}-${i}`;\r\n }\r\n );\r\n\r\n // This is the public function that the template calls\r\n getSelectFrameworkInputs(layoutItem: any, i: number) {\r\n if (this.memoizationEnabled) {\r\n return this._getSelectFrameworkInputsMemoized(layoutItem, i);\r\n } else {\r\n return this._getSelectFrameworkInputsRaw(layoutItem, i);\r\n }\r\n }\r\n //TODO investigate-causing layout issue with layout,for now\r\n //removed from template\r\n trackByFn(index: number, item: any): any {\r\n return item._id ?? index;\r\n }\r\n\r\n \r\n\r\n /*\r\n ngOnChanges(changes: SimpleChanges): void {\r\n // If any of the input properties change, clear the cache\r\n if (changes.dataIndex || changes.layoutIndex || changes.layout) {\r\n this.selectframeworkInputCache?.clear(); // Clear the entire cache\r\n }\r\n }\r\n */\r\n ngOnChanges(changes: SimpleChanges): void {\r\n if (changes['layout'] || changes['dataIndex'] || changes['layoutIndex']) {\r\n // Clear the entire cache of the memoized function\r\n this._getSelectFrameworkInputsMemoized.cache.clear();\r\n this.cdr.markForCheck();\r\n }\r\n }\r\n\r\n\r\n showWidget(layoutNode: any): boolean {\r\n return this.jsf.evaluateCondition(layoutNode, this.dataIndex());\r\n }\r\n ngOnInit(): void {\r\n if(this.memoizationEnabled){\r\n this.jsf.dataChanges.subscribe((val)=>{\r\n //this.selectframeworkInputCache?.clear();\r\n this._getSelectFrameworkInputsMemoized.cache.clear();\r\n //TODO-fix for now changed to detectChanges-\r\n //used to updated the dynamic titles in tab compnents \r\n this.cdr.markForCheck();\r\n // this.cdr.detectChanges();-breaks oneOf/ matdatepicker\r\n })\r\n }\r\n\r\n }\r\n ngOnDestroy(): void {\r\n //this.selectframeworkInputCache?.clear()\r\n //this.selectframeworkInputCache=null;\r\n this._getSelectFrameworkInputsMemoized.cache.clear();\r\n this.dataChangesSubs?.unsubscribe();\r\n }\r\n \r\n\r\n}\r\n","import { Component, OnInit, inject, input } from '@angular/core';\r\nimport { JsonSchemaFormService } from '../json-schema-form.service';\r\n\r\n\r\n@Component({\r\n // tslint:disable-next-line:component-selector\r\n selector: 'section-widget',\r\n template: `\r\n <div *ngIf=\"containerType === 'div'\"\r\n [class]=\"options?.htmlClass || ''\"\r\n [class.expandable]=\"options?.expandable && !expanded\"\r\n [class.expanded]=\"options?.expandable && expanded\">\r\n <label *ngIf=\"sectionTitle\"\r\n class=\"legend\"\r\n [class]=\"options?.labelHtmlClass || ''\"\r\n [innerHTML]=\"sectionTitle\"\r\n (click)=\"toggleExpanded()\"></label>\r\n <root-widget \r\n [dataIndex]=\"dataIndex()\"\r\n [layout]=\"layoutNode().items\"\r\n [layoutIndex]=\"layoutIndex()\"\r\n [isFlexItem]=\"getFlexAttribute('is-flex')\"\r\n [isOrderable]=\"options?.orderable\"\r\n [class.form-flex-column]=\"getFlexAttribute('flex-direction') === 'column'\"\r\n [class.form-flex-row]=\"getFlexAttribute('flex-direction') === 'row'\"\r\n [style.align-content]=\"getFlexAttribute('align-content')\"\r\n [style.align-items]=\"getFlexAttribute('align-items')\"\r\n [style.display]=\"!expanded?'none':getFlexAttribute('display')\"\r\n [style.flex-direction]=\"getFlexAttribute('flex-direction')\"\r\n [style.flex-wrap]=\"getFlexAttribute('flex-wrap')\"\r\n [style.justify-content]=\"getFlexAttribute('justify-content')\"></root-widget>\r\n </div>\r\n <fieldset *ngIf=\"containerType === 'fieldset'\"\r\n [class]=\"options?.htmlClass || ''\"\r\n [class.expandable]=\"options?.expandable && !expanded\"\r\n [class.expanded]=\"options?.expandable && expanded\"\r\n [disabled]=\"options?.readonly\">\r\n <legend *ngIf=\"sectionTitle\"\r\n class=\"legend\"\r\n [class]=\"options?.labelHtmlClass || ''\"\r\n [innerHTML]=\"sectionTitle\"\r\n (click)=\"toggleExpanded()\"></legend>\r\n <div *ngIf=\"options?.messageLocation !== 'bottom'\">\r\n <p *ngIf=\"options?.description\"\r\n class=\"help-block\"\r\n [class]=\"options?.labelHelpBlockClass || ''\"\r\n [innerHTML]=\"options?.description\"></p>\r\n </div>\r\n <root-widget \r\n [dataIndex]=\"dataIndex()\"\r\n [layout]=\"layoutNode().items\"\r\n [layoutIndex]=\"layoutIndex()\"\r\n [isFlexItem]=\"getFlexAttribute('is-flex')\"\r\n [isOrderable]=\"options?.orderable\"\r\n [class.form-flex-column]=\"getFlexAttribute('flex-direction') === 'column'\"\r\n [class.form-flex-row]=\"getFlexAttribute('flex-direction') === 'row'\"\r\n [style.align-content]=\"getFlexAttribute('align-content')\"\r\n [style.align-items]=\"getFlexAttribute('align-items')\"\r\n [style.display]=\"!expanded?'none':getFlexAttribute('display')\"\r\n [style.flex-direction]=\"getFlexAttribute('flex-direction')\"\r\n [style.flex-wrap]=\"getFlexAttribute('flex-wrap')\"\r\n [style.justify-content]=\"getFlexAttribute('justify-content')\"></root-widget>\r\n <div *ngIf=\"options?.messageLocation === 'bottom'\">\r\n <p *ngIf=\"options?.description\"\r\n class=\"help-block\"\r\n [class]=\"options?.labelHelpBlockClass || ''\"\r\n [innerHTML]=\"options?.description\"></p>\r\n </div>\r\n </fieldset>`,\r\n styles: [`\r\n .legend { font-weight: bold; }\r\n .expandable > legend:before, .expandable > label:before { content: '▶'; padding-right: .3em; font-family:auto }\r\n .expanded > legend:before, .expanded > label:before { content: '▼'; padding-right: .2em; }\r\n `],\r\n standalone: false\r\n})\r\nexport class SectionComponent implements OnInit {\r\n private jsf = inject(JsonSchemaFormService);\r\n\r\n options: any;\r\n expanded = true;\r\n containerType: string;\r\n readonly layoutNode = input<any>(undefined);\r\n readonly layoutIndex = input<number[]>(undefined);\r\n readonly dataIndex = input<number[]>(undefined);\r\n\r\n get sectionTitle() {\r\n return this.options.notitle ? null : this.jsf.setItemTitle(this);\r\n }\r\n\r\n\r\n\r\n ngOnInit() {\r\n this.jsf.initializeControl(this);\r\n this.options = this.layoutNode().options || {};\r\n this.expanded = typeof this.options.expanded === 'boolean' ?\r\n this.options.expanded : !this.options.expandable;\r\n switch (this.layoutNode().type) {\r\n case 'fieldset': case 'array': case 'tab': case 'advancedfieldset':\r\n case 'authfieldset': case 'optionfieldset': case 'selectfieldset':\r\n this.containerType = 'fieldset';\r\n break;\r\n default: // 'div', 'flex', 'section', 'conditional', 'actions', 'tagsinput'\r\n this.containerType = 'div';\r\n break;\r\n }\r\n }\r\n\r\n toggleExpanded() {\r\n if (this.options.expandable) { this.expanded = !this.expanded; }\r\n }\r\n\r\n // Set attributes for flexbox container\r\n // (child attributes are set in root.component)\r\n getFlexAttribute(attribute: string) {\r\n const flexActive: boolean =\r\n this.layoutNode().type === 'flex' ||\r\n !!this.options.displayFlex ||\r\n this.options.display === 'flex';\r\n if (attribute !== 'flex' && !flexActive) { return null; }\r\n switch (attribute) {\r\n case 'is-flex':\r\n return flexActive;\r\n case 'display':\r\n return flexActive ? 'flex' : 'initial';\r\n case 'flex-direction': case 'flex-wrap':\r\n const index = ['flex-direction', 'flex-wrap'].indexOf(attribute);\r\n return (this.options['flex-flow'] || '').split(/\\s+/)[index] ||\r\n this.options[attribute] || ['column', 'nowrap'][index];\r\n case 'justify-content': case 'align-items': case 'align-content':\r\n return this.options[attribute];\r\n }\r\n }\r\n}\r\n","import { Component, inject, input, OnDestroy, OnInit } from '@angular/core';\r\nimport { AbstractControl } from '@angular/forms';\r\nimport { JsonSchemaFormService } from '../json-schema-form.service';\r\nimport { buildTitleMap, isArray } from '../shared';\r\n\r\n\r\n@Component({\r\n // tslint:disable-next-line:component-selector\r\n selector: 'select-widget',\r\n template: `\r\n <div\r\n [class]=\"options?.htmlClass || ''\">\r\n <label *ngIf=\"options?.title\"\r\n [attr.for]=\"'control' + layoutNode()?._id\"\r\n [class]=\"options?.labelHtmlClass || ''\"\r\n [style.display]=\"options?.notitle ? 'none' : ''\"\r\n [innerHTML]=\"options?.title\"></label>\r\n <select *ngIf=\"boundControl && !options?.multiple\"\r\n [formControl]=\"formControl\"\r\n [attr.aria-describedby]=\"'control' + layoutNode()?._id + 'Status'\"\r\n [attr.readonly]=\"options?.readonly ? 'readonly' : null\"\r\n [attr.required]=\"options?.required\"\r\n [class]=\"options?.fieldHtmlClass || ''\"\r\n [id]=\"'control' + layoutNode()?._id\"\r\n [name]=\"controlName\">\r\n <ng-template ngFor let-selectItem [ngForOf]=\"selectList\">\r\n <option *ngIf=\"!isArray(selectItem?.items)\"\r\n [ngValue]=\"selectItem?.value\">\r\n <span [innerHTML]=\"selectItem?.name\"></span>\r\n </option>\r\n <optgroup *ngIf=\"isArray(selectItem?.items)\"\r\n [label]=\"selectItem?.group\">\r\n <option *ngFor=\"let subItem of selectItem.items\"\r\n [ngValue]=\"subItem?.value\">\r\n <span [innerHTML]=\"subItem?.name\"></span>\r\n </option>\r\n </optgroup>\r\n </ng-template>\r\n </select>\r\n <select *ngIf=\"!boundControl\"\r\n [attr.aria-describedby]=\"'control' + layoutNode()?._id + 'Status'\"\r\n [attr.readonly]=\"options?.readonly ? 'readonly' : null\"\r\n [attr.required]=\"options?.required\"\r\n [class]=\"options?.fieldHtmlClass || ''\"\r\n [disabled]=\"controlDisabled\"\r\n [id]=\"'control' + layoutNode()?._id\"\r\n [name]=\"controlName\"\r\n (change)=\"updateValue($event)\">\r\n <ng-template ngFor let-selectItem [ngForOf]=\"selectList\">\r\n <option *ngIf=\"!isArray(selectItem?.items)\"\r\n [selected]=\"selectItem?.value === controlValue\"\r\n [ngValue]=\"selectItem?.value\">\r\n <span [innerHTML]=\"selectItem?.name\"></span>\r\n </option>\r\n <optgroup *ngIf=\"isArray(selectItem?.items)\"\r\n [label]=\"selectItem?.group\">\r\n <option *ngFor=\"let subItem of selectItem.items\"\r\n [attr.selected]=\"subItem?.value === controlValue\"\r\n [ngValue]=\"subItem?.value\">\r\n <span [innerHTML]=\"subItem?.name\"></span>\r\n </option>\r\n </optgroup>\r\n </ng-template>\r\n </select>\r\n <select *ngIf=\"boundControl && options?.multiple\"\r\n [attr.aria-describedby]=\"'control' + layoutNode()?._id + 'Status'\"\r\n [attr.readonly]=\"options?.readonly ? 'readonly' : null\"\r\n [attr.required]=\"options?.required\"\r\n [class]=\"options?.fieldHtmlClass || ''\"\r\n [disabled]=\"controlDisabled\"\r\n [id]=\"'control' + layoutNode()?._id\"\r\n [multiple]=\"options?.multiple\"\r\n [name]=\"controlName\"\r\n [(ngModel)]=\"controlValue\"\r\n (change)=\"updateValue($event)\">\r\n <ng-template ngFor let-selectItem [ngForOf]=\"selectList\">\r\n <option *ngIf=\"!isArray(selectItem?.items)\"\r\n [selected]=\"selectItem?.value === controlValue\"\r\n [ngValue]=\"selectItem?.value\">\r\n <span [innerHTML]=\"selectItem?.name\"></span>\r\n </option>\r\n <optgroup *ngIf=\"isArray(selectItem?.items)\"\r\n [label]=\"selectItem?.group\">\r\n <option *ngFor=\"let subItem of selectItem.items\"\r\n [attr.selected]=\"subItem?.value === controlValue\"\r\n [ngValue]=\"subItem?.value\">\r\n <span [innerHTML]=\"subItem?.name\"></span>\r\n </option>\r\n </optgroup>\r\n </ng-template>\r\n </select>\r\n </div>`,\r\n standalone: false\r\n})\r\nexport class SelectComponent implements OnInit, OnDestroy {\r\n private jsf = inject(JsonSchemaFormService);\r\n\r\n formControl: AbstractControl;\r\n controlName: string;\r\n controlValue: any;\r\n controlDisabled = false;\r\n boundControl = false;\r\n options: any;\r\n selectList: any[] = [];\r\n selectListFlatGroup: any[] = [];\r\n isArray = isArray;\r\n readonly layoutNode = input<any>(undefined);\r\n readonly layoutIndex = input<number[]>(undefined);\r\n readonly dataIndex = input<number[]>(undefined);\r\n\r\n ngOnInit() {\r\n this.options = this.layoutNode().options || {};\r\n this.selectList = buildTitleMap(\r\n this.options.titleMap || this.options.enumNames,\r\n this.options.enum, !!this.options.required, !!this.options.flatList\r\n );\r\n //the selectListFlatGroup array will be used to update the formArray values\r\n //while the selectList array will be bound to the form select\r\n //as either a grouped select or a flat select\r\n this.selectListFlatGroup = buildTitleMap(\r\n this.options.titleMap || this.options.enumNames,\r\n this.options.enum, !!this.options.required, true\r\n )\r\n this.jsf.initializeControl(this);\r\n }\r\n\r\n deselectAll() {\r\n this.selectListFlatGroup.forEach(selItem => {\r\n selItem.checked = false;\r\n })\r\n }\r\n\r\n updateValue(event) {\r\n this.options.showErrors = true;\r\n if (this.options.multiple) {\r\n if (this.controlValue?.includes(null)) {\r\n this.deselectAll();\r\n //this.control.setValue([]); // Reset the form control to an empty array\r\n //this.selectList=JSON.parse(JSON.stringify(this.selectList));\r\n this.jsf.updateArrayMultiSelectList(this, []);\r\n } else {\r\n this.selectListFlatGroup.forEach(selItem => {\r\n selItem.checked = this.controlValue?.indexOf(selItem.value) >= 0 ? true : false;\r\n })\r\n this.jsf.updateArrayMultiSelectList(this, this.selectListFlatGroup);\r\n }\r\n return;\r\n }\r\n this.jsf.updateValue(this, this.controlValue);\r\n }\r\n\r\n ngOnDestroy() {\r\n let nullVal=this.options.multiple?[null]:null;\r\n this.formControl.reset(nullVal)\r\n this.controlValue=null;\r\n }\r\n}\r\n","import { Component, OnDestroy, OnInit, inject, input } from '@angular/core';\r\nimport { AbstractControl } from '@angular/forms';\r\nimport { Subscription } from 'rxjs';\r\nimport { JsonSchemaFormService } from '../json-schema-form.service';\r\nimport { hasOwn } from '../shared/utility.functions';\r\n\r\n\r\n@Component({\r\n // tslint:disable-next-line:component-selector\r\n selector: 'submit-widget',\r\n template: `\r\n <div\r\n [class]=\"options?.htmlClass || ''\">\r\n <input\r\n [attr.aria-describedby]=\"'control' + layoutNode()?._id + 'Status'\"\r\n [attr.readonly]=\"options?.readonly ? 'readonly' : null\"\r\n [attr.required]=\"options?.required\"\r\n [class]=\"options?.fieldHtmlClass || ''\"\r\n [disabled]=\"controlDisabled\"\r\n [id]=\"'control' + layoutNode()?._id\"\r\n [name]=\"controlName\"\r\n [type]=\"layoutNode()?.type\"\r\n [value]=\"controlValue\"\r\n (click)=\"updateValue($event)\"\r\n [appStopPropagation]=\"['mousedown', 'touchstart']\"\r\n >\r\n </div>`,\r\n standalone: false\r\n})\r\nexport class SubmitComponent implements OnInit,OnDestroy {\r\n private jsf = inject(JsonSchemaFormService);\r\n\r\n formControl: AbstractControl;\r\n controlName: string;\r\n controlValue: any;\r\n controlDisabled = false;\r\n boundControl = false;\r\n options: any;\r\n readonly layoutNode = input<any>(undefined);\r\n readonly layoutIndex = input<number[]>(undefined);\r\n readonly dataIndex = input<number[]>(undefined);\r\n\r\n isValidChangesSubs:Subscription;\r\n ngOnDestroy(): void {\r\n this.isValidChangesSubs?.unsubscribe();\r\n this.isValidChangesSubs=null;\r\n this.updateValue({target:{value:null}});\r\n }\r\n\r\n ngOnInit() {\r\n this.options = this.layoutNode().options || {};\r\n this.jsf.initializeControl(this);\r\n if (hasOwn(this.options, 'disabled')) {\r\n this.controlDisabled = this.options.disabled;\r\n } else if (this.jsf.formOptions.disableInvalidSubmit) {\r\n this.controlDisabled = !this.jsf.isValid;\r\n this.isValidChangesSubs=this.jsf.isValidChanges.subscribe(isValid => this.controlDisabled = !isValid);\r\n }\r\n if (this.controlValue === null || this.controlValue === undefined) {\r\n this.controlValue = this.options.title;\r\n }\r\n }\r\n\r\n updateValue(event) {\r\n if (typeof this.options.onClick === 'function') {\r\n this.options.onClick(event);\r\n } else {\r\n this.jsf.updateValue(this, event.target.value);\r\n }\r\n }\r\n}\r\n","import { Component, ComponentRef, OnChanges, OnInit, ViewContainerRef, inject, input, viewChild } from '@angular/core';\r\nimport { JsonSchemaFormService } from '../json-schema-form.service';\r\n\r\n\r\n@Component({\r\n // tslint:disable-next-line:component-selector\r\n selector: 'template-widget',\r\n template: `<div #widgetContainer></div>`,\r\n standalone: false\r\n})\r\nexport class TemplateComponent implements OnInit, OnChanges {\r\n private jsf = inject(JsonSchemaFormService);\r\n\r\n newComponent: ComponentRef<any> = null;\r\n readonly layoutNode = input<any>(undefined);\r\n readonly layoutIndex = input<number[]>(undefined);\r\n readonly dataIndex = input<number[]>(undefined);\r\n readonly widgetContainer = viewChild('widgetContainer', { read: ViewContainerRef });\r\n\r\n ngOnInit() {\r\n this.updateComponent();\r\n }\r\n\r\n ngOnChanges() {\r\n this.updateComponent();\r\n }\r\n\r\n updateComponent() {\r\n const layoutNode = this.layoutNode();\r\n const widgetContainer = this.widgetContainer();\r\n if (widgetContainer && !this.newComponent && layoutNode.options.template) {\r\n this.newComponent = widgetContainer.createComponent((layoutNode.options.template)\r\n );\r\n }\r\n if (this.newComponent) {\r\n for (const input of ['layoutNode', 'layoutIndex', 'dataIndex']) {\r\n this.newComponent.instance[input] = this[input];\r\n }\r\n }\r\n }\r\n}\r\n","import { Component, inject, input, OnDestroy, OnInit } from '@angular/core';\r\nimport { AbstractControl } from '@angular/forms';\r\nimport { JsonSchemaFormService } from '../json-schema-form.service';\r\n\r\n\r\n@Component({\r\n // tslint:disable-next-line:component-selector\r\n selector: 'textarea-widget',\r\n template: `\r\n <div\r\n [class]=\"options?.htmlClass || ''\">\r\n <label *ngIf=\"options?.title\"\r\n [attr.for]=\"'control' + layoutNode()?._id\"\r\n [class]=\"options?.labelHtmlClass || ''\"\r\n [style.display]=\"options?.notitle ? 'none' : ''\"\r\n [innerHTML]=\"options?.title\"></label>\r\n <textarea *ngIf=\"boundControl\"\r\n [formControl]=\"formControl\"\r\n [attr.aria-describedby]=\"'control' + layoutNode()?._id + 'Status'\"\r\n [attr.maxlength]=\"options?.maxLength\"\r\n [attr.minlength]=\"options?.minLength\"\r\n [attr.pattern]=\"options?.pattern\"\r\n [attr.placeholder]=\"options?.placeholder\"\r\n [attr.readonly]=\"options?.readonly ? 'readonly' : null\"\r\n [attr.required]=\"options?.required\"\r\n [class]=\"options?.fieldHtmlClass || ''\"\r\n [id]=\"'control' + layoutNode()?._id\"\r\n [name]=\"controlName\"></textarea>\r\n <textarea *ngIf=\"!boundControl\"\r\n [attr.aria-describedby]=\"'control' + layoutNode()?._id + 'Status'\"\r\n [attr.maxlength]=\"options?.maxLength\"\r\n [attr.minlength]=\"options?.minLength\"\r\n [attr.pattern]=\"options?.pattern\"\r\n [attr.placeholder]=\"options?.placeholder\"\r\n [attr.readonly]=\"options?.readonly ? 'readonly' : null\"\r\n [attr.required]=\"options?.required\"\r\n [class]=\"options?.fieldHtmlClass || ''\"\r\n [disabled]=\"controlDisabled\"\r\n [id]=\"'control' + layoutNode()?._id\"\r\n [name]=\"controlName\"\r\n [value]=\"controlValue\"\r\n (input)=\"updateValue($event)\">{{controlValue}}</textarea>\r\n </div>`,\r\n standalone: false\r\n})\r\nexport class TextareaComponent implements OnInit,OnDestroy {\r\n private jsf = inject(JsonSchemaFormService);\r\n\r\n formControl: AbstractControl;\r\n controlName: string;\r\n controlValue: any;\r\n controlDisabled = false;\r\n boundControl = false;\r\n options: any;\r\n readonly layoutNode = input<any>(undefined);\r\n readonly layoutIndex = input<number[]>(undefined);\r\n readonly dataIndex = input<number[]>(undefined);\r\n\r\n ngOnInit() {\r\n this.options = this.layoutNode().options || {};\r\n this.jsf.initializeControl(this);\r\n }\r\n\r\n updateValue(event) {\r\n this.jsf.updateValue(this, event.target.value);\r\n }\r\n \r\n ngOnDestroy () {\r\n //see cpmments in input component\r\n setTimeout(()=>{\r\n this.jsf.updateValue(this, null);\r\n })\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport { hasOwn } from '../shared/utility.functions';\r\nimport { AddReferenceComponent } from './add-reference.component';\r\nimport { ButtonComponent } from './button.component';\r\nimport { CheckboxComponent } from './checkbox.component';\r\nimport { CheckboxesComponent } from './checkboxes.component';\r\nimport { FileComponent } from './file.component';\r\nimport { InputComponent } from './input.component';\r\nimport { MessageComponent } from './message.component';\r\nimport { NoneComponent } from './none.component';\r\nimport { NumberComponent } from './number.component';\r\nimport { OneOfComponent } from './one-of.component';\r\nimport { RadiosComponent } from './radios.component';\r\nimport { RootComponent } from './root.component';\r\nimport { SectionComponent } from './section.component';\r\nimport { SelectFrameworkComponent } from './select-framework.component';\r\nimport { SelectWidgetComponent } from './select-widget.component';\r\nimport { SelectComponent } from './select.component';\r\nimport { SelectCheckboxComponent } from './selectcheckbox.component';\r\nimport { SubmitComponent } from './submit.component';\r\nimport { TabsComponent } from './tabs.component';\r\nimport { TemplateComponent } from './template.component';\r\nimport { TextareaComponent } from './textarea.component';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class WidgetLibraryService {\r\n\r\n defaultWidget = 'text';\r\n widgetLibrary: any = {\r\n\r\n // Angular JSON Schema Form administrative widgets\r\n 'none': NoneComponent, // Placeholder, for development - displays nothing\r\n 'root': RootComponent, // Form root, renders a complete layout\r\n 'select-framework': SelectFrameworkComponent, // Applies the selected framework to a specified widget\r\n 'select-widget': SelectWidgetComponent, // Displays a specified widget\r\n '$ref': AddReferenceComponent, // Button to add a new array item or $ref element\r\n\r\n // Free-form text HTML 'input' form control widgets <input type=\"...\">\r\n 'email': 'text',\r\n 'integer': 'number', // Note: 'integer' is not a recognized HTML input type\r\n 'number': NumberComponent,\r\n 'password': 'text',\r\n 'search': 'text',\r\n 'tel': 'text',\r\n 'text': InputComponent,\r\n 'url': 'text',\r\n\r\n // Controlled text HTML 'input' form control widgets <input type=\"...\">\r\n 'color': 'text',\r\n 'date': 'text',\r\n 'datetime': 'text',\r\n 'datetime-local': 'text',\r\n 'month': 'text',\r\n 'range': 'number',\r\n 'time': 'text',\r\n 'week': 'text',\r\n\r\n // Non-text HTML 'input' form control widgets <input type=\"...\">\r\n // 'button': <input type=\"button\"> not used, use <button> instead\r\n 'checkbox': CheckboxComponent, // TODO: Set ternary = true for 3-state ??\r\n 'file': FileComponent, // TODO: Finish 'file' widget\r\n 'hidden': 'text',\r\n 'image': 'text', // TODO: Figure out how to handle these\r\n 'radio': 'radios',\r\n 'reset': 'submit', // TODO: Figure out how to handle these\r\n 'submit': SubmitComponent,\r\n\r\n // Other (non-'input') HTML form control widgets\r\n 'button': ButtonComponent,\r\n 'select': SelectComponent,\r\n // 'option': automatically generated by select widgets\r\n // 'optgroup': automatically generated by select widgets\r\n 'textarea': TextareaComponent,\r\n\r\n // HTML form control widget sets\r\n 'checkboxes': CheckboxesComponent, // Grouped list of checkboxes\r\n 'checkboxes-inline': 'checkboxes', // Checkboxes in one line\r\n 'checkboxbuttons': 'checkboxes', // Checkboxes as html buttons\r\n 'radios': RadiosComponent, // Grouped list of radio buttons\r\n 'radios-inline': 'radios', // Radio controls in one line\r\n 'radiobuttons': 'radios', // Radio controls as html buttons\r\n\r\n // HTML Layout widgets\r\n // 'label': automatically added to data widgets\r\n // 'legend': automatically added to fieldsets\r\n 'section': SectionComponent, // Just a div <div>\r\n 'div': 'section', // Still just a div <div>\r\n 'fieldset': 'section', // A fieldset, with an optional legend <fieldset>\r\n 'flex': 'section', // A flexbox container <div style=\"display: flex\">\r\n\r\n // Non-HTML layout widgets\r\n 'one-of': OneOfComponent, // A select box that changes another input\r\n // TODO: Finish 'one-of' widget\r\n 'array': 'section', // A list you can add, remove and reorder <fieldset>\r\n 'tabarray': 'tabs', // A tabbed version of array\r\n 'tab': 'section', // A tab group, similar to a fieldset or section <fieldset>\r\n 'tabs': TabsComponent, // A tabbed set of panels with different controls\r\n 'message': MessageComponent, // Insert arbitrary html\r\n 'help': 'message', // Insert arbitrary html\r\n 'msg': 'message', // Insert arbitrary html\r\n 'html': 'message', // Insert arbitrary html\r\n 'template': TemplateComponent, // Insert a custom Angular component\r\n\r\n // Widgets included for compatibility with JSON Form API\r\n 'advancedfieldset': 'section', // Adds 'Advanced settings' title <fieldset>\r\n 'authfieldset': 'section', // Adds 'Authentication settings' title <fieldset>\r\n 'optionfieldset': 'one-of', // Option control, displays selected sub-item <fieldset>\r\n 'selectfieldset': 'one-of', // Select control, displays selected sub-item <fieldset>\r\n 'conditional': 'section', // Identical to 'section' (depeciated) <div>\r\n 'actions': 'section', // Horizontal button list, can only submit, uses buttons as items <div>\r\n 'tagsinput': 'section', // For entering short text tags <div>\r\n // See: http://ulion.github.io/jsonform/playground/?example=fields-checkboxbuttons\r\n\r\n // Widgets included for compatibility with React JSON Schema Form API\r\n 'updown': 'number',\r\n //'date-time': 'datetime-local',\r\n //as per ajv date-time requires a timezone but input \r\n //datetime-local doesn't \r\n 'iso-date-time':'datetime-local',\r\n 'alt-datetime': 'datetime-local',\r\n 'alt-date': 'date',\r\n\r\n // Widgets included for compatibility with Angular Schema Form API\r\n 'wizard': 'section', // TODO: Sequential panels with \"Next\" and \"Previous\" buttons\r\n\r\n // Widgets included for compatibility with other libraries\r\n 'textline': 'text',\r\n\r\n 'selectcheckbox': SelectCheckboxComponent,\r\n\r\n // Recommended 3rd-party add-on widgets (TODO: create wrappers for these...)\r\n // 'ng2-select': Select control replacement - http://valor-software.com/ng2-select/\r\n // 'flatpickr': Flatpickr date picker - https://github.com/chmln/flatpickr\r\n // 'pikaday': Pikaday date picker - https://github.com/dbushell/Pikaday\r\n // 'spectrum': Spectrum color picker - http://bgrins.github.io/spectrum\r\n // 'bootstrap-slider': Bootstrap Slider range control - https://github.com/seiyria/bootstrap-slider\r\n // 'ace': ACE code editor - https://ace.c9.io\r\n // 'ckeditor': CKEditor HTML / rich text editor - http://ckeditor.com\r\n // 'tinymce': TinyMCE HTML / rich text editor - https://www.tinymce.com\r\n // 'imageselect': Bootstrap drop-down image selector - http://silviomoreto.github.io/bootstrap-select\r\n // 'wysihtml5': HTML editor - http://jhollingworth.github.io/bootstrap-wysihtml5\r\n // 'quill': Quill HTML / rich text editor (?) - https://quilljs.com\r\n };\r\n registeredWidgets: any = { };\r\n frameworkWidgets: any = { };\r\n activeWidgets: any = { };\r\n\r\n constructor() {\r\n this.setActiveWidgets();\r\n }\r\n\r\n setActiveWidgets(): boolean {\r\n this.activeWidgets = Object.assign(\r\n { }, this.widgetLibrary, this.frameworkWidgets, this.registeredWidgets\r\n );\r\n for (const widgetName of Object.keys(this.activeWidgets)) {\r\n let widget: any = this.activeWidgets[widgetName];\r\n // Resolve aliases\r\n if (typeof widget === 'string') {\r\n const usedAliases: string[] = [];\r\n while (typeof widget === 'string' && !usedAliases.includes(widget)) {\r\n usedAliases.push(widget);\r\n widget = this.activeWidgets[widget];\r\n }\r\n if (typeof widget !== 'string') {\r\n this.activeWidgets[widgetName] = widget;\r\n }\r\n }\r\n }\r\n return true;\r\n }\r\n\r\n setDefaultWidget(type: string): boolean {\r\n if (!this.hasWidget(type)) { return false; }\r\n this.defaultWidget = type;\r\n return true;\r\n }\r\n\r\n hasWidget(type: string, widgetSet = 'activeWidgets'): boolean {\r\n if (!type || typeof type !== 'string') { return false; }\r\n return hasOwn(this[widgetSet], type);\r\n }\r\n\r\n hasDefaultWidget(type: string): boolean {\r\n return this.hasWidget(type, 'widgetLibrary');\r\n }\r\n\r\n registerWidget(type: string, widget: any): boolean {\r\n if (!type || !widget || typeof type !== 'string') { return false; }\r\n this.registeredWidgets[type] = widget;\r\n return this.setActiveWidgets();\r\n }\r\n\r\n unRegisterWidget(type: string): boolean {\r\n if (!hasOwn(this.registeredWidgets, type)) { return false; }\r\n delete this.registeredWidgets[type];\r\n return this.setActiveWidgets();\r\n }\r\n\r\n unRegisterAllWidgets(unRegisterFrameworkWidgets = true): boolean {\r\n this.registeredWidgets = { };\r\n if (unRegisterFrameworkWidgets) { this.frameworkWidgets = { }; }\r\n return this.setActiveWidgets();\r\n }\r\n\r\n registerFrameworkWidgets(widgets: any): boolean {\r\n if (widgets === null || typeof widgets !== 'object') { widgets = { }; }\r\n this.frameworkWidgets = widgets;\r\n return this.setActiveWidgets();\r\n }\r\n\r\n unRegisterFrameworkWidgets(): boolean {\r\n if (Object.keys(this.frameworkWidgets).length) {\r\n this.frameworkWidgets = { };\r\n return this.setActiveWidgets();\r\n }\r\n return false;\r\n }\r\n\r\n getWidget(type?: string, widgetSet = 'activeWidgets'): any {\r\n if (this.hasWidget(type, widgetSet)) {\r\n return this[widgetSet][type];\r\n } else if (this.hasWidget(this.defaultWidget, widgetSet)) {\r\n return this[widgetSet][this.defaultWidget];\r\n } else {\r\n return null;\r\n }\r\n }\r\n\r\n getAllWidgets(): any {\r\n return {\r\n widgetLibrary: this.widgetLibrary,\r\n registeredWidgets: this.registeredWidgets,\r\n frameworkWidgets: this.frameworkWidgets,\r\n activeWidgets: this.activeWidgets,\r\n };\r\n }\r\n}\r\n","import { HttpClient } from '@angular/common/http';\r\nimport { Inject, Injectable, inject } from '@angular/core';\r\nimport { Observable, Subject, lastValueFrom } from 'rxjs';\r\nimport { hasOwn } from '../shared/utility.functions';\r\nimport { WidgetLibraryService } from '../widget-library/widget-library.service';\r\nimport { Framework } from './framework';\r\n\r\n// Possible future frameworks:\r\n// - Foundation 6:\r\n// http://justindavis.co/2017/06/15/using-foundation-6-in-angular-4/\r\n// https://github.com/zurb/foundation-sites\r\n// - Semantic UI:\r\n// https://github.com/edcarroll/ng2-semantic-ui\r\n// https://github.com/vladotesanovic/ngSemantic\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class FrameworkLibraryService {\r\n //private frameworks = inject(Framework);\r\n private widgetLibrary = inject<WidgetLibraryService>(WidgetLibraryService);\r\n private http = inject(HttpClient);\r\n\r\n activeFramework: Framework = null;\r\n stylesheets: (HTMLStyleElement|HTMLLinkElement)[];\r\n scripts: HTMLScriptElement[];\r\n loadExternalAssets = false;\r\n defaultFramework: string;\r\n frameworkLibrary: { [name: string]: Framework } = {};\r\n\r\n activeFrameworkName$: Observable<string>;\r\n private activeFrameworkNameSubject: Subject<string>;\r\n private activeFrameworkName:string;\r\n\r\n constructor(@Inject(Framework) private frameworks: any[],) {\r\n this.frameworks.forEach(framework =>\r\n this.frameworkLibrary[framework.name] = framework\r\n );\r\n this.defaultFramework = this.frameworks[0].name;\r\n //this.setFramework(this.defaultFramework);\r\n \r\n this.activeFrameworkName=this.defaultFramework;\r\n this.activeFrameworkNameSubject = new Subject<string>();\r\n this.activeFrameworkName$ = this.activeFrameworkNameSubject.asObservable();\r\n this.setFramework(this.defaultFramework);\r\n }\r\n\r\n public setLoadExternalAssets(loadExternalAssets = true): void {\r\n this.loadExternalAssets = !!loadExternalAssets;\r\n }\r\n\r\n public setFramework(\r\n framework: string|Framework = this.defaultFramework,\r\n loadExternalAssets = this.loadExternalAssets\r\n ): boolean {\r\n this.activeFramework =\r\n typeof framework === 'string' && this.hasFramework(framework) ?\r\n this.frameworkLibrary[framework] :\r\n typeof framework === 'object' && hasOwn(framework, 'framework') ?\r\n framework :\r\n this.frameworkLibrary[this.defaultFramework];\r\n if(this.activeFramework.name !=this.activeFrameworkName){\r\n this.activeFrameworkName=this.activeFramework.name;\r\n this.activeFrameworkNameSubject.next(this.activeFrameworkName);\r\n }\r\n return this.registerFrameworkWidgets(this.activeFramework);\r\n }\r\n\r\n registerFrameworkWidgets(framework: Framework): boolean {\r\n return hasOwn(framework, 'widgets') ?\r\n this.widgetLibrary.registerFrameworkWidgets(framework.widgets) :\r\n this.widgetLibrary.unRegisterFrameworkWidgets();\r\n }\r\n\r\n public hasFramework(type: string): boolean {\r\n return hasOwn(this.frameworkLibrary, type);\r\n }\r\n\r\n public getFramework(): any {\r\n if (!this.activeFramework) { this.setFramework('default', true); }\r\n return this.activeFramework.framework;\r\n }\r\n\r\n public getFrameworkList():{name:string,text:string}[] {\r\n return this.frameworks.map(fw=>{\r\n return {name:fw.name,text:fw.text};\r\n })\r\n \r\n }\r\n\r\n public getFrameworkWidgets(): any {\r\n return this.activeFramework.widgets || {};\r\n }\r\n\r\n \r\n\r\n public getFrameworkStylesheets(load: boolean = this.loadExternalAssets): string[] {\r\n return (load && this.activeFramework.stylesheets) || [];\r\n }\r\n\r\n public getFrameworkScripts(load: boolean = this.loadExternalAssets): string[] {\r\n return (load && this.activeFramework.scripts) || [];\r\n }\r\n\r\n //applies to CssFramework classes\r\n public getFrameworkConfig(existingFramework?:any): any {\r\n let actFramework:Framework& { [key: string]: any; }=existingFramework||this.activeFramework;\r\n return actFramework.config;\r\n }\r\n\r\n //this will load the list of assets to be loaded at runtime in case the dependent framework\r\n //scripts and styles are include locally with the parent app\r\n public getFrameworkAssetConfig(existingFramework?:any,useAssetRelPath=true):Promise<{stylesheets:string[],scripts:string[]}>{\r\n let actFramework:Framework& { [key: string]: any; }=existingFramework||this.activeFramework;\r\n //TODO move this into config\r\n const assetConfigPath = `assets/${actFramework.name}/cssframework`\r\n const assetConfigURL = `${assetConfigPath}/assets.json`;\r\n let subs=this.http\r\n .get(assetConfigURL, { responseType: 'text' })\r\n //.subscribe(assetConfig => {\r\n // assetConfig\r\n //})\r\n \r\n return lastValueFrom(subs).then(assetCfgText=>{\r\n let assetCfg=JSON.parse(assetCfgText);\r\n if(useAssetRelPath){\r\n assetCfg.stylesheets=assetCfg.stylesheets.map(styleLink=>{\r\n //ignore relative path if url starts with known protocol or //\r\n let nonRelPrefixes=[\"/\",\"//\",\"http:\",\"https:\"];//\"//\" list for completeness \r\n let isNonRel=false;\r\n nonRelPrefixes.forEach(prefix=>{\r\n isNonRel=isNonRel||styleLink.indexOf(prefix)==0;\r\n })\r\n if(isNonRel){\r\n return styleLink;\r\n }\r\n return `${assetConfigPath}/${styleLink}`;\r\n })\r\n assetCfg.scripts=assetCfg.scripts.map(scriptLink=>{\r\n return `${assetConfigPath}/${scriptLink}`;\r\n })\r\n } \r\n return assetCfg\r\n });\r\n }\r\n\r\n //applies to CssFramework classes\r\n public getFrameworkThemes():{name:string,text:string}[] {\r\n let cssfwConfig=this.getFrameworkConfig();\r\n let themes;\r\n if(cssfwConfig){\r\n themes=cssfwConfig?.widgetstyles?.__themes__||[]\r\n }\r\n return themes\r\n }\r\n\r\n //applies to CssFramework classes\r\n public requestThemeChange(name:string,validateThemeExists:boolean=false,existingFramework?:any){\r\n let actFramework:Framework& { [key: string]: any; }=existingFramework||this.activeFramework;\r\n if(actFramework.requestThemeChange){\r\n if(validateThemeExists){ \r\n let themes=this.getFrameworkThemes();\r\n let foundThemes=themes.filter(thm=>{return thm.name==name});\r\n if(!foundThemes|| foundThemes.length==0){\r\n return false;\r\n }\r\n }\r\n actFramework.requestThemeChange(name);\r\n return true;\r\n }\r\n }\r\n //applies to CssFramework classes\r\n public getActiveTheme(existingFramework?:any):{name:string,text:string}{\r\n let actFramework:Framework& { [key: string]: any; }=existingFramework||this.activeFramework;\r\n if(actFramework.getActiveTheme){\r\n return actFramework.getActiveTheme();\r\n }\r\n }\r\n\r\n //applies to CssFramework classes\r\n public registerTheme(newTheme:{name:string,text:string},existingFramework?:any):boolean{\r\n let actFramework:Framework& { [key: string]: any; }=existingFramework||this.activeFramework;\r\n if(actFramework.registerTheme){\r\n return actFramework.registerTheme(newTheme);\r\n }\r\n }\r\n\r\n //applies to CssFramework classes\r\n public unregisterTheme(name:string,existingFramework?:any):boolean{\r\n let actFramework:Framework& { [key: string]: any; }=existingFramework||this.activeFramework;\r\n if(actFramework.registerTheme){\r\n return actFramework.unregisterTheme(name);\r\n }\r\n }\r\n}\r\n","import { Component, inject, input, OnDestroy, OnInit } from '@angular/core';\r\nimport { AbstractControl } from '@angular/forms';\r\nimport { FrameworkLibraryService } from '../framework-library/framework-library.service';\r\nimport { JsonSchemaFormService } from '../json-schema-form.service';\r\nimport { buildTitleMap, isArray } from '../shared';\r\n\r\n//component created as a fallback for the checkbox/sortabljs issue\r\n//its meant to display a select as a checkbox\r\n@Component({\r\n // tslint:disable-next-line:component-selector\r\n selector: 'selectcheckbox-widget',\r\n template: `\r\n <div \r\n [class]=\"options?.htmlClass || ''\">\r\n <select *ngIf=\"boundControl\"\r\n [attr.aria-describedby]=\"'control' + layoutNode()?._id + 'Status'\"\r\n [attr.readonly]=\"options?.readonly ? 'readonly' : null\"\r\n [attr.required]=\"options?.required\"\r\n [class]=\" frameworkStyles[activeFramework].selectClass\"\r\n [multiple]=\"true\"\r\n [id]=\"'control' + layoutNode()?._id\"\r\n [name]=\"controlName\"\r\n [ngModel]=\"selectValue\" \r\n >\r\n <ng-template ngFor let-selectItem [ngForOf]=\"selectList\">\r\n <option *ngIf=\"!isArray(selectItem?.items)\"\r\n [class]=\"frameworkStyles[activeFramework].optionClass\"\r\n [class.active]=\"selectItem?.value === controlValue\"\r\n [class.unchecked-notusing]=\"selectItem?.value != controlValue\"\r\n [value]=\"selectItem?.value\"\r\n (click)=\"onSelectClicked($event)\"\r\n type=\"checkbox\"\r\n >\r\n </option>\r\n <!--NB the text is out of the option element to display besides the checkbox-->\r\n <span [innerHTML]=\"selectItem?.name\"></span>\r\n </ng-template>\r\n </select>\r\n <select *ngIf=\"!boundControl\"\r\n [attr.aria-describedby]=\"'control' + layoutNode()?._id + 'Status'\"\r\n [attr.readonly]=\"options?.readonly ? 'readonly' : null\"\r\n [attr.required]=\"options?.required\"\r\n [class]=\"frameworkStyles[activeFramework].selectClass +' select-box'\"\r\n [multiple]=\"true\"\r\n [disabled]=\"controlDisabled\"\r\n [id]=\"'control' + layoutNode()?._id\"\r\n [name]=\"controlName\"\r\n (change)=\"updateValue($event)\">\r\n <ng-template ngFor let-selectItem [ngForOf]=\"selectList\">\r\n <option *ngIf=\"!isArray(selectItem?.items)\"\r\n [selected]=\"selectItem?.value === controlValue\"\r\n [class]=\"frameworkStyles[activeFramework].optionClass\"\r\n [class.checked-notusing]=\"selectItem?.value === controlValue\"\r\n [class.unchecked-notusing]]=\"selectItem?.value != controlValue\"\r\n [value]=\"selectItem?.value\"\r\n type=\"checkbox\">\r\n </option>\r\n <!--NB the text is out of the option element to display besides the checkbox-->\r\n <span [innerHTML]=\"selectItem?.name\"></span>\r\n </ng-template>\r\n </select>\r\n \r\n </div>`,\r\n styles:[`\r\n /* Style the select element */\r\n .select-box {\r\n font-size: 16px;\r\n border: none;\r\n appearance: none;\r\n -webkit-appearance: none;\r\n -moz-appearance: none;\r\n height: 25px; /*Height equal to the size of a single option */\r\n overflow: hidden; /* Hide scrollbars */\r\n text-overflow: ellipsis; /* For overflowing text inside options */\r\n background-color: white; /* Set background to white */\r\n color: black; /* Ensure text is black */\r\n /* White gradient background */\r\n /*\r\n background-image: linear-gradient(0deg, white 0%, white 100%); \r\n */\r\n background-color:transparent;\r\n }\r\n\r\n /* Remove the default focus outline */\r\n .select-box:focus {\r\n outline: none;\r\n }\r\n\r\n /* Style the option element */\r\n .select-option {\r\n font-size: 20px; /* Adjust size of the checkbox */\r\n color: black; /* Ensure text color is black */\r\n background-color: white; /* Ensure background is white */\r\n display:inline-block;\r\n }\r\n\r\n /* Empty box when unchecked */\r\n .unchecked::before {\r\n content: '☐'; /* Empty box Unicode */\r\n left: 5px;\r\n top: 50%;\r\n transform: translateY(-50%);\r\n font-size: 30px; /* Adjust size */\r\n }\r\n\r\n /* Checked box when selected */\r\n .checked::before {\r\n content: '☑'; /* Checked box with tick Unicode */\r\n left: 5px;\r\n top: 50%;\r\n transform: translateY(-50%);\r\n font-size: 30px;\r\n }\r\n\r\n /* Maintain the text and background color when the option is selected */\r\n .select-option:checked {\r\n background-image: linear-gradient(0deg, white 0%, white 100%);\r\n color: black;\r\n }\r\n\r\n /* Style the select element when focused */\r\n .select-box[multiple]:focus {\r\n /*\r\n background-image: linear-gradient(0deg, white 0%, white 100%);\r\n */\r\n background-color:transparent;\r\n color: blue;\r\n -webkit-text-fill-color: black;\r\n }\r\n \r\n .display-inline-block{\r\n display:inline-block;\r\n }\r\n\r\n .bs4-option, .bs3-option{\r\n width: 14px;\r\n height: 14px;\r\n border: solid 1px;\r\n color: darkgrey;\r\n min-block-size: auto;\r\n border-radius: 3px;\r\n \r\n }\r\n .bs4-option:checked[type=checkbox], .bs3-option:checked[type=checkbox] {\r\n \r\n background-image: url(data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3C!--%20License%3A%20MIT.%20Made%20by%20jaynewey%3A%20https%3A%2F%2Fgithub.com%2Fjaynewey%2Fcharm-icons%20--%3E%3Csvg%20viewBox%3D%220%200%2016%2016%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20fill%3D%22none%22%20stroke%3D%22%23000000%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20stroke-width%3D%222.5%22%3E%3Cpolyline%20points%3D%224%208.75%2C6.25%2012.25%2C13.25%203.5%22%2F%3E%3C%2Fsvg%3E);\r\n background-color:darkturquoise;\r\n }\r\n \r\n `],\r\n standalone: false\r\n})\r\nexport class SelectCheckboxComponent implements OnInit, OnDestroy {\r\n private jsf = inject(JsonSchemaFormService);\r\n private jsfFLService = inject(FrameworkLibraryService);\r\n\r\n formControl: AbstractControl;\r\n controlName: string;\r\n controlValue: any;\r\n controlDisabled = false;\r\n boundControl = false;\r\n options: any;\r\n selectList: any[] = [];\r\n selectListFlatGroup: any[] = [];\r\n selectValue: any;\r\n isArray = isArray;\r\n readonly layoutNode = input<any>(undefined);\r\n readonly layoutIndex = input<number[]>(undefined);\r\n readonly dataIndex = input<number[]>(undefined);\r\n\r\n frameworkStyles={\r\n daisyui:{selectClass:\"select-box\",optionClass:\"checkbox tw:dui-checkbox\",optionChecked:\"active\",optionUnchecked:\"\"},\r\n \"bootstrap-3\":{selectClass:\"select-box\",optionClass:\"bs3-option checkbox display-inline-block\",optionChecked:\"active\",optionUnchecked:\"\"},\r\n \"bootstrap-4\":{selectClass:\"select-box\",optionClass:\"bs4-option checkbox display-inline-block\",optionChecked:\"active\",optionUnchecked:\"\"},\r\n \"bootstrap-5\":{selectClass:\" select-box\",optionClass:\"form-check-input display-inline-block\",optionChecked:\"active\",optionUnchecked:\"\"},\r\n //\"material-design\":{selectClass:\" \",optionClass:\" \"}\r\n\r\n }\r\n\r\n activeFramework:string;\r\n\r\n ngOnInit() {\r\n this.options = this.layoutNode().options || {};\r\n this.activeFramework= this.jsfFLService.activeFramework.name;\r\n this.selectList = buildTitleMap(\r\n //this.options.titleMap || this.options.enumNames,\r\n //TODO review-title is set to null in the setTitle() method of CssFrameworkComponent\r\n this.options.enumNames || (this.options?.title && [this.options?.title]) \r\n || [this.layoutNode().name],\r\n //this.options.enum, \r\n [true],\r\n //make required true to avoid creating 'none' select option\r\n true, !!this.options.flatList\r\n );\r\n\r\n\r\n\r\n\r\n //the selectListFlatGroup array will be used to update the formArray values\r\n //while the selectList array will be bound to the form select\r\n //as either a grouped select or a flat select\r\n /*\r\n this.selectListFlatGroup = buildTitleMap(\r\n this.options.titleMap || this.options.enumNames,\r\n this.options.enum, !!this.options.required, true\r\n )\r\n */\r\n \r\n this.jsf.initializeControl(this);\r\n this.selectValue=[this.controlValue];\r\n }\r\n\r\n deselectAll() {\r\n this.selectListFlatGroup.forEach(selItem => {\r\n selItem.checked = false;\r\n })\r\n }\r\n\r\n updateValue(event) {\r\n this.options.showErrors = true;\r\n this.controlValue=this.selectValue[0];\r\n this.jsf.updateValue(this, this.controlValue);\r\n }\r\n\r\n onSelectClicked($event){\r\n this.selectValue=this.selectValue && this.selectValue[0]?[false]:[true];\r\n this.controlValue=this.selectValue[0];\r\n this.jsf.updateValue(this, this.controlValue);\r\n }\r\n\r\n ngOnDestroy() {\r\n let nullVal=this.options.multiple?[null]:null;\r\n this.formControl.reset(nullVal)\r\n this.controlValue=null;\r\n }\r\n}\r\n","import { Component, OnInit, input, inject } from '@angular/core';\r\nimport { JsonSchemaFormService } from '../json-schema-form.service';\r\n\r\n\r\n@Component({\r\n // tslint:disable-next-line:component-selector\r\n selector: 'tab-widget',\r\n template: `\r\n <div [class]=\"options?.htmlClass || ''\">\r\n <root-widget\r\n [dataIndex]=\"dataIndex()\"\r\n [layoutIndex]=\"layoutIndex()\"\r\n [layout]=\"layoutNode().items\"></root-widget>\r\n </div>`,\r\n standalone: false\r\n})\r\nexport class TabComponent implements OnInit {\r\n private jsf = inject(JsonSchemaFormService);\r\n\r\n options: any;\r\n readonly layoutNode = input<any>(undefined);\r\n readonly layoutIndex = input<number[]>(undefined);\r\n readonly dataIndex = input<number[]>(undefined);\r\n\r\n ngOnInit() {\r\n this.options = this.layoutNode().options || {};\r\n }\r\n}\r\n","import { Directive, ElementRef, NgZone, OnDestroy, OnInit, inject, input } from '@angular/core';\r\nimport { Subscription } from 'rxjs';\r\nimport { JsonSchemaFormService } from '../json-schema-form.service';\r\n\r\n\r\n/**\r\n * OrderableDirective\r\n *\r\n * Enables array elements to be reordered by dragging and dropping.\r\n *\r\n * Only works for arrays that have at least two elements.\r\n *\r\n * Also detects arrays-within-arrays, and correctly moves either\r\n * the child array element or the parent array element,\r\n * depending on the drop targert.\r\n *\r\n * Listeners for movable element being dragged:\r\n * - dragstart: add 'dragging' class to element, set effectAllowed = 'move'\r\n * - dragover: set dropEffect = 'move'\r\n * - dragend: remove 'dragging' class from element\r\n *\r\n * Listeners for stationary items being dragged over:\r\n * - dragenter: add 'drag-target-...' classes to element\r\n * - dragleave: remove 'drag-target-...' classes from element\r\n * - drop: remove 'drag-target-...' classes from element, move dropped array item\r\n */\r\n@Directive({\r\n // tslint:disable-next-line:directive-selector\r\n selector: '[orderable]',\r\n standalone: false\r\n})\r\nexport class OrderableDirective implements OnInit,OnDestroy {\r\n\r\n private elementRef = inject(ElementRef);\r\n private jsf = inject(JsonSchemaFormService);\r\n private ngZone = inject(NgZone);\r\n\r\n arrayLayoutIndex: string;\r\n element: any;\r\n overParentElement = false;\r\n overChildElement = false;\r\n readonly orderable = input<boolean>(undefined);\r\n readonly layoutNode = input<any>(undefined);\r\n readonly layoutIndex = input<number[]>(undefined);\r\n readonly dataIndex = input<number[]>(undefined);\r\n\r\n private draggableStateSubscription: Subscription;\r\n ngOnInit() {\r\n const layoutIndex = this.layoutIndex();\r\n if (this.orderable() && this.layoutNode() && layoutIndex && this.dataIndex()) {\r\n this.element = this.elementRef.nativeElement;\r\n this.element.draggable = true;\r\n this.arrayLayoutIndex = 'move:' + layoutIndex.slice(0, -1).toString();\r\n\r\n this.ngZone.runOutsideAngular(() => {\r\n\r\n // Listeners for movable element being dragged:\r\n\r\n this.element.addEventListener('dragstart', (event) => {\r\n event.dataTransfer.effectAllowed = 'move';\r\n event.dataTransfer.setData('text', '');\r\n // Hack to bypass stupid HTML drag-and-drop dataTransfer protection\r\n // so drag source info will be available on dragenter\r\n const sourceArrayIndex = this.dataIndex()[this.dataIndex().length - 1];\r\n sessionStorage.setItem(this.arrayLayoutIndex, sourceArrayIndex + '');\r\n });\r\n\r\n this.element.addEventListener('dragover', (event) => {\r\n if (event.preventDefault) { event.preventDefault(); }\r\n event.dataTransfer.dropEffect = 'move';\r\n return false;\r\n });\r\n\r\n // Listeners for stationary items being dragged over:\r\n\r\n this.element.addEventListener('dragenter', (event) => {\r\n // Part 1 of a hack, inspired by Dragster, to simulate mouseover and mouseout\r\n // behavior while dragging items - http://bensmithett.github.io/dragster/\r\n if (this.overParentElement) {\r\n return this.overChildElement = true;\r\n } else {\r\n this.overParentElement = true;\r\n }\r\n\r\n const sourceArrayIndex = sessionStorage.getItem(this.arrayLayoutIndex);\r\n if (sourceArrayIndex !== null) {\r\n if (this.dataIndex()[this.dataIndex().length - 1] < +sourceArrayIndex) {\r\n this.element.classList.add('drag-target-top');\r\n } else if (this.dataIndex()[this.dataIndex().length - 1] > +sourceArrayIndex) {\r\n this.element.classList.add('drag-target-bottom');\r\n }\r\n }\r\n });\r\n\r\n this.element.addEventListener('dragleave', (event) => {\r\n // Part 2 of the Dragster hack\r\n if (this.overChildElement) {\r\n this.overChildElement = false;\r\n } else if (this.overParentElement) {\r\n this.overParentElement = false;\r\n }\r\n\r\n const sourceArrayIndex = sessionStorage.getItem(this.arrayLayoutIndex);\r\n if (!this.overParentElement && !this.overChildElement && sourceArrayIndex !== null) {\r\n this.element.classList.remove('drag-target-top');\r\n this.element.classList.remove('drag-target-bottom');\r\n }\r\n });\r\n\r\n this.element.addEventListener('drop', (event) => {\r\n this.element.classList.remove('drag-target-top');\r\n this.element.classList.remove('drag-target-bottom');\r\n // Confirm that drop target is another item in the same array as source item\r\n const sourceArrayIndex = sessionStorage.getItem(this.arrayLayoutIndex);\r\n const destArrayIndex = this.dataIndex()[this.dataIndex().length - 1];\r\n if (sourceArrayIndex !== null && +sourceArrayIndex !== destArrayIndex) {\r\n // Move array item\r\n this.jsf.moveArrayItem(this, +sourceArrayIndex, destArrayIndex);\r\n }\r\n sessionStorage.removeItem(this.arrayLayoutIndex);\r\n return false;\r\n });\r\n\r\n });\r\n // Subscribe to the draggable state\r\n this.draggableStateSubscription = this.jsf.draggableState$.subscribe(\r\n (value) => {\r\n this.element.draggable = value;\r\n }\r\n );\r\n }\r\n }\r\n ngOnDestroy(): void {\r\n if (this.draggableStateSubscription) {\r\n this.draggableStateSubscription.unsubscribe();\r\n }\r\n }\r\n}\r\n","import { AddReferenceComponent } from './add-reference.component';\r\nimport { ButtonComponent } from './button.component';\r\nimport { CheckboxComponent } from './checkbox.component';\r\nimport { CheckboxesComponent } from './checkboxes.component';\r\nimport { FileComponent } from './file.component';\r\nimport { HiddenComponent } from './hidden.component';\r\nimport { InputComponent } from './input.component';\r\nimport { ItemTitleComponent } from './item-title.component';\r\nimport { MessageComponent } from './message.component';\r\nimport { NoneComponent } from './none.component';\r\nimport { NumberComponent } from './number.component';\r\nimport { OneOfComponent } from './one-of.component';\r\nimport { RadiosComponent } from './radios.component';\r\nimport { RootComponent } from './root.component';\r\nimport { SectionComponent } from './section.component';\r\nimport { SelectFrameworkComponent } from './select-framework.component';\r\nimport { SelectWidgetComponent } from './select-widget.component';\r\nimport { SelectComponent } from './select.component';\r\nimport { SelectCheckboxComponent } from './selectcheckbox.component';\r\nimport { SubmitComponent } from './submit.component';\r\nimport { TabComponent } from './tab.component';\r\nimport { TabsComponent } from './tabs.component';\r\nimport { TemplateComponent } from './template.component';\r\nimport { TextareaComponent } from './textarea.component';\r\n\r\nexport const BASIC_WIDGETS = [\r\n AddReferenceComponent, OneOfComponent, ButtonComponent, CheckboxComponent,\r\n CheckboxesComponent, FileComponent, HiddenComponent, InputComponent,\r\n MessageComponent, NoneComponent, NumberComponent, RadiosComponent,\r\n RootComponent, SectionComponent, SelectComponent, SelectFrameworkComponent,\r\n SelectWidgetComponent, SubmitComponent, TabComponent, TabsComponent,\r\n TemplateComponent, TextareaComponent,SelectCheckboxComponent,ItemTitleComponent\r\n];\r\n\r\nexport { AddReferenceComponent } from './add-reference.component';\r\nexport { ButtonComponent } from './button.component';\r\nexport { CheckboxComponent } from './checkbox.component';\r\nexport { CheckboxesComponent } from './checkboxes.component';\r\nexport { ElementAttributeDirective } from './element-attribute.directive';\r\nexport { FileComponent } from './file.component';\r\nexport { HiddenComponent } from './hidden.component';\r\nexport { InputComponent } from './input.component';\r\nexport { ItemTitleComponent } from './item-title.component';\r\nexport { MessageComponent } from './message.component';\r\nexport { NoneComponent } from './none.component';\r\nexport { NumberComponent } from './number.component';\r\nexport { OneOfComponent } from './one-of.component';\r\nexport { OrderableDirective } from './orderable.directive';\r\nexport { RadiosComponent } from './radios.component';\r\nexport { RootComponent } from './root.component';\r\nexport { SectionComponent } from './section.component';\r\nexport { SelectFrameworkComponent } from './select-framework.component';\r\nexport { SelectWidgetComponent } from './select-widget.component';\r\nexport { SelectComponent } from './select.component';\r\nexport { SelectCheckboxComponent } from './selectcheckbox.component';\r\nexport { StopPropagationDirective } from './stop-propagation.directive';\r\nexport { SubmitComponent } from './submit.component';\r\nexport { TabComponent } from './tab.component';\r\nexport { TabsComponent } from './tabs.component';\r\nexport { TemplateComponent } from './template.component';\r\nexport { TextareaComponent } from './textarea.component';\r\nexport { WidgetLibraryService } from './widget-library.service';\r\n\r\n","import { DragDropModule } from '@angular/cdk/drag-drop';\r\nimport { CommonModule } from '@angular/common';\r\nimport { NgModule } from '@angular/core';\r\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\r\nimport { ElementAttributeDirective } from './element-attribute.directive';\r\nimport { BASIC_WIDGETS } from './index';\r\nimport { OrderableDirective } from './orderable.directive';\r\nimport { StopPropagationDirective } from './stop-propagation.directive';\r\n\r\n@NgModule({\r\n imports: [CommonModule, FormsModule, ReactiveFormsModule,DragDropModule\r\n ],\r\n declarations: [...BASIC_WIDGETS, OrderableDirective,ElementAttributeDirective,StopPropagationDirective],\r\n exports: [...BASIC_WIDGETS, OrderableDirective,ElementAttributeDirective,StopPropagationDirective]\r\n})\r\nexport class WidgetLibraryModule {\r\n}\r\n","import { CommonModule } from '@angular/common';\r\nimport { Framework } from './framework';\r\nimport { NgModule } from '@angular/core';\r\nimport { NoFramework } from './no.framework';\r\nimport { NoFrameworkComponent } from './no-framework.component';\r\nimport { WidgetLibraryModule } from '../widget-library/widget-library.module';\r\n\r\n// No framework - plain HTML controls (styles from form layout only)\r\n\r\n@NgModule({\r\n imports: [CommonModule, WidgetLibraryModule],\r\n declarations: [NoFrameworkComponent],\r\n exports: [NoFrameworkComponent],\r\n providers: [\r\n { provide: Framework, useClass: NoFramework, multi: true }\r\n ]\r\n})\r\nexport class NoFrameworkModule { }\r\n","import cloneDeep from 'lodash/cloneDeep';\r\nimport isEqual from 'lodash/isEqual';\r\n\r\nimport { ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, OnChanges, OnDestroy, OnInit, SimpleChanges, forwardRef, inject, input, output } from '@angular/core';\r\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\r\nimport { Subject, Subscription } from 'rxjs';\r\nimport { takeUntil } from 'rxjs/operators';\r\nimport { FrameworkLibraryService } from './framework-library/framework-library.service';\r\nimport { JsonSchemaFormService } from './json-schema-form.service';\r\nimport { convertSchemaToDraft6 } from './shared/convert-schema-to-draft6.function';\r\nimport { resolveSchemaReferences } from './shared/json-schema.functions';\r\nimport { JsonPointer } from './shared/jsonpointer.functions';\r\nimport { compareObjectArraySizes, forEach, hasOwn } from './shared/utility.functions';\r\nimport {\r\n hasValue,\r\n inArray,\r\n isArray,\r\n isEmpty,\r\n isObject\r\n} from './shared/validator.functions';\r\nimport { WidgetLibraryService } from './widget-library/widget-library.service';\r\n\r\nexport const JSON_SCHEMA_FORM_VALUE_ACCESSOR: any = {\r\n provide: NG_VALUE_ACCESSOR,\r\n useExisting: forwardRef(() => JsonSchemaFormComponent),\r\n multi: true,\r\n};\r\n\r\n/**\r\n * @module 'JsonSchemaFormComponent' - Angular JSON Schema Form\r\n *\r\n * Root module of the Angular JSON Schema Form client-side library,\r\n * an Angular library which generates an HTML form from a JSON schema\r\n * structured data model and/or a JSON Schema Form layout description.\r\n *\r\n * This library also validates input data by the user, using both validators on\r\n * individual controls to provide real-time feedback while the user is filling\r\n * out the form, and then validating the entire input against the schema when\r\n * the form is submitted to make sure the returned JSON data object is valid.\r\n *\r\n * This library is similar to, and mostly API compatible with:\r\n *\r\n * - JSON Schema Form's Angular Schema Form library for AngularJs\r\n * http://schemaform.io\r\n * http://schemaform.io/examples/bootstrap-example.html (examples)\r\n *\r\n * - Mozilla's react-jsonschema-form library for React\r\n * https://github.com/mozilla-services/react-jsonschema-form\r\n * https://mozilla-services.github.io/react-jsonschema-form (examples)\r\n *\r\n * - Joshfire's JSON Form library for jQuery\r\n * https://github.com/joshfire/jsonform\r\n * http://ulion.github.io/jsonform/playground (examples)\r\n *\r\n * This library depends on:\r\n * - Angular (obviously) https://angular.io\r\n * - lodash, JavaScript utility library https://github.com/lodash/lodash\r\n * - ajv, Another JSON Schema validator https://github.com/epoberezkin/ajv\r\n *\r\n * In addition, the Example Playground also depends on:\r\n * - brace, Browserified Ace editor http://thlorenz.github.io/brace\r\n */\r\n@Component({\r\n // tslint:disable-next-line:component-selector\r\n selector: 'json-schema-form',\r\n templateUrl: './json-schema-form.component.html',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n // Adding 'JsonSchemaFormService' here, instead of in the module,\r\n // creates a separate instance of the service for each component\r\n providers: [JsonSchemaFormService, JSON_SCHEMA_FORM_VALUE_ACCESSOR],\r\n standalone: false\r\n})\r\nexport class JsonSchemaFormComponent implements ControlValueAccessor, OnChanges, OnInit,OnDestroy {\r\n private changeDetector = inject(ChangeDetectorRef);\r\n private frameworkLibrary = inject(FrameworkLibraryService);\r\n private widgetLibrary = inject(WidgetLibraryService);\r\n jsf = inject(JsonSchemaFormService);\r\n\r\n // TODO: quickfix to avoid subscribing twice to the same emitters\r\n private unsubscribeOnActivateForm$ = new Subject<void>();\r\n\r\n debugOutput: any; // Debug information, if requested\r\n formValueSubscription: any = null;\r\n formInitialized = false;\r\n objectWrap = false; // Is non-object input schema wrapped in an object?\r\n\r\n formValuesInput: string; // Name of the input providing the form data\r\n previousInputs: { // Previous input values, to detect which input triggers onChanges\r\n schema: any, layout: any[], data: any, options: any, framework: any | string,\r\n widgets: any, form: any, model: any, JSONSchema: any, UISchema: any,\r\n formData: any, loadExternalAssets: boolean, debug: boolean,ajvOptions:any\r\n } = {\r\n schema: null, layout: null, data: null, options: null, framework: null,\r\n widgets: null, form: null, model: null, JSONSchema: null, UISchema: null,\r\n formData: null, loadExternalAssets: null, debug: null,ajvOptions:null\r\n };\r\n\r\n // Recommended inputs\r\n readonly schema = input<any>(undefined); // The JSON Schema\r\n readonly layout = input<any[]>(undefined); // The form layout\r\n readonly data = input<any>(undefined); // The form data\r\n readonly options = input<any>(undefined); // The global form options\r\n readonly framework = input<any | string>(undefined); // The framework to load\r\n readonly widgets = input<any>(undefined); // Any custom widgets to load\r\n\r\n // Alternate combined single input\r\n readonly form = input<any>(undefined); // For testing, and JSON Schema Form API compatibility\r\n\r\n // Angular Schema Form API compatibility input\r\n readonly model = input<any>(undefined); // Alternate input for form data\r\n\r\n // React JSON Schema Form API compatibility inputs\r\n readonly JSONSchema = input<any>(undefined); // Alternate input for JSON Schema\r\n readonly UISchema = input<any>(undefined); // UI schema - alternate form layout format\r\n readonly formData = input<any>(undefined); // Alternate input for form data\r\n\r\n readonly ngModel = input<any>(undefined); // Alternate input for Angular forms\r\n\r\n readonly language = input<string>(undefined); // Language\r\n\r\n // Development inputs, for testing and debugging\r\n readonly loadExternalAssets = input<boolean>(undefined); // Load external framework assets?\r\n readonly debug = input<boolean>(undefined); // Show debug information?\r\n\r\n readonly theme = input<string>(undefined); // Theme\r\n\r\n readonly ajvOptions = input<any>(undefined); // ajvOptions\r\n\r\n private ajvInstanceName:string;\r\n\r\n @Input()\r\n get value(): any {\r\n return this.objectWrap ? this.jsf.data['1'] : this.jsf.data;\r\n }\r\n set value(value: any) {\r\n this.setFormValues(value, false);\r\n }\r\n\r\n // Outputs\r\n readonly onChanges = output<any>(); // Live unvalidated internal form data\r\n readonly onSubmit = output<any>(); // Complete validated form data\r\n readonly isValid = output<boolean>(); // Is current data valid?\r\n readonly validationErrors = output<any>(); // Validation errors (if any)\r\n readonly formSchema = output<any>(); // Final schema used to create form\r\n readonly formLayout = output<any>(); // Final layout used to create form\r\n\r\n // Outputs for possible 2-way data binding\r\n // Only the one input providing the initial form data will be bound.\r\n // If there is no inital data, input '{}' to activate 2-way data binding.\r\n // There is no 2-way binding if inital data is combined inside the 'form' input.\r\n readonly dataChange = output<any>();\r\n readonly modelChange = output<any>();\r\n readonly formDataChange = output<any>();\r\n readonly ngModelChange = output<any>();\r\n\r\n onChange: Function;\r\n onTouched: Function;\r\n\r\n //TODO-review,maybe use takeUntilDestroyed rxjs op\r\n dataChangesSubs:Subscription;\r\n statusChangesSubs:Subscription;\r\n isValidChangesSubs:Subscription;\r\n validationErrorChangesSubs:Subscription;\r\n ngOnDestroy(): void {\r\n this.dataChangesSubs?.unsubscribe();\r\n this.statusChangesSubs?.unsubscribe();\r\n this.isValidChangesSubs?.unsubscribe();\r\n this.validationErrorChangesSubs?.unsubscribe();\r\n this.dataChangesSubs=null;\r\n this.statusChangesSubs=null;\r\n this.isValidChangesSubs=null;\r\n this.validationErrorChangesSubs=null;\r\n }\r\n\r\n\r\n private getInputValue(inputKey:string){\r\n //TODO review if the value is meant to be a function and not a signal,\r\n //it might inadvertently be called!\r\n if(typeof this[inputKey]==\"function\"){\r\n return this[inputKey]();\r\n }\r\n return this[inputKey];\r\n }\r\n\r\n private resetScriptsAndStyleSheets() {\r\n document.querySelectorAll('.ajsf').forEach(element => element.remove());\r\n }\r\n private loadScripts(scriptList?:string[]) {\r\n const scripts = scriptList||this.frameworkLibrary.getFrameworkScripts();\r\n scripts.map(script => {\r\n const scriptTag: HTMLScriptElement = document.createElement('script');\r\n scriptTag.src = script;\r\n scriptTag.type = 'text/javascript';\r\n scriptTag.async = true;\r\n scriptTag.setAttribute('class', 'ajsf');\r\n document.getElementsByTagName('head')[0].appendChild(scriptTag);\r\n });\r\n }\r\n private loadStyleSheets(styleList?:string[]) {\r\n const stylesheets = styleList||this.frameworkLibrary.getFrameworkStylesheets();\r\n stylesheets.map(stylesheet => {\r\n const linkTag: HTMLLinkElement = document.createElement('link');\r\n linkTag.rel = 'stylesheet';\r\n linkTag.href = stylesheet;\r\n linkTag.setAttribute('class', 'ajsf');\r\n document.getElementsByTagName('head')[0].appendChild(linkTag);\r\n });\r\n }\r\n private loadAssets() {\r\n this.frameworkLibrary.getFrameworkAssetConfig().then(assetCfg=>{\r\n this.resetScriptsAndStyleSheets();\r\n this.loadScripts(assetCfg.scripts);\r\n this.loadStyleSheets(assetCfg.stylesheets);\r\n }).catch(err=>{\r\n console.log(err);\r\n this.resetScriptsAndStyleSheets();\r\n this.loadScripts();\r\n this.loadStyleSheets();\r\n })\r\n\r\n }\r\n ngOnInit() {\r\n this.updateForm();\r\n this.loadAssets();\r\n }\r\n\r\n ngOnChanges(changes: SimpleChanges) {\r\n this.updateForm();\r\n // Check if there's changes in Framework then load assets if that's the\r\n if (changes.framework) {\r\n if (!changes.framework.isFirstChange() &&\r\n (changes.framework.previousValue !== changes.framework.currentValue)) {\r\n this.loadAssets();\r\n }\r\n }\r\n }\r\n\r\n writeValue(value: any) {\r\n this.setFormValues(value, false);\r\n if (!this.formValuesInput) { this.formValuesInput = 'ngModel'; }\r\n }\r\n\r\n registerOnChange(fn: Function) {\r\n this.onChange = fn;\r\n }\r\n\r\n registerOnTouched(fn: Function) {\r\n this.onTouched = fn;\r\n }\r\n\r\n //see note\r\n //https://angular.io/guide/update-to-version-15#v15-bc-06\r\n setDisabledState(isDisabled: boolean) {\r\n if (this.jsf.formOptions.formDisabled !== !!isDisabled) {\r\n this.jsf.formOptions.formDisabled = !!isDisabled;\r\n this.initializeForm();\r\n }\r\n }\r\n\r\n updateForm() {\r\n let changedData;\r\n const language = this.language();\r\n if (!this.formInitialized || !this.formValuesInput ||\r\n (language && language !== this.jsf.language)\r\n \r\n ) {\r\n this.initializeForm();\r\n } else {\r\n if (language && language !== this.jsf.language) {\r\n this.jsf.setLanguage(language);\r\n }\r\n\r\n // Get names of changed inputs\r\n let changedInput = Object.keys(this.previousInputs)\r\n .filter(input => this.previousInputs[input] !== this.getInputValue(input));\r\n let resetFirst = true;\r\n if (changedInput.length === 1 && changedInput[0] === 'form' &&\r\n this.formValuesInput.startsWith('form.')\r\n ) {\r\n // If only 'form' input changed, get names of changed keys\r\n changedInput = Object.keys(this.previousInputs.form || {})\r\n .filter(key => !isEqual(this.previousInputs.form[key], this.form()[key]))\r\n .map(key => `form.${key}`);\r\n resetFirst = false;\r\n }\r\n\r\n // If only input values have changed, update the form values\r\n if (changedInput.length === 1 && changedInput[0] === this.formValuesInput) {\r\n \r\n if (this.formValuesInput.indexOf('.') === -1) {\r\n changedData=this.getInputValue(this.formValuesInput)\r\n //this[this.formValuesInput];\r\n } else {\r\n const [input, key] = this.formValuesInput.split('.');\r\n changedData=this.getInputValue(input)[key];\r\n }\r\n //TODO -review if any of the the array sizes changed then the \r\n //layout array sizes need to be resynced to match\r\n //-for now jsf.adjustLayout doesnt seem to work with nested arrays\r\n //so entire form is reinited \r\n let arraySizesChanged=!compareObjectArraySizes(changedData,this.jsf.data,);\r\n if(arraySizesChanged){\r\n this.initializeForm(changedData);\r\n if (this.onChange) { this.onChange(changedData); }\r\n if (this.onTouched) { this.onTouched(changedData); }\r\n }else{\r\n this.setFormValues(changedData, resetFirst);\r\n } \r\n // If anything else has changed, re-render the entire form\r\n } else if (changedInput.length) {\r\n this.initializeForm(changedData);\r\n if (this.onChange) { this.onChange(this.jsf.formValues); }\r\n if (this.onTouched) { this.onTouched(this.jsf.formValues); }\r\n }\r\n \r\n //set framework theme\r\n const theme = this.theme();\r\n if (theme && theme !== this.frameworkLibrary.getActiveTheme()?.name) {\r\n this.frameworkLibrary.requestThemeChange(theme);\r\n }\r\n\r\n // Update previous inputs\r\n Object.keys(this.previousInputs)\r\n .filter(input => this.previousInputs[input] !== this.getInputValue(input))\r\n .forEach(input => this.previousInputs[input] = this.getInputValue(input));\r\n }\r\n }\r\n \r\n\r\n setFormValues(formValues: any, resetFirst = true,emitFormEvent=true,usePatch=true) {\r\n\r\n if (formValues) {\r\n const newFormValues = this.objectWrap ? formValues['1'] : formValues;\r\n if (!this.jsf.formGroup) {\r\n this.jsf.formValues = formValues;\r\n this.activateForm();\r\n } else if (resetFirst) {//changed to avoid reset events\r\n this.jsf.formGroup.reset({},{emitEvent:emitFormEvent});\r\n }\r\n if (this.jsf.formGroup) {//changed to avoid reset events\r\n \r\n if(usePatch){\r\n this.jsf.formGroup.patchValue(newFormValues,{emitEvent:emitFormEvent});\r\n }else{\r\n this.jsf.formGroup.setValue(newFormValues,{emitEvent:emitFormEvent});\r\n }\r\n \r\n }\r\n if (this.onChange) { this.onChange(newFormValues); }\r\n if (this.onTouched) { this.onTouched(newFormValues); }\r\n } else {\r\n this.jsf.formGroup.reset();\r\n }\r\n this.changeDetector.markForCheck();\r\n }\r\n\r\n submitForm() {\r\n const validData = this.jsf.validData;\r\n this.onSubmit.emit(this.objectWrap ? validData['1'] : validData);\r\n }\r\n\r\n /**\r\n * 'initializeForm' function\r\n *\r\n * - Update 'schema', 'layout', and 'formValues', from inputs.\r\n *\r\n * - Create 'schemaRefLibrary' and 'schemaRecursiveRefMap'\r\n * to resolve schema $ref links, including recursive $ref links.\r\n *\r\n * - Create 'dataRecursiveRefMap' to resolve recursive links in data\r\n * and corectly set output formats for recursively nested values.\r\n *\r\n * - Create 'layoutRefLibrary' and 'templateRefLibrary' to store\r\n * new layout nodes and formGroup elements to use when dynamically\r\n * adding form components to arrays and recursive $ref points.\r\n *\r\n * - Create 'dataMap' to map the data to the schema and template.\r\n *\r\n * - Create the master 'formGroupTemplate' then from it 'formGroup'\r\n * the Angular formGroup used to control the reactive form.\r\n */\r\n initializeForm(initialData?:any) {\r\n if (\r\n this.schema() || this.layout() || this.data() || this.form() || this.model() ||\r\n this.JSONSchema() || this.UISchema() || this.formData() || this.ngModel() ||\r\n this.jsf.data\r\n ) {\r\n // Reset all form values to defaults\r\n this.jsf.resetAllValues();\r\n this.initializeAjv();\r\n this.initializeOptions(); // Update options\r\n this.initializeSchema(); // Update schema, schemaRefLibrary,\r\n // schemaRecursiveRefMap, & dataRecursiveRefMap\r\n this.initializeLayout(); // Update layout, layoutRefLibrary,\r\n this.initializeData(); // Update formValues\r\n if(initialData){\r\n this.jsf.formValues=initialData;\r\n }\r\n this.activateForm(); // Update dataMap, templateRefLibrary,\r\n // formGroupTemplate, formGroup\r\n\r\n // Uncomment individual lines to output debugging information to console:\r\n // (These always work.)\r\n // console.log('loading form...');\r\n // console.log('schema', this.jsf.schema);\r\n // console.log('layout', this.jsf.layout);\r\n // console.log('options', this.options);\r\n // console.log('formValues', this.jsf.formValues);\r\n // console.log('formGroupTemplate', this.jsf.formGroupTemplate);\r\n // console.log('formGroup', this.jsf.formGroup);\r\n // console.log('formGroup.value', this.jsf.formGroup.value);\r\n // console.log('schemaRefLibrary', this.jsf.schemaRefLibrary);\r\n // console.log('layoutRefLibrary', this.jsf.layoutRefLibrary);\r\n // console.log('templateRefLibrary', this.jsf.templateRefLibrary);\r\n // console.log('dataMap', this.jsf.dataMap);\r\n // console.log('arrayMap', this.jsf.arrayMap);\r\n // console.log('schemaRecursiveRefMap', this.jsf.schemaRecursiveRefMap);\r\n // console.log('dataRecursiveRefMap', this.jsf.dataRecursiveRefMap);\r\n\r\n // Uncomment individual lines to output debugging information to browser:\r\n // (These only work if the 'debug' option has also been set to 'true'.)\r\n if (this.debug() || this.jsf.formOptions.debug) {\r\n const vars: any[] = [];\r\n // vars.push(this.jsf.schema);\r\n // vars.push(this.jsf.layout);\r\n // vars.push(this.options);\r\n // vars.push(this.jsf.formValues);\r\n // vars.push(this.jsf.formGroup.value);\r\n // vars.push(this.jsf.formGroupTemplate);\r\n // vars.push(this.jsf.formGroup);\r\n // vars.push(this.jsf.schemaRefLibrary);\r\n // vars.push(this.jsf.layoutRefLibrary);\r\n // vars.push(this.jsf.templateRefLibrary);\r\n // vars.push(this.jsf.dataMap);\r\n // vars.push(this.jsf.arrayMap);\r\n // vars.push(this.jsf.schemaRecursiveRefMap);\r\n // vars.push(this.jsf.dataRecursiveRefMap);\r\n this.debugOutput = vars.map(v => JSON.stringify(v, null, 2)).join('\\n');\r\n }\r\n this.formInitialized = true;\r\n }\r\n }\r\n\r\n /**\r\n * 'initializeAjv' function\r\n *\r\n * Initialize ajv from 'ajvOptions'\r\n */\r\n private initializeAjv() {\r\n const form = this.form();\r\n const ajvOptions=cloneDeep(this.ajvOptions())||\r\n (form && hasOwn(form, 'ajvOptions') && isObject(form.ajvOptions)\r\n &&cloneDeep(form.ajvOptions));\r\n if(ajvOptions){\r\n this.ajvInstanceName=this.jsf.createAndRegisterAjvInstance(ajvOptions).name;\r\n }\r\n }\r\n\r\n /**\r\n * 'initializeOptions' function\r\n *\r\n * Initialize 'options' (global form options) and set framework\r\n * Combine available inputs:\r\n * 1. options - recommended\r\n * 2. form.options - Single input style\r\n */\r\n private initializeOptions() {\r\n const language = this.language();\r\n if (language && language !== this.jsf.language) {\r\n this.jsf.setLanguage(language);\r\n }\r\n this.jsf.setOptions({ debug: !!this.debug() });\r\n let loadExternalAssets: boolean = this.loadExternalAssets() || false;\r\n let framework: any = this.framework() || 'default';\r\n const options = this.options();\r\n if (isObject(options)) {\r\n this.jsf.setOptions(options);\r\n loadExternalAssets = options.loadExternalAssets || loadExternalAssets;\r\n framework = options.framework || framework;\r\n }\r\n const form = this.form();\r\n if (isObject(form) && isObject(form.options)) {\r\n this.jsf.setOptions(form.options);\r\n loadExternalAssets = form.options.loadExternalAssets || loadExternalAssets;\r\n framework = form.options.framework || framework;\r\n }\r\n const widgets = this.widgets();\r\n if (isObject(widgets)) {\r\n this.jsf.setOptions({ widgets: widgets });\r\n }\r\n this.frameworkLibrary.setLoadExternalAssets(loadExternalAssets);\r\n this.frameworkLibrary.setFramework(framework);\r\n this.jsf.framework = this.frameworkLibrary.getFramework();\r\n if (isObject(this.jsf.formOptions.widgets)) {\r\n for (const widget of Object.keys(this.jsf.formOptions.widgets)) {\r\n this.widgetLibrary.registerWidget(widget, this.jsf.formOptions.widgets[widget]);\r\n }\r\n }\r\n if (isObject(form) && isObject(form.tpldata)) {\r\n this.jsf.setTpldata(form.tpldata);\r\n }\r\n const theme = this.theme();\r\n if (theme) {\r\n this.frameworkLibrary.requestThemeChange(theme);\r\n }\r\n }\r\n\r\n\r\n /**\r\n * 'initializeSchema' function\r\n *\r\n * Initialize 'schema'\r\n * Use first available input:\r\n * 1. schema - recommended / Angular Schema Form style\r\n * 2. form.schema - Single input / JSON Form style\r\n * 3. JSONSchema - React JSON Schema Form style\r\n * 4. form.JSONSchema - For testing single input React JSON Schema Forms\r\n * 5. form - For testing single schema-only inputs\r\n *\r\n * ... if no schema input found, the 'activateForm' function, below,\r\n * will make two additional attempts to build a schema\r\n * 6. If layout input - build schema from layout\r\n * 7. If data input - build schema from data\r\n */\r\n private initializeSchema() {\r\n\r\n // TODO: update to allow non-object schemas\r\n\r\n const form = this.form();\r\n const schema = this.schema();\r\n const JSONSchema = this.JSONSchema();\r\n if (isObject(schema)) {\r\n this.jsf.AngularSchemaFormCompatibility = true;\r\n this.jsf.schema = cloneDeep(schema);\r\n } else if (hasOwn(form, 'schema') && isObject(form.schema)) {\r\n this.jsf.schema = cloneDeep(form.schema);\r\n } else if (isObject(JSONSchema)) {\r\n this.jsf.ReactJsonSchemaFormCompatibility = true;\r\n this.jsf.schema = cloneDeep(JSONSchema);\r\n } else if (hasOwn(form, 'JSONSchema') && isObject(form.JSONSchema)) {\r\n this.jsf.ReactJsonSchemaFormCompatibility = true;\r\n this.jsf.schema = cloneDeep(form.JSONSchema);\r\n } else if (hasOwn(form, 'properties') && isObject(form.properties)) {\r\n this.jsf.schema = cloneDeep(form);\r\n } else if (isObject(form)) {\r\n // TODO: Handle other types of form input\r\n }\r\n\r\n if (!isEmpty(this.jsf.schema)) {\r\n\r\n // If other types also allowed, render schema as an object\r\n if (inArray('object', this.jsf.schema.type)) {\r\n this.jsf.schema.type = 'object';\r\n }\r\n\r\n // Wrap non-object schemas in object.\r\n if (hasOwn(this.jsf.schema, 'type') && this.jsf.schema.type !== 'object') {\r\n this.jsf.schema = {\r\n 'type': 'object',\r\n 'properties': { 1: this.jsf.schema }\r\n };\r\n this.objectWrap = true;\r\n } else if (!hasOwn(this.jsf.schema, 'type')) {\r\n\r\n // Add type = 'object' if missing\r\n if (isObject(this.jsf.schema.properties) ||\r\n isObject(this.jsf.schema.patternProperties) ||\r\n isObject(this.jsf.schema.additionalProperties)\r\n ) {\r\n this.jsf.schema.type = 'object';\r\n\r\n // Fix JSON schema shorthand (JSON Form style)\r\n } else {\r\n this.jsf.JsonFormCompatibility = true;\r\n this.jsf.schema = {\r\n 'type': 'object',\r\n 'properties': this.jsf.schema\r\n };\r\n }\r\n }\r\n\r\n // If needed, update JSON Schema to draft 6 format, including\r\n // draft 3 (JSON Form style) and draft 4 (Angular Schema Form style)\r\n this.jsf.schema = convertSchemaToDraft6(this.jsf.schema);\r\n\r\n // Initialize ajv and compile schema\r\n //this.jsf.compileAjvSchema();\r\n //moved to initializeAjv()\r\n\r\n // Create schemaRefLibrary, schemaRecursiveRefMap, dataRecursiveRefMap, & arrayMap\r\n this.jsf.schema = resolveSchemaReferences(\r\n this.jsf.schema, this.jsf.schemaRefLibrary, this.jsf.schemaRecursiveRefMap,\r\n this.jsf.dataRecursiveRefMap, this.jsf.arrayMap\r\n );\r\n if (hasOwn(this.jsf.schemaRefLibrary, '')) {\r\n this.jsf.hasRootReference = true;\r\n }\r\n\r\n // TODO: (?) Resolve external $ref links\r\n // // Create schemaRefLibrary & schemaRecursiveRefMap\r\n // this.parser.bundle(this.schema)\r\n // .then(schema => this.schema = resolveSchemaReferences(\r\n // schema, this.jsf.schemaRefLibrary,\r\n // this.jsf.schemaRecursiveRefMap, this.jsf.dataRecursiveRefMap\r\n // ));\r\n }\r\n }\r\n\r\n /**\r\n * 'initializeData' function\r\n *\r\n * Initialize 'formValues'\r\n * defulat or previously submitted values used to populate form\r\n * Use first available input:\r\n * 1. data - recommended\r\n * 2. model - Angular Schema Form style\r\n * 3. form.value - JSON Form style\r\n * 4. form.data - Single input style\r\n * 5. formData - React JSON Schema Form style\r\n * 6. form.formData - For easier testing of React JSON Schema Forms\r\n * 7. (none) no data - initialize data from schema and layout defaults only\r\n */\r\n private initializeData() {\r\n const form = this.form();\r\n const data = this.data();\r\n const model = this.model();\r\n const ngModel = this.ngModel();\r\n if (hasValue(data)) {\r\n this.jsf.formValues = cloneDeep(data);\r\n this.formValuesInput = 'data';\r\n } else if (hasValue(model)) {\r\n this.jsf.AngularSchemaFormCompatibility = true;\r\n this.jsf.formValues = cloneDeep(model);\r\n this.formValuesInput = 'model';\r\n } else if (hasValue(ngModel)) {\r\n this.jsf.AngularSchemaFormCompatibility = true;\r\n this.jsf.formValues = cloneDeep(ngModel);\r\n this.formValuesInput = 'ngModel';\r\n } else if (isObject(form) && hasValue(form.value)) {\r\n this.jsf.JsonFormCompatibility = true;\r\n this.jsf.formValues = cloneDeep(form.value);\r\n this.formValuesInput = 'form.value';\r\n } else if (isObject(form) && hasValue(form.data)) {\r\n this.jsf.formValues = cloneDeep(form.data);\r\n this.formValuesInput = 'form.data';\r\n } else if (hasValue(this.formData())) {\r\n this.jsf.ReactJsonSchemaFormCompatibility = true;\r\n this.formValuesInput = 'formData';\r\n } else if (hasOwn(form, 'formData') && hasValue(form.formData)) {\r\n this.jsf.ReactJsonSchemaFormCompatibility = true;\r\n this.jsf.formValues = cloneDeep(form.formData);\r\n this.formValuesInput = 'form.formData';\r\n } else {\r\n this.formValuesInput = \"data\";//null;\r\n }\r\n }\r\n\r\n /**\r\n * 'initializeLayout' function\r\n *\r\n * Initialize 'layout'\r\n * Use first available array input:\r\n * 1. layout - recommended\r\n * 2. form - Angular Schema Form style\r\n * 3. form.form - JSON Form style\r\n * 4. form.layout - Single input style\r\n * 5. (none) no layout - set default layout instead\r\n * (full layout will be built later from the schema)\r\n *\r\n * Also, if alternate layout formats are available,\r\n * import from 'UISchema' or 'customFormItems'\r\n * used for React JSON Schema Form and JSON Form API compatibility\r\n * Use first available input:\r\n * 1. UISchema - React JSON Schema Form style\r\n * 2. form.UISchema - For testing single input React JSON Schema Forms\r\n * 2. form.customFormItems - JSON Form style\r\n * 3. (none) no input - don't import\r\n */\r\n private initializeLayout() {\r\n\r\n // Rename JSON Form-style 'options' lists to\r\n // Angular Schema Form-style 'titleMap' lists.\r\n const fixJsonFormOptions = (layout: any): any => {\r\n if (isObject(layout) || isArray(layout)) {\r\n forEach(layout, (value, key) => {\r\n if (hasOwn(value, 'options') && isObject(value.options)) {\r\n value.titleMap = value.options;\r\n delete value.options;\r\n }\r\n }, 'top-down');\r\n }\r\n return layout;\r\n };\r\n\r\n // Check for layout inputs and, if found, initialize form layout\r\n const form = this.form();\r\n const layoutValue = this.layout();\r\n if (isArray(layoutValue)) {\r\n this.jsf.layout = cloneDeep(layoutValue);\r\n } else if (isArray(form)) {\r\n this.jsf.AngularSchemaFormCompatibility = true;\r\n this.jsf.layout = cloneDeep(form);\r\n } else if (form && isArray(form.form)) {\r\n this.jsf.JsonFormCompatibility = true;\r\n this.jsf.layout = fixJsonFormOptions(cloneDeep(form.form));\r\n } else if (form && isArray(form.layout)) {\r\n this.jsf.layout = cloneDeep(form.layout);\r\n } else {\r\n this.jsf.layout = ['*'];\r\n }\r\n\r\n // Check for alternate layout inputs\r\n let alternateLayout: any = null;\r\n const formValue = this.form();\r\n const UISchema = this.UISchema();\r\n if (isObject(UISchema)) {\r\n this.jsf.ReactJsonSchemaFormCompatibility = true;\r\n alternateLayout = cloneDeep(UISchema);\r\n } else if (hasOwn(formValue, 'UISchema')) {\r\n this.jsf.ReactJsonSchemaFormCompatibility = true;\r\n alternateLayout = cloneDeep(formValue.UISchema);\r\n } else if (hasOwn(formValue, 'uiSchema')) {\r\n this.jsf.ReactJsonSchemaFormCompatibility = true;\r\n alternateLayout = cloneDeep(formValue.uiSchema);\r\n } else if (hasOwn(formValue, 'customFormItems')) {\r\n this.jsf.JsonFormCompatibility = true;\r\n alternateLayout = fixJsonFormOptions(cloneDeep(formValue.customFormItems));\r\n }\r\n\r\n // if alternate layout found, copy alternate layout options into schema\r\n if (alternateLayout) {\r\n JsonPointer.forEachDeep(alternateLayout, (value, pointer) => {\r\n const schemaPointer = pointer\r\n .replace(/\\//g, '/properties/')\r\n .replace(/\\/properties\\/items\\/properties\\//g, '/items/properties/')\r\n .replace(/\\/properties\\/titleMap\\/properties\\//g, '/titleMap/properties/');\r\n if (hasValue(value) && hasValue(pointer)) {\r\n let key = JsonPointer.toKey(pointer);\r\n const groupPointer = (JsonPointer.parse(schemaPointer) || []).slice(0, -2);\r\n let itemPointer: string | string[];\r\n\r\n // If 'ui:order' object found, copy into object schema root\r\n if (key.toLowerCase() === 'ui:order') {\r\n itemPointer = [...groupPointer, 'ui:order'];\r\n\r\n // Copy other alternate layout options to schema 'x-schema-form',\r\n // (like Angular Schema Form options) and remove any 'ui:' prefixes\r\n } else {\r\n if (key.slice(0, 3).toLowerCase() === 'ui:') { key = key.slice(3); }\r\n itemPointer = [...groupPointer, 'x-schema-form', key];\r\n }\r\n if (JsonPointer.has(this.jsf.schema, groupPointer) &&\r\n !JsonPointer.has(this.jsf.schema, itemPointer)\r\n ) {\r\n JsonPointer.set(this.jsf.schema, itemPointer, value);\r\n }\r\n }\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * 'activateForm' function\r\n *\r\n * ...continued from 'initializeSchema' function, above\r\n * If 'schema' has not been initialized (i.e. no schema input found)\r\n * 6. If layout input - build schema from layout input\r\n * 7. If data input - build schema from data input\r\n *\r\n * Create final layout,\r\n * build the FormGroup template and the Angular FormGroup,\r\n * subscribe to changes,\r\n * and activate the form.\r\n */\r\n private activateForm() {\r\n this.unsubscribeOnActivateForm$.next();\r\n // If 'schema' not initialized\r\n if (isEmpty(this.jsf.schema)) {\r\n\r\n // TODO: If full layout input (with no '*'), build schema from layout\r\n // if (!this.jsf.layout.includes('*')) {\r\n // this.jsf.buildSchemaFromLayout();\r\n // } else\r\n\r\n // If data input, build schema from data\r\n if (!isEmpty(this.jsf.formValues)) {\r\n this.jsf.buildSchemaFromData();\r\n }\r\n }\r\n\r\n if (!isEmpty(this.jsf.schema)) {\r\n\r\n // If not already initialized, initialize ajv and compile schema\r\n //this.jsf.compileAjvSchema();\r\n //moved to initializeAjv()\r\n\r\n // Update all layout elements, add values, widgets, and validators,\r\n // replace any '*' with a layout built from all schema elements,\r\n // and update the FormGroup template with any new validators\r\n this.jsf.buildLayout(this.widgetLibrary);\r\n\r\n // Build the Angular FormGroup template from the schema\r\n this.jsf.buildFormGroupTemplate(this.jsf.formValues);\r\n\r\n // Build the real Angular FormGroup from the FormGroup template\r\n this.jsf.buildFormGroup(this.ajvInstanceName);\r\n }\r\n\r\n if (this.jsf.formGroup) {\r\n\r\n // Reset initial form values\r\n if (!isEmpty(this.jsf.formValues) &&\r\n this.jsf.formOptions.setSchemaDefaults !== true &&\r\n this.jsf.formOptions.setLayoutDefaults !== true\r\n ) {\r\n this.setFormValues(this.jsf.formValues);\r\n }\r\n\r\n // TODO: Figure out how to display calculated values without changing object data\r\n // See http://ulion.github.io/jsonform/playground/?example=templating-values\r\n // Calculate references to other fields\r\n // if (!isEmpty(this.jsf.formGroup.value)) {\r\n // forEach(this.jsf.formGroup.value, (value, key, object, rootObject) => {\r\n // if (typeof value === 'string') {\r\n // object[key] = this.jsf.parseText(value, value, rootObject, key);\r\n // }\r\n // }, 'top-down');\r\n // }\r\n\r\n // Subscribe to form changes to output live data, validation, and errors\r\n this.dataChangesSubs=this.jsf.dataChanges.pipe(takeUntil(this.unsubscribeOnActivateForm$)).subscribe(data => {\r\n this.onChanges.emit(this.objectWrap ? data['1'] : data);\r\n if (this.formValuesInput && this.formValuesInput.indexOf('.') === -1) {\r\n this[`${this.formValuesInput}Change`].emit(this.objectWrap ? data['1'] : data);\r\n }\r\n });\r\n\r\n // Trigger change detection on statusChanges to show updated errors\r\n this.statusChangesSubs= this.jsf.formGroup.statusChanges.pipe(takeUntil(this.unsubscribeOnActivateForm$)).subscribe(() => this.changeDetector.markForCheck());\r\n this.isValidChangesSubs=this.jsf.isValidChanges.pipe(takeUntil(this.unsubscribeOnActivateForm$)).subscribe(isValid => this.isValid.emit(isValid));\r\n this.validationErrorChangesSubs=this.jsf.validationErrorChanges.pipe(takeUntil(this.unsubscribeOnActivateForm$)).subscribe(err => this.validationErrors.emit(err));\r\n\r\n // Output final schema, final layout, and initial data\r\n this.formSchema.emit(this.jsf.schema);\r\n this.formLayout.emit(this.jsf.layout);\r\n this.onChanges.emit(this.objectWrap ? this.jsf.data['1'] : this.jsf.data);\r\n\r\n // If validateOnRender, output initial validation and any errors\r\n const validateOnRender =\r\n JsonPointer.get(this.jsf, '/formOptions/validateOnRender');\r\n if (validateOnRender) { // validateOnRender === 'auto' || true\r\n const touchAll = (control) => {\r\n if (validateOnRender === true || hasValue(control.value)) {\r\n control.markAsTouched();\r\n }\r\n Object.keys(control.controls || {})\r\n .forEach(key => touchAll(control.controls[key]));\r\n };\r\n touchAll(this.jsf.formGroup);\r\n this.isValid.emit(this.jsf.isValid);\r\n this.validationErrors.emit(this.jsf.ajvErrors);\r\n }\r\n }\r\n }\r\n\r\n}\r\n","<form [autocomplete]=\"jsf?.formOptions?.autocomplete ? 'on' : 'off'\" class=\"json-schema-form\" (ngSubmit)=\"submitForm()\">\r\n <root-widget [layout]=\"jsf?.layout\"></root-widget>\r\n</form>\r\n<div *ngIf=\"debug() || jsf?.formOptions?.debug\">\r\n Debug output:\r\n <pre>{{debugOutput}}</pre>\r\n</div>","import { CommonModule } from '@angular/common';\r\nimport { NgModule } from '@angular/core';\r\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\r\nimport { NoFrameworkModule } from './framework-library/no-framework.module';\r\nimport { JsonSchemaFormComponent } from './json-schema-form.component';\r\nimport { WidgetLibraryModule } from './widget-library/widget-library.module';\r\n\r\n@NgModule({\r\n imports: [\r\n CommonModule, FormsModule, ReactiveFormsModule,\r\n WidgetLibraryModule, NoFrameworkModule\r\n ],\r\n declarations: [JsonSchemaFormComponent],\r\n exports: [JsonSchemaFormComponent, WidgetLibraryModule]\r\n})\r\nexport class JsonSchemaFormModule {\r\n}\r\n","/*\r\n * Public API Surface of json-schema-form\r\n */\r\n\r\nexport { JsonSchemaFormModule } from './lib/json-schema-form.module';\r\nexport { TitleMapItem, ErrorMessages, JsonSchemaFormService } from './lib/json-schema-form.service';\r\nexport { JsonSchemaFormComponent } from './lib/json-schema-form.component';\r\nexport { Framework } from './lib/framework-library/framework';\r\nexport { FrameworkLibraryService } from './lib/framework-library/framework-library.service';\r\nexport {\r\n deValidationMessages,\r\n enValidationMessages,\r\n esValidationMessages,\r\n frValidationMessages,\r\n itValidationMessages,\r\n ptValidationMessages,\r\n zhValidationMessages\r\n } from './lib/locale';\r\nexport * from './lib/widget-library';\r\nexport * from './lib/widget-library/widget-library.module';\r\nexport * from './lib/shared';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["isEqual","isEmpty","map","_isEqual","i1.SelectWidgetComponent","i2.StopPropagationDirective","i3.ElementAttributeDirective","i4.StopPropagationDirective","i1.JsonSchemaFormService","i3.SelectFrameworkComponent","isObject","i1.TabsComponent","i2","i2.RootComponent","i1.StopPropagationDirective","i1.RootComponent","i1.AddReferenceComponent","i2.OneOfComponent","i3.ButtonComponent","i4.CheckboxComponent","i5.CheckboxesComponent","i6.FileComponent","i7.HiddenComponent","i8.InputComponent","i9.MessageComponent","i10.NoneComponent","i11.NumberComponent","i12.RadiosComponent","i13.RootComponent","i14.SectionComponent","i15.SelectComponent","i16.SelectFrameworkComponent","i17.SelectWidgetComponent","i18.SubmitComponent","i19.TabComponent","i20.TabsComponent","i21.TemplateComponent","i22.TextareaComponent","i23.SelectCheckboxComponent","i24.ItemTitleComponent","i3.RootComponent"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;MAGa,SAAS,CAAA;AADtB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