@devtron-labs/devtron-fe-common-lib 0.0.61-beta-3 → 0.0.61-beta-4
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/Shared/Components/BulkSelection/types.d.ts +2 -0
- package/dist/index.js +4 -2
- package/package.json +1 -1
- package/src/Shared/Components/BulkSelection/BulkSelection.tsx +2 -2
- package/src/Shared/Components/BulkSelection/BulkSelectionProvider.tsx +2 -0
- package/src/Shared/Components/BulkSelection/types.tsx +2 -0
|
@@ -23,6 +23,8 @@ export interface GetBulkSelectionCheckboxValuesType {
|
|
|
23
23
|
export interface UseBulkSelectionReturnType<T> extends GetBulkSelectionCheckboxValuesType {
|
|
24
24
|
selectedIdentifiers: T;
|
|
25
25
|
handleBulkSelection: ({ action, data }: HandleBulkSelectionType<T>) => void;
|
|
26
|
+
isBulkSelectionApplied: boolean;
|
|
27
|
+
getSelectedIdentifiersCount: () => number;
|
|
26
28
|
}
|
|
27
29
|
export interface BulkSelectionProps {
|
|
28
30
|
showPagination: boolean;
|
package/dist/index.js
CHANGED
|
@@ -29021,6 +29021,8 @@ var BulkSelectionContext = React.createContext({
|
|
|
29021
29021
|
handleBulkSelection: noop$1,
|
|
29022
29022
|
isChecked: false,
|
|
29023
29023
|
checkboxValue: exports.CHECKBOX_VALUE.CHECKED,
|
|
29024
|
+
isBulkSelectionApplied: false,
|
|
29025
|
+
getSelectedIdentifiersCount: noop$1,
|
|
29024
29026
|
});
|
|
29025
29027
|
var useBulkSelection = function () {
|
|
29026
29028
|
var context = React.useContext(BulkSelectionContext);
|
|
@@ -29218,8 +29220,8 @@ var SvgIcClose = function SvgIcClose(props) {
|
|
|
29218
29220
|
|
|
29219
29221
|
var BulkSelection = function (_a) {
|
|
29220
29222
|
var showPagination = _a.showPagination;
|
|
29221
|
-
var _b = useBulkSelection(), handleBulkSelection = _b.handleBulkSelection,
|
|
29222
|
-
var areOptionsSelected =
|
|
29223
|
+
var _b = useBulkSelection(), handleBulkSelection = _b.handleBulkSelection, isChecked = _b.isChecked, checkboxValue = _b.checkboxValue, getSelectedIdentifiersCount = _b.getSelectedIdentifiersCount;
|
|
29224
|
+
var areOptionsSelected = getSelectedIdentifiersCount() > 0;
|
|
29223
29225
|
var BulkSelectionItems = __spreadArray(__spreadArray([
|
|
29224
29226
|
{
|
|
29225
29227
|
locator: exports.BulkSelectionEvents.SELECT_ALL_ON_PAGE,
|
package/package.json
CHANGED
|
@@ -9,8 +9,8 @@ import { ReactComponent as ICCheckAll } from '../../../Assets/Icon/ic-check-all.
|
|
|
9
9
|
import { ReactComponent as ICClose } from '../../../Assets/Icon/ic-close.svg'
|
|
10
10
|
|
|
11
11
|
const BulkSelection = <T,>({ showPagination }: BulkSelectionProps) => {
|
|
12
|
-
const { handleBulkSelection,
|
|
13
|
-
const areOptionsSelected =
|
|
12
|
+
const { handleBulkSelection, isChecked, checkboxValue, getSelectedIdentifiersCount } = useBulkSelection<T>()
|
|
13
|
+
const areOptionsSelected = getSelectedIdentifiersCount() > 0
|
|
14
14
|
const BulkSelectionItems: BulkSelectionDropdownItemsType[] = [
|
|
15
15
|
{
|
|
16
16
|
locator: BulkSelectionEvents.SELECT_ALL_ON_PAGE,
|
|
@@ -16,6 +16,8 @@ const BulkSelectionContext = createContext<UseBulkSelectionReturnType<any>>({
|
|
|
16
16
|
handleBulkSelection: noop,
|
|
17
17
|
isChecked: false,
|
|
18
18
|
checkboxValue: CHECKBOX_VALUE.CHECKED,
|
|
19
|
+
isBulkSelectionApplied: false,
|
|
20
|
+
getSelectedIdentifiersCount: noop,
|
|
19
21
|
})
|
|
20
22
|
|
|
21
23
|
export const useBulkSelection = <T,>() => {
|
|
@@ -26,6 +26,8 @@ export interface GetBulkSelectionCheckboxValuesType {
|
|
|
26
26
|
export interface UseBulkSelectionReturnType<T> extends GetBulkSelectionCheckboxValuesType {
|
|
27
27
|
selectedIdentifiers: T
|
|
28
28
|
handleBulkSelection: ({ action, data }: HandleBulkSelectionType<T>) => void
|
|
29
|
+
isBulkSelectionApplied: boolean
|
|
30
|
+
getSelectedIdentifiersCount: () => number
|
|
29
31
|
}
|
|
30
32
|
|
|
31
33
|
export interface BulkSelectionProps {
|