Skip to content

Commit bf28de6

Browse files
committed
v1.1.4
1 parent 47daa80 commit bf28de6

File tree

11,467 files changed

+1014975
-2814
lines changed

Some content is hidden

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

11,467 files changed

+1014975
-2814
lines changed

.editorconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
root = true
2+
3+
[*]
4+
indent_style = tab
5+
indent_size = 4

.eslintignore

Lines changed: 0 additions & 4 deletions
This file was deleted.

.eslintrc.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,10 @@ module.exports = {
55
node: true,
66
es6: true,
77
},
8-
extends: ["eslint:recommended", "prettier"],
8+
extends: ["plugin:cypress/recommended", "eslint:recommended", "prettier"],
99
parserOptions: {
1010
ecmaVersion: 2020,
1111
sourceType: "module",
12-
13-
project: "./tsconfig.json",
14-
tsconfigRootDir: __dirname,
1512
extraFileExtensions: [".svelte"],
1613
},
1714
plugins: ["svelte3"],

.gitignore

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
1-
node_modules
2-
package-lock.json
3-
4-
*.zip
5-
.Ds_store
6-
*.tgz
7-
*.log
8-
.vscode
9-
.idea
10-
11-
public/demos
12-
public/dist
13-
public/stats.html
1+
dist
2+
cypress/screenshots
3+
cypress/videos

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@wx:registry=https://npm.svar.dev/

.prettierrc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"useTabs": true,
3+
"semi": true,
4+
"singleQuote": false,
5+
"quoteProps": "as-needed",
6+
"trailingComma": "es5",
7+
"bracketSpacing": true,
8+
"arrowParens": "avoid",
9+
"svelteSortOrder": "options-scripts-markup-styles",
10+
"vueIndentScriptAndStyle": true,
11+
"plugins": [
12+
"prettier-plugin-svelte"
13+
],
14+
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
15+
}

demos/Router.svelte

Lines changed: 0 additions & 36 deletions
This file was deleted.

demos/cases/Area.svelte

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<script>
2+
import { Area, Field } from "../../src/index";
3+
let v1, v2;
4+
</script>
5+
6+
<div class="demo-box">
7+
<h3>Area with a top label</h3>
8+
<Field label="Details" let:id>
9+
<Area bind:value={v1} {id} placeholder="Type here" />
10+
</Field>
11+
<Field label="Disabled" let:id>
12+
<Area bind:value={v1} {id} disabled placeholder="Type here" />
13+
</Field>
14+
<Field label="Readonly" let:id>
15+
<Area bind:value={v1} {id} readonly placeholder="Type here" />
16+
</Field>
17+
<Field label="Error" let:id error>
18+
<Area
19+
bind:value={v1}
20+
{id}
21+
error
22+
placeholder="Type here"
23+
title="It can't be empty"
24+
/>
25+
</Field>
26+
</div>
27+
28+
<div class="demo-box">
29+
<h3>Area with a side label</h3>
30+
<Field label="Details" position="left" let:id>
31+
<Area bind:value={v2} {id} placeholder="Type here" />
32+
</Field>
33+
</div>

