@haiilo/catalyst 6.2.2 → 6.2.3

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.
Files changed (81) hide show
  1. package/dist/catalyst/catalyst.css +6 -5
  2. package/dist/catalyst/catalyst.esm.js +1 -1
  3. package/dist/catalyst/catalyst.esm.js.map +1 -1
  4. package/dist/catalyst/p-0c98e803.entry.js +10 -0
  5. package/dist/catalyst/p-0c98e803.entry.js.map +1 -0
  6. package/dist/catalyst/scss/_mixins.scss +2 -1
  7. package/dist/catalyst/scss/_variables.scss +1 -8
  8. package/dist/catalyst/scss/core/_nav.scss +2 -3
  9. package/dist/catalyst/scss/utils/_layout.scss +7 -3
  10. package/dist/catalyst/scss/utils/_z-index.mixins.scss +7 -0
  11. package/dist/catalyst/scss/vendor/_flatpickr.scss +1 -1
  12. package/dist/cjs/cat-alert_25.cjs.entry.js +86 -69
  13. package/dist/cjs/cat-alert_25.cjs.entry.js.map +1 -1
  14. package/dist/cjs/catalyst.cjs.js +1 -1
  15. package/dist/cjs/loader.cjs.js +1 -1
  16. package/dist/collection/components/cat-button/cat-button.css +21 -5
  17. package/dist/collection/components/cat-button/cat-button.js +18 -2
  18. package/dist/collection/components/cat-button/cat-button.js.map +1 -1
  19. package/dist/collection/components/cat-button/cat-button.spec.js +3 -1
  20. package/dist/collection/components/cat-button/cat-button.spec.js.map +1 -1
  21. package/dist/collection/components/cat-datepicker/cat-datepicker.js +57 -37
  22. package/dist/collection/components/cat-datepicker/cat-datepicker.js.map +1 -1
  23. package/dist/collection/components/cat-dropdown/cat-dropdown.css +34 -11
  24. package/dist/collection/components/cat-form-group/cat-form-group.js +6 -6
  25. package/dist/collection/components/cat-form-group/cat-form-group.js.map +1 -1
  26. package/dist/collection/components/cat-input/cat-input.css +5 -0
  27. package/dist/collection/components/cat-input/cat-input.js +3 -3
  28. package/dist/collection/components/cat-input/cat-input.js.map +1 -1
  29. package/dist/collection/components/cat-select/cat-select.css +1 -1
  30. package/dist/collection/components/cat-select/cat-select.js +9 -9
  31. package/dist/collection/components/cat-select/cat-select.js.map +1 -1
  32. package/dist/collection/components/cat-tab/cat-tab.js +16 -0
  33. package/dist/collection/components/cat-tab/cat-tab.js.map +1 -1
  34. package/dist/collection/components/cat-tabs/cat-tabs.css +24 -2
  35. package/dist/collection/components/cat-tabs/cat-tabs.js +3 -3
  36. package/dist/collection/components/cat-tabs/cat-tabs.js.map +1 -1
  37. package/dist/collection/components/cat-textarea/cat-textarea.js +3 -3
  38. package/dist/collection/components/cat-textarea/cat-textarea.js.map +1 -1
  39. package/dist/collection/components/cat-tooltip/cat-tooltip.css +1 -1
  40. package/dist/collection/scss/_mixins.scss +2 -1
  41. package/dist/collection/scss/_variables.scss +1 -8
  42. package/dist/collection/scss/core/_nav.scss +2 -3
  43. package/dist/collection/scss/utils/_layout.scss +7 -3
  44. package/dist/collection/scss/utils/_z-index.mixins.scss +7 -0
  45. package/dist/collection/scss/vendor/_flatpickr.scss +1 -1
  46. package/dist/components/cat-button2.js +5 -3
  47. package/dist/components/cat-button2.js.map +1 -1
  48. package/dist/components/cat-datepicker.js +52 -37
  49. package/dist/components/cat-datepicker.js.map +1 -1
  50. package/dist/components/cat-dropdown2.js +1 -1
  51. package/dist/components/cat-dropdown2.js.map +1 -1
  52. package/dist/components/cat-form-group.js +6 -6
  53. package/dist/components/cat-form-group.js.map +1 -1
  54. package/dist/components/cat-input2.js +4 -4
  55. package/dist/components/cat-input2.js.map +1 -1
  56. package/dist/components/cat-select2.js +10 -10
  57. package/dist/components/cat-select2.js.map +1 -1
  58. package/dist/components/cat-tab.js +3 -1
  59. package/dist/components/cat-tab.js.map +1 -1
  60. package/dist/components/cat-tabs.js +4 -4
  61. package/dist/components/cat-tabs.js.map +1 -1
  62. package/dist/components/cat-textarea.js +3 -3
  63. package/dist/components/cat-textarea.js.map +1 -1
  64. package/dist/components/cat-tooltip.js +1 -1
  65. package/dist/components/cat-tooltip.js.map +1 -1
  66. package/dist/esm/cat-alert_25.entry.js +86 -69
  67. package/dist/esm/cat-alert_25.entry.js.map +1 -1
  68. package/dist/esm/catalyst.js +1 -1
  69. package/dist/esm/loader.js +1 -1
  70. package/dist/types/components/cat-button/cat-button.d.ts +6 -0
  71. package/dist/types/components/cat-datepicker/cat-datepicker.d.ts +3 -0
  72. package/dist/types/components/cat-form-group/cat-form-group.d.ts +2 -2
  73. package/dist/types/components/cat-input/cat-input.d.ts +1 -1
  74. package/dist/types/components/cat-select/cat-select.d.ts +4 -4
  75. package/dist/types/components/cat-tab/cat-tab.d.ts +6 -0
  76. package/dist/types/components/cat-tabs/cat-tabs.d.ts +1 -1
  77. package/dist/types/components/cat-textarea/cat-textarea.d.ts +1 -1
  78. package/dist/types/components.d.ts +16 -0
  79. package/package.json +2 -2
  80. package/dist/catalyst/p-cd1f4492.entry.js +0 -10
  81. package/dist/catalyst/p-cd1f4492.entry.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"cat-form-group.js","sourceRoot":"","sources":["../../../src/components/cat-form-group/cat-form-group.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAazE,MAAM,OAAO,YAAY;;IACf,iBAAY,GAA8B,EAAE,CAAC;0BAWe,MAAM;sBAKrD,KAAK;;;EAQ1B,gBAAgB,CAAC,iBAA4D;IAC3E,MAAM,YAAY,GAAG,iBAAiB,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC;IAC1G,IAAI,CAAC,YAAY,CAAC,OAAO,CACvB,OAAO,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,cAAc,EAAE,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,GAAG,YAAY,CAAC,CAC7F,CAAC;EACJ,CAAC;EAGD,YAAY,CAAC,aAAsB;IACjC,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;MAClC,OAAO,CAAC,UAAU,GAAG,aAAa,CAAC;IACrC,CAAC,CAAC,CAAC;EACL,CAAC;EAED,MAAM;IACJ,OAAO,CACL,EAAC,IAAI,IAAC,KAAK,EAAE,EAAE,cAAc,EAAE,IAAI,CAAC,SAAS,EAAE;MAC7C,YAAM,YAAY,EAAE,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,GAAS,CACpD,CACR,CAAC;EACJ,CAAC;EAEO,YAAY;IAClB,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC,IAAI,CAC5B,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,qDAAqD,CAAC,CAC5D,CAAC;IAC/B,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IAC3C,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;EACrC,CAAC;EAEO,SAAS,CAAC,QAAmC;IACnD,MAAM,cAAc,GAAG,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC;IACxE,MAAM,cAAc,GAAG,QAAQ,CAAC,MAAM,GAAG,cAAc,CAAC;IACxD,OAAO,cAAc,IAAI,cAAc,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC;EACpE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, h, Host, Prop, Watch } from '@stencil/core';\n\ntype HTMLCatFormFieldElement =\n | HTMLCatInputElement\n | HTMLCatTextareaElement\n | HTMLCatSelectElement\n | HTMLCatDatepickerElement;\n\n@Component({\n tag: 'cat-form-group',\n styleUrl: 'cat-form-group.scss',\n shadow: true\n})\nexport class CatFormGroup {\n private formElements: HTMLCatFormFieldElement[] = [];\n\n @Element() hostElement!: HTMLElement;\n\n /**\n * Whether the labels need a marker to shown if the forms fields are required or optional.<br /><br />\n * By default, it is set to auto, it will display the mark depending on the number of required and optional fields: <br />\n * - If there are more required, the optional will be marked.<br />\n * - If there are less required, it will mark the required.<br /><br />\n * If a form field had \"!\", the requiredMarked of the field would not change.\n */\n @Prop() requiredMarker: 'none' | 'required' | 'optional' | 'auto' = 'auto';\n\n /**\n * Whether the label is on top or left.\n */\n @Prop() horizontal = false;\n\n /**\n * The space allocated to the input label\n */\n @Prop() labelSize?: string;\n\n @Watch('requiredMarker')\n onRequiredMarker(newRequiredMarker: 'none' | 'required' | 'optional' | 'auto') {\n const updateMarker = newRequiredMarker === 'auto' ? this.calculate(this.formElements) : newRequiredMarker;\n this.formElements.forEach(\n element => !element.requiredMarker?.endsWith('!') && (element.requiredMarker = updateMarker)\n );\n }\n\n @Watch('horizontal')\n onHorizontal(newHorizontal: boolean) {\n this.formElements.forEach(element => {\n element.horizontal = newHorizontal;\n });\n }\n\n render() {\n return (\n <Host style={{ '--label-size': this.labelSize }}>\n <slot onSlotchange={this.onSlotChange.bind(this)}></slot>\n </Host>\n );\n }\n\n private onSlotChange(): void {\n this.formElements = Array.from(\n this.hostElement.querySelectorAll('cat-input, cat-textarea, cat-select, cat-datepicker')\n ) as HTMLCatFormFieldElement[];\n this.onRequiredMarker(this.requiredMarker);\n this.onHorizontal(this.horizontal);\n }\n\n private calculate(elements: HTMLCatFormFieldElement[]): 'optional' | 'required' {\n const optionalFields = elements.filter(value => !value.required).length;\n const requiredFields = elements.length - optionalFields;\n return requiredFields >= optionalFields ? 'optional' : 'required';\n }\n}\n"]}
1
+ {"version":3,"file":"cat-form-group.js","sourceRoot":"","sources":["../../../src/components/cat-form-group/cat-form-group.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAA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K,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC;IACxE,MAAM,cAAc,GAAG,QAAQ,CAAC,MAAM,GAAG,cAAc,CAAC;IACxD,OAAO,cAAc,IAAI,cAAc,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC;EACpE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, h, Host, Prop, Watch } from '@stencil/core';\n\ntype HTMLCatFormFieldElement =\n | HTMLCatInputElement\n | HTMLCatTextareaElement\n | HTMLCatSelectElement\n | HTMLCatDatepickerElement;\n\n@Component({\n tag: 'cat-form-group',\n styleUrl: 'cat-form-group.scss',\n shadow: true\n})\nexport class CatFormGroup {\n private formElements: HTMLCatFormFieldElement[] = [];\n\n @Element() hostElement!: HTMLElement;\n\n /**\n * Whether the labels need a marker to shown if the forms fields are required or optional.<br /><br />\n * By default, it is set to auto, it will display the mark depending on the number of required and optional fields: <br />\n * - If there are more required, the optional will be marked.<br />\n * - If there are less required, it will mark the required.<br /><br />\n * If a form field had \"!\", the requiredMarked of the field would not change.\n */\n @Prop() requiredMarker: 'none' | 'required' | 'optional' | 'auto' = 'auto';\n\n /**\n * Whether the label is on top or left.\n */\n @Prop() horizontal = false;\n\n /**\n * The space allocated to the input label\n */\n @Prop() labelSize?: string;\n\n @Watch('requiredMarker')\n onRequiredMarkerChanged(newRequiredMarker: 'none' | 'required' | 'optional' | 'auto') {\n const updateMarker = newRequiredMarker === 'auto' ? this.calculate(this.formElements) : newRequiredMarker;\n this.formElements.forEach(\n element => !element.requiredMarker?.endsWith('!') && (element.requiredMarker = updateMarker)\n );\n }\n\n @Watch('horizontal')\n onHorizontalChanged(newHorizontal: boolean) {\n this.formElements.forEach(element => {\n element.horizontal = newHorizontal;\n });\n }\n\n render() {\n return (\n <Host style={{ '--label-size': this.labelSize }}>\n <slot onSlotchange={this.onSlotChange.bind(this)}></slot>\n </Host>\n );\n }\n\n private onSlotChange(): void {\n this.formElements = Array.from(\n this.hostElement.querySelectorAll('cat-input, cat-textarea, cat-select, cat-datepicker')\n ) as HTMLCatFormFieldElement[];\n this.onRequiredMarkerChanged(this.requiredMarker);\n this.onHorizontalChanged(this.horizontal);\n }\n\n private calculate(elements: HTMLCatFormFieldElement[]): 'optional' | 'required' {\n const optionalFields = elements.filter(value => !value.required).length;\n const requiredFields = elements.length - optionalFields;\n return requiredFields >= optionalFields ? 'optional' : 'required';\n }\n}\n"]}
@@ -432,6 +432,11 @@ input {
432
432
  border: none;
433
433
  outline: none;
434
434
  background: none;
435
+ /* stylelint-disable value-no-vendor-prefix, property-no-vendor-prefix */
436
+ overflow: hidden;
437
+ text-overflow: ellipsis;
438
+ white-space: nowrap;
439
+ /* stylelint-enable value-no-vendor-prefix, property-no-vendor-prefix */
435
440
  /* stylelint-disable property-no-vendor-prefix */
436
441
  /* stylelint-enable property-no-vendor-prefix */
437
442
  }
@@ -53,7 +53,7 @@ export class CatInput {
53
53
  return this.identifier || this._id;
54
54
  }
