@open-tender/store 0.1.300 → 0.1.301

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.
@@ -1,11 +1,14 @@
1
1
  import { Handlers, KeypadProps, KeypadType } from '@open-tender/ui';
2
2
  import { ReactNode } from 'react';
3
- declare const Keypad: ({ children, maxLength, type, value, handlers, isEmail }: {
4
- children: (props: KeypadProps) => ReactNode;
3
+ declare const Keypad: ({ children, maxLength, type, value, handlers, isEmail, autoCapitalize }: {
4
+ children: (props: KeypadProps & {
5
+ autoCapitalize?: boolean;
6
+ }) => ReactNode;
5
7
  maxLength?: number;
6
8
  type?: KeypadType;
7
9
  value: string;
8
10
  handlers: Handlers;
9
11
  isEmail?: boolean;
12
+ autoCapitalize?: boolean;
10
13
  }) => ReactNode;
11
14
  export default Keypad;
@@ -5,11 +5,11 @@ var hooks_1 = require("../app/hooks");
5
5
  var slices_1 = require("../slices");
6
6
  var utils_1 = require("../utils");
7
7
  var Keypad = function (_a) {
8
- var children = _a.children, maxLength = _a.maxLength, type = _a.type, value = _a.value, handlers = _a.handlers, isEmail = _a.isEmail;
9
- var _b = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig), keypad = _b.keypad, numpad = _b.numpad;
8
+ var children = _a.children, maxLength = _a.maxLength, type = _a.type, value = _a.value, handlers = _a.handlers, isEmail = _a.isEmail, _b = _a.autoCapitalize, autoCapitalize = _b === void 0 ? false : _b;
9
+ var _c = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig), keypad = _c.keypad, numpad = _c.numpad;
10
10
  var isDollar = type === 'dollar';
11
11
  var config = type === 'numeric' || isDollar ? numpad : keypad;
12
- var _c = (0, react_1.useState)(false), isShiftOn = _c[0], setIsShiftOn = _c[1];
12
+ var _d = (0, react_1.useState)(false), isShiftOn = _d[0], setIsShiftOn = _d[1];
13
13
  var handleOnKeyPress = (0, react_1.useCallback)(function (key) {
14
14
  setIsShiftOn(function (prev) { return (key === '\u21E7' ? !prev : prev); });
15
15
  handlers.change((0, utils_1.getKeyboardValue)(key, value, maxLength, isShiftOn));
@@ -23,7 +23,8 @@ var Keypad = function (_a) {
23
23
  value: value,
24
24
  type: type,
25
25
  isEmail: isEmail,
26
- isShiftOn: isShiftOn
26
+ isShiftOn: isShiftOn,
27
+ autoCapitalize: autoCapitalize
27
28
  });
28
29
  };
29
30
  exports.default = Keypad;
@@ -1,11 +1,14 @@
1
1
  import { Handlers, KeypadProps, KeypadType } from '@open-tender/ui';
2
2
  import { ReactNode } from 'react';
3
- declare const Keypad: ({ children, maxLength, type, value, handlers, isEmail }: {
4
- children: (props: KeypadProps) => ReactNode;
3
+ declare const Keypad: ({ children, maxLength, type, value, handlers, isEmail, autoCapitalize }: {
4
+ children: (props: KeypadProps & {
5
+ autoCapitalize?: boolean;
6
+ }) => ReactNode;
5
7
  maxLength?: number;
6
8
  type?: KeypadType;
7
9
  value: string;
8
10
  handlers: Handlers;
9
11
  isEmail?: boolean;
12
+ autoCapitalize?: boolean;
10
13
  }) => ReactNode;
11
14
  export default Keypad;
@@ -3,11 +3,11 @@ import { useAppSelector } from '../app/hooks';
3
3
  import { selectKioskConfig } from '../slices';
4
4
  import { getKeyboardValue } from '../utils';
5
5
  var Keypad = function (_a) {
6
- var children = _a.children, maxLength = _a.maxLength, type = _a.type, value = _a.value, handlers = _a.handlers, isEmail = _a.isEmail;
7
- var _b = useAppSelector(selectKioskConfig), keypad = _b.keypad, numpad = _b.numpad;
6
+ var children = _a.children, maxLength = _a.maxLength, type = _a.type, value = _a.value, handlers = _a.handlers, isEmail = _a.isEmail, _b = _a.autoCapitalize, autoCapitalize = _b === void 0 ? false : _b;
7
+ var _c = useAppSelector(selectKioskConfig), keypad = _c.keypad, numpad = _c.numpad;
8
8
  var isDollar = type === 'dollar';
9
9
  var config = type === 'numeric' || isDollar ? numpad : keypad;
10
- var _c = useState(false), isShiftOn = _c[0], setIsShiftOn = _c[1];
10
+ var _d = useState(false), isShiftOn = _d[0], setIsShiftOn = _d[1];
11
11
  var handleOnKeyPress = useCallback(function (key) {
12
12
  setIsShiftOn(function (prev) { return (key === '\u21E7' ? !prev : prev); });
13
13
  handlers.change(getKeyboardValue(key, value, maxLength, isShiftOn));
@@ -21,7 +21,8 @@ var Keypad = function (_a) {
21
21
  value: value,
22
22
  type: type,
23
23
  isEmail: isEmail,
24
- isShiftOn: isShiftOn
24
+ isShiftOn: isShiftOn,
25
+ autoCapitalize: autoCapitalize
25
26
  });
26
27
  };
27
28
  export default Keypad;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-tender/store",
3
- "version": "0.1.300",
3
+ "version": "0.1.301",
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",