@iyulab/modern-app 0.20.0 → 0.20.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.20.1] - 2026-09-17
4
+
5
+ ### Fixed
6
+
7
+ - **`u-master-detail-layout` no longer adds a trailing blank page when a single pane is printed.**
8
+ The layout is a flex row with scrolling panes, and both keep the bottom margin of a pane's last
9
+ block inside the layout, so the layout grew by that margin; content ending just short of a page
10
+ boundary then spilled onto a page holding only the margin. When a single pane is showing
11
+ (overlay mode, or no detail) the layout now prints as block flow, which lets the margin collapse
12
+ past it and be truncated at the page break. Side-by-side printing is unchanged: two columns are
13
+ flex items and each keeps its own margin.
14
+
15
+ ### Added
16
+
17
+ - `u-master-detail-layout` exposes a `:state(detail)` custom state while its `detail` slot has
18
+ content.
19
+
20
+ ### Changed
21
+
22
+ - Requires `@iyulab/router` `^0.15.1`, which prints the route outlet as a block box. The shell's
23
+ guarantee that a screen's trailing margin collapses out of the page in print depends on it.
24
+
3
25
  ## [0.20.0] - 2026-09-16
4
26
 
5
27
  ### Added
@@ -32,6 +32,9 @@ type ElementParts = 'host' | 'master' | 'divider' | 'detail' | 'detail-close';
32
32
  * `PageHeader`/`GroupBox`/`ActionBar` 의 고정 중단점 관행을 벗어나려는 것이 아니다.
33
33
  *
34
34
  * 오버라이드: `part`(host·master·divider·detail·detail-close) + slot 치환.
35
+ *
36
+ * detail 슬롯이 채워져 있는 동안 `:state(detail)` 커스텀 상태를 노출한다
37
+ * (`ElementInternals.states`) — 속성으로 반사하지 않는다(`u-select:state(open)` 과 같은 관례).
35
38
  */
