@covalent/components 8.8.0 → 8.8.1
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/badge.js +1 -1
- package/badge.mjs +4 -4
- package/package.json +1 -1
package/badge.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("./query-assigned-elements-f623705d.js"),i=require("./property-57f6f6fe.js"),p=require("./class-map-b5efe8da.js"),g=`.cv-badge{background-color:var(--cv-theme-
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("./query-assigned-elements-f623705d.js"),i=require("./property-57f6f6fe.js"),p=require("./class-map-b5efe8da.js"),g=`.cv-badge{background-color:var(--cv-theme-negative);border-radius:11px;box-sizing:border-box;color:var(--cv-theme-on-negative);display:inline-block;font-family:var(--mdc-typography-caption-font-family);font-size:var(--mdc-typography-caption-font-size);font-weight:var(--mdc-typography-caption-font-weight);line-height:var(--mdc-typography-caption-line-height);height:16px;min-width:16px;padding:0 4px;position:absolute;text-align:center}.cv-badge.small{height:2px;padding:2px;min-width:2px}.cv-badge.top-right{top:-2px;right:-2px}.cv-badge.top-left{top:-2px;left:-2px}.cv-badge.bottom-right{bottom:-2px;right:-2px}.cv-badge.bottom-left{bottom:-2px;left:-2px}.cv-badge.isolated{position:relative;top:0;right:0;bottom:0;left:0}.cv-badge-container{position:relative;display:inline-flex}.wrapped-content{flex-grow:1}.hidden{display:none}
|
2
2
|
`;var c=Object.defineProperty,h=Object.getOwnPropertyDescriptor,a=(l,e,t,s)=>{for(var n=s>1?void 0:s?h(e,t):e,o=l.length-1,d;o>=0;o--)(d=l[o])&&(n=(s?d(e,t,n):d(n))||n);return s&&n&&c(e,t,n),n};exports.CovalentBadge=class extends r.s{constructor(){super(...arguments),this.max=100,this.size="large",this.hideBadge=!1,this.verticalAlignment="top",this.horizontalAlignment="right"}firstUpdated(){var t;const e=this.renderRoot.querySelector("slot");if(e&&!e.assignedNodes({flatten:!0}).filter(o=>o.nodeType===Node.ELEMENT_NODE).length){const o=this.renderRoot.querySelector("#badge-content");(t=o==null?void 0:o.classList)==null||t.add("isolated")}}getContent(){let e=this.content;const t=Number(e);return this.showZero&&e==0?e=e.toString():!isNaN(t)&&this.max&&(e=t>this.max?`${this.max}+`:t),e||""}render(){const e={"cv-badge":!0,small:this.size==="small",hidden:!!this.hideBadge||!this.showZero&&this.content==0};return e[`${this.verticalAlignment}-${this.horizontalAlignment}`]=!0,r.x`
|
3
3
|
<div class="cv-badge-container">
|
4
4
|
<slot class="wrapped-content"></slot>
|
package/badge.mjs
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
import { i as
|
1
|
+
import { i as d, r as c, s as h, x as g, e as m } from "./query-assigned-elements-4a39219d.mjs";
|
2
2
|
import { n as s } from "./property-9b6ea53b.mjs";
|
3
3
|
import { o as v } from "./class-map-4b94b017.mjs";
|
4
|
-
const f = `.cv-badge{background-color:var(--cv-theme-
|
4
|
+
const f = `.cv-badge{background-color:var(--cv-theme-negative);border-radius:11px;box-sizing:border-box;color:var(--cv-theme-on-negative);display:inline-block;font-family:var(--mdc-typography-caption-font-family);font-size:var(--mdc-typography-caption-font-size);font-weight:var(--mdc-typography-caption-font-weight);line-height:var(--mdc-typography-caption-line-height);height:16px;min-width:16px;padding:0 4px;position:absolute;text-align:center}.cv-badge.small{height:2px;padding:2px;min-width:2px}.cv-badge.top-right{top:-2px;right:-2px}.cv-badge.top-left{top:-2px;left:-2px}.cv-badge.bottom-right{bottom:-2px;right:-2px}.cv-badge.bottom-left{bottom:-2px;left:-2px}.cv-badge.isolated{position:relative;top:0;right:0;bottom:0;left:0}.cv-badge-container{position:relative;display:inline-flex}.wrapped-content{flex-grow:1}.hidden{display:none}
|
5
5
|
`;
|
6
6
|
var x = Object.defineProperty, b = Object.getOwnPropertyDescriptor, n = (t, o, a, r) => {
|
7
7
|
for (var e = r > 1 ? void 0 : r ? b(o, a) : o, l = t.length - 1, p; l >= 0; l--)
|
@@ -46,8 +46,8 @@ let i = class extends h {
|
|
46
46
|
}
|
47
47
|
};
|
48
48
|
i.styles = [
|
49
|
-
|
50
|
-
${
|
49
|
+
d`
|
50
|
+
${c(f)}
|
51
51
|
`
|
52
52
|
];
|
53
53
|
n([
|