@webority/ui-elements 0.163.0 → 0.164.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 +4 -4
- package/THIRD-PARTY-NOTICES.txt +1 -1
- package/dist/WuiCodeBlock-7O514Hqe.js +1 -0
- package/dist/{WuiCommandPalette-Dpz0DXKJ.js → WuiCommandPalette-rVScJ2Hy.js} +2 -2
- package/dist/WuiCommentThread-5Uz83s1Y.js +1 -0
- package/dist/WuiContextMenu-_ZeequGf.js +1 -0
- package/dist/{WuiDataTable-C1Rrxmh_.js → WuiDataTable-Bb5hxTfn.js} +1 -1
- package/dist/WuiDatePicker-BF_GVNaj.js +31 -0
- package/dist/WuiDateRange-B6xh25qZ.js +25 -0
- package/dist/WuiDrawer-BGuq6FAZ.js +1 -0
- package/dist/WuiDropdown-DVTtANwz.js +1 -0
- package/dist/WuiHoverCard-FL38ANLM.js +1 -0
- package/dist/WuiInlineEdit-DMK1ESdx.js +1 -0
- package/dist/WuiLightbox-BUD0uefB.js +1 -0
- package/dist/WuiMarkdown-B7nfQ6tW.js +4 -0
- package/dist/WuiMentionInput-Bo9bhe3U.js +1 -0
- package/dist/WuiModal-DvSt_466.js +1 -0
- package/dist/WuiNavigationMenu-Dlo-n-cL.js +1 -0
- package/dist/WuiNotificationCenter-DP-Sf4FQ.js +1 -0
- package/dist/WuiOverflow-CV5y5zkM.js +1 -0
- package/dist/WuiPhone-BC0MQ6bf.js +16 -0
- package/dist/WuiPopover-CQJLfgm_.js +1 -0
- package/dist/WuiRelativeTime-CmlKD-97.js +1 -0
- package/dist/WuiSavedViews-CdjavvPC.js +1 -0
- package/dist/WuiSelect-EquDxkz1.js +9 -0
- package/dist/WuiShortcuts-5PhCS5ri.js +1 -0
- package/dist/WuiTimePicker-OAP_QRwV.js +9 -0
- package/dist/WuiTour-Dxyv9uNz.js +1 -0
- package/dist/{WuiTree-COd5leOB.js → WuiTree-BPT9EZuw.js} +1 -1
- package/dist/{WuiTruncate-C2WV1-NN.js → WuiTruncate-BB4i8wHE.js} +1 -1
- package/dist/WuiWhatsNew-B2mM4MHE.js +1 -0
- package/dist/anchorOverlay-B8fu8hjz.js +1 -0
- package/dist/chips-Dcf6_wuZ.js +2 -0
- package/dist/drawerDiscard-BtPeayNT.js +1 -0
- package/dist/elements/code-block.js +1 -1
- package/dist/elements/command-palette.js +1 -1
- package/dist/elements/comment-thread.js +1 -1
- package/dist/elements/context-menu.js +1 -1
- package/dist/elements/data-table.js +1 -1
- package/dist/elements/date-range.js +1 -1
- package/dist/elements/datepicker.js +1 -1
- package/dist/elements/drawer.js +1 -1
- package/dist/elements/dropdown.js +1 -0
- package/dist/elements/filter-popover.js +1 -1
- package/dist/elements/hover-card.js +1 -1
- package/dist/elements/inline-edit.js +1 -1
- package/dist/elements/lightbox.js +1 -1
- package/dist/elements/markdown.js +1 -1
- package/dist/elements/mention-input.js +1 -1
- package/dist/elements/modal.js +1 -0
- package/dist/elements/navigation-menu.js +1 -1
- package/dist/elements/notification-center.js +1 -1
- package/dist/elements/overflow.js +1 -1
- package/dist/elements/phone.js +1 -1
- package/dist/elements/popover.js +1 -0
- package/dist/elements/relative-time.js +1 -1
- package/dist/elements/saved-views.js +1 -1
- package/dist/elements/select.js +1 -1
- package/dist/elements/shortcuts.js +1 -1
- package/dist/elements/timepicker.js +1 -1
- package/dist/elements/tour.js +1 -1
- package/dist/elements/tree.js +1 -1
- package/dist/elements/truncate.js +1 -1
- package/dist/elements/whats-new.js +1 -1
- package/dist/fileViewerImage-XsUnEv6Z.js +3 -0
- package/dist/fileViewerMedia-DTDM69nT.js +1 -0
- package/dist/{fileViewerPdf-CAbiTCHl.js → fileViewerPdf-vlVCKKyK.js} +2 -2
- package/dist/fileViewerUi-CprJdtCB.js +1 -0
- package/dist/filterPopover-CYzUbKN0.js +1 -0
- package/dist/helpers.js +1 -1
- package/dist/inlineEditText-_GFrdJ6F.js +1 -0
- package/dist/{listboxKeyNav-DkLHwzJE.js → listboxKeyNav-CF7tMDGG.js} +1 -1
- package/dist/loader-B7twHKUy.js +1 -0
- package/dist/menuKeyNav-COGecOjH.js +1 -0
- package/dist/nativeOverlay-BbkCnzFj.js +1 -0
- package/dist/{search-C0IYOzso.js → search-C6r6xpep.js} +1 -1
- package/dist/server.js +1 -1
- package/dist/{themeTransition-CwE2VwQa.js → themeTransition-Dt7Br1QT.js} +1 -1
- package/dist/ui-elements/carousel.global.js +1 -1
- package/dist/ui-elements/code-block.global.js +1 -1
- package/dist/ui-elements/command-palette.global.js +2 -2
- package/dist/ui-elements/comment-thread.global.js +1 -1
- package/dist/ui-elements/consent-banner.global.js +1 -1
- package/dist/ui-elements/context-menu.global.js +1 -1
- package/dist/ui-elements/date-range.global.js +10 -10
- package/dist/ui-elements/drawer.global.js +1 -1
- package/dist/ui-elements/dropdown.global.js +1 -0
- package/dist/ui-elements/glyphs.global.js +1 -1
- package/dist/ui-elements/image-crop.global.js +1 -1
- package/dist/ui-elements/inline-edit.global.js +1 -1
- package/dist/ui-elements/kanban.global.js +1 -1
- package/dist/ui-elements/lead-popup.global.js +1 -1
- package/dist/ui-elements/lightbox.global.js +1 -1
- package/dist/ui-elements/markdown.global.js +3 -3
- package/dist/ui-elements/modal.global.js +1 -0
- package/dist/ui-elements/org-tree.global.js +1 -1
- package/dist/ui-elements/phone.global.js +6 -6
- package/dist/ui-elements/popover.global.js +1 -0
- package/dist/ui-elements/resizable.global.js +1 -1
- package/dist/ui-elements/saved-views.global.js +1 -1
- package/dist/ui-elements/select-chips.global.js +2 -2
- package/dist/ui-elements/select-recents.global.js +1 -1
- package/dist/ui-elements/select-search.global.js +1 -1
- package/dist/ui-elements/slider.global.js +1 -1
- package/dist/ui-elements/sortable.global.js +1 -1
- package/dist/ui-elements/status-icon.global.js +1 -1
- package/dist/ui-elements/timepicker.global.js +4 -4
- package/dist/ui-elements/tour.global.js +1 -1
- package/dist/ui-elements/tree.global.js +1 -1
- package/dist/ui-elements/wizard.global.js +1 -1
- package/dist/ui-elements.global.js +20 -20
- package/dist/ui-elements.js +1 -1
- package/dist/ui-file-viewer.global.js +10 -10
- package/dist/ui-file-viewer.js +1 -1
- package/dist/ui-tour.global.js +1 -1
- package/package.json +17 -5
- package/types/WuiCommandPalette.d.ts +2 -2
- package/types/WuiCommentThread.d.ts +1 -2
- package/types/WuiContextMenu.d.ts +56 -5
- package/types/WuiDatePicker.d.ts +3 -7
- package/types/WuiDateRange.d.ts +2 -9
- package/types/WuiDrawer.d.ts +9 -12
- package/types/WuiDropdown.d.ts +61 -0
- package/types/WuiHoverCard.d.ts +15 -1
- package/types/WuiInlineEdit.d.ts +2 -1
- package/types/WuiLightbox.d.ts +1 -2
- package/types/WuiMentionInput.d.ts +0 -4
- package/types/WuiModal.d.ts +50 -0
- package/types/WuiNavigationMenu.d.ts +8 -3
- package/types/WuiNotificationCenter.d.ts +10 -2
- package/types/WuiPhone.d.ts +1 -5
- package/types/WuiPopover.d.ts +67 -0
- package/types/WuiRelativeTime.d.ts +5 -6
- package/types/WuiSelect.d.ts +8 -6
- package/types/WuiShortcuts.d.ts +6 -1
- package/types/WuiSlider.d.ts +3 -3
- package/types/WuiTimePicker.d.ts +3 -5
- package/types/WuiTour.d.ts +1 -0
- package/types/WuiTruncate.d.ts +2 -2
- package/types/WuiWhatsNew.d.ts +3 -3
- package/types/anchorOverlay.d.ts +24 -8
- package/types/codeHighlight.d.ts +1 -1
- package/types/elements/dropdown.d.ts +2 -0
- package/types/elements/modal.d.ts +2 -0
- package/types/elements/popover.d.ts +2 -0
- package/types/fileViewerImage.d.ts +2 -0
- package/types/fileViewerMedia.d.ts +2 -0
- package/types/fileViewerPdf.d.ts +2 -0
- package/types/fileViewerUi.d.ts +1 -2
- package/types/filterPopover.d.ts +7 -8
- package/types/global/core.d.ts +0 -1
- package/types/global/shared.d.ts +6 -0
- package/types/globals.d.ts +23 -75
- package/types/helpers.d.ts +4 -0
- package/types/iconGlyphs.g.d.ts +1 -1
- package/types/index.d.ts +4 -1
- package/types/inlineEditText.d.ts +12 -1
- package/types/listboxKeyNav.d.ts +3 -3
- package/types/menuKeyNav.d.ts +8 -0
- package/types/nativeOverlay.d.ts +49 -0
- package/types/razor-js/modules/overlays.d.ts +1 -4
- package/types/razor-js/modules/serverBridge.d.ts +15 -13
- package/types/razor-js/modules/shared.d.ts +0 -7
- package/types/razor-js/modules/tables.d.ts +1 -0
- package/types/server/remoteModal.d.ts +0 -1
- package/types/statusIcons.d.ts +1 -1
- package/types/tooltips.d.ts +18 -0
- package/dist/WuiCodeBlock-cLLbSBK4.js +0 -1
- package/dist/WuiCommentThread-CclWHz4C.js +0 -1
- package/dist/WuiContextMenu-B2MrH_LK.js +0 -1
- package/dist/WuiDatePicker-DLEsnzqG.js +0 -31
- package/dist/WuiDateRange-9Xqs5nvv.js +0 -25
- package/dist/WuiDrawer-B3YFmxl2.js +0 -1
- package/dist/WuiHoverCard-CE3dHKaM.js +0 -1
- package/dist/WuiInlineEdit-pG9Z5tUQ.js +0 -1
- package/dist/WuiLightbox-C2A14vHx.js +0 -1
- package/dist/WuiMarkdown-BXY0QKaO.js +0 -4
- package/dist/WuiMentionInput-B_K8AXM5.js +0 -1
- package/dist/WuiNavigationMenu-CZ3XhFam.js +0 -1
- package/dist/WuiNotificationCenter-ClkCTUnp.js +0 -1
- package/dist/WuiOverflow-B0wA6aDe.js +0 -1
- package/dist/WuiPhone-icMSUnua.js +0 -16
- package/dist/WuiRelativeTime-DyeUQOQ8.js +0 -1
- package/dist/WuiSavedViews-Br9YKOVU.js +0 -1
- package/dist/WuiSelect-B199VL24.js +0 -9
- package/dist/WuiShortcuts-D3rWkaOm.js +0 -1
- package/dist/WuiTimePicker-wo9BlOFs.js +0 -9
- package/dist/WuiTour-D3Sx7JCM.js +0 -1
- package/dist/WuiWhatsNew-dLGyA4g1.js +0 -1
- package/dist/anchorOverlay-CXnWfezA.js +0 -1
- package/dist/chips-0jT9fpA9.js +0 -2
- package/dist/drawerDiscard-C-STs39f.js +0 -1
- package/dist/fileViewerImage-Bt1jeArm.js +0 -3
- package/dist/fileViewerMedia-Bp1uHJvC.js +0 -1
- package/dist/fileViewerUi-ResPjO1o.js +0 -1
- package/dist/filterPopover-CaHWe9V0.js +0 -1
- package/dist/inlineEditText-CsLCQbcg.js +0 -1
- package/dist/loader-DRYPWxQL.js +0 -1
- package/types/overlayRelease.d.ts +0 -12
- package/types/razor-js/modules/popovers.d.ts +0 -1
package/types/global/shared.d.ts
CHANGED
|
@@ -13,6 +13,8 @@ import * as iconGlyphs from "../iconGlyphs.g.ts";
|
|
|
13
13
|
import * as imeSafeEnter from "../imeSafeEnter.ts";
|
|
14
14
|
import * as listboxKeyNav from "../listboxKeyNav.ts";
|
|
15
15
|
import * as mentionText from "../mentionText.ts";
|
|
16
|
+
import * as menuKeyNav from "../menuKeyNav.ts";
|
|
17
|
+
import * as nativeOverlay from "../nativeOverlay.ts";
|
|
16
18
|
import * as notificationDays from "../notificationDays.ts";
|
|
17
19
|
import * as optionLabel from "../optionLabel.ts";
|
|
18
20
|
import * as selectList from "../select/list.ts";
|
|
@@ -22,6 +24,7 @@ import * as wuiHttp from "../server/wuiHttp.ts";
|
|
|
22
24
|
import * as stepperHeader from "../stepperHeader.ts";
|
|
23
25
|
import * as tableSelect from "../tableSelect.ts";
|
|
24
26
|
import * as textMatch from "../textMatch.ts";
|
|
27
|
+
import * as tooltips from "../tooltips.ts";
|
|
25
28
|
import * as WuiSelect from "../WuiSelect.ts";
|
|
26
29
|
import * as zone from "../zone.ts";
|
|
27
30
|
import * as glyphs from "./glyphs.ts";
|
|
@@ -44,6 +47,8 @@ export declare const SHARED_MODULES: Readonly<{
|
|
|
44
47
|
listboxKeyNav: typeof listboxKeyNav;
|
|
45
48
|
loader: typeof loader;
|
|
46
49
|
mentionText: typeof mentionText;
|
|
50
|
+
menuKeyNav: typeof menuKeyNav;
|
|
51
|
+
nativeOverlay: typeof nativeOverlay;
|
|
47
52
|
notificationDays: typeof notificationDays;
|
|
48
53
|
optionLabel: typeof optionLabel;
|
|
49
54
|
partRegistry: typeof partRegistry;
|
|
@@ -52,6 +57,7 @@ export declare const SHARED_MODULES: Readonly<{
|
|
|
52
57
|
stepperHeader: typeof stepperHeader;
|
|
53
58
|
tableSelect: typeof tableSelect;
|
|
54
59
|
textMatch: typeof textMatch;
|
|
60
|
+
tooltips: typeof tooltips;
|
|
55
61
|
wuiHttp: typeof wuiHttp;
|
|
56
62
|
WuiSelect: typeof WuiSelect;
|
|
57
63
|
zone: typeof zone;
|
package/types/globals.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { WuiFilterPopover } from "./filterPopover.ts";
|
|
2
2
|
import type { WuiKanban } from "./kanban.ts";
|
|
3
|
+
import type { OverlayCloseReason } from "./nativeOverlay.ts";
|
|
3
4
|
import type { WuiStatusIcon } from "./statusIcons.ts";
|
|
4
5
|
import type { WuiTourStep } from "./tourGlobal.ts";
|
|
5
6
|
import type { WuiCalendar } from "./WuiCalendar.ts";
|
|
@@ -15,6 +16,7 @@ import type { WuiDatePicker } from "./WuiDatePicker.ts";
|
|
|
15
16
|
import type { WuiDateRange } from "./WuiDateRange.ts";
|
|
16
17
|
import type { WuiDock } from "./WuiDock.ts";
|
|
17
18
|
import type { WuiDrawer } from "./WuiDrawer.ts";
|
|
19
|
+
import type { WuiDropdown } from "./WuiDropdown.ts";
|
|
18
20
|
import type { WuiFileViewer } from "./WuiFileViewer.ts";
|
|
19
21
|
import type { WuiHoverCard } from "./WuiHoverCard.ts";
|
|
20
22
|
import type { WuiImageCrop } from "./WuiImageCrop.ts";
|
|
@@ -23,6 +25,7 @@ import type { WuiLeadPopup } from "./WuiLeadPopup.ts";
|
|
|
23
25
|
import type { WuiLightbox } from "./WuiLightbox.ts";
|
|
24
26
|
import type { WuiMarkdown } from "./WuiMarkdown.ts";
|
|
25
27
|
import type { WuiMentionInput } from "./WuiMentionInput.ts";
|
|
28
|
+
import type { WuiModal } from "./WuiModal.ts";
|
|
26
29
|
import type { WuiNavigationMenu } from "./WuiNavigationMenu.ts";
|
|
27
30
|
import type { WuiNotificationCenter } from "./WuiNotificationCenter.ts";
|
|
28
31
|
import type { WuiOnboardingChecklist } from "./WuiOnboardingChecklist.ts";
|
|
@@ -30,6 +33,7 @@ import type { WuiOrgTree } from "./WuiOrgTree.ts";
|
|
|
30
33
|
import type { WuiOtp } from "./WuiOtp.ts";
|
|
31
34
|
import type { WuiOverflow } from "./WuiOverflow.ts";
|
|
32
35
|
import type { WuiPhone } from "./WuiPhone.ts";
|
|
36
|
+
import type { WuiPopover } from "./WuiPopover.ts";
|
|
33
37
|
import type { WuiRating } from "./WuiRating.ts";
|
|
34
38
|
import type { WuiRecordPager } from "./WuiRecordPager.ts";
|
|
35
39
|
import type { WuiRelativeTime } from "./WuiRelativeTime.ts";
|
|
@@ -63,6 +67,7 @@ export interface WuiElementTagMap {
|
|
|
63
67
|
"wui-date-range": WuiDateRange;
|
|
64
68
|
"wui-dock": WuiDock;
|
|
65
69
|
"wui-drawer": WuiDrawer;
|
|
70
|
+
"wui-dropdown": WuiDropdown;
|
|
66
71
|
"wui-file-viewer": WuiFileViewer;
|
|
67
72
|
"wui-filter-popover": WuiFilterPopover;
|
|
68
73
|
"wui-hover-card": WuiHoverCard;
|
|
@@ -72,6 +77,7 @@ export interface WuiElementTagMap {
|
|
|
72
77
|
"wui-lead-popup": WuiLeadPopup;
|
|
73
78
|
"wui-lightbox": WuiLightbox;
|
|
74
79
|
"wui-markdown": WuiMarkdown;
|
|
80
|
+
"wui-modal": WuiModal;
|
|
75
81
|
"wui-mention-input": WuiMentionInput;
|
|
76
82
|
"wui-navigation-menu": WuiNavigationMenu;
|
|
77
83
|
"wui-notification-center": WuiNotificationCenter;
|
|
@@ -80,6 +86,7 @@ export interface WuiElementTagMap {
|
|
|
80
86
|
"wui-otp": WuiOtp;
|
|
81
87
|
"wui-overflow": WuiOverflow;
|
|
82
88
|
"wui-phone": WuiPhone;
|
|
89
|
+
"wui-popover": WuiPopover;
|
|
83
90
|
"wui-rating": WuiRating;
|
|
84
91
|
"wui-record-pager": WuiRecordPager;
|
|
85
92
|
"wui-relative-time": WuiRelativeTime;
|
|
@@ -102,79 +109,6 @@ export interface WuiElementTagMap {
|
|
|
102
109
|
"wui-wizard": WuiWizard;
|
|
103
110
|
"wui-wizard-step": WuiWizardStep;
|
|
104
111
|
}
|
|
105
|
-
export interface BootstrapComponent<Instance, Options> {
|
|
106
|
-
new (element: Element | string, config?: Options): Instance;
|
|
107
|
-
getInstance(element: Element): Instance | null;
|
|
108
|
-
getOrCreateInstance(element: Element, config?: Options): Instance;
|
|
109
|
-
readonly EVENT_KEY: string;
|
|
110
|
-
}
|
|
111
|
-
export interface BootstrapModalInstance {
|
|
112
|
-
show(): void;
|
|
113
|
-
hide(): void;
|
|
114
|
-
toggle(): void;
|
|
115
|
-
handleUpdate(): void;
|
|
116
|
-
dispose(): void;
|
|
117
|
-
}
|
|
118
|
-
export interface BootstrapModalOptions {
|
|
119
|
-
backdrop?: boolean | "static";
|
|
120
|
-
focus?: boolean;
|
|
121
|
-
keyboard?: boolean;
|
|
122
|
-
}
|
|
123
|
-
export interface BootstrapTipInstance {
|
|
124
|
-
tip?: HTMLElement | null;
|
|
125
|
-
show(): void;
|
|
126
|
-
hide(): void;
|
|
127
|
-
toggle(): void;
|
|
128
|
-
update(): void;
|
|
129
|
-
dispose(): void;
|
|
130
|
-
setContent(content: Record<string, string | Element | null>): void;
|
|
131
|
-
}
|
|
132
|
-
export interface BootstrapTipOptions {
|
|
133
|
-
animation?: boolean;
|
|
134
|
-
boundary?: string | Element;
|
|
135
|
-
container?: string | Element | false;
|
|
136
|
-
content?: string | Element | (() => string | Element);
|
|
137
|
-
customClass?: string;
|
|
138
|
-
delay?: number | {
|
|
139
|
-
show: number;
|
|
140
|
-
hide: number;
|
|
141
|
-
};
|
|
142
|
-
fallbackPlacements?: string[];
|
|
143
|
-
html?: boolean;
|
|
144
|
-
offset?: [number, number] | string;
|
|
145
|
-
placement?: "auto" | "top" | "bottom" | "left" | "right";
|
|
146
|
-
popperConfig?: object | ((defaults: {
|
|
147
|
-
modifiers?: unknown[];
|
|
148
|
-
}) => object);
|
|
149
|
-
sanitize?: boolean;
|
|
150
|
-
selector?: string | false;
|
|
151
|
-
template?: string;
|
|
152
|
-
title?: string | Element | (() => string | Element);
|
|
153
|
-
trigger?: string;
|
|
154
|
-
}
|
|
155
|
-
export interface BootstrapDropdownInstance {
|
|
156
|
-
show(): void;
|
|
157
|
-
hide(): void;
|
|
158
|
-
toggle(): void;
|
|
159
|
-
update(): void;
|
|
160
|
-
dispose(): void;
|
|
161
|
-
}
|
|
162
|
-
export interface BootstrapTabInstance {
|
|
163
|
-
show(): void;
|
|
164
|
-
dispose(): void;
|
|
165
|
-
}
|
|
166
|
-
export type BootstrapTabOptions = Record<string, never>;
|
|
167
|
-
export interface WuiBootstrap {
|
|
168
|
-
Modal: BootstrapComponent<BootstrapModalInstance, BootstrapModalOptions>;
|
|
169
|
-
Tooltip: BootstrapComponent<BootstrapTipInstance, BootstrapTipOptions>;
|
|
170
|
-
Popover: BootstrapComponent<BootstrapTipInstance, BootstrapTipOptions> & {
|
|
171
|
-
Default: {
|
|
172
|
-
template: string;
|
|
173
|
-
};
|
|
174
|
-
};
|
|
175
|
-
Dropdown: BootstrapComponent<BootstrapDropdownInstance, object>;
|
|
176
|
-
Tab: BootstrapComponent<BootstrapTabInstance, BootstrapTabOptions>;
|
|
177
|
-
}
|
|
178
112
|
export interface WuiEventMap {
|
|
179
113
|
"wui:shell:collapse": CustomEvent<{
|
|
180
114
|
collapsed: boolean;
|
|
@@ -190,6 +124,21 @@ export interface WuiEventMap {
|
|
|
190
124
|
href: string;
|
|
191
125
|
}>;
|
|
192
126
|
"wui:teardown": CustomEvent<null>;
|
|
127
|
+
"wui-modal-open": CustomEvent<{
|
|
128
|
+
trigger: HTMLElement | null;
|
|
129
|
+
}>;
|
|
130
|
+
"wui-modal-opened": CustomEvent<null>;
|
|
131
|
+
"wui-modal-close": CustomEvent<{
|
|
132
|
+
reason: OverlayCloseReason;
|
|
133
|
+
}>;
|
|
134
|
+
"wui-modal-closed": CustomEvent<null>;
|
|
135
|
+
"wui-dropdown-toggle": CustomEvent<{
|
|
136
|
+
open: boolean;
|
|
137
|
+
source: "trigger" | "select" | "dismiss" | "scroll" | "resize";
|
|
138
|
+
}>;
|
|
139
|
+
"wui-popover-toggle": CustomEvent<{
|
|
140
|
+
open: boolean;
|
|
141
|
+
}>;
|
|
193
142
|
search: CustomEvent<{
|
|
194
143
|
query: string;
|
|
195
144
|
seq: number;
|
|
@@ -202,8 +151,7 @@ declare global {
|
|
|
202
151
|
}
|
|
203
152
|
interface DocumentEventMap extends WuiEventMap {
|
|
204
153
|
}
|
|
205
|
-
var
|
|
206
|
-
var WeborityUiElements: typeof import("./global/core.ts") & Partial<typeof import("./elements/carousel.ts")> & Partial<typeof import("./elements/code-block.ts")> & Partial<typeof import("./elements/command-palette.ts")> & Partial<typeof import("./elements/comment-thread.ts")> & Partial<typeof import("./elements/consent-banner.ts")> & Partial<typeof import("./elements/context-menu.ts")> & Partial<typeof import("./elements/date-range.ts")> & Partial<typeof import("./elements/drawer.ts")> & Partial<typeof import("./elements/image-crop.ts")> & Partial<typeof import("./elements/inline-edit.ts")> & Partial<typeof import("./elements/kanban.ts")> & Partial<typeof import("./elements/lead-popup.ts")> & Partial<typeof import("./elements/lightbox.ts")> & Partial<typeof import("./elements/org-tree.ts")> & Partial<typeof import("./elements/markdown.ts")> & Partial<typeof import("./elements/phone.ts")> & Partial<typeof import("./global/parts/select-country.ts")> & Partial<typeof import("./elements/resizable.ts")> & Partial<typeof import("./elements/saved-views.ts")> & Partial<typeof import("./global/parts/select-chips.ts")> & Partial<typeof import("./global/parts/select-recents.ts")> & Partial<typeof import("./global/parts/select-search.ts")> & Partial<typeof import("./elements/slider.ts")> & Partial<typeof import("./elements/sortable.ts")> & Partial<typeof import("./elements/status-icon.ts")> & Partial<typeof import("./elements/timepicker.ts")> & Partial<typeof import("./elements/tour.ts")> & Partial<typeof import("./elements/tree.ts")> & Partial<typeof import("./elements/wizard.ts")>;
|
|
154
|
+
var WeborityUiElements: typeof import("./global/core.ts") & Partial<typeof import("./elements/carousel.ts")> & Partial<typeof import("./elements/code-block.ts")> & Partial<typeof import("./elements/command-palette.ts")> & Partial<typeof import("./elements/comment-thread.ts")> & Partial<typeof import("./elements/consent-banner.ts")> & Partial<typeof import("./elements/context-menu.ts")> & Partial<typeof import("./elements/date-range.ts")> & Partial<typeof import("./elements/drawer.ts")> & Partial<typeof import("./elements/dropdown.ts")> & Partial<typeof import("./elements/image-crop.ts")> & Partial<typeof import("./elements/inline-edit.ts")> & Partial<typeof import("./elements/kanban.ts")> & Partial<typeof import("./elements/lead-popup.ts")> & Partial<typeof import("./elements/lightbox.ts")> & Partial<typeof import("./elements/org-tree.ts")> & Partial<typeof import("./elements/markdown.ts")> & Partial<typeof import("./elements/modal.ts")> & Partial<typeof import("./elements/phone.ts")> & Partial<typeof import("./elements/popover.ts")> & Partial<typeof import("./global/parts/select-country.ts")> & Partial<typeof import("./elements/resizable.ts")> & Partial<typeof import("./elements/saved-views.ts")> & Partial<typeof import("./global/parts/select-chips.ts")> & Partial<typeof import("./global/parts/select-recents.ts")> & Partial<typeof import("./global/parts/select-search.ts")> & Partial<typeof import("./elements/slider.ts")> & Partial<typeof import("./elements/sortable.ts")> & Partial<typeof import("./elements/status-icon.ts")> & Partial<typeof import("./elements/timepicker.ts")> & Partial<typeof import("./elements/tour.ts")> & Partial<typeof import("./elements/tree.ts")> & Partial<typeof import("./elements/wizard.ts")>;
|
|
207
155
|
var WeborityFileViewer: typeof import("./fileViewer.ts") | undefined;
|
|
208
156
|
var WeborityChart: typeof import("./chart.ts") | undefined;
|
|
209
157
|
var WeborityCalendar: typeof import("./calendar.ts") | undefined;
|
package/types/helpers.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export type { AnchorOptions, OverlaySide } from "./anchorOverlay.ts";
|
|
1
2
|
export { AVATAR_ACCEPT, AVATAR_MAX_SIZE_MB, AVATAR_OUTPUT_SIZE, AVATAR_OUTPUT_TYPE, AVATAR_PREVIEW_SIZES, AVATAR_TEXT, avatarCropOptions, avatarUnreadableMessage, isHeicFile, } from "./avatarPicker.ts";
|
|
2
3
|
export { COMMAND_SHORTCUT_ATTRIBUTE, initCommandShortcuts, isCommandChord } from "./commandShortcut.ts";
|
|
3
4
|
export { COMMENT_INTENTS, COMMENT_REACTIONS, COMMENT_TEXT, type CommentIntent } from "./commentText.ts";
|
|
@@ -14,6 +15,8 @@ export { INLINE_EDIT_SAVED_MS, INLINE_EDIT_TEXT, INLINE_EDIT_TYPES, type InlineE
|
|
|
14
15
|
export { attachInputMask, formatMasked, initInputMasks, isMaskPattern, MASK_INPUT_TYPES, MASK_NAMES, maskedPostValue, postedMasked, rawMasked, resolveMask, } from "./inputMask.ts";
|
|
15
16
|
export { KANBAN_DRAG_THRESHOLD_PX, KANBAN_LONG_PRESS_MS, KANBAN_PHONE_QUERY, KANBAN_STORAGE_PREFIX, KANBAN_SUMMARY_FORMATS, KANBAN_TEXT, KANBAN_TONES, kanbanCardLabel, kanbanOverflow, kanbanStorageKey, kanbanSummaryFormat, kanbanVisibleLimit, readKanbanCollapsed, type SummaryFormat, sumKanbanValues, writeKanbanCollapsed, } from "./kanbanModel.ts";
|
|
16
17
|
export { MENTION_ID_PATTERN, type MentionPart, type MentionSpan, mentionedIds, mentionLabel, mentionTextFromValue, mentionValueFromText, parseMentionValue, } from "./mentionText.ts";
|
|
18
|
+
export { bindMenuKeys, type MenuKeyOptions, } from "./menuKeyNav.ts";
|
|
19
|
+
export { type AnchoredPopoverOptions, CLOSE_MOTION_LIMIT_MS, CLOSING_ATTRIBUTE, closeAnchoredPopover, closeModalDialog, DISMISS_ATTRIBUTE, isPopoverOpen, type ModalDialogOptions, OPEN_ATTRIBUTE, type OverlayCloseReason, onOverlayRootChange, openAnchoredPopover, openModalDialog, overlayRoot, raisePopover, setPopoverOpen, wireOpenTriggers, } from "./nativeOverlay.ts";
|
|
17
20
|
export { revealActiveNavItem } from "./navReveal.ts";
|
|
18
21
|
export { groupNotificationsByDay, NOTIFICATION_COUNT_CAP, NOTIFICATION_TEXT, notificationCountText, notificationDayHeading, notificationTime, notificationTriggerLabel, notificationUnreadAnnouncement, } from "./notificationDays.ts";
|
|
19
22
|
export { withTrustedLabel } from "./optionLabel.ts";
|
|
@@ -26,5 +29,6 @@ export { deriveStepStatus, stepperHeaderItems } from "./stepperHeader.ts";
|
|
|
26
29
|
export { initSubmitOnce, SUBMIT_ONCE_ATTRIBUTE } from "./submitOnce.ts";
|
|
27
30
|
export { matchSegments } from "./textMatch.ts";
|
|
28
31
|
export { applyTheme, DEFAULT_THEME_EFFECT, DEFAULT_THEME_STORAGE_KEY, nextTheme, readStoredTheme, resolveTheme, storeTheme, THEME_CHANGE_EVENT, THEME_EFFECT_DURATION, THEME_EFFECTS, THEME_MODES, THEME_SWITCHING_CLASS, themeBootScript, themeKeyframes, transitionTheme, watchSystemTheme, } from "./themeTransition.ts";
|
|
32
|
+
export { showPinnedTooltips, TOOLTIP_ATTRIBUTE, TOOLTIP_CLASS_ATTRIBUTE, TOOLTIP_HTML_ATTRIBUTE, TOOLTIP_ID_ATTRIBUTE, TOOLTIP_OPEN_ATTRIBUTE, TOOLTIP_PLACEMENT_ATTRIBUTE, wireTooltips, } from "./tooltips.ts";
|
|
29
33
|
export { createLocalSeenStore } from "./tourSeenStore.ts";
|
|
30
34
|
export { isTimeZone, todayIn, wallClockOf, zoneOffsetMs, zoneParts } from "./zone.ts";
|
package/types/iconGlyphs.g.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const GLYPHS: Record<string, string>;
|
|
2
2
|
export declare const iconNames: string[];
|
|
3
|
-
/** The library's single icon SVG emitter
|
|
3
|
+
/** The library's single icon SVG emitter, with markup identical to Razor's IconMarkup.Render. */
|
|
4
4
|
export declare function glyphSvg(name: string, { size, className }?: {
|
|
5
5
|
size?: number;
|
|
6
6
|
className?: string;
|
package/types/index.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ import { WuiDatePicker } from "./WuiDatePicker.ts";
|
|
|
11
11
|
import { WuiDateRange } from "./WuiDateRange.ts";
|
|
12
12
|
import { WuiDock } from "./WuiDock.ts";
|
|
13
13
|
import { WuiDrawer } from "./WuiDrawer.ts";
|
|
14
|
+
import { WuiDropdown } from "./WuiDropdown.ts";
|
|
14
15
|
import { WuiHoverCard } from "./WuiHoverCard.ts";
|
|
15
16
|
import { WuiImageCrop } from "./WuiImageCrop.ts";
|
|
16
17
|
import { WuiInlineEdit } from "./WuiInlineEdit.ts";
|
|
@@ -18,6 +19,7 @@ import { WuiLeadPopup } from "./WuiLeadPopup.ts";
|
|
|
18
19
|
import { WuiLightbox } from "./WuiLightbox.ts";
|
|
19
20
|
import { WuiMarkdown } from "./WuiMarkdown.ts";
|
|
20
21
|
import { WuiMentionInput } from "./WuiMentionInput.ts";
|
|
22
|
+
import { WuiModal } from "./WuiModal.ts";
|
|
21
23
|
import { WuiNavigationMenu } from "./WuiNavigationMenu.ts";
|
|
22
24
|
import { WuiNotificationCenter } from "./WuiNotificationCenter.ts";
|
|
23
25
|
import { WuiOnboardingChecklist } from "./WuiOnboardingChecklist.ts";
|
|
@@ -25,6 +27,7 @@ import { WuiOrgTree } from "./WuiOrgTree.ts";
|
|
|
25
27
|
import { WuiOtp } from "./WuiOtp.ts";
|
|
26
28
|
import { WuiOverflow } from "./WuiOverflow.ts";
|
|
27
29
|
import { WuiPhone } from "./WuiPhone.ts";
|
|
30
|
+
import { WuiPopover } from "./WuiPopover.ts";
|
|
28
31
|
import { WuiRating } from "./WuiRating.ts";
|
|
29
32
|
import { WuiRecordPager } from "./WuiRecordPager.ts";
|
|
30
33
|
import { WuiRelativeTime } from "./WuiRelativeTime.ts";
|
|
@@ -51,4 +54,4 @@ export { DISCARD_EVENT } from "./server/drawerDiscard.ts";
|
|
|
51
54
|
export { SHORTCUT_EVENT } from "./shortcutKeys.ts";
|
|
52
55
|
export { THEME_CHANGE_EVENT } from "./themeTransition.ts";
|
|
53
56
|
export { WHATS_NEW_READ_EVENT } from "./WuiWhatsNew.ts";
|
|
54
|
-
export { WuiCarousel, WuiCodeBlock, WuiCommandPalette, WuiCommentThread, WuiConsentBanner, WuiContextMenu, WuiDataTable, WuiDatePicker, WuiDateRange, WuiDock, WuiDrawer, WuiHoverCard, WuiImageCrop, WuiInlineEdit, WuiKanban, WuiLeadPopup, WuiLightbox, WuiMarkdown, WuiMentionInput, WuiNavigationMenu, WuiNotificationCenter, WuiOnboardingChecklist, WuiOrgTree, WuiOtp, WuiOverflow, WuiPhone, WuiRating, WuiRecordPager, WuiRelativeTime, WuiResizable, WuiRollingNumber, WuiSavedViews, WuiSelect, WuiShortcuts, WuiShowMore, WuiSlider, WuiSortable, WuiStatusIcon, WuiTimePicker, WuiTour, WuiTree, WuiTruncate, WuiWhatsNew, WuiWizard, WuiWizardStep, };
|
|
57
|
+
export { WuiCarousel, WuiCodeBlock, WuiCommandPalette, WuiCommentThread, WuiConsentBanner, WuiContextMenu, WuiDataTable, WuiDatePicker, WuiDateRange, WuiDock, WuiDrawer, WuiDropdown, WuiHoverCard, WuiImageCrop, WuiInlineEdit, WuiKanban, WuiLeadPopup, WuiLightbox, WuiMarkdown, WuiMentionInput, WuiModal, WuiNavigationMenu, WuiNotificationCenter, WuiOnboardingChecklist, WuiOrgTree, WuiOtp, WuiOverflow, WuiPhone, WuiPopover, WuiRating, WuiRecordPager, WuiRelativeTime, WuiResizable, WuiRollingNumber, WuiSavedViews, WuiSelect, WuiShortcuts, WuiShowMore, WuiSlider, WuiSortable, WuiStatusIcon, WuiTimePicker, WuiTour, WuiTree, WuiTruncate, WuiWhatsNew, WuiWizard, WuiWizardStep, };
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
/** The controls an inline edit can turn into. */
|
|
2
2
|
export declare const INLINE_EDIT_TYPES: readonly ["text", "number", "select", "date", "textarea"];
|
|
3
3
|
export type InlineEditType = (typeof INLINE_EDIT_TYPES)[number];
|
|
4
|
+
/** How a number value at rest is grouped: "indian" reads 15,00,000. */
|
|
5
|
+
export declare const INLINE_EDIT_GROUPINGS: readonly ["none", "indian"];
|
|
6
|
+
export type InlineEditGrouping = (typeof INLINE_EDIT_GROUPINGS)[number];
|
|
4
7
|
/** How long the saved tick stays after a save. */
|
|
5
8
|
export declare const INLINE_EDIT_SAVED_MS = 2000;
|
|
6
9
|
export interface InlineEditOption {
|
|
@@ -11,6 +14,7 @@ export interface InlineEditTextConfig {
|
|
|
11
14
|
type?: string;
|
|
12
15
|
options?: InlineEditOption[];
|
|
13
16
|
placeholder?: string;
|
|
17
|
+
grouping?: InlineEditGrouping | undefined;
|
|
14
18
|
}
|
|
15
19
|
export interface InlineEditTextResult {
|
|
16
20
|
text: string;
|
|
@@ -44,4 +48,11 @@ export declare const INLINE_EDIT_TEXT: Readonly<{
|
|
|
44
48
|
* The text a value reads as before any custom rendering: the placeholder (or the house hyphen)
|
|
45
49
|
* when empty, a date as dd-MMM-yyyy, a select value as its option's label.
|
|
46
50
|
*/
|
|
47
|
-
export declare function inlineEditText(value: unknown, { type, options, placeholder }?: InlineEditTextConfig): InlineEditTextResult;
|
|
51
|
+
export declare function inlineEditText(value: unknown, { type, options, placeholder, grouping }?: InlineEditTextConfig): InlineEditTextResult;
|
|
52
|
+
/** The message for a grouping that is not in INLINE_EDIT_GROUPINGS. */
|
|
53
|
+
export declare const groupingMessage: (grouping: unknown) => string;
|
|
54
|
+
/**
|
|
55
|
+
* Groups the integer digits of a plain number 3 then 2s from the right (1500000 reads 15,00,000),
|
|
56
|
+
* keeping the sign and the typed fraction exact. Text that is not a plain number is returned as it is.
|
|
57
|
+
*/
|
|
58
|
+
export declare function groupIndianDigits(text: string): string;
|
package/types/listboxKeyNav.d.ts
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* getActive: () => this._active,
|
|
15
15
|
* setActive: (i) => { ... },
|
|
16
16
|
* onEnter: (activeOption, opts) => { ... }, // fired when Enter pressed & active option exists
|
|
17
|
-
* onEscape: () => { ... },
|
|
17
|
+
* onEscape: (e) => { ... }, // fired when Escape pressed; the caller cancels e
|
|
18
18
|
* onTypeahead: (char) => { ... }, // optional: invoked for printable keys outside input
|
|
19
19
|
* typeaheadMs: 500, // optional: buffer clear timeout (default 500)
|
|
20
20
|
* });
|
|
@@ -31,7 +31,7 @@ export interface ListboxKeyNavConfig {
|
|
|
31
31
|
getActive: () => number;
|
|
32
32
|
setActive: (index: number) => void;
|
|
33
33
|
onEnter?: (activeOption: HTMLElement | undefined, visibleOptions: HTMLElement[]) => void;
|
|
34
|
-
onEscape?: () => void;
|
|
34
|
+
onEscape?: (e: KeyboardEvent) => void;
|
|
35
35
|
onTypeahead?: (char: string, activeIndex: number, visibleOptions: HTMLElement[]) => void;
|
|
36
36
|
typeaheadMs?: number;
|
|
37
37
|
}
|
|
@@ -47,7 +47,7 @@ export interface ListboxKeyNav {
|
|
|
47
47
|
* @param config.getActive - returns current active index
|
|
48
48
|
* @param config.setActive - (index) => void, sets the active cursor
|
|
49
49
|
* @param [config.onEnter] - (activeOption, visibleOptions) => void, Enter key action
|
|
50
|
-
* @param [config.onEscape] - () => void, Escape key action (may include close + teardown)
|
|
50
|
+
* @param [config.onEscape] - (e) => void, Escape key action (may include close + teardown); the caller cancels e
|
|
51
51
|
* @param [config.onTypeahead] - (char, activeIndex, visibleOptions) => void, char matched to option
|
|
52
52
|
* @param [config.typeaheadMs] - clear buffer timeout (default 500)
|
|
53
53
|
* @returns { handler: (KeyboardEvent) => void, teardown: () => void, clearTypeahead: () => void }
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface MenuKeyOptions {
|
|
2
|
+
/** The focusable rows of `menu`, in order, read on each key press. */
|
|
3
|
+
items: () => HTMLElement[];
|
|
4
|
+
/** Typed-letter jump between rows, with a 500 ms buffer. Default true. */
|
|
5
|
+
typeahead?: boolean;
|
|
6
|
+
}
|
|
7
|
+
/** ArrowDown, ArrowUp, Home, End, PageDown, PageUp and typeahead inside `menu`. Returns the unbind. Activation and closing stay with the owner. */
|
|
8
|
+
export declare function bindMenuKeys(menu: HTMLElement, options: MenuKeyOptions): () => void;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { type AnchorOptions } from "./anchorOverlay.ts";
|
|
2
|
+
export type OverlayCloseReason = "escape" | "backdrop" | "dismiss" | "drag";
|
|
3
|
+
export declare const OPEN_ATTRIBUTE = "data-wui-open";
|
|
4
|
+
export declare const DISMISS_ATTRIBUTE = "data-wui-dismiss";
|
|
5
|
+
export declare const CLOSING_ATTRIBUTE = "data-wui-closing";
|
|
6
|
+
/** The longest the exit motion may hold a dialog open, in ms. */
|
|
7
|
+
export declare const CLOSE_MOTION_LIMIT_MS = 400;
|
|
8
|
+
export interface ModalDialogOptions {
|
|
9
|
+
/** False: Escape does not ask to close (sets closedby="none" and prevents `cancel`). */
|
|
10
|
+
escape: boolean;
|
|
11
|
+
/** False: a press outside the dialog's box does not ask to close. */
|
|
12
|
+
backdrop: boolean;
|
|
13
|
+
/** "first-control": [data-autofocus], else the first control that is not the close or back button, else the first close or back button. "panel": the dialog itself. */
|
|
14
|
+
focus: "first-control" | "panel";
|
|
15
|
+
/** The person asked to close. The dialog never closes itself: the owner answers by calling closeModalDialog. */
|
|
16
|
+
onRequestClose: (reason: OverlayCloseReason) => void;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* WebKit does not focus a button on click, so the browser has no opener to hand focus back to: move it there once
|
|
20
|
+
* `closed` has closed, unless focus has already gone somewhere real. Focus still inside `closed` is not real:
|
|
21
|
+
* WebKit leaves it on the control the dialog held after an Escape.
|
|
22
|
+
*/
|
|
23
|
+
export declare function returnFocus(opener: HTMLElement | null, closed: Element): void;
|
|
24
|
+
/** Opens `dialog` as a modal, places focus by the rule, and wires Escape, the backdrop and [data-wui-dismiss]. Returns the release, called once the dialog has closed. */
|
|
25
|
+
export declare function openModalDialog(dialog: HTMLDialogElement, options: ModalDialogOptions): () => void;
|
|
26
|
+
/** Marks the dialog closing, waits for its exit animation (at most CLOSE_MOTION_LIMIT_MS; none under reduced motion), then closes it. Resolves once closed. */
|
|
27
|
+
export declare function closeModalDialog(dialog: HTMLDialogElement): Promise<void>;
|
|
28
|
+
export interface AnchoredPopoverOptions extends AnchorOptions {
|
|
29
|
+
/** "auto": the browser closes it on Escape, an outside press, or another auto panel opening. "manual": only the owner closes it. */
|
|
30
|
+
mode: "auto" | "manual";
|
|
31
|
+
/** Runs once each time the panel closes, however it closed. */
|
|
32
|
+
onClosed?: () => void;
|
|
33
|
+
/** A panel its owner holds open stays open while its trigger is scrolled out of view. */
|
|
34
|
+
keepOffscreen?: boolean;
|
|
35
|
+
}
|
|
36
|
+
/** Sets the popover attribute to `mode`, shows the panel, places it against `trigger` and keeps it placed until it closes. */
|
|
37
|
+
export declare function openAnchoredPopover(trigger: HTMLElement, panel: HTMLElement, options: AnchoredPopoverOptions): void;
|
|
38
|
+
export declare function closeAnchoredPopover(panel: HTMLElement): void;
|
|
39
|
+
export declare function isPopoverOpen(panel: HTMLElement): boolean;
|
|
40
|
+
/** Shows or hides a top-layer panel that has no trigger to anchor to. Calling show or hide on a panel already in that state is a no-op in the browser, so the state is checked first to keep the call one-to-one with the change. */
|
|
41
|
+
export declare function setPopoverOpen(panel: HTMLElement, open: boolean): void;
|
|
42
|
+
/** Moves an open top-layer panel to the top of the top layer, above a dialog opened after it. The browser stacks the top layer by when each entry was shown, so a hide and show is the only way to move one. */
|
|
43
|
+
export declare function raisePopover(panel: HTMLElement): void;
|
|
44
|
+
/** Where a page-level layer (toasts, a tooltip bubble, the tour) must sit to stay live: the most recently shown modal <dialog> that is still open, else document.body. */
|
|
45
|
+
export declare function overlayRoot(doc?: Document): HTMLElement;
|
|
46
|
+
/** Calls `listener` each time overlayRoot() changes. Returns the unsubscribe. */
|
|
47
|
+
export declare function onOverlayRootChange(listener: (root: HTMLElement) => void, doc?: Document): () => void;
|
|
48
|
+
/** One delegated click listener per document: a control with data-wui-open="#id" opens the <wui-modal> or <wui-drawer> with that id, passing itself as the opener. Idempotent. */
|
|
49
|
+
export declare function wireOpenTriggers(doc: Document): void;
|
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
export declare const initOverlayFocus: () => void;
|
|
2
|
-
export declare const initModalInert: () => void;
|
|
3
|
-
export declare const initCommandPalettes: () => void;
|
|
4
|
-
export declare const initDropdownScrollClose: () => void;
|
|
5
1
|
export declare const initDisabledDropdownItems: () => void;
|
|
2
|
+
export declare const initStaleOverlayMarkup: (root?: Document | Element) => void;
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const
|
|
3
|
-
export declare const
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const
|
|
6
|
-
export declare const
|
|
7
|
-
export declare const
|
|
8
|
-
export declare const
|
|
9
|
-
export declare const
|
|
10
|
-
export declare const
|
|
11
|
-
export declare const
|
|
12
|
-
export declare const
|
|
13
|
-
export declare const
|
|
1
|
+
type Root = Document | Element;
|
|
2
|
+
export declare const initServerTables: (root?: Root) => void;
|
|
3
|
+
export declare const initRemoteModals: (root?: Root) => void;
|
|
4
|
+
export declare const initServerActions: (root?: Root) => void;
|
|
5
|
+
export declare const initInputMasks: (root?: Root) => void;
|
|
6
|
+
export declare const initScrollEdges: (root?: Root) => void;
|
|
7
|
+
export declare const initShellParts: (root?: Root) => void;
|
|
8
|
+
export declare const initUnsavedChanges: (root?: Root) => void;
|
|
9
|
+
export declare const initDrawerDiscard: (root?: Root) => void;
|
|
10
|
+
export declare const initCollapsibleSearch: (root?: Root) => void;
|
|
11
|
+
export declare const initPageBarBulk: (root?: Root) => void;
|
|
12
|
+
export declare const initRowDrag: (root?: Root) => void;
|
|
13
|
+
export declare const initSubmitOnce: (root?: Root) => void;
|
|
14
|
+
export declare const initCommandShortcuts: (root?: Root) => void;
|
|
15
|
+
export {};
|
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
export declare const ready: (fn: () => void) => void;
|
|
2
2
|
export declare const qsa: <E extends HTMLElement>(root: ParentNode, selector: string, type: abstract new (...args: never[]) => E) => E[];
|
|
3
3
|
export declare const onTeardown: (node: Element, release: () => void) => void;
|
|
4
|
-
export declare const plainPopoverTitle: (bs: {
|
|
5
|
-
Popover?: {
|
|
6
|
-
Default?: {
|
|
7
|
-
template?: string;
|
|
8
|
-
};
|
|
9
|
-
};
|
|
10
|
-
}) => void;
|
|
11
4
|
export declare const wuiIcon: (name: string, size?: number) => string;
|
|
12
5
|
export declare const fadeOutError: (node: Element) => void;
|
|
13
6
|
export declare const setFieldError: (host: HTMLElement | null, message: string, { errorClassEl }?: {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare const initSelectableTables: (root?: ParentNode) => void;
|
|
2
|
+
export declare const initExpandableTables: (root?: ParentNode) => void;
|
|
2
3
|
export declare const initSortableTables: (root?: ParentNode) => void;
|
|
3
4
|
export declare const initTableToolbars: () => void;
|
|
4
5
|
export declare const markRowLinks: (root?: ParentNode) => void;
|
|
@@ -53,7 +53,6 @@ export declare const REMOTE_MODAL_TEXT: Readonly<Record<TextKey, string>>;
|
|
|
53
53
|
export declare function resolveModalSize(size: string | number | null | undefined): SizeSpec | null;
|
|
54
54
|
/** A drawer size as the shell applies it: sm | md | lg | xl are drawer widths, or a positive px number. Empty is null. */
|
|
55
55
|
export declare function resolveDrawerSize(size: string | number | null | undefined): SizeSpec | null;
|
|
56
|
-
export declare function wrapTab(shell: HTMLElement, e: KeyboardEvent): void;
|
|
57
56
|
/** Wire the remote modal shells and the delegated trigger under `root`. */
|
|
58
57
|
export declare function initRemoteModals(root?: Document | Element): void;
|
|
59
58
|
/**
|
package/types/statusIcons.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ElementBase } from "./elementBase.ts";
|
|
2
2
|
export declare const STATUS_TONES: string[];
|
|
3
3
|
/**
|
|
4
|
-
* `<wui-status-icon tone="delete" size="104"
|
|
4
|
+
* `<wui-status-icon tone="delete" size="104">`: decorative, aria-hidden. The dialog's
|
|
5
5
|
* title and message carry the meaning.
|
|
6
6
|
*/
|
|
7
7
|
export declare class WuiStatusIcon extends ElementBase {
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare const TOOLTIP_ATTRIBUTE = "data-wui-tooltip";
|
|
2
|
+
export declare const TOOLTIP_PLACEMENT_ATTRIBUTE = "data-wui-tooltip-placement";
|
|
3
|
+
export declare const TOOLTIP_CLASS_ATTRIBUTE = "data-wui-tooltip-class";
|
|
4
|
+
export declare const TOOLTIP_HTML_ATTRIBUTE = "data-wui-tooltip-html";
|
|
5
|
+
export declare const TOOLTIP_ID_ATTRIBUTE = "data-wui-tooltip-id";
|
|
6
|
+
export declare const TOOLTIP_OPEN_ATTRIBUTE = "data-wui-tooltip-open";
|
|
7
|
+
/**
|
|
8
|
+
* One set of delegated listeners per document for every tooltip trigger. A trigger carries TOOLTIP_ATTRIBUTE (text; with
|
|
9
|
+
* TOOLTIP_HTML_ATTRIBUTE the value is trusted server markup) or TOOLTIP_ID_ATTRIBUTE (the id of a bubble the caller rendered).
|
|
10
|
+
* Shows on hover and on keyboard focus (:focus-visible), hides on leave, blur, a click on the trigger and Escape.
|
|
11
|
+
* The bubble is a popover="manual" element inside overlayRoot():
|
|
12
|
+
* <div class="tooltip wui-tooltip bs-tooltip-{placement} {class}" role="tooltip" popover="manual">
|
|
13
|
+
* <div class="tooltip-arrow"></div><div class="tooltip-inner">…</div></div>
|
|
14
|
+
* The class names the placement asked for, auto included. Idempotent.
|
|
15
|
+
*/
|
|
16
|
+
export declare function wireTooltips(doc: Document): void;
|
|
17
|
+
/** Shows every trigger under `root` that carries TOOLTIP_OPEN_ATTRIBUTE. Pinned tooltips stay shown together, each in its own bubble. */
|
|
18
|
+
export declare function showPinnedTooltips(root: Document | Element): void;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./buttonClass-GtEi8hAY.js";import{n,t as r}from"./copyText-Q-QZKBmx.js";import{t as i}from"./elementBase-Cxeyx0tU.js";import{t as a}from"./iconGlyphs.g-DPqoOoXy.js";Object.freeze([`text`,`json`,`js`,`cs`,`sql`,`bash`,`http`,`html`,`css`]);var o=Object.freeze({text:``,json:`JSON`,js:`JavaScript`,cs:`C#`,sql:`SQL`,bash:`Bash`,http:`HTTP`,html:`HTML`,css:`CSS`}),s=e=>RegExp(`\\b(?:${e.join(`|`)})\\b`),c=`(?![\\s\\S])`,l=RegExp(`/\\*[\\s\\S]*?(?:\\*/|${c})`).source,u=[[`attr`,/"(?:[^"\\\n]|\\.)*"(?=\s*:)/],[`string`,/"(?:[^"\\\n]|\\.)*"?/],[`number`,/-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?\b/],[`literal`,s([`true`,`false`,`null`])],[`punct`,/[{}[\],:]/]],d=[[`comment`,RegExp(`//[^\\n]*|${l}`)],[`string`,/"(?:[^"\\\n]|\\.)*"?|'(?:[^'\\\n]|\\.)*'?|`(?:[^`\\]|\\[\s\S])*`?/],[`number`,/\b(?:0[xX][\da-fA-F_]+|\d[\d_]*\.?\d*(?:[eE][+-]?\d+)?n?)\b/],[`keyword`,s(/* @__PURE__ */ `async.await.break.case.catch.class.const.continue.default.delete.do.else.export.extends.finally.for.from.function.if.import.in.instanceof.let.new.of.return.static.super.switch.this.throw.try.typeof.var.void.while.yield`.split(`.`))],[`literal`,s([`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`])],[`function`,/(?<![\w$])[A-Za-z_$][\w$]*(?=\s*\()/],[`type`,/(?<![\w$])[A-Z][\w$]*/],[`punct`,/[{}()[\];,]/]],f=[[`comment`,RegExp(`//[^\\n]*|${l}`)],[`string`,/@"(?:[^"]|"")*"?|\$@?"(?:[^"\\\n]|\\.)*"?|"(?:[^"\\\n]|\\.)*"?|'(?:[^'\\\n]|\\.)*'?/],[`number`,/\b\d[\d_]*\.?\d*(?:[eE][+-]?\d+)?[fFdDmMlLuU]{0,2}\b/],[`keyword`,s(/* @__PURE__ */ `abstract.as.async.await.base.bool.break.byte.case.catch.char.checked.class.const.continue.decimal.default.delegate.do.double.else.enum.event.explicit.extern.finally.fixed.float.for.foreach.get.goto.if.implicit.in.init.int.interface.internal.is.lock.long.namespace.new.object.operator.out.override.params.private.protected.public.readonly.record.ref.required.return.sbyte.sealed.set.short.sizeof.static.string.struct.switch.this.throw.try.typeof.uint.ulong.unchecked.unsafe.ushort.using.var.virtual.void.volatile.when.while.with`.split(`.`))],[`literal`,s([`true`,`false`,`null`])],[`function`,/(?<!\w)[A-Za-z_]\w*(?=\s*\()/],[`type`,/(?<!\w)[A-Z]\w*/],[`punct`,/[{}()[\];,]/]],p=[[`comment`,RegExp(`--[^\\n]*|${l}`)],[`string`,/'(?:[^']|'')*'?/],[`variable`,/@@?\w+/],[`number`,/\b\d+(?:\.\d+)?\b/],[`keyword`,s(/* @__PURE__ */ `add.all.alter.and.as.asc.begin.between.by.case.check.column.commit.constraint.create.cross.database.declare.default.delete.desc.distinct.drop.else.end.exec.execute.exists.foreign.from.full.function.group.having.if.in.index.inner.insert.into.is.join.key.left.like.limit.not.null.offset.on.or.order.outer.over.partition.primary.procedure.references.return.returns.right.rollback.select.set.table.then.top.transaction.union.unique.update.values.view.when.where.while.with`.split(`.`))],[`literal`,s([`true`,`false`])],[`type`,s([`bigint`,`bit`,`char`,`date`,`datetime`,`datetime2`,`decimal`,`float`,`int`,`money`,`nchar`,`numeric`,`nvarchar`,`real`,`smallint`,`text`,`time`,`tinyint`,`uniqueidentifier`,`varchar`])],[`function`,/\b[A-Za-z_]\w*(?=\s*\()/],[`punct`,/[(),;]/]],m=[[`comment`,/(?<![^\s;|&(])#[^\n]*/],[`string`,/"(?:[^"\\]|\\[\s\S])*"?|'[^']*'?/],[`variable`,/\$(?:\{[^}\n]*\}?|[A-Za-z_]\w*|[0-9@#?$!*-])/],[`attr`,/(?<![\w-])--?[A-Za-z][\w-]*/],[`number`,/(?<![\w.-])\d+(?:\.\d+)?\b/],[`keyword`,s([`case`,`do`,`done`,`elif`,`else`,`esac`,`exit`,`export`,`fi`,`for`,`function`,`if`,`in`,`local`,`return`,`select`,`then`,`until`,`while`])],[`function`,s(/* @__PURE__ */ `awk.az.cat.cd.chmod.chown.cp.curl.docker.dotnet.echo.gcloud.git.grep.kubectl.ls.mkdir.mv.npm.npx.pnpm.rm.sed.source.sudo.wget`.split(`.`))],[`punct`,/[|&;<>(){}[\]]+/]],h=[[`comment`,/^#[^\n]*/m],[`keyword`,/^(?:GET|POST|PUT|PATCH|DELETE|HEAD|OPTIONS|TRACE|CONNECT)(?= )/m],[`literal`,/HTTP\/\d(?:\.\d)?/],[`number`,/(?<=^HTTP\/\d(?:\.\d)? )\d{3}\b/m],[`function`,/(?<=^[A-Z]+ )\S+/m],[`attr`,/^[A-Za-z][\w-]*(?=:)/m],[`string`,/(?<=^[A-Za-z][\w-]*:[ \t]*)[^\n]+/m]],g=[[`comment`,RegExp(`<!--[\\s\\S]*?(?:-->|${c})`)],[`keyword`,/<![A-Za-z][^>]*>?/],[`tag`,/<\/?[A-Za-z][^<>]*>?/],[`literal`,/&#?\w+;/]],_={json:u,js:d,cs:f,sql:p,bash:m,http:h,css:[[`comment`,new RegExp(l)],[`string`,/"(?:[^"\\\n]|\\.)*"?|'(?:[^'\\\n]|\\.)*'?/],[`keyword`,/@[\w-]+|!important/],[`attr`,/[\w-]+(?=\s*:[^{};]*[;}])/],[`number`,/#[0-9a-fA-F]{3,8}\b|(?<![\w-])-?(?:\d+\.?\d*|\.\d+)(?:%|[A-Za-z]{1,4})?/],[`function`,/[\w-]+(?=\()/],[`type`,/[.#](?!\d)[A-Za-z_][\w-]*/],[`punct`,/[{}();:,]/]],html:g,htmlTag:[[`tag`,/^<\/?[\w:.-]+/],[`string`,/"[^"]*"?|'[^']*'?/],[`attr`,/(?<=\s)[^\s=<>/"']+/],[`punct`,/\/?>|=/]]},v=e=>Object.hasOwn(_,e),y=/* @__PURE__ */ new Map;function b(e){let t=y.get(e);if(!t){let n=_[e],r=e===`sql`?`gi`:`g`,i=n.map(([,e])=>`(${e.source})`).join(`|`);t={re:new RegExp(i,`${r}m`),types:n.map(([e])=>e)},y.set(e,t)}return t}function x(e,t,n){if(!n)return;let r=e[e.length-1];r&&r[0]===t?r[1]+=n:e.push([t,n])}function S(e,t,n=[]){let{re:r,types:i}=b(e),a=0;for(let o of t.matchAll(r)){let r=o[0];if(!r)continue;x(n,`plain`,t.slice(a,o.index));let s=i.findIndex((e,t)=>o[t+1]!==void 0);e===`html`&&i[s]===`tag`?S(`htmlTag`,r,n):x(n,i[s]??`plain`,r),a=o.index+r.length}return x(n,`plain`,t.slice(a)),n}function C(e){let t=/\r?\n\r?\n/.exec(e);if(!t)return S(`http`,e);let n=t[0]??``,r=S(`http`,e.slice(0,t.index+n.length)),i=e.slice(t.index+n.length),a=i.trimStart()[0];return a===`{`||a===`[`?S(`json`,i,r):a===`<`?S(`html`,i,r):(x(r,`plain`,i),r)}function w(e,t){let n=String(e??``);return!n||n.length>1e5?n?[[`plain`,n]]:[]:t===`http`?C(n):!v(t)||t===`htmlTag`?[[`plain`,n]]:S(t,n)}function T(e,t){let n=[],r=[n];for(let[i,a]of w(e,t))a.split(/\r\n|\r|\n/).forEach((e,t)=>{t>0&&(n=[],r.push(n)),e&&n.push([i,e])});return r.length>1&&n.length===0&&r.pop(),r}function E(e){return Object.hasOwn(o,e)}var D=class extends i{_title;_view;_codeEl;_copyIcon;_copyText;_chrome=null;_copied=!1;_observer=null;_timer=0;_cancelFrame=null;constructor(){super();let e=this.ownerDocument;this._title=e.createElement(`span`),this._title.className=`wui-code-title`,this._view=e.createElement(`div`),this._codeEl=e.createElement(`code`),this._copyIcon=e.createElement(`span`),this._copyIcon.className=`wui-code-copy-icon`,this._copyText=e.createElement(`span`)}static get observedAttributes(){return[`language`,`line-numbers`,`wrap`,`label`,`copy-label`,`copied-label`]}connectedCallback(){this._render(),typeof MutationObserver<`u`&&(this._observer=new MutationObserver(e=>{e.some(e=>!this._chrome?.contains(e.target))&&this._schedule()}),this._observer.observe(this,{childList:!0,subtree:!0,characterData:!0}))}disconnectedCallback(){this._observer?.disconnect(),this._observer=null,this._cancelPending()}attributeChangedCallback(){this.isConnected&&this._render()}_source(){return Array.from(this.children).find(e=>e.classList.contains(`wui-code-source`))}_code(){return(this._source()?.textContent??``).replace(/\r?\n$/,``)}_schedule(){if(this._cancelFrame)return;let e=()=>{this._cancelFrame=null,this._render()};if(typeof requestAnimationFrame==`function`){let t=requestAnimationFrame(e);this._cancelFrame=()=>cancelAnimationFrame(t)}else{let t=!0;queueMicrotask(()=>{t&&e()}),this._cancelFrame=()=>{t=!1}}}_cancelPending(){this._cancelFrame?.(),this._cancelFrame=null}_render(){if(!this._source())return;this._cancelPending();let e=this.ownerDocument;this._chrome||this._build(e);let t=this.getAttribute(`language`),n=t!==null&&E(t)?t:`text`,r=this.getAttribute(`label`)||``,i=T(this._code(),n);this._title.textContent=r||o[n],this._view.setAttribute(`aria-label`,r||`Code`),this._view.style.setProperty(`--wui-code-digits`,String(String(i.length).length)),this._codeEl.replaceChildren(...i.map(t=>O(e,t))),this._copied||(this._copyText.textContent=this._copyLabel()),this.setAttribute(`data-wui-ready`,``),this._observer?.takeRecords()}_build(e){let t=e.createElement(`div`);t.className=`wui-code-chrome`,t.append(this._bar(e));let n=this._view;n.className=`wui-code-view`,n.setAttribute(`role`,`region`),n.tabIndex=0;let r=e.createElement(`pre`);r.className=`wui-code-pre`,r.append(this._codeEl),n.append(r),t.append(n),this._chrome=t,this.append(t)}_bar(i){let a=i.createElement(`div`);a.className=`wui-code-bar`;let o=i.createElement(`button`);return o.type=`button`,o.className=`${e(`primary`,`ghost`,`sm`)} wui-code-copy`,o.dataset.wui=t,o.setAttribute(`aria-live`,`polite`),this._setCopied(!1),o.append(this._copyIcon,this._copyText),o.addEventListener(`click`,async()=>{await n(this._code())&&(this._setCopied(!0),clearTimeout(this._timer),this._timer=window.setTimeout(()=>this._setCopied(!1),r))}),a.append(this._title,o),a}_setCopied(e){this._copied=e,this._copyIcon.innerHTML=a(e?`check`:`files`,{size:14}),this._copyText.textContent=this._copyLabel()}_copyLabel(){return this._copied?this.getAttribute(`copied-label`)||`Copied`:this.getAttribute(`copy-label`)||`Copy`}};function O(e,t){let n=e.createElement(`span`);n.className=`wui-code-line`;for(let[r,i]of t){if(r===`plain`){n.append(i);continue}let t=e.createElement(`span`);t.className=`wui-code-t-${r}`,t.textContent=i,n.append(t)}return n}export{D as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,r as t,t as n}from"./anchorOverlay-CXnWfezA.js";import{n as r,t as i}from"./buttonClass-GtEi8hAY.js";import{a,i as o,n as s,r as c}from"./commentText-BnX7rA2-.js";import{t as l}from"./elementBase-Cxeyx0tU.js";import{l as u}from"./wuiHttp-DGbD7Fra.js";import{i as d}from"./WuiMentionInput-B_K8AXM5.js";var f=`[data-wui-items]`,p=`[data-wui-picker]`,m=`[data-wui-composer]`,h=`[data-wui-comment]`,g=`[data-wui-live]`,_=e=>{let t=typeof e==`object`&&e&&`message`in e?e.message:void 0;return typeof t==`string`&&t?t:a},v=e=>e instanceof Element?e:null,y=e=>`disabled`in e&&e.disabled===!0,b=(e,t)=>{if(e==null)throw Error(`${t} missing`);return e},x=(e,t,n)=>{let r=e?.querySelector(t);return r instanceof n?r:null},S=(e,t,n)=>{let r=e?.closest(t);return r instanceof n?r:null},C=(e,t,n)=>e?[...e.querySelectorAll(t)].filter(e=>e instanceof n):[],w=class extends l{_wired;_busy;_peopleProp;_pickerFor;_onDocClick;_repositionPicker;_openers;constructor(){super(),this._wired=!1,this._busy=!1,this._peopleProp=null,this._pickerFor=null,this._onClick=this._onClick.bind(this),this._onKeyDown=this._onKeyDown.bind(this),this._onSubmitKey=this._onSubmitKey.bind(this),this._onDocClick=e=>{this._pickerFor&&!x(this,p,HTMLElement)?.contains(v(e.target))&&!this._pickerFor.button.contains(v(e.target))&&this._closePicker(!1)},this._repositionPicker=()=>{this._pickerFor&&n(this._pickerFor.button,x(this,p,HTMLElement))}}connectedCallback(){if(Object.hasOwn(this,`people`)){let e=this.people;Reflect.deleteProperty(this,`people`),this.people=e}if(this._wired)return;this._wired=!0,this.addEventListener(`click`,this._onClick),this.addEventListener(`keydown`,this._onKeyDown),this.addEventListener(`wui:mention-input:submit`,this._onSubmitKey),customElements.upgrade(this);let e=x(this,`${m} wui-mention-input`,d);this._handPeople(e),this._applyComposerPlaceholder(e)}disconnectedCallback(){this._closePicker(!1)}get people(){return this._peopleProp?this._peopleProp:C(this,`:scope > [data-wui-people] > wui-option`,HTMLElement).map(e=>({value:e.getAttribute(`value`)??``,label:(e.textContent??``).trim(),description:e.getAttribute(`data-description`)||void 0,src:e.getAttribute(`data-src`)||void 0}))}set people(e){this._peopleProp=Array.isArray(e)?e:[];for(let e of this.querySelectorAll(`wui-mention-input`))e.people=this._peopleProp}_handPeople(e){!e||this.hasAttribute(`remote`)||this.hasAttribute(`source`)||(e.people=this.people)}_applyComposerPlaceholder(e){let t=this.getAttribute(`composer-placeholder`);e&&t!=null&&e.setAttribute(`placeholder`,t)}_reactionChoices(){let e=this.getAttribute(`reaction-choices`),t=e?e.split(/\s+/).filter(Boolean):[];return t.length?t:s}_onClick(e){let t=S(v(e.target),`[data-wui-emoji]`,HTMLElement);if(t&&this.contains(t)&&!y(t)){let e=t.closest(p),n=e?this._pickerFor?.comment:t.closest(h);e&&this._closePicker(!0),n&&this._react(n,t.getAttribute(`data-wui-emoji`));return}let n=S(v(e.target),`[data-wui-action]`,HTMLElement);if(!n||!this.contains(n)||y(n))return;let r=n.closest(h);switch(n.getAttribute(`data-wui-action`)){case`reply`:this._openReply(r,n);break;case`edit`:this._openEditor(r,n);break;case`delete`:this._askDelete(r);break;case`cancel-delete`:this._closeConfirm(r,!0);break;case`confirm-delete`:{let e=b(r,`comment`);this._send(`delete`,{commentId:e.getAttribute(`data-wui-comment`)},{comment:e,scope:e});break}case`react-menu`:this._pickerFor?.button===n?this._closePicker(!0):this._openPicker(r,n);break;case`cancel`:this._closeSlot(S(n,`[data-wui-reply], [data-wui-editor]`,HTMLElement),!0);break;case`post`:case`send`:this._sendFrom(n)}}_onKeyDown(e){let t=x(this,p,HTMLElement),n=v(e.target);if(this._pickerFor&&t?.contains(n)){let r=C(t,`[data-wui-emoji]`,HTMLElement),i=n instanceof HTMLElement?r.indexOf(n):-1;e.key===`Escape`?(e.preventDefault(),e.stopPropagation(),this._closePicker(!0)):e.key===`ArrowRight`||e.key===`ArrowLeft`?(e.preventDefault(),r[(i+(e.key===`ArrowRight`?1:-1)+r.length)%r.length]?.focus()):e.key===`Tab`&&this._closePicker(!1);return}if(e.key!==`Escape`)return;let r=S(n,`[data-wui-reply], [data-wui-editor]`,HTMLElement);if(r&&this.contains(r)){e.preventDefault(),e.stopPropagation(),this._closeSlot(r,!0);return}let i=S(n,`[data-wui-confirm]`,HTMLElement);i&&(e.preventDefault(),e.stopPropagation(),this._closeConfirm(i.closest(h),!0))}_onSubmitKey(e){let t=x(S(v(e.target),`[data-wui-reply], [data-wui-editor], [data-wui-composer]`,HTMLElement),`[data-wui-action="send"], [data-wui-action="post"]`,HTMLElement);t&&!y(t)&&this._sendFrom(t)}_openReply(e,t){if(this.hasAttribute(`no-replies`))return;let n=x(e,`:scope > [data-wui-reply]`,HTMLElement);if(!n)return;if(!n.hidden){n.querySelector(`wui-mention-input`)?.focus();return}let r=e?.querySelector(`.wui-comment-author`)?.textContent?.trim()||``;this._fillSlot(n,{label:c.replyLabel(r),placeholder:c.replyPlaceholder,value:``,send:c.reply,opener:t})}_openEditor(e,t){let n=x(e,`:scope > .wui-comment-row [data-wui-editor]`,HTMLElement);if(!n?.hidden)return;let r=x(b(n.parentElement,`comment row`),`:scope > [data-wui-text]`,HTMLElement);r&&(r.hidden=!0),this._fillSlot(n,{label:c.editLabel,placeholder:``,value:e?.getAttribute(`data-value`)??``,send:c.save,opener:t})}_fillSlot(e,{label:t,placeholder:n,value:r,send:i,opener:a}){let o=this.ownerDocument,s=o.createElement(`wui-mention-input`);s.className=`wui-mention-input`,s.setAttribute(`label`,t),n&&s.setAttribute(`placeholder`,n),s.setAttribute(`rows`,`2`),s.setAttribute(`value`,r);for(let e of[`remote`,`source`,`min-chars`,`debounce`]){let t=this.getAttribute(e);t!=null&&s.setAttribute(e,t)}let l=o.createElement(`div`);l.className=`wui-comment-form-actions`,l.append(this._button(`primary`,`solid`,`sm`,`send`,i),this._button(`primary`,`ghost`,`sm`,`cancel`,c.cancel));let u=o.createElement(`div`);u.className=`wui-comment-error`,u.setAttribute(`data-wui-error`,``),u.hidden=!0,e.replaceChildren(s,l,u),this._handPeople(s),e.hidden=!1,this._openers??=/* @__PURE__ */ new WeakMap,this._openers.set(e,a),s.focus();let d=s.querySelector(`textarea`);d?.setSelectionRange(d.value.length,d.value.length)}_button(e,t,n,a,o){let s=this.ownerDocument.createElement(`button`);return s.type=`button`,s.className=r(e,t,n),s.dataset.wui=i,s.setAttribute(`data-wui-action`,a),s.textContent=o,s}_closeSlot(e,t){if(!e||e.hidden)return;if(e.hidden=!0,e.replaceChildren(),e.hasAttribute(`data-wui-editor`)){let t=x(e.parentElement,`:scope > [data-wui-text]`,HTMLElement);t&&(t.hidden=!1)}let n=this._openers?.get(e);t&&n?.isConnected&&n.focus()}_askDelete(e){let t=x(e,`:scope > .wui-comment-row`,HTMLElement),n=x(t,`[data-wui-confirm]`,HTMLElement),r=x(t,`[data-wui-actions]`,HTMLElement);n&&(n.hidden=!1,r&&(r.hidden=!0),x(n,`[data-wui-action="cancel-delete"]`,HTMLElement)?.focus())}_closeConfirm(e,t){let n=x(e,`:scope > .wui-comment-row`,HTMLElement),r=x(n,`[data-wui-confirm]`,HTMLElement),i=x(n,`[data-wui-actions]`,HTMLElement);r&&(r.hidden=!0),i&&(i.hidden=!1),t&&x(i,`[data-wui-action="delete"]`,HTMLElement)?.focus()}_openPicker(t,r){let i=x(this,p,HTMLElement);i&&t&&!this.hasAttribute(`no-reactions`)&&(this._closePicker(!1),this._pickerFor={comment:t,button:r},r.setAttribute(`aria-expanded`,`true`),i.hidden=!1,n(r,i),e(this,this._repositionPicker),this.ownerDocument.addEventListener(`click`,this._onDocClick,!0),x(i,`[data-wui-emoji]`,HTMLElement)?.focus())}_closePicker(e){let n=this._pickerFor;if(!n)return;this._pickerFor=null;let r=x(this,p,HTMLElement);r&&(r.hidden=!0),n.button.setAttribute(`aria-expanded`,`false`),t(this),this.ownerDocument.removeEventListener(`click`,this._onDocClick,!0),e&&n.button.isConnected&&n.button.focus()}_react(e,t){t&&!this.hasAttribute(`no-reactions`)&&this._send(`react`,{commentId:e.getAttribute(`data-wui-comment`),emoji:t},{comment:e,scope:e})}_sendFrom(e){let t=S(e,`[data-wui-reply], [data-wui-editor], [data-wui-composer]`,HTMLElement);if(!t)return;let n=t.querySelector(`wui-mention-input`),r=n?.value??``;if(!r.trim()){this._showError(t,c.emptyBody),n?.focus();return}let i=t.closest(h);t.hasAttribute(`data-wui-composer`)?this._send(`post`,{body:r},{scope:t,form:t}):t.hasAttribute(`data-wui-reply`)?this._send(`reply`,{parentId:b(i,`comment`).getAttribute(`data-wui-comment`),body:r},{comment:i,scope:t,form:t}):this._send(`edit`,{commentId:b(i,`comment`).getAttribute(`data-wui-comment`),body:r},{comment:i,scope:t,form:t})}async _send(e,t,{comment:n,scope:r,form:i}){if(this._busy)return;this._busy=!0,this.setAttribute(`aria-busy`,`true`);let a=i??x(n,`:scope > .wui-comment-row`,HTMLElement)??this;this._showError(a,null);let o=[...r.querySelectorAll(`button, textarea`)].filter(e=>e instanceof HTMLButtonElement||e instanceof HTMLTextAreaElement).filter(e=>!e.disabled);for(let e of o)e.disabled=!0;let s=await this._persist({intent:e,...t});for(let e of o)e.isConnected&&(e.disabled=!1);this._busy=!1,this.removeAttribute(`aria-busy`);let l=t.commentId??null,u=t.parentId??null;s.ok?(s.html!=null&&this._swapItems(s.html),e===`post`?i?.querySelector(`wui-mention-input`)?.clear():i?.isConnected&&this._closeSlot(i,!1),e===`delete`&&n?.isConnected&&this._closeConfirm(n,!1),this._restoreFocus(e,t,i),c.done[e]&&this._announce(c.done[e]),this.dispatchEvent(new CustomEvent(`wui:comment-thread:done`,{bubbles:!0,detail:{intent:e,commentId:l,parentId:u}}))):s.kind!==`session`&&s.kind!==`aborted`&&(this._showError(a.isConnected?a:this,s.message),this._announce(s.message),this.dispatchEvent(new CustomEvent(`wui:comment-thread:failed`,{bubbles:!0,detail:{intent:e,kind:s.kind,message:s.message}})))}async _persist(e){if(this.hasAttribute(`controlled`)){if(typeof this.submit!=`function`)return{ok:!0,html:null};try{return await this.submit(e),{ok:!0,html:null}}catch(e){return{ok:!1,kind:`server`,message:_(e)}}}let t=this.getAttribute(`action`);if(!t)return{ok:!1,kind:`client`,message:o};let n=new URLSearchParams;for(let[t,r]of Object.entries(e))r!=null&&n.set(t,r);let r=await u(t,{method:`POST`,body:n});return r.ok?{ok:!0,html:r.html}:{ok:!1,kind:r.kind,message:r.message||c.failed[r.kind]||`Something went wrong on our side. Try again in a moment.`}}_swapItems(e){let t=x(this,f,HTMLElement);if(!t||!e.trim())return;let n=this.ownerDocument.createElement(`template`);n.innerHTML=e;let r=x(n.content,f,HTMLElement);t.replaceChildren(...r?r.childNodes:n.content.childNodes)}_restoreFocus(e,t,n){let r=this.ownerDocument,i=r.activeElement;if(i&&i!==r.body&&i.isConnected&&this.contains(i)&&!y(i))return;let a=e=>e?C(this,h,HTMLElement).find(t=>t.getAttribute(`data-wui-comment`)===e):null,o=e=>x(a(e),`:scope > .wui-comment-row`,HTMLElement),s=null;if(e===`post`)s=n?.querySelector(`textarea`);else if(e===`reply`)s=x(o(t.parentId),`[data-wui-action="reply"]`,HTMLElement);else if(e===`edit`)s=x(o(t.commentId),`[data-wui-action="edit"]`,HTMLElement);else if(e===`react`){let e=o(t.commentId);s=C(e,`button[data-wui-emoji]`,HTMLButtonElement).find(e=>e.getAttribute(`data-wui-emoji`)===t.emoji)??x(e,`[data-wui-action="react-menu"]`,HTMLElement)}s??=x(this,`${m} textarea`,HTMLTextAreaElement),s?.focus()}_showError(e,t){let n=x(e,`:scope > [data-wui-error], :scope > .wui-comment-main > [data-wui-error]`,HTMLElement);n&&(n.textContent=t||``,n.hidden=!t)}_announce(e){let t=x(this,`:scope > ${g}`,HTMLElement);t&&e&&(t.textContent=``,t.textContent=e)}};export{w as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./anchorOverlay-CXnWfezA.js";import{t}from"./elementBase-Cxeyx0tU.js";import{t as n}from"./imeSafeEnter-DPs9qL3S.js";import{t as r}from"./listboxKeyNav-DkLHwzJE.js";var i=`[role="menuitem"]`,a=`.wui-context-menu-sub`,o=`input.wui-context-menu-search`,s=`input, textarea, select, [contenteditable=""], [contenteditable="true"]`,c=`data-open`,l=500,u=10,d=400,f=null,p=null,m=0,h=/* @__PURE__ */ new WeakMap;function g(e,t,n){let r=h.get(e);if(r){if(r.region===t||t.contains(r.region))return!1;r.cancel()}return h.set(e,{region:t,cancel:n}),!0}var _=e=>e instanceof Element?e:e instanceof Node?e.parentElement:null,v=e=>`focus`in e,y=e=>[...e.childNodes].filter(e=>e.nodeType===Node.TEXT_NODE||e instanceof Element&&!e.matches(`.wui-context-menu-hint, .wui-context-menu-tick`)).map(e=>e.textContent).join(``),b=(e,t)=>[...e.querySelectorAll(t)].filter(e=>e instanceof HTMLElement),x=e=>[...e.children].filter(e=>e instanceof HTMLElement),S=(e,t)=>{let n=e.children[t];if(!(n instanceof HTMLElement))throw Error(`a submenu holds its opener and then its panel`);return n},C=e=>S(e,0),w=e=>S(e,1),T=(e,t)=>{let n=e?.closest(t);return n instanceof HTMLElement?n:null},E=class extends t{_region;_origin;_returnFocus;_press;_swallowClick;_navPanel;_nav;_onContextMenu;_onContextMenuCapture;_onDocKeyDown;_onDocClick;_onPointerDown;_onPressMove;_onPressEnd;_onClickCapture;_onKeyDown;_onClick;_onInput;_onMouseMove;_onDismiss;_onPointerDownCapture;static get observedAttributes(){return[`disabled`,`open`]}constructor(){super(),this._region=null,this._origin=null,this._returnFocus=null,this._press=null,this._swallowClick=!1,this._navPanel=null,this._nav=r({getVisibleOptions:()=>this._rowsOf(this._navPanel),getActive:()=>{let e=document.activeElement,t=this._rowsOf(this._navPanel);return e?t.indexOf(e):-1},setActive:e=>this._rowsOf(this._navPanel)[e]?.focus({preventScroll:!0})}),this._onContextMenu=e=>this._handleContextMenu(e),this._onContextMenuCapture=e=>{this.isOpen&&!this._inPanel(e.target)&&!this._isKeyEcho()&&this.close()},this._onDocKeyDown=e=>this._handleDocKeyDown(e),this._onDocClick=e=>this._handleDocClick(e),this._onPointerDown=e=>this._handlePointerDown(e),this._onPressMove=e=>{this._press&&Math.hypot(e.clientX-this._press.x,e.clientY-this._press.y)>u&&this._cancelPress()},this._onPressEnd=()=>this._cancelPress(),this._onClickCapture=e=>{if(this._swallowClick&&this._region){if(!(e.target instanceof Node))throw Error(`a click target is always a node`);this._region.contains(e.target)&&(this._swallowClick=!1,e.preventDefault(),e.stopImmediatePropagation())}},this._onKeyDown=e=>{this._inPanel(e.target)&&this._handleMenuKey(e)},this._onClick=e=>this._handleClick(e),this._onInput=e=>this._handleInput(e),this._onMouseMove=e=>{let t=T(_(e.target),i);t&&this._inPanel(t)&&!this._isDisabled(t)&&t!==document.activeElement&&t.focus({preventScroll:!0})},this._onDismiss=e=>{this.hasAttribute(`open`)||e.type===`scroll`&&this._inPanel(e.target)||this.close()},this._onPointerDownCapture=e=>{this._swallowClick=!1,this.isOpen&&!this.hasAttribute(`open`)&&!this._inPanel(e.target)&&this.close()}}connectedCallback(){this._teardown(),document.addEventListener(`contextmenu`,this._onContextMenuCapture,!0),document.addEventListener(`contextmenu`,this._onContextMenu),document.addEventListener(`keydown`,this._onDocKeyDown),document.addEventListener(`pointerdown`,this._onPointerDownCapture,!0),document.addEventListener(`pointerdown`,this._onPointerDown),document.addEventListener(`click`,this._onClickCapture,!0),document.addEventListener(`click`,this._onDocClick),window.addEventListener(`keydown`,this._onKeyDown,!0),this.addEventListener(`click`,this._onClick),this.addEventListener(`input`,this._onInput),this.addEventListener(`mousemove`,this._onMouseMove),this._syncOpen()}disconnectedCallback(){this._teardown()}attributeChangedCallback(e){e===`open`?this.isConnected&&this._syncOpen():this.disabled&&this.close()}get target(){return this.getAttribute(`target`)}set target(e){e==null||e===``?this.removeAttribute(`target`):this.setAttribute(`target`,String(e))}get disabled(){return this.hasAttribute(`disabled`)}set disabled(e){this.toggleAttribute(`disabled`,!!e)}get isOpen(){return this._panel()?.hasAttribute(c)??!1}open(t,n,{region:r=this,origin:i=r,trigger:a=null,keyboard:o=!1}={}){let s=this._panel();if(!s)return!1;let l=new CustomEvent(`wui-context-menu:beforeopen`,{bubbles:!0,cancelable:!0,detail:{region:r,origin:i,trigger:a}});if(this.dispatchEvent(l),l.defaultPrevented)return!1;if(this._decorate(s),f&&f!==this&&f.close(!0),!this.isOpen){let e=document.activeElement;this._returnFocus=e&&e!==document.body&&!this._inPanel(e)&&v(e)?e:null}return this._region=r,this._origin=i,p=null,s.setAttribute(c,``),f=this,e({getBoundingClientRect:()=>({x:t,y:n,left:t,right:t,top:n,bottom:n,width:0,height:0,toJSON:()=>({})})},s,{clampHeight:!0}),window.addEventListener(`scroll`,this._onDismiss,!0),window.addEventListener(`resize`,this._onDismiss),window.addEventListener(`blur`,this._onDismiss),((o?this._rowsOf(s)[0]:null)??s).focus({preventScroll:!0}),this.dispatchEvent(new CustomEvent(`wui-context-menu:open`,{bubbles:!0,detail:{region:r,origin:i,x:t,y:n}})),!0}_syncOpen(){if(!this.hasAttribute(`open`)){this.close(this._inPanel(document.activeElement));return}let e=this.target?document.querySelector(this.target):this,t=e&&this._regionRect(e);e&&t&&this.open(t.left,t.top,{region:e,origin:e})}_regionRect(e){if(e!==this)return e.getBoundingClientRect();let t=[...this.children].filter(e=>e!==this._panel()).map(e=>e.getBoundingClientRect());return t.length?{left:Math.min(...t.map(e=>e.left)),top:Math.min(...t.map(e=>e.top))}:null}close(e=!1){let t=this._panel();if(!t?.hasAttribute(c))return;for(let e of b(t,a))this._setSub(e,!1);t.removeAttribute(c),f===this&&(f=null),window.removeEventListener(`scroll`,this._onDismiss,!0),window.removeEventListener(`resize`,this._onDismiss),window.removeEventListener(`blur`,this._onDismiss),this._nav.teardown();let n=this._returnFocus;this._returnFocus=null,e&&n?.isConnected&&n.focus({preventScroll:!0})}_panel(){return x(this).find(e=>e.getAttribute(`role`)===`menu`)??null}_inPanel(e){return e instanceof Node&&!!this._panel()?.contains(e)}_rowsOf(e){return e?b(e,i).filter(t=>t.closest(`[role="menu"]`)===e&&!this._isDisabled(t)&&!t.closest(`[hidden]`)):[]}_isDisabled(e){return e.getAttribute(`aria-disabled`)===`true`}_regionFor(e){let t=_(e);if(!t||this.disabled||!this._panel()||this._inPanel(t)||t.closest(s))return null;let n=this.target;return n?t.closest(n):this.contains(t)?this:null}_triggerFor(e){let t=_(e),n=this.getAttribute(`trigger`);if(!t||!n||this._inPanel(t))return null;let r=T(t,n),i=r&&this._regionFor(r);return r&&i?{trigger:r,region:i}:null}_isKeyEcho(){return p?.menu===this&&this.isOpen&&performance.now()-p.at<d}_handleContextMenu(e){if(this._inPanel(e.target)){e.preventDefault();return}if(e.defaultPrevented&&!h.has(e))return;let t=this._regionFor(e.target);t&&(this._isKeyEcho()?e.preventDefault():e.shiftKey||g(e,t,()=>this.close(!0))&&this.open(e.clientX,e.clientY,{region:t,origin:_(e.target)})&&e.preventDefault())}_handleDocKeyDown(e){if(e.defaultPrevented&&!h.has(e))return;if(n(e)){let t=this._triggerFor(e.target);if(!t||!g(e,t.region,()=>this.close(!0)))return;e.preventDefault(),t.trigger.click();return}if(!(e.key===`ContextMenu`||e.key===`F10`&&e.shiftKey)||this._inPanel(e.target))return;let t=this._regionFor(e.target);if(!t||!g(e,t,()=>this.close(!0)))return;let r=_(e.target);if(!r)return;let i=r.getBoundingClientRect();this.open(i.left+Math.min(16,i.width/2),i.bottom,{region:t,origin:r,keyboard:!0})&&(e.preventDefault(),p={menu:this,at:performance.now()})}_handleDocClick(e){let t=this._triggerFor(e.target);if(!t||!g(e,t.region,()=>this.close(!0)))return;let n=t.trigger.getBoundingClientRect();this.open(n.left,n.bottom,{region:t.region,origin:t.trigger,trigger:t.trigger,keyboard:e.detail===0})}_handlePointerDown(e){if(e.pointerType!==`touch`)return;let t=this._regionFor(e.target);if(!t||!g(e,t,()=>this._cancelPress()))return;this._cancelPress();let{clientX:n,clientY:r}=e,i=_(e.target);this._press={x:n,y:r,timer:setTimeout(()=>{this._cancelPress(),this.open(n,r,{region:t,origin:i})&&(this._swallowClick=!0)},l)},document.addEventListener(`pointermove`,this._onPressMove,{passive:!0}),document.addEventListener(`pointerup`,this._onPressEnd),document.addEventListener(`pointercancel`,this._onPressEnd),window.addEventListener(`scroll`,this._onPressEnd,!0)}_cancelPress(){this._press&&(clearTimeout(this._press.timer),this._press=null,document.removeEventListener(`pointermove`,this._onPressMove),document.removeEventListener(`pointerup`,this._onPressEnd),document.removeEventListener(`pointercancel`,this._onPressEnd),window.removeEventListener(`scroll`,this._onPressEnd,!0))}_handleMenuKey(e){if(!this.isOpen)return;let t=_(e.target);if(!t)return;if(t.matches(o)){this._handleSearchKey(e,t);return}let r=T(t,`[role="menu"]`);if(!r)return;let a=T(t,i),s=r.matches(`.wui-context-menu-subpanel`)?r.parentElement:null;if(e.key===`Escape`){if(e.preventDefault(),e.stopPropagation(),s)this._closeSubByKey(s);else{let e=this._openSubOf(r);e?this._closeSubByKey(e):this.close(!0)}}else if(e.key===`Tab`)this.close(!0);else if(e.key===`ArrowDown`||e.key===`ArrowUp`)e.preventDefault(),e.stopPropagation(),this._step(r,a,e.key===`ArrowDown`?1:-1);else if(e.key===`ArrowRight`){let t=a&&this._subOf(a);if(!t)return;e.preventDefault(),this._openSub(t,!0)}else if(e.key===`ArrowLeft`){if(!s)return;e.preventDefault(),this._closeSubByKey(s)}else n(e)||e.key===` `?(e.preventDefault(),a?.click()):(this._navPanel=r,this._nav.handler(e))}_handleSearchKey(e,t){let n=T(t,a);if(!n)return;let r=this._rowsOf(w(n));e.key===`Escape`?(e.preventDefault(),e.stopPropagation(),this._closeSubByKey(n)):e.key===`ArrowDown`?(e.preventDefault(),r[0]?.focus({preventScroll:!0})):e.key===`ArrowUp`?(e.preventDefault(),r[r.length-1]?.focus({preventScroll:!0})):e.key===`Tab`&&this.close(!0)}_step(e,t,n){let r=this._rowsOf(e);if(!r.length)return;let i=t?r.indexOf(t):-1;r[i<0?n>0?0:r.length-1:(i+n+r.length)%r.length]?.focus({preventScroll:!0})}_subOf(e){return e.hasAttribute(`aria-haspopup`)&&e.parentElement?.matches(a)?e.parentElement:null}_openSubOf(e){return x(e).find(e=>e.matches(a)&&w(e).hasAttribute(c))??null}_openSub(e,t){let n=e.parentElement;if(!n)throw Error(`a submenu is always inside its menu panel`);for(let t of x(n))t!==e&&t.matches(a)&&this._closeSub(t);this._setSub(e,!0);let r=w(e).querySelector(`:scope > ${o}`),i=e.hasAttribute(`data-searchable`)&&r instanceof HTMLInputElement?r:null;i?(i.value=``,this._filter(e,``),i.focus({preventScroll:!0})):t&&this._rowsOf(w(e))[0]?.focus({preventScroll:!0})}_closeSub(e){for(let t of b(w(e),a))this._setSub(t,!1);this._setSub(e,!1)}_closeSubByKey(e){this._closeSub(e),C(e).focus({preventScroll:!0})}_setSub(t,n){let r=C(t),i=w(t);i.toggleAttribute(c,n),r.setAttribute(`aria-expanded`,String(n)),n?e(r,i,{beside:!0}):i.removeAttribute(`data-side`)}_filter(e,t){let n=t.trim().toLowerCase();for(let t of x(w(e)))t.tagName===`HR`?t.hidden=n!==``:t.matches(i)?t.hidden=n!==``&&!y(t).toLowerCase().includes(n):t.matches(a)&&(t.hidden=n!==``&&!y(C(t)).toLowerCase().includes(n))}_handleInput(e){let t=_(e.target)?.closest(o);if(!(t instanceof HTMLInputElement))return;let n=T(t,a);n?.hasAttribute(`data-searchable`)&&this._inPanel(n)&&this._filter(n,t.value)}_decorate(e){for(let t of b(e,i)){let e=t.getAttribute(`aria-checked`)===`true`,n=t.querySelector(`:scope > .wui-context-menu-tick`);if(e&&!n){let e=document.createElement(`span`);e.className=`wui-context-menu-tick`,e.setAttribute(`aria-hidden`,`true`),t.prepend(e)}else!e&&n&&n.remove();let r=t.querySelector(`:scope > .wui-context-menu-hint`),i=t.dataset.hint;if(i){let e=r??document.createElement(`span`);r||(e.className=`wui-context-menu-hint`,e.id=`wui-context-menu-hint-${++m}`,t.append(e)),e.textContent=i,t.setAttribute(`aria-describedby`,e.id)}else r&&(r.remove(),t.removeAttribute(`aria-describedby`))}}_handleClick(e){let t=T(_(e.target),i);if(!t||!this._inPanel(t))return;if(this._isDisabled(t)){e.preventDefault(),e.stopPropagation();return}let n=this._subOf(t);n?(e.preventDefault(),this._openSub(n,e.detail===0)):(this.close(!0),this.dispatchEvent(new CustomEvent(`wui-context-menu:select`,{bubbles:!0,detail:{key:t.dataset.key??null,item:t,region:this._region,origin:this._origin}})))}_teardown(){this.close(),this._cancelPress(),document.removeEventListener(`contextmenu`,this._onContextMenuCapture,!0),document.removeEventListener(`contextmenu`,this._onContextMenu),document.removeEventListener(`keydown`,this._onDocKeyDown),document.removeEventListener(`pointerdown`,this._onPointerDownCapture,!0),document.removeEventListener(`pointerdown`,this._onPointerDown),document.removeEventListener(`click`,this._onClickCapture,!0),document.removeEventListener(`click`,this._onDocClick),window.removeEventListener(`keydown`,this._onKeyDown,!0),this.removeEventListener(`click`,this._onClick),this.removeEventListener(`input`,this._onInput),this.removeEventListener(`mousemove`,this._onMouseMove)}};export{E as t};
|