@iyulab/components 0.1.0 → 0.1.2

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 +8 -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 +38 -26
  78. package/dist/utilities/theme.js +110 -85
  79. package/package.json +2 -2
  80. package/dist/utilities/storage.d.ts +0 -60
  81. package/dist/utilities/storage.js +0 -120
@@ -1,5 +1,6 @@
1
- import { css as o } from "lit";
2
- const i = o`
1
+ import { css } from 'lit';
2
+
3
+ const styles = css`
3
4
  :host {
4
5
  position: relative;
5
6
  display: flex;
@@ -14,6 +15,5 @@ const i = o`
14
15
  flex-direction: column;
15
16
  }
16
17
  `;
17
- export {
18
- i as styles
19
- };
18
+
19
+ export { styles };
@@ -1,39 +1,45 @@
1
- import { html as p } from "lit";
2
- import { state as l, property as g } from "lit/decorators.js";
3
- import { BaseElement as d } from "../BaseElement.js";
4
- import { styles as m } from "./Splitter.styles.js";
5
- var f = Object.defineProperty, n = (r, e, i, u) => {
6
- for (var t = void 0, s = r.length - 1, o; s >= 0; s--)
7
- (o = r[s]) && (t = o(e, i, t) || t);
8
- return t && f(e, i, t), t;
1
+ import { html } from 'lit';
2
+ import { state, property } from 'lit/decorators.js';
3
+ import { BaseElement } from '../BaseElement.js';
4
+ import { styles } from './Splitter.styles.js';
5
+
6
+ var __defProp = Object.defineProperty;
7
+ var __decorateClass = (decorators, target, key, kind) => {
8
+ var result = void 0 ;
9
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
10
+ if (decorator = decorators[i])
11
+ result = (decorator(target, key, result) ) || result;
12
+ if (result) __defProp(target, key, result);
13
+ return result;
9
14
  };
10
- class a extends d {
15
+ class Splitter extends BaseElement {
11
16
  constructor() {
12
- super(...arguments), this.dragging = !1, this.orientation = "horizontal";
17
+ super(...arguments);
18
+ this.dragging = false;
19
+ this.orientation = "horizontal";
13
20
  }
14
21
  static {
15
- this.styles = [super.styles, m];
22
+ this.styles = [super.styles, styles];
16
23
  }
17
24
  static {
18
25
  this.dependencies = {};
19
26
  }
20
27
  render() {
21
- return p`
28
+ return html`
22
29
  <div class="handler" ?dragging=${this.dragging}></div>
23
30
  `;
24
31
  }
25
32
  /** 스플리터의 크기를 반환합니다. */
26
33
  get size() {
27
- const e = getComputedStyle(this).getPropertyValue("--splitter-size").trim();
28
- return parseFloat(e) || 2;
34
+ const sizeStr = getComputedStyle(this).getPropertyValue("--splitter-size").trim();
35
+ return parseFloat(sizeStr) || 2;
29
36
  }
30
37
  }
31
- n([
32
- l()
33
- ], a.prototype, "dragging");
34
- n([
35
- g({ type: String, reflect: !0 })
36
- ], a.prototype, "orientation");
37
- export {
38
- a as Splitter
39
- };
38
+ __decorateClass([
39
+ state()
40
+ ], Splitter.prototype, "dragging");
41
+ __decorateClass([
42
+ property({ type: String, reflect: true })
43
+ ], Splitter.prototype, "orientation");
44
+
45
+ export { Splitter };
@@ -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
  position: relative;
5
6
  display: block;
@@ -40,6 +41,5 @@ const e = r`
40
41
  opacity: 1;
41
42
  }
42
43
  `;
43
- export {
44
- e as styles
45
- };
44
+
45
+ export { styles };
@@ -1,91 +1,133 @@
1
- import { html as l } from "lit";
2
- import { property as r } from "lit/decorators.js";
3
- import { offset as g, shift as p, flip as u, autoPlacement as m, computePosition as d } from "@floating-ui/dom";
4
- import { getParentElement as f, findElementsBy as y } from "../../internals/node-helpers.js";
5
- import { BaseElement as E } from "../BaseElement.js";
6
- import { styles as v } from "./Tooltip.styles.js";
7
- var T = Object.defineProperty, i = (a, t, e, n) => {
8
- for (var s = void 0, h = a.length - 1, c; h >= 0; h--)
9
- (c = a[h]) && (s = c(t, e, s) || s);
10
- return s && T(t, e, s), s;
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, findElementsBy } from '../../internals/node-helpers.js';
5
+ import { BaseElement } from '../BaseElement.js';
6
+ import { styles } from './Tooltip.styles.js';
7
+
8
+ var __defProp = Object.defineProperty;
9
+ var __decorateClass = (decorators, target, key, kind) => {
10
+ var result = void 0 ;
11
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
12
+ if (decorator = decorators[i])
13
+ result = (decorator(target, key, result) ) || result;
14
+ if (result) __defProp(target, key, result);
15
+ return result;
11
16
  };
12
- class o extends E {
17
+ class Tooltip extends BaseElement {
13
18
  constructor() {
14
- super(...arguments), this.isSlotEmpty = !0, this.triggers = [], this.open = !1, this.hoist = !1, this.distance = 8, this.show = async (t) => {
19
+ super(...arguments);
20
+ /** 슬롯이 비어있는지 여부를 나타냅니다. */
21
+ this.isSlotEmpty = true;
22
+ this.triggers = [];
23
+ this.open = false;
24
+ this.hoist = false;
25
+ this.distance = 8;
26
+ /** 툴팁을 표시합니다. */
27
+ this.show = async (e) => {
15
28
  await this.updateComplete;
16
- const e = t?.currentTarget || this.triggers[0] || null;
17
- if (!e || this.isSlotEmpty) return;
18
- const n = [
19
- g({ mainAxis: this.distance }),
20
- p(),
21
- u()
29
+ const trigger = e?.currentTarget || this.triggers[0] || null;
30
+ if (!trigger || this.isSlotEmpty) return;
31
+ const middleware = [
32
+ offset({ mainAxis: this.distance }),
33
+ shift(),
34
+ flip()
22
35
  ];
23
- this.placement || n.push(m());
24
- const s = await d(e, this, {
36
+ if (!this.placement)
37
+ middleware.push(autoPlacement());
38
+ const position = await computePosition(trigger, this, {
25
39
  placement: this.placement,
26
- middleware: n,
40
+ middleware,
27
41
  strategy: this.hoist ? "fixed" : "absolute"
28
42
  });
29
43
  Object.assign(this.style, {
30
- left: `${s.x}px`,
31
- top: `${s.y}px`,
32
- transformOrigin: this.getTransformOrigin(s.placement)
33
- }), await this.updateComplete, requestAnimationFrame(() => {
34
- this.open = !0;
44
+ left: `${position.x}px`,
45
+ top: `${position.y}px`,
46
+ transformOrigin: this.getTransformOrigin(position.placement)
35
47
  });
36
- }, this.hide = async (t) => {
37
- await this.updateComplete, requestAnimationFrame(() => {
38
- this.open = !1;
48
+ await this.updateComplete;
49
+ requestAnimationFrame(() => {
50
+ this.open = true;
51
+ });
52
+ };
53
+ /** 툴팁을 숨깁니다. */
54
+ this.hide = async (_) => {
55
+ await this.updateComplete;
56
+ requestAnimationFrame(() => {
57
+ this.open = false;
58
+ });
59
+ };
60
+ /**
61
+ * slot에 콘텐츠가 존재하는지 확인합니다.
62
+ */
63
+ this.handleSlotChange = (e) => {
64
+ const slot = e.target;
65
+ const nodes = slot.assignedNodes({ flatten: true }) ?? [];
66
+ this.isSlotEmpty = !nodes.some((node) => {
67
+ if (node.nodeType === Node.ELEMENT_NODE) return true;
68
+ if (node.nodeType === Node.TEXT_NODE && node.textContent?.trim()) return true;
69
+ return false;
39
70
  });
40
- }, this.handleSlotChange = (t) => {
41
- const n = t.target.assignedNodes({ flatten: !0 }) ?? [];
42
- this.isSlotEmpty = !n.some((s) => !!(s.nodeType === Node.ELEMENT_NODE || s.nodeType === Node.TEXT_NODE && s.textContent?.trim()));
43
71
  };
44
72
  }
45
73
  static {
46
- this.styles = [super.styles, v];
74
+ this.styles = [super.styles, styles];
47
75
  }
48
76
  static {
49
77
  this.dependencies = {};
50
78
  }
51
79
  connectedCallback() {
52
- if (super.connectedCallback(), this.triggers.length === 0) {
53
- const t = f(this);
54
- t && (this.triggers = [t]);
80
+ super.connectedCallback();
81
+ if (this.triggers.length === 0) {
82
+ const parent = getParentElement(this);
83
+ if (parent) this.triggers = [parent];
55
84
  }
56
85
  }
57
86
  disconnectedCallback() {
58
- this.detachTriggers(this.triggers), super.disconnectedCallback();
87
+ this.detachTriggers(this.triggers);
88
+ super.disconnectedCallback();
59
89
  }
60
- updated(t) {
61
- if (super.updated(t), t.has("triggers") && this.triggers) {
62
- const e = t.get("triggers");
63
- this.detachTriggers(e), this.attachTriggers(this.triggers);
90
+ updated(changedProperties) {
91
+ super.updated(changedProperties);
92
+ if (changedProperties.has("triggers") && this.triggers) {
93
+ const oldTriggers = changedProperties.get("triggers");
94
+ this.detachTriggers(oldTriggers);
95
+ this.attachTriggers(this.triggers);
96
+ }
97
+ if (changedProperties.has("triggerSelectors") && this.triggerSelectors) {
98
+ this.triggers = findElementsBy(this, this.triggerSelectors);
64
99
  }
65
- t.has("triggerSelectors") && this.triggerSelectors && (this.triggers = y(this, this.triggerSelectors));
66
100
  }
67
101
  render() {
68
- return l`
102
+ return html`
69
103
  <slot @slotchange=${this.handleSlotChange}></slot>
70
104
  `;
71
105
  }
72
106
  /** 대상 엘리먼트에 툴팁 이벤트를 바인딩 합니다. */
73
- attachTriggers(t) {
74
- if (t)
75
- for (const e of t)
76
- e.addEventListener("mouseenter", this.show), e.addEventListener("mouseleave", this.hide), e.addEventListener("focusin", this.show), e.addEventListener("focusout", this.hide);
107
+ attachTriggers(triggers) {
108
+ if (!triggers) return;
109
+ for (const trigger of triggers) {
110
+ trigger.addEventListener("mouseenter", this.show);
111
+ trigger.addEventListener("mouseleave", this.hide);
112
+ trigger.addEventListener("focusin", this.show);
113
+ trigger.addEventListener("focusout", this.hide);
114
+ }
77
115
  }
78
116
  /** 대상 엘리먼트에 바인딩된 툴팁 이벤트를 제거합니다. */
79
- detachTriggers(t) {
80
- if (t)
81
- for (const e of t)
82
- e.removeEventListener("mouseenter", this.show), e.removeEventListener("mouseleave", this.hide), e.removeEventListener("focusin", this.show), e.removeEventListener("focusout", this.hide);
117
+ detachTriggers(triggers) {
118
+ if (!triggers) return;
119
+ for (const trigger of triggers) {
120
+ trigger.removeEventListener("mouseenter", this.show);
121
+ trigger.removeEventListener("mouseleave", this.hide);
122
+ trigger.removeEventListener("focusin", this.show);
123
+ trigger.removeEventListener("focusout", this.hide);
124
+ }
83
125
  }
84
126
  /**
85
127
  * 툴팁이 나타날 위치에 따라 transform-origin 값을 반환합니다.
86
128
  */
87
- getTransformOrigin(t) {
88
- switch (t) {
129
+ getTransformOrigin(placement) {
130
+ switch (placement) {
89
131
  case "top":
90
132
  case "top-start":
91
133
  case "top-end":
@@ -107,24 +149,23 @@ class o extends E {
107
149
  }
108
150
  }
109
151
  }
110
- i([
111
- r({ attribute: !1 })
112
- ], o.prototype, "triggers");
113
- i([
114
- r({ type: String, attribute: "trigger-selectors" })
115
- ], o.prototype, "triggerSelectors");
116
- i([
117
- r({ type: Boolean, reflect: !0 })
118
- ], o.prototype, "open");
119
- i([
120
- r({ type: Boolean, reflect: !0 })
121
- ], o.prototype, "hoist");
122
- i([
123
- r({ type: String })
124
- ], o.prototype, "placement");
125
- i([
126
- r({ type: Number })
127
- ], o.prototype, "distance");
128
- export {
129
- o as Tooltip
130
- };
152
+ __decorateClass([
153
+ property({ attribute: false })
154
+ ], Tooltip.prototype, "triggers");
155
+ __decorateClass([
156
+ property({ type: String, attribute: "trigger-selectors" })
157
+ ], Tooltip.prototype, "triggerSelectors");
158
+ __decorateClass([
159
+ property({ type: Boolean, reflect: true })
160
+ ], Tooltip.prototype, "open");
161
+ __decorateClass([
162
+ property({ type: Boolean, reflect: true })
163
+ ], Tooltip.prototype, "hoist");
164
+ __decorateClass([
165
+ property({ type: String })
166
+ ], Tooltip.prototype, "placement");
167
+ __decorateClass([
168
+ property({ type: Number })
169
+ ], Tooltip.prototype, "distance");
170
+
171
+ export { Tooltip };
@@ -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;
@@ -31,6 +32,5 @@ const e = o`
31
32
  position: fixed;
32
33
  }
33
34
  `;
34
- export {
35
- e as styles
36
- };
35
+
36
+ export { styles };
package/dist/index.js CHANGED
@@ -1,40 +1,18 @@
1
- import { Alert as e } from "./components/alert/Alert.js";
2
- import { Button as p } from "./components/button/Button.js";
3
- import { ContextMenu as f } from "./components/context-menu/ContextMenu.js";
4
- import { Dialog as n } from "./components/dialog/Dialog.js";
5
- import { Form as i } from "./components/form/Form.js";
6
- import { Icon as g } from "./components/icon/Icon.js";
7
- import { IconButton as M } from "./components/icon-button/IconButton.js";
8
- import { Input as s } from "./components/input/Input.js";
9
- import { Menu as B } from "./components/menu/Menu.js";
10
- import { Panel as S } from "./components/panel/Panel.js";
11
- import { ProgressRing as h } from "./components/progress-ring/ProgressRing.js";
12
- import { Spinner as A } from "./components/spinner/Spinner.js";
13
- import { SplitPanel as D } from "./components/split-panel/SplitPanel.js";
14
- import { Tooltip as R } from "./components/tooltip/Tooltip.js";
15
- import { getPropertyMeta as b, propertyMeta as d, setPropertyMeta as j } from "./utilities/decorators.js";
16
- import { notifier as q } from "./utilities/notifier.js";
17
- import { BrowserStorage as z } from "./utilities/storage.js";
18
- import { theme as G } from "./utilities/theme.js";
19
- export {
20
- e as Alert,
21
- z as BrowserStorage,
22
- p as Button,
23
- f as ContextMenu,
24
- n as Dialog,
25
- i as Form,
26
- g as Icon,
27
- M as IconButton,
28
- s as Input,
29
- B as Menu,
30
- S as Panel,
31
- h as ProgressRing,
32
- A as Spinner,
33
- D as SplitPanel,
34
- R as Tooltip,
35
- b as getPropertyMeta,
36
- q as notifier,
37
- d as propertyMeta,
38
- j as setPropertyMeta,
39
- G as theme
40
- };
1
+ export { Alert } from './components/alert/Alert.js';
2
+ export { Button } from './components/button/Button.js';
3
+ export { ContextMenu } from './components/context-menu/ContextMenu.js';
4
+ export { Dialog } from './components/dialog/Dialog.js';
5
+ export { Form } from './components/form/Form.js';
6
+ export { Icon } from './components/icon/Icon.js';
7
+ export { IconButton } from './components/icon-button/IconButton.js';
8
+ export { Input } from './components/input/Input.js';
9
+ export { Menu } from './components/menu/Menu.js';
10
+ export { Panel } from './components/panel/Panel.js';
11
+ export { ProgressRing } from './components/progress-ring/ProgressRing.js';
12
+ export { Spinner } from './components/spinner/Spinner.js';
13
+ export { SplitPanel } from './components/split-panel/SplitPanel.js';
14
+ export { Tooltip } from './components/tooltip/Tooltip.js';
15
+ export { BrowserStorage } from './utilities/BrowserStorage.js';
16
+ export { getPropertyMeta, propertyMeta, setPropertyMeta } from './utilities/decorators.js';
17
+ export { notifier } from './utilities/notifier.js';
18
+ export { Theme, theme } from './utilities/theme.js';
@@ -1,12 +1,14 @@
1
- function e(i, r = ",") {
1
+ function arrayAttributeConverter(parser, separator = ",") {
2
2
  return {
3
- fromAttribute: (t) => {
4
- if (t)
5
- return t.split(r).map((n) => i(n.trim()));
3
+ fromAttribute: (value) => {
4
+ if (!value) return void 0;
5
+ return value.split(separator).map((v) => parser(v.trim()));
6
6
  },
7
- toAttribute: (t) => t ? t.join(r) : null
7
+ toAttribute: (value) => {
8
+ if (!value) return null;
9
+ return value.join(separator);
10
+ }
8
11
  };
9
12
  }
10
- export {
11
- e as arrayAttributeConverter
12
- };
13
+
14
+ export { arrayAttributeConverter };
@@ -1,67 +1,42 @@
1
- import * as i from "../assets/icons/arrow-clockwise.svg.js";
2
- import * as r from "../assets/icons/arrow-down.svg.js";
3
- import * as e from "../assets/icons/arrow-up.svg.js";
4
- import * as a from "../assets/icons/ban.svg.js";
5
- import * as t from "../assets/icons/bell-fill.svg.js";
6
- import * as l from "../assets/icons/check-circle-fill.svg.js";
7
- import * as c from "../assets/icons/check-lg.svg.js";
8
- import * as m from "../assets/icons/chevron-down.svg.js";
9
- import * as n from "../assets/icons/chevron-left.svg.js";
10
- import * as p from "../assets/icons/chevron-right.svg.js";
11
- import * as g from "../assets/icons/chevron-up.svg.js";
12
- import * as f from "../assets/icons/copy.svg.js";
13
- import * as v from "../assets/icons/dash-lg.svg.js";
14
- import * as h from "../assets/icons/exclamation-circle-fill.svg.js";
15
- import * as b from "../assets/icons/exclamation-triangle-fill.svg.js";
16
- import * as u from "../assets/icons/eye-slash.svg.js";
17
- import * as w from "../assets/icons/eye.svg.js";
18
- import * as d from "../assets/icons/info-circle-fill.svg.js";
19
- import * as y from "../assets/icons/layout-sidebar.svg.js";
20
- import * as F from "../assets/icons/lightbulb-fill.svg.js";
21
- import * as x from "../assets/icons/lightbulb-off.svg.js";
22
- import * as k from "../assets/icons/lightbulb.svg.js";
23
- import * as L from "../assets/icons/mic-fill.svg.js";
24
- import * as C from "../assets/icons/mic-mute-fill.svg.js";
25
- import * as O from "../assets/icons/paperclip.svg.js";
26
- import * as S from "../assets/icons/pencil-square.svg.js";
27
- import * as j from "../assets/icons/plus-lg.svg.js";
28
- import * as q from "../assets/icons/search.svg.js";
29
- import * as D from "../assets/icons/speedometer.svg.js";
30
- import * as M from "../assets/icons/x-lg.svg.js";
31
- const R = new Map(
32
- Object.entries(/* @__PURE__ */ Object.assign({
33
- "../assets/icons/arrow-clockwise.svg": i,
34
- "../assets/icons/arrow-down.svg": r,
35
- "../assets/icons/arrow-up.svg": e,
36
- "../assets/icons/ban.svg": a,
37
- "../assets/icons/bell-fill.svg": t,
38
- "../assets/icons/check-circle-fill.svg": l,
39
- "../assets/icons/check-lg.svg": c,
40
- "../assets/icons/chevron-down.svg": m,
41
- "../assets/icons/chevron-left.svg": n,
42
- "../assets/icons/chevron-right.svg": p,
43
- "../assets/icons/chevron-up.svg": g,
44
- "../assets/icons/copy.svg": f,
45
- "../assets/icons/dash-lg.svg": v,
46
- "../assets/icons/exclamation-circle-fill.svg": h,
47
- "../assets/icons/exclamation-triangle-fill.svg": b,
48
- "../assets/icons/eye-slash.svg": u,
49
- "../assets/icons/eye.svg": w,
50
- "../assets/icons/info-circle-fill.svg": d,
51
- "../assets/icons/layout-sidebar.svg": y,
52
- "../assets/icons/lightbulb-fill.svg": F,
53
- "../assets/icons/lightbulb-off.svg": x,
54
- "../assets/icons/lightbulb.svg": k,
55
- "../assets/icons/mic-fill.svg": L,
56
- "../assets/icons/mic-mute-fill.svg": C,
57
- "../assets/icons/paperclip.svg": O,
58
- "../assets/icons/pencil-square.svg": S,
59
- "../assets/icons/plus-lg.svg": j,
60
- "../assets/icons/search.svg": q,
61
- "../assets/icons/speedometer.svg": D,
62
- "../assets/icons/x-lg.svg": M
63
- })).map(([s, o]) => [s.split("/").pop()?.replace(".svg", "") || "", o.default]).filter(([s]) => s !== "")
1
+ import * as arrowClockwise from '../assets/icons/arrow-clockwise.svg.js';
2
+ import * as arrowDown from '../assets/icons/arrow-down.svg.js';
3
+ import * as arrowUp from '../assets/icons/arrow-up.svg.js';
4
+ import * as ban from '../assets/icons/ban.svg.js';
5
+ import * as bellFill from '../assets/icons/bell-fill.svg.js';
6
+ import * as checkCircleFill from '../assets/icons/check-circle-fill.svg.js';
7
+ import * as checkLg from '../assets/icons/check-lg.svg.js';
8
+ import * as chevronDown from '../assets/icons/chevron-down.svg.js';
9
+ import * as chevronLeft from '../assets/icons/chevron-left.svg.js';
10
+ import * as chevronRight from '../assets/icons/chevron-right.svg.js';
11
+ import * as chevronUp from '../assets/icons/chevron-up.svg.js';
12
+ import * as copy from '../assets/icons/copy.svg.js';
13
+ import * as dashLg from '../assets/icons/dash-lg.svg.js';
14
+ import * as exclamationCircleFill from '../assets/icons/exclamation-circle-fill.svg.js';
15
+ import * as exclamationTriangleFill from '../assets/icons/exclamation-triangle-fill.svg.js';
16
+ import * as eyeSlash from '../assets/icons/eye-slash.svg.js';
17
+ import * as eye from '../assets/icons/eye.svg.js';
18
+ import * as infoCircleFill from '../assets/icons/info-circle-fill.svg.js';
19
+ import * as layoutSidebar from '../assets/icons/layout-sidebar.svg.js';
20
+ import * as lightbulbFill from '../assets/icons/lightbulb-fill.svg.js';
21
+ import * as lightbulbOff from '../assets/icons/lightbulb-off.svg.js';
22
+ import * as lightbulb from '../assets/icons/lightbulb.svg.js';
23
+ import * as micFill from '../assets/icons/mic-fill.svg.js';
24
+ import * as micMuteFill from '../assets/icons/mic-mute-fill.svg.js';
25
+ import * as paperclip from '../assets/icons/paperclip.svg.js';
26
+ import * as pencilSquare from '../assets/icons/pencil-square.svg.js';
27
+ import * as plusLg from '../assets/icons/plus-lg.svg.js';
28
+ import * as search from '../assets/icons/search.svg.js';
29
+ import * as speedometer from '../assets/icons/speedometer.svg.js';
30
+ import * as xLg from '../assets/icons/x-lg.svg.js';
31
+
32
+ const icons = new Map(
33
+ Object.entries(/* #__PURE__ */ Object.assign({"../assets/icons/arrow-clockwise.svg": arrowClockwise,"../assets/icons/arrow-down.svg": arrowDown,"../assets/icons/arrow-up.svg": arrowUp,"../assets/icons/ban.svg": ban,"../assets/icons/bell-fill.svg": bellFill,"../assets/icons/check-circle-fill.svg": checkCircleFill,"../assets/icons/check-lg.svg": checkLg,"../assets/icons/chevron-down.svg": chevronDown,"../assets/icons/chevron-left.svg": chevronLeft,"../assets/icons/chevron-right.svg": chevronRight,"../assets/icons/chevron-up.svg": chevronUp,"../assets/icons/copy.svg": copy,"../assets/icons/dash-lg.svg": dashLg,"../assets/icons/exclamation-circle-fill.svg": exclamationCircleFill,"../assets/icons/exclamation-triangle-fill.svg": exclamationTriangleFill,"../assets/icons/eye-slash.svg": eyeSlash,"../assets/icons/eye.svg": eye,"../assets/icons/info-circle-fill.svg": infoCircleFill,"../assets/icons/layout-sidebar.svg": layoutSidebar,"../assets/icons/lightbulb-fill.svg": lightbulbFill,"../assets/icons/lightbulb-off.svg": lightbulbOff,"../assets/icons/lightbulb.svg": lightbulb,"../assets/icons/mic-fill.svg": micFill,"../assets/icons/mic-mute-fill.svg": micMuteFill,"../assets/icons/paperclip.svg": paperclip,"../assets/icons/pencil-square.svg": pencilSquare,"../assets/icons/plus-lg.svg": plusLg,"../assets/icons/search.svg": search,"../assets/icons/speedometer.svg": speedometer,"../assets/icons/x-lg.svg": xLg
34
+
35
+
36
+ })).map(([path, module]) => {
37
+ const name = path.split("/").pop()?.replace(".svg", "") || "";
38
+ return [name, module.default];
39
+ }).filter(([name]) => name !== "")
64
40
  );
65
- export {
66
- R as icons
67
- };
41
+
42
+ export { icons };
@@ -1,21 +1,20 @@
1
- function r(o) {
2
- if (o.parentElement)
3
- return o.parentElement;
4
- {
5
- const e = o.getRootNode({ composed: !1 });
6
- return e instanceof Document ? e.documentElement : e instanceof ShadowRoot ? e.host : e instanceof HTMLElement ? e : void 0;
1
+ function getParentElement(element) {
2
+ if (element.parentElement) {
3
+ return element.parentElement;
4
+ } else {
5
+ const root = element.getRootNode({ composed: false });
6
+ return root instanceof Document ? root.documentElement : root instanceof ShadowRoot ? root.host : root instanceof HTMLElement ? root : void 0;
7
7
  }
8
8
  }
9
- function c(o, e) {
10
- if (!e) return [];
11
- const t = o.getRootNode({ composed: !1 });
12
- if (t instanceof ShadowRoot || t instanceof Document) {
13
- const n = t.querySelectorAll(e);
14
- return Array.from(n);
15
- } else
9
+ function findElementsBy(element, selectors) {
10
+ if (!selectors) return [];
11
+ const rootNode = element.getRootNode({ composed: false });
12
+ if (rootNode instanceof ShadowRoot || rootNode instanceof Document) {
13
+ const nodeList = rootNode.querySelectorAll(selectors);
14
+ return Array.from(nodeList);
15
+ } else {
16
16
  return [];
17
+ }
17
18
  }
18
- export {
19
- c as findElementsBy,
20
- r as getParentElement
21
- };
19
+
20
+ export { findElementsBy, getParentElement };
@@ -0,0 +1,43 @@
1
+ /** localStorage 설정 옵션 */
2
+ export interface LocalStorageOptions {
3
+ type: 'localStorage';
4
+ }
5
+ /** 쿠키 스토리지 설정 옵션 */
6
+ export interface CookieOptions {
7
+ type: 'cookie';
8
+ path?: string;
9
+ domain?: string | null;
10
+ expires?: DOMHighResTimeStamp | null;
11
+ sameSite?: CookieSameSite;
12
+ partitioned?: boolean;
13
+ }
14
+ export type BrowserStorageOptions = (LocalStorageOptions | CookieOptions) & {
15
+ /** 키 앞에 붙일 접두사 (옵션) */
16
+ prefix?: string;
17
+ };
18
+ /**
19
+ * 웹 브라우저가 제공하는 저장소 유틸리티 클래스
20
+ */
21
+ export declare class BrowserStorage {
22
+ private readonly options;
23
+ constructor(options: BrowserStorageOptions);
24
+ /** 키에 prefix를 붙인 실제 저장 키 */
25
+ private buildKey;
26
+ /**
27
+ * 값 저장
28
+ * @param key 키
29
+ * @param value 문자열 값 (문자열이 아닌 값은 JSON.stringify 권장)
30
+ */
31
+ set(key: string, value: string): Promise<void>;
32
+ /**
33
+ * 값 조회
34
+ * @param key 키
35
+ * @returns 값 (없으면 null)
36
+ */
37
+ get(key: string): Promise<string | null>;
38
+ /**
39
+ * 값 삭제
40
+ * @param key 키
41
+ */
42
+ remove(key: string): Promise<void>;
43
+ }