@operato/popup 10.11.0 โ†’ 10.15.0

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 (49) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/coverage/lcov-report/base.css +224 -0
  3. package/coverage/lcov-report/block-navigation.js +87 -0
  4. package/coverage/lcov-report/favicon.png +0 -0
  5. package/coverage/lcov-report/index.html +206 -0
  6. package/coverage/lcov-report/prettify.css +1 -0
  7. package/coverage/lcov-report/prettify.js +2 -0
  8. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  9. package/coverage/lcov-report/sorter.js +210 -0
  10. package/coverage/lcov.info +7675 -0
  11. package/dist/src/implementation.d.ts +13 -0
  12. package/dist/src/implementation.js +13 -0
  13. package/dist/src/implementation.js.map +1 -0
  14. package/dist/src/index.d.ts +1 -0
  15. package/dist/src/index.js +1 -0
  16. package/dist/src/index.js.map +1 -1
  17. package/dist/src/open-popup.d.ts +37 -13
  18. package/dist/src/open-popup.js +79 -12
  19. package/dist/src/open-popup.js.map +1 -1
  20. package/dist/src/ox-floating-overlay.d.ts +4 -1
  21. package/dist/src/ox-floating-overlay.js +19 -2
  22. package/dist/src/ox-floating-overlay.js.map +1 -1
  23. package/dist/src/ox-popup-actions.d.ts +36 -0
  24. package/dist/src/ox-popup-actions.js +129 -0
  25. package/dist/src/ox-popup-actions.js.map +1 -0
  26. package/dist/src/ox-prompt.d.ts +9 -3
  27. package/dist/src/ox-prompt.js +50 -42
  28. package/dist/src/ox-prompt.js.map +1 -1
  29. package/dist/src/popup-result.d.ts +19 -0
  30. package/dist/src/popup-result.js +53 -0
  31. package/dist/src/popup-result.js.map +1 -0
  32. package/dist/test/office-control-height.test.d.ts +1 -0
  33. package/dist/test/office-control-height.test.js +48 -0
  34. package/dist/test/office-control-height.test.js.map +1 -0
  35. package/dist/test/ox-popup-actions.test.d.ts +3 -0
  36. package/dist/test/ox-popup-actions.test.js +104 -0
  37. package/dist/test/ox-popup-actions.test.js.map +1 -0
  38. package/dist/test/ox-prompt-actions.test.d.ts +1 -0
  39. package/dist/test/ox-prompt-actions.test.js +77 -0
  40. package/dist/test/ox-prompt-actions.test.js.map +1 -0
  41. package/dist/test/popup-result.test.d.ts +1 -0
  42. package/dist/test/popup-result.test.js +114 -0
  43. package/dist/test/popup-result.test.js.map +1 -0
  44. package/dist/tsconfig.tsbuildinfo +1 -1
  45. package/package.json +14 -5
  46. package/test/office-control-height.test.ts +58 -0
  47. package/test/ox-popup-actions.test.ts +130 -0
  48. package/test/ox-prompt-actions.test.ts +99 -0
  49. package/test/popup-result.test.ts +150 -0
@@ -0,0 +1,13 @@
1
+ /**
2
+ * For code that plugs an openPopup implementation in (`setOpenPopupImplementation`) - not for code that
3
+ * opens popups.
4
+ *
5
+ * `claimHistoryBack` must only be called right before an implementation's own history.back(). A caller
6
+ * that calls it on its own takes the claim, and the popup's next real close is refused until the next
7
+ * popstate - the popup will not close.
8
+ *
9
+ * It lives on this subpath, not the package index that every popup opener imports, so it is not found
10
+ * by accident.
11
+ */
12
+ export { claimHistoryBack } from './popup-result.js';
13
+ export type { PopupImplementationHandle } from './open-popup.js';
@@ -0,0 +1,13 @@
1
+ /**
2
+ * For code that plugs an openPopup implementation in (`setOpenPopupImplementation`) - not for code that
3
+ * opens popups.
4
+ *
5
+ * `claimHistoryBack` must only be called right before an implementation's own history.back(). A caller
6
+ * that calls it on its own takes the claim, and the popup's next real close is refused until the next
7
+ * popstate - the popup will not close.
8
+ *
9
+ * It lives on this subpath, not the package index that every popup opener imports, so it is not found
10
+ * by accident.
11
+ */
12
+ export { claimHistoryBack } from './popup-result.js';
13
+ //# sourceMappingURL=implementation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"implementation.js","sourceRoot":"","sources":["../../src/implementation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA","sourcesContent":["/**\n * For code that plugs an openPopup implementation in (`setOpenPopupImplementation`) - not for code that\n * opens popups.\n *\n * `claimHistoryBack` must only be called right before an implementation's own history.back(). A caller\n * that calls it on its own takes the claim, and the popup's next real close is refused until the next\n * popstate - the popup will not close.\n *\n * It lives on this subpath, not the package index that every popup opener imports, so it is not found\n * by accident.\n */\nexport { claimHistoryBack } from './popup-result.js'\nexport type { PopupImplementationHandle } from './open-popup.js'\n"]}
@@ -3,4 +3,5 @@ export * from './ox-popup-list.js';
3
3
  export * from './ox-popup-menu.js';
4
4
  export * from './ox-popup-menuitem.js';
5
5
  export * from './ox-prompt.js';
6
+ export * from './ox-popup-actions.js';
6
7
  export * from './open-popup.js';
package/dist/src/index.js CHANGED
@@ -3,5 +3,6 @@ export * from './ox-popup-list.js';
3
3
  export * from './ox-popup-menu.js';
4
4
  export * from './ox-popup-menuitem.js';
5
5
  export * from './ox-prompt.js';
6
+ export * from './ox-popup-actions.js';
6
7
  export * from './open-popup.js';
7
8
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA;AAC7B,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA;AAClC,cAAc,wBAAwB,CAAA;AACtC,cAAc,gBAAgB,CAAA;AAE9B,cAAc,iBAAiB,CAAA","sourcesContent":["export * from './ox-popup.js'\nexport * from './ox-popup-list.js'\nexport * from './ox-popup-menu.js'\nexport * from './ox-popup-menuitem.js'\nexport * from './ox-prompt.js'\n\nexport * from './open-popup.js'\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA;AAC7B,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA;AAClC,cAAc,wBAAwB,CAAA;AACtC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,uBAAuB,CAAA;AAErC,cAAc,iBAAiB,CAAA","sourcesContent":["export * from './ox-popup.js'\nexport * from './ox-popup-list.js'\nexport * from './ox-popup-menu.js'\nexport * from './ox-popup-menuitem.js'\nexport * from './ox-prompt.js'\nexport * from './ox-popup-actions.js'\n\nexport * from './open-popup.js'\n"]}
@@ -34,26 +34,48 @@ export type PopupOptions = {
34
34
  };
35
35
  };
36
36
  /**
37
- * Popup handle object that will be returned openPopup
37
+ * What an openPopup implementation returns. An implementation makes two promises, and the tests count
38
+ * both for every implementation:
39
+ *
40
+ * 1. `onclosed` is called exactly once when the popup is gone, whichever way it went (its own close,
41
+ * ESC, backdrop, X, history back). `openPopup` settles the result there, so an implementation that
42
+ * forgets it leaves every awaiting opener hanging.
43
+ * 2. `close()` answers whether it closed anything. There is deliberately no default: treating "no
44
+ * answer" as closed would keep the value of a request that closed nothing, to surface later as the
45
+ * result of a dismissal; treating it as not closed would drop a real result. Both are wrong, so the
46
+ * type requires the answer.
47
+ */
48
+ export type PopupImplementationHandle = {
49
+ name: string;
50
+ /** True when this call closed the popup (or started closing it); false when it closed nothing. */
51
+ close: () => boolean;
52
+ closed: boolean;
53
+ onclosed?: () => void;
54
+ };
55
+ /**
56
+ * Popup handle object returned by openPopup
38
57
  *
39
58
  * @typedef {Object} PopupHandle
40
59
  * @property {String} [name] - popup instance name
41
- * @property {Function} [close] - call this function to close the popup.
60
+ * @property {Function} [close] - closes the popup. A value passed here becomes the result.
42
61
  * @property {Boolean} [closed] - state telling whether the popup is closed or not.
43
- * @property {Function} [onclosed] - set callback function on close. It will be called when the popup about to close.
62
+ * @property {Function} [onclosed] - callback called once when the popup is gone.
63
+ * @property {Promise} [result] - settles once when the popup is gone: the first value given to
64
+ * `close(value)` or `closePopup(element, value)`, or undefined when it was only dismissed.
44
65
  */
45
- export type PopupHandle = {
66
+ export type PopupHandle<R = unknown> = {
46
67
  name: string;
47
- close: () => void;
68
+ close: (result?: R) => void;
48
69
  closed: boolean;
49
70
  onclosed?: () => void;
71
+ result: Promise<R | undefined>;
50
72
  };
51
73
  /**
52
74
  * replace default openPopup implementation
53
75
  *
54
- * @param {(template: TemplateResult, options: PopupOptions) => PopupHandle} implementation
76
+ * @param {(template: TemplateResult, options: PopupOptions) => PopupImplementationHandle} implementation
55
77
  */
56
- export declare function setOpenPopupImplementation(implementation: (template: TemplateResult, options: PopupOptions) => PopupHandle): void;
78
+ export declare function setOpenPopupImplementation(implementation: (template: TemplateResult, options: PopupOptions) => PopupImplementationHandle): void;
57
79
  /**
58
80
  * open popup out of operato application environment
59
81
  *
@@ -61,12 +83,14 @@ export declare function setOpenPopupImplementation(implementation: (template: Te
61
83
  * @param {PopupOptions} options
62
84
  * @returns popup handle object. This object is used to close the popup.
63
85
  */
64
- export declare const openPopup: (template: TemplateResult, options?: PopupOptions) => PopupHandle;
86
+ export declare const openPopup: <R = unknown>(template: TemplateResult, options?: PopupOptions) => PopupHandle<R>;
65
87
  /**
66
- * open popup out of operato application environment
88
+ * close the popup that contains the element, from inside the popup's content
67
89
  *
68
- * @param {*} template html template to be rendered inside the popup
69
- * @param {PopupOptions} options
70
- * @returns popup handle object. This object is used to close the popup.
90
+ * The content usually does not hold the handle - openPopup returns it after the template exists - so
91
+ * this is the content's way to give the opener a result without knowing who opened it.
92
+ *
93
+ * @param {HTMLElement} element an element inside the popup content
94
+ * @param {*} [result] becomes the handle's result, unless another close request came first
71
95
  */
72
- export declare const closePopup: (element: HTMLElement) => void;
96
+ export declare const closePopup: (element: HTMLElement, ...result: [unknown?]) => void;
@@ -1,5 +1,6 @@
1
1
  import './ox-floating-overlay.js';
2
2
  import { html, render } from 'lit';
3
+ import { beginPopupResult, forgetPopupResult, recordPopupResult, takePopupResult } from './popup-result.js';
3
4
  /*
4
5
  * popup handling
5
6
  *
@@ -20,6 +21,14 @@ var popupSequence = 0;
20
21
  function defaultOpenPopup(template, options = {}) {
21
22
  const { title, size = 'large', closable = false, escapable = false, help, hovering, backdrop, movable = false, search, filter } = options;
22
23
  const name = `$popup-${popupSequence++}`;
24
+ /*
25
+ * Render each popup into its own fragment and move it into the body.
26
+ *
27
+ * Rendering straight into document.body made every popup share one lit part: the second
28
+ * openPopup reused the first popup's template instance and updated an overlay that had already
29
+ * removed itself from the document, so after one popup closed no other popup ever appeared.
30
+ */
31
+ const fragment = document.createDocumentFragment();
23
32
  render(html `
24
33
  <ox-floating-overlay
25
34
  id=${name}
@@ -38,26 +47,45 @@ function defaultOpenPopup(template, options = {}) {
38
47
  .filter=${filter}
39
48
  >${template}</ox-floating-overlay
40
49
  >
41
- `, document.body);
50
+ `, fragment);
51
+ document.body.appendChild(fragment);
42
52
  requestAnimationFrame(() => {
43
53
  dispatchEvent(new Event('resize'));
44
54
  });
45
55
  const popupHandle = {
46
56
  name,
47
57
  close: () => {
48
- const popup = document.body.querySelector(`#${name}`);
49
- popup?.close();
50
- popupHandle.onclosed && popupHandle.onclosed();
58
+ /*
59
+ * getElementById, not querySelector(`#${name}`): names start with `$`, which is not a valid CSS
60
+ * id selector, so querySelector threw and handle.close() never closed anything here.
61
+ */
62
+ const popup = document.getElementById(name);
63
+ if (!popup)
64
+ return false;
65
+ popup.close();
66
+ return true;
51
67
  },
