Your IP : 216.73.216.229


Current Path : /home/jeromecohp/www/plugins/system/yooessentials/modules/core/app/fields/
Upload File :
Current File : /home/jeromecohp/www/plugins/system/yooessentials/modules/core/app/fields/SourceTypeSelectField.js

/* Essentials YOOtheme Pro (Freemium) 2.0.19 build 1026.0920; ZOOlanders https://www.zoolanders.com; Copyright (C) Joolanders, SL; http://www.gnu.org/licenses/gpl.html GNU/GPL */

import yootheme from 'yootheme';

export default {
    name: 'YooessentialsSourceTypeSelect',

    extends: yootheme.fields.components.FieldSelect,

    methods: {
        filterOptions() {
            const types = yootheme.customizer?.schema?.types;

            return [
                { text: this.$t(this.field?.placeholder || 'None'), value: '' },
                ...types
                    .filter(
                        (type) =>
                            type.kind === 'OBJECT' &&
                            type.name !== 'Query' &&
                            !type.name.startsWith('__')
                    )
                    .map((type) => ({
                        value: type.name,
                        text: type.name,
                    })),
            ];
        },
    },
};