Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

adaptivecards-controls

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

adaptivecards-controls - npm Package Compare versions

Comparing version 0.3.6 to 0.3.7

81

dist/adaptivecards-controls.d.ts

@@ -5,2 +5,3 @@ declare module 'adaptivecards-controls/constants' {

export const KEY_ESCAPE = 27;
export const KEY_SPACE = 32;
export const KEY_UP = 38;

@@ -60,3 +61,3 @@ export const KEY_DOWN = 40;

indexOf(item: TItem): number;
readonly length: number;
get length(): number;
}

@@ -70,3 +71,3 @@

protected keyDown(e: KeyboardEvent): void;
protected readonly rootElement: HTMLElement;
protected get rootElement(): HTMLElement;
attach(rootElement: HTMLElement): void;

@@ -89,3 +90,3 @@ }

closePopup(wasCancelled: boolean): void;
readonly isOpen: boolean;
get isOpen(): boolean;
}

@@ -100,3 +101,3 @@ export abstract class InputWithPopup<TPopupControl extends PopupControl, TValue> extends InputControl {

private updateLabel;
protected readonly popupControl: TPopupControl;
protected get popupControl(): TPopupControl;
protected abstract createPopupControl(): TPopupControl;

@@ -111,5 +112,8 @@ protected abstract getCssClassName(): string;

closePopup(wasCancelled: boolean): void;
readonly isOpen: boolean;
placeholderText: string;
value: TValue;
get labelId(): string;
get isOpen(): boolean;
get placeholderText(): string;
set placeholderText(value: string);
get value(): TValue;
set value(newValue: TValue);
}

@@ -130,4 +134,6 @@

focus(): void;
isSubdued: boolean;
isSelected: boolean;
get isSubdued(): boolean;
set isSubdued(value: boolean);
get isSelected(): boolean;
set isSelected(value: boolean);
}

@@ -142,3 +148,4 @@ export class Calendar extends InputControl {

private generateDayCells;
private selectedDayCell;
private get selectedDayCell();
private set selectedDayCell(value);
private initializeSelection;

@@ -150,3 +157,4 @@ private rebuildMiniCalendar;

focus(): void;
date: Date;
get date(): Date;
set date(value: Date);
}

@@ -167,3 +175,4 @@

render(): HTMLElement;
value: string;
get value(): string;
set value(newValue: string);
}

@@ -178,6 +187,8 @@ export class DropDownPopupControl extends PopupControl {

render(rootElementBounds: ClientRect): HTMLElement;
selectedIndex: number;
get selectedIndex(): number;
set selectedIndex(index: number);
}
export class DropDown extends InputWithPopup<DropDownPopupControl, DropDownItem> {
private _items;
private _parentLabelId;
private itemClicked;

@@ -190,5 +201,9 @@ protected validateRootElement(rootElement: HTMLElement): void;

popup(): void;
readonly items: Collection<DropDownItem>;
selectedItem: DropDownItem;
selectedIndex: number;
get items(): Collection<DropDownItem>;
get selectedItem(): DropDownItem;
set selectedItem(newValue: DropDownItem);
get selectedIndex(): number;
set selectedIndex(index: number);
get parentLabelId(): string;
set parentLabelId(value: string);
}

@@ -229,4 +244,6 @@

attach(rootElement: HTMLElement): void;
label: string;
isChecked: boolean;
get label(): string;
set label(value: string);
get isChecked(): boolean;
set isChecked(value: boolean);
}

@@ -248,4 +265,6 @@

attach(rootElement: HTMLElement): void;
label: string;
isChecked: boolean;
get label(): string;
set label(value: string);
get isChecked(): boolean;
set isChecked(value: boolean);
}

@@ -264,10 +283,15 @@

private recreateEditBox;
private readonly editBox;
private get editBox();
onChange: (sender: TextBox) => void;
attach(rootElement: HTMLElement): void;
value: string;
placeholder: string;
isMultiline: boolean;
lineCount: number;
maxLength: number;
get value(): string;
set value(newValue: string);
get placeholder(): string;
set placeholder(value: string);
get isMultiline(): boolean;
set isMultiline(value: boolean);
get lineCount(): number;
set lineCount(value: number);
get maxLength(): number;
set maxLength(value: number);
}

@@ -287,4 +311,5 @@

keyDown(e: KeyboardEvent): void;
readonly items: Collection<DropDownItem>;
selectedIndex: number;
get items(): Collection<DropDownItem>;
get selectedIndex(): number;
set selectedIndex(index: number);
}

@@ -291,0 +316,0 @@

