lit-litelements 2.0.0 → 2.0.2

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "lit-litelements",
3
- "version": "2.0.0",
4
- "description": "My LitElement component build for loading spinner with 10 types, and chart-display",
3
+ "version": "2.0.2",
4
+ "description": "My LitElement component build for loading spinner with 10 types, and chart-display fix error hover",
5
5
  "main": "dist/main.js",
6
6
  "module": "dist/main.js",
7
7
  "types": "dist/main.d.js",
package/readme.md CHANGED
@@ -13,5 +13,51 @@
13
13
  3. backgroundColor: the color background of the spinner
14
14
  4. center: to make the spinner in the center of page or not
15
15
 
16
- ## display stock chart
17
- using chart.js to build reuse char
16
+ - ex:
17
+ <loading-spinner-element center name="spinner11" style="color: red;"></loading-spinner-element>
18
+ <loading-spinner-element center name="spinner11" style="color: red;" size="100px"></loading-spinner-element>
19
+ <loading-spinner-element center name="spinner11" style="color: red;" size="100px" backgroundColor="white"></loading-spinner-element>
20
+
21
+ ## stock-chart-display
22
+ stock-chart-display take the prop as array
23
+
24
+ dataArray=[
25
+ {
26
+ "volume": 2431872,
27
+ "open": 10.15,
28
+ "close": 9.52,
29
+ "high": 10.44,
30
+ "low": 9.32,
31
+ "date": "2024-10-23T04:00:00.000Z",
32
+ "MA20": 10.06,
33
+ "MA50": 10.29,
34
+ "MA200": 18.62,
35
+ "RSI": 63.85793018983466,
36
+ "MACDLine": 0.024551282051284318,
37
+ "SignalLine": -0.2835965963696013,
38
+ "MACDHistogram": 0.3081478784208856
39
+ },
40
+ ]
41
+ <stock-chart-display stockData=dataArray>
42
+ ## Integrate
43
+
44
+ ### angular
45
+ add to angular.json
46
+ "architect": {
47
+ "build": {
48
+ "builder": "@angular-devkit/build-angular:browser",
49
+ "options": {
50
+ ...
51
+ ],
52
+ "styles": [
53
+ ],
54
+ "scripts": [
55
+
56
+ "./node_modules/lit-litelements/dist/main.js"
57
+ ]
58
+ }
59
+ }
60
+ }
61
+
62
+ ### html
63
+ <script type="module" src="./node_modules/lit-litelements/dist/main.js"></script>
@@ -1,17 +0,0 @@
1
- import { LitElement } from "lit";
2
- declare class MyElement extends LitElement {
3
- firstName: string;
4
- lastName: string;
5
- iconSize: string;
6
- textSize: string;
7
- backgroundColor: string;
8
- static styles: import("lit").CSSResult;
9
- updated(changedProperties: any): void;
10
- render(): import("lit-html").TemplateResult<1>;
11
- }
12
- declare global {
13
- interface HTMLElementTagNameMap {
14
- "icon-element": MyElement;
15
- }
16
- }
17
- export {};
@@ -1,75 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- var __metadata = (this && this.__metadata) || function (k, v) {
8
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
- };
10
- import { LitElement, html, css } from "lit";
11
- import { customElement, property } from "lit/decorators.js";
12
- let MyElement = class MyElement extends LitElement {
13
- constructor() {
14
- super(...arguments);
15
- this.firstName = "L";
16
- this.lastName = "L";
17
- this.iconSize = "64px";
18
- this.textSize = "16px";
19
- this.backgroundColor = "red";
20
- }
21
- updated(changedProperties) {
22
- if (changedProperties.has("iconSize")) {
23
- this.style.setProperty("--lds-dual-ring-size", this.iconSize);
24
- }
25
- if (changedProperties.has("textSize")) {
26
- this.style.setProperty("--textSize", this.textSize);
27
- }
28
- if (changedProperties.has("backgroundColor")) {
29
- this.style.setProperty("--lds-backgroundColor", this.backgroundColor);
30
- }
31
- }
32
- render() {
33
- return html `
34
- <div class="icon">${this.firstName.charAt(0).toUpperCase()}${this.lastName.charAt(0).toUpperCase()}</div>
35
- `;
36
- }
37
- };
38
- MyElement.styles = css `
39
- .icon {
40
- border-radius: 50%;
41
- display: flex;
42
- justify-content: center;
43
- align-items: center;
44
- font-weight: 500;
45
- line-height: 150%;
46
- width: var(--lds-dual-ring-size, 64px);
47
- height: var(--lds-dual-ring-size, 64px);
48
- font-size: var(--textSize, 16px);
49
- background-color: var(--backgroundColor, rgb(153, 153, 153));
50
- color: black;
51
- }
52
- `;
53
- __decorate([
54
- property({ type: String }),
55
- __metadata("design:type", Object)
56
- ], MyElement.prototype, "firstName", void 0);
57
- __decorate([
58
- property({ type: String }),
59
- __metadata("design:type", Object)
60
- ], MyElement.prototype, "lastName", void 0);
61
- __decorate([
62
- property({ type: String }),
63
- __metadata("design:type", Object)
64
- ], MyElement.prototype, "iconSize", void 0);
65
- __decorate([
66
- property({ type: String }),
67
- __metadata("design:type", Object)
68
- ], MyElement.prototype, "textSize", void 0);
69
- __decorate([
70
- property({ type: String }),
71
- __metadata("design:type", Object)
72
- ], MyElement.prototype, "backgroundColor", void 0);
73
- MyElement = __decorate([
74
- customElement("icon-element")
75
- ], MyElement);