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.
@@ -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
- private image;
5
- private getHRef;
6
- constructor(image: string, getHRef: (value: any) => any, width?: string);
7
- format(value: any, _: TableColumnInfo, __: TableRowInfo<any>, printable: boolean): any;
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(image, getHRef, width = "250px") {
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: this.image, style: { width: "20px", height: "20px" } }), "\u00A0", _jsx("a", { href: this.getHRef(value), children: value })] }));
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;IAI1D,YAAY,KAAa,EAAE,OAA4B,EAAE,QAAgB,OAAO;QAE5E,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACvB,CAAC;IACQ,MAAM,CAAC,KAAU,EAAE,CAAkB,EAAE,EAAqB,EAAE,SAAkB;QAErF,IAAI,CAAC,SAAS,EACd,CAAC;YACG,OAAO,CACH,eAAK,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,aACjD,cAAK,GAAG,EAAE,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAI,YAElE,YAAG,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,YAAG,KAAK,GAAM,IACvC,CACV,CAAC;QACN,CAAC;QACD,OAAO,KAAK,CAAC;IACjB,CAAC;CACJ"}
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, table: TableColumnInfo, row: TableRowInfo<any>, printable: boolean): 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("https://static.namirasoft.com/image/concept/type/email.png", value => `email:${value}`);
6
+ this.formatter = new BaseURLImageFormatter();
7
+ this.onclick_overrided = true;
7
8
  this.width = width;
8
9
  }
9
- format(value, table, row, printable) {
10
- return this.formatter.format(value, table, row, printable);
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.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E,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, _: TableColumnInfo, __: TableRowInfo<any>, printable: boolean): 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, _, __, printable) {
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 (_jsxs("div", { style: { display: "flex", alignItems: "center" }, children: [_jsx("img", { src: info.product.logo, alt: info.product.name, style: { width: "20px", height: "20px" } }), "\u00A0", _jsx("a", { href: info.table.front_end.getViewLink(value + ""), target: "_blank", rel: "noreferrer", children: value })] }));
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.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are class PhoneFormatter extends BaseColumnFormatter {
4
4
  private formatter;
5
5
  constructor(width?: string);
6
- format(value: any, table: TableColumnInfo, row: TableRowInfo<any>, printable: boolean): 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("https://static.namirasoft.com/image/concept/type/phone.png", value => `tel:${value}`);
6
+ this.formatter = new BaseURLImageFormatter();
7
+ this.onclick_overrided = true;
7
8
  this.width = width;
8
9
  }
9
- format(value, table, row, printable) {
10
- return this.formatter.format(value, table, row, printable);
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,CAAC,4DAA4D,EAAE,KAAK,CAAC,EAAE,CAAC,OAAO,KAAK,EAAE,CAAC,CAAC;QAIxJ,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACvB,CAAC;IACQ,MAAM,CAAC,KAAU,EAAE,KAAsB,EAAE,GAAsB,EAAE,SAAkB;QAE1F,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,SAAS,CAAC,CAAC;IAC/D,CAAC;CACJ"}
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, table: TableColumnInfo, row: TableRowInfo<any>, printable: boolean): 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("https://static.namirasoft.com/image/concept/type/url.png", value => value);
6
+ this.formatter = new BaseURLImageFormatter();
7
+ this.onclick_overrided = true;
7
8
  this.width = width;
8
9
  }
9
- format(value, table, row, printable) {
10
- return this.formatter.format(value, table, row, printable);
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,CAAC,0DAA0D,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;QAI7I,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACvB,CAAC;IACQ,MAAM,CAAC,KAAU,EAAE,KAAsB,EAAE,GAAsB,EAAE,SAAkB;QAE1F,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,SAAS,CAAC,CAAC;IAC/D,CAAC;CACJ"}
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
@@ -8,7 +8,7 @@
8
8
  "framework": "npm",
9
9
  "application": "package",
10
10
  "private": false,
11
- "version": "1.4.170",
11
+ "version": "1.4.171",
12
12
  "author": "Amir Abolhasani",
13
13
  "license": "MIT",
14
14
  "main": "./dist/main.js",
@@ -3,27 +3,27 @@ import { BaseColumnFormatter } from "./BaseColumnFormatter";
3
3
 
4
4
  export class BaseURLImageFormatter extends BaseColumnFormatter
5
5
  {
6
- private image: string;
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: any, _: TableColumnInfo, __: TableRowInfo<any>, printable: boolean): any
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={this.image} style={{ width: "20px", height: "20px" }} />
21
+ <img src={value.image.url} alt={value.image.alt} style={{ width: "20px", height: "20px" }} />
22
22
  &nbsp;
23
- <a href={this.getHRef(value)}>{value}</a >
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("https://static.namirasoft.com/image/concept/type/email.png", value => `email:${value}`);
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, table: TableColumnInfo, row: TableRowInfo<any>, printable: boolean): any
14
+ override format(value: any, column: TableColumnInfo, row: TableRowInfo<any>, printable: boolean): any
14
15
  {
15
- return this.formatter.format(value, table, row, printable);
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, _: TableColumnInfo, __: TableRowInfo<any>, printable: boolean): 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
- return (
22
- <div style={{ display: "flex", alignItems: "center" }}>
23
- <img src={info.product.logo} alt={info.product.name} style={{ width: "20px", height: "20px" }} />
24
- &nbsp;
25
- <a href={info.table.front_end.getViewLink(value + "")} target="_blank" rel="noreferrer">{value}</a >
26
- </div >
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("https://static.namirasoft.com/image/concept/type/phone.png", value => `tel:${value}`);
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, table: TableColumnInfo, row: TableRowInfo<any>, printable: boolean): any
14
+ override format(value: any, column: TableColumnInfo, row: TableRowInfo<any>, printable: boolean): any
14
15
  {
15
- return this.formatter.format(value, table, row, printable);
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("https://static.namirasoft.com/image/concept/type/url.png", value => value);
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, table: TableColumnInfo, row: TableRowInfo<any>, printable: boolean): any
14
+ override format(value: any, column: TableColumnInfo, row: TableRowInfo<any>, printable: boolean): any
14
15
  {
15
- return this.formatter.format(value, table, row, printable);
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
  }