55
55
  componentWillRender() {
56
- this.watchErrorsHandler(this.errors);
56
+ this.onErrorsChanged(this.errors);
57
57
  this.hasSlottedLabel = !!this.hostElement.querySelector('[slot="label"]');
58
58
  this.hasSlottedHint = !!this.hostElement.querySelector('[slot="hint"]');
59
59
  if (!this.label && !this.hasSlottedLabel) {
@@ -84,7 +84,7 @@ export class CatInput {
84
84
  this.value = '';
85
85
  this.catChange.emit(this.value);
86
86
  }
87
- watchErrorsHandler(value) {
87
+ onErrorsChanged(value) {
88
88
  if (!coerceBoolean(this.errorUpdate)) {
89
89
  this.errorMap = undefined;
90
90
  }
@@ -779,7 +779,7 @@ export class CatInput {
779
779
  static get watchers() {
780
780
  return [{
781
781
  "propName": "errors",
782
- "methodName": "watchErrorsHandler"
782
+ "methodName": "onErrorsChanged"
783
783
  }];
784
784
  }
785
785
  }
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E;MACb,IAAI,CAAC,UAAU,EAAE,CAAC;KACnB;EACH,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Method, Prop, State, Watch } from '@stencil/core';\nimport log from 'loglevel';\nimport { coerceBoolean, coerceNumber } from '../../utils/coerce';\nimport { CatFormHint, ErrorMap } from '../cat-form-hint/cat-form-hint';\nimport { catI18nRegistry as i18n } from '../cat-i18n/cat-i18n-registry';\nimport { InputType } from './input-type';\n\nlet nextUniqueId = 0;\n\n/**\n * Inputs are used to allow users to provide text input when the expected input\n * is short. As well as plain text, Input supports various types of text,\n * including passwords and numbers.\n *\n * @slot hint - Optional hint element to be displayed with the input.\n * @slot label - The slotted label. If both the label property and the label slot are present, only the label slot will be displayed.\n * @part label - The label content.\n * @part prefix - The text prefix.\n * @part suffix - The text suffix.\n */\n@Component({\n tag: 'cat-input',\n styleUrl: 'cat-input.scss',\n shadow: true\n})\nexport class CatInput {\n private readonly _id = `cat-input-${nextUniqueId++}`;\n private get id() {\n return this.identifier || this._id;\n }\n\n private input!: HTMLInputElement;\n private errorMapSrc?: ErrorMap;\n\n @Element() hostElement!: HTMLElement;\n\n @State() hasSlottedLabel = false;\n\n @State() hasSlottedHint = false;\n\n @State() errorMap?: ErrorMap;\n\n /**\n * Whether the label need a marker to shown if the input is required or optional.\n */\n @Prop() requiredMarker: 'none' | 'required' | 'optional' | 'none!' | 'optional!' | 'required!' = 'optional';\n\n /**\n * Whether the label is on top or left.\n */\n @Prop() horizontal = false;\n\n /**\n * Hint for form autofill feature.\n */\n @Prop() autoComplete?: string;\n\n /**\n * Whether the input should show a clear button.\n */\n @Prop() clearable = false;\n\n /**\n * Whether the input is disabled.\n */\n @Prop() disabled = false;\n\n /**\n * Optional hint text(s) to be displayed with the input.\n */\n @Prop() hint?: string | string[];\n\n /**\n * The name of an icon to be displayed in the input.\n */\n @Prop() icon?: string;\n\n /**\n * Display the icon on the right.\n */\n @Prop() iconRight = false;\n\n /**\n * A unique identifier for the input.\n */\n @Prop() identifier?: string;\n\n /**\n * The label for the input.\n */\n @Prop() label = '';\n\n /**\n * Visually hide the label, but still show it to assistive technologies like screen readers.\n */\n @Prop() labelHidden = false;\n\n /**\n * A maximum value for date, time and numeric values.\n */\n @Prop() max?: number | string;\n\n /**\n * A maximum length (number of characters) for textual values.\n */\n @Prop() maxLength?: number;\n\n /**\n * A minimum value for date, time and numeric values.\n */\n @Prop() min?: number | string;\n\n /**\n * A minimum length (number of characters) for textual values.\n */\n @Prop() minLength?: number;\n\n /**\n * The name of the form control. Submitted with the form as part of a name/value pair.\n */\n @Prop() name?: string;\n\n /**\n * The placeholder text to display within the input.\n */\n @Prop() placeholder?: string;\n\n /**\n * A textual prefix to be displayed in the input.\n */\n @Prop() textPrefix?: string;\n\n /**\n * A textual suffix to be displayed in the input.\n */\n @Prop() textSuffix?: string;\n\n /**\n * The value is not editable.\n */\n @Prop() readonly = false;\n\n /**\n * A value is required or must be check for the form to be submittable.\n */\n @Prop() required = false;\n\n /**\n * Use round input edges.\n */\n @Prop() round = false;\n\n /**\n * Type of form control.\n */\n @Prop() type: InputType = 'text';\n\n /**\n * The value of the control.\n */\n @Prop({ mutable: true }) value?: string;\n\n /**\n * The validation errors for this input. Will render a hint under the input\n * with the translated error message(s) `error.${key}`. If an object is\n * passed, the keys will be used as error keys and the values translation\n * parameters.\n * If the value is `true`, the input will be marked as invalid without any\n * hints under the input.\n */\n @Prop() errors?: boolean | string[] | ErrorMap;\n\n /**\n * Fine-grained control over when the errors are shown. Can be `false` to\n * never show errors, `true` to show errors on blur, or a number to show\n * errors on change with the given delay in milliseconds.\n */\n @Prop() errorUpdate: boolean | number = 0;\n\n /**\n * Attributes that will be added to the native HTML input element.\n */\n @Prop() nativeAttributes?: { [key: string]: string };\n\n /**\n * Emitted when the value is changed.\n */\n @Event() catChange!: EventEmitter<string>;\n\n /**\n * Emitted when the input received focus.\n */\n @Event() catFocus!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the input loses focus.\n */\n @Event() catBlur!: EventEmitter<FocusEvent>;\n\n componentWillRender(): void {\n this.watchErrorsHandler(this.errors);\n this.hasSlottedLabel = !!this.hostElement.querySelector('[slot=\"label\"]');\n this.hasSlottedHint = !!this.hostElement.querySelector('[slot=\"hint\"]');\n if (!this.label && !this.hasSlottedLabel) {\n log.warn('[A11y] Missing ARIA label on input', this);\n }\n }\n\n /**\n * Programmatically move focus to the input. Use this method instead of\n * `input.focus()`.\n *\n * @param options An optional object providing options to control aspects of\n * the focusing process.\n */\n @Method()\n async doFocus(options?: FocusOptions): Promise<void> {\n this.input.focus(options);\n }\n\n /**\n * Programmatically remove focus from the input. Use this method instead of\n * `input.blur()`.\n */\n @Method()\n async doBlur(): Promise<void> {\n this.input.blur();\n }\n\n /**\n * Clear the input.\n */\n @Method()\n async clear(): Promise<void> {\n this.value = '';\n this.catChange.emit(this.value);\n }\n\n @Watch('errors')\n watchErrorsHandler(value?: boolean | string[] | ErrorMap) {\n if (!coerceBoolean(this.errorUpdate)) {\n this.errorMap = undefined;\n } else {\n this.errorMapSrc = Array.isArray(value)\n ? (value as string[]).reduce((acc, err) => ({ ...acc, [err]: undefined }), {})\n : value === true\n ? {}\n : value || undefined;\n this.showErrorsIfTimeout() || this.showErrorsIfNoFocus();\n }\n }\n\n render() {\n return (\n <div\n class={{\n 'input-field': true,\n 'input-horizontal': this.horizontal\n }}\n >\n <div class=\"label-container\">\n {(this.hasSlottedLabel || this.label) && (\n <label htmlFor={this.id} class={{ hidden: this.labelHidden }}>\n <span class=\"label-wrapper\" part=\"label\">\n {(this.hasSlottedLabel && <slot name=\"label\"></slot>) || this.label}\n <div class=\"label-metadata\">\n {!this.required && this.requiredMarker.startsWith('optional') && (\n <span class=\"label-optional\" aria-hidden=\"true\">\n ({i18n.t('input.optional')})\n </span>\n )}\n {this.required && this.requiredMarker.startsWith('required') && (\n <span class=\"label-optional\" aria-hidden=\"true\">\n ({i18n.t('input.required')})\n </span>\n )}\n {this.maxLength && (\n <div class=\"label-character-count\" aria-hidden=\"true\">\n {this.value?.toString().length ?? 0}/{this.maxLength}\n </div>\n )}\n </div>\n </span>\n </label>\n )}\n </div>\n <div class=\"input-container\">\n <div\n class={{\n 'input-wrapper': true,\n 'input-round': this.round,\n 'input-disabled': this.disabled,\n 'input-invalid': this.invalid\n }}\n onClick={() => this.input.focus()}\n >\n {this.textPrefix && (\n <span class=\"text-prefix\" part=\"prefix\">\n {this.textPrefix}\n </span>\n )}\n {this.icon && !this.iconRight && <cat-icon icon={this.icon} class=\"icon-prefix\" size=\"l\"></cat-icon>}\n <div class=\"input-inner-wrapper\">\n <input\n {...this.nativeAttributes}\n ref={el => (this.input = el as HTMLInputElement)}\n id={this.id}\n class={{\n 'has-clearable': this.clearable && !this.disabled\n }}\n autocomplete={this.autoComplete}\n disabled={this.disabled}\n max={this.max}\n maxlength={this.maxLength}\n min={this.min}\n minlength={this.minLength}\n name={this.name}\n placeholder={this.placeholder}\n readonly={this.readonly}\n required={this.required}\n type={this.type}\n value={this.value}\n onInput={this.onInput.bind(this)}\n onFocus={this.onFocus.bind(this)}\n onBlur={this.onBlur.bind(this)}\n aria-invalid={this.invalid ? 'true' : undefined}\n aria-describedby={this.hint?.length ? this.id + '-hint' : undefined}\n ></input>\n {this.clearable && !this.disabled && this.value && (\n <cat-button\n class=\"clearable\"\n icon=\"$cat:input-close\"\n icon-only=\"true\"\n size=\"s\"\n variant=\"text\"\n a11y-label={i18n.t('input.clear')}\n onClick={this.clear.bind(this)}\n ></cat-button>\n )}\n </div>\n {!this.invalid && this.icon && this.iconRight && (\n <cat-icon icon={this.icon} class=\"icon-suffix\" size=\"l\"></cat-icon>\n )}\n {this.invalid && <cat-icon icon=\"$cat:input-error\" class=\"icon-suffix cat-text-danger\" size=\"l\"></cat-icon>}\n {this.textSuffix && (\n <span class=\"text-suffix\" part=\"suffix\">\n {this.textSuffix}\n </span>\n )}\n </div>\n {(this.hint || this.hasSlottedHint || !!Object.keys(this.errorMap || {}).length) && (\n <CatFormHint\n id={this.id}\n hint={this.hint}\n slottedHint={this.hasSlottedHint && <slot name=\"hint\"></slot>}\n errorMap={this.errorMap}\n />\n )}\n </div>\n </div>\n );\n }\n\n private get invalid() {\n return !!this.errorMap;\n }\n\n private onInput() {\n this.value = this.input.value;\n this.catChange.emit(this.value);\n this.showErrorsIfTimeout();\n }\n\n private onFocus(event: FocusEvent) {\n this.catFocus.emit(event);\n }\n\n private onBlur(event: FocusEvent) {\n this.catBlur.emit(event);\n if (coerceBoolean(this.errorUpdate)) {\n this.showErrors();\n }\n }\n\n private showErrors() {\n this.errorMap = this.errorMapSrc;\n }\n\n private errorUpdateTimeoutId?: number;\n private showErrorsIfTimeout() {\n const errorUpdate = coerceNumber(this.errorUpdate, null);\n if (errorUpdate !== null) {\n typeof this.errorUpdateTimeoutId === 'number' && window.clearTimeout(this.errorUpdateTimeoutId);\n this.errorUpdateTimeoutId = window.setTimeout(() => this.showErrors(), errorUpdate);\n return true;\n }\n return false;\n }\n\n private showErrorsIfNoFocus() {\n const hasFocus = document.activeElement === this.hostElement || document.activeElement === this.input;\n if (!hasFocus) {\n this.showErrors();\n }\n }\n}\n"]}
1
+ {"version":3,"file":"cat-input.js","sourceRoot":"","sources":["../../../src/components/cat-input/cat-input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACvG,OAAO,GAAG,MAAM,UAAU,CAAC;AAC3B,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,WAAW,EAAY,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,eAAe,IAAI,IAAI,EAAE,MAAM,+BAA+B,CAAC;AAGxE,IAAI,YAAY,GAAG,CAAC,CAAC;AAErB;;;;;;;;;;GAUG;AAMH,MAAM,OAAO,QAAQ;;IACF,QAAG,GAAG,aAAa,YAAY,EAAE,EAAE,CAAC;2BAU1B,KAAK;0BAEN,KAAK;;0BAOkE,UAAU;sBAKtF,KAAK;;qBAUN,KAAK;oBAKN,KAAK;;;qBAeJ,KAAK;;iBAUT,EAAE;uBAKI,KAAK;;;;;;;;;oBA6CR,KAAK;oBAKL,KAAK;iBAKR,KAAK;gBAKK,MAAM;;;uBAsBQ,CAAC;;;EAtJzC,IAAY,EAAE;IACZ,OAAO,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,GAAG,CAAC;EACrC,CAAC;EA0KD,mBAAmB;IACjB,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAClC,IAAI,CAAC,eAAe,GAAG,CAAC,CAAC,IAAI,CAAC,WAAW,CAA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;KACb;IACD,OAAO,KAAK,CAAC;EACf,CAAC;EAEO,mBAAmB;IACzB,MAAM,QAAQ,GAAG,QAAQ,CAAC,aAAa,KAAK,IAAI,CAAC,WAAW,IAAI,QAAQ,CAAC,aAAa,KAAK,IAAI,CAAC,KAAK,CAAC;IACtG,IAAI,CAAC,QAAQ,EAAE;MACb,IAAI,CAAC,UAAU,EAAE,CAAC;KACnB;EACH,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Method, Prop, State, Watch } from '@stencil/core';\nimport log from 'loglevel';\nimport { coerceBoolean, coerceNumber } from '../../utils/coerce';\nimport { CatFormHint, ErrorMap } from '../cat-form-hint/cat-form-hint';\nimport { catI18nRegistry as i18n } from '../cat-i18n/cat-i18n-registry';\nimport { InputType } from './input-type';\n\nlet nextUniqueId = 0;\n\n/**\n * Inputs are used to allow users to provide text input when the expected input\n * is short. As well as plain text, Input supports various types of text,\n * including passwords and numbers.\n *\n * @slot hint - Optional hint element to be displayed with the input.\n * @slot label - The slotted label. If both the label property and the label slot are present, only the label slot will be displayed.\n * @part label - The label content.\n * @part prefix - The text prefix.\n * @part suffix - The text suffix.\n */\n@Component({\n tag: 'cat-input',\n styleUrl: 'cat-input.scss',\n shadow: true\n})\nexport class CatInput {\n private readonly _id = `cat-input-${nextUniqueId++}`;\n private get id() {\n return this.identifier || this._id;\n }\n\n private input!: HTMLInputElement;\n private errorMapSrc?: ErrorMap;\n\n @Element() hostElement!: HTMLElement;\n\n @State() hasSlottedLabel = false;\n\n @State() hasSlottedHint = false;\n\n @State() errorMap?: ErrorMap;\n\n /**\n * Whether the label need a marker to shown if the input is required or optional.\n */\n @Prop() requiredMarker: 'none' | 'required' | 'optional' | 'none!' | 'optional!' | 'required!' = 'optional';\n\n /**\n * Whether the label is on top or left.\n */\n @Prop() horizontal = false;\n\n /**\n * Hint for form autofill feature.\n */\n @Prop() autoComplete?: string;\n\n /**\n * Whether the input should show a clear button.\n */\n @Prop() clearable = false;\n\n /**\n * Whether the input is disabled.\n */\n @Prop() disabled = false;\n\n /**\n * Optional hint text(s) to be displayed with the input.\n */\n @Prop() hint?: string | string[];\n\n /**\n * The name of an icon to be displayed in the input.\n */\n @Prop() icon?: string;\n\n /**\n * Display the icon on the right.\n */\n @Prop() iconRight = false;\n\n /**\n * A unique identifier for the input.\n */\n @Prop() identifier?: string;\n\n /**\n * The label for the input.\n */\n @Prop() label = '';\n\n /**\n * Visually hide the label, but still show it to assistive technologies like screen readers.\n */\n @Prop() labelHidden = false;\n\n /**\n * A maximum value for date, time and numeric values.\n */\n @Prop() max?: number | string;\n\n /**\n * A maximum length (number of characters) for textual values.\n */\n @Prop() maxLength?: number;\n\n /**\n * A minimum value for date, time and numeric values.\n */\n @Prop() min?: number | string;\n\n /**\n * A minimum length (number of characters) for textual values.\n */\n @Prop() minLength?: number;\n\n /**\n * The name of the form control. Submitted with the form as part of a name/value pair.\n */\n @Prop() name?: string;\n\n /**\n * The placeholder text to display within the input.\n */\n @Prop() placeholder?: string;\n\n /**\n * A textual prefix to be displayed in the input.\n */\n @Prop() textPrefix?: string;\n\n /**\n * A textual suffix to be displayed in the input.\n */\n @Prop() textSuffix?: string;\n\n /**\n * The value is not editable.\n */\n @Prop() readonly = false;\n\n /**\n * A value is required or must be check for the form to be submittable.\n */\n @Prop() required = false;\n\n /**\n * Use round input edges.\n */\n @Prop() round = false;\n\n /**\n * Type of form control.\n */\n @Prop() type: InputType = 'text';\n\n /**\n * The value of the control.\n */\n @Prop({ mutable: true }) value?: string;\n\n /**\n * The validation errors for this input. Will render a hint under the input\n * with the translated error message(s) `error.${key}`. If an object is\n * passed, the keys will be used as error keys and the values translation\n * parameters.\n * If the value is `true`, the input will be marked as invalid without any\n * hints under the input.\n */\n @Prop() errors?: boolean | string[] | ErrorMap;\n\n /**\n * Fine-grained control over when the errors are shown. Can be `false` to\n * never show errors, `true` to show errors on blur, or a number to show\n * errors on change with the given delay in milliseconds.\n */\n @Prop() errorUpdate: boolean | number = 0;\n\n /**\n * Attributes that will be added to the native HTML input element.\n */\n @Prop() nativeAttributes?: { [key: string]: string };\n\n /**\n * Emitted when the value is changed.\n */\n @Event() catChange!: EventEmitter<string>;\n\n /**\n * Emitted when the input received focus.\n */\n @Event() catFocus!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the input loses focus.\n */\n @Event() catBlur!: EventEmitter<FocusEvent>;\n\n componentWillRender(): void {\n this.onErrorsChanged(this.errors);\n this.hasSlottedLabel = !!this.hostElement.querySelector('[slot=\"label\"]');\n this.hasSlottedHint = !!this.hostElement.querySelector('[slot=\"hint\"]');\n if (!this.label && !this.hasSlottedLabel) {\n log.warn('[A11y] Missing ARIA label on input', this);\n }\n }\n\n /**\n * Programmatically move focus to the input. Use this method instead of\n * `input.focus()`.\n *\n * @param options An optional object providing options to control aspects of\n * the focusing process.\n */\n @Method()\n async doFocus(options?: FocusOptions): Promise<void> {\n this.input.focus(options);\n }\n\n /**\n * Programmatically remove focus from the input. Use this method instead of\n * `input.blur()`.\n */\n @Method()\n async doBlur(): Promise<void> {\n this.input.blur();\n }\n\n /**\n * Clear the input.\n */\n @Method()\n async clear(): Promise<void> {\n this.value = '';\n this.catChange.emit(this.value);\n }\n\n @Watch('errors')\n onErrorsChanged(value?: boolean | string[] | ErrorMap) {\n if (!coerceBoolean(this.errorUpdate)) {\n this.errorMap = undefined;\n } else {\n this.errorMapSrc = Array.isArray(value)\n ? (value as string[]).reduce((acc, err) => ({ ...acc, [err]: undefined }), {})\n : value === true\n ? {}\n : value || undefined;\n this.showErrorsIfTimeout() || this.showErrorsIfNoFocus();\n }\n }\n\n render() {\n return (\n <div\n class={{\n 'input-field': true,\n 'input-horizontal': this.horizontal\n }}\n >\n <div class=\"label-container\">\n {(this.hasSlottedLabel || this.label) && (\n <label htmlFor={this.id} class={{ hidden: this.labelHidden }}>\n <span class=\"label-wrapper\" part=\"label\">\n {(this.hasSlottedLabel && <slot name=\"label\"></slot>) || this.label}\n <div class=\"label-metadata\">\n {!this.required && this.requiredMarker.startsWith('optional') && (\n <span class=\"label-optional\" aria-hidden=\"true\">\n ({i18n.t('input.optional')})\n </span>\n )}\n {this.required && this.requiredMarker.startsWith('required') && (\n <span class=\"label-optional\" aria-hidden=\"true\">\n ({i18n.t('input.required')})\n </span>\n )}\n {this.maxLength && (\n <div class=\"label-character-count\" aria-hidden=\"true\">\n {this.value?.toString().length ?? 0}/{this.maxLength}\n </div>\n )}\n </div>\n </span>\n </label>\n )}\n </div>\n <div class=\"input-container\">\n <div\n class={{\n 'input-wrapper': true,\n 'input-round': this.round,\n 'input-disabled': this.disabled,\n 'input-invalid': this.invalid\n }}\n onClick={() => this.input.focus()}\n >\n {this.textPrefix && (\n <span class=\"text-prefix\" part=\"prefix\">\n {this.textPrefix}\n </span>\n )}\n {this.icon && !this.iconRight && <cat-icon icon={this.icon} class=\"icon-prefix\" size=\"l\"></cat-icon>}\n <div class=\"input-inner-wrapper\">\n <input\n {...this.nativeAttributes}\n ref={el => (this.input = el as HTMLInputElement)}\n id={this.id}\n class={{\n 'has-clearable': this.clearable && !this.disabled\n }}\n autocomplete={this.autoComplete}\n disabled={this.disabled}\n max={this.max}\n maxlength={this.maxLength}\n min={this.min}\n minlength={this.minLength}\n name={this.name}\n placeholder={this.placeholder}\n readonly={this.readonly}\n required={this.required}\n type={this.type}\n value={this.value}\n onInput={this.onInput.bind(this)}\n onFocus={this.onFocus.bind(this)}\n onBlur={this.onBlur.bind(this)}\n aria-invalid={this.invalid ? 'true' : undefined}\n aria-describedby={this.hint?.length ? this.id + '-hint' : undefined}\n ></input>\n {this.clearable && !this.disabled && this.value && (\n <cat-button\n class=\"clearable\"\n icon=\"$cat:input-close\"\n icon-only=\"true\"\n size=\"s\"\n variant=\"text\"\n a11y-label={i18n.t('input.clear')}\n onClick={this.clear.bind(this)}\n ></cat-button>\n )}\n </div>\n {!this.invalid && this.icon && this.iconRight && (\n <cat-icon icon={this.icon} class=\"icon-suffix\" size=\"l\"></cat-icon>\n )}\n {this.invalid && <cat-icon icon=\"$cat:input-error\" class=\"icon-suffix cat-text-danger\" size=\"l\"></cat-icon>}\n {this.textSuffix && (\n <span class=\"text-suffix\" part=\"suffix\">\n {this.textSuffix}\n </span>\n )}\n </div>\n {(this.hint || this.hasSlottedHint || !!Object.keys(this.errorMap || {}).length) && (\n <CatFormHint\n id={this.id}\n hint={this.hint}\n slottedHint={this.hasSlottedHint && <slot name=\"hint\"></slot>}\n errorMap={this.errorMap}\n />\n )}\n </div>\n </div>\n );\n }\n\n private get invalid() {\n return !!this.errorMap;\n }\n\n private onInput() {\n this.value = this.input.value;\n this.catChange.emit(this.value);\n this.showErrorsIfTimeout();\n }\n\n private onFocus(event: FocusEvent) {\n this.catFocus.emit(event);\n }\n\n private onBlur(event: FocusEvent) {\n this.catBlur.emit(event);\n if (coerceBoolean(this.errorUpdate)) {\n this.showErrors();\n }\n }\n\n private showErrors() {\n this.errorMap = this.errorMapSrc;\n }\n\n private errorUpdateTimeoutId?: number;\n private showErrorsIfTimeout() {\n const errorUpdate = coerceNumber(this.errorUpdate, null);\n if (errorUpdate !== null) {\n typeof this.errorUpdateTimeoutId === 'number' && window.clearTimeout(this.errorUpdateTimeoutId);\n this.errorUpdateTimeoutId = window.setTimeout(() => this.showErrors(), errorUpdate);\n return true;\n }\n return false;\n }\n\n private showErrorsIfNoFocus() {\n const hasFocus = document.activeElement === this.hostElement || document.activeElement === this.input;\n if (!hasFocus) {\n this.showErrors();\n }\n }\n}\n"]}
@@ -506,7 +506,7 @@ cat-spinner {
506
506
  box-shadow: 0 4px 6px -2px rgba(27, 31, 38, 0.03), 0 12px 16px -4px rgba(27, 31, 38, 0.08);
507
507
  border-radius: var(--cat-border-radius-m, 0.25rem);
508
508
  border: 1px solid rgb(var(--cat-border-color, 235, 236, 240));
509
- z-index: 100;
509
+ z-index: calc(var(--cat-z-index, 0) + 100);
510
510
  /* Avoid layout interference */
511
511
  width: max-content;
512
512
  top: 0;
@@ -64,14 +64,14 @@ class CatSelect {
64
64
  get id() {
65
65
  return this.identifier || this._id;
66
66
  }
67
- onConnectorChange(connector) {
67
+ onConnectorChanged(connector) {
68
68
  this.reset(connector);
69
69
  this.resolve();
70
70
  }
71
- onValueChange() {
71
+ onValueChanged() {
72
72
  !this.valueChangedBySelection ? this.resolve() : (this.valueChangedBySelection = false);
73
73
  }
74
- watchErrorsHandler(value) {
74
+ onErrorsChanged(value) {
75
75
  if (!coerceBoolean(this.errorUpdate)) {
76
76
  this.errorMap = undefined;
77
77
  }
@@ -84,7 +84,7 @@ class CatSelect {
84
84
  this.showErrorsIfTimeout() || this.showErrorsIfNoFocus();
85
85
  }
86
86
  }
87
- onStateChange(newState, oldState) {
87
+ onStateChanged(newState, oldState) {
88
88
  const changed = (key) => newState[key] !== oldState[key];
89
89
  if (changed('isOpen')) {
90
90
  this.update();
@@ -137,7 +137,7 @@ class CatSelect {
137
137
  }
138
138
  }
139
139
  componentWillRender() {
140
- this.watchErrorsHandler(this.errors);
140
+ this.onErrorsChanged(this.errors);
141
141
  this.hasSlottedLabel = !!this.hostElement.querySelector('[slot="label"]');
142
142
  this.hasSlottedHint = !!this.hostElement.querySelector('[slot="hint"]');
143
143
  if (!this.label && !this.hasSlottedLabel) {
@@ -1181,16 +1181,16 @@ class CatSelect {
1181
1181
  static get watchers() {
1182
1182
  return [{
1183
1183
  "propName": "connector",
1184
- "methodName": "onConnectorChange"
1184
+ "methodName": "onConnectorChanged"
1185
1185
  }, {
1186
1186
  "propName": "value",
1187
- "methodName": "onValueChange"
1187
+ "methodName": "onValueChanged"
1188
1188
  }, {
1189
1189
  "propName": "errors",
1190
- "methodName": "watchErrorsHandler"
1190
+ "methodName": "onErrorsChanged"
1191
1191
  }, {
1192
1192
  "propName": "state",
1193
- "methodName": "onStateChange"
1193
+ "methodName": "onStateChanged"
1194
1194
  }];
1195
1195
  }
1196
1196
  static get listeners() {
@@ -1 +1 @@
1
- {"version":3,"file":"cat-select.js","sourceRoot":"","sources":["../../../src/components/cat-select/cat-select.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,EAAa,MAAM,kBAAkB,CAAC;AACxF,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACrH,OAAO,aAAa,MAAM,gBAAgB,CAAC;AAC3C,OAAO,GAAG,MAAM,UAAU,CAAC;AAC3B,OAAO,EACL,UAAU,EACV,QAAQ,EACR,oBAAoB,EACpB,MAAM,EACN,KAAK,EAEL,EAAE,EACF,IAAI,EACJ,SAAS,EACT,OAAO,EAEP,SAAS,EACT,SAAS,EACT,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,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,WAAW,CAAC,CAAC;MACpF,OAAO,IAAI,CAAC;KACb;IACD,OAAO,KAAK,CAAC;EACf,CAAC;EAEO,mBAAmB;IACzB,MAAM,QAAQ,GAAG,QAAQ,CAAC,aAAa,KAAK,IAAI,CAAC,WAAW,IAAI,QAAQ,CAAC,aAAa,KAAK,IAAI,CAAC,KAAK,CAAC;IACtG,IAAI,CAAC,QAAQ,EAAE;MACb,IAAI,CAAC,UAAU,EAAE,CAAC;KACnB;EACH,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA3gCuB,wBAAc,GAAG,CAAC,AAAJ,CAAK;AACnB,yBAAe,GAAG,CAAC,AAAJ,CAAK;SAFjC,SAAS","sourcesContent":["import { autoUpdate, computePosition, flip, offset, Placement } from '@floating-ui/dom';\nimport { Component, Element, Event, EventEmitter, h, Host, Listen, Method, Prop, State, Watch } from '@stencil/core';\nimport autosizeInput from 'autosize-input';\nimport log from 'loglevel';\nimport {\n catchError,\n debounce,\n distinctUntilChanged,\n filter,\n first,\n Observable,\n of,\n scan,\n startWith,\n Subject,\n Subscription,\n switchMap,\n takeWhile,\n tap,\n timer\n} from 'rxjs';\nimport { coerceBoolean, coerceNumber } from '../../utils/coerce';\nimport { CatFormHint, ErrorMap } from '../cat-form-hint/cat-form-hint';\nimport { catI18nRegistry as i18n } from '../cat-i18n/cat-i18n-registry';\n\nexport interface Item {\n id: string;\n}\n\nexport interface Page<T> {\n content: T[];\n last: boolean;\n totalElements?: number;\n}\n\nexport interface RenderInfo {\n label: string;\n description?: string;\n avatar?: {\n src?: string;\n round?: boolean;\n initials?: string;\n icon?: string;\n };\n}\n\n/**\n * @property customId - Change the ID of item for the given one.\n * @property resolve - Resolves the value of the select.\n * @property retrieve - Retrieves the options of the select.\n * @property render - Renders the items of the select.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface CatSelectConnector<T extends Item = any> {\n customId?: (item: T) => string;\n resolve: (ids: string[]) => Observable<T[]>;\n retrieve: (term: string, page: number) => Observable<Page<T>>;\n render: (item: T) => RenderInfo;\n}\n\nexport interface CatSelectState {\n term: string;\n isOpen: boolean;\n isLoading: boolean;\n isResolving: boolean;\n options: { item: Item; render: RenderInfo }[];\n tempSelection: { item: Item; render: RenderInfo }[];\n selection: { item: Item; render: RenderInfo }[];\n activeOptionIndex: number;\n activeSelectionIndex: number;\n totalElements?: number;\n}\n\nexport interface CatSelectMultipleTaggingValue {\n ids: string[];\n tags: string[];\n}\n\nexport interface CatSelectTaggingValue {\n id: string;\n tag: string;\n}\n\nconst INIT_STATE: CatSelectState = {\n term: '',\n isOpen: false,\n isLoading: false,\n isResolving: false,\n options: [],\n selection: [],\n tempSelection: [],\n activeOptionIndex: -1,\n activeSelectionIndex: -1\n};\n\nlet nextUniqueId = 0;\nlet nextTagUniqueId = 0;\n\n/**\n * Select lets user choose one option from an options' menu. Consider using\n * select when you have 6 or more options. Select component supports any content\n * type.\n *\n * @slot hint - Optional hint element to be displayed with the select.\n * @slot label - The slotted label. If both the label property and the label slot are present, only the label slot will be displayed.\n * @part label - The label content.\n */\n@Component({\n tag: 'cat-select',\n styleUrl: 'cat-select.scss',\n shadow: true\n})\nexport class CatSelect {\n private static readonly SKELETON_COUNT = 4;\n private static readonly DROPDOWN_OFFSET = 4;\n private readonly _id = `cat-input-${nextUniqueId++}`;\n private get id() {\n return this.identifier || this._id;\n }\n\n private dropdown?: HTMLElement;\n private trigger?: HTMLElement;\n private input?: HTMLInputElement;\n private errorMapSrc?: ErrorMap;\n\n private subscription?: Subscription;\n private term$: Subject<string> = new Subject();\n private more$: Subject<void> = new Subject();\n private valueChangedBySelection = false;\n\n @Element() hostElement!: HTMLElement;\n\n @State() connector?: CatSelectConnector;\n\n @State() state: CatSelectState = INIT_STATE;\n\n @State() hasSlottedLabel = false;\n\n @State() hasSlottedHint = false;\n\n @State() errorMap?: ErrorMap;\n\n /**\n * Whether the label need a marker to shown if the select is required or optional.\n */\n @Prop() requiredMarker: 'none' | 'required' | 'optional' | 'none!' | 'optional!' | 'required!' = 'optional';\n\n /**\n * Whether the label is on top or left.\n */\n @Prop() horizontal = false;\n\n /**\n * Enable multiple selection.\n */\n @Prop() multiple = false;\n\n /**\n * The debounce time for the search.\n */\n @Prop() debounce = 250;\n\n /**\n * The placement of the select.\n */\n @Prop() placement: Placement = 'bottom-start';\n\n /**\n * The value of the select. <br />\n * <br />\n * The value of the select depends on whether it is allowed to choose a single item or several items. <br />\n * When only one item can be selected, the value is the id of the item, in case several items can be selected, the value is an array of ids of the selected items. <br />\n * <br />\n * In case the user can add new items to the select (tags activated), the value in the single select is an object (CatSelectTaggingValue) with the id of the item or the name of the created item,\n * in the case of multiple select, it is an object (CatSelectMultipleTaggingValue) with the array of the ids of the items selected and the array of the names of the items created\n */\n @Prop({ mutable: true }) value?: string | string[] | CatSelectTaggingValue | CatSelectMultipleTaggingValue;\n\n /**\n * Whether the select is disabled.\n */\n @Prop() disabled = false;\n\n /**\n * The placeholder text to display within the select.\n */\n @Prop() placeholder?: string;\n\n /**\n * Optional hint text(s) to be displayed with the select.\n */\n @Prop() hint?: string | string[];\n\n /**\n * A unique identifier for the input.\n */\n @Prop() identifier?: string;\n\n /**\n * The label for the select.\n */\n @Prop() label = '';\n\n /**\n * The name of the form control. Submitted with the form as part of a name/value pair.\n */\n @Prop() name?: string;\n\n /**\n * Visually hide the label, but still show it to assistive technologies like screen readers.\n */\n @Prop() labelHidden = false;\n\n /**\n * A value is required or must be checked for the form to be submittable.\n */\n @Prop() required = false;\n\n /**\n * Whether the select should show a clear button.\n */\n @Prop() clearable = false;\n\n /**\n * Whether the select should add new items.\n */\n @Prop() tags = false;\n\n /**\n * Optional hint text to be displayed on the new item to be added.\n */\n @Prop() tagHint?: string;\n\n /**\n * The text to display in the dropdown if no results are found.\n */\n @Prop() noItems?: string;\n\n /**\n * The validation errors for this input. Will render a hint under the input\n * with the translated error message(s) `error.${key}`. If an object is\n * passed, the keys will be used as error keys and the values translation\n * parameters.\n * If the value is `true`, the input will be marked as invalid without any\n * hints under the input.\n */\n @Prop() errors?: boolean | string[] | ErrorMap;\n\n /**\n * Fine-grained control over when the errors are shown. Can be `false` to\n * never show errors, `true` to show errors on blur, or a number to show\n * errors on change with the given delay in milliseconds.\n */\n @Prop() errorUpdate: boolean | number = 0;\n\n /**\n * Attributes that will be added to the native HTML input element.\n */\n @Prop() nativeAttributes?: { [key: string]: string };\n\n @Watch('connector')\n onConnectorChange(connector: CatSelectConnector) {\n this.reset(connector);\n this.resolve();\n }\n\n @Watch('value')\n onValueChange() {\n !this.valueChangedBySelection ? this.resolve() : (this.valueChangedBySelection = false);\n }\n\n @Watch('errors')\n watchErrorsHandler(value?: boolean | string[] | ErrorMap) {\n if (!coerceBoolean(this.errorUpdate)) {\n this.errorMap = undefined;\n } else {\n this.errorMapSrc = Array.isArray(value)\n ? (value as string[]).reduce((acc, err) => ({ ...acc, [err]: undefined }), {})\n : value === true\n ? {}\n : value || undefined;\n this.showErrorsIfTimeout() || this.showErrorsIfNoFocus();\n }\n }\n\n @Watch('state')\n onStateChange(newState: CatSelectState, oldState: CatSelectState) {\n const changed = (key: keyof CatSelectState) => newState[key] !== oldState[key];\n if (changed('isOpen')) {\n this.update();\n }\n if (changed('activeOptionIndex') && this.state.activeOptionIndex >= 0) {\n this.dropdown\n ?.querySelector(`#select-${this.id}-option-${this.state.activeOptionIndex}`)\n ?.scrollIntoView({ block: 'nearest' });\n }\n\n if (changed('selection')) {\n let newValue;\n if (!this.multiple && this.state.selection.length) {\n this.hide();\n }\n const idsSelected = this.state.selection.map(item => item.item.id);\n if (!this.tags) {\n if (this.multiple) {\n newValue = idsSelected;\n } else {\n newValue = idsSelected.length ? idsSelected[0] : '';\n }\n } else {\n const ids = idsSelected.filter(id => !id.startsWith(`select-${this.id}-tag`));\n const tags = this.state.selection\n .filter(item => item.item.id.startsWith(`select-${this.id}-tag`))\n .map(item => item.render.label);\n if (this.multiple) {\n newValue = { ids, tags };\n } else {\n newValue = { id: ids.length ? ids[0] : '', tag: tags.length ? tags[0] : '' };\n }\n }\n\n if (!oldState.isResolving) {\n this.valueChangedBySelection = true;\n this.value = newValue;\n }\n this.catChange.emit();\n this.showErrorsIfTimeout();\n }\n }\n\n /**\n * Emitted when the select dropdown is opened.\n */\n @Event() catOpen!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the select dropdown is closed.\n */\n @Event() catClose!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the value is changed.\n */\n @Event() catChange!: EventEmitter<InputEvent>;\n\n /**\n * Emitted when the select loses the focus.\n */\n @Event() catBlur!: EventEmitter<FocusEvent>;\n\n componentDidLoad(): void {\n if (this.input) {\n autosizeInput(this.input);\n }\n if (this.trigger && this.dropdown) {\n autoUpdate(this.trigger, this.dropdown, () => this.update());\n }\n }\n\n componentWillRender(): void {\n this.watchErrorsHandler(this.errors);\n this.hasSlottedLabel = !!this.hostElement.querySelector('[slot=\"label\"]');\n this.hasSlottedHint = !!this.hostElement.querySelector('[slot=\"hint\"]');\n if (!this.label && !this.hasSlottedLabel) {\n log.warn('[A11y] Missing ARIA label on select', this);\n }\n }\n\n @Listen('blur')\n onBlur(event: FocusEvent): void {\n if (!this.multiple && this.state.activeOptionIndex >= 0) {\n if (this.tags && this.state.options[this.state.activeOptionIndex].item.id === `select-${this.id}-option-tag`) {\n this.createTag(this.state.term);\n } else {\n this.select(this.state.options[this.state.activeOptionIndex]);\n }\n }\n this.hide();\n // Conditionally remove selection if the option was not manually selected through click or enter key press\n if (!this.multiple && (!this.tags || !this.state.selection?.length) && this.state.tempSelection?.length) {\n this.patchState({\n activeSelectionIndex: -1,\n selection: this.state.tempSelection,\n tempSelection: [],\n options: [],\n term: this.state.tempSelection[0].render.label\n });\n } else {\n this.patchState({ activeSelectionIndex: -1 });\n }\n\n this.catBlur.emit(event);\n if (coerceBoolean(this.errorUpdate)) {\n this.showErrors();\n }\n }\n\n @Listen('keydown')\n onKeyDown(event: KeyboardEvent): void {\n const isInputFocused = this.hostElement.shadowRoot?.activeElement === this.input;\n\n if (['ArrowDown', 'ArrowUp', 'ArrowLeft', 'ArrowRight'].includes(event.key)) {\n this.onArrowKeyDown(event);\n } else if (['Enter', ' '].includes(event.key) && isInputFocused) {\n if (\n this.tags &&\n this.state.activeOptionIndex === 0 &&\n this.state.options[0].item.id === `select-${this.id}-option-tag`\n ) {\n event.preventDefault();\n if (this.multiple) {\n this.toggleTag(this.state.options[0]);\n } else {\n this.createTag(this.state.options[0].render.label);\n }\n } else if (this.state.activeOptionIndex >= 0) {\n event.preventDefault();\n if (this.multiple) {\n this.toggle(this.state.options[this.state.activeOptionIndex]);\n } else {\n this.select(this.state.options[this.state.activeOptionIndex]);\n }\n } else if (this.tags && event.key === 'Enter' && this.state.activeOptionIndex < 0) {\n this.createTag(this.state.term);\n }\n } else if (event.key === 'Escape') {\n this.hide();\n } else if (event.key === 'Backspace' || event.key === 'Delete') {\n this.input?.focus();\n if (!this.multiple || !this.state.term || (this.input?.selectionStart === 0 && event.key === 'Backspace')) {\n if (this.state.activeSelectionIndex >= 0) {\n this.deselect(this.state.selection[this.state.activeSelectionIndex].item.id);\n } else if (this.state.selection.length) {\n const selectionClone = [...this.state.selection];\n selectionClone.pop();\n this.patchState({\n selection: selectionClone,\n tempSelection: this.state.term ? [...this.state.selection] : []\n });\n }\n }\n } else if (event.key === 'Tab') {\n this.trigger?.setAttribute('tabindex', '-1');\n if (this.multiple) {\n this.patchState({ activeSelectionIndex: -1, activeOptionIndex: -1 });\n } else if (this.state.activeOptionIndex >= 0) {\n if (this.tags && this.state.options[this.state.activeOptionIndex].item.id === `select-${this.id}-option-tag`) {\n this.createTag(this.state.term);\n } else {\n this.select(this.state.options[this.state.activeOptionIndex]);\n }\n }\n } else if (event.key.length === 1) {\n this.input?.focus();\n }\n }\n\n @Listen('keyup')\n onKeyUp(event: KeyboardEvent): void {\n if (event.key === 'Tab' && !event.shiftKey) {\n this.hostElement.shadowRoot?.activeElement === this.trigger && this.input?.focus();\n if (this.hostElement.shadowRoot?.activeElement === this.input) {\n this.show();\n }\n } else if (event.key === 'Tab' && event.shiftKey) {\n const clearButton = this.trigger?.querySelector(`#select-clear-btn-${this.id}`);\n\n if (clearButton) {\n this.hostElement.shadowRoot?.activeElement === clearButton && this.show();\n } else {\n this.show();\n }\n }\n }\n\n /**\n * Connect the functions of the select\n *\n * @param connector - The {@link CatSelectConnector} of the select.\n */\n @Method()\n async connect(connector: CatSelectConnector): Promise<void> {\n this.connector = connector;\n let number$: Observable<number>;\n this.subscription?.unsubscribe();\n this.subscription = this.term$\n .asObservable()\n .pipe(\n debounce(term => (term ? timer(this.debounce) : of(0))),\n distinctUntilChanged(),\n tap(\n () =>\n (number$ = this.more$.pipe(\n filter(() => !this.state.isLoading),\n scan(n => n + 1, 0),\n startWith(0)\n ))\n ),\n tap(() => this.patchState({ options: [] })),\n switchMap(term =>\n number$.pipe(\n tap(() => this.patchState({ isLoading: true })),\n switchMap(number => connector.retrieve(term, number)),\n tap(page => this.patchState({ isLoading: false, totalElements: page.totalElements })),\n takeWhile(page => !page.last, true),\n scan((items, page) => [...items, ...page.content], [] as Item[])\n )\n )\n )\n .subscribe(items => {\n const options = this.toSelectItems(connector, items);\n\n if (\n this.tags &&\n this.state.term.trim().length &&\n !options.find(value1 => value1.render.label.toLowerCase() === this.state.term.toLowerCase())\n ) {\n let label;\n if (this.isTagSelected(this.state.term)) {\n label = this.state.selection.find(item => item.render.label.toLowerCase() === this.state.term.toLowerCase())\n ?.render.label;\n }\n options.unshift({\n item: { id: `select-${this.id}-option-tag` },\n render: { label: label ? label : this.state.term }\n });\n }\n this.patchState({\n options\n });\n });\n }\n\n render() {\n return (\n <Host>\n <div\n class={{\n 'select-field': true,\n 'select-horizontal': this.horizontal\n }}\n >\n <div class=\"label-container\">\n {(this.hasSlottedLabel || this.label) && (\n <label htmlFor={this.id} class={{ hidden: this.labelHidden }}>\n <span class=\"label-wrapper\" part=\"label\">\n {(this.hasSlottedLabel && <slot name=\"label\"></slot>) || this.label}\n <div class=\"label-metadata\">\n {!this.required && this.requiredMarker.startsWith('optional') && (\n <span class=\"label-optional\" aria-hidden=\"true\">\n ({i18n.t('input.optional')})\n </span>\n )}\n {this.required && this.requiredMarker.startsWith('required') && (\n <span class=\"label-optional\" aria-hidden=\"true\">\n ({i18n.t('input.required')})\n </span>\n )}\n </div>\n </span>\n </label>\n )}\n </div>\n\n <div class=\"select-container\">\n <div\n class={{ 'select-wrapper': true, 'select-disabled': this.disabled, 'select-invalid': this.invalid }}\n ref={el => (this.trigger = el)}\n id={this.id}\n role=\"combobox\"\n aria-expanded={this.state.isOpen || this.isPillboxActive()}\n aria-controls={this.isPillboxActive() ? `select-pillbox-${this.id}` : `select-listbox-${this.id}`}\n aria-required={this.required ? 'true' : false}\n aria-activedescendant={this.activeDescendant}\n onClick={e => this.onClick(e)}\n >\n <div class=\"select-wrapper-inner\">\n {this.multiple && this.state.selection.length ? (\n <div\n id={`select-pillbox-${this.id}`}\n role=\"listbox\"\n aria-orientation=\"horizontal\"\n class=\"select-pills\"\n >\n {this.state.selection.map((item, i) => (\n <span\n class={{\n pill: true,\n 'select-no-open': true,\n 'select-option-active': this.state.activeSelectionIndex === i\n }}\n role=\"option\"\n aria-selected=\"true\"\n id={`select-${this.id}-selection-${i}`}\n >\n {item.render.avatar ? (\n <cat-avatar\n label={item.render.label}\n round={item.render.avatar.round}\n src={item.render.avatar.src}\n icon={item.render.avatar.icon}\n initials={item.render.avatar.initials ?? ''}\n ></cat-avatar>\n ) : null}\n <span>{item.render.label}</span>\n {!this.disabled && (\n <cat-button\n size=\"xs\"\n variant=\"text\"\n icon=\"$cat:select-clear\"\n iconOnly\n a11yLabel={i18n.t('select.deselect')}\n onClick={() => this.deselect(item.item.id)}\n tabIndex={-1}\n onCatClick={event => event.stopPropagation()}\n ></cat-button>\n )}\n </span>\n ))}\n </div>\n ) : this.state.selection.length && this.state.selection[0].render.avatar ? (\n <cat-avatar\n label={this.state.selection[0].render.label}\n round={this.state.selection[0].render.avatar.round}\n src={this.state.selection[0].render.avatar.src}\n icon={this.state.selection[0].render.avatar.icon}\n initials={this.state.selection[0].render.avatar.initials ?? ''}\n ></cat-avatar>\n ) : null}\n <input\n {...this.nativeAttributes}\n class=\"select-input\"\n ref={el => (this.input = el)}\n aria-controls={this.isPillboxActive() ? `select-pillbox-${this.id}` : `select-listbox-${this.id}`}\n aria-activedescendant={this.activeDescendant}\n aria-invalid={this.invalid ? 'true' : undefined}\n aria-describedby={this.hint?.length ? this.id + '-hint' : undefined}\n onInput={this.onInput.bind(this)}\n value={!this.multiple ? this.state.term : undefined}\n placeholder={this.placeholder}\n disabled={this.disabled || this.state.isResolving}\n ></input>\n </div>\n {this.state.isResolving && <cat-spinner></cat-spinner>}\n {this.invalid && (\n <cat-icon icon=\"$cat:input-error\" class=\"icon-suffix cat-text-danger\" size=\"l\"></cat-icon>\n )}\n {(this.state.selection.length || this.state.term.length) &&\n !this.disabled &&\n !this.state.isResolving &&\n this.clearable ? (\n <cat-button\n id={`select-clear-btn-${this.id}`}\n iconOnly\n icon=\"$cat:input-close\"\n variant=\"text\"\n size=\"s\"\n a11yLabel={i18n.t('input.clear')}\n onCatClick={event => {\n event.stopPropagation();\n this.clear();\n }}\n ></cat-button>\n ) : null}\n {!this.state.isResolving && (\n <cat-button\n iconOnly\n icon=\"$cat:select-open\"\n class={{ 'select-btn': true, 'select-btn-open': this.state.isOpen }}\n variant=\"text\"\n size=\"s\"\n a11yLabel={this.state.isOpen ? i18n.t('select.close') : i18n.t('select.open')}\n aria-controls={`select-listbox-${this.id}`}\n aria-expanded={this.state.isOpen}\n tabIndex={-1}\n disabled={this.disabled || this.state.isResolving}\n onCatClick={event => event.stopPropagation()}\n ></cat-button>\n )}\n </div>\n {(this.hint || this.hasSlottedHint || !!Object.keys(this.errorMap || {}).length) && (\n <CatFormHint\n id={this.id}\n hint={this.hint}\n slottedHint={this.hasSlottedHint && <slot name=\"hint\"></slot>}\n errorMap={this.errorMap}\n />\n )}\n </div>\n </div>\n\n <div\n class=\"select-dropdown\"\n ref={el => (this.dropdown = el)}\n style={{ display: this.state.isOpen ? 'block' : undefined }}\n >\n {this.state.isOpen && (\n <cat-scrollable\n class=\"select-options-wrapper\"\n scrolledBuffer={56}\n noOverflowX\n noOverscroll\n noScrolledInit\n onScrolledBottom={() => this.more$.next()}\n >\n <ul\n class=\"select-options\"\n role=\"listbox\"\n aria-multiselectable={this.multiple}\n aria-setsize={this.state.totalElements}\n id={`select-listbox-${this.id}`}\n >\n {this.optionsList}\n {this.state.isLoading\n ? Array.from(Array(CatSelect.SKELETON_COUNT)).map(() => (\n <li class=\"select-option-loading\">\n <cat-skeleton variant=\"body\" lines={1}></cat-skeleton>\n <cat-skeleton variant=\"body\" lines={1}></cat-skeleton>\n </li>\n ))\n : !this.state.options.length &&\n !this.tags && (\n <li class=\"select-option-empty\">{this.noItems ? this.noItems : i18n.t('select.empty')}</li>\n )}\n </ul>\n </cat-scrollable>\n )}\n </div>\n </Host>\n );\n }\n\n private get invalid() {\n return !!this.errorMap;\n }\n\n private get optionsList() {\n return this.state.options.map((item, i) => {\n const isTagOption = this.tags && item.item.id === `select-${this.id}-option-tag`;\n\n const isOptionSelected = this.isSelected(item.item.id) || (this.tags && this.isTagSelected(item.render.label));\n\n const getLabel = () => {\n if (isTagOption) {\n return item.render.label + this.tagTextHelp;\n }\n return item.render.label;\n };\n\n return (\n <li\n role=\"option\"\n class=\"select-option\"\n id={`select-${this.id}-option-${i}`}\n aria-selected={isOptionSelected ? 'true' : 'false'}\n >\n {this.multiple ? (\n <cat-checkbox\n class={{ 'select-option-active': this.state.activeOptionIndex === i }}\n checked={isOptionSelected}\n tabIndex={-1}\n labelLeft\n onFocus={() => this.input?.focus()}\n onCatChange={e => {\n !isTagOption ? this.toggle(item) : this.toggleTag(item);\n e.stopPropagation();\n }}\n >\n <span slot=\"label\" class=\"select-option-inner\">\n {item.render.avatar ? (\n <cat-avatar\n label={item.render.label}\n round={item.render.avatar.round}\n src={item.render.avatar.src}\n icon={item.render.avatar.icon}\n initials={item.render.avatar.initials ?? ''}\n ></cat-avatar>\n ) : null}\n <span class=\"select-option-text\">\n <span class=\"select-option-label\">{getLabel()}</span>\n <span class=\"select-option-description\">{item.render.description}</span>\n </span>\n </span>\n </cat-checkbox>\n ) : (\n <div\n class={{\n 'select-option-inner': true,\n 'select-option-single': true,\n 'select-option-active': this.state.activeOptionIndex === i\n }}\n onFocus={() => this.input?.focus()}\n onClick={() => (isTagOption ? this.createTag(item.render.label) : this.select(item))}\n tabIndex={-1}\n >\n {item.render.avatar ? (\n <cat-avatar\n label={item.render.label}\n round={item.render.avatar.round}\n src={item.render.avatar.src}\n icon={item.render.avatar.icon}\n initials={item.render.avatar.initials ?? ''}\n ></cat-avatar>\n ) : null}\n <span class=\"select-option-text\">\n <span class=\"select-option-label\">{getLabel()}</span>\n <span class=\"select-option-description\">{item.render.description}</span>\n </span>\n </div>\n )}\n </li>\n );\n });\n }\n\n private resolve() {\n const connector = this.connector;\n if (!connector) {\n return;\n }\n this.patchState({ isResolving: true });\n\n const ids = this.initIds();\n let tags: string[];\n\n if (this.tags) {\n tags = this.initTags();\n }\n\n const data$ = ids.length ? connector.resolve(ids).pipe(first()) : of([]);\n data$.pipe(catchError(() => of([]))).subscribe(items => {\n const selection = this.toSelectItems(connector, items);\n if (this.tags) {\n tags\n .filter(tag => !this.isTagSelected(tag, selection))\n .forEach((tag, index) => {\n const item = { id: `select-${this.id}-tag-${index}`, name: tag };\n selection.push({ item, render: { label: item.name } });\n });\n }\n this.patchState({\n isResolving: false,\n selection,\n term: !this.multiple && selection.length ? selection[0].render.label : ''\n });\n });\n }\n\n private toSelectItems(connector: CatSelectConnector, items: Item[]) {\n return items.map(item => ({\n item: { ...item, id: connector.customId ? connector.customId(item) : item.id },\n render: connector.render(item)\n }));\n }\n\n private show() {\n if (!this.state.isOpen) {\n this.patchState({ isOpen: true });\n this.catOpen.emit();\n this.term$.next('');\n this.input?.classList.remove('select-input-transparent-caret');\n }\n }\n\n private hide() {\n if (this.state.isOpen) {\n this.patchState({ isOpen: false, activeOptionIndex: -1 });\n this.catClose.emit();\n }\n }\n\n private search(term: string) {\n this.patchState({ term, activeOptionIndex: -1, activeSelectionIndex: -1 });\n this.term$.next(term);\n }\n\n private isSelected(id: string) {\n return this.state.selection.findIndex(s => s.item.id === id) >= 0;\n }\n\n private select(item: { item: Item; render: RenderInfo }) {\n if (!this.isSelected(item.item.id)) {\n let newSelection;\n if (this.multiple) {\n newSelection = [...this.state.selection, item];\n } else {\n newSelection = [item];\n this.search(item.render.label);\n }\n this.patchState({ selection: newSelection });\n\n if (this.multiple && this.state.term.trim() && this.input) {\n this.patchState({ term: '', activeOptionIndex: -1 });\n this.term$.next('');\n this.input.value = '';\n }\n }\n this.setTransparentCaret();\n }\n\n private deselect(id: string) {\n if (this.isSelected(id)) {\n this.patchState({\n selection: this.state.selection.filter(item => item.item.id !== id),\n activeSelectionIndex: -1\n });\n }\n }\n\n private toggle(item: { item: Item; render: RenderInfo }) {\n this.isSelected(item.item.id)\n ? this.deselect(item.item.id)\n : this.tags && this.isTagSelected(item.render.label)\n ? this.removeTag(item.render.label)\n : this.select(item);\n }\n\n private clear() {\n if (this.input && this.state.term) {\n this.patchState({ selection: [], options: [], term: '', activeOptionIndex: -1, tempSelection: [] });\n this.term$.next('');\n this.input.value = '';\n } else {\n this.patchState({ selection: [], tempSelection: [] });\n }\n }\n\n private reset(connector?: CatSelectConnector) {\n this.connector = connector ?? this.connector;\n this.subscription?.unsubscribe();\n this.subscription = undefined;\n this.state = INIT_STATE;\n }\n\n private onClick(event: MouseEvent) {\n if (this.disabled) {\n return;\n }\n const elem = event.target as Element;\n this.trigger?.setAttribute('tabindex', '0');\n this.input?.focus();\n if (\n elem === this.trigger ||\n elem === this.input ||\n elem.classList.contains('select-btn') ||\n elem.nodeName === 'SPAN'\n ) {\n this.state.isOpen ? this.hide() : this.show();\n }\n }\n\n private onInput() {\n this.search(this.input?.value.trim() || '');\n if (!this.multiple) {\n if (this.state.selection.length) {\n const selectionClone = [...this.state.selection];\n selectionClone.pop();\n this.patchState({ selection: selectionClone, tempSelection: [...this.state.selection] });\n }\n\n if (!this.input?.value.trim()) {\n this.patchState({ tempSelection: [] });\n }\n }\n this.show();\n }\n\n private update() {\n if (this.trigger && this.dropdown) {\n computePosition(this.trigger, this.dropdown, {\n strategy: 'fixed',\n placement: this.placement,\n middleware: [offset(CatSelect.DROPDOWN_OFFSET), flip()]\n }).then(({ x, y, placement }) => {\n if (this.dropdown) {\n this.dropdown.dataset.placement = placement;\n Object.assign(this.dropdown.style, {\n width: `${this.trigger?.clientWidth}px`,\n left: `${x}px`,\n top: `${y}px`\n });\n }\n });\n }\n }\n\n private patchState(update: Partial<CatSelectState>) {\n this.state = { ...this.state, ...update };\n }\n\n private isPillboxActive() {\n return this.state.activeSelectionIndex >= 0;\n }\n\n private get activeDescendant() {\n let activeDescendant = undefined;\n if (this.state.activeOptionIndex >= 0) {\n activeDescendant = `select-${this.id}-option-${this.state.activeOptionIndex}`;\n } else if (this.state.activeSelectionIndex >= 0) {\n activeDescendant = `select-${this.id}-selection-${this.state.activeSelectionIndex}`;\n }\n return activeDescendant;\n }\n\n private onArrowKeyDown(event: KeyboardEvent) {\n let preventDefault = false;\n this.input?.focus();\n\n switch (event.key) {\n case 'ArrowDown':\n preventDefault = true;\n this.state.isOpen\n ? this.patchState({\n activeOptionIndex: Math.min(this.state.activeOptionIndex + 1, this.state.options.length - 1),\n activeSelectionIndex: -1\n })\n : this.show();\n break;\n case 'ArrowUp':\n preventDefault = true;\n this.state.activeOptionIndex >= 0\n ? this.patchState({\n activeOptionIndex: Math.max(this.state.activeOptionIndex - 1, -1),\n activeSelectionIndex: -1\n })\n : this.hide();\n break;\n case 'ArrowLeft':\n if (this.input?.selectionStart === 0) {\n preventDefault = true;\n let index;\n this.state.activeSelectionIndex > 0\n ? (index = Math.max(this.state.activeSelectionIndex - 1, -1))\n : (index = this.state.selection.length - 1);\n this.patchState({ activeSelectionIndex: index, activeOptionIndex: -1 });\n }\n break;\n case 'ArrowRight':\n if (this.state.activeSelectionIndex >= 0) {\n preventDefault = true;\n let index = -1;\n if (this.state.activeSelectionIndex < this.state.selection.length - 1) {\n index = Math.min(this.state.activeSelectionIndex + 1, this.state.selection.length - 1);\n } else if (!this.state.term) {\n index = 0;\n }\n this.patchState({ activeSelectionIndex: index, activeOptionIndex: -1 });\n }\n }\n\n if (preventDefault) {\n event.preventDefault();\n event.stopPropagation();\n }\n }\n\n private get tagTextHelp() {\n return this.tagHint && !this.isTagSelected(this.state.term) ? ' (' + this.tagHint + ')' : '';\n }\n\n private isTagSelected(term: string, selection: { item: Item; render: RenderInfo }[] = this.state.selection) {\n return selection.findIndex(item => item.render.label.toLowerCase() === term.toLowerCase()) >= 0;\n }\n\n private createTag(term: string) {\n if (term.trim().length && !this.isTagSelected(term)) {\n const value = this.value as CatSelectMultipleTaggingValue;\n const tags = value?.tags;\n const tag = { id: `select-${this.id}-tag-${tags?.length ? tags?.length + nextTagUniqueId++ : 0}`, name: term };\n this.select({ item: tag, render: { label: tag.name } });\n }\n this.setTransparentCaret();\n }\n\n private removeTag(label: string) {\n if (this.isTagSelected(label)) {\n const item = this.state.selection.find(item => item.render.label.toLowerCase() === label.toLowerCase());\n item && this.deselect(item.item.id);\n }\n }\n\n private toggleTag(item: { item: Item; render: RenderInfo }) {\n this.isTagSelected(item.render.label) ? this.removeTag(item.render.label) : this.createTag(item.render.label);\n }\n\n private initIds() {\n let ids: string[] = [];\n if (this.value) {\n if (!this.tags) {\n if (this.multiple) {\n ids = this.value as string[];\n } else {\n ids = [this.value as string];\n }\n } else {\n if (this.multiple) {\n const value = this.value as CatSelectMultipleTaggingValue;\n ids = value.ids ? value.ids : [];\n } else {\n const value = this.value as CatSelectTaggingValue;\n ids = value.id ? [value.id] : [];\n }\n }\n }\n return ids;\n }\n\n private initTags() {\n let tags: string[] = [];\n if (this.value) {\n if (this.multiple) {\n const value = this.value as CatSelectMultipleTaggingValue;\n tags = value.tags ? value.tags : [];\n } else {\n const value = this.value as CatSelectTaggingValue;\n tags = value.tag ? [value.tag] : [];\n }\n }\n return tags;\n }\n\n private setTransparentCaret() {\n if (!this.multiple) {\n this.hide();\n this.input?.classList.add('select-input-transparent-caret');\n }\n }\n\n private showErrors() {\n this.errorMap = this.errorMapSrc;\n }\n\n private errorUpdateTimeoutId?: number;\n private showErrorsIfTimeout() {\n const errorUpdate = coerceNumber(this.errorUpdate, null);\n if (errorUpdate !== null) {\n typeof this.errorUpdateTimeoutId === 'number' && window.clearTimeout(this.errorUpdateTimeoutId);\n this.errorUpdateTimeoutId = window.setTimeout(() => this.showErrors(), errorUpdate);\n return true;\n }\n return false;\n }\n\n private showErrorsIfNoFocus() {\n const hasFocus = document.activeElement === this.hostElement || document.activeElement === this.input;\n if (!hasFocus) {\n this.showErrors();\n }\n }\n}\n"]}
1
+ {"version":3,"file":"cat-select.js","sourceRoot":"","sources":["../../../src/components/cat-select/cat-select.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,EAAa,MAAM,kBAAkB,CAAC;AACxF,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACrH,OAAO,aAAa,MAAM,gBAAgB,CAAC;AAC3C,OAAO,GAAG,MAAM,UAAU,CAAC;AAC3B,OAAO,EACL,UAAU,EACV,QAAQ,EACR,oBAAoB,EACpB,MAAM,EACN,KAAK,EAEL,EAAE,EACF,IAAI,EACJ,SAAS,EACT,OAAO,EAEP,SAAS,EACT,SAAS,EACT,GAAG,EACH,KAAK,EACN,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,WAAW,EAAY,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,eAAe,IAAI,IAAI,EAAE,MAAM,+BAA+B,CAAC;AA4DxE,MAAM,UAAU,GAAmB;EACjC,IAAI,EAAE,EAAE;EACR,MAAM,EAAE,KAAK;EACb,SAAS,EAAE,KAAK;EAChB,WAAW,EAAE,KAAK;EAClB,OAAO,EAAE,EAAE;EACX,SAAS,EAAE,EAAE;EACb,aAAa,EAAE,EAAE;EACjB,iBAAiB,EAAE,CAAC,CAAC;EACrB,oBAAoB,EAAE,CAAC,CAAC;CACzB,CAAC;AAEF,IAAI,YAAY,GAAG,CAAC,CAAC;AACrB,IAAI,eAAe,GAAG,CAAC,CAAC;AAExB;;;;;;;;GAQG;AACH,MAKa,SAAS;;IAGH,QAAG,GAAG,aAAa,YAAY,EAAE,EAAE,CAAC;IAW7C,UAAK,GAAoB,IAAI,OAAO,EAAE,CAAC;IACvC,U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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA3gCuB,wBAAc,GAAG,CAAC,AAAJ,CAAK;AACnB,yBAAe,GAAG,CAAC,AAAJ,CAAK;SAFjC,SAAS","sourcesContent":["import { autoUpdate, computePosition, flip, offset, Placement } from '@floating-ui/dom';\nimport { Component, Element, Event, EventEmitter, h, Host, Listen, Method, Prop, State, Watch } from '@stencil/core';\nimport autosizeInput from 'autosize-input';\nimport log from 'loglevel';\nimport {\n catchError,\n debounce,\n distinctUntilChanged,\n filter,\n first,\n Observable,\n of,\n scan,\n startWith,\n Subject,\n Subscription,\n switchMap,\n takeWhile,\n tap,\n timer\n} from 'rxjs';\nimport { coerceBoolean, coerceNumber } from '../../utils/coerce';\nimport { CatFormHint, ErrorMap } from '../cat-form-hint/cat-form-hint';\nimport { catI18nRegistry as i18n } from '../cat-i18n/cat-i18n-registry';\n\nexport interface Item {\n id: string;\n}\n\nexport interface Page<T> {\n content: T[];\n last: boolean;\n totalElements?: number;\n}\n\nexport interface RenderInfo {\n label: string;\n description?: string;\n avatar?: {\n src?: string;\n round?: boolean;\n initials?: string;\n icon?: string;\n };\n}\n\n/**\n * @property customId - Change the ID of item for the given one.\n * @property resolve - Resolves the value of the select.\n * @property retrieve - Retrieves the options of the select.\n * @property render - Renders the items of the select.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface CatSelectConnector<T extends Item = any> {\n customId?: (item: T) => string;\n resolve: (ids: string[]) => Observable<T[]>;\n retrieve: (term: string, page: number) => Observable<Page<T>>;\n render: (item: T) => RenderInfo;\n}\n\nexport interface CatSelectState {\n term: string;\n isOpen: boolean;\n isLoading: boolean;\n isResolving: boolean;\n options: { item: Item; render: RenderInfo }[];\n tempSelection: { item: Item; render: RenderInfo }[];\n selection: { item: Item; render: RenderInfo }[];\n activeOptionIndex: number;\n activeSelectionIndex: number;\n totalElements?: number;\n}\n\nexport interface CatSelectMultipleTaggingValue {\n ids: string[];\n tags: string[];\n}\n\nexport interface CatSelectTaggingValue {\n id: string;\n tag: string;\n}\n\nconst INIT_STATE: CatSelectState = {\n term: '',\n isOpen: false,\n isLoading: false,\n isResolving: false,\n options: [],\n selection: [],\n tempSelection: [],\n activeOptionIndex: -1,\n activeSelectionIndex: -1\n};\n\nlet nextUniqueId = 0;\nlet nextTagUniqueId = 0;\n\n/**\n * Select lets user choose one option from an options' menu. Consider using\n * select when you have 6 or more options. Select component supports any content\n * type.\n *\n * @slot hint - Optional hint element to be displayed with the select.\n * @slot label - The slotted label. If both the label property and the label slot are present, only the label slot will be displayed.\n * @part label - The label content.\n */\n@Component({\n tag: 'cat-select',\n styleUrl: 'cat-select.scss',\n shadow: true\n})\nexport class CatSelect {\n private static readonly SKELETON_COUNT = 4;\n private static readonly DROPDOWN_OFFSET = 4;\n private readonly _id = `cat-input-${nextUniqueId++}`;\n private get id() {\n return this.identifier || this._id;\n }\n\n private dropdown?: HTMLElement;\n private trigger?: HTMLElement;\n private input?: HTMLInputElement;\n private errorMapSrc?: ErrorMap;\n\n private subscription?: Subscription;\n private term$: Subject<string> = new Subject();\n private more$: Subject<void> = new Subject();\n private valueChangedBySelection = false;\n\n @Element() hostElement!: HTMLElement;\n\n @State() connector?: CatSelectConnector;\n\n @State() state: CatSelectState = INIT_STATE;\n\n @State() hasSlottedLabel = false;\n\n @State() hasSlottedHint = false;\n\n @State() errorMap?: ErrorMap;\n\n /**\n * Whether the label need a marker to shown if the select is required or optional.\n */\n @Prop() requiredMarker: 'none' | 'required' | 'optional' | 'none!' | 'optional!' | 'required!' = 'optional';\n\n /**\n * Whether the label is on top or left.\n */\n @Prop() horizontal = false;\n\n /**\n * Enable multiple selection.\n */\n @Prop() multiple = false;\n\n /**\n * The debounce time for the search.\n */\n @Prop() debounce = 250;\n\n /**\n * The placement of the select.\n */\n @Prop() placement: Placement = 'bottom-start';\n\n /**\n * The value of the select. <br />\n * <br />\n * The value of the select depends on whether it is allowed to choose a single item or several items. <br />\n * When only one item can be selected, the value is the id of the item, in case several items can be selected, the value is an array of ids of the selected items. <br />\n * <br />\n * In case the user can add new items to the select (tags activated), the value in the single select is an object (CatSelectTaggingValue) with the id of the item or the name of the created item,\n * in the case of multiple select, it is an object (CatSelectMultipleTaggingValue) with the array of the ids of the items selected and the array of the names of the items created\n */\n @Prop({ mutable: true }) value?: string | string[] | CatSelectTaggingValue | CatSelectMultipleTaggingValue;\n\n /**\n * Whether the select is disabled.\n */\n @Prop() disabled = false;\n\n /**\n * The placeholder text to display within the select.\n */\n @Prop() placeholder?: string;\n\n /**\n * Optional hint text(s) to be displayed with the select.\n */\n @Prop() hint?: string | string[];\n\n /**\n * A unique identifier for the input.\n */\n @Prop() identifier?: string;\n\n /**\n * The label for the select.\n */\n @Prop() label = '';\n\n /**\n * The name of the form control. Submitted with the form as part of a name/value pair.\n */\n @Prop() name?: string;\n\n /**\n * Visually hide the label, but still show it to assistive technologies like screen readers.\n */\n @Prop() labelHidden = false;\n\n /**\n * A value is required or must be checked for the form to be submittable.\n */\n @Prop() required = false;\n\n /**\n * Whether the select should show a clear button.\n */\n @Prop() clearable = false;\n\n /**\n * Whether the select should add new items.\n */\n @Prop() tags = false;\n\n /**\n * Optional hint text to be displayed on the new item to be added.\n */\n @Prop() tagHint?: string;\n\n /**\n * The text to display in the dropdown if no results are found.\n */\n @Prop() noItems?: string;\n\n /**\n * The validation errors for this input. Will render a hint under the input\n * with the translated error message(s) `error.${key}`. If an object is\n * passed, the keys will be used as error keys and the values translation\n * parameters.\n * If the value is `true`, the input will be marked as invalid without any\n * hints under the input.\n */\n @Prop() errors?: boolean | string[] | ErrorMap;\n\n /**\n * Fine-grained control over when the errors are shown. Can be `false` to\n * never show errors, `true` to show errors on blur, or a number to show\n * errors on change with the given delay in milliseconds.\n */\n @Prop() errorUpdate: boolean | number = 0;\n\n /**\n * Attributes that will be added to the native HTML input element.\n */\n @Prop() nativeAttributes?: { [key: string]: string };\n\n @Watch('connector')\n onConnectorChanged(connector: CatSelectConnector) {\n this.reset(connector);\n this.resolve();\n }\n\n @Watch('value')\n onValueChanged() {\n !this.valueChangedBySelection ? this.resolve() : (this.valueChangedBySelection = false);\n }\n\n @Watch('errors')\n onErrorsChanged(value?: boolean | string[] | ErrorMap) {\n if (!coerceBoolean(this.errorUpdate)) {\n this.errorMap = undefined;\n } else {\n this.errorMapSrc = Array.isArray(value)\n ? (value as string[]).reduce((acc, err) => ({ ...acc, [err]: undefined }), {})\n : value === true\n ? {}\n : value || undefined;\n this.showErrorsIfTimeout() || this.showErrorsIfNoFocus();\n }\n }\n\n @Watch('state')\n onStateChanged(newState: CatSelectState, oldState: CatSelectState) {\n const changed = (key: keyof CatSelectState) => newState[key] !== oldState[key];\n if (changed('isOpen')) {\n this.update();\n }\n if (changed('activeOptionIndex') && this.state.activeOptionIndex >= 0) {\n this.dropdown\n ?.querySelector(`#select-${this.id}-option-${this.state.activeOptionIndex}`)\n ?.scrollIntoView({ block: 'nearest' });\n }\n\n if (changed('selection')) {\n let newValue;\n if (!this.multiple && this.state.selection.length) {\n this.hide();\n }\n const idsSelected = this.state.selection.map(item => item.item.id);\n if (!this.tags) {\n if (this.multiple) {\n newValue = idsSelected;\n } else {\n newValue = idsSelected.length ? idsSelected[0] : '';\n }\n } else {\n const ids = idsSelected.filter(id => !id.startsWith(`select-${this.id}-tag`));\n const tags = this.state.selection\n .filter(item => item.item.id.startsWith(`select-${this.id}-tag`))\n .map(item => item.render.label);\n if (this.multiple) {\n newValue = { ids, tags };\n } else {\n newValue = { id: ids.length ? ids[0] : '', tag: tags.length ? tags[0] : '' };\n }\n }\n\n if (!oldState.isResolving) {\n this.valueChangedBySelection = true;\n this.value = newValue;\n }\n this.catChange.emit();\n this.showErrorsIfTimeout();\n }\n }\n\n /**\n * Emitted when the select dropdown is opened.\n */\n @Event() catOpen!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the select dropdown is closed.\n */\n @Event() catClose!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the value is changed.\n */\n @Event() catChange!: EventEmitter<InputEvent>;\n\n /**\n * Emitted when the select loses the focus.\n */\n @Event() catBlur!: EventEmitter<FocusEvent>;\n\n componentDidLoad(): void {\n if (this.input) {\n autosizeInput(this.input);\n }\n if (this.trigger && this.dropdown) {\n autoUpdate(this.trigger, this.dropdown, () => this.update());\n }\n }\n\n componentWillRender(): void {\n this.onErrorsChanged(this.errors);\n this.hasSlottedLabel = !!this.hostElement.querySelector('[slot=\"label\"]');\n this.hasSlottedHint = !!this.hostElement.querySelector('[slot=\"hint\"]');\n if (!this.label && !this.hasSlottedLabel) {\n log.warn('[A11y] Missing ARIA label on select', this);\n }\n }\n\n @Listen('blur')\n onBlur(event: FocusEvent): void {\n if (!this.multiple && this.state.activeOptionIndex >= 0) {\n if (this.tags && this.state.options[this.state.activeOptionIndex].item.id === `select-${this.id}-option-tag`) {\n this.createTag(this.state.term);\n } else {\n this.select(this.state.options[this.state.activeOptionIndex]);\n }\n }\n this.hide();\n // Conditionally remove selection if the option was not manually selected through click or enter key press\n if (!this.multiple && (!this.tags || !this.state.selection?.length) && this.state.tempSelection?.length) {\n this.patchState({\n activeSelectionIndex: -1,\n selection: this.state.tempSelection,\n tempSelection: [],\n options: [],\n term: this.state.tempSelection[0].render.label\n });\n } else {\n this.patchState({ activeSelectionIndex: -1 });\n }\n\n this.catBlur.emit(event);\n if (coerceBoolean(this.errorUpdate)) {\n this.showErrors();\n }\n }\n\n @Listen('keydown')\n onKeyDown(event: KeyboardEvent): void {\n const isInputFocused = this.hostElement.shadowRoot?.activeElement === this.input;\n\n if (['ArrowDown', 'ArrowUp', 'ArrowLeft', 'ArrowRight'].includes(event.key)) {\n this.onArrowKeyDown(event);\n } else if (['Enter', ' '].includes(event.key) && isInputFocused) {\n if (\n this.tags &&\n this.state.activeOptionIndex === 0 &&\n this.state.options[0].item.id === `select-${this.id}-option-tag`\n ) {\n event.preventDefault();\n if (this.multiple) {\n this.toggleTag(this.state.options[0]);\n } else {\n this.createTag(this.state.options[0].render.label);\n }\n } else if (this.state.activeOptionIndex >= 0) {\n event.preventDefault();\n if (this.multiple) {\n this.toggle(this.state.options[this.state.activeOptionIndex]);\n } else {\n this.select(this.state.options[this.state.activeOptionIndex]);\n }\n } else if (this.tags && event.key === 'Enter' && this.state.activeOptionIndex < 0) {\n this.createTag(this.state.term);\n }\n } else if (event.key === 'Escape') {\n this.hide();\n } else if (event.key === 'Backspace' || event.key === 'Delete') {\n this.input?.focus();\n if (!this.multiple || !this.state.term || (this.input?.selectionStart === 0 && event.key === 'Backspace')) {\n if (this.state.activeSelectionIndex >= 0) {\n this.deselect(this.state.selection[this.state.activeSelectionIndex].item.id);\n } else if (this.state.selection.length) {\n const selectionClone = [...this.state.selection];\n selectionClone.pop();\n this.patchState({\n selection: selectionClone,\n tempSelection: this.state.term ? [...this.state.selection] : []\n });\n }\n }\n } else if (event.key === 'Tab') {\n this.trigger?.setAttribute('tabindex', '-1');\n if (this.multiple) {\n this.patchState({ activeSelectionIndex: -1, activeOptionIndex: -1 });\n } else if (this.state.activeOptionIndex >= 0) {\n if (this.tags && this.state.options[this.state.activeOptionIndex].item.id === `select-${this.id}-option-tag`) {\n this.createTag(this.state.term);\n } else {\n this.select(this.state.options[this.state.activeOptionIndex]);\n }\n }\n } else if (event.key.length === 1) {\n this.input?.focus();\n }\n }\n\n @Listen('keyup')\n onKeyUp(event: KeyboardEvent): void {\n if (event.key === 'Tab' && !event.shiftKey) {\n this.hostElement.shadowRoot?.activeElement === this.trigger && this.input?.focus();\n if (this.hostElement.shadowRoot?.activeElement === this.input) {\n this.show();\n }\n } else if (event.key === 'Tab' && event.shiftKey) {\n const clearButton = this.trigger?.querySelector(`#select-clear-btn-${this.id}`);\n\n if (clearButton) {\n this.hostElement.shadowRoot?.activeElement === clearButton && this.show();\n } else {\n this.show();\n }\n }\n }\n\n /**\n * Connect the functions of the select\n *\n * @param connector - The {@link CatSelectConnector} of the select.\n */\n @Method()\n async connect(connector: CatSelectConnector): Promise<void> {\n this.connector = connector;\n let number$: Observable<number>;\n this.subscription?.unsubscribe();\n this.subscription = this.term$\n .asObservable()\n .pipe(\n debounce(term => (term ? timer(this.debounce) : of(0))),\n distinctUntilChanged(),\n tap(\n () =>\n (number$ = this.more$.pipe(\n filter(() => !this.state.isLoading),\n scan(n => n + 1, 0),\n startWith(0)\n ))\n ),\n tap(() => this.patchState({ options: [] })),\n switchMap(term =>\n number$.pipe(\n tap(() => this.patchState({ isLoading: true })),\n switchMap(number => connector.retrieve(term, number)),\n tap(page => this.patchState({ isLoading: false, totalElements: page.totalElements })),\n takeWhile(page => !page.last, true),\n scan((items, page) => [...items, ...page.content], [] as Item[])\n )\n )\n )\n .subscribe(items => {\n const options = this.toSelectItems(connector, items);\n\n if (\n this.tags &&\n this.state.term.trim().length &&\n !options.find(value1 => value1.render.label.toLowerCase() === this.state.term.toLowerCase())\n ) {\n let label;\n if (this.isTagSelected(this.state.term)) {\n label = this.state.selection.find(item => item.render.label.toLowerCase() === this.state.term.toLowerCase())\n ?.render.label;\n }\n options.unshift({\n item: { id: `select-${this.id}-option-tag` },\n render: { label: label ? label : this.state.term }\n });\n }\n this.patchState({\n options\n });\n });\n }\n\n render() {\n return (\n <Host>\n <div\n class={{\n 'select-field': true,\n 'select-horizontal': this.horizontal\n }}\n >\n <div class=\"label-container\">\n {(this.hasSlottedLabel || this.label) && (\n <label htmlFor={this.id} class={{ hidden: this.labelHidden }}>\n <span class=\"label-wrapper\" part=\"label\">\n {(this.hasSlottedLabel && <slot name=\"label\"></slot>) || this.label}\n <div class=\"label-metadata\">\n {!this.required && this.requiredMarker.startsWith('optional') && (\n <span class=\"label-optional\" aria-hidden=\"true\">\n ({i18n.t('input.optional')})\n </span>\n )}\n {this.required && this.requiredMarker.startsWith('required') && (\n <span class=\"label-optional\" aria-hidden=\"true\">\n ({i18n.t('input.required')})\n </span>\n )}\n </div>\n </span>\n </label>\n )}\n </div>\n\n <div class=\"select-container\">\n <div\n class={{ 'select-wrapper': true, 'select-disabled': this.disabled, 'select-invalid': this.invalid }}\n ref={el => (this.trigger = el)}\n id={this.id}\n role=\"combobox\"\n aria-expanded={this.state.isOpen || this.isPillboxActive()}\n aria-controls={this.isPillboxActive() ? `select-pillbox-${this.id}` : `select-listbox-${this.id}`}\n aria-required={this.required ? 'true' : false}\n aria-activedescendant={this.activeDescendant}\n onClick={e => this.onClick(e)}\n >\n <div class=\"select-wrapper-inner\">\n {this.multiple && this.state.selection.length ? (\n <div\n id={`select-pillbox-${this.id}`}\n role=\"listbox\"\n aria-orientation=\"horizontal\"\n class=\"select-pills\"\n >\n {this.state.selection.map((item, i) => (\n <span\n class={{\n pill: true,\n 'select-no-open': true,\n 'select-option-active': this.state.activeSelectionIndex === i\n }}\n role=\"option\"\n aria-selected=\"true\"\n id={`select-${this.id}-selection-${i}`}\n >\n {item.render.avatar ? (\n <cat-avatar\n label={item.render.label}\n round={item.render.avatar.round}\n src={item.render.avatar.src}\n icon={item.render.avatar.icon}\n initials={item.render.avatar.initials ?? ''}\n ></cat-avatar>\n ) : null}\n <span>{item.render.label}</span>\n {!this.disabled && (\n <cat-button\n size=\"xs\"\n variant=\"text\"\n icon=\"$cat:select-clear\"\n iconOnly\n a11yLabel={i18n.t('select.deselect')}\n onClick={() => this.deselect(item.item.id)}\n tabIndex={-1}\n onCatClick={event => event.stopPropagation()}\n ></cat-button>\n )}\n </span>\n ))}\n </div>\n ) : this.state.selection.length && this.state.selection[0].render.avatar ? (\n <cat-avatar\n label={this.state.selection[0].render.label}\n round={this.state.selection[0].render.avatar.round}\n src={this.state.selection[0].render.avatar.src}\n icon={this.state.selection[0].render.avatar.icon}\n initials={this.state.selection[0].render.avatar.initials ?? ''}\n ></cat-avatar>\n ) : null}\n <input\n {...this.nativeAttributes}\n class=\"select-input\"\n ref={el => (this.input = el)}\n aria-controls={this.isPillboxActive() ? `select-pillbox-${this.id}` : `select-listbox-${this.id}`}\n aria-activedescendant={this.activeDescendant}\n aria-invalid={this.invalid ? 'true' : undefined}\n aria-describedby={this.hint?.length ? this.id + '-hint' : undefined}\n onInput={this.onInput.bind(this)}\n value={!this.multiple ? this.state.term : undefined}\n placeholder={this.placeholder}\n disabled={this.disabled || this.state.isResolving}\n ></input>\n </div>\n {this.state.isResolving && <cat-spinner></cat-spinner>}\n {this.invalid && (\n <cat-icon icon=\"$cat:input-error\" class=\"icon-suffix cat-text-danger\" size=\"l\"></cat-icon>\n )}\n {(this.state.selection.length || this.state.term.length) &&\n !this.disabled &&\n !this.state.isResolving &&\n this.clearable ? (\n <cat-button\n id={`select-clear-btn-${this.id}`}\n iconOnly\n icon=\"$cat:input-close\"\n variant=\"text\"\n size=\"s\"\n a11yLabel={i18n.t('input.clear')}\n onCatClick={event => {\n event.stopPropagation();\n this.clear();\n }}\n ></cat-button>\n ) : null}\n {!this.state.isResolving && (\n <cat-button\n iconOnly\n icon=\"$cat:select-open\"\n class={{ 'select-btn': true, 'select-btn-open': this.state.isOpen }}\n variant=\"text\"\n size=\"s\"\n a11yLabel={this.state.isOpen ? i18n.t('select.close') : i18n.t('select.open')}\n aria-controls={`select-listbox-${this.id}`}\n aria-expanded={this.state.isOpen}\n tabIndex={-1}\n disabled={this.disabled || this.state.isResolving}\n onCatClick={event => event.stopPropagation()}\n ></cat-button>\n )}\n </div>\n {(this.hint || this.hasSlottedHint || !!Object.keys(this.errorMap || {}).length) && (\n <CatFormHint\n id={this.id}\n hint={this.hint}\n slottedHint={this.hasSlottedHint && <slot name=\"hint\"></slot>}\n errorMap={this.errorMap}\n />\n )}\n </div>\n </div>\n\n <div\n class=\"select-dropdown\"\n ref={el => (this.dropdown = el)}\n style={{ display: this.state.isOpen ? 'block' : undefined }}\n >\n {this.state.isOpen && (\n <cat-scrollable\n class=\"select-options-wrapper\"\n scrolledBuffer={56}\n noOverflowX\n noOverscroll\n noScrolledInit\n onScrolledBottom={() => this.more$.next()}\n >\n <ul\n class=\"select-options\"\n role=\"listbox\"\n aria-multiselectable={this.multiple}\n aria-setsize={this.state.totalElements}\n id={`select-listbox-${this.id}`}\n >\n {this.optionsList}\n {this.state.isLoading\n ? Array.from(Array(CatSelect.SKELETON_COUNT)).map(() => (\n <li class=\"select-option-loading\">\n <cat-skeleton variant=\"body\" lines={1}></cat-skeleton>\n <cat-skeleton variant=\"body\" lines={1}></cat-skeleton>\n </li>\n ))\n : !this.state.options.length &&\n !this.tags && (\n <li class=\"select-option-empty\">{this.noItems ? this.noItems : i18n.t('select.empty')}</li>\n )}\n </ul>\n </cat-scrollable>\n )}\n </div>\n </Host>\n );\n }\n\n private get invalid() {\n return !!this.errorMap;\n }\n\n private get optionsList() {\n return this.state.options.map((item, i) => {\n const isTagOption = this.tags && item.item.id === `select-${this.id}-option-tag`;\n\n const isOptionSelected = this.isSelected(item.item.id) || (this.tags && this.isTagSelected(item.render.label));\n\n const getLabel = () => {\n if (isTagOption) {\n return item.render.label + this.tagTextHelp;\n }\n return item.render.label;\n };\n\n return (\n <li\n role=\"option\"\n class=\"select-option\"\n id={`select-${this.id}-option-${i}`}\n aria-selected={isOptionSelected ? 'true' : 'false'}\n >\n {this.multiple ? (\n <cat-checkbox\n class={{ 'select-option-active': this.state.activeOptionIndex === i }}\n checked={isOptionSelected}\n tabIndex={-1}\n labelLeft\n onFocus={() => this.input?.focus()}\n onCatChange={e => {\n !isTagOption ? this.toggle(item) : this.toggleTag(item);\n e.stopPropagation();\n }}\n >\n <span slot=\"label\" class=\"select-option-inner\">\n {item.render.avatar ? (\n <cat-avatar\n label={item.render.label}\n round={item.render.avatar.round}\n src={item.render.avatar.src}\n icon={item.render.avatar.icon}\n initials={item.render.avatar.initials ?? ''}\n ></cat-avatar>\n ) : null}\n <span class=\"select-option-text\">\n <span class=\"select-option-label\">{getLabel()}</span>\n <span class=\"select-option-description\">{item.render.description}</span>\n </span>\n </span>\n </cat-checkbox>\n ) : (\n <div\n class={{\n 'select-option-inner': true,\n 'select-option-single': true,\n 'select-option-active': this.state.activeOptionIndex === i\n }}\n onFocus={() => this.input?.focus()}\n onClick={() => (isTagOption ? this.createTag(item.render.label) : this.select(item))}\n tabIndex={-1}\n >\n {item.render.avatar ? (\n <cat-avatar\n label={item.render.label}\n round={item.render.avatar.round}\n src={item.render.avatar.src}\n icon={item.render.avatar.icon}\n initials={item.render.avatar.initials ?? ''}\n ></cat-avatar>\n ) : null}\n <span class=\"select-option-text\">\n <span class=\"select-option-label\">{getLabel()}</span>\n <span class=\"select-option-description\">{item.render.description}</span>\n </span>\n </div>\n )}\n </li>\n );\n });\n }\n\n private resolve() {\n const connector = this.connector;\n if (!connector) {\n return;\n }\n this.patchState({ isResolving: true });\n\n const ids = this.initIds();\n let tags: string[];\n\n if (this.tags) {\n tags = this.initTags();\n }\n\n const data$ = ids.length ? connector.resolve(ids).pipe(first()) : of([]);\n data$.pipe(catchError(() => of([]))).subscribe(items => {\n const selection = this.toSelectItems(connector, items);\n if (this.tags) {\n tags\n .filter(tag => !this.isTagSelected(tag, selection))\n .forEach((tag, index) => {\n const item = { id: `select-${this.id}-tag-${index}`, name: tag };\n selection.push({ item, render: { label: item.name } });\n });\n }\n this.patchState({\n isResolving: false,\n selection,\n term: !this.multiple && selection.length ? selection[0].render.label : ''\n });\n });\n }\n\n private toSelectItems(connector: CatSelectConnector, items: Item[]) {\n return items.map(item => ({\n item: { ...item, id: connector.customId ? connector.customId(item) : item.id },\n render: connector.render(item)\n }));\n }\n\n private show() {\n if (!this.state.isOpen) {\n this.patchState({ isOpen: true });\n this.catOpen.emit();\n this.term$.next('');\n this.input?.classList.remove('select-input-transparent-caret');\n }\n }\n\n private hide() {\n if (this.state.isOpen) {\n this.patchState({ isOpen: false, activeOptionIndex: -1 });\n this.catClose.emit();\n }\n }\n\n private search(term: string) {\n this.patchState({ term, activeOptionIndex: -1, activeSelectionIndex: -1 });\n this.term$.next(term);\n }\n\n private isSelected(id: string) {\n return this.state.selection.findIndex(s => s.item.id === id) >= 0;\n }\n\n private select(item: { item: Item; render: RenderInfo }) {\n if (!this.isSelected(item.item.id)) {\n let newSelection;\n if (this.multiple) {\n newSelection = [...this.state.selection, item];\n } else {\n newSelection = [item];\n this.search(item.render.label);\n }\n this.patchState({ selection: newSelection });\n\n if (this.multiple && this.state.term.trim() && this.input) {\n this.patchState({ term: '', activeOptionIndex: -1 });\n this.term$.next('');\n this.input.value = '';\n }\n }\n this.setTransparentCaret();\n }\n\n private deselect(id: string) {\n if (this.isSelected(id)) {\n this.patchState({\n selection: this.state.selection.filter(item => item.item.id !== id),\n activeSelectionIndex: -1\n });\n }\n }\n\n private toggle(item: { item: Item; render: RenderInfo }) {\n this.isSelected(item.item.id)\n ? this.deselect(item.item.id)\n : this.tags && this.isTagSelected(item.render.label)\n ? this.removeTag(item.render.label)\n : this.select(item);\n }\n\n private clear() {\n if (this.input && this.state.term) {\n this.patchState({ selection: [], options: [], term: '', activeOptionIndex: -1, tempSelection: [] });\n this.term$.next('');\n this.input.value = '';\n } else {\n this.patchState({ selection: [], tempSelection: [] });\n }\n }\n\n private reset(connector?: CatSelectConnector) {\n this.connector = connector ?? this.connector;\n this.subscription?.unsubscribe();\n this.subscription = undefined;\n this.state = INIT_STATE;\n }\n\n private onClick(event: MouseEvent) {\n if (this.disabled) {\n return;\n }\n const elem = event.target as Element;\n this.trigger?.setAttribute('tabindex', '0');\n this.input?.focus();\n if (\n elem === this.trigger ||\n elem === this.input ||\n elem.classList.contains('select-btn') ||\n elem.nodeName === 'SPAN'\n ) {\n this.state.isOpen ? this.hide() : this.show();\n }\n }\n\n private onInput() {\n this.search(this.input?.value.trim() || '');\n if (!this.multiple) {\n if (this.state.selection.length) {\n const selectionClone = [...this.state.selection];\n selectionClone.pop();\n this.patchState({ selection: selectionClone, tempSelection: [...this.state.selection] });\n }\n\n if (!this.input?.value.trim()) {\n this.patchState({ tempSelection: [] });\n }\n }\n this.show();\n }\n\n private update() {\n if (this.trigger && this.dropdown) {\n computePosition(this.trigger, this.dropdown, {\n strategy: 'fixed',\n placement: this.placement,\n middleware: [offset(CatSelect.DROPDOWN_OFFSET), flip()]\n }).then(({ x, y, placement }) => {\n if (this.dropdown) {\n this.dropdown.dataset.placement = placement;\n Object.assign(this.dropdown.style, {\n width: `${this.trigger?.clientWidth}px`,\n left: `${x}px`,\n top: `${y}px`\n });\n }\n });\n }\n }\n\n private patchState(update: Partial<CatSelectState>) {\n this.state = { ...this.state, ...update };\n }\n\n private isPillboxActive() {\n return this.state.activeSelectionIndex >= 0;\n }\n\n private get activeDescendant() {\n let activeDescendant = undefined;\n if (this.state.activeOptionIndex >= 0) {\n activeDescendant = `select-${this.id}-option-${this.state.activeOptionIndex}`;\n } else if (this.state.activeSelectionIndex >= 0) {\n activeDescendant = `select-${this.id}-selection-${this.state.activeSelectionIndex}`;\n }\n return activeDescendant;\n }\n\n private onArrowKeyDown(event: KeyboardEvent) {\n let preventDefault = false;\n this.input?.focus();\n\n switch (event.key) {\n case 'ArrowDown':\n preventDefault = true;\n this.state.isOpen\n ? this.patchState({\n activeOptionIndex: Math.min(this.state.activeOptionIndex + 1, this.state.options.length - 1),\n activeSelectionIndex: -1\n })\n : this.show();\n break;\n case 'ArrowUp':\n preventDefault = true;\n this.state.activeOptionIndex >= 0\n ? this.patchState({\n activeOptionIndex: Math.max(this.state.activeOptionIndex - 1, -1),\n activeSelectionIndex: -1\n })\n : this.hide();\n break;\n case 'ArrowLeft':\n if (this.input?.selectionStart === 0) {\n preventDefault = true;\n let index;\n this.state.activeSelectionIndex > 0\n ? (index = Math.max(this.state.activeSelectionIndex - 1, -1))\n : (index = this.state.selection.length - 1);\n this.patchState({ activeSelectionIndex: index, activeOptionIndex: -1 });\n }\n break;\n case 'ArrowRight':\n if (this.state.activeSelectionIndex >= 0) {\n preventDefault = true;\n let index = -1;\n if (this.state.activeSelectionIndex < this.state.selection.length - 1) {\n index = Math.min(this.state.activeSelectionIndex + 1, this.state.selection.length - 1);\n } else if (!this.state.term) {\n index = 0;\n }\n this.patchState({ activeSelectionIndex: index, activeOptionIndex: -1 });\n }\n }\n\n if (preventDefault) {\n event.preventDefault();\n event.stopPropagation();\n }\n }\n\n private get tagTextHelp() {\n return this.tagHint && !this.isTagSelected(this.state.term) ? ' (' + this.tagHint + ')' : '';\n }\n\n private isTagSelected(term: string, selection: { item: Item; render: RenderInfo }[] = this.state.selection) {\n return selection.findIndex(item => item.render.label.toLowerCase() === term.toLowerCase()) >= 0;\n }\n\n private createTag(term: string) {\n if (term.trim().length && !this.isTagSelected(term)) {\n const value = this.value as CatSelectMultipleTaggingValue;\n const tags = value?.tags;\n const tag = { id: `select-${this.id}-tag-${tags?.length ? tags?.length + nextTagUniqueId++ : 0}`, name: term };\n this.select({ item: tag, render: { label: tag.name } });\n }\n this.setTransparentCaret();\n }\n\n private removeTag(label: string) {\n if (this.isTagSelected(label)) {\n const item = this.state.selection.find(item => item.render.label.toLowerCase() === label.toLowerCase());\n item && this.deselect(item.item.id);\n }\n }\n\n private toggleTag(item: { item: Item; render: RenderInfo }) {\n this.isTagSelected(item.render.label) ? this.removeTag(item.render.label) : this.createTag(item.render.label);\n }\n\n private initIds() {\n let ids: string[] = [];\n if (this.value) {\n if (!this.tags) {\n if (this.multiple) {\n ids = this.value as string[];\n } else {\n ids = [this.value as string];\n }\n } else {\n if (this.multiple) {\n const value = this.value as CatSelectMultipleTaggingValue;\n ids = value.ids ? value.ids : [];\n } else {\n const value = this.value as CatSelectTaggingValue;\n ids = value.id ? [value.id] : [];\n }\n }\n }\n return ids;\n }\n\n private initTags() {\n let tags: string[] = [];\n if (this.value) {\n if (this.multiple) {\n const value = this.value as CatSelectMultipleTaggingValue;\n tags = value.tags ? value.tags : [];\n } else {\n const value = this.value as CatSelectTaggingValue;\n tags = value.tag ? [value.tag] : [];\n }\n }\n return tags;\n }\n\n private setTransparentCaret() {\n if (!this.multiple) {\n this.hide();\n this.input?.classList.add('select-input-transparent-caret');\n }\n }\n\n private showErrors() {\n this.errorMap = this.errorMapSrc;\n }\n\n private errorUpdateTimeoutId?: number;\n private showErrorsIfTimeout() {\n const errorUpdate = coerceNumber(this.errorUpdate, null);\n if (errorUpdate !== null) {\n typeof this.errorUpdateTimeoutId === 'number' && window.clearTimeout(this.errorUpdateTimeoutId);\n this.errorUpdateTimeoutId = window.setTimeout(() => this.showErrors(), errorUpdate);\n return true;\n }\n return false;\n }\n\n private showErrorsIfNoFocus() {\n const hasFocus = document.activeElement === this.hostElement || document.activeElement === this.input;\n if (!hasFocus) {\n this.showErrors();\n }\n }\n}\n"]}