36
39
  export declare class MasterDetailLayout extends StyledElement<ElementParts> {
37
40
  static styles: import('lit').CSSResultGroup[];
@@ -50,6 +53,13 @@ export declare class MasterDetailLayout extends StyledElement<ElementParts> {
50
53
  locale: string;
51
54
  /** detail 슬롯 배정 상태 — CSS `:has()` 로는 알 수 없다(`internals/slotted.ts` 참조). */
52
55
  private hasDetail;
56
+ /**
57
+ * `:state(detail)` 을 싣는 자리. 인쇄 규칙이 «한 판만 보이는가» 를 호스트에서 갈라야 해서
58
+ * 생겼다(styles 의 인쇄 절 참조).
59
+ * ⚠생성자에서 한 번만 붙인다 — `attachInternals()` 는 같은 인스턴스에 두 번 부르면
60
+ * `NotSupportedError` 이고, `connectedCallback` 은 재연결마다 다시 돈다.
61
+ */
62
+ private readonly internals;
53
63
  private resizeObserver?;
54
64
  connectedCallback(): void;
55
65
  /**
@@ -11,7 +11,7 @@ import "@iyulab/components/dist/components/icon/UIcon.js";
11
11
  //#region src/components/MasterDetailLayout.ts
12
12
  var u = class extends n {
13
13
  constructor(...e) {
14
- super(...e), this.masterSize = "22rem", this.overlayBreakpoint = 760, this.locale = "", this.hasDetail = !1, this.handleDetailClose = () => {
14
+ super(...e), this.masterSize = "22rem", this.overlayBreakpoint = 760, this.locale = "", this.hasDetail = !1, this.internals = typeof this.attachInternals == "function" ? this.attachInternals() : void 0, this.handleDetailClose = () => {
15
15
  this.fire("detail-close", { cancelable: !1 });
16
16
  }, this.handleDetailSlotChange = (e) => {
17
17
  this.hasDetail = i(e.target);
@@ -32,7 +32,7 @@ var u = class extends n {
32
32
  super.disconnectedCallback(), this.resizeObserver?.disconnect();
33
33
  }
34
34
  updated(e) {
35
- super.updated(e), e.has("masterSize") && this.style.setProperty("--_master-size", this.masterSize), e.has("overlayBreakpoint") && this.applyOverlay(this.getBoundingClientRect().width);
35
+ super.updated(e), e.has("masterSize") && this.style.setProperty("--_master-size", this.masterSize), e.has("hasDetail") && this.internals?.states?.[this.hasDetail ? "add" : "delete"]("detail"), e.has("overlayBreakpoint") && this.applyOverlay(this.getBoundingClientRect().width);
36
36
  }
37
37
  render() {
38
38
  return o`
@@ -74,8 +74,33 @@ var t = e`
74
74
  * 되돌려 전부 인쇄한다 — 덮여 있던 master 는 찍지 않는다. detail 이 비어 있으면 master 가
75
75
  * 화면 그대로 인쇄된다(covered 는 detail 이 채워졌을 때만 붙는다).
76
76
  * 나란히 배치 모드는 바꾸지 않는다 — 두 판이 부모 높이를 따라 풀린다.
77
+ *
78
+ * 🔴**한 판만 보일 때는 flex 뼈대를 걷는다**(오버레이 모드 · detail 없음). flex 호스트와
79
+ * overflow: auto 판은 둘 다 독립 서식 문맥이라, 화면 마지막 블록의 아래 여백이 레이아웃
80
+ * «안» 에 갇혀 그만큼 높이가 는다 — 내용 끝이 쪽 경계에서 그 여백 이내에 있으면 여백만 담긴
81
+ * 빈 꼬리 쪽이 찍힌다(router 아웃렛의 인쇄 수정과 같은 기전). 한 판뿐이면 flex 가 인쇄에서
82
+ * 할 일이 없으므로 블록 흐름으로 돌려 여백이 문서 끝까지 접히게 한다(쪽 경계에서 잘린다).
83
+ * ⚠**나란히 배치(detail 있음 · 오버레이 아님)는 원리적으로 가둔다** — 두 열은 flex 항목이고
84
+ * flex 항목은 항상 독립 서식 문맥이다. 화면에 보인 두 열을 그대로 찍는 것이 계약이다.
85
+ * ⚠:state() 를 모르는 엔진에서는 그 선택자만 무효가 되도록 **규칙을 나눴다** — 선택자 목록에
86
+ * 섞으면 목록 전체가 버려져 오버레이 규칙까지 사라진다.
77
87
  */
78
88
  @media print {
89
+ :host([overlay]) {
90
+ display: block;
91
+ height: auto;
92
+ }
93
+ :host(:not(:state(detail))) {
94
+ display: block;
95
+ height: auto;
96
+ }
97
+ :host([overlay]) .master,
98
+ :host([overlay]) .detail {
99
+ overflow: visible;
100
+ }
101
+ :host(:not(:state(detail))) .master {
102
+ overflow: visible;
103
+ }
79
104
  .detail-close,
80
105
  :host([overlay]) .detail-close,
81
106
  :host([overlay]) .master.covered {
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 lit-element",
4
- "version": "0.20.0",
4
+ "version": "0.20.1",
5
5
  "keywords": [
6
6
  "iyulab",
7
7
  "web-framework",
@@ -59,7 +59,7 @@
59
59
  "test:react-types": "tsc -p tsconfig.react-smoke.json"
60
60
  },
61
61
  "dependencies": {
62
- "@iyulab/router": "^0.15.0",
62
+ "@iyulab/router": "^0.15.1",
63
63
  "i18next": "^26.3.6",
64
64
  "lit": "^3.3.3"
65
65
  },
@@ -59,6 +59,14 @@ In overlay mode, a filled detail prints in full, in flow, instead of the covered
59
59
  close button is not printed; with the detail empty, the master prints. The overlay state is the
60
60
  one measured on screen when printing starts.
61
61
 
62
+ When a single pane is showing (overlay mode, or no detail), the layout prints as ordinary block
63
+ flow rather than a flex row with scrolling panes. Both of those create an independent formatting
64
+ context, which would keep the bottom margin of the pane's last block inside the layout and make
65
+ the layout that much taller — enough, when content ends just short of a page boundary, to print
66
+ a trailing page holding nothing but the margin. In block flow the margin collapses past the layout
67
+ and is truncated at the page break. Side by side, the two panes are flex items and each keeps its
68
+ own margin; that is inherent to printing two columns.
69
+
62
70
  ## Slots
63
71
 
64
72
  | Name | Description |
@@ -80,6 +88,16 @@ one measured on screen when printing starts.
80
88
  |-------|--------|------------|--------------|
81
89
  | `detail-close` | — | No | Overlay-mode close button clicked. Clear the `detail` slot's content in response — the component does not do this for you |
82
90
 
91
+ ## Custom States
92
+
93
+ | State | Description |
94
+ |-------|-------------|
95
+ | `:state(detail)` | Present while the `detail` slot has content |
96
+
97
+ ```css
98
+ u-master-detail-layout:state(detail)::part(master) { border-inline-end: 0; }
99
+ ```
100
+
83
101
  ## CSS Parts
84
102
 
85
103
  | Part | Description |