react-admin-base-bootstrap 0.7.6 → 0.7.7

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.
@@ -67,10 +67,7 @@ export function ActionsColumn() {
67
67
  export function Column(props) {
68
68
  const [params, setParams] = useContext(DataTableContext);
69
69
  const { sort } = props;
70
- return React.createElement("th", Object.assign({}, props, { style: props.sort && { cursor: 'pointer' }, onClick: props.sort && (() => setParams({
71
- sort: sort,
72
- desc: params.sort === sort ? !params.desc : true
73
- })) }),
70
+ return React.createElement("th", Object.assign({}, props, { style: props.sort && { cursor: 'pointer' }, onClick: props.sort && (() => setParams(params => (Object.assign(Object.assign({}, params), { sort: sort, desc: params.sort === sort ? !params.desc : true })))) }),
74
71
  props.children,
75
72
  " ",
76
73
  sort && params.sort && params.sort === sort ? params.desc ?
@@ -12,7 +12,7 @@ function BootstrapPasswordInput({ className, value, onChange, disabled, placehol
12
12
  const perfect = intl.formatMessage({ id: "PASSWORD_PERFECT" });
13
13
  const scoreWords = useMemo(() => [short, bad, okay, good, perfect], [short, bad, okay, good, perfect]);
14
14
  return React.createElement(React.Fragment, null,
15
- React.createElement(Input, { className: className, type: "password", value: value || '', onChange: a => onChange(a.currentTarget.value), disabled: disabled, placeholder: placeholder }),
15
+ React.createElement(Input, { className: className, type: "password", value: value || '', onChange: a => onChange(a.currentTarget.value), disabled: disabled, placeholder: placeholder, autoComplete: "new-password" }),
16
16
  React.createElement(PasswordStrengthBar, { className: "password-str-bar", password: value || '', scoreWords: scoreWords, shortScoreWord: short }));
17
17
  }
18
18
  export default function PasswordInput({ value, onChange, className, disabled, icon, required, placeholder }) {
@@ -35,5 +35,5 @@ export default function PasswordInput({ value, onChange, className, disabled, ic
35
35
  React.createElement(Label, null,
36
36
  React.createElement(FormattedMessage, { id: "PASSWORD_AGAIN" })),
37
37
  React.createElement(Validator, { name: "password2", type: [(required || value) && "required", { password: value || '' }].filter(a => !!a) },
38
- React.createElement(Input, { type: "password", value: password2 || '', onChange: a => setPassword2(a.currentTarget.value), disabled: disabled }))));
38
+ React.createElement(Input, { type: "password", value: password2 || '', onChange: a => setPassword2(a.currentTarget.value), disabled: disabled, autoComplete: "new-password" }))));
39
39
  }
@@ -0,0 +1,4 @@
1
+ export default function RichTextEditor({ value, onChange }: {
2
+ value: any;
3
+ onChange: any;
4
+ }): JSX.Element;
@@ -0,0 +1,52 @@
1
+ import React from 'react';
2
+ import { LexicalComposer } from "@lexical/react/LexicalComposer";
3
+ import { RichTextPlugin } from "@lexical/react/LexicalRichTextPlugin";
4
+ import { ContentEditable } from "@lexical/react/LexicalContentEditable";
5
+ import { HistoryPlugin } from "@lexical/react/LexicalHistoryPlugin";
6
+ import { AutoFocusPlugin } from "@lexical/react/LexicalAutoFocusPlugin";
7
+ import { HeadingNode, QuoteNode } from "@lexical/rich-text";
8
+ import { TableCellNode, TableNode, TableRowNode } from "@lexical/table";
9
+ import { ListItemNode, ListNode } from "@lexical/list";
10
+ import { CodeHighlightNode, CodeNode } from "@lexical/code";
11
+ import { AutoLinkNode, LinkNode } from "@lexical/link";
12
+ import { LinkPlugin } from "@lexical/react/LexicalLinkPlugin";
13
+ import { ListPlugin } from "@lexical/react/LexicalListPlugin";
14
+ import { MarkdownShortcutPlugin } from "@lexical/react/LexicalMarkdownShortcutPlugin";
15
+ import { TRANSFORMERS } from "@lexical/markdown";
16
+ import ToolbarPlugin from '../Lexical/ToolbarPlugin';
17
+ function Placeholder() {
18
+ return React.createElement("div", { className: "editor-placeholder" }, "Enter some rich text...");
19
+ }
20
+ const editorConfig = {
21
+ namespace: '',
22
+ // Handling of errors during update
23
+ onError(error) {
24
+ throw error;
25
+ },
26
+ // Any custom nodes go here
27
+ nodes: [
28
+ HeadingNode,
29
+ ListNode,
30
+ ListItemNode,
31
+ QuoteNode,
32
+ CodeNode,
33
+ CodeHighlightNode,
34
+ TableNode,
35
+ TableCellNode,
36
+ TableRowNode,
37
+ AutoLinkNode,
38
+ LinkNode
39
+ ]
40
+ };
41
+ export default function RichTextEditor({ value, onChange }) {
42
+ return React.createElement(LexicalComposer, { initialConfig: editorConfig },
43
+ React.createElement("div", { className: "editor-container" },
44
+ React.createElement(ToolbarPlugin, null),
45
+ React.createElement("div", { className: "editor-inner" },
46
+ React.createElement(RichTextPlugin, { contentEditable: React.createElement(ContentEditable, { className: "editor-input" }), placeholder: React.createElement(Placeholder, null) }),
47
+ React.createElement(HistoryPlugin, null),
48
+ React.createElement(AutoFocusPlugin, null),
49
+ React.createElement(ListPlugin, null),
50
+ React.createElement(LinkPlugin, null),
51
+ React.createElement(MarkdownShortcutPlugin, { transformers: TRANSFORMERS }))));
52
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-admin-base-bootstrap",
3
- "version": "0.7.6",
3
+ "version": "0.7.7",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",
@@ -64,10 +64,11 @@ export function Column(props) {
64
64
  return <th
65
65
  {...props}
66
66
  style={props.sort && {cursor: 'pointer'}}
67
- onClick={props.sort && (() => setParams({
68
- sort: sort,
67
+ onClick={props.sort && (() => setParams(params => ({
68
+ ...params,
69
+ sort: sort,
69
70
  desc: params.sort === sort ? !params.desc : true
70
- }))}
71
+ })))}
71
72
  >{props.children} {sort && params.sort && params.sort === sort ? params.desc ?
72
73
  <i className="fa fa-sort-down"/> :
73
74
  <i className="fa fa-sort-up"/> : ''}
@@ -33,6 +33,7 @@ function BootstrapPasswordInput({ className, value, onChange, disabled, placehol
33
33
  onChange={a => onChange(a.currentTarget.value)}
34
34
  disabled={disabled}
35
35
  placeholder={placeholder}
36
+ autoComplete="new-password"
36
37
  />
37
38
  <PasswordStrengthBar
38
39
  className="password-str-bar"
@@ -86,6 +87,7 @@ export default function PasswordInput({ value, onChange, className, disabled, ic
86
87
  value={password2 || ''}
87
88
  onChange={a => setPassword2(a.currentTarget.value)}
88
89
  disabled={disabled}
90
+ autoComplete="new-password"
89
91
  />
90
92
  </Validator>
91
93
  </FormGroup> }