@bpmn-io/form-js-editor 0.10.0-alpha.2 → 0.10.0
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/README.md +5 -4
- package/dist/index.cjs +480 -314
- package/dist/index.cjs.map +1 -1
- package/dist/index.es.js +466 -300
- package/dist/index.es.js.map +1 -1
- package/dist/types/features/properties-panel/entries/AdornerEntry.d.ts +11 -0
- package/dist/types/features/properties-panel/entries/DateTimeConstraintsEntry.d.ts +9 -0
- package/dist/types/features/properties-panel/entries/DateTimeEntry.d.ts +9 -0
- package/dist/types/features/properties-panel/entries/DateTimeSerializationEntry.d.ts +9 -0
- package/dist/types/features/properties-panel/entries/LabelEntry.d.ts +5 -5
- package/dist/types/features/properties-panel/entries/factories/index.d.ts +1 -0
- package/dist/types/features/properties-panel/entries/factories/simpleStringEntryFactory.d.ts +9 -0
- package/dist/types/features/properties-panel/entries/index.d.ts +4 -0
- package/dist/types/features/properties-panel/groups/AppearanceGroup.d.ts +13 -0
- package/dist/types/features/properties-panel/groups/ConstraintsGroup.d.ts +11 -0
- package/dist/types/features/properties-panel/groups/index.d.ts +2 -0
- package/dist/types/render/components/icons/index.d.ts +1 -15
- package/package.json +3 -3
- package/dist/types/features/properties-panel/entries/ValuesSourceUtil.d.ts +0 -15
package/dist/index.cjs
CHANGED
|
@@ -8,8 +8,8 @@ var minDash = require('min-dash');
|
|
|
8
8
|
var preact = require('preact');
|
|
9
9
|
var hooks$1 = require('preact/hooks');
|
|
10
10
|
var dragula = require('dragula');
|
|
11
|
-
var React = require('preact/compat');
|
|
12
11
|
var jsxRuntime = require('preact/jsx-runtime');
|
|
12
|
+
var React = require('preact/compat');
|
|
13
13
|
var minDom = require('min-dom');
|
|
14
14
|
var arrayMove = require('array-move');
|
|
15
15
|
var classnames = require('classnames');
|
|
@@ -705,11 +705,11 @@ function useService$1 (type, strict) {
|
|
|
705
705
|
return getService(type, strict);
|
|
706
706
|
}
|
|
707
707
|
|
|
708
|
-
function _extends
|
|
708
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
709
709
|
var ListDeleteIcon = (({
|
|
710
710
|
styles = {},
|
|
711
711
|
...props
|
|
712
|
-
}) => /*#__PURE__*/React__default['default'].createElement("svg", _extends
|
|
712
|
+
}) => /*#__PURE__*/React__default['default'].createElement("svg", _extends({
|
|
713
713
|
xmlns: "http://www.w3.org/2000/svg",
|
|
714
714
|
width: "11",
|
|
715
715
|
height: "14"
|
|
@@ -717,223 +717,6 @@ var ListDeleteIcon = (({
|
|
|
717
717
|
d: "M10 4v8c0 1.1-.9 2-2 2H3c-1.1 0-2-.9-2-2V4h9zM8 6H3v4.8c0 .66.5 1.2 1.111 1.2H6.89C7.5 12 8 11.46 8 10.8V6zm3-5H8.5l-1-1h-4l-1 1H0v1.5h11V1z"
|
|
718
718
|
})));
|
|
719
719
|
|
|
720
|
-
function _extends$c() { _extends$c = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$c.apply(this, arguments); }
|
|
721
|
-
var ButtonIcon = (({
|
|
722
|
-
styles = {},
|
|
723
|
-
...props
|
|
724
|
-
}) => /*#__PURE__*/React__default['default'].createElement("svg", _extends$c({
|
|
725
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
726
|
-
width: "54",
|
|
727
|
-
height: "54"
|
|
728
|
-
}, props), /*#__PURE__*/React__default['default'].createElement("path", {
|
|
729
|
-
fillRule: "evenodd",
|
|
730
|
-
d: "M45 17a3 3 0 013 3v14a3 3 0 01-3 3H9a3 3 0 01-3-3V20a3 3 0 013-3h36zm-9 8.889H18v2.222h18V25.89z"
|
|
731
|
-
})));
|
|
732
|
-
|
|
733
|
-
function _extends$b() { _extends$b = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$b.apply(this, arguments); }
|
|
734
|
-
var CheckboxIcon = (({
|
|
735
|
-
styles = {},
|
|
736
|
-
...props
|
|
737
|
-
}) => /*#__PURE__*/React__default['default'].createElement("svg", _extends$b({
|
|
738
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
739
|
-
width: "54",
|
|
740
|
-
height: "54"
|
|
741
|
-
}, props), /*#__PURE__*/React__default['default'].createElement("path", {
|
|
742
|
-
d: "M34 18H20a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2V20a2 2 0 00-2-2zm-9 14l-5-5 1.41-1.41L25 29.17l7.59-7.59L34 23l-9 9z"
|
|
743
|
-
})));
|
|
744
|
-
|
|
745
|
-
function _extends$a() { _extends$a = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$a.apply(this, arguments); }
|
|
746
|
-
var ChecklistIcon = (({
|
|
747
|
-
styles = {},
|
|
748
|
-
...props
|
|
749
|
-
}) => /*#__PURE__*/React__default['default'].createElement("svg", _extends$a({
|
|
750
|
-
width: "54",
|
|
751
|
-
height: "54",
|
|
752
|
-
fill: "none",
|
|
753
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
754
|
-
}, props), /*#__PURE__*/React__default['default'].createElement("path", {
|
|
755
|
-
fillRule: "evenodd",
|
|
756
|
-
clipRule: "evenodd",
|
|
757
|
-
d: "M19 24h-6v6h6v-6zm-6-2a2 2 0 00-2 2v6a2 2 0 002 2h6a2 2 0 002-2v-6a2 2 0 00-2-2h-6zm6 18h-6v6h6v-6zm-6-2a2 2 0 00-2 2v6a2 2 0 002 2h6a2 2 0 002-2v-6a2 2 0 00-2-2h-6zm6-30h-6v6h6V8zm-6-2a2 2 0 00-2 2v6a2 2 0 002 2h6a2 2 0 002-2V8a2 2 0 00-2-2h-6z",
|
|
758
|
-
fill: "#22242A"
|
|
759
|
-
}), /*#__PURE__*/React__default['default'].createElement("path", {
|
|
760
|
-
d: "M26 26a1 1 0 011-1h15a1 1 0 011 1v2a1 1 0 01-1 1H27a1 1 0 01-1-1v-2zm0 16a1 1 0 011-1h15a1 1 0 011 1v2a1 1 0 01-1 1H27a1 1 0 01-1-1v-2zm0-32a1 1 0 011-1h15a1 1 0 011 1v2a1 1 0 01-1 1H27a1 1 0 01-1-1v-2z",
|
|
761
|
-
fill: "#22242A"
|
|
762
|
-
})));
|
|
763
|
-
|
|
764
|
-
function _extends$9() { _extends$9 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$9.apply(this, arguments); }
|
|
765
|
-
var TaglistIcon = (({
|
|
766
|
-
styles = {},
|
|
767
|
-
...props
|
|
768
|
-
}) => /*#__PURE__*/React__default['default'].createElement("svg", _extends$9({
|
|
769
|
-
width: "54",
|
|
770
|
-
height: "54",
|
|
771
|
-
fill: "none",
|
|
772
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
773
|
-
}, props), /*#__PURE__*/React__default['default'].createElement("path", {
|
|
774
|
-
fillRule: "evenodd",
|
|
775
|
-
clipRule: "evenodd",
|
|
776
|
-
d: "M45 16a3 3 0 013 3v16a3 3 0 01-3 3H9a3 3 0 01-3-3V19a3 3 0 013-3h36zm0 2H9a1 1 0 00-1 1v16a1 1 0 001 1h36a1 1 0 001-1V19a1 1 0 00-1-1z",
|
|
777
|
-
fill: "#000"
|
|
778
|
-
}), /*#__PURE__*/React__default['default'].createElement("path", {
|
|
779
|
-
d: "M11 22a1 1 0 011-1h19a1 1 0 011 1v10a1 1 0 01-1 1H12a1 1 0 01-1-1V22z",
|
|
780
|
-
fill: "#505562"
|
|
781
|
-
})));
|
|
782
|
-
|
|
783
|
-
function _extends$8() { _extends$8 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$8.apply(this, arguments); }
|
|
784
|
-
var FormIcon = (({
|
|
785
|
-
styles = {},
|
|
786
|
-
...props
|
|
787
|
-
}) => /*#__PURE__*/React__default['default'].createElement("svg", _extends$8({
|
|
788
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
789
|
-
width: "54",
|
|
790
|
-
height: "54"
|
|
791
|
-
}, props), /*#__PURE__*/React__default['default'].createElement("rect", {
|
|
792
|
-
x: "15",
|
|
793
|
-
y: "17",
|
|
794
|
-
width: "24",
|
|
795
|
-
height: "4",
|
|
796
|
-
rx: "1"
|
|
797
|
-
}), /*#__PURE__*/React__default['default'].createElement("rect", {
|
|
798
|
-
x: "15",
|
|
799
|
-
y: "25",
|
|
800
|
-
width: "24",
|
|
801
|
-
height: "4",
|
|
802
|
-
rx: "1"
|
|
803
|
-
}), /*#__PURE__*/React__default['default'].createElement("rect", {
|
|
804
|
-
x: "15",
|
|
805
|
-
y: "33",
|
|
806
|
-
width: "13",
|
|
807
|
-
height: "4",
|
|
808
|
-
rx: "1"
|
|
809
|
-
})));
|
|
810
|
-
|
|
811
|
-
function _extends$7() { _extends$7 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$7.apply(this, arguments); }
|
|
812
|
-
var ColumnsIcon = (({
|
|
813
|
-
styles = {},
|
|
814
|
-
...props
|
|
815
|
-
}) => /*#__PURE__*/React__default['default'].createElement("svg", _extends$7({
|
|
816
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
817
|
-
width: "54",
|
|
818
|
-
height: "54"
|
|
819
|
-
}, props), /*#__PURE__*/React__default['default'].createElement("path", {
|
|
820
|
-
fillRule: "evenodd",
|
|
821
|
-
d: "M8 33v5a1 1 0 001 1h4v2H9a3 3 0 01-3-3v-5h2zm18 6v2H15v-2h11zm13 0v2H28v-2h11zm9-6v5a3 3 0 01-3 3h-4v-2h4a1 1 0 00.993-.883L46 38v-5h2zM8 22v9H6v-9h2zm40 0v9h-2v-9h2zm-35-9v2H9a1 1 0 00-.993.883L8 16v4H6v-4a3 3 0 013-3h4zm32 0a3 3 0 013 3v4h-2v-4a1 1 0 00-.883-.993L45 15h-4v-2h4zm-6 0v2H28v-2h11zm-13 0v2H15v-2h11z"
|
|
822
|
-
})));
|
|
823
|
-
|
|
824
|
-
function _extends$6() { _extends$6 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$6.apply(this, arguments); }
|
|
825
|
-
var NumberIcon = (({
|
|
826
|
-
styles = {},
|
|
827
|
-
...props
|
|
828
|
-
}) => /*#__PURE__*/React__default['default'].createElement("svg", _extends$6({
|
|
829
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
830
|
-
width: "54",
|
|
831
|
-
height: "54"
|
|
832
|
-
}, props), /*#__PURE__*/React__default['default'].createElement("path", {
|
|
833
|
-
fillRule: "evenodd",
|
|
834
|
-
d: "M45 16a3 3 0 013 3v16a3 3 0 01-3 3H9a3 3 0 01-3-3V19a3 3 0 013-3h36zm0 2H9a1 1 0 00-1 1v16a1 1 0 001 1h36a1 1 0 001-1V19a1 1 0 00-1-1zM35 28.444h7l-3.5 4-3.5-4zM35 26h7l-3.5-4-3.5 4z"
|
|
835
|
-
})));
|
|
836
|
-
|
|
837
|
-
function _extends$5() { _extends$5 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$5.apply(this, arguments); }
|
|
838
|
-
var RadioIcon = (({
|
|
839
|
-
styles = {},
|
|
840
|
-
...props
|
|
841
|
-
}) => /*#__PURE__*/React__default['default'].createElement("svg", _extends$5({
|
|
842
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
843
|
-
width: "54",
|
|
844
|
-
height: "54"
|
|
845
|
-
}, props), /*#__PURE__*/React__default['default'].createElement("path", {
|
|
846
|
-
d: "M27 22c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zm0-5c-5.52 0-10 4.48-10 10s4.48 10 10 10 10-4.48 10-10-4.48-10-10-10zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"
|
|
847
|
-
})));
|
|
848
|
-
|
|
849
|
-
function _extends$4() { _extends$4 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$4.apply(this, arguments); }
|
|
850
|
-
var SelectIcon = (({
|
|
851
|
-
styles = {},
|
|
852
|
-
...props
|
|
853
|
-
}) => /*#__PURE__*/React__default['default'].createElement("svg", _extends$4({
|
|
854
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
855
|
-
width: "54",
|
|
856
|
-
height: "54"
|
|
857
|
-
}, props), /*#__PURE__*/React__default['default'].createElement("path", {
|
|
858
|
-
fillRule: "evenodd",
|
|
859
|
-
d: "M45 16a3 3 0 013 3v16a3 3 0 01-3 3H9a3 3 0 01-3-3V19a3 3 0 013-3h36zm0 2H9a1 1 0 00-1 1v16a1 1 0 001 1h36a1 1 0 001-1V19a1 1 0 00-1-1zm-12 7h9l-4.5 6-4.5-6z"
|
|
860
|
-
})));
|
|
861
|
-
|
|
862
|
-
function _extends$3() { _extends$3 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$3.apply(this, arguments); }
|
|
863
|
-
var TextIcon = (({
|
|
864
|
-
styles = {},
|
|
865
|
-
...props
|
|
866
|
-
}) => /*#__PURE__*/React__default['default'].createElement("svg", _extends$3({
|
|
867
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
868
|
-
width: "54",
|
|
869
|
-
height: "54"
|
|
870
|
-
}, props), /*#__PURE__*/React__default['default'].createElement("path", {
|
|
871
|
-
d: "M20.58 33.77h-3l-1.18-3.08H11l-1.1 3.08H7l5.27-13.54h2.89zm-5-5.36l-1.86-5-1.83 5zM22 20.23h5.41a15.47 15.47 0 012.4.14 3.42 3.42 0 011.41.55 3.47 3.47 0 011 1.14 3 3 0 01.42 1.58 3.26 3.26 0 01-1.91 2.94 3.63 3.63 0 011.91 1.22 3.28 3.28 0 01.66 2 4 4 0 01-.43 1.8 3.63 3.63 0 01-1.09 1.4 3.89 3.89 0 01-1.83.65q-.69.07-3.3.09H22zm2.73 2.25v3.13h3.8a1.79 1.79 0 001.1-.49 1.41 1.41 0 00.41-1 1.49 1.49 0 00-.35-1 1.54 1.54 0 00-1-.48c-.27 0-1.05-.05-2.34-.05zm0 5.39v3.62h2.57a11.52 11.52 0 001.88-.09 1.65 1.65 0 001-.54 1.6 1.6 0 00.38-1.14 1.75 1.75 0 00-.29-1 1.69 1.69 0 00-.86-.62 9.28 9.28 0 00-2.41-.23zM44.35 28.79l2.65.84a5.94 5.94 0 01-2 3.29A5.74 5.74 0 0141.38 34a5.87 5.87 0 01-4.44-1.84 7.09 7.09 0 01-1.73-5A7.43 7.43 0 0137 21.87 6 6 0 0141.54 20a5.64 5.64 0 014 1.47A5.33 5.33 0 0147 24l-2.7.65a2.8 2.8 0 00-2.86-2.27A3.09 3.09 0 0039 23.42a5.31 5.31 0 00-.93 3.5 5.62 5.62 0 00.93 3.65 3 3 0 002.4 1.09 2.72 2.72 0 001.82-.66 4 4 0 001.13-2.21z"
|
|
872
|
-
})));
|
|
873
|
-
|
|
874
|
-
function _extends$2() { _extends$2 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$2.apply(this, arguments); }
|
|
875
|
-
var TextfieldIcon = (({
|
|
876
|
-
styles = {},
|
|
877
|
-
...props
|
|
878
|
-
}) => /*#__PURE__*/React__default['default'].createElement("svg", _extends$2({
|
|
879
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
880
|
-
width: "54",
|
|
881
|
-
height: "54"
|
|
882
|
-
}, props), /*#__PURE__*/React__default['default'].createElement("path", {
|
|
883
|
-
fillRule: "evenodd",
|
|
884
|
-
d: "M45 16a3 3 0 013 3v16a3 3 0 01-3 3H9a3 3 0 01-3-3V19a3 3 0 013-3h36zm0 2H9a1 1 0 00-1 1v16a1 1 0 001 1h36a1 1 0 001-1V19a1 1 0 00-1-1zm-32 4v10h-2V22h2z"
|
|
885
|
-
})));
|
|
886
|
-
|
|
887
|
-
function _extends$1() { _extends$1 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1.apply(this, arguments); }
|
|
888
|
-
var TextareaIcon = (({
|
|
889
|
-
styles = {},
|
|
890
|
-
...props
|
|
891
|
-
}) => /*#__PURE__*/React__default['default'].createElement("svg", _extends$1({
|
|
892
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
893
|
-
width: "54",
|
|
894
|
-
height: "54"
|
|
895
|
-
}, props), /*#__PURE__*/React__default['default'].createElement("path", {
|
|
896
|
-
fillRule: "evenodd",
|
|
897
|
-
d: "M45 13a3 3 0 013 3v22a3 3 0 01-3 3H9a3 3 0 01-3-3V16a3 3 0 013-3h36zm0 2H9a1 1 0 00-1 1v22a1 1 0 001 1h36a1 1 0 001-1V16a1 1 0 00-1-1zm-1.136 15.5l.848.849-6.363 6.363-.849-.848 6.364-6.364zm.264 3.5l.849.849-2.828 2.828-.849-.849L44.128 34zM13 19v10h-2V19h2z"
|
|
898
|
-
})));
|
|
899
|
-
|
|
900
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
901
|
-
var ImageIcon = (({
|
|
902
|
-
styles = {},
|
|
903
|
-
...props
|
|
904
|
-
}) => /*#__PURE__*/React__default['default'].createElement("svg", _extends({
|
|
905
|
-
width: "54",
|
|
906
|
-
height: "54",
|
|
907
|
-
fill: "none",
|
|
908
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
909
|
-
}, props), /*#__PURE__*/React__default['default'].createElement("path", {
|
|
910
|
-
fillRule: "evenodd",
|
|
911
|
-
clipRule: "evenodd",
|
|
912
|
-
d: "M34.636 21.91A3.818 3.818 0 1127 21.908a3.818 3.818 0 017.636 0zm-2 0A1.818 1.818 0 1129 21.908a1.818 1.818 0 013.636 0z",
|
|
913
|
-
fill: "#000"
|
|
914
|
-
}), /*#__PURE__*/React__default['default'].createElement("path", {
|
|
915
|
-
fillRule: "evenodd",
|
|
916
|
-
clipRule: "evenodd",
|
|
917
|
-
d: "M15 13a2 2 0 00-2 2v24a2 2 0 002 2h24a2 2 0 002-2V15a2 2 0 00-2-2H15zm24 2H15v12.45l4.71-4.709a1.91 1.91 0 012.702 0l6.695 6.695 2.656-1.77a1.91 1.91 0 012.411.239L39 32.73V15zM15 39v-8.754c.06-.038.116-.083.168-.135l5.893-5.893 6.684 6.685a1.911 1.911 0 002.41.238l2.657-1.77 6.02 6.02c.052.051.108.097.168.135V39H15z",
|
|
918
|
-
fill: "#000"
|
|
919
|
-
})));
|
|
920
|
-
|
|
921
|
-
const iconsByType = {
|
|
922
|
-
button: ButtonIcon,
|
|
923
|
-
checkbox: CheckboxIcon,
|
|
924
|
-
checklist: ChecklistIcon,
|
|
925
|
-
columns: ColumnsIcon,
|
|
926
|
-
image: ImageIcon,
|
|
927
|
-
number: NumberIcon,
|
|
928
|
-
radio: RadioIcon,
|
|
929
|
-
select: SelectIcon,
|
|
930
|
-
taglist: TaglistIcon,
|
|
931
|
-
text: TextIcon,
|
|
932
|
-
textfield: TextfieldIcon,
|
|
933
|
-
textarea: TextareaIcon,
|
|
934
|
-
default: FormIcon
|
|
935
|
-
};
|
|
936
|
-
|
|
937
720
|
function ContextPad(props) {
|
|
938
721
|
if (!props.children) {
|
|
939
722
|
return null;
|
|
@@ -1208,7 +991,7 @@ function CreatePreview(props) {
|
|
|
1208
991
|
} = hooks$1.useContext(DragAndDropContext);
|
|
1209
992
|
function handleCloned(clone, original, type) {
|
|
1210
993
|
const fieldType = clone.dataset.fieldType;
|
|
1211
|
-
const Icon = iconsByType[fieldType];
|
|
994
|
+
const Icon = formJsViewer.iconsByType[fieldType];
|
|
1212
995
|
if (fieldType) {
|
|
1213
996
|
clone.innerHTML = '';
|
|
1214
997
|
clone.class = 'gu-mirror';
|
|
@@ -3106,6 +2889,9 @@ const types = [{
|
|
|
3106
2889
|
}, {
|
|
3107
2890
|
label: 'Number',
|
|
3108
2891
|
type: 'number'
|
|
2892
|
+
}, {
|
|
2893
|
+
label: 'Datetime',
|
|
2894
|
+
type: 'datetime'
|
|
3109
2895
|
}, {
|
|
3110
2896
|
label: 'Checkbox',
|
|
3111
2897
|
type: 'checkbox'
|
|
@@ -3122,7 +2908,7 @@ const types = [{
|
|
|
3122
2908
|
label: 'Select',
|
|
3123
2909
|
type: 'select'
|
|
3124
2910
|
}, {
|
|
3125
|
-
label: 'Text',
|
|
2911
|
+
label: 'Text view',
|
|
3126
2912
|
type: 'text'
|
|
3127
2913
|
}, {
|
|
3128
2914
|
label: 'Image view',
|
|
@@ -3147,7 +2933,7 @@ function Palette(props) {
|
|
|
3147
2933
|
label,
|
|
3148
2934
|
type
|
|
3149
2935
|
}) => {
|
|
3150
|
-
const Icon = iconsByType[type];
|
|
2936
|
+
const Icon = formJsViewer.iconsByType[type];
|
|
3151
2937
|
return jsxRuntime.jsxs("div", {
|
|
3152
2938
|
class: "fjs-palette-field fjs-drag-copy fjs-no-drop",
|
|
3153
2939
|
"data-field-type": type,
|
|
@@ -4682,7 +4468,7 @@ const OptionalFeelInput = React.forwardRef((props, ref) => {
|
|
|
4682
4468
|
value: value || ''
|
|
4683
4469
|
});
|
|
4684
4470
|
});
|
|
4685
|
-
React.forwardRef((props, ref) => {
|
|
4471
|
+
const OptionalFeelTextArea = React.forwardRef((props, ref) => {
|
|
4686
4472
|
const {
|
|
4687
4473
|
id,
|
|
4688
4474
|
disabled,
|
|
@@ -4816,6 +4602,28 @@ function FeelEntry(props) {
|
|
|
4816
4602
|
})]
|
|
4817
4603
|
});
|
|
4818
4604
|
}
|
|
4605
|
+
|
|
4606
|
+
/**
|
|
4607
|
+
* @param {Object} props
|
|
4608
|
+
* @param {Object} props.element
|
|
4609
|
+
* @param {String} props.id
|
|
4610
|
+
* @param {String} props.description
|
|
4611
|
+
* @param {Boolean} props.debounce
|
|
4612
|
+
* @param {Boolean} props.disabled
|
|
4613
|
+
* @param {String} props.label
|
|
4614
|
+
* @param {Function} props.getValue
|
|
4615
|
+
* @param {Function} props.setValue
|
|
4616
|
+
* @param {Function} props.onFocus
|
|
4617
|
+
* @param {Function} props.onBlur
|
|
4618
|
+
* @param {Function} props.validate
|
|
4619
|
+
*/
|
|
4620
|
+
function FeelTextArea(props) {
|
|
4621
|
+
return jsxRuntime.jsx(FeelEntry, {
|
|
4622
|
+
class: "bio-properties-panel-feel-textarea",
|
|
4623
|
+
OptionalComponent: OptionalFeelTextArea,
|
|
4624
|
+
...props
|
|
4625
|
+
});
|
|
4626
|
+
}
|
|
4819
4627
|
function isEdited$6(node) {
|
|
4820
4628
|
return node && (!!node.value || node.classList.contains('edited'));
|
|
4821
4629
|
}
|
|
@@ -5357,7 +5165,7 @@ function textToLabel(text) {
|
|
|
5357
5165
|
}
|
|
5358
5166
|
return null;
|
|
5359
5167
|
}
|
|
5360
|
-
const INPUTS = ['checkbox', 'checklist', 'number', 'radio', 'select', 'taglist', 'textfield', 'textarea'];
|
|
5168
|
+
const INPUTS = ['checkbox', 'checklist', 'datetime', 'number', 'radio', 'select', 'taglist', 'textfield', 'textarea'];
|
|
5361
5169
|
const VALUES_INPUTS = ['checklist', 'radio', 'select', 'taglist'];
|
|
5362
5170
|
|
|
5363
5171
|
const labelsByType = {
|
|
@@ -5366,12 +5174,13 @@ const labelsByType = {
|
|
|
5366
5174
|
checklist: 'CHECKLIST',
|
|
5367
5175
|
columns: 'COLUMNS',
|
|
5368
5176
|
default: 'FORM',
|
|
5369
|
-
|
|
5177
|
+
datetime: 'DATETIME',
|
|
5178
|
+
image: 'IMAGE VIEW',
|
|
5370
5179
|
number: 'NUMBER',
|
|
5371
5180
|
radio: 'RADIO',
|
|
5372
5181
|
select: 'SELECT',
|
|
5373
5182
|
taglist: 'TAGLIST',
|
|
5374
|
-
text: 'TEXT',
|
|
5183
|
+
text: 'TEXT VIEW',
|
|
5375
5184
|
textfield: 'TEXT FIELD',
|
|
5376
5185
|
textarea: 'TEXT AREA'
|
|
5377
5186
|
};
|
|
@@ -5395,7 +5204,7 @@ const PropertiesPanelHeaderProvider = {
|
|
|
5395
5204
|
const {
|
|
5396
5205
|
type
|
|
5397
5206
|
} = field;
|
|
5398
|
-
const Icon = iconsByType[type];
|
|
5207
|
+
const Icon = formJsViewer.iconsByType[type];
|
|
5399
5208
|
if (Icon) {
|
|
5400
5209
|
return () => jsxRuntime.jsx(Icon, {
|
|
5401
5210
|
width: "36",
|
|
@@ -6054,48 +5863,83 @@ function Key$1(props) {
|
|
|
6054
5863
|
});
|
|
6055
5864
|
}
|
|
6056
5865
|
|
|
6057
|
-
function
|
|
5866
|
+
function simpleStringEntryFactory(options) {
|
|
5867
|
+
const {
|
|
5868
|
+
id,
|
|
5869
|
+
label,
|
|
5870
|
+
path,
|
|
5871
|
+
props
|
|
5872
|
+
} = options;
|
|
6058
5873
|
const {
|
|
6059
5874
|
editField,
|
|
6060
5875
|
field
|
|
6061
5876
|
} = props;
|
|
6062
|
-
|
|
6063
|
-
|
|
6064
|
-
|
|
6065
|
-
|
|
6066
|
-
|
|
6067
|
-
|
|
6068
|
-
|
|
6069
|
-
|
|
6070
|
-
|
|
6071
|
-
field: field,
|
|
6072
|
-
isEdited: isEdited$1
|
|
6073
|
-
});
|
|
6074
|
-
}
|
|
6075
|
-
return entries;
|
|
5877
|
+
return {
|
|
5878
|
+
id,
|
|
5879
|
+
label,
|
|
5880
|
+
path,
|
|
5881
|
+
field,
|
|
5882
|
+
editField,
|
|
5883
|
+
component: SimpleStringComponent,
|
|
5884
|
+
isEdited: isEdited$1
|
|
5885
|
+
};
|
|
6076
5886
|
}
|
|
6077
|
-
|
|
5887
|
+
const SimpleStringComponent = props => {
|
|
6078
5888
|
const {
|
|
6079
|
-
|
|
5889
|
+
id,
|
|
5890
|
+
label,
|
|
5891
|
+
path,
|
|
6080
5892
|
field,
|
|
6081
|
-
|
|
5893
|
+
editField
|
|
6082
5894
|
} = props;
|
|
6083
5895
|
const debounce = useService('debounce');
|
|
6084
|
-
const
|
|
6085
|
-
const
|
|
6086
|
-
return minDash.get(field, path, '');
|
|
6087
|
-
};
|
|
6088
|
-
const setValue = value => {
|
|
6089
|
-
return editField(field, path, value);
|
|
6090
|
-
};
|
|
5896
|
+
const getValue = () => minDash.get(field, path, '');
|
|
5897
|
+
const setValue = value => editField(field, path, value);
|
|
6091
5898
|
return TextfieldEntry({
|
|
6092
5899
|
debounce,
|
|
6093
5900
|
element: field,
|
|
6094
5901
|
getValue,
|
|
6095
5902
|
id,
|
|
6096
|
-
label
|
|
5903
|
+
label,
|
|
6097
5904
|
setValue
|
|
6098
5905
|
});
|
|
5906
|
+
};
|
|
5907
|
+
|
|
5908
|
+
function LabelEntry(props) {
|
|
5909
|
+
const {
|
|
5910
|
+
field
|
|
5911
|
+
} = props;
|
|
5912
|
+
const {
|
|
5913
|
+
type,
|
|
5914
|
+
subtype
|
|
5915
|
+
} = field;
|
|
5916
|
+
const entries = [];
|
|
5917
|
+
if (type === 'datetime') {
|
|
5918
|
+
if (subtype === formJsViewer.DATETIME_SUBTYPES.DATE || subtype === formJsViewer.DATETIME_SUBTYPES.DATETIME) {
|
|
5919
|
+
entries.push(simpleStringEntryFactory({
|
|
5920
|
+
id: 'date-label',
|
|
5921
|
+
path: formJsViewer.DATE_LABEL_PATH,
|
|
5922
|
+
label: 'Date label',
|
|
5923
|
+
props
|
|
5924
|
+
}));
|
|
5925
|
+
}
|
|
5926
|
+
if (subtype === formJsViewer.DATETIME_SUBTYPES.TIME || subtype === formJsViewer.DATETIME_SUBTYPES.DATETIME) {
|
|
5927
|
+
entries.push(simpleStringEntryFactory({
|
|
5928
|
+
id: 'time-label',
|
|
5929
|
+
path: formJsViewer.TIME_LABEL_PATH,
|
|
5930
|
+
label: 'Time label',
|
|
5931
|
+
props
|
|
5932
|
+
}));
|
|
5933
|
+
}
|
|
5934
|
+
} else if (INPUTS.includes(type) || type === 'button') {
|
|
5935
|
+
entries.push(simpleStringEntryFactory({
|
|
5936
|
+
id: 'label',
|
|
5937
|
+
path: ['label'],
|
|
5938
|
+
label: 'Field label',
|
|
5939
|
+
props
|
|
5940
|
+
}));
|
|
5941
|
+
}
|
|
5942
|
+
return entries;
|
|
6099
5943
|
}
|
|
6100
5944
|
|
|
6101
5945
|
function SourceEntry(props) {
|
|
@@ -6156,17 +6000,16 @@ function TextEntry(props) {
|
|
|
6156
6000
|
const {
|
|
6157
6001
|
type
|
|
6158
6002
|
} = field;
|
|
6159
|
-
|
|
6160
|
-
|
|
6161
|
-
entries.push({
|
|
6162
|
-
id: 'text',
|
|
6163
|
-
component: Text,
|
|
6164
|
-
editField: editField,
|
|
6165
|
-
field: field,
|
|
6166
|
-
isEdited: isEdited$2
|
|
6167
|
-
});
|
|
6003
|
+
if (type !== 'text') {
|
|
6004
|
+
return [];
|
|
6168
6005
|
}
|
|
6169
|
-
return
|
|
6006
|
+
return [{
|
|
6007
|
+
id: 'text',
|
|
6008
|
+
component: Text,
|
|
6009
|
+
editField: editField,
|
|
6010
|
+
field: field,
|
|
6011
|
+
isEdited: isEdited$6
|
|
6012
|
+
}];
|
|
6170
6013
|
}
|
|
6171
6014
|
function Text(props) {
|
|
6172
6015
|
const {
|
|
@@ -6175,6 +6018,9 @@ function Text(props) {
|
|
|
6175
6018
|
id
|
|
6176
6019
|
} = props;
|
|
6177
6020
|
const debounce = useService('debounce');
|
|
6021
|
+
const variables = useVariables().map(name => ({
|
|
6022
|
+
name
|
|
6023
|
+
}));
|
|
6178
6024
|
const path = ['text'];
|
|
6179
6025
|
const getValue = () => {
|
|
6180
6026
|
return minDash.get(field, path, '');
|
|
@@ -6182,15 +6028,17 @@ function Text(props) {
|
|
|
6182
6028
|
const setValue = value => {
|
|
6183
6029
|
return editField(field, path, value);
|
|
6184
6030
|
};
|
|
6185
|
-
return
|
|
6031
|
+
return FeelTextArea({
|
|
6186
6032
|
debounce,
|
|
6187
|
-
description: 'Use Markdown or basic HTML to format.',
|
|
6033
|
+
description: 'Use an Expression, Markdown or basic HTML to format.',
|
|
6188
6034
|
element: field,
|
|
6035
|
+
feel: 'optional',
|
|
6189
6036
|
getValue,
|
|
6190
6037
|
id,
|
|
6191
6038
|
label: 'Text',
|
|
6192
6039
|
rows: 10,
|
|
6193
|
-
setValue
|
|
6040
|
+
setValue,
|
|
6041
|
+
variables
|
|
6194
6042
|
});
|
|
6195
6043
|
}
|
|
6196
6044
|
|
|
@@ -6283,8 +6131,7 @@ function NumberArrowStep(props) {
|
|
|
6283
6131
|
function NumberSerializationEntry(props) {
|
|
6284
6132
|
const {
|
|
6285
6133
|
editField,
|
|
6286
|
-
field
|
|
6287
|
-
id
|
|
6134
|
+
field
|
|
6288
6135
|
} = props;
|
|
6289
6136
|
const {
|
|
6290
6137
|
type
|
|
@@ -6294,7 +6141,7 @@ function NumberSerializationEntry(props) {
|
|
|
6294
6141
|
}
|
|
6295
6142
|
const entries = [];
|
|
6296
6143
|
entries.push({
|
|
6297
|
-
id:
|
|
6144
|
+
id: 'serialize-to-string',
|
|
6298
6145
|
component: SerializeToString,
|
|
6299
6146
|
isEdited: isEdited$7,
|
|
6300
6147
|
editField,
|
|
@@ -6332,6 +6179,243 @@ function SerializeToString(props) {
|
|
|
6332
6179
|
});
|
|
6333
6180
|
}
|
|
6334
6181
|
|
|
6182
|
+
function DateTimeEntry(props) {
|
|
6183
|
+
const {
|
|
6184
|
+
editField,
|
|
6185
|
+
field
|
|
6186
|
+
} = props;
|
|
6187
|
+
const {
|
|
6188
|
+
type,
|
|
6189
|
+
subtype
|
|
6190
|
+
} = field;
|
|
6191
|
+
if (type !== 'datetime') {
|
|
6192
|
+
return [];
|
|
6193
|
+
}
|
|
6194
|
+
const entries = [{
|
|
6195
|
+
id: 'subtype',
|
|
6196
|
+
component: DateTimeSubtypeSelect,
|
|
6197
|
+
isEdited: isEdited$4,
|
|
6198
|
+
editField,
|
|
6199
|
+
field
|
|
6200
|
+
}];
|
|
6201
|
+
if (subtype === formJsViewer.DATETIME_SUBTYPES.TIME || subtype === formJsViewer.DATETIME_SUBTYPES.DATETIME) {
|
|
6202
|
+
entries.push({
|
|
6203
|
+
id: 'use24h',
|
|
6204
|
+
component: Use24h,
|
|
6205
|
+
isEdited: isEdited$7,
|
|
6206
|
+
editField,
|
|
6207
|
+
field
|
|
6208
|
+
});
|
|
6209
|
+
}
|
|
6210
|
+
return entries;
|
|
6211
|
+
}
|
|
6212
|
+
function DateTimeSubtypeSelect(props) {
|
|
6213
|
+
const {
|
|
6214
|
+
editField,
|
|
6215
|
+
field,
|
|
6216
|
+
id
|
|
6217
|
+
} = props;
|
|
6218
|
+
const getValue = e => minDash.get(field, formJsViewer.DATETIME_SUBTYPE_PATH);
|
|
6219
|
+
const clearTimeConfig = () => {
|
|
6220
|
+
const timeConfigPaths = [formJsViewer.TIME_LABEL_PATH, formJsViewer.TIME_USE24H_PATH, formJsViewer.TIME_INTERVAL_PATH, formJsViewer.TIME_SERIALISING_FORMAT_PATH];
|
|
6221
|
+
for (const path of timeConfigPaths) {
|
|
6222
|
+
editField(field, path, undefined);
|
|
6223
|
+
}
|
|
6224
|
+
};
|
|
6225
|
+
const initTimeConfig = () => {
|
|
6226
|
+
editField(field, formJsViewer.TIME_LABEL_PATH, 'Time');
|
|
6227
|
+
editField(field, formJsViewer.TIME_SERIALISING_FORMAT_PATH, formJsViewer.TIME_SERIALISING_FORMATS.UTC_OFFSET);
|
|
6228
|
+
editField(field, formJsViewer.TIME_INTERVAL_PATH, 15);
|
|
6229
|
+
};
|
|
6230
|
+
const clearDateConfig = () => {
|
|
6231
|
+
const dateConfigPaths = [formJsViewer.DATE_LABEL_PATH, formJsViewer.DATE_DISALLOW_PAST_PATH];
|
|
6232
|
+
for (const path of dateConfigPaths) {
|
|
6233
|
+
editField(field, path, undefined);
|
|
6234
|
+
}
|
|
6235
|
+
};
|
|
6236
|
+
const initDateConfig = () => {
|
|
6237
|
+
editField(field, formJsViewer.DATE_LABEL_PATH, 'Date');
|
|
6238
|
+
};
|
|
6239
|
+
const setValue = value => {
|
|
6240
|
+
const oldValue = getValue();
|
|
6241
|
+
if (oldValue === value) return;
|
|
6242
|
+
if (value === formJsViewer.DATETIME_SUBTYPES.DATE) {
|
|
6243
|
+
clearTimeConfig();
|
|
6244
|
+
oldValue === formJsViewer.DATETIME_SUBTYPES.TIME && initDateConfig();
|
|
6245
|
+
} else if (value === formJsViewer.DATETIME_SUBTYPES.TIME) {
|
|
6246
|
+
clearDateConfig();
|
|
6247
|
+
oldValue === formJsViewer.DATETIME_SUBTYPES.DATE && initTimeConfig();
|
|
6248
|
+
} else if (value === formJsViewer.DATETIME_SUBTYPES.DATETIME) {
|
|
6249
|
+
oldValue === formJsViewer.DATETIME_SUBTYPES.DATE && initTimeConfig();
|
|
6250
|
+
oldValue === formJsViewer.DATETIME_SUBTYPES.TIME && initDateConfig();
|
|
6251
|
+
}
|
|
6252
|
+
return editField(field, formJsViewer.DATETIME_SUBTYPE_PATH, value);
|
|
6253
|
+
};
|
|
6254
|
+
const getDatetimeSubtypes = () => {
|
|
6255
|
+
return Object.values(formJsViewer.DATETIME_SUBTYPES).map(subtype => ({
|
|
6256
|
+
label: formJsViewer.DATETIME_SUBTYPES_LABELS[subtype],
|
|
6257
|
+
value: subtype
|
|
6258
|
+
}));
|
|
6259
|
+
};
|
|
6260
|
+
return SelectEntry({
|
|
6261
|
+
label: 'Subtype',
|
|
6262
|
+
element: field,
|
|
6263
|
+
getOptions: getDatetimeSubtypes,
|
|
6264
|
+
getValue,
|
|
6265
|
+
id,
|
|
6266
|
+
setValue
|
|
6267
|
+
});
|
|
6268
|
+
}
|
|
6269
|
+
function Use24h(props) {
|
|
6270
|
+
const {
|
|
6271
|
+
editField,
|
|
6272
|
+
field,
|
|
6273
|
+
id
|
|
6274
|
+
} = props;
|
|
6275
|
+
const path = formJsViewer.TIME_USE24H_PATH;
|
|
6276
|
+
const getValue = () => {
|
|
6277
|
+
return minDash.get(field, path, '');
|
|
6278
|
+
};
|
|
6279
|
+
const setValue = value => {
|
|
6280
|
+
return editField(field, path, value);
|
|
6281
|
+
};
|
|
6282
|
+
return CheckboxEntry({
|
|
6283
|
+
element: field,
|
|
6284
|
+
getValue,
|
|
6285
|
+
id,
|
|
6286
|
+
label: 'Use 24h',
|
|
6287
|
+
setValue
|
|
6288
|
+
});
|
|
6289
|
+
}
|
|
6290
|
+
|
|
6291
|
+
function DateTimeConstraintsEntry(props) {
|
|
6292
|
+
const {
|
|
6293
|
+
editField,
|
|
6294
|
+
field,
|
|
6295
|
+
id
|
|
6296
|
+
} = props;
|
|
6297
|
+
const {
|
|
6298
|
+
type,
|
|
6299
|
+
subtype
|
|
6300
|
+
} = field;
|
|
6301
|
+
if (type !== 'datetime') {
|
|
6302
|
+
return [];
|
|
6303
|
+
}
|
|
6304
|
+
const entries = [];
|
|
6305
|
+
if (subtype === formJsViewer.DATETIME_SUBTYPES.TIME || subtype === formJsViewer.DATETIME_SUBTYPES.DATETIME) {
|
|
6306
|
+
entries.push({
|
|
6307
|
+
id: id + '-timeInterval',
|
|
6308
|
+
component: TimeIntervalSelect,
|
|
6309
|
+
isEdited: isEdited$4,
|
|
6310
|
+
editField,
|
|
6311
|
+
field
|
|
6312
|
+
});
|
|
6313
|
+
}
|
|
6314
|
+
if (subtype === formJsViewer.DATETIME_SUBTYPES.DATE || subtype === formJsViewer.DATETIME_SUBTYPES.DATETIME) {
|
|
6315
|
+
entries.push({
|
|
6316
|
+
id: id + '-disallowPassedDates',
|
|
6317
|
+
component: DisallowPassedDates,
|
|
6318
|
+
isEdited: isEdited$7,
|
|
6319
|
+
editField,
|
|
6320
|
+
field
|
|
6321
|
+
});
|
|
6322
|
+
}
|
|
6323
|
+
return entries;
|
|
6324
|
+
}
|
|
6325
|
+
function DisallowPassedDates(props) {
|
|
6326
|
+
const {
|
|
6327
|
+
editField,
|
|
6328
|
+
field,
|
|
6329
|
+
id
|
|
6330
|
+
} = props;
|
|
6331
|
+
const path = formJsViewer.DATE_DISALLOW_PAST_PATH;
|
|
6332
|
+
const getValue = () => {
|
|
6333
|
+
return minDash.get(field, path, '');
|
|
6334
|
+
};
|
|
6335
|
+
const setValue = value => {
|
|
6336
|
+
return editField(field, path, value);
|
|
6337
|
+
};
|
|
6338
|
+
return CheckboxEntry({
|
|
6339
|
+
element: field,
|
|
6340
|
+
getValue,
|
|
6341
|
+
id,
|
|
6342
|
+
label: 'Disallow past dates',
|
|
6343
|
+
setValue
|
|
6344
|
+
});
|
|
6345
|
+
}
|
|
6346
|
+
function TimeIntervalSelect(props) {
|
|
6347
|
+
const {
|
|
6348
|
+
editField,
|
|
6349
|
+
field,
|
|
6350
|
+
id
|
|
6351
|
+
} = props;
|
|
6352
|
+
const timeIntervals = [1, 5, 10, 15, 30, 60];
|
|
6353
|
+
const getValue = e => minDash.get(field, formJsViewer.TIME_INTERVAL_PATH);
|
|
6354
|
+
const setValue = value => editField(field, formJsViewer.TIME_INTERVAL_PATH, parseInt(value));
|
|
6355
|
+
const getTimeIntervals = () => {
|
|
6356
|
+
return timeIntervals.map(timeInterval => ({
|
|
6357
|
+
label: timeInterval === 60 ? '1h' : timeInterval + 'm',
|
|
6358
|
+
value: timeInterval
|
|
6359
|
+
}));
|
|
6360
|
+
};
|
|
6361
|
+
return SelectEntry({
|
|
6362
|
+
label: 'Time interval',
|
|
6363
|
+
element: field,
|
|
6364
|
+
getOptions: getTimeIntervals,
|
|
6365
|
+
getValue,
|
|
6366
|
+
id,
|
|
6367
|
+
setValue
|
|
6368
|
+
});
|
|
6369
|
+
}
|
|
6370
|
+
|
|
6371
|
+
function DateTimeFormatEntry(props) {
|
|
6372
|
+
const {
|
|
6373
|
+
editField,
|
|
6374
|
+
field
|
|
6375
|
+
} = props;
|
|
6376
|
+
const {
|
|
6377
|
+
type,
|
|
6378
|
+
subtype
|
|
6379
|
+
} = field;
|
|
6380
|
+
if (type !== 'datetime') {
|
|
6381
|
+
return [];
|
|
6382
|
+
}
|
|
6383
|
+
const entries = [];
|
|
6384
|
+
if (subtype === formJsViewer.DATETIME_SUBTYPES.TIME || subtype === formJsViewer.DATETIME_SUBTYPES.DATETIME) {
|
|
6385
|
+
entries.push({
|
|
6386
|
+
id: 'time-format',
|
|
6387
|
+
component: TimeFormatSelect,
|
|
6388
|
+
isEdited: isEdited$4,
|
|
6389
|
+
editField,
|
|
6390
|
+
field
|
|
6391
|
+
});
|
|
6392
|
+
}
|
|
6393
|
+
return entries;
|
|
6394
|
+
}
|
|
6395
|
+
function TimeFormatSelect(props) {
|
|
6396
|
+
const {
|
|
6397
|
+
editField,
|
|
6398
|
+
field,
|
|
6399
|
+
id
|
|
6400
|
+
} = props;
|
|
6401
|
+
const getValue = e => minDash.get(field, formJsViewer.TIME_SERIALISING_FORMAT_PATH);
|
|
6402
|
+
const setValue = value => editField(field, formJsViewer.TIME_SERIALISING_FORMAT_PATH, value);
|
|
6403
|
+
const getTimeSerialisingFormats = () => {
|
|
6404
|
+
return Object.values(formJsViewer.TIME_SERIALISING_FORMATS).map(format => ({
|
|
6405
|
+
label: formJsViewer.TIME_SERIALISINGFORMAT_LABELS[format],
|
|
6406
|
+
value: format
|
|
6407
|
+
}));
|
|
6408
|
+
};
|
|
6409
|
+
return SelectEntry({
|
|
6410
|
+
label: 'Time format',
|
|
6411
|
+
element: field,
|
|
6412
|
+
getOptions: getTimeSerialisingFormats,
|
|
6413
|
+
getValue,
|
|
6414
|
+
id,
|
|
6415
|
+
setValue
|
|
6416
|
+
});
|
|
6417
|
+
}
|
|
6418
|
+
|
|
6335
6419
|
function ValueEntry(props) {
|
|
6336
6420
|
const {
|
|
6337
6421
|
editField,
|
|
@@ -6533,37 +6617,6 @@ function updateKey(properties, oldKey, newKey) {
|
|
|
6533
6617
|
}, {});
|
|
6534
6618
|
}
|
|
6535
6619
|
|
|
6536
|
-
// config ///////////////////
|
|
6537
|
-
|
|
6538
|
-
const VALUES_SOURCES = {
|
|
6539
|
-
STATIC: 'static',
|
|
6540
|
-
INPUT: 'input'
|
|
6541
|
-
};
|
|
6542
|
-
const VALUES_SOURCE_DEFAULT = VALUES_SOURCES.STATIC;
|
|
6543
|
-
const VALUES_SOURCES_LABELS = {
|
|
6544
|
-
[VALUES_SOURCES.STATIC]: 'Static',
|
|
6545
|
-
[VALUES_SOURCES.INPUT]: 'Input data'
|
|
6546
|
-
};
|
|
6547
|
-
const VALUES_SOURCES_PATHS = {
|
|
6548
|
-
[VALUES_SOURCES.STATIC]: ['values'],
|
|
6549
|
-
[VALUES_SOURCES.INPUT]: ['valuesKey']
|
|
6550
|
-
};
|
|
6551
|
-
const VALUES_SOURCES_DEFAULTS = {
|
|
6552
|
-
[VALUES_SOURCES.STATIC]: [],
|
|
6553
|
-
[VALUES_SOURCES.INPUT]: ''
|
|
6554
|
-
};
|
|
6555
|
-
|
|
6556
|
-
// helpers ///////////////////
|
|
6557
|
-
|
|
6558
|
-
function getValuesSource(field) {
|
|
6559
|
-
for (const source of Object.values(VALUES_SOURCES)) {
|
|
6560
|
-
if (minDash.get(field, VALUES_SOURCES_PATHS[source]) !== undefined) {
|
|
6561
|
-
return source;
|
|
6562
|
-
}
|
|
6563
|
-
}
|
|
6564
|
-
return VALUES_SOURCE_DEFAULT;
|
|
6565
|
-
}
|
|
6566
|
-
|
|
6567
6620
|
function ValuesSourceSelectEntry(props) {
|
|
6568
6621
|
const {
|
|
6569
6622
|
editField,
|
|
@@ -6584,21 +6637,21 @@ function ValuesSourceSelect(props) {
|
|
|
6584
6637
|
field,
|
|
6585
6638
|
id
|
|
6586
6639
|
} = props;
|
|
6587
|
-
const getValue = getValuesSource;
|
|
6640
|
+
const getValue = formJsViewer.getValuesSource;
|
|
6588
6641
|
const setValue = value => {
|
|
6589
6642
|
let newField = field;
|
|
6590
6643
|
const newProperties = {};
|
|
6591
|
-
Object.values(VALUES_SOURCES).forEach(source => {
|
|
6644
|
+
Object.values(formJsViewer.VALUES_SOURCES).forEach(source => {
|
|
6592
6645
|
// Clear all values source definitions and default the newly selected one
|
|
6593
|
-
const newValue = value === source ? VALUES_SOURCES_DEFAULTS[source] : undefined;
|
|
6594
|
-
newProperties[VALUES_SOURCES_PATHS[source]] = newValue;
|
|
6646
|
+
const newValue = value === source ? formJsViewer.VALUES_SOURCES_DEFAULTS[source] : undefined;
|
|
6647
|
+
newProperties[formJsViewer.VALUES_SOURCES_PATHS[source]] = newValue;
|
|
6595
6648
|
});
|
|
6596
6649
|
newField = editField(field, newProperties);
|
|
6597
6650
|
return newField;
|
|
6598
6651
|
};
|
|
6599
6652
|
const getValuesSourceOptions = () => {
|
|
6600
|
-
return Object.values(VALUES_SOURCES).map(valueSource => ({
|
|
6601
|
-
label: VALUES_SOURCES_LABELS[valueSource],
|
|
6653
|
+
return Object.values(formJsViewer.VALUES_SOURCES).map(valueSource => ({
|
|
6654
|
+
label: formJsViewer.VALUES_SOURCES_LABELS[valueSource],
|
|
6602
6655
|
value: valueSource
|
|
6603
6656
|
}));
|
|
6604
6657
|
};
|
|
@@ -6637,7 +6690,7 @@ function InputValuesKey(props) {
|
|
|
6637
6690
|
description
|
|
6638
6691
|
} = props;
|
|
6639
6692
|
const debounce = useService('debounce');
|
|
6640
|
-
const path = VALUES_SOURCES_PATHS[VALUES_SOURCES.INPUT];
|
|
6693
|
+
const path = formJsViewer.VALUES_SOURCES_PATHS[formJsViewer.VALUES_SOURCES.INPUT];
|
|
6641
6694
|
const getValue = () => minDash.get(field, path, '');
|
|
6642
6695
|
const setValue = value => editField(field, path, value || '');
|
|
6643
6696
|
const validate = value => {
|
|
@@ -6674,10 +6727,10 @@ function StaticValuesSourceEntry(props) {
|
|
|
6674
6727
|
e.stopPropagation();
|
|
6675
6728
|
const index = values.length + 1;
|
|
6676
6729
|
const entry = getIndexedEntry(index);
|
|
6677
|
-
editField(field, VALUES_SOURCES_PATHS[VALUES_SOURCES.STATIC], arrayAdd(values, values.length, entry));
|
|
6730
|
+
editField(field, formJsViewer.VALUES_SOURCES_PATHS[formJsViewer.VALUES_SOURCES.STATIC], arrayAdd(values, values.length, entry));
|
|
6678
6731
|
};
|
|
6679
6732
|
const removeEntry = entry => {
|
|
6680
|
-
editField(field, VALUES_SOURCES_PATHS[VALUES_SOURCES.STATIC], minDash.without(values, entry));
|
|
6733
|
+
editField(field, formJsViewer.VALUES_SOURCES_PATHS[formJsViewer.VALUES_SOURCES.STATIC], minDash.without(values, entry));
|
|
6681
6734
|
};
|
|
6682
6735
|
const validateFactory = key => {
|
|
6683
6736
|
return value => {
|
|
@@ -6730,6 +6783,83 @@ function getIndexedEntry(index) {
|
|
|
6730
6783
|
return entry;
|
|
6731
6784
|
}
|
|
6732
6785
|
|
|
6786
|
+
function AdornerEntry(props) {
|
|
6787
|
+
const {
|
|
6788
|
+
editField,
|
|
6789
|
+
field
|
|
6790
|
+
} = props;
|
|
6791
|
+
const {
|
|
6792
|
+
type
|
|
6793
|
+
} = field;
|
|
6794
|
+
const entries = [];
|
|
6795
|
+
const onChange = key => {
|
|
6796
|
+
return value => {
|
|
6797
|
+
const appearance = minDash.get(field, ['appearance'], {});
|
|
6798
|
+
editField(field, ['appearance'], minDash.set(appearance, [key], value));
|
|
6799
|
+
};
|
|
6800
|
+
};
|
|
6801
|
+
const getValue = key => {
|
|
6802
|
+
return () => {
|
|
6803
|
+
return minDash.get(field, ['appearance', key]);
|
|
6804
|
+
};
|
|
6805
|
+
};
|
|
6806
|
+
if (['number', 'textfield'].includes(type)) {
|
|
6807
|
+
entries.push({
|
|
6808
|
+
id: 'prefix-adorner',
|
|
6809
|
+
component: PrefixAdorner,
|
|
6810
|
+
isEdited: isEdited$1,
|
|
6811
|
+
editField,
|
|
6812
|
+
field,
|
|
6813
|
+
onChange,
|
|
6814
|
+
getValue
|
|
6815
|
+
});
|
|
6816
|
+
entries.push({
|
|
6817
|
+
id: 'suffix-adorner',
|
|
6818
|
+
component: SuffixAdorner,
|
|
6819
|
+
isEdited: isEdited$1,
|
|
6820
|
+
editField,
|
|
6821
|
+
field,
|
|
6822
|
+
onChange,
|
|
6823
|
+
getValue
|
|
6824
|
+
});
|
|
6825
|
+
}
|
|
6826
|
+
return entries;
|
|
6827
|
+
}
|
|
6828
|
+
function PrefixAdorner(props) {
|
|
6829
|
+
const {
|
|
6830
|
+
field,
|
|
6831
|
+
id,
|
|
6832
|
+
onChange,
|
|
6833
|
+
getValue
|
|
6834
|
+
} = props;
|
|
6835
|
+
const debounce = useService('debounce');
|
|
6836
|
+
return TextfieldEntry({
|
|
6837
|
+
debounce,
|
|
6838
|
+
element: field,
|
|
6839
|
+
getValue: getValue('prefixAdorner'),
|
|
6840
|
+
id,
|
|
6841
|
+
label: 'Prefix',
|
|
6842
|
+
setValue: onChange('prefixAdorner')
|
|
6843
|
+
});
|
|
6844
|
+
}
|
|
6845
|
+
function SuffixAdorner(props) {
|
|
6846
|
+
const {
|
|
6847
|
+
field,
|
|
6848
|
+
id,
|
|
6849
|
+
onChange,
|
|
6850
|
+
getValue
|
|
6851
|
+
} = props;
|
|
6852
|
+
const debounce = useService('debounce');
|
|
6853
|
+
return TextfieldEntry({
|
|
6854
|
+
debounce,
|
|
6855
|
+
element: field,
|
|
6856
|
+
getValue: getValue('suffixAdorner'),
|
|
6857
|
+
id,
|
|
6858
|
+
label: 'Suffix',
|
|
6859
|
+
setValue: onChange('suffixAdorner')
|
|
6860
|
+
});
|
|
6861
|
+
}
|
|
6862
|
+
|
|
6733
6863
|
function ConditionEntry(props) {
|
|
6734
6864
|
const {
|
|
6735
6865
|
editField,
|
|
@@ -6800,6 +6930,9 @@ function GeneralGroup(field, editField) {
|
|
|
6800
6930
|
}), ...ColumnsEntry({
|
|
6801
6931
|
field,
|
|
6802
6932
|
editField
|
|
6933
|
+
}), ...DateTimeEntry({
|
|
6934
|
+
field,
|
|
6935
|
+
editField
|
|
6803
6936
|
}), ...TextEntry({
|
|
6804
6937
|
field,
|
|
6805
6938
|
editField
|
|
@@ -6827,6 +6960,9 @@ function SerializationGroup(field, editField) {
|
|
|
6827
6960
|
const entries = [...NumberSerializationEntry({
|
|
6828
6961
|
field,
|
|
6829
6962
|
editField
|
|
6963
|
+
}), ...DateTimeFormatEntry({
|
|
6964
|
+
field,
|
|
6965
|
+
editField
|
|
6830
6966
|
})];
|
|
6831
6967
|
if (!entries.length) {
|
|
6832
6968
|
return null;
|
|
@@ -6838,6 +6974,21 @@ function SerializationGroup(field, editField) {
|
|
|
6838
6974
|
};
|
|
6839
6975
|
}
|
|
6840
6976
|
|
|
6977
|
+
function ConstraintsGroup(field, editField) {
|
|
6978
|
+
const entries = [...DateTimeConstraintsEntry({
|
|
6979
|
+
field,
|
|
6980
|
+
editField
|
|
6981
|
+
})];
|
|
6982
|
+
if (!entries.length) {
|
|
6983
|
+
return null;
|
|
6984
|
+
}
|
|
6985
|
+
return {
|
|
6986
|
+
id: 'constraints',
|
|
6987
|
+
label: 'Constraints',
|
|
6988
|
+
entries
|
|
6989
|
+
};
|
|
6990
|
+
}
|
|
6991
|
+
|
|
6841
6992
|
const VALIDATION_TYPE_OPTIONS = {
|
|
6842
6993
|
custom: {
|
|
6843
6994
|
value: 'custom',
|
|
@@ -7091,8 +7242,8 @@ function ValuesGroups(field, editField) {
|
|
|
7091
7242
|
id: valuesSourceId
|
|
7092
7243
|
})
|
|
7093
7244
|
}];
|
|
7094
|
-
const valuesSource = getValuesSource(field);
|
|
7095
|
-
if (valuesSource === VALUES_SOURCES.INPUT) {
|
|
7245
|
+
const valuesSource = formJsViewer.getValuesSource(field);
|
|
7246
|
+
if (valuesSource === formJsViewer.VALUES_SOURCES.INPUT) {
|
|
7096
7247
|
const dynamicValuesId = `${fieldId}-dynamicValues`;
|
|
7097
7248
|
groups.push({
|
|
7098
7249
|
id: dynamicValuesId,
|
|
@@ -7103,7 +7254,7 @@ function ValuesGroups(field, editField) {
|
|
|
7103
7254
|
id: dynamicValuesId
|
|
7104
7255
|
})
|
|
7105
7256
|
});
|
|
7106
|
-
} else if (valuesSource === VALUES_SOURCES.STATIC) {
|
|
7257
|
+
} else if (valuesSource === formJsViewer.VALUES_SOURCES.STATIC) {
|
|
7107
7258
|
const staticValuesId = `${fieldId}-staticValues`;
|
|
7108
7259
|
groups.push({
|
|
7109
7260
|
id: staticValuesId,
|
|
@@ -7202,6 +7353,21 @@ function removeKey(properties, oldKey) {
|
|
|
7202
7353
|
}, {});
|
|
7203
7354
|
}
|
|
7204
7355
|
|
|
7356
|
+
function AppearanceGroup(field, editField) {
|
|
7357
|
+
const entries = [...AdornerEntry({
|
|
7358
|
+
field,
|
|
7359
|
+
editField
|
|
7360
|
+
})];
|
|
7361
|
+
if (!entries.length) {
|
|
7362
|
+
return null;
|
|
7363
|
+
}
|
|
7364
|
+
return {
|
|
7365
|
+
id: 'appearance',
|
|
7366
|
+
label: 'Appearance',
|
|
7367
|
+
entries
|
|
7368
|
+
};
|
|
7369
|
+
}
|
|
7370
|
+
|
|
7205
7371
|
function ConditionGroup(field, editField) {
|
|
7206
7372
|
const {
|
|
7207
7373
|
type
|
|
@@ -7224,7 +7390,7 @@ function getGroups(field, editField) {
|
|
|
7224
7390
|
if (!field) {
|
|
7225
7391
|
return [];
|
|
7226
7392
|
}
|
|
7227
|
-
const groups = [GeneralGroup(field, editField), ConditionGroup(field, editField), SerializationGroup(field, editField), ...ValuesGroups(field, editField), ValidationGroup(field, editField), CustomValuesGroup(field, editField)];
|
|
7393
|
+
const groups = [GeneralGroup(field, editField), ConditionGroup(field, editField), AppearanceGroup(field, editField), SerializationGroup(field, editField), ...ValuesGroups(field, editField), ConstraintsGroup(field, editField), ValidationGroup(field, editField), CustomValuesGroup(field, editField)];
|
|
7228
7394
|
|
|
7229
7395
|
// contract: if a group returns null, it should not be displayed at all
|
|
7230
7396
|
return groups.filter(group => group !== null);
|