@@ -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 i=t[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,n),i.l=!0,i.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 i in e)n.d(o,i,function(t){return e[t]}.bind(null,i));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),i=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 r(e,t){var n=new Date(e.getTime());return n.setDate(n.getDate()+t),n}t.CalendarSettings=i,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=r,t.addMonths=function(e,t){var n=new Date(e.getTime()),o=n.getMonth()+t;return n.setMonth(o),n.getMonth()!==(o%i.monthsInYear+i.monthsInYear)%i.monthsInYear&&(n=r(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 i=parseInt(o.value);if(!isNaN(i))return i}return n}},function(e,t,n){"use strict";var o,i=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 r=n(0),s=n(2),l=n(1),a=function(){function e(){this._isOpen=!1}return e.prototype.keyDown=function(e){switch(e.keyCode){case r.KEY_ESCAPE:this.closePopup(!0)}},e.prototype.render=function(e){var t=this,n=document.createElement("div");return n.tabIndex=0,n.className="ms-ctrl ms-ctrl-popup-container",n.onkeydown=function(e){return t.keyDown(e),!e.cancelBubble},n.appendChild(this.renderContent()),n},e.prototype.focus=function(){this._popupElement&&this._popupElement.firstElementChild.focus()},e.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.width=document.documentElement.scrollWidth+"px",this._overlayElement.style.height=document.documentElement.scrollHeight+"px",this._overlayElement.onfocus=function(e){t.closePopup(!0)},document.body.appendChild(this._overlayElement);var n=e.getBoundingClientRect();this._popupElement=this.render(n),this._popupElement.classList.remove("ms-ctrl-slide","ms-ctrl-slideLeftToRight","ms-ctrl-slideRightToLeft","ms-ctrl-slideTopToBottom","ms-ctrl-slideRightToLeft"),this._overlayElement.appendChild(this._popupElement);var o,i=this._popupElement.getBoundingClientRect(),r=window.innerHeight-n.bottom,l=n.top,a=(window.innerWidth,n.left),c=(a=window.innerWidth-n.right,n.left),u=n.left+s.getScrollX();if(l<i.height&&r<i.height){var h=Math.min(i.height,window.innerHeight);if(this._popupElement.style.maxHeight=h+"px",o=h<i.height?s.getScrollY():s.getScrollY()+n.top+(n.height-h)/2,c<i.width&&a<i.width){var p=Math.min(i.width,window.innerWidth);this._popupElement.style.maxWidth=p+"px",u=p<i.width?s.getScrollX():s.getScrollX()+n.left+(n.width-p)/2}else a>=i.width?(u=s.getScrollX()+n.right,this._popupElement.classList.add("ms-ctrl-slide","ms-ctrl-slideLeftToRight")):(u=s.getScrollX()+n.left-i.width,this._popupElement.classList.add("ms-ctrl-slide","ms-ctrl-slideRightToLeft"))}else r>=i.height?(o=s.getScrollY()+n.bottom,this._popupElement.classList.add("ms-ctrl-slide","ms-ctrl-slideTopToBottom")):(o=s.getScrollY()+n.top-i.height,this._popupElement.classList.add("ms-ctrl-slide","ms-ctrl-slideBottomToTop")),a<i.width&&(u=s.getScrollX()+n.right-i.width);this._popupElement.style.left=u+"px",this._popupElement.style.top=o+"px",this._popupElement.focus(),this._isOpen=!0}},e.prototype.closePopup=function(e){this._isOpen&&(document.body.removeChild(this._overlayElement),this._isOpen=!1,this.onClose&&this.onClose(this,e))},Object.defineProperty(e.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!0,configurable:!0}),e}();t.PopupControl=a;var c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(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(!0)})),this.rootElement.onclick=function(e){n.isOpen?n.closePopup(!0):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;this._popupControl=this.createPopupControl(),this._popupControl=this.createPopupControl(),this._popupControl.onClose=function(t,n){e.closePopup(n),e.rootElement.focus()},this._popupControl.popup(this.rootElement)},t.prototype.closePopup=function(e){this.popupControl&&this.popupControl.closePopup(e)},Object.defineProperty(t.prototype,"isOpen",{get:function(){return!!this._popupControl&&this._popupControl.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,i=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 r=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 i=document.createElement("i");return i.className="ms-icon ms-ctrl-calendarNavButton ms-icon-chevronLeft",i.tabIndex=0,i.onclick=function(e){t.date=r.addMonths(t.date,-1)},i.onkeydown=function(e){if(e.keyCode==s.KEY_ENTER)return t.date=r.addMonths(t.date,-1),!1},o.appendChild(i),(i=document.createElement("i")).className="ms-icon ms-ctrl-calendarNavButton ms-icon-chevronRight",i.tabIndex=0,i.onclick=function(e){t.date=r.addMonths(t.date,1)},i.onkeydown=function(e){if(e.keyCode==s.KEY_ENTER)return t.date=r.addMonths(t.date,1),!1},o.appendChild(i),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 i(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)),l=i.getDay();l-r.CalendarSettings.firstDayOfWeek>0&&(i=r.addDays(i,r.CalendarSettings.firstDayOfWeek-l));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 m=new a(i);m.onSelected=function(e){t.selectedDayCell=e,t.onDateChanged&&t.onDateChanged(t)},this._days.push(m);var f=i.getDate()==h&&i.getMonth()==p&&i.getFullYear()==d;i=r.addDays(i,1)}while(!f)},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}(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))},function(e,t,n){"use strict";var o,i=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 r=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 i(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.closePopup(!0);break;case r.KEY_ENTER:this.selectedIndex>=0&&(this._owner.selectedIndex=this.selectedIndex,this.closePopup(!1));break;case r.KEY_UP:(n<=0||--n<0)&&(n=this._renderedItems.length-1),this.selectedIndex=n,t.cancelBubble=!0;break;case r.KEY_DOWN:(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 i(t,e),t.prototype.itemClicked=function(e){this.selectedItem=e,this.closePopup(!1),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 i=new a(o.attributes.getNamedItem("key").value,o.attributes.getNamedItem("value").value);this._items.add(i)}}},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,i=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 r=n(3),s=n(6),l=function(e){function t(t){var n=e.call(this)||this;return n._owner=t,n}return i(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.closePopup(!1)},this._calendar.attach(t),t},t.prototype.focus=function(){this._calendar&&this._calendar.focus()},t}(r.PopupControl);t.CalendarPopupControl=l;var a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(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}(r.InputWithPopup);t.DatePicker=a},function(e,t,n){"use strict";var o,i=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 r=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 i(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 i=n.attributes.label;i&&(this._label=i.value);var r=n.attributes.ischecked;r&&(this._isChecked="true"===r.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,i=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 r=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 i(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 i=n.attributes.label;i&&(this._label=i.value);var r=n.attributes.ischecked;r&&(this._isChecked="true"===r.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,i=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 r=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 i(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 i(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 i(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=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}(s.InputControl);t.TextBox=u},function(e,t,n){"use strict";var o,i=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 r=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 i(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 r.KEY_TAB:this.closePopup(!0);break;case r.KEY_UP:(n<=0||--n<0)&&(n=this._renderedItems.length-1),this.selectedIndex=n,t.cancelBubble=!0;break;case r.KEY_DOWN:(n<0||++n>=this._renderedItems.length)&&(n=0),this.selectedIndex=n,t.cancelBubble=!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){"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 i=t[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,n),i.l=!0,i.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 i in e)n.d(o,i,function(t){return e[t]}.bind(null,i));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=9)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KEY_DELETE=t.KEY_DOWN=t.KEY_UP=t.KEY_SPACE=t.KEY_ESCAPE=t.KEY_ENTER=t.KEY_TAB=void 0,t.KEY_TAB=9,t.KEY_ENTER=13,t.KEY_ESCAPE=27,t.KEY_SPACE=32,t.KEY_UP=38,t.KEY_DOWN=40,t.KEY_DELETE=46},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InputControl=void 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:!1,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}),t.getAttributeValueAsInt=t.getAttributeValueAsString=t.getAttributeValueAsBool=t.getScrollY=t.getScrollX=t.areDatesEqual=t.addMonths=t.addDays=t.daysInMonth=t.CalendarSettings=void 0;var o=n(5),i=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 r(e,t){var n=new Date(e.getTime());return n.setDate(n.getDate()+t),n}t.CalendarSettings=i,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=r,t.addMonths=function(e,t){var n=new Date(e.getTime()),o=n.getMonth()+t;return n.setMonth(o),n.getMonth()!==(o%i.monthsInYear+i.monthsInYear)%i.monthsInYear&&(n=r(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 i=parseInt(o.value);if(!isNaN(i))return i}return n}},function(e,t,n){"use strict";var o,i=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}),t.InputWithPopup=t.PopupControl=void 0;var r=n(0),s=n(2),l=n(1),a=n(10),c=function(){function e(){this._isOpen=!1}return e.prototype.keyDown=function(e){switch(e.keyCode){case r.KEY_ESCAPE:this.closePopup(!0)}},e.prototype.render=function(e){var t=this,n=document.createElement("div");return n.tabIndex=0,n.className="ms-ctrl ms-ctrl-popup-container",n.setAttribute("role","dialog"),n.setAttribute("aria-modal","true"),n.onkeydown=function(e){return t.keyDown(e),!e.cancelBubble},n.appendChild(this.renderContent()),n},e.prototype.focus=function(){this._popupElement&&this._popupElement.firstElementChild.focus()},e.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.width=document.documentElement.scrollWidth+"px",this._overlayElement.style.height=document.documentElement.scrollHeight+"px",this._overlayElement.onfocus=function(e){t.closePopup(!0)},document.body.appendChild(this._overlayElement);var n=e.getBoundingClientRect();this._popupElement=this.render(n),this._popupElement.classList.remove("ms-ctrl-slide","ms-ctrl-slideLeftToRight","ms-ctrl-slideRightToLeft","ms-ctrl-slideTopToBottom","ms-ctrl-slideRightToLeft"),window.addEventListener("resize",(function(e){t.closePopup(!0)}));var o=e.getAttribute("aria-label");o&&this._popupElement.setAttribute("aria-label",o),this._overlayElement.appendChild(this._popupElement);var i,r=this._popupElement.getBoundingClientRect(),l=window.innerHeight-n.bottom,a=n.top,c=(window.innerWidth,n.left),u=(c=window.innerWidth-n.right,n.left),d=n.left+s.getScrollX();if(a<r.height&&l<r.height){var h=Math.min(r.height,window.innerHeight);if(this._popupElement.style.maxHeight=h+"px",i=h<r.height?s.getScrollY():s.getScrollY()+n.top+(n.height-h)/2,u<r.width&&c<r.width){var p=Math.min(r.width,window.innerWidth);this._popupElement.style.maxWidth=p+"px",d=p<r.width?s.getScrollX():s.getScrollX()+n.left+(n.width-p)/2}else c>=r.width?(d=s.getScrollX()+n.right,this._popupElement.classList.add("ms-ctrl-slide","ms-ctrl-slideLeftToRight")):(d=s.getScrollX()+n.left-r.width,this._popupElement.classList.add("ms-ctrl-slide","ms-ctrl-slideRightToLeft"))}else l>=r.height?(i=s.getScrollY()+n.bottom,this._popupElement.classList.add("ms-ctrl-slide","ms-ctrl-slideTopToBottom")):(i=s.getScrollY()+n.top-r.height,this._popupElement.classList.add("ms-ctrl-slide","ms-ctrl-slideBottomToTop")),c<r.width&&(d=s.getScrollX()+n.right-r.width);this._popupElement.style.left=d+"px",this._popupElement.style.top=i+"px",this._popupElement.focus(),this._isOpen=!0}},e.prototype.closePopup=function(e){this._isOpen&&(document.body.removeChild(this._overlayElement),this._isOpen=!1,this.onClose&&this.onClose(this,e))},Object.defineProperty(e.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),e}();t.PopupControl=c;var u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(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:!1,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(!0)})),this.rootElement.onclick=function(e){n.isOpen?n.closePopup(!0):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._labelElement.id=a.v4(),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;this._popupControl=this.createPopupControl(),this._popupControl.onClose=function(t,n){e.closePopup(n),e.rootElement.focus()},this._popupControl.popup(this.rootElement)},t.prototype.closePopup=function(e){this.popupControl&&this.popupControl.closePopup(e)},Object.defineProperty(t.prototype,"labelId",{get:function(){if(this._labelElement)return this._labelElement.id},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isOpen",{get:function(){return!!this._popupControl&&this._popupControl.isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"placeholderText",{get:function(){return this._placeholderText},set:function(e){this._placeholderText=e},enumerable:!1,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:!1,configurable:!0}),t}(l.InputControl);t.InputWithPopup=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Collection=void 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:!1,configurable:!0}),e}();t.Collection=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DayOfWeek=void 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){var n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(n){var o=new Uint8Array(16);e.exports=function(){return n(o),o}}else{var i=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),i[t]=e>>>((3&t)<<3)&255;return i}}},function(e,t){for(var n=[],o=0;o<256;++o)n[o]=(o+256).toString(16).substr(1);e.exports=function(e,t){var o=t||0,i=n;return[i[e[o++]],i[e[o++]],i[e[o++]],i[e[o++]],"-",i[e[o++]],i[e[o++]],"-",i[e[o++]],i[e[o++]],"-",i[e[o++]],i[e[o++]],"-",i[e[o++]],i[e[o++]],i[e[o++]],i[e[o++]],i[e[o++]],i[e[o++]]].join("")}},function(e,t,n){"use strict";var o,i=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}),t.Calendar=t.DayCell=void 0;var r=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:!1,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:!1,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 i=document.createElement("i");return i.className="ms-icon ms-ctrl-calendarNavButton ms-icon-chevronLeft",i.tabIndex=0,i.onclick=function(e){t.date=r.addMonths(t.date,-1)},i.onkeydown=function(e){if(e.keyCode==s.KEY_ENTER)return t.date=r.addMonths(t.date,-1),!1},o.appendChild(i),(i=document.createElement("i")).className="ms-icon ms-ctrl-calendarNavButton ms-icon-chevronRight",i.tabIndex=0,i.onclick=function(e){t.date=r.addMonths(t.date,1)},i.onkeydown=function(e){if(e.keyCode==s.KEY_ENTER)return t.date=r.addMonths(t.date,1),!1},o.appendChild(i),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 i(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)),l=i.getDay();l-r.CalendarSettings.firstDayOfWeek>0&&(i=r.addDays(i,r.CalendarSettings.firstDayOfWeek-l));var c=s.getDay(),u=r.CalendarSettings.firstDayOfWeek+6;u-c>0&&(s=r.addDays(s,u-c));var d=s.getDate(),h=s.getMonth(),p=s.getFullYear();do{var m=new a(i);m.onSelected=function(e){t.selectedDayCell=e,t.onDateChanged&&t.onDateChanged(t)},this._days.push(m);var f=i.getDate()==d&&i.getMonth()==h&&i.getFullYear()==p;i=r.addDays(i,1)}while(!f)},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:!1,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:!1,configurable:!0}),t}(l.InputControl);t.Calendar=c},function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n),Object.defineProperty(e,o,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||t.hasOwnProperty(n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(0),t),i(n(5),t),i(n(2),t),i(n(4),t),i(n(1),t),i(n(3),t),i(n(8),t),i(n(13),t),i(n(14),t),i(n(15),t),i(n(16),t),i(n(17),t),i(n(18),t)},function(e,t,n){var o=n(11),i=n(12),r=i;r.v1=o,r.v4=i,e.exports=r},function(e,t,n){var o,i,r=n(6),s=n(7),l=0,a=0;e.exports=function(e,t,n){var c=t&&n||0,u=t||[],d=(e=e||{}).node||o,h=void 0!==e.clockseq?e.clockseq:i;if(null==d||null==h){var p=r();null==d&&(d=o=[1|p[0],p[1],p[2],p[3],p[4],p[5]]),null==h&&(h=i=16383&(p[6]<<8|p[7]))}var m=void 0!==e.msecs?e.msecs:(new Date).getTime(),f=void 0!==e.nsecs?e.nsecs:a+1,_=m-l+(f-a)/1e4;if(_<0&&void 0===e.clockseq&&(h=h+1&16383),(_<0||m>l)&&void 0===e.nsecs&&(f=0),f>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");l=m,a=f,i=h;var y=(1e4*(268435455&(m+=122192928e5))+f)%4294967296;u[c++]=y>>>24&255,u[c++]=y>>>16&255,u[c++]=y>>>8&255,u[c++]=255&y;var b=m/4294967296*1e4&268435455;u[c++]=b>>>8&255,u[c++]=255&b,u[c++]=b>>>24&15|16,u[c++]=b>>>16&255,u[c++]=h>>>8|128,u[c++]=255&h;for(var g=0;g<6;++g)u[c+g]=d[g];return t||s(u)}},function(e,t,n){var o=n(6),i=n(7);e.exports=function(e,t,n){var r=t&&n||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var s=(e=e||{}).random||(e.rng||o)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,t)for(var l=0;l<16;++l)t[r+l]=s[l];return t||i(s)}},function(e,t,n){"use strict";var o,i=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}),t.DropDown=t.DropDownPopupControl=t.DropDownItem=void 0;var r=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.setAttribute("role","option"),this._element.setAttribute("aria-selected","false"),this._element.onmouseup=function(t){e.click()},this._element.onkeydown=function(t){t.keyCode===r.KEY_ENTER&&(e.click(),t.cancelBubble=!0)}),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:!1,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 i(t,e),t.prototype.renderContent=function(){var e=document.createElement("div");e.className="ms-ctrl ms-popup",e.setAttribute("role","listbox");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.closePopup(!0);break;case r.KEY_ENTER:this.selectedIndex>=0&&(this._owner.selectedIndex=this.selectedIndex,this.closePopup(!1));break;case r.KEY_UP:(n<=0||--n<0)&&(n=this._renderedItems.length-1),this.selectedIndex=n,t.cancelBubble=!0;break;case r.KEY_DOWN:(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},Object.defineProperty(t.prototype,"selectedIndex",{get:function(){return this._selectedIndex},set:function(e){e>=0&&e<this._renderedItems.length&&(this._selectedIndex>=0&&this._selectedIndex<this._renderedItems.length&&this._renderedItems[this._selectedIndex].setAttribute("aria-selected","false"),this._renderedItems[e].focus(),this._renderedItems[e].setAttribute("aria-selected","true"),this._selectedIndex=e)},enumerable:!1,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 i(t,e),t.prototype.itemClicked=function(e){this.selectedItem=e,this.closePopup(!1),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 i=new a(o.attributes.getNamedItem("key").value,o.attributes.getNamedItem("value").value);this._items.add(i)}}var r=[];this.parentLabelId&&r.push(this.parentLabelId),this.labelId&&r.push(this.labelId),r.length>0&&this.rootElement.setAttribute("aria-labelledby",r.join(" "))},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:!1,configurable:!0}),Object.defineProperty(t.prototype,"selectedItem",{get:function(){return this.value},set:function(e){this.value=e},enumerable:!1,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:!1,configurable:!0}),Object.defineProperty(t.prototype,"parentLabelId",{get:function(){return this._parentLabelId},set:function(e){this._parentLabelId=e},enumerable:!1,configurable:!0}),t}(l.InputWithPopup);t.DropDown=u},function(e,t,n){"use strict";var o,i=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}),t.DatePicker=t.CalendarPopupControl=void 0;var r=n(3),s=n(8),l=function(e){function t(t){var n=e.call(this)||this;return n._owner=t,n}return i(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.closePopup(!1)},this._calendar.attach(t),t},t.prototype.focus=function(){this._calendar&&this._calendar.focus()},t}(r.PopupControl);t.CalendarPopupControl=l;var a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(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}(r.InputWithPopup);t.DatePicker=a},function(e,t,n){"use strict";var o,i=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}),t.CheckBox=void 0;var r=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 i(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 i=n.attributes.label;i&&(this._label=i.value);var r=n.attributes.ischecked;r&&(this._isChecked="true"===r.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:!1,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:!1,configurable:!0}),t.creationIndex=0,t}(n(1).InputControl);t.CheckBox=s},function(e,t,n){"use strict";var o,i=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}),t.RadioButton=void 0;var r=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 i(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 i=n.attributes.label;i&&(this._label=i.value);var r=n.attributes.ischecked;r&&(this._isChecked="true"===r.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:!1,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:!1,configurable:!0}),t.creationIndex=0,t}(n(1).InputControl);t.RadioButton=s},function(e,t,n){"use strict";var o,i=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}),t.TextBox=void 0;var r=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 i(t,e),Object.defineProperty(t.prototype,"element",{get:function(){return this._inputElement},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"placeholder",{set:function(e){this._inputElement.placeholder=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lineCount",{set:function(e){},enumerable:!1,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:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this._inputElement.value},set:function(e){this._inputElement.value=e},enumerable:!1,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 i(t,e),Object.defineProperty(t.prototype,"element",{get:function(){return this._textareaElement},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"placeholder",{set:function(e){this._textareaElement.placeholder=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lineCount",{set:function(e){this._textareaElement.rows=e},enumerable:!1,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:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this._textareaElement.value},set:function(e){this._textareaElement.value=e},enumerable:!1,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 i(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:!1,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:!1,configurable:!0}),Object.defineProperty(t.prototype,"placeholder",{get:function(){return this._placeholder},set:function(e){this._placeholder=e,this.editBox.placeholder=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isMultiline",{get:function(){return this._isMultiline},set:function(e){this._isMultiline!=e&&(this._isMultiline=e,this.recreateEditBox())},enumerable:!1,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:!1,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:!1,configurable:!0}),t}(s.InputControl);t.TextBox=u},function(e,t,n){"use strict";var o,i=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}),t.PopupMenu=void 0;var r=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 i(t,e),t.prototype.renderContent=function(){var e=document.createElement("div");e.className="ms-ctrl ms-popup",e.setAttribute("role","listbox");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 r.KEY_TAB:this.closePopup(!0);break;case r.KEY_UP:(n<=0||--n<0)&&(n=this._renderedItems.length-1),this.selectedIndex=n,t.cancelBubble=!0;break;case r.KEY_DOWN:(n<0||++n>=this._renderedItems.length)&&(n=0),this.selectedIndex=n,t.cancelBubble=!0}},Object.defineProperty(t.prototype,"items",{get:function(){return this._items},enumerable:!1,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:!1,configurable:!0}),t}(n(3).PopupControl);t.PopupMenu=l}])}));
//# sourceMappingURL=adaptivecards-controls.min.js.map
"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
__export(require("./constants"));
__export(require("./enums"));
__export(require("./utils"));
__export(require("./collection"));
__export(require("./inputcontrol"));
__export(require("./inputwithpopup"));
__export(require("./calendar"));
__export(require("./dropdown"));
__export(require("./datepicker"));
__export(require("./checkbox"));
__export(require("./radiobutton"));
__export(require("./textbox"));
__export(require("./popupmenu"));
__exportStar(require("./constants"), exports);
__exportStar(require("./enums"), exports);
__exportStar(require("./utils"), exports);
__exportStar(require("./collection"), exports);
__exportStar(require("./inputcontrol"), exports);
__exportStar(require("./inputwithpopup"), exports);
__exportStar(require("./calendar"), exports);
__exportStar(require("./dropdown"), exports);
__exportStar(require("./datepicker"), exports);
__exportStar(require("./checkbox"), exports);
__exportStar(require("./radiobutton"), exports);
__exportStar(require("./textbox"), exports);
__exportStar(require("./popupmenu"), exports);
//# sourceMappingURL=adaptivecards-controls.js.map

