namirasoft-site-react 1.3.377 → 1.3.378
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.
|
@@ -1,35 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import { INSARouterProps, NSASectionEditProps, NSASectionListProps, NSASectionViewProps, IEntityInfo } from "namirasoft-account-react";
|
|
3
|
-
export interface NSProductListProps<EntityType extends {
|
|
4
|
-
id: string;
|
|
5
|
-
}, EntityTypeInput = EntityType> extends INSARouterProps {
|
|
6
|
-
action?: INSBarActionProps;
|
|
7
|
-
banner?: INSBarHeroBannerProps;
|
|
8
|
-
title?: INSBarTitleProps;
|
|
9
|
-
pages?: {
|
|
10
|
-
entity: IEntityInfo<EntityType, EntityTypeInput>;
|
|
11
|
-
ui?: {
|
|
12
|
-
action?: {
|
|
13
|
-
menus: {
|
|
14
|
-
view?: boolean;
|
|
15
|
-
viewHistory?: boolean;
|
|
16
|
-
copy?: boolean;
|
|
17
|
-
edit?: boolean;
|
|
18
|
-
delete?: boolean;
|
|
19
|
-
apply?: boolean;
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
list?: NSASectionListProps<EntityType>;
|
|
24
|
-
edit?: NSASectionEditProps<EntityType, EntityTypeInput>;
|
|
25
|
-
view?: NSASectionViewProps<EntityType>;
|
|
26
|
-
};
|
|
27
|
-
edit?: () => void;
|
|
28
|
-
delete?: () => void;
|
|
29
|
-
redirectToView?: () => void;
|
|
1
|
+
export interface NSProductListProps {
|
|
30
2
|
scope: string;
|
|
31
|
-
|
|
3
|
+
name: string;
|
|
32
4
|
}
|
|
33
|
-
export declare function NSProductList
|
|
34
|
-
id: string;
|
|
35
|
-
} = any, EntityTypeInput = EntityType>(props: NSProductListProps<EntityType, EntityTypeInput>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare function NSProductList(props: NSProductListProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { NSCard } from "../main";
|
|
3
3
|
import { useState, useEffect } from "react";
|
|
4
4
|
import { NamirasoftAPIProductServer } from "namirasoft-api-product";
|
|
5
|
-
import { NSALayout } from "namirasoft-account-react";
|
|
6
5
|
export function NSProductList(props) {
|
|
7
6
|
const [state, setState] = useState({ products: [] });
|
|
8
7
|
useEffect(() => {
|
|
9
8
|
let server = new NamirasoftAPIProductServer(console.error);
|
|
10
|
-
server.filter.ListProducts(
|
|
9
|
+
server.filter.ListProducts(props.scope, props.name, null, null, null).then((products) => {
|
|
11
10
|
setState({ products: products.rows });
|
|
12
11
|
}).catch(() => { });
|
|
13
12
|
}, []);
|
|
14
|
-
return (_jsx(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
return (_jsx("div", { className: "d-flex gap-3 flex-wrap justify-content-between container", children: state.products.map((product) => {
|
|
14
|
+
var _a, _b;
|
|
15
|
+
return (_jsx(NSCard, { link: { href: (_a = product.link) !== null && _a !== void 0 ? _a : "" }, title: product.name, image: { src: (_b = product.logo) !== null && _b !== void 0 ? _b : '', alt: product.name } }, product.id));
|
|
16
|
+
}) }));
|
|
18
17
|
}
|
|
19
18
|
//# sourceMappingURL=NSProductList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NSProductList.js","sourceRoot":"","sources":["../../src/components/NSProductList.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,0BAA0B,EAAkB,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"NSProductList.js","sourceRoot":"","sources":["../../src/components/NSProductList.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CA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@@
|
|
|
8
8
|
"framework": "npm",
|
|
9
9
|
"application": "package",
|
|
10
10
|
"private": false,
|
|
11
|
-
"version": "1.3.
|
|
11
|
+
"version": "1.3.378",
|
|
12
12
|
"author": "Amir Abolhasani, Alireza Esmaeeli, Sepideh Mazloumi, Hooman Shashaeh",
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"main": "./dist/main.js",
|
|
@@ -29,7 +29,6 @@
|
|
|
29
29
|
"bootstrap": "^5.3.3",
|
|
30
30
|
"copyfiles": "^2.4.1",
|
|
31
31
|
"link-react": "^3.0.0",
|
|
32
|
-
"namirasoft-account-react": "^1.3.245",
|
|
33
32
|
"namirasoft-api-link": "^1.3.17",
|
|
34
33
|
"namirasoft-api-product": "^1.3.14",
|
|
35
34
|
"namirasoft-core": "^1.3.80",
|
|
@@ -1,51 +1,26 @@
|
|
|
1
1
|
import { NSCard } from "../main";
|
|
2
2
|
import { useState, useEffect } from "react";
|
|
3
3
|
import { NamirasoftAPIProductServer, ProductFullRow } from "namirasoft-api-product";
|
|
4
|
-
import { INSBarActionProps, INSBarHeroBannerProps, INSBarTitleProps } from "namirasoft-site-react";
|
|
5
|
-
import { INSARouterProps, NSALayout, NSASectionEditProps, NSASectionListProps, NSASectionViewProps, IEntityInfo } from "namirasoft-account-react";
|
|
6
4
|
|
|
7
|
-
export interface NSProductListProps
|
|
5
|
+
export interface NSProductListProps
|
|
8
6
|
{
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
title?: INSBarTitleProps;
|
|
12
|
-
pages?: {
|
|
13
|
-
entity: IEntityInfo<EntityType, EntityTypeInput>;
|
|
14
|
-
ui?: {
|
|
15
|
-
action?: {
|
|
16
|
-
menus: {
|
|
17
|
-
view?: boolean;
|
|
18
|
-
viewHistory?: boolean;
|
|
19
|
-
copy?: boolean;
|
|
20
|
-
edit?: boolean;
|
|
21
|
-
delete?: boolean;
|
|
22
|
-
apply?: boolean;
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
list?: NSASectionListProps<EntityType>;
|
|
27
|
-
edit?: NSASectionEditProps<EntityType, EntityTypeInput>;
|
|
28
|
-
view?: NSASectionViewProps<EntityType>;
|
|
29
|
-
}
|
|
30
|
-
edit?: () => void;
|
|
31
|
-
delete?: () => void;
|
|
32
|
-
redirectToView?: () => void;
|
|
33
|
-
scope:string;
|
|
34
|
-
logo:string;
|
|
7
|
+
scope: string;
|
|
8
|
+
name: string;
|
|
35
9
|
}
|
|
36
10
|
|
|
37
11
|
interface NSProductListState
|
|
38
12
|
{
|
|
39
13
|
products: ProductFullRow[];
|
|
40
14
|
}
|
|
41
|
-
|
|
15
|
+
|
|
16
|
+
export function NSProductList(props: NSProductListProps)
|
|
42
17
|
{
|
|
43
18
|
const [state, setState] = useState<NSProductListState>({ products: [] });
|
|
44
19
|
|
|
45
20
|
useEffect(() =>
|
|
46
21
|
{
|
|
47
22
|
let server = new NamirasoftAPIProductServer(console.error);
|
|
48
|
-
server.filter.ListProducts(
|
|
23
|
+
server.filter.ListProducts(props.scope, props.name, null, null, null).then((products) =>
|
|
49
24
|
{
|
|
50
25
|
setState({ products: products.rows });
|
|
51
26
|
}).catch(() => { });
|
|
@@ -54,25 +29,13 @@ export function NSProductList<EntityType extends { id: string } = any, EntityTyp
|
|
|
54
29
|
}, []);
|
|
55
30
|
|
|
56
31
|
return (
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
notifier={props.notifier}
|
|
66
|
-
>
|
|
67
|
-
<div className="d-flex gap-3 flex-wrap justify-content-between container">
|
|
68
|
-
{state.products.map((product: ProductFullRow) =>
|
|
69
|
-
{
|
|
70
|
-
return (
|
|
71
|
-
<NSCard key={product.id} link={{ href: product.link ?? "" }} title={product.name} image={{ src: product.logo ?? '', alt: product.name }} />
|
|
72
|
-
);
|
|
73
|
-
})}
|
|
74
|
-
</div>
|
|
75
|
-
</NSALayout>
|
|
76
|
-
</>
|
|
32
|
+
<div className="d-flex gap-3 flex-wrap justify-content-between container">
|
|
33
|
+
{state.products.map((product: ProductFullRow) =>
|
|
34
|
+
{
|
|
35
|
+
return (
|
|
36
|
+
<NSCard key={product.id} link={{ href: product.link ?? "" }} title={product.name} image={{ src: product.logo ?? '', alt: product.name }} />
|
|
37
|
+
);
|
|
38
|
+
})}
|
|
39
|
+
</div>
|
|
77
40
|
);
|
|
78
41
|
}
|