@pgcorp/ui-kit 0.14.0 → 0.15.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.
- package/README.md +330 -12
- package/dist/assets/src/components/layout/{SResizeHandle.vue_vue_type_style_index_0_scoped_13b9b27a_lang.css → SResizeHandle.vue_vue_type_style_index_0_scoped_dc65aba1_lang.css} +1 -1
- package/dist/assets/src/components/shared/_internal/SDialogSurface.css_vue_type_style_index_0_src_a108e8f1_scoped_a108e8f1_lang.css +2 -0
- package/dist/assets/src/components/shared/containers/{SCollapsiblePanel.css_vue_type_style_index_0_src_71824088_scoped_71824088_lang.css → SCollapsiblePanel.css_vue_type_style_index_0_src_db85261d_scoped_db85261d_lang.css} +1 -1
- package/dist/assets/src/components/shared/containers/{SOverlayHost.css_vue_type_style_index_0_src_8f9be94e_scoped_8f9be94e_lang.css → SOverlayHost.css_vue_type_style_index_0_src_09215628_scoped_09215628_lang.css} +1 -1
- package/dist/assets/src/components/shared/containers/{SPopover.css_vue_type_style_index_0_src_4091d007_scoped_4091d007_lang.css → SPopover.css_vue_type_style_index_0_src_a4f1f64a_scoped_a4f1f64a_lang.css} +1 -1
- package/dist/assets/src/components/shared/containers/SSidebarSection.css_vue_type_style_index_0_src_52396e42_scoped_52396e42_lang.css +2 -0
- package/dist/assets/src/components/shared/controls/SButton.css_vue_type_style_index_0_src_7a5acda9_scoped_7a5acda9_lang.css +1 -1
- package/dist/assets/src/components/shared/controls/SCheckbox.css_vue_type_style_index_0_src_2562f916_scoped_2562f916_lang.css +2 -0
- package/dist/assets/src/components/shared/controls/SCombobox.css_vue_type_style_index_0_src_d630c922_scoped_d630c922_lang.css +2 -0
- package/dist/assets/src/components/shared/controls/SContextMenu.css_vue_type_style_index_0_src_43b6e378_scoped_43b6e378_lang.css +1 -0
- package/dist/assets/src/components/shared/controls/{SDropdownMenu.css_vue_type_style_index_0_src_857e2649_scoped_857e2649_lang.css → SDropdownMenu.css_vue_type_style_index_0_src_40040ae5_scoped_40040ae5_lang.css} +1 -1
- package/dist/assets/src/components/shared/controls/{SMenuSurface.css_vue_type_style_index_0_src_84109ad9_scoped_84109ad9_lang.css → SMenuSurface.css_vue_type_style_index_0_src_d2b7d71b_scoped_d2b7d71b_lang.css} +1 -1
- package/dist/assets/src/components/shared/controls/SSelect.css_vue_type_style_index_0_src_d1ead6c0_scoped_d1ead6c0_lang.css +2 -0
- package/dist/assets/src/components/shared/data-display/SControlledToastViewport.css_vue_type_style_index_0_src_a69aa84b_scoped_a69aa84b_lang.css +2 -0
- package/dist/assets/src/components/shared/data-display/SScrollViewport.css_vue_type_style_index_0_src_d94fcf8c_scoped_d94fcf8c_lang.css +2 -0
- package/dist/assets/src/components/shared/data-display/STooltip.css_vue_type_style_index_0_src_true_lang.css +1 -1
- package/dist/assets/src/components/shared/data-display/_internal/STableFrame.css_vue_type_style_index_0_src_914bad28_scoped_914bad28_lang.css +2 -0
- package/dist/assets/src/components/shared/navigation/{SBottomNav.vue_vue_type_style_index_0_scoped_24be0f2b_lang.css → SBottomNav.vue_vue_type_style_index_0_scoped_68cf84b3_lang.css} +1 -1
- package/dist/src/components/layout/SResizeHandle.vue.js +2 -2
- package/dist/src/components/layout/SResizeHandle.vue_vue_type_script_setup_true_lang.js +4 -2
- package/dist/src/components/shared/_internal/SDialogSurface.vue.d.ts +9 -1
- package/dist/src/components/shared/_internal/SDialogSurface.vue.js +2 -2
- package/dist/src/components/shared/_internal/SDialogSurface.vue_vue_type_script_setup_true_lang.js +174 -82
- package/dist/src/components/shared/_internal/dialogSurface.d.ts +2 -0
- package/dist/src/components/shared/_internal/dialogSurface.js +30 -27
- package/dist/src/components/shared/_internal/dialogSurfaceMotion.d.ts +14 -0
- package/dist/src/components/shared/_internal/dialogSurfaceMotion.js +84 -0
- package/dist/src/components/shared/_internal/focusTrap.js +15 -13
- package/dist/src/components/shared/containers/SCollapsiblePanel.vue.d.ts +5 -0
- package/dist/src/components/shared/containers/SCollapsiblePanel.vue.js +2 -2
- package/dist/src/components/shared/containers/SCollapsiblePanel.vue_vue_type_script_setup_true_lang.js +123 -121
- package/dist/src/components/shared/containers/SDrawer.vue.d.ts +4 -4
- package/dist/src/components/shared/containers/SDrawer.vue.js +3 -6
- package/dist/src/components/shared/containers/SDrawer.vue_vue_type_script_setup_true_lang.js +104 -128
- package/dist/src/components/shared/containers/SModal.vue.d.ts +8 -8
- package/dist/src/components/shared/containers/SModal.vue.js +3 -6
- package/dist/src/components/shared/containers/SModal.vue_vue_type_script_setup_true_lang.js +87 -103
- package/dist/src/components/shared/containers/SOverlayHost.vue.js +2 -2
- package/dist/src/components/shared/containers/SOverlayHost.vue_vue_type_script_setup_true_lang.js +32 -31
- package/dist/src/components/shared/containers/SPanel.vue.d.ts +1 -1
- package/dist/src/components/shared/containers/SPopover.vue.js +2 -2
- package/dist/src/components/shared/containers/SPopover.vue_vue_type_script_setup_true_lang.js +225 -200
- package/dist/src/components/shared/containers/SSidebarSection.vue.js +2 -2
- package/dist/src/components/shared/containers/SSidebarSection.vue_vue_type_script_setup_true_lang.js +4 -3
- package/dist/src/components/shared/controls/SCheckbox.vue.js +2 -2
- package/dist/src/components/shared/controls/SCheckbox.vue_vue_type_script_setup_true_lang.js +13 -7
- package/dist/src/components/shared/controls/SCombobox.vue.js +2 -2
- package/dist/src/components/shared/controls/SCombobox.vue_vue_type_script_setup_true_lang.js +104 -94
- package/dist/src/components/shared/controls/SContextMenu.vue.js +2 -2
- package/dist/src/components/shared/controls/SContextMenu.vue_vue_type_script_setup_true_lang.js +86 -81
- package/dist/src/components/shared/controls/SDropdownMenu.vue.js +2 -2
- package/dist/src/components/shared/controls/SDropdownMenu.vue_vue_type_script_setup_true_lang.js +77 -72
- package/dist/src/components/shared/controls/SMenuSurface.vue.js +2 -2
- package/dist/src/components/shared/controls/SMenuSurface.vue_vue_type_script_setup_true_lang.js +81 -77
- package/dist/src/components/shared/controls/SSelect.vue.js +2 -2
- package/dist/src/components/shared/controls/SSelect.vue_vue_type_script_setup_true_lang.js +85 -77
- package/dist/src/components/shared/data-display/SControlledToastViewport.vue.js +2 -2
- package/dist/src/components/shared/data-display/SControlledToastViewport.vue_vue_type_script_setup_true_lang.js +58 -49
- package/dist/src/components/shared/data-display/SScrollViewport.vue.d.ts +10 -5
- package/dist/src/components/shared/data-display/SScrollViewport.vue.js +2 -2
- package/dist/src/components/shared/data-display/SScrollViewport.vue_vue_type_script_setup_true_lang.js +162 -111
- package/dist/src/components/shared/data-display/STooltip.vue_vue_type_script_setup_true_lang.js +276 -224
- package/dist/src/components/shared/data-display/_internal/STableFrame.vue.d.ts +3 -3
- package/dist/src/components/shared/data-display/_internal/STableFrame.vue.js +2 -2
- package/dist/src/components/shared/data-display/_internal/STableFrame.vue_vue_type_script_setup_true_lang.js +62 -46
- package/dist/src/components/shared/data-display/scrollViewport.d.ts +2 -0
- package/dist/src/components/shared/navigation/SBottomNav.vue.js +2 -2
- package/dist/src/components/shared/navigation/SBottomNav.vue_vue_type_script_setup_true_lang.js +3 -1
- package/dist/src/components/shared/navigation/STabList.vue.d.ts +1 -1
- package/dist/src/composables/useDialogOverlay.d.ts +12 -2
- package/dist/src/composables/useDialogOverlay.js +192 -119
- package/dist/src/internal/flatTree.d.ts +8 -0
- package/dist/src/internal/flatTree.js +23 -0
- package/dist/src/internal/focusNavigation.d.ts +3 -0
- package/dist/src/internal/focusNavigation.js +28 -15
- package/dist/src/internal/inertLease.d.ts +8 -0
- package/dist/src/internal/inertLease.js +33 -0
- package/dist/src/internal/layerStack.d.ts +40 -0
- package/dist/src/internal/layerStack.js +301 -94
- package/dist/src/internal/nativeFocus.d.ts +4 -0
- package/dist/src/internal/nativeFocus.js +12 -0
- package/dist/src/internal/overlayPortal.d.ts +17 -0
- package/dist/src/internal/overlayPortal.js +23 -0
- package/dist/src/internal/semanticSizing.d.ts +2 -2
- package/dist/src/internal/semanticSizing.js +2 -1
- package/dist/src/internal/useMenuLayer.d.ts +1 -0
- package/dist/src/internal/useMenuLayer.js +63 -57
- package/dist/src/internal/viewportModality.d.ts +27 -0
- package/dist/src/internal/viewportModality.js +132 -0
- package/dist/typography.js +17 -62
- package/docs/overlay-lifecycle.md +195 -0
- package/docs/public-api.md +141 -4
- package/docs/resize.md +34 -5
- package/docs/scroll-viewport.md +30 -10
- package/docs/theming.md +42 -8
- package/package.json +1 -1
- package/src/components/shared/_internal/SDialogSurface.css +185 -40
- package/src/components/shared/controls/SButton.css +0 -3
- package/src/components/shared/controls/SCheckbox.css +19 -7
- package/src/components/shared/data-display/SControlledToastViewport.css +2 -10
- package/src/components/shared/data-display/SScrollViewport.css +17 -1
- package/src/components/shared/data-display/STooltip.css +1 -1
- package/src/components/shared/data-display/_internal/STableFrame.css +1 -5
- package/dist/assets/src/components/shared/_internal/SDialogSurface.css_vue_type_style_index_0_src_0e58afdc_scoped_0e58afdc_lang.css +0 -2
- package/dist/assets/src/components/shared/containers/SDrawer.css_vue_type_style_index_0_src_61cf20dd_scoped_61cf20dd_lang.css +0 -2
- package/dist/assets/src/components/shared/containers/SModal.css_vue_type_style_index_0_src_42e1bd5f_scoped_42e1bd5f_lang.css +0 -2
- package/dist/assets/src/components/shared/containers/SSidebarSection.css_vue_type_style_index_0_src_21f71ae8_scoped_21f71ae8_lang.css +0 -2
- package/dist/assets/src/components/shared/controls/SCheckbox.css_vue_type_style_index_0_src_55d4826e_scoped_55d4826e_lang.css +0 -2
- package/dist/assets/src/components/shared/controls/SCombobox.css_vue_type_style_index_0_src_537f5744_scoped_537f5744_lang.css +0 -2
- package/dist/assets/src/components/shared/controls/SContextMenu.css_vue_type_style_index_0_src_03921269_scoped_03921269_lang.css +0 -1
- package/dist/assets/src/components/shared/controls/SSelect.css_vue_type_style_index_0_src_df3d6688_scoped_df3d6688_lang.css +0 -2
- package/dist/assets/src/components/shared/data-display/SControlledToastViewport.css_vue_type_style_index_0_src_5864b6c6_scoped_5864b6c6_lang.css +0 -2
- package/dist/assets/src/components/shared/data-display/SScrollViewport.css_vue_type_style_index_0_src_e5d11342_scoped_e5d11342_lang.css +0 -2
- package/dist/assets/src/components/shared/data-display/_internal/STableFrame.css_vue_type_style_index_0_src_52b5825e_scoped_52b5825e_lang.css +0 -2
- package/src/components/shared/containers/SDrawer.css +0 -87
- package/src/components/shared/containers/SModal.css +0 -27
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import r from "
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
1
|
+
import { useOverlayAdmission as e } from "../../../internal/overlayHost.js";
|
|
2
|
+
import { validateBoundedInteger as t, validateNonEmptyString as n } from "../../../internal/runtimeContract.js";
|
|
3
|
+
import { useOverlayPortal as r, useOverlayPortalTarget as i } from "../../../internal/overlayPortal.js";
|
|
4
|
+
import { useOwnedAttrs as a } from "../../../internal/ownedAttrs.js";
|
|
5
|
+
import o from "../_internal/SToastItem.vue.js";
|
|
6
|
+
import { validateToastLifetimeOwner as s, validateToastPosition as c, validateToastPresentations as l } from "./toast.js";
|
|
7
|
+
import { Fragment as u, Teleport as d, TransitionGroup as f, computed as p, createBlock as m, createCommentVNode as h, createElementBlock as g, createElementVNode as _, createVNode as v, defineComponent as y, mergeProps as b, onBeforeUnmount as x, openBlock as S, renderList as C, unref as w, watch as T, withCtx as E } from "vue";
|
|
6
8
|
//#region src/components/shared/data-display/SControlledToastViewport.vue?vue&type=script&setup=true&lang.ts
|
|
7
|
-
var
|
|
9
|
+
var D = ["data-position", "aria-label"], O = /*@__PURE__*/ y({
|
|
8
10
|
inheritAttrs: !1,
|
|
9
11
|
__name: "SControlledToastViewport",
|
|
10
12
|
props: {
|
|
@@ -19,31 +21,31 @@ var x = ["data-position", "aria-label"], S = /*@__PURE__*/ p({
|
|
|
19
21
|
"action",
|
|
20
22
|
"lifetime-expired"
|
|
21
23
|
],
|
|
22
|
-
setup(
|
|
23
|
-
let
|
|
24
|
+
setup(y, { emit: O }) {
|
|
25
|
+
let k = y, A = O, j = a({
|
|
24
26
|
component: "SControlledToastViewport",
|
|
25
27
|
owner: "controlled toast viewport root"
|
|
26
|
-
}),
|
|
28
|
+
}), M = r(), N = i(), P = e(), F = p(() => M?.scope.value === "native"), I = p(() => M && !P.value ? null : N.value), L = /* @__PURE__ */ new Map(), R = p(() => l("SControlledToastViewport", k.notifications)), z = p(() => n("SControlledToastViewport", "accessibleLabel", k.accessibleLabel)), B = p(() => c(k.position)), V = p(() => s(k.lifetimeOwner)), H = p(() => t("SControlledToastViewport", "maxVisible", k.maxVisible, {
|
|
27
29
|
minimum: 1,
|
|
28
30
|
maximum: 2 ** 53 - 1
|
|
29
|
-
})),
|
|
30
|
-
function
|
|
31
|
+
})), U = p(() => R.value.slice(0, H.value));
|
|
32
|
+
function W(e) {
|
|
31
33
|
e.timer !== null && (clearTimeout(e.timer), e.timer = null);
|
|
32
34
|
}
|
|
33
|
-
function
|
|
34
|
-
let t =
|
|
35
|
-
t && (
|
|
35
|
+
function G(e) {
|
|
36
|
+
let t = L.get(e);
|
|
37
|
+
t && (W(t), L.delete(e));
|
|
36
38
|
}
|
|
37
|
-
function
|
|
38
|
-
for (let e of
|
|
39
|
-
|
|
39
|
+
function K() {
|
|
40
|
+
for (let e of L.values()) W(e);
|
|
41
|
+
L.clear();
|
|
40
42
|
}
|
|
41
|
-
function
|
|
43
|
+
function q(e, t) {
|
|
42
44
|
typeof window > "u" || t.expired || t.remainingMs <= 0 || t.pausedBy.size > 0 || (t.startedAt = Date.now(), t.timer = setTimeout(() => {
|
|
43
|
-
t.timer = null, t.remainingMs = 0, t.expired = !0,
|
|
45
|
+
t.timer = null, t.remainingMs = 0, t.expired = !0, A("lifetime-expired", { id: e });
|
|
44
46
|
}, t.remainingMs));
|
|
45
47
|
}
|
|
46
|
-
function
|
|
48
|
+
function J(e, t) {
|
|
47
49
|
let n = {
|
|
48
50
|
configuredDurationMs: t,
|
|
49
51
|
remainingMs: t,
|
|
@@ -52,66 +54,73 @@ var x = ["data-position", "aria-label"], S = /*@__PURE__*/ p({
|
|
|
52
54
|
pausedBy: /* @__PURE__ */ new Set(),
|
|
53
55
|
expired: !1
|
|
54
56
|
};
|
|
55
|
-
return
|
|
57
|
+
return L.set(e, n), q(e, n), n;
|
|
56
58
|
}
|
|
57
|
-
function
|
|
58
|
-
if (
|
|
59
|
-
|
|
59
|
+
function Y() {
|
|
60
|
+
if (V.value !== "viewport" || typeof window > "u") {
|
|
61
|
+
K();
|
|
60
62
|
return;
|
|
61
63
|
}
|
|
62
64
|
let e = /* @__PURE__ */ new Set();
|
|
63
|
-
for (let t of
|
|
65
|
+
for (let t of U.value) {
|
|
64
66
|
e.add(t.id);
|
|
65
|
-
let n = t.durationMs ?? 0, r =
|
|
67
|
+
let n = t.durationMs ?? 0, r = L.get(t.id);
|
|
66
68
|
if (n === 0) {
|
|
67
|
-
|
|
69
|
+
G(t.id);
|
|
68
70
|
continue;
|
|
69
71
|
}
|
|
70
72
|
if (!r) {
|
|
71
|
-
|
|
73
|
+
J(t.id, n);
|
|
72
74
|
continue;
|
|
73
75
|
}
|
|
74
|
-
r.configuredDurationMs !== n && (
|
|
76
|
+
r.configuredDurationMs !== n && (G(t.id), J(t.id, n));
|
|
75
77
|
}
|
|
76
|
-
for (let t of
|
|
78
|
+
for (let t of L.keys()) e.has(t) || G(t);
|
|
77
79
|
}
|
|
78
|
-
function
|
|
79
|
-
let n =
|
|
80
|
+
function X(e, t) {
|
|
81
|
+
let n = L.get(e);
|
|
80
82
|
if (!n || n.expired || n.pausedBy.has(t) || (n.pausedBy.add(t), n.timer === null)) return;
|
|
81
83
|
let r = Math.max(0, Date.now() - n.startedAt);
|
|
82
|
-
n.remainingMs = Math.max(0, n.remainingMs - r),
|
|
84
|
+
n.remainingMs = Math.max(0, n.remainingMs - r), W(n);
|
|
83
85
|
}
|
|
84
|
-
function
|
|
85
|
-
let n =
|
|
86
|
-
!n || !n.pausedBy.delete(t) || n.pausedBy.size > 0 ||
|
|
86
|
+
function Z(e, t) {
|
|
87
|
+
let n = L.get(e);
|
|
88
|
+
!n || !n.pausedBy.delete(t) || n.pausedBy.size > 0 || q(e, n);
|
|
87
89
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
+
T(I, (e, t) => {
|
|
91
|
+
if (e === null && t !== null) for (let e of L.keys()) Z(e, "pointer"), Z(e, "focus");
|
|
92
|
+
}, { flush: "sync" });
|
|
93
|
+
function Q(e) {
|
|
94
|
+
A("dismiss", {
|
|
90
95
|
id: e,
|
|
91
96
|
reason: "close"
|
|
92
97
|
});
|
|
93
98
|
}
|
|
94
|
-
return
|
|
99
|
+
return T([U, V], Y, { immediate: !0 }), x(K), (e, t) => I.value ? (S(), m(d, {
|
|
100
|
+
key: 0,
|
|
101
|
+
to: I.value,
|
|
102
|
+
disabled: !F.value
|
|
103
|
+
}, [_("div", b(w(j).bindings(), {
|
|
95
104
|
class: "s-toast-container s-controlled-toast-viewport",
|
|
96
|
-
"data-position":
|
|
105
|
+
"data-position": B.value,
|
|
97
106
|
role: "region",
|
|
98
|
-
"aria-label":
|
|
99
|
-
}), [f
|
|
107
|
+
"aria-label": z.value
|
|
108
|
+
}), [v(f, {
|
|
100
109
|
name: "notification-transition",
|
|
101
110
|
tag: "div",
|
|
102
111
|
class: "s-toast-transition-wrapper"
|
|
103
112
|
}, {
|
|
104
|
-
default:
|
|
113
|
+
default: E(() => [(S(!0), g(u, null, C(U.value, (e) => (S(), m(o, {
|
|
105
114
|
key: e.id,
|
|
106
115
|
notification: e,
|
|
107
|
-
onDismiss:
|
|
108
|
-
onAction: t[0] ||= (e) =>
|
|
109
|
-
onLifetimePause:
|
|
110
|
-
onLifetimeResume:
|
|
116
|
+
onDismiss: Q,
|
|
117
|
+
onAction: t[0] ||= (e) => A("action", e),
|
|
118
|
+
onLifetimePause: X,
|
|
119
|
+
onLifetimeResume: Z
|
|
111
120
|
}, null, 8, ["notification"]))), 128))]),
|
|
112
121
|
_: 1
|
|
113
|
-
})], 16,
|
|
122
|
+
})], 16, D)], 8, ["to", "disabled"])) : h("", !0);
|
|
114
123
|
}
|
|
115
124
|
});
|
|
116
125
|
//#endregion
|
|
117
|
-
export {
|
|
126
|
+
export { O as default };
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import { SScrollViewportApi, SScrollViewportState, SScrollViewportAxis as PublicSScrollViewportAxis, SScrollViewportOverscrollBehavior as PublicSScrollViewportOverscrollBehavior } from './scrollViewport';
|
|
2
|
-
import { ScrollViewportBlockSize as PublicScrollViewportBlockSize } from '../../../internal/semanticSizing';
|
|
1
|
+
import { SScrollViewportApi, SScrollViewportState, SScrollViewportAxis as PublicSScrollViewportAxis, SScrollViewportFocusPolicy as PublicSScrollViewportFocusPolicy, SScrollViewportOverscrollBehavior as PublicSScrollViewportOverscrollBehavior } from './scrollViewport';
|
|
2
|
+
import { ScrollViewportBlockSize as PublicScrollViewportBlockSize, ScrollableViewportMaxBlockSize as PublicScrollableViewportMaxBlockSize } from '../../../internal/semanticSizing';
|
|
3
3
|
export interface Props {
|
|
4
|
-
accessibleLabel
|
|
4
|
+
accessibleLabel?: string;
|
|
5
|
+
accessibleLabelledby?: string;
|
|
5
6
|
axis?: PublicSScrollViewportAxis;
|
|
6
7
|
blockSize?: PublicScrollViewportBlockSize;
|
|
8
|
+
maxBlockSize?: PublicScrollableViewportMaxBlockSize;
|
|
9
|
+
focusPolicy?: PublicSScrollViewportFocusPolicy;
|
|
7
10
|
focusable?: boolean;
|
|
8
11
|
keyboardNavigation?: boolean;
|
|
9
12
|
overscrollBehavior?: PublicSScrollViewportOverscrollBehavior;
|
|
@@ -16,10 +19,12 @@ declare const __VLS_export: __VLS_WithSlots<import('vue').DefineComponent<Props,
|
|
|
16
19
|
"onScroll-state"?: ((state: SScrollViewportState) => any) | undefined;
|
|
17
20
|
}>, {
|
|
18
21
|
focusable: boolean;
|
|
19
|
-
blockSize: PublicScrollViewportBlockSize;
|
|
20
|
-
overscrollBehavior: PublicSScrollViewportOverscrollBehavior;
|
|
21
22
|
axis: PublicSScrollViewportAxis;
|
|
23
|
+
blockSize: PublicScrollViewportBlockSize;
|
|
24
|
+
maxBlockSize: PublicScrollableViewportMaxBlockSize;
|
|
25
|
+
focusPolicy: PublicSScrollViewportFocusPolicy;
|
|
22
26
|
keyboardNavigation: boolean;
|
|
27
|
+
overscrollBehavior: PublicSScrollViewportOverscrollBehavior;
|
|
23
28
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>, {
|
|
24
29
|
default?: (props: {}) => any;
|
|
25
30
|
}>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import "../../../../assets/src/components/shared/data-display/SScrollViewport.
|
|
1
|
+
import "../../../../assets/src/components/shared/data-display/SScrollViewport.css_vue_type_style_index_0_src_d94fcf8c_scoped_d94fcf8c_lang.css";
|
|
2
2
|
import e from "../../../../_virtual/_plugin-vue_export-helper.js";
|
|
3
3
|
import t from "./SScrollViewport.vue_vue_type_script_setup_true_lang.js";
|
|
4
4
|
/* empty css */
|
|
5
5
|
//#region src/components/shared/data-display/SScrollViewport.vue
|
|
6
|
-
var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-
|
|
6
|
+
var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-d94fcf8c"]]);
|
|
7
7
|
//#endregion
|
|
8
8
|
export { n as default };
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
import { validateBoolean as e, validateBoundedNumber as t,
|
|
2
|
-
import { useOwnedAttrs as
|
|
3
|
-
import { useInteractiveLeafRegistration as
|
|
4
|
-
import { validateScrollViewportBlockSize as
|
|
5
|
-
import { computed as
|
|
1
|
+
import { validateBoolean as e, validateBoundedNumber as t, validateDomIdReferences as n, validateExactString as r, validateNonEmptyString as i } from "../../../internal/runtimeContract.js";
|
|
2
|
+
import { useOwnedAttrs as a } from "../../../internal/ownedAttrs.js";
|
|
3
|
+
import { useInteractiveLeafRegistration as o } from "../../../internal/passiveContentContract.js";
|
|
4
|
+
import { validateScrollViewportBlockSize as s, validateScrollableViewportMaxBlockSize as c } from "../../../internal/semanticSizing.js";
|
|
5
|
+
import { computed as l, createElementBlock as ee, createElementVNode as u, defineComponent as d, mergeProps as f, nextTick as p, onBeforeUnmount as m, onMounted as h, openBlock as g, renderSlot as _, shallowRef as v, unref as y, watch as b } from "vue";
|
|
6
6
|
//#region src/components/shared/data-display/SScrollViewport.vue?vue&type=script&setup=true&lang.ts
|
|
7
|
-
var
|
|
7
|
+
var x = [
|
|
8
|
+
"role",
|
|
8
9
|
"aria-label",
|
|
10
|
+
"aria-labelledby",
|
|
9
11
|
"tabindex",
|
|
10
12
|
"data-axis",
|
|
11
13
|
"data-block-size",
|
|
14
|
+
"data-max-block-size",
|
|
15
|
+
"data-focus-policy",
|
|
12
16
|
"data-focusable",
|
|
13
17
|
"data-keyboard-navigation",
|
|
14
18
|
"data-overscroll-behavior",
|
|
@@ -16,13 +20,16 @@ var b = [
|
|
|
16
20
|
"data-at-inline-end",
|
|
17
21
|
"data-at-block-start",
|
|
18
22
|
"data-at-block-end"
|
|
19
|
-
],
|
|
23
|
+
], S = /*@__PURE__*/ d({
|
|
20
24
|
inheritAttrs: !1,
|
|
21
25
|
__name: "SScrollViewport",
|
|
22
26
|
props: {
|
|
23
27
|
accessibleLabel: {},
|
|
28
|
+
accessibleLabelledby: {},
|
|
24
29
|
axis: { default: "y" },
|
|
25
30
|
blockSize: { default: "md" },
|
|
31
|
+
maxBlockSize: { default: "none" },
|
|
32
|
+
focusPolicy: { default: "always" },
|
|
26
33
|
focusable: {
|
|
27
34
|
type: Boolean,
|
|
28
35
|
default: !0
|
|
@@ -34,61 +41,71 @@ var b = [
|
|
|
34
41
|
overscrollBehavior: { default: "contain" }
|
|
35
42
|
},
|
|
36
43
|
emits: ["scroll-state"],
|
|
37
|
-
setup(
|
|
38
|
-
let
|
|
44
|
+
setup(d, { expose: S, emit: C }) {
|
|
45
|
+
let w = d, T = C, E = v(null), D = v(null), O = v(null), k = v(!1), te = a({
|
|
39
46
|
component: "SScrollViewport",
|
|
40
47
|
owner: "scroll viewport region"
|
|
41
|
-
}),
|
|
42
|
-
|
|
43
|
-
|
|
48
|
+
}), A = null, j = null, M = /* @__PURE__ */ new Set(), N = !1, P = "", F = null, I = l(() => {
|
|
49
|
+
if (w.accessibleLabel === void 0 == (w.accessibleLabelledby === void 0)) throw Error("SScrollViewport: требуется ровно один accessibleLabel или accessibleLabelledby. / SScrollViewport: exactly one accessibleLabel or accessibleLabelledby is required.");
|
|
50
|
+
let t = e("SScrollViewport", "focusable", w.focusable), a = e("SScrollViewport", "keyboardNavigation", w.keyboardNavigation);
|
|
51
|
+
if (a && !t) throw Error("SScrollViewport: keyboardNavigation=true требует focusable=true. / SScrollViewport: keyboardNavigation=true requires focusable=true.");
|
|
44
52
|
return {
|
|
45
|
-
accessibleLabel:
|
|
46
|
-
|
|
53
|
+
accessibleLabel: w.accessibleLabel === void 0 ? void 0 : i("SScrollViewport", "accessibleLabel", w.accessibleLabel),
|
|
54
|
+
accessibleLabelledby: w.accessibleLabelledby === void 0 ? void 0 : n("SScrollViewport", "accessibleLabelledby", w.accessibleLabelledby),
|
|
55
|
+
axis: r("SScrollViewport", "axis", w.axis, [
|
|
47
56
|
"x",
|
|
48
57
|
"y",
|
|
49
58
|
"both"
|
|
50
59
|
]),
|
|
51
|
-
blockSize:
|
|
60
|
+
blockSize: s("SScrollViewport", "blockSize", w.blockSize),
|
|
61
|
+
maxBlockSize: c("SScrollViewport", "maxBlockSize", w.maxBlockSize),
|
|
62
|
+
focusPolicy: r("SScrollViewport", "focusPolicy", w.focusPolicy, ["always", "overflow"]),
|
|
52
63
|
focusable: t,
|
|
53
|
-
keyboardNavigation:
|
|
54
|
-
overscrollBehavior:
|
|
64
|
+
keyboardNavigation: a,
|
|
65
|
+
overscrollBehavior: r("SScrollViewport", "overscrollBehavior", w.overscrollBehavior, [
|
|
55
66
|
"auto",
|
|
56
67
|
"contain",
|
|
57
68
|
"none"
|
|
58
69
|
])
|
|
59
70
|
};
|
|
71
|
+
}), L = l(() => {
|
|
72
|
+
let e = O.value?.physical;
|
|
73
|
+
return e ? Y("x") && e.maxX > 0 || Y("y") && e.maxY > 0 : !1;
|
|
74
|
+
}), R = l(() => I.value.focusPolicy === "always" || L.value), z = l(() => I.value.focusable && R.value), B = l(() => {
|
|
75
|
+
if (z.value) return 0;
|
|
76
|
+
if (I.value.focusPolicy === "overflow" && I.value.focusable && k.value) return -1;
|
|
60
77
|
});
|
|
61
|
-
|
|
78
|
+
o({
|
|
62
79
|
owner: "SScrollViewport",
|
|
63
|
-
active: () =>
|
|
80
|
+
active: () => z.value
|
|
64
81
|
});
|
|
65
|
-
function
|
|
82
|
+
function V(e, t) {
|
|
66
83
|
return Math.min(t, Math.max(0, e));
|
|
67
84
|
}
|
|
68
|
-
function
|
|
69
|
-
if (
|
|
85
|
+
function H(e) {
|
|
86
|
+
if (F) return F;
|
|
70
87
|
let t = e.ownerDocument, n = t.createElement("div"), r = t.createElement("div");
|
|
71
|
-
return n.dir = "rtl", n.style.cssText = "position:absolute;inset:-9999px;width:4px;height:1px;overflow:scroll;", r.style.cssText = "width:8px;height:1px;", n.append(r), t.body.append(n), n.scrollLeft > 0 ?
|
|
88
|
+
return n.dir = "rtl", n.style.cssText = "position:absolute;inset:-9999px;width:4px;height:1px;overflow:scroll;", r.style.cssText = "width:8px;height:1px;", n.append(r), t.body.append(n), n.scrollLeft > 0 ? F = "default" : (n.scrollLeft = 1, F = n.scrollLeft === 0 ? "negative" : "reverse"), n.remove(), F;
|
|
72
89
|
}
|
|
73
|
-
function
|
|
90
|
+
function U(e, t) {
|
|
74
91
|
let n = e.scrollLeft;
|
|
75
|
-
if (getComputedStyle(e).direction !== "rtl") return
|
|
76
|
-
switch (
|
|
77
|
-
case "negative": return
|
|
78
|
-
case "reverse": return
|
|
79
|
-
case "default": return
|
|
92
|
+
if (getComputedStyle(e).direction !== "rtl") return V(n, t);
|
|
93
|
+
switch (H(e)) {
|
|
94
|
+
case "negative": return V(t + n, t);
|
|
95
|
+
case "reverse": return V(t - n, t);
|
|
96
|
+
case "default": return V(n, t);
|
|
80
97
|
}
|
|
81
98
|
}
|
|
82
|
-
function
|
|
83
|
-
let r =
|
|
99
|
+
function W(e, t, n) {
|
|
100
|
+
let r = V(t, n);
|
|
84
101
|
if (getComputedStyle(e).direction !== "rtl") return r;
|
|
85
|
-
switch (
|
|
102
|
+
switch (H(e)) {
|
|
86
103
|
case "negative": return r - n;
|
|
87
104
|
case "reverse": return n - r;
|
|
88
105
|
case "default": return r;
|
|
89
106
|
}
|
|
90
107
|
}
|
|
91
|
-
function
|
|
108
|
+
function G(e, t) {
|
|
92
109
|
let n = getComputedStyle(e);
|
|
93
110
|
return n.writingMode.startsWith("vertical") || n.writingMode.startsWith("sideways") ? Object.freeze({
|
|
94
111
|
inline: n.direction === "rtl" ? t.maxY - t.y : t.y,
|
|
@@ -102,13 +119,13 @@ var b = [
|
|
|
102
119
|
maxBlock: t.maxY
|
|
103
120
|
});
|
|
104
121
|
}
|
|
105
|
-
function
|
|
122
|
+
function K(e) {
|
|
106
123
|
let t = Math.max(0, e.scrollWidth - e.clientWidth), n = Math.max(0, e.scrollHeight - e.clientHeight), r = Object.freeze({
|
|
107
|
-
x:
|
|
108
|
-
y:
|
|
124
|
+
x: U(e, t),
|
|
125
|
+
y: V(e.scrollTop, n),
|
|
109
126
|
maxX: t,
|
|
110
127
|
maxY: n
|
|
111
|
-
}), i =
|
|
128
|
+
}), i = G(e, r);
|
|
112
129
|
return Object.freeze({
|
|
113
130
|
physical: r,
|
|
114
131
|
semantic: i,
|
|
@@ -118,56 +135,58 @@ var b = [
|
|
|
118
135
|
atBlockEnd: i.maxBlock - i.block <= 1
|
|
119
136
|
});
|
|
120
137
|
}
|
|
121
|
-
function
|
|
122
|
-
|
|
138
|
+
function q() {
|
|
139
|
+
if (!N) return;
|
|
140
|
+
let e = E.value;
|
|
123
141
|
if (!e) return;
|
|
124
|
-
let t =
|
|
125
|
-
n !==
|
|
142
|
+
let t = K(e), n = JSON.stringify(t);
|
|
143
|
+
n !== P && (P = n, O.value = t, T("scroll-state", t));
|
|
126
144
|
}
|
|
127
|
-
function
|
|
128
|
-
let t =
|
|
145
|
+
function J(e) {
|
|
146
|
+
let t = E.value;
|
|
129
147
|
if (t) return t;
|
|
130
148
|
throw Error(`SScrollViewport: ${e} недоступен до mount. / SScrollViewport: ${e} is unavailable before mount.`);
|
|
131
149
|
}
|
|
132
|
-
function
|
|
133
|
-
return
|
|
150
|
+
function Y(e) {
|
|
151
|
+
return I.value.axis === e || I.value.axis === "both";
|
|
134
152
|
}
|
|
135
|
-
function
|
|
136
|
-
if (!
|
|
153
|
+
function X(e, t) {
|
|
154
|
+
if (!Y(e)) throw Error(`SScrollViewport: ${t} не может управлять осью ${e} при axis=${I.value.axis}. / SScrollViewport: ${t} cannot control axis ${e} when axis=${I.value.axis}.`);
|
|
137
155
|
}
|
|
138
|
-
function
|
|
139
|
-
if (!
|
|
140
|
-
|
|
156
|
+
function Z() {
|
|
157
|
+
if (!I.value.focusable) throw Error("SScrollViewport: focus() требует focusable=true. / SScrollViewport: focus() requires focusable=true.");
|
|
158
|
+
if (!z.value) throw Error("SScrollViewport: focus() при focusPolicy=overflow требует переполнения разрешённой оси. / SScrollViewport: focus() with focusPolicy=overflow requires enabled-axis overflow.");
|
|
159
|
+
J("focus()").focus();
|
|
141
160
|
}
|
|
142
|
-
function
|
|
143
|
-
let
|
|
144
|
-
|
|
145
|
-
let a =
|
|
161
|
+
function ne(e, t) {
|
|
162
|
+
let n = r("SScrollViewport", "scrollToBoundary.axis", e, ["x", "y"]), i = r("SScrollViewport", "scrollToBoundary.boundary", t, ["start", "end"]);
|
|
163
|
+
X(n, "scrollToBoundary()");
|
|
164
|
+
let a = J("scrollToBoundary()"), o = K(a).physical, s = n === "x" ? i === "start" ? 0 : o.maxX : o.x, c = n === "y" ? i === "start" ? 0 : o.maxY : o.y;
|
|
146
165
|
a.scrollTo({
|
|
147
|
-
left:
|
|
166
|
+
left: W(a, s, o.maxX),
|
|
148
167
|
top: c,
|
|
149
168
|
behavior: "auto"
|
|
150
|
-
}),
|
|
169
|
+
}), q();
|
|
151
170
|
}
|
|
152
|
-
function
|
|
171
|
+
function re(e) {
|
|
153
172
|
if (typeof e != "object" || !e || Array.isArray(e)) throw TypeError("SScrollViewport: reveal.options должен быть объектом. / SScrollViewport: reveal.options must be an object.");
|
|
154
173
|
if (e.x === void 0 && e.y === void 0) throw Error("SScrollViewport: reveal() требует x и/или y. / SScrollViewport: reveal() requires x and/or y.");
|
|
155
|
-
e.x !== void 0 &&
|
|
156
|
-
let
|
|
174
|
+
e.x !== void 0 && X("x", "reveal()"), e.y !== void 0 && X("y", "reveal()");
|
|
175
|
+
let n = J("reveal()"), i = K(n).physical, a = e.x === void 0 ? i.x : t("SScrollViewport", "reveal.x", e.x, {
|
|
157
176
|
minimum: 0,
|
|
158
177
|
maximum: 2 ** 53 - 1
|
|
159
178
|
}), o = e.y === void 0 ? i.y : t("SScrollViewport", "reveal.y", e.y, {
|
|
160
179
|
minimum: 0,
|
|
161
180
|
maximum: 2 ** 53 - 1
|
|
162
|
-
}), s =
|
|
163
|
-
|
|
164
|
-
left:
|
|
165
|
-
top:
|
|
181
|
+
}), s = r("SScrollViewport", "reveal.behavior", e.behavior ?? "auto", ["auto", "smooth"]);
|
|
182
|
+
n.scrollTo({
|
|
183
|
+
left: W(n, a, i.maxX),
|
|
184
|
+
top: V(o, i.maxY),
|
|
166
185
|
behavior: s
|
|
167
|
-
}),
|
|
186
|
+
}), q();
|
|
168
187
|
}
|
|
169
|
-
function
|
|
170
|
-
let n =
|
|
188
|
+
function ie(e, t) {
|
|
189
|
+
let n = Y("x"), r = Y("y"), i = Math.max(1, e.clientWidth / 8), a = Math.max(1, e.clientHeight / 8), o = Math.max(1, e.clientWidth * .9), s = Math.max(1, e.clientHeight * .9), c = K(e).physical;
|
|
171
190
|
switch (t.key) {
|
|
172
191
|
case "ArrowLeft": return n ? {
|
|
173
192
|
left: c.x - i,
|
|
@@ -210,64 +229,96 @@ var b = [
|
|
|
210
229
|
default: return null;
|
|
211
230
|
}
|
|
212
231
|
}
|
|
213
|
-
function
|
|
214
|
-
let t =
|
|
215
|
-
|
|
216
|
-
|
|
232
|
+
function ae(e) {
|
|
233
|
+
let t = E.value;
|
|
234
|
+
t && e.target === t && (k.value = t.matches(":focus"));
|
|
235
|
+
}
|
|
236
|
+
function oe(e) {
|
|
237
|
+
e.target === E.value && (k.value = !1);
|
|
238
|
+
}
|
|
239
|
+
function se(e) {
|
|
240
|
+
let t = E.value;
|
|
241
|
+
if (!t || !z.value || !I.value.keyboardNavigation || e.target !== t || e.defaultPrevented || e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) return;
|
|
242
|
+
let n = ie(t, e);
|
|
217
243
|
if (!n) return;
|
|
218
244
|
e.preventDefault();
|
|
219
|
-
let r =
|
|
245
|
+
let r = K(t).physical;
|
|
220
246
|
t.scrollTo({
|
|
221
|
-
left:
|
|
222
|
-
top:
|
|
247
|
+
left: W(t, n.left, r.maxX),
|
|
248
|
+
top: V(n.top, r.maxY),
|
|
223
249
|
behavior: "auto"
|
|
224
|
-
}),
|
|
250
|
+
}), q();
|
|
225
251
|
}
|
|
226
|
-
function
|
|
227
|
-
|
|
252
|
+
function Q() {
|
|
253
|
+
q();
|
|
254
|
+
}
|
|
255
|
+
function $() {
|
|
256
|
+
let e = D.value;
|
|
257
|
+
if (N && e && A) {
|
|
258
|
+
for (let t of M) t.parentElement !== e && (A.unobserve(t), M.delete(t));
|
|
259
|
+
for (let t of e.children) M.has(t) || (A.observe(t), M.add(t));
|
|
260
|
+
}
|
|
228
261
|
}
|
|
229
|
-
|
|
230
|
-
|
|
262
|
+
function ce() {
|
|
263
|
+
$(), q();
|
|
264
|
+
}
|
|
265
|
+
return h(() => {
|
|
266
|
+
let e = J("observer setup"), t = D.value;
|
|
231
267
|
if (!t) throw Error("SScrollViewport: content owner отсутствует после mount. / SScrollViewport: content owner is missing after mount.");
|
|
232
268
|
if (typeof ResizeObserver > "u") throw Error("SScrollViewport: runtime требует ResizeObserver. / SScrollViewport: runtime requires ResizeObserver.");
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
269
|
+
if (typeof MutationObserver > "u") throw Error("SScrollViewport: runtime требует MutationObserver. / SScrollViewport: runtime requires MutationObserver.");
|
|
270
|
+
N = !0, e.addEventListener("scroll", Q, { passive: !0 }), t.addEventListener("load", q, !0), A = new ResizeObserver(q), A.observe(e), A.observe(t), $(), j = new MutationObserver(ce), j.observe(t, {
|
|
271
|
+
subtree: !0,
|
|
272
|
+
childList: !0,
|
|
273
|
+
characterData: !0,
|
|
274
|
+
attributes: !0
|
|
275
|
+
}), q();
|
|
276
|
+
}), b(() => [
|
|
277
|
+
I.value.axis,
|
|
278
|
+
I.value.blockSize,
|
|
279
|
+
I.value.maxBlockSize,
|
|
280
|
+
I.value.focusPolicy,
|
|
281
|
+
I.value.accessibleLabel,
|
|
282
|
+
I.value.accessibleLabelledby,
|
|
283
|
+
I.value.focusable,
|
|
284
|
+
I.value.keyboardNavigation,
|
|
285
|
+
I.value.overscrollBehavior
|
|
240
286
|
], async () => {
|
|
241
|
-
await
|
|
242
|
-
}),
|
|
243
|
-
|
|
244
|
-
}),
|
|
245
|
-
focus:
|
|
246
|
-
scrollToBoundary:
|
|
247
|
-
reveal:
|
|
248
|
-
}), (e, t) => (
|
|
287
|
+
await p(), q();
|
|
288
|
+
}), m(() => {
|
|
289
|
+
N = !1, E.value?.removeEventListener("scroll", Q), D.value?.removeEventListener("load", q, !0), j?.disconnect(), j = null, A?.disconnect(), A = null, M.clear(), P = "";
|
|
290
|
+
}), S({
|
|
291
|
+
focus: Z,
|
|
292
|
+
scrollToBoundary: ne,
|
|
293
|
+
reveal: re
|
|
294
|
+
}), (e, t) => (g(), ee("div", f(y(te).bindings(), {
|
|
249
295
|
ref_key: "viewportRef",
|
|
250
|
-
ref:
|
|
296
|
+
ref: E,
|
|
251
297
|
class: "s-scroll-viewport",
|
|
252
|
-
role: "region",
|
|
253
|
-
"aria-label":
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
"data-
|
|
257
|
-
"data-
|
|
258
|
-
"data-
|
|
259
|
-
"data-
|
|
260
|
-
"data-
|
|
261
|
-
"data-
|
|
262
|
-
"data-
|
|
263
|
-
"data-at-
|
|
264
|
-
|
|
265
|
-
|
|
298
|
+
role: R.value ? "region" : void 0,
|
|
299
|
+
"aria-label": R.value ? I.value.accessibleLabel : void 0,
|
|
300
|
+
"aria-labelledby": R.value ? I.value.accessibleLabelledby : void 0,
|
|
301
|
+
tabindex: B.value,
|
|
302
|
+
"data-axis": I.value.axis,
|
|
303
|
+
"data-block-size": I.value.blockSize,
|
|
304
|
+
"data-max-block-size": I.value.maxBlockSize,
|
|
305
|
+
"data-focus-policy": I.value.focusPolicy,
|
|
306
|
+
"data-focusable": z.value,
|
|
307
|
+
"data-keyboard-navigation": I.value.keyboardNavigation,
|
|
308
|
+
"data-overscroll-behavior": I.value.overscrollBehavior,
|
|
309
|
+
"data-at-inline-start": O.value?.atInlineStart,
|
|
310
|
+
"data-at-inline-end": O.value?.atInlineEnd,
|
|
311
|
+
"data-at-block-start": O.value?.atBlockStart,
|
|
312
|
+
"data-at-block-end": O.value?.atBlockEnd,
|
|
313
|
+
onFocus: ae,
|
|
314
|
+
onBlur: oe,
|
|
315
|
+
onKeydown: se
|
|
316
|
+
}), [u("div", {
|
|
266
317
|
ref_key: "contentRef",
|
|
267
|
-
ref:
|
|
318
|
+
ref: D,
|
|
268
319
|
class: "s-scroll-viewport__content"
|
|
269
|
-
}, [
|
|
320
|
+
}, [_(e.$slots, "default", {}, void 0, !0)], 512)], 16, x));
|
|
270
321
|
}
|
|
271
322
|
});
|
|
272
323
|
//#endregion
|
|
273
|
-
export {
|
|
324
|
+
export { S as default };
|