@@ -12,4 +12,6 @@ import { InputControl } from "./inputcontrol";

focus(): void;
isSubdued: boolean;
isSelected: boolean;
get isSubdued(): boolean;
set isSubdued(value: boolean);
get isSelected(): boolean;
set isSelected(value: boolean);
}

@@ -24,3 +26,4 @@ export declare class Calendar extends InputControl {

private generateDayCells;
private selectedDayCell;
private get selectedDayCell();
private set selectedDayCell(value);
private initializeSelection;

@@ -32,3 +35,4 @@ private rebuildMiniCalendar;

focus(): void;
date: Date;
get date(): Date;
set date(value: Date);
}

@@ -16,2 +16,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.Calendar = exports.DayCell = void 0;
// Copyright (c) Microsoft Corporation. All rights reserved.

@@ -64,3 +65,3 @@ // Licensed under the MIT License.

},
enumerable: true,
enumerable: false,
configurable: true

@@ -81,3 +82,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -185,3 +186,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -267,3 +268,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -270,0 +271,0 @@ });

@@ -13,4 +13,6 @@ import { InputControl } from "./inputcontrol";

attach(rootElement: HTMLElement): void;
label: string;
isChecked: boolean;
get label(): string;
set label(value: string);
get isChecked(): boolean;
set isChecked(value: boolean);
}

