adaptivecards-controls
Advanced tools
Comparing version 0.1.4 to 0.1.5
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("ACControls",[],t):"object"==typeof exports?exports.ACControls=t():e.ACControls=t()}(this,function(){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/dist/",n(n.s=7)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KEY_TAB=9,t.KEY_ENTER=13,t.KEY_ESCAPE=27,t.KEY_UP=38,t.KEY_DOWN=40,t.KEY_DELETE=46},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(){}return e.prototype.validateRootElement=function(e){},e.prototype.keyDown=function(e){},Object.defineProperty(e.prototype,"rootElement",{get:function(){return this._rootElement},enumerable:!0,configurable:!0}),e.prototype.attach=function(e){var t=this;this.validateRootElement(e),this._rootElement=e,this._rootElement.onkeydown=function(e){t.keyDown(e)}},e}();t.InputControl=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(5),r=function(){function e(){}return e.getLongDayName=function(t){if(t>=0&&t<e.longDayNames.length)return e.longDayNames[t];throw new Error("Day index out of range: "+t)},e.getShortDayName=function(t){if(t>=0&&t<e.shortDayNames.length)return e.shortDayNames[t];throw new Error("Day index out of range: "+t)},e.getInitialDayName=function(t){if(t>=0&&t<e.minimalDayNames.length)return e.minimalDayNames[t];throw new Error("Day index out of range: "+t)},e.getLongMonthName=function(t){if(t>=0&&t<e.longMonthNames.length)return e.longMonthNames[t];throw new Error("Month index out of range: "+t)},e.getShortMonthName=function(t){if(t>=0&&t<e.shortMonthNames.length)return e.shortMonthNames[t];throw new Error("Month index out of range: "+t)},e.monthsInYear=12,e.daysInWeek=7,e.firstDayOfWeek=o.DayOfWeek.Sunday,e.longDayNames=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],e.shortDayNames=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],e.minimalDayNames=["Su","Mo","Tu","We","Th","Fr","Sa"],e.longMonthNames=["January","February","March","April","May","June","July","August","September","October","November","December"],e.shortMonthNames=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],e}();function i(e,t){var n=new Date(e.getTime());return n.setDate(n.getDate()+t),n}t.CalendarSettings=r,t.daysInMonth=function(e,t){switch(t){case 1:return e%4==0&&e%100||e%400==0?29:28;case 3:case 5:case 8:case 10:return 30;default:return 31}},t.addDays=i,t.addMonths=function(e,t){var n=new Date(e.getTime()),o=n.getMonth()+t;return n.setMonth(o),n.getMonth()!==(o%r.monthsInYear+r.monthsInYear)%r.monthsInYear&&(n=i(n,-n.getDate())),n},t.areDatesEqual=function(e,t){return e.getFullYear()==t.getFullYear()&&e.getMonth()==t.getMonth()&&e.getDate()==t.getDate()},t.getScrollX=function(){return window.pageXOffset},t.getScrollY=function(){return window.pageYOffset},t.getAttributeValueAsBool=function(e,t,n){var o=e.attributes[t];return o?"true"===o.value:n},t.getAttributeValueAsString=function(e,t,n){var o=e.attributes[t];return o?o.value:n},t.getAttributeValueAsInt=function(e,t,n){var o=e.attributes[t];if(o){var r=parseInt(o.value);if(!isNaN(r))return r}return n}},function(e,t,n){"use strict";var o=this&&this.__extends||function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function o(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}();Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=n(2),s=n(1),l=function(){function e(){}return e.prototype.close=function(){this.onClose&&this.onClose(this)},e.prototype.keyDown=function(e){switch(e.keyCode){case r.KEY_ESCAPE:this.close()}},e.prototype.render=function(e){var t=this;return this._popupElement=document.createElement("div"),this._popupElement.tabIndex=0,this._popupElement.className="ms-ctrl ms-ctrl-popup-container",this._popupElement.onkeydown=function(e){return t.keyDown(e),!e.cancelBubble},this._popupElement.appendChild(this.renderContent()),this._popupElement},e.prototype.focus=function(){this._popupElement&&this._popupElement.firstElementChild.focus()},e}();t.PopupControl=l;var a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.keyDown=function(e){switch(e.keyCode){case r.KEY_ENTER:this.popup()}},t.prototype.updateLabel=function(){this._labelElement&&(this._value?(this._labelElement.innerHTML=this.getValueAsString(),this._labelElement.classList.remove("placeholder")):(this._labelElement.innerText=this._placeholderText?this._placeholderText:"",this._labelElement.classList.add("placeholder")))},Object.defineProperty(t.prototype,"popupControl",{get:function(){return this._popupControl},enumerable:!0,configurable:!0}),t.prototype.getButtonIconCssClassName=function(){return"ms-icon-chevronDown"},t.prototype.getValueAsString=function(){return this._value.toString()},t.prototype.valueChanged=function(){this.onValueChanged&&this.onValueChanged(this)},t.prototype.attach=function(t){var n=this;e.prototype.attach.call(this,t),t.tabIndex=0,t.className=this.getCssClassName(),window.addEventListener("resize",function(e){n.closePopup()}),this.rootElement.onclick=function(e){n._isOpen?n.closePopup():n.popup()};var o=this.rootElement.attributes.getNamedItem("placeholder");o&&(this._placeholderText=o.value),this._labelElement=document.createElement("span"),this._labelElement.className="ms-ctrl ms-dropdown-label",this._dropDownButtonElement=document.createElement("i"),this._dropDownButtonElement.className="ms-icon ms-ctrl-dropdown-button "+this.getButtonIconCssClassName(),this.rootElement.appendChild(this._labelElement),this.rootElement.appendChild(this._dropDownButtonElement),this.updateLabel()},t.prototype.popup=function(){var e=this;if(!this._isOpen){this._overlayElement=document.createElement("div"),this._overlayElement.className="ms-ctrl-overlay",this._overlayElement.tabIndex=0,this._overlayElement.style.width=document.documentElement.scrollWidth+"px",this._overlayElement.style.height=document.documentElement.scrollHeight+"px",this._overlayElement.onfocus=function(t){e.closePopup()},document.body.appendChild(this._overlayElement),this._popupControl=this.createPopupControl(),this._popupControl.onClose=function(t){e.closePopup(),e.rootElement.focus()};var t=this.rootElement.getBoundingClientRect();this._popupControlElement=this._popupControl.render(t),this._popupControlElement.classList.remove("ms-ctrl-slide","ms-ctrl-slideLeftToRight","ms-ctrl-slideRightToLeft","ms-ctrl-slideTopToBottom","ms-ctrl-slideRightToLeft"),this._overlayElement.appendChild(this._popupControlElement);var n,o=this._popupControlElement.getBoundingClientRect(),r=window.innerHeight-t.bottom,s=t.top,l=t.left+i.getScrollX();if(s<o.height&&r<o.height){var a=Math.min(o.height,window.innerHeight);this._popupControlElement.style.maxHeight=a+"px",n=a<o.height?i.getScrollY():i.getScrollY()+t.top+(t.height-a)/2;var c=window.innerWidth-t.right;if(t.left<o.width&&c<o.width){var u=Math.min(o.width,window.innerWidth);this._popupControlElement.style.maxWidth=u+"px",l=u<o.width?i.getScrollX():i.getScrollX()+t.left+(t.width-u)/2}else c>=o.width?(l=i.getScrollX()+t.right,this._popupControlElement.classList.add("ms-ctrl-slide","ms-ctrl-slideLeftToRight")):(l=i.getScrollX()+t.left-o.width,this._popupControlElement.classList.add("ms-ctrl-slide","ms-ctrl-slideRightToLeft"))}else r>=o.height?(n=i.getScrollY()+t.bottom,this._popupControlElement.classList.add("ms-ctrl-slide","ms-ctrl-slideTopToBottom")):(n=i.getScrollY()+t.top-o.height,this._popupControlElement.classList.add("ms-ctrl-slide","ms-ctrl-slideBottomToTop"));this._popupControlElement.style.left=l+"px",this._popupControlElement.style.top=n+"px",this._popupControlElement.focus(),this._isOpen=!0}},t.prototype.closePopup=function(){this._isOpen&&(document.body.removeChild(this._overlayElement),this._isOpen=!1)},Object.defineProperty(t.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"placeholderText",{get:function(){return this._placeholderText},set:function(e){this._placeholderText=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this._value},set:function(e){this._value!=e&&(this._value=e,this.updateLabel(),this.valueChanged())},enumerable:!0,configurable:!0}),t}(s.InputControl);t.InputWithPopup=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(){this._items=[],this.onItemAdded=null,this.onItemRemoved=null}return e.prototype.get=function(e){return this._items[e]},e.prototype.add=function(e){this._items.push(e),this.onItemAdded&&this.onItemAdded(e)},e.prototype.remove=function(e){var t=this._items.indexOf(e);t>=0&&(this._items=this._items.splice(t,1),this.onItemRemoved&&this.onItemRemoved(e))},e.prototype.indexOf=function(e){return this._items.indexOf(e)},Object.defineProperty(e.prototype,"length",{get:function(){return this._items.length},enumerable:!0,configurable:!0}),e}();t.Collection=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.Sunday=0]="Sunday",e[e.Monday=1]="Monday",e[e.Tuesday=2]="Tuesday",e[e.Wednesday=3]="Wednesday",e[e.Thursday=4]="Thursday",e[e.Friday=5]="Friday",e[e.Saturday=6]="Saturday"}(t.DayOfWeek||(t.DayOfWeek={}))},function(e,t,n){"use strict";var o=this&&this.__extends||function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function o(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}();Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),i=n(0),s=n(1),l=function(){function e(e){this._isSubdued=!1,this._isSelected=!1,this.date=e}return e.prototype.selected=function(){this.onSelected&&this.onSelected(this)},e.prototype.render=function(){var e=this;return this._element=document.createElement("div"),this._element.className="ms-ctrl ms-ctrl-calendarDay",this._element.innerText=this.date.getDate().toString(),this._element.tabIndex=0,this._element.onclick=function(t){e.selected()},this._element.onkeydown=function(t){if(t.keyCode==i.KEY_ENTER)return e.selected(),!1},this._element},e.prototype.focus=function(){this._element.focus()},Object.defineProperty(e.prototype,"isSubdued",{get:function(){return this._isSubdued},set:function(e){this._isSubdued=e,this._isSubdued?this._element.classList.add("subdued"):this._element.classList.remove("subdued")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isSelected",{get:function(){return this._isSelected},set:function(e){this._isSelected=e,this._isSelected?this._element.classList.add("selected"):this._element.classList.remove("selected")},enumerable:!0,configurable:!0}),e}();t.DayCell=l;var a=function(e){function t(){var t=e.call(this)||this;t._selectedDay=null,t._miniCalendarElement=document.createElement("table"),t._miniCalendarElement.className="ms-ctrl ms-ctrl-slide",t._miniCalendarElement.cellPadding="0px",t._miniCalendarElement.cellSpacing="0px";var n=document.createElement("div");n.className="ms-ctrl ms-ctrl-calendarHeader",n.style.display="flex",t._monthYearLabelElement=document.createElement("div"),t._monthYearLabelElement.style.flex="1 1 100%",n.appendChild(t._monthYearLabelElement);var o=document.createElement("div");o.style.flex="0 0 auto";var s=document.createElement("i");return s.className="ms-icon ms-ctrl-calendarNavButton ms-icon-chevronLeft",s.tabIndex=0,s.onclick=function(e){t.date=r.addMonths(t.date,-1)},s.onkeydown=function(e){if(e.keyCode==i.KEY_ENTER)return t.date=r.addMonths(t.date,-1),!1},o.appendChild(s),(s=document.createElement("i")).className="ms-icon ms-ctrl-calendarNavButton ms-icon-chevronRight",s.tabIndex=0,s.onclick=function(e){t.date=r.addMonths(t.date,1)},s.onkeydown=function(e){if(e.keyCode==i.KEY_ENTER)return t.date=r.addMonths(t.date,1),!1},o.appendChild(s),n.appendChild(o),t._rootContainerElement=document.createElement("div"),t._rootContainerElement.className="ms-ctrl ms-ctrl-calendar",t._rootContainerElement.appendChild(n),t._rootContainerElement.appendChild(t._miniCalendarElement),t.date=new Date,t}return o(t,e),t.prototype.generateDayCells=function(e){var t=this;this._days=[];var n=e.getMonth(),o=e.getFullYear(),i=new Date(o,n,1),s=new Date(o,n,r.daysInMonth(o,n)),a=i.getDay();a-r.CalendarSettings.firstDayOfWeek>0&&(i=r.addDays(i,r.CalendarSettings.firstDayOfWeek-a));var c=s.getDay(),u=r.CalendarSettings.firstDayOfWeek+6;u-c>0&&(s=r.addDays(s,u-c));var h=s.getDate(),p=s.getMonth(),d=s.getFullYear();do{var f=new l(i);f.onSelected=function(e){t.selectedDayCell=e,t.onDateChanged&&t.onDateChanged(t)},this._days.push(f);var m=i.getDate()==h&&i.getMonth()==p&&i.getFullYear()==d;i=r.addDays(i,1)}while(!m)},Object.defineProperty(t.prototype,"selectedDayCell",{get:function(){return this._selectedDay},set:function(e){this._selectedDay&&(this._selectedDay.isSelected=!1),this._selectedDay=e,this._selectedDay&&(this._selectedDay.isSelected=!0,this._date=this._selectedDay.date)},enumerable:!0,configurable:!0}),t.prototype.initializeSelection=function(){if(this._date)for(var e=0;e<this._days.length;e++)if(r.areDatesEqual(this._days[e].date,this.date)){this.selectedDayCell=this._days[e];break}},t.prototype.rebuildMiniCalendar=function(e,t){this.generateDayCells(e);var n=e.getMonth();this._miniCalendarElement.innerHTML="",this._miniCalendarElement.classList.remove("ms-ctrl-slide","ms-ctrl-slideLeftToRight","ms-ctrl-slideRightToLeft");for(var o=document.createElement("tr"),i=r.CalendarSettings.firstDayOfWeek,s=0;s<r.CalendarSettings.daysInWeek;s++){var l=document.createElement("td");l.className="ms-ctrl ms-ctrl-calendarDayHeader",l.innerText=r.CalendarSettings.getInitialDayName(i),o.appendChild(l),++i>=r.CalendarSettings.daysInWeek&&(i=0)}this._miniCalendarElement.appendChild(o);for(s=0;s<this._days.length;s++){s%7==0&&(o=document.createElement("tr"),this._miniCalendarElement.appendChild(o));var a=document.createElement("td");a.appendChild(this._days[s].render()),this._days[s].date.getMonth()!=n&&(this._days[s].isSubdued=!0),o.appendChild(a)}if(t){var c=e.getTime()-t.getTime();c>0?this._miniCalendarElement.classList.add("ms-ctrl-slide","ms-ctrl-slideRightToLeft"):c<0&&this._miniCalendarElement.classList.add("ms-ctrl-slide","ms-ctrl-slideLeftToRight")}},t.prototype.attach=function(t){e.prototype.attach.call(this,t),t.innerHTML="",t.appendChild(this._rootContainerElement)},t.prototype.focus=function(){this._selectedDay&&this._selectedDay.focus()},Object.defineProperty(t.prototype,"date",{get:function(){return this._date},set:function(e){var t=!0,n=e||new Date;this._date&&(t=!this._days||n.getFullYear()!=this._date.getFullYear()||n.getMonth()!=this._date.getMonth()),t&&this.rebuildMiniCalendar(n,this._date),this._date=n,this.initializeSelection(),this._monthYearLabelElement.innerText=r.CalendarSettings.getLongMonthName(this._date.getMonth())+" "+this._date.getFullYear()},enumerable:!0,configurable:!0}),t}(s.InputControl);t.Calendar=a},function(e,t,n){"use strict";function o(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),o(n(0)),o(n(5)),o(n(2)),o(n(4)),o(n(1)),o(n(3)),o(n(6)),o(n(8)),o(n(9)),o(n(10)),o(n(11)),o(n(12)),o(n(13)),n(14)},function(e,t,n){"use strict";var o=this&&this.__extends||function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function o(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}();Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=n(4),s=n(3),l=function(){function e(e,t){this.key=e,this._value=t}return e.prototype.click=function(){this.onClick&&this.onClick(this)},e.prototype.toString=function(){return this.value},e.prototype.render=function(){var e=this;return this._element||(this._element=document.createElement("span"),this._element.className="ms-ctrl ms-ctrl-dropdown-item",this._element.innerText=this.value,this._element.onmouseup=function(t){e.click()}),this._element},Object.defineProperty(e.prototype,"value",{get:function(){return this._value},set:function(e){this._value=e,this._element&&(this._element.innerText=e)},enumerable:!0,configurable:!0}),e}();t.DropDownItem=l;var a=function(e){function t(t){var n=e.call(this)||this;return n._renderedItems=[],n._selectedIndex=-1,n._owner=t,n}return o(t,e),t.prototype.renderContent=function(){var e=document.createElement("div");e.className="ms-ctrl ms-popup";for(var t=this._owner.selectedIndex,n=0;n<this._owner.items.length;n++){var o=this._owner.items.get(n).render();o.tabIndex=0,e.appendChild(o),n==t&&o.focus(),this._renderedItems.push(o)}return e},t.prototype.keyDown=function(t){e.prototype.keyDown.call(this,t);var n=this._selectedIndex;switch(t.keyCode){case r.KEY_TAB:this.close();break;case r.KEY_ENTER:this.selectedIndex>=0&&(this._owner.selectedIndex=this.selectedIndex,this.close());break;case r.KEY_UP:n<=0?n=this._renderedItems.length-1:--n<0&&(n=this._renderedItems.length-1),this.selectedIndex=n,t.cancelBubble=!0;break;case r.KEY_DOWN:n<0?n=0:++n>=this._renderedItems.length&&(n=0),this.selectedIndex=n,t.cancelBubble=!0}},t.prototype.render=function(t){var n=e.prototype.render.call(this,t);return n.style.minWidth=t.width/2+"px",n.style.maxWidth=t.width+"px",n},Object.defineProperty(t.prototype,"selectedIndex",{get:function(){return this._selectedIndex},set:function(e){e>=0&&e<this._renderedItems.length&&(this._renderedItems[e].focus(),this._selectedIndex=e)},enumerable:!0,configurable:!0}),t}(s.PopupControl);t.DropDownPopupControl=a;var c=function(e){function t(){var t=e.call(this)||this;return t._items=new i.Collection,t._items.onItemAdded=function(e){e.onClick=function(e){t.itemClicked(e)}},t._items.onItemRemoved=function(e){e.onClick=null},t}return o(t,e),t.prototype.itemClicked=function(e){this.selectedItem=e,this.closePopup(),this.rootElement.focus()},t.prototype.validateRootElement=function(e){if(!(e instanceof HTMLDivElement))throw new Error("DropDown requires a DIV element as its root.")},t.prototype.createPopupControl=function(){return new a(this)},t.prototype.getCssClassName=function(){return"ms-ctrl ms-ctrl-dropdown"},t.prototype.attach=function(t){e.prototype.attach.call(this,t);for(var n=0;n<this.rootElement.children.length;n++){var o=this.rootElement.children[n];if("ms-dropdown-item"==o.tagName.toLowerCase()){var r=new l(o.attributes.getNamedItem("key").value,o.attributes.getNamedItem("value").value);this._items.add(r)}}},t.prototype.popup=function(){e.prototype.popup.call(this),this.popupControl.selectedIndex=this.selectedIndex},Object.defineProperty(t.prototype,"items",{get:function(){return this._items},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"selectedItem",{get:function(){return this.value},set:function(e){this.value=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"selectedIndex",{get:function(){return this.items.indexOf(this.value)},set:function(e){e>=0&&this.items.length>e&&(this.selectedItem=this.items.get(e))},enumerable:!0,configurable:!0}),t}(s.InputWithPopup);t.DropDown=c},function(e,t,n){"use strict";var o=this&&this.__extends||function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function o(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}();Object.defineProperty(t,"__esModule",{value:!0});var r=n(3),i=n(6),s=function(e){function t(t){var n=e.call(this)||this;return n._owner=t,n}return o(t,e),t.prototype.renderContent=function(){var e=this,t=document.createElement("div");return t.className="ms-ctrl ms-calendarPopup",this._calendar=new i.Calendar,this._calendar.date=this._owner.value,this._calendar.onDateChanged=function(t){e._owner.value=t.date,e.close()},this._calendar.attach(t),t},t.prototype.focus=function(){this._calendar&&this._calendar.focus()},t}(r.PopupControl);t.CalendarPopupControl=s;var l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.validateRootElement=function(e){if(!(e instanceof HTMLDivElement))throw new Error("DatePicker requires a DIV element as its root.")},t.prototype.createPopupControl=function(){return new s(this)},t.prototype.getValueAsString=function(){return this.value.toLocaleDateString()},t.prototype.getCssClassName=function(){return"ms-ctrl ms-ctrl-datePicker"},t.prototype.getButtonIconCssClassName=function(){return"ms-icon-calendar"},t.prototype.popup=function(){e.prototype.popup.call(this),this.isOpen&&this.popupControl.focus()},t}(r.InputWithPopup);t.DatePicker=l},function(e,t,n){"use strict";var o=this&&this.__extends||function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function o(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}();Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._label="",t._checkboxElement=null,t._spanElement=null,t}return o(t,e),t.createId=function(){var e=t.creationIndex;return t.creationIndex++,e},t.prototype.changed=function(){this.onChange&&this.onChange(this)},t.prototype.keyDown=function(e){switch(e.keyCode){case r.KEY_ENTER:this.isChecked=!this.isChecked}},t.prototype.attach=function(n){var o=this;e.prototype.attach.call(this,n),n.className="ms-ctrl ms-ctrl-checkbox",n.tabIndex=0;var r=n.attributes.label;r&&(this._label=r.value);var i=n.attributes.ischecked;i&&(this._isChecked="true"===i.value),this._checkboxElement=document.createElement("input"),this._checkboxElement.id="ms-ctrl-checkbox-"+t.createId(),this._checkboxElement.type="checkbox",this._checkboxElement.style.position="absolute",this._checkboxElement.checked=this.isChecked,this._checkboxElement.onchange=function(e){o.changed()};var s=document.createElement("label");s.htmlFor=this._checkboxElement.id,this._spanElement=document.createElement("span"),this._spanElement.innerText=this._label,s.appendChild(this._spanElement),n.innerHTML="",n.appendChild(this._checkboxElement),n.appendChild(s)},Object.defineProperty(t.prototype,"label",{get:function(){return this._label},set:function(e){this._label=e,this._spanElement&&(this._spanElement.innerText=this._label)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isChecked",{get:function(){return this._isChecked},set:function(e){this._isChecked!=e&&(this._isChecked=e,this._checkboxElement&&(this._checkboxElement.checked=this._isChecked),this.changed())},enumerable:!0,configurable:!0}),t.creationIndex=0,t}(n(1).InputControl);t.CheckBox=i},function(e,t,n){"use strict";var o=this&&this.__extends||function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function o(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}();Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._label="",t._checkboxElement=null,t._spanElement=null,t}return o(t,e),t.createId=function(){var e=t.creationIndex;return t.creationIndex++,e},t.prototype.changed=function(){this.onChange&&this.onChange(this)},t.prototype.keyDown=function(e){switch(e.keyCode){case r.KEY_ENTER:this.isChecked=!this.isChecked}},t.prototype.attach=function(n){var o=this;e.prototype.attach.call(this,n),n.className="ms-ctrl ms-ctrl-radiobutton",n.tabIndex=0;var r=n.attributes.label;r&&(this._label=r.value);var i=n.attributes.ischecked;i&&(this._isChecked="true"===i.value),this._checkboxElement=document.createElement("input"),this._checkboxElement.id="ms-ctrl-radio-"+t.createId(),this._checkboxElement.type="radio",this._checkboxElement.style.position="absolute",this._checkboxElement.checked=this.isChecked,this._checkboxElement.onchange=function(e){o.changed()};var s=n.attributes.groupname;s&&(this._checkboxElement.name=s.value);var l=document.createElement("label");l.htmlFor=this._checkboxElement.id,this._spanElement=document.createElement("span"),this._spanElement.innerText=this._label,l.appendChild(this._spanElement),n.innerHTML="",n.appendChild(this._checkboxElement),n.appendChild(l)},Object.defineProperty(t.prototype,"label",{get:function(){return this._label},set:function(e){this._label=e,this._spanElement&&(this._spanElement.innerText=this._label)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isChecked",{get:function(){return this._isChecked},set:function(e){this._isChecked!=e&&(this._isChecked=e,this._checkboxElement&&(this._checkboxElement.checked=this._isChecked),this.changed())},enumerable:!0,configurable:!0}),t.creationIndex=0,t}(n(1).InputControl);t.RadioButton=i},function(e,t,n){"use strict";var o=this&&this.__extends||function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function o(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}();Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),i=n(1),s=function(){function e(){}return e.prototype.changed=function(){this.onChange&&this.onChange()},e}(),l=function(e){function t(){var t=e.call(this)||this;return t._inputElement=document.createElement("input"),t._inputElement.className="ms-ctrl ms-ctrl-textbox",t._inputElement.type="text",t._inputElement.oninput=function(e){t.changed()},t}return o(t,e),Object.defineProperty(t.prototype,"element",{get:function(){return this._inputElement},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"placeholder",{set:function(e){this._inputElement.placeholder=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"lineCount",{set:function(e){},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"maxLength",{set:function(e){this._inputElement.maxLength!=e&&(this._inputElement.maxLength=e,this.value=this.value.substr(0,e))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this._inputElement.value},set:function(e){this._inputElement.value=e},enumerable:!0,configurable:!0}),t}(s),a=function(e){function t(){var t=e.call(this)||this;return t._textareaElement=document.createElement("textarea"),t._textareaElement.className="ms-ctrl ms-ctrl-textbox ms-ctrl-textbox-multiline",t._textareaElement.oninput=function(e){t.changed()},t}return o(t,e),Object.defineProperty(t.prototype,"element",{get:function(){return this._textareaElement},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"placeholder",{set:function(e){this._textareaElement.placeholder=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"lineCount",{set:function(e){this._textareaElement.rows=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"maxLength",{set:function(e){this._textareaElement.maxLength!=e&&(this._textareaElement.maxLength=e,this.value=this.value.substr(0,e))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this._textareaElement.value},set:function(e){this._textareaElement.value=e},enumerable:!0,configurable:!0}),t}(s),c=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._isMultiline=!1,t._lineCount=3,t}return o(t,e),t.prototype.editBoxChanged=function(){this.onChange&&this.onChange(this)},t.prototype.recreateEditBox=function(){var e=this,t=null;t=this._editBox?this._editBox.value:this.rootElement.innerText,this._isMultiline?this._editBox=new a:this._editBox=new l,t&&(this._editBox.value=t),this._editBox.lineCount=this._lineCount,this._editBox.maxLength=this._maxLength,this._editBox.placeholder=this._placeholder,this._editBox.onChange=function(){e.editBoxChanged()},this.rootElement.innerHTML="",this.rootElement.appendChild(this._editBox.element)},Object.defineProperty(t.prototype,"editBox",{get:function(){return this._editBox||this.recreateEditBox(),this._editBox},enumerable:!0,configurable:!0}),t.prototype.attach=function(t){e.prototype.attach.call(this,t),this._isMultiline=r.getAttributeValueAsBool(t,"ismultiline",!1),this._lineCount=r.getAttributeValueAsInt(t,"lines",3),this._maxLength=r.getAttributeValueAsInt(t,"maxlength",5e4),this._placeholder=r.getAttributeValueAsString(t,"placeholder",null),this.recreateEditBox()},Object.defineProperty(t.prototype,"value",{get:function(){return this.editBox.value},set:function(e){this.editBox.value=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"placeholder",{get:function(){return this._placeholder},set:function(e){this._placeholder=e,this.editBox.placeholder=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isMultiline",{get:function(){return this._isMultiline},set:function(e){this._isMultiline!=e&&(this._isMultiline=e,this.recreateEditBox())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"lineCount",{get:function(){return this._lineCount},set:function(e){e>0&&(this._lineCount=e,this.editBox.lineCount=e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"maxLength",{get:function(){return this._maxLength},set:function(e){e>0&&(this._maxLength=e,this.editBox.maxLength=e)},enumerable:!0,configurable:!0}),t}(i.InputControl);t.TextBox=c},function(e,t,n){"use strict";var o=this&&this.__extends||function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function o(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}();Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),i=n(0),s=n(4),l=function(e){function t(){var t=e.call(this)||this;return t._items=new s.Collection,t._renderedItems=[],t._selectedIndex=-1,t}return o(t,e),t.prototype.renderContent=function(){var e=document.createElement("div");e.className="ms-ctrl ms-popup";for(var t=0;t<this._items.length;t++){var n=this._items.get(t).render();n.tabIndex=0,e.appendChild(n),t==this.selectedIndex&&n.focus(),this._renderedItems.push(n)}return e},t.prototype.keyDown=function(t){e.prototype.keyDown.call(this,t);var n=this._selectedIndex;switch(t.keyCode){case i.KEY_TAB:this.close();break;case i.KEY_UP:n<=0?n=this._renderedItems.length-1:--n<0&&(n=this._renderedItems.length-1),this.selectedIndex=n,t.cancelBubble=!0;break;case i.KEY_DOWN:n<0?n=0:++n>=this._renderedItems.length&&(n=0),this.selectedIndex=n,t.cancelBubble=!0}},t.prototype.popup=function(e){var t=this;if(!this._isOpen){this._overlayElement=document.createElement("div"),this._overlayElement.className="ms-ctrl-overlay",this._overlayElement.tabIndex=0,this._overlayElement.style.zIndex="1000",this._overlayElement.style.width=document.documentElement.scrollWidth+"px",this._overlayElement.style.height=document.documentElement.scrollHeight+"px",this._overlayElement.onfocus=function(e){t.closePopup()},document.body.appendChild(this._overlayElement);var n=e.getBoundingClientRect();this._popupControlElement=this.render(n),this._popupControlElement.classList.remove("ms-ctrl-slide","ms-ctrl-slideLeftToRight","ms-ctrl-slideRightToLeft","ms-ctrl-slideTopToBottom","ms-ctrl-slideRightToLeft"),this._overlayElement.appendChild(this._popupControlElement);var o,i=this._popupControlElement.getBoundingClientRect(),s=window.innerHeight-n.bottom,l=n.top,a=n.left+r.getScrollX();if(l<i.height&&s<i.height){var c=window.innerHeight;this._popupControlElement.style.maxHeight=c+"px",o=c<i.height?r.getScrollY():r.getScrollY()+n.top+(n.height-c)/2;var u=window.innerWidth-n.right;if(n.left<i.width&&u<i.width){var h=window.innerWidth;this._popupControlElement.style.maxWidth=h+"px",a=h<i.width?r.getScrollX():r.getScrollX()+n.left+(n.width-h)/2}else u>=i.width?(a=r.getScrollX()+n.right,this._popupControlElement.classList.add("ms-ctrl-slide","ms-ctrl-slideLeftToRight")):(a=r.getScrollX()+n.left-i.width,this._popupControlElement.classList.add("ms-ctrl-slide","ms-ctrl-slideRightToLeft"))}else s>=i.height?(o=r.getScrollY()+n.bottom,this._popupControlElement.classList.add("ms-ctrl-slide","ms-ctrl-slideTopToBottom")):(o=r.getScrollY()+n.top-i.height,this._popupControlElement.classList.add("ms-ctrl-slide","ms-ctrl-slideBottomToTop"));this._popupControlElement.style.left=a+"px",this._popupControlElement.style.top=o+"px",this._popupControlElement.focus(),this._isOpen=!0}},t.prototype.closePopup=function(){this._isOpen&&(document.body.removeChild(this._overlayElement),this._isOpen=!1)},Object.defineProperty(t.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"items",{get:function(){return this._items},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"selectedIndex",{get:function(){return this._selectedIndex},set:function(e){e>=0&&e<this._renderedItems.length&&(this._renderedItems[e].focus(),this._selectedIndex=e)},enumerable:!0,configurable:!0}),t}(n(3).PopupControl);t.PopupMenu=l},function(e,t,n){var o=n(15);"string"==typeof o&&(o=[[e.i,o,""]]);var r={hmr:!0,transform:void 0,insertInto:void 0};n(16)(o,r);o.locals&&(e.exports=o.locals)},function(e,t,n){},function(e,t,n){var o={},r=function(e){var t;return function(){return void 0===t&&(t=e.apply(this,arguments)),t}}(function(){return window&&document&&document.all&&!window.atob}),i=function(e){var t={};return function(e,n){if("function"==typeof e)return e();if(void 0===t[e]){var o=function(e,t){return t?t.querySelector(e):document.querySelector(e)}.call(this,e,n);if(window.HTMLIFrameElement&&o instanceof window.HTMLIFrameElement)try{o=o.contentDocument.head}catch(e){o=null}t[e]=o}return t[e]}}(),s=null,l=0,a=[],c=n(17);function u(e,t){for(var n=0;n<e.length;n++){var r=e[n],i=o[r.id];if(i){i.refs++;for(var s=0;s<i.parts.length;s++)i.parts[s](r.parts[s]);for(;s<r.parts.length;s++)i.parts.push(_(r.parts[s],t))}else{var l=[];for(s=0;s<r.parts.length;s++)l.push(_(r.parts[s],t));o[r.id]={id:r.id,refs:1,parts:l}}}}function h(e,t){for(var n=[],o={},r=0;r<e.length;r++){var i=e[r],s=t.base?i[0]+t.base:i[0],l={css:i[1],media:i[2],sourceMap:i[3]};o[s]?o[s].parts.push(l):n.push(o[s]={id:s,parts:[l]})}return n}function p(e,t){var n=i(e.insertInto);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var o=a[a.length-1];if("top"===e.insertAt)o?o.nextSibling?n.insertBefore(t,o.nextSibling):n.appendChild(t):n.insertBefore(t,n.firstChild),a.push(t);else if("bottom"===e.insertAt)n.appendChild(t);else{if("object"!=typeof e.insertAt||!e.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var r=i(e.insertAt.before,n);n.insertBefore(t,r)}}function d(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e);var t=a.indexOf(e);t>=0&&a.splice(t,1)}function f(e){var t=document.createElement("style");if(void 0===e.attrs.type&&(e.attrs.type="text/css"),void 0===e.attrs.nonce){var o=function(){0;return n.nc}();o&&(e.attrs.nonce=o)}return m(t,e.attrs),p(e,t),t}function m(e,t){Object.keys(t).forEach(function(n){e.setAttribute(n,t[n])})}function _(e,t){var n,o,r,i;if(t.transform&&e.css){if(!(i="function"==typeof t.transform?t.transform(e.css):t.transform.default(e.css)))return function(){};e.css=i}if(t.singleton){var a=l++;n=s||(s=f(t)),o=b.bind(null,n,a,!1),r=b.bind(null,n,a,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(e){var t=document.createElement("link");return void 0===e.attrs.type&&(e.attrs.type="text/css"),e.attrs.rel="stylesheet",m(t,e.attrs),p(e,t),t}(t),o=function(e,t,n){var o=n.css,r=n.sourceMap,i=void 0===t.convertToAbsoluteUrls&&r;(t.convertToAbsoluteUrls||i)&&(o=c(o));r&&(o+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var s=new Blob([o],{type:"text/css"}),l=e.href;e.href=URL.createObjectURL(s),l&&URL.revokeObjectURL(l)}.bind(null,n,t),r=function(){d(n),n.href&&URL.revokeObjectURL(n.href)}):(n=f(t),o=function(e,t){var n=t.css,o=t.media;o&&e.setAttribute("media",o);if(e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}.bind(null,n),r=function(){d(n)});return o(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;o(e=t)}else r()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(t=t||{}).attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||"boolean"==typeof t.singleton||(t.singleton=r()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var n=h(e,t);return u(n,t),function(e){for(var r=[],i=0;i<n.length;i++){var s=n[i];(l=o[s.id]).refs--,r.push(l)}e&&u(h(e,t),t);for(i=0;i<r.length;i++){var l;if(0===(l=r[i]).refs){for(var a=0;a<l.parts.length;a++)l.parts[a]();delete o[l.id]}}}};var y=function(){var e=[];return function(t,n){return e[t]=n,e.filter(Boolean).join("\n")}}();function b(e,t,n,o){var r=n?"":o.css;if(e.styleSheet)e.styleSheet.cssText=y(t,r);else{var i=document.createTextNode(r),s=e.childNodes;s[t]&&e.removeChild(s[t]),s.length?e.insertBefore(i,s[t]):e.appendChild(i)}}},function(e,t){e.exports=function(e){var t="undefined"!=typeof window&&window.location;if(!t)throw new Error("fixUrls requires window.location");if(!e||"string"!=typeof e)return e;var n=t.protocol+"//"+t.host,o=n+t.pathname.replace(/\/[^\/]*$/,"/");return e.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(e,t){var r,i=t.trim().replace(/^"(.*)"$/,function(e,t){return t}).replace(/^'(.*)'$/,function(e,t){return t});return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(i)?e:(r=0===i.indexOf("//")?i:0===i.indexOf("/")?n+i:o+i.replace(/^\.\//,""),"url("+JSON.stringify(r)+")")})}}])}); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("ACControls",[],t):"object"==typeof exports?exports.ACControls=t():e.ACControls=t()}(this,function(){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/dist/",n(n.s=7)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KEY_TAB=9,t.KEY_ENTER=13,t.KEY_ESCAPE=27,t.KEY_UP=38,t.KEY_DOWN=40,t.KEY_DELETE=46},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(){}return e.prototype.validateRootElement=function(e){},e.prototype.keyDown=function(e){},Object.defineProperty(e.prototype,"rootElement",{get:function(){return this._rootElement},enumerable:!0,configurable:!0}),e.prototype.attach=function(e){var t=this;this.validateRootElement(e),this._rootElement=e,this._rootElement.onkeydown=function(e){t.keyDown(e)}},e}();t.InputControl=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(5),r=function(){function e(){}return e.getLongDayName=function(t){if(t>=0&&t<e.longDayNames.length)return e.longDayNames[t];throw new Error("Day index out of range: "+t)},e.getShortDayName=function(t){if(t>=0&&t<e.shortDayNames.length)return e.shortDayNames[t];throw new Error("Day index out of range: "+t)},e.getInitialDayName=function(t){if(t>=0&&t<e.minimalDayNames.length)return e.minimalDayNames[t];throw new Error("Day index out of range: "+t)},e.getLongMonthName=function(t){if(t>=0&&t<e.longMonthNames.length)return e.longMonthNames[t];throw new Error("Month index out of range: "+t)},e.getShortMonthName=function(t){if(t>=0&&t<e.shortMonthNames.length)return e.shortMonthNames[t];throw new Error("Month index out of range: "+t)},e.monthsInYear=12,e.daysInWeek=7,e.firstDayOfWeek=o.DayOfWeek.Sunday,e.longDayNames=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],e.shortDayNames=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],e.minimalDayNames=["Su","Mo","Tu","We","Th","Fr","Sa"],e.longMonthNames=["January","February","March","April","May","June","July","August","September","October","November","December"],e.shortMonthNames=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],e}();function i(e,t){var n=new Date(e.getTime());return n.setDate(n.getDate()+t),n}t.CalendarSettings=r,t.daysInMonth=function(e,t){switch(t){case 1:return e%4==0&&e%100||e%400==0?29:28;case 3:case 5:case 8:case 10:return 30;default:return 31}},t.addDays=i,t.addMonths=function(e,t){var n=new Date(e.getTime()),o=n.getMonth()+t;return n.setMonth(o),n.getMonth()!==(o%r.monthsInYear+r.monthsInYear)%r.monthsInYear&&(n=i(n,-n.getDate())),n},t.areDatesEqual=function(e,t){return e.getFullYear()==t.getFullYear()&&e.getMonth()==t.getMonth()&&e.getDate()==t.getDate()},t.getScrollX=function(){return window.pageXOffset},t.getScrollY=function(){return window.pageYOffset},t.getAttributeValueAsBool=function(e,t,n){var o=e.attributes[t];return o?"true"===o.value:n},t.getAttributeValueAsString=function(e,t,n){var o=e.attributes[t];return o?o.value:n},t.getAttributeValueAsInt=function(e,t,n){var o=e.attributes[t];if(o){var r=parseInt(o.value);if(!isNaN(r))return r}return n}},function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),s=n(2),l=n(1),a=function(){function e(){}return e.prototype.close=function(){this.onClose&&this.onClose(this)},e.prototype.keyDown=function(e){switch(e.keyCode){case i.KEY_ESCAPE:this.close()}},e.prototype.render=function(e){var t=this;return this._popupElement=document.createElement("div"),this._popupElement.tabIndex=0,this._popupElement.className="ms-ctrl ms-ctrl-popup-container",this._popupElement.onkeydown=function(e){return t.keyDown(e),!e.cancelBubble},this._popupElement.appendChild(this.renderContent()),this._popupElement},e.prototype.focus=function(){this._popupElement&&this._popupElement.firstElementChild.focus()},e}();t.PopupControl=a;var c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.keyDown=function(e){switch(e.keyCode){case i.KEY_ENTER:this.popup()}},t.prototype.updateLabel=function(){this._labelElement&&(this._value?(this._labelElement.innerHTML=this.getValueAsString(),this._labelElement.classList.remove("placeholder")):(this._labelElement.innerText=this._placeholderText?this._placeholderText:"",this._labelElement.classList.add("placeholder")))},Object.defineProperty(t.prototype,"popupControl",{get:function(){return this._popupControl},enumerable:!0,configurable:!0}),t.prototype.getButtonIconCssClassName=function(){return"ms-icon-chevronDown"},t.prototype.getValueAsString=function(){return this._value.toString()},t.prototype.valueChanged=function(){this.onValueChanged&&this.onValueChanged(this)},t.prototype.attach=function(t){var n=this;e.prototype.attach.call(this,t),t.tabIndex=0,t.className=this.getCssClassName(),window.addEventListener("resize",function(e){n.closePopup()}),this.rootElement.onclick=function(e){n._isOpen?n.closePopup():n.popup()};var o=this.rootElement.attributes.getNamedItem("placeholder");o&&(this._placeholderText=o.value),this._labelElement=document.createElement("span"),this._labelElement.className="ms-ctrl ms-dropdown-label",this._dropDownButtonElement=document.createElement("i"),this._dropDownButtonElement.className="ms-icon ms-ctrl-dropdown-button "+this.getButtonIconCssClassName(),this.rootElement.appendChild(this._labelElement),this.rootElement.appendChild(this._dropDownButtonElement),this.updateLabel()},t.prototype.popup=function(){var e=this;if(!this._isOpen){this._overlayElement=document.createElement("div"),this._overlayElement.className="ms-ctrl-overlay",this._overlayElement.tabIndex=0,this._overlayElement.style.width=document.documentElement.scrollWidth+"px",this._overlayElement.style.height=document.documentElement.scrollHeight+"px",this._overlayElement.onfocus=function(t){e.closePopup()},document.body.appendChild(this._overlayElement),this._popupControl=this.createPopupControl(),this._popupControl.onClose=function(t){e.closePopup(),e.rootElement.focus()};var t=this.rootElement.getBoundingClientRect();this._popupControlElement=this._popupControl.render(t),this._popupControlElement.classList.remove("ms-ctrl-slide","ms-ctrl-slideLeftToRight","ms-ctrl-slideRightToLeft","ms-ctrl-slideTopToBottom","ms-ctrl-slideRightToLeft"),this._overlayElement.appendChild(this._popupControlElement);var n,o=this._popupControlElement.getBoundingClientRect(),r=window.innerHeight-t.bottom,i=t.top,l=t.left+s.getScrollX();if(i<o.height&&r<o.height){var a=Math.min(o.height,window.innerHeight);this._popupControlElement.style.maxHeight=a+"px",n=a<o.height?s.getScrollY():s.getScrollY()+t.top+(t.height-a)/2;var c=window.innerWidth-t.right;if(t.left<o.width&&c<o.width){var u=Math.min(o.width,window.innerWidth);this._popupControlElement.style.maxWidth=u+"px",l=u<o.width?s.getScrollX():s.getScrollX()+t.left+(t.width-u)/2}else c>=o.width?(l=s.getScrollX()+t.right,this._popupControlElement.classList.add("ms-ctrl-slide","ms-ctrl-slideLeftToRight")):(l=s.getScrollX()+t.left-o.width,this._popupControlElement.classList.add("ms-ctrl-slide","ms-ctrl-slideRightToLeft"))}else r>=o.height?(n=s.getScrollY()+t.bottom,this._popupControlElement.classList.add("ms-ctrl-slide","ms-ctrl-slideTopToBottom")):(n=s.getScrollY()+t.top-o.height,this._popupControlElement.classList.add("ms-ctrl-slide","ms-ctrl-slideBottomToTop"));this._popupControlElement.style.left=l+"px",this._popupControlElement.style.top=n+"px",this._popupControlElement.focus(),this._isOpen=!0}},t.prototype.closePopup=function(){this._isOpen&&(document.body.removeChild(this._overlayElement),this._isOpen=!1)},Object.defineProperty(t.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"placeholderText",{get:function(){return this._placeholderText},set:function(e){this._placeholderText=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this._value},set:function(e){this._value!=e&&(this._value=e,this.updateLabel(),this.valueChanged())},enumerable:!0,configurable:!0}),t}(l.InputControl);t.InputWithPopup=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(){this._items=[],this.onItemAdded=null,this.onItemRemoved=null}return e.prototype.get=function(e){return this._items[e]},e.prototype.add=function(e){this._items.push(e),this.onItemAdded&&this.onItemAdded(e)},e.prototype.remove=function(e){var t=this._items.indexOf(e);t>=0&&(this._items=this._items.splice(t,1),this.onItemRemoved&&this.onItemRemoved(e))},e.prototype.indexOf=function(e){return this._items.indexOf(e)},Object.defineProperty(e.prototype,"length",{get:function(){return this._items.length},enumerable:!0,configurable:!0}),e}();t.Collection=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.Sunday=0]="Sunday",e[e.Monday=1]="Monday",e[e.Tuesday=2]="Tuesday",e[e.Wednesday=3]="Wednesday",e[e.Thursday=4]="Thursday",e[e.Friday=5]="Friday",e[e.Saturday=6]="Saturday"}(t.DayOfWeek||(t.DayOfWeek={}))},function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),s=n(0),l=n(1),a=function(){function e(e){this._isSubdued=!1,this._isSelected=!1,this.date=e}return e.prototype.selected=function(){this.onSelected&&this.onSelected(this)},e.prototype.render=function(){var e=this;return this._element=document.createElement("div"),this._element.className="ms-ctrl ms-ctrl-calendarDay",this._element.innerText=this.date.getDate().toString(),this._element.tabIndex=0,this._element.onclick=function(t){e.selected()},this._element.onkeydown=function(t){if(t.keyCode==s.KEY_ENTER)return e.selected(),!1},this._element},e.prototype.focus=function(){this._element.focus()},Object.defineProperty(e.prototype,"isSubdued",{get:function(){return this._isSubdued},set:function(e){this._isSubdued=e,this._isSubdued?this._element.classList.add("subdued"):this._element.classList.remove("subdued")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isSelected",{get:function(){return this._isSelected},set:function(e){this._isSelected=e,this._isSelected?this._element.classList.add("selected"):this._element.classList.remove("selected")},enumerable:!0,configurable:!0}),e}();t.DayCell=a;var c=function(e){function t(){var t=e.call(this)||this;t._selectedDay=null,t._miniCalendarElement=document.createElement("table"),t._miniCalendarElement.className="ms-ctrl ms-ctrl-slide",t._miniCalendarElement.cellPadding="0px",t._miniCalendarElement.cellSpacing="0px";var n=document.createElement("div");n.className="ms-ctrl ms-ctrl-calendarHeader",n.style.display="flex",t._monthYearLabelElement=document.createElement("div"),t._monthYearLabelElement.style.flex="1 1 100%",n.appendChild(t._monthYearLabelElement);var o=document.createElement("div");o.style.flex="0 0 auto";var r=document.createElement("i");return r.className="ms-icon ms-ctrl-calendarNavButton ms-icon-chevronLeft",r.tabIndex=0,r.onclick=function(e){t.date=i.addMonths(t.date,-1)},r.onkeydown=function(e){if(e.keyCode==s.KEY_ENTER)return t.date=i.addMonths(t.date,-1),!1},o.appendChild(r),(r=document.createElement("i")).className="ms-icon ms-ctrl-calendarNavButton ms-icon-chevronRight",r.tabIndex=0,r.onclick=function(e){t.date=i.addMonths(t.date,1)},r.onkeydown=function(e){if(e.keyCode==s.KEY_ENTER)return t.date=i.addMonths(t.date,1),!1},o.appendChild(r),n.appendChild(o),t._rootContainerElement=document.createElement("div"),t._rootContainerElement.className="ms-ctrl ms-ctrl-calendar",t._rootContainerElement.appendChild(n),t._rootContainerElement.appendChild(t._miniCalendarElement),t.date=new Date,t}return r(t,e),t.prototype.generateDayCells=function(e){var t=this;this._days=[];var n=e.getMonth(),o=e.getFullYear(),r=new Date(o,n,1),s=new Date(o,n,i.daysInMonth(o,n)),l=r.getDay();l-i.CalendarSettings.firstDayOfWeek>0&&(r=i.addDays(r,i.CalendarSettings.firstDayOfWeek-l));var c=s.getDay(),u=i.CalendarSettings.firstDayOfWeek+6;u-c>0&&(s=i.addDays(s,u-c));var h=s.getDate(),p=s.getMonth(),d=s.getFullYear();do{var f=new a(r);f.onSelected=function(e){t.selectedDayCell=e,t.onDateChanged&&t.onDateChanged(t)},this._days.push(f);var m=r.getDate()==h&&r.getMonth()==p&&r.getFullYear()==d;r=i.addDays(r,1)}while(!m)},Object.defineProperty(t.prototype,"selectedDayCell",{get:function(){return this._selectedDay},set:function(e){this._selectedDay&&(this._selectedDay.isSelected=!1),this._selectedDay=e,this._selectedDay&&(this._selectedDay.isSelected=!0,this._date=this._selectedDay.date)},enumerable:!0,configurable:!0}),t.prototype.initializeSelection=function(){if(this._date)for(var e=0;e<this._days.length;e++)if(i.areDatesEqual(this._days[e].date,this.date)){this.selectedDayCell=this._days[e];break}},t.prototype.rebuildMiniCalendar=function(e,t){this.generateDayCells(e);var n=e.getMonth();this._miniCalendarElement.innerHTML="",this._miniCalendarElement.classList.remove("ms-ctrl-slide","ms-ctrl-slideLeftToRight","ms-ctrl-slideRightToLeft");for(var o=document.createElement("tr"),r=i.CalendarSettings.firstDayOfWeek,s=0;s<i.CalendarSettings.daysInWeek;s++){var l=document.createElement("td");l.className="ms-ctrl ms-ctrl-calendarDayHeader",l.innerText=i.CalendarSettings.getInitialDayName(r),o.appendChild(l),++r>=i.CalendarSettings.daysInWeek&&(r=0)}this._miniCalendarElement.appendChild(o);for(s=0;s<this._days.length;s++){s%7==0&&(o=document.createElement("tr"),this._miniCalendarElement.appendChild(o));var a=document.createElement("td");a.appendChild(this._days[s].render()),this._days[s].date.getMonth()!=n&&(this._days[s].isSubdued=!0),o.appendChild(a)}if(t){var c=e.getTime()-t.getTime();c>0?this._miniCalendarElement.classList.add("ms-ctrl-slide","ms-ctrl-slideRightToLeft"):c<0&&this._miniCalendarElement.classList.add("ms-ctrl-slide","ms-ctrl-slideLeftToRight")}},t.prototype.attach=function(t){e.prototype.attach.call(this,t),t.innerHTML="",t.appendChild(this._rootContainerElement)},t.prototype.focus=function(){this._selectedDay&&this._selectedDay.focus()},Object.defineProperty(t.prototype,"date",{get:function(){return this._date},set:function(e){var t=!0,n=e||new Date;this._date&&(t=!this._days||n.getFullYear()!=this._date.getFullYear()||n.getMonth()!=this._date.getMonth()),t&&this.rebuildMiniCalendar(n,this._date),this._date=n,this.initializeSelection(),this._monthYearLabelElement.innerText=i.CalendarSettings.getLongMonthName(this._date.getMonth())+" "+this._date.getFullYear()},enumerable:!0,configurable:!0}),t}(l.InputControl);t.Calendar=c},function(e,t,n){"use strict";function o(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),o(n(0)),o(n(5)),o(n(2)),o(n(4)),o(n(1)),o(n(3)),o(n(6)),o(n(8)),o(n(9)),o(n(10)),o(n(11)),o(n(12)),o(n(13)),n(14)},function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),s=n(4),l=n(3),a=function(){function e(e,t){this.key=e,this._value=t}return e.prototype.click=function(){this.onClick&&this.onClick(this)},e.prototype.toString=function(){return this.value},e.prototype.render=function(){var e=this;return this._element||(this._element=document.createElement("span"),this._element.className="ms-ctrl ms-ctrl-dropdown-item",this._element.innerText=this.value,this._element.onmouseup=function(t){e.click()}),this._element},Object.defineProperty(e.prototype,"value",{get:function(){return this._value},set:function(e){this._value=e,this._element&&(this._element.innerText=e)},enumerable:!0,configurable:!0}),e}();t.DropDownItem=a;var c=function(e){function t(t){var n=e.call(this)||this;return n._renderedItems=[],n._selectedIndex=-1,n._owner=t,n}return r(t,e),t.prototype.renderContent=function(){var e=document.createElement("div");e.className="ms-ctrl ms-popup";for(var t=this._owner.selectedIndex,n=0;n<this._owner.items.length;n++){var o=this._owner.items.get(n).render();o.tabIndex=0,e.appendChild(o),n==t&&o.focus(),this._renderedItems.push(o)}return e},t.prototype.keyDown=function(t){e.prototype.keyDown.call(this,t);var n=this._selectedIndex;switch(t.keyCode){case i.KEY_TAB:this.close();break;case i.KEY_ENTER:this.selectedIndex>=0&&(this._owner.selectedIndex=this.selectedIndex,this.close());break;case i.KEY_UP:n<=0?n=this._renderedItems.length-1:--n<0&&(n=this._renderedItems.length-1),this.selectedIndex=n,t.cancelBubble=!0;break;case i.KEY_DOWN:n<0?n=0:++n>=this._renderedItems.length&&(n=0),this.selectedIndex=n,t.cancelBubble=!0}},t.prototype.render=function(t){var n=e.prototype.render.call(this,t);return n.style.minWidth=t.width/2+"px",n.style.maxWidth=t.width+"px",n},Object.defineProperty(t.prototype,"selectedIndex",{get:function(){return this._selectedIndex},set:function(e){e>=0&&e<this._renderedItems.length&&(this._renderedItems[e].focus(),this._selectedIndex=e)},enumerable:!0,configurable:!0}),t}(l.PopupControl);t.DropDownPopupControl=c;var u=function(e){function t(){var t=e.call(this)||this;return t._items=new s.Collection,t._items.onItemAdded=function(e){e.onClick=function(e){t.itemClicked(e)}},t._items.onItemRemoved=function(e){e.onClick=null},t}return r(t,e),t.prototype.itemClicked=function(e){this.selectedItem=e,this.closePopup(),this.rootElement.focus()},t.prototype.validateRootElement=function(e){if(!(e instanceof HTMLDivElement))throw new Error("DropDown requires a DIV element as its root.")},t.prototype.createPopupControl=function(){return new c(this)},t.prototype.getCssClassName=function(){return"ms-ctrl ms-ctrl-dropdown"},t.prototype.attach=function(t){e.prototype.attach.call(this,t);for(var n=0;n<this.rootElement.children.length;n++){var o=this.rootElement.children[n];if("ms-dropdown-item"==o.tagName.toLowerCase()){var r=new a(o.attributes.getNamedItem("key").value,o.attributes.getNamedItem("value").value);this._items.add(r)}}},t.prototype.popup=function(){e.prototype.popup.call(this),this.popupControl.selectedIndex=this.selectedIndex},Object.defineProperty(t.prototype,"items",{get:function(){return this._items},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"selectedItem",{get:function(){return this.value},set:function(e){this.value=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"selectedIndex",{get:function(){return this.items.indexOf(this.value)},set:function(e){e>=0&&this.items.length>e&&(this.selectedItem=this.items.get(e))},enumerable:!0,configurable:!0}),t}(l.InputWithPopup);t.DropDown=u},function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(3),s=n(6),l=function(e){function t(t){var n=e.call(this)||this;return n._owner=t,n}return r(t,e),t.prototype.renderContent=function(){var e=this,t=document.createElement("div");return t.className="ms-ctrl ms-calendarPopup",this._calendar=new s.Calendar,this._calendar.date=this._owner.value,this._calendar.onDateChanged=function(t){e._owner.value=t.date,e.close()},this._calendar.attach(t),t},t.prototype.focus=function(){this._calendar&&this._calendar.focus()},t}(i.PopupControl);t.CalendarPopupControl=l;var a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.validateRootElement=function(e){if(!(e instanceof HTMLDivElement))throw new Error("DatePicker requires a DIV element as its root.")},t.prototype.createPopupControl=function(){return new l(this)},t.prototype.getValueAsString=function(){return this.value.toLocaleDateString()},t.prototype.getCssClassName=function(){return"ms-ctrl ms-ctrl-datePicker"},t.prototype.getButtonIconCssClassName=function(){return"ms-icon-calendar"},t.prototype.popup=function(){e.prototype.popup.call(this),this.isOpen&&this.popupControl.focus()},t}(i.InputWithPopup);t.DatePicker=a},function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._label="",t._checkboxElement=null,t._spanElement=null,t}return r(t,e),t.createId=function(){var e=t.creationIndex;return t.creationIndex++,e},t.prototype.changed=function(){this.onChange&&this.onChange(this)},t.prototype.keyDown=function(e){switch(e.keyCode){case i.KEY_ENTER:this.isChecked=!this.isChecked}},t.prototype.attach=function(n){var o=this;e.prototype.attach.call(this,n),n.className="ms-ctrl ms-ctrl-checkbox",n.tabIndex=0;var r=n.attributes.label;r&&(this._label=r.value);var i=n.attributes.ischecked;i&&(this._isChecked="true"===i.value),this._checkboxElement=document.createElement("input"),this._checkboxElement.id="ms-ctrl-checkbox-"+t.createId(),this._checkboxElement.type="checkbox",this._checkboxElement.style.position="absolute",this._checkboxElement.checked=this.isChecked,this._checkboxElement.onchange=function(e){o.changed()};var s=document.createElement("label");s.htmlFor=this._checkboxElement.id,this._spanElement=document.createElement("span"),this._spanElement.innerText=this._label,s.appendChild(this._spanElement),n.innerHTML="",n.appendChild(this._checkboxElement),n.appendChild(s)},Object.defineProperty(t.prototype,"label",{get:function(){return this._label},set:function(e){this._label=e,this._spanElement&&(this._spanElement.innerText=this._label)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isChecked",{get:function(){return this._isChecked},set:function(e){this._isChecked!=e&&(this._isChecked=e,this._checkboxElement&&(this._checkboxElement.checked=this._isChecked),this.changed())},enumerable:!0,configurable:!0}),t.creationIndex=0,t}(n(1).InputControl);t.CheckBox=s},function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._label="",t._checkboxElement=null,t._spanElement=null,t}return r(t,e),t.createId=function(){var e=t.creationIndex;return t.creationIndex++,e},t.prototype.changed=function(){this.onChange&&this.onChange(this)},t.prototype.keyDown=function(e){switch(e.keyCode){case i.KEY_ENTER:this.isChecked=!this.isChecked}},t.prototype.attach=function(n){var o=this;e.prototype.attach.call(this,n),n.className="ms-ctrl ms-ctrl-radiobutton",n.tabIndex=0;var r=n.attributes.label;r&&(this._label=r.value);var i=n.attributes.ischecked;i&&(this._isChecked="true"===i.value),this._checkboxElement=document.createElement("input"),this._checkboxElement.id="ms-ctrl-radio-"+t.createId(),this._checkboxElement.type="radio",this._checkboxElement.style.position="absolute",this._checkboxElement.checked=this.isChecked,this._checkboxElement.onchange=function(e){o.changed()};var s=n.attributes.groupname;s&&(this._checkboxElement.name=s.value);var l=document.createElement("label");l.htmlFor=this._checkboxElement.id,this._spanElement=document.createElement("span"),this._spanElement.innerText=this._label,l.appendChild(this._spanElement),n.innerHTML="",n.appendChild(this._checkboxElement),n.appendChild(l)},Object.defineProperty(t.prototype,"label",{get:function(){return this._label},set:function(e){this._label=e,this._spanElement&&(this._spanElement.innerText=this._label)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isChecked",{get:function(){return this._isChecked},set:function(e){this._isChecked!=e&&(this._isChecked=e,this._checkboxElement&&(this._checkboxElement.checked=this._isChecked),this.changed())},enumerable:!0,configurable:!0}),t.creationIndex=0,t}(n(1).InputControl);t.RadioButton=s},function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),s=n(1),l=function(){function e(){}return e.prototype.changed=function(){this.onChange&&this.onChange()},e}(),a=function(e){function t(){var t=e.call(this)||this;return t._inputElement=document.createElement("input"),t._inputElement.className="ms-ctrl ms-ctrl-textbox",t._inputElement.type="text",t._inputElement.oninput=function(e){t.changed()},t}return r(t,e),Object.defineProperty(t.prototype,"element",{get:function(){return this._inputElement},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"placeholder",{set:function(e){this._inputElement.placeholder=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"lineCount",{set:function(e){},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"maxLength",{set:function(e){this._inputElement.maxLength!=e&&(this._inputElement.maxLength=e,this.value=this.value.substr(0,e))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this._inputElement.value},set:function(e){this._inputElement.value=e},enumerable:!0,configurable:!0}),t}(l),c=function(e){function t(){var t=e.call(this)||this;return t._textareaElement=document.createElement("textarea"),t._textareaElement.className="ms-ctrl ms-ctrl-textbox ms-ctrl-textbox-multiline",t._textareaElement.oninput=function(e){t.changed()},t}return r(t,e),Object.defineProperty(t.prototype,"element",{get:function(){return this._textareaElement},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"placeholder",{set:function(e){this._textareaElement.placeholder=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"lineCount",{set:function(e){this._textareaElement.rows=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"maxLength",{set:function(e){this._textareaElement.maxLength!=e&&(this._textareaElement.maxLength=e,this.value=this.value.substr(0,e))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this._textareaElement.value},set:function(e){this._textareaElement.value=e},enumerable:!0,configurable:!0}),t}(l),u=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._isMultiline=!1,t._lineCount=3,t}return r(t,e),t.prototype.editBoxChanged=function(){this.onChange&&this.onChange(this)},t.prototype.recreateEditBox=function(){var e=this,t=null;t=this._editBox?this._editBox.value:this.rootElement.innerText,this._isMultiline?this._editBox=new c:this._editBox=new a,t&&(this._editBox.value=t),this._editBox.lineCount=this._lineCount,this._editBox.maxLength=this._maxLength,this._editBox.placeholder=this._placeholder,this._editBox.onChange=function(){e.editBoxChanged()},this.rootElement.innerHTML="",this.rootElement.appendChild(this._editBox.element)},Object.defineProperty(t.prototype,"editBox",{get:function(){return this._editBox||this.recreateEditBox(),this._editBox},enumerable:!0,configurable:!0}),t.prototype.attach=function(t){e.prototype.attach.call(this,t),this._isMultiline=i.getAttributeValueAsBool(t,"ismultiline",!1),this._lineCount=i.getAttributeValueAsInt(t,"lines",3),this._maxLength=i.getAttributeValueAsInt(t,"maxlength",5e4),this._placeholder=i.getAttributeValueAsString(t,"placeholder",null),this.recreateEditBox()},Object.defineProperty(t.prototype,"value",{get:function(){return this.editBox.value},set:function(e){this.editBox.value=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"placeholder",{get:function(){return this._placeholder},set:function(e){this._placeholder=e,this.editBox.placeholder=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isMultiline",{get:function(){return this._isMultiline},set:function(e){this._isMultiline!=e&&(this._isMultiline=e,this.recreateEditBox())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"lineCount",{get:function(){return this._lineCount},set:function(e){e>0&&(this._lineCount=e,this.editBox.lineCount=e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"maxLength",{get:function(){return this._maxLength},set:function(e){e>0&&(this._maxLength=e,this.editBox.maxLength=e)},enumerable:!0,configurable:!0}),t}(s.InputControl);t.TextBox=u},function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),s=n(0),l=n(4),a=function(e){function t(){var t=e.call(this)||this;return t._items=new l.Collection,t._renderedItems=[],t._selectedIndex=-1,t}return r(t,e),t.prototype.renderContent=function(){var e=document.createElement("div");e.className="ms-ctrl ms-popup";for(var t=0;t<this._items.length;t++){var n=this._items.get(t).render();n.tabIndex=0,e.appendChild(n),t==this.selectedIndex&&n.focus(),this._renderedItems.push(n)}return e},t.prototype.keyDown=function(t){e.prototype.keyDown.call(this,t);var n=this._selectedIndex;switch(t.keyCode){case s.KEY_TAB:this.close();break;case s.KEY_UP:n<=0?n=this._renderedItems.length-1:--n<0&&(n=this._renderedItems.length-1),this.selectedIndex=n,t.cancelBubble=!0;break;case s.KEY_DOWN:n<0?n=0:++n>=this._renderedItems.length&&(n=0),this.selectedIndex=n,t.cancelBubble=!0}},t.prototype.popup=function(e){var t=this;if(!this._isOpen){this._overlayElement=document.createElement("div"),this._overlayElement.className="ms-ctrl-overlay",this._overlayElement.tabIndex=0,this._overlayElement.style.zIndex="1000",this._overlayElement.style.width=document.documentElement.scrollWidth+"px",this._overlayElement.style.height=document.documentElement.scrollHeight+"px",this._overlayElement.onfocus=function(e){t.closePopup()},document.body.appendChild(this._overlayElement);var n=e.getBoundingClientRect();this._popupControlElement=this.render(n),this._popupControlElement.classList.remove("ms-ctrl-slide","ms-ctrl-slideLeftToRight","ms-ctrl-slideRightToLeft","ms-ctrl-slideTopToBottom","ms-ctrl-slideRightToLeft"),this._overlayElement.appendChild(this._popupControlElement);var o,r=this._popupControlElement.getBoundingClientRect(),s=window.innerHeight-n.bottom,l=n.top,a=n.left+i.getScrollX();if(l<r.height&&s<r.height){var c=window.innerHeight;this._popupControlElement.style.maxHeight=c+"px",o=c<r.height?i.getScrollY():i.getScrollY()+n.top+(n.height-c)/2;var u=window.innerWidth-n.right;if(n.left<r.width&&u<r.width){var h=window.innerWidth;this._popupControlElement.style.maxWidth=h+"px",a=h<r.width?i.getScrollX():i.getScrollX()+n.left+(n.width-h)/2}else u>=r.width?(a=i.getScrollX()+n.right,this._popupControlElement.classList.add("ms-ctrl-slide","ms-ctrl-slideLeftToRight")):(a=i.getScrollX()+n.left-r.width,this._popupControlElement.classList.add("ms-ctrl-slide","ms-ctrl-slideRightToLeft"))}else s>=r.height?(o=i.getScrollY()+n.bottom,this._popupControlElement.classList.add("ms-ctrl-slide","ms-ctrl-slideTopToBottom")):(o=i.getScrollY()+n.top-r.height,this._popupControlElement.classList.add("ms-ctrl-slide","ms-ctrl-slideBottomToTop"));this._popupControlElement.style.left=a+"px",this._popupControlElement.style.top=o+"px",this._popupControlElement.focus(),this._isOpen=!0}},t.prototype.closePopup=function(){this._isOpen&&(document.body.removeChild(this._overlayElement),this._isOpen=!1)},Object.defineProperty(t.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"items",{get:function(){return this._items},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"selectedIndex",{get:function(){return this._selectedIndex},set:function(e){e>=0&&e<this._renderedItems.length&&(this._renderedItems[e].focus(),this._selectedIndex=e)},enumerable:!0,configurable:!0}),t}(n(3).PopupControl);t.PopupMenu=a},function(e,t,n){var o=n(15);"string"==typeof o&&(o=[[e.i,o,""]]);var r={hmr:!0,transform:void 0,insertInto:void 0};n(16)(o,r);o.locals&&(e.exports=o.locals)},function(e,t,n){},function(e,t,n){var o,r,i={},s=(o=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===r&&(r=o.apply(this,arguments)),r}),l=function(e){var t={};return function(e,n){if("function"==typeof e)return e();if(void 0===t[e]){var o=function(e,t){return t?t.querySelector(e):document.querySelector(e)}.call(this,e,n);if(window.HTMLIFrameElement&&o instanceof window.HTMLIFrameElement)try{o=o.contentDocument.head}catch(e){o=null}t[e]=o}return t[e]}}(),a=null,c=0,u=[],h=n(17);function p(e,t){for(var n=0;n<e.length;n++){var o=e[n],r=i[o.id];if(r){r.refs++;for(var s=0;s<r.parts.length;s++)r.parts[s](o.parts[s]);for(;s<o.parts.length;s++)r.parts.push(b(o.parts[s],t))}else{var l=[];for(s=0;s<o.parts.length;s++)l.push(b(o.parts[s],t));i[o.id]={id:o.id,refs:1,parts:l}}}}function d(e,t){for(var n=[],o={},r=0;r<e.length;r++){var i=e[r],s=t.base?i[0]+t.base:i[0],l={css:i[1],media:i[2],sourceMap:i[3]};o[s]?o[s].parts.push(l):n.push(o[s]={id:s,parts:[l]})}return n}function f(e,t){var n=l(e.insertInto);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var o=u[u.length-1];if("top"===e.insertAt)o?o.nextSibling?n.insertBefore(t,o.nextSibling):n.appendChild(t):n.insertBefore(t,n.firstChild),u.push(t);else if("bottom"===e.insertAt)n.appendChild(t);else{if("object"!=typeof e.insertAt||!e.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var r=l(e.insertAt.before,n);n.insertBefore(t,r)}}function m(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e);var t=u.indexOf(e);t>=0&&u.splice(t,1)}function _(e){var t=document.createElement("style");if(void 0===e.attrs.type&&(e.attrs.type="text/css"),void 0===e.attrs.nonce){var o=function(){0;return n.nc}();o&&(e.attrs.nonce=o)}return y(t,e.attrs),f(e,t),t}function y(e,t){Object.keys(t).forEach(function(n){e.setAttribute(n,t[n])})}function b(e,t){var n,o,r,i;if(t.transform&&e.css){if(!(i="function"==typeof t.transform?t.transform(e.css):t.transform.default(e.css)))return function(){};e.css=i}if(t.singleton){var s=c++;n=a||(a=_(t)),o=E.bind(null,n,s,!1),r=E.bind(null,n,s,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(e){var t=document.createElement("link");return void 0===e.attrs.type&&(e.attrs.type="text/css"),e.attrs.rel="stylesheet",y(t,e.attrs),f(e,t),t}(t),o=function(e,t,n){var o=n.css,r=n.sourceMap,i=void 0===t.convertToAbsoluteUrls&&r;(t.convertToAbsoluteUrls||i)&&(o=h(o));r&&(o+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var s=new Blob([o],{type:"text/css"}),l=e.href;e.href=URL.createObjectURL(s),l&&URL.revokeObjectURL(l)}.bind(null,n,t),r=function(){m(n),n.href&&URL.revokeObjectURL(n.href)}):(n=_(t),o=function(e,t){var n=t.css,o=t.media;o&&e.setAttribute("media",o);if(e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}.bind(null,n),r=function(){m(n)});return o(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;o(e=t)}else r()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(t=t||{}).attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||"boolean"==typeof t.singleton||(t.singleton=s()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var n=d(e,t);return p(n,t),function(e){for(var o=[],r=0;r<n.length;r++){var s=n[r];(l=i[s.id]).refs--,o.push(l)}e&&p(d(e,t),t);for(r=0;r<o.length;r++){var l;if(0===(l=o[r]).refs){for(var a=0;a<l.parts.length;a++)l.parts[a]();delete i[l.id]}}}};var g,v=(g=[],function(e,t){return g[e]=t,g.filter(Boolean).join("\n")});function E(e,t,n,o){var r=n?"":o.css;if(e.styleSheet)e.styleSheet.cssText=v(t,r);else{var i=document.createTextNode(r),s=e.childNodes;s[t]&&e.removeChild(s[t]),s.length?e.insertBefore(i,s[t]):e.appendChild(i)}}},function(e,t){e.exports=function(e){var t="undefined"!=typeof window&&window.location;if(!t)throw new Error("fixUrls requires window.location");if(!e||"string"!=typeof e)return e;var n=t.protocol+"//"+t.host,o=n+t.pathname.replace(/\/[^\/]*$/,"/");return e.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(e,t){var r,i=t.trim().replace(/^"(.*)"$/,function(e,t){return t}).replace(/^'(.*)'$/,function(e,t){return t});return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(i)?e:(r=0===i.indexOf("//")?i:0===i.indexOf("/")?n+i:o+i.replace(/^\.\//,""),"url("+JSON.stringify(r)+")")})}}])}); | ||
//# sourceMappingURL=adaptivecards-controls.min.js.map |
@@ -8,3 +8,3 @@ "use strict"; | ||
return extendStatics(d, b); | ||
} | ||
}; | ||
return function (d, b) { | ||
@@ -11,0 +11,0 @@ extendStatics(d, b); |
@@ -8,3 +8,3 @@ "use strict"; | ||
return extendStatics(d, b); | ||
} | ||
}; | ||
return function (d, b) { | ||
@@ -11,0 +11,0 @@ extendStatics(d, b); |
@@ -8,3 +8,3 @@ "use strict"; | ||
return extendStatics(d, b); | ||
} | ||
}; | ||
return function (d, b) { | ||
@@ -11,0 +11,0 @@ extendStatics(d, b); |
@@ -8,3 +8,3 @@ "use strict"; | ||
return extendStatics(d, b); | ||
} | ||
}; | ||
return function (d, b) { | ||
@@ -11,0 +11,0 @@ extendStatics(d, b); |
@@ -8,3 +8,3 @@ "use strict"; | ||
return extendStatics(d, b); | ||
} | ||
}; | ||
return function (d, b) { | ||
@@ -11,0 +11,0 @@ extendStatics(d, b); |
@@ -8,3 +8,3 @@ "use strict"; | ||
return extendStatics(d, b); | ||
} | ||
}; | ||
return function (d, b) { | ||
@@ -11,0 +11,0 @@ extendStatics(d, b); |
@@ -8,3 +8,3 @@ "use strict"; | ||
return extendStatics(d, b); | ||
} | ||
}; | ||
return function (d, b) { | ||
@@ -11,0 +11,0 @@ extendStatics(d, b); |
@@ -8,3 +8,3 @@ "use strict"; | ||
return extendStatics(d, b); | ||
} | ||
}; | ||
return function (d, b) { | ||
@@ -11,0 +11,0 @@ extendStatics(d, b); |
{ | ||
"name": "adaptivecards-controls", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"description": "A library of pure JS/HTML controls designed for use with Adaptive Cards.", | ||
@@ -12,3 +12,4 @@ "author": "Microsoft", | ||
"lib", | ||
"dist" | ||
"dist", | ||
"src" | ||
], | ||
@@ -21,24 +22,11 @@ "scripts": { | ||
"dts": "dts-generator --name adaptivecards-controls --project . --out dist/adaptivecards-controls.d.ts", | ||
"version": "npm run clean && npm run build && webpack --mode=production && npm run dts" | ||
"release": "npm run clean && npm run build && webpack --mode=production && npm run dts" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.1.2", | ||
"@types/node": "0.0.2", | ||
"awesome-typescript-loader": "^5.2.1", | ||
"clean-webpack-plugin": "^0.1.19", | ||
"copy-webpack-plugin": "^4.6.0", | ||
"css-loader": "^1.0.0", | ||
"dts-generator": "^2.1.0", | ||
"json-loader": "0.5.4", | ||
"mini-css-extract-plugin": "^0.4.4", | ||
"rimraf": "^2.6.2", | ||
"style-loader": "^0.23.1", | ||
"ts-loader": "^5.2.2", | ||
"tslint": "^4.4.2", | ||
"typescript": "^3.0.3", | ||
"typings-for-css-modules-loader": "^1.7.0", | ||
"webpack": "^4.21.0", | ||
"typescript": "^3.2.2", | ||
"webpack": "^4.27.1", | ||
"webpack-cli": "^3.1.2", | ||
"webpack-dev-server": "^3.1.9" | ||
"webpack-dev-server": "^3.1.14" | ||
} | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
638742
5
67
6919