@fluid-topics/ft-trend 2.1.19 → 2.1.20
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/build/ft-trend.js +4 -4
- package/build/ft-trend.min.js +1 -1
- package/build/ft-trend.styles.js +2 -2
- package/package.json +4 -4
package/build/ft-trend.js
CHANGED
|
@@ -6,7 +6,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
};
|
|
7
7
|
import { html } from "lit";
|
|
8
8
|
import { property } from "lit/decorators.js";
|
|
9
|
-
import { FtLitElement } from "@fluid-topics/ft-wc-utils";
|
|
9
|
+
import { FtLitElement, } from "@fluid-topics/ft-wc-utils";
|
|
10
10
|
import { FtTypography } from "@fluid-topics/ft-typography";
|
|
11
11
|
import { styles } from "./ft-trend.styles";
|
|
12
12
|
export class FtTrend extends FtLitElement {
|
|
@@ -28,9 +28,9 @@ export class FtTrend extends FtLitElement {
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
getTrendPercentage() {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
const factor = (this.currentValue - this.previousValue) / this.previousValue;
|
|
32
|
+
const percent = Math.round(100 * factor);
|
|
33
|
+
const sign = (percent >= 0) ? "+" : "-";
|
|
34
34
|
return `${sign}${Math.abs(percent)}%`;
|
|
35
35
|
}
|
|
36
36
|
render() {
|
package/build/ft-trend.min.js
CHANGED
|
@@ -5,7 +5,7 @@ Also for action icons.`,c.colorGray200),contentGlobalSubtle:r.extend("--ftds-con
|
|
|
5
5
|
.highlight-html-match {
|
|
6
6
|
background: ${Ei};
|
|
7
7
|
}
|
|
8
|
-
`;function fd(t,e,o){var n,a;let i=t.getAttribute("data-highlight-html-query");if((i??"")!==(e??"")){let s=new dd(t);if(s.unmark(),e&&e.trim()){let l={className:(n=o?.className)!==null&&n!==void 0?n:"highlight-html-match",acrossElements:!0};o?.attributes!=null&&(l.each=
|
|
8
|
+
`;function fd(t,e,o){var n,a;let i=t.getAttribute("data-highlight-html-query");if((i??"")!==(e??"")){let s=new dd(t);if(s.unmark(),e&&e.trim()){let l={className:(n=o?.className)!==null&&n!==void 0?n:"highlight-html-match",acrossElements:!0};o?.attributes!=null&&(l.each=f=>{for(let h in o.attributes)f.setAttribute(h,o.attributes[h])}),s.mark(e.replace(/"[^"]+"/g,""),{...l,separateWordSearch:!0}),((a=e.match(/"[^"]+"/g))!==null&&a!==void 0?a:[]).forEach(f=>s.mark(f.replace(/"/g,""),{...l,separateWordSearch:!1}))}}t.setAttribute("data-highlight-html-query",e??"")}var $o={};k($o,{noTextInputDefaultClearButton:()=>gd,noTextSelect:()=>pd,safariEllipsisFix:()=>yd,wordWrap:()=>hd});var pd=D`
|
|
9
9
|
.ft-no-text-select {
|
|
10
10
|
-webkit-touch-callout: none;
|
|
11
11
|
-webkit-user-select: none;
|
package/build/ft-trend.styles.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { css } from "lit";
|
|
2
|
-
import { designSystemVariables, FtCssVariableFactory } from "@fluid-topics/ft-wc-utils";
|
|
2
|
+
import { designSystemVariables, FtCssVariableFactory, } from "@fluid-topics/ft-wc-utils";
|
|
3
3
|
export const FtTrendCssVariables = {
|
|
4
4
|
textColor: FtCssVariableFactory.external(designSystemVariables.colorOnSurfaceHigh, "Design system"),
|
|
5
|
-
titleColor: FtCssVariableFactory.external(designSystemVariables.colorOnSurfaceMedium, "Design system")
|
|
5
|
+
titleColor: FtCssVariableFactory.external(designSystemVariables.colorOnSurfaceMedium, "Design system"),
|
|
6
6
|
};
|
|
7
7
|
// language=CSS
|
|
8
8
|
export const styles = css `
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/ft-trend",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.20",
|
|
4
4
|
"description": "Single stat value with a trend",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Lit"
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
"url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@fluid-topics/ft-typography": "2.1.
|
|
23
|
-
"@fluid-topics/ft-wc-utils": "2.1.
|
|
22
|
+
"@fluid-topics/ft-typography": "2.1.20",
|
|
23
|
+
"@fluid-topics/ft-wc-utils": "2.1.20",
|
|
24
24
|
"lit": "3.1.0"
|
|
25
25
|
},
|
|
26
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "77e9f03085f977dde887e175b964bf66b862253f"
|
|
27
27
|
}
|