@momentum-ui/web-components 3.2.8 → 3.2.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/3639.js +3 -3
- package/dist/5057.js +1 -1
- package/dist/8663.js +5 -1
- package/dist/953.js +1 -3
- package/dist/comp/md-accordion-item-entry.js +8 -3
- package/dist/comp/md-advance-list-entry.js +1 -1
- package/dist/comp/md-date-range-picker-entry.js +1 -1
- package/dist/comp/md-datepicker-calendar-entry.js +2 -4
- package/dist/comp/md-datepicker-day-entry.js +3 -3
- package/dist/comp/md-datepicker-entry.js +7 -3
- package/dist/comp/md-dropdown-entry.js +32 -23
- package/dist/esm/3639.js +3 -3
- package/dist/esm/5057.js +1 -1
- package/dist/esm/6020.js +3 -3
- package/dist/esm/837.js +4 -6
- package/dist/esm/8663.js +5 -1
- package/dist/esm/953.js +1 -3
- package/dist/esm/comp/md-accordion-item-entry.js +8 -3
- package/dist/esm/comp/md-advance-list-entry.js +3 -3
- package/dist/esm/comp/md-date-range-picker-entry.js +1 -1
- package/dist/esm/comp/md-datepicker-entry.js +13 -9
- package/dist/esm/comp/md-dropdown-entry.js +36 -27
- package/dist/esm/index-entry.js +30 -16
- package/dist/esm/index.js +1 -1
- package/dist/index-entry.js +196 -184
- package/dist/index.js +1 -1
- package/dist/types/[sandbox]/examples/editable-field.d.ts +1 -1
- package/dist/types/components/accordion/AccordionItem.d.ts +1 -0
- package/dist/types/components/avatar/Avatar.d.ts +3 -3
- package/dist/types/components/badge/Badge.d.ts +1 -1
- package/dist/types/components/button/Button.d.ts +2 -2
- package/dist/types/components/chip/Chip.d.ts +3 -3
- package/dist/types/components/combobox/ComboBox.d.ts +4 -4
- package/dist/types/components/date-range-picker/DateRangePicker.d.ts +1 -0
- package/dist/types/components/datepicker/DatePicker.d.ts +6 -0
- package/dist/types/components/dropdown/Dropdown.d.ts +3 -2
- package/dist/types/components/editable-textfield/EditableTextfield.d.ts +1 -1
- package/dist/types/components/input/Input.d.ts +5 -5
- package/dist/types/components/radio/Radio.d.ts +1 -1
- package/dist/types/components/taskitem/TaskItem.utils.d.ts +1 -1
- package/dist/types/internal-components/color-table/ColorTable.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("lit"),require("lit/decorators.js"),require("lit/directives/class-map.js"),require("lit/directives/style-map.js"),require("lit/directives/if-defined.js"),require("@momentum-ui/icons/data/momentumUiIconsNames.json"),require("@momentum-ui/utils/lib/getColorValue"),require("mobx"),require("lit/directives/repeat.js"));else if("function"==typeof define&&define.amd)define(["lit","lit/decorators.js","lit/directives/class-map.js","lit/directives/style-map.js","lit/directives/if-defined.js","@momentum-ui/icons/data/momentumUiIconsNames.json","@momentum-ui/utils/lib/getColorValue","mobx","lit/directives/repeat.js"],t);else{var i="object"==typeof exports?t(require("lit"),require("lit/decorators.js"),require("lit/directives/class-map.js"),require("lit/directives/style-map.js"),require("lit/directives/if-defined.js"),require("@momentum-ui/icons/data/momentumUiIconsNames.json"),require("@momentum-ui/utils/lib/getColorValue"),require("mobx"),require("lit/directives/repeat.js")):t(e.lit,e["lit/decorators.js"],e["lit/directives/class-map.js"],e["lit/directives/style-map.js"],e["lit/directives/if-defined.js"],e["@momentum-ui/icons/data/momentumUiIconsNames.json"],e["@momentum-ui/utils/lib/getColorValue"],e.mobx,e["lit/directives/repeat.js"]);for(var s in i)("object"==typeof exports?exports:e)[s]=i[s]}}(self,(e,t,i,s,o,n,r,a,d)=>(()=>{"use strict";var l,p={621(e,t,i){i.r(t),i.d(t,{Dropdown:()=>s}),i(1821);var s,o=i(2900),n=i(7704),r=i(2050),a=i(4084),d=i(7161),l=i(429),p=i(5125),h=i(291),u=i(8175),c=i(318),m=i(5057),y=function(e,t,i,s){var o,n=arguments.length,r=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(n<3?o(r):n>3?o(t,i,r):o(t,i))||r);return n>3&&r&&Object.defineProperty(t,i,r),r},f=function(e,t,i,s){return new(i||(i=Promise))(function(o,n){function r(e){try{d(s.next(e))}catch(e){n(e)}}function a(e){try{d(s.throw(e))}catch(e){n(e)}}function d(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(r,a)}d((s=s.apply(e,t||[])).next())})};!function(e){class t{determineMessageType(e){return e.reduce((e,t)=>"error"===t?e:t.type,"")}filterMessagesByType(e,t){return e.reduce((e,i)=>i.type===t?e.concat(i.message):e,[])}}e.MessageController=t;let i=class extends((0,n.yC)(d.LitElement)){constructor(){super(...arguments),this.title="Select...",this.options=[],this.optionId="",this.optionValue="",this.defaultOption="",this.disabled=!1,this.customTabIndex=0,this.allowUnselected=!1,this.visibleOptions=8,this.newMomentum=!1,this.compact=!1,this.searchable=!1,this.searchItem=!1,this.inputValue="",this.placeholder="Select...",this.readOnly=!1,this.autofocus=!1,this.leftIcon="",this.trimSpace=!1,this.resultsTextLocalization="No Results",this.pill=!1,this.helpText="",this.messageArr=[],this.htmlId="",this.clearAriaLabel="Clear",this.clearIconHeight="auto",this.arrowAriaLabel="Expand",this.popupChevronAriaHidden="true",this.ariaLabel="",this.searchResultAriaLabel="",this.ariaLabelForDropdown="",this.dropdownRenderOptions=[],this.selectedKey="",this.expanded=!1,this.focusedIndex=-1,this.messageController=new t,this.lastMaxHeight="",this.onOutsideClick=e=>{let t=!1;const i=e.composedPath();i.length&&(t=!!i.find(e=>e===this),t||this.expanded&&this.collapse())},this.onKeyDown=e=>{switch(e.code){case o.Uz.Tab:this.expanded&&(e.stopPropagation(),this.collapse());break;case o.Uz.Space:case o.Uz.Enter:this.expanded?(this.select(),this.collapse()):this.expand();break;case o.Uz.ArrowDown:this.expanded?this.focusNext():this.expand();break;case o.Uz.ArrowUp:this.expanded?this.focusPrev():this.expand();break;case o.Uz.Home:this.expanded?this.focusFirst():this.expand();break;case o.Uz.End:this.expanded?this.focusLast():this.expand();break;case o.Uz.Escape||o.Uz.Backspace:this.expanded&&(e.stopPropagation(),this.collapse())}},this.notifyInputValueChanged=(0,r.sg)(e=>{this.dispatchEvent(new CustomEvent("dropdown-input",{composed:!0,bubbles:!0,detail:{value:e}})),this.notifySearchResultCount(),requestAnimationFrame(()=>{this.input.focus()})},250)}connectedCallback(){super.connectedCallback(),this.setupEvents()}disconnectedCallback(){super.disconnectedCallback(),this.teardownEvents()}firstUpdated(e){super.firstUpdated(e),e.forEach((e,t)=>{if("defaultOption"===t&&this.defaultOption){const{key:e}=this.getOptionKeyValuePair(this.defaultOption);this.selectedKey=e}}),this.searchable&&this.setInitialValue()}updated(e){super.updated(e),e.forEach((e,t)=>{if("options"===t&&this.updateRenderOptions(),"selectedKey"===t){const e=this.dropdownRenderOptions.findIndex(e=>e.key===this.selectedKey);-1!==e&&(this.focusToIndex(e),this.searchable&&this.setInitialValue())}if("expanded"===t&&this.updateListDOM(),"focusedIndex"===t&&this.updateListDOM(),"defaultOption"===t&&this.defaultOption){const{key:e}=this.getOptionKeyValuePair(this.defaultOption);this.selectedKey=e}})}notifySearchResultCount(){if(this.searchResultAriaLabel){const e=/{{.*?}}/g;this.ariaLabelForDropdown=this.searchResultAriaLabel.replace(e,this.filteredOptions.length.toString())}else this.ariaLabel?this.ariaLabelForDropdown=`${this.ariaLabel}, ${this.filteredOptions.length} results found.`:this.ariaLabelForDropdown=`Dropdown Element, ${this.filteredOptions.length} results found.`}setInitialValue(){var e;if(this.options.length){const t=this.dropdownRenderOptions.find(e=>e.key===this.selectedKey),i=null==t?void 0:t.option;i&&(this.setInputValue(this.getOptionValue(i)),null===(e=this.input)||void 0===e||e.setAttribute(o.iw.AriaActivedescendant,this.getOptionId(i)),this.notifyInputValueChanged(this.getOptionValue(i)),this.requestUpdate())}}getOptionValue(e){return this.isOptionObject(e)&&!this.optionValue?Object.values(e)[0]:this.isOptionObject(e)?e[this.optionValue]:e}getOptionId(e){return this.isOptionObject(e)?e[this.optionId]:e}isOptionObject(e){return"object"==typeof e&&null!==e}updateRenderOptions(){const e=[];this.focusReset();const t=this.options.reduce((t,i)=>{const{key:s,value:o}=this.getOptionKeyValuePair(i);return-1!==e.indexOf(s)?console.error(`Dropdown already have option key: "${s}". Ignoring `):s?(e.push(s),t.push({key:s,value:o,option:i})):console.error(`Dropdown key is not defined: "${s}". (value: "${o}"). Ignoring `),t},[]);this.allowUnselected&&t.unshift({key:"",value:this.title}),this.dropdownRenderOptions=t}updateListDOM(){return f(this,void 0,void 0,function*(){this.expanded&&(yield this.resizeDropdownList(),yield this.scrollToIndex(this.focusedIndex))})}resizeDropdownList(){return f(this,void 0,void 0,function*(){yield new Promise(e=>requestAnimationFrame(()=>{if(this.optionsListItems)if(this.optionsListItems.length>this.visibleOptions){const e=`${[...this.optionsListItems].slice(0,this.visibleOptions).reduce((e,t)=>e+t.offsetHeight,0)}px`;this.lastMaxHeight!==e&&(this.optionsList.style.maxHeight=e,this.lastMaxHeight=e)}else{const e="auto";this.lastMaxHeight!==e&&(this.optionsList.style.maxHeight=e,this.lastMaxHeight=e)}e()}))})}handleFocusIn(e){var t;this.disabled&&this.readOnly||null===(t=super.handleFocusIn)||void 0===t||t.call(this,e),this.dispatchEvent(new CustomEvent("dropdown-focus-in",{composed:!0,bubbles:!0}))}handleFocusOut(e){var t;null===(t=super.handleFocusOut)||void 0===t||t.call(this,e),this.dispatchEvent(new CustomEvent("dropdown-focus-out",{composed:!0,bubbles:!0}))}static get styles(){return[a.A,m.A]}get filteredOptions(){const e=this.trimSpace?this.inputValue.replace(/\s+/g,""):this.inputValue;if(!e.trim())return this.dropdownRenderOptions;const t=this.dropdownRenderOptions.filter(t=>t.value.toLowerCase().includes(e.toLowerCase()));return 0===t.length?[{key:"no-result",value:"No Result",disabled:!0}]:t}get messageType(){return this.messageArr.length>0?this.messageController.determineMessageType(this.messageArr):null}get messages(){return this.messageType?this.messageController.filterMessagesByType(this.messageArr,this.messageType):null}setVisualListbox(e){this.expanded=e}updateOnNextFrame(e){requestAnimationFrame(e)}setInputValue(e=""){this.input.value=e}shouldChangeButton(){const e=this.input&&this.input.value.length>0;return e&&document.dispatchEvent(new CustomEvent("on-widget-update")),e}toggleVisualListBox(e){var t,i;if(!this.readOnly){if(e.target.classList.contains("md-dropdown-input"))e.target.focus();else if("md-icon"===e.target.localName){const s=null===(i=null===(t=e.target.parentElement)||void 0===t?void 0:t.parentElement)||void 0===i?void 0:i.parentElement;if(s){const e=s.querySelector(".md-dropdown-input");setTimeout(()=>{e.focus()},10)}}this.expanded?this.setVisualListbox(!1):(this.dispatchEvent(new CustomEvent("combobox-on-expand",{composed:!0,bubbles:!0})),this.notifySearchResultCount(),this.setVisualListbox(!0)),this.input.focus()}}handleRemoveAll(e){e.stopPropagation(),this.dispatchEvent(new CustomEvent("remove-all-selected"))}removeAllSelected(){var e;this.focusReset(),this.selectedKey="",this.inputValue="",this.setInputValue(),null===(e=this.input)||void 0===e||e.setAttribute(o.iw.AriaActivedescendant,""),this.setVisualListbox(!1),this.updateOnNextFrame(()=>{this.input.focus()}),this.dispatchEvent(new CustomEvent("dropdown-selection-removed",{composed:!0,bubbles:!0,detail:{}}))}setupEvents(){document.addEventListener("click",this.onOutsideClick),this.addEventListener("keydown",this.onKeyDown),this.addEventListener("remove-all-selected",this.removeAllSelected)}teardownEvents(){document.removeEventListener("click",this.onOutsideClick),this.removeEventListener("keydown",this.onKeyDown),this.removeEventListener("remove-all-selected",this.removeAllSelected)}expand(){this.expanded=!0;const e=-1!==this.focusedIndex?`combo-${this.focusedIndex}`:"";document.dispatchEvent(new CustomEvent("on-widget-update")),this.label.setAttribute("aria-activedescendant",e),this.optionsList&&this.optionsList.focus(),-1===this.focusedIndex&&this.focusNext()}collapse(){this.expanded=!1,this.searchable||this.label.setAttribute("aria-activedescendant","")}toggle(){this.expanded?this.collapse():this.expand()}select(){if(-1!==this.focusedIndex){const e=this.dropdownRenderOptions[this.focusedIndex],t=e.key;t!==this.selectedKey&&(this.selectedKey=t,this.dispatchEvent(new CustomEvent("dropdown-selected",{composed:!0,bubbles:!0,detail:{option:e.option?e.option:e.key}})))}}onLabelClick(){this.label.focus(),this.toggle()}focusFirst(){this.dropdownRenderOptions.length&&(this.focusedIndex=0)}focusLast(){this.dropdownRenderOptions.length&&(this.focusedIndex=this.dropdownRenderOptions.length-1)}focusNext(){this.dropdownRenderOptions.length&&(-1!==this.focusedIndex&&this.focusedIndex<this.dropdownRenderOptions.length-1?this.focusedIndex++:this.focusFirst())}focusPrev(){this.dropdownRenderOptions.length&&(this.focusedIndex>0?this.focusedIndex--:this.focusLast())}focusToIndex(e){this.dropdownRenderOptions.length&&e>=0&&e<=this.dropdownRenderOptions.length-1&&(this.focusedIndex=e)}focusToIndexWithOption(e){const t=this.dropdownRenderOptions.findIndex(t=>t.key===e.key);this.dropdownRenderOptions.length&&t>=0&&t<=this.dropdownRenderOptions.length-1&&(this.focusedIndex=t)}focusReset(){this.focusedIndex=-1}scrollToIndex(e){return f(this,void 0,void 0,function*(){yield new Promise(t=>{requestAnimationFrame(()=>{if(this.optionsListItems&&this.optionsListItems.length>this.visibleOptions&&e>=0&&this.optionsListItems.length>e){let t=0;const{top:i,bottom:s}=this.optionsList.getBoundingClientRect(),o=this.optionsListItems[e],n=this.optionsListItems[e+1]||o,r=this.optionsListItems[e-1]||o,a=n.getBoundingClientRect(),d=r.getBoundingClientRect();a.bottom>s?t=a.bottom-s+2:d.top<i&&(t=d.top-i-2),this.optionsList.scrollTop+=t}t()})})})}getOptionKeyValuePair(e){if("string"==typeof e)return{key:e.trim(),value:e};if(e&&"object"==typeof e){const t=Object.keys(e),i=Object.values(e);if(t.length){if(1===t.length||!this.optionId)return{key:t[0],value:i[0]};if(this.optionId)return{key:e[this.optionId],value:e[this.optionValue||this.optionId]}}}return{key:"undefined",value:"undefined"}}get labelTitle(){if(this.selectedKey){const e=this.dropdownRenderOptions.find(e=>e.key===this.selectedKey);if(e)return e.value}return this.title}get dropDownClassMap(){return{"md-dropdown__expanded":this.expanded,[`md-${this.messageType}`]:!!this.messageType,"md-new-dropdown":this.newMomentum,"md-dropdown--pill":!0===this.pill}}handleInput(e){const t=e.target.value;this.inputValue=t.trim(),this.notifyInputValueChanged(t.trim())}helpTextTemplate(){return this.helpText?d.html`
|
|
1
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("lit"),require("lit/decorators.js"),require("lit/directives/class-map.js"),require("lit/directives/style-map.js"),require("lit/directives/if-defined.js"),require("@momentum-ui/icons/data/momentumUiIconsNames.json"),require("@momentum-ui/utils/lib/getColorValue"),require("mobx"),require("lit/directives/repeat.js"));else if("function"==typeof define&&define.amd)define(["lit","lit/decorators.js","lit/directives/class-map.js","lit/directives/style-map.js","lit/directives/if-defined.js","@momentum-ui/icons/data/momentumUiIconsNames.json","@momentum-ui/utils/lib/getColorValue","mobx","lit/directives/repeat.js"],t);else{var i="object"==typeof exports?t(require("lit"),require("lit/decorators.js"),require("lit/directives/class-map.js"),require("lit/directives/style-map.js"),require("lit/directives/if-defined.js"),require("@momentum-ui/icons/data/momentumUiIconsNames.json"),require("@momentum-ui/utils/lib/getColorValue"),require("mobx"),require("lit/directives/repeat.js")):t(e.lit,e["lit/decorators.js"],e["lit/directives/class-map.js"],e["lit/directives/style-map.js"],e["lit/directives/if-defined.js"],e["@momentum-ui/icons/data/momentumUiIconsNames.json"],e["@momentum-ui/utils/lib/getColorValue"],e.mobx,e["lit/directives/repeat.js"]);for(var s in i)("object"==typeof exports?exports:e)[s]=i[s]}}(self,(e,t,i,s,o,n,r,a,l)=>(()=>{"use strict";var d,p={621(e,t,i){i.r(t),i.d(t,{Dropdown:()=>s}),i(1821);var s,o=i(2900),n=i(7704),r=i(2050),a=i(4084),l=i(7161),d=i(429),p=i(5125),h=i(291),u=i(8175),c=i(318),m=i(5057),y=function(e,t,i,s){var o,n=arguments.length,r=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(n<3?o(r):n>3?o(t,i,r):o(t,i))||r);return n>3&&r&&Object.defineProperty(t,i,r),r},f=function(e,t,i,s){return new(i||(i=Promise))(function(o,n){function r(e){try{l(s.next(e))}catch(e){n(e)}}function a(e){try{l(s.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(r,a)}l((s=s.apply(e,t||[])).next())})};!function(e){class t{determineMessageType(e){return e.reduce((e,t)=>"error"===t?e:t.type,"")}filterMessagesByType(e,t){return e.reduce((e,i)=>i.type===t?e.concat(i.message):e,[])}}e.MessageController=t;let i=class extends((0,n.yC)(l.LitElement)){constructor(){super(...arguments),this.title="Select...",this.options=[],this.optionId="",this.optionValue="",this.defaultOption="",this.disabled=!1,this.customTabIndex=0,this.allowUnselected=!1,this.visibleOptions=8,this.newMomentum=!1,this.compact=!1,this.searchable=!1,this.searchItem=!1,this.inputValue="",this.placeholder="Select...",this.readOnly=!1,this.autofocus=!1,this.leftIcon="",this.trimSpace=!1,this.resultsTextLocalization="No Results",this.pill=!1,this.helpText="",this.messageArr=[],this.htmlId="",this.clearAriaLabel="Clear",this.clearIconHeight="auto",this.arrowAriaLabel="Expand",this.popupChevronAriaHidden="true",this.ariaLabel="",this.searchResultAriaLabel="",this.ariaLabelForDropdown="",this.dropdownRenderOptions=[],this.selectedKey="",this.expanded=!1,this.focusedIndex=-1,this.messageController=new t,this.lastMaxHeight="",this.onOutsideClick=e=>{let t=!1;const i=e.composedPath();i.length&&(t=!!i.find(e=>e===this),t||this.expanded&&this.collapse())},this.onKeyDown=e=>{var t;if(!this.disabled&&!this.readOnly)switch(e.code){case o.Uz.Tab:this.expanded&&(e.stopPropagation(),this.collapse());break;case o.Uz.Space:case o.Uz.Enter:{const i=e.composedPath()[0];if(null===(t=i.closest)||void 0===t?void 0:t.call(i,".md-dropdown-button"))break;e.preventDefault(),this.expanded?(this.select(),this.collapse()):this.expand();break}case o.Uz.ArrowDown:e.preventDefault(),this.expanded?this.focusNext():this.expand();break;case o.Uz.ArrowUp:e.preventDefault(),this.expanded?this.focusPrev():this.expand();break;case o.Uz.Home:e.preventDefault(),this.expanded?this.focusFirst():this.expand();break;case o.Uz.End:e.preventDefault(),this.expanded?this.focusLast():this.expand();break;case o.Uz.Escape:case o.Uz.Backspace:this.expanded&&(e.preventDefault(),e.stopPropagation(),this.collapse())}},this.notifyInputValueChanged=(0,r.sg)(e=>{this.dispatchEvent(new CustomEvent("dropdown-input",{composed:!0,bubbles:!0,detail:{value:e}})),this.notifySearchResultCount(),requestAnimationFrame(()=>{this.input.focus()})},250)}connectedCallback(){super.connectedCallback(),this.setupEvents()}disconnectedCallback(){super.disconnectedCallback(),this.teardownEvents()}firstUpdated(e){super.firstUpdated(e),e.forEach((e,t)=>{if("defaultOption"===t&&this.defaultOption){const{key:e}=this.getOptionKeyValuePair(this.defaultOption);this.selectedKey=e}}),this.searchable&&this.setInitialValue()}updated(e){super.updated(e),e.forEach((e,t)=>{if("options"===t&&this.updateRenderOptions(),"selectedKey"===t&&this.dropdownRenderOptions.some(e=>e.key===this.selectedKey)){const e=this.filteredOptions.findIndex(e=>e.key===this.selectedKey);-1!==e&&this.focusToIndex(e),this.searchable&&this.setInitialValue()}if("expanded"===t&&(this.updateListDOM(),this.updateActiveDescendant()),"focusedIndex"===t&&(this.updateListDOM(),this.updateActiveDescendant()),"defaultOption"===t&&this.defaultOption){const{key:e}=this.getOptionKeyValuePair(this.defaultOption);this.selectedKey=e}})}notifySearchResultCount(){if(this.searchResultAriaLabel){const e=/{{.*?}}/g;this.ariaLabelForDropdown=this.searchResultAriaLabel.replace(e,this.filteredOptions.length.toString())}else this.ariaLabel?this.ariaLabelForDropdown=`${this.ariaLabel}, ${this.filteredOptions.length} results found.`:this.ariaLabelForDropdown=`Dropdown Element, ${this.filteredOptions.length} results found.`}setInitialValue(){var e;if(this.options.length){const t=this.dropdownRenderOptions.find(e=>e.key===this.selectedKey),i=null==t?void 0:t.option;if(i){const t=this.getOptionValue(i);this.inputValue=t,this.setInputValue(t),null===(e=this.input)||void 0===e||e.setAttribute(o.iw.AriaActivedescendant,this.getOptionId(i)),this.notifyInputValueChanged(t)}}}getOptionValue(e){return this.isOptionObject(e)&&!this.optionValue?Object.values(e)[0]:this.isOptionObject(e)?e[this.optionValue]:e}getOptionId(e){return this.isOptionObject(e)?e[this.optionId]:e}isOptionObject(e){return"object"==typeof e&&null!==e}updateRenderOptions(){const e=[];this.focusReset();const t=this.options.reduce((t,i)=>{const{key:s,value:o}=this.getOptionKeyValuePair(i);return-1!==e.indexOf(s)?console.error(`Dropdown already have option key: "${s}". Ignoring `):s?(e.push(s),t.push({key:s,value:o,option:i})):console.error(`Dropdown key is not defined: "${s}". (value: "${o}"). Ignoring `),t},[]);this.allowUnselected&&t.unshift({key:"",value:this.title}),this.dropdownRenderOptions=t}updateActiveDescendant(){const e=this.searchable?this.input:this.label;if(e){const t=this.expanded&&-1!==this.focusedIndex?`combo-${this.focusedIndex}`:"";e.setAttribute("aria-activedescendant",t)}}updateListDOM(){return f(this,void 0,void 0,function*(){this.expanded&&(yield this.resizeDropdownList(),yield this.scrollToIndex(this.focusedIndex))})}resizeDropdownList(){return f(this,void 0,void 0,function*(){yield new Promise(e=>requestAnimationFrame(()=>{if(this.optionsListItems)if(this.optionsListItems.length>this.visibleOptions){const e=`${[...this.optionsListItems].slice(0,this.visibleOptions).reduce((e,t)=>e+t.offsetHeight,0)}px`;this.lastMaxHeight!==e&&(this.optionsList.style.maxHeight=e,this.lastMaxHeight=e)}else{const e="auto";this.lastMaxHeight!==e&&(this.optionsList.style.maxHeight=e,this.lastMaxHeight=e)}e()}))})}handleFocusIn(e){var t;this.disabled||null===(t=super.handleFocusIn)||void 0===t||t.call(this,e),this.dispatchEvent(new CustomEvent("dropdown-focus-in",{composed:!0,bubbles:!0}))}handleFocusOut(e){var t;null===(t=super.handleFocusOut)||void 0===t||t.call(this,e),this.dispatchEvent(new CustomEvent("dropdown-focus-out",{composed:!0,bubbles:!0}))}static get styles(){return[a.A,m.A]}get filteredOptions(){const e=this.trimSpace?this.inputValue.replace(/\s+/g,""):this.inputValue;if(!e.trim())return this.dropdownRenderOptions;const t=this.dropdownRenderOptions.filter(t=>t.value.toLowerCase().includes(e.toLowerCase()));return 0===t.length?[{key:"no-result",value:"No Result",disabled:!0}]:t}get messageType(){return this.messageArr.length>0?this.messageController.determineMessageType(this.messageArr):null}get messages(){return this.messageType?this.messageController.filterMessagesByType(this.messageArr,this.messageType):null}setVisualListbox(e){this.expanded=e}updateOnNextFrame(e){requestAnimationFrame(e)}setInputValue(e=""){this.input.value=e}shouldChangeButton(){const e=this.input&&this.input.value.length>0;return e&&document.dispatchEvent(new CustomEvent("on-widget-update")),e}toggleVisualListBox(e){var t,i;if(!this.readOnly){if(e.target.classList.contains("md-dropdown-input"))e.target.focus();else if("md-icon"===e.target.localName){const s=null===(i=null===(t=e.target.parentElement)||void 0===t?void 0:t.parentElement)||void 0===i?void 0:i.parentElement;if(s){const e=s.querySelector(".md-dropdown-input");setTimeout(()=>{e.focus()},10)}}this.expanded?this.collapse():(this.dispatchEvent(new CustomEvent("combobox-on-expand",{composed:!0,bubbles:!0})),this.notifySearchResultCount(),this.expand()),this.input.focus()}}handleRemoveAll(e){e.stopPropagation(),this.dispatchEvent(new CustomEvent("remove-all-selected"))}removeAllSelected(){var e;this.focusReset(),this.selectedKey="",this.inputValue="",this.setInputValue(),null===(e=this.input)||void 0===e||e.setAttribute(o.iw.AriaActivedescendant,""),this.setVisualListbox(!1),this.updateOnNextFrame(()=>{this.input.focus()}),this.dispatchEvent(new CustomEvent("dropdown-selection-removed",{composed:!0,bubbles:!0,detail:{}}))}setupEvents(){document.addEventListener("click",this.onOutsideClick),this.addEventListener("keydown",this.onKeyDown),this.addEventListener("remove-all-selected",this.removeAllSelected)}teardownEvents(){document.removeEventListener("click",this.onOutsideClick),this.removeEventListener("keydown",this.onKeyDown),this.removeEventListener("remove-all-selected",this.removeAllSelected)}expand(){this.expanded=!0,document.dispatchEvent(new CustomEvent("on-widget-update")),!this.searchable&&this.label&&this.label.focus(),-1===this.focusedIndex&&this.focusNext()}collapse(){if(this.expanded=!1,this.searchable&&this.selectedKey){const e=this.dropdownRenderOptions.find(e=>e.key===this.selectedKey);if(null==e?void 0:e.option){const t=this.getOptionValue(e.option);this.inputValue=t,this.setInputValue(t)}}}toggle(){this.expanded?this.collapse():this.expand()}select(){if(-1!==this.focusedIndex){const e=this.filteredOptions[this.focusedIndex];if(!e||"no-result"===e.key)return;const t=e.key;t!==this.selectedKey&&(this.selectedKey=t,this.dispatchEvent(new CustomEvent("dropdown-selected",{composed:!0,bubbles:!0,detail:{option:"option"in e&&e.option||e.key}})))}}onLabelClick(){this.label.focus(),this.readOnly||this.toggle()}focusFirst(){this.filteredOptions.length&&(this.focusedIndex=0)}focusLast(){this.filteredOptions.length&&(this.focusedIndex=this.filteredOptions.length-1)}focusNext(){this.filteredOptions.length&&(-1!==this.focusedIndex&&this.focusedIndex<this.filteredOptions.length-1?this.focusedIndex++:this.focusFirst())}focusPrev(){this.filteredOptions.length&&(this.focusedIndex>0?this.focusedIndex--:this.focusLast())}focusToIndex(e){this.filteredOptions.length&&e>=0&&e<=this.filteredOptions.length-1&&(this.focusedIndex=e)}focusToIndexWithOption(e){const t=this.filteredOptions.findIndex(t=>t.key===e.key);this.filteredOptions.length&&t>=0&&t<=this.filteredOptions.length-1&&(this.focusedIndex=t)}focusReset(){this.focusedIndex=-1}scrollToIndex(e){return f(this,void 0,void 0,function*(){yield new Promise(t=>{requestAnimationFrame(()=>{if(this.optionsListItems&&this.optionsListItems.length>this.visibleOptions&&e>=0&&this.optionsListItems.length>e){let t=0;const{top:i,bottom:s}=this.optionsList.getBoundingClientRect(),o=this.optionsListItems[e],n=this.optionsListItems[e+1]||o,r=this.optionsListItems[e-1]||o,a=n.getBoundingClientRect(),l=r.getBoundingClientRect();a.bottom>s?t=a.bottom-s+2:l.top<i&&(t=l.top-i-2),this.optionsList.scrollTop+=t}t()})})})}getOptionKeyValuePair(e){if("string"==typeof e)return{key:e.trim(),value:e};if(e&&"object"==typeof e){const t=Object.keys(e),i=Object.values(e);if(t.length){if(1===t.length||!this.optionId)return{key:t[0],value:i[0]};if(this.optionId)return{key:e[this.optionId],value:e[this.optionValue||this.optionId]}}}return{key:"undefined",value:"undefined"}}get labelTitle(){if(this.selectedKey){const e=this.dropdownRenderOptions.find(e=>e.key===this.selectedKey);if(e)return e.value}return this.title}get dropDownClassMap(){return{"md-dropdown__expanded":this.expanded,[`md-${this.messageType}`]:!!this.messageType,"md-new-dropdown":this.newMomentum,"md-dropdown--pill":!0===this.pill}}handleInput(e){const t=e.target.value;this.inputValue=t.trim(),this.notifyInputValueChanged(t.trim())}helpTextTemplate(){return this.helpText?l.html`
|
|
2
2
|
<md-help-text
|
|
3
3
|
class="help-text ${(0,p.classMap)({disabled:this.disabled,newMomentum:this.newMomentum})}"
|
|
4
4
|
.message=${this.helpText}
|
|
5
5
|
style=${(0,c.styleMap)({width:"100%"})}
|
|
6
6
|
></md-help-text>
|
|
7
|
-
`:
|
|
7
|
+
`:l.nothing}messagesTemplate(){return this.messages&&this.messages.length?l.html`
|
|
8
8
|
<div id="${this.htmlId}-message" part="message" class="md-dropbox__messages">
|
|
9
|
-
${(0,u.repeat)(this.messages,(e,t)=>
|
|
9
|
+
${(0,u.repeat)(this.messages,(e,t)=>l.html`
|
|
10
10
|
<md-help-text
|
|
11
11
|
.message=${e}
|
|
12
12
|
.id=${this.messageArr[t].id||""}
|
|
@@ -15,15 +15,16 @@
|
|
|
15
15
|
></md-help-text>
|
|
16
16
|
`)}
|
|
17
17
|
</div>
|
|
18
|
-
`:
|
|
18
|
+
`:l.nothing}iconTemplate(){return l.html`
|
|
19
19
|
<md-icon
|
|
20
20
|
class="md-dropdown-left-icon"
|
|
21
21
|
name="${this.leftIcon}"
|
|
22
22
|
size="16"
|
|
23
23
|
iconSet="momentumDesign"
|
|
24
|
+
aria-hidden="true"
|
|
24
25
|
@click=${this.toggleVisualListBox}
|
|
25
26
|
></md-icon>
|
|
26
|
-
`}clearButtonTemplate(){return
|
|
27
|
+
`}clearButtonTemplate(){return l.html`
|
|
27
28
|
<button
|
|
28
29
|
type="button"
|
|
29
30
|
class="md-dropdown-button clear"
|
|
@@ -39,10 +40,11 @@
|
|
|
39
40
|
name="cancel-bold"
|
|
40
41
|
size="16"
|
|
41
42
|
iconSet="momentumDesign"
|
|
43
|
+
aria-hidden="true"
|
|
42
44
|
style="height: ${this.clearIconHeight};"
|
|
43
45
|
></md-icon>
|
|
44
46
|
</button>
|
|
45
|
-
`}arrowButtonTemplate(){return
|
|
47
|
+
`}arrowButtonTemplate(){return l.html`
|
|
46
48
|
<button
|
|
47
49
|
type="button"
|
|
48
50
|
class="md-dropdown-button arrow-down"
|
|
@@ -55,54 +57,54 @@
|
|
|
55
57
|
?disabled=${this.disabled}
|
|
56
58
|
@click=${this.toggleVisualListBox}
|
|
57
59
|
>
|
|
58
|
-
<md-icon name="arrow-down-bold" size="16" iconSet="momentumDesign"></md-icon>
|
|
60
|
+
<md-icon name="arrow-down-bold" size="16" iconSet="momentumDesign" aria-hidden="true"></md-icon>
|
|
59
61
|
</button>
|
|
60
|
-
`}render(){return
|
|
62
|
+
`}render(){return l.html`
|
|
61
63
|
<div class="md-dropdown ${(0,p.classMap)(this.dropDownClassMap)}" part="dropdown">
|
|
62
|
-
${this.searchable?
|
|
64
|
+
${this.searchable?l.html`
|
|
63
65
|
<div part="group" class="group" ?readonly=${this.readOnly}>
|
|
64
|
-
${this.leftIcon?this.iconTemplate():
|
|
66
|
+
${this.leftIcon?this.iconTemplate():l.nothing}
|
|
65
67
|
<input
|
|
66
68
|
class="md-dropdown-input"
|
|
67
69
|
type="text"
|
|
68
70
|
role="combobox"
|
|
69
71
|
aria-autocomplete="both"
|
|
70
|
-
aria-label=${this.title}
|
|
72
|
+
aria-label=${(0,h.ifDefined)(this.inputValue?void 0:this.title)}
|
|
71
73
|
part="dropdown-input"
|
|
72
74
|
aria-expanded=${this.expanded}
|
|
73
|
-
placeholder=${this.placeholder}
|
|
75
|
+
placeholder=${this.inputValue?"":this.placeholder}
|
|
74
76
|
aria-controls="md-dropdown-list"
|
|
75
77
|
?readonly=${this.readOnly}
|
|
76
78
|
?disabled=${this.disabled}
|
|
77
79
|
?autofocus=${this.autofocus}
|
|
78
|
-
title=${this.title}
|
|
79
80
|
tabindex="0"
|
|
80
81
|
.value=${this.inputValue}
|
|
81
82
|
@click=${this.toggleVisualListBox}
|
|
82
83
|
@input=${this.handleInput}
|
|
83
84
|
/>
|
|
84
|
-
${this.compact||!this.searchable?
|
|
85
|
+
${this.compact||!this.searchable?l.nothing:this.shouldChangeButton()?this.clearButtonTemplate():this.arrowButtonTemplate()}
|
|
85
86
|
</div>
|
|
86
|
-
`:
|
|
87
|
+
`:l.html`
|
|
87
88
|
<label
|
|
88
89
|
class="md-dropdown-label ${(0,p.classMap)({"md-new-dropdown-label":this.newMomentum})}"
|
|
89
90
|
aria-expanded="${this.expanded}"
|
|
90
|
-
aria-label="${this.
|
|
91
|
+
aria-label="${this.labelTitle}"
|
|
91
92
|
aria-controls="md-dropdown-list"
|
|
92
93
|
aria-haspopup="listbox"
|
|
93
94
|
?disabled=${this.disabled}
|
|
94
95
|
@click=${this.onLabelClick}
|
|
95
96
|
part="dropdown-header"
|
|
96
97
|
role="combobox"
|
|
97
|
-
tabindex="0"
|
|
98
|
+
tabindex="${this.newMomentum&&this.disabled?-1:0}"
|
|
98
99
|
>
|
|
99
|
-
${this.leftIcon?
|
|
100
|
+
${this.leftIcon?l.html`<span class="md-dropdown-label--left-icon" aria-hidden="true">${this.iconTemplate()}</span>`:l.nothing}
|
|
100
101
|
<span
|
|
101
102
|
class="md-dropdown-label--text ${(0,p.classMap)({"md-new-dropdown-label--text":this.newMomentum})}"
|
|
103
|
+
aria-hidden="true"
|
|
102
104
|
>
|
|
103
105
|
${this.labelTitle}</span
|
|
104
106
|
>
|
|
105
|
-
<span class="md-dropdown-label--icon">
|
|
107
|
+
<span class="md-dropdown-label--icon" aria-hidden="true">
|
|
106
108
|
<md-icon name="arrow-down-bold" size="16" iconSet="momentumDesign"></md-icon>
|
|
107
109
|
</span>
|
|
108
110
|
</label>
|
|
@@ -114,14 +116,14 @@
|
|
|
114
116
|
aria-label="${this.labelTitle}"
|
|
115
117
|
aria-hidden="${!this.expanded}"
|
|
116
118
|
part="dropdown-options"
|
|
117
|
-
tabindex=${(0,h.ifDefined)(
|
|
119
|
+
tabindex=${(0,h.ifDefined)(this.newMomentum||-1===this.customTabIndex?void 0:this.customTabIndex)}
|
|
118
120
|
>
|
|
119
|
-
${this.filteredOptions.map((e,t)=>
|
|
121
|
+
${this.filteredOptions.map((e,t)=>l.html`
|
|
120
122
|
<li
|
|
121
123
|
id="combo-${t}"
|
|
122
124
|
class="md-dropdown-option"
|
|
123
125
|
role="option"
|
|
124
|
-
tabindex=${(0,h.ifDefined)(
|
|
126
|
+
tabindex=${(0,h.ifDefined)(this.newMomentum||-1===this.customTabIndex?void 0:this.customTabIndex)}
|
|
125
127
|
aria-label="${e.value}"
|
|
126
128
|
label="${e.value}"
|
|
127
129
|
aria-selected="${e.key===this.selectedKey}"
|
|
@@ -133,9 +135,16 @@
|
|
|
133
135
|
<span class="select-label" part="label">
|
|
134
136
|
<span>${e.value}</span>
|
|
135
137
|
</span>
|
|
138
|
+
${this.newMomentum&&e.key===this.selectedKey?l.html`<md-icon
|
|
139
|
+
class="md-dropdown-option--icon"
|
|
140
|
+
name="check-bold"
|
|
141
|
+
size="16"
|
|
142
|
+
iconSet="momentumDesign"
|
|
143
|
+
aria-hidden="true"
|
|
144
|
+
></md-icon>`:l.nothing}
|
|
136
145
|
</li>
|
|
137
146
|
`)}
|
|
138
147
|
</ul>
|
|
139
148
|
</div>
|
|
140
149
|
${this.messagesTemplate()} ${this.helpTextTemplate()}
|
|
141
|
-
`}};y([(0,
|
|
150
|
+
`}};y([(0,d.property)({type:String,attribute:"title"})],i.prototype,"title",void 0),y([(0,d.property)({type:Array})],i.prototype,"options",void 0),y([(0,d.property)({type:String,attribute:"option-id"})],i.prototype,"optionId",void 0),y([(0,d.property)({type:String,attribute:"option-value"})],i.prototype,"optionValue",void 0),y([(0,d.property)({type:Object})],i.prototype,"defaultOption",void 0),y([(0,d.property)({type:Boolean,reflect:!0})],i.prototype,"disabled",void 0),y([(0,d.property)({type:Number,attribute:"custom-tab-index",reflect:!0})],i.prototype,"customTabIndex",void 0),y([(0,d.property)({type:Boolean,attribute:"allow-unselected",reflect:!0})],i.prototype,"allowUnselected",void 0),y([(0,d.property)({type:Number,attribute:"visible-option",reflect:!0})],i.prototype,"visibleOptions",void 0),y([(0,d.property)({type:Boolean})],i.prototype,"newMomentum",void 0),y([(0,d.property)({type:Boolean,reflect:!0})],i.prototype,"compact",void 0),y([(0,d.property)({type:Boolean,reflect:!0})],i.prototype,"searchable",void 0),y([(0,d.property)({type:Boolean,reflect:!0})],i.prototype,"searchItem",void 0),y([(0,d.property)({type:String,attribute:"input-value",reflect:!0})],i.prototype,"inputValue",void 0),y([(0,d.property)({type:String})],i.prototype,"placeholder",void 0),y([(0,d.property)({type:Boolean,reflect:!0})],i.prototype,"readOnly",void 0),y([(0,d.property)({type:Boolean,reflect:!0})],i.prototype,"autofocus",void 0),y([(0,d.property)({type:String,attribute:"left-icon",reflect:!0})],i.prototype,"leftIcon",void 0),y([(0,d.property)({type:Boolean,reflect:!0,attribute:"search-trim-space"})],i.prototype,"trimSpace",void 0),y([(0,d.property)({type:String,attribute:"no-results-i18n"})],i.prototype,"resultsTextLocalization",void 0),y([(0,d.property)({type:Boolean})],i.prototype,"pill",void 0),y([(0,d.property)({type:String})],i.prototype,"helpText",void 0),y([(0,d.property)({type:Array})],i.prototype,"messageArr",void 0),y([(0,d.property)({type:String})],i.prototype,"htmlId",void 0),y([(0,d.property)({type:String,attribute:"clear-aria-label"})],i.prototype,"clearAriaLabel",void 0),y([(0,d.property)({type:String,attribute:"clear-icon-height"})],i.prototype,"clearIconHeight",void 0),y([(0,d.property)({type:String,attribute:"arrow-aria-label"})],i.prototype,"arrowAriaLabel",void 0),y([(0,d.property)({type:String,attribute:"popup-chevron-aria-hidden"})],i.prototype,"popupChevronAriaHidden",void 0),y([(0,d.property)({type:String,reflect:!0})],i.prototype,"ariaLabel",void 0),y([(0,d.property)({type:String,attribute:"search-result-aria-label"})],i.prototype,"searchResultAriaLabel",void 0),y([(0,d.state)()],i.prototype,"ariaLabelForDropdown",void 0),y([(0,d.state)()],i.prototype,"dropdownRenderOptions",void 0),y([(0,d.state)()],i.prototype,"selectedKey",void 0),y([(0,d.state)()],i.prototype,"expanded",void 0),y([(0,d.state)()],i.prototype,"focusedIndex",void 0),y([(0,d.query)("label")],i.prototype,"label",void 0),y([(0,d.query)(".md-dropdown-input")],i.prototype,"input",void 0),y([(0,d.query)("ul.md-dropdown-list")],i.prototype,"optionsList",void 0),y([(0,d.queryAll)("li.md-dropdown-option")],i.prototype,"optionsListItems",void 0),i=y([(0,n.wW)("md-dropdown")],i),e.ELEMENT=i}(s||(s={}))},7704(e,t,i){i.d(t,{wW:()=>o.w,yC:()=>s.y}),i(2364);var s=i(3203),o=(i(9938),i(5201),i(4781),i(608),i(9609))},2022(e){e.exports=n},554(e){e.exports=r},7161(t){t.exports=e},429(e){e.exports=t},5125(e){e.exports=i},291(e){e.exports=o},8175(e){e.exports=l},318(e){e.exports=s},5314(e){e.exports=a}},h={};function u(e){var t=h[e];if(void 0!==t)return t.exports;var i=h[e]={exports:{}};return p[e](i,i.exports,u),i.exports}u.m=p,d=[],u.O=(e,t,i,s)=>{if(!t){var o=1/0;for(l=0;l<d.length;l++){for(var[t,i,s]=d[l],n=!0,r=0;r<t.length;r++)(!1&s||o>=s)&&Object.keys(u.O).every(e=>u.O[e](t[r]))?t.splice(r--,1):(n=!1,s<o&&(o=s));if(n){d.splice(l--,1);var a=i();void 0!==a&&(e=a)}}return e}s=s||0;for(var l=d.length;l>0&&d[l-1][2]>s;l--)d[l]=d[l-1];d[l]=[t,i,s]},u.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return u.d(t,{a:t}),t},u.d=(e,t)=>{for(var i in t)u.o(t,i)&&!u.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},u.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),u.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e={561:0,2942:0,5323:0,7704:0,7711:0,8180:0};u.O.j=t=>0===e[t];var t=(t,i)=>{var s,o,[n,r,a]=i,l=0;if(n.some(t=>0!==e[t])){for(s in r)u.o(r,s)&&(u.m[s]=r[s]);if(a)var d=a(u)}for(t&&t(i);l<n.length;l++)o=n[l],u.o(e,o)&&e[o]&&e[o][0](),e[o]=0;return u.O(d)},i=self["momentum-web-components-[id]"]=self["momentum-web-components-[id]"]||[];i.forEach(t.bind(null,0)),i.push=t.bind(null,i.push.bind(i))})();var c=u.O(void 0,[9609,4084,3305,4739,7154,9773,5983,9488,1821,2364,9938,4781,5201,5584,8227,2050,8138,5057],()=>u(621));return u.O(c)})());
|
package/dist/esm/3639.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const __webpack_esm_id__=3639;export const __webpack_esm_ids__=[3639,6020];export const __webpack_esm_modules__={3639(t,e,i){i(5983);var s,a=i(9609),d=i(878),r=i(2050),o=i(4084),n=i(2927),h=i(8899),c=i(4955),l=i(3517),p=i(3842),y=function(t,e,i,s){var a,d=arguments.length,r=d<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(r=(d<3?a(r):d>3?a(e,i,r):a(e,i))||r);return d>3&&r&&Object.defineProperty(e,i,r),r};!function(t){let e=class extends n.LitElement{constructor(){super(...arguments),this.focused=!1,this.selected=!1,this.disabled=!1,this.day=(0,d.tB)(),this.viewAnchorMonth=void 0,this.filterParams=void 0,this.datePickerProps=void 0,this.isOutsideMonth=!1,this.isToday=!1,this.parentRangePicker=null,this.dateIsInRange=!1,this.handleClick=t=>{this.dispatchEvent(new CustomEvent("day-select",{bubbles:!0,composed:!0,detail:{date:this.day,sourceEvent:t}}))},this.isDateInRange=()=>{var t;const e=this.parentRangePicker,i=null==e?void 0:e.startDate,s=null==e?void 0:e.endDate;if(!i||!s)return!1;const a=(null===(t=this.day)||void 0===t?void 0:t.isValid)?this.day.toSQLDate():null;if(!a)return!1;const d=a>i&&a<s,r=a===i,o=a===s;return!this.isPrimarySelection()&&(d||r||o)},this.handleKeyDown=t=>{this.dispatchEvent(new CustomEvent("day-key-event",{bubbles:!0,composed:!0,detail:{date:this.day,sourceEvent:t}}))}}connectedCallback(){super.connectedCallback(),this.disabled=this.filterParams&&(0,d.t_)(this.day,this.filterParams)||!1,this.isOutsideMonth=this.day.month!==this.viewAnchorMonth,this.isToday=(0,d.ro)(this.day,(0,d.tB)()),this.selected=this.datePickerProps&&(0,d.ro)(this.datePickerProps.selected,this.day)||!1,this.focused=this.datePickerProps&&(0,d.ro)(this.datePickerProps.focused,this.day)||!1,this.parentRangePicker=(0,r.QZ)("md-date-range-picker",this)}updated(t){var e,i;super.updated(t),this.disabled=this.filterParams&&(0,d.t_)(this.day,this.filterParams)||!1,this.isOutsideMonth=this.day.month!==this.viewAnchorMonth,this.isToday=(0,d.ro)(this.day,(0,d.tB)()),this.selected=this.datePickerProps&&(0,d.ro)(this.datePickerProps.selected,this.day)||!1,this.focused=this.datePickerProps&&(0,d.ro)(this.datePickerProps.focused,this.day)||!1,this.focused&&this.button&&(null===(i=null===(e=this.button.shadowRoot)||void 0===e?void 0:e.querySelector("button"))||void 0===i||i.focus()),this.parentRangePicker&&(this.dateIsInRange=this.isDateInRange())}isPrimarySelection(){var t;return(null===(t=this.parentRangePicker)||void 0===t?void 0:t.startDate)&&void 0===this.parentRangePicker.endDate}isLeadingRangeEdge(){var t;return this===(null===(t=this.parentNode)||void 0===t?void 0:t.firstElementChild)}isEndingRangeEdge(){var t;return this===(null===(t=this.parentNode)||void 0===t?void 0:t.lastElementChild)}isStartDate(){var t;return(null===(t=this.parentRangePicker)||void 0===t?void 0:t.startDate)===this.day.toSQLDate()&&!this.isPrimarySelection()}isEndDate(){var t;return(null===(t=this.parentRangePicker)||void 0===t?void 0:t.endDate)===this.day.toSQLDate()}get getDayClassMap(){return{"md-datepicker__day--selected":this.selected,"md-datepicker__day--focus":this.focused,"md-datepicker__day--today":this.isToday,"md-datepicker__day--outside-month":this.isOutsideMonth,"md-datepicker__day--in-range":this.dateIsInRange,"md-datepicker__day--week-first":this.isLeadingRangeEdge(),"md-datepicker__day--week-last":this.isEndingRangeEdge(),"md-datepicker__day--start-date":this.isStartDate(),"md-datepicker__day--end-date":this.isEndDate()}}static get styles(){return[o.A,p.A]}render(){var t;const e=(0,d.WV)(this.day,(null===(t=this.datePickerProps)||void 0===t?void 0:t.locale)||"en").toFormat("
|
|
1
|
+
export const __webpack_esm_id__=3639;export const __webpack_esm_ids__=[3639,6020];export const __webpack_esm_modules__={3639(t,e,i){i(5983);var s,a=i(9609),d=i(878),r=i(2050),o=i(4084),n=i(2927),h=i(8899),c=i(4955),l=i(3517),p=i(3842),y=function(t,e,i,s){var a,d=arguments.length,r=d<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(r=(d<3?a(r):d>3?a(e,i,r):a(e,i))||r);return d>3&&r&&Object.defineProperty(e,i,r),r};!function(t){let e=class extends n.LitElement{constructor(){super(...arguments),this.focused=!1,this.selected=!1,this.disabled=!1,this.day=(0,d.tB)(),this.viewAnchorMonth=void 0,this.filterParams=void 0,this.datePickerProps=void 0,this.isOutsideMonth=!1,this.isToday=!1,this.parentRangePicker=null,this.dateIsInRange=!1,this.handleClick=t=>{this.dispatchEvent(new CustomEvent("day-select",{bubbles:!0,composed:!0,detail:{date:this.day,sourceEvent:t}}))},this.isDateInRange=()=>{var t;const e=this.parentRangePicker,i=null==e?void 0:e.startDate,s=null==e?void 0:e.endDate;if(!i||!s)return!1;const a=(null===(t=this.day)||void 0===t?void 0:t.isValid)?this.day.toSQLDate():null;if(!a)return!1;const d=a>i&&a<s,r=a===i,o=a===s;return!this.isPrimarySelection()&&(d||r||o)},this.handleKeyDown=t=>{this.dispatchEvent(new CustomEvent("day-key-event",{bubbles:!0,composed:!0,detail:{date:this.day,sourceEvent:t}}))}}connectedCallback(){super.connectedCallback(),this.disabled=this.filterParams&&(0,d.t_)(this.day,this.filterParams)||!1,this.isOutsideMonth=this.day.month!==this.viewAnchorMonth,this.isToday=(0,d.ro)(this.day,(0,d.tB)()),this.selected=this.datePickerProps&&(0,d.ro)(this.datePickerProps.selected,this.day)||!1,this.focused=this.datePickerProps&&(0,d.ro)(this.datePickerProps.focused,this.day)||!1,this.parentRangePicker=(0,r.QZ)("md-date-range-picker",this)}updated(t){var e,i;super.updated(t),this.disabled=this.filterParams&&(0,d.t_)(this.day,this.filterParams)||!1,this.isOutsideMonth=this.day.month!==this.viewAnchorMonth,this.isToday=(0,d.ro)(this.day,(0,d.tB)()),this.selected=this.datePickerProps&&(0,d.ro)(this.datePickerProps.selected,this.day)||!1,this.focused=this.datePickerProps&&(0,d.ro)(this.datePickerProps.focused,this.day)||!1,this.focused&&this.button&&(null===(i=null===(e=this.button.shadowRoot)||void 0===e?void 0:e.querySelector("button"))||void 0===i||i.focus()),this.parentRangePicker&&(this.dateIsInRange=this.isDateInRange())}isPrimarySelection(){var t;return(null===(t=this.parentRangePicker)||void 0===t?void 0:t.startDate)&&void 0===this.parentRangePicker.endDate}isLeadingRangeEdge(){var t;return this===(null===(t=this.parentNode)||void 0===t?void 0:t.firstElementChild)}isEndingRangeEdge(){var t;return this===(null===(t=this.parentNode)||void 0===t?void 0:t.lastElementChild)}isStartDate(){var t;return(null===(t=this.parentRangePicker)||void 0===t?void 0:t.startDate)===this.day.toSQLDate()&&!this.isPrimarySelection()}isEndDate(){var t;return(null===(t=this.parentRangePicker)||void 0===t?void 0:t.endDate)===this.day.toSQLDate()}get getDayClassMap(){return{"md-datepicker__day--selected":this.selected,"md-datepicker__day--focus":this.focused,"md-datepicker__day--today":this.isToday,"md-datepicker__day--outside-month":this.isOutsideMonth,"md-datepicker__day--in-range":this.dateIsInRange,"md-datepicker__day--week-first":this.isLeadingRangeEdge(),"md-datepicker__day--week-last":this.isEndingRangeEdge(),"md-datepicker__day--start-date":this.isStartDate(),"md-datepicker__day--end-date":this.isEndDate()}}static get styles(){return[o.A,p.A]}render(){var t;const e=(0,d.WV)(this.day,(null===(t=this.datePickerProps)||void 0===t?void 0:t.locale)||"en").toFormat("dd MMMM yyyy"),i=this.selected||this.isStartDate()||this.isEndDate()?`${e}, selected`:e;return n.html`
|
|
2
2
|
<md-button
|
|
3
3
|
circle
|
|
4
4
|
size=${32}
|
|
@@ -7,8 +7,8 @@ export const __webpack_esm_id__=3639;export const __webpack_esm_ids__=[3639,6020
|
|
|
7
7
|
class="md-datepicker__day ${(0,c.classMap)(this.getDayClassMap)}"
|
|
8
8
|
@click=${t=>{this.disabled||this.handleClick(t)}}
|
|
9
9
|
@keydown=${t=>this.handleKeyDown(t)}
|
|
10
|
-
ariaLabel=${
|
|
11
|
-
title=${
|
|
10
|
+
ariaLabel=${i}
|
|
11
|
+
title=${e}
|
|
12
12
|
aria-selected=${(0,l.ifDefined)(this.selected)}
|
|
13
13
|
tab-index=${this.focused?"0":"-1"}
|
|
14
14
|
>
|
package/dist/esm/5057.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const __webpack_esm_id__=5057;export const __webpack_esm_ids__=[5057];export const __webpack_esm_modules__={5057(o,r,d){d.d(r,{A:()=>e});const e=d(2927).css`:host(:focus){box-shadow:none!important;outline:0!important}:host .md-dropdown{display:flex;flex-direction:column;position:relative}:host .md-dropdown-select{display:none}:host .md-dropdown-label{align-content:center;align-items:center;display:flex;flex-flow:row nowrap;justify-content:center;background-color:var(--md-primary-bg-color);border:1px solid var(--dropdown-border-color,var(--md-secondary-seperator-color));border-radius:var(--dropdown-group-radius);min-height:2rem;padding:0 .75rem}:host .md-dropdown-label--text{align-content:center;align-items:center;display:flex;flex-flow:row nowrap;justify-content:flex-start;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--md-secondary-text-color);line-height:2rem;outline:0;width:6.25rem;flex:1 0 auto}:host .md-dropdown-label--left-icon{margin-right:calc(.25rem*2);align-self:center;cursor:pointer;height:15px;display:flex}:host .md-dropdown-label--left-icon md-icon{color:var(--md-primary-text-color,#f7f7f7)}:host .md-dropdown-label--icon{transition:all .15s linear;align-self:center;background:rgba(0,0,0,0);border:0;cursor:pointer;margin:0;margin-left:calc(.25rem*2);outline:0;padding:0;padding-top:calc(.25rem/2);position:relative;vertical-align:bottom;height:inherit;display:flex}:host .md-dropdown-label--icon md-icon{color:var(--md-primary-text-color,#f7f7f7)}:host .md-dropdown-label:hover{background-color:var(--dropdown-bg-color-hover)}:host .md-dropdown-label:active{background-color:var(--dropdown-bg-color-active)}:host .md-dropdown-list{list-style:none;margin:0;padding:0;display:none;background-color:var(--md-primary-bg-color);border:1px solid var(--dropdown-list-border-color);border-radius:.5rem;box-shadow:0 4px 8px rgba(0,0,0,.16),0 0 1px rgba(0,0,0,.16);left:0;overflow:auto;overflow-x:hidden;position:absolute;top:calc(100% + .25rem);width:100%;z-index:99;padding:calc(var(--dropdown-list-padding)/16*1rem)}:host .md-dropdown-option{align-content:center;align-items:center;display:flex;flex-flow:row nowrap;justify-content:flex-start;color:var(--md-primary-text-color,#f7f7f7);padding:.4375rem .75rem .5rem;border-radius:calc(var(--dropdown-list-item-border-radius)/16*1rem);height:calc(var(--dropdown-list-item-height)/16*1rem)}:host .md-dropdown-option .select-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:default;width:calc(100% - 1rem);display:block}:host .md-dropdown-option:hover{background-color:var(--dropdown-list-item-bg-color-hover)}:host .md-dropdown-option[focused]{background-color:var(--dropdown-list-item-bg-color-hover);box-shadow:none;outline:0;box-shadow:0 0 0 .09375rem var(--dropdown-list-item-border-focus)}:host .md-dropdown-option[selected]{background-color:var(--dropdown-list-item-bg-color-focus);box-shadow:none;outline:0;box-shadow:0 0 0 .09375rem var(--dropdown-list-item-border-focus)}:host .md-dropdown__expanded .md-dropdown-list{display:block}:host .md-dropdown__expanded .md-dropdown-label--icon{transform:rotate(180deg)}:host .md-dropdown__expanded .md-dropdown-button.arrow-down{transform:rotate(180deg)}:host .md-dropdown--pill .group,:host .md-dropdown--pill .md-dropdown-label{border-radius:18px}:host .md-dropdown .group{align-items:start;background-color:var(--md-primary-bg-color);border:1px solid var(--dropdown-border-color,var(--md-secondary-seperator-color));border-radius:var(--dropdown-group-radius);display:flex;min-height:2rem;padding:0 .75rem;height:2.125rem}:host .md-dropdown .group md-icon{color:var(--md-primary-text-color,#545454);cursor:pointer;fill:var(--md-secondary-text-color,#545454);height:100%}:host .md-dropdown .group md-icon:focus{box-shadow:none;outline:0;box-shadow:0 0 0 .125rem var(--md-focus-border-color,#545454)}:host .md-dropdown .group:hover{background-color:var(--dropdown-bg-color-hover)}:host .md-dropdown .group:active{background-color:var(--dropdown-bg-color-active)}:host .md-dropdown .group input{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;background:rgba(0,0,0,0);border:0;color:var(--md-primary-text-color);display:inline-block;flex:1 1 auto;height:2rem;outline:0}:host .md-dropdown .group input::placeholder{color:var(--md-secondary-text-color)}:host .md-dropdown .group ::input-placeholder{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:inline-block;width:100%}:host .md-dropdown .group .md-dropdown-left-icon{margin-right:.25rem}:host .md-dropdown .md-dropdown-button[disabled] md-icon{color:var(--md-disabled-text-color,#b2b2b2)}:host .md-dropdown .md-dropdown-input[readonly]{pointer-events:none}:host .md-dropdown.md-error .group,:host .md-dropdown.md-error .group:active{border-color:var(--input-error-border-color)!important}:host .md-dropdown.md-warning .group,:host .md-dropdown.md-warning .group:active{border-color:var(--input-warning-border-color)!important}:host .md-dropdown.md-success .group,:host .md-dropdown.md-success .group:active{border-color:var(--input-success-border-color)!important}:host .help-text,:host .md-dropbox__messages{padding-top:.375rem}:host .group[readonly]{border-color:var(--dropdown-border-color-disabled)!important}:host .group[readonly] md-icon{color:var(--dropdown-bg-color-disabled)!important}:host .md-dropdown-button{transition:all .15s linear;align-self:center;background:rgba(0,0,0,0);border:0;cursor:pointer;margin:0;margin-left:calc(.25rem*2);outline:0;padding:0;position:relative;width:1.25rem;height:1.25rem;display:flex;align-items:center;justify-content:center}:host .md-dropdown-button md-icon{color:var(--combobox-dropdown-item-icon-color)}:host .md-combobox-button.clear{height:auto;padding:.115rem}:host .md-combobox-button.arrow-down:focus,:host .md-combobox-button.clear:focus{outline:2px solid var(--button-focus-ring-color,#007aa3)}:host .md-new-dropdown{height:2rem}:host .md-new-dropdown-label{background-color:var(--dropdown-bg-color-default);border-radius:8px}:host .md-new-dropdown-label--text{color:var(--md-primary-text-color)}:host .md-new-dropdown-label:hover{background-color:var(--dropdown-bg-color-hover)}:host .md-new-dropdown-label:active{background-color:var(--dropdown-bg-color-active)}:host .md-new-dropdown-label:focus{background-color:var(--dropdown-bg-color-focus)}:host .md-new-dropdown .group{height:2rem;border-radius:.5rem;background-color:rgba(0,0,0,0);padding-right:.5rem}:host(:active) .md-new-dropdown .group,:host(:active) .md-new-dropdown-label{outline:2px solid var(--input-default-outline-color);outline-offset:.125rem;box-shadow:none;border:1px solid var(--dropdown-border-color,var(--md-secondary-seperator-color))!important}:host([focus-visible]) .md-dropdown-label{border-color:var(--dropdown-border-color-focus);box-shadow:none;outline:0}:host([focus-visible]) .group{border-color:var(--dropdown-border-color-focus);background-color:var(--dropdown-bg-color-focus)}:host([focus-visible]) .md-new-dropdown .group,:host([focus-visible]) .md-new-dropdown-label{outline:2px solid var(--dropdown-border-color-focus)!important;outline-offset:.125rem!important;box-shadow:none;border-color:var(--combobox-focus-new-border-color)}:host([disabled]) .md-dropdown-label{background-color:var(--md-tertiary-bg-color)}:host([disabled]) .md-dropdown-label:active,:host([disabled]) .md-dropdown-label:hover{background-color:var(--md-tertiary-bg-color);pointer-events:none}:host([disabled]) .md-dropdown-label:active>md-icon,:host([disabled]) .md-dropdown-label:hover>md-icon{opacity:.3}:host([disabled]) .md-dropdown-label:focus-visible{border-color:var(--dropdown-border-color-focus);outline:0}:host([disabled]) .group{background-color:var(--md-tertiary-bg-color)}:host([disabled]) .group md-icon{opacity:.3}:host([disabled]) .group:active,:host([disabled]) .group:hover{background-color:var(--md-tertiary-bg-color);pointer-events:none}:host([disabled]) .group:focus-visible{border-color:var(--dropdown-border-color-focus);outline:0}:host([disabled]) md-help-text{color:var(--md-disabled-text-color,#b2b2b2)}:host([disabled]) .md-new-dropdown-label{background-color:var(--dropdown-bg-color-disabled,transparent);border-color:var(--dropdown-border-color-disabled,#b2b2b2);outline:0!important;box-shadow:none}:host([disabled]) .md-new-dropdown-label--text{color:var(--md-disabled-text-color)}:host([disabled]) .md-new-dropdown-label .md-dropdown-label--icon md-icon{color:var(--md-disabled-text-color)}:host([disabled]) .md-new-dropdown-label:active,:host([disabled]) .md-new-dropdown-label:hover{background-color:var(--dropdown-bg-color-disabled,transparent);pointer-events:none;outline:0!important;box-shadow:none;border-color:var(--dropdown-border-color-disabled,#b2b2b2)}:host([disabled]) .md-new-dropdown-label:focus-visible{border-color:var(--dropdown-border-color-disabled);outline:0!important;box-shadow:none}:host([disabled]) .md-new-dropdown .group{background:rgba(0,0,0,0);border-color:var(--dropdown-border-color-disabled);pointer-events:none;outline:0!important}:host([disabled]) .md-new-dropdown .group input{color:var(--md-disabled-text-color)}:host([disabled]) .md-new-dropdown .group input::placeholder{color:var(--md-disabled-text-color)}:host([disabled]) .md-new-dropdown .group:active,:host([disabled]) .md-new-dropdown .group:hover{border-color:var(--dropdown-border-color-disabled)}:host([disabled]) .md-new-dropdown .group:focus-visible{border-color:var(--dropdown-border-color-disabled)}@media(forced-colors:active){:host([focus-visible]) .md-dropdown .md-dropdown-label{border:2px solid Highlight}:host([focus-visible]) .md-dropdown .md-dropdown-label--text{forced-color-adjust:none;background-color:Canvas;color:CanvasText}:host([focus-visible]) .md-dropdown-list{border:1px solid CanvasText}:host .md-dropdown-option[focused]{forced-color-adjust:none;background-color:Highlight;color:HighlightText}:host .group input{color:HighlightText}:host .group input::placeholder{color:GrayText}:host([disabled]) .md-dropdown .md-dropdown-label{border:1px solid GrayText}:host([disabled]) .group,:host([disabled]) .group:active{border:1px solid GrayText!important;outline:0!important}:host([disabled]) .group input,:host([disabled]) .group:active input{color:GrayText}:host([disabled]) .group input::placeholder,:host([disabled]) .group:active input::placeholder{color:GrayText}}`}};
|
|
1
|
+
export const __webpack_esm_id__=5057;export const __webpack_esm_ids__=[5057];export const __webpack_esm_modules__={5057(o,r,d){d.d(r,{A:()=>e});const e=d(2927).css`:host(:focus){box-shadow:none!important;outline:0!important}:host .md-dropdown{display:flex;flex-direction:column;position:relative}:host .md-dropdown-select{display:none}:host .md-dropdown-label{align-content:center;align-items:center;display:flex;flex-flow:row nowrap;justify-content:center;background-color:var(--md-primary-bg-color);border:1px solid var(--dropdown-border-color,var(--md-secondary-seperator-color));border-radius:var(--dropdown-group-radius);min-height:2rem;padding:0 .75rem}:host .md-dropdown-label--text{align-content:center;align-items:center;display:flex;flex-flow:row nowrap;justify-content:flex-start;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--md-secondary-text-color);line-height:2rem;outline:0;width:6.25rem;flex:1 0 auto}:host .md-dropdown-label--left-icon{margin-right:calc(.25rem*2);align-self:center;cursor:pointer;height:15px;display:flex}:host .md-dropdown-label--left-icon md-icon{color:var(--md-primary-text-color,#f7f7f7)}:host .md-dropdown-label--icon{transition:all .15s linear;align-self:center;background:rgba(0,0,0,0);border:0;cursor:pointer;margin:0;margin-left:calc(.25rem*2);outline:0;padding:0;padding-top:calc(.25rem/2);position:relative;vertical-align:bottom;height:inherit;display:flex}:host .md-dropdown-label--icon md-icon{color:var(--md-primary-text-color,#f7f7f7)}:host .md-dropdown-label:hover{background-color:var(--dropdown-bg-color-hover)}:host .md-dropdown-label:active{background-color:var(--dropdown-bg-color-active)}:host .md-dropdown-list{list-style:none;margin:0;padding:0;display:none;background-color:var(--md-primary-bg-color);border:1px solid var(--dropdown-list-border-color);border-radius:.5rem;box-shadow:0 4px 8px rgba(0,0,0,.16),0 0 1px rgba(0,0,0,.16);left:0;overflow:auto;overflow-x:hidden;position:absolute;top:calc(100% + .25rem);width:100%;z-index:99;padding:calc(var(--dropdown-list-padding)/16*1rem)}:host .md-dropdown-option{align-content:center;align-items:center;display:flex;flex-flow:row nowrap;justify-content:flex-start;color:var(--md-primary-text-color,#f7f7f7);padding:.4375rem .75rem .5rem;border-radius:calc(var(--dropdown-list-item-border-radius)/16*1rem);height:calc(var(--dropdown-list-item-height)/16*1rem)}:host .md-dropdown-option .select-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:default;width:calc(100% - 1rem);display:block}:host .md-dropdown-option:hover{background-color:var(--dropdown-list-item-bg-color-hover)}:host .md-dropdown-option[focused]{background-color:var(--dropdown-list-item-bg-color-hover);box-shadow:none;outline:0;box-shadow:0 0 0 .09375rem var(--dropdown-list-item-border-focus)}:host .md-dropdown-option[selected]{background-color:var(--dropdown-list-item-bg-color-focus);box-shadow:none;outline:0;box-shadow:0 0 0 .09375rem var(--dropdown-list-item-border-focus)}:host .md-dropdown__expanded .md-dropdown-list{display:block}:host .md-dropdown__expanded .md-dropdown-label--icon{transform:rotate(180deg)}:host .md-dropdown__expanded .md-dropdown-button.arrow-down{transform:rotate(180deg)}:host .md-dropdown--pill .group,:host .md-dropdown--pill .md-dropdown-label{border-radius:18px}:host .md-dropdown .group{align-items:start;background-color:var(--md-primary-bg-color);border:1px solid var(--dropdown-border-color,var(--md-secondary-seperator-color));border-radius:var(--dropdown-group-radius);display:flex;min-height:2rem;padding:0 .75rem;height:2.125rem}:host .md-dropdown .group md-icon{color:var(--md-primary-text-color,#545454);cursor:pointer;fill:var(--md-secondary-text-color,#545454);height:100%}:host .md-dropdown .group md-icon:focus{box-shadow:none;outline:0;box-shadow:0 0 0 .125rem var(--md-focus-border-color,#545454)}:host .md-dropdown .group:hover{background-color:var(--dropdown-bg-color-hover)}:host .md-dropdown .group:active{background-color:var(--dropdown-bg-color-active)}:host .md-dropdown .group input{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;background:rgba(0,0,0,0);border:0;color:var(--md-primary-text-color);display:inline-block;flex:1 1 auto;height:2rem;outline:0}:host .md-dropdown .group input::placeholder{color:var(--md-secondary-text-color)}:host .md-dropdown .group ::input-placeholder{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:inline-block;width:100%}:host .md-dropdown .group .md-dropdown-left-icon{margin-right:.25rem}:host .md-dropdown .md-dropdown-button[disabled] md-icon{color:var(--md-disabled-text-color,#b2b2b2)}:host .md-dropdown .md-dropdown-input[readonly]{pointer-events:none}:host .md-dropdown.md-error .group,:host .md-dropdown.md-error .group:active{border-color:var(--input-error-border-color)!important}:host .md-dropdown.md-warning .group,:host .md-dropdown.md-warning .group:active{border-color:var(--input-warning-border-color)!important}:host .md-dropdown.md-success .group,:host .md-dropdown.md-success .group:active{border-color:var(--input-success-border-color)!important}:host .help-text,:host .md-dropbox__messages{padding-top:.375rem}:host .group[readonly]{border-color:var(--dropdown-border-color-disabled)!important}:host .group[readonly] md-icon{color:var(--dropdown-bg-color-disabled)!important}:host .md-dropdown-button{transition:all .15s linear;align-self:center;background:rgba(0,0,0,0);border:0;cursor:pointer;margin:0;margin-left:calc(.25rem*2);outline:0;padding:0;position:relative;width:1.25rem;height:1.25rem;display:flex;align-items:center;justify-content:center}:host .md-dropdown-button md-icon{color:var(--combobox-dropdown-item-icon-color)}:host .md-dropdown-button.clear:focus-visible{outline:2px solid var(--button-focus-ring-color);border-radius:.125rem}:host .md-combobox-button.clear{height:auto;padding:.115rem}:host .md-combobox-button.arrow-down:focus,:host .md-combobox-button.clear:focus{outline:2px solid var(--button-focus-ring-color)}:host .md-new-dropdown{height:2rem}:host .md-new-dropdown-label{background-color:var(--dropdown-bg-color-default);border-radius:8px}:host .md-new-dropdown-label--text{color:var(--md-primary-text-color)}:host .md-new-dropdown-label:hover{background-color:var(--dropdown-bg-color-hover)}:host .md-new-dropdown-label:active{background-color:var(--dropdown-bg-color-active)}:host .md-new-dropdown-label:focus{background-color:var(--dropdown-bg-color-focus)}:host .md-new-dropdown .group{height:2rem;border-radius:.5rem;background-color:rgba(0,0,0,0);padding-right:.5rem;align-items:center}:host .md-new-dropdown .md-dropdown-list{border:1px solid var(--dropdown-list-border-color)}:host .md-new-dropdown .md-dropdown-option:active{background-color:var(--dropdown-list-item-bg-color-focus)}:host .md-new-dropdown .md-dropdown-option[selected]{background-color:rgba(0,0,0,0);box-shadow:none}:host .md-new-dropdown .md-dropdown-option[selected]:hover{background-color:var(--dropdown-list-item-bg-color-hover)}:host .md-new-dropdown .md-dropdown-option[selected]:active{background-color:var(--dropdown-list-item-bg-color-focus)}:host .md-new-dropdown .md-dropdown-option[focused]{background-color:rgba(0,0,0,0);box-shadow:none;outline:0;box-shadow:0 0 0 .09375rem var(--dropdown-list-item-border-focus)}:host .md-new-dropdown .md-dropdown-option[focused]:hover{background-color:var(--dropdown-list-item-bg-color-hover)}:host .md-new-dropdown .md-dropdown-option[focused]:active{background-color:var(--dropdown-list-item-bg-color-focus)}:host .md-new-dropdown .md-dropdown-option--icon{flex-shrink:0;display:flex;align-items:center;margin-left:auto}:host(:active) .md-new-dropdown .group,:host(:active) .md-new-dropdown-label{outline:2px solid var(--input-default-outline-color);outline-offset:.125rem;box-shadow:none;border:1px solid var(--dropdown-border-color,var(--md-secondary-seperator-color))!important}:host(:active) .md-new-dropdown.md-dropdown__expanded .group,:host(:active) .md-new-dropdown.md-dropdown__expanded .md-new-dropdown-label{outline:0!important}:host([focus-visible]) .md-dropdown-label{border-color:var(--dropdown-border-color-focus);box-shadow:none;outline:0}:host([focus-visible]) .group{border-color:var(--dropdown-border-color-focus);background-color:var(--dropdown-bg-color-focus)}:host([focus-visible]) .group:has(.md-dropdown-button:focus-visible){border-color:var(--dropdown-border-color);background-color:rgba(0,0,0,0);outline:0!important}:host([focus-visible]) .md-new-dropdown .group,:host([focus-visible]) .md-new-dropdown-label{outline:2px solid var(--dropdown-border-color-focus)!important;outline-offset:.125rem!important;box-shadow:none;border-color:var(--combobox-focus-new-border-color)}:host([focus-visible]) .md-new-dropdown .group:has(.md-dropdown-button:focus-visible){outline:0!important;border-color:var(--dropdown-border-color)}:host([focus-visible]) .md-new-dropdown.md-dropdown__expanded .group,:host([focus-visible]) .md-new-dropdown.md-dropdown__expanded .md-new-dropdown-label{outline:0!important}:host([disabled]) .md-dropdown-label{background-color:var(--md-tertiary-bg-color)}:host([disabled]) .md-dropdown-label:active,:host([disabled]) .md-dropdown-label:hover{background-color:var(--md-tertiary-bg-color);pointer-events:none}:host([disabled]) .md-dropdown-label:active>md-icon,:host([disabled]) .md-dropdown-label:hover>md-icon{opacity:.3}:host([disabled]) .md-dropdown-label:focus-visible{border-color:var(--dropdown-border-color-focus);outline:0}:host([disabled]) .group{background-color:var(--md-tertiary-bg-color)}:host([disabled]) .group md-icon{opacity:.3}:host([disabled]) .group:active,:host([disabled]) .group:hover{background-color:var(--md-tertiary-bg-color);pointer-events:none}:host([disabled]) .group:focus-visible{border-color:var(--dropdown-border-color-focus);outline:0}:host([disabled]) md-help-text{color:var(--md-disabled-text-color,#b2b2b2)}:host([disabled]) .md-new-dropdown-label{background-color:var(--dropdown-bg-color-disabled,transparent);border-color:var(--dropdown-border-color-disabled,#b2b2b2);outline:0!important;box-shadow:none}:host([disabled]) .md-new-dropdown-label--text{color:var(--md-disabled-text-color)}:host([disabled]) .md-new-dropdown-label .md-dropdown-label--icon md-icon{color:var(--md-disabled-text-color)}:host([disabled]) .md-new-dropdown-label:active,:host([disabled]) .md-new-dropdown-label:hover{background-color:var(--dropdown-bg-color-disabled,transparent);pointer-events:none;outline:0!important;box-shadow:none;border-color:var(--dropdown-border-color-disabled,#b2b2b2)}:host([disabled]) .md-new-dropdown-label:focus-visible{border-color:var(--dropdown-border-color-disabled);outline:0!important;box-shadow:none}:host([disabled]) .md-new-dropdown .group{background:rgba(0,0,0,0);border-color:var(--dropdown-border-color-disabled);pointer-events:none;outline:0!important}:host([disabled]) .md-new-dropdown .group input{color:var(--md-disabled-text-color)}:host([disabled]) .md-new-dropdown .group input::placeholder{color:var(--md-disabled-text-color)}:host([disabled]) .md-new-dropdown .group:active,:host([disabled]) .md-new-dropdown .group:hover{border-color:var(--dropdown-border-color-disabled)}:host([disabled]) .md-new-dropdown .group:focus-visible{border-color:var(--dropdown-border-color-disabled)}@media(forced-colors:active){:host([focus-visible]) .md-dropdown .md-dropdown-label{border:2px solid Highlight}:host([focus-visible]) .md-dropdown .md-dropdown-label--text{forced-color-adjust:none;background-color:Canvas;color:CanvasText}:host([focus-visible]) .md-dropdown-list{border:1px solid CanvasText}:host .md-dropdown-option[focused]{forced-color-adjust:none;background-color:Highlight;color:HighlightText}:host .group input{color:HighlightText}:host .group input::placeholder{color:GrayText}:host([disabled]) .md-dropdown .md-dropdown-label{border:1px solid GrayText}:host([disabled]) .group,:host([disabled]) .group:active{border:1px solid GrayText!important;outline:0!important}:host([disabled]) .group input,:host([disabled]) .group:active input{color:GrayText}:host([disabled]) .group input::placeholder,:host([disabled]) .group:active input::placeholder{color:GrayText}}`}};
|
package/dist/esm/6020.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const __webpack_esm_id__=6020;export const __webpack_esm_ids__=[3639,6020];export const __webpack_esm_modules__={3639(t,e,i){i.d(e,{X:()=>s}),i(5983);var s,a=i(9609),d=i(878),r=i(2050),o=i(4084),n=i(2927),h=i(8899),c=i(4955),l=i(3517),p=i(3842),y=function(t,e,i,s){var a,d=arguments.length,r=d<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(r=(d<3?a(r):d>3?a(e,i,r):a(e,i))||r);return d>3&&r&&Object.defineProperty(e,i,r),r};!function(t){let e=class extends n.LitElement{constructor(){super(...arguments),this.focused=!1,this.selected=!1,this.disabled=!1,this.day=(0,d.tB)(),this.viewAnchorMonth=void 0,this.filterParams=void 0,this.datePickerProps=void 0,this.isOutsideMonth=!1,this.isToday=!1,this.parentRangePicker=null,this.dateIsInRange=!1,this.handleClick=t=>{this.dispatchEvent(new CustomEvent("day-select",{bubbles:!0,composed:!0,detail:{date:this.day,sourceEvent:t}}))},this.isDateInRange=()=>{var t;const e=this.parentRangePicker,i=null==e?void 0:e.startDate,s=null==e?void 0:e.endDate;if(!i||!s)return!1;const a=(null===(t=this.day)||void 0===t?void 0:t.isValid)?this.day.toSQLDate():null;if(!a)return!1;const d=a>i&&a<s,r=a===i,o=a===s;return!this.isPrimarySelection()&&(d||r||o)},this.handleKeyDown=t=>{this.dispatchEvent(new CustomEvent("day-key-event",{bubbles:!0,composed:!0,detail:{date:this.day,sourceEvent:t}}))}}connectedCallback(){super.connectedCallback(),this.disabled=this.filterParams&&(0,d.t_)(this.day,this.filterParams)||!1,this.isOutsideMonth=this.day.month!==this.viewAnchorMonth,this.isToday=(0,d.ro)(this.day,(0,d.tB)()),this.selected=this.datePickerProps&&(0,d.ro)(this.datePickerProps.selected,this.day)||!1,this.focused=this.datePickerProps&&(0,d.ro)(this.datePickerProps.focused,this.day)||!1,this.parentRangePicker=(0,r.QZ)("md-date-range-picker",this)}updated(t){var e,i;super.updated(t),this.disabled=this.filterParams&&(0,d.t_)(this.day,this.filterParams)||!1,this.isOutsideMonth=this.day.month!==this.viewAnchorMonth,this.isToday=(0,d.ro)(this.day,(0,d.tB)()),this.selected=this.datePickerProps&&(0,d.ro)(this.datePickerProps.selected,this.day)||!1,this.focused=this.datePickerProps&&(0,d.ro)(this.datePickerProps.focused,this.day)||!1,this.focused&&this.button&&(null===(i=null===(e=this.button.shadowRoot)||void 0===e?void 0:e.querySelector("button"))||void 0===i||i.focus()),this.parentRangePicker&&(this.dateIsInRange=this.isDateInRange())}isPrimarySelection(){var t;return(null===(t=this.parentRangePicker)||void 0===t?void 0:t.startDate)&&void 0===this.parentRangePicker.endDate}isLeadingRangeEdge(){var t;return this===(null===(t=this.parentNode)||void 0===t?void 0:t.firstElementChild)}isEndingRangeEdge(){var t;return this===(null===(t=this.parentNode)||void 0===t?void 0:t.lastElementChild)}isStartDate(){var t;return(null===(t=this.parentRangePicker)||void 0===t?void 0:t.startDate)===this.day.toSQLDate()&&!this.isPrimarySelection()}isEndDate(){var t;return(null===(t=this.parentRangePicker)||void 0===t?void 0:t.endDate)===this.day.toSQLDate()}get getDayClassMap(){return{"md-datepicker__day--selected":this.selected,"md-datepicker__day--focus":this.focused,"md-datepicker__day--today":this.isToday,"md-datepicker__day--outside-month":this.isOutsideMonth,"md-datepicker__day--in-range":this.dateIsInRange,"md-datepicker__day--week-first":this.isLeadingRangeEdge(),"md-datepicker__day--week-last":this.isEndingRangeEdge(),"md-datepicker__day--start-date":this.isStartDate(),"md-datepicker__day--end-date":this.isEndDate()}}static get styles(){return[o.A,p.A]}render(){var t;const e=(0,d.WV)(this.day,(null===(t=this.datePickerProps)||void 0===t?void 0:t.locale)||"en").toFormat("
|
|
1
|
+
export const __webpack_esm_id__=6020;export const __webpack_esm_ids__=[3639,6020];export const __webpack_esm_modules__={3639(t,e,i){i.d(e,{X:()=>s}),i(5983);var s,a=i(9609),d=i(878),r=i(2050),o=i(4084),n=i(2927),h=i(8899),c=i(4955),l=i(3517),p=i(3842),y=function(t,e,i,s){var a,d=arguments.length,r=d<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(r=(d<3?a(r):d>3?a(e,i,r):a(e,i))||r);return d>3&&r&&Object.defineProperty(e,i,r),r};!function(t){let e=class extends n.LitElement{constructor(){super(...arguments),this.focused=!1,this.selected=!1,this.disabled=!1,this.day=(0,d.tB)(),this.viewAnchorMonth=void 0,this.filterParams=void 0,this.datePickerProps=void 0,this.isOutsideMonth=!1,this.isToday=!1,this.parentRangePicker=null,this.dateIsInRange=!1,this.handleClick=t=>{this.dispatchEvent(new CustomEvent("day-select",{bubbles:!0,composed:!0,detail:{date:this.day,sourceEvent:t}}))},this.isDateInRange=()=>{var t;const e=this.parentRangePicker,i=null==e?void 0:e.startDate,s=null==e?void 0:e.endDate;if(!i||!s)return!1;const a=(null===(t=this.day)||void 0===t?void 0:t.isValid)?this.day.toSQLDate():null;if(!a)return!1;const d=a>i&&a<s,r=a===i,o=a===s;return!this.isPrimarySelection()&&(d||r||o)},this.handleKeyDown=t=>{this.dispatchEvent(new CustomEvent("day-key-event",{bubbles:!0,composed:!0,detail:{date:this.day,sourceEvent:t}}))}}connectedCallback(){super.connectedCallback(),this.disabled=this.filterParams&&(0,d.t_)(this.day,this.filterParams)||!1,this.isOutsideMonth=this.day.month!==this.viewAnchorMonth,this.isToday=(0,d.ro)(this.day,(0,d.tB)()),this.selected=this.datePickerProps&&(0,d.ro)(this.datePickerProps.selected,this.day)||!1,this.focused=this.datePickerProps&&(0,d.ro)(this.datePickerProps.focused,this.day)||!1,this.parentRangePicker=(0,r.QZ)("md-date-range-picker",this)}updated(t){var e,i;super.updated(t),this.disabled=this.filterParams&&(0,d.t_)(this.day,this.filterParams)||!1,this.isOutsideMonth=this.day.month!==this.viewAnchorMonth,this.isToday=(0,d.ro)(this.day,(0,d.tB)()),this.selected=this.datePickerProps&&(0,d.ro)(this.datePickerProps.selected,this.day)||!1,this.focused=this.datePickerProps&&(0,d.ro)(this.datePickerProps.focused,this.day)||!1,this.focused&&this.button&&(null===(i=null===(e=this.button.shadowRoot)||void 0===e?void 0:e.querySelector("button"))||void 0===i||i.focus()),this.parentRangePicker&&(this.dateIsInRange=this.isDateInRange())}isPrimarySelection(){var t;return(null===(t=this.parentRangePicker)||void 0===t?void 0:t.startDate)&&void 0===this.parentRangePicker.endDate}isLeadingRangeEdge(){var t;return this===(null===(t=this.parentNode)||void 0===t?void 0:t.firstElementChild)}isEndingRangeEdge(){var t;return this===(null===(t=this.parentNode)||void 0===t?void 0:t.lastElementChild)}isStartDate(){var t;return(null===(t=this.parentRangePicker)||void 0===t?void 0:t.startDate)===this.day.toSQLDate()&&!this.isPrimarySelection()}isEndDate(){var t;return(null===(t=this.parentRangePicker)||void 0===t?void 0:t.endDate)===this.day.toSQLDate()}get getDayClassMap(){return{"md-datepicker__day--selected":this.selected,"md-datepicker__day--focus":this.focused,"md-datepicker__day--today":this.isToday,"md-datepicker__day--outside-month":this.isOutsideMonth,"md-datepicker__day--in-range":this.dateIsInRange,"md-datepicker__day--week-first":this.isLeadingRangeEdge(),"md-datepicker__day--week-last":this.isEndingRangeEdge(),"md-datepicker__day--start-date":this.isStartDate(),"md-datepicker__day--end-date":this.isEndDate()}}static get styles(){return[o.A,p.A]}render(){var t;const e=(0,d.WV)(this.day,(null===(t=this.datePickerProps)||void 0===t?void 0:t.locale)||"en").toFormat("dd MMMM yyyy"),i=this.selected||this.isStartDate()||this.isEndDate()?`${e}, selected`:e;return n.html`
|
|
2
2
|
<md-button
|
|
3
3
|
circle
|
|
4
4
|
size=${32}
|
|
@@ -7,8 +7,8 @@ export const __webpack_esm_id__=6020;export const __webpack_esm_ids__=[3639,6020
|
|
|
7
7
|
class="md-datepicker__day ${(0,c.classMap)(this.getDayClassMap)}"
|
|
8
8
|
@click=${t=>{this.disabled||this.handleClick(t)}}
|
|
9
9
|
@keydown=${t=>this.handleKeyDown(t)}
|
|
10
|
-
ariaLabel=${
|
|
11
|
-
title=${
|
|
10
|
+
ariaLabel=${i}
|
|
11
|
+
title=${e}
|
|
12
12
|
aria-selected=${(0,l.ifDefined)(this.selected)}
|
|
13
13
|
tab-index=${this.focused?"0":"-1"}
|
|
14
14
|
>
|
package/dist/esm/837.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const __webpack_esm_id__=837;export const __webpack_esm_ids__=[837];export const __webpack_esm_modules__={837(t,
|
|
1
|
+
export const __webpack_esm_id__=837;export const __webpack_esm_ids__=[837];export const __webpack_esm_modules__={837(e,t,i){i.d(t,{$:()=>r}),i(8371),i(1821),i(9773);var r,o=i(9609),a=i(878),n=i(4084),s=i(2927),d=i(8899),h=i(3842),c=function(e,t,i,r){var o,a=arguments.length,n=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(n=(a<3?o(n):a>3?o(t,i,n):o(t,i))||n);return a>3&&n&&Object.defineProperty(t,i,n),n};!function(e){let t=class extends s.LitElement{constructor(){super(...arguments),this.monthFormat="MMMM yyyy",this.filterParams=void 0,this.handleMonthChange=void 0,this.onRetry=void 0,this.datePickerProps=void 0,this.errorMessages={},this.shortDay=!1,this.isDatePickerMonthLoading=!1,this.isDatePickerMonthError=!1,this.viewAnchorDate=(0,a.tB)(),this.localeMonth=void 0,this.setDate=(e,t)=>{this.viewAnchorDate=e,null==t||t()},this.increaseMonth=e=>{const{handleMonthChange:t}=this,{viewAnchorDate:i}=this;this.setDate((0,a.PS)(i,1),()=>t&&t(e,this.viewAnchorDate))},this.decreaseMonth=e=>{const{handleMonthChange:t}=this,{viewAnchorDate:i}=this;this.setDate((0,a.SL)(i,1),()=>t&&t(e,this.viewAnchorDate))},this.handleRetryClick=()=>{this.onRetry&&this.onRetry()},this.renderMonthName=()=>s.html` <div class="md-datepicker__navigation--current-month" aria-live="polite">${this.localeMonth}</div> `,this.renderPreviousMonthButton=()=>{var e,t;const i=(null===(e=this.filterParams)||void 0===e?void 0:e.minDate)&&(0,a.PD)(this.viewAnchorDate,null===(t=this.filterParams)||void 0===t?void 0:t.minDate);return s.html`
|
|
2
2
|
<md-button
|
|
3
3
|
variant="ghost"
|
|
4
4
|
circle
|
|
@@ -8,11 +8,10 @@ export const __webpack_esm_id__=837;export const __webpack_esm_ids__=[837];expor
|
|
|
8
8
|
title=${"previous month"}
|
|
9
9
|
?disabled=${i}
|
|
10
10
|
@click=${!i&&this.decreaseMonth}
|
|
11
|
-
tabindex="-1"
|
|
12
11
|
>
|
|
13
12
|
<md-icon name="arrow-left-bold" size="16" iconSet="momentumDesign"></md-icon>
|
|
14
13
|
</md-button>
|
|
15
|
-
`},this.renderNextMonthButton=()=>{var t
|
|
14
|
+
`},this.renderNextMonthButton=()=>{var e,t;const i=(null===(e=this.filterParams)||void 0===e?void 0:e.maxDate)&&(0,a.FO)(this.viewAnchorDate,null===(t=this.filterParams)||void 0===t?void 0:t.maxDate);return s.html`
|
|
16
15
|
<md-button
|
|
17
16
|
variant="ghost"
|
|
18
17
|
circle
|
|
@@ -22,10 +21,9 @@ export const __webpack_esm_id__=837;export const __webpack_esm_ids__=[837];expor
|
|
|
22
21
|
title=${"next month"}
|
|
23
22
|
?disabled=${i}
|
|
24
23
|
@click=${!i&&this.increaseMonth}
|
|
25
|
-
tabindex="-1"
|
|
26
24
|
><md-icon name="arrow-right-bold" size="16" iconSet="momentumDesign"></md-icon>
|
|
27
25
|
</md-button>
|
|
28
|
-
`},this.header=()=>{var
|
|
26
|
+
`},this.header=()=>{var e;const t=(0,a.mK)(this.viewAnchorDate,null===(e=this.datePickerProps)||void 0===e?void 0:e.weekStart);return[].concat([0,1,2,3,4,5,6].map(e=>{var i;const r=(0,a.fi)((0,a.WV)(t,(null===(i=this.datePickerProps)||void 0===i?void 0:i.locale)||"en"),e),o=(0,a.XN)(r),n=this.getWeekDayName(o,r);return s.html` <div class="md-datepicker__day--name">${n}</div> `}))}}connectedCallback(){var e,t,i;super.connectedCallback(),this.viewAnchorDate=(null===(e=this.datePickerProps)||void 0===e?void 0:e.focused)||(null===(t=this.datePickerProps)||void 0===t?void 0:t.selected)||(0,a.tB)(),this.localeMonth=(0,a.WV)(this.viewAnchorDate,(null===(i=this.datePickerProps)||void 0===i?void 0:i.locale)||"en").toFormat(this.monthFormat)}updated(e){var t,i,r,o,n,s;if(super.updated(e),e.has("datePickerProps")){const n=e.get("datePickerProps"),s=null===(t=this.datePickerProps)||void 0===t?void 0:t.selected,d=null===(i=this.datePickerProps)||void 0===i?void 0:i.focused;if(null===(null==s?void 0:s.invalidReason)&&(!(null==n?void 0:n.selected)||!(0,a.ro)(n.selected,s))&&(this.viewAnchorDate=s||(0,a.tB)()),null==d?void 0:d.isValid){const e=!(null==n?void 0:n.focused)||!(0,a.ro)(n.focused,d),t=d.month!==this.viewAnchorDate.month||d.year!==this.viewAnchorDate.year;e&&t&&(this.viewAnchorDate=d)}this.localeMonth=((null===(r=this.datePickerProps)||void 0===r?void 0:r.locale)?(0,a.WV)(this.viewAnchorDate,null===(o=this.datePickerProps)||void 0===o?void 0:o.locale):this.viewAnchorDate).toFormat(this.monthFormat)}e.has("viewAnchorDate")&&(this.localeMonth=((null===(n=this.datePickerProps)||void 0===n?void 0:n.locale)?(0,a.WV)(this.viewAnchorDate,null===(s=this.datePickerProps)||void 0===s?void 0:s.locale):this.viewAnchorDate).toFormat(this.monthFormat))}getWeekDayName(e,t){return this.shortDay?(0,a.XY)(e,t):(0,a.DY)(e,t)}renderLoader(){return s.html`
|
|
29
27
|
<div class="md-datepicker__loading">
|
|
30
28
|
<div class="md-datepicker__loading-text">${this.errorMessages.LOADING}</div>
|
|
31
29
|
<md-spinner size="32"></md-spinner>
|
|
@@ -63,4 +61,4 @@ export const __webpack_esm_id__=837;export const __webpack_esm_ids__=[837];expor
|
|
|
63
61
|
</div>
|
|
64
62
|
`}static get styles(){return[n.A,h.A]}render(){return s.html`
|
|
65
63
|
<div class="md-datepicker__calendar" id="Datepicker-Calendar">${this.viewAnchorDate&&this.renderMonth()}</div>
|
|
66
|
-
`}};c([(0,d.property)({attribute:!1})],
|
|
64
|
+
`}};c([(0,d.property)({attribute:!1})],t.prototype,"monthFormat",void 0),c([(0,d.property)({attribute:!1})],t.prototype,"filterParams",void 0),c([(0,d.property)({attribute:!1})],t.prototype,"handleMonthChange",void 0),c([(0,d.property)({attribute:!1})],t.prototype,"onRetry",void 0),c([(0,d.property)({attribute:!1})],t.prototype,"datePickerProps",void 0),c([(0,d.property)({type:Object,attribute:!1})],t.prototype,"errorMessages",void 0),c([(0,d.property)({type:Boolean,reflect:!0,attribute:"short-day"})],t.prototype,"shortDay",void 0),c([(0,d.property)({type:Boolean,reflect:!0,attribute:"is-date-picker-month-loading"})],t.prototype,"isDatePickerMonthLoading",void 0),c([(0,d.property)({type:Boolean,reflect:!0,attribute:"is-date-picker-month-error"})],t.prototype,"isDatePickerMonthError",void 0),c([(0,d.state)()],t.prototype,"viewAnchorDate",void 0),c([(0,d.state)()],t.prototype,"localeMonth",void 0),t=c([(0,o.w)("md-datepicker-calendar")],t),e.ELEMENT=t}(r||(r={}))}};
|
package/dist/esm/8663.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const __webpack_esm_id__=8663;export const __webpack_esm_ids__=[8663];export const __webpack_esm_modules__={8663(e,t,i){i.d(t,{l:()=>o});var o,a=i(2900),r=i(3876),s=i(9609),l=i(878),n=i(3331),d=i(2927),p=i(8899),h=i(3517),c=i(9642),u=(i(9189),i(708),i(405)),m=(i(837),i(3842)),v=function(e,t,i,o){var a,r=arguments.length,s=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(r<3?a(s):r>3?a(t,i,s):a(t,i))||s);return r>3&&s&&Object.defineProperty(t,i,s),s};!function(e){e.weekStartDays=["Sunday","Monday"];let t=class extends d.LitElement{constructor(){super(...arguments),this.shouldCloseOnSelect=!1,this.maxDate=void 0,this.minDate=void 0,this.value=void 0,this.weekStart="Sunday",this.placeholder=void 0,this.locale=void 0,this.useISOFormat=!0,this.validateDate=!0,this.includesTime=!1,this.disabled=!1,this.htmlId="",this.label="",this.ariaLabel=null,this.displayValue=null,this.required=!1,this.errorMessage="",this.customTrigger=!1,this.isMenuOverlayOpen=!1,this.newMomentum=void 0,this.disableUserTextInput=!1,this.compactInput=void 0,this.controlButtons=void 0,this.positioningStrategy=void 0,this.showDefaultNowDate=!0,this.usePopover=!1,this.triggerID="date-trigger",this.animationFrame=!1,this.isDatePickerMonthLoading=!1,this.isDatePickerMonthError=!1,this.errorMessages={},this.selectedDate=(0,l.tB)(),this.focusedDate=(0,l.tB)(),this.filterDate=void 0,this.onRetry=void 0,this.maxDateData=void 0,this.minDateData=void 0,this.popoverController=null,this.handleDateInputChange=e=>{var t,i;this.useISOFormat?this.value=null===(t=null==e?void 0:e.detail)||void 0===t?void 0:t.value:this.value=null===(i=this.selectedDate)||void 0===i?void 0:i.toLocaleString(c.DateTime.DATE_SHORT,{locale:this.locale}),this.dispatchEvent(new CustomEvent("date-input-change",{bubbles:!0,composed:!0,detail:{sourceEvent:e,value:this.value}}))},this.setOpen=e=>{var t,i;this.usePopover?e?null===(t=this.popoverController)||void 0===t||t.show():null===(i=this.popoverController)||void 0===i||i.hide():this.menuOverlay.isOpen=e,this.isMenuOverlayOpen=e},this.setPreSelection=e=>{const t={maxDate:this.maxDateData,minDate:this.minDateData,filterDate:this.filterDate};(0,l.t_)(e,t)||(this.focusedDate=e)},this.handleInputKeyDown=e=>{e.code
|
|
1
|
+
export const __webpack_esm_id__=8663;export const __webpack_esm_ids__=[8663];export const __webpack_esm_modules__={8663(e,t,i){i.d(t,{l:()=>o});var o,a=i(2900),r=i(3876),s=i(9609),l=i(878),n=i(3331),d=i(2927),p=i(8899),h=i(3517),c=i(9642),u=(i(9189),i(708),i(405)),m=(i(837),i(3842)),v=function(e,t,i,o){var a,r=arguments.length,s=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(r<3?a(s):r>3?a(t,i,s):a(t,i))||s);return r>3&&s&&Object.defineProperty(t,i,s),s};!function(e){e.weekStartDays=["Sunday","Monday"];let t=class extends d.LitElement{constructor(){super(...arguments),this.shouldCloseOnSelect=!1,this.maxDate=void 0,this.minDate=void 0,this.value=void 0,this.weekStart="Sunday",this.placeholder=void 0,this.locale=void 0,this.useISOFormat=!0,this.validateDate=!0,this.includesTime=!1,this.disabled=!1,this.htmlId="",this.label="",this.ariaLabel=null,this.displayValue=null,this.required=!1,this.errorMessage="",this.customTrigger=!1,this.isMenuOverlayOpen=!1,this.newMomentum=void 0,this.disableUserTextInput=!1,this.compactInput=void 0,this.controlButtons=void 0,this.positioningStrategy=void 0,this.showDefaultNowDate=!0,this.usePopover=!1,this.triggerID="date-trigger",this.animationFrame=!1,this.isDatePickerMonthLoading=!1,this.isDatePickerMonthError=!1,this.errorMessages={},this.selectedDate=(0,l.tB)(),this.focusedDate=(0,l.tB)(),this.filterDate=void 0,this.onRetry=void 0,this.maxDateData=void 0,this.minDateData=void 0,this.popoverController=null,this.openedViaKeyboard=!1,this.handleDateInputChange=e=>{var t,i;this.useISOFormat?this.value=null===(t=null==e?void 0:e.detail)||void 0===t?void 0:t.value:this.value=null===(i=this.selectedDate)||void 0===i?void 0:i.toLocaleString(c.DateTime.DATE_SHORT,{locale:this.locale}),this.dispatchEvent(new CustomEvent("date-input-change",{bubbles:!0,composed:!0,detail:{sourceEvent:e,value:this.value}}))},this.setOpen=e=>{var t,i;this.usePopover?e?null===(t=this.popoverController)||void 0===t||t.show():null===(i=this.popoverController)||void 0===i||i.hide():this.menuOverlay.isOpen=e,this.isMenuOverlayOpen=e},this.setPreSelection=e=>{if(!(null==e?void 0:e.isValid))return;const t={maxDate:this.maxDateData,minDate:this.minDateData,filterDate:this.filterDate};(0,l.t_)(e,t)||(this.focusedDate=e)},this.handleOverlayOpened=()=>{this.isMenuOverlayOpen=!0,this.openedViaKeyboard&&(this.openedViaKeyboard=!1,this.focusCalendarDay())},this.handleOverlayClosed=()=>{this.isMenuOverlayOpen=!1,this.focusDateInput()},this.handleInputKeyDown=e=>{switch(e.code){case a.Uz.ArrowDown:e.preventDefault(),this.isCalendarOpen||(this.openedViaKeyboard=!0,this.setOpen(!0));break;case a.Uz.Escape:this.isCalendarOpen&&(e.preventDefault(),e.stopPropagation(),this.setOpen(!1),this.focusDateInput())}},this.handleKeyDown=e=>{const t=e.detail.sourceEvent;let i=!1;const o=this.focusedDate;switch(!t.shiftKey&&t.code){case"Space":case"Enter":this.handleSelect(e),i=!0;break;case"Escape":this.setOpen(!1),i=!0;break;case"ArrowUp":this.setPreSelection((0,l.WB)(o,1)),i=!0;break;case"ArrowLeft":this.setPreSelection((0,l.gg)(o,1)),i=!0;break;case"ArrowRight":this.setPreSelection((0,l.fi)(o,1)),i=!0;break;case"ArrowDown":this.setPreSelection((0,l.J4)(o,1)),i=!0}i&&(t.stopPropagation(),t.preventDefault())},this.getDefaultAriaLabel=()=>{var e;return(null===(e=this.selectedDate)||void 0===e?void 0:e.isValid)?`Choose Date, selected date is ${this.selectedDate.toLocaleString(c.DateTime.DATE_FULL)}`:"Choose Date"},this.getValidRegexString=()=>this.includesTime?n.b.ISOString:n.b.ISODateString}get computedNewMomentum(){return void 0!==this.newMomentum?this.newMomentum:r.vz.isMomentumV2Enabled}static get styles(){return m.A}connectedCallback(){super.connectedCallback(),this.minDate&&(this.minDateData=(0,l.mA)(this.minDate)),this.maxDate&&(this.maxDateData=(0,l.mA)(this.maxDate)),this.usePopover&&(this.popoverController=new u.I)}firstUpdated(e){super.firstUpdated(e),!this.value&&this.showDefaultNowDate&&(this.value=this.getFormattedDate(this.selectedDate))}updated(e){super.updated(e),this.value&&e.has("value")&&(this.useISOFormat?this.selectedDate=(0,l.mA)(this.value):this.selectedDate=c.DateTime.fromFormat(this.value,(0,l.gq)(this.locale),{locale:this.locale}),this.setPreSelection(this.selectedDate)),e.has("locale")&&this.render(),this.minDate&&e.has("minDate")&&(this.minDateData=(0,l.mA)(this.minDate)),this.maxDate&&e.has("maxDate")&&(this.maxDateData=(0,l.mA)(this.maxDate)),!this.usePopover&&e.has("usePopover")&&(this.popoverController=new u.I)}handleSelect(e){var t;const i=e.detail.date,o=e.detail.sourceEvent;this.setPreSelection(i),this.dispatchEvent(new CustomEvent("date-pre-selection-change",{bubbles:!0,composed:!0,detail:{sourceEvent:o,data:i}})),(null===(t=this.controlButtons)||void 0===t?void 0:t.apply)&&"apply-button-clicked"!==(null==o?void 0:o.type)||(this.setSelected(i,o),this.shouldCloseOnSelect&&this.setOpen(!1))}getISODateTime(e){return this.includesTime?e.startOf("second").toISO({suppressMilliseconds:!0}):e.toISODate()}setSelected(e,t){const i={maxDate:this.maxDateData,minDate:this.minDateData,filterDate:this.filterDate};if(!(0,l.t_)(e,i)){const t=this.getISODateTime(e);this.selectedDate=e,this.useISOFormat?this.value=t:this.value=e.toLocaleString(c.DateTime.DATE_SHORT,{locale:this.locale})}this.dispatchEvent(new CustomEvent("date-selection-change",{bubbles:!0,composed:!0,detail:{sourceEvent:t,data:e}}))}get isCalendarOpen(){var e,t,i,o;return this.usePopover?null!==(t=null===(e=this.popoverController)||void 0===e?void 0:e.isVisible())&&void 0!==t&&t:null!==(o=null===(i=this.menuOverlay)||void 0===i?void 0:i.isOpen)&&void 0!==o&&o}focusDateInput(){requestAnimationFrame(()=>{var e;const t=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector(".date-input");null==t||t.focus()})}focusCalendarDay(){const e=t=>{requestAnimationFrame(()=>{var i,o,a,r,s,l;const n=null===(i=this.shadowRoot)||void 0===i?void 0:i.querySelector("md-datepicker-calendar"),d=null===(o=null==n?void 0:n.shadowRoot)||void 0===o?void 0:o.querySelector("md-datepicker-month"),p=null===(a=null==d?void 0:d.shadowRoot)||void 0===a?void 0:a.querySelectorAll("md-datepicker-week");if(p){for(const e of Array.from(p)){const t=null===(r=e.shadowRoot)||void 0===r?void 0:r.querySelector("md-datepicker-day[focused]");if(t){const e=null===(s=t.shadowRoot)||void 0===s?void 0:s.querySelector("md-button"),i=null===(l=null==e?void 0:e.shadowRoot)||void 0===l?void 0:l.querySelector("button");if(i)return void i.focus()}}t>0&&e(t-1)}else t>0&&e(t-1)})};e(8)}validateDateString(e){if(!e&&""!==e)return!0;if(this.useISOFormat){const t=RegExp(this.getValidRegexString()),i={maxDate:this.maxDateData,minDate:this.minDateData,filterDate:this.filterDate};return!!e&&t.test(e)&&!(0,l.t_)((0,l.mA)(e),i)}const t=(0,l.gq)(this.locale);return c.DateTime.fromFormat(e,t,{locale:this.locale}).isValid}isValueValid(){return!this.validateDate||this.validateDateString(this.value)}get messageArray(){return this.errorMessage?[{message:this.errorMessage,type:"error"}]:this.isValueValid()?[]:[{message:"",type:"error"}]}onCancelClick(){this.setOpen(!1)}onApplyClick(){this.handleSelect(new CustomEvent("day-select",{detail:{date:this.focusedDate,sourceEvent:new Event("apply-button-clicked")}}))}renderControlButtons(){var e,t,i,o,a,r;return!this.controlButtons||this.isDatePickerMonthLoading||this.isDatePickerMonthError?d.nothing:d.html`
|
|
2
2
|
<div class="control-buttons">
|
|
3
3
|
${this.controlButtons.cancel?d.html`
|
|
4
4
|
<md-button
|
|
@@ -36,6 +36,8 @@ export const __webpack_esm_id__=8663;export const __webpack_esm_ids__=[8663];exp
|
|
|
36
36
|
.controller=${this.popoverController}
|
|
37
37
|
?animation-frame=${this.animationFrame}
|
|
38
38
|
.offset=${15}
|
|
39
|
+
@shown=${this.handleOverlayOpened}
|
|
40
|
+
@hidden=${this.handleOverlayClosed}
|
|
39
41
|
>
|
|
40
42
|
<div class="date-overlay-content">
|
|
41
43
|
<md-datepicker-calendar
|
|
@@ -91,6 +93,8 @@ export const __webpack_esm_id__=8663;export const __webpack_esm_ids__=[8663];exp
|
|
|
91
93
|
custom-width="272px"
|
|
92
94
|
?disabled=${this.disabled}
|
|
93
95
|
positioning-strategy=${(0,h.ifDefined)(this.positioningStrategy)}
|
|
96
|
+
@menu-overlay-open=${this.handleOverlayOpened}
|
|
97
|
+
@menu-overlay-close=${this.handleOverlayClosed}
|
|
94
98
|
>
|
|
95
99
|
${this.customTrigger?d.html`
|
|
96
100
|
<span slot="menu-trigger">
|
package/dist/esm/953.js
CHANGED
|
@@ -8,7 +8,6 @@ export const __webpack_esm_id__=953;export const __webpack_esm_ids__=[405,837,95
|
|
|
8
8
|
title=${"previous month"}
|
|
9
9
|
?disabled=${i}
|
|
10
10
|
@click=${!i&&this.decreaseMonth}
|
|
11
|
-
tabindex="-1"
|
|
12
11
|
>
|
|
13
12
|
<md-icon name="arrow-left-bold" size="16" iconSet="momentumDesign"></md-icon>
|
|
14
13
|
</md-button>
|
|
@@ -22,10 +21,9 @@ export const __webpack_esm_id__=953;export const __webpack_esm_ids__=[405,837,95
|
|
|
22
21
|
title=${"next month"}
|
|
23
22
|
?disabled=${i}
|
|
24
23
|
@click=${!i&&this.increaseMonth}
|
|
25
|
-
tabindex="-1"
|
|
26
24
|
><md-icon name="arrow-right-bold" size="16" iconSet="momentumDesign"></md-icon>
|
|
27
25
|
</md-button>
|
|
28
|
-
`},this.header=()=>{var e;const t=(0,s.mK)(this.viewAnchorDate,null===(e=this.datePickerProps)||void 0===e?void 0:e.weekStart);return[].concat([0,1,2,3,4,5,6].map(e=>{var i;const o=(0,s.fi)((0,s.WV)(t,(null===(i=this.datePickerProps)||void 0===i?void 0:i.locale)||"en"),e),r=(0,s.XN)(o),n=this.getWeekDayName(r,o);return l.html` <div class="md-datepicker__day--name">${n}</div> `}))}}connectedCallback(){var e,t,i;super.connectedCallback(),this.viewAnchorDate=(null===(e=this.datePickerProps)||void 0===e?void 0:e.focused)||(null===(t=this.datePickerProps)||void 0===t?void 0:t.selected)||(0,s.tB)(),this.localeMonth=(0,s.WV)(this.viewAnchorDate,(null===(i=this.datePickerProps)||void 0===i?void 0:i.locale)||"en").toFormat(this.monthFormat)}updated(e){var t,i,o,r,n;super.updated(e),e.has("datePickerProps")
|
|
26
|
+
`},this.header=()=>{var e;const t=(0,s.mK)(this.viewAnchorDate,null===(e=this.datePickerProps)||void 0===e?void 0:e.weekStart);return[].concat([0,1,2,3,4,5,6].map(e=>{var i;const o=(0,s.fi)((0,s.WV)(t,(null===(i=this.datePickerProps)||void 0===i?void 0:i.locale)||"en"),e),r=(0,s.XN)(o),n=this.getWeekDayName(r,o);return l.html` <div class="md-datepicker__day--name">${n}</div> `}))}}connectedCallback(){var e,t,i;super.connectedCallback(),this.viewAnchorDate=(null===(e=this.datePickerProps)||void 0===e?void 0:e.focused)||(null===(t=this.datePickerProps)||void 0===t?void 0:t.selected)||(0,s.tB)(),this.localeMonth=(0,s.WV)(this.viewAnchorDate,(null===(i=this.datePickerProps)||void 0===i?void 0:i.locale)||"en").toFormat(this.monthFormat)}updated(e){var t,i,o,r,n,l;if(super.updated(e),e.has("datePickerProps")){const n=e.get("datePickerProps"),l=null===(t=this.datePickerProps)||void 0===t?void 0:t.selected,h=null===(i=this.datePickerProps)||void 0===i?void 0:i.focused;if(null===(null==l?void 0:l.invalidReason)&&(!(null==n?void 0:n.selected)||!(0,s.ro)(n.selected,l))&&(this.viewAnchorDate=l||(0,s.tB)()),null==h?void 0:h.isValid){const e=!(null==n?void 0:n.focused)||!(0,s.ro)(n.focused,h),t=h.month!==this.viewAnchorDate.month||h.year!==this.viewAnchorDate.year;e&&t&&(this.viewAnchorDate=h)}this.localeMonth=((null===(o=this.datePickerProps)||void 0===o?void 0:o.locale)?(0,s.WV)(this.viewAnchorDate,null===(r=this.datePickerProps)||void 0===r?void 0:r.locale):this.viewAnchorDate).toFormat(this.monthFormat)}e.has("viewAnchorDate")&&(this.localeMonth=((null===(n=this.datePickerProps)||void 0===n?void 0:n.locale)?(0,s.WV)(this.viewAnchorDate,null===(l=this.datePickerProps)||void 0===l?void 0:l.locale):this.viewAnchorDate).toFormat(this.monthFormat))}getWeekDayName(e,t){return this.shortDay?(0,s.XY)(e,t):(0,s.DY)(e,t)}renderLoader(){return l.html`
|
|
29
27
|
<div class="md-datepicker__loading">
|
|
30
28
|
<div class="md-datepicker__loading-text">${this.errorMessages.LOADING}</div>
|
|
31
29
|
<md-spinner size="32"></md-spinner>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import*as e from"@momentum-ui/icons/data/momentumUiIconsNames.json";import*as t from"@momentum-ui/utils/lib/getColorValue";import*as o from"lit";import*as i from"lit/decorators.js";import*as r from"lit/directives/class-map.js";import*as s from"lit/directives/if-defined.js";import*as a from"lit/directives/style-map.js";import*as d from"mobx";var n,l,p={4466(e,t,o){o.d(t,{A:()=>i}),o(1821);var i,r=o(7704),s=o(9609),a=o(93),d=o(4084),n=o(2927),l=o(8899),p=o(3517),c=o(742),m=function(e,t,o,i){var r,s=arguments.length,a=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,i);else for(var d=e.length-1;d>=0;d--)(r=e[d])&&(a=(s<3?r(a):s>3?r(t,o,a):r(t,o))||a);return s>3&&a&&Object.defineProperty(t,o,a),a};!function(e){let t=class extends((0,r.yC)(n.LitElement)){constructor(){super(...arguments),this._expanded=!1,this._level=3,this.uniqueId=(0,a.O)("accordion-item"),this.label="",this.disabled=!1,this.doubleClickToExpand=!1}get expanded(){return this._expanded}set expanded(e){const t=this._expanded;this._expanded=e,e?(this.notifyAccordionFocus(),this.notifyExpandedHeader()):this.notifyCollapsedHeader(),this.requestUpdate("expanded",t)}get level(){return this._level}set level(e){const t=this.level;e<1||e>6?(console.warn("Please set appropriate section heading level"),this._level=3):this._level=e,this.requestUpdate("level",t)}notifyExpandedHeader(){this.dispatchEvent(new CustomEvent("accordion-item-expanded",{composed:!0,bubbles:!0,detail:{id:this.uniqueId}}))}notifyCollapsedHeader(){this.dispatchEvent(new CustomEvent("accordion-item-collapsed",{composed:!0,bubbles:!0,detail:{id:this.uniqueId}}))}notifyAccordionFocus(){this.dispatchEvent(new CustomEvent("focus-visible",{composed:!0,bubbles:!0}))}firstUpdated(e){super.firstUpdated(e),this.setAttribute("id",this.uniqueId)}static get styles(){return[d.A,c.A]}handleClickEvent(e){if(this.disabled)return;const t="dblclick"===e.type;this.doubleClickToExpand
|
|
1
|
+
import*as e from"@momentum-ui/icons/data/momentumUiIconsNames.json";import*as t from"@momentum-ui/utils/lib/getColorValue";import*as o from"lit";import*as i from"lit/decorators.js";import*as r from"lit/directives/class-map.js";import*as s from"lit/directives/if-defined.js";import*as a from"lit/directives/style-map.js";import*as d from"mobx";var n,l,p={4466(e,t,o){o.d(t,{A:()=>i}),o(1821);var i,r=o(7704),s=o(9609),a=o(93),d=o(4084),n=o(2927),l=o(8899),p=o(3517),c=o(742),m=function(e,t,o,i){var r,s=arguments.length,a=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,i);else for(var d=e.length-1;d>=0;d--)(r=e[d])&&(a=(s<3?r(a):s>3?r(t,o,a):r(t,o))||a);return s>3&&a&&Object.defineProperty(t,o,a),a};!function(e){let t=class extends((0,r.yC)(n.LitElement)){constructor(){super(...arguments),this._expanded=!1,this._level=3,this.uniqueId=(0,a.O)("accordion-item"),this.label="",this.disabled=!1,this.doubleClickToExpand=!1}get expanded(){return this._expanded}set expanded(e){const t=this._expanded;this._expanded=e,e?(this.notifyAccordionFocus(),this.notifyExpandedHeader()):this.notifyCollapsedHeader(),this.requestUpdate("expanded",t)}get level(){return this._level}set level(e){const t=this.level;e<1||e>6?(console.warn("Please set appropriate section heading level"),this._level=3):this._level=e,this.requestUpdate("level",t)}notifyExpandedHeader(){this.dispatchEvent(new CustomEvent("accordion-item-expanded",{composed:!0,bubbles:!0,detail:{id:this.uniqueId}}))}notifyCollapsedHeader(){this.dispatchEvent(new CustomEvent("accordion-item-collapsed",{composed:!0,bubbles:!0,detail:{id:this.uniqueId}}))}notifyAccordionFocus(){this.dispatchEvent(new CustomEvent("focus-visible",{composed:!0,bubbles:!0}))}firstUpdated(e){super.firstUpdated(e),this.setAttribute("id",this.uniqueId)}static get styles(){return[d.A,c.A]}isClickOnExpanderIcon(e){var t;const o=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector(".md-accordion-expander-icon");return!!o&&e.composedPath().includes(o)}handleClickEvent(e){if(this.disabled)return;const t="dblclick"===e.type,o="click"===e.type&&this.isClickOnExpanderIcon(e);(this.doubleClickToExpand?t||o:!t)&&this.dispatchEvent(new CustomEvent("accordion-item-click",{detail:{srcEvent:e},composed:!0,bubbles:!0}))}handleKeyDown(e){this.disabled||this.dispatchEvent(new CustomEvent("accordion-item-keydown",{detail:{srcEvent:e},bubbles:!0,composed:!0}))}render(){return n.html`
|
|
2
2
|
<div class="md-accordion-item">
|
|
3
3
|
<div role="heading" aria-level=${this.level} class="md-accordion-header" part="accordion-header">
|
|
4
4
|
<button
|
|
@@ -19,7 +19,12 @@ import*as e from"@momentum-ui/icons/data/momentumUiIconsNames.json";import*as t
|
|
|
19
19
|
<slot name="header-content">
|
|
20
20
|
<span class="md-accordion-expander-label">${this.label}</span>
|
|
21
21
|
</slot>
|
|
22
|
-
<md-icon
|
|
22
|
+
<md-icon
|
|
23
|
+
class="md-accordion-expander-icon"
|
|
24
|
+
iconSet=${"momentumDesign"}
|
|
25
|
+
size="14"
|
|
26
|
+
name="arrow-down-bold"
|
|
27
|
+
></md-icon>
|
|
23
28
|
</button>
|
|
24
29
|
</div>
|
|
25
30
|
<div
|
|
@@ -32,4 +37,4 @@ import*as e from"@momentum-ui/icons/data/momentumUiIconsNames.json";import*as t
|
|
|
32
37
|
<slot></slot>
|
|
33
38
|
</div>
|
|
34
39
|
</div>
|
|
35
|
-
`}};m([(0,l.property)({type:String})],t.prototype,"label",void 0),m([(0,l.property)({type:Boolean,reflect:!0})],t.prototype,"disabled",void 0),m([(0,l.property)({type:Boolean,attribute:"double-click-to-expand"})],t.prototype,"doubleClickToExpand",void 0),m([(0,l.property)({type:Boolean,reflect:!0})],t.prototype,"expanded",null),m([(0,l.property)({type:Number,reflect:!0})],t.prototype,"level",null),m([(0,l.query)(".md-accordion-expander")],t.prototype,"header",void 0),t=m([(0,s.w)("md-accordion-item")],t),e.ELEMENT=t}(i||(i={}))},9500(t,o,i){var r,s;t.exports=(r={default:()=>e.default},s={},i.d(s,r),s)},3496(e,o,i){var r,s;e.exports=(r={default:()=>t.default},s={},i.d(s,r),s)},2927(e,t,i){var r,s;e.exports=(r={LitElement:()=>o.LitElement,css:()=>o.css,html:()=>o.html,nothing:()=>o.nothing},s={},i.d(s,r),s)},8899(e,t,o){var r,s;e.exports=(r={property:()=>i.property,query:()=>i.query,state:()=>i.state},s={},o.d(s,r),s)},4955(e,t,o){var i,s;e.exports=(i={classMap:()=>r.classMap},s={},o.d(s,i),s)},3517(e,t,o){var i,r;e.exports=(i={ifDefined:()=>s.ifDefined},r={},o.d(r,i),r)},1156(e,t,o){var i,r;e.exports=(i={styleMap:()=>a.styleMap},r={},o.d(r,i),r)},4980(e,t,o){var i,r;e.exports=(i={action:()=>d.action,observable:()=>d.observable},r={},o.d(r,i),r)}},c={};function m(e){var t=c[e];if(void 0!==t)return t.exports;var o=c[e]={exports:{}};return p[e](o,o.exports,m),o.exports}m.m=p,n=[],m.O=(e,t,o,i)=>{if(!t){var r=1/0;for(l=0;l<n.length;l++){for(var[t,o,i]=n[l],s=!0,a=0;a<t.length;a++)(!1&i||r>=i)&&Object.keys(m.O).every(e=>m.O[e](t[a]))?t.splice(a--,1):(s=!1,i<r&&(r=i));if(s){n.splice(l--,1);var d=o();void 0!==d&&(e=d)}}return e}i=i||0;for(var l=n.length;l>0&&n[l-1][2]>i;l--)n[l]=n[l-1];n[l]=[t,o,i]},m.d=(e,t)=>{for(var o in t)m.o(t,o)&&!m.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},m.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);export{m as __webpack_require__};l={502:0,1745:0,2330:0,4545:0,4928:0,5369:0,6060:0,6920:0,8111:0,8442:0},m.C=e=>{var t,o,{__webpack_esm_ids__:i,__webpack_esm_modules__:r,__webpack_esm_runtime__:s}=e,a=0;for(t in r)m.o(r,t)&&(m.m[t]=r[t]);for(s&&s(m);a<i.length;a++)o=i[a],m.o(l,o)&&l[o]&&l[o][0](),l[i[a]]=0;m.O()},m.O.j=e=>0===l[e];import*as u from"../9609.js";m.C(u);import*as
|
|
40
|
+
`}};m([(0,l.property)({type:String})],t.prototype,"label",void 0),m([(0,l.property)({type:Boolean,reflect:!0})],t.prototype,"disabled",void 0),m([(0,l.property)({type:Boolean,attribute:"double-click-to-expand"})],t.prototype,"doubleClickToExpand",void 0),m([(0,l.property)({type:Boolean,reflect:!0})],t.prototype,"expanded",null),m([(0,l.property)({type:Number,reflect:!0})],t.prototype,"level",null),m([(0,l.query)(".md-accordion-expander")],t.prototype,"header",void 0),t=m([(0,s.w)("md-accordion-item")],t),e.ELEMENT=t}(i||(i={}))},9500(t,o,i){var r,s;t.exports=(r={default:()=>e.default},s={},i.d(s,r),s)},3496(e,o,i){var r,s;e.exports=(r={default:()=>t.default},s={},i.d(s,r),s)},2927(e,t,i){var r,s;e.exports=(r={LitElement:()=>o.LitElement,css:()=>o.css,html:()=>o.html,nothing:()=>o.nothing},s={},i.d(s,r),s)},8899(e,t,o){var r,s;e.exports=(r={property:()=>i.property,query:()=>i.query,state:()=>i.state},s={},o.d(s,r),s)},4955(e,t,o){var i,s;e.exports=(i={classMap:()=>r.classMap},s={},o.d(s,i),s)},3517(e,t,o){var i,r;e.exports=(i={ifDefined:()=>s.ifDefined},r={},o.d(r,i),r)},1156(e,t,o){var i,r;e.exports=(i={styleMap:()=>a.styleMap},r={},o.d(r,i),r)},4980(e,t,o){var i,r;e.exports=(i={action:()=>d.action,observable:()=>d.observable},r={},o.d(r,i),r)}},c={};function m(e){var t=c[e];if(void 0!==t)return t.exports;var o=c[e]={exports:{}};return p[e](o,o.exports,m),o.exports}m.m=p,n=[],m.O=(e,t,o,i)=>{if(!t){var r=1/0;for(l=0;l<n.length;l++){for(var[t,o,i]=n[l],s=!0,a=0;a<t.length;a++)(!1&i||r>=i)&&Object.keys(m.O).every(e=>m.O[e](t[a]))?t.splice(a--,1):(s=!1,i<r&&(r=i));if(s){n.splice(l--,1);var d=o();void 0!==d&&(e=d)}}return e}i=i||0;for(var l=n.length;l>0&&n[l-1][2]>i;l--)n[l]=n[l-1];n[l]=[t,o,i]},m.d=(e,t)=>{for(var o in t)m.o(t,o)&&!m.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},m.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);export{m as __webpack_require__};l={502:0,1745:0,2330:0,4545:0,4928:0,5369:0,6060:0,6920:0,8111:0,8442:0},m.C=e=>{var t,o,{__webpack_esm_ids__:i,__webpack_esm_modules__:r,__webpack_esm_runtime__:s}=e,a=0;for(t in r)m.o(r,t)&&(m.m[t]=r[t]);for(s&&s(m);a<i.length;a++)o=i[a],m.o(l,o)&&l[o]&&l[o][0](),l[i[a]]=0;m.O()},m.O.j=e=>0===l[e];import*as u from"../9609.js";m.C(u);import*as h from"../4084.js";m.C(h);import*as f from"../3305.js";m.C(f);import*as v from"../4739.js";m.C(v);import*as b from"../7154.js";m.C(b);import*as y from"../9773.js";m.C(y);import*as x from"../5983.js";m.C(x);import*as C from"../9488.js";m.C(C);import*as j from"../1821.js";m.C(j);import*as E from"../2364.js";m.C(E);import*as _ from"../9938.js";m.C(_);import*as k from"../4781.js";m.C(k);import*as g from"../5201.js";m.C(g);import*as w from"../5584.js";m.C(w);import*as O from"../8227.js";m.C(O);import*as $ from"../2900.js";m.C($);import*as q from"../7704.js";m.C(q);import*as I from"../93.js";m.C(I);import*as A from"../742.js";m.C(A);var D=m.O(void 0,[9609,4084,3305,4739,7154,9773,5983,9488,1821,2364,9938,4781,5201,5584,8227,2900,7704,93,742],()=>m(4466));const P=(D=m.O(D)).A;export{P as AccordionItem};
|