@hpcc-js/form 3.3.10 → 3.4.1
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.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +1 -1
- package/package.json +6 -6
- package/src/Form.css +15 -16
- package/src/Input.css +16 -15
- package/src/OnOff.css +35 -15
- package/src/Slider.css +40 -40
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var t=Object.defineProperty,e=(e,n)=>t(e,"name",{value:n,configurable:!0});import{IInput as n}from"@hpcc-js/api";import{HTMLWidget as i,rgb as s,WidgetArray as o,d3Event as l,select as a,SVGWidget as r,scaleLinear as p,timeParse as h,drag as u,timeFormat as c,format as d}from"@hpcc-js/common";const m="@hpcc-js/form",f="3.3.10",y="3.20.0",g=class _Button extends i{_inputElement=[];constructor(){super(),n.call(this),this._tag="div"}enter(t,e){super.enter(t,e);const n=this;this._inputElement[0]=e.append("button").attr("name",this.name()).on("click",function(t){t.click(t)}).on("blur",function(t){t.blur(t)}).on("change",function(t){n.value([n._inputElement[0].property("value")]),t.change(t,!0)})}update(t,e){super.update(t,e),this._inputElement[0].text(this.value())}};e(g,"Button");let b=g;b.prototype._class+=" form_Button",b.prototype.implements(n.prototype);const _=class _CheckBox extends i{_inputElement=[];constructor(){super(),n.call(this),this._tag="div"}enter(t,e){super.enter(t,e);const n=this,i=e.append("ul");this.selectOptions().length||this.selectOptions().push(""),this.selectOptions().forEach(function(t,e){n._inputElement[e]=i.append("li").append("input").attr("type","checkbox"),n._inputElement[e].node().insertAdjacentHTML("afterend","<text>"+t+"</text>")}),this._inputElement.forEach(function(t,e){t.attr("name",n.name()),t.on("click",function(t){t.click(t)}),t.on("blur",function(t){t.blur(t)}),t.on("change",function(t){const e=[];n._inputElement.forEach(function(t){t.property("checked")&&e.push(t.property("value"))}),n.value(e),t.change(t,!0)})})}update(t,e){super.update(t,e);const n=this;this._inputElement.forEach(function(t,e){t.property("value",n.selectOptions()[e]),-1!==n.value().indexOf(n.selectOptions()[e])&&"false"!==n.value()?t.property("checked",!0):t.property("checked",!1)})}insertSelectOptions(t){let e="";t.length>0?t.forEach(function(t){const 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)}};e(_,"CheckBox");let v=_;v.prototype._class+=" form_CheckBox",v.prototype.implements(n.prototype),v.prototype.publish("selectOptions",[],"array","Array of options used to fill a dropdown list");const x=class _ColorInput extends i{_inputElement=[];constructor(){super(),n.call(this),this._tag="div"}enter(t,e){super.enter(t,e);const n=this;this._inputElement[0]=e.append("input").attr("type","text"),this._inputElement[0].classed("color-text",!0),this._inputElement[1]=e.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?(n._inputElement[1].property("value",s(n._inputElement[0].property("value")).toString()),n.value(n._inputElement[0].property("value"))):(n._inputElement[0].property("value",n._inputElement[1].property("value")),n.value(s(n._inputElement[1].property("value")).toString())),t.change(t,!0)})})}update(t,e){super.update(t,e);const n=this;this._inputElement.forEach(function(t){t.attr("name",n.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",s(this.value()).toString());const i=this._inputElement[0].node().getBoundingClientRect();this._inputElement[1].style("height",i.height-2+"px")}};e(x,"ColorInput");let E=x;E.prototype._class+=" form_ColorInput",E.prototype.implements(n.prototype);const k=class _Form extends i{tbody;tfoot;btntd;_controls;_maxCols;constructor(){super(),this._tag="form"}data(t){if(!arguments.length){const t=[];return this.inputsForEach(function(e){t.push(e.value())}),t}return this.inputsForEach(function(e,n){t&&t.length>n&&e.value(t[n]).render()}),this}inputsForEach(t,e){let n=0;this.inputs().forEach(function(i){(i instanceof o?i.content():[i]).forEach(function(i){e?t.call(e,i,n++):t(i,n++)})})}inputsMap(){const t={};return this.inputs().forEach(function(e){t[e.name()]=e}),t}calcMaxColumns(){let t=0;return this.inputs().forEach(function(e){const n=e instanceof o?e.content():[e];n.length>t&&(t=n.length)}),t}values(t){if(!arguments.length){const t={};return this.inputsForEach(function(e){const n=e.type?e.type():"text";if(e.value()||!this.omitBlank())switch(n){case"checkbox":t[e.name()]=e.value_exists()?!!e.value():void 0;break;case"number":const n=e.value();t[e.name()]=""===n?void 0:+n;break;default:t[e.name()]=e.value_exists()?e.value():void 0}},this),t}return this.inputsForEach(function(e){t[e.name()]?e.value(t[e.name()]):this.omitBlank()&&e.value("")},this),this}submit(){let 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)}clear(){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()}})}checkValidation(){let t=!0;const 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}enter(t,e){super.enter(t,e),e.on("submit",function(){l().preventDefault()}),this._placeholderElement.style("overflow","auto");const n=e.append("table");this.tbody=n.append("tbody"),this.tfoot=n.append("tfoot"),this.btntd=this.tfoot.append("tr").append("td").attr("colspan",2);const i=this;this._controls=[(new b).classed({default:!0}).value("Submit").on("click",function(){i.submit()},!0),(new b).value("Clear").on("click",function(){i.clear()},!0)];const s=i.btntd.append("div").style("float","right");this._controls.forEach(function(t){const e=s.append("span").style("float","left");t.target(e.node()).render()})}update(t,e){super.update(t,e),this._maxCols=this.calcMaxColumns();const n=this,i=this.tbody.selectAll("tr").data(this.inputs());i.enter().append("tr").each(function(t,e){const i=a(this),s=t instanceof o?t.content():[t];s.forEach(function(t,e){i.append("td").attr("class","prompt");const o=i.append("td").attr("class","input");if(e===s.length-1&&s.length<n._maxCols&&o.attr("colspan",2*(n._maxCols-s.length+1)),t.target(o.node()).render(),t instanceof r){const e=t.element().node().getBBox();o.style("height",e.height+"px"),t.resize().render()}t._inputElement instanceof Array&&t._inputElement.forEach(function(t){t.on("keyup.form",function(t){setTimeout(function(){n._controls[0].disable(!n.allowEmptyRequest()&&!n.inputs().some(function(t){return-1!==t._class.indexOf("WidgetArray")?t.content().some(function(t){return t.hasValue()}):t.hasValue()}))},100)})})})}).merge(i).each(function(t,e){const n=a(this);(t instanceof o?t.content():[t]).forEach(function(t,e){n.select("td.prompt").text(t.label()+":")})}),i.each(function(t,e){0===e&&t.setFocus&&t.setFocus()}),i.exit().each(function(t,e){(t instanceof o?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(){n._controls[0].disable(!n.allowEmptyRequest()&&!n.inputs().some(function(t){return-1!==t._class.indexOf("WidgetArray")?t.content().some(function(t){return t.hasValue()}):t.hasValue()}))},100)}exit(t,e){this.inputsForEach(t=>t.target(null)),super.exit(t,e)}click(t,e,n){}};e(k,"Form");let w=k;w.prototype._class+=" form_Form",w.prototype.publish("validate",!0,"boolean","Enable/Disable input validation"),w.prototype.publish("inputs",[],"widgetArray","Array of input widgets",null,{render:!1}),w.prototype.publish("showSubmit",!0,"boolean","Show Submit/Cancel Controls"),w.prototype.publish("omitBlank",!1,"boolean","Drop Blank Fields From Submit"),w.prototype.publish("allowEmptyRequest",!1,"boolean","Allow Blank Form to be Submitted");const R=class _Input extends i{_inputElement=[];_labelElement=[];constructor(){super(),n.call(this),this._tag="div"}checked(t){return arguments.length?(this._inputElement[0]&&this._inputElement[0].property("checked",t),this):!!this._inputElement[0]&&this._inputElement[0].property("checked")}enter(t,e){super.enter(t,e),this._labelElement[0]=e.append("label").attr("for",this.id()+"_input").style("visibility",this.inlineLabel_exists()?"visible":"hidden");const n=this;switch(this.type()){case"button":this._inputElement[0]=e.append("button").attr("id",this.id()+"_input");break;case"textarea":this._inputElement[0]=e.append("textarea").attr("id",this.id()+"_input");break;default:this._inputElement[0]=e.append("input").attr("id",this.id()+"_input").attr("type",this.type())}this._inputElement.forEach(function(t,e){t.attr("name",n.name()),t.on("click",function(t){t.click(t)}),t.on("blur",function(t){t.blur(t)}),t.on("change",function(e){n.value([t.property("value")]),e.change(e,!0)}),t.on("keyup",function(e){n.value([t.property("value")]),e.change(e,!1)})})}update(t,e){switch(super.update(t,e),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())}}blur(t){}keyup(t){}focus(t){}click(t){}dblclick(t){}change(t,e){}};e(R,"Input");let S=R;S.prototype._class+=" form_Input",S.prototype.implements(n.prototype),S.prototype.publish("type","text","set","Input type",["string","number","boolean","date","time","hidden","nested","button","checkbox","text","textarea","search","email","datetime"]),S.prototype.publish("inlineLabel",null,"string","Input Label",null,{optional:!0});const P=class _FieldForm extends w{constructor(){super(),this._tag="form"}fields(t){const e=super.fields.apply(this,arguments);if(arguments.length){const e=this.inputsMap();this.inputs(t.map(t=>e[t.id()]||(new S).name(t.id()).label(t.label()).type(t.type())))}return e}data(t){if(!arguments.length)return super.data();if(super.data(t[0]),t[0]){const e=this.inputs(),n=t[0][this.columns().length];let i=0;for(const t in n)e[i].name(t),++i}return this}};e(P,"FieldForm");let O=P;O.prototype._class+=" form_FieldForm";const C=class _InputRange extends i{_inputElement=[];_labelElement=[];_rangeData=[];constructor(){super(),n.call(this),this._tag="div"}enter(t,e){super.enter(t,e),this._labelElement[0]=e.append("label").attr("for",this.id()+"_input").style("visibility",this.inlineLabel_exists()?"visible":"hidden"),this._inputElement.push(e.append("input").attr("id",this.id()+"_input_min").attr("type",this.type())),this._inputElement.push(e.append("input").attr("id",this.id()+"_input_max").attr("type",this.type()));const n=this;this._inputElement.forEach(function(t,e){t.attr("name",n.name()),t.on("click",function(t){t.click(t)}),t.on("blur",function(t){t.blur(t)}),t.on("change",function(i){n._rangeData[e]=t.property("value"),n.value(n._rangeData),i.change(i,!0)})})}update(t,e){super.update(t,e),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)}};e(C,"InputRange");let F=C;F.prototype._class+=" form_InputRange",F.prototype.implements(n.prototype),F.prototype.publish("type","text","set","InputRange type",["number","date","text","time","datetime","hidden"]),F.prototype.publish("inlineLabel",null,"string","InputRange Label",null,{optional:!0}),F.prototype.publish("value",["",""],"array","Input Current Value",null,{override:!0});const L=class _OnOff extends i{_inputElement=[];_input;constructor(){super(),n.call(this),this._tag="div"}enter(t,e){super.enter(t,e),e.classed("onoffswitch",!0);const n=this;this._input=e.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){const e=[];n._inputElement.forEach(function(t,n){t.property("checked")&&e.push(t.property("value"))}),n.value(e),t.change(t,!0)});const i=e.append("label").attr("class","onoffswitch-label").attr("for",this.id()+"_onOff"),s=i.append("div").attr("class","onoffswitch-inner");s.append("div").attr("class","onoffswitch-offText").style("padding-right",this.containerRadius()/2+"px").text(this.offText()),s.append("div").attr("class","onoffswitch-onText").style("padding-left",this.containerRadius()/2+"px").style("width",`calc(100% - ${this.containerRadius()/2}px)`).text(this.onText()),i.append("div").attr("class","onoffswitch-switch")}update(t,e){super.update(t,e),this._input.attr("name",this.name()),e.style("margin-left",this.marginLeft()+"px").style("margin-bottom",this.marginBottom()+"px").style("width",this.minWidth()+"px");const n=this.minHeight()-4*this.gutter();e.select(".onoffswitch-switch").style("height",n+"px").style("width",n+"px").style("top",2*this.gutter()+1+"px").style("border-radius",this.switchRadius()+"px"),e.select(".onoffswitch-inner").style("min-height",this.minHeight()+"px"),e.select(".onoffswitch-label").style("border-radius",this.containerRadius()+"px"),e.select(".onoffswitch-offText").style("color",this.offFontColor()).style("background-color",this.offColor()),e.select(".onoffswitch-onText").style("color",this.onFontColor()).style("background-color",this.onColor())}};e(L,"OnOff");let A=L;A.prototype._class+=" form_OnOff",A.prototype.implements(n.prototype),A.prototype.publish("marginLeft",0,"number","Margin left of OnOff"),A.prototype.publish("marginBottom",0,"number","Margin bottom of OnOff"),A.prototype.publish("minWidth",100,"number","Minimum width of OnOff (pixels)"),A.prototype.publish("minHeight",20,"number","Minimum height of OnOff (pixels)"),A.prototype.publish("gutter",1,"number","Space between switch and border of OnOff (pixels)"),A.prototype.publish("onText","Save","string","Text to display when 'ON'"),A.prototype.publish("offText","Properties","string","Text to display when 'OFF'"),A.prototype.publish("switchRadius",10,"number","Border radius of switch (pixels)"),A.prototype.publish("containerRadius",10,"number","Border radius of OnOff (pixels)"),A.prototype.publish("onColor","#2ecc71","html-color","Background color when 'ON'"),A.prototype.publish("offColor","#ecf0f1","html-color","Background color when 'OFF'"),A.prototype.publish("onFontColor","#2c3e50","html-color","Font color when 'ON'"),A.prototype.publish("offFontColor","#7f8c8d","html-color","Font color when 'OFF'");const B=class _Radio extends i{_inputElement=[];constructor(){super(),n.call(this),this._tag="div"}enter(t,e){super.enter(t,e);const n=this,i=e.append("ul");this.selectOptions().length||this.selectOptions().push(""),this.selectOptions().forEach(function(t,e){n._inputElement[e]=i.append("li").append("input").attr("type","radio"),n._inputElement[e].node().insertAdjacentHTML("afterend","<text>"+t+"</text>")}),this._inputElement.forEach(function(t,e){t.attr("name",n.name()),t.on("click",function(t){t.click(t)}),t.on("blur",function(t){t.blur(t)}),t.on("change",function(e){n.value([t.property("value")]),e.change(e,!0)})})}update(t,e){super.update(t,e);const n=this;this._inputElement.forEach(function(t,e){t.property("value",n.selectOptions()[e]),-1!==n.value().indexOf(n.selectOptions()[e])&&"false"!==n.value()?t.property("checked",!0):t.property("checked",!1)})}};e(B,"Radio");let M=B;M.prototype._class+=" form_Radio",M.prototype.implements(n.prototype),M.prototype.publish("selectOptions",[],"array","Array of options used to fill a dropdown list");const H=class _Range extends i{_inputElement=[];constructor(){super(),n.call(this),this._tag="div"}enter(t,e){super.enter(t,e);const n=this;this._inputElement[0]=e.append("input").attr("type","range"),this._inputElement[1]=e.append("input").attr("type","number"),this._inputElement.forEach(function(t,e){t.attr("name",n.name()),t.on("click",function(t){t.click(t)}),t.on("blur",function(t){t.blur(t)}),t.on("change",function(t){0===e?(n._inputElement[1].property("value",s(n._inputElement[0].property("value")).toString()),n.value(n._inputElement[0].property("value"))):(n._inputElement[0].property("value",n._inputElement[1].property("value")),n.value(s(n._inputElement[1].property("value")).toString())),t.change(t,!0)})})}update(t,e){super.update(t,e),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())}insertSelectOptions(t){let e="";t.length>0?t.forEach(function(t){const 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)}};e(H,"Range");let I=H;I.prototype._class+=" form_Range",I.prototype.implements(n.prototype),I.prototype.publish("type","text","set","Input type",["html-color","number","checkbox","button","select","textarea","date","text","range","search","email","time","datetime"]),I.prototype.publish("selectOptions",[],"array","Array of options used to fill a dropdown list"),I.prototype.publish("low",null,"number","Minimum value for Range input"),I.prototype.publish("high",null,"number","Maximum value for Range input"),I.prototype.publish("step",null,"number","Step value for Range input");const T=class _Select extends i{_inputElement=[];constructor(){super(),n.call(this),this._tag="div"}enter(t,e){super.enter(t,e);const n=this;this._inputElement[0]=e.append("select").attr("name",this.name()).on("click",function(t){t.click(t)}).on("blur",function(t){t.blur(t)}).on("change",function(t){n.value([n._inputElement[0].property("value")]),t.change(t,!0)})}update(t,e){super.update(t,e),this.insertSelectOptions(this.selectOptions()),this._inputElement[0].property("value",this.value()).style("max-width",this.maxWidth_exists()?this.maxWidth()+"px":null)}insertSelectOptions(t){let e="";t.length>0?t.forEach(function(t){const 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)}};e(T,"Select");let V=T;V.prototype._class+=" form_Select",V.prototype.implements(n.prototype),V.prototype.publish("selectOptions",[],"array","Array of options used to fill a dropdown list"),V.prototype.publish("maxWidth",120,"number","Width",null,{optional:!0});const D=class _Slider extends r{xScale;moveMode;moveStartPos;prevValue;slider;handleLeft;handleLeftPos=0;handleLeftStartPos;handleRight;handleRightPos=0;handleRightStartPos;constructor(){super(),n.call(this)}enter(t,e){if(super.enter(t,e),this.resize({width:this.width(),height:50}),this.xScale=p().clamp(!0),this.slider=e.append("g").attr("class","slider"),null===this.low()&&null===this.high()&&null!==this.lowDatetime()&&null!==this.highDatetime()){const t=h(this.timePattern()?this.timePattern():"%Q");this.low(t(this.lowDatetime()).getTime()),this.high(t(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(u().on("start",()=>{const t=l();this.moveStartPos=t.x,this.handleLeftStartPos=this.handleLeftPos,this.handleRightStartPos=this.handleRightPos,this.allowRange()&&this.handleLeftPos<=t.x&&t.x<=this.handleRightPos?this.moveMode="both":Math.abs(t.x-this.handleLeftPos)<Math.abs(t.x-this.handleRightPos)?this.moveMode="left":this.moveMode="right",this.moveHandleTo(t.x)}).on("drag",()=>{this.moveHandleTo(l().x)}).on("end",()=>{this.moveHandleTo(l().x),this.data([[this.xScale.invert(this.handleLeftPos),this.xScale.invert(this.handleRightPos)]]),this.checkChangedValue()})),this.slider.insert("g",".track-overlay").attr("class","ticks").attr("transform",`translate(0, ${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")}update(t,e){super.update(t,e);const n=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]);const i=(this.width()-2*this.padding())/(this.tickCount()-1),s=[];if(null!==this.tickDateFormat()&&null!==this.timePattern()){const t=h("%Q"),e=c(this.tickDateFormat()),n=(this.high()-this.low())/(this.tickCount()-1);for(let i=0;i<this.tickCount();i++){const o=t(""+(this.low()+n*i));s.push(e(o))}}else{const t=d(this.tickValueFormat()),e=(this.high()-this.low())/(this.tickCount()-1);for(let n=0;n<this.tickCount();n++){const i=this.low()+e*n;s.push(t(i))}}const o=this.slider.selectAll("g.tick").data(s),l=o.enter().append("g").attr("class","tick");l.append("text").attr("class","tick-text"),l.append("line").attr("class","tick-line"),l.merge(o).each(function(t,e){const s=i*e;a(this).select("text.tick-text").style("font-size",n.fontSize()).attr("x",function(){return 0===e?s-2:e===n.tickCount()-1?s+2:s}).attr("y",n.tickHeight()+n.tickOffset()/2+n.fontSize()).attr("text-basline","text-before-edge").attr("text-anchor",function(){return 0===e?"start":e===n.tickCount()-1?"end":"middle"}).text(()=>t),a(this).select("line.tick-line").attr("x1",s).attr("x2",s).attr("y1",n.tickOffset()-1).attr("y2",n.tickOffset()+n.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()}checkChangedValue(){this.prevValue!==this.value()&&void 0!==this.prevValue&&this.change(this),this.prevValue=this.value()}updateHandles(){this.handleLeft.attr("transform",`translate(${this.handleLeftPos}, -28)`).attr("d",t=>this.handlePath("l")),this.handleRight.attr("transform",`translate(${this.handleRightPos}, -28)`).attr("d",t=>this.handlePath("r"))}lowPos(){let 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])}highPos(){let 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])}moveHandleTo(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()}constrain(t){const e=this.xScale.range();return t<e[0]&&(t=e[0]),t>e[1]&&(t=e[1]),this.nearestStep(t)}nearestStep(t){const e=this.xScale.invert(t);return this.xScale(this.low()+Math.round((e-this.low())/this.step())*this.step())}handlePath=/* @__PURE__ */e(function(t){const e=+("r"===t),n=e?1:-1,i=this.allowRange()?.5:0;let s="M"+i*n+","+"18A6,6 0 0 "+e+" "+6.5*n+",24V30A6,6 0 0 "+e+" "+i*n+",36";return this.allowRange()?s+="ZM"+2.5*n+",26V28M"+4.5*n+",26V28":s+="M"+1*n+",26V28",s},"handlePath")};e(D,"Slider");let W=D;W.prototype._class+=" form_Slider",W.prototype.implements(n.prototype),W.prototype.publish("padding",16,"number","Outer Padding",null,{tags:["Basic"]}),W.prototype.publish("fontSize",12,"number","Font Size",null,{tags:["Basic"]}),W.prototype.publish("fontFamily",null,"string","Font Name",null,{tags:["Basic"]}),W.prototype.publish("fontColor",null,"html-color","Font Color",null,{tags:["Basic"]}),W.prototype.publish("allowRange",!1,"boolean","Allow Range Selection",null,{tags:["Intermediate"]}),W.prototype.publish("low",null,"number","Low",null,{tags:["Intermediate"]}),W.prototype.publish("high",null,"number","High",null,{tags:["Intermediate"]}),W.prototype.publish("step",10,"number","Step",null,{tags:["Intermediate"]}),W.prototype.publish("lowDatetime",null,"string","Low",null,{tags:["Intermediate"]}),W.prototype.publish("highDatetime",null,"string","High",null,{tags:["Intermediate"]}),W.prototype.publish("selectionLabel","","string","Selection Label",null,{tags:["Intermediate"]}),W.prototype.publish("timePattern","%Y-%m-%d","string"),W.prototype.publish("tickCount",10,"number"),W.prototype.publish("tickOffset",5,"number"),W.prototype.publish("tickHeight",8,"number"),W.prototype.publish("tickDateFormat",null,"string"),W.prototype.publish("tickValueFormat",",.0f","string");const z=W.prototype.name;W.prototype.name=function(t){const e=z.apply(this,arguments);if(arguments.length){const e=t instanceof Array?t:[t];r.prototype.columns.call(this,e)}return e};const N=W.prototype.value;W.prototype.value=function(t){const e=N.apply(this,arguments);return arguments.length?(r.prototype.data.call(this,[this.allowRange()?t:[t,t]]),e):this.allowRange()?r.prototype.data.call(this)[0]:r.prototype.data.call(this)[0][0]};const j=class _TextArea extends S{constructor(){super(),this._tag="div",this.type("textarea")}enter(t,e){super.enter(t,e)}calcHeight(){return Math.max(this.minHeight_exists()?this.minHeight():0,this.height())}update(t,e){super.update(t,e),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(j,"TextArea");let q=j;q.prototype._class+=" form_TextArea",q.prototype.publish("rows",null,"number","Rows",null,{optional:!0}),q.prototype.publish("cols",null,"number","Columns",null,{optional:!0}),q.prototype.publish("wrap","off","set","Wrap",["off","on"]),q.prototype.publish("minHeight",null,"number","Minimum Height",null,{optional:!0}),q.prototype.publish("spellcheck",null,"boolean","Input spell checking",{optional:!0});export{y as BUILD_VERSION,b as Button,v as CheckBox,E as ColorInput,O as FieldForm,w as Form,S as Input,F as InputRange,A as OnOff,m as PKG_NAME,f as PKG_VERSION,M as Radio,I as Range,V as Select,W as Slider,q as TextArea};
|
|
1
|
+
var t=Object.defineProperty,e=(e,n)=>t(e,"name",{value:n,configurable:!0});import{IInput as n}from"@hpcc-js/api";import{HTMLWidget as i,rgb as s,WidgetArray as o,d3Event as l,select as a,SVGWidget as r,scaleLinear as p,timeParse as h,drag as u,timeFormat as c,format as d}from"@hpcc-js/common";const m="@hpcc-js/form",f="3.4.1",y="3.21.2",g=class _Button extends i{_inputElement=[];constructor(){super(),n.call(this),this._tag="div"}enter(t,e){super.enter(t,e);const n=this;this._inputElement[0]=e.append("button").attr("name",this.name()).on("click",function(t){t.click(t)}).on("blur",function(t){t.blur(t)}).on("change",function(t){n.value([n._inputElement[0].property("value")]),t.change(t,!0)})}update(t,e){super.update(t,e),this._inputElement[0].text(this.value())}};e(g,"Button");let b=g;b.prototype._class+=" form_Button",b.prototype.implements(n.prototype);const _=class _CheckBox extends i{_inputElement=[];constructor(){super(),n.call(this),this._tag="div"}enter(t,e){super.enter(t,e);const n=this,i=e.append("ul");this.selectOptions().length||this.selectOptions().push(""),this.selectOptions().forEach(function(t,e){n._inputElement[e]=i.append("li").append("input").attr("type","checkbox"),n._inputElement[e].node().insertAdjacentHTML("afterend","<text>"+t+"</text>")}),this._inputElement.forEach(function(t,e){t.attr("name",n.name()),t.on("click",function(t){t.click(t)}),t.on("blur",function(t){t.blur(t)}),t.on("change",function(t){const e=[];n._inputElement.forEach(function(t){t.property("checked")&&e.push(t.property("value"))}),n.value(e),t.change(t,!0)})})}update(t,e){super.update(t,e);const n=this;this._inputElement.forEach(function(t,e){t.property("value",n.selectOptions()[e]),-1!==n.value().indexOf(n.selectOptions()[e])&&"false"!==n.value()?t.property("checked",!0):t.property("checked",!1)})}insertSelectOptions(t){let e="";t.length>0?t.forEach(function(t){const 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)}};e(_,"CheckBox");let v=_;v.prototype._class+=" form_CheckBox",v.prototype.implements(n.prototype),v.prototype.publish("selectOptions",[],"array","Array of options used to fill a dropdown list");const x=class _ColorInput extends i{_inputElement=[];constructor(){super(),n.call(this),this._tag="div"}enter(t,e){super.enter(t,e);const n=this;this._inputElement[0]=e.append("input").attr("type","text"),this._inputElement[0].classed("color-text",!0),this._inputElement[1]=e.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?(n._inputElement[1].property("value",s(n._inputElement[0].property("value")).toString()),n.value(n._inputElement[0].property("value"))):(n._inputElement[0].property("value",n._inputElement[1].property("value")),n.value(s(n._inputElement[1].property("value")).toString())),t.change(t,!0)})})}update(t,e){super.update(t,e);const n=this;this._inputElement.forEach(function(t){t.attr("name",n.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",s(this.value()).toString());const i=this._inputElement[0].node().getBoundingClientRect();this._inputElement[1].style("height",i.height-2+"px")}};e(x,"ColorInput");let E=x;E.prototype._class+=" form_ColorInput",E.prototype.implements(n.prototype);const k=class _Form extends i{tbody;tfoot;btntd;_controls;_maxCols;constructor(){super(),this._tag="form"}data(t){if(!arguments.length){const t=[];return this.inputsForEach(function(e){t.push(e.value())}),t}return this.inputsForEach(function(e,n){t&&t.length>n&&e.value(t[n]).render()}),this}inputsForEach(t,e){let n=0;this.inputs().forEach(function(i){(i instanceof o?i.content():[i]).forEach(function(i){e?t.call(e,i,n++):t(i,n++)})})}inputsMap(){const t={};return this.inputs().forEach(function(e){t[e.name()]=e}),t}calcMaxColumns(){let t=0;return this.inputs().forEach(function(e){const n=e instanceof o?e.content():[e];n.length>t&&(t=n.length)}),t}values(t){if(!arguments.length){const t={};return this.inputsForEach(function(e){const n=e.type?e.type():"text";if(e.value()||!this.omitBlank())switch(n){case"checkbox":t[e.name()]=e.value_exists()?!!e.value():void 0;break;case"number":const n=e.value();t[e.name()]=""===n?void 0:+n;break;default:t[e.name()]=e.value_exists()?e.value():void 0}},this),t}return this.inputsForEach(function(e){t[e.name()]?e.value(t[e.name()]):this.omitBlank()&&e.value("")},this),this}submit(){let 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)}clear(){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()}})}checkValidation(){let t=!0;const 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}enter(t,e){super.enter(t,e),e.on("submit",function(){l().preventDefault()}),this._placeholderElement.style("overflow","auto");const n=e.append("table");this.tbody=n.append("tbody"),this.tfoot=n.append("tfoot"),this.btntd=this.tfoot.append("tr").append("td").attr("colspan",2);const i=this;this._controls=[(new b).classed({default:!0}).value("Submit").on("click",function(){i.submit()},!0),(new b).value("Clear").on("click",function(){i.clear()},!0)];const s=i.btntd.append("div").style("float","right");this._controls.forEach(function(t){const e=s.append("span").style("float","left");t.target(e.node()).render()})}update(t,e){super.update(t,e),this._maxCols=this.calcMaxColumns();const n=this,i=this.tbody.selectAll("tr").data(this.inputs());i.enter().append("tr").each(function(t,e){const i=a(this),s=t instanceof o?t.content():[t];s.forEach(function(t,e){i.append("td").attr("class","prompt");const o=i.append("td").attr("class","input");if(e===s.length-1&&s.length<n._maxCols&&o.attr("colspan",2*(n._maxCols-s.length+1)),t.target(o.node()).render(),t instanceof r){const e=t.element().node().getBBox();o.style("height",e.height+"px"),t.resize().render()}t._inputElement instanceof Array&&t._inputElement.forEach(function(t){t.on("keyup.form",function(t){setTimeout(function(){n._controls[0].disable(!n.allowEmptyRequest()&&!n.inputs().some(function(t){return-1!==t._class.indexOf("WidgetArray")?t.content().some(function(t){return t.hasValue()}):t.hasValue()}))},100)})})})}).merge(i).each(function(t,e){const n=a(this);(t instanceof o?t.content():[t]).forEach(function(t,e){n.select("td.prompt").text(t.label()+":")})}),i.each(function(t,e){0===e&&t.setFocus&&t.setFocus()}),i.exit().each(function(t,e){(t instanceof o?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(){n._controls[0].disable(!n.allowEmptyRequest()&&!n.inputs().some(function(t){return-1!==t._class.indexOf("WidgetArray")?t.content().some(function(t){return t.hasValue()}):t.hasValue()}))},100)}exit(t,e){this.inputsForEach(t=>t.target(null)),super.exit(t,e)}click(t,e,n){}};e(k,"Form");let w=k;w.prototype._class+=" form_Form",w.prototype.publish("validate",!0,"boolean","Enable/Disable input validation"),w.prototype.publish("inputs",[],"widgetArray","Array of input widgets",null,{render:!1}),w.prototype.publish("showSubmit",!0,"boolean","Show Submit/Cancel Controls"),w.prototype.publish("omitBlank",!1,"boolean","Drop Blank Fields From Submit"),w.prototype.publish("allowEmptyRequest",!1,"boolean","Allow Blank Form to be Submitted");const R=class _Input extends i{_inputElement=[];_labelElement=[];constructor(){super(),n.call(this),this._tag="div"}checked(t){return arguments.length?(this._inputElement[0]&&this._inputElement[0].property("checked",t),this):!!this._inputElement[0]&&this._inputElement[0].property("checked")}enter(t,e){super.enter(t,e),this._labelElement[0]=e.append("label").attr("for",this.id()+"_input").style("visibility",this.inlineLabel_exists()?"visible":"hidden");const n=this;switch(this.type()){case"button":this._inputElement[0]=e.append("button").attr("id",this.id()+"_input");break;case"textarea":this._inputElement[0]=e.append("textarea").attr("id",this.id()+"_input");break;default:this._inputElement[0]=e.append("input").attr("id",this.id()+"_input").attr("type",this.type())}this._inputElement.forEach(function(t,e){t.attr("name",n.name()),t.on("click",function(t){t.click(t)}),t.on("blur",function(t){t.blur(t)}),t.on("change",function(e){n.value([t.property("value")]),e.change(e,!0)}),t.on("keyup",function(e){n.value([t.property("value")]),e.change(e,!1)})})}update(t,e){switch(super.update(t,e),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())}}blur(t){}keyup(t){}focus(t){}click(t){}dblclick(t){}change(t,e){}};e(R,"Input");let S=R;S.prototype._class+=" form_Input",S.prototype.implements(n.prototype),S.prototype.publish("type","text","set","Input type",["string","number","boolean","date","time","hidden","nested","button","checkbox","text","textarea","search","email","datetime"]),S.prototype.publish("inlineLabel",null,"string","Input Label",null,{optional:!0});const P=class _FieldForm extends w{constructor(){super(),this._tag="form"}fields(t){const e=super.fields.apply(this,arguments);if(arguments.length){const e=this.inputsMap();this.inputs(t.map(t=>e[t.id()]||(new S).name(t.id()).label(t.label()).type(t.type())))}return e}data(t){if(!arguments.length)return super.data();if(super.data(t[0]),t[0]){const e=this.inputs(),n=t[0][this.columns().length];let i=0;for(const t in n)e[i].name(t),++i}return this}};e(P,"FieldForm");let O=P;O.prototype._class+=" form_FieldForm";const C=class _InputRange extends i{_inputElement=[];_labelElement=[];_rangeData=[];constructor(){super(),n.call(this),this._tag="div"}enter(t,e){super.enter(t,e),this._labelElement[0]=e.append("label").attr("for",this.id()+"_input").style("visibility",this.inlineLabel_exists()?"visible":"hidden"),this._inputElement.push(e.append("input").attr("id",this.id()+"_input_min").attr("type",this.type())),this._inputElement.push(e.append("input").attr("id",this.id()+"_input_max").attr("type",this.type()));const n=this;this._inputElement.forEach(function(t,e){t.attr("name",n.name()),t.on("click",function(t){t.click(t)}),t.on("blur",function(t){t.blur(t)}),t.on("change",function(i){n._rangeData[e]=t.property("value"),n.value(n._rangeData),i.change(i,!0)})})}update(t,e){super.update(t,e),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)}};e(C,"InputRange");let F=C;F.prototype._class+=" form_InputRange",F.prototype.implements(n.prototype),F.prototype.publish("type","text","set","InputRange type",["number","date","text","time","datetime","hidden"]),F.prototype.publish("inlineLabel",null,"string","InputRange Label",null,{optional:!0}),F.prototype.publish("value",["",""],"array","Input Current Value",null,{override:!0});const L=class _OnOff extends i{_inputElement=[];_input;constructor(){super(),n.call(this),this._tag="div"}enter(t,e){super.enter(t,e),e.classed("onoffswitch",!0);const n=this;this._input=e.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){const e=[];n._inputElement.forEach(function(t,n){t.property("checked")&&e.push(t.property("value"))}),n.value(e),t.change(t,!0)});const i=e.append("label").attr("class","onoffswitch-label").attr("for",this.id()+"_onOff"),s=i.append("div").attr("class","onoffswitch-inner");s.append("div").attr("class","onoffswitch-offText").style("padding-right",this.containerRadius()/2+"px").text(this.offText()),s.append("div").attr("class","onoffswitch-onText").style("padding-left",this.containerRadius()/2+"px").style("width",`calc(100% - ${this.containerRadius()/2}px)`).text(this.onText()),i.append("div").attr("class","onoffswitch-switch")}update(t,e){super.update(t,e),this._input.attr("name",this.name()),e.style("margin-left",this.marginLeft()+"px").style("margin-bottom",this.marginBottom()+"px").style("width",this.minWidth()+"px");const n=this.minHeight()-4*this.gutter();e.select(".onoffswitch-switch").style("height",n+"px").style("width",n+"px").style("top",2*this.gutter()+1+"px").style("border-radius",this.switchRadius()+"px"),e.select(".onoffswitch-inner").style("min-height",this.minHeight()+"px"),e.select(".onoffswitch-label").style("border-radius",this.containerRadius()+"px"),e.select(".onoffswitch-offText").style("color",this.offFontColor()).style("background-color",this.offColor()),e.select(".onoffswitch-onText").style("color",this.onFontColor()).style("background-color",this.onColor())}};e(L,"OnOff");let A=L;A.prototype._class+=" form_OnOff",A.prototype.implements(n.prototype),A.prototype.publish("marginLeft",0,"number","Margin left of OnOff"),A.prototype.publish("marginBottom",0,"number","Margin bottom of OnOff"),A.prototype.publish("minWidth",100,"number","Minimum width of OnOff (pixels)"),A.prototype.publish("minHeight",20,"number","Minimum height of OnOff (pixels)"),A.prototype.publish("gutter",1,"number","Space between switch and border of OnOff (pixels)"),A.prototype.publish("onText","Save","string","Text to display when 'ON'"),A.prototype.publish("offText","Properties","string","Text to display when 'OFF'"),A.prototype.publish("switchRadius",10,"number","Border radius of switch (pixels)"),A.prototype.publish("containerRadius",10,"number","Border radius of OnOff (pixels)"),A.prototype.publish("onColor","#2ecc71","html-color","Background color when 'ON'"),A.prototype.publish("offColor","#ecf0f1","html-color","Background color when 'OFF'"),A.prototype.publish("onFontColor","#2c3e50","html-color","Font color when 'ON'"),A.prototype.publish("offFontColor","#7f8c8d","html-color","Font color when 'OFF'");const B=class _Radio extends i{_inputElement=[];constructor(){super(),n.call(this),this._tag="div"}enter(t,e){super.enter(t,e);const n=this,i=e.append("ul");this.selectOptions().length||this.selectOptions().push(""),this.selectOptions().forEach(function(t,e){n._inputElement[e]=i.append("li").append("input").attr("type","radio"),n._inputElement[e].node().insertAdjacentHTML("afterend","<text>"+t+"</text>")}),this._inputElement.forEach(function(t,e){t.attr("name",n.name()),t.on("click",function(t){t.click(t)}),t.on("blur",function(t){t.blur(t)}),t.on("change",function(e){n.value([t.property("value")]),e.change(e,!0)})})}update(t,e){super.update(t,e);const n=this;this._inputElement.forEach(function(t,e){t.property("value",n.selectOptions()[e]),-1!==n.value().indexOf(n.selectOptions()[e])&&"false"!==n.value()?t.property("checked",!0):t.property("checked",!1)})}};e(B,"Radio");let M=B;M.prototype._class+=" form_Radio",M.prototype.implements(n.prototype),M.prototype.publish("selectOptions",[],"array","Array of options used to fill a dropdown list");const H=class _Range extends i{_inputElement=[];constructor(){super(),n.call(this),this._tag="div"}enter(t,e){super.enter(t,e);const n=this;this._inputElement[0]=e.append("input").attr("type","range"),this._inputElement[1]=e.append("input").attr("type","number"),this._inputElement.forEach(function(t,e){t.attr("name",n.name()),t.on("click",function(t){t.click(t)}),t.on("blur",function(t){t.blur(t)}),t.on("change",function(t){0===e?(n._inputElement[1].property("value",s(n._inputElement[0].property("value")).toString()),n.value(n._inputElement[0].property("value"))):(n._inputElement[0].property("value",n._inputElement[1].property("value")),n.value(s(n._inputElement[1].property("value")).toString())),t.change(t,!0)})})}update(t,e){super.update(t,e),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())}insertSelectOptions(t){let e="";t.length>0?t.forEach(function(t){const 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)}};e(H,"Range");let I=H;I.prototype._class+=" form_Range",I.prototype.implements(n.prototype),I.prototype.publish("type","text","set","Input type",["html-color","number","checkbox","button","select","textarea","date","text","range","search","email","time","datetime"]),I.prototype.publish("selectOptions",[],"array","Array of options used to fill a dropdown list"),I.prototype.publish("low",null,"number","Minimum value for Range input"),I.prototype.publish("high",null,"number","Maximum value for Range input"),I.prototype.publish("step",null,"number","Step value for Range input");const T=class _Select extends i{_inputElement=[];constructor(){super(),n.call(this),this._tag="div"}enter(t,e){super.enter(t,e);const n=this;this._inputElement[0]=e.append("select").attr("name",this.name()).on("click",function(t){t.click(t)}).on("blur",function(t){t.blur(t)}).on("change",function(t){n.value([n._inputElement[0].property("value")]),t.change(t,!0)})}update(t,e){super.update(t,e),this.insertSelectOptions(this.selectOptions()),this._inputElement[0].property("value",this.value()).style("max-width",this.maxWidth_exists()?this.maxWidth()+"px":null)}insertSelectOptions(t){let e="";t.length>0?t.forEach(function(t){const 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)}};e(T,"Select");let V=T;V.prototype._class+=" form_Select",V.prototype.implements(n.prototype),V.prototype.publish("selectOptions",[],"array","Array of options used to fill a dropdown list"),V.prototype.publish("maxWidth",120,"number","Width",null,{optional:!0});const D=class _Slider extends r{xScale;moveMode;moveStartPos;prevValue;slider;handleLeft;handleLeftPos=0;handleLeftStartPos;handleRight;handleRightPos=0;handleRightStartPos;constructor(){super(),n.call(this)}enter(t,e){if(super.enter(t,e),this.resize({width:this.width(),height:50}),this.xScale=p().clamp(!0),this.slider=e.append("g").attr("class","slider"),null===this.low()&&null===this.high()&&null!==this.lowDatetime()&&null!==this.highDatetime()){const t=h(this.timePattern()?this.timePattern():"%Q");this.low(t(this.lowDatetime()).getTime()),this.high(t(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(u().on("start",()=>{const t=l();this.moveStartPos=t.x,this.handleLeftStartPos=this.handleLeftPos,this.handleRightStartPos=this.handleRightPos,this.allowRange()&&this.handleLeftPos<=t.x&&t.x<=this.handleRightPos?this.moveMode="both":Math.abs(t.x-this.handleLeftPos)<Math.abs(t.x-this.handleRightPos)?this.moveMode="left":this.moveMode="right",this.moveHandleTo(t.x)}).on("drag",()=>{this.moveHandleTo(l().x)}).on("end",()=>{this.moveHandleTo(l().x),this.data([[this.xScale.invert(this.handleLeftPos),this.xScale.invert(this.handleRightPos)]]),this.checkChangedValue()})),this.slider.insert("g",".track-overlay").attr("class","ticks").attr("transform",`translate(0, ${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")}update(t,e){super.update(t,e);const n=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]);const i=(this.width()-2*this.padding())/(this.tickCount()-1),s=[];if(null!==this.tickDateFormat()&&null!==this.timePattern()){const t=h("%Q"),e=c(this.tickDateFormat()),n=(this.high()-this.low())/(this.tickCount()-1);for(let i=0;i<this.tickCount();i++){const o=t(""+(this.low()+n*i));s.push(e(o))}}else{const t=d(this.tickValueFormat()),e=(this.high()-this.low())/(this.tickCount()-1);for(let n=0;n<this.tickCount();n++){const i=this.low()+e*n;s.push(t(i))}}const o=this.slider.selectAll("g.tick").data(s),l=o.enter().append("g").attr("class","tick");l.append("text").attr("class","tick-text"),l.append("line").attr("class","tick-line"),l.merge(o).each(function(t,e){const s=i*e;a(this).select("text.tick-text").style("font-size",n.fontSize()).attr("x",function(){return 0===e?s-2:e===n.tickCount()-1?s+2:s}).attr("y",n.tickHeight()+n.tickOffset()/2+n.fontSize()).attr("text-basline","text-before-edge").attr("text-anchor",function(){return 0===e?"start":e===n.tickCount()-1?"end":"middle"}).text(()=>t),a(this).select("line.tick-line").attr("x1",s).attr("x2",s).attr("y1",n.tickOffset()-1).attr("y2",n.tickOffset()+n.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()}checkChangedValue(){this.prevValue!==this.value()&&void 0!==this.prevValue&&this.change(this),this.prevValue=this.value()}updateHandles(){this.handleLeft.attr("transform",`translate(${this.handleLeftPos}, -28)`).attr("d",t=>this.handlePath("l")),this.handleRight.attr("transform",`translate(${this.handleRightPos}, -28)`).attr("d",t=>this.handlePath("r"))}lowPos(){let 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])}highPos(){let 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])}moveHandleTo(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()}constrain(t){const e=this.xScale.range();return t<e[0]&&(t=e[0]),t>e[1]&&(t=e[1]),this.nearestStep(t)}nearestStep(t){const e=this.xScale.invert(t);return this.xScale(this.low()+Math.round((e-this.low())/this.step())*this.step())}handlePath=/* @__PURE__ */e(function(t){const e=+("r"===t),n=e?1:-1,i=this.allowRange()?.5:0;let s="M"+i*n+","+"18A6,6 0 0 "+e+" "+6.5*n+",24V30A6,6 0 0 "+e+" "+i*n+",36";return this.allowRange()?s+="ZM"+2.5*n+",26V28M"+4.5*n+",26V28":s+="M"+1*n+",26V28",s},"handlePath")};e(D,"Slider");let W=D;W.prototype._class+=" form_Slider",W.prototype.implements(n.prototype),W.prototype.publish("padding",16,"number","Outer Padding",null,{tags:["Basic"]}),W.prototype.publish("fontSize",12,"number","Font Size",null,{tags:["Basic"]}),W.prototype.publish("fontFamily",null,"string","Font Name",null,{tags:["Basic"]}),W.prototype.publish("fontColor",null,"html-color","Font Color",null,{tags:["Basic"]}),W.prototype.publish("allowRange",!1,"boolean","Allow Range Selection",null,{tags:["Intermediate"]}),W.prototype.publish("low",null,"number","Low",null,{tags:["Intermediate"]}),W.prototype.publish("high",null,"number","High",null,{tags:["Intermediate"]}),W.prototype.publish("step",10,"number","Step",null,{tags:["Intermediate"]}),W.prototype.publish("lowDatetime",null,"string","Low",null,{tags:["Intermediate"]}),W.prototype.publish("highDatetime",null,"string","High",null,{tags:["Intermediate"]}),W.prototype.publish("selectionLabel","","string","Selection Label",null,{tags:["Intermediate"]}),W.prototype.publish("timePattern","%Y-%m-%d","string"),W.prototype.publish("tickCount",10,"number"),W.prototype.publish("tickOffset",5,"number"),W.prototype.publish("tickHeight",8,"number"),W.prototype.publish("tickDateFormat",null,"string"),W.prototype.publish("tickValueFormat",",.0f","string");const z=W.prototype.name;W.prototype.name=function(t){const e=z.apply(this,arguments);if(arguments.length){const e=t instanceof Array?t:[t];r.prototype.columns.call(this,e)}return e};const N=W.prototype.value;W.prototype.value=function(t){const e=N.apply(this,arguments);return arguments.length?(r.prototype.data.call(this,[this.allowRange()?t:[t,t]]),e):this.allowRange()?r.prototype.data.call(this)[0]:r.prototype.data.call(this)[0][0]};const j=class _TextArea extends S{constructor(){super(),this._tag="div",this.type("textarea")}enter(t,e){super.enter(t,e)}calcHeight(){return Math.max(this.minHeight_exists()?this.minHeight():0,this.height())}update(t,e){super.update(t,e),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(j,"TextArea");let q=j;q.prototype._class+=" form_TextArea",q.prototype.publish("rows",null,"number","Rows",null,{optional:!0}),q.prototype.publish("cols",null,"number","Columns",null,{optional:!0}),q.prototype.publish("wrap","off","set","Wrap",["off","on"]),q.prototype.publish("minHeight",null,"number","Minimum Height",null,{optional:!0}),q.prototype.publish("spellcheck",null,"boolean","Input spell checking",{optional:!0});export{y as BUILD_VERSION,b as Button,v as CheckBox,E as ColorInput,O as FieldForm,w as Form,S as Input,F as InputRange,A as OnOff,m as PKG_NAME,f as PKG_VERSION,M as Radio,I as Range,V as Select,W as Slider,q as TextArea};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
3
3
|
!function(){"use strict";try{if("undefined"!=typeof document){var o=document.createElement("style");o.appendChild(document.createTextNode(".form_Input input,.form_Input select,.form_Input button,.form_Input textarea{padding:2px}.form_Input button{cursor:pointer}.form_Input input.color-text{width:120px}.form_Input input.color-text+input{width:57px;position:absolute}.form_Input textarea,.form_Input input[type=textbox]{width:100%;box-sizing:border-box;display:block}.form_Input ul{list-style-type:none;float:left;padding:0;margin:0}.form_Input li{float:left;list-style-position:inside}.form_Form{color:#404040}.form_Form tbody td{white-space:nowrap;border:1px solid #E5E5E5}.form_Form td.prompt{padding:2px;vertical-align:middle;background-color:#e5e5e5}.form_Form td.input{padding:2px;width:100%;vertical-align:middle}.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{background-position:-1px -1px;box-sizing:border-box;color:#24292e;cursor:pointer;height:28px;inset:0;overflow-wrap:break-word;position:relative;text-decoration:none solid rgb(36,41,46);vertical-align:middle;white-space:nowrap;word-wrap:break-word;column-rule-color:#24292e;perspective-origin:57.2938px 14px;transform-origin:57.2938px 14px;-webkit-user-select:none;user-select:none;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;outline:rgb(36,41,46) none 0px;padding:3px 10px}.form_Form .form_Button button[disabled=disabled]{background:#dbdfe2}.form_Form .form_Button button:focus{box-shadow:0 0 0 .2em #0366d64d}.form_Form .form_Button button:hover{background:#dbdfe2}.form_Form .form_Button.default button{color:#fff;text-decoration:none solid rgb(255,255,255);word-wrap:break-word;column-rule-color:#fff;perspective-origin:44.975px 17px;transform-origin:44.975px 17px;background:#28a745 linear-gradient(-180deg,#34d058,#28a745 90%) repeat-x scroll -1px -1px / 110% 110% padding-box border-box;outline:rgb(255,255,255) none 0px}.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}.onoffswitch-checkbox{display:none}.onoffswitch{position:relative;height:20px;width:100px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.onoffswitch-label{display:block;overflow:hidden;cursor:pointer;border:1px solid #999999;height:20px}.onoffswitch-inner{position:relative;display:block;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;transition:all .3s ease-in 0s;width:100%;text-align:right}.onoffswitch-inner>.onoffswitch-onText{font-weight:700;position:absolute;left:-100%;transition:all .3s ease-in 0s;width:100%;text-align:left}.onoffswitch-switch{display:block;width:20px;margin:-1px;background:#fff;position:absolute;border:1px solid #999999;transition:all .3s ease-in 0s;inset:0 78px 0 4px}.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)}.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{pointer-events:stroke;stroke-width:50px;stroke:transparent;cursor:crosshair}.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}")),document.head.appendChild(o)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}}();
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/__package__.ts","../src/Button.ts","../src/CheckBox.ts","../src/ColorInput.ts","../src/Form.ts","../src/Input.ts","../src/FieldForm.ts","../src/InputRange.ts","../src/OnOff.ts","../src/Radio.ts","../src/Range.ts","../src/Select.ts","../src/Slider.ts","../src/TextArea.ts"],"sourcesContent":["export const PKG_NAME = \"__PACKAGE_NAME__\";\nexport const PKG_VERSION = \"__PACKAGE_VERSION__\";\nexport const BUILD_VERSION = \"__BUILD_VERSION__\";\n","import { IInput } from \"@hpcc-js/api\";\nimport { HTMLWidget } from \"@hpcc-js/common\";\n\nimport \"../src/Input.css\";\n\nexport class Button extends HTMLWidget {\n _inputElement = [];\n\n constructor() {\n super();\n IInput.call(this);\n\n this._tag = \"div\";\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n const context = this;\n this._inputElement[0] = element.append(\"button\")\n .attr(\"name\", this.name())\n .on(\"click\", function (w) {\n w.click(w);\n })\n .on(\"blur\", function (w) {\n w.blur(w);\n })\n .on(\"change\", function (w) {\n context.value([context._inputElement[0].property(\"value\")]);\n w.change(w, true);\n })\n ;\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n\n this._inputElement[0].text(this.value());\n }\n}\nButton.prototype._class += \" form_Button\";\nButton.prototype.implements(IInput.prototype);\n\nexport interface Button {\n name(): string;\n name(_: string): Button;\n label(): string;\n label(_: string): Button;\n value(): any;\n value(_: any): Button;\n validate(): string;\n validate(_: string): Button;\n}\n","import { IInput } from \"@hpcc-js/api\";\nimport { HTMLWidget } from \"@hpcc-js/common\";\n\nimport \"../src/Input.css\";\n\nexport class CheckBox extends HTMLWidget {\n _inputElement = [];\n\n constructor() {\n super();\n IInput.call(this);\n\n this._tag = \"div\";\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n const context = this;\n\n const checkboxContainer = element.append(\"ul\");\n if (!this.selectOptions().length) {\n this.selectOptions().push(\"\"); // create an empty radio if we using .value and not selectOptions array\n }\n this.selectOptions().forEach(function (val, idx) {\n context._inputElement[idx] = checkboxContainer.append(\"li\").append(\"input\").attr(\"type\", \"checkbox\");\n context._inputElement[idx].node().insertAdjacentHTML(\"afterend\", \"<text>\" + val + \"</text>\");\n });\n\n this._inputElement.forEach(function (e, idx) {\n e.attr(\"name\", context.name());\n e.on(\"click\", function (w) {\n w.click(w);\n });\n e.on(\"blur\", function (w) {\n w.blur(w);\n });\n e.on(\"change\", function (w) {\n const vals = [];\n context._inputElement.forEach(function (d) {\n if (d.property(\"checked\")) {\n vals.push(d.property(\"value\"));\n }\n });\n context.value(vals);\n w.change(w, true);\n });\n });\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n\n const context = this;\n\n this._inputElement.forEach(function (e, idx) {\n e.property(\"value\", context.selectOptions()[idx]);\n if (context.value().indexOf(context.selectOptions()[idx]) !== -1 && context.value() !== \"false\") {\n e.property(\"checked\", true);\n } else {\n e.property(\"checked\", false);\n }\n });\n }\n\n insertSelectOptions(optionsArr) {\n let optionHTML = \"\";\n if (optionsArr.length > 0) {\n optionsArr.forEach(function (opt) {\n const val = (opt instanceof Array ? opt[0] : opt);\n const text = (opt instanceof Array ? (opt[1] ? opt[1] : opt[0]) : opt);\n optionHTML += \"<option value='\" + val + \"'>\" + text + \"</option>\";\n });\n } else {\n optionHTML += \"<option>selectOptions not set</option>\";\n }\n this._inputElement[0].html(optionHTML);\n }\n}\nCheckBox.prototype._class += \" form_CheckBox\";\nCheckBox.prototype.implements(IInput.prototype);\n\nexport interface CheckBox {\n // IInput ---\n name(): string;\n name(_: string): this;\n name_exists(): boolean;\n label(): string;\n label(_: string): this;\n label_exists(): boolean;\n value(): any;\n value(_: any): this;\n value_exists(): boolean;\n validate(): string;\n validate(_: string): this;\n validate_exists(): boolean;\n\n // Properties ---\n selectOptions(): any[];\n selectOptions(_: any[]): this;\n selectOptions_exists(): boolean;\n}\n\nCheckBox.prototype.publish(\"selectOptions\", [], \"array\", \"Array of options used to fill a dropdown list\");\n","import { IInput } from \"@hpcc-js/api\";\nimport { HTMLWidget } from \"@hpcc-js/common\";\nimport { rgb as d3Rgb } from \"d3-color\";\n\nimport \"../src/Input.css\";\n\nexport class ColorInput extends HTMLWidget {\n _inputElement = [];\n\n constructor() {\n super();\n IInput.call(this);\n\n this._tag = \"div\";\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n\n const context = this;\n\n this._inputElement[0] = element.append(\"input\").attr(\"type\", \"text\");\n this._inputElement[0].classed(\"color-text\", true);\n this._inputElement[1] = element.append(\"input\").attr(\"type\", \"color\");\n\n this._inputElement.forEach(function (e, idx) {\n e.on(\"click\", function (w) {\n w.click(w);\n });\n e.on(\"blur\", function (w) {\n w.blur(w);\n });\n e.on(\"change\", function (w) {\n if (idx === 0) {\n context._inputElement[1].property(\"value\", d3Rgb(context._inputElement[0].property(\"value\")).toString());\n context.value(context._inputElement[0].property(\"value\"));\n } else {\n context._inputElement[0].property(\"value\", context._inputElement[1].property(\"value\"));\n context.value(d3Rgb(context._inputElement[1].property(\"value\")).toString());\n }\n w.change(w, true);\n });\n });\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n\n const context = this;\n this._inputElement.forEach(function (e) {\n e.attr(\"name\", context.name());\n });\n\n this._inputElement[0].attr(\"type\", \"text\");\n this._inputElement[1].attr(\"type\", \"color\");\n this._inputElement[0].property(\"value\", this.value());\n this._inputElement[1].property(\"value\", d3Rgb(this.value()).toString());\n\n const bbox = this._inputElement[0].node().getBoundingClientRect();\n this._inputElement[1].style(\"height\", (bbox.height - 2) + \"px\");\n\n }\n}\nColorInput.prototype._class += \" form_ColorInput\";\nColorInput.prototype.implements(IInput.prototype);\n\nexport interface ColorInput {\n // IInput ---\n name(): string;\n name(_: string): this;\n name_exists(): boolean;\n label(): string;\n label(_: string): this;\n label_exists(): boolean;\n value(): any;\n value(_: any): this;\n value_exists(): boolean;\n validate(): string;\n validate(_: string): this;\n validate_exists(): boolean;\n}\n","import { d3Event, HTMLWidget, select as d3Select, SVGWidget, Widget, WidgetArray } from \"@hpcc-js/common\";\nimport { Button } from \"./Button.ts\";\n\nimport \"../src/Form.css\";\n\nexport class Form extends HTMLWidget {\n tbody;\n tfoot;\n btntd;\n _controls;\n _maxCols;\n\n constructor() {\n super();\n\n this._tag = \"form\";\n }\n\n data(): any;\n data(_: any): this;\n data(_?: any): any | this {\n if (!arguments.length) {\n const retVal = [];\n this.inputsForEach(function (input) {\n retVal.push(input.value());\n });\n return retVal;\n } else {\n this.inputsForEach(function (input, idx) {\n if (_ && _.length > idx) {\n input.value(_[idx]).render();\n }\n });\n }\n return this;\n }\n\n inputsForEach(callback, scope?) {\n let idx = 0;\n this.inputs().forEach(function (inp) {\n const inpArray = inp instanceof WidgetArray ? inp.content() : [inp];\n inpArray.forEach(function (inp2) {\n if (scope) {\n callback.call(scope, inp2, idx++);\n } else {\n callback(inp2, idx++);\n }\n });\n });\n }\n\n inputsMap(): { [name: string]: Widget } {\n const retVal: { [name: string]: Widget } = {};\n this.inputs().forEach(function (inp) {\n retVal[inp.name()] = inp;\n });\n return retVal;\n }\n\n calcMaxColumns() {\n let retVal = 0;\n this.inputs().forEach(function (inputWidget) {\n const inputWidgetArray = inputWidget instanceof WidgetArray ? inputWidget.content() : [inputWidget];\n if (inputWidgetArray.length > retVal) {\n retVal = inputWidgetArray.length;\n }\n });\n return retVal;\n }\n\n values(): any;\n values(_: any): this;\n values(_?: any): any | this {\n if (!arguments.length) {\n const dataArr = {};\n this.inputsForEach(function (inp) {\n const type = inp.type ? inp.type() : \"text\";\n const value = inp.value();\n if (value || !this.omitBlank()) {\n switch (type) {\n case \"checkbox\":\n dataArr[inp.name()] = inp.value_exists() ? !!inp.value() : undefined;\n break;\n case \"number\":\n const v = inp.value();\n dataArr[inp.name()] = v === \"\" ? undefined : +v;\n break;\n case \"text\":\n default:\n dataArr[inp.name()] = inp.value_exists() ? inp.value() : undefined;\n break;\n }\n }\n }, this);\n return dataArr;\n } else {\n this.inputsForEach(function (inp) {\n if (_[inp.name()]) {\n inp.value(_[inp.name()]);\n } else if (this.omitBlank()) {\n inp.value(\"\");\n }\n }, this);\n }\n return this;\n }\n\n submit() {\n let isValid = true;\n if (this.validate()) {\n isValid = this.checkValidation();\n }\n if (!this.allowEmptyRequest() && !this.inputs().some(function (w) {\n if (w._class.indexOf(\"WidgetArray\") !== -1) {\n return w.content().some(function (wa) {\n return wa.hasValue();\n });\n }\n return w.hasValue();\n })) {\n return;\n }\n this.click(isValid ? this.values() : null, null, isValid);\n }\n\n clear() {\n this.inputsForEach(function (inp) {\n switch (inp.classID()) {\n case \"form_Slider\":\n if (inp.allowRange()) {\n inp.value([inp.low(), inp.low()]).render();\n } else {\n inp.value(inp.low()).render();\n }\n break;\n case \"form_CheckBox\":\n inp.value(false).render();\n break;\n case \"form_Button\":\n /* skip */\n break;\n default:\n inp.value(undefined).render();\n break;\n }\n });\n }\n\n checkValidation() {\n let ret = true;\n const msgArr = [];\n this.inputsForEach(function (inp) {\n if (!inp.isValid()) {\n msgArr.push(\"'\" + inp.label() + \"'\" + \" value is invalid.\");\n }\n });\n if (msgArr.length > 0) {\n alert(msgArr.join(\"\\n\"));\n ret = false;\n }\n return ret;\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n element.on(\"submit\", function () {\n d3Event().preventDefault();\n });\n\n this._placeholderElement.style(\"overflow\", \"auto\");\n const table = element\n .append(\"table\")\n ;\n this.tbody = table.append(\"tbody\");\n this.tfoot = table.append(\"tfoot\");\n this.btntd = this.tfoot.append(\"tr\").append(\"td\")\n .attr(\"colspan\", 2)\n ;\n\n const context = this;\n this._controls = [\n new Button()\n .classed({ default: true })\n .value(\"Submit\")\n .on(\"click\", function () {\n context.submit();\n }, true),\n new Button()\n .value(\"Clear\")\n .on(\"click\", function () {\n context.clear();\n }, true)\n ];\n const rightJust = context.btntd\n .append(\"div\")\n .style(\"float\", \"right\")\n ;\n this._controls.forEach(function (w) {\n const leftJust = rightJust\n .append(\"span\")\n .style(\"float\", \"left\")\n ;\n w.target(leftJust.node()).render();\n });\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n\n this._maxCols = this.calcMaxColumns();\n\n const context = this;\n const rows = this.tbody.selectAll(\"tr\").data(this.inputs());\n rows.enter().append(\"tr\")\n .each(function (inputWidget, i) {\n const element2 = d3Select(this);\n\n const inputWidgetArray = inputWidget instanceof WidgetArray ? inputWidget.content() : [inputWidget];\n inputWidgetArray.forEach(function (inputWidget2, idx) {\n element2.append(\"td\")\n .attr(\"class\", \"prompt\")\n ;\n const input = element2.append(\"td\")\n .attr(\"class\", \"input\")\n ;\n if (idx === inputWidgetArray.length - 1 && inputWidgetArray.length < context._maxCols) {\n input.attr(\"colspan\", (context._maxCols - inputWidgetArray.length + 1) * 2);\n }\n inputWidget2.target(input.node()).render();\n if (inputWidget2 instanceof SVGWidget) {\n const bbox = inputWidget2.element().node().getBBox();\n input.style(\"height\", bbox.height + \"px\");\n inputWidget2.resize().render();\n }\n\n if (inputWidget2._inputElement instanceof Array) {\n inputWidget2._inputElement.forEach(function (e) {\n e.on(\"keyup.form\", function (w) {\n setTimeout(function () {\n\n context._controls[0].disable(!context.allowEmptyRequest() && !context.inputs().some(function (w2) {\n if (w2._class.indexOf(\"WidgetArray\") !== -1) {\n return w2.content().some(function (wa) {\n return wa.hasValue();\n });\n }\n return w2.hasValue();\n }));\n }, 100);\n });\n });\n }\n });\n })\n .merge(rows)\n .each(function (inputWidget, i) {\n const element2 = d3Select(this);\n const inputWidgetArray = inputWidget instanceof WidgetArray ? inputWidget.content() : [inputWidget];\n inputWidgetArray.forEach(function (inputWidget2, idx) {\n element2.select(\"td.prompt\")\n .text(inputWidget2.label() + \":\")\n ;\n });\n })\n ;\n rows.each(function (inputWidget, i) {\n if (i === 0 && inputWidget.setFocus) {\n inputWidget.setFocus();\n }\n });\n rows.exit()\n .each(function (inputWidget, i) {\n const inputWidgetArray = inputWidget instanceof WidgetArray ? inputWidget.content() : [inputWidget];\n inputWidgetArray.forEach(function (inputWidget2, idx) {\n inputWidget2.target(null);\n });\n })\n .remove()\n ;\n\n this.tfoot\n .style(\"display\", this.showSubmit() ? \"table-footer-group\" : \"none\")\n ;\n this.btntd\n .attr(\"colspan\", this._maxCols * 2)\n ;\n\n // Disable Submit unless there is data\n if (!this.allowEmptyRequest()) {\n setTimeout(function () {\n context._controls[0].disable(!context.allowEmptyRequest() && !context.inputs().some(function (w) {\n if (w._class.indexOf(\"WidgetArray\") !== -1) {\n return w.content().some(function (wa) {\n return wa.hasValue();\n });\n }\n return w.hasValue();\n }));\n }, 100);\n }\n\n }\n\n exit(domNode, element) {\n this.inputsForEach(input => input.target(null));\n super.exit(domNode, element);\n }\n\n click(row, col, sel) {\n }\n}\nForm.prototype._class += \" form_Form\";\n\nexport interface Form {\n validate(): boolean;\n validate(_: boolean): this;\n validate_exists(): boolean;\n inputs(): any[];\n inputs(_: any[]): this;\n inputs_exists(): boolean;\n inputs_reset(): void;\n showSubmit(): boolean;\n showSubmit(_: boolean): this;\n showSubmit_exists(): boolean;\n omitBlank(): boolean;\n omitBlank(_: boolean): this;\n omitBlank_exists(): boolean;\n allowEmptyRequest(): boolean;\n allowEmptyRequest(_: boolean): this;\n allowEmptyRequest_exists(): boolean;\n}\n\nForm.prototype.publish(\"validate\", true, \"boolean\", \"Enable/Disable input validation\");\nForm.prototype.publish(\"inputs\", [], \"widgetArray\", \"Array of input widgets\", null, { render: false });\nForm.prototype.publish(\"showSubmit\", true, \"boolean\", \"Show Submit/Cancel Controls\");\nForm.prototype.publish(\"omitBlank\", false, \"boolean\", \"Drop Blank Fields From Submit\");\nForm.prototype.publish(\"allowEmptyRequest\", false, \"boolean\", \"Allow Blank Form to be Submitted\");\n","import { IInput } from \"@hpcc-js/api\";\nimport { Database, HTMLWidget } from \"@hpcc-js/common\";\n\nimport \"../src/Input.css\";\n\nexport class Input extends HTMLWidget {\n _inputElement = [];\n _labelElement = [];\n\n constructor() {\n super();\n IInput.call(this);\n\n this._tag = \"div\";\n }\n\n checked(_) {\n if (!arguments.length) return this._inputElement[0] ? this._inputElement[0].property(\"checked\") : false;\n if (this._inputElement[0]) {\n this._inputElement[0].property(\"checked\", _);\n }\n return this;\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n\n this._labelElement[0] = element.append(\"label\")\n .attr(\"for\", this.id() + \"_input\")\n .style(\"visibility\", this.inlineLabel_exists() ? \"visible\" : \"hidden\")\n ;\n\n const context = this;\n switch (this.type()) {\n case \"button\":\n this._inputElement[0] = element.append(\"button\")\n .attr(\"id\", this.id() + \"_input\")\n ;\n break;\n case \"textarea\":\n this._inputElement[0] = element.append(\"textarea\")\n .attr(\"id\", this.id() + \"_input\")\n ;\n break;\n default:\n this._inputElement[0] = element.append(\"input\")\n .attr(\"id\", this.id() + \"_input\")\n .attr(\"type\", this.type())\n ;\n break;\n }\n\n this._inputElement.forEach(function (e, idx) {\n e.attr(\"name\", context.name());\n e.on(\"click\", function (w: Input) {\n w.click(w);\n });\n e.on(\"blur\", function (w: Input) {\n w.blur(w);\n });\n e.on(\"change\", function (w: Input) {\n context.value([e.property(\"value\")]);\n w.change(w, true);\n });\n e.on(\"keyup\", function (w: Input) {\n context.value([e.property(\"value\")]);\n w.change(w, false);\n });\n });\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n\n this._labelElement[0]\n .style(\"visibility\", this.inlineLabel_exists() ? \"visible\" : \"hidden\")\n .text(this.inlineLabel())\n ;\n switch (this.type()) {\n case \"button\":\n this._inputElement[0].text(this.value());\n break;\n case \"textarea\":\n this._inputElement[0].property(\"value\", this.value());\n break;\n default:\n this._inputElement[0].attr(\"type\", this.type());\n this._inputElement[0].property(\"value\", this.value());\n break;\n }\n }\n\n // IInput Events ---\n blur(w: Input) {\n }\n keyup(w: Input) {\n }\n focus(w: Input) {\n }\n click(w: Input) {\n }\n dblclick(w: Input) {\n }\n change(w: Input, complete: boolean) {\n }\n}\nInput.prototype._class += \" form_Input\";\nInput.prototype.implements(IInput.prototype);\n\nexport interface Input {\n // IInput ---\n name(): string;\n name(_: string): this;\n name_exists(): boolean;\n label(): string;\n label(_: string): this;\n label_exists(): boolean;\n value(): any;\n value(_: any): this;\n value_exists(): boolean;\n validate(): string;\n validate(_: string): this;\n validate_exists(): boolean;\n\n // Properties ---\n type(): Database.FieldType | \"button\" | \"checkbox\" | \"text\" | \"textarea\" | \"search\" | \"email\" | \"datetime\";\n type(_: Database.FieldType | \"button\" | \"checkbox\" | \"text\" | \"textarea\" | \"search\" | \"email\" | \"datetime\"): this;\n type_exists(): boolean;\n type_default(): string;\n inlineLabel(): string;\n inlineLabel(_: string): this;\n inlineLabel_exists(): boolean;\n}\n\nInput.prototype.publish(\"type\", \"text\", \"set\", \"Input type\", [\"string\", \"number\", \"boolean\", \"date\", \"time\", \"hidden\", \"nested\", \"button\", \"checkbox\", \"text\", \"textarea\", \"search\", \"email\", \"datetime\"]);\nInput.prototype.publish(\"inlineLabel\", null, \"string\", \"Input Label\", null, { optional: true });\n","import { Database } from \"@hpcc-js/common\";\nimport { Form } from \"./Form.ts\";\nimport { Input } from \"./Input.ts\";\n\nimport \"../src/Form.css\";\n\nexport class FieldForm extends Form {\n\n constructor() {\n super();\n\n this._tag = \"form\";\n }\n\n fields(): Database.Field[];\n fields(_: Database.Field[]): this;\n fields(_?: Database.Field[]): Database.Field[] | this {\n const retVal = super.fields.apply(this, arguments);\n if (arguments.length) {\n const inpMap = this.inputsMap();\n this.inputs(_.map(f => inpMap[f.id()] || new Input()\n .name(f.id())\n .label(f.label())\n .type(f.type())\n ));\n }\n return retVal;\n }\n\n data(): any;\n data(_: any): this;\n data(_?: any): any | this {\n if (!arguments.length) return super.data();\n super.data(_[0]);\n if (_[0]) {\n // Update input \"name\" with the __lparam ids ---\n const inputs = this.inputs();\n const __lparam = _[0][this.columns().length];\n let i = 0;\n for (const key in __lparam) {\n inputs[i].name(key);\n ++i;\n }\n }\n return this;\n }\n\n}\nFieldForm.prototype._class += \" form_FieldForm\";\n","import { IInput } from \"@hpcc-js/api\";\nimport { HTMLWidget } from \"@hpcc-js/common\";\n\nimport \"../src/Input.css\";\n\nexport class InputRange extends HTMLWidget {\n _inputElement = [];\n _labelElement = [];\n _rangeData = [];\n\n constructor() {\n super();\n IInput.call(this);\n\n this._tag = \"div\";\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n\n this._labelElement[0] = element.append(\"label\")\n .attr(\"for\", this.id() + \"_input\")\n .style(\"visibility\", this.inlineLabel_exists() ? \"visible\" : \"hidden\")\n ;\n\n this._inputElement.push(element.append(\"input\")\n .attr(\"id\", this.id() + \"_input_min\")\n .attr(\"type\", this.type()));\n this._inputElement.push(element.append(\"input\")\n .attr(\"id\", this.id() + \"_input_max\")\n .attr(\"type\", this.type()));\n\n const context = this;\n this._inputElement.forEach(function (e, idx) {\n e.attr(\"name\", context.name());\n e.on(\"click\", function (w) {\n w.click(w);\n });\n e.on(\"blur\", function (w) {\n w.blur(w);\n });\n e.on(\"change\", function (w) {\n context._rangeData[idx] = e.property(\"value\");\n context.value(context._rangeData);\n w.change(w, true);\n });\n });\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n\n this._labelElement[0]\n .style(\"visibility\", this.inlineLabel_exists() ? \"visible\" : \"hidden\")\n .text(this.inlineLabel())\n ;\n\n this._rangeData = this.value();\n this._inputElement.forEach(function (e, idx) {\n e\n .attr(\"type\", this.type())\n .property(\"value\", this._rangeData.length > idx ? this._rangeData[idx] : \"\");\n }, this);\n }\n}\nInputRange.prototype._class += \" form_InputRange\";\nInputRange.prototype.implements(IInput.prototype);\n\nexport interface InputRange {\n // IInput ---\n name(): string;\n name(_: string): this;\n name_exists(): boolean;\n label(): string;\n label(_: string): this;\n label_exists(): boolean;\n value(): any[];\n value(_: any[]): this;\n value_exists(): boolean;\n validate(): string;\n validate(_: string): this;\n validate_exists(): boolean;\n\n // Properties ---\n type(): string;\n type(_: string): this;\n type_exists(): boolean;\n inlineLabel(): string;\n inlineLabel(_: string): this;\n inlineLabel_exists(): boolean;\n}\n\nInputRange.prototype.publish(\"type\", \"text\", \"set\", \"InputRange type\", [\"number\", \"date\", \"text\", \"time\", \"datetime\", \"hidden\"]);\nInputRange.prototype.publish(\"inlineLabel\", null, \"string\", \"InputRange Label\", null, { optional: true });\nInputRange.prototype.publish(\"value\", [\"\", \"\"], \"array\", \"Input Current Value\", null, { override: true });\n","import { IInput } from \"@hpcc-js/api\";\nimport { HTMLWidget } from \"@hpcc-js/common\";\n\nimport \"../src/OnOff.css\";\n\nexport class OnOff extends HTMLWidget {\n _inputElement = [];\n _input;\n\n constructor() {\n super();\n IInput.call(this);\n\n this._tag = \"div\";\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n element.classed(\"onoffswitch\", true);\n const context = this;\n this._input = element.append(\"input\")\n .attr(\"class\", \"onoffswitch-checkbox\")\n .attr(\"type\", \"checkbox\")\n .attr(\"id\", this.id() + \"_onOff\")\n .on(\"click\", function (w) {\n w.click(w);\n })\n .on(\"blur\", function (w) {\n w.blur(w);\n })\n .on(\"change\", function (w) {\n const vals = [];\n context._inputElement.forEach(function (d, idx) {\n if (d.property(\"checked\")) {\n vals.push(d.property(\"value\"));\n }\n });\n context.value(vals);\n w.change(w, true);\n })\n ;\n const label = element.append(\"label\")\n .attr(\"class\", \"onoffswitch-label\")\n .attr(\"for\", this.id() + \"_onOff\")\n ;\n const inner = label.append(\"div\")\n .attr(\"class\", \"onoffswitch-inner\")\n ;\n inner.append(\"div\")\n .attr(\"class\", \"onoffswitch-offText\")\n .style(\"padding-right\", (this.containerRadius() / 2) + \"px\")\n .text(this.offText())\n ;\n inner.append(\"div\")\n .attr(\"class\", \"onoffswitch-onText\")\n .style(\"padding-left\", (this.containerRadius() / 2) + \"px\")\n .style(\"width\", `calc(100% - ${(this.containerRadius() / 2)}px)`)\n .text(this.onText())\n ;\n label.append(\"div\")\n .attr(\"class\", \"onoffswitch-switch\")\n ;\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n this._input\n .attr(\"name\", this.name())\n ;\n element\n .style(\"margin-left\", this.marginLeft() + \"px\")\n .style(\"margin-bottom\", this.marginBottom() + \"px\")\n .style(\"width\", this.minWidth() + \"px\")\n ;\n\n const _switch_size = this.minHeight() - (this.gutter() * 4);\n\n element.select(\".onoffswitch-switch\")\n .style(\"height\", _switch_size + \"px\")\n .style(\"width\", _switch_size + \"px\")\n .style(\"top\", (this.gutter() * 2) + 1 + \"px\")\n .style(\"border-radius\", this.switchRadius() + \"px\")\n ;\n element.select(\".onoffswitch-inner\")\n .style(\"min-height\", this.minHeight() + \"px\")\n ;\n element.select(\".onoffswitch-label\")\n .style(\"border-radius\", this.containerRadius() + \"px\")\n ;\n element.select(\".onoffswitch-offText\")\n .style(\"color\", this.offFontColor())\n .style(\"background-color\", this.offColor())\n ;\n element.select(\".onoffswitch-onText\")\n .style(\"color\", this.onFontColor())\n .style(\"background-color\", this.onColor())\n ;\n }\n}\nOnOff.prototype._class += \" form_OnOff\";\nexport interface OnOff {\n // IInput ---\n name(): string;\n name(_: string): this;\n name_exists(): boolean;\n label(): string;\n label(_: string): this;\n label_exists(): boolean;\n value(): any;\n value(_: any): this;\n value_exists(): boolean;\n validate(): string;\n validate(_: string): this;\n validate_exists(): boolean;\n\n // Properties ---\n marginLeft(): number;\n marginLeft(_: number): this;\n marginBottom(): number;\n marginBottom(_: number): this;\n minWidth(): number;\n minWidth(_: number): this;\n minHeight(): number;\n minHeight(_: number): this;\n gutter(): number;\n gutter(_: number): this;\n offText(): string;\n offText(_: string): this;\n onText(): string;\n onText(_: string): this;\n switchRadius(): number;\n switchRadius(_: number): this;\n containerRadius(): number;\n containerRadius(_: number): this;\n offColor(): string;\n offColor(_: string): this;\n onColor(): string;\n onColor(_: string): this;\n offFontColor(): string;\n offFontColor(_: string): this;\n onFontColor(): string;\n onFontColor(_: string): this;\n\n}\nOnOff.prototype.implements(IInput.prototype);\n\nOnOff.prototype.publish(\"marginLeft\", 0, \"number\", \"Margin left of OnOff\");\nOnOff.prototype.publish(\"marginBottom\", 0, \"number\", \"Margin bottom of OnOff\");\nOnOff.prototype.publish(\"minWidth\", 100, \"number\", \"Minimum width of OnOff (pixels)\");\nOnOff.prototype.publish(\"minHeight\", 20, \"number\", \"Minimum height of OnOff (pixels)\");\nOnOff.prototype.publish(\"gutter\", 1, \"number\", \"Space between switch and border of OnOff (pixels)\");\nOnOff.prototype.publish(\"onText\", \"Save\", \"string\", \"Text to display when 'ON'\");\nOnOff.prototype.publish(\"offText\", \"Properties\", \"string\", \"Text to display when 'OFF'\");\nOnOff.prototype.publish(\"switchRadius\", 10, \"number\", \"Border radius of switch (pixels)\");\nOnOff.prototype.publish(\"containerRadius\", 10, \"number\", \"Border radius of OnOff (pixels)\");\nOnOff.prototype.publish(\"onColor\", \"#2ecc71\", \"html-color\", \"Background color when 'ON'\");\nOnOff.prototype.publish(\"offColor\", \"#ecf0f1\", \"html-color\", \"Background color when 'OFF'\");\nOnOff.prototype.publish(\"onFontColor\", \"#2c3e50\", \"html-color\", \"Font color when 'ON'\");\nOnOff.prototype.publish(\"offFontColor\", \"#7f8c8d\", \"html-color\", \"Font color when 'OFF'\");\n","import { IInput } from \"@hpcc-js/api\";\nimport { HTMLWidget } from \"@hpcc-js/common\";\n\nimport \"../src/Input.css\";\n\nexport class Radio extends HTMLWidget {\n _inputElement = [];\n constructor() {\n super();\n IInput.call(this);\n\n this._tag = \"div\";\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n\n const context = this;\n\n const radioContainer = element.append(\"ul\");\n if (!this.selectOptions().length) {\n this.selectOptions().push(\"\"); // create an empty radio if we using .value and not selectOptions array\n }\n this.selectOptions().forEach(function (val, idx) {\n context._inputElement[idx] = radioContainer.append(\"li\").append(\"input\").attr(\"type\", \"radio\");\n context._inputElement[idx].node().insertAdjacentHTML(\"afterend\", \"<text>\" + val + \"</text>\");\n });\n\n this._inputElement.forEach(function (e, idx) {\n e.attr(\"name\", context.name());\n e.on(\"click\", function (w) {\n w.click(w);\n });\n e.on(\"blur\", function (w) {\n w.blur(w);\n });\n e.on(\"change\", function (w) {\n context.value([e.property(\"value\")]);\n w.change(w, true);\n });\n });\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n\n const context = this;\n\n this._inputElement.forEach(function (e, idx) {\n e.property(\"value\", context.selectOptions()[idx]);\n if (context.value().indexOf(context.selectOptions()[idx]) !== -1 && context.value() !== \"false\") {\n e.property(\"checked\", true);\n } else {\n e.property(\"checked\", false);\n }\n });\n }\n}\nRadio.prototype._class += \" form_Radio\";\nRadio.prototype.implements(IInput.prototype);\n\nexport interface Radio {\n // IInput ---\n name(): string;\n name(_: string): this;\n name_exists(): boolean;\n label(): string;\n label(_: string): this;\n label_exists(): boolean;\n value(): any;\n value(_: any): this;\n value_exists(): boolean;\n validate(): string;\n validate(_: string): this;\n validate_exists(): boolean;\n\n // Properties ---\n selectOptions(): any[];\n selectOptions(_: any[]): this;\n selectOptions_exists(): boolean;\n}\n\nRadio.prototype.publish(\"selectOptions\", [], \"array\", \"Array of options used to fill a dropdown list\");\n","import { IInput } from \"@hpcc-js/api\";\nimport { HTMLWidget } from \"@hpcc-js/common\";\nimport { rgb as d3Rgb } from \"d3-color\";\n\nimport \"../src/Input.css\";\n\nexport class Range extends HTMLWidget {\n _inputElement = [];\n\n constructor() {\n super();\n\n IInput.call(this);\n\n this._tag = \"div\";\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n\n const context = this;\n\n this._inputElement[0] = element.append(\"input\").attr(\"type\", \"range\");\n this._inputElement[1] = element.append(\"input\").attr(\"type\", \"number\");\n\n this._inputElement.forEach(function (e, idx) {\n e.attr(\"name\", context.name());\n e.on(\"click\", function (w) {\n w.click(w);\n });\n e.on(\"blur\", function (w) {\n w.blur(w);\n });\n e.on(\"change\", function (w) {\n if (idx === 0) {\n context._inputElement[1].property(\"value\", d3Rgb(context._inputElement[0].property(\"value\")).toString());\n context.value(context._inputElement[0].property(\"value\"));\n } else {\n context._inputElement[0].property(\"value\", context._inputElement[1].property(\"value\"));\n context.value(d3Rgb(context._inputElement[1].property(\"value\")).toString());\n }\n w.change(w, true);\n });\n });\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n\n this._inputElement[0].attr(\"type\", \"range\");\n this._inputElement[0].property(\"value\", this.value());\n this._inputElement[0].attr(\"min\", this.low());\n this._inputElement[0].attr(\"max\", this.high());\n this._inputElement[0].attr(\"step\", this.step());\n this._inputElement[1].attr(\"type\", \"number\");\n this._inputElement[1].property(\"value\", this.value());\n this._inputElement[1].attr(\"min\", this.low());\n this._inputElement[1].attr(\"max\", this.high());\n this._inputElement[1].attr(\"step\", this.step());\n }\n\n insertSelectOptions(optionsArr) {\n let optionHTML = \"\";\n if (optionsArr.length > 0) {\n optionsArr.forEach(function (opt) {\n const val = (opt instanceof Array ? opt[0] : opt);\n const text = (opt instanceof Array ? (opt[1] ? opt[1] : opt[0]) : opt);\n optionHTML += \"<option value='\" + val + \"'>\" + text + \"</option>\";\n });\n } else {\n optionHTML += \"<option>selectOptions not set</option>\";\n }\n this._inputElement[0].html(optionHTML);\n }\n}\nRange.prototype._class += \" form_Range\";\nRange.prototype.implements(IInput.prototype);\n\nexport interface Range {\n // IInput ---\n name(): string;\n name(_: string): this;\n name_exists(): boolean;\n label(): string;\n label(_: string): this;\n label_exists(): boolean;\n value(): any;\n value(_: any): this;\n value_exists(): boolean;\n validate(): string;\n validate(_: string): this;\n validate_exists(): boolean;\n\n // Properties ---\n type(): string;\n type(_: string): this;\n type_exists(): boolean;\n selectOptions(): any[];\n selectOptions(_: any[]): this;\n selectOptions_exists(): boolean;\n low(): number;\n low(_: number): this;\n low_exists(): boolean;\n high(): number;\n high(_: number): this;\n high_exists(): boolean;\n step(): number;\n step(_: number): this;\n step_exists(): boolean;\n}\n\nRange.prototype.publish(\"type\", \"text\", \"set\", \"Input type\", [\"html-color\", \"number\", \"checkbox\", \"button\", \"select\", \"textarea\", \"date\", \"text\", \"range\", \"search\", \"email\", \"time\", \"datetime\"]);\nRange.prototype.publish(\"selectOptions\", [], \"array\", \"Array of options used to fill a dropdown list\");\nRange.prototype.publish(\"low\", null, \"number\", \"Minimum value for Range input\");\nRange.prototype.publish(\"high\", null, \"number\", \"Maximum value for Range input\");\nRange.prototype.publish(\"step\", null, \"number\", \"Step value for Range input\");\n","import { IInput } from \"@hpcc-js/api\";\nimport { HTMLWidget } from \"@hpcc-js/common\";\n\nimport \"../src/Input.css\";\n\nexport class Select extends HTMLWidget {\n _inputElement = [];\n\n constructor() {\n super();\n\n IInput.call(this);\n\n this._tag = \"div\";\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n\n const context = this;\n\n this._inputElement[0] = element.append(\"select\")\n .attr(\"name\", this.name())\n .on(\"click\", function (w) {\n w.click(w);\n })\n .on(\"blur\", function (w) {\n w.blur(w);\n })\n .on(\"change\", function (w) {\n context.value([context._inputElement[0].property(\"value\")]);\n w.change(w, true);\n })\n ;\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n\n this.insertSelectOptions(this.selectOptions());\n this._inputElement[0]\n .property(\"value\", this.value())\n .style(\"max-width\", this.maxWidth_exists() ? this.maxWidth() + \"px\" : null)\n ;\n }\n\n insertSelectOptions(optionsArr) {\n let optionHTML = \"\";\n if (optionsArr.length > 0) {\n optionsArr.forEach(function (opt) {\n const val = (opt instanceof Array ? opt[0] : opt);\n const text = (opt instanceof Array ? (opt[1] ? opt[1] : opt[0]) : opt);\n optionHTML += \"<option value='\" + val + \"'>\" + text + \"</option>\";\n });\n } else {\n optionHTML += \"<option>selectOptions not set</option>\";\n }\n this._inputElement[0].html(optionHTML);\n }\n}\nSelect.prototype._class += \" form_Select\";\nSelect.prototype.implements(IInput.prototype);\n\nexport interface Select {\n // IInput ---\n name(): string;\n name(_: string): this;\n name_exists(): boolean;\n label(): string;\n label(_: string): this;\n label_exists(): boolean;\n value(): any;\n value(_: any): this;\n value_exists(): boolean;\n validate(): string;\n validate(_: string): this;\n validate_exists(): boolean;\n\n // Properties ---\n selectOptions(): any[];\n selectOptions(_: any[]): this;\n selectOptions_exists(): boolean;\n maxWidth(): number;\n maxWidth(_: number): this;\n maxWidth_exists(): boolean;\n}\n\nSelect.prototype.publish(\"selectOptions\", [], \"array\", \"Array of options used to fill a dropdown list\");\nSelect.prototype.publish(\"maxWidth\", 120, \"number\", \"Width\", null, { optional: true });\n","import { IInput } from \"@hpcc-js/api\";\nimport { d3Event, select as d3Select, SVGWidget } from \"@hpcc-js/common\";\nimport { drag as d3Drag } from \"d3-drag\";\nimport { format as d3Format } from \"d3-format\";\nimport { scaleLinear as d3ScaleLinear } from \"d3-scale\";\nimport { timeFormat as d3TimeFormat, timeParse as d3TimeParse } from \"d3-time-format\";\n\nimport \"../src/Slider.css\";\n\nexport class Slider extends SVGWidget {\n xScale;\n\n moveMode: \"both\" | \"left\" | \"right\";\n moveStartPos: number;\n\n prevValue;\n\n slider;\n\n handleLeft;\n handleLeftPos: number = 0;\n handleLeftStartPos: number;\n\n handleRight;\n handleRightPos: number = 0;\n handleRightStartPos: number;\n\n constructor() {\n super();\n IInput.call(this);\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n this.resize({ width: this.width(), height: 50 });\n\n this.xScale = d3ScaleLinear()\n .clamp(true);\n\n this.slider = element.append(\"g\")\n .attr(\"class\", \"slider\")\n ;\n if (this.low() === null && this.high() === null) {\n if (this.lowDatetime() !== null && this.highDatetime() !== null) {\n const time_parser = d3TimeParse(this.timePattern() ? this.timePattern() : \"%Q\");\n this.low(time_parser(this.lowDatetime()).getTime());\n this.high(time_parser(this.highDatetime()).getTime());\n }\n }\n this.slider.append(\"line\")\n .attr(\"class\", \"track\")\n .select(function () { return this.parentNode.appendChild(this.cloneNode(true)); })\n .attr(\"class\", \"track-inset\")\n .select(function () { return this.parentNode.appendChild(this.cloneNode(true)); })\n .attr(\"class\", \"track-overlay\")\n .call(d3Drag()\n .on(\"start\", () => {\n const event = d3Event();\n this.moveStartPos = event.x;\n this.handleLeftStartPos = this.handleLeftPos;\n this.handleRightStartPos = this.handleRightPos;\n if (this.allowRange() && this.handleLeftPos <= event.x && event.x <= this.handleRightPos) {\n this.moveMode = \"both\";\n } else if (Math.abs(event.x - this.handleLeftPos) < Math.abs(event.x - this.handleRightPos)) {\n this.moveMode = \"left\";\n } else {\n this.moveMode = \"right\";\n }\n this.moveHandleTo(event.x);\n })\n .on(\"drag\", () => {\n this.moveHandleTo(d3Event().x);\n })\n .on(\"end\", () => {\n this.moveHandleTo(d3Event().x);\n this.data([[this.xScale.invert(this.handleLeftPos), this.xScale.invert(this.handleRightPos)]]);\n this.checkChangedValue();\n }));\n\n this.slider.insert(\"g\", \".track-overlay\")\n .attr(\"class\", \"ticks\")\n .attr(\"transform\", `translate(0, ${this.fontSize() + (this.tickHeight() / 2)})`)\n ;\n\n this.handleRight = this.slider.insert(\"path\", \".track-overlay\")\n .attr(\"class\", \"handle\")\n ;\n\n this.handleLeft = this.slider.insert(\"path\", \".track-overlay\")\n .attr(\"class\", \"handle\")\n ;\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n const context = this;\n this.xScale\n .domain([this.low(), this.high()])\n .range([0, this.width() - this.padding() * 2])\n ;\n\n this.slider\n .attr(\"transform\", \"translate(\" + (-this.width() / 2 + this.padding()) + \",\" + 0 + \")\");\n\n this.slider.selectAll(\"line.track,line.track-inset,line.track-overlay\")\n .attr(\"x1\", this.xScale.range()[0])\n .attr(\"x2\", this.xScale.range()[1])\n ;\n\n const x_distance = (this.width() - (this.padding() * 2)) / (this.tickCount() - 1);\n\n const tick_text_arr = [];\n if (this.tickDateFormat() !== null && this.timePattern() !== null) {\n const Q_parser = d3TimeParse(\"%Q\");\n const time_formatter = d3TimeFormat(this.tickDateFormat());\n const time_segment = (this.high() - this.low()) / (this.tickCount() - 1);\n for (let i = 0; i < this.tickCount(); i++) {\n const date_to_parse = \"\" + (this.low() + (time_segment * i));\n const parsed_date = Q_parser(date_to_parse);\n tick_text_arr.push(time_formatter(parsed_date));\n }\n } else {\n const value_formatter = d3Format(this.tickValueFormat());\n const value_segment = (this.high() - this.low()) / (this.tickCount() - 1);\n for (let i = 0; i < this.tickCount(); i++) {\n const tick_value = this.low() + (value_segment * i);\n tick_text_arr.push(value_formatter(tick_value));\n }\n }\n const tickText = this.slider.selectAll(\"g.tick\").data(tick_text_arr);\n const tickTextEnter = tickText.enter().append(\"g\").attr(\"class\", \"tick\");\n\n tickTextEnter.append(\"text\").attr(\"class\", \"tick-text\");\n tickTextEnter.append(\"line\").attr(\"class\", \"tick-line\");\n tickTextEnter\n .merge(tickText)\n .each(function (d, i) {\n const x = x_distance * i;\n\n d3Select(this).select(\"text.tick-text\")\n .style(\"font-size\", context.fontSize())\n .attr(\"x\", function () {\n if (i === 0) return x - 2;\n return i === context.tickCount() - 1 ? x + 2 : x;\n })\n .attr(\"y\", context.tickHeight() + (context.tickOffset() / 2) + context.fontSize())\n .attr(\"text-basline\", \"text-before-edge\")\n .attr(\"text-anchor\", function () {\n if (i === 0) return \"start\";\n return i === context.tickCount() - 1 ? \"end\" : \"middle\";\n })\n .text(() => d)\n ;\n\n d3Select(this).select(\"line.tick-line\")\n .attr(\"x1\", x)\n .attr(\"x2\", x)\n .attr(\"y1\", context.tickOffset() - 1)\n .attr(\"y2\", context.tickOffset() + context.tickHeight())\n .style(\"stroke\", \"#000\")\n .style(\"stroke-width\", 1)\n ;\n });\n this.slider.node().appendChild(this.handleRight.node());\n this.slider.node().appendChild(this.handleLeft.node());\n this.handleLeftPos = this.lowPos();\n this.handleRightPos = this.highPos();\n this.updateHandles();\n this.checkChangedValue();\n }\n\n checkChangedValue() {\n if (this.prevValue !== this.value() && typeof this.prevValue !== \"undefined\") {\n this.change(this);\n }\n this.prevValue = this.value();\n }\n\n updateHandles() {\n this.handleLeft\n .attr(\"transform\", `translate(${this.handleLeftPos}, -28)`)\n .attr(\"d\", (d) => this.handlePath(\"l\"))\n ;\n this.handleRight\n .attr(\"transform\", `translate(${this.handleRightPos}, -28)`)\n .attr(\"d\", (d) => this.handlePath(\"r\"))\n ;\n }\n\n lowPos(): number {\n let data = [[this.low(), this.high()]];\n if (this.data().length > 0 && typeof this.data()[0][0] === \"number\" && typeof this.data()[0][1] === \"number\") {\n data = this.data();\n }\n return this.xScale(data[0][0]);\n }\n\n highPos(): number {\n let data = [[this.low(), this.high()]];\n if (this.data().length > 0 && typeof this.data()[0][0] === \"number\" && typeof this.data()[0][1] === \"number\") {\n data = this.data();\n }\n return this.xScale(data[0][this.allowRange() ? 1 : 0]);\n }\n\n moveHandleTo(pos) {\n if (this.allowRange()) {\n switch (this.moveMode) {\n case \"both\":\n this.handleLeftPos = this.handleLeftStartPos + pos - this.moveStartPos;\n this.handleRightPos = this.handleRightStartPos + pos - this.moveStartPos;\n break;\n case \"left\":\n this.handleLeftPos = pos;\n if (this.handleLeftPos > this.handleRightPos) {\n this.handleRightPos = this.handleLeftPos;\n }\n break;\n case \"right\":\n this.handleRightPos = pos;\n if (this.handleRightPos < this.handleLeftPos) {\n this.handleLeftPos = this.handleRightPos;\n }\n break;\n }\n } else {\n this.handleLeftPos = this.handleRightPos = pos;\n }\n\n this.handleLeftPos = this.constrain(this.handleLeftPos);\n this.handleRightPos = this.constrain(this.handleRightPos);\n this.value(this.allowRange() ? [this.xScale.invert(this.handleLeftPos), this.xScale.invert(this.handleRightPos)] : this.xScale.invert(this.handleLeftPos));\n this.updateHandles();\n }\n\n constrain(pos: number): number {\n const range = this.xScale.range();\n if (pos < range[0]) pos = range[0];\n if (pos > range[1]) pos = range[1];\n return this.nearestStep(pos);\n }\n\n nearestStep(pos) {\n const value = this.xScale.invert(pos);\n return this.xScale(this.low() + Math.round((value - this.low()) / this.step()) * this.step());\n }\n\n handlePath = function (d) {\n const e = +(d === \"r\");\n const x = e ? 1 : -1;\n const xOffset = this.allowRange() ? 0.5 : 0.0;\n const y = 18;\n let retVal = \"M\" + (xOffset * x) + \",\" + y +\n \"A6,6 0 0 \" + e + \" \" + (6.5 * x) + \",\" + (y + 6) +\n \"V\" + (2 * y - 6) +\n \"A6,6 0 0 \" + e + \" \" + (xOffset * x) + \",\" + (2 * y)\n ;\n if (this.allowRange()) {\n retVal += \"Z\" +\n \"M\" + (2.5 * x) + \",\" + (y + 8) +\n \"V\" + (2 * y - 8) +\n \"M\" + (4.5 * x) + \",\" + (y + 8) +\n \"V\" + (2 * y - 8)\n ;\n } else {\n retVal += \"M\" + (1 * x) + \",\" + (y + 8) +\n \"V\" + (2 * y - 8)\n ;\n }\n return retVal;\n };\n\n}\nSlider.prototype._class += \" form_Slider\";\nSlider.prototype.implements(IInput.prototype);\n\nexport interface Slider {\n // IInput ---\n name(): string;\n name(_: string): this;\n change(_: Slider): void;\n\n // Properties ---\n padding(): number;\n padding(_: number): this;\n fontSize(): number;\n fontSize(_: number): this;\n fontFamily(): string;\n fontFamily(_: string): this;\n fontColor(): string;\n fontColor(_: string): this;\n allowRange(): boolean;\n allowRange(_: boolean): this;\n low(): number;\n low(_: number): this;\n high(): number;\n high(_: number): this;\n step(): number;\n step(_: number): this;\n lowDatetime(): string;\n lowDatetime(_: string): this;\n highDatetime(): string;\n highDatetime(_: string): this;\n stepDatetime(): number;\n stepDatetime(_: number): this;\n selectionLabel(): string;\n selectionLabel(_: string): this;\n label(): string;\n label(_: string): this;\n value(): any;\n value(_: any): this;\n validate(): string;\n validate(_: string): this;\n tickCount(): number;\n tickCount(_: number): this;\n tickOffset(): number;\n tickOffset(_: number): this;\n tickHeight(): number;\n tickHeight(_: number): this;\n tickDateFormat(): string;\n tickDateFormat(_: string): this;\n tickValueFormat(): string;\n tickValueFormat(_: string): this;\n timePattern(): string;\n timePattern(_: string): this;\n\n padding_exists(): boolean;\n fontSize_exists(): boolean;\n fontFamily_exists(): boolean;\n fontColor_exists(): boolean;\n allowRange_exists(): boolean;\n low_exists(): boolean;\n step_exists(): boolean;\n high_exists(): boolean;\n selectionLabel_exists(): boolean;\n name_exists(): boolean;\n label_exists(): boolean;\n value_exists(): boolean;\n validate_exists(): boolean;\n}\n\nSlider.prototype.publish(\"padding\", 16, \"number\", \"Outer Padding\", null, { tags: [\"Basic\"] });\nSlider.prototype.publish(\"fontSize\", 12, \"number\", \"Font Size\", null, { tags: [\"Basic\"] });\nSlider.prototype.publish(\"fontFamily\", null, \"string\", \"Font Name\", null, { tags: [\"Basic\"] });\nSlider.prototype.publish(\"fontColor\", null, \"html-color\", \"Font Color\", null, { tags: [\"Basic\"] });\n\nSlider.prototype.publish(\"allowRange\", false, \"boolean\", \"Allow Range Selection\", null, { tags: [\"Intermediate\"] });\nSlider.prototype.publish(\"low\", null, \"number\", \"Low\", null, { tags: [\"Intermediate\"] });\nSlider.prototype.publish(\"high\", null, \"number\", \"High\", null, { tags: [\"Intermediate\"] });\nSlider.prototype.publish(\"step\", 10, \"number\", \"Step\", null, { tags: [\"Intermediate\"] });\nSlider.prototype.publish(\"lowDatetime\", null, \"string\", \"Low\", null, { tags: [\"Intermediate\"] });\nSlider.prototype.publish(\"highDatetime\", null, \"string\", \"High\", null, { tags: [\"Intermediate\"] });\nSlider.prototype.publish(\"selectionLabel\", \"\", \"string\", \"Selection Label\", null, { tags: [\"Intermediate\"] });\n\nSlider.prototype.publish(\"timePattern\", \"%Y-%m-%d\", \"string\");\n\nSlider.prototype.publish(\"tickCount\", 10, \"number\");\nSlider.prototype.publish(\"tickOffset\", 5, \"number\");\nSlider.prototype.publish(\"tickHeight\", 8, \"number\");\nSlider.prototype.publish(\"tickDateFormat\", null, \"string\");\nSlider.prototype.publish(\"tickValueFormat\", \",.0f\", \"string\");\n\nconst name = Slider.prototype.name;\nSlider.prototype.name = function (_?: any): any {\n const retVal = name.apply(this, arguments);\n if (arguments.length) {\n const val = _ instanceof Array ? _ : [_];\n SVGWidget.prototype.columns.call(this, val);\n }\n return retVal;\n};\n\nconst value = Slider.prototype.value;\nSlider.prototype.value = function (_?: any): any {\n const retVal = value.apply(this, arguments);\n if (!arguments.length) {\n if (!this.allowRange()) {\n return SVGWidget.prototype.data.call(this)[0][0];\n }\n return SVGWidget.prototype.data.call(this)[0];\n } else {\n SVGWidget.prototype.data.call(this, [this.allowRange() ? _ : [_, _]]);\n }\n return retVal;\n};\n","import { Input } from \"./Input.ts\";\n\nexport class TextArea extends Input {\n constructor() {\n super();\n\n this._tag = \"div\";\n this.type(\"textarea\");\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n }\n\n calcHeight() {\n return Math.max(this.minHeight_exists() ? this.minHeight() : 0, this.height());\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n this._inputElement[0]\n .attr(\"rows\", this.rows())\n .attr(\"cols\", this.cols())\n .attr(\"wrap\", this.wrap())\n .attr(\"spellcheck\", this.spellcheck())\n .style(\"height\", this.calcHeight() + \"px\")\n ;\n }\n\n}\nTextArea.prototype._class += \" form_TextArea\";\n\nexport interface TextArea {\n rows(): number;\n rows(_: number): this;\n rows_exists(): boolean;\n cols(): number;\n cols(_: number): this;\n cols_exists(): boolean;\n wrap(): string;\n wrap(_: string): this;\n wrap_exists(): boolean;\n minHeight(): number;\n minHeight(_: number): this;\n minHeight_exists(): boolean;\n spellcheck(): boolean;\n spellcheck(_: boolean): this;\n spellcheck_exists(): boolean;\n}\n\nTextArea.prototype.publish(\"rows\", null, \"number\", \"Rows\", null, { optional: true });\nTextArea.prototype.publish(\"cols\", null, \"number\", \"Columns\", null, { optional: true });\nTextArea.prototype.publish(\"wrap\", \"off\", \"set\", \"Wrap\", [\"off\", \"on\"]);\nTextArea.prototype.publish(\"minHeight\", null, \"number\", \"Minimum Height\", null, { optional: true });\nTextArea.prototype.publish(\"spellcheck\", null, \"boolean\", \"Input spell checking\", { optional: true });\n"],"names":["PKG_NAME","PKG_VERSION","BUILD_VERSION","_Button","HTMLWidget","_inputElement","constructor","super","IInput","call","this","_tag","enter","domNode","element","context","append","attr","name","on","w","click","blur","value","property","change","update","text","__name","Button","prototype","_class","implements","_CheckBox","checkboxContainer","selectOptions","length","push","forEach","val","idx","node","insertAdjacentHTML","e","vals","d","indexOf","insertSelectOptions","optionsArr","optionHTML","opt","Array","html","CheckBox","publish","_ColorInput","classed","d3Rgb","toString","bbox","getBoundingClientRect","style","height","ColorInput","_Form","tbody","tfoot","btntd","_controls","_maxCols","data","_","arguments","retVal","inputsForEach","input","render","callback","scope","inputs","inp","WidgetArray","content","inp2","inputsMap","calcMaxColumns","inputWidget","inputWidgetArray","values","dataArr","type","omitBlank","value_exists","v","submit","isValid","validate","checkValidation","allowEmptyRequest","some","wa","hasValue","clear","classID","allowRange","low","ret","msgArr","label","alert","join","d3Event","preventDefault","_placeholderElement","table","default","rightJust","leftJust","target","rows","selectAll","each","i","element2","d3Select","inputWidget2","SVGWidget","getBBox","resize","setTimeout","disable","w2","merge","select","setFocus","exit","remove","showSubmit","row","col","sel","Form","_Input","_labelElement","checked","id","inlineLabel_exists","inlineLabel","keyup","focus","dblclick","complete","Input","optional","_FieldForm","fields","apply","inpMap","map","f","__lparam","columns","key","FieldForm","_InputRange","_rangeData","InputRange","override","_OnOff","_input","inner","containerRadius","offText","onText","marginLeft","marginBottom","minWidth","_switch_size","minHeight","gutter","switchRadius","offFontColor","offColor","onFontColor","onColor","OnOff","_Radio","radioContainer","Radio","_Range","high","step","Range","_Select","maxWidth_exists","maxWidth","Select","_Slider","xScale","moveMode","moveStartPos","prevValue","slider","handleLeft","handleLeftPos","handleLeftStartPos","handleRight","handleRightPos","handleRightStartPos","width","d3ScaleLinear","clamp","lowDatetime","highDatetime","time_parser","d3TimeParse","timePattern","getTime","parentNode","appendChild","cloneNode","d3Drag","event","x","Math","abs","moveHandleTo","invert","checkChangedValue","insert","fontSize","tickHeight","domain","range","padding","x_distance","tickCount","tick_text_arr","tickDateFormat","Q_parser","time_formatter","d3TimeFormat","time_segment","parsed_date","value_formatter","d3Format","tickValueFormat","value_segment","tick_value","tickText","tickTextEnter","tickOffset","lowPos","highPos","updateHandles","handlePath","pos","constrain","nearestStep","round","xOffset","Slider","tags","_TextArea","calcHeight","max","minHeight_exists","cols","wrap","spellcheck","TextArea"],"mappings":"sSAAO,MAAMA,EAAW,gBACXC,EAAc,SACdC,EAAgB,SCGhBC,EAAN,MAAMA,gBAAeC,EACxBC,cAAgB,GAEhB,WAAAC,GACIC,QACAC,EAAOC,KAAKC,MAEZA,KAAKC,KAAO,KAChB,CAEA,KAAAC,CAAMC,EAASC,GACXP,MAAMK,MAAMC,EAASC,GACrB,MAAMC,EAAUL,KAChBA,KAAKL,cAAc,GAAKS,EAAQE,OAAO,UAClCC,KAAK,OAAQP,KAAKQ,QAClBC,GAAG,QAAS,SAAUC,GACnBA,EAAEC,MAAMD,EACZ,GACCD,GAAG,OAAQ,SAAUC,GAClBA,EAAEE,KAAKF,EACX,GACCD,GAAG,SAAU,SAAUC,GACpBL,EAAQQ,MAAM,CAACR,EAAQV,cAAc,GAAGmB,SAAS,WACjDJ,EAAEK,OAAOL,GAAG,EAChB,EAER,CAEA,MAAAM,CAAOb,EAASC,GACZP,MAAMmB,OAAOb,EAASC,GAEtBJ,KAAKL,cAAc,GAAGsB,KAAKjB,KAAKa,QACpC,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
|
+
{"version":3,"file":"index.js","sources":["../src/__package__.ts","../src/Button.ts","../src/CheckBox.ts","../src/ColorInput.ts","../src/Form.ts","../src/Input.ts","../src/FieldForm.ts","../src/InputRange.ts","../src/OnOff.ts","../src/Radio.ts","../src/Range.ts","../src/Select.ts","../src/Slider.ts","../src/TextArea.ts"],"sourcesContent":["export const PKG_NAME = \"__PACKAGE_NAME__\";\nexport const PKG_VERSION = \"__PACKAGE_VERSION__\";\nexport const BUILD_VERSION = \"__BUILD_VERSION__\";\n","import { IInput } from \"@hpcc-js/api\";\nimport { HTMLWidget } from \"@hpcc-js/common\";\n\nimport \"../src/Input.css\";\n\nexport class Button extends HTMLWidget {\n _inputElement = [];\n\n constructor() {\n super();\n IInput.call(this);\n\n this._tag = \"div\";\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n const context = this;\n this._inputElement[0] = element.append(\"button\")\n .attr(\"name\", this.name())\n .on(\"click\", function (w) {\n w.click(w);\n })\n .on(\"blur\", function (w) {\n w.blur(w);\n })\n .on(\"change\", function (w) {\n context.value([context._inputElement[0].property(\"value\")]);\n w.change(w, true);\n })\n ;\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n\n this._inputElement[0].text(this.value());\n }\n}\nButton.prototype._class += \" form_Button\";\nButton.prototype.implements(IInput.prototype);\n\nexport interface Button {\n name(): string;\n name(_: string): Button;\n label(): string;\n label(_: string): Button;\n value(): any;\n value(_: any): Button;\n validate(): string;\n validate(_: string): Button;\n}\n","import { IInput } from \"@hpcc-js/api\";\nimport { HTMLWidget } from \"@hpcc-js/common\";\n\nimport \"../src/Input.css\";\n\nexport class CheckBox extends HTMLWidget {\n _inputElement = [];\n\n constructor() {\n super();\n IInput.call(this);\n\n this._tag = \"div\";\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n const context = this;\n\n const checkboxContainer = element.append(\"ul\");\n if (!this.selectOptions().length) {\n this.selectOptions().push(\"\"); // create an empty radio if we using .value and not selectOptions array\n }\n this.selectOptions().forEach(function (val, idx) {\n context._inputElement[idx] = checkboxContainer.append(\"li\").append(\"input\").attr(\"type\", \"checkbox\");\n context._inputElement[idx].node().insertAdjacentHTML(\"afterend\", \"<text>\" + val + \"</text>\");\n });\n\n this._inputElement.forEach(function (e, idx) {\n e.attr(\"name\", context.name());\n e.on(\"click\", function (w) {\n w.click(w);\n });\n e.on(\"blur\", function (w) {\n w.blur(w);\n });\n e.on(\"change\", function (w) {\n const vals = [];\n context._inputElement.forEach(function (d) {\n if (d.property(\"checked\")) {\n vals.push(d.property(\"value\"));\n }\n });\n context.value(vals);\n w.change(w, true);\n });\n });\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n\n const context = this;\n\n this._inputElement.forEach(function (e, idx) {\n e.property(\"value\", context.selectOptions()[idx]);\n if (context.value().indexOf(context.selectOptions()[idx]) !== -1 && context.value() !== \"false\") {\n e.property(\"checked\", true);\n } else {\n e.property(\"checked\", false);\n }\n });\n }\n\n insertSelectOptions(optionsArr) {\n let optionHTML = \"\";\n if (optionsArr.length > 0) {\n optionsArr.forEach(function (opt) {\n const val = (opt instanceof Array ? opt[0] : opt);\n const text = (opt instanceof Array ? (opt[1] ? opt[1] : opt[0]) : opt);\n optionHTML += \"<option value='\" + val + \"'>\" + text + \"</option>\";\n });\n } else {\n optionHTML += \"<option>selectOptions not set</option>\";\n }\n this._inputElement[0].html(optionHTML);\n }\n}\nCheckBox.prototype._class += \" form_CheckBox\";\nCheckBox.prototype.implements(IInput.prototype);\n\nexport interface CheckBox {\n // IInput ---\n name(): string;\n name(_: string): this;\n name_exists(): boolean;\n label(): string;\n label(_: string): this;\n label_exists(): boolean;\n value(): any;\n value(_: any): this;\n value_exists(): boolean;\n validate(): string;\n validate(_: string): this;\n validate_exists(): boolean;\n\n // Properties ---\n selectOptions(): any[];\n selectOptions(_: any[]): this;\n selectOptions_exists(): boolean;\n}\n\nCheckBox.prototype.publish(\"selectOptions\", [], \"array\", \"Array of options used to fill a dropdown list\");\n","import { IInput } from \"@hpcc-js/api\";\nimport { HTMLWidget } from \"@hpcc-js/common\";\nimport { rgb as d3Rgb } from \"d3-color\";\n\nimport \"../src/Input.css\";\n\nexport class ColorInput extends HTMLWidget {\n _inputElement = [];\n\n constructor() {\n super();\n IInput.call(this);\n\n this._tag = \"div\";\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n\n const context = this;\n\n this._inputElement[0] = element.append(\"input\").attr(\"type\", \"text\");\n this._inputElement[0].classed(\"color-text\", true);\n this._inputElement[1] = element.append(\"input\").attr(\"type\", \"color\");\n\n this._inputElement.forEach(function (e, idx) {\n e.on(\"click\", function (w) {\n w.click(w);\n });\n e.on(\"blur\", function (w) {\n w.blur(w);\n });\n e.on(\"change\", function (w) {\n if (idx === 0) {\n context._inputElement[1].property(\"value\", d3Rgb(context._inputElement[0].property(\"value\")).toString());\n context.value(context._inputElement[0].property(\"value\"));\n } else {\n context._inputElement[0].property(\"value\", context._inputElement[1].property(\"value\"));\n context.value(d3Rgb(context._inputElement[1].property(\"value\")).toString());\n }\n w.change(w, true);\n });\n });\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n\n const context = this;\n this._inputElement.forEach(function (e) {\n e.attr(\"name\", context.name());\n });\n\n this._inputElement[0].attr(\"type\", \"text\");\n this._inputElement[1].attr(\"type\", \"color\");\n this._inputElement[0].property(\"value\", this.value());\n this._inputElement[1].property(\"value\", d3Rgb(this.value()).toString());\n\n const bbox = this._inputElement[0].node().getBoundingClientRect();\n this._inputElement[1].style(\"height\", (bbox.height - 2) + \"px\");\n\n }\n}\nColorInput.prototype._class += \" form_ColorInput\";\nColorInput.prototype.implements(IInput.prototype);\n\nexport interface ColorInput {\n // IInput ---\n name(): string;\n name(_: string): this;\n name_exists(): boolean;\n label(): string;\n label(_: string): this;\n label_exists(): boolean;\n value(): any;\n value(_: any): this;\n value_exists(): boolean;\n validate(): string;\n validate(_: string): this;\n validate_exists(): boolean;\n}\n","import { d3Event, HTMLWidget, select as d3Select, SVGWidget, Widget, WidgetArray } from \"@hpcc-js/common\";\nimport { Button } from \"./Button.ts\";\n\nimport \"../src/Form.css\";\n\nexport class Form extends HTMLWidget {\n tbody;\n tfoot;\n btntd;\n _controls;\n _maxCols;\n\n constructor() {\n super();\n\n this._tag = \"form\";\n }\n\n data(): any;\n data(_: any): this;\n data(_?: any): any | this {\n if (!arguments.length) {\n const retVal = [];\n this.inputsForEach(function (input) {\n retVal.push(input.value());\n });\n return retVal;\n } else {\n this.inputsForEach(function (input, idx) {\n if (_ && _.length > idx) {\n input.value(_[idx]).render();\n }\n });\n }\n return this;\n }\n\n inputsForEach(callback, scope?) {\n let idx = 0;\n this.inputs().forEach(function (inp) {\n const inpArray = inp instanceof WidgetArray ? inp.content() : [inp];\n inpArray.forEach(function (inp2) {\n if (scope) {\n callback.call(scope, inp2, idx++);\n } else {\n callback(inp2, idx++);\n }\n });\n });\n }\n\n inputsMap(): { [name: string]: Widget } {\n const retVal: { [name: string]: Widget } = {};\n this.inputs().forEach(function (inp) {\n retVal[inp.name()] = inp;\n });\n return retVal;\n }\n\n calcMaxColumns() {\n let retVal = 0;\n this.inputs().forEach(function (inputWidget) {\n const inputWidgetArray = inputWidget instanceof WidgetArray ? inputWidget.content() : [inputWidget];\n if (inputWidgetArray.length > retVal) {\n retVal = inputWidgetArray.length;\n }\n });\n return retVal;\n }\n\n values(): any;\n values(_: any): this;\n values(_?: any): any | this {\n if (!arguments.length) {\n const dataArr = {};\n this.inputsForEach(function (inp) {\n const type = inp.type ? inp.type() : \"text\";\n const value = inp.value();\n if (value || !this.omitBlank()) {\n switch (type) {\n case \"checkbox\":\n dataArr[inp.name()] = inp.value_exists() ? !!inp.value() : undefined;\n break;\n case \"number\":\n const v = inp.value();\n dataArr[inp.name()] = v === \"\" ? undefined : +v;\n break;\n case \"text\":\n default:\n dataArr[inp.name()] = inp.value_exists() ? inp.value() : undefined;\n break;\n }\n }\n }, this);\n return dataArr;\n } else {\n this.inputsForEach(function (inp) {\n if (_[inp.name()]) {\n inp.value(_[inp.name()]);\n } else if (this.omitBlank()) {\n inp.value(\"\");\n }\n }, this);\n }\n return this;\n }\n\n submit() {\n let isValid = true;\n if (this.validate()) {\n isValid = this.checkValidation();\n }\n if (!this.allowEmptyRequest() && !this.inputs().some(function (w) {\n if (w._class.indexOf(\"WidgetArray\") !== -1) {\n return w.content().some(function (wa) {\n return wa.hasValue();\n });\n }\n return w.hasValue();\n })) {\n return;\n }\n this.click(isValid ? this.values() : null, null, isValid);\n }\n\n clear() {\n this.inputsForEach(function (inp) {\n switch (inp.classID()) {\n case \"form_Slider\":\n if (inp.allowRange()) {\n inp.value([inp.low(), inp.low()]).render();\n } else {\n inp.value(inp.low()).render();\n }\n break;\n case \"form_CheckBox\":\n inp.value(false).render();\n break;\n case \"form_Button\":\n /* skip */\n break;\n default:\n inp.value(undefined).render();\n break;\n }\n });\n }\n\n checkValidation() {\n let ret = true;\n const msgArr = [];\n this.inputsForEach(function (inp) {\n if (!inp.isValid()) {\n msgArr.push(\"'\" + inp.label() + \"'\" + \" value is invalid.\");\n }\n });\n if (msgArr.length > 0) {\n alert(msgArr.join(\"\\n\"));\n ret = false;\n }\n return ret;\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n element.on(\"submit\", function () {\n d3Event().preventDefault();\n });\n\n this._placeholderElement.style(\"overflow\", \"auto\");\n const table = element\n .append(\"table\")\n ;\n this.tbody = table.append(\"tbody\");\n this.tfoot = table.append(\"tfoot\");\n this.btntd = this.tfoot.append(\"tr\").append(\"td\")\n .attr(\"colspan\", 2)\n ;\n\n const context = this;\n this._controls = [\n new Button()\n .classed({ default: true })\n .value(\"Submit\")\n .on(\"click\", function () {\n context.submit();\n }, true),\n new Button()\n .value(\"Clear\")\n .on(\"click\", function () {\n context.clear();\n }, true)\n ];\n const rightJust = context.btntd\n .append(\"div\")\n .style(\"float\", \"right\")\n ;\n this._controls.forEach(function (w) {\n const leftJust = rightJust\n .append(\"span\")\n .style(\"float\", \"left\")\n ;\n w.target(leftJust.node()).render();\n });\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n\n this._maxCols = this.calcMaxColumns();\n\n const context = this;\n const rows = this.tbody.selectAll(\"tr\").data(this.inputs());\n rows.enter().append(\"tr\")\n .each(function (inputWidget, i) {\n const element2 = d3Select(this);\n\n const inputWidgetArray = inputWidget instanceof WidgetArray ? inputWidget.content() : [inputWidget];\n inputWidgetArray.forEach(function (inputWidget2, idx) {\n element2.append(\"td\")\n .attr(\"class\", \"prompt\")\n ;\n const input = element2.append(\"td\")\n .attr(\"class\", \"input\")\n ;\n if (idx === inputWidgetArray.length - 1 && inputWidgetArray.length < context._maxCols) {\n input.attr(\"colspan\", (context._maxCols - inputWidgetArray.length + 1) * 2);\n }\n inputWidget2.target(input.node()).render();\n if (inputWidget2 instanceof SVGWidget) {\n const bbox = inputWidget2.element().node().getBBox();\n input.style(\"height\", bbox.height + \"px\");\n inputWidget2.resize().render();\n }\n\n if (inputWidget2._inputElement instanceof Array) {\n inputWidget2._inputElement.forEach(function (e) {\n e.on(\"keyup.form\", function (w) {\n setTimeout(function () {\n\n context._controls[0].disable(!context.allowEmptyRequest() && !context.inputs().some(function (w2) {\n if (w2._class.indexOf(\"WidgetArray\") !== -1) {\n return w2.content().some(function (wa) {\n return wa.hasValue();\n });\n }\n return w2.hasValue();\n }));\n }, 100);\n });\n });\n }\n });\n })\n .merge(rows)\n .each(function (inputWidget, i) {\n const element2 = d3Select(this);\n const inputWidgetArray = inputWidget instanceof WidgetArray ? inputWidget.content() : [inputWidget];\n inputWidgetArray.forEach(function (inputWidget2, idx) {\n element2.select(\"td.prompt\")\n .text(inputWidget2.label() + \":\")\n ;\n });\n })\n ;\n rows.each(function (inputWidget, i) {\n if (i === 0 && inputWidget.setFocus) {\n inputWidget.setFocus();\n }\n });\n rows.exit()\n .each(function (inputWidget, i) {\n const inputWidgetArray = inputWidget instanceof WidgetArray ? inputWidget.content() : [inputWidget];\n inputWidgetArray.forEach(function (inputWidget2, idx) {\n inputWidget2.target(null);\n });\n })\n .remove()\n ;\n\n this.tfoot\n .style(\"display\", this.showSubmit() ? \"table-footer-group\" : \"none\")\n ;\n this.btntd\n .attr(\"colspan\", this._maxCols * 2)\n ;\n\n // Disable Submit unless there is data\n if (!this.allowEmptyRequest()) {\n setTimeout(function () {\n context._controls[0].disable(!context.allowEmptyRequest() && !context.inputs().some(function (w) {\n if (w._class.indexOf(\"WidgetArray\") !== -1) {\n return w.content().some(function (wa) {\n return wa.hasValue();\n });\n }\n return w.hasValue();\n }));\n }, 100);\n }\n\n }\n\n exit(domNode, element) {\n this.inputsForEach(input => input.target(null));\n super.exit(domNode, element);\n }\n\n click(row, col, sel) {\n }\n}\nForm.prototype._class += \" form_Form\";\n\nexport interface Form {\n validate(): boolean;\n validate(_: boolean): this;\n validate_exists(): boolean;\n inputs(): any[];\n inputs(_: any[]): this;\n inputs_exists(): boolean;\n inputs_reset(): void;\n showSubmit(): boolean;\n showSubmit(_: boolean): this;\n showSubmit_exists(): boolean;\n omitBlank(): boolean;\n omitBlank(_: boolean): this;\n omitBlank_exists(): boolean;\n allowEmptyRequest(): boolean;\n allowEmptyRequest(_: boolean): this;\n allowEmptyRequest_exists(): boolean;\n}\n\nForm.prototype.publish(\"validate\", true, \"boolean\", \"Enable/Disable input validation\");\nForm.prototype.publish(\"inputs\", [], \"widgetArray\", \"Array of input widgets\", null, { render: false });\nForm.prototype.publish(\"showSubmit\", true, \"boolean\", \"Show Submit/Cancel Controls\");\nForm.prototype.publish(\"omitBlank\", false, \"boolean\", \"Drop Blank Fields From Submit\");\nForm.prototype.publish(\"allowEmptyRequest\", false, \"boolean\", \"Allow Blank Form to be Submitted\");\n","import { IInput } from \"@hpcc-js/api\";\nimport { Database, HTMLWidget } from \"@hpcc-js/common\";\n\nimport \"../src/Input.css\";\n\nexport class Input extends HTMLWidget {\n _inputElement = [];\n _labelElement = [];\n\n constructor() {\n super();\n IInput.call(this);\n\n this._tag = \"div\";\n }\n\n checked(_) {\n if (!arguments.length) return this._inputElement[0] ? this._inputElement[0].property(\"checked\") : false;\n if (this._inputElement[0]) {\n this._inputElement[0].property(\"checked\", _);\n }\n return this;\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n\n this._labelElement[0] = element.append(\"label\")\n .attr(\"for\", this.id() + \"_input\")\n .style(\"visibility\", this.inlineLabel_exists() ? \"visible\" : \"hidden\")\n ;\n\n const context = this;\n switch (this.type()) {\n case \"button\":\n this._inputElement[0] = element.append(\"button\")\n .attr(\"id\", this.id() + \"_input\")\n ;\n break;\n case \"textarea\":\n this._inputElement[0] = element.append(\"textarea\")\n .attr(\"id\", this.id() + \"_input\")\n ;\n break;\n default:\n this._inputElement[0] = element.append(\"input\")\n .attr(\"id\", this.id() + \"_input\")\n .attr(\"type\", this.type())\n ;\n break;\n }\n\n this._inputElement.forEach(function (e, idx) {\n e.attr(\"name\", context.name());\n e.on(\"click\", function (w: Input) {\n w.click(w);\n });\n e.on(\"blur\", function (w: Input) {\n w.blur(w);\n });\n e.on(\"change\", function (w: Input) {\n context.value([e.property(\"value\")]);\n w.change(w, true);\n });\n e.on(\"keyup\", function (w: Input) {\n context.value([e.property(\"value\")]);\n w.change(w, false);\n });\n });\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n\n this._labelElement[0]\n .style(\"visibility\", this.inlineLabel_exists() ? \"visible\" : \"hidden\")\n .text(this.inlineLabel())\n ;\n switch (this.type()) {\n case \"button\":\n this._inputElement[0].text(this.value());\n break;\n case \"textarea\":\n this._inputElement[0].property(\"value\", this.value());\n break;\n default:\n this._inputElement[0].attr(\"type\", this.type());\n this._inputElement[0].property(\"value\", this.value());\n break;\n }\n }\n\n // IInput Events ---\n blur(w: Input) {\n }\n keyup(w: Input) {\n }\n focus(w: Input) {\n }\n click(w: Input) {\n }\n dblclick(w: Input) {\n }\n change(w: Input, complete: boolean) {\n }\n}\nInput.prototype._class += \" form_Input\";\nInput.prototype.implements(IInput.prototype);\n\nexport interface Input {\n // IInput ---\n name(): string;\n name(_: string): this;\n name_exists(): boolean;\n label(): string;\n label(_: string): this;\n label_exists(): boolean;\n value(): any;\n value(_: any): this;\n value_exists(): boolean;\n validate(): string;\n validate(_: string): this;\n validate_exists(): boolean;\n\n // Properties ---\n type(): Database.FieldType | \"button\" | \"checkbox\" | \"text\" | \"textarea\" | \"search\" | \"email\" | \"datetime\";\n type(_: Database.FieldType | \"button\" | \"checkbox\" | \"text\" | \"textarea\" | \"search\" | \"email\" | \"datetime\"): this;\n type_exists(): boolean;\n type_default(): string;\n inlineLabel(): string;\n inlineLabel(_: string): this;\n inlineLabel_exists(): boolean;\n}\n\nInput.prototype.publish(\"type\", \"text\", \"set\", \"Input type\", [\"string\", \"number\", \"boolean\", \"date\", \"time\", \"hidden\", \"nested\", \"button\", \"checkbox\", \"text\", \"textarea\", \"search\", \"email\", \"datetime\"]);\nInput.prototype.publish(\"inlineLabel\", null, \"string\", \"Input Label\", null, { optional: true });\n","import { Database } from \"@hpcc-js/common\";\nimport { Form } from \"./Form.ts\";\nimport { Input } from \"./Input.ts\";\n\nimport \"../src/Form.css\";\n\nexport class FieldForm extends Form {\n\n constructor() {\n super();\n\n this._tag = \"form\";\n }\n\n fields(): Database.Field[];\n fields(_: Database.Field[]): this;\n fields(_?: Database.Field[]): Database.Field[] | this {\n const retVal = super.fields.apply(this, arguments);\n if (arguments.length) {\n const inpMap = this.inputsMap();\n this.inputs(_.map(f => inpMap[f.id()] || new Input()\n .name(f.id())\n .label(f.label())\n .type(f.type())\n ));\n }\n return retVal;\n }\n\n data(): any;\n data(_: any): this;\n data(_?: any): any | this {\n if (!arguments.length) return super.data();\n super.data(_[0]);\n if (_[0]) {\n // Update input \"name\" with the __lparam ids ---\n const inputs = this.inputs();\n const __lparam = _[0][this.columns().length];\n let i = 0;\n for (const key in __lparam) {\n inputs[i].name(key);\n ++i;\n }\n }\n return this;\n }\n\n}\nFieldForm.prototype._class += \" form_FieldForm\";\n","import { IInput } from \"@hpcc-js/api\";\nimport { HTMLWidget } from \"@hpcc-js/common\";\n\nimport \"../src/Input.css\";\n\nexport class InputRange extends HTMLWidget {\n _inputElement = [];\n _labelElement = [];\n _rangeData = [];\n\n constructor() {\n super();\n IInput.call(this);\n\n this._tag = \"div\";\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n\n this._labelElement[0] = element.append(\"label\")\n .attr(\"for\", this.id() + \"_input\")\n .style(\"visibility\", this.inlineLabel_exists() ? \"visible\" : \"hidden\")\n ;\n\n this._inputElement.push(element.append(\"input\")\n .attr(\"id\", this.id() + \"_input_min\")\n .attr(\"type\", this.type()));\n this._inputElement.push(element.append(\"input\")\n .attr(\"id\", this.id() + \"_input_max\")\n .attr(\"type\", this.type()));\n\n const context = this;\n this._inputElement.forEach(function (e, idx) {\n e.attr(\"name\", context.name());\n e.on(\"click\", function (w) {\n w.click(w);\n });\n e.on(\"blur\", function (w) {\n w.blur(w);\n });\n e.on(\"change\", function (w) {\n context._rangeData[idx] = e.property(\"value\");\n context.value(context._rangeData);\n w.change(w, true);\n });\n });\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n\n this._labelElement[0]\n .style(\"visibility\", this.inlineLabel_exists() ? \"visible\" : \"hidden\")\n .text(this.inlineLabel())\n ;\n\n this._rangeData = this.value();\n this._inputElement.forEach(function (e, idx) {\n e\n .attr(\"type\", this.type())\n .property(\"value\", this._rangeData.length > idx ? this._rangeData[idx] : \"\");\n }, this);\n }\n}\nInputRange.prototype._class += \" form_InputRange\";\nInputRange.prototype.implements(IInput.prototype);\n\nexport interface InputRange {\n // IInput ---\n name(): string;\n name(_: string): this;\n name_exists(): boolean;\n label(): string;\n label(_: string): this;\n label_exists(): boolean;\n value(): any[];\n value(_: any[]): this;\n value_exists(): boolean;\n validate(): string;\n validate(_: string): this;\n validate_exists(): boolean;\n\n // Properties ---\n type(): string;\n type(_: string): this;\n type_exists(): boolean;\n inlineLabel(): string;\n inlineLabel(_: string): this;\n inlineLabel_exists(): boolean;\n}\n\nInputRange.prototype.publish(\"type\", \"text\", \"set\", \"InputRange type\", [\"number\", \"date\", \"text\", \"time\", \"datetime\", \"hidden\"]);\nInputRange.prototype.publish(\"inlineLabel\", null, \"string\", \"InputRange Label\", null, { optional: true });\nInputRange.prototype.publish(\"value\", [\"\", \"\"], \"array\", \"Input Current Value\", null, { override: true });\n","import { IInput } from \"@hpcc-js/api\";\nimport { HTMLWidget } from \"@hpcc-js/common\";\n\nimport \"../src/OnOff.css\";\n\nexport class OnOff extends HTMLWidget {\n _inputElement = [];\n _input;\n\n constructor() {\n super();\n IInput.call(this);\n\n this._tag = \"div\";\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n element.classed(\"onoffswitch\", true);\n const context = this;\n this._input = element.append(\"input\")\n .attr(\"class\", \"onoffswitch-checkbox\")\n .attr(\"type\", \"checkbox\")\n .attr(\"id\", this.id() + \"_onOff\")\n .on(\"click\", function (w) {\n w.click(w);\n })\n .on(\"blur\", function (w) {\n w.blur(w);\n })\n .on(\"change\", function (w) {\n const vals = [];\n context._inputElement.forEach(function (d, idx) {\n if (d.property(\"checked\")) {\n vals.push(d.property(\"value\"));\n }\n });\n context.value(vals);\n w.change(w, true);\n })\n ;\n const label = element.append(\"label\")\n .attr(\"class\", \"onoffswitch-label\")\n .attr(\"for\", this.id() + \"_onOff\")\n ;\n const inner = label.append(\"div\")\n .attr(\"class\", \"onoffswitch-inner\")\n ;\n inner.append(\"div\")\n .attr(\"class\", \"onoffswitch-offText\")\n .style(\"padding-right\", (this.containerRadius() / 2) + \"px\")\n .text(this.offText())\n ;\n inner.append(\"div\")\n .attr(\"class\", \"onoffswitch-onText\")\n .style(\"padding-left\", (this.containerRadius() / 2) + \"px\")\n .style(\"width\", `calc(100% - ${(this.containerRadius() / 2)}px)`)\n .text(this.onText())\n ;\n label.append(\"div\")\n .attr(\"class\", \"onoffswitch-switch\")\n ;\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n this._input\n .attr(\"name\", this.name())\n ;\n element\n .style(\"margin-left\", this.marginLeft() + \"px\")\n .style(\"margin-bottom\", this.marginBottom() + \"px\")\n .style(\"width\", this.minWidth() + \"px\")\n ;\n\n const _switch_size = this.minHeight() - (this.gutter() * 4);\n\n element.select(\".onoffswitch-switch\")\n .style(\"height\", _switch_size + \"px\")\n .style(\"width\", _switch_size + \"px\")\n .style(\"top\", (this.gutter() * 2) + 1 + \"px\")\n .style(\"border-radius\", this.switchRadius() + \"px\")\n ;\n element.select(\".onoffswitch-inner\")\n .style(\"min-height\", this.minHeight() + \"px\")\n ;\n element.select(\".onoffswitch-label\")\n .style(\"border-radius\", this.containerRadius() + \"px\")\n ;\n element.select(\".onoffswitch-offText\")\n .style(\"color\", this.offFontColor())\n .style(\"background-color\", this.offColor())\n ;\n element.select(\".onoffswitch-onText\")\n .style(\"color\", this.onFontColor())\n .style(\"background-color\", this.onColor())\n ;\n }\n}\nOnOff.prototype._class += \" form_OnOff\";\nexport interface OnOff {\n // IInput ---\n name(): string;\n name(_: string): this;\n name_exists(): boolean;\n label(): string;\n label(_: string): this;\n label_exists(): boolean;\n value(): any;\n value(_: any): this;\n value_exists(): boolean;\n validate(): string;\n validate(_: string): this;\n validate_exists(): boolean;\n\n // Properties ---\n marginLeft(): number;\n marginLeft(_: number): this;\n marginBottom(): number;\n marginBottom(_: number): this;\n minWidth(): number;\n minWidth(_: number): this;\n minHeight(): number;\n minHeight(_: number): this;\n gutter(): number;\n gutter(_: number): this;\n offText(): string;\n offText(_: string): this;\n onText(): string;\n onText(_: string): this;\n switchRadius(): number;\n switchRadius(_: number): this;\n containerRadius(): number;\n containerRadius(_: number): this;\n offColor(): string;\n offColor(_: string): this;\n onColor(): string;\n onColor(_: string): this;\n offFontColor(): string;\n offFontColor(_: string): this;\n onFontColor(): string;\n onFontColor(_: string): this;\n\n}\nOnOff.prototype.implements(IInput.prototype);\n\nOnOff.prototype.publish(\"marginLeft\", 0, \"number\", \"Margin left of OnOff\");\nOnOff.prototype.publish(\"marginBottom\", 0, \"number\", \"Margin bottom of OnOff\");\nOnOff.prototype.publish(\"minWidth\", 100, \"number\", \"Minimum width of OnOff (pixels)\");\nOnOff.prototype.publish(\"minHeight\", 20, \"number\", \"Minimum height of OnOff (pixels)\");\nOnOff.prototype.publish(\"gutter\", 1, \"number\", \"Space between switch and border of OnOff (pixels)\");\nOnOff.prototype.publish(\"onText\", \"Save\", \"string\", \"Text to display when 'ON'\");\nOnOff.prototype.publish(\"offText\", \"Properties\", \"string\", \"Text to display when 'OFF'\");\nOnOff.prototype.publish(\"switchRadius\", 10, \"number\", \"Border radius of switch (pixels)\");\nOnOff.prototype.publish(\"containerRadius\", 10, \"number\", \"Border radius of OnOff (pixels)\");\nOnOff.prototype.publish(\"onColor\", \"#2ecc71\", \"html-color\", \"Background color when 'ON'\");\nOnOff.prototype.publish(\"offColor\", \"#ecf0f1\", \"html-color\", \"Background color when 'OFF'\");\nOnOff.prototype.publish(\"onFontColor\", \"#2c3e50\", \"html-color\", \"Font color when 'ON'\");\nOnOff.prototype.publish(\"offFontColor\", \"#7f8c8d\", \"html-color\", \"Font color when 'OFF'\");\n","import { IInput } from \"@hpcc-js/api\";\nimport { HTMLWidget } from \"@hpcc-js/common\";\n\nimport \"../src/Input.css\";\n\nexport class Radio extends HTMLWidget {\n _inputElement = [];\n constructor() {\n super();\n IInput.call(this);\n\n this._tag = \"div\";\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n\n const context = this;\n\n const radioContainer = element.append(\"ul\");\n if (!this.selectOptions().length) {\n this.selectOptions().push(\"\"); // create an empty radio if we using .value and not selectOptions array\n }\n this.selectOptions().forEach(function (val, idx) {\n context._inputElement[idx] = radioContainer.append(\"li\").append(\"input\").attr(\"type\", \"radio\");\n context._inputElement[idx].node().insertAdjacentHTML(\"afterend\", \"<text>\" + val + \"</text>\");\n });\n\n this._inputElement.forEach(function (e, idx) {\n e.attr(\"name\", context.name());\n e.on(\"click\", function (w) {\n w.click(w);\n });\n e.on(\"blur\", function (w) {\n w.blur(w);\n });\n e.on(\"change\", function (w) {\n context.value([e.property(\"value\")]);\n w.change(w, true);\n });\n });\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n\n const context = this;\n\n this._inputElement.forEach(function (e, idx) {\n e.property(\"value\", context.selectOptions()[idx]);\n if (context.value().indexOf(context.selectOptions()[idx]) !== -1 && context.value() !== \"false\") {\n e.property(\"checked\", true);\n } else {\n e.property(\"checked\", false);\n }\n });\n }\n}\nRadio.prototype._class += \" form_Radio\";\nRadio.prototype.implements(IInput.prototype);\n\nexport interface Radio {\n // IInput ---\n name(): string;\n name(_: string): this;\n name_exists(): boolean;\n label(): string;\n label(_: string): this;\n label_exists(): boolean;\n value(): any;\n value(_: any): this;\n value_exists(): boolean;\n validate(): string;\n validate(_: string): this;\n validate_exists(): boolean;\n\n // Properties ---\n selectOptions(): any[];\n selectOptions(_: any[]): this;\n selectOptions_exists(): boolean;\n}\n\nRadio.prototype.publish(\"selectOptions\", [], \"array\", \"Array of options used to fill a dropdown list\");\n","import { IInput } from \"@hpcc-js/api\";\nimport { HTMLWidget } from \"@hpcc-js/common\";\nimport { rgb as d3Rgb } from \"d3-color\";\n\nimport \"../src/Input.css\";\n\nexport class Range extends HTMLWidget {\n _inputElement = [];\n\n constructor() {\n super();\n\n IInput.call(this);\n\n this._tag = \"div\";\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n\n const context = this;\n\n this._inputElement[0] = element.append(\"input\").attr(\"type\", \"range\");\n this._inputElement[1] = element.append(\"input\").attr(\"type\", \"number\");\n\n this._inputElement.forEach(function (e, idx) {\n e.attr(\"name\", context.name());\n e.on(\"click\", function (w) {\n w.click(w);\n });\n e.on(\"blur\", function (w) {\n w.blur(w);\n });\n e.on(\"change\", function (w) {\n if (idx === 0) {\n context._inputElement[1].property(\"value\", d3Rgb(context._inputElement[0].property(\"value\")).toString());\n context.value(context._inputElement[0].property(\"value\"));\n } else {\n context._inputElement[0].property(\"value\", context._inputElement[1].property(\"value\"));\n context.value(d3Rgb(context._inputElement[1].property(\"value\")).toString());\n }\n w.change(w, true);\n });\n });\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n\n this._inputElement[0].attr(\"type\", \"range\");\n this._inputElement[0].property(\"value\", this.value());\n this._inputElement[0].attr(\"min\", this.low());\n this._inputElement[0].attr(\"max\", this.high());\n this._inputElement[0].attr(\"step\", this.step());\n this._inputElement[1].attr(\"type\", \"number\");\n this._inputElement[1].property(\"value\", this.value());\n this._inputElement[1].attr(\"min\", this.low());\n this._inputElement[1].attr(\"max\", this.high());\n this._inputElement[1].attr(\"step\", this.step());\n }\n\n insertSelectOptions(optionsArr) {\n let optionHTML = \"\";\n if (optionsArr.length > 0) {\n optionsArr.forEach(function (opt) {\n const val = (opt instanceof Array ? opt[0] : opt);\n const text = (opt instanceof Array ? (opt[1] ? opt[1] : opt[0]) : opt);\n optionHTML += \"<option value='\" + val + \"'>\" + text + \"</option>\";\n });\n } else {\n optionHTML += \"<option>selectOptions not set</option>\";\n }\n this._inputElement[0].html(optionHTML);\n }\n}\nRange.prototype._class += \" form_Range\";\nRange.prototype.implements(IInput.prototype);\n\nexport interface Range {\n // IInput ---\n name(): string;\n name(_: string): this;\n name_exists(): boolean;\n label(): string;\n label(_: string): this;\n label_exists(): boolean;\n value(): any;\n value(_: any): this;\n value_exists(): boolean;\n validate(): string;\n validate(_: string): this;\n validate_exists(): boolean;\n\n // Properties ---\n type(): string;\n type(_: string): this;\n type_exists(): boolean;\n selectOptions(): any[];\n selectOptions(_: any[]): this;\n selectOptions_exists(): boolean;\n low(): number;\n low(_: number): this;\n low_exists(): boolean;\n high(): number;\n high(_: number): this;\n high_exists(): boolean;\n step(): number;\n step(_: number): this;\n step_exists(): boolean;\n}\n\nRange.prototype.publish(\"type\", \"text\", \"set\", \"Input type\", [\"html-color\", \"number\", \"checkbox\", \"button\", \"select\", \"textarea\", \"date\", \"text\", \"range\", \"search\", \"email\", \"time\", \"datetime\"]);\nRange.prototype.publish(\"selectOptions\", [], \"array\", \"Array of options used to fill a dropdown list\");\nRange.prototype.publish(\"low\", null, \"number\", \"Minimum value for Range input\");\nRange.prototype.publish(\"high\", null, \"number\", \"Maximum value for Range input\");\nRange.prototype.publish(\"step\", null, \"number\", \"Step value for Range input\");\n","import { IInput } from \"@hpcc-js/api\";\nimport { HTMLWidget } from \"@hpcc-js/common\";\n\nimport \"../src/Input.css\";\n\nexport class Select extends HTMLWidget {\n _inputElement = [];\n\n constructor() {\n super();\n\n IInput.call(this);\n\n this._tag = \"div\";\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n\n const context = this;\n\n this._inputElement[0] = element.append(\"select\")\n .attr(\"name\", this.name())\n .on(\"click\", function (w) {\n w.click(w);\n })\n .on(\"blur\", function (w) {\n w.blur(w);\n })\n .on(\"change\", function (w) {\n context.value([context._inputElement[0].property(\"value\")]);\n w.change(w, true);\n })\n ;\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n\n this.insertSelectOptions(this.selectOptions());\n this._inputElement[0]\n .property(\"value\", this.value())\n .style(\"max-width\", this.maxWidth_exists() ? this.maxWidth() + \"px\" : null)\n ;\n }\n\n insertSelectOptions(optionsArr) {\n let optionHTML = \"\";\n if (optionsArr.length > 0) {\n optionsArr.forEach(function (opt) {\n const val = (opt instanceof Array ? opt[0] : opt);\n const text = (opt instanceof Array ? (opt[1] ? opt[1] : opt[0]) : opt);\n optionHTML += \"<option value='\" + val + \"'>\" + text + \"</option>\";\n });\n } else {\n optionHTML += \"<option>selectOptions not set</option>\";\n }\n this._inputElement[0].html(optionHTML);\n }\n}\nSelect.prototype._class += \" form_Select\";\nSelect.prototype.implements(IInput.prototype);\n\nexport interface Select {\n // IInput ---\n name(): string;\n name(_: string): this;\n name_exists(): boolean;\n label(): string;\n label(_: string): this;\n label_exists(): boolean;\n value(): any;\n value(_: any): this;\n value_exists(): boolean;\n validate(): string;\n validate(_: string): this;\n validate_exists(): boolean;\n\n // Properties ---\n selectOptions(): any[];\n selectOptions(_: any[]): this;\n selectOptions_exists(): boolean;\n maxWidth(): number;\n maxWidth(_: number): this;\n maxWidth_exists(): boolean;\n}\n\nSelect.prototype.publish(\"selectOptions\", [], \"array\", \"Array of options used to fill a dropdown list\");\nSelect.prototype.publish(\"maxWidth\", 120, \"number\", \"Width\", null, { optional: true });\n","import { IInput } from \"@hpcc-js/api\";\nimport { d3Event, select as d3Select, SVGWidget } from \"@hpcc-js/common\";\nimport { drag as d3Drag } from \"d3-drag\";\nimport { format as d3Format } from \"d3-format\";\nimport { scaleLinear as d3ScaleLinear } from \"d3-scale\";\nimport { timeFormat as d3TimeFormat, timeParse as d3TimeParse } from \"d3-time-format\";\n\nimport \"../src/Slider.css\";\n\nexport class Slider extends SVGWidget {\n xScale;\n\n moveMode: \"both\" | \"left\" | \"right\";\n moveStartPos: number;\n\n prevValue;\n\n slider;\n\n handleLeft;\n handleLeftPos: number = 0;\n handleLeftStartPos: number;\n\n handleRight;\n handleRightPos: number = 0;\n handleRightStartPos: number;\n\n constructor() {\n super();\n IInput.call(this);\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n this.resize({ width: this.width(), height: 50 });\n\n this.xScale = d3ScaleLinear()\n .clamp(true);\n\n this.slider = element.append(\"g\")\n .attr(\"class\", \"slider\")\n ;\n if (this.low() === null && this.high() === null) {\n if (this.lowDatetime() !== null && this.highDatetime() !== null) {\n const time_parser = d3TimeParse(this.timePattern() ? this.timePattern() : \"%Q\");\n this.low(time_parser(this.lowDatetime()).getTime());\n this.high(time_parser(this.highDatetime()).getTime());\n }\n }\n this.slider.append(\"line\")\n .attr(\"class\", \"track\")\n .select(function () { return this.parentNode.appendChild(this.cloneNode(true)); })\n .attr(\"class\", \"track-inset\")\n .select(function () { return this.parentNode.appendChild(this.cloneNode(true)); })\n .attr(\"class\", \"track-overlay\")\n .call(d3Drag()\n .on(\"start\", () => {\n const event = d3Event();\n this.moveStartPos = event.x;\n this.handleLeftStartPos = this.handleLeftPos;\n this.handleRightStartPos = this.handleRightPos;\n if (this.allowRange() && this.handleLeftPos <= event.x && event.x <= this.handleRightPos) {\n this.moveMode = \"both\";\n } else if (Math.abs(event.x - this.handleLeftPos) < Math.abs(event.x - this.handleRightPos)) {\n this.moveMode = \"left\";\n } else {\n this.moveMode = \"right\";\n }\n this.moveHandleTo(event.x);\n })\n .on(\"drag\", () => {\n this.moveHandleTo(d3Event().x);\n })\n .on(\"end\", () => {\n this.moveHandleTo(d3Event().x);\n this.data([[this.xScale.invert(this.handleLeftPos), this.xScale.invert(this.handleRightPos)]]);\n this.checkChangedValue();\n }));\n\n this.slider.insert(\"g\", \".track-overlay\")\n .attr(\"class\", \"ticks\")\n .attr(\"transform\", `translate(0, ${this.fontSize() + (this.tickHeight() / 2)})`)\n ;\n\n this.handleRight = this.slider.insert(\"path\", \".track-overlay\")\n .attr(\"class\", \"handle\")\n ;\n\n this.handleLeft = this.slider.insert(\"path\", \".track-overlay\")\n .attr(\"class\", \"handle\")\n ;\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n const context = this;\n this.xScale\n .domain([this.low(), this.high()])\n .range([0, this.width() - this.padding() * 2])\n ;\n\n this.slider\n .attr(\"transform\", \"translate(\" + (-this.width() / 2 + this.padding()) + \",\" + 0 + \")\");\n\n this.slider.selectAll(\"line.track,line.track-inset,line.track-overlay\")\n .attr(\"x1\", this.xScale.range()[0])\n .attr(\"x2\", this.xScale.range()[1])\n ;\n\n const x_distance = (this.width() - (this.padding() * 2)) / (this.tickCount() - 1);\n\n const tick_text_arr = [];\n if (this.tickDateFormat() !== null && this.timePattern() !== null) {\n const Q_parser = d3TimeParse(\"%Q\");\n const time_formatter = d3TimeFormat(this.tickDateFormat());\n const time_segment = (this.high() - this.low()) / (this.tickCount() - 1);\n for (let i = 0; i < this.tickCount(); i++) {\n const date_to_parse = \"\" + (this.low() + (time_segment * i));\n const parsed_date = Q_parser(date_to_parse);\n tick_text_arr.push(time_formatter(parsed_date));\n }\n } else {\n const value_formatter = d3Format(this.tickValueFormat());\n const value_segment = (this.high() - this.low()) / (this.tickCount() - 1);\n for (let i = 0; i < this.tickCount(); i++) {\n const tick_value = this.low() + (value_segment * i);\n tick_text_arr.push(value_formatter(tick_value));\n }\n }\n const tickText = this.slider.selectAll(\"g.tick\").data(tick_text_arr);\n const tickTextEnter = tickText.enter().append(\"g\").attr(\"class\", \"tick\");\n\n tickTextEnter.append(\"text\").attr(\"class\", \"tick-text\");\n tickTextEnter.append(\"line\").attr(\"class\", \"tick-line\");\n tickTextEnter\n .merge(tickText)\n .each(function (d, i) {\n const x = x_distance * i;\n\n d3Select(this).select(\"text.tick-text\")\n .style(\"font-size\", context.fontSize())\n .attr(\"x\", function () {\n if (i === 0) return x - 2;\n return i === context.tickCount() - 1 ? x + 2 : x;\n })\n .attr(\"y\", context.tickHeight() + (context.tickOffset() / 2) + context.fontSize())\n .attr(\"text-basline\", \"text-before-edge\")\n .attr(\"text-anchor\", function () {\n if (i === 0) return \"start\";\n return i === context.tickCount() - 1 ? \"end\" : \"middle\";\n })\n .text(() => d)\n ;\n\n d3Select(this).select(\"line.tick-line\")\n .attr(\"x1\", x)\n .attr(\"x2\", x)\n .attr(\"y1\", context.tickOffset() - 1)\n .attr(\"y2\", context.tickOffset() + context.tickHeight())\n .style(\"stroke\", \"#000\")\n .style(\"stroke-width\", 1)\n ;\n });\n this.slider.node().appendChild(this.handleRight.node());\n this.slider.node().appendChild(this.handleLeft.node());\n this.handleLeftPos = this.lowPos();\n this.handleRightPos = this.highPos();\n this.updateHandles();\n this.checkChangedValue();\n }\n\n checkChangedValue() {\n if (this.prevValue !== this.value() && typeof this.prevValue !== \"undefined\") {\n this.change(this);\n }\n this.prevValue = this.value();\n }\n\n updateHandles() {\n this.handleLeft\n .attr(\"transform\", `translate(${this.handleLeftPos}, -28)`)\n .attr(\"d\", (d) => this.handlePath(\"l\"))\n ;\n this.handleRight\n .attr(\"transform\", `translate(${this.handleRightPos}, -28)`)\n .attr(\"d\", (d) => this.handlePath(\"r\"))\n ;\n }\n\n lowPos(): number {\n let data = [[this.low(), this.high()]];\n if (this.data().length > 0 && typeof this.data()[0][0] === \"number\" && typeof this.data()[0][1] === \"number\") {\n data = this.data();\n }\n return this.xScale(data[0][0]);\n }\n\n highPos(): number {\n let data = [[this.low(), this.high()]];\n if (this.data().length > 0 && typeof this.data()[0][0] === \"number\" && typeof this.data()[0][1] === \"number\") {\n data = this.data();\n }\n return this.xScale(data[0][this.allowRange() ? 1 : 0]);\n }\n\n moveHandleTo(pos) {\n if (this.allowRange()) {\n switch (this.moveMode) {\n case \"both\":\n this.handleLeftPos = this.handleLeftStartPos + pos - this.moveStartPos;\n this.handleRightPos = this.handleRightStartPos + pos - this.moveStartPos;\n break;\n case \"left\":\n this.handleLeftPos = pos;\n if (this.handleLeftPos > this.handleRightPos) {\n this.handleRightPos = this.handleLeftPos;\n }\n break;\n case \"right\":\n this.handleRightPos = pos;\n if (this.handleRightPos < this.handleLeftPos) {\n this.handleLeftPos = this.handleRightPos;\n }\n break;\n }\n } else {\n this.handleLeftPos = this.handleRightPos = pos;\n }\n\n this.handleLeftPos = this.constrain(this.handleLeftPos);\n this.handleRightPos = this.constrain(this.handleRightPos);\n this.value(this.allowRange() ? [this.xScale.invert(this.handleLeftPos), this.xScale.invert(this.handleRightPos)] : this.xScale.invert(this.handleLeftPos));\n this.updateHandles();\n }\n\n constrain(pos: number): number {\n const range = this.xScale.range();\n if (pos < range[0]) pos = range[0];\n if (pos > range[1]) pos = range[1];\n return this.nearestStep(pos);\n }\n\n nearestStep(pos) {\n const value = this.xScale.invert(pos);\n return this.xScale(this.low() + Math.round((value - this.low()) / this.step()) * this.step());\n }\n\n handlePath = function (d) {\n const e = +(d === \"r\");\n const x = e ? 1 : -1;\n const xOffset = this.allowRange() ? 0.5 : 0.0;\n const y = 18;\n let retVal = \"M\" + (xOffset * x) + \",\" + y +\n \"A6,6 0 0 \" + e + \" \" + (6.5 * x) + \",\" + (y + 6) +\n \"V\" + (2 * y - 6) +\n \"A6,6 0 0 \" + e + \" \" + (xOffset * x) + \",\" + (2 * y)\n ;\n if (this.allowRange()) {\n retVal += \"Z\" +\n \"M\" + (2.5 * x) + \",\" + (y + 8) +\n \"V\" + (2 * y - 8) +\n \"M\" + (4.5 * x) + \",\" + (y + 8) +\n \"V\" + (2 * y - 8)\n ;\n } else {\n retVal += \"M\" + (1 * x) + \",\" + (y + 8) +\n \"V\" + (2 * y - 8)\n ;\n }\n return retVal;\n };\n\n}\nSlider.prototype._class += \" form_Slider\";\nSlider.prototype.implements(IInput.prototype);\n\nexport interface Slider {\n // IInput ---\n name(): string;\n name(_: string): this;\n change(_: Slider): void;\n\n // Properties ---\n padding(): number;\n padding(_: number): this;\n fontSize(): number;\n fontSize(_: number): this;\n fontFamily(): string;\n fontFamily(_: string): this;\n fontColor(): string;\n fontColor(_: string): this;\n allowRange(): boolean;\n allowRange(_: boolean): this;\n low(): number;\n low(_: number): this;\n high(): number;\n high(_: number): this;\n step(): number;\n step(_: number): this;\n lowDatetime(): string;\n lowDatetime(_: string): this;\n highDatetime(): string;\n highDatetime(_: string): this;\n stepDatetime(): number;\n stepDatetime(_: number): this;\n selectionLabel(): string;\n selectionLabel(_: string): this;\n label(): string;\n label(_: string): this;\n value(): any;\n value(_: any): this;\n validate(): string;\n validate(_: string): this;\n tickCount(): number;\n tickCount(_: number): this;\n tickOffset(): number;\n tickOffset(_: number): this;\n tickHeight(): number;\n tickHeight(_: number): this;\n tickDateFormat(): string;\n tickDateFormat(_: string): this;\n tickValueFormat(): string;\n tickValueFormat(_: string): this;\n timePattern(): string;\n timePattern(_: string): this;\n\n padding_exists(): boolean;\n fontSize_exists(): boolean;\n fontFamily_exists(): boolean;\n fontColor_exists(): boolean;\n allowRange_exists(): boolean;\n low_exists(): boolean;\n step_exists(): boolean;\n high_exists(): boolean;\n selectionLabel_exists(): boolean;\n name_exists(): boolean;\n label_exists(): boolean;\n value_exists(): boolean;\n validate_exists(): boolean;\n}\n\nSlider.prototype.publish(\"padding\", 16, \"number\", \"Outer Padding\", null, { tags: [\"Basic\"] });\nSlider.prototype.publish(\"fontSize\", 12, \"number\", \"Font Size\", null, { tags: [\"Basic\"] });\nSlider.prototype.publish(\"fontFamily\", null, \"string\", \"Font Name\", null, { tags: [\"Basic\"] });\nSlider.prototype.publish(\"fontColor\", null, \"html-color\", \"Font Color\", null, { tags: [\"Basic\"] });\n\nSlider.prototype.publish(\"allowRange\", false, \"boolean\", \"Allow Range Selection\", null, { tags: [\"Intermediate\"] });\nSlider.prototype.publish(\"low\", null, \"number\", \"Low\", null, { tags: [\"Intermediate\"] });\nSlider.prototype.publish(\"high\", null, \"number\", \"High\", null, { tags: [\"Intermediate\"] });\nSlider.prototype.publish(\"step\", 10, \"number\", \"Step\", null, { tags: [\"Intermediate\"] });\nSlider.prototype.publish(\"lowDatetime\", null, \"string\", \"Low\", null, { tags: [\"Intermediate\"] });\nSlider.prototype.publish(\"highDatetime\", null, \"string\", \"High\", null, { tags: [\"Intermediate\"] });\nSlider.prototype.publish(\"selectionLabel\", \"\", \"string\", \"Selection Label\", null, { tags: [\"Intermediate\"] });\n\nSlider.prototype.publish(\"timePattern\", \"%Y-%m-%d\", \"string\");\n\nSlider.prototype.publish(\"tickCount\", 10, \"number\");\nSlider.prototype.publish(\"tickOffset\", 5, \"number\");\nSlider.prototype.publish(\"tickHeight\", 8, \"number\");\nSlider.prototype.publish(\"tickDateFormat\", null, \"string\");\nSlider.prototype.publish(\"tickValueFormat\", \",.0f\", \"string\");\n\nconst name = Slider.prototype.name;\nSlider.prototype.name = function (_?: any): any {\n const retVal = name.apply(this, arguments);\n if (arguments.length) {\n const val = _ instanceof Array ? _ : [_];\n SVGWidget.prototype.columns.call(this, val);\n }\n return retVal;\n};\n\nconst value = Slider.prototype.value;\nSlider.prototype.value = function (_?: any): any {\n const retVal = value.apply(this, arguments);\n if (!arguments.length) {\n if (!this.allowRange()) {\n return SVGWidget.prototype.data.call(this)[0][0];\n }\n return SVGWidget.prototype.data.call(this)[0];\n } else {\n SVGWidget.prototype.data.call(this, [this.allowRange() ? _ : [_, _]]);\n }\n return retVal;\n};\n","import { Input } from \"./Input.ts\";\n\nexport class TextArea extends Input {\n constructor() {\n super();\n\n this._tag = \"div\";\n this.type(\"textarea\");\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n }\n\n calcHeight() {\n return Math.max(this.minHeight_exists() ? this.minHeight() : 0, this.height());\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n this._inputElement[0]\n .attr(\"rows\", this.rows())\n .attr(\"cols\", this.cols())\n .attr(\"wrap\", this.wrap())\n .attr(\"spellcheck\", this.spellcheck())\n .style(\"height\", this.calcHeight() + \"px\")\n ;\n }\n\n}\nTextArea.prototype._class += \" form_TextArea\";\n\nexport interface TextArea {\n rows(): number;\n rows(_: number): this;\n rows_exists(): boolean;\n cols(): number;\n cols(_: number): this;\n cols_exists(): boolean;\n wrap(): string;\n wrap(_: string): this;\n wrap_exists(): boolean;\n minHeight(): number;\n minHeight(_: number): this;\n minHeight_exists(): boolean;\n spellcheck(): boolean;\n spellcheck(_: boolean): this;\n spellcheck_exists(): boolean;\n}\n\nTextArea.prototype.publish(\"rows\", null, \"number\", \"Rows\", null, { optional: true });\nTextArea.prototype.publish(\"cols\", null, \"number\", \"Columns\", null, { optional: true });\nTextArea.prototype.publish(\"wrap\", \"off\", \"set\", \"Wrap\", [\"off\", \"on\"]);\nTextArea.prototype.publish(\"minHeight\", null, \"number\", \"Minimum Height\", null, { optional: true });\nTextArea.prototype.publish(\"spellcheck\", null, \"boolean\", \"Input spell checking\", { optional: true });\n"],"names":["PKG_NAME","PKG_VERSION","BUILD_VERSION","_Button","HTMLWidget","_inputElement","constructor","super","IInput","call","this","_tag","enter","domNode","element","context","append","attr","name","on","w","click","blur","value","property","change","update","text","__name","Button","prototype","_class","implements","_CheckBox","checkboxContainer","selectOptions","length","push","forEach","val","idx","node","insertAdjacentHTML","e","vals","d","indexOf","insertSelectOptions","optionsArr","optionHTML","opt","Array","html","CheckBox","publish","_ColorInput","classed","d3Rgb","toString","bbox","getBoundingClientRect","style","height","ColorInput","_Form","tbody","tfoot","btntd","_controls","_maxCols","data","_","arguments","retVal","inputsForEach","input","render","callback","scope","inputs","inp","WidgetArray","content","inp2","inputsMap","calcMaxColumns","inputWidget","inputWidgetArray","values","dataArr","type","omitBlank","value_exists","v","submit","isValid","validate","checkValidation","allowEmptyRequest","some","wa","hasValue","clear","classID","allowRange","low","ret","msgArr","label","alert","join","d3Event","preventDefault","_placeholderElement","table","default","rightJust","leftJust","target","rows","selectAll","each","i","element2","d3Select","inputWidget2","SVGWidget","getBBox","resize","setTimeout","disable","w2","merge","select","setFocus","exit","remove","showSubmit","row","col","sel","Form","_Input","_labelElement","checked","id","inlineLabel_exists","inlineLabel","keyup","focus","dblclick","complete","Input","optional","_FieldForm","fields","apply","inpMap","map","f","__lparam","columns","key","FieldForm","_InputRange","_rangeData","InputRange","override","_OnOff","_input","inner","containerRadius","offText","onText","marginLeft","marginBottom","minWidth","_switch_size","minHeight","gutter","switchRadius","offFontColor","offColor","onFontColor","onColor","OnOff","_Radio","radioContainer","Radio","_Range","high","step","Range","_Select","maxWidth_exists","maxWidth","Select","_Slider","xScale","moveMode","moveStartPos","prevValue","slider","handleLeft","handleLeftPos","handleLeftStartPos","handleRight","handleRightPos","handleRightStartPos","width","d3ScaleLinear","clamp","lowDatetime","highDatetime","time_parser","d3TimeParse","timePattern","getTime","parentNode","appendChild","cloneNode","d3Drag","event","x","Math","abs","moveHandleTo","invert","checkChangedValue","insert","fontSize","tickHeight","domain","range","padding","x_distance","tickCount","tick_text_arr","tickDateFormat","Q_parser","time_formatter","d3TimeFormat","time_segment","parsed_date","value_formatter","d3Format","tickValueFormat","value_segment","tick_value","tickText","tickTextEnter","tickOffset","lowPos","highPos","updateHandles","handlePath","pos","constrain","nearestStep","round","xOffset","Slider","tags","_TextArea","calcHeight","max","minHeight_exists","cols","wrap","spellcheck","TextArea"],"mappings":"sSAAO,MAAMA,EAAW,gBACXC,EAAc,QACdC,EAAgB,SCGhBC,EAAN,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Q,QAClB1P,KAAK,OAAQP,KAAKkQ,QAClB3P,KAAK,aAAcP,KAAKmQ,cACxBhN,MAAM,SAAUnD,KAAK8P,aAAe,KAE7C,GAzBgC5O,EAAA2O,EAAA,YAA7B,IAAMO,EAANP,EA4BPO,EAAShP,UAAUC,QAAU,iBAoB7B+O,EAAShP,UAAUwB,QAAQ,OAAQ,KAAM,SAAU,OAAQ,KAAM,CAAEmG,UAAU,IAC7EqH,EAAShP,UAAUwB,QAAQ,OAAQ,KAAM,SAAU,UAAW,KAAM,CAAEmG,UAAU,IAChFqH,EAAShP,UAAUwB,QAAQ,OAAQ,MAAO,MAAO,OAAQ,CAAC,MAAO,OACjEwN,EAAShP,UAAUwB,QAAQ,YAAa,KAAM,SAAU,iBAAkB,KAAM,CAAEmG,UAAU,IAC5FqH,EAAShP,UAAUwB,QAAQ,aAAc,KAAM,UAAW,uBAAwB,CAAEmG,UAAU"}
|
package/dist/index.umd.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
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=Object.defineProperty,s=(t,e)=>i(t,"name",{value:e,configurable:!0});const o=class _Button extends n.HTMLWidget{_inputElement=[];constructor(){super(),e.IInput.call(this),this._tag="div"}enter(t,e){super.enter(t,e);const n=this;this._inputElement[0]=e.append("button").attr("name",this.name()).on("click",function(t){t.click(t)}).on("blur",function(t){t.blur(t)}).on("change",function(t){n.value([n._inputElement[0].property("value")]),t.change(t,!0)})}update(t,e){super.update(t,e),this._inputElement[0].text(this.value())}};s(o,"Button");let l=o;l.prototype._class+=" form_Button",l.prototype.implements(e.IInput.prototype);const a=class _CheckBox extends n.HTMLWidget{_inputElement=[];constructor(){super(),e.IInput.call(this),this._tag="div"}enter(t,e){super.enter(t,e);const n=this,i=e.append("ul");this.selectOptions().length||this.selectOptions().push(""),this.selectOptions().forEach(function(t,e){n._inputElement[e]=i.append("li").append("input").attr("type","checkbox"),n._inputElement[e].node().insertAdjacentHTML("afterend","<text>"+t+"</text>")}),this._inputElement.forEach(function(t,e){t.attr("name",n.name()),t.on("click",function(t){t.click(t)}),t.on("blur",function(t){t.blur(t)}),t.on("change",function(t){const e=[];n._inputElement.forEach(function(t){t.property("checked")&&e.push(t.property("value"))}),n.value(e),t.change(t,!0)})})}update(t,e){super.update(t,e);const n=this;this._inputElement.forEach(function(t,e){t.property("value",n.selectOptions()[e]),-1!==n.value().indexOf(n.selectOptions()[e])&&"false"!==n.value()?t.property("checked",!0):t.property("checked",!1)})}insertSelectOptions(t){let e="";t.length>0?t.forEach(function(t){const 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)}};s(a,"CheckBox");let r=a;r.prototype._class+=" form_CheckBox",r.prototype.implements(e.IInput.prototype),r.prototype.publish("selectOptions",[],"array","Array of options used to fill a dropdown list");const p=class _ColorInput extends n.HTMLWidget{_inputElement=[];constructor(){super(),e.IInput.call(this),this._tag="div"}enter(t,e){super.enter(t,e);const i=this;this._inputElement[0]=e.append("input").attr("type","text"),this._inputElement[0].classed("color-text",!0),this._inputElement[1]=e.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?(i._inputElement[1].property("value",n.rgb(i._inputElement[0].property("value")).toString()),i.value(i._inputElement[0].property("value"))):(i._inputElement[0].property("value",i._inputElement[1].property("value")),i.value(n.rgb(i._inputElement[1].property("value")).toString())),t.change(t,!0)})})}update(t,e){super.update(t,e);const i=this;this._inputElement.forEach(function(t){t.attr("name",i.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());const s=this._inputElement[0].node().getBoundingClientRect();this._inputElement[1].style("height",s.height-2+"px")}};s(p,"ColorInput");let h=p;h.prototype._class+=" form_ColorInput",h.prototype.implements(e.IInput.prototype);const u=class _Form extends n.HTMLWidget{tbody;tfoot;btntd;_controls;_maxCols;constructor(){super(),this._tag="form"}data(t){if(!arguments.length){const t=[];return this.inputsForEach(function(e){t.push(e.value())}),t}return this.inputsForEach(function(e,n){t&&t.length>n&&e.value(t[n]).render()}),this}inputsForEach(t,e){let i=0;this.inputs().forEach(function(s){(s instanceof n.WidgetArray?s.content():[s]).forEach(function(n){e?t.call(e,n,i++):t(n,i++)})})}inputsMap(){const t={};return this.inputs().forEach(function(e){t[e.name()]=e}),t}calcMaxColumns(){let t=0;return this.inputs().forEach(function(e){const i=e instanceof n.WidgetArray?e.content():[e];i.length>t&&(t=i.length)}),t}values(t){if(!arguments.length){const t={};return this.inputsForEach(function(e){const n=e.type?e.type():"text";if(e.value()||!this.omitBlank())switch(n){case"checkbox":t[e.name()]=e.value_exists()?!!e.value():void 0;break;case"number":const n=e.value();t[e.name()]=""===n?void 0:+n;break;default:t[e.name()]=e.value_exists()?e.value():void 0}},this),t}return this.inputsForEach(function(e){t[e.name()]?e.value(t[e.name()]):this.omitBlank()&&e.value("")},this),this}submit(){let 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)}clear(){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()}})}checkValidation(){let t=!0;const 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}enter(t,e){super.enter(t,e),e.on("submit",function(){n.d3Event().preventDefault()}),this._placeholderElement.style("overflow","auto");const i=e.append("table");this.tbody=i.append("tbody"),this.tfoot=i.append("tfoot"),this.btntd=this.tfoot.append("tr").append("td").attr("colspan",2);const s=this;this._controls=[(new l).classed({default:!0}).value("Submit").on("click",function(){s.submit()},!0),(new l).value("Clear").on("click",function(){s.clear()},!0)];const o=s.btntd.append("div").style("float","right");this._controls.forEach(function(t){const e=o.append("span").style("float","left");t.target(e.node()).render()})}update(t,e){super.update(t,e),this._maxCols=this.calcMaxColumns();const i=this,s=this.tbody.selectAll("tr").data(this.inputs());s.enter().append("tr").each(function(t,e){const s=n.select(this),o=t instanceof n.WidgetArray?t.content():[t];o.forEach(function(t,e){s.append("td").attr("class","prompt");const l=s.append("td").attr("class","input");if(e===o.length-1&&o.length<i._maxCols&&l.attr("colspan",2*(i._maxCols-o.length+1)),t.target(l.node()).render(),t instanceof n.SVGWidget){const e=t.element().node().getBBox();l.style("height",e.height+"px"),t.resize().render()}t._inputElement instanceof Array&&t._inputElement.forEach(function(t){t.on("keyup.form",function(t){setTimeout(function(){i._controls[0].disable(!i.allowEmptyRequest()&&!i.inputs().some(function(t){return-1!==t._class.indexOf("WidgetArray")?t.content().some(function(t){return t.hasValue()}):t.hasValue()}))},100)})})})}).merge(s).each(function(t,e){const i=n.select(this);(t instanceof n.WidgetArray?t.content():[t]).forEach(function(t,e){i.select("td.prompt").text(t.label()+":")})}),s.each(function(t,e){0===e&&t.setFocus&&t.setFocus()}),s.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(){i._controls[0].disable(!i.allowEmptyRequest()&&!i.inputs().some(function(t){return-1!==t._class.indexOf("WidgetArray")?t.content().some(function(t){return t.hasValue()}):t.hasValue()}))},100)}exit(t,e){this.inputsForEach(t=>t.target(null)),super.exit(t,e)}click(t,e,n){}};s(u,"Form");let c=u;c.prototype._class+=" form_Form",c.prototype.publish("validate",!0,"boolean","Enable/Disable input validation"),c.prototype.publish("inputs",[],"widgetArray","Array of input widgets",null,{render:!1}),c.prototype.publish("showSubmit",!0,"boolean","Show Submit/Cancel Controls"),c.prototype.publish("omitBlank",!1,"boolean","Drop Blank Fields From Submit"),c.prototype.publish("allowEmptyRequest",!1,"boolean","Allow Blank Form to be Submitted");const d=class _Input extends n.HTMLWidget{_inputElement=[];_labelElement=[];constructor(){super(),e.IInput.call(this),this._tag="div"}checked(t){return arguments.length?(this._inputElement[0]&&this._inputElement[0].property("checked",t),this):!!this._inputElement[0]&&this._inputElement[0].property("checked")}enter(t,e){super.enter(t,e),this._labelElement[0]=e.append("label").attr("for",this.id()+"_input").style("visibility",this.inlineLabel_exists()?"visible":"hidden");const n=this;switch(this.type()){case"button":this._inputElement[0]=e.append("button").attr("id",this.id()+"_input");break;case"textarea":this._inputElement[0]=e.append("textarea").attr("id",this.id()+"_input");break;default:this._inputElement[0]=e.append("input").attr("id",this.id()+"_input").attr("type",this.type())}this._inputElement.forEach(function(t,e){t.attr("name",n.name()),t.on("click",function(t){t.click(t)}),t.on("blur",function(t){t.blur(t)}),t.on("change",function(e){n.value([t.property("value")]),e.change(e,!0)}),t.on("keyup",function(e){n.value([t.property("value")]),e.change(e,!1)})})}update(t,e){switch(super.update(t,e),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())}}blur(t){}keyup(t){}focus(t){}click(t){}dblclick(t){}change(t,e){}};s(d,"Input");let m=d;m.prototype._class+=" form_Input",m.prototype.implements(e.IInput.prototype),m.prototype.publish("type","text","set","Input type",["string","number","boolean","date","time","hidden","nested","button","checkbox","text","textarea","search","email","datetime"]),m.prototype.publish("inlineLabel",null,"string","Input Label",null,{optional:!0});const f=class _FieldForm extends c{constructor(){super(),this._tag="form"}fields(t){const e=super.fields.apply(this,arguments);if(arguments.length){const e=this.inputsMap();this.inputs(t.map(t=>e[t.id()]||(new m).name(t.id()).label(t.label()).type(t.type())))}return e}data(t){if(!arguments.length)return super.data();if(super.data(t[0]),t[0]){const e=this.inputs(),n=t[0][this.columns().length];let i=0;for(const t in n)e[i].name(t),++i}return this}};s(f,"FieldForm");let g=f;g.prototype._class+=" form_FieldForm";const y=class _InputRange extends n.HTMLWidget{_inputElement=[];_labelElement=[];_rangeData=[];constructor(){super(),e.IInput.call(this),this._tag="div"}enter(t,e){super.enter(t,e),this._labelElement[0]=e.append("label").attr("for",this.id()+"_input").style("visibility",this.inlineLabel_exists()?"visible":"hidden"),this._inputElement.push(e.append("input").attr("id",this.id()+"_input_min").attr("type",this.type())),this._inputElement.push(e.append("input").attr("id",this.id()+"_input_max").attr("type",this.type()));const n=this;this._inputElement.forEach(function(t,e){t.attr("name",n.name()),t.on("click",function(t){t.click(t)}),t.on("blur",function(t){t.blur(t)}),t.on("change",function(i){n._rangeData[e]=t.property("value"),n.value(n._rangeData),i.change(i,!0)})})}update(t,e){super.update(t,e),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)}};s(y,"InputRange");let b=y;b.prototype._class+=" form_InputRange",b.prototype.implements(e.IInput.prototype),b.prototype.publish("type","text","set","InputRange type",["number","date","text","time","datetime","hidden"]),b.prototype.publish("inlineLabel",null,"string","InputRange Label",null,{optional:!0}),b.prototype.publish("value",["",""],"array","Input Current Value",null,{override:!0});const _=class _OnOff extends n.HTMLWidget{_inputElement=[];_input;constructor(){super(),e.IInput.call(this),this._tag="div"}enter(t,e){super.enter(t,e),e.classed("onoffswitch",!0);const n=this;this._input=e.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){const e=[];n._inputElement.forEach(function(t,n){t.property("checked")&&e.push(t.property("value"))}),n.value(e),t.change(t,!0)});const i=e.append("label").attr("class","onoffswitch-label").attr("for",this.id()+"_onOff"),s=i.append("div").attr("class","onoffswitch-inner");s.append("div").attr("class","onoffswitch-offText").style("padding-right",this.containerRadius()/2+"px").text(this.offText()),s.append("div").attr("class","onoffswitch-onText").style("padding-left",this.containerRadius()/2+"px").style("width",`calc(100% - ${this.containerRadius()/2}px)`).text(this.onText()),i.append("div").attr("class","onoffswitch-switch")}update(t,e){super.update(t,e),this._input.attr("name",this.name()),e.style("margin-left",this.marginLeft()+"px").style("margin-bottom",this.marginBottom()+"px").style("width",this.minWidth()+"px");const n=this.minHeight()-4*this.gutter();e.select(".onoffswitch-switch").style("height",n+"px").style("width",n+"px").style("top",2*this.gutter()+1+"px").style("border-radius",this.switchRadius()+"px"),e.select(".onoffswitch-inner").style("min-height",this.minHeight()+"px"),e.select(".onoffswitch-label").style("border-radius",this.containerRadius()+"px"),e.select(".onoffswitch-offText").style("color",this.offFontColor()).style("background-color",this.offColor()),e.select(".onoffswitch-onText").style("color",this.onFontColor()).style("background-color",this.onColor())}};s(_,"OnOff");let v=_;v.prototype._class+=" form_OnOff",v.prototype.implements(e.IInput.prototype),v.prototype.publish("marginLeft",0,"number","Margin left of OnOff"),v.prototype.publish("marginBottom",0,"number","Margin bottom of OnOff"),v.prototype.publish("minWidth",100,"number","Minimum width of OnOff (pixels)"),v.prototype.publish("minHeight",20,"number","Minimum height of OnOff (pixels)"),v.prototype.publish("gutter",1,"number","Space between switch and border of OnOff (pixels)"),v.prototype.publish("onText","Save","string","Text to display when 'ON'"),v.prototype.publish("offText","Properties","string","Text to display when 'OFF'"),v.prototype.publish("switchRadius",10,"number","Border radius of switch (pixels)"),v.prototype.publish("containerRadius",10,"number","Border radius of OnOff (pixels)"),v.prototype.publish("onColor","#2ecc71","html-color","Background color when 'ON'"),v.prototype.publish("offColor","#ecf0f1","html-color","Background color when 'OFF'"),v.prototype.publish("onFontColor","#2c3e50","html-color","Font color when 'ON'"),v.prototype.publish("offFontColor","#7f8c8d","html-color","Font color when 'OFF'");const x=class _Radio extends n.HTMLWidget{_inputElement=[];constructor(){super(),e.IInput.call(this),this._tag="div"}enter(t,e){super.enter(t,e);const n=this,i=e.append("ul");this.selectOptions().length||this.selectOptions().push(""),this.selectOptions().forEach(function(t,e){n._inputElement[e]=i.append("li").append("input").attr("type","radio"),n._inputElement[e].node().insertAdjacentHTML("afterend","<text>"+t+"</text>")}),this._inputElement.forEach(function(t,e){t.attr("name",n.name()),t.on("click",function(t){t.click(t)}),t.on("blur",function(t){t.blur(t)}),t.on("change",function(e){n.value([t.property("value")]),e.change(e,!0)})})}update(t,e){super.update(t,e);const n=this;this._inputElement.forEach(function(t,e){t.property("value",n.selectOptions()[e]),-1!==n.value().indexOf(n.selectOptions()[e])&&"false"!==n.value()?t.property("checked",!0):t.property("checked",!1)})}};s(x,"Radio");let E=x;E.prototype._class+=" form_Radio",E.prototype.implements(e.IInput.prototype),E.prototype.publish("selectOptions",[],"array","Array of options used to fill a dropdown list");const k=class _Range extends n.HTMLWidget{_inputElement=[];constructor(){super(),e.IInput.call(this),this._tag="div"}enter(t,e){super.enter(t,e);const i=this;this._inputElement[0]=e.append("input").attr("type","range"),this._inputElement[1]=e.append("input").attr("type","number"),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){0===e?(i._inputElement[1].property("value",n.rgb(i._inputElement[0].property("value")).toString()),i.value(i._inputElement[0].property("value"))):(i._inputElement[0].property("value",i._inputElement[1].property("value")),i.value(n.rgb(i._inputElement[1].property("value")).toString())),t.change(t,!0)})})}update(t,e){super.update(t,e),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())}insertSelectOptions(t){let e="";t.length>0?t.forEach(function(t){const 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)}};s(k,"Range");let w=k;w.prototype._class+=" form_Range",w.prototype.implements(e.IInput.prototype),w.prototype.publish("type","text","set","Input type",["html-color","number","checkbox","button","select","textarea","date","text","range","search","email","time","datetime"]),w.prototype.publish("selectOptions",[],"array","Array of options used to fill a dropdown list"),w.prototype.publish("low",null,"number","Minimum value for Range input"),w.prototype.publish("high",null,"number","Maximum value for Range input"),w.prototype.publish("step",null,"number","Step value for Range input");const S=class _Select extends n.HTMLWidget{_inputElement=[];constructor(){super(),e.IInput.call(this),this._tag="div"}enter(t,e){super.enter(t,e);const n=this;this._inputElement[0]=e.append("select").attr("name",this.name()).on("click",function(t){t.click(t)}).on("blur",function(t){t.blur(t)}).on("change",function(t){n.value([n._inputElement[0].property("value")]),t.change(t,!0)})}update(t,e){super.update(t,e),this.insertSelectOptions(this.selectOptions()),this._inputElement[0].property("value",this.value()).style("max-width",this.maxWidth_exists()?this.maxWidth()+"px":null)}insertSelectOptions(t){let e="";t.length>0?t.forEach(function(t){const 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)}};s(S,"Select");let I=S;I.prototype._class+=" form_Select",I.prototype.implements(e.IInput.prototype),I.prototype.publish("selectOptions",[],"array","Array of options used to fill a dropdown list"),I.prototype.publish("maxWidth",120,"number","Width",null,{optional:!0});const R=class _Slider extends n.SVGWidget{xScale;moveMode;moveStartPos;prevValue;slider;handleLeft;handleLeftPos=0;handleLeftStartPos;handleRight;handleRightPos=0;handleRightStartPos;constructor(){super(),e.IInput.call(this)}enter(t,e){if(super.enter(t,e),this.resize({width:this.width(),height:50}),this.xScale=n.scaleLinear().clamp(!0),this.slider=e.append("g").attr("class","slider"),null===this.low()&&null===this.high()&&null!==this.lowDatetime()&&null!==this.highDatetime()){const t=n.timeParse(this.timePattern()?this.timePattern():"%Q");this.low(t(this.lowDatetime()).getTime()),this.high(t(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",()=>{const t=n.d3Event();this.moveStartPos=t.x,this.handleLeftStartPos=this.handleLeftPos,this.handleRightStartPos=this.handleRightPos,this.allowRange()&&this.handleLeftPos<=t.x&&t.x<=this.handleRightPos?this.moveMode="both":Math.abs(t.x-this.handleLeftPos)<Math.abs(t.x-this.handleRightPos)?this.moveMode="left":this.moveMode="right",this.moveHandleTo(t.x)}).on("drag",()=>{this.moveHandleTo(n.d3Event().x)}).on("end",()=>{this.moveHandleTo(n.d3Event().x),this.data([[this.xScale.invert(this.handleLeftPos),this.xScale.invert(this.handleRightPos)]]),this.checkChangedValue()})),this.slider.insert("g",".track-overlay").attr("class","ticks").attr("transform",`translate(0, ${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")}update(t,e){super.update(t,e);const i=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]);const s=(this.width()-2*this.padding())/(this.tickCount()-1),o=[];if(null!==this.tickDateFormat()&&null!==this.timePattern()){const t=n.timeParse("%Q"),e=n.timeFormat(this.tickDateFormat()),i=(this.high()-this.low())/(this.tickCount()-1);for(let n=0;n<this.tickCount();n++){const s=t(""+(this.low()+i*n));o.push(e(s))}}else{const t=n.format(this.tickValueFormat()),e=(this.high()-this.low())/(this.tickCount()-1);for(let n=0;n<this.tickCount();n++){const i=this.low()+e*n;o.push(t(i))}}const l=this.slider.selectAll("g.tick").data(o),a=l.enter().append("g").attr("class","tick");a.append("text").attr("class","tick-text"),a.append("line").attr("class","tick-line"),a.merge(l).each(function(t,e){const o=s*e;n.select(this).select("text.tick-text").style("font-size",i.fontSize()).attr("x",function(){return 0===e?o-2:e===i.tickCount()-1?o+2:o}).attr("y",i.tickHeight()+i.tickOffset()/2+i.fontSize()).attr("text-basline","text-before-edge").attr("text-anchor",function(){return 0===e?"start":e===i.tickCount()-1?"end":"middle"}).text(()=>t),n.select(this).select("line.tick-line").attr("x1",o).attr("x2",o).attr("y1",i.tickOffset()-1).attr("y2",i.tickOffset()+i.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()}checkChangedValue(){this.prevValue!==this.value()&&void 0!==this.prevValue&&this.change(this),this.prevValue=this.value()}updateHandles(){this.handleLeft.attr("transform",`translate(${this.handleLeftPos}, -28)`).attr("d",t=>this.handlePath("l")),this.handleRight.attr("transform",`translate(${this.handleRightPos}, -28)`).attr("d",t=>this.handlePath("r"))}lowPos(){let 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])}highPos(){let 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])}moveHandleTo(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()}constrain(t){const e=this.xScale.range();return t<e[0]&&(t=e[0]),t>e[1]&&(t=e[1]),this.nearestStep(t)}nearestStep(t){const e=this.xScale.invert(t);return this.xScale(this.low()+Math.round((e-this.low())/this.step())*this.step())}handlePath=s(function(t){const e=+("r"===t),n=e?1:-1,i=this.allowRange()?.5:0;let s="M"+i*n+","+"18A6,6 0 0 "+e+" "+6.5*n+",24V30A6,6 0 0 "+e+" "+i*n+",36";return this.allowRange()?s+="ZM"+2.5*n+",26V28M"+4.5*n+",26V28":s+="M"+1*n+",26V28",s},"handlePath")};s(R,"Slider");let P=R;P.prototype._class+=" form_Slider",P.prototype.implements(e.IInput.prototype),P.prototype.publish("padding",16,"number","Outer Padding",null,{tags:["Basic"]}),P.prototype.publish("fontSize",12,"number","Font Size",null,{tags:["Basic"]}),P.prototype.publish("fontFamily",null,"string","Font Name",null,{tags:["Basic"]}),P.prototype.publish("fontColor",null,"html-color","Font Color",null,{tags:["Basic"]}),P.prototype.publish("allowRange",!1,"boolean","Allow Range Selection",null,{tags:["Intermediate"]}),P.prototype.publish("low",null,"number","Low",null,{tags:["Intermediate"]}),P.prototype.publish("high",null,"number","High",null,{tags:["Intermediate"]}),P.prototype.publish("step",10,"number","Step",null,{tags:["Intermediate"]}),P.prototype.publish("lowDatetime",null,"string","Low",null,{tags:["Intermediate"]}),P.prototype.publish("highDatetime",null,"string","High",null,{tags:["Intermediate"]}),P.prototype.publish("selectionLabel","","string","Selection Label",null,{tags:["Intermediate"]}),P.prototype.publish("timePattern","%Y-%m-%d","string"),P.prototype.publish("tickCount",10,"number"),P.prototype.publish("tickOffset",5,"number"),P.prototype.publish("tickHeight",8,"number"),P.prototype.publish("tickDateFormat",null,"string"),P.prototype.publish("tickValueFormat",",.0f","string");const O=P.prototype.name;P.prototype.name=function(t){const e=O.apply(this,arguments);if(arguments.length){const e=t instanceof Array?t:[t];n.SVGWidget.prototype.columns.call(this,e)}return e};const L=P.prototype.value;P.prototype.value=function(t){const e=L.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]};const C=class _TextArea extends m{constructor(){super(),this._tag="div",this.type("textarea")}enter(t,e){super.enter(t,e)}calcHeight(){return Math.max(this.minHeight_exists()?this.minHeight():0,this.height())}update(t,e){super.update(t,e),this._inputElement[0].attr("rows",this.rows()).attr("cols",this.cols()).attr("wrap",this.wrap()).attr("spellcheck",this.spellcheck()).style("height",this.calcHeight()+"px")}};s(C,"TextArea");let F=C;F.prototype._class+=" form_TextArea",F.prototype.publish("rows",null,"number","Rows",null,{optional:!0}),F.prototype.publish("cols",null,"number","Columns",null,{optional:!0}),F.prototype.publish("wrap","off","set","Wrap",["off","on"]),F.prototype.publish("minHeight",null,"number","Minimum Height",null,{optional:!0}),F.prototype.publish("spellcheck",null,"boolean","Input spell checking",{optional:!0}),t.BUILD_VERSION="3.20.0",t.Button=l,t.CheckBox=r,t.ColorInput=h,t.FieldForm=g,t.Form=c,t.Input=m,t.InputRange=b,t.OnOff=v,t.PKG_NAME="@hpcc-js/form",t.PKG_VERSION="3.3.10",t.Radio=E,t.Range=w,t.Select=I,t.Slider=P,t.TextArea=F,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})});
|
|
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=Object.defineProperty,s=(t,e)=>i(t,"name",{value:e,configurable:!0});const o=class _Button extends n.HTMLWidget{_inputElement=[];constructor(){super(),e.IInput.call(this),this._tag="div"}enter(t,e){super.enter(t,e);const n=this;this._inputElement[0]=e.append("button").attr("name",this.name()).on("click",function(t){t.click(t)}).on("blur",function(t){t.blur(t)}).on("change",function(t){n.value([n._inputElement[0].property("value")]),t.change(t,!0)})}update(t,e){super.update(t,e),this._inputElement[0].text(this.value())}};s(o,"Button");let l=o;l.prototype._class+=" form_Button",l.prototype.implements(e.IInput.prototype);const a=class _CheckBox extends n.HTMLWidget{_inputElement=[];constructor(){super(),e.IInput.call(this),this._tag="div"}enter(t,e){super.enter(t,e);const n=this,i=e.append("ul");this.selectOptions().length||this.selectOptions().push(""),this.selectOptions().forEach(function(t,e){n._inputElement[e]=i.append("li").append("input").attr("type","checkbox"),n._inputElement[e].node().insertAdjacentHTML("afterend","<text>"+t+"</text>")}),this._inputElement.forEach(function(t,e){t.attr("name",n.name()),t.on("click",function(t){t.click(t)}),t.on("blur",function(t){t.blur(t)}),t.on("change",function(t){const e=[];n._inputElement.forEach(function(t){t.property("checked")&&e.push(t.property("value"))}),n.value(e),t.change(t,!0)})})}update(t,e){super.update(t,e);const n=this;this._inputElement.forEach(function(t,e){t.property("value",n.selectOptions()[e]),-1!==n.value().indexOf(n.selectOptions()[e])&&"false"!==n.value()?t.property("checked",!0):t.property("checked",!1)})}insertSelectOptions(t){let e="";t.length>0?t.forEach(function(t){const 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)}};s(a,"CheckBox");let r=a;r.prototype._class+=" form_CheckBox",r.prototype.implements(e.IInput.prototype),r.prototype.publish("selectOptions",[],"array","Array of options used to fill a dropdown list");const p=class _ColorInput extends n.HTMLWidget{_inputElement=[];constructor(){super(),e.IInput.call(this),this._tag="div"}enter(t,e){super.enter(t,e);const i=this;this._inputElement[0]=e.append("input").attr("type","text"),this._inputElement[0].classed("color-text",!0),this._inputElement[1]=e.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?(i._inputElement[1].property("value",n.rgb(i._inputElement[0].property("value")).toString()),i.value(i._inputElement[0].property("value"))):(i._inputElement[0].property("value",i._inputElement[1].property("value")),i.value(n.rgb(i._inputElement[1].property("value")).toString())),t.change(t,!0)})})}update(t,e){super.update(t,e);const i=this;this._inputElement.forEach(function(t){t.attr("name",i.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());const s=this._inputElement[0].node().getBoundingClientRect();this._inputElement[1].style("height",s.height-2+"px")}};s(p,"ColorInput");let h=p;h.prototype._class+=" form_ColorInput",h.prototype.implements(e.IInput.prototype);const u=class _Form extends n.HTMLWidget{tbody;tfoot;btntd;_controls;_maxCols;constructor(){super(),this._tag="form"}data(t){if(!arguments.length){const t=[];return this.inputsForEach(function(e){t.push(e.value())}),t}return this.inputsForEach(function(e,n){t&&t.length>n&&e.value(t[n]).render()}),this}inputsForEach(t,e){let i=0;this.inputs().forEach(function(s){(s instanceof n.WidgetArray?s.content():[s]).forEach(function(n){e?t.call(e,n,i++):t(n,i++)})})}inputsMap(){const t={};return this.inputs().forEach(function(e){t[e.name()]=e}),t}calcMaxColumns(){let t=0;return this.inputs().forEach(function(e){const i=e instanceof n.WidgetArray?e.content():[e];i.length>t&&(t=i.length)}),t}values(t){if(!arguments.length){const t={};return this.inputsForEach(function(e){const n=e.type?e.type():"text";if(e.value()||!this.omitBlank())switch(n){case"checkbox":t[e.name()]=e.value_exists()?!!e.value():void 0;break;case"number":const n=e.value();t[e.name()]=""===n?void 0:+n;break;default:t[e.name()]=e.value_exists()?e.value():void 0}},this),t}return this.inputsForEach(function(e){t[e.name()]?e.value(t[e.name()]):this.omitBlank()&&e.value("")},this),this}submit(){let 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)}clear(){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()}})}checkValidation(){let t=!0;const 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}enter(t,e){super.enter(t,e),e.on("submit",function(){n.d3Event().preventDefault()}),this._placeholderElement.style("overflow","auto");const i=e.append("table");this.tbody=i.append("tbody"),this.tfoot=i.append("tfoot"),this.btntd=this.tfoot.append("tr").append("td").attr("colspan",2);const s=this;this._controls=[(new l).classed({default:!0}).value("Submit").on("click",function(){s.submit()},!0),(new l).value("Clear").on("click",function(){s.clear()},!0)];const o=s.btntd.append("div").style("float","right");this._controls.forEach(function(t){const e=o.append("span").style("float","left");t.target(e.node()).render()})}update(t,e){super.update(t,e),this._maxCols=this.calcMaxColumns();const i=this,s=this.tbody.selectAll("tr").data(this.inputs());s.enter().append("tr").each(function(t,e){const s=n.select(this),o=t instanceof n.WidgetArray?t.content():[t];o.forEach(function(t,e){s.append("td").attr("class","prompt");const l=s.append("td").attr("class","input");if(e===o.length-1&&o.length<i._maxCols&&l.attr("colspan",2*(i._maxCols-o.length+1)),t.target(l.node()).render(),t instanceof n.SVGWidget){const e=t.element().node().getBBox();l.style("height",e.height+"px"),t.resize().render()}t._inputElement instanceof Array&&t._inputElement.forEach(function(t){t.on("keyup.form",function(t){setTimeout(function(){i._controls[0].disable(!i.allowEmptyRequest()&&!i.inputs().some(function(t){return-1!==t._class.indexOf("WidgetArray")?t.content().some(function(t){return t.hasValue()}):t.hasValue()}))},100)})})})}).merge(s).each(function(t,e){const i=n.select(this);(t instanceof n.WidgetArray?t.content():[t]).forEach(function(t,e){i.select("td.prompt").text(t.label()+":")})}),s.each(function(t,e){0===e&&t.setFocus&&t.setFocus()}),s.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(){i._controls[0].disable(!i.allowEmptyRequest()&&!i.inputs().some(function(t){return-1!==t._class.indexOf("WidgetArray")?t.content().some(function(t){return t.hasValue()}):t.hasValue()}))},100)}exit(t,e){this.inputsForEach(t=>t.target(null)),super.exit(t,e)}click(t,e,n){}};s(u,"Form");let c=u;c.prototype._class+=" form_Form",c.prototype.publish("validate",!0,"boolean","Enable/Disable input validation"),c.prototype.publish("inputs",[],"widgetArray","Array of input widgets",null,{render:!1}),c.prototype.publish("showSubmit",!0,"boolean","Show Submit/Cancel Controls"),c.prototype.publish("omitBlank",!1,"boolean","Drop Blank Fields From Submit"),c.prototype.publish("allowEmptyRequest",!1,"boolean","Allow Blank Form to be Submitted");const d=class _Input extends n.HTMLWidget{_inputElement=[];_labelElement=[];constructor(){super(),e.IInput.call(this),this._tag="div"}checked(t){return arguments.length?(this._inputElement[0]&&this._inputElement[0].property("checked",t),this):!!this._inputElement[0]&&this._inputElement[0].property("checked")}enter(t,e){super.enter(t,e),this._labelElement[0]=e.append("label").attr("for",this.id()+"_input").style("visibility",this.inlineLabel_exists()?"visible":"hidden");const n=this;switch(this.type()){case"button":this._inputElement[0]=e.append("button").attr("id",this.id()+"_input");break;case"textarea":this._inputElement[0]=e.append("textarea").attr("id",this.id()+"_input");break;default:this._inputElement[0]=e.append("input").attr("id",this.id()+"_input").attr("type",this.type())}this._inputElement.forEach(function(t,e){t.attr("name",n.name()),t.on("click",function(t){t.click(t)}),t.on("blur",function(t){t.blur(t)}),t.on("change",function(e){n.value([t.property("value")]),e.change(e,!0)}),t.on("keyup",function(e){n.value([t.property("value")]),e.change(e,!1)})})}update(t,e){switch(super.update(t,e),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())}}blur(t){}keyup(t){}focus(t){}click(t){}dblclick(t){}change(t,e){}};s(d,"Input");let m=d;m.prototype._class+=" form_Input",m.prototype.implements(e.IInput.prototype),m.prototype.publish("type","text","set","Input type",["string","number","boolean","date","time","hidden","nested","button","checkbox","text","textarea","search","email","datetime"]),m.prototype.publish("inlineLabel",null,"string","Input Label",null,{optional:!0});const f=class _FieldForm extends c{constructor(){super(),this._tag="form"}fields(t){const e=super.fields.apply(this,arguments);if(arguments.length){const e=this.inputsMap();this.inputs(t.map(t=>e[t.id()]||(new m).name(t.id()).label(t.label()).type(t.type())))}return e}data(t){if(!arguments.length)return super.data();if(super.data(t[0]),t[0]){const e=this.inputs(),n=t[0][this.columns().length];let i=0;for(const t in n)e[i].name(t),++i}return this}};s(f,"FieldForm");let g=f;g.prototype._class+=" form_FieldForm";const y=class _InputRange extends n.HTMLWidget{_inputElement=[];_labelElement=[];_rangeData=[];constructor(){super(),e.IInput.call(this),this._tag="div"}enter(t,e){super.enter(t,e),this._labelElement[0]=e.append("label").attr("for",this.id()+"_input").style("visibility",this.inlineLabel_exists()?"visible":"hidden"),this._inputElement.push(e.append("input").attr("id",this.id()+"_input_min").attr("type",this.type())),this._inputElement.push(e.append("input").attr("id",this.id()+"_input_max").attr("type",this.type()));const n=this;this._inputElement.forEach(function(t,e){t.attr("name",n.name()),t.on("click",function(t){t.click(t)}),t.on("blur",function(t){t.blur(t)}),t.on("change",function(i){n._rangeData[e]=t.property("value"),n.value(n._rangeData),i.change(i,!0)})})}update(t,e){super.update(t,e),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)}};s(y,"InputRange");let b=y;b.prototype._class+=" form_InputRange",b.prototype.implements(e.IInput.prototype),b.prototype.publish("type","text","set","InputRange type",["number","date","text","time","datetime","hidden"]),b.prototype.publish("inlineLabel",null,"string","InputRange Label",null,{optional:!0}),b.prototype.publish("value",["",""],"array","Input Current Value",null,{override:!0});const _=class _OnOff extends n.HTMLWidget{_inputElement=[];_input;constructor(){super(),e.IInput.call(this),this._tag="div"}enter(t,e){super.enter(t,e),e.classed("onoffswitch",!0);const n=this;this._input=e.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){const e=[];n._inputElement.forEach(function(t,n){t.property("checked")&&e.push(t.property("value"))}),n.value(e),t.change(t,!0)});const i=e.append("label").attr("class","onoffswitch-label").attr("for",this.id()+"_onOff"),s=i.append("div").attr("class","onoffswitch-inner");s.append("div").attr("class","onoffswitch-offText").style("padding-right",this.containerRadius()/2+"px").text(this.offText()),s.append("div").attr("class","onoffswitch-onText").style("padding-left",this.containerRadius()/2+"px").style("width",`calc(100% - ${this.containerRadius()/2}px)`).text(this.onText()),i.append("div").attr("class","onoffswitch-switch")}update(t,e){super.update(t,e),this._input.attr("name",this.name()),e.style("margin-left",this.marginLeft()+"px").style("margin-bottom",this.marginBottom()+"px").style("width",this.minWidth()+"px");const n=this.minHeight()-4*this.gutter();e.select(".onoffswitch-switch").style("height",n+"px").style("width",n+"px").style("top",2*this.gutter()+1+"px").style("border-radius",this.switchRadius()+"px"),e.select(".onoffswitch-inner").style("min-height",this.minHeight()+"px"),e.select(".onoffswitch-label").style("border-radius",this.containerRadius()+"px"),e.select(".onoffswitch-offText").style("color",this.offFontColor()).style("background-color",this.offColor()),e.select(".onoffswitch-onText").style("color",this.onFontColor()).style("background-color",this.onColor())}};s(_,"OnOff");let v=_;v.prototype._class+=" form_OnOff",v.prototype.implements(e.IInput.prototype),v.prototype.publish("marginLeft",0,"number","Margin left of OnOff"),v.prototype.publish("marginBottom",0,"number","Margin bottom of OnOff"),v.prototype.publish("minWidth",100,"number","Minimum width of OnOff (pixels)"),v.prototype.publish("minHeight",20,"number","Minimum height of OnOff (pixels)"),v.prototype.publish("gutter",1,"number","Space between switch and border of OnOff (pixels)"),v.prototype.publish("onText","Save","string","Text to display when 'ON'"),v.prototype.publish("offText","Properties","string","Text to display when 'OFF'"),v.prototype.publish("switchRadius",10,"number","Border radius of switch (pixels)"),v.prototype.publish("containerRadius",10,"number","Border radius of OnOff (pixels)"),v.prototype.publish("onColor","#2ecc71","html-color","Background color when 'ON'"),v.prototype.publish("offColor","#ecf0f1","html-color","Background color when 'OFF'"),v.prototype.publish("onFontColor","#2c3e50","html-color","Font color when 'ON'"),v.prototype.publish("offFontColor","#7f8c8d","html-color","Font color when 'OFF'");const x=class _Radio extends n.HTMLWidget{_inputElement=[];constructor(){super(),e.IInput.call(this),this._tag="div"}enter(t,e){super.enter(t,e);const n=this,i=e.append("ul");this.selectOptions().length||this.selectOptions().push(""),this.selectOptions().forEach(function(t,e){n._inputElement[e]=i.append("li").append("input").attr("type","radio"),n._inputElement[e].node().insertAdjacentHTML("afterend","<text>"+t+"</text>")}),this._inputElement.forEach(function(t,e){t.attr("name",n.name()),t.on("click",function(t){t.click(t)}),t.on("blur",function(t){t.blur(t)}),t.on("change",function(e){n.value([t.property("value")]),e.change(e,!0)})})}update(t,e){super.update(t,e);const n=this;this._inputElement.forEach(function(t,e){t.property("value",n.selectOptions()[e]),-1!==n.value().indexOf(n.selectOptions()[e])&&"false"!==n.value()?t.property("checked",!0):t.property("checked",!1)})}};s(x,"Radio");let E=x;E.prototype._class+=" form_Radio",E.prototype.implements(e.IInput.prototype),E.prototype.publish("selectOptions",[],"array","Array of options used to fill a dropdown list");const k=class _Range extends n.HTMLWidget{_inputElement=[];constructor(){super(),e.IInput.call(this),this._tag="div"}enter(t,e){super.enter(t,e);const i=this;this._inputElement[0]=e.append("input").attr("type","range"),this._inputElement[1]=e.append("input").attr("type","number"),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){0===e?(i._inputElement[1].property("value",n.rgb(i._inputElement[0].property("value")).toString()),i.value(i._inputElement[0].property("value"))):(i._inputElement[0].property("value",i._inputElement[1].property("value")),i.value(n.rgb(i._inputElement[1].property("value")).toString())),t.change(t,!0)})})}update(t,e){super.update(t,e),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())}insertSelectOptions(t){let e="";t.length>0?t.forEach(function(t){const 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)}};s(k,"Range");let w=k;w.prototype._class+=" form_Range",w.prototype.implements(e.IInput.prototype),w.prototype.publish("type","text","set","Input type",["html-color","number","checkbox","button","select","textarea","date","text","range","search","email","time","datetime"]),w.prototype.publish("selectOptions",[],"array","Array of options used to fill a dropdown list"),w.prototype.publish("low",null,"number","Minimum value for Range input"),w.prototype.publish("high",null,"number","Maximum value for Range input"),w.prototype.publish("step",null,"number","Step value for Range input");const S=class _Select extends n.HTMLWidget{_inputElement=[];constructor(){super(),e.IInput.call(this),this._tag="div"}enter(t,e){super.enter(t,e);const n=this;this._inputElement[0]=e.append("select").attr("name",this.name()).on("click",function(t){t.click(t)}).on("blur",function(t){t.blur(t)}).on("change",function(t){n.value([n._inputElement[0].property("value")]),t.change(t,!0)})}update(t,e){super.update(t,e),this.insertSelectOptions(this.selectOptions()),this._inputElement[0].property("value",this.value()).style("max-width",this.maxWidth_exists()?this.maxWidth()+"px":null)}insertSelectOptions(t){let e="";t.length>0?t.forEach(function(t){const 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)}};s(S,"Select");let I=S;I.prototype._class+=" form_Select",I.prototype.implements(e.IInput.prototype),I.prototype.publish("selectOptions",[],"array","Array of options used to fill a dropdown list"),I.prototype.publish("maxWidth",120,"number","Width",null,{optional:!0});const R=class _Slider extends n.SVGWidget{xScale;moveMode;moveStartPos;prevValue;slider;handleLeft;handleLeftPos=0;handleLeftStartPos;handleRight;handleRightPos=0;handleRightStartPos;constructor(){super(),e.IInput.call(this)}enter(t,e){if(super.enter(t,e),this.resize({width:this.width(),height:50}),this.xScale=n.scaleLinear().clamp(!0),this.slider=e.append("g").attr("class","slider"),null===this.low()&&null===this.high()&&null!==this.lowDatetime()&&null!==this.highDatetime()){const t=n.timeParse(this.timePattern()?this.timePattern():"%Q");this.low(t(this.lowDatetime()).getTime()),this.high(t(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",()=>{const t=n.d3Event();this.moveStartPos=t.x,this.handleLeftStartPos=this.handleLeftPos,this.handleRightStartPos=this.handleRightPos,this.allowRange()&&this.handleLeftPos<=t.x&&t.x<=this.handleRightPos?this.moveMode="both":Math.abs(t.x-this.handleLeftPos)<Math.abs(t.x-this.handleRightPos)?this.moveMode="left":this.moveMode="right",this.moveHandleTo(t.x)}).on("drag",()=>{this.moveHandleTo(n.d3Event().x)}).on("end",()=>{this.moveHandleTo(n.d3Event().x),this.data([[this.xScale.invert(this.handleLeftPos),this.xScale.invert(this.handleRightPos)]]),this.checkChangedValue()})),this.slider.insert("g",".track-overlay").attr("class","ticks").attr("transform",`translate(0, ${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")}update(t,e){super.update(t,e);const i=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]);const s=(this.width()-2*this.padding())/(this.tickCount()-1),o=[];if(null!==this.tickDateFormat()&&null!==this.timePattern()){const t=n.timeParse("%Q"),e=n.timeFormat(this.tickDateFormat()),i=(this.high()-this.low())/(this.tickCount()-1);for(let n=0;n<this.tickCount();n++){const s=t(""+(this.low()+i*n));o.push(e(s))}}else{const t=n.format(this.tickValueFormat()),e=(this.high()-this.low())/(this.tickCount()-1);for(let n=0;n<this.tickCount();n++){const i=this.low()+e*n;o.push(t(i))}}const l=this.slider.selectAll("g.tick").data(o),a=l.enter().append("g").attr("class","tick");a.append("text").attr("class","tick-text"),a.append("line").attr("class","tick-line"),a.merge(l).each(function(t,e){const o=s*e;n.select(this).select("text.tick-text").style("font-size",i.fontSize()).attr("x",function(){return 0===e?o-2:e===i.tickCount()-1?o+2:o}).attr("y",i.tickHeight()+i.tickOffset()/2+i.fontSize()).attr("text-basline","text-before-edge").attr("text-anchor",function(){return 0===e?"start":e===i.tickCount()-1?"end":"middle"}).text(()=>t),n.select(this).select("line.tick-line").attr("x1",o).attr("x2",o).attr("y1",i.tickOffset()-1).attr("y2",i.tickOffset()+i.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()}checkChangedValue(){this.prevValue!==this.value()&&void 0!==this.prevValue&&this.change(this),this.prevValue=this.value()}updateHandles(){this.handleLeft.attr("transform",`translate(${this.handleLeftPos}, -28)`).attr("d",t=>this.handlePath("l")),this.handleRight.attr("transform",`translate(${this.handleRightPos}, -28)`).attr("d",t=>this.handlePath("r"))}lowPos(){let 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])}highPos(){let 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])}moveHandleTo(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()}constrain(t){const e=this.xScale.range();return t<e[0]&&(t=e[0]),t>e[1]&&(t=e[1]),this.nearestStep(t)}nearestStep(t){const e=this.xScale.invert(t);return this.xScale(this.low()+Math.round((e-this.low())/this.step())*this.step())}handlePath=s(function(t){const e=+("r"===t),n=e?1:-1,i=this.allowRange()?.5:0;let s="M"+i*n+","+"18A6,6 0 0 "+e+" "+6.5*n+",24V30A6,6 0 0 "+e+" "+i*n+",36";return this.allowRange()?s+="ZM"+2.5*n+",26V28M"+4.5*n+",26V28":s+="M"+1*n+",26V28",s},"handlePath")};s(R,"Slider");let P=R;P.prototype._class+=" form_Slider",P.prototype.implements(e.IInput.prototype),P.prototype.publish("padding",16,"number","Outer Padding",null,{tags:["Basic"]}),P.prototype.publish("fontSize",12,"number","Font Size",null,{tags:["Basic"]}),P.prototype.publish("fontFamily",null,"string","Font Name",null,{tags:["Basic"]}),P.prototype.publish("fontColor",null,"html-color","Font Color",null,{tags:["Basic"]}),P.prototype.publish("allowRange",!1,"boolean","Allow Range Selection",null,{tags:["Intermediate"]}),P.prototype.publish("low",null,"number","Low",null,{tags:["Intermediate"]}),P.prototype.publish("high",null,"number","High",null,{tags:["Intermediate"]}),P.prototype.publish("step",10,"number","Step",null,{tags:["Intermediate"]}),P.prototype.publish("lowDatetime",null,"string","Low",null,{tags:["Intermediate"]}),P.prototype.publish("highDatetime",null,"string","High",null,{tags:["Intermediate"]}),P.prototype.publish("selectionLabel","","string","Selection Label",null,{tags:["Intermediate"]}),P.prototype.publish("timePattern","%Y-%m-%d","string"),P.prototype.publish("tickCount",10,"number"),P.prototype.publish("tickOffset",5,"number"),P.prototype.publish("tickHeight",8,"number"),P.prototype.publish("tickDateFormat",null,"string"),P.prototype.publish("tickValueFormat",",.0f","string");const O=P.prototype.name;P.prototype.name=function(t){const e=O.apply(this,arguments);if(arguments.length){const e=t instanceof Array?t:[t];n.SVGWidget.prototype.columns.call(this,e)}return e};const L=P.prototype.value;P.prototype.value=function(t){const e=L.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]};const C=class _TextArea extends m{constructor(){super(),this._tag="div",this.type("textarea")}enter(t,e){super.enter(t,e)}calcHeight(){return Math.max(this.minHeight_exists()?this.minHeight():0,this.height())}update(t,e){super.update(t,e),this._inputElement[0].attr("rows",this.rows()).attr("cols",this.cols()).attr("wrap",this.wrap()).attr("spellcheck",this.spellcheck()).style("height",this.calcHeight()+"px")}};s(C,"TextArea");let F=C;F.prototype._class+=" form_TextArea",F.prototype.publish("rows",null,"number","Rows",null,{optional:!0}),F.prototype.publish("cols",null,"number","Columns",null,{optional:!0}),F.prototype.publish("wrap","off","set","Wrap",["off","on"]),F.prototype.publish("minHeight",null,"number","Minimum Height",null,{optional:!0}),F.prototype.publish("spellcheck",null,"boolean","Input spell checking",{optional:!0}),t.BUILD_VERSION="3.21.2",t.Button=l,t.CheckBox=r,t.ColorInput=h,t.FieldForm=g,t.Form=c,t.Input=m,t.InputRange=b,t.OnOff=v,t.PKG_NAME="@hpcc-js/form",t.PKG_VERSION="3.4.1",t.Radio=E,t.Range=w,t.Select=I,t.Slider=P,t.TextArea=F,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})});
|
|
2
2
|
//# sourceMappingURL=index.umd.cjs.map
|
|
3
3
|
!function(){"use strict";try{if("undefined"!=typeof document){var o=document.createElement("style");o.appendChild(document.createTextNode(".form_Input input,.form_Input select,.form_Input button,.form_Input textarea{padding:2px}.form_Input button{cursor:pointer}.form_Input input.color-text{width:120px}.form_Input input.color-text+input{width:57px;position:absolute}.form_Input textarea,.form_Input input[type=textbox]{width:100%;box-sizing:border-box;display:block}.form_Input ul{list-style-type:none;float:left;padding:0;margin:0}.form_Input li{float:left;list-style-position:inside}.form_Form{color:#404040}.form_Form tbody td{white-space:nowrap;border:1px solid #E5E5E5}.form_Form td.prompt{padding:2px;vertical-align:middle;background-color:#e5e5e5}.form_Form td.input{padding:2px;width:100%;vertical-align:middle}.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{background-position:-1px -1px;box-sizing:border-box;color:#24292e;cursor:pointer;height:28px;inset:0;overflow-wrap:break-word;position:relative;text-decoration:none solid rgb(36,41,46);vertical-align:middle;white-space:nowrap;word-wrap:break-word;column-rule-color:#24292e;perspective-origin:57.2938px 14px;transform-origin:57.2938px 14px;-webkit-user-select:none;user-select:none;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;outline:rgb(36,41,46) none 0px;padding:3px 10px}.form_Form .form_Button button[disabled=disabled]{background:#dbdfe2}.form_Form .form_Button button:focus{box-shadow:0 0 0 .2em #0366d64d}.form_Form .form_Button button:hover{background:#dbdfe2}.form_Form .form_Button.default button{color:#fff;text-decoration:none solid rgb(255,255,255);word-wrap:break-word;column-rule-color:#fff;perspective-origin:44.975px 17px;transform-origin:44.975px 17px;background:#28a745 linear-gradient(-180deg,#34d058,#28a745 90%) repeat-x scroll -1px -1px / 110% 110% padding-box border-box;outline:rgb(255,255,255) none 0px}.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}.onoffswitch-checkbox{display:none}.onoffswitch{position:relative;height:20px;width:100px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.onoffswitch-label{display:block;overflow:hidden;cursor:pointer;border:1px solid #999999;height:20px}.onoffswitch-inner{position:relative;display:block;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;transition:all .3s ease-in 0s;width:100%;text-align:right}.onoffswitch-inner>.onoffswitch-onText{font-weight:700;position:absolute;left:-100%;transition:all .3s ease-in 0s;width:100%;text-align:left}.onoffswitch-switch{display:block;width:20px;margin:-1px;background:#fff;position:absolute;border:1px solid #999999;transition:all .3s ease-in 0s;inset:0 78px 0 4px}.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)}.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{pointer-events:stroke;stroke-width:50px;stroke:transparent;cursor:crosshair}.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}")),document.head.appendChild(o)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}}();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hpcc-js/form",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.1",
|
|
4
4
|
"description": "hpcc-js - Viz Form",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.umd.cjs",
|
|
@@ -37,12 +37,12 @@
|
|
|
37
37
|
"update-major": "npx --yes npm-check-updates -u"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@hpcc-js/api": "^3.4.
|
|
41
|
-
"@hpcc-js/chart": "^3.
|
|
42
|
-
"@hpcc-js/common": "^3.7.
|
|
40
|
+
"@hpcc-js/api": "^3.4.12",
|
|
41
|
+
"@hpcc-js/chart": "^3.7.1",
|
|
42
|
+
"@hpcc-js/common": "^3.7.2"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@hpcc-js/esbuild-plugins": "^1.8.
|
|
45
|
+
"@hpcc-js/esbuild-plugins": "^1.8.4",
|
|
46
46
|
"d3-brush": "^1",
|
|
47
47
|
"d3-color": "3.1.0",
|
|
48
48
|
"d3-drag": "^1",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"url": "https://github.com/hpcc-systems/Visualization/issues"
|
|
61
61
|
},
|
|
62
62
|
"homepage": "https://github.com/hpcc-systems/Visualization",
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "04460c76008934053c9957c361693aac862ca7dc"
|
|
64
64
|
}
|
package/src/Form.css
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
.form_Form {
|
|
2
|
-
color
|
|
2
|
+
color: #404040;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
.form_Form tbody td {
|
|
6
6
|
white-space: nowrap;
|
|
7
|
-
border:1px solid #E5E5E5;
|
|
7
|
+
border: 1px solid #E5E5E5;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
.form_Form td.prompt {
|
|
11
|
-
padding:2px;
|
|
12
|
-
vertical-align:middle;
|
|
13
|
-
background-color
|
|
11
|
+
padding: 2px;
|
|
12
|
+
vertical-align: middle;
|
|
13
|
+
background-color: #E5E5E5;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
.form_Form td.input {
|
|
17
|
-
padding:2px;
|
|
18
|
-
width:100%;
|
|
19
|
-
vertical-align:middle;
|
|
17
|
+
padding: 2px;
|
|
18
|
+
width: 100%;
|
|
19
|
+
vertical-align: middle;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
.form_Form td.input .common_HTMLWidget ul{
|
|
23
|
-
margin:0px;
|
|
22
|
+
.form_Form td.input .common_HTMLWidget ul {
|
|
23
|
+
margin: 0px;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
.form_Form tfoot button{
|
|
27
|
-
margin:5px;
|
|
26
|
+
.form_Form tfoot button {
|
|
27
|
+
margin: 5px;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
.form_Form tbody tr:hover {
|
|
31
|
-
background-color
|
|
31
|
+
background-color: #FAFAFA;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
.form_Form .form_Button button {
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
.form_Form .form_Button button:focus {
|
|
66
|
-
box-shadow: 0 0 0 0.2em rgba(3,102,214,0.3)
|
|
66
|
+
box-shadow: 0 0 0 0.2em rgba(3, 102, 214, 0.3)
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
.form_Form .form_Button button:hover {
|
|
@@ -88,5 +88,4 @@
|
|
|
88
88
|
|
|
89
89
|
.form_Form .form_Button.default button:hover {
|
|
90
90
|
background: rgb(20, 147, 49);
|
|
91
|
-
}
|
|
92
|
-
|
|
91
|
+
}
|
package/src/Input.css
CHANGED
|
@@ -1,32 +1,33 @@
|
|
|
1
1
|
.form_Input input,
|
|
2
2
|
.form_Input select,
|
|
3
3
|
.form_Input button,
|
|
4
|
-
.form_Input textarea{
|
|
5
|
-
padding:2px;
|
|
4
|
+
.form_Input textarea {
|
|
5
|
+
padding: 2px;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
.form_Input button{
|
|
9
|
-
cursor:pointer;
|
|
8
|
+
.form_Input button {
|
|
9
|
+
cursor: pointer;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
.form_Input input.color-text{
|
|
13
|
-
width:120px;
|
|
12
|
+
.form_Input input.color-text {
|
|
13
|
+
width: 120px;
|
|
14
14
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
|
|
16
|
+
.form_Input input.color-text+input {
|
|
17
|
+
width: 57px;
|
|
18
|
+
position: absolute;
|
|
18
19
|
}
|
|
19
20
|
|
|
20
|
-
.form_Input textarea{
|
|
21
|
-
width:100%;
|
|
21
|
+
.form_Input textarea {
|
|
22
|
+
width: 100%;
|
|
22
23
|
box-sizing: border-box;
|
|
23
|
-
display:block;
|
|
24
|
+
display: block;
|
|
24
25
|
}
|
|
25
26
|
|
|
26
|
-
.form_Input input[type="textbox"]{
|
|
27
|
-
width:100%;
|
|
27
|
+
.form_Input input[type="textbox"] {
|
|
28
|
+
width: 100%;
|
|
28
29
|
box-sizing: border-box;
|
|
29
|
-
display:block;
|
|
30
|
+
display: block;
|
|
30
31
|
}
|
|
31
32
|
|
|
32
33
|
.form_Input ul {
|
package/src/OnOff.css
CHANGED
|
@@ -1,55 +1,75 @@
|
|
|
1
1
|
.onoffswitch-checkbox {
|
|
2
2
|
display: none;
|
|
3
3
|
}
|
|
4
|
+
|
|
4
5
|
.onoffswitch {
|
|
5
|
-
position: relative;
|
|
6
|
-
|
|
6
|
+
position: relative;
|
|
7
|
+
height: 20px;
|
|
8
|
+
width: 100px;
|
|
9
|
+
-webkit-user-select: none;
|
|
10
|
+
-moz-user-select: none;
|
|
11
|
+
-ms-user-select: none;
|
|
7
12
|
}
|
|
13
|
+
|
|
8
14
|
.onoffswitch-label {
|
|
9
|
-
display: block;
|
|
15
|
+
display: block;
|
|
16
|
+
overflow: hidden;
|
|
17
|
+
cursor: pointer;
|
|
10
18
|
border: 1px solid #999999;
|
|
11
19
|
height: 20px;
|
|
12
20
|
}
|
|
21
|
+
|
|
13
22
|
.onoffswitch-inner {
|
|
14
23
|
position: relative;
|
|
15
24
|
display: block;
|
|
16
25
|
transition: margin 0.3s ease-in 0s;
|
|
17
26
|
}
|
|
18
|
-
|
|
19
|
-
.onoffswitch-inner
|
|
27
|
+
|
|
28
|
+
.onoffswitch-inner>.onoffswitch-offText,
|
|
29
|
+
.onoffswitch-inner>.onoffswitch-onText {
|
|
20
30
|
height: 100%;
|
|
21
31
|
}
|
|
22
|
-
|
|
32
|
+
|
|
33
|
+
.onoffswitch-inner>.onoffswitch-offText {
|
|
23
34
|
font-weight: bold;
|
|
24
35
|
position: absolute;
|
|
25
36
|
right: 0;
|
|
26
|
-
transition: all 0.3s ease-in 0s;
|
|
37
|
+
transition: all 0.3s ease-in 0s;
|
|
27
38
|
width: 100%;
|
|
28
39
|
text-align: right;
|
|
29
40
|
}
|
|
30
|
-
|
|
41
|
+
|
|
42
|
+
.onoffswitch-inner>.onoffswitch-onText {
|
|
31
43
|
font-weight: bold;
|
|
32
44
|
position: absolute;
|
|
33
45
|
left: -100%;
|
|
34
|
-
transition: all 0.3s ease-in 0s;
|
|
46
|
+
transition: all 0.3s ease-in 0s;
|
|
35
47
|
width: 100%;
|
|
36
48
|
text-align: left;
|
|
37
49
|
}
|
|
50
|
+
|
|
38
51
|
.onoffswitch-switch {
|
|
39
|
-
display: block;
|
|
52
|
+
display: block;
|
|
53
|
+
width: 20px;
|
|
54
|
+
margin: -1px;
|
|
40
55
|
background: #FFFFFF;
|
|
41
|
-
position: absolute;
|
|
56
|
+
position: absolute;
|
|
57
|
+
top: 0;
|
|
58
|
+
bottom: 0;
|
|
42
59
|
right: 78px;
|
|
43
60
|
border: 1px solid #999999;
|
|
44
|
-
transition: all 0.3s ease-in 0s;
|
|
61
|
+
transition: all 0.3s ease-in 0s;
|
|
45
62
|
left: 4px;
|
|
46
63
|
}
|
|
47
|
-
|
|
64
|
+
|
|
65
|
+
.onoffswitch-checkbox:checked+.onoffswitch-label .onoffswitch-inner>.onoffswitch-offText {
|
|
48
66
|
right: -100%;
|
|
49
67
|
}
|
|
50
|
-
|
|
68
|
+
|
|
69
|
+
.onoffswitch-checkbox:checked+.onoffswitch-label .onoffswitch-inner>.onoffswitch-onText {
|
|
51
70
|
left: 0;
|
|
52
71
|
}
|
|
53
|
-
|
|
72
|
+
|
|
73
|
+
.onoffswitch-checkbox:checked+.onoffswitch-label .onoffswitch-switch {
|
|
54
74
|
left: calc(100% - 20px);
|
|
55
75
|
}
|
package/src/Slider.css
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
1
|
.form_Slider .ticks {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
2
|
+
font: 10px sans-serif;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.form_Slider .track,
|
|
6
|
+
.form_Slider .track-inset,
|
|
7
|
+
.form_Slider .track-overlay {
|
|
8
|
+
stroke-linecap: round;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.form_Slider .track {
|
|
12
|
+
stroke: #000;
|
|
13
|
+
stroke-opacity: 0.3;
|
|
14
|
+
stroke-width: 10px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.form_Slider .track-inset {
|
|
18
|
+
stroke: #ddd;
|
|
19
|
+
stroke-width: 8px;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.form_Slider .track-overlay {
|
|
23
|
+
pointer-events: stroke;
|
|
24
|
+
stroke-width: 50px;
|
|
25
|
+
stroke: transparent;
|
|
26
|
+
cursor: crosshair;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.form_Slider .handle {
|
|
30
|
+
fill: #fff;
|
|
31
|
+
stroke: #000;
|
|
32
|
+
stroke-opacity: 0.5;
|
|
33
|
+
stroke-width: 1.25px;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.form_Slider .tick-line {
|
|
37
|
+
stroke: #000;
|
|
38
|
+
stroke-opacity: 0.5;
|
|
39
|
+
stroke-width: 1px;
|
|
40
|
+
shape-rendering: crispEdges;
|
|
41
|
+
}
|