@operato/input 1.0.0-alpha.2 → 1.0.0-alpha.20

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.
Files changed (97) hide show
  1. package/CHANGELOG.md +151 -0
  2. package/README.md +9 -6
  3. package/assets/images/icon-editor-gradient-direction.png +0 -0
  4. package/assets/images/icon-properties-label.png +0 -0
  5. package/assets/images/icon-properties-line-type.png +0 -0
  6. package/assets/images/icon-properties-table.png +0 -0
  7. package/demo/index-color-gradient.html +35 -0
  8. package/demo/index-color-stops.html +62 -0
  9. package/demo/index-color.html +35 -0
  10. package/demo/index-file.html +41 -0
  11. package/demo/index-image.html +1 -1
  12. package/demo/index-multiple-colors.html +37 -0
  13. package/demo/index-options.html +43 -0
  14. package/demo/index-range.html +40 -0
  15. package/demo/index-table.html +39 -0
  16. package/demo/index-value-map.html +80 -0
  17. package/demo/index-value-ranges.html +80 -0
  18. package/demo/index.html +19 -56
  19. package/dist/src/index.d.ts +18 -11
  20. package/dist/src/index.js +18 -11
  21. package/dist/src/index.js.map +1 -1
  22. package/dist/src/ox-checkbox.js +1 -1
  23. package/dist/src/ox-checkbox.js.map +1 -1
  24. package/dist/src/ox-input-code.d.ts +4 -4
  25. package/dist/src/ox-input-code.js +8 -8
  26. package/dist/src/ox-input-code.js.map +1 -1
  27. package/dist/src/ox-input-color-stops.d.ts +71 -0
  28. package/dist/src/ox-input-color-stops.js +445 -0
  29. package/dist/src/ox-input-color-stops.js.map +1 -0
  30. package/dist/src/ox-input-color.d.ts +176 -0
  31. package/dist/src/ox-input-color.js +298 -0
  32. package/dist/src/ox-input-color.js.map +1 -0
  33. package/dist/src/ox-input-data.d.ts +2 -2
  34. package/dist/src/ox-input-data.js +2 -2
  35. package/dist/src/ox-input-data.js.map +1 -1
  36. package/dist/src/ox-input-file.d.ts +2 -0
  37. package/dist/src/ox-input-file.js +6 -1
  38. package/dist/src/ox-input-file.js.map +1 -1
  39. package/dist/src/ox-input-layout/ox-input-card-layout.d.ts +4 -0
  40. package/dist/src/ox-input-layout/ox-input-card-layout.js +57 -0
  41. package/dist/src/ox-input-layout/ox-input-card-layout.js.map +1 -0
  42. package/dist/src/ox-input-layout/ox-input-grid-layout.d.ts +4 -0
  43. package/dist/src/ox-input-layout/ox-input-grid-layout.js +63 -0
  44. package/dist/src/ox-input-layout/ox-input-grid-layout.js.map +1 -0
  45. package/dist/src/ox-input-layout/ox-input-layout.d.ts +5 -0
  46. package/dist/src/ox-input-layout/ox-input-layout.js +73 -0
  47. package/dist/src/ox-input-layout/ox-input-layout.js.map +1 -0
  48. package/dist/src/ox-input-multiple-colors.d.ts +28 -0
  49. package/dist/src/ox-input-multiple-colors.js +113 -0
  50. package/dist/src/ox-input-multiple-colors.js.map +1 -0
  51. package/dist/src/ox-input-options.d.ts +22 -0
  52. package/dist/src/ox-input-options.js +137 -0
  53. package/dist/src/ox-input-options.js.map +1 -0
  54. package/dist/src/ox-input-range.d.ts +4 -0
  55. package/dist/src/ox-input-range.js +161 -0
  56. package/dist/src/ox-input-range.js.map +1 -0
  57. package/dist/src/{ox-input-id.d.ts → ox-input-scene-component-id.d.ts} +0 -0
  58. package/dist/src/{ox-input-id.js → ox-input-scene-component-id.js} +2 -2
  59. package/dist/src/ox-input-scene-component-id.js.map +1 -0
  60. package/dist/src/ox-input-stack.d.ts +1 -1
  61. package/dist/src/ox-input-stack.js +1 -1
  62. package/dist/src/ox-input-stack.js.map +1 -1
  63. package/dist/src/ox-input-table.d.ts +8 -0
  64. package/dist/src/ox-input-table.js +379 -0
  65. package/dist/src/ox-input-table.js.map +1 -0
  66. package/dist/src/ox-input-value-map.d.ts +41 -0
  67. package/dist/src/ox-input-value-map.js +278 -0
  68. package/dist/src/ox-input-value-map.js.map +1 -0
  69. package/dist/src/ox-input-value-ranges.d.ts +41 -0
  70. package/dist/src/ox-input-value-ranges.js +298 -0
  71. package/dist/src/ox-input-value-ranges.js.map +1 -0
  72. package/dist/tsconfig.tsbuildinfo +1 -1
  73. package/package.json +22 -7
  74. package/src/index.ts +18 -11
  75. package/src/ox-checkbox.ts +1 -1
  76. package/src/ox-input-code.ts +9 -10
  77. package/src/ox-input-color-stops.ts +499 -0
  78. package/src/ox-input-color.ts +323 -0
  79. package/src/ox-input-data.ts +5 -5
  80. package/src/ox-input-file.ts +8 -3
  81. package/src/ox-input-layout/ox-input-card-layout.ts +58 -0
  82. package/src/ox-input-layout/ox-input-grid-layout.ts +64 -0
  83. package/src/ox-input-layout/ox-input-layout.ts +77 -0
  84. package/src/ox-input-multiple-colors.ts +113 -0
  85. package/src/ox-input-options.ts +165 -0
  86. package/src/ox-input-range.ts +147 -0
  87. package/src/{ox-input-id.ts → ox-input-scene-component-id.ts} +1 -1
  88. package/src/ox-input-stack.ts +1 -1
  89. package/src/ox-input-table.ts +404 -0
  90. package/src/{ox-input-keyvalues.ts.ing → ox-input-value-map.ts} +122 -93
  91. package/src/ox-input-value-ranges.ts +325 -0
  92. package/translations/en.json +1 -0
  93. package/translations/ko.json +1 -0
  94. package/translations/ms.json +1 -0
  95. package/translations/zh.json +1 -0
  96. package/dist/src/ox-input-id.js.map +0 -1
  97. package/src/ox-input-ranges.ts.ing +0 -292