@@ -16,2 +16,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.CheckBox = void 0;
// Copyright (c) Microsoft Corporation. All rights reserved.

@@ -85,3 +86,3 @@ // Licensed under the MIT License.

},
enumerable: true,
enumerable: false,
configurable: true

@@ -102,3 +103,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -105,0 +106,0 @@ });

@@ -9,3 +9,3 @@ export declare class Collection<TItem> {

indexOf(item: TItem): number;
readonly length: number;
get length(): number;
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Collection = void 0;
// Copyright (c) Microsoft Corporation. All rights reserved.

@@ -36,3 +37,3 @@ // Licensed under the MIT License.

},
enumerable: true,
enumerable: false,
configurable: true

@@ -39,0 +40,0 @@ });

export declare const KEY_TAB = 9;
export declare const KEY_ENTER = 13;
export declare const KEY_ESCAPE = 27;
export declare const KEY_SPACE = 32;
export declare const KEY_UP = 38;
export declare const KEY_DOWN = 40;
export declare const KEY_DELETE = 46;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.KEY_DELETE = exports.KEY_DOWN = exports.KEY_UP = exports.KEY_SPACE = exports.KEY_ESCAPE = exports.KEY_ENTER = exports.KEY_TAB = void 0;
// Copyright (c) Microsoft Corporation. All rights reserved.

