@tripetto/block-textarea
Version:
Text input (multi-line) block for Tripetto.
2 lines • 3.82 kB
JavaScript
/*! Tripetto Textarea Block 6.0.3 - Copyright (C) 2023 Tripetto B.V. - All Rights Reserved */
!function(){"use strict";var t={407:function(t,e,r){var n,o=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__decorate||function(t,e,r,n){var o,i=arguments.length,a=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};Object.defineProperty(e,"__esModule",{value:!0}),e.TextareaCondition=void 0;var a=r(226),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.getMatchString=function(){if((0,a.isVariable)(this.props.match)){var t=this.variableFor(this.props.match);return t&&t.hasValue?t.string:""}return this.parseVariables(this.props.match||"","",!0)},e.prototype.isEqual=function(){var t=this.valueOf();if(t){var e=this.props.ignoreCase?a.Str.lowercase(this.getMatchString()):this.getMatchString(),r=this.props.ignoreCase?a.Str.lowercase(t.string):t.string;switch(this.props.mode){case"exact":return r===e;case"not-exact":return r!==e;case"contains":return e&&-1!==r.indexOf(e)||!1;case"not-contains":return e&&-1===r.indexOf(e)||!1;case"starts":return e&&0===r.indexOf(e)||!1;case"ends":return e&&r.length>=e.length&&r.lastIndexOf(e)===r.length-e.length||!1;case"defined":return""!==r;case"undefined":return""===r}}return!1},i([a.condition],e.prototype,"isEqual",null),e=i([(0,a.tripetto)({type:"condition",legacyBlock:!0,identifier:"@tripetto/block-textarea"})],e)}(a.ConditionBlock);e.TextareaCondition=s},856:function(t,e,r){var n,o=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__decorate||function(t,e,r,n){var o,i=arguments.length,a=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};Object.defineProperty(e,"__esModule",{value:!0}),e.Textarea=void 0;var a=r(226);r(407);var s=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.textareaSlot=(0,a.assert)(e.valueOf("value","static",{prefill:(0,a.isString)(e.props.prefill)&&{value:e.props.prefill}||void 0})),e.required=e.textareaSlot.slot.required||!1,e.maxLength=e.textareaSlot.slot.maxLength,e}return o(e,t),e.prototype.validate=function(){return!this.props.minLength||!this.textareaSlot.value.length||this.textareaSlot.value.length>=this.props.minLength},i([a.validator],e.prototype,"validate",null),e}(a.NodeBlock);e.Textarea=s},226:function(t){t.exports=require("@tripetto/runner")}},e={};var r=function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n].call(i.exports,i,i.exports,r),i.exports}(856);module.exports=r}();