@bit.rhplus/ui.grid 0.0.13 → 0.0.15
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/ContextBuilder.js +199 -0
- package/dist/ContextBuilder.d.ts +80 -0
- package/dist/ContextBuilder.js +187 -0
- package/dist/ContextBuilder.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +33 -32
- package/dist/index.js.map +1 -1
- package/index.jsx +31 -30
- package/package.json +5 -5
- /package/dist/{preview-1742310517823.js → preview-1743690438726.js} +0 -0
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
class ContextBuilder {
|
|
4
|
+
#addPreparedMenuItem(props) {
|
|
5
|
+
this.menuItems.push(props);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
constructor(intl) {
|
|
9
|
+
this.menuItems = [];
|
|
10
|
+
this.intl = intl;
|
|
11
|
+
this.globalStyles = {};
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
addMenuItem(props) {
|
|
15
|
+
this.#addPreparedMenuItem(props);
|
|
16
|
+
return this;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
addActionItem({ name, action, icon, disabled = false, tooltip, showCondition = () => true,
|
|
20
|
+
cssClasses, style, iconStyle, ...restProps }) {
|
|
21
|
+
this.#addPreparedMenuItem({
|
|
22
|
+
name,
|
|
23
|
+
action,
|
|
24
|
+
icon,
|
|
25
|
+
disabled: this.#resolveDisabled(disabled),
|
|
26
|
+
tooltip,
|
|
27
|
+
showCondition,
|
|
28
|
+
cssClasses,
|
|
29
|
+
style,
|
|
30
|
+
iconStyle,
|
|
31
|
+
...restProps
|
|
32
|
+
});
|
|
33
|
+
return this;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
addSubMenuItem({ name, icon, items, disabled = false, tooltip, showCondition = () => true,
|
|
37
|
+
cssClasses, style, iconStyle, ...restProps }) {
|
|
38
|
+
this.#addPreparedMenuItem({
|
|
39
|
+
name,
|
|
40
|
+
icon,
|
|
41
|
+
subMenu: Array.isArray(items) ? items : [],
|
|
42
|
+
disabled: this.#resolveDisabled(disabled),
|
|
43
|
+
tooltip,
|
|
44
|
+
showCondition,
|
|
45
|
+
cssClasses,
|
|
46
|
+
style,
|
|
47
|
+
iconStyle,
|
|
48
|
+
...restProps
|
|
49
|
+
});
|
|
50
|
+
return this;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
addSeparator({ showCondition = () => true, cssClasses, style }) {
|
|
54
|
+
this.#addPreparedMenuItem({
|
|
55
|
+
separator: true,
|
|
56
|
+
showCondition,
|
|
57
|
+
cssClasses,
|
|
58
|
+
style
|
|
59
|
+
});
|
|
60
|
+
return this;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
addCustomItem({ component, showCondition = () => true, cssClasses, style, ...restProps }) {
|
|
64
|
+
const customComponent = (params) => {
|
|
65
|
+
return React.createElement(component, { ...params, ...restProps });
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
this.#addPreparedMenuItem({
|
|
69
|
+
custom: true,
|
|
70
|
+
component: customComponent,
|
|
71
|
+
showCondition,
|
|
72
|
+
cssClasses,
|
|
73
|
+
style,
|
|
74
|
+
...restProps
|
|
75
|
+
});
|
|
76
|
+
return this;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
addDynamicItems({ itemsGenerator, showCondition = () => true }) {
|
|
80
|
+
this.#addPreparedMenuItem({
|
|
81
|
+
dynamic: true,
|
|
82
|
+
itemsGenerator,
|
|
83
|
+
showCondition
|
|
84
|
+
});
|
|
85
|
+
return this;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// Nová metoda pro položku s vlastním CSS
|
|
89
|
+
addStyledActionItem({ name, action, icon, disabled = false, tooltip, showCondition = () => true,
|
|
90
|
+
color, backgroundColor, fontWeight, fontSize, border, padding, margin,
|
|
91
|
+
iconColor, iconSize, ...restProps }) {
|
|
92
|
+
|
|
93
|
+
// Vytvoření objektu stylu pro text položky
|
|
94
|
+
const itemStyle = {};
|
|
95
|
+
if (color) itemStyle.color = color;
|
|
96
|
+
if (backgroundColor) itemStyle.backgroundColor = backgroundColor;
|
|
97
|
+
if (fontWeight) itemStyle.fontWeight = fontWeight;
|
|
98
|
+
if (fontSize) itemStyle.fontSize = fontSize;
|
|
99
|
+
if (border) itemStyle.border = border;
|
|
100
|
+
if (padding) itemStyle.padding = padding;
|
|
101
|
+
if (margin) itemStyle.margin = margin;
|
|
102
|
+
|
|
103
|
+
// Vytvoření objektu stylu pro ikonu
|
|
104
|
+
const iconStyleObj = {};
|
|
105
|
+
if (iconColor) iconStyleObj.color = iconColor;
|
|
106
|
+
if (iconSize) iconStyleObj.fontSize = iconSize;
|
|
107
|
+
|
|
108
|
+
this.#addPreparedMenuItem({
|
|
109
|
+
name,
|
|
110
|
+
action,
|
|
111
|
+
icon,
|
|
112
|
+
disabled: this.#resolveDisabled(disabled),
|
|
113
|
+
tooltip,
|
|
114
|
+
showCondition,
|
|
115
|
+
style: itemStyle,
|
|
116
|
+
iconStyle: iconStyleObj,
|
|
117
|
+
...restProps
|
|
118
|
+
});
|
|
119
|
+
return this;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// Nová metoda pro přidání CSS tříd k položce menu
|
|
123
|
+
addClassedActionItem({ name, action, icon, disabled = false, tooltip, showCondition = () => true,
|
|
124
|
+
cssClasses, iconCssClasses, ...restProps }) {
|
|
125
|
+
this.#addPreparedMenuItem({
|
|
126
|
+
name,
|
|
127
|
+
action,
|
|
128
|
+
icon,
|
|
129
|
+
disabled: this.#resolveDisabled(disabled),
|
|
130
|
+
tooltip,
|
|
131
|
+
showCondition,
|
|
132
|
+
cssClasses,
|
|
133
|
+
iconCssClasses,
|
|
134
|
+
...restProps
|
|
135
|
+
});
|
|
136
|
+
return this;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// Helper method for properly setting disabled property
|
|
140
|
+
#resolveDisabled(disabled) {
|
|
141
|
+
if (!disabled)
|
|
142
|
+
return false;
|
|
143
|
+
return disabled;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// Nová metoda pro nastavení globálního stylu pro všechny položky menu
|
|
147
|
+
setGlobalStyles(styles = {}) {
|
|
148
|
+
this.globalStyles = styles;
|
|
149
|
+
return this;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
build() {
|
|
153
|
+
return (params) => {
|
|
154
|
+
// Filter items based on showCondition
|
|
155
|
+
const filteredItems = this.menuItems
|
|
156
|
+
.filter(item => item.showCondition(params))
|
|
157
|
+
.map(item => {
|
|
158
|
+
// For dynamic items, call the generator function to get actual items
|
|
159
|
+
if (item.dynamic) {
|
|
160
|
+
return item.itemsGenerator(params);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// Create a new item object instead of modifying the original
|
|
164
|
+
const { showCondition, ...menuItem } = item;
|
|
165
|
+
let newItem = { ...menuItem };
|
|
166
|
+
|
|
167
|
+
// Apply global styles if defined
|
|
168
|
+
if (this.globalStyles && Object.keys(this.globalStyles).length > 0) {
|
|
169
|
+
if (newItem.style) {
|
|
170
|
+
newItem = {
|
|
171
|
+
...newItem,
|
|
172
|
+
style: { ...this.globalStyles, ...newItem.style }
|
|
173
|
+
};
|
|
174
|
+
} else {
|
|
175
|
+
newItem = {
|
|
176
|
+
...newItem,
|
|
177
|
+
style: { ...this.globalStyles }
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
return newItem;
|
|
183
|
+
})
|
|
184
|
+
// Flatten any arrays returned by dynamic item generators
|
|
185
|
+
.flat();
|
|
186
|
+
|
|
187
|
+
// Pokud používáme AG-Grid's Enterprise verzi, můžeme přidat vlastní CSS styly
|
|
188
|
+
// Tato část je nepovinná a závisí na implementaci AG-Grid
|
|
189
|
+
if (params && params.api && params.api.setPopupParentComponent) {
|
|
190
|
+
// Zde můžete nastavit vlastní komponentu pro kontextové menu
|
|
191
|
+
// To by vyžadovalo vytvoření této komponenty
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
return filteredItems;
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export default ContextBuilder;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
export default ContextBuilder;
|
|
2
|
+
declare class ContextBuilder {
|
|
3
|
+
constructor(intl: any);
|
|
4
|
+
menuItems: any[];
|
|
5
|
+
intl: any;
|
|
6
|
+
globalStyles: {};
|
|
7
|
+
addMenuItem(props: any): this;
|
|
8
|
+
addActionItem({ name, action, icon, disabled, tooltip, showCondition, cssClasses, style, iconStyle, ...restProps }: {
|
|
9
|
+
[x: string]: any;
|
|
10
|
+
name: any;
|
|
11
|
+
action: any;
|
|
12
|
+
icon: any;
|
|
13
|
+
disabled?: boolean | undefined;
|
|
14
|
+
tooltip: any;
|
|
15
|
+
showCondition?: (() => boolean) | undefined;
|
|
16
|
+
cssClasses: any;
|
|
17
|
+
style: any;
|
|
18
|
+
iconStyle: any;
|
|
19
|
+
}): this;
|
|
20
|
+
addSubMenuItem({ name, icon, items, disabled, tooltip, showCondition, cssClasses, style, iconStyle, ...restProps }: {
|
|
21
|
+
[x: string]: any;
|
|
22
|
+
name: any;
|
|
23
|
+
icon: any;
|
|
24
|
+
items: any;
|
|
25
|
+
disabled?: boolean | undefined;
|
|
26
|
+
tooltip: any;
|
|
27
|
+
showCondition?: (() => boolean) | undefined;
|
|
28
|
+
cssClasses: any;
|
|
29
|
+
style: any;
|
|
30
|
+
iconStyle: any;
|
|
31
|
+
}): this;
|
|
32
|
+
addSeparator({ showCondition, cssClasses, style }: {
|
|
33
|
+
showCondition?: (() => boolean) | undefined;
|
|
34
|
+
cssClasses: any;
|
|
35
|
+
style: any;
|
|
36
|
+
}): this;
|
|
37
|
+
addCustomItem({ component, showCondition, cssClasses, style, ...restProps }: {
|
|
38
|
+
[x: string]: any;
|
|
39
|
+
component: any;
|
|
40
|
+
showCondition?: (() => boolean) | undefined;
|
|
41
|
+
cssClasses: any;
|
|
42
|
+
style: any;
|
|
43
|
+
}): this;
|
|
44
|
+
addDynamicItems({ itemsGenerator, showCondition }: {
|
|
45
|
+
itemsGenerator: any;
|
|
46
|
+
showCondition?: (() => boolean) | undefined;
|
|
47
|
+
}): this;
|
|
48
|
+
addStyledActionItem({ name, action, icon, disabled, tooltip, showCondition, color, backgroundColor, fontWeight, fontSize, border, padding, margin, iconColor, iconSize, ...restProps }: {
|
|
49
|
+
[x: string]: any;
|
|
50
|
+
name: any;
|
|
51
|
+
action: any;
|
|
52
|
+
icon: any;
|
|
53
|
+
disabled?: boolean | undefined;
|
|
54
|
+
tooltip: any;
|
|
55
|
+
showCondition?: (() => boolean) | undefined;
|
|
56
|
+
color: any;
|
|
57
|
+
backgroundColor: any;
|
|
58
|
+
fontWeight: any;
|
|
59
|
+
fontSize: any;
|
|
60
|
+
border: any;
|
|
61
|
+
padding: any;
|
|
62
|
+
margin: any;
|
|
63
|
+
iconColor: any;
|
|
64
|
+
iconSize: any;
|
|
65
|
+
}): this;
|
|
66
|
+
addClassedActionItem({ name, action, icon, disabled, tooltip, showCondition, cssClasses, iconCssClasses, ...restProps }: {
|
|
67
|
+
[x: string]: any;
|
|
68
|
+
name: any;
|
|
69
|
+
action: any;
|
|
70
|
+
icon: any;
|
|
71
|
+
disabled?: boolean | undefined;
|
|
72
|
+
tooltip: any;
|
|
73
|
+
showCondition?: (() => boolean) | undefined;
|
|
74
|
+
cssClasses: any;
|
|
75
|
+
iconCssClasses: any;
|
|
76
|
+
}): this;
|
|
77
|
+
setGlobalStyles(styles?: {}): this;
|
|
78
|
+
build(): (params: any) => any[];
|
|
79
|
+
#private;
|
|
80
|
+
}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
2
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
3
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
+
};
|
|
6
|
+
var _ContextBuilder_instances, _ContextBuilder_addPreparedMenuItem, _ContextBuilder_resolveDisabled;
|
|
7
|
+
import * as React from 'react';
|
|
8
|
+
class ContextBuilder {
|
|
9
|
+
constructor(intl) {
|
|
10
|
+
_ContextBuilder_instances.add(this);
|
|
11
|
+
this.menuItems = [];
|
|
12
|
+
this.intl = intl;
|
|
13
|
+
this.globalStyles = {};
|
|
14
|
+
}
|
|
15
|
+
addMenuItem(props) {
|
|
16
|
+
__classPrivateFieldGet(this, _ContextBuilder_instances, "m", _ContextBuilder_addPreparedMenuItem).call(this, props);
|
|
17
|
+
return this;
|
|
18
|
+
}
|
|
19
|
+
addActionItem({ name, action, icon, disabled = false, tooltip, showCondition = () => true, cssClasses, style, iconStyle, ...restProps }) {
|
|
20
|
+
__classPrivateFieldGet(this, _ContextBuilder_instances, "m", _ContextBuilder_addPreparedMenuItem).call(this, {
|
|
21
|
+
name,
|
|
22
|
+
action,
|
|
23
|
+
icon,
|
|
24
|
+
disabled: __classPrivateFieldGet(this, _ContextBuilder_instances, "m", _ContextBuilder_resolveDisabled).call(this, disabled),
|
|
25
|
+
tooltip,
|
|
26
|
+
showCondition,
|
|
27
|
+
cssClasses,
|
|
28
|
+
style,
|
|
29
|
+
iconStyle,
|
|
30
|
+
...restProps
|
|
31
|
+
});
|
|
32
|
+
return this;
|
|
33
|
+
}
|
|
34
|
+
addSubMenuItem({ name, icon, items, disabled = false, tooltip, showCondition = () => true, cssClasses, style, iconStyle, ...restProps }) {
|
|
35
|
+
__classPrivateFieldGet(this, _ContextBuilder_instances, "m", _ContextBuilder_addPreparedMenuItem).call(this, {
|
|
36
|
+
name,
|
|
37
|
+
icon,
|
|
38
|
+
subMenu: Array.isArray(items) ? items : [],
|
|
39
|
+
disabled: __classPrivateFieldGet(this, _ContextBuilder_instances, "m", _ContextBuilder_resolveDisabled).call(this, disabled),
|
|
40
|
+
tooltip,
|
|
41
|
+
showCondition,
|
|
42
|
+
cssClasses,
|
|
43
|
+
style,
|
|
44
|
+
iconStyle,
|
|
45
|
+
...restProps
|
|
46
|
+
});
|
|
47
|
+
return this;
|
|
48
|
+
}
|
|
49
|
+
addSeparator({ showCondition = () => true, cssClasses, style }) {
|
|
50
|
+
__classPrivateFieldGet(this, _ContextBuilder_instances, "m", _ContextBuilder_addPreparedMenuItem).call(this, {
|
|
51
|
+
separator: true,
|
|
52
|
+
showCondition,
|
|
53
|
+
cssClasses,
|
|
54
|
+
style
|
|
55
|
+
});
|
|
56
|
+
return this;
|
|
57
|
+
}
|
|
58
|
+
addCustomItem({ component, showCondition = () => true, cssClasses, style, ...restProps }) {
|
|
59
|
+
const customComponent = (params) => {
|
|
60
|
+
return React.createElement(component, { ...params, ...restProps });
|
|
61
|
+
};
|
|
62
|
+
__classPrivateFieldGet(this, _ContextBuilder_instances, "m", _ContextBuilder_addPreparedMenuItem).call(this, {
|
|
63
|
+
custom: true,
|
|
64
|
+
component: customComponent,
|
|
65
|
+
showCondition,
|
|
66
|
+
cssClasses,
|
|
67
|
+
style,
|
|
68
|
+
...restProps
|
|
69
|
+
});
|
|
70
|
+
return this;
|
|
71
|
+
}
|
|
72
|
+
addDynamicItems({ itemsGenerator, showCondition = () => true }) {
|
|
73
|
+
__classPrivateFieldGet(this, _ContextBuilder_instances, "m", _ContextBuilder_addPreparedMenuItem).call(this, {
|
|
74
|
+
dynamic: true,
|
|
75
|
+
itemsGenerator,
|
|
76
|
+
showCondition
|
|
77
|
+
});
|
|
78
|
+
return this;
|
|
79
|
+
}
|
|
80
|
+
// Nová metoda pro položku s vlastním CSS
|
|
81
|
+
addStyledActionItem({ name, action, icon, disabled = false, tooltip, showCondition = () => true, color, backgroundColor, fontWeight, fontSize, border, padding, margin, iconColor, iconSize, ...restProps }) {
|
|
82
|
+
// Vytvoření objektu stylu pro text položky
|
|
83
|
+
const itemStyle = {};
|
|
84
|
+
if (color)
|
|
85
|
+
itemStyle.color = color;
|
|
86
|
+
if (backgroundColor)
|
|
87
|
+
itemStyle.backgroundColor = backgroundColor;
|
|
88
|
+
if (fontWeight)
|
|
89
|
+
itemStyle.fontWeight = fontWeight;
|
|
90
|
+
if (fontSize)
|
|
91
|
+
itemStyle.fontSize = fontSize;
|
|
92
|
+
if (border)
|
|
93
|
+
itemStyle.border = border;
|
|
94
|
+
if (padding)
|
|
95
|
+
itemStyle.padding = padding;
|
|
96
|
+
if (margin)
|
|
97
|
+
itemStyle.margin = margin;
|
|
98
|
+
// Vytvoření objektu stylu pro ikonu
|
|
99
|
+
const iconStyleObj = {};
|
|
100
|
+
if (iconColor)
|
|
101
|
+
iconStyleObj.color = iconColor;
|
|
102
|
+
if (iconSize)
|
|
103
|
+
iconStyleObj.fontSize = iconSize;
|
|
104
|
+
__classPrivateFieldGet(this, _ContextBuilder_instances, "m", _ContextBuilder_addPreparedMenuItem).call(this, {
|
|
105
|
+
name,
|
|
106
|
+
action,
|
|
107
|
+
icon,
|
|
108
|
+
disabled: __classPrivateFieldGet(this, _ContextBuilder_instances, "m", _ContextBuilder_resolveDisabled).call(this, disabled),
|
|
109
|
+
tooltip,
|
|
110
|
+
showCondition,
|
|
111
|
+
style: itemStyle,
|
|
112
|
+
iconStyle: iconStyleObj,
|
|
113
|
+
...restProps
|
|
114
|
+
});
|
|
115
|
+
return this;
|
|
116
|
+
}
|
|
117
|
+
// Nová metoda pro přidání CSS tříd k položce menu
|
|
118
|
+
addClassedActionItem({ name, action, icon, disabled = false, tooltip, showCondition = () => true, cssClasses, iconCssClasses, ...restProps }) {
|
|
119
|
+
__classPrivateFieldGet(this, _ContextBuilder_instances, "m", _ContextBuilder_addPreparedMenuItem).call(this, {
|
|
120
|
+
name,
|
|
121
|
+
action,
|
|
122
|
+
icon,
|
|
123
|
+
disabled: __classPrivateFieldGet(this, _ContextBuilder_instances, "m", _ContextBuilder_resolveDisabled).call(this, disabled),
|
|
124
|
+
tooltip,
|
|
125
|
+
showCondition,
|
|
126
|
+
cssClasses,
|
|
127
|
+
iconCssClasses,
|
|
128
|
+
...restProps
|
|
129
|
+
});
|
|
130
|
+
return this;
|
|
131
|
+
}
|
|
132
|
+
// Nová metoda pro nastavení globálního stylu pro všechny položky menu
|
|
133
|
+
setGlobalStyles(styles = {}) {
|
|
134
|
+
this.globalStyles = styles;
|
|
135
|
+
return this;
|
|
136
|
+
}
|
|
137
|
+
build() {
|
|
138
|
+
return (params) => {
|
|
139
|
+
// Filter items based on showCondition
|
|
140
|
+
const filteredItems = this.menuItems
|
|
141
|
+
.filter(item => item.showCondition(params))
|
|
142
|
+
.map(item => {
|
|
143
|
+
// For dynamic items, call the generator function to get actual items
|
|
144
|
+
if (item.dynamic) {
|
|
145
|
+
return item.itemsGenerator(params);
|
|
146
|
+
}
|
|
147
|
+
// Create a new item object instead of modifying the original
|
|
148
|
+
const { showCondition, ...menuItem } = item;
|
|
149
|
+
let newItem = { ...menuItem };
|
|
150
|
+
// Apply global styles if defined
|
|
151
|
+
if (this.globalStyles && Object.keys(this.globalStyles).length > 0) {
|
|
152
|
+
if (newItem.style) {
|
|
153
|
+
newItem = {
|
|
154
|
+
...newItem,
|
|
155
|
+
style: { ...this.globalStyles, ...newItem.style }
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
newItem = {
|
|
160
|
+
...newItem,
|
|
161
|
+
style: { ...this.globalStyles }
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
return newItem;
|
|
166
|
+
})
|
|
167
|
+
// Flatten any arrays returned by dynamic item generators
|
|
168
|
+
.flat();
|
|
169
|
+
// Pokud používáme AG-Grid's Enterprise verzi, můžeme přidat vlastní CSS styly
|
|
170
|
+
// Tato část je nepovinná a závisí na implementaci AG-Grid
|
|
171
|
+
if (params && params.api && params.api.setPopupParentComponent) {
|
|
172
|
+
// Zde můžete nastavit vlastní komponentu pro kontextové menu
|
|
173
|
+
// To by vyžadovalo vytvoření této komponenty
|
|
174
|
+
}
|
|
175
|
+
return filteredItems;
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
_ContextBuilder_instances = new WeakSet(), _ContextBuilder_addPreparedMenuItem = function _ContextBuilder_addPreparedMenuItem(props) {
|
|
180
|
+
this.menuItems.push(props);
|
|
181
|
+
}, _ContextBuilder_resolveDisabled = function _ContextBuilder_resolveDisabled(disabled) {
|
|
182
|
+
if (!disabled)
|
|
183
|
+
return false;
|
|
184
|
+
return disabled;
|
|
185
|
+
};
|
|
186
|
+
export default ContextBuilder;
|
|
187
|
+
//# sourceMappingURL=ContextBuilder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContextBuilder.js","sourceRoot":"","sources":["../ContextBuilder.js"],"names":[],"mappings":";;;;;;AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,cAAc;IAKlB,YAAY,IAAI;;QACd,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;QACpB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC;IACzB,CAAC;IAED,WAAW,CAAC,KAAK;QACf,uBAAA,IAAI,sEAAqB,MAAzB,IAAI,EAAsB,KAAK,CAAC,CAAC;QACjC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,aAAa,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,GAAG,KAAK,EAAE,OAAO,EAAE,aAAa,GAAG,GAAG,EAAE,CAAC,IAAI,EACzE,UAAU,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,SAAS,EAAE;QAC1D,uBAAA,IAAI,sEAAqB,MAAzB,IAAI,EAAsB;YACxB,IAAI;YACJ,MAAM;YACN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QAAQ;IACvB,IAAI,CAAC,QAAQ;QACX,OAAO,KAAK,CAAC;IACf,OAAO,QAAQ,CAAC;AAClB,CAAC;AAuDH,eAAe,cAAc,CAAC"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -24,37 +24,35 @@ const Grid = (props) => {
|
|
|
24
24
|
updateItem(data.id, changes);
|
|
25
25
|
}, [updateItem]);
|
|
26
26
|
// Handler pro dvojklik na buňku
|
|
27
|
-
const handleCellDoubleClicked = useCallback((params) => {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
}, [onRowDoubleClicked, editableDefault]);
|
|
27
|
+
// const handleCellDoubleClicked = useCallback((params) => {
|
|
28
|
+
// const { colDef } = params;
|
|
29
|
+
// // Pokud je buňka needitovatelná, vyvoláme událost onRowDoubleClicked
|
|
30
|
+
// let isEditable = true;
|
|
31
|
+
// if (typeof colDef.editable === 'function') {
|
|
32
|
+
// isEditable = colDef.editable(params);
|
|
33
|
+
// } else if (typeof colDef.editable === 'boolean') {
|
|
34
|
+
// isEditable = colDef.editable;
|
|
35
|
+
// } else {
|
|
36
|
+
// isEditable = editableDefault;
|
|
37
|
+
// }
|
|
38
|
+
// // Pokud buňka není editovatelná a máme definován callback pro dvojklik na řádek
|
|
39
|
+
// if (!isEditable && onRowDoubleClicked) {
|
|
40
|
+
// // Simulujeme událost dvojkliku na řádek
|
|
41
|
+
// onRowDoubleClicked({
|
|
42
|
+
// ...params,
|
|
43
|
+
// // Přidáme data, která by normálně obsahovala událost onRowDoubleClicked
|
|
44
|
+
// api: params.api,
|
|
45
|
+
// node: params.node,
|
|
46
|
+
// rowIndex: params.rowIndex,
|
|
47
|
+
// data: params.data,
|
|
48
|
+
// event: params.event
|
|
49
|
+
// });
|
|
50
|
+
// // Zastavíme výchozí zpracování událostí, aby se nezobrazil editor buňky
|
|
51
|
+
// if (params.event) {
|
|
52
|
+
// params.event.preventDefault();
|
|
53
|
+
// }
|
|
54
|
+
// }
|
|
55
|
+
// }, [onRowDoubleClicked, editableDefault]);
|
|
58
56
|
// Handler pro přidání nového řádku
|
|
59
57
|
const handleAddRow = useCallback((rowData = {}) => {
|
|
60
58
|
const newItemId = addItem(rowData);
|
|
@@ -113,11 +111,14 @@ const Grid = (props) => {
|
|
|
113
111
|
// Neselektovatelné řádky čekající na odstranění
|
|
114
112
|
return !pendingChanges[params.data.id] ||
|
|
115
113
|
pendingChanges[params.data.id].operation !== OperationType.DELETE;
|
|
116
|
-
}, isEditable: isCellEditable, onGridReady: handleGridReady, onCellValueChanged: handleCellValueChanged,
|
|
114
|
+
}, isEditable: isCellEditable, onGridReady: handleGridReady, onCellValueChanged: handleCellValueChanged,
|
|
115
|
+
// onCellDoubleClicked={handleCellDoubleClicked}
|
|
116
|
+
rowClassRules: combinedRowClassRules, getRowId: (params) => params.data.id, ...gridOptions, context: {
|
|
117
117
|
componentParent: this,
|
|
118
118
|
}, ...props, ref: gridRef, columnDefs: AgGridColumns(columnDefs, props) }) }));
|
|
119
119
|
};
|
|
120
120
|
export default Grid;
|
|
121
121
|
export * from './enums';
|
|
122
122
|
export { default as ColumnBuilder } from './ColumnBuilder';
|
|
123
|
+
export { default as ContextBuilder } from './ContextBuilder';
|
|
123
124
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.jsx"],"names":[],"mappings":";AAAA,OAAO,KA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O,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
|
package/index.jsx
CHANGED
|
@@ -45,38 +45,38 @@ const Grid = (props) => {
|
|
|
45
45
|
}, [updateItem]);
|
|
46
46
|
|
|
47
47
|
// Handler pro dvojklik na buňku
|
|
48
|
-
const handleCellDoubleClicked = useCallback((params) => {
|
|
49
|
-
|
|
48
|
+
// const handleCellDoubleClicked = useCallback((params) => {
|
|
49
|
+
// const { colDef } = params;
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
51
|
+
// // Pokud je buňka needitovatelná, vyvoláme událost onRowDoubleClicked
|
|
52
|
+
// let isEditable = true;
|
|
53
|
+
// if (typeof colDef.editable === 'function') {
|
|
54
|
+
// isEditable = colDef.editable(params);
|
|
55
|
+
// } else if (typeof colDef.editable === 'boolean') {
|
|
56
|
+
// isEditable = colDef.editable;
|
|
57
|
+
// } else {
|
|
58
|
+
// isEditable = editableDefault;
|
|
59
|
+
// }
|
|
60
60
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
61
|
+
// // Pokud buňka není editovatelná a máme definován callback pro dvojklik na řádek
|
|
62
|
+
// if (!isEditable && onRowDoubleClicked) {
|
|
63
|
+
// // Simulujeme událost dvojkliku na řádek
|
|
64
|
+
// onRowDoubleClicked({
|
|
65
|
+
// ...params,
|
|
66
|
+
// // Přidáme data, která by normálně obsahovala událost onRowDoubleClicked
|
|
67
|
+
// api: params.api,
|
|
68
|
+
// node: params.node,
|
|
69
|
+
// rowIndex: params.rowIndex,
|
|
70
|
+
// data: params.data,
|
|
71
|
+
// event: params.event
|
|
72
|
+
// });
|
|
73
73
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}, [onRowDoubleClicked, editableDefault]);
|
|
74
|
+
// // Zastavíme výchozí zpracování událostí, aby se nezobrazil editor buňky
|
|
75
|
+
// if (params.event) {
|
|
76
|
+
// params.event.preventDefault();
|
|
77
|
+
// }
|
|
78
|
+
// }
|
|
79
|
+
// }, [onRowDoubleClicked, editableDefault]);
|
|
80
80
|
|
|
81
81
|
// Handler pro přidání nového řádku
|
|
82
82
|
const handleAddRow = useCallback((rowData = {}) => {
|
|
@@ -154,7 +154,7 @@ const Grid = (props) => {
|
|
|
154
154
|
isEditable={isCellEditable}
|
|
155
155
|
onGridReady={handleGridReady}
|
|
156
156
|
onCellValueChanged={handleCellValueChanged}
|
|
157
|
-
onCellDoubleClicked={handleCellDoubleClicked}
|
|
157
|
+
// onCellDoubleClicked={handleCellDoubleClicked}
|
|
158
158
|
rowClassRules={combinedRowClassRules}
|
|
159
159
|
getRowId={(params) => params.data.id}
|
|
160
160
|
{...gridOptions}
|
|
@@ -172,3 +172,4 @@ const Grid = (props) => {
|
|
|
172
172
|
export default Grid;
|
|
173
173
|
export * from './enums';
|
|
174
174
|
export { default as ColumnBuilder } from './ColumnBuilder';
|
|
175
|
+
export { default as ContextBuilder } from './ContextBuilder';
|
package/package.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bit.rhplus/ui.grid",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.15",
|
|
4
4
|
"homepage": "https://bit.cloud/remote-scope/ui/grid",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "remote-scope",
|
|
8
8
|
"name": "ui/grid",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.15"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"classnames": "^2.5.1",
|
|
13
|
-
"@bit.rhplus/ag-grid": "0.0.
|
|
14
|
-
"@bit.rhplus/shared-grid-form": "0.0.
|
|
13
|
+
"@bit.rhplus/ag-grid": "0.0.17",
|
|
14
|
+
"@bit.rhplus/shared-grid-form": "0.0.2"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
|
-
"@teambit/react.react-env": "1.0.
|
|
17
|
+
"@teambit/react.react-env": "1.0.129"
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|
|
20
20
|
"react": "^17.0.0 || ^18.0.0"
|
|
File without changes
|