@ahoo-wang/fetcher-viewer 2.8.1 → 2.8.3
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/README.md +30 -4
- package/dist/filter/conditionFilter.d.ts +6 -0
- package/dist/filter/conditionFilter.d.ts.map +1 -0
- package/dist/filter/conditionFilterRegistry.d.ts +9 -0
- package/dist/filter/conditionFilterRegistry.d.ts.map +1 -0
- package/dist/filter/index.d.ts +4 -0
- package/dist/filter/index.d.ts.map +1 -0
- package/dist/filter/types.d.ts +22 -0
- package/dist/filter/types.d.ts.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.js +26 -1
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +14 -10
package/README.md
CHANGED
|
@@ -1,26 +1,52 @@
|
|
|
1
1
|
## Viewer
|
|
2
2
|
|
|
3
3
|
- views
|
|
4
|
+
- personal views
|
|
5
|
+
- public views
|
|
6
|
+
- current view
|
|
7
|
+
- actions
|
|
8
|
+
- add
|
|
9
|
+
- delete
|
|
10
|
+
- edit name
|
|
11
|
+
- sort
|
|
4
12
|
|
|
5
13
|
## View
|
|
6
14
|
|
|
15
|
+
- type
|
|
16
|
+
- system
|
|
17
|
+
- user
|
|
18
|
+
- filter
|
|
19
|
+
- table
|
|
7
20
|
- actions
|
|
8
21
|
- refresh
|
|
9
22
|
- timedRefresh
|
|
23
|
+
- trigger
|
|
10
24
|
- extra
|
|
11
|
-
|
|
12
|
-
- table
|
|
25
|
+
|
|
13
26
|
|
|
14
27
|
## Filter
|
|
15
28
|
|
|
29
|
+
- allConditions
|
|
16
30
|
- conditions
|
|
31
|
+
- actions
|
|
32
|
+
- search
|
|
33
|
+
- addConditionFilter
|
|
34
|
+
- removeConditionFilter
|
|
35
|
+
- group: and , or , nor
|
|
36
|
+
- friendly
|
|
37
|
+
|
|
38
|
+
### ConditionFilter
|
|
39
|
+
|
|
40
|
+
- type
|
|
17
41
|
- filter friendly
|
|
42
|
+
- actions
|
|
43
|
+
- reset
|
|
18
44
|
|
|
19
45
|
## Table
|
|
20
46
|
|
|
21
47
|
- columns
|
|
22
|
-
-
|
|
48
|
+
- field
|
|
23
49
|
- actions
|
|
24
50
|
- projection
|
|
25
51
|
- pagination
|
|
26
|
-
|
|
52
|
+
- data
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ConditionFilterProps } from './types';
|
|
2
|
+
export interface TypedConditionFilterProps extends ConditionFilterProps {
|
|
3
|
+
type: string;
|
|
4
|
+
}
|
|
5
|
+
export declare function ConditionFilter(props: TypedConditionFilterProps): import('react').ReactNode;
|
|
6
|
+
//# sourceMappingURL=conditionFilter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conditionFilter.d.ts","sourceRoot":"","sources":["../../src/filter/conditionFilter.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAG/C,MAAM,WAAW,yBAA0B,SAAQ,oBAAoB;IACrE,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,yBAAyB,6BAM/D"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ConditionFilterComponent } from './types';
|
|
2
|
+
export declare class ConditionFilterRegistry {
|
|
3
|
+
private readonly filters;
|
|
4
|
+
register(type: string, filter: ConditionFilterComponent): void;
|
|
5
|
+
unregister(type: string): boolean;
|
|
6
|
+
get(type: string): ConditionFilterComponent | undefined;
|
|
7
|
+
}
|
|
8
|
+
export declare const conditionFilterRegistry: ConditionFilterRegistry;
|
|
9
|
+
//# sourceMappingURL=conditionFilterRegistry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conditionFilterRegistry.d.ts","sourceRoot":"","sources":["../../src/filter/conditionFilterRegistry.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAEnD,qBAAa,uBAAuB;IAElC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAsF;IAE9G,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,wBAAwB;IAIvD,UAAU,CAAC,IAAI,EAAE,MAAM;IAIvB,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,wBAAwB,GAAG,SAAS;CAIxD;AAED,eAAO,MAAM,uBAAuB,yBAAgC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/filter/index.ts"],"names":[],"mappings":"AAaA,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { AttributesCapable, NamedCapable } from '@ahoo-wang/fetcher';
|
|
2
|
+
import { Condition, Operator } from '@ahoo-wang/fetcher-wow';
|
|
3
|
+
import { Ref } from 'react';
|
|
4
|
+
/**
|
|
5
|
+
* @see {@link Schema}
|
|
6
|
+
*/
|
|
7
|
+
export interface ConditionField extends NamedCapable {
|
|
8
|
+
label: string;
|
|
9
|
+
type: string;
|
|
10
|
+
format?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface ConditionFilterCallbacks {
|
|
13
|
+
getCondition(): Condition;
|
|
14
|
+
}
|
|
15
|
+
export interface ConditionFilterProps extends AttributesCapable {
|
|
16
|
+
field: ConditionField;
|
|
17
|
+
placeholder?: string;
|
|
18
|
+
operator: Operator;
|
|
19
|
+
ref: Ref<ConditionFilterCallbacks>;
|
|
20
|
+
}
|
|
21
|
+
export type ConditionFilterComponent = React.FC<ConditionFilterProps>;
|
|
22
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/filter/types.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5B;;GAEG;AACH,MAAM,WAAW,cAAe,SAAQ,YAAY;IAClD,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,wBAAwB;IACvC,YAAY,IAAI,SAAS,CAAC;CAC3B;AAED,MAAM,WAAW,oBAAqB,SAAQ,iBAAiB;IAC7D,KAAK,EAAE,cAAc,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,QAAQ,CAAC;IACnB,GAAG,EAAE,GAAG,CAAC,wBAAwB,CAAC,CAAC;CACpC;AAED,MAAM,MAAM,wBAAwB,GAAG,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAAC,CAAC"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,cAAc,UAAU,CAAC"}
|
package/dist/index.es.js
CHANGED
|
@@ -1,2 +1,27 @@
|
|
|
1
|
-
|
|
1
|
+
class r {
|
|
2
|
+
constructor() {
|
|
3
|
+
this.filters = /* @__PURE__ */ new Map();
|
|
4
|
+
}
|
|
5
|
+
register(t, i) {
|
|
6
|
+
this.filters.set(t, i);
|
|
7
|
+
}
|
|
8
|
+
unregister(t) {
|
|
9
|
+
return this.filters.delete(t);
|
|
10
|
+
}
|
|
11
|
+
get(t) {
|
|
12
|
+
return this.filters.get(t);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
const n = new r();
|
|
16
|
+
function o(e) {
|
|
17
|
+
const t = n.get(e.type);
|
|
18
|
+
if (!t)
|
|
19
|
+
throw new Error(`ConditionFilter type ${e.type} not found.`);
|
|
20
|
+
return t(e);
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
o as ConditionFilter,
|
|
24
|
+
r as ConditionFilterRegistry,
|
|
25
|
+
n as conditionFilterRegistry
|
|
26
|
+
};
|
|
2
27
|
//# sourceMappingURL=index.es.js.map
|
package/dist/index.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../src/filter/conditionFilterRegistry.ts","../src/filter/conditionFilter.tsx"],"sourcesContent":["/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\nimport { ConditionFilterComponent } from './types';\n\nexport class ConditionFilterRegistry {\n\n private readonly filters: Map<string, ConditionFilterComponent> = new Map<string, ConditionFilterComponent>();\n\n register(type: string, filter: ConditionFilterComponent) {\n this.filters.set(type, filter);\n }\n\n unregister(type: string) {\n return this.filters.delete(type);\n }\n\n get(type: string): ConditionFilterComponent | undefined {\n return this.filters.get(type);\n }\n\n}\n\nexport const conditionFilterRegistry = new ConditionFilterRegistry();","/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ConditionFilterProps } from './types';\nimport { conditionFilterRegistry } from './conditionFilterRegistry';\n\nexport interface TypedConditionFilterProps extends ConditionFilterProps {\n type: string;\n}\n\nexport function ConditionFilter(props: TypedConditionFilterProps) {\n const filter = conditionFilterRegistry.get(props.type);\n if (!filter) {\n throw new Error(`ConditionFilter type ${props.type} not found.`);\n }\n return filter(props);\n}"],"names":["ConditionFilterRegistry","type","filter","conditionFilterRegistry","ConditionFilter","props"],"mappings":"AAgBO,MAAMA,EAAwB;AAAA,EAA9B,cAAA;AAEL,SAAiB,8BAAqD,IAAA;AAAA,EAAsC;AAAA,EAE5G,SAASC,GAAcC,GAAkC;AACvD,SAAK,QAAQ,IAAID,GAAMC,CAAM;AAAA,EAC/B;AAAA,EAEA,WAAWD,GAAc;AACvB,WAAO,KAAK,QAAQ,OAAOA,CAAI;AAAA,EACjC;AAAA,EAEA,IAAIA,GAAoD;AACtD,WAAO,KAAK,QAAQ,IAAIA,CAAI;AAAA,EAC9B;AAEF;AAEO,MAAME,IAA0B,IAAIH,EAAA;ACdpC,SAASI,EAAgBC,GAAkC;AAChE,QAAMH,IAASC,EAAwB,IAAIE,EAAM,IAAI;AACrD,MAAI,CAACH;AACH,UAAM,IAAI,MAAM,wBAAwBG,EAAM,IAAI,aAAa;AAEjE,SAAOH,EAAOG,CAAK;AACrB;"}
|
package/dist/index.umd.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(e,i){typeof exports=="object"&&typeof module<"u"?i(exports):typeof define=="function"&&define.amd?define(["exports"],i):(e=typeof globalThis<"u"?globalThis:e||self,i(e.FetcherReact={}))})(this,(function(e){"use strict";class i{constructor(){this.filters=new Map}register(t,s){this.filters.set(t,s)}unregister(t){return this.filters.delete(t)}get(t){return this.filters.get(t)}}const r=new i;function o(n){const t=r.get(n.type);if(!t)throw new Error(`ConditionFilter type ${n.type} not found.`);return t(n)}e.ConditionFilter=o,e.ConditionFilterRegistry=i,e.conditionFilterRegistry=r,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}));
|
|
2
2
|
//# sourceMappingURL=index.umd.js.map
|
package/dist/index.umd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.umd.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.umd.js","sources":["../src/filter/conditionFilterRegistry.ts","../src/filter/conditionFilter.tsx"],"sourcesContent":["/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\nimport { ConditionFilterComponent } from './types';\n\nexport class ConditionFilterRegistry {\n\n private readonly filters: Map<string, ConditionFilterComponent> = new Map<string, ConditionFilterComponent>();\n\n register(type: string, filter: ConditionFilterComponent) {\n this.filters.set(type, filter);\n }\n\n unregister(type: string) {\n return this.filters.delete(type);\n }\n\n get(type: string): ConditionFilterComponent | undefined {\n return this.filters.get(type);\n }\n\n}\n\nexport const conditionFilterRegistry = new ConditionFilterRegistry();","/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ConditionFilterProps } from './types';\nimport { conditionFilterRegistry } from './conditionFilterRegistry';\n\nexport interface TypedConditionFilterProps extends ConditionFilterProps {\n type: string;\n}\n\nexport function ConditionFilter(props: TypedConditionFilterProps) {\n const filter = conditionFilterRegistry.get(props.type);\n if (!filter) {\n throw new Error(`ConditionFilter type ${props.type} not found.`);\n }\n return filter(props);\n}"],"names":["ConditionFilterRegistry","type","filter","conditionFilterRegistry","ConditionFilter","props"],"mappings":"qOAgBO,MAAMA,CAAwB,CAA9B,aAAA,CAEL,KAAiB,YAAqD,GAAsC,CAE5G,SAASC,EAAcC,EAAkC,CACvD,KAAK,QAAQ,IAAID,EAAMC,CAAM,CAC/B,CAEA,WAAWD,EAAc,CACvB,OAAO,KAAK,QAAQ,OAAOA,CAAI,CACjC,CAEA,IAAIA,EAAoD,CACtD,OAAO,KAAK,QAAQ,IAAIA,CAAI,CAC9B,CAEF,CAEO,MAAME,EAA0B,IAAIH,ECdpC,SAASI,EAAgBC,EAAkC,CAChE,MAAMH,EAASC,EAAwB,IAAIE,EAAM,IAAI,EACrD,GAAI,CAACH,EACH,MAAM,IAAI,MAAM,wBAAwBG,EAAM,IAAI,aAAa,EAEjE,OAAOH,EAAOG,CAAK,CACrB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ahoo-wang/fetcher-viewer",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"fetch",
|
|
@@ -37,14 +37,17 @@
|
|
|
37
37
|
"dist"
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@ahoo-wang/fetcher": "^2.3.4",
|
|
41
|
-
"@ahoo-wang/fetcher-storage": "^2.3.4",
|
|
42
|
-
"@ahoo-wang/fetcher-wow": "^2.3.4",
|
|
43
40
|
"react-use": "^17.6.0"
|
|
44
41
|
},
|
|
45
42
|
"peerDependencies": {
|
|
46
|
-
"react": ">=
|
|
47
|
-
"react-dom": ">=
|
|
43
|
+
"react": ">=18.0.0",
|
|
44
|
+
"react-dom": ">=18.0.0",
|
|
45
|
+
"antd": "5.27.4",
|
|
46
|
+
"@ahoo-wang/fetcher": "^2.3.4",
|
|
47
|
+
"@ahoo-wang/fetcher-storage": "^2.3.4",
|
|
48
|
+
"@ahoo-wang/fetcher-wow": "^2.3.4",
|
|
49
|
+
"@ahoo-wang/fetcher-react": "^2.8.0",
|
|
50
|
+
"@ahoo-wang/fetcher-openapi": "^2.3.4"
|
|
48
51
|
},
|
|
49
52
|
"devDependencies": {
|
|
50
53
|
"@eslint/js": "^9.37.0",
|
|
@@ -61,11 +64,12 @@
|
|
|
61
64
|
"vite-bundle-analyzer": "^1.2.3",
|
|
62
65
|
"vitest": "^3.2.4",
|
|
63
66
|
"@testing-library/react": "^16.0.0",
|
|
64
|
-
"@types/react": "^18.
|
|
65
|
-
"@types/react-dom": "^18.
|
|
67
|
+
"@types/react": "^18.3.26",
|
|
68
|
+
"@types/react-dom": "^18.3.7",
|
|
66
69
|
"jsdom": "^27.0.0",
|
|
67
|
-
"react": "^18.
|
|
68
|
-
"react-dom": "^18.
|
|
70
|
+
"react": "^18.3.1",
|
|
71
|
+
"react-dom": "^18.3.1",
|
|
72
|
+
"@vitejs/plugin-react": "^5.0.4"
|
|
69
73
|
},
|
|
70
74
|
"scripts": {
|
|
71
75
|
"build": "vite build",
|