@crystaldesign/grid 24.12.0-beta.10 → 24.12.0-beta.16

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.
@@ -62,7 +62,7 @@ import { useHover, useLayer } from 'react-laag';
62
62
  import { ContentBoxComponent } from '@crystaldesign/content-box';
63
63
  import { NavigateBefore, NavigateNext } from '@material-ui/icons';
64
64
  import TextareaAutosize from '@material-ui/core/TextareaAutosize';
65
- import { Editor } from '@tinymce/tinymce-react';
65
+ import RTFEditor from '@crystaldesign/rtf-editor';
66
66
  import NumberFormat from 'react-number-format';
67
67
  import format from 'date-fns/format';
68
68
  import { enGB, fr, it, de } from 'date-fns/locale';
@@ -1939,18 +1939,16 @@ function Text(_ref3) {
1939
1939
  _useState8 = _slicedToArray(_useState7, 2),
1940
1940
  value = _useState8[0],
1941
1941
  setValue = _useState8[1];
1942
- var _useState9 = useState(valueOutside),
1943
- _useState10 = _slicedToArray(_useState9, 2),
1944
- tempRichText = _useState10[0],
1945
- setTempRichText = _useState10[1];
1946
- var _useDivaCore2 = useDivaCore(),
1947
- tinyMceApiKey = _useDivaCore2.state.tinyMceApiKey;
1948
1942
  useEffect(function () {
1949
1943
  setValueOutside(value);
1950
1944
  }, [value]);
1951
- useEffect(function () {
1952
- if (rich) setValue(tempRichText);
1953
- }, [curLangIndex]);
1945
+ function changeText(text) {
1946
+ if (translation) {
1947
+ setValue(_objectSpread$7(_objectSpread$7({}, value), {}, _defineProperty({}, languages[curLangIndex], text)));
1948
+ } else {
1949
+ setValue(text);
1950
+ }
1951
+ }
1954
1952
  return /*#__PURE__*/jsxs(Fragment, {
1955
1953
  children: [translation && /*#__PURE__*/jsx(TranslationSelector, {
1956
1954
  state: [curLangIndex, setLang],
@@ -1974,28 +1972,9 @@ function Text(_ref3) {
1974
1972
  fontSize: 'inherit',
1975
1973
  overflow: 'auto'
1976
1974
  }
1977
- }, curLangIndex), rich && /*#__PURE__*/jsx(Editor, {
1978
- apiKey: tinyMceApiKey,
1975
+ }, curLangIndex), rich && /*#__PURE__*/jsx(RTFEditor, {
1979
1976
  initialValue: translation ? value[languages[curLangIndex]] : value,
1980
- onChange: function onChange(e) {
1981
- if (translation) {
1982
- setTempRichText(_objectSpread$7(_objectSpread$7({}, value), {}, _defineProperty({}, languages[curLangIndex], e.target.getContent())));
1983
- } else setTempRichText(e.target.getContent());
1984
- },
1985
- onSubmit: function onSubmit(e) {
1986
- setValue(tempRichText);
1987
- },
1988
- textareaName: "text",
1989
- init: {
1990
- height: 500,
1991
- menubar: false,
1992
- plugins: ['advlist autolink lists link table paste'],
1993
- contextmenu: '',
1994
- resize: false,
1995
- statusbar: false,
1996
- toolbar: 'undo redo | formatselect | ' + 'bold italic backcolor | alignleft aligncenter ' + 'alignright alignjustify | bullist numlist outdent indent | table ',
1997
- content_style: 'body { font-family:Helvetica,Arial,sans-serif; font-size:14px }'
1998
- }
1977
+ onChange: changeText
1999
1978
  }, curLangIndex)]
2000
1979
  });
2001
1980
  }
@@ -1 +1 @@
1
- {"version":3,"file":"TextCell.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/cells/text/TextCell.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAQxC,MAAM,CAAC,OAAO,WAAW,CAAC,SAAS,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC,EAAE,GAAG,CAAC,eA4DlE"}
1
+ {"version":3,"file":"TextCell.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/cells/text/TextCell.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AASxC,MAAM,CAAC,OAAO,WAAW,CAAC,SAAS,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC,EAAE,GAAG,CAAC,eA4DlE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crystaldesign/grid",
3
- "version": "24.12.0-beta.10",
3
+ "version": "24.12.0-beta.16",
4
4
  "license": "COMMERCIAL",
5
5
  "devDependencies": {
6
6
  "@material-ui/pickers": "^3.2.10",
@@ -13,10 +13,10 @@
13
13
  "react-dom": "17.0.2"
14
14
  },
15
15
  "dependencies": {
16
- "@crystaldesign/searchfield": "24.12.0-beta.10",
16
+ "@crystaldesign/rtf-editor": "24.12.0-beta.16",
17
+ "@crystaldesign/searchfield": "24.12.0-beta.16",
17
18
  "@date-io/core": "^1.3.13",
18
19
  "@date-io/date-fns": "^1.3.13",
19
- "@tinymce/tinymce-react": "^3.13.0",
20
20
  "assign-deep": "^1.0.1",
21
21
  "classnames": "^2.2.6",
22
22
  "core-js-pure": "^3.0.1",
@@ -43,5 +43,5 @@
43
43
  },
44
44
  "module": "build/esm/index.js",
45
45
  "types": "./build/types/grid/src/index.d.ts",
46
- "gitHead": "ae2fba6651a64d9e9cc9e6f071382e8a6bb72329"
46
+ "gitHead": "c4637cc66f8e880e0a9a7f8d58ef21d7a8baf105"
47
47
  }