ywana-core8 0.0.417 → 0.0.418
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 +9 -25
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +10 -26
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +9 -25
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/ContentEditor.js +2 -2
- package/src/domain/ContentEditor.test.js +1 -2
- package/src/html/tokenfield.js +7 -18
package/dist/index.cjs
CHANGED
@@ -1898,37 +1898,22 @@ var StringCellEditor = function StringCellEditor(_ref8) {
|
|
1898
1898
|
var TokenField = function TokenField(_ref) {
|
1899
1899
|
var id = _ref.id,
|
1900
1900
|
label = _ref.label,
|
1901
|
-
_ref$
|
1902
|
-
|
1901
|
+
_ref$tokens = _ref.tokens,
|
1902
|
+
tokens = _ref$tokens === void 0 ? [] : _ref$tokens,
|
1903
1903
|
readOnly = _ref.readOnly,
|
1904
1904
|
options = _ref.options,
|
1905
1905
|
onChange = _ref.onChange;
|
1906
|
-
var mounted = React.useRef(false);
|
1907
1906
|
|
1908
1907
|
var _useState = React.useState(),
|
1909
1908
|
value = _useState[0],
|
1910
1909
|
setValue = _useState[1];
|
1911
1910
|
|
1912
|
-
var _useState2 = React.useState(init),
|
1913
|
-
tokens = _useState2[0],
|
1914
|
-
setTokens = _useState2[1];
|
1915
|
-
|
1916
1911
|
React.useState(false);
|
1917
1912
|
|
1918
|
-
React.useEffect(function () {
|
1919
|
-
if (mounted.current) {
|
1920
|
-
if (onChange) {
|
1921
|
-
if (tokens) onChange(id, tokens);
|
1922
|
-
}
|
1923
|
-
} else {
|
1924
|
-
mounted.current = true;
|
1925
|
-
}
|
1926
|
-
}, [tokens]);
|
1927
|
-
|
1928
1913
|
function remove(index) {
|
1929
1914
|
var next = tokens.slice();
|
1930
1915
|
next.splice(index, 1);
|
1931
|
-
|
1916
|
+
if (onChange) onChange(id, next);
|
1932
1917
|
}
|
1933
1918
|
|
1934
1919
|
function change(event) {
|
@@ -1936,10 +1921,10 @@ var TokenField = function TokenField(_ref) {
|
|
1936
1921
|
setValue(value);
|
1937
1922
|
}
|
1938
1923
|
|
1939
|
-
function changeDropDown(
|
1924
|
+
function changeDropDown(fid, value) {
|
1940
1925
|
var next = tokens.concat(value);
|
1941
|
-
|
1942
|
-
setValue('
|
1926
|
+
if (onChange) onChange(id, next);
|
1927
|
+
setValue('');
|
1943
1928
|
}
|
1944
1929
|
|
1945
1930
|
function onEnter(event) {
|
@@ -1948,7 +1933,7 @@ var TokenField = function TokenField(_ref) {
|
|
1948
1933
|
event.stopPropagation();
|
1949
1934
|
var token = event.target.value;
|
1950
1935
|
var next = tokens.concat(token);
|
1951
|
-
|
1936
|
+
if (onChange) onChange(id, next);
|
1952
1937
|
setValue('');
|
1953
1938
|
}
|
1954
1939
|
|
@@ -4118,6 +4103,7 @@ var StringEditor = function StringEditor(_ref6) {
|
|
4118
4103
|
Editor = field.Editor;
|
4119
4104
|
|
4120
4105
|
function change(id, value) {
|
4106
|
+
console.log(id, value);
|
4121
4107
|
if (onChange) onChange(id, value);
|
4122
4108
|
}
|
4123
4109
|
|
@@ -4155,14 +4141,12 @@ var StringEditor = function StringEditor(_ref6) {
|
|
4155
4141
|
});
|
4156
4142
|
|
4157
4143
|
case FORMATS.TOKENS:
|
4158
|
-
var init = Array.isArray(value) ? value : [];
|
4159
4144
|
return /*#__PURE__*/React__default["default"].createElement(TokenField, {
|
4160
4145
|
id: id,
|
4161
4146
|
label: label,
|
4162
4147
|
onChange: change,
|
4163
|
-
readOnly: !editable,
|
4164
4148
|
options: buildOptions(),
|
4165
|
-
|
4149
|
+
tokens: value
|
4166
4150
|
});
|
4167
4151
|
|
4168
4152
|
default:
|