@@ -8,2 +9,3 @@ // Licensed under the MIT License.

exports.KEY_ESCAPE = 27;
exports.KEY_SPACE = 32;
exports.KEY_UP = 38;

@@ -10,0 +12,0 @@ exports.KEY_DOWN = 40;

@@ -16,2 +16,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.DatePicker = exports.CalendarPopupControl = void 0;
// Copyright (c) Microsoft Corporation. All rights reserved.

@@ -18,0 +19,0 @@ // Licensed under the MIT License.

@@ -12,3 +12,4 @@ import { Collection } from "./collection";

render(): HTMLElement;
value: string;
get value(): string;
set value(newValue: string);
}

@@ -23,6 +24,8 @@ export declare class DropDownPopupControl extends PopupControl {

render(rootElementBounds: ClientRect): HTMLElement;
selectedIndex: number;
get selectedIndex(): number;
set selectedIndex(index: number);
}
export declare class DropDown extends InputWithPopup<DropDownPopupControl, DropDownItem> {
private _items;
private _parentLabelId;
private itemClicked;

@@ -35,5 +38,9 @@ protected validateRootElement(rootElement: HTMLElement): void;

popup(): void;
readonly items: Collection<DropDownItem>;
selectedItem: DropDownItem;
selectedIndex: number;
get items(): Collection<DropDownItem>;
get selectedItem(): DropDownItem;
set selectedItem(newValue: DropDownItem);
get selectedIndex(): number;
set selectedIndex(index: number);
get parentLabelId(): string;
set parentLabelId(value: string);
}

