carbon-react 105.1.0 → 105.2.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/esm/__internal__/tooltip-provider/index.d.ts +19 -24
- package/esm/__internal__/tooltip-provider/index.js +0 -10
- package/esm/__spec_helper__/mock-match-media.d.ts +3 -1
- package/esm/components/app-wrapper/app-wrapper.component.d.ts +4 -0
- package/esm/components/badge/badge.style.d.ts +4 -2
- package/esm/components/button/button-types.style.d.ts +1 -2
- package/esm/components/button/button-types.style.js +3 -1
- package/esm/components/button/button.component.d.ts +67 -36
- package/esm/components/button/button.component.js +3314 -165
- package/esm/components/button/button.config.d.ts +4 -3
- package/esm/components/button/button.style.d.ts +6 -8
- package/esm/components/button/button.style.js +51 -95
- package/esm/components/button/index.d.ts +2 -2
- package/esm/components/duelling-picklist/picklist-group/picklist-group.style.d.ts +1 -2
- package/esm/components/duelling-picklist/picklist-item/picklist-item.style.d.ts +1 -2
- package/esm/components/flat-table/flat-table-body-draggable/flat-table-body-draggable.component.js +10 -3
- package/esm/components/flat-table/flat-table-body-draggable/flat-table-body-draggable.style.d.ts +2 -0
- package/esm/components/flat-table/flat-table-body-draggable/flat-table-body-draggable.style.js +9 -0
- package/esm/components/flat-table/flat-table-row/flat-table-row.style.js +0 -1
- package/esm/components/heading/heading.component.d.ts +5 -0
- package/esm/components/icon/index.d.ts +1 -0
- package/esm/components/multi-action-button/multi-action-button.component.d.ts +3 -1
- package/esm/components/multi-action-button/multi-action-button.component.js +7 -5
- package/esm/components/multi-action-button/multi-action-button.d.ts +4 -2
- package/esm/components/multi-step-wizard/multi-step-wizard.d.ts +22 -0
- package/esm/components/multi-step-wizard/step/step.d.ts +6 -0
- package/esm/components/multi-step-wizard/step/step.style.d.ts +4 -2
- package/esm/components/radio-button/radio-button-svg.component.js +29 -16
- package/esm/components/scrollable-list/scrollable-list.component.d.ts +8 -0
- package/esm/components/select/option/index.d.ts +1 -1
- package/esm/components/split-button/split-button-toggle.style.d.ts +2 -6
- package/esm/components/split-button/split-button.component.d.ts +3 -1
- package/esm/components/split-button/split-button.component.js +7 -4
- package/esm/components/split-button/split-button.d.ts +5 -2
- package/esm/components/tooltip/index.d.ts +2 -1
- package/esm/components/tooltip/tooltip-pointer.style.d.ts +10 -1
- package/esm/components/tooltip/tooltip-pointer.style.js +5 -12
- package/esm/components/tooltip/tooltip.component.d.ts +33 -2
- package/esm/components/tooltip/tooltip.component.js +255 -110
- package/esm/components/tooltip/tooltip.config.d.ts +2 -1
- package/esm/components/tooltip/tooltip.style.d.ts +7 -2
- package/esm/components/tooltip/tooltip.style.js +7 -21
- package/esm/components/typography/typography.component.d.ts +1 -1
- package/esm/hooks/__internal__/useCharacterCount/index.d.ts +1 -2
- package/esm/hooks/__internal__/useCharacterCount/index.js +1 -18
- package/esm/hooks/__internal__/useCharacterCount/useCharacterCount.d.ts +3 -0
- package/esm/hooks/__internal__/useCharacterCount/useCharacterCount.js +24 -0
- package/esm/hooks/__internal__/useInputAccessibility/index.d.ts +1 -24
- package/esm/hooks/__internal__/useInputAccessibility/useInputAccessibility.d.ts +11 -11
- package/esm/hooks/__internal__/useInputAccessibility/useInputAccessibility.js +1 -3
- package/esm/hooks/__internal__/useIsAboveBreakpoint/index.d.ts +1 -1
- package/esm/hooks/__internal__/useIsAboveBreakpoint/index.js +1 -6
- package/esm/hooks/__internal__/useIsAboveBreakpoint/useIsAboveBreakpoint.d.ts +1 -0
- package/esm/hooks/__internal__/useIsAboveBreakpoint/useIsAboveBreakpoint.js +6 -0
- package/esm/hooks/__internal__/useLocale/index.d.ts +1 -1
- package/esm/hooks/__internal__/useLocale/index.js +1 -5
- package/esm/hooks/__internal__/useLocale/useLocale.d.ts +1 -0
- package/esm/hooks/__internal__/useLocale/useLocale.js +5 -0
- package/esm/hooks/__internal__/useResizeObserver/index.d.ts +1 -10
- package/esm/hooks/__internal__/useResizeObserver/index.js +1 -23
- package/esm/hooks/__internal__/useResizeObserver/useResizeObserver.d.ts +8 -0
- package/esm/hooks/__internal__/useResizeObserver/useResizeObserver.js +29 -0
- package/esm/hooks/__internal__/useScrollBlock/index.d.ts +1 -4
- package/esm/hooks/__internal__/useScrollBlock/scroll-block-manager.d.ts +23 -9
- package/esm/hooks/__internal__/useScrollBlock/scroll-block-manager.js +24 -12
- package/esm/hooks/__internal__/useScrollBlock/useScrollBlock.d.ts +2 -2
- package/esm/hooks/__internal__/useScrollBlock/useScrollBlock.js +3 -5
- package/esm/hooks/useMediaQuery/index.d.ts +1 -1
- package/esm/hooks/useMediaQuery/index.js +1 -19
- package/esm/hooks/useMediaQuery/useMediaQuery.d.ts +1 -0
- package/esm/hooks/useMediaQuery/useMediaQuery.js +19 -0
- package/esm/locales/en-gb.d.ts +3 -5
- package/esm/locales/en-gb.js +5 -4
- package/esm/locales/index.d.ts +1 -1
- package/esm/locales/index.js +2 -0
- package/esm/locales/locale.d.ts +99 -105
- package/esm/locales/locale.js +1 -0
- package/esm/locales/pl-pl.d.ts +3 -5
- package/esm/locales/pl-pl.js +5 -4
- package/lib/__internal__/tooltip-provider/index.d.ts +19 -24
- package/lib/__internal__/tooltip-provider/index.js +1 -12
- package/lib/__spec_helper__/mock-match-media.d.ts +3 -1
- package/lib/components/app-wrapper/app-wrapper.component.d.ts +4 -0
- package/lib/components/badge/badge.style.d.ts +4 -2
- package/lib/components/button/button-types.style.d.ts +1 -2
- package/lib/components/button/button-types.style.js +0 -1
- package/lib/components/button/button.component.d.ts +67 -36
- package/lib/components/button/button.component.js +3381 -172
- package/lib/components/button/button.config.d.ts +4 -3
- package/lib/components/button/button.style.d.ts +6 -8
- package/lib/components/button/button.style.js +52 -101
- package/lib/components/button/index.d.ts +2 -2
- package/lib/components/duelling-picklist/picklist-group/picklist-group.style.d.ts +1 -2
- package/lib/components/duelling-picklist/picklist-item/picklist-item.style.d.ts +1 -2
- package/lib/components/flat-table/flat-table-body-draggable/flat-table-body-draggable.component.js +10 -3
- package/lib/components/flat-table/flat-table-body-draggable/flat-table-body-draggable.style.d.ts +2 -0
- package/lib/components/flat-table/flat-table-body-draggable/flat-table-body-draggable.style.js +22 -0
- package/lib/components/flat-table/flat-table-row/flat-table-row.style.js +0 -1
- package/lib/components/heading/heading.component.d.ts +5 -0
- package/lib/components/icon/index.d.ts +1 -0
- package/lib/components/multi-action-button/multi-action-button.component.d.ts +3 -1
- package/lib/components/multi-action-button/multi-action-button.component.js +6 -4
- package/lib/components/multi-action-button/multi-action-button.d.ts +4 -2
- package/lib/components/multi-step-wizard/multi-step-wizard.d.ts +22 -0
- package/lib/components/multi-step-wizard/step/step.d.ts +6 -0
- package/lib/components/multi-step-wizard/step/step.style.d.ts +4 -2
- package/lib/components/radio-button/radio-button-svg.component.js +38 -20
- package/lib/components/scrollable-list/scrollable-list.component.d.ts +8 -0
- package/lib/components/select/option/index.d.ts +1 -1
- package/lib/components/split-button/split-button-toggle.style.d.ts +2 -6
- package/lib/components/split-button/split-button.component.d.ts +3 -1
- package/lib/components/split-button/split-button.component.js +6 -3
- package/lib/components/split-button/split-button.d.ts +5 -2
- package/lib/components/tooltip/index.d.ts +2 -1
- package/lib/components/tooltip/tooltip-pointer.style.d.ts +10 -1
- package/lib/components/tooltip/tooltip-pointer.style.js +7 -15
- package/lib/components/tooltip/tooltip.component.d.ts +33 -2
- package/lib/components/tooltip/tooltip.component.js +221 -130
- package/lib/components/tooltip/tooltip.config.d.ts +2 -1
- package/lib/components/tooltip/tooltip.style.d.ts +7 -2
- package/lib/components/tooltip/tooltip.style.js +7 -22
- package/lib/components/typography/typography.component.d.ts +1 -1
- package/lib/components/vertical-divider/vertical-divider.component.js +3 -0
- package/lib/hooks/__internal__/useCharacterCount/index.d.ts +1 -2
- package/lib/hooks/__internal__/useCharacterCount/index.js +8 -27
- package/lib/hooks/__internal__/useCharacterCount/useCharacterCount.d.ts +3 -0
- package/lib/hooks/__internal__/useCharacterCount/useCharacterCount.js +40 -0
- package/lib/hooks/__internal__/useInputAccessibility/index.d.ts +1 -24
- package/lib/hooks/__internal__/useInputAccessibility/useInputAccessibility.d.ts +11 -11
- package/lib/hooks/__internal__/useInputAccessibility/useInputAccessibility.js +1 -3
- package/lib/hooks/__internal__/useIsAboveBreakpoint/index.d.ts +1 -1
- package/lib/hooks/__internal__/useIsAboveBreakpoint/index.js +8 -9
- package/lib/hooks/__internal__/useIsAboveBreakpoint/useIsAboveBreakpoint.d.ts +1 -0
- package/lib/hooks/__internal__/useIsAboveBreakpoint/useIsAboveBreakpoint.js +16 -0
- package/lib/hooks/__internal__/useLocale/index.d.ts +1 -1
- package/lib/hooks/__internal__/useLocale/index.js +8 -9
- package/lib/hooks/__internal__/useLocale/useLocale.d.ts +1 -0
- package/lib/hooks/__internal__/useLocale/useLocale.js +16 -0
- package/lib/hooks/__internal__/useResizeObserver/index.d.ts +1 -10
- package/lib/hooks/__internal__/useResizeObserver/index.js +8 -24
- package/lib/hooks/__internal__/useResizeObserver/useResizeObserver.d.ts +8 -0
- package/lib/hooks/__internal__/useResizeObserver/useResizeObserver.js +37 -0
- package/lib/hooks/__internal__/useScrollBlock/index.d.ts +1 -4
- package/lib/hooks/__internal__/useScrollBlock/scroll-block-manager.d.ts +23 -9
- package/lib/hooks/__internal__/useScrollBlock/scroll-block-manager.js +24 -12
- package/lib/hooks/__internal__/useScrollBlock/useScrollBlock.d.ts +2 -2
- package/lib/hooks/__internal__/useScrollBlock/useScrollBlock.js +3 -5
- package/lib/hooks/useMediaQuery/index.d.ts +1 -1
- package/lib/hooks/useMediaQuery/index.js +8 -25
- package/lib/hooks/useMediaQuery/useMediaQuery.d.ts +1 -0
- package/lib/hooks/useMediaQuery/useMediaQuery.js +32 -0
- package/lib/locales/en-gb.d.ts +3 -5
- package/lib/locales/en-gb.js +2 -1
- package/lib/locales/index.d.ts +1 -1
- package/lib/locales/index.js +23 -0
- package/lib/locales/locale.d.ts +99 -105
- package/lib/locales/locale.js +5 -0
- package/lib/locales/package.json +6 -0
- package/lib/locales/pl-pl.d.ts +3 -5
- package/lib/locales/pl-pl.js +2 -1
- package/package.json +11 -6
- package/esm/components/button/button.d.ts +0 -85
- package/esm/components/tooltip/tooltip.d.ts +0 -40
- package/lib/components/button/button.d.ts +0 -85
- package/lib/components/tooltip/tooltip.d.ts +0 -40
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
export default function useInputAccessibility({ id, error, warning, info, label, fieldHelp, }: {
|
|
2
|
-
id:
|
|
3
|
-
error
|
|
4
|
-
warning
|
|
5
|
-
info
|
|
6
|
-
label
|
|
7
|
-
fieldHelp
|
|
2
|
+
id: string;
|
|
3
|
+
error?: string;
|
|
4
|
+
warning?: string;
|
|
5
|
+
info?: string;
|
|
6
|
+
label?: string;
|
|
7
|
+
fieldHelp?: string;
|
|
8
8
|
}): {
|
|
9
|
-
labelId
|
|
10
|
-
validationIconId
|
|
11
|
-
fieldHelpId
|
|
12
|
-
ariaDescribedBy
|
|
13
|
-
ariaLabelledBy
|
|
9
|
+
labelId?: string;
|
|
10
|
+
validationIconId?: string;
|
|
11
|
+
fieldHelpId?: string;
|
|
12
|
+
ariaDescribedBy?: string;
|
|
13
|
+
ariaLabelledBy?: string;
|
|
14
14
|
};
|
|
@@ -7,9 +7,7 @@ export default function useInputAccessibility({
|
|
|
7
7
|
fieldHelp
|
|
8
8
|
}) {
|
|
9
9
|
const labelId = label ? `${id}-label` : undefined;
|
|
10
|
-
const validationIconId = [error, warning, info].filter(validation => {
|
|
11
|
-
return validation && typeof validation === "string";
|
|
12
|
-
}).length ? `${id}-validation-icon` : undefined;
|
|
10
|
+
const validationIconId = [error, warning, info].filter(validation => validation && typeof validation === "string").length ? `${id}-validation-icon` : undefined;
|
|
13
11
|
const fieldHelpId = fieldHelp ? `${id}-field-help` : undefined;
|
|
14
12
|
const ariaDescribedBy = [fieldHelpId, validationIconId].filter(Boolean).join(" ");
|
|
15
13
|
const ariaLabelledBy = labelId;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export default
|
|
1
|
+
export { default } from "./useIsAboveBreakpoint";
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export default function useIsAboveBreakpoint(breakpoint) {
|
|
3
|
-
const matchesQuery = useMediaQuery(`(min-width:${breakpoint}px)`);
|
|
4
|
-
if (!breakpoint) return undefined;
|
|
5
|
-
return matchesQuery;
|
|
6
|
-
}
|
|
1
|
+
export { default } from "./useIsAboveBreakpoint";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function useIsAboveBreakpoint(breakpoint?: number): boolean | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export default
|
|
1
|
+
export { default } from "./useLocale";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function useLocale(): import("../../../locales/locale").default;
|
|
@@ -1,10 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export default function useResizeObserver(
|
|
4
|
-
/** Reference to the resizable HTML element - */
|
|
5
|
-
ref: React.RefObject<HTMLElement>,
|
|
6
|
-
/** Callback meant to be executed on element resize */
|
|
7
|
-
onResize: () => void,
|
|
8
|
-
/** Flag to indicate whether hook should be disabled */
|
|
9
|
-
disabled?: boolean
|
|
10
|
-
): void;
|
|
1
|
+
export { default } from "./useResizeObserver";
|
|
@@ -1,23 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export default function useResizeObserver(ref, onResize, disabled) {
|
|
3
|
-
const observer = useRef(null);
|
|
4
|
-
const onResizeRef = useRef(null);
|
|
5
|
-
onResizeRef.current = onResize;
|
|
6
|
-
useLayoutEffect(() => {
|
|
7
|
-
const referenceRef = ref.current;
|
|
8
|
-
|
|
9
|
-
if (!disabled) {
|
|
10
|
-
observer.current = new ResizeObserver(() => {
|
|
11
|
-
onResizeRef === null || onResizeRef === void 0 ? void 0 : onResizeRef.current();
|
|
12
|
-
});
|
|
13
|
-
observer.current.observe(referenceRef);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
return () => {
|
|
17
|
-
if (!disabled) {
|
|
18
|
-
observer.current.unobserve(referenceRef);
|
|
19
|
-
observer.current.disconnect();
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
}, [ref, disabled]);
|
|
23
|
-
}
|
|
1
|
+
export { default } from "./useResizeObserver";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { RefObject } from "react";
|
|
2
|
+
export default function useResizeObserver(
|
|
3
|
+
/** Reference to the resizable HTML element */
|
|
4
|
+
ref: RefObject<Element>,
|
|
5
|
+
/** Callback meant to be executed on element resize */
|
|
6
|
+
onResize: () => void,
|
|
7
|
+
/** Flag to indicate whether hook should be disabled */
|
|
8
|
+
disabled?: boolean): void;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { useRef, useLayoutEffect } from "react";
|
|
2
|
+
export default function useResizeObserver(
|
|
3
|
+
/** Reference to the resizable HTML element */
|
|
4
|
+
ref,
|
|
5
|
+
/** Callback meant to be executed on element resize */
|
|
6
|
+
onResize,
|
|
7
|
+
/** Flag to indicate whether hook should be disabled */
|
|
8
|
+
disabled) {
|
|
9
|
+
const observer = useRef();
|
|
10
|
+
const onResizeRef = useRef(onResize);
|
|
11
|
+
onResizeRef.current = onResize;
|
|
12
|
+
useLayoutEffect(() => {
|
|
13
|
+
const referenceRef = ref.current;
|
|
14
|
+
|
|
15
|
+
if (!disabled && referenceRef) {
|
|
16
|
+
observer.current = new ResizeObserver(() => {
|
|
17
|
+
onResizeRef === null || onResizeRef === void 0 ? void 0 : onResizeRef.current();
|
|
18
|
+
});
|
|
19
|
+
observer.current.observe(referenceRef);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return () => {
|
|
23
|
+
if (!disabled && referenceRef && observer.current) {
|
|
24
|
+
observer.current.unobserve(referenceRef);
|
|
25
|
+
observer.current.disconnect();
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
}, [ref, disabled]);
|
|
29
|
+
}
|
|
@@ -1,12 +1,26 @@
|
|
|
1
|
-
|
|
1
|
+
declare global {
|
|
2
|
+
interface Window {
|
|
3
|
+
__CARBON_INTERNALS_SCROLL_BLOCKERS?: {
|
|
4
|
+
components: {
|
|
5
|
+
[key: string]: boolean;
|
|
6
|
+
};
|
|
7
|
+
originalValues: string[];
|
|
8
|
+
restoreValues?: (() => void) | null;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
}
|
|
2
12
|
declare class ScrollBlockManager {
|
|
3
|
-
components:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
13
|
+
components: {
|
|
14
|
+
[key: string]: boolean;
|
|
15
|
+
};
|
|
16
|
+
originalValues: string[];
|
|
17
|
+
constructor();
|
|
18
|
+
registerComponent(id: string): void;
|
|
19
|
+
unregisterComponent(id: string): void;
|
|
20
|
+
saveRestoreValuesCallback(callback: (() => void) | null): void;
|
|
21
|
+
getRestoreValuesCallback(): (() => void) | null | undefined;
|
|
22
|
+
saveOriginalValues(values: string[]): void;
|
|
23
|
+
getOriginalValues(): string[];
|
|
11
24
|
isBlocked(): boolean;
|
|
12
25
|
}
|
|
26
|
+
export default ScrollBlockManager;
|
|
@@ -4,19 +4,26 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
|
|
|
4
4
|
|
|
5
5
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
|
+
|
|
9
|
+
// TODO: This component can be refactored to remove redundant code
|
|
10
|
+
// once we can confirm that all Sage products use version 105.0.0^
|
|
9
11
|
let ScrollBlockManager = /*#__PURE__*/function () {
|
|
10
12
|
function ScrollBlockManager() {
|
|
11
13
|
_classCallCheck(this, ScrollBlockManager);
|
|
12
14
|
|
|
15
|
+
_defineProperty(this, "components", void 0);
|
|
16
|
+
|
|
17
|
+
_defineProperty(this, "originalValues", void 0);
|
|
18
|
+
|
|
13
19
|
// Due to possibility of multiple carbon versions using it
|
|
14
20
|
// it is necessary to maintain same structure in this global variable
|
|
15
21
|
if (!window.__CARBON_INTERNALS_SCROLL_BLOCKERS) {
|
|
16
22
|
window.__CARBON_INTERNALS_SCROLL_BLOCKERS = {
|
|
17
23
|
components: {},
|
|
18
24
|
// originalValues can be removed
|
|
19
|
-
originalValues: []
|
|
25
|
+
originalValues: [],
|
|
26
|
+
restoreValues: null
|
|
20
27
|
};
|
|
21
28
|
}
|
|
22
29
|
|
|
@@ -34,23 +41,28 @@ let ScrollBlockManager = /*#__PURE__*/function () {
|
|
|
34
41
|
key: "unregisterComponent",
|
|
35
42
|
value: function unregisterComponent(id) {
|
|
36
43
|
delete this.components[id];
|
|
37
|
-
} // TODO: saveOriginalValues can be removed
|
|
38
|
-
|
|
39
|
-
}, {
|
|
40
|
-
key: "saveOriginalValues",
|
|
41
|
-
value: function saveOriginalValues(values) {
|
|
42
|
-
this.originalValues.length = 0;
|
|
43
|
-
this.originalValues.push(...values);
|
|
44
44
|
}
|
|
45
45
|
}, {
|
|
46
46
|
key: "saveRestoreValuesCallback",
|
|
47
47
|
value: function saveRestoreValuesCallback(callback) {
|
|
48
|
-
|
|
48
|
+
/* istanbul ignore else */
|
|
49
|
+
if (window.__CARBON_INTERNALS_SCROLL_BLOCKERS) {
|
|
50
|
+
window.__CARBON_INTERNALS_SCROLL_BLOCKERS.restoreValues = callback;
|
|
51
|
+
}
|
|
49
52
|
}
|
|
50
53
|
}, {
|
|
51
54
|
key: "getRestoreValuesCallback",
|
|
52
55
|
value: function getRestoreValuesCallback() {
|
|
53
|
-
|
|
56
|
+
var _window$__CARBON_INTE;
|
|
57
|
+
|
|
58
|
+
return (_window$__CARBON_INTE = window.__CARBON_INTERNALS_SCROLL_BLOCKERS) === null || _window$__CARBON_INTE === void 0 ? void 0 : _window$__CARBON_INTE.restoreValues;
|
|
59
|
+
} // TODO: saveOriginalValues can be removed
|
|
60
|
+
|
|
61
|
+
}, {
|
|
62
|
+
key: "saveOriginalValues",
|
|
63
|
+
value: function saveOriginalValues(values) {
|
|
64
|
+
this.originalValues.length = 0;
|
|
65
|
+
this.originalValues.push(...values);
|
|
54
66
|
} // TODO: getOriginalValues can be removed
|
|
55
67
|
|
|
56
68
|
}, {
|
|
@@ -4,20 +4,18 @@ import ScrollBlockManager from "./scroll-block-manager"; // TODO: This component
|
|
|
4
4
|
// we can confirm that all Sage products use version 105.0.0^
|
|
5
5
|
|
|
6
6
|
const scrollBlockManager = new ScrollBlockManager();
|
|
7
|
-
/* istanbul ignore next */
|
|
8
|
-
|
|
9
|
-
const safeDocument = typeof document !== "undefined" ? document : {};
|
|
10
7
|
|
|
11
8
|
const useScrollBlock = () => {
|
|
12
9
|
const {
|
|
13
10
|
current: containerGuid
|
|
14
11
|
} = useRef(guid());
|
|
15
|
-
const originalValuesRef = useRef();
|
|
12
|
+
const originalValuesRef = useRef([]);
|
|
16
13
|
const rules = useMemo(() => {
|
|
14
|
+
/* istanbul ignore next */
|
|
17
15
|
const {
|
|
18
16
|
documentElement,
|
|
19
17
|
body
|
|
20
|
-
} =
|
|
18
|
+
} = document || {};
|
|
21
19
|
const scrollBarWidth = window.innerWidth - documentElement.clientWidth;
|
|
22
20
|
const bodyPaddingRight = parseInt(window.getComputedStyle(body).getPropertyValue("padding-right")) || 0;
|
|
23
21
|
return [// TODO: First two entries of this array with the documentElement can be removed
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export default
|
|
1
|
+
export { default } from "./useMediaQuery";
|
|
@@ -1,19 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export default function useMediaQuery(queryInput) {
|
|
3
|
-
const query = queryInput.replace(/^@media( ?)/m, "");
|
|
4
|
-
const [match, setMatch] = React.useState(() => false);
|
|
5
|
-
React.useEffect(() => {
|
|
6
|
-
const queryList = window.matchMedia(query);
|
|
7
|
-
|
|
8
|
-
const updateMatch = () => {
|
|
9
|
-
setMatch(queryList.matches);
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
updateMatch();
|
|
13
|
-
queryList.addListener(updateMatch);
|
|
14
|
-
return () => {
|
|
15
|
-
queryList.removeListener(updateMatch);
|
|
16
|
-
};
|
|
17
|
-
}, [query]);
|
|
18
|
-
return match;
|
|
19
|
-
}
|
|
1
|
+
export { default } from "./useMediaQuery";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function useMediaQuery(queryInput: string): boolean;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export default function useMediaQuery(queryInput) {
|
|
3
|
+
const query = queryInput.replace(/^@media( ?)/m, "");
|
|
4
|
+
const [match, setMatch] = React.useState(() => false);
|
|
5
|
+
React.useEffect(() => {
|
|
6
|
+
const queryList = window.matchMedia(query);
|
|
7
|
+
|
|
8
|
+
const updateMatch = () => {
|
|
9
|
+
setMatch(queryList.matches);
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
updateMatch();
|
|
13
|
+
queryList.addListener(updateMatch);
|
|
14
|
+
return () => {
|
|
15
|
+
queryList.removeListener(updateMatch);
|
|
16
|
+
};
|
|
17
|
+
}, [query]);
|
|
18
|
+
return match;
|
|
19
|
+
}
|
package/esm/locales/en-gb.d.ts
CHANGED
package/esm/locales/en-gb.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { enGB } from "./date-fns-locales";
|
|
1
|
+
import { enGB as enGBDateLocale } from "./date-fns-locales";
|
|
2
2
|
|
|
3
3
|
const isSingular = count => (typeof count === "string" ? parseInt(count) : count) === 1;
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
const enGB = {
|
|
6
6
|
locale: () => "en-GB",
|
|
7
7
|
actions: {
|
|
8
8
|
edit: () => "Edit",
|
|
@@ -19,7 +19,7 @@ export default {
|
|
|
19
19
|
yes: () => "Yes"
|
|
20
20
|
},
|
|
21
21
|
date: {
|
|
22
|
-
dateFnsLocale: () =>
|
|
22
|
+
dateFnsLocale: () => enGBDateLocale
|
|
23
23
|
},
|
|
24
24
|
dialog: {
|
|
25
25
|
ariaLabels: {
|
|
@@ -128,4 +128,5 @@ export default {
|
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
|
-
};
|
|
131
|
+
};
|
|
132
|
+
export default enGB;
|
package/esm/locales/index.d.ts
CHANGED
package/esm/locales/locale.d.ts
CHANGED
|
@@ -1,111 +1,105 @@
|
|
|
1
1
|
import { Locale as DateFnsLocale } from "date-fns";
|
|
2
|
-
|
|
3
2
|
interface Locale {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
show: () => string;
|
|
53
|
-
records: (count: number | string, showNumber: boolean) => string;
|
|
54
|
-
first: () => string;
|
|
55
|
-
last: () => string;
|
|
56
|
-
next: () => string;
|
|
57
|
-
previous: () => string;
|
|
58
|
-
pageX: () => string;
|
|
59
|
-
ofY: (count: string | number) => string;
|
|
60
|
-
};
|
|
61
|
-
select: {
|
|
62
|
-
actionButtonText: () => string;
|
|
63
|
-
placeholder: () => string;
|
|
64
|
-
noResultsForTerm: (term: string) => string;
|
|
65
|
-
};
|
|
66
|
-
link: {
|
|
67
|
-
skipLinkLabel: () => string;
|
|
68
|
-
};
|
|
69
|
-
sidebar: {
|
|
70
|
-
ariaLabels: {
|
|
71
|
-
close: () => string;
|
|
72
|
-
};
|
|
73
|
-
};
|
|
74
|
-
switch: {
|
|
75
|
-
on: () => string;
|
|
76
|
-
off: () => string;
|
|
77
|
-
};
|
|
78
|
-
textEditor: {
|
|
79
|
-
tooltipMessages: {
|
|
80
|
-
bold: () => string;
|
|
81
|
-
italic: () => string;
|
|
82
|
-
bulletList: () => string;
|
|
83
|
-
numberList: () => string;
|
|
84
|
-
};
|
|
85
|
-
ariaLabels: {
|
|
86
|
-
bold: () => string;
|
|
87
|
-
italic: () => string;
|
|
88
|
-
bulletList: () => string;
|
|
89
|
-
numberList: () => string;
|
|
90
|
-
};
|
|
91
|
-
};
|
|
92
|
-
tileSelect: {
|
|
93
|
-
deselect: () => string;
|
|
94
|
-
};
|
|
95
|
-
toast: {
|
|
96
|
-
ariaLabels: {
|
|
97
|
-
close: () => string;
|
|
98
|
-
};
|
|
99
|
-
};
|
|
100
|
-
wizards: {
|
|
101
|
-
multiStep: {
|
|
102
|
-
buttons: {
|
|
103
|
-
submit: () => string;
|
|
3
|
+
locale: () => string;
|
|
4
|
+
actions: {
|
|
5
|
+
edit: () => string;
|
|
6
|
+
delete: () => string;
|
|
7
|
+
};
|
|
8
|
+
actionPopover: {
|
|
9
|
+
ariaLabel: () => string;
|
|
10
|
+
};
|
|
11
|
+
batchSelection: {
|
|
12
|
+
selected: (count: number | string) => string;
|
|
13
|
+
};
|
|
14
|
+
confirm: {
|
|
15
|
+
no: () => string;
|
|
16
|
+
yes: () => string;
|
|
17
|
+
};
|
|
18
|
+
date: {
|
|
19
|
+
dateFnsLocale: () => DateFnsLocale;
|
|
20
|
+
};
|
|
21
|
+
dialog: {
|
|
22
|
+
ariaLabels: {
|
|
23
|
+
close: () => string;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
dialogFullScreen: {
|
|
27
|
+
ariaLabels: {
|
|
28
|
+
close: () => string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
errors: {
|
|
32
|
+
messages: {
|
|
33
|
+
formSummary: (errors: number, warnings: number, type: string) => [string, string] | null;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
message: {
|
|
37
|
+
closeButtonAriaLabel: () => string;
|
|
38
|
+
};
|
|
39
|
+
numeralDate: {
|
|
40
|
+
validation: {
|
|
41
|
+
day: () => string;
|
|
42
|
+
month: () => string;
|
|
43
|
+
year: () => string;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
pager: {
|
|
47
|
+
show: () => string;
|
|
48
|
+
records: (count: number | string, showNumber: boolean) => string;
|
|
49
|
+
first: () => string;
|
|
50
|
+
last: () => string;
|
|
104
51
|
next: () => string;
|
|
105
|
-
|
|
106
|
-
|
|
52
|
+
previous: () => string;
|
|
53
|
+
pageX: () => string;
|
|
54
|
+
ofY: (count: string | number) => string;
|
|
55
|
+
};
|
|
56
|
+
select: {
|
|
57
|
+
actionButtonText: () => string;
|
|
58
|
+
placeholder: () => string;
|
|
59
|
+
noResultsForTerm: (term: string) => string;
|
|
60
|
+
};
|
|
61
|
+
link: {
|
|
62
|
+
skipLinkLabel: () => string;
|
|
63
|
+
};
|
|
64
|
+
sidebar: {
|
|
65
|
+
ariaLabels: {
|
|
66
|
+
close: () => string;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
switch: {
|
|
70
|
+
on: () => string;
|
|
71
|
+
off: () => string;
|
|
72
|
+
};
|
|
73
|
+
textEditor: {
|
|
74
|
+
tooltipMessages: {
|
|
75
|
+
bold: () => string;
|
|
76
|
+
italic: () => string;
|
|
77
|
+
bulletList: () => string;
|
|
78
|
+
numberList: () => string;
|
|
79
|
+
};
|
|
80
|
+
ariaLabels: {
|
|
81
|
+
bold: () => string;
|
|
82
|
+
italic: () => string;
|
|
83
|
+
bulletList: () => string;
|
|
84
|
+
numberList: () => string;
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
tileSelect: {
|
|
88
|
+
deselect: () => string;
|
|
89
|
+
};
|
|
90
|
+
toast: {
|
|
91
|
+
ariaLabels: {
|
|
92
|
+
close: () => string;
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
wizards: {
|
|
96
|
+
multiStep: {
|
|
97
|
+
buttons: {
|
|
98
|
+
submit: () => string;
|
|
99
|
+
next: () => string;
|
|
100
|
+
back: () => string;
|
|
101
|
+
};
|
|
102
|
+
};
|
|
107
103
|
};
|
|
108
|
-
};
|
|
109
104
|
}
|
|
110
|
-
|
|
111
105
|
export default Locale;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/esm/locales/pl-pl.d.ts
CHANGED
package/esm/locales/pl-pl.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { pl } from "./date-fns-locales";
|
|
1
|
+
import { pl as plDateLocale } from "./date-fns-locales";
|
|
2
2
|
|
|
3
3
|
const isSingular = count => (typeof count === "string" ? parseInt(count) : count) === 1;
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
const plPL = {
|
|
6
6
|
locale: () => "pl-PL",
|
|
7
7
|
actions: {
|
|
8
8
|
edit: () => "Edytuj",
|
|
@@ -19,7 +19,7 @@ export default {
|
|
|
19
19
|
yes: () => "Tak"
|
|
20
20
|
},
|
|
21
21
|
date: {
|
|
22
|
-
dateFnsLocale: () =>
|
|
22
|
+
dateFnsLocale: () => plDateLocale
|
|
23
23
|
},
|
|
24
24
|
dialog: {
|
|
25
25
|
ariaLabels: {
|
|
@@ -126,4 +126,5 @@ export default {
|
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
|
-
};
|
|
129
|
+
};
|
|
130
|
+
export default plPL;
|