@patternfly/pfe-core 2.0.0-next.11 → 2.0.0-next.13
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/context.d.ts +4 -4
- package/controllers/color-context.d.ts +2 -2
- package/controllers/floating-dom-controller.d.ts +35 -16
- package/controllers/floating-dom-controller.js +1 -1
- package/controllers/floating-dom-controller.js.map +3 -3
- package/controllers/internals-controller.d.ts +52 -0
- package/controllers/internals-controller.js +2 -0
- package/controllers/internals-controller.js.map +7 -0
- package/controllers/property-observer-controller.d.ts +3 -3
- package/controllers/slot-controller.d.ts +1 -1
- package/decorators/deprecation.d.ts +1 -1
- package/decorators/observed.d.ts +1 -1
- package/package.json +3 -2
package/context.d.ts
CHANGED
|
@@ -5,18 +5,18 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* A Context object defines an optional initial value for a Context, as well as a name identifier for debugging purposes.
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
8
|
+
export type Context<T> = {
|
|
9
9
|
name: string;
|
|
10
10
|
initialValue?: T;
|
|
11
11
|
};
|
|
12
12
|
/**
|
|
13
13
|
* An unknown context typeU
|
|
14
14
|
*/
|
|
15
|
-
export
|
|
15
|
+
export type UnknownContext = Context<unknown>;
|
|
16
16
|
/**
|
|
17
17
|
* A helper type which can extract a Context value type from a Context type
|
|
18
18
|
*/
|
|
19
|
-
export
|
|
19
|
+
export type ContextType<T extends UnknownContext> = T extends Context<infer Y> ? Y : never;
|
|
20
20
|
/**
|
|
21
21
|
* A function which creates a Context value object
|
|
22
22
|
*/
|
|
@@ -25,7 +25,7 @@ export declare function createContext<T>(name: string, initialValue?: T): Readon
|
|
|
25
25
|
* A callback which is provided by a context requester and is called with the value satisfying the request.
|
|
26
26
|
* This callback can be called multiple times by context providers as the requested value is changed.
|
|
27
27
|
*/
|
|
28
|
-
export
|
|
28
|
+
export type ContextCallback<ValueType> = (value: ValueType, dispose?: () => void) => void;
|
|
29
29
|
/**
|
|
30
30
|
* An event fired by a context requester to signal it desires a named context.
|
|
31
31
|
*
|
|
@@ -10,13 +10,13 @@ import { StyleController } from './style-controller.js';
|
|
|
10
10
|
*
|
|
11
11
|
* `ColorPalette` is associated with the `color-palette` attribute
|
|
12
12
|
*/
|
|
13
|
-
export
|
|
13
|
+
export type ColorPalette = ('base' | 'accent' | 'complement' | 'lighter' | 'lightest' | 'darker' | 'darkest');
|
|
14
14
|
/**
|
|
15
15
|
* A Color theme is a context-specific restriction on the available color palettes
|
|
16
16
|
*
|
|
17
17
|
* `ColorTheme` is associated with the `on` attribute and the `--context` css property
|
|
18
18
|
*/
|
|
19
|
-
export
|
|
19
|
+
export type ColorTheme = ('dark' | 'light' | 'saturated');
|
|
20
20
|
export interface ColorContextOptions {
|
|
21
21
|
prefix?: string;
|
|
22
22
|
attribute?: string;
|
|
@@ -1,30 +1,49 @@
|
|
|
1
|
+
import type { Placement } from '@floating-ui/dom';
|
|
1
2
|
import type { ReactiveController, ReactiveElement } from 'lit';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
import type { StyleInfo } from 'lit/directives/style-map.js';
|
|
4
|
+
import type { Options as Offset } from '@floating-ui/core/src/middleware/offset';
|
|
5
|
+
export { Placement };
|
|
6
|
+
type Lazy<T> = T | (() => T | null | undefined);
|
|
7
|
+
interface FloatingDOMControllerOptions {
|
|
8
|
+
content: Lazy<HTMLElement>;
|
|
9
|
+
invoker?: Lazy<HTMLElement>;
|
|
10
|
+
arrow?: boolean;
|
|
11
|
+
flip?: boolean;
|
|
12
|
+
shift?: boolean;
|
|
13
|
+
padding?: number;
|
|
14
|
+
}
|
|
15
|
+
interface ShowOptions {
|
|
16
|
+
offset?: Offset;
|
|
17
|
+
placement?: Placement;
|
|
18
|
+
}
|
|
19
|
+
export type Anchor = '' | 'top' | 'left' | 'bottom' | 'right';
|
|
20
|
+
export type Alignment = 'center' | 'start' | 'end';
|
|
8
21
|
/**
|
|
9
22
|
* Controls floating DOM within a web component, e.g. tooltips and popovers
|
|
10
23
|
*/
|
|
11
24
|
export declare class FloatingDOMController implements ReactiveController {
|
|
12
25
|
#private;
|
|
13
26
|
private host;
|
|
14
|
-
|
|
15
|
-
|
|
27
|
+
/** The crosswise alignment of the invoker on which to display the floating DOM */
|
|
28
|
+
get alignment(): Alignment;
|
|
29
|
+
/** The side of the invoker on which to display the floating DOM */
|
|
30
|
+
get anchor(): Anchor;
|
|
16
31
|
/**
|
|
17
32
|
* When true, the floating DOM is visible
|
|
18
33
|
*/
|
|
19
34
|
get open(): boolean;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
35
|
+
/** The computed placement of the floating DOM */
|
|
36
|
+
get placement(): Placement;
|
|
37
|
+
/**
|
|
38
|
+
* Styles to apply to your element's container
|
|
39
|
+
*
|
|
40
|
+
* - `--_floating-content-translate`: translate to apply to floating content.
|
|
41
|
+
*/
|
|
42
|
+
get styles(): StyleInfo;
|
|
43
|
+
constructor(host: ReactiveElement, options: FloatingDOMControllerOptions);
|
|
44
|
+
hostDisconnected(): void;
|
|
23
45
|
/** Show the floating DOM */
|
|
24
|
-
show(): void
|
|
46
|
+
show({ offset, placement }?: ShowOptions): Promise<void>;
|
|
25
47
|
/** Hide the floating DOM */
|
|
26
|
-
hide(): void
|
|
27
|
-
/** Initialize the floating DOM */
|
|
28
|
-
create(invoker: Element, content: HTMLElement, placement: Placement, offset?: number[]): void;
|
|
48
|
+
hide(): Promise<void>;
|
|
29
49
|
}
|
|
30
|
-
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var
|
|
1
|
+
var C=(n,t,i)=>{if(!t.has(n))throw TypeError("Cannot "+i)};var e=(n,t,i)=>(C(n,t,"read from private field"),i?i.call(n):t.get(n)),s=(n,t,i)=>{if(t.has(n))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(n):t.set(n,i)},l=(n,t,i,o)=>(C(n,t,"write to private field"),o?o.call(n,i):t.set(n,i),i),M=(n,t,i,o)=>({set _(a){l(n,t,a,i)},get _(){return e(n,t,o)}}),P=(n,t,i)=>(C(n,t,"access private method"),i);import{autoUpdate as T,computePosition as D,offset as E,shift as F,flip as U}from"@floating-ui/dom";var c,p,f,d,g,y,m,r,w,x,v,A,O,b,q=class{constructor(t,i){this.host=t;s(this,w);s(this,v);s(this,O);s(this,c,!1);s(this,p,!1);s(this,f,void 0);s(this,d,void 0);s(this,g,void 0);s(this,y,void 0);s(this,m,void 0);s(this,r,void 0);var o,a,h,u;t.addController(this),l(this,r,i),(o=e(this,r)).invoker??(o.invoker=t),(a=e(this,r)).arrow??(a.arrow=!1),(h=e(this,r)).flip??(h.flip=!0),(u=e(this,r)).shift??(u.shift=!0)}get alignment(){return e(this,g)??"center"}get anchor(){return e(this,d)??""}get open(){return e(this,c)}get placement(){return e(this,m)??"top"}get styles(){return e(this,y)??{}}hostDisconnected(){var t;(t=e(this,f))==null||t.call(this)}async show({offset:t,placement:i}={}){let o=e(this,w,x),a=e(this,v,A);if(!(!o||!a)){if(!e(this,p)){l(this,p,!0);let h=P(this,O,b).call(this,i,t);e(this,f)??l(this,f,T(o,a,()=>P(this,O,b).call(this,i,t))),await h,l(this,p,!1)}l(this,c,!0),this.host.requestUpdate()}}async hide(){var t;for(await this.host.updateComplete;e(this,p)&&!this.open;)await new Promise(requestAnimationFrame);l(this,c,!1),(t=e(this,f))==null||t.call(this),this.host.requestUpdate(),await this.host.updateComplete}};c=new WeakMap,p=new WeakMap,f=new WeakMap,d=new WeakMap,g=new WeakMap,y=new WeakMap,m=new WeakMap,r=new WeakMap,w=new WeakSet,x=function(){let{invoker:t}=e(this,r);return typeof t=="function"?t():t},v=new WeakSet,A=function(){let{content:t}=e(this,r);return typeof t=="function"?t():t},O=new WeakSet,b=async function(t="top",i){let{flip:o,padding:a,shift:h}=e(this,r),u=e(this,w,x),k=e(this,v,A);if(!u||!k)return;let{x:R,y:L,placement:S}=await D(u,k,{strategy:"absolute",placement:t,middleware:[E(i),h&&F({padding:a}),o&&U({padding:a})].filter(Boolean)});l(this,m,S),[M(this,d)._,M(this,g)._]=e(this,m).split("-")??[],l(this,y,{"--_floating-content-translate":`${R}px ${L}px`}),this.host.requestUpdate()};export{q as FloatingDOMController};
|
|
2
2
|
//# sourceMappingURL=floating-dom-controller.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["floating-dom-controller.ts"],
|
|
4
|
-
"sourcesContent": ["import type {
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["
|
|
4
|
+
"sourcesContent": ["import type { Placement } from '@floating-ui/dom';\nimport type { ReactiveController, ReactiveElement } from 'lit';\nimport type { StyleInfo } from 'lit/directives/style-map.js';\nimport type { Options as Offset } from '@floating-ui/core/src/middleware/offset';\n\n\nexport { Placement };\n\nimport {\n autoUpdate,\n computePosition,\n offset as offsetMiddleware,\n shift as shiftMiddleware,\n flip as flipMiddleware,\n} from '@floating-ui/dom';\n\ntype Lazy<T> = T|(() => T|null|undefined);\n\ninterface FloatingDOMControllerOptions {\n content: Lazy<HTMLElement>;\n invoker?: Lazy<HTMLElement>;\n arrow?: boolean;\n flip?: boolean;\n shift?: boolean;\n padding?: number;\n}\n\ninterface ShowOptions {\n offset?: Offset;\n placement?: Placement;\n}\n\nexport type Anchor = ''|'top'|'left'|'bottom'|'right';\nexport type Alignment = 'center'|'start'|'end';\n\n/**\n * Controls floating DOM within a web component, e.g. tooltips and popovers\n */\nexport class FloatingDOMController implements ReactiveController {\n #open = false;\n #opening = false;\n #cleanup?: () => void;\n #anchor?: Anchor;\n #alignment?: Alignment;\n #styles?: StyleInfo;\n #placement?: Placement;\n #options: Required<FloatingDOMControllerOptions>;\n\n get #invoker() {\n const { invoker } = this.#options;\n return typeof invoker === 'function' ? invoker() : invoker;\n }\n\n get #content() {\n const { content } = this.#options;\n return typeof content === 'function' ? content() : content;\n }\n\n /** The crosswise alignment of the invoker on which to display the floating DOM */\n get alignment() {\n return this.#alignment ?? 'center';\n }\n\n /** The side of the invoker on which to display the floating DOM */\n get anchor() {\n return this.#anchor ?? '';\n }\n\n /**\n * When true, the floating DOM is visible\n */\n get open() {\n return this.#open;\n }\n\n /** The computed placement of the floating DOM */\n get placement(): Placement {\n return this.#placement ?? 'top';\n }\n\n /**\n * Styles to apply to your element's container\n *\n * - `--_floating-content-translate`: translate to apply to floating content.\n */\n get styles(): StyleInfo {\n return this.#styles ?? {};\n }\n\n constructor(\n private host: ReactiveElement,\n options: FloatingDOMControllerOptions\n ) {\n host.addController(this);\n this.#options = options as Required<FloatingDOMControllerOptions>;\n this.#options.invoker ??= host;\n this.#options.arrow ??= false;\n this.#options.flip ??= true;\n this.#options.shift ??= true;\n }\n\n hostDisconnected() {\n this.#cleanup?.();\n }\n\n async #update(placement: Placement = 'top', offset?: Offset) {\n const { flip, padding, shift } = this.#options;\n\n const invoker = this.#invoker;\n const content = this.#content;\n if (!invoker || !content) {\n return;\n }\n const { x, y, placement: _placement } = await computePosition(invoker, content, {\n strategy: 'absolute',\n placement,\n middleware: [\n offsetMiddleware(offset),\n shift && shiftMiddleware({ padding }),\n flip && flipMiddleware({ padding }),\n ].filter(Boolean)\n });\n\n this.#placement = _placement;\n [this.#anchor, this.#alignment] = (this.#placement.split('-') ?? []) as [Anchor, Alignment];\n this.#styles = {\n '--_floating-content-translate': `${x}px ${y}px`,\n };\n this.host.requestUpdate();\n }\n\n /** Show the floating DOM */\n async show({ offset, placement }: ShowOptions = {}) {\n const invoker = this.#invoker;\n const content = this.#content;\n if (!invoker || !content) {\n return;\n }\n if (!this.#opening) {\n this.#opening = true;\n const p = this.#update(placement, offset);\n this.#cleanup ??= autoUpdate(invoker, content, () =>\n this.#update(placement, offset));\n await p;\n this.#opening = false;\n }\n this.#open = true;\n this.host.requestUpdate();\n }\n\n /** Hide the floating DOM */\n async hide() {\n await this.host.updateComplete;\n while (this.#opening && !this.open) {\n await new Promise(requestAnimationFrame);\n }\n this.#open = false;\n this.#cleanup?.();\n this.host.requestUpdate();\n await this.host.updateComplete;\n }\n}\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["autoUpdate", "computePosition", "offsetMiddleware", "shiftMiddleware", "flipMiddleware", "_open", "_opening", "_cleanup", "_anchor", "_alignment", "_styles", "_placement", "_options", "_invoker", "invoker_get", "_content", "content_get", "_update", "update_fn", "FloatingDOMController", "host", "options", "__privateAdd", "_a", "_b", "_c", "_d", "__privateSet", "__privateGet", "offset", "placement", "invoker", "content", "p", "__privateMethod", "autoUpdate", "flip", "padding", "shift", "x", "y", "computePosition", "offsetMiddleware", "shiftMiddleware", "flipMiddleware", "__privateWrapper"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { ReactiveController, ReactiveControllerHost } from 'lit';
|
|
2
|
+
export declare class InternalsController implements ReactiveController, ARIAMixin {
|
|
3
|
+
#private;
|
|
4
|
+
host: ReactiveControllerHost & HTMLElement;
|
|
5
|
+
role: ARIAMixin['role'];
|
|
6
|
+
ariaAtomic: ARIAMixin['ariaAtomic'];
|
|
7
|
+
ariaAutoComplete: ARIAMixin['ariaAutoComplete'];
|
|
8
|
+
ariaBusy: ARIAMixin['ariaBusy'];
|
|
9
|
+
ariaChecked: ARIAMixin['ariaChecked'];
|
|
10
|
+
ariaColCount: ARIAMixin['ariaColCount'];
|
|
11
|
+
ariaColIndex: ARIAMixin['ariaColIndex'];
|
|
12
|
+
ariaColIndexText: ARIAMixin['ariaColIndexText'];
|
|
13
|
+
ariaColSpan: ARIAMixin['ariaColSpan'];
|
|
14
|
+
ariaCurrent: ARIAMixin['ariaCurrent'];
|
|
15
|
+
ariaDisabled: ARIAMixin['ariaDisabled'];
|
|
16
|
+
ariaExpanded: ARIAMixin['ariaExpanded'];
|
|
17
|
+
ariaHasPopup: ARIAMixin['ariaHasPopup'];
|
|
18
|
+
ariaHidden: ARIAMixin['ariaHidden'];
|
|
19
|
+
ariaInvalid: ARIAMixin['ariaInvalid'];
|
|
20
|
+
ariaKeyShortcuts: ARIAMixin['ariaKeyShortcuts'];
|
|
21
|
+
ariaLabel: ARIAMixin['ariaLabel'];
|
|
22
|
+
ariaLevel: ARIAMixin['ariaLevel'];
|
|
23
|
+
ariaLive: ARIAMixin['ariaLive'];
|
|
24
|
+
ariaModal: ARIAMixin['ariaModal'];
|
|
25
|
+
ariaMultiLine: ARIAMixin['ariaMultiLine'];
|
|
26
|
+
ariaMultiSelectable: ARIAMixin['ariaMultiSelectable'];
|
|
27
|
+
ariaOrientation: ARIAMixin['ariaOrientation'];
|
|
28
|
+
ariaPlaceholder: ARIAMixin['ariaPlaceholder'];
|
|
29
|
+
ariaPosInSet: ARIAMixin['ariaPosInSet'];
|
|
30
|
+
ariaPressed: ARIAMixin['ariaPressed'];
|
|
31
|
+
ariaReadOnly: ARIAMixin['ariaReadOnly'];
|
|
32
|
+
ariaRequired: ARIAMixin['ariaRequired'];
|
|
33
|
+
ariaRoleDescription: ARIAMixin['ariaRoleDescription'];
|
|
34
|
+
ariaRowCount: ARIAMixin['ariaRowCount'];
|
|
35
|
+
ariaRowIndex: ARIAMixin['ariaRowIndex'];
|
|
36
|
+
ariaRowIndexText: ARIAMixin['ariaRowIndexText'];
|
|
37
|
+
ariaRowSpan: ARIAMixin['ariaRowSpan'];
|
|
38
|
+
ariaSelected: ARIAMixin['ariaSelected'];
|
|
39
|
+
ariaSetSize: ARIAMixin['ariaSetSize'];
|
|
40
|
+
ariaSort: ARIAMixin['ariaSort'];
|
|
41
|
+
ariaValueMax: ARIAMixin['ariaValueMax'];
|
|
42
|
+
ariaValueMin: ARIAMixin['ariaValueMin'];
|
|
43
|
+
ariaValueNow: ARIAMixin['ariaValueNow'];
|
|
44
|
+
ariaValueText: ARIAMixin['ariaValueText'];
|
|
45
|
+
/** True when the control is disabled via it's containing fieldset element */
|
|
46
|
+
get formDisabled(): boolean;
|
|
47
|
+
static protos: WeakMap<object, any>;
|
|
48
|
+
constructor(host: ReactiveControllerHost & HTMLElement, options?: Partial<ARIAMixin>);
|
|
49
|
+
hostConnected?(): void;
|
|
50
|
+
submit(): void;
|
|
51
|
+
reset(): void;
|
|
52
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var o=(a,i,e)=>{if(!i.has(a))throw TypeError("Cannot "+e)};var l=(a,i,e)=>(o(a,i,"read from private field"),e?e.call(a):i.get(a)),d=(a,i,e)=>{if(i.has(a))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(a):i.set(a,e)},c=(a,i,e,r)=>(o(a,i,"write to private field"),r?r.call(a,e):i.set(a,e),e);function x(a){return a==="role"||a.startsWith("aria")}var t,A=class{constructor(i,e){this.host=i;d(this,t,void 0);c(this,t,i.attachInternals());for(let r of Object.keys(Object.getPrototypeOf(l(this,t))))x(r)&&Object.defineProperty(this,r,{get(){return l(this,t)[r]},set(n){l(this,t)[r]=n,this.host.requestUpdate()}});for(let[r,n]of Object.entries(e??{}))x(r)&&(this[r]=n)}get formDisabled(){return this.host.matches(":disabled")}submit(){l(this,t).form?.requestSubmit()}reset(){l(this,t).form?.reset()}};t=new WeakMap,A.protos=new WeakMap;export{A as InternalsController};
|
|
2
|
+
//# sourceMappingURL=internals-controller.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["internals-controller.ts"],
|
|
4
|
+
"sourcesContent": ["import type { ReactiveController, ReactiveControllerHost } from 'lit';\n\nfunction isARIAMixinProp(key: string): key is keyof ARIAMixin {\n return key === 'role' || key.startsWith('aria');\n}\n\nexport class InternalsController implements ReactiveController, ARIAMixin {\n declare role: ARIAMixin['role'];\n declare ariaAtomic: ARIAMixin['ariaAtomic'];\n declare ariaAutoComplete: ARIAMixin['ariaAutoComplete'];\n declare ariaBusy: ARIAMixin['ariaBusy'];\n declare ariaChecked: ARIAMixin['ariaChecked'];\n declare ariaColCount: ARIAMixin['ariaColCount'];\n declare ariaColIndex: ARIAMixin['ariaColIndex'];\n declare ariaColIndexText: ARIAMixin['ariaColIndexText'];\n declare ariaColSpan: ARIAMixin['ariaColSpan'];\n declare ariaCurrent: ARIAMixin['ariaCurrent'];\n declare ariaDisabled: ARIAMixin['ariaDisabled'];\n declare ariaExpanded: ARIAMixin['ariaExpanded'];\n declare ariaHasPopup: ARIAMixin['ariaHasPopup'];\n declare ariaHidden: ARIAMixin['ariaHidden'];\n declare ariaInvalid: ARIAMixin['ariaInvalid'];\n declare ariaKeyShortcuts: ARIAMixin['ariaKeyShortcuts'];\n declare ariaLabel: ARIAMixin['ariaLabel'];\n declare ariaLevel: ARIAMixin['ariaLevel'];\n declare ariaLive: ARIAMixin['ariaLive'];\n declare ariaModal: ARIAMixin['ariaModal'];\n declare ariaMultiLine: ARIAMixin['ariaMultiLine'];\n declare ariaMultiSelectable: ARIAMixin['ariaMultiSelectable'];\n declare ariaOrientation: ARIAMixin['ariaOrientation'];\n declare ariaPlaceholder: ARIAMixin['ariaPlaceholder'];\n declare ariaPosInSet: ARIAMixin['ariaPosInSet'];\n declare ariaPressed: ARIAMixin['ariaPressed'];\n declare ariaReadOnly: ARIAMixin['ariaReadOnly'];\n declare ariaRequired: ARIAMixin['ariaRequired'];\n declare ariaRoleDescription: ARIAMixin['ariaRoleDescription'];\n declare ariaRowCount: ARIAMixin['ariaRowCount'];\n declare ariaRowIndex: ARIAMixin['ariaRowIndex'];\n declare ariaRowIndexText: ARIAMixin['ariaRowIndexText'];\n declare ariaRowSpan: ARIAMixin['ariaRowSpan'];\n declare ariaSelected: ARIAMixin['ariaSelected'];\n declare ariaSetSize: ARIAMixin['ariaSetSize'];\n declare ariaSort: ARIAMixin['ariaSort'];\n declare ariaValueMax: ARIAMixin['ariaValueMax'];\n declare ariaValueMin: ARIAMixin['ariaValueMin'];\n declare ariaValueNow: ARIAMixin['ariaValueNow'];\n declare ariaValueText: ARIAMixin['ariaValueText'];\n\n #internals: ElementInternals;\n\n /** True when the control is disabled via it's containing fieldset element */\n get formDisabled() {\n return this.host.matches(':disabled');\n }\n\n static protos = new WeakMap();\n\n constructor(\n public host: ReactiveControllerHost & HTMLElement,\n options?: Partial<ARIAMixin>\n ) {\n this.#internals = host.attachInternals();\n // proxy the internals object's aria prototype\n for (const key of Object.keys(Object.getPrototypeOf(this.#internals))) {\n if (isARIAMixinProp(key)) {\n Object.defineProperty(this, key, {\n get() {\n return this.#internals[key];\n },\n set(value) {\n this.#internals[key] = value;\n this.host.requestUpdate();\n }\n });\n }\n }\n\n for (const [key, val] of Object.entries(options ?? {})) {\n if (isARIAMixinProp(key)) {\n this[key] = val;\n }\n }\n }\n\n hostConnected?(): void\n\n submit() {\n this.#internals.form?.requestSubmit();\n }\n\n reset() {\n this.#internals.form?.reset();\n }\n}\n"],
|
|
5
|
+
"mappings": "mVAEA,SAASA,EAAgBC,EAAqC,CAC5D,OAAOA,IAAQ,QAAUA,EAAI,WAAW,MAAM,CAChD,CAJA,IAAAC,EAMaC,EAAN,KAAmE,CAmDxE,YACSC,EACPC,EACA,CAFO,UAAAD,EAVTE,EAAA,KAAAJ,EAAA,QAaEK,EAAA,KAAKL,EAAaE,EAAK,gBAAgB,GAEvC,QAAWH,KAAO,OAAO,KAAK,OAAO,eAAeO,EAAA,KAAKN,EAAU,CAAC,EAC9DF,EAAgBC,CAAG,GACrB,OAAO,eAAe,KAAMA,EAAK,CAC/B,KAAM,CACJ,OAAOO,EAAA,KAAKN,GAAWD,EACzB,EACA,IAAIQ,EAAO,CACTD,EAAA,KAAKN,GAAWD,GAAOQ,EACvB,KAAK,KAAK,cAAc,CAC1B,CACF,CAAC,EAIL,OAAW,CAACR,EAAKS,CAAG,IAAK,OAAO,QAAQL,GAAW,CAAC,CAAC,EAC/CL,EAAgBC,CAAG,IACrB,KAAKA,GAAOS,EAGlB,CA/BA,IAAI,cAAe,CACjB,OAAO,KAAK,KAAK,QAAQ,WAAW,CACtC,CAiCA,QAAS,CACPF,EAAA,KAAKN,GAAW,MAAM,cAAc,CACtC,CAEA,OAAQ,CACNM,EAAA,KAAKN,GAAW,MAAM,MAAM,CAC9B,CACF,EA7CEA,EAAA,YA1CWC,EAiDJ,OAAS,IAAI",
|
|
6
|
+
"names": ["isARIAMixinProp", "key", "_internals", "InternalsController", "host", "options", "__privateAdd", "__privateSet", "__privateGet", "value", "val"]
|
|
7
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { ReactiveController, ReactiveElement } from 'lit';
|
|
2
2
|
export declare const observedController: unique symbol;
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
3
|
+
export type ChangeCallback<T = ReactiveElement> = (this: T, old?: T[keyof T], newV?: T[keyof T]) => void;
|
|
4
|
+
export type ChangeCallbackName = `_${string}Changed`;
|
|
5
|
+
export type PropertyObserverHost<T> = T & Record<ChangeCallbackName, ChangeCallback<T>> & {
|
|
6
6
|
[observedController]: PropertyObserverController;
|
|
7
7
|
};
|
|
8
8
|
/** This controller holds a cache of observed property values which were set before the element updated */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReactiveElement, PropertyDeclaration } from 'lit';
|
|
2
|
-
export
|
|
2
|
+
export type DeprecationDeclaration<K extends PropertyKey> = PropertyDeclaration & {
|
|
3
3
|
alias: string & K;
|
|
4
4
|
attribute: string;
|
|
5
5
|
};
|
package/decorators/observed.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReactiveElement } from 'lit';
|
|
2
2
|
import type { ChangeCallback } from '../controllers/property-observer-controller.js';
|
|
3
|
-
|
|
3
|
+
type TypedFieldDecorator<T> = (proto: T, key: string | keyof T) => void;
|
|
4
4
|
/**
|
|
5
5
|
* Calls a _fooChanged method on the instance when the value changes.
|
|
6
6
|
* Works on any class field. When using on lit observed properties,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/pfe-core",
|
|
3
|
-
"version": "2.0.0-next.
|
|
3
|
+
"version": "2.0.0-next.13",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "PatternFly Elements Core Library",
|
|
6
6
|
"customElements": "custom-elements.json",
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"./controllers/css-variable-controller.js": "./controllers/css-variable-controller.js",
|
|
19
19
|
"./controllers/light-dom-controller.js": "./controllers/light-dom-controller.js",
|
|
20
20
|
"./controllers/logger.js": "./controllers/logger.js",
|
|
21
|
+
"./controllers/internals-controller.js": "./controllers/internals-controller.js",
|
|
21
22
|
"./controllers/perf-controller.js": "./controllers/perf-controller.js",
|
|
22
23
|
"./controllers/property-observer-controller.js": "./controllers/property-observer-controller.js",
|
|
23
24
|
"./controllers/slot-controller.js": "./controllers/slot-controller.js",
|
|
@@ -61,7 +62,7 @@
|
|
|
61
62
|
"watch:types": "tsc -w"
|
|
62
63
|
},
|
|
63
64
|
"dependencies": {
|
|
64
|
-
"@
|
|
65
|
+
"@floating-ui/dom": "^1.0.5",
|
|
65
66
|
"lit": "2.3.0"
|
|
66
67
|
},
|
|
67
68
|
"repository": {
|