@operato/context 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.
Files changed (29) hide show
  1. package/CHANGELOG.md +193 -30
  2. package/dist/src/layouts/ox-context-page-toolbar.js +15 -0
  3. package/dist/src/layouts/ox-context-page-toolbar.js.map +1 -1
  4. package/dist/src/layouts/ox-context-toolbar.js +21 -0
  5. package/dist/src/layouts/ox-context-toolbar.js.map +1 -1
  6. package/dist/src/tools/ox-page-action-context-bar.js +32 -4
  7. package/dist/src/tools/ox-page-action-context-bar.js.map +1 -1
  8. package/dist/src/tools/ox-page-action-overlay-template.js +6 -1
  9. package/dist/src/tools/ox-page-action-overlay-template.js.map +1 -1
  10. package/dist/src/tools/ox-page-title-bar.js +20 -4
  11. package/dist/src/tools/ox-page-title-bar.js.map +1 -1
  12. package/dist/src/tools/ox-title-bar.js +18 -4
  13. package/dist/src/tools/ox-title-bar.js.map +1 -1
  14. package/dist/stories/ox-context-page-toolbar-select-buttons.stories.js +1 -1
  15. package/dist/stories/ox-context-page-toolbar-select-buttons.stories.js.map +1 -1
  16. package/dist/stories/ox-context-page-toolbar-select.stories.js +1 -1
  17. package/dist/stories/ox-context-page-toolbar-select.stories.js.map +1 -1
  18. package/dist/stories/ox-context-page-toolbar.stories.js +1 -1
  19. package/dist/stories/ox-context-page-toolbar.stories.js.map +1 -1
  20. package/dist/stories/ox-context-toolbar-complex.stories.js +1 -1
  21. package/dist/stories/ox-context-toolbar-complex.stories.js.map +1 -1
  22. package/dist/stories/ox-context-toolbar-empty.stories.js +1 -1
  23. package/dist/stories/ox-context-toolbar-empty.stories.js.map +1 -1
  24. package/dist/stories/ox-context-toolbar-overflow.stories.js +1 -1
  25. package/dist/stories/ox-context-toolbar-overflow.stories.js.map +1 -1
  26. package/dist/stories/ox-context-toolbar.stories.js +1 -1
  27. package/dist/stories/ox-context-toolbar.stories.js.map +1 -1
  28. package/dist/tsconfig.tsbuildinfo +1 -1
  29. package/package.json +17 -16