@@ -16,2 +16,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.DropDown = exports.DropDownPopupControl = exports.DropDownItem = void 0;
// Copyright (c) Microsoft Corporation. All rights reserved.

@@ -41,3 +42,11 @@ // Licensed under the MIT License.

this._element.innerText = this.value;
this._element.setAttribute("role", "option");
this._element.setAttribute("aria-selected", "false");
this._element.onmouseup = function (e) { _this.click(); };
this._element.onkeydown = function (e) {
if (e.keyCode === Constants.KEY_ENTER) {
_this.click();
e.cancelBubble = true;
}
};
}

@@ -56,3 +65,3 @@ return this._element;

},
enumerable: true,
enumerable: false,
configurable: true

@@ -75,2 +84,3 @@ });

element.className = "ms-ctrl ms-popup";
element.setAttribute("role", "listbox");
var selectedIndex = this._owner.selectedIndex;

@@ -89,3 +99,3 @@ for (var i = 0; i < this._owner.items.length; i++) {

DropDownPopupControl.prototype.keyDown = function (e) {
_super.prototype.keyDown.call(this, e);
_super.prototype.keyDown.call(this, e); // handles ESC
var selectedItemIndex = this._selectedIndex;

@@ -133,3 +143,2 @@ switch (e.keyCode) {

renderedElement.style.minWidth = (rootElementBounds.width / 2) + "px";
renderedElement.style.maxWidth = rootElementBounds.width + "px";
return renderedElement;

@@ -143,7 +152,13 @@ };

if (index >= 0 && index < this._renderedItems.length) {
// deselect previous item (if one was selected)
if (this._selectedIndex >= 0 && this._selectedIndex < this._renderedItems.length) {
this._renderedItems[this._selectedIndex].setAttribute("aria-selected", "false");
}
// select new item
this._renderedItems[index].focus();
this._renderedItems[index].setAttribute("aria-selected", "true");
this._selectedIndex = index;
}
},
enumerable: true,
enumerable: false,
configurable: true

@@ -188,2 +203,13 @@ });

}
// add aria-labelledby tag with all pertinent label ids
var ariaLabelledByIds = [];
if (this.parentLabelId) {
ariaLabelledByIds.push(this.parentLabelId);
}
if (this.labelId) {
ariaLabelledByIds.push(this.labelId);
}
if (ariaLabelledByIds.length > 0) {
this.rootElement.setAttribute("aria-labelledby", ariaLabelledByIds.join(" "));
}
};

@@ -198,3 +224,3 @@ DropDown.prototype.popup = function () {

},
enumerable: true,
enumerable: false,
configurable: true

@@ -209,3 +235,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -222,5 +248,15 @@ });

},
enumerable: true,
enumerable: false,
configurable: true
});
Object.defineProperty(DropDown.prototype, "parentLabelId", {
get: function () {
return this._parentLabelId;
},
set: function (value) {
this._parentLabelId = value;
},
enumerable: false,
configurable: true
});
return DropDown;

@@ -227,0 +263,0 @@ }(inputwithpopup_1.InputWithPopup));

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DayOfWeek = void 0;
// Copyright (c) Microsoft Corporation. All rights reserved.

@@ -4,0 +5,0 @@ // Licensed under the MIT License.

@@ -5,4 +5,4 @@ export declare abstract class InputControl {

protected keyDown(e: KeyboardEvent): void;
protected readonly rootElement: HTMLElement;
protected get rootElement(): HTMLElement;
attach(rootElement: HTMLElement): void;
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.InputControl = void 0;
// Copyright (c) Microsoft Corporation. All rights reserved.

@@ -18,3 +19,3 @@ // Licensed under the MIT License.

},
enumerable: true,
enumerable: false,
configurable: true

