@shival99/z-ui 2.3.2 → 2.3.4
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/assets/css/overlay.css +28 -8
- package/fesm2022/shival99-z-ui-components-z-calendar.mjs +2 -2
- package/fesm2022/shival99-z-ui-components-z-calendar.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-drawer.mjs +47 -14
- package/fesm2022/shival99-z-ui-components-z-drawer.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-modal.mjs +5 -12
- package/fesm2022/shival99-z-ui-components-z-modal.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-overlay.mjs +112 -8
- package/fesm2022/shival99-z-ui-components-z-overlay.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-tabs.mjs +1 -1
- package/fesm2022/shival99-z-ui-components-z-tabs.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-services.mjs +3 -1
- package/fesm2022/shival99-z-ui-services.mjs.map +1 -1
- package/package.json +1 -1
- package/types/shival99-z-ui-components-z-autocomplete.d.ts +1 -1
- package/types/shival99-z-ui-components-z-calendar.d.ts +4 -4
- package/types/shival99-z-ui-components-z-drawer.d.ts +12 -1
- package/types/shival99-z-ui-components-z-editor.d.ts +1 -1
- package/types/shival99-z-ui-components-z-modal.d.ts +0 -1
- package/types/shival99-z-ui-components-z-overlay.d.ts +64 -4
- package/types/shival99-z-ui-components-z-select.d.ts +1 -1
package/assets/css/overlay.css
CHANGED
|
@@ -20,12 +20,17 @@
|
|
|
20
20
|
pointer-events: none;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
/*
|
|
23
|
+
/* Global panels own their scrolling; the overlay host must not create a second viewport. */
|
|
24
24
|
.z-overlay-host.z-overlay-global {
|
|
25
|
-
overflow:
|
|
25
|
+
overflow: hidden;
|
|
26
26
|
overscroll-behavior: contain;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
/* Free-form dynamic overlays opt into viewport scrolling explicitly. */
|
|
30
|
+
.z-overlay-host.z-overlay-global.z-overlay-scrollable {
|
|
31
|
+
overflow: auto;
|
|
32
|
+
}
|
|
33
|
+
|
|
29
34
|
.z-overlay-host::backdrop {
|
|
30
35
|
display: none; /* dùng div backdrop riêng (.z-overlay-backdrop) để giữ nguyên animation cũ */
|
|
31
36
|
}
|
|
@@ -72,12 +77,6 @@
|
|
|
72
77
|
}
|
|
73
78
|
}
|
|
74
79
|
|
|
75
|
-
/* Khoá scroll trang nhưng giữ nguyên document flow để overlay không bị layout shift. */
|
|
76
|
-
html.z-scroll-locked {
|
|
77
|
-
overflow: hidden;
|
|
78
|
-
scrollbar-gutter: stable;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
80
|
@media (prefers-reduced-motion: reduce) {
|
|
82
81
|
.z-overlay-pane,
|
|
83
82
|
.z-overlay-backdrop {
|
|
@@ -85,3 +84,24 @@
|
|
|
85
84
|
}
|
|
86
85
|
}
|
|
87
86
|
}
|
|
87
|
+
|
|
88
|
+
/*
|
|
89
|
+
* Khoá scroll trang. Phải nằm NGOÀI `@layer base` để thắng rule `html { ... }` mà app khai báo
|
|
90
|
+
* không-layer (rule trong layer luôn thua rule không-layer, bất kể specificity).
|
|
91
|
+
*/
|
|
92
|
+
html.z-scroll-locked {
|
|
93
|
+
overflow: hidden;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/*
|
|
97
|
+
* `overflow: hidden` làm scrollbar biến mất và nhả lại đúng chiều rộng của nó -> toàn bộ UI (kể cả
|
|
98
|
+
* element `position: fixed`) nở ra rồi co lại khi đóng overlay. `scrollbar-gutter: stable` giữ nguyên
|
|
99
|
+
* chỗ đó nên không có gì dịch chuyển. ZScrollLockService chỉ gắn class này khi trang vốn đã dành chỗ
|
|
100
|
+
* cho scrollbar — trang không có scrollbar (hoặc scrollbar dạng overlay) mà giữ gutter thì lại co vào.
|
|
101
|
+
* Trình duyệt không hỗ trợ `scrollbar-gutter`: service đo hiệu số thật rồi bù `padding-right` vào body
|
|
102
|
+
* và ghi ra `--z-scroll-lock-gutter` (0px khi không nhả) để app tự bù cho element fixed của mình:
|
|
103
|
+
* `.my-fixed-bar { padding-right: var(--z-scroll-lock-gutter, 0px); }`
|
|
104
|
+
*/
|
|
105
|
+
html.z-scroll-locked.z-scroll-locked-gutter {
|
|
106
|
+
scrollbar-gutter: stable;
|
|
107
|
+
}
|