ywana-core8 0.0.391 → 0.0.394
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 +40 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +24 -5
- package/dist/index.css.map +1 -1
- package/dist/index.modern.js +40 -13
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +44 -16
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -2
- package/src/domain/ContentEditor.js +1 -1
- package/src/html/color.css +18 -0
- package/src/html/color.js +8 -6
- package/src/html/color.test.js +1 -1
- package/src/html/textfield.js +11 -10
- package/src/html/textfield.test.js +2 -1
- package/src/html/tokenfield.css +6 -5
- package/src/html/tokenfield.js +19 -7
- package/src/html/color1.css +0 -3
package/dist/index.cjs
CHANGED
@@ -6,7 +6,6 @@ var momentRange = require('moment-range');
|
|
6
6
|
var ResumableJS = require('resumablejs');
|
7
7
|
var reactNotificationsComponent = require('react-notifications-component');
|
8
8
|
require('react-notifications-component/dist/theme.css');
|
9
|
-
var reactColor = require('react-color');
|
10
9
|
var equal = require('deep-equal');
|
11
10
|
|
12
11
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
@@ -1088,7 +1087,10 @@ var DropDown = function DropDown(props) {
|
|
1088
1087
|
_props$predictive = props.predictive,
|
1089
1088
|
predictive = _props$predictive === void 0 ? false : _props$predictive,
|
1090
1089
|
_props$readOnly3 = props.readOnly,
|
1091
|
-
readOnly = _props$readOnly3 === void 0 ? false : _props$readOnly3
|
1090
|
+
readOnly = _props$readOnly3 === void 0 ? false : _props$readOnly3,
|
1091
|
+
_props$verbose = props.verbose,
|
1092
|
+
verbose = _props$verbose === void 0 ? true : _props$verbose,
|
1093
|
+
onBlur = props.onBlur;
|
1092
1094
|
|
1093
1095
|
var _useState = React.useState(false),
|
1094
1096
|
open = _useState[0],
|
@@ -1099,6 +1101,8 @@ var DropDown = function DropDown(props) {
|
|
1099
1101
|
setLabel = _useState2[1];
|
1100
1102
|
|
1101
1103
|
React.useEffect(function () {
|
1104
|
+
console.log('DD change value', label);
|
1105
|
+
|
1102
1106
|
if (Array.isArray(options)) {
|
1103
1107
|
var option = options.find(function (option) {
|
1104
1108
|
return option.value === value;
|
@@ -1135,14 +1139,14 @@ var DropDown = function DropDown(props) {
|
|
1135
1139
|
var option = options.find(function (option) {
|
1136
1140
|
return option.value === next;
|
1137
1141
|
});
|
1138
|
-
if (onChange) onChange(id, next);
|
1139
|
-
setLabel(option.label);
|
1140
1142
|
setOpen(false);
|
1143
|
+
var label = verbose ? option.label : "";
|
1144
|
+
setLabel(label);
|
1145
|
+
if (onChange) onChange(id, next);
|
1141
1146
|
}
|
1142
1147
|
|
1143
1148
|
function blur() {
|
1144
|
-
|
1145
|
-
site.clearFocus();
|
1149
|
+
if (onBlur) onBlur();
|
1146
1150
|
}
|
1147
1151
|
|
1148
1152
|
function renderOptions() {
|
@@ -1889,6 +1893,7 @@ var TokenField = function TokenField(_ref) {
|
|
1889
1893
|
_ref$init = _ref.init,
|
1890
1894
|
init = _ref$init === void 0 ? [] : _ref$init,
|
1891
1895
|
readOnly = _ref.readOnly,
|
1896
|
+
options = _ref.options,
|
1892
1897
|
onChange = _ref.onChange;
|
1893
1898
|
var mounted = React.useRef(false);
|
1894
1899
|
|
@@ -1900,6 +1905,8 @@ var TokenField = function TokenField(_ref) {
|
|
1900
1905
|
tokens = _useState2[0],
|
1901
1906
|
setTokens = _useState2[1];
|
1902
1907
|
|
1908
|
+
React.useState(false);
|
1909
|
+
|
1903
1910
|
React.useEffect(function () {
|
1904
1911
|
if (mounted.current) {
|
1905
1912
|
if (onChange) {
|
@@ -1921,6 +1928,12 @@ var TokenField = function TokenField(_ref) {
|
|
1921
1928
|
setValue(value);
|
1922
1929
|
}
|
1923
1930
|
|
1931
|
+
function changeDropDown(id, value) {
|
1932
|
+
var next = tokens.concat(value);
|
1933
|
+
setTokens(next);
|
1934
|
+
setValue('xxx');
|
1935
|
+
}
|
1936
|
+
|
1924
1937
|
function onEnter(event) {
|
1925
1938
|
if (event.key === 'Enter') {
|
1926
1939
|
event.preventDefault();
|
@@ -1947,7 +1960,12 @@ var TokenField = function TokenField(_ref) {
|
|
1947
1960
|
return remove(index);
|
1948
1961
|
}
|
1949
1962
|
});
|
1950
|
-
}), /*#__PURE__*/React__default["default"].createElement(
|
1963
|
+
}), options ? /*#__PURE__*/React__default["default"].createElement(DropDown, {
|
1964
|
+
onChange: changeDropDown,
|
1965
|
+
options: options,
|
1966
|
+
predictive: true,
|
1967
|
+
verbose: false
|
1968
|
+
}) : /*#__PURE__*/React__default["default"].createElement("input", {
|
1951
1969
|
type: "text",
|
1952
1970
|
value: value,
|
1953
1971
|
onChange: change,
|
@@ -3724,17 +3742,25 @@ var NumberField = function NumberField(_ref3) {
|
|
3724
3742
|
|
3725
3743
|
var ColorField = function ColorField(props) {
|
3726
3744
|
var id = props.id,
|
3745
|
+
_props$label = props.label,
|
3746
|
+
label = _props$label === void 0 ? "Color" : _props$label,
|
3747
|
+
value = props.value,
|
3727
3748
|
onChange = props.onChange;
|
3728
3749
|
|
3729
|
-
function change(
|
3730
|
-
|
3750
|
+
function change(event) {
|
3751
|
+
var color = event.target.value;
|
3752
|
+
if (onChange) onChange(id, color);
|
3731
3753
|
}
|
3732
3754
|
|
3733
3755
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
3734
3756
|
className: "color-field"
|
3735
|
-
}, /*#__PURE__*/React__default["default"].createElement(
|
3736
|
-
|
3737
|
-
|
3757
|
+
}, /*#__PURE__*/React__default["default"].createElement("label", {
|
3758
|
+
"for": id
|
3759
|
+
}, label), /*#__PURE__*/React__default["default"].createElement("input", {
|
3760
|
+
id: id,
|
3761
|
+
type: "color",
|
3762
|
+
onChange: change,
|
3763
|
+
value: value
|
3738
3764
|
}));
|
3739
3765
|
};
|
3740
3766
|
|
@@ -4097,7 +4123,8 @@ var StringEditor = function StringEditor(_ref6) {
|
|
4097
4123
|
case FORMATS.COLOR:
|
4098
4124
|
return /*#__PURE__*/React__default["default"].createElement(ColorField, {
|
4099
4125
|
id: id,
|
4100
|
-
onChange: change
|
4126
|
+
onChange: change,
|
4127
|
+
value: value
|
4101
4128
|
});
|
4102
4129
|
|
4103
4130
|
case FORMATS.HTML:
|