@deepfuture/dui-components 0.0.15 → 0.0.17
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 +32 -0
- package/accordion/accordion-item.js +1 -19
- package/all.d.ts +4 -0
- package/all.js +8 -0
- package/card-grid/card-grid.d.ts +17 -0
- package/card-grid/card-grid.js +110 -0
- package/card-grid/index.d.ts +3 -0
- package/card-grid/index.js +3 -0
- package/collapsible/collapsible.js +4 -17
- package/command/command-empty.js +1 -1
- package/command/command-group.js +1 -1
- package/command/command-item.js +1 -1
- package/number-field/index.d.ts +2 -2
- package/number-field/index.js +2 -2
- package/number-field/number-field.d.ts +24 -3
- package/number-field/number-field.js +426 -66
- package/package.json +14 -2
- package/popover/popover-popup.js +5 -1
- package/popover/popover-trigger.d.ts +1 -0
- package/popover/popover-trigger.js +17 -0
- package/preview-card/preview-card-popup.js +5 -1
- package/select/select.js +5 -0
- package/slider/slider.d.ts +8 -1
- package/slider/slider.js +92 -10
- package/split-button/index.d.ts +1 -0
- package/split-button/index.js +1 -0
- package/split-button/register.d.ts +1 -0
- package/split-button/register.js +4 -0
- package/split-button/split-button.d.ts +33 -0
- package/split-button/split-button.js +397 -0
- package/stepper/index.d.ts +3 -0
- package/stepper/index.js +3 -0
- package/stepper/stepper.d.ts +45 -0
- package/stepper/stepper.js +430 -0
- package/tabs/tabs-panel.d.ts +2 -2
- package/tabs/tabs-panel.js +9 -15
- package/tooltip/tooltip-popup.js +5 -1
|
@@ -0,0 +1,397 @@
|
|
|
1
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
2
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
3
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
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, nothing } from "lit";
|
|
40
|
+
import { property, state } from "lit/decorators.js";
|
|
41
|
+
import { base } from "@deepfuture/dui-core/base";
|
|
42
|
+
import { customEvent } from "@deepfuture/dui-core/event";
|
|
43
|
+
import { FloatingPortalController } from "@deepfuture/dui-core/floating-portal-controller";
|
|
44
|
+
import { DuiMenuItem } from "../menu/menu-item.js";
|
|
45
|
+
/** Fired when the action (left) button is clicked. */
|
|
46
|
+
export const actionEvent = customEvent("dui-action", { bubbles: true, composed: true });
|
|
47
|
+
/** Structural styles only — layout and behavioral CSS. */
|
|
48
|
+
const hostStyles = css `
|
|
49
|
+
:host {
|
|
50
|
+
display: inline-block;
|
|
51
|
+
}
|
|
52
|
+
`;
|
|
53
|
+
const componentStyles = css `
|
|
54
|
+
.Root {
|
|
55
|
+
display: inline-flex;
|
|
56
|
+
align-items: stretch;
|
|
57
|
+
box-sizing: border-box;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.Action,
|
|
61
|
+
.Trigger {
|
|
62
|
+
appearance: none;
|
|
63
|
+
background: none;
|
|
64
|
+
border: none;
|
|
65
|
+
padding: 0;
|
|
66
|
+
margin: 0;
|
|
67
|
+
font: inherit;
|
|
68
|
+
color: inherit;
|
|
69
|
+
cursor: pointer;
|
|
70
|
+
user-select: none;
|
|
71
|
+
-webkit-tap-highlight-color: transparent;
|
|
72
|
+
box-sizing: border-box;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.Action {
|
|
76
|
+
display: inline-flex;
|
|
77
|
+
align-items: center;
|
|
78
|
+
justify-content: center;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.Divider {
|
|
82
|
+
display: block;
|
|
83
|
+
width: 0;
|
|
84
|
+
align-self: stretch;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.Trigger {
|
|
88
|
+
display: inline-flex;
|
|
89
|
+
align-items: center;
|
|
90
|
+
justify-content: center;
|
|
91
|
+
flex-shrink: 0;
|
|
92
|
+
}
|
|
93
|
+
`;
|
|
94
|
+
/** Structural styles injected into the portal positioner. */
|
|
95
|
+
const portalPopupStyles = [
|
|
96
|
+
css `
|
|
97
|
+
.Popup {
|
|
98
|
+
max-height: 240px;
|
|
99
|
+
overflow-y: auto;
|
|
100
|
+
overscroll-behavior: contain;
|
|
101
|
+
opacity: 1;
|
|
102
|
+
transform: translateY(0);
|
|
103
|
+
transition-property: opacity, transform;
|
|
104
|
+
pointer-events: auto;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.Popup[data-starting-style],
|
|
108
|
+
.Popup[data-ending-style] {
|
|
109
|
+
opacity: 0;
|
|
110
|
+
}
|
|
111
|
+
`,
|
|
112
|
+
];
|
|
113
|
+
/**
|
|
114
|
+
* `<dui-split-button>` — A button with an attached dropdown menu trigger.
|
|
115
|
+
*
|
|
116
|
+
* The action zone (left) performs a primary action. The menu trigger (right)
|
|
117
|
+
* opens a dropdown of `dui-menu-item` children for secondary actions.
|
|
118
|
+
*
|
|
119
|
+
* @slot - Action button label / content.
|
|
120
|
+
* @slot icon - Custom icon for the dropdown trigger (defaults to chevron-down).
|
|
121
|
+
* @slot menu - `dui-menu-item` elements rendered inside the dropdown popup.
|
|
122
|
+
* @csspart root - The outer container wrapping both zones.
|
|
123
|
+
* @csspart action - The left action button element.
|
|
124
|
+
* @csspart divider - The vertical separator between action and trigger.
|
|
125
|
+
* @csspart trigger - The right dropdown trigger button element.
|
|
126
|
+
* @fires dui-action - Fired when the action button is clicked. Detail: {}
|
|
127
|
+
*/
|
|
128
|
+
let DuiSplitButton = (() => {
|
|
129
|
+
let _classSuper = LitElement;
|
|
130
|
+
let _variant_decorators;
|
|
131
|
+
let _variant_initializers = [];
|
|
132
|
+
let _variant_extraInitializers = [];
|
|
133
|
+
let _appearance_decorators;
|
|
134
|
+
let _appearance_initializers = [];
|
|
135
|
+
let _appearance_extraInitializers = [];
|
|
136
|
+
let _size_decorators;
|
|
137
|
+
let _size_initializers = [];
|
|
138
|
+
let _size_extraInitializers = [];
|
|
139
|
+
let _disabled_decorators;
|
|
140
|
+
let _disabled_initializers = [];
|
|
141
|
+
let _disabled_extraInitializers = [];
|
|
142
|
+
let _private_highlightedIndex_decorators;
|
|
143
|
+
let _private_highlightedIndex_initializers = [];
|
|
144
|
+
let _private_highlightedIndex_extraInitializers = [];
|
|
145
|
+
let _private_highlightedIndex_descriptor;
|
|
146
|
+
return class DuiSplitButton extends _classSuper {
|
|
147
|
+
static {
|
|
148
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
149
|
+
_variant_decorators = [property({ reflect: true })];
|
|
150
|
+
_appearance_decorators = [property({ reflect: true })];
|
|
151
|
+
_size_decorators = [property({ reflect: true })];
|
|
152
|
+
_disabled_decorators = [property({ type: Boolean, reflect: true })];
|
|
153
|
+
_private_highlightedIndex_decorators = [state()];
|
|
154
|
+
__esDecorate(this, null, _variant_decorators, { kind: "accessor", name: "variant", static: false, private: false, access: { has: obj => "variant" in obj, get: obj => obj.variant, set: (obj, value) => { obj.variant = value; } }, metadata: _metadata }, _variant_initializers, _variant_extraInitializers);
|
|
155
|
+
__esDecorate(this, null, _appearance_decorators, { kind: "accessor", name: "appearance", static: false, private: false, access: { has: obj => "appearance" in obj, get: obj => obj.appearance, set: (obj, value) => { obj.appearance = value; } }, metadata: _metadata }, _appearance_initializers, _appearance_extraInitializers);
|
|
156
|
+
__esDecorate(this, null, _size_decorators, { kind: "accessor", name: "size", static: false, private: false, access: { has: obj => "size" in obj, get: obj => obj.size, set: (obj, value) => { obj.size = value; } }, metadata: _metadata }, _size_initializers, _size_extraInitializers);
|
|
157
|
+
__esDecorate(this, null, _disabled_decorators, { kind: "accessor", name: "disabled", static: false, private: false, access: { has: obj => "disabled" in obj, get: obj => obj.disabled, set: (obj, value) => { obj.disabled = value; } }, metadata: _metadata }, _disabled_initializers, _disabled_extraInitializers);
|
|
158
|
+
__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);
|
|
159
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
160
|
+
}
|
|
161
|
+
static tagName = "dui-split-button";
|
|
162
|
+
static styles = [base, hostStyles, componentStyles];
|
|
163
|
+
#variant_accessor_storage = __runInitializers(this, _variant_initializers, "");
|
|
164
|
+
/** Visual variant — mapped to theme styles (e.g. neutral, primary, danger). */
|
|
165
|
+
get variant() { return this.#variant_accessor_storage; }
|
|
166
|
+
set variant(value) { this.#variant_accessor_storage = value; }
|
|
167
|
+
#appearance_accessor_storage = (__runInitializers(this, _variant_extraInitializers), __runInitializers(this, _appearance_initializers, ""));
|
|
168
|
+
/** Visual appearance — mapped to theme styles (e.g. filled, outline, ghost). */
|
|
169
|
+
get appearance() { return this.#appearance_accessor_storage; }
|
|
170
|
+
set appearance(value) { this.#appearance_accessor_storage = value; }
|
|
171
|
+
#size_accessor_storage = (__runInitializers(this, _appearance_extraInitializers), __runInitializers(this, _size_initializers, ""));
|
|
172
|
+
/** Size — mapped to theme styles (e.g. xs, sm, md, lg). */
|
|
173
|
+
get size() { return this.#size_accessor_storage; }
|
|
174
|
+
set size(value) { this.#size_accessor_storage = value; }
|
|
175
|
+
#disabled_accessor_storage = (__runInitializers(this, _size_extraInitializers), __runInitializers(this, _disabled_initializers, false));
|
|
176
|
+
/** Whether the entire split button is disabled. */
|
|
177
|
+
get disabled() { return this.#disabled_accessor_storage; }
|
|
178
|
+
set disabled(value) { this.#disabled_accessor_storage = value; }
|
|
179
|
+
#highlightedIndex_accessor_storage = (__runInitializers(this, _disabled_extraInitializers), __runInitializers(this, _private_highlightedIndex_initializers, -1));
|
|
180
|
+
get #highlightedIndex() { return _private_highlightedIndex_descriptor.get.call(this); }
|
|
181
|
+
set #highlightedIndex(value) { return _private_highlightedIndex_descriptor.set.call(this, value); }
|
|
182
|
+
#menuId = (__runInitializers(this, _private_highlightedIndex_extraInitializers), `split-menu-${crypto.randomUUID().slice(0, 8)}`);
|
|
183
|
+
#popup = new FloatingPortalController(this, {
|
|
184
|
+
getAnchor: () => this.shadowRoot?.querySelector(".Root"),
|
|
185
|
+
matchWidth: false,
|
|
186
|
+
styles: portalPopupStyles,
|
|
187
|
+
contentContainer: ".Menu",
|
|
188
|
+
contentSelector: "dui-menu-item",
|
|
189
|
+
onOpen: () => {
|
|
190
|
+
this.#highlightedIndex = -1;
|
|
191
|
+
},
|
|
192
|
+
onClose: () => {
|
|
193
|
+
this.#highlightedIndex = -1;
|
|
194
|
+
},
|
|
195
|
+
renderPopup: (portal) => html `
|
|
196
|
+
<div
|
|
197
|
+
class="Popup"
|
|
198
|
+
?data-starting-style="${portal.isStarting}"
|
|
199
|
+
?data-ending-style="${portal.isEnding}"
|
|
200
|
+
>
|
|
201
|
+
<div
|
|
202
|
+
class="Menu"
|
|
203
|
+
id="${this.#menuId}"
|
|
204
|
+
role="menu"
|
|
205
|
+
@click="${this.#onItemSlotClick}"
|
|
206
|
+
@mousemove="${this.#onMenuMouseMove}"
|
|
207
|
+
></div>
|
|
208
|
+
</div>
|
|
209
|
+
`,
|
|
210
|
+
});
|
|
211
|
+
get #items() {
|
|
212
|
+
const container = this.#popup.renderRoot?.querySelector(".Menu") ?? this;
|
|
213
|
+
return [...container.querySelectorAll("dui-menu-item")];
|
|
214
|
+
}
|
|
215
|
+
updated() {
|
|
216
|
+
const items = this.#items;
|
|
217
|
+
for (let i = 0; i < items.length; i++) {
|
|
218
|
+
if (i === this.#highlightedIndex) {
|
|
219
|
+
items[i].setAttribute("data-highlighted", "");
|
|
220
|
+
}
|
|
221
|
+
else {
|
|
222
|
+
items[i].removeAttribute("data-highlighted");
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
// ---- Action zone handlers ----
|
|
227
|
+
#onActionClick = (e) => {
|
|
228
|
+
e.stopPropagation();
|
|
229
|
+
if (this.disabled)
|
|
230
|
+
return;
|
|
231
|
+
this.dispatchEvent(actionEvent({}));
|
|
232
|
+
};
|
|
233
|
+
#onActionKeyDown = (e) => {
|
|
234
|
+
if (this.disabled)
|
|
235
|
+
return;
|
|
236
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
237
|
+
e.preventDefault();
|
|
238
|
+
this.dispatchEvent(actionEvent({}));
|
|
239
|
+
}
|
|
240
|
+
};
|
|
241
|
+
// ---- Trigger zone handlers ----
|
|
242
|
+
#onTriggerClick = (e) => {
|
|
243
|
+
e.stopPropagation();
|
|
244
|
+
if (this.disabled)
|
|
245
|
+
return;
|
|
246
|
+
if (this.#popup.isOpen) {
|
|
247
|
+
this.#popup.close();
|
|
248
|
+
}
|
|
249
|
+
else {
|
|
250
|
+
this.#popup.open();
|
|
251
|
+
}
|
|
252
|
+
};
|
|
253
|
+
#onTriggerKeyDown = (e) => {
|
|
254
|
+
if (this.disabled)
|
|
255
|
+
return;
|
|
256
|
+
const items = this.#items;
|
|
257
|
+
switch (e.key) {
|
|
258
|
+
case "Enter":
|
|
259
|
+
case " ": {
|
|
260
|
+
if (this.#popup.isOpen && this.#highlightedIndex >= 0) {
|
|
261
|
+
e.preventDefault();
|
|
262
|
+
const item = items[this.#highlightedIndex];
|
|
263
|
+
if (item && !item.disabled) {
|
|
264
|
+
item.click();
|
|
265
|
+
this.#popup.close();
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
else if (!this.#popup.isOpen) {
|
|
269
|
+
e.preventDefault();
|
|
270
|
+
this.#popup.open();
|
|
271
|
+
}
|
|
272
|
+
break;
|
|
273
|
+
}
|
|
274
|
+
case "ArrowDown": {
|
|
275
|
+
e.preventDefault();
|
|
276
|
+
if (!this.#popup.isOpen) {
|
|
277
|
+
this.#popup.open();
|
|
278
|
+
}
|
|
279
|
+
else {
|
|
280
|
+
let next = this.#highlightedIndex + 1;
|
|
281
|
+
while (next < items.length && items[next]?.disabled)
|
|
282
|
+
next++;
|
|
283
|
+
if (next < items.length)
|
|
284
|
+
this.#highlightedIndex = next;
|
|
285
|
+
}
|
|
286
|
+
break;
|
|
287
|
+
}
|
|
288
|
+
case "ArrowUp": {
|
|
289
|
+
e.preventDefault();
|
|
290
|
+
if (!this.#popup.isOpen) {
|
|
291
|
+
this.#popup.open();
|
|
292
|
+
}
|
|
293
|
+
else {
|
|
294
|
+
let prev = this.#highlightedIndex - 1;
|
|
295
|
+
while (prev >= 0 && items[prev]?.disabled)
|
|
296
|
+
prev--;
|
|
297
|
+
if (prev >= 0)
|
|
298
|
+
this.#highlightedIndex = prev;
|
|
299
|
+
}
|
|
300
|
+
break;
|
|
301
|
+
}
|
|
302
|
+
case "Home": {
|
|
303
|
+
if (this.#popup.isOpen) {
|
|
304
|
+
e.preventDefault();
|
|
305
|
+
const firstEnabled = items.findIndex((item) => !item.disabled);
|
|
306
|
+
if (firstEnabled >= 0)
|
|
307
|
+
this.#highlightedIndex = firstEnabled;
|
|
308
|
+
}
|
|
309
|
+
break;
|
|
310
|
+
}
|
|
311
|
+
case "End": {
|
|
312
|
+
if (this.#popup.isOpen) {
|
|
313
|
+
e.preventDefault();
|
|
314
|
+
for (let i = items.length - 1; i >= 0; i--) {
|
|
315
|
+
if (!items[i]?.disabled) {
|
|
316
|
+
this.#highlightedIndex = i;
|
|
317
|
+
break;
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
break;
|
|
322
|
+
}
|
|
323
|
+
case "Escape": {
|
|
324
|
+
if (this.#popup.isOpen) {
|
|
325
|
+
e.preventDefault();
|
|
326
|
+
this.#popup.close();
|
|
327
|
+
this.#focusTrigger();
|
|
328
|
+
}
|
|
329
|
+
break;
|
|
330
|
+
}
|
|
331
|
+
case "Tab": {
|
|
332
|
+
if (this.#popup.isOpen) {
|
|
333
|
+
this.#popup.close();
|
|
334
|
+
}
|
|
335
|
+
break;
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
};
|
|
339
|
+
// ---- Menu handlers ----
|
|
340
|
+
#onItemSlotClick = (e) => {
|
|
341
|
+
const item = e
|
|
342
|
+
.composedPath()
|
|
343
|
+
.find((el) => el instanceof HTMLElement && el.matches(DuiMenuItem.tagName));
|
|
344
|
+
if (item && !item.disabled) {
|
|
345
|
+
this.#popup.close();
|
|
346
|
+
}
|
|
347
|
+
};
|
|
348
|
+
#onMenuMouseMove = () => {
|
|
349
|
+
if (this.#highlightedIndex >= 0) {
|
|
350
|
+
this.#highlightedIndex = -1;
|
|
351
|
+
}
|
|
352
|
+
};
|
|
353
|
+
#focusTrigger() {
|
|
354
|
+
this.shadowRoot?.querySelector(".Trigger")?.focus();
|
|
355
|
+
}
|
|
356
|
+
render() {
|
|
357
|
+
return html `
|
|
358
|
+
<div class="Root" part="root">
|
|
359
|
+
<button
|
|
360
|
+
class="Action"
|
|
361
|
+
part="action"
|
|
362
|
+
type="button"
|
|
363
|
+
?disabled="${this.disabled}"
|
|
364
|
+
@click="${this.#onActionClick}"
|
|
365
|
+
@keydown="${this.#onActionKeyDown}"
|
|
366
|
+
>
|
|
367
|
+
<slot></slot>
|
|
368
|
+
</button>
|
|
369
|
+
|
|
370
|
+
<span part="divider" class="Divider"></span>
|
|
371
|
+
|
|
372
|
+
<button
|
|
373
|
+
class="Trigger"
|
|
374
|
+
part="trigger"
|
|
375
|
+
type="button"
|
|
376
|
+
?disabled="${this.disabled}"
|
|
377
|
+
aria-haspopup="menu"
|
|
378
|
+
aria-expanded="${this.#popup.isOpen}"
|
|
379
|
+
aria-controls="${this.#menuId}"
|
|
380
|
+
?data-open="${this.#popup.isOpen || nothing}"
|
|
381
|
+
@click="${this.#onTriggerClick}"
|
|
382
|
+
@keydown="${this.#onTriggerKeyDown}"
|
|
383
|
+
>
|
|
384
|
+
<slot name="icon">
|
|
385
|
+
<dui-icon>
|
|
386
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"
|
|
387
|
+
stroke="currentColor" stroke-width="2" stroke-linecap="round"
|
|
388
|
+
stroke-linejoin="round"><path d="m6 9 6 6 6-6"/></svg>
|
|
389
|
+
</dui-icon>
|
|
390
|
+
</slot>
|
|
391
|
+
</button>
|
|
392
|
+
</div>
|
|
393
|
+
`;
|
|
394
|
+
}
|
|
395
|
+
};
|
|
396
|
+
})();
|
|
397
|
+
export { DuiSplitButton };
|
package/stepper/index.js
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { LitElement, type TemplateResult } from "lit";
|
|
2
|
+
import { type FieldContext } from "@deepfuture/dui-components/field";
|
|
3
|
+
export declare const valueChangeEvent: (detail: {
|
|
4
|
+
value: number;
|
|
5
|
+
}) => CustomEvent<{
|
|
6
|
+
value: number;
|
|
7
|
+
}>;
|
|
8
|
+
export declare const valueCommittedEvent: (detail: {
|
|
9
|
+
value: number;
|
|
10
|
+
}) => CustomEvent<{
|
|
11
|
+
value: number;
|
|
12
|
+
}>;
|
|
13
|
+
/**
|
|
14
|
+
* `<dui-stepper>` — A numeric input with increment/decrement buttons.
|
|
15
|
+
*
|
|
16
|
+
* Simple component for stepping values up and down via buttons, keyboard,
|
|
17
|
+
* or manual text entry. No labels, icons, scrubbing, or other extras.
|
|
18
|
+
*
|
|
19
|
+
* @csspart root - The outer container.
|
|
20
|
+
* @csspart input - The text input element.
|
|
21
|
+
* @csspart decrement - The decrement button.
|
|
22
|
+
* @csspart increment - The increment button.
|
|
23
|
+
* @fires value-change - Fired when value changes. Detail: { value: number }
|
|
24
|
+
* @fires value-committed - Fired on blur or Enter. Detail: { value: number }
|
|
25
|
+
*/
|
|
26
|
+
export declare class DuiStepper extends LitElement {
|
|
27
|
+
#private;
|
|
28
|
+
static tagName: "dui-stepper";
|
|
29
|
+
static shadowRootOptions: ShadowRootInit;
|
|
30
|
+
static styles: import("lit").CSSResult[];
|
|
31
|
+
accessor value: number | undefined;
|
|
32
|
+
accessor defaultValue: number | undefined;
|
|
33
|
+
accessor min: number | undefined;
|
|
34
|
+
accessor max: number | undefined;
|
|
35
|
+
accessor step: number;
|
|
36
|
+
accessor largeStep: number;
|
|
37
|
+
accessor disabled: boolean;
|
|
38
|
+
accessor readOnly: boolean;
|
|
39
|
+
accessor required: boolean;
|
|
40
|
+
accessor name: string | undefined;
|
|
41
|
+
accessor _fieldCtx: FieldContext;
|
|
42
|
+
connectedCallback(): void;
|
|
43
|
+
willUpdate(): void;
|
|
44
|
+
render(): TemplateResult;
|
|
45
|
+
}
|