@gooddata/sdk-ui-kit 11.43.0-alpha.0 → 11.43.0-alpha.1
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/@ui/UiGranteeAsyncPicker/UiGranteeAsyncPicker.d.ts.map +1 -1
- package/esm/@ui/UiGranteeAsyncPicker/UiGranteeAsyncPicker.js +7 -4
- package/esm/@ui/UiGranteeRow/UiGranteeRow.d.ts +3 -1
- package/esm/@ui/UiGranteeRow/UiGranteeRow.d.ts.map +1 -1
- package/esm/@ui/UiGranteeRow/UiGranteeRow.js +2 -2
- package/esm/@ui/UiGranteeRowControls/UiGranteeRowControls.d.ts +15 -15
- package/esm/@ui/UiGranteeRowControls/UiGranteeRowControls.d.ts.map +1 -1
- package/esm/@ui/UiGranteeRowControls/UiGranteeRowControls.js +20 -18
- package/esm/@ui/UiLabelsChecklist/UiLabelsChecklist.d.ts +44 -0
- package/esm/@ui/UiLabelsChecklist/UiLabelsChecklist.d.ts.map +1 -0
- package/esm/@ui/UiLabelsChecklist/UiLabelsChecklist.js +76 -0
- package/esm/@ui/UiMoreOptionsMenu/UiMoreOptionsMenu.d.ts +23 -0
- package/esm/@ui/UiMoreOptionsMenu/UiMoreOptionsMenu.d.ts.map +1 -0
- package/esm/@ui/UiMoreOptionsMenu/UiMoreOptionsMenu.js +83 -0
- package/esm/@ui/UiObjectShareDialog/UiObjectShareDialogCard.d.ts +2 -0
- package/esm/@ui/UiObjectShareDialog/UiObjectShareDialogCard.d.ts.map +1 -1
- package/esm/@ui/UiObjectShareDialog/UiObjectShareDialogCard.js +1 -1
- package/esm/@ui/UiPermissionMenu/UiPermissionMenu.d.ts +4 -15
- package/esm/@ui/UiPermissionMenu/UiPermissionMenu.d.ts.map +1 -1
- package/esm/@ui/UiPermissionMenu/UiPermissionMenu.js +11 -23
- package/esm/@ui/UiPopover/UiPopover.d.ts +10 -1
- package/esm/@ui/UiPopover/UiPopover.d.ts.map +1 -1
- package/esm/@ui/UiPopover/UiPopover.js +2 -2
- package/esm/@ui/UiTag/UiTag.d.ts +1 -0
- package/esm/@ui/UiTag/UiTag.d.ts.map +1 -1
- package/esm/@ui/UiTag/UiTag.js +10 -4
- package/esm/@ui/UiTags/UiTag.d.ts +0 -2
- package/esm/@ui/UiTags/UiTag.d.ts.map +1 -1
- package/esm/@ui/UiTags/UiTag.js +14 -9
- package/esm/@ui/UiTags/UiTags.d.ts.map +1 -1
- package/esm/@ui/UiTags/UiTags.js +38 -24
- package/esm/@ui/UiTags/interactions.d.ts +4 -9
- package/esm/@ui/UiTags/interactions.d.ts.map +1 -1
- package/esm/@ui/UiTags/interactions.js +58 -228
- package/esm/@ui/UiTooltip/UiTooltip.d.ts +1 -1
- package/esm/@ui/UiTooltip/UiTooltip.d.ts.map +1 -1
- package/esm/@ui/UiTooltip/UiTooltip.js +17 -9
- package/esm/@ui/UiTooltip/types.d.ts +10 -1
- package/esm/@ui/UiTooltip/types.d.ts.map +1 -1
- package/esm/Button/Button.d.ts.map +1 -1
- package/esm/Button/Button.js +2 -2
- package/esm/Icon/icons/InsightIcons/Radar.d.ts.map +1 -1
- package/esm/Icon/icons/InsightIcons/Radar.js +3 -1
- package/esm/List/MenuList.d.ts +2 -1
- package/esm/List/MenuList.d.ts.map +1 -1
- package/esm/List/MenuList.js +2 -2
- package/esm/index.d.ts +2 -1
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +2 -1
- package/esm/locales.d.ts +11 -4
- package/esm/locales.d.ts.map +1 -1
- package/esm/locales.js +5 -4
- package/esm/sdk-ui-kit.d.ts +101 -84
- package/esm/tsdoc-metadata.json +1 -1
- package/package.json +11 -11
- package/src/@ui/UiGranteeAsyncPicker/UiGranteeAsyncPicker.scss +12 -0
- package/src/@ui/UiGranteeRow/UiGranteeRow.scss +5 -0
- package/src/@ui/UiGranteeRowControls/UiGranteeRowControls.scss +7 -0
- package/src/@ui/{UiLabelsPicker/UiLabelsPicker.scss → UiLabelsChecklist/UiLabelsChecklist.scss} +2 -7
- package/src/@ui/UiModalDialog/UiModalDialog.scss +11 -1
- package/src/@ui/UiMoreOptionsMenu/UiMoreOptionsMenu.scss +10 -0
- package/src/@ui/UiPermissionMenu/UiPermissionMenu.scss +0 -7
- package/src/@ui/UiTabs/UiTabs.scss +0 -1
- package/src/@ui/UiTag/UiTag.scss +4 -0
- package/src/@ui/UiTags/UiTags.scss +5 -1
- package/src/@ui/index.scss +2 -1
- package/styles/css/main.css +53 -21
- package/styles/css/main.css.map +1 -1
- package/styles/images/visualization-types/radar-active.svg +10 -6
- package/styles/images/visualization-types/radar.svg +16 -5
- package/esm/@ui/UiLabelsPicker/UiLabelsPicker.d.ts +0 -64
- package/esm/@ui/UiLabelsPicker/UiLabelsPicker.d.ts.map +0 -1
- package/esm/@ui/UiLabelsPicker/UiLabelsPicker.js +0 -89
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { type ReactElement } from "react";
|
|
2
|
-
import { type LabelRowKind } from "../UiLabelRow/UiLabelRow.js";
|
|
3
|
-
/**
|
|
4
|
-
* One label entry in the picker.
|
|
5
|
-
*
|
|
6
|
-
* @internal
|
|
7
|
-
*/
|
|
8
|
-
export interface IUiLabelsPickerItem {
|
|
9
|
-
/** Stable identifier — used as the React key and in selection state. */
|
|
10
|
-
id: string;
|
|
11
|
-
/** Label text. */
|
|
12
|
-
label: string;
|
|
13
|
-
/** Drives the icon + suffix. Omit for a regular label. */
|
|
14
|
-
kind?: LabelRowKind;
|
|
15
|
-
/**
|
|
16
|
-
* When true the item is rendered locked (checked + disabled). Used for
|
|
17
|
-
* the primary-key row, which is always included.
|
|
18
|
-
*/
|
|
19
|
-
locked?: boolean;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Predicate the picker uses to decide whether an item is effectively selected:
|
|
23
|
-
* locked items always count as selected, otherwise membership in the staged
|
|
24
|
-
* `selected` set. Exported so consumers (e.g. the grantee row counter) can
|
|
25
|
-
* apply the same rule without re-encoding it.
|
|
26
|
-
*
|
|
27
|
-
* @internal
|
|
28
|
-
*/
|
|
29
|
-
export declare const isLabelsPickerItemChecked: (item: IUiLabelsPickerItem, selectedIds: readonly string[]) => boolean;
|
|
30
|
-
/**
|
|
31
|
-
* @internal
|
|
32
|
-
*/
|
|
33
|
-
export interface IUiLabelsPickerProps {
|
|
34
|
-
/** Element that opens the picker on click. */
|
|
35
|
-
anchor: ReactElement<any>;
|
|
36
|
-
/** All available label items, in source order. */
|
|
37
|
-
items: ReadonlyArray<IUiLabelsPickerItem>;
|
|
38
|
-
/**
|
|
39
|
-
* Initial set of selected item ids. Locked items are always treated as
|
|
40
|
-
* selected regardless of what's passed here. Consumers that need to
|
|
41
|
-
* reset the staged state when switching contexts (e.g. picking labels
|
|
42
|
-
* for a different grantee) should pass `key={contextId}` so React
|
|
43
|
-
* remounts the picker body.
|
|
44
|
-
*/
|
|
45
|
-
defaultSelectedIds: ReadonlyArray<string>;
|
|
46
|
-
/**
|
|
47
|
-
* Fires when the user clicks Apply with the (locked-augmented) set of
|
|
48
|
-
* selected ids. The picker keeps its own staged state — the caller is
|
|
49
|
-
* notified only on commit.
|
|
50
|
-
*/
|
|
51
|
-
onApply: (selectedIds: string[]) => void;
|
|
52
|
-
/** Test id forwarded to the picker body. */
|
|
53
|
-
dataTestId?: string;
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Per-label picker popover. Anchored on a click target; stages selection
|
|
57
|
-
* internally and commits via `onApply`. Locked items are always included
|
|
58
|
-
* — at render time via {@link isLabelsPickerItemChecked} and again at
|
|
59
|
-
* commit via the locked-aware filter.
|
|
60
|
-
*
|
|
61
|
-
* @internal
|
|
62
|
-
*/
|
|
63
|
-
export declare function UiLabelsPicker({ anchor, items, defaultSelectedIds, onApply, dataTestId }: IUiLabelsPickerProps): import("react/jsx-runtime").JSX.Element;
|
|
64
|
-
//# sourceMappingURL=UiLabelsPicker.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"UiLabelsPicker.d.ts","sourceRoot":"","sources":["../../../src/@ui/UiLabelsPicker/UiLabelsPicker.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAsB,KAAK,YAAY,EAAyC,MAAM,OAAO,CAAC;AAQrG,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAKhE;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAChC,0EAAwE;IACxE,EAAE,EAAE,MAAM,CAAC;IACX,kBAAkB;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,0DAA0D;IAC1D,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,yBAAyB,wEAG6B,CAAC;AAEpE;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACjC,8CAA8C;IAC9C,MAAM,EAAE,YAAY,CAAC,GAAG,CAAC,CAAC;IAC1B,kDAAkD;IAClD,KAAK,EAAE,aAAa,CAAC,mBAAmB,CAAC,CAAC;IAC1C;;;;;;OAMG;IACH,kBAAkB,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAC1C;;;;OAIG;IACH,OAAO,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACzC,4CAA4C;IAC5C,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,EAC3B,MAAM,EACN,KAAK,EACL,kBAAkB,EAClB,OAAO,EACP,UAAU,EACb,EAAE,oBAAoB,2CAqBtB"}
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
// (C) 2026 GoodData Corporation
|
|
3
|
-
import { useCallback, useId, useMemo, useState } from "react";
|
|
4
|
-
import { useIntl } from "react-intl";
|
|
5
|
-
import { commonDialogMessages, olpLabelMessages } from "../../locales.js";
|
|
6
|
-
import { bem } from "../@utils/bem.js";
|
|
7
|
-
import { UiButton } from "../UiButton/UiButton.js";
|
|
8
|
-
import { UiLabelChecklistRow } from "../UiLabelChecklistRow/UiLabelChecklistRow.js";
|
|
9
|
-
import { UiPopover } from "../UiPopover/UiPopover.js";
|
|
10
|
-
const { b, e } = bem("gd-ui-kit-labels-picker");
|
|
11
|
-
/**
|
|
12
|
-
* Predicate the picker uses to decide whether an item is effectively selected:
|
|
13
|
-
* locked items always count as selected, otherwise membership in the staged
|
|
14
|
-
* `selected` set. Exported so consumers (e.g. the grantee row counter) can
|
|
15
|
-
* apply the same rule without re-encoding it.
|
|
16
|
-
*
|
|
17
|
-
* @internal
|
|
18
|
-
*/
|
|
19
|
-
export const isLabelsPickerItemChecked = (item, selectedIds) => item.locked === true || selectedIds.includes(item.id);
|
|
20
|
-
/**
|
|
21
|
-
* Per-label picker popover. Anchored on a click target; stages selection
|
|
22
|
-
* internally and commits via `onApply`. Locked items are always included
|
|
23
|
-
* — at render time via {@link isLabelsPickerItemChecked} and again at
|
|
24
|
-
* commit via the locked-aware filter.
|
|
25
|
-
*
|
|
26
|
-
* @internal
|
|
27
|
-
*/
|
|
28
|
-
export function UiLabelsPicker({ anchor, items, defaultSelectedIds, onApply, dataTestId, }) {
|
|
29
|
-
const intl = useIntl();
|
|
30
|
-
const groupId = useId();
|
|
31
|
-
return (_jsx(UiPopover, { anchor: anchor, anchorAccessibilityConfig: { ariaHaspopup: "dialog", ariaControls: groupId }, title: intl.formatMessage(olpLabelMessages.popoverTitle), width: 245, content: ({ onClose }) => (_jsx(PickerBody, { items: items, defaultSelectedIds: defaultSelectedIds, onApply: onApply, onClose: onClose, dataTestId: dataTestId, groupId: groupId })) }));
|
|
32
|
-
}
|
|
33
|
-
function PickerBody({ items, defaultSelectedIds, onApply, onClose, dataTestId, groupId }) {
|
|
34
|
-
const intl = useIntl();
|
|
35
|
-
// The user's staged toggles. We never merge locked ids into here — the
|
|
36
|
-
// locked-aware predicate handles that at render and at commit. The body
|
|
37
|
-
// only mounts when the popover opens, so this captures the initial
|
|
38
|
-
// selection once; parent rerenders don't disturb staged edits.
|
|
39
|
-
const [selected, setSelected] = useState(() => [...defaultSelectedIds]);
|
|
40
|
-
const toggle = useCallback((id, next) => {
|
|
41
|
-
setSelected((prev) => next ? (prev.includes(id) ? prev : [...prev, id]) : prev.filter((x) => x !== id));
|
|
42
|
-
}, []);
|
|
43
|
-
const handleApply = useCallback(() => {
|
|
44
|
-
onApply(items.filter((item) => isLabelsPickerItemChecked(item, selected)).map((item) => item.id));
|
|
45
|
-
onClose();
|
|
46
|
-
}, [items, selected, onApply, onClose]);
|
|
47
|
-
const isDirty = useMemo(() => {
|
|
48
|
-
// Compare against the locked-aware initial set so re-Apply on an
|
|
49
|
-
// unchanged selection stays disabled even when defaultSelectedIds
|
|
50
|
-
// omits a locked id (the picker silently includes it).
|
|
51
|
-
const initial = new Set();
|
|
52
|
-
for (const id of defaultSelectedIds)
|
|
53
|
-
initial.add(id);
|
|
54
|
-
for (const item of items)
|
|
55
|
-
if (item.locked)
|
|
56
|
-
initial.add(item.id);
|
|
57
|
-
const current = new Set();
|
|
58
|
-
for (const item of items) {
|
|
59
|
-
if (isLabelsPickerItemChecked(item, selected))
|
|
60
|
-
current.add(item.id);
|
|
61
|
-
}
|
|
62
|
-
if (initial.size !== current.size)
|
|
63
|
-
return true;
|
|
64
|
-
for (const id of initial) {
|
|
65
|
-
if (!current.has(id))
|
|
66
|
-
return true;
|
|
67
|
-
}
|
|
68
|
-
return false;
|
|
69
|
-
}, [items, defaultSelectedIds, selected]);
|
|
70
|
-
const handleKeyDown = (event) => {
|
|
71
|
-
// Enter commits when something has changed — scoped to the items
|
|
72
|
-
// group only so Enter on the footer Cancel/Apply buttons keeps its
|
|
73
|
-
// native semantics.
|
|
74
|
-
if (event.key === "Enter" && isDirty) {
|
|
75
|
-
event.preventDefault();
|
|
76
|
-
handleApply();
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
const suffixFor = (kind) => {
|
|
80
|
-
if (!kind)
|
|
81
|
-
return undefined;
|
|
82
|
-
return intl.formatMessage(kind === "primary" ? olpLabelMessages.suffixPrimary : olpLabelMessages.suffixDefault);
|
|
83
|
-
};
|
|
84
|
-
return (_jsxs("div", { className: b(), "data-testid": dataTestId, children: [
|
|
85
|
-
_jsx("div", { id: groupId, className: e("items"), role: "group", "aria-label": intl.formatMessage(olpLabelMessages.popoverTitle), onKeyDown: handleKeyDown, children: items.map((item) => (_jsx(UiLabelChecklistRow, { label: item.label, kind: item.kind, suffix: suffixFor(item.kind), checked: isLabelsPickerItemChecked(item, selected), disabled: item.locked, onChange: (next) => toggle(item.id, next) }, item.id))) }), _jsxs("div", { className: e("actions"), children: [
|
|
86
|
-
_jsx(UiButton, { variant: "secondary", size: "small", label: intl.formatMessage(commonDialogMessages.cancel), onClick: onClose }), _jsx(UiButton, { variant: "primary", size: "small", label: intl.formatMessage(commonDialogMessages.apply), onClick: handleApply, isDisabled: !isDirty })
|
|
87
|
-
] })
|
|
88
|
-
] }));
|
|
89
|
-
}
|