@patternfly/pfe-core 3.0.0 → 4.0.1
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/controllers/activedescendant-controller.d.ts +99 -0
- package/controllers/activedescendant-controller.js +230 -0
- package/controllers/activedescendant-controller.js.map +1 -0
- package/controllers/at-focus-controller.d.ts +56 -0
- package/controllers/at-focus-controller.js +168 -0
- package/controllers/at-focus-controller.js.map +1 -0
- package/controllers/cascade-controller.d.ts +7 -2
- package/controllers/cascade-controller.js +6 -1
- package/controllers/cascade-controller.js.map +1 -1
- package/controllers/combobox-controller.d.ts +117 -0
- package/controllers/combobox-controller.js +611 -0
- package/controllers/combobox-controller.js.map +1 -0
- package/controllers/css-variable-controller.js +1 -1
- package/controllers/css-variable-controller.js.map +1 -1
- package/controllers/floating-dom-controller.d.ts +8 -1
- package/controllers/floating-dom-controller.js +12 -5
- package/controllers/floating-dom-controller.js.map +1 -1
- package/controllers/internals-controller.d.ts +26 -9
- package/controllers/internals-controller.js +45 -13
- package/controllers/internals-controller.js.map +1 -1
- package/controllers/light-dom-controller.js +2 -2
- package/controllers/light-dom-controller.js.map +1 -1
- package/controllers/listbox-controller.d.ts +118 -33
- package/controllers/listbox-controller.js +347 -154
- package/controllers/listbox-controller.js.map +1 -1
- package/controllers/logger.d.ts +13 -10
- package/controllers/logger.js +15 -11
- package/controllers/logger.js.map +1 -1
- package/controllers/overflow-controller.js +10 -6
- package/controllers/overflow-controller.js.map +1 -1
- package/controllers/perf-controller.js.map +1 -1
- package/controllers/property-observer-controller.d.ts +13 -16
- package/controllers/property-observer-controller.js +54 -25
- package/controllers/property-observer-controller.js.map +1 -1
- package/controllers/roving-tabindex-controller.d.ts +12 -61
- package/controllers/roving-tabindex-controller.js +57 -203
- package/controllers/roving-tabindex-controller.js.map +1 -1
- package/controllers/scroll-spy-controller.d.ts +4 -1
- package/controllers/scroll-spy-controller.js +9 -6
- package/controllers/scroll-spy-controller.js.map +1 -1
- package/controllers/slot-controller.d.ts +12 -16
- package/controllers/slot-controller.js +17 -20
- package/controllers/slot-controller.js.map +1 -1
- package/controllers/style-controller.js +3 -1
- package/controllers/style-controller.js.map +1 -1
- package/controllers/tabs-aria-controller.d.ts +2 -0
- package/controllers/tabs-aria-controller.js +2 -0
- package/controllers/tabs-aria-controller.js.map +1 -1
- package/controllers/test/combobox-controller.spec.d.ts +1 -0
- package/controllers/test/combobox-controller.spec.js +282 -0
- package/controllers/test/combobox-controller.spec.js.map +1 -0
- package/controllers/timestamp-controller.js +7 -2
- package/controllers/timestamp-controller.js.map +1 -1
- package/core.d.ts +0 -23
- package/core.js +1 -38
- package/core.js.map +1 -1
- package/custom-elements.json +3862 -1369
- package/decorators/bound.d.ts +3 -1
- package/decorators/bound.js +3 -1
- package/decorators/bound.js.map +1 -1
- package/decorators/cascades.d.ts +2 -1
- package/decorators/cascades.js +2 -1
- package/decorators/cascades.js.map +1 -1
- package/decorators/deprecation.d.ts +6 -5
- package/decorators/deprecation.js +6 -5
- package/decorators/deprecation.js.map +1 -1
- package/decorators/initializer.js.map +1 -1
- package/decorators/listen.d.ts +8 -0
- package/decorators/listen.js +22 -0
- package/decorators/listen.js.map +1 -0
- package/decorators/observed.d.ts +12 -16
- package/decorators/observed.js +39 -44
- package/decorators/observed.js.map +1 -1
- package/decorators/observes.d.ts +15 -0
- package/decorators/observes.js +30 -0
- package/decorators/observes.js.map +1 -0
- package/decorators/time.d.ts +1 -0
- package/decorators/time.js +6 -9
- package/decorators/time.js.map +1 -1
- package/decorators/trace.d.ts +4 -1
- package/decorators/trace.js +4 -1
- package/decorators/trace.js.map +1 -1
- package/decorators.d.ts +2 -0
- package/decorators.js +2 -0
- package/decorators.js.map +1 -1
- package/functions/arraysAreEquivalent.d.ts +9 -0
- package/functions/arraysAreEquivalent.js +28 -0
- package/functions/arraysAreEquivalent.js.map +1 -0
- package/functions/containsDeep.d.ts +2 -0
- package/functions/containsDeep.js +2 -0
- package/functions/containsDeep.js.map +1 -1
- package/functions/context.d.ts +3 -4
- package/functions/context.js +6 -2
- package/functions/context.js.map +1 -1
- package/functions/debounce.js.map +1 -1
- package/functions/isElementInView.d.ts +4 -6
- package/functions/isElementInView.js +9 -11
- package/functions/isElementInView.js.map +1 -1
- package/package.json +12 -4
- package/ssr-shims.d.ts +17 -0
- package/ssr-shims.js +55 -0
- package/ssr-shims.js.map +1 -0
package/core.d.ts
CHANGED
|
@@ -1,23 +1,7 @@
|
|
|
1
1
|
import type { ComplexAttributeConverter } from 'lit';
|
|
2
|
-
/** PatternFly Elements global config object */
|
|
3
|
-
export interface PfeConfig {
|
|
4
|
-
/** Set to false to disable client-side page load performance tracking */
|
|
5
|
-
trackPerformance?: boolean;
|
|
6
|
-
/** Set to false to disable various debug logs */
|
|
7
|
-
log?: boolean;
|
|
8
|
-
/** Set to false to disable automatically removing `unresolved` attr from body */
|
|
9
|
-
autoReveal?: boolean;
|
|
10
|
-
}
|
|
11
2
|
export type RequireProps<T, Ps extends keyof T> = T & {
|
|
12
3
|
[P in Ps]-?: T[P];
|
|
13
4
|
};
|
|
14
|
-
declare const noPref: unique symbol;
|
|
15
|
-
/**
|
|
16
|
-
* A boolean value that indicates if the performance should be tracked.
|
|
17
|
-
* For use in a JS file or script tag; can also be added in the constructor of a component during development.
|
|
18
|
-
* @example trackPerformance(true);
|
|
19
|
-
*/
|
|
20
|
-
export declare function trackPerformance(preference?: boolean | typeof noPref): boolean | undefined;
|
|
21
5
|
/**
|
|
22
6
|
* A LitElement property converter which represents a list of numbers as a comma separated string
|
|
23
7
|
* @see https://lit.dev/docs/components/properties/#conversion-converter
|
|
@@ -35,10 +19,3 @@ export declare const StringListConverter: ComplexAttributeConverter<string[] | n
|
|
|
35
19
|
export declare class ComposedEvent extends Event {
|
|
36
20
|
constructor(type: string, init?: EventInit);
|
|
37
21
|
}
|
|
38
|
-
declare global {
|
|
39
|
-
interface Window {
|
|
40
|
-
/** Global configuration settings for PatternFly Elements */
|
|
41
|
-
PfeConfig: PfeConfig;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
export {};
|
package/core.js
CHANGED
|
@@ -1,19 +1,3 @@
|
|
|
1
|
-
const noPref = Symbol();
|
|
2
|
-
/** Retrieve an HTML metadata item */
|
|
3
|
-
function getMeta(name) {
|
|
4
|
-
return document.head.querySelector(`meta[name="${name}"]`)?.content;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* A boolean value that indicates if the performance should be tracked.
|
|
8
|
-
* For use in a JS file or script tag; can also be added in the constructor of a component during development.
|
|
9
|
-
* @example trackPerformance(true);
|
|
10
|
-
*/
|
|
11
|
-
export function trackPerformance(preference = noPref) {
|
|
12
|
-
if (preference !== noPref) {
|
|
13
|
-
window.PfeConfig.trackPerformance = !!preference;
|
|
14
|
-
}
|
|
15
|
-
return window.PfeConfig.trackPerformance;
|
|
16
|
-
}
|
|
17
1
|
function makeConverter(f) {
|
|
18
2
|
return {
|
|
19
3
|
fromAttribute(value) {
|
|
@@ -48,29 +32,8 @@ export class ComposedEvent extends Event {
|
|
|
48
32
|
super(type, {
|
|
49
33
|
bubbles: true,
|
|
50
34
|
composed: true,
|
|
51
|
-
...init
|
|
35
|
+
...init,
|
|
52
36
|
});
|
|
53
37
|
}
|
|
54
38
|
}
|
|
55
|
-
const bodyNoAutoReveal = document.body.hasAttribute('no-auto-reveal');
|
|
56
|
-
/** Global patternfly elements config */
|
|
57
|
-
window.PfeConfig = Object.assign(window.PfeConfig ?? {}, {
|
|
58
|
-
trackPerformance: window.PfeConfig?.trackPerformance ?? getMeta('pf-track-performance') === 'true',
|
|
59
|
-
// if the body tag has `no-auto-reveal` attribute, reveal immediately
|
|
60
|
-
// if `<meta name="pf-auto-reveal">` exists, and it's `content` is 'true',
|
|
61
|
-
// then auto-reveal the body
|
|
62
|
-
autoReveal: window.PfeConfig?.autoReveal ?? (bodyNoAutoReveal ? !bodyNoAutoReveal
|
|
63
|
-
: getMeta('pf-auto-reveal') === 'true'),
|
|
64
|
-
get log() {
|
|
65
|
-
return !!localStorage.pfeLog;
|
|
66
|
-
},
|
|
67
|
-
set log(v) {
|
|
68
|
-
if (v) {
|
|
69
|
-
localStorage.setItem('pfeLog', `${true}`);
|
|
70
|
-
}
|
|
71
|
-
else {
|
|
72
|
-
localStorage.removeItem('pfeLog');
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
|
-
});
|
|
76
39
|
//# sourceMappingURL=core.js.map
|
package/core.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.js","sourceRoot":"","sources":["core.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"core.js","sourceRoot":"","sources":["core.ts"],"names":[],"mappings":"AAMA,SAAS,aAAa,CACpB,CAAmC;IAEnC,OAAO;QACL,aAAa,CAAC,KAAa;YACzB,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;gBAC9B,OAAO,IAAI,CAAC;YACd,CAAC;iBAAM,CAAC;gBACN,OAAO,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YACjC,CAAC;QACH,CAAC;QACD,WAAW,CAAC,KAAU;YACpB,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACzB,CAAC;KACF,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAC9B,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;AAE9C;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAC9B,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;AAE/B;;;GAGG;AACH,MAAM,OAAO,aAAc,SAAQ,KAAK;IACtC,YAAY,IAAY,EAAE,IAAgB;QACxC,KAAK,CAAC,IAAI,EAAE;YACV,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,IAAI;YACd,GAAG,IAAI;SACR,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["import type { ComplexAttributeConverter } from 'lit';\n\nexport type RequireProps<T, Ps extends keyof T> = T & {\n [P in Ps]-?: T[P];\n};\n\nfunction makeConverter<T>(\n f: (x: string, type?: unknown) => T,\n): ComplexAttributeConverter<null | T[]> {\n return {\n fromAttribute(value: string) {\n if (typeof value !== 'string') {\n return null;\n } else {\n return value.split(',').map(f);\n }\n },\n toAttribute(value: T[]) {\n return value.join(',');\n },\n };\n}\n\n/**\n * A LitElement property converter which represents a list of numbers as a comma separated string\n * @see https://lit.dev/docs/components/properties/#conversion-converter\n */\nexport const NumberListConverter: ComplexAttributeConverter<number[] | null, unknown> =\n makeConverter(x => parseInt(x?.trim(), 10));\n\n/**\n * A LitElement property converter which represents a list of strings as a comma separated string\n * @see https://lit.dev/docs/components/properties/#conversion-converter\n */\nexport const StringListConverter: ComplexAttributeConverter<string[] | null, unknown> =\n makeConverter(x => x.trim());\n\n/**\n * A composed, bubbling event for UI interactions\n * e.g. when an accordion panel opens.\n */\nexport class ComposedEvent extends Event {\n constructor(type: string, init?: EventInit) {\n super(type, {\n bubbles: true,\n composed: true,\n ...init,\n });\n }\n}\n\n"]}
|