@operato/form 8.0.0 → 9.0.0-beta.10
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/CHANGELOG.md +190 -17
- package/dist/src/components/ox-custom-input.js +61 -3
- package/dist/src/components/ox-custom-input.js.map +1 -1
- package/dist/src/components/ox-custom-select.js +49 -3
- package/dist/src/components/ox-custom-select.js.map +1 -1
- package/dist/src/components/ox-file-uploader.js +38 -6
- package/dist/src/components/ox-file-uploader.js.map +1 -1
- package/dist/src/components/ox-form-master.js +61 -6
- package/dist/src/components/ox-form-master.js.map +1 -1
- package/dist/src/components/ox-form-paginator.js +25 -5
- package/dist/src/components/ox-form-paginator.js.map +1 -1
- package/dist/src/components/ox-search-form-paginator.js +19 -4
- package/dist/src/components/ox-search-form-paginator.js.map +1 -1
- package/dist/src/components/ox-search-form.js +53 -9
- package/dist/src/components/ox-search-form.js.map +1 -1
- package/dist/src/filters/ox-filter-personalizer.js +20 -4
- package/dist/src/filters/ox-filter-personalizer.js.map +1 -1
- package/dist/src/filters/ox-filters-form-base.js +77 -10
- package/dist/src/filters/ox-filters-form-base.js.map +1 -1
- package/dist/src/index.d.ts +4 -4
- package/dist/src/index.js +4 -4
- package/dist/src/index.js.map +1 -1
- package/dist/src/styles/index.d.ts +3 -3
- package/dist/src/styles/index.js +3 -3
- package/dist/src/styles/index.js.map +1 -1
- package/dist/src/types.d.ts +2 -2
- package/dist/src/types.js.map +1 -1
- package/dist/stories/ox-filters-form-barcode.stories.js +1 -1
- package/dist/stories/ox-filters-form-barcode.stories.js.map +1 -1
- package/dist/stories/ox-filters-form-base-bounded.stories.js +1 -1
- package/dist/stories/ox-filters-form-base-bounded.stories.js.map +1 -1
- package/dist/stories/ox-filters-form-base-change-handler.stories.js +1 -1
- package/dist/stories/ox-filters-form-base-change-handler.stories.js.map +1 -1
- package/dist/stories/ox-filters-form-base.stories.js +1 -1
- package/dist/stories/ox-filters-form-base.stories.js.map +1 -1
- package/dist/stories/ox-search-form-change-handler.stories.js +1 -1
- package/dist/stories/ox-search-form-change-handler.stories.js.map +1 -1
- package/dist/stories/ox-search-form.stories.js +1 -1
- package/dist/stories/ox-search-form.stories.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +16 -15
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,16 @@
|
|
|
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
|
-
## [
|
|
6
|
+
## [9.0.0-beta.10](https://github.com/hatiolab/operato/compare/v9.0.0-beta.9...v9.0.0-beta.10) (2025-01-25)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### :bug: Bug Fix
|
|
10
|
+
|
|
11
|
+
* tweak tsconfig.json ([3c424b1](https://github.com/hatiolab/operato/commit/3c424b18d046f95d5619076d113d49a4b4dc9bbb))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## [9.0.0-beta.7](https://github.com/hatiolab/operato/compare/v9.0.0-beta.6...v9.0.0-beta.7) (2025-01-20)
|
|
7
16
|
|
|
8
17
|
**Note:** Version bump only for package @operato/form
|
|
9
18
|
|
|
@@ -11,17 +20,42 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
11
20
|
|
|
12
21
|
|
|
13
22
|
|
|
14
|
-
|
|
23
|
+
## [9.0.0-beta.6](https://github.com/hatiolab/operato/compare/v9.0.0-beta.5...v9.0.0-beta.6) (2025-01-20)
|
|
15
24
|
|
|
16
25
|
|
|
17
26
|
### :bug: Bug Fix
|
|
18
27
|
|
|
19
|
-
*
|
|
20
|
-
|
|
28
|
+
* esm module ([9642b97](https://github.com/hatiolab/operato/commit/9642b97650623d9ce71f6db0fd1995a2379205b5))
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
## [9.0.0-beta.5](https://github.com/hatiolab/operato/compare/v9.0.0-beta.4...v9.0.0-beta.5) (2025-01-20)
|
|
21
33
|
|
|
22
34
|
|
|
35
|
+
### :bug: Bug Fix
|
|
36
|
+
|
|
37
|
+
* esm module ([1319b00](https://github.com/hatiolab/operato/commit/1319b00d6955a514f63b3469fb514a28f84168a2))
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
## [9.0.0-beta.4](https://github.com/hatiolab/operato/compare/v9.0.0-beta.3...v9.0.0-beta.4) (2025-01-20)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
### :bug: Bug Fix
|
|
45
|
+
|
|
46
|
+
* esm module ([0402232](https://github.com/hatiolab/operato/commit/04022327fa47eac64eaf3c56eeec55b9ace13e0e))
|
|
23
47
|
|
|
24
|
-
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
## [9.0.0-beta.0](https://github.com/hatiolab/operato/compare/v8.0.0-beta.11...v9.0.0-beta.0) (2025-01-13)
|
|
51
|
+
|
|
52
|
+
**Note:** Version bump only for package @operato/form
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
## [8.0.0-beta.5](https://github.com/hatiolab/operato/compare/v8.0.0-beta.4...v8.0.0-beta.5) (2025-01-10)
|
|
25
59
|
|
|
26
60
|
**Note:** Version bump only for package @operato/form
|
|
27
61
|
|
|
@@ -29,16 +63,49 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
29
63
|
|
|
30
64
|
|
|
31
65
|
|
|
32
|
-
|
|
66
|
+
## [8.0.0-beta.2](https://github.com/hatiolab/operato/compare/v8.0.0-beta.1...v8.0.0-beta.2) (2025-01-08)
|
|
33
67
|
|
|
34
68
|
|
|
35
69
|
### :bug: Bug Fix
|
|
36
70
|
|
|
37
|
-
*
|
|
71
|
+
* typo .npmignore ([d9c0c8c](https://github.com/hatiolab/operato/commit/d9c0c8c79abc688c3c2cfb6c37fcb689483a5977))
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
## [8.0.0-beta.1](https://github.com/hatiolab/operato/compare/v8.0.0-beta.0...v8.0.0-beta.1) (2025-01-08)
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
### :bug: Bug Fix
|
|
79
|
+
|
|
80
|
+
* missing .npmignore ([be05985](https://github.com/hatiolab/operato/commit/be05985abfae4af53501f718dd52932099f7fbcb))
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
## [8.0.0-beta.0](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.56...v8.0.0-beta.0) (2025-01-07)
|
|
85
|
+
|
|
86
|
+
**Note:** Version bump only for package @operato/form
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
## [8.0.0-alpha.51](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.50...v8.0.0-alpha.51) (2024-11-29)
|
|
93
|
+
|
|
94
|
+
**Note:** Version bump only for package @operato/form
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
## [8.0.0-alpha.50](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.49...v8.0.0-alpha.50) (2024-11-16)
|
|
101
|
+
|
|
102
|
+
**Note:** Version bump only for package @operato/form
|
|
103
|
+
|
|
104
|
+
|
|
38
105
|
|
|
39
106
|
|
|
40
107
|
|
|
41
|
-
|
|
108
|
+
## [8.0.0-alpha.46](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.45...v8.0.0-alpha.46) (2024-10-23)
|
|
42
109
|
|
|
43
110
|
**Note:** Version bump only for package @operato/form
|
|
44
111
|
|
|
@@ -46,7 +113,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
46
113
|
|
|
47
114
|
|
|
48
115
|
|
|
49
|
-
|
|
116
|
+
## [8.0.0-alpha.45](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.44...v8.0.0-alpha.45) (2024-10-23)
|
|
50
117
|
|
|
51
118
|
**Note:** Version bump only for package @operato/form
|
|
52
119
|
|
|
@@ -54,7 +121,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
54
121
|
|
|
55
122
|
|
|
56
123
|
|
|
57
|
-
|
|
124
|
+
## [8.0.0-alpha.41](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.40...v8.0.0-alpha.41) (2024-10-21)
|
|
58
125
|
|
|
59
126
|
**Note:** Version bump only for package @operato/form
|
|
60
127
|
|
|
@@ -62,25 +129,131 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
62
129
|
|
|
63
130
|
|
|
64
131
|
|
|
65
|
-
|
|
132
|
+
## [8.0.0-alpha.37](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.36...v8.0.0-alpha.37) (2024-10-20)
|
|
66
133
|
|
|
67
134
|
|
|
68
135
|
### :bug: Bug Fix
|
|
69
136
|
|
|
70
|
-
*
|
|
137
|
+
* update dev-dependencies version ([d6fe342](https://github.com/hatiolab/operato/commit/d6fe342de738c6bad3528550a862b5a1d2573161))
|
|
71
138
|
|
|
72
139
|
|
|
73
140
|
|
|
74
|
-
|
|
141
|
+
## [8.0.0-alpha.34](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.33...v8.0.0-alpha.34) (2024-10-15)
|
|
142
|
+
|
|
143
|
+
**Note:** Version bump only for package @operato/form
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
## [8.0.0-alpha.33](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.32...v8.0.0-alpha.33) (2024-10-14)
|
|
150
|
+
|
|
151
|
+
**Note:** Version bump only for package @operato/form
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
## [8.0.0-alpha.30](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.29...v8.0.0-alpha.30) (2024-10-11)
|
|
158
|
+
|
|
159
|
+
**Note:** Version bump only for package @operato/form
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
## [8.0.0-alpha.29](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.28...v8.0.0-alpha.29) (2024-10-10)
|
|
166
|
+
|
|
167
|
+
**Note:** Version bump only for package @operato/form
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
## [8.0.0-alpha.27](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.26...v8.0.0-alpha.27) (2024-10-06)
|
|
75
174
|
|
|
76
175
|
|
|
77
176
|
### :bug: Bug Fix
|
|
78
177
|
|
|
79
|
-
*
|
|
178
|
+
* calendar css variables ([9ea1918](https://github.com/hatiolab/operato/commit/9ea191844c72de5f920a8da85ad50209ba77cc07))
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
## [8.0.0-alpha.26](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.25...v8.0.0-alpha.26) (2024-10-06)
|
|
183
|
+
|
|
184
|
+
**Note:** Version bump only for package @operato/form
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
## [8.0.0-alpha.21](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.20...v8.0.0-alpha.21) (2024-10-05)
|
|
191
|
+
|
|
192
|
+
**Note:** Version bump only for package @operato/form
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
## [8.0.0-alpha.20](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.19...v8.0.0-alpha.20) (2024-10-04)
|
|
199
|
+
|
|
200
|
+
**Note:** Version bump only for package @operato/form
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
## [8.0.0-alpha.19](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.18...v8.0.0-alpha.19) (2024-10-04)
|
|
207
|
+
|
|
208
|
+
**Note:** Version bump only for package @operato/form
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
## [8.0.0-alpha.11](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.10...v8.0.0-alpha.11) (2024-09-21)
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
### :bug: Bug Fix
|
|
218
|
+
|
|
219
|
+
* ox-filters-form-base 수정 (value 세팅 중복 X) ([530254b](https://github.com/hatiolab/operato/commit/530254b9da4c908b85e55cb6e28c00248d69da4c))
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
## [8.0.0-alpha.10](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.9...v8.0.0-alpha.10) (2024-09-18)
|
|
224
|
+
|
|
225
|
+
**Note:** Version bump only for package @operato/form
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
## [8.0.0-alpha.6](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.5...v8.0.0-alpha.6) (2024-09-14)
|
|
232
|
+
|
|
233
|
+
**Note:** Version bump only for package @operato/form
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
## [8.0.0-alpha.4](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.3...v8.0.0-alpha.4) (2024-09-07)
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
### :bug: Bug Fix
|
|
243
|
+
|
|
244
|
+
* dataset components & styles ([be44acd](https://github.com/hatiolab/operato/commit/be44acde8f25980e5b27afc481a2c149f8c23dbd))
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
## [8.0.0-alpha.3](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.2...v8.0.0-alpha.3) (2024-09-06)
|
|
249
|
+
|
|
250
|
+
**Note:** Version bump only for package @operato/form
|
|
251
|
+
|
|
252
|
+
|
|
80
253
|
|
|
81
254
|
|
|
82
255
|
|
|
83
|
-
|
|
256
|
+
## [8.0.0-alpha.2](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.1...v8.0.0-alpha.2) (2024-09-05)
|
|
84
257
|
|
|
85
258
|
**Note:** Version bump only for package @operato/form
|
|
86
259
|
|
|
@@ -88,7 +261,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
88
261
|
|
|
89
262
|
|
|
90
263
|
|
|
91
|
-
|
|
264
|
+
## [8.0.0-alpha.1](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.0...v8.0.0-alpha.1) (2024-09-04)
|
|
92
265
|
|
|
93
266
|
**Note:** Version bump only for package @operato/form
|
|
94
267
|
|
|
@@ -96,7 +269,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
96
269
|
|
|
97
270
|
|
|
98
271
|
|
|
99
|
-
|
|
272
|
+
## [8.0.0-alpha.0](https://github.com/hatiolab/operato/compare/v7.1.1...v8.0.0-alpha.0) (2024-09-01)
|
|
100
273
|
|
|
101
274
|
**Note:** Version bump only for package @operato/form
|
|
102
275
|
|
|
@@ -4,7 +4,60 @@ import { customElement, property, query } from 'lit/decorators.js';
|
|
|
4
4
|
let CustomInput = class CustomInput extends LitElement {
|
|
5
5
|
constructor() {
|
|
6
6
|
super(...arguments);
|
|
7
|
-
this
|
|
7
|
+
Object.defineProperty(this, "name", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
configurable: true,
|
|
10
|
+
writable: true,
|
|
11
|
+
value: void 0
|
|
12
|
+
});
|
|
13
|
+
Object.defineProperty(this, "placeholder", {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
configurable: true,
|
|
16
|
+
writable: true,
|
|
17
|
+
value: void 0
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(this, "type", {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
configurable: true,
|
|
22
|
+
writable: true,
|
|
23
|
+
value: void 0
|
|
24
|
+
});
|
|
25
|
+
Object.defineProperty(this, "props", {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
configurable: true,
|
|
28
|
+
writable: true,
|
|
29
|
+
value: void 0
|
|
30
|
+
});
|
|
31
|
+
Object.defineProperty(this, "attrs", {
|
|
32
|
+
enumerable: true,
|
|
33
|
+
configurable: true,
|
|
34
|
+
writable: true,
|
|
35
|
+
value: void 0
|
|
36
|
+
});
|
|
37
|
+
Object.defineProperty(this, "valueField", {
|
|
38
|
+
enumerable: true,
|
|
39
|
+
configurable: true,
|
|
40
|
+
writable: true,
|
|
41
|
+
value: void 0
|
|
42
|
+
});
|
|
43
|
+
Object.defineProperty(this, "value", {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
configurable: true,
|
|
46
|
+
writable: true,
|
|
47
|
+
value: void 0
|
|
48
|
+
});
|
|
49
|
+
Object.defineProperty(this, "autofocus", {
|
|
50
|
+
enumerable: true,
|
|
51
|
+
configurable: true,
|
|
52
|
+
writable: true,
|
|
53
|
+
value: false
|
|
54
|
+
});
|
|
55
|
+
Object.defineProperty(this, "input", {
|
|
56
|
+
enumerable: true,
|
|
57
|
+
configurable: true,
|
|
58
|
+
writable: true,
|
|
59
|
+
value: void 0
|
|
60
|
+
});
|
|
8
61
|
}
|
|
9
62
|
render() {
|
|
10
63
|
return html `
|
|
@@ -67,7 +120,11 @@ let CustomInput = class CustomInput extends LitElement {
|
|
|
67
120
|
return this.input.checkValidity();
|
|
68
121
|
}
|
|
69
122
|
};
|
|
70
|
-
CustomInput
|
|
123
|
+
Object.defineProperty(CustomInput, "styles", {
|
|
124
|
+
enumerable: true,
|
|
125
|
+
configurable: true,
|
|
126
|
+
writable: true,
|
|
127
|
+
value: css `
|
|
71
128
|
input {
|
|
72
129
|
margin: auto 0;
|
|
73
130
|
border: 1px solid var(--md-sys-color-outline);
|
|
@@ -79,7 +136,8 @@ CustomInput.styles = css `
|
|
|
79
136
|
color: var(--form-input-background-color, var(--md-sys-color-on-surface-variant));
|
|
80
137
|
background-color: var(--form-input-background-color, var(--md-sys-color-surface-variant));
|
|
81
138
|
}
|
|
82
|
-
|
|
139
|
+
`
|
|
140
|
+
});
|
|
83
141
|
__decorate([
|
|
84
142
|
property({ type: String })
|
|
85
143
|
], CustomInput.prototype, "name", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ox-custom-input.js","sourceRoot":"","sources":["../../../src/components/ox-custom-input.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAkB,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC3D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAS,MAAM,mBAAmB,CAAA;AAGlE,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,UAAU;IAApC;;
|
|
1
|
+
{"version":3,"file":"ox-custom-input.js","sourceRoot":"","sources":["../../../src/components/ox-custom-input.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAkB,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC3D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAS,MAAM,mBAAmB,CAAA;AAGlE,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,UAAU;IAApC;;QAeuB;;;;;WAAa;QACb;;;;;WAAoB;QACpB;;;;;WAAa;QACb;;;;;WAAU;QACX;;;;;WAAU;QACT;;;;;WAAmB;QACnB;;;;;WAAU;QACT;;;;mBAAqB,KAAK;WAAA;QAEvC;;;;;WAAwB;IAyE1C,CAAC;IAvEC,MAAM;QACJ,OAAO,IAAI,CAAA;;eAEA,IAAI,CAAC,IAAI;sBACF,IAAI,CAAC,WAAW;eACvB,IAAI,CAAC,IAAI,IAAI,MAAM;gBAClB,IAAI,CAAC,KAAK,IAAI,EAAE;iBACf,CAAC,CAAa,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,KAA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E,CAAC;0CAAW;AACT;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+CAAoB;AACnB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0CAAW;AACT;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;8CAA2B;AAEvC;IAAf,KAAK,CAAC,OAAO,CAAC;0CAAyB;AAxB7B,WAAW;IADvB,aAAa,CAAC,iBAAiB,CAAC;GACpB,WAAW,CAiGvB","sourcesContent":["import { LitElement, PropertyValues, css, html } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\n\n@customElement('ox-custom-input')\nexport class CustomInput extends LitElement {\n static styles = css`\n input {\n margin: auto 0;\n border: 1px solid var(--md-sys-color-outline);\n padding: 0 var(--spacing-small);\n min-width: var(--form-input-width, 300px);\n max-width: var(--form-input-width, 300px);\n height: var(--form-element-height-medium);\n outline: var(--form-input-outline, none);\n color: var(--form-input-background-color, var(--md-sys-color-on-surface-variant));\n background-color: var(--form-input-background-color, var(--md-sys-color-surface-variant));\n }\n `\n\n @property({ type: String }) name?: string\n @property({ type: String }) placeholder?: string\n @property({ type: String }) type?: string\n @property({ type: Object }) props: any\n @property({ type: Array }) attrs: any\n @property({ type: String }) valueField?: string\n @property({ type: Object }) value: any\n @property({ type: Boolean }) autofocus: boolean = false\n\n @query('input') input!: HTMLInputElement\n\n render() {\n return html`\n <input\n name=${this.name}\n placeholder=${this.placeholder}\n type=${this.type || 'text'}\n value=${this.value || ''}\n @input=${(e: InputEvent) => (this.value = (e.currentTarget as HTMLInputElement).value)}\n ?autofocus=${this.autofocus}\n />\n `\n }\n\n get checked() {\n return this.input.checked\n }\n\n set checked(checked) {\n this.input.checked = checked\n }\n\n firstUpdated() {\n this.dispatchEvent(new CustomEvent('load'))\n }\n\n updated(changes: PropertyValues<this>) {\n if (changes.has('props')) {\n if (this._isObject(this.props)) {\n for (let prop in this.props) {\n if (this.props[prop]) {\n this.input.setAttribute(prop, this.props[prop])\n this.setAttribute(prop, this.props[prop])\n }\n }\n }\n }\n\n if (changes.has('attrs')) {\n if (this.attrs && Array.isArray(this.attrs)) {\n this.attrs.forEach(attr => {\n this.input.setAttribute(attr, '')\n this.setAttribute(attr, '')\n })\n }\n }\n\n if (changes.has('value') && this._isObject(this.value)) {\n let value = this.value\n this.value = (this.valueField && value[this.valueField]) || value[Object.keys(value)[0]]\n }\n }\n\n _isObject(v: any) {\n return v instanceof Object && !Array.isArray(v)\n }\n\n focus() {\n this.input.focus()\n }\n\n select() {\n this.input.select()\n }\n\n blur() {\n this.input.blur()\n }\n\n checkValidity() {\n return this.input.checkValidity()\n }\n}\n"]}
|
|
@@ -4,7 +4,48 @@ import { customElement, property, query } from 'lit/decorators.js';
|
|
|
4
4
|
let CustomSelect = class CustomSelect extends LitElement {
|
|
5
5
|
constructor() {
|
|
6
6
|
super(...arguments);
|
|
7
|
-
this
|
|
7
|
+
Object.defineProperty(this, "name", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
configurable: true,
|
|
10
|
+
writable: true,
|
|
11
|
+
value: void 0
|
|
12
|
+
});
|
|
13
|
+
Object.defineProperty(this, "options", {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
configurable: true,
|
|
16
|
+
writable: true,
|
|
17
|
+
value: void 0
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(this, "props", {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
configurable: true,
|
|
22
|
+
writable: true,
|
|
23
|
+
value: void 0
|
|
24
|
+
});
|
|
25
|
+
Object.defineProperty(this, "attrs", {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
configurable: true,
|
|
28
|
+
writable: true,
|
|
29
|
+
value: void 0
|
|
30
|
+
});
|
|
31
|
+
Object.defineProperty(this, "value", {
|
|
32
|
+
enumerable: true,
|
|
33
|
+
configurable: true,
|
|
34
|
+
writable: true,
|
|
35
|
+
value: void 0
|
|
36
|
+
});
|
|
37
|
+
Object.defineProperty(this, "autofocus", {
|
|
38
|
+
enumerable: true,
|
|
39
|
+
configurable: true,
|
|
40
|
+
writable: true,
|
|
41
|
+
value: false
|
|
42
|
+
});
|
|
43
|
+
Object.defineProperty(this, "select", {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
configurable: true,
|
|
46
|
+
writable: true,
|
|
47
|
+
value: void 0
|
|
48
|
+
});
|
|
8
49
|
}
|
|
9
50
|
render() {
|
|
10
51
|
return html `
|
|
@@ -53,7 +94,11 @@ let CustomSelect = class CustomSelect extends LitElement {
|
|
|
53
94
|
return this.select.checkValidity();
|
|
54
95
|
}
|
|
55
96
|
};
|
|
56
|
-
CustomSelect
|
|
97
|
+
Object.defineProperty(CustomSelect, "styles", {
|
|
98
|
+
enumerable: true,
|
|
99
|
+
configurable: true,
|
|
100
|
+
writable: true,
|
|
101
|
+
value: css `
|
|
57
102
|
select {
|
|
58
103
|
margin: auto 0;
|
|
59
104
|
border-style: var(--form-input-border-style, solid);
|
|
@@ -72,7 +117,8 @@ CustomSelect.styles = css `
|
|
|
72
117
|
-webkit-appearance: none;
|
|
73
118
|
-webkit-border-radius: 0px;
|
|
74
119
|
}
|
|
75
|
-
|
|
120
|
+
`
|
|
121
|
+
});
|
|
76
122
|
__decorate([
|
|
77
123
|
property({ type: String })
|
|
78
124
|
], CustomSelect.prototype, "name", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ox-custom-select.js","sourceRoot":"","sources":["../../../src/components/ox-custom-select.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAkB,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC3D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAG3D,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,UAAU;IAArC;;
|
|
1
|
+
{"version":3,"file":"ox-custom-select.js","sourceRoot":"","sources":["../../../src/components/ox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I,EAAE,KAAK,EAAE,CAAC;2CAAW;AACT;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2CAAW;AACT;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;+CAA2B;AAEtC;IAAhB,KAAK,CAAC,QAAQ,CAAC;4CAA0B;AA7B/B,YAAY;IADxB,aAAa,CAAC,kBAAkB,CAAC;GACrB,YAAY,CAsFxB","sourcesContent":["import { LitElement, PropertyValues, css, html } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\n\n@customElement('ox-custom-select')\nexport class CustomSelect extends LitElement {\n static styles = css`\n select {\n margin: auto 0;\n border-style: var(--form-input-border-style, solid);\n border-width: var(--form-input-border-width, 1px);\n border-color: var(--form-input-border-color, #c4c5c6);\n padding: var(--form-input-padding, 5px);\n outline: var(--form-input-outline, none);\n color: var(--form-input-background-color, var(--md-sys-color-on-surface-variant));\n background-color: var(--form-input-background-color, var(--md-sys-color-surface-variant));\n min-width: calc(\n var(--form-input-width, 300px) + 2 * var(--form-input-padding, 5px) + 2 * var(--form-input-border-width, 1px)\n );\n max-width: calc(\n var(--form-input-width) + 2 * var(--form-input-padding, 5px) + 2 * var(--form-input-border-width, 1px)\n );\n -webkit-appearance: none;\n -webkit-border-radius: 0px;\n }\n `\n\n @property({ type: String }) name?: string\n @property({ type: Array }) options?: { name: string; value: any }[]\n @property({ type: Object }) props: any\n @property({ type: Array }) attrs: any\n @property({ type: String }) value: any\n @property({ type: Boolean }) autofocus: boolean = false\n\n @query('select') select!: HTMLInputElement\n\n render() {\n return html`\n <select\n name=${this.name}\n ?autofocus=${this.autofocus}\n @change=${(e: Event) => (this.value = (e.currentTarget as HTMLSelectElement).value)}\n >\n ${(this.options || []).map(\n option => html`\n <option value=${option.value} ?selected=${this.value === option.value}>${option.name}</option>\n `\n )}\n </select>\n `\n }\n\n firstUpdated() {\n this.dispatchEvent(new CustomEvent('load'))\n }\n\n updated(changes: PropertyValues<this>) {\n if (changes.has('props') && this._isObject(this.props)) {\n for (let prop in this.props) {\n if (this.props[prop]) {\n this.select.setAttribute(prop, this.props[prop])\n this.setAttribute(prop, this.props[prop])\n }\n }\n }\n\n if (changes.has('attrs')) {\n if (this.attrs && Array.isArray(this.attrs)) {\n this.attrs.forEach(attr => {\n this.select.setAttribute(attr, '')\n this.setAttribute(attr, '')\n })\n }\n }\n }\n\n _isObject(v: any) {\n return v instanceof Object && !Array.isArray(v)\n }\n\n focus() {\n this.select.focus()\n }\n\n blur() {\n this.select.blur()\n }\n\n checkValidity() {\n return this.select.checkValidity()\n }\n}\n"]}
|
|
@@ -5,9 +5,36 @@ import { FileDropHelper } from '@operato/utils';
|
|
|
5
5
|
let FileUploader = class FileUploader extends LitElement {
|
|
6
6
|
constructor() {
|
|
7
7
|
super(...arguments);
|
|
8
|
-
this
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
Object.defineProperty(this, "multiple", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
configurable: true,
|
|
11
|
+
writable: true,
|
|
12
|
+
value: false
|
|
13
|
+
});
|
|
14
|
+
Object.defineProperty(this, "accept", {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
configurable: true,
|
|
17
|
+
writable: true,
|
|
18
|
+
value: '*/*'
|
|
19
|
+
});
|
|
20
|
+
Object.defineProperty(this, "label", {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
configurable: true,
|
|
23
|
+
writable: true,
|
|
24
|
+
value: void 0
|
|
25
|
+
});
|
|
26
|
+
Object.defineProperty(this, "_files", {
|
|
27
|
+
enumerable: true,
|
|
28
|
+
configurable: true,
|
|
29
|
+
writable: true,
|
|
30
|
+
value: []
|
|
31
|
+
});
|
|
32
|
+
Object.defineProperty(this, "fileInput", {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
configurable: true,
|
|
35
|
+
writable: true,
|
|
36
|
+
value: void 0
|
|
37
|
+
});
|
|
11
38
|
}
|
|
12
39
|
render() {
|
|
13
40
|
var _a;
|
|
@@ -81,8 +108,12 @@ let FileUploader = class FileUploader extends LitElement {
|
|
|
81
108
|
this._files = [];
|
|
82
109
|
}
|
|
83
110
|
};
|
|
84
|
-
FileUploader
|
|
85
|
-
|
|
111
|
+
Object.defineProperty(FileUploader, "styles", {
|
|
112
|
+
enumerable: true,
|
|
113
|
+
configurable: true,
|
|
114
|
+
writable: true,
|
|
115
|
+
value: [
|
|
116
|
+
css `
|
|
86
117
|
:host {
|
|
87
118
|
display: flex;
|
|
88
119
|
flex-direction: column;
|
|
@@ -144,7 +175,8 @@ FileUploader.styles = [
|
|
|
144
175
|
color: var(--file-uploader-li-icon-focus-color);
|
|
145
176
|
}
|
|
146
177
|
`
|
|
147
|
-
]
|
|
178
|
+
]
|
|
179
|
+
});
|
|
148
180
|
__decorate([
|
|
149
181
|
property({ type: Boolean })
|
|
150
182
|
], FileUploader.prototype, "multiple", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ox-file-uploader.js","sourceRoot":"","sources":["../../../src/components/ox-file-uploader.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAElE,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAGxC,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,UAAU;IAArC;;QAkEwB,
|
|
1
|
+
{"version":3,"file":"ox-file-uploader.js","sourceRoot":"","sources":["../../../src/components/ox-file-uploader.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAElE,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,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AAE4B;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;8CAA0B;AAC1B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CAAuB;AACtB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2CAAe;AAEf;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;4CAAoB;AAExB;IAArB,KAAK,CAAC,aAAa,CAAC;+CAA6B;AAxEvC,YAAY;IADxB,aAAa,CAAC,kBAAkB,CAAC;GACrB,YAAY,CA6JxB","sourcesContent":["import { LitElement, css, html } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\n\nimport { FileDropHelper } from '@operato/utils'\n\n@customElement('ox-file-uploader')\nexport class FileUploader extends LitElement {\n static styles = [\n css`\n :host {\n display: flex;\n flex-direction: column;\n border-radius: var(--border-radius);\n text-align: center;\n padding-bottom: 5px !important;\n text-transform: capitalize;\n\n border: var(--file-uploader-border);\n background-color: var(--md-sys-color-background);\n font: var(--file-uploader-font) !important;\n color: var(--file-uploader-color);\n }\n :host > md-icon {\n color: var(--file-uploader-icon-color);\n }\n\n :host(.candrop) {\n background-color: var(--file-uploader-candrop-background-color);\n }\n\n #input-file {\n display: none;\n }\n\n label {\n position: relative;\n width: auto;\n border: none;\n text-transform: capitalize;\n\n padding: var(--file-uploader-label-padding);\n border-radius: var(--file-uploader-label-border-radius);\n background-color: var(--file-uploader-label-background-color);\n color: var(--file-uploader-label-color);\n font: var(--file-uploader-label-font) !important;\n }\n\n ul {\n max-width: 500px;\n list-style: none;\n padding: 0;\n }\n li {\n text-align: left;\n\n padding: var(--file-uploader-li-padding);\n border-bottom: var(--file-uploader-li-border-bottom);\n display: flex;\n align-items: center;\n }\n li md-icon {\n cursor: pointer;\n font: var(--file-uploader-li-icon-font);\n margin-left: auto;\n }\n li md-icon:hover,\n li md-icon:active {\n color: var(--file-uploader-li-icon-focus-color);\n }\n `\n ]\n\n @property({ type: Boolean }) multiple: boolean = false\n @property({ type: String }) accept: string = '*/*'\n @property({ type: String }) label?: string\n\n @property({ type: Array }) _files: File[] = []\n\n @query('#input-file') fileInput!: HTMLInputElement\n\n render() {\n return html`\n <md-icon>post_add</md-icon>\n <span>add file or drop files here!</span>\n <input\n id=\"input-file\"\n type=\"file\"\n accept=${this.accept}\n ?multiple=${this.multiple}\n hidden\n @change=${(e: Event) => {\n const fileInput = e.currentTarget as HTMLInputElement\n const files = fileInput.files as FileList\n //// Temporary Validation preventing file size more than 10mb to be uploaded\n for (let index = 0; index < files.length; index++) {\n if (files[index].size > 9999999) {\n document.dispatchEvent(\n new CustomEvent('notify', {\n detail: {\n type: 'error',\n message: 'File size must be less than 10 MB.'\n }\n })\n )\n throw new Error('File size must be less than 10 MB.')\n }\n }\n\n this._files = [...this._files, ...Array.from(files)]\n\n this.dispatchEvent(\n new CustomEvent('files-change', {\n bubbles: true,\n composed: true,\n detail: {\n files: files\n }\n })\n )\n\n fileInput.value = ''\n }}\n />\n <label for=\"input-file\">${this.label || 'select file'}</label>\n\n ${this._files?.length\n ? html` <ul>\n ${this._files.map(\n file => html`\n <li>\n - ${file.name}\n <md-icon\n @click=${(e: Event) => {\n this._files.splice(this._files.indexOf(file), 1)\n this.requestUpdate()\n }}\n >delete_outline</md-icon\n >\n </li>\n `\n )}\n </ul>`\n : ''}\n `\n }\n\n firstUpdated() {\n FileDropHelper.set(this)\n\n this.addEventListener('file-drop', (e: Event) => {\n const de = e as any\n this._files = this.multiple ? de.detail : de.detail[0] ? [de.detail[0]] : []\n })\n }\n\n get files() {\n return this._files\n }\n\n reset() {\n this.fileInput.value = ''\n this._files = []\n }\n}\n"]}
|