agnosticui-core 2.0.0-alpha.22 → 2.0.0-alpha.24
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/dist/components/Button/core/_Button.d.ts +8 -8
- package/dist/components/Button/core/_Button.d.ts.map +1 -1
- package/dist/components/Button/core/_Button.js +72 -83
- package/dist/components/Drawer/react/ReactDrawer.d.ts +27 -8
- package/dist/components/Drawer/react/ReactDrawer.d.ts.map +1 -1
- package/dist/components/Drawer/react/ReactDrawer.js +31 -9
- package/dist/components/EmptyState/core/_EmptyState.d.ts.map +1 -1
- package/dist/components/EmptyState/core/_EmptyState.js +24 -23
- package/dist/components/Input/core/_Input.d.ts +8 -8
- package/dist/components/Input/core/_Input.d.ts.map +1 -1
- package/dist/components/Input/core/_Input.js +17 -26
- package/dist/components/Select/core/_Select.d.ts +8 -0
- package/dist/components/Select/core/_Select.d.ts.map +1 -1
- package/dist/components/Select/core/_Select.js +39 -36
- package/dist/utils/slot.js +1 -1
- package/package.json +1 -1
- package/src/components/Button/core/_Button.ts +5 -20
- package/src/components/Drawer/react/ReactDrawer.tsx +60 -3
- package/src/components/EmptyState/core/_EmptyState.ts +3 -5
- package/src/components/Input/core/_Input.ts +5 -14
- package/src/components/Select/core/_Select.ts +5 -0
- package/src/utils/slot.ts +1 -1
|
@@ -38,6 +38,14 @@ export interface ButtonProps {
|
|
|
38
38
|
* - APG-compliant accessibility
|
|
39
39
|
*/
|
|
40
40
|
export declare class AgButton extends LitElement implements ButtonProps {
|
|
41
|
+
static shadowRootOptions: {
|
|
42
|
+
delegatesFocus: boolean;
|
|
43
|
+
clonable?: boolean;
|
|
44
|
+
customElementRegistry?: CustomElementRegistry;
|
|
45
|
+
mode: ShadowRootMode;
|
|
46
|
+
serializable?: boolean;
|
|
47
|
+
slotAssignment?: SlotAssignmentMode;
|
|
48
|
+
};
|
|
41
49
|
static styles: CSSResultGroup;
|
|
42
50
|
/**
|
|
43
51
|
* Visual variant for styling hooks
|
|
@@ -103,14 +111,6 @@ export declare class AgButton extends LitElement implements ButtonProps {
|
|
|
103
111
|
private _handleClick;
|
|
104
112
|
private _handleFocus;
|
|
105
113
|
private _handleBlur;
|
|
106
|
-
/**
|
|
107
|
-
* Focus the internal button element
|
|
108
|
-
*/
|
|
109
|
-
focus(): void;
|
|
110
|
-
/**
|
|
111
|
-
* Blur the internal button element
|
|
112
|
-
*/
|
|
113
|
-
blur(): void;
|
|
114
114
|
render(): import('lit').TemplateResult<1>;
|
|
115
115
|
}
|
|
116
116
|
//# sourceMappingURL=_Button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_Button.d.ts","sourceRoot":"","sources":["../../../../src/components/Button/core/_Button.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,UAAU,EAAa,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAKjE,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,OAAO,CAAC;CAClB;AACD,MAAM,MAAM,iBAAiB,GAAG,WAAW,CAAC,uBAAuB,CAAC,CAAC;AAGrE,MAAM,WAAW,WAAW;IAC1B,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,QAAQ,GAAG,YAAY,GAAG,EAAE,CAAC;IACzF,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1C,KAAK,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,gBAAgB,GAAG,EAAE,CAAC;IAC5E,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,CA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EK,KAAK,EAAE,OAAO,CAAC;IAEvB;;OAEG;IAEK,IAAI,EAAE,OAAO,CAAC;IAEtB;;OAEG;IAEK,OAAO,EAAE,OAAO,CAAC;IAEzB;;OAEG;IAEK,SAAS,EAAE,OAAO,CAAC;IAE3B;;OAEG;IAEK,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;IAE5C;;OAEG;IAEK,QAAQ,EAAE,OAAO,CAAC;IAE1B;;OAEG;IAEK,OAAO,EAAE,OAAO,CAAC;IAEzB;;OAEG;IAEK,MAAM,EAAE,OAAO,CAAC;IAExB;;OAEG;IAEK,OAAO,EAAE,OAAO,CAAC;IAEzB;;OAEG;IAEK,SAAS,EAAE,MAAM,CAAC;IAGlB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;IAGtC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;IAGtC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;IAGrC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAC;;IAoBtD,OAAO,CAAC,YAAY;IAoCpB,OAAO,CAAC,YAAY;IAcpB,OAAO,CAAC,WAAW;IAcnB,MAAM;CAoBP"}
|
|
@@ -1,76 +1,62 @@
|
|
|
1
|
-
import { LitElement as
|
|
2
|
-
import { n as
|
|
3
|
-
import { o as
|
|
4
|
-
var b = Object.defineProperty,
|
|
5
|
-
for (var n = void 0,
|
|
6
|
-
(
|
|
7
|
-
return n && b(
|
|
1
|
+
import { LitElement as u, css as c, html as h } from "lit";
|
|
2
|
+
import { n as a } from "../../../property-CemaeiRl.js";
|
|
3
|
+
import { o as d } from "../../../if-defined-C8i28hSj.js";
|
|
4
|
+
var b = Object.defineProperty, r = (g, e, o, v) => {
|
|
5
|
+
for (var n = void 0, s = g.length - 1, l; s >= 0; s--)
|
|
6
|
+
(l = g[s]) && (n = l(e, o, n) || n);
|
|
7
|
+
return n && b(e, o, n), n;
|
|
8
8
|
};
|
|
9
|
-
const
|
|
9
|
+
const i = class i extends u {
|
|
10
10
|
constructor() {
|
|
11
11
|
super(), this.disabled = !1, this.loading = !1, this.toggle = !1, this.pressed = !1, this.bordered = !1, this.ghost = !1, this.link = !1, this.grouped = !1, this.fullWidth = !1, this.type = "button", this.ariaLabel = "", this.variant = "", this.size = "md", this.shape = "";
|
|
12
12
|
}
|
|
13
|
-
_handleClick(
|
|
14
|
-
if (this.onClick && this.onClick(
|
|
13
|
+
_handleClick(e) {
|
|
14
|
+
if (this.onClick && this.onClick(e), !this.disabled && !this.loading && !e.defaultPrevented) {
|
|
15
15
|
if (this.type === "submit") {
|
|
16
|
-
const
|
|
17
|
-
|
|
16
|
+
const o = this.closest("form");
|
|
17
|
+
o && o.requestSubmit();
|
|
18
18
|
} else if (this.type === "reset") {
|
|
19
|
-
const
|
|
20
|
-
|
|
19
|
+
const o = this.closest("form");
|
|
20
|
+
o && o.reset();
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
if (this.toggle && !this.disabled && !this.loading && !
|
|
23
|
+
if (this.toggle && !this.disabled && !this.loading && !e.defaultPrevented) {
|
|
24
24
|
this.pressed = !this.pressed;
|
|
25
|
-
const
|
|
25
|
+
const o = new CustomEvent("toggle", {
|
|
26
26
|
detail: { pressed: this.pressed },
|
|
27
27
|
bubbles: !0,
|
|
28
28
|
composed: !0
|
|
29
29
|
});
|
|
30
|
-
this.dispatchEvent(
|
|
30
|
+
this.dispatchEvent(o), this.onToggle && this.onToggle(o);
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
-
_handleFocus(
|
|
34
|
-
this.onFocus && this.onFocus(
|
|
35
|
-
const
|
|
33
|
+
_handleFocus(e) {
|
|
34
|
+
this.onFocus && this.onFocus(e);
|
|
35
|
+
const o = new FocusEvent("focus", {
|
|
36
36
|
bubbles: !0,
|
|
37
37
|
composed: !0
|
|
38
38
|
});
|
|
39
|
-
this.dispatchEvent(
|
|
39
|
+
this.dispatchEvent(o);
|
|
40
40
|
}
|
|
41
|
-
_handleBlur(
|
|
42
|
-
this.onBlur && this.onBlur(
|
|
43
|
-
const
|
|
41
|
+
_handleBlur(e) {
|
|
42
|
+
this.onBlur && this.onBlur(e);
|
|
43
|
+
const o = new FocusEvent("blur", {
|
|
44
44
|
bubbles: !0,
|
|
45
45
|
composed: !0
|
|
46
46
|
});
|
|
47
|
-
this.dispatchEvent(
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Focus the internal button element
|
|
51
|
-
*/
|
|
52
|
-
focus() {
|
|
53
|
-
const a = this.shadowRoot?.querySelector("button");
|
|
54
|
-
a && a.focus();
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Blur the internal button element
|
|
58
|
-
*/
|
|
59
|
-
blur() {
|
|
60
|
-
const a = this.shadowRoot?.querySelector("button");
|
|
61
|
-
a && a.blur();
|
|
47
|
+
this.dispatchEvent(o);
|
|
62
48
|
}
|
|
63
49
|
render() {
|
|
64
|
-
const
|
|
50
|
+
const e = this.disabled || this.loading;
|
|
65
51
|
return h`
|
|
66
52
|
<button
|
|
67
53
|
type=${this.type}
|
|
68
54
|
part="ag-button"
|
|
69
|
-
?disabled=${
|
|
70
|
-
aria-disabled=${
|
|
71
|
-
aria-busy=${
|
|
72
|
-
aria-pressed=${
|
|
73
|
-
aria-label=${
|
|
55
|
+
?disabled=${e}
|
|
56
|
+
aria-disabled=${e ? "true" : "false"}
|
|
57
|
+
aria-busy=${d(this.loading ? "true" : void 0)}
|
|
58
|
+
aria-pressed=${d(this.toggle ? String(this.pressed) : void 0)}
|
|
59
|
+
aria-label=${d(this.ariaLabel || void 0)}
|
|
74
60
|
@click=${this._handleClick}
|
|
75
61
|
@focus=${this._handleFocus}
|
|
76
62
|
@blur=${this._handleBlur}
|
|
@@ -80,7 +66,10 @@ const d = class d extends l {
|
|
|
80
66
|
`;
|
|
81
67
|
}
|
|
82
68
|
};
|
|
83
|
-
|
|
69
|
+
i.shadowRootOptions = {
|
|
70
|
+
...u.shadowRootOptions,
|
|
71
|
+
delegatesFocus: !0
|
|
72
|
+
}, i.styles = c`
|
|
84
73
|
/* MINIMALIST & THEMEABLE - Styling via --ag-* design tokens */
|
|
85
74
|
:host {
|
|
86
75
|
/* Inline-flex for perfect centering while maintaining inline behavior */
|
|
@@ -467,60 +456,60 @@ d.styles = c`
|
|
|
467
456
|
transition: outline var(--ag-motion-medium) ease;
|
|
468
457
|
}
|
|
469
458
|
`;
|
|
470
|
-
let t =
|
|
471
|
-
|
|
472
|
-
|
|
459
|
+
let t = i;
|
|
460
|
+
r([
|
|
461
|
+
a({ type: String, reflect: !0 })
|
|
473
462
|
], t.prototype, "variant");
|
|
474
|
-
|
|
475
|
-
|
|
463
|
+
r([
|
|
464
|
+
a({ type: String, reflect: !0 })
|
|
476
465
|
], t.prototype, "size");
|
|
477
|
-
|
|
478
|
-
|
|
466
|
+
r([
|
|
467
|
+
a({ type: String, reflect: !0 })
|
|
479
468
|
], t.prototype, "shape");
|
|
480
|
-
|
|
481
|
-
|
|
469
|
+
r([
|
|
470
|
+
a({ type: Boolean, reflect: !0 })
|
|
482
471
|
], t.prototype, "bordered");
|
|
483
|
-
|
|
484
|
-
|
|
472
|
+
r([
|
|
473
|
+
a({ type: Boolean, reflect: !0 })
|
|
485
474
|
], t.prototype, "ghost");
|
|
486
|
-
|
|
487
|
-
|
|
475
|
+
r([
|
|
476
|
+
a({ type: Boolean, reflect: !0 })
|
|
488
477
|
], t.prototype, "link");
|
|
489
|
-
|
|
490
|
-
|
|
478
|
+
r([
|
|
479
|
+
a({ type: Boolean, reflect: !0 })
|
|
491
480
|
], t.prototype, "grouped");
|
|
492
|
-
|
|
493
|
-
|
|
481
|
+
r([
|
|
482
|
+
a({ type: Boolean, reflect: !0, attribute: "full-width" })
|
|
494
483
|
], t.prototype, "fullWidth");
|
|
495
|
-
|
|
496
|
-
|
|
484
|
+
r([
|
|
485
|
+
a({ type: String })
|
|
497
486
|
], t.prototype, "type");
|
|
498
|
-
|
|
499
|
-
|
|
487
|
+
r([
|
|
488
|
+
a({ type: Boolean })
|
|
500
489
|
], t.prototype, "disabled");
|
|
501
|
-
|
|
502
|
-
|
|
490
|
+
r([
|
|
491
|
+
a({ type: Boolean })
|
|
503
492
|
], t.prototype, "loading");
|
|
504
|
-
|
|
505
|
-
|
|
493
|
+
r([
|
|
494
|
+
a({ type: Boolean })
|
|
506
495
|
], t.prototype, "toggle");
|
|
507
|
-
|
|
508
|
-
|
|
496
|
+
r([
|
|
497
|
+
a({ type: Boolean })
|
|
509
498
|
], t.prototype, "pressed");
|
|
510
|
-
|
|
511
|
-
|
|
499
|
+
r([
|
|
500
|
+
a({ type: String, reflect: !0, attribute: "aria-label" })
|
|
512
501
|
], t.prototype, "ariaLabel");
|
|
513
|
-
|
|
514
|
-
|
|
502
|
+
r([
|
|
503
|
+
a({ attribute: !1 })
|
|
515
504
|
], t.prototype, "onClick");
|
|
516
|
-
|
|
517
|
-
|
|
505
|
+
r([
|
|
506
|
+
a({ attribute: !1 })
|
|
518
507
|
], t.prototype, "onFocus");
|
|
519
|
-
|
|
520
|
-
|
|
508
|
+
r([
|
|
509
|
+
a({ attribute: !1 })
|
|
521
510
|
], t.prototype, "onBlur");
|
|
522
|
-
|
|
523
|
-
|
|
511
|
+
r([
|
|
512
|
+
a({ attribute: !1 })
|
|
524
513
|
], t.prototype, "onToggle");
|
|
525
514
|
export {
|
|
526
515
|
t as AgButton
|
|
@@ -1,13 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { AgnosticDrawer, DrawerProps, DrawerOpenEvent, DrawerCloseEvent, DrawerCancelEvent } from '../core/Drawer';
|
|
1
|
+
import { AgnosticDrawer, DrawerProps } from '../core/Drawer';
|
|
3
2
|
import * as React from 'react';
|
|
4
3
|
/**
|
|
5
|
-
* React-specific props for Drawer
|
|
4
|
+
* React-specific props for Drawer.
|
|
5
|
+
*
|
|
6
|
+
* Includes onOpenChange for controlled-component support. This is necessary
|
|
7
|
+
* because the underlying Lit web component manages its own open state internally
|
|
8
|
+
* (e.g. it sets this.open = false on Escape or backdrop click). @lit/react's
|
|
9
|
+
* createComponent only bridges DOM events -> React props, so without explicitly
|
|
10
|
+
* calling onOpenChange(false) on close/cancel, React's state never learns the
|
|
11
|
+
* drawer closed. The stale open={true} is then re-applied on the next render,
|
|
12
|
+
* causing previously dismissed drawers to reappear when other drawers are opened.
|
|
6
13
|
*/
|
|
7
14
|
export interface ReactDrawerProps extends DrawerProps {
|
|
8
15
|
children?: React.ReactNode;
|
|
9
16
|
className?: string;
|
|
10
17
|
id?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Called with the new open state whenever the drawer opens or closes.
|
|
20
|
+
* Wire this to your React state setter (e.g. onOpenChange={setIsOpen}) so
|
|
21
|
+
* React stays in sync when the drawer closes itself internally.
|
|
22
|
+
*/
|
|
23
|
+
onOpenChange?: (open: boolean) => void;
|
|
11
24
|
}
|
|
12
25
|
/**
|
|
13
26
|
* Helper component for drawer header slot
|
|
@@ -21,11 +34,17 @@ export interface DrawerHeaderProps {
|
|
|
21
34
|
export interface DrawerFooterProps {
|
|
22
35
|
children?: React.ReactNode;
|
|
23
36
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
37
|
+
/**
|
|
38
|
+
* ReactDrawer wraps _ReactDrawerBase to add onOpenChange support.
|
|
39
|
+
*
|
|
40
|
+
* The Lit element fires "drawer-close" when the close button is clicked and
|
|
41
|
+
* "drawer-cancel" when the user presses Escape or clicks the backdrop. Both
|
|
42
|
+
* mean the drawer is now closed. We intercept those two events and call
|
|
43
|
+
* onOpenChange(false) so React state reflects the new closed state immediately,
|
|
44
|
+
* preventing the stale open={true} from being pushed back into the element on
|
|
45
|
+
* the next render.
|
|
46
|
+
*/
|
|
47
|
+
export declare const ReactDrawer: React.ForwardRefExoticComponent<ReactDrawerProps & React.RefAttributes<AgnosticDrawer>>;
|
|
29
48
|
export declare const DrawerHeader: React.FC<DrawerHeaderProps>;
|
|
30
49
|
export declare const DrawerFooter: React.FC<DrawerFooterProps>;
|
|
31
50
|
export type { DrawerOpenEvent, DrawerCloseEvent, DrawerCancelEvent } from '../core/Drawer';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReactDrawer.d.ts","sourceRoot":"","sources":["../../../../src/components/Drawer/react/ReactDrawer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ReactDrawer.d.ts","sourceRoot":"","sources":["../../../../src/components/Drawer/react/ReactDrawer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EACL,cAAc,EACd,KAAK,WAAW,EAIjB,MAAM,gBAAgB,CAAC;AAExB;;;;;;;;;;GAUG;AACH,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACnD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;;;OAIG;IACH,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CACxC;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAeD;;;;;;;;;GASG;AACH,eAAO,MAAM,WAAW,yFA4BvB,CAAC;AAKF,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAEpD,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAEpD,CAAC;AAGF,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -1,20 +1,42 @@
|
|
|
1
|
-
import { j as
|
|
1
|
+
import { j as a } from "../../../jsx-runtime-BzflLqGi.js";
|
|
2
2
|
import * as o from "react";
|
|
3
|
-
import { o as
|
|
3
|
+
import { o as m } from "../../../create-component-BPMDMe-q.js";
|
|
4
4
|
import "../core/Drawer.js";
|
|
5
|
-
import { AgnosticDrawer as
|
|
6
|
-
const
|
|
5
|
+
import { AgnosticDrawer as i } from "../core/_drawer.js";
|
|
6
|
+
const p = m({
|
|
7
7
|
tagName: "ag-drawer",
|
|
8
|
-
elementClass:
|
|
8
|
+
elementClass: i,
|
|
9
9
|
react: o,
|
|
10
10
|
events: {
|
|
11
11
|
onDrawerOpen: "drawer-open",
|
|
12
12
|
onDrawerClose: "drawer-close",
|
|
13
13
|
onDrawerCancel: "drawer-cancel"
|
|
14
14
|
}
|
|
15
|
-
}),
|
|
15
|
+
}), f = o.forwardRef(
|
|
16
|
+
({ onOpenChange: r, onDrawerOpen: t, onDrawerClose: s, onDrawerCancel: n, ...w }, c) => {
|
|
17
|
+
const l = (e) => {
|
|
18
|
+
t?.(e), r?.(!0);
|
|
19
|
+
}, D = (e) => {
|
|
20
|
+
s?.(e), r?.(!1);
|
|
21
|
+
}, d = (e) => {
|
|
22
|
+
n?.(e), r?.(!1);
|
|
23
|
+
};
|
|
24
|
+
return /* @__PURE__ */ a.jsx(
|
|
25
|
+
p,
|
|
26
|
+
{
|
|
27
|
+
ref: c,
|
|
28
|
+
onDrawerOpen: l,
|
|
29
|
+
onDrawerClose: D,
|
|
30
|
+
onDrawerCancel: d,
|
|
31
|
+
...w
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
f.displayName = "ReactDrawer";
|
|
37
|
+
const C = ({ children: r }) => /* @__PURE__ */ a.jsx("div", { slot: "header", children: r }), v = ({ children: r }) => /* @__PURE__ */ a.jsx("div", { slot: "footer", children: r });
|
|
16
38
|
export {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
39
|
+
v as DrawerFooter,
|
|
40
|
+
C as DrawerHeader,
|
|
41
|
+
f as ReactDrawer
|
|
20
42
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_EmptyState.d.ts","sourceRoot":"","sources":["../../../../src/components/EmptyState/core/_EmptyState.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAG5C,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,qBAAa,YAAa,SAAQ,UAAW,YAAW,eAAe;IAE7D,KAAK,EAAE,MAAM,CAAC;IAGd,QAAQ,EAAE,MAAM,CAAC;IAGjB,UAAU,EAAE,MAAM,CAAC;IAGnB,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAGzB,QAAQ,EAAE,OAAO,CAAC;IAGlB,OAAO,EAAE,OAAO,CAAC;IAGzB,OAAO,CAAC,YAAY,CAAS;IAG7B,OAAO,CAAC,eAAe,CAAS;;IAYhC,OAAO,CAAC,iBAAiB;
|
|
1
|
+
{"version":3,"file":"_EmptyState.d.ts","sourceRoot":"","sources":["../../../../src/components/EmptyState/core/_EmptyState.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAG5C,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,qBAAa,YAAa,SAAQ,UAAW,YAAW,eAAe;IAE7D,KAAK,EAAE,MAAM,CAAC;IAGd,QAAQ,EAAE,MAAM,CAAC;IAGjB,UAAU,EAAE,MAAM,CAAC;IAGnB,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAGzB,QAAQ,EAAE,OAAO,CAAC;IAGlB,OAAO,EAAE,OAAO,CAAC;IAGzB,OAAO,CAAC,YAAY,CAAS;IAG7B,OAAO,CAAC,eAAe,CAAS;;IAYhC,OAAO,CAAC,iBAAiB;IAWhB,YAAY;IAoBrB,MAAM,CAAC,MAAM,0BA8FX;IAEF,MAAM;CAuDP"}
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import { hasSlotContent as l } from "../../../utils/slot.js";
|
|
2
|
-
import { LitElement as
|
|
3
|
-
import { n as
|
|
4
|
-
|
|
2
|
+
import { LitElement as u, css as b, html as r } from "lit";
|
|
3
|
+
import { n as a } from "../../../property-CemaeiRl.js";
|
|
4
|
+
import { r as d } from "../../../state-CovhUvdr.js";
|
|
5
|
+
var m = Object.defineProperty, s = (p, e, o, n) => {
|
|
5
6
|
for (var i = void 0, c = p.length - 1, g; c >= 0; c--)
|
|
6
7
|
(g = p[c]) && (i = g(e, o, i) || i);
|
|
7
|
-
return i &&
|
|
8
|
+
return i && m(e, o, i), i;
|
|
8
9
|
};
|
|
9
|
-
const h = class h extends
|
|
10
|
+
const h = class h extends u {
|
|
10
11
|
constructor() {
|
|
11
12
|
super(), this._hasIconSlot = !1, this._hasActionsSlot = !1, this.title = "", this.subtitle = "", this.buttonText = "", this.size = "md", this.bordered = !1, this.rounded = !1;
|
|
12
13
|
}
|
|
13
14
|
_handleSlotChange(e) {
|
|
14
15
|
const o = e.target, n = o.name;
|
|
15
|
-
n === "icon" ? this._hasIconSlot = l(o) : n === "actions" && (this._hasActionsSlot = l(o))
|
|
16
|
+
n === "icon" ? this._hasIconSlot = l(o) : n === "actions" && (this._hasActionsSlot = l(o));
|
|
16
17
|
}
|
|
17
18
|
firstUpdated() {
|
|
18
19
|
setTimeout(() => {
|
|
@@ -73,7 +74,7 @@ const h = class h extends d {
|
|
|
73
74
|
`;
|
|
74
75
|
}
|
|
75
76
|
};
|
|
76
|
-
h.styles =
|
|
77
|
+
h.styles = b`
|
|
77
78
|
:host {
|
|
78
79
|
display: block;
|
|
79
80
|
}
|
|
@@ -169,29 +170,29 @@ h.styles = u`
|
|
|
169
170
|
}
|
|
170
171
|
`;
|
|
171
172
|
let t = h;
|
|
172
|
-
|
|
173
|
-
|
|
173
|
+
s([
|
|
174
|
+
a({ type: String })
|
|
174
175
|
], t.prototype, "title");
|
|
175
|
-
|
|
176
|
-
|
|
176
|
+
s([
|
|
177
|
+
a({ type: String })
|
|
177
178
|
], t.prototype, "subtitle");
|
|
178
|
-
|
|
179
|
-
|
|
179
|
+
s([
|
|
180
|
+
a({ type: String, attribute: "button-text" })
|
|
180
181
|
], t.prototype, "buttonText");
|
|
181
|
-
|
|
182
|
-
|
|
182
|
+
s([
|
|
183
|
+
a({ type: String, reflect: !0 })
|
|
183
184
|
], t.prototype, "size");
|
|
184
|
-
|
|
185
|
-
|
|
185
|
+
s([
|
|
186
|
+
a({ type: Boolean })
|
|
186
187
|
], t.prototype, "bordered");
|
|
187
|
-
|
|
188
|
-
|
|
188
|
+
s([
|
|
189
|
+
a({ type: Boolean })
|
|
189
190
|
], t.prototype, "rounded");
|
|
190
|
-
|
|
191
|
-
|
|
191
|
+
s([
|
|
192
|
+
d()
|
|
192
193
|
], t.prototype, "_hasIconSlot");
|
|
193
|
-
|
|
194
|
-
|
|
194
|
+
s([
|
|
195
|
+
d()
|
|
195
196
|
], t.prototype, "_hasActionsSlot");
|
|
196
197
|
export {
|
|
197
198
|
t as AgEmptyState
|
|
@@ -38,6 +38,14 @@ export interface InputProps {
|
|
|
38
38
|
}
|
|
39
39
|
declare const AgInput_base: (new (...args: any[]) => import('../../../shared/face-mixin').FaceMixinInterface) & typeof LitElement;
|
|
40
40
|
export declare class AgInput extends AgInput_base implements InputProps {
|
|
41
|
+
static shadowRootOptions: {
|
|
42
|
+
delegatesFocus: boolean;
|
|
43
|
+
clonable?: boolean;
|
|
44
|
+
customElementRegistry?: CustomElementRegistry;
|
|
45
|
+
mode: ShadowRootMode;
|
|
46
|
+
serializable?: boolean;
|
|
47
|
+
slotAssignment?: SlotAssignmentMode;
|
|
48
|
+
};
|
|
41
49
|
static styles: import('lit').CSSResult[];
|
|
42
50
|
private _ids;
|
|
43
51
|
private _inputElement?;
|
|
@@ -83,14 +91,6 @@ export declare class AgInput extends AgInput_base implements InputProps {
|
|
|
83
91
|
* Set the value of the input
|
|
84
92
|
*/
|
|
85
93
|
setValue(value: string): void;
|
|
86
|
-
/**
|
|
87
|
-
* Focus the input element
|
|
88
|
-
*/
|
|
89
|
-
focus(): void;
|
|
90
|
-
/**
|
|
91
|
-
* Blur the input element
|
|
92
|
-
*/
|
|
93
|
-
blur(): void;
|
|
94
94
|
/**
|
|
95
95
|
* Select the text in the input
|
|
96
96
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_Input.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/core/_Input.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAsB,MAAM,KAAK,CAAC;AAKrD,OAAO,EAIL,KAAK,aAAa,EACnB,MAAM,oCAAoC,CAAC;AAG5C,MAAM,MAAM,SAAS,GACjB,MAAM,GACN,UAAU,GACV,OAAO,GACP,QAAQ,GACR,QAAQ,GACR,KAAK,GACL,KAAK,GACL,MAAM,GACN,gBAAgB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OnB;;;;;OAKG;IACH,OAAO,CAAC,aAAa;IAMrB;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAazB;;OAEG;IACH,OAAO,CAAC,YAAY;IAapB;;OAEG;IACH,OAAO,CAAC,aAAa;IAarB;;OAEG;IACH,OAAO,CAAC,YAAY;IAepB;;OAEG;IACH,OAAO,CAAC,WAAW;IAenB;;OAEG;IACH,OAAO,CAAC,YAAY;IAMpB;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAS3B;;OAEG;IACH,OAAO,CAAC,mBAAmB;IA4DlB,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IAY/C,YAAY;IAwBrB;;OAEG;IACH,OAAO,CAAC,YAAY;IAgCpB;;OAEG;IACH,OAAO,CAAC,aAAa;IAcrB;;;;;;OAMG;IACH,OAAO,CAAC,YAAY;IAepB,MAAM;CAkFP"}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { css as
|
|
1
|
+
import { LitElement as c, css as v, html as s, nothing as o } from "lit";
|
|
2
2
|
import { n as i } from "../../../property-CemaeiRl.js";
|
|
3
|
-
import { r as
|
|
3
|
+
import { r as b } from "../../../state-CovhUvdr.js";
|
|
4
4
|
import { e as y } from "../../../query-BykXNUlT.js";
|
|
5
5
|
import { o as l } from "../../../if-defined-C8i28hSj.js";
|
|
6
6
|
import { hasSlotContent as u } from "../../../utils/slot.js";
|
|
7
7
|
import { formControlStyles as m } from "../../../shared/form-control-styles.js";
|
|
8
|
-
import { createFormControlIds as $, buildAriaDescribedBy as x, isHorizontalLabel as
|
|
8
|
+
import { createFormControlIds as $, buildAriaDescribedBy as x, isHorizontalLabel as f } from "../../../shared/form-control-utils.js";
|
|
9
9
|
import { FaceMixin as w, syncInnerInputValidity as k } from "../../../shared/face-mixin.js";
|
|
10
|
-
var S = Object.defineProperty, a = (
|
|
11
|
-
for (var d = void 0,
|
|
12
|
-
(
|
|
10
|
+
var S = Object.defineProperty, a = (g, t, n, r) => {
|
|
11
|
+
for (var d = void 0, p = g.length - 1, _; p >= 0; p--)
|
|
12
|
+
(_ = g[p]) && (d = _(t, n, d) || d);
|
|
13
13
|
return d && S(t, n, d), d;
|
|
14
14
|
};
|
|
15
|
-
const
|
|
15
|
+
const h = class h extends w(c) {
|
|
16
16
|
constructor() {
|
|
17
17
|
super(), this._ids = $("ag-input"), this._hasLeftAddon = !1, this._hasRightAddon = !1, this.label = "", this.labelHidden = !1, this.labelPosition = "top", this.noLabel = !1, this.ariaLabel = "", this.type = "text", this.value = "", this.placeholder = "", this.rows = 4, this.cols = 50, this.size = "default", this.capsule = !1, this.rounded = !1, this.underlined = !1, this.underlinedWithBackground = !1, this.inline = !1, this.required = !1, this.disabled = !1, this.readonly = !1, this.invalid = !1, this.errorMessage = "", this.helpText = "";
|
|
18
18
|
}
|
|
@@ -34,18 +34,6 @@ const p = class p extends w(v) {
|
|
|
34
34
|
setValue(t) {
|
|
35
35
|
this._inputElement && (this._inputElement.value = t, this.value = t);
|
|
36
36
|
}
|
|
37
|
-
/**
|
|
38
|
-
* Focus the input element
|
|
39
|
-
*/
|
|
40
|
-
focus() {
|
|
41
|
-
this._inputElement?.focus();
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Blur the input element
|
|
45
|
-
*/
|
|
46
|
-
blur() {
|
|
47
|
-
this._inputElement?.blur();
|
|
48
|
-
}
|
|
49
37
|
/**
|
|
50
38
|
* Select the text in the input
|
|
51
39
|
*/
|
|
@@ -222,7 +210,7 @@ const p = class p extends w(v) {
|
|
|
222
210
|
_renderLabel() {
|
|
223
211
|
if (!this.label || this.noLabel) return o;
|
|
224
212
|
const t = [];
|
|
225
|
-
return
|
|
213
|
+
return f(this.labelPosition) ? (t.push("ag-form-control__label--horizontal"), t.push(`ag-form-control__label--${this.labelPosition}`), t.push("ag-input__label--horizontal"), t.push(`ag-input__label--${this.labelPosition}`)) : this.labelPosition === "bottom" && (t.push(`ag-form-control__label--${this.labelPosition}`), t.push(`ag-input__label--${this.labelPosition}`)), s`
|
|
226
214
|
<label
|
|
227
215
|
id="${this._ids.labelId}"
|
|
228
216
|
for="${this._ids.inputId}"
|
|
@@ -272,7 +260,7 @@ const p = class p extends w(v) {
|
|
|
272
260
|
`;
|
|
273
261
|
}
|
|
274
262
|
render() {
|
|
275
|
-
const t = this._hasLeftAddon || this._hasRightAddon, n =
|
|
263
|
+
const t = this._hasLeftAddon || this._hasRightAddon, n = f(this.labelPosition), r = ["ag-input"];
|
|
276
264
|
this.size === "small" && r.push("ag-input--small"), this.size === "large" && r.push("ag-input--large"), this.rounded && r.push("ag-input--rounded"), this.underlined && r.push("ag-input--underlined"), this.underlinedWithBackground && r.push("ag-input--underlined-with-background");
|
|
277
265
|
const d = t ? s`
|
|
278
266
|
<div class="ag-input__field" part="ag-input-field-wrapper">
|
|
@@ -325,9 +313,12 @@ const p = class p extends w(v) {
|
|
|
325
313
|
`;
|
|
326
314
|
}
|
|
327
315
|
};
|
|
328
|
-
|
|
316
|
+
h.shadowRootOptions = {
|
|
317
|
+
...c.shadowRootOptions,
|
|
318
|
+
delegatesFocus: !0
|
|
319
|
+
}, h.styles = [
|
|
329
320
|
m,
|
|
330
|
-
|
|
321
|
+
v`
|
|
331
322
|
:host {
|
|
332
323
|
display: block;
|
|
333
324
|
}
|
|
@@ -567,7 +558,7 @@ p.styles = [
|
|
|
567
558
|
}
|
|
568
559
|
`
|
|
569
560
|
];
|
|
570
|
-
let e =
|
|
561
|
+
let e = h;
|
|
571
562
|
a([
|
|
572
563
|
y("input, textarea")
|
|
573
564
|
], e.prototype, "_inputElement");
|
|
@@ -653,10 +644,10 @@ a([
|
|
|
653
644
|
i({ attribute: !1 })
|
|
654
645
|
], e.prototype, "onBlur");
|
|
655
646
|
a([
|
|
656
|
-
|
|
647
|
+
b()
|
|
657
648
|
], e.prototype, "_hasLeftAddon");
|
|
658
649
|
a([
|
|
659
|
-
|
|
650
|
+
b()
|
|
660
651
|
], e.prototype, "_hasRightAddon");
|
|
661
652
|
export {
|
|
662
653
|
e as AgInput
|
|
@@ -36,6 +36,14 @@ declare const Select_base: (new (...args: any[]) => import('../../../shared/face
|
|
|
36
36
|
* @fires change - Emitted when selection changes
|
|
37
37
|
*/
|
|
38
38
|
export declare class Select extends Select_base implements SelectProps {
|
|
39
|
+
static shadowRootOptions: {
|
|
40
|
+
delegatesFocus: boolean;
|
|
41
|
+
clonable?: boolean;
|
|
42
|
+
customElementRegistry?: CustomElementRegistry;
|
|
43
|
+
mode: ShadowRootMode;
|
|
44
|
+
serializable?: boolean;
|
|
45
|
+
slotAssignment?: SlotAssignmentMode;
|
|
46
|
+
};
|
|
39
47
|
size: SelectSize;
|
|
40
48
|
multiple: boolean;
|
|
41
49
|
disabled: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_Select.d.ts","sourceRoot":"","sources":["../../../../src/components/Select/core/_Select.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAE5C,OAAO,EAIL,KAAK,aAAa,EACnB,MAAM,oCAAoC,CAAC;AAI5C,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,OAAO,GAAG,EAAE,CAAC;AAGhD,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAC1B;AACD,MAAM,MAAM,iBAAiB,GAAG,WAAW,CAAC,uBAAuB,CAAC,CAAC;AAErE,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CA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AAE,IAAI,GAAG,MAAM,GAAG,QAAQ,GAAG,IAAI,EACtC,KAAK,EAAE,SAAS,GAAG,cAAc,GAChC,IAAI;IAmBP;;;;;;;;;;OAUG;IACH,OAAO,CAAC,WAAW;IAMnB;;;;;OAKG;IACH,OAAO,CAAC,cAAc;IAatB;;OAEG;IACH,OAAO,CAAC,aAAa;IAMZ,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IAWxD,SAAS,CAAC,YAAY;IAgBtB,OAAO,CAAC,gBAAgB;IAwBxB,MAAM,CAAC,MAAM,4BA6FX;IAEF,OAAO,CAAC,WAAW;IAOnB,OAAO,CAAC,WAAW;IAanB,OAAO,CAAC,UAAU;IAalB,OAAO,CAAC,YAAY;IA4BpB,OAAO,CAAC,WAAW;IAwBnB,MAAM;CA0EP;AAOD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,WAAW,EAAE,MAAM,CAAC;KACrB;CACF"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { LitElement as
|
|
2
|
-
import { n as
|
|
1
|
+
import { LitElement as p, css as g, html as n } from "lit";
|
|
2
|
+
import { n as o } from "../../../property-CemaeiRl.js";
|
|
3
3
|
import { e as m } from "../../../query-BykXNUlT.js";
|
|
4
|
-
import { isHorizontalLabel as
|
|
4
|
+
import { isHorizontalLabel as u, createFormControlIds as f, buildAriaDescribedBy as b } from "../../../shared/form-control-utils.js";
|
|
5
5
|
import { formControlStyles as v } from "../../../shared/form-control-styles.js";
|
|
6
6
|
import { FaceMixin as y, syncInnerInputValidity as _ } from "../../../shared/face-mixin.js";
|
|
7
|
-
var E = Object.defineProperty, i = (h, e, a,
|
|
7
|
+
var E = Object.defineProperty, i = (h, e, a, r) => {
|
|
8
8
|
for (var s = void 0, l = h.length - 1, d; l >= 0; l--)
|
|
9
9
|
(d = h[l]) && (s = d(e, a, s) || s);
|
|
10
10
|
return s && E(e, a, s), s;
|
|
11
11
|
};
|
|
12
|
-
const c = class c extends y(
|
|
12
|
+
const c = class c extends y(p) {
|
|
13
13
|
constructor() {
|
|
14
14
|
super(...arguments), this.size = "", this.multiple = !1, this.disabled = !1, this.label = "", this.labelPosition = "top", this.labelHidden = !1, this.noLabel = !1, this.required = !1, this.invalid = !1, this.errorMessage = "", this.helpText = "";
|
|
15
15
|
}
|
|
@@ -31,12 +31,12 @@ const c = class c extends y(u) {
|
|
|
31
31
|
this.updateComplete.then(() => {
|
|
32
32
|
if (this.selectElement) {
|
|
33
33
|
if (this.multiple && e instanceof FormData) {
|
|
34
|
-
const
|
|
34
|
+
const r = new Set(Array.from(e.values()));
|
|
35
35
|
Array.from(this.selectElement.options).forEach((s) => {
|
|
36
|
-
s.selected =
|
|
36
|
+
s.selected = r.has(s.value);
|
|
37
37
|
});
|
|
38
|
-
} else typeof e == "string" && Array.from(this.selectElement.options).forEach((
|
|
39
|
-
|
|
38
|
+
} else typeof e == "string" && Array.from(this.selectElement.options).forEach((r) => {
|
|
39
|
+
r.selected = r.value === e;
|
|
40
40
|
});
|
|
41
41
|
this._syncFormValue(), this._syncValidity(), this._syncStates();
|
|
42
42
|
}
|
|
@@ -91,10 +91,10 @@ const c = class c extends y(u) {
|
|
|
91
91
|
if (!this.selectElement) return;
|
|
92
92
|
const e = this.shadowRoot?.querySelector("slot");
|
|
93
93
|
if (!e) return;
|
|
94
|
-
e.assignedNodes().forEach((
|
|
95
|
-
if (
|
|
96
|
-
const s =
|
|
97
|
-
(s.tagName === "OPTION" || s.tagName === "OPTGROUP") && this.selectElement.appendChild(
|
|
94
|
+
e.assignedNodes().forEach((r) => {
|
|
95
|
+
if (r.nodeType === Node.ELEMENT_NODE) {
|
|
96
|
+
const s = r;
|
|
97
|
+
(s.tagName === "OPTION" || s.tagName === "OPTGROUP") && this.selectElement.appendChild(r);
|
|
98
98
|
}
|
|
99
99
|
});
|
|
100
100
|
}
|
|
@@ -115,10 +115,10 @@ const c = class c extends y(u) {
|
|
|
115
115
|
}
|
|
116
116
|
handleChange(e) {
|
|
117
117
|
const a = e.target;
|
|
118
|
-
let
|
|
119
|
-
this.multiple ?
|
|
118
|
+
let r;
|
|
119
|
+
this.multiple ? r = Array.from(a.selectedOptions).map((l) => l.value) : r = a.value, this._syncFormValue(), this._syncValidity();
|
|
120
120
|
const s = new CustomEvent("change", {
|
|
121
|
-
detail: { value:
|
|
121
|
+
detail: { value: r },
|
|
122
122
|
bubbles: !0,
|
|
123
123
|
composed: !0
|
|
124
124
|
});
|
|
@@ -127,7 +127,7 @@ const c = class c extends y(u) {
|
|
|
127
127
|
renderLabel(e) {
|
|
128
128
|
if (!this.label || this.noLabel) return "";
|
|
129
129
|
const a = [];
|
|
130
|
-
return
|
|
130
|
+
return u(this.labelPosition) ? (a.push("ag-form-control__label--horizontal"), a.push(`ag-form-control__label--${this.labelPosition}`)) : this.labelPosition === "bottom" && a.push(`ag-form-control__label--${this.labelPosition}`), n`
|
|
131
131
|
<label
|
|
132
132
|
for=${e.inputId}
|
|
133
133
|
class="ag-form-control__label ${this.labelHidden ? "ag-form-control__label--hidden" : ""} ${this.required ? "ag-form-control__label--required" : ""} ${a.join(" ")}"
|
|
@@ -142,7 +142,7 @@ const c = class c extends y(u) {
|
|
|
142
142
|
errorId: e.errorId,
|
|
143
143
|
hasHelper: !!this.helpText && !this.invalid,
|
|
144
144
|
hasError: !!this.invalid && !!this.errorMessage
|
|
145
|
-
}),
|
|
145
|
+
}), r = u(this.labelPosition), s = n`
|
|
146
146
|
<select
|
|
147
147
|
id=${e.inputId}
|
|
148
148
|
class="select"
|
|
@@ -166,7 +166,7 @@ const c = class c extends y(u) {
|
|
|
166
166
|
</div>` : "", d = this.invalid && this.errorMessage ? n`<div id=${e.errorId} class="ag-form-control__error">
|
|
167
167
|
${this.errorMessage}
|
|
168
168
|
</div>` : "";
|
|
169
|
-
return
|
|
169
|
+
return r ? n`
|
|
170
170
|
<div class="ag-form-control--horizontal">
|
|
171
171
|
${this.renderLabel(e)}
|
|
172
172
|
${s}
|
|
@@ -186,7 +186,10 @@ const c = class c extends y(u) {
|
|
|
186
186
|
`;
|
|
187
187
|
}
|
|
188
188
|
};
|
|
189
|
-
c.
|
|
189
|
+
c.shadowRootOptions = {
|
|
190
|
+
...p.shadowRootOptions,
|
|
191
|
+
delegatesFocus: !0
|
|
192
|
+
}, c.styles = [
|
|
190
193
|
v,
|
|
191
194
|
g`
|
|
192
195
|
:host {
|
|
@@ -282,52 +285,52 @@ c.styles = [
|
|
|
282
285
|
];
|
|
283
286
|
let t = c;
|
|
284
287
|
i([
|
|
285
|
-
|
|
288
|
+
o({ type: String, reflect: !0 })
|
|
286
289
|
], t.prototype, "size");
|
|
287
290
|
i([
|
|
288
|
-
|
|
291
|
+
o({ type: Boolean, reflect: !0 })
|
|
289
292
|
], t.prototype, "multiple");
|
|
290
293
|
i([
|
|
291
|
-
|
|
294
|
+
o({ type: Boolean, reflect: !0 })
|
|
292
295
|
], t.prototype, "disabled");
|
|
293
296
|
i([
|
|
294
|
-
|
|
297
|
+
o({ type: Number, attribute: "multiple-size" })
|
|
295
298
|
], t.prototype, "multipleSize");
|
|
296
299
|
i([
|
|
297
|
-
|
|
300
|
+
o({ type: String })
|
|
298
301
|
], t.prototype, "label");
|
|
299
302
|
i([
|
|
300
|
-
|
|
303
|
+
o({ type: String, attribute: "label-position" })
|
|
301
304
|
], t.prototype, "labelPosition");
|
|
302
305
|
i([
|
|
303
|
-
|
|
306
|
+
o({ type: Boolean, attribute: "label-hidden" })
|
|
304
307
|
], t.prototype, "labelHidden");
|
|
305
308
|
i([
|
|
306
|
-
|
|
309
|
+
o({ type: Boolean, attribute: "no-label" })
|
|
307
310
|
], t.prototype, "noLabel");
|
|
308
311
|
i([
|
|
309
|
-
|
|
312
|
+
o({ type: Boolean })
|
|
310
313
|
], t.prototype, "required");
|
|
311
314
|
i([
|
|
312
|
-
|
|
315
|
+
o({ type: Boolean })
|
|
313
316
|
], t.prototype, "invalid");
|
|
314
317
|
i([
|
|
315
|
-
|
|
318
|
+
o({ type: String, attribute: "error-message" })
|
|
316
319
|
], t.prototype, "errorMessage");
|
|
317
320
|
i([
|
|
318
|
-
|
|
321
|
+
o({ type: String, attribute: "help-text" })
|
|
319
322
|
], t.prototype, "helpText");
|
|
320
323
|
i([
|
|
321
|
-
|
|
324
|
+
o({ attribute: !1 })
|
|
322
325
|
], t.prototype, "onClick");
|
|
323
326
|
i([
|
|
324
|
-
|
|
327
|
+
o({ attribute: !1 })
|
|
325
328
|
], t.prototype, "onFocus");
|
|
326
329
|
i([
|
|
327
|
-
|
|
330
|
+
o({ attribute: !1 })
|
|
328
331
|
], t.prototype, "onBlur");
|
|
329
332
|
i([
|
|
330
|
-
|
|
333
|
+
o({ attribute: !1 })
|
|
331
334
|
], t.prototype, "onChange");
|
|
332
335
|
i([
|
|
333
336
|
m("select")
|
package/dist/utils/slot.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
function o(t) {
|
|
2
2
|
if (!t)
|
|
3
3
|
return !1;
|
|
4
|
-
const n = t.assignedNodes(
|
|
4
|
+
const n = t.assignedNodes(), r = (e) => e.children.length > 0 || e.textContent?.trim() !== "";
|
|
5
5
|
return n.some((e) => e.nodeType === Node.ELEMENT_NODE ? r(e) : e.nodeType === Node.TEXT_NODE ? e.textContent?.trim() !== "" : !1);
|
|
6
6
|
}
|
|
7
7
|
export {
|
package/package.json
CHANGED
|
@@ -69,6 +69,11 @@ export interface ButtonProps {
|
|
|
69
69
|
* - APG-compliant accessibility
|
|
70
70
|
*/
|
|
71
71
|
export class AgButton extends LitElement implements ButtonProps {
|
|
72
|
+
static shadowRootOptions = {
|
|
73
|
+
...LitElement.shadowRootOptions,
|
|
74
|
+
delegatesFocus: true,
|
|
75
|
+
};
|
|
76
|
+
|
|
72
77
|
static styles = css`
|
|
73
78
|
/* MINIMALIST & THEMEABLE - Styling via --ag-* design tokens */
|
|
74
79
|
:host {
|
|
@@ -635,26 +640,6 @@ export class AgButton extends LitElement implements ButtonProps {
|
|
|
635
640
|
this.dispatchEvent(blurEvent);
|
|
636
641
|
}
|
|
637
642
|
|
|
638
|
-
/**
|
|
639
|
-
* Focus the internal button element
|
|
640
|
-
*/
|
|
641
|
-
focus() {
|
|
642
|
-
const button = this.shadowRoot?.querySelector('button');
|
|
643
|
-
if (button) {
|
|
644
|
-
button.focus();
|
|
645
|
-
}
|
|
646
|
-
}
|
|
647
|
-
|
|
648
|
-
/**
|
|
649
|
-
* Blur the internal button element
|
|
650
|
-
*/
|
|
651
|
-
blur() {
|
|
652
|
-
const button = this.shadowRoot?.querySelector('button');
|
|
653
|
-
if (button) {
|
|
654
|
-
button.blur();
|
|
655
|
-
}
|
|
656
|
-
}
|
|
657
|
-
|
|
658
643
|
render() {
|
|
659
644
|
const isDisabled = this.disabled || this.loading;
|
|
660
645
|
|
|
@@ -9,12 +9,26 @@ import {
|
|
|
9
9
|
} from '../core/Drawer';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
* React-specific props for Drawer
|
|
12
|
+
* React-specific props for Drawer.
|
|
13
|
+
*
|
|
14
|
+
* Includes onOpenChange for controlled-component support. This is necessary
|
|
15
|
+
* because the underlying Lit web component manages its own open state internally
|
|
16
|
+
* (e.g. it sets this.open = false on Escape or backdrop click). @lit/react's
|
|
17
|
+
* createComponent only bridges DOM events -> React props, so without explicitly
|
|
18
|
+
* calling onOpenChange(false) on close/cancel, React's state never learns the
|
|
19
|
+
* drawer closed. The stale open={true} is then re-applied on the next render,
|
|
20
|
+
* causing previously dismissed drawers to reappear when other drawers are opened.
|
|
13
21
|
*/
|
|
14
22
|
export interface ReactDrawerProps extends DrawerProps {
|
|
15
23
|
children?: React.ReactNode;
|
|
16
24
|
className?: string;
|
|
17
25
|
id?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Called with the new open state whenever the drawer opens or closes.
|
|
28
|
+
* Wire this to your React state setter (e.g. onOpenChange={setIsOpen}) so
|
|
29
|
+
* React stays in sync when the drawer closes itself internally.
|
|
30
|
+
*/
|
|
31
|
+
onOpenChange?: (open: boolean) => void;
|
|
18
32
|
}
|
|
19
33
|
|
|
20
34
|
/**
|
|
@@ -31,8 +45,9 @@ export interface DrawerFooterProps {
|
|
|
31
45
|
children?: React.ReactNode;
|
|
32
46
|
}
|
|
33
47
|
|
|
34
|
-
//
|
|
35
|
-
|
|
48
|
+
// Raw @lit/react bridge — maps Lit custom events to React prop callbacks.
|
|
49
|
+
// Does NOT handle onOpenChange; that requires the wrapper below.
|
|
50
|
+
const _ReactDrawerBase = createComponent({
|
|
36
51
|
tagName: 'ag-drawer',
|
|
37
52
|
elementClass: AgnosticDrawer,
|
|
38
53
|
react: React,
|
|
@@ -43,6 +58,48 @@ export const ReactDrawer = createComponent({
|
|
|
43
58
|
},
|
|
44
59
|
});
|
|
45
60
|
|
|
61
|
+
/**
|
|
62
|
+
* ReactDrawer wraps _ReactDrawerBase to add onOpenChange support.
|
|
63
|
+
*
|
|
64
|
+
* The Lit element fires "drawer-close" when the close button is clicked and
|
|
65
|
+
* "drawer-cancel" when the user presses Escape or clicks the backdrop. Both
|
|
66
|
+
* mean the drawer is now closed. We intercept those two events and call
|
|
67
|
+
* onOpenChange(false) so React state reflects the new closed state immediately,
|
|
68
|
+
* preventing the stale open={true} from being pushed back into the element on
|
|
69
|
+
* the next render.
|
|
70
|
+
*/
|
|
71
|
+
export const ReactDrawer = React.forwardRef<AgnosticDrawer, ReactDrawerProps>(
|
|
72
|
+
({ onOpenChange, onDrawerOpen, onDrawerClose, onDrawerCancel, ...props }, ref) => {
|
|
73
|
+
const handleDrawerOpen = (event: DrawerOpenEvent) => {
|
|
74
|
+
onDrawerOpen?.(event);
|
|
75
|
+
onOpenChange?.(true);
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
// Both close and cancel mean the drawer is no longer open — notify React.
|
|
79
|
+
const handleDrawerClose = (event: DrawerCloseEvent) => {
|
|
80
|
+
onDrawerClose?.(event);
|
|
81
|
+
onOpenChange?.(false);
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
const handleDrawerCancel = (event: DrawerCancelEvent) => {
|
|
85
|
+
onDrawerCancel?.(event);
|
|
86
|
+
onOpenChange?.(false);
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
return (
|
|
90
|
+
<_ReactDrawerBase
|
|
91
|
+
ref={ref}
|
|
92
|
+
onDrawerOpen={handleDrawerOpen}
|
|
93
|
+
onDrawerClose={handleDrawerClose}
|
|
94
|
+
onDrawerCancel={handleDrawerCancel}
|
|
95
|
+
{...props}
|
|
96
|
+
/>
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
);
|
|
100
|
+
|
|
101
|
+
ReactDrawer.displayName = 'ReactDrawer';
|
|
102
|
+
|
|
46
103
|
// Helper components for slots (simple React components)
|
|
47
104
|
export const DrawerHeader: React.FC<DrawerHeaderProps> = ({ children }) => {
|
|
48
105
|
return <div slot="header">{children}</div>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { hasSlotContent } from '../../../utils/slot';
|
|
2
2
|
import { LitElement, html, css } from 'lit';
|
|
3
|
-
import { property } from 'lit/decorators.js';
|
|
3
|
+
import { property, state } from 'lit/decorators.js';
|
|
4
4
|
|
|
5
5
|
export type EmptyStateProps = {
|
|
6
6
|
title?: string;
|
|
@@ -30,10 +30,10 @@ export class AgEmptyState extends LitElement implements EmptyStateProps {
|
|
|
30
30
|
@property({ type: Boolean })
|
|
31
31
|
declare rounded: boolean;
|
|
32
32
|
|
|
33
|
-
@
|
|
33
|
+
@state()
|
|
34
34
|
private _hasIconSlot = false;
|
|
35
35
|
|
|
36
|
-
@
|
|
36
|
+
@state()
|
|
37
37
|
private _hasActionsSlot = false;
|
|
38
38
|
|
|
39
39
|
constructor() {
|
|
@@ -55,8 +55,6 @@ export class AgEmptyState extends LitElement implements EmptyStateProps {
|
|
|
55
55
|
} else if (slotName === 'actions') {
|
|
56
56
|
this._hasActionsSlot = hasSlotContent(slot);
|
|
57
57
|
}
|
|
58
|
-
|
|
59
|
-
this.requestUpdate();
|
|
60
58
|
}
|
|
61
59
|
|
|
62
60
|
override firstUpdated() {
|
|
@@ -70,6 +70,11 @@ export interface InputProps {
|
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
export class AgInput extends FaceMixin(LitElement) implements InputProps {
|
|
73
|
+
static shadowRootOptions = {
|
|
74
|
+
...LitElement.shadowRootOptions,
|
|
75
|
+
delegatesFocus: true,
|
|
76
|
+
};
|
|
77
|
+
|
|
73
78
|
static styles = [
|
|
74
79
|
formControlStyles,
|
|
75
80
|
css`
|
|
@@ -462,20 +467,6 @@ export class AgInput extends FaceMixin(LitElement) implements InputProps {
|
|
|
462
467
|
}
|
|
463
468
|
}
|
|
464
469
|
|
|
465
|
-
/**
|
|
466
|
-
* Focus the input element
|
|
467
|
-
*/
|
|
468
|
-
focus(): void {
|
|
469
|
-
this._inputElement?.focus();
|
|
470
|
-
}
|
|
471
|
-
|
|
472
|
-
/**
|
|
473
|
-
* Blur the input element
|
|
474
|
-
*/
|
|
475
|
-
blur(): void {
|
|
476
|
-
this._inputElement?.blur();
|
|
477
|
-
}
|
|
478
|
-
|
|
479
470
|
/**
|
|
480
471
|
* Select the text in the input
|
|
481
472
|
*/
|
|
@@ -49,6 +49,11 @@ export interface SelectProps {
|
|
|
49
49
|
* @fires change - Emitted when selection changes
|
|
50
50
|
*/
|
|
51
51
|
export class Select extends FaceMixin(LitElement) implements SelectProps {
|
|
52
|
+
static shadowRootOptions = {
|
|
53
|
+
...LitElement.shadowRootOptions,
|
|
54
|
+
delegatesFocus: true,
|
|
55
|
+
};
|
|
56
|
+
|
|
52
57
|
@property({ type: String, reflect: true })
|
|
53
58
|
public size: SelectSize = '';
|
|
54
59
|
|
package/src/utils/slot.ts
CHANGED
|
@@ -13,7 +13,7 @@ export function hasSlotContent(slot: HTMLSlotElement | null): boolean {
|
|
|
13
13
|
if (!slot) {
|
|
14
14
|
return false;
|
|
15
15
|
}
|
|
16
|
-
const assignedNodes = slot.assignedNodes(
|
|
16
|
+
const assignedNodes = slot.assignedNodes();
|
|
17
17
|
|
|
18
18
|
// Helper to check if an element has meaningful content
|
|
19
19
|
const hasElementContent = (element: Element): boolean => {
|