@@ -21,0 +22,0 @@ });

@@ -13,3 +13,3 @@ import { InputControl } from "./inputcontrol";

closePopup(wasCancelled: boolean): void;
readonly isOpen: boolean;
get isOpen(): boolean;
}

@@ -24,3 +24,3 @@ export declare abstract class InputWithPopup<TPopupControl extends PopupControl, TValue> extends InputControl {

private updateLabel;
protected readonly popupControl: TPopupControl;
protected get popupControl(): TPopupControl;
protected abstract createPopupControl(): TPopupControl;

@@ -35,5 +35,8 @@ protected abstract getCssClassName(): string;

closePopup(wasCancelled: boolean): void;
readonly isOpen: boolean;
placeholderText: string;
value: TValue;
get labelId(): string;
get isOpen(): boolean;
get placeholderText(): string;
set placeholderText(value: string);
get value(): TValue;
set value(newValue: TValue);
}

@@ -16,2 +16,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.InputWithPopup = exports.PopupControl = void 0;
// Copyright (c) Microsoft Corporation. All rights reserved.

@@ -22,2 +23,3 @@ // Licensed under the MIT License.

var inputcontrol_1 = require("./inputcontrol");
var uuid_1 = require("uuid");
var PopupControl = /** @class */ (function () {

@@ -39,2 +41,4 @@ function PopupControl() {

element.className = "ms-ctrl ms-ctrl-popup-container";
element.setAttribute("role", "dialog");
element.setAttribute("aria-modal", "true");
element.onkeydown = function (e) {

@@ -65,2 +69,7 @@ _this.keyDown(e);

this._popupElement.classList.remove("ms-ctrl-slide", "ms-ctrl-slideLeftToRight", "ms-ctrl-slideRightToLeft", "ms-ctrl-slideTopToBottom", "ms-ctrl-slideRightToLeft");
window.addEventListener("resize", function (e) { _this.closePopup(true); });
var rootElementLabel = rootElement.getAttribute("aria-label");
if (rootElementLabel) {
this._popupElement.setAttribute("aria-label", rootElementLabel);
}
this._overlayElement.appendChild(this._popupElement);

@@ -141,3 +150,3 @@ var popupElementBounds = this._popupElement.getBoundingClientRect();

},
enumerable: true,
enumerable: false,
configurable: true

@@ -176,3 +185,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -211,2 +220,3 @@ });

this._labelElement.className = "ms-ctrl ms-dropdown-label";
this._labelElement.id = uuid_1.v4(); // generate unique id for our label element
this._dropDownButtonElement = document.createElement("i");

@@ -221,3 +231,2 @@ this._dropDownButtonElement.className = "ms-icon ms-ctrl-dropdown-button " + this.getButtonIconCssClassName();

this._popupControl = this.createPopupControl();
this._popupControl = this.createPopupControl();
this._popupControl.onClose = function (sender, wasCancelled) {

@@ -234,2 +243,12 @@ _this.closePopup(wasCancelled);

};
Object.defineProperty(InputWithPopup.prototype, "labelId", {
get: function () {
if (this._labelElement) {
return this._labelElement.id;
}
return undefined;
},
enumerable: false,
configurable: true
});
Object.defineProperty(InputWithPopup.prototype, "isOpen", {

@@ -239,3 +258,3 @@ get: function () {

},
enumerable: true,
enumerable: false,
configurable: true

@@ -250,3 +269,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -265,3 +284,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -268,0 +287,0 @@ });

@@ -11,4 +11,5 @@ import { Collection } from "./collection";

keyDown(e: KeyboardEvent): void;
readonly items: Collection<DropDownItem>;
selectedIndex: number;
get items(): Collection<DropDownItem>;
get selectedIndex(): number;
set selectedIndex(index: number);
}

@@ -16,2 +16,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.PopupMenu = void 0;
// Copyright (c) Microsoft Corporation. All rights reserved.

@@ -34,2 +35,3 @@ // Licensed under the MIT License.

element.className = "ms-ctrl ms-popup";
element.setAttribute("role", "listbox");
for (var i = 0; i < this._items.length; i++) {

@@ -95,3 +97,3 @@ var renderedItem = this._items.get(i).render();

},
enumerable: true,
enumerable: false,
configurable: true

@@ -109,3 +111,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -112,0 +114,0 @@ });

@@ -13,4 +13,6 @@ import { InputControl } from "./inputcontrol";

attach(rootElement: HTMLElement): void;
label: string;
isChecked: boolean;
get label(): string;
set label(value: string);
get isChecked(): boolean;
set isChecked(value: boolean);
}

@@ -16,2 +16,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.RadioButton = void 0;
// Copyright (c) Microsoft Corporation. All rights reserved.

@@ -89,3 +90,3 @@ // Licensed under the MIT License.

},
enumerable: true,
enumerable: false,
configurable: true

@@ -106,3 +107,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -109,0 +110,0 @@ });

@@ -10,10 +10,15 @@ import { InputControl } from "./inputcontrol";

private recreateEditBox;
private readonly editBox;
private get editBox();
onChange: (sender: TextBox) => void;
attach(rootElement: HTMLElement): void;
value: string;
placeholder: string;
isMultiline: boolean;
lineCount: number;
maxLength: number;
get value(): string;
set value(newValue: string);
get placeholder(): string;
set placeholder(value: string);
get isMultiline(): boolean;
set isMultiline(value: boolean);
get lineCount(): number;
set lineCount(value: number);
get maxLength(): number;
set maxLength(value: number);
}

@@ -16,2 +16,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.TextBox = void 0;
var Utils = require("./utils");

@@ -45,3 +46,3 @@ var inputcontrol_1 = require("./inputcontrol");

},
enumerable: true,
enumerable: false,
configurable: true

