@open-tender/store 0.3.32 → 0.3.34
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/utils/datetimes.d.ts +1 -1
- package/dist/cjs/utils/datetimes.js +3 -2
- package/dist/cjs/utils/helpers.d.ts +2 -0
- package/dist/cjs/utils/helpers.js +9 -1
- package/dist/esm/utils/datetimes.d.ts +1 -1
- package/dist/esm/utils/datetimes.js +3 -2
- package/dist/esm/utils/helpers.d.ts +2 -0
- package/dist/esm/utils/helpers.js +6 -0
- package/package.json +1 -1
|
@@ -10,7 +10,7 @@ export declare const currentLocalDate: (tz: Timezone) => Date;
|
|
|
10
10
|
export declare const currentLocalDateStr: (tz: Timezone, fmt?: string) => string;
|
|
11
11
|
export declare const dateToIso: (date: Date, tz: Timezone) => ISOString;
|
|
12
12
|
export declare const isoToDate: (dt: ISOStringOffset, tz: Timezone) => Date;
|
|
13
|
-
export declare const isoToDateStr: (dt: ISOStringOffset, tz: Timezone) => string;
|
|
13
|
+
export declare const isoToDateStr: (dt: ISOStringOffset, tz: Timezone, fmt?: string) => string;
|
|
14
14
|
export declare const adjustZonedIso: (dt: ISOStringOffset, tz: Timezone, adjustment: Record<string, number>) => string;
|
|
15
15
|
export declare const cleanISOString: (date: Date) => ISOString;
|
|
16
16
|
export declare const replaceAmPm: (str: string) => string;
|
|
@@ -41,9 +41,10 @@ var isoToDate = function (dt, tz) {
|
|
|
41
41
|
return (0, date_fns_tz_1.utcToZonedTime)((0, date_fns_tz_1.toDate)(dt), tz);
|
|
42
42
|
};
|
|
43
43
|
exports.isoToDate = isoToDate;
|
|
44
|
-
var isoToDateStr = function (dt, tz) {
|
|
44
|
+
var isoToDateStr = function (dt, tz, fmt) {
|
|
45
|
+
if (fmt === void 0) { fmt = exports.HUMAN_DATETIME; }
|
|
45
46
|
var date = (0, exports.isoToDate)(dt, tz);
|
|
46
|
-
return (0, date_fns_tz_1.formatInTimeZone)(date, tz,
|
|
47
|
+
return (0, date_fns_tz_1.formatInTimeZone)(date, tz, fmt);
|
|
47
48
|
};
|
|
48
49
|
exports.isoToDateStr = isoToDateStr;
|
|
49
50
|
var adjustZonedIso = function (dt, tz, adjustment) {
|
|
@@ -2,6 +2,8 @@ import { IndexedError, RequestErrorAPI } from '../types';
|
|
|
2
2
|
export declare const isEmpty: (obj: any) => boolean;
|
|
3
3
|
export declare const contains: (arr: [], values: []) => boolean;
|
|
4
4
|
export declare const makeRandomNumberString: () => string;
|
|
5
|
+
export declare const getWidth: () => number;
|
|
6
|
+
export declare const getHeight: () => number;
|
|
5
7
|
export declare const convertStringToArray: (s: string) => string[];
|
|
6
8
|
export declare const serialize: (obj: Record<string, string>) => string;
|
|
7
9
|
export declare const capitalize: (s: string) => string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.handleRespError = exports.pixelsToInt = exports.remsToInt = exports.formatDollars = exports.formatQuantity = exports.addCommas = exports.capitalize = exports.serialize = exports.convertStringToArray = exports.makeRandomNumberString = exports.contains = exports.isEmpty = void 0;
|
|
3
|
+
exports.handleRespError = exports.pixelsToInt = exports.remsToInt = exports.formatDollars = exports.formatQuantity = exports.addCommas = exports.capitalize = exports.serialize = exports.convertStringToArray = exports.getHeight = exports.getWidth = exports.makeRandomNumberString = exports.contains = exports.isEmpty = void 0;
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
5
|
var isEmpty = function (obj) {
|
|
6
6
|
return (!obj || (obj.constructor === Object && Object.entries(obj).length === 0));
|
|
@@ -14,6 +14,14 @@ var makeRandomNumberString = function () {
|
|
|
14
14
|
return Math.floor(Math.random() * 1000000000).toString();
|
|
15
15
|
};
|
|
16
16
|
exports.makeRandomNumberString = makeRandomNumberString;
|
|
17
|
+
var getWidth = function () {
|
|
18
|
+
return Math.max(document.body.scrollWidth, document.documentElement.scrollWidth, document.body.offsetWidth, document.documentElement.offsetWidth, document.documentElement.clientWidth);
|
|
19
|
+
};
|
|
20
|
+
exports.getWidth = getWidth;
|
|
21
|
+
var getHeight = function () {
|
|
22
|
+
return Math.max(document.body.scrollHeight, document.documentElement.scrollHeight, document.body.offsetHeight, document.documentElement.offsetHeight, document.documentElement.clientHeight);
|
|
23
|
+
};
|
|
24
|
+
exports.getHeight = getHeight;
|
|
17
25
|
var convertStringToArray = function (s) {
|
|
18
26
|
return s
|
|
19
27
|
? s
|
|
@@ -10,7 +10,7 @@ export declare const currentLocalDate: (tz: Timezone) => Date;
|
|
|
10
10
|
export declare const currentLocalDateStr: (tz: Timezone, fmt?: string) => string;
|
|
11
11
|
export declare const dateToIso: (date: Date, tz: Timezone) => ISOString;
|
|
12
12
|
export declare const isoToDate: (dt: ISOStringOffset, tz: Timezone) => Date;
|
|
13
|
-
export declare const isoToDateStr: (dt: ISOStringOffset, tz: Timezone) => string;
|
|
13
|
+
export declare const isoToDateStr: (dt: ISOStringOffset, tz: Timezone, fmt?: string) => string;
|
|
14
14
|
export declare const adjustZonedIso: (dt: ISOStringOffset, tz: Timezone, adjustment: Record<string, number>) => string;
|
|
15
15
|
export declare const cleanISOString: (date: Date) => ISOString;
|
|
16
16
|
export declare const replaceAmPm: (str: string) => string;
|
|
@@ -33,9 +33,10 @@ export var dateToIso = function (date, tz) {
|
|
|
33
33
|
export var isoToDate = function (dt, tz) {
|
|
34
34
|
return utcToZonedTime(toDate(dt), tz);
|
|
35
35
|
};
|
|
36
|
-
export var isoToDateStr = function (dt, tz) {
|
|
36
|
+
export var isoToDateStr = function (dt, tz, fmt) {
|
|
37
|
+
if (fmt === void 0) { fmt = HUMAN_DATETIME; }
|
|
37
38
|
var date = isoToDate(dt, tz);
|
|
38
|
-
return formatInTimeZone(date, tz,
|
|
39
|
+
return formatInTimeZone(date, tz, fmt);
|
|
39
40
|
};
|
|
40
41
|
export var adjustZonedIso = function (dt, tz, adjustment) {
|
|
41
42
|
var date = isoToDate(dt, tz);
|
|
@@ -2,6 +2,8 @@ import { IndexedError, RequestErrorAPI } from '../types';
|
|
|
2
2
|
export declare const isEmpty: (obj: any) => boolean;
|
|
3
3
|
export declare const contains: (arr: [], values: []) => boolean;
|
|
4
4
|
export declare const makeRandomNumberString: () => string;
|
|
5
|
+
export declare const getWidth: () => number;
|
|
6
|
+
export declare const getHeight: () => number;
|
|
5
7
|
export declare const convertStringToArray: (s: string) => string[];
|
|
6
8
|
export declare const serialize: (obj: Record<string, string>) => string;
|
|
7
9
|
export declare const capitalize: (s: string) => string;
|
|
@@ -8,6 +8,12 @@ export var contains = function (arr, values) {
|
|
|
8
8
|
export var makeRandomNumberString = function () {
|
|
9
9
|
return Math.floor(Math.random() * 1000000000).toString();
|
|
10
10
|
};
|
|
11
|
+
export var getWidth = function () {
|
|
12
|
+
return Math.max(document.body.scrollWidth, document.documentElement.scrollWidth, document.body.offsetWidth, document.documentElement.offsetWidth, document.documentElement.clientWidth);
|
|
13
|
+
};
|
|
14
|
+
export var getHeight = function () {
|
|
15
|
+
return Math.max(document.body.scrollHeight, document.documentElement.scrollHeight, document.body.offsetHeight, document.documentElement.offsetHeight, document.documentElement.clientHeight);
|
|
16
|
+
};
|
|
11
17
|
export var convertStringToArray = function (s) {
|
|
12
18
|
return s
|
|
13
19
|
? s
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-tender/store",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.34",
|
|
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",
|