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.
- package/dist/components/NSDialog.d.ts +1 -1
- package/dist/components/NSDialogBoxDate.js +2 -2
- package/dist/components/NSDialogBoxDate.js.map +1 -1
- package/dist/components/NSDialogBoxDateTime.js +2 -2
- package/dist/components/NSDialogBoxDateTime.js.map +1 -1
- package/dist/components/NSDialogBoxPhone.js +2 -2
- package/dist/components/NSDialogBoxPhone.js.map +1 -1
- package/dist/components/NSDialogBoxString.js +2 -2
- package/dist/components/NSDialogBoxString.js.map +1 -1
- package/dist/formatter/JsonFormatter.d.ts +1 -0
- package/dist/formatter/JsonFormatter.js +25 -5
- package/dist/formatter/JsonFormatter.js.map +1 -1
- package/package.json +1 -1
- package/src/components/NSDialog.tsx +1 -1
- package/src/components/NSDialogBoxDate.tsx +2 -1
- package/src/components/NSDialogBoxDateTime.tsx +2 -1
- package/src/components/NSDialogBoxPhone.tsx +2 -1
- package/src/components/NSDialogBoxString.tsx +1 -0
- package/src/formatter/JsonFormatter.tsx +34 -5
|
@@ -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
|
|
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 (
|
|
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;
|
|
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 (
|
|
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;
|
|
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 (
|
|
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;
|
|
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 (
|
|
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;
|
|
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
|
-
|
|
10
|
+
isJsonSerializable(v) {
|
|
11
11
|
try {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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 (
|
|
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,aAAc,SAAQ,mBAAmB;IAElD,YAAY,QAAgB,OAAO;QAE/B,KAAK,EA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AQ,IAAC,KAAK,EAAE,MAAM,GAAI,CAAC;QACvC,CAAC;QACD,WACA,CAAC;YACG,OAAO,KAAK,CAAC;QACjB,CAAC;IACL,CAAC;CACJ"}
|
package/package.json
CHANGED
|
@@ -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
|
}
|
|
@@ -11,18 +11,47 @@ export class JsonFormatter extends BaseColumnFormatter
|
|
|
11
11
|
this.width = width;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
private isJsonSerializable(v: unknown): boolean
|
|
15
15
|
{
|
|
16
16
|
try
|
|
17
17
|
{
|
|
18
|
-
|
|
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
|
-
|
|
21
|
-
|
|
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
|
|
54
|
+
catch
|
|
26
55
|
{
|
|
27
56
|
return value;
|
|
28
57
|
}
|