@wsxjs/wsx-base-components 0.0.26 → 0.0.28
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/index.cjs +5 -5
- package/dist/index.js +196 -202
- package/package.json +6 -7
- package/src/Button.wsx +1 -1
- package/src/ColorPicker.wsx +1 -1
- package/src/SvgIcon.wsx +1 -12
- package/src/ThemeSwitcher.wsx +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wsxjs/wsx-base-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.28",
|
|
4
4
|
"description": "Base UI components built with WSXJS",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
],
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"prismjs": "^1.30.0",
|
|
22
|
-
"@wsxjs/wsx-core": "0.0.
|
|
23
|
-
"@wsxjs/wsx-logger": "0.0.
|
|
22
|
+
"@wsxjs/wsx-core": "0.0.28",
|
|
23
|
+
"@wsxjs/wsx-logger": "0.0.28"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@types/prismjs": "^1.26.5",
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"typescript": "^5.0.0",
|
|
34
34
|
"vite": "^5.4.19",
|
|
35
35
|
"vitest": "^2.1.8",
|
|
36
|
-
"@wsxjs/eslint-plugin-wsx": "0.0.
|
|
37
|
-
"@wsxjs/wsx-vite-plugin": "0.0.
|
|
36
|
+
"@wsxjs/eslint-plugin-wsx": "0.0.28",
|
|
37
|
+
"@wsxjs/wsx-vite-plugin": "0.0.28"
|
|
38
38
|
},
|
|
39
39
|
"keywords": [
|
|
40
40
|
"wsx",
|
|
@@ -61,8 +61,7 @@
|
|
|
61
61
|
"typecheck": "tsc --noEmit",
|
|
62
62
|
"lint": "eslint .",
|
|
63
63
|
"lint:fix": "eslint . --fix",
|
|
64
|
-
"test": "vitest",
|
|
65
|
-
"test:run": "vitest run",
|
|
64
|
+
"test": "vitest --run",
|
|
66
65
|
"test:coverage": "vitest run --coverage",
|
|
67
66
|
"test:watch": "vitest watch"
|
|
68
67
|
}
|
package/src/Button.wsx
CHANGED
|
@@ -94,7 +94,7 @@ export default class Button extends WebComponent {
|
|
|
94
94
|
|
|
95
95
|
const linkElement = (
|
|
96
96
|
<a
|
|
97
|
-
href={this.disabled || this.loading ?
|
|
97
|
+
href={this.disabled || this.loading ? null : this.href || undefined}
|
|
98
98
|
target={this.target}
|
|
99
99
|
rel={this.rel || undefined}
|
|
100
100
|
download={this.download || undefined}
|
package/src/ColorPicker.wsx
CHANGED
|
@@ -65,7 +65,7 @@ const DEFAULT_COLORS = [
|
|
|
65
65
|
/**
|
|
66
66
|
* 颜色选择器组件 Web Component with JSX aka WSX
|
|
67
67
|
*/
|
|
68
|
-
@autoRegister({ tagName: "color-picker" })
|
|
68
|
+
@autoRegister({ tagName: "wsx-color-picker" })
|
|
69
69
|
export default class ColorPicker extends WebComponent {
|
|
70
70
|
private colorCollections: string[];
|
|
71
71
|
private onColorPicked?: (color: string) => void;
|
package/src/SvgIcon.wsx
CHANGED
|
@@ -4,7 +4,7 @@ import { createLogger } from "@wsxjs/wsx-logger";
|
|
|
4
4
|
|
|
5
5
|
const logger = createLogger("SvgIcon");
|
|
6
6
|
|
|
7
|
-
@autoRegister({ tagName: "svg-icon" })
|
|
7
|
+
@autoRegister({ tagName: "wsx-svg-icon" })
|
|
8
8
|
export default class SvgIcon extends WebComponent {
|
|
9
9
|
@state private size: number = 24;
|
|
10
10
|
@state private color: string = "currentColor";
|
|
@@ -74,15 +74,4 @@ export default class SvgIcon extends WebComponent {
|
|
|
74
74
|
const svg = event.target as SVGElement;
|
|
75
75
|
svg.style.transform = "scale(1)";
|
|
76
76
|
};
|
|
77
|
-
|
|
78
|
-
static get observedAttributes() {
|
|
79
|
-
return ["name", "size", "color"];
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
protected onAttributeChanged(name: string, oldValue: string, newValue: string): void {
|
|
83
|
-
logger.debug(`Attribute ${name} changed from ${oldValue} to ${newValue}`);
|
|
84
|
-
if (this.connected) {
|
|
85
|
-
this.rerender();
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
77
|
}
|
package/src/ThemeSwitcher.wsx
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { WebComponent, autoRegister } from "@wsxjs/wsx-core";
|
|
4
4
|
|
|
5
|
-
@autoRegister({ tagName: "theme-switcher" })
|
|
5
|
+
@autoRegister({ tagName: "wsx-theme-switcher" })
|
|
6
6
|
export default class ThemeSwitcher extends WebComponent {
|
|
7
7
|
private currentTheme: "light" | "dark" | "auto" = "auto";
|
|
8
8
|
|