@public-ui/hydrate 3.0.2-ab502d4896d9763f93bb8cce1b07a1b2f8d04439.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/README.md CHANGED
@@ -19,9 +19,9 @@ Provide an adapter for Server Side Rendering of KoliBri components.
19
19
  You can install the adapter with `npm`, `pnpm` or `yarn`:
20
20
 
21
21
  ```bash
22
- npm i -g @public-ui/hydrate
23
- pnpm i -g @public-ui/hydrate
24
- yarn add -g @public-ui/hydrate
22
+ npm i @public-ui/hydrate
23
+ pnpm i @public-ui/hydrate
24
+ yarn add @public-ui/hydrate
25
25
  ```
26
26
 
27
27
  ## Usage
@@ -35,3 +35,5 @@ import { renderToString } from '@public-ui/hydrate';
35
35
  const inputHtml = `<kol-button _label="Hello World"_></kol-button>`;
36
36
  const { html } = await renderToString(inputHtml);
37
37
  ```
38
+
39
+ Refer to the [default theme README](../../themes/default/README.md) for information on customizing the output.
package/dist/index.js CHANGED
@@ -3832,6 +3832,10 @@ const validateAdjustHeight = (component, value) => {
3832
3832
  watchBoolean(component, '_adjustHeight', value);
3833
3833
  };
3834
3834
 
3835
+ const validateAlt = (component, value, options = {}) => {
3836
+ watchString(component, '_alt', value, options);
3837
+ };
3838
+
3835
3839
  const validateAlignment = (component, propName, value) => {
3836
3840
  watchValidator(component, propName, (value) => typeof value === 'string' && alignPropTypeOptions.includes(value), new Set(alignPropTypeOptions), value, {
3837
3841
  defaultValue: 'top',
@@ -4198,6 +4202,14 @@ const validateImageSource = (component, value, options) => {
4198
4202
  watchString(component, '_src', value, options);
4199
4203
  };
4200
4204
 
4205
+ const validateImageSizes = (component, value, options = {}) => {
4206
+ watchString(component, '_sizes', value, options);
4207
+ };
4208
+
4209
+ const validateImageSrcset = (component, value, options = {}) => {
4210
+ watchString(component, '_srcset', value, options);
4211
+ };
4212
+
4201
4213
  const validateIndeterminate = (component, value) => {
4202
4214
  watchBoolean(component, '_indeterminate', value);
4203
4215
  };
@@ -5134,13 +5146,28 @@ const AlertIcon = ({ type, label }) => {
5134
5146
  }
5135
5147
  };
5136
5148
 
5149
+ const vibrateOnError = () => {
5150
+ if (typeof navigator === 'undefined' || typeof navigator.vibrate !== 'function') {
5151
+ return;
5152
+ }
5153
+ const ua = navigator.userActivation;
5154
+ const hasGesture = (ua === null || ua === void 0 ? void 0 : ua.isActive) || (ua === null || ua === void 0 ? void 0 : ua.hasBeenActive);
5155
+ if (!hasGesture) {
5156
+ return;
5157
+ }
5158
+ if (!matchMedia('(any-pointer: coarse)').matches) {
5159
+ return;
5160
+ }
5161
+ try {
5162
+ navigator.vibrate([100, 75, 100, 75, 100]);
5163
+ }
5164
+ catch (_a) {
5165
+ }
5166
+ };
5137
5167
  const KolAlertFc = (props, children) => {
5138
- var _a, _b;
5139
5168
  const { class: classNames = {}, alert = false, hasCloser = false, label, level = 0, type = 'default', variant = 'msg', onAlertTimeout, onCloserClick } = props, other = __rest(props, ["class", "alert", "hasCloser", "label", "level", "type", "variant", "onAlertTimeout", "onCloserClick"]);
5140
5169
  if (alert) {
5141
- if ((_a = navigator.userActivation) === null || _a === void 0 ? void 0 : _a.hasBeenActive) {
5142
- (_b = navigator === null || navigator === void 0 ? void 0 : navigator.vibrate) === null || _b === void 0 ? void 0 : _b.call(navigator, [100, 75, 100, 75, 100]);
5143
- }
5170
+ vibrateOnError();
5144
5171
  setTimeout(() => {
5145
5172
  onAlertTimeout === null || onAlertTimeout === void 0 ? void 0 : onAlertTimeout();
5146
5173
  }, 10000);
@@ -5205,7 +5232,7 @@ class KolAlertWc {
5205
5232
  onCloserClick: this.close,
5206
5233
  onAlertTimeout: this.handleAlertTimeout,
5207
5234
  };
5208
- return (hAsync(KolAlertFc, Object.assign({ key: '9038051f21b86a9c83c8ac5619e723dff5ebcbeb' }, props), hAsync("slot", { key: 'cfd116176ab783db5232d9d5520f8ae890ca44db' })));
5235
+ return (hAsync(KolAlertFc, Object.assign({ key: '2b0d74465270eef8d8d6f3da8c04377f862e8630' }, props), hAsync("slot", { key: '55e8ad62be763c26af16813e5ebfac2ce1f63b54' })));
5209
5236
  }
5210
5237
  validateAlert(value) {
5211
5238
  watchBoolean(this, '_alert', value);
@@ -17387,8 +17414,15 @@ const CustomSuggestionsToggleFc = ({ onClick, disabled }) => {
17387
17414
  hAsync(KolIconTag, { _icons: "codicon codicon-triangle-down", _label: translate('kol-dropdown') })));
17388
17415
  };
17389
17416
 
17390
- const CustomSuggestionsOptionFc = ({ index, ref, selected, onClick, onMouseOver, onFocus, onKeyDown, option }) => {
17391
- 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 || '')));
17392
17426
  };
17393
17427
 
17394
17428
  const CustomSuggestionsOptionsGroupFc = ({ blockSuggestionMouseOver, onKeyDown, style }, children) => {
@@ -17496,7 +17530,7 @@ class KolCombobox {
17496
17530
  render() {
17497
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) &&
17498
17532
  this._filteredSuggestions.length > 0 &&
17499
- 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) => {
17500
17534
  if (el)
17501
17535
  this.refSuggestions[index] = el;
17502
17536
  }, selected: this.state._value === option, onClick: () => {
@@ -18330,15 +18364,13 @@ class KolImage {
18330
18364
  };
18331
18365
  }
18332
18366
  validateAlt(value) {
18333
- watchString(this, '_alt', value, {
18334
- required: true,
18335
- });
18367
+ validateAlt(this, value, { required: true });
18336
18368
  }
18337
18369
  validateLoading(value) {
18338
18370
  validateLoading(this, value);
18339
18371
  }
18340
18372
  validateSizes(value) {
18341
- watchString(this, '_sizes', value);
18373
+ validateImageSizes(this, value);
18342
18374
  }
18343
18375
  validateSrc(value) {
18344
18376
  validateImageSource(this, value, {
@@ -18346,7 +18378,7 @@ class KolImage {
18346
18378
  });
18347
18379
  }
18348
18380
  validateSrcset(value) {
18349
- watchString(this, '_srcset', value);
18381
+ validateImageSrcset(this, value);
18350
18382
  }
18351
18383
  componentWillLoad() {
18352
18384
  this.validateAlt(this._alt);
@@ -18356,7 +18388,7 @@ class KolImage {
18356
18388
  this.validateSrcset(this._srcset);
18357
18389
  }
18358
18390
  render() {
18359
- return (hAsync("img", { key: '23837493ec11632608a497a0319b945b91cadb6d', class: "kol-image", alt: this.state._alt, loading: this.state._loading, sizes: this.state._sizes, src: this.state._src, srcset: this.state._srcset }));
18391
+ return (hAsync("img", { key: 'cca1e1b65e9aab11b4c15bea394d6c54ead1a123', class: "kol-image", alt: this.state._alt, loading: this.state._loading, sizes: this.state._sizes, src: this.state._src, srcset: this.state._srcset }));
18360
18392
  }
18361
18393
  static get watchers() { return {
18362
18394
  "_alt": ["validateAlt"],
@@ -25903,7 +25935,7 @@ class KolSingleSelect {
25903
25935
  (_a = this.refInput) === null || _a === void 0 ? void 0 : _a.focus();
25904
25936
  }, class: clsx('kol-single-select__delete', {
25905
25937
  'kol-single-select__delete--disabled': this.state._disabled,
25906
- }) })), 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) => {
25907
25939
  if (el)
25908
25940
  this.refOptions[index] = el;
25909
25941
  }, selected: this._value === option.value, onClick: (event) => {
@@ -26380,6 +26412,9 @@ var KolSplitButtonDefaultStyle0 = defaultStyleCss$9;
26380
26412
  class KolSplitButton {
26381
26413
  constructor(hostRef) {
26382
26414
  registerInstance(this, hostRef);
26415
+ this.catchPrimaryRef = (ref) => {
26416
+ this.primaryButtonWcRef = ref;
26417
+ };
26383
26418
  this.clickButtonHandler = {
26384
26419
  onClick: (event) => {
26385
26420
  var _a, _b;
@@ -26387,9 +26422,6 @@ class KolSplitButton {
26387
26422
  if (typeof ((_a = this._on) === null || _a === void 0 ? void 0 : _a.onClick) === 'function') {
26388
26423
  (_b = this._on) === null || _b === void 0 ? void 0 : _b.onClick(event, this._value);
26389
26424
  }
26390
- else {
26391
- this.toggleDropdown();
26392
- }
26393
26425
  },
26394
26426
  };
26395
26427
  this.clickToggleHandler = {
@@ -26404,7 +26436,9 @@ class KolSplitButton {
26404
26436
  this.handleOnClose = () => {
26405
26437
  this.state = Object.assign(Object.assign({}, this.state), { _show: false });
26406
26438
  };
26439
+ this._accessKey = undefined;
26407
26440
  this._ariaControls = undefined;
26441
+ this._ariaDescription = undefined;
26408
26442
  this._ariaExpanded = undefined;
26409
26443
  this._ariaSelected = undefined;
26410
26444
  this._customClass = undefined;
@@ -26416,6 +26450,7 @@ class KolSplitButton {
26416
26450
  this._name = undefined;
26417
26451
  this._on = undefined;
26418
26452
  this._role = undefined;
26453
+ this._shortKey = undefined;
26419
26454
  this._syncValueBySelector = undefined;
26420
26455
  this._tooltipAlign = 'top';
26421
26456
  this._type = 'button';
@@ -26425,12 +26460,19 @@ class KolSplitButton {
26425
26460
  _show: false,
26426
26461
  };
26427
26462
  }
26463
+ async getValue() {
26464
+ return this._value;
26465
+ }
26466
+ async kolFocus() {
26467
+ var _a;
26468
+ await ((_a = this.primaryButtonWcRef) === null || _a === void 0 ? void 0 : _a.kolFocus());
26469
+ }
26428
26470
  render() {
26429
26471
  const i18nDropdownLabel = 'kol-split-button-dropdown-label';
26430
- return (hAsync("div", { key: 'adfeb36fc1c13115648cab2c692dcf28ede4f663', class: "kol-split-button" }, hAsync("div", { key: '6ddddfa00a901d7a1c02a242384ba6478955c13b', class: "kol-split-button__root" }, hAsync(KolButtonWcTag, { key: '73295b6c589ee559c4e301c6685568e0aa6359de', class: clsx('kol-split-button__button', {
26472
+ return (hAsync("div", { key: '2ca0df775c2fcce89473dfeaad1fbb64235b8a3b', class: "kol-split-button" }, hAsync("div", { key: '8933d5eddbc53f3653dcba1c4bcee525cff244b4', class: "kol-split-button__root" }, hAsync(KolButtonWcTag, { key: 'f5a0ca81140515725acb321757a7fe36ee02ea14', class: clsx('kol-split-button__button', {
26431
26473
  [this._variant]: this._variant !== 'custom',
26432
26474
  [this._customClass]: this._variant === 'custom' && typeof this._customClass === 'string' && this._customClass.length > 0,
26433
- }), _ariaControls: this._ariaControls, _ariaExpanded: this._ariaExpanded, _ariaSelected: this._ariaSelected, _customClass: this._customClass, _disabled: this._disabled, _icons: this._icons, _hideLabel: this._hideLabel, _label: this._label, _name: this._name, _on: this.clickButtonHandler, _role: this._role, _syncValueBySelector: this._syncValueBySelector, _tooltipAlign: this._tooltipAlign, _type: this._type, _value: this._value, _buttonVariant: this._variant }), hAsync("div", { key: '29f15b767934692234c76d6738696ea225488d24', class: "kol-split-button__horizontal-line" }), hAsync(KolButtonWcTag, { key: '689696759403849639ec892383aad2d055ac1482', class: "kol-split-button__secondary-button", _disabled: this._disabled, _hideLabel: true, _icons: "codicon codicon-triangle-down", _label: this.state._show ? translate(`${i18nDropdownLabel}-close`) : translate(`${i18nDropdownLabel}-open`), _on: this.clickToggleHandler })), hAsync(KolPopoverWcTag, { key: 'ba4151408b5ea8295eaee3f680ccd394e081464b', _show: this.state._show, _on: { onClose: this.handleOnClose }, _align: "bottom" }, hAsync("slot", { key: '88c02a85478c3cedae8272e2f3f4848bbf031488' }))));
26475
+ }), ref: this.catchPrimaryRef, _accessKey: this._accessKey, _ariaControls: this._ariaControls, _ariaDescription: this._ariaDescription, _ariaExpanded: this._ariaExpanded, _ariaSelected: this._ariaSelected, _customClass: this._customClass, _disabled: this._disabled, _icons: this._icons, _id: this._id, _hideLabel: this._hideLabel, _label: this._label, _name: this._name, _on: this.clickButtonHandler, _role: this._role, _shortKey: this._shortKey, _syncValueBySelector: this._syncValueBySelector, _tooltipAlign: this._tooltipAlign, _type: this._type, _value: this._value, _buttonVariant: this._variant }), hAsync("div", { key: '4ee2a8564093ceaf91735a06cadb2d61477e8403', class: "kol-split-button__horizontal-line" }), hAsync(KolButtonWcTag, { key: 'aae9e7140a3f4fe3c892a29172b33c72ef165a30', class: "kol-split-button__secondary-button", _disabled: this._disabled, _hideLabel: true, _icons: "codicon codicon-triangle-down", _label: this.state._show ? translate(`${i18nDropdownLabel}-close`) : translate(`${i18nDropdownLabel}-open`), _on: this.clickToggleHandler })), hAsync(KolPopoverWcTag, { key: '032232308b826e91f2bed8dce79ce898961f5f0f', _show: this.state._show, _on: { onClose: this.handleOnClose }, _align: "bottom" }, hAsync("slot", { key: 'dc706f0a2c45e7527111af72e0bdf5b6a551ef60' }))));
26434
26476
  }
26435
26477
  async closePopup() {
26436
26478
  this.handleOnClose();
@@ -26444,7 +26486,9 @@ class KolSplitButton {
26444
26486
  "$flags$": 57,
26445
26487
  "$tagName$": "kol-split-button",
26446
26488
  "$members$": {
26489
+ "_accessKey": [1, "_access-key"],
26447
26490
  "_ariaControls": [1, "_aria-controls"],
26491
+ "_ariaDescription": [1, "_aria-description"],
26448
26492
  "_ariaExpanded": [4, "_aria-expanded"],
26449
26493
  "_ariaSelected": [4, "_aria-selected"],
26450
26494
  "_customClass": [1, "_custom-class"],
@@ -26456,12 +26500,15 @@ class KolSplitButton {
26456
26500
  "_name": [1],
26457
26501
  "_on": [16],
26458
26502
  "_role": [1],
26503
+ "_shortKey": [1, "_short-key"],
26459
26504
  "_syncValueBySelector": [1, "_sync-value-by-selector"],
26460
26505
  "_tooltipAlign": [1, "_tooltip-align"],
26461
26506
  "_type": [1],
26462
26507
  "_value": [8],
26463
26508
  "_variant": [1],
26464
26509
  "state": [32],
26510
+ "getValue": [64],
26511
+ "kolFocus": [64],
26465
26512
  "closePopup": [64]
26466
26513
  },
26467
26514
  "$listeners$": undefined,
package/dist/index.mjs CHANGED
@@ -3828,6 +3828,10 @@ const validateAdjustHeight = (component, value) => {
3828
3828
  watchBoolean(component, '_adjustHeight', value);
3829
3829
  };
3830
3830
 
3831
+ const validateAlt = (component, value, options = {}) => {
3832
+ watchString(component, '_alt', value, options);
3833
+ };
3834
+
3831
3835
  const validateAlignment = (component, propName, value) => {
3832
3836
  watchValidator(component, propName, (value) => typeof value === 'string' && alignPropTypeOptions.includes(value), new Set(alignPropTypeOptions), value, {
3833
3837
  defaultValue: 'top',
@@ -4194,6 +4198,14 @@ const validateImageSource = (component, value, options) => {
4194
4198
  watchString(component, '_src', value, options);
4195
4199
  };
4196
4200
 
4201
+ const validateImageSizes = (component, value, options = {}) => {
4202
+ watchString(component, '_sizes', value, options);
4203
+ };
4204
+
4205
+ const validateImageSrcset = (component, value, options = {}) => {
4206
+ watchString(component, '_srcset', value, options);
4207
+ };
4208
+
4197
4209
  const validateIndeterminate = (component, value) => {
4198
4210
  watchBoolean(component, '_indeterminate', value);
4199
4211
  };
@@ -5130,13 +5142,28 @@ const AlertIcon = ({ type, label }) => {
5130
5142
  }
5131
5143
  };
5132
5144
 
5145
+ const vibrateOnError = () => {
5146
+ if (typeof navigator === 'undefined' || typeof navigator.vibrate !== 'function') {
5147
+ return;
5148
+ }
5149
+ const ua = navigator.userActivation;
5150
+ const hasGesture = (ua === null || ua === void 0 ? void 0 : ua.isActive) || (ua === null || ua === void 0 ? void 0 : ua.hasBeenActive);
5151
+ if (!hasGesture) {
5152
+ return;
5153
+ }
5154
+ if (!matchMedia('(any-pointer: coarse)').matches) {
5155
+ return;
5156
+ }
5157
+ try {
5158
+ navigator.vibrate([100, 75, 100, 75, 100]);
5159
+ }
5160
+ catch (_a) {
5161
+ }
5162
+ };
5133
5163
  const KolAlertFc = (props, children) => {
5134
- var _a, _b;
5135
5164
  const { class: classNames = {}, alert = false, hasCloser = false, label, level = 0, type = 'default', variant = 'msg', onAlertTimeout, onCloserClick } = props, other = __rest(props, ["class", "alert", "hasCloser", "label", "level", "type", "variant", "onAlertTimeout", "onCloserClick"]);
5136
5165
  if (alert) {
5137
- if ((_a = navigator.userActivation) === null || _a === void 0 ? void 0 : _a.hasBeenActive) {
5138
- (_b = navigator === null || navigator === void 0 ? void 0 : navigator.vibrate) === null || _b === void 0 ? void 0 : _b.call(navigator, [100, 75, 100, 75, 100]);
5139
- }
5166
+ vibrateOnError();
5140
5167
  setTimeout(() => {
5141
5168
  onAlertTimeout === null || onAlertTimeout === void 0 ? void 0 : onAlertTimeout();
5142
5169
  }, 10000);
@@ -5201,7 +5228,7 @@ class KolAlertWc {
5201
5228
  onCloserClick: this.close,
5202
5229
  onAlertTimeout: this.handleAlertTimeout,
5203
5230
  };
5204
- return (hAsync(KolAlertFc, Object.assign({ key: '9038051f21b86a9c83c8ac5619e723dff5ebcbeb' }, props), hAsync("slot", { key: 'cfd116176ab783db5232d9d5520f8ae890ca44db' })));
5231
+ return (hAsync(KolAlertFc, Object.assign({ key: '2b0d74465270eef8d8d6f3da8c04377f862e8630' }, props), hAsync("slot", { key: '55e8ad62be763c26af16813e5ebfac2ce1f63b54' })));
5205
5232
  }
5206
5233
  validateAlert(value) {
5207
5234
  watchBoolean(this, '_alert', value);
@@ -17383,8 +17410,15 @@ const CustomSuggestionsToggleFc = ({ onClick, disabled }) => {
17383
17410
  hAsync(KolIconTag, { _icons: "codicon codicon-triangle-down", _label: translate('kol-dropdown') })));
17384
17411
  };
17385
17412
 
17386
- const CustomSuggestionsOptionFc = ({ index, ref, selected, onClick, onMouseOver, onFocus, onKeyDown, option }) => {
17387
- 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 || '')));
17388
17422
  };
17389
17423
 
17390
17424
  const CustomSuggestionsOptionsGroupFc = ({ blockSuggestionMouseOver, onKeyDown, style }, children) => {
@@ -17492,7 +17526,7 @@ class KolCombobox {
17492
17526
  render() {
17493
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) &&
17494
17528
  this._filteredSuggestions.length > 0 &&
17495
- 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) => {
17496
17530
  if (el)
17497
17531
  this.refSuggestions[index] = el;
17498
17532
  }, selected: this.state._value === option, onClick: () => {
@@ -18326,15 +18360,13 @@ class KolImage {
18326
18360
  };
18327
18361
  }
18328
18362
  validateAlt(value) {
18329
- watchString(this, '_alt', value, {
18330
- required: true,
18331
- });
18363
+ validateAlt(this, value, { required: true });
18332
18364
  }
18333
18365
  validateLoading(value) {
18334
18366
  validateLoading(this, value);
18335
18367
  }
18336
18368
  validateSizes(value) {
18337
- watchString(this, '_sizes', value);
18369
+ validateImageSizes(this, value);
18338
18370
  }
18339
18371
  validateSrc(value) {
18340
18372
  validateImageSource(this, value, {
@@ -18342,7 +18374,7 @@ class KolImage {
18342
18374
  });
18343
18375
  }
18344
18376
  validateSrcset(value) {
18345
- watchString(this, '_srcset', value);
18377
+ validateImageSrcset(this, value);
18346
18378
  }
18347
18379
  componentWillLoad() {
18348
18380
  this.validateAlt(this._alt);
@@ -18352,7 +18384,7 @@ class KolImage {
18352
18384
  this.validateSrcset(this._srcset);
18353
18385
  }
18354
18386
  render() {
18355
- return (hAsync("img", { key: '23837493ec11632608a497a0319b945b91cadb6d', class: "kol-image", alt: this.state._alt, loading: this.state._loading, sizes: this.state._sizes, src: this.state._src, srcset: this.state._srcset }));
18387
+ return (hAsync("img", { key: 'cca1e1b65e9aab11b4c15bea394d6c54ead1a123', class: "kol-image", alt: this.state._alt, loading: this.state._loading, sizes: this.state._sizes, src: this.state._src, srcset: this.state._srcset }));
18356
18388
  }
18357
18389
  static get watchers() { return {
18358
18390
  "_alt": ["validateAlt"],
@@ -25899,7 +25931,7 @@ class KolSingleSelect {
25899
25931
  (_a = this.refInput) === null || _a === void 0 ? void 0 : _a.focus();
25900
25932
  }, class: clsx('kol-single-select__delete', {
25901
25933
  'kol-single-select__delete--disabled': this.state._disabled,
25902
- }) })), 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) => {
25903
25935
  if (el)
25904
25936
  this.refOptions[index] = el;
25905
25937
  }, selected: this._value === option.value, onClick: (event) => {
@@ -26376,6 +26408,9 @@ var KolSplitButtonDefaultStyle0 = defaultStyleCss$9;
26376
26408
  class KolSplitButton {
26377
26409
  constructor(hostRef) {
26378
26410
  registerInstance(this, hostRef);
26411
+ this.catchPrimaryRef = (ref) => {
26412
+ this.primaryButtonWcRef = ref;
26413
+ };
26379
26414
  this.clickButtonHandler = {
26380
26415
  onClick: (event) => {
26381
26416
  var _a, _b;
@@ -26383,9 +26418,6 @@ class KolSplitButton {
26383
26418
  if (typeof ((_a = this._on) === null || _a === void 0 ? void 0 : _a.onClick) === 'function') {
26384
26419
  (_b = this._on) === null || _b === void 0 ? void 0 : _b.onClick(event, this._value);
26385
26420
  }
26386
- else {
26387
- this.toggleDropdown();
26388
- }
26389
26421
  },
26390
26422
  };
26391
26423
  this.clickToggleHandler = {
@@ -26400,7 +26432,9 @@ class KolSplitButton {
26400
26432
  this.handleOnClose = () => {
26401
26433
  this.state = Object.assign(Object.assign({}, this.state), { _show: false });
26402
26434
  };
26435
+ this._accessKey = undefined;
26403
26436
  this._ariaControls = undefined;
26437
+ this._ariaDescription = undefined;
26404
26438
  this._ariaExpanded = undefined;
26405
26439
  this._ariaSelected = undefined;
26406
26440
  this._customClass = undefined;
@@ -26412,6 +26446,7 @@ class KolSplitButton {
26412
26446
  this._name = undefined;
26413
26447
  this._on = undefined;
26414
26448
  this._role = undefined;
26449
+ this._shortKey = undefined;
26415
26450
  this._syncValueBySelector = undefined;
26416
26451
  this._tooltipAlign = 'top';
26417
26452
  this._type = 'button';
@@ -26421,12 +26456,19 @@ class KolSplitButton {
26421
26456
  _show: false,
26422
26457
  };
26423
26458
  }
26459
+ async getValue() {
26460
+ return this._value;
26461
+ }
26462
+ async kolFocus() {
26463
+ var _a;
26464
+ await ((_a = this.primaryButtonWcRef) === null || _a === void 0 ? void 0 : _a.kolFocus());
26465
+ }
26424
26466
  render() {
26425
26467
  const i18nDropdownLabel = 'kol-split-button-dropdown-label';
26426
- return (hAsync("div", { key: 'adfeb36fc1c13115648cab2c692dcf28ede4f663', class: "kol-split-button" }, hAsync("div", { key: '6ddddfa00a901d7a1c02a242384ba6478955c13b', class: "kol-split-button__root" }, hAsync(KolButtonWcTag, { key: '73295b6c589ee559c4e301c6685568e0aa6359de', class: clsx('kol-split-button__button', {
26468
+ return (hAsync("div", { key: '2ca0df775c2fcce89473dfeaad1fbb64235b8a3b', class: "kol-split-button" }, hAsync("div", { key: '8933d5eddbc53f3653dcba1c4bcee525cff244b4', class: "kol-split-button__root" }, hAsync(KolButtonWcTag, { key: 'f5a0ca81140515725acb321757a7fe36ee02ea14', class: clsx('kol-split-button__button', {
26427
26469
  [this._variant]: this._variant !== 'custom',
26428
26470
  [this._customClass]: this._variant === 'custom' && typeof this._customClass === 'string' && this._customClass.length > 0,
26429
- }), _ariaControls: this._ariaControls, _ariaExpanded: this._ariaExpanded, _ariaSelected: this._ariaSelected, _customClass: this._customClass, _disabled: this._disabled, _icons: this._icons, _hideLabel: this._hideLabel, _label: this._label, _name: this._name, _on: this.clickButtonHandler, _role: this._role, _syncValueBySelector: this._syncValueBySelector, _tooltipAlign: this._tooltipAlign, _type: this._type, _value: this._value, _buttonVariant: this._variant }), hAsync("div", { key: '29f15b767934692234c76d6738696ea225488d24', class: "kol-split-button__horizontal-line" }), hAsync(KolButtonWcTag, { key: '689696759403849639ec892383aad2d055ac1482', class: "kol-split-button__secondary-button", _disabled: this._disabled, _hideLabel: true, _icons: "codicon codicon-triangle-down", _label: this.state._show ? translate(`${i18nDropdownLabel}-close`) : translate(`${i18nDropdownLabel}-open`), _on: this.clickToggleHandler })), hAsync(KolPopoverWcTag, { key: 'ba4151408b5ea8295eaee3f680ccd394e081464b', _show: this.state._show, _on: { onClose: this.handleOnClose }, _align: "bottom" }, hAsync("slot", { key: '88c02a85478c3cedae8272e2f3f4848bbf031488' }))));
26471
+ }), ref: this.catchPrimaryRef, _accessKey: this._accessKey, _ariaControls: this._ariaControls, _ariaDescription: this._ariaDescription, _ariaExpanded: this._ariaExpanded, _ariaSelected: this._ariaSelected, _customClass: this._customClass, _disabled: this._disabled, _icons: this._icons, _id: this._id, _hideLabel: this._hideLabel, _label: this._label, _name: this._name, _on: this.clickButtonHandler, _role: this._role, _shortKey: this._shortKey, _syncValueBySelector: this._syncValueBySelector, _tooltipAlign: this._tooltipAlign, _type: this._type, _value: this._value, _buttonVariant: this._variant }), hAsync("div", { key: '4ee2a8564093ceaf91735a06cadb2d61477e8403', class: "kol-split-button__horizontal-line" }), hAsync(KolButtonWcTag, { key: 'aae9e7140a3f4fe3c892a29172b33c72ef165a30', class: "kol-split-button__secondary-button", _disabled: this._disabled, _hideLabel: true, _icons: "codicon codicon-triangle-down", _label: this.state._show ? translate(`${i18nDropdownLabel}-close`) : translate(`${i18nDropdownLabel}-open`), _on: this.clickToggleHandler })), hAsync(KolPopoverWcTag, { key: '032232308b826e91f2bed8dce79ce898961f5f0f', _show: this.state._show, _on: { onClose: this.handleOnClose }, _align: "bottom" }, hAsync("slot", { key: 'dc706f0a2c45e7527111af72e0bdf5b6a551ef60' }))));
26430
26472
  }
26431
26473
  async closePopup() {
26432
26474
  this.handleOnClose();
@@ -26440,7 +26482,9 @@ class KolSplitButton {
26440
26482
  "$flags$": 57,
26441
26483
  "$tagName$": "kol-split-button",
26442
26484
  "$members$": {
26485
+ "_accessKey": [1, "_access-key"],
26443
26486
  "_ariaControls": [1, "_aria-controls"],
26487
+ "_ariaDescription": [1, "_aria-description"],
26444
26488
  "_ariaExpanded": [4, "_aria-expanded"],
26445
26489
  "_ariaSelected": [4, "_aria-selected"],
26446
26490
  "_customClass": [1, "_custom-class"],
@@ -26452,12 +26496,15 @@ class KolSplitButton {
26452
26496
  "_name": [1],
26453
26497
  "_on": [16],
26454
26498
  "_role": [1],
26499
+ "_shortKey": [1, "_short-key"],
26455
26500
  "_syncValueBySelector": [1, "_sync-value-by-selector"],
26456
26501
  "_tooltipAlign": [1, "_tooltip-align"],
26457
26502
  "_type": [1],
26458
26503
  "_value": [8],
26459
26504
  "_variant": [1],
26460
26505
  "state": [32],
26506
+ "getValue": [64],
26507
+ "kolFocus": [64],
26461
26508
  "closePopup": [64]
26462
26509
  },
26463
26510
  "$listeners$": undefined,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@public-ui/hydrate",
3
- "version": "3.0.2-ab502d4896d9763f93bb8cce1b07a1b2f8d04439.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-ab502d4896d9763f93bb8cce1b07a1b2f8d04439.0"
49
+ "@public-ui/components": "3.0.2-d721ede5369345abe032367b7d05a7c5a20dca9b.0"
50
50
  },
51
51
  "peerDependencies": {
52
- "@public-ui/components": "3.0.2-ab502d4896d9763f93bb8cce1b07a1b2f8d04439.0"
52
+ "@public-ui/components": "3.0.2-d721ede5369345abe032367b7d05a7c5a20dca9b.0"
53
53
  },
54
54
  "sideEffects": false,
55
55
  "type": "commonjs",