@synerise/ds-utils 1.0.1 → 1.1.0
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/CHANGELOG.md +17 -0
- package/dist/focusWithArrowKeys/focusWithArrowKeys.js +2 -0
- package/dist/index.d.ts +1 -1
- package/dist/testing/renderWithLocalesLoaded/renderWithLocalesLoaded.js +2 -2
- package/dist/testing/renderWithProvider/renderWithProvider.d.ts +2 -4
- package/dist/testing/renderWithProvider/renderWithProvider.js +14 -13
- package/dist/types/types.d.ts +6 -1
- package/dist/useBreakpoint/useBreakpoint.js +1 -1
- package/dist/useElementInView/useElementInView.js +1 -1
- package/dist/useSearchResults/useSearchResults.js +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,23 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [1.1.0](https://github.com/synerise/synerise-design/compare/@synerise/ds-utils@1.0.1...@synerise/ds-utils@1.1.0) (2025-05-07)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **item-picker:** focus in search on section change ([9b41649](https://github.com/synerise/synerise-design/commit/9b416499c0cb2fa78447eb5769ae9f9a0f35b6d4))
|
|
12
|
+
* **table:** update batch selection for table with limit ([a63698a](https://github.com/synerise/synerise-design/commit/a63698adf24e59aa3b220f3840ecdc43d60d62a5))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* **toast:** toast component ([0cb20d0](https://github.com/synerise/synerise-design/commit/0cb20d07b48d1c768a0ddf133b1970a4a13444ca))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
6
23
|
## [1.0.1](https://github.com/synerise/synerise-design/compare/@synerise/ds-utils@1.0.0...@synerise/ds-utils@1.0.1) (2025-03-18)
|
|
7
24
|
|
|
8
25
|
**Note:** Version bump only for package @synerise/ds-utils
|
|
@@ -31,6 +31,8 @@ var focusWithArrowKeys = function focusWithArrowKeys(keyDownEvent, focusableItem
|
|
|
31
31
|
if (isItemFocused) {
|
|
32
32
|
var prevSibling = activeElement.previousElementSibling;
|
|
33
33
|
_elementToFocusOn = prevSibling !== null && hasFocusableElementInside(prevSibling, selector) ? prevSibling : focusableElements[activeElementIndex - 1];
|
|
34
|
+
} else {
|
|
35
|
+
_elementToFocusOn = focusableElements[focusableElements.length - 1];
|
|
34
36
|
}
|
|
35
37
|
if (_elementToFocusOn) {
|
|
36
38
|
_elementToFocusOn.focus();
|
package/dist/index.d.ts
CHANGED
|
@@ -22,4 +22,4 @@ export * from './useTraceUpdate';
|
|
|
22
22
|
export * from './getPopupContainer';
|
|
23
23
|
export declare const NOOP: () => void;
|
|
24
24
|
export type { HandledEventsType } from './useOnClickOutside/useOnClickOutside';
|
|
25
|
-
export type { ExactlyOne, LiteralStringUnion, WithHTMLAttributes, DeepPartial } from './types/types';
|
|
25
|
+
export type { DataAttributes, ExactlyOne, LiteralStringUnion, WithHTMLAttributes, DeepPartial, RequiredProps, } from './types/types';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { render } from '@testing-library/react';
|
|
4
4
|
import { DSProvider } from '@synerise/ds-core';
|
|
@@ -17,7 +17,7 @@ var renderWithLocalesLoaded = function renderWithLocalesLoaded(node, options, pr
|
|
|
17
17
|
}
|
|
18
18
|
}));
|
|
19
19
|
};
|
|
20
|
-
var rendered = render(
|
|
20
|
+
var rendered = render(/*#__PURE__*/React.createElement(DSProvider, _extends({
|
|
21
21
|
locale: (_props$locale = props == null ? void 0 : props.locale) != null ? _props$locale : undefined,
|
|
22
22
|
onErrorIntl: NOOP,
|
|
23
23
|
onDSLocalesLoaded: onDSLocalesLoaded,
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { RenderOptions, RenderResult } from '@testing-library/react';
|
|
3
|
+
import { DSProviderProps } from '@synerise/ds-core';
|
|
3
4
|
import { DataFormatNotationType } from '@synerise/ds-data-format';
|
|
4
5
|
type Options = Omit<RenderOptions, 'queries'>;
|
|
5
|
-
declare const renderWithProvider: (node: ReactNode, options?: Options, props?: {
|
|
6
|
-
locale?: string;
|
|
6
|
+
declare const renderWithProvider: (node: ReactNode, options?: Options, props?: Partial<Omit<DSProviderProps, 'onErrorIntl' | 'dataFormatConfig'>> & {
|
|
7
7
|
notation?: DataFormatNotationType;
|
|
8
|
-
timeZone?: string;
|
|
9
|
-
onDSLocalesLoaded?: () => void;
|
|
10
8
|
}) => RenderResult;
|
|
11
9
|
export default renderWithProvider;
|
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
|
|
1
|
+
var _excluded = ["notation"];
|
|
2
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
2
4
|
import React from 'react';
|
|
3
5
|
import { render } from '@testing-library/react';
|
|
4
6
|
import { DSProvider } from '@synerise/ds-core';
|
|
5
7
|
import { getDataFormatConfigFromNotation } from '@synerise/ds-data-format';
|
|
6
8
|
import { NOOP } from '../../index';
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
} : {}), node), options);
|
|
9
|
+
var _renderWithProvider = function renderWithProvider(node, options, props) {
|
|
10
|
+
var _ref = props || {},
|
|
11
|
+
notation = _ref.notation,
|
|
12
|
+
providerProps = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
13
|
+
var rendered = render(/*#__PURE__*/React.createElement(DSProvider, _extends({
|
|
14
|
+
onErrorIntl: NOOP
|
|
15
|
+
}, notation ? {
|
|
16
|
+
dataFormatConfig: getDataFormatConfigFromNotation(notation)
|
|
17
|
+
} : {}, providerProps), node), options);
|
|
17
18
|
return _extends({}, rendered, {
|
|
18
19
|
rerender: function rerender(ui, opt) {
|
|
19
|
-
return
|
|
20
|
+
return _renderWithProvider(ui, _extends({
|
|
20
21
|
container: rendered.container
|
|
21
22
|
}, opt));
|
|
22
23
|
}
|
|
23
24
|
});
|
|
24
25
|
};
|
|
25
|
-
export default
|
|
26
|
+
export default _renderWithProvider;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -11,7 +11,12 @@ export type ExactlyOne<T, U> = (T & {
|
|
|
11
11
|
}) | (U & {
|
|
12
12
|
[K in keyof T]?: never;
|
|
13
13
|
});
|
|
14
|
-
export type
|
|
14
|
+
export type DataAttributes = Record<`data-${string}`, string>;
|
|
15
|
+
export type WithHTMLAttributes<ElementType extends HTMLElement, BaseType> = BaseType & Omit<HTMLAttributes<ElementType>, keyof BaseType> & DataAttributes;
|
|
15
16
|
export type DeepPartial<T> = T extends object ? {
|
|
16
17
|
[P in keyof T]?: DeepPartial<T[P]>;
|
|
17
18
|
} : T;
|
|
19
|
+
/**
|
|
20
|
+
* Makes selected props of the base type required
|
|
21
|
+
*/
|
|
22
|
+
export type RequiredProps<BaseType, PropName extends keyof BaseType> = Required<Pick<BaseType, PropName>> & Omit<BaseType, PropName>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
2
|
import React from 'react';
|
|
3
3
|
var BREAKPOINTS = {
|
|
4
4
|
xxl: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
2
|
import { useEffect, useRef, useState } from 'react';
|
|
3
3
|
var useElementInView = function useElementInView(options, rootElementRef) {
|
|
4
4
|
var elementRef = useRef(null);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
2
|
import { useMemo } from 'react';
|
|
3
3
|
import { getActiveTabGroup, getGroupName, isItemInGroup } from './search.utils';
|
|
4
4
|
export var useSearchResults = function useSearchResults(items, groups, activeTab, groupByGroupName, activeGroup, searchQuery, maxSearchResultsInGroup) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-utils",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Utils UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "synerise/synerise-design",
|
|
@@ -41,5 +41,5 @@
|
|
|
41
41
|
"react": ">=16.9.0 <= 18.3.1",
|
|
42
42
|
"styled-components": "^5.3.3"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "90af7549cf0f556340bdd0deec4bb59bacf3e95e"
|
|
45
45
|
}
|