52
68
  closed: false
53
69
  };
70
+ /*
71
+ * Report "closed" from the one place every path passes: the overlay leaving the document. It
72
+ * announces that itself (`overlay-closed`). Reporting from close() only - as before - missed ESC,
73
+ * the backdrop and X, so `closed` stayed false and `onclosed` never ran for those.
74
+ */
75
+ document.addEventListener('overlay-closed', function listener(e) {
76
+ if (name == e.detail) {
77
+ document.removeEventListener('overlay-closed', listener);
78
+ popupHandle.closed = true;
79
+ popupHandle.onclosed && popupHandle.onclosed();
80
+ }
81
+ });
54
82
  return popupHandle;
55
83
  }
56
84
  var openPopupImpl = defaultOpenPopup;
57
85
  /**
58
86
  * replace default openPopup implementation
59
87
  *
60
- * @param {(template: TemplateResult, options: PopupOptions) => PopupHandle} implementation
88
+ * @param {(template: TemplateResult, options: PopupOptions) => PopupImplementationHandle} implementation
61
89
  */
62
90
  export function setOpenPopupImplementation(implementation) {
63
91
  openPopupImpl = implementation;
@@ -70,19 +98,58 @@ export function setOpenPopupImplementation(implementation) {
70
98
  * @returns popup handle object. This object is used to close the popup.
71
99
  */
72
100
  export const openPopup = (template, options = {}) => {
73
- return openPopupImpl(template, options);
101
+ const handle = openPopupImpl(template, options);
102
+ const name = handle.name;
103
+ const implementationClose = handle.close;
104
+ beginPopupResult(name);
105
+ /*
106
+ * The result settles in one place: when the implementation reports the popup gone. Both entrances
107
+ * below only record. Whatever the path - close(value), closePopup(element, value), ESC, backdrop,
108
+ * X, history back - it settles exactly once.
109
+ */
110
+ let settle;
111
+ handle.result = new Promise(resolve => (settle = resolve));
112
+ let settled = false;
113
+ let callerOnclosed = handle.onclosed;
114
+ Object.defineProperty(handle, 'onclosed', {
115
+ configurable: true,
116
+ enumerable: true,
117
+ /* Callers still assign `handle.onclosed = fn`; the implementation still calls `handle.onclosed()`. */
118
+ get: () => () => {
119
+ if (settled)
120
+ return;
121
+ settled = true;
122
+ settle(takePopupResult(name));
123
+ callerOnclosed && callerOnclosed();
124
+ },
125
+ set: (fn) => {
126
+ callerOnclosed = fn;
127
+ }
128
+ });
129
+ handle.close = (value) => {
130
+ const recorded = recordPopupResult(name, value);
131
+ /* A request that closed nothing must not leave its value behind to surface on a later dismissal. */
132
+ if (!implementationClose() && recorded) {
133
+ forgetPopupResult(name);
134
+ }
135
+ };
136
+ return handle;
74
137
  };
75
138
  /**
76
- * open popup out of operato application environment
139
+ * close the popup that contains the element, from inside the popup's content
77
140
  *
78
- * @param {*} template html template to be rendered inside the popup
79
- * @param {PopupOptions} options
80
- * @returns popup handle object. This object is used to close the popup.
141
+ * The content usually does not hold the handle - openPopup returns it after the template exists - so
142
+ * this is the content's way to give the opener a result without knowing who opened it.
143
+ *
144
+ * @param {HTMLElement} element an element inside the popup content
145
+ * @param {*} [result] becomes the handle's result, unless another close request came first
81
146
  */
82
- export const closePopup = (element) => {
147
+ export const closePopup = (element, ...result) => {
83
148
  element.dispatchEvent(new CustomEvent('close-overlay', {
84
149
  bubbles: true,
85
- composed: true
150
+ composed: true,
151
+ /* Only carries a result when one was given - `closePopup(el)` stays a plain dismissal. */
152
+ detail: result.length > 0 ? { result: result[0] } : undefined
86
153
  }));
87
154
  };
88
155
  //# sourceMappingURL=open-popup.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"open-popup.js","sourceRoot":"","sources":["../../src/open-popup.ts"],"names":[],"mappings":"AAAA,OAAO,0BAA0B,CAAA;AAEjC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAkB,MAAM,KAAK,CAAA;AAsDlD;;;;;;;;GAQG;AACH,IAAI,aAAa,GAAG,CAAC,CAAA;AAErB;;;;;;GAMG;AACH,SAAS,gBAAgB,CAAC,QAAwB,EAAE,UAAwB,EAAE;IAC5E,MAAM,EACJ,KAAK,EACL,IAAI,GAAG,OAAO,EACd,QAAQ,GAAG,KAAK,EAChB,SAAS,GAAG,KAAK,EACjB,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,OAAO,GAAG,KAAK,EACf,MAAM,EACN,MAAM,EACP,GAAG,OAAO,CAAA;IACX,MAAM,IAAI,GAAG,UAAU,aAAa,EAAE,EAAE,CAAA;IAExC,MAAM,CACJ,IAAI,CAAA;;aAEK,IAAI;eACF,IAAI;oBACC,QAAQ;;oBAER,QAAQ;iBACX,KAAK,IAAI,EAAE;gBACZ,IAAI;gBACJ,IAAI;oBACA,QAAQ;qBACP,SAAS;sBACR,KAAK;mBACR,OAAO;kBACR,MAAM;kBACN,MAAM;WACb,QAAQ;;KAEd,EACD,QAAQ,CAAC,IAAI,CACd,CAAA;IAED,qBAAqB,CAAC,GAAG,EAAE;QACzB,aAAa,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;IACpC,CAAC,CAAC,CAAA;IAEF,MAAM,WAAW,GAAG;QAClB,IAAI;QACJ,KAAK,EAAE,GAAG,EAAE;YACV,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,IAAI,EAAE,CAAsB,CAAA;YAC1E,KAAK,EAAE,KAAK,EAAE,CAAA;YACd,WAAW,CAAC,QAAQ,IAAI,WAAW,CAAC,QAAQ,EAAE,CAAA;QAChD,CAAC;QACD,MAAM,EAAE,KAAK;KACC,CAAA;IAEhB,OAAO,WAAW,CAAA;AACpB,CAAC;AAED,IAAI,aAAa,GAAqE,gBAAgB,CAAA;AAEtG;;;;GAIG;AACH,MAAM,UAAU,0BAA0B,CACxC,cAAgF;IAEhF,aAAa,GAAG,cAAc,CAAA;AAChC,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,QAAwB,EAAE,UAAwB,EAAE,EAAe,EAAE;IAC7F,OAAO,aAAa,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;AACzC,CAAC,CAAA;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,OAAoB,EAAQ,EAAE;IACvD,OAAO,CAAC,aAAa,CACnB,IAAI,WAAW,CAAC,eAAe,EAAE;QAC/B,OAAO,EAAE,IAAI;QACb,QAAQ,EAAE,IAAI;KACf,CAAC,CACH,CAAA;AACH,CAAC,CAAA","sourcesContent":["import './ox-floating-overlay.js'\n\nimport { html, render, TemplateResult } from 'lit'\n\nimport { OxFloatingOverlay } from './ox-floating-overlay.js'\n\n/**\n * Options for popup\n *\n * @typedef {Object} PopupOptions\n * @property {String} [title] - popup title\n * @property {'center' | 'next' | 'edge'} [hovering] - hovering position (default: 'center'). 'edge' : edge of the HEADERBAR, 'next' : next of the clicked position.\n * @property {'large' | 'medium' | small'} [size] - popup size\n * @property {Boolean} [closable] - set whether the close 'X' button is shown on top-right most position (default true)\n * @property {Boolean} [escapable] - ESC closes the popup right away (default false โ€” ESC still works,\n * but asks first)\n * @property {Boolean} [backdrop] - set whether to do background masking around the pop-up. If true, it becomes modal (default true)\n * @property {Boolean} [movable] - set whether to be able to movable by the gesture dragging on header once the hovering option is 'center'\n * @property {String} [help] - inline help link\n */\nexport type PopupOptions = {\n title?: string\n hovering?: 'center' | 'next' | 'edge'\n size?: 'large' | 'medium' | 'small' | 'full'\n closable?: boolean\n escapable?: boolean\n backdrop?: boolean\n movable?: boolean\n help?: string\n search?: {\n value?: string\n handler?: (closure: any, value: string) => void\n placeholder?: string\n autofocus?: boolean\n }\n filter?: {\n handler?: (closure: any) => void\n }\n}\n\n/**\n * Popup handle object that will be returned openPopup\n *\n * @typedef {Object} PopupHandle\n * @property {String} [name] - popup instance name\n * @property {Function} [close] - call this function to close the popup.\n * @property {Boolean} [closed] - state telling whether the popup is closed or not.\n * @property {Function} [onclosed] - set callback function on close. It will be called when the popup about to close.\n */\nexport type PopupHandle = {\n name: string\n close: () => void\n closed: boolean\n onclosed?: () => void\n}\n\n/*\n * popup handling\n *\n * popup์€ overlay์˜ ํŠน๋ณ„ํ•œ ํ˜•ํƒœ์ด๋‹ค.\n * popup์€ open๋  ๋•Œ, viewpart๋ฅผ append ํ•˜๋ฉฐ, close ๋  ๋•Œ viewpart๋ฅผ remove ํ•œ๋‹ค.\n * - name: '$popup-${popupSequence}'\n * - position: VIEWPART_POSITION_HEADERBAR\n * - hovering: 'center' | 'next' | 'edge'\n */\nvar popupSequence = 0\n\n/**\n * default openPopup implementation for operato application environment\n *\n * @param {*} template html template to be rendered inside the popup\n * @param {PopupOptions} options\n * @returns popup handle object. This object is used to close the popup.\n */\nfunction defaultOpenPopup(template: TemplateResult, options: PopupOptions = {}): PopupHandle {\n const {\n title,\n size = 'large',\n closable = false,\n escapable = false,\n help,\n hovering,\n backdrop,\n movable = false,\n search,\n filter\n } = options\n const name = `$popup-${popupSequence++}`\n\n render(\n html`\n <ox-floating-overlay\n id=${name}\n name=${name}\n .backdrop=${backdrop}\n direction=\"down\"\n .hovering=${hovering}\n .title=${title || ''}\n .help=${help}\n .size=${size}\n .closable=${closable}\n .escapable=${escapable}\n .historical=${false}\n .movable=${movable}\n .search=${search}\n .filter=${filter}\n >${template}</ox-floating-overlay\n >\n `,\n document.body\n )\n\n requestAnimationFrame(() => {\n dispatchEvent(new Event('resize'))\n })\n\n const popupHandle = {\n name,\n close: () => {\n const popup = document.body.querySelector(`#${name}`) as OxFloatingOverlay\n popup?.close()\n popupHandle.onclosed && popupHandle.onclosed()\n },\n closed: false\n } as PopupHandle\n\n return popupHandle\n}\n\nvar openPopupImpl: (template: TemplateResult, options: PopupOptions) => PopupHandle = defaultOpenPopup\n\n/**\n * replace default openPopup implementation\n *\n * @param {(template: TemplateResult, options: PopupOptions) => PopupHandle} implementation\n */\nexport function setOpenPopupImplementation(\n implementation: (template: TemplateResult, options: PopupOptions) => PopupHandle\n) {\n openPopupImpl = implementation\n}\n\n/**\n * open popup out of operato application environment\n *\n * @param {*} template html template to be rendered inside the popup\n * @param {PopupOptions} options\n * @returns popup handle object. This object is used to close the popup.\n */\nexport const openPopup = (template: TemplateResult, options: PopupOptions = {}): PopupHandle => {\n return openPopupImpl(template, options)\n}\n\n/**\n * open popup out of operato application environment\n *\n * @param {*} template html template to be rendered inside the popup\n * @param {PopupOptions} options\n * @returns popup handle object. This object is used to close the popup.\n */\nexport const closePopup = (element: HTMLElement): void => {\n element.dispatchEvent(\n new CustomEvent('close-overlay', {\n bubbles: true,\n composed: true\n })\n )\n}\n"]}
1
+ {"version":3,"file":"open-popup.js","sourceRoot":"","sources":["../../src/open-popup.ts"],"names":[],"mappings":"AAAA,OAAO,0BAA0B,CAAA;AAEjC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAkB,MAAM,KAAK,CAAA;AAGlD,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AA2E3G;;;;;;;;GAQG;AACH,IAAI,aAAa,GAAG,CAAC,CAAA;AAErB;;;;;;GAMG;AACH,SAAS,gBAAgB,CAAC,QAAwB,EAAE,UAAwB,EAAE;IAC5E,MAAM,EACJ,KAAK,EACL,IAA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AE,EAAE;YACpC,cAAc,GAAG,EAAE,CAAA;QACrB,CAAC;KACF,CAAC,CAAA;IAEF,MAAM,CAAC,KAAK,GAAG,CAAC,KAAS,EAAE,EAAE;QAC3B,MAAM,QAAQ,GAAG,iBAAiB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;QAE/C,oGAAoG;QACpG,IAAI,CAAC,mBAAmB,EAAE,IAAI,QAAQ,EAAE,CAAC;YACvC,iBAAiB,CAAC,IAAI,CAAC,CAAA;QACzB,CAAC;IACH,CAAC,CAAA;IAED,OAAO,MAAM,CAAA;AACf,CAAC,CAAA;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,OAAoB,EAAE,GAAG,MAAkB,EAAQ,EAAE;IAC9E,OAAO,CAAC,aAAa,CACnB,IAAI,WAAW,CAAC,eAAe,EAAE;QAC/B,OAAO,EAAE,IAAI;QACb,QAAQ,EAAE,IAAI;QACd,0FAA0F;QAC1F,MAAM,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS;KAC9D,CAAC,CACH,CAAA;AACH,CAAC,CAAA","sourcesContent":["import './ox-floating-overlay.js'\n\nimport { html, render, TemplateResult } from 'lit'\n\nimport { OxFloatingOverlay } from './ox-floating-overlay.js'\nimport { beginPopupResult, forgetPopupResult, recordPopupResult, takePopupResult } from './popup-result.js'\n\n/**\n * Options for popup\n *\n * @typedef {Object} PopupOptions\n * @property {String} [title] - popup title\n * @property {'center' | 'next' | 'edge'} [hovering] - hovering position (default: 'center'). 'edge' : edge of the HEADERBAR, 'next' : next of the clicked position.\n * @property {'large' | 'medium' | small'} [size] - popup size\n * @property {Boolean} [closable] - set whether the close 'X' button is shown on top-right most position (default true)\n * @property {Boolean} [escapable] - ESC closes the popup right away (default false โ€” ESC still works,\n * but asks first)\n * @property {Boolean} [backdrop] - set whether to do background masking around the pop-up. If true, it becomes modal (default true)\n * @property {Boolean} [movable] - set whether to be able to movable by the gesture dragging on header once the hovering option is 'center'\n * @property {String} [help] - inline help link\n */\nexport type PopupOptions = {\n title?: string\n hovering?: 'center' | 'next' | 'edge'\n size?: 'large' | 'medium' | 'small' | 'full'\n closable?: boolean\n escapable?: boolean\n backdrop?: boolean\n movable?: boolean\n help?: string\n search?: {\n value?: string\n handler?: (closure: any, value: string) => void\n placeholder?: string\n autofocus?: boolean\n }\n filter?: {\n handler?: (closure: any) => void\n }\n}\n\n/**\n * What an openPopup implementation returns. An implementation makes two promises, and the tests count\n * both for every implementation:\n *\n * 1. `onclosed` is called exactly once when the popup is gone, whichever way it went (its own close,\n * ESC, backdrop, X, history back). `openPopup` settles the result there, so an implementation that\n * forgets it leaves every awaiting opener hanging.\n * 2. `close()` answers whether it closed anything. There is deliberately no default: treating \"no\n * answer\" as closed would keep the value of a request that closed nothing, to surface later as the\n * result of a dismissal; treating it as not closed would drop a real result. Both are wrong, so the\n * type requires the answer.\n */\nexport type PopupImplementationHandle = {\n name: string\n /** True when this call closed the popup (or started closing it); false when it closed nothing. */\n close: () => boolean\n closed: boolean\n onclosed?: () => void\n}\n\n/**\n * Popup handle object returned by openPopup\n *\n * @typedef {Object} PopupHandle\n * @property {String} [name] - popup instance name\n * @property {Function} [close] - closes the popup. A value passed here becomes the result.\n * @property {Boolean} [closed] - state telling whether the popup is closed or not.\n * @property {Function} [onclosed] - callback called once when the popup is gone.\n * @property {Promise} [result] - settles once when the popup is gone: the first value given to\n * `close(value)` or `closePopup(element, value)`, or undefined when it was only dismissed.\n */\nexport type PopupHandle<R = unknown> = {\n name: string\n close: (result?: R) => void\n closed: boolean\n onclosed?: () => void\n result: Promise<R | undefined>\n}\n\n/*\n * popup handling\n *\n * popup์€ overlay์˜ ํŠน๋ณ„ํ•œ ํ˜•ํƒœ์ด๋‹ค.\n * popup์€ open๋  ๋•Œ, viewpart๋ฅผ append ํ•˜๋ฉฐ, close ๋  ๋•Œ viewpart๋ฅผ remove ํ•œ๋‹ค.\n * - name: '$popup-${popupSequence}'\n * - position: VIEWPART_POSITION_HEADERBAR\n * - hovering: 'center' | 'next' | 'edge'\n */\nvar popupSequence = 0\n\n/**\n * default openPopup implementation for operato application environment\n *\n * @param {*} template html template to be rendered inside the popup\n * @param {PopupOptions} options\n * @returns popup handle object. This object is used to close the popup.\n */\nfunction defaultOpenPopup(template: TemplateResult, options: PopupOptions = {}): PopupImplementationHandle {\n const {\n title,\n size = 'large',\n closable = false,\n escapable = false,\n help,\n hovering,\n backdrop,\n movable = false,\n search,\n filter\n } = options\n const name = `$popup-${popupSequence++}`\n\n /*\n * Render each popup into its own fragment and move it into the body.\n *\n * Rendering straight into document.body made every popup share one lit part: the second\n * openPopup reused the first popup's template instance and updated an overlay that had already\n * removed itself from the document, so after one popup closed no other popup ever appeared.\n */\n const fragment = document.createDocumentFragment()\n\n render(\n html`\n <ox-floating-overlay\n id=${name}\n name=${name}\n .backdrop=${backdrop}\n direction=\"down\"\n .hovering=${hovering}\n .title=${title || ''}\n .help=${help}\n .size=${size}\n .closable=${closable}\n .escapable=${escapable}\n .historical=${false}\n .movable=${movable}\n .search=${search}\n .filter=${filter}\n >${template}</ox-floating-overlay\n >\n `,\n fragment\n )\n\n document.body.appendChild(fragment)\n\n requestAnimationFrame(() => {\n dispatchEvent(new Event('resize'))\n })\n\n const popupHandle: PopupImplementationHandle = {\n name,\n close: () => {\n /*\n * getElementById, not querySelector(`#${name}`): names start with `$`, which is not a valid CSS\n * id selector, so querySelector threw and handle.close() never closed anything here.\n */\n const popup = document.getElementById(name) as OxFloatingOverlay | null\n if (!popup) return false\n\n popup.close()\n return true\n },\n closed: false\n }\n\n /*\n * Report \"closed\" from the one place every path passes: the overlay leaving the document. It\n * announces that itself (`overlay-closed`). Reporting from close() only - as before - missed ESC,\n * the backdrop and X, so `closed` stayed false and `onclosed` never ran for those.\n */\n document.addEventListener('overlay-closed', function listener(e) {\n if (name == (e as CustomEvent).detail) {\n document.removeEventListener('overlay-closed', listener)\n popupHandle.closed = true\n popupHandle.onclosed && popupHandle.onclosed()\n }\n })\n\n return popupHandle\n}\n\nvar openPopupImpl: (template: TemplateResult, options: PopupOptions) => PopupImplementationHandle = defaultOpenPopup\n\n/**\n * replace default openPopup implementation\n *\n * @param {(template: TemplateResult, options: PopupOptions) => PopupImplementationHandle} implementation\n */\nexport function setOpenPopupImplementation(\n implementation: (template: TemplateResult, options: PopupOptions) => PopupImplementationHandle\n) {\n openPopupImpl = implementation\n}\n\n/**\n * open popup out of operato application environment\n *\n * @param {*} template html template to be rendered inside the popup\n * @param {PopupOptions} options\n * @returns popup handle object. This object is used to close the popup.\n */\nexport const openPopup = <R = unknown>(template: TemplateResult, options: PopupOptions = {}): PopupHandle<R> => {\n const handle = openPopupImpl(template, options) as unknown as PopupHandle<R>\n const name = handle.name\n const implementationClose = handle.close as unknown as () => boolean\n\n beginPopupResult(name)\n\n /*\n * The result settles in one place: when the implementation reports the popup gone. Both entrances\n * below only record. Whatever the path - close(value), closePopup(element, value), ESC, backdrop,\n * X, history back - it settles exactly once.\n */\n let settle!: (value: R | undefined) => void\n handle.result = new Promise<R | undefined>(resolve => (settle = resolve))\n\n let settled = false\n let callerOnclosed = handle.onclosed\n\n Object.defineProperty(handle, 'onclosed', {\n configurable: true,\n enumerable: true,\n /* Callers still assign `handle.onclosed = fn`; the implementation still calls `handle.onclosed()`. */\n get: () => () => {\n if (settled) return\n settled = true\n settle(takePopupResult(name) as R | undefined)\n callerOnclosed && callerOnclosed()\n },\n set: (fn: (() => void) | undefined) => {\n callerOnclosed = fn\n }\n })\n\n handle.close = (value?: R) => {\n const recorded = recordPopupResult(name, value)\n\n /* A request that closed nothing must not leave its value behind to surface on a later dismissal. */\n if (!implementationClose() && recorded) {\n forgetPopupResult(name)\n }\n }\n\n return handle\n}\n\n/**\n * close the popup that contains the element, from inside the popup's content\n *\n * The content usually does not hold the handle - openPopup returns it after the template exists - so\n * this is the content's way to give the opener a result without knowing who opened it.\n *\n * @param {HTMLElement} element an element inside the popup content\n * @param {*} [result] becomes the handle's result, unless another close request came first\n */\nexport const closePopup = (element: HTMLElement, ...result: [unknown?]): void => {\n element.dispatchEvent(\n new CustomEvent('close-overlay', {\n bubbles: true,\n composed: true,\n /* Only carries a result when one was given - `closePopup(el)` stays a plain dismissal. */\n detail: result.length > 0 ? { result: result[0] } : undefined\n })\n )\n}\n"]}
@@ -151,5 +151,8 @@ export declare class OxFloatingOverlay extends LitElement {
151
151
  * When called, this method removes the overlay element, effectively hiding it from the user interface.
152
152
  */
153
153
  close(): void;
154
- onClose(e: Event, escape?: boolean): true | undefined;
154
+ onClose(e: Event, escape?: boolean, request?: {
155
+ result: unknown;
156
+ }): true | undefined;
157
+ private recordResult;
155
158
  }
@@ -9,6 +9,7 @@ import { i18next } from '@operato/i18n';
9
9
  import { OxPrompt } from './ox-prompt.js';
10
10
  import { ScrollbarStyles } from '@operato/styles';
11
11
  import { isHandheldDevice } from '@operato/utils';
12
+ import { claimHistoryBack, recordPopupResult } from './popup-result.js';
12
13
  function getPoint(e) {
13
14
  if (e.button == 0) {
14
15
  return {
@@ -490,7 +491,7 @@ let OxFloatingOverlay = class OxFloatingOverlay extends LitElement {
490
491
  size=${this.size || 'medium'}
491
492
  @close-overlay=${(e) => {
492
493
  e.stopPropagation();
493
- this.onClose(e);
494
+ this.onClose(e, false, e.detail);
494
495
  }}
495
496
  @transitionstart=${(e) => {
496
497
  /* to hide scrollbar during transition */
@@ -724,7 +725,7 @@ let OxFloatingOverlay = class OxFloatingOverlay extends LitElement {
724
725
  close() {
725
726
  this.parentNode?.removeChild(this);
726
727
  }
727
- onClose(e, escape) {
728
+ onClose(e, escape, request) {
728
729
  e.stopPropagation();
729
730
  /* ํ˜„์žฌ overlay state๋ฅผ ํ™•์ธํ•ด์„œ, ์ž์‹ ์ด ํฌํ•จํ•˜๊ณ  ์žˆ๋Š” ํ…œํ”Œ๋ฆฟ์ธ ๊ฒฝ์šฐ์— history.back() ํ•œ๋‹ค. */
730
731
  if (this.historical) {
@@ -737,12 +738,28 @@ let OxFloatingOverlay = class OxFloatingOverlay extends LitElement {
737
738
  if (escape && !overlay.escapable) {
738
739
  return true;
739
740
  }
741
+ /* A second close in the same tick would see the same state and go back one page too far. */
742
+ if (!claimHistoryBack(overlay.name)) {
743
+ return;
744
+ }
745
+ this.recordResult(request);
740
746
  history.back();
741
747
  }
742
748
  else {
749
+ this.recordResult(request);
743
750
  this.close();
744
751
  }
745
752
  }
753
+ /*
754
+ * A value from the content (`closePopup(element, value)`) is recorded only once the overlay is really
755
+ * going to close, and nothing settles here - the result settles when the overlay leaves the document,
756
+ * where every way of closing ends. If another request recorded first, this value is dropped.
757
+ */
758
+ recordResult(request) {
759
+ if (request && 'result' in request) {
760
+ recordPopupResult(this.name, request.result);
761
+ }
762
+ }
746
763
  };
747
764
  __decorate([
748
765
  property({ type: Boolean })
@@ -1 +1 @@
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,OAAO,EAAE,MAAM,eAAe,CAAA;AAEvC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,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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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 { i18next } from '@operato/i18n'\n\nimport { OxPrompt } from './ox-prompt.js'\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 /*\n * โ”€โ”€ ๊ทธ๋ฆผ์ž๋Š” ์ธต์œผ๋กœ ์Œ“๋Š”๋‹ค โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€\n * ์ „์—๋Š” 2px 3px 10px 5px ์˜€๋‹ค โ€” ์˜ค๋ฅธ์ชฝ ์•„๋ž˜๋กœ ์น˜์šฐ์นœ ๋ฐ๋‹ค 5px ํผ์ง์ด ์žˆ์–ด์„œ ์ƒ์ž ๋„ค ๋ณ€์—\n * ํšŒ์ƒ‰ ํ…Œ๋ฅผ ๋‘๋ฅธ ๊ฒƒ์ฒ˜๋Ÿผ ๋ณด์˜€๋‹ค. ๋–  ์žˆ๋Š” ๋А๋‚Œ์ด ์•„๋‹ˆ๋ผ ๋ง๊ทธ๋ฆฐ ๋А๋‚Œ์ด๋‹ค.\n *\n * ๊ฐ€๊นŒ์šด ์ธต ํ•˜๋‚˜๋กœ ๊ฒฝ๊ณ„๋ฅผ ์„ธ์šฐ๊ณ , ๋จผ ์ธต ํ•˜๋‚˜๋กœ ๋†’์ด๋ฅผ ๋งŒ๋“ ๋‹ค. ๋จผ ์ธต์€ ์œ„๋กœ ํผ์ง€์ง€ ์•Š๊ฒŒ\n * ์Œ์ˆ˜ spread ๋ฅผ ์ค€๋‹ค โ€” ๋น›์ด ์œ„์—์„œ ์˜จ๋‹ค๋Š” ๊ทธ ๊ทœ์น™๋งŒ ์ง€์ผœ๋„ ์ƒ์ž๊ฐ€ ๋œฌ๋‹ค.\n */\n box-shadow:\n 0 1px 2px rgba(0, 0, 0, 0.06),\n 0 16px 40px -12px rgba(0, 0, 0, 0.28);\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 /*\n * โ”€โ”€ ํ…Œ๋‘๋ฆฌ๋Š” ์‹ค์„  ํ•œ ์˜ฌ, ๋ชจ์„œ๋ฆฌ๋Š” ๋‘ฅ๊ธ€๊ฒŒ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€\n * 2px outline ์ด์—ˆ๋‹ค. ํ™”๋ฉด์—์„œ ๊ฐ€์žฅ ๊ตต๊ณ  ๊ฐ€์žฅ ์ง„ํ•œ ์„ ์ด ์ƒ์ž์˜ ํ…Œ๋‘๋ฆฌ์—ฌ์„œ, ์•ˆ์— ๋“  ๋‚ด์šฉ๋ณด๋‹ค\n * ์ƒ์ž๊ฐ€ ๋จผ์ € ๋ณด์˜€๋‹ค. ๊ฒฝ๊ณ„๋Š” ํ•œ ์˜ฌ๋กœ ์ถฉ๋ถ„ํ•˜๋‹ค โ€” ๋‚˜๋จธ์ง€๋Š” ๊ทธ๋ฆผ์ž๊ฐ€ ๋งก๋Š”๋‹ค.\n *\n * ๋ชจ์„œ๋ฆฌ๋„ ๊ฐ์ด์—ˆ๋‹ค. ์ด ์ œํ’ˆ์˜ ์นด๋“œยทํ‘œ๋Š” ๋ชจ๋‘ ๋‘ฅ๊ธ€๋‹ค(10~14px). ํŒ์—…๋งŒ ๊ฐ์ด๋ฉด ๊ทธ ํ•˜๋‚˜๊ฐ€\n * ๋”ด ์„ธ๋Œ€์˜ ๊ฒƒ์œผ๋กœ ๋ณด์ธ๋‹ค.\n *\n * โ”€โ”€ --popup-radius ๋Š” **์นด๋“œ์˜ ๋ชจ์„œ๋ฆฌ**๋‹ค. ์—ฌ๊ธฐ๊ฐ€ ๊ทธ ์ž„์ž๋‹ค โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€\n * ์ด ๊ฐ’์ด ํŒ์—… ์•ˆ ์ปจํŠธ๋กค์˜ ๋ชจ์„œ๋ฆฌ๋ฅผ ํ•จ๊ป˜ ์ •ํ•œ๋‹ค โ€” ๋ชจ์„œ๋ฆฌ๋Š” ๋‹ด๋Š” ๋ฉด์„ ๋”ฐ๋ฅธ๋‹ค(๋™์‹ฌ ๋ชจ์„œ๋ฆฌ).\n * ๊ทธ ์ง์€ --popup-control-radius ์ด๊ณ  CommonPopupStyles ๊ฐ€ ์„ ์–ธํ•œ๋‹ค. ์นด๋“œ๋ฅผ ๊ฐ์ง€๊ฒŒ\n * ํ•˜๋ ค๋ฉด ๋‘ ๊ฐ’์„ **ํ•จ๊ป˜** ๋‚ด๋ ค๋ผ. ํ•œ์ชฝ๋งŒ ๋ฐ”๊พธ๋ฉด ๋‘ฅ๊ทผ ํ‹€์— ๊ฐ์ง„ ํŒ์ด ๋ฐ•ํžŒ๋‹ค.\n */\n border: 1px solid var(--md-sys-color-outline-variant);\n border-radius: var(--popup-radius, 16px);\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 [hovering='center'][size='full'] {\n width: var(--overlay-center-full-width, 100%);\n height: var(--overlay-center-full-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 /*\n * for header style\n *\n * primary ๋Š” ์–ด๋‘์šด ํ‘œ๋ฉด ์œ„์— ๋†“๋Š” ๊ฐ•์กฐ์ƒ‰์ด๋ผ ํฐ ๋ฉด์„ ์ฑ„์šฐ๋ฉด ๋‹คํฌ์—์„œ ๋ฐ์€ ๋ ๊ฐ€ ๋œ๋‹ค\n * (์‹ค์ œ๋กœ ํŒ์—… ์ œ๋ชฉ์ค„์ด ํƒ„์ƒ‰ ๋ธ”๋ก์œผ๋กœ ๋ณด์˜€๋‹ค). ์ œ๋ชฉ์ค„์€ ํ‘œ๋ฉด์ด๋ฏ€๋กœ container ์—ญํ• ์„ ์“ด๋‹ค.\n * ์•ฑ์ด ์กฐ์ •ํ•˜๋ ค๋ฉด --popup-header-background / --popup-header-color ๋ฅผ ์ง€์ •ํ•œ๋‹ค.\n */\n [header] {\n display: flex;\n flex-direction: row;\n align-items: center;\n /*\n * ๋จธ๋ฆฌ๋Š” ์Šฌ๋ž˜๋ธŒ๊ฐ€ ์•„๋‹ˆ๋‹ค. ์ฑ„์›€๊ณผ ์•„๋ž˜ ์‹ค์„ ์„ ๋‘˜ ๋‹ค ์“ฐ๊ณ  ์žˆ์—ˆ๊ณ , ์ฑ„์›€์ด ํ•œ ๋‹จ ์ง„ํ•ด์„œ ๊ทธ ๋ ๊ฐ€\n * ์•ˆ์— ๋“  ๋‚ด์šฉ๋ณด๋‹ค ๋ฌด๊ฑฐ์› ๋‹ค. ํ•œ ๋‹จ ๋‚ฎ์ถ˜๋‹ค โ€” ์„ ์€ ๋‚จ๊ธด๋‹ค(๋ชฉ๋ก์ด ์˜ฌ๋ผ์˜ฌ ๋•Œ ๊ทธ ์„ ์ด ๋จธ๋ฆฌ๋ฅผ ๋งํ•œ๋‹ค).\n */\n background-color: var(--popup-header-background, var(--md-sys-color-surface-container-low));\n font-weight: var(--md-sys-typescale-label-large-weight, var(--md-ref-typeface-weight-medium, 500));\n color: var(--popup-header-color, var(--md-sys-color-on-surface));\n border-bottom: 1px solid var(--md-sys-color-outline-variant);\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 /*\n * โ”€โ”€ ๋จธ๋ฆฌ์˜ ์•„์ด์ฝ˜์€ **๊พธ๋ฐˆ์ด ์•„๋‹ˆ๋ผ ๊ณ๊ฒƒ**์ด๋‹ค โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€\n *\n * ๋‹ซ๊ธฐ์™€ ์†์žก์ด๊ฐ€ ์ œ๋ชฉ๊ณผ ๊ฐ™์€ ์ž‰ํฌ์— 24px ์˜€๋‹ค. ์ œ๋ชฉ์ด 16px ์ด๋‹ˆ **๊ณ๊ฒƒ์ด ๋‚ด์šฉ๋ณด๋‹ค ๊ตต๊ณ \n * ์ปธ๋‹ค** โ€” ํŒ์—…์„ ์—ด๋ฉด ๋ˆˆ์ด ๋จผ์ € โœ• ๋กœ ๊ฐ”๋‹ค.\n *\n * ํฌ๊ธฐ๋Š” ์ด ์ œํ’ˆ์˜ ์•„์ด์ฝ˜ ๋ˆˆ๊ธˆ(18~19px)์— ๋งž์ถ”๊ณ , ์ƒ‰์€ ํ•œ ๋‹จ ํ๋ฆฌ๊ฒŒ ๋‘์—ˆ๋‹ค๊ฐ€ ๋งˆ์šฐ์Šค๋ฅผ\n * ์˜ฌ๋ฆด ๋•Œ๋งŒ ์ง™์–ด์ง„๋‹ค. ๋ˆ„๋ฅผ ์ž๋ฆฌ๋Š” ์—ฌ๋ฐฑ์œผ๋กœ ๋„“ํ˜€ ๋‘”๋‹ค โ€” ์•„์ด์ฝ˜์ด ์ž‘์•„๋„ 28px ์•ˆ์—์„œ ๋ˆŒ๋ฆฐ๋‹ค.\n *\n * ์†์žก์ด(drag_indicator)๋Š” ๊ทธ์ค‘ **๊ฐ€์žฅ ํ๋ฆฌ๋‹ค.** ๊ทธ๊ฒƒ์€ ๋™์ž‘์ด ์•„๋‹ˆ๋ผ ใ€Œ์—ฌ๊ธฐ๋ฅผ ์žก์œผ๋ฉด\n * ์›€์ง์ธ๋‹คใ€๋Š” ํ‘œ์‹œ์ด๊ณ , ์žก์œผ๋ ค๋Š” ์‚ฌ๋žŒ์€ ์ด๋ฏธ ๊ทธ ์ž๋ฆฌ๋ฅผ ์•ˆ๋‹ค.\n */\n /*\n * ์•ฑ์ด --popup-header-background ๋ฅผ primary ๊ฐ™์€ ์ง™์€ ์ƒ‰์œผ๋กœ ๋ฐ”๊พธ๋ฉด ์•„์ด์ฝ˜๋„ ํ•จ๊ป˜ ๋ฐ์•„์ ธ์•ผ ํ•œ๋‹ค.\n * --popup-header-icon-color ํ•˜๋‚˜๋กœ ๋‹ซ๊ธฐ/๋’ค๋กœ/์†์žก์ด ์ƒ‰์„ ๋งž์ถ”๊ณ , ํ˜ธ๋ฒ„ ๋ฉด์€ --popup-header-icon-hover-background.\n */\n [header] md-icon {\n --md-icon-size: 18px;\n\n padding: 5px;\n border-radius: 999em;\n color: var(--popup-header-icon-color, var(--md-sys-color-outline));\n transition:\n color 0.12s ease-out,\n background-color 0.12s ease-out;\n }\n\n [header] md-icon[historyback]:hover,\n [header] md-icon[close]:hover {\n color: var(--popup-header-icon-hover-color, var(--md-sys-color-on-surface));\n background-color: var(--popup-header-icon-hover-background, var(--md-sys-color-surface-container-high));\n }\n\n /* ์†์žก์ด๋Š” ๋ˆŒ๋ฆฌ๋Š” ๊ฒƒ์ด ์•„๋‹ˆ๋ผ ์žกํžˆ๋Š” ๊ฒƒ์ด๋‹ค. ๋ฉด์„ ์ฃผ์ง€ ์•Š๊ณ  ์ƒ‰๋งŒ ํ•œ ๋‹จ ์˜ฌ๋ฆฐ๋‹ค. */\n [header] md-icon:not([close]):not([historyback]) {\n color: var(--popup-header-icon-color, var(--md-sys-color-outline-variant));\n opacity: var(--popup-header-handle-opacity, 1);\n cursor: grab;\n }\n\n [header] md-icon:not([close]):not([historyback]):hover {\n color: var(--popup-header-icon-color, var(--md-sys-color-outline));\n opacity: 1;\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' | 'full'\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 /**\n * ESC ๋กœ ๋ฐ”๋กœ ๋‹ซ์•„๋„ ๋˜๋‚˜.\n *\n * ์ด ์†์„ฑ์ด **์—†์—ˆ๋‹ค.** `openPopup({ escapable: true })` ๋กœ ์ค˜๋„ ๋ถ€ํ’ˆ๊นŒ์ง€ ์˜ค์ง€ ์•Š์•˜๊ณ , ๊ฐ’์€\n * ๋ธŒ๋ผ์šฐ์ € ์ด๋ ฅ ์ƒํƒœ์—๋งŒ ๋‹ด๊ฒจ ๋ฐ”ํƒ• ํด๋ฆญ ํŒ์ •์—๋งŒ ์“ฐ์˜€๋‹ค. ๊ทธ๋ž˜์„œ ์ด ๊ฐ’์„ ์ฐธ์œผ๋กœ ์ค€ ํŒ์—…๋„ ESC\n * ๋กœ๋Š” ๋‹ซํžˆ์ง€ ์•Š์•˜๋‹ค.\n *\n * ๊ธฐ๋ณธ๊ฐ’์€ ๊ฑฐ์ง“์ด๋‹ค โ€” ์žƒ์„ ๊ฒƒ์ด ์žˆ๋Š” ํŒ์—…์ด ์‹ค์ˆ˜๋กœ ๋‹ซํžˆ์ง€ ์•Š๊ฒŒ. ๊ฑฐ์ง“์ด์–ด๋„ ESC ๋Š” ๋“ฃ๋Š”๋‹ค.\n * ๋‹ซ์„์ง€ ๋ฌผ์–ด๋ณธ๋‹ค(`onEscape`).\n */\n @property({ type: Boolean }) escapable?: boolean = false\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\n role=\"button\"\n tabindex=${this.closable ? 0 : -1}\n @click=${(e: Event) => this.onClose(e)}\n @keydown=${(e: KeyboardEvent) => this.onActivateKey(e, () => this.onClose(e))}\n ?closable=${this.closable}\n historyback\n >arrow_back</md-icon\n >\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 || ''}&nbsp;${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\n role=\"button\"\n tabindex=\"0\"\n @click=${(e: MouseEvent) => filterHandler(this.firstElementChild)}\n @keydown=${(e: KeyboardEvent) =>\n this.onActivateKey(e, () => filterHandler(this.firstElementChild))}\n >tune</md-icon\n >`\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\n role=\"button\"\n tabindex=${this.closable ? 0 : -1}\n title=${i18next.t('button.close', { defaultValue: 'close' })}\n @click=${(e: Event) => this.onClose(e)}\n @keydown=${(e: KeyboardEvent) => this.onActivateKey(e, () => this.onClose(e))}\n ?closable=${this.closable}\n close\n >close</md-icon\n >\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 /**\n * ํŒ์—…์„ ์—ฐ ์ž๋ฆฌ. **๋‹ซํžˆ๋ฉด ์—ฌ๊ธฐ๋กœ ๋Œ๋ ค์ค€๋‹ค.**\n *\n * ์•ˆ ๋Œ๋ ค์ฃผ๋ฉด ํฌ์ปค์Šค๊ฐ€ body ๋กœ ๋–จ์–ด์ง„๋‹ค. ํ‚ค๋ณด๋“œ๋กœ ์ผํ•˜๋Š” ์‚ฌ๋žŒ์€ ์ž๊ธฐ ์ž๋ฆฌ๋ฅผ ์žƒ๊ณ ,\n * ๊ทธ๋ฆฌ๋“œ์—์„œ๋Š” ํŒ์—…์„ ๋‹ซ์ž๋งˆ์ž ํ™”์‚ดํ‘œ๊ฐ€ ์•ˆ ๋จน๋Š”๋‹ค. ๋Œ€ํ™”์ƒ์ž์˜ ํ‘œ์ค€ ๋™์ž‘์ด๋‹ค\n * (WAI-ARIA ์˜ dialog ํŒจํ„ด).\n */\n /**\n * Enter ยท Space ๋กœ๋„ ๋ˆŒ๋ฆฐ๋‹ค.\n *\n * ๋จธ๋ฆฌ์˜ ํ‘œ์‹๋“ค์€ `md-icon` ์ด๋ผ **ํ‚ค๋ณด๋“œ ์ดˆ์ ์„ ๋ฐ›์ง€ ๋ชปํ•œ๋‹ค.** ๋งˆ์šฐ์Šค๋กœ๋งŒ ๋‹ซํžˆ๋Š” ํŒ์—…์ด ๋˜๋Š”๋ฐ,\n * ์ด ์•ฑ์˜ `openPopup` ์€ ๊ธฐ๋ณธ๊ฐ’์ด `escapable: false` ๋ผ์„œ ESC ๋กœ๋„ ๋‹ซํžˆ์ง€ ์•Š๋Š”๋‹ค โ€” ํ‚ค๋ณด๋“œ๋งŒ\n * ์“ฐ๋Š” ์‚ฌ๋žŒ์—๊ฒŒ๋Š” ๋‚˜๊ฐˆ ๋ฐฉ๋ฒ•์ด ์—†์–ด์ง„๋‹ค.\n *\n * ๊ทธ๋ž˜์„œ role ยท tabindex ๋ฅผ ์ฃผ๊ณ  ์ด ์ฒ˜๋ฆฌ๊ธฐ๋ฅผ ๋‹จ๋‹ค. Space ๋Š” ๊ธฐ๋ณธ ๋™์ž‘(์Šคํฌ๋กค)์„ ๋ง‰์•„์•ผ ํ•œ๋‹ค.\n */\n /**\n * โ”€โ”€ ESC โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€\n *\n * ์ด ๋ถ€ํ’ˆ์€ **ESC ๋ฅผ ์•„์˜ˆ ๋“ฃ์ง€ ์•Š์•˜๋‹ค.** `escapable` ์€ ๋ฐ”ํƒ•์„ ๋ˆŒ๋ €์„ ๋•Œ๋งŒ ๋ณด๋˜ ๊ฐ’์ด๋ผ,\n * `escapable: true` ๋กœ ์—ฐ ํŒ์—…๋„ ESC ๋กœ๋Š” ๋‹ซํžˆ์ง€ ์•Š์•˜๋‹ค. ๋ฌธ์„œ์—๋Š” ๊ธฐ๋ณธ๊ฐ’์ด ์ฐธ์ด๋ผ๊ณ  ์ ํ˜€\n * ์žˆ๋Š”๋ฐ ์ฝ”๋“œ์˜ ๊ธฐ๋ณธ๊ฐ’์€ ๊ฑฐ์ง“์ด๋‹ค(`open-popup.ts`) โ€” ๊ทธ ์–ด๊ธ‹๋‚จ๋„ ์—ฌ๊ธฐ์„œ ๋“œ๋Ÿฌ๋‚ฌ๋‹ค.\n *\n * ๊ธฐ๋ณธ๊ฐ’์€ ๋ฐ”๊พธ์ง€ ์•Š๋Š”๋‹ค. ํŒ์—…๋งˆ๋‹ค ๋ฌด์—‡์„ ์žƒ์„์ง€ ๋‹ค๋ฅด๊ณ , ๊ทธ ํŒ๋‹จ์€ ์—ฌ๋Š” ์ชฝ์ด ํ•œ๋‹ค.\n * ๋Œ€์‹  **๋‘ ๊ฐˆ๋ž˜๋กœ ๋‹ตํ•œ๋‹ค.**\n *\n * escapable: true ๋ฐ”๋กœ ๋‹ซ๋Š”๋‹ค โ€” ์—ฌ๋Š” ์ชฝ์ด ๊ทธ๋ž˜๋„ ๋œ๋‹ค๊ณ  ๋งํ•œ ๊ฒƒ์ด๋‹ค\n * escapable: false ๋‹ซ์„์ง€ ๋ฌป๋Š”๋‹ค โ€” ์‹ค์ˆ˜๋กœ ๋‹ซํžˆ์ง€ ์•Š์œผ๋ฉด์„œ, ๋‚˜๊ฐˆ ๊ธธ์€ ์žˆ๋‹ค\n *\n * ๋ฌป๋Š” ์ชฝ์„ ๊ณ ๋ฅธ ์ด์œ : ๋‹ซ๋Š” ๊ธธ์„ ๋ง‰๋Š” ๊ฒƒ์€ ์žƒ์„ ๊ฒƒ์„ ์ง€ํ‚ค๋Š” ๋ฐฉ๋ฒ•์ด ์•„๋‹ˆ๋ผ **๋‚˜๊ฐˆ ๊ธธ์„ ์—†์• ๋Š”**\n * ๋ฐฉ๋ฒ•์ด๋‹ค. ํ‚ค๋ณด๋“œ๋งŒ ์“ฐ๋Š” ์‚ฌ๋žŒ์—๊ฒŒ๋Š” ๊ทธ๊ฒƒ์ด ์œ ์ผํ•œ ๊ธธ์ผ ์ˆ˜ ์žˆ๋‹ค.\n *\n * ๊ฒน์ณ ์žˆ์œผ๋ฉด **๋งจ ์œ„ ๊ฒƒ๋งŒ** ๋‹ตํ•œ๋‹ค. ๋‘˜์ด ํ•จ๊ป˜ ๋‹ซํžˆ๋ฉด ๋’ค์—ฃ๊ฒƒ๊นŒ์ง€ ์‚ฌ๋ผ์ง„๋‹ค.\n */\n private onEscape = async (event: KeyboardEvent) => {\n if (event.key !== 'Escape' && event.key !== 'Esc') {\n return\n }\n\n if (!this.isTopOverlay()) {\n return\n }\n\n event.preventDefault()\n event.stopPropagation()\n\n if (this.escapable) {\n this.close()\n return\n }\n\n const leave = await OxPrompt.open({\n type: 'question',\n title: i18next.t('text.close-this-popup', { defaultValue: 'close this popup?' }),\n text: i18next.t('text.unsaved-may-be-lost', { defaultValue: 'anything not saved is lost.' }),\n confirmButton: { text: i18next.t('button.close', { defaultValue: 'close' }) },\n cancelButton: { text: i18next.t('button.cancel', { defaultValue: 'cancel' }) }\n })\n\n if (leave) {\n this.close()\n }\n }\n\n /** ๊ฒน์นœ ํŒ์—… ์ค‘ ๋งจ ์œ„์ธ๊ฐ€ โ€” ๋‚˜์ค‘์— ๋ถ™์€ ๊ฒƒ์ด ์œ„๋‹ค. */\n private isTopOverlay(): boolean {\n const root = this.getRootNode() as Document | ShadowRoot\n const all = Array.from(root.querySelectorAll('ox-floating-overlay'))\n\n return all.length === 0 || all[all.length - 1] === this\n }\n\n private onActivateKey(event: KeyboardEvent, run: () => void) {\n if (event.key !== 'Enter' && event.key !== ' ') {\n return\n }\n\n event.preventDefault()\n event.stopPropagation()\n run()\n }\n\n private opener?: HTMLElement\n\n connectedCallback(): void {\n super.connectedCallback()\n\n /*\n * ESC ๋Š” **๋ฌธ์„œ์—์„œ** ๋“ฃ๋Š”๋‹ค. ์ดˆ์ ์ด ํŒ์—… ์•ˆ์— ์—†์„ ์ˆ˜๋„ ์žˆ๋Š”๋ฐ(์—ฐ ์งํ›„, ๋˜๋Š” ๋ฐ”ํƒ•์„ ๋ˆŒ๋Ÿฌ\n * ์ดˆ์ ์ด ๋น ์กŒ์„ ๋•Œ) ๊ทธ๋•Œ๋„ ๋‚˜๊ฐˆ ์ˆ˜ ์žˆ์–ด์•ผ ํ•œ๋‹ค.\n */\n document.addEventListener('keydown', this.onEscape)\n\n /*\n * ๊ทธ๋ฆผ์ž ์•ˆ์— ์žˆ๋Š” ์š”์†Œ๋„ ์ฐพ์•„ ๋“ค์–ด๊ฐ„๋‹ค โ€” document.activeElement ๋Š” ๊ทธ ์š”์†Œ๋ฅผ ํ’ˆ์€\n * ํ˜ธ์ŠคํŠธ๊นŒ์ง€๋งŒ ์•Œ๋ ค ์ค€๋‹ค. ๊ทธ๋ฆฌ๋“œ์˜ ์นธ์ด ๊ทธ๋ฆผ์ž ๋‘ ๊ฒน ์•ˆ์— ์žˆ๋‹ค.\n */\n let active = document.activeElement as HTMLElement | null\n\n while (active?.shadowRoot?.activeElement) {\n active = active.shadowRoot.activeElement as HTMLElement\n }\n\n /* ์ž๊ธฐ ์ž์‹ ์ด๋‚˜ ์ž๊ธฐ ์•ˆ์˜ ๊ฒƒ์€ ๊ธฐ์–ตํ•˜์ง€ ์•Š๋Š”๋‹ค โ€” ๋Œ์•„๊ฐˆ ์ž๋ฆฌ๊ฐ€ ์•„๋‹ˆ๋‹ค. */\n this.opener = active && !this.contains(active) ? active : undefined\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.removeEventListener('keydown', this.onEscape)\n\n document.dispatchEvent(\n new CustomEvent('overlay-closed', {\n detail: this.name\n })\n )\n\n /*\n * ์—ด์–ด ์ค€ ์ž๋ฆฌ๋กœ ๋Œ๋ ค์ค€๋‹ค.\n *\n * **์‚ฌ๋ผ์กŒ์œผ๋ฉด ์กฐ์šฉํžˆ ๋„˜์–ด๊ฐ„๋‹ค** โ€” ์ค„์ด ๋‹ค์‹œ ๊ทธ๋ ค์กŒ๊ฑฐ๋‚˜ ๋ชฉ๋ก์ด ๋ฐ”๋€Œ์—ˆ์œผ๋ฉด ๊ทธ ์š”์†Œ๋Š” ์ด๋ฏธ\n * ๋ฌธ์„œ์— ์—†๋‹ค. ์—†๋Š” ๊ณณ์— ํฌ์ปค์Šค๋ฅผ ์ฃผ๋ ค๋‹ค ์˜ค๋ฅ˜๋ฅผ ๋‚ด๋ฉด ํŒ์—… ๋‹ซ๊ธฐ๊ฐ€ ํ†ต์งธ๋กœ ๋ฉˆ์ถ˜๋‹ค.\n *\n * ๋‹ค์Œ ํ”„๋ ˆ์ž„์— ์ค€๋‹ค. ์ง€๊ธˆ ์ฃผ๋ฉด ์•„์ง ์ด ์˜ค๋ฒ„๋ ˆ์ด๊ฐ€ ๋–ผ์–ด์ง€๋Š” ์ค‘์ด๋ผ ๋ธŒ๋ผ์šฐ์ €๊ฐ€ ๋‹ค์‹œ\n * ๊ฐ€์ ธ๊ฐ„๋‹ค.\n */\n const opener = this.opener\n\n this.opener = undefined\n\n if (opener?.isConnected) {\n requestAnimationFrame(() => {\n try {\n opener.focus({ preventScroll: true })\n } catch (e) {\n /* ํฌ์ปค์Šค๋ฅผ ๋ชป ๋ฐ›๋Š” ์š”์†Œ์˜€๋‹ค. ํŒ์—… ๋‹ซ๊ธฐ๋ฅผ ๋ง‰์„ ์ผ์€ ์•„๋‹ˆ๋‹ค. */\n }\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,OAAO,EAAE,MAAM,eAAe,CAAA;AAEvC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAEjD,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,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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;AAzbjC,iBAAiB;IAD7B,aAAa,CAAC,qBAAqB,CAAC;GACxB,iBAAiB,CAk1B7B","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 { i18next } from '@operato/i18n'\n\nimport { OxPrompt } from './ox-prompt.js'\nimport { ScrollbarStyles } from '@operato/styles'\nimport { isHandheldDevice } from '@operato/utils'\n\nimport { claimHistoryBack, recordPopupResult } from './popup-result.js'\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 /*\n * โ”€โ”€ ๊ทธ๋ฆผ์ž๋Š” ์ธต์œผ๋กœ ์Œ“๋Š”๋‹ค โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€\n * ์ „์—๋Š” 2px 3px 10px 5px ์˜€๋‹ค โ€” ์˜ค๋ฅธ์ชฝ ์•„๋ž˜๋กœ ์น˜์šฐ์นœ ๋ฐ๋‹ค 5px ํผ์ง์ด ์žˆ์–ด์„œ ์ƒ์ž ๋„ค ๋ณ€์—\n * ํšŒ์ƒ‰ ํ…Œ๋ฅผ ๋‘๋ฅธ ๊ฒƒ์ฒ˜๋Ÿผ ๋ณด์˜€๋‹ค. ๋–  ์žˆ๋Š” ๋А๋‚Œ์ด ์•„๋‹ˆ๋ผ ๋ง๊ทธ๋ฆฐ ๋А๋‚Œ์ด๋‹ค.\n *\n * ๊ฐ€๊นŒ์šด ์ธต ํ•˜๋‚˜๋กœ ๊ฒฝ๊ณ„๋ฅผ ์„ธ์šฐ๊ณ , ๋จผ ์ธต ํ•˜๋‚˜๋กœ ๋†’์ด๋ฅผ ๋งŒ๋“ ๋‹ค. ๋จผ ์ธต์€ ์œ„๋กœ ํผ์ง€์ง€ ์•Š๊ฒŒ\n * ์Œ์ˆ˜ spread ๋ฅผ ์ค€๋‹ค โ€” ๋น›์ด ์œ„์—์„œ ์˜จ๋‹ค๋Š” ๊ทธ ๊ทœ์น™๋งŒ ์ง€์ผœ๋„ ์ƒ์ž๊ฐ€ ๋œฌ๋‹ค.\n */\n box-shadow:\n 0 1px 2px rgba(0, 0, 0, 0.06),\n 0 16px 40px -12px rgba(0, 0, 0, 0.28);\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 /*\n * โ”€โ”€ ํ…Œ๋‘๋ฆฌ๋Š” ์‹ค์„  ํ•œ ์˜ฌ, ๋ชจ์„œ๋ฆฌ๋Š” ๋‘ฅ๊ธ€๊ฒŒ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€\n * 2px outline ์ด์—ˆ๋‹ค. ํ™”๋ฉด์—์„œ ๊ฐ€์žฅ ๊ตต๊ณ  ๊ฐ€์žฅ ์ง„ํ•œ ์„ ์ด ์ƒ์ž์˜ ํ…Œ๋‘๋ฆฌ์—ฌ์„œ, ์•ˆ์— ๋“  ๋‚ด์šฉ๋ณด๋‹ค\n * ์ƒ์ž๊ฐ€ ๋จผ์ € ๋ณด์˜€๋‹ค. ๊ฒฝ๊ณ„๋Š” ํ•œ ์˜ฌ๋กœ ์ถฉ๋ถ„ํ•˜๋‹ค โ€” ๋‚˜๋จธ์ง€๋Š” ๊ทธ๋ฆผ์ž๊ฐ€ ๋งก๋Š”๋‹ค.\n *\n * ๋ชจ์„œ๋ฆฌ๋„ ๊ฐ์ด์—ˆ๋‹ค. ์ด ์ œํ’ˆ์˜ ์นด๋“œยทํ‘œ๋Š” ๋ชจ๋‘ ๋‘ฅ๊ธ€๋‹ค(10~14px). ํŒ์—…๋งŒ ๊ฐ์ด๋ฉด ๊ทธ ํ•˜๋‚˜๊ฐ€\n * ๋”ด ์„ธ๋Œ€์˜ ๊ฒƒ์œผ๋กœ ๋ณด์ธ๋‹ค.\n *\n * โ”€โ”€ --popup-radius ๋Š” **์นด๋“œ์˜ ๋ชจ์„œ๋ฆฌ**๋‹ค. ์—ฌ๊ธฐ๊ฐ€ ๊ทธ ์ž„์ž๋‹ค โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€\n * ์ด ๊ฐ’์ด ํŒ์—… ์•ˆ ์ปจํŠธ๋กค์˜ ๋ชจ์„œ๋ฆฌ๋ฅผ ํ•จ๊ป˜ ์ •ํ•œ๋‹ค โ€” ๋ชจ์„œ๋ฆฌ๋Š” ๋‹ด๋Š” ๋ฉด์„ ๋”ฐ๋ฅธ๋‹ค(๋™์‹ฌ ๋ชจ์„œ๋ฆฌ).\n * ๊ทธ ์ง์€ --popup-control-radius ์ด๊ณ  CommonPopupStyles ๊ฐ€ ์„ ์–ธํ•œ๋‹ค. ์นด๋“œ๋ฅผ ๊ฐ์ง€๊ฒŒ\n * ํ•˜๋ ค๋ฉด ๋‘ ๊ฐ’์„ **ํ•จ๊ป˜** ๋‚ด๋ ค๋ผ. ํ•œ์ชฝ๋งŒ ๋ฐ”๊พธ๋ฉด ๋‘ฅ๊ทผ ํ‹€์— ๊ฐ์ง„ ํŒ์ด ๋ฐ•ํžŒ๋‹ค.\n */\n border: 1px solid var(--md-sys-color-outline-variant);\n border-radius: var(--popup-radius, 16px);\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 [hovering='center'][size='full'] {\n width: var(--overlay-center-full-width, 100%);\n height: var(--overlay-center-full-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 /*\n * for header style\n *\n * primary ๋Š” ์–ด๋‘์šด ํ‘œ๋ฉด ์œ„์— ๋†“๋Š” ๊ฐ•์กฐ์ƒ‰์ด๋ผ ํฐ ๋ฉด์„ ์ฑ„์šฐ๋ฉด ๋‹คํฌ์—์„œ ๋ฐ์€ ๋ ๊ฐ€ ๋œ๋‹ค\n * (์‹ค์ œ๋กœ ํŒ์—… ์ œ๋ชฉ์ค„์ด ํƒ„์ƒ‰ ๋ธ”๋ก์œผ๋กœ ๋ณด์˜€๋‹ค). ์ œ๋ชฉ์ค„์€ ํ‘œ๋ฉด์ด๋ฏ€๋กœ container ์—ญํ• ์„ ์“ด๋‹ค.\n * ์•ฑ์ด ์กฐ์ •ํ•˜๋ ค๋ฉด --popup-header-background / --popup-header-color ๋ฅผ ์ง€์ •ํ•œ๋‹ค.\n */\n [header] {\n display: flex;\n flex-direction: row;\n align-items: center;\n /*\n * ๋จธ๋ฆฌ๋Š” ์Šฌ๋ž˜๋ธŒ๊ฐ€ ์•„๋‹ˆ๋‹ค. ์ฑ„์›€๊ณผ ์•„๋ž˜ ์‹ค์„ ์„ ๋‘˜ ๋‹ค ์“ฐ๊ณ  ์žˆ์—ˆ๊ณ , ์ฑ„์›€์ด ํ•œ ๋‹จ ์ง„ํ•ด์„œ ๊ทธ ๋ ๊ฐ€\n * ์•ˆ์— ๋“  ๋‚ด์šฉ๋ณด๋‹ค ๋ฌด๊ฑฐ์› ๋‹ค. ํ•œ ๋‹จ ๋‚ฎ์ถ˜๋‹ค โ€” ์„ ์€ ๋‚จ๊ธด๋‹ค(๋ชฉ๋ก์ด ์˜ฌ๋ผ์˜ฌ ๋•Œ ๊ทธ ์„ ์ด ๋จธ๋ฆฌ๋ฅผ ๋งํ•œ๋‹ค).\n */\n background-color: var(--popup-header-background, var(--md-sys-color-surface-container-low));\n font-weight: var(--md-sys-typescale-label-large-weight, var(--md-ref-typeface-weight-medium, 500));\n color: var(--popup-header-color, var(--md-sys-color-on-surface));\n border-bottom: 1px solid var(--md-sys-color-outline-variant);\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 /*\n * โ”€โ”€ ๋จธ๋ฆฌ์˜ ์•„์ด์ฝ˜์€ **๊พธ๋ฐˆ์ด ์•„๋‹ˆ๋ผ ๊ณ๊ฒƒ**์ด๋‹ค โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€\n *\n * ๋‹ซ๊ธฐ์™€ ์†์žก์ด๊ฐ€ ์ œ๋ชฉ๊ณผ ๊ฐ™์€ ์ž‰ํฌ์— 24px ์˜€๋‹ค. ์ œ๋ชฉ์ด 16px ์ด๋‹ˆ **๊ณ๊ฒƒ์ด ๋‚ด์šฉ๋ณด๋‹ค ๊ตต๊ณ \n * ์ปธ๋‹ค** โ€” ํŒ์—…์„ ์—ด๋ฉด ๋ˆˆ์ด ๋จผ์ € โœ• ๋กœ ๊ฐ”๋‹ค.\n *\n * ํฌ๊ธฐ๋Š” ์ด ์ œํ’ˆ์˜ ์•„์ด์ฝ˜ ๋ˆˆ๊ธˆ(18~19px)์— ๋งž์ถ”๊ณ , ์ƒ‰์€ ํ•œ ๋‹จ ํ๋ฆฌ๊ฒŒ ๋‘์—ˆ๋‹ค๊ฐ€ ๋งˆ์šฐ์Šค๋ฅผ\n * ์˜ฌ๋ฆด ๋•Œ๋งŒ ์ง™์–ด์ง„๋‹ค. ๋ˆ„๋ฅผ ์ž๋ฆฌ๋Š” ์—ฌ๋ฐฑ์œผ๋กœ ๋„“ํ˜€ ๋‘”๋‹ค โ€” ์•„์ด์ฝ˜์ด ์ž‘์•„๋„ 28px ์•ˆ์—์„œ ๋ˆŒ๋ฆฐ๋‹ค.\n *\n * ์†์žก์ด(drag_indicator)๋Š” ๊ทธ์ค‘ **๊ฐ€์žฅ ํ๋ฆฌ๋‹ค.** ๊ทธ๊ฒƒ์€ ๋™์ž‘์ด ์•„๋‹ˆ๋ผ ใ€Œ์—ฌ๊ธฐ๋ฅผ ์žก์œผ๋ฉด\n * ์›€์ง์ธ๋‹คใ€๋Š” ํ‘œ์‹œ์ด๊ณ , ์žก์œผ๋ ค๋Š” ์‚ฌ๋žŒ์€ ์ด๋ฏธ ๊ทธ ์ž๋ฆฌ๋ฅผ ์•ˆ๋‹ค.\n */\n /*\n * ์•ฑ์ด --popup-header-background ๋ฅผ primary ๊ฐ™์€ ์ง™์€ ์ƒ‰์œผ๋กœ ๋ฐ”๊พธ๋ฉด ์•„์ด์ฝ˜๋„ ํ•จ๊ป˜ ๋ฐ์•„์ ธ์•ผ ํ•œ๋‹ค.\n * --popup-header-icon-color ํ•˜๋‚˜๋กœ ๋‹ซ๊ธฐ/๋’ค๋กœ/์†์žก์ด ์ƒ‰์„ ๋งž์ถ”๊ณ , ํ˜ธ๋ฒ„ ๋ฉด์€ --popup-header-icon-hover-background.\n */\n [header] md-icon {\n --md-icon-size: 18px;\n\n padding: 5px;\n border-radius: 999em;\n color: var(--popup-header-icon-color, var(--md-sys-color-outline));\n transition:\n color 0.12s ease-out,\n background-color 0.12s ease-out;\n }\n\n [header] md-icon[historyback]:hover,\n [header] md-icon[close]:hover {\n color: var(--popup-header-icon-hover-color, var(--md-sys-color-on-surface));\n background-color: var(--popup-header-icon-hover-background, var(--md-sys-color-surface-container-high));\n }\n\n /* ์†์žก์ด๋Š” ๋ˆŒ๋ฆฌ๋Š” ๊ฒƒ์ด ์•„๋‹ˆ๋ผ ์žกํžˆ๋Š” ๊ฒƒ์ด๋‹ค. ๋ฉด์„ ์ฃผ์ง€ ์•Š๊ณ  ์ƒ‰๋งŒ ํ•œ ๋‹จ ์˜ฌ๋ฆฐ๋‹ค. */\n [header] md-icon:not([close]):not([historyback]) {\n color: var(--popup-header-icon-color, var(--md-sys-color-outline-variant));\n opacity: var(--popup-header-handle-opacity, 1);\n cursor: grab;\n }\n\n [header] md-icon:not([close]):not([historyback]):hover {\n color: var(--popup-header-icon-color, var(--md-sys-color-outline));\n opacity: 1;\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' | 'full'\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 /**\n * ESC ๋กœ ๋ฐ”๋กœ ๋‹ซ์•„๋„ ๋˜๋‚˜.\n *\n * ์ด ์†์„ฑ์ด **์—†์—ˆ๋‹ค.** `openPopup({ escapable: true })` ๋กœ ์ค˜๋„ ๋ถ€ํ’ˆ๊นŒ์ง€ ์˜ค์ง€ ์•Š์•˜๊ณ , ๊ฐ’์€\n * ๋ธŒ๋ผ์šฐ์ € ์ด๋ ฅ ์ƒํƒœ์—๋งŒ ๋‹ด๊ฒจ ๋ฐ”ํƒ• ํด๋ฆญ ํŒ์ •์—๋งŒ ์“ฐ์˜€๋‹ค. ๊ทธ๋ž˜์„œ ์ด ๊ฐ’์„ ์ฐธ์œผ๋กœ ์ค€ ํŒ์—…๋„ ESC\n * ๋กœ๋Š” ๋‹ซํžˆ์ง€ ์•Š์•˜๋‹ค.\n *\n * ๊ธฐ๋ณธ๊ฐ’์€ ๊ฑฐ์ง“์ด๋‹ค โ€” ์žƒ์„ ๊ฒƒ์ด ์žˆ๋Š” ํŒ์—…์ด ์‹ค์ˆ˜๋กœ ๋‹ซํžˆ์ง€ ์•Š๊ฒŒ. ๊ฑฐ์ง“์ด์–ด๋„ ESC ๋Š” ๋“ฃ๋Š”๋‹ค.\n * ๋‹ซ์„์ง€ ๋ฌผ์–ด๋ณธ๋‹ค(`onEscape`).\n */\n @property({ type: Boolean }) escapable?: boolean = false\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, false, (e as CustomEvent).detail)\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\n role=\"button\"\n tabindex=${this.closable ? 0 : -1}\n @click=${(e: Event) => this.onClose(e)}\n @keydown=${(e: KeyboardEvent) => this.onActivateKey(e, () => this.onClose(e))}\n ?closable=${this.closable}\n historyback\n >arrow_back</md-icon\n >\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 || ''}&nbsp;${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\n role=\"button\"\n tabindex=\"0\"\n @click=${(e: MouseEvent) => filterHandler(this.firstElementChild)}\n @keydown=${(e: KeyboardEvent) =>\n this.onActivateKey(e, () => filterHandler(this.firstElementChild))}\n >tune</md-icon\n >`\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\n role=\"button\"\n tabindex=${this.closable ? 0 : -1}\n title=${i18next.t('button.close', { defaultValue: 'close' })}\n @click=${(e: Event) => this.onClose(e)}\n @keydown=${(e: KeyboardEvent) => this.onActivateKey(e, () => this.onClose(e))}\n ?closable=${this.closable}\n close\n >close</md-icon\n >\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 /**\n * ํŒ์—…์„ ์—ฐ ์ž๋ฆฌ. **๋‹ซํžˆ๋ฉด ์—ฌ๊ธฐ๋กœ ๋Œ๋ ค์ค€๋‹ค.**\n *\n * ์•ˆ ๋Œ๋ ค์ฃผ๋ฉด ํฌ์ปค์Šค๊ฐ€ body ๋กœ ๋–จ์–ด์ง„๋‹ค. ํ‚ค๋ณด๋“œ๋กœ ์ผํ•˜๋Š” ์‚ฌ๋žŒ์€ ์ž๊ธฐ ์ž๋ฆฌ๋ฅผ ์žƒ๊ณ ,\n * ๊ทธ๋ฆฌ๋“œ์—์„œ๋Š” ํŒ์—…์„ ๋‹ซ์ž๋งˆ์ž ํ™”์‚ดํ‘œ๊ฐ€ ์•ˆ ๋จน๋Š”๋‹ค. ๋Œ€ํ™”์ƒ์ž์˜ ํ‘œ์ค€ ๋™์ž‘์ด๋‹ค\n * (WAI-ARIA ์˜ dialog ํŒจํ„ด).\n */\n /**\n * Enter ยท Space ๋กœ๋„ ๋ˆŒ๋ฆฐ๋‹ค.\n *\n * ๋จธ๋ฆฌ์˜ ํ‘œ์‹๋“ค์€ `md-icon` ์ด๋ผ **ํ‚ค๋ณด๋“œ ์ดˆ์ ์„ ๋ฐ›์ง€ ๋ชปํ•œ๋‹ค.** ๋งˆ์šฐ์Šค๋กœ๋งŒ ๋‹ซํžˆ๋Š” ํŒ์—…์ด ๋˜๋Š”๋ฐ,\n * ์ด ์•ฑ์˜ `openPopup` ์€ ๊ธฐ๋ณธ๊ฐ’์ด `escapable: false` ๋ผ์„œ ESC ๋กœ๋„ ๋‹ซํžˆ์ง€ ์•Š๋Š”๋‹ค โ€” ํ‚ค๋ณด๋“œ๋งŒ\n * ์“ฐ๋Š” ์‚ฌ๋žŒ์—๊ฒŒ๋Š” ๋‚˜๊ฐˆ ๋ฐฉ๋ฒ•์ด ์—†์–ด์ง„๋‹ค.\n *\n * ๊ทธ๋ž˜์„œ role ยท tabindex ๋ฅผ ์ฃผ๊ณ  ์ด ์ฒ˜๋ฆฌ๊ธฐ๋ฅผ ๋‹จ๋‹ค. Space ๋Š” ๊ธฐ๋ณธ ๋™์ž‘(์Šคํฌ๋กค)์„ ๋ง‰์•„์•ผ ํ•œ๋‹ค.\n */\n /**\n * โ”€โ”€ ESC โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€\n *\n * ์ด ๋ถ€ํ’ˆ์€ **ESC ๋ฅผ ์•„์˜ˆ ๋“ฃ์ง€ ์•Š์•˜๋‹ค.** `escapable` ์€ ๋ฐ”ํƒ•์„ ๋ˆŒ๋ €์„ ๋•Œ๋งŒ ๋ณด๋˜ ๊ฐ’์ด๋ผ,\n * `escapable: true` ๋กœ ์—ฐ ํŒ์—…๋„ ESC ๋กœ๋Š” ๋‹ซํžˆ์ง€ ์•Š์•˜๋‹ค. ๋ฌธ์„œ์—๋Š” ๊ธฐ๋ณธ๊ฐ’์ด ์ฐธ์ด๋ผ๊ณ  ์ ํ˜€\n * ์žˆ๋Š”๋ฐ ์ฝ”๋“œ์˜ ๊ธฐ๋ณธ๊ฐ’์€ ๊ฑฐ์ง“์ด๋‹ค(`open-popup.ts`) โ€” ๊ทธ ์–ด๊ธ‹๋‚จ๋„ ์—ฌ๊ธฐ์„œ ๋“œ๋Ÿฌ๋‚ฌ๋‹ค.\n *\n * ๊ธฐ๋ณธ๊ฐ’์€ ๋ฐ”๊พธ์ง€ ์•Š๋Š”๋‹ค. ํŒ์—…๋งˆ๋‹ค ๋ฌด์—‡์„ ์žƒ์„์ง€ ๋‹ค๋ฅด๊ณ , ๊ทธ ํŒ๋‹จ์€ ์—ฌ๋Š” ์ชฝ์ด ํ•œ๋‹ค.\n * ๋Œ€์‹  **๋‘ ๊ฐˆ๋ž˜๋กœ ๋‹ตํ•œ๋‹ค.**\n *\n * escapable: true ๋ฐ”๋กœ ๋‹ซ๋Š”๋‹ค โ€” ์—ฌ๋Š” ์ชฝ์ด ๊ทธ๋ž˜๋„ ๋œ๋‹ค๊ณ  ๋งํ•œ ๊ฒƒ์ด๋‹ค\n * escapable: false ๋‹ซ์„์ง€ ๋ฌป๋Š”๋‹ค โ€” ์‹ค์ˆ˜๋กœ ๋‹ซํžˆ์ง€ ์•Š์œผ๋ฉด์„œ, ๋‚˜๊ฐˆ ๊ธธ์€ ์žˆ๋‹ค\n *\n * ๋ฌป๋Š” ์ชฝ์„ ๊ณ ๋ฅธ ์ด์œ : ๋‹ซ๋Š” ๊ธธ์„ ๋ง‰๋Š” ๊ฒƒ์€ ์žƒ์„ ๊ฒƒ์„ ์ง€ํ‚ค๋Š” ๋ฐฉ๋ฒ•์ด ์•„๋‹ˆ๋ผ **๋‚˜๊ฐˆ ๊ธธ์„ ์—†์• ๋Š”**\n * ๋ฐฉ๋ฒ•์ด๋‹ค. ํ‚ค๋ณด๋“œ๋งŒ ์“ฐ๋Š” ์‚ฌ๋žŒ์—๊ฒŒ๋Š” ๊ทธ๊ฒƒ์ด ์œ ์ผํ•œ ๊ธธ์ผ ์ˆ˜ ์žˆ๋‹ค.\n *\n * ๊ฒน์ณ ์žˆ์œผ๋ฉด **๋งจ ์œ„ ๊ฒƒ๋งŒ** ๋‹ตํ•œ๋‹ค. ๋‘˜์ด ํ•จ๊ป˜ ๋‹ซํžˆ๋ฉด ๋’ค์—ฃ๊ฒƒ๊นŒ์ง€ ์‚ฌ๋ผ์ง„๋‹ค.\n */\n private onEscape = async (event: KeyboardEvent) => {\n if (event.key !== 'Escape' && event.key !== 'Esc') {\n return\n }\n\n if (!this.isTopOverlay()) {\n return\n }\n\n event.preventDefault()\n event.stopPropagation()\n\n if (this.escapable) {\n this.close()\n return\n }\n\n const leave = await OxPrompt.open({\n type: 'question',\n title: i18next.t('text.close-this-popup', { defaultValue: 'close this popup?' }),\n text: i18next.t('text.unsaved-may-be-lost', { defaultValue: 'anything not saved is lost.' }),\n confirmButton: { text: i18next.t('button.close', { defaultValue: 'close' }) },\n cancelButton: { text: i18next.t('button.cancel', { defaultValue: 'cancel' }) }\n })\n\n if (leave) {\n this.close()\n }\n }\n\n /** ๊ฒน์นœ ํŒ์—… ์ค‘ ๋งจ ์œ„์ธ๊ฐ€ โ€” ๋‚˜์ค‘์— ๋ถ™์€ ๊ฒƒ์ด ์œ„๋‹ค. */\n private isTopOverlay(): boolean {\n const root = this.getRootNode() as Document | ShadowRoot\n const all = Array.from(root.querySelectorAll('ox-floating-overlay'))\n\n return all.length === 0 || all[all.length - 1] === this\n }\n\n private onActivateKey(event: KeyboardEvent, run: () => void) {\n if (event.key !== 'Enter' && event.key !== ' ') {\n return\n }\n\n event.preventDefault()\n event.stopPropagation()\n run()\n }\n\n private opener?: HTMLElement\n\n connectedCallback(): void {\n super.connectedCallback()\n\n /*\n * ESC ๋Š” **๋ฌธ์„œ์—์„œ** ๋“ฃ๋Š”๋‹ค. ์ดˆ์ ์ด ํŒ์—… ์•ˆ์— ์—†์„ ์ˆ˜๋„ ์žˆ๋Š”๋ฐ(์—ฐ ์งํ›„, ๋˜๋Š” ๋ฐ”ํƒ•์„ ๋ˆŒ๋Ÿฌ\n * ์ดˆ์ ์ด ๋น ์กŒ์„ ๋•Œ) ๊ทธ๋•Œ๋„ ๋‚˜๊ฐˆ ์ˆ˜ ์žˆ์–ด์•ผ ํ•œ๋‹ค.\n */\n document.addEventListener('keydown', this.onEscape)\n\n /*\n * ๊ทธ๋ฆผ์ž ์•ˆ์— ์žˆ๋Š” ์š”์†Œ๋„ ์ฐพ์•„ ๋“ค์–ด๊ฐ„๋‹ค โ€” document.activeElement ๋Š” ๊ทธ ์š”์†Œ๋ฅผ ํ’ˆ์€\n * ํ˜ธ์ŠคํŠธ๊นŒ์ง€๋งŒ ์•Œ๋ ค ์ค€๋‹ค. ๊ทธ๋ฆฌ๋“œ์˜ ์นธ์ด ๊ทธ๋ฆผ์ž ๋‘ ๊ฒน ์•ˆ์— ์žˆ๋‹ค.\n */\n let active = document.activeElement as HTMLElement | null\n\n while (active?.shadowRoot?.activeElement) {\n active = active.shadowRoot.activeElement as HTMLElement\n }\n\n /* ์ž๊ธฐ ์ž์‹ ์ด๋‚˜ ์ž๊ธฐ ์•ˆ์˜ ๊ฒƒ์€ ๊ธฐ์–ตํ•˜์ง€ ์•Š๋Š”๋‹ค โ€” ๋Œ์•„๊ฐˆ ์ž๋ฆฌ๊ฐ€ ์•„๋‹ˆ๋‹ค. */\n this.opener = active && !this.contains(active) ? active : undefined\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.removeEventListener('keydown', this.onEscape)\n\n document.dispatchEvent(\n new CustomEvent('overlay-closed', {\n detail: this.name\n })\n )\n\n /*\n * ์—ด์–ด ์ค€ ์ž๋ฆฌ๋กœ ๋Œ๋ ค์ค€๋‹ค.\n *\n * **์‚ฌ๋ผ์กŒ์œผ๋ฉด ์กฐ์šฉํžˆ ๋„˜์–ด๊ฐ„๋‹ค** โ€” ์ค„์ด ๋‹ค์‹œ ๊ทธ๋ ค์กŒ๊ฑฐ๋‚˜ ๋ชฉ๋ก์ด ๋ฐ”๋€Œ์—ˆ์œผ๋ฉด ๊ทธ ์š”์†Œ๋Š” ์ด๋ฏธ\n * ๋ฌธ์„œ์— ์—†๋‹ค. ์—†๋Š” ๊ณณ์— ํฌ์ปค์Šค๋ฅผ ์ฃผ๋ ค๋‹ค ์˜ค๋ฅ˜๋ฅผ ๋‚ด๋ฉด ํŒ์—… ๋‹ซ๊ธฐ๊ฐ€ ํ†ต์งธ๋กœ ๋ฉˆ์ถ˜๋‹ค.\n *\n * ๋‹ค์Œ ํ”„๋ ˆ์ž„์— ์ค€๋‹ค. ์ง€๊ธˆ ์ฃผ๋ฉด ์•„์ง ์ด ์˜ค๋ฒ„๋ ˆ์ด๊ฐ€ ๋–ผ์–ด์ง€๋Š” ์ค‘์ด๋ผ ๋ธŒ๋ผ์šฐ์ €๊ฐ€ ๋‹ค์‹œ\n * ๊ฐ€์ ธ๊ฐ„๋‹ค.\n */\n const opener = this.opener\n\n this.opener = undefined\n\n if (opener?.isConnected) {\n requestAnimationFrame(() => {\n try {\n opener.focus({ preventScroll: true })\n } catch (e) {\n /* ํฌ์ปค์Šค๋ฅผ ๋ชป ๋ฐ›๋Š” ์š”์†Œ์˜€๋‹ค. ํŒ์—… ๋‹ซ๊ธฐ๋ฅผ ๋ง‰์„ ์ผ์€ ์•„๋‹ˆ๋‹ค. */\n }\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, request?: { result: unknown }) {\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 /* A second close in the same tick would see the same state and go back one page too far. */\n if (!claimHistoryBack(overlay.name)) {\n return\n }\n\n this.recordResult(request)\n history.back()\n } else {\n this.recordResult(request)\n this.close()\n }\n }\n\n /*\n * A value from the content (`closePopup(element, value)`) is recorded only once the overlay is really\n * going to close, and nothing settles here - the result settles when the overlay leaves the document,\n * where every way of closing ends. If another request recorded first, this value is dropped.\n */\n private recordResult(request?: { result: unknown }) {\n if (request && 'result' in request) {\n recordPopupResult(this.name, request.result)\n }\n }\n}\n"]}