namirasoft-site-react 1.4.170 → 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 +9 -4
- package/dist/formatter/BaseURLImageFormatter.js +3 -5
- package/dist/formatter/BaseURLImageFormatter.js.map +1 -1
- package/dist/formatter/EmailFormatter.d.ts +1 -1
- package/dist/formatter/EmailFormatter.js +8 -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 +1 -1
- package/dist/formatter/PhoneFormatter.js +8 -3
- package/dist/formatter/PhoneFormatter.js.map +1 -1
- package/dist/formatter/URLFormatter.d.ts +1 -1
- package/dist/formatter/URLFormatter.js +8 -3
- package/dist/formatter/URLFormatter.js.map +1 -1
- package/package.json +1 -1
- package/src/formatter/BaseURLImageFormatter.tsx +9 -9
- package/src/formatter/EmailFormatter.tsx +8 -3
- package/src/formatter/IDFormatter.tsx +11 -8
- package/src/formatter/PhoneFormatter.tsx +8 -3
- package/src/formatter/URLFormatter.tsx +8 -3
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { TableColumnInfo, TableRowInfo } from "../main";
|
|
2
2
|
import { BaseColumnFormatter } from "./BaseColumnFormatter";
|
|
3
3
|
export declare class BaseURLImageFormatter extends BaseColumnFormatter {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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;
|
|
8
13
|
}
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { BaseColumnFormatter } from "./BaseColumnFormatter";
|
|
3
3
|
export class BaseURLImageFormatter extends BaseColumnFormatter {
|
|
4
|
-
constructor(
|
|
4
|
+
constructor(width = "250px") {
|
|
5
5
|
super();
|
|
6
|
-
this.image = image;
|
|
7
|
-
this.getHRef = getHRef;
|
|
8
6
|
this.width = width;
|
|
9
7
|
}
|
|
10
8
|
format(value, _, __, printable) {
|
|
11
9
|
if (!printable) {
|
|
12
|
-
return (_jsxs("div", { style: { display: "flex", alignItems: "center" }, children: [_jsx("img", { src:
|
|
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 })] }));
|
|
13
11
|
}
|
|
14
|
-
return value;
|
|
12
|
+
return value.text;
|
|
15
13
|
}
|
|
16
14
|
}
|
|
17
15
|
//# sourceMappingURL=BaseURLImageFormatter.js.map
|
|
@@ -1 +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;
|
|
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"}
|
|
@@ -3,5 +3,5 @@ import { BaseColumnFormatter } from "./BaseColumnFormatter";
|
|
|
3
3
|
export declare class EmailFormatter extends BaseColumnFormatter {
|
|
4
4
|
private formatter;
|
|
5
5
|
constructor(width?: string);
|
|
6
|
-
format(value: any,
|
|
6
|
+
format(value: any, column: TableColumnInfo, row: TableRowInfo<any>, printable: boolean): any;
|
|
7
7
|
}
|
|
@@ -3,11 +3,16 @@ import { BaseURLImageFormatter } from "./BaseURLImageFormatter";
|
|
|
3
3
|
export class EmailFormatter extends BaseColumnFormatter {
|
|
4
4
|
constructor(width = "250px") {
|
|
5
5
|
super();
|
|
6
|
-
this.formatter = new BaseURLImageFormatter(
|
|
6
|
+
this.formatter = new BaseURLImageFormatter();
|
|
7
|
+
this.onclick_overrided = true;
|
|
7
8
|
this.width = width;
|
|
8
9
|
}
|
|
9
|
-
format(value,
|
|
10
|
-
return this.formatter.format(
|
|
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);
|
|
11
16
|
}
|
|
12
17
|
}
|
|
13
18
|
//# sourceMappingURL=EmailFormatter.js.map
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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"}
|
|
@@ -3,5 +3,5 @@ import { BaseColumnFormatter } from "./BaseColumnFormatter";
|
|
|
3
3
|
export declare class PhoneFormatter extends BaseColumnFormatter {
|
|
4
4
|
private formatter;
|
|
5
5
|
constructor(width?: string);
|
|
6
|
-
format(value: any,
|
|
6
|
+
format(value: any, column: TableColumnInfo, row: TableRowInfo<any>, printable: boolean): any;
|
|
7
7
|
}
|
|
@@ -3,11 +3,16 @@ import { BaseURLImageFormatter } from "./BaseURLImageFormatter";
|
|
|
3
3
|
export class PhoneFormatter extends BaseColumnFormatter {
|
|
4
4
|
constructor(width = "150px") {
|
|
5
5
|
super();
|
|
6
|
-
this.formatter = new BaseURLImageFormatter(
|
|
6
|
+
this.formatter = new BaseURLImageFormatter();
|
|
7
|
+
this.onclick_overrided = true;
|
|
7
8
|
this.width = width;
|
|
8
9
|
}
|
|
9
|
-
format(value,
|
|
10
|
-
return this.formatter.format(
|
|
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);
|
|
11
16
|
}
|
|
12
17
|
}
|
|
13
18
|
//# sourceMappingURL=PhoneFormatter.js.map
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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"}
|
|
@@ -3,5 +3,5 @@ import { BaseColumnFormatter } from "./BaseColumnFormatter";
|
|
|
3
3
|
export declare class URLFormatter extends BaseColumnFormatter {
|
|
4
4
|
private formatter;
|
|
5
5
|
constructor(width?: string);
|
|
6
|
-
format(value: any,
|
|
6
|
+
format(value: any, column: TableColumnInfo, row: TableRowInfo<any>, printable: boolean): any;
|
|
7
7
|
}
|
|
@@ -3,11 +3,16 @@ import { BaseURLImageFormatter } from "./BaseURLImageFormatter";
|
|
|
3
3
|
export class URLFormatter extends BaseColumnFormatter {
|
|
4
4
|
constructor(width = "250px") {
|
|
5
5
|
super();
|
|
6
|
-
this.formatter = new BaseURLImageFormatter(
|
|
6
|
+
this.formatter = new BaseURLImageFormatter();
|
|
7
|
+
this.onclick_overrided = true;
|
|
7
8
|
this.width = width;
|
|
8
9
|
}
|
|
9
|
-
format(value,
|
|
10
|
-
return this.formatter.format(
|
|
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);
|
|
11
16
|
}
|
|
12
17
|
}
|
|
13
18
|
//# sourceMappingURL=URLFormatter.js.map
|
|
@@ -1 +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,
|
|
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/package.json
CHANGED
|
@@ -3,27 +3,27 @@ import { BaseColumnFormatter } from "./BaseColumnFormatter";
|
|
|
3
3
|
|
|
4
4
|
export class BaseURLImageFormatter extends BaseColumnFormatter
|
|
5
5
|
{
|
|
6
|
-
|
|
7
|
-
private getHRef: (value: any) => any;
|
|
8
|
-
constructor(image: string, getHRef: (value: any) => any, width: string = "250px")
|
|
6
|
+
constructor(width: string = "250px")
|
|
9
7
|
{
|
|
10
8
|
super();
|
|
11
|
-
this.image = image;
|
|
12
|
-
this.getHRef = getHRef;
|
|
13
9
|
this.width = width;
|
|
14
10
|
}
|
|
15
|
-
override format(value:
|
|
11
|
+
override format(value: {
|
|
12
|
+
text: any,
|
|
13
|
+
image: { url: string, alt: string },
|
|
14
|
+
href: string
|
|
15
|
+
}, _: TableColumnInfo, __: TableRowInfo<any>, printable: boolean): any
|
|
16
16
|
{
|
|
17
17
|
if (!printable)
|
|
18
18
|
{
|
|
19
19
|
return (
|
|
20
20
|
<div style={{ display: "flex", alignItems: "center" }}>
|
|
21
|
-
<img src={
|
|
21
|
+
<img src={value.image.url} alt={value.image.alt} style={{ width: "20px", height: "20px" }} />
|
|
22
22
|
|
|
23
|
-
<a href={
|
|
23
|
+
<a href={value.href} target="_blank" rel="noreferrer">{value.text}</a>
|
|
24
24
|
</div >
|
|
25
25
|
);
|
|
26
26
|
}
|
|
27
|
-
return value;
|
|
27
|
+
return value.text;
|
|
28
28
|
}
|
|
29
29
|
}
|
|
@@ -4,14 +4,19 @@ import { BaseURLImageFormatter } from "./BaseURLImageFormatter";
|
|
|
4
4
|
|
|
5
5
|
export class EmailFormatter extends BaseColumnFormatter
|
|
6
6
|
{
|
|
7
|
-
private formatter: BaseURLImageFormatter = new BaseURLImageFormatter(
|
|
7
|
+
private formatter: BaseURLImageFormatter = new BaseURLImageFormatter();
|
|
8
8
|
constructor(width: string = "250px")
|
|
9
9
|
{
|
|
10
10
|
super();
|
|
11
|
+
this.onclick_overrided = true;
|
|
11
12
|
this.width = width;
|
|
12
13
|
}
|
|
13
|
-
override format(value: any,
|
|
14
|
+
override format(value: any, column: TableColumnInfo, row: TableRowInfo<any>, printable: boolean): any
|
|
14
15
|
{
|
|
15
|
-
return this.formatter.format(
|
|
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);
|
|
16
21
|
}
|
|
17
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
|
}
|
|
@@ -4,14 +4,19 @@ import { BaseURLImageFormatter } from "./BaseURLImageFormatter";
|
|
|
4
4
|
|
|
5
5
|
export class PhoneFormatter extends BaseColumnFormatter
|
|
6
6
|
{
|
|
7
|
-
private formatter: BaseURLImageFormatter = new BaseURLImageFormatter(
|
|
7
|
+
private formatter: BaseURLImageFormatter = new BaseURLImageFormatter();
|
|
8
8
|
constructor(width: string = "150px")
|
|
9
9
|
{
|
|
10
10
|
super();
|
|
11
|
+
this.onclick_overrided = true;
|
|
11
12
|
this.width = width;
|
|
12
13
|
}
|
|
13
|
-
override format(value: any,
|
|
14
|
+
override format(value: any, column: TableColumnInfo, row: TableRowInfo<any>, printable: boolean): any
|
|
14
15
|
{
|
|
15
|
-
return this.formatter.format(
|
|
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);
|
|
16
21
|
}
|
|
17
22
|
}
|
|
@@ -4,14 +4,19 @@ import { BaseURLImageFormatter } from "./BaseURLImageFormatter";
|
|
|
4
4
|
|
|
5
5
|
export class URLFormatter extends BaseColumnFormatter
|
|
6
6
|
{
|
|
7
|
-
private formatter: BaseURLImageFormatter = new BaseURLImageFormatter(
|
|
7
|
+
private formatter: BaseURLImageFormatter = new BaseURLImageFormatter();
|
|
8
8
|
constructor(width: string = "250px")
|
|
9
9
|
{
|
|
10
10
|
super();
|
|
11
|
+
this.onclick_overrided = true;
|
|
11
12
|
this.width = width;
|
|
12
13
|
}
|
|
13
|
-
override format(value: any,
|
|
14
|
+
override format(value: any, column: TableColumnInfo, row: TableRowInfo<any>, printable: boolean): any
|
|
14
15
|
{
|
|
15
|
-
return this.formatter.format(
|
|
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);
|
|
16
21
|
}
|
|
17
22
|
}
|