Skip to content

Commit eb12feb

Browse files
committed
feat: fix bugs
1 parent 5039884 commit eb12feb

File tree

68 files changed

+1967
-276
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+1967
-276
lines changed

component/packages/wu-alert/public/index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<body>
88
<div id="app">
99
<div style="width: 400px; display: flex; justify-content: center; flex-direction: column; margin: 0 auto">
10-
<h4>普通用法</h4>
10+
<!--<h4>普通用法</h4>
1111
<wu-plus-alert tip="成功提示的文案" type="success" effect="dark"></wu-plus-alert>
1212
<p class="line-height"></p>
1313
<wu-plus-alert tip="消息提示的文案" type="info" effect="dark"></wu-plus-alert>
@@ -21,12 +21,12 @@ <h4>主题</h4>
2121
<wu-plus-alert tip="dark主题" type="success" effect="dark"></wu-plus-alert>
2222
<p class="line-height"></p>
2323
<wu-plus-alert tip="light主题" type="success" effect="light"></wu-plus-alert>
24-
<p class="line-height"></p>
24+
<p class="line-height"></p>-->
2525

2626
<h4>自定义关闭按钮</h4>
2727
<wu-plus-alert tip="不可关闭的 alert" type="success" closable="false"></wu-plus-alert>
2828
<p class="line-height"></p>
29-
<wu-plus-alert tip="自定义 close-text" type="info" close-text="知道了"></wu-plus-alert>
29+
<!-- <wu-plus-alert tip="自定义 close-text" type="info" close-text="知道了"></wu-plus-alert>
3030
<p class="line-height"></p>
3131
3232
<h4>自定义icon</h4>
@@ -45,7 +45,7 @@ <h4>带有辅助性文字介绍</h4>
4545
type="success" show-icon="true"
4646
description="这是一句绕口令:黑灰化肥会挥发发灰黑化肥挥发化为灰……"
4747
></wu-plus-alert>
48-
<p class="line-height"></p>
48+
<p class="line-height"></p>-->
4949
</div>
5050
</div>
5151
</body>

