@mxenabled/connect-widget 0.0.14 → 0.0.15

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/index.es.js CHANGED
@@ -5131,39 +5131,23 @@ function baseFindIndex$2(array, predicate, fromIndex, fromRight) {
5131
5131
  }
5132
5132
  var _baseFindIndex = baseFindIndex$2;
5133
5133
 
5134
- var _trimmedEndIndex;
5135
- var hasRequired_trimmedEndIndex;
5136
-
5137
- function require_trimmedEndIndex () {
5138
- if (hasRequired_trimmedEndIndex) return _trimmedEndIndex;
5139
- hasRequired_trimmedEndIndex = 1;
5140
- var reWhitespace = /\s/;
5141
- function trimmedEndIndex(string) {
5142
- var index = string.length;
5143
- while (index-- && reWhitespace.test(string.charAt(index))) {
5144
- }
5145
- return index;
5146
- }
5147
- _trimmedEndIndex = trimmedEndIndex;
5148
- return _trimmedEndIndex;
5134
+ var reWhitespace = /\s/;
5135
+ function trimmedEndIndex$1(string) {
5136
+ var index = string.length;
5137
+ while (index-- && reWhitespace.test(string.charAt(index))) {
5138
+ }
5139
+ return index;
5149
5140
  }
5141
+ var _trimmedEndIndex = trimmedEndIndex$1;
5150
5142
 
5151
- var _baseTrim;
5152
- var hasRequired_baseTrim;
5153
-
5154
- function require_baseTrim () {
5155
- if (hasRequired_baseTrim) return _baseTrim;
5156
- hasRequired_baseTrim = 1;
5157
- var trimmedEndIndex = require_trimmedEndIndex();
5158
- var reTrimStart = /^\s+/;
5159
- function baseTrim(string) {
5160
- return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string;
5161
- }
5162
- _baseTrim = baseTrim;
5163
- return _baseTrim;
5143
+ var trimmedEndIndex = _trimmedEndIndex;
5144
+ var reTrimStart = /^\s+/;
5145
+ function baseTrim$1(string) {
5146
+ return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string;
5164
5147
  }
5148
+ var _baseTrim = baseTrim$1;
5165
5149
 
5166
- var baseTrim = require_baseTrim(), isObject$7 = isObject_1, isSymbol$1 = isSymbol_1;
5150
+ var baseTrim = _baseTrim, isObject$7 = isObject_1, isSymbol$1 = isSymbol_1;
5167
5151
  var NAN = 0 / 0;
5168
5152
  var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
5169
5153
  var reIsBinary = /^0b[01]+$/i;
@@ -8629,7 +8613,7 @@ var hasRequiredTrim;
8629
8613
  function requireTrim () {
8630
8614
  if (hasRequiredTrim) return trim_1;
8631
8615
  hasRequiredTrim = 1;
8632
- var baseToString = _baseToString, baseTrim = require_baseTrim(), castSlice = require_castSlice(), charsEndIndex = require_charsEndIndex(), charsStartIndex = require_charsStartIndex(), stringToArray = require_stringToArray(), toString = toString_1;
8616
+ var baseToString = _baseToString, baseTrim = _baseTrim, castSlice = require_castSlice(), charsEndIndex = require_charsEndIndex(), charsStartIndex = require_charsStartIndex(), stringToArray = require_stringToArray(), toString = toString_1;
8633
8617
  function trim(string, chars, guard) {
8634
8618
  string = toString(string);
8635
8619
  if (string && (guard || chars === void 0)) {
@@ -62348,42 +62332,44 @@ var range_1 = range;
62348
62332
 
62349
62333
  const _range = /*@__PURE__*/getDefaultExportFromCjs(range_1);
62350
62334
 
62351
- const DayOfMonthPicker = (props) => {
62352
- const containerRef = useRef(null);
62353
- const tokens = useTokens();
62354
- const styles = getStyles$8(tokens);
62355
- const getNextDelay = getDelay();
62356
- const days = _range(1, 32);
62357
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { ref: containerRef, children: [
62358
- /* @__PURE__ */ jsxRuntimeExports.jsx(SlideDown, { delay: getNextDelay(), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
62359
- GoBackButton,
62360
- {
62361
- handleGoBack: () => fadeOut(containerRef.current, "up", 300).then(props.handleClose)
62362
- }
62363
- ) }),
62364
- /* @__PURE__ */ jsxRuntimeExports.jsxs(SlideDown, { delay: getNextDelay(), children: [
62365
- /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { "data-test": "date-picker-header", style: styles.title, tag: "h2", children: __("Payment due day") }),
62366
- /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { "data-test": "date-picker-paragraph", style: styles.body, tag: "p", children: __("Choose what day of the month your payment is due.") })
62367
- ] }),
62368
- /* @__PURE__ */ jsxRuntimeExports.jsx(SlideDown, { delay: getNextDelay(), children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { "data-test": "date-picker-calendar", style: styles.buttons, children: days.map((day) => /* @__PURE__ */ jsxRuntimeExports.jsx(
62369
- Button$1,
62370
- {
62371
- autoFocus: day === 1,
62372
- "data-test": `date-picker-button-${day}`,
62373
- name: props.name || day,
62374
- onClick: (e) => {
62375
- e.persist();
62376
- fadeOut(containerRef.current, "up", 300).then(() => props.handleSelect(e));
62335
+ const DayOfMonthPicker = React__default.forwardRef(
62336
+ (props, ref) => {
62337
+ const tokens = useTokens();
62338
+ const styles = getStyles$8(tokens);
62339
+ const getNextDelay = getDelay();
62340
+ const days = _range(1, 32);
62341
+ const containerRef = ref;
62342
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { ref: containerRef, children: [
62343
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SlideDown, { delay: getNextDelay(), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
62344
+ GoBackButton,
62345
+ {
62346
+ handleGoBack: () => fadeOut(containerRef?.current, "up", 300).then(props.handleClose)
62347
+ }
62348
+ ) }),
62349
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(SlideDown, { delay: getNextDelay(), children: [
62350
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { "data-test": "date-picker-header", style: styles.title, tag: "h2", children: __("Payment due day") }),
62351
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { "data-test": "date-picker-paragraph", style: styles.body, tag: "p", children: __("Choose what day of the month your payment is due.") })
62352
+ ] }),
62353
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SlideDown, { delay: getNextDelay(), children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { "data-test": "date-picker-calendar", style: styles.buttons, children: days.map((day) => /* @__PURE__ */ jsxRuntimeExports.jsx(
62354
+ Button,
62355
+ {
62356
+ autoFocus: day === 1,
62357
+ "data-test": `date-picker-button-${day}`,
62358
+ name: props.name || day,
62359
+ onClick: (e) => {
62360
+ e.persist();
62361
+ fadeOut(containerRef?.current, "up", 300).then(() => props.handleSelect(e));
62362
+ },
62363
+ style: styles.button,
62364
+ value: day,
62365
+ variant: "transparent",
62366
+ children: day
62377
62367
  },
62378
- style: styles.button,
62379
- value: day,
62380
- variant: "text",
62381
- children: day
62382
- },
62383
- day
62384
- )) }) })
62385
- ] });
62386
- };
62368
+ day
62369
+ )) }) })
62370
+ ] });
62371
+ }
62372
+ );
62387
62373
  const getStyles$8 = (tokens) => ({
62388
62374
  title: {
62389
62375
  marginBottom: tokens.Spacing.XSmall
@@ -62397,16 +62383,10 @@ const getStyles$8 = (tokens) => ({
62397
62383
  marginTop: tokens.Spacing.XSmall
62398
62384
  },
62399
62385
  button: {
62400
- width: "calc(100%/7)",
62401
- fontSize: "13px",
62402
- minWidth: "auto"
62386
+ width: "14.25%"
62403
62387
  }
62404
62388
  });
62405
- DayOfMonthPicker.propTypes = {
62406
- handleClose: PropTypes$1.func.isRequired,
62407
- handleSelect: PropTypes$1.func.isRequired,
62408
- name: PropTypes$1.string
62409
- };
62389
+ DayOfMonthPicker.displayName = "DayOfMonthPicker";
62410
62390
 
62411
62391
  const ManualAccountForm = React__default.forwardRef(
62412
62392
  (props, ref) => {
@@ -62416,7 +62396,6 @@ const ManualAccountForm = React__default.forwardRef(
62416
62396
  const members = useSelector(getMembers);
62417
62397
  const [saving, setSaving] = useState(false);
62418
62398
  const [isPersonal, setIsPersonal] = useState(true);
62419
- const [showDayPicker, setShowDayPicker] = useState(false);
62420
62399
  const [returnField, setReturnField] = useState(null);
62421
62400
  const [accountCreationError, setAccountCreationError] = useState(null);
62422
62401
  const dispatch = useDispatch();
@@ -62499,17 +62478,18 @@ const ManualAccountForm = React__default.forwardRef(
62499
62478
  return () => createManualAccount$.unsubscribe();
62500
62479
  }, [saving]);
62501
62480
  const shouldFocus = (field, returnField2, i) => returnField2 ? returnField2 === field : i === 0;
62502
- if (showDayPicker) {
62481
+ if (props.showDayPicker) {
62503
62482
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
62504
62483
  DayOfMonthPicker,
62505
62484
  {
62506
62485
  "data-test": "day-of-month-picker",
62507
- handleClose: () => setShowDayPicker(false),
62486
+ handleClose: () => props.setShowDayPicker(false),
62508
62487
  handleSelect: (e) => {
62509
62488
  handleTextInputChange(e);
62510
- setShowDayPicker(false);
62489
+ props.setShowDayPicker(false);
62511
62490
  },
62512
- name: "day_payment_is_due"
62491
+ name: "day_payment_is_due",
62492
+ ref
62513
62493
  }
62514
62494
  );
62515
62495
  }
@@ -62570,11 +62550,11 @@ const ManualAccountForm = React__default.forwardRef(
62570
62550
  name: field.name,
62571
62551
  onChange: () => {
62572
62552
  setReturnField(field.name);
62573
- setShowDayPicker(true);
62553
+ props.setShowDayPicker(true);
62574
62554
  },
62575
62555
  onClick: () => {
62576
62556
  setReturnField(field.name);
62577
- setShowDayPicker(true);
62557
+ props.setShowDayPicker(true);
62578
62558
  },
62579
62559
  value: values[field.name]
62580
62560
  }
@@ -62821,6 +62801,7 @@ const ManualAccountConnect = React__default.forwardRef((props, ref) => {
62821
62801
  const formRef = useRef(null);
62822
62802
  const menuRef = useRef(null);
62823
62803
  const postMessageFunctions = useContext(PostMessageContext);
62804
+ const [showDayPicker, setShowDayPicker] = useState(false);
62824
62805
  const [state, dispatch] = useReducer(reducer$1, {
62825
62806
  showForm: false,
62826
62807
  showSuccess: false,
@@ -62840,13 +62821,13 @@ const ManualAccountConnect = React__default.forwardRef((props, ref) => {
62840
62821
  }
62841
62822
  },
62842
62823
  showBackButton() {
62843
- if (state.showSuccess) {
62824
+ if (state.showSuccess || showDayPicker) {
62844
62825
  return false;
62845
62826
  }
62846
62827
  return menuRef.current || formRef.current;
62847
62828
  }
62848
62829
  };
62849
- }, [state]);
62830
+ }, [state, showDayPicker]);
62850
62831
  const handleAccountTypeSelect = (accountType) => {
62851
62832
  dispatch({ type: Actions.SELECT_ACCOUNT_TYPE, payload: accountType });
62852
62833
  };
@@ -62876,7 +62857,9 @@ const ManualAccountConnect = React__default.forwardRef((props, ref) => {
62876
62857
  handleSuccess: () => {
62877
62858
  dispatch({ type: Actions.HANDLE_SUCCESS });
62878
62859
  },
62879
- ref: formRef
62860
+ ref: formRef,
62861
+ setShowDayPicker,
62862
+ showDayPicker
62880
62863
  }
62881
62864
  ) : /* @__PURE__ */ jsxRuntimeExports.jsx(
62882
62865
  ManualAccountMenu,
@@ -65094,7 +65077,7 @@ const Connect$2 = ({
65094
65077
  }) => {
65095
65078
  const connectConfig = useSelector(selectConnectConfig);
65096
65079
  const loadError = useSelector((state2) => state2.connect.loadError);
65097
- const hasAtriumAPI = useSelector((state2) => state2.profiles.client?.has_atrium_api);
65080
+ const hasAtriumAPI = useSelector((state2) => state2.profiles.client.has_atrium_api);
65098
65081
  const isLoading = useSelector((state2) => state2.connect.isComponentLoading);
65099
65082
  const isMobileWebview = useSelector(selectIsMobileWebView);
65100
65083
  const isVerificationEnabled = useSelector(