@omnia/velcron 8.0.327-dev → 8.0.329-dev
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.
|
@@ -4,16 +4,32 @@ exports.dateFormatter = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const dayjs_1 = tslib_1.__importDefault(require("dayjs"));
|
|
6
6
|
const parser_1 = require("../parser");
|
|
7
|
+
//"EDT": "America/New_York",
|
|
8
|
+
//"CEST": "Europe/Berlin",
|
|
9
|
+
//"CET": "Europe/Berlin",
|
|
7
10
|
exports.dateFormatter = {
|
|
8
11
|
name: "date",
|
|
9
|
-
format: (value,
|
|
10
|
-
if (typeof value === "string" ||
|
|
11
|
-
|
|
12
|
+
format: (value, format = "YYYY-MM-DD", timezone) => {
|
|
13
|
+
if (typeof value === "string" ||
|
|
14
|
+
value instanceof Date ||
|
|
15
|
+
typeof value === "number") {
|
|
16
|
+
let date;
|
|
17
|
+
if (timezone) {
|
|
18
|
+
date = dayjs_1.default.utc(value).tz(timezone);
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
date = (0, dayjs_1.default)(value);
|
|
22
|
+
}
|
|
12
23
|
if (date.isValid()) {
|
|
13
|
-
|
|
24
|
+
if (format.toLowerCase() === "social") {
|
|
25
|
+
return date.fromNow();
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
return date.format(format);
|
|
29
|
+
}
|
|
14
30
|
}
|
|
15
31
|
}
|
|
16
32
|
return value;
|
|
17
|
-
}
|
|
33
|
+
},
|
|
18
34
|
};
|
|
19
35
|
parser_1.VelcronFormatters.registerFormatter(exports.dateFormatter);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BackgroundDefinition, BlueprintsReference, ColorValue, FillDefinitionValue } from "./ThemeDefinition";
|
|
2
|
-
import { SpacingDefinition, Spacing } from "./Spacing";
|
|
2
|
+
import { SpacingDefinition, Spacing, SpacingValue } from "./Spacing";
|
|
3
3
|
import { TypographyFontDefinition, TypographyValue } from "./Typography";
|
|
4
4
|
import { ThemeBase } from "./ThemeBase";
|
|
5
5
|
import { VelcronRendererResolverReference } from "../velcron";
|
|
@@ -89,7 +89,8 @@ export interface ButtonBlueprintVariant {
|
|
|
89
89
|
category: ButtonBlueprintType;
|
|
90
90
|
}
|
|
91
91
|
export interface ButtonBlueprint extends Blueprint {
|
|
92
|
-
padding?:
|
|
92
|
+
padding?: SpacingValue;
|
|
93
|
+
height?: number;
|
|
93
94
|
background?: BackgroundDefinition;
|
|
94
95
|
alterCase?: boolean;
|
|
95
96
|
text?: TextBlueprint;
|
|
@@ -118,11 +119,12 @@ export interface InputBlueprints extends Blueprints, VariantBlueprints<InputBlue
|
|
|
118
119
|
primary?: InputBlueprint;
|
|
119
120
|
}
|
|
120
121
|
export interface InputBlueprint extends Blueprint {
|
|
121
|
-
variant?: "filled" | "underlined" | "outlined" | "plain" | "solo" | "solo-inverted" | "solo-filled";
|
|
122
|
+
variant?: "filled" | "underlined" | "outlined" | "plain" | "solo" | "solo-inverted" | "solo-filled" | "custom";
|
|
122
123
|
background?: BackgroundDefinition;
|
|
123
124
|
height?: number;
|
|
124
125
|
text?: TextBlueprint;
|
|
125
126
|
icon?: IconBlueprint;
|
|
127
|
+
padding?: SpacingValue;
|
|
126
128
|
}
|
|
127
129
|
export interface TabsBlueprints extends Blueprints, VariantBlueprints<TabsBlueprint> {
|
|
128
130
|
primary?: TabsBlueprint;
|
|
@@ -415,6 +415,7 @@ export interface VelcronReferenceDefinition extends VelcronDefinition {
|
|
|
415
415
|
export interface VelcronPropertyDefinition extends VelcronDefinitionWithEditMode {
|
|
416
416
|
type: "property";
|
|
417
417
|
value: VelcronBindableProp<string>;
|
|
418
|
+
slots: Record<string, VelcronDefinition>;
|
|
418
419
|
}
|
|
419
420
|
export interface VelcronCheckboxDefinition extends VelcronDefinition {
|
|
420
421
|
type: "checkbox";
|