@patternfly/pfe-core 3.0.0 → 4.0.0
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 +3844 -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 +7 -4
package/functions/context.js
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import { ContextRoot, createContext } from '@lit/context';
|
|
2
|
+
import { isServer } from 'lit';
|
|
2
3
|
let root;
|
|
3
4
|
function makeContextRoot() {
|
|
4
|
-
root = new ContextRoot();
|
|
5
|
-
|
|
5
|
+
const root = new ContextRoot();
|
|
6
|
+
if (!isServer) {
|
|
7
|
+
root.attach(document.body);
|
|
8
|
+
}
|
|
6
9
|
return root;
|
|
7
10
|
}
|
|
8
11
|
/**
|
|
9
12
|
* In order to prevent late-upgrading-context-consumers from 'missing'
|
|
10
13
|
* their rightful context providers, we must set up a `ContextRoot` on the body.
|
|
11
14
|
* Always use this function when creating contexts that are shared with child elements.
|
|
15
|
+
* @param args createContext args
|
|
12
16
|
*/
|
|
13
17
|
export function createContextWithRoot(...args) {
|
|
14
18
|
root ?? (root = makeContextRoot());
|
package/functions/context.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,aAAa,EAAgB,MAAM,cAAc,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAE/B,IAAI,IAAiB,CAAC;AAEtB,SAAS,eAAe;IACtB,MAAM,IAAI,GAAG,IAAI,WAAW,EAAE,CAAC;IAC/B,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CACnC,GAAG,IAAsC;IAEzC,IAAI,KAAJ,IAAI,GAAK,eAAe,EAAE,EAAC;IAC3B,OAAO,aAAa,CAAI,GAAG,IAAI,CAAC,CAAC;AACnC,CAAC","sourcesContent":["import { ContextRoot, createContext, type Context } from '@lit/context';\nimport { isServer } from 'lit';\n\nlet root: ContextRoot;\n\nfunction makeContextRoot() {\n const root = new ContextRoot();\n if (!isServer) {\n root.attach(document.body);\n }\n return root;\n}\n\n/**\n * In order to prevent late-upgrading-context-consumers from 'missing'\n * their rightful context providers, we must set up a `ContextRoot` on the body.\n * Always use this function when creating contexts that are shared with child elements.\n * @param args createContext args\n */\nexport function createContextWithRoot<T>(\n ...args: Parameters<typeof createContext>\n): Context<unknown, T> {\n root ??= makeContextRoot();\n return createContext<T>(...args);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debounce.js","sourceRoot":"","sources":["debounce.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,UAAU,QAAQ,CACtB,IAAiC,EACjC,KAAa,EACb,SAAS,GAAG,KAAK;IAEjB,IAAI,OAAsB,CAAC;IAC3B,OAAO,UAAwB,GAAG,IAAW;QAC3C,4DAA4D;QAC5D,MAAM,OAAO,GAAG,IAAI,CAAC;QACrB,MAAM,KAAK,GAAG;YACZ,OAAO,GAAG,IAAI,CAAC;YACf,IAAI,CAAC,SAAS,EAAE,CAAC;gBACf,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;YAC5B,CAAC;QACH,CAAC,CAAC;QACF,MAAM,OAAO,GAAG,SAAS,IAAI,CAAC,OAAO,CAAC;QACtC,YAAY,CAAC,OAAiB,CAAC,CAAC;QAChC,OAAO,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QAC1C,IAAI,OAAO,EAAE,CAAC;YACZ,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Debounce helper function\n * @see https://davidwalsh.name/javascript-debounce-function\n *\n * @param func Function to be debounced\n * @param delay How long until it will be run\n * @param immediate Whether it should be run at the start instead of the end of the debounce\n */\nexport function debounce(\n func: (...args: any[]) => unknown,\n delay: number,\n immediate = false\n) {\n let timeout: number | null;\n return function(this: unknown, ...args: any[]) {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const context = this;\n const later = function() {\n timeout = null;\n if (!immediate) {\n func.apply(context, args);\n }\n };\n const callNow = immediate && !timeout;\n clearTimeout(timeout as number);\n timeout = window.setTimeout(later, delay);\n if (callNow) {\n func.apply(context, args);\n }\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"debounce.js","sourceRoot":"","sources":["debounce.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,UAAU,QAAQ,CACtB,IAAiC,EACjC,KAAa,EACb,SAAS,GAAG,KAAK;IAEjB,IAAI,OAAsB,CAAC;IAC3B,OAAO,UAAwB,GAAG,IAAW;QAC3C,4DAA4D;QAC5D,MAAM,OAAO,GAAG,IAAI,CAAC;QACrB,MAAM,KAAK,GAAG;YACZ,OAAO,GAAG,IAAI,CAAC;YACf,IAAI,CAAC,SAAS,EAAE,CAAC;gBACf,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;YAC5B,CAAC;QACH,CAAC,CAAC;QACF,MAAM,OAAO,GAAG,SAAS,IAAI,CAAC,OAAO,CAAC;QACtC,YAAY,CAAC,OAAiB,CAAC,CAAC;QAChC,OAAO,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QAC1C,IAAI,OAAO,EAAE,CAAC;YACZ,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Debounce helper function\n * @see https://davidwalsh.name/javascript-debounce-function\n *\n * @param func Function to be debounced\n * @param delay How long until it will be run\n * @param immediate Whether it should be run at the start instead of the end of the debounce\n */\nexport function debounce(\n func: (...args: any[]) => unknown,\n delay: number,\n immediate = false\n) {\n let timeout: number | null;\n return function(this: unknown, ...args: any[]): void {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const context = this;\n const later = function() {\n timeout = null;\n if (!immediate) {\n func.apply(context, args);\n }\n };\n const callNow = immediate && !timeout;\n clearTimeout(timeout as number);\n timeout = window.setTimeout(later, delay);\n if (callNow) {\n func.apply(context, args);\n }\n };\n}\n"]}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This function returns whether or not an element is within the viewable area of a container. If partial is true,
|
|
3
3
|
* then this function will return true even if only part of the element is in view.
|
|
4
|
-
*
|
|
5
|
-
* @param
|
|
6
|
-
* @param
|
|
7
|
-
* @param
|
|
8
|
-
* @param {boolean} strict true if strict mode is set, never consider the container width and element width
|
|
9
|
-
*
|
|
4
|
+
* @param container The container to check if the element is in view of.
|
|
5
|
+
* @param element The element to check if it is view
|
|
6
|
+
* @param partial true if partial view is allowed
|
|
7
|
+
* @param strict true if strict mode is set, never consider the container width and element width
|
|
10
8
|
* @returns True if the component is in View.
|
|
11
9
|
*/
|
|
12
10
|
export declare function isElementInView(container: HTMLElement, element: HTMLElement, partial?: boolean, strict?: boolean): boolean;
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This function returns whether or not an element is within the viewable area of a container. If partial is true,
|
|
3
3
|
* then this function will return true even if only part of the element is in view.
|
|
4
|
-
*
|
|
5
|
-
* @param
|
|
6
|
-
* @param
|
|
7
|
-
* @param
|
|
8
|
-
* @param {boolean} strict true if strict mode is set, never consider the container width and element width
|
|
9
|
-
*
|
|
4
|
+
* @param container The container to check if the element is in view of.
|
|
5
|
+
* @param element The element to check if it is view
|
|
6
|
+
* @param partial true if partial view is allowed
|
|
7
|
+
* @param strict true if strict mode is set, never consider the container width and element width
|
|
10
8
|
* @returns True if the component is in View.
|
|
11
9
|
*/
|
|
12
10
|
export function isElementInView(container, element, partial = false, strict = false) {
|
|
@@ -20,11 +18,11 @@ export function isElementInView(container, element, partial = false, strict = fa
|
|
|
20
18
|
const elementBoundsLeft = Math.ceil(elementBounds.left);
|
|
21
19
|
const elementBoundsRight = Math.floor(elementBounds.right);
|
|
22
20
|
// Check if in view
|
|
23
|
-
const isTotallyInView = elementBoundsLeft >= containerBoundsLeft
|
|
24
|
-
elementBoundsRight <= containerBoundsRight;
|
|
25
|
-
const isPartiallyInView = (partial || (!strict && containerBounds.width < elementBounds.width))
|
|
26
|
-
((elementBoundsLeft < containerBoundsLeft && elementBoundsRight > containerBoundsLeft)
|
|
27
|
-
(elementBoundsRight > containerBoundsRight && elementBoundsLeft < containerBoundsRight));
|
|
21
|
+
const isTotallyInView = elementBoundsLeft >= containerBoundsLeft
|
|
22
|
+
&& elementBoundsRight <= containerBoundsRight;
|
|
23
|
+
const isPartiallyInView = (partial || (!strict && containerBounds.width < elementBounds.width))
|
|
24
|
+
&& ((elementBoundsLeft < containerBoundsLeft && elementBoundsRight > containerBoundsLeft)
|
|
25
|
+
|| (elementBoundsRight > containerBoundsRight && elementBoundsLeft < containerBoundsRight));
|
|
28
26
|
// Return outcome
|
|
29
27
|
return isTotallyInView || isPartiallyInView;
|
|
30
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isElementInView.js","sourceRoot":"","sources":["isElementInView.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"isElementInView.js","sourceRoot":"","sources":["isElementInView.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,UAAU,eAAe,CAC7B,SAAsB,EACtB,OAAoB,EACpB,OAAO,GAAG,KAAK,EACf,MAAM,GAAG,KAAK;IAEd,IAAI,CAAC,SAAS,IAAI,CAAC,OAAO,EAAE,CAAC;QAC3B,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,eAAe,GAAG,SAAS,CAAC,qBAAqB,EAAE,CAAC;IAC1D,MAAM,aAAa,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAC;IACtD,MAAM,mBAAmB,GAAG,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;IAC5D,MAAM,oBAAoB,GAAG,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IAC/D,MAAM,iBAAiB,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IACxD,MAAM,kBAAkB,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAE3D,mBAAmB;IACnB,MAAM,eAAe,GACnB,iBAAiB,IAAI,mBAAmB;WACrC,kBAAkB,IAAI,oBAAoB,CAAC;IAChD,MAAM,iBAAiB,GACrB,CAAC,OAAO,IAAI,CAAC,CAAC,MAAM,IAAI,eAAe,CAAC,KAAK,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;WAClE,CAAC,CAAC,iBAAiB,GAAG,mBAAmB,IAAI,kBAAkB,GAAG,mBAAmB,CAAC;eACpF,CAAC,kBAAkB,GAAG,oBAAoB,IAAI,iBAAiB,GAAG,oBAAoB,CAAC,CAAC,CAAC;IAEhG,iBAAiB;IACjB,OAAO,eAAe,IAAI,iBAAiB,CAAC;AAC9C,CAAC","sourcesContent":["/**\n * This function returns whether or not an element is within the viewable area of a container. If partial is true,\n * then this function will return true even if only part of the element is in view.\n * @param container The container to check if the element is in view of.\n * @param element The element to check if it is view\n * @param partial true if partial view is allowed\n * @param strict true if strict mode is set, never consider the container width and element width\n * @returns True if the component is in View.\n */\nexport function isElementInView(\n container: HTMLElement,\n element: HTMLElement,\n partial = false,\n strict = false\n): boolean {\n if (!container || !element) {\n return false;\n }\n const containerBounds = container.getBoundingClientRect();\n const elementBounds = element.getBoundingClientRect();\n const containerBoundsLeft = Math.ceil(containerBounds.left);\n const containerBoundsRight = Math.floor(containerBounds.right);\n const elementBoundsLeft = Math.ceil(elementBounds.left);\n const elementBoundsRight = Math.floor(elementBounds.right);\n\n // Check if in view\n const isTotallyInView =\n elementBoundsLeft >= containerBoundsLeft\n && elementBoundsRight <= containerBoundsRight;\n const isPartiallyInView =\n (partial || (!strict && containerBounds.width < elementBounds.width))\n && ((elementBoundsLeft < containerBoundsLeft && elementBoundsRight > containerBoundsLeft)\n || (elementBoundsRight > containerBoundsRight && elementBoundsLeft < containerBoundsRight));\n\n // Return outcome\n return isTotallyInView || isPartiallyInView;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/pfe-core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "PatternFly Elements Core Library",
|
|
6
6
|
"customElements": "custom-elements.json",
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
"./functions/*": "./functions/*",
|
|
17
17
|
"./core.js": "./core.js",
|
|
18
18
|
"./decorators.js": "./decorators.js",
|
|
19
|
+
"./controllers/activedescendant-controller.js": "./controllers/activedescendant-controller.js",
|
|
19
20
|
"./controllers/cascade-controller.js": "./controllers/cascade-controller.js",
|
|
20
21
|
"./controllers/css-variable-controller.js": "./controllers/css-variable-controller.js",
|
|
21
22
|
"./controllers/floating-dom-controller.js": "./controllers/floating-dom-controller.js",
|
|
@@ -35,8 +36,10 @@
|
|
|
35
36
|
"./decorators/deprecation.js": "./decorators/deprecation.js",
|
|
36
37
|
"./decorators/initializer.js": "./decorators/initializer.js",
|
|
37
38
|
"./decorators/observed.js": "./decorators/observed.js",
|
|
39
|
+
"./decorators/observes.js": "./decorators/observes.js",
|
|
38
40
|
"./decorators/time.js": "./decorators/time.js",
|
|
39
41
|
"./decorators/trace.js": "./decorators/trace.js",
|
|
42
|
+
"./functions/arraysAreEquivalent.js": "./functions/arraysAreEquivalent.js",
|
|
40
43
|
"./functions/context.js": "./functions/context.js",
|
|
41
44
|
"./functions/containsDeep.js": "./functions/containsDeep.js",
|
|
42
45
|
"./functions/debounce.js": "./functions/debounce.js",
|
|
@@ -53,9 +56,9 @@
|
|
|
53
56
|
"test": "wtr --files './test/*.spec.ts' --config ../../web-test-runner.config.js"
|
|
54
57
|
},
|
|
55
58
|
"dependencies": {
|
|
56
|
-
"@floating-ui/dom": "^1.6.
|
|
57
|
-
"@lit/context": "^1.1.
|
|
58
|
-
"lit": "^3.
|
|
59
|
+
"@floating-ui/dom": "^1.6.10",
|
|
60
|
+
"@lit/context": "^1.1.2",
|
|
61
|
+
"lit": "^3.2.0"
|
|
59
62
|
},
|
|
60
63
|
"repository": {
|
|
61
64
|
"type": "git",
|