@fluid-topics/ft-wc-utils 1.1.81 → 1.1.83
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/build/DateFormatter.d.ts +10 -0
- package/build/DateFormatter.js +22 -0
- package/build/FtLitElement.d.ts +2 -1
- package/build/FtLitElement.js +12 -4
- package/build/decorators.js +2 -2
- package/build/globals.min.js +11 -11
- package/build/helpers.d.ts +1 -0
- package/build/helpers.js +3 -0
- package/build/index.d.ts +3 -0
- package/build/index.js +5 -0
- package/build/redux/decorators.js +2 -2
- package/build/shadowQuerySelector.d.ts +3 -0
- package/build/shadowQuerySelector.js +15 -0
- package/build/urlHelpers.js +1 -1
- package/package.json +5 -4
package/build/helpers.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export declare function flatDeep<T>(arr: Array<T>, getChildren: (o: T) => Array<
|
|
|
6
6
|
export declare function dateReviver(...dateKeys: string[]): (key: string, value: any) => any;
|
|
7
7
|
export declare function parseDate(value: string): Date;
|
|
8
8
|
export declare function deepEqual(a: any, b: any): boolean;
|
|
9
|
+
export declare function hasChanged(a: any, b: any): boolean;
|
|
9
10
|
export declare function eventPathContainsMatchingElement(e: Event, matchers: string[], containerElement?: HTMLElement): boolean;
|
|
10
11
|
export declare function minmax(min: number, value: number, max: number): number;
|
|
11
12
|
export declare function last<T = any>(arr: T[]): T | undefined;
|
package/build/helpers.js
CHANGED
|
@@ -119,6 +119,9 @@ export function deepEqual(a, b) {
|
|
|
119
119
|
return false;
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
|
+
export function hasChanged(a, b) {
|
|
123
|
+
return !deepEqual(a, b);
|
|
124
|
+
}
|
|
122
125
|
export function eventPathContainsMatchingElement(e, matchers, containerElement = window.document.body) {
|
|
123
126
|
if (matchers.length > 0) {
|
|
124
127
|
const path = e.composedPath();
|
package/build/index.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export declare const isTouchScreen: boolean;
|
|
|
12
12
|
export * from "./CacheRegistry";
|
|
13
13
|
export * from "./CancelablePromise";
|
|
14
14
|
export * from "./ClusteringHelper";
|
|
15
|
+
export * from "./DateFormatter";
|
|
15
16
|
export * from "./Debouncer";
|
|
16
17
|
export * from "./decorators";
|
|
17
18
|
export * from "./designSystemVariables";
|
|
@@ -27,5 +28,7 @@ export * from "./models";
|
|
|
27
28
|
export * from "./ParametrizedLabelResolver";
|
|
28
29
|
export * from "./redux";
|
|
29
30
|
export * from "./ScopedRegistryLitElement";
|
|
31
|
+
export * from "./shadowQuerySelector";
|
|
30
32
|
export * from "./urlHelpers";
|
|
31
33
|
export * from "./FtFormComponent";
|
|
34
|
+
export { setVariable } from "@fluid-topics/design-system-variables";
|
package/build/index.js
CHANGED
|
@@ -26,6 +26,7 @@ import * as redux from "./redux";
|
|
|
26
26
|
import * as ScopedRegistryLitElement from "./ScopedRegistryLitElement";
|
|
27
27
|
import * as urlHelpers from "./urlHelpers";
|
|
28
28
|
import * as FtFormComponent from "./FtFormComponent";
|
|
29
|
+
import { DateFormatter } from "./DateFormatter";
|
|
29
30
|
export const isSafari = (navigator.vendor && !!navigator.vendor.match(/apple/i))
|
|
30
31
|
|| ((_c = (_b = (_a = window.safari) === null || _a === void 0 ? void 0 : _a.pushNotification) === null || _b === void 0 ? void 0 : _b.toString()) !== null && _c !== void 0 ? _c : "") === "[object SafariRemoteNotification]";
|
|
31
32
|
export const isTouchScreen = (("ontouchstart" in window)
|
|
@@ -43,6 +44,7 @@ window.ftGlobals = (_d = window.ftGlobals) !== null && _d !== void 0 ? _d : {
|
|
|
43
44
|
...CacheRegistry,
|
|
44
45
|
...CancelablePromise,
|
|
45
46
|
...ClusteringHelper,
|
|
47
|
+
...DateFormatter,
|
|
46
48
|
...Debouncer,
|
|
47
49
|
...decorators,
|
|
48
50
|
...designSystemVariables,
|
|
@@ -67,6 +69,7 @@ window.ftGlobals = (_d = window.ftGlobals) !== null && _d !== void 0 ? _d : {
|
|
|
67
69
|
export * from "./CacheRegistry";
|
|
68
70
|
export * from "./CancelablePromise";
|
|
69
71
|
export * from "./ClusteringHelper";
|
|
72
|
+
export * from "./DateFormatter";
|
|
70
73
|
export * from "./Debouncer";
|
|
71
74
|
export * from "./decorators";
|
|
72
75
|
export * from "./designSystemVariables";
|
|
@@ -82,5 +85,7 @@ export * from "./models";
|
|
|
82
85
|
export * from "./ParametrizedLabelResolver";
|
|
83
86
|
export * from "./redux";
|
|
84
87
|
export * from "./ScopedRegistryLitElement";
|
|
88
|
+
export * from "./shadowQuerySelector";
|
|
85
89
|
export * from "./urlHelpers";
|
|
86
90
|
export * from "./FtFormComponent";
|
|
91
|
+
export { setVariable } from "@fluid-topics/design-system-variables";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { hasChanged } from "../helpers";
|
|
2
2
|
import { property } from "lit/decorators.js";
|
|
3
3
|
export const reduxReactive = () => {
|
|
4
4
|
return (proto, name) => {
|
|
@@ -13,7 +13,7 @@ export const redux = (propertyInit) => {
|
|
|
13
13
|
return (proto, name) => {
|
|
14
14
|
var _a;
|
|
15
15
|
const litPropertyInit = {
|
|
16
|
-
hasChanged
|
|
16
|
+
hasChanged,
|
|
17
17
|
attribute: false,
|
|
18
18
|
...init
|
|
19
19
|
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { Optional } from "./generic-types";
|
|
2
|
+
export declare function shadowQuerySelector<T extends Element>(element: Element, firstSelector: string, ...selectors: string[]): Optional<T>;
|
|
3
|
+
export declare function shadowQuerySelectorAll<T extends Element>(element: Element, firstSelector: string, ...selectors: string[]): Array<T>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export function shadowQuerySelector(element, firstSelector, ...selectors) {
|
|
2
|
+
var _a;
|
|
3
|
+
let found = element.querySelector(firstSelector);
|
|
4
|
+
for (let selector of selectors) {
|
|
5
|
+
found = (_a = found === null || found === void 0 ? void 0 : found.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(selector);
|
|
6
|
+
}
|
|
7
|
+
return found;
|
|
8
|
+
}
|
|
9
|
+
export function shadowQuerySelectorAll(element, firstSelector, ...selectors) {
|
|
10
|
+
let found = [...element.querySelectorAll(firstSelector)];
|
|
11
|
+
for (let selector of selectors) {
|
|
12
|
+
found = found.flatMap(e => { var _a, _b; return [...((_b = (_a = e.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll(selector)) !== null && _b !== void 0 ? _b : [])]; });
|
|
13
|
+
}
|
|
14
|
+
return found;
|
|
15
|
+
}
|
package/build/urlHelpers.js
CHANGED
|
@@ -12,7 +12,7 @@ export function serializeRequest(baseUrl, request) {
|
|
|
12
12
|
if (request.scope && request.scope !== "DEFAULT") {
|
|
13
13
|
params.append("scope", request.scope.toLowerCase());
|
|
14
14
|
}
|
|
15
|
-
if (request.virtualField) {
|
|
15
|
+
if (request.virtualField && request.virtualField !== "EVERYWHERE") {
|
|
16
16
|
params.append("virtual-field", request.virtualField.toLowerCase());
|
|
17
17
|
}
|
|
18
18
|
if (request.periodFilter) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/ft-wc-utils",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.83",
|
|
4
4
|
"description": "Internal web components tools",
|
|
5
5
|
"author": "Fluid Topics <devtopics@antidot.net>",
|
|
6
6
|
"license": "ISC",
|
|
@@ -15,13 +15,14 @@
|
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@floating-ui/dom": "1.5.3",
|
|
17
17
|
"@fluid-topics/design-system-variables": "0.0.24",
|
|
18
|
-
"@fluid-topics/public-api": "1.0.
|
|
18
|
+
"@fluid-topics/public-api": "1.0.71",
|
|
19
19
|
"@reduxjs/toolkit": "1.9.5",
|
|
20
20
|
"@types/mark.js": "8.11.12",
|
|
21
21
|
"@webcomponents/scoped-custom-element-registry": "0.0.9",
|
|
22
22
|
"composed-offset-position": "^0.0.4",
|
|
23
23
|
"lit": "3.1.0",
|
|
24
|
-
"mark.js": "8.11.1"
|
|
24
|
+
"mark.js": "8.11.1",
|
|
25
|
+
"moment": "2.29.4"
|
|
25
26
|
},
|
|
26
|
-
"gitHead": "
|
|
27
|
+
"gitHead": "2ca7449aa6df93b0b6ba0794e695aa3f605f38bf"
|
|
27
28
|
}
|