ywana-core8 0.0.552 → 0.0.555
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.cjs +22 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +22 -9
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +22 -9
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/ContentViewer.js +1 -1
- package/src/html/property.js +10 -4
- package/src/site/view.js +6 -2
- package/src/widgets/calendar/Calendar.js +1 -1
package/dist/index.cjs
CHANGED
@@ -755,7 +755,8 @@ var Property = function Property(props) {
|
|
755
755
|
value = props.value,
|
756
756
|
_props$editable = props.editable,
|
757
757
|
editable = _props$editable === void 0 ? false : _props$editable,
|
758
|
-
onChange = props.onChange
|
758
|
+
onChange = props.onChange,
|
759
|
+
options = props.options;
|
759
760
|
|
760
761
|
function change(event) {
|
761
762
|
if (onChange) {
|
@@ -768,19 +769,26 @@ var Property = function Property(props) {
|
|
768
769
|
if (onChange) onChange(id, "");
|
769
770
|
}
|
770
771
|
|
772
|
+
var value2 = value || initial;
|
773
|
+
|
774
|
+
if (options) {
|
775
|
+
var opt = options.find(function (option) {
|
776
|
+
return option.value == value2;
|
777
|
+
});
|
778
|
+
if (opt) value2 = opt.label;
|
779
|
+
}
|
780
|
+
|
771
781
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
772
782
|
className: "property property-" + id + " " + className
|
773
783
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
774
784
|
className: "property-name"
|
775
|
-
}, name || label),
|
776
|
-
className: "property-value"
|
777
|
-
}, initial) : null, /*#__PURE__*/React__default["default"].createElement("div", {
|
785
|
+
}, name || label), /*#__PURE__*/React__default["default"].createElement("div", {
|
778
786
|
className: "property-value"
|
779
787
|
}, editable ? /*#__PURE__*/React__default["default"].createElement("input", {
|
780
788
|
type: "text",
|
781
|
-
value:
|
789
|
+
value: value2,
|
782
790
|
onChange: change
|
783
|
-
}) :
|
791
|
+
}) : value2, editable && value2.length > 0 ? /*#__PURE__*/React__default["default"].createElement(Icon, {
|
784
792
|
icon: "close",
|
785
793
|
size: "small",
|
786
794
|
clickable: true,
|
@@ -2627,7 +2635,7 @@ var Calendar = function Calendar(props) {
|
|
2627
2635
|
setPosition(today);
|
2628
2636
|
}, []);
|
2629
2637
|
React.useEffect(function () {
|
2630
|
-
if (onChange) {
|
2638
|
+
if (position && onChange) {
|
2631
2639
|
var _firstDayOfMonth = position.clone().startOf('month');
|
2632
2640
|
|
2633
2641
|
var _firstDayOfRange = _firstDayOfMonth.clone().startOf('isoweek');
|
@@ -3794,7 +3802,8 @@ var View = function View(props) {
|
|
3794
3802
|
};
|
3795
3803
|
var TabbedView = function TabbedView(props) {
|
3796
3804
|
var title = props.title,
|
3797
|
-
className = props.className
|
3805
|
+
className = props.className,
|
3806
|
+
selected = props.selected;
|
3798
3807
|
|
3799
3808
|
var _useState2 = React.useState(0),
|
3800
3809
|
tab = _useState2[0],
|
@@ -3807,6 +3816,9 @@ var TabbedView = function TabbedView(props) {
|
|
3807
3816
|
label: child.props.label
|
3808
3817
|
});
|
3809
3818
|
});
|
3819
|
+
React.useEffect(function () {
|
3820
|
+
if (selected && selected !== tab) setTab(selected);
|
3821
|
+
}, [selected]);
|
3810
3822
|
var toolbar = /*#__PURE__*/React__default["default"].createElement(Tabs, {
|
3811
3823
|
selected: tab,
|
3812
3824
|
onChange: function onChange(tab) {
|
@@ -5995,7 +6007,8 @@ var FieldViewer = function FieldViewer(props) {
|
|
5995
6007
|
case TYPES.STRING:
|
5996
6008
|
return /*#__PURE__*/React__default["default"].createElement(Property, {
|
5997
6009
|
label: label,
|
5998
|
-
value: value
|
6010
|
+
value: value,
|
6011
|
+
options: field.options
|
5999
6012
|
});
|
6000
6013
|
|
6001
6014
|
case TYPES.ENTITY:
|