UNPKG

@tripetto/block-textarea

Version:

Text input (multi-line) block for Tripetto.

2 lines 4.14 kB
/*! Tripetto Textarea Block 6.0.3 - Copyright (C) 2023 Tripetto B.V. - All Rights Reserved */ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("TripettoRunner")):"function"==typeof define&&define.amd?define("TripettoBlockTextarea",["TripettoRunner"],e):"object"==typeof exports?exports.TripettoBlockTextarea=e(require("TripettoRunner")):t.TripettoBlockTextarea=e(t.TripettoRunner)}(this,(function(t){return function(){"use strict";var e={407:function(t,e,r){var o,n=this&&this.__extends||(o=function(t,e){return o=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])},o(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}o(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__decorate||function(t,e,r,o){var n,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,r,o);else for(var s=t.length-1;s>=0;s--)(n=t[s])&&(a=(i<3?n(a):i>3?n(e,r,a):n(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(294),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(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 o,n=this&&this.__extends||(o=function(t,e){return o=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])},o(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}o(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__decorate||function(t,e,r,o){var n,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,r,o);else for(var s=t.length-1;s>=0;s--)(n=t[s])&&(a=(i<3?n(a):i>3?n(e,r,a):n(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(294);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 n(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},294:function(e){e.exports=t}},r={};var o=function t(o){var n=r[o];if(void 0!==n)return n.exports;var i=r[o]={exports:{}};return e[o].call(i.exports,i,i.exports,t),i.exports}(856);return o}()}));