"use strict";
var __webpack_require__ = {};
(()=>{
    __webpack_require__.d = (exports1, definition)=>{
        for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
            enumerable: true,
            get: definition[key]
        });
    };
})();
(()=>{
    __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
})();
(()=>{
    __webpack_require__.r = (exports1)=>{
        if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
            value: 'Module'
        });
        Object.defineProperty(exports1, '__esModule', {
            value: true
        });
    };
})();
var __webpack_exports__ = {};
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
    TextareaFieldInterface: ()=>TextareaFieldInterface
});
const CollectionFieldInterface_js_namespaceObject = require("../../data-source/collection-field-interface/CollectionFieldInterface.js");
const index_js_namespaceObject = require("../../i18n/index.js");
const external_properties_index_js_namespaceObject = require("./properties/index.js");
function _define_property(obj, key, value) {
    if (key in obj) Object.defineProperty(obj, key, {
        value: value,
        enumerable: true,
        configurable: true,
        writable: true
    });
    else obj[key] = value;
    return obj;
}
class TextareaFieldInterface extends CollectionFieldInterface_js_namespaceObject.CollectionFieldInterface {
    schemaInitialize(schema, param) {
        let { block } = param;
        if ([
            'Table',
            'Kanban'
        ].includes(block)) {
            schema['x-component-props'] = schema['x-component-props'] || {};
            schema['x-component-props']['ellipsis'] = true;
        }
    }
    constructor(...args){
        super(...args), _define_property(this, "name", 'textarea'), _define_property(this, "type", 'object'), _define_property(this, "group", 'basic'), _define_property(this, "order", 2), _define_property(this, "title", '{{t("Long text")}}'), _define_property(this, "icon", 'FileTextOutlined'), _define_property(this, "default", {
            interface: 'textarea',
            type: 'text',
            uiSchema: {
                type: 'string',
                'x-component': 'Input.TextArea'
            }
        }), _define_property(this, "availableTypes", [
            'text',
            'json'
        ]), _define_property(this, "hasDefaultValue", true), _define_property(this, "properties", {
            ...external_properties_index_js_namespaceObject.defaultProps
        }), _define_property(this, "validateSchema", (fieldSchema)=>({
                max: {
                    type: 'number',
                    title: '{{ t("Max length") }}',
                    minimum: 0,
                    'x-decorator': 'FormItem',
                    'x-component': 'InputNumber',
                    'x-component-props': {
                        precision: 0
                    },
                    'x-reactions': "{{(field) => {\n          const targetValue = field.query('.min').value();\n          field.selfErrors =\n            !!targetValue && !!field.value && targetValue > field.value ? '".concat(index_js_namespaceObject.i18n.t('Max length must greater than min length'), "' : ''\n        }}}")
                },
                min: {
                    type: 'number',
                    title: '{{ t("Min length") }}',
                    minimum: 0,
                    'x-decorator': 'FormItem',
                    'x-component': 'InputNumber',
                    'x-component-props': {
                        precision: 0
                    },
                    'x-reactions': {
                        dependencies: [
                            '.max'
                        ],
                        fulfill: {
                            state: {
                                selfErrors: "{{!!$deps[0] && !!$self.value && $deps[0] < $self.value ? '".concat(index_js_namespaceObject.i18n.t('Min length must less than max length'), "' : ''}}")
                            }
                        }
                    }
                }
            })), _define_property(this, "filterable", {
            operators: external_properties_index_js_namespaceObject.operators.string
        });
    }
}
exports.TextareaFieldInterface = __webpack_exports__.TextareaFieldInterface;
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
    "TextareaFieldInterface"
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
Object.defineProperty(exports, '__esModule', {
    value: true
});
