@esri/hub-common 9.49.0 → 10.0.0-next.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.
Files changed (102) hide show
  1. package/dist/es2017/search/_internal/hubSearchItems.js +0 -43
  2. package/dist/es2017/search/_internal/hubSearchItems.js.map +1 -1
  3. package/dist/es2017/search/_internal/index.js +0 -1
  4. package/dist/es2017/search/_internal/index.js.map +1 -1
  5. package/dist/es2017/search/_internal/portalSearchGroups.js +0 -1
  6. package/dist/es2017/search/_internal/portalSearchGroups.js.map +1 -1
  7. package/dist/es2017/search/_internal/portalSearchItems.js +1 -4
  8. package/dist/es2017/search/_internal/portalSearchItems.js.map +1 -1
  9. package/dist/es2017/search/_internal/portalSearchUsers.js +0 -1
  10. package/dist/es2017/search/_internal/portalSearchUsers.js.map +1 -1
  11. package/dist/es2017/search/_searchContent.js +1 -5
  12. package/dist/es2017/search/_searchContent.js.map +1 -1
  13. package/dist/es2017/search/_searchGroups.js.map +1 -1
  14. package/dist/es2017/search/content-utils.js +2 -67
  15. package/dist/es2017/search/content-utils.js.map +1 -1
  16. package/dist/es2017/search/index.js +0 -1
  17. package/dist/es2017/search/index.js.map +1 -1
  18. package/dist/es2017/search/types/index.js +0 -2
  19. package/dist/es2017/search/types/index.js.map +1 -1
  20. package/dist/es2017/types.js.map +1 -1
  21. package/dist/esm/search/_internal/hubSearchItems.js +1 -45
  22. package/dist/esm/search/_internal/hubSearchItems.js.map +1 -1
  23. package/dist/esm/search/_internal/index.js +0 -1
  24. package/dist/esm/search/_internal/index.js.map +1 -1
  25. package/dist/esm/search/_internal/portalSearchGroups.js +0 -1
  26. package/dist/esm/search/_internal/portalSearchGroups.js.map +1 -1
  27. package/dist/esm/search/_internal/portalSearchItems.js +2 -4
  28. package/dist/esm/search/_internal/portalSearchItems.js.map +1 -1
  29. package/dist/esm/search/_internal/portalSearchUsers.js +0 -1
  30. package/dist/esm/search/_internal/portalSearchUsers.js.map +1 -1
  31. package/dist/esm/search/_searchContent.js +1 -5
  32. package/dist/esm/search/_searchContent.js.map +1 -1
  33. package/dist/esm/search/_searchGroups.js.map +1 -1
  34. package/dist/esm/search/content-utils.js +2 -70
  35. package/dist/esm/search/content-utils.js.map +1 -1
  36. package/dist/esm/search/index.js +0 -1
  37. package/dist/esm/search/index.js.map +1 -1
  38. package/dist/esm/search/types/index.js +0 -2
  39. package/dist/esm/search/types/index.js.map +1 -1
  40. package/dist/esm/types.js.map +1 -1
  41. package/dist/node/search/_internal/hubSearchItems.js +1 -45
  42. package/dist/node/search/_internal/hubSearchItems.js.map +1 -1
  43. package/dist/node/search/_internal/index.js +0 -1
  44. package/dist/node/search/_internal/index.js.map +1 -1
  45. package/dist/node/search/_internal/portalSearchGroups.js +0 -1
  46. package/dist/node/search/_internal/portalSearchGroups.js.map +1 -1
  47. package/dist/node/search/_internal/portalSearchItems.js +0 -3
  48. package/dist/node/search/_internal/portalSearchItems.js.map +1 -1
  49. package/dist/node/search/_internal/portalSearchUsers.js +0 -1
  50. package/dist/node/search/_internal/portalSearchUsers.js.map +1 -1
  51. package/dist/node/search/_searchContent.js +0 -4
  52. package/dist/node/search/_searchContent.js.map +1 -1
  53. package/dist/node/search/_searchGroups.js.map +1 -1
  54. package/dist/node/search/content-utils.js +3 -70
  55. package/dist/node/search/content-utils.js.map +1 -1
  56. package/dist/node/search/index.js +0 -1
  57. package/dist/node/search/index.js.map +1 -1
  58. package/dist/node/search/types/index.js +0 -2
  59. package/dist/node/search/types/index.js.map +1 -1
  60. package/dist/node/types.js.map +1 -1
  61. package/dist/types/search/_internal/hubSearchItems.d.ts +1 -2
  62. package/dist/types/search/_internal/index.d.ts +0 -1
  63. package/dist/types/search/_searchGroups.d.ts +1 -5
  64. package/dist/types/search/content-utils.d.ts +1 -18
  65. package/dist/types/search/index.d.ts +0 -1
  66. package/dist/types/search/types/ICatalog.d.ts +0 -5
  67. package/dist/types/search/types/ICollection.d.ts +0 -2
  68. package/dist/types/search/types/IHubSearchResponse.d.ts +0 -5
  69. package/dist/types/search/types/index.d.ts +0 -2
  70. package/dist/types/search/types/types.d.ts +0 -2
  71. package/dist/types/types.d.ts +0 -2
  72. package/dist/umd/common.umd.js +3 -327
  73. package/dist/umd/common.umd.js.map +1 -1
  74. package/package.json +1 -1
  75. package/dist/es2017/search/_internal/state.js +0 -155
  76. package/dist/es2017/search/_internal/state.js.map +0 -1
  77. package/dist/es2017/search/collectionState.js +0 -60
  78. package/dist/es2017/search/collectionState.js.map +0 -1
  79. package/dist/es2017/search/types/IFacet.js +0 -1
  80. package/dist/es2017/search/types/IFacet.js.map +0 -1
  81. package/dist/es2017/search/types/IFacetOption.js +0 -1
  82. package/dist/es2017/search/types/IFacetOption.js.map +0 -1
  83. package/dist/esm/search/_internal/state.js +0 -155
  84. package/dist/esm/search/_internal/state.js.map +0 -1
  85. package/dist/esm/search/collectionState.js +0 -61
  86. package/dist/esm/search/collectionState.js.map +0 -1
  87. package/dist/esm/search/types/IFacet.js +0 -1
  88. package/dist/esm/search/types/IFacet.js.map +0 -1
  89. package/dist/esm/search/types/IFacetOption.js +0 -1
  90. package/dist/esm/search/types/IFacetOption.js.map +0 -1
  91. package/dist/node/search/_internal/state.js +0 -166
  92. package/dist/node/search/_internal/state.js.map +0 -1
  93. package/dist/node/search/collectionState.js +0 -65
  94. package/dist/node/search/collectionState.js.map +0 -1
  95. package/dist/node/search/types/IFacet.js +0 -3
  96. package/dist/node/search/types/IFacet.js.map +0 -1
  97. package/dist/node/search/types/IFacetOption.js +0 -3
  98. package/dist/node/search/types/IFacetOption.js.map +0 -1
  99. package/dist/types/search/_internal/state.d.ts +0 -70
  100. package/dist/types/search/collectionState.d.ts +0 -19
  101. package/dist/types/search/types/IFacet.d.ts +0 -62
  102. package/dist/types/search/types/IFacetOption.d.ts +0 -30
