@ -1,7 +1,7 @@
|
||||
import { ScopedStateKey } from '@/ui/utilities/recoil-scope/scopes-internal/types/ScopedStateKey';
|
||||
import { StateScopeMapKey } from '@/ui/utilities/recoil-scope/scopes-internal/types/StateScopeMapKey';
|
||||
import { createScopeInternalContext } from '@/ui/utilities/recoil-scope/scopes-internal/utils/createScopeInternalContext';
|
||||
|
||||
type ObjectFilterDropdownScopeInternalContextProps = ScopedStateKey;
|
||||
type ObjectFilterDropdownScopeInternalContextProps = StateScopeMapKey;
|
||||
|
||||
export const ObjectFilterDropdownScopeInternalContext =
|
||||
createScopeInternalContext<ObjectFilterDropdownScopeInternalContextProps>();
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { FilterDefinition } from '@/object-record/object-filter-dropdown/types/FilterDefinition';
|
||||
import { createScopedState } from '@/ui/utilities/recoil-scope/utils/createScopedState';
|
||||
import { createStateScopeMap } from '@/ui/utilities/recoil-scope/utils/createStateScopeMap';
|
||||
|
||||
export const availableFilterDefinitionsScopedState = createScopedState<
|
||||
export const availableFilterDefinitionsScopedState = createStateScopeMap<
|
||||
FilterDefinition[]
|
||||
>({
|
||||
key: 'availableFilterDefinitionsScopedState',
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
import { createScopedState } from '@/ui/utilities/recoil-scope/utils/createScopedState';
|
||||
import { createStateScopeMap } from '@/ui/utilities/recoil-scope/utils/createStateScopeMap';
|
||||
|
||||
import { FilterDefinition } from '../types/FilterDefinition';
|
||||
|
||||
export const filterDefinitionUsedInDropdownScopedState =
|
||||
createScopedState<FilterDefinition | null>({
|
||||
createStateScopeMap<FilterDefinition | null>({
|
||||
key: 'filterDefinitionUsedInDropdownScopedState',
|
||||
defaultValue: null,
|
||||
});
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { createScopedState } from '@/ui/utilities/recoil-scope/utils/createScopedState';
|
||||
import { createStateScopeMap } from '@/ui/utilities/recoil-scope/utils/createStateScopeMap';
|
||||
|
||||
export const isObjectFilterDropdownOperandSelectUnfoldedScopedState =
|
||||
createScopedState<boolean>({
|
||||
createStateScopeMap<boolean>({
|
||||
key: 'isObjectFilterDropdownOperandSelectUnfoldedScopedState',
|
||||
defaultValue: false,
|
||||
});
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { createScopedState } from '@/ui/utilities/recoil-scope/utils/createScopedState';
|
||||
import { createStateScopeMap } from '@/ui/utilities/recoil-scope/utils/createStateScopeMap';
|
||||
|
||||
export const isObjectFilterDropdownUnfoldedScopedState =
|
||||
createScopedState<boolean>({
|
||||
createStateScopeMap<boolean>({
|
||||
key: 'isObjectFilterDropdownUnfoldedScopedState',
|
||||
defaultValue: false,
|
||||
});
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { createScopedState } from '@/ui/utilities/recoil-scope/utils/createScopedState';
|
||||
import { createStateScopeMap } from '@/ui/utilities/recoil-scope/utils/createStateScopeMap';
|
||||
|
||||
export const objectFilterDropdownSearchInputScopedState =
|
||||
createScopedState<string>({
|
||||
createStateScopeMap<string>({
|
||||
key: 'objectFilterDropdownSearchInputScopedState',
|
||||
defaultValue: '',
|
||||
});
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { createScopedState } from '@/ui/utilities/recoil-scope/utils/createScopedState';
|
||||
import { createStateScopeMap } from '@/ui/utilities/recoil-scope/utils/createStateScopeMap';
|
||||
|
||||
export const objectFilterDropdownSelectedEntityIdScopedState =
|
||||
createScopedState<string | null>({
|
||||
createStateScopeMap<string | null>({
|
||||
key: 'objectFilterDropdownSelectedEntityIdScopedState',
|
||||
defaultValue: null,
|
||||
});
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { createScopedState } from '@/ui/utilities/recoil-scope/utils/createScopedState';
|
||||
import { createStateScopeMap } from '@/ui/utilities/recoil-scope/utils/createStateScopeMap';
|
||||
|
||||
export const objectFilterDropdownSelectedRecordIdsScopedState =
|
||||
createScopedState<string[]>({
|
||||
createStateScopeMap<string[]>({
|
||||
key: 'objectFilterDropdownSelectedRecordIdsScopedState',
|
||||
defaultValue: [],
|
||||
});
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import { createScopedState } from '@/ui/utilities/recoil-scope/utils/createScopedState';
|
||||
import { createStateScopeMap } from '@/ui/utilities/recoil-scope/utils/createStateScopeMap';
|
||||
|
||||
import { Filter } from '../types/Filter';
|
||||
|
||||
export const onFilterSelectScopedState = createScopedState<
|
||||
export const onFilterSelectScopedState = createStateScopeMap<
|
||||
((filter: Filter) => void) | undefined
|
||||
>({
|
||||
key: 'onFilterSelectScopedState',
|
||||
|
||||
@ -1,8 +1,10 @@
|
||||
import { createScopedState } from '@/ui/utilities/recoil-scope/utils/createScopedState';
|
||||
import { createStateScopeMap } from '@/ui/utilities/recoil-scope/utils/createStateScopeMap';
|
||||
|
||||
import { Filter } from '../types/Filter';
|
||||
|
||||
export const selectedFilterScopedState = createScopedState<Filter | undefined>({
|
||||
export const selectedFilterScopedState = createStateScopeMap<
|
||||
Filter | undefined
|
||||
>({
|
||||
key: 'selectedFilterScopedState',
|
||||
defaultValue: undefined,
|
||||
});
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import { createScopedState } from '@/ui/utilities/recoil-scope/utils/createScopedState';
|
||||
import { createStateScopeMap } from '@/ui/utilities/recoil-scope/utils/createStateScopeMap';
|
||||
import { ViewFilterOperand } from '@/views/types/ViewFilterOperand';
|
||||
|
||||
export const selectedOperandInDropdownScopedState =
|
||||
createScopedState<ViewFilterOperand | null>({
|
||||
createStateScopeMap<ViewFilterOperand | null>({
|
||||
key: 'selectedOperandInDropdownScopedState',
|
||||
defaultValue: null,
|
||||
});
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
import { ScopedStateKey } from '@/ui/utilities/recoil-scope/scopes-internal/types/ScopedStateKey';
|
||||
import { StateScopeMapKey } from '@/ui/utilities/recoil-scope/scopes-internal/types/StateScopeMapKey';
|
||||
import { createScopeInternalContext } from '@/ui/utilities/recoil-scope/scopes-internal/utils/createScopeInternalContext';
|
||||
|
||||
import { Sort } from '../../types/Sort';
|
||||
|
||||
type ObjectSortDropdownScopeInternalContextProps = ScopedStateKey & {
|
||||
type ObjectSortDropdownScopeInternalContextProps = StateScopeMapKey & {
|
||||
onSortSelect?: (sort: Sort) => void;
|
||||
};
|
||||
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import { createScopedState } from '@/ui/utilities/recoil-scope/utils/createScopedState';
|
||||
import { createStateScopeMap } from '@/ui/utilities/recoil-scope/utils/createStateScopeMap';
|
||||
|
||||
import { SortDefinition } from '../types/SortDefinition';
|
||||
|
||||
export const availableSortDefinitionsScopedState = createScopedState<
|
||||
export const availableSortDefinitionsScopedState = createStateScopeMap<
|
||||
SortDefinition[]
|
||||
>({
|
||||
key: 'availableSortDefinitionsScopedState',
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { createScopedState } from '@/ui/utilities/recoil-scope/utils/createScopedState';
|
||||
import { createStateScopeMap } from '@/ui/utilities/recoil-scope/utils/createStateScopeMap';
|
||||
|
||||
export const isSortSelectedScopedState = createScopedState<boolean>({
|
||||
export const isSortSelectedScopedState = createStateScopeMap<boolean>({
|
||||
key: 'isSortSelectedScopedState',
|
||||
defaultValue: false,
|
||||
});
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import { createScopedState } from '@/ui/utilities/recoil-scope/utils/createScopedState';
|
||||
import { createStateScopeMap } from '@/ui/utilities/recoil-scope/utils/createStateScopeMap';
|
||||
|
||||
import { Sort } from '../types/Sort';
|
||||
|
||||
export const onSortSelectScopedState = createScopedState<
|
||||
export const onSortSelectScopedState = createStateScopeMap<
|
||||
((sort: Sort) => void) | undefined
|
||||
>({
|
||||
key: 'onSortSelectScopedState',
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { ScopedStateKey } from '@/ui/utilities/recoil-scope/scopes-internal/types/ScopedStateKey';
|
||||
import { StateScopeMapKey } from '@/ui/utilities/recoil-scope/scopes-internal/types/StateScopeMapKey';
|
||||
import { createScopeInternalContext } from '@/ui/utilities/recoil-scope/scopes-internal/utils/createScopeInternalContext';
|
||||
|
||||
type RecordBoardScopeInternalContextProps = ScopedStateKey;
|
||||
type RecordBoardScopeInternalContextProps = StateScopeMapKey;
|
||||
|
||||
export const RecordBoardScopeInternalContext =
|
||||
createScopeInternalContext<RecordBoardScopeInternalContextProps>();
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
import { createScopedState } from '@/ui/utilities/recoil-scope/utils/createScopedState';
|
||||
import { createStateScopeMap } from '@/ui/utilities/recoil-scope/utils/createStateScopeMap';
|
||||
|
||||
export const activeRecordBoardCardIdsScopedState = createScopedState<string[]>({
|
||||
export const activeRecordBoardCardIdsScopedState = createStateScopeMap<
|
||||
string[]
|
||||
>({
|
||||
key: 'activeRecordBoardCardIdsScopedState',
|
||||
defaultValue: [],
|
||||
});
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
import { FieldMetadata } from '@/object-record/field/types/FieldMetadata';
|
||||
import { createScopedState } from '@/ui/utilities/recoil-scope/utils/createScopedState';
|
||||
import { createStateScopeMap } from '@/ui/utilities/recoil-scope/utils/createStateScopeMap';
|
||||
|
||||
import { BoardFieldDefinition } from '../types/BoardFieldDefinition';
|
||||
|
||||
export const availableRecordBoardCardFieldsScopedState = createScopedState<
|
||||
export const availableRecordBoardCardFieldsScopedState = createStateScopeMap<
|
||||
BoardFieldDefinition<FieldMetadata>[]
|
||||
>({
|
||||
key: 'availableRecordBoardCardFieldsScopedState',
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { createScopedState } from '@/ui/utilities/recoil-scope/utils/createScopedState';
|
||||
import { createStateScopeMap } from '@/ui/utilities/recoil-scope/utils/createStateScopeMap';
|
||||
|
||||
export const isCompactViewEnabledScopedState = createScopedState<boolean>({
|
||||
export const isCompactViewEnabledScopedState = createStateScopeMap<boolean>({
|
||||
key: 'isCompactViewEnabledScopedState',
|
||||
defaultValue: false,
|
||||
});
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { createScopedState } from '@/ui/utilities/recoil-scope/utils/createScopedState';
|
||||
import { createStateScopeMap } from '@/ui/utilities/recoil-scope/utils/createStateScopeMap';
|
||||
|
||||
export const isRecordBoardLoadedScopedState = createScopedState<boolean>({
|
||||
export const isRecordBoardLoadedScopedState = createStateScopeMap<boolean>({
|
||||
key: 'isRecordBoardLoadedScopedState',
|
||||
defaultValue: false,
|
||||
});
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import { FieldMetadata } from '@/object-record/field/types/FieldMetadata';
|
||||
import { BoardFieldDefinition } from '@/object-record/record-board/types/BoardFieldDefinition';
|
||||
import { createScopedState } from '@/ui/utilities/recoil-scope/utils/createScopedState';
|
||||
import { createStateScopeMap } from '@/ui/utilities/recoil-scope/utils/createStateScopeMap';
|
||||
|
||||
export const onFieldsChangeScopedState = createScopedState<
|
||||
export const onFieldsChangeScopedState = createStateScopeMap<
|
||||
(fields: BoardFieldDefinition<FieldMetadata>[]) => void
|
||||
>({
|
||||
key: 'onFieldsChangeScopedState',
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
import { FieldMetadata } from '@/object-record/field/types/FieldMetadata';
|
||||
import { createScopedState } from '@/ui/utilities/recoil-scope/utils/createScopedState';
|
||||
import { createStateScopeMap } from '@/ui/utilities/recoil-scope/utils/createStateScopeMap';
|
||||
|
||||
import { BoardFieldDefinition } from '../types/BoardFieldDefinition';
|
||||
|
||||
export const recordBoardCardFieldsScopedState = createScopedState<
|
||||
export const recordBoardCardFieldsScopedState = createStateScopeMap<
|
||||
BoardFieldDefinition<FieldMetadata>[]
|
||||
>({
|
||||
key: 'recordBoardCardFieldsScopedState',
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { BoardColumnDefinition } from '@/object-record/record-board/types/BoardColumnDefinition';
|
||||
import { createScopedState } from '@/ui/utilities/recoil-scope/utils/createScopedState';
|
||||
import { createStateScopeMap } from '@/ui/utilities/recoil-scope/utils/createStateScopeMap';
|
||||
|
||||
export const recordBoardColumnsScopedState = createScopedState<
|
||||
export const recordBoardColumnsScopedState = createStateScopeMap<
|
||||
BoardColumnDefinition[]
|
||||
>({
|
||||
key: 'recordBoardColumnsScopedState',
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { Filter } from '@/object-record/object-filter-dropdown/types/Filter';
|
||||
import { createScopedState } from '@/ui/utilities/recoil-scope/utils/createScopedState';
|
||||
import { createStateScopeMap } from '@/ui/utilities/recoil-scope/utils/createStateScopeMap';
|
||||
|
||||
export const recordBoardFiltersScopedState = createScopedState<Filter[]>({
|
||||
export const recordBoardFiltersScopedState = createStateScopeMap<Filter[]>({
|
||||
key: 'recordBoardFiltersScopedState',
|
||||
defaultValue: [],
|
||||
});
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import { createScopedState } from '@/ui/utilities/recoil-scope/utils/createScopedState';
|
||||
import { createStateScopeMap } from '@/ui/utilities/recoil-scope/utils/createStateScopeMap';
|
||||
|
||||
import { Sort } from '../../object-sort-dropdown/types/Sort';
|
||||
|
||||
export const recordBoardSortsScopedState = createScopedState<Sort[]>({
|
||||
export const recordBoardSortsScopedState = createStateScopeMap<Sort[]>({
|
||||
key: 'recordBoardSortsScopedState',
|
||||
defaultValue: [],
|
||||
});
|
||||
|
||||
@ -1,7 +1,9 @@
|
||||
import { Opportunity } from '@/pipeline/types/Opportunity';
|
||||
import { createScopedState } from '@/ui/utilities/recoil-scope/utils/createScopedState';
|
||||
import { createStateScopeMap } from '@/ui/utilities/recoil-scope/utils/createStateScopeMap';
|
||||
|
||||
export const savedOpportunitiesScopedState = createScopedState<Opportunity[]>({
|
||||
key: 'savedOpportunitiesScopedState',
|
||||
defaultValue: [],
|
||||
});
|
||||
export const savedOpportunitiesScopedState = createStateScopeMap<Opportunity[]>(
|
||||
{
|
||||
key: 'savedOpportunitiesScopedState',
|
||||
defaultValue: [],
|
||||
},
|
||||
);
|
||||
|
||||
@ -1,7 +1,9 @@
|
||||
import { PipelineStep } from '@/pipeline/types/PipelineStep';
|
||||
import { createScopedState } from '@/ui/utilities/recoil-scope/utils/createScopedState';
|
||||
import { createStateScopeMap } from '@/ui/utilities/recoil-scope/utils/createStateScopeMap';
|
||||
|
||||
export const savedPipelineStepsScopedState = createScopedState<PipelineStep[]>({
|
||||
export const savedPipelineStepsScopedState = createStateScopeMap<
|
||||
PipelineStep[]
|
||||
>({
|
||||
key: 'savedPipelineStepsScopedState',
|
||||
defaultValue: [],
|
||||
});
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
import { FieldMetadata } from '@/object-record/field/types/FieldMetadata';
|
||||
import { createScopedState } from '@/ui/utilities/recoil-scope/utils/createScopedState';
|
||||
import { createStateScopeMap } from '@/ui/utilities/recoil-scope/utils/createStateScopeMap';
|
||||
|
||||
import { BoardFieldDefinition } from '../types/BoardFieldDefinition';
|
||||
|
||||
export const savedRecordBoardCardFieldsScopedState = createScopedState<
|
||||
export const savedRecordBoardCardFieldsScopedState = createStateScopeMap<
|
||||
BoardFieldDefinition<FieldMetadata>[]
|
||||
>({
|
||||
key: 'savedRecordBoardCardFieldsScopedState',
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import { createScopedState } from '@/ui/utilities/recoil-scope/utils/createScopedState';
|
||||
import { createStateScopeMap } from '@/ui/utilities/recoil-scope/utils/createStateScopeMap';
|
||||
|
||||
import { BoardColumnDefinition } from '../types/BoardColumnDefinition';
|
||||
|
||||
export const savedRecordBoardColumnsScopedState = createScopedState<
|
||||
export const savedRecordBoardColumnsScopedState = createStateScopeMap<
|
||||
BoardColumnDefinition[]
|
||||
>({
|
||||
key: 'savedRecordBoardColumnsScopedState',
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { Company } from '@/companies/types/Company';
|
||||
import { createScopedState } from '@/ui/utilities/recoil-scope/utils/createScopedState';
|
||||
import { createStateScopeMap } from '@/ui/utilities/recoil-scope/utils/createStateScopeMap';
|
||||
|
||||
export const savedRecordsScopedState = createScopedState<Company[]>({
|
||||
export const savedRecordsScopedState = createStateScopeMap<Company[]>({
|
||||
key: 'savedRecordsScopedState',
|
||||
defaultValue: [],
|
||||
});
|
||||
|
||||
@ -1,22 +1,24 @@
|
||||
import { createScopedSelector } from '@/ui/utilities/recoil-scope/utils/createScopedSelector';
|
||||
import { createSelectorScopeMap } from '@/ui/utilities/recoil-scope/utils/createSelectorScopeMap';
|
||||
|
||||
import { availableRecordBoardCardFieldsScopedState } from '../availableRecordBoardCardFieldsScopedState';
|
||||
import { recordBoardCardFieldsScopedState } from '../recordBoardCardFieldsScopedState';
|
||||
|
||||
export const hiddenRecordBoardCardFieldsScopedSelector = createScopedSelector({
|
||||
key: 'hiddenRecordBoardCardFieldsScopedSelector',
|
||||
get:
|
||||
({ scopeId }) =>
|
||||
({ get }) => {
|
||||
const fields = get(recordBoardCardFieldsScopedState({ scopeId }));
|
||||
const fieldKeys = fields.map(({ fieldMetadataId }) => fieldMetadataId);
|
||||
const otherAvailableKeys = get(
|
||||
availableRecordBoardCardFieldsScopedState({ scopeId }),
|
||||
).filter(({ fieldMetadataId }) => !fieldKeys.includes(fieldMetadataId));
|
||||
export const hiddenRecordBoardCardFieldsScopedSelector = createSelectorScopeMap(
|
||||
{
|
||||
key: 'hiddenRecordBoardCardFieldsScopedSelector',
|
||||
get:
|
||||
({ scopeId }) =>
|
||||
({ get }) => {
|
||||
const fields = get(recordBoardCardFieldsScopedState({ scopeId }));
|
||||
const fieldKeys = fields.map(({ fieldMetadataId }) => fieldMetadataId);
|
||||
const otherAvailableKeys = get(
|
||||
availableRecordBoardCardFieldsScopedState({ scopeId }),
|
||||
).filter(({ fieldMetadataId }) => !fieldKeys.includes(fieldMetadataId));
|
||||
|
||||
return [
|
||||
...fields.filter((field) => !field.isVisible),
|
||||
...otherAvailableKeys,
|
||||
];
|
||||
},
|
||||
});
|
||||
return [
|
||||
...fields.filter((field) => !field.isVisible),
|
||||
...otherAvailableKeys,
|
||||
];
|
||||
},
|
||||
},
|
||||
);
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
import { createScopedSelector } from '@/ui/utilities/recoil-scope/utils/createScopedSelector';
|
||||
import { createSelectorScopeMap } from '@/ui/utilities/recoil-scope/utils/createSelectorScopeMap';
|
||||
|
||||
import { isRecordBoardCardSelectedFamilyState } from '../isRecordBoardCardSelectedFamilyState';
|
||||
import { recordBoardCardIdsByColumnIdFamilyState } from '../recordBoardCardIdsByColumnIdFamilyState';
|
||||
import { recordBoardColumnsScopedState } from '../recordBoardColumnsScopedState';
|
||||
|
||||
export const selectedRecordBoardCardIdsScopedSelector = createScopedSelector<
|
||||
export const selectedRecordBoardCardIdsScopedSelector = createSelectorScopeMap<
|
||||
string[]
|
||||
>({
|
||||
key: 'selectedRecordBoardCardIdsScopedSelector',
|
||||
|
||||
@ -1,13 +1,14 @@
|
||||
import { createScopedSelector } from '@/ui/utilities/recoil-scope/utils/createScopedSelector';
|
||||
import { createSelectorScopeMap } from '@/ui/utilities/recoil-scope/utils/createSelectorScopeMap';
|
||||
|
||||
import { recordBoardCardFieldsScopedState } from '../recordBoardCardFieldsScopedState';
|
||||
|
||||
export const visibleRecordBoardCardFieldsScopedSelector = createScopedSelector({
|
||||
key: 'visibleRecordBoardCardFieldsScopedSelector',
|
||||
get:
|
||||
({ scopeId }) =>
|
||||
({ get }) =>
|
||||
get(recordBoardCardFieldsScopedState({ scopeId }))
|
||||
.filter((field) => field.isVisible)
|
||||
.sort((a, b) => a.position - b.position),
|
||||
});
|
||||
export const visibleRecordBoardCardFieldsScopedSelector =
|
||||
createSelectorScopeMap({
|
||||
key: 'visibleRecordBoardCardFieldsScopedSelector',
|
||||
get:
|
||||
({ scopeId }) =>
|
||||
({ get }) =>
|
||||
get(recordBoardCardFieldsScopedState({ scopeId }))
|
||||
.filter((field) => field.isVisible)
|
||||
.sort((a, b) => a.position - b.position),
|
||||
});
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { createScopedFamilyState } from '@/ui/utilities/recoil-scope/utils/createScopedFamilyState';
|
||||
import { createFamilyStateScopeMap } from '@/ui/utilities/recoil-scope/utils/createFamilyStateScopeMap';
|
||||
|
||||
export const isRowSelectedScopedFamilyState = createScopedFamilyState<
|
||||
export const isRowSelectedScopedFamilyState = createFamilyStateScopeMap<
|
||||
boolean,
|
||||
string
|
||||
>({
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
import { FieldMetadata } from '@/object-record/field/types/FieldMetadata';
|
||||
import { ScopedStateKey } from '@/ui/utilities/recoil-scope/scopes-internal/types/ScopedStateKey';
|
||||
import { StateScopeMapKey } from '@/ui/utilities/recoil-scope/scopes-internal/types/StateScopeMapKey';
|
||||
import { createScopeInternalContext } from '@/ui/utilities/recoil-scope/scopes-internal/utils/createScopeInternalContext';
|
||||
|
||||
import { ColumnDefinition } from '../../types/ColumnDefinition';
|
||||
|
||||
type RecordTableScopeInternalContextProps = ScopedStateKey & {
|
||||
type RecordTableScopeInternalContextProps = StateScopeMapKey & {
|
||||
onColumnsChange: (columns: ColumnDefinition<FieldMetadata>[]) => void;
|
||||
};
|
||||
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
import { FieldMetadata } from '@/object-record/field/types/FieldMetadata';
|
||||
import { createScopedState } from '@/ui/utilities/recoil-scope/utils/createScopedState';
|
||||
import { createStateScopeMap } from '@/ui/utilities/recoil-scope/utils/createStateScopeMap';
|
||||
|
||||
import { ColumnDefinition } from '../types/ColumnDefinition';
|
||||
|
||||
export const availableTableColumnsScopedState = createScopedState<
|
||||
export const availableTableColumnsScopedState = createStateScopeMap<
|
||||
ColumnDefinition<FieldMetadata>[]
|
||||
>({
|
||||
key: 'availableTableColumnsScopedState',
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
import { createScopedState } from '@/ui/utilities/recoil-scope/utils/createScopedState';
|
||||
import { createStateScopeMap } from '@/ui/utilities/recoil-scope/utils/createStateScopeMap';
|
||||
|
||||
import { TableCellPosition } from '../types/TableCellPosition';
|
||||
|
||||
export const currentTableCellInEditModePositionScopedState =
|
||||
createScopedState<TableCellPosition>({
|
||||
createStateScopeMap<TableCellPosition>({
|
||||
key: 'currentTableCellInEditModePositionScopedState',
|
||||
defaultValue: {
|
||||
row: 0,
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { createScopedState } from '@/ui/utilities/recoil-scope/utils/createScopedState';
|
||||
import { createStateScopeMap } from '@/ui/utilities/recoil-scope/utils/createStateScopeMap';
|
||||
|
||||
export const isRecordTableInitialLoadingScopedState =
|
||||
createScopedState<boolean>({
|
||||
createStateScopeMap<boolean>({
|
||||
key: 'isRecordTableInitialLoadingScopedState',
|
||||
defaultValue: true,
|
||||
});
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { createScopedState } from '@/ui/utilities/recoil-scope/utils/createScopedState';
|
||||
import { createStateScopeMap } from '@/ui/utilities/recoil-scope/utils/createStateScopeMap';
|
||||
|
||||
export const isSoftFocusActiveScopedState = createScopedState<boolean>({
|
||||
export const isSoftFocusActiveScopedState = createStateScopeMap<boolean>({
|
||||
key: 'isSoftFocusActiveScopedState',
|
||||
defaultValue: false,
|
||||
});
|
||||
|
||||
@ -1,11 +1,9 @@
|
||||
import { createScopedFamilyState } from '@/ui/utilities/recoil-scope/utils/createScopedFamilyState';
|
||||
import { createFamilyStateScopeMap } from '@/ui/utilities/recoil-scope/utils/createFamilyStateScopeMap';
|
||||
|
||||
import { TableCellPosition } from '../types/TableCellPosition';
|
||||
|
||||
export const isSoftFocusOnTableCellScopedFamilyState = createScopedFamilyState<
|
||||
boolean,
|
||||
TableCellPosition
|
||||
>({
|
||||
key: 'isSoftFocusOnTableCellScopedFamilyState',
|
||||
defaultValue: false,
|
||||
});
|
||||
export const isSoftFocusOnTableCellScopedFamilyState =
|
||||
createFamilyStateScopeMap<boolean, TableCellPosition>({
|
||||
key: 'isSoftFocusOnTableCellScopedFamilyState',
|
||||
defaultValue: false,
|
||||
});
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import { createScopedFamilyState } from '@/ui/utilities/recoil-scope/utils/createScopedFamilyState';
|
||||
import { createFamilyStateScopeMap } from '@/ui/utilities/recoil-scope/utils/createFamilyStateScopeMap';
|
||||
|
||||
import { TableCellPosition } from '../types/TableCellPosition';
|
||||
|
||||
export const isTableCellInEditModeScopedFamilyState = createScopedFamilyState<
|
||||
export const isTableCellInEditModeScopedFamilyState = createFamilyStateScopeMap<
|
||||
boolean,
|
||||
TableCellPosition
|
||||
>({
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { createScopedState } from '@/ui/utilities/recoil-scope/utils/createScopedState';
|
||||
import { createStateScopeMap } from '@/ui/utilities/recoil-scope/utils/createStateScopeMap';
|
||||
|
||||
export const numberOfTableRowsScopedState = createScopedState<number>({
|
||||
export const numberOfTableRowsScopedState = createStateScopeMap<number>({
|
||||
key: 'numberOfTableRowsScopedState',
|
||||
defaultValue: 0,
|
||||
});
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import { ObjectMetadataConfig } from '@/object-record/record-table/types/ObjectMetadataConfig';
|
||||
import { createScopedState } from '@/ui/utilities/recoil-scope/utils/createScopedState';
|
||||
import { createStateScopeMap } from '@/ui/utilities/recoil-scope/utils/createStateScopeMap';
|
||||
|
||||
export const objectMetadataConfigScopedState =
|
||||
createScopedState<ObjectMetadataConfig | null>({
|
||||
createStateScopeMap<ObjectMetadataConfig | null>({
|
||||
key: 'objectMetadataConfigScopedState',
|
||||
defaultValue: null,
|
||||
});
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
import { createScopedState } from '@/ui/utilities/recoil-scope/utils/createScopedState';
|
||||
import { createStateScopeMap } from '@/ui/utilities/recoil-scope/utils/createStateScopeMap';
|
||||
|
||||
import { FieldMetadata } from '../../field/types/FieldMetadata';
|
||||
import { ColumnDefinition } from '../types/ColumnDefinition';
|
||||
|
||||
export const onColumnsChangeScopedState = createScopedState<
|
||||
export const onColumnsChangeScopedState = createStateScopeMap<
|
||||
((columns: ColumnDefinition<FieldMetadata>[]) => void) | undefined
|
||||
>({
|
||||
key: 'onColumnsChangeScopedState',
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { createScopedState } from '@/ui/utilities/recoil-scope/utils/createScopedState';
|
||||
import { createStateScopeMap } from '@/ui/utilities/recoil-scope/utils/createStateScopeMap';
|
||||
|
||||
export const onEntityCountChangeScopedState = createScopedState<
|
||||
export const onEntityCountChangeScopedState = createStateScopeMap<
|
||||
((entityCount: number) => void) | undefined
|
||||
>({
|
||||
key: 'onEntityCountChangeScopedState',
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { createScopedState } from '@/ui/utilities/recoil-scope/utils/createScopedState';
|
||||
import { createStateScopeMap } from '@/ui/utilities/recoil-scope/utils/createStateScopeMap';
|
||||
|
||||
export const resizeFieldOffsetScopedState = createScopedState<number>({
|
||||
export const resizeFieldOffsetScopedState = createStateScopeMap<number>({
|
||||
key: 'resizeFieldOffsetScopedState',
|
||||
defaultValue: 0,
|
||||
});
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { createScopedSelector } from '@/ui/utilities/recoil-scope/utils/createScopedSelector';
|
||||
import { createSelectorScopeMap } from '@/ui/utilities/recoil-scope/utils/createSelectorScopeMap';
|
||||
|
||||
import { AllRowsSelectedStatus } from '../../types/AllRowSelectedStatus';
|
||||
import { numberOfTableRowsScopedState } from '../numberOfTableRowsScopedState';
|
||||
@ -6,7 +6,7 @@ import { numberOfTableRowsScopedState } from '../numberOfTableRowsScopedState';
|
||||
import { selectedRowIdsScopedSelector } from './selectedRowIdsScopedSelector';
|
||||
|
||||
export const allRowsSelectedStatusScopedSelector =
|
||||
createScopedSelector<AllRowsSelectedStatus>({
|
||||
createSelectorScopeMap<AllRowsSelectedStatus>({
|
||||
key: 'allRowsSelectedStatusScopedSelector',
|
||||
get:
|
||||
({ scopeId }) =>
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
import { createScopedSelector } from '@/ui/utilities/recoil-scope/utils/createScopedSelector';
|
||||
import { createSelectorScopeMap } from '@/ui/utilities/recoil-scope/utils/createSelectorScopeMap';
|
||||
|
||||
import { availableTableColumnsScopedState } from '../availableTableColumnsScopedState';
|
||||
import { tableColumnsScopedState } from '../tableColumnsScopedState';
|
||||
|
||||
export const hiddenTableColumnsScopedSelector = createScopedSelector({
|
||||
export const hiddenTableColumnsScopedSelector = createSelectorScopeMap({
|
||||
key: 'hiddenTableColumnsScopedSelector',
|
||||
get:
|
||||
({ scopeId }) =>
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import { createScopedSelector } from '@/ui/utilities/recoil-scope/utils/createScopedSelector';
|
||||
import { createSelectorScopeMap } from '@/ui/utilities/recoil-scope/utils/createSelectorScopeMap';
|
||||
|
||||
import { tableColumnsScopedState } from '../tableColumnsScopedState';
|
||||
|
||||
export const numberOfTableColumnsScopedSelector = createScopedSelector({
|
||||
export const numberOfTableColumnsScopedSelector = createSelectorScopeMap({
|
||||
key: 'numberOfTableColumnsScopedSelector',
|
||||
get:
|
||||
({ scopeId }) =>
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
import { createScopedSelector } from '@/ui/utilities/recoil-scope/utils/createScopedSelector';
|
||||
import { createSelectorScopeMap } from '@/ui/utilities/recoil-scope/utils/createSelectorScopeMap';
|
||||
|
||||
import { isRowSelectedScopedFamilyState } from '../../record-table-row/states/isRowSelectedScopedFamilyState';
|
||||
import { tableRowIdsScopedState } from '../tableRowIdsScopedState';
|
||||
|
||||
export const selectedRowIdsScopedSelector = createScopedSelector<string[]>({
|
||||
export const selectedRowIdsScopedSelector = createSelectorScopeMap<string[]>({
|
||||
key: 'selectedRowIdsScopedSelector',
|
||||
get:
|
||||
({ scopeId }) =>
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
import { FieldMetadata } from '@/object-record/field/types/FieldMetadata';
|
||||
import { createScopedSelector } from '@/ui/utilities/recoil-scope/utils/createScopedSelector';
|
||||
import { createSelectorScopeMap } from '@/ui/utilities/recoil-scope/utils/createSelectorScopeMap';
|
||||
|
||||
import { ColumnDefinition } from '../../types/ColumnDefinition';
|
||||
import { tableColumnsScopedState } from '../tableColumnsScopedState';
|
||||
|
||||
export const tableColumnsByKeyScopedSelector = createScopedSelector({
|
||||
export const tableColumnsByKeyScopedSelector = createSelectorScopeMap({
|
||||
key: 'tableColumnsByKeyScopedSelector',
|
||||
get:
|
||||
({ scopeId }) =>
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
import { createScopedSelector } from '@/ui/utilities/recoil-scope/utils/createScopedSelector';
|
||||
import { createSelectorScopeMap } from '@/ui/utilities/recoil-scope/utils/createSelectorScopeMap';
|
||||
|
||||
import { availableTableColumnsScopedState } from '../availableTableColumnsScopedState';
|
||||
import { tableColumnsScopedState } from '../tableColumnsScopedState';
|
||||
|
||||
export const visibleTableColumnsScopedSelector = createScopedSelector({
|
||||
export const visibleTableColumnsScopedSelector = createSelectorScopeMap({
|
||||
key: 'visibleTableColumnsScopedSelector',
|
||||
get:
|
||||
({ scopeId }) =>
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
import { createScopedState } from '@/ui/utilities/recoil-scope/utils/createScopedState';
|
||||
import { createStateScopeMap } from '@/ui/utilities/recoil-scope/utils/createStateScopeMap';
|
||||
|
||||
import { TableCellPosition } from '../types/TableCellPosition';
|
||||
|
||||
export const softFocusPositionScopedState =
|
||||
createScopedState<TableCellPosition>({
|
||||
createStateScopeMap<TableCellPosition>({
|
||||
key: 'softFocusPositionScopedState',
|
||||
defaultValue: {
|
||||
row: 0,
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
import { FieldMetadata } from '@/object-record/field/types/FieldMetadata';
|
||||
import { createScopedState } from '@/ui/utilities/recoil-scope/utils/createScopedState';
|
||||
import { createStateScopeMap } from '@/ui/utilities/recoil-scope/utils/createStateScopeMap';
|
||||
|
||||
import { ColumnDefinition } from '../types/ColumnDefinition';
|
||||
|
||||
export const tableColumnsScopedState = createScopedState<
|
||||
export const tableColumnsScopedState = createStateScopeMap<
|
||||
ColumnDefinition<FieldMetadata>[]
|
||||
>({
|
||||
key: 'tableColumnsScopedState',
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import { createScopedState } from '@/ui/utilities/recoil-scope/utils/createScopedState';
|
||||
import { createStateScopeMap } from '@/ui/utilities/recoil-scope/utils/createStateScopeMap';
|
||||
|
||||
import { Filter } from '../../object-filter-dropdown/types/Filter';
|
||||
|
||||
export const tableFiltersScopedState = createScopedState<Filter[]>({
|
||||
export const tableFiltersScopedState = createStateScopeMap<Filter[]>({
|
||||
key: 'tableFiltersScopedState',
|
||||
defaultValue: [],
|
||||
});
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { createScopedState } from '@/ui/utilities/recoil-scope/utils/createScopedState';
|
||||
import { createStateScopeMap } from '@/ui/utilities/recoil-scope/utils/createStateScopeMap';
|
||||
|
||||
export const tableLastRowVisibleScopedState = createScopedState<boolean>({
|
||||
export const tableLastRowVisibleScopedState = createStateScopeMap<boolean>({
|
||||
key: 'tableLastRowVisibleScopedState',
|
||||
defaultValue: false,
|
||||
});
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { createScopedState } from '@/ui/utilities/recoil-scope/utils/createScopedState';
|
||||
import { createStateScopeMap } from '@/ui/utilities/recoil-scope/utils/createStateScopeMap';
|
||||
|
||||
export const tableRowIdsScopedState = createScopedState<string[]>({
|
||||
export const tableRowIdsScopedState = createStateScopeMap<string[]>({
|
||||
key: 'tableRowIdsScopedState',
|
||||
defaultValue: [],
|
||||
});
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import { createScopedState } from '@/ui/utilities/recoil-scope/utils/createScopedState';
|
||||
import { createStateScopeMap } from '@/ui/utilities/recoil-scope/utils/createStateScopeMap';
|
||||
|
||||
import { Sort } from '../../object-sort-dropdown/types/Sort';
|
||||
|
||||
export const tableSortsScopedState = createScopedState<Sort[]>({
|
||||
export const tableSortsScopedState = createStateScopeMap<Sort[]>({
|
||||
key: 'tableSortsScopedState',
|
||||
defaultValue: [],
|
||||
});
|
||||
|
||||
@ -22,13 +22,11 @@ export const SelectableMenuItemSelect = ({
|
||||
onEntitySelected,
|
||||
selectedEntity,
|
||||
}: SelectableMenuItemSelectProps) => {
|
||||
const { isSelectedItemIdFamilyState } = useSelectableList(
|
||||
const { isSelectedItemIdSelector } = useSelectableList(
|
||||
'single-entity-select-base-list',
|
||||
);
|
||||
|
||||
const isSelectedItemId = useRecoilValue(
|
||||
isSelectedItemIdFamilyState(entity.id),
|
||||
);
|
||||
const isSelectedItemId = useRecoilValue(isSelectedItemIdSelector(entity.id));
|
||||
|
||||
return (
|
||||
<StyledSelectableItem itemId={entity.id} key={entity.id}>
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { ScopedStateKey } from '@/ui/utilities/recoil-scope/scopes-internal/types/ScopedStateKey';
|
||||
import { StateScopeMapKey } from '@/ui/utilities/recoil-scope/scopes-internal/types/StateScopeMapKey';
|
||||
import { createScopeInternalContext } from '@/ui/utilities/recoil-scope/scopes-internal/utils/createScopeInternalContext';
|
||||
|
||||
type RelationPickerScopeInternalContextProps = ScopedStateKey;
|
||||
type RelationPickerScopeInternalContextProps = StateScopeMapKey;
|
||||
|
||||
export const RelationPickerScopeInternalContext =
|
||||
createScopeInternalContext<RelationPickerScopeInternalContextProps>();
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import { IdentifiersMapper } from '@/object-record/relation-picker/types/IdentifiersMapper';
|
||||
import { createScopedState } from '@/ui/utilities/recoil-scope/utils/createScopedState';
|
||||
import { createStateScopeMap } from '@/ui/utilities/recoil-scope/utils/createStateScopeMap';
|
||||
|
||||
export const identifiersMapperScopedState =
|
||||
createScopedState<IdentifiersMapper | null>({
|
||||
createStateScopeMap<IdentifiersMapper | null>({
|
||||
key: 'identifiersMapperScopedState',
|
||||
defaultValue: null,
|
||||
});
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { createScopedState } from '@/ui/utilities/recoil-scope/utils/createScopedState';
|
||||
import { createStateScopeMap } from '@/ui/utilities/recoil-scope/utils/createStateScopeMap';
|
||||
|
||||
export const relationPickerPreselectedIdScopedState = createScopedState<
|
||||
export const relationPickerPreselectedIdScopedState = createStateScopeMap<
|
||||
string | undefined
|
||||
>({
|
||||
key: 'relationPickerPreselectedIdScopedState',
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import { createScopedState } from '@/ui/utilities/recoil-scope/utils/createScopedState';
|
||||
import { createStateScopeMap } from '@/ui/utilities/recoil-scope/utils/createStateScopeMap';
|
||||
|
||||
export const relationPickerSearchFilterScopedState = createScopedState<string>({
|
||||
key: 'relationPickerSearchFilterScopedState',
|
||||
defaultValue: '',
|
||||
});
|
||||
export const relationPickerSearchFilterScopedState =
|
||||
createStateScopeMap<string>({
|
||||
key: 'relationPickerSearchFilterScopedState',
|
||||
defaultValue: '',
|
||||
});
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { SearchQuery } from '@/object-record/relation-picker/types/SearchQuery';
|
||||
import { createScopedState } from '@/ui/utilities/recoil-scope/utils/createScopedState';
|
||||
import { createStateScopeMap } from '@/ui/utilities/recoil-scope/utils/createStateScopeMap';
|
||||
|
||||
export const searchQueryScopedState = createScopedState<SearchQuery | null>({
|
||||
export const searchQueryScopedState = createStateScopeMap<SearchQuery | null>({
|
||||
key: 'searchQueryScopedState',
|
||||
defaultValue: null,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user