oolib 2.202.0 → 2.203.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/dist/icons/index.d.ts +6 -0
- package/dist/icons/index.js +3 -0
- package/dist/v2/components/Dropdowns/DropdownMulti/index.js +6 -1
- package/dist/v2/components/Dropdowns/comps/SelectTagsInput/index.d.ts +2 -1
- package/dist/v2/components/Dropdowns/comps/SelectTagsInput/index.js +19 -33
- package/dist/v2/components/Dropdowns/comps/SelectTagsInput/styled.d.ts +1 -2
- package/dist/v2/components/Dropdowns/comps/SelectTagsInput/styled.js +7 -44
- package/dist/v2/components/Dropdowns/utils/genTagComp.js +5 -1
- package/dist/v2/components/dataviz/HeatMapGrid/utils/useAxisMeasure.js +1 -1
- package/package.json +1 -1
package/dist/icons/index.d.ts
CHANGED
|
@@ -131,6 +131,9 @@ export namespace icons {
|
|
|
131
131
|
export { ChartBarHorizontal };
|
|
132
132
|
export { GridNine };
|
|
133
133
|
export { ChartDonut };
|
|
134
|
+
export { Translate };
|
|
135
|
+
export { SlidersHorizontal };
|
|
136
|
+
export { Stack };
|
|
134
137
|
export { OkeGoogleIcon };
|
|
135
138
|
export { LetterH };
|
|
136
139
|
export { IndexIcon };
|
|
@@ -327,6 +330,9 @@ import { ShareIcon as Share } from '@phosphor-icons/react';
|
|
|
327
330
|
import { ChartBarHorizontalIcon as ChartBarHorizontal } from '@phosphor-icons/react';
|
|
328
331
|
import { GridNineIcon as GridNine } from '@phosphor-icons/react';
|
|
329
332
|
import { ChartDonutIcon as ChartDonut } from '@phosphor-icons/react';
|
|
333
|
+
import { TranslateIcon as Translate } from '@phosphor-icons/react';
|
|
334
|
+
import { SlidersHorizontalIcon as SlidersHorizontal } from '@phosphor-icons/react';
|
|
335
|
+
import { StackIcon as Stack } from '@phosphor-icons/react';
|
|
330
336
|
import { OkeGoogleIcon } from "./custom";
|
|
331
337
|
import { LetterH } from "./custom";
|
|
332
338
|
import { IndexIcon } from "./custom";
|
package/dist/icons/index.js
CHANGED
|
@@ -136,6 +136,9 @@ exports.icons = {
|
|
|
136
136
|
ChartBarHorizontal: react_1.ChartBarHorizontalIcon,
|
|
137
137
|
GridNine: react_1.GridNineIcon,
|
|
138
138
|
ChartDonut: react_1.ChartDonutIcon,
|
|
139
|
+
Translate: react_1.TranslateIcon,
|
|
140
|
+
SlidersHorizontal: react_1.SlidersHorizontalIcon,
|
|
141
|
+
Stack: react_1.StackIcon,
|
|
139
142
|
//custom icons
|
|
140
143
|
OkeGoogleIcon: custom_1.OkeGoogleIcon,
|
|
141
144
|
LetterH: custom_1.LetterH,
|
|
@@ -163,6 +163,11 @@ function DropdownMulti(_a) {
|
|
|
163
163
|
// hideShowOtherTextInputOnSelect_MULTI,
|
|
164
164
|
saveValueAsString: saveValueAsString
|
|
165
165
|
}); };
|
|
166
|
+
var handleClearAll = function () {
|
|
167
|
+
var newValForParent = saveValueAsString ? [] : [];
|
|
168
|
+
parentOnChange && parentOnChange(id, newValForParent);
|
|
169
|
+
setSearchString('');
|
|
170
|
+
};
|
|
166
171
|
var genDisplayComp = function () {
|
|
167
172
|
if (!(value === null || value === void 0 ? void 0 : value.length) > 0)
|
|
168
173
|
return null;
|
|
@@ -172,7 +177,7 @@ function DropdownMulti(_a) {
|
|
|
172
177
|
var _h = (0, react_1.useState)(false), focusSelectTagsInput = _h[0], setFocusSelectTagsInput = _h[1];
|
|
173
178
|
var genSelectTagsInput = function (ops) {
|
|
174
179
|
if (ops === void 0) { ops = {}; }
|
|
175
|
-
return (react_1.default.createElement(SelectTagsInput_1.SelectTagsInput, { id: id, value: value, handleSelect: handleSelect, searchString: searchString,
|
|
180
|
+
return (react_1.default.createElement(SelectTagsInput_1.SelectTagsInput, { id: id, value: value, handleSelect: handleSelect, handleClearAll: handleClearAll, searchString: searchString,
|
|
176
181
|
setSearchString: setSearchString,
|
|
177
182
|
single_multi: "multi", placeholder: placeholder, focusSelectTagsInput: focusSelectTagsInput, setFocusSelectTagsInput: setFocusSelectTagsInput, showOptions: showOptions, S: S, disabled: disabled, style: ops.style }));
|
|
178
183
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export function SelectTagsInput({ id, value, disabled, handleSelect, searchString, setSearchString, placeholder, setFocusSelectTagsInput, focusSelectTagsInput, single_multi, showOptions, S, tagColor, style }: {
|
|
1
|
+
export function SelectTagsInput({ id, value, disabled, handleSelect, searchString, setSearchString, placeholder, setFocusSelectTagsInput, focusSelectTagsInput, single_multi, showOptions, S, handleClearAll, tagColor, style }: {
|
|
2
2
|
id: any;
|
|
3
3
|
value: any;
|
|
4
4
|
disabled: any;
|
|
@@ -11,6 +11,7 @@ export function SelectTagsInput({ id, value, disabled, handleSelect, searchStrin
|
|
|
11
11
|
single_multi: any;
|
|
12
12
|
showOptions: any;
|
|
13
13
|
S: any;
|
|
14
|
+
handleClearAll: any;
|
|
14
15
|
tagColor: any;
|
|
15
16
|
style: any;
|
|
16
17
|
}): React.JSX.Element;
|
|
@@ -38,12 +38,14 @@ var react_1 = __importStar(require("react"));
|
|
|
38
38
|
var styled_components_1 = require("styled-components");
|
|
39
39
|
var toArray_1 = require("../../../../../utils/toArray");
|
|
40
40
|
var utilsOolib_1 = require("../../../../../utilsOolib");
|
|
41
|
-
var styled_1 = require("../../styled");
|
|
42
41
|
var genTagComp_1 = require("../../utils/genTagComp");
|
|
43
|
-
var
|
|
42
|
+
var styled_1 = require("./styled");
|
|
44
43
|
var getKeyCode_1 = require("../../../../../utils/getKeyCode");
|
|
45
44
|
var themes_1 = require("../../../../themes");
|
|
45
|
+
var TextInputs_1 = require("../../../TextInputs");
|
|
46
|
+
var Buttons_1 = require("../../../Buttons");
|
|
46
47
|
var Typo2_1 = require("../../../Typo2");
|
|
48
|
+
var __1 = require("../../../../..");
|
|
47
49
|
var SelectTagsInput = function (_a) {
|
|
48
50
|
var
|
|
49
51
|
//from root
|
|
@@ -52,7 +54,7 @@ var SelectTagsInput = function (_a) {
|
|
|
52
54
|
handleSelect = _a.handleSelect, searchString = _a.searchString, setSearchString = _a.setSearchString, placeholder = _a.placeholder,
|
|
53
55
|
// minHeight, // standard | wide | actual height in rem
|
|
54
56
|
setFocusSelectTagsInput = _a.setFocusSelectTagsInput, focusSelectTagsInput = _a.focusSelectTagsInput, //force focus when after an option is selected in multiselect
|
|
55
|
-
single_multi = _a.single_multi, showOptions = _a.showOptions, S = _a.S, tagColor = _a.tagColor, style = _a.style;
|
|
57
|
+
single_multi = _a.single_multi, showOptions = _a.showOptions, S = _a.S, handleClearAll = _a.handleClearAll, tagColor = _a.tagColor, style = _a.style;
|
|
56
58
|
var inputRef = (0, react_1.useRef)(null);
|
|
57
59
|
var theme = (0, styled_components_1.useTheme)();
|
|
58
60
|
var localize = (0, utilsOolib_1.useLocale)();
|
|
@@ -74,32 +76,14 @@ var SelectTagsInput = function (_a) {
|
|
|
74
76
|
handleFocus(true);
|
|
75
77
|
}
|
|
76
78
|
}, [focusSelectTagsInput]);
|
|
77
|
-
var genSelectedTagsTextLabel = function () {
|
|
78
|
-
var TYPO_COMP = S ? Typo2_1.UI_BODY_SM : Typo2_1.UI_BODY;
|
|
79
|
-
return (react_1.default.createElement("div", { style: {
|
|
80
|
-
minHeight: S ? "2rem" : "3rem",
|
|
81
|
-
display: "flex",
|
|
82
|
-
alignItems: "center",
|
|
83
|
-
} },
|
|
84
|
-
react_1.default.createElement(TYPO_COMP, { color: disabled
|
|
85
|
-
? themes_1.colors.grey40
|
|
86
|
-
: themes_1.colors.grey80 }, "".concat(localize('Selected Tags'), ":"))));
|
|
87
|
-
};
|
|
88
79
|
var genSelectComp = function () {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
return (react_1.default.createElement(styled_2.StyledSelectTagsInputContainer, { onKeyDown: blurInputOnEscKey,
|
|
97
|
-
// style={{ minHeight: '9rem' }}
|
|
98
|
-
style: style, className: "".concat(isFocussed ? "focussed" : ""), disabled: disabled, onFocus: function () {
|
|
99
|
-
handleFocus(true);
|
|
100
|
-
}, onBlur: function () { return handleFocus(false); }, tabIndex: 0 },
|
|
101
|
-
react_1.default.createElement(styled_1.StyledTagsInputWrapper, null,
|
|
102
|
-
genSelectedTagsTextLabel(),
|
|
80
|
+
return (react_1.default.createElement(styled_1.StyledSelectTagsWrapper, { style: style, disabled: disabled, className: "".concat(isFocussed ? "focussed" : "") },
|
|
81
|
+
react_1.default.createElement("div", { style: { display: "flex", gap: "0.4rem", alignItems: "center", height: "2.4rem" } },
|
|
82
|
+
" ",
|
|
83
|
+
single_multi === "multi" ?
|
|
84
|
+
react_1.default.createElement(Buttons_1.ButtonTertiaryCompact, { onClick: function () { return handleClearAll(); }, children: "Clear all", disabled: !value || !value.length })
|
|
85
|
+
:
|
|
86
|
+
react_1.default.createElement(Typo2_1.UI_BODY_SEMIBOLD_SM_DF, { style: { color: __1.colors2.grey50 } }, "Selected : "),
|
|
103
87
|
value &&
|
|
104
88
|
(0, toArray_1.toArray)(value).map(function (d) {
|
|
105
89
|
return (0, genTagComp_1.genTagComp)(id, d, {
|
|
@@ -110,11 +94,13 @@ var SelectTagsInput = function (_a) {
|
|
|
110
94
|
S: S,
|
|
111
95
|
color: tagColor
|
|
112
96
|
});
|
|
113
|
-
}),
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
97
|
+
})),
|
|
98
|
+
react_1.default.createElement(TextInputs_1.TextInput, { onKeyDown: blurInputOnEscKey, onFocus: function () {
|
|
99
|
+
handleFocus(true);
|
|
100
|
+
}, ref: inputRef, className: S ? "UI_BODY_SM" : "UI_BODY", style: { color: themes_1.colors.grey80 }, placeholder: localize(placeholder || "Type to Search"), icon: "Tag", value: searchString, onBlur: function () {
|
|
101
|
+
handleFocus(false);
|
|
102
|
+
setFocusSelectTagsInput && setFocusSelectTagsInput(false);
|
|
103
|
+
}, onChange: function (id, v) { return setSearchString(v); } })));
|
|
118
104
|
};
|
|
119
105
|
return genSelectComp();
|
|
120
106
|
};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export const
|
|
2
|
-
export const StyledSelectTagsInputContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
1
|
+
export const StyledSelectTagsWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -3,48 +3,11 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
|
|
|
3
3
|
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
4
|
return cooked;
|
|
5
5
|
};
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
-
}
|
|
12
|
-
Object.defineProperty(o, k2, desc);
|
|
13
|
-
}) : (function(o, m, k, k2) {
|
|
14
|
-
if (k2 === undefined) k2 = k;
|
|
15
|
-
o[k2] = m[k];
|
|
16
|
-
}));
|
|
17
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
18
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
19
|
-
}) : function(o, v) {
|
|
20
|
-
o["default"] = v;
|
|
21
|
-
});
|
|
22
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
23
|
-
var ownKeys = function(o) {
|
|
24
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
25
|
-
var ar = [];
|
|
26
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
27
|
-
return ar;
|
|
28
|
-
};
|
|
29
|
-
return ownKeys(o);
|
|
30
|
-
};
|
|
31
|
-
return function (mod) {
|
|
32
|
-
if (mod && mod.__esModule) return mod;
|
|
33
|
-
var result = {};
|
|
34
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
35
|
-
__setModuleDefault(result, mod);
|
|
36
|
-
return result;
|
|
37
|
-
};
|
|
38
|
-
})();
|
|
6
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
+
};
|
|
39
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
-
exports.
|
|
41
|
-
var styled_components_1 =
|
|
42
|
-
|
|
43
|
-
var
|
|
44
|
-
var themes_1 = require("../../../../themes");
|
|
45
|
-
exports.StyledTagsSelectTextInput = styled_components_1.default.input(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: 100%;\n border: 0;\n width: 100%;\n background-color: inherit;\n \n // this strange bit is to fix the 'zoom into input' issue on ios\n margin: 0 -2rem;\n ", "\n &:focus {\n border: 0;\n }\n\n &::placeholder {\n color: ", ";\n }\n"], ["\n height: 100%;\n border: 0;\n width: 100%;\n background-color: inherit;\n \n // this strange bit is to fix the 'zoom into input' issue on ios\n margin: 0 -2rem;\n ", "\n &:focus {\n border: 0;\n }\n\n &::placeholder {\n color: ", ";\n }\n"])), globalVariables_1.globalInputElemPadding, themes_1.colors.grey40);
|
|
46
|
-
exports.StyledSelectTagsInputContainer = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n cursor: pointer;\n position: relative;\n border-radius: 2px;\n background-color: ", ";\n padding: 1rem 2rem 1rem 2rem;\n ", "\n\n ", ";\n\n ", "\n ", "\n\n height: auto;\n align-items: flex-start;\n"], ["\n cursor: pointer;\n position: relative;\n border-radius: 2px;\n background-color: ", ";\n padding: 1rem 2rem 1rem 2rem;\n ", "\n\n ", ";\n\n ", "\n ", "\n\n height: auto;\n align-items: flex-start;\n"])), themes_1.colors.grey5, function (_a) {
|
|
47
|
-
var disabled = _a.disabled;
|
|
48
|
-
return disabled && (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n pointer-events: none;\n "], ["\n pointer-events: none;\n "])));
|
|
49
|
-
}, (0, mixins_1.transition)("background-color"), globalVariables_1.globalInputElemFocused, globalVariables_1.globalInputElemHover);
|
|
50
|
-
var templateObject_1, templateObject_2, templateObject_3;
|
|
10
|
+
exports.StyledSelectTagsWrapper = void 0;
|
|
11
|
+
var styled_components_1 = __importDefault(require("styled-components"));
|
|
12
|
+
exports.StyledSelectTagsWrapper = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n gap: 0.8rem;\n"], ["\n display: flex;\n flex-direction: column;\n gap: 0.8rem;\n"])));
|
|
13
|
+
var templateObject_1;
|
|
@@ -14,7 +14,11 @@ var genTagComp = function (id, d, options) {
|
|
|
14
14
|
switch (true) {
|
|
15
15
|
case !options.display:
|
|
16
16
|
return (react_1.default.createElement("div", { tabIndex: 0, style: { minWidth: 0 }, onFocus: function (e) { return !showOptions && e.stopPropagation(); } },
|
|
17
|
-
react_1.default.createElement(Tags_1.TagClear
|
|
17
|
+
react_1.default.createElement(Tags_1.TagClear
|
|
18
|
+
// size={options.S}
|
|
19
|
+
, {
|
|
20
|
+
// size={options.S}
|
|
21
|
+
grey: true, display: d.display, onClick: function (e) {
|
|
18
22
|
e.stopPropagation();
|
|
19
23
|
options.handleSelect(options.single_multi === "single" ? undefined : d);
|
|
20
24
|
} })));
|
|
@@ -16,7 +16,7 @@ var useAxisMeasure = function (defaultAxisLabelWidth) {
|
|
|
16
16
|
// console.log({verEL: el})
|
|
17
17
|
verticalRefs.current[index] = el;
|
|
18
18
|
};
|
|
19
|
-
console.log({
|
|
19
|
+
// console.log({horizontalRefs, verticalRefs})
|
|
20
20
|
(0, react_1.useEffect)(function () {
|
|
21
21
|
// Measure horizontal labels
|
|
22
22
|
var maxHorizontalWidth = 0;
|