@public-ui/hydrate 3.0.2-d721ede5369345abe032367b7d05a7c5a20dca9b.0 → 3.0.2-f97556ada8a20e9abe2dbb519562bad234f7191b.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 @public-ui/hydrate
23
- pnpm i @public-ui/hydrate
24
- yarn add @public-ui/hydrate
22
+ npm i -g @public-ui/hydrate
23
+ pnpm i -g @public-ui/hydrate
24
+ yarn add -g @public-ui/hydrate
25
25
  ```
26
26
 
27
27
  ## Usage
@@ -35,5 +35,3 @@ 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,10 +3832,6 @@ 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
-
3839
3835
  const validateAlignment = (component, propName, value) => {
3840
3836
  watchValidator(component, propName, (value) => typeof value === 'string' && alignPropTypeOptions.includes(value), new Set(alignPropTypeOptions), value, {
3841
3837
  defaultValue: 'top',
@@ -4202,14 +4198,6 @@ const validateImageSource = (component, value, options) => {
4202
4198
  watchString(component, '_src', value, options);
4203
4199
  };
4204
4200
 
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
-
4213
4201
  const validateIndeterminate = (component, value) => {
4214
4202
  watchBoolean(component, '_indeterminate', value);
4215
4203
  };
@@ -5146,28 +5134,13 @@ const AlertIcon = ({ type, label }) => {
5146
5134
  }
5147
5135
  };
5148
5136
 
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
- };
5167
5137
  const KolAlertFc = (props, children) => {
5138
+ var _a, _b;
5168
5139
  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"]);
5169
5140
  if (alert) {
5170
- vibrateOnError();
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
+ }
5171
5144
  setTimeout(() => {
5172
5145
  onAlertTimeout === null || onAlertTimeout === void 0 ? void 0 : onAlertTimeout();
5173
5146
  }, 10000);
@@ -5232,7 +5205,7 @@ class KolAlertWc {
5232
5205
  onCloserClick: this.close,
5233
5206
  onAlertTimeout: this.handleAlertTimeout,
5234
5207
  };
5235
- return (hAsync(KolAlertFc, Object.assign({ key: '2b0d74465270eef8d8d6f3da8c04377f862e8630' }, props), hAsync("slot", { key: '55e8ad62be763c26af16813e5ebfac2ce1f63b54' })));
5208
+ return (hAsync(KolAlertFc, Object.assign({ key: '9038051f21b86a9c83c8ac5619e723dff5ebcbeb' }, props), hAsync("slot", { key: 'cfd116176ab783db5232d9d5520f8ae890ca44db' })));
5236
5209
  }
5237
5210
  validateAlert(value) {
5238
5211
  watchBoolean(this, '_alert', value);
@@ -17414,15 +17387,8 @@ const CustomSuggestionsToggleFc = ({ onClick, disabled }) => {
17414
17387
  hAsync(KolIconTag, { _icons: "codicon codicon-triangle-down", _label: translate('kol-dropdown') })));
17415
17388
  };
17416
17389
 
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 || '')));
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));
17426
17392
  };
17427
17393
 
17428
17394
  const CustomSuggestionsOptionsGroupFc = ({ blockSuggestionMouseOver, onKeyDown, style }, children) => {
@@ -17530,7 +17496,7 @@ class KolCombobox {
17530
17496
  render() {
17531
17497
  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) &&
17532
17498
  this._filteredSuggestions.length > 0 &&
17533
- this._filteredSuggestions.map((option, index) => (hAsync(CustomSuggestionsOptionFc, { index: index, option: option, searchTerm: this.state._value, ref: (el) => {
17499
+ this._filteredSuggestions.map((option, index) => (hAsync(CustomSuggestionsOptionFc, { index: index, option: option, ref: (el) => {
17534
17500
  if (el)
17535
17501
  this.refSuggestions[index] = el;
17536
17502
  }, selected: this.state._value === option, onClick: () => {
@@ -18364,13 +18330,15 @@ class KolImage {
18364
18330
  };
18365
18331
  }
18366
18332
  validateAlt(value) {
18367
- validateAlt(this, value, { required: true });
18333
+ watchString(this, '_alt', value, {
18334
+ required: true,
18335
+ });
18368
18336
  }
18369
18337
  validateLoading(value) {
18370
18338
  validateLoading(this, value);
18371
18339
  }
18372
18340
  validateSizes(value) {
18373
- validateImageSizes(this, value);
18341
+ watchString(this, '_sizes', value);
18374
18342
  }
18375
18343
  validateSrc(value) {
18376
18344
  validateImageSource(this, value, {
@@ -18378,7 +18346,7 @@ class KolImage {
18378
18346
  });
18379
18347
  }
18380
18348
  validateSrcset(value) {
18381
- validateImageSrcset(this, value);
18349
+ watchString(this, '_srcset', value);
18382
18350
  }
18383
18351
  componentWillLoad() {
18384
18352
  this.validateAlt(this._alt);
@@ -18388,7 +18356,7 @@ class KolImage {
18388
18356
  this.validateSrcset(this._srcset);
18389
18357
  }
18390
18358
  render() {
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 }));
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 }));
18392
18360
  }
18393
18361
  static get watchers() { return {
18394
18362
  "_alt": ["validateAlt"],
@@ -25935,7 +25903,7 @@ class KolSingleSelect {
25935
25903
  (_a = this.refInput) === null || _a === void 0 ? void 0 : _a.focus();
25936
25904
  }, class: clsx('kol-single-select__delete', {
25937
25905
  'kol-single-select__delete--disabled': this.state._disabled,
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) => {
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) => {
25939
25907
  if (el)
25940
25908
  this.refOptions[index] = el;
25941
25909
  }, selected: this._value === option.value, onClick: (event) => {
@@ -26412,9 +26380,6 @@ var KolSplitButtonDefaultStyle0 = defaultStyleCss$9;
26412
26380
  class KolSplitButton {
26413
26381
  constructor(hostRef) {
26414
26382
  registerInstance(this, hostRef);
26415
- this.catchPrimaryRef = (ref) => {
26416
- this.primaryButtonWcRef = ref;
26417
- };
26418
26383
  this.clickButtonHandler = {
26419
26384
  onClick: (event) => {
26420
26385
  var _a, _b;
@@ -26422,6 +26387,9 @@ class KolSplitButton {
26422
26387
  if (typeof ((_a = this._on) === null || _a === void 0 ? void 0 : _a.onClick) === 'function') {
26423
26388
  (_b = this._on) === null || _b === void 0 ? void 0 : _b.onClick(event, this._value);
26424
26389
  }
26390
+ else {
26391
+ this.toggleDropdown();
26392
+ }
26425
26393
  },
26426
26394
  };
26427
26395
  this.clickToggleHandler = {
@@ -26436,9 +26404,7 @@ class KolSplitButton {
26436
26404
  this.handleOnClose = () => {
26437
26405
  this.state = Object.assign(Object.assign({}, this.state), { _show: false });
26438
26406
  };
26439
- this._accessKey = undefined;
26440
26407
  this._ariaControls = undefined;
26441
- this._ariaDescription = undefined;
26442
26408
  this._ariaExpanded = undefined;
26443
26409
  this._ariaSelected = undefined;
26444
26410
  this._customClass = undefined;
@@ -26450,7 +26416,6 @@ class KolSplitButton {
26450
26416
  this._name = undefined;
26451
26417
  this._on = undefined;
26452
26418
  this._role = undefined;
26453
- this._shortKey = undefined;
26454
26419
  this._syncValueBySelector = undefined;
26455
26420
  this._tooltipAlign = 'top';
26456
26421
  this._type = 'button';
@@ -26460,19 +26425,12 @@ class KolSplitButton {
26460
26425
  _show: false,
26461
26426
  };
26462
26427
  }
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
- }
26470
26428
  render() {
26471
26429
  const i18nDropdownLabel = 'kol-split-button-dropdown-label';
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', {
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', {
26473
26431
  [this._variant]: this._variant !== 'custom',
26474
26432
  [this._customClass]: this._variant === 'custom' && typeof this._customClass === 'string' && this._customClass.length > 0,
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' }))));
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' }))));
26476
26434
  }
26477
26435
  async closePopup() {
26478
26436
  this.handleOnClose();
@@ -26486,9 +26444,7 @@ class KolSplitButton {
26486
26444
  "$flags$": 57,
26487
26445
  "$tagName$": "kol-split-button",
26488
26446
  "$members$": {
26489
- "_accessKey": [1, "_access-key"],
26490
26447
  "_ariaControls": [1, "_aria-controls"],
26491
- "_ariaDescription": [1, "_aria-description"],
26492
26448
  "_ariaExpanded": [4, "_aria-expanded"],
26493
26449
  "_ariaSelected": [4, "_aria-selected"],
26494
26450
  "_customClass": [1, "_custom-class"],
@@ -26500,15 +26456,12 @@ class KolSplitButton {
26500
26456
  "_name": [1],
26501
26457
  "_on": [16],
26502
26458
  "_role": [1],
26503
- "_shortKey": [1, "_short-key"],
26504
26459
  "_syncValueBySelector": [1, "_sync-value-by-selector"],
26505
26460
  "_tooltipAlign": [1, "_tooltip-align"],
26506
26461
  "_type": [1],
26507
26462
  "_value": [8],
26508
26463
  "_variant": [1],
26509
26464
  "state": [32],
26510
- "getValue": [64],
26511
- "kolFocus": [64],
26512
26465
  "closePopup": [64]
26513
26466
  },
26514
26467
  "$listeners$": undefined,
package/dist/index.mjs CHANGED
@@ -3828,10 +3828,6 @@ 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
-
3835
3831
  const validateAlignment = (component, propName, value) => {
3836
3832
  watchValidator(component, propName, (value) => typeof value === 'string' && alignPropTypeOptions.includes(value), new Set(alignPropTypeOptions), value, {
3837
3833
  defaultValue: 'top',
@@ -4198,14 +4194,6 @@ const validateImageSource = (component, value, options) => {
4198
4194
  watchString(component, '_src', value, options);
4199
4195
  };
4200
4196
 
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
-
4209
4197
  const validateIndeterminate = (component, value) => {
4210
4198
  watchBoolean(component, '_indeterminate', value);
4211
4199
  };
@@ -5142,28 +5130,13 @@ const AlertIcon = ({ type, label }) => {
5142
5130
  }
5143
5131
  };
5144
5132
 
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
- };
5163
5133
  const KolAlertFc = (props, children) => {
5134
+ var _a, _b;
5164
5135
  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"]);
5165
5136
  if (alert) {
5166
- vibrateOnError();
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
+ }
5167
5140
  setTimeout(() => {
5168
5141
  onAlertTimeout === null || onAlertTimeout === void 0 ? void 0 : onAlertTimeout();
5169
5142
  }, 10000);
@@ -5228,7 +5201,7 @@ class KolAlertWc {
5228
5201
  onCloserClick: this.close,
5229
5202
  onAlertTimeout: this.handleAlertTimeout,
5230
5203
  };
5231
- return (hAsync(KolAlertFc, Object.assign({ key: '2b0d74465270eef8d8d6f3da8c04377f862e8630' }, props), hAsync("slot", { key: '55e8ad62be763c26af16813e5ebfac2ce1f63b54' })));
5204
+ return (hAsync(KolAlertFc, Object.assign({ key: '9038051f21b86a9c83c8ac5619e723dff5ebcbeb' }, props), hAsync("slot", { key: 'cfd116176ab783db5232d9d5520f8ae890ca44db' })));
5232
5205
  }
5233
5206
  validateAlert(value) {
5234
5207
  watchBoolean(this, '_alert', value);
@@ -17410,15 +17383,8 @@ const CustomSuggestionsToggleFc = ({ onClick, disabled }) => {
17410
17383
  hAsync(KolIconTag, { _icons: "codicon codicon-triangle-down", _label: translate('kol-dropdown') })));
17411
17384
  };
17412
17385
 
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 || '')));
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));
17422
17388
  };
17423
17389
 
17424
17390
  const CustomSuggestionsOptionsGroupFc = ({ blockSuggestionMouseOver, onKeyDown, style }, children) => {
@@ -17526,7 +17492,7 @@ class KolCombobox {
17526
17492
  render() {
17527
17493
  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) &&
17528
17494
  this._filteredSuggestions.length > 0 &&
17529
- this._filteredSuggestions.map((option, index) => (hAsync(CustomSuggestionsOptionFc, { index: index, option: option, searchTerm: this.state._value, ref: (el) => {
17495
+ this._filteredSuggestions.map((option, index) => (hAsync(CustomSuggestionsOptionFc, { index: index, option: option, ref: (el) => {
17530
17496
  if (el)
17531
17497
  this.refSuggestions[index] = el;
17532
17498
  }, selected: this.state._value === option, onClick: () => {
@@ -18360,13 +18326,15 @@ class KolImage {
18360
18326
  };
18361
18327
  }
18362
18328
  validateAlt(value) {
18363
- validateAlt(this, value, { required: true });
18329
+ watchString(this, '_alt', value, {
18330
+ required: true,
18331
+ });
18364
18332
  }
18365
18333
  validateLoading(value) {
18366
18334
  validateLoading(this, value);
18367
18335
  }
18368
18336
  validateSizes(value) {
18369
- validateImageSizes(this, value);
18337
+ watchString(this, '_sizes', value);
18370
18338
  }
18371
18339
  validateSrc(value) {
18372
18340
  validateImageSource(this, value, {
@@ -18374,7 +18342,7 @@ class KolImage {
18374
18342
  });
18375
18343
  }
18376
18344
  validateSrcset(value) {
18377
- validateImageSrcset(this, value);
18345
+ watchString(this, '_srcset', value);
18378
18346
  }
18379
18347
  componentWillLoad() {
18380
18348
  this.validateAlt(this._alt);
@@ -18384,7 +18352,7 @@ class KolImage {
18384
18352
  this.validateSrcset(this._srcset);
18385
18353
  }
18386
18354
  render() {
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 }));
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 }));
18388
18356
  }
18389
18357
  static get watchers() { return {
18390
18358
  "_alt": ["validateAlt"],
@@ -25931,7 +25899,7 @@ class KolSingleSelect {
25931
25899
  (_a = this.refInput) === null || _a === void 0 ? void 0 : _a.focus();
25932
25900
  }, class: clsx('kol-single-select__delete', {
25933
25901
  'kol-single-select__delete--disabled': this.state._disabled,
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) => {
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) => {
25935
25903
  if (el)
25936
25904
  this.refOptions[index] = el;
25937
25905
  }, selected: this._value === option.value, onClick: (event) => {
@@ -26408,9 +26376,6 @@ var KolSplitButtonDefaultStyle0 = defaultStyleCss$9;
26408
26376
  class KolSplitButton {
26409
26377
  constructor(hostRef) {
26410
26378
  registerInstance(this, hostRef);
26411
- this.catchPrimaryRef = (ref) => {
26412
- this.primaryButtonWcRef = ref;
26413
- };
26414
26379
  this.clickButtonHandler = {
26415
26380
  onClick: (event) => {
26416
26381
  var _a, _b;
@@ -26418,6 +26383,9 @@ class KolSplitButton {
26418
26383
  if (typeof ((_a = this._on) === null || _a === void 0 ? void 0 : _a.onClick) === 'function') {
26419
26384
  (_b = this._on) === null || _b === void 0 ? void 0 : _b.onClick(event, this._value);
26420
26385
  }
26386
+ else {
26387
+ this.toggleDropdown();
26388
+ }
26421
26389
  },
26422
26390
  };
26423
26391
  this.clickToggleHandler = {
@@ -26432,9 +26400,7 @@ class KolSplitButton {
26432
26400
  this.handleOnClose = () => {
26433
26401
  this.state = Object.assign(Object.assign({}, this.state), { _show: false });
26434
26402
  };
26435
- this._accessKey = undefined;
26436
26403
  this._ariaControls = undefined;
26437
- this._ariaDescription = undefined;
26438
26404
  this._ariaExpanded = undefined;
26439
26405
  this._ariaSelected = undefined;
26440
26406
  this._customClass = undefined;
@@ -26446,7 +26412,6 @@ class KolSplitButton {
26446
26412
  this._name = undefined;
26447
26413
  this._on = undefined;
26448
26414
  this._role = undefined;
26449
- this._shortKey = undefined;
26450
26415
  this._syncValueBySelector = undefined;
26451
26416
  this._tooltipAlign = 'top';
26452
26417
  this._type = 'button';
@@ -26456,19 +26421,12 @@ class KolSplitButton {
26456
26421
  _show: false,
26457
26422
  };
26458
26423
  }
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
- }
26466
26424
  render() {
26467
26425
  const i18nDropdownLabel = 'kol-split-button-dropdown-label';
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', {
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', {
26469
26427
  [this._variant]: this._variant !== 'custom',
26470
26428
  [this._customClass]: this._variant === 'custom' && typeof this._customClass === 'string' && this._customClass.length > 0,
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' }))));
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' }))));
26472
26430
  }
26473
26431
  async closePopup() {
26474
26432
  this.handleOnClose();
@@ -26482,9 +26440,7 @@ class KolSplitButton {
26482
26440
  "$flags$": 57,
26483
26441
  "$tagName$": "kol-split-button",
26484
26442
  "$members$": {
26485
- "_accessKey": [1, "_access-key"],
26486
26443
  "_ariaControls": [1, "_aria-controls"],
26487
- "_ariaDescription": [1, "_aria-description"],
26488
26444
  "_ariaExpanded": [4, "_aria-expanded"],
26489
26445
  "_ariaSelected": [4, "_aria-selected"],
26490
26446
  "_customClass": [1, "_custom-class"],
@@ -26496,15 +26452,12 @@ class KolSplitButton {
26496
26452
  "_name": [1],
26497
26453
  "_on": [16],
26498
26454
  "_role": [1],
26499
- "_shortKey": [1, "_short-key"],
26500
26455
  "_syncValueBySelector": [1, "_sync-value-by-selector"],
26501
26456
  "_tooltipAlign": [1, "_tooltip-align"],
26502
26457
  "_type": [1],
26503
26458
  "_value": [8],
26504
26459
  "_variant": [1],
26505
26460
  "state": [32],
26506
- "getValue": [64],
26507
- "kolFocus": [64],
26508
26461
  "closePopup": [64]
26509
26462
  },
26510
26463
  "$listeners$": undefined,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@public-ui/hydrate",
3
- "version": "3.0.2-d721ede5369345abe032367b7d05a7c5a20dca9b.0",
3
+ "version": "3.0.2-f97556ada8a20e9abe2dbb519562bad234f7191b.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-d721ede5369345abe032367b7d05a7c5a20dca9b.0"
49
+ "@public-ui/components": "3.0.2-f97556ada8a20e9abe2dbb519562bad234f7191b.0"
50
50
  },
51
51
  "peerDependencies": {
52
- "@public-ui/components": "3.0.2-d721ede5369345abe032367b7d05a7c5a20dca9b.0"
52
+ "@public-ui/components": "3.0.2-f97556ada8a20e9abe2dbb519562bad234f7191b.0"
53
53
  },
54
54
  "sideEffects": false,
55
55
  "type": "commonjs",