namirasoft-site-react 1.4.169 → 1.4.171
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/formatter/BaseURLImageFormatter.d.ts +13 -0
- package/dist/formatter/BaseURLImageFormatter.js +15 -0
- package/dist/formatter/BaseURLImageFormatter.js.map +1 -0
- package/dist/formatter/EmailFormatter.d.ts +3 -1
- package/dist/formatter/EmailFormatter.js +9 -3
- package/dist/formatter/EmailFormatter.js.map +1 -1
- package/dist/formatter/IDFormatter.d.ts +2 -1
- package/dist/formatter/IDFormatter.js +8 -3
- package/dist/formatter/IDFormatter.js.map +1 -1
- package/dist/formatter/PhoneFormatter.d.ts +3 -1
- package/dist/formatter/PhoneFormatter.js +9 -3
- package/dist/formatter/PhoneFormatter.js.map +1 -1
- package/dist/formatter/URLFormatter.d.ts +7 -0
- package/dist/formatter/URLFormatter.js +18 -0
- package/dist/formatter/URLFormatter.js.map +1 -0
- package/dist/main.d.ts +2 -0
- package/dist/main.js +2 -0
- package/dist/main.js.map +1 -1
- package/package.json +1 -1
- package/src/formatter/BaseURLImageFormatter.tsx +29 -0
- package/src/formatter/EmailFormatter.tsx +10 -3
- package/src/formatter/IDFormatter.tsx +11 -8
- package/src/formatter/PhoneFormatter.tsx +10 -3
- package/src/formatter/URLFormatter.tsx +22 -0
- package/src/main.ts +2 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { TableColumnInfo, TableRowInfo } from "../main";
|
|
2
|
+
import { BaseColumnFormatter } from "./BaseColumnFormatter";
|
|
3
|
+
export declare class BaseURLImageFormatter extends BaseColumnFormatter {
|
|
4
|
+
constructor(width?: string);
|
|
5
|
+
format(value: {
|
|
6
|
+
text: any;
|
|
7
|
+
image: {
|
|
8
|
+
url: string;
|
|
9
|
+
alt: string;
|
|
10
|
+
};
|
|
11
|
+
href: string;
|
|
12
|
+
}, _: TableColumnInfo, __: TableRowInfo<any>, printable: boolean): any;
|
|
13
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { BaseColumnFormatter } from "./BaseColumnFormatter";
|
|
3
|
+
export class BaseURLImageFormatter extends BaseColumnFormatter {
|
|
4
|
+
constructor(width = "250px") {
|
|
5
|
+
super();
|
|
6
|
+
this.width = width;
|
|
7
|
+
}
|
|
8
|
+
format(value, _, __, printable) {
|
|
9
|
+
if (!printable) {
|
|
10
|
+
return (_jsxs("div", { style: { display: "flex", alignItems: "center" }, children: [_jsx("img", { src: value.image.url, alt: value.image.alt, style: { width: "20px", height: "20px" } }), "\u00A0", _jsx("a", { href: value.href, target: "_blank", rel: "noreferrer", children: value.text })] }));
|
|
11
|
+
}
|
|
12
|
+
return value.text;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=BaseURLImageFormatter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseURLImageFormatter.js","sourceRoot":"","sources":["../../src/formatter/BaseURLImageFormatter.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,OAAO,qBAAsB,SAAQ,mBAAmB;IAE1D,YAAY,QAAgB,OAAO;QAE/B,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACvB,CAAC;IACQ,MAAM,CAAC,KAIf,EAAE,CAAkB,EAAE,EAAqB,EAAE,SAAkB;QAE5D,IAAI,CAAC,SAAS,EACd,CAAC;YACG,OAAO,CACH,eAAK,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,aACjD,cAAK,GAAG,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAI,YAE7F,YAAG,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,MAAM,EAAC,QAAQ,EAAC,GAAG,EAAC,YAAY,YAAE,KAAK,CAAC,IAAI,GAAK,IACnE,CACV,CAAC;QACN,CAAC;QACD,OAAO,KAAK,CAAC,IAAI,CAAC;IACtB,CAAC;CACJ"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { TableColumnInfo, TableRowInfo } from "../main";
|
|
1
2
|
import { BaseColumnFormatter } from "./BaseColumnFormatter";
|
|
2
3
|
export declare class EmailFormatter extends BaseColumnFormatter {
|
|
4
|
+
private formatter;
|
|
3
5
|
constructor(width?: string);
|
|
4
|
-
format(value: any): any;
|
|
6
|
+
format(value: any, column: TableColumnInfo, row: TableRowInfo<any>, printable: boolean): any;
|
|
5
7
|
}
|
|
@@ -1,12 +1,18 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
1
|
import { BaseColumnFormatter } from "./BaseColumnFormatter";
|
|
2
|
+
import { BaseURLImageFormatter } from "./BaseURLImageFormatter";
|
|
3
3
|
export class EmailFormatter extends BaseColumnFormatter {
|
|
4
4
|
constructor(width = "250px") {
|
|
5
5
|
super();
|
|
6
|
+
this.formatter = new BaseURLImageFormatter();
|
|
7
|
+
this.onclick_overrided = true;
|
|
6
8
|
this.width = width;
|
|
7
9
|
}
|
|
8
|
-
format(value) {
|
|
9
|
-
return
|
|
10
|
+
format(value, column, row, printable) {
|
|
11
|
+
return this.formatter.format({
|
|
12
|
+
text: value,
|
|
13
|
+
href: `email:${value}`,
|
|
14
|
+
image: { url: "https://static.namirasoft.com/image/concept/type/email.png", alt: "phone" }
|
|
15
|
+
}, column, row, printable);
|
|
10
16
|
}
|
|
11
17
|
}
|
|
12
18
|
//# sourceMappingURL=EmailFormatter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmailFormatter.js","sourceRoot":"","sources":["../../src/formatter/EmailFormatter.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"EmailFormatter.js","sourceRoot":"","sources":["../../src/formatter/EmailFormatter.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,MAAM,OAAO,cAAe,SAAQ,mBAAmB;IAGnD,YAAY,QAAgB,OAAO;QAE/B,KAAK,EAAE,CAAC;QAHJ,cAAS,GAA0B,IAAI,qBAAqB,EAAE,CAAC;QAInE,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC;QAC9B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACvB,CAAC;IACQ,MAAM,CAAC,KAAU,EAAE,MAAuB,EAAE,GAAsB,EAAE,SAAkB;QAE3F,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC;YACzB,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,SAAS,KAAK,EAAE;YACtB,KAAK,EAAE,EAAE,GAAG,EAAE,4DAA4D,EAAE,GAAG,EAAE,OAAO,EAAE;SAC7F,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,CAAC,CAAC;IAC/B,CAAC;CACJ"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BaseColumnFormatter } from "./BaseColumnFormatter";
|
|
2
2
|
import { TableColumnInfo, TableRowInfo } from "../components/NSTable";
|
|
3
3
|
export declare class IDFormatter extends BaseColumnFormatter {
|
|
4
|
+
private formatter;
|
|
4
5
|
constructor(width?: string);
|
|
5
|
-
format(value: any,
|
|
6
|
+
format(value: any, column: TableColumnInfo, row: TableRowInfo<any>, printable: boolean): any;
|
|
6
7
|
}
|
|
@@ -1,19 +1,24 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
1
|
import { BaseUUID } from "namirasoft-core";
|
|
3
2
|
import { BaseColumnFormatter } from "./BaseColumnFormatter";
|
|
4
3
|
import { Globe } from "namirasoft-site-map";
|
|
4
|
+
import { BaseURLImageFormatter } from "./BaseURLImageFormatter";
|
|
5
5
|
export class IDFormatter extends BaseColumnFormatter {
|
|
6
6
|
constructor(width = "200px") {
|
|
7
7
|
super();
|
|
8
|
+
this.formatter = new BaseURLImageFormatter();
|
|
8
9
|
this.onclick_overrided = true;
|
|
9
10
|
this.width = width;
|
|
10
11
|
}
|
|
11
|
-
format(value,
|
|
12
|
+
format(value, column, row, printable) {
|
|
12
13
|
if (!printable)
|
|
13
14
|
if (BaseUUID.isValid(value)) {
|
|
14
15
|
let short = BaseUUID.getShort(value);
|
|
15
16
|
let info = Globe.namirasoft.getByShortName(short);
|
|
16
|
-
return
|
|
17
|
+
return this.formatter.format({
|
|
18
|
+
text: value,
|
|
19
|
+
href: info.table.front_end.getViewLink(value + ""),
|
|
20
|
+
image: { url: info.product.logo, alt: info.product.logo }
|
|
21
|
+
}, column, row, printable);
|
|
17
22
|
}
|
|
18
23
|
return value;
|
|
19
24
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IDFormatter.js","sourceRoot":"","sources":["../../src/formatter/IDFormatter.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"IDFormatter.js","sourceRoot":"","sources":["../../src/formatter/IDFormatter.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,MAAM,OAAO,WAAY,SAAQ,mBAAmB;IAIhD,YAAY,QAAgB,OAAO;QAE/B,KAAK,EAAE,CAAC;QAJJ,cAAS,GAAG,IAAI,qBAAqB,EAAE,CAAC;QAK5C,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC;QAC9B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACvB,CAAC;IACQ,MAAM,CAAC,KAAU,EAAE,MAAuB,EAAE,GAAsB,EAAE,SAAkB;QAE3F,IAAI,CAAC,SAAS;YACV,IAAI,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,EAC3B,CAAC;gBACG,IAAI,KAAK,GAAG,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;gBACrC,IAAI,IAAI,GAAG,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;gBAElD,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC;oBACzB,IAAI,EAAE,KAAK;oBACX,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,KAAK,GAAG,EAAE,CAAC;oBAClD,KAAK,EAAE,EAAE,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE;iBAC5D,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,CAAC,CAAC;YAE/B,CAAC;QACL,OAAO,KAAK,CAAC;IACjB,CAAC;CACJ"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { TableColumnInfo, TableRowInfo } from "../main";
|
|
1
2
|
import { BaseColumnFormatter } from "./BaseColumnFormatter";
|
|
2
3
|
export declare class PhoneFormatter extends BaseColumnFormatter {
|
|
4
|
+
private formatter;
|
|
3
5
|
constructor(width?: string);
|
|
4
|
-
format(value: any): any;
|
|
6
|
+
format(value: any, column: TableColumnInfo, row: TableRowInfo<any>, printable: boolean): any;
|
|
5
7
|
}
|
|
@@ -1,12 +1,18 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
1
|
import { BaseColumnFormatter } from "./BaseColumnFormatter";
|
|
2
|
+
import { BaseURLImageFormatter } from "./BaseURLImageFormatter";
|
|
3
3
|
export class PhoneFormatter extends BaseColumnFormatter {
|
|
4
4
|
constructor(width = "150px") {
|
|
5
5
|
super();
|
|
6
|
+
this.formatter = new BaseURLImageFormatter();
|
|
7
|
+
this.onclick_overrided = true;
|
|
6
8
|
this.width = width;
|
|
7
9
|
}
|
|
8
|
-
format(value) {
|
|
9
|
-
return
|
|
10
|
+
format(value, column, row, printable) {
|
|
11
|
+
return this.formatter.format({
|
|
12
|
+
text: value,
|
|
13
|
+
href: `tel:${value}`,
|
|
14
|
+
image: { url: "https://static.namirasoft.com/image/concept/type/phone.png", alt: "phone" }
|
|
15
|
+
}, column, row, printable);
|
|
10
16
|
}
|
|
11
17
|
}
|
|
12
18
|
//# sourceMappingURL=PhoneFormatter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PhoneFormatter.js","sourceRoot":"","sources":["../../src/formatter/PhoneFormatter.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PhoneFormatter.js","sourceRoot":"","sources":["../../src/formatter/PhoneFormatter.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,MAAM,OAAO,cAAe,SAAQ,mBAAmB;IAGnD,YAAY,QAAgB,OAAO;QAE/B,KAAK,EAAE,CAAC;QAHJ,cAAS,GAA0B,IAAI,qBAAqB,EAAE,CAAC;QAInE,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC;QAC9B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACvB,CAAC;IACQ,MAAM,CAAC,KAAU,EAAE,MAAuB,EAAE,GAAsB,EAAE,SAAkB;QAE3F,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC;YACzB,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,OAAO,KAAK,EAAE;YACpB,KAAK,EAAE,EAAE,GAAG,EAAE,4DAA4D,EAAE,GAAG,EAAE,OAAO,EAAE;SAC7F,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,CAAC,CAAC;IAC/B,CAAC;CACJ"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TableColumnInfo, TableRowInfo } from "../main";
|
|
2
|
+
import { BaseColumnFormatter } from "./BaseColumnFormatter";
|
|
3
|
+
export declare class URLFormatter extends BaseColumnFormatter {
|
|
4
|
+
private formatter;
|
|
5
|
+
constructor(width?: string);
|
|
6
|
+
format(value: any, column: TableColumnInfo, row: TableRowInfo<any>, printable: boolean): any;
|
|
7
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { BaseColumnFormatter } from "./BaseColumnFormatter";
|
|
2
|
+
import { BaseURLImageFormatter } from "./BaseURLImageFormatter";
|
|
3
|
+
export class URLFormatter extends BaseColumnFormatter {
|
|
4
|
+
constructor(width = "250px") {
|
|
5
|
+
super();
|
|
6
|
+
this.formatter = new BaseURLImageFormatter();
|
|
7
|
+
this.onclick_overrided = true;
|
|
8
|
+
this.width = width;
|
|
9
|
+
}
|
|
10
|
+
format(value, column, row, printable) {
|
|
11
|
+
return this.formatter.format({
|
|
12
|
+
text: value,
|
|
13
|
+
href: value,
|
|
14
|
+
image: { url: "https://static.namirasoft.com/image/concept/type/url.png", alt: "url" }
|
|
15
|
+
}, column, row, printable);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=URLFormatter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"URLFormatter.js","sourceRoot":"","sources":["../../src/formatter/URLFormatter.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,MAAM,OAAO,YAAa,SAAQ,mBAAmB;IAGjD,YAAY,QAAgB,OAAO;QAE/B,KAAK,EAAE,CAAC;QAHJ,cAAS,GAA0B,IAAI,qBAAqB,EAAE,CAAC;QAInE,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC;QAC9B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACvB,CAAC;IACQ,MAAM,CAAC,KAAU,EAAE,MAAuB,EAAE,GAAsB,EAAE,SAAkB;QAE3F,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC;YACzB,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,KAAK;YACX,KAAK,EAAE,EAAE,GAAG,EAAE,0DAA0D,EAAE,GAAG,EAAE,KAAK,EAAE;SACzF,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,CAAC,CAAC;IAC/B,CAAC;CACJ"}
|
package/dist/main.d.ts
CHANGED
|
@@ -84,6 +84,7 @@ export * from "./components/NSCopy";
|
|
|
84
84
|
export * from "./components/NSColumn";
|
|
85
85
|
export * from "./formatter/BackColorFormatter";
|
|
86
86
|
export * from "./formatter/BaseColumnFormatter";
|
|
87
|
+
export * from "./formatter/BaseURLImageFormatter";
|
|
87
88
|
export * from "./formatter/BooleanFormatter";
|
|
88
89
|
export * from "./formatter/DateFormatter";
|
|
89
90
|
export * from "./formatter/DateTimeFormatter";
|
|
@@ -101,6 +102,7 @@ export * from "./formatter/PhoneFormatter";
|
|
|
101
102
|
export * from "./formatter/StringFormatter";
|
|
102
103
|
export * from "./formatter/TimeFormatter";
|
|
103
104
|
export * from "./formatter/UnknowFormatter";
|
|
105
|
+
export * from "./formatter/URLFormatter";
|
|
104
106
|
export * from "./pages/NSNotFoundPage";
|
|
105
107
|
export * from "./pages/NSUpdating";
|
|
106
108
|
export * from "./props/IBaseComponentProps";
|
package/dist/main.js
CHANGED
|
@@ -84,6 +84,7 @@ export * from "./components/NSCopy";
|
|
|
84
84
|
export * from "./components/NSColumn";
|
|
85
85
|
export * from "./formatter/BackColorFormatter";
|
|
86
86
|
export * from "./formatter/BaseColumnFormatter";
|
|
87
|
+
export * from "./formatter/BaseURLImageFormatter";
|
|
87
88
|
export * from "./formatter/BooleanFormatter";
|
|
88
89
|
export * from "./formatter/DateFormatter";
|
|
89
90
|
export * from "./formatter/DateTimeFormatter";
|
|
@@ -101,6 +102,7 @@ export * from "./formatter/PhoneFormatter";
|
|
|
101
102
|
export * from "./formatter/StringFormatter";
|
|
102
103
|
export * from "./formatter/TimeFormatter";
|
|
103
104
|
export * from "./formatter/UnknowFormatter";
|
|
105
|
+
export * from "./formatter/URLFormatter";
|
|
104
106
|
export * from "./pages/NSNotFoundPage";
|
|
105
107
|
export * from "./pages/NSUpdating";
|
|
106
108
|
export * from "./props/IBaseComponentProps";
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AACA,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,yBAAyB,CAAC;AAGxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC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,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AAGzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AAGnC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,0BAA0B,CAAC;AACzC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gCAAgC,CAAC;AAG/C,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { TableColumnInfo, TableRowInfo } from "../main";
|
|
2
|
+
import { BaseColumnFormatter } from "./BaseColumnFormatter";
|
|
3
|
+
|
|
4
|
+
export class BaseURLImageFormatter extends BaseColumnFormatter
|
|
5
|
+
{
|
|
6
|
+
constructor(width: string = "250px")
|
|
7
|
+
{
|
|
8
|
+
super();
|
|
9
|
+
this.width = width;
|
|
10
|
+
}
|
|
11
|
+
override format(value: {
|
|
12
|
+
text: any,
|
|
13
|
+
image: { url: string, alt: string },
|
|
14
|
+
href: string
|
|
15
|
+
}, _: TableColumnInfo, __: TableRowInfo<any>, printable: boolean): any
|
|
16
|
+
{
|
|
17
|
+
if (!printable)
|
|
18
|
+
{
|
|
19
|
+
return (
|
|
20
|
+
<div style={{ display: "flex", alignItems: "center" }}>
|
|
21
|
+
<img src={value.image.url} alt={value.image.alt} style={{ width: "20px", height: "20px" }} />
|
|
22
|
+
|
|
23
|
+
<a href={value.href} target="_blank" rel="noreferrer">{value.text}</a>
|
|
24
|
+
</div >
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
return value.text;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -1,15 +1,22 @@
|
|
|
1
|
+
import { TableColumnInfo, TableRowInfo } from "../main";
|
|
1
2
|
import { BaseColumnFormatter } from "./BaseColumnFormatter";
|
|
3
|
+
import { BaseURLImageFormatter } from "./BaseURLImageFormatter";
|
|
2
4
|
|
|
3
5
|
export class EmailFormatter extends BaseColumnFormatter
|
|
4
6
|
{
|
|
7
|
+
private formatter: BaseURLImageFormatter = new BaseURLImageFormatter();
|
|
5
8
|
constructor(width: string = "250px")
|
|
6
9
|
{
|
|
7
10
|
super();
|
|
11
|
+
this.onclick_overrided = true;
|
|
8
12
|
this.width = width;
|
|
9
13
|
}
|
|
10
|
-
override format(value: any): any
|
|
14
|
+
override format(value: any, column: TableColumnInfo, row: TableRowInfo<any>, printable: boolean): any
|
|
11
15
|
{
|
|
12
|
-
|
|
13
|
-
|
|
16
|
+
return this.formatter.format({
|
|
17
|
+
text: value,
|
|
18
|
+
href: `email:${value}`,
|
|
19
|
+
image: { url: "https://static.namirasoft.com/image/concept/type/email.png", alt: "phone" }
|
|
20
|
+
}, column, row, printable);
|
|
14
21
|
}
|
|
15
22
|
}
|
|
@@ -2,29 +2,32 @@ import { BaseUUID } from "namirasoft-core";
|
|
|
2
2
|
import { BaseColumnFormatter } from "./BaseColumnFormatter";
|
|
3
3
|
import { Globe } from "namirasoft-site-map";
|
|
4
4
|
import { TableColumnInfo, TableRowInfo } from "../components/NSTable";
|
|
5
|
+
import { BaseURLImageFormatter } from "./BaseURLImageFormatter";
|
|
5
6
|
|
|
6
7
|
export class IDFormatter extends BaseColumnFormatter
|
|
7
8
|
{
|
|
9
|
+
private formatter = new BaseURLImageFormatter();
|
|
10
|
+
|
|
8
11
|
constructor(width: string = "200px")
|
|
9
12
|
{
|
|
10
13
|
super();
|
|
11
14
|
this.onclick_overrided = true;
|
|
12
15
|
this.width = width;
|
|
13
16
|
}
|
|
14
|
-
override format(value: any,
|
|
17
|
+
override format(value: any, column: TableColumnInfo, row: TableRowInfo<any>, printable: boolean): any
|
|
15
18
|
{
|
|
16
19
|
if (!printable)
|
|
17
20
|
if (BaseUUID.isValid(value))
|
|
18
21
|
{
|
|
19
22
|
let short = BaseUUID.getShort(value);
|
|
20
23
|
let info = Globe.namirasoft.getByShortName(short);
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
|
|
25
|
+
return this.formatter.format({
|
|
26
|
+
text: value,
|
|
27
|
+
href: info.table.front_end.getViewLink(value + ""),
|
|
28
|
+
image: { url: info.product.logo, alt: info.product.logo }
|
|
29
|
+
}, column, row, printable);
|
|
30
|
+
|
|
28
31
|
}
|
|
29
32
|
return value;
|
|
30
33
|
}
|
|
@@ -1,15 +1,22 @@
|
|
|
1
|
+
import { TableColumnInfo, TableRowInfo } from "../main";
|
|
1
2
|
import { BaseColumnFormatter } from "./BaseColumnFormatter";
|
|
3
|
+
import { BaseURLImageFormatter } from "./BaseURLImageFormatter";
|
|
2
4
|
|
|
3
5
|
export class PhoneFormatter extends BaseColumnFormatter
|
|
4
6
|
{
|
|
7
|
+
private formatter: BaseURLImageFormatter = new BaseURLImageFormatter();
|
|
5
8
|
constructor(width: string = "150px")
|
|
6
9
|
{
|
|
7
10
|
super();
|
|
11
|
+
this.onclick_overrided = true;
|
|
8
12
|
this.width = width;
|
|
9
13
|
}
|
|
10
|
-
override format(value: any): any
|
|
14
|
+
override format(value: any, column: TableColumnInfo, row: TableRowInfo<any>, printable: boolean): any
|
|
11
15
|
{
|
|
12
|
-
|
|
13
|
-
|
|
16
|
+
return this.formatter.format({
|
|
17
|
+
text: value,
|
|
18
|
+
href: `tel:${value}`,
|
|
19
|
+
image: { url: "https://static.namirasoft.com/image/concept/type/phone.png", alt: "phone" }
|
|
20
|
+
}, column, row, printable);
|
|
14
21
|
}
|
|
15
22
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { TableColumnInfo, TableRowInfo } from "../main";
|
|
2
|
+
import { BaseColumnFormatter } from "./BaseColumnFormatter";
|
|
3
|
+
import { BaseURLImageFormatter } from "./BaseURLImageFormatter";
|
|
4
|
+
|
|
5
|
+
export class URLFormatter extends BaseColumnFormatter
|
|
6
|
+
{
|
|
7
|
+
private formatter: BaseURLImageFormatter = new BaseURLImageFormatter();
|
|
8
|
+
constructor(width: string = "250px")
|
|
9
|
+
{
|
|
10
|
+
super();
|
|
11
|
+
this.onclick_overrided = true;
|
|
12
|
+
this.width = width;
|
|
13
|
+
}
|
|
14
|
+
override format(value: any, column: TableColumnInfo, row: TableRowInfo<any>, printable: boolean): any
|
|
15
|
+
{
|
|
16
|
+
return this.formatter.format({
|
|
17
|
+
text: value,
|
|
18
|
+
href: value,
|
|
19
|
+
image: { url: "https://static.namirasoft.com/image/concept/type/url.png", alt: "url" }
|
|
20
|
+
}, column, row, printable);
|
|
21
|
+
}
|
|
22
|
+
}
|
package/src/main.ts
CHANGED
|
@@ -147,6 +147,7 @@ export * from "./components/NSColumn";
|
|
|
147
147
|
// formatter
|
|
148
148
|
export * from "./formatter/BackColorFormatter";
|
|
149
149
|
export * from "./formatter/BaseColumnFormatter";
|
|
150
|
+
export * from "./formatter/BaseURLImageFormatter";
|
|
150
151
|
export * from "./formatter/BooleanFormatter";
|
|
151
152
|
export * from "./formatter/DateFormatter";
|
|
152
153
|
export * from "./formatter/DateTimeFormatter";
|
|
@@ -164,6 +165,7 @@ export * from "./formatter/PhoneFormatter";
|
|
|
164
165
|
export * from "./formatter/StringFormatter";
|
|
165
166
|
export * from "./formatter/TimeFormatter";
|
|
166
167
|
export * from "./formatter/UnknowFormatter";
|
|
168
|
+
export * from "./formatter/URLFormatter";
|
|
167
169
|
|
|
168
170
|
// pages
|
|
169
171
|
export * from "./pages/NSNotFoundPage";
|