@daffodil/core 0.45.1 → 0.47.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/esm2020/filterable/filter-base.mjs +2 -0
- package/esm2020/filterable/filter-option-base.mjs +2 -0
- package/esm2020/filterable/filter-option.mjs +2 -0
- package/esm2020/filterable/filter-request.mjs +2 -0
- package/esm2020/filterable/filter-toggle-request.mjs +2 -0
- package/esm2020/filterable/filter.mjs +2 -0
- package/esm2020/filterable/filterable.mjs +2 -0
- package/esm2020/filterable/filters.type.mjs +2 -0
- package/esm2020/filterable/public_api.mjs +5 -0
- package/esm2020/filterable/type/equal/filter.mjs +2 -0
- package/esm2020/filterable/type/equal/option.mjs +2 -0
- package/esm2020/filterable/type/equal/public_api.mjs +2 -0
- package/esm2020/filterable/type/equal/request.mjs +2 -0
- package/esm2020/filterable/type/equal/toggle-request.mjs +2 -0
- package/esm2020/filterable/type/filter-type.mjs +9 -0
- package/esm2020/filterable/type/range/filter-base.mjs +2 -0
- package/esm2020/filterable/type/range/option.mjs +2 -0
- package/esm2020/filterable/type/range/pair.mjs +2 -0
- package/esm2020/filterable/type/range/public_api.mjs +2 -0
- package/esm2020/filterable/type/range/request-base.mjs +2 -0
- package/esm2020/filterable/type/range/request-option.mjs +2 -0
- package/esm2020/filterable/type/range/separator.mjs +6 -0
- package/esm2020/filterable/type/range-numeric/filter.mjs +2 -0
- package/esm2020/filterable/type/range-numeric/public_api.mjs +2 -0
- package/esm2020/filterable/type/range-numeric/request.mjs +2 -0
- package/esm2020/filterable/type/range-numeric/toggle-request.mjs +2 -0
- package/esm2020/filters/array-to-dict/array-to-dict.mjs +6 -0
- package/esm2020/filters/behaviors/apply/apply-filter.mjs +24 -0
- package/esm2020/filters/behaviors/apply/apply-request-to-filters.mjs +12 -0
- package/esm2020/filters/behaviors/apply/apply-requests-to-filters.mjs +12 -0
- package/esm2020/filters/behaviors/apply/public_api.mjs +4 -0
- package/esm2020/filters/behaviors/clear/clear-filter.mjs +21 -0
- package/esm2020/filters/behaviors/clear/clear-filters.mjs +12 -0
- package/esm2020/filters/behaviors/clear/public_api.mjs +3 -0
- package/esm2020/filters/behaviors/remove/public_api.mjs +4 -0
- package/esm2020/filters/behaviors/remove/remove-filter.mjs +25 -0
- package/esm2020/filters/behaviors/remove/remove-request-from-filters.mjs +12 -0
- package/esm2020/filters/behaviors/remove/remove-requests-from-filters.mjs +13 -0
- package/esm2020/filters/behaviors/toggle/public_api.mjs +3 -0
- package/esm2020/filters/behaviors/toggle/toggle-request-on-filters.mjs +10 -0
- package/esm2020/filters/behaviors/toggle/toggle.mjs +22 -0
- package/esm2020/filters/compute-applied-filters/compute-applied-filters.mjs +21 -0
- package/esm2020/filters/errors/codes.enum.mjs +11 -0
- package/esm2020/filters/errors/filter-not-found.error.mjs +12 -0
- package/esm2020/filters/errors/public_api.mjs +5 -0
- package/esm2020/filters/errors/request-name-mismatch.error.mjs +13 -0
- package/esm2020/filters/errors/request-type-mismatch.error.mjs +13 -0
- package/esm2020/filters/errors/unknown-filter-type.error.mjs +13 -0
- package/esm2020/filters/find-applied/find-applied-options.mjs +5 -0
- package/esm2020/filters/find-applied/public_api.mjs +2 -0
- package/esm2020/filters/is-applied/is-filter-applied.mjs +18 -0
- package/esm2020/filters/is-applied/is-toggle-request-applied-to-filter.mjs +18 -0
- package/esm2020/filters/is-applied/public_api.mjs +3 -0
- package/esm2020/filters/public_api.mjs +14 -0
- package/esm2020/filters/to-request/filter-to-request.mjs +20 -0
- package/esm2020/filters/to-request/filters-to-requests.mjs +15 -0
- package/esm2020/filters/to-request/public_api.mjs +3 -0
- package/esm2020/filters/type/equal/array-to-dict/option.mjs +6 -0
- package/esm2020/filters/type/equal/behaviors/apply/apply.mjs +20 -0
- package/esm2020/filters/type/equal/behaviors/clear/clear.mjs +17 -0
- package/esm2020/filters/type/equal/behaviors/remove/remove.mjs +23 -0
- package/esm2020/filters/type/equal/behaviors/toggle/toggle.mjs +24 -0
- package/esm2020/filters/type/equal/is-applied/is-applied.mjs +5 -0
- package/esm2020/filters/type/equal/is-applied/is-toggle-request-applied-to-filter.mjs +5 -0
- package/esm2020/filters/type/equal/public_api.mjs +2 -0
- package/esm2020/filters/type/equal/to-request/filter-to-request.mjs +17 -0
- package/esm2020/filters/type/range/array-to-dict/pair.mjs +7 -0
- package/esm2020/filters/type/range/behaviors/apply/apply.mjs +24 -0
- package/esm2020/filters/type/range/behaviors/clear/clear.mjs +11 -0
- package/esm2020/filters/type/range/behaviors/remove/remove.mjs +17 -0
- package/esm2020/filters/type/range/behaviors/toggle/toggle.mjs +15 -0
- package/esm2020/filters/type/range/compute-pair-label.mjs +3 -0
- package/esm2020/filters/type/range/is-applied/is-applied.mjs +5 -0
- package/esm2020/filters/type/range/is-applied/is-toggle-request-applied-to-filter.mjs +6 -0
- package/esm2020/filters/type/range/public_api.mjs +3 -0
- package/esm2020/filters/type/range/to-request/filter-to-request.mjs +19 -0
- package/esm2020/filters/type/range-numeric/to-request/filter-to-request.mjs +6 -0
- package/esm2020/filters/validators/public_api.mjs +3 -0
- package/esm2020/filters/validators/request-name-match.mjs +16 -0
- package/esm2020/filters/validators/request-type-match.mjs +12 -0
- package/esm2020/graphql/apollo/cacheable-operations/cacheable-operations-link.interface.mjs +1 -1
- package/esm2020/graphql/apollo/public_api.mjs +1 -1
- package/esm2020/public_api.mjs +3 -1
- package/esm2020/testing/factories/filters/filter.factory.mjs +50 -0
- package/esm2020/testing/factories/filters/public_api.mjs +5 -0
- package/esm2020/testing/factories/filters/request.factory.mjs +25 -0
- package/esm2020/testing/factories/filters/toggle-request.mjs +35 -0
- package/esm2020/testing/factories/filters/type/equal/option.mjs +29 -0
- package/esm2020/testing/factories/filters/type/equal/public_api.mjs +4 -0
- package/esm2020/testing/factories/filters/type/equal/request.mjs +29 -0
- package/esm2020/testing/factories/filters/type/equal/toggle-request.mjs +29 -0
- package/esm2020/testing/factories/filters/type/equal.mjs +30 -0
- package/esm2020/testing/factories/filters/type/public_api.mjs +5 -0
- package/esm2020/testing/factories/filters/type/range-numeric/option.mjs +27 -0
- package/esm2020/testing/factories/filters/type/range-numeric/pair.mjs +37 -0
- package/esm2020/testing/factories/filters/type/range-numeric/public_api.mjs +6 -0
- package/esm2020/testing/factories/filters/type/range-numeric/request-option.mjs +27 -0
- package/esm2020/testing/factories/filters/type/range-numeric/request.mjs +38 -0
- package/esm2020/testing/factories/filters/type/range-numeric/toggle-request.mjs +38 -0
- package/esm2020/testing/factories/filters/type/range-numeric.mjs +32 -0
- package/esm2020/testing/factories/public_api.mjs +2 -1
- package/fesm2015/daffodil-core-testing.mjs +332 -2
- package/fesm2015/daffodil-core-testing.mjs.map +1 -1
- package/fesm2015/daffodil-core.mjs +485 -1
- package/fesm2015/daffodil-core.mjs.map +1 -1
- package/fesm2020/daffodil-core-testing.mjs +351 -2
- package/fesm2020/daffodil-core-testing.mjs.map +1 -1
- package/fesm2020/daffodil-core.mjs +534 -1
- package/fesm2020/daffodil-core.mjs.map +1 -1
- package/filterable/filter-base.d.ts +24 -0
- package/filterable/filter-option-base.d.ts +9 -0
- package/filterable/filter-option.d.ts +6 -0
- package/filterable/filter-request.d.ts +7 -0
- package/filterable/filter-toggle-request.d.ts +6 -0
- package/filterable/filter.d.ts +9 -0
- package/filterable/filterable.d.ts +10 -0
- package/filterable/filters.type.d.ts +5 -0
- package/filterable/public_api.d.ts +12 -0
- package/filterable/type/equal/filter.d.ts +24 -0
- package/filterable/type/equal/option.d.ts +19 -0
- package/filterable/type/equal/public_api.d.ts +4 -0
- package/filterable/type/equal/request.d.ts +18 -0
- package/filterable/type/equal/toggle-request.d.ts +18 -0
- package/filterable/type/filter-type.d.ts +7 -0
- package/filterable/type/range/filter-base.d.ts +23 -0
- package/filterable/type/range/option.d.ts +14 -0
- package/filterable/type/range/pair.d.ts +20 -0
- package/filterable/type/range/public_api.d.ts +6 -0
- package/filterable/type/range/request-base.d.ts +20 -0
- package/filterable/type/range/request-option.d.ts +14 -0
- package/filterable/type/range/separator.d.ts +5 -0
- package/filterable/type/range-numeric/filter.d.ts +11 -0
- package/filterable/type/range-numeric/public_api.d.ts +3 -0
- package/filterable/type/range-numeric/request.d.ts +11 -0
- package/filterable/type/range-numeric/toggle-request.d.ts +12 -0
- package/filters/array-to-dict/array-to-dict.d.ts +5 -0
- package/filters/behaviors/apply/apply-filter.d.ts +8 -0
- package/filters/behaviors/apply/apply-request-to-filters.d.ts +8 -0
- package/filters/behaviors/apply/apply-requests-to-filters.d.ts +8 -0
- package/filters/behaviors/apply/public_api.d.ts +3 -0
- package/filters/behaviors/clear/clear-filter.d.ts +8 -0
- package/filters/behaviors/clear/clear-filters.d.ts +8 -0
- package/filters/behaviors/clear/public_api.d.ts +2 -0
- package/filters/behaviors/remove/public_api.d.ts +3 -0
- package/filters/behaviors/remove/remove-filter.d.ts +9 -0
- package/filters/behaviors/remove/remove-request-from-filters.d.ts +8 -0
- package/filters/behaviors/remove/remove-requests-from-filters.d.ts +9 -0
- package/filters/behaviors/toggle/public_api.d.ts +2 -0
- package/filters/behaviors/toggle/toggle-request-on-filters.d.ts +6 -0
- package/filters/behaviors/toggle/toggle.d.ts +6 -0
- package/filters/compute-applied-filters/compute-applied-filters.d.ts +6 -0
- package/filters/errors/codes.enum.d.ts +9 -0
- package/filters/errors/filter-not-found.error.d.ts +8 -0
- package/filters/errors/public_api.d.ts +4 -0
- package/filters/errors/request-name-mismatch.error.d.ts +9 -0
- package/filters/errors/request-type-mismatch.error.d.ts +9 -0
- package/filters/errors/unknown-filter-type.error.d.ts +9 -0
- package/filters/find-applied/find-applied-options.d.ts +5 -0
- package/filters/find-applied/public_api.d.ts +1 -0
- package/filters/is-applied/is-filter-applied.d.ts +5 -0
- package/filters/is-applied/is-toggle-request-applied-to-filter.d.ts +5 -0
- package/filters/is-applied/public_api.d.ts +2 -0
- package/filters/public_api.d.ts +13 -0
- package/filters/to-request/filter-to-request.d.ts +6 -0
- package/filters/to-request/filters-to-requests.d.ts +6 -0
- package/filters/to-request/public_api.d.ts +2 -0
- package/filters/type/equal/array-to-dict/option.d.ts +5 -0
- package/filters/type/equal/behaviors/apply/apply.d.ts +8 -0
- package/filters/type/equal/behaviors/clear/clear.d.ts +8 -0
- package/filters/type/equal/behaviors/remove/remove.d.ts +11 -0
- package/filters/type/equal/behaviors/toggle/toggle.d.ts +11 -0
- package/filters/type/equal/is-applied/is-applied.d.ts +5 -0
- package/filters/type/equal/is-applied/is-toggle-request-applied-to-filter.d.ts +5 -0
- package/filters/type/equal/public_api.d.ts +1 -0
- package/filters/type/equal/to-request/filter-to-request.d.ts +5 -0
- package/filters/type/range/array-to-dict/pair.d.ts +5 -0
- package/filters/type/range/behaviors/apply/apply.d.ts +8 -0
- package/filters/type/range/behaviors/clear/clear.d.ts +8 -0
- package/filters/type/range/behaviors/remove/remove.d.ts +11 -0
- package/filters/type/range/behaviors/toggle/toggle.d.ts +10 -0
- package/filters/type/range/compute-pair-label.d.ts +1 -0
- package/filters/type/range/is-applied/is-applied.d.ts +5 -0
- package/filters/type/range/is-applied/is-toggle-request-applied-to-filter.d.ts +5 -0
- package/filters/type/range/public_api.d.ts +2 -0
- package/filters/type/range/to-request/filter-to-request.d.ts +5 -0
- package/filters/type/range-numeric/to-request/filter-to-request.d.ts +5 -0
- package/filters/validators/public_api.d.ts +2 -0
- package/filters/validators/request-name-match.d.ts +7 -0
- package/filters/validators/request-type-match.d.ts +7 -0
- package/graphql/apollo/cacheable-operations/cacheable-operations-link.interface.d.ts +1 -1
- package/graphql/apollo/public_api.d.ts +1 -1
- package/package.json +1 -1
- package/public_api.d.ts +2 -0
- package/testing/factories/filters/filter.factory.d.ts +18 -0
- package/testing/factories/filters/public_api.d.ts +4 -0
- package/testing/factories/filters/request.factory.d.ts +13 -0
- package/testing/factories/filters/toggle-request.d.ts +18 -0
- package/testing/factories/filters/type/equal/option.d.ts +17 -0
- package/testing/factories/filters/type/equal/public_api.d.ts +3 -0
- package/testing/factories/filters/type/equal/request.d.ts +16 -0
- package/testing/factories/filters/type/equal/toggle-request.d.ts +16 -0
- package/testing/factories/filters/type/equal.d.ts +17 -0
- package/testing/factories/filters/type/public_api.d.ts +4 -0
- package/testing/factories/filters/type/range-numeric/option.d.ts +15 -0
- package/testing/factories/filters/type/range-numeric/pair.d.ts +23 -0
- package/testing/factories/filters/type/range-numeric/public_api.d.ts +5 -0
- package/testing/factories/filters/type/range-numeric/request-option.d.ts +15 -0
- package/testing/factories/filters/type/range-numeric/request.d.ts +23 -0
- package/testing/factories/filters/type/range-numeric/toggle-request.d.ts +20 -0
- package/testing/factories/filters/type/range-numeric.d.ts +19 -0
- package/testing/factories/public_api.d.ts +1 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DaffFilterType } from '../filter-type';
|
|
2
|
+
import { DaffFilterRangeRequestBase } from '../range/public_api';
|
|
3
|
+
/**
|
|
4
|
+
* Describes filter range requests for numbers; i.e. prices.
|
|
5
|
+
*/
|
|
6
|
+
export interface DaffFilterRangeNumericRequest extends DaffFilterRangeRequestBase<number> {
|
|
7
|
+
/**
|
|
8
|
+
* The filter type.
|
|
9
|
+
*/
|
|
10
|
+
type: DaffFilterType.RangeNumeric;
|
|
11
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DaffFilterType } from '../filter-type';
|
|
2
|
+
import { DaffFilterRangeRequestBase } from '../range/request-base';
|
|
3
|
+
/**
|
|
4
|
+
* An interface to describe toggle requests for ranged numeric filters. For example, the request could be to
|
|
5
|
+
* toggle a price filter for the "10-20" range.
|
|
6
|
+
*/
|
|
7
|
+
export interface DaffFilterRangeNumericToggleRequest extends DaffFilterRangeRequestBase<number> {
|
|
8
|
+
/**
|
|
9
|
+
* The filter type.
|
|
10
|
+
*/
|
|
11
|
+
type: DaffFilterType.RangeNumeric;
|
|
12
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DaffFilterRequest, DaffFilter } from '../../../filterable/public_api';
|
|
2
|
+
/**
|
|
3
|
+
* Applies a filter request to the matching filter.
|
|
4
|
+
*
|
|
5
|
+
* @idempotent {filter}
|
|
6
|
+
* @throws {@link DaffFilterUnknownType}
|
|
7
|
+
*/
|
|
8
|
+
export declare const daffApplyFilter: (request: DaffFilterRequest, filter: DaffFilter) => DaffFilter;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DaffFilterRequest, DaffFilters } from '../../../filterable/public_api';
|
|
2
|
+
/**
|
|
3
|
+
* Applies a {@link DaffFilterRequest} to a dictionary of {@link DaffFilter}
|
|
4
|
+
* returning the updated dictionary.
|
|
5
|
+
*
|
|
6
|
+
* @idempotent {filters}
|
|
7
|
+
*/
|
|
8
|
+
export declare const daffApplyRequestToFilters: (request: DaffFilterRequest, filters: DaffFilters) => DaffFilters;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DaffFilterRequest, DaffFilters } from '../../../filterable/public_api';
|
|
2
|
+
/**
|
|
3
|
+
* Applies filters from a {@link DaffFilterRequest} to a dictionary
|
|
4
|
+
* of {@link DaffFilter}.
|
|
5
|
+
*
|
|
6
|
+
* @idempotent {filters}
|
|
7
|
+
*/
|
|
8
|
+
export declare const daffApplyRequestsToFilters: (filtersRequests: DaffFilterRequest[], filters: DaffFilters) => DaffFilters;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DaffFilter } from '../../../filterable/public_api';
|
|
2
|
+
/**
|
|
3
|
+
* Undoes the applied state of all applied filter options of a {@link DaffFilter}
|
|
4
|
+
* returning the filter.
|
|
5
|
+
*
|
|
6
|
+
* @idempotent {filter}
|
|
7
|
+
*/
|
|
8
|
+
export declare const daffClearFilter: (filter: DaffFilter) => DaffFilter;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DaffFilters } from '../../../filterable/public_api';
|
|
2
|
+
/**
|
|
3
|
+
* Undoes the applied state of all applied filter options of a dictionary of {@link DaffFilter}
|
|
4
|
+
* returning updated dictionary.
|
|
5
|
+
*
|
|
6
|
+
* @idempotent {filters}
|
|
7
|
+
*/
|
|
8
|
+
export declare const daffClearFilters: (filters: DaffFilters) => DaffFilters;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DaffFilterRequest, DaffFilter } from '../../../filterable/public_api';
|
|
2
|
+
/**
|
|
3
|
+
* Undoes any applied options of a {@link DaffFilter} that match the
|
|
4
|
+
* {@link DaffFilterRequest}, returning the {@link DaffFilter}.
|
|
5
|
+
*
|
|
6
|
+
* @idempotent {filter}
|
|
7
|
+
* @pure
|
|
8
|
+
*/
|
|
9
|
+
export declare const daffRemoveFilter: (request: DaffFilterRequest, filter: DaffFilter) => DaffFilter;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DaffFilterRequest, DaffFilters } from '../../../filterable/public_api';
|
|
2
|
+
/**
|
|
3
|
+
* Undoes any applied options of a particular filter of a dictionary of {@link DaffFilter}
|
|
4
|
+
* that match the {@link DaffFilterRequest}, returning the dictionary of {@link DaffFilter}.
|
|
5
|
+
*
|
|
6
|
+
* @idempotent {filters}
|
|
7
|
+
*/
|
|
8
|
+
export declare const daffRemoveRequestFromFilters: (request: DaffFilterRequest, filters: DaffFilters) => DaffFilters;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DaffFilterRequest, DaffFilters } from '../../../filterable/public_api';
|
|
2
|
+
/**
|
|
3
|
+
* Undoes all applied options of a dictionary of {@link DaffFilter}
|
|
4
|
+
* that match any of the {@link DaffFilterRequest},
|
|
5
|
+
* returning the updated dictionary of {@link DaffFilter}.
|
|
6
|
+
*
|
|
7
|
+
* @idempotent {filters}
|
|
8
|
+
*/
|
|
9
|
+
export declare const daffRemoveRequestsFromFilters: (requests: (DaffFilterRequest)[], filters: DaffFilters) => DaffFilters;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DaffFilters, DaffFilterToggleRequest } from '../../../filterable/public_api';
|
|
2
|
+
/**
|
|
3
|
+
* Toggles the state of a filter option in the {@link DaffFilters}
|
|
4
|
+
* that matches the {@link DaffFilterToggleRequest}.
|
|
5
|
+
*/
|
|
6
|
+
export declare const daffToggleRequestOnFilters: (request: DaffFilterToggleRequest, filters: DaffFilters) => DaffFilters;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DaffFilterToggleRequest, DaffFilter } from '../../../filterable/public_api';
|
|
2
|
+
/**
|
|
3
|
+
* Toggles the state of the filters (and their options) in the {@link DaffFilter}
|
|
4
|
+
* that match the {@link DaffFilterToggleRequest} .
|
|
5
|
+
*/
|
|
6
|
+
export declare function daffToggleFilter(request: DaffFilterToggleRequest, filter: DaffFilter): DaffFilter;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DaffFilters } from '../../filterable/public_api';
|
|
2
|
+
/**
|
|
3
|
+
* Returns a {@link DaffFilters} and only their applied options.
|
|
4
|
+
* {@link DaffFilter} that have no applied options will be omitted.
|
|
5
|
+
*/
|
|
6
|
+
export declare const daffComputeAppliedFilters: (filters: DaffFilters) => DaffFilters;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The error codes applicable to the filter behaviors of `@daffodil/core`.
|
|
3
|
+
*/
|
|
4
|
+
export declare enum DaffFilterErrorCodes {
|
|
5
|
+
FILTER_REQUEST_TYPE_MISMATCH = "DAFF_FILTER_REQUEST_TYPE_MISMATCH",
|
|
6
|
+
FILTER_REQUEST_NAME_MISMATCH = "DAFF_FILTER_REQUEST_NAME_MISMATCH",
|
|
7
|
+
FILTER_NOT_FOUND = "DAFF_FILTER_NOT_FOUND",
|
|
8
|
+
UNKNOWN_FILTER_TYPE = "DAFF_FILTER_UNKNOWN_TYPE"
|
|
9
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DaffError, DaffInheritableError } from '../../errors/public_api';
|
|
2
|
+
/**
|
|
3
|
+
* An error thrown when a lookup for a filter.
|
|
4
|
+
*/
|
|
5
|
+
export declare class DaffFilterNotFound extends DaffInheritableError implements DaffError {
|
|
6
|
+
readonly code: string;
|
|
7
|
+
constructor(message?: string);
|
|
8
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { DaffFilterNotFound } from './filter-not-found.error';
|
|
2
|
+
export { DaffFilterRequestTypeMismatch } from './request-type-mismatch.error';
|
|
3
|
+
export { DaffFilterRequestNameMismatch } from './request-name-mismatch.error';
|
|
4
|
+
export { DaffFilterUnknownType } from './unknown-filter-type.error';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DaffError, DaffInheritableError } from '../../errors/public_api';
|
|
2
|
+
/**
|
|
3
|
+
* An error thrown when an operation targeting a filter matching one name
|
|
4
|
+
* matches a filter of another name.
|
|
5
|
+
*/
|
|
6
|
+
export declare class DaffFilterRequestNameMismatch extends DaffInheritableError implements DaffError {
|
|
7
|
+
readonly code: string;
|
|
8
|
+
constructor(message?: string);
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DaffError, DaffInheritableError } from '../../errors/public_api';
|
|
2
|
+
/**
|
|
3
|
+
* An error thrown when an operation targeting a filter matching one type
|
|
4
|
+
* matches a filter of another type.
|
|
5
|
+
*/
|
|
6
|
+
export declare class DaffFilterRequestTypeMismatch extends DaffInheritableError implements DaffError {
|
|
7
|
+
readonly code: string;
|
|
8
|
+
constructor(message?: string);
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DaffError, DaffInheritableError } from '../../errors/public_api';
|
|
2
|
+
/**
|
|
3
|
+
* An error thrown when an operation targeting a filter matches a type unknown
|
|
4
|
+
* to Daffodil.
|
|
5
|
+
*/
|
|
6
|
+
export declare class DaffFilterUnknownType extends DaffInheritableError implements DaffError {
|
|
7
|
+
readonly code: string;
|
|
8
|
+
constructor(message?: string);
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { daffFilterFindAppliedOptions } from './find-applied-options';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { DaffFilter, DaffFilterToggleRequest } from '../../filterable/public_api';
|
|
2
|
+
/**
|
|
3
|
+
* Determines whether or not a {@link DaffFilterToggleRequest} is already applied to a {@link DaffFilter}.
|
|
4
|
+
*/
|
|
5
|
+
export declare const daffIsToggleRequestAppliedToFilter: (request: DaffFilterToggleRequest, filter: DaffFilter) => boolean;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from './behaviors/apply/public_api';
|
|
2
|
+
export * from './behaviors/clear/public_api';
|
|
3
|
+
export * from './behaviors/remove/public_api';
|
|
4
|
+
export * from './behaviors/toggle/public_api';
|
|
5
|
+
export * from './is-applied/public_api';
|
|
6
|
+
export * from './find-applied/public_api';
|
|
7
|
+
export * from './to-request/public_api';
|
|
8
|
+
export * from './type/range/public_api';
|
|
9
|
+
export * from './type/equal/public_api';
|
|
10
|
+
export * from './validators/public_api';
|
|
11
|
+
export * from './errors/public_api';
|
|
12
|
+
export { daffFilterArrayToDict } from './array-to-dict/array-to-dict';
|
|
13
|
+
export { daffComputeAppliedFilters } from './compute-applied-filters/compute-applied-filters';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DaffFilter, DaffFilterRequest } from '../../filterable/public_api';
|
|
2
|
+
/**
|
|
3
|
+
* Builds a filter request from a filter.
|
|
4
|
+
* Returns null if the filter does not have at least one applied option.
|
|
5
|
+
*/
|
|
6
|
+
export declare function daffFilterToRequest(filter: DaffFilter): DaffFilterRequest | null;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DaffFilterRequest, DaffFilters } from '../../filterable/public_api';
|
|
2
|
+
/**
|
|
3
|
+
* Builds a list of filter requests from a list of filters.
|
|
4
|
+
* Requests are only built for the filters that have at least one applied option.
|
|
5
|
+
*/
|
|
6
|
+
export declare function daffFiltersToRequests(filters: DaffFilters): DaffFilterRequest[];
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { DaffFilterEqualOption } from '../../../../filterable/public_api';
|
|
2
|
+
/**
|
|
3
|
+
* Converts a list of equal filter options to a dict of options keyed by option value.
|
|
4
|
+
*/
|
|
5
|
+
export declare const daffFilterEqualOptionArrayToDict: (options: DaffFilterEqualOption[]) => Record<DaffFilterEqualOption['value'], DaffFilterEqualOption>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DaffFilterEqual, DaffFilterEqualRequest } from '../../../../../filterable/public_api';
|
|
2
|
+
/**
|
|
3
|
+
* Applies a {@link DaffFilterEqualRequest} to a {@link DaffFilterEqual}
|
|
4
|
+
*
|
|
5
|
+
* @idempotent {filter}
|
|
6
|
+
* @docs-private
|
|
7
|
+
*/
|
|
8
|
+
export declare const daffApplyFilterEqual: (request: DaffFilterEqualRequest, filter: DaffFilterEqual) => DaffFilterEqual;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DaffFilterEqual } from '../../../../../filterable/public_api';
|
|
2
|
+
/**
|
|
3
|
+
* Unapplies the applied filter options of a {@link DaffFilterEqual}
|
|
4
|
+
*
|
|
5
|
+
* @idempotent {filter}
|
|
6
|
+
* @docs-private
|
|
7
|
+
*/
|
|
8
|
+
export declare const daffClearFilterEqual: (filter: DaffFilterEqual) => DaffFilterEqual;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DaffFilterEqualRequest, DaffFilter, DaffFilterEqual } from '../../../../../filterable/public_api';
|
|
2
|
+
/**
|
|
3
|
+
* Removes the matching filter options of a {@link DaffFilterEqual}
|
|
4
|
+
* that match the {@link DaffFilterEqualRequest}
|
|
5
|
+
*
|
|
6
|
+
* If there are no matching options, returns the original {@link DaffFilterEqual}
|
|
7
|
+
*
|
|
8
|
+
* @idempotent {filter}
|
|
9
|
+
* @docs-private
|
|
10
|
+
*/
|
|
11
|
+
export declare const daffRemoveFilterEqual: (request: DaffFilterEqualRequest, filter: DaffFilterEqual) => DaffFilter;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DaffFilterEqual } from '../../../../../filterable/public_api';
|
|
2
|
+
import { DaffFilterEqualToggleRequest } from '../../../../../filterable/public_api';
|
|
3
|
+
/**
|
|
4
|
+
* Oscillates the applied state of the matching filter options of a {@link DaffFilterEqual}
|
|
5
|
+
* that match the {@link DaffFilterEqualRequest}
|
|
6
|
+
*
|
|
7
|
+
* If there are no matching options, returns the original {@link DaffFilterEqual}
|
|
8
|
+
*
|
|
9
|
+
* @docs-private
|
|
10
|
+
*/
|
|
11
|
+
export declare const daffToggleFilterEqual: (request: DaffFilterEqualToggleRequest, filter: DaffFilterEqual) => DaffFilterEqual;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { DaffFilterEqualToggleRequest, DaffFilterEqual } from '../../../../filterable/public_api';
|
|
2
|
+
/**
|
|
3
|
+
* Determines whether or not any {@link DaffFilterEqual} options matching {@link DaffFilterEqualToggleRequest} are applied.
|
|
4
|
+
*/
|
|
5
|
+
export declare const daffIsEqualToggleRequestAppliedToFilter: (request: DaffFilterEqualToggleRequest, filter: DaffFilterEqual) => boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { daffFilterEqualOptionArrayToDict } from './array-to-dict/option';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { DaffFilterEqual, DaffFilterEqualRequest } from '../../../../filterable/public_api';
|
|
2
|
+
/**
|
|
3
|
+
* Builds an {@link DaffFilterEqualRequest} from the passed filter and options.
|
|
4
|
+
*/
|
|
5
|
+
export declare const daffFilterEqualToRequest: (filter: DaffFilterEqual) => DaffFilterEqualRequest | null;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { DaffFilterRangePair } from '../../../../filterable/public_api';
|
|
2
|
+
/**
|
|
3
|
+
* Transforms an {@link DaffFilterRangePair[]} to a dictionary.
|
|
4
|
+
*/
|
|
5
|
+
export declare const daffFilterRangePairArrayToDict: <T>(pairs: DaffFilterRangePair<T>[]) => Record<string, DaffFilterRangePair<T>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DaffFilterRangeRequestBase, DaffFilterRangeBase } from '../../../../../filterable/public_api';
|
|
2
|
+
/**
|
|
3
|
+
* Applies a {@link DaffFilterRangeRequestBase} to a {@link DaffFilterRangeBase}
|
|
4
|
+
*
|
|
5
|
+
* @idempotent {filter}
|
|
6
|
+
* @docs-private
|
|
7
|
+
*/
|
|
8
|
+
export declare const daffApplyFilterRange: <T, U extends DaffFilterRangeRequestBase<T>, V extends DaffFilterRangeBase<T>>(request: U, filter: V) => V;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DaffFilterRangeBase } from '../../../../../filterable/public_api';
|
|
2
|
+
/**
|
|
3
|
+
* Unapplies the applied filter options of a {@link DaffFilterRangeBase}
|
|
4
|
+
*
|
|
5
|
+
* @idempotent {filter}
|
|
6
|
+
* @docs-private
|
|
7
|
+
*/
|
|
8
|
+
export declare const daffClearFilterRange: <T, U extends DaffFilterRangeBase<T>>(filter: U) => U;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DaffFilterRangeRequestBase, DaffFilterRangeBase } from '../../../../../filterable/public_api';
|
|
2
|
+
/**
|
|
3
|
+
* Removes the matching filter options of a {@link DaffFilterRangeBase}
|
|
4
|
+
* that match the {@link DaffFilterRangeRequestBase}
|
|
5
|
+
*
|
|
6
|
+
* If there are no matching options, returns the original {@link DaffFilterRangeBase}
|
|
7
|
+
*
|
|
8
|
+
* @idempotent {filter}
|
|
9
|
+
* @docs-private
|
|
10
|
+
*/
|
|
11
|
+
export declare const daffRemoveFilterRange: <T, U extends DaffFilterRangeBase<T>>(request: DaffFilterRangeRequestBase<T>, filter: U) => U;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DaffFilterRangeBase, DaffFilterRangeRequestBase } from '../../../../../filterable/public_api';
|
|
2
|
+
/**
|
|
3
|
+
* Oscillates the applied state of the matching filter options of a {@link DaffFilterRangeBase}
|
|
4
|
+
* that match the {@link DaffFilterRangeRequestBase}
|
|
5
|
+
*
|
|
6
|
+
* If there are no matching options, returns the original {@link DaffFilterRangeBase}
|
|
7
|
+
*
|
|
8
|
+
* @docs-private
|
|
9
|
+
*/
|
|
10
|
+
export declare const daffToggleFilterRange: <T, U extends DaffFilterRangeBase<T>>(request: DaffFilterRangeRequestBase<T>, filter: U) => U;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const daffFilterComputeRangePairLabel: (min: any, max: any) => string;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { DaffFilterRangeRequestBase, DaffFilterRangeBase } from '../../../../filterable/public_api';
|
|
2
|
+
/**
|
|
3
|
+
* Determines whether or not any {@link DaffFilterRangeBase} options matching {@link DaffFilterRangeRequestBase} are applied.
|
|
4
|
+
*/
|
|
5
|
+
export declare const daffIsRangeToggleRequestAppliedToFilter: <T>(request: DaffFilterRangeRequestBase<T>, filter: DaffFilterRangeBase<T>) => boolean;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { DaffFilterRangeBase, DaffFilterRangeRequestBase } from '../../../../filterable/public_api';
|
|
2
|
+
/**
|
|
3
|
+
* Builds a {@link DaffFilterRangeRequestBase} from the passed {@link DaffFilterRangeBase} and options.
|
|
4
|
+
*/
|
|
5
|
+
export declare const daffFilterRangeToRequest: <T, U extends DaffFilterRangeBase<T>>(filter: U) => DaffFilterRangeRequestBase<T>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { DaffFilterRangeNumeric, DaffFilterRangeNumericRequest } from '../../../../filterable/public_api';
|
|
2
|
+
/**
|
|
3
|
+
* Transforms a {@link DaffFilterRangeNumeric} into a {@link DaffFilterRangeNumericRequest}
|
|
4
|
+
*/
|
|
5
|
+
export declare const daffFilterRangeNumericToRequest: (filter: DaffFilterRangeNumeric) => DaffFilterRangeNumericRequest;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DaffFilterRequest, DaffFilter, DaffFilterToggleRequest } from '../../filterable/public_api';
|
|
2
|
+
/**
|
|
3
|
+
* Ensures that the names of the filter and the filter request match.
|
|
4
|
+
*
|
|
5
|
+
* @throws {@link DaffFilterNotFound} if the names do not match.
|
|
6
|
+
*/
|
|
7
|
+
export declare const daffFilterValidateRequestNameMatch: (request: DaffFilterRequest | DaffFilterToggleRequest, filter: DaffFilter) => void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DaffFilterRequest, DaffFilter, DaffFilterToggleRequest } from '../../filterable/public_api';
|
|
2
|
+
/**
|
|
3
|
+
* Ensures that the types of the filter and the filter request match.
|
|
4
|
+
*
|
|
5
|
+
* @throws {@link DaffFilterRequestTypeMismatch} if the types do not match.
|
|
6
|
+
*/
|
|
7
|
+
export declare const daffFilterValidateRequestTypeMatch: (request: DaffFilterRequest | DaffFilterToggleRequest, filter: DaffFilter) => void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { DaffQueuedApollo } from './queued-apollo/queued-apollo.service';
|
|
2
|
-
export {
|
|
2
|
+
export { DaffApolloLinkGenerator } from './cacheable-operations/cacheable-operations-link.interface';
|
package/package.json
CHANGED
package/public_api.d.ts
CHANGED
|
@@ -11,4 +11,6 @@ export * from './kindable/public_api';
|
|
|
11
11
|
export * from './base64/public_api';
|
|
12
12
|
export * from './collection/public_api';
|
|
13
13
|
export * from './identifiable/public_api';
|
|
14
|
+
export * from './filterable/public_api';
|
|
15
|
+
export * from './filters/public_api';
|
|
14
16
|
export { DaffOrderable } from './orderable/orderable';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { DaffFilter } from '@daffodil/core';
|
|
2
|
+
import { DaffModelFactory } from '../factory';
|
|
3
|
+
import { DaffFilterEqualFactory } from './type/equal';
|
|
4
|
+
import { DaffFilterRangeNumericFactory } from './type/range-numeric';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class MockDaffFilter {
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* A factory for creating a {@link DaffFilter}.
|
|
10
|
+
*/
|
|
11
|
+
export declare class DaffFilterFactory extends DaffModelFactory<DaffFilter> {
|
|
12
|
+
private equalFactory;
|
|
13
|
+
private rangeFactory;
|
|
14
|
+
constructor(equalFactory: DaffFilterEqualFactory, rangeFactory: DaffFilterRangeNumericFactory);
|
|
15
|
+
create(partial?: Partial<DaffFilter>): DaffFilter;
|
|
16
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffFilterFactory, never>;
|
|
17
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DaffFilterFactory>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DaffFilterRequest } from '@daffodil/core';
|
|
2
|
+
import { DaffModelFactory } from '../factory';
|
|
3
|
+
import { DaffFilterRequestEqualFactory } from './type/equal/request';
|
|
4
|
+
import { DaffFilterRequestRangeNumericFactory } from './type/range-numeric/request';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
/**
|
|
7
|
+
* A factory for creating a {@link DaffFilterRequest}.
|
|
8
|
+
*/
|
|
9
|
+
export declare class DaffFilterRequestFactory extends DaffModelFactory<DaffFilterRequest> {
|
|
10
|
+
constructor(equalFactory: DaffFilterRequestEqualFactory, rangeFactory: DaffFilterRequestRangeNumericFactory);
|
|
11
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffFilterRequestFactory, never>;
|
|
12
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DaffFilterRequestFactory>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { DaffFilterToggleRequest } from '@daffodil/core';
|
|
2
|
+
import { DaffModelFactory } from '../factory';
|
|
3
|
+
import { DaffFilterToggleRequestEqualFactory } from './type/equal/toggle-request';
|
|
4
|
+
import { DaffFilterToggleRequestRangeNumericFactory } from './type/range-numeric/toggle-request';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class MockDaffFilterToggleRequest {
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* A factory for creating a {@link DaffFilterToggleRequest}.
|
|
10
|
+
*/
|
|
11
|
+
export declare class DaffFilterToggleRequestFactory extends DaffModelFactory<DaffFilterToggleRequest> {
|
|
12
|
+
private equalFactory;
|
|
13
|
+
private rangeFactory;
|
|
14
|
+
constructor(equalFactory: DaffFilterToggleRequestEqualFactory, rangeFactory: DaffFilterToggleRequestRangeNumericFactory);
|
|
15
|
+
create(partial?: Partial<DaffFilterToggleRequest>): DaffFilterToggleRequest;
|
|
16
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffFilterToggleRequestFactory, never>;
|
|
17
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DaffFilterToggleRequestFactory>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { DaffFilterEqualOption } from '@daffodil/core';
|
|
2
|
+
import { DaffModelFactory } from '../../../factory';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class MockDaffFilterEqualOption implements DaffFilterEqualOption {
|
|
5
|
+
applied: boolean;
|
|
6
|
+
value: any;
|
|
7
|
+
label: any;
|
|
8
|
+
count: any;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* A factory for creating a {@link DaffFilterEqualOption}.
|
|
12
|
+
*/
|
|
13
|
+
export declare class DaffFilterEqualOptionFactory extends DaffModelFactory<DaffFilterEqualOption> {
|
|
14
|
+
constructor();
|
|
15
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffFilterEqualOptionFactory, never>;
|
|
16
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DaffFilterEqualOptionFactory>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { DaffFilterEqualOptionFactory, MockDaffFilterEqualOption, } from './option';
|
|
2
|
+
export { DaffFilterRequestEqualFactory, MockDaffFilterEqualRequest, } from './request';
|
|
3
|
+
export { DaffFilterToggleRequestEqualFactory, MockDaffFilterToggleEqualRequest, } from './toggle-request';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { DaffFilterEqualRequest, DaffFilterType } from '@daffodil/core';
|
|
2
|
+
import { DaffModelFactory } from '../../../factory';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class MockDaffFilterEqualRequest implements DaffFilterEqualRequest {
|
|
5
|
+
type: DaffFilterType.Equal;
|
|
6
|
+
name: any;
|
|
7
|
+
value: any[];
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* A factory for creating a {@link DaffFilterEqualRequest}.
|
|
11
|
+
*/
|
|
12
|
+
export declare class DaffFilterRequestEqualFactory extends DaffModelFactory<DaffFilterEqualRequest> {
|
|
13
|
+
constructor();
|
|
14
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffFilterRequestEqualFactory, never>;
|
|
15
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DaffFilterRequestEqualFactory>;
|
|
16
|
+
}
|