@deepfuture/dui-components 0.0.9 → 0.0.11
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/_deprecated/center/index.d.ts +1 -0
- package/_deprecated/center/index.js +1 -0
- package/_deprecated/center/register.d.ts +1 -0
- package/_deprecated/center/register.js +4 -0
- package/_deprecated/hstack/index.d.ts +2 -0
- package/_deprecated/hstack/index.js +1 -0
- package/_deprecated/hstack/register.d.ts +1 -0
- package/_deprecated/hstack/register.js +4 -0
- package/_deprecated/page-inset/index.d.ts +1 -0
- package/_deprecated/page-inset/index.js +1 -0
- package/_deprecated/page-inset/register.d.ts +1 -0
- package/_deprecated/page-inset/register.js +4 -0
- package/_deprecated/vstack/index.d.ts +1 -0
- package/_deprecated/vstack/index.js +1 -0
- package/_deprecated/vstack/register.d.ts +1 -0
- package/_deprecated/vstack/register.js +4 -0
- package/accordion/index.d.ts +2 -5
- package/accordion/index.js +2 -5
- package/accordion/register.d.ts +1 -0
- package/accordion/register.js +8 -0
- package/alert-dialog/alert-dialog.d.ts +2 -0
- package/alert-dialog/alert-dialog.js +12 -6
- package/alert-dialog/index.d.ts +4 -9
- package/alert-dialog/index.js +4 -9
- package/alert-dialog/register.d.ts +1 -0
- package/alert-dialog/register.js +16 -0
- package/all.d.ts +16 -64
- package/all.js +132 -144
- package/avatar/index.d.ts +1 -3
- package/avatar/index.js +1 -3
- package/avatar/register.d.ts +1 -0
- package/avatar/register.js +4 -0
- package/badge/index.d.ts +1 -3
- package/badge/index.js +1 -3
- package/badge/register.d.ts +1 -0
- package/badge/register.js +4 -0
- package/breadcrumb/index.d.ts +6 -13
- package/breadcrumb/index.js +6 -13
- package/breadcrumb/register.d.ts +1 -0
- package/breadcrumb/register.js +14 -0
- package/button/index.d.ts +1 -3
- package/button/index.js +1 -3
- package/button/register.d.ts +1 -0
- package/button/register.js +4 -0
- package/calendar/index.d.ts +1 -3
- package/calendar/index.js +1 -3
- package/calendar/register.d.ts +1 -0
- package/calendar/register.js +4 -0
- package/checkbox/checkbox-group.d.ts +2 -0
- package/checkbox/checkbox-group.js +12 -6
- package/checkbox/checkbox.d.ts +2 -0
- package/checkbox/checkbox.js +17 -11
- package/checkbox/index.d.ts +2 -5
- package/checkbox/index.js +2 -5
- package/checkbox/register.d.ts +1 -0
- package/checkbox/register.js +8 -0
- package/collapsible/index.d.ts +1 -3
- package/collapsible/index.js +1 -3
- package/collapsible/register.d.ts +1 -0
- package/collapsible/register.js +4 -0
- package/combobox/index.d.ts +1 -3
- package/combobox/index.js +1 -3
- package/combobox/register.d.ts +1 -0
- package/combobox/register.js +4 -0
- package/command/index.d.ts +8 -17
- package/command/index.js +8 -17
- package/command/register.d.ts +1 -0
- package/command/register.js +22 -0
- package/data-table/index.d.ts +1 -3
- package/data-table/index.js +1 -3
- package/data-table/register.d.ts +1 -0
- package/data-table/register.js +4 -0
- package/dialog/dialog.d.ts +2 -0
- package/dialog/dialog.js +12 -6
- package/dialog/index.d.ts +4 -9
- package/dialog/index.js +4 -9
- package/dialog/register.d.ts +1 -0
- package/dialog/register.js +16 -0
- package/dropzone/index.d.ts +1 -3
- package/dropzone/index.js +1 -3
- package/dropzone/register.d.ts +1 -0
- package/dropzone/register.js +4 -0
- package/global.d.ts +0 -8
- package/icon/index.d.ts +1 -3
- package/icon/index.js +1 -3
- package/icon/register.d.ts +1 -0
- package/icon/register.js +4 -0
- package/input/index.d.ts +1 -3
- package/input/index.js +1 -3
- package/input/input.d.ts +2 -0
- package/input/input.js +24 -18
- package/input/register.d.ts +1 -0
- package/input/register.js +4 -0
- package/link/index.d.ts +1 -3
- package/link/index.js +1 -3
- package/link/register.d.ts +1 -0
- package/link/register.js +4 -0
- package/menu/index.d.ts +2 -5
- package/menu/index.js +2 -5
- package/menu/register.d.ts +1 -0
- package/menu/register.js +8 -0
- package/menubar/index.d.ts +1 -3
- package/menubar/index.js +1 -3
- package/menubar/menubar.d.ts +2 -0
- package/menubar/menubar.js +11 -5
- package/menubar/register.d.ts +1 -0
- package/menubar/register.js +4 -0
- package/number-field/index.d.ts +1 -3
- package/number-field/index.js +1 -3
- package/number-field/number-field.d.ts +2 -0
- package/number-field/number-field.js +18 -12
- package/number-field/register.d.ts +1 -0
- package/number-field/register.js +4 -0
- package/package.json +4 -21
- package/popover/index.d.ts +4 -9
- package/popover/index.js +4 -9
- package/popover/popover.d.ts +2 -1
- package/popover/popover.js +14 -8
- package/popover/register.d.ts +1 -0
- package/popover/register.js +16 -0
- package/portal/index.d.ts +1 -3
- package/portal/index.js +1 -3
- package/portal/register.d.ts +1 -0
- package/portal/register.js +4 -0
- package/preview-card/index.d.ts +3 -7
- package/preview-card/index.js +3 -7
- package/preview-card/preview-card.d.ts +2 -1
- package/preview-card/preview-card.js +14 -8
- package/preview-card/register.d.ts +1 -0
- package/preview-card/register.js +12 -0
- package/progress/index.d.ts +1 -3
- package/progress/index.js +1 -3
- package/progress/register.d.ts +1 -0
- package/progress/register.js +4 -0
- package/radio/index.d.ts +2 -5
- package/radio/index.js +2 -5
- package/radio/radio-group.d.ts +2 -0
- package/radio/radio-group.js +12 -6
- package/radio/radio.d.ts +2 -0
- package/radio/radio.js +15 -9
- package/radio/register.d.ts +1 -0
- package/radio/register.js +8 -0
- package/scroll-area/index.d.ts +1 -3
- package/scroll-area/index.js +1 -3
- package/scroll-area/register.d.ts +1 -0
- package/scroll-area/register.js +4 -0
- package/scroll-area/scroll-area.js +0 -7
- package/select/index.d.ts +1 -3
- package/select/index.js +1 -3
- package/select/register.d.ts +1 -0
- package/select/register.js +4 -0
- package/select/select.d.ts +2 -0
- package/select/select.js +19 -13
- package/separator/index.d.ts +1 -3
- package/separator/index.js +1 -3
- package/separator/register.d.ts +1 -0
- package/separator/register.js +4 -0
- package/sidebar/index.d.ts +13 -27
- package/sidebar/index.js +13 -32
- package/sidebar/register.d.ts +1 -0
- package/sidebar/register.js +52 -0
- package/sidebar/sidebar-provider.d.ts +2 -0
- package/sidebar/sidebar-provider.js +12 -6
- package/slider/index.d.ts +1 -3
- package/slider/index.js +1 -3
- package/slider/register.d.ts +1 -0
- package/slider/register.js +4 -0
- package/spinner/index.d.ts +1 -3
- package/spinner/index.js +1 -3
- package/spinner/register.d.ts +1 -0
- package/spinner/register.js +4 -0
- package/switch/index.d.ts +1 -3
- package/switch/index.js +1 -3
- package/switch/register.d.ts +1 -0
- package/switch/register.js +4 -0
- package/switch/switch.d.ts +2 -0
- package/switch/switch.js +15 -9
- package/tabs/index.d.ts +5 -11
- package/tabs/index.js +5 -11
- package/tabs/register.d.ts +1 -0
- package/tabs/register.js +10 -0
- package/textarea/index.d.ts +1 -3
- package/textarea/index.js +1 -3
- package/textarea/register.d.ts +1 -0
- package/textarea/register.js +4 -0
- package/toggle/index.d.ts +2 -5
- package/toggle/index.js +2 -5
- package/toggle/register.d.ts +1 -0
- package/toggle/register.js +8 -0
- package/toggle/toggle-group.d.ts +2 -0
- package/toggle/toggle-group.js +12 -6
- package/toggle/toggle.d.ts +2 -0
- package/toggle/toggle.js +15 -9
- package/toolbar/index.d.ts +1 -3
- package/toolbar/index.js +1 -3
- package/toolbar/register.d.ts +1 -0
- package/toolbar/register.js +4 -0
- package/tooltip/index.d.ts +3 -7
- package/tooltip/index.js +3 -7
- package/tooltip/register.d.ts +1 -0
- package/tooltip/register.js +12 -0
- package/tooltip/tooltip.d.ts +2 -1
- package/tooltip/tooltip.js +14 -8
- package/trunc/index.d.ts +1 -3
- package/trunc/index.js +1 -3
- package/trunc/register.d.ts +1 -0
- package/trunc/register.js +4 -0
- package/README.md +0 -191
- package/center/index.d.ts +0 -3
- package/center/index.js +0 -3
- package/hstack/index.d.ts +0 -4
- package/hstack/index.js +0 -3
- package/page-inset/index.d.ts +0 -3
- package/page-inset/index.js +0 -3
- package/vstack/index.d.ts +0 -3
- package/vstack/index.js +0 -3
- /package/{center → _deprecated/center}/center.d.ts +0 -0
- /package/{center → _deprecated/center}/center.js +0 -0
- /package/{hstack → _deprecated/hstack}/hstack.d.ts +0 -0
- /package/{hstack → _deprecated/hstack}/hstack.js +0 -0
- /package/{page-inset → _deprecated/page-inset}/page-inset.d.ts +0 -0
- /package/{page-inset → _deprecated/page-inset}/page-inset.js +0 -0
- /package/{vstack → _deprecated/vstack}/vstack.d.ts +0 -0
- /package/{vstack → _deprecated/vstack}/vstack.js +0 -0
package/menubar/menubar.js
CHANGED
|
@@ -5,8 +5,10 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
7
|
import { css, html, LitElement } from "lit";
|
|
8
|
-
import { property } from "lit/decorators.js";
|
|
8
|
+
import { property, state } from "lit/decorators.js";
|
|
9
|
+
import { provide } from "@lit/context";
|
|
9
10
|
import { base } from "@deepfuture/dui-core/base";
|
|
11
|
+
import { menubarContext, } from "./menubar-context.js";
|
|
10
12
|
/** Structural styles only — layout CSS. */
|
|
11
13
|
const styles = css `
|
|
12
14
|
:host {
|
|
@@ -82,9 +84,9 @@ export class DuiMenubar extends LitElement {
|
|
|
82
84
|
const trigger = nextMenu.querySelector('[slot="trigger"]');
|
|
83
85
|
trigger?.focus();
|
|
84
86
|
};
|
|
85
|
-
#
|
|
86
|
-
get
|
|
87
|
-
set
|
|
87
|
+
#_ctx_accessor_storage = this.#buildContext();
|
|
88
|
+
get _ctx() { return this.#_ctx_accessor_storage; }
|
|
89
|
+
set _ctx(value) { this.#_ctx_accessor_storage = value; }
|
|
88
90
|
#buildContext() {
|
|
89
91
|
return {
|
|
90
92
|
activeMenuId: this.#activeMenuId,
|
|
@@ -94,7 +96,7 @@ export class DuiMenubar extends LitElement {
|
|
|
94
96
|
};
|
|
95
97
|
}
|
|
96
98
|
willUpdate() {
|
|
97
|
-
this
|
|
99
|
+
this._ctx = this.#buildContext();
|
|
98
100
|
}
|
|
99
101
|
#onKeyDown = (e) => {
|
|
100
102
|
const isHorizontal = this.orientation === "horizontal";
|
|
@@ -128,3 +130,7 @@ __decorate([
|
|
|
128
130
|
__decorate([
|
|
129
131
|
property({ reflect: true })
|
|
130
132
|
], DuiMenubar.prototype, "orientation", null);
|
|
133
|
+
__decorate([
|
|
134
|
+
provide({ context: menubarContext }),
|
|
135
|
+
state()
|
|
136
|
+
], DuiMenubar.prototype, "_ctx", null);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/number-field/index.d.ts
CHANGED
package/number-field/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { LitElement, type TemplateResult } from "lit";
|
|
2
|
+
import { type FieldContext } from "@deepfuture/dui-components/field";
|
|
2
3
|
export declare const valueChangeEvent: (detail: {
|
|
3
4
|
value: number;
|
|
4
5
|
}) => CustomEvent<{
|
|
@@ -28,6 +29,7 @@ export declare class DuiNumberField extends LitElement {
|
|
|
28
29
|
accessor readOnly: boolean;
|
|
29
30
|
accessor required: boolean;
|
|
30
31
|
accessor name: string | undefined;
|
|
32
|
+
accessor _fieldCtx: FieldContext;
|
|
31
33
|
connectedCallback(): void;
|
|
32
34
|
willUpdate(): void;
|
|
33
35
|
render(): TemplateResult;
|
|
@@ -5,10 +5,12 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
7
|
import { css, html, LitElement, nothing } from "lit";
|
|
8
|
-
import { property } from "lit/decorators.js";
|
|
8
|
+
import { property, state } from "lit/decorators.js";
|
|
9
|
+
import { consume } from "@lit/context";
|
|
9
10
|
import { live } from "lit/directives/live.js";
|
|
10
11
|
import { base } from "@deepfuture/dui-core/base";
|
|
11
12
|
import { customEvent } from "@deepfuture/dui-core/event";
|
|
13
|
+
import { fieldContext } from "@deepfuture/dui-components/field";
|
|
12
14
|
export const valueChangeEvent = customEvent("value-change", { bubbles: true, composed: true });
|
|
13
15
|
/** Structural styles only — layout CSS. */
|
|
14
16
|
const styles = css `
|
|
@@ -117,17 +119,17 @@ export class DuiNumberField extends LitElement {
|
|
|
117
119
|
#inputText_accessor_storage = "";
|
|
118
120
|
get #inputText() { return this.#inputText_accessor_storage; }
|
|
119
121
|
set #inputText(value) { this.#inputText_accessor_storage = value; }
|
|
120
|
-
#
|
|
121
|
-
get
|
|
122
|
-
set
|
|
122
|
+
#_fieldCtx_accessor_storage;
|
|
123
|
+
get _fieldCtx() { return this.#_fieldCtx_accessor_storage; }
|
|
124
|
+
set _fieldCtx(value) { this.#_fieldCtx_accessor_storage = value; }
|
|
123
125
|
get #currentValue() {
|
|
124
126
|
return this.value ?? this.#internalValue;
|
|
125
127
|
}
|
|
126
128
|
get #isDisabled() {
|
|
127
|
-
return this.disabled || (this
|
|
129
|
+
return this.disabled || (this._fieldCtx?.disabled ?? false);
|
|
128
130
|
}
|
|
129
131
|
get #isInvalid() {
|
|
130
|
-
return this
|
|
132
|
+
return this._fieldCtx?.invalid ?? false;
|
|
131
133
|
}
|
|
132
134
|
get #canDecrement() {
|
|
133
135
|
const v = this.#currentValue;
|
|
@@ -167,8 +169,8 @@ export class DuiNumberField extends LitElement {
|
|
|
167
169
|
if (this.value === undefined) {
|
|
168
170
|
this.#internalValue = clamped;
|
|
169
171
|
}
|
|
170
|
-
this
|
|
171
|
-
this
|
|
172
|
+
this._fieldCtx?.markDirty();
|
|
173
|
+
this._fieldCtx?.setFilled(true);
|
|
172
174
|
this.dispatchEvent(valueChangeEvent({ value: clamped }));
|
|
173
175
|
}
|
|
174
176
|
#increment = (amount) => {
|
|
@@ -197,11 +199,11 @@ export class DuiNumberField extends LitElement {
|
|
|
197
199
|
};
|
|
198
200
|
#onBlur = () => {
|
|
199
201
|
this.#commitInput();
|
|
200
|
-
this
|
|
201
|
-
this
|
|
202
|
+
this._fieldCtx?.setFocused(false);
|
|
203
|
+
this._fieldCtx?.markTouched();
|
|
202
204
|
};
|
|
203
205
|
#onFocus = () => {
|
|
204
|
-
this
|
|
206
|
+
this._fieldCtx?.setFocused(true);
|
|
205
207
|
};
|
|
206
208
|
#onKeyDown = (e) => {
|
|
207
209
|
switch (e.key) {
|
|
@@ -239,7 +241,7 @@ export class DuiNumberField extends LitElement {
|
|
|
239
241
|
render() {
|
|
240
242
|
const isDisabled = this.#isDisabled;
|
|
241
243
|
const isInvalid = this.#isInvalid;
|
|
242
|
-
const controlId = this
|
|
244
|
+
const controlId = this._fieldCtx?.controlId ?? "";
|
|
243
245
|
const currentValue = this.#currentValue;
|
|
244
246
|
return html `
|
|
245
247
|
<div
|
|
@@ -324,3 +326,7 @@ __decorate([
|
|
|
324
326
|
__decorate([
|
|
325
327
|
property()
|
|
326
328
|
], DuiNumberField.prototype, "name", null);
|
|
329
|
+
__decorate([
|
|
330
|
+
consume({ context: fieldContext, subscribe: true }),
|
|
331
|
+
state()
|
|
332
|
+
], DuiNumberField.prototype, "_fieldCtx", null);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepfuture/dui-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.11",
|
|
4
4
|
"description": "DUI unstyled web components — structural CSS only, themed via applyTheme()",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
|
-
"url": "https://github.com/
|
|
9
|
+
"url": "https://github.com/nicholasgasior/dui.git",
|
|
10
10
|
"directory": "packages/components"
|
|
11
11
|
},
|
|
12
12
|
"exports": {
|
|
@@ -94,22 +94,6 @@
|
|
|
94
94
|
"import": "./trunc/index.js",
|
|
95
95
|
"types": "./trunc/index.d.ts"
|
|
96
96
|
},
|
|
97
|
-
"./center": {
|
|
98
|
-
"import": "./center/index.js",
|
|
99
|
-
"types": "./center/index.d.ts"
|
|
100
|
-
},
|
|
101
|
-
"./hstack": {
|
|
102
|
-
"import": "./hstack/index.js",
|
|
103
|
-
"types": "./hstack/index.d.ts"
|
|
104
|
-
},
|
|
105
|
-
"./vstack": {
|
|
106
|
-
"import": "./vstack/index.js",
|
|
107
|
-
"types": "./vstack/index.d.ts"
|
|
108
|
-
},
|
|
109
|
-
"./page-inset": {
|
|
110
|
-
"import": "./page-inset/index.js",
|
|
111
|
-
"types": "./page-inset/index.d.ts"
|
|
112
|
-
},
|
|
113
97
|
"./link": {
|
|
114
98
|
"import": "./link/index.js",
|
|
115
99
|
"types": "./link/index.d.ts"
|
|
@@ -190,11 +174,10 @@
|
|
|
190
174
|
"files": [
|
|
191
175
|
"**/*.js",
|
|
192
176
|
"**/*.d.ts",
|
|
193
|
-
"**/*.css"
|
|
194
|
-
"README.md"
|
|
177
|
+
"**/*.css"
|
|
195
178
|
],
|
|
196
179
|
"dependencies": {
|
|
197
|
-
"@deepfuture/dui-core": "0.0.
|
|
180
|
+
"@deepfuture/dui-core": "0.0.11",
|
|
198
181
|
"lit": "^3.3.2",
|
|
199
182
|
"@lit/context": "^1.1.3"
|
|
200
183
|
},
|
package/popover/index.d.ts
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
export { DuiPopover, openChangeEvent };
|
|
1
|
+
export { DuiPopover, openChangeEvent } from "./popover.js";
|
|
3
2
|
export type { PopoverOpenChangeDetail } from "./popover.js";
|
|
4
|
-
|
|
5
|
-
export {
|
|
6
|
-
|
|
7
|
-
export { DuiPopoverPopup };
|
|
8
|
-
import { DuiPopoverClose } from "./popover-close.js";
|
|
9
|
-
export { DuiPopoverClose };
|
|
3
|
+
export { DuiPopoverTrigger } from "./popover-trigger.js";
|
|
4
|
+
export { DuiPopoverPopup } from "./popover-popup.js";
|
|
5
|
+
export { DuiPopoverClose } from "./popover-close.js";
|
|
10
6
|
export type { PopoverContext, PopoverSide } from "./popover-context.js";
|
|
11
|
-
export declare const popoverFamily: (typeof DuiPopover | typeof DuiPopoverTrigger | typeof DuiPopoverPopup | typeof DuiPopoverClose)[];
|
package/popover/index.js
CHANGED
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
3
|
-
|
|
4
|
-
export {
|
|
5
|
-
import { DuiPopoverPopup } from "./popover-popup.js";
|
|
6
|
-
export { DuiPopoverPopup };
|
|
7
|
-
import { DuiPopoverClose } from "./popover-close.js";
|
|
8
|
-
export { DuiPopoverClose };
|
|
9
|
-
export const popoverFamily = [DuiPopover, DuiPopoverTrigger, DuiPopoverPopup, DuiPopoverClose];
|
|
1
|
+
export { DuiPopover, openChangeEvent } from "./popover.js";
|
|
2
|
+
export { DuiPopoverTrigger } from "./popover-trigger.js";
|
|
3
|
+
export { DuiPopoverPopup } from "./popover-popup.js";
|
|
4
|
+
export { DuiPopoverClose } from "./popover-close.js";
|
package/popover/popover.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** Ported from original DUI: deep-future-app/app/client/components/dui/popover */
|
|
2
2
|
import { LitElement, type PropertyValues, type TemplateResult } from "lit";
|
|
3
|
-
import { type PopoverSide } from "./popover-context.js";
|
|
3
|
+
import { type PopoverContext, type PopoverSide } from "./popover-context.js";
|
|
4
4
|
export type PopoverOpenChangeDetail = {
|
|
5
5
|
open: boolean;
|
|
6
6
|
};
|
|
@@ -23,6 +23,7 @@ export declare class DuiPopover extends LitElement {
|
|
|
23
23
|
accessor side: PopoverSide;
|
|
24
24
|
/** Offset from the trigger in pixels. */
|
|
25
25
|
accessor sideOffset: number;
|
|
26
|
+
accessor _ctx: PopoverContext;
|
|
26
27
|
connectedCallback(): void;
|
|
27
28
|
disconnectedCallback(): void;
|
|
28
29
|
protected willUpdate(changed: PropertyValues): void;
|
package/popover/popover.js
CHANGED
|
@@ -6,9 +6,11 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
7
|
};
|
|
8
8
|
import { css, html, LitElement } from "lit";
|
|
9
|
-
import { property } from "lit/decorators.js";
|
|
9
|
+
import { property, state } from "lit/decorators.js";
|
|
10
|
+
import { provide } from "@lit/context";
|
|
10
11
|
import { base } from "@deepfuture/dui-core/base";
|
|
11
12
|
import { customEvent } from "@deepfuture/dui-core/event";
|
|
13
|
+
import { popoverContext, } from "./popover-context.js";
|
|
12
14
|
export const openChangeEvent = customEvent("open-change", { bubbles: true, composed: true });
|
|
13
15
|
const hostStyles = css `
|
|
14
16
|
:host {
|
|
@@ -51,7 +53,7 @@ export class DuiPopover extends LitElement {
|
|
|
51
53
|
}
|
|
52
54
|
#triggerId = `popover-trigger-${crypto.randomUUID().slice(0, 8)}`;
|
|
53
55
|
#popupId = `popover-popup-${crypto.randomUUID().slice(0, 8)}`;
|
|
54
|
-
#
|
|
56
|
+
#_ctx_accessor_storage = {
|
|
55
57
|
open: false,
|
|
56
58
|
triggerId: this.#triggerId,
|
|
57
59
|
popupId: this.#popupId,
|
|
@@ -63,8 +65,8 @@ export class DuiPopover extends LitElement {
|
|
|
63
65
|
togglePopover: () => this.#doToggle(),
|
|
64
66
|
setTriggerEl: (el) => this.#setTriggerEl(el),
|
|
65
67
|
};
|
|
66
|
-
get
|
|
67
|
-
set
|
|
68
|
+
get _ctx() { return this.#_ctx_accessor_storage; }
|
|
69
|
+
set _ctx(value) { this.#_ctx_accessor_storage = value; }
|
|
68
70
|
connectedCallback() {
|
|
69
71
|
super.connectedCallback();
|
|
70
72
|
if (this.defaultOpen) {
|
|
@@ -80,10 +82,10 @@ export class DuiPopover extends LitElement {
|
|
|
80
82
|
if (changed.has("open") ||
|
|
81
83
|
changed.has("side") ||
|
|
82
84
|
changed.has("sideOffset") ||
|
|
83
|
-
this
|
|
84
|
-
this
|
|
85
|
-
this
|
|
86
|
-
...this
|
|
85
|
+
this._ctx.open !== this.#isOpen ||
|
|
86
|
+
this._ctx.triggerEl !== this.#triggerEl) {
|
|
87
|
+
this._ctx = {
|
|
88
|
+
...this._ctx,
|
|
87
89
|
open: this.#isOpen,
|
|
88
90
|
side: this.side,
|
|
89
91
|
sideOffset: this.sideOffset,
|
|
@@ -138,3 +140,7 @@ __decorate([
|
|
|
138
140
|
__decorate([
|
|
139
141
|
property({ type: Number, attribute: "side-offset" })
|
|
140
142
|
], DuiPopover.prototype, "sideOffset", null);
|
|
143
|
+
__decorate([
|
|
144
|
+
provide({ context: popoverContext }),
|
|
145
|
+
state()
|
|
146
|
+
], DuiPopover.prototype, "_ctx", null);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { DuiPopover } from "./popover.js";
|
|
2
|
+
import { DuiPopoverTrigger } from "./popover-trigger.js";
|
|
3
|
+
import { DuiPopoverPopup } from "./popover-popup.js";
|
|
4
|
+
import { DuiPopoverClose } from "./popover-close.js";
|
|
5
|
+
if (!customElements.get(DuiPopover.tagName)) {
|
|
6
|
+
customElements.define(DuiPopover.tagName, DuiPopover);
|
|
7
|
+
}
|
|
8
|
+
if (!customElements.get(DuiPopoverTrigger.tagName)) {
|
|
9
|
+
customElements.define(DuiPopoverTrigger.tagName, DuiPopoverTrigger);
|
|
10
|
+
}
|
|
11
|
+
if (!customElements.get(DuiPopoverPopup.tagName)) {
|
|
12
|
+
customElements.define(DuiPopoverPopup.tagName, DuiPopoverPopup);
|
|
13
|
+
}
|
|
14
|
+
if (!customElements.get(DuiPopoverClose.tagName)) {
|
|
15
|
+
customElements.define(DuiPopoverClose.tagName, DuiPopoverClose);
|
|
16
|
+
}
|
package/portal/index.d.ts
CHANGED
package/portal/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/preview-card/index.d.ts
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
export { DuiPreviewCard, openChangeEvent };
|
|
1
|
+
export { DuiPreviewCard, openChangeEvent } from "./preview-card.js";
|
|
3
2
|
export type { PreviewCardOpenChangeDetail } from "./preview-card.js";
|
|
4
|
-
|
|
5
|
-
export {
|
|
6
|
-
import { DuiPreviewCardPopup } from "./preview-card-popup.js";
|
|
7
|
-
export { DuiPreviewCardPopup };
|
|
3
|
+
export { DuiPreviewCardTrigger } from "./preview-card-trigger.js";
|
|
4
|
+
export { DuiPreviewCardPopup } from "./preview-card-popup.js";
|
|
8
5
|
export type { PreviewCardContext, PreviewCardSide } from "./preview-card-context.js";
|
|
9
|
-
export declare const previewCardFamily: (typeof DuiPreviewCard | typeof DuiPreviewCardTrigger | typeof DuiPreviewCardPopup)[];
|
package/preview-card/index.js
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
3
|
-
|
|
4
|
-
export { DuiPreviewCardTrigger };
|
|
5
|
-
import { DuiPreviewCardPopup } from "./preview-card-popup.js";
|
|
6
|
-
export { DuiPreviewCardPopup };
|
|
7
|
-
export const previewCardFamily = [DuiPreviewCard, DuiPreviewCardTrigger, DuiPreviewCardPopup];
|
|
1
|
+
export { DuiPreviewCard, openChangeEvent } from "./preview-card.js";
|
|
2
|
+
export { DuiPreviewCardTrigger } from "./preview-card-trigger.js";
|
|
3
|
+
export { DuiPreviewCardPopup } from "./preview-card-popup.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** Ported from original DUI: deep-future-app/app/client/components/dui/preview-card */
|
|
2
2
|
import { LitElement, type PropertyValues, type TemplateResult } from "lit";
|
|
3
|
-
import { type PreviewCardSide } from "./preview-card-context.js";
|
|
3
|
+
import { type PreviewCardContext, type PreviewCardSide } from "./preview-card-context.js";
|
|
4
4
|
export type PreviewCardOpenChangeDetail = {
|
|
5
5
|
open: boolean;
|
|
6
6
|
};
|
|
@@ -27,6 +27,7 @@ export declare class DuiPreviewCard extends LitElement {
|
|
|
27
27
|
accessor delay: number;
|
|
28
28
|
/** Delay before closing in milliseconds. */
|
|
29
29
|
accessor closeDelay: number;
|
|
30
|
+
accessor _ctx: PreviewCardContext;
|
|
30
31
|
connectedCallback(): void;
|
|
31
32
|
disconnectedCallback(): void;
|
|
32
33
|
protected willUpdate(changed: PropertyValues): void;
|
|
@@ -6,9 +6,11 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
7
|
};
|
|
8
8
|
import { css, html, LitElement } from "lit";
|
|
9
|
-
import { property } from "lit/decorators.js";
|
|
9
|
+
import { property, state } from "lit/decorators.js";
|
|
10
|
+
import { provide } from "@lit/context";
|
|
10
11
|
import { base } from "@deepfuture/dui-core/base";
|
|
11
12
|
import { customEvent } from "@deepfuture/dui-core/event";
|
|
13
|
+
import { previewCardContext, } from "./preview-card-context.js";
|
|
12
14
|
export const openChangeEvent = customEvent("open-change", { bubbles: true, composed: true });
|
|
13
15
|
const hostStyles = css `
|
|
14
16
|
:host {
|
|
@@ -58,7 +60,7 @@ export class DuiPreviewCard extends LitElement {
|
|
|
58
60
|
#closeTimeout;
|
|
59
61
|
#triggerId = `preview-card-trigger-${crypto.randomUUID().slice(0, 8)}`;
|
|
60
62
|
#popupId = `preview-card-popup-${crypto.randomUUID().slice(0, 8)}`;
|
|
61
|
-
#
|
|
63
|
+
#_ctx_accessor_storage = {
|
|
62
64
|
open: false,
|
|
63
65
|
triggerId: this.#triggerId,
|
|
64
66
|
popupId: this.#popupId,
|
|
@@ -69,8 +71,8 @@ export class DuiPreviewCard extends LitElement {
|
|
|
69
71
|
closePreviewCard: () => this.#scheduleClose(),
|
|
70
72
|
setTriggerEl: (el) => this.#setTriggerEl(el),
|
|
71
73
|
};
|
|
72
|
-
get
|
|
73
|
-
set
|
|
74
|
+
get _ctx() { return this.#_ctx_accessor_storage; }
|
|
75
|
+
set _ctx(value) { this.#_ctx_accessor_storage = value; }
|
|
74
76
|
connectedCallback() {
|
|
75
77
|
super.connectedCallback();
|
|
76
78
|
if (this.defaultOpen) {
|
|
@@ -86,10 +88,10 @@ export class DuiPreviewCard extends LitElement {
|
|
|
86
88
|
if (changed.has("open") ||
|
|
87
89
|
changed.has("side") ||
|
|
88
90
|
changed.has("sideOffset") ||
|
|
89
|
-
this
|
|
90
|
-
this
|
|
91
|
-
this
|
|
92
|
-
...this
|
|
91
|
+
this._ctx.open !== isOpen ||
|
|
92
|
+
this._ctx.triggerEl !== this.#triggerEl) {
|
|
93
|
+
this._ctx = {
|
|
94
|
+
...this._ctx,
|
|
93
95
|
open: isOpen,
|
|
94
96
|
side: this.side,
|
|
95
97
|
sideOffset: this.sideOffset,
|
|
@@ -162,3 +164,7 @@ __decorate([
|
|
|
162
164
|
__decorate([
|
|
163
165
|
property({ type: Number, attribute: "close-delay" })
|
|
164
166
|
], DuiPreviewCard.prototype, "closeDelay", null);
|
|
167
|
+
__decorate([
|
|
168
|
+
provide({ context: previewCardContext }),
|
|
169
|
+
state()
|
|
170
|
+
], DuiPreviewCard.prototype, "_ctx", null);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DuiPreviewCard } from "./preview-card.js";
|
|
2
|
+
import { DuiPreviewCardTrigger } from "./preview-card-trigger.js";
|
|
3
|
+
import { DuiPreviewCardPopup } from "./preview-card-popup.js";
|
|
4
|
+
if (!customElements.get(DuiPreviewCard.tagName)) {
|
|
5
|
+
customElements.define(DuiPreviewCard.tagName, DuiPreviewCard);
|
|
6
|
+
}
|
|
7
|
+
if (!customElements.get(DuiPreviewCardTrigger.tagName)) {
|
|
8
|
+
customElements.define(DuiPreviewCardTrigger.tagName, DuiPreviewCardTrigger);
|
|
9
|
+
}
|
|
10
|
+
if (!customElements.get(DuiPreviewCardPopup.tagName)) {
|
|
11
|
+
customElements.define(DuiPreviewCardPopup.tagName, DuiPreviewCardPopup);
|
|
12
|
+
}
|
package/progress/index.d.ts
CHANGED
package/progress/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/radio/index.d.ts
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
3
|
-
import { DuiRadioGroup, valueChangeEvent } from "./radio-group.js";
|
|
4
|
-
export { DuiRadioGroup, valueChangeEvent };
|
|
1
|
+
export { DuiRadio } from "./radio.js";
|
|
2
|
+
export { DuiRadioGroup, valueChangeEvent } from "./radio-group.js";
|
|
5
3
|
export type { RadioGroupContext } from "./radio-group-context.js";
|
|
6
|
-
export declare const radioFamily: (typeof DuiRadio | typeof DuiRadioGroup)[];
|
package/radio/index.js
CHANGED
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
3
|
-
import { DuiRadioGroup, valueChangeEvent } from "./radio-group.js";
|
|
4
|
-
export { DuiRadioGroup, valueChangeEvent };
|
|
5
|
-
export const radioFamily = [DuiRadio, DuiRadioGroup];
|
|
1
|
+
export { DuiRadio } from "./radio.js";
|
|
2
|
+
export { DuiRadioGroup, valueChangeEvent } from "./radio-group.js";
|
package/radio/radio-group.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/** Ported from original DUI: deep-future-app/app/client/components/dui/radio */
|
|
2
2
|
import { LitElement, type TemplateResult } from "lit";
|
|
3
|
+
import { type RadioGroupContext } from "./radio-group-context.js";
|
|
3
4
|
export declare const valueChangeEvent: (detail: {
|
|
4
5
|
value: string;
|
|
5
6
|
}) => CustomEvent<{
|
|
@@ -31,6 +32,7 @@ export declare class DuiRadioGroup extends LitElement {
|
|
|
31
32
|
accessor readOnly: boolean;
|
|
32
33
|
/** Whether a selection is required. */
|
|
33
34
|
accessor required: boolean;
|
|
35
|
+
accessor _ctx: RadioGroupContext;
|
|
34
36
|
connectedCallback(): void;
|
|
35
37
|
willUpdate(): void;
|
|
36
38
|
render(): TemplateResult;
|
package/radio/radio-group.js
CHANGED
|
@@ -6,8 +6,10 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
7
|
};
|
|
8
8
|
import { css, html, LitElement } from "lit";
|
|
9
|
-
import { property } from "lit/decorators.js";
|
|
9
|
+
import { property, state } from "lit/decorators.js";
|
|
10
|
+
import { provide } from "@lit/context";
|
|
10
11
|
import { base } from "@deepfuture/dui-core/base";
|
|
12
|
+
import { radioGroupContext, } from "./radio-group-context.js";
|
|
11
13
|
import { customEvent } from "@deepfuture/dui-core/event";
|
|
12
14
|
export const valueChangeEvent = customEvent("value-change", {
|
|
13
15
|
bubbles: true,
|
|
@@ -78,9 +80,9 @@ export class DuiRadioGroup extends LitElement {
|
|
|
78
80
|
}
|
|
79
81
|
this.dispatchEvent(valueChangeEvent({ value: val }));
|
|
80
82
|
};
|
|
81
|
-
#
|
|
82
|
-
get
|
|
83
|
-
set
|
|
83
|
+
#_ctx_accessor_storage = this.#buildContext();
|
|
84
|
+
get _ctx() { return this.#_ctx_accessor_storage; }
|
|
85
|
+
set _ctx(value) { this.#_ctx_accessor_storage = value; }
|
|
84
86
|
#buildContext() {
|
|
85
87
|
return {
|
|
86
88
|
name: this.name,
|
|
@@ -96,10 +98,10 @@ export class DuiRadioGroup extends LitElement {
|
|
|
96
98
|
if (this.value === undefined && this.defaultValue !== undefined) {
|
|
97
99
|
this.#internalValue = this.defaultValue;
|
|
98
100
|
}
|
|
99
|
-
this
|
|
101
|
+
this._ctx = this.#buildContext();
|
|
100
102
|
}
|
|
101
103
|
willUpdate() {
|
|
102
|
-
this
|
|
104
|
+
this._ctx = this.#buildContext();
|
|
103
105
|
}
|
|
104
106
|
render() {
|
|
105
107
|
return html `
|
|
@@ -133,3 +135,7 @@ __decorate([
|
|
|
133
135
|
__decorate([
|
|
134
136
|
property({ type: Boolean, reflect: true })
|
|
135
137
|
], DuiRadioGroup.prototype, "required", null);
|
|
138
|
+
__decorate([
|
|
139
|
+
provide({ context: radioGroupContext }),
|
|
140
|
+
state()
|
|
141
|
+
], DuiRadioGroup.prototype, "_ctx", null);
|
package/radio/radio.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/** Ported from original DUI: deep-future-app/app/client/components/dui/radio */
|
|
2
2
|
import { LitElement, type TemplateResult } from "lit";
|
|
3
|
+
import { type FieldContext } from "@deepfuture/dui-components/field";
|
|
3
4
|
/**
|
|
4
5
|
* `<dui-radio>` — A radio button input.
|
|
5
6
|
*
|
|
@@ -21,6 +22,7 @@ export declare class DuiRadio extends LitElement {
|
|
|
21
22
|
accessor disabled: boolean;
|
|
22
23
|
/** Whether the radio is read-only. */
|
|
23
24
|
accessor readOnly: boolean;
|
|
25
|
+
accessor _fieldCtx: FieldContext;
|
|
24
26
|
connectedCallback(): void;
|
|
25
27
|
disconnectedCallback(): void;
|
|
26
28
|
render(): TemplateResult;
|