package/CHANGELOG.md CHANGED
@@ -3,7 +3,51 @@
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
- ## [8.0.0](https://github.com/hatiolab/operato/compare/v7.1.33...v8.0.0) (2025-01-14)
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)
16
+
17
+
18
+ ### :bug: Bug Fix
19
+
20
+ * esm module ([d000a03](https://github.com/hatiolab/operato/commit/d000a0314cb2245f11534cef71d00544e649f5e9))
21
+
22
+
23
+
24
+ ## [9.0.0-beta.6](https://github.com/hatiolab/operato/compare/v9.0.0-beta.5...v9.0.0-beta.6) (2025-01-20)
25
+
26
+
27
+ ### :bug: Bug Fix
28
+
29
+ * esm module ([9642b97](https://github.com/hatiolab/operato/commit/9642b97650623d9ce71f6db0fd1995a2379205b5))
30
+
31
+
32
+
33
+ ## [9.0.0-beta.5](https://github.com/hatiolab/operato/compare/v9.0.0-beta.4...v9.0.0-beta.5) (2025-01-20)
34
+
35
+ **Note:** Version bump only for package @operato/context
36
+
37
+
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))
47
+
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)
7
51
 
8
52
  **Note:** Version bump only for package @operato/context
9
53
 
@@ -11,7 +55,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
11
55
 
12
56
 
13
57
 
14
- ### [7.1.33](https://github.com/hatiolab/operato/compare/v7.1.32...v7.1.33) (2025-01-13)
58
+ ## [8.0.0-beta.6](https://github.com/hatiolab/operato/compare/v8.0.0-beta.5...v8.0.0-beta.6) (2025-01-11)
15
59
 
16
60
  **Note:** Version bump only for package @operato/context
17
61
 
@@ -19,18 +63,42 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
19
63
 
20
64
 
21
65
 
22
- ### [7.1.32](https://github.com/hatiolab/operato/compare/v7.1.31...v7.1.32) (2025-01-11)
66
+ ## [8.0.0-beta.5](https://github.com/hatiolab/operato/compare/v8.0.0-beta.4...v8.0.0-beta.5) (2025-01-10)
67
+
68
+
69
+ ### :bug: Bug Fix
70
+
71
+ * button icon refreshing in ox-page-action-context-bar ([844468d](https://github.com/hatiolab/operato/commit/844468d89375e45ae7e2197e5f357a4fa46a115a))
72
+
73
+
74
+
75
+ ## [8.0.0-beta.2](https://github.com/hatiolab/operato/compare/v8.0.0-beta.1...v8.0.0-beta.2) (2025-01-08)
76
+
77
+
78
+ ### :bug: Bug Fix
79
+
80
+ * typo .npmignore ([d9c0c8c](https://github.com/hatiolab/operato/commit/d9c0c8c79abc688c3c2cfb6c37fcb689483a5977))
81
+
82
+
83
+
84
+ ## [8.0.0-beta.1](https://github.com/hatiolab/operato/compare/v8.0.0-beta.0...v8.0.0-beta.1) (2025-01-08)
23
85
 
24
86
 
25
87
  ### :bug: Bug Fix
26
88
 
27
- * button icon refreshing in ox-page-action-context-bar ([55d750e](https://github.com/hatiolab/operato/commit/55d750e3f2c1a0666f86aebb508ee81ca6b23f81))
28
- * missing .npmignore ([03db207](https://github.com/hatiolab/operato/commit/03db207498088b294ccfb9645f6839c2f11645d5))
29
- * typo .npmignore ([df91cae](https://github.com/hatiolab/operato/commit/df91caea0f5938a3febd9307184e5b036a65e2bd))
89
+ * missing .npmignore ([be05985](https://github.com/hatiolab/operato/commit/be05985abfae4af53501f718dd52932099f7fbcb))
90
+
91
+
92
+
93
+ ## [8.0.0-beta.0](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.56...v8.0.0-beta.0) (2025-01-07)
94
+
95
+ **Note:** Version bump only for package @operato/context
96
+
97
+
30
98
 
31
99
 
32
100
 
33
- ### [7.1.31](https://github.com/hatiolab/operato/compare/v7.1.30...v7.1.31) (2025-01-10)
101
+ ## [8.0.0-alpha.54](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.53...v8.0.0-alpha.54) (2024-12-09)
34
102
 
35
103
  **Note:** Version bump only for package @operato/context
36
104
 
@@ -38,7 +106,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
38
106
 
39
107
 
40
108
 
41
- ### [7.1.30](https://github.com/hatiolab/operato/compare/v7.1.29...v7.1.30) (2025-01-10)
109
+ ## [8.0.0-alpha.52](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.51...v8.0.0-alpha.52) (2024-12-03)
42
110
 
43
111
  **Note:** Version bump only for package @operato/context
44
112
 
@@ -46,7 +114,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
46
114
 
47
115
 
48
116
 
49
- ### [7.1.28](https://github.com/hatiolab/operato/compare/v7.1.27...v7.1.28) (2024-12-09)
117
+ ## [8.0.0-alpha.51](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.50...v8.0.0-alpha.51) (2024-11-29)
50
118
 
51
119
  **Note:** Version bump only for package @operato/context
52
120
 
@@ -54,16 +122,17 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
54
122
 
55
123
 
56
124
 
57
- ### [7.1.27](https://github.com/hatiolab/operato/compare/v7.1.26...v7.1.27) (2024-12-09)
125
+ ## [8.0.0-alpha.50](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.49...v8.0.0-alpha.50) (2024-11-16)
58
126
 
59
127
 
60
128
  ### :bug: Bug Fix
61
129
 
62
- * calendar css variables ([75a7eb0](https://github.com/hatiolab/operato/commit/75a7eb0c68a9d863f2b0db44152fdb9b9536ceca))
130
+ * button text capitalize ([4578e09](https://github.com/hatiolab/operato/commit/4578e096bb4aa0f689dd4f2e3b12cd159be55731))
131
+ * change help icon color ([14d1f04](https://github.com/hatiolab/operato/commit/14d1f04c054f8de70c28968951649e5ade2f0ff6))
63
132
 
64
133
 
65
134
 
66
- ### [7.1.26](https://github.com/hatiolab/operato/compare/v7.1.25...v7.1.26) (2024-11-28)
135
+ ## [8.0.0-alpha.49](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.48...v8.0.0-alpha.49) (2024-11-13)
67
136
 
68
137
  **Note:** Version bump only for package @operato/context
69
138
 
@@ -71,43 +140,129 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
71
140
 
72
141
 
73
142
 
74
- ### [7.1.25](https://github.com/hatiolab/operato/compare/v7.1.24...v7.1.25) (2024-11-23)
143
+ ## [8.0.0-alpha.48](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.47...v8.0.0-alpha.48) (2024-11-13)
75
144
 
145
+ **Note:** Version bump only for package @operato/context
76
146
 
77
- ### :bug: Bug Fix
78
147
 
79
- * button text capitalize ([5211446](https://github.com/hatiolab/operato/commit/52114469926fc502d2ee16112402f53978e17e68))
80
148
 
81
149
 
82
150
 
83
- ### [7.1.24](https://github.com/hatiolab/operato/compare/v7.1.23...v7.1.24) (2024-11-14)
151
+ ## [8.0.0-alpha.46](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.45...v8.0.0-alpha.46) (2024-10-23)
84
152
 
153
+ **Note:** Version bump only for package @operato/context
154
+
155
+
156
+
157
+
158
+
159
+ ## [8.0.0-alpha.45](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.44...v8.0.0-alpha.45) (2024-10-23)
160
+
161
+ **Note:** Version bump only for package @operato/context
162
+
163
+
164
+
165
+
166
+
167
+ ## [8.0.0-alpha.41](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.40...v8.0.0-alpha.41) (2024-10-21)
168
+
169
+ **Note:** Version bump only for package @operato/context
85
170
 
86
- ### :bug: Bug Fix
87
171
 
88
- * change help icon color ([33ad429](https://github.com/hatiolab/operato/commit/33ad42961ab8b87e89fd759563daf5612ca78bb8))
89
172
 
90
173
 
91
174
 
92
- ### [7.1.23](https://github.com/hatiolab/operato/compare/v7.1.22...v7.1.23) (2024-11-14)
175
+ ## [8.0.0-alpha.37](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.36...v8.0.0-alpha.37) (2024-10-20)
93
176
 
94
177
 
95
178
  ### :bug: Bug Fix
96
179
 
97
- * change help icon color ([d5731dc](https://github.com/hatiolab/operato/commit/d5731dc81b4d644937feab99bfecdca6c96d7146))
180
+ * update dev-dependencies version ([d6fe342](https://github.com/hatiolab/operato/commit/d6fe342de738c6bad3528550a862b5a1d2573161))
181
+
182
+
183
+
184
+ ## [8.0.0-alpha.34](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.33...v8.0.0-alpha.34) (2024-10-15)
185
+
186
+ **Note:** Version bump only for package @operato/context
187
+
188
+
189
+
190
+
191
+
192
+ ## [8.0.0-alpha.33](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.32...v8.0.0-alpha.33) (2024-10-14)
193
+
194
+ **Note:** Version bump only for package @operato/context
195
+
196
+
197
+
198
+
98
199
 
200
+ ## [8.0.0-alpha.30](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.29...v8.0.0-alpha.30) (2024-10-11)
201
+
202
+ **Note:** Version bump only for package @operato/context
203
+
204
+
205
+
206
+
207
+
208
+ ## [8.0.0-alpha.29](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.28...v8.0.0-alpha.29) (2024-10-10)
209
+
210
+ **Note:** Version bump only for package @operato/context
99
211
 
100
212
 
101
- ### [7.1.22](https://github.com/hatiolab/operato/compare/v7.1.21...v7.1.22) (2024-11-14)
213
+
214
+
215
+
216
+ ## [8.0.0-alpha.27](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.26...v8.0.0-alpha.27) (2024-10-06)
102
217
 
103
218
 
104
219
  ### :bug: Bug Fix
105
220
 
106
- * change help icon color ([78a25e5](https://github.com/hatiolab/operato/commit/78a25e5c449f9d630923a7e9195e358243c6ba76))
221
+ * calendar css variables ([9ea1918](https://github.com/hatiolab/operato/commit/9ea191844c72de5f920a8da85ad50209ba77cc07))
222
+
223
+
224
+
225
+ ## [8.0.0-alpha.26](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.25...v8.0.0-alpha.26) (2024-10-06)
226
+
227
+ **Note:** Version bump only for package @operato/context
228
+
107
229
 
108
230
 
109
231
 
110
- ### [7.1.21](https://github.com/hatiolab/operato/compare/v7.1.20...v7.1.21) (2024-11-13)
232
+
233
+ ## [8.0.0-alpha.21](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.20...v8.0.0-alpha.21) (2024-10-05)
234
+
235
+ **Note:** Version bump only for package @operato/context
236
+
237
+
238
+
239
+
240
+
241
+ ## [8.0.0-alpha.20](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.19...v8.0.0-alpha.20) (2024-10-04)
242
+
243
+ **Note:** Version bump only for package @operato/context
244
+
245
+
246
+
247
+
248
+
249
+ ## [8.0.0-alpha.19](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.18...v8.0.0-alpha.19) (2024-10-04)
250
+
251
+ **Note:** Version bump only for package @operato/context
252
+
253
+
254
+
255
+
256
+
257
+ ## [8.0.0-alpha.10](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.9...v8.0.0-alpha.10) (2024-09-18)
258
+
259
+ **Note:** Version bump only for package @operato/context
260
+
261
+
262
+
263
+
264
+
265
+ ## [8.0.0-alpha.8](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.7...v8.0.0-alpha.8) (2024-09-15)
111
266
 
112
267
  **Note:** Version bump only for package @operato/context
113
268
 
@@ -115,7 +270,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
115
270
 
116
271
 
117
272
 
118
- ### [7.1.13](https://github.com/hatiolab/operato/compare/v7.1.12...v7.1.13) (2024-09-23)
273
+ ## [8.0.0-alpha.6](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.5...v8.0.0-alpha.6) (2024-09-14)
119
274
 
120
275
  **Note:** Version bump only for package @operato/context
121
276
 
@@ -123,7 +278,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
123
278
 
124
279
 
125
280
 
126
- ### [7.1.10](https://github.com/hatiolab/operato/compare/v7.1.9...v7.1.10) (2024-09-15)
281
+ ## [8.0.0-alpha.5](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.4...v8.0.0-alpha.5) (2024-09-12)
127
282
 
128
283
  **Note:** Version bump only for package @operato/context
129
284
 
@@ -131,16 +286,24 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
131
286
 
132
287
 
133
288
 
134
- ### [7.1.6](https://github.com/hatiolab/operato/compare/v7.1.5...v7.1.6) (2024-09-07)
289
+ ## [8.0.0-alpha.4](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.3...v8.0.0-alpha.4) (2024-09-07)
135
290
 
136
291
 
137
292
  ### :bug: Bug Fix
138
293
 
139
- * dataset components & styles ([d6836bd](https://github.com/hatiolab/operato/commit/d6836bd1c400962453dec31ab6e6055e4110900b))
294
+ * dataset components & styles ([be44acd](https://github.com/hatiolab/operato/commit/be44acde8f25980e5b27afc481a2c149f8c23dbd))
295
+
296
+
297
+
298
+ ## [8.0.0-alpha.3](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.2...v8.0.0-alpha.3) (2024-09-06)
299
+
300
+ **Note:** Version bump only for package @operato/context
301
+
302
+
140
303
 
141
304
 
142
305
 
143
- ### [7.1.4](https://github.com/hatiolab/operato/compare/v7.1.3...v7.1.4) (2024-09-06)
306
+ ## [8.0.0-alpha.2](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.1...v8.0.0-alpha.2) (2024-09-05)
144
307
 
145
308
  **Note:** Version bump only for package @operato/context
146
309
 
@@ -148,7 +311,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
148
311
 
149
312
 
150
313
 
151
- ### [7.1.3](https://github.com/hatiolab/operato/compare/v7.1.2...v7.1.3) (2024-09-04)
314
+ ## [8.0.0-alpha.1](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.0...v8.0.0-alpha.1) (2024-09-04)
152
315
 
153
316
  **Note:** Version bump only for package @operato/context
154
317
 
@@ -156,7 +319,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
156
319
 
157
320
 
158
321
 
159
- ### [7.1.2](https://github.com/hatiolab/operato/compare/v7.1.1...v7.1.2) (2024-09-02)
322
+ ## [8.0.0-alpha.0](https://github.com/hatiolab/operato/compare/v7.1.1...v8.0.0-alpha.0) (2024-09-01)
160
323
 
161
324
  **Note:** Version bump only for package @operato/context
162
325
 
@@ -6,6 +6,21 @@ import { connect } from 'pwa-helpers/connect-mixin.js';
6
6
  import { TOOL_POSITION } from '@operato/layout';
7
7
  import { store } from '@operato/shell';
8
8
  let ContextPageToolbar = class ContextPageToolbar extends connect(store)(LitElement) {
9
+ constructor() {
10
+ super(...arguments);
11
+ Object.defineProperty(this, "context", {
12
+ enumerable: true,
13
+ configurable: true,
14
+ writable: true,
15
+ value: void 0
16
+ });
17
+ Object.defineProperty(this, "tools", {
18
+ enumerable: true,
19
+ configurable: true,
20
+ writable: true,
21
+ value: void 0
22
+ });
23
+ }
9
24
  static get styles() {
10
25
  return [
11
26
  css `
@@ -1 +1 @@
1
- {"version":3,"file":"ox-context-page-toolbar.js","sourceRoot":"","sources":["../../../src/layouts/ox-context-page-toolbar.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AAEnC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAkB,OAAO,EAAE,MAAM,KAAK,CAAA;AACpE,OAAO,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C,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAA,IAAI,IAAI,CAAC,QAAQ,GAAG,CAAC,QAAQ;YACtF,CAAC,CAAC,OAAO;;KAEZ,CAAA;IACH,CAAC;IAED,YAAY,CAAC,KAAU;;QACrB,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;YAClB,IAAI,CAAC,KAAK,GAAG,MAAA,KAAK,CAAC,OAAO,0CAAE,KAAK,CAAA;QACnC,CAAC;IACH,CAAC;CACF,CAAA;AA7C6B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;mDAAa;AACb;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;iDAIvB;AAtEQ,kBAAkB;IAD9B,aAAa,CAAC,yBAAyB,CAAC;GAC5B,kBAAkB,CA8G9B","sourcesContent":["import '@material/web/icon/icon.js'\n\nimport { css, html, LitElement, TemplateResult, nothing } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { connect } from 'pwa-helpers/connect-mixin.js'\n\nimport { TOOL_POSITION } from '@operato/layout'\nimport { store } from '@operato/shell'\n\n@customElement('ox-context-page-toolbar')\nexport class ContextPageToolbar extends connect(store)(LitElement) {\n static get styles() {\n return [\n css`\n :host {\n display: flex;\n flex-direction: row-reverse;\n gap: var(--spacing-medium);\n\n position: relative;\n\n justify-content: end;\n align-items: center;\n\n text-transform: capitalize;\n\n --context-action-bar-button-margin: var(--spacing-none);\n --context-action-bar-more-button-border-radius: 2px;\n\n --md-icon-size: 20px;\n }\n\n :host > div {\n display: flex;\n flex-direction: row;\n\n align-items: center;\n gap: var(--spacing-small);\n }\n\n md-icon {\n width: 32px;\n height: 32px;\n box-sizing: border-box;\n\n color: var(--md-sys-color-on-primary-container);\n background-color: var(--md-sys-color-primary-container);\n border: 1px solid var(--md-sys-color-primary-container);\n border-radius: var(--md-sys-shape-corner-small);\n padding: var(--spacing-small);\n\n &:hover {\n color: var(--md-sys-color-on-primary);\n background-color: var(--md-sys-color-primary);\n border-color: var(--md-sys-color-primary);\n }\n }\n\n @media screen and (max-width: 460px) {\n :host {\n gap: 0;\n }\n\n :host > div {\n gap: 0;\n }\n\n md-icon {\n border-radius: 0;\n }\n }\n `\n ]\n }\n\n @property({ type: Object }) context: any\n @property({ type: Array }) tools?: {\n position: TOOL_POSITION\n template: TemplateResult\n context?: string\n }[]\n\n render() {\n let contextKeys = Object.keys(this.context).filter(key => !!this.context[key])\n let tools = (this.tools || []).filter(tool => {\n if (!tool.context || contextKeys.includes(tool.context)) {\n return tool\n }\n })\n\n let frontEndTools = tools.filter(tool => tool.position == TOOL_POSITION.FRONT_END)\n let frontTools = tools.filter(tool => tool.position == TOOL_POSITION.FRONT)\n let centerTools = tools.filter(tool => tool.position == TOOL_POSITION.CENTER)\n let rearTools = tools.filter(tool => tool.position == TOOL_POSITION.REAR)\n let rearEndTools = tools.filter(tool => tool.position == TOOL_POSITION.REAR_END)\n\n return html`\n <slot name=\"front\"></slot>\n ${frontEndTools.length > 0\n ? html`<div id=\"front-end\">${frontEndTools.map(tool => html` ${tool.template} `)}</div>`\n : nothing}\n ${frontTools.length > 0\n ? html`<div id=\"front\">${frontTools.map(tool => html` ${tool.template} `)}</div>`\n : nothing}\n ${centerTools.length > 0\n ? html`<div id=\"center\">${centerTools.map(tool => html` ${tool.template} `)}</div>`\n : nothing}\n ${rearTools.length > 0 ? html`<div id=\"rear\">${rearTools.map(tool => html` ${tool.template} `)}</div>` : nothing}\n ${rearEndTools.length > 0\n ? html`<div id=\"rear-end\">${rearEndTools.map(tool => html` ${tool.template} `)}</div>`\n : nothing}\n <slot name=\"rear\"></slot>\n `\n }\n\n stateChanged(state: any) {\n if (state.context) {\n this.tools = state.context?.tools\n }\n }\n}\n"]}
1
+ {"version":3,"file":"ox-context-page-toolbar.js","sourceRoot":"","sources":["../../../src/layouts/ox-context-page-toolbar.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;A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A,IAAI,IAAI,CAAC,QAAQ,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO;QAC9G,YAAY,CAAC,MAAM,GAAG,CAAC;YACvB,CAAC,CAAC,IAAI,CAAA,sBAAsB,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAA,IAAI,IAAI,CAAC,QAAQ,GAAG,CAAC,QAAQ;YACtF,CAAC,CAAC,OAAO;;KAEZ,CAAA;IACH,CAAC;IAED,YAAY,CAAC,KAAU;;QACrB,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;YAClB,IAAI,CAAC,KAAK,GAAG,MAAA,KAAK,CAAC,OAAO,0CAAE,KAAK,CAAA;QACnC,CAAC;IACH,CAAC;CACF,CAAA;AA7C6B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;mDAAa;AACb;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;iDAIvB;AAtEQ,kBAAkB;IAD9B,aAAa,CAAC,yBAAyB,CAAC;GAC5B,kBAAkB,CA8G9B","sourcesContent":["import '@material/web/icon/icon.js'\n\nimport { css, html, LitElement, TemplateResult, nothing } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { connect } from 'pwa-helpers/connect-mixin.js'\n\nimport { TOOL_POSITION } from '@operato/layout'\nimport { store } from '@operato/shell'\n\n@customElement('ox-context-page-toolbar')\nexport class ContextPageToolbar extends connect(store)(LitElement) {\n static get styles() {\n return [\n css`\n :host {\n display: flex;\n flex-direction: row-reverse;\n gap: var(--spacing-medium);\n\n position: relative;\n\n justify-content: end;\n align-items: center;\n\n text-transform: capitalize;\n\n --context-action-bar-button-margin: var(--spacing-none);\n --context-action-bar-more-button-border-radius: 2px;\n\n --md-icon-size: 20px;\n }\n\n :host > div {\n display: flex;\n flex-direction: row;\n\n align-items: center;\n gap: var(--spacing-small);\n }\n\n md-icon {\n width: 32px;\n height: 32px;\n box-sizing: border-box;\n\n color: var(--md-sys-color-on-primary-container);\n background-color: var(--md-sys-color-primary-container);\n border: 1px solid var(--md-sys-color-primary-container);\n border-radius: var(--md-sys-shape-corner-small);\n padding: var(--spacing-small);\n\n &:hover {\n color: var(--md-sys-color-on-primary);\n background-color: var(--md-sys-color-primary);\n border-color: var(--md-sys-color-primary);\n }\n }\n\n @media screen and (max-width: 460px) {\n :host {\n gap: 0;\n }\n\n :host > div {\n gap: 0;\n }\n\n md-icon {\n border-radius: 0;\n }\n }\n `\n ]\n }\n\n @property({ type: Object }) context: any\n @property({ type: Array }) tools?: {\n position: TOOL_POSITION\n template: TemplateResult\n context?: string\n }[]\n\n render() {\n let contextKeys = Object.keys(this.context).filter(key => !!this.context[key])\n let tools = (this.tools || []).filter(tool => {\n if (!tool.context || contextKeys.includes(tool.context)) {\n return tool\n }\n })\n\n let frontEndTools = tools.filter(tool => tool.position == TOOL_POSITION.FRONT_END)\n let frontTools = tools.filter(tool => tool.position == TOOL_POSITION.FRONT)\n let centerTools = tools.filter(tool => tool.position == TOOL_POSITION.CENTER)\n let rearTools = tools.filter(tool => tool.position == TOOL_POSITION.REAR)\n let rearEndTools = tools.filter(tool => tool.position == TOOL_POSITION.REAR_END)\n\n return html`\n <slot name=\"front\"></slot>\n ${frontEndTools.length > 0\n ? html`<div id=\"front-end\">${frontEndTools.map(tool => html` ${tool.template} `)}</div>`\n : nothing}\n ${frontTools.length > 0\n ? html`<div id=\"front\">${frontTools.map(tool => html` ${tool.template} `)}</div>`\n : nothing}\n ${centerTools.length > 0\n ? html`<div id=\"center\">${centerTools.map(tool => html` ${tool.template} `)}</div>`\n : nothing}\n ${rearTools.length > 0 ? html`<div id=\"rear\">${rearTools.map(tool => html` ${tool.template} `)}</div>` : nothing}\n ${rearEndTools.length > 0\n ? html`<div id=\"rear-end\">${rearEndTools.map(tool => html` ${tool.template} `)}</div>`\n : nothing}\n <slot name=\"rear\"></slot>\n `\n }\n\n stateChanged(state: any) {\n if (state.context) {\n this.tools = state.context?.tools\n }\n }\n}\n"]}
@@ -6,6 +6,27 @@ import { connect } from 'pwa-helpers/connect-mixin.js';
6
6
  import { TOOL_POSITION } from '@operato/layout';
7
7
  import { store } from '@operato/shell';
8
8
  let ContextToolbar = class ContextToolbar extends connect(store)(LitElement) {
9
+ constructor() {
10
+ super(...arguments);
11
+ Object.defineProperty(this, "context", {
12
+ enumerable: true,
13
+ configurable: true,
14
+ writable: true,
15
+ value: void 0
16
+ });
17
+ Object.defineProperty(this, "tools", {
18
+ enumerable: true,
19
+ configurable: true,
20
+ writable: true,
21
+ value: void 0
22
+ });
23
+ Object.defineProperty(this, "container", {
24
+ enumerable: true,
25
+ configurable: true,
26
+ writable: true,
27
+ value: void 0
28
+ });
29
+ }
9
30
  static get styles() {
10
31
  return [
11
32
  css `
@@ -1 +1 @@
1
- {"version":3,"file":"ox-context-toolbar.js","sourceRoot":"","sources":["../../../src/layouts/ox-context-toolbar.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AAEnC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAkB,MAAM,KAAK,CAAA;AACpE,OAAO,EAAE,aAAa,EAAY,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACzE,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAA;AAEtD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAG/B,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,OAAO,CAAC,KAAK,CAAC,CAAC,UAAU,CAAC;IAC5D,MAAM,KAAK,MAAM;QACf,OAAO;YACL,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgHF;SACF,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AC,gBAAgB,CAAC,GAAG,CAAC,CAAA;YAErD,IAAI,IAAI,GAAG,IAAI,CAAA;YAEf,qBAAqB;YACrB,KAAK,MAAM,KAAK,IAAI,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;gBACzC,IAAK,KAAqB,CAAC,YAAY,KAAK,CAAC,EAAE,CAAC;oBAC9C,IAAI,GAAG,KAAK,CAAA;oBACZ,MAAK;gBACP,CAAC;YACH,CAAC;YAED,kDAAkD;YAClD,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,cAAc,CAAA;QAC5D,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,YAAY,CAAC,KAAU;QACrB,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;YAClB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,IAAI,EAAE,CAAA;YACtC,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,OAAO,IAAI,EAAE,CAAA;QAC1C,CAAC;IACH,CAAC;CACF,CAAA;AA9EkB;IAAhB,KAAK,EAAE;+CAAqB;AACZ;IAAhB,KAAK,EAAE;6CAAsB;AAEA;IAA7B,KAAK,CAAC,aAAa,CAAC;iDAAmC;AA1H7C,cAAc;IAD1B,aAAa,CAAC,oBAAoB,CAAC;GACvB,cAAc,CAqM1B","sourcesContent":["import '@material/web/icon/icon.js'\n\nimport { css, html, LitElement, nothing, PropertyValues } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { connect } from 'pwa-helpers/connect-mixin.js'\n\nimport { TOOL_POSITION } from '@operato/layout'\nimport { store } from '@operato/shell'\n\n@customElement('ox-context-toolbar')\nexport class ContextToolbar extends connect(store)(LitElement) {\n static get styles() {\n return [\n css`\n :host {\n display: flex;\n\n color: var(--context-toolbar-background-color, var(--md-sys-color-on-secondary-container));\n background-color: var(--context-toolbar-background-color, var(--md-sys-color-secondary-container));\n box-shadow: var(--context-toolbar-shadow-line);\n\n padding: 0;\n\n --md-icon-size: 20px;\n }\n\n div[container] {\n flex: 1;\n\n display: flex;\n position: relative;\n overflow: hidden;\n\n justify-content: space-between;\n\n gap: var(--spacing-medium);\n padding: var(--spacing-small) var(--spacing-medium);\n\n &:not(:has(> *)) {\n padding: 0;\n }\n\n div {\n display: flex;\n flex-direction: row;\n flex-wrap: nowrap;\n\n align-items: center;\n overflow: hidden;\n padding: 0;\n }\n\n #front-end md-icon,\n #front md-icon {\n border: var(--context-toolbar-function-button-border, none);\n }\n\n #front-end md-icon {\n color: var(--md-sys-color-on-primary-container);\n background-color: var(--md-sys-color-on-primary-container);\n }\n\n #front-end md-icon:hover {\n color: var(--md-sys-color-on-primary);\n background-color: var(--md-sys-color-primary);\n }\n\n #front md-icon {\n color: var(--md-sys-color-on-secondary-container);\n background-color: var(--md-sys-color-secondary-container);\n }\n\n #front md-icon:hover {\n color: var(--md-sys-on-color-secondary);\n background-color: var(--md-sys-color-secondary);\n }\n\n md-icon {\n color: var(--md-sys-color-on-primary-container);\n background-color: var(--md-sys-color-primary-container);\n border: 1px solid var(--md-sys-color-primary-container);\n border-radius: var(--md-sys-shape-corner-small);\n padding: var(--spacing-small);\n\n &:hover {\n color: var(--md-sys-color-on-primary);\n background-color: var(--md-sys-color-primary);\n }\n }\n\n div md-icon {\n border-radius: 0;\n }\n\n div md-icon:first-child {\n border-top-left-radius: var(--md-sys-shape-corner-small);\n border-bottom-left-radius: var(--md-sys-shape-corner-small);\n }\n\n div md-icon:last-child {\n border-top-right-radius: var(--md-sys-shape-corner-small);\n border-bottom-right-radius: var(--md-sys-shape-corner-small);\n }\n\n #center {\n flex: 1;\n justify-content: end;\n }\n }\n\n @media only screen and (max-width: 460px) {\n div[container] {\n padding: 0;\n gap: 0;\n --md-assist-chip-container-shape: 0;\n }\n\n div[container] div md-icon {\n border-radius: 0 !important;\n }\n\n div[container] div md-icon:not(:last-child) {\n border-right-width: 0;\n }\n }\n `\n ]\n }\n\n @state() private context: any\n @state() private tools?: any[]\n\n @query('[container]') private container!: HTMLDivElement\n\n render() {\n if (this.context.toolbar === false) {\n return nothing\n }\n\n let contextKeys = Object.keys(this.context).filter(key => !!this.context[key])\n let tools = (this.tools || []).filter(tool => {\n if (!tool.context || contextKeys.includes(tool.context)) {\n return tool\n }\n })\n\n let frontEndTools = tools.filter(tool => tool.position == TOOL_POSITION.FRONT_END)\n let frontTools = tools.filter(tool => tool.position == TOOL_POSITION.FRONT)\n let centerTools = tools.filter(tool => tool.position == TOOL_POSITION.CENTER)\n let rearTools = tools.filter(tool => tool.position == TOOL_POSITION.REAR)\n let rearEndTools = tools.filter(tool => tool.position == TOOL_POSITION.REAR_END)\n\n return html`\n <div container>\n ${frontEndTools.length > 0\n ? html`<div id=\"front-end\">${frontEndTools.map(tool => html` ${tool.template} `)}</div>`\n : nothing}\n ${frontTools.length > 0\n ? html`<div id=\"front\">${frontTools.map(tool => html` ${tool.template} `)}</div>`\n : nothing}\n ${centerTools.length > 0\n ? html`<div id=\"center\">${centerTools.map(tool => html` ${tool.template} `)}</div>`\n : nothing}\n ${rearTools.length > 0\n ? html`<div id=\"rear\">${rearTools.map(tool => html` ${tool.template} `)}</div>`\n : nothing}\n ${rearEndTools.length > 0\n ? html`<div id=\"rear-end\">${rearEndTools.map(tool => html` ${tool.template} `)}</div>`\n : nothing}\n </div>\n `\n }\n\n updated(changes: PropertyValues<this>) {\n requestAnimationFrame(() => {\n /*\n 하위 엘리먼트들이 실제로 보일 필요가 없을 때는, 이 엘리먼트도 숨김 처리함.\n &:not(:has(> *)) 처리로 모두 해결되지 않으므로, 로직 처리로 보완함.\n &:not(:has(> *)) 가 필요없으나, 남겨 두었음.\n */\n if (!this.container) {\n return\n }\n\n const children = this.container.querySelectorAll('*')\n\n let zero = true\n\n // 모든 하위 엘리먼트의 높이를 확인\n for (const child of Array.from(children)) {\n if ((child as HTMLElement).offsetHeight !== 0) {\n zero = false\n break\n }\n }\n\n // 모든 하위 엘리먼트의 높이가 0이면 부모 엘리먼트의 display를 none으로 변경\n this.container.style.padding = zero ? '0' : 'revert-layer'\n })\n }\n\n stateChanged(state: any) {\n if (state.context) {\n this.tools = state.context.tools || []\n this.context = state.route.context || {}\n }\n }\n}\n"]}
1
+ {"version":3,"file":"ox-context-toolbar.js","sourceRoot":"","sources":["../../../src/layouts/ox-context-toolbar.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AAEnC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAkB,MAAM,KAAK,CAAA;AACpE,OAAO,EAAE,aAAa,EAAY,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACzE,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAA;AAEtD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAG/B,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,OAAO,CAAC,KAAK,CAAC,CAAC,UAAU,CAAC;IAAvD;;QAuHY;;;;;WAAY;QACZ;;;;;WAAa;QAEA;;;;;WAA0B;IA2E1D,CAAC;IApMC,MAAM,KAAK,MAAM;QACf,OAAO;YACL,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgHF;SACF,CAAA;IACH,CAAC;IAOD,MAAM;QACJ,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,KAAK,KAAK,EAAE,CAAC;YACnC,OAAO,OAAO,CAAA;QAChB,CAAC;QAED,IAAI,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CA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K,CAAA;oBACZ,MAAK;gBACP,CAAC;YACH,CAAC;YAED,kDAAkD;YAClD,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,cAAc,CAAA;QAC5D,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,YAAY,CAAC,KAAU;QACrB,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;YAClB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,IAAI,EAAE,CAAA;YACtC,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,OAAO,IAAI,EAAE,CAAA;QAC1C,CAAC;IACH,CAAC;CACF,CAAA;AA9EkB;IAAhB,KAAK,EAAE;+CAAqB;AACZ;IAAhB,KAAK,EAAE;6CAAsB;AAEA;IAA7B,KAAK,CAAC,aAAa,CAAC;iDAAmC;AA1H7C,cAAc;IAD1B,aAAa,CAAC,oBAAoB,CAAC;GACvB,cAAc,CAqM1B","sourcesContent":["import '@material/web/icon/icon.js'\n\nimport { css, html, LitElement, nothing, PropertyValues } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { connect } from 'pwa-helpers/connect-mixin.js'\n\nimport { TOOL_POSITION } from '@operato/layout'\nimport { store } from '@operato/shell'\n\n@customElement('ox-context-toolbar')\nexport class ContextToolbar extends connect(store)(LitElement) {\n static get styles() {\n return [\n css`\n :host {\n display: flex;\n\n color: var(--context-toolbar-background-color, var(--md-sys-color-on-secondary-container));\n background-color: var(--context-toolbar-background-color, var(--md-sys-color-secondary-container));\n box-shadow: var(--context-toolbar-shadow-line);\n\n padding: 0;\n\n --md-icon-size: 20px;\n }\n\n div[container] {\n flex: 1;\n\n display: flex;\n position: relative;\n overflow: hidden;\n\n justify-content: space-between;\n\n gap: var(--spacing-medium);\n padding: var(--spacing-small) var(--spacing-medium);\n\n &:not(:has(> *)) {\n padding: 0;\n }\n\n div {\n display: flex;\n flex-direction: row;\n flex-wrap: nowrap;\n\n align-items: center;\n overflow: hidden;\n padding: 0;\n }\n\n #front-end md-icon,\n #front md-icon {\n border: var(--context-toolbar-function-button-border, none);\n }\n\n #front-end md-icon {\n color: var(--md-sys-color-on-primary-container);\n background-color: var(--md-sys-color-on-primary-container);\n }\n\n #front-end md-icon:hover {\n color: var(--md-sys-color-on-primary);\n background-color: var(--md-sys-color-primary);\n }\n\n #front md-icon {\n color: var(--md-sys-color-on-secondary-container);\n background-color: var(--md-sys-color-secondary-container);\n }\n\n #front md-icon:hover {\n color: var(--md-sys-on-color-secondary);\n background-color: var(--md-sys-color-secondary);\n }\n\n md-icon {\n color: var(--md-sys-color-on-primary-container);\n background-color: var(--md-sys-color-primary-container);\n border: 1px solid var(--md-sys-color-primary-container);\n border-radius: var(--md-sys-shape-corner-small);\n padding: var(--spacing-small);\n\n &:hover {\n color: var(--md-sys-color-on-primary);\n background-color: var(--md-sys-color-primary);\n }\n }\n\n div md-icon {\n border-radius: 0;\n }\n\n div md-icon:first-child {\n border-top-left-radius: var(--md-sys-shape-corner-small);\n border-bottom-left-radius: var(--md-sys-shape-corner-small);\n }\n\n div md-icon:last-child {\n border-top-right-radius: var(--md-sys-shape-corner-small);\n border-bottom-right-radius: var(--md-sys-shape-corner-small);\n }\n\n #center {\n flex: 1;\n justify-content: end;\n }\n }\n\n @media only screen and (max-width: 460px) {\n div[container] {\n padding: 0;\n gap: 0;\n --md-assist-chip-container-shape: 0;\n }\n\n div[container] div md-icon {\n border-radius: 0 !important;\n }\n\n div[container] div md-icon:not(:last-child) {\n border-right-width: 0;\n }\n }\n `\n ]\n }\n\n @state() private context: any\n @state() private tools?: any[]\n\n @query('[container]') private container!: HTMLDivElement\n\n render() {\n if (this.context.toolbar === false) {\n return nothing\n }\n\n let contextKeys = Object.keys(this.context).filter(key => !!this.context[key])\n let tools = (this.tools || []).filter(tool => {\n if (!tool.context || contextKeys.includes(tool.context)) {\n return tool\n }\n })\n\n let frontEndTools = tools.filter(tool => tool.position == TOOL_POSITION.FRONT_END)\n let frontTools = tools.filter(tool => tool.position == TOOL_POSITION.FRONT)\n let centerTools = tools.filter(tool => tool.position == TOOL_POSITION.CENTER)\n let rearTools = tools.filter(tool => tool.position == TOOL_POSITION.REAR)\n let rearEndTools = tools.filter(tool => tool.position == TOOL_POSITION.REAR_END)\n\n return html`\n <div container>\n ${frontEndTools.length > 0\n ? html`<div id=\"front-end\">${frontEndTools.map(tool => html` ${tool.template} `)}</div>`\n : nothing}\n ${frontTools.length > 0\n ? html`<div id=\"front\">${frontTools.map(tool => html` ${tool.template} `)}</div>`\n : nothing}\n ${centerTools.length > 0\n ? html`<div id=\"center\">${centerTools.map(tool => html` ${tool.template} `)}</div>`\n : nothing}\n ${rearTools.length > 0\n ? html`<div id=\"rear\">${rearTools.map(tool => html` ${tool.template} `)}</div>`\n : nothing}\n ${rearEndTools.length > 0\n ? html`<div id=\"rear-end\">${rearEndTools.map(tool => html` ${tool.template} `)}</div>`\n : nothing}\n </div>\n `\n }\n\n updated(changes: PropertyValues<this>) {\n requestAnimationFrame(() => {\n /*\n 하위 엘리먼트들이 실제로 보일 필요가 없을 때는, 이 엘리먼트도 숨김 처리함.\n &:not(:has(> *)) 처리로 모두 해결되지 않으므로, 로직 처리로 보완함.\n &:not(:has(> *)) 가 필요없으나, 남겨 두었음.\n */\n if (!this.container) {\n return\n }\n\n const children = this.container.querySelectorAll('*')\n\n let zero = true\n\n // 모든 하위 엘리먼트의 높이를 확인\n for (const child of Array.from(children)) {\n if ((child as HTMLElement).offsetHeight !== 0) {\n zero = false\n break\n }\n }\n\n // 모든 하위 엘리먼트의 높이가 0이면 부모 엘리먼트의 display를 none으로 변경\n this.container.style.padding = zero ? '0' : 'revert-layer'\n })\n }\n\n stateChanged(state: any) {\n if (state.context) {\n this.tools = state.context.tools || []\n this.context = state.route.context || {}\n }\n }\n}\n"]}
@@ -4,8 +4,8 @@ import '@material/web/chips/assist-chip.js';
4
4
  import './ox-page-action-overlay-template.js';
5
5
  import { css, html, LitElement, nothing } from 'lit';
6
6
  import { customElement, property, query, state } from 'lit/decorators.js';
7
- import throttle from 'lodash-es/throttle';
8
- import { connect } from 'pwa-helpers/connect-mixin';
7
+ import throttle from 'lodash-es/throttle.js';
8
+ import { connect } from 'pwa-helpers/connect-mixin.js';
9
9
  import { openOverlay } from '@operato/layout';
10
10
  import { store } from '@operato/shell';
11
11
  import { sleep } from '@operato/utils';
@@ -13,8 +13,36 @@ import { ButtonContainerStyles } from '@operato/styles';
13
13
  let PageActionContextBar = class PageActionContextBar extends connect(store)(LitElement) {
14
14
  constructor() {
15
15
  super(...arguments);
16
- this.actions = [];
17
- this.overflown = false;
16
+ Object.defineProperty(this, "actions", {
17
+ enumerable: true,
18
+ configurable: true,
19
+ writable: true,
20
+ value: []
21
+ });
22
+ Object.defineProperty(this, "overflown", {
23
+ enumerable: true,
24
+ configurable: true,
25
+ writable: true,
26
+ value: false
27
+ });
28
+ Object.defineProperty(this, "container", {
29
+ enumerable: true,
30
+ configurable: true,
31
+ writable: true,
32
+ value: void 0
33
+ });
34
+ Object.defineProperty(this, "overflownUpdaterThrottle", {
35
+ enumerable: true,
36
+ configurable: true,
37
+ writable: true,
38
+ value: void 0
39
+ });
40
+ Object.defineProperty(this, "resizeCallback", {
41
+ enumerable: true,
42
+ configurable: true,
43
+ writable: true,
44
+ value: void 0
45
+ });
18
46
  }
19
47
  static get styles() {
20
48
  return [
@@ -1 +1 @@
1
- {"version":3,"file":"ox-page-action-context-bar.js","sourceRoot":"","sources":["../../../src/tools/ox-page-action-context-bar.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,oCAAoC,CAAA;AAC3C,OAAO,sCAAsC,CAAA;AAE7C,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAkB,MAAM,KAAK,CAAA;AACpE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KA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AG,CAAC,SAAS,CAAC,EAAE,CAAC;YAC3B,qBAAqB,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAA;QAC9C,CAAC;IACH,CAAC;IAED,YAAY,CAAC,KAAU;;QACrB,MAAM,EAAE,OAAO,EAAE,GAAG,CAAA,MAAA,KAAK,CAAC,KAAK,0CAAE,OAAO,KAAI,EAAE,CAAA;QAE9C,IAAI,OAAO,EAAE,CAAC;YACZ,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,MAAW,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA;QAC1D,CAAC;IACH,CAAC;IAED,QAAQ;QACN,WAAW,CAAC,yBAAyB,EAAE;YACrC,QAAQ,EAAE,IAAI,CAAA,qEAAqE;SACpF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AA9H4B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;qDAQlB;AAES;IAAhB,KAAK,EAAE;uDAAmC;AACrB;IAArB,KAAK,CAAC,aAAa,CAAC;uDAA2B;AA5FrC,oBAAoB;IADhC,aAAa,CAAC,4BAA4B,CAAC;GAC/B,oBAAoB,CA+MhC","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@material/web/chips/assist-chip.js'\nimport './ox-page-action-overlay-template.js'\n\nimport { css, html, LitElement, nothing, PropertyValues } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport throttle from 'lodash-es/throttle'\nimport { connect } from 'pwa-helpers/connect-mixin'\n\nimport { openOverlay } from '@operato/layout'\nimport { store } from '@operato/shell'\nimport { sleep } from '@operato/utils'\nimport { ButtonContainerStyles } from '@operato/styles'\n\n@customElement('ox-page-action-context-bar')\nexport class PageActionContextBar extends connect(store)(LitElement) {\n static get styles() {\n return [\n ButtonContainerStyles,\n css`\n :host {\n display: flex;\n position: relative;\n overflow-x: clip;\n overflow-y: hidden;\n\n text-transform: capitalize;\n }\n\n :host *:focus {\n outline: none;\n }\n\n [container] {\n flex: 1;\n\n display: flex;\n overflow: hidden;\n gap: var(--spacing-small);\n padding: 2px; /* only for button shadow */\n align-items: center;\n }\n\n [more] {\n position: absolute;\n bottom: 0;\n right: 0;\n color: var(--md-sys-color-inverse-on-surface);\n background-color: var(--md-sys-color-inverse-surface);\n box-shadow: -2px 0px 2px 1px rgba(0, 0, 0, 0.2);\n padding: var(--context-action-bar-more-button-padding, 11px 10px);\n font-size: 2rem;\n z-index: 10;\n }\n\n select,\n input[type='text'] {\n box-sizing: border-box;\n padding: 0 var(--spacing-small);\n height: var(--form-element-height-medium);\n border: 1px solid var(--md-sys-color-outline);\n border-radius: var(--md-sys-shape-corner-small);\n color: var(--md-sys-color-on-primary);\n background-color: var(--md-sys-color-on-primary);\n font-size: var(--md-sys-typescale-label-large-size, 0.875rem);\n outline: none;\n }\n\n md-icon[working] {\n animation: rotate 1s linear infinite;\n }\n\n md-assist-chip[icon-only] {\n --md-assist-chip-trailing-space: 0;\n }\n\n @media screen and (max-width: 460px) {\n [container] {\n padding: 0;\n gap: 0;\n --md-assist-chip-container-shape: 0;\n }\n }\n\n @keyframes rotate {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n }\n `\n ]\n }\n\n @property({ type: Array }) actions: {\n title: string\n action: () => void\n icon: string\n type: string\n select: string[]\n href?: string\n emphasis?: boolean\n }[] = []\n\n @state() private overflown: boolean = false\n @query('[container]') container?: HTMLDivElement\n\n private overflownUpdaterThrottle: any\n private resizeCallback: any\n\n get overflownUpdater() {\n if (!this.overflownUpdaterThrottle) {\n this.overflownUpdaterThrottle = throttle(() => {\n this.overflown = !!this.container && this.container.scrollWidth > this.container.clientWidth\n }, 100)\n }\n\n return this.overflownUpdaterThrottle\n }\n\n connectedCallback() {\n super.connectedCallback()\n\n this.resizeCallback = () => this.overflownUpdater()\n\n window.addEventListener('resize', this.resizeCallback)\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n\n window.removeEventListener('resize', this.resizeCallback)\n }\n\n render() {\n return this.actions.length > 0\n ? html`\n <div container>${this.renderActions()}</div>\n ${this.overflown ? html` <md-icon more @click=${this.showMore.bind(this)}>more_horiz</md-icon> ` : html``}\n `\n : nothing\n }\n\n renderActions() {\n return html`\n ${this.actions.map(($action, idx) => {\n let { type, title, icon, action, select, href, emphasis } = $action as any\n let { raised, danger } = emphasis || {}\n\n return type == 'text'\n ? html` <span @click=${action}>${title}</span> `\n : type == 'select' || (select && select.length > 0)\n ? html`\n <select @change=${action}>\n ${select.map((option: any) => html` <option>${option}</option> `)}\n </select>\n `\n : type == 'link'\n ? html` <a href=${href}>${title}</a> `\n : html`\n <md-assist-chip\n ?icon-only=${type == 'icon' || !title}\n ?elevated=${raised}\n ?danger=${danger}\n label=${title}\n @click=${async (e: MouseEvent) => {\n /* all actions should be bloked for a second */\n const button = e.currentTarget as any\n const iconElement = button.querySelector('[slot=\"icon\"]')\n const actionConfig = this.actions[idx]\n\n if (iconElement) {\n icon = actionConfig.icon\n actionConfig.icon = 'refresh'\n this.requestUpdate()\n iconElement.setAttribute('working', true)\n }\n button.disabled = true\n\n try {\n await action()\n } finally {\n await sleep(1000) /* waiting for additionla 1 second */\n\n /* because icon can be changed after sleep, don't use closure 'icon'. */\n if (iconElement) {\n actionConfig.icon = icon\n this.requestUpdate()\n iconElement.removeAttribute('working')\n }\n button.disabled = false\n }\n }}\n >\n <md-icon slot=\"icon\">${this.actions[idx].icon}</md-icon>\n </md-assist-chip>\n `\n })}\n `\n }\n\n async updated(changed: PropertyValues<this>) {\n if (changed.has('actions')) {\n requestAnimationFrame(this.overflownUpdater)\n }\n }\n\n stateChanged(state: any) {\n const { actions } = state.route?.context || {}\n\n if (actions) {\n this.actions = actions.filter((action: any) => !!action)\n }\n }\n\n showMore() {\n openOverlay('context-toolbar-overlay', {\n template: html`<ox-page-action-overlay-template></ox-page-action-overlay-template>`\n })\n }\n}\n"]}
1
+ {"version":3,"file":"ox-page-action-context-bar.js","sourceRo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,CAAC,aAAa,EAAE,CAAA;oCACpB,WAAW,CAAC,eAAe,CAAC,SAAS,CAAC,CAAA;gCACxC,CAAC;gCACD,MAAM,CAAC,QAAQ,GAAG,KAAK,CAAA;4BACzB,CAAC;wBACH,CAAC;;2CAEsB,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI;;iBAEhD,CAAA;QACX,CAAC,CAAC;KACH,CAAA;IACH,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,OAA6B;QACzC,IAAI,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;YAC3B,qBAAqB,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAA;QAC9C,CAAC;IACH,CAAC;IAED,YAAY,CAAC,KAAU;;QACrB,MAAM,EAAE,OAAO,EAAE,GAAG,CAAA,MAAA,KAAK,CAAC,KAAK,0CAAE,OAAO,KAAI,EAAE,CAAA;QAE9C,IAAI,OAAO,EAAE,CAAC;YACZ,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,MAAW,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA;QAC1D,CAAC;IACH,CAAC;IAED,QAAQ;QACN,WAAW,CAAC,yBAAyB,EAAE;YACrC,QAAQ,EAAE,IAAI,CAAA,qEAAqE;SACpF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AA9H4B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;qDAQlB;AAES;IAAhB,KAAK,EAAE;uDAAmC;AACrB;IAArB,KAAK,CAAC,aAAa,CAAC;uDAA2B;AA5FrC,oBAAoB;IADhC,aAAa,CAAC,4BAA4B,CAAC;GAC/B,oBAAoB,CA+MhC","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@material/web/chips/assist-chip.js'\nimport './ox-page-action-overlay-template.js'\n\nimport { css, html, LitElement, nothing, PropertyValues } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport throttle from 'lodash-es/throttle.js'\nimport { connect } from 'pwa-helpers/connect-mixin.js'\n\nimport { openOverlay } from '@operato/layout'\nimport { store } from '@operato/shell'\nimport { sleep } from '@operato/utils'\nimport { ButtonContainerStyles } from '@operato/styles'\n\n@customElement('ox-page-action-context-bar')\nexport class PageActionContextBar extends connect(store)(LitElement) {\n static get styles() {\n return [\n ButtonContainerStyles,\n css`\n :host {\n display: flex;\n position: relative;\n overflow-x: clip;\n overflow-y: hidden;\n\n text-transform: capitalize;\n }\n\n :host *:focus {\n outline: none;\n }\n\n [container] {\n flex: 1;\n\n display: flex;\n overflow: hidden;\n gap: var(--spacing-small);\n padding: 2px; /* only for button shadow */\n align-items: center;\n }\n\n [more] {\n position: absolute;\n bottom: 0;\n right: 0;\n color: var(--md-sys-color-inverse-on-surface);\n background-color: var(--md-sys-color-inverse-surface);\n box-shadow: -2px 0px 2px 1px rgba(0, 0, 0, 0.2);\n padding: var(--context-action-bar-more-button-padding, 11px 10px);\n font-size: 2rem;\n z-index: 10;\n }\n\n select,\n input[type='text'] {\n box-sizing: border-box;\n padding: 0 var(--spacing-small);\n height: var(--form-element-height-medium);\n border: 1px solid var(--md-sys-color-outline);\n border-radius: var(--md-sys-shape-corner-small);\n color: var(--md-sys-color-on-primary);\n background-color: var(--md-sys-color-on-primary);\n font-size: var(--md-sys-typescale-label-large-size, 0.875rem);\n outline: none;\n }\n\n md-icon[working] {\n animation: rotate 1s linear infinite;\n }\n\n md-assist-chip[icon-only] {\n --md-assist-chip-trailing-space: 0;\n }\n\n @media screen and (max-width: 460px) {\n [container] {\n padding: 0;\n gap: 0;\n --md-assist-chip-container-shape: 0;\n }\n }\n\n @keyframes rotate {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n }\n `\n ]\n }\n\n @property({ type: Array }) actions: {\n title: string\n action: () => void\n icon: string\n type: string\n select: string[]\n href?: string\n emphasis?: boolean\n }[] = []\n\n @state() private overflown: boolean = false\n @query('[container]') container?: HTMLDivElement\n\n private overflownUpdaterThrottle: any\n private resizeCallback: any\n\n get overflownUpdater() {\n if (!this.overflownUpdaterThrottle) {\n this.overflownUpdaterThrottle = throttle(() => {\n this.overflown = !!this.container && this.container.scrollWidth > this.container.clientWidth\n }, 100)\n }\n\n return this.overflownUpdaterThrottle\n }\n\n connectedCallback() {\n super.connectedCallback()\n\n this.resizeCallback = () => this.overflownUpdater()\n\n window.addEventListener('resize', this.resizeCallback)\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n\n window.removeEventListener('resize', this.resizeCallback)\n }\n\n render() {\n return this.actions.length > 0\n ? html`\n <div container>${this.renderActions()}</div>\n ${this.overflown ? html` <md-icon more @click=${this.showMore.bind(this)}>more_horiz</md-icon> ` : html``}\n `\n : nothing\n }\n\n renderActions() {\n return html`\n ${this.actions.map(($action, idx) => {\n let { type, title, icon, action, select, href, emphasis } = $action as any\n let { raised, danger } = emphasis || {}\n\n return type == 'text'\n ? html` <span @click=${action}>${title}</span> `\n : type == 'select' || (select && select.length > 0)\n ? html`\n <select @change=${action}>\n ${select.map((option: any) => html` <option>${option}</option> `)}\n </select>\n `\n : type == 'link'\n ? html` <a href=${href}>${title}</a> `\n : html`\n <md-assist-chip\n ?icon-only=${type == 'icon' || !title}\n ?elevated=${raised}\n ?danger=${danger}\n label=${title}\n @click=${async (e: MouseEvent) => {\n /* all actions should be bloked for a second */\n const button = e.currentTarget as any\n const iconElement = button.querySelector('[slot=\"icon\"]')\n const actionConfig = this.actions[idx]\n\n if (iconElement) {\n icon = actionConfig.icon\n actionConfig.icon = 'refresh'\n this.requestUpdate()\n iconElement.setAttribute('working', true)\n }\n button.disabled = true\n\n try {\n await action()\n } finally {\n await sleep(1000) /* waiting for additionla 1 second */\n\n /* because icon can be changed after sleep, don't use closure 'icon'. */\n if (iconElement) {\n actionConfig.icon = icon\n this.requestUpdate()\n iconElement.removeAttribute('working')\n }\n button.disabled = false\n }\n }}\n >\n <md-icon slot=\"icon\">${this.actions[idx].icon}</md-icon>\n </md-assist-chip>\n `\n })}\n `\n }\n\n async updated(changed: PropertyValues<this>) {\n if (changed.has('actions')) {\n requestAnimationFrame(this.overflownUpdater)\n }\n }\n\n stateChanged(state: any) {\n const { actions } = state.route?.context || {}\n\n if (actions) {\n this.actions = actions.filter((action: any) => !!action)\n }\n }\n\n showMore() {\n openOverlay('context-toolbar-overlay', {\n template: html`<ox-page-action-overlay-template></ox-page-action-overlay-template>`\n })\n }\n}\n"]}
@@ -11,7 +11,12 @@ import { ContextToolbarOverlayStyle } from '../styles/ox-context-toolbar-overlay
11
11
  let PageActionOverlayTemplate = class PageActionOverlayTemplate extends connect(store)(LitElement) {
12
12
  constructor() {
13
13
  super(...arguments);
14
- this.actions = [];
14
+ Object.defineProperty(this, "actions", {
15
+ enumerable: true,
16
+ configurable: true,
17
+ writable: true,
18
+ value: []
19
+ });
15
20
  }
16
21
  static get styles() {
17
22
  return [