@jobber/components 4.4.5 → 4.4.6-jeff.10
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/Autocomplete/index.js +2 -2
- package/dist/Chips/index.js +1 -1
- package/dist/DataTable/index.js +2 -2
- package/dist/FormField/index.js +1 -1
- package/dist/{FormField-bdfb7a5a.js → FormField-db4b9e0d.js} +3 -2
- package/dist/InputDate/index.js +8 -3
- package/dist/InputEmail/index.js +1 -1
- package/dist/InputNumber/index.js +1 -1
- package/dist/InputPassword/index.js +1 -1
- package/dist/InputText/index.js +2 -2
- package/dist/{InputText-c056703c.js → InputText-87d76eac.js} +1 -1
- package/dist/InputTime/index.js +1 -1
- package/dist/{Option-73a5502d.js → Option-6eee901f.js} +1 -1
- package/dist/Select/index.js +2 -2
- package/package.json +5 -5
|
@@ -11,10 +11,10 @@ var useEventListener = require('@use-it/event-listener');
|
|
|
11
11
|
var Text = require('../Text-668ba4fe.js');
|
|
12
12
|
var Icon = require('../Icon-405a216c.js');
|
|
13
13
|
var Heading = require('../Heading-4dc407a9.js');
|
|
14
|
-
var InputText = require('../InputText-
|
|
14
|
+
var InputText = require('../InputText-87d76eac.js');
|
|
15
15
|
require('../Typography-1aeeb56e.js');
|
|
16
16
|
require('@jobber/design');
|
|
17
|
-
require('../FormField-
|
|
17
|
+
require('../FormField-db4b9e0d.js');
|
|
18
18
|
require('uuid');
|
|
19
19
|
require('react-hook-form');
|
|
20
20
|
require('../Button-e2452625.js');
|
package/dist/Chips/index.js
CHANGED
|
@@ -492,7 +492,7 @@ function InternalChipDismissibleInput(props) {
|
|
|
492
492
|
function InternalChipDismissible(props) {
|
|
493
493
|
const { availableChipOptions, ref: wrapperRef, sortedVisibleChipOptions, handleChipAdd, handleChipClick, handleChipKeyDown, handleChipRemove, handleCustomAdd, handleWrapperKeyDown, } = useInternalChipDismissible(props);
|
|
494
494
|
return (React__default["default"].createElement("div", { ref: wrapperRef, className: styles.wrapper, "data-testid": "dismissible-chips", onKeyDown: handleWrapperKeyDown, role: "listbox" },
|
|
495
|
-
sortedVisibleChipOptions.map(chip => (React__default["default"].createElement(InternalChip, Object.assign({ key: chip.value }, chip, { onKeyDown: handleChipKeyDown(chip.value), onClick: handleChipClick(chip.value), ariaLabel: `${chip.
|
|
495
|
+
sortedVisibleChipOptions.map(chip => (React__default["default"].createElement(InternalChip, Object.assign({ key: chip.value }, chip, { onKeyDown: handleChipKeyDown(chip.value), onClick: handleChipClick(chip.value), ariaLabel: `${chip.label}. Press delete or backspace to remove ${chip.label}`, tabIndex: 0, suffix: React__default["default"].createElement(InternalChipButton, { icon: "remove", invalid: chip.invalid, disabled: chip.disabled, label: chip.label, onClick: handleChipRemove(chip.value) }) })))),
|
|
496
496
|
React__default["default"].createElement(InternalChipDismissibleInput, { activator: props.activator, attachTo: wrapperRef, isLoadingMore: props.isLoadingMore, options: availableChipOptions, onOptionSelect: handleChipAdd, onCustomOptionSelect: handleCustomAdd, onSearch: props.onSearch, onLoadMore: props.onLoadMore })));
|
|
497
497
|
}
|
|
498
498
|
|
package/dist/DataTable/index.js
CHANGED
|
@@ -8,10 +8,10 @@ var React = require('react');
|
|
|
8
8
|
var jobberHooks = require('@jobber/hooks');
|
|
9
9
|
var styleInject_es = require('../style-inject.es-9d2f5f4e.js');
|
|
10
10
|
var tslib_es6 = require('../tslib.es6-5b8768b7.js');
|
|
11
|
-
var Option = require('../Option-
|
|
11
|
+
var Option = require('../Option-6eee901f.js');
|
|
12
12
|
var Button = require('../Button-e2452625.js');
|
|
13
13
|
var Text = require('../Text-668ba4fe.js');
|
|
14
|
-
require('../FormField-
|
|
14
|
+
require('../FormField-db4b9e0d.js');
|
|
15
15
|
require('uuid');
|
|
16
16
|
require('react-hook-form');
|
|
17
17
|
require('../Icon-405a216c.js');
|
package/dist/FormField/index.js
CHANGED
|
@@ -118,7 +118,8 @@ function FormField(props) {
|
|
|
118
118
|
const { actionsRef, autocomplete = true, children, defaultValue, description, disabled, inputRef, inline, keyboard, max, maxLength, min, name, readonly, rows, loading, type = "text", validations, value, onChange, onEnter, onFocus, onBlur, onValidation, } = props;
|
|
119
119
|
const { control, errors, setValue, watch } = reactHookForm.useFormContext() != undefined
|
|
120
120
|
? reactHookForm.useFormContext()
|
|
121
|
-
:
|
|
121
|
+
: // If there isn't a Form Context being provided, get a form for this field.
|
|
122
|
+
reactHookForm.useForm({ mode: "onTouched" });
|
|
122
123
|
const [identifier] = React.useState(uuid.v1());
|
|
123
124
|
const [descriptionIdentifier] = React.useState(`descriptionUUID--${uuid.v1()}`);
|
|
124
125
|
/**
|
|
@@ -134,7 +135,7 @@ function FormField(props) {
|
|
|
134
135
|
}, [value, watch(controlledName)]);
|
|
135
136
|
React.useImperativeHandle(actionsRef, () => ({
|
|
136
137
|
setValue: newValue => {
|
|
137
|
-
setValue(controlledName, newValue);
|
|
138
|
+
setValue(controlledName, newValue, { shouldValidate: true });
|
|
138
139
|
},
|
|
139
140
|
}));
|
|
140
141
|
const error = errors[controlledName] && errors[controlledName].message;
|
package/dist/InputDate/index.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var lodash = require('lodash');
|
|
6
6
|
var React = require('react');
|
|
7
|
-
var FormField = require('../FormField-
|
|
7
|
+
var FormField = require('../FormField-db4b9e0d.js');
|
|
8
8
|
var DatePicker = require('../DatePicker-90fd1823.js');
|
|
9
9
|
require('../tslib.es6-5b8768b7.js');
|
|
10
10
|
require('uuid');
|
|
@@ -28,20 +28,25 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
28
28
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
29
29
|
|
|
30
30
|
function InputDate(inputProps) {
|
|
31
|
-
|
|
31
|
+
const formFieldActionsRef = React.useRef(null);
|
|
32
|
+
return (React__default["default"].createElement(DatePicker.DatePicker, { selected: inputProps.value, onChange: inputProps === null || inputProps === void 0 ? void 0 : inputProps.onChange, disabled: inputProps.disabled, readonly: inputProps.readonly, fullWidth: !inputProps.inline, minDate: inputProps.minDate, maxDate: inputProps.maxDate, smartAutofocus: false, activator: activatorProps => {
|
|
33
|
+
var _a;
|
|
32
34
|
const { onChange, onClick, value } = activatorProps;
|
|
33
35
|
const newActivatorProps = lodash.omit(activatorProps, ["activator"]);
|
|
34
36
|
const suffix = Object.assign({ icon: "calendar" }, (onClick && {
|
|
35
37
|
onClick: onClick,
|
|
36
38
|
ariaLabel: "Show calendar",
|
|
37
39
|
}));
|
|
40
|
+
// Set form field to formatted date string immediately, to avoid validations
|
|
41
|
+
// triggering incorrectly when it blurs (to handle the datepicker UI click)
|
|
42
|
+
value && ((_a = formFieldActionsRef.current) === null || _a === void 0 ? void 0 : _a.setValue(value));
|
|
38
43
|
return (React__default["default"].createElement(FormField.FormField, Object.assign({}, newActivatorProps, inputProps, { value: value, onChange: (_, event) => onChange && onChange(event), onBlur: () => {
|
|
39
44
|
inputProps.onBlur && inputProps.onBlur();
|
|
40
45
|
activatorProps.onBlur && activatorProps.onBlur();
|
|
41
46
|
}, onFocus: () => {
|
|
42
47
|
inputProps.onFocus && inputProps.onFocus();
|
|
43
48
|
activatorProps.onFocus && activatorProps.onFocus();
|
|
44
|
-
}, suffix: suffix })));
|
|
49
|
+
}, actionsRef: formFieldActionsRef, suffix: suffix })));
|
|
45
50
|
} }));
|
|
46
51
|
}
|
|
47
52
|
|
package/dist/InputEmail/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
|
-
var FormField = require('../FormField-
|
|
6
|
+
var FormField = require('../FormField-db4b9e0d.js');
|
|
7
7
|
require('../tslib.es6-5b8768b7.js');
|
|
8
8
|
require('uuid');
|
|
9
9
|
require('react-hook-form');
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
|
-
var FormField = require('../FormField-
|
|
6
|
+
var FormField = require('../FormField-db4b9e0d.js');
|
|
7
7
|
require('../tslib.es6-5b8768b7.js');
|
|
8
8
|
require('uuid');
|
|
9
9
|
require('react-hook-form');
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
|
-
var FormField = require('../FormField-
|
|
6
|
+
var FormField = require('../FormField-db4b9e0d.js');
|
|
7
7
|
require('../tslib.es6-5b8768b7.js');
|
|
8
8
|
require('uuid');
|
|
9
9
|
require('react-hook-form');
|
package/dist/InputText/index.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var InputText = require('../InputText-
|
|
5
|
+
var InputText = require('../InputText-87d76eac.js');
|
|
6
6
|
require('react');
|
|
7
|
-
require('../FormField-
|
|
7
|
+
require('../FormField-db4b9e0d.js');
|
|
8
8
|
require('../tslib.es6-5b8768b7.js');
|
|
9
9
|
require('uuid');
|
|
10
10
|
require('react-hook-form');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var React = require('react');
|
|
4
|
-
var FormField = require('./FormField-
|
|
4
|
+
var FormField = require('./FormField-db4b9e0d.js');
|
|
5
5
|
|
|
6
6
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
7
7
|
|
package/dist/InputTime/index.js
CHANGED
|
@@ -6,7 +6,7 @@ var tslib_es6 = require('../tslib.es6-5b8768b7.js');
|
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var debounce = require('lodash/debounce');
|
|
8
8
|
var temporal = require('@std-proposal/temporal');
|
|
9
|
-
var FormField = require('../FormField-
|
|
9
|
+
var FormField = require('../FormField-db4b9e0d.js');
|
|
10
10
|
require('uuid');
|
|
11
11
|
require('react-hook-form');
|
|
12
12
|
require('../style-inject.es-9d2f5f4e.js');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var React = require('react');
|
|
4
|
-
var FormField = require('./FormField-
|
|
4
|
+
var FormField = require('./FormField-db4b9e0d.js');
|
|
5
5
|
|
|
6
6
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
7
7
|
|
package/dist/Select/index.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var Option = require('../Option-
|
|
5
|
+
var Option = require('../Option-6eee901f.js');
|
|
6
6
|
require('react');
|
|
7
|
-
require('../FormField-
|
|
7
|
+
require('../FormField-db4b9e0d.js');
|
|
8
8
|
require('../tslib.es6-5b8768b7.js');
|
|
9
9
|
require('uuid');
|
|
10
10
|
require('react-hook-form');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jobber/components",
|
|
3
|
-
"version": "4.4.
|
|
3
|
+
"version": "4.4.6-jeff.10+8c8e89f1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
"dist/*"
|
|
18
18
|
],
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@jobber/design": "^0.31.
|
|
21
|
-
"@jobber/formatters": "
|
|
22
|
-
"@jobber/hooks": "
|
|
20
|
+
"@jobber/design": "^0.31.2-jeff.16+8c8e89f1",
|
|
21
|
+
"@jobber/formatters": "^0.2.2",
|
|
22
|
+
"@jobber/hooks": "^2.0.2",
|
|
23
23
|
"@popperjs/core": "^2.0.6",
|
|
24
24
|
"@std-proposal/temporal": "0.0.1",
|
|
25
25
|
"@tanstack/react-table": "8.5.13",
|
|
@@ -81,5 +81,5 @@
|
|
|
81
81
|
"> 1%",
|
|
82
82
|
"IE 10"
|
|
83
83
|
],
|
|
84
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "8c8e89f15a412cbdb83fb81acaa75611d72ff35e"
|
|
85
85
|
}
|