@everymatrix/cashier-method-details 1.43.0 → 1.43.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/cashier-method-details",
3
- "version": "1.43.0",
3
+ "version": "1.43.2",
4
4
  "main": "index.js",
5
5
  "svelte": "src/index.ts",
6
6
  "scripts": {
@@ -35,5 +35,5 @@
35
35
  "publishConfig": {
36
36
  "access": "public"
37
37
  },
38
- "gitHead": "2b46cd3311230285da87ca4b133f9dd5735a0db7"
38
+ "gitHead": "0477411e57fe6c3eda8ff28059aa540dcada8ae0"
39
39
  }
@@ -16,6 +16,8 @@
16
16
  import "flatpickr/dist/flatpickr.min.css";
17
17
  import FlatpickrLanguages from "flatpickr/dist/l10n";
18
18
  import dayjs from 'dayjs';
19
+ import utc from 'dayjs/plugin/utc';
20
+ dayjs.extend(utc);
19
21
  import customParseFormat from 'dayjs/plugin/customParseFormat';
20
22
  import type {DateTimeFormat, PaymentMethod} from "./CashierMethodDetails.types";
21
23
  export class PaymentMethodDetails {
@@ -161,7 +163,7 @@
161
163
  Placeholder = 'Placeholder',
162
164
  Format = 'Format'
163
165
  }
