@iyulab/modern-app 0.2.1 → 0.2.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.2 (2025-11-17)
4
+ - added `fallback` config in `AppConfig` type
5
+ - improved route-progress handling in layout component
6
+
3
7
  ## 0.2.1 (2025-11-13)
4
8
  - Fixed few component and sidebar styles
5
9
  - removed `theme` setter property in `app` instance
package/dist/app.d.ts CHANGED
@@ -7,8 +7,8 @@ import { NotificationOptions } from './types/AppOptions.js';
7
7
  declare class App {
8
8
  private static _instance;
9
9
  private _config?;
10
+ private _layout?;
10
11
  private _router?;
11
- private _root?;
12
12
  private constructor();
13
13
  /** 싱글톤 인스턴스 반환 */
14
14
  static get instance(): App;
@@ -18,18 +18,14 @@ declare class App {
18
18
  get router(): Router | undefined;
19
19
  /** 스타일 테마 관리 유틸리티 객체 반환 */
20
20
  get theme(): import('@iyulab/components/dist/utilities/theme.js').Theme;
21
- /** 현재 언어 코드 반환 (i18next.language) */
22
- get language(): string;
21
+ /** 다국어 로컬라이저(i18next) 반환 */
22
+ get localizer(): import('i18next').i18n;
23
23
  /** 앱 로드 및 초기화 */
24
24
  load(config: AppConfig): Promise<void>;
25
25
  /** 앱 언로드 */
26
26
  unload(): void;
27
27
  /** 페이지 이동 */
28
28
  navigate(path: string): void;
29
- /** 언어 설정 변경(i18next.changeLanguage 호출) */
30
- setLanguage(lang: string): Promise<void>;
31
- /** 레이아웃 진행바 설정 */
32
- progress(value: number): void;
33
29
  /** 공지 메시지 */
34
30
  notice(message: string, options?: NotificationOptions): Promise<void>;
35
31
  /** 정보 메시지 */
package/dist/app.js CHANGED
@@ -1,16 +1,16 @@
1
- import { runInAction as r } from "mobx";
1
+ import { runInAction as u } from "mobx";
2
2
  import n from "i18next";
3
3
  import { Router as l } from "@iyulab/router";
4
- import { notifier as c } from "@iyulab/components/dist/utilities/notifier.js";
5
- import { theme as u } from "@iyulab/components/dist/utilities/theme.js";
6
- import { screen as s, progress as d } from "./internals/observables.js";
4
+ import { theme as s } from "@iyulab/components/dist/utilities/theme.js";
5
+ import { notifier as d } from "@iyulab/components/dist/utilities/notifier.js";
6
+ import { screen as r } from "./internals/observables.js";
7
7
  class o {
8
8
  // private 생성자로 외부에서 인스턴스 생성 방지
9
9
  constructor() {
10
10
  this.handleWindowResize = (t) => {
11
11
  const e = window.innerWidth, [i, a] = this._config?.layout.breakpoints || [768, 1024];
12
- r(() => {
13
- e < i ? s.set("small") : e < a ? s.set("medium") : s.set("large");
12
+ u(() => {
13
+ e < i ? r.set("small") : e < a ? r.set("medium") : r.set("large");
14
14
  });
15
15
  };
16
16
  }
@@ -28,43 +28,34 @@ class o {
28
28
  }
29
29
  /** 스타일 테마 관리 유틸리티 객체 반환 */
30
30
  get theme() {
31
- return u;
31
+ return s;
32
32
  }
33
- /** 현재 언어 코드 반환 (i18next.language) */
34
- get language() {
35
- return n.language;
33
+ /** 다국어 로컬라이저(i18next) 반환 */
34
+ get localizer() {
35
+ return n;
36
36
  }
37
37
  /** 앱 로드 및 초기화 */
38
38
  async load(t) {
39
- if (this.unload(), this._config = t, await u.init(t.theme), t.localization) {
39
+ if (this.unload(), this._config = t, await s.init(t.theme), t.localization) {
40
40
  for (const e of t.localization.plugins || [])
41
41
  n.use(e);
42
42
  await n.init(t.localization);
43
43
  }
44
- window.addEventListener("resize", this.handleWindowResize), this.handleWindowResize(new Event("resize")), this._root = await this.createLayout(t.layout), this._router = new l({
45
- root: this._root,
44
+ window.addEventListener("resize", this.handleWindowResize), this.handleWindowResize(new Event("resize")), this._layout = await this.createLayout(t.layout), this._router = new l({
45
+ root: this._layout,
46
46
  basepath: t.basepath,
47
- routes: t.routes
48
- }), console.log("✅ App loaded successfully");
47
+ routes: t.routes,
48
+ fallback: t.fallback
49
+ });
49
50
  }
50
51
  /** 앱 언로드 */
51
52
  unload() {
52
- window.removeEventListener("resize", this.handleWindowResize), this._root && (this._root.remove(), this._root = void 0), this._router && (this._router.destroy(), this._router = void 0), this._config && (this._config = void 0);
53
+ window.removeEventListener("resize", this.handleWindowResize), this._layout && (this._layout.remove(), this._layout = void 0), this._router && (this._router.destroy(), this._router = void 0), this._config && (this._config = void 0);
53
54
  }
54
55
  /** 페이지 이동 */
55
56
  navigate(t) {
56
57
  this._router?.go(t);
57
58
  }
58
- /** 언어 설정 변경(i18next.changeLanguage 호출) */
59
- async setLanguage(t) {
60
- await n.changeLanguage(t);
61
- }
62
- /** 레이아웃 진행바 설정 */
63
- progress(t) {
64
- r(() => {
65
- d.set(t);
66
- });
67
- }
68
59
  /** 공지 메시지 */
69
60
  async notice(t, e) {
70
61
  await this.notify("notice", t, e);
@@ -97,7 +88,7 @@ class o {
97
88
  }
98
89
  /** 알림 표시 */
99
90
  async notify(t, e, i) {
100
- await c.toast({
91
+ await d.toast({
101
92
  type: t,
102
93
  content: e,
103
94
  label: i?.title,
@@ -106,7 +97,7 @@ class o {
106
97
  });
107
98
  }
108
99
  }
109
- const g = o.instance;
100
+ const p = o.instance;
110
101
  export {
111
- g as app
102
+ p as app
112
103
  };
@@ -3,15 +3,15 @@ import { property as e } from "lit/decorators.js";
3
3
  import { Icon as l } from "@iyulab/components/dist/components/Icon/Icon.js";
4
4
  import { ExtendedBaseElement as h } from "../internals/ExtendedBaseElement.js";
5
5
  import { styles as d } from "./SidebarLink.styles.js";
6
- var u = Object.defineProperty, n = (o, r, a, f) => {
6
+ var m = Object.defineProperty, n = (o, r, a, u) => {
7
7
  for (var t = void 0, s = o.length - 1, p; s >= 0; s--)
8
8
  (p = o[s]) && (t = p(r, a, t) || t);
9
- return t && u(r, a, t), t;
9
+ return t && m(r, a, t), t;
10
10
  };
11
11
  class i extends h {
12
12
  constructor() {
13
13
  super(...arguments), this.selected = !1, this.compact = !1, this.handleRouteBegin = (r) => {
14
- this.pattern ||= this.href, this.pattern ? (this.pattern = typeof this.pattern == "string" ? new URLPattern(this.pattern, window.location.origin) : this.pattern, this.selected = this.pattern.test(r.routeInfo.path, window.location.origin)) : this.selected = !1;
14
+ this.pattern ||= this.href, this.pattern ? (this.pattern = typeof this.pattern == "string" ? new URLPattern(this.pattern, window.location.origin) : this.pattern, this.selected = this.pattern.test(r.context.path, window.location.origin)) : this.selected = !1;
15
15
  };
16
16
  }
17
17
  static {
@@ -5,7 +5,3 @@ export type ScreenSize = 'small' | 'medium' | 'large';
5
5
  * 현재 화면 크기 상태
6
6
  */
7
7
  export declare const screen: IObservableValue<ScreenSize>;
8
- /**
9
- * 로딩 진행 상태 (0 - 100)
10
- */
11
- export declare const progress: IObservableValue<number>;
@@ -1,6 +1,5 @@
1
- import { observable as o } from "mobx";
2
- const e = o.box("large"), s = o.box(0);
1
+ import { observable as e } from "mobx";
2
+ const r = e.box("large");
3
3
  export {
4
- s as progress,
5
- e as screen
4
+ r as screen
6
5
  };
@@ -1,16 +1,18 @@
1
1
  import { nothing, PropertyValues } from 'lit';
2
2
  import { BaseElement } from '@iyulab/components/dist/components/BaseElement.js';
3
+ import { IconButton } from '@iyulab/components/dist/components/icon-button/IconButton.js';
4
+ import { ProgressBar } from '@iyulab/components/dist/components/progress-bar/ProgressBar.js';
3
5
  import { ExtendedBaseElement } from '../internals/ExtendedBaseElement';
4
- import { ProgressBar } from '../components/ProgressBar';
5
6
  import { SidebarLogo } from '../components/SidebarLogo';
6
7
  import { SidebarSection } from '../components/SidebarSection';
7
8
  import { SidebarGroup } from '../components/SidebarGroup';
8
9
  import { SidebarLink } from '../components/SidebarLink';
9
10
  import { SidebarButton } from '../components/SidebarButton';
10
11
  import { SidebarLayoutConfig, SidebarState, SidebarParts } from './SidebarLayout.types';
11
- /** 엘리먼트 타입 매핑 */
12
+ /** 엘리먼트 타입 매핑 (for deveveloper experience) */
12
13
  declare global {
13
14
  interface HTMLElementTagNameMap {
15
+ 'u-icon-button': IconButton;
14
16
  'u-progress-bar': ProgressBar;
15
17
  'u-sidebar-logo': SidebarLogo;
16
18
  'u-sidebar-section': SidebarSection;
@@ -35,7 +37,7 @@ export declare class SidebarLayout extends ExtendedBaseElement<SidebarParts> {
35
37
  static dependencies: Record<string, typeof BaseElement>;
36
38
  /** 반응형 상태 관리를 위한 MobX 반응 해제 함수들 */
37
39
  private disposers;
38
- progressEl?: ProgressBar;
40
+ progressBarEl: ProgressBar;
39
41
  /** 사이드바 상태 */
40
42
  state: SidebarState;
41
43
  /** 사이드바 레이아웃 설정 */
@@ -55,4 +57,10 @@ export declare class SidebarLayout extends ExtendedBaseElement<SidebarParts> {
55
57
  * 백드롭 클릭 or 라우트 변경 시
56
58
  */
57
59
  private toggleStateIfModalState;
60
+ /** 라우트 변경 시작 핸들러 */
61
+ private handleRouteBegin;
62
+ /** 라우트 변경 진행 핸들러 */
63
+ private handleRouteProgress;
64
+ /** 라우트 변경 완료 핸들러 */
65
+ private handleRouteDone;
58
66
  }
@@ -1,44 +1,47 @@
1
- import { nothing as p, html as i } from "lit";
2
- import { query as f, state as b, property as h, customElement as m } from "lit/decorators.js";
3
- import { repeat as l } from "lit/directives/repeat.js";
4
- import { autorun as g } from "mobx";
5
- import { IconButton as $ } from "@iyulab/components/dist/components/icon-button/IconButton.js";
6
- import { screen as u, progress as y } from "../internals/observables.js";
7
- import { ExtendedBaseElement as v } from "../internals/ExtendedBaseElement.js";
8
- import { ProgressBar as S } from "../components/ProgressBar.js";
1
+ import { nothing as u, html as i } from "lit";
2
+ import { query as h, state as g, property as b, customElement as f } from "lit/decorators.js";
3
+ import { unsafeHTML as m } from "lit/directives/unsafe-html.js";
4
+ import { repeat as n } from "lit/directives/repeat.js";
5
+ import { autorun as $ } from "mobx";
6
+ import { IconButton as v } from "@iyulab/components/dist/components/icon-button/IconButton.js";
7
+ import { ProgressBar as y } from "@iyulab/components/dist/components/progress-bar/ProgressBar.js";
8
+ import { screen as p } from "../internals/observables.js";
9
+ import { ExtendedBaseElement as S } from "../internals/ExtendedBaseElement.js";
9
10
  import { SidebarLogo as _ } from "../components/SidebarLogo.js";
10
- import { SidebarSection as k } from "../components/SidebarSection.js";
11
- import { SidebarGroup as w } from "../components/SidebarGroup.js";
12
- import { SidebarLink as I } from "../components/SidebarLink.js";
13
- import { SidebarButton as E } from "../components/SidebarButton.js";
14
- import { styles as C } from "./SidebarLayout.styles.js";
15
- import { unsafeHTML as O } from "lit/directives/unsafe-html.js";
16
- var M = Object.defineProperty, L = Object.getOwnPropertyDescriptor, P = Object.getPrototypeOf, B = Reflect.get, n = (e, t, s, a) => {
17
- for (var r = a > 1 ? void 0 : a ? L(t, s) : t, d = e.length - 1, c; d >= 0; d--)
11
+ import { SidebarSection as w } from "../components/SidebarSection.js";
12
+ import { SidebarGroup as k } from "../components/SidebarGroup.js";
13
+ import { SidebarLink as E } from "../components/SidebarLink.js";
14
+ import { SidebarButton as B } from "../components/SidebarButton.js";
15
+ import { styles as L } from "./SidebarLayout.styles.js";
16
+ var R = Object.defineProperty, I = Object.getOwnPropertyDescriptor, P = Object.getPrototypeOf, C = Reflect.get, l = (e, t, s, a) => {
17
+ for (var r = a > 1 ? void 0 : a ? I(t, s) : t, d = e.length - 1, c; d >= 0; d--)
18
18
  (c = e[d]) && (r = (a ? c(t, s, r) : c(r)) || r);
19
- return a && r && M(t, s, r), r;
20
- }, j = (e, t, s) => B(P(e), s, t);
21
- let o = class extends v {
19
+ return a && r && R(t, s, r), r;
20
+ }, O = (e, t, s) => C(P(e), s, t);
21
+ let o = class extends S {
22
22
  constructor() {
23
23
  super(...arguments), this.disposers = [], this.state = "docked", this.toggleState = () => {
24
- const e = u.get();
24
+ const e = p.get();
25
25
  e === "large" ? this.state = this.state === "docked" ? "slim" : "docked" : e === "medium" ? this.state = this.state === "slim" ? "modal" : "slim" : e === "small" ? this.state = this.state === "closed" ? "modal" : "closed" : console.warn("Unknown screen size:", e);
26
26
  }, this.toggleStateIfModalState = () => {
27
- const e = u.get();
27
+ const e = p.get();
28
28
  this.state === "modal" && (e === "medium" ? this.state = "slim" : e === "small" && (this.state = "closed"));
29
+ }, this.handleRouteBegin = (e) => {
30
+ this.progressBarEl.value = 0, this.toggleStateIfModalState();
31
+ }, this.handleRouteProgress = (e) => {
32
+ this.progressBarEl.value = e.progress;
33
+ }, this.handleRouteDone = (e) => {
34
+ this.progressBarEl.value = 100;
29
35
  };
30
36
  }
31
37
  connectedCallback() {
32
- super.connectedCallback(), this.disposers.push(g(() => {
33
- const e = u.get();
38
+ super.connectedCallback(), this.disposers.push($(() => {
39
+ const e = p.get();
34
40
  this.updateState(e);
35
- })), this.disposers.push(g(() => {
36
- const e = y.get();
37
- this.progressEl && (this.progressEl.value = e);
38
- })), window.addEventListener("route-begin", this.toggleStateIfModalState);
41
+ })), window.addEventListener("route-begin", this.handleRouteBegin), window.addEventListener("route-done", this.handleRouteDone), window.addEventListener("route-progress", this.handleRouteProgress);
39
42
  }
40
43
  disconnectedCallback() {
41
- this.disposers.forEach((e) => e()), window.removeEventListener("route-begin", this.toggleStateIfModalState), super.disconnectedCallback();
44
+ this.disposers.forEach((e) => e()), window.removeEventListener("route-begin", this.handleRouteBegin), window.removeEventListener("route-done", this.handleRouteDone), window.removeEventListener("route-progress", this.handleRouteProgress), super.disconnectedCallback();
42
45
  }
43
46
  updated(e) {
44
47
  super.updated(e), e.has("config") && (this.styles = this.config?.styles);
@@ -51,12 +54,12 @@ let o = class extends v {
51
54
  <div class="sidebar-header" part="sidebar-header">
52
55
  <u-sidebar-logo
53
56
  .compact="${this.state === "slim"}"
54
- .type=${this.config.logo.type}
55
- .image="${this.config.logo.image}"
56
- .icon="${this.config.logo.icon}"
57
- .label="${this.config.logo.label}"
58
- .styles="${this.config.logo.styles}"
59
- @click="${this.config.logo.onClick}"
57
+ .type=${this.config.logo?.type || "icon"}
58
+ .image="${this.config.logo?.image}"
59
+ .icon="${this.config.logo?.icon}"
60
+ .label="${this.config.logo?.label}"
61
+ .styles="${this.config.logo?.styles}"
62
+ @click="${this.config.logo?.onClick}"
60
63
  ></u-sidebar-logo>
61
64
  <u-icon-button class="sidebar-toggler" part="sidebar-toggler"
62
65
  name=${this.state === "closed" ? "chevron-right" : "layout-sidebar"}
@@ -66,7 +69,7 @@ let o = class extends v {
66
69
 
67
70
  <!-- Sidebar Navigation Menu -->
68
71
  <nav class="sidebar-menu" part="sidebar-menu">
69
- ${l(
72
+ ${n(
70
73
  this.config.menu ?? [],
71
74
  (e, t) => t,
72
75
  (e, t) => this.renderItem(e)
@@ -76,7 +79,7 @@ let o = class extends v {
76
79
  <!-- Sidebar Footer -->
77
80
  <div class="sidebar-footer" part="sidebar-footer"
78
81
  ?hidden="${!this.config.footer || this.config.footer.length === 0}">
79
- ${l(
82
+ ${n(
80
83
  this.config.footer ?? [],
81
84
  (e, t) => t,
82
85
  (e, t) => this.renderItem(e)
@@ -96,11 +99,11 @@ let o = class extends v {
96
99
  ?hidden="${this.state !== "modal"}"
97
100
  @click="${this.toggleStateIfModalState}"
98
101
  ></div>
99
- ` : p;
102
+ ` : u;
100
103
  }
101
104
  /** 사이드바 아이템 렌더링 */
102
105
  renderItem(e) {
103
- return e ? e.type === "content" ? this.state === "slim" ? p : O(e.content) : e.type === "button" ? i`
106
+ return e ? e.type === "content" ? this.state === "slim" ? u : m(e.content) : e.type === "button" ? i`
104
107
  <u-sidebar-button
105
108
  ?compact=${this.state === "slim"}
106
109
  .icon="${e.icon}"
@@ -115,7 +118,7 @@ let o = class extends v {
115
118
  .subTitle="${e.subTitle}"
116
119
  .items="${e.items}"
117
120
  .styles="${e.styles}">
118
- ${l(
121
+ ${n(
119
122
  e.items,
120
123
  (t, s) => s,
121
124
  (t, s) => this.renderItem(t)
@@ -129,7 +132,7 @@ let o = class extends v {
129
132
  .label="${e.label}"
130
133
  .items="${e.items}"
131
134
  .styles="${e.styles}">
132
- ${l(
135
+ ${n(
133
136
  e.items,
134
137
  (t, s) => s,
135
138
  (t, s) => this.renderItem(t)
@@ -144,34 +147,34 @@ let o = class extends v {
144
147
  .pattern="${e.pattern}"
145
148
  .styles="${e.styles}"
146
149
  ></u-sidebar-link>
147
- ` : p;
150
+ ` : u;
148
151
  }
149
152
  /** 화면 크기 변경에 따른 사이드바 상태 업데이트 */
150
153
  updateState(e) {
151
154
  e === "large" ? this.state = "docked" : e === "medium" ? this.state = "slim" : e === "small" ? this.state = "closed" : console.warn("Unknown screen size:", e);
152
155
  }
153
156
  };
154
- o.styles = [j(o, o, "styles"), C];
157
+ o.styles = [O(o, o, "styles"), L];
155
158
  o.dependencies = {
156
- "u-icon-button": $,
157
- "u-progress-bar": S,
159
+ "u-icon-button": v,
160
+ "u-progress-bar": y,
158
161
  "u-sidebar-logo": _,
159
- "u-sidebar-section": k,
160
- "u-sidebar-group": w,
161
- "u-sidebar-link": I,
162
- "u-sidebar-button": E
162
+ "u-sidebar-section": w,
163
+ "u-sidebar-group": k,
164
+ "u-sidebar-link": E,
165
+ "u-sidebar-button": B
163
166
  };
164
- n([
165
- f("u-progress-bar")
166
- ], o.prototype, "progressEl", 2);
167
- n([
168
- b()
167
+ l([
168
+ h("u-progress-bar")
169
+ ], o.prototype, "progressBarEl", 2);
170
+ l([
171
+ g()
169
172
  ], o.prototype, "state", 2);
170
- n([
171
- h({ type: Object })
173
+ l([
174
+ b({ type: Object })
172
175
  ], o.prototype, "config", 2);
173
- o = n([
174
- m("app-sidebar-layout")
176
+ o = l([
177
+ f("app-sidebar-layout")
175
178
  ], o);
176
179
  export {
177
180
  o as SidebarLayout
@@ -100,6 +100,25 @@ const r = o`
100
100
  border-top: 1px solid var(--u-border-color-weak);
101
101
  }
102
102
 
103
+ /* Main Content */
104
+ .main {
105
+ position: relative;
106
+ flex: 1;
107
+ display: block;
108
+ overflow: hidden;
109
+ background: var(--u-bg-color);
110
+ }
111
+
112
+ .main u-progress-bar {
113
+ position: absolute;
114
+ z-index: 100;
115
+ top: 0;
116
+ left: 0;
117
+ height: 4px;
118
+ border-radius: 0;
119
+ background-color: transparent;
120
+ }
121
+
103
122
  /* Backdrop for modal mode */
104
123
  .backdrop {
105
124
  content: '';
@@ -111,15 +130,6 @@ const r = o`
111
130
  bottom: 0;
112
131
  background: var(--u-overlay-bg-color);
113
132
  }
114
-
115
- /* Main Content */
116
- .main {
117
- position: relative;
118
- flex: 1;
119
- display: block;
120
- overflow: hidden;
121
- background: var(--u-bg-color);
122
- }
123
133
  `;
124
134
  export {
125
135
  r as styles
@@ -19,7 +19,7 @@ export type SidebarItem = (SidebarLinkConfig | SidebarSectionConfig | SidebarGro
19
19
  export interface SidebarLayoutConfig {
20
20
  type: 'sidebar';
21
21
  /** 최상단 앱 로고 */
22
- logo: SidebarLogoConfig;
22
+ logo?: SidebarLogoConfig;
23
23
  /** 상단/메인 메뉴 항목들 */
24
24
  menu?: SidebarItem[];
25
25
  /** 하단(footer)에 고정해서 렌더할 항목들 */
@@ -1,5 +1,5 @@
1
1
  import { InitOptions, Module, Newable, NewableModule } from 'i18next';
2
- import { RouteConfig } from '@iyulab/router';
2
+ import { RouteConfig, FallbackRouteConfig } from '@iyulab/router';
3
3
  import { ThemeInitOptions } from '@iyulab/components/dist/utilities/theme.js';
4
4
  import { SidebarLayoutConfig } from '../layouts/SidebarLayout.types';
5
5
  /**
@@ -8,7 +8,7 @@ import { SidebarLayoutConfig } from '../layouts/SidebarLayout.types';
8
8
  export type LocalizationInitOptions = InitOptions & {
9
9
  /**
10
10
  * i18next 플러그인 배열
11
- * @description i18next.use() 메서드에 전달될 플러그인들의 배열입니다.
11
+ * @description i18next.use() 메서드에 전달되는 플러그인들의 배열입니다.
12
12
  */
13
13
  plugins?: (Module | NewableModule<Module> | Newable<Module>)[];
14
14
  };
@@ -35,7 +35,11 @@ export interface AppConfig {
35
35
  /**
36
36
  * 클라이언트 사이드 라우팅을 위한 설정 배열
37
37
  */
38
- routes: RouteConfig[];
38
+ routes?: RouteConfig[];
39
+ /**
40
+ * 라우팅 실패 시 대체 컨텐츠 설정
41
+ */
42
+ fallback?: FallbackRouteConfig;
39
43
  /**
40
44
  * 애플리케이션의 스타일 테마 설정
41
45
  */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@iyulab/modern-app",
3
3
  "description": "web-framework by iyulab based on react, lit-element",
4
- "version": "0.2.1",
4
+ "version": "0.2.2",
5
5
  "keywords": [
6
6
  "iyulab",
7
7
  "web-framework",
@@ -38,8 +38,8 @@
38
38
  "build": "vite build"
39
39
  },
40
40
  "dependencies": {
41
- "@iyulab/components": "^0.1.2",
42
- "@iyulab/router": "^0.5.1",
41
+ "@iyulab/components": "^0.1.3",
42
+ "@iyulab/router": "^0.5.2",
43
43
  "lit": "^3.3.1",
44
44
  "mobx": "^6.15.0",
45
45
  "i18next": "^25.6.2"
@@ -1,22 +0,0 @@
1
- import { BaseElement } from '@iyulab/components/dist/components/BaseElement.js';
2
- /**
3
- * ProgressBar 컴포넌트는 진행 상태를 시각적으로 표시합니다.
4
- * 로딩 상태나 작업 진행률을 표시하는데 사용됩니다.
5
- */
6
- export declare class ProgressBar extends BaseElement {
7
- static styles: import('lit').CSSResultGroup[];
8
- static dependencies: Record<string, typeof BaseElement>;
9
- /** 불확정 상태 (로딩 애니메이션 표시) */
10
- indeterminate: boolean;
11
- /** 최소값 (기본값: 0) */
12
- minValue: number;
13
- /** 최대값 (기본값: 100) */
14
- maxValue: number;
15
- /** 현재값 */
16
- value: number;
17
- connectedCallback(): void;
18
- protected updated(changedProperties: Map<string, unknown>): void;
19
- render(): import('lit-html').TemplateResult<1>;
20
- /** 진행 상태 업데이트 */
21
- private updateProgress;
22
- }
@@ -1,54 +0,0 @@
1
- import { html as h } from "lit";
2
- import { property as i } from "lit/decorators.js";
3
- import { BaseElement as n } from "@iyulab/components/dist/components/BaseElement.js";
4
- import { styles as p } from "./ProgressBar.styles.js";
5
- var v = Object.defineProperty, a = (u, t, s, o) => {
6
- for (var e = void 0, l = u.length - 1, m; l >= 0; l--)
7
- (m = u[l]) && (e = m(t, s, e) || e);
8
- return e && v(t, s, e), e;
9
- };
10
- class r extends n {
11
- constructor() {
12
- super(...arguments), this.indeterminate = !1, this.minValue = 0, this.maxValue = 100, this.value = 0;
13
- }
14
- static {
15
- this.styles = [super.styles, p];
16
- }
17
- static {
18
- this.dependencies = {};
19
- }
20
- connectedCallback() {
21
- super.connectedCallback(), this.setAttribute("role", "progressbar");
22
- }
23
- updated(t) {
24
- super.updated(t), t.has("value") && (this.updateProgress(t.get("value"), this.value), this.setAttribute("aria-valuenow", this.value.toString())), t.has("minValue") && (this.updateProgress(this.value, this.value), this.setAttribute("aria-valuemax", this.maxValue.toString())), t.has("maxValue") && (this.updateProgress(this.value, this.value), this.setAttribute("aria-valuemin", this.minValue.toString())), t.has("indeterminate") && (this.updateProgress(this.value, this.value), this.indeterminate ? (this.removeAttribute("aria-valuenow"), this.setAttribute("aria-busy", "true")) : this.removeAttribute("aria-busy"));
25
- }
26
- render() {
27
- return h`<slot></slot>`;
28
- }
29
- /** 진행 상태 업데이트 */
30
- updateProgress(t, s) {
31
- if (this.indeterminate) return;
32
- const e = (Math.min(Math.max(s, this.minValue), this.maxValue) - this.minValue) / (this.maxValue - this.minValue);
33
- t < s ? (this.style.transform = `scaleX(${e})`, s >= this.maxValue && setTimeout(() => {
34
- this.style.opacity = "0";
35
- }, 300)) : (this.style.opacity = "0", this.style.transform = "scaleX(0)", setTimeout(() => {
36
- this.style.opacity = "1", this.style.transform = `scaleX(${e})`;
37
- }, 300));
38
- }
39
- }
40
- a([
41
- i({ type: Boolean, reflect: !0 })
42
- ], r.prototype, "indeterminate");
43
- a([
44
- i({ type: Number })
45
- ], r.prototype, "minValue");
46
- a([
47
- i({ type: Number })
48
- ], r.prototype, "maxValue");
49
- a([
50
- i({ type: Number })
51
- ], r.prototype, "value");
52
- export {
53
- r as ProgressBar
54
- };
@@ -1 +0,0 @@
1
- export declare const styles: import('lit').CSSResult;
@@ -1,31 +0,0 @@
1
- import { css as t } from "lit";
2
- const a = t`
3
- :host {
4
- display: block;
5
- position: absolute;
6
- z-index: 9999;
7
- top: 0;
8
- left: 0;
9
- right: 0;
10
- height: 4px;
11
- background-color: var(--u-blue-600);
12
- transform-origin: left;
13
- transition: all 0.3s ease-out;
14
- box-shadow: 0 2px 4px var(--u-shadow-weak);
15
- }
16
- :host([indeterminate]) {
17
- animation: indeterminate 1.5s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;
18
- }
19
-
20
- @keyframes indeterminate {
21
- 0% {
22
- transform: translateX(-100%);
23
- }
24
- 100% {
25
- transform: translateX(100%);
26
- }
27
- }
28
- `;
29
- export {
30
- a as styles
31
- };