@@ -1,65 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.serializeCollectionState = exports.applyCollectionState = void 0;
4
- const util_1 = require("../util");
5
- const state_1 = require("./_internal/state");
6
- /**
7
- * Apply ICollectionState to an ICollection
8
- *
9
- * Typically used in a Gallery or Catalog component to
10
- * set the inital state, based on values deserialized
11
- * from a query string
12
- * @param collection
13
- * @param state
14
- * @returns
15
- */
16
- function applyCollectionState(collection, state) {
17
- const updated = util_1.cloneObject(collection);
18
- // Apply default query
19
- if (state.query) {
20
- updated.defaultQuery = state.query;
21
- }
22
- // Apply Sort State
23
- updated.sortOption = state_1.applySortState(updated.sortOption, state.sort);
24
- // Look for state props for the facets and apply them
25
- updated.facets = updated.facets.map((facet) => {
26
- // see if there is a key for this facet on the state
27
- if (Object.keys(state).includes(facet.key)) {
28
- const facetState = {};
29
- facetState[facet.key] = state[facet.key];
30
- return state_1.applyFacetState(facet, facetState);
31
- }
32
- else {
33
- // Ensure all options are not selected
34
- // because they were not included in the state
35
- facet.options.forEach((opt) => {
36
- opt.selected = false;
37
- });
38
- return facet;
39
- }
40
- });
41
- //
42
- return updated;
43
- }
44
- exports.applyCollectionState = applyCollectionState;
45
- /**
46
- * Serialize the current state of a collection into a hash that
47
- * can be converted into a query string
48
- * @param collection
49
- * @returns
50
- */
51
- function serializeCollectionState(collection) {
52
- const state = {};
53
- if (collection.defaultQuery) {
54
- state.query = collection.defaultQuery;
55
- }
56
- if (collection.sortOption) {
57
- state.sort = state_1.serializeSortState(collection.sortOption);
58
- }
59
- const facetState = (collection.facets || []).reduce((s, facet) => {
60
- return Object.assign(Object.assign({}, s), state_1.serializeFacetState(facet));
61
- }, {});
62
- return Object.assign(Object.assign({}, state), facetState);
63
- }
64
- exports.serializeCollectionState = serializeCollectionState;
65
- //# sourceMappingURL=collectionState.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"collectionState.js","sourceRoot":"","sources":["../../../src/search/collectionState.ts"],"names":[],"mappings":";;;AACA,kCAAsC;AAEtC,6CAK2B;AAE3B;;;;;;;;;GASG;AAEH,SAAgB,oBAAoB,CAClC,UAAuB,EACvB,KAAu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B,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;KACxD;IAED,MAAM,UAAU,GAAG,CAAC,UAAU,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE;QAC/D,uCAAY,CAAC,GAAK,2BAAmB,CAAC,KAAK,CAAC,EAAG;IACjD,CAAC,EAAE,EAAiB,CAAC,CAAC;IAEtB,uCAAY,KAAK,GAAK,UAAU,EAAG;AACrC,CAAC;AAlBD,4DAkBC"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=IFacet.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IFacet.js","sourceRoot":"","sources":["../../../../src/search/types/IFacet.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=IFacetOption.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IFacetOption.js","sourceRoot":"","sources":["../../../../src/search/types/IFacetOption.ts"],"names":[],"mappings":""}
@@ -1,70 +0,0 @@
1
- import { IFacet, IFacetState, ISortOption } from "../types";
2
- /**
3
- * @private
4
- * Apply the sortState to SortOptions
5
- *
6
- * @param sortOptions
7
- * @param sortState
8
- * @returns
9
- */
10
- export declare function applySortState(sortOptions: ISortOption, sortState: string): ISortOption;
11
- /**
12
- * @private
13
- * Apply FacetState to a Facet
14
- * @param facet
15
- * @param state
16
- * @returns
17
- */
18
- export declare function applyFacetState(facet: IFacet, state: IFacetState): IFacet;
19
- /**
20
- * @private
21
- * Apply the Facet State onto a single-select facet
22
- *
23
- * Intentionally mutates the facet.
24
- * @param facet
25
- * @param state
26
- * @returns
27
- */
28
- export declare function applySingleSelectFacetState(facet: IFacet, state: IFacetState): IFacet;
29
- /**
30
- * @private
31
- * Serialize single-select facet into IFacetState
32
- * @param facet
33
- * @returns
34
- */
35
- export declare function serializeSingleSelectFacetState(facet: IFacet): IFacetState;
36
- /**
37
- * @private
38
- * Apply the Facet State onto a multi-select Facet
39
- *
40
- * Intentionally mutates the facet.
41
- * @param facet
42
- * @param state
43
- * @returns
44
- */
45
- export declare function applyMultiSelectFacetState(facet: IFacet, state: IFacetState): IFacet;
46
- /**
47
- * @private
48
- * Serialize multi-select facet into IFacetState
49
- * @param facet
50
- * @returns
51
- */
52
- export declare function serializeMultiSelectFacetState(facet: IFacet): IFacetState;
53
- /**
54
- * @private
55
- * Serialize the state of the SortOption into a key/value pair
56
- *
57
- * Called from the Sort component
58
- * @param sort
59
- * @returns
60
- */
61
- export declare function serializeSortState(sort: ISortOption): string;
62
- /**
63
- * @private
64
- * Serialize the state of a facet into a key/value pair
65
- *
66
- * Called from the various facet components
67
- * @param facet
68
- * @returns
69
- */
70
- export declare function serializeFacetState(facet: IFacet): IFacetState;
@@ -1,19 +0,0 @@
1
- import { ICollection, ICollectionState } from "./types";
2
- /**
3
- * Apply ICollectionState to an ICollection
4
- *
5
- * Typically used in a Gallery or Catalog component to
6
- * set the inital state, based on values deserialized
7
- * from a query string
8
- * @param collection
9
- * @param state
10
- * @returns
11
- */
12
- export declare function applyCollectionState(collection: ICollection, state: ICollectionState): ICollection;
13
- /**
14
- * Serialize the current state of a collection into a hash that
15
- * can be converted into a query string
16
- * @param collection
17
- * @returns
18
- */
19
- export declare function serializeCollectionState(collection: ICollection): ICollectionState;
@@ -1,62 +0,0 @@
1
- import { IFacetOption } from "./IFacetOption";
2
- /**
3
- * Definition of a Facet shown in the Gallery UI.
4
- *
5
- * If a `field` is specified, the Facet will be "dynamic" in that
6
- * it will request aggregations for the field and use the returned
7
- * values to create the FacetOptions.
8
- *
9
- * `Facet` contains and array if `FacetOptions`. When selected
10
- * in the UI, a FilterGroup is constructed from the `Facet.operation`
11
- * and the `Filters` are from the selected `FacetOptions`.
12
- */
13
- export interface IFacet {
14
- /**
15
- * Translated label for the facet
16
- */
17
- label?: string;
18
- /**
19
- * Unique key, used for query params and telemetry
20
- */
21
- key?: string;
22
- /**
23
- * field to generate the facet from
24
- */
25
- field?: string;
26
- /**
27
- * limit of aggregates returned. Max 200
28
- */
29
- aggLimit?: number;
30
- /**
31
- * Display for this facet. Not all facets will be compatible with all displays
32
- */
33
- display?: "map" | "single-select" | "multi-select" | "date-range" | "histogram";
34
- /**
35
- * State of the Facet
36
- */
37
- state?: "open" | "closed";
38
- /**
39
- * Individual options for this Facet
40
- */
41
- options?: IFacetOption[];
42
- /**
43
- * Operation is passed into the FilterGroup that is constructed
44
- * when the Facet is serialized.
45
- * Implemetations should default to "OR" if not specified
46
- */
47
- operation?: "OR" | "AND";
48
- /**
49
- * Number of facet options to show by default. Only applies to `multi-select`, and defaults to all.
50
- */
51
- optionLimit?: number;
52
- /**
53
- * Specifies how to order the facet options. Only applies to `multi-select`, and defaults to count.
54
- * - count: orders by `option.count` in descending order of frequency
55
- * - label: orders by `option.label` in ascending alphabetical order
56
- */
57
- orderBy?: "count" | "label";
58
- accordionClosed?: boolean;
59
- type?: "single-select" | "multi-select" | "date-range" | "histogram";
60
- pageSize?: number;
61
- aggField?: string;
62
- }
@@ -1,30 +0,0 @@
1
- import { Filter, FilterType } from "./types";
2
- /**
3
- * Facet Option shown in the UI as either a radio button or checkbox
4
- */
5
- export interface IFacetOption {
6
- /**
7
- * Translated label for the option
8
- */
9
- label: string;
10
- /**
11
- * Unique key, used for query params and telemetry
12
- */
13
- key: string;
14
- /**
15
- * For aggregate based Facets, the count of entries in the index with this value
16
- */
17
- count?: number;
18
- /**
19
- * Is this option selected when the UI loads
20
- */
21
- selected: boolean;
22
- /**
23
- * Filters to be applied when this option is selected
24
- */
25
- filters?: Array<Filter<FilterType>>;
26
- /**
27
- * DEPRECATED: Filter to be applied when this option is selected
28
- */
29
- filter?: Filter<FilterType>;
30
- }