@public-ui/hydrate 3.0.2-6ae0104cda0b7b19a5b0d6bbc5f990b9fe544fa0.0 → 3.0.2-d721ede5369345abe032367b7d05a7c5a20dca9b.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/index.js CHANGED
@@ -17414,8 +17414,15 @@ const CustomSuggestionsToggleFc = ({ onClick, disabled }) => {
17414
17414
  hAsync(KolIconTag, { _icons: "codicon codicon-triangle-down", _label: translate('kol-dropdown') })));
17415
17415
  };
17416
17416
 
17417
- const CustomSuggestionsOptionFc = ({ index, ref, selected, onClick, onMouseOver, onFocus, onKeyDown, option }) => {
17418
- return (hAsync("li", { id: `option-${index}`, key: `-${index}`, ref: ref, "data-index": index, tabIndex: -1, role: "option", "aria-selected": selected ? 'true' : undefined, onClick: onClick, onMouseOver: onMouseOver, onFocus: onFocus, class: "kol-custom-suggestions-option", onKeyDown: onKeyDown }, option));
17417
+ const CustomSuggestionsOptionFc = ({ index, ref, selected, onClick, onMouseOver, onFocus, onKeyDown, option, searchTerm }) => {
17418
+ const highlightSearchTerm = (text, searchTerm) => {
17419
+ if (!(searchTerm === null || searchTerm === void 0 ? void 0 : searchTerm.trim()))
17420
+ return text;
17421
+ const regex = new RegExp(`(${searchTerm.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')})`, 'gi');
17422
+ const parts = text.split(regex);
17423
+ return parts.map((part, partIndex) => (regex.test(part) ? hAsync("mark", { key: partIndex }, part) : part));
17424
+ };
17425
+ return (hAsync("li", { id: `option-${index}`, key: `-${index}`, ref: ref, "data-index": index, tabIndex: -1, role: "option", "aria-selected": selected ? 'true' : undefined, onClick: onClick, onMouseOver: onMouseOver, onFocus: onFocus, class: "kol-custom-suggestions-option", onKeyDown: onKeyDown }, highlightSearchTerm(String(option), searchTerm || '')));
17419
17426
  };
17420
17427
 
17421
17428
  const CustomSuggestionsOptionsGroupFc = ({ blockSuggestionMouseOver, onKeyDown, style }, children) => {
@@ -17523,7 +17530,7 @@ class KolCombobox {
17523
17530
  render() {
17524
17531
  return (hAsync(FormFieldStateWrapper, Object.assign({ key: '44bc85c62caa382896b635dbc743f16d24863644' }, this.getFormFieldProps()), hAsync(InputContainerStateWrapperFc, { key: 'fd4b270034c88219b2f7f7eae2591334906ece02', state: this.state }, hAsync("div", { key: 'd4510edc466749cef9b6291afd9c282c77b88f8f', class: "kol-combobox__group" }, hAsync(InputStateWrapper, Object.assign({ key: 'ddc7d75b247724e081da3b8360238e271110cdca' }, this.getInputProps())), hAsync(CustomSuggestionsToggleFc, { key: '4531ca610c2f04d45072823222cac12c49c3ab74', onClick: this.toggleListbox.bind(this), disabled: this.state._disabled })), this._isOpen && !(this.state._disabled === true) && (hAsync(CustomSuggestionsOptionsGroupFc, { key: 'd995a87095216c4f1cf32b8e6c789dffffcf2572', blockSuggestionMouseOver: this.blockSuggestionMouseOver, onKeyDown: this.handleKeyDownDropdown.bind(this) }, Array.isArray(this._filteredSuggestions) &&
17525
17532
  this._filteredSuggestions.length > 0 &&
17526
- this._filteredSuggestions.map((option, index) => (hAsync(CustomSuggestionsOptionFc, { index: index, option: option, ref: (el) => {
17533
+ this._filteredSuggestions.map((option, index) => (hAsync(CustomSuggestionsOptionFc, { index: index, option: option, searchTerm: this.state._value, ref: (el) => {
17527
17534
  if (el)
17528
17535
  this.refSuggestions[index] = el;
17529
17536
  }, selected: this.state._value === option, onClick: () => {
@@ -25928,7 +25935,7 @@ class KolSingleSelect {
25928
25935
  (_a = this.refInput) === null || _a === void 0 ? void 0 : _a.focus();
25929
25936
  }, class: clsx('kol-single-select__delete', {
25930
25937
  'kol-single-select__delete--disabled': this.state._disabled,
25931
- }) })), hAsync(CustomSuggestionsToggleFc, { key: '6ed5dfdd0465c0aa15745ed3b0210eec01f769e2', onClick: this.toggleListbox.bind(this), disabled: this.state._disabled })), this._isOpen && !(this.state._disabled === true) && (hAsync(CustomSuggestionsOptionsGroupFc, { key: 'f6caab6259e0928ecdff02385e690ff6aba9bbb4', blockSuggestionMouseOver: this.blockSuggestionMouseOver, onKeyDown: this.handleKeyDownDropdown.bind(this), style: { '--visible-options': `${(_a = this._rows) !== null && _a !== void 0 ? _a : 5}` } }, Array.isArray(this._filteredOptions) && this._filteredOptions.length > 0 ? (this._filteredOptions.map((option, index) => (hAsync(CustomSuggestionsOptionFc, { index: index, option: option.label, ref: (el) => {
25938
+ }) })), hAsync(CustomSuggestionsToggleFc, { key: '6ed5dfdd0465c0aa15745ed3b0210eec01f769e2', onClick: this.toggleListbox.bind(this), disabled: this.state._disabled })), this._isOpen && !(this.state._disabled === true) && (hAsync(CustomSuggestionsOptionsGroupFc, { key: 'f6caab6259e0928ecdff02385e690ff6aba9bbb4', blockSuggestionMouseOver: this.blockSuggestionMouseOver, onKeyDown: this.handleKeyDownDropdown.bind(this), style: { '--visible-options': `${(_a = this._rows) !== null && _a !== void 0 ? _a : 5}` } }, Array.isArray(this._filteredOptions) && this._filteredOptions.length > 0 ? (this._filteredOptions.map((option, index) => (hAsync(CustomSuggestionsOptionFc, { index: index, option: option.label, searchTerm: this._inputValue, ref: (el) => {
25932
25939
  if (el)
25933
25940
  this.refOptions[index] = el;
25934
25941
  }, selected: this._value === option.value, onClick: (event) => {
package/dist/index.mjs CHANGED
@@ -17410,8 +17410,15 @@ const CustomSuggestionsToggleFc = ({ onClick, disabled }) => {
17410
17410
  hAsync(KolIconTag, { _icons: "codicon codicon-triangle-down", _label: translate('kol-dropdown') })));
17411
17411
  };
17412
17412
 
17413
- const CustomSuggestionsOptionFc = ({ index, ref, selected, onClick, onMouseOver, onFocus, onKeyDown, option }) => {
17414
- return (hAsync("li", { id: `option-${index}`, key: `-${index}`, ref: ref, "data-index": index, tabIndex: -1, role: "option", "aria-selected": selected ? 'true' : undefined, onClick: onClick, onMouseOver: onMouseOver, onFocus: onFocus, class: "kol-custom-suggestions-option", onKeyDown: onKeyDown }, option));
17413
+ const CustomSuggestionsOptionFc = ({ index, ref, selected, onClick, onMouseOver, onFocus, onKeyDown, option, searchTerm }) => {
17414
+ const highlightSearchTerm = (text, searchTerm) => {
17415
+ if (!(searchTerm === null || searchTerm === void 0 ? void 0 : searchTerm.trim()))
17416
+ return text;
17417
+ const regex = new RegExp(`(${searchTerm.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')})`, 'gi');
17418
+ const parts = text.split(regex);
17419
+ return parts.map((part, partIndex) => (regex.test(part) ? hAsync("mark", { key: partIndex }, part) : part));
17420
+ };
17421
+ return (hAsync("li", { id: `option-${index}`, key: `-${index}`, ref: ref, "data-index": index, tabIndex: -1, role: "option", "aria-selected": selected ? 'true' : undefined, onClick: onClick, onMouseOver: onMouseOver, onFocus: onFocus, class: "kol-custom-suggestions-option", onKeyDown: onKeyDown }, highlightSearchTerm(String(option), searchTerm || '')));
17415
17422
  };
17416
17423
 
17417
17424
  const CustomSuggestionsOptionsGroupFc = ({ blockSuggestionMouseOver, onKeyDown, style }, children) => {
@@ -17519,7 +17526,7 @@ class KolCombobox {
17519
17526
  render() {
17520
17527
  return (hAsync(FormFieldStateWrapper, Object.assign({ key: '44bc85c62caa382896b635dbc743f16d24863644' }, this.getFormFieldProps()), hAsync(InputContainerStateWrapperFc, { key: 'fd4b270034c88219b2f7f7eae2591334906ece02', state: this.state }, hAsync("div", { key: 'd4510edc466749cef9b6291afd9c282c77b88f8f', class: "kol-combobox__group" }, hAsync(InputStateWrapper, Object.assign({ key: 'ddc7d75b247724e081da3b8360238e271110cdca' }, this.getInputProps())), hAsync(CustomSuggestionsToggleFc, { key: '4531ca610c2f04d45072823222cac12c49c3ab74', onClick: this.toggleListbox.bind(this), disabled: this.state._disabled })), this._isOpen && !(this.state._disabled === true) && (hAsync(CustomSuggestionsOptionsGroupFc, { key: 'd995a87095216c4f1cf32b8e6c789dffffcf2572', blockSuggestionMouseOver: this.blockSuggestionMouseOver, onKeyDown: this.handleKeyDownDropdown.bind(this) }, Array.isArray(this._filteredSuggestions) &&
17521
17528
  this._filteredSuggestions.length > 0 &&
17522
- this._filteredSuggestions.map((option, index) => (hAsync(CustomSuggestionsOptionFc, { index: index, option: option, ref: (el) => {
17529
+ this._filteredSuggestions.map((option, index) => (hAsync(CustomSuggestionsOptionFc, { index: index, option: option, searchTerm: this.state._value, ref: (el) => {
17523
17530
  if (el)
17524
17531
  this.refSuggestions[index] = el;
17525
17532
  }, selected: this.state._value === option, onClick: () => {
@@ -25924,7 +25931,7 @@ class KolSingleSelect {
25924
25931
  (_a = this.refInput) === null || _a === void 0 ? void 0 : _a.focus();
25925
25932
  }, class: clsx('kol-single-select__delete', {
25926
25933
  'kol-single-select__delete--disabled': this.state._disabled,
25927
- }) })), hAsync(CustomSuggestionsToggleFc, { key: '6ed5dfdd0465c0aa15745ed3b0210eec01f769e2', onClick: this.toggleListbox.bind(this), disabled: this.state._disabled })), this._isOpen && !(this.state._disabled === true) && (hAsync(CustomSuggestionsOptionsGroupFc, { key: 'f6caab6259e0928ecdff02385e690ff6aba9bbb4', blockSuggestionMouseOver: this.blockSuggestionMouseOver, onKeyDown: this.handleKeyDownDropdown.bind(this), style: { '--visible-options': `${(_a = this._rows) !== null && _a !== void 0 ? _a : 5}` } }, Array.isArray(this._filteredOptions) && this._filteredOptions.length > 0 ? (this._filteredOptions.map((option, index) => (hAsync(CustomSuggestionsOptionFc, { index: index, option: option.label, ref: (el) => {
25934
+ }) })), hAsync(CustomSuggestionsToggleFc, { key: '6ed5dfdd0465c0aa15745ed3b0210eec01f769e2', onClick: this.toggleListbox.bind(this), disabled: this.state._disabled })), this._isOpen && !(this.state._disabled === true) && (hAsync(CustomSuggestionsOptionsGroupFc, { key: 'f6caab6259e0928ecdff02385e690ff6aba9bbb4', blockSuggestionMouseOver: this.blockSuggestionMouseOver, onKeyDown: this.handleKeyDownDropdown.bind(this), style: { '--visible-options': `${(_a = this._rows) !== null && _a !== void 0 ? _a : 5}` } }, Array.isArray(this._filteredOptions) && this._filteredOptions.length > 0 ? (this._filteredOptions.map((option, index) => (hAsync(CustomSuggestionsOptionFc, { index: index, option: option.label, searchTerm: this._inputValue, ref: (el) => {
25928
25935
  if (el)
25929
25936
  this.refOptions[index] = el;
25930
25937
  }, selected: this._value === option.value, onClick: (event) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@public-ui/hydrate",
3
- "version": "3.0.2-6ae0104cda0b7b19a5b0d6bbc5f990b9fe544fa0.0",
3
+ "version": "3.0.2-d721ede5369345abe032367b7d05a7c5a20dca9b.0",
4
4
  "license": "EUPL-1.2",
5
5
  "homepage": "https://public-ui.github.io",
6
6
  "repository": {
@@ -46,10 +46,10 @@
46
46
  ],
47
47
  "devDependencies": {
48
48
  "rimraf": "6.0.1",
49
- "@public-ui/components": "3.0.2-6ae0104cda0b7b19a5b0d6bbc5f990b9fe544fa0.0"
49
+ "@public-ui/components": "3.0.2-d721ede5369345abe032367b7d05a7c5a20dca9b.0"
50
50
  },
51
51
  "peerDependencies": {
52
- "@public-ui/components": "3.0.2-6ae0104cda0b7b19a5b0d6bbc5f990b9fe544fa0.0"
52
+ "@public-ui/components": "3.0.2-d721ede5369345abe032367b7d05a7c5a20dca9b.0"
53
53
  },
54
54
  "sideEffects": false,
55
55
  "type": "commonjs",