oolib 2.227.10 → 2.228.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.
@@ -159,6 +159,7 @@ export namespace icons {
159
159
  export { Clipboard };
160
160
  export { Robot };
161
161
  export { Textbox };
162
+ export { Cursor };
162
163
  export { OkeGoogleIcon };
163
164
  export { LetterH };
164
165
  export { IndexIcon };
@@ -388,6 +389,7 @@ import { NoteIcon as Note } from "@phosphor-icons/react";
388
389
  import { ClipboardIcon as Clipboard } from "@phosphor-icons/react";
389
390
  import { RobotIcon as Robot } from "@phosphor-icons/react";
390
391
  import { TextboxIcon as Textbox } from "@phosphor-icons/react";
392
+ import { CursorIcon as Cursor } from "@phosphor-icons/react";
391
393
  import { OkeGoogleIcon } from "./custom";
392
394
  import { LetterH } from "./custom";
393
395
  import { IndexIcon } from "./custom";
@@ -164,6 +164,7 @@ exports.icons = {
164
164
  Clipboard: react_1.ClipboardIcon,
165
165
  Robot: react_1.RobotIcon,
166
166
  Textbox: react_1.TextboxIcon,
167
+ Cursor: react_1.CursorIcon,
167
168
  //custom icons
168
169
  OkeGoogleIcon: custom_1.OkeGoogleIcon,
169
170
  LetterH: custom_1.LetterH,
@@ -1,4 +1,4 @@
1
- export function DropdownMulti({ saveValueAsString, value: valueProp, id, onChange: parentOnChange, className, readOnly, selectClassName, optionsClassName, selectStyleOverride, optionsFn, options: optionsProp, isTagsStyle, isSearchable, searchFieldsConfig, setFilteredOptions: setFilteredOptionsInParent, setSearchString: setSearchStringInParent, searchString: searchStringInParent, label, optionsModalLabel, genCreateTagButton, placeholder, genCustomSelectComp, disableSelectTextUpdate, selectConfig, lightboxHeight, lightboxStyle, optionsAnchor, popOutOfOverflowHiddenParent, S, disabled, broadcastShowOptions, tagColor, searchbarPlaceholder, alignDropdown, variant, matchSelectInputWidth, observerRef }: {
1
+ export function DropdownMulti({ saveValueAsString, value: valueProp, id, onChange: parentOnChange, className, readOnly, selectClassName, optionsClassName, selectStyleOverride, optionsFn, options: optionsProp, isTagsStyle, isSearchable, searchFieldsConfig, setFilteredOptions: setFilteredOptionsInParent, setSearchString: setSearchStringInParent, searchString: searchStringInParent, label, optionsModalLabel, genCreateTagButton, placeholder, genCustomSelectComp, disableSelectTextUpdate, selectConfig, lightboxHeight, lightboxStyle, optionsAnchor, popOutOfOverflowHiddenParent, S, disabled, broadcastShowOptions, tagColor, searchbarPlaceholder, alignDropdown, variant, matchSelectInputWidth, observerRef, content, }: {
2
2
  saveValueAsString: any;
3
3
  value: any;
4
4
  id: any;
@@ -36,5 +36,6 @@ export function DropdownMulti({ saveValueAsString, value: valueProp, id, onChang
36
36
  variant?: string;
37
37
  matchSelectInputWidth?: boolean;
38
38
  observerRef: any;
39
+ content: any;
39
40
  }, ...args: any[]): React.JSX.Element;
40
41
  import React from "react";
@@ -74,7 +74,7 @@ function DropdownMulti(_a) {
74
74
  optionsClassName = _a.optionsClassName, //used to override font size in priimary header
75
75
  selectStyleOverride = _a.selectStyleOverride, optionsFn = _a.optionsFn, optionsProp = _a.options, isTagsStyle = _a.isTagsStyle, isSearchable = _a.isSearchable, searchFieldsConfig = _a.searchFieldsConfig, setFilteredOptionsInParent = _a.setFilteredOptions, setSearchStringInParent = _a.setSearchString, searchStringInParent = _a.searchString, label = _a.label, optionsModalLabel = _a.optionsModalLabel, genCreateTagButton = _a.genCreateTagButton, placeholder = _a.placeholder, genCustomSelectComp = _a.genCustomSelectComp, disableSelectTextUpdate = _a.disableSelectTextUpdate, selectConfig = _a.selectConfig,
76
76
  //props whose existence needs to be questioned:
77
- lightboxHeight = _a.lightboxHeight, lightboxStyle = _a.lightboxStyle, optionsAnchor = _a.optionsAnchor, popOutOfOverflowHiddenParent = _a.popOutOfOverflowHiddenParent, S = _a.S, disabled = _a.disabled, broadcastShowOptions = _a.broadcastShowOptions, tagColor = _a.tagColor, searchbarPlaceholder = _a.searchbarPlaceholder, _b = _a.alignDropdown, alignDropdown = _b === void 0 ? "left" : _b, _c = _a.variant, variant = _c === void 0 ? "default" : _c, _d = _a.matchSelectInputWidth, matchSelectInputWidth = _d === void 0 ? false : _d, observerRef = _a.observerRef;
77
+ lightboxHeight = _a.lightboxHeight, lightboxStyle = _a.lightboxStyle, optionsAnchor = _a.optionsAnchor, popOutOfOverflowHiddenParent = _a.popOutOfOverflowHiddenParent, S = _a.S, disabled = _a.disabled, broadcastShowOptions = _a.broadcastShowOptions, tagColor = _a.tagColor, searchbarPlaceholder = _a.searchbarPlaceholder, _b = _a.alignDropdown, alignDropdown = _b === void 0 ? "left" : _b, _c = _a.variant, variant = _c === void 0 ? "default" : _c, _d = _a.matchSelectInputWidth, matchSelectInputWidth = _d === void 0 ? false : _d, observerRef = _a.observerRef, content = _a.content;
78
78
  var theme = (0, styled_components_1.useTheme)();
79
79
  var props = arguments[0];
80
80
  var value = (0, getValue_1.getValue_MULTI)({ valueProp: valueProp, optionsFn: optionsFn, options: optionsProp, theme: theme, saveValueAsString: saveValueAsString });
@@ -174,17 +174,19 @@ function DropdownMulti(_a) {
174
174
  var genDisplayComp = function () {
175
175
  if (!(value === null || value === void 0 ? void 0 : value.length) > 0)
176
176
  return null;
177
- return isTagsStyle ? (react_1.default.createElement(styled_1.StyledTagsInputWrapper, null, value.map(function (d) { return (0, genTagComp_1.genTagComp)(id, d, { display: true, theme: theme, color: tagColor }); }))) : (react_1.default.createElement("div", { style: { display: "flex", flexWrap: "wrap", gap: "0.5rem" } }, value.map(function (v, i) { return react_1.default.createElement(Typo2_1.UI_BODY_SM_DF, { key: v.value },
177
+ return isTagsStyle ? (react_1.default.createElement(styled_1.StyledTagsInputWrapper, null, value.map(function (d) { var _a; return (0, genTagComp_1.genTagComp)(id, d, { display: true, theme: theme, color: tagColor, usedOnContentType: (_a = content === null || content === void 0 ? void 0 : content.meta) === null || _a === void 0 ? void 0 : _a.kp_content_type }); }))) : (react_1.default.createElement("div", { style: { display: "flex", flexWrap: "wrap", gap: "0.5rem" } }, value.map(function (v, i) { return react_1.default.createElement(Typo2_1.UI_BODY_SM_DF, { key: v.value },
178
178
  v.display,
179
179
  " ",
180
180
  i !== value.length - 1 ? ',' : ''); })));
181
181
  };
182
182
  var _h = (0, react_1.useState)(false), focusSelectTagsInput = _h[0], setFocusSelectTagsInput = _h[1];
183
183
  var genSelectTagsInput = function (ops) {
184
+ var _a;
184
185
  if (ops === void 0) { ops = {}; }
185
186
  return (react_1.default.createElement(SelectTagsInput_1.SelectTagsInput, { id: id, value: value, handleSelect: handleSelect, handleClearAll: handleClearAll, searchString: searchString,
186
187
  setSearchString: setSearchString,
187
- single_multi: "multi", placeholder: placeholder, focusSelectTagsInput: focusSelectTagsInput, setFocusSelectTagsInput: setFocusSelectTagsInput, showOptions: showOptions, S: S, disabled: disabled, style: ops.style }));
188
+ single_multi: "multi", placeholder: placeholder, focusSelectTagsInput: focusSelectTagsInput, setFocusSelectTagsInput: setFocusSelectTagsInput, showOptions: showOptions, S: S, disabled: disabled, style: ops.style,
189
+ usedOnContentType: (_a = content === null || content === void 0 ? void 0 : content.meta) === null || _a === void 0 ? void 0 : _a.kp_content_type }));
188
190
  };
189
191
  var genInputComp = function () {
190
192
  // const SelectComp = isTagsStyle ? SelectTagsInput : SelectDropdown
@@ -1,4 +1,4 @@
1
- export function DropdownSingle({ optionsAnchor, lightboxHeight, lightboxStyle, selectClassName, optionsClassName, disableSelectTextUpdate, selectStyleOverride, value: valueProp, id, onChange: parentOnChange, className, style, readOnly, optionsFn, options: optionsProp, saveValueAsString, isTagsStyle, selectConfig, label, optionsModalLabel, broadcastShowOptions, isSearchable, searchFieldsConfig, setFilteredOptions: setFilteredOptionsInParent, setSearchString: setSearchStringInParent, searchString: searchStringInParent, genCustomSelectComp, placeholder, genCreateTagButton, popOutOfOverflowHiddenParent, S, disabled, tagColor, observerRef, searchbarPlaceholder, alignDropdown, variant, matchSelectInputWidth }: {
1
+ export function DropdownSingle({ optionsAnchor, lightboxHeight, lightboxStyle, selectClassName, optionsClassName, disableSelectTextUpdate, selectStyleOverride, value: valueProp, id, onChange: parentOnChange, className, style, readOnly, optionsFn, options: optionsProp, saveValueAsString, isTagsStyle, selectConfig, label, optionsModalLabel, broadcastShowOptions, isSearchable, searchFieldsConfig, setFilteredOptions: setFilteredOptionsInParent, setSearchString: setSearchStringInParent, searchString: searchStringInParent, genCustomSelectComp, placeholder, genCreateTagButton, popOutOfOverflowHiddenParent, S, disabled, tagColor, observerRef, searchbarPlaceholder, alignDropdown, variant, matchSelectInputWidth, content, }: {
2
2
  optionsAnchor: any;
3
3
  lightboxHeight: any;
4
4
  lightboxStyle: any;
@@ -37,5 +37,6 @@ export function DropdownSingle({ optionsAnchor, lightboxHeight, lightboxStyle, s
37
37
  alignDropdown?: string;
38
38
  variant?: string;
39
39
  matchSelectInputWidth: any;
40
+ content: any;
40
41
  }, ...args: any[]): React.JSX.Element;
41
42
  import React from "react";
@@ -81,7 +81,7 @@ function DropdownSingle(_a) {
81
81
  searchFieldsConfig = _a.searchFieldsConfig, setFilteredOptionsInParent = _a.setFilteredOptions, setSearchStringInParent = _a.setSearchString, searchStringInParent = _a.searchString, genCustomSelectComp = _a.genCustomSelectComp, placeholder = _a.placeholder, //
82
82
  genCreateTagButton = _a.genCreateTagButton, popOutOfOverflowHiddenParent = _a.popOutOfOverflowHiddenParent, S = _a.S, //
83
83
  disabled = _a.disabled, //
84
- tagColor = _a.tagColor, observerRef = _a.observerRef, searchbarPlaceholder = _a.searchbarPlaceholder, _b = _a.alignDropdown, alignDropdown = _b === void 0 ? "left" : _b, _c = _a.variant, variant = _c === void 0 ? "default" : _c, matchSelectInputWidth = _a.matchSelectInputWidth;
84
+ tagColor = _a.tagColor, observerRef = _a.observerRef, searchbarPlaceholder = _a.searchbarPlaceholder, _b = _a.alignDropdown, alignDropdown = _b === void 0 ? "left" : _b, _c = _a.variant, variant = _c === void 0 ? "default" : _c, matchSelectInputWidth = _a.matchSelectInputWidth, content = _a.content;
85
85
  var theme = (0, styled_components_1.useTheme)();
86
86
  var props = arguments[0];
87
87
  var value = (0, getValue_1.getValue_SINGLE)({ valueProp: valueProp, optionsFn: optionsFn, options: optionsProp, theme: theme, saveValueAsString: saveValueAsString });
@@ -135,10 +135,10 @@ function DropdownSingle(_a) {
135
135
  searchString
136
136
  ]);
137
137
  var genSelectTagsInput = function (ops) {
138
+ var _a;
138
139
  if (ops === void 0) { ops = {}; }
139
- return (react_1.default.createElement(SelectTagsInput_1.SelectTagsInput, { id: id, value: value, handleSelect: handleSelect, searchString: searchString, setSearchString: setSearchString, single_multi: 'single', placeholder: placeholder, S: S, disabled: disabled, showOptions: showOptions, S: S, style: ops.style
140
- // forceFocus, comp is expecting this
141
- }));
140
+ return (react_1.default.createElement(SelectTagsInput_1.SelectTagsInput, { id: id, value: value, handleSelect: handleSelect, searchString: searchString, setSearchString: setSearchString, single_multi: 'single', placeholder: placeholder, S: S, disabled: disabled, showOptions: showOptions, S: S, style: ops.style,
141
+ usedOnContentType: (_a = content === null || content === void 0 ? void 0 : content.meta) === null || _a === void 0 ? void 0 : _a.kp_content_type }));
142
142
  };
143
143
  var genInputComp = function () {
144
144
  return (react_1.default.createElement(styled_1.StyledDropdownRefWrapper, { ref: dropdownRef, className: "StyledDropdownRefWrapper_styleOverrideHandle" },
@@ -152,9 +152,10 @@ function DropdownSingle(_a) {
152
152
  alignDropdown: alignDropdown, genCreateTagButton: genCreateTagButton, matchSelectInputWidth: matchSelectInputWidth, SelectComp: isTagsStyle && genSelectTagsInput({ style: { position: 'sticky', top: 0, zIndex: 1000 } }), S: S, popOutOfOverflowHiddenParent: popOutOfOverflowHiddenParent, isSearchable: isTagsStyle ? false : isSearchable, searchbarPlaceholder: searchbarPlaceholder, searchString: searchString, setSearchString: setSearchString })));
153
153
  };
154
154
  var genDisplayComp = function () {
155
+ var _a;
155
156
  if (!value)
156
157
  return null;
157
- return isTagsStyle ? (react_1.default.createElement(styled_1.StyledTagsInputWrapper, null, (0, genTagComp_1.genTagComp)(id, value, { display: true, theme: theme, color: tagColor }))) : (react_1.default.createElement(DisplayCompSingle_1.DisplayCompSingle, { value: value, S: S }));
158
+ return isTagsStyle ? (react_1.default.createElement(styled_1.StyledTagsInputWrapper, null, (0, genTagComp_1.genTagComp)(id, value, { display: true, theme: theme, color: tagColor, usedOnContentType: (_a = content === null || content === void 0 ? void 0 : content.meta) === null || _a === void 0 ? void 0 : _a.kp_content_type }))) : (react_1.default.createElement(DisplayCompSingle_1.DisplayCompSingle, { value: value, S: S }));
158
159
  };
159
160
  return (react_1.default.createElement("div", { className: "OKE-Dropdown ".concat(className, " OKE-Dropdown--").concat(readOnly ? "displayComp" : "inputComp"), style: style },
160
161
  react_1.default.createElement(BlockLabel_1.BlockLabel, __assign({}, (0, getBlockLabelProps_1.getBlockLabelProps)(props) /** in other words, props. */)),
@@ -1,4 +1,4 @@
1
- export function SelectTagsInput({ id, value, disabled, handleSelect, searchString, setSearchString, placeholder, setFocusSelectTagsInput, focusSelectTagsInput, single_multi, showOptions, S, handleClearAll, tagColor, style }: {
1
+ export function SelectTagsInput({ id, value, disabled, handleSelect, searchString, setSearchString, placeholder, setFocusSelectTagsInput, focusSelectTagsInput, single_multi, showOptions, S, handleClearAll, tagColor, style, usedOnContentType, }: {
2
2
  id: any;
3
3
  value: any;
4
4
  disabled: any;
@@ -14,5 +14,6 @@ export function SelectTagsInput({ id, value, disabled, handleSelect, searchStrin
14
14
  handleClearAll: any;
15
15
  tagColor: any;
16
16
  style: any;
17
+ usedOnContentType: any;
17
18
  }): React.JSX.Element;
18
19
  import React from "react";
@@ -54,7 +54,7 @@ var SelectTagsInput = function (_a) {
54
54
  handleSelect = _a.handleSelect, searchString = _a.searchString, setSearchString = _a.setSearchString, placeholder = _a.placeholder,
55
55
  // minHeight, // standard | wide | actual height in rem
56
56
  setFocusSelectTagsInput = _a.setFocusSelectTagsInput, focusSelectTagsInput = _a.focusSelectTagsInput, //force focus when after an option is selected in multiselect
57
- single_multi = _a.single_multi, showOptions = _a.showOptions, S = _a.S, handleClearAll = _a.handleClearAll, 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, usedOnContentType = _a.usedOnContentType;
58
58
  var inputRef = (0, react_1.useRef)(null);
59
59
  var theme = (0, styled_components_1.useTheme)();
60
60
  var localize = (0, utilsOolib_1.useLocale)();
@@ -89,7 +89,8 @@ var SelectTagsInput = function (_a) {
89
89
  showOptions: showOptions,
90
90
  theme: theme,
91
91
  S: S,
92
- color: tagColor
92
+ color: tagColor,
93
+ usedOnContentType: usedOnContentType,
93
94
  });
94
95
  })),
95
96
  react_1.default.createElement(TextInputs_1.TextInput, { onKeyDown: blurInputOnEscKey, onFocus: function () {
@@ -6,7 +6,7 @@ var genLinkOrText = function (value, cb, options) {
6
6
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
7
7
  if (cb === void 0) { cb = undefined; }
8
8
  if (options === void 0) { options = {}; }
9
- var SELF_MANAGED_BASE_CONFIGS = options.SELF_MANAGED_BASE_CONFIGS;
9
+ var SELF_MANAGED_BASE_CONFIGS = options.SELF_MANAGED_BASE_CONFIGS, usedOnContentType = options.usedOnContentType;
10
10
  if ((!value.data ||
11
11
  !value.data._id ||
12
12
  (!((_a = value.data.meta) === null || _a === void 0 ? void 0 : _a.content_type) &&
@@ -51,6 +51,11 @@ var genLinkOrText = function (value, cb, options) {
51
51
  contentId: value._id,
52
52
  SELF_MANAGED_BASE_CONFIGS: SELF_MANAGED_BASE_CONFIGS,
53
53
  });
54
+ // SM-specific: append activeTab so the collection page opens the correct tab.
55
+ // Only in SM mode because only there we can be sure a tab will exist for each linked content type.
56
+ if (link && (SELF_MANAGED_BASE_CONFIGS === null || SELF_MANAGED_BASE_CONFIGS === void 0 ? void 0 : SELF_MANAGED_BASE_CONFIGS.enable) && usedOnContentType) {
57
+ link = "".concat(link, "?activeTab=").concat(usedOnContentType);
58
+ }
54
59
  }
55
60
  return cb ? (cb(value.display, link)) : ({ link: link });
56
61
  }
@@ -12,6 +12,7 @@ var genTagComp = function (id, d, options) {
12
12
  if (options === void 0) { options = {}; }
13
13
  var link = (0, genLinkOrText_1.genLinkOrText)(d, undefined, {
14
14
  SELF_MANAGED_BASE_CONFIGS: (_a = options.theme) === null || _a === void 0 ? void 0 : _a.SELF_MANAGED_BASE_CONFIGS,
15
+ usedOnContentType: options.usedOnContentType, // parent doc's content type, used to append ?activeTab= to collection tag links
15
16
  }).link;
16
17
  var showOptions = options.showOptions;
17
18
  switch (true) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oolib",
3
- "version": "2.227.10",
3
+ "version": "2.228.0",
4
4
  "description": " OKE Component Library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",