oolib 2.224.0 → 2.225.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/dist/components/SimpleTable/comps/rowColActionMenus/RowActionsMenu/index.d.ts +2 -1
- package/dist/components/SimpleTable/comps/rowColActionMenus/RowActionsMenu/index.js +4 -4
- package/dist/components/SimpleTable/handlers/handleRowActions.d.ts +6 -3
- package/dist/components/SimpleTable/handlers/handleRowActions.js +13 -12
- package/dist/components/SimpleTable/index.js +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -1
- package/dist/stories/v2/components/Tooltip.stories.d.ts +215 -0
- package/dist/stories/v2/components/Tooltip.stories.js +197 -0
- package/dist/utils/customHooks/useFloatingPosition.d.ts +99 -0
- package/dist/utils/customHooks/useFloatingPosition.js +102 -0
- package/dist/v2/components/TextInputs/index.styled.js +1 -1
- package/dist/v2/components/Tooltip/Layout/TooltipHeading.d.ts +10 -0
- package/dist/v2/components/Tooltip/Layout/TooltipHeading.js +29 -0
- package/dist/v2/components/Tooltip/Layout/TooltipText.d.ts +8 -0
- package/dist/v2/components/Tooltip/Layout/TooltipText.js +28 -0
- package/dist/v2/components/Tooltip/Layout/index.d.ts +2 -0
- package/dist/v2/components/Tooltip/Layout/index.js +10 -0
- package/dist/v2/components/Tooltip/index.d.ts +21 -0
- package/dist/v2/components/Tooltip/index.js +216 -0
- package/dist/v2/components/Tooltip/styled.d.ts +24 -0
- package/dist/v2/components/Tooltip/styled.js +81 -0
- package/dist/v2/components/Tooltip/utils/autoSafeFlip.d.ts +4 -0
- package/dist/v2/components/Tooltip/utils/autoSafeFlip.js +63 -0
- package/dist/v2/components/Tooltip/utils/index.d.ts +26 -0
- package/dist/v2/components/Tooltip/utils/index.js +66 -0
- package/package.json +7 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export function RowActionsMenu({ value, rowIdx, onChange, id, disableAddRow, setActionsActiveOnRow, rowActionsButtonWidth, conditionsToRender }: {
|
|
1
|
+
export function RowActionsMenu({ value, rowIdx, onChange, id, disableAddRow, setActionsActiveOnRow, rowActionsButtonWidth, conditionsToRender, blockConfig }: {
|
|
2
2
|
value: any;
|
|
3
3
|
rowIdx: any;
|
|
4
4
|
onChange: any;
|
|
@@ -7,5 +7,6 @@ export function RowActionsMenu({ value, rowIdx, onChange, id, disableAddRow, set
|
|
|
7
7
|
setActionsActiveOnRow: any;
|
|
8
8
|
rowActionsButtonWidth: any;
|
|
9
9
|
conditionsToRender?: boolean;
|
|
10
|
+
blockConfig: any;
|
|
10
11
|
}): React.JSX.Element;
|
|
11
12
|
import React from "react";
|
|
@@ -60,7 +60,7 @@ var styled_1 = require("../styled");
|
|
|
60
60
|
var StyledCustomSelectCompWrapper = styled_components_1.default.button(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n /* width: 1.5rem; */\n height: 2.5rem;\n"], ["\n ", "\n /* width: 1.5rem; */\n height: 2.5rem;\n"])), styled_1.commonRowColActionMenuStyles);
|
|
61
61
|
// const CustomSelectComp =
|
|
62
62
|
var RowActionsMenu = function (_a) {
|
|
63
|
-
var value = _a.value, rowIdx = _a.rowIdx, onChange = _a.onChange, id = _a.id, disableAddRow = _a.disableAddRow, setActionsActiveOnRow = _a.setActionsActiveOnRow, rowActionsButtonWidth = _a.rowActionsButtonWidth, _b = _a.conditionsToRender, conditionsToRender = _b === void 0 ? true : _b;
|
|
63
|
+
var value = _a.value, rowIdx = _a.rowIdx, onChange = _a.onChange, id = _a.id, disableAddRow = _a.disableAddRow, setActionsActiveOnRow = _a.setActionsActiveOnRow, rowActionsButtonWidth = _a.rowActionsButtonWidth, _b = _a.conditionsToRender, conditionsToRender = _b === void 0 ? true : _b, blockConfig = _a.blockConfig;
|
|
64
64
|
var _c = (0, react_1.useState)(false), actionMenuIsOpen = _c[0], setActionMenuIsOpen = _c[1];
|
|
65
65
|
var isFirstMount = (0, react_1.useRef)(true);
|
|
66
66
|
(0, react_1.useEffect)(function () {
|
|
@@ -98,20 +98,20 @@ var RowActionsMenu = function (_a) {
|
|
|
98
98
|
{
|
|
99
99
|
display: UIContent_1.UIContent.SimpleTable.insertRowBefore,
|
|
100
100
|
onClick: function () {
|
|
101
|
-
return (0, handleRowActions_1.handleInsertRowBefore)({ value: value, rowIdx: rowIdx, onChange: onChange, id: id });
|
|
101
|
+
return (0, handleRowActions_1.handleInsertRowBefore)({ value: value, rowIdx: rowIdx, onChange: onChange, id: id, blockConfig: blockConfig });
|
|
102
102
|
},
|
|
103
103
|
},
|
|
104
104
|
{
|
|
105
105
|
display: UIContent_1.UIContent.SimpleTable.insertRowAfter,
|
|
106
106
|
onClick: function () {
|
|
107
|
-
return (0, handleRowActions_1.handleInsertRowAfter)({ value: value, rowIdx: rowIdx, onChange: onChange, id: id });
|
|
107
|
+
return (0, handleRowActions_1.handleInsertRowAfter)({ value: value, rowIdx: rowIdx, onChange: onChange, id: id, blockConfig: blockConfig });
|
|
108
108
|
},
|
|
109
109
|
},
|
|
110
110
|
] : []), true), [
|
|
111
111
|
{
|
|
112
112
|
display: UIContent_1.UIContent.SimpleTable.clearContent,
|
|
113
113
|
onClick: function () {
|
|
114
|
-
return (0, handleRowActions_1.handleClearRowContent)({ value: value, rowIdx: rowIdx, onChange: onChange, id: id });
|
|
114
|
+
return (0, handleRowActions_1.handleClearRowContent)({ value: value, rowIdx: rowIdx, onChange: onChange, id: id, blockConfig: blockConfig });
|
|
115
115
|
},
|
|
116
116
|
},
|
|
117
117
|
], false) })));
|
|
@@ -11,21 +11,24 @@ export function handleDuplicateRow({ value, rowIdx, onChange, id }: {
|
|
|
11
11
|
onChange: any;
|
|
12
12
|
id: any;
|
|
13
13
|
}): void;
|
|
14
|
-
export function handleInsertRowAfter({ value, rowIdx, onChange, id }: {
|
|
14
|
+
export function handleInsertRowAfter({ value, rowIdx, onChange, id, blockConfig }: {
|
|
15
15
|
value: any;
|
|
16
16
|
rowIdx: any;
|
|
17
17
|
onChange: any;
|
|
18
18
|
id: any;
|
|
19
|
+
blockConfig: any;
|
|
19
20
|
}): void;
|
|
20
|
-
export function handleInsertRowBefore({ value, rowIdx, onChange, id }: {
|
|
21
|
+
export function handleInsertRowBefore({ value, rowIdx, onChange, id, blockConfig }: {
|
|
21
22
|
value: any;
|
|
22
23
|
rowIdx: any;
|
|
23
24
|
onChange: any;
|
|
24
25
|
id: any;
|
|
26
|
+
blockConfig: any;
|
|
25
27
|
}): void;
|
|
26
|
-
export function handleClearRowContent({ value, rowIdx, onChange, id }: {
|
|
28
|
+
export function handleClearRowContent({ value, rowIdx, onChange, id, blockConfig }: {
|
|
27
29
|
value: any;
|
|
28
30
|
rowIdx: any;
|
|
29
31
|
onChange: any;
|
|
30
32
|
id: any;
|
|
33
|
+
blockConfig: any;
|
|
31
34
|
}): void;
|
|
@@ -24,21 +24,22 @@ exports.handleClearRowContent = exports.handleInsertRowBefore = exports.handleIn
|
|
|
24
24
|
var makeArrayFromLength_1 = require("../../../utils/makeArrayFromLength");
|
|
25
25
|
var genHash_1 = require("../utils/genHash");
|
|
26
26
|
var genNewRow = function (_a) {
|
|
27
|
-
var data = _a.data, rowIdx = _a.rowIdx;
|
|
27
|
+
var data = _a.data, rowIdx = _a.rowIdx, blockConfig = _a.blockConfig;
|
|
28
28
|
var totCells = data[rowIdx].cellData.length;
|
|
29
29
|
return ({
|
|
30
30
|
id: "row_".concat((0, genHash_1.genHash)(8)),
|
|
31
|
-
cellData: (0, makeArrayFromLength_1.makeArrayFromLength)(totCells).map(function (d, i) {
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
cellData: (0, makeArrayFromLength_1.makeArrayFromLength)(totCells).map(function (d, i) {
|
|
32
|
+
var _a, _b;
|
|
33
|
+
return (__assign(__assign({ id: "cell_".concat((0, genHash_1.genHash)(8)) }, (((_a = blockConfig === null || blockConfig === void 0 ? void 0 : blockConfig[i]) === null || _a === void 0 ? void 0 : _a.comp) ? { comp: blockConfig[i].comp } : {})), (((_b = blockConfig === null || blockConfig === void 0 ? void 0 : blockConfig[i]) === null || _b === void 0 ? void 0 : _b.props) ? { props: blockConfig[i].props } : {})));
|
|
34
|
+
})
|
|
34
35
|
});
|
|
35
36
|
};
|
|
36
37
|
var handleAddRow = function (value, props) {
|
|
37
|
-
var onChange = props.onChange, id = props.id;
|
|
38
|
+
var onChange = props.onChange, id = props.id, config = props.config;
|
|
38
39
|
var data = value.data, colWidthConfig = value.colWidthConfig;
|
|
39
40
|
var newData = __spreadArray([], data, true);
|
|
40
41
|
var lastRowIdx = newData.length - 1;
|
|
41
|
-
var newRow = genNewRow({ data: newData, rowIdx: lastRowIdx });
|
|
42
|
+
var newRow = genNewRow({ data: newData, rowIdx: lastRowIdx, blockConfig: config === null || config === void 0 ? void 0 : config.blockConfig });
|
|
42
43
|
newData.push(newRow);
|
|
43
44
|
onChange && onChange(id, { data: newData, colWidthConfig: colWidthConfig });
|
|
44
45
|
};
|
|
@@ -61,25 +62,25 @@ var handleDuplicateRow = function (_a) {
|
|
|
61
62
|
};
|
|
62
63
|
exports.handleDuplicateRow = handleDuplicateRow;
|
|
63
64
|
var handleInsertRowAfter = function (_a) {
|
|
64
|
-
var value = _a.value, rowIdx = _a.rowIdx, onChange = _a.onChange, id = _a.id;
|
|
65
|
+
var value = _a.value, rowIdx = _a.rowIdx, onChange = _a.onChange, id = _a.id, blockConfig = _a.blockConfig;
|
|
65
66
|
var data = value.data, colWidthConfig = value.colWidthConfig;
|
|
66
67
|
var newData = __spreadArray([], data, true);
|
|
67
|
-
var newRow = genNewRow({ data: newData, rowIdx: rowIdx });
|
|
68
|
+
var newRow = genNewRow({ data: newData, rowIdx: rowIdx, blockConfig: blockConfig });
|
|
68
69
|
newData.splice(rowIdx + 1, 0, newRow);
|
|
69
70
|
onChange && onChange(id, { data: newData, colWidthConfig: colWidthConfig });
|
|
70
71
|
};
|
|
71
72
|
exports.handleInsertRowAfter = handleInsertRowAfter;
|
|
72
73
|
var handleInsertRowBefore = function (_a) {
|
|
73
|
-
var value = _a.value, rowIdx = _a.rowIdx, onChange = _a.onChange, id = _a.id;
|
|
74
|
+
var value = _a.value, rowIdx = _a.rowIdx, onChange = _a.onChange, id = _a.id, blockConfig = _a.blockConfig;
|
|
74
75
|
var data = value.data, colWidthConfig = value.colWidthConfig;
|
|
75
76
|
var newData = __spreadArray([], data, true);
|
|
76
|
-
var newRow = genNewRow({ data: newData, rowIdx: rowIdx });
|
|
77
|
+
var newRow = genNewRow({ data: newData, rowIdx: rowIdx, blockConfig: blockConfig });
|
|
77
78
|
newData.splice(rowIdx, 0, newRow);
|
|
78
79
|
onChange && onChange(id, { data: newData, colWidthConfig: colWidthConfig });
|
|
79
80
|
};
|
|
80
81
|
exports.handleInsertRowBefore = handleInsertRowBefore;
|
|
81
82
|
var handleClearRowContent = function (_a) {
|
|
82
|
-
var value = _a.value, rowIdx = _a.rowIdx, onChange = _a.onChange, id = _a.id;
|
|
83
|
+
var value = _a.value, rowIdx = _a.rowIdx, onChange = _a.onChange, id = _a.id, blockConfig = _a.blockConfig;
|
|
83
84
|
var data = value.data, colWidthConfig = value.colWidthConfig;
|
|
84
85
|
var newData = __spreadArray([], data, true);
|
|
85
86
|
/**
|
|
@@ -88,7 +89,7 @@ var handleClearRowContent = function (_a) {
|
|
|
88
89
|
* ensures the the RTE used within the cell is reinitiated and the previous value in it is cleared.
|
|
89
90
|
* (since RTEs are not controlled components)
|
|
90
91
|
*/
|
|
91
|
-
var newRow = genNewRow({ data: newData, rowIdx: rowIdx });
|
|
92
|
+
var newRow = genNewRow({ data: newData, rowIdx: rowIdx, blockConfig: blockConfig });
|
|
92
93
|
newData.splice(rowIdx, 1, newRow);
|
|
93
94
|
onChange && onChange(id, { data: newData, colWidthConfig: colWidthConfig });
|
|
94
95
|
};
|
|
@@ -244,6 +244,7 @@ function SimpleTable(_a) {
|
|
|
244
244
|
rowIdx === 0 &&
|
|
245
245
|
hoveredRowAndCol.colIdx === cellIdx }),
|
|
246
246
|
!config.disableRowActionsMenu && react_1.default.createElement(RowActionsMenu_1.RowActionsMenu, { value: value, rowIdx: rowIdx, onChange: onChange, id: id, setActionsActiveOnRow: setActionsActiveOnRow, rowActionsButtonWidth: rowActionsButtonWidth, disableAddRow: config === null || config === void 0 ? void 0 : config.disableAddRow,
|
|
247
|
+
blockConfig: config === null || config === void 0 ? void 0 : config.blockConfig,
|
|
247
248
|
conditionsToRender: !readOnly &&
|
|
248
249
|
enableRowActions &&
|
|
249
250
|
cellIdx === 0 &&
|
package/dist/index.d.ts
CHANGED
|
@@ -76,6 +76,7 @@ export { CheckboxButton } from "./v2/components/RadioAndCheckbox/comps/CheckboxL
|
|
|
76
76
|
export { RadioList } from "./v2/components/RadioAndCheckbox/comps/RadioList/index";
|
|
77
77
|
export { List } from "./v2/components/List";
|
|
78
78
|
export { ListItem } from "./v2/components/List/comps/ListItem";
|
|
79
|
+
export { default as TooltipV2 } from "./v2/components/Tooltip";
|
|
79
80
|
export * as baseStyling from "./v2/themes/utils/baseStyling";
|
|
80
81
|
export { LoaderCircle, ProgressBar, LoaderCircle as Loader, LoaderOverlay } from "./components/LoadersAndProgress";
|
|
81
82
|
export { TagClear, TagLink, TagSelect, TagDisplay } from "./components/Tags";
|
package/dist/index.js
CHANGED
|
@@ -41,7 +41,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
41
41
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
42
|
exports.BannerInfo = exports.BannerAlert = exports.GroupQuestionsInputSingle = exports.ResourceInput = exports.IFrameInput = exports.PDFInput = exports.AudioInput = exports.VideoInput = exports.ProfileImageInput = exports.ImageInput = exports.MetaBlock = exports.parseCardConfig = exports.ListProfile = exports.CardProfile = exports.CardEmbed = exports.DateTimeRangePicker = exports.DateTimePicker = exports.TimeRangePicker = exports.TimePicker = exports.DateRangePicker = exports.DatePicker = exports.TextLoader = exports.PageScrollIndicator = exports.HomeCover = exports.EmptyStates = exports.ModalSmall = exports.Modal = exports.ModalForms = exports.ModalConfirm = exports.SkeletonLoader = exports.Divider = exports.PercentCompletedPie = exports.Accordion = exports.ActionMenu = exports.Tooltip = exports.OKELink = exports.UserRoleBadge = exports.Section = exports.TagDisplay = exports.TagSelect = exports.TagLink = exports.TagClear = exports.LoaderOverlay = exports.Loader = exports.ProgressBar = exports.LoaderCircle = exports.applyBlackOverlayOnHover = exports.icons = exports.colors = exports.GlobalStyles = void 0;
|
|
43
43
|
exports.List = exports.SwitchDouble = exports.SwitchSingle = exports.RadioButton = exports.RadioInput = exports.RadioList = exports.CheckboxButton = exports.CheckboxInput = exports.CheckboxList = exports.AccordionV2 = exports.HomeCoverV2 = exports.DateRangePickerV2 = exports.MetaBlockV2 = exports.typoV2_CSS = exports.colors2 = exports.TabBarV2 = exports.ButtonUpload = exports.ButtonGhostCompact = exports.ButtonTertiaryCompact = exports.ButtonSecondaryCompact = exports.ButtonPrimaryCompact = exports.ButtonGhostV2 = exports.ButtonTertiaryV2 = exports.ButtonSecondaryV2 = exports.ButtonPrimaryV2 = exports.TagClearV2 = exports.TagLinkV2 = exports.TagDisplayV2 = exports.generateOptions = exports.genTagComp = exports.OptionsSingle = exports.DropdownMulti = exports.DropdownSingle = exports.HintsProvider = exports.BlockLabel = exports.ListContent = exports.CardContent = exports.URLInput = exports.PasswordInput = exports.PhoneInput = exports.NumberInput = exports.EmailInput = exports.TextInput = exports.TableCellResizerPlugin = exports.styledOKELinkCSS = exports.SimpleTable = exports.ModalConfirmAction = exports.BannerProvider = exports.useBannerContext = exports.BannerContext = void 0;
|
|
44
|
-
exports.baseStyling = exports.ListItem = void 0;
|
|
44
|
+
exports.baseStyling = exports.TooltipV2 = exports.ListItem = void 0;
|
|
45
45
|
//css and styling related ( styled-components )
|
|
46
46
|
var globalStyles_1 = require("./globalStyles");
|
|
47
47
|
Object.defineProperty(exports, "GlobalStyles", { enumerable: true, get: function () { return globalStyles_1.GlobalStyles; } });
|
|
@@ -249,4 +249,6 @@ var List_1 = require("./v2/components/List");
|
|
|
249
249
|
Object.defineProperty(exports, "List", { enumerable: true, get: function () { return List_1.List; } });
|
|
250
250
|
var ListItem_1 = require("./v2/components/List/comps/ListItem");
|
|
251
251
|
Object.defineProperty(exports, "ListItem", { enumerable: true, get: function () { return ListItem_1.ListItem; } });
|
|
252
|
+
var Tooltip_2 = require("./v2/components/Tooltip");
|
|
253
|
+
Object.defineProperty(exports, "TooltipV2", { enumerable: true, get: function () { return __importDefault(Tooltip_2).default; } });
|
|
252
254
|
exports.baseStyling = __importStar(require("./v2/themes/utils/baseStyling"));
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
export let title: string;
|
|
3
|
+
export { Tooltip as component };
|
|
4
|
+
export namespace argTypes {
|
|
5
|
+
namespace text {
|
|
6
|
+
let name: string;
|
|
7
|
+
let control: string;
|
|
8
|
+
let description: string;
|
|
9
|
+
}
|
|
10
|
+
namespace heading {
|
|
11
|
+
let name_1: string;
|
|
12
|
+
export { name_1 as name };
|
|
13
|
+
let control_1: string;
|
|
14
|
+
export { control_1 as control };
|
|
15
|
+
let description_1: string;
|
|
16
|
+
export { description_1 as description };
|
|
17
|
+
}
|
|
18
|
+
namespace primaryContentType {
|
|
19
|
+
let name_2: string;
|
|
20
|
+
export { name_2 as name };
|
|
21
|
+
export let options: string[];
|
|
22
|
+
export namespace control_2 {
|
|
23
|
+
let type: string;
|
|
24
|
+
}
|
|
25
|
+
export { control_2 as control };
|
|
26
|
+
let description_2: string;
|
|
27
|
+
export { description_2 as description };
|
|
28
|
+
}
|
|
29
|
+
namespace secondaryContentType {
|
|
30
|
+
let name_3: string;
|
|
31
|
+
export { name_3 as name };
|
|
32
|
+
let options_1: string[];
|
|
33
|
+
export { options_1 as options };
|
|
34
|
+
export namespace control_3 {
|
|
35
|
+
let type_1: string;
|
|
36
|
+
export { type_1 as type };
|
|
37
|
+
}
|
|
38
|
+
export { control_3 as control };
|
|
39
|
+
let description_3: string;
|
|
40
|
+
export { description_3 as description };
|
|
41
|
+
}
|
|
42
|
+
namespace progressiveDelay {
|
|
43
|
+
let name_4: string;
|
|
44
|
+
export { name_4 as name };
|
|
45
|
+
export namespace control_4 {
|
|
46
|
+
let type_2: string;
|
|
47
|
+
export { type_2 as type };
|
|
48
|
+
export let min: number;
|
|
49
|
+
export let max: number;
|
|
50
|
+
export let step: number;
|
|
51
|
+
}
|
|
52
|
+
export { control_4 as control };
|
|
53
|
+
let description_4: string;
|
|
54
|
+
export { description_4 as description };
|
|
55
|
+
}
|
|
56
|
+
namespace progressiveGap {
|
|
57
|
+
let name_5: string;
|
|
58
|
+
export { name_5 as name };
|
|
59
|
+
export namespace control_5 {
|
|
60
|
+
let type_3: string;
|
|
61
|
+
export { type_3 as type };
|
|
62
|
+
let min_1: number;
|
|
63
|
+
export { min_1 as min };
|
|
64
|
+
let max_1: number;
|
|
65
|
+
export { max_1 as max };
|
|
66
|
+
let step_1: number;
|
|
67
|
+
export { step_1 as step };
|
|
68
|
+
}
|
|
69
|
+
export { control_5 as control };
|
|
70
|
+
let description_5: string;
|
|
71
|
+
export { description_5 as description };
|
|
72
|
+
}
|
|
73
|
+
namespace placement {
|
|
74
|
+
let name_6: string;
|
|
75
|
+
export { name_6 as name };
|
|
76
|
+
let options_2: string[];
|
|
77
|
+
export { options_2 as options };
|
|
78
|
+
export namespace control_6 {
|
|
79
|
+
let type_4: string;
|
|
80
|
+
export { type_4 as type };
|
|
81
|
+
}
|
|
82
|
+
export { control_6 as control };
|
|
83
|
+
}
|
|
84
|
+
namespace showDelay {
|
|
85
|
+
let name_7: string;
|
|
86
|
+
export { name_7 as name };
|
|
87
|
+
export namespace control_7 {
|
|
88
|
+
let type_5: string;
|
|
89
|
+
export { type_5 as type };
|
|
90
|
+
let min_2: number;
|
|
91
|
+
export { min_2 as min };
|
|
92
|
+
let max_2: number;
|
|
93
|
+
export { max_2 as max };
|
|
94
|
+
let step_2: number;
|
|
95
|
+
export { step_2 as step };
|
|
96
|
+
}
|
|
97
|
+
export { control_7 as control };
|
|
98
|
+
let description_6: string;
|
|
99
|
+
export { description_6 as description };
|
|
100
|
+
}
|
|
101
|
+
namespace hideDelay {
|
|
102
|
+
let name_8: string;
|
|
103
|
+
export { name_8 as name };
|
|
104
|
+
export namespace control_8 {
|
|
105
|
+
let type_6: string;
|
|
106
|
+
export { type_6 as type };
|
|
107
|
+
let min_3: number;
|
|
108
|
+
export { min_3 as min };
|
|
109
|
+
let max_3: number;
|
|
110
|
+
export { max_3 as max };
|
|
111
|
+
let step_3: number;
|
|
112
|
+
export { step_3 as step };
|
|
113
|
+
}
|
|
114
|
+
export { control_8 as control };
|
|
115
|
+
let description_7: string;
|
|
116
|
+
export { description_7 as description };
|
|
117
|
+
}
|
|
118
|
+
namespace animation {
|
|
119
|
+
let name_9: string;
|
|
120
|
+
export { name_9 as name };
|
|
121
|
+
let options_3: string[];
|
|
122
|
+
export { options_3 as options };
|
|
123
|
+
export namespace control_9 {
|
|
124
|
+
let type_7: string;
|
|
125
|
+
export { type_7 as type };
|
|
126
|
+
}
|
|
127
|
+
export { control_9 as control };
|
|
128
|
+
let description_8: string;
|
|
129
|
+
export { description_8 as description };
|
|
130
|
+
}
|
|
131
|
+
namespace showPointer {
|
|
132
|
+
let name_10: string;
|
|
133
|
+
export { name_10 as name };
|
|
134
|
+
let control_10: string;
|
|
135
|
+
export { control_10 as control };
|
|
136
|
+
let description_9: string;
|
|
137
|
+
export { description_9 as description };
|
|
138
|
+
}
|
|
139
|
+
namespace followCursor {
|
|
140
|
+
let name_11: string;
|
|
141
|
+
export { name_11 as name };
|
|
142
|
+
let control_11: string;
|
|
143
|
+
export { control_11 as control };
|
|
144
|
+
let description_10: string;
|
|
145
|
+
export { description_10 as description };
|
|
146
|
+
}
|
|
147
|
+
namespace cursorOffset {
|
|
148
|
+
let name_12: string;
|
|
149
|
+
export { name_12 as name };
|
|
150
|
+
export namespace control_12 {
|
|
151
|
+
let type_8: string;
|
|
152
|
+
export { type_8 as type };
|
|
153
|
+
let min_4: number;
|
|
154
|
+
export { min_4 as min };
|
|
155
|
+
let max_4: number;
|
|
156
|
+
export { max_4 as max };
|
|
157
|
+
let step_4: number;
|
|
158
|
+
export { step_4 as step };
|
|
159
|
+
}
|
|
160
|
+
export { control_12 as control };
|
|
161
|
+
let description_11: string;
|
|
162
|
+
export { description_11 as description };
|
|
163
|
+
}
|
|
164
|
+
namespace invert {
|
|
165
|
+
let name_13: string;
|
|
166
|
+
export { name_13 as name };
|
|
167
|
+
let control_13: string;
|
|
168
|
+
export { control_13 as control };
|
|
169
|
+
let description_12: string;
|
|
170
|
+
export { description_12 as description };
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
export namespace args {
|
|
174
|
+
let text_1: string;
|
|
175
|
+
export { text_1 as text };
|
|
176
|
+
let heading_1: string;
|
|
177
|
+
export { heading_1 as heading };
|
|
178
|
+
let primaryContentType_1: string;
|
|
179
|
+
export { primaryContentType_1 as primaryContentType };
|
|
180
|
+
let secondaryContentType_1: string;
|
|
181
|
+
export { secondaryContentType_1 as secondaryContentType };
|
|
182
|
+
let progressiveDelay_1: number;
|
|
183
|
+
export { progressiveDelay_1 as progressiveDelay };
|
|
184
|
+
let progressiveGap_1: number;
|
|
185
|
+
export { progressiveGap_1 as progressiveGap };
|
|
186
|
+
let placement_1: string;
|
|
187
|
+
export { placement_1 as placement };
|
|
188
|
+
let showDelay_1: number;
|
|
189
|
+
export { showDelay_1 as showDelay };
|
|
190
|
+
let hideDelay_1: number;
|
|
191
|
+
export { hideDelay_1 as hideDelay };
|
|
192
|
+
let animation_1: string;
|
|
193
|
+
export { animation_1 as animation };
|
|
194
|
+
let showPointer_1: boolean;
|
|
195
|
+
export { showPointer_1 as showPointer };
|
|
196
|
+
let followCursor_1: boolean;
|
|
197
|
+
export { followCursor_1 as followCursor };
|
|
198
|
+
let cursorOffset_1: number;
|
|
199
|
+
export { cursorOffset_1 as cursorOffset };
|
|
200
|
+
let invert_1: boolean;
|
|
201
|
+
export { invert_1 as invert };
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
export default _default;
|
|
205
|
+
export function Tooltip_(args: any): React.JSX.Element;
|
|
206
|
+
export function EdgeCases(): React.JSX.Element;
|
|
207
|
+
export namespace EdgeCases {
|
|
208
|
+
namespace parameters {
|
|
209
|
+
namespace controls {
|
|
210
|
+
let disable: boolean;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
import Tooltip from '../../../v2/components/Tooltip';
|
|
215
|
+
import React from 'react';
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.EdgeCases = exports.Tooltip_ = void 0;
|
|
18
|
+
var react_1 = __importDefault(require("react"));
|
|
19
|
+
var Tooltip_1 = __importDefault(require("../../../v2/components/Tooltip"));
|
|
20
|
+
var icons_1 = require("../../../icons");
|
|
21
|
+
var Typo_1 = require("../../../components/Typo");
|
|
22
|
+
var Info = icons_1.icons.Info;
|
|
23
|
+
var contentOptions = {
|
|
24
|
+
'None': null,
|
|
25
|
+
'TooltipText': {
|
|
26
|
+
layout: 'TooltipText',
|
|
27
|
+
props: {
|
|
28
|
+
text: "The purple elephant danced across the neon sky, balancing a slice of pepperoni pizza on its trunk while humming a tune that only dolphins could understand."
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
'TooltipHeading': {
|
|
32
|
+
layout: 'TooltipHeading',
|
|
33
|
+
props: {
|
|
34
|
+
heading: "Heading",
|
|
35
|
+
text: "The purple elephant danced across the neon sky, balancing a slice of pepperoni pizza on its trunk while humming a tune that only dolphins could understand."
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
'Custom': {
|
|
39
|
+
layout: 'custom',
|
|
40
|
+
render: (react_1.default.createElement("div", { style: { padding: '0.8rem', maxWidth: '280px' } },
|
|
41
|
+
react_1.default.createElement(Typo_1.SANS_2, null, "This is custom JSX content!")))
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
exports.default = {
|
|
45
|
+
title: 'Oolib V 2.0/components/Tooltip',
|
|
46
|
+
component: Tooltip_1.default,
|
|
47
|
+
argTypes: {
|
|
48
|
+
// Simple API
|
|
49
|
+
text: {
|
|
50
|
+
name: "Text",
|
|
51
|
+
control: 'text',
|
|
52
|
+
description: 'Simple text content for the tooltip (used when primaryContent is not set)',
|
|
53
|
+
},
|
|
54
|
+
heading: {
|
|
55
|
+
name: "Heading",
|
|
56
|
+
control: 'text',
|
|
57
|
+
description: 'Heading text (when provided with text, renders TooltipHeading layout)',
|
|
58
|
+
},
|
|
59
|
+
// Advanced API
|
|
60
|
+
primaryContentType: {
|
|
61
|
+
name: "Primary Content (Advanced)",
|
|
62
|
+
options: ['None', 'TooltipText', 'TooltipHeading', 'Custom'],
|
|
63
|
+
control: { type: 'select' },
|
|
64
|
+
description: 'Advanced: Select primary content layout (overrides text/heading)',
|
|
65
|
+
},
|
|
66
|
+
secondaryContentType: {
|
|
67
|
+
name: "Secondary Content",
|
|
68
|
+
options: ['None', 'TooltipText', 'TooltipHeading', 'Custom'],
|
|
69
|
+
control: { type: 'select' },
|
|
70
|
+
description: 'Select secondary content layout (appears after delay)',
|
|
71
|
+
},
|
|
72
|
+
progressiveDelay: {
|
|
73
|
+
name: "Progressive Delay (ms)",
|
|
74
|
+
control: { type: 'number', min: 0, max: 5000, step: 100 },
|
|
75
|
+
description: 'Delay before showing secondary layout',
|
|
76
|
+
},
|
|
77
|
+
progressiveGap: {
|
|
78
|
+
name: "Progressive Gap (px)",
|
|
79
|
+
control: { type: 'number', min: 0, max: 50, step: 1 },
|
|
80
|
+
description: 'Gap between primary and secondary tooltip',
|
|
81
|
+
},
|
|
82
|
+
placement: {
|
|
83
|
+
name: "Placement",
|
|
84
|
+
options: ['top', 'bottom', 'left', 'right', 'top-start', 'top-end', 'bottom-start', 'bottom-end', 'left-start', 'left-end', 'right-start', 'right-end'],
|
|
85
|
+
control: { type: 'select' },
|
|
86
|
+
},
|
|
87
|
+
showDelay: {
|
|
88
|
+
name: "Show Delay (ms)",
|
|
89
|
+
control: { type: 'number', min: 0, max: 5000, step: 100 },
|
|
90
|
+
description: 'Delay in milliseconds before tooltip appears',
|
|
91
|
+
},
|
|
92
|
+
hideDelay: {
|
|
93
|
+
name: "Hide Delay (ms)",
|
|
94
|
+
control: { type: 'number', min: 0, max: 5000, step: 100 },
|
|
95
|
+
description: 'Delay in milliseconds before tooltip disappears',
|
|
96
|
+
},
|
|
97
|
+
animation: {
|
|
98
|
+
name: "Animation",
|
|
99
|
+
options: ['none', 'fade'],
|
|
100
|
+
control: { type: 'inline-radio' },
|
|
101
|
+
description: 'Animation style for tooltip appearance',
|
|
102
|
+
},
|
|
103
|
+
showPointer: {
|
|
104
|
+
name: "Show Pointer",
|
|
105
|
+
control: 'boolean',
|
|
106
|
+
description: 'Show or hide the tooltip arrow pointer',
|
|
107
|
+
},
|
|
108
|
+
followCursor: {
|
|
109
|
+
name: "Follow Cursor",
|
|
110
|
+
control: 'boolean',
|
|
111
|
+
description: 'Tooltip follows mouse cursor',
|
|
112
|
+
},
|
|
113
|
+
cursorOffset: {
|
|
114
|
+
name: "Cursor Offset (px)",
|
|
115
|
+
control: { type: 'number', min: 0, max: 50, step: 1 },
|
|
116
|
+
description: 'Distance from cursor (when followCursor is true)',
|
|
117
|
+
},
|
|
118
|
+
invert: {
|
|
119
|
+
name: "Invert",
|
|
120
|
+
control: 'boolean',
|
|
121
|
+
description: 'Invert tooltip colors (white background, black text)',
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
args: {
|
|
125
|
+
text: 'The purple elephant danced across the neon sky, balancing a slice of pepperoni pizza on its trunk.',
|
|
126
|
+
heading: '',
|
|
127
|
+
primaryContentType: 'None',
|
|
128
|
+
secondaryContentType: 'None',
|
|
129
|
+
progressiveDelay: 1000,
|
|
130
|
+
progressiveGap: 8,
|
|
131
|
+
placement: 'top',
|
|
132
|
+
showDelay: 0,
|
|
133
|
+
hideDelay: 0,
|
|
134
|
+
animation: 'none',
|
|
135
|
+
showPointer: true,
|
|
136
|
+
followCursor: false,
|
|
137
|
+
cursorOffset: 10,
|
|
138
|
+
invert: false,
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
var Tooltip_ = function (args) {
|
|
142
|
+
// If primaryContent is selected (not 'None'), use it; otherwise use text/heading
|
|
143
|
+
var usePrimaryContent = args.primaryContentType && args.primaryContentType !== 'None';
|
|
144
|
+
return (react_1.default.createElement("div", { style: {
|
|
145
|
+
padding: '4rem',
|
|
146
|
+
minHeight: '400px',
|
|
147
|
+
display: 'flex',
|
|
148
|
+
alignItems: 'center',
|
|
149
|
+
justifyContent: 'center'
|
|
150
|
+
} },
|
|
151
|
+
react_1.default.createElement(Tooltip_1.default
|
|
152
|
+
// Simple API - only used when primaryContent is not selected
|
|
153
|
+
, {
|
|
154
|
+
// Simple API - only used when primaryContent is not selected
|
|
155
|
+
text: usePrimaryContent ? undefined : args.text, heading: usePrimaryContent ? undefined : (args.heading || undefined),
|
|
156
|
+
// Advanced API - only used when primaryContent is selected
|
|
157
|
+
primaryContent: usePrimaryContent ? contentOptions[args.primaryContentType] : undefined, secondaryContent: contentOptions[args.secondaryContentType], progressiveDelay: args.progressiveDelay, progressiveGap: args.progressiveGap, placement: args.placement, showDelay: args.showDelay, hideDelay: args.hideDelay, animation: args.animation, showPointer: args.showPointer, followCursor: args.followCursor, cursorOffset: args.cursorOffset, invert: args.invert }, args.followCursor ? (react_1.default.createElement("div", { style: {
|
|
158
|
+
width: '200px',
|
|
159
|
+
height: '150px',
|
|
160
|
+
backgroundColor: '#f0f0f0',
|
|
161
|
+
borderRadius: '8px',
|
|
162
|
+
display: 'flex',
|
|
163
|
+
alignItems: 'center',
|
|
164
|
+
justifyContent: 'center',
|
|
165
|
+
border: '2px dashed #ccc',
|
|
166
|
+
cursor: 'default',
|
|
167
|
+
} },
|
|
168
|
+
react_1.default.createElement(Typo_1.SANS_2, null, "Hover and move cursor"))) : (react_1.default.createElement(Info, { size: 24 })))));
|
|
169
|
+
};
|
|
170
|
+
exports.Tooltip_ = Tooltip_;
|
|
171
|
+
var TooltipItem = function (_a) {
|
|
172
|
+
var label = _a.label, placement = _a.placement, position = _a.position;
|
|
173
|
+
return (react_1.default.createElement("div", { style: __assign(__assign({ position: 'absolute' }, position), { display: 'flex', flexDirection: 'column', alignItems: 'center', gap: '4px' }) },
|
|
174
|
+
react_1.default.createElement("span", { style: { fontSize: '11px', color: '#666', textAlign: 'center', maxWidth: '100px' } }, label),
|
|
175
|
+
react_1.default.createElement(Tooltip_1.default, { primaryContent: contentOptions['TooltipText'], placement: placement },
|
|
176
|
+
react_1.default.createElement(Info, { size: 24 }))));
|
|
177
|
+
};
|
|
178
|
+
var EdgeCases = function () { return (react_1.default.createElement("div", { style: {
|
|
179
|
+
position: 'relative',
|
|
180
|
+
width: '100%',
|
|
181
|
+
height: '600px',
|
|
182
|
+
border: '2px dashed #ccc',
|
|
183
|
+
borderRadius: '8px',
|
|
184
|
+
overflow: 'visible'
|
|
185
|
+
} },
|
|
186
|
+
react_1.default.createElement(TooltipItem, { label: "Top-Left Corner", placement: "bottom", position: { top: '10px', left: '10px' } }),
|
|
187
|
+
react_1.default.createElement(TooltipItem, { label: "Top-Right Corner", placement: "bottom", position: { top: '10px', right: '10px' } }),
|
|
188
|
+
react_1.default.createElement(TooltipItem, { label: "Bottom-Left Corner", placement: "top", position: { bottom: '10px', left: '10px' } }),
|
|
189
|
+
react_1.default.createElement(TooltipItem, { label: "Bottom-Right Corner", placement: "top", position: { bottom: '10px', right: '10px' } }),
|
|
190
|
+
react_1.default.createElement(TooltipItem, { label: "Top Edge Center", placement: "bottom", position: { top: '10px', left: '50%', transform: 'translateX(-50%)' } }),
|
|
191
|
+
react_1.default.createElement(TooltipItem, { label: "Bottom Edge Center", placement: "top", position: { bottom: '10px', left: '50%', transform: 'translateX(-50%)' } }),
|
|
192
|
+
react_1.default.createElement(TooltipItem, { label: "Left Edge Center", placement: "right", position: { top: '50%', left: '10px', transform: 'translateY(-50%)' } }),
|
|
193
|
+
react_1.default.createElement(TooltipItem, { label: "Right Edge Center", placement: "left", position: { top: '50%', right: '10px', transform: 'translateY(-50%)' } }))); };
|
|
194
|
+
exports.EdgeCases = EdgeCases;
|
|
195
|
+
exports.EdgeCases.parameters = {
|
|
196
|
+
controls: { disable: true }
|
|
197
|
+
};
|