package/CHANGELOG.md CHANGED
@@ -3,6 +3,157 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.0.0-alpha.20](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.19...v1.0.0-alpha.20) (2022-03-15)
7
+
8
+ **Note:** Version bump only for package @operato/input
9
+
10
+
11
+
12
+
13
+
14
+ ## [1.0.0-alpha.19](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.18...v1.0.0-alpha.19) (2022-03-14)
15
+
16
+ **Note:** Version bump only for package @operato/input
17
+
18
+
19
+
20
+
21
+
22
+ ## [1.0.0-alpha.18](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.17...v1.0.0-alpha.18) (2022-03-14)
23
+
24
+ **Note:** Version bump only for package @operato/input
25
+
26
+
27
+
28
+
29
+
30
+ ## [1.0.0-alpha.17](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.16...v1.0.0-alpha.17) (2022-03-13)
31
+
32
+ **Note:** Version bump only for package @operato/input
33
+
34
+
35
+
36
+
37
+
38
+ ## [1.0.0-alpha.16](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.15...v1.0.0-alpha.16) (2022-03-13)
39
+
40
+ **Note:** Version bump only for package @operato/input
41
+
42
+
43
+
44
+
45
+
46
+ ## [1.0.0-alpha.15](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.14...v1.0.0-alpha.15) (2022-03-13)
47
+
48
+
49
+ ### :rocket: New Features
50
+
51
+ * migrate input, property-editor from things-factory ([dbd5e73](https://github.com/hatiolab/operato/commit/dbd5e73eac328e72c4bb7abd113a819532bc894d))
52
+
53
+
54
+
55
+ ## [1.0.0-alpha.14](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.13...v1.0.0-alpha.14) (2022-03-13)
56
+
57
+ **Note:** Version bump only for package @operato/input
58
+
59
+
60
+
61
+
62
+
63
+ ## [1.0.0-alpha.13](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.12...v1.0.0-alpha.13) (2022-03-13)
64
+
65
+
66
+ ### :bug: Bug Fix
67
+
68
+ * typos ([71447fa](https://github.com/hatiolab/operato/commit/71447fa2dfb52c5e45909baac735c2e195856256))
69
+
70
+
71
+
72
+ ## [1.0.0-alpha.12](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.11...v1.0.0-alpha.12) (2022-03-13)
73
+
74
+
75
+ ### :rocket: New Features
76
+
77
+ * migrate input, property-editor from things-factory ([4800d85](https://github.com/hatiolab/operato/commit/4800d859473bf623325233a7f2af851e5d093dcb))
78
+
79
+
80
+
81
+ ## [1.0.0-alpha.11](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.10...v1.0.0-alpha.11) (2022-03-12)
82
+
83
+ **Note:** Version bump only for package @operato/input
84
+
85
+
86
+
87
+
88
+
89
+ ## [1.0.0-alpha.10](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.9...v1.0.0-alpha.10) (2022-03-12)
90
+
91
+
92
+ ### :bug: Bug Fix
93
+
94
+ * style ([89ba680](https://github.com/hatiolab/operato/commit/89ba68072c3141b6bbcad3378cc6980670ef4198))
95
+
96
+
97
+
98
+ ## [1.0.0-alpha.9](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.8...v1.0.0-alpha.9) (2022-03-12)
99
+
100
+
101
+ ### :rocket: New Features
102
+
103
+ * settled concept for input, property-editor, grist-editor, so on ([0c9e1d0](https://github.com/hatiolab/operato/commit/0c9e1d054c7aef5d965868242cf471667af7a3c3))
104
+
105
+
106
+
107
+ ## [1.0.0-alpha.8](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.7...v1.0.0-alpha.8) (2022-03-11)
108
+
109
+ **Note:** Version bump only for package @operato/input
110
+
111
+
112
+
113
+
114
+
115
+ ## [1.0.0-alpha.7](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.6...v1.0.0-alpha.7) (2022-03-11)
116
+
117
+ **Note:** Version bump only for package @operato/input
118
+
119
+
120
+
121
+
122
+
123
+ ## [1.0.0-alpha.6](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.5...v1.0.0-alpha.6) (2022-03-11)
124
+
125
+ **Note:** Version bump only for package @operato/input
126
+
127
+
128
+
129
+
130
+
131
+ ## [1.0.0-alpha.5](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.4...v1.0.0-alpha.5) (2022-03-11)
132
+
133
+
134
+ ### :rocket: New Features
135
+
136
+ * migrate property-editor from things-factory ([272cdaa](https://github.com/hatiolab/operato/commit/272cdaafd74f3c3c597403f88655cb5cf4a81313))
137
+ * migrated property-editors from things-factory ([9d0b73a](https://github.com/hatiolab/operato/commit/9d0b73a8c05187e7ca8db874ddde8c977ec52a55))
138
+
139
+
140
+
141
+ ## [1.0.0-alpha.4](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.3...v1.0.0-alpha.4) (2022-03-11)
142
+
143
+ **Note:** Version bump only for package @operato/input
144
+
145
+
146
+
147
+
148
+
149
+ ## [1.0.0-alpha.3](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.2...v1.0.0-alpha.3) (2022-03-10)
150
+
151
+ **Note:** Version bump only for package @operato/input
152
+
153
+
154
+
155
+
156
+
6
157
  ## [1.0.0-alpha.2](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.1...v1.0.0-alpha.2) (2022-03-10)
7
158
 
8
159
  **Note:** Version bump only for package @operato/input
package/README.md CHANGED
@@ -1,21 +1,25 @@
1
- # \<property-editor>
1
+ # @operato/input module
2
2
 
3
- This webcomponent follows the [open-wc](https://github.com/open-wc/open-wc) recommendation.
3
+ 모듈에는 디펜던시가 최소화된 입력용 컴포넌트들을 포함한다.
4
+
5
+ 각 컴포넌트는 OxFormField 를 상속함으로써 폼의 입력 엘리먼트로 동작할 수 있다.
4
6
 
5
7
  ## Installation
6
8
 
7
9
  ```bash
8
- npm i property-editor
10
+ npm i @operato/input
9
11
  ```
10
12
 
11
13
  ## Usage
12
14
 
13
15
  ```html
14
16
  <script type="module">
15
- import 'property-editor/property-editor.js';
17
+ import '@operato/input/ox-input-angle.js'
16
18
  </script>
17
19
 
18
- <property-editor></property-editor>
20
+ <form>
21
+ <ox-input-angle name="angle"></ox-input-angle>
22
+ </form>
19
23
  ```
20
24
 
21
25
  ## Linting and formatting
@@ -60,7 +64,6 @@ To build a production version of Storybook, run
60
64
  npm run storybook:build
61
65
  ```
62
66
 
63
-
64
67
  ## Tooling configs
65
68
 
66
69
  For most of the tools, the configuration is in the `package.json` to reduce the amount of files in your project.
@@ -0,0 +1,35 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en-GB">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <style>
6
+ body {
7
+ background: #fafafa;
8
+ }
9
+ </style>
10
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/web-animations/2.3.2/web-animations-next-lite.min.js"></script>
11
+ </head>
12
+ <body>
13
+ <form id="demo"></form>
14
+
15
+ <script type="module">
16
+ import { html, render } from 'lit'
17
+ import '../dist/src/ox-input-color-gradient.js'
18
+
19
+ const form = document.querySelector('#demo')
20
+ render(
21
+ html`
22
+ <ox-input-color-gradient
23
+ name="color-gradient-solid"
24
+ type="solid"
25
+ @change=${e => {
26
+ console.log(e.target.value)
27
+ console.log('form value', new FormData(form).get('color-gradient-solid'))
28
+ }}
29
+ ></ox-input-color-gradient>
30
+ `,
31
+ form
32
+ )
33
+ </script>
34
+ </body>
35
+ </html>
@@ -0,0 +1,62 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en-GB">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <style>
6
+ body {
7
+ background: #fafafa;
8
+ }
9
+ </style>
10
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/web-animations/2.3.2/web-animations-next-lite.min.js"></script>
11
+ </head>
12
+ <body>
13
+ <form id="demo"></form>
14
+
15
+ <script type="module">
16
+ import { html, render } from 'lit'
17
+ import '../dist/src/ox-input-color-stops.js'
18
+
19
+ const value = [
20
+ {
21
+ position: 0,
22
+ color: 'white'
23
+ },
24
+ {
25
+ position: 0.5,
26
+ color: 'green'
27
+ },
28
+ {
29
+ position: 1,
30
+ color: 'white'
31
+ }
32
+ ]
33
+
34
+ const form = document.querySelector('#demo')
35
+ render(
36
+ html`
37
+ <ox-input-color-stops
38
+ name="color-stops-solid"
39
+ type="solid"
40
+ min="0"
41
+ max="100"
42
+ @change=${e => {
43
+ console.log(e.target.value)
44
+ console.log('form value', new FormData(form).get('color-stops-solid'))
45
+ }}
46
+ ></ox-input-color-stops>
47
+
48
+ <ox-input-color-stops
49
+ name="color-stops-gradient"
50
+ .value=${value}
51
+ type="gradient"
52
+ @change=${e => {
53
+ console.log(e.target.value)
54
+ console.log('form value', new FormData(form).get('color-stops-gradient'))
55
+ }}
56
+ ></ox-input-color-stops>
57
+ `,
58
+ form
59
+ )
60
+ </script>
61
+ </body>
62
+ </html>
@@ -0,0 +1,35 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en-GB">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <style>
6
+ body {
7
+ background: #fafafa;
8
+ }
9
+ </style>
10
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/web-animations/2.3.2/web-animations-next-lite.min.js"></script>
11
+ </head>
12
+ <body>
13
+ <form id="demo"></form>
14
+
15
+ <script type="module">
16
+ import { html, render } from 'lit'
17
+ import '../dist/src/ox-input-color.js'
18
+
19
+ const form = document.querySelector('#demo')
20
+ render(
21
+ html`
22
+ <ox-input-color
23
+ value="navy"
24
+ name="color"
25
+ @change=${e => {
26
+ console.log(e.target.value)
27
+ console.log('form value', new FormData(form).get('color'))
28
+ }}
29
+ ></ox-input-color>
30
+ `,
31
+ form
32
+ )
33
+ </script>
34
+ </body>
35
+ </html>
@@ -0,0 +1,41 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en-GB">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <style>
6
+ body {
7
+ background: #fafafa;
8
+ }
9
+
10
+ ox-input-file {
11
+ max-width: 500px;
12
+ max-height: 300px;
13
+ }
14
+ </style>
15
+ <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Material+Icons&display=block" />
16
+ </head>
17
+ <body>
18
+ <form id="demo"></form>
19
+
20
+ <script type="module">
21
+ import { html, render } from 'lit'
22
+ import '../dist/src/ox-input-file.js'
23
+
24
+ const form = document.querySelector('#demo')
25
+ render(
26
+ html`
27
+ <ox-input-file
28
+ .value=${['https://www.hatiolab.com/assets/img/arch-thingsboard.png']}
29
+ name="file"
30
+ multiple
31
+ @change=${e => {
32
+ console.log(e.target.value)
33
+ console.log('form value', new FormData(form).get('file'))
34
+ }}
35
+ ></ox-input-file>
36
+ `,
37
+ form
38
+ )
39
+ </script>
40
+ </body>
41
+ </html>
@@ -29,7 +29,7 @@
29
29
  name="image"
30
30
  @change=${e => {
31
31
  console.log(e.target.value)
32
- console.log('form value', new FormData(form).get('angle'))
32
+ console.log('form value', new FormData(form).get('image'))
33
33
  }}
34
34
  ></ox-input-image>
35
35
  `,
@@ -0,0 +1,37 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en-GB">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <style>
6
+ body {
7
+ background: #fafafa;
8
+ }
9
+ </style>
10
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/web-animations/2.3.2/web-animations-next-lite.min.js"></script>
11
+ </head>
12
+ <body>
13
+ <form id="demo"></form>
14
+
15
+ <script type="module">
16
+ import { html, render } from 'lit'
17
+ import '../dist/src/ox-input-multiple-colors.js'
18
+
19
+ const form = document.querySelector('#demo')
20
+
21
+ const value = ['yello', 'white']
22
+ render(
23
+ html`
24
+ <ox-input-multiple-colors
25
+ name="multiple-colors"
26
+ .value=${value}
27
+ @change=${e => {
28
+ console.log(e.target.value)
29
+ console.log('form value', new FormData(form).get('multiple-colors'))
30
+ }}
31
+ ></ox-input-multiple-colors>
32
+ `,
33
+ form
34
+ )
35
+ </script>
36
+ </body>
37
+ </html>
@@ -0,0 +1,43 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en-GB">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <style>
6
+ body {
7
+ background: #fafafa;
8
+ }
9
+ </style>
10
+ </head>
11
+ <body>
12
+ <form id="demo"></form>
13
+
14
+ <script type="module">
15
+ import { html, render } from 'lit'
16
+ import '../dist/src/ox-input-options.js'
17
+
18
+ const form = document.querySelector('#demo')
19
+
20
+ const value = [{ text: 'SHOOSE', value: 'Shoose' }]
21
+
22
+ const sort = () => {
23
+ const input = document.querySelector('ox-input-options')
24
+ input.sort()
25
+ }
26
+
27
+ render(
28
+ html`
29
+ <ox-input-options
30
+ name="options"
31
+ .value=${value}
32
+ @change=${e => {
33
+ console.log(e.target.value)
34
+ console.log('form value', new FormData(form).get('options'))
35
+ }}
36
+ ></ox-input-options>
37
+ <input type="button" value="Sort" @click=${e => sort()}></input>
38
+ `,
39
+ form
40
+ )
41
+ </script>
42
+ </body>
43
+ </html>
@@ -0,0 +1,40 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en-GB">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <style>
6
+ body {
7
+ background: #fafafa;
8
+ }
9
+ </style>
10
+ </head>
11
+ <body>
12
+ <form id="demo"></form>
13
+
14
+ <script type="module">
15
+ import { html, render } from 'lit'
16
+ import '../dist/src/ox-input-range.js'
17
+
18
+ const form = document.querySelector('#demo')
19
+ const placeholder = 'enter a range in degree'
20
+
21
+ render(
22
+ html`
23
+ <ox-input-range
24
+ value="1"
25
+ name="range"
26
+ step="10"
27
+ min="-300"
28
+ max="300"
29
+ placeholder=${placeholder}
30
+ @change=${e => {
31
+ console.log(e.target.value)
32
+ console.log('form value', new FormData(form).get('range'))
33
+ }}
34
+ ></ox-input-range>
35
+ `,
36
+ form
37
+ )
38
+ </script>
39
+ </body>
40
+ </html>
@@ -0,0 +1,39 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en-GB">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <style>
6
+ body {
7
+ background: #fafafa;
8
+ }
9
+ </style>
10
+
11
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/web-animations/2.3.2/web-animations-next-lite.min.js"></script>
12
+
13
+ <link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" rel="stylesheet" />
14
+ <link href="https://fonts.googleapis.com/css?family=Material+Icons&display=block" rel="stylesheet" />
15
+ </head>
16
+ <body>
17
+ <form id="demo"></form>
18
+
19
+ <script type="module">
20
+ import { html, render } from 'lit'
21
+ import '../dist/src/ox-input-table.js'
22
+
23
+ const form = document.querySelector('#demo')
24
+
25
+ render(
26
+ html`
27
+ <ox-input-table
28
+ name="table"
29
+ @change=${e => {
30
+ console.log(e.target.value)
31
+ console.log('form value', new FormData(form).get('table'))
32
+ }}
33
+ ></ox-input-table>
34
+ `,
35
+ form
36
+ )
37
+ </script>
38
+ </body>
39
+ </html>
@@ -0,0 +1,80 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en-GB">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <style>
6
+ body {
7
+ background: #fafafa;
8
+ }
9
+ </style>
10
+ </head>
11
+ <body>
12
+ <form id="demo"></form>
13
+
14
+ <script type="module">
15
+ import { html, render } from 'lit'
16
+ import '../dist/src/ox-input-value-map.js'
17
+
18
+ const form = document.querySelector('#demo')
19
+
20
+ const value1 = {
21
+ A: 'A',
22
+ B: 'B',
23
+ C: 'C',
24
+ default: 'B'
25
+ }
26
+
27
+ const value2 = {
28
+ A: true,
29
+ B: false,
30
+ C: true,
31
+ default: true
32
+ }
33
+
34
+ const value3 = {
35
+ A: 'red',
36
+ B: 'yellow',
37
+ C: 'blue',
38
+ default: 'yellow'
39
+ }
40
+
41
+ render(
42
+ html`
43
+ <ox-input-value-map
44
+ name="value-map1"
45
+ valuetype="string"
46
+ keytype="string"
47
+ .value=${value1}
48
+ @change=${e => {
49
+ console.log(e.target.value)
50
+ console.log('form value', new FormData(form).get('value-map1'))
51
+ }}
52
+ ></ox-input-value-map>
53
+
54
+ <ox-input-value-map
55
+ name="value-map2"
56
+ valuetype="boolean"
57
+ keytype="string"
58
+ .value=${value2}
59
+ @change=${e => {
60
+ console.log(e.target.value)
61
+ console.log('form value', new FormData(form).get('value-map2'))
62
+ }}
63
+ ></ox-input-value-map>
64
+
65
+ <ox-input-value-map
66
+ name="value-map3"
67
+ valuetype="color"
68
+ keytype="string"
69
+ .value=${value3}
70
+ @change=${e => {
71
+ console.log(e.target.value)
72
+ console.log('form value', new FormData(form).get('value-map3'))
73
+ }}
74
+ ></ox-input-value-map>
75
+ `,
76
+ form
77
+ )
78
+ </script>
79
+ </body>
80
+ </html>