@hitachivantara/uikit-react-lab 3.47.3 → 3.49.0
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/Controls/Controls.d.ts +57 -0
- package/dist/Controls/Controls.js +197 -0
- package/dist/Controls/Controls.js.map +1 -0
- package/dist/Controls/LeftControl/LeftControl.d.ts +32 -0
- package/dist/Controls/LeftControl/LeftControl.js +130 -0
- package/dist/Controls/LeftControl/LeftControl.js.map +1 -0
- package/dist/Controls/LeftControl/index.d.ts +2 -0
- package/dist/Controls/LeftControl/index.js +16 -0
- package/dist/Controls/LeftControl/index.js.map +1 -0
- package/dist/Controls/LeftControl/styles.js +19 -0
- package/dist/Controls/LeftControl/styles.js.map +1 -0
- package/dist/Controls/RightControl/RightControl.d.ts +43 -0
- package/dist/Controls/RightControl/RightControl.js +167 -0
- package/dist/Controls/RightControl/RightControl.js.map +1 -0
- package/dist/Controls/RightControl/index.d.ts +2 -0
- package/dist/Controls/RightControl/index.js +16 -0
- package/dist/Controls/RightControl/index.js.map +1 -0
- package/dist/Controls/RightControl/styles.js +22 -0
- package/dist/Controls/RightControl/styles.js.map +1 -0
- package/dist/Controls/context/ControlsContext.js +21 -0
- package/dist/Controls/context/ControlsContext.js.map +1 -0
- package/dist/Controls/index.d.ts +3 -0
- package/dist/Controls/index.js +32 -0
- package/dist/Controls/index.js.map +1 -0
- package/dist/Controls/styles.js +30 -0
- package/dist/Controls/styles.js.map +1 -0
- package/dist/QueryBuilder/Rule/Rule.js +0 -2
- package/dist/QueryBuilder/Rule/Rule.js.map +1 -1
- package/dist/QueryBuilder/RuleGroup/RuleGroup.js +6 -2
- package/dist/QueryBuilder/RuleGroup/RuleGroup.js.map +1 -1
- package/dist/QueryBuilder/{types.ts → types.d.ts} +1 -1
- package/dist/Table/TableBody/TableBody.js +1 -3
- package/dist/Table/TableBody/TableBody.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +21 -0
- package/dist/index.js.map +1 -1
- package/dist/legacy/Controls/Controls.d.ts +57 -0
- package/dist/legacy/Controls/Controls.js +174 -0
- package/dist/legacy/Controls/Controls.js.map +1 -0
- package/dist/legacy/Controls/LeftControl/LeftControl.d.ts +32 -0
- package/dist/legacy/Controls/LeftControl/LeftControl.js +91 -0
- package/dist/legacy/Controls/LeftControl/LeftControl.js.map +1 -0
- package/dist/legacy/Controls/LeftControl/index.d.ts +2 -0
- package/dist/legacy/Controls/LeftControl/index.js +2 -0
- package/dist/legacy/Controls/LeftControl/index.js.map +1 -0
- package/dist/legacy/Controls/LeftControl/styles.js +11 -0
- package/dist/legacy/Controls/LeftControl/styles.js.map +1 -0
- package/dist/legacy/Controls/RightControl/RightControl.d.ts +43 -0
- package/dist/legacy/Controls/RightControl/RightControl.js +125 -0
- package/dist/legacy/Controls/RightControl/RightControl.js.map +1 -0
- package/dist/legacy/Controls/RightControl/index.d.ts +2 -0
- package/dist/legacy/Controls/RightControl/index.js +2 -0
- package/dist/legacy/Controls/RightControl/index.js.map +1 -0
- package/dist/legacy/Controls/RightControl/styles.js +14 -0
- package/dist/legacy/Controls/RightControl/styles.js.map +1 -0
- package/dist/legacy/Controls/context/ControlsContext.js +6 -0
- package/dist/legacy/Controls/context/ControlsContext.js.map +1 -0
- package/dist/legacy/Controls/index.d.ts +3 -0
- package/dist/legacy/Controls/index.js +4 -0
- package/dist/legacy/Controls/index.js.map +1 -0
- package/dist/legacy/Controls/styles.js +22 -0
- package/dist/legacy/Controls/styles.js.map +1 -0
- package/dist/legacy/QueryBuilder/Rule/Rule.js +0 -2
- package/dist/legacy/QueryBuilder/Rule/Rule.js.map +1 -1
- package/dist/legacy/QueryBuilder/RuleGroup/RuleGroup.js +6 -2
- package/dist/legacy/QueryBuilder/RuleGroup/RuleGroup.js.map +1 -1
- package/dist/legacy/QueryBuilder/{types.ts → types.d.ts} +1 -1
- package/dist/legacy/Table/TableBody/TableBody.js +2 -3
- package/dist/legacy/Table/TableBody/TableBody.js.map +1 -1
- package/dist/legacy/index.d.ts +3 -0
- package/dist/legacy/index.js +2 -0
- package/dist/legacy/index.js.map +1 -1
- package/dist/modern/Controls/Controls.d.ts +57 -0
- package/dist/modern/Controls/Controls.js +164 -0
- package/dist/modern/Controls/Controls.js.map +1 -0
- package/dist/modern/Controls/LeftControl/LeftControl.d.ts +32 -0
- package/dist/modern/Controls/LeftControl/LeftControl.js +90 -0
- package/dist/modern/Controls/LeftControl/LeftControl.js.map +1 -0
- package/dist/modern/Controls/LeftControl/index.d.ts +2 -0
- package/dist/modern/Controls/LeftControl/index.js +2 -0
- package/dist/modern/Controls/LeftControl/index.js.map +1 -0
- package/dist/modern/Controls/LeftControl/styles.js +9 -0
- package/dist/modern/Controls/LeftControl/styles.js.map +1 -0
- package/dist/modern/Controls/RightControl/RightControl.d.ts +43 -0
- package/dist/modern/Controls/RightControl/RightControl.js +109 -0
- package/dist/modern/Controls/RightControl/RightControl.js.map +1 -0
- package/dist/modern/Controls/RightControl/index.d.ts +2 -0
- package/dist/modern/Controls/RightControl/index.js +2 -0
- package/dist/modern/Controls/RightControl/index.js.map +1 -0
- package/dist/modern/Controls/RightControl/styles.js +12 -0
- package/dist/modern/Controls/RightControl/styles.js.map +1 -0
- package/dist/modern/Controls/context/ControlsContext.js +6 -0
- package/dist/modern/Controls/context/ControlsContext.js.map +1 -0
- package/dist/modern/Controls/index.d.ts +3 -0
- package/dist/modern/Controls/index.js +4 -0
- package/dist/modern/Controls/index.js.map +1 -0
- package/dist/modern/Controls/styles.js +20 -0
- package/dist/modern/Controls/styles.js.map +1 -0
- package/dist/modern/QueryBuilder/Rule/Rule.js +0 -2
- package/dist/modern/QueryBuilder/Rule/Rule.js.map +1 -1
- package/dist/modern/QueryBuilder/RuleGroup/RuleGroup.js +6 -2
- package/dist/modern/QueryBuilder/RuleGroup/RuleGroup.js.map +1 -1
- package/dist/modern/QueryBuilder/{types.ts → types.d.ts} +1 -1
- package/dist/modern/Table/TableBody/TableBody.js +2 -3
- package/dist/modern/Table/TableBody/TableBody.js.map +1 -1
- package/dist/modern/index.d.ts +3 -0
- package/dist/modern/index.js +2 -0
- package/dist/modern/index.js.map +1 -1
- package/package.json +22 -28
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { StandardProps } from "@material-ui/core";
|
|
2
|
+
|
|
3
|
+
export type HvControlsClassKey = "root" | "rightSection" | "leftSection";
|
|
4
|
+
|
|
5
|
+
export interface HvControlsSortValue {
|
|
6
|
+
id: string;
|
|
7
|
+
desc: string;
|
|
8
|
+
}
|
|
9
|
+
export interface HvControlsViewConfiguration extends Record<string, unknown> {
|
|
10
|
+
setSortBy?: (v: HvControlsSortValue[]) => void;
|
|
11
|
+
setGlobalFilter?: (v: string) => void;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface HvControlsCallbacks extends Record<string, unknown> {
|
|
15
|
+
id: string;
|
|
16
|
+
label: string;
|
|
17
|
+
icon: React.ReactNode;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface HvControlsProps
|
|
21
|
+
extends StandardProps<React.HTMLAttributes<HTMLDivElement>, HvControlsClassKey> {
|
|
22
|
+
/** Children to be rendered. */
|
|
23
|
+
id?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Class names to be applied.
|
|
26
|
+
*/
|
|
27
|
+
className?: string;
|
|
28
|
+
/**
|
|
29
|
+
* An instance of useHvTable or useTable used to manage the data
|
|
30
|
+
* if this is not provided data sorting and search must be handled externally
|
|
31
|
+
*/
|
|
32
|
+
callbacks?: HvControlsCallbacks;
|
|
33
|
+
/**
|
|
34
|
+
* Views configuration required for the view buttons
|
|
35
|
+
*/
|
|
36
|
+
views?: HvControlsViewConfiguration[];
|
|
37
|
+
/**
|
|
38
|
+
* What view is selected by default
|
|
39
|
+
*/
|
|
40
|
+
defaultView?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Sets the selected view to be the one specified
|
|
43
|
+
* if specified the component is in a controlled state and it won't change it state
|
|
44
|
+
* unless specified externally
|
|
45
|
+
*/
|
|
46
|
+
selectedView?: string;
|
|
47
|
+
/**
|
|
48
|
+
* Callback called when the view switcher button is pressed
|
|
49
|
+
*/
|
|
50
|
+
onViewChange?: (event: Event, id: string) => void;
|
|
51
|
+
/**
|
|
52
|
+
* if `true` the button to switch views is not rendered
|
|
53
|
+
*/
|
|
54
|
+
hideViewSwitcher?: boolean;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export default function HvControls(props: HvControlsProps): JSX.Element | null;
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
+
|
|
12
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
13
|
+
|
|
14
|
+
require("core-js/modules/es.array.slice.js");
|
|
15
|
+
|
|
16
|
+
require("core-js/modules/es.array.map.js");
|
|
17
|
+
|
|
18
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
19
|
+
|
|
20
|
+
var _react = _interopRequireDefault(require("react"));
|
|
21
|
+
|
|
22
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
23
|
+
|
|
24
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
25
|
+
|
|
26
|
+
var _core = require("@material-ui/core");
|
|
27
|
+
|
|
28
|
+
var _uikitReactCore = require("@hitachivantara/uikit-react-core");
|
|
29
|
+
|
|
30
|
+
var _ControlsContext = require("./context/ControlsContext");
|
|
31
|
+
|
|
32
|
+
var _styles = _interopRequireDefault(require("./styles"));
|
|
33
|
+
|
|
34
|
+
var _excluded = ["id", "icon"];
|
|
35
|
+
|
|
36
|
+
/** Controls it's a group of features used to control data that can be rendered using different views (table, cards, list). */
|
|
37
|
+
var HvControls = function HvControls(_ref) {
|
|
38
|
+
var id = _ref.id,
|
|
39
|
+
views = _ref.views,
|
|
40
|
+
classes = _ref.classes,
|
|
41
|
+
className = _ref.className,
|
|
42
|
+
callbacks = _ref.callbacks,
|
|
43
|
+
selectedView = _ref.selectedView,
|
|
44
|
+
defaultView = _ref.defaultView,
|
|
45
|
+
children = _ref.children,
|
|
46
|
+
_ref$hideViewSwitcher = _ref.hideViewSwitcher,
|
|
47
|
+
hideViewSwitcher = _ref$hideViewSwitcher === void 0 ? false : _ref$hideViewSwitcher,
|
|
48
|
+
onViewChange = _ref.onViewChange;
|
|
49
|
+
|
|
50
|
+
var _useControlled = (0, _uikitReactCore.useControlled)(selectedView, defaultView),
|
|
51
|
+
_useControlled2 = (0, _slicedToArray2.default)(_useControlled, 2),
|
|
52
|
+
currentView = _useControlled2[0],
|
|
53
|
+
setCurrentView = _useControlled2[1];
|
|
54
|
+
|
|
55
|
+
var onViewChangeHandler = function onViewChangeHandler(evt, btnId) {
|
|
56
|
+
setCurrentView(btnId);
|
|
57
|
+
onViewChange === null || onViewChange === void 0 ? void 0 : onViewChange(evt, btnId);
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
var onSearchHandler = function onSearchHandler(value) {
|
|
61
|
+
return callbacks === null || callbacks === void 0 ? void 0 : callbacks.setGlobalFilter(value);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
var onSortHandler = function onSortHandler(value) {
|
|
65
|
+
return callbacks === null || callbacks === void 0 ? void 0 : callbacks.setSortBy([{
|
|
66
|
+
id: value === null || value === void 0 ? void 0 : value.accessor,
|
|
67
|
+
desc: value === null || value === void 0 ? void 0 : value.desc
|
|
68
|
+
}]);
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
var childrenIndexCut = (children === null || children === void 0 ? void 0 : children.length) > 0 ? Math.round(children.length * 0.5) : 0;
|
|
72
|
+
var leftChildren = children.slice(0, childrenIndexCut);
|
|
73
|
+
var rightChildren = children.slice(childrenIndexCut, (children === null || children === void 0 ? void 0 : children.length) || 0);
|
|
74
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
75
|
+
id: id,
|
|
76
|
+
className: (0, _clsx.default)(className, classes.root)
|
|
77
|
+
}, /*#__PURE__*/_react.default.createElement(_ControlsContext.HvControlsContextProvider, {
|
|
78
|
+
value: {
|
|
79
|
+
onSearch: onSearchHandler,
|
|
80
|
+
onSort: onSortHandler
|
|
81
|
+
}
|
|
82
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
83
|
+
className: (0, _clsx.default)(classes.section, classes.leftSection)
|
|
84
|
+
}, leftChildren), /*#__PURE__*/_react.default.createElement("div", {
|
|
85
|
+
className: (0, _clsx.default)(classes.section, classes.rightSection)
|
|
86
|
+
}, rightChildren, !hideViewSwitcher && (views === null || views === void 0 ? void 0 : views.length) > 0 && /*#__PURE__*/_react.default.createElement(_uikitReactCore.HvMultiButton, {
|
|
87
|
+
id: (0, _uikitReactCore.setId)(id, "view-multi-button")
|
|
88
|
+
}, views === null || views === void 0 ? void 0 : views.map(function (_ref2) {
|
|
89
|
+
var btnId = _ref2.id,
|
|
90
|
+
icon = _ref2.icon,
|
|
91
|
+
others = (0, _objectWithoutProperties2.default)(_ref2, _excluded);
|
|
92
|
+
return /*#__PURE__*/_react.default.createElement(_uikitReactCore.HvButton, (0, _extends2.default)({
|
|
93
|
+
id: btnId,
|
|
94
|
+
key: btnId,
|
|
95
|
+
icon: true,
|
|
96
|
+
selected: currentView === btnId,
|
|
97
|
+
onClick: function onClick(evt) {
|
|
98
|
+
return onViewChangeHandler(evt, btnId);
|
|
99
|
+
}
|
|
100
|
+
}, others), icon);
|
|
101
|
+
})))));
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
process.env.NODE_ENV !== "production" ? HvControls.propTypes = {
|
|
105
|
+
/** Children to be rendered. */
|
|
106
|
+
id: _propTypes.default.string,
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Class names to be applied.
|
|
110
|
+
*/
|
|
111
|
+
className: _propTypes.default.string,
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Children elements to be rendered
|
|
115
|
+
*/
|
|
116
|
+
children: _propTypes.default.node,
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* An instance of useHvTable or useTable used to manage the data
|
|
120
|
+
* if this is not provided data sorting and search must be handled externally
|
|
121
|
+
*/
|
|
122
|
+
callbacks: _propTypes.default.shape({
|
|
123
|
+
/**
|
|
124
|
+
* Callback used by the .
|
|
125
|
+
*/
|
|
126
|
+
setSortBy: _propTypes.default.func,
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Callback used by the search input to filter data across all fields
|
|
130
|
+
*/
|
|
131
|
+
setGlobalFilter: _propTypes.default.func
|
|
132
|
+
}),
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Views configuration required for the view buttons
|
|
136
|
+
*/
|
|
137
|
+
views: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
138
|
+
label: _propTypes.default.string,
|
|
139
|
+
icon: _propTypes.default.node,
|
|
140
|
+
id: _propTypes.default.string
|
|
141
|
+
})),
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* the classes object to be applied into the root object.
|
|
145
|
+
*/
|
|
146
|
+
classes: _propTypes.default.shape({
|
|
147
|
+
/**
|
|
148
|
+
* Style applied to the root of the component.
|
|
149
|
+
*/
|
|
150
|
+
root: _propTypes.default.string,
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Right box of the controls
|
|
154
|
+
*/
|
|
155
|
+
rightSection: _propTypes.default.string,
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Left box of the controls
|
|
159
|
+
*/
|
|
160
|
+
leftSection: _propTypes.default.string,
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* common styles for left and right controls
|
|
164
|
+
*/
|
|
165
|
+
section: _propTypes.default.string
|
|
166
|
+
}).isRequired,
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* What view is selected by default
|
|
170
|
+
*/
|
|
171
|
+
defaultView: _propTypes.default.string,
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Sets the selected view to be the one specified
|
|
175
|
+
* if specified the component is in a controlled state and it won't change it state
|
|
176
|
+
* unless specified externally
|
|
177
|
+
*/
|
|
178
|
+
selectedView: _propTypes.default.string,
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Callback called when the view switcher button is pressed
|
|
182
|
+
*/
|
|
183
|
+
onViewChange: _propTypes.default.func,
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* if `true` the button to switch views is not rendered
|
|
187
|
+
*/
|
|
188
|
+
hideViewSwitcher: _propTypes.default.bool
|
|
189
|
+
} : void 0;
|
|
190
|
+
|
|
191
|
+
var _default = (0, _core.withStyles)(_styles.default, {
|
|
192
|
+
name: "HvControls",
|
|
193
|
+
withTheme: true
|
|
194
|
+
})(HvControls);
|
|
195
|
+
|
|
196
|
+
exports.default = _default;
|
|
197
|
+
//# sourceMappingURL=Controls.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Controls.js","names":["HvControls","id","views","classes","className","callbacks","selectedView","defaultView","children","hideViewSwitcher","onViewChange","currentView","setCurrentView","onViewChangeHandler","evt","btnId","onSearchHandler","value","setGlobalFilter","onSortHandler","setSortBy","accessor","desc","childrenIndexCut","length","Math","round","leftChildren","slice","rightChildren","root","onSearch","onSort","section","leftSection","rightSection","map","icon","others","propTypes","PropTypes","string","node","shape","func","arrayOf","label","isRequired","bool","styleCreator","name","withTheme"],"sources":["../../src/Controls/Controls.js"],"sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport clsx from \"clsx\";\nimport { withStyles } from \"@material-ui/core\";\nimport { useControlled, HvMultiButton, HvButton, setId } from \"@hitachivantara/uikit-react-core\";\nimport { HvControlsContextProvider } from \"./context/ControlsContext\";\nimport styleCreator from \"./styles\";\n\n/** Controls it's a group of features used to control data that can be rendered using different views (table, cards, list). */\nconst HvControls = ({\n id,\n views,\n classes,\n className,\n callbacks,\n selectedView,\n defaultView,\n children,\n hideViewSwitcher = false,\n onViewChange,\n}) => {\n const [currentView, setCurrentView] = useControlled(selectedView, defaultView);\n\n const onViewChangeHandler = (evt, btnId) => {\n setCurrentView(btnId);\n onViewChange?.(evt, btnId);\n };\n\n const onSearchHandler = (value) => callbacks?.setGlobalFilter(value);\n const onSortHandler = (value) =>\n callbacks?.setSortBy([\n {\n id: value?.accessor,\n desc: value?.desc,\n },\n ]);\n const childrenIndexCut = children?.length > 0 ? Math.round(children.length * 0.5) : 0;\n const leftChildren = children.slice(0, childrenIndexCut);\n const rightChildren = children.slice(childrenIndexCut, children?.length || 0);\n return (\n <div id={id} className={clsx(className, classes.root)}>\n <HvControlsContextProvider\n value={{\n onSearch: onSearchHandler,\n onSort: onSortHandler,\n }}\n >\n <div className={clsx(classes.section, classes.leftSection)}>{leftChildren}</div>\n <div className={clsx(classes.section, classes.rightSection)}>\n {rightChildren}\n {!hideViewSwitcher && views?.length > 0 && (\n <HvMultiButton id={setId(id, \"view-multi-button\")}>\n {views?.map(({ id: btnId, icon, ...others }) => (\n <HvButton\n id={btnId}\n key={btnId}\n icon\n selected={currentView === btnId}\n onClick={(evt) => onViewChangeHandler(evt, btnId)}\n {...others}\n >\n {icon}\n </HvButton>\n ))}\n </HvMultiButton>\n )}\n </div>\n </HvControlsContextProvider>\n </div>\n );\n};\n\nHvControls.propTypes = {\n /** Children to be rendered. */\n id: PropTypes.string,\n /**\n * Class names to be applied.\n */\n className: PropTypes.string,\n /**\n * Children elements to be rendered\n */\n children: PropTypes.node,\n /**\n * An instance of useHvTable or useTable used to manage the data\n * if this is not provided data sorting and search must be handled externally\n */\n callbacks: PropTypes.shape({\n /**\n * Callback used by the .\n */\n setSortBy: PropTypes.func,\n /**\n * Callback used by the search input to filter data across all fields\n */\n setGlobalFilter: PropTypes.func,\n }),\n /**\n * Views configuration required for the view buttons\n */\n views: PropTypes.arrayOf(\n PropTypes.shape({\n label: PropTypes.string,\n icon: PropTypes.node,\n id: PropTypes.string,\n })\n ),\n /**\n * the classes object to be applied into the root object.\n */\n classes: PropTypes.shape({\n /**\n * Style applied to the root of the component.\n */\n root: PropTypes.string,\n /**\n * Right box of the controls\n */\n rightSection: PropTypes.string,\n /**\n * Left box of the controls\n */\n leftSection: PropTypes.string,\n /**\n * common styles for left and right controls\n */\n section: PropTypes.string,\n }).isRequired,\n /**\n * What view is selected by default\n */\n defaultView: PropTypes.string,\n /**\n * Sets the selected view to be the one specified\n * if specified the component is in a controlled state and it won't change it state\n * unless specified externally\n */\n selectedView: PropTypes.string,\n /**\n * Callback called when the view switcher button is pressed\n */\n onViewChange: PropTypes.func,\n /**\n * if `true` the button to switch views is not rendered\n */\n hideViewSwitcher: PropTypes.bool,\n};\n\nexport default withStyles(styleCreator, { name: \"HvControls\", withTheme: true })(HvControls);\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA;AACA,IAAMA,UAAU,GAAG,SAAbA,UAAa,OAWb;EAAA,IAVJC,EAUI,QAVJA,EAUI;EAAA,IATJC,KASI,QATJA,KASI;EAAA,IARJC,OAQI,QARJA,OAQI;EAAA,IAPJC,SAOI,QAPJA,SAOI;EAAA,IANJC,SAMI,QANJA,SAMI;EAAA,IALJC,YAKI,QALJA,YAKI;EAAA,IAJJC,WAII,QAJJA,WAII;EAAA,IAHJC,QAGI,QAHJA,QAGI;EAAA,iCAFJC,gBAEI;EAAA,IAFJA,gBAEI,sCAFe,KAEf;EAAA,IADJC,YACI,QADJA,YACI;;EACJ,qBAAsC,mCAAcJ,YAAd,EAA4BC,WAA5B,CAAtC;EAAA;EAAA,IAAOI,WAAP;EAAA,IAA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AUI,IAJI;;IAKzB;AACJ;AACA;IACI1B,eAAe,EAAEsB,mBAAUI;EARF,CAAhB,CAfU;;EAyBrB;AACF;AACA;EACE1C,KAAK,EAAEsC,mBAAUK,OAAV,CACLL,mBAAUG,KAAV,CAAgB;IACdG,KAAK,EAAEN,mBAAUC,MADH;IAEdJ,IAAI,EAAEG,mBAAUE,IAFF;IAGdzC,EAAE,EAAEuC,mBAAUC;EAHA,CAAhB,CADK,CA5Bc;;EAmCrB;AACF;AACA;EACEtC,OAAO,EAAEqC,mBAAUG,KAAV,CAAgB;IACvB;AACJ;AACA;IACIb,IAAI,EAAEU,mBAAUC,MAJO;;IAKvB;AACJ;AACA;IACIN,YAAY,EAAEK,mBAAUC,MARD;;IASvB;AACJ;AACA;IACIP,WAAW,EAAEM,mBAAUC,MAZA;;IAavB;AACJ;AACA;IACIR,OAAO,EAAEO,mBAAUC;EAhBI,CAAhB,EAiBNM,UAvDkB;;EAwDrB;AACF;AACA;EACExC,WAAW,EAAEiC,mBAAUC,MA3DF;;EA4DrB;AACF;AACA;AACA;AACA;EACEnC,YAAY,EAAEkC,mBAAUC,MAjEH;;EAkErB;AACF;AACA;EACE/B,YAAY,EAAE8B,mBAAUI,IArEH;;EAsErB;AACF;AACA;EACEnC,gBAAgB,EAAE+B,mBAAUQ;AAzEP,CAAvB;;eA4Ee,sBAAWC,eAAX,EAAyB;EAAEC,IAAI,EAAE,YAAR;EAAsBC,SAAS,EAAE;AAAjC,CAAzB,EAAkEnD,UAAlE,C"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { StandardProps } from "@material-ui/core";
|
|
2
|
+
import { HvInputProps } from "@hitachivantara/uikit-react-core";
|
|
3
|
+
|
|
4
|
+
export type HvLeftControlClassKey = "root";
|
|
5
|
+
|
|
6
|
+
export interface HvLeftControlProps
|
|
7
|
+
extends StandardProps<React.HTMLAttributes<HTMLDivElement>, HvLeftControlClassKey> {
|
|
8
|
+
/** Children to be rendered. */
|
|
9
|
+
id?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Class names to be applied.
|
|
12
|
+
*/
|
|
13
|
+
className?: string;
|
|
14
|
+
/**
|
|
15
|
+
* if `true` the hide sort by dropdown is not rendered
|
|
16
|
+
*/
|
|
17
|
+
hideSearch?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* placeholder of the input
|
|
20
|
+
*/
|
|
21
|
+
placeholder?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Callback called when a search action occurs
|
|
24
|
+
*/
|
|
25
|
+
onSearch?: (event: React.ChangeEvent<HTMLInputElement>, value: string) => void;
|
|
26
|
+
/**
|
|
27
|
+
* Extra props passed to input
|
|
28
|
+
*/
|
|
29
|
+
searchProps?: HvInputProps;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export default function HvLeftControl(props: HvLeftControlProps): JSX.Element | null;
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.array.iterator.js");
|
|
4
|
+
|
|
5
|
+
require("core-js/modules/es.object.to-string.js");
|
|
6
|
+
|
|
7
|
+
require("core-js/modules/es.string.iterator.js");
|
|
8
|
+
|
|
9
|
+
require("core-js/modules/es.weak-map.js");
|
|
10
|
+
|
|
11
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
12
|
+
|
|
13
|
+
require("core-js/modules/es.object.get-own-property-descriptor.js");
|
|
14
|
+
|
|
15
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
16
|
+
|
|
17
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
18
|
+
|
|
19
|
+
Object.defineProperty(exports, "__esModule", {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
exports.default = void 0;
|
|
23
|
+
|
|
24
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
25
|
+
|
|
26
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
27
|
+
|
|
28
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
29
|
+
|
|
30
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
31
|
+
|
|
32
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
33
|
+
|
|
34
|
+
var _core = require("@material-ui/core");
|
|
35
|
+
|
|
36
|
+
var _uikitReactCore = require("@hitachivantara/uikit-react-core");
|
|
37
|
+
|
|
38
|
+
var _ControlsContext = require("../context/ControlsContext");
|
|
39
|
+
|
|
40
|
+
var _styles = _interopRequireDefault(require("./styles"));
|
|
41
|
+
|
|
42
|
+
var _excluded = ["id", "classes", "className", "children", "placeholder", "onSearch", "hideSearch", "searchProps"];
|
|
43
|
+
|
|
44
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
45
|
+
|
|
46
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
47
|
+
|
|
48
|
+
var HvLeftControl = function HvLeftControl(_ref) {
|
|
49
|
+
var id = _ref.id,
|
|
50
|
+
classes = _ref.classes,
|
|
51
|
+
className = _ref.className,
|
|
52
|
+
children = _ref.children,
|
|
53
|
+
_ref$placeholder = _ref.placeholder,
|
|
54
|
+
placeholder = _ref$placeholder === void 0 ? "Search" : _ref$placeholder,
|
|
55
|
+
onSearch = _ref.onSearch,
|
|
56
|
+
_ref$hideSearch = _ref.hideSearch,
|
|
57
|
+
hideSearch = _ref$hideSearch === void 0 ? false : _ref$hideSearch,
|
|
58
|
+
searchProps = _ref.searchProps,
|
|
59
|
+
others = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
60
|
+
|
|
61
|
+
var _useContext = (0, _react.useContext)(_ControlsContext.HvControlsContext),
|
|
62
|
+
onSearchHandler = _useContext.onSearch;
|
|
63
|
+
|
|
64
|
+
var onChangeFilter = function onChangeFilter(e, value) {
|
|
65
|
+
onSearch === null || onSearch === void 0 ? void 0 : onSearch(e, value);
|
|
66
|
+
onSearchHandler === null || onSearchHandler === void 0 ? void 0 : onSearchHandler(value);
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
return /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({
|
|
70
|
+
id: id,
|
|
71
|
+
className: (0, _clsx.default)(className, classes.root)
|
|
72
|
+
}, others), !hideSearch && /*#__PURE__*/_react.default.createElement(_uikitReactCore.HvInput, (0, _extends2.default)({
|
|
73
|
+
id: (0, _uikitReactCore.setId)(id, "search-input"),
|
|
74
|
+
type: "search",
|
|
75
|
+
placeholder: placeholder,
|
|
76
|
+
onChange: function onChange(e, value) {
|
|
77
|
+
return onChangeFilter(e, value);
|
|
78
|
+
}
|
|
79
|
+
}, searchProps)), children);
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
process.env.NODE_ENV !== "production" ? HvLeftControl.propTypes = {
|
|
83
|
+
/** Children to be rendered. */
|
|
84
|
+
id: _propTypes.default.string,
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Class names to be applied.
|
|
88
|
+
*/
|
|
89
|
+
className: _propTypes.default.string,
|
|
90
|
+
|
|
91
|
+
/** Children to be rendered. */
|
|
92
|
+
children: _propTypes.default.node,
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* the classes object to be applied.
|
|
96
|
+
*/
|
|
97
|
+
classes: _propTypes.default.shape({
|
|
98
|
+
/**
|
|
99
|
+
* Style applied to the root of the component.
|
|
100
|
+
*/
|
|
101
|
+
root: _propTypes.default.string,
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Style applied to the dropdown in charge of sorting.
|
|
105
|
+
*/
|
|
106
|
+
sortDropdown: _propTypes.default.string
|
|
107
|
+
}).isRequired,
|
|
108
|
+
|
|
109
|
+
/** Placeholder text to be show within the search input. */
|
|
110
|
+
placeholder: _propTypes.default.string,
|
|
111
|
+
|
|
112
|
+
/** Callback fired when the user starts to type in the search field. */
|
|
113
|
+
onSearch: _propTypes.default.func,
|
|
114
|
+
|
|
115
|
+
/** Boolean to control whether if the search input should appears or not. */
|
|
116
|
+
hideSearch: _propTypes.default.bool,
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Extra props to be passed onto the input
|
|
120
|
+
*/
|
|
121
|
+
searchProps: _propTypes.default.object
|
|
122
|
+
} : void 0;
|
|
123
|
+
|
|
124
|
+
var _default = (0, _core.withStyles)(_styles.default, {
|
|
125
|
+
name: "HvLeftControl",
|
|
126
|
+
withTheme: true
|
|
127
|
+
})(HvLeftControl);
|
|
128
|
+
|
|
129
|
+
exports.default = _default;
|
|
130
|
+
//# sourceMappingURL=LeftControl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LeftControl.js","names":["HvLeftControl","id","classes","className","children","placeholder","onSearch","hideSearch","searchProps","others","HvControlsContext","onSearchHandler","onChangeFilter","e","value","root","propTypes","PropTypes","string","node","shape","sortDropdown","isRequired","func","bool","object","styleCreator","name","withTheme"],"sources":["../../../src/Controls/LeftControl/LeftControl.js"],"sourcesContent":["import React, { useContext } from \"react\";\nimport clsx from \"clsx\";\nimport PropTypes from \"prop-types\";\nimport { withStyles } from \"@material-ui/core\";\nimport { HvInput, setId } from \"@hitachivantara/uikit-react-core\";\nimport { HvControlsContext } from \"../context/ControlsContext\";\nimport styleCreator from \"./styles\";\n\nconst HvLeftControl = ({\n id,\n classes,\n className,\n children,\n placeholder = \"Search\",\n onSearch,\n hideSearch = false,\n searchProps,\n ...others\n}) => {\n const { onSearch: onSearchHandler } = useContext(HvControlsContext);\n\n const onChangeFilter = (e, value) => {\n onSearch?.(e, value);\n onSearchHandler?.(value);\n };\n\n return (\n <div id={id} className={clsx(className, classes.root)} {...others}>\n {!hideSearch && (\n <HvInput\n id={setId(id, \"search-input\")}\n type=\"search\"\n placeholder={placeholder}\n onChange={(e, value) => onChangeFilter(e, value)}\n {...searchProps}\n />\n )}\n {children}\n </div>\n );\n};\n\nHvLeftControl.propTypes = {\n /** Children to be rendered. */\n id: PropTypes.string,\n /**\n * Class names to be applied.\n */\n className: PropTypes.string,\n /** Children to be rendered. */\n children: PropTypes.node,\n /**\n * the classes object to be applied.\n */\n classes: PropTypes.shape({\n /**\n * Style applied to the root of the component.\n */\n root: PropTypes.string,\n /**\n * Style applied to the dropdown in charge of sorting.\n */\n sortDropdown: PropTypes.string,\n }).isRequired,\n /** Placeholder text to be show within the search input. */\n placeholder: PropTypes.string,\n /** Callback fired when the user starts to type in the search field. */\n onSearch: PropTypes.func,\n /** Boolean to control whether if the search input should appears or not. */\n hideSearch: PropTypes.bool,\n /**\n * Extra props to be passed onto the input\n */\n searchProps: PropTypes.object,\n};\n\nexport default withStyles(styleCreator, { name: \"HvLeftControl\", withTheme: true })(HvLeftControl);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEA,IAAMA,aAAa,GAAG,SAAhBA,aAAgB,OAUhB;EAAA,IATJC,EASI,QATJA,EASI;EAAA,IARJC,OAQI,QARJA,OAQI;EAAA,IAPJC,SAOI,QAPJ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mBAAUC,MAJO;;IAKvB;AACJ;AACA;IACIG,YAAY,EAAEJ,mBAAUC;EARD,CAAhB,EASNI,UArBqB;;EAsBxB;EACAjB,WAAW,EAAEY,mBAAUC,MAvBC;;EAwBxB;EACAZ,QAAQ,EAAEW,mBAAUM,IAzBI;;EA0BxB;EACAhB,UAAU,EAAEU,mBAAUO,IA3BE;;EA4BxB;AACF;AACA;EACEhB,WAAW,EAAES,mBAAUQ;AA/BC,CAA1B;;eAkCe,sBAAWC,eAAX,EAAyB;EAAEC,IAAI,EAAE,eAAR;EAAyBC,SAAS,EAAE;AAApC,CAAzB,EAAqE5B,aAArE,C"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
Object.defineProperty(exports, "default", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function get() {
|
|
11
|
+
return _LeftControl.default;
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
var _LeftControl = _interopRequireDefault(require("./LeftControl"));
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/Controls/LeftControl/index.js"],"sourcesContent":["export { default } from \"./LeftControl\";\n"],"mappings":";;;;;;;;;;;;;;AAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var styles = function styles() {
|
|
9
|
+
return {
|
|
10
|
+
root: {
|
|
11
|
+
display: "inline-flex",
|
|
12
|
+
gap: 10
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
var _default = styles;
|
|
18
|
+
exports.default = _default;
|
|
19
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","names":["styles","root","display","gap"],"sources":["../../../src/Controls/LeftControl/styles.js"],"sourcesContent":["const styles = () => ({\n root: {\n display: \"inline-flex\",\n gap: 10,\n },\n});\n\nexport default styles;\n"],"mappings":";;;;;;;AAAA,IAAMA,MAAM,GAAG,SAATA,MAAS;EAAA,OAAO;IACpBC,IAAI,EAAE;MACJC,OAAO,EAAE,aADL;MAEJC,GAAG,EAAE;IAFD;EADc,CAAP;AAAA,CAAf;;eAOeH,M"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { StandardProps } from "@material-ui/core";
|
|
2
|
+
import { HvDropdownProps, ListValueProp } from "@hitachivantara/uikit-react-core";
|
|
3
|
+
|
|
4
|
+
export type HvRightControlClassKey = "root" | "sortDropdown";
|
|
5
|
+
|
|
6
|
+
export interface HvControlsViewConfiguration extends Record<string, unknown> {
|
|
7
|
+
id: string;
|
|
8
|
+
label: string;
|
|
9
|
+
icon: React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface RightListControls extends ListValueProp {
|
|
13
|
+
accesor: string;
|
|
14
|
+
desc: boolean;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface HvRightControlProps
|
|
18
|
+
extends StandardProps<React.HTMLAttributes<HTMLDivElement>, HvRightControlClassKey> {
|
|
19
|
+
/** Children to be rendered. */
|
|
20
|
+
id?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Class names to be applied.
|
|
23
|
+
*/
|
|
24
|
+
className?: string;
|
|
25
|
+
/**
|
|
26
|
+
* if `true` the hide sort by dropdown is not rendered
|
|
27
|
+
*/
|
|
28
|
+
hideSortBy?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* options for the dropdown to sort
|
|
31
|
+
*/
|
|
32
|
+
values?: RightListControls[];
|
|
33
|
+
/**
|
|
34
|
+
* Callback called when a sort action occurs
|
|
35
|
+
*/
|
|
36
|
+
onSort?: (selected: RightListControls | ListValueProp | ListValueProp[] | undefined) => void;
|
|
37
|
+
/**
|
|
38
|
+
* Extra props passed to dropdown
|
|
39
|
+
*/
|
|
40
|
+
sortProps?: HvDropdownProps;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export default function HvRightControl(props: HvRightControlProps): JSX.Element | null;
|