@open-tender/store 1.1.25 → 1.1.27

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.
@@ -44,7 +44,7 @@ var SignInPhone = function (_a) {
44
44
  var keypadHandlers = (0, react_1.useMemo)(function () { return ({
45
45
  change: function (value) { return setPhone((0, utils_2.makePhone)(value)); }
46
46
  }); }, []);
47
- var renderKeypad = (0, react_1.useCallback)(function () { return (react_1.default.createElement(Keypad_1.default, { handlers: keypadHandlers, value: phone, children: KeypadView })); }, [KeypadView, phone, keypadHandlers]);
47
+ var renderKeypad = (0, react_1.useCallback)(function () { return (react_1.default.createElement(Keypad_1.default, { type: "numeric", handlers: keypadHandlers, value: phone, children: KeypadView })); }, [KeypadView, phone, keypadHandlers]);
48
48
  var renderErrorMessage = (0, react_1.useCallback)(function (errMsg) { return (react_1.default.createElement(ErrorMessage_1.default, { content: errMsg, children: ErrorMessageView })); }, [ErrorMessageView]);
49
49
  return children({
50
50
  config: config,
@@ -20,27 +20,36 @@ var keypad = {
20
20
  classes: '',
21
21
  props: {},
22
22
  style: {
23
- flexDirection: 'row',
23
+ flexDirection: 'column',
24
24
  flexWrap: 'wrap',
25
25
  width: '100%',
26
26
  gap: 5
27
27
  }
28
28
  },
29
- keypad__button: {
29
+ keypad__buttonsLine: {
30
30
  classes: '',
31
31
  props: {},
32
- style: tslib_1.__assign(tslib_1.__assign({}, styles_1.default.textBody), { flexBasis: '32.42%', color: utils_1.theme.colors.text.primary, fontSize: utils_1.theme.fontSizes.large, aspectRatio: 1.5, backgroundColor: utils_1.theme.colors.background.primary, borderWidth: utils_1.theme.spacing.borderWidth.medium, borderStyle: 'solid', borderColor: utils_1.theme.colors.border.primary, alignItems: 'center', justifyContent: 'center' })
32
+ style: {
33
+ flexDirection: 'row',
34
+ flexWrap: 'nowrap',
35
+ width: '100%',
36
+ gap: 5
37
+ }
33
38
  },
34
- cardLarge: {
39
+ keypad__defaultButton: {
35
40
  classes: '',
36
41
  props: {},
37
- style: {
38
- alignItems: 'stretch',
39
- backgroundColor: utils_1.theme.colors.card.primary,
40
- borderRadius: utils_1.theme.spacing.borderRadius.large,
41
- overflow: 'hidden',
42
- boxShadow: utils_1.theme.colors.boxShadow.primary
43
- }
42
+ style: tslib_1.__assign(tslib_1.__assign({}, styles_1.default.textBody), { flexBasis: '100%', color: utils_1.theme.colors.text.primary, fontSize: utils_1.theme.fontSizes.large, height: 80, backgroundColor: utils_1.theme.colors.background.primary, borderWidth: utils_1.theme.spacing.borderWidth.medium, borderStyle: 'solid', borderColor: utils_1.theme.colors.border.primary, alignItems: 'center', justifyContent: 'center' })
43
+ },
44
+ keypad__numericButton: {
45
+ classes: '',
46
+ props: {},
47
+ style: tslib_1.__assign(tslib_1.__assign({}, styles_1.default.textBody), { flexBasis: '100%', color: utils_1.theme.colors.text.primary, fontSize: utils_1.theme.fontSizes.large, backgroundColor: utils_1.theme.colors.background.primary, borderWidth: utils_1.theme.spacing.borderWidth.medium, borderStyle: 'solid', borderColor: utils_1.theme.colors.border.primary, alignItems: 'center', justifyContent: 'center', aspectRatio: 1.5 })
48
+ },
49
+ keypad__fixedWidthButton: {
50
+ classes: '',
51
+ props: {},
52
+ style: tslib_1.__assign(tslib_1.__assign({}, styles_1.default.textBody), { width: 80, color: utils_1.theme.colors.text.primary, fontSize: utils_1.theme.fontSizes.large, height: 80, backgroundColor: utils_1.theme.colors.background.primary, borderWidth: utils_1.theme.spacing.borderWidth.medium, borderStyle: 'solid', borderColor: utils_1.theme.colors.border.primary, alignItems: 'center', justifyContent: 'center' })
44
53
  }
45
54
  };
46
55
  exports.default = keypad;
@@ -2,12 +2,14 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getKeyboardValue = void 0;
4
4
  var getKeyboardValue = function (key, value, maxLength) {
5
- if (key === 'del')
5
+ if (key === 'Del')
6
6
  return value.slice(0, -1);
7
- else if (key === 'clr')
7
+ else if (key === 'Clr')
8
8
  return '';
9
9
  else if (maxLength && value.length >= maxLength)
10
10
  return value;
11
+ else if (key === 'Space')
12
+ return value + ' ';
11
13
  else
12
14
  return value + key;
13
15
  };
@@ -41,7 +41,7 @@ var SignInPhone = function (_a) {
41
41
  var keypadHandlers = useMemo(function () { return ({
42
42
  change: function (value) { return setPhone(makePhone(value)); }
43
43
  }); }, []);
44
- var renderKeypad = useCallback(function () { return (React.createElement(KeypadContainer, { handlers: keypadHandlers, value: phone, children: KeypadView })); }, [KeypadView, phone, keypadHandlers]);
44
+ var renderKeypad = useCallback(function () { return (React.createElement(KeypadContainer, { type: "numeric", handlers: keypadHandlers, value: phone, children: KeypadView })); }, [KeypadView, phone, keypadHandlers]);
45
45
  var renderErrorMessage = useCallback(function (errMsg) { return (React.createElement(ErrorMessageContainer, { content: errMsg, children: ErrorMessageView })); }, [ErrorMessageView]);
46
46
  return children({
47
47
  config: config,
@@ -18,27 +18,36 @@ var keypad = {
18
18
  classes: '',
19
19
  props: {},
20
20
  style: {
21
- flexDirection: 'row',
21
+ flexDirection: 'column',
22
22
  flexWrap: 'wrap',
23
23
  width: '100%',
24
24
  gap: 5
25
25
  }
26
26
  },
27
- keypad__button: {
27
+ keypad__buttonsLine: {
28
28
  classes: '',
29
29
  props: {},
30
- style: __assign(__assign({}, styles.textBody), { flexBasis: '32.42%', color: theme.colors.text.primary, fontSize: theme.fontSizes.large, aspectRatio: 1.5, backgroundColor: theme.colors.background.primary, borderWidth: theme.spacing.borderWidth.medium, borderStyle: 'solid', borderColor: theme.colors.border.primary, alignItems: 'center', justifyContent: 'center' })
30
+ style: {
31
+ flexDirection: 'row',
32
+ flexWrap: 'nowrap',
33
+ width: '100%',
34
+ gap: 5
35
+ }
31
36
  },
32
- cardLarge: {
37
+ keypad__defaultButton: {
33
38
  classes: '',
34
39
  props: {},
35
- style: {
36
- alignItems: 'stretch',
37
- backgroundColor: theme.colors.card.primary,
38
- borderRadius: theme.spacing.borderRadius.large,
39
- overflow: 'hidden',
40
- boxShadow: theme.colors.boxShadow.primary
41
- }
40
+ style: __assign(__assign({}, styles.textBody), { flexBasis: '100%', color: theme.colors.text.primary, fontSize: theme.fontSizes.large, height: 80, backgroundColor: theme.colors.background.primary, borderWidth: theme.spacing.borderWidth.medium, borderStyle: 'solid', borderColor: theme.colors.border.primary, alignItems: 'center', justifyContent: 'center' })
41
+ },
42
+ keypad__numericButton: {
43
+ classes: '',
44
+ props: {},
45
+ style: __assign(__assign({}, styles.textBody), { flexBasis: '100%', color: theme.colors.text.primary, fontSize: theme.fontSizes.large, backgroundColor: theme.colors.background.primary, borderWidth: theme.spacing.borderWidth.medium, borderStyle: 'solid', borderColor: theme.colors.border.primary, alignItems: 'center', justifyContent: 'center', aspectRatio: 1.5 })
46
+ },
47
+ keypad__fixedWidthButton: {
48
+ classes: '',
49
+ props: {},
50
+ style: __assign(__assign({}, styles.textBody), { width: 80, color: theme.colors.text.primary, fontSize: theme.fontSizes.large, height: 80, backgroundColor: theme.colors.background.primary, borderWidth: theme.spacing.borderWidth.medium, borderStyle: 'solid', borderColor: theme.colors.border.primary, alignItems: 'center', justifyContent: 'center' })
42
51
  }
43
52
  };
44
53
  export default keypad;
@@ -1,10 +1,12 @@
1
1
  export var getKeyboardValue = function (key, value, maxLength) {
2
- if (key === 'del')
2
+ if (key === 'Del')
3
3
  return value.slice(0, -1);
4
- else if (key === 'clr')
4
+ else if (key === 'Clr')
5
5
  return '';
6
6
  else if (maxLength && value.length >= maxLength)
7
7
  return value;
8
+ else if (key === 'Space')
9
+ return value + ' ';
8
10
  else
9
11
  return value + key;
10
12
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-tender/store",
3
- "version": "1.1.25",
3
+ "version": "1.1.27",
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",
@@ -36,7 +36,7 @@
36
36
  "@babel/core": "^7.23.6",
37
37
  "@emotion/react": "^11.11.1",
38
38
  "@open-tender/types": "^0.4.44",
39
- "@open-tender/ui": "^0.3.18",
39
+ "@open-tender/ui": "^0.3.19",
40
40
  "@open-tender/utils": "^0.4.23",
41
41
  "@reduxjs/toolkit": "^2.0.1",
42
42
  "@types/react": "^18.2.45",
@@ -65,7 +65,7 @@
65
65
  "peerDependencies": {
66
66
  "@emotion/react": "^11.11.1",
67
67
  "@open-tender/types": "^0.4.43",
68
- "@open-tender/ui": "^0.3.18",
68
+ "@open-tender/ui": "^0.3.19",
69
69
  "@open-tender/utils": "^0.4.23",
70
70
  "@reduxjs/toolkit": "^2.0.1",
71
71
  "date-fns": "2.30.0",