@bit.rhplus/ag-grid 0.0.80 → 0.0.82
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/BulkEdit/BulkEditDatePicker.jsx +305 -305
- package/BulkEdit/BulkEditInput.jsx +81 -81
- package/BulkEdit/BulkEditPopover.jsx +310 -310
- package/BulkEdit/BulkEditSelect.jsx +106 -106
- package/Renderers/ImageRenderer.jsx +103 -103
- package/Renderers/LinkRenderer.jsx +133 -133
- package/Renderers/ObjectRenderer.jsx +140 -140
- package/Renderers/StateRenderer.jsx +148 -148
- package/dist/BulkEdit/BulkEditDatePicker.js +35 -35
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/index.jsx +1 -0
- package/package.json +4 -4
- /package/dist/{preview-1768405724660.js → preview-1768559621799.js} +0 -0
|
@@ -1,81 +1,81 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
import React, { useRef, useEffect } from 'react';
|
|
3
|
-
import { createMemoComparison } from '@bit.rhplus/react-memo';
|
|
4
|
-
import { Input, Button, Space } from 'antd';
|
|
5
|
-
|
|
6
|
-
const BulkEditInput = ({
|
|
7
|
-
value,
|
|
8
|
-
onChange,
|
|
9
|
-
onSubmit,
|
|
10
|
-
onCancel,
|
|
11
|
-
loading,
|
|
12
|
-
placeholder = 'Zadejte hodnotu...',
|
|
13
|
-
allowClear = true,
|
|
14
|
-
maxLength,
|
|
15
|
-
type = 'text',
|
|
16
|
-
}) => {
|
|
17
|
-
const inputRef = useRef(null);
|
|
18
|
-
|
|
19
|
-
useEffect(() => {
|
|
20
|
-
if (inputRef.current) {
|
|
21
|
-
setTimeout(() => {
|
|
22
|
-
inputRef.current?.focus();
|
|
23
|
-
inputRef.current?.select();
|
|
24
|
-
}, 100);
|
|
25
|
-
}
|
|
26
|
-
}, []);
|
|
27
|
-
|
|
28
|
-
const handleKeyDown = (e) => {
|
|
29
|
-
if (e.key === 'Enter' && !loading) {
|
|
30
|
-
e.preventDefault();
|
|
31
|
-
onSubmit(value);
|
|
32
|
-
} else if (e.key === 'Escape') {
|
|
33
|
-
e.preventDefault();
|
|
34
|
-
onCancel();
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
return (
|
|
39
|
-
<>
|
|
40
|
-
<div style={{ marginBottom: '12px' }} onClick={(e) => e.stopPropagation()}>
|
|
41
|
-
<Input
|
|
42
|
-
ref={inputRef}
|
|
43
|
-
value={value}
|
|
44
|
-
onChange={(e) => onChange(e.target.value)}
|
|
45
|
-
placeholder={placeholder}
|
|
46
|
-
disabled={loading}
|
|
47
|
-
allowClear={allowClear}
|
|
48
|
-
maxLength={maxLength}
|
|
49
|
-
type={type}
|
|
50
|
-
onKeyDown={handleKeyDown}
|
|
51
|
-
onClick={(e) => e.stopPropagation()}
|
|
52
|
-
/>
|
|
53
|
-
</div>
|
|
54
|
-
|
|
55
|
-
<Space style={{ width: '100%', justifyContent: 'flex-end' }}>
|
|
56
|
-
<Button size="small" onClick={onCancel} disabled={loading}>
|
|
57
|
-
Zrušit
|
|
58
|
-
</Button>
|
|
59
|
-
<Button
|
|
60
|
-
type="primary"
|
|
61
|
-
size="small"
|
|
62
|
-
onClick={() => onSubmit(value)}
|
|
63
|
-
loading={loading}
|
|
64
|
-
>
|
|
65
|
-
Použít
|
|
66
|
-
</Button>
|
|
67
|
-
</Space>
|
|
68
|
-
</>
|
|
69
|
-
);
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
// React.memo optimalizace
|
|
73
|
-
// ✅ PERFORMANCE FIX: Ignore callback references
|
|
74
|
-
const arePropsEqual = createMemoComparison(
|
|
75
|
-
['value', 'loading', 'placeholder', 'allowClear', 'maxLength', 'type'], // Kritické props
|
|
76
|
-
['onChange', 'onSubmit', 'onCancel'], // Ignorované callbacky
|
|
77
|
-
false,
|
|
78
|
-
'BulkEditInput'
|
|
79
|
-
);
|
|
80
|
-
|
|
81
|
-
export default React.memo(BulkEditInput, arePropsEqual);
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import React, { useRef, useEffect } from 'react';
|
|
3
|
+
import { createMemoComparison } from '@bit.rhplus/react-memo';
|
|
4
|
+
import { Input, Button, Space } from 'antd';
|
|
5
|
+
|
|
6
|
+
const BulkEditInput = ({
|
|
7
|
+
value,
|
|
8
|
+
onChange,
|
|
9
|
+
onSubmit,
|
|
10
|
+
onCancel,
|
|
11
|
+
loading,
|
|
12
|
+
placeholder = 'Zadejte hodnotu...',
|
|
13
|
+
allowClear = true,
|
|
14
|
+
maxLength,
|
|
15
|
+
type = 'text',
|
|
16
|
+
}) => {
|
|
17
|
+
const inputRef = useRef(null);
|
|
18
|
+
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
if (inputRef.current) {
|
|
21
|
+
setTimeout(() => {
|
|
22
|
+
inputRef.current?.focus();
|
|
23
|
+
inputRef.current?.select();
|
|
24
|
+
}, 100);
|
|
25
|
+
}
|
|
26
|
+
}, []);
|
|
27
|
+
|
|
28
|
+
const handleKeyDown = (e) => {
|
|
29
|
+
if (e.key === 'Enter' && !loading) {
|
|
30
|
+
e.preventDefault();
|
|
31
|
+
onSubmit(value);
|
|
32
|
+
} else if (e.key === 'Escape') {
|
|
33
|
+
e.preventDefault();
|
|
34
|
+
onCancel();
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<>
|
|
40
|
+
<div style={{ marginBottom: '12px' }} onClick={(e) => e.stopPropagation()}>
|
|
41
|
+
<Input
|
|
42
|
+
ref={inputRef}
|
|
43
|
+
value={value}
|
|
44
|
+
onChange={(e) => onChange(e.target.value)}
|
|
45
|
+
placeholder={placeholder}
|
|
46
|
+
disabled={loading}
|
|
47
|
+
allowClear={allowClear}
|
|
48
|
+
maxLength={maxLength}
|
|
49
|
+
type={type}
|
|
50
|
+
onKeyDown={handleKeyDown}
|
|
51
|
+
onClick={(e) => e.stopPropagation()}
|
|
52
|
+
/>
|
|
53
|
+
</div>
|
|
54
|
+
|
|
55
|
+
<Space style={{ width: '100%', justifyContent: 'flex-end' }}>
|
|
56
|
+
<Button size="small" onClick={onCancel} disabled={loading}>
|
|
57
|
+
Zrušit
|
|
58
|
+
</Button>
|
|
59
|
+
<Button
|
|
60
|
+
type="primary"
|
|
61
|
+
size="small"
|
|
62
|
+
onClick={() => onSubmit(value)}
|
|
63
|
+
loading={loading}
|
|
64
|
+
>
|
|
65
|
+
Použít
|
|
66
|
+
</Button>
|
|
67
|
+
</Space>
|
|
68
|
+
</>
|
|
69
|
+
);
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
// React.memo optimalizace
|
|
73
|
+
// ✅ PERFORMANCE FIX: Ignore callback references
|
|
74
|
+
const arePropsEqual = createMemoComparison(
|
|
75
|
+
['value', 'loading', 'placeholder', 'allowClear', 'maxLength', 'type'], // Kritické props
|
|
76
|
+
['onChange', 'onSubmit', 'onCancel'], // Ignorované callbacky
|
|
77
|
+
false,
|
|
78
|
+
'BulkEditInput'
|
|
79
|
+
);
|
|
80
|
+
|
|
81
|
+
export default React.memo(BulkEditInput, arePropsEqual);
|