@momentum-ui/web-components 2.17.6 → 2.17.8
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/chunks/md-28.js +1 -1
- package/dist/chunks/md-6.js +1 -1
- package/dist/chunks/md-60.js +5 -2
- package/dist/chunks/md-8.js +1 -1
- package/dist/chunks/md-83.js +2 -2
- package/dist/chunks/md-9.js +1 -1
- package/dist/chunks/md-90.js +1 -1
- package/dist/index-entry.js +1 -1
- package/dist/index.js +2 -2
- package/dist/types/components/chat-message/ChatMessage.d.ts +1 -2
- package/dist/types/components/radio/RadioGroup.d.ts +1 -0
- package/dist/types/components/timepicker/TimePicker.d.ts +1 -1
- package/package.json +4 -4
package/dist/chunks/md-83.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
(window["momentum-web-components-[id]"]=window["momentum-web-components-[id]"]||[]).push([[83],{105:function(e,t,s){"use strict";s.r(t),s.d(t,"RadioGroup",(function(){return i}));var i,d=s(1),o=s(7),r=s(5),c=s(6),n=s(0),
|
|
1
|
+
(window["momentum-web-components-[id]"]=window["momentum-web-components-[id]"]||[]).push([[83],{105:function(e,t,s){"use strict";s.r(t),s.d(t,"RadioGroup",(function(){return i}));var i,d=s(1),o=s(7),r=s(5),c=s(6),n=s(0),a=s(72),l=function(e,t,s,i){var d,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,s,i);else for(var c=e.length-1;c>=0;c--)(d=e[c])&&(r=(o<3?d(r):o>3?d(t,s,r):d(t,s))||r);return o>3&&r&&Object.defineProperty(t,s,r),r};!function(e){let t=class extends(Object(o.d)(n.LitElement)){constructor(){super(...arguments),this.label="group",this.checked=-1,this.alignment="vertical",this._disabled=!1}get disabled(){return this._disabled}set disabled(e){const t=this._disabled;this._disabled=e,this.requestUpdate("disabled",t)}firstUpdated(e){super.firstUpdated(e),this.setAttribute("role","radiogroup"),this.setAttribute("aria-label",this.label)}updated(e){super.updated(e),(e.has("slotted")||e.has("checked"))&&this.setFirstChecked()}get selectedRadioValue(){return this.slotted[this.selected].value}notifySelectedChange(){this.dispatchEvent(new CustomEvent("radio-change",{detail:{selected:this.selectedRadioValue},bubbles:!0,composed:!0}))}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",this.handleKeyDown),this.addEventListener("click",this.handleClick)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",this.handleKeyDown),this.removeEventListener("click",this.handleClick)}setFirstChecked(){-1!==this.checked&&(this.selected=this.checked,this.setChecked(this.checked))}findRadioIndex(e){const t=e.composedPath();return this.slotted.findIndex(e=>t.includes(e))}findCheckedRadioIndex(){return this.slotted.findIndex(e=>e.checked)}setChecked(e){const t=this.findCheckedRadioIndex();-1!==t&&t!==e&&this.slotted[t]&&(this.slotted[t].checked=!1),this.slotted[e]&&(this.slotted[e].checked=!0)}switchRadioOnArrowPress(e,t=1){const s=super.getAvailableSelectedIndex(e,t);-1!==s&&(this.selected=s,this.setChecked(s),this.notifySelectedChange())}isRadioDisabled(e){return this.slotted[e].disabled}handleClick(e){if(this.disabled)return!1;const t=this.findRadioIndex(e);-1!==t&&(this.isRadioDisabled(t)||(this.selected=t,this.setChecked(t),this.notifySelectedChange()))}handleKeyDown(e){if(this.disabled)return!1;const{code:t}=e;switch(t){case d.b.Enter:case d.b.Space:this.isRadioDisabled(this.selected)||(this.setChecked(this.selected),this.notifySelectedChange(),e.stopPropagation(),e.preventDefault());break;case d.b.ArrowUp:case d.b.ArrowLeft:0===this.selected?this.switchRadioOnArrowPress(this.slotted.length-1,-1):this.switchRadioOnArrowPress(this.selected-1,-1),e.stopPropagation(),e.preventDefault();break;case d.b.ArrowDown:case d.b.ArrowRight:this.selected===this.slotted.length-1?this.switchRadioOnArrowPress(0):this.switchRadioOnArrowPress(this.selected+1),e.stopPropagation(),e.preventDefault()}}get slotElement(){return this.radioSlot}static get styles(){return[c.a,a.a]}clearSelection(){const e=this.findCheckedRadioIndex();-1!=e&&(this.checked=-1,this.slotted[e].checked=!1)}render(){return n.html`
|
|
2
2
|
<div class="radio-group-container" part="radio-group-container">
|
|
3
3
|
<slot name="radio"></slot>
|
|
4
4
|
</div>
|
|
5
|
-
`}};
|
|
5
|
+
`}};l([Object(n.property)({type:String,attribute:"group-label"})],t.prototype,"label",void 0),l([Object(n.property)({type:Number,reflect:!0})],t.prototype,"checked",void 0),l([Object(n.property)({type:String,reflect:!0})],t.prototype,"alignment",void 0),l([Object(n.query)("slot[name='radio']")],t.prototype,"radioSlot",void 0),l([Object(n.property)({type:Boolean,reflect:!0})],t.prototype,"disabled",null),t=l([Object(r.a)("md-radiogroup")],t),e.ELEMENT=t}(i||(i={}))}}]);
|