@open-tender/store 0.3.78 → 0.3.80
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/cjs/types/api/order.d.ts +1 -0
- package/dist/cjs/types/global.d.ts +1 -1
- package/dist/cjs/utils/pos.d.ts +1 -0
- package/dist/cjs/utils/pos.js +14 -1
- package/dist/esm/types/api/order.d.ts +1 -0
- package/dist/esm/types/global.d.ts +1 -1
- package/dist/esm/utils/pos.d.ts +1 -0
- package/dist/esm/utils/pos.js +12 -0
- package/package.json +1 -1
|
@@ -19,7 +19,7 @@ export declare type TenderTypeMap = {
|
|
|
19
19
|
[Property in TenderType]: string;
|
|
20
20
|
};
|
|
21
21
|
export declare type CardType = 'VISA' | 'MC' | 'DISC' | 'AMEX' | 'OTHER';
|
|
22
|
-
export declare type DiscountType = 'DOLLAR' | 'PERCENTAGE';
|
|
22
|
+
export declare type DiscountType = 'DOLLAR' | 'PERCENTAGE' | 'LOYALTY';
|
|
23
23
|
export declare type SurchargeType = 'DOLLAR' | 'PERCENTAGE' | 'DISTANCE' | 'TRAVEL_TIME';
|
|
24
24
|
export declare type TaxType = 'DOLLAR' | 'PERCENTAGE';
|
|
25
25
|
export declare type TaxTypeInt = 1 | 2;
|
package/dist/cjs/utils/pos.d.ts
CHANGED
package/dist/cjs/utils/pos.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.makeAsideWidth = void 0;
|
|
3
|
+
exports.makePhone = exports.makeAsideWidth = void 0;
|
|
4
4
|
var helpers_1 = require("./helpers");
|
|
5
5
|
var makeAsideWidth = function (deviceWidth, layout) {
|
|
6
6
|
var padding = (0, helpers_1.pixelsToInt)(layout.padding);
|
|
@@ -11,3 +11,16 @@ var makeAsideWidth = function (deviceWidth, layout) {
|
|
|
11
11
|
return deviceWidth - count * buttonWidth - 2 * padding;
|
|
12
12
|
};
|
|
13
13
|
exports.makeAsideWidth = makeAsideWidth;
|
|
14
|
+
var makePhone = function (phone) {
|
|
15
|
+
if (!phone)
|
|
16
|
+
return '';
|
|
17
|
+
var p = phone.replace(/\D/g, '');
|
|
18
|
+
if (p.length > 6) {
|
|
19
|
+
return "".concat(p.slice(0, 3), "-").concat(p.slice(3, 6), "-").concat(p.slice(6, 10));
|
|
20
|
+
}
|
|
21
|
+
else if (p.length > 3) {
|
|
22
|
+
return "".concat(p.slice(0, 3), "-").concat(p.slice(3, 6));
|
|
23
|
+
}
|
|
24
|
+
return p;
|
|
25
|
+
};
|
|
26
|
+
exports.makePhone = makePhone;
|
|
@@ -19,7 +19,7 @@ export declare type TenderTypeMap = {
|
|
|
19
19
|
[Property in TenderType]: string;
|
|
20
20
|
};
|
|
21
21
|
export declare type CardType = 'VISA' | 'MC' | 'DISC' | 'AMEX' | 'OTHER';
|
|
22
|
-
export declare type DiscountType = 'DOLLAR' | 'PERCENTAGE';
|
|
22
|
+
export declare type DiscountType = 'DOLLAR' | 'PERCENTAGE' | 'LOYALTY';
|
|
23
23
|
export declare type SurchargeType = 'DOLLAR' | 'PERCENTAGE' | 'DISTANCE' | 'TRAVEL_TIME';
|
|
24
24
|
export declare type TaxType = 'DOLLAR' | 'PERCENTAGE';
|
|
25
25
|
export declare type TaxTypeInt = 1 | 2;
|
package/dist/esm/utils/pos.d.ts
CHANGED
package/dist/esm/utils/pos.js
CHANGED
|
@@ -7,3 +7,15 @@ export var makeAsideWidth = function (deviceWidth, layout) {
|
|
|
7
7
|
var count = Math.floor(remaining / buttonWidth);
|
|
8
8
|
return deviceWidth - count * buttonWidth - 2 * padding;
|
|
9
9
|
};
|
|
10
|
+
export var makePhone = function (phone) {
|
|
11
|
+
if (!phone)
|
|
12
|
+
return '';
|
|
13
|
+
var p = phone.replace(/\D/g, '');
|
|
14
|
+
if (p.length > 6) {
|
|
15
|
+
return "".concat(p.slice(0, 3), "-").concat(p.slice(3, 6), "-").concat(p.slice(6, 10));
|
|
16
|
+
}
|
|
17
|
+
else if (p.length > 3) {
|
|
18
|
+
return "".concat(p.slice(0, 3), "-").concat(p.slice(3, 6));
|
|
19
|
+
}
|
|
20
|
+
return p;
|
|
21
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-tender/store",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.80",
|
|
4
4
|
"description": "A library of hooks, reducers, utility functions, and types for use with Open Tender applications that utilize our in-store POS API",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"module": "./dist/esm/index.js",
|