dist/@ajsf/core/esm2015/lib/json-schema-form.component.js
/**
     * 'initializeLayout' function
     *
     * Initialize 'layout'
     * Use first available array input:
     * 1. layout - recommended
     * 2. form - Angular Schema Form style
     * 3. form.form - JSON Form style
     * 4. form.layout - Single input style
     * 5. (none) no layout - set default layout instead
     *    (full layout will be built later from the schema)
     *
     * Also, if alternate layout formats are available,
     * import from 'UISchema' or 'customFormItems'
     * used for React JSON Schema Form and JSON Form API compatibility
     * Use first available input:
     * 1. UISchema - React JSON Schema Form style
     * 2. form.UISchema - For testing single input React JSON Schema Forms
     * 2. form.customFormItems - JSON Form style
     * 3. (none) no input - don't import
     */
'initializeLayout' function
Initialize 'layout'
Use first available array input:
1. layout - recommended
2. form - Angular Schema Form style
3. form.form - JSON Form style
4. form.layout - Single input style
5. (none) no layout - set default layout instead
(full layout will be built later from the schema)

Also, if alternate layout formats are available,
import from 'UISchema' or 'customFormItems'
used for React JSON Schema Form and JSON Form API compatibility
Use first available input:
1. UISchema - React JSON Schema Form style
2. form.UISchema - For testing single input React JSON Schema Forms
2. form.customFormItems - JSON Form style
3. (none) no input - don't import
' initializeLayout ' function Initialize ' layout ' Use first available array input : 1 . layout - recommended 2 . form - Angular Schema Form style 3 . form . form - JSON Form style 4 . form . layout - Single input style 5 . ( none ) no layout - set default layout instead ( full layout will be built later from the schema ) Also if alternate layout formats are available import from ' UISchema ' or ' customFormItems ' used for React JSON Schema Form and JSON Form API compatibility Use first available input : 1 . UISchema - React JSON Schema Form style 2 . form . UISchema - For testing single input React JSON Schema Forms 2 . form . customFormItems - JSON Form style 3 . ( none ) no input - don ' t import
initializeLayout() {
        const fixJsonFormOptions = (layout) => {
            if (isObject(layout) || isArray(layout)) {
                forEach(layout, (value, key) => {
                    if (hasOwn(value, 'options') && isObject(value.options)) {
                        value.titleMap = value.options;
                        delete value.options;
                    }
                }, 'top-down');
            }
            return layout;
        };
        if (isArray(this.layout)) {
            this.jsf.layout = cloneDeep(this.layout);
        }
        else if (isArray(this.form)) {
            this.jsf.AngularSchemaFormCompatibility = true;
            this.jsf.layout = cloneDeep(this.form);
        }
        else if (this.form && isArray(this.form.form)) {
            this.jsf.JsonFormCompatibility = true;
            this.jsf.layout = fixJsonFormOptions(cloneDeep(this.form.form));
        }
        else if (this.form && isArray(this.form.layout)) {
            this.jsf.layout = cloneDeep(this.form.layout);
        }
        else {
            this.jsf.layout = ['*'];
        }
        let alternateLayout = null;
        if (isObject(this.UISchema)) {
            this.jsf.ReactJsonSchemaFormCompatibility = true;
            alternateLayout = cloneDeep(this.UISchema);
        }
        else if (hasOwn(this.form, 'UISchema')) {
            this.jsf.ReactJsonSchemaFormCompatibility = true;
            alternateLayout = cloneDeep(this.form.UISchema);
        }
        else if (hasOwn(this.form, 'uiSchema')) {
            this.jsf.ReactJsonSchemaFormCompatibility = true;
            alternateLayout = cloneDeep(this.form.uiSchema);
        }
        else if (hasOwn(this.form, 'customFormItems')) {
            this.jsf.JsonFormCompatibility = true;
            alternateLayout = fixJsonFormOptions(cloneDeep(this.form.customFormItems));
        }
        if (alternateLayout) {
            JsonPointer.forEachDeep(alternateLayout, (value, pointer) => {
                const schemaPointer = pointer
                    .replace(/\//g, '/properties/')
                    .replace(/\/properties\/items\/properties\//g, '/items/properties/')
                    .replace(/\/properties\/titleMap\/properties\//g, '/titleMap/properties/');
                if (hasValue(value) && hasValue(pointer)) {
                    let key = JsonPointer.toKey(pointer);
                    const groupPointer = (JsonPointer.parse(schemaPointer) || []).slice(0, -2);
                    let itemPointer;
                    if (key.toLowerCase() === 'ui:order') {
                        itemPointer = [...groupPointer, 'ui:order'];
                    }
                    else {
                        if (key.slice(0, 3).toLowerCase() === 'ui:') {
                            key = key.slice(3);
                        }
                        itemPointer = [...groupPointer, 'x-schema-form', key];
                    }
                    if (JsonPointer.has(this.jsf.schema, groupPointer) &&
                        !JsonPointer.has(this.jsf.schema, itemPointer)) {
                        JsonPointer.set(this.jsf.schema, itemPointer, value);
                    }
                }
            });
        }
    }
initializeLayout ( ) { const fixJsonFormOptions = ( layout ) => { if ( isObject ( layout ) || isArray ( layout ) ) { forEach ( layout , ( value , key ) => { if ( hasOwn ( value , 'options' ) && isObject ( value . options ) ) { value . titleMap = value . options ; delete value . options ; } } , 'top-down' ) ; } return layout ; } ; if ( isArray ( this . layout ) ) { this . jsf . layout = cloneDeep ( this . layout ) ; } else if ( isArray ( this . form ) ) { this . jsf . AngularSchemaFormCompatibility = true ; this . jsf . layout = cloneDeep ( this . form ) ; } else if ( this . form && isArray ( this . form . form ) ) { this . jsf . JsonFormCompatibility = true ; this . jsf . layout = fixJsonFormOptions ( cloneDeep ( this . form . form ) ) ; } else if ( this . form && isArray ( this . form . layout ) ) { this . jsf . layout = cloneDeep ( this . form . layout ) ; } else { this . jsf . layout = [ '*' ] ; } let alternateLayout = null ; if ( isObject ( this . UISchema ) ) { this . jsf . ReactJsonSchemaFormCompatibility = true ; alternateLayout = cloneDeep ( this . UISchema ) ; } else if ( hasOwn ( this . form , 'UISchema' ) ) { this . jsf . ReactJsonSchemaFormCompatibility = true ; alternateLayout = cloneDeep ( this . form . UISchema ) ; } else if ( hasOwn ( this . form , 'uiSchema' ) ) { this . jsf . ReactJsonSchemaFormCompatibility = true ; alternateLayout = cloneDeep ( this . form . uiSchema ) ; } else if ( hasOwn ( this . form , 'customFormItems' ) ) { this . jsf . JsonFormCompatibility = true ; alternateLayout = fixJsonFormOptions ( cloneDeep ( this . form . customFormItems ) ) ; } if ( alternateLayout ) { JsonPointer . forEachDeep ( alternateLayout , ( value , pointer ) => { const schemaPointer = pointer . replace ( / \/ / g , '/properties/' ) . replace ( / \/properties\/items\/properties\/ / g , '/items/properties/' ) . replace ( / \/properties\/titleMap\/properties\/ / g , '/titleMap/properties/' ) ; if ( hasValue ( value ) && hasValue ( pointer ) ) { let key = JsonPointer . toKey ( pointer ) ; const groupPointer = ( JsonPointer . parse ( schemaPointer ) || [ ] ) . slice ( 0 , - 2 ) ; let itemPointer ; if ( key . toLowerCase ( ) === 'ui:order' ) { itemPointer = [ ... groupPointer , 'ui:order' ] ; } else { if ( key . slice ( 0 , 3 ) . toLowerCase ( ) === 'ui:' ) { key = key . slice ( 3 ) ; } itemPointer = [ ... groupPointer , 'x-schema-form' , key ] ; } if ( JsonPointer . has ( this . jsf . schema , groupPointer ) && ! JsonPointer . has ( this . jsf . schema , itemPointer ) ) { JsonPointer . set ( this . jsf . schema , itemPointer , value ) ; } } } ) ; } }
'initializeLayout' function
 Initialize 'layout'
 Use first available array input:
 1. layout - recommended
 2. form - Angular Schema Form style
 3. form.form - JSON Form style
 4. form.layout - Single input style
 5.
' initializeLayout ' function Initialize ' layout ' Use first available array input : 1 . layout - recommended 2 . form - Angular Schema Form style 3 . form . form - JSON Form style 4 . form . layout - Single input style 5 .
// Rename JSON Form-style 'options' lists to // Angular Schema Form-style 'titleMap' lists. // Check for layout inputs and, if found, initialize form layout // Check for alternate layout inputs // if alternate layout found, copy alternate layout options into schema // If 'ui:order' object found, copy into object schema root // Copy other alternate layout options to schema 'x-schema-form', // (like Angular Schema Form options) and remove any 'ui:' prefixes