@iyulab/modern-app 0.56.1 → 0.57.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 (54) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/dist/App.js +1 -2
  3. package/dist/_virtual/{_@oxc-project_runtime@0.154.0 → _@oxc-project_runtime@0.155.0}/helpers/esm/decorate.js +1 -2
  4. package/dist/_virtual/{_@oxc-project_runtime@0.154.0 → _@oxc-project_runtime@0.155.0}/helpers/esm/decorateMetadata.js +1 -2
  5. package/dist/components/ActionBar.js +3 -4
  6. package/dist/components/ActionBar.styles.js +1 -2
  7. package/dist/components/EmptyState.js +3 -4
  8. package/dist/components/EmptyState.styles.js +1 -2
  9. package/dist/components/GroupBox.js +3 -4
  10. package/dist/components/GroupBox.styles.js +1 -2
  11. package/dist/components/InfoField.d.ts +5 -0
  12. package/dist/components/InfoField.js +25 -19
  13. package/dist/components/InfoField.styles.js +20 -2
  14. package/dist/components/InfoSection.js +3 -4
  15. package/dist/components/InfoSection.styles.js +1 -2
  16. package/dist/components/MasterDetailLayout.js +3 -4
  17. package/dist/components/MasterDetailLayout.styles.js +1 -2
  18. package/dist/components/PageHeader.js +3 -4
  19. package/dist/components/PageHeader.styles.js +1 -2
  20. package/dist/components/SidebarButton.js +3 -4
  21. package/dist/components/SidebarButton.styles.js +1 -2
  22. package/dist/components/SidebarGroup.d.ts +9 -0
  23. package/dist/components/SidebarGroup.js +17 -14
  24. package/dist/components/SidebarGroup.styles.js +1 -2
  25. package/dist/components/SidebarLink.d.ts +6 -0
  26. package/dist/components/SidebarLink.js +16 -14
  27. package/dist/components/SidebarLink.styles.js +1 -2
  28. package/dist/components/SidebarSection.js +3 -4
  29. package/dist/components/SidebarSection.styles.js +1 -2
  30. package/dist/components/Timeline.js +2 -3
  31. package/dist/components/Timeline.styles.js +1 -2
  32. package/dist/components/TimelineItem.js +3 -4
  33. package/dist/components/TimelineItem.styles.js +1 -2
  34. package/dist/components/Wizard.js +3 -4
  35. package/dist/components/Wizard.styles.js +1 -2
  36. package/dist/defaultFallback.js +1 -2
  37. package/dist/index.d.ts +1 -1
  38. package/dist/index.js +1 -2
  39. package/dist/internals/ScreenObserver.js +1 -2
  40. package/dist/internals/StyledElement.js +3 -4
  41. package/dist/internals/locale.js +1 -2
  42. package/dist/internals/nav-icon.js +1 -2
  43. package/dist/internals/slotted.js +1 -2
  44. package/dist/layouts/SidebarLayout.d.ts +10 -0
  45. package/dist/layouts/SidebarLayout.js +27 -9
  46. package/dist/layouts/SidebarLayout.styles.js +31 -7
  47. package/dist/layouts/SidebarLayout.types.d.ts +16 -2
  48. package/dist/layouts/filterSidebarItems.js +1 -2
  49. package/dist/react.js +1 -2
  50. package/dist/translate.js +0 -1
  51. package/dist/unsaved.js +19 -9
  52. package/package.json +1 -1
  53. package/skills/modern-app/references/components/info-field.md +22 -0
  54. package/skills/modern-app/references/layout.md +5 -2
@@ -1,21 +1,24 @@
1
- import e from "../_virtual/_@oxc-project_runtime@0.154.0/helpers/esm/decorateMetadata.js";
2
- import t from "../_virtual/_@oxc-project_runtime@0.154.0/helpers/esm/decorate.js";
1
+ import e from "../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorateMetadata.js";
2
+ import t from "../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorate.js";
3
3
  import { StyledElement as n } from "../internals/StyledElement.js";
4
4
  import { getLocaleStrings as r } from "../internals/locale.js";
5
5
  import { DEFAULT_NAV_ICON as i } from "../internals/nav-icon.js";
6
6
  import { styles as a } from "./SidebarLink.styles.js";
7
7
  import "@iyulab/router";
8
8
  import { html as o, nothing as s } from "lit";
9
- import { customElement as c, property as l } from "lit/decorators.js";
9
+ import { customElement as c, property as l, state as u } from "lit/decorators.js";
10
10
  import "@iyulab/components/dist/components/icon/UIcon.js";
