@openremote/or-mwc-components 1.3.0-snapshot.20250117163435 → 1.3.0-snapshot.20250120082100
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/lib/or-mwc-input.d.ts +0 -8
- package/lib/or-mwc-input.js.map +1 -1
- package/package.json +5 -5
- package/src/or-mwc-input.ts +0 -8
- package/tsconfig.tsbuildinfo +1 -1
- package/stories/input/button.stories.js +0 -37
- package/stories/input/checkbox.stories.js +0 -37
- package/stories/input/color.stories.js +0 -36
- package/stories/input/date.stories.js +0 -36
- package/stories/input/general.stories.js +0 -119
- package/stories/input/input.stories.js +0 -37
- package/stories/input/select.stories.js +0 -43
- package/stories/table.stories.js +0 -73
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { getWcStorybookHelpers } from "wc-storybook-helpers";
|
|
2
|
-
import {InputType, OrMwcInput} from "@openremote/or-mwc-components/or-mwc-input";
|
|
3
|
-
import { html } from 'lit';
|
|
4
|
-
|
|
5
|
-
const { events, args, argTypes, template } = getWcStorybookHelpers("or-mwc-input");
|
|
6
|
-
|
|
7
|
-
/** @type { import('@storybook/web-components').Meta } */
|
|
8
|
-
const meta = {
|
|
9
|
-
title: "Playground/or-mwc-input/button",
|
|
10
|
-
component: "or-mwc-input",
|
|
11
|
-
args: args,
|
|
12
|
-
argTypes: {
|
|
13
|
-
...argTypes,
|
|
14
|
-
type: {
|
|
15
|
-
options: Object.values(InputType)
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
parameters: {
|
|
19
|
-
actions: {
|
|
20
|
-
handles: [...events, "or-mwc-input-changed"]
|
|
21
|
-
},
|
|
22
|
-
docs: {
|
|
23
|
-
subtitle: "<or-mwc-input>",
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
/** @type { import('@storybook/web-components').StoryObj } */
|
|
29
|
-
export const Primary = {
|
|
30
|
-
render: (args) => template(args),
|
|
31
|
-
args: {
|
|
32
|
-
type: InputType.BUTTON,
|
|
33
|
-
label: "Button"
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export default meta;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { getWcStorybookHelpers } from "wc-storybook-helpers";
|
|
2
|
-
import {InputType, OrMwcInput} from "@openremote/or-mwc-components/or-mwc-input";
|
|
3
|
-
import { html } from 'lit';
|
|
4
|
-
|
|
5
|
-
const { events, args, argTypes, template } = getWcStorybookHelpers("or-mwc-input");
|
|
6
|
-
|
|
7
|
-
/** @type { import('@storybook/web-components').Meta } */
|
|
8
|
-
const meta = {
|
|
9
|
-
title: "Playground/or-mwc-input/checkbox",
|
|
10
|
-
component: "or-mwc-input",
|
|
11
|
-
args: args,
|
|
12
|
-
argTypes: {
|
|
13
|
-
...argTypes,
|
|
14
|
-
type: {
|
|
15
|
-
options: Object.values(InputType)
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
parameters: {
|
|
19
|
-
actions: {
|
|
20
|
-
handles: [...events, "or-mwc-input-changed"]
|
|
21
|
-
},
|
|
22
|
-
docs: {
|
|
23
|
-
subtitle: "<or-mwc-input>",
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
/** @type { import('@storybook/web-components').StoryObj } */
|
|
29
|
-
export const Primary = {
|
|
30
|
-
render: (args) => template(args),
|
|
31
|
-
args: {
|
|
32
|
-
type: InputType.CHECKBOX,
|
|
33
|
-
label: "Checkbox"
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export default meta;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { getWcStorybookHelpers } from "wc-storybook-helpers";
|
|
2
|
-
import {InputType} from "@openremote/or-mwc-components/or-mwc-input";
|
|
3
|
-
import { html } from 'lit';
|
|
4
|
-
|
|
5
|
-
const { events, args, argTypes, template } = getWcStorybookHelpers("or-mwc-input");
|
|
6
|
-
|
|
7
|
-
/** @type { import('@storybook/web-components').Meta } */
|
|
8
|
-
const meta = {
|
|
9
|
-
title: "Playground/or-mwc-input/colour",
|
|
10
|
-
component: "or-mwc-input",
|
|
11
|
-
args: args,
|
|
12
|
-
argTypes: {
|
|
13
|
-
...argTypes,
|
|
14
|
-
type: {
|
|
15
|
-
options: Object.values(InputType)
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
parameters: {
|
|
19
|
-
actions: {
|
|
20
|
-
handles: [...events, "or-mwc-input-changed"]
|
|
21
|
-
},
|
|
22
|
-
docs: {
|
|
23
|
-
subtitle: "<or-mwc-input>",
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
/** @type { import('@storybook/web-components').StoryObj } */
|
|
29
|
-
export const Primary = {
|
|
30
|
-
render: (args) => template(args),
|
|
31
|
-
args: {
|
|
32
|
-
type: InputType.COLOUR
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export default meta;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { getWcStorybookHelpers } from "wc-storybook-helpers";
|
|
2
|
-
import {InputType} from "@openremote/or-mwc-components/or-mwc-input";
|
|
3
|
-
import { html } from 'lit';
|
|
4
|
-
|
|
5
|
-
const { events, args, argTypes, template } = getWcStorybookHelpers("or-mwc-input");
|
|
6
|
-
|
|
7
|
-
/** @type { import('@storybook/web-components').Meta } */
|
|
8
|
-
const meta = {
|
|
9
|
-
title: "Playground/or-mwc-input/date",
|
|
10
|
-
component: "or-mwc-input",
|
|
11
|
-
args: args,
|
|
12
|
-
argTypes: {
|
|
13
|
-
...argTypes,
|
|
14
|
-
type: {
|
|
15
|
-
options: Object.values(InputType)
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
parameters: {
|
|
19
|
-
actions: {
|
|
20
|
-
handles: [...events, "or-mwc-input-changed"]
|
|
21
|
-
},
|
|
22
|
-
docs: {
|
|
23
|
-
subtitle: "<or-mwc-input>",
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
/** @type { import('@storybook/web-components').StoryObj } */
|
|
29
|
-
export const Primary = {
|
|
30
|
-
render: (args) => template(args),
|
|
31
|
-
args: {
|
|
32
|
-
type: InputType.DATE
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export default meta;
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import {getWcStorybookHelpers} from "wc-storybook-helpers";
|
|
2
|
-
import {InputType, OrMwcInput} from "@openremote/or-mwc-components/or-mwc-input";
|
|
3
|
-
import {html} from 'lit';
|
|
4
|
-
|
|
5
|
-
const {events, args, argTypes, template} = getWcStorybookHelpers("or-mwc-input");
|
|
6
|
-
|
|
7
|
-
/** @type { import('@storybook/web-components').Meta } */
|
|
8
|
-
const meta = {
|
|
9
|
-
title: "Playground/or-mwc-input/general",
|
|
10
|
-
component: "or-mwc-input",
|
|
11
|
-
args: args,
|
|
12
|
-
argTypes: {
|
|
13
|
-
...argTypes,
|
|
14
|
-
type: {
|
|
15
|
-
options: Object.values(InputType)
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
parameters: {
|
|
19
|
-
actions: {
|
|
20
|
-
handles: [...events, "or-mwc-input-changed"]
|
|
21
|
-
},
|
|
22
|
-
docs: {
|
|
23
|
-
subtitle: "<or-mwc-input>",
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
/** @type { import('@storybook/web-components').StoryObj } */
|
|
29
|
-
export const Primary = {
|
|
30
|
-
render: (args) => template(args),
|
|
31
|
-
args: {
|
|
32
|
-
type: InputType.NUMBER,
|
|
33
|
-
value: 100
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
/** @type { import('@storybook/web-components').StoryObj } */
|
|
38
|
-
export const Select = {
|
|
39
|
-
render: (_args) => {
|
|
40
|
-
const options = [
|
|
41
|
-
["one", "One"],
|
|
42
|
-
["two", "Two"],
|
|
43
|
-
["three", "Three"],
|
|
44
|
-
["four", "Four"],
|
|
45
|
-
["five", "Five"],
|
|
46
|
-
["six", "Six"],
|
|
47
|
-
["seven", "Seven"],
|
|
48
|
-
["eight", "Eight"],
|
|
49
|
-
["nine", "Nine"],
|
|
50
|
-
["ten", "Ten"],
|
|
51
|
-
["eleven", "Eleven"],
|
|
52
|
-
["twelve", "Twelve"],
|
|
53
|
-
["thirteen", "Thirteen"],
|
|
54
|
-
["fourteen", "Fourteen"],
|
|
55
|
-
["fifteen", "Fifteen"],
|
|
56
|
-
["sixteen", "Sixteen"],
|
|
57
|
-
["seventeen", "Seventeen"],
|
|
58
|
-
["eighteen", "Eighteen"],
|
|
59
|
-
["nineteen", "Nineteen"],
|
|
60
|
-
["twenty", "Twenty"],
|
|
61
|
-
["twenty-one", "Twenty One"],
|
|
62
|
-
["twenty-two", "Twenty Two"],
|
|
63
|
-
["twenty-three", "Twenty Three"],
|
|
64
|
-
["twenty-four", "Twenty Four"],
|
|
65
|
-
["twenty-five", "Twenty Five"],
|
|
66
|
-
["twenty-six", "Twenty Six"],
|
|
67
|
-
["twenty-seven", "Twenty Seven"],
|
|
68
|
-
["twenty-eight", "Twenty Eight"],
|
|
69
|
-
["twenty-nine", "Twenty Nine"],
|
|
70
|
-
["thirty", "Thirty"]
|
|
71
|
-
];
|
|
72
|
-
const searchProviderAsync = async (search) => {
|
|
73
|
-
console.log(search);
|
|
74
|
-
return options;
|
|
75
|
-
}
|
|
76
|
-
const searchProvider = (search) => {
|
|
77
|
-
console.log(search);
|
|
78
|
-
return options;
|
|
79
|
-
}
|
|
80
|
-
return html`
|
|
81
|
-
<div style="display: flex; gap: 12px;">
|
|
82
|
-
<or-mwc-input .type="${InputType.SELECT}" .value="${options[0][0]}" .options="${options}"
|
|
83
|
-
label="Search for an async value"
|
|
84
|
-
outlined rounded .searchProvider=${searchProviderAsync} style="width: 300px;"
|
|
85
|
-
></or-mwc-input>
|
|
86
|
-
<or-mwc-input .type="${InputType.SELECT}" .value="${options[0][0]}" .options="${options}"
|
|
87
|
-
label="Search for a value"
|
|
88
|
-
outlined rounded .searchProvider=${searchProvider} style="width: 300px;"
|
|
89
|
-
></or-mwc-input>
|
|
90
|
-
<or-mwc-input .type="${InputType.SELECT}" .value="${options[0][0]}" .options="${options}" label="Select a value"
|
|
91
|
-
outlined rounded style="width: 300px;"
|
|
92
|
-
></or-mwc-input>
|
|
93
|
-
</div>
|
|
94
|
-
`;
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
/** @type { import('@storybook/web-components').StoryObj } */
|
|
99
|
-
export const Example = {
|
|
100
|
-
render: (args) => html`
|
|
101
|
-
<div style="display: flex; gap: 16px; align-items: center;">
|
|
102
|
-
${template(args[0])}
|
|
103
|
-
${template(args[1])}
|
|
104
|
-
</div>
|
|
105
|
-
`,
|
|
106
|
-
args: [{
|
|
107
|
-
type: InputType.NUMBER,
|
|
108
|
-
value: 100,
|
|
109
|
-
outlined: true,
|
|
110
|
-
comfortable: true,
|
|
111
|
-
compact: true
|
|
112
|
-
}, {
|
|
113
|
-
type: InputType.BUTTON,
|
|
114
|
-
label: "submit",
|
|
115
|
-
outlined: true
|
|
116
|
-
}]
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
export default meta;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { getWcStorybookHelpers } from "wc-storybook-helpers";
|
|
2
|
-
import {InputType} from "@openremote/or-mwc-components/or-mwc-input";
|
|
3
|
-
import { html } from 'lit';
|
|
4
|
-
|
|
5
|
-
const { events, args, argTypes, template } = getWcStorybookHelpers("or-mwc-input");
|
|
6
|
-
|
|
7
|
-
/** @type { import('@storybook/web-components').Meta } */
|
|
8
|
-
const meta = {
|
|
9
|
-
title: "Playground/or-mwc-input/input",
|
|
10
|
-
component: "or-mwc-input",
|
|
11
|
-
args: args,
|
|
12
|
-
argTypes: {
|
|
13
|
-
...argTypes,
|
|
14
|
-
type: {
|
|
15
|
-
options: Object.values(InputType)
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
parameters: {
|
|
19
|
-
actions: {
|
|
20
|
-
handles: [...events, "or-mwc-input-changed"]
|
|
21
|
-
},
|
|
22
|
-
docs: {
|
|
23
|
-
subtitle: "<or-mwc-input>",
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
/** @type { import('@storybook/web-components').StoryObj } */
|
|
29
|
-
export const Primary = {
|
|
30
|
-
render: (args) => template(args),
|
|
31
|
-
args: {
|
|
32
|
-
type: InputType.TEXT,
|
|
33
|
-
label: "Enter text"
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export default meta;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { getWcStorybookHelpers } from "wc-storybook-helpers";
|
|
2
|
-
import {InputType} from "@openremote/or-mwc-components/or-mwc-input";
|
|
3
|
-
import { html } from 'lit';
|
|
4
|
-
|
|
5
|
-
const { events, args, argTypes, template } = getWcStorybookHelpers("or-mwc-input");
|
|
6
|
-
|
|
7
|
-
/** @type { import('@storybook/web-components').Meta } */
|
|
8
|
-
const meta = {
|
|
9
|
-
title: "Playground/or-mwc-input/select",
|
|
10
|
-
component: "or-mwc-input",
|
|
11
|
-
args: args,
|
|
12
|
-
argTypes: {
|
|
13
|
-
...argTypes,
|
|
14
|
-
type: {
|
|
15
|
-
options: Object.values(InputType)
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
parameters: {
|
|
19
|
-
actions: {
|
|
20
|
-
handles: [...events, "or-mwc-input-changed"]
|
|
21
|
-
},
|
|
22
|
-
docs: {
|
|
23
|
-
subtitle: "<or-mwc-input>",
|
|
24
|
-
story: {
|
|
25
|
-
height: "240px"
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
/** @type { import('@storybook/web-components').StoryObj } */
|
|
32
|
-
export const Primary = {
|
|
33
|
-
render: (args) => template(args),
|
|
34
|
-
args: {
|
|
35
|
-
type: InputType.SELECT,
|
|
36
|
-
label: "Select amount",
|
|
37
|
-
placeHolder: "Select amount",
|
|
38
|
-
options: JSON.stringify(["One", "Two", "Three"]),
|
|
39
|
-
fullWidth: true
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export default meta;
|
package/stories/table.stories.js
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { getWcStorybookHelpers } from "wc-storybook-helpers";
|
|
2
|
-
import "@openremote/or-mwc-components/or-mwc-table";
|
|
3
|
-
|
|
4
|
-
const { events, args, argTypes, template } = getWcStorybookHelpers("or-mwc-table");
|
|
5
|
-
|
|
6
|
-
/** @type { import('@storybook/web-components').Meta } */
|
|
7
|
-
const meta = {
|
|
8
|
-
title: "Playground/or-mwc-table",
|
|
9
|
-
component: "or-mwc-table",
|
|
10
|
-
args: args,
|
|
11
|
-
argTypes: argTypes,
|
|
12
|
-
parameters: {
|
|
13
|
-
actions: {
|
|
14
|
-
handles: events
|
|
15
|
-
},
|
|
16
|
-
docs: {
|
|
17
|
-
subtitle: "<or-mwc-table>"
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
/** @type { import('@storybook/web-components').StoryObj } */
|
|
23
|
-
export const Primary = {
|
|
24
|
-
args: {
|
|
25
|
-
columns: JSON.stringify([{title: "Column 1"}, {title: "Column 2"}, {title: "Column 3"}]),
|
|
26
|
-
rows: JSON.stringify([
|
|
27
|
-
{content: ["Row 1, Column 1", "Row 1, Column 2", "Row 1, Column 3"]},
|
|
28
|
-
{content: ["Row 2, Column 1", "Row 2, Column 2", "Row 2, Column 3"]}
|
|
29
|
-
])
|
|
30
|
-
},
|
|
31
|
-
parameters: {
|
|
32
|
-
docs: {
|
|
33
|
-
source: {
|
|
34
|
-
code: getExampleCode()
|
|
35
|
-
},
|
|
36
|
-
story: {
|
|
37
|
-
height: '240px'
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
render: (args) => template(args)
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
/* ------------------------------------------------------- */
|
|
45
|
-
/* UTILITY FUNCTIONS */
|
|
46
|
-
/* ------------------------------------------------------- */
|
|
47
|
-
|
|
48
|
-
function getExampleCode() {
|
|
49
|
-
|
|
50
|
-
//language=javascript
|
|
51
|
-
return `
|
|
52
|
-
import {TableColumn, TableRow} from "@openremote/or-mwc-components/or-mwc-table";
|
|
53
|
-
import "@openremote/or-mwc-components/or-mwc-table"; // this is necessary
|
|
54
|
-
|
|
55
|
-
// Set up table columns
|
|
56
|
-
const columns: TableColumn[] = [{title: "Column 1"}, {title: "Column 2"}, {title: "Column 3"}];
|
|
57
|
-
|
|
58
|
-
// Set up table rows
|
|
59
|
-
const rows: TableRow[] = [
|
|
60
|
-
{content: ["Row 1, Column 1", "Row 1, Column 2", "Row 1, Column 3"]},
|
|
61
|
-
{content: ["Row 2, Column 1", "Row 2, Column 2", "Row 2, Column 3"]}
|
|
62
|
-
];
|
|
63
|
-
|
|
64
|
-
// (IF NOT USING LIT; you should parse the objects to JSON strings)
|
|
65
|
-
// const columnsStr = JSON.stringify(columns);
|
|
66
|
-
// const rowsStr = JSON.stringify(rows);
|
|
67
|
-
|
|
68
|
-
// in your HTML code use this, and inject them;
|
|
69
|
-
<or-mwc-table columns="columns" rows="rows"></or-mwc-table>
|
|
70
|
-
`
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export default meta;
|