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
- import { INSBarActionProps, INSBarHeroBannerProps, INSBarTitleProps } from "namirasoft-site-react";
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
- logo: string;
3
+ name: string;
32
4
  }
33
- export declare function NSProductList<EntityType extends {
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, Fragment as _Fragment } from "react/jsx-runtime";
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("Namirasoft Account", "Home", null, null, null).then((products) => {
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(_Fragment, { children: _jsx(NSALayout, { scope: props.scope, logo: props.logo, background: "url('https://static.namirasoft.com/image/namirasoft/account/background/base.svg')", notifications: props.notifier.getNotifications(), account: props.account, url: props.url, notifier: props.notifier, children: _jsx("div", { className: "d-flex gap-3 flex-wrap justify-content-between container", children: state.products.map((product) => {
15
- var _a, _b;
16
- 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));
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;AAEpF,OAAO,EAAmB,SAAS,EAA8E,MAAM,0BAA0B,CAAC;AAoClJ,MAAM,UAAU,aAAa,CAAwE,KAAsD;IAEvJ,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAqB,EAAE,QAAQ,EAA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IAA1H,OAAO,CAAC,EAAE,CAAoH,CAC9I,CAAC;QACN,CAAC,CAAC,GACA,CACT,CAAC;AACN,CAAC"}
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "framework": "npm",
9
9
  "application": "package",
10
10
  "private": false,
11
- "version": "1.3.377",
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<EntityType extends { id: string }, EntityTypeInput = EntityType> extends INSARouterProps
5
+ export interface NSProductListProps
8
6
  {
9
- action?: INSBarActionProps;
10
- banner?: INSBarHeroBannerProps;
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
- export function NSProductList<EntityType extends { id: string } = any, EntityTypeInput = EntityType>(props: NSProductListProps<EntityType, EntityTypeInput>)
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("Namirasoft Account", "Home", null, null, null).then((products) =>
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
- <NSALayout
59
- scope={props.scope}
60
- logo={props.logo}
61
- background="url('https://static.namirasoft.com/image/namirasoft/account/background/base.svg')"
62
- notifications={props.notifier.getNotifications()}
63
- account={props.account}
64
- url={props.url}
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
  }