namirasoft-site-react 1.4.516 → 1.4.518

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.
@@ -2,7 +2,7 @@ import { ReactNode } from 'react';
2
2
  import { IBaseComponentProps } from '../props/IBaseComponentProps';
3
3
  export interface NSDialogProps extends IBaseComponentProps {
4
4
  onClose: () => void;
5
- children: ReactNode;
5
+ children?: ReactNode;
6
6
  center_dialog?: boolean;
7
7
  closeButton?: {
8
8
  show?: boolean;
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Component, createRef } from 'react';
3
3
  import { NSDialogBox } from "./NSDialogBox";
4
4
  import { NSBoxDate } from "./NSBoxDate";
@@ -8,7 +8,7 @@ export class NSDialogBoxDate extends Component {
8
8
  this.NSBoxDate_Ref = createRef();
9
9
  }
10
10
  render() {
11
- return (_jsx(NSDialogBox, Object.assign({}, this.props, { children_ref: this.NSBoxDate_Ref, children: _jsx(NSBoxDate, Object.assign({ ref: this.NSBoxDate_Ref }, this.props.box)) })));
11
+ return (_jsxs(NSDialogBox, Object.assign({}, this.props, { children_ref: this.NSBoxDate_Ref, children: [_jsx(NSBoxDate, Object.assign({}, this.props.box, { ref: this.NSBoxDate_Ref })), this.props.children] })));
12
12
  }
13
13
  }
14
14
  //# sourceMappingURL=NSDialogBoxDate.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NSDialogBoxDate.js","sourceRoot":"","sources":["../../src/components/NSDialogBoxDate.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAyB,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,SAAS,EAAkB,MAAM,aAAa,CAAC;AAOxD,MAAM,OAAO,eAAgB,SAAQ,SAA+B;IAApE;;QAEY,kBAAa,GAAG,SAAS,EAAa,CAAC;IAgBnD,CAAC;IAdY,MAAM;QAEX,OAAO,CACH,KAAC,WAAW,oBACJ,IAAI,CAAC,KAAK,IACd,YAAY,EAAE,IAAI,CAAC,aAAa,YAEhC,KAAC,SAAS,kBACN,GAAG,EAAE,IAAI,CAAC,aAAa,IACnB,IAAI,CAAC,KAAK,CAAC,GAAG,EACpB,IACQ,CACjB,CAAC;IACN,CAAC;CACJ"}
1
+ {"version":3,"file":"NSDialogBoxDate.js","sourceRoot":"","sources":["../../src/components/NSDialogBoxDate.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAyB,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,SAAS,EAAkB,MAAM,aAAa,CAAC;AAOxD,MAAM,OAAO,eAAgB,SAAQ,SAA+B;IAApE;;QAEY,kBAAa,GAAG,SAAS,EAAa,CAAC;IAiBnD,CAAC;IAfY,MAAM;QAEX,OAAO,CACH,MAAC,WAAW,oBACJ,IAAI,CAAC,KAAK,IACd,YAAY,EAAE,IAAI,CAAC,aAAa,aAEhC,KAAC,SAAS,oBACF,IAAI,CAAC,KAAK,CAAC,GAAG,IAClB,GAAG,EAAE,IAAI,CAAC,aAAa,IACzB,EACD,IAAI,CAAC,KAAK,CAAC,QAAQ,KACV,CACjB,CAAC;IACN,CAAC;CACJ"}
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Component, createRef } from 'react';
3
3
  import { NSBoxDateTime } from "./NSBoxDateTime";
4
4
  import { NSDialogBox } from "./NSDialogBox";
@@ -8,7 +8,7 @@ export class NSDialogBoxDateTime extends Component {
8
8
  this.NSBoxDateTime_Ref = createRef();
9
9
  }
10
10
  render() {
11
- return (_jsx(NSDialogBox, Object.assign({}, this.props, { children_ref: this.NSBoxDateTime_Ref, children: _jsx(NSBoxDateTime, Object.assign({ ref: this.NSBoxDateTime_Ref }, this.props.box)) })));
11
+ return (_jsxs(NSDialogBox, Object.assign({}, this.props, { children_ref: this.NSBoxDateTime_Ref, children: [_jsx(NSBoxDateTime, Object.assign({}, this.props.box, { ref: this.NSBoxDateTime_Ref })), this.props.children] })));
12
12
  }
13
13
  }
14
14
  //# sourceMappingURL=NSDialogBoxDateTime.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NSDialogBoxDateTime.js","sourceRoot":"","sources":["../../src/components/NSDialogBoxDateTime.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAsB,MAAM,iBAAiB,CAAC;AACpE,OAAO,EAAyB,WAAW,EAAE,MAAM,eAAe,CAAC;AAOnE,MAAM,OAAO,mBAAoB,SAAQ,SAAmC;IAA5E;;QAEY,sBAAiB,GAAG,SAAS,EAAiB,CAAC;IAgB3D,CAAC;IAdY,MAAM;QAEX,OAAO,CACH,KAAC,WAAW,oBACJ,IAAI,CAAC,KAAK,IACd,YAAY,EAAE,IAAI,CAAC,iBAAiB,YAEpC,KAAC,aAAa,kBACV,GAAG,EAAE,IAAI,CAAC,iBAAiB,IACvB,IAAI,CAAC,KAAK,CAAC,GAAG,EACpB,IACQ,CACjB,CAAC;IACN,CAAC;CACJ"}
1
+ {"version":3,"file":"NSDialogBoxDateTime.js","sourceRoot":"","sources":["../../src/components/NSDialogBoxDateTime.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAsB,MAAM,iBAAiB,CAAC;AACpE,OAAO,EAAyB,WAAW,EAAE,MAAM,eAAe,CAAC;AAOnE,MAAM,OAAO,mBAAoB,SAAQ,SAAmC;IAA5E;;QAEY,sBAAiB,GAAG,SAAS,EAAiB,CAAC;IAiB3D,CAAC;IAfY,MAAM;QAEX,OAAO,CACH,MAAC,WAAW,oBACJ,IAAI,CAAC,KAAK,IACd,YAAY,EAAE,IAAI,CAAC,iBAAiB,aAEpC,KAAC,aAAa,oBACN,IAAI,CAAC,KAAK,CAAC,GAAG,IAClB,GAAG,EAAE,IAAI,CAAC,iBAAiB,IAC7B,EACD,IAAI,CAAC,KAAK,CAAC,QAAQ,KACV,CACjB,CAAC;IACN,CAAC;CACJ"}
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Component, createRef } from 'react';
3
3
  import { NSDialogBox } from "./NSDialogBox";
4
4
  import { NSBoxPhone } from "./NSBoxPhone";
@@ -8,7 +8,7 @@ export class NSDialogBoxPhone extends Component {
8
8
  this.NSBoxPhone_Ref = createRef();
9
9
  }
10
10
  render() {
11
- return (_jsx(NSDialogBox, Object.assign({}, this.props, { children_ref: this.NSBoxPhone_Ref, children: _jsx(NSBoxPhone, Object.assign({ ref: this.NSBoxPhone_Ref }, this.props.box)) })));
11
+ return (_jsxs(NSDialogBox, Object.assign({}, this.props, { children_ref: this.NSBoxPhone_Ref, children: [_jsx(NSBoxPhone, Object.assign({}, this.props.box, { ref: this.NSBoxPhone_Ref })), this.props.children] })));
12
12
  }
13
13
  }
14
14
  //# sourceMappingURL=NSDialogBoxPhone.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NSDialogBoxPhone.js","sourceRoot":"","sources":["../../src/components/NSDialogBoxPhone.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAyB,WAAW,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,UAAU,EAAmB,MAAM,cAAc,CAAC;AAO3D,MAAM,OAAO,gBAAiB,SAAQ,SAAgC;IAAtE;;QAEY,mBAAc,GAAG,SAAS,EAAc,CAAC;IAgBrD,CAAC;IAdY,MAAM;QAEX,OAAO,CACH,KAAC,WAAW,oBACJ,IAAI,CAAC,KAAK,IACd,YAAY,EAAE,IAAI,CAAC,cAAc,YAEjC,KAAC,UAAU,kBACP,GAAG,EAAE,IAAI,CAAC,cAAc,IACpB,IAAI,CAAC,KAAK,CAAC,GAAG,EACpB,IACQ,CACjB,CAAC;IACN,CAAC;CACJ"}
1
+ {"version":3,"file":"NSDialogBoxPhone.js","sourceRoot":"","sources":["../../src/components/NSDialogBoxPhone.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAyB,WAAW,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,UAAU,EAAmB,MAAM,cAAc,CAAC;AAO3D,MAAM,OAAO,gBAAiB,SAAQ,SAAgC;IAAtE;;QAEY,mBAAc,GAAG,SAAS,EAAc,CAAC;IAiBrD,CAAC;IAfY,MAAM;QAEX,OAAO,CACH,MAAC,WAAW,oBACJ,IAAI,CAAC,KAAK,IACd,YAAY,EAAE,IAAI,CAAC,cAAc,aAEjC,KAAC,UAAU,oBACH,IAAI,CAAC,KAAK,CAAC,GAAG,IAClB,GAAG,EAAE,IAAI,CAAC,cAAc,IAC1B,EACD,IAAI,CAAC,KAAK,CAAC,QAAQ,KACV,CACjB,CAAC;IACN,CAAC;CACJ"}
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Component, createRef } from 'react';
3
3
  import { NSDialogBox } from "./NSDialogBox";
4
4
  import { NSBoxString } from './NSBoxString';
@@ -8,7 +8,7 @@ export class NSDialogBoxString extends Component {
8
8
  this.NSBoxString_Ref = createRef();
9
9
  }
10
10
  render() {
11
- return (_jsx(NSDialogBox, Object.assign({}, this.props, { children_ref: this.NSBoxString_Ref, children: _jsx(NSBoxString, Object.assign({}, this.props.box, { ref: this.NSBoxString_Ref })) })));
11
+ return (_jsxs(NSDialogBox, Object.assign({}, this.props, { children_ref: this.NSBoxString_Ref, children: [_jsx(NSBoxString, Object.assign({}, this.props.box, { ref: this.NSBoxString_Ref })), this.props.children] })));
12
12
  }
13
13
  }
14
14
  //# sourceMappingURL=NSDialogBoxString.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NSDialogBoxString.js","sourceRoot":"","sources":["../../src/components/NSDialogBoxString.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAyB,WAAW,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,WAAW,EAAoB,MAAM,eAAe,CAAC;AAO9D,MAAM,OAAO,iBAAkB,SAAQ,SAAiC;IAAxE;;QAEY,oBAAe,GAAG,SAAS,EAAe,CAAC;IAgBvD,CAAC;IAdY,MAAM;QAEX,OAAO,CACH,KAAC,WAAW,oBACJ,IAAI,CAAC,KAAK,IACd,YAAY,EAAE,IAAI,CAAC,eAAe,YAElC,KAAC,WAAW,oBACJ,IAAI,CAAC,KAAK,CAAC,GAAG,IAClB,GAAG,EAAE,IAAI,CAAC,eAAe,IAC3B,IACQ,CACjB,CAAC;IACN,CAAC;CACJ"}
1
+ {"version":3,"file":"NSDialogBoxString.js","sourceRoot":"","sources":["../../src/components/NSDialogBoxString.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAyB,WAAW,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,WAAW,EAAoB,MAAM,eAAe,CAAC;AAO9D,MAAM,OAAO,iBAAkB,SAAQ,SAAiC;IAAxE;;QAEY,oBAAe,GAAG,SAAS,EAAe,CAAC;IAiBvD,CAAC;IAfY,MAAM;QAEX,OAAO,CACH,MAAC,WAAW,oBACJ,IAAI,CAAC,KAAK,IACd,YAAY,EAAE,IAAI,CAAC,eAAe,aAElC,KAAC,WAAW,oBACJ,IAAI,CAAC,KAAK,CAAC,GAAG,IAClB,GAAG,EAAE,IAAI,CAAC,eAAe,IAC3B,EACD,IAAI,CAAC,KAAK,CAAC,QAAQ,KACV,CACjB,CAAC;IACN,CAAC;CACJ"}
@@ -2,5 +2,6 @@ import { BaseColumnFormatter } from "./BaseColumnFormatter";
2
2
  import { TableColumnInfo, TableRowInfo } from "../main";
3
3
  export declare class JsonFormatter extends BaseColumnFormatter {
4
4
  constructor(width?: string);
5
+ private isJsonSerializable;
5
6
  format(value: any, _: TableColumnInfo, __: TableRowInfo<any>, printable: boolean): any;
6
7
  }
@@ -7,14 +7,34 @@ export class JsonFormatter extends BaseColumnFormatter {
7
7
  if (width)
8
8
  this.width = width;
9
9
  }
10
- format(value, _, __, printable) {
10
+ isJsonSerializable(v) {
11
11
  try {
12
- let parsed = JSON.parse(String(value).trim());
13
- if (!printable)
14
- return _jsx(JsonView, { value: parsed });
12
+ JSON.stringify(v);
13
+ return true;
14
+ }
15
+ catch (_a) {
16
+ return false;
17
+ }
18
+ }
19
+ format(value, _, __, printable) {
20
+ let parsed = value;
21
+ if (typeof value === "string")
22
+ try {
23
+ parsed = JSON.parse(value.trim());
24
+ }
25
+ catch (_a) {
26
+ return value;
27
+ }
28
+ if (printable)
29
+ return parsed;
30
+ if (parsed === null || typeof parsed !== "object")
15
31
  return parsed;
32
+ if (!this.isJsonSerializable(parsed))
33
+ return value;
34
+ try {
35
+ return _jsx(JsonView, { value: parsed });
16
36
  }
17
- catch (error) {
37
+ catch (_b) {
18
38
  return value;
19
39
  }
20
40
  }
@@ -1 +1 @@
1
- {"version":3,"file":"JsonFormatter.js","sourceRoot":"","sources":["../../src/formatter/JsonFormatter.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,QAAQ,MAAM,sBAAsB,CAAC;AAE5C,MAAM,OAAO,aA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,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;YACtC,CAAC;YACD,WACA,CAAC;gBACG,OAAO,KAAK,CAAC;YACjB,CAAC;QAEL,IAAI,SAAS;YACT,OAAO,MAAM,CAAC;QAElB,IAAI,MAAM,KAAK,IAAI,IAAI,OAAO,MAAM,KAAK,QAAQ;YAC7C,OAAO,MAAM,CAAC;QAElB,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC;YAChC,OAAO,KAAK,CAAC;QAEjB,IACA,CAAC;YACG,OAAO,KAAC,QAAQ,IAAC,KAAK,EAAE,MAAM,GAAI,CAAC;QACvC,CAAC;QACD,WACA,CAAC;YACG,OAAO,KAAK,CAAC;QACjB,CAAC;IACL,CAAC;CACJ"}
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "framework": "npm",
9
9
  "application": "package",
10
10
  "private": false,
11
- "version": "1.4.516",
11
+ "version": "1.4.518",
12
12
  "author": "Amir Abolhasani",
13
13
  "license": "MIT",
14
14
  "main": "./dist/main.js",
@@ -5,7 +5,7 @@ import Styles from './NSDialog.module.css';
5
5
  export interface NSDialogProps extends IBaseComponentProps
6
6
  {
7
7
  onClose: () => void;
8
- children: ReactNode;
8
+ children?: ReactNode;
9
9
  center_dialog?: boolean;
10
10
  closeButton?: {
11
11
  show?: boolean;
@@ -19,9 +19,10 @@ export class NSDialogBoxDate extends Component<NSDialogBoxDateProps>
19
19
  children_ref={this.NSBoxDate_Ref}
20
20
  >
21
21
  <NSBoxDate
22
- ref={this.NSBoxDate_Ref}
23
22
  {...this.props.box}
23
+ ref={this.NSBoxDate_Ref}
24
24
  />
25
+ {this.props.children}
25
26
  </NSDialogBox>
26
27
  );
27
28
  }
@@ -19,9 +19,10 @@ export class NSDialogBoxDateTime extends Component<NSDialogBoxDateTimeProps>
19
19
  children_ref={this.NSBoxDateTime_Ref}
20
20
  >
21
21
  <NSBoxDateTime
22
- ref={this.NSBoxDateTime_Ref}
23
22
  {...this.props.box}
23
+ ref={this.NSBoxDateTime_Ref}
24
24
  />
25
+ {this.props.children}
25
26
  </NSDialogBox>
26
27
  );
27
28
  }
@@ -19,9 +19,10 @@ export class NSDialogBoxPhone extends Component<NSDialogBoxPhoneProps>
19
19
  children_ref={this.NSBoxPhone_Ref}
20
20
  >
21
21
  <NSBoxPhone
22
- ref={this.NSBoxPhone_Ref}
23
22
  {...this.props.box}
23
+ ref={this.NSBoxPhone_Ref}
24
24
  />
25
+ {this.props.children}
25
26
  </NSDialogBox>
26
27
  );
27
28
  }
@@ -22,6 +22,7 @@ export class NSDialogBoxString extends Component<NSDialogBoxStringProps>
22
22
  {...this.props.box}
23
23
  ref={this.NSBoxString_Ref}
24
24
  />
25
+ {this.props.children}
25
26
  </NSDialogBox>
26
27
  );
27
28
  }
@@ -11,18 +11,47 @@ export class JsonFormatter extends BaseColumnFormatter
11
11
  this.width = width;
12
12
  }
13
13
 
14
- override format(value: any, _: TableColumnInfo, __: TableRowInfo<any>, printable: boolean): any
14
+ private isJsonSerializable(v: unknown): boolean
15
15
  {
16
16
  try
17
17
  {
18
- let parsed = JSON.parse(String(value).trim());
18
+ JSON.stringify(v);
19
+ return true;
20
+ }
21
+ catch
22
+ {
23
+ return false;
24
+ }
25
+ }
26
+
27
+ override format(value: any, _: TableColumnInfo, __: TableRowInfo<any>, printable: boolean): any
28
+ {
29
+ let parsed = value;
19
30
 
20
- if (!printable)
21
- return <JsonView value={parsed} />;
31
+ if (typeof value === "string")
32
+ try
33
+ {
34
+ parsed = JSON.parse(value.trim());
35
+ }
36
+ catch
37
+ {
38
+ return value;
39
+ }
22
40
 
41
+ if (printable)
23
42
  return parsed;
43
+
44
+ if (parsed === null || typeof parsed !== "object")
45
+ return parsed;
46
+
47
+ if (!this.isJsonSerializable(parsed))
48
+ return value;
49
+
50
+ try
51
+ {
52
+ return <JsonView value={parsed} />;
24
53
  }
25
- catch (error)
54
+ catch
26
55
  {
27
56
  return value;
28
57
  }