@fluid-topics/ft-app-context 1.2.21 → 1.2.23
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.
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { FtLitElementRedux } from "@fluid-topics/ft-wc-utils/build/redux";
|
|
2
2
|
import { PropertyValues } from "lit";
|
|
3
3
|
import { Constructor } from "@fluid-topics/ft-wc-utils/build/generic-types";
|
|
4
|
-
import { FtMetadata } from "@fluid-topics/public-api";
|
|
5
4
|
export type FtLitElementWithDateFormatInterface = {
|
|
6
5
|
dateFormatOptionsChanged(props: PropertyValues): boolean;
|
|
7
|
-
|
|
6
|
+
getDateFormatter(metadataKey: string): ((value: string) => string) | undefined;
|
|
8
7
|
};
|
|
9
8
|
type FtLitElementWithDateFormatType<T extends Constructor<FtLitElementRedux>> = T & Constructor<FtLitElementWithDateFormatInterface>;
|
|
10
9
|
export declare function withDateFormat<T extends Constructor<FtLitElementRedux>>(Class: T): FtLitElementWithDateFormatType<T>;
|
|
@@ -24,18 +24,10 @@ export function withDateFormat(Class) {
|
|
|
24
24
|
|| props.has("useDateTimeFormat")
|
|
25
25
|
|| props.has("uiLocale");
|
|
26
26
|
}
|
|
27
|
-
|
|
27
|
+
getDateFormatter(metadataKey) {
|
|
28
28
|
var _a, _b;
|
|
29
|
-
const isDateMetadata = (_b = (_a = this.metadataDescriptors.find(descriptor => descriptor.key ===
|
|
30
|
-
return isDateMetadata ? this.
|
|
31
|
-
}
|
|
32
|
-
formatMetadataDates(metadata) {
|
|
33
|
-
return {
|
|
34
|
-
key: metadata.key,
|
|
35
|
-
label: metadata.label,
|
|
36
|
-
values: metadata.values.map(date => DateFormatter.format(date, this.uiLocale, this.useLongDateFormat, this.useDateTimeFormat)),
|
|
37
|
-
hierarchicalValues: metadata.hierarchicalValues
|
|
38
|
-
};
|
|
29
|
+
const isDateMetadata = (_b = (_a = this.metadataDescriptors.find(descriptor => descriptor.key === metadataKey)) === null || _a === void 0 ? void 0 : _a.date) !== null && _b !== void 0 ? _b : false;
|
|
30
|
+
return isDateMetadata ? (value) => DateFormatter.format(value, this.uiLocale, this.useLongDateFormat, this.useDateTimeFormat) : undefined;
|
|
39
31
|
}
|
|
40
32
|
}
|
|
41
33
|
__decorate([
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/ft-app-context",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.23",
|
|
4
4
|
"description": "Global application context for Fluid Topics integrations",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Lit"
|
|
@@ -19,11 +19,11 @@
|
|
|
19
19
|
"url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@fluid-topics/ft-wc-utils": "1.2.
|
|
22
|
+
"@fluid-topics/ft-wc-utils": "1.2.23",
|
|
23
23
|
"lit": "3.1.0"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@fluid-topics/public-api": "1.0.82"
|
|
27
27
|
},
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "5194ba981cde5e47a64f98727806cd6c2e8214b3"
|
|
29
29
|
}
|