@@ -53,3 +54,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -61,3 +62,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -72,3 +73,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -83,3 +84,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -104,3 +105,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -112,3 +113,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -120,3 +121,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -131,3 +132,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -142,3 +143,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -193,3 +194,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -212,3 +213,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -224,3 +225,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -238,3 +239,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -252,3 +253,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -266,3 +267,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -269,0 +270,0 @@ });

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getAttributeValueAsInt = exports.getAttributeValueAsString = exports.getAttributeValueAsBool = exports.getScrollY = exports.getScrollX = exports.areDatesEqual = exports.addMonths = exports.addDays = exports.daysInMonth = exports.CalendarSettings = void 0;
// Copyright (c) Microsoft Corporation. All rights reserved.

@@ -4,0 +5,0 @@ // Licensed under the MIT License.

{
"name": "adaptivecards-controls",
"version": "0.3.6",
"version": "0.3.7",
"description": "A library of pure JS/HTML controls designed for use with Adaptive Cards.",

@@ -21,13 +21,14 @@ "author": "Microsoft",

"lint": "eslint src/*.ts",
"dts": "dts-generator --name adaptivecards-controls --project . --out dist/adaptivecards-controls.d.ts",
"dts": "dts-generator --prefix adaptivecards-controls --project . --out dist/adaptivecards-controls.d.ts",
"release": "npm run clean && npm run build && webpack --mode=production && npm run dts"
},
"devDependencies": {
"rimraf": "^2.6.3",
"typescript": "^3.5.3",
"webpack": "^4.38.0",
"webpack-cli": "^3.3.6",
"webpack-dev-server": "^3.7.2"
"rimraf": "^3.0.2",
"ts-loader": "^7.0.5",
"typescript": "^3.9.5",
"webpack": "^4.43.0",
"webpack-cli": "^3.3.12",
"webpack-dev-server": "^3.11.0"
},
"gitHead": "32f802979e2b8de3d18f8258d2e66cf1efc4b6cb"
"gitHead": "41887f9c4f15157247df676d818cc91269433af5"
}

@@ -6,4 +6,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved.

export const KEY_ESCAPE = 27;
export const KEY_SPACE = 32;
export const KEY_UP = 38;
export const KEY_DOWN = 40;
export const KEY_DELETE = 46;

@@ -35,3 +35,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved.

this._element.innerText = this.value;
this._element.setAttribute("role", "option");
this._element.setAttribute("aria-selected", "false");
this._element.onmouseup = (e) => { this.click(); };
this._element.onkeydown = (e) => {
if (e.keyCode === Constants.KEY_ENTER) {
this.click();
e.cancelBubble = true;
}
};
}

@@ -69,2 +77,3 @@

element.className = "ms-ctrl ms-popup";
element.setAttribute("role", "listbox");

@@ -90,3 +99,3 @@ var selectedIndex = this._owner.selectedIndex;

keyDown(e: KeyboardEvent) {
super.keyDown(e);
super.keyDown(e); // handles ESC

@@ -149,3 +158,2 @@ var selectedItemIndex = this._selectedIndex;

renderedElement.style.minWidth = (rootElementBounds.width / 2) + "px";
renderedElement.style.maxWidth = rootElementBounds.width + "px";

@@ -161,3 +169,10 @@ return renderedElement;

if (index >= 0 && index < this._renderedItems.length) {
// deselect previous item (if one was selected)
if (this._selectedIndex >= 0 && this._selectedIndex < this._renderedItems.length) {
this._renderedItems[this._selectedIndex].setAttribute("aria-selected", "false");
}
// select new item
this._renderedItems[index].focus();
this._renderedItems[index].setAttribute("aria-selected", "true");

@@ -171,2 +186,3 @@ this._selectedIndex = index;

private _items: Collection<DropDownItem>;
private _parentLabelId: string; // tracks the id of the parent control's label

@@ -216,2 +232,17 @@ private itemClicked(item: DropDownItem) {

}
// add aria-labelledby tag with all pertinent label ids
let ariaLabelledByIds: Array<string> = [];
if (this.parentLabelId) {
ariaLabelledByIds.push(this.parentLabelId);
}
if (this.labelId) {
ariaLabelledByIds.push(this.labelId);
}
if (ariaLabelledByIds.length > 0) {
this.rootElement.setAttribute("aria-labelledby", ariaLabelledByIds.join(" "));
}
}

@@ -246,2 +277,10 @@

}
get parentLabelId() : string {
return this._parentLabelId;
}
set parentLabelId(value: string) {
this._parentLabelId = value;
}
}

@@ -6,2 +6,3 @@ // Copyright (c) Microsoft Corporation. All rights reserved.

import { InputControl } from "./inputcontrol";
import { v4 as uuidv4 } from "uuid";

@@ -30,2 +31,4 @@ export abstract class PopupControl {

element.className = "ms-ctrl ms-ctrl-popup-container";
element.setAttribute("role", "dialog");
element.setAttribute("aria-modal", "true");
element.onkeydown = (e) => {

@@ -69,2 +72,9 @@ this.keyDown(e);

window.addEventListener("resize", (e) => { this.closePopup(true); });
const rootElementLabel = rootElement.getAttribute("aria-label");
if (rootElementLabel) {
this._popupElement.setAttribute("aria-label", rootElementLabel);
}
this._overlayElement.appendChild(this._popupElement);

@@ -243,2 +253,3 @@

this._labelElement.className = "ms-ctrl ms-dropdown-label";
this._labelElement.id = uuidv4(); // generate unique id for our label element

@@ -256,3 +267,2 @@ this._dropDownButtonElement = document.createElement("i");

this._popupControl = this.createPopupControl();
this._popupControl = this.createPopupControl();
this._popupControl.onClose = (sender, wasCancelled) => {

@@ -273,2 +283,11 @@ this.closePopup(wasCancelled);

get labelId(): string {
if (this._labelElement) {
return this._labelElement.id;
}
return undefined;
}
get isOpen(): boolean {

@@ -275,0 +294,0 @@ return this._popupControl ? this._popupControl.isOpen : false;

@@ -20,2 +20,3 @@ // Copyright (c) Microsoft Corporation. All rights reserved.

element.className = "ms-ctrl ms-popup";
element.setAttribute("role", "listbox");

@@ -22,0 +23,0 @@ for (var i = 0; i < this._items.length; i++) {

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc