1/* eslint-disable */ 2this.BX = this.BX || {}; 3this.BX.UI = this.BX.UI || {}; 4(function (exports,main_core) { 5 'use strict'; 6 7 var _templateObject, _templateObject2, _templateObject3, _templateObject4; 8 function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); } 9 function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } } 10 var _id = /*#__PURE__*/new WeakMap(); 11 var _inputText = /*#__PURE__*/new WeakMap(); 12 var _labelText = /*#__PURE__*/new WeakMap(); 13 var _configurator = /*#__PURE__*/new WeakMap(); 14 var _errorLayout = /*#__PURE__*/new WeakMap(); 15 var _inputLayout = /*#__PURE__*/new WeakMap(); 16 var _wrapper = /*#__PURE__*/new WeakMap(); 17 var TextInput = /*#__PURE__*/function () { 18 function TextInput(id, configurator, inputText) { 19 babelHelpers.classCallCheck(this, TextInput); 20 _classPrivateFieldInitSpec(this, _id, { 21 writable: true, 22 value: void 0 23 }); 24 _classPrivateFieldInitSpec(this, _inputText, { 25 writable: true, 26 value: void 0 27 }); 28 _classPrivateFieldInitSpec(this, _labelText, { 29 writable: true, 30 value: void 0 31 }); 32 _classPrivateFieldInitSpec(this, _configurator, { 33 writable: true, 34 value: void 0 35 }); 36 _classPrivateFieldInitSpec(this, _errorLayout, { 37 writable: true, 38 value: void 0 39 }); 40 _classPrivateFieldInitSpec(this, _inputLayout, { 41 writable: true, 42 value: void 0 43 }); 44 _classPrivateFieldInitSpec(this, _wrapper, { 45 writable: true, 46 value: void 0 47 }); 48 babelHelpers.classPrivateFieldSet(this, _id, id !== '' ? id : main_core.util.getRandomString(4)); 49 babelHelpers.classPrivateFieldSet(this, _configurator, configurator); 50 babelHelpers.classPrivateFieldSet(this, _inputText, inputText); 51 babelHelpers.classPrivateFieldSet(this, _labelText, main_core.Loc.getMessage('UI_ENTITY_EDITOR_UF_CONFIGURATORS_TOOLTIP_INPUT_LABEL')); 52 babelHelpers.classPrivateFieldSet(this, _errorLayout, null); 53 babelHelpers.classPrivateFieldSet(this, _inputLayout, null); 54 babelHelpers.classPrivateFieldSet(this, _wrapper, null); 55 } 56 babelHelpers.createClass(TextInput, [{ 57 key: "prepareLayout", 58 value: function prepareLayout() { 59 babelHelpers.classPrivateFieldSet(this, _inputLayout, main_core.Tag.render(_templateObject || (_templateObject = babelHelpers.taggedTemplateLiteral(["\n\t\t\t<textarea \n\t\t\t\tclass=\"ui-ctl-element\"\n\t\t\t\trows=\"3\"\n\t\t\t\tid=\"", "\"\n\t\t\t></textarea>\n\t\t"])), babelHelpers.classPrivateFieldGet(this, _id))); 60 babelHelpers.classPrivateFieldGet(this, _inputLayout).innerHTML = babelHelpers.classPrivateFieldGet(this, _inputText); 61 var label = main_core.Tag.render(_templateObject2 || (_templateObject2 = babelHelpers.taggedTemplateLiteral(["\n\t\t\t<label class=\"ui-entity-editor-block-title\">\n\t\t\t\t", "\n\t\t\t</label>\n\t\t"])), babelHelpers.classPrivateFieldGet(this, _labelText)); 62 babelHelpers.classPrivateFieldSet(this, _wrapper, main_core.Tag.render(_templateObject3 || (_templateObject3 = babelHelpers.taggedTemplateLiteral(["\n\t\t\t<div class=\"ui-entity-editor-new-field-visibility-wrapper\">\n\t\t\t\t", "\n\t\t\t\t", "\n\t\t\t</div>\n\t\t"])), label, babelHelpers.classPrivateFieldGet(this, _inputLayout))); 63 return babelHelpers.classPrivateFieldGet(this, _wrapper); 64 } 65 }, { 66 key: "renderError", 67 value: function renderError(errorText) { 68 if (main_core.Type.isNull(babelHelpers.classPrivateFieldGet(this, _errorLayout))) { 69 babelHelpers.classPrivateFieldSet(this, _errorLayout, main_core.Tag.render(_templateObject4 || (_templateObject4 = babelHelpers.taggedTemplateLiteral(["\n\t\t\t\t<label class=\"ui-entity-editor-user-field-setting-error-text\"></label>\n\t\t\t"])))); 70 babelHelpers.classPrivateFieldGet(this, _wrapper).append(babelHelpers.classPrivateFieldGet(this, _errorLayout)); 71 } 72 babelHelpers.classPrivateFieldGet(this, _errorLayout).innerHTML = errorText; 73 } 74 }, { 75 key: "adjustVisibility", 76 value: function adjustVisibility() { 77 if (babelHelpers.classPrivateFieldGet(this, _configurator).isInputEnabled()) { 78 main_core.Dom.show(babelHelpers.classPrivateFieldGet(this, _wrapper)); 79 } else { 80 main_core.Dom.hide(babelHelpers.classPrivateFieldGet(this, _wrapper)); 81 } 82 } 83 }, {
84 key: "getInputText", 85 value: function getInputText() { 86 return babelHelpers.classPrivateFieldGet(this, _inputLayout).value; 87 } 88 }]); 89 return TextInput; 90 }(); 91 92 function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration$1(obj, privateSet); privateSet.add(obj); } 93 function _classPrivateFieldInitSpec$1(obj, privateMap, value) { _checkPrivateRedeclaration$1(obj, privateMap); privateMap.set(obj, value); } 94 function _checkPrivateRedeclaration$1(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } } 95 function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; } 96 var MAX_TOOLTIP_LENGTH = 250; 97 var _id$1 = /*#__PURE__*/new WeakMap(); 98 var _editor = /*#__PURE__*/new WeakMap(); 99 var _field = /*#__PURE__*/new WeakMap(); 100 var _previousTooltip = /*#__PURE__*/new WeakMap(); 101 var _caption = /*#__PURE__*/new WeakMap(); 102 var _textInput = /*#__PURE__*/new WeakMap(); 103 var _checkBox = /*#__PURE__*/new WeakMap(); 104 var _isShowInput = /*#__PURE__*/new WeakMap(); 105 var _checkBoxHandler = /*#__PURE__*/new WeakMap(); 106 var _onCheckBoxClick = /*#__PURE__*/new WeakSet(); 107 var TooltipConfigurator = /*#__PURE__*/function () { 108 function TooltipConfigurator(id, editor, field) { 109 var _babelHelpers$classPr, _babelHelpers$classPr2, _babelHelpers$classPr3; 110 babelHelpers.classCallCheck(this, TooltipConfigurator); 111 _classPrivateMethodInitSpec(this, _onCheckBoxClick); 112 _classPrivateFieldInitSpec$1(this, _id$1, { 113 writable: true, 114 value: void 0 115 }); 116 _classPrivateFieldInitSpec$1(this, _editor, { 117 writable: true, 118 value: void 0 119 }); 120 _classPrivateFieldInitSpec$1(this, _field, { 121 writable: true, 122 value: void 0 123 }); 124 _classPrivateFieldInitSpec$1(this, _previousTooltip, { 125 writable: true, 126 value: void 0 127 }); 128 _classPrivateFieldInitSpec$1(this, _caption, { 129 writable: true, 130 value: void 0 131 }); 132 _classPrivateFieldInitSpec$1(this, _textInput, { 133 writable: true, 134 value: void 0 135 }); 136 _classPrivateFieldInitSpec$1(this, _checkBox, { 137 writable: true, 138 value: void 0 139 }); 140 _classPrivateFieldInitSpec$1(this, _isShowInput, { 141 writable: true, 142 value: void 0 143 }); 144 _classPrivateFieldInitSpec$1(this, _checkBoxHandler, { 145 writable: true, 146 value: void 0 147 }); 148 babelHelpers.classPrivateFieldSet(this, _id$1, id !== '' ? id : main_core.util.getRandomString(4)); 149 babelHelpers.classPrivateFieldSet(this, _editor, editor); 150 babelHelpers.classPrivateFieldSet(this, _field, field); 151 babelHelpers.classPrivateFieldSet(this, _previousTooltip, (_babelHelpers$classPr = (_babelHelpers$classPr2 = babelHelpers.classPrivateFieldGet(this, _field)) === null || _babelHelpers$classPr2 === void 0 ? void 0 : (_babelHelpers$classPr3 = _babelHelpers$classPr2._schemeElement) === null || _babelHelpers$classPr3 === void 0 ? void 0 : _babelHelpers$classPr3._hint) !== null && _babelHelpers$classPr !== void 0 ? _babelHelpers$classPr : ''); 152 babelHelpers.classPrivateFieldSet(this, _isShowInput, Boolean(babelHelpers.classPrivateFieldGet(this, _previousTooltip))); 153 babelHelpers.classPrivateFieldSet(this, _checkBoxHandler, _classPrivateMethodGet(this, _onCheckBoxClick, _onCheckBoxClick2).bind(this)); 154 babelHelpers.classPrivateFieldSet(this, _textInput, null); 155 babelHelpers.classPrivateFieldSet(this, _checkBox, null); 156 babelHelpers.classPrivateFieldSet(this, _caption, main_core.Loc.getMessage('UI_ENTITY_EDITOR_UF_CONFIGURATORS_TOOLTIP_CHECKBOX_LABEL')); 157 } 158 babelHelpers.createClass(TooltipConfigurator, [{ 159 key: "validateInputText", 160 value: function validateInputText() { 161 var input = this.getInput(); 162 var text = input.getInputText(); 163 if (text.length > MAX_TOOLTIP_LENGTH) { 164 var errorText = main_core.Loc.getMessage('UI_ENTITY_EDITOR_UF_CONFIGURATORS_TOOLTIP_LENGTH_VALIDATION_ERROR', { 165 '#MAX_LENGTH#': MAX_TOOLTIP_LENGTH 166 }); 167 input.renderError(errorText); 168 return false;
169 } 170 input.renderError(''); 171 return true; 172 } 173 }, { 174 key: "setCheckBox", 175 value: function setCheckBox(checkBox) { 176 if (!main_core.Type.isNull(babelHelpers.classPrivateFieldGet(this, _checkBox))) { 177 main_core.Event.unbind(babelHelpers.classPrivateFieldGet(this, _checkBox), 'click', babelHelpers.classPrivateFieldGet(this, _checkBoxHandler)); 178 } 179 babelHelpers.classPrivateFieldSet(this, _checkBox, checkBox); 180 if (this.isInputEnabled()) { 181 babelHelpers.classPrivateFieldGet(this, _checkBox).checked = true; 182 } 183 if (!main_core.Type.isNull(babelHelpers.classPrivateFieldGet(this, _checkBox))) { 184 main_core.Event.bind(babelHelpers.classPrivateFieldGet(this, _checkBox), 'click', babelHelpers.classPrivateFieldGet(this, _checkBoxHandler)); 185 } 186 } 187 }, { 188 key: "getTooltip", 189 value: function getTooltip() { 190 return this.isInputEnabled() ? this.getInput().getInputText() : ''; 191 } 192 }, { 193 key: "getCaption", 194 value: function getCaption() { 195 return babelHelpers.classPrivateFieldGet(this, _caption); 196 } 197 }, { 198 key: "isInputEnabled", 199 value: function isInputEnabled() { 200 return babelHelpers.classPrivateFieldGet(this, _isShowInput); 201 } 202 }, { 203 key: "getInput", 204 value: function getInput() { 205 if (main_core.Type.isNull(babelHelpers.classPrivateFieldGet(this, _textInput))) { 206 babelHelpers.classPrivateFieldSet(this, _textInput, new TextInput(babelHelpers.classPrivateFieldGet(this, _id$1), this, babelHelpers.classPrivateFieldGet(this, _previousTooltip))); 207 } 208 return babelHelpers.classPrivateFieldGet(this, _textInput); 209 } 210 }]); 211 return TooltipConfigurator; 212 }(); 213 function _onCheckBoxClick2() { 214 babelHelpers.classPrivateFieldSet(this, _isShowInput, !babelHelpers.classPrivateFieldGet(this, _isShowInput)); 215 babelHelpers.classPrivateFieldGet(this, _textInput).adjustVisibility(); 216 } 217 218 exports.TooltipConfigurator = TooltipConfigurator; 219 220}((this.BX.UI.EntityEditorUfConfigurators = this.BX.UI.EntityEditorUfConfigurators || {}),BX)); 221//# sourceMappingURL=tooltip-configurator.bundle.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.