component/packages/wu-alert/src/index.tsx

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { h, Component, Prop, Emit, WuComponent } from '@wu-component/web-core-plus';
1+
import {h, Component, Prop, Emit, WuComponent, Fragment, OnConnected} from '@wu-component/web-core-plus';
22
import css from './index.scss';
33
type TypeEnums = 'success' | 'warning' | 'info' | 'error';
44
const TYPE_CLASSES_MAP = {
@@ -10,7 +10,7 @@ const TYPE_CLASSES_MAP = {
1010
name: 'wu-plus-alert',
1111
css: css,
1212
})
13-
export class WuAlert extends WuComponent {
13+
export class WuAlert extends WuComponent implements OnConnected {
1414
constructor() {
1515
super();
1616
}
@@ -19,6 +19,8 @@ export class WuAlert extends WuComponent {
1919
@Prop({ default: true, type: Boolean })
2020
public visible: boolean;
2121

22+
public show = true;
23+
2224
@Prop({ default: '', type: String })
2325
public tip: string;
2426

@@ -43,21 +45,31 @@ export class WuAlert extends WuComponent {
4345
@Prop({ default: 'light', type: String })
4446
public effect: string;
4547

48+
public override connected(shadowRoot: ShadowRoot) {
49+
this.show = this.visible;
50+
}
51+
4652
@Emit("confirm")
4753
public confirm() {
4854
this.visible = false;
55+
this.show = false;
56+
this.update();
4957
return this;
5058
}
5159

5260
@Emit("cancel")
5361
public cancel() {
5462
this.visible = false;
63+
this.show = false;
64+
this.update();
5565
return this;
5666
}
5767

5868
@Emit("close")
5969
public close() {
6070
this.visible = false;
71+
this.show = false;
72+
this.update();
6173
return this;
6274
}
6375

@@ -74,8 +86,8 @@ export class WuAlert extends WuComponent {
7486
}
7587

7688
public override render(_renderProps = {}, _store = {}) {
77-
if (!this.visible) {
78-
return null;
89+
if ((!this.visible) || (!this.show)) {
90+
return <Fragment></Fragment>;
7991
}
8092
return (
8193
<div class={`wu-alert ${this.typeClass} ${this.center ? "is-center" : ''} ${'is-' + this.effect}`} role="alert">

component/packages/wu-cascader/types/wu-popover/src/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { OnConnected, WuComponent } from '@wu-component/web-core-plus';
2+
// @ts-ignore
23
import { Placement } from '@popperjs/core/lib/enums';
34
export declare type TypeEnums = 'success' | 'warning' | 'info' | 'error';
45
export declare class WuPopover extends WuComponent implements OnConnected {

component/packages/wu-code-monaco-editor/src/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,17 +88,17 @@ export class WuCodeMonacoEditor extends WuComponent implements OnConnected {
8888
}
8989

9090
private async initEditor() {
91-
const initialValue = (this.props as any).initialValue || '';
91+
const initialValue = this.initialValue || '';
9292
this.initialValue = await this.formatFile(initialValue);
9393
const { editor, monacoInstance } = await createEditorByLoader(this.shadowRoot.querySelector("#container"), {
9494
value: this.initialValue,
95-
language: (this.props as any).language,
96-
theme: (this.props as any).theme,
95+
language: (this as any).language,
96+
theme: (this as any).theme,
9797
// mode: createEditorMode.call(this, (this.props as any).language, this.initialValue)
9898
});
9999
this.editor = editor;
100100
this.monacoInstance = monacoInstance;
101-
const mode = createEditorMode.call(this, (this.props as any).language, this.initialValue);
101+
const mode = createEditorMode.call(this, (this as any).language, this.initialValue);
102102
mode && editor.setModel(mode);
103103
// editor.restoreViewState(data[type].state);
104104
editor.focus();

component/packages/wu-code-sandbox/src/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export class WuMonacoEditorPreview extends WuComponent implements OnConnected {
6262
}
6363

6464
public override async connected(shadowRoot: ShadowRoot) {
65-
const initialSrcDoc = (this.props as any).initialSrcDoc;
65+
const initialSrcDoc = (this as any).initialSrcDoc;
6666
// this.container = shadowRoot.querySelector("#codeIframe");
6767
const fragment = document.createElement("div");
6868
let current = {};
@@ -136,7 +136,7 @@ export class WuMonacoEditorPreview extends WuComponent implements OnConnected {
136136
* @param code
137137
*/
138138
public runCode(type: string, code: string) {
139-
if ((this.props as any).isBeforeRefresh) {
139+
if ((this as any).isBeforeRefresh) {
140140
// 此处做了定制,webComponent 中无法重复定义元素,所以此处需要重新加载沙箱
141141
this.container.contentWindow.location.reload();
142142
// 将需要执行的代码暂存

component/packages/wu-col/index.html

Lines changed: 78 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,87 @@
33
<head>
44
<meta charset="UTF-8">
55
<title>Title</title>
6+
<script src="https://unpkg.com/@wu-component/web-core-plus@next"></script>
7+
<script src="./dist/index.umd.js"></script>
68
</head>
79
<body>
810
<div id="app">
9-
<wu-test-example></wu-test-example>
11+
<div>
12+
<div style="display: flex; align-items: center;justify-content: space-around;width: 100%">
13+
<wu-plus-row>
14+
<wu-plus-col span="12">
15+
<div style="height: 40px;background:#d3dce6">12</div>
16+
</wu-plus-col>
17+
<wu-plus-col span="12">
18+
<div style="height: 40px;background:#e5e9f2">12</div>
19+
</wu-plus-col>
20+
</wu-plus-row>
21+
</div>
22+
<div style="display: flex; align-items: center;justify-content: space-around;width: 100%; margin-top: 8px">
23+
<wu-plus-row>
24+
<wu-plus-col span="4">
25+
<div style="height: 40px;background:#d3dce6">4</div>
26+
</wu-plus-col>
27+
<wu-plus-col span="20">
28+
<div style="height: 40px;background:#e5e9f2">20</div>
29+
</wu-plus-col>
30+
</wu-plus-row>
31+
</div>
32+
<div style="display: flex; align-items: center;justify-content: space-around;width: 100%; margin-top: 8px">
33+
<wu-plus-row>
34+
<wu-plus-col span="20">
35+
<div style="height: 40px;background:#d3dce6">4</div>
36+
</wu-plus-col>
37+
<wu-plus-col span="4">
38+
<div style="height: 40px;background:#e5e9f2">20</div>
39+
</wu-plus-col>
40+
</wu-plus-row>
41+
</div>
42+
</div>
43+
44+
45+
<div>
46+
<div style="display: flex; align-items: center;justify-content: space-around;width: 100%; margin-top: 8px">
47+
<wu-plus-row type="flex" justify="space-around">
48+
<wu-plus-col span="10">
49+
<div style="height: 40px;background:#d3dce6">10</div>
50+
</wu-plus-col>
51+
<wu-plus-col span="10">
52+
<div style="height: 40px;background:#e5e9f2">10</div>
53+
</wu-plus-col>
54+
</wu-plus-row>
55+
</div>
56+
<div style="display: flex; align-items: center;justify-content: space-around;width: 100%; margin-top: 8px">
57+
<wu-plus-row type="flex" justify="start">
58+
<wu-plus-col span="10">
59+
<div style="height: 40px;background:#d3dce6">10</div>
60+
</wu-plus-col>
61+
<wu-plus-col span="10">
62+
<div style="height: 40px;background:#e5e9f2">10</div>
63+
</wu-plus-col>
64+
</wu-plus-row>
65+
</div>
66+
<div style="display: flex; align-items: center;justify-content: space-around;width: 100%; margin-top: 8px">
67+
<wu-plus-row type="flex" justify="end">
68+
<wu-plus-col span="10">
69+
<div style="height: 40px;background:#d3dce6">10</div>
70+
</wu-plus-col>
71+
<wu-plus-col span="10">
72+
<div style="height: 40px;background:#e5e9f2">10</div>
73+
</wu-plus-col>
74+
</wu-plus-row>
75+
</div>
76+
<div style="display: flex; align-items: center;justify-content: space-around;width: 100%; margin-top: 8px">
77+
<wu-plus-row type="flex" justify="center">
78+
<wu-plus-col span="10">
79+
<div style="height: 40px;background:#d3dce6">10</div>
80+
</wu-plus-col>
81+
<wu-plus-col span="10">
82+
<div style="height: 40px;background:#e5e9f2">10</div>
83+
</wu-plus-col>
84+
</wu-plus-row>
85+
</div>
86+
</div>
1087
</div>
1188
<script src="./dist/index.umd.js"></script>
1289
</body>

component/packages/wu-col/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@
8686
},
8787
"dependencies": {
8888
"@wu-component/common": "latest",
89-
"@wu-component/web-core-plus": "next"
89+
"@wu-component/web-core-plus": "next",
90+
"@wu-component/wu-row": "latest"
9091
},
9192
"files": [
9293
"dist",

component/packages/wu-col/public/index.html

Lines changed: 76 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,82 @@
66
</head>
77
<body>
88
<div id="app">
9-
<wu-test-example></wu-test-example>
9+
<div>
10+
<div style="display: flex; align-items: center;justify-content: space-around;width: 100%">
11+
<wu-plus-row>
12+
<wu-plus-col span="12">
13+
<div style="height: 40px;background:#d3dce6">12</div>
14+
</wu-plus-col>
15+
<wu-plus-col span="12">
16+
<div style="height: 40px;background:#e5e9f2">12</div>
17+
</wu-plus-col>
18+
</wu-plus-row>
19+
</div>
20+
<div style="display: flex; align-items: center;justify-content: space-around;width: 100%; margin-top: 8px">
21+
<wu-plus-row>
22+
<wu-plus-col span="4">
23+
<div style="height: 40px;background:#d3dce6">4</div>
24+
</wu-plus-col>
25+
<wu-plus-col span="20">
26+
<div style="height: 40px;background:#e5e9f2">20</div>
27+
</wu-plus-col>
28+
</wu-plus-row>
29+
</div>
30+
<div style="display: flex; align-items: center;justify-content: space-around;width: 100%; margin-top: 8px">
31+
<wu-plus-row>
32+
<wu-plus-col span="20">
33+
<div style="height: 40px;background:#d3dce6">4</div>
34+
</wu-plus-col>
35+
<wu-plus-col span="4">
36+
<div style="height: 40px;background:#e5e9f2">20</div>
37+
</wu-plus-col>
38+
</wu-plus-row>
39+
</div>
40+
</div>
41+
42+
43+
<div>
44+
<div style="display: flex; align-items: center;justify-content: space-around;width: 100%; margin-top: 8px">
45+
<wu-plus-row type="flex" justify="space-around">
46+
<wu-plus-col span="10">
47+
<div style="height: 40px;background:#d3dce6">10</div>
48+
</wu-plus-col>
49+
<wu-plus-col span="10">
50+
<div style="height: 40px;background:#e5e9f2">10</div>
51+
</wu-plus-col>
52+
</wu-plus-row>
53+
</div>
54+
<div style="display: flex; align-items: center;justify-content: space-around;width: 100%; margin-top: 8px">
55+
<wu-plus-row type="flex" justify="start">
56+
<wu-plus-col span="10">
57+
<div style="height: 40px;background:#d3dce6">10</div>
58+
</wu-plus-col>
59+
<wu-plus-col span="10">
60+
<div style="height: 40px;background:#e5e9f2">10</div>
61+
</wu-plus-col>
62+
</wu-plus-row>
63+
</div>
64+
<div style="display: flex; align-items: center;justify-content: space-around;width: 100%; margin-top: 8px">
65+
<wu-plus-row type="flex" justify="end">
66+
<wu-plus-col span="10">
67+
<div style="height: 40px;background:#d3dce6">10</div>
68+
</wu-plus-col>
69+
<wu-plus-col span="10">
70+
<div style="height: 40px;background:#e5e9f2">10</div>
71+
</wu-plus-col>
72+
</wu-plus-row>
73+
</div>
74+
<div style="display: flex; align-items: center;justify-content: space-around;width: 100%; margin-top: 8px">
75+
<wu-plus-row type="flex" justify="center">
76+
<wu-plus-col span="10">
77+
<div style="height: 40px;background:#d3dce6">10</div>
78+
</wu-plus-col>
79+
<wu-plus-col span="10">
80+
<div style="height: 40px;background:#e5e9f2">10</div>
81+
</wu-plus-col>
82+
</wu-plus-row>
83+
</div>
84+
</div>
1085
</div>
1186
</body>
1287
</html>

component/packages/wu-col/src/index.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { h, Component, Prop, WuComponent } from '@wu-component/web-core-plus';
22
import css from './index.scss';
33
import { extractClass } from '@wu-component/common';
4+
import "@wu-component/wu-row";
45

56
@Component({
67
name: 'wu-plus-col',
@@ -15,7 +16,7 @@ export class WuCol extends WuComponent {
1516
public tag: string;
1617

1718
@Prop({ default: 24, type: Number })
18-
public span: number;
19+
public span: number = 24;
1920

2021
@Prop({ default: '', type: Number })
2122
public offset: number;
@@ -31,13 +32,15 @@ export class WuCol extends WuComponent {
3132
const classListMap: Record<string, boolean> = {};
3233
const style: Record<string, string> = {};
3334
[ 'span', 'offset', 'pull', 'push' ].forEach(prop => {
35+
console.log(prop, this[prop]);
3436
if (this[prop] || this[prop] === 0) {
3537
const name = prop !== 'span' ? `wu-col-${prop}-${this[prop]}` : `wu-col-${this[prop]}`;
3638
classList.push(name);
3739
classListMap[name] = true;
3840
}
3941
});
4042
return (
43+
// @ts-ignore
4144
<this.tag
4245
style={{ ...style }}
4346
{...extractClass({}, `wu-col`, {

component/packages/wu-container/package.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,20 @@
8686
},
8787
"dependencies": {
8888
"@wu-component/common": "latest",
89+
"@wu-component/wu-footer": "latest",
90+
"@wu-component/wu-aside": "latest",
91+
"@wu-component/wu-main": "latest",
92+
"@wu-component/wu-header": "latest",
8993
"@wu-component/web-core-plus": "next"
9094
},
95+
"peerDependencies": {
96+
"@wu-component/common": "latest",
97+
"@wu-component/wu-footer": "latest",
98+
"@wu-component/wu-aside": "latest",
99+
"@wu-component/wu-main": "latest",
100+
"@wu-component/wu-header": "latest",
101+
"@wu-component/web-core-plus": "next"
102+
},
91103
"files": [
92104
"dist",
93105
"src",

0 commit comments

Comments
 (0)