@patternfly/pfe-core 2.0.0-next.11 → 2.0.0-next.12
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 +3 -3
- package/controllers/internals-controller.d.ts +9 -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 +2 -1
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,10 +1,10 @@
|
|
|
1
1
|
import type { ReactiveController, ReactiveElement } from 'lit';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
type Direction = 'top' | 'bottom' | 'left' | 'right';
|
|
3
|
+
type Alignment = 'start' | 'end';
|
|
4
4
|
/**
|
|
5
5
|
* Represents the placement of floating DOM
|
|
6
6
|
*/
|
|
7
|
-
export
|
|
7
|
+
export type Placement = Direction | `${Direction}-${Alignment}`;
|
|
8
8
|
/**
|
|
9
9
|
* Controls floating DOM within a web component, e.g. tooltips and popovers
|
|
10
10
|
*/
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ReactiveController, ReactiveControllerHost } from 'lit';
|
|
2
|
+
export declare class InternalsController implements ReactiveController {
|
|
3
|
+
#private;
|
|
4
|
+
host: ReactiveControllerHost & HTMLElement;
|
|
5
|
+
constructor(host: ReactiveControllerHost & HTMLElement);
|
|
6
|
+
hostConnected?(): void;
|
|
7
|
+
submit(): void;
|
|
8
|
+
reset(): void;
|
|
9
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var l=(t,e,o)=>{if(!e.has(t))throw TypeError("Cannot "+o)};var s=(t,e,o)=>(l(t,e,"read from private field"),o?o.call(t):e.get(t)),n=(t,e,o)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,o)},c=(t,e,o,i)=>(l(t,e,"write to private field"),i?i.call(t,o):e.set(t,o),o);var r,m=class{constructor(e){this.host=e;n(this,r,void 0);c(this,r,e.attachInternals())}submit(){s(this,r).form?.requestSubmit(this.host)}reset(){s(this,r).form?.reset()}};r=new WeakMap;export{m 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\nexport class InternalsController implements ReactiveController {\n #internals: ElementInternals;\n\n constructor(\n public host: ReactiveControllerHost & HTMLElement,\n ) {\n this.#internals = host.attachInternals();\n }\n\n hostConnected?(): void\n\n submit() {\n this.#internals.form?.requestSubmit(this.host);\n }\n\n reset() {\n this.#internals.form?.reset();\n }\n}\n"],
|
|
5
|
+
"mappings": "mVAAA,IAAAA,EAEaC,EAAN,KAAwD,CAG7D,YACSC,EACP,CADO,UAAAA,EAHTC,EAAA,KAAAH,EAAA,QAKEI,EAAA,KAAKJ,EAAaE,EAAK,gBAAgB,EACzC,CAIA,QAAS,CACPG,EAAA,KAAKL,GAAW,MAAM,cAAc,KAAK,IAAI,CAC/C,CAEA,OAAQ,CACNK,EAAA,KAAKL,GAAW,MAAM,MAAM,CAC9B,CACF,EAjBEA,EAAA",
|
|
6
|
+
"names": ["_internals", "InternalsController", "host", "__privateAdd", "__privateSet", "__privateGet"]
|
|
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.12",
|
|
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",
|