11
- //#region src/components/SidebarLink.ts
12
- var u = class extends n {
11
+ // src/components/SidebarLink.ts
12
+ var d = class extends n {
13
13
  constructor(...e) {
14
- super(...e), this.selected = !1, this.compact = !1;
14
+ super(...e), this.selected = !1, this.compact = !1, this.nested = !1;
15
15
  }
16
16
  static {
17
17
  this.styles = [super.styles, a];
18
18
  }
19
+ connectedCallback() {
20
+ super.connectedCallback(), this.nested = this.parentElement?.localName === "u-sidebar-group";
21
+ }
19
22
  render() {
20
23
  return o`
21
24
  <u-link
@@ -25,11 +28,11 @@ var u = class extends n {
25
28
  aria-current=${this.selected ? "page" : s}
26
29
  >
27
30
  <div class="container" part="base" ?compact=${this.compact}>
28
- <u-icon part="icon"
29
- .lib=${this.lib}
30
- .name=${this.icon}
31
- .fallback=${i}
32
- ></u-icon>
31
+ ${this.icon || !this.nested ? o`<u-icon part="icon"
32
+ .lib=${this.lib}
33
+ .name=${this.icon}
34
+ .fallback=${i}
35
+ ></u-icon>` : s}
33
36
  <span part="label" ?compact=${this.compact}>
34
37
  ${this.label}
35
38
  </span>
@@ -43,6 +46,5 @@ var u = class extends n {
43
46
  t([l({
44
47
  type: Boolean,
45
48
  reflect: !0
46
- }), e("design:type", Object)], u.prototype, "selected", void 0), t([l({ type: Boolean }), e("design:type", Object)], u.prototype, "compact", void 0), t([l({ type: String }), e("design:type", String)], u.prototype, "icon", void 0), t([l({ type: String }), e("design:type", String)], u.prototype, "lib", void 0), t([l({ type: String }), e("design:type", Object)], u.prototype, "label", void 0), t([l({ type: String }), e("design:type", String)], u.prototype, "href", void 0), t([l({ type: String }), e("design:type", Object)], u.prototype, "pattern", void 0), t([l({ type: String }), e("design:type", String)], u.prototype, "navigate", void 0), t([l({ type: String }), e("design:type", String)], u.prototype, "target", void 0), t([l(), e("design:type", Object)], u.prototype, "count", void 0), u = t([c("u-sidebar-link")], u);
47
- //#endregion
48
- export { u as SidebarLink };
49
+ }), e("design:type", Object)], d.prototype, "selected", void 0), t([l({ type: Boolean }), e("design:type", Object)], d.prototype, "compact", void 0), t([l({ type: String }), e("design:type", String)], d.prototype, "icon", void 0), t([l({ type: String }), e("design:type", String)], d.prototype, "lib", void 0), t([l({ type: String }), e("design:type", Object)], d.prototype, "label", void 0), t([l({ type: String }), e("design:type", String)], d.prototype, "href", void 0), t([l({ type: String }), e("design:type", Object)], d.prototype, "pattern", void 0), t([l({ type: String }), e("design:type", String)], d.prototype, "navigate", void 0), t([l({ type: String }), e("design:type", String)], d.prototype, "target", void 0), t([l(), e("design:type", Object)], d.prototype, "count", void 0), t([u(), e("design:type", Object)], d.prototype, "nested", void 0), d = t([c("u-sidebar-link")], d);
50
+ export { d as SidebarLink };
@@ -1,5 +1,5 @@
1
1
  import { css as e } from "lit";
2
- //#region src/components/SidebarLink.styles.ts
2
+ // src/components/SidebarLink.styles.ts
3
3
  var t = e`
4
4
  :host {
5
5
 
@@ -124,5 +124,4 @@ var t = e`
124
124
  white-space: nowrap;
125
125
  }
126
126
  `;
127
- //#endregion
128
127
  export { t as styles };
@@ -1,10 +1,10 @@
1
- import e from "../_virtual/_@oxc-project_runtime@0.154.0/helpers/esm/decorateMetadata.js";
2
- import t from "../_virtual/_@oxc-project_runtime@0.154.0/helpers/esm/decorate.js";
1
+ import e from "../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorateMetadata.js";
2
+ import t from "../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorate.js";
3
3
  import { StyledElement as n } from "../internals/StyledElement.js";
4
4
  import { styles as r } from "./SidebarSection.styles.js";
5
5
  import { html as i } from "lit";
6
6
  import { customElement as a, property as o } from "lit/decorators.js";
7
- //#region src/components/SidebarSection.ts
7
+ // src/components/SidebarSection.ts
8
8
  var s = class extends n {
9
9
  constructor(...e) {
10
10
  super(...e), this.compact = !1;
@@ -30,5 +30,4 @@ var s = class extends n {
30
30
  }
31
31
  };
32
32
  t([o({ type: Boolean }), e("design:type", Object)], s.prototype, "compact", void 0), t([o({ type: String }), e("design:type", Object)], s.prototype, "mainTitle", void 0), t([o({ type: String }), e("design:type", Object)], s.prototype, "subTitle", void 0), s = t([a("u-sidebar-section")], s);
33
- //#endregion
34
33
  export { s as SidebarSection };
@@ -1,5 +1,5 @@
1
1
  import { css as e } from "lit";
2
- //#region src/components/SidebarSection.styles.ts
2
+ // src/components/SidebarSection.styles.ts
3
3
  var t = e`
4
4
  :host {
5
5
  display: flex;
@@ -45,5 +45,4 @@ var t = e`
45
45
  flex-direction: column;
46
46
  }
47
47
  `;
48
- //#endregion
49
48
  export { t as styles };
@@ -1,10 +1,10 @@
1
- import e from "../_virtual/_@oxc-project_runtime@0.154.0/helpers/esm/decorate.js";
1
+ import e from "../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorate.js";
2
2
  import { StyledElement as t } from "../internals/StyledElement.js";
3
3
  import "./TimelineItem.js";
4
4
  import { styles as n } from "./Timeline.styles.js";
5
5
  import { html as r } from "lit";
6
6
  import { customElement as i } from "lit/decorators.js";
7
- //#region src/components/Timeline.ts
7
+ // src/components/Timeline.ts
8
8
  var a = class extends t {
9
9
  static {
10
10
  this.styles = [super.styles, n];
@@ -17,5 +17,4 @@ var a = class extends t {
17
17
  }
18
18
  };
19
19
  a = e([i("u-timeline")], a);
20
- //#endregion
21
20
  export { a as Timeline };
@@ -1,5 +1,5 @@
1
1
  import { css as e } from "lit";
2
- //#region src/components/Timeline.styles.ts
2
+ // src/components/Timeline.styles.ts
3
3
  var t = e`
4
4
  :host {
5
5
  display: block;
@@ -10,5 +10,4 @@ var t = e`
10
10
  flex-direction: column;
11
11
  }
12
12
  `;
13
- //#endregion
14
13
  export { t as styles };
@@ -1,5 +1,5 @@
1
- import e from "../_virtual/_@oxc-project_runtime@0.154.0/helpers/esm/decorateMetadata.js";
2
- import t from "../_virtual/_@oxc-project_runtime@0.154.0/helpers/esm/decorate.js";
1
+ import e from "../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorateMetadata.js";
2
+ import t from "../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorate.js";
3
3
  import { StyledElement as n } from "../internals/StyledElement.js";
4
4
  import { slotHasContent as r } from "../internals/slotted.js";
5
5
  import { styles as i } from "./TimelineItem.styles.js";
@@ -7,7 +7,7 @@ import { html as a, nothing as o } from "lit";
7
7
  import { customElement as s, property as c, state as l } from "lit/decorators.js";
8
8
  import { formatDate as u } from "@iyulab/components/dist/utilities/format.js";
9
9
  import "@iyulab/components/dist/components/icon/UIcon.js";
10
- //#region src/components/TimelineItem.ts
10
+ // src/components/TimelineItem.ts
11
11
  var d = class extends n {
12
12
  constructor(...e) {
13
13
  super(...e), this.heading = "", this.datetime = "", this.color = "neutral", this.hasBody = !1;
@@ -52,5 +52,4 @@ t([c({ type: String }), e("design:type", Object)], d.prototype, "heading", void
52
52
  type: String,
53
53
  reflect: !0
54
54
  }), e("design:type", Object)], d.prototype, "color", void 0), t([c({ type: String }), e("design:type", String)], d.prototype, "icon", void 0), t([c({ type: String }), e("design:type", String)], d.prototype, "lib", void 0), t([l(), e("design:type", Object)], d.prototype, "hasBody", void 0), d = t([s("u-timeline-item")], d);
55
- //#endregion
56
55
  export { d as TimelineItem };
@@ -1,5 +1,5 @@
1
1
  import { css as e } from "lit";
2
- //#region src/components/TimelineItem.styles.ts
2
+ // src/components/TimelineItem.styles.ts
3
3
  var t = e`
4
4
  :host {
5
5
  display: grid;
@@ -118,5 +118,4 @@ var t = e`
118
118
  display: none;
119
119
  }
120
120
  `;
121
- //#endregion
122
121
  export { t as styles };
@@ -1,12 +1,12 @@
1
- import e from "../_virtual/_@oxc-project_runtime@0.154.0/helpers/esm/decorateMetadata.js";
2
- import t from "../_virtual/_@oxc-project_runtime@0.154.0/helpers/esm/decorate.js";
1
+ import e from "../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorateMetadata.js";
2
+ import t from "../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorate.js";
3
3
  import { StyledElement as n } from "../internals/StyledElement.js";
4
4
  import { getLocaleStrings as r } from "../internals/locale.js";
5
5
  import { styles as i } from "./Wizard.styles.js";
6
6
  import { html as a, nothing as o } from "lit";
7
7
  import { customElement as s, property as c, state as l } from "lit/decorators.js";
8
8
  import "@iyulab/components/dist/components/button/UButton.js";
9
- //#region src/components/Wizard.ts
9
+ // src/components/Wizard.ts
10
10
  var u = class extends n {
11
11
  constructor(...e) {
12
12
  super(...e), this.steps = [], this.active = 0, this.orientation = "vertical", this.linear = !0, this.locale = "", this.announcement = "", this.handleTabKeydown = (e, t) => {
@@ -118,5 +118,4 @@ t([c({
118
118
  type: Boolean,
119
119
  reflect: !0
120
120
  }), e("design:type", Object)], u.prototype, "linear", void 0), t([c({ type: String }), e("design:type", Object)], u.prototype, "locale", void 0), t([l(), e("design:type", Object)], u.prototype, "announcement", void 0), u = t([s("u-wizard")], u);
121
- //#endregion
122
121
  export { u as Wizard };
@@ -1,5 +1,5 @@
1
1
  import { css as e } from "lit";
2
- //#region src/components/Wizard.styles.ts
2
+ // src/components/Wizard.styles.ts
3
3
  var t = e`
4
4
  :host {
5
5
  display: flex;
@@ -115,5 +115,4 @@ var t = e`
115
115
  border: 0;
116
116
  }
117
117
  `;
118
- //#endregion
119
118
  export { t as styles };
@@ -1,6 +1,6 @@
1
1
  import { getLocaleStrings as e } from "./internals/locale.js";
2
2
  import { EmptyState as t } from "./components/EmptyState.js";
3
- //#region src/defaultFallback.ts
3
+ // src/defaultFallback.ts
4
4
  function n(e) {
5
5
  switch (String(e.code)) {
6
6
  case "403": return "no-access";
@@ -23,5 +23,4 @@ var i = {
23
23
  return i.variant = n(e.error), i.variant === "error" && (i.title = r(e), i.description = e.error.message), i;
24
24
  }
25
25
  };
26
- //#endregion
27
26
  export { i as defaultFallback, n as variantOf };
package/dist/index.d.ts CHANGED
@@ -6,7 +6,7 @@ export type { SidebarPermissionGuard } from './layouts/SidebarPermission';
6
6
  export type { RouteConfig, RouteContext, FallbackRouteConfig, RouteLeaveContext } from '@iyulab/router';
7
7
  export { RouteError, NotFoundError, AccessDeniedError, ContentLoadError, ContentRenderError, OutletMissingError, } from '@iyulab/router';
8
8
  export { defaultFallback } from './defaultFallback.js';
9
- export type { SidebarIconsConfig, SidebarLayoutConfig, SidebarItem, SidebarLogoConfig, SidebarLinkConfig, SidebarSectionConfig, SidebarGroupConfig, SidebarButtonConfig, SidebarMenuConfig, SidebarMenuItemConfig, SidebarHtmlConfig, SidebarState, } from './layouts/SidebarLayout.types';
9
+ export type { SidebarIconsConfig, SidebarLayoutConfig, SidebarItem, SidebarLogoConfig, SidebarLogoIcon, SidebarLinkConfig, SidebarSectionConfig, SidebarGroupConfig, SidebarButtonConfig, SidebarMenuConfig, SidebarMenuItemConfig, SidebarHtmlConfig, SidebarState, } from './layouts/SidebarLayout.types';
10
10
  export type { SidebarAvatar } from './components/SidebarButton.js';
11
11
  export type { SidebarLayoutEventMap } from './layouts/SidebarLayout.js';
12
12
  export { filterSidebarItems } from './layouts/filterSidebarItems.js';
package/dist/index.js CHANGED
@@ -16,7 +16,6 @@ import { MasterDetailLayout as x } from "./components/MasterDetailLayout.js";
16
16
  import { Wizard as S } from "./components/Wizard.js";
17
17
  import { translate as C } from "./translate.js";
18
18
  import { AccessDeniedError as w, ContentLoadError as T, ContentRenderError as E, NotFoundError as D, OutletMissingError as O, RouteError as k } from "@iyulab/router";
19
- //#region src/index.ts
19
+ // src/index.ts
20
20
  var A = d;
21
- //#endregion
22
21
  export { w as AccessDeniedError, b as ActionBar, T as ContentLoadError, E as ContentRenderError, i as EmptyState, m as GroupBox, g as InfoField, h as InfoSection, x as MasterDetailLayout, D as NotFoundError, O as OutletMissingError, p as PageHeader, k as RouteError, e as ScreenObserver, y as Timeline, v as TimelineItem, o as UnsavedChangesController, S as Wizard, d as app, s as confirmDiscardChanges, A as default, a as defaultFallback, f as filterSidebarItems, t as getDefaultLocale, n as getLocaleStrings, c as hasUnsavedChanges, _ as isBlank, r as modernAppLocale, l as trackUnsavedChanges, C as translate, u as unsavedChangesGuard };
@@ -1,4 +1,4 @@
1
- //#region src/internals/ScreenObserver.ts
1
+ // src/internals/ScreenObserver.ts
2
2
  var e = class {
3
3
  constructor(e) {
4
4
  this._breakpoints = e.breakpoints, this._observer = new ResizeObserver((e) => {
@@ -19,5 +19,4 @@ var e = class {
19
19
  return e < t ? "small" : e < n ? "medium" : "large";
20
20
  }
21
21
  };
22
- //#endregion
23
22
  export { e as ScreenObserver };
@@ -1,8 +1,8 @@
1
- import e from "../_virtual/_@oxc-project_runtime@0.154.0/helpers/esm/decorateMetadata.js";
2
- import t from "../_virtual/_@oxc-project_runtime@0.154.0/helpers/esm/decorate.js";
1
+ import e from "../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorateMetadata.js";
2
+ import t from "../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorate.js";
3
3
  import { property as n } from "lit/decorators.js";
4
4
  import { UElement as r } from "@iyulab/components/dist/components/UElement.js";
5
- //#region src/internals/StyledElement.ts
5
+ // src/internals/StyledElement.ts
6
6
  var i = class extends r {
7
7
  static {
8
8
  this.styles = super.styles;
@@ -39,5 +39,4 @@ t([n({
39
39
  type: Object,
40
40
  attribute: !1
41
41
  }), e("design:type", Object)], i.prototype, "styles", void 0);
42
- //#endregion
43
42
  export { i as StyledElement };
@@ -1,5 +1,5 @@
1
1
  import { Locale as e } from "@iyulab/components/dist/utilities/Locale.js";
2
- //#region src/internals/locale.ts
2
+ // src/internals/locale.ts
3
3
  var t = {
4
4
  back: "Back",
5
5
  noDataTitle: "Nothing here yet",
@@ -98,5 +98,4 @@ function a() {
98
98
  wizardStepAnnouncement: (e, t, n) => `Step ${e} of ${t}: ${n}`
99
99
  };
100
100
  }
101
- //#endregion
102
101
  export { a as getDefaultLocale, i as getLocaleStrings, n as modernAppLocale };
@@ -1,4 +1,3 @@
1
- //#region src/internals/nav-icon.ts
1
+ // src/internals/nav-icon.ts
2
2
  var e = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><path d=\"M8.186 1.113a.5.5 0 0 0-.372 0L1.846 3.5 8 5.961 14.154 3.5zM15 4.239l-6.5 2.6v7.922l6.5-2.6V4.24zM7.5 14.762V6.838L1 4.239v7.923zM7.443.184a1.5 1.5 0 0 1 1.114 0l7.129 2.852A.5.5 0 0 1 16 3.5v8.662a1 1 0 0 1-.629.928l-7.185 2.874a.5.5 0 0 1-.372 0L.63 13.09a1 1 0 0 1-.63-.928V3.5a.5.5 0 0 1 .314-.464z\"/></svg>";
3
- //#endregion
4
3
  export { e as DEFAULT_NAV_ICON };
@@ -1,6 +1,5 @@
1
- //#region src/internals/slotted.ts
1
+ // src/internals/slotted.ts
2
2
  function e(e) {
3
3
  return e ? e.assignedNodes({ flatten: !0 }).some((e) => e.nodeType !== Node.TEXT_NODE || (e.textContent ?? "").trim() !== "") : !1;
4
4
  }
5
- //#endregion
6
5
  export { e as slotHasContent };
@@ -40,6 +40,15 @@ export declare class SidebarLayout extends StyledElement<SidebarParts> {
40
40
  */
41
41
  private mainTabStop;
42
42
  private mainSizeObserver?;
43
+ /**
44
+ * 모바일 머리 줄(`.mobile-header`)의 실제 높이 — 모바일 패널이 그 아래에서 시작한다(`--_mobile-header-block-size`).
45
+ * 종전에는 패널이 맨 위(0)에서 시작하고 패널 안의 자기 머리 줄이 모바일 머리 줄 밑에 깔려 높이를 채웠다. 두 머리 줄의
46
+ * 높이가 같다는 우연에 기댄 배치라 한쪽만 바뀌어도 내용이 머리 줄 밑으로 들어갔고, 깔린 머리 줄의 버튼은 보이지 않는데
47
+ * Tab 으로 포커스가 갔다. 그리고 패널이 덮인 자리까지 «자기 상자» 로 가져 위치 계산이 머리 줄 밑을 빈 자리로 봤다.
48
+ * 높이는 밀도 토큰에 따라 달라 재서 쓴다.
49
+ */
50
+ private mobileHeaderBlockSize;
51
+ private mobileHeaderObserver?;
43
52
  /**
44
53
  * 오버레이를 연 컨트롤 — 닫힐 때 포커스를 되돌릴 곳.
45
54
  * ★슬롯 배정 «시점» 에 잡는다. 렌더가 본문에 `inert` 를 걸면 그 컨트롤이 쥐던 포커스는
@@ -149,6 +158,7 @@ export declare class SidebarLayout extends StyledElement<SidebarParts> {
149
158
  * ⚠`.main-content` 는 `display: contents` 라 상자가 없다 — 관찰 대상은 슬롯에 배정된 요소들이고, 배정이 바뀔 때마다 다시 건다.
150
159
  */
151
160
  private observeMainSize;
161
+ private observeMobileHeader;
152
162
  private observedContent;
153
163
  private observeContentSize;
154
164
  private handleMainSlotChange;
@@ -1,5 +1,5 @@
1
- import e from "../_virtual/_@oxc-project_runtime@0.154.0/helpers/esm/decorateMetadata.js";
2
- import t from "../_virtual/_@oxc-project_runtime@0.154.0/helpers/esm/decorate.js";
1
+ import e from "../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorateMetadata.js";
2
+ import t from "../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorate.js";
3
3
  import { StyledElement as n } from "../internals/StyledElement.js";
4
4
  import { slotHasContent as r } from "../internals/slotted.js";
5
5
  import { getLocaleStrings as i } from "../internals/locale.js";
@@ -25,7 +25,7 @@ import { createDevWarner as v } from "@iyulab/components/dist/utilities/devWarni
25
25
  import { isFocusCandidate as y, querySelectorDeep as b } from "@iyulab/components/dist/utilities/elements.js";
26
26
  import { OverlayManager as x } from "@iyulab/components/dist/utilities/OverlayManager.js";
27
27
  import "@iyulab/components/dist/components/progress-bar/UProgressBar.js";
28
- //#region src/layouts/SidebarLayout.ts
28
+ // src/layouts/SidebarLayout.ts
29
29
  var S, C = v("@iyulab/modern-app"), w = 0;
30
30
  function T(e) {
31
31
  let t = e.tagName;
@@ -79,7 +79,7 @@ var M = class extends n {
79
79
  S = this;
80
80
  }
81
81
  constructor(...e) {
82
- super(...e), this.state = "default", this.counts = {}, this.locale = "", this.hasOverlay = !1, this.openMenu = null, this.menuIds = /* @__PURE__ */ new WeakMap(), this.hasNotice = !1, this.routeLoading = !1, this.mainTabStop = !1, this.overlayTrigger = null, this.internals = typeof this.attachInternals == "function" ? this.attachInternals() : void 0, this.currentPath = null, this.unsizedWarnKey = `unsized:${++w}`, this.isMatchedLink = (e) => this.currentPath === null || !e ? !1 : (e = typeof e == "string" ? new URLPattern(e, window.location.origin) : e, e.test(this.currentPath, window.location.origin)), this.handleToggleButtonClick = () => {
82
+ super(...e), this.state = "default", this.counts = {}, this.locale = "", this.hasOverlay = !1, this.openMenu = null, this.menuIds = /* @__PURE__ */ new WeakMap(), this.hasNotice = !1, this.routeLoading = !1, this.mainTabStop = !1, this.mobileHeaderBlockSize = 0, this.overlayTrigger = null, this.internals = typeof this.attachInternals == "function" ? this.attachInternals() : void 0, this.currentPath = null, this.unsizedWarnKey = `unsized:${++w}`, this.isMatchedLink = (e) => this.currentPath === null || !e ? !1 : (e = typeof e == "string" ? new URLPattern(e, window.location.origin) : e, e.test(this.currentPath, window.location.origin)), this.handleToggleButtonClick = () => {
83
83
  let e = this.screenSize ?? a.screen ?? "large";
84
84
  e === "large" ? this.state = this.state === "default" ? "slim" : "default" : e === "medium" ? this.state = this.state === "slim" ? "modal" : "slim" : e === "small" ? this.state = this.state === "mobile" ? "mobile-open" : "mobile" : console.warn("[@iyulab/modern-app] unknown screen size:", e);
85
85
  }, this.handleBackdropClick = () => {
@@ -171,13 +171,13 @@ var M = class extends n {
171
171
  super.connectedCallback(), this.currentPath = l(), window.addEventListener("route-begin", this.handleRouteBegin), window.addEventListener("route-done", this.handleRouteDone), window.addEventListener("route-progress", this.handleRouteProgress), window.addEventListener("route-error", this.handleRouteError), window.addEventListener("screen-resize", this.handleScreenResize);
172
172
  }
173
173
  disconnectedCallback() {
174
- window.removeEventListener("route-begin", this.handleRouteBegin), window.removeEventListener("route-done", this.handleRouteDone), window.removeEventListener("route-progress", this.handleRouteProgress), window.removeEventListener("route-error", this.handleRouteError), window.removeEventListener("screen-resize", this.handleScreenResize), x.closeLayer(this), this.mainSizeObserver?.disconnect(), this.mainSizeObserver = void 0, super.disconnectedCallback();
174
+ window.removeEventListener("route-begin", this.handleRouteBegin), window.removeEventListener("route-done", this.handleRouteDone), window.removeEventListener("route-progress", this.handleRouteProgress), window.removeEventListener("route-error", this.handleRouteError), window.removeEventListener("screen-resize", this.handleScreenResize), x.closeLayer(this), this.mainSizeObserver?.disconnect(), this.mainSizeObserver = void 0, this.mobileHeaderObserver?.disconnect(), this.mobileHeaderObserver = void 0, super.disconnectedCallback();
175
175
  }
176
176
  willUpdate(e) {
177
177
  super.willUpdate(e), e.has("config") && (this.styles = this.config?.styles);
178
178
  }
179
179
  updated(e) {
180
- super.updated(e), this.observeMainSize(), e.has("hasOverlay") && (this.internals?.states?.[this.hasOverlay ? "add" : "delete"]("overlay"), this.hasOverlay ? (x.openLayer(this, this.handleOverlayEscape), this.focusOverlay()) : e.get("hasOverlay") === !0 && (x.closeLayer(this), this.restoreOverlayFocus()));
180
+ super.updated(e), this.observeMainSize(), this.observeMobileHeader(), e.has("hasOverlay") && (this.internals?.states?.[this.hasOverlay ? "add" : "delete"]("overlay"), this.hasOverlay ? (x.openLayer(this, this.handleOverlayEscape), this.focusOverlay()) : e.get("hasOverlay") === !0 && (x.closeLayer(this), this.restoreOverlayFocus()));
181
181
  }
182
182
  firstUpdated(e) {
183
183
  super.firstUpdated(e), this.warnIfUnsized();
@@ -213,12 +213,14 @@ var M = class extends n {
213
213
  </div>
214
214
 
215
215
  <!-- Sidebar -->
216
- <aside class="sidebar" part="sidebar" state="${this.state}">
216
+ <aside class="sidebar" part="sidebar" state="${this.state}"
217
+ style="--_mobile-header-block-size: ${this.mobileHeaderBlockSize}px">
217
218
  <!-- Sidebar Header -->
218
219
  <div class="sidebar-header" part="sidebar-header">
219
220
  ${this.renderLogo()}
220
221
  <span class="title" ?hidden=${this.state === "slim"}>
221
222
  ${this.config.title}
223
+ ${this.config.subtitle ? u`<span class="subtitle" part="subtitle">${this.config.subtitle}</span>` : d}
222
224
  </span>
223
225
  <u-button class="toggler" appearance="plain"
224
226
  aria-label=${i(this.locale || void 0).toggleSidebar}
@@ -405,6 +407,15 @@ var M = class extends n {
405
407
  ></u-icon>
406
408
  </u-link>
407
409
  ` : d;
410
+ if (typeof e == "object" && "icon" in e) return u`
411
+ <u-link class="logo-link" aria-label=${t}>
412
+ <u-icon class="logo"
413
+ .lib=${e.lib}
414
+ .name="${e.icon}"
415
+ .fallback=${s}
416
+ ></u-icon>
417
+ </u-link>
418
+ `;
408
419
  if (typeof e == "function") {
409
420
  let n = e(this.state);
410
421
  return u`
@@ -430,6 +441,14 @@ var M = class extends n {
430
441
  let e = this.shadowRoot?.querySelector(".main");
431
442
  e && (this.mainSizeObserver = new ResizeObserver(() => this.syncMainTabStop()), this.mainSizeObserver.observe(e), this.observeContentSize());
432
443
  }
444
+ observeMobileHeader() {
445
+ if (this.mobileHeaderObserver || typeof ResizeObserver > "u") return;
446
+ let e = this.shadowRoot?.querySelector(".mobile-header");
447
+ e && (this.mobileHeaderObserver = new ResizeObserver(([t]) => {
448
+ let n = t?.borderBoxSize?.[0]?.blockSize ?? e.getBoundingClientRect().height;
449
+ n !== this.mobileHeaderBlockSize && (this.mobileHeaderBlockSize = n);
450
+ }), this.mobileHeaderObserver.observe(e));
451
+ }
433
452
  observeContentSize() {
434
453
  let e = this.mainSizeObserver;
435
454
  if (e) {
@@ -475,6 +494,5 @@ var M = class extends n {
475
494
  t([p({
476
495
  type: String,
477
496
  reflect: !0
478
- }), e("design:type", Object)], M.prototype, "state", void 0), t([p({ type: Object }), e("design:type", Object)], M.prototype, "config", void 0), t([p({ type: Object }), e("design:type", typeof Record > "u" ? Object : Record)], M.prototype, "counts", void 0), t([p({ type: String }), e("design:type", Object)], M.prototype, "locale", void 0), t([m("u-progress-bar"), e("design:type", Object)], M.prototype, "progressBarEl", void 0), t([h(), e("design:type", Object)], M.prototype, "hasOverlay", void 0), t([h(), e("design:type", Object)], M.prototype, "openMenu", void 0), t([h(), e("design:type", Object)], M.prototype, "hasNotice", void 0), t([h(), e("design:type", Object)], M.prototype, "routeLoading", void 0), t([h(), e("design:type", Object)], M.prototype, "mainTabStop", void 0), t([h(), e("design:type", Object)], M.prototype, "currentPath", void 0), M = S = t([f("u-sidebar-layout")], M);
479
- //#endregion
497
+ }), e("design:type", Object)], M.prototype, "state", void 0), t([p({ type: Object }), e("design:type", Object)], M.prototype, "config", void 0), t([p({ type: Object }), e("design:type", typeof Record > "u" ? Object : Record)], M.prototype, "counts", void 0), t([p({ type: String }), e("design:type", Object)], M.prototype, "locale", void 0), t([m("u-progress-bar"), e("design:type", Object)], M.prototype, "progressBarEl", void 0), t([h(), e("design:type", Object)], M.prototype, "hasOverlay", void 0), t([h(), e("design:type", Object)], M.prototype, "openMenu", void 0), t([h(), e("design:type", Object)], M.prototype, "hasNotice", void 0), t([h(), e("design:type", Object)], M.prototype, "routeLoading", void 0), t([h(), e("design:type", Object)], M.prototype, "mainTabStop", void 0), t([h(), e("design:type", Object)], M.prototype, "mobileHeaderBlockSize", void 0), t([h(), e("design:type", Object)], M.prototype, "currentPath", void 0), M = S = t([f("u-sidebar-layout")], M);
480
498
  export { M as SidebarLayout };
@@ -1,5 +1,5 @@
1
1
  import { css as e } from "lit";
2
- //#region src/layouts/SidebarLayout.styles.ts
2
+ // src/layouts/SidebarLayout.styles.ts
3
3
  var t = e`
4
4
  :host {
5
5
  position: relative;
@@ -62,6 +62,17 @@ var t = e`
62
62
  overflow: hidden;
63
63
  text-overflow: ellipsis;
64
64
  }
65
+
66
+ .title .subtitle {
67
+ display: block;
68
+ overflow: hidden;
69
+ text-overflow: ellipsis;
70
+ color: var(--u-txt-color-weak, #616161);
71
+ font-size: var(--u-text-caption-size, 12px);
72
+ line-height: var(--u-text-caption-leading, 1.5);
73
+ font-weight: var(--u-text-caption-weight, 400);
74
+ letter-spacing: var(--u-text-caption-tracking, 0);
75
+ }
65
76
 
66
77
 
67
78
 
@@ -74,11 +85,14 @@ var t = e`
74
85
 
75
86
 
76
87
 
88
+
77
89
  .toggler {
78
90
  color: inherit;
79
- font-size: 20px;
80
91
  padding: 0px;
81
92
  }
93
+ .toggler u-icon {
94
+ font-size: 20px;
95
+ }
82
96
  .toggler:hover {
83
97
  color: var(--u-txt-color-hover, #1565C0);
84
98
  }
@@ -154,21 +168,32 @@ var t = e`
154
168
  bottom: 0;
155
169
  left: 0;
156
170
  }
171
+
172
+
173
+ .sidebar[state="mobile"] .sidebar-header,
174
+ .sidebar[state="mobile-open"] .sidebar-header {
175
+ display: none;
176
+ }
157
177
  .sidebar[state="mobile"] {
158
178
  position: absolute;
159
- top: 0;
179
+ top: var(--_mobile-header-block-size, 0px);
160
180
  bottom: 0;
161
181
  left: 0;
162
182
  right: 0;
163
183
  transform: translateY(-100%);
164
184
  }
185
+
186
+
187
+
188
+
165
189
  .sidebar[state="mobile-open"] {
166
190
  position: absolute;
167
- top: 0;
191
+ top: var(--_mobile-header-block-size, 0px);
168
192
  bottom: 0;
169
193
  left: 0;
170
194
  right: 0;
171
195
  transform: translateY(0);
196
+ overflow: hidden;
172
197
  }
173
198
 
174
199
 
@@ -180,7 +205,7 @@ var t = e`
180
205
  align-items: center;
181
206
  justify-content: space-between;
182
207
  gap: 12px;
183
- padding: 16px;
208
+ padding: 12px 16px;
184
209
  background: var(--app-header-bg, var(--u-bg-color-raised, #FAFAFA));
185
210
  color: var(--app-header-fg, var(--u-txt-color, #212121));
186
211
  border-bottom: 1px solid var(--u-border-color-weak, #EEEEEE);
@@ -194,7 +219,7 @@ var t = e`
194
219
  align-items: center;
195
220
  justify-content: space-between;
196
221
  gap: 12px;
197
- padding: 16px;
222
+ padding: 12px 16px;
198
223
  border-bottom: 1px solid var(--u-border-color-weak, #EEEEEE);
199
224
  user-select: none;
200
225
  }
@@ -439,5 +464,4 @@ var t = e`
439
464
  }
440
465
  }
441
466
  `;
442
- //#endregion
443
467
  export { t as styles };
@@ -57,8 +57,17 @@ export interface SidebarLogoImage {
57
57
  }
58
58
  /** 커스텀 로고 렌더 함수. `SidebarHtmlConfig.render`와 동일한 반환 타입 */
59
59
  export type SidebarLogoRenderer = (state: SidebarState) => TemplateResult<1> | HTMLElement | string;
60
- /** 최상단 앱 로고 설정: 아이콘명(문자열, 기존 동작) | 이미지 | 커스텀 렌더 함수 */
61
- export type SidebarLogoConfig = string | SidebarLogoImage | SidebarLogoRenderer;
60
+ /**
61
+ * 등록된 아이콘 라이브러리의 아이콘 로고 — 메뉴 항목과 같은 `icon` + `lib` 짝.
62
+ * 문자열 로고는 라이브러리를 고르지 못해 `u-icon` 의 기본 경로(`iconBasepath`)에서만 찾는다.
63
+ */
64
+ export interface SidebarLogoIcon {
65
+ icon: string;
66
+ /** `icon` 을 찾을 등록 라이브러리(`IconRegistry`). 없으면 문자열 로고와 같다. */
67
+ lib?: string;
68
+ }
69
+ /** 최상단 앱 로고 설정: 아이콘명(문자열, 기존 동작) | 라이브러리 아이콘 | 이미지 | 커스텀 렌더 함수 */
70
+ export type SidebarLogoConfig = string | SidebarLogoIcon | SidebarLogoImage | SidebarLogoRenderer;
62
71
  /** One entry of a `type: 'menu'` popup. */
63
72
  export interface SidebarMenuItemConfig extends SidebarPermissionGuard {
64
73
  label: string | DirectiveResult;
@@ -101,6 +110,11 @@ export interface SidebarLayoutConfig {
101
110
  logo?: SidebarLogoConfig;
102
111
  /** 앱 제목 */
103
112
  title?: string;
113
+ /**
114
+ * 제목 아래 한 줄 — 앱이 무엇인지(«여신 서류 보관 시스템»). 펼친 사이드바의 머리에만 보인다: 접힌 사이드바는 제목과 함께 숨고,
115
+ * 모바일 머리 줄은 한 줄을 지킨다.
116
+ */
117
+ subtitle?: string;
104
118
  /** 상단/메인 메뉴 아이템 항목들 */
105
119
  main?: SidebarItem[];
106
120
  /** 하단(footer)에 고정해서 렌더할 항목들 */
@@ -1,4 +1,4 @@
1
- //#region src/layouts/filterSidebarItems.ts
1
+ // src/layouts/filterSidebarItems.ts
2
2
  function e(e, t) {
3
3
  return !(e.requirePermission && !t(e.requirePermission) || e.requireAnyPermission && e.requireAnyPermission.length > 0 && !e.requireAnyPermission.some((e) => t(e)));
4
4
  }
@@ -24,5 +24,4 @@ function t(n, r) {
24
24
  }
25
25
  return a;
26
26
  }
27
- //#endregion
28
27
  export { t as filterSidebarItems };
package/dist/react.js CHANGED
@@ -4,7 +4,7 @@ import { Wizard as n } from "./components/Wizard.js";
4
4
  import { SidebarLayout as r } from "./layouts/SidebarLayout.js";
5
5
  import i from "react";
6
6
  import { createComponent as a } from "@lit/react";
7
- //#region src/react.ts
7
+ // src/react.ts
8
8
  function o(e) {
9
9
  let n = i.useRef(e);
10
10
  n.current = e;
@@ -26,5 +26,4 @@ var s = a({
26
26
  elementClass: n,
27
27
  events: { onStepChange: "step-change" }
28
28
  });
29
- //#endregion
30
29
  export { e as ScreenObserver, s as SidebarLayout, c as Wizard, o as useUnsavedChanges };
package/dist/translate.js CHANGED
@@ -27,5 +27,4 @@ var r = n(class extends t {
27
27
  this.subscribed && (this.subscribed = !1, e.off("languageChanged", this.refresh), e.off("initialized", this.refresh), e.store?.off("added", this.refresh));
28
28
  }
29
29
  });
30
- //#endregion
31
30
  export { r as translate };