@hpcc-js/form 2.12.2 → 2.12.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.min.js CHANGED
@@ -1,2 +1,2 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@hpcc-js/api"),require("@hpcc-js/common")):"function"==typeof define&&define.amd?define(["exports","@hpcc-js/api","@hpcc-js/common"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["@hpcc-js/form"]={},t["@hpcc-js/api"],t["@hpcc-js/common"])}(this,function(t,e,n){"use strict";var i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)};function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function r(t,e){void 0===e&&(e={});var n=e.insertAt;if(t&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&i.firstChild?i.insertBefore(o,i.firstChild):i.appendChild(o),o.styleSheet?o.styleSheet.cssText=t:o.appendChild(document.createTextNode(t))}}"function"==typeof SuppressedError&&SuppressedError;r(".form_Input button,.form_Input input,.form_Input select,.form_Input textarea{padding:2px}.form_Input button{cursor:pointer}.form_Input input.color-text{width:120px}.form_Input input.color-text+input{position:absolute;width:57px}.form_Input input[type=textbox],.form_Input textarea{box-sizing:border-box;display:block;width:100%}.form_Input ul{float:left;list-style-type:none;margin:0;padding:0}.form_Input li{float:left;list-style-position:inside}");var a=function(t){function n(){var n=t.call(this)||this;return n._inputElement=[],e.IInput.call(n),n._tag="div",n}return o(n,t),n.prototype.enter=function(e,n){t.prototype.enter.call(this,e,n);var i=this;this._inputElement[0]=n.append("button").attr("name",this.name()).on("click",function(t){t.click(t)}).on("blur",function(t){t.blur(t)}).on("change",function(t){i.value([i._inputElement[0].property("value")]),t.change(t,!0)})},n.prototype.update=function(e,n){t.prototype.update.call(this,e,n),this._inputElement[0].text(this.value())},n}(n.HTMLWidget);a.prototype._class+=" form_Button",a.prototype.implements(e.IInput.prototype);var l=function(t){function n(){var n=t.call(this)||this;return n._inputElement=[],e.IInput.call(n),n._tag="div",n}return o(n,t),n.prototype.enter=function(e,n){t.prototype.enter.call(this,e,n);var i=this,o=n.append("ul");this.selectOptions().length||this.selectOptions().push(""),this.selectOptions().forEach(function(t,e){i._inputElement[e]=o.append("li").append("input").attr("type","checkbox"),i._inputElement[e].node().insertAdjacentHTML("afterend","<text>"+t+"</text>")}),this._inputElement.forEach(function(t,e){t.attr("name",i.name()),t.on("click",function(t){t.click(t)}),t.on("blur",function(t){t.blur(t)}),t.on("change",function(t){var e=[];i._inputElement.forEach(function(t){t.property("checked")&&e.push(t.property("value"))}),i.value(e),t.change(t,!0)})})},n.prototype.update=function(e,n){t.prototype.update.call(this,e,n);var i=this;this._inputElement.forEach(function(t,e){t.property("value",i.selectOptions()[e]),-1!==i.value().indexOf(i.selectOptions()[e])&&"false"!==i.value()?t.property("checked",!0):t.property("checked",!1)})},n.prototype.insertSelectOptions=function(t){var e="";t.length>0?t.forEach(function(t){var n=t instanceof Array?t[0]:t,i=t instanceof Array?t[1]?t[1]:t[0]:t;e+="<option value='"+n+"'>"+i+"</option>"}):e+="<option>selectOptions not set</option>",this._inputElement[0].html(e)},n}(n.HTMLWidget);l.prototype._class+=" form_CheckBox",l.prototype.implements(e.IInput.prototype),l.prototype.publish("selectOptions",[],"array","Array of options used to fill a dropdown list");var s=function(t){function i(){var n=t.call(this)||this;return n._inputElement=[],e.IInput.call(n),n._tag="div",n}return o(i,t),i.prototype.enter=function(e,i){t.prototype.enter.call(this,e,i);var o=this;this._inputElement[0]=i.append("input").attr("type","text"),this._inputElement[0].classed("color-text",!0),this._inputElement[1]=i.append("input").attr("type","color"),this._inputElement.forEach(function(t,e){t.on("click",function(t){t.click(t)}),t.on("blur",function(t){t.blur(t)}),t.on("change",function(t){0===e?(o._inputElement[1].property("value",n.rgb(o._inputElement[0].property("value")).toString()),o.value(o._inputElement[0].property("value"))):(o._inputElement[0].property("value",o._inputElement[1].property("value")),o.value(n.rgb(o._inputElement[1].property("value")).toString())),t.change(t,!0)})})},i.prototype.update=function(e,i){t.prototype.update.call(this,e,i);var o=this;this._inputElement.forEach(function(t){t.attr("name",o.name())}),this._inputElement[0].attr("type","text"),this._inputElement[1].attr("type","color"),this._inputElement[0].property("value",this.value()),this._inputElement[1].property("value",n.rgb(this.value()).toString());var r=this._inputElement[0].node().getBoundingClientRect();this._inputElement[1].style("height",r.height-2+"px")},i}(n.HTMLWidget);s.prototype._class+=" form_ColorInput",s.prototype.implements(e.IInput.prototype);r(".form_Form{color:#404040}.form_Form tbody td{border:1px solid #e5e5e5;white-space:nowrap}.form_Form td.prompt{background-color:#e5e5e5;padding:2px;vertical-align:middle}.form_Form td.input{padding:2px;vertical-align:middle;width:100%}.form_Form td.input .common_HTMLWidget ul{margin:0}.form_Form tfoot button{margin:5px}.form_Form tbody tr:hover{background-color:#fafafa}.form_Form .form_Button button{word-wrap:break-word;background-position:-1px -1px;background:#eff3f6 linear-gradient(-180deg,#fafbfc,#eff3f6 90%) repeat-x scroll -1px -1px /110% 110% padding-box border-box;border:1px solid rgba(27,31,35,.2);border-radius:3px 3px 3px 3px;bottom:0;box-sizing:border-box;color:#24292e;column-rule-color:#24292e;cursor:pointer;height:28px;left:0;outline:0 none #24292e;overflow-wrap:break-word;padding:3px 10px;perspective-origin:57.2938px 14px;position:relative;right:0;text-decoration:none solid #24292e;top:0;transform-origin:57.2938px 14px;user-select:none;vertical-align:middle;white-space:nowrap}.form_Form .form_Button button[disabled=disabled]{background:#dbdfe2}.form_Form .form_Button button:focus{box-shadow:0 0 0 .2em rgba(3,102,214,.3)}.form_Form .form_Button button:hover{background:#dbdfe2}.form_Form .form_Button.default button{word-wrap:break-word;background:#28a745 linear-gradient(-180deg,#34d058,#28a745 90%) repeat-x scroll -1px -1px /110% 110% padding-box border-box;color:#fff;column-rule-color:#fff;outline:0 none #fff;perspective-origin:44.975px 17px;text-decoration:none solid #fff;transform-origin:44.975px 17px}.form_Form .form_Button.default button[disabled=disabled],.form_Form .form_Button.default button[disabled=disabled]:hover{background:#dbdfe2}.form_Form .form_Button.default button:hover{background:#149331}");var p=function(t){function e(){var e=t.call(this)||this;return e._tag="form",e}return o(e,t),e.prototype.data=function(t){if(!arguments.length){var e=[];return this.inputsForEach(function(t){e.push(t.value())}),e}return this.inputsForEach(function(e,n){t&&t.length>n&&e.value(t[n]).render()}),this},e.prototype.inputsForEach=function(t,e){var i=0;this.inputs().forEach(function(o){(o instanceof n.WidgetArray?o.content():[o]).forEach(function(n){e?t.call(e,n,i++):t(n,i++)})})},e.prototype.inputsMap=function(){var t={};return this.inputs().forEach(function(e){t[e.name()]=e}),t},e.prototype.calcMaxColumns=function(){var t=0;return this.inputs().forEach(function(e){var i=e instanceof n.WidgetArray?e.content():[e];i.length>t&&(t=i.length)}),t},e.prototype.values=function(t){if(!arguments.length){var e={};return this.inputsForEach(function(t){var n=t.type?t.type():"text";if(t.value()||!this.omitBlank())switch(n){case"checkbox":e[t.name()]=t.value_exists()?!!t.value():void 0;break;case"number":var i=t.value();e[t.name()]=""===i?void 0:+i;break;default:e[t.name()]=t.value_exists()?t.value():void 0}},this),e}return this.inputsForEach(function(e){t[e.name()]?e.value(t[e.name()]):this.omitBlank()&&e.value("")},this),this},e.prototype.submit=function(){var t=!0;this.validate()&&(t=this.checkValidation()),(this.allowEmptyRequest()||this.inputs().some(function(t){return-1!==t._class.indexOf("WidgetArray")?t.content().some(function(t){return t.hasValue()}):t.hasValue()}))&&this.click(t?this.values():null,null,t)},e.prototype.clear=function(){this.inputsForEach(function(t){switch(t.classID()){case"form_Slider":t.allowRange()?t.value([t.low(),t.low()]).render():t.value(t.low()).render();break;case"form_CheckBox":t.value(!1).render();break;case"form_Button":break;default:t.value(void 0).render()}})},e.prototype.checkValidation=function(){var t=!0,e=[];return this.inputsForEach(function(t){t.isValid()||e.push("'"+t.label()+"' value is invalid.")}),e.length>0&&(alert(e.join("\n")),t=!1),t},e.prototype.enter=function(e,i){t.prototype.enter.call(this,e,i),i.on("submit",function(){n.d3Event().preventDefault()}),this._placeholderElement.style("overflow","auto");var o=i.append("table");this.tbody=o.append("tbody"),this.tfoot=o.append("tfoot"),this.btntd=this.tfoot.append("tr").append("td").attr("colspan",2);var r=this;this._controls=[(new a).classed({default:!0}).value("Submit").on("click",function(){r.submit()},!0),(new a).value("Clear").on("click",function(){r.clear()},!0)];var l=r.btntd.append("div").style("float","right");this._controls.forEach(function(t){var e=l.append("span").style("float","left");t.target(e.node()).render()})},e.prototype.update=function(e,i){t.prototype.update.call(this,e,i),this._maxCols=this.calcMaxColumns();var o=this,r=this.tbody.selectAll("tr").data(this.inputs());r.enter().append("tr").each(function(t,e){var i=n.select(this),r=t instanceof n.WidgetArray?t.content():[t];r.forEach(function(t,e){i.append("td").attr("class","prompt");var a=i.append("td").attr("class","input");if(e===r.length-1&&r.length<o._maxCols&&a.attr("colspan",2*(o._maxCols-r.length+1)),t.target(a.node()).render(),t instanceof n.SVGWidget){var l=t.element().node().getBBox();a.style("height",l.height+"px"),t.resize().render()}t._inputElement instanceof Array&&t._inputElement.forEach(function(t){t.on("keyup.form",function(t){setTimeout(function(){o._controls[0].disable(!o.allowEmptyRequest()&&!o.inputs().some(function(t){return-1!==t._class.indexOf("WidgetArray")?t.content().some(function(t){return t.hasValue()}):t.hasValue()}))},100)})})})}).merge(r).each(function(t,e){var i=n.select(this);(t instanceof n.WidgetArray?t.content():[t]).forEach(function(t,e){i.select("td.prompt").text(t.label()+":")})}),r.each(function(t,e){0===e&&t.setFocus&&t.setFocus()}),r.exit().each(function(t,e){(t instanceof n.WidgetArray?t.content():[t]).forEach(function(t,e){t.target(null)})}).remove(),this.tfoot.style("display",this.showSubmit()?"table-footer-group":"none"),this.btntd.attr("colspan",2*this._maxCols),this.allowEmptyRequest()||setTimeout(function(){o._controls[0].disable(!o.allowEmptyRequest()&&!o.inputs().some(function(t){return-1!==t._class.indexOf("WidgetArray")?t.content().some(function(t){return t.hasValue()}):t.hasValue()}))},100)},e.prototype.exit=function(e,n){this.inputsForEach(function(t){return t.target(null)}),t.prototype.exit.call(this,e,n)},e.prototype.click=function(t,e,n){},e}(n.HTMLWidget);p.prototype._class+=" form_Form",p.prototype.publish("validate",!0,"boolean","Enable/Disable input validation"),p.prototype.publish("inputs",[],"widgetArray","Array of input widgets",null,{render:!1}),p.prototype.publish("showSubmit",!0,"boolean","Show Submit/Cancel Controls"),p.prototype.publish("omitBlank",!1,"boolean","Drop Blank Fields From Submit"),p.prototype.publish("allowEmptyRequest",!1,"boolean","Allow Blank Form to be Submitted");var h=function(t){function n(){var n=t.call(this)||this;return n._inputElement=[],n._labelElement=[],e.IInput.call(n),n._tag="div",n}return o(n,t),n.prototype.checked=function(t){return arguments.length?(this._inputElement[0]&&this._inputElement[0].property("checked",t),this):!!this._inputElement[0]&&this._inputElement[0].property("checked")},n.prototype.enter=function(e,n){t.prototype.enter.call(this,e,n),this._labelElement[0]=n.append("label").attr("for",this.id()+"_input").style("visibility",this.inlineLabel_exists()?"visible":"hidden");var i=this;switch(this.type()){case"button":this._inputElement[0]=n.append("button").attr("id",this.id()+"_input");break;case"textarea":this._inputElement[0]=n.append("textarea").attr("id",this.id()+"_input");break;default:this._inputElement[0]=n.append("input").attr("id",this.id()+"_input").attr("type",this.type())}this._inputElement.forEach(function(t,e){t.attr("name",i.name()),t.on("click",function(t){t.click(t)}),t.on("blur",function(t){t.blur(t)}),t.on("change",function(e){i.value([t.property("value")]),e.change(e,!0)}),t.on("keyup",function(e){i.value([t.property("value")]),e.change(e,!1)})})},n.prototype.update=function(e,n){switch(t.prototype.update.call(this,e,n),this._labelElement[0].style("visibility",this.inlineLabel_exists()?"visible":"hidden").text(this.inlineLabel()),this.type()){case"button":this._inputElement[0].text(this.value());break;case"textarea":this._inputElement[0].property("value",this.value());break;default:this._inputElement[0].attr("type",this.type()),this._inputElement[0].property("value",this.value())}},n}(n.HTMLWidget);h.prototype._class+=" form_Input",h.prototype.implements(e.IInput.prototype),h.prototype.publish("type","text","set","Input type",["number","button","checkbox","date","text","textarea","search","email","time","datetime","hidden"]),h.prototype.publish("inlineLabel",null,"string","Input Label",null,{optional:!0});var u=function(t){function e(){var e=t.call(this)||this;return e._tag="form",e}return o(e,t),e.prototype.fields=function(e){var n=t.prototype.fields.apply(this,arguments);if(arguments.length){var i=this.inputsMap();this.inputs(e.map(function(t){return i[t.id()]||(new h).name(t.id()).label(t.label()).type(t.type())}))}return n},e.prototype.data=function(e){if(!arguments.length)return t.prototype.data.call(this);if(t.prototype.data.call(this,e[0]),e[0]){var n=this.inputs(),i=e[0][this.columns().length],o=0;for(var r in i)n[o].name(r),++o}return this},e}(p);u.prototype._class+=" form_FieldForm";var c=function(t){function n(){var n=t.call(this)||this;return n._inputElement=[],n._labelElement=[],n._rangeData=[],e.IInput.call(n),n._tag="div",n}return o(n,t),n.prototype.enter=function(e,n){t.prototype.enter.call(this,e,n),this._labelElement[0]=n.append("label").attr("for",this.id()+"_input").style("visibility",this.inlineLabel_exists()?"visible":"hidden"),this._inputElement.push(n.append("input").attr("id",this.id()+"_input_min").attr("type",this.type())),this._inputElement.push(n.append("input").attr("id",this.id()+"_input_max").attr("type",this.type()));var i=this;this._inputElement.forEach(function(t,e){t.attr("name",i.name()),t.on("click",function(t){t.click(t)}),t.on("blur",function(t){t.blur(t)}),t.on("change",function(n){i._rangeData[e]=t.property("value"),i.value(i._rangeData),n.change(n,!0)})})},n.prototype.update=function(e,n){t.prototype.update.call(this,e,n),this._labelElement[0].style("visibility",this.inlineLabel_exists()?"visible":"hidden").text(this.inlineLabel()),this._rangeData=this.value(),this._inputElement.forEach(function(t,e){t.attr("type",this.type()).property("value",this._rangeData.length>e?this._rangeData[e]:"")},this)},n}(n.HTMLWidget);c.prototype._class+=" form_InputRange",c.prototype.implements(e.IInput.prototype),c.prototype.publish("type","text","set","InputRange type",["number","date","text","time","datetime","hidden"]),c.prototype.publish("inlineLabel",null,"string","InputRange Label",null,{optional:!0}),c.prototype.publish("value",["",""],"array","Input Current Value",null,{override:!0});r(".onoffswitch-checkbox{display:none}.onoffswitch{height:20px;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;width:100px}.onoffswitch-label{border:1px solid #999;cursor:pointer;display:block;height:20px;overflow:hidden}.onoffswitch-inner{display:block;position:relative;transition:margin .3s ease-in 0s}.onoffswitch-inner>.onoffswitch-offText,.onoffswitch-inner>.onoffswitch-onText{height:100%}.onoffswitch-inner>.onoffswitch-offText{font-weight:700;position:absolute;right:0;text-align:right;transition:all .3s ease-in 0s;width:100%}.onoffswitch-inner>.onoffswitch-onText{font-weight:700;left:-100%;position:absolute;text-align:left;transition:all .3s ease-in 0s;width:100%}.onoffswitch-switch{background:#fff;border:1px solid #999;bottom:0;display:block;left:4px;margin:-1px;position:absolute;right:78px;top:0;transition:all .3s ease-in 0s;width:20px}.onoffswitch-checkbox:checked+.onoffswitch-label .onoffswitch-inner>.onoffswitch-offText{right:-100%}.onoffswitch-checkbox:checked+.onoffswitch-label .onoffswitch-inner>.onoffswitch-onText{left:0}.onoffswitch-checkbox:checked+.onoffswitch-label .onoffswitch-switch{left:calc(100% - 20px)}");var f=function(t){function n(){var n=t.call(this)||this;return n._inputElement=[],e.IInput.call(n),n._tag="div",n}return o(n,t),n.prototype.enter=function(e,n){t.prototype.enter.call(this,e,n),n.classed("onoffswitch",!0);var i=this;this._input=n.append("input").attr("class","onoffswitch-checkbox").attr("type","checkbox").attr("id",this.id()+"_onOff").on("click",function(t){t.click(t)}).on("blur",function(t){t.blur(t)}).on("change",function(t){var e=[];i._inputElement.forEach(function(t,n){t.property("checked")&&e.push(t.property("value"))}),i.value(e),t.change(t,!0)});var o=n.append("label").attr("class","onoffswitch-label").attr("for",this.id()+"_onOff"),r=o.append("div").attr("class","onoffswitch-inner");r.append("div").attr("class","onoffswitch-offText").style("padding-right",this.containerRadius()/2+"px").text(this.offText()),r.append("div").attr("class","onoffswitch-onText").style("padding-left",this.containerRadius()/2+"px").style("width","calc(100% - ".concat(this.containerRadius()/2,"px)")).text(this.onText()),o.append("div").attr("class","onoffswitch-switch")},n.prototype.update=function(e,n){t.prototype.update.call(this,e,n),this._input.attr("name",this.name()),n.style("margin-left",this.marginLeft()+"px").style("margin-bottom",this.marginBottom()+"px").style("width",this.minWidth()+"px");var i=this.minHeight()-4*this.gutter();n.select(".onoffswitch-switch").style("height",i+"px").style("width",i+"px").style("top",2*this.gutter()+1+"px").style("border-radius",this.switchRadius()+"px"),n.select(".onoffswitch-inner").style("min-height",this.minHeight()+"px"),n.select(".onoffswitch-label").style("border-radius",this.containerRadius()+"px"),n.select(".onoffswitch-offText").style("color",this.offFontColor()).style("background-color",this.offColor()),n.select(".onoffswitch-onText").style("color",this.onFontColor()).style("background-color",this.onColor())},n}(n.HTMLWidget);f.prototype._class+=" form_OnOff",f.prototype.implements(e.IInput.prototype),f.prototype.publish("marginLeft",0,"number","Margin left of OnOff"),f.prototype.publish("marginBottom",0,"number","Margin bottom of OnOff"),f.prototype.publish("minWidth",100,"number","Minimum width of OnOff (pixels)"),f.prototype.publish("minHeight",20,"number","Minimum height of OnOff (pixels)"),f.prototype.publish("gutter",1,"number","Space between switch and border of OnOff (pixels)"),f.prototype.publish("onText","Save","string","Text to display when 'ON'"),f.prototype.publish("offText","Properties","string","Text to display when 'OFF'"),f.prototype.publish("switchRadius",10,"number","Border radius of switch (pixels)"),f.prototype.publish("containerRadius",10,"number","Border radius of OnOff (pixels)"),f.prototype.publish("onColor","#2ecc71","html-color","Background color when 'ON'"),f.prototype.publish("offColor","#ecf0f1","html-color","Background color when 'OFF'"),f.prototype.publish("onFontColor","#2c3e50","html-color","Font color when 'ON'"),f.prototype.publish("offFontColor","#7f8c8d","html-color","Font color when 'OFF'");var d=function(t){function n(){var n=t.call(this)||this;return n._inputElement=[],e.IInput.call(n),n._tag="div",n}return o(n,t),n.prototype.enter=function(e,n){t.prototype.enter.call(this,e,n);var i=this,o=n.append("ul");this.selectOptions().length||this.selectOptions().push(""),this.selectOptions().forEach(function(t,e){i._inputElement[e]=o.append("li").append("input").attr("type","radio"),i._inputElement[e].node().insertAdjacentHTML("afterend","<text>"+t+"</text>")}),this._inputElement.forEach(function(t,e){t.attr("name",i.name()),t.on("click",function(t){t.click(t)}),t.on("blur",function(t){t.blur(t)}),t.on("change",function(e){i.value([t.property("value")]),e.change(e,!0)})})},n.prototype.update=function(e,n){t.prototype.update.call(this,e,n);var i=this;this._inputElement.forEach(function(t,e){t.property("value",i.selectOptions()[e]),-1!==i.value().indexOf(i.selectOptions()[e])&&"false"!==i.value()?t.property("checked",!0):t.property("checked",!1)})},n}(n.HTMLWidget);d.prototype._class+=" form_Radio",d.prototype.implements(e.IInput.prototype),d.prototype.publish("selectOptions",[],"array","Array of options used to fill a dropdown list");var m=function(t){function i(){var n=t.call(this)||this;return n._inputElement=[],e.IInput.call(n),n._tag="div",n}return o(i,t),i.prototype.enter=function(e,i){t.prototype.enter.call(this,e,i);var o=this;this._inputElement[0]=i.append("input").attr("type","range"),this._inputElement[1]=i.append("input").attr("type","number"),this._inputElement.forEach(function(t,e){t.attr("name",o.name()),t.on("click",function(t){t.click(t)}),t.on("blur",function(t){t.blur(t)}),t.on("change",function(t){0===e?(o._inputElement[1].property("value",n.rgb(o._inputElement[0].property("value")).toString()),o.value(o._inputElement[0].property("value"))):(o._inputElement[0].property("value",o._inputElement[1].property("value")),o.value(n.rgb(o._inputElement[1].property("value")).toString())),t.change(t,!0)})})},i.prototype.update=function(e,n){t.prototype.update.call(this,e,n),this._inputElement[0].attr("type","range"),this._inputElement[0].property("value",this.value()),this._inputElement[0].attr("min",this.low()),this._inputElement[0].attr("max",this.high()),this._inputElement[0].attr("step",this.step()),this._inputElement[1].attr("type","number"),this._inputElement[1].property("value",this.value()),this._inputElement[1].attr("min",this.low()),this._inputElement[1].attr("max",this.high()),this._inputElement[1].attr("step",this.step())},i.prototype.insertSelectOptions=function(t){var e="";t.length>0?t.forEach(function(t){var n=t instanceof Array?t[0]:t,i=t instanceof Array?t[1]?t[1]:t[0]:t;e+="<option value='"+n+"'>"+i+"</option>"}):e+="<option>selectOptions not set</option>",this._inputElement[0].html(e)},i}(n.HTMLWidget);m.prototype._class+=" form_Range",m.prototype.implements(e.IInput.prototype),m.prototype.publish("type","text","set","Input type",["html-color","number","checkbox","button","select","textarea","date","text","range","search","email","time","datetime"]),m.prototype.publish("selectOptions",[],"array","Array of options used to fill a dropdown list"),m.prototype.publish("low",null,"number","Minimum value for Range input"),m.prototype.publish("high",null,"number","Maximum value for Range input"),m.prototype.publish("step",null,"number","Step value for Range input");var y=function(t){function n(){var n=t.call(this)||this;return n._inputElement=[],e.IInput.call(n),n._tag="div",n}return o(n,t),n.prototype.enter=function(e,n){t.prototype.enter.call(this,e,n);var i=this;this._inputElement[0]=n.append("select").attr("name",this.name()).on("click",function(t){t.click(t)}).on("blur",function(t){t.blur(t)}).on("change",function(t){i.value([i._inputElement[0].property("value")]),t.change(t,!0)})},n.prototype.update=function(e,n){t.prototype.update.call(this,e,n),this.insertSelectOptions(this.selectOptions()),this._inputElement[0].property("value",this.value()).style("max-width",this.maxWidth_exists()?this.maxWidth()+"px":null)},n.prototype.insertSelectOptions=function(t){var e="";t.length>0?t.forEach(function(t){var n=t instanceof Array?t[0]:t,i=t instanceof Array?t[1]?t[1]:t[0]:t;e+="<option value='"+n+"'>"+i+"</option>"}):e+="<option>selectOptions not set</option>",this._inputElement[0].html(e)},n}(n.HTMLWidget);y.prototype._class+=" form_Select",y.prototype.implements(e.IInput.prototype),y.prototype.publish("selectOptions",[],"array","Array of options used to fill a dropdown list"),y.prototype.publish("maxWidth",120,"number","Width",null,{optional:!0});r(".form_Slider .ticks{font:10px sans-serif}.form_Slider .track,.form_Slider .track-inset,.form_Slider .track-overlay{stroke-linecap:round}.form_Slider .track{stroke:#000;stroke-opacity:.3;stroke-width:10px}.form_Slider .track-inset{stroke:#ddd;stroke-width:8px}.form_Slider .track-overlay{stroke-width:50px;stroke:transparent;cursor:crosshair;pointer-events:stroke}.form_Slider .handle{fill:#fff;stroke:#000;stroke-opacity:.5;stroke-width:1.25px}.form_Slider .tick-line{stroke:#000;stroke-opacity:.5;stroke-width:1px;shape-rendering:crispEdges}");var g=function(t){function i(){var n=t.call(this)||this;return n.handleLeftPos=0,n.handleRightPos=0,n.handlePath=function(t){var e=+("r"===t),n=e?1:-1,i=this.allowRange()?.5:0,o="M"+i*n+","+"18A6,6 0 0 "+e+" "+6.5*n+",24V30A6,6 0 0 "+e+" "+i*n+",36";return this.allowRange()?o+="ZM"+2.5*n+",26V28M"+4.5*n+",26V28":o+="M"+1*n+",26V28",o},e.IInput.call(n),n}return o(i,t),i.prototype.enter=function(e,i){var o=this;if(t.prototype.enter.call(this,e,i),this.resize({width:this.width(),height:50}),this.xScale=n.scaleLinear().clamp(!0),this.slider=i.append("g").attr("class","slider"),null===this.low()&&null===this.high()&&null!==this.lowDatetime()&&null!==this.highDatetime()){var r=n.timeParse(this.timePattern()?this.timePattern():"%Q");this.low(r(this.lowDatetime()).getTime()),this.high(r(this.highDatetime()).getTime())}this.slider.append("line").attr("class","track").select(function(){return this.parentNode.appendChild(this.cloneNode(!0))}).attr("class","track-inset").select(function(){return this.parentNode.appendChild(this.cloneNode(!0))}).attr("class","track-overlay").call(n.drag().on("start",function(){var t=n.d3Event();o.moveStartPos=t.x,o.handleLeftStartPos=o.handleLeftPos,o.handleRightStartPos=o.handleRightPos,o.allowRange()&&o.handleLeftPos<=t.x&&t.x<=o.handleRightPos?o.moveMode="both":Math.abs(t.x-o.handleLeftPos)<Math.abs(t.x-o.handleRightPos)?o.moveMode="left":o.moveMode="right",o.moveHandleTo(t.x)}).on("drag",function(){o.moveHandleTo(n.d3Event().x)}).on("end",function(){o.moveHandleTo(n.d3Event().x),o.data([[o.xScale.invert(o.handleLeftPos),o.xScale.invert(o.handleRightPos)]]),o.checkChangedValue()})),this.slider.insert("g",".track-overlay").attr("class","ticks").attr("transform","translate(0, ".concat(this.fontSize()+this.tickHeight()/2,")")),this.handleRight=this.slider.insert("path",".track-overlay").attr("class","handle"),this.handleLeft=this.slider.insert("path",".track-overlay").attr("class","handle")},i.prototype.update=function(e,i){t.prototype.update.call(this,e,i);var o=this;this.xScale.domain([this.low(),this.high()]).range([0,this.width()-2*this.padding()]),this.slider.attr("transform","translate("+(-this.width()/2+this.padding())+",0)"),this.slider.selectAll("line.track,line.track-inset,line.track-overlay").attr("x1",this.xScale.range()[0]).attr("x2",this.xScale.range()[1]);var r=(this.width()-2*this.padding())/(this.tickCount()-1),a=[];if(null!==this.tickDateFormat()&&null!==this.timePattern())for(var l=n.timeParse("%Q"),s=n.timeFormat(this.tickDateFormat()),p=(this.high()-this.low())/(this.tickCount()-1),h=0;h<this.tickCount();h++){var u=l(""+(this.low()+p*h));a.push(s(u))}else{var c=n.format(this.tickValueFormat()),f=(this.high()-this.low())/(this.tickCount()-1);for(h=0;h<this.tickCount();h++){var d=this.low()+f*h;a.push(c(d))}}var m=this.slider.selectAll("g.tick").data(a),y=m.enter().append("g").attr("class","tick");y.append("text").attr("class","tick-text"),y.append("line").attr("class","tick-line"),y.merge(m).each(function(t,e){var i=r*e;n.select(this).select("text.tick-text").style("font-size",o.fontSize()).attr("x",function(){return 0===e?i-2:e===o.tickCount()-1?i+2:i}).attr("y",o.tickHeight()+o.tickOffset()/2+o.fontSize()).attr("text-basline","text-before-edge").attr("text-anchor",function(){return 0===e?"start":e===o.tickCount()-1?"end":"middle"}).text(function(){return t}),n.select(this).select("line.tick-line").attr("x1",i).attr("x2",i).attr("y1",o.tickOffset()-1).attr("y2",o.tickOffset()+o.tickHeight()).style("stroke","#000").style("stroke-width",1)}),this.slider.node().appendChild(this.handleRight.node()),this.slider.node().appendChild(this.handleLeft.node()),this.handleLeftPos=this.lowPos(),this.handleRightPos=this.highPos(),this.updateHandles(),this.checkChangedValue()},i.prototype.checkChangedValue=function(){this.prevValue!==this.value()&&void 0!==this.prevValue&&this.change(this),this.prevValue=this.value()},i.prototype.updateHandles=function(){var t=this;this.handleLeft.attr("transform","translate(".concat(this.handleLeftPos,", -28)")).attr("d",function(e){return t.handlePath("l")}),this.handleRight.attr("transform","translate(".concat(this.handleRightPos,", -28)")).attr("d",function(e){return t.handlePath("r")})},i.prototype.lowPos=function(){var t=[[this.low(),this.high()]];return this.data().length>0&&"number"==typeof this.data()[0][0]&&"number"==typeof this.data()[0][1]&&(t=this.data()),this.xScale(t[0][0])},i.prototype.highPos=function(){var t=[[this.low(),this.high()]];return this.data().length>0&&"number"==typeof this.data()[0][0]&&"number"==typeof this.data()[0][1]&&(t=this.data()),this.xScale(t[0][this.allowRange()?1:0])},i.prototype.moveHandleTo=function(t){if(this.allowRange())switch(this.moveMode){case"both":this.handleLeftPos=this.handleLeftStartPos+t-this.moveStartPos,this.handleRightPos=this.handleRightStartPos+t-this.moveStartPos;break;case"left":this.handleLeftPos=t,this.handleLeftPos>this.handleRightPos&&(this.handleRightPos=this.handleLeftPos);break;case"right":this.handleRightPos=t,this.handleRightPos<this.handleLeftPos&&(this.handleLeftPos=this.handleRightPos)}else this.handleLeftPos=this.handleRightPos=t;this.handleLeftPos=this.constrain(this.handleLeftPos),this.handleRightPos=this.constrain(this.handleRightPos),this.value(this.allowRange()?[this.xScale.invert(this.handleLeftPos),this.xScale.invert(this.handleRightPos)]:this.xScale.invert(this.handleLeftPos)),this.updateHandles()},i.prototype.constrain=function(t){var e=this.xScale.range();return t<e[0]&&(t=e[0]),t>e[1]&&(t=e[1]),this.nearestStep(t)},i.prototype.nearestStep=function(t){var e=this.xScale.invert(t);return this.xScale(this.low()+Math.round((e-this.low())/this.step())*this.step())},i}(n.SVGWidget);g.prototype._class+=" form_Slider",g.prototype.implements(e.IInput.prototype),g.prototype.publish("padding",16,"number","Outer Padding",null,{tags:["Basic"]}),g.prototype.publish("fontSize",12,"number","Font Size",null,{tags:["Basic"]}),g.prototype.publish("fontFamily",null,"string","Font Name",null,{tags:["Basic"]}),g.prototype.publish("fontColor",null,"html-color","Font Color",null,{tags:["Basic"]}),g.prototype.publish("allowRange",!1,"boolean","Allow Range Selection",null,{tags:["Intermediate"]}),g.prototype.publish("low",null,"number","Low",null,{tags:["Intermediate"]}),g.prototype.publish("high",null,"number","High",null,{tags:["Intermediate"]}),g.prototype.publish("step",10,"number","Step",null,{tags:["Intermediate"]}),g.prototype.publish("lowDatetime",null,"string","Low",null,{tags:["Intermediate"]}),g.prototype.publish("highDatetime",null,"string","High",null,{tags:["Intermediate"]}),g.prototype.publish("selectionLabel","","string","Selection Label",null,{tags:["Intermediate"]}),g.prototype.publish("timePattern","%Y-%m-%d","string"),g.prototype.publish("tickCount",10,"number"),g.prototype.publish("tickOffset",5,"number"),g.prototype.publish("tickHeight",8,"number"),g.prototype.publish("tickDateFormat",null,"string"),g.prototype.publish("tickValueFormat",",.0f","string");var b=g.prototype.name;g.prototype.name=function(t){var e=b.apply(this,arguments);if(arguments.length){var i=t instanceof Array?t:[t];n.SVGWidget.prototype.columns.call(this,i)}return e};var v=g.prototype.value;g.prototype.value=function(t){var e=v.apply(this,arguments);return arguments.length?(n.SVGWidget.prototype.data.call(this,[this.allowRange()?t:[t,t]]),e):this.allowRange()?n.SVGWidget.prototype.data.call(this)[0]:n.SVGWidget.prototype.data.call(this)[0][0]};var _=function(t){function e(){var e=t.call(this)||this;return e._tag="div",e.type("textarea"),e}return o(e,t),e.prototype.enter=function(e,n){t.prototype.enter.call(this,e,n)},e.prototype.calcHeight=function(){return Math.max(this.minHeight_exists()?this.minHeight():0,this.height())},e.prototype.update=function(e,n){t.prototype.update.call(this,e,n),this._inputElement[0].attr("rows",this.rows()).attr("cols",this.cols()).attr("wrap",this.wrap()).attr("spellcheck",this.spellcheck()).style("height",this.calcHeight()+"px")},e}(h);_.prototype._class+=" form_TextArea",_.prototype.publish("rows",null,"number","Rows",null,{optional:!0}),_.prototype.publish("cols",null,"number","Columns",null,{optional:!0}),_.prototype.publish("wrap","off","set","Wrap",["off","on"]),_.prototype.publish("minHeight",null,"number","Minimum Height",null,{optional:!0}),_.prototype.publish("spellcheck",null,"boolean","Input spell checking",{optional:!0}),t.BUILD_VERSION="2.108.6",t.Button=a,t.CheckBox=l,t.ColorInput=s,t.FieldForm=u,t.Form=p,t.Input=h,t.InputRange=c,t.OnOff=f,t.PKG_NAME="@hpcc-js/form",t.PKG_VERSION="2.12.2",t.Radio=d,t.Range=m,t.Select=y,t.Slider=g,t.TextArea=_});
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@hpcc-js/api"),require("@hpcc-js/common")):"function"==typeof define&&define.amd?define(["exports","@hpcc-js/api","@hpcc-js/common"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["@hpcc-js/form"]={},t["@hpcc-js/api"],t["@hpcc-js/common"])}(this,function(t,e,n){"use strict";var i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)};function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function r(t,e){void 0===e&&(e={});var n=e.insertAt;if(t&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&i.firstChild?i.insertBefore(o,i.firstChild):i.appendChild(o),o.styleSheet?o.styleSheet.cssText=t:o.appendChild(document.createTextNode(t))}}"function"==typeof SuppressedError&&SuppressedError;r(".form_Input button,.form_Input input,.form_Input select,.form_Input textarea{padding:2px}.form_Input button{cursor:pointer}.form_Input input.color-text{width:120px}.form_Input input.color-text+input{position:absolute;width:57px}.form_Input input[type=textbox],.form_Input textarea{box-sizing:border-box;display:block;width:100%}.form_Input ul{float:left;list-style-type:none;margin:0;padding:0}.form_Input li{float:left;list-style-position:inside}");var a=function(t){function n(){var n=t.call(this)||this;return n._inputElement=[],e.IInput.call(n),n._tag="div",n}return o(n,t),n.prototype.enter=function(e,n){t.prototype.enter.call(this,e,n);var i=this;this._inputElement[0]=n.append("button").attr("name",this.name()).on("click",function(t){t.click(t)}).on("blur",function(t){t.blur(t)}).on("change",function(t){i.value([i._inputElement[0].property("value")]),t.change(t,!0)})},n.prototype.update=function(e,n){t.prototype.update.call(this,e,n),this._inputElement[0].text(this.value())},n}(n.HTMLWidget);a.prototype._class+=" form_Button",a.prototype.implements(e.IInput.prototype);var l=function(t){function n(){var n=t.call(this)||this;return n._inputElement=[],e.IInput.call(n),n._tag="div",n}return o(n,t),n.prototype.enter=function(e,n){t.prototype.enter.call(this,e,n);var i=this,o=n.append("ul");this.selectOptions().length||this.selectOptions().push(""),this.selectOptions().forEach(function(t,e){i._inputElement[e]=o.append("li").append("input").attr("type","checkbox"),i._inputElement[e].node().insertAdjacentHTML("afterend","<text>"+t+"</text>")}),this._inputElement.forEach(function(t,e){t.attr("name",i.name()),t.on("click",function(t){t.click(t)}),t.on("blur",function(t){t.blur(t)}),t.on("change",function(t){var e=[];i._inputElement.forEach(function(t){t.property("checked")&&e.push(t.property("value"))}),i.value(e),t.change(t,!0)})})},n.prototype.update=function(e,n){t.prototype.update.call(this,e,n);var i=this;this._inputElement.forEach(function(t,e){t.property("value",i.selectOptions()[e]),-1!==i.value().indexOf(i.selectOptions()[e])&&"false"!==i.value()?t.property("checked",!0):t.property("checked",!1)})},n.prototype.insertSelectOptions=function(t){var e="";t.length>0?t.forEach(function(t){var n=t instanceof Array?t[0]:t,i=t instanceof Array?t[1]?t[1]:t[0]:t;e+="<option value='"+n+"'>"+i+"</option>"}):e+="<option>selectOptions not set</option>",this._inputElement[0].html(e)},n}(n.HTMLWidget);l.prototype._class+=" form_CheckBox",l.prototype.implements(e.IInput.prototype),l.prototype.publish("selectOptions",[],"array","Array of options used to fill a dropdown list");var s=function(t){function i(){var n=t.call(this)||this;return n._inputElement=[],e.IInput.call(n),n._tag="div",n}return o(i,t),i.prototype.enter=function(e,i){t.prototype.enter.call(this,e,i);var o=this;this._inputElement[0]=i.append("input").attr("type","text"),this._inputElement[0].classed("color-text",!0),this._inputElement[1]=i.append("input").attr("type","color"),this._inputElement.forEach(function(t,e){t.on("click",function(t){t.click(t)}),t.on("blur",function(t){t.blur(t)}),t.on("change",function(t){0===e?(o._inputElement[1].property("value",n.rgb(o._inputElement[0].property("value")).toString()),o.value(o._inputElement[0].property("value"))):(o._inputElement[0].property("value",o._inputElement[1].property("value")),o.value(n.rgb(o._inputElement[1].property("value")).toString())),t.change(t,!0)})})},i.prototype.update=function(e,i){t.prototype.update.call(this,e,i);var o=this;this._inputElement.forEach(function(t){t.attr("name",o.name())}),this._inputElement[0].attr("type","text"),this._inputElement[1].attr("type","color"),this._inputElement[0].property("value",this.value()),this._inputElement[1].property("value",n.rgb(this.value()).toString());var r=this._inputElement[0].node().getBoundingClientRect();this._inputElement[1].style("height",r.height-2+"px")},i}(n.HTMLWidget);s.prototype._class+=" form_ColorInput",s.prototype.implements(e.IInput.prototype);r(".form_Form{color:#404040}.form_Form tbody td{border:1px solid #e5e5e5;white-space:nowrap}.form_Form td.prompt{background-color:#e5e5e5;padding:2px;vertical-align:middle}.form_Form td.input{padding:2px;vertical-align:middle;width:100%}.form_Form td.input .common_HTMLWidget ul{margin:0}.form_Form tfoot button{margin:5px}.form_Form tbody tr:hover{background-color:#fafafa}.form_Form .form_Button button{word-wrap:break-word;background-position:-1px -1px;background:#eff3f6 linear-gradient(-180deg,#fafbfc,#eff3f6 90%) repeat-x scroll -1px -1px /110% 110% padding-box border-box;border:1px solid rgba(27,31,35,.2);border-radius:3px 3px 3px 3px;bottom:0;box-sizing:border-box;color:#24292e;column-rule-color:#24292e;cursor:pointer;height:28px;left:0;outline:0 none #24292e;overflow-wrap:break-word;padding:3px 10px;perspective-origin:57.2938px 14px;position:relative;right:0;text-decoration:none solid #24292e;top:0;transform-origin:57.2938px 14px;user-select:none;vertical-align:middle;white-space:nowrap}.form_Form .form_Button button[disabled=disabled]{background:#dbdfe2}.form_Form .form_Button button:focus{box-shadow:0 0 0 .2em rgba(3,102,214,.3)}.form_Form .form_Button button:hover{background:#dbdfe2}.form_Form .form_Button.default button{word-wrap:break-word;background:#28a745 linear-gradient(-180deg,#34d058,#28a745 90%) repeat-x scroll -1px -1px /110% 110% padding-box border-box;color:#fff;column-rule-color:#fff;outline:0 none #fff;perspective-origin:44.975px 17px;text-decoration:none solid #fff;transform-origin:44.975px 17px}.form_Form .form_Button.default button[disabled=disabled],.form_Form .form_Button.default button[disabled=disabled]:hover{background:#dbdfe2}.form_Form .form_Button.default button:hover{background:#149331}");var p=function(t){function e(){var e=t.call(this)||this;return e._tag="form",e}return o(e,t),e.prototype.data=function(t){if(!arguments.length){var e=[];return this.inputsForEach(function(t){e.push(t.value())}),e}return this.inputsForEach(function(e,n){t&&t.length>n&&e.value(t[n]).render()}),this},e.prototype.inputsForEach=function(t,e){var i=0;this.inputs().forEach(function(o){(o instanceof n.WidgetArray?o.content():[o]).forEach(function(n){e?t.call(e,n,i++):t(n,i++)})})},e.prototype.inputsMap=function(){var t={};return this.inputs().forEach(function(e){t[e.name()]=e}),t},e.prototype.calcMaxColumns=function(){var t=0;return this.inputs().forEach(function(e){var i=e instanceof n.WidgetArray?e.content():[e];i.length>t&&(t=i.length)}),t},e.prototype.values=function(t){if(!arguments.length){var e={};return this.inputsForEach(function(t){var n=t.type?t.type():"text";if(t.value()||!this.omitBlank())switch(n){case"checkbox":e[t.name()]=t.value_exists()?!!t.value():void 0;break;case"number":var i=t.value();e[t.name()]=""===i?void 0:+i;break;default:e[t.name()]=t.value_exists()?t.value():void 0}},this),e}return this.inputsForEach(function(e){t[e.name()]?e.value(t[e.name()]):this.omitBlank()&&e.value("")},this),this},e.prototype.submit=function(){var t=!0;this.validate()&&(t=this.checkValidation()),(this.allowEmptyRequest()||this.inputs().some(function(t){return-1!==t._class.indexOf("WidgetArray")?t.content().some(function(t){return t.hasValue()}):t.hasValue()}))&&this.click(t?this.values():null,null,t)},e.prototype.clear=function(){this.inputsForEach(function(t){switch(t.classID()){case"form_Slider":t.allowRange()?t.value([t.low(),t.low()]).render():t.value(t.low()).render();break;case"form_CheckBox":t.value(!1).render();break;case"form_Button":break;default:t.value(void 0).render()}})},e.prototype.checkValidation=function(){var t=!0,e=[];return this.inputsForEach(function(t){t.isValid()||e.push("'"+t.label()+"' value is invalid.")}),e.length>0&&(alert(e.join("\n")),t=!1),t},e.prototype.enter=function(e,i){t.prototype.enter.call(this,e,i),i.on("submit",function(){n.d3Event().preventDefault()}),this._placeholderElement.style("overflow","auto");var o=i.append("table");this.tbody=o.append("tbody"),this.tfoot=o.append("tfoot"),this.btntd=this.tfoot.append("tr").append("td").attr("colspan",2);var r=this;this._controls=[(new a).classed({default:!0}).value("Submit").on("click",function(){r.submit()},!0),(new a).value("Clear").on("click",function(){r.clear()},!0)];var l=r.btntd.append("div").style("float","right");this._controls.forEach(function(t){var e=l.append("span").style("float","left");t.target(e.node()).render()})},e.prototype.update=function(e,i){t.prototype.update.call(this,e,i),this._maxCols=this.calcMaxColumns();var o=this,r=this.tbody.selectAll("tr").data(this.inputs());r.enter().append("tr").each(function(t,e){var i=n.select(this),r=t instanceof n.WidgetArray?t.content():[t];r.forEach(function(t,e){i.append("td").attr("class","prompt");var a=i.append("td").attr("class","input");if(e===r.length-1&&r.length<o._maxCols&&a.attr("colspan",2*(o._maxCols-r.length+1)),t.target(a.node()).render(),t instanceof n.SVGWidget){var l=t.element().node().getBBox();a.style("height",l.height+"px"),t.resize().render()}t._inputElement instanceof Array&&t._inputElement.forEach(function(t){t.on("keyup.form",function(t){setTimeout(function(){o._controls[0].disable(!o.allowEmptyRequest()&&!o.inputs().some(function(t){return-1!==t._class.indexOf("WidgetArray")?t.content().some(function(t){return t.hasValue()}):t.hasValue()}))},100)})})})}).merge(r).each(function(t,e){var i=n.select(this);(t instanceof n.WidgetArray?t.content():[t]).forEach(function(t,e){i.select("td.prompt").text(t.label()+":")})}),r.each(function(t,e){0===e&&t.setFocus&&t.setFocus()}),r.exit().each(function(t,e){(t instanceof n.WidgetArray?t.content():[t]).forEach(function(t,e){t.target(null)})}).remove(),this.tfoot.style("display",this.showSubmit()?"table-footer-group":"none"),this.btntd.attr("colspan",2*this._maxCols),this.allowEmptyRequest()||setTimeout(function(){o._controls[0].disable(!o.allowEmptyRequest()&&!o.inputs().some(function(t){return-1!==t._class.indexOf("WidgetArray")?t.content().some(function(t){return t.hasValue()}):t.hasValue()}))},100)},e.prototype.exit=function(e,n){this.inputsForEach(function(t){return t.target(null)}),t.prototype.exit.call(this,e,n)},e.prototype.click=function(t,e,n){},e}(n.HTMLWidget);p.prototype._class+=" form_Form",p.prototype.publish("validate",!0,"boolean","Enable/Disable input validation"),p.prototype.publish("inputs",[],"widgetArray","Array of input widgets",null,{render:!1}),p.prototype.publish("showSubmit",!0,"boolean","Show Submit/Cancel Controls"),p.prototype.publish("omitBlank",!1,"boolean","Drop Blank Fields From Submit"),p.prototype.publish("allowEmptyRequest",!1,"boolean","Allow Blank Form to be Submitted");var h=function(t){function n(){var n=t.call(this)||this;return n._inputElement=[],n._labelElement=[],e.IInput.call(n),n._tag="div",n}return o(n,t),n.prototype.checked=function(t){return arguments.length?(this._inputElement[0]&&this._inputElement[0].property("checked",t),this):!!this._inputElement[0]&&this._inputElement[0].property("checked")},n.prototype.enter=function(e,n){t.prototype.enter.call(this,e,n),this._labelElement[0]=n.append("label").attr("for",this.id()+"_input").style("visibility",this.inlineLabel_exists()?"visible":"hidden");var i=this;switch(this.type()){case"button":this._inputElement[0]=n.append("button").attr("id",this.id()+"_input");break;case"textarea":this._inputElement[0]=n.append("textarea").attr("id",this.id()+"_input");break;default:this._inputElement[0]=n.append("input").attr("id",this.id()+"_input").attr("type",this.type())}this._inputElement.forEach(function(t,e){t.attr("name",i.name()),t.on("click",function(t){t.click(t)}),t.on("blur",function(t){t.blur(t)}),t.on("change",function(e){i.value([t.property("value")]),e.change(e,!0)}),t.on("keyup",function(e){i.value([t.property("value")]),e.change(e,!1)})})},n.prototype.update=function(e,n){switch(t.prototype.update.call(this,e,n),this._labelElement[0].style("visibility",this.inlineLabel_exists()?"visible":"hidden").text(this.inlineLabel()),this.type()){case"button":this._inputElement[0].text(this.value());break;case"textarea":this._inputElement[0].property("value",this.value());break;default:this._inputElement[0].attr("type",this.type()),this._inputElement[0].property("value",this.value())}},n}(n.HTMLWidget);h.prototype._class+=" form_Input",h.prototype.implements(e.IInput.prototype),h.prototype.publish("type","text","set","Input type",["number","button","checkbox","date","text","textarea","search","email","time","datetime","hidden"]),h.prototype.publish("inlineLabel",null,"string","Input Label",null,{optional:!0});var u=function(t){function e(){var e=t.call(this)||this;return e._tag="form",e}return o(e,t),e.prototype.fields=function(e){var n=t.prototype.fields.apply(this,arguments);if(arguments.length){var i=this.inputsMap();this.inputs(e.map(function(t){return i[t.id()]||(new h).name(t.id()).label(t.label()).type(t.type())}))}return n},e.prototype.data=function(e){if(!arguments.length)return t.prototype.data.call(this);if(t.prototype.data.call(this,e[0]),e[0]){var n=this.inputs(),i=e[0][this.columns().length],o=0;for(var r in i)n[o].name(r),++o}return this},e}(p);u.prototype._class+=" form_FieldForm";var c=function(t){function n(){var n=t.call(this)||this;return n._inputElement=[],n._labelElement=[],n._rangeData=[],e.IInput.call(n),n._tag="div",n}return o(n,t),n.prototype.enter=function(e,n){t.prototype.enter.call(this,e,n),this._labelElement[0]=n.append("label").attr("for",this.id()+"_input").style("visibility",this.inlineLabel_exists()?"visible":"hidden"),this._inputElement.push(n.append("input").attr("id",this.id()+"_input_min").attr("type",this.type())),this._inputElement.push(n.append("input").attr("id",this.id()+"_input_max").attr("type",this.type()));var i=this;this._inputElement.forEach(function(t,e){t.attr("name",i.name()),t.on("click",function(t){t.click(t)}),t.on("blur",function(t){t.blur(t)}),t.on("change",function(n){i._rangeData[e]=t.property("value"),i.value(i._rangeData),n.change(n,!0)})})},n.prototype.update=function(e,n){t.prototype.update.call(this,e,n),this._labelElement[0].style("visibility",this.inlineLabel_exists()?"visible":"hidden").text(this.inlineLabel()),this._rangeData=this.value(),this._inputElement.forEach(function(t,e){t.attr("type",this.type()).property("value",this._rangeData.length>e?this._rangeData[e]:"")},this)},n}(n.HTMLWidget);c.prototype._class+=" form_InputRange",c.prototype.implements(e.IInput.prototype),c.prototype.publish("type","text","set","InputRange type",["number","date","text","time","datetime","hidden"]),c.prototype.publish("inlineLabel",null,"string","InputRange Label",null,{optional:!0}),c.prototype.publish("value",["",""],"array","Input Current Value",null,{override:!0});r(".onoffswitch-checkbox{display:none}.onoffswitch{height:20px;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;width:100px}.onoffswitch-label{border:1px solid #999;cursor:pointer;display:block;height:20px;overflow:hidden}.onoffswitch-inner{display:block;position:relative;transition:margin .3s ease-in 0s}.onoffswitch-inner>.onoffswitch-offText,.onoffswitch-inner>.onoffswitch-onText{height:100%}.onoffswitch-inner>.onoffswitch-offText{font-weight:700;position:absolute;right:0;text-align:right;transition:all .3s ease-in 0s;width:100%}.onoffswitch-inner>.onoffswitch-onText{font-weight:700;left:-100%;position:absolute;text-align:left;transition:all .3s ease-in 0s;width:100%}.onoffswitch-switch{background:#fff;border:1px solid #999;bottom:0;display:block;left:4px;margin:-1px;position:absolute;right:78px;top:0;transition:all .3s ease-in 0s;width:20px}.onoffswitch-checkbox:checked+.onoffswitch-label .onoffswitch-inner>.onoffswitch-offText{right:-100%}.onoffswitch-checkbox:checked+.onoffswitch-label .onoffswitch-inner>.onoffswitch-onText{left:0}.onoffswitch-checkbox:checked+.onoffswitch-label .onoffswitch-switch{left:calc(100% - 20px)}");var f=function(t){function n(){var n=t.call(this)||this;return n._inputElement=[],e.IInput.call(n),n._tag="div",n}return o(n,t),n.prototype.enter=function(e,n){t.prototype.enter.call(this,e,n),n.classed("onoffswitch",!0);var i=this;this._input=n.append("input").attr("class","onoffswitch-checkbox").attr("type","checkbox").attr("id",this.id()+"_onOff").on("click",function(t){t.click(t)}).on("blur",function(t){t.blur(t)}).on("change",function(t){var e=[];i._inputElement.forEach(function(t,n){t.property("checked")&&e.push(t.property("value"))}),i.value(e),t.change(t,!0)});var o=n.append("label").attr("class","onoffswitch-label").attr("for",this.id()+"_onOff"),r=o.append("div").attr("class","onoffswitch-inner");r.append("div").attr("class","onoffswitch-offText").style("padding-right",this.containerRadius()/2+"px").text(this.offText()),r.append("div").attr("class","onoffswitch-onText").style("padding-left",this.containerRadius()/2+"px").style("width","calc(100% - ".concat(this.containerRadius()/2,"px)")).text(this.onText()),o.append("div").attr("class","onoffswitch-switch")},n.prototype.update=function(e,n){t.prototype.update.call(this,e,n),this._input.attr("name",this.name()),n.style("margin-left",this.marginLeft()+"px").style("margin-bottom",this.marginBottom()+"px").style("width",this.minWidth()+"px");var i=this.minHeight()-4*this.gutter();n.select(".onoffswitch-switch").style("height",i+"px").style("width",i+"px").style("top",2*this.gutter()+1+"px").style("border-radius",this.switchRadius()+"px"),n.select(".onoffswitch-inner").style("min-height",this.minHeight()+"px"),n.select(".onoffswitch-label").style("border-radius",this.containerRadius()+"px"),n.select(".onoffswitch-offText").style("color",this.offFontColor()).style("background-color",this.offColor()),n.select(".onoffswitch-onText").style("color",this.onFontColor()).style("background-color",this.onColor())},n}(n.HTMLWidget);f.prototype._class+=" form_OnOff",f.prototype.implements(e.IInput.prototype),f.prototype.publish("marginLeft",0,"number","Margin left of OnOff"),f.prototype.publish("marginBottom",0,"number","Margin bottom of OnOff"),f.prototype.publish("minWidth",100,"number","Minimum width of OnOff (pixels)"),f.prototype.publish("minHeight",20,"number","Minimum height of OnOff (pixels)"),f.prototype.publish("gutter",1,"number","Space between switch and border of OnOff (pixels)"),f.prototype.publish("onText","Save","string","Text to display when 'ON'"),f.prototype.publish("offText","Properties","string","Text to display when 'OFF'"),f.prototype.publish("switchRadius",10,"number","Border radius of switch (pixels)"),f.prototype.publish("containerRadius",10,"number","Border radius of OnOff (pixels)"),f.prototype.publish("onColor","#2ecc71","html-color","Background color when 'ON'"),f.prototype.publish("offColor","#ecf0f1","html-color","Background color when 'OFF'"),f.prototype.publish("onFontColor","#2c3e50","html-color","Font color when 'ON'"),f.prototype.publish("offFontColor","#7f8c8d","html-color","Font color when 'OFF'");var d=function(t){function n(){var n=t.call(this)||this;return n._inputElement=[],e.IInput.call(n),n._tag="div",n}return o(n,t),n.prototype.enter=function(e,n){t.prototype.enter.call(this,e,n);var i=this,o=n.append("ul");this.selectOptions().length||this.selectOptions().push(""),this.selectOptions().forEach(function(t,e){i._inputElement[e]=o.append("li").append("input").attr("type","radio"),i._inputElement[e].node().insertAdjacentHTML("afterend","<text>"+t+"</text>")}),this._inputElement.forEach(function(t,e){t.attr("name",i.name()),t.on("click",function(t){t.click(t)}),t.on("blur",function(t){t.blur(t)}),t.on("change",function(e){i.value([t.property("value")]),e.change(e,!0)})})},n.prototype.update=function(e,n){t.prototype.update.call(this,e,n);var i=this;this._inputElement.forEach(function(t,e){t.property("value",i.selectOptions()[e]),-1!==i.value().indexOf(i.selectOptions()[e])&&"false"!==i.value()?t.property("checked",!0):t.property("checked",!1)})},n}(n.HTMLWidget);d.prototype._class+=" form_Radio",d.prototype.implements(e.IInput.prototype),d.prototype.publish("selectOptions",[],"array","Array of options used to fill a dropdown list");var m=function(t){function i(){var n=t.call(this)||this;return n._inputElement=[],e.IInput.call(n),n._tag="div",n}return o(i,t),i.prototype.enter=function(e,i){t.prototype.enter.call(this,e,i);var o=this;this._inputElement[0]=i.append("input").attr("type","range"),this._inputElement[1]=i.append("input").attr("type","number"),this._inputElement.forEach(function(t,e){t.attr("name",o.name()),t.on("click",function(t){t.click(t)}),t.on("blur",function(t){t.blur(t)}),t.on("change",function(t){0===e?(o._inputElement[1].property("value",n.rgb(o._inputElement[0].property("value")).toString()),o.value(o._inputElement[0].property("value"))):(o._inputElement[0].property("value",o._inputElement[1].property("value")),o.value(n.rgb(o._inputElement[1].property("value")).toString())),t.change(t,!0)})})},i.prototype.update=function(e,n){t.prototype.update.call(this,e,n),this._inputElement[0].attr("type","range"),this._inputElement[0].property("value",this.value()),this._inputElement[0].attr("min",this.low()),this._inputElement[0].attr("max",this.high()),this._inputElement[0].attr("step",this.step()),this._inputElement[1].attr("type","number"),this._inputElement[1].property("value",this.value()),this._inputElement[1].attr("min",this.low()),this._inputElement[1].attr("max",this.high()),this._inputElement[1].attr("step",this.step())},i.prototype.insertSelectOptions=function(t){var e="";t.length>0?t.forEach(function(t){var n=t instanceof Array?t[0]:t,i=t instanceof Array?t[1]?t[1]:t[0]:t;e+="<option value='"+n+"'>"+i+"</option>"}):e+="<option>selectOptions not set</option>",this._inputElement[0].html(e)},i}(n.HTMLWidget);m.prototype._class+=" form_Range",m.prototype.implements(e.IInput.prototype),m.prototype.publish("type","text","set","Input type",["html-color","number","checkbox","button","select","textarea","date","text","range","search","email","time","datetime"]),m.prototype.publish("selectOptions",[],"array","Array of options used to fill a dropdown list"),m.prototype.publish("low",null,"number","Minimum value for Range input"),m.prototype.publish("high",null,"number","Maximum value for Range input"),m.prototype.publish("step",null,"number","Step value for Range input");var y=function(t){function n(){var n=t.call(this)||this;return n._inputElement=[],e.IInput.call(n),n._tag="div",n}return o(n,t),n.prototype.enter=function(e,n){t.prototype.enter.call(this,e,n);var i=this;this._inputElement[0]=n.append("select").attr("name",this.name()).on("click",function(t){t.click(t)}).on("blur",function(t){t.blur(t)}).on("change",function(t){i.value([i._inputElement[0].property("value")]),t.change(t,!0)})},n.prototype.update=function(e,n){t.prototype.update.call(this,e,n),this.insertSelectOptions(this.selectOptions()),this._inputElement[0].property("value",this.value()).style("max-width",this.maxWidth_exists()?this.maxWidth()+"px":null)},n.prototype.insertSelectOptions=function(t){var e="";t.length>0?t.forEach(function(t){var n=t instanceof Array?t[0]:t,i=t instanceof Array?t[1]?t[1]:t[0]:t;e+="<option value='"+n+"'>"+i+"</option>"}):e+="<option>selectOptions not set</option>",this._inputElement[0].html(e)},n}(n.HTMLWidget);y.prototype._class+=" form_Select",y.prototype.implements(e.IInput.prototype),y.prototype.publish("selectOptions",[],"array","Array of options used to fill a dropdown list"),y.prototype.publish("maxWidth",120,"number","Width",null,{optional:!0});r(".form_Slider .ticks{font:10px sans-serif}.form_Slider .track,.form_Slider .track-inset,.form_Slider .track-overlay{stroke-linecap:round}.form_Slider .track{stroke:#000;stroke-opacity:.3;stroke-width:10px}.form_Slider .track-inset{stroke:#ddd;stroke-width:8px}.form_Slider .track-overlay{stroke-width:50px;stroke:transparent;cursor:crosshair;pointer-events:stroke}.form_Slider .handle{fill:#fff;stroke:#000;stroke-opacity:.5;stroke-width:1.25px}.form_Slider .tick-line{stroke:#000;stroke-opacity:.5;stroke-width:1px;shape-rendering:crispEdges}");var g=function(t){function i(){var n=t.call(this)||this;return n.handleLeftPos=0,n.handleRightPos=0,n.handlePath=function(t){var e=+("r"===t),n=e?1:-1,i=this.allowRange()?.5:0,o="M"+i*n+","+"18A6,6 0 0 "+e+" "+6.5*n+",24V30A6,6 0 0 "+e+" "+i*n+",36";return this.allowRange()?o+="ZM"+2.5*n+",26V28M"+4.5*n+",26V28":o+="M"+1*n+",26V28",o},e.IInput.call(n),n}return o(i,t),i.prototype.enter=function(e,i){var o=this;if(t.prototype.enter.call(this,e,i),this.resize({width:this.width(),height:50}),this.xScale=n.scaleLinear().clamp(!0),this.slider=i.append("g").attr("class","slider"),null===this.low()&&null===this.high()&&null!==this.lowDatetime()&&null!==this.highDatetime()){var r=n.timeParse(this.timePattern()?this.timePattern():"%Q");this.low(r(this.lowDatetime()).getTime()),this.high(r(this.highDatetime()).getTime())}this.slider.append("line").attr("class","track").select(function(){return this.parentNode.appendChild(this.cloneNode(!0))}).attr("class","track-inset").select(function(){return this.parentNode.appendChild(this.cloneNode(!0))}).attr("class","track-overlay").call(n.drag().on("start",function(){var t=n.d3Event();o.moveStartPos=t.x,o.handleLeftStartPos=o.handleLeftPos,o.handleRightStartPos=o.handleRightPos,o.allowRange()&&o.handleLeftPos<=t.x&&t.x<=o.handleRightPos?o.moveMode="both":Math.abs(t.x-o.handleLeftPos)<Math.abs(t.x-o.handleRightPos)?o.moveMode="left":o.moveMode="right",o.moveHandleTo(t.x)}).on("drag",function(){o.moveHandleTo(n.d3Event().x)}).on("end",function(){o.moveHandleTo(n.d3Event().x),o.data([[o.xScale.invert(o.handleLeftPos),o.xScale.invert(o.handleRightPos)]]),o.checkChangedValue()})),this.slider.insert("g",".track-overlay").attr("class","ticks").attr("transform","translate(0, ".concat(this.fontSize()+this.tickHeight()/2,")")),this.handleRight=this.slider.insert("path",".track-overlay").attr("class","handle"),this.handleLeft=this.slider.insert("path",".track-overlay").attr("class","handle")},i.prototype.update=function(e,i){t.prototype.update.call(this,e,i);var o=this;this.xScale.domain([this.low(),this.high()]).range([0,this.width()-2*this.padding()]),this.slider.attr("transform","translate("+(-this.width()/2+this.padding())+",0)"),this.slider.selectAll("line.track,line.track-inset,line.track-overlay").attr("x1",this.xScale.range()[0]).attr("x2",this.xScale.range()[1]);var r=(this.width()-2*this.padding())/(this.tickCount()-1),a=[];if(null!==this.tickDateFormat()&&null!==this.timePattern())for(var l=n.timeParse("%Q"),s=n.timeFormat(this.tickDateFormat()),p=(this.high()-this.low())/(this.tickCount()-1),h=0;h<this.tickCount();h++){var u=l(""+(this.low()+p*h));a.push(s(u))}else{var c=n.format(this.tickValueFormat()),f=(this.high()-this.low())/(this.tickCount()-1);for(h=0;h<this.tickCount();h++){var d=this.low()+f*h;a.push(c(d))}}var m=this.slider.selectAll("g.tick").data(a),y=m.enter().append("g").attr("class","tick");y.append("text").attr("class","tick-text"),y.append("line").attr("class","tick-line"),y.merge(m).each(function(t,e){var i=r*e;n.select(this).select("text.tick-text").style("font-size",o.fontSize()).attr("x",function(){return 0===e?i-2:e===o.tickCount()-1?i+2:i}).attr("y",o.tickHeight()+o.tickOffset()/2+o.fontSize()).attr("text-basline","text-before-edge").attr("text-anchor",function(){return 0===e?"start":e===o.tickCount()-1?"end":"middle"}).text(function(){return t}),n.select(this).select("line.tick-line").attr("x1",i).attr("x2",i).attr("y1",o.tickOffset()-1).attr("y2",o.tickOffset()+o.tickHeight()).style("stroke","#000").style("stroke-width",1)}),this.slider.node().appendChild(this.handleRight.node()),this.slider.node().appendChild(this.handleLeft.node()),this.handleLeftPos=this.lowPos(),this.handleRightPos=this.highPos(),this.updateHandles(),this.checkChangedValue()},i.prototype.checkChangedValue=function(){this.prevValue!==this.value()&&void 0!==this.prevValue&&this.change(this),this.prevValue=this.value()},i.prototype.updateHandles=function(){var t=this;this.handleLeft.attr("transform","translate(".concat(this.handleLeftPos,", -28)")).attr("d",function(e){return t.handlePath("l")}),this.handleRight.attr("transform","translate(".concat(this.handleRightPos,", -28)")).attr("d",function(e){return t.handlePath("r")})},i.prototype.lowPos=function(){var t=[[this.low(),this.high()]];return this.data().length>0&&"number"==typeof this.data()[0][0]&&"number"==typeof this.data()[0][1]&&(t=this.data()),this.xScale(t[0][0])},i.prototype.highPos=function(){var t=[[this.low(),this.high()]];return this.data().length>0&&"number"==typeof this.data()[0][0]&&"number"==typeof this.data()[0][1]&&(t=this.data()),this.xScale(t[0][this.allowRange()?1:0])},i.prototype.moveHandleTo=function(t){if(this.allowRange())switch(this.moveMode){case"both":this.handleLeftPos=this.handleLeftStartPos+t-this.moveStartPos,this.handleRightPos=this.handleRightStartPos+t-this.moveStartPos;break;case"left":this.handleLeftPos=t,this.handleLeftPos>this.handleRightPos&&(this.handleRightPos=this.handleLeftPos);break;case"right":this.handleRightPos=t,this.handleRightPos<this.handleLeftPos&&(this.handleLeftPos=this.handleRightPos)}else this.handleLeftPos=this.handleRightPos=t;this.handleLeftPos=this.constrain(this.handleLeftPos),this.handleRightPos=this.constrain(this.handleRightPos),this.value(this.allowRange()?[this.xScale.invert(this.handleLeftPos),this.xScale.invert(this.handleRightPos)]:this.xScale.invert(this.handleLeftPos)),this.updateHandles()},i.prototype.constrain=function(t){var e=this.xScale.range();return t<e[0]&&(t=e[0]),t>e[1]&&(t=e[1]),this.nearestStep(t)},i.prototype.nearestStep=function(t){var e=this.xScale.invert(t);return this.xScale(this.low()+Math.round((e-this.low())/this.step())*this.step())},i}(n.SVGWidget);g.prototype._class+=" form_Slider",g.prototype.implements(e.IInput.prototype),g.prototype.publish("padding",16,"number","Outer Padding",null,{tags:["Basic"]}),g.prototype.publish("fontSize",12,"number","Font Size",null,{tags:["Basic"]}),g.prototype.publish("fontFamily",null,"string","Font Name",null,{tags:["Basic"]}),g.prototype.publish("fontColor",null,"html-color","Font Color",null,{tags:["Basic"]}),g.prototype.publish("allowRange",!1,"boolean","Allow Range Selection",null,{tags:["Intermediate"]}),g.prototype.publish("low",null,"number","Low",null,{tags:["Intermediate"]}),g.prototype.publish("high",null,"number","High",null,{tags:["Intermediate"]}),g.prototype.publish("step",10,"number","Step",null,{tags:["Intermediate"]}),g.prototype.publish("lowDatetime",null,"string","Low",null,{tags:["Intermediate"]}),g.prototype.publish("highDatetime",null,"string","High",null,{tags:["Intermediate"]}),g.prototype.publish("selectionLabel","","string","Selection Label",null,{tags:["Intermediate"]}),g.prototype.publish("timePattern","%Y-%m-%d","string"),g.prototype.publish("tickCount",10,"number"),g.prototype.publish("tickOffset",5,"number"),g.prototype.publish("tickHeight",8,"number"),g.prototype.publish("tickDateFormat",null,"string"),g.prototype.publish("tickValueFormat",",.0f","string");var b=g.prototype.name;g.prototype.name=function(t){var e=b.apply(this,arguments);if(arguments.length){var i=t instanceof Array?t:[t];n.SVGWidget.prototype.columns.call(this,i)}return e};var v=g.prototype.value;g.prototype.value=function(t){var e=v.apply(this,arguments);return arguments.length?(n.SVGWidget.prototype.data.call(this,[this.allowRange()?t:[t,t]]),e):this.allowRange()?n.SVGWidget.prototype.data.call(this)[0]:n.SVGWidget.prototype.data.call(this)[0][0]};var _=function(t){function e(){var e=t.call(this)||this;return e._tag="div",e.type("textarea"),e}return o(e,t),e.prototype.enter=function(e,n){t.prototype.enter.call(this,e,n)},e.prototype.calcHeight=function(){return Math.max(this.minHeight_exists()?this.minHeight():0,this.height())},e.prototype.update=function(e,n){t.prototype.update.call(this,e,n),this._inputElement[0].attr("rows",this.rows()).attr("cols",this.cols()).attr("wrap",this.wrap()).attr("spellcheck",this.spellcheck()).style("height",this.calcHeight()+"px")},e}(h);_.prototype._class+=" form_TextArea",_.prototype.publish("rows",null,"number","Rows",null,{optional:!0}),_.prototype.publish("cols",null,"number","Columns",null,{optional:!0}),_.prototype.publish("wrap","off","set","Wrap",["off","on"]),_.prototype.publish("minHeight",null,"number","Minimum Height",null,{optional:!0}),_.prototype.publish("spellcheck",null,"boolean","Input spell checking",{optional:!0}),t.BUILD_VERSION="2.108.8",t.Button=a,t.CheckBox=l,t.ColorInput=s,t.FieldForm=u,t.Form=p,t.Input=h,t.InputRange=c,t.OnOff=f,t.PKG_NAME="@hpcc-js/form",t.PKG_VERSION="2.12.4",t.Radio=d,t.Range=m,t.Select=y,t.Slider=g,t.TextArea=_});
2
2
  //# sourceMappingURL=index.min.js.map