namirasoft-site-react 1.4.168 → 1.4.170
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.module.css +0 -1
- package/dist/formatter/BaseURLImageFormatter.d.ts +8 -0
- package/dist/formatter/BaseURLImageFormatter.js +17 -0
- package/dist/formatter/BaseURLImageFormatter.js.map +1 -0
- package/dist/formatter/EmailFormatter.d.ts +3 -1
- package/dist/formatter/EmailFormatter.js +4 -3
- package/dist/formatter/EmailFormatter.js.map +1 -1
- package/dist/formatter/PhoneFormatter.d.ts +3 -1
- package/dist/formatter/PhoneFormatter.js +4 -3
- package/dist/formatter/PhoneFormatter.js.map +1 -1
- package/dist/formatter/URLFormatter.d.ts +7 -0
- package/dist/formatter/URLFormatter.js +13 -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/components/NSDialog.module.css +0 -1
- package/src/formatter/BaseURLImageFormatter.tsx +29 -0
- package/src/formatter/EmailFormatter.tsx +5 -3
- package/src/formatter/PhoneFormatter.tsx +5 -3
- package/src/formatter/URLFormatter.tsx +17 -0
- package/src/main.ts +2 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TableColumnInfo, TableRowInfo } from "../main";
|
|
2
|
+
import { BaseColumnFormatter } from "./BaseColumnFormatter";
|
|
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;
|
|
8
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
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(image, getHRef, width = "250px") {
|
|
5
|
+
super();
|
|
6
|
+
this.image = image;
|
|
7
|
+
this.getHRef = getHRef;
|
|
8
|
+
this.width = width;
|
|
9
|
+
}
|
|
10
|
+
format(value, _, __, printable) {
|
|
11
|
+
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 })] }));
|
|
13
|
+
}
|
|
14
|
+
return value;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
//# 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;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,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, table: TableColumnInfo, row: TableRowInfo<any>, printable: boolean): any;
|
|
5
7
|
}
|
|
@@ -1,12 +1,13 @@
|
|
|
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("https://static.namirasoft.com/image/concept/type/email.png", value => `email:${value}`);
|
|
6
7
|
this.width = width;
|
|
7
8
|
}
|
|
8
|
-
format(value) {
|
|
9
|
-
return
|
|
9
|
+
format(value, table, row, printable) {
|
|
10
|
+
return this.formatter.format(value, table, row, printable);
|
|
10
11
|
}
|
|
11
12
|
}
|
|
12
13
|
//# 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,CAAC,4DAA4D,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,KAAK,EAAE,CAAC,CAAC;QAI1J,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,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, table: TableColumnInfo, row: TableRowInfo<any>, printable: boolean): any;
|
|
5
7
|
}
|
|
@@ -1,12 +1,13 @@
|
|
|
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("https://static.namirasoft.com/image/concept/type/phone.png", value => `tel:${value}`);
|
|
6
7
|
this.width = width;
|
|
7
8
|
}
|
|
8
|
-
format(value) {
|
|
9
|
-
return
|
|
9
|
+
format(value, table, row, printable) {
|
|
10
|
+
return this.formatter.format(value, table, row, printable);
|
|
10
11
|
}
|
|
11
12
|
}
|
|
12
13
|
//# 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,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"}
|
|
@@ -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, table: TableColumnInfo, row: TableRowInfo<any>, printable: boolean): any;
|
|
7
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
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("https://static.namirasoft.com/image/concept/type/url.png", value => value);
|
|
7
|
+
this.width = width;
|
|
8
|
+
}
|
|
9
|
+
format(value, table, row, printable) {
|
|
10
|
+
return this.formatter.format(value, table, row, printable);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
//# 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,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"}
|
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,C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C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iCAAiC,CAAC;AAChD,cAAc,mCAAmC,CAAC;AAClD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,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
|
+
private image: string;
|
|
7
|
+
private getHRef: (value: any) => any;
|
|
8
|
+
constructor(image: string, getHRef: (value: any) => any, width: string = "250px")
|
|
9
|
+
{
|
|
10
|
+
super();
|
|
11
|
+
this.image = image;
|
|
12
|
+
this.getHRef = getHRef;
|
|
13
|
+
this.width = width;
|
|
14
|
+
}
|
|
15
|
+
override format(value: any, _: TableColumnInfo, __: TableRowInfo<any>, printable: boolean): any
|
|
16
|
+
{
|
|
17
|
+
if (!printable)
|
|
18
|
+
{
|
|
19
|
+
return (
|
|
20
|
+
<div style={{ display: "flex", alignItems: "center" }}>
|
|
21
|
+
<img src={this.image} style={{ width: "20px", height: "20px" }} />
|
|
22
|
+
|
|
23
|
+
<a href={this.getHRef(value)}>{value}</a >
|
|
24
|
+
</div >
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
return value;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -1,15 +1,17 @@
|
|
|
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("https://static.namirasoft.com/image/concept/type/email.png", value => `email:${value}`);
|
|
5
8
|
constructor(width: string = "250px")
|
|
6
9
|
{
|
|
7
10
|
super();
|
|
8
11
|
this.width = width;
|
|
9
12
|
}
|
|
10
|
-
override format(value: any): any
|
|
13
|
+
override format(value: any, table: TableColumnInfo, row: TableRowInfo<any>, printable: boolean): any
|
|
11
14
|
{
|
|
12
|
-
|
|
13
|
-
return <a href={`email:${value}`}>value</a>;
|
|
15
|
+
return this.formatter.format(value, table, row, printable);
|
|
14
16
|
}
|
|
15
17
|
}
|
|
@@ -1,15 +1,17 @@
|
|
|
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("https://static.namirasoft.com/image/concept/type/phone.png", value => `tel:${value}`);
|
|
5
8
|
constructor(width: string = "150px")
|
|
6
9
|
{
|
|
7
10
|
super();
|
|
8
11
|
this.width = width;
|
|
9
12
|
}
|
|
10
|
-
override format(value: any): any
|
|
13
|
+
override format(value: any, table: TableColumnInfo, row: TableRowInfo<any>, printable: boolean): any
|
|
11
14
|
{
|
|
12
|
-
|
|
13
|
-
return <a href={`tel:${value}`}>value</a>;
|
|
15
|
+
return this.formatter.format(value, table, row, printable);
|
|
14
16
|
}
|
|
15
17
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
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("https://static.namirasoft.com/image/concept/type/url.png", value => value);
|
|
8
|
+
constructor(width: string = "250px")
|
|
9
|
+
{
|
|
10
|
+
super();
|
|
11
|
+
this.width = width;
|
|
12
|
+
}
|
|
13
|
+
override format(value: any, table: TableColumnInfo, row: TableRowInfo<any>, printable: boolean): any
|
|
14
|
+
{
|
|
15
|
+
return this.formatter.format(value, table, row, printable);
|
|
16
|
+
}
|
|
17
|
+
}
|
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";
|