@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
package/dist/src/components/shared/containers/SPopover.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
import { lastItem as e } from "../../../internal/es2020.js";
|
|
2
2
|
import { findRelativeTabTarget as t, getFocusableElements as n } from "../../../internal/focusNavigation.js";
|
|
3
|
-
import {
|
|
4
|
-
import { useOverlayAdmission as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
3
|
+
import { captureLayerFocusAdmission as r, registerLayer as i } from "../../../internal/layerStack.js";
|
|
4
|
+
import { useOverlayAdmission as a } from "../../../internal/overlayHost.js";
|
|
5
|
+
import { useOverlayPortalTarget as o } from "../../../internal/overlayPortal.js";
|
|
6
|
+
import { useFloatingPosition as s } from "../../../composables/useFloatingPosition.js";
|
|
7
|
+
import { useUiKitLocale as c } from "../../../composables/useUiKitLocale.js";
|
|
8
|
+
import { useOwnedAttrs as ee } from "../../../internal/ownedAttrs.js";
|
|
9
|
+
import { useInteractiveLeafRegistration as te } from "../../../internal/passiveContentContract.js";
|
|
9
10
|
import l from "../controls/SButton.vue.js";
|
|
10
|
-
import { resolveInteractiveElement as
|
|
11
|
-
import { Teleport as
|
|
11
|
+
import { resolveInteractiveElement as ne } from "../../../internal/interactiveElement.js";
|
|
12
|
+
import { Teleport as re, Transition as ie, computed as u, createBlock as ae, createCommentVNode as oe, createElementBlock as se, createElementVNode as ce, createVNode as le, defineComponent as d, mergeProps as ue, nextTick as f, normalizeStyle as de, onBeforeUnmount as fe, onMounted as pe, onUpdated as me, openBlock as p, ref as m, renderSlot as h, shallowRef as he, unref as g, useId as ge, useSlots as _e, watch as _, withCtx as ve, withKeys as ye } from "vue";
|
|
12
13
|
//#region src/components/shared/containers/SPopover.vue?vue&type=script&setup=true&lang.ts
|
|
13
|
-
var
|
|
14
|
+
var be = { class: "s-popover relative block w-full" }, xe = [
|
|
14
15
|
"hidden",
|
|
15
16
|
"^inert",
|
|
16
17
|
"data-placement",
|
|
17
18
|
"data-surface",
|
|
18
19
|
"data-width",
|
|
19
20
|
"aria-label"
|
|
20
|
-
],
|
|
21
|
+
], Se = { class: "s-popover-content" }, Ce = "built-in", we = /*@__PURE__*/ d({
|
|
21
22
|
inheritAttrs: !1,
|
|
22
23
|
__name: "SPopover",
|
|
23
24
|
props: {
|
|
@@ -52,296 +53,317 @@ var ge = { class: "s-popover relative block w-full" }, _e = [
|
|
|
52
53
|
}
|
|
53
54
|
},
|
|
54
55
|
emits: ["update:open"],
|
|
55
|
-
setup(
|
|
56
|
-
let
|
|
56
|
+
setup(d, { expose: we, emit: Te }) {
|
|
57
|
+
let v = d, { t: Ee } = c(), De = u(() => v.ariaLabel ?? Ee("dialog.moreActions")), y = Te, b = _e(), Oe = ee({
|
|
57
58
|
component: "SPopover",
|
|
58
59
|
owner: "root wrapper"
|
|
59
60
|
});
|
|
60
|
-
if (
|
|
61
|
-
if (!
|
|
62
|
-
let
|
|
63
|
-
|
|
61
|
+
if (b.trigger && b.default) throw Error("SPopover: default slot is reserved for built-in SButton content and cannot be combined with #trigger; move popover content to #panel");
|
|
62
|
+
if (!b.panel) throw Error("SPopover: #panel slot is required");
|
|
63
|
+
let x = v.open !== void 0, S = a(), C = o(), w = m(!1), T = m(!1), E = he(null), D = u(() => S.value && C.value !== null && !T.value && (v.open ?? w.value));
|
|
64
|
+
te({
|
|
64
65
|
owner: "SPopover",
|
|
65
|
-
active: () =>
|
|
66
|
+
active: () => D.value
|
|
66
67
|
});
|
|
67
|
-
let
|
|
68
|
-
active:
|
|
69
|
-
placement: () =>
|
|
68
|
+
let O = `s-popover-panel-${ge()}`, k = m(null), A = m("var(--s-layer-root-floating)"), ke = u(() => v.triggerAriaLabel ?? (v.triggerIconOnly || !v.triggerLabel && !b.default ? De.value : void 0)), j = null, M = null, N = null, P = null, F = null, I = 0, L = null, Ae = u(() => v.align === "left" ? "bottom-start" : v.align === "center" ? "bottom-center" : "bottom-end"), { anchorRef: R, panelRef: z, floatingStyle: je, resolvedPlacement: Me, updatePosition: B } = s({
|
|
69
|
+
active: D,
|
|
70
|
+
placement: () => Ae.value,
|
|
70
71
|
offset: () => 6,
|
|
71
72
|
boundaryPadding: () => 8,
|
|
72
73
|
flip: () => !0,
|
|
73
74
|
shift: () => !0,
|
|
74
75
|
constrainMainAxis: () => !0,
|
|
75
|
-
widthMatch: () =>
|
|
76
|
-
zIndex: () =>
|
|
76
|
+
widthMatch: () => v.width === "trigger" ? "min" : "none",
|
|
77
|
+
zIndex: () => A.value,
|
|
77
78
|
scrollStrategy: "reposition"
|
|
78
|
-
})
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
});
|
|
80
|
+
_(z, () => j?.refreshModality(), { flush: "sync" });
|
|
81
|
+
let Ne = u(() => !S.value || C.value === null || E.value !== null && E.value === z.value);
|
|
82
|
+
function Pe() {
|
|
83
|
+
let e = z.value;
|
|
81
84
|
if (!e) return;
|
|
82
|
-
|
|
85
|
+
E.value = e, e.hidden = !0, e.setAttribute("inert", "");
|
|
83
86
|
let t = e.ownerDocument.activeElement;
|
|
84
87
|
t instanceof HTMLElement && e.contains(t) && t.blur();
|
|
85
88
|
}
|
|
86
|
-
class
|
|
89
|
+
class Fe {
|
|
87
90
|
constructor(e, t) {
|
|
88
91
|
this.id = e, this.activation = t, this.target = null, this.binding = {
|
|
89
|
-
ref: (e) =>
|
|
92
|
+
ref: (e) => Re(this, e),
|
|
90
93
|
get "aria-expanded"() {
|
|
91
|
-
return
|
|
94
|
+
return D.value && k.value === e;
|
|
92
95
|
},
|
|
93
96
|
get disclosure() {
|
|
94
97
|
return {
|
|
95
|
-
expanded:
|
|
96
|
-
controls:
|
|
98
|
+
expanded: D.value && k.value === e,
|
|
99
|
+
controls: O,
|
|
97
100
|
iconPlacement: "none"
|
|
98
101
|
};
|
|
99
102
|
},
|
|
100
103
|
"aria-haspopup": "dialog",
|
|
101
|
-
"aria-controls":
|
|
102
|
-
onClick: (e) =>
|
|
104
|
+
"aria-controls": O,
|
|
105
|
+
onClick: (e) => Ke(this, e)
|
|
103
106
|
};
|
|
104
107
|
}
|
|
105
108
|
element() {
|
|
106
|
-
return
|
|
109
|
+
return Le(this.target, this.id);
|
|
107
110
|
}
|
|
108
111
|
}
|
|
109
|
-
let
|
|
110
|
-
function
|
|
112
|
+
let V = /* @__PURE__ */ new Map();
|
|
113
|
+
function Ie(e) {
|
|
111
114
|
if (e.length === 0 || e.trim() !== e) throw Error("SPopover: trigger id must be a non-empty string without surrounding whitespace");
|
|
112
115
|
}
|
|
113
|
-
function
|
|
114
|
-
return
|
|
116
|
+
function Le(e, t) {
|
|
117
|
+
return ne(`SPopover: trigger "${t}"`, e);
|
|
115
118
|
}
|
|
116
|
-
function
|
|
119
|
+
function Re(e, t) {
|
|
117
120
|
if (t === null) {
|
|
118
121
|
e.target = null;
|
|
119
122
|
return;
|
|
120
123
|
}
|
|
121
124
|
if (e.target && e.target !== t) throw Error(`SPopover: trigger id "${e.id}" is bound to multiple elements`);
|
|
122
|
-
for (let n of
|
|
125
|
+
for (let n of V.values()) if (n !== e && n.target === t) throw Error(`SPopover: one trigger element cannot use both "${n.id}" and "${e.id}" ids`);
|
|
123
126
|
e.target = t;
|
|
124
127
|
}
|
|
125
|
-
function
|
|
126
|
-
|
|
127
|
-
let n =
|
|
128
|
+
function ze(e, t = "toggle") {
|
|
129
|
+
Ie(e);
|
|
130
|
+
let n = V.get(e);
|
|
128
131
|
if (n) {
|
|
129
132
|
if (n.activation !== t) throw Error(`SPopover: trigger "${e}" activation cannot change from "${n.activation}" to "${t}"`);
|
|
130
133
|
return n.binding;
|
|
131
134
|
}
|
|
132
|
-
let r = new
|
|
133
|
-
return
|
|
135
|
+
let r = new Fe(e, t);
|
|
136
|
+
return V.set(e, r), r.binding;
|
|
134
137
|
}
|
|
135
|
-
let
|
|
136
|
-
function
|
|
138
|
+
let Be = b.trigger ? void 0 : ze(Ce);
|
|
139
|
+
function Ve(e) {
|
|
137
140
|
return /* @__PURE__ */ Error(`SPopover: custom trigger "${e}" must apply the complete object returned by bindTrigger()`);
|
|
138
141
|
}
|
|
139
|
-
function
|
|
142
|
+
function H(e) {
|
|
140
143
|
let t = e.element();
|
|
141
|
-
if (!t) throw
|
|
142
|
-
if (
|
|
143
|
-
if (t.getAttribute("aria-haspopup") !== "dialog" || t.getAttribute("aria-controls") !==
|
|
144
|
+
if (!t) throw Ve(e.id);
|
|
145
|
+
if (b.trigger && !(t instanceof HTMLButtonElement)) throw Error(`SPopover: custom trigger "${e.id}" must bind directly to a button element, not to a wrapper`);
|
|
146
|
+
if (t.getAttribute("aria-haspopup") !== "dialog" || t.getAttribute("aria-controls") !== O || t.getAttribute("aria-expanded") !== String(D.value && k.value === e.id)) throw Ve(e.id);
|
|
144
147
|
return t;
|
|
145
148
|
}
|
|
146
|
-
function
|
|
147
|
-
if (
|
|
148
|
-
for (let e of
|
|
149
|
+
function He() {
|
|
150
|
+
if (V.size === 0) throw Error("SPopover: #trigger must apply a binding returned by bindTrigger()");
|
|
151
|
+
for (let e of V.values()) H(e);
|
|
149
152
|
}
|
|
150
|
-
function
|
|
151
|
-
return [...
|
|
153
|
+
function Ue() {
|
|
154
|
+
return [...V.values()].filter((e) => e.element()?.isConnected).map((e) => e.id).sort((e, t) => e.localeCompare(t));
|
|
152
155
|
}
|
|
153
|
-
function
|
|
156
|
+
function U(e) {
|
|
154
157
|
if (e !== void 0) {
|
|
155
|
-
|
|
156
|
-
let t =
|
|
158
|
+
Ie(e);
|
|
159
|
+
let t = V.get(e);
|
|
157
160
|
if (!t?.element()?.isConnected) throw Error(`SPopover: programmatic open requires a registered trigger with id "${e}"`);
|
|
158
|
-
return
|
|
161
|
+
return H(t), t;
|
|
159
162
|
}
|
|
160
|
-
let t =
|
|
163
|
+
let t = Ue();
|
|
161
164
|
if (t.length === 0) throw Error("SPopover: programmatic open requires one registered trigger anchor");
|
|
162
165
|
if (t.length > 1) throw Error(`SPopover: programmatic open is ambiguous; pass one of the registered trigger ids: ${t.map((e) => `"${e}"`).join(", ")}`);
|
|
163
166
|
let [n] = t;
|
|
164
167
|
if (!n) throw Error("SPopover: registered trigger inventory is unexpectedly empty");
|
|
165
|
-
let r =
|
|
168
|
+
let r = V.get(n);
|
|
166
169
|
if (!r) throw Error("SPopover: registered trigger invariant failed");
|
|
167
|
-
return
|
|
170
|
+
return H(r), r;
|
|
168
171
|
}
|
|
169
|
-
function
|
|
170
|
-
let t =
|
|
171
|
-
return
|
|
172
|
+
function W(e) {
|
|
173
|
+
let t = H(e);
|
|
174
|
+
return k.value = e.id, R.value = t, t;
|
|
172
175
|
}
|
|
173
|
-
function
|
|
174
|
-
return
|
|
176
|
+
function G(e) {
|
|
177
|
+
return V.get(e.trigger.id) === e.trigger && k.value === e.trigger.id && e.trigger.element() === e.anchor && e.anchor.isConnected;
|
|
175
178
|
}
|
|
176
|
-
function
|
|
177
|
-
if (
|
|
178
|
-
let e =
|
|
179
|
-
|
|
179
|
+
function K() {
|
|
180
|
+
if (T.value) return;
|
|
181
|
+
let e = M === null;
|
|
182
|
+
T.value = !0, w.value = !1, M = null, Y("outside"), e && y("update:open", !1);
|
|
180
183
|
}
|
|
181
|
-
async function
|
|
182
|
-
let
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
return;
|
|
184
|
+
async function q(e, t = r(), n) {
|
|
185
|
+
let a = ++I;
|
|
186
|
+
F?.(), F = null, j?.unregister({ restoreFocus: !1 }), j = null, P?.cancel(), P = t;
|
|
187
|
+
try {
|
|
188
|
+
if (z.value?.isConnected || await f(), I !== a || !D.value) return;
|
|
189
|
+
if (n && !G(n)) {
|
|
190
|
+
K();
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
let r = z.value;
|
|
194
|
+
if (!e.isConnected || !r?.isConnected) throw Error("SPopover: open layer requires connected native anchor and panel");
|
|
195
|
+
if (j = i({
|
|
196
|
+
kind: "popover",
|
|
197
|
+
root: () => z.value,
|
|
198
|
+
anchor: () => R.value,
|
|
199
|
+
branches: () => [...V.values()].map((e) => e.element()).filter((e) => !!e?.isConnected),
|
|
200
|
+
restoreTarget: e,
|
|
201
|
+
focusAdmission: t,
|
|
202
|
+
requestDismiss: (e) => Q(e === "escape" ? "escape" : "outside"),
|
|
203
|
+
onRetire: K
|
|
204
|
+
}), A.value = j.zIndex, B(), await f(), I !== a || !D.value || !j?.isTopmost()) return;
|
|
205
|
+
if (n && !G(n)) {
|
|
206
|
+
K();
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
let o = z.value, s = L;
|
|
210
|
+
if (L = null, o !== r || !o.isConnected || s !== o) return;
|
|
211
|
+
j.claimFocus(o);
|
|
212
|
+
} finally {
|
|
213
|
+
t?.cancel(), P === t && (P = null);
|
|
202
214
|
}
|
|
203
|
-
let o = V.value, s = z;
|
|
204
|
-
if (z = null, o !== a || !o.isConnected || s !== o) return;
|
|
205
|
-
let c = document.activeElement, l = t instanceof HTMLElement && !t.isConnected && c === document.body;
|
|
206
|
-
(c === t || l) && o.focus({ preventScroll: !0 });
|
|
207
215
|
}
|
|
208
|
-
function
|
|
209
|
-
if (
|
|
210
|
-
let e =
|
|
216
|
+
function We() {
|
|
217
|
+
if (k.value !== null) {
|
|
218
|
+
let e = V.get(k.value);
|
|
211
219
|
if (e?.element()?.isConnected) return e;
|
|
212
220
|
}
|
|
213
|
-
return
|
|
221
|
+
return U();
|
|
214
222
|
}
|
|
215
|
-
function
|
|
216
|
-
let e =
|
|
217
|
-
if (
|
|
218
|
-
if (!
|
|
219
|
-
|
|
223
|
+
function J() {
|
|
224
|
+
let e = N;
|
|
225
|
+
if (N = null, e) {
|
|
226
|
+
if (!G(e)) {
|
|
227
|
+
e.focusAdmission?.cancel(), K();
|
|
220
228
|
return;
|
|
221
229
|
}
|
|
222
|
-
|
|
230
|
+
W(e.trigger), q(e.anchor, e.focusAdmission, e);
|
|
223
231
|
return;
|
|
224
232
|
}
|
|
225
|
-
|
|
233
|
+
q(W(We()));
|
|
226
234
|
}
|
|
227
|
-
function
|
|
235
|
+
function Ge(e) {
|
|
228
236
|
if (!(e instanceof HTMLElement)) throw Error("SPopover: transition enter target must be an HTMLElement");
|
|
229
|
-
|
|
237
|
+
D.value && e === z.value && e.isConnected && (L = e);
|
|
230
238
|
}
|
|
231
239
|
function Y(e) {
|
|
232
|
-
|
|
233
|
-
let t =
|
|
234
|
-
|
|
240
|
+
I += 1, N?.focusAdmission?.cancel(), N = null, P?.cancel(), P = null, L = null, e !== "tab" && (F?.(), F = null);
|
|
241
|
+
let t = S.value && (e === "explicit" || e === "escape" || e === "trigger");
|
|
242
|
+
j?.unregister({
|
|
235
243
|
restoreFocus: t,
|
|
236
244
|
commitFocusHandoff: e === "tab"
|
|
237
|
-
}),
|
|
245
|
+
}), j = null, A.value = "var(--s-layer-root-floating)";
|
|
238
246
|
}
|
|
239
247
|
function X() {
|
|
240
|
-
if (
|
|
248
|
+
if (v.open !== void 0 !== x) throw Error("SPopover: open control mode cannot change after mount");
|
|
241
249
|
}
|
|
242
|
-
function
|
|
250
|
+
function Ke(e, t) {
|
|
243
251
|
if (e.activation === "manual") {
|
|
244
|
-
|
|
252
|
+
W(e), D.value && f(B);
|
|
245
253
|
return;
|
|
246
254
|
}
|
|
247
|
-
if (
|
|
255
|
+
if (D.value && k.value === e.id) {
|
|
248
256
|
Q("trigger");
|
|
249
257
|
return;
|
|
250
258
|
}
|
|
251
|
-
if (
|
|
252
|
-
|
|
259
|
+
if (D.value) {
|
|
260
|
+
q(W(e));
|
|
253
261
|
return;
|
|
254
262
|
}
|
|
255
263
|
Z(e.id);
|
|
256
264
|
}
|
|
257
265
|
function Z(e) {
|
|
258
|
-
if (
|
|
259
|
-
if (
|
|
260
|
-
let t =
|
|
261
|
-
if (
|
|
266
|
+
if (S.value && C.value !== null && !(T.value && x)) {
|
|
267
|
+
if (T.value = !1, !D.value && !v.disabled) {
|
|
268
|
+
let t = U(e), n = W(t), i = r();
|
|
269
|
+
if (N?.focusAdmission?.cancel(), x && (N = {
|
|
262
270
|
trigger: t,
|
|
263
271
|
anchor: n,
|
|
264
|
-
|
|
265
|
-
}),
|
|
266
|
-
|
|
272
|
+
focusAdmission: i
|
|
273
|
+
}), y("update:open", !0), x) return;
|
|
274
|
+
w.value = !0, q(n, i);
|
|
267
275
|
return;
|
|
268
276
|
}
|
|
269
|
-
|
|
277
|
+
D.value && e !== void 0 && e !== k.value && q(W(U(e)));
|
|
270
278
|
}
|
|
271
279
|
}
|
|
272
280
|
function Q(e = "explicit") {
|
|
273
|
-
let t =
|
|
274
|
-
if (
|
|
275
|
-
Y(e),
|
|
281
|
+
let t = D.value, n = N;
|
|
282
|
+
if (n?.focusAdmission?.cancel(), N = null, !t && n) {
|
|
283
|
+
Y(e), y("update:open", !1);
|
|
276
284
|
return;
|
|
277
285
|
}
|
|
278
|
-
if (t &&
|
|
279
|
-
if (
|
|
280
|
-
|
|
286
|
+
if (t && M === null) {
|
|
287
|
+
if (M = e, y("update:open", !1), x) return;
|
|
288
|
+
w.value = !1, Y(e), M = null;
|
|
281
289
|
}
|
|
282
290
|
}
|
|
283
291
|
function $() {
|
|
284
292
|
Q("explicit");
|
|
285
293
|
}
|
|
286
|
-
function
|
|
287
|
-
let i =
|
|
294
|
+
function qe(r) {
|
|
295
|
+
let i = z.value, a = R.value;
|
|
288
296
|
if (!i || !a) return;
|
|
289
|
-
let o = n(i), s = document.activeElement, c = o[0],
|
|
290
|
-
if (!(o.length === 0 || (r.shiftKey ? s === i || s === c : s ===
|
|
291
|
-
let
|
|
292
|
-
r.preventDefault(),
|
|
297
|
+
let o = n(i), s = document.activeElement, c = o[0], ee = e(o);
|
|
298
|
+
if (!(o.length === 0 || (r.shiftKey ? s === i || s === c : s === ee))) return;
|
|
299
|
+
let te = j?.focusScope() ?? document, l = t(a, te, i, r.shiftKey);
|
|
300
|
+
r.preventDefault(), F?.(), F = l && j ? j.handoffFocus(l) : null, Q("tab");
|
|
293
301
|
}
|
|
294
|
-
function
|
|
295
|
-
if (!
|
|
302
|
+
function Je(e) {
|
|
303
|
+
if (!D.value) return;
|
|
296
304
|
let t = e.relatedTarget;
|
|
297
|
-
t instanceof Node
|
|
305
|
+
if (t instanceof Node) {
|
|
306
|
+
if (j?.containsFocusTarget(t)) return;
|
|
307
|
+
Q("outside");
|
|
308
|
+
return;
|
|
309
|
+
}
|
|
310
|
+
let n = j, r = z.value, i = I, a = e.composedPath().find((e) => e instanceof Element), o = a instanceof Element ? n?.captureOwnedFocusLoss(a) : null;
|
|
311
|
+
queueMicrotask(() => {
|
|
312
|
+
if (!D.value || M !== null || I !== i || j !== n || z.value !== r || !r?.isConnected) return;
|
|
313
|
+
let e = document.activeElement;
|
|
314
|
+
e && n?.containsFocusTarget(e) || o?.isCurrentUnavailable() || Q("outside");
|
|
315
|
+
});
|
|
298
316
|
}
|
|
299
|
-
return
|
|
300
|
-
|
|
301
|
-
}),
|
|
317
|
+
return pe(() => {
|
|
318
|
+
He(), D.value && J();
|
|
319
|
+
}), me(() => {
|
|
302
320
|
X();
|
|
303
|
-
}),
|
|
304
|
-
e === !1 && (X(),
|
|
305
|
-
}, { flush: "pre" }),
|
|
306
|
-
if (X(), e && !
|
|
307
|
-
|
|
321
|
+
}), _(() => v.open, (e) => {
|
|
322
|
+
e === !1 && (X(), T.value = !1, Y(M ?? "explicit"), M = null);
|
|
323
|
+
}, { flush: "pre" }), _(() => v.open, (e) => {
|
|
324
|
+
if (X(), e && !S.value) {
|
|
325
|
+
K();
|
|
308
326
|
return;
|
|
309
327
|
}
|
|
310
|
-
|
|
311
|
-
}, { flush: "post" }),
|
|
312
|
-
e || (
|
|
328
|
+
T.value || e && C.value !== null && J();
|
|
329
|
+
}, { flush: "post" }), _(S, (e) => {
|
|
330
|
+
e || (Pe(), (v.open === !0 || w.value || N || j) && K());
|
|
313
331
|
}, {
|
|
314
332
|
flush: "sync",
|
|
315
333
|
immediate: !0
|
|
316
|
-
}),
|
|
317
|
-
|
|
318
|
-
}),
|
|
334
|
+
}), _(C, (e, t) => {
|
|
335
|
+
e === null && t !== null && (Pe(), (v.open === !0 || w.value || N || j) && K());
|
|
336
|
+
}, { flush: "sync" }), _(C, (e, t) => {
|
|
337
|
+
e !== null && D.value && (t === null ? J() : (j?.refreshModality(), B()));
|
|
338
|
+
}, { flush: "post" }), fe(() => {
|
|
339
|
+
I += 1, N?.focusAdmission?.cancel(), N = null, P?.cancel(), P = null, L = null, F?.(), j?.unregister({ restoreFocus: !1 }), j = null;
|
|
340
|
+
}), we({
|
|
319
341
|
open: Z,
|
|
320
342
|
close: $
|
|
321
|
-
}), (e, t) => (
|
|
322
|
-
bindTrigger:
|
|
343
|
+
}), (e, t) => (p(), se("div", ue(g(Oe).bindings(), { class: "s-popover-wrapper" }), [ce("div", be, [e.$slots.trigger ? h(e.$slots, "trigger", {
|
|
344
|
+
bindTrigger: ze,
|
|
323
345
|
open: Z,
|
|
324
346
|
close: $,
|
|
325
|
-
isOpen:
|
|
326
|
-
}, void 0, !0, 0) : (
|
|
347
|
+
isOpen: D.value
|
|
348
|
+
}, void 0, !0, 0) : (p(), ae(l, ue({ key: 1 }, g(Be), {
|
|
327
349
|
"data-s-popover-trigger": "",
|
|
328
|
-
label:
|
|
329
|
-
"leading-icon":
|
|
330
|
-
"trailing-icon":
|
|
331
|
-
"icon-only":
|
|
332
|
-
appearance:
|
|
333
|
-
size:
|
|
334
|
-
width:
|
|
335
|
-
"content-align":
|
|
336
|
-
shape:
|
|
337
|
-
severity:
|
|
338
|
-
badge:
|
|
339
|
-
disabled:
|
|
340
|
-
title:
|
|
341
|
-
"aria-label":
|
|
342
|
-
"data-testid":
|
|
350
|
+
label: d.triggerLabel,
|
|
351
|
+
"leading-icon": d.triggerLeadingIcon,
|
|
352
|
+
"trailing-icon": d.triggerTrailingIcon,
|
|
353
|
+
"icon-only": d.triggerIconOnly,
|
|
354
|
+
appearance: d.triggerAppearance,
|
|
355
|
+
size: d.triggerSize,
|
|
356
|
+
width: d.triggerWidth,
|
|
357
|
+
"content-align": d.triggerContentAlign,
|
|
358
|
+
shape: d.triggerShape,
|
|
359
|
+
severity: d.triggerSeverity,
|
|
360
|
+
badge: d.triggerBadge,
|
|
361
|
+
disabled: d.disabled,
|
|
362
|
+
title: d.triggerTitle,
|
|
363
|
+
"aria-label": ke.value,
|
|
364
|
+
"data-testid": d.triggerTestId
|
|
343
365
|
}), {
|
|
344
|
-
default:
|
|
366
|
+
default: ve(() => [h(e.$slots, "default", { isOpen: D.value }, void 0, !0)]),
|
|
345
367
|
_: 3
|
|
346
368
|
}, 16, [
|
|
347
369
|
"label",
|
|
@@ -359,37 +381,40 @@ var ge = { class: "s-popover relative block w-full" }, _e = [
|
|
|
359
381
|
"title",
|
|
360
382
|
"aria-label",
|
|
361
383
|
"data-testid"
|
|
362
|
-
])),
|
|
363
|
-
css:
|
|
364
|
-
"enter-active-class": "transition duration-[var(--s-motion-standard)] ease-out",
|
|
365
|
-
"enter-from-class": "translate-y-1
|
|
366
|
-
"enter-to-class": "translate-y-0
|
|
367
|
-
"leave-active-class": "pointer-events-none transition duration-[var(--s-motion-fast)] ease-in",
|
|
368
|
-
"leave-from-class": "translate-y-0
|
|
369
|
-
"leave-to-class": "translate-y-1
|
|
370
|
-
onEnter:
|
|
384
|
+
])), le(ie, {
|
|
385
|
+
css: g(S),
|
|
386
|
+
"enter-active-class": "transition-transform duration-[var(--s-motion-standard)] ease-out",
|
|
387
|
+
"enter-from-class": "translate-y-1",
|
|
388
|
+
"enter-to-class": "translate-y-0",
|
|
389
|
+
"leave-active-class": "pointer-events-none transition-transform duration-[var(--s-motion-fast)] ease-in",
|
|
390
|
+
"leave-from-class": "translate-y-0",
|
|
391
|
+
"leave-to-class": "translate-y-1",
|
|
392
|
+
onEnter: Ge
|
|
371
393
|
}, {
|
|
372
|
-
default:
|
|
394
|
+
default: ve(() => [g(C) ? (p(), ae(re, {
|
|
395
|
+
key: 0,
|
|
396
|
+
to: g(C)
|
|
397
|
+
}, [D.value ? (p(), se("div", {
|
|
373
398
|
key: 0,
|
|
374
399
|
ref_key: "panelRef",
|
|
375
|
-
ref:
|
|
376
|
-
hidden:
|
|
377
|
-
"^inert":
|
|
400
|
+
ref: z,
|
|
401
|
+
hidden: Ne.value,
|
|
402
|
+
"^inert": Ne.value ? !0 : void 0,
|
|
378
403
|
class: "s-popover-panel",
|
|
379
|
-
style:
|
|
380
|
-
"data-placement":
|
|
381
|
-
"data-surface":
|
|
382
|
-
"data-width":
|
|
404
|
+
style: de(g(je)),
|
|
405
|
+
"data-placement": g(Me),
|
|
406
|
+
"data-surface": d.surface,
|
|
407
|
+
"data-width": d.width,
|
|
383
408
|
tabindex: "-1",
|
|
384
409
|
role: "dialog",
|
|
385
|
-
id:
|
|
386
|
-
"aria-label":
|
|
387
|
-
onKeydown:
|
|
388
|
-
onFocusout:
|
|
389
|
-
}, [
|
|
410
|
+
id: O,
|
|
411
|
+
"aria-label": De.value,
|
|
412
|
+
onKeydown: ye(qe, ["tab"]),
|
|
413
|
+
onFocusout: Je
|
|
414
|
+
}, [ce("div", Se, [h(e.$slots, "panel", { close: $ }, void 0, !0)])], 44, xe)) : oe("", !0)], 8, ["to"])) : oe("", !0)]),
|
|
390
415
|
_: 3
|
|
391
416
|
}, 8, ["css"])])], 16));
|
|
392
417
|
}
|
|
393
418
|
});
|
|
394
419
|
//#endregion
|
|
395
|
-
export {
|
|
420
|
+
export { we as default };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import "../../../../assets/src/components/shared/containers/SSidebarSection.
|
|
1
|
+
import "../../../../assets/src/components/shared/containers/SSidebarSection.css_vue_type_style_index_0_src_52396e42_scoped_52396e42_lang.css";
|
|
2
2
|
import e from "../../../../_virtual/_plugin-vue_export-helper.js";
|
|
3
3
|
import t from "./SSidebarSection.vue_vue_type_script_setup_true_lang.js";
|
|
4
4
|
/* empty css */
|
|
5
5
|
//#region src/components/shared/containers/SSidebarSection.vue
|
|
6
|
-
var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-
|
|
6
|
+
var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-52396e42"]]);
|
|
7
7
|
//#endregion
|
|
8
8
|
export { n as default };
|
package/dist/src/components/shared/containers/SSidebarSection.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -103,10 +103,11 @@ var E = { class: "s-sidebar-section" }, D = { class: "s-sidebar-section-trigger"
|
|
|
103
103
|
let [t, n] = Z();
|
|
104
104
|
I.resizeSections(t.key, n.key, e);
|
|
105
105
|
}
|
|
106
|
-
function ne() {
|
|
106
|
+
function ne(e, t) {
|
|
107
|
+
if (t === void 0) return;
|
|
107
108
|
if (B === null) throw Error("SSidebarSection: resize completion has no active section pair");
|
|
108
|
-
let
|
|
109
|
-
B = null, I.finishResize(
|
|
109
|
+
let n = B;
|
|
110
|
+
B = null, I.finishResize(n[0], n[1]);
|
|
110
111
|
}
|
|
111
112
|
function $() {
|
|
112
113
|
let e = B;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import "../../../../assets/src/components/shared/controls/SCheckbox.
|
|
1
|
+
import "../../../../assets/src/components/shared/controls/SCheckbox.css_vue_type_style_index_0_src_2562f916_scoped_2562f916_lang.css";
|
|
2
2
|
import e from "../../../../_virtual/_plugin-vue_export-helper.js";
|
|
3
3
|
import t from "./SCheckbox.vue_vue_type_script_setup_true_lang.js";
|
|
4
4
|
/* empty css */
|
|
5
5
|
//#region src/components/shared/controls/SCheckbox.vue
|
|
6
|
-
var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-
|
|
6
|
+
var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-2562f916"]]);
|
|
7
7
|
//#endregion
|
|
8
8
|
export { n as default };
|