- this.onChangeOutput(value, 'collection1')}
- />
- this.onChangeOutput(value, 'collection2')}
- />
+ triggerOptions={{ placeholder: "Input Collection 1" }}
+ onSelect={(option) => this.onChangeOutput(option.value, 'collection1')}
+ >
+
+ {options.map((item, key) => {
+ return (
+
+ {item.label}
+
+ )
+ })}
+
+
+
Destination
@@ -130,11 +150,21 @@ const customCode = `
- this.onChangeOutput(value, 'collection')}
- />
+
@@ -148,9 +178,35 @@ const customCode = `
- this.onChangeOutput(value, 'retention')} />
+
- this.onChangeOutput(value, 'clarification')} />
+
@@ -165,14 +221,24 @@ const customCode = `
- {
+
diff --git a/core/components/patterns/forms/TimePeriodForm.story.tsx b/core/components/patterns/forms/TimePeriodForm.story.tsx
index c28c375626..947b51a2e0 100644
--- a/core/components/patterns/forms/TimePeriodForm.story.tsx
+++ b/core/components/patterns/forms/TimePeriodForm.story.tsx
@@ -32,11 +32,31 @@ const customCode = `
-
+
-
+
Add organizations
diff --git a/core/components/patterns/table/TableWithHeader/tableWithHeader.story.jsx b/core/components/patterns/table/TableWithHeader/tableWithHeader.story.jsx
index 70c5153a3f..2f401ee6b3 100644
--- a/core/components/patterns/table/TableWithHeader/tableWithHeader.story.jsx
+++ b/core/components/patterns/table/TableWithHeader/tableWithHeader.story.jsx
@@ -344,6 +344,73 @@ import './style.css';
? \`Showing \${startIndex}-\${endIndex} of \${totalRecords} item\${getPluralSuffix(totalRecords)}\`
: \`Showing \${totalRecords} item\${getPluralSuffix(totalRecords)}\`;
+ const nameOptions = [
+ { label: 'A-G', value: 'a-g' },
+ { label: 'H-R', value: 'h-r' },
+ { label: 'S-Z', value: 's-z' }
+ ];
+
+ const selectRef = React.useRef(null);
+ const [selectedOptions, setSelectedOptions] = React.useState([]);
+ const [previousSelectedOptions, setPreviousSelectedOptions] = React.useState([]);
+ const [checkedState, setCheckedState] = React.useState('unchecked');
+ const [isDisabled, setIsDisabled] = React.useState(true);
+
+ const handleSelect = (selectedOption) => {
+ setIsDisabled(false);
+ console.log('selectedOption', selectedOption);
+ setSelectedOptions(selectedOption);
+ };
+
+ const handleSelectAllClick = (selectedOption) => {
+ setIsDisabled(false);
+ console.log(selectedOption, 'handleSelectAllClick');
+ if (checkedState === 'checked') {
+ setCheckedState('unchecked');
+ setSelectedOptions([]);
+ } else {
+ setCheckedState('checked');
+ setSelectedOptions(nameOptions);
+ }
+ };
+
+ const onClearHandler = () => {
+ setCheckedState('unchecked');
+ setSelectedOptions([]);
+ setPreviousSelectedOptions([]);
+ };
+
+ const onApplyOptions = () => {
+ console.log('onApply button called');
+ selectRef.current.setOpen(false);
+ setPreviousSelectedOptions(selectedOptions);
+ onFilterChange('name', selectedOptions.map(option => option.value));
+ };
+
+ const onCancelOptions = () => {
+ console.log('onCancel button called');
+ selectRef.current.setOpen(false);
+ setSelectedOptions(previousSelectedOptions);
+ };
+
+ const onOutsideClickHandler = () => {
+ setSelectedOptions(previousSelectedOptions);
+ };
+
+ React.useEffect(() => {
+ setSelectedOptions(previousSelectedOptions);
+ }, [previousSelectedOptions]);
+
+ React.useEffect(() => {
+ if (selectedOptions.length === nameOptions.length) {
+ setCheckedState('checked');
+ } else if (selectedOptions.length === 0) {
+ setCheckedState('unchecked');
+ } else {
+ setCheckedState('indeterminate');
+ }
+ }, [checkedState, selectedOptions]);
+
return (
@@ -361,19 +428,58 @@ import './style.css';
- onFilterChange("name", selected)}
- />
+
- this.onFilterChange("gender", selected)}
- />
+