164
-
166
+
165
167
  const defaultDateTimeFormatMap = new Map<FieldTypes, DateTimeFormat>([
166
168
  [FieldTypes.Date, {Placeholder: 'MM/DD/YYYY', Format: '^\\d{2}\/\\d{2}\/\\d{4}$' }],
167
169
  [FieldTypes.Time, { Placeholder: 'HH:mm', Format: '^\\d{2}:\\d{2}$' }],
@@ -372,6 +374,7 @@
372
374
  const headers = new Headers();
373
375
  headers.append("accept", "application/json");
374
376
  headers.append("Content-Type", "application/json");
377
+ headers.append("X-Client-Request-Timestamp", dayjs.utc().format("YYYY-MM-DD HH:mm:ss.SSS"));
375
378
  const requestParams:RequestInit = {
376
379
  method: "POST",
377
380
  mode: "cors",
@@ -508,7 +511,7 @@
508
511
  const topSpace = innerContainer.top - outerContainer.top - innerContainer.height;
509
512
  const bottomSpace = outerContainer.bottom - innerContainer.bottom - innerContainer.height;
510
513
  const dropdownSizeBottom = !openLookupTop && bottomSpace < 70 ? minLookupHeight - 50 : bottomSpace;
511
- maxLookupHeight = openLookupTop ? topSpace : dropdownSizeBottom;
514
+ maxLookupHeight = openLookupTop ? topSpace : dropdownSizeBottom;
512
515
  openedLookup = name
513
516
  }
514
517
 
@@ -521,6 +524,7 @@
521
524
  const headers = new Headers();
522
525
  headers.append("accept", "application/json");
523
526
  headers.append("Content-Type", "application/json");
527
+ headers.append("X-Client-Request-Timestamp", dayjs.utc().format("YYYY-MM-DD HH:mm:ss.SSS"));
524
528
  toggleDisableActionOnPage();
525
529
  const requestParams:RequestInit = {
526
530
  method: "POST",
@@ -627,6 +631,7 @@
627
631
  const headers = new Headers();
628
632
  headers.append("accept", "application/json");
629
633
  headers.append("Content-Type", "application/json");
634
+ headers.append("X-Client-Request-Timestamp", dayjs.utc().format("YYYY-MM-DD HH:mm:ss.SSS"));
630
635
  toggleDisableActionOnPage();
631
636
  const requestParams:RequestInit = {
632
637
  method: "POST",
@@ -648,7 +653,7 @@
648
653
  setErrorResponseCode();
649
654
  return;
650
655
  }
651
-
656
+
652
657
  if (data.ResponseCode !== ResponseCode.Success) {
653
658
  errorResponseCode = data.ResponseCode;
654
659
  isProcessingTxn = false;
@@ -769,7 +774,7 @@
769
774
  }
770
775
  return ''
771
776
  }
772
-
777
+
773
778
  const patternValidator = (pattern, value) => {
774
779
  if (!pattern) return true;
775
780
  let regex;
@@ -811,7 +816,7 @@
811
816
  const dateTimeValidation = (field) => {
812
817
  const value = prepareFields[field.name];
813
818
  const format = field.placeholder;
814
- const inputValue = dayjs(value, format);
819
+ const inputValue = dayjs(value, format);
815
820
  const maxValue = dayjs(field.maxValue, format);
816
821
  const minValue = dayjs(field.minValue, format);
817
822
  if (inputValue.isBefore(minValue) || inputValue.isAfter(maxValue)) {
@@ -823,7 +828,7 @@
823
828
 
824
829
  const validateField = (field) => {
825
830
  const value = prepareFields[field.name]
826
- fieldValidation[field.name] = showField(field) ? (emptyFieldError(field, value) || patternMatchesError(field, value)) : '';
831
+ fieldValidation[field.name] = showField(field) ? (emptyFieldError(field, value) || patternMatchesError(field, value)) : '';
827
832
  }
828
833
 
829
834
  const isSubmitDisabled = (amountError, fieldValidation) => {
@@ -1083,19 +1088,17 @@
1083
1088
  input::-webkit-date-and-time-value {
1084
1089
  visibility: hidden;
1085
1090
  }
1086
-
1091
+
1087
1092
  input[type=number] {
1088
1093
  -moz-appearance: textfield;
1089
1094
  }
1090
1095
  .CashierMethodDetails {
1091
1096
  width: 100%;
1092
1097
  height: 100%;
1093
- overflow-y: auto;
1094
1098
  box-sizing: border-box;
1095
- scrollbar-gutter: stable both-edges;
1096
- padding: var(--emw--spacing-large, 20px) var(--emw--spacing-x-small, 10px) var(--emw--spacing-small, 12px) var(--emw--spacing-x-small, 10px);
1097
1099
  container-name: method-details;
1098
1100
  container-type: inline-size;
1101
+ padding: 1px;
1099
1102
  min-height: 200px;
1100
1103
  }
1101
1104
  .ReceiptPage {
@@ -1145,13 +1148,13 @@
1145
1148
  background: var(--emw--color-background, #fff);
1146
1149
  border: 1px solid var(--mmw--color-grey-105, #E8E9EB);
1147
1150
  border-radius: var(--mmw--border-radius-medium-plus, 6px);
1148
-
1151
+
1149
1152
  img {
1150
1153
  max-height: 32px;
1151
1154
  max-width: 56px;
1152
1155
  }
1153
1156
  }
1154
-
1157
+
1155
1158
  .ChangePaymeth {
1156
1159
  margin-left: auto;
1157
1160
  cursor: pointer;
@@ -1159,7 +1162,7 @@
1159
1162
  font-size: var(--emw--font-size-small, 14px);
1160
1163
  text-decoration-line: underline;
1161
1164
  }
1162
-
1165
+
1163
1166
  .SelectedMethodDescription {
1164
1167
  color: var(--mmw--color-grey-290, #666);
1165
1168
  font-size: var(--emw--font-size-x-small, 12px);
@@ -1196,7 +1199,7 @@
1196
1199
  border-radius: var(--emw--border-radius-medium, 4px);
1197
1200
  background: var(--emw--color-primary, #7EC51E);
1198
1201
  }
1199
-
1202
+
1200
1203
  .RedirectionTitle {
1201
1204
  color: var(--mmw--color-grey-10, #111);
1202
1205
  font-size: var(--emw--font-size-x-small, 12px);
@@ -1409,7 +1412,7 @@
1409
1412
  display: block;
1410
1413
  position: absolute;
1411
1414
  top: 50%;
1412
- transform: translateY(-50%);
1415
+ transform: translateY(-50%);
1413
1416
  left: 15px;
1414
1417
  }
1415
1418
  }
@@ -1479,7 +1482,7 @@
1479
1482
  overflow: hidden;
1480
1483
  text-overflow: ellipsis;
1481
1484
  }
1482
-
1485
+
1483
1486
  label, input, .Description, .FormLogo .ChangePaymeth, .OptionList div {
1484
1487
  font-size: var(--emw--font-size-x-small, 12px);
1485
1488
  }