lit-litelements 1.0.2 → 2.0.0
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/component/chart.lit.d.ts +18 -0
- package/dist/component/chart.lit.js +99 -0
- package/dist/component/icon.lit.d.ts +17 -0
- package/dist/component/icon.lit.js +75 -0
- package/dist/main.d.ts +1 -1
- package/dist/main.js +529 -3
- package/package.json +10 -6
- package/readme.md +2 -27
- package/dist/component/markdown.lit.d.ts +0 -8
- package/dist/component/markdown.lit.js +0 -65
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lit-litelements",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "My LitElement component build for loading spinner with 10 types",
|
|
5
|
-
"main": "dist/main.js",
|
|
6
|
-
"module": "dist/main.js",
|
|
7
|
-
"types": "dist/main.d.js",
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"description": "My LitElement component build for loading spinner with 10 types, and chart-display",
|
|
5
|
+
"main": "dist/main.js",
|
|
6
|
+
"module": "dist/main.js",
|
|
7
|
+
"types": "dist/main.d.js",
|
|
8
8
|
"scripts": {
|
|
9
9
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
10
10
|
"start": "concurrently \"tsc --watch\" \"rollup -c --watch\"",
|
|
@@ -16,17 +16,21 @@
|
|
|
16
16
|
"keywords": [
|
|
17
17
|
"lit-element",
|
|
18
18
|
"web-components",
|
|
19
|
-
"loading-spiner"
|
|
19
|
+
"loading-spiner",
|
|
20
|
+
"chartjs",
|
|
21
|
+
"stock chart"
|
|
20
22
|
],
|
|
21
23
|
"author": "Someone using other to build",
|
|
22
24
|
"license": "ISC",
|
|
23
25
|
"dependencies": {
|
|
26
|
+
"chart.js": "^4.4.5",
|
|
24
27
|
"lit": "^3.1.4",
|
|
25
28
|
"tslib": "^2.6.3"
|
|
26
29
|
},
|
|
27
30
|
"devDependencies": {
|
|
28
31
|
"@babel/core": "^7.24.7",
|
|
29
32
|
"@babel/plugin-proposal-decorators": "^7.24.7",
|
|
33
|
+
"@babel/plugin-transform-class-properties": "^7.25.9",
|
|
30
34
|
"@babel/preset-env": "^7.24.7",
|
|
31
35
|
"@rollup/plugin-babel": "^6.0.4",
|
|
32
36
|
"@rollup/plugin-commonjs": "^26.0.1",
|
package/readme.md
CHANGED
|
@@ -13,30 +13,5 @@
|
|
|
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
|
-
|
|
17
|
-
|
|
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
|
-
## Integrate
|
|
22
|
-
|
|
23
|
-
### angular
|
|
24
|
-
add to angular.json
|
|
25
|
-
"architect": {
|
|
26
|
-
"build": {
|
|
27
|
-
"builder": "@angular-devkit/build-angular:browser",
|
|
28
|
-
"options": {
|
|
29
|
-
...
|
|
30
|
-
],
|
|
31
|
-
"styles": [
|
|
32
|
-
],
|
|
33
|
-
"scripts": [
|
|
34
|
-
|
|
35
|
-
"./node_modules/lit-litelements/dist/main.js"
|
|
36
|
-
]
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
### html
|
|
42
|
-
<script type="module" src="./node_modules/lit-litelements/dist/main.js"></script>
|
|
16
|
+
## display stock chart
|
|
17
|
+
using chart.js to build reuse char
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { LitElement } from 'lit';
|
|
2
|
-
export declare class MarkdownRenderer extends LitElement {
|
|
3
|
-
src: string;
|
|
4
|
-
static styles: import("lit").CSSResult;
|
|
5
|
-
updated(changedProperties: Map<string | number | symbol, unknown>): void;
|
|
6
|
-
private loadMarkdown;
|
|
7
|
-
render(): import("lit-html").TemplateResult<1>;
|
|
8
|
-
}
|
|
@@ -1,65 +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
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
11
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
12
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
13
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
14
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
15
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
16
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
17
|
-
});
|
|
18
|
-
};
|
|
19
|
-
import { LitElement, html, css } from 'lit';
|
|
20
|
-
import { customElement, property } from "lit/decorators.js";
|
|
21
|
-
import { marked } from 'marked';
|
|
22
|
-
let MarkdownRenderer = class MarkdownRenderer extends LitElement {
|
|
23
|
-
constructor() {
|
|
24
|
-
super(...arguments);
|
|
25
|
-
this.src = '';
|
|
26
|
-
}
|
|
27
|
-
updated(changedProperties) {
|
|
28
|
-
super.updated(changedProperties);
|
|
29
|
-
if (changedProperties.has('src')) {
|
|
30
|
-
this.loadMarkdown();
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
loadMarkdown() {
|
|
34
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
35
|
-
try {
|
|
36
|
-
const response = yield fetch(this.src);
|
|
37
|
-
const markdown = yield response.text();
|
|
38
|
-
console.log(markdown);
|
|
39
|
-
console.log(marked('# Hello \n This is **markdown** printed in the `terminal`'));
|
|
40
|
-
// const htmlContent = marked(markdown);
|
|
41
|
-
this.innerHTML = `htmlContent`;
|
|
42
|
-
}
|
|
43
|
-
catch (error) {
|
|
44
|
-
console.error('Error loading Markdown:', error);
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
render() {
|
|
49
|
-
return html `<div>hello</div>`;
|
|
50
|
-
return html `<!-- Render markdown content here dynamically -->`;
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
MarkdownRenderer.styles = css `
|
|
54
|
-
:host {
|
|
55
|
-
display: block;
|
|
56
|
-
}
|
|
57
|
-
`;
|
|
58
|
-
__decorate([
|
|
59
|
-
property({ type: String }),
|
|
60
|
-
__metadata("design:type", Object)
|
|
61
|
-
], MarkdownRenderer.prototype, "src", void 0);
|
|
62
|
-
MarkdownRenderer = __decorate([
|
|
63
|
-
customElement('markdown-renderer-element')
|
|
64
|
-
], MarkdownRenderer);
|
|
65
|
-
export { MarkdownRenderer };
|