@jobber/components 6.111.0 → 6.111.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.
|
@@ -197,6 +197,7 @@ function useAutocompleteListNav({ navigableCount, shouldResetActiveIndexOnClose,
|
|
|
197
197
|
return prev >= navigableCount ? navigableCount - 1 : prev;
|
|
198
198
|
});
|
|
199
199
|
}, [navigableCount, setActiveIndex, listRef]);
|
|
200
|
+
const setReferenceElement = React.useCallback((el) => refs.setReference(el), [refs]);
|
|
200
201
|
return {
|
|
201
202
|
refs,
|
|
202
203
|
floatingStyles,
|
|
@@ -209,7 +210,7 @@ function useAutocompleteListNav({ navigableCount, shouldResetActiveIndexOnClose,
|
|
|
209
210
|
listRef,
|
|
210
211
|
open,
|
|
211
212
|
setOpen,
|
|
212
|
-
setReferenceElement
|
|
213
|
+
setReferenceElement,
|
|
213
214
|
};
|
|
214
215
|
}
|
|
215
216
|
|
|
@@ -968,7 +969,7 @@ function AutocompleteRebuiltInternal(props, forwardedRef) {
|
|
|
968
969
|
disabled, readOnly: props.readOnly, error: error !== null && error !== void 0 ? error : undefined, name: props.name, invalid, autoComplete: "off", autoFocus: props.autoFocus, description, size: sizeProp ? sizeProp : undefined, prefix: props.prefix, suffix: props.suffix }), (props.readOnly ? {} : composedReferenceProps)), { role: "combobox", "aria-autocomplete": "list", "aria-expanded": open ? true : false, "aria-controls": listboxId, "aria-activedescendant": open && activeIndex != null
|
|
969
970
|
? `${listboxId}-item-${activeIndex}`
|
|
970
971
|
: undefined }), dataAttrs);
|
|
971
|
-
const referenceInputRef = (node) => {
|
|
972
|
+
const referenceInputRef = React.useCallback((node) => {
|
|
972
973
|
setReferenceElement(node);
|
|
973
974
|
// Workaround to get the width of the visual InputText element, which is not the same as
|
|
974
975
|
// the literal input reference element when props like suffix/prefix/clearable are present.
|
|
@@ -977,11 +978,11 @@ function AutocompleteRebuiltInternal(props, forwardedRef) {
|
|
|
977
978
|
setMenuWidth(visualInputTextElement.clientWidth);
|
|
978
979
|
setPositionRefEl(visualInputTextElement);
|
|
979
980
|
}
|
|
980
|
-
};
|
|
981
|
-
const mergedInputRef = FormField.mergeRefs([
|
|
981
|
+
}, [setReferenceElement]);
|
|
982
|
+
const mergedInputRef = React.useMemo(() => FormField.mergeRefs([
|
|
982
983
|
referenceInputRef,
|
|
983
984
|
forwardedRef,
|
|
984
|
-
]);
|
|
985
|
+
]), [referenceInputRef, forwardedRef]);
|
|
985
986
|
React.useEffect(() => {
|
|
986
987
|
if (!positionRefEl)
|
|
987
988
|
return;
|
|
@@ -195,6 +195,7 @@ function useAutocompleteListNav({ navigableCount, shouldResetActiveIndexOnClose,
|
|
|
195
195
|
return prev >= navigableCount ? navigableCount - 1 : prev;
|
|
196
196
|
});
|
|
197
197
|
}, [navigableCount, setActiveIndex, listRef]);
|
|
198
|
+
const setReferenceElement = useCallback((el) => refs.setReference(el), [refs]);
|
|
198
199
|
return {
|
|
199
200
|
refs,
|
|
200
201
|
floatingStyles,
|
|
@@ -207,7 +208,7 @@ function useAutocompleteListNav({ navigableCount, shouldResetActiveIndexOnClose,
|
|
|
207
208
|
listRef,
|
|
208
209
|
open,
|
|
209
210
|
setOpen,
|
|
210
|
-
setReferenceElement
|
|
211
|
+
setReferenceElement,
|
|
211
212
|
};
|
|
212
213
|
}
|
|
213
214
|
|
|
@@ -966,7 +967,7 @@ function AutocompleteRebuiltInternal(props, forwardedRef) {
|
|
|
966
967
|
disabled, readOnly: props.readOnly, error: error !== null && error !== void 0 ? error : undefined, name: props.name, invalid, autoComplete: "off", autoFocus: props.autoFocus, description, size: sizeProp ? sizeProp : undefined, prefix: props.prefix, suffix: props.suffix }), (props.readOnly ? {} : composedReferenceProps)), { role: "combobox", "aria-autocomplete": "list", "aria-expanded": open ? true : false, "aria-controls": listboxId, "aria-activedescendant": open && activeIndex != null
|
|
967
968
|
? `${listboxId}-item-${activeIndex}`
|
|
968
969
|
: undefined }), dataAttrs);
|
|
969
|
-
const referenceInputRef = (node) => {
|
|
970
|
+
const referenceInputRef = useCallback((node) => {
|
|
970
971
|
setReferenceElement(node);
|
|
971
972
|
// Workaround to get the width of the visual InputText element, which is not the same as
|
|
972
973
|
// the literal input reference element when props like suffix/prefix/clearable are present.
|
|
@@ -975,11 +976,11 @@ function AutocompleteRebuiltInternal(props, forwardedRef) {
|
|
|
975
976
|
setMenuWidth(visualInputTextElement.clientWidth);
|
|
976
977
|
setPositionRefEl(visualInputTextElement);
|
|
977
978
|
}
|
|
978
|
-
};
|
|
979
|
-
const mergedInputRef = mergeRefs([
|
|
979
|
+
}, [setReferenceElement]);
|
|
980
|
+
const mergedInputRef = useMemo(() => mergeRefs([
|
|
980
981
|
referenceInputRef,
|
|
981
982
|
forwardedRef,
|
|
982
|
-
]);
|
|
983
|
+
]), [referenceInputRef, forwardedRef]);
|
|
983
984
|
useEffect(() => {
|
|
984
985
|
if (!positionRefEl)
|
|
985
986
|
return;
|
|
@@ -39,7 +39,7 @@ function SortIcon({ direction }) {
|
|
|
39
39
|
React.createElement("path", { className: finalStyle.downArrowStyle, d: "M8.29292 13.3339C8.68345 12.9434 9.31661 12.9434 9.70714 13.3339L12.2968 15.8573L14.8787 13.3339C15.2692 12.9434 15.9024 12.9434 16.2929 13.3339C16.6834 13.7244 16.6834 14.3576 16.2929 14.7481L13 18.041C12.6095 18.4315 11.9763 18.4315 11.5858 18.041L8.29292 14.7481C7.9024 14.3576 7.9024 13.7244 8.29292 13.3339Z" }))));
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
var styles = {"container":"_1-DPmbxOkZ8-","tableElement":"kJeYcsgg700-","header":"_5d2OcsTVgzU-","headerCell":"LTx0tCU3F2I-","sortableButton":"WTQCrd2d8nw-","focusArea":"RipbH3rRU-E-","row":"sJQbtw-NEHU-","cell":"_1UpLYTK64uY-","footer":"qe-6UrAFLTo-","actions":"_2fZsLSaNPnI-","rowActions":"pElxuwpGmCI-","pagination":"thJ-CSoe0ps-","spinning":"EBpmC7cZzCs-"};
|
|
42
|
+
var styles = {"container":"_1-DPmbxOkZ8-","tableElement":"kJeYcsgg700-","header":"_5d2OcsTVgzU-","headerCell":"LTx0tCU3F2I-","sortableButton":"WTQCrd2d8nw-","focusArea":"RipbH3rRU-E-","row":"sJQbtw-NEHU-","clickableRow":"J2p1EeT252A-","cell":"_1UpLYTK64uY-","footer":"qe-6UrAFLTo-","actions":"_2fZsLSaNPnI-","rowActions":"pElxuwpGmCI-","pagination":"thJ-CSoe0ps-","spinning":"EBpmC7cZzCs-"};
|
|
43
43
|
|
|
44
44
|
function DataTableActions(props) {
|
|
45
45
|
return (React.createElement("div", Object.assign({}, props, { className: classnames(styles.actions, props.className) }), props.children));
|
|
@@ -83,8 +83,9 @@ function DataTablePaginationButton({ direction, onClick, disabled = false, ariaL
|
|
|
83
83
|
return (React.createElement(Button.Button, { label: "", onClick: onClick, icon: isNext ? "arrowRight" : "arrowLeft", type: "secondary", variation: "learning", disabled: disabled, ariaLabel: ariaLabel(direction) }));
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
const DataTableRow = React.forwardRef((
|
|
87
|
-
|
|
86
|
+
const DataTableRow = React.forwardRef((_a, ref) => {
|
|
87
|
+
var { className } = _a, props = tslib_es6.__rest(_a, ["className"]);
|
|
88
|
+
return (React.createElement("tr", Object.assign({}, props, { className: classnames(styles.row, props.onClick && styles.clickableRow, className), ref: ref }), props.children));
|
|
88
89
|
});
|
|
89
90
|
DataTableRow.displayName = "DataTableRow";
|
|
90
91
|
|
|
@@ -37,7 +37,7 @@ function SortIcon({ direction }) {
|
|
|
37
37
|
React__default.createElement("path", { className: finalStyle.downArrowStyle, d: "M8.29292 13.3339C8.68345 12.9434 9.31661 12.9434 9.70714 13.3339L12.2968 15.8573L14.8787 13.3339C15.2692 12.9434 15.9024 12.9434 16.2929 13.3339C16.6834 13.7244 16.6834 14.3576 16.2929 14.7481L13 18.041C12.6095 18.4315 11.9763 18.4315 11.5858 18.041L8.29292 14.7481C7.9024 14.3576 7.9024 13.7244 8.29292 13.3339Z" }))));
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
var styles = {"container":"_1-DPmbxOkZ8-","tableElement":"kJeYcsgg700-","header":"_5d2OcsTVgzU-","headerCell":"LTx0tCU3F2I-","sortableButton":"WTQCrd2d8nw-","focusArea":"RipbH3rRU-E-","row":"sJQbtw-NEHU-","cell":"_1UpLYTK64uY-","footer":"qe-6UrAFLTo-","actions":"_2fZsLSaNPnI-","rowActions":"pElxuwpGmCI-","pagination":"thJ-CSoe0ps-","spinning":"EBpmC7cZzCs-"};
|
|
40
|
+
var styles = {"container":"_1-DPmbxOkZ8-","tableElement":"kJeYcsgg700-","header":"_5d2OcsTVgzU-","headerCell":"LTx0tCU3F2I-","sortableButton":"WTQCrd2d8nw-","focusArea":"RipbH3rRU-E-","row":"sJQbtw-NEHU-","clickableRow":"J2p1EeT252A-","cell":"_1UpLYTK64uY-","footer":"qe-6UrAFLTo-","actions":"_2fZsLSaNPnI-","rowActions":"pElxuwpGmCI-","pagination":"thJ-CSoe0ps-","spinning":"EBpmC7cZzCs-"};
|
|
41
41
|
|
|
42
42
|
function DataTableActions(props) {
|
|
43
43
|
return (React__default.createElement("div", Object.assign({}, props, { className: classnames(styles.actions, props.className) }), props.children));
|
|
@@ -81,8 +81,9 @@ function DataTablePaginationButton({ direction, onClick, disabled = false, ariaL
|
|
|
81
81
|
return (React__default.createElement(Button, { label: "", onClick: onClick, icon: isNext ? "arrowRight" : "arrowLeft", type: "secondary", variation: "learning", disabled: disabled, ariaLabel: ariaLabel(direction) }));
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
const DataTableRow = forwardRef((
|
|
85
|
-
|
|
84
|
+
const DataTableRow = forwardRef((_a, ref) => {
|
|
85
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
86
|
+
return (React__default.createElement("tr", Object.assign({}, props, { className: classnames(styles.row, props.onClick && styles.clickableRow, className), ref: ref }), props.children));
|
|
86
87
|
});
|
|
87
88
|
DataTableRow.displayName = "DataTableRow";
|
|
88
89
|
|
package/dist/styles.css
CHANGED
|
@@ -6702,7 +6702,11 @@ a._7BLGtYNuJOU-.zgRx3ehZ2z8-:hover {
|
|
|
6702
6702
|
position: relative;
|
|
6703
6703
|
}
|
|
6704
6704
|
|
|
6705
|
-
.sJQbtw-NEHU
|
|
6705
|
+
.sJQbtw-NEHU-.J2p1EeT252A- {
|
|
6706
|
+
cursor: pointer;
|
|
6707
|
+
}
|
|
6708
|
+
|
|
6709
|
+
.kJeYcsgg700- tbody tr.sJQbtw-NEHU-.J2p1EeT252A-:hover {
|
|
6706
6710
|
background-color: hsl(53, 21%, 93%);
|
|
6707
6711
|
background-color: var(--color-surface--hover);
|
|
6708
6712
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jobber/components",
|
|
3
|
-
"version": "6.111.
|
|
3
|
+
"version": "6.111.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -538,5 +538,5 @@
|
|
|
538
538
|
"> 1%",
|
|
539
539
|
"IE 10"
|
|
540
540
|
],
|
|
541
|
-
"gitHead": "
|
|
541
|
+
"gitHead": "1baaa9f24017f50d12130e779b621a7c971723ef"
|
|
542
542
|
}
|