@momentum-ui/web-components 2.26.23 → 2.26.24
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/1200.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";(self["momentum-web-components-[id]"]=self["momentum-web-components-[id]"]||[]).push([[1200],{61200:(t,e,i)=>{i(96798);var o,n=i(31890),s=i(26272),r=i(32022),c=i.n(r),a=i(60554),
|
|
1
|
+
"use strict";(self["momentum-web-components-[id]"]=self["momentum-web-components-[id]"]||[]).push([[1200],{61200:(t,e,i)=>{i(96798);var o,n=i(31890),s=i(26272),r=i(32022),c=i.n(r),a=i(60554),l=i.n(a),h=i(41488),d=i(40333),p=i(23968),u=i(97822),m=i(8229),g=i(57955),v=i(66873),y=i(81786),S=i(9223),b=function(t,e,i,o){var n,s=arguments.length,r=s<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(n=t[c])&&(r=(s<3?n(r):s>3?n(e,i,r):n(e,i))||r);return s>3&&r&&Object.defineProperty(e,i,r),r};!function(t){var e;let i=e=class extends h.LitElement{constructor(){super(...arguments),this.color="",this.description="",this.name="",this.id="",this.size="",this.title="",this.ariaHidden=null,this.type="",this.isActive=!1,this.isComboBoxIcon=!1,this.sizeOverrided=!1,this.iconSet="momentumUI",this.svgIcon=null,this._ariaLabel="",this.consoleHandler=(t,e)=>{switch(t){case"color-warn":console.warn(`[@momentum-ui/web-component] Icon: ${e} may not exist in the design system, please use a color name from https://momentum.design/styles/color/style`);break;case"name-error":console.warn(`[@momentum-ui/web-component] Icon: Icon ${e} does not exist in the design system. Visit https://momentum.design/icons for a list of available icons or to request a new icon.`);break;case"name-changed":console.warn(`[@momentum-ui/web-component] Icon: The name changed to '${e[0]}' before the SVG icon '${e[1]}' finished loading; skipping outdated result.`)}}}isSvgAlreadyLoaded(t){var e,i;return!!this.svgIcon&&(null===(i=null===(e=this.svgIcon)||void 0===e?void 0:e.getAttribute("class"))||void 0===i?void 0:i.includes(t))}loadSvgIcon(t){return e=this,i=void 0,n=function*(){var e,i,o,n;if(this.isSvgAlreadyLoaded(t))return;const s=null===(e=this.svgIcon)||void 0===e?void 0:e.getAttribute("class"),r="momentumBrandVisuals"===this.iconSet||"svg"===this.iconSet?yield(0,S.Jp)(this.computedSvgPath,t,"svg"):yield(0,S.D6)(t);if(!r)return;const c=null===(i=this.svgIcon)||void 0===i?void 0:i.getAttribute("class");s===c?(this.svgIcon=r,null===(o=this.svgIcon)||void 0===o||o.setAttribute("class",`icon ${t}`),null===(n=this.svgIcon)||void 0===n||n.setAttribute("part","icon"),this.setSvgIconAttributes(),this.requestUpdate()):this.consoleHandler("name-changed",[null!=c?c:"",t])},new((o=void 0)||(o=Promise))(function(t,s){function r(t){try{a(n.next(t))}catch(t){s(t)}}function c(t){try{a(n.throw(t))}catch(t){s(t)}}function a(e){var i;e.done?t(e.value):(i=e.value,i instanceof o?i:new o(function(t){t(i)})).then(r,c)}a((n=n.apply(e,i||[])).next())});var e,i,o,n}setSvgIconAttributes(){this.svgIcon&&(this.iconFontSize&&this.svgIcon.setAttribute("width",`${this.iconFontSize}px`),this.iconFontSize&&this.svgIcon.setAttribute("height",`${this.iconFontSize}px`),this.color?this.svgIcon.setAttribute("fill",this.iconColor):this.svgIcon.setAttribute("fill","currentColor"))}get computedSvgPath(){return this.svgUrl?this.svgUrl:y.O.svgIconUrl}getIsMomentumDesignName(t){return t.endsWith("-filled")||t.endsWith("-light")||t.endsWith("-regular")||t.endsWith("-bold")}get svgIconName(){if("momentumDesign"===this.iconSet||"momentumBrandVisuals"===this.iconSet||"svg"===this.iconSet)return this.name;if("preferMomentumDesign"===this.iconSet&&this.getIsMomentumDesignName(this.name))return this.name;const t=this.momentumUIIconLookupName,i=e.designLookup.get(t);return null!=i?i:t}updated(t){if(super.updated(t),this.doesIconSetSupportSVG)if(t.has("name")||t.has("iconSet")){const t=this.svgIconName;t&&"Unknown"!==t&&this.loadSvgIcon(t)}else(t.has("iconFontSize")||t.has("color"))&&this.setSvgIconAttributes()}get ariaLabel(){return this._ariaLabel?this._ariaLabel:this.title&&this.description?`${this.title} ${this.description}`:this.title?this.title:this.description?this.description:"icon"}set ariaLabel(t){const e=this._ariaLabel;this._ariaLabel=t,this.requestUpdate("ariaLabel",e)}get buttonClassMap(){return{[`md-button--icon-${this.type}`]:!!this.type}}get iconFontSize(){const t=this.name.split("_")[1];return this.size||t||16}get iconColor(){return this.color.startsWith("#")?(this.consoleHandler("color-warn",this.color),this.color):this.color.startsWith("var(")?this.color:l()(this.color)}get iconClassMap(){return{"md-combobox-input__icon":this.isComboBoxIcon,"md-combobox-input__icon--active":this.isComboBoxIcon&&this.isActive,[`${this.iconName}`]:!!this.iconName}}get momentumUIIconLookupName(){let t=this.name;return t=t.startsWith("icon-")?t.substring(5):t,t=t.split("_")[0],t}getIconName(){let t=this.name;return t=t.startsWith("icon-")?t.substring(5):t,t}handleSizeOverride(t){return`${t.split("_")[0]}_${this.iconFontSize}`}get iconName(){const t=this.getIconName();return this.sizeOverrided?this.handleSizeOverride(t):"preferMomentumDesign"===this.iconSet&&this.getIsMomentumDesignName(this.name)?"":c().includes(t)||""===t?`icon-${t}`:this.consoleHandler("name-error",t)}get iconStyleMap(){return Object.assign(Object.assign({},this.iconFontSize&&{"font-size":`${this.iconFontSize}px`}),this.color&&{color:this.iconColor})}static get styles(){return[s.A,v.A]}handleIconClick(t){this.dispatchEvent(new CustomEvent("icon-click",{bubbles:!0,composed:!0,detail:{srcEvent:t}}))}get doesIconSetSupportSVG(){return"momentumDesign"===this.iconSet||"preferMomentumDesign"===this.iconSet||"momentumBrandVisuals"===this.iconSet||"svg"===this.iconSet}get isSVGRender(){return this.svgIcon&&"preferMomentumDesign"===this.iconSet||"momentumDesign"===this.iconSet||"momentumBrandVisuals"===this.iconSet||"svg"===this.iconSet}render(){return this.isSVGRender?this.renderSVGIcon():this.renderFontIcon()}renderFontIcon(){var t;return h.html`
|
|
2
2
|
<i
|
|
3
3
|
part="icon"
|
|
4
4
|
id=${this.id}
|
|
5
|
-
class="md-icon icon ${(0,
|
|
5
|
+
class="md-icon icon ${(0,p.classMap)(this.iconClassMap)}"
|
|
6
6
|
style=${(0,m.styleMap)(this.iconStyleMap)}
|
|
7
7
|
role="img"
|
|
8
8
|
aria-label=${this.ariaLabel}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
@click=${t=>this.handleIconClick(t)}
|
|
12
12
|
>
|
|
13
13
|
</i>
|
|
14
|
-
`}renderSVGIcon(){var t;return
|
|
14
|
+
`}renderSVGIcon(){var t;return h.html`
|
|
15
15
|
<div
|
|
16
16
|
class="svg-icon-container"
|
|
17
17
|
id=${this.id}
|
|
@@ -21,6 +21,6 @@
|
|
|
21
21
|
aria-hidden=${(0,u.ifDefined)(null!==(t=this.ariaHidden)&&void 0!==t?t:void 0)}
|
|
22
22
|
@click=${t=>this.handleIconClick(t)}
|
|
23
23
|
>
|
|
24
|
-
${this.svgIcon?this.svgIcon:
|
|
24
|
+
${this.svgIcon?this.svgIcon:d.nothing}
|
|
25
25
|
</div>
|
|
26
|
-
`}};i.designLookup=new Map(Object.entries(g)),b([(0,
|
|
26
|
+
`}};i.designLookup=new Map(Object.entries(g)),b([(0,h.property)({type:String})],i.prototype,"color",void 0),b([(0,h.property)({type:String})],i.prototype,"description",void 0),b([(0,h.property)({type:String})],i.prototype,"name",void 0),b([(0,h.property)({type:String})],i.prototype,"id",void 0),b([(0,h.property)({type:String})],i.prototype,"size",void 0),b([(0,h.property)({type:String})],i.prototype,"title",void 0),b([(0,h.property)({type:String})],i.prototype,"ariaHidden",void 0),b([(0,h.property)({type:String})],i.prototype,"type",void 0),b([(0,h.property)({type:Boolean})],i.prototype,"isActive",void 0),b([(0,h.property)({type:Boolean})],i.prototype,"isComboBoxIcon",void 0),b([(0,h.property)({type:Boolean})],i.prototype,"sizeOverrided",void 0),b([(0,h.property)({type:String})],i.prototype,"iconSet",void 0),b([(0,h.property)({type:String,attribute:"svg-url"})],i.prototype,"svgUrl",void 0),b([(0,h.internalProperty)()],i.prototype,"svgIcon",void 0),b([(0,h.property)({type:String})],i.prototype,"ariaLabel",null),i=e=b([(0,n.w)("md-icon")],i),t.ELEMENT=i}(o||(o={}))}}]);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("lit-element"),require("lit-html/directives/class-map"),require("lit-html/directives/style-map"),require("lit-html"),require("lit-html/directives/if-defined"),require("@momentum-ui/icons/data/momentumUiIconsNames.json"),require("@momentum-ui/utils/lib/getColorValue"),require("mobx"));else if("function"==typeof define&&define.amd)define(["lit-element","lit-html/directives/class-map","lit-html/directives/style-map","lit-html","lit-html/directives/if-defined","@momentum-ui/icons/data/momentumUiIconsNames.json","@momentum-ui/utils/lib/getColorValue","mobx"],e);else{var i="object"==typeof exports?e(require("lit-element"),require("lit-html/directives/class-map"),require("lit-html/directives/style-map"),require("lit-html"),require("lit-html/directives/if-defined"),require("@momentum-ui/icons/data/momentumUiIconsNames.json"),require("@momentum-ui/utils/lib/getColorValue"),require("mobx")):e(t["lit-element"],t["lit-html/directives/class-map"],t["lit-html/directives/style-map"],t["lit-html"],t["lit-html/directives/if-defined"],t["@momentum-ui/icons/data/momentumUiIconsNames.json"],t["@momentum-ui/utils/lib/getColorValue"],t.mobx);for(var o in i)("object"==typeof exports?exports:t)[o]=i[o]}}(self,(t,e,i,o,n,s,r,l)=>(()=>{"use strict";var c,a={8229:t=>{t.exports=i},23968:t=>{t.exports=e},32022:t=>{t.exports=s},40333:t=>{t.exports=o},41488:e=>{e.exports=t},60554:t=>{t.exports=r},61200:(t,e,i)=>{i.r(e),i.d(e,{Icon:()=>x,iconSet:()=>I,iconSize:()=>b,iconType:()=>S}),i(96798);var o=i(31890),n=i(26272),s=i(32022),r=i.n(s),l=i(60554),c=i.n(l),a=i(41488),m=i(40333),u=i(23968),h=i(97822),d=i(8229),p=i(57955),v=i(66873),g=i(81786),y=i(9223),f=function(t,e,i,o){var n,s=arguments.length,r=s<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(r=(s<3?n(r):s>3?n(e,i,r):n(e,i))||r);return s>3&&r&&Object.defineProperty(e,i,r),r};const b=["14","16","18","20","28","36","56",14,16,18,20,28,36,56],S=["","white"],I=["momentumUI","preferMomentumDesign","momentumDesign","momentumBrandVisuals","svg"];var x;!function(t){var e;let i=e=class extends a.LitElement{constructor(){super(...arguments),this.color="",this.description="",this.name="",this.id="",this.size="",this.title="",this.ariaHidden=null,this.type="",this.isActive=!1,this.isComboBoxIcon=!1,this.sizeOverrided=!1,this.iconSet="momentumUI",this.svgIcon=null,this._ariaLabel="",this.consoleHandler=(t,e)=>{switch(t){case"color-warn":console.warn(`[@momentum-ui/web-component] Icon: ${e} may not exist in the design system, please use a color name from https://momentum.design/styles/color/style`);break;case"name-error":console.warn(`[@momentum-ui/web-component] Icon: Icon ${e} does not exist in the design system. Visit https://momentum.design/icons for a list of available icons or to request a new icon.`)}}}isSvgAlreadyLoaded(t){var e,i;return!!this.svgIcon&&(null===(i=null===(e=this.svgIcon)||void 0===e?void 0:e.getAttribute("class"))||void 0===i?void 0:i.includes(t))}loadSvgIcon(t){return e=this,i=void 0,n=function*(){var e,i;if(this.isSvgAlreadyLoaded(t))return;const
|
|
1
|
+
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("lit-element"),require("lit-html/directives/class-map"),require("lit-html/directives/style-map"),require("lit-html"),require("lit-html/directives/if-defined"),require("@momentum-ui/icons/data/momentumUiIconsNames.json"),require("@momentum-ui/utils/lib/getColorValue"),require("mobx"));else if("function"==typeof define&&define.amd)define(["lit-element","lit-html/directives/class-map","lit-html/directives/style-map","lit-html","lit-html/directives/if-defined","@momentum-ui/icons/data/momentumUiIconsNames.json","@momentum-ui/utils/lib/getColorValue","mobx"],e);else{var i="object"==typeof exports?e(require("lit-element"),require("lit-html/directives/class-map"),require("lit-html/directives/style-map"),require("lit-html"),require("lit-html/directives/if-defined"),require("@momentum-ui/icons/data/momentumUiIconsNames.json"),require("@momentum-ui/utils/lib/getColorValue"),require("mobx")):e(t["lit-element"],t["lit-html/directives/class-map"],t["lit-html/directives/style-map"],t["lit-html"],t["lit-html/directives/if-defined"],t["@momentum-ui/icons/data/momentumUiIconsNames.json"],t["@momentum-ui/utils/lib/getColorValue"],t.mobx);for(var o in i)("object"==typeof exports?exports:t)[o]=i[o]}}(self,(t,e,i,o,n,s,r,l)=>(()=>{"use strict";var c,a={8229:t=>{t.exports=i},23968:t=>{t.exports=e},32022:t=>{t.exports=s},40333:t=>{t.exports=o},41488:e=>{e.exports=t},60554:t=>{t.exports=r},61200:(t,e,i)=>{i.r(e),i.d(e,{Icon:()=>x,iconSet:()=>I,iconSize:()=>b,iconType:()=>S}),i(96798);var o=i(31890),n=i(26272),s=i(32022),r=i.n(s),l=i(60554),c=i.n(l),a=i(41488),m=i(40333),u=i(23968),h=i(97822),d=i(8229),p=i(57955),v=i(66873),g=i(81786),y=i(9223),f=function(t,e,i,o){var n,s=arguments.length,r=s<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(r=(s<3?n(r):s>3?n(e,i,r):n(e,i))||r);return s>3&&r&&Object.defineProperty(e,i,r),r};const b=["14","16","18","20","28","36","56",14,16,18,20,28,36,56],S=["","white"],I=["momentumUI","preferMomentumDesign","momentumDesign","momentumBrandVisuals","svg"];var x;!function(t){var e;let i=e=class extends a.LitElement{constructor(){super(...arguments),this.color="",this.description="",this.name="",this.id="",this.size="",this.title="",this.ariaHidden=null,this.type="",this.isActive=!1,this.isComboBoxIcon=!1,this.sizeOverrided=!1,this.iconSet="momentumUI",this.svgIcon=null,this._ariaLabel="",this.consoleHandler=(t,e)=>{switch(t){case"color-warn":console.warn(`[@momentum-ui/web-component] Icon: ${e} may not exist in the design system, please use a color name from https://momentum.design/styles/color/style`);break;case"name-error":console.warn(`[@momentum-ui/web-component] Icon: Icon ${e} does not exist in the design system. Visit https://momentum.design/icons for a list of available icons or to request a new icon.`);break;case"name-changed":console.warn(`[@momentum-ui/web-component] Icon: The name changed to '${e[0]}' before the SVG icon '${e[1]}' finished loading; skipping outdated result.`)}}}isSvgAlreadyLoaded(t){var e,i;return!!this.svgIcon&&(null===(i=null===(e=this.svgIcon)||void 0===e?void 0:e.getAttribute("class"))||void 0===i?void 0:i.includes(t))}loadSvgIcon(t){return e=this,i=void 0,n=function*(){var e,i,o,n;if(this.isSvgAlreadyLoaded(t))return;const s=null===(e=this.svgIcon)||void 0===e?void 0:e.getAttribute("class"),r="momentumBrandVisuals"===this.iconSet||"svg"===this.iconSet?yield(0,y.Jp)(this.computedSvgPath,t,"svg"):yield(0,y.D6)(t);if(!r)return;const l=null===(i=this.svgIcon)||void 0===i?void 0:i.getAttribute("class");s===l?(this.svgIcon=r,null===(o=this.svgIcon)||void 0===o||o.setAttribute("class",`icon ${t}`),null===(n=this.svgIcon)||void 0===n||n.setAttribute("part","icon"),this.setSvgIconAttributes(),this.requestUpdate()):this.consoleHandler("name-changed",[null!=l?l:"",t])},new((o=void 0)||(o=Promise))(function(t,s){function r(t){try{c(n.next(t))}catch(t){s(t)}}function l(t){try{c(n.throw(t))}catch(t){s(t)}}function c(e){var i;e.done?t(e.value):(i=e.value,i instanceof o?i:new o(function(t){t(i)})).then(r,l)}c((n=n.apply(e,i||[])).next())});var e,i,o,n}setSvgIconAttributes(){this.svgIcon&&(this.iconFontSize&&this.svgIcon.setAttribute("width",`${this.iconFontSize}px`),this.iconFontSize&&this.svgIcon.setAttribute("height",`${this.iconFontSize}px`),this.color?this.svgIcon.setAttribute("fill",this.iconColor):this.svgIcon.setAttribute("fill","currentColor"))}get computedSvgPath(){return this.svgUrl?this.svgUrl:g.O.svgIconUrl}getIsMomentumDesignName(t){return t.endsWith("-filled")||t.endsWith("-light")||t.endsWith("-regular")||t.endsWith("-bold")}get svgIconName(){if("momentumDesign"===this.iconSet||"momentumBrandVisuals"===this.iconSet||"svg"===this.iconSet)return this.name;if("preferMomentumDesign"===this.iconSet&&this.getIsMomentumDesignName(this.name))return this.name;const t=this.momentumUIIconLookupName,i=e.designLookup.get(t);return null!=i?i:t}updated(t){if(super.updated(t),this.doesIconSetSupportSVG)if(t.has("name")||t.has("iconSet")){const t=this.svgIconName;t&&"Unknown"!==t&&this.loadSvgIcon(t)}else(t.has("iconFontSize")||t.has("color"))&&this.setSvgIconAttributes()}get ariaLabel(){return this._ariaLabel?this._ariaLabel:this.title&&this.description?`${this.title} ${this.description}`:this.title?this.title:this.description?this.description:"icon"}set ariaLabel(t){const e=this._ariaLabel;this._ariaLabel=t,this.requestUpdate("ariaLabel",e)}get buttonClassMap(){return{[`md-button--icon-${this.type}`]:!!this.type}}get iconFontSize(){const t=this.name.split("_")[1];return this.size||t||16}get iconColor(){return this.color.startsWith("#")?(this.consoleHandler("color-warn",this.color),this.color):this.color.startsWith("var(")?this.color:c()(this.color)}get iconClassMap(){return{"md-combobox-input__icon":this.isComboBoxIcon,"md-combobox-input__icon--active":this.isComboBoxIcon&&this.isActive,[`${this.iconName}`]:!!this.iconName}}get momentumUIIconLookupName(){let t=this.name;return t=t.startsWith("icon-")?t.substring(5):t,t=t.split("_")[0],t}getIconName(){let t=this.name;return t=t.startsWith("icon-")?t.substring(5):t,t}handleSizeOverride(t){return`${t.split("_")[0]}_${this.iconFontSize}`}get iconName(){const t=this.getIconName();return this.sizeOverrided?this.handleSizeOverride(t):"preferMomentumDesign"===this.iconSet&&this.getIsMomentumDesignName(this.name)?"":r().includes(t)||""===t?`icon-${t}`:this.consoleHandler("name-error",t)}get iconStyleMap(){return Object.assign(Object.assign({},this.iconFontSize&&{"font-size":`${this.iconFontSize}px`}),this.color&&{color:this.iconColor})}static get styles(){return[n.A,v.A]}handleIconClick(t){this.dispatchEvent(new CustomEvent("icon-click",{bubbles:!0,composed:!0,detail:{srcEvent:t}}))}get doesIconSetSupportSVG(){return"momentumDesign"===this.iconSet||"preferMomentumDesign"===this.iconSet||"momentumBrandVisuals"===this.iconSet||"svg"===this.iconSet}get isSVGRender(){return this.svgIcon&&"preferMomentumDesign"===this.iconSet||"momentumDesign"===this.iconSet||"momentumBrandVisuals"===this.iconSet||"svg"===this.iconSet}render(){return this.isSVGRender?this.renderSVGIcon():this.renderFontIcon()}renderFontIcon(){var t;return a.html`
|
|
2
2
|
<i
|
|
3
3
|
part="icon"
|
|
4
4
|
id=${this.id}
|
package/dist/index-entry.js
CHANGED
|
@@ -1736,7 +1736,7 @@
|
|
|
1736
1736
|
<slot name="custom-right-content" part="chip-right"> </slot>
|
|
1737
1737
|
</span>
|
|
1738
1738
|
</md-tooltip>
|
|
1739
|
-
`}};c([(0,a.property)({type:String})],e.prototype,"color",void 0),c([(0,a.property)({type:String})],e.prototype,"bgColor",void 0),c([(0,a.property)({type:String})],e.prototype,"textColor",void 0),c([(0,a.property)({type:String})],e.prototype,"height",void 0),c([(0,a.property)({type:String})],e.prototype,"icon",void 0),c([(0,a.property)({type:String})],e.prototype,"iconColor",void 0),c([(0,a.property)({type:String})],e.prototype,"iconSize",void 0),c([(0,a.property)({type:String})],e.prototype,"role",void 0),c([(0,a.property)({type:String,reflect:!0})],e.prototype,"id",void 0),c([(0,a.property)({type:Boolean})],e.prototype,"small",void 0),c([(0,a.property)({type:Boolean})],e.prototype,"readonly",void 0),c([(0,a.property)({type:Boolean,reflect:!0})],e.prototype,"selected",void 0),c([(0,a.property)({type:Boolean})],e.prototype,"disabled",void 0),c([(0,a.property)({type:Number})],e.prototype,"determinateProgress",void 0),c([(0,a.property)({type:Boolean})],e.prototype,"indeterminateProgress",void 0),c([(0,a.property)({type:String})],e.prototype,"tooltipText",void 0),c([(0,a.property)({type:String})],e.prototype,"tooltipPlacement",void 0),c([(0,a.property)({type:String})],e.prototype,"iconSet",void 0),c([(0,a.property)({type:Boolean,attribute:"suppress-default-max-width"})],e.prototype,"suppressDefaultMaxWidth",void 0),c([(0,a.property)({type:Boolean})],e.prototype,"decorative",void 0),c([(0,a.property)({type:Boolean})],e.prototype,"shouldTruncateValue",void 0),c([(0,a.property)({type:String,hasChanged:(t,e)=>t!==e})],e.prototype,"value",void 0),c([(0,a.internalProperty)({hasChanged:(t,e)=>t!==e})],e.prototype,"textOverflow",void 0),c([(0,a.internalProperty)()],e.prototype,"renderedText",void 0),e=c([(0,r.w)("md-chip")],e),t.ELEMENT=e}(o||(o={}))},60554:t=>{t.exports=n},61200:(t,e,i)=>{i.d(e,{Icon:()=>o}),i(96798);var o,s=i(31890),r=i(26272),n=i(32022),a=i.n(n),l=i(60554),d=i.n(l),h=i(41488),p=i(40333),c=i(23968),u=i(97822),m=i(8229),y=i(57955),v=i(66873),b=i(81786),g=i(9223),f=function(t,e,i,o){var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};!function(t){var e;let i=e=class extends h.LitElement{constructor(){super(...arguments),this.color="",this.description="",this.name="",this.id="",this.size="",this.title="",this.ariaHidden=null,this.type="",this.isActive=!1,this.isComboBoxIcon=!1,this.sizeOverrided=!1,this.iconSet="momentumUI",this.svgIcon=null,this._ariaLabel="",this.consoleHandler=(t,e)=>{switch(t){case"color-warn":console.warn(`[@momentum-ui/web-component] Icon: ${e} may not exist in the design system, please use a color name from https://momentum.design/styles/color/style`);break;case"name-error":console.warn(`[@momentum-ui/web-component] Icon: Icon ${e} does not exist in the design system. Visit https://momentum.design/icons for a list of available icons or to request a new icon.`)}}}isSvgAlreadyLoaded(t){var e,i;return!!this.svgIcon&&(null===(i=null===(e=this.svgIcon)||void 0===e?void 0:e.getAttribute("class"))||void 0===i?void 0:i.includes(t))}loadSvgIcon(t){return e=this,i=void 0,s=function*(){var e,i;if(this.isSvgAlreadyLoaded(t))return;const
|
|
1739
|
+
`}};c([(0,a.property)({type:String})],e.prototype,"color",void 0),c([(0,a.property)({type:String})],e.prototype,"bgColor",void 0),c([(0,a.property)({type:String})],e.prototype,"textColor",void 0),c([(0,a.property)({type:String})],e.prototype,"height",void 0),c([(0,a.property)({type:String})],e.prototype,"icon",void 0),c([(0,a.property)({type:String})],e.prototype,"iconColor",void 0),c([(0,a.property)({type:String})],e.prototype,"iconSize",void 0),c([(0,a.property)({type:String})],e.prototype,"role",void 0),c([(0,a.property)({type:String,reflect:!0})],e.prototype,"id",void 0),c([(0,a.property)({type:Boolean})],e.prototype,"small",void 0),c([(0,a.property)({type:Boolean})],e.prototype,"readonly",void 0),c([(0,a.property)({type:Boolean,reflect:!0})],e.prototype,"selected",void 0),c([(0,a.property)({type:Boolean})],e.prototype,"disabled",void 0),c([(0,a.property)({type:Number})],e.prototype,"determinateProgress",void 0),c([(0,a.property)({type:Boolean})],e.prototype,"indeterminateProgress",void 0),c([(0,a.property)({type:String})],e.prototype,"tooltipText",void 0),c([(0,a.property)({type:String})],e.prototype,"tooltipPlacement",void 0),c([(0,a.property)({type:String})],e.prototype,"iconSet",void 0),c([(0,a.property)({type:Boolean,attribute:"suppress-default-max-width"})],e.prototype,"suppressDefaultMaxWidth",void 0),c([(0,a.property)({type:Boolean})],e.prototype,"decorative",void 0),c([(0,a.property)({type:Boolean})],e.prototype,"shouldTruncateValue",void 0),c([(0,a.property)({type:String,hasChanged:(t,e)=>t!==e})],e.prototype,"value",void 0),c([(0,a.internalProperty)({hasChanged:(t,e)=>t!==e})],e.prototype,"textOverflow",void 0),c([(0,a.internalProperty)()],e.prototype,"renderedText",void 0),e=c([(0,r.w)("md-chip")],e),t.ELEMENT=e}(o||(o={}))},60554:t=>{t.exports=n},61200:(t,e,i)=>{i.d(e,{Icon:()=>o}),i(96798);var o,s=i(31890),r=i(26272),n=i(32022),a=i.n(n),l=i(60554),d=i.n(l),h=i(41488),p=i(40333),c=i(23968),u=i(97822),m=i(8229),y=i(57955),v=i(66873),b=i(81786),g=i(9223),f=function(t,e,i,o){var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};!function(t){var e;let i=e=class extends h.LitElement{constructor(){super(...arguments),this.color="",this.description="",this.name="",this.id="",this.size="",this.title="",this.ariaHidden=null,this.type="",this.isActive=!1,this.isComboBoxIcon=!1,this.sizeOverrided=!1,this.iconSet="momentumUI",this.svgIcon=null,this._ariaLabel="",this.consoleHandler=(t,e)=>{switch(t){case"color-warn":console.warn(`[@momentum-ui/web-component] Icon: ${e} may not exist in the design system, please use a color name from https://momentum.design/styles/color/style`);break;case"name-error":console.warn(`[@momentum-ui/web-component] Icon: Icon ${e} does not exist in the design system. Visit https://momentum.design/icons for a list of available icons or to request a new icon.`);break;case"name-changed":console.warn(`[@momentum-ui/web-component] Icon: The name changed to '${e[0]}' before the SVG icon '${e[1]}' finished loading; skipping outdated result.`)}}}isSvgAlreadyLoaded(t){var e,i;return!!this.svgIcon&&(null===(i=null===(e=this.svgIcon)||void 0===e?void 0:e.getAttribute("class"))||void 0===i?void 0:i.includes(t))}loadSvgIcon(t){return e=this,i=void 0,s=function*(){var e,i,o,s;if(this.isSvgAlreadyLoaded(t))return;const r=null===(e=this.svgIcon)||void 0===e?void 0:e.getAttribute("class"),n="momentumBrandVisuals"===this.iconSet||"svg"===this.iconSet?yield(0,g.Jp)(this.computedSvgPath,t,"svg"):yield(0,g.D6)(t);if(!n)return;const a=null===(i=this.svgIcon)||void 0===i?void 0:i.getAttribute("class");r===a?(this.svgIcon=n,null===(o=this.svgIcon)||void 0===o||o.setAttribute("class",`icon ${t}`),null===(s=this.svgIcon)||void 0===s||s.setAttribute("part","icon"),this.setSvgIconAttributes(),this.requestUpdate()):this.consoleHandler("name-changed",[null!=a?a:"",t])},new((o=void 0)||(o=Promise))(function(t,r){function n(t){try{l(s.next(t))}catch(t){r(t)}}function a(t){try{l(s.throw(t))}catch(t){r(t)}}function l(e){var i;e.done?t(e.value):(i=e.value,i instanceof o?i:new o(function(t){t(i)})).then(n,a)}l((s=s.apply(e,i||[])).next())});var e,i,o,s}setSvgIconAttributes(){this.svgIcon&&(this.iconFontSize&&this.svgIcon.setAttribute("width",`${this.iconFontSize}px`),this.iconFontSize&&this.svgIcon.setAttribute("height",`${this.iconFontSize}px`),this.color?this.svgIcon.setAttribute("fill",this.iconColor):this.svgIcon.setAttribute("fill","currentColor"))}get computedSvgPath(){return this.svgUrl?this.svgUrl:b.O.svgIconUrl}getIsMomentumDesignName(t){return t.endsWith("-filled")||t.endsWith("-light")||t.endsWith("-regular")||t.endsWith("-bold")}get svgIconName(){if("momentumDesign"===this.iconSet||"momentumBrandVisuals"===this.iconSet||"svg"===this.iconSet)return this.name;if("preferMomentumDesign"===this.iconSet&&this.getIsMomentumDesignName(this.name))return this.name;const t=this.momentumUIIconLookupName,i=e.designLookup.get(t);return null!=i?i:t}updated(t){if(super.updated(t),this.doesIconSetSupportSVG)if(t.has("name")||t.has("iconSet")){const t=this.svgIconName;t&&"Unknown"!==t&&this.loadSvgIcon(t)}else(t.has("iconFontSize")||t.has("color"))&&this.setSvgIconAttributes()}get ariaLabel(){return this._ariaLabel?this._ariaLabel:this.title&&this.description?`${this.title} ${this.description}`:this.title?this.title:this.description?this.description:"icon"}set ariaLabel(t){const e=this._ariaLabel;this._ariaLabel=t,this.requestUpdate("ariaLabel",e)}get buttonClassMap(){return{[`md-button--icon-${this.type}`]:!!this.type}}get iconFontSize(){const t=this.name.split("_")[1];return this.size||t||16}get iconColor(){return this.color.startsWith("#")?(this.consoleHandler("color-warn",this.color),this.color):this.color.startsWith("var(")?this.color:d()(this.color)}get iconClassMap(){return{"md-combobox-input__icon":this.isComboBoxIcon,"md-combobox-input__icon--active":this.isComboBoxIcon&&this.isActive,[`${this.iconName}`]:!!this.iconName}}get momentumUIIconLookupName(){let t=this.name;return t=t.startsWith("icon-")?t.substring(5):t,t=t.split("_")[0],t}getIconName(){let t=this.name;return t=t.startsWith("icon-")?t.substring(5):t,t}handleSizeOverride(t){return`${t.split("_")[0]}_${this.iconFontSize}`}get iconName(){const t=this.getIconName();return this.sizeOverrided?this.handleSizeOverride(t):"preferMomentumDesign"===this.iconSet&&this.getIsMomentumDesignName(this.name)?"":a().includes(t)||""===t?`icon-${t}`:this.consoleHandler("name-error",t)}get iconStyleMap(){return Object.assign(Object.assign({},this.iconFontSize&&{"font-size":`${this.iconFontSize}px`}),this.color&&{color:this.iconColor})}static get styles(){return[r.A,v.A]}handleIconClick(t){this.dispatchEvent(new CustomEvent("icon-click",{bubbles:!0,composed:!0,detail:{srcEvent:t}}))}get doesIconSetSupportSVG(){return"momentumDesign"===this.iconSet||"preferMomentumDesign"===this.iconSet||"momentumBrandVisuals"===this.iconSet||"svg"===this.iconSet}get isSVGRender(){return this.svgIcon&&"preferMomentumDesign"===this.iconSet||"momentumDesign"===this.iconSet||"momentumBrandVisuals"===this.iconSet||"svg"===this.iconSet}render(){return this.isSVGRender?this.renderSVGIcon():this.renderFontIcon()}renderFontIcon(){var t;return h.html`
|
|
1740
1740
|
<i
|
|
1741
1741
|
part="icon"
|
|
1742
1742
|
id=${this.id}
|
|
@@ -163,7 +163,7 @@ export declare namespace Icon {
|
|
|
163
163
|
get buttonClassMap(): {
|
|
164
164
|
[x: string]: boolean;
|
|
165
165
|
};
|
|
166
|
-
consoleHandler: (message: string, data: string) => void;
|
|
166
|
+
consoleHandler: (message: string, data: string | string[]) => void;
|
|
167
167
|
get iconFontSize(): string | 16;
|
|
168
168
|
get iconColor(): any;
|
|
169
169
|
get iconClassMap(): {
|