glints-aries 4.0.374 → 4.0.375
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.
|
@@ -2,9 +2,10 @@ import React from 'react';
|
|
|
2
2
|
import { IndexTableProps as PolarisIndexTableProps } from 'polaris-glints';
|
|
3
3
|
declare type IndexTableProps = Omit<PolarisIndexTableProps, 'emptySearchTitle'> & {
|
|
4
4
|
height?: string;
|
|
5
|
+
selectableItemsCount?: number;
|
|
5
6
|
};
|
|
6
7
|
declare const IndexTable: {
|
|
7
|
-
({ bulkActions, children, height, itemCount, selectedItemsCount, loading, emptyState, ...props }: IndexTableProps): JSX.Element;
|
|
8
|
+
({ bulkActions, children, height, itemCount, selectedItemsCount, loading, emptyState, selectableItemsCount, ...props }: IndexTableProps): JSX.Element;
|
|
8
9
|
Cell: React.NamedExoticComponent<import("polaris-glints/build/ts/latest/src/components/IndexTable").CellProps>;
|
|
9
10
|
Row: ({ children, ...props }: import("polaris-glints").RowProps) => JSX.Element;
|
|
10
11
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
3
|
-
var _excluded = ["bulkActions", "children", "height", "itemCount", "selectedItemsCount", "loading", "emptyState"],
|
|
3
|
+
var _excluded = ["bulkActions", "children", "height", "itemCount", "selectedItemsCount", "loading", "emptyState", "selectableItemsCount"],
|
|
4
4
|
_excluded2 = ["checked", "onChange"];
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { Cell, IndexTable as PolarisIndexTable } from 'polaris-glints';
|
|
@@ -17,6 +17,7 @@ var IndexTable = function IndexTable(_ref) {
|
|
|
17
17
|
selectedItemsCount = _ref.selectedItemsCount,
|
|
18
18
|
loading = _ref.loading,
|
|
19
19
|
emptyState = _ref.emptyState,
|
|
20
|
+
selectableItemsCount = _ref.selectableItemsCount,
|
|
20
21
|
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
21
22
|
var renderCheckboxHeader = function renderCheckboxHeader(_ref2) {
|
|
22
23
|
var checked = _ref2.checked,
|
|
@@ -25,7 +26,8 @@ var IndexTable = function IndexTable(_ref) {
|
|
|
25
26
|
return /*#__PURE__*/React.createElement(CheckboxCellContentContainer, null, /*#__PURE__*/React.createElement(Checkbox, _extends({
|
|
26
27
|
onChange: onChange,
|
|
27
28
|
checked: checked,
|
|
28
|
-
isPadded: false
|
|
29
|
+
isPadded: false,
|
|
30
|
+
disabled: props.disabled || selectableItemsCount === 0
|
|
29
31
|
}, props)));
|
|
30
32
|
};
|
|
31
33
|
var checkbox = !loading && itemCount > 0 ? renderCheckboxHeader : undefined;
|
|
@@ -2,9 +2,10 @@ import React from 'react';
|
|
|
2
2
|
import { IndexTableProps as PolarisIndexTableProps } from 'polaris-glints';
|
|
3
3
|
declare type IndexTableProps = Omit<PolarisIndexTableProps, 'emptySearchTitle'> & {
|
|
4
4
|
height?: string;
|
|
5
|
+
selectableItemsCount?: number;
|
|
5
6
|
};
|
|
6
7
|
declare const IndexTable: {
|
|
7
|
-
({ bulkActions, children, height, itemCount, selectedItemsCount, loading, emptyState, ...props }: IndexTableProps): JSX.Element;
|
|
8
|
+
({ bulkActions, children, height, itemCount, selectedItemsCount, loading, emptyState, selectableItemsCount, ...props }: IndexTableProps): JSX.Element;
|
|
8
9
|
Cell: React.NamedExoticComponent<import("polaris-glints/build/ts/latest/src/components/IndexTable").CellProps>;
|
|
9
10
|
Row: ({ children, ...props }: import("polaris-glints").RowProps) => JSX.Element;
|
|
10
11
|
};
|
|
@@ -13,7 +13,7 @@ var _Row = require("./components/Row/Row");
|
|
|
13
13
|
var _IndexTableStyle = require("./IndexTableStyle");
|
|
14
14
|
var _LoadingState = require("./components/LoadingState");
|
|
15
15
|
var _CheckboxStyle = require("./components/Checkbox/CheckboxStyle");
|
|
16
|
-
var _excluded = ["bulkActions", "children", "height", "itemCount", "selectedItemsCount", "loading", "emptyState"],
|
|
16
|
+
var _excluded = ["bulkActions", "children", "height", "itemCount", "selectedItemsCount", "loading", "emptyState", "selectableItemsCount"],
|
|
17
17
|
_excluded2 = ["checked", "onChange"];
|
|
18
18
|
var IndexTable = function IndexTable(_ref) {
|
|
19
19
|
var bulkActions = _ref.bulkActions,
|
|
@@ -23,6 +23,7 @@ var IndexTable = function IndexTable(_ref) {
|
|
|
23
23
|
selectedItemsCount = _ref.selectedItemsCount,
|
|
24
24
|
loading = _ref.loading,
|
|
25
25
|
emptyState = _ref.emptyState,
|
|
26
|
+
selectableItemsCount = _ref.selectableItemsCount,
|
|
26
27
|
props = (0, _objectWithoutPropertiesLoose2["default"])(_ref, _excluded);
|
|
27
28
|
var renderCheckboxHeader = function renderCheckboxHeader(_ref2) {
|
|
28
29
|
var checked = _ref2.checked,
|
|
@@ -31,7 +32,8 @@ var IndexTable = function IndexTable(_ref) {
|
|
|
31
32
|
return /*#__PURE__*/_react["default"].createElement(_CheckboxStyle.CheckboxCellContentContainer, null, /*#__PURE__*/_react["default"].createElement(_Checkbox.Checkbox, (0, _extends2["default"])({
|
|
32
33
|
onChange: onChange,
|
|
33
34
|
checked: checked,
|
|
34
|
-
isPadded: false
|
|
35
|
+
isPadded: false,
|
|
36
|
+
disabled: props.disabled || selectableItemsCount === 0
|
|
35
37
|
}, props)));
|
|
36
38
|
};
|
|
37
39
|
var checkbox = !loading && itemCount > 0 ? renderCheckboxHeader : undefined;
|