piral-search 0.15.0-alpha.4041 → 0.15.0-alpha.4098
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/esm/types.d.ts +9 -1
- package/lib/create.js +2 -2
- package/lib/create.js.map +1 -1
- package/lib/index.js +6 -6
- package/lib/index.js.map +1 -1
- package/lib/types.d.ts +9 -1
- package/package.json +6 -6
- package/src/types.ts +11 -2
package/esm/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ReactChild, ComponentType, ReactElement } from 'react';
|
|
1
|
+
import type { ReactChild, ComponentType, ReactElement, ReactNode } from 'react';
|
|
2
2
|
import type { Dict, Disposable, PiletApi, BaseRegistration, AnyComponent, BaseComponentProps, RegistrationDisposer } from 'piral-core';
|
|
3
3
|
declare module 'piral-core/lib/types/custom' {
|
|
4
4
|
interface PiletCustomApi extends PiletSearchApi {
|
|
@@ -77,6 +77,10 @@ export interface SearchContainerProps {
|
|
|
77
77
|
* Gets if the results are still gathered.
|
|
78
78
|
*/
|
|
79
79
|
loading: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* The search to display.
|
|
82
|
+
*/
|
|
83
|
+
children?: ReactNode;
|
|
80
84
|
}
|
|
81
85
|
export interface SearchInputProps {
|
|
82
86
|
setValue(value: string): void;
|
|
@@ -85,6 +89,10 @@ export interface SearchInputProps {
|
|
|
85
89
|
export interface SearchResultComponentProps extends BaseComponentProps {
|
|
86
90
|
}
|
|
87
91
|
export interface SearchResultProps {
|
|
92
|
+
/**
|
|
93
|
+
* The search results to display.
|
|
94
|
+
*/
|
|
95
|
+
children?: ReactNode;
|
|
88
96
|
}
|
|
89
97
|
export declare type SearchResultType = string | ReactElement<any> | AnyComponent<SearchResultComponentProps>;
|
|
90
98
|
export interface SearchProvider {
|
package/lib/create.js
CHANGED
|
@@ -10,7 +10,7 @@ const Search_1 = require("./Search");
|
|
|
10
10
|
const SearchInput_1 = require("./SearchInput");
|
|
11
11
|
function noop() { }
|
|
12
12
|
function createSearchRegistration(pilet, search, settings = {}) {
|
|
13
|
-
const { onlyImmediate = false, onCancel = noop, onClear = noop } = settings, rest =
|
|
13
|
+
const { onlyImmediate = false, onCancel = noop, onClear = noop } = settings, rest = tslib_1.__rest(settings, ["onlyImmediate", "onCancel", "onClear"]);
|
|
14
14
|
return Object.assign(Object.assign({}, rest), { pilet,
|
|
15
15
|
onlyImmediate, cancel: (0, piral_core_1.isfunc)(onCancel) ? onCancel : noop, clear: (0, piral_core_1.isfunc)(onClear) ? onClear : noop, search });
|
|
16
16
|
}
|
|
@@ -48,7 +48,7 @@ function withSearch(searchProviders, query, items) {
|
|
|
48
48
|
* Creates new Pilet API extensions for search and filtering.
|
|
49
49
|
*/
|
|
50
50
|
function createSearchApi(config = {}) {
|
|
51
|
-
const { providers = [], results = [], query = '' } = config, actionConfig =
|
|
51
|
+
const { providers = [], results = [], query = '' } = config, actionConfig = tslib_1.__rest(config, ["providers", "results", "query"]);
|
|
52
52
|
return (context) => {
|
|
53
53
|
context.defineActions((0, actions_1.createActions)(actionConfig));
|
|
54
54
|
context.dispatch((0, piral_core_1.withAll)(withSearch(getSearchProviders(providers), query, results), (0, piral_core_1.withRootExtension)('piral-search', Search_1.Search), (0, piral_core_1.withRootExtension)('piral-search-input', SearchInput_1.SearchInput)));
|
package/lib/create.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.js","sourceRoot":"","sources":["../src/create.ts"],"names":[],"mappings":";;;;AAAA,iCAAkE;AAClE,2CAWoB;AACpB,uCAA0C;AAC1C,uCAA0E;AAC1E,qCAAkC;AAClC,+CAA4C;AAsD5C,SAAS,IAAI,KAAI,CAAC;AAElB,SAAS,wBAAwB,CAC/B,KAAa,EACb,MAAqB,EACrB,WAA2B,EAAE;IAE7B,MAAM,EAAE,aAAa,GAAG,KAAK,EAAE,QAAQ,GAAG,IAAI,EAAE,OAAO,GAAG,IAAI,KAAc,QAAQ,E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J,CAAC;AAhDD,0CAgDC"}
|
package/lib/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
tslib_1.__exportStar(require("./create"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./components"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./SearchInput"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./Search"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./types"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./useSearch"), exports);
|
|
10
10
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,mDAAyB;AACzB,uDAA6B;AAC7B,wDAA8B;AAC9B,mDAAyB;AACzB,kDAAwB;AACxB,sDAA4B"}
|
package/lib/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ReactChild, ComponentType, ReactElement } from 'react';
|
|
1
|
+
import type { ReactChild, ComponentType, ReactElement, ReactNode } from 'react';
|
|
2
2
|
import type { Dict, Disposable, PiletApi, BaseRegistration, AnyComponent, BaseComponentProps, RegistrationDisposer } from 'piral-core';
|
|
3
3
|
declare module 'piral-core/lib/types/custom' {
|
|
4
4
|
interface PiletCustomApi extends PiletSearchApi {
|
|
@@ -77,6 +77,10 @@ export interface SearchContainerProps {
|
|
|
77
77
|
* Gets if the results are still gathered.
|
|
78
78
|
*/
|
|
79
79
|
loading: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* The search to display.
|
|
82
|
+
*/
|
|
83
|
+
children?: ReactNode;
|
|
80
84
|
}
|
|
81
85
|
export interface SearchInputProps {
|
|
82
86
|
setValue(value: string): void;
|
|
@@ -85,6 +89,10 @@ export interface SearchInputProps {
|
|
|
85
89
|
export interface SearchResultComponentProps extends BaseComponentProps {
|
|
86
90
|
}
|
|
87
91
|
export interface SearchResultProps {
|
|
92
|
+
/**
|
|
93
|
+
* The search results to display.
|
|
94
|
+
*/
|
|
95
|
+
children?: ReactNode;
|
|
88
96
|
}
|
|
89
97
|
export declare type SearchResultType = string | ReactElement<any> | AnyComponent<SearchResultComponentProps>;
|
|
90
98
|
export interface SearchProvider {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "piral-search",
|
|
3
|
-
"version": "0.15.0-alpha.
|
|
3
|
+
"version": "0.15.0-alpha.4098",
|
|
4
4
|
"description": "Plugin for centralizing search in Piral.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"piral",
|
|
@@ -44,13 +44,13 @@
|
|
|
44
44
|
"test": "echo \"Error: run tests from root\" && exit 1"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@types/react": "^
|
|
48
|
-
"piral-core": "0.15.0-alpha.
|
|
49
|
-
"react": "^
|
|
47
|
+
"@types/react": "^18.0.0",
|
|
48
|
+
"piral-core": "0.15.0-alpha.4098",
|
|
49
|
+
"react": "^18.0.0"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
|
-
"piral-core": "0.14.x",
|
|
52
|
+
"piral-core": "0.14.x || 0.15.x",
|
|
53
53
|
"react": ">=16.8.0"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "02ef35574b29cc5dd93c515bfdf27dd523893b28"
|
|
56
56
|
}
|
package/src/types.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ReactChild, ComponentType, ReactElement } from 'react';
|
|
1
|
+
import type { ReactChild, ComponentType, ReactElement, ReactNode } from 'react';
|
|
2
2
|
import type {
|
|
3
3
|
Dict,
|
|
4
4
|
Disposable,
|
|
@@ -90,6 +90,10 @@ export interface SearchContainerProps {
|
|
|
90
90
|
* Gets if the results are still gathered.
|
|
91
91
|
*/
|
|
92
92
|
loading: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* The search to display.
|
|
95
|
+
*/
|
|
96
|
+
children?: ReactNode;
|
|
93
97
|
}
|
|
94
98
|
|
|
95
99
|
export interface SearchInputProps {
|
|
@@ -99,7 +103,12 @@ export interface SearchInputProps {
|
|
|
99
103
|
|
|
100
104
|
export interface SearchResultComponentProps extends BaseComponentProps {}
|
|
101
105
|
|
|
102
|
-
export interface SearchResultProps {
|
|
106
|
+
export interface SearchResultProps {
|
|
107
|
+
/**
|
|
108
|
+
* The search results to display.
|
|
109
|
+
*/
|
|
110
|
+
children?: ReactNode;
|
|
111
|
+
}
|
|
103
112
|
|
|
104
113
|
export type SearchResultType = string | ReactElement<any> | AnyComponent<SearchResultComponentProps>;
|
|
105
114
|
|