@iyulab/components 0.1.0 → 0.1.1

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 (81) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/dist/assets/icons/arrow-clockwise.svg.js +3 -7
  3. package/dist/assets/icons/arrow-down.svg.js +3 -6
  4. package/dist/assets/icons/arrow-up.svg.js +3 -6
  5. package/dist/assets/icons/ban.svg.js +3 -6
  6. package/dist/assets/icons/bell-fill.svg.js +3 -6
  7. package/dist/assets/icons/check-circle-fill.svg.js +3 -6
  8. package/dist/assets/icons/check-lg.svg.js +3 -6
  9. package/dist/assets/icons/chevron-down.svg.js +3 -6
  10. package/dist/assets/icons/chevron-left.svg.js +3 -6
  11. package/dist/assets/icons/chevron-right.svg.js +3 -6
  12. package/dist/assets/icons/chevron-up.svg.js +3 -6
  13. package/dist/assets/icons/copy.svg.js +3 -6
  14. package/dist/assets/icons/dash-lg.svg.js +3 -6
  15. package/dist/assets/icons/exclamation-circle-fill.svg.js +3 -6
  16. package/dist/assets/icons/exclamation-triangle-fill.svg.js +3 -6
  17. package/dist/assets/icons/eye-slash.svg.js +3 -8
  18. package/dist/assets/icons/eye.svg.js +3 -7
  19. package/dist/assets/icons/info-circle-fill.svg.js +3 -6
  20. package/dist/assets/icons/layout-sidebar.svg.js +3 -6
  21. package/dist/assets/icons/lightbulb-fill.svg.js +3 -6
  22. package/dist/assets/icons/lightbulb-off.svg.js +3 -6
  23. package/dist/assets/icons/lightbulb.svg.js +3 -6
  24. package/dist/assets/icons/mic-fill.svg.js +3 -7
  25. package/dist/assets/icons/mic-mute-fill.svg.js +3 -7
  26. package/dist/assets/icons/paperclip.svg.js +3 -6
  27. package/dist/assets/icons/pencil-square.svg.js +3 -7
  28. package/dist/assets/icons/plus-lg.svg.js +3 -6
  29. package/dist/assets/icons/search.svg.js +3 -6
  30. package/dist/assets/icons/speedometer.svg.js +3 -7
  31. package/dist/assets/icons/x-lg.svg.js +3 -6
  32. package/dist/assets/styles/dark.css.js +3 -4
  33. package/dist/assets/styles/light.css.js +3 -4
  34. package/dist/components/BaseElement.js +32 -22
  35. package/dist/components/BaseElement.styles.js +5 -5
  36. package/dist/components/alert/Alert.js +79 -51
  37. package/dist/components/alert/Alert.styles.js +5 -5
  38. package/dist/components/button/Button.js +29 -23
  39. package/dist/components/button/Button.styles.js +5 -5
  40. package/dist/components/context-menu/ContextMenu.js +123 -72
  41. package/dist/components/context-menu/ContextMenu.styles.js +5 -5
  42. package/dist/components/dialog/Dialog.js +73 -40
  43. package/dist/components/dialog/Dialog.styles.js +5 -5
  44. package/dist/components/form/Form.js +51 -32
  45. package/dist/components/form/Form.styles.js +5 -5
  46. package/dist/components/icon/Icon.js +53 -36
  47. package/dist/components/icon/Icon.styles.js +5 -5
  48. package/dist/components/icon-button/IconButton.js +44 -36
  49. package/dist/components/icon-button/IconButton.styles.js +5 -5
  50. package/dist/components/input/Input.js +161 -112
  51. package/dist/components/input/Input.styles.js +5 -5
  52. package/dist/components/menu/Menu.js +108 -58
  53. package/dist/components/menu/Menu.styles.js +5 -5
  54. package/dist/components/menu-item/MenuItem.js +67 -37
  55. package/dist/components/menu-item/MenuItem.styles.js +5 -5
  56. package/dist/components/panel/Panel.js +11 -10
  57. package/dist/components/panel/Panel.styles.js +5 -5
  58. package/dist/components/progress-ring/ProgressRing.js +70 -45
  59. package/dist/components/progress-ring/ProgressRing.styles.js +5 -5
  60. package/dist/components/spinner/Spinner.js +9 -9
  61. package/dist/components/spinner/Spinner.styles.js +5 -5
  62. package/dist/components/split-panel/SplitPanel.js +127 -66
  63. package/dist/components/split-panel/SplitPanel.styles.js +5 -5
  64. package/dist/components/split-panel/Splitter.js +29 -23
  65. package/dist/components/split-panel/Splitter.styles.js +5 -5
  66. package/dist/components/tooltip/Tooltip.js +115 -74
  67. package/dist/components/tooltip/Tooltip.styles.js +5 -5
  68. package/dist/index.js +18 -40
  69. package/dist/internals/attribute-converters.js +10 -8
  70. package/dist/internals/icons.js +41 -66
  71. package/dist/internals/node-helpers.js +16 -17
  72. package/dist/utilities/BrowserStorage.d.ts +43 -0
  73. package/dist/utilities/BrowserStorage.js +87 -0
  74. package/dist/utilities/decorators.js +19 -14
  75. package/dist/utilities/index.d.ts +1 -1
  76. package/dist/utilities/notifier.js +62 -20
  77. package/dist/utilities/theme.d.ts +39 -26
  78. package/dist/utilities/theme.js +111 -86
  79. package/package.json +2 -2
  80. package/dist/utilities/storage.d.ts +0 -60
  81. package/dist/utilities/storage.js +0 -120