demos/cases/Buttons.svelte

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
<script>
2+
import { Button } from "../../src/index";
3+
import { getContext } from "svelte";
4+
5+
const { showNotice } = getContext("wx-helpers");
6+
7+
function click() {
8+
showNotice({
9+
text: "Button clicked",
10+
});
11+
}
12+
</script>
13+
14+
<div class="demo-box">
15+
<h3>Default button</h3>
16+
<Button {click} title="Click me and I will do nothing">Click Me</Button>
17+
<Button disabled={true} {click}>Click Me</Button>
18+
</div>
19+
20+
<div class="demo-box">
21+
<h3>Primary button</h3>
22+
<Button type={"primary"} {click}>Click Me</Button>
23+
<Button type={"primary"} disabled={true} {click}>Click Me</Button>
24+
</div>
25+
26+
<div class="demo-box">
27+
<h3>Secondary button</h3>
28+
<Button type={"secondary"} {click}>Click Me</Button>
29+
<Button type={"secondary"} disabled={true} {click}>Click Me</Button>
30+
</div>
31+
32+
<div class="demo-box">
33+
<h3>Danger button</h3>
34+
<Button type={"danger"} {click}>Click Me</Button>
35+
<Button type={"danger"} disabled={true} {click}>Click Me</Button>
36+
</div>
37+
38+
<div class="demo-box">
39+
<h3>Link button</h3>
40+
<p>
41+
<Button type={"link"} icon="wxi-alert" {click}>Click Me</Button>
42+
</p>
43+
<p>
44+
<Button type={"link"} {click}>Click Me</Button>
45+
</p>
46+
<p>
47+
<Button type={"link"} disabled={true} {click}>Click Me</Button>
48+
</p>
49+
</div>
50+
51+
<div class="demo-box">
52+
<h3>Block buttons</h3>
53+
<p>
54+
<Button type={"primary block"}>Click Me</Button>
55+
</p>
56+
<p>
57+
<Button type={"secondary block"}>Click Me</Button>
58+
</p>
59+
<div style="display:flex;">
60+
<Button type={"secondary block"}>Click Me</Button>
61+
&nbsp;
62+
<Button type={"primary block"}>Click Me</Button>
63+
</div>
64+
</div>
65+
66+
<div class="demo-box">
67+
<h3>Icon buttons</h3>
68+
<Button icon="wxi-alert">With Icon</Button>
69+
<Button type={"primary"} icon="wxi-alert">With Icon</Button>
70+
<Button type={"secondary"} icon="wxi-alert">With Icon</Button>
71+
<Button icon="wxi-alert" />
72+
<Button type={"primary"} icon="wxi-alert" />
73+
<Button type={"secondary"} icon="wxi-alert" />
74+
<Button type={"danger"} icon="wxi-alert" />
75+
<Button disabled icon="wxi-alert" />
76+
</div>
77+
78+
<div class="demo-box">
79+
<h3>Multi-line button</h3>
80+
<p>
81+
<Button type={"primary"}>Click me<br />a few times</Button>
82+
</p>
83+
</div>

demos/common/Calendar.svelte renamed to demos/cases/Calendar.svelte

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,10 @@
1111
v >= new Date(2022, 2, 8) && v <= new Date(2022, 2, 29)
1212
? "inrange"
1313
: "";
14-
1514
</script>
1615

1716
<div class="demo-box" style="width: 300px">
18-
<h4>Calendar</h4>
17+
<h3>Calendar</h3>
1918
<div style="display: flex; flex-direction: row;">
2019
<Calendar value={new Date(2022, 2, 18)} />
2120
<Calendar current={new Date(2022, 2, 18)} markers={markLine} />
@@ -24,7 +23,7 @@
2423
</div>
2524

2625
<div class="demo-box" style="width: 300px">
27-
<h4>Calendar with Locale</h4>
26+
<h3>Calendar with Locale</h3>
2827
<div style="display: flex; flex-direction: row;">
2928
<Locale words={de}>
3029
<Calendar value={new Date(2022, 2, 18)} />
@@ -36,6 +35,6 @@
3635
</div>
3736

3837
<div class="demo-box" style="width: 300px">
39-
<h4>Calendar without buttons</h4>
38+
<h3>Calendar without buttons</h3>
4039
<Calendar value={new Date(2022, 2, 18)} buttons={false} />
4140
</div>

demos/common/Checkbox.svelte renamed to demos/cases/Checkbox.svelte

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
];
1111
1212
let v1 = true,
13-
v2,
14-
v3 = [3];
13+
v2;
1514
1615
let valueGroup1 = [1, 2];
1716
let valueGroup2 = [2, 3];
@@ -20,11 +19,10 @@
2019
function print(v) {
2120
return v.join(", ");
2221
}
23-
2422
</script>
2523

2624
<div class="demo-box">
27-
<h4>Checkbox</h4>
25+
<h3>Checkbox</h3>
2826
Value:
2927
{v1}
3028
<p>
@@ -38,34 +36,34 @@
3836
</div>
3937

4038
<div class="demo-box">
41-
<h4>Checkbox with a side label</h4>
39+
<h3>Checkbox with a side label</h3>
4240
<Field label="Checkbox" type="checkbox" position="left" let:id>
4341
<Checkbox {id} />
4442
</Field>
4543
<Field label="Disabled" type="checkbox" position="left" let:id>
4644
<Checkbox label="Default" disabled {id} />
4745
</Field>
4846
<Field label="Disabled" type="checkbox" position="left" let:id>
49-
<Checkbox label="Checked" disabled {id} value="3" bind:group={v3} />
47+
<Checkbox label="Checked" disabled {id} />
5048
</Field>
5149
</div>
5250

