@momentum-ui/web-components 2.16.13 → 2.16.14
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-10.js +1 -1
- package/dist/chunks/md-11.js +1 -1
- package/dist/chunks/md-14.js +1 -1
- package/dist/chunks/md-15.js +1 -1
- package/dist/chunks/md-17.js +1 -1
- package/dist/chunks/md-18.js +1 -1
- package/dist/chunks/md-19.js +1 -1
- package/dist/chunks/md-20.js +1 -1
- package/dist/chunks/md-21.js +1 -1
- package/dist/chunks/md-22.js +1 -1
- package/dist/chunks/md-25.js +1 -1
- package/dist/chunks/md-27.js +1 -1
- package/dist/chunks/md-28.js +1 -1
- package/dist/chunks/md-29.js +1 -1
- package/dist/chunks/md-30.js +1 -1
- package/dist/chunks/md-31.js +1 -1
- package/dist/chunks/md-33.js +1 -1
- package/dist/chunks/md-34.js +2 -2
- package/dist/chunks/md-35.js +1 -1
- package/dist/chunks/md-37.js +1 -1
- package/dist/chunks/md-38.js +1 -1
- package/dist/chunks/md-39.js +1 -1
- package/dist/chunks/md-41.js +1 -1
- package/dist/chunks/md-42.js +1 -1
- package/dist/chunks/md-43.js +1 -1
- package/dist/chunks/md-44.js +1 -1
- package/dist/chunks/md-45.js +2 -2
- package/dist/chunks/md-46.js +1 -1
- package/dist/chunks/md-47.js +1 -27
- package/dist/chunks/md-48.js +26 -4
- package/dist/chunks/md-49.js +4 -37
- package/dist/chunks/md-5.js +1 -1
- package/dist/chunks/md-50.js +38 -13
- package/dist/chunks/md-51.js +12 -33
- package/dist/chunks/md-52.js +34 -20
- package/dist/chunks/md-53.js +18 -119
- package/dist/chunks/md-54.js +114 -91
- package/dist/chunks/md-55.js +98 -11
- package/dist/chunks/md-56.js +11 -5
- package/dist/chunks/md-57.js +4 -76
- package/dist/chunks/md-58.js +68 -59
- package/dist/chunks/md-59.js +64 -18
- package/dist/chunks/md-6.js +2 -2
- package/dist/chunks/md-60.js +22 -14
- package/dist/chunks/md-61.js +14 -5
- package/dist/chunks/md-62.js +5 -51
- package/dist/chunks/md-63.js +51 -22
- package/dist/chunks/md-64.js +19 -44
- package/dist/chunks/md-65.js +46 -4
- package/dist/chunks/md-66.js +5 -1
- package/dist/chunks/md-67.js +1 -23
- package/dist/chunks/md-68.js +23 -5
- package/dist/chunks/md-69.js +4 -10
- package/dist/chunks/md-70.js +9 -136
- package/dist/chunks/md-71.js +135 -27
- package/dist/chunks/md-72.js +29 -69
- package/dist/chunks/md-73.js +70 -19
- package/dist/chunks/md-74.js +19 -22
- package/dist/chunks/md-75.js +21 -16
- package/dist/chunks/md-76.js +17 -76
- package/dist/chunks/md-77.js +76 -7
- package/dist/chunks/md-78.js +7 -72
- package/dist/chunks/md-79.js +72 -77
- package/dist/chunks/md-80.js +78 -71
- package/dist/chunks/md-81.js +69 -15
- package/dist/chunks/md-82.js +16 -4
- package/dist/chunks/md-83.js +4 -18
- package/dist/chunks/md-84.js +19 -1
- package/dist/chunks/md-85.js +1 -168
- package/dist/chunks/md-86.js +167 -42
- package/dist/chunks/md-87.js +41 -99
- package/dist/chunks/md-88.js +94 -75
- package/dist/chunks/md-89.js +81 -11
- package/dist/chunks/md-90.js +11 -42
- package/dist/chunks/md-91.js +41 -32
- package/dist/chunks/md-92.js +34 -1
- package/dist/comp/md-accordion-entry.js +1 -1
- package/dist/comp/md-accordion-item-entry.js +1 -1
- package/dist/comp/md-accordion-item.js +1 -1
- package/dist/comp/md-accordion.js +1 -1
- package/dist/comp/md-activity-button-entry.js +1 -1
- package/dist/comp/md-activity-button.js +1 -1
- package/dist/comp/md-advance-list-entry.js +1 -1
- package/dist/comp/md-advance-list.js +1 -1
- package/dist/comp/md-alert-banner-entry.js +1 -1
- package/dist/comp/md-alert-banner.js +1 -1
- package/dist/comp/md-alert-entry.js +1 -1
- package/dist/comp/md-alert.js +1 -1
- package/dist/comp/md-audio-player-entry.js +1 -1
- package/dist/comp/md-audio-player.js +1 -1
- package/dist/comp/md-avatar-entry.js +1 -1
- package/dist/comp/md-badge-entry.js +1 -1
- package/dist/comp/md-breadcrumb-entry.js +1 -1
- package/dist/comp/md-breadcrumb.js +1 -1
- package/dist/comp/md-button-group-entry.js +1 -1
- package/dist/comp/md-button-group.js +1 -1
- package/dist/comp/md-card-ai-entry.js +1 -1
- package/dist/comp/md-card-ai.js +1 -1
- package/dist/comp/md-card-entry.js +1 -1
- package/dist/comp/md-card.js +1 -1
- package/dist/comp/md-chat-message-entry.js +1 -1
- package/dist/comp/md-chat-message.js +1 -1
- package/dist/comp/md-checkbox-entry.js +1 -1
- package/dist/comp/md-checkbox.js +1 -1
- package/dist/comp/md-checkboxgroup-entry.js +1 -1
- package/dist/comp/md-checkboxgroup.js +1 -1
- package/dist/comp/md-chip-entry.js +1 -1
- package/dist/comp/md-chip.js +1 -1
- package/dist/comp/md-coachmark-entry.js +1 -1
- package/dist/comp/md-coachmark-popover-entry.js +1 -1
- package/dist/comp/md-coachmark-popover.js +1 -1
- package/dist/comp/md-coachmark.js +1 -1
- package/dist/comp/md-combobox-entry.js +1 -1
- package/dist/comp/md-composite-avatar-entry.js +1 -1
- package/dist/comp/md-composite-avatar.js +1 -1
- package/dist/comp/md-date-range-picker-entry.js +1 -1
- package/dist/comp/md-date-range-picker.js +1 -1
- package/dist/comp/md-date-time-picker-entry.js +1 -1
- package/dist/comp/md-date-time-picker.js +1 -1
- package/dist/comp/md-datepicker-calendar-entry.js +1 -1
- package/dist/comp/md-datepicker-day-entry.js +1 -1
- package/dist/comp/md-datepicker-entry.js +1 -1
- package/dist/comp/md-datepicker-month-entry.js +1 -1
- package/dist/comp/md-datepicker-week-entry.js +1 -1
- package/dist/comp/md-draggable-entry.js +1 -1
- package/dist/comp/md-draggable-item-entry.js +1 -1
- package/dist/comp/md-draggable-item.js +1 -1
- package/dist/comp/md-draggable.js +1 -1
- package/dist/comp/md-dropdown-entry.js +1 -1
- package/dist/comp/md-dropdown.js +1 -1
- package/dist/comp/md-editable-field-entry.js +1 -1
- package/dist/comp/md-editable-field.js +1 -1
- package/dist/comp/md-favorite-entry.js +1 -1
- package/dist/comp/md-floating-minimize-entry.js +1 -1
- package/dist/comp/md-floating-modal-entry.js +1 -1
- package/dist/comp/md-floating-modal.js +1 -1
- package/dist/comp/md-form-entry.js +1 -1
- package/dist/comp/md-form.js +1 -1
- package/dist/comp/md-grabber-entry.js +1 -1
- package/dist/comp/md-grabber.js +1 -1
- package/dist/comp/md-help-text-entry.js +1 -1
- package/dist/comp/md-icon-entry.js +1 -1
- package/dist/comp/md-inpu.js +1 -1
- package/dist/comp/md-input-entry.js +1 -1
- package/dist/comp/md-input-file.js +1 -1
- package/dist/comp/md-label-entry.js +1 -1
- package/dist/comp/md-list-entry.js +1 -1
- package/dist/comp/md-list-item-entry.js +1 -1
- package/dist/comp/md-meeting-alert-entry.js +1 -1
- package/dist/comp/md-meeting-alert.js +1 -1
- package/dist/comp/md-menu-entry.js +1 -1
- package/dist/comp/md-menu-item-entry.js +1 -1
- package/dist/comp/md-menu.js +1 -1
- package/dist/comp/md-modal-entry.js +1 -1
- package/dist/comp/md-modal.js +2 -1
- package/dist/comp/md-pagination-entry.js +1 -1
- package/dist/comp/md-pagination.js +1 -1
- package/dist/comp/md-phone-input-entry.js +1 -1
- package/dist/comp/md-phone-input.js +1 -1
- package/dist/comp/md-popover-entry.js +1 -1
- package/dist/comp/md-radio-entry.js +1 -1
- package/dist/comp/md-radio.js +2 -2
- package/dist/comp/md-radiogroup-entry.js +1 -1
- package/dist/comp/md-radiogroup.js +2 -2
- package/dist/comp/md-slider-entry.js +1 -1
- package/dist/comp/md-slider.js +1 -1
- package/dist/comp/md-spinner-entry.js +1 -1
- package/dist/comp/md-tab-entry.js +1 -1
- package/dist/comp/md-tab-panel-entry.js +1 -1
- package/dist/comp/md-tab-panel.js +1 -1
- package/dist/comp/md-tab.js +1 -1
- package/dist/comp/md-table-advanced-entry.js +1 -1
- package/dist/comp/md-table-advanced.js +1 -1
- package/dist/comp/md-table-entry.js +1 -1
- package/dist/comp/md-table.js +1 -1
- package/dist/comp/md-tabs-entry.js +1 -1
- package/dist/comp/md-tabs.js +2 -2
- package/dist/comp/md-task-item-entry.js +1 -1
- package/dist/comp/md-task-item.js +1 -1
- package/dist/comp/md-theme-entry.js +1 -1
- package/dist/comp/md-theme.js +1 -1
- package/dist/comp/md-timepicker-entry.js +1 -1
- package/dist/comp/md-timepicker.js +1 -1
- package/dist/comp/md-toggle-switch-entry.js +1 -1
- package/dist/comp/md-toggle-switch.js +1 -1
- package/dist/index-entry.js +2 -2
- package/dist/index.js +35 -35
- package/dist/managers/thememanager-entry.js +1 -1
- package/dist/managers/thememanager.js +1 -1
- package/dist/types/components/combobox/ComboBox.d.ts +1 -1
- package/dist/types/components/link/Link.d.ts +3 -0
- package/dist/types/components/modal/Modal.d.ts +4 -0
- package/dist/types/components/timepicker/TimePicker.d.ts +1 -1
- package/package.json +1 -1
package/dist/chunks/md-81.js
CHANGED
|
@@ -1,17 +1,71 @@
|
|
|
1
|
-
(window["momentum-web-components-[id]"]=window["momentum-web-components-[id]"]||[]).push([[81],{
|
|
2
|
-
<
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
(window["momentum-web-components-[id]"]=window["momentum-web-components-[id]"]||[]).push([[81],{130:function(t,e,o){"use strict";o.r(e),o.d(e,"PhoneInput",(function(){return i}));o(57),o(30);var i,r=o(5),n=o(6),a=o(86),l=o(87),d=o(71),p=o(0),s=o(2),h=o(4),c=o(88),u=p.css`.md-phone-input__container{--combo-box-contaier-width:100px;display:flex;position:relative}.md-phone-input__container span.flag-box{align-items:center;border:1px solid var(--input-default-border-color,#ccc);border-bottom-left-radius:.25rem;border-top-left-radius:.25rem;border-right:none;display:flex;height:2.125rem;justify-content:center;position:relative;width:2.25rem}.md-phone-input__container span.flag-box.new-momentum{border:1px solid var(--input-default-new-border-color,#ccc);height:2rem;border-top-left-radius:.5rem;border-bottom-left-radius:.5rem;border-right:none}.md-phone-input__container span.flag-box .flag-svg-wrapper{justify-content:center}.md-phone-input__container .flag-svg-wrapper{align-items:center;display:flex;width:2rem}.md-phone-input__container .flag-svg-wrapper img{max-height:.7rem}.md-phone-input__container md-combobox{width:var(--combo-box-contaier-width)}.md-phone-input__container md-combobox::part(combobox){position:initial}.md-phone-input__container md-combobox::part(group){border-bottom-right-radius:0;border-right-width:0;border-top-right-radius:0}.md-phone-input__container md-combobox::part(multiwrap){overflow-x:hidden}.md-phone-input__container md-combobox::part(multiwrap-input){padding-left:0;padding-right:0;width:100%}.md-phone-input__container md-combobox::part(combobox-options){top:2.5rem}.md-phone-input__container md-combobox::part(label){width:100%}.md-phone-input__container md-input::part(input){border-bottom-left-radius:0;border-top-left-radius:0;padding-right:2.125rem}.md-phone-input__container md-input::part(message){margin-left:calc(var(--combo-box-contaier-width)*-1);width:calc(100% + var(--combo-box-contaier-width))}.md-phone-input__container .md-phone-input__option{align-items:center;display:flex;justify-content:start}.md-phone-input__container .md-phone-input__option :nth-child(3){margin-left:1rem}.md-phone-input__container md-input[disabled]::part(input){background:var(--phone-input-disabled-bg-color);border:1px solid var(--phone-input-default-border-color);color:var(--md-disabled-text-color)}.md-phone-input__container md-input[disabled]::part(input)::placeholder{border:none}`,m=function(t,e,o,i){var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,o,i);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};!function(t){let e=class extends p.LitElement{constructor(){super(...arguments),this.codePlaceholder="+1",this.numberPlaceholder="Enter Phone Number",this.countryCallingCode="",this.showFlags=!1,this.pill=!1,this.disabled=!1,this.value="",this.errorMessage="",this.showErrorMessage=!1,this.clearIconHeight="auto",this.countryCodeAriaLabel="",this.dialNumberAriaLabel="",this.clearAriaLabel="Clear Input",this.clearCountryCodeAriaLabel="Clear Country Code",this.id="",this.newMomentum=!1,this.countryCode="US",this.codeList=[],this.formattedValue="",this.isValid=!0}connectedCallback(){super.connectedCallback(),this.codeList=Object(a.customArray)({name:"{countryNameEn}",value:"{countryCallingCode}",code:"{countryCode}"}),""===this.id&&(this.id="md-phone-input-"+Math.random().toString(36).substr(2,4)),this.validateInput(this.value)}getCountryFlag(t){return p.html`
|
|
2
|
+
<span class="flag-svg-wrapper">
|
|
3
|
+
<img src="${Object(l.findFlagUrlByIso2Code)(t)}" />
|
|
4
|
+
</span>
|
|
5
|
+
`}countryCodeOptionTemplate(t,e){return p.html`
|
|
6
|
+
<div
|
|
7
|
+
part="option"
|
|
8
|
+
class="md-phone-input__option"
|
|
9
|
+
display-value="+${t.value}"
|
|
10
|
+
slot=${e}
|
|
11
|
+
aria-label="+${t.value}, ${t.name}, ${t.code}"
|
|
12
|
+
>
|
|
13
|
+
${this.showFlags?this.getCountryFlag(t.code):s.nothing}
|
|
14
|
+
<span>${t.name}</span>
|
|
15
|
+
<span>+${t.value}</span>
|
|
16
|
+
</div>
|
|
17
|
+
`}validateNumber(){this.isValid=!this.value||Object(d.isValidNumberForRegion)(this.value,this.countryCode)}handleCountryChange(t){var e,o;t.detail.value&&(null===(e=t.detail.value)||void 0===e?void 0:e.id)?(this.countryCallingCode=t.detail.value.id,this.countryCode=null===(o=t.detail.value.id.split(",")[2])||void 0===o?void 0:o.trim()):(this.countryCode="US",this.countryCallingCode=""),this.validateNumber(),this.dispatchEvent(new CustomEvent("countrycode-change",{bubbles:!0,composed:!0,detail:{srcEvent:t,isValid:this.isValid}}))}handlePhoneChange(t){this.value=t.detail.value,t.stopPropagation(),this.dispatchEvent(new CustomEvent("phoneinput-change",{bubbles:!0,composed:!0,detail:{srcEvent:t,value:`${this.countryCallingCode}${this.value}`,isValid:this.isValid,phoneNumber:this.value}}))}handleKeydown(t){this.isValid=!0,t.stopPropagation(),this.dispatchEvent(new CustomEvent("phoneinput-keydown",{bubbles:!0,composed:!0,detail:{srcEvent:t,value:`${this.countryCallingCode}${this.value}`,isValid:this.isValid,phoneNumber:this.value}}))}handleBlur(t){this.validateInput(this.value),this.validateNumber(),t.stopPropagation(),this.removeCountryCode(),this.dispatchEvent(new CustomEvent("phoneinput-blur",{bubbles:!0,composed:!0,detail:{srcEvent:t,value:`${this.countryCallingCode}${this.value}`,isValid:this.isValid,phoneNumber:this.value}}))}removeCountryCode(){var t;const e=null===(t=this.countryCallingCode.split(",")[0])||void 0===t?void 0:t.trim();if(this.value.startsWith(e)){const t=this.value.slice(e.length).replace(/^-/,"");this.value=t}}validateInput(t){this.formattedValue=new d.AsYouType(this.countryCode).input(t)}get flagClassMap(){return{"new-momentum":this.newMomentum}}getFormatedCountryCallingCode(){var t;return{id:this.countryCallingCode,value:null===(t=this.countryCallingCode.split(",")[0])||void 0===t?void 0:t.trim()}}getModStyle(){return p.html`
|
|
18
|
+
<style>
|
|
19
|
+
.md-phone-input__container md-combobox {
|
|
20
|
+
width: 5.625rem;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
md-combobox::part(group) {
|
|
24
|
+
border-left-style: none;
|
|
25
|
+
border-bottom-left-radius: 0;
|
|
26
|
+
border-top-left-radius: 0;
|
|
27
|
+
padding-left: 0;
|
|
28
|
+
}
|
|
29
|
+
</style>
|
|
30
|
+
`}static get styles(){return[n.a,u]}render(){return p.html`
|
|
31
|
+
${this.showFlags?this.getModStyle():s.nothing}
|
|
32
|
+
<div class="md-phone-input__container">
|
|
33
|
+
${this.showFlags?p.html`
|
|
34
|
+
<span class="flag-box ${Object(h.classMap)(this.flagClassMap)}">${this.getCountryFlag(this.countryCode)}</span>
|
|
35
|
+
`:s.nothing}
|
|
36
|
+
<md-combobox
|
|
37
|
+
part="combobox"
|
|
38
|
+
?disabled=${this.disabled}
|
|
39
|
+
shape="${this.pill?"pill":"none"}"
|
|
40
|
+
ariaLabel=${this.countryCodeAriaLabel}
|
|
41
|
+
placeholder="${this.codePlaceholder}"
|
|
42
|
+
.value="${this.countryCallingCode?[this.getFormatedCountryCallingCode()]:[]}"
|
|
43
|
+
@change-selected="${t=>this.handleCountryChange(t)}"
|
|
44
|
+
clear-icon-height="${this.clearIconHeight}"
|
|
45
|
+
with-custom-content
|
|
46
|
+
?newMomentum=${this.newMomentum}
|
|
47
|
+
is-dropdown-arrow
|
|
48
|
+
.clearAriaLabel="${this.clearCountryCodeAriaLabel}"
|
|
49
|
+
>
|
|
50
|
+
${Object(c.repeat)(this.codeList,t=>t.name,(t,e)=>this.countryCodeOptionTemplate(t,e))}
|
|
51
|
+
</md-combobox>
|
|
52
|
+
<md-input
|
|
53
|
+
part="md-input"
|
|
11
54
|
?disabled=${this.disabled}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
55
|
+
placeholder=${this.numberPlaceholder}
|
|
56
|
+
.ariaInvalid=${this.isValid?"false":"true"}
|
|
57
|
+
.ariaLabel=${""+this.dialNumberAriaLabel}
|
|
58
|
+
@input-change="${t=>this.handlePhoneChange(t)}"
|
|
59
|
+
@input-blur="${t=>this.handleBlur(t)}"
|
|
60
|
+
@input-keydown="${t=>this.handleKeydown(t)}"
|
|
61
|
+
shape="${this.pill?"pill":"none"}"
|
|
62
|
+
.ariaControls=${this.id}
|
|
63
|
+
clear
|
|
64
|
+
?newMomentum=${this.newMomentum}
|
|
65
|
+
clearAriaLabel="${this.clearAriaLabel}"
|
|
66
|
+
type="tel"
|
|
67
|
+
value="${this.formattedValue}"
|
|
68
|
+
.messageArr="${!this.isValid||this.showErrorMessage?[{type:"error",id:this.id,ariaLive:"polite",message:this.errorMessage}]:[]}"
|
|
69
|
+
></md-input>
|
|
16
70
|
</div>
|
|
17
|
-
`}};
|
|
71
|
+
`}};m([Object(p.property)({type:String,reflect:!0})],e.prototype,"codePlaceholder",void 0),m([Object(p.property)({type:String})],e.prototype,"numberPlaceholder",void 0),m([Object(p.property)({type:String,attribute:"country-calling-code"})],e.prototype,"countryCallingCode",void 0),m([Object(p.property)({type:Boolean,attribute:"show-flags"})],e.prototype,"showFlags",void 0),m([Object(p.property)({type:Boolean})],e.prototype,"pill",void 0),m([Object(p.property)({type:Boolean})],e.prototype,"disabled",void 0),m([Object(p.property)({type:String})],e.prototype,"value",void 0),m([Object(p.property)({type:String})],e.prototype,"errorMessage",void 0),m([Object(p.property)({type:Boolean})],e.prototype,"showErrorMessage",void 0),m([Object(p.property)({type:String,attribute:"clear-icon-height"})],e.prototype,"clearIconHeight",void 0),m([Object(p.property)({type:String})],e.prototype,"countryCodeAriaLabel",void 0),m([Object(p.property)({type:String})],e.prototype,"dialNumberAriaLabel",void 0),m([Object(p.property)({type:String})],e.prototype,"clearAriaLabel",void 0),m([Object(p.property)({type:String})],e.prototype,"clearCountryCodeAriaLabel",void 0),m([Object(p.property)({type:String})],e.prototype,"id",void 0),m([Object(p.property)({type:Boolean})],e.prototype,"newMomentum",void 0),m([Object(p.internalProperty)()],e.prototype,"countryCode",void 0),m([Object(p.internalProperty)()],e.prototype,"codeList",void 0),m([Object(p.internalProperty)()],e.prototype,"formattedValue",void 0),m([Object(p.internalProperty)()],e.prototype,"isValid",void 0),m([Object(p.query)("md-combobox")],e.prototype,"combobox",void 0),e=m([Object(r.a)("md-phone-input")],e),t.ELEMENT=e}(i||(i={}))}}]);
|
package/dist/chunks/md-82.js
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
|
-
(window["momentum-web-components-[id]"]=window["momentum-web-components-[id]"]||[]).push([[82],{
|
|
2
|
-
<div class="radio-
|
|
3
|
-
<
|
|
1
|
+
(window["momentum-web-components-[id]"]=window["momentum-web-components-[id]"]||[]).push([[82],{104:function(e,t,i){"use strict";i.r(t),i.d(t,"Radio",(function(){return r}));var r,a=i(7),o=i(5),d=i(6),s=i(0),l=i(3),c=i(72),p=function(e,t,i,r){var a,o=arguments.length,d=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)d=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(d=(o<3?a(d):o>3?a(t,i,d):a(t,i))||d);return o>3&&d&&Object.defineProperty(t,i,d),d};!function(e){let t=class extends(Object(a.a)(s.LitElement)){constructor(){super(...arguments),this.tabIndex=-1,this.label="",this.value="",this.ariaLabel="",this.autofocus=!1,this._disabled=!1,this._checked=!1}get disabled(){return this._disabled}set disabled(e){const t=this._disabled;this._disabled=e,this.setAttribute("aria-disabled",""+e),this.tabIndex=e?-1:0,this.requestUpdate("disabled",t)}get checked(){return this._checked}set checked(e){const t=this._checked;this._checked=e,this.setAttribute("aria-checked",""+e),this.requestUpdate("checked",t)}firstUpdated(e){super.firstUpdated(e),this.setAttribute("role","radio"),this.label&&this.setAttribute("aria-label",this.label)}static get styles(){return[d.a,c.a]}render(){return s.html`
|
|
2
|
+
<div class="md-radio-wrapper" part="radio-wrapper">
|
|
3
|
+
<input
|
|
4
|
+
class="md-radio-input"
|
|
5
|
+
type="radio"
|
|
6
|
+
aria-label=${Object(l.ifDefined)(this.ariaLabel.length?this.ariaLabel:void 0)}
|
|
7
|
+
aria-checked=${this.checked?"true":"false"}
|
|
8
|
+
.value=${this.value}
|
|
9
|
+
?checked=${this.checked}
|
|
10
|
+
?autofocus=${this.autofocus}
|
|
11
|
+
?disabled=${this.disabled}
|
|
12
|
+
aria-hidden="true"
|
|
13
|
+
id="radio-label"
|
|
14
|
+
/>
|
|
15
|
+
<label for="radio-label" class="md-radio-label" part="radio-label"><slot></slot></label>
|
|
4
16
|
</div>
|
|
5
|
-
`}};
|
|
17
|
+
`}};p([Object(s.property)({type:Number,reflect:!0})],t.prototype,"tabIndex",void 0),p([Object(s.property)({type:String})],t.prototype,"label",void 0),p([Object(s.property)({type:String})],t.prototype,"value",void 0),p([Object(s.property)({type:String})],t.prototype,"ariaLabel",void 0),p([Object(s.property)({type:Boolean,reflect:!0})],t.prototype,"autofocus",void 0),p([Object(s.property)({type:Boolean,reflect:!0})],t.prototype,"disabled",null),p([Object(s.property)({type:Boolean,attribute:!1})],t.prototype,"checked",null),t=p([Object(o.a)("md-radio")],t),e.ELEMENT=t}(r||(r={}))}}]);
|
package/dist/chunks/md-83.js
CHANGED
|
@@ -1,19 +1,5 @@
|
|
|
1
|
-
(window["momentum-web-components-[id]"]=window["momentum-web-components-[id]"]||[]).push([[83],{
|
|
2
|
-
<div class="
|
|
3
|
-
|
|
4
|
-
<div class="md-slider">
|
|
5
|
-
<span class="md-slider__bar"></span>
|
|
6
|
-
<span class="md-slider__selection" style=${Object(m.styleMap)(this.sliderSelectionStyleMap)}></span>
|
|
7
|
-
<span
|
|
8
|
-
class="md-slider__pointer"
|
|
9
|
-
role="slider"
|
|
10
|
-
part="slider"
|
|
11
|
-
aria-valuemin=${this.min}
|
|
12
|
-
aria-valuemax=${this.max}
|
|
13
|
-
aria-valuenow=${this.now}
|
|
14
|
-
aria-label=${Object(h.ifDefined)(this.label)}
|
|
15
|
-
style=${Object(m.styleMap)(this.sliderPointerStyleMap)}
|
|
16
|
-
></span>
|
|
17
|
-
${this.step?this.ticksTemplate():l.nothing} ${this.hideValue?l.nothing:this.displayValueTemplate()}
|
|
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),l=s(72),a=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());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);break;case d.b.ArrowDown:case d.b.ArrowRight:this.selected===this.slotted.length-1?this.switchRadioOnArrowPress(0):this.switchRadioOnArrowPress(this.selected+1)}}get slotElement(){return this.radioSlot}static get styles(){return[c.a,l.a]}render(){return n.html`
|
|
2
|
+
<div class="radio-group-container" part="radio-group-container">
|
|
3
|
+
<slot name="radio"></slot>
|
|
18
4
|
</div>
|
|
19
|
-
`}};
|
|
5
|
+
`}};a([Object(n.property)({type:String,attribute:"group-label"})],t.prototype,"label",void 0),a([Object(n.property)({type:Number,reflect:!0})],t.prototype,"checked",void 0),a([Object(n.property)({type:String,reflect:!0})],t.prototype,"alignment",void 0),a([Object(n.query)("slot[name='radio']")],t.prototype,"radioSlot",void 0),a([Object(n.property)({type:Boolean,reflect:!0})],t.prototype,"disabled",null),t=a([Object(r.a)("md-radiogroup")],t),e.ELEMENT=t}(i||(i={}))}}]);
|
package/dist/chunks/md-84.js
CHANGED
|
@@ -1 +1,19 @@
|
|
|
1
|
-
(window["momentum-web-components-[id]"]=window["momentum-web-components-[id]"]||[]).push([[84],{
|
|
1
|
+
(window["momentum-web-components-[id]"]=window["momentum-web-components-[id]"]||[]).push([[84],{131:function(e,t,i){"use strict";i.r(t),i.d(t,"Slider",(function(){return s}));var s,r=i(1),o=i(7),n=i(5),d=i(6),a=i(0),l=i(2),h=i(3),c=i(13),m=i(8),p=a.css`:host(:focus){box-shadow:none;outline:0!important}:host(md-slider){display:flex;flex:1 1 auto;padding:1.25rem 0}:host(md-slider) .md-slider{border-radius:.25rem;display:flex;flex:1 1 auto;height:1.25rem;margin-right:1.25rem;position:relative;width:calc(100% - 1.25rem)}:host(md-slider) .md-slider__bar{position:absolute;top:50%;transform:translateY(-50%);background-color:var(--slider-background-bar,#ccc);border-radius:.125rem;cursor:pointer;height:.125rem;left:0;right:-1.25rem;z-index:0}:host(md-slider) .md-slider__selection{position:absolute;top:50%;transform:translateY(-50%);background-color:var(--slider-background-selection,#00a0d1);border-radius:.125rem;height:.125rem;left:0;transition:left 50ms,right 50ms;z-index:1}:host(md-slider) .md-slider__pointer{position:absolute;top:50%;transform:translateY(-50%);border-radius:.25rem;cursor:grabbing;height:1.25rem;transition:left 50ms,right 50ms;width:1.25rem;z-index:2}:host(md-slider) .md-slider__pointer::after{background-color:var(--slider-background-pointer,#fff);border-radius:50%;box-shadow:0 2px 6px rgba(0,0,0,.16);content:"";height:100%;position:absolute;width:100%;border:1px solid var(--slider-background-pointerBorder)}@media screen and (-ms-high-contrast:active){:host(md-slider) .md-slider__pointer::after{filter:brightness(1) contrast(1) saturate(1.5)}}:host(md-slider) .md-slider__hashlabel{align-content:center;align-items:center;display:flex;flex-flow:row nowrap;justify-content:space-between;bottom:-1.25rem;color:var(--slider-label,#545454);font-size:14px;left:0;line-height:14px;position:absolute;right:-1.25rem;white-space:nowrap}:host(md-slider) .md-slider__value{color:var(--slider-label,#545454);font-size:14px;line-height:14px;position:absolute;right:-1.25rem;top:-1.25rem}:host([disabled]) .md-slider__bar{cursor:not-allowed;background-color:var(--slider-background-disabled-bar,var(--slider-background-bar,#ccc))}:host([disabled]) .md-slider__pointer{cursor:not-allowed}:host([disabled]) .md-slider__pointer::after{background-color:var(--slider-background-disabled-pointer,#ccc)}:host([disabled]) .md-slider__selection{background-color:var(--slider-background-disabled-selection,#949494)}:host([focus-visible]:not([disabled])) .md-slider__pointer::after{box-shadow:var(--slider-background-focus-shadow,0 0 0 8px rgba(0,160,209,.4))}:host([no-pointer][focus-visible]:not([disabled])) .md-slider{box-shadow:var(--slider-background-focus-shadow,0 0 0 2px var(--slider-background-focus-selection,#007aa3),0 2px 6px rgba(0,0,0,.16))}:host(:hover:not([disabled])) .md-slider__pointer::after{background-color:var(--slider-background-hover-pointer,#c9f4ff)}:host([no-pointer]) .md-slider{margin-right:0!important}:host([no-pointer]) .md-slider__bar,:host([no-pointer]) .md-slider__value{right:0}:host([no-pointer]) .md-slider__pointer{display:none}@media(forced-colors:active){:host(md-slider) .md-slider__bar{background-color:CanvasText}:host(md-slider) .md-slider__selection{background-color:Highlight}:host(md-slider) .md-slider__pointer::after{background-color:Highlight}:host(:hover:not([disabled])) .md-slider__pointer::after{background-color:Highlight}:host([no-pointer][focus-visible]:not([disabled])) .md-slider{outline:1px solid Highlight}:host([focus-visible]:not([disabled])) .md-slider__pointer{outline:2px solid Highlight}:host([disabled]) .md-slider__pointer::after{background-color:GrayText}}`,u=function(e,t,i,s){var r,o=arguments.length,n=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var d=e.length-1;d>=0;d--)(r=e[d])&&(n=(o<3?r(n):o>3?r(t,i,n):r(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};!function(e){let t=class extends(Object(o.a)(a.LitElement)){constructor(){super(...arguments),this._disabled=!1,this._now=0,this.min=0,this.max=100,this.hideValue=!1,this.text=0,this.label="slider",this.step=0,this.dragging=!1}get now(){return this._now}set now(e){const t=this._now;e<this.min||e>this.max?console.warn("Please select correct value"):(this._now=Math.round(e),this.requestUpdate("now",t))}get disabled(){return this._disabled}set disabled(e){const t=this._disabled;this._disabled=e,this.setAttribute("aria-disabled",""+e),this.tabIndex=e?-1:0,this.requestUpdate("disabled",t)}get pointerPosition(){const e=this.max-this.min;return(this.now-this.min)/e*100}calculateHandlePosition(e){const{width:t,left:i}=this.getBoundingClientRect(),{clientX:s}=e,r=(s-i)/t;return this.min+(this.max-this.min)*r}moveSliderTo(e){this.disabled||(e>this.max?this.now=this.max:e<this.min?this.now=this.min:this.now=e)}trackMouseEvent(){if(!this.currentMouseEvent||!this.dragging)return;const e=this.calculateHandlePosition(this.currentMouseEvent),t=this.now;this.moveSliderTo(e),this.notifyChanging(t,this.now),requestAnimationFrame(()=>{this.trackMouseEvent()})}ticksTemplate(){const{min:e,max:t,step:i}=this,s=Math.round((t-e)/i),r=new Array(s+1).fill(0,0,s+1).map((t,s)=>e+s*i).filter(i=>i>=e&&i<=t);return a.html`
|
|
2
|
+
<div class="md-slider__hashlabel">${Object(c.repeat)(r,e=>a.html` <div class="tick">${e}</div> `)}</div>
|
|
3
|
+
`}displayValueTemplate(){return a.html` <span class="md-slider__value"> ${this.now} </span> `}notifyChanges(){this.dispatchEvent(new CustomEvent("slider-change",{bubbles:!0,composed:!0,detail:{value:this.now}}))}notifyChanging(e,t){e!==t&&this.dispatchEvent(new CustomEvent("slider-changing",{bubbles:!0,composed:!0,detail:{oldValue:e,newValue:t}}))}handleMouseDown(e){if(e.preventDefault(),this.disabled)return;const t=e=>{this.currentMouseEvent=e},i=e=>{this.focus(),this.currentMouseEvent=e,document.removeEventListener("mousemove",t),document.removeEventListener("mouseup",i),requestAnimationFrame(()=>{this.dragging=!1,this.notifyChanges()})};document.addEventListener("mousemove",t),document.addEventListener("mouseup",i),this.focus(),this.dragging=!0,this.currentMouseEvent=e,requestAnimationFrame(()=>{this.trackMouseEvent()})}handleKeyDown(e){const{code:t}=e,i=this.now;switch(t){case r.b.ArrowLeft:case r.b.ArrowDown:this.moveSliderTo(this.now-1);break;case r.b.ArrowRight:case r.b.ArrowUp:this.moveSliderTo(this.now+1);break;case r.b.Home:this.moveSliderTo(this.min);break;case r.b.End:this.moveSliderTo(this.max)}this.notifyChanging(i,this.now);const s=()=>{document.removeEventListener("keyup",s),this.notifyChanges()};document.addEventListener("keyup",s)}get sliderPointerStyleMap(){return{left:this.pointerPosition+"%"}}get sliderSelectionStyleMap(){return{right:`calc(100% - ${this.pointerPosition}%)`}}static get styles(){return[d.a,p]}firstUpdated(e){super.firstUpdated(e),this.setAttribute("tabindex",this.disabled?"-1":"0")}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",this.handleKeyDown),this.addEventListener("mousedown",this.handleMouseDown)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",this.handleKeyDown),this.removeEventListener("mousedown",this.handleMouseDown)}render(){return a.html`
|
|
4
|
+
<div class="md-slider">
|
|
5
|
+
<span class="md-slider__bar"></span>
|
|
6
|
+
<span class="md-slider__selection" style=${Object(m.styleMap)(this.sliderSelectionStyleMap)}></span>
|
|
7
|
+
<span
|
|
8
|
+
class="md-slider__pointer"
|
|
9
|
+
role="slider"
|
|
10
|
+
part="slider"
|
|
11
|
+
aria-valuemin=${this.min}
|
|
12
|
+
aria-valuemax=${this.max}
|
|
13
|
+
aria-valuenow=${this.now}
|
|
14
|
+
aria-label=${Object(h.ifDefined)(this.label)}
|
|
15
|
+
style=${Object(m.styleMap)(this.sliderPointerStyleMap)}
|
|
16
|
+
></span>
|
|
17
|
+
${this.step?this.ticksTemplate():l.nothing} ${this.hideValue?l.nothing:this.displayValueTemplate()}
|
|
18
|
+
</div>
|
|
19
|
+
`}};u([Object(a.property)({type:Number,reflect:!0})],t.prototype,"min",void 0),u([Object(a.property)({type:Number,reflect:!0})],t.prototype,"max",void 0),u([Object(a.property)({type:Boolean,attribute:"hide-value"})],t.prototype,"hideValue",void 0),u([Object(a.property)({type:Number,reflect:!0})],t.prototype,"now",null),u([Object(a.property)({type:Number})],t.prototype,"text",void 0),u([Object(a.property)({type:String})],t.prototype,"label",void 0),u([Object(a.property)({type:Number,reflect:!0})],t.prototype,"step",void 0),u([Object(a.property)({type:Boolean,reflect:!0})],t.prototype,"disabled",null),u([Object(a.internalProperty)()],t.prototype,"dragging",void 0),t=u([Object(n.a)("md-slider")],t),e.ELEMENT=t}(s||(s={}))}}]);
|
package/dist/chunks/md-85.js
CHANGED
|
@@ -1,168 +1 @@
|
|
|
1
|
-
(window["momentum-web-components-[id]"]=window["momentum-web-components-[id]"]||[]).push([[85],{109:function(e,t,o){"use strict";o.r(t),o.d(t,"TableAdvanced",(function(){return w}));o(17),o(14),o(36);var r=o(5),i=o(33),a=o(6),l=o(0),d=o(2),n=o(4),s=o(3),c=o(89),h=o(38),p=o.n(h),b=l.css`:host{display:block}.md-table-advanced{width:100%}table{border-collapse:separate;border-spacing:0;max-width:100%;position:relative;width:100%}table.sticky-header{height:100%}table.sticky-header thead th:first-child{border-left:1px solid var(--table-advanced-border-color,#dedede)}table.sticky-header thead th{background-color:var(--table-advanced-header-bg-color,#f7f7f7);border-left:0;border-top:0;position:sticky;top:0;z-index:1}table.sticky-header thead th::before{border-top:1px solid var(--table-advanced-border-color,#dedede);bottom:0;content:" ";left:0;position:absolute;top:0;width:100%}table.sticky-header thead tr:last-child th{top:2.5rem}table.sticky-header thead tr:last-child th::before{border-bottom:1px solid var(--table-advanced-border-color,#dedede);border-top:1px solid var(--table-advanced-border-color,#dedede)}table.sticky-header thead tr:first-child th{height:calc(2.5rem + .0625rem*2);top:0}table.sticky-header thead tr:first-child th::before{border-bottom:1px solid var(--table-advanced-border-color,#dedede);border-top:1px solid var(--table-advanced-border-color,#dedede)}table.sticky-header thead tr:focus{outline:0}table.sticky-header thead tr:focus th:first-child{border-left:2px solid var(--md-focus-border-color)}table.sticky-header thead tr:focus th:last-child{border-right:2px solid var(--md-focus-border-color)}table.sticky-header thead tr:focus th::before{border-bottom:2px solid var(--md-focus-border-color);border-top:2px solid var(--md-focus-border-color)}thead th:first-child{border-left:1px solid var(--table-advanced-border-color,#dedede)}thead th{background-color:var(--table-advanced-header-bg-color,#f7f7f7);border:1px solid var(--table-advanced-border-color,#dedede);border-left:0;color:var(--md-secondary-text-color);font-family:var(--brand-font-regular, "CiscoSansTT Regular", "Helvetica Neue", Helvetica, Arial, sans-serif);font-size:14px;height:2.5rem;max-width:0;padding:0 .375rem;position:relative;text-align:left}thead th .filter{display:inline-block;height:auto;margin-top:calc(.25rem/2)}thead th .resize{background-color:rgba(0,0,0,0);cursor:col-resize;height:100%;left:calc(-.25rem/2);position:absolute;top:0;width:.25rem;z-index:1}thead .head-inner-cell{align-items:center;display:flex;min-width:.875rem}thead .head-inner-cell .filter-wrap{align-items:center;display:inline-flex;flex:1;justify-content:flex-end}thead .head-inner-cell .filter-icon{color:var(--md-secondary-text-color);cursor:pointer;display:inline-block;height:1.5rem;min-width:1.25rem;position:relative;z-index:1}thead .head-inner-cell .filter-icon::part(button){padding:.25rem;text-align:center;width:1.5rem}thead .head-inner-cell .filter-icon:hover{background-color:var(--table-advanced-filter-hover-bg-color,#ededed)}thead .head-inner-cell .filter-icon:active{background-color:var(--table-advanced-filter-pressed-bg-color,#dedede)}thead .head-inner-cell span{display:inline-block;overflow:hidden;padding-right:calc(.25rem*1.25);text-overflow:ellipsis;white-space:nowrap;width:100%}thead .head-inner-cell .sortable{background:rgba(0,0,0,0);border:0;color:var(--md-secondary-text-color);display:inline-flex;align-items:center;min-width:calc(1rem*2.5);overflow:hidden;padding-right:calc(.25rem*4);text-overflow:ellipsis;white-space:nowrap;width:auto}thead md-menu-overlay::part(overlay){top:-.375rem;white-space:normal}@supports(-moz-appearance:none){thead md-menu-overlay::part(overlay){top:-.25rem;white-space:normal}}thead .drag-area-col{cursor:grab;display:block;height:calc(.25rem*10);left:.25rem;position:absolute;right:.25rem;top:0;z-index:1}thead .drag-area-col.drag{border:2px dashed var(--table-advanced-filter-border-color,#ccc);opacity:1}thead .drag-area-col.over{background-color:#a87ff1;height:100%;opacity:.1}thead .sortable{cursor:pointer;z-index:1;gap:.5rem}.filter-active{display:inline-block;height:1.25rem;text-align:center;vertical-align:bottom;width:1.25rem}.filter-active::part(icon){line-height:.875rem}.filter-menu{background-color:var(--table-advanced-filter-bg-color,#fff);padding:calc(.25rem*3);position:relative;z-index:1}.filter-menu select{background-color:var(--table-advanced-filter-bg-color,#fff);border:1px solid var(--table-advanced-filter-border-color,#ccc);color:var(--md-secondary-text-color);min-height:calc(.875rem*1.8);width:100%}.filter-menu input{background-color:var(--table-advanced-filter-bg-color,#fff);border:1px solid var(--table-advanced-filter-border-color,#ccc);color:var(--md-secondary-text-color);margin-top:calc(.25rem*2);width:100%}tbody tr{position:relative}tbody tr td:first-child{border-left:1px solid var(--table-advanced-border-color,#dedede)}tbody tr td{border-bottom:1px solid var(--table-advanced-border-color,#dedede);border-right:1px solid var(--table-advanced-border-color,#dedede);font-size:14px;height:2.5rem;max-width:0;padding:calc(.25rem*1.5);position:relative}tbody tr th:first-child{border-top:1px solid var(--table-advanced-border-color,#dedede)}tbody tr th{background-color:var(--table-advanced-header-bg-color,#f7f7f7);border-bottom:1px solid var(--table-advanced-border-color,#dedede);border-right:1px solid var(--table-advanced-border-color,#dedede);font-size:14px;max-width:0;padding:0 calc(.25rem*4);position:relative;text-align:left}tbody tr .inner-cell{display:flex;white-space:nowrap;align-items:center}tbody tr .inner-cell .warn-icon{display:inline-block;margin-left:.25rem;max-height:1.25rem;position:relative;vertical-align:middle;z-index:0}tbody tr .inner-cell md-icon::part(icon){line-height:1.25rem}tbody tr .inner-cell span{align-self:center;display:inline-block;flex:1;overflow:hidden;padding:0 .25rem;text-overflow:ellipsis;vertical-align:middle}tbody tr .drag-handle{cursor:grab;float:left;margin-right:calc(.25rem*1.5)}tbody tr .drag-area{height:50%;left:0;opacity:.3;position:absolute;right:0}tbody tr .drag-area.top{top:0}tbody tr .drag-area.bottom{background-color:rgba(0,0,0,0);bottom:0}tbody tr.ghost{opacity:.3}tbody tr:hover{background-color:var(--table-advanced-hover-bg-color,#f7f7f7)}tbody tr:hover td,tbody tr:hover th{background-color:var(--table-advanced-hover-bg-color,#f7f7f7)}tbody tr.selected,tbody tr:active{background-color:var(--table-advanced-selected-bg-color,#ededed)}tbody tr.selected td,tbody tr.selected th,tbody tr:active td,tbody tr:active th{background-color:var(--table-advanced-selected-bg-color,#ededed)}button.row-collapsible{display:inline-flex;align-items:center;justify-content:center;height:1.25rem;width:1.25rem;margin-right:calc(.25rem*1.5);background-color:rgba(0,0,0,0);border:1px solid var(--table-advanced-border-color);border-radius:2px}button.row-collapsible:hover{background-color:var(--table-advanced-filter-hover-bg-color,#ededed);border:0}button.row-collapsible:active{background-color:var(--table-advanced-filter-pressed-bg-color);border:0}`;function g(e=250){return function(t,o,r){let i;return function(e,t){if(e.descriptor=e.descriptor||Object.getOwnPropertyDescriptor(e.target,e.key),"function"!=typeof e.descriptor.value)return console.warn(e.key,"Decorator must be used on function"),e.descriptor;const o=e.descriptor.value,r=e.target.constructor.name;return e.descriptor.value=function(...e){return t.call(this,o,e,r)},e.descriptor}({target:t,key:o,descriptor:r},(function(t,o){clearTimeout(i),i=window.setTimeout(()=>{clearTimeout(i),t.apply(this,o)},e)}))}}class m{constructor(e,t){this.target=e,this.eventName=t}emit(e,t={bubbles:!0,composed:!0,cancelable:!1}){this.target.dispatchEvent(new CustomEvent(this.eventName,Object.assign({detail:e},t)))}}const u=new WeakMap,f=Object(d.directive)(e=>t=>{if(!(t instanceof d.NodePart))throw new Error("templateCallback can only be used in text bindings");const o=u.get(t);if(void 0!==o&&e.template===o.template&&t.value===o.fragment)return;const r=document.importNode(e.template.content,!0);e.cb({content:e.content,row:e.row,col:e.col,insertIndex:e.insertIndex,fragment:r}),t.setValue(r),u.set(t,{template:e.template,fragment:r})});var v;!function(e){const t={placeholder:"Filter..."};e.OPTIONS={equals:{label:"Equals",input:t,predicate:(e,t)=>e==t},notEqual:{label:"Not equal",input:t,predicate:(e,t)=>e!=t},contains:{label:"Contains",input:t,predicate:(e,t)=>e.includes(t)},notContains:{label:"Not contains",input:t,predicate:(e,t)=>!e.includes(t)},startsWith:{label:"Starts with",input:t,predicate:(e,t)=>e.startsWith(t)},endsWith:{label:"Ends with",input:t,predicate:(e,t)=>e.endsWith(t)},lessThan:{label:"Less than",input:t,predicate:(e,t)=>e<t},lessThanOrEquals:{label:"Less than or equals",input:t,predicate:(e,t)=>e<=t},greaterThan:{label:"Greater than",input:t,predicate:(e,t)=>e>t},greaterThanOrEquals:{label:"Greater than or equals",input:t,predicate:(e,t)=>e>=t}},e.optionsString=[e.OPTIONS.equals,e.OPTIONS.notEqual,e.OPTIONS.contains,e.OPTIONS.notContains,e.OPTIONS.startsWith,e.OPTIONS.endsWith],e.optionsNumber=[e.OPTIONS.equals,e.OPTIONS.notEqual,e.OPTIONS.lessThan,e.OPTIONS.lessThanOrEquals,e.OPTIONS.greaterThan,e.OPTIONS.greaterThanOrEquals]}(v||(v={}));var y=function(e,t,o,r){var i,a=arguments.length,l=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,o,r);else for(var d=e.length-1;d>=0;d--)(i=e[d])&&(l=(a<3?i(l):a>3?i(t,o,l):i(t,o))||l);return a>3&&l&&Object.defineProperty(t,o,l),l};const x=document.createElement("img");var w;x.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",function(e){let t=class extends(Object(i.a)(l.LitElement)){constructor(){super(...arguments),this.isRowFocusable="true",this.error="",this.COLS=[],this.ROWS=[],this.updCols=()=>this.requestUpdate("COLS"),this.updRows=()=>this.requestUpdate("ROWS"),this.dragRow=-1,this.dropRow=-1,this.drops=[],this.dragRowElem=null,this.dragCol=-1,this.dropCol=-1,this.isResizing=!1,this.isSelectable=!1,this.selected={},this.expandedRowIdx={},this.dragover=e=>e.preventDefault(),this.eX=0,this.onResize=(e,t)=>{var o;if(-1!=this.dragCol||-1!=this.dragRow)return;this.isResizing=!0;const r=e.target;null===(o=e.dataTransfer)||void 0===o||o.setDragImage(x,0,0);const i=this.COLS.map(e=>this.shadowRoot.querySelector("th.col-index-"+e.index));this.COLS.forEach((e,t)=>e.width=i[t].offsetWidth+"px"),this.updCols();const a=e.x;this.eX=e.x;let l=-1,d=-1,n=-1;const s=this.COLS[t.index-1],c=i[t.index],h=i[t.index-1],p=c.offsetWidth,b=h.offsetWidth,g=()=>{const e=this.eX;if(l!=e&&0!=e){l=e;const o=l-a;d=p-o,n=b+o,t.width=d+"px",s.width=n+"px",this.updCols()}},m=e=>this.eX=e.x,u=()=>{this.isResizing=!1,r.removeEventListener("drag",g),r.removeEventListener("dragend",u),document.removeEventListener("dragover",m)};r.addEventListener("drag",g),r.addEventListener("dragend",u),document.addEventListener("dragover",m)}}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("dragover",this.dragover)}connectedCallback(){super.connectedCallback(),document.addEventListener("dragover",this.dragover),this.updateTableConfig(),this.updateTableData(),this.populateTable()}update(e){super.update(e),e.has("data")&&(this.updateTableData(),this.updateDataInTable())}updateTableData(){if("string"==typeof this.data)try{this.tableData=JSON.parse(this.data)}catch(e){console.error("[INVALID_JSON_FORMAT] Please recheck the config json")}else this.tableData=Object.assign({},this.data)}updateTableConfig(){if("string"==typeof this.config)try{this.tableConfig=JSON.parse(this.config)}catch(e){console.error("[INVALID_JSON_FORMAT] Please recheck the data json")}else this.tableConfig=Object.assign({},this.config)}populateColumns(){var e;let t=0;const o=(e,o)=>{var r,i,a,l;const d=e.filters||(null===(i=null===(r=this.tableConfig.default)||void 0===r?void 0:r.col)||void 0===i?void 0:i.filters),n=d?"forString"==d?v.optionsString:"forNumber"==d?v.optionsNumber:d.length?d:null:null;this.COLS.push({options:Object.assign({},e),index:t++,group:o,sort:"default",sorter:e.sorter||(null===(l=null===(a=this.tableConfig.default)||void 0===a?void 0:a.col)||void 0===l?void 0:l.sorter),isCollapsable:this.tableConfig.cols.collapse==e.id,filter:n?{list:n,selectedIndex:0,input:"",active:!1,menuVisible:!1}:void 0})};this.tableConfig.cols.define.forEach(e=>{"children"in e?e.children.forEach(t=>o(t,{name:e.groupName,length:e.children.length})):o(e)}),this.isSelectable=!!this.tableConfig.rows&&"none"!=(null===(e=this.tableConfig.rows)||void 0===e?void 0:e.selectable)}populateData(){const e=this.COLS.length;if("csv"in this.tableData){const e=p.a.parse(this.tableData.csv,{skipEmptyLines:!0,transform:e=>e.trim()});if(e.errors)return void(this.error="PARSE ERROR:\n"+JSON.stringify(e.errors,null,2));{const t=e.data;this.ROWS=t.map(e=>e.map(e=>({text:e})))}}else if("list2d"in this.tableData)this.ROWS=this.tableData.list2d.map(e=>e.map(e=>({text:e})));else{for(;this.tableData.list.length>e;)this.ROWS.push(this.tableData.list.splice(0,e).map(e=>({text:e})));0!=this.tableData.list.length&&this.ROWS.push(this.tableData.list.map(e=>({text:e})))}0!=this.ROWS.length||(this.error="DATA ERROR: Data is empty")}validateData(){const e=this.COLS.length;this.ROWS.reduce((e,t)=>e+t.length,0)%e==0?this.ROWS.forEach((t,o)=>{const r=t.length;r!=e&&(this.error=`DATA ERROR: Total number of cols (=${e}) and data[${o}] length (=${r}) mismatch`)}):this.error=this.error="DATA ERROR: Data length mismatch. You must provide (numberOfRows * numberOfColumns) amount of data values."}populateTemplate(){const e=this.tableConfig.cellTemplates,t=Object.keys(e||{});e&&t.length&&this.ROWS.forEach((t,o)=>{t.forEach((t,r)=>{for(const i in e){const a=t.text.indexOf(i);if(-1!=a){const l=e[i],d=this.querySelector("#"+l.templateName);if(null==d){console.warn(`cellTemplates["${i}"]: Missing '${l.templateName}' template.`);continue}let n=t.text.replace(i,"");l.contentCb&&(n=l.contentCb({col:r,row:o,content:n,insertIndex:a})),this.ROWS[o][r]={text:n,template:{template:d,templateCb:l.templateCb,insertIndex:"replace"==l.contentUse?-1:a}};break}}})})}setDefaultFilterAndSort(){var e,t;const o=null===(e=this.tableConfig.default)||void 0===e?void 0:e.sort;if(o){const e=this.COLS.find(e=>e.options.id==o.colId);e?this.sort(e,o.order):console.warn(`Cant find ${o.colId} col - for sorting`)}const r=null===(t=this.tableConfig.default)||void 0===t?void 0:t.filter;if(r){const e=this.COLS.find(e=>e.options.id==r.colId);e?e.filter?(e.filter.selectedIndex=r.selectedIndex,e.filter.input=r.input,this.updCols(),this.filter(e)):console.warn(`Cant find filters on ${r.colId} col`):console.warn(`Cant find ${r.colId} col - for filtering`)}}populateTable(){this.populateColumns(),this.populateData(),this.validateData(),this.setDefaultFilterAndSort(),this.populateTemplate()}updateDataInTable(){this.populateData(),this.validateData(),this.populateTemplate()}onDropRow(){this.dragRow!=this.dropRow&&this.drops.push([this.dragRow,this.dropRow]),this.dragRow=-1,this.dropRow=-1,this.dragRowElem&&(this.dragRowElem.setAttribute("draggable","false"),this.dragRowElem=null)}onDropCol(){if(this.dragCol!=this.dropCol){const e=this.COLS[this.dragCol],t=this.COLS[this.dropCol],o=e.group,r=t.group,i=e.index,a=t.index;e.group=r,t.group=o,e.index=a,t.index=i,this.COLS[this.dragCol]=t,this.COLS[this.dropCol]=e,this.ROWS.forEach(e=>{const t=e[this.dragCol],o=e[this.dropCol];e[this.dragCol]=o,e[this.dropCol]=t}),this.updCols(),this.updRows()}this.dragCol=-1,this.dropCol=-1}sort(e,t){e.sorter&&(this.clearSelection(),this.drops=[],this.COLS.forEach(o=>{o.options.id==e.options.id?o.sort=t||("default"==o.sort?"ascending":"ascending"==o.sort?"descending":"default"):o.sort="default"}),this.updCols(),this.requestUpdate(),this["md-table-advanced-change"].emit({type:"sort",order:e.sort}))}filter(e){if(!e.filter)return;this.clearSelection(),this.drops=[];const t=e.filter.input.trim(),o=e.filter.list[e.filter.selectedIndex];e.filter.active=!!t,this.requestUpdate(),t?this["md-table-advanced-change"].emit({type:"filter-on",filter:o,input:t}):this["md-table-advanced-change"].emit({type:"filter-off",filter:e.filter.list[e.filter.selectedIndex]})}selectRow(e){var t;const o=e.row.idx,r=Object.prototype.hasOwnProperty.call(this.selected,o);"multiple"==(null===(t=this.tableConfig.rows)||void 0===t?void 0:t.selectable)?(e.metaKey?r?delete this.selected[o]:this.selected[o]=!0:e.shiftKey||(this.selected={[o]:!0}),this["md-table-advanced-change"].emit({type:"multi-select",rows:Object.keys(this.selected).map(e=>+e)})):r?this.clearSelection():(this.selected={[o]:!0},this["md-table-advanced-change"].emit({type:"select",index:o})),this.requestUpdate("selected")}clearSelection(){this.selected={},this.requestUpdate("selected")}collapseToggle(e,t){e.stopPropagation(),this.expandedRowIdx[t]?(delete this.expandedRowIdx[t],this["md-table-advanced-change"].emit({type:"collapse",row:t})):(this.expandedRowIdx[t]=!0,this["md-table-advanced-change"].emit({type:"expand",row:t})),this.clearSelection(),this.requestUpdate()}render(){if(this.error)return l.html` <div>${this.error}</div> `;const{head:e}=this.tableConfig,t=Object(n.classMap)({"sticky-header":!!this.tableConfig.isStickyHeader});return l.html`
|
|
2
|
-
<div class="md-table-advanced">
|
|
3
|
-
<slot></slot>
|
|
4
|
-
<table class=${t} summary=${Object(s.ifDefined)(null==e?void 0:e.summary)}>
|
|
5
|
-
${(null==e?void 0:e.caption)?l.html`
|
|
6
|
-
<caption>
|
|
7
|
-
${null==e?void 0:e.caption}
|
|
8
|
-
${(null==e?void 0:e.tableDescription)?l.html` <span style="position: absolute; top: -30em">${null==e?void 0:e.tableDescription}</span> `:d.nothing}
|
|
9
|
-
</caption>
|
|
10
|
-
`:(null==e?void 0:e.tableDescription)?l.html`
|
|
11
|
-
<caption>
|
|
12
|
-
<span style="position: absolute; top: -30em">${null==e?void 0:e.tableDescription}</span>
|
|
13
|
-
</caption>
|
|
14
|
-
`:d.nothing}
|
|
15
|
-
${this.renderHead()} ${this.renderBody()}
|
|
16
|
-
</table>
|
|
17
|
-
</div>
|
|
18
|
-
`}ariaSortOrder(e){return"ascending"===e||"descending"===e?e:"none"}renderHead(){let e=d.nothing;const t=this.COLS.reduce((e,t)=>!!t.group||e,!1);if(t){let t="";e=l.html`
|
|
19
|
-
${this.COLS.map(e=>e.group?t!=e.group.name?(t=e.group.name,l.html` <colgroup span=${e.group.length}></colgroup> `):void 0:l.html` <col /> `)}
|
|
20
|
-
<tr tabindex="0">
|
|
21
|
-
${this.COLS.map(e=>e.group?t!=e.group.name?(t=e.group.name,l.html`
|
|
22
|
-
<th colspan=${e.group.length} scope="colgroup" title="${e.group.name}">
|
|
23
|
-
<div class="head-inner-cell">
|
|
24
|
-
<span>${e.group.name}</span>
|
|
25
|
-
${this.renderColResize(e)}
|
|
26
|
-
</div>
|
|
27
|
-
</th>
|
|
28
|
-
`):void 0:this.renderCol(e,2))}
|
|
29
|
-
</tr>
|
|
30
|
-
`}const o=l.html`
|
|
31
|
-
<tr tabindex="0">
|
|
32
|
-
${this.COLS.map(e=>t?e.group?this.renderCol(e):void 0:this.renderCol(e))}
|
|
33
|
-
</tr>
|
|
34
|
-
`;return l.html`
|
|
35
|
-
<thead>
|
|
36
|
-
${e} ${o}
|
|
37
|
-
</thead>
|
|
38
|
-
`}sortIconTemplate(e){return"ascending"===e?l.html`<md-icon name="arrow-tail-down-bold" size="12" iconSet="momentumDesign"></md-icon>`:"descending"===e?l.html`<md-icon name="arrow-tail-up-bold" size="12" iconSet="momentumDesign"></md-icon>`:l.html`<md-icon name="unsorted-bold" size="12" iconSet="momentumDesign"></md-icon>`}renderCol(e,t){var o,r;const i=null===(r=null===(o=e.filter)||void 0===o?void 0:o.list[e.filter.selectedIndex])||void 0===r?void 0:r.input,a=Object(n.classMap)({ascending:"ascending"==e.sort,descending:"descending"==e.sort});return l.html`
|
|
39
|
-
<th
|
|
40
|
-
rowspan=${Object(s.ifDefined)(t)}
|
|
41
|
-
width=${Object(s.ifDefined)(e.width?e.width:e.options.width)}
|
|
42
|
-
scope="col"
|
|
43
|
-
part="head-col"
|
|
44
|
-
aria-sort=${this.ariaSortOrder(e.sort)}
|
|
45
|
-
title="${e.options.title}"
|
|
46
|
-
class=${"col-index-"+e.index}
|
|
47
|
-
>
|
|
48
|
-
<!-- DRAG -->
|
|
49
|
-
${this.renderColDrag(e)}
|
|
50
|
-
|
|
51
|
-
<div class="head-inner-cell">
|
|
52
|
-
<!-- SORT -->
|
|
53
|
-
${e.sorter?l.html`
|
|
54
|
-
<button class="sortable ${a}" @click=${()=>this.sort(e)}>
|
|
55
|
-
${e.options.title} ${this.sortIconTemplate(e.sort)}
|
|
56
|
-
</button>
|
|
57
|
-
`:l.html` <span>${e.options.title}</span> `}
|
|
58
|
-
|
|
59
|
-
<!-- FILTER -->
|
|
60
|
-
${e.filter?l.html`
|
|
61
|
-
<div class="filter-wrap">
|
|
62
|
-
${e.filter.active?l.html`
|
|
63
|
-
<md-icon
|
|
64
|
-
class="filter-active"
|
|
65
|
-
name="filter-bold"
|
|
66
|
-
size="14"
|
|
67
|
-
iconSet="momentumDesign"
|
|
68
|
-
></md-icon>
|
|
69
|
-
`:d.nothing}
|
|
70
|
-
<md-menu-overlay placement="bottom" class="filter" custom-width="188px">
|
|
71
|
-
<md-button class="filter-icon" slot="menu-trigger" color="color-none" size="size-none">
|
|
72
|
-
<md-icon slot="icon" name="filter-bold" size="16" iconSet="momentumDesign"></md-icon>
|
|
73
|
-
</md-button>
|
|
74
|
-
<div class="filter-menu" style="width: 100%;">
|
|
75
|
-
<select
|
|
76
|
-
name="filter-type"
|
|
77
|
-
@change=${t=>{e.filter.selectedIndex=t.target.value,this.updCols(),this.filter(e)}}
|
|
78
|
-
>
|
|
79
|
-
${e.filter.list.map((t,o)=>l.html`
|
|
80
|
-
<option value=${o} ?selected=${e.filter.selectedIndex==o}>${t.label}</option>
|
|
81
|
-
`)}
|
|
82
|
-
</select>
|
|
83
|
-
<input
|
|
84
|
-
type="text"
|
|
85
|
-
placeholder=${i.placeholder}
|
|
86
|
-
maxlength=${Object(s.ifDefined)(i.maxlength)}
|
|
87
|
-
pattern=${Object(s.ifDefined)(i.pattern)}
|
|
88
|
-
.value=${e.filter.input}
|
|
89
|
-
@input=${t=>{e.filter.input=t.target.value,this.updCols(),this.filter(e)}}
|
|
90
|
-
/>
|
|
91
|
-
</div>
|
|
92
|
-
</md-menu-overlay>
|
|
93
|
-
</div>
|
|
94
|
-
`:d.nothing}
|
|
95
|
-
|
|
96
|
-
<!-- RESIZE -->
|
|
97
|
-
${this.renderColResize(e)}
|
|
98
|
-
</div>
|
|
99
|
-
</th>
|
|
100
|
-
`}renderColDrag(e){return this.tableConfig.cols.isDraggable?l.html`
|
|
101
|
-
<div
|
|
102
|
-
draggable="true"
|
|
103
|
-
class="drag-area-col ${Object(n.classMap)({drag:-1!=this.dragCol,over:this.dropCol==e.index&&this.dropCol!=this.dragCol})}"
|
|
104
|
-
@dragstart=${t=>{this.isResizing||-1!=this.dragRow||(this.dragCol=e.index,t.dataTransfer.setDragImage(t.target.parentNode,0,0))}}
|
|
105
|
-
@dragenter=${()=>{this.isResizing||-1!=this.dragRow||(this.dropCol=e.index)}}
|
|
106
|
-
@dragend=${()=>this.onDropCol()}
|
|
107
|
-
></div>
|
|
108
|
-
`:d.nothing}renderColResize(e){return this.tableConfig.cols.isResizable?l.html`
|
|
109
|
-
${e.index>0?l.html`
|
|
110
|
-
<div class="resize" draggable="true" @dragstart=${t=>this.onResize(t,e)}></div>
|
|
111
|
-
`:d.nothing}
|
|
112
|
-
`:d.nothing}renderBody(){let e=this.ROWS.map((e,t)=>({cells:e,idx:t,idxDrag:t,collapse:"none",first:0===t,isGhost:!1,children:[]}));const t=this.COLS.length;e=e.filter(e=>{var o;for(let r=0;r<t;r++){const t=this.COLS[r];if(null===(o=t.filter)||void 0===o?void 0:o.active){if(!t.filter.list[t.filter.selectedIndex].predicate(e.cells[r].text,t.filter.input))return!1}}return!0});const o=this.COLS.find(e=>"default"!=e.sort);if(o){const t=this.ROWS.map((e,t)=>({v:e[o.index].text,i:t})),r="ascending"==o.sort?1:-1;let i=[];if("byNumber"==o.sorter)i=t.sort((e,t)=>1==r?+e.v-+t.v:+t.v-+e.v);else if("byString"==o.sorter)i=t.sort((e,t)=>e.v==t.v?0:e.v>t.v?r:-r);else if("function"==typeof o.sorter){const e=o.sorter;i=t.sort((t,o)=>e(t.v,o.v,r))}e=i.map(t=>e[t.i])}const r=this.COLS.find(e=>e.isCollapsable);if(r){const t=r.index,o=e.reduce((e,o)=>{const r=o.cells[t].text,i=e.find(e=>e.key==r);return i?(o.collapse="child",i.children.push(o)):e.push({key:r,root:o,children:[]}),e},[]);e=[],o.forEach(t=>{e.push(t.root),t.root.collapse=0==t.children.length?"none":this.expandedRowIdx[t.root.idx]?"expanded":"collapsed",t.root.children=t.children})}return this.drops.forEach(({0:t,1:o})=>{e.splice(o,0,e.splice(t,1)[0])}),e.forEach((e,t)=>e.idxDrag=t),-1!=this.dragRow&&(e[this.dragRow].isGhost=!0,-1!=this.dropRow&&e.splice(this.dropRow,0,e.splice(this.dragRow,1)[0])),l.html`
|
|
113
|
-
<tbody>
|
|
114
|
-
${e.map(t=>{const o=e.length,r=t.children.length>0&&"expanded"==t.collapse&&!t.isGhost;return l.html`
|
|
115
|
-
${this.renderRow(t,o)} ${r?t.children.map(e=>this.renderRow(e,o)):d.nothing}
|
|
116
|
-
`})}
|
|
117
|
-
</tbody>
|
|
118
|
-
`}renderRow(e,t){const o=Object.prototype.hasOwnProperty.call(this.selected,e.idx),r=Object(n.classMap)({selected:o,selectable:this.isSelectable&&!o,ghost:e.isGhost});return l.html`
|
|
119
|
-
<tr
|
|
120
|
-
class=${r}
|
|
121
|
-
tabindex=${Object(s.ifDefined)("true"===this.isRowFocusable?"0":void 0)}
|
|
122
|
-
part=${e.first?"first-row":"row"}
|
|
123
|
-
@click=${({shiftKey:t,metaKey:o})=>{this.isSelectable&&this.selectRow({row:e,shiftKey:t,metaKey:o})}}
|
|
124
|
-
>
|
|
125
|
-
${e.cells.map((o,r)=>{var i;const a=this.COLS[r];let n=o.text;const s=o.template;s&&(n=s.templateCb?l.html`
|
|
126
|
-
${f({cb:s.templateCb,insertIndex:s.insertIndex,template:s.template,content:o.text,row:e.idx,col:r})}
|
|
127
|
-
`:l.html` ${Object(c.templateContent)(s.template)} `,-1!=s.insertIndex&&(n=l.html`
|
|
128
|
-
${s.insertIndex>0?o.text.substring(0,s.insertIndex):d.nothing} ${n}
|
|
129
|
-
${s.insertIndex<o.text.length-1?o.text.substring(s.insertIndex):d.nothing}
|
|
130
|
-
`));const h=(null===(i=this.tableConfig.rows)||void 0===i?void 0:i.isDraggable)&&"child"!=e.collapse,p=h&&-1!=this.dragRow&&this.dragRow!=e.idxDrag,b=h&&0==r,g=l.html`
|
|
131
|
-
<div
|
|
132
|
-
class="inner-cell"
|
|
133
|
-
draggable="false"
|
|
134
|
-
@dragstart=${()=>{this.isResizing||-1!=this.dragCol||(this.dragRow=e.idxDrag)}}
|
|
135
|
-
@dragend=${()=>this.onDropRow()}
|
|
136
|
-
>
|
|
137
|
-
${p?l.html`
|
|
138
|
-
<div
|
|
139
|
-
class="drag-area top"
|
|
140
|
-
@dragenter=${()=>{if(0==this.dragRow){const t=e.idxDrag-1;this.dropRow=t>=0?t:0}else this.dropRow=e.idxDrag}}
|
|
141
|
-
></div>
|
|
142
|
-
<div
|
|
143
|
-
class="drag-area bottom"
|
|
144
|
-
@dragenter=${()=>{if(0==this.dragRow)this.dropRow=e.idxDrag;else{const o=e.idxDrag+1;this.dropRow=o<t?o:t-1}}}
|
|
145
|
-
></div>
|
|
146
|
-
`:d.nothing}
|
|
147
|
-
${b?l.html`
|
|
148
|
-
<md-icon
|
|
149
|
-
class="drag-handle"
|
|
150
|
-
@mousedown=${e=>{this.isResizing||-1!=this.dragCol||(this.dragRowElem=e.target.parentNode,this.dragRowElem.setAttribute("draggable","true"))}}
|
|
151
|
-
name="dragger-vertical-bold"
|
|
152
|
-
size="16"
|
|
153
|
-
iconSet="momentumDesign"
|
|
154
|
-
>
|
|
155
|
-
</md-icon>
|
|
156
|
-
`:d.nothing}
|
|
157
|
-
${a.isCollapsable?l.html`
|
|
158
|
-
${"expanded"==e.collapse||"collapsed"==e.collapse?l.html`
|
|
159
|
-
<button class="row-collapsible" @click=${t=>this.collapseToggle(t,e.idx)}>
|
|
160
|
-
${"collapsed"==e.collapse?l.html` <md-icon name="plus-bold" size="12" iconSet="momentumDesign"></md-icon> `:l.html` <md-icon name="minus-bold" size="12" iconSet="momentumDesign"></md-icon> `}
|
|
161
|
-
</button>
|
|
162
|
-
`:d.nothing}
|
|
163
|
-
<span>${"child"==e.collapse?d.nothing:n}</span>
|
|
164
|
-
`:l.html` <span>${n}</span> `}
|
|
165
|
-
</div>
|
|
166
|
-
`;return a.options.isHeader?l.html` <th part="cell-ishead" scope="row" title="${o.text}">${g}</th> `:l.html` <td part=${0===r?"first-cell":"cell"} title="${o.text}">${g}</td> `})}
|
|
167
|
-
</tr>
|
|
168
|
-
`}static get styles(){return[a.a,b]}};y([Object(l.property)({attribute:"config"})],t.prototype,"config",void 0),y([Object(l.property)({attribute:"data"})],t.prototype,"data",void 0),y([Object(l.property)({type:String})],t.prototype,"isRowFocusable",void 0),y([(e,t)=>{const o={get(){return new m(this,void 0!==t?t:e.key)},enumerable:!0,configurable:!0};return void 0!==t?Object.defineProperty(e,t,o):{kind:"method",placement:"prototype",key:e.key,descriptor:o}}],t.prototype,"md-table-advanced-change",void 0),y([Object(l.internalProperty)()],t.prototype,"tableConfig",void 0),y([Object(l.internalProperty)()],t.prototype,"tableData",void 0),y([Object(l.internalProperty)()],t.prototype,"error",void 0),y([Object(l.internalProperty)()],t.prototype,"COLS",void 0),y([Object(l.internalProperty)()],t.prototype,"ROWS",void 0),y([Object(l.internalProperty)()],t.prototype,"dragRow",void 0),y([Object(l.internalProperty)()],t.prototype,"dropRow",void 0),y([Object(l.internalProperty)()],t.prototype,"drops",void 0),y([Object(l.internalProperty)()],t.prototype,"dragCol",void 0),y([Object(l.internalProperty)()],t.prototype,"dropCol",void 0),y([Object(l.queryAll)("tr[tabindex]")],t.prototype,"tableRaws",void 0),y([g(500)],t.prototype,"filter",null),t=y([Object(r.a)("md-table-advanced")],t),e.ELEMENT=t}(w||(w={}))}}]);
|
|
1
|
+
(window["momentum-web-components-[id]"]=window["momentum-web-components-[id]"]||[]).push([[85],{106:function(e,t,r){"use strict";r.r(t),r.d(t,"TabPanel",(function(){return n}));var n,o=r(7),a=r(5),s=r(6),c=r(0),i=r(41),l=function(e,t,r,n){var o,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var c=e.length-1;c>=0;c--)(o=e[c])&&(s=(a<3?o(s):a>3?o(t,r,s):o(t,r))||s);return a>3&&s&&Object.defineProperty(t,r,s),s};!function(e){let t=class extends(Object(o.a)(c.LitElement)){constructor(){super(...arguments),this.selected=!1,this.name="",this.focusablePanel="true"}static get styles(){return[s.a,i.a]}firstUpdated(e){super.firstUpdated(e),this.setAttribute("role","tabpanel"),"true"===this.focusablePanel&&this.setAttribute("tabindex","0")}render(){return c.html` <slot></slot> `}};l([Object(c.property)({type:Boolean,reflect:!0})],t.prototype,"selected",void 0),l([Object(c.property)({type:String,attribute:"name"})],t.prototype,"name",void 0),l([Object(c.property)({type:String,attribute:"focusable-panel"})],t.prototype,"focusablePanel",void 0),t=l([Object(a.a)("md-tab-panel")],t),e.ELEMENT=t}(n||(n={}))}}]);
|