@operato/popup 8.0.3 → 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 +86 -18
- package/dist/src/ox-floating-overlay.d.ts +0 -1
- package/dist/src/ox-floating-overlay.js +79 -33
- package/dist/src/ox-floating-overlay.js.map +1 -1
- package/dist/src/ox-popup-list.js +84 -65
- package/dist/src/ox-popup-list.js.map +1 -1
- package/dist/src/ox-popup-menu.d.ts +1 -1
- package/dist/src/ox-popup-menu.js +60 -63
- package/dist/src/ox-popup-menu.js.map +1 -1
- package/dist/src/ox-popup-menuitem.d.ts +1 -1
- package/dist/src/ox-popup-menuitem.js +49 -47
- package/dist/src/ox-popup-menuitem.js.map +1 -1
- package/dist/src/ox-popup.js +48 -51
- package/dist/src/ox-popup.js.map +1 -1
- package/dist/src/ox-prompt.js +102 -73
- package/dist/src/ox-prompt.js.map +1 -1
- package/dist/stories/open-popup.stories.js +2 -2
- package/dist/stories/open-popup.stories.js.map +1 -1
- package/dist/stories/ox-popup-list-sortable.stories.js +1 -1
- package/dist/stories/ox-popup-list-sortable.stories.js.map +1 -1
- package/dist/stories/ox-popup-list.stories.js +1 -1
- package/dist/stories/ox-popup-list.stories.js.map +1 -1
- package/dist/stories/ox-popup-menu.stories.js +1 -1
- package/dist/stories/ox-popup-menu.stories.js.map +1 -1
- package/dist/stories/ox-popup.stories.js +2 -2
- package/dist/stories/ox-popup.stories.js.map +1 -1
- package/dist/stories/ox-prompt-icon.stories.js +2 -2
- package/dist/stories/ox-prompt-icon.stories.js.map +1 -1
- package/dist/stories/ox-prompt-normal.stories.js +2 -2
- package/dist/stories/ox-prompt-normal.stories.js.map +1 -1
- package/dist/stories/ox-prompt.stories.js +2 -2
- package/dist/stories/ox-prompt.stories.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +14 -13
- package/dist/stories/ox-popup-list-image-2.stories.d.ts +0 -23
- package/dist/stories/ox-popup-list-image-2.stories.js +0 -133
- package/dist/stories/ox-popup-list-image-2.stories.js.map +0 -1
- package/dist/stories/ox-popup-list-image.stories.d.ts +0 -23
- package/dist/stories/ox-popup-list-image.stories.js +0 -208
- package/dist/stories/ox-popup-list-image.stories.js.map +0 -1
package/CHANGELOG.md
CHANGED
@@ -3,25 +3,44 @@
|
|
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
7
|
|
8
8
|
|
9
9
|
### :bug: Bug Fix
|
10
10
|
|
11
|
-
*
|
11
|
+
* i18next@24.2.1 ([1c5920c](https://github.com/hatiolab/operato/commit/1c5920c6f77d28f07051a0a49997b9fb1dbf08bf))
|
12
|
+
* tweak tsconfig.json ([3c424b1](https://github.com/hatiolab/operato/commit/3c424b18d046f95d5619076d113d49a4b4dc9bbb))
|
12
13
|
|
13
14
|
|
14
15
|
|
15
|
-
|
16
|
+
## [9.0.0-beta.6](https://github.com/hatiolab/operato/compare/v9.0.0-beta.5...v9.0.0-beta.6) (2025-01-20)
|
16
17
|
|
17
18
|
|
18
19
|
### :bug: Bug Fix
|
19
20
|
|
20
|
-
*
|
21
|
+
* esm module ([9642b97](https://github.com/hatiolab/operato/commit/9642b97650623d9ce71f6db0fd1995a2379205b5))
|
21
22
|
|
22
23
|
|
23
24
|
|
24
|
-
## [
|
25
|
+
## [9.0.0-beta.5](https://github.com/hatiolab/operato/compare/v9.0.0-beta.4...v9.0.0-beta.5) (2025-01-20)
|
26
|
+
|
27
|
+
|
28
|
+
### :bug: Bug Fix
|
29
|
+
|
30
|
+
* esm module ([1319b00](https://github.com/hatiolab/operato/commit/1319b00d6955a514f63b3469fb514a28f84168a2))
|
31
|
+
|
32
|
+
|
33
|
+
|
34
|
+
## [9.0.0-beta.4](https://github.com/hatiolab/operato/compare/v9.0.0-beta.3...v9.0.0-beta.4) (2025-01-20)
|
35
|
+
|
36
|
+
|
37
|
+
### :bug: Bug Fix
|
38
|
+
|
39
|
+
* esm module ([0402232](https://github.com/hatiolab/operato/commit/04022327fa47eac64eaf3c56eeec55b9ace13e0e))
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
## [9.0.0-beta.0](https://github.com/hatiolab/operato/compare/v8.0.0-beta.11...v9.0.0-beta.0) (2025-01-13)
|
25
44
|
|
26
45
|
**Note:** Version bump only for package @operato/popup
|
27
46
|
|
@@ -29,44 +48,77 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
29
48
|
|
30
49
|
|
31
50
|
|
32
|
-
|
51
|
+
## [8.0.0-beta.5](https://github.com/hatiolab/operato/compare/v8.0.0-beta.4...v8.0.0-beta.5) (2025-01-10)
|
52
|
+
|
53
|
+
|
54
|
+
### :bug: Bug Fix
|
55
|
+
|
56
|
+
* alert 텍스트 정렬 속성 추가 ([d3b5c9b](https://github.com/hatiolab/operato/commit/d3b5c9bd706f30498b5c11ca89f83d6588961950))
|
57
|
+
|
58
|
+
|
59
|
+
|
60
|
+
## [8.0.0-beta.2](https://github.com/hatiolab/operato/compare/v8.0.0-beta.1...v8.0.0-beta.2) (2025-01-08)
|
61
|
+
|
62
|
+
|
63
|
+
### :bug: Bug Fix
|
64
|
+
|
65
|
+
* typo .npmignore ([d9c0c8c](https://github.com/hatiolab/operato/commit/d9c0c8c79abc688c3c2cfb6c37fcb689483a5977))
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
## [8.0.0-beta.1](https://github.com/hatiolab/operato/compare/v8.0.0-beta.0...v8.0.0-beta.1) (2025-01-08)
|
33
70
|
|
34
71
|
|
35
72
|
### :bug: Bug Fix
|
36
73
|
|
37
|
-
* missing .npmignore ([
|
38
|
-
* typo .npmignore ([df91cae](https://github.com/hatiolab/operato/commit/df91caea0f5938a3febd9307184e5b036a65e2bd))
|
74
|
+
* missing .npmignore ([be05985](https://github.com/hatiolab/operato/commit/be05985abfae4af53501f718dd52932099f7fbcb))
|
39
75
|
|
40
76
|
|
41
77
|
|
42
|
-
|
78
|
+
## [8.0.0-beta.0](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.56...v8.0.0-beta.0) (2025-01-07)
|
79
|
+
|
80
|
+
**Note:** Version bump only for package @operato/popup
|
81
|
+
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
|
86
|
+
## [8.0.0-alpha.51](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.50...v8.0.0-alpha.51) (2024-11-29)
|
43
87
|
|
44
88
|
|
45
89
|
### :bug: Bug Fix
|
46
90
|
|
47
|
-
*
|
91
|
+
* 팝업 텍스트 줄바꿈 추가 ([799df6d](https://github.com/hatiolab/operato/commit/799df6d43193353b43af977be8f6c65f997d1173))
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
## [8.0.0-alpha.50](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.49...v8.0.0-alpha.50) (2024-11-16)
|
96
|
+
|
97
|
+
**Note:** Version bump only for package @operato/popup
|
98
|
+
|
99
|
+
|
48
100
|
|
49
101
|
|
50
102
|
|
51
|
-
|
103
|
+
## [8.0.0-alpha.41](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.40...v8.0.0-alpha.41) (2024-10-21)
|
52
104
|
|
53
105
|
|
54
106
|
### :bug: Bug Fix
|
55
107
|
|
56
|
-
*
|
108
|
+
* remove import to escape circular referencing (temporary) ([4887944](https://github.com/hatiolab/operato/commit/488794473b84964ddbff0ee838d180b86cd00fc3))
|
57
109
|
|
58
110
|
|
59
111
|
|
60
|
-
|
112
|
+
## [8.0.0-alpha.37](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.36...v8.0.0-alpha.37) (2024-10-20)
|
61
113
|
|
62
114
|
|
63
115
|
### :bug: Bug Fix
|
64
116
|
|
65
|
-
*
|
117
|
+
* update dev-dependencies version ([d6fe342](https://github.com/hatiolab/operato/commit/d6fe342de738c6bad3528550a862b5a1d2573161))
|
66
118
|
|
67
119
|
|
68
120
|
|
69
|
-
|
121
|
+
## [8.0.0-alpha.33](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.32...v8.0.0-alpha.33) (2024-10-14)
|
70
122
|
|
71
123
|
**Note:** Version bump only for package @operato/popup
|
72
124
|
|
@@ -74,16 +126,32 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
74
126
|
|
75
127
|
|
76
128
|
|
77
|
-
|
129
|
+
## [8.0.0-alpha.29](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.28...v8.0.0-alpha.29) (2024-10-10)
|
130
|
+
|
131
|
+
**Note:** Version bump only for package @operato/popup
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
## [8.0.0-alpha.27](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.26...v8.0.0-alpha.27) (2024-10-06)
|
78
138
|
|
79
139
|
|
80
140
|
### :bug: Bug Fix
|
81
141
|
|
82
|
-
*
|
142
|
+
* calendar css variables ([9ea1918](https://github.com/hatiolab/operato/commit/9ea191844c72de5f920a8da85ad50209ba77cc07))
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
## [8.0.0-alpha.4](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.3...v8.0.0-alpha.4) (2024-09-07)
|
147
|
+
|
148
|
+
**Note:** Version bump only for package @operato/popup
|
149
|
+
|
150
|
+
|
83
151
|
|
84
152
|
|
85
153
|
|
86
|
-
|
154
|
+
## [8.0.0-alpha.0](https://github.com/hatiolab/operato/compare/v7.1.1...v8.0.0-alpha.0) (2024-09-01)
|
87
155
|
|
88
156
|
**Note:** Version bump only for package @operato/popup
|
89
157
|
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { __decorate } from "tslib";
|
2
2
|
import '@material/web/icon/icon.js';
|
3
|
-
|
3
|
+
// 순환 참조가 되어서 일단 코멘트 처리함.
|
4
|
+
// import '@operato/input/ox-input-search.js'
|
4
5
|
import { css, html, LitElement } from 'lit';
|
5
6
|
import { customElement, property, query } from 'lit/decorators.js';
|
6
7
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
@@ -30,37 +31,7 @@ function getPoint(e) {
|
|
30
31
|
* They are often used for modal dialogs, pop-ups, and similar UI elements.
|
31
32
|
*/
|
32
33
|
let OxFloatingOverlay = class OxFloatingOverlay extends LitElement {
|
33
|
-
|
34
|
-
super(...arguments);
|
35
|
-
/**
|
36
|
-
* A boolean property that determines whether a backdrop should be displayed behind the overlay.
|
37
|
-
* Backdrop provides a semi-transparent background that covers the entire screen when the overlay is open.
|
38
|
-
*/
|
39
|
-
this.backdrop = false;
|
40
|
-
/**
|
41
|
-
* A string property that sets the title of the overlay.
|
42
|
-
* The title is typically displayed in the header of the overlay.
|
43
|
-
*/
|
44
|
-
this.title = '';
|
45
|
-
/**
|
46
|
-
* A boolean property that determines whether the overlay can be closed by the user.
|
47
|
-
* If set to true, a close button will be displayed in the header.
|
48
|
-
*/
|
49
|
-
this.closable = false;
|
50
|
-
/**
|
51
|
-
* A boolean property that determines whether the overlay is considered historical.
|
52
|
-
* Historical overlays may have specific behavior or interactions, such as navigating back in history.
|
53
|
-
*/
|
54
|
-
this.historical = false;
|
55
|
-
/**
|
56
|
-
* A boolean property that determines whether the overlay can be moved by dragging.
|
57
|
-
* If set to true, the overlay can be repositioned by dragging its header.
|
58
|
-
*/
|
59
|
-
this.movable = false;
|
60
|
-
this.dragEndHandler = this.onDragEnd.bind(this);
|
61
|
-
this.dragMoveHandler = this.onDragMove.bind(this);
|
62
|
-
}
|
63
|
-
static { this.styles = [
|
34
|
+
static styles = [
|
64
35
|
ScrollbarStyles,
|
65
36
|
css `
|
66
37
|
/* for layout style */
|
@@ -308,7 +279,82 @@ let OxFloatingOverlay = class OxFloatingOverlay extends LitElement {
|
|
308
279
|
}
|
309
280
|
}
|
310
281
|
`
|
311
|
-
];
|
282
|
+
];
|
283
|
+
/**
|
284
|
+
* A boolean property that determines whether a backdrop should be displayed behind the overlay.
|
285
|
+
* Backdrop provides a semi-transparent background that covers the entire screen when the overlay is open.
|
286
|
+
*/
|
287
|
+
backdrop = false;
|
288
|
+
/**
|
289
|
+
* A string property that specifies the direction in which the overlay should appear.
|
290
|
+
* Possible values are: 'up', 'down', 'left', or 'right'.
|
291
|
+
*/
|
292
|
+
direction;
|
293
|
+
/**
|
294
|
+
* A string property that reflects the hovering state of the overlay.
|
295
|
+
* Possible values are: 'center', 'edge', or 'next'.
|
296
|
+
*/
|
297
|
+
hovering;
|
298
|
+
/**
|
299
|
+
* A string property that specifies the size of the overlay.
|
300
|
+
* Possible values are: 'small', 'medium', or 'large'.
|
301
|
+
*/
|
302
|
+
size;
|
303
|
+
/**
|
304
|
+
* A string property that represents the name of the overlay.
|
305
|
+
* This can be used for identification or other purposes.
|
306
|
+
*/
|
307
|
+
name;
|
308
|
+
/**
|
309
|
+
* A string property that sets the title of the overlay.
|
310
|
+
* The title is typically displayed in the header of the overlay.
|
311
|
+
*/
|
312
|
+
title = '';
|
313
|
+
/**
|
314
|
+
* A boolean property that determines whether the overlay can be closed by the user.
|
315
|
+
* If set to true, a close button will be displayed in the header.
|
316
|
+
*/
|
317
|
+
closable = false;
|
318
|
+
/**
|
319
|
+
* An object property that can hold custom properties for the template of the overlay.
|
320
|
+
* These properties can be used to customize the template's behavior.
|
321
|
+
*/
|
322
|
+
templateProperties;
|
323
|
+
/**
|
324
|
+
* An object property that can hold information related to help or assistance for the overlay.
|
325
|
+
* This information may be used to provide additional guidance to users.
|
326
|
+
*/
|
327
|
+
help;
|
328
|
+
/**
|
329
|
+
* A boolean property that determines whether the overlay is considered historical.
|
330
|
+
* Historical overlays may have specific behavior or interactions, such as navigating back in history.
|
331
|
+
*/
|
332
|
+
historical = false;
|
333
|
+
/**
|
334
|
+
* A boolean property that determines whether the overlay can be moved by dragging.
|
335
|
+
* If set to true, the overlay can be repositioned by dragging its header.
|
336
|
+
*/
|
337
|
+
movable = false;
|
338
|
+
/**
|
339
|
+
* An object property that can hold information related to a search feature within the overlay.
|
340
|
+
* It can include properties like 'value', 'handler', and 'placeholder'.
|
341
|
+
*/
|
342
|
+
search;
|
343
|
+
/**
|
344
|
+
* An object property that can hold information related to a filter feature within the overlay.
|
345
|
+
* It can include a 'handler' function for filtering content.
|
346
|
+
*/
|
347
|
+
filter;
|
348
|
+
/**
|
349
|
+
* A numeric property that specifies the z-index of the overlay.
|
350
|
+
* The z-index determines the stacking order of the overlay in relation to other elements on the page.
|
351
|
+
*/
|
352
|
+
zIndex;
|
353
|
+
dragStart;
|
354
|
+
dragEndHandler = this.onDragEnd.bind(this);
|
355
|
+
dragMoveHandler = this.onDragMove.bind(this);
|
356
|
+
overlayed;
|
357
|
+
content;
|
312
358
|
render() {
|
313
359
|
const direction = this.hovering == 'center' ? undefined : this.direction;
|
314
360
|
const { value = '', handler: searchHandler, placeholder = '', autofocus = true } = this.search || {};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ox-floating-overlay.js","sourceRoot":"","sources":["../../src/ox-floating-overlay.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,mCAAmC,CAAA;AAE1C,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAA;AAC3D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAExD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAEjD,SAAS,QAAQ,CAAC,CAAQ;IACxB,IAAK,CAAgB,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;QAClC,OAAO;YACL,CAAC,EAAG,CAAgB,CAAC,OAAO;YAC5B,CAAC,EAAG,CAAgB,CAAC,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B","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@operato/input/ox-input-search.js'\n\nimport { css, html, LitElement, PropertyValues } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\n\nimport { ScrollbarStyles } from '@operato/styles'\nimport { isHandheldDevice } from '@operato/utils'\n\nfunction getPoint(e: Event): { x: number; y: number } | undefined {\n if ((e as MouseEvent).button == 0) {\n return {\n x: (e as MouseEvent).clientX,\n y: (e as MouseEvent).clientY\n }\n } else if ((e as TouchEvent).touches?.length == 1) {\n const touch = (e as TouchEvent).touches[0]\n return {\n x: touch.clientX,\n y: touch.clientY\n }\n } else {\n return\n }\n}\n\n/**\n * Custom element for creating floating overlays.\n * These overlays can have various properties like direction, size, title, and more.\n * They are often used for modal dialogs, pop-ups, and similar UI elements.\n */\n@customElement('ox-floating-overlay')\nexport class OxFloatingOverlay extends LitElement {\n static styles = [\n ScrollbarStyles,\n css`\n /* for layout style */\n :host {\n position: relative;\n z-index: var(--z-index, 10);\n box-shadow: 2px 3px 10px 5px rgba(0, 0, 0, 0.15);\n }\n\n :host([hovering='edge']) {\n /* edge hovering 인 경우에는 상위 relative position 크기와 위치를 반영한다. */\n position: initial;\n }\n\n #backdrop {\n position: fixed;\n left: 0;\n top: 0;\n\n width: 100vw;\n height: 100vh;\n height: 100dvh;\n\n background-color: var(--md-sys-color-shadow, #000);\n opacity: 0.4;\n }\n\n [overlayed] {\n position: absolute;\n\n display: flex;\n flex-direction: column;\n overflow: hidden;\n }\n\n [overlayed][hovering='center'] {\n position: fixed;\n\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n\n opacity: 0;\n border: 2px solid var(--md-sys-color-primary);\n }\n\n [overlayed][hovering='center'][opened] {\n opacity: 1;\n transition: opacity 0.3s ease-in;\n background-color: var(--md-sys-color-surface-container-lowest);\n }\n\n [hovering='center'] {\n width: var(--overlay-center-normal-width, 60%);\n height: var(--overlay-center-normal-height, 60%);\n }\n\n [hovering='center'][size='small'] {\n width: var(--overlay-center-small-width, 40%);\n height: var(--overlay-center-small-height, 40%);\n }\n\n [hovering='center'][size='large'] {\n width: var(--overlay-center-large-width, 100%);\n height: var(--overlay-center-large-height, 100%);\n }\n\n [header] {\n --help-icon-color: var(--md-sys-color-on-primary-container);\n --help-icon-hover-color: var(--md-sys-color-on-primary-container);\n\n pointer-events: initial;\n }\n\n [content] {\n flex: 1;\n overflow: hidden;\n }\n\n ::slotted(*) {\n box-sizing: border-box;\n pointer-events: initial;\n }\n\n [hovering='center'] [content] ::slotted(*) {\n width: 100%;\n height: 100%;\n }\n [direction='up'],\n [direction='down'] {\n width: 100%;\n\n max-height: 0;\n transition: max-height 0.7s ease-in;\n }\n [direction='up'] {\n bottom: 0;\n }\n [direction='down'] {\n top: 0;\n }\n\n [direction='up'][opened],\n [direction='down'][opened] {\n max-height: 100vh;\n max-height: 100dvh;\n }\n\n [settled][direction='down'] [content],\n [settled][direction='up'] [content] {\n overflow-y: auto;\n }\n\n [direction='left'],\n [direction='right'] {\n height: 100%;\n\n max-width: 0;\n transition: max-width 0.5s ease-in;\n }\n [direction='left'] {\n right: 0;\n }\n [direction='right'] {\n left: 0;\n }\n\n [direction='left'][opened],\n [direction='right'][opened] {\n max-width: 100vw;\n }\n\n [settled][direction='left'] [content],\n [settled][direction='right'] [content] {\n overflow-x: auto;\n }\n\n @media screen and (max-width: 460px) {\n [direction='up'],\n [direction='down'] {\n max-height: 100vh;\n max-height: 100dvh;\n }\n\n [direction='left'],\n [direction='right'] {\n max-width: 100vw;\n }\n }\n `,\n css`\n /* for header style */\n [header] {\n display: flex;\n flex-direction: row;\n align-items: center;\n background-color: var(--md-sys-color-primary);\n font-weight: var(--md-sys-typescale-label-large-weight, var(--md-ref-typeface-weight-medium, 500));\n color: var(--md-sys-color-on-primary);\n }\n\n slot[name='header'] {\n flex: 1;\n\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n text-transform: capitalize;\n }\n\n [name='header']::slotted(*) {\n margin: 0 auto;\n }\n\n [name='header'] > h1 {\n font-size: var(--md-sys-typescale-title-medium-size, 1rem);\n margin-block: 0.4rem;\n }\n\n [historyback] {\n margin-left: var(--spacing-medium);\n margin-right: auto;\n }\n\n [close] {\n margin-left: auto;\n margin-right: var(--spacing-medium);\n }\n\n [historyback],\n [close] {\n display: none;\n }\n\n [closable][close] {\n display: block;\n cursor: pointer;\n }\n\n [search] ox-help-icon {\n color: var(--md-sys-color-on-secondary-container);\n }\n\n [search] {\n --help-icon-color: var(--md-sys-color-primary);\n --help-icon-hover-color: var(--md-sys-color-primary);\n --help-icon-opacity: 0.2;\n --help-icon-size: 20px;\n\n --md-icon-size: 20px;\n\n --input-search-padding: var(--spacing-medium);\n --input-search-focus-border-bottom: none;\n --input-search-font: normal 16px var(--theme-font);\n\n display: flex;\n justify-content: space-between;\n align-items: center;\n\n align-self: center;\n color: var(--md-sys-color-primary);\n background-color: var(--md-sys-color-on-primary);\n border-radius: 999em;\n padding: 0 var(--spacing-medium);\n }\n\n [search] > * {\n align-self: center;\n }\n\n ox-input-search {\n color: var(--md-sys-color-primary);\n background-color: var(--md-sys-color-on-primary);\n border-radius: var(--md-sys-shape-corner-full);\n }\n\n @media screen and (max-width: 460px) {\n [closable][historyback] {\n display: block;\n }\n\n [closable][close] {\n display: none;\n }\n }\n `\n ]\n\n /**\n * A boolean property that determines whether a backdrop should be displayed behind the overlay.\n * Backdrop provides a semi-transparent background that covers the entire screen when the overlay is open.\n */\n @property({ type: Boolean }) backdrop?: boolean = false\n\n /**\n * A string property that specifies the direction in which the overlay should appear.\n * Possible values are: 'up', 'down', 'left', or 'right'.\n */\n @property({ type: String }) direction?: 'up' | 'down' | 'left' | 'right'\n\n /**\n * A string property that reflects the hovering state of the overlay.\n * Possible values are: 'center', 'edge', or 'next'.\n */\n @property({ type: String, reflect: true }) hovering?: 'center' | 'edge' | 'next'\n\n /**\n * A string property that specifies the size of the overlay.\n * Possible values are: 'small', 'medium', or 'large'.\n */\n @property({ type: String }) size?: 'small' | 'medium' | 'large'\n\n /**\n * A string property that represents the name of the overlay.\n * This can be used for identification or other purposes.\n */\n @property({ type: String }) name?: string\n\n /**\n * A string property that sets the title of the overlay.\n * The title is typically displayed in the header of the overlay.\n */\n @property({ type: String }) title: string = ''\n\n /**\n * A boolean property that determines whether the overlay can be closed by the user.\n * If set to true, a close button will be displayed in the header.\n */\n @property({ type: Boolean }) closable?: boolean = false\n\n /**\n * An object property that can hold custom properties for the template of the overlay.\n * These properties can be used to customize the template's behavior.\n */\n @property({ type: Object }) templateProperties: any\n\n /**\n * An object property that can hold information related to help or assistance for the overlay.\n * This information may be used to provide additional guidance to users.\n */\n @property({ type: Object }) help: any\n\n /**\n * A boolean property that determines whether the overlay is considered historical.\n * Historical overlays may have specific behavior or interactions, such as navigating back in history.\n */\n @property({ type: Boolean }) historical?: boolean = false\n\n /**\n * A boolean property that determines whether the overlay can be moved by dragging.\n * If set to true, the overlay can be repositioned by dragging its header.\n */\n @property({ type: Boolean }) movable?: boolean = false\n\n /**\n * An object property that can hold information related to a search feature within the overlay.\n * It can include properties like 'value', 'handler', and 'placeholder'.\n */\n @property({ type: Object }) search?: {\n value?: string\n handler?: (instance: any, value: string) => void\n placeholder?: string\n }\n\n /**\n * An object property that can hold information related to a filter feature within the overlay.\n * It can include a 'handler' function for filtering content.\n */\n @property({ type: Object }) filter?: { handler?: (instance: any) => void }\n\n /**\n * A numeric property that specifies the z-index of the overlay.\n * The z-index determines the stacking order of the overlay in relation to other elements on the page.\n */\n @property({ type: Number, attribute: 'z-index' }) zIndex?: number\n\n private dragStart?: { x: number; y: number }\n private dragEndHandler = this.onDragEnd.bind(this) as EventListener\n private dragMoveHandler = this.onDragMove.bind(this) as EventListener\n\n @query('[overlayed]') overlayed!: HTMLDivElement\n @query('[content]') content!: HTMLDivElement\n\n render() {\n const direction = this.hovering == 'center' ? undefined : this.direction\n\n const { value = '', handler: searchHandler, placeholder = '', autofocus = true } = this.search || ({} as any)\n const { handler: filterHandler } = this.filter || ({} as any)\n\n const searchable = typeof searchHandler == 'function'\n const filterable = typeof filterHandler == 'function'\n\n return html`\n ${Boolean(this.backdrop)\n ? html`\n <div\n id=\"backdrop\"\n ?hidden=${!this.backdrop}\n @click=${(e: Event) => this.onClose(e, true /* escape */)}\n ></div>\n `\n : html``}\n\n <div\n overlayed\n hovering=${this.hovering || 'center'}\n direction=${ifDefined(direction)}\n size=${this.size || 'medium'}\n @close-overlay=${(e: Event) => {\n e.stopPropagation()\n this.onClose(e)\n }}\n @transitionstart=${(e: Event) => {\n /* to hide scrollbar during transition */\n ;(e.target as HTMLElement).removeAttribute('settled')\n }}\n @transitionend=${(e: Event) => {\n ;(e.target as HTMLElement).setAttribute('settled', '')\n }}\n @click=${(e: MouseEvent) => {\n if (this.backdrop && e.target === this.content) {\n this.onClose(e, true /* escape */)\n }\n }}\n >\n <div\n header\n @mousedown=${this.onDragStart.bind(this)}\n @touchstart=${this.onDragStart.bind(this)}\n draggable=\"false\"\n >\n <md-icon @click=${(e: Event) => this.onClose(e)} ?closable=${this.closable} historyback>arrow_back</md-icon>\n ${this.movable ? html`<md-icon>drag_indicator</md-icon>` : html``}\n <slot name=\"header\">\n ${this.title || this.closable\n ? html`\n <h1>\n ${this.title || ''} ${this.help\n ? html`<ox-help-icon .topic=${this.help}></ox-help-icon>`\n : html``}\n </h1>\n `\n : html``}\n ${searchable || filterable\n ? html`\n <div search>\n ${searchable\n ? html` <ox-input-search\n .placeholder=${placeholder}\n .value=${value || ''}\n ?autofocus=${autofocus}\n @change=${(e: Event) => {\n searchHandler(this.firstElementChild, (e.target as any).value)\n }}\n ></ox-input-search>`\n : html``}\n ${this.help && searchable ? html`<ox-help-icon .topic=${this.help}></ox-help-icon>` : html``}\n ${filterable\n ? html`<md-icon @click=${(e: MouseEvent) => filterHandler(this.firstElementChild)}>tune</md-icon>`\n : html``}\n </div>\n `\n : html``}\n ${this.help && !searchable && !this.title /* help only */\n ? html`<ox-help-icon .topic=${this.help}></ox-help-icon>`\n : html``}\n </slot>\n <md-icon @click=${(e: Event) => this.onClose(e)} ?closable=${this.closable} close>close</md-icon>\n </div>\n\n <div content>\n <slot> </slot>\n </div>\n </div>\n `\n }\n\n updated(changes: PropertyValues<this>) {\n if (changes.has('templateProperties') && this.templateProperties) {\n var template = this.firstElementChild\n if (template) {\n for (let prop in this.templateProperties) {\n //@ts-ignore\n template[prop] = this.templateProperties[prop]\n }\n }\n }\n }\n\n firstUpdated() {\n if (this.zIndex) {\n this.style.setProperty('--z-index', String(this.zIndex))\n }\n\n requestAnimationFrame(() => {\n /* transition(animation) 효과를 위해 'opened' 속성을 변화시킨다. */\n this.overlayed?.setAttribute('opened', 'true')\n })\n }\n\n connectedCallback(): void {\n super.connectedCallback()\n\n this.movable = this.movable && !isHandheldDevice()\n\n if (this.movable) {\n document.addEventListener('mouseup', this.dragEndHandler)\n document.addEventListener('touchend', this.dragEndHandler)\n document.addEventListener('touchcancel', this.dragEndHandler)\n document.addEventListener('mousemove', this.dragMoveHandler)\n document.addEventListener('touchmove', this.dragMoveHandler)\n }\n }\n\n disconnectedCallback() {\n document.dispatchEvent(\n new CustomEvent('overlay-closed', {\n detail: this.name\n })\n )\n\n if (this.movable) {\n document.removeEventListener('mouseup', this.dragEndHandler!)\n document.removeEventListener('touchend', this.dragEndHandler!)\n document.removeEventListener('touchcancel', this.dragEndHandler!)\n document.removeEventListener('mousemove', this.dragMoveHandler!)\n document.removeEventListener('touchmove', this.dragMoveHandler!)\n }\n\n super.disconnectedCallback()\n }\n\n onDragStart(e: Event) {\n if (!this.movable) {\n return\n }\n\n const point = getPoint(e)\n\n if (point) {\n this.dragStart = point\n e.stopPropagation()\n return false\n }\n }\n\n onDragMove(e: Event) {\n if (!this.movable || !this.dragStart) {\n return false\n }\n\n const point = getPoint(e)\n\n if (!point) {\n return false\n }\n\n e.stopPropagation()\n e.preventDefault()\n\n const dragStart = point\n var { x, y } = point\n\n x -= this.dragStart.x\n y -= this.dragStart.y\n\n this.dragStart = dragStart\n\n const overlayed = this.overlayed\n\n var boundingRect = overlayed.getBoundingClientRect()\n\n overlayed.style.left =\n Math.min(document.body.offsetWidth - 40, Math.max(40 - overlayed.offsetWidth, boundingRect.left + x)) + 'px'\n overlayed.style.top = Math.min(document.body.offsetHeight - 40, Math.max(0, boundingRect.top + y)) + 'px'\n\n overlayed.style.transform = 'initial'\n\n return false\n }\n\n onDragEnd(e: Event) {\n if (this.movable && this.dragStart) {\n e.stopPropagation()\n e.preventDefault()\n\n delete this.dragStart\n }\n }\n\n /**\n * A method that closes the overlay by removing it from its parent node in the DOM.\n * When called, this method removes the overlay element, effectively hiding it from the user interface.\n */\n close() {\n this.parentNode?.removeChild(this)\n }\n\n onClose(e: Event, escape?: boolean) {\n e.stopPropagation()\n /* 현재 overlay state를 확인해서, 자신이 포함하고 있는 템플릿인 경우에 history.back() 한다. */\n\n if (this.historical) {\n var state = history.state\n var overlay = (state || {}).overlay\n\n if (!overlay || overlay.name !== this.name) {\n return\n }\n\n /* Backdrop click 경우는 escape 시도라고 정의한다. overlay 속성이 escapable이 아닌 경우에는 동작하지 않는다. */\n if (escape && !overlay.escapable) {\n return true\n }\n\n history.back()\n } else {\n this.close()\n }\n }\n}\n"]}
|
1
|
+
{"version":3,"file":"ox-floating-overlay.js","sourceRoot":"","sources":["../../src/ox-floating-overlay.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,yBAAyB;AACzB,6CAA6C;AAE7C,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAA;AAC3D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAExD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAEjD,SAAS,Q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AE,CAAC;qDAA6B;AAM5B;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;kDAA0B;AAM1B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;iDAI1B;AAM2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;iDAA+C;AAMxB;IAAjD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC;iDAAgB;AAM3C;IAArB,KAAK,CAAC,aAAa,CAAC;oDAA2B;AAC5B;IAAnB,KAAK,CAAC,WAAW,CAAC;kDAAyB;AAxVjC,iBAAiB;IAD7B,aAAa,CAAC,qBAAqB,CAAC;GACxB,iBAAiB,CAukB7B","sourcesContent":["import '@material/web/icon/icon.js'\n// 순환 참조가 되어서 일단 코멘트 처리함.\n// import '@operato/input/ox-input-search.js'\n\nimport { css, html, LitElement, PropertyValues } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\n\nimport { ScrollbarStyles } from '@operato/styles'\nimport { isHandheldDevice } from '@operato/utils'\n\nfunction getPoint(e: Event): { x: number; y: number } | undefined {\n if ((e as MouseEvent).button == 0) {\n return {\n x: (e as MouseEvent).clientX,\n y: (e as MouseEvent).clientY\n }\n } else if ((e as TouchEvent).touches?.length == 1) {\n const touch = (e as TouchEvent).touches[0]\n return {\n x: touch.clientX,\n y: touch.clientY\n }\n } else {\n return\n }\n}\n\n/**\n * Custom element for creating floating overlays.\n * These overlays can have various properties like direction, size, title, and more.\n * They are often used for modal dialogs, pop-ups, and similar UI elements.\n */\n@customElement('ox-floating-overlay')\nexport class OxFloatingOverlay extends LitElement {\n static styles = [\n ScrollbarStyles,\n css`\n /* for layout style */\n :host {\n position: relative;\n z-index: var(--z-index, 10);\n box-shadow: 2px 3px 10px 5px rgba(0, 0, 0, 0.15);\n }\n\n :host([hovering='edge']) {\n /* edge hovering 인 경우에는 상위 relative position 크기와 위치를 반영한다. */\n position: initial;\n }\n\n #backdrop {\n position: fixed;\n left: 0;\n top: 0;\n\n width: 100vw;\n height: 100vh;\n height: 100dvh;\n\n background-color: var(--md-sys-color-shadow, #000);\n opacity: 0.4;\n }\n\n [overlayed] {\n position: absolute;\n\n display: flex;\n flex-direction: column;\n overflow: hidden;\n }\n\n [overlayed][hovering='center'] {\n position: fixed;\n\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n\n opacity: 0;\n border: 2px solid var(--md-sys-color-primary);\n }\n\n [overlayed][hovering='center'][opened] {\n opacity: 1;\n transition: opacity 0.3s ease-in;\n background-color: var(--md-sys-color-surface-container-lowest);\n }\n\n [hovering='center'] {\n width: var(--overlay-center-normal-width, 60%);\n height: var(--overlay-center-normal-height, 60%);\n }\n\n [hovering='center'][size='small'] {\n width: var(--overlay-center-small-width, 40%);\n height: var(--overlay-center-small-height, 40%);\n }\n\n [hovering='center'][size='large'] {\n width: var(--overlay-center-large-width, 100%);\n height: var(--overlay-center-large-height, 100%);\n }\n\n [header] {\n --help-icon-color: var(--md-sys-color-on-primary-container);\n --help-icon-hover-color: var(--md-sys-color-on-primary-container);\n\n pointer-events: initial;\n }\n\n [content] {\n flex: 1;\n overflow: hidden;\n }\n\n ::slotted(*) {\n box-sizing: border-box;\n pointer-events: initial;\n }\n\n [hovering='center'] [content] ::slotted(*) {\n width: 100%;\n height: 100%;\n }\n [direction='up'],\n [direction='down'] {\n width: 100%;\n\n max-height: 0;\n transition: max-height 0.7s ease-in;\n }\n [direction='up'] {\n bottom: 0;\n }\n [direction='down'] {\n top: 0;\n }\n\n [direction='up'][opened],\n [direction='down'][opened] {\n max-height: 100vh;\n max-height: 100dvh;\n }\n\n [settled][direction='down'] [content],\n [settled][direction='up'] [content] {\n overflow-y: auto;\n }\n\n [direction='left'],\n [direction='right'] {\n height: 100%;\n\n max-width: 0;\n transition: max-width 0.5s ease-in;\n }\n [direction='left'] {\n right: 0;\n }\n [direction='right'] {\n left: 0;\n }\n\n [direction='left'][opened],\n [direction='right'][opened] {\n max-width: 100vw;\n }\n\n [settled][direction='left'] [content],\n [settled][direction='right'] [content] {\n overflow-x: auto;\n }\n\n @media screen and (max-width: 460px) {\n [direction='up'],\n [direction='down'] {\n max-height: 100vh;\n max-height: 100dvh;\n }\n\n [direction='left'],\n [direction='right'] {\n max-width: 100vw;\n }\n }\n `,\n css`\n /* for header style */\n [header] {\n display: flex;\n flex-direction: row;\n align-items: center;\n background-color: var(--md-sys-color-primary);\n font-weight: var(--md-sys-typescale-label-large-weight, var(--md-ref-typeface-weight-medium, 500));\n color: var(--md-sys-color-on-primary);\n }\n\n slot[name='header'] {\n flex: 1;\n\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n text-transform: capitalize;\n }\n\n [name='header']::slotted(*) {\n margin: 0 auto;\n }\n\n [name='header'] > h1 {\n font-size: var(--md-sys-typescale-title-medium-size, 1rem);\n margin-block: 0.4rem;\n }\n\n [historyback] {\n margin-left: var(--spacing-medium);\n margin-right: auto;\n }\n\n [close] {\n margin-left: auto;\n margin-right: var(--spacing-medium);\n }\n\n [historyback],\n [close] {\n display: none;\n }\n\n [closable][close] {\n display: block;\n cursor: pointer;\n }\n\n [search] ox-help-icon {\n color: var(--md-sys-color-on-secondary-container);\n }\n\n [search] {\n --help-icon-color: var(--md-sys-color-primary);\n --help-icon-hover-color: var(--md-sys-color-primary);\n --help-icon-opacity: 0.2;\n --help-icon-size: 20px;\n\n --md-icon-size: 20px;\n\n --input-search-padding: var(--spacing-medium);\n --input-search-focus-border-bottom: none;\n --input-search-font: normal 16px var(--theme-font);\n\n display: flex;\n justify-content: space-between;\n align-items: center;\n\n align-self: center;\n color: var(--md-sys-color-primary);\n background-color: var(--md-sys-color-on-primary);\n border-radius: 999em;\n padding: 0 var(--spacing-medium);\n }\n\n [search] > * {\n align-self: center;\n }\n\n ox-input-search {\n color: var(--md-sys-color-primary);\n background-color: var(--md-sys-color-on-primary);\n border-radius: var(--md-sys-shape-corner-full);\n }\n\n @media screen and (max-width: 460px) {\n [closable][historyback] {\n display: block;\n }\n\n [closable][close] {\n display: none;\n }\n }\n `\n ]\n\n /**\n * A boolean property that determines whether a backdrop should be displayed behind the overlay.\n * Backdrop provides a semi-transparent background that covers the entire screen when the overlay is open.\n */\n @property({ type: Boolean }) backdrop?: boolean = false\n\n /**\n * A string property that specifies the direction in which the overlay should appear.\n * Possible values are: 'up', 'down', 'left', or 'right'.\n */\n @property({ type: String }) direction?: 'up' | 'down' | 'left' | 'right'\n\n /**\n * A string property that reflects the hovering state of the overlay.\n * Possible values are: 'center', 'edge', or 'next'.\n */\n @property({ type: String, reflect: true }) hovering?: 'center' | 'edge' | 'next'\n\n /**\n * A string property that specifies the size of the overlay.\n * Possible values are: 'small', 'medium', or 'large'.\n */\n @property({ type: String }) size?: 'small' | 'medium' | 'large'\n\n /**\n * A string property that represents the name of the overlay.\n * This can be used for identification or other purposes.\n */\n @property({ type: String }) name?: string\n\n /**\n * A string property that sets the title of the overlay.\n * The title is typically displayed in the header of the overlay.\n */\n @property({ type: String }) title: string = ''\n\n /**\n * A boolean property that determines whether the overlay can be closed by the user.\n * If set to true, a close button will be displayed in the header.\n */\n @property({ type: Boolean }) closable?: boolean = false\n\n /**\n * An object property that can hold custom properties for the template of the overlay.\n * These properties can be used to customize the template's behavior.\n */\n @property({ type: Object }) templateProperties: any\n\n /**\n * An object property that can hold information related to help or assistance for the overlay.\n * This information may be used to provide additional guidance to users.\n */\n @property({ type: Object }) help: any\n\n /**\n * A boolean property that determines whether the overlay is considered historical.\n * Historical overlays may have specific behavior or interactions, such as navigating back in history.\n */\n @property({ type: Boolean }) historical?: boolean = false\n\n /**\n * A boolean property that determines whether the overlay can be moved by dragging.\n * If set to true, the overlay can be repositioned by dragging its header.\n */\n @property({ type: Boolean }) movable?: boolean = false\n\n /**\n * An object property that can hold information related to a search feature within the overlay.\n * It can include properties like 'value', 'handler', and 'placeholder'.\n */\n @property({ type: Object }) search?: {\n value?: string\n handler?: (instance: any, value: string) => void\n placeholder?: string\n }\n\n /**\n * An object property that can hold information related to a filter feature within the overlay.\n * It can include a 'handler' function for filtering content.\n */\n @property({ type: Object }) filter?: { handler?: (instance: any) => void }\n\n /**\n * A numeric property that specifies the z-index of the overlay.\n * The z-index determines the stacking order of the overlay in relation to other elements on the page.\n */\n @property({ type: Number, attribute: 'z-index' }) zIndex?: number\n\n private dragStart?: { x: number; y: number }\n private dragEndHandler = this.onDragEnd.bind(this) as EventListener\n private dragMoveHandler = this.onDragMove.bind(this) as EventListener\n\n @query('[overlayed]') overlayed!: HTMLDivElement\n @query('[content]') content!: HTMLDivElement\n\n render() {\n const direction = this.hovering == 'center' ? undefined : this.direction\n\n const { value = '', handler: searchHandler, placeholder = '', autofocus = true } = this.search || ({} as any)\n const { handler: filterHandler } = this.filter || ({} as any)\n\n const searchable = typeof searchHandler == 'function'\n const filterable = typeof filterHandler == 'function'\n\n return html`\n ${Boolean(this.backdrop)\n ? html`\n <div\n id=\"backdrop\"\n ?hidden=${!this.backdrop}\n @click=${(e: Event) => this.onClose(e, true /* escape */)}\n ></div>\n `\n : html``}\n\n <div\n overlayed\n hovering=${this.hovering || 'center'}\n direction=${ifDefined(direction)}\n size=${this.size || 'medium'}\n @close-overlay=${(e: Event) => {\n e.stopPropagation()\n this.onClose(e)\n }}\n @transitionstart=${(e: Event) => {\n /* to hide scrollbar during transition */\n ;(e.target as HTMLElement).removeAttribute('settled')\n }}\n @transitionend=${(e: Event) => {\n ;(e.target as HTMLElement).setAttribute('settled', '')\n }}\n @click=${(e: MouseEvent) => {\n if (this.backdrop && e.target === this.content) {\n this.onClose(e, true /* escape */)\n }\n }}\n >\n <div\n header\n @mousedown=${this.onDragStart.bind(this)}\n @touchstart=${this.onDragStart.bind(this)}\n draggable=\"false\"\n >\n <md-icon @click=${(e: Event) => this.onClose(e)} ?closable=${this.closable} historyback>arrow_back</md-icon>\n ${this.movable ? html`<md-icon>drag_indicator</md-icon>` : html``}\n <slot name=\"header\">\n ${this.title || this.closable\n ? html`\n <h1>\n ${this.title || ''} ${this.help\n ? html`<ox-help-icon .topic=${this.help}></ox-help-icon>`\n : html``}\n </h1>\n `\n : html``}\n ${searchable || filterable\n ? html`\n <div search>\n ${searchable\n ? html` <ox-input-search\n .placeholder=${placeholder}\n .value=${value || ''}\n ?autofocus=${autofocus}\n @change=${(e: Event) => {\n searchHandler(this.firstElementChild, (e.target as any).value)\n }}\n ></ox-input-search>`\n : html``}\n ${this.help && searchable ? html`<ox-help-icon .topic=${this.help}></ox-help-icon>` : html``}\n ${filterable\n ? html`<md-icon @click=${(e: MouseEvent) => filterHandler(this.firstElementChild)}>tune</md-icon>`\n : html``}\n </div>\n `\n : html``}\n ${this.help && !searchable && !this.title /* help only */\n ? html`<ox-help-icon .topic=${this.help}></ox-help-icon>`\n : html``}\n </slot>\n <md-icon @click=${(e: Event) => this.onClose(e)} ?closable=${this.closable} close>close</md-icon>\n </div>\n\n <div content>\n <slot> </slot>\n </div>\n </div>\n `\n }\n\n updated(changes: PropertyValues<this>) {\n if (changes.has('templateProperties') && this.templateProperties) {\n var template = this.firstElementChild\n if (template) {\n for (let prop in this.templateProperties) {\n //@ts-ignore\n template[prop] = this.templateProperties[prop]\n }\n }\n }\n }\n\n firstUpdated() {\n if (this.zIndex) {\n this.style.setProperty('--z-index', String(this.zIndex))\n }\n\n requestAnimationFrame(() => {\n /* transition(animation) 효과를 위해 'opened' 속성을 변화시킨다. */\n this.overlayed?.setAttribute('opened', 'true')\n })\n }\n\n connectedCallback(): void {\n super.connectedCallback()\n\n this.movable = this.movable && !isHandheldDevice()\n\n if (this.movable) {\n document.addEventListener('mouseup', this.dragEndHandler)\n document.addEventListener('touchend', this.dragEndHandler)\n document.addEventListener('touchcancel', this.dragEndHandler)\n document.addEventListener('mousemove', this.dragMoveHandler)\n document.addEventListener('touchmove', this.dragMoveHandler)\n }\n }\n\n disconnectedCallback() {\n document.dispatchEvent(\n new CustomEvent('overlay-closed', {\n detail: this.name\n })\n )\n\n if (this.movable) {\n document.removeEventListener('mouseup', this.dragEndHandler!)\n document.removeEventListener('touchend', this.dragEndHandler!)\n document.removeEventListener('touchcancel', this.dragEndHandler!)\n document.removeEventListener('mousemove', this.dragMoveHandler!)\n document.removeEventListener('touchmove', this.dragMoveHandler!)\n }\n\n super.disconnectedCallback()\n }\n\n onDragStart(e: Event) {\n if (!this.movable) {\n return\n }\n\n const point = getPoint(e)\n\n if (point) {\n this.dragStart = point\n e.stopPropagation()\n return false\n }\n }\n\n onDragMove(e: Event) {\n if (!this.movable || !this.dragStart) {\n return false\n }\n\n const point = getPoint(e)\n\n if (!point) {\n return false\n }\n\n e.stopPropagation()\n e.preventDefault()\n\n const dragStart = point\n var { x, y } = point\n\n x -= this.dragStart.x\n y -= this.dragStart.y\n\n this.dragStart = dragStart\n\n const overlayed = this.overlayed\n\n var boundingRect = overlayed.getBoundingClientRect()\n\n overlayed.style.left =\n Math.min(document.body.offsetWidth - 40, Math.max(40 - overlayed.offsetWidth, boundingRect.left + x)) + 'px'\n overlayed.style.top = Math.min(document.body.offsetHeight - 40, Math.max(0, boundingRect.top + y)) + 'px'\n\n overlayed.style.transform = 'initial'\n\n return false\n }\n\n onDragEnd(e: Event) {\n if (this.movable && this.dragStart) {\n e.stopPropagation()\n e.preventDefault()\n\n delete this.dragStart\n }\n }\n\n /**\n * A method that closes the overlay by removing it from its parent node in the DOM.\n * When called, this method removes the overlay element, effectively hiding it from the user interface.\n */\n close() {\n this.parentNode?.removeChild(this)\n }\n\n onClose(e: Event, escape?: boolean) {\n e.stopPropagation()\n /* 현재 overlay state를 확인해서, 자신이 포함하고 있는 템플릿인 경우에 history.back() 한다. */\n\n if (this.historical) {\n var state = history.state\n var overlay = (state || {}).overlay\n\n if (!overlay || overlay.name !== this.name) {\n return\n }\n\n /* Backdrop click 경우는 escape 시도라고 정의한다. overlay 속성이 escapable이 아닌 경우에는 동작하지 않는다. */\n if (escape && !overlay.escapable) {\n return true\n }\n\n history.back()\n } else {\n this.close()\n }\n }\n}\n"]}
|
@@ -22,70 +22,7 @@ function guaranteeFocus(element) {
|
|
22
22
|
* A custom element representing a list-like popup menu.
|
23
23
|
*/
|
24
24
|
let OxPopupList = class OxPopupList extends OxPopup {
|
25
|
-
|
26
|
-
super(...arguments);
|
27
|
-
/**
|
28
|
-
* A boolean property that, when set to true, allows multiple options to be selected in the popup list.
|
29
|
-
* @type {boolean}
|
30
|
-
*/
|
31
|
-
this.multiple = false;
|
32
|
-
/**
|
33
|
-
* A boolean property that, when set to true, enables the drag-and-drop sorting functionality within the popup list.
|
34
|
-
* This allows users to reorder the options in the list by dragging them into new positions.
|
35
|
-
* @type {boolean|undefined}
|
36
|
-
*/
|
37
|
-
this.sortable = false;
|
38
|
-
this.nothingToSelect = false;
|
39
|
-
this.locked = false;
|
40
|
-
this._onkeydown = function (e) {
|
41
|
-
e.stopPropagation();
|
42
|
-
switch (e.key) {
|
43
|
-
case 'Esc': // for IE/Edge
|
44
|
-
case 'Escape':
|
45
|
-
this.close();
|
46
|
-
break;
|
47
|
-
case 'Left': // for IE/Edge
|
48
|
-
case 'ArrowLeft':
|
49
|
-
case 'Up': // for IE/Edge
|
50
|
-
case 'ArrowUp':
|
51
|
-
this.activeIndex--;
|
52
|
-
break;
|
53
|
-
case 'Right': // for IE/Edge
|
54
|
-
case 'ArrowRight':
|
55
|
-
case 'Down': // for IE/Edge
|
56
|
-
case 'ArrowDown':
|
57
|
-
this.activeIndex++;
|
58
|
-
break;
|
59
|
-
case 'Enter':
|
60
|
-
case ' ':
|
61
|
-
case 'Spacebar': // for old firefox
|
62
|
-
this.setActive(this.activeIndex, true);
|
63
|
-
this.select();
|
64
|
-
break;
|
65
|
-
}
|
66
|
-
}.bind(this);
|
67
|
-
this._onfocusout = function (e) {
|
68
|
-
const to = e.relatedTarget;
|
69
|
-
if (!this.contains(to)) {
|
70
|
-
/* If the focus has clearly moved to an element outside of my range, the ox-popup-list should be closed. */
|
71
|
-
// @ts-ignore for debug
|
72
|
-
!this.preventCloseOnBlur && !this.debug && !window.POPUP_DEBUG && this.close();
|
73
|
-
}
|
74
|
-
}.bind(this);
|
75
|
-
this._onclick = function (e) {
|
76
|
-
e.stopPropagation();
|
77
|
-
// Check if the click event target is a checkbox
|
78
|
-
if (e.target.closest('input[type="checkbox"]')) {
|
79
|
-
return; // Do not proceed if it's a checkbox click
|
80
|
-
}
|
81
|
-
const option = e.target?.closest('[option]');
|
82
|
-
if (option) {
|
83
|
-
this.setActive(option, true);
|
84
|
-
this.select();
|
85
|
-
}
|
86
|
-
}.bind(this);
|
87
|
-
}
|
88
|
-
static { this.styles = [
|
25
|
+
static styles = [
|
89
26
|
...OxPopup.styles,
|
90
27
|
css `
|
91
28
|
:host {
|
@@ -197,7 +134,42 @@ let OxPopupList = class OxPopupList extends OxPopup {
|
|
197
134
|
overflow: auto;
|
198
135
|
}
|
199
136
|
`
|
200
|
-
];
|
137
|
+
];
|
138
|
+
/**
|
139
|
+
* A boolean property that, when set to true, allows multiple options to be selected in the popup list.
|
140
|
+
* @type {boolean}
|
141
|
+
*/
|
142
|
+
multiple = false;
|
143
|
+
/**
|
144
|
+
* An optional attribute that specifies the name of the attribute used to mark selected options in the list.
|
145
|
+
* @type {string|undefined}
|
146
|
+
*/
|
147
|
+
attrSelected;
|
148
|
+
/**
|
149
|
+
* A boolean property that, when set to true, enables the search functionality in the popup list.
|
150
|
+
* Users can search/filter options by typing in a search bar.
|
151
|
+
* @type {boolean|undefined}
|
152
|
+
*/
|
153
|
+
withSearch;
|
154
|
+
/**
|
155
|
+
* A boolean property that, when set to true, enables the drag-and-drop sorting functionality within the popup list.
|
156
|
+
* This allows users to reorder the options in the list by dragging them into new positions.
|
157
|
+
* @type {boolean|undefined}
|
158
|
+
*/
|
159
|
+
sortable = false;
|
160
|
+
/**
|
161
|
+
* The value(s) of the selected option(s) in the popup list.
|
162
|
+
* This property can be a string or an array of strings, depending on whether multiple selections are allowed.
|
163
|
+
* @type {string|string[]|undefined}
|
164
|
+
*/
|
165
|
+
value;
|
166
|
+
activeIndex;
|
167
|
+
searchKeyword;
|
168
|
+
nothingToSelect = false;
|
169
|
+
searchInput;
|
170
|
+
body;
|
171
|
+
sortableObject;
|
172
|
+
locked = false;
|
201
173
|
render() {
|
202
174
|
return html `
|
203
175
|
<slot name="header"> </slot>
|
@@ -252,6 +224,53 @@ let OxPopupList = class OxPopupList extends OxPopup {
|
|
252
224
|
e.stopPropagation();
|
253
225
|
}
|
254
226
|
}
|
227
|
+
_onkeydown = function (e) {
|
228
|
+
e.stopPropagation();
|
229
|
+
switch (e.key) {
|
230
|
+
case 'Esc': // for IE/Edge
|
231
|
+
case 'Escape':
|
232
|
+
this.close();
|
233
|
+
break;
|
234
|
+
case 'Left': // for IE/Edge
|
235
|
+
case 'ArrowLeft':
|
236
|
+
case 'Up': // for IE/Edge
|
237
|
+
case 'ArrowUp':
|
238
|
+
this.activeIndex--;
|
239
|
+
break;
|
240
|
+
case 'Right': // for IE/Edge
|
241
|
+
case 'ArrowRight':
|
242
|
+
case 'Down': // for IE/Edge
|
243
|
+
case 'ArrowDown':
|
244
|
+
this.activeIndex++;
|
245
|
+
break;
|
246
|
+
case 'Enter':
|
247
|
+
case ' ':
|
248
|
+
case 'Spacebar': // for old firefox
|
249
|
+
this.setActive(this.activeIndex, true);
|
250
|
+
this.select();
|
251
|
+
break;
|
252
|
+
}
|
253
|
+
}.bind(this);
|
254
|
+
_onfocusout = function (e) {
|
255
|
+
const to = e.relatedTarget;
|
256
|
+
if (!this.contains(to)) {
|
257
|
+
/* If the focus has clearly moved to an element outside of my range, the ox-popup-list should be closed. */
|
258
|
+
// @ts-ignore for debug
|
259
|
+
!this.preventCloseOnBlur && !this.debug && !window.POPUP_DEBUG && this.close();
|
260
|
+
}
|
261
|
+
}.bind(this);
|
262
|
+
_onclick = function (e) {
|
263
|
+
e.stopPropagation();
|
264
|
+
// Check if the click event target is a checkbox
|
265
|
+
if (e.target.closest('input[type="checkbox"]')) {
|
266
|
+
return; // Do not proceed if it's a checkbox click
|
267
|
+
}
|
268
|
+
const option = e.target?.closest('[option]');
|
269
|
+
if (option) {
|
270
|
+
this.setActive(option, true);
|
271
|
+
this.select();
|
272
|
+
}
|
273
|
+
}.bind(this);
|
255
274
|
updated(changes) {
|
256
275
|
if (changes.has('activeIndex')) {
|
257
276
|
this.activeIndex !== undefined && this.setActive(this.activeIndex);
|