@ahoo-wang/fetcher-viewer 2.8.1 → 2.8.2

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 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
- - filter
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
- - data
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,4 @@
1
+ export * from './conditionFilter';
2
+ export * from './conditionFilterRegistry';
3
+ export * from './types';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -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,21 @@
1
+ import { AttributesCapable, NamedCapable } from '@ahoo-wang/fetcher';
2
+ import { Schema } from '@ahoo-wang/fetcher-openapi';
3
+ import { Condition, Operator } from '@ahoo-wang/fetcher-wow';
4
+ import { Ref } from 'react';
5
+ export interface ConditionField extends NamedCapable, Schema {
6
+ label: string;
7
+ }
8
+ export interface FriendlyCondition {
9
+ condition: Condition;
10
+ friendly: string;
11
+ }
12
+ export interface ConditionFilterCallbacks {
13
+ getCondition(): FriendlyCondition;
14
+ }
15
+ export interface ConditionFilterProps extends AttributesCapable {
16
+ field: ConditionField;
17
+ operator: Operator;
18
+ ref: Ref<ConditionFilterCallbacks>;
19
+ }
20
+ export type ConditionFilterComponent = React.FC<ConditionFilterProps>;
21
+ //# 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,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5B,MAAM,WAAW,cAAe,SAAQ,YAAY,EAAE,MAAM;IAC1D,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,SAAS,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,wBAAwB;IACvC,YAAY,IAAI,iBAAiB,CAAC;CACnC;AAED,MAAM,WAAW,oBAAqB,SAAQ,iBAAiB;IAC7D,KAAK,EAAE,cAAc,CAAC;IACtB,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
@@ -1 +1,2 @@
1
+ export * from './filter';
1
2
  //# sourceMappingURL=index.d.ts.map
@@ -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
@@ -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(n){typeof define=="function"&&define.amd?define(n):n()})((function(){"use strict"}));
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
@@ -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.1",
3
+ "version": "2.8.2",
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": ">=16.8.0",
47
- "react-dom": ">=16.8.0"
43
+ "react": ">=18.0.0",
44
+ "react-dom": ">=18.0.0",
45
+ "antd": ">=5.0.0",
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",