@deepfuture/dui-components 0.0.20 → 1.0.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 +56 -65
- package/_install.js +11 -0
- package/accordion/accordion-item.d.ts +3 -20
- package/accordion/accordion-item.js +93 -292
- package/accordion/accordion.d.ts +3 -18
- package/accordion/accordion.js +9 -247
- package/accordion/index.d.ts +6 -6
- package/accordion/index.js +5 -5
- package/alert-dialog/alert-dialog-close.d.ts +3 -14
- package/alert-dialog/alert-dialog-close.js +4 -34
- package/alert-dialog/alert-dialog-popup.d.ts +3 -32
- package/alert-dialog/alert-dialog-popup.js +68 -317
- package/alert-dialog/alert-dialog-trigger.d.ts +3 -14
- package/alert-dialog/alert-dialog-trigger.js +4 -51
- package/alert-dialog/alert-dialog.d.ts +3 -30
- package/alert-dialog/alert-dialog.js +8 -158
- package/alert-dialog/index.d.ts +11 -11
- package/alert-dialog/index.js +9 -9
- package/all.d.ts +159 -123
- package/all.js +134 -231
- package/avatar/avatar.d.ts +3 -39
- package/avatar/avatar.js +18 -238
- package/avatar/index.d.ts +4 -4
- package/avatar/index.js +3 -3
- package/badge/badge.d.ts +3 -10
- package/badge/badge.js +88 -22
- package/badge/index.d.ts +2 -3
- package/badge/index.js +2 -3
- package/breadcrumb/breadcrumb-ellipsis.d.ts +3 -12
- package/breadcrumb/breadcrumb-ellipsis.js +8 -34
- package/breadcrumb/breadcrumb-item.d.ts +3 -11
- package/breadcrumb/breadcrumb-item.js +7 -26
- package/breadcrumb/breadcrumb-link.d.ts +3 -12
- package/breadcrumb/breadcrumb-link.js +16 -26
- package/breadcrumb/breadcrumb-page.d.ts +3 -11
- package/breadcrumb/breadcrumb-page.js +8 -31
- package/breadcrumb/breadcrumb-separator.d.ts +3 -12
- package/breadcrumb/breadcrumb-separator.js +8 -31
- package/breadcrumb/breadcrumb.d.ts +3 -12
- package/breadcrumb/breadcrumb.js +10 -33
- package/breadcrumb/index.d.ts +12 -13
- package/breadcrumb/index.js +12 -13
- package/button/button.d.ts +3 -32
- package/button/button.js +221 -165
- package/button/index.d.ts +3 -3
- package/button/index.js +3 -3
- package/calendar/calendar.d.ts +3 -31
- package/calendar/calendar.js +71 -481
- package/calendar/index.d.ts +3 -3
- package/calendar/index.js +3 -3
- package/card/card.d.ts +3 -27
- package/card/card.js +80 -163
- package/card/index.d.ts +2 -3
- package/card/index.js +2 -3
- package/card-grid/card-grid.d.ts +3 -15
- package/card-grid/card-grid.js +8 -106
- package/card-grid/index.d.ts +2 -3
- package/card-grid/index.js +2 -3
- package/checkbox/checkbox-group.d.ts +3 -34
- package/checkbox/checkbox-group.js +11 -188
- package/checkbox/checkbox.d.ts +3 -47
- package/checkbox/checkbox.js +43 -341
- package/checkbox/index.d.ts +6 -6
- package/checkbox/index.js +5 -5
- package/collapsible/collapsible.d.ts +3 -20
- package/collapsible/collapsible.js +83 -277
- package/collapsible/index.d.ts +3 -3
- package/collapsible/index.js +3 -3
- package/combobox/combobox.d.ts +3 -47
- package/combobox/combobox.js +136 -538
- package/combobox/index.d.ts +4 -4
- package/combobox/index.js +3 -3
- package/command/command-empty.d.ts +3 -8
- package/command/command-empty.js +10 -88
- package/command/command-group.d.ts +3 -13
- package/command/command-group.js +15 -114
- package/command/command-input.d.ts +3 -11
- package/command/command-input.js +20 -136
- package/command/command-item.d.ts +3 -18
- package/command/command-item.js +24 -212
- package/command/command-list.d.ts +3 -7
- package/command/command-list.js +11 -79
- package/command/command-separator.d.ts +3 -5
- package/command/command-separator.js +10 -11
- package/command/command-shortcut.d.ts +3 -5
- package/command/command-shortcut.js +9 -12
- package/command/command.d.ts +3 -23
- package/command/command.js +10 -339
- package/command/index.d.ts +17 -19
- package/command/index.js +16 -18
- package/data-table/data-table.d.ts +3 -57
- package/data-table/data-table.js +86 -449
- package/data-table/index.d.ts +3 -4
- package/data-table/index.js +2 -3
- package/dialog/dialog-close.d.ts +3 -14
- package/dialog/dialog-close.js +4 -34
- package/dialog/dialog-popup.d.ts +3 -34
- package/dialog/dialog-popup.js +70 -336
- package/dialog/dialog-trigger.d.ts +3 -14
- package/dialog/dialog-trigger.js +4 -51
- package/dialog/dialog.d.ts +3 -30
- package/dialog/dialog.js +8 -158
- package/dialog/index.d.ts +11 -11
- package/dialog/index.js +9 -9
- package/dropzone/dropzone.d.ts +3 -72
- package/dropzone/dropzone.js +29 -407
- package/dropzone/index.d.ts +4 -4
- package/dropzone/index.js +3 -3
- package/field/field.d.ts +3 -30
- package/field/field.js +34 -353
- package/field/index.d.ts +1 -0
- package/field/index.js +1 -0
- package/fieldset/fieldset.d.ts +3 -18
- package/fieldset/fieldset.js +21 -110
- package/fieldset/index.d.ts +1 -0
- package/fieldset/index.js +1 -0
- package/icon/icon.d.ts +3 -15
- package/icon/icon.js +4 -33
- package/icon/index.d.ts +2 -3
- package/icon/index.js +2 -3
- package/input/index.d.ts +3 -3
- package/input/index.js +3 -3
- package/input/input.d.ts +3 -49
- package/input/input.js +57 -238
- package/menu/index.d.ts +4 -5
- package/menu/index.js +4 -5
- package/menu/menu-item.d.ts +3 -13
- package/menu/menu-item.js +41 -91
- package/menu/menu.d.ts +3 -15
- package/menu/menu.js +27 -277
- package/menubar/index.d.ts +3 -4
- package/menubar/index.js +2 -3
- package/menubar/menubar.d.ts +3 -19
- package/menubar/menubar.js +12 -183
- package/number-field/index.d.ts +3 -3
- package/number-field/index.js +3 -3
- package/number-field/number-field.d.ts +3 -55
- package/number-field/number-field.js +205 -698
- package/package.json +126 -113
- package/popover/index.d.ts +11 -11
- package/popover/index.js +9 -9
- package/popover/popover-close.d.ts +3 -12
- package/popover/popover-close.js +4 -32
- package/popover/popover-popup.d.ts +3 -18
- package/popover/popover-popup.js +28 -205
- package/popover/popover-trigger.d.ts +3 -13
- package/popover/popover-trigger.js +4 -73
- package/popover/popover.d.ts +3 -29
- package/popover/popover.js +8 -207
- package/portal/index.d.ts +3 -4
- package/portal/index.js +2 -3
- package/portal/portal.d.ts +3 -27
- package/portal/portal.js +8 -157
- package/preview-card/index.d.ts +9 -9
- package/preview-card/index.js +7 -7
- package/preview-card/preview-card-popup.d.ts +3 -14
- package/preview-card/preview-card-popup.js +29 -193
- package/preview-card/preview-card-trigger.d.ts +3 -12
- package/preview-card/preview-card-trigger.js +4 -74
- package/preview-card/preview-card.d.ts +3 -33
- package/preview-card/preview-card.js +8 -239
- package/progress/index.d.ts +2 -3
- package/progress/index.js +2 -3
- package/progress/progress.d.ts +3 -17
- package/progress/progress.js +28 -130
- package/radio/index.d.ts +6 -6
- package/radio/index.js +5 -5
- package/radio/radio-group.d.ts +3 -37
- package/radio/radio-group.js +8 -200
- package/radio/radio.d.ts +3 -28
- package/radio/radio.js +38 -213
- package/scroll-area/index.d.ts +2 -3
- package/scroll-area/index.js +2 -3
- package/scroll-area/scroll-area.d.ts +3 -36
- package/scroll-area/scroll-area.js +25 -546
- package/select/index.d.ts +3 -4
- package/select/index.js +2 -3
- package/select/select.d.ts +3 -37
- package/select/select.js +115 -403
- package/separator/index.d.ts +2 -3
- package/separator/index.js +2 -3
- package/separator/separator.d.ts +3 -10
- package/separator/separator.js +23 -84
- package/sidebar/index.d.ts +29 -29
- package/sidebar/index.js +27 -32
- package/sidebar/sidebar-content.d.ts +3 -12
- package/sidebar/sidebar-content.js +7 -29
- package/sidebar/sidebar-footer.d.ts +3 -10
- package/sidebar/sidebar-footer.js +7 -20
- package/sidebar/sidebar-group-label.d.ts +3 -15
- package/sidebar/sidebar-group-label.js +17 -41
- package/sidebar/sidebar-group.d.ts +3 -13
- package/sidebar/sidebar-group.js +7 -24
- package/sidebar/sidebar-header.d.ts +3 -10
- package/sidebar/sidebar-header.js +7 -16
- package/sidebar/sidebar-inset.d.ts +3 -13
- package/sidebar/sidebar-inset.js +7 -28
- package/sidebar/sidebar-menu-button.d.ts +3 -26
- package/sidebar/sidebar-menu-button.js +60 -217
- package/sidebar/sidebar-menu-item.d.ts +3 -10
- package/sidebar/sidebar-menu-item.js +7 -19
- package/sidebar/sidebar-menu.d.ts +3 -12
- package/sidebar/sidebar-menu.js +7 -25
- package/sidebar/sidebar-provider.d.ts +3 -34
- package/sidebar/sidebar-provider.js +22 -232
- package/sidebar/sidebar-separator.d.ts +3 -10
- package/sidebar/sidebar-separator.js +9 -19
- package/sidebar/sidebar-trigger.d.ts +3 -14
- package/sidebar/sidebar-trigger.js +10 -46
- package/sidebar/sidebar.d.ts +3 -19
- package/sidebar/sidebar.js +65 -262
- package/slider/index.d.ts +3 -3
- package/slider/index.js +3 -3
- package/slider/slider.d.ts +3 -45
- package/slider/slider.js +97 -382
- package/spinner/index.d.ts +2 -3
- package/spinner/index.js +2 -3
- package/spinner/spinner.d.ts +3 -11
- package/spinner/spinner.js +20 -163
- package/split-button/index.d.ts +3 -1
- package/split-button/index.js +3 -1
- package/split-button/split-button.d.ts +3 -31
- package/split-button/split-button.js +307 -384
- package/stepper/index.d.ts +3 -3
- package/stepper/index.js +3 -3
- package/stepper/stepper.d.ts +3 -41
- package/stepper/stepper.js +57 -381
- package/switch/index.d.ts +3 -3
- package/switch/index.js +3 -3
- package/switch/switch.d.ts +3 -30
- package/switch/switch.js +63 -228
- package/tabs/index.d.ts +12 -12
- package/tabs/index.js +11 -11
- package/tabs/tab.d.ts +3 -14
- package/tabs/tab.js +33 -131
- package/tabs/tabs-indicator.d.ts +3 -9
- package/tabs/tabs-indicator.js +17 -22
- package/tabs/tabs-list.d.ts +3 -15
- package/tabs/tabs-list.js +14 -113
- package/tabs/tabs-panel.d.ts +3 -16
- package/tabs/tabs-panel.js +32 -114
- package/tabs/tabs.d.ts +3 -22
- package/tabs/tabs.js +8 -170
- package/textarea/index.d.ts +4 -4
- package/textarea/index.js +3 -3
- package/textarea/textarea.d.ts +3 -36
- package/textarea/textarea.js +63 -220
- package/toggle/index.d.ts +6 -6
- package/toggle/index.js +5 -5
- package/toggle/toggle-group.d.ts +3 -27
- package/toggle/toggle-group.js +9 -224
- package/toggle/toggle.d.ts +3 -26
- package/toggle/toggle.js +94 -178
- package/tokens/properties.css +361 -0
- package/tokens/prose.css +250 -0
- package/tokens/prose.d.ts +2 -0
- package/tokens/prose.js +4 -0
- package/tokens/tokens-raw.d.ts +2 -0
- package/tokens/tokens-raw.js +2 -0
- package/tokens/tokens.css +409 -0
- package/tokens/tokens.d.ts +2 -0
- package/tokens/tokens.js +5 -0
- package/toolbar/index.d.ts +2 -3
- package/toolbar/index.js +2 -3
- package/toolbar/toolbar.d.ts +3 -11
- package/toolbar/toolbar.js +25 -116
- package/tooltip/index.d.ts +9 -9
- package/tooltip/index.js +7 -7
- package/tooltip/tooltip-popup.d.ts +3 -14
- package/tooltip/tooltip-popup.js +32 -185
- package/tooltip/tooltip-trigger.d.ts +3 -14
- package/tooltip/tooltip-trigger.js +5 -148
- package/tooltip/tooltip.d.ts +3 -35
- package/tooltip/tooltip.js +8 -253
- package/trunc/index.d.ts +2 -3
- package/trunc/index.js +2 -3
- package/trunc/trunc.d.ts +3 -17
- package/trunc/trunc.js +10 -108
- package/_deprecated/center/center.d.ts +0 -14
- package/_deprecated/center/center.js +0 -37
- package/_deprecated/center/index.d.ts +0 -3
- package/_deprecated/center/index.js +0 -3
- package/_deprecated/center/register.js +0 -4
- package/_deprecated/hstack/hstack.d.ts +0 -25
- package/_deprecated/hstack/hstack.js +0 -187
- package/_deprecated/hstack/index.d.ts +0 -4
- package/_deprecated/hstack/index.js +0 -3
- package/_deprecated/hstack/register.d.ts +0 -1
- package/_deprecated/hstack/register.js +0 -4
- package/_deprecated/page-inset/index.d.ts +0 -3
- package/_deprecated/page-inset/index.js +0 -3
- package/_deprecated/page-inset/page-inset.d.ts +0 -28
- package/_deprecated/page-inset/page-inset.js +0 -151
- package/_deprecated/page-inset/register.d.ts +0 -1
- package/_deprecated/page-inset/register.js +0 -4
- package/_deprecated/vstack/index.d.ts +0 -3
- package/_deprecated/vstack/index.js +0 -3
- package/_deprecated/vstack/register.d.ts +0 -1
- package/_deprecated/vstack/register.js +0 -4
- package/_deprecated/vstack/vstack.d.ts +0 -17
- package/_deprecated/vstack/vstack.js +0 -125
- package/accordion/accordion-context.d.ts +0 -15
- package/accordion/accordion-context.js +0 -3
- package/alert-dialog/alert-dialog-context.d.ts +0 -13
- package/alert-dialog/alert-dialog-context.js +0 -3
- package/checkbox/checkbox-group-context.d.ts +0 -11
- package/checkbox/checkbox-group-context.js +0 -3
- package/command/command-context.d.ts +0 -30
- package/command/command-context.js +0 -3
- package/command/command-score.d.ts +0 -6
- package/command/command-score.js +0 -31
- package/dialog/dialog-context.d.ts +0 -13
- package/dialog/dialog-context.js +0 -3
- package/global.d.ts +0 -179
- package/menubar/menubar-context.d.ts +0 -9
- package/menubar/menubar-context.js +0 -2
- package/popover/popover-context.d.ts +0 -17
- package/popover/popover-context.js +0 -3
- package/preview-card/preview-card-context.d.ts +0 -16
- package/preview-card/preview-card-context.js +0 -3
- package/radio/radio-group-context.d.ts +0 -11
- package/radio/radio-group-context.js +0 -2
- package/sidebar/sidebar-context.d.ts +0 -15
- package/sidebar/sidebar-context.js +0 -3
- package/split-button/register.d.ts +0 -1
- package/split-button/register.js +0 -4
- package/tabs/tabs-context.d.ts +0 -8
- package/tabs/tabs-context.js +0 -2
- package/toggle/toggle-group-context.d.ts +0 -9
- package/toggle/toggle-group-context.js +0 -2
- package/tooltip/tooltip-context.d.ts +0 -17
- package/tooltip/tooltip-context.js +0 -3
- /package/{_deprecated/center/register.d.ts → _install.d.ts} +0 -0
package/menu/menu.js
CHANGED
|
@@ -1,280 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
13
|
-
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
14
|
-
if (kind === "accessor") {
|
|
15
|
-
if (result === void 0) continue;
|
|
16
|
-
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
17
|
-
if (_ = accept(result.get)) descriptor.get = _;
|
|
18
|
-
if (_ = accept(result.set)) descriptor.set = _;
|
|
19
|
-
if (_ = accept(result.init)) initializers.unshift(_);
|
|
20
|
-
}
|
|
21
|
-
else if (_ = accept(result)) {
|
|
22
|
-
if (kind === "field") initializers.unshift(_);
|
|
23
|
-
else descriptor[key] = _;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
27
|
-
done = true;
|
|
28
|
-
};
|
|
29
|
-
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
30
|
-
var useValue = arguments.length > 2;
|
|
31
|
-
for (var i = 0; i < initializers.length; i++) {
|
|
32
|
-
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
33
|
-
}
|
|
34
|
-
return useValue ? value : void 0;
|
|
35
|
-
};
|
|
36
|
-
var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) {
|
|
37
|
-
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
|
|
38
|
-
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
|
39
|
-
};
|
|
40
|
-
import { css, html, LitElement } from "lit";
|
|
41
|
-
import { property, state } from "lit/decorators.js";
|
|
42
|
-
import { base } from "@deepfuture/dui-core/base";
|
|
43
|
-
import { FloatingPortalController } from "@deepfuture/dui-core/floating-portal-controller";
|
|
44
|
-
import { DuiMenuItem } from "./menu-item.js";
|
|
45
|
-
const hostStyles = css `
|
|
46
|
-
:host {
|
|
47
|
-
display: block;
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
import { DuiMenuPrimitive } from "@deepfuture/dui-primitives/menu";
|
|
3
|
+
import "../_install.js";
|
|
4
|
+
const styles = css `
|
|
5
|
+
.Popup {
|
|
6
|
+
background: var(--surface-3);
|
|
7
|
+
border: var(--border-width-thin) solid var(--border);
|
|
8
|
+
border-radius: var(--radius-md);
|
|
9
|
+
box-shadow: var(--shadow-md);
|
|
10
|
+
transition-duration: var(--duration-fast);
|
|
11
|
+
transition-timing-function: var(--ease-out-3);
|
|
48
12
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
.
|
|
52
|
-
|
|
53
|
-
cursor: pointer;
|
|
13
|
+
|
|
14
|
+
.Popup[data-starting-style],
|
|
15
|
+
.Popup[data-ending-style] {
|
|
16
|
+
transform: translateY(calc(var(--space-1) * -1));
|
|
54
17
|
}
|
|
55
|
-
`;
|
|
56
|
-
/** Structural styles injected into the portal positioner. */
|
|
57
|
-
const portalPopupStyles = [
|
|
58
|
-
css `
|
|
59
|
-
.Popup {
|
|
60
|
-
max-height: 240px;
|
|
61
|
-
overflow-y: auto;
|
|
62
|
-
overscroll-behavior: contain;
|
|
63
|
-
opacity: 1;
|
|
64
|
-
transform: translateY(0);
|
|
65
|
-
transition-property: opacity, transform;
|
|
66
|
-
pointer-events: auto;
|
|
67
|
-
}
|
|
68
18
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
let DuiMenu = (() => {
|
|
82
|
-
let _classSuper = LitElement;
|
|
83
|
-
let _popupMinWidth_decorators;
|
|
84
|
-
let _popupMinWidth_initializers = [];
|
|
85
|
-
let _popupMinWidth_extraInitializers = [];
|
|
86
|
-
let _private_highlightedIndex_decorators;
|
|
87
|
-
let _private_highlightedIndex_initializers = [];
|
|
88
|
-
let _private_highlightedIndex_extraInitializers = [];
|
|
89
|
-
let _private_highlightedIndex_descriptor;
|
|
90
|
-
return class DuiMenu extends _classSuper {
|
|
91
|
-
static {
|
|
92
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
93
|
-
_popupMinWidth_decorators = [property({ attribute: "popup-min-width" })];
|
|
94
|
-
_private_highlightedIndex_decorators = [state()];
|
|
95
|
-
__esDecorate(this, null, _popupMinWidth_decorators, { kind: "accessor", name: "popupMinWidth", static: false, private: false, access: { has: obj => "popupMinWidth" in obj, get: obj => obj.popupMinWidth, set: (obj, value) => { obj.popupMinWidth = value; } }, metadata: _metadata }, _popupMinWidth_initializers, _popupMinWidth_extraInitializers);
|
|
96
|
-
__esDecorate(this, _private_highlightedIndex_descriptor = { get: __setFunctionName(function () { return this.#highlightedIndex_accessor_storage; }, "#highlightedIndex", "get"), set: __setFunctionName(function (value) { this.#highlightedIndex_accessor_storage = value; }, "#highlightedIndex", "set") }, _private_highlightedIndex_decorators, { kind: "accessor", name: "#highlightedIndex", static: false, private: true, access: { has: obj => #highlightedIndex in obj, get: obj => obj.#highlightedIndex, set: (obj, value) => { obj.#highlightedIndex = value; } }, metadata: _metadata }, _private_highlightedIndex_initializers, _private_highlightedIndex_extraInitializers);
|
|
97
|
-
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
98
|
-
}
|
|
99
|
-
static tagName = "dui-menu";
|
|
100
|
-
static styles = [base, hostStyles, componentStyles];
|
|
101
|
-
#popupMinWidth_accessor_storage = __runInitializers(this, _popupMinWidth_initializers, "var(--space-28)");
|
|
102
|
-
/** Sets `min-width` on the popup panel (e.g. `"200px"`). Defaults to `"var(--space-28)".` */
|
|
103
|
-
get popupMinWidth() { return this.#popupMinWidth_accessor_storage; }
|
|
104
|
-
set popupMinWidth(value) { this.#popupMinWidth_accessor_storage = value; }
|
|
105
|
-
#highlightedIndex_accessor_storage = (__runInitializers(this, _popupMinWidth_extraInitializers), __runInitializers(this, _private_highlightedIndex_initializers, -1));
|
|
106
|
-
get #highlightedIndex() { return _private_highlightedIndex_descriptor.get.call(this); }
|
|
107
|
-
set #highlightedIndex(value) { return _private_highlightedIndex_descriptor.set.call(this, value); }
|
|
108
|
-
#getTriggerElement = (__runInitializers(this, _private_highlightedIndex_extraInitializers), () => {
|
|
109
|
-
const slot = this.shadowRoot?.querySelector('slot[name="trigger"]');
|
|
110
|
-
return slot?.assignedElements()?.[0];
|
|
111
|
-
});
|
|
112
|
-
#popup = new FloatingPortalController(this, {
|
|
113
|
-
getAnchor: () => this.#getTriggerElement() ?? this,
|
|
114
|
-
matchWidth: false,
|
|
115
|
-
styles: portalPopupStyles,
|
|
116
|
-
contentContainer: ".Menu",
|
|
117
|
-
contentSelector: "dui-menu-item, dui-separator",
|
|
118
|
-
onOpen: () => {
|
|
119
|
-
this.#highlightedIndex = -1;
|
|
120
|
-
this.#getTriggerElement()?.setAttribute("data-open", "");
|
|
121
|
-
},
|
|
122
|
-
onClose: () => {
|
|
123
|
-
this.#highlightedIndex = -1;
|
|
124
|
-
this.#getTriggerElement()?.removeAttribute("data-open");
|
|
125
|
-
},
|
|
126
|
-
renderPopup: (portal) => html `
|
|
127
|
-
<div
|
|
128
|
-
class="Popup"
|
|
129
|
-
style="${this.popupMinWidth ? `min-width:${this.popupMinWidth}` : ""}"
|
|
130
|
-
?data-starting-style="${portal.isStarting}"
|
|
131
|
-
?data-ending-style="${portal.isEnding}"
|
|
132
|
-
>
|
|
133
|
-
<div
|
|
134
|
-
class="Menu"
|
|
135
|
-
id="${this.#menuId}"
|
|
136
|
-
role="menu"
|
|
137
|
-
@click="${this.#onItemSlotClick}"
|
|
138
|
-
@mousemove="${this.#onMenuMouseMove}"
|
|
139
|
-
></div>
|
|
140
|
-
</div>
|
|
141
|
-
`,
|
|
142
|
-
});
|
|
143
|
-
#menuId = `menu-${crypto.randomUUID().slice(0, 8)}`;
|
|
144
|
-
get #items() {
|
|
145
|
-
const container = this.#popup.renderRoot?.querySelector(".Menu") ?? this;
|
|
146
|
-
return [...container.querySelectorAll("dui-menu-item")];
|
|
147
|
-
}
|
|
148
|
-
updated() {
|
|
149
|
-
const items = this.#items;
|
|
150
|
-
for (let i = 0; i < items.length; i++) {
|
|
151
|
-
if (i === this.#highlightedIndex) {
|
|
152
|
-
items[i].setAttribute("data-highlighted", "");
|
|
153
|
-
}
|
|
154
|
-
else {
|
|
155
|
-
items[i].removeAttribute("data-highlighted");
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
#togglePopup() {
|
|
160
|
-
if (this.#popup.isOpen) {
|
|
161
|
-
this.#popup.close();
|
|
162
|
-
}
|
|
163
|
-
else {
|
|
164
|
-
this.#popup.open();
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
#onTriggerClick = (event) => {
|
|
168
|
-
event.stopPropagation();
|
|
169
|
-
event.preventDefault();
|
|
170
|
-
this.#togglePopup();
|
|
171
|
-
};
|
|
172
|
-
#onItemSlotClick = (event) => {
|
|
173
|
-
const item = event
|
|
174
|
-
.composedPath()
|
|
175
|
-
.find((el) => el instanceof HTMLElement && el.matches(DuiMenuItem.tagName));
|
|
176
|
-
if (item && !item.disabled) {
|
|
177
|
-
this.#popup.close();
|
|
178
|
-
}
|
|
179
|
-
};
|
|
180
|
-
#onKeyDown = (event) => {
|
|
181
|
-
const items = this.#items;
|
|
182
|
-
switch (event.key) {
|
|
183
|
-
case "ArrowDown": {
|
|
184
|
-
event.preventDefault();
|
|
185
|
-
if (!this.#popup.isOpen) {
|
|
186
|
-
this.#popup.open();
|
|
187
|
-
}
|
|
188
|
-
else {
|
|
189
|
-
let next = this.#highlightedIndex + 1;
|
|
190
|
-
while (next < items.length && items[next]?.disabled)
|
|
191
|
-
next++;
|
|
192
|
-
if (next < items.length)
|
|
193
|
-
this.#highlightedIndex = next;
|
|
194
|
-
}
|
|
195
|
-
break;
|
|
196
|
-
}
|
|
197
|
-
case "ArrowUp": {
|
|
198
|
-
event.preventDefault();
|
|
199
|
-
if (!this.#popup.isOpen) {
|
|
200
|
-
this.#popup.open();
|
|
201
|
-
}
|
|
202
|
-
else {
|
|
203
|
-
let prev = this.#highlightedIndex - 1;
|
|
204
|
-
while (prev >= 0 && items[prev]?.disabled)
|
|
205
|
-
prev--;
|
|
206
|
-
if (prev >= 0)
|
|
207
|
-
this.#highlightedIndex = prev;
|
|
208
|
-
}
|
|
209
|
-
break;
|
|
210
|
-
}
|
|
211
|
-
case "Home":
|
|
212
|
-
if (this.#popup.isOpen) {
|
|
213
|
-
event.preventDefault();
|
|
214
|
-
const firstEnabled = items.findIndex((item) => !item.disabled);
|
|
215
|
-
if (firstEnabled >= 0)
|
|
216
|
-
this.#highlightedIndex = firstEnabled;
|
|
217
|
-
}
|
|
218
|
-
break;
|
|
219
|
-
case "End":
|
|
220
|
-
if (this.#popup.isOpen) {
|
|
221
|
-
event.preventDefault();
|
|
222
|
-
for (let i = items.length - 1; i >= 0; i--) {
|
|
223
|
-
if (!items[i]?.disabled) {
|
|
224
|
-
this.#highlightedIndex = i;
|
|
225
|
-
break;
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
break;
|
|
230
|
-
case "Enter":
|
|
231
|
-
case " ": {
|
|
232
|
-
if (this.#popup.isOpen && this.#highlightedIndex >= 0) {
|
|
233
|
-
event.preventDefault();
|
|
234
|
-
const item = items[this.#highlightedIndex];
|
|
235
|
-
if (item && !item.disabled) {
|
|
236
|
-
item.click();
|
|
237
|
-
this.#popup.close();
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
else if (!this.#popup.isOpen) {
|
|
241
|
-
event.preventDefault();
|
|
242
|
-
this.#popup.open();
|
|
243
|
-
}
|
|
244
|
-
break;
|
|
245
|
-
}
|
|
246
|
-
case "Escape":
|
|
247
|
-
if (this.#popup.isOpen) {
|
|
248
|
-
event.preventDefault();
|
|
249
|
-
this.#popup.close();
|
|
250
|
-
}
|
|
251
|
-
break;
|
|
252
|
-
case "Tab":
|
|
253
|
-
if (this.#popup.isOpen) {
|
|
254
|
-
this.#popup.close();
|
|
255
|
-
}
|
|
256
|
-
break;
|
|
257
|
-
}
|
|
258
|
-
};
|
|
259
|
-
#onMenuMouseMove = () => {
|
|
260
|
-
if (this.#highlightedIndex >= 0) {
|
|
261
|
-
this.#highlightedIndex = -1;
|
|
262
|
-
}
|
|
263
|
-
};
|
|
264
|
-
render() {
|
|
265
|
-
return html `
|
|
266
|
-
<div
|
|
267
|
-
class="Trigger"
|
|
268
|
-
aria-haspopup="menu"
|
|
269
|
-
aria-expanded="${this.#popup.isOpen}"
|
|
270
|
-
aria-controls="${this.#menuId}"
|
|
271
|
-
@click="${this.#onTriggerClick}"
|
|
272
|
-
@keydown="${this.#onKeyDown}"
|
|
273
|
-
>
|
|
274
|
-
<slot name="trigger"></slot>
|
|
275
|
-
</div>
|
|
276
|
-
`;
|
|
277
|
-
}
|
|
278
|
-
};
|
|
279
|
-
})();
|
|
280
|
-
export { DuiMenu };
|
|
19
|
+
.Menu {
|
|
20
|
+
padding: var(--space-1);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.Menu dui-separator {
|
|
24
|
+
margin: var(--space-1) var(--space-2);
|
|
25
|
+
}
|
|
26
|
+
`;
|
|
27
|
+
export class DuiMenu extends DuiMenuPrimitive {
|
|
28
|
+
static styles = [...DuiMenuPrimitive.styles, styles];
|
|
29
|
+
}
|
|
30
|
+
customElements.define(DuiMenu.tagName, DuiMenu);
|
package/menubar/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
export { DuiMenubar };
|
|
3
|
-
export type { MenubarContext } from "
|
|
4
|
-
export declare const menubarFamily: (typeof DuiMenubar)[];
|
|
1
|
+
import "./menubar.js";
|
|
2
|
+
export { DuiMenubar } from "./menubar.js";
|
|
3
|
+
export type { MenubarContext } from "@deepfuture/dui-primitives/menubar";
|
package/menubar/index.js
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
export { DuiMenubar };
|
|
3
|
-
export const menubarFamily = [DuiMenubar];
|
|
1
|
+
import "./menubar.js";
|
|
2
|
+
export { DuiMenubar } from "./menubar.js";
|
package/menubar/menubar.d.ts
CHANGED
|
@@ -1,21 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
* `<dui-menubar>` — A horizontal bar of menus with coordinated open/close.
|
|
5
|
-
*
|
|
6
|
-
* Contains `<dui-menu>` children. When one menu is open, hovering another
|
|
7
|
-
* menu trigger opens it and closes the previous one.
|
|
8
|
-
*
|
|
9
|
-
* @slot - `dui-menu` children.
|
|
10
|
-
* @csspart root - The menubar container.
|
|
11
|
-
*/
|
|
12
|
-
export declare class DuiMenubar extends LitElement {
|
|
13
|
-
#private;
|
|
14
|
-
static tagName: "dui-menubar";
|
|
1
|
+
import { DuiMenubarPrimitive } from "@deepfuture/dui-primitives/menubar";
|
|
2
|
+
import "../_install.js";
|
|
3
|
+
export declare class DuiMenubar extends DuiMenubarPrimitive {
|
|
15
4
|
static styles: import("lit").CSSResult[];
|
|
16
|
-
accessor loop: boolean;
|
|
17
|
-
accessor orientation: "horizontal" | "vertical";
|
|
18
|
-
accessor _ctx: MenubarContext;
|
|
19
|
-
willUpdate(): void;
|
|
20
|
-
render(): TemplateResult;
|
|
21
5
|
}
|
package/menubar/menubar.js
CHANGED
|
@@ -1,187 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
5
|
-
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
6
|
-
var _, done = false;
|
|
7
|
-
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
8
|
-
var context = {};
|
|
9
|
-
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
10
|
-
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
11
|
-
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
12
|
-
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
13
|
-
if (kind === "accessor") {
|
|
14
|
-
if (result === void 0) continue;
|
|
15
|
-
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
16
|
-
if (_ = accept(result.get)) descriptor.get = _;
|
|
17
|
-
if (_ = accept(result.set)) descriptor.set = _;
|
|
18
|
-
if (_ = accept(result.init)) initializers.unshift(_);
|
|
19
|
-
}
|
|
20
|
-
else if (_ = accept(result)) {
|
|
21
|
-
if (kind === "field") initializers.unshift(_);
|
|
22
|
-
else descriptor[key] = _;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
26
|
-
done = true;
|
|
27
|
-
};
|
|
28
|
-
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
29
|
-
var useValue = arguments.length > 2;
|
|
30
|
-
for (var i = 0; i < initializers.length; i++) {
|
|
31
|
-
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
32
|
-
}
|
|
33
|
-
return useValue ? value : void 0;
|
|
34
|
-
};
|
|
35
|
-
var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) {
|
|
36
|
-
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
|
|
37
|
-
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
|
38
|
-
};
|
|
39
|
-
import { css, html, LitElement } from "lit";
|
|
40
|
-
import { property, state } from "lit/decorators.js";
|
|
41
|
-
import { provide } from "@lit/context";
|
|
42
|
-
import { base } from "@deepfuture/dui-core/base";
|
|
43
|
-
import { menubarContext, } from "./menubar-context.js";
|
|
44
|
-
/** Structural styles only — layout CSS. */
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
import { DuiMenubarPrimitive } from "@deepfuture/dui-primitives/menubar";
|
|
3
|
+
import "../_install.js";
|
|
45
4
|
const styles = css `
|
|
46
|
-
:host {
|
|
47
|
-
display: block;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
5
|
[part="root"] {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
flex-direction: column;
|
|
57
|
-
align-items: stretch;
|
|
6
|
+
gap: var(--space-1);
|
|
7
|
+
border: var(--border-width-thin) solid var(--border);
|
|
8
|
+
border-radius: var(--radius-md);
|
|
9
|
+
background: var(--background);
|
|
10
|
+
padding: var(--space-1);
|
|
58
11
|
}
|
|
59
12
|
`;
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
* menu trigger opens it and closes the previous one.
|
|
65
|
-
*
|
|
66
|
-
* @slot - `dui-menu` children.
|
|
67
|
-
* @csspart root - The menubar container.
|
|
68
|
-
*/
|
|
69
|
-
let DuiMenubar = (() => {
|
|
70
|
-
let _classSuper = LitElement;
|
|
71
|
-
let _loop_decorators;
|
|
72
|
-
let _loop_initializers = [];
|
|
73
|
-
let _loop_extraInitializers = [];
|
|
74
|
-
let _orientation_decorators;
|
|
75
|
-
let _orientation_initializers = [];
|
|
76
|
-
let _orientation_extraInitializers = [];
|
|
77
|
-
let _private_activeMenuId_decorators;
|
|
78
|
-
let _private_activeMenuId_initializers = [];
|
|
79
|
-
let _private_activeMenuId_extraInitializers = [];
|
|
80
|
-
let _private_activeMenuId_descriptor;
|
|
81
|
-
let __ctx_decorators;
|
|
82
|
-
let __ctx_initializers = [];
|
|
83
|
-
let __ctx_extraInitializers = [];
|
|
84
|
-
return class DuiMenubar extends _classSuper {
|
|
85
|
-
static {
|
|
86
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
87
|
-
_loop_decorators = [property({ type: Boolean })];
|
|
88
|
-
_orientation_decorators = [property({ reflect: true })];
|
|
89
|
-
_private_activeMenuId_decorators = [state()];
|
|
90
|
-
__ctx_decorators = [provide({ context: menubarContext }), state()];
|
|
91
|
-
__esDecorate(this, null, _loop_decorators, { kind: "accessor", name: "loop", static: false, private: false, access: { has: obj => "loop" in obj, get: obj => obj.loop, set: (obj, value) => { obj.loop = value; } }, metadata: _metadata }, _loop_initializers, _loop_extraInitializers);
|
|
92
|
-
__esDecorate(this, null, _orientation_decorators, { kind: "accessor", name: "orientation", static: false, private: false, access: { has: obj => "orientation" in obj, get: obj => obj.orientation, set: (obj, value) => { obj.orientation = value; } }, metadata: _metadata }, _orientation_initializers, _orientation_extraInitializers);
|
|
93
|
-
__esDecorate(this, _private_activeMenuId_descriptor = { get: __setFunctionName(function () { return this.#activeMenuId_accessor_storage; }, "#activeMenuId", "get"), set: __setFunctionName(function (value) { this.#activeMenuId_accessor_storage = value; }, "#activeMenuId", "set") }, _private_activeMenuId_decorators, { kind: "accessor", name: "#activeMenuId", static: false, private: true, access: { has: obj => #activeMenuId in obj, get: obj => obj.#activeMenuId, set: (obj, value) => { obj.#activeMenuId = value; } }, metadata: _metadata }, _private_activeMenuId_initializers, _private_activeMenuId_extraInitializers);
|
|
94
|
-
__esDecorate(this, null, __ctx_decorators, { kind: "accessor", name: "_ctx", static: false, private: false, access: { has: obj => "_ctx" in obj, get: obj => obj._ctx, set: (obj, value) => { obj._ctx = value; } }, metadata: _metadata }, __ctx_initializers, __ctx_extraInitializers);
|
|
95
|
-
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
96
|
-
}
|
|
97
|
-
static tagName = "dui-menubar";
|
|
98
|
-
static styles = [base, styles];
|
|
99
|
-
#loop_accessor_storage = __runInitializers(this, _loop_initializers, true);
|
|
100
|
-
get loop() { return this.#loop_accessor_storage; }
|
|
101
|
-
set loop(value) { this.#loop_accessor_storage = value; }
|
|
102
|
-
#orientation_accessor_storage = (__runInitializers(this, _loop_extraInitializers), __runInitializers(this, _orientation_initializers, "horizontal"));
|
|
103
|
-
get orientation() { return this.#orientation_accessor_storage; }
|
|
104
|
-
set orientation(value) { this.#orientation_accessor_storage = value; }
|
|
105
|
-
#activeMenuId_accessor_storage = (__runInitializers(this, _orientation_extraInitializers), __runInitializers(this, _private_activeMenuId_initializers, null));
|
|
106
|
-
get #activeMenuId() { return _private_activeMenuId_descriptor.get.call(this); }
|
|
107
|
-
set #activeMenuId(value) { return _private_activeMenuId_descriptor.set.call(this, value); }
|
|
108
|
-
#getMenus() {
|
|
109
|
-
return [...this.querySelectorAll("dui-menu")];
|
|
110
|
-
}
|
|
111
|
-
#openMenu = (__runInitializers(this, _private_activeMenuId_extraInitializers), (id) => {
|
|
112
|
-
this.#activeMenuId = id;
|
|
113
|
-
});
|
|
114
|
-
#closeAll = () => {
|
|
115
|
-
this.#activeMenuId = null;
|
|
116
|
-
};
|
|
117
|
-
#navigateToMenu = (direction) => {
|
|
118
|
-
const menus = this.#getMenus();
|
|
119
|
-
if (menus.length === 0)
|
|
120
|
-
return;
|
|
121
|
-
const currentIndex = menus.findIndex((m) => m.getAttribute("data-menubar-id") === this.#activeMenuId);
|
|
122
|
-
let nextIndex;
|
|
123
|
-
if (direction === "next") {
|
|
124
|
-
nextIndex = currentIndex + 1;
|
|
125
|
-
if (nextIndex >= menus.length) {
|
|
126
|
-
nextIndex = this.loop ? 0 : menus.length - 1;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
else {
|
|
130
|
-
nextIndex = currentIndex - 1;
|
|
131
|
-
if (nextIndex < 0) {
|
|
132
|
-
nextIndex = this.loop ? menus.length - 1 : 0;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
const nextMenu = menus[nextIndex];
|
|
136
|
-
if (!nextMenu)
|
|
137
|
-
return;
|
|
138
|
-
const nextId = nextMenu.getAttribute("data-menubar-id");
|
|
139
|
-
if (nextId) {
|
|
140
|
-
this.#activeMenuId = nextId;
|
|
141
|
-
}
|
|
142
|
-
// Focus the trigger of the next menu
|
|
143
|
-
const trigger = nextMenu.querySelector('[slot="trigger"]');
|
|
144
|
-
trigger?.focus();
|
|
145
|
-
};
|
|
146
|
-
#_ctx_accessor_storage = __runInitializers(this, __ctx_initializers, this.#buildContext());
|
|
147
|
-
get _ctx() { return this.#_ctx_accessor_storage; }
|
|
148
|
-
set _ctx(value) { this.#_ctx_accessor_storage = value; }
|
|
149
|
-
#buildContext() {
|
|
150
|
-
return {
|
|
151
|
-
activeMenuId: this.#activeMenuId,
|
|
152
|
-
openMenu: this.#openMenu,
|
|
153
|
-
closeAll: this.#closeAll,
|
|
154
|
-
navigateToMenu: this.#navigateToMenu,
|
|
155
|
-
};
|
|
156
|
-
}
|
|
157
|
-
willUpdate() {
|
|
158
|
-
this._ctx = this.#buildContext();
|
|
159
|
-
}
|
|
160
|
-
#onKeyDown = (__runInitializers(this, __ctx_extraInitializers), (e) => {
|
|
161
|
-
const isHorizontal = this.orientation === "horizontal";
|
|
162
|
-
const nextKey = isHorizontal ? "ArrowRight" : "ArrowDown";
|
|
163
|
-
const prevKey = isHorizontal ? "ArrowLeft" : "ArrowUp";
|
|
164
|
-
if (e.key === nextKey) {
|
|
165
|
-
e.preventDefault();
|
|
166
|
-
this.#navigateToMenu("next");
|
|
167
|
-
}
|
|
168
|
-
else if (e.key === prevKey) {
|
|
169
|
-
e.preventDefault();
|
|
170
|
-
this.#navigateToMenu("prev");
|
|
171
|
-
}
|
|
172
|
-
});
|
|
173
|
-
render() {
|
|
174
|
-
return html `
|
|
175
|
-
<div
|
|
176
|
-
part="root"
|
|
177
|
-
role="menubar"
|
|
178
|
-
aria-orientation="${this.orientation}"
|
|
179
|
-
@keydown="${this.#onKeyDown}"
|
|
180
|
-
>
|
|
181
|
-
<slot></slot>
|
|
182
|
-
</div>
|
|
183
|
-
`;
|
|
184
|
-
}
|
|
185
|
-
};
|
|
186
|
-
})();
|
|
187
|
-
export { DuiMenubar };
|
|
13
|
+
export class DuiMenubar extends DuiMenubarPrimitive {
|
|
14
|
+
static styles = [...DuiMenubarPrimitive.styles, styles];
|
|
15
|
+
}
|
|
16
|
+
customElements.define(DuiMenubar.tagName, DuiMenubar);
|
package/number-field/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
export { DuiNumberField
|
|
3
|
-
export
|
|
1
|
+
import "./number-field.js";
|
|
2
|
+
export { DuiNumberField } from "./number-field.js";
|
|
3
|
+
export { valueChangeEvent, valueCommittedEvent } from "@deepfuture/dui-primitives/number-field";
|
package/number-field/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
export { DuiNumberField
|
|
3
|
-
export
|
|
1
|
+
import "./number-field.js";
|
|
2
|
+
export { DuiNumberField } from "./number-field.js";
|
|
3
|
+
export { valueChangeEvent, valueCommittedEvent } from "@deepfuture/dui-primitives/number-field";
|
|
@@ -1,57 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}) => CustomEvent<{
|
|
5
|
-
value: number;
|
|
6
|
-
}>;
|
|
7
|
-
export declare const valueCommittedEvent: (detail: {
|
|
8
|
-
value: number;
|
|
9
|
-
}) => CustomEvent<{
|
|
10
|
-
value: number;
|
|
11
|
-
}>;
|
|
12
|
-
/**
|
|
13
|
-
* `<dui-number-field>` — A numeric input with optional label, icon,
|
|
14
|
-
* unit suffix, drag-to-scrub behavior, and precision formatting.
|
|
15
|
-
*
|
|
16
|
-
* For simple step-up/step-down with buttons, use `<dui-stepper>` instead.
|
|
17
|
-
*
|
|
18
|
-
* @csspart root - The outer container.
|
|
19
|
-
* @csspart label - Label text element.
|
|
20
|
-
* @csspart icon - Icon slot wrapper.
|
|
21
|
-
* @csspart input - The text input element.
|
|
22
|
-
* @csspart unit - Unit suffix element.
|
|
23
|
-
* @fires value-change - Fired when value changes. Detail: { value: number }
|
|
24
|
-
* @fires value-committed - Fired on pointerup (end of drag), blur, or Enter. Detail: { value: number }
|
|
25
|
-
*/
|
|
26
|
-
export declare class DuiNumberField extends LitElement {
|
|
27
|
-
#private;
|
|
28
|
-
static tagName: "dui-number-field";
|
|
29
|
-
static formAssociated: boolean;
|
|
30
|
-
static shadowRootOptions: ShadowRootInit;
|
|
1
|
+
import { DuiNumberFieldPrimitive } from "@deepfuture/dui-primitives/number-field";
|
|
2
|
+
import "../_install.js";
|
|
3
|
+
export declare class DuiNumberField extends DuiNumberFieldPrimitive {
|
|
31
4
|
static styles: import("lit").CSSResult[];
|
|
32
|
-
constructor();
|
|
33
|
-
accessor value: number | undefined;
|
|
34
|
-
accessor defaultValue: number | undefined;
|
|
35
|
-
accessor min: number | undefined;
|
|
36
|
-
accessor max: number | undefined;
|
|
37
|
-
accessor step: number;
|
|
38
|
-
accessor largeStep: number;
|
|
39
|
-
accessor disabled: boolean;
|
|
40
|
-
accessor readOnly: boolean;
|
|
41
|
-
accessor required: boolean;
|
|
42
|
-
accessor name: string | undefined;
|
|
43
|
-
accessor label: string;
|
|
44
|
-
accessor labelPosition: string;
|
|
45
|
-
accessor iconPosition: string;
|
|
46
|
-
accessor unit: string;
|
|
47
|
-
accessor precision: number | undefined;
|
|
48
|
-
accessor scrubLabel: boolean;
|
|
49
|
-
accessor scrubValue: boolean;
|
|
50
|
-
accessor scrubField: boolean;
|
|
51
|
-
accessor clickLabel: boolean;
|
|
52
|
-
accessor clickValue: boolean;
|
|
53
|
-
accessor clickField: boolean;
|
|
54
|
-
connectedCallback(): void;
|
|
55
|
-
willUpdate(): void;
|
|
56
|
-
render(): TemplateResult;
|
|
57
5
|
}
|