@@ -1,30 +1,49 @@
1
- import { html as p } from "lit";
2
- import { property as e } from "lit/decorators.js";
3
- import { BaseElement as c } from "../BaseElement.js";
4
- import { Icon as h } from "../icon/Icon.js";
5
- import { styles as m } from "./Alert.styles.js";
6
- var u = Object.defineProperty, i = (r, t, a, d) => {
7
- for (var o = void 0, n = r.length - 1, l; n >= 0; n--)
8
- (l = r[n]) && (o = l(t, a, o) || o);
9
- return o && u(t, a, o), o;
1
+ import { html } from 'lit';
2
+ import { property } from 'lit/decorators.js';
3
+ import { BaseElement } from '../BaseElement.js';
4
+ import { Icon } from '../icon/Icon.js';
5
+ import { styles } from './Alert.styles.js';
6
+
7
+ var __defProp = Object.defineProperty;
8
+ var __decorateClass = (decorators, target, key, kind) => {
9
+ var result = void 0 ;
10
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
11
+ if (decorator = decorators[i])
12
+ result = (decorator(target, key, result) ) || result;
13
+ if (result) __defProp(target, key, result);
14
+ return result;
10
15
  };
11
- class s extends c {
16
+ class Alert extends BaseElement {
12
17
  constructor() {
13
- super(...arguments), this.open = !1, this.type = "info", this.minRows = 1, this.maxRows = 3, this.duration = 0;
18
+ super(...arguments);
19
+ this.open = false;
20
+ this.type = "info";
21
+ this.minRows = 1;
22
+ this.maxRows = 3;
23
+ this.duration = 0;
14
24
  }
15
25
  static {
16
- this.styles = [super.styles, m];
26
+ this.styles = [super.styles, styles];
17
27
  }
18
28
  static {
19
29
  this.dependencies = {
20
- "u-icon": h
30
+ "u-icon": Icon
21
31
  };
22
32
  }
23
- updated(t) {
24
- super.updated(t), t.has("minRows") && this.minRows < this.maxRows && this.minRows > 0 && this.style.setProperty("--min-content-rows", `${this.minRows}`), t.has("maxRows") && this.maxRows > this.minRows && this.maxRows > 0 && this.style.setProperty("--max-content-rows", `${this.maxRows}`), t.has("open") && this.updateOpenState(this.open);
33
+ updated(changedProperties) {
34
+ super.updated(changedProperties);
35
+ if (changedProperties.has("minRows") && this.minRows < this.maxRows && this.minRows > 0) {
36
+ this.style.setProperty("--min-content-rows", `${this.minRows}`);
37
+ }
38
+ if (changedProperties.has("maxRows") && this.maxRows > this.minRows && this.maxRows > 0) {
39
+ this.style.setProperty("--max-content-rows", `${this.maxRows}`);
40
+ }
41
+ if (changedProperties.has("open")) {
42
+ this.updateOpenState(this.open);
43
+ }
25
44
  }
26
45
  render() {
27
- return p`
46
+ return html`
28
47
  <div class="container">
29
48
  <div class="header">
30
49
  <u-icon class="icon"
@@ -39,7 +58,7 @@ class s extends c {
39
58
  ></u-icon>
40
59
  </div>
41
60
  <div class="content scrollable">
42
- ${this.content || p`<slot></slot>`}
61
+ ${this.content || html`<slot></slot>`}
43
62
  </div>
44
63
  <div class="footer"></div>
45
64
  </div>
@@ -47,19 +66,21 @@ class s extends c {
47
66
  }
48
67
  /** Alert를 표시합니다. */
49
68
  async show() {
50
- await this.updateComplete, requestAnimationFrame(() => {
51
- this.open = !0;
69
+ await this.updateComplete;
70
+ requestAnimationFrame(() => {
71
+ this.open = true;
52
72
  });
53
73
  }
54
74
  /** Alert를 숨깁니다. */
55
75
  async hide() {
56
- await this.updateComplete, requestAnimationFrame(() => {
57
- this.open = !1;
76
+ await this.updateComplete;
77
+ requestAnimationFrame(() => {
78
+ this.open = false;
58
79
  });
59
80
  }
60
81
  /** Alert 타입에 따른 아이콘 이름을 반환합니다. */
61
- getIcon(t) {
62
- switch (t) {
82
+ getIcon(type) {
83
+ switch (type) {
63
84
  case "error":
64
85
  return "exclamation-circle-fill";
65
86
  case "warning":
@@ -75,33 +96,40 @@ class s extends c {
75
96
  }
76
97
  }
77
98
  /** open 속성 변경에 따른 상태 업데이트를 처리합니다. */
78
- updateOpenState(t) {
79
- t ? (this.duration && this.duration > 0 && (this.timeoutId = window.setTimeout(() => {
80
- this.hide();
81
- }, this.duration)), this.emit("u-show")) : (clearTimeout(this.timeoutId), this.emit("u-hide"));
99
+ updateOpenState(open) {
100
+ if (open) {
101
+ if (this.duration && this.duration > 0) {
102
+ this.timeoutId = window.setTimeout(() => {
103
+ this.hide();
104
+ }, this.duration);
105
+ }
106
+ this.emit("u-show");
107
+ } else {
108
+ clearTimeout(this.timeoutId);
109
+ this.emit("u-hide");
110
+ }
82
111
  }
83
112
  }
84
- i([
85
- e({ type: Boolean, reflect: !0 })
86
- ], s.prototype, "open");
87
- i([
88
- e({ type: String, reflect: !0 })
89
- ], s.prototype, "type");
90
- i([
91
- e({ type: String })
92
- ], s.prototype, "label");
93
- i([
94
- e({ type: String })
95
- ], s.prototype, "content");
96
- i([
97
- e({ type: Number })
98
- ], s.prototype, "minRows");
99
- i([
100
- e({ type: Number })
101
- ], s.prototype, "maxRows");
102
- i([
103
- e({ type: Number })
104
- ], s.prototype, "duration");
105
- export {
106
- s as Alert
107
- };
113
+ __decorateClass([
114
+ property({ type: Boolean, reflect: true })
115
+ ], Alert.prototype, "open");
116
+ __decorateClass([
117
+ property({ type: String, reflect: true })
118
+ ], Alert.prototype, "type");
119
+ __decorateClass([
120
+ property({ type: String })
121
+ ], Alert.prototype, "label");
122
+ __decorateClass([
123
+ property({ type: String })
124
+ ], Alert.prototype, "content");
125
+ __decorateClass([
126
+ property({ type: Number })
127
+ ], Alert.prototype, "minRows");
128
+ __decorateClass([
129
+ property({ type: Number })
130
+ ], Alert.prototype, "maxRows");
131
+ __decorateClass([
132
+ property({ type: Number })
133
+ ], Alert.prototype, "duration");
134
+
135
+ export { Alert };
@@ -1,5 +1,6 @@
1
- import { css as r } from "lit";
2
- const e = r`
1
+ import { css } from 'lit';
2
+
3
+ const styles = css`
3
4
  :host {
4
5
  display: block;
5
6
  min-width: 300px;
@@ -109,6 +110,5 @@ const e = r`
109
110
  display: none;
110
111
  }
111
112
  `;
112
- export {
113
- e as styles
114
- };
113
+
114
+ export { styles };
@@ -1,27 +1,34 @@
1
- import { html as p } from "lit";
2
- import { property as n } from "lit/decorators.js";
3
- import { BaseElement as d } from "../BaseElement.js";
4
- import { Spinner as f } from "../spinner/Spinner.js";
5
- import { styles as u } from "./Button.styles.js";
6
- var m = Object.defineProperty, l = (t, r, o, h) => {
7
- for (var e = void 0, s = t.length - 1, i; s >= 0; s--)
8
- (i = t[s]) && (e = i(r, o, e) || e);
9
- return e && m(r, o, e), e;
1
+ import { html } from 'lit';
2
+ import { property } from 'lit/decorators.js';
3
+ import { BaseElement } from '../BaseElement.js';
4
+ import { Spinner } from '../spinner/Spinner.js';
5
+ import { styles } from './Button.styles.js';
6
+
7
+ var __defProp = Object.defineProperty;
8
+ var __decorateClass = (decorators, target, key, kind) => {
9
+ var result = void 0 ;
10
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
11
+ if (decorator = decorators[i])
12
+ result = (decorator(target, key, result) ) || result;
13
+ if (result) __defProp(target, key, result);
14
+ return result;
10
15
  };
11
- class a extends d {
16
+ class Button extends BaseElement {
12
17
  constructor() {
13
- super(...arguments), this.disabled = !1, this.loading = !1;
18
+ super(...arguments);
19
+ this.disabled = false;
20
+ this.loading = false;
14
21
  }
15
22
  static {
16
- this.styles = [super.styles, u];
23
+ this.styles = [super.styles, styles];
17
24
  }
18
25
  static {
19
26
  this.dependencies = {
20
- "u-spinner": f
27
+ "u-spinner": Spinner
21
28
  };
22
29
  }
23
30
  render() {
24
- return p`
31
+ return html`
25
32
  <button part="base" ?disabled=${this.disabled || this.loading}>
26
33
  <slot name="prefix"></slot>
27
34
  <slot></slot>
@@ -34,12 +41,11 @@ class a extends d {
34
41
  `;
35
42
  }
36
43
  }
37
- l([
38
- n({ type: Boolean, reflect: !0 })
39
- ], a.prototype, "disabled");
40
- l([
41
- n({ type: Boolean, reflect: !0 })
42
- ], a.prototype, "loading");
43
- export {
44
- a as Button
45
- };
44
+ __decorateClass([
45
+ property({ type: Boolean, reflect: true })
46
+ ], Button.prototype, "disabled");
47
+ __decorateClass([
48
+ property({ type: Boolean, reflect: true })
49
+ ], Button.prototype, "loading");
50
+
51
+ export { Button };
@@ -1,5 +1,6 @@
1
- import { css as o } from "lit";
2
- const t = o`
1
+ import { css } from 'lit';
2
+
3
+ const styles = css`
3
4
  :host {
4
5
  position: relative;
5
6
  display: inline-flex;
@@ -84,6 +85,5 @@ const t = o`
84
85
  background-color: inherit;
85
86
  }
86
87
  `;
87
- export {
88
- t as styles
89
- };
88
+
89
+ export { styles };
@@ -1,20 +1,35 @@
1
- import { html as l } from "lit";
2
- import { property as n } from "lit/decorators.js";
3
- import { offset as m, shift as u, flip as d, autoPlacement as p, computePosition as g } from "@floating-ui/dom";
4
- import { getParentElement as f } from "../../internals/node-helpers.js";
5
- import { BaseElement as v } from "../BaseElement.js";
6
- import { MenuItem as C } from "../menu-item/MenuItem.js";
7
- import { styles as y } from "./ContextMenu.styles.js";
8
- var b = Object.defineProperty, o = (h, t, s, a) => {
9
- for (var e = void 0, i = h.length - 1, c; i >= 0; i--)
10
- (c = h[i]) && (e = c(t, s, e) || e);
11
- return e && b(t, s, e), e;
1
+ import { html } from 'lit';
2
+ import { property } from 'lit/decorators.js';
3
+ import { offset, shift, flip, autoPlacement, computePosition } from '@floating-ui/dom';
4
+ import { getParentElement } from '../../internals/node-helpers.js';
5
+ import { BaseElement } from '../BaseElement.js';
6
+ import { MenuItem } from '../menu-item/MenuItem.js';
7
+ import { styles } from './ContextMenu.styles.js';
8
+
9
+ var __defProp = Object.defineProperty;
10
+ var __decorateClass = (decorators, target, key, kind) => {
11
+ var result = void 0 ;
12
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
13
+ if (decorator = decorators[i])
14
+ result = (decorator(target, key, result) ) || result;
15
+ if (result) __defProp(target, key, result);
16
+ return result;
12
17
  };
13
- class r extends v {
18
+ class ContextMenu extends BaseElement {
14
19
  constructor() {
15
- super(...arguments), this.mouseX = 0, this.mouseY = 0, this.open = !1, this.hoist = !0, this.distance = 2, this.show = async (t, s) => {
16
- t !== void 0 && (this.mouseX = t), s !== void 0 && (this.mouseY = s), await this.updateComplete;
17
- const a = {
20
+ super(...arguments);
21
+ /** 마우스 클릭 위치 */
22
+ this.mouseX = 0;
23
+ this.mouseY = 0;
24
+ this.open = false;
25
+ this.hoist = true;
26
+ this.distance = 2;
27
+ /** 컨텍스트 메뉴를 표시합니다. */
28
+ this.show = async (x, y) => {
29
+ if (x !== void 0) this.mouseX = x;
30
+ if (y !== void 0) this.mouseY = y;
31
+ await this.updateComplete;
32
+ const virtualElement = {
18
33
  getBoundingClientRect: () => ({
19
34
  width: 0,
20
35
  height: 0,
@@ -25,64 +40,95 @@ class r extends v {
25
40
  right: this.mouseX,
26
41
  bottom: this.mouseY
27
42
  })
28
- }, e = [
29
- m({ mainAxis: this.distance }),
30
- u({ padding: 8 }),
31
- d()
43
+ };
44
+ const middleware = [
45
+ offset({ mainAxis: this.distance }),
46
+ shift({ padding: 8 }),
47
+ flip()
32
48
  ];
33
- this.placement || e.push(p({ allowedPlacements: ["bottom-start", "bottom-end", "top-start", "top-end"] }));
34
- const i = await g(a, this, {
49
+ if (!this.placement) {
50
+ middleware.push(autoPlacement({ allowedPlacements: ["bottom-start", "bottom-end", "top-start", "top-end"] }));
51
+ }
52
+ const position = await computePosition(virtualElement, this, {
35
53
  placement: this.placement || "bottom-start",
36
- middleware: e,
54
+ middleware,
37
55
  strategy: this.hoist ? "fixed" : "absolute"
38
56
  });
39
57
  Object.assign(this.style, {
40
- left: `${i.x}px`,
41
- top: `${i.y}px`,
42
- transformOrigin: this.getTransformOrigin(i.placement)
43
- }), await this.updateComplete, requestAnimationFrame(() => {
44
- this.open = !0, this.emit("u-show");
58
+ left: `${position.x}px`,
59
+ top: `${position.y}px`,
60
+ transformOrigin: this.getTransformOrigin(position.placement)
45
61
  });
46
- }, this.hide = async () => {
47
- await this.updateComplete, requestAnimationFrame(() => {
48
- this.open = !1, this.emit("u-hide");
62
+ await this.updateComplete;
63
+ requestAnimationFrame(() => {
64
+ this.open = true;
65
+ this.emit("u-show");
49
66
  });
50
- }, this.handleContextMenu = (t) => {
51
- t.preventDefault(), t.stopPropagation(), this.show(t.clientX, t.clientY);
52
- }, this.handleDocumentClick = (t) => {
53
- this.open && !this.contains(t.target) && this.hide();
54
- }, this.handleDocumentContextMenu = (t) => {
55
- this.open && !this.trigger?.contains(t.target) && this.hide();
56
- }, this.handleSlotChange = () => {
57
- this.shadowRoot?.querySelector("slot")?.assignedElements({ flatten: !0 })?.forEach((a) => {
58
- a.addEventListener("u-select", () => {
67
+ };
68
+ /** 컨텍스트 메뉴를 숨깁니다. */
69
+ this.hide = async () => {
70
+ await this.updateComplete;
71
+ requestAnimationFrame(() => {
72
+ this.open = false;
73
+ this.emit("u-hide");
74
+ });
75
+ };
76
+ /** 컨텍스트 메뉴 이벤트를 처리합니다. */
77
+ this.handleContextMenu = (e) => {
78
+ e.preventDefault();
79
+ e.stopPropagation();
80
+ this.show(e.clientX, e.clientY);
81
+ };
82
+ /** 문서 클릭 이벤트를 처리합니다. */
83
+ this.handleDocumentClick = (e) => {
84
+ if (this.open && !this.contains(e.target)) {
85
+ this.hide();
86
+ }
87
+ };
88
+ /** 문서 컨텍스트 메뉴 이벤트를 처리합니다. */
89
+ this.handleDocumentContextMenu = (e) => {
90
+ if (this.open && !this.trigger?.contains(e.target)) {
91
+ this.hide();
92
+ }
93
+ };
94
+ /** 슬롯 변경 이벤트를 처리합니다. */
95
+ this.handleSlotChange = () => {
96
+ const slot = this.shadowRoot?.querySelector("slot");
97
+ const items = slot?.assignedElements({ flatten: true });
98
+ items?.forEach((item) => {
99
+ item.addEventListener("u-select", () => {
59
100
  this.hide();
60
101
  });
61
102
  });
62
103
  };
63
104
  }
64
105
  static {
65
- this.styles = [super.styles, y];
106
+ this.styles = [super.styles, styles];
66
107
  }
67
108
  static {
68
109
  this.dependencies = {
69
- "u-menu-item": C
110
+ "u-menu-item": MenuItem
70
111
  };
71
112
  }
72
113
  connectedCallback() {
73
- super.connectedCallback(), this.trigger ||= f(this), this.setAttribute("role", "menu");
114
+ super.connectedCallback();
115
+ this.trigger ||= getParentElement(this);
116
+ this.setAttribute("role", "menu");
74
117
  }
75
118
  disconnectedCallback() {
76
- this.detachTrigger(this.trigger), super.disconnectedCallback();
119
+ this.detachTrigger(this.trigger);
120
+ super.disconnectedCallback();
77
121
  }
78
- updated(t) {
79
- if (super.updated(t), t.has("trigger") && this.trigger) {
80
- const s = t.get("trigger");
81
- this.detachTrigger(s), this.attachTrigger(this.trigger);
122
+ updated(changedProperties) {
123
+ super.updated(changedProperties);
124
+ if (changedProperties.has("trigger") && this.trigger) {
125
+ const oldTrigger = changedProperties.get("trigger");
126
+ this.detachTrigger(oldTrigger);
127
+ this.attachTrigger(this.trigger);
82
128
  }
83
129
  }
84
130
  render() {
85
- return l`
131
+ return html`
86
132
  <div class="container">
87
133
  <slot @slotchange=${this.handleSlotChange}></slot>
88
134
  </div>
@@ -91,8 +137,8 @@ class r extends v {
91
137
  /**
92
138
  * 메뉴가 나타날 위치에 따라 transform-origin 값을 반환합니다.
93
139
  */
94
- getTransformOrigin(t) {
95
- switch (t) {
140
+ getTransformOrigin(placement) {
141
+ switch (placement) {
96
142
  case "top":
97
143
  case "top-start":
98
144
  case "top-end":
@@ -114,29 +160,34 @@ class r extends v {
114
160
  }
115
161
  }
116
162
  /** 대상 엘리먼트에 컨텍스트 메뉴 이벤트를 바인딩 합니다. */
117
- attachTrigger(t) {
118
- t && (t.addEventListener("contextmenu", this.handleContextMenu), document.addEventListener("click", this.handleDocumentClick), document.addEventListener("contextmenu", this.handleDocumentContextMenu));
163
+ attachTrigger(trigger) {
164
+ if (!trigger) return;
165
+ trigger.addEventListener("contextmenu", this.handleContextMenu);
166
+ document.addEventListener("click", this.handleDocumentClick);
167
+ document.addEventListener("contextmenu", this.handleDocumentContextMenu);
119
168
  }
120
169
  /** 대상 엘리먼트에 바인딩된 컨텍스트 메뉴 이벤트를 제거합니다. */
121
- detachTrigger(t) {
122
- t && (t.removeEventListener("contextmenu", this.handleContextMenu), document.removeEventListener("click", this.handleDocumentClick), document.removeEventListener("contextmenu", this.handleDocumentContextMenu));
170
+ detachTrigger(trigger) {
171
+ if (!trigger) return;
172
+ trigger.removeEventListener("contextmenu", this.handleContextMenu);
173
+ document.removeEventListener("click", this.handleDocumentClick);
174
+ document.removeEventListener("contextmenu", this.handleDocumentContextMenu);
123
175
  }
124
176
  }
125
- o([
126
- n({ attribute: !1 })
127
- ], r.prototype, "trigger");
128
- o([
129
- n({ type: Boolean, reflect: !0 })
130
- ], r.prototype, "open");
131
- o([
132
- n({ type: Boolean, reflect: !0 })
133
- ], r.prototype, "hoist");
134
- o([
135
- n({ type: String })
136
- ], r.prototype, "placement");
137
- o([
138
- n({ type: Number })
139
- ], r.prototype, "distance");
140
- export {
141
- r as ContextMenu
142
- };
177
+ __decorateClass([
178
+ property({ attribute: false })
179
+ ], ContextMenu.prototype, "trigger");
180
+ __decorateClass([
181
+ property({ type: Boolean, reflect: true })
182
+ ], ContextMenu.prototype, "open");
183
+ __decorateClass([
184
+ property({ type: Boolean, reflect: true })
185
+ ], ContextMenu.prototype, "hoist");
186
+ __decorateClass([
187
+ property({ type: String })
188
+ ], ContextMenu.prototype, "placement");
189
+ __decorateClass([
190
+ property({ type: Number })
191
+ ], ContextMenu.prototype, "distance");
192
+
193
+ export { ContextMenu };
@@ -1,5 +1,6 @@
1
- import { css as o } from "lit";
2
- const e = o`
1
+ import { css } from 'lit';
2
+
3
+ const styles = css`
3
4
  :host {
4
5
  position: absolute;
5
6
  z-index: 1000;
@@ -35,6 +36,5 @@ const e = o`
35
36
  overflow: hidden;
36
37
  }
37
38
  `;
38
- export {
39
- e as styles
40
- };
39
+
40
+ export { styles };