5351
<div class="demo-box">
54-
<h4>Checkbox group: {print(valueGroup1)}</h4>
52+
<h3>Checkbox group: {print(valueGroup1)}</h3>
5553
<Field label="Check group" position="left" type="checkbox">
5654
<CheckboxGroup {options} bind:value={valueGroup1} />
5755
</Field>
5856
</div>
5957

6058
<div class="demo-box">
61-
<h4>Checkbox group inline: {print(valueGroup2)}</h4>
59+
<h3>Checkbox group inline: {print(valueGroup2)}</h3>
6260
<Field label="Check group" position="left" type="checkbox">
6361
<CheckboxGroup {options} bind:value={valueGroup2} type="inline" />
6462
</Field>
6563
</div>
6664

6765
<div class="demo-box">
68-
<h4>Checkbox group grid: {print(valueGroup3)}</h4>
66+
<h3>Checkbox group grid: {print(valueGroup3)}</h3>
6967
<Field label="Check group" position="left" type="checkbox">
7068
<CheckboxGroup {options} bind:value={valueGroup3} type="grid" />
7169
</Field>

demos/common/ColorPicker.svelte renamed to demos/cases/ColorPicker.svelte

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,24 @@
33
44
let value;
55
let selectedColor;
6-
76
</script>
87

98
<div class="demo-box">
10-
<h4>The current color: {value || ''}</h4>
9+
<h3>The current color: {value || ""}</h3>
1110
<div style="width:300px; height: auto;">
1211
<ColorBoard bind:value />
1312
</div>
14-
<h4>The selected form color: {selectedColor || ''}</h4>
13+
<h3>The selected form color: {selectedColor || ""}</h3>
1514
<div style="width:300px; height: auto;">
1615
<ColorBoard
1716
bind:value={selectedColor}
18-
placeholder="Select a color..." />
17+
placeholder="Select a color..."
18+
/>
1919
</div>
2020
</div>
2121

2222
<div class="demo-box">
23-
<h4>Custom color select forms:</h4>
23+
<h3>Custom color select forms:</h3>
2424
<Field label="Your color" position="left" let:id>
2525
<ColorPicker value="#5D59BA" {id} placeholder="Select a color..." />
2626
</Field>
@@ -29,7 +29,8 @@
2929
{id}
3030
placeholder="Select a color..."
3131
disabled
32-
value="#65D3B3" />
32+
value="#65D3B3"
33+
/>
3334
</Field>
3435
<Field label="Error" position="left" error let:id>
3536
<ColorPicker {id} placeholder="Select a color..." error />

demos/cases/ColorSelect.svelte

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<script>
2+
import { ColorSelect, Field } from "../../src/index";
3+
4+
let color;
5+
</script>
6+
7+
<div class="demo-box">
8+
<h3>The selected color: {color ? color : ""}</h3>
9+
<Field label="Select a color" let:id>
10+
<ColorSelect
11+
bind:value={color}
12+
{id}
13+
title="Colors can be reconfigured"
14+
/>
15+
</Field>
16+
</div>
17+
18+
<div class="demo-box">
19+
<h3>Custom colors</h3>
20+
<Field label="Your color" position="left" let:id>
21+
<ColorSelect
22+
{id}
23+
colors={["#65D3B3", "#FFC975", "#58C3FE"]}
24+
placeholder="Select a color..."
25+
/>
26+
</Field>
27+
<Field label="Disabled" position="left" let:id>
28+
<ColorSelect
29+
{id}
30+
colors={["#65D3B3", "#FFC975", "#58C3FE"]}
31+
placeholder="Select a color..."
32+
disabled
33+
value="#65D3B3"
34+
/>
35+
</Field>
36+
<Field label="Error" position="left" error let:id>
37+
<ColorSelect
38+
{id}
39+
colors={["#65D3B3", "#FFC975", "#58C3FE"]}
40+
placeholder="Select a color..."
41+
error
42+
/>
43+
</Field>
44+
</div>

0 commit comments

Comments
 (0)