@plasmicpkgs/plasmic-rich-components 1.0.113 → 1.0.115
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/dist/index.js
CHANGED
|
@@ -6,6 +6,7 @@ var React = require('react');
|
|
|
6
6
|
var antd = require('antd');
|
|
7
7
|
require('lodash/get');
|
|
8
8
|
var dataSources = require('@plasmicapp/data-sources');
|
|
9
|
+
var luxon = require('luxon');
|
|
9
10
|
var tinycolor = require('@ctrl/tinycolor');
|
|
10
11
|
var icons = require('@ant-design/icons');
|
|
11
12
|
var proComponents = require('@ant-design/pro-components');
|
|
@@ -657,6 +658,12 @@ function renderBoolean(value, cconfig) {
|
|
|
657
658
|
return value ? "true" : "false";
|
|
658
659
|
}
|
|
659
660
|
}
|
|
661
|
+
const dateTimeParsers = [
|
|
662
|
+
luxon.DateTime.fromISO,
|
|
663
|
+
luxon.DateTime.fromRFC2822,
|
|
664
|
+
luxon.DateTime.fromHTTP,
|
|
665
|
+
luxon.DateTime.fromSQL
|
|
666
|
+
];
|
|
660
667
|
const CANNOT_COERCE = Symbol("plasmic-cannot-coerce");
|
|
661
668
|
function coerceValue(value, dataType) {
|
|
662
669
|
if (value == null) {
|
|
@@ -678,9 +685,11 @@ function coerceValue(value, dataType) {
|
|
|
678
685
|
} else if (typeof value === "number") {
|
|
679
686
|
return new Date(value);
|
|
680
687
|
} else if (typeof value === "string") {
|
|
681
|
-
const
|
|
682
|
-
|
|
683
|
-
|
|
688
|
+
for (const parser of dateTimeParsers) {
|
|
689
|
+
const parsed = parser(value);
|
|
690
|
+
if (parsed.isValid) {
|
|
691
|
+
return parsed.toJSDate();
|
|
692
|
+
}
|
|
684
693
|
}
|
|
685
694
|
}
|
|
686
695
|
} else if (dataType === "boolean") {
|
|
@@ -856,7 +865,7 @@ function registerRichDetails(loader) {
|
|
|
856
865
|
bordered: {
|
|
857
866
|
displayName: "Show borders?",
|
|
858
867
|
type: "boolean",
|
|
859
|
-
|
|
868
|
+
defaultValue: true
|
|
860
869
|
}
|
|
861
870
|
},
|
|
862
871
|
importPath: "@plasmicpkgs/plasmic-rich-components",
|