@thecb/components 10.11.0-beta.1 → 10.11.1
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/index.cjs.js +80 -60
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.esm.js +80 -60
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/.DS_Store +0 -0
- package/src/components/atoms/search/Search.js +3 -1
- package/src/components/atoms/search/index.d.ts +1 -0
- package/src/components/atoms/sortable-table-heading/SortableTableHeading.js +4 -1
- package/src/components/atoms/sortable-table-heading/index.d.ts +1 -0
- package/src/components/atoms/state-province-dropdown/options.js +4 -1
- package/src/components/molecules/multiple-select-filter/MultipleSelectFilter.js +3 -3
package/package.json
CHANGED
|
Binary file
|
|
@@ -27,6 +27,7 @@ const Search = ({
|
|
|
27
27
|
field,
|
|
28
28
|
fieldActions,
|
|
29
29
|
dataset,
|
|
30
|
+
disableFilter = false, // Some implementations may prefer to filter the list at the application level (e.g., Revenue Management centralizing search, sort, and filtering Users state).
|
|
30
31
|
valuesToSearchFor,
|
|
31
32
|
onSearchCallback,
|
|
32
33
|
onClearCallback,
|
|
@@ -52,7 +53,8 @@ const Search = ({
|
|
|
52
53
|
);
|
|
53
54
|
};
|
|
54
55
|
|
|
55
|
-
const handleSubmit = () =>
|
|
56
|
+
const handleSubmit = () =>
|
|
57
|
+
disableFilter ? onSearchCallback() : onSearchCallback(getFilteredDataset());
|
|
56
58
|
|
|
57
59
|
return (
|
|
58
60
|
<Cluster extraStyles={`overflow: visible; width: ${width}; ${extraStyles}`}>
|
|
@@ -5,9 +5,11 @@ import { fallbackValues } from "./SortableTableHeading.theme";
|
|
|
5
5
|
import { themeComponent } from "../../../util/themeUtils";
|
|
6
6
|
import { Cluster, Stack } from "../layouts";
|
|
7
7
|
import { TableHeading } from "../table";
|
|
8
|
+
import { noop } from "../../../util/general";
|
|
8
9
|
|
|
9
10
|
const SortableTableHeading = ({
|
|
10
11
|
ariaControlsId,
|
|
12
|
+
disabled = false,
|
|
11
13
|
displayName,
|
|
12
14
|
onSortChange,
|
|
13
15
|
sortOrder = null,
|
|
@@ -22,8 +24,9 @@ const SortableTableHeading = ({
|
|
|
22
24
|
};
|
|
23
25
|
return (
|
|
24
26
|
<TableHeading
|
|
27
|
+
disabled={disabled}
|
|
25
28
|
extraStyles={`cursor: pointer; ${extraStyles}`}
|
|
26
|
-
onClick={onSortChange}
|
|
29
|
+
onClick={event => (disabled ? noop : onSortChange(event))}
|
|
27
30
|
aria-controls={ariaControlsId}
|
|
28
31
|
>
|
|
29
32
|
<Cluster justify="space-between">
|
|
@@ -4,6 +4,7 @@ import Expand from "../../../util/expand";
|
|
|
4
4
|
export type SortOrder = "asc" | "desc" | null;
|
|
5
5
|
export interface SortableTableHeadingProps {
|
|
6
6
|
ariaControlsId: string;
|
|
7
|
+
disabled?: boolean; // Useful if you want to render the component while data is fetching
|
|
7
8
|
displayName: string; // The name displayed in the <th> element
|
|
8
9
|
onSortChange: () => void;
|
|
9
10
|
sortOrder: SortOrder;
|
|
@@ -3650,7 +3650,10 @@ const allOptions = {
|
|
|
3650
3650
|
{ text: "Washington", value: "WA" },
|
|
3651
3651
|
{ text: "West Virginia", value: "WV" },
|
|
3652
3652
|
{ text: "Wisconsin", value: "WI" },
|
|
3653
|
-
{ text: "Wyoming", value: "WY" }
|
|
3653
|
+
{ text: "Wyoming", value: "WY" },
|
|
3654
|
+
{ text: "Armed Forces Americas", value: "AA" },
|
|
3655
|
+
{ text: "Armed Forces Europe", value: "AE" },
|
|
3656
|
+
{ text: "Armed Forces Pacific", value: "AP" }
|
|
3654
3657
|
],
|
|
3655
3658
|
UM: [{ text: "Palmyra Atoll", value: "95" }],
|
|
3656
3659
|
UY: [
|
|
@@ -180,9 +180,9 @@ const MultipleSelectFilter = ({
|
|
|
180
180
|
: WHITE;
|
|
181
181
|
const contentColor = !opened && selectedOptions?.length ? WHITE : "#292A33";
|
|
182
182
|
|
|
183
|
-
const completeOptionsList = itemList
|
|
184
|
-
|
|
185
|
-
|
|
183
|
+
const completeOptionsList = itemList
|
|
184
|
+
.slice()
|
|
185
|
+
.sort((a, b) => a.name.toLowerCase().localeCompare(b.name.toLowerCase()));
|
|
186
186
|
const selectValues = items => items.map(item => item.value);
|
|
187
187
|
const selectOption = selectedOption => {
|
|
188
188
|
if (selectValues(selectedOptions).includes(selectedOption.value)) {
|