@scheels-softdev/kendoreact-generics 2.9.3 → 2.9.5
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/GenericDropdown.js
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
2
2
|
import { ComboBox } from "@progress/kendo-react-dropdowns";
|
3
3
|
import { useState, useEffect } from "react";
|
4
|
-
const total = 5000;
|
5
4
|
const pageSize = 12;
|
6
5
|
export function GenericDropdown(props) {
|
7
6
|
var _a, _b, _c, _d;
|
@@ -12,6 +11,7 @@ export function GenericDropdown(props) {
|
|
12
11
|
const [state, setState] = useState({
|
13
12
|
subsetData: props.data.slice(0, pageSize),
|
14
13
|
skip: 0,
|
14
|
+
total: props.data.length,
|
15
15
|
});
|
16
16
|
const pageChange = (event) => {
|
17
17
|
const skip = event.page.skip;
|
@@ -20,13 +20,14 @@ export function GenericDropdown(props) {
|
|
20
20
|
setState({
|
21
21
|
subsetData: newSubsetData,
|
22
22
|
skip: skip,
|
23
|
+
total: props.data.length,
|
23
24
|
});
|
24
25
|
};
|
25
26
|
return (_jsx(ComboBox, { data: state.subsetData, dataItemKey: (_b = (_a = props.idField) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : undefined, textField: props.textField.toString(), virtual: {
|
26
|
-
total:
|
27
|
+
total: props.data.length,
|
27
28
|
pageSize: pageSize,
|
28
29
|
skip: state.skip,
|
29
30
|
}, label: (_c = props.title) !== null && _c !== void 0 ? _c : "Select an option", onPageChange: pageChange, popupSettings: {
|
30
31
|
height: "250px",
|
31
|
-
}, defaultValue: props, style: Object.assign({ width: "300px" }, props.style), onChange: (event) => props.onChange(event), disabled: props.isLoading, value: (_d = props.selectedData) !== null && _d !== void 0 ? _d : props.data.find((d) => d[props.idField] === props.selectedId) }));
|
32
|
+
}, defaultValue: props, style: Object.assign({ width: "300px" }, props.style), onChange: (event) => props.onChange(event), disabled: props.isLoading, value: (_d = props.selectedData) !== null && _d !== void 0 ? _d : props.data.find((d) => d[props.idField] === props.selectedId), clearButton: props.hideClearButton ? undefined : true }));
|
32
33
|
}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import { ComboBoxChangeEvent } from "@progress/kendo-react-dropdowns";
|
2
|
+
export declare function CommandCellDDWithoutId<T>(props: {
|
3
|
+
/** The data array for the dropdown options. */
|
4
|
+
data: T[];
|
5
|
+
/** The currently selected data item. */
|
6
|
+
selectedData: T;
|
7
|
+
/** The field names to use for text values in the dropdown. */
|
8
|
+
textField: keyof T;
|
9
|
+
/** Callback function to be called when the selected value changes. */
|
10
|
+
onChange: (e: ComboBoxChangeEvent) => void;
|
11
|
+
/** Optional separator to use for concatenating text values. */
|
12
|
+
separator?: string;
|
13
|
+
/** Determines if the edit field should be checked. */
|
14
|
+
checkEditField?: boolean;
|
15
|
+
/** Determines if the cell is in an editing state. */
|
16
|
+
isEditing?: boolean;
|
17
|
+
/** Determines if the clear button should be displayed in the dropdown. */
|
18
|
+
showClearButton?: boolean;
|
19
|
+
}): import("react/jsx-runtime").JSX.Element;
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
2
|
+
import { GenericDropdown } from "../GenericDropdown";
|
3
|
+
export function CommandCellDDWithoutId(props) {
|
4
|
+
// Function implementation...
|
5
|
+
return (_jsx("td", { children: props.checkEditField && !props.isEditing ? (_jsx(_Fragment, {}) //TODO remove this from Marketing display
|
6
|
+
) : (
|
7
|
+
// If "props.checkEditField" is false or "props.isEditing" is true, render the GenericDropdownWithSearch component with the "props" passed to it
|
8
|
+
_jsx(GenericDropdown, Object.assign({}, props))) }));
|
9
|
+
}
|