@kodaris/krubble-components 1.0.39 → 1.0.41

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.
@@ -89,7 +89,7 @@ const e$4=(e,t,c)=>(c.configurable=true,c.enumerable=true,Reflect.decorate&&"obj
89
89
  * SPDX-License-Identifier: BSD-3-Clause
90
90
  */function e$3(e,r){return (n,s,i)=>{const o=t=>t.renderRoot?.querySelector(e)??null;return e$4(n,s,{get(){return o(this)}})}}
91
91
 
92
- var __decorate$g = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
92
+ var __decorate$h = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
93
93
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
94
94
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
95
95
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
@@ -196,13 +196,13 @@ KRAccordion.styles = i$5 `
196
196
  padding: 16px 16px 8px 16px;
197
197
  }
198
198
  `;
199
- __decorate$g([
199
+ __decorate$h([
200
200
  n$1({ type: String })
201
201
  ], KRAccordion.prototype, "header", void 0);
202
- __decorate$g([
202
+ __decorate$h([
203
203
  n$1({ type: Boolean, reflect: true })
204
204
  ], KRAccordion.prototype, "expanded", void 0);
205
- KRAccordion = __decorate$g([
205
+ KRAccordion = __decorate$h([
206
206
  t$1('kr-accordion')
207
207
  ], KRAccordion);
208
208
 
@@ -219,7 +219,7 @@ const t={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4},e$2=t=>(...e)=>({_$
219
219
  * SPDX-License-Identifier: BSD-3-Clause
220
220
  */const e$1=e$2(class extends i$1{constructor(t$1){if(super(t$1),t$1.type!==t.ATTRIBUTE||"class"!==t$1.name||t$1.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return " "+Object.keys(t).filter(s=>t[s]).join(" ")+" "}update(s,[i]){if(void 0===this.st){this.st=new Set,void 0!==s.strings&&(this.nt=new Set(s.strings.join(" ").split(/\s/).filter(t=>""!==t)));for(const t in i)i[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(i)}const r=s.element.classList;for(const t of this.st)t in i||(r.remove(t),this.st.delete(t));for(const t in i){const s=!!i[t];s===this.st.has(t)||this.nt?.has(t)||(s?(r.add(t),this.st.add(t)):(r.remove(t),this.st.delete(t)));}return E}});
221
221
 
222
- var __decorate$f = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
222
+ var __decorate$g = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
223
223
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
224
224
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
225
225
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
@@ -417,23 +417,23 @@ KRAlert.styles = i$5 `
417
417
  outline-offset: 2px;
418
418
  }
419
419
  `;
420
- __decorate$f([
420
+ __decorate$g([
421
421
  n$1({ type: String })
422
422
  ], KRAlert.prototype, "type", void 0);
423
- __decorate$f([
423
+ __decorate$g([
424
424
  n$1({ type: String })
425
425
  ], KRAlert.prototype, "title", void 0);
426
- __decorate$f([
426
+ __decorate$g([
427
427
  n$1({ type: Boolean })
428
428
  ], KRAlert.prototype, "dismissible", void 0);
429
- __decorate$f([
429
+ __decorate$g([
430
430
  n$1({ type: Boolean })
431
431
  ], KRAlert.prototype, "visible", void 0);
432
- KRAlert = __decorate$f([
432
+ KRAlert = __decorate$g([
433
433
  t$1('kr-alert')
434
434
  ], KRAlert);
435
435
 
436
- var __decorate$e = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
436
+ var __decorate$f = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
437
437
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
438
438
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
439
439
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
@@ -892,40 +892,40 @@ KRButton.styles = i$5 `
892
892
  height: 22px;
893
893
  }
894
894
  `;
895
- __decorate$e([
895
+ __decorate$f([
896
896
  n$1({ type: String, reflect: true })
897
897
  ], KRButton.prototype, "variant", void 0);
898
- __decorate$e([
898
+ __decorate$f([
899
899
  n$1({ type: String, reflect: true })
900
900
  ], KRButton.prototype, "color", void 0);
901
- __decorate$e([
901
+ __decorate$f([
902
902
  n$1({ type: String, reflect: true })
903
903
  ], KRButton.prototype, "size", void 0);
904
- __decorate$e([
904
+ __decorate$f([
905
905
  n$1({ type: Boolean, reflect: true })
906
906
  ], KRButton.prototype, "disabled", void 0);
907
- __decorate$e([
907
+ __decorate$f([
908
908
  n$1({ type: String })
909
909
  ], KRButton.prototype, "href", void 0);
910
- __decorate$e([
910
+ __decorate$f([
911
911
  n$1({ type: String })
912
912
  ], KRButton.prototype, "target", void 0);
913
- __decorate$e([
913
+ __decorate$f([
914
914
  n$1({ type: Array })
915
915
  ], KRButton.prototype, "options", void 0);
916
- __decorate$e([
916
+ __decorate$f([
917
917
  n$1({ type: String, reflect: true, attribute: 'icon-position' })
918
918
  ], KRButton.prototype, "iconPosition", void 0);
919
- __decorate$e([
919
+ __decorate$f([
920
920
  r$1()
921
921
  ], KRButton.prototype, "_state", void 0);
922
- __decorate$e([
922
+ __decorate$f([
923
923
  r$1()
924
924
  ], KRButton.prototype, "_stateText", void 0);
925
- __decorate$e([
925
+ __decorate$f([
926
926
  r$1()
927
927
  ], KRButton.prototype, "_dropdownOpened", void 0);
928
- KRButton = __decorate$e([
928
+ KRButton = __decorate$f([
929
929
  t$1('kr-button')
930
930
  ], KRButton);
931
931
 
@@ -935,7 +935,7 @@ KRButton = __decorate$e([
935
935
  * SPDX-License-Identifier: BSD-3-Clause
936
936
  */class e extends i$1{constructor(i){if(super(i),this.it=A,i.type!==t.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(r){if(r===A||null==r)return this._t=void 0,this.it=r;if(r===E)return r;if("string"!=typeof r)throw Error(this.constructor.directiveName+"() called with a non-string value");if(r===this.it)return this._t;this.it=r;const s=[r];return s.raw=s,this._t={_$litType$:this.constructor.resultType,strings:s,values:[]}}}e.directiveName="unsafeHTML",e.resultType=1;const o$2=e$2(e);
937
937
 
938
- var __decorate$d = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
938
+ var __decorate$e = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
939
939
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
940
940
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
941
941
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
@@ -1169,26 +1169,26 @@ KRCodeDemo.styles = [krBaseCSS, i$5 `
1169
1169
  .hljs-property { color: #005cc5; }
1170
1170
 
1171
1171
  `];
1172
- __decorate$d([
1172
+ __decorate$e([
1173
1173
  n$1({ type: String })
1174
1174
  ], KRCodeDemo.prototype, "language", void 0);
1175
- __decorate$d([
1175
+ __decorate$e([
1176
1176
  r$1()
1177
1177
  ], KRCodeDemo.prototype, "code", void 0);
1178
- __decorate$d([
1178
+ __decorate$e([
1179
1179
  r$1()
1180
1180
  ], KRCodeDemo.prototype, "activeTab", void 0);
1181
- __decorate$d([
1181
+ __decorate$e([
1182
1182
  r$1()
1183
1183
  ], KRCodeDemo.prototype, "copied", void 0);
1184
- __decorate$d([
1184
+ __decorate$e([
1185
1185
  r$1()
1186
1186
  ], KRCodeDemo.prototype, "highlightedCode", void 0);
1187
- KRCodeDemo = __decorate$d([
1187
+ KRCodeDemo = __decorate$e([
1188
1188
  t$1('kr-code-demo')
1189
1189
  ], KRCodeDemo);
1190
1190
 
1191
- var __decorate$c = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
1191
+ var __decorate$d = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
1192
1192
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1193
1193
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
1194
1194
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
@@ -1357,10 +1357,10 @@ KRContextMenu.styles = i$5 `
1357
1357
  margin: 4px 0;
1358
1358
  }
1359
1359
  `;
1360
- __decorate$c([
1360
+ __decorate$d([
1361
1361
  r$1()
1362
1362
  ], KRContextMenu.prototype, "items", void 0);
1363
- KRContextMenu = __decorate$c([
1363
+ KRContextMenu = __decorate$d([
1364
1364
  t$1('kr-context-menu')
1365
1365
  ], KRContextMenu);
1366
1366
 
@@ -1370,7 +1370,7 @@ KRContextMenu = __decorate$c([
1370
1370
  * SPDX-License-Identifier: BSD-3-Clause
1371
1371
  */const n="important",i=" !"+n,o$1=e$2(class extends i$1{constructor(t$1){if(super(t$1),t$1.type!==t.ATTRIBUTE||"style"!==t$1.name||t$1.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce((e,r)=>{const s=t[r];return null==s?e:e+`${r=r.includes("-")?r:r.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${s};`},"")}update(e,[r]){const{style:s}=e.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(r)),this.render(r);for(const t of this.ft)null==r[t]&&(this.ft.delete(t),t.includes("-")?s.removeProperty(t):s[t]=null);for(const t in r){const e=r[t];if(null!=e){this.ft.add(t);const r="string"==typeof e&&e.endsWith(i);t.includes("-")||r?s.setProperty(t,r?e.slice(0,-11):e,r?n:""):s[t]=e;}}return E}});
1372
1372
 
1373
- var __decorate$b = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
1373
+ var __decorate$c = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
1374
1374
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1375
1375
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
1376
1376
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
@@ -1397,7 +1397,7 @@ KRDialogHeader.styles = i$5 `
1397
1397
  font-weight: 600;
1398
1398
  }
1399
1399
  `;
1400
- KRDialogHeader = __decorate$b([
1400
+ KRDialogHeader = __decorate$c([
1401
1401
  t$1('kr-dialog-header')
1402
1402
  ], KRDialogHeader);
1403
1403
  let KRDialogContent = class KRDialogContent extends i$2 {
@@ -1413,7 +1413,7 @@ KRDialogContent.styles = i$5 `
1413
1413
  flex: 1 1 auto;
1414
1414
  }
1415
1415
  `;
1416
- KRDialogContent = __decorate$b([
1416
+ KRDialogContent = __decorate$c([
1417
1417
  t$1('kr-dialog-content')
1418
1418
  ], KRDialogContent);
1419
1419
  let KRDialogFooter = class KRDialogFooter extends i$2 {
@@ -1433,7 +1433,7 @@ KRDialogFooter.styles = i$5 `
1433
1433
  justify-content: flex-end;
1434
1434
  }
1435
1435
  `;
1436
- KRDialogFooter = __decorate$b([
1436
+ KRDialogFooter = __decorate$c([
1437
1437
  t$1('kr-dialog-footer')
1438
1438
  ], KRDialogFooter);
1439
1439
  /**
@@ -1641,23 +1641,23 @@ KRDialog.styles = i$5 `
1641
1641
  font-weight: 600;
1642
1642
  }
1643
1643
  `;
1644
- __decorate$b([
1644
+ __decorate$c([
1645
1645
  r$1()
1646
1646
  ], KRDialog.prototype, "_contentElement", void 0);
1647
- __decorate$b([
1647
+ __decorate$c([
1648
1648
  n$1({ type: Boolean, reflect: true })
1649
1649
  ], KRDialog.prototype, "opened", void 0);
1650
- __decorate$b([
1650
+ __decorate$c([
1651
1651
  n$1({ type: String })
1652
1652
  ], KRDialog.prototype, "label", void 0);
1653
- __decorate$b([
1653
+ __decorate$c([
1654
1654
  n$1({ type: String })
1655
1655
  ], KRDialog.prototype, "width", void 0);
1656
- KRDialog = __decorate$b([
1656
+ KRDialog = __decorate$c([
1657
1657
  t$1('kr-dialog')
1658
1658
  ], KRDialog);
1659
1659
 
1660
- var __decorate$a = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
1660
+ var __decorate$b = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
1661
1661
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1662
1662
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
1663
1663
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
@@ -1959,23 +1959,23 @@ KRSnackbar.styles = i$5 `
1959
1959
  `;
1960
1960
  /** Track active snackbars for stacking */
1961
1961
  KRSnackbar.activeSnackbars = [];
1962
- __decorate$a([
1962
+ __decorate$b([
1963
1963
  n$1({ type: String })
1964
1964
  ], KRSnackbar.prototype, "type", void 0);
1965
- __decorate$a([
1965
+ __decorate$b([
1966
1966
  n$1({ type: String })
1967
1967
  ], KRSnackbar.prototype, "title", void 0);
1968
- __decorate$a([
1968
+ __decorate$b([
1969
1969
  n$1({ type: String })
1970
1970
  ], KRSnackbar.prototype, "message", void 0);
1971
- __decorate$a([
1971
+ __decorate$b([
1972
1972
  n$1({ type: Number })
1973
1973
  ], KRSnackbar.prototype, "duration", void 0);
1974
- KRSnackbar = KRSnackbar_1 = __decorate$a([
1974
+ KRSnackbar = KRSnackbar_1 = __decorate$b([
1975
1975
  t$1('kr-snackbar')
1976
1976
  ], KRSnackbar);
1977
1977
 
1978
- var __decorate$9 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
1978
+ var __decorate$a = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
1979
1979
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1980
1980
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
1981
1981
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
@@ -2278,20 +2278,20 @@ KRTabGroup.styles = [
2278
2278
  }
2279
2279
  `,
2280
2280
  ];
2281
- __decorate$9([
2281
+ __decorate$a([
2282
2282
  n$1({ type: String, attribute: 'active-tab-id' })
2283
2283
  ], KRTabGroup.prototype, "activeTabId", void 0);
2284
- __decorate$9([
2284
+ __decorate$a([
2285
2285
  n$1({ type: Boolean })
2286
2286
  ], KRTabGroup.prototype, "justified", void 0);
2287
- __decorate$9([
2287
+ __decorate$a([
2288
2288
  n$1({ type: String, reflect: true })
2289
2289
  ], KRTabGroup.prototype, "size", void 0);
2290
- KRTabGroup = __decorate$9([
2290
+ KRTabGroup = __decorate$a([
2291
2291
  t$1('kr-tab-group')
2292
2292
  ], KRTabGroup);
2293
2293
 
2294
- var __decorate$8 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
2294
+ var __decorate$9 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
2295
2295
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
2296
2296
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
2297
2297
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
@@ -2365,35 +2365,35 @@ KRTab.styles = [
2365
2365
  }
2366
2366
  `,
2367
2367
  ];
2368
- __decorate$8([
2368
+ __decorate$9([
2369
2369
  n$1({ type: String, reflect: true })
2370
2370
  ], KRTab.prototype, "id", void 0);
2371
- __decorate$8([
2371
+ __decorate$9([
2372
2372
  n$1({ type: String })
2373
2373
  ], KRTab.prototype, "label", void 0);
2374
- __decorate$8([
2374
+ __decorate$9([
2375
2375
  n$1({ type: String })
2376
2376
  ], KRTab.prototype, "badge", void 0);
2377
- __decorate$8([
2377
+ __decorate$9([
2378
2378
  n$1({ type: String, attribute: 'badge-background' })
2379
2379
  ], KRTab.prototype, "badgeBackground", void 0);
2380
- __decorate$8([
2380
+ __decorate$9([
2381
2381
  n$1({ type: String, attribute: 'badge-color' })
2382
2382
  ], KRTab.prototype, "badgeColor", void 0);
2383
- __decorate$8([
2383
+ __decorate$9([
2384
2384
  n$1({ type: Boolean })
2385
2385
  ], KRTab.prototype, "disabled", void 0);
2386
- __decorate$8([
2386
+ __decorate$9([
2387
2387
  n$1({ type: Boolean })
2388
2388
  ], KRTab.prototype, "dismissible", void 0);
2389
- __decorate$8([
2389
+ __decorate$9([
2390
2390
  n$1({ type: Boolean, reflect: true })
2391
2391
  ], KRTab.prototype, "active", void 0);
2392
- KRTab = __decorate$8([
2392
+ KRTab = __decorate$9([
2393
2393
  t$1('kr-tab')
2394
2394
  ], KRTab);
2395
2395
 
2396
- var __decorate$7 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
2396
+ var __decorate$8 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
2397
2397
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
2398
2398
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
2399
2399
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
@@ -3595,50 +3595,50 @@ KRTable.styles = [krBaseCSS, i$5 `
3595
3595
  color: #dc2626;
3596
3596
  }
3597
3597
  `];
3598
- __decorate$7([
3598
+ __decorate$8([
3599
3599
  r$1()
3600
3600
  ], KRTable.prototype, "_data", void 0);
3601
- __decorate$7([
3601
+ __decorate$8([
3602
3602
  r$1()
3603
3603
  ], KRTable.prototype, "_dataState", void 0);
3604
- __decorate$7([
3604
+ __decorate$8([
3605
3605
  r$1()
3606
3606
  ], KRTable.prototype, "_page", void 0);
3607
- __decorate$7([
3607
+ __decorate$8([
3608
3608
  r$1()
3609
3609
  ], KRTable.prototype, "_pageSize", void 0);
3610
- __decorate$7([
3610
+ __decorate$8([
3611
3611
  r$1()
3612
3612
  ], KRTable.prototype, "_totalItems", void 0);
3613
- __decorate$7([
3613
+ __decorate$8([
3614
3614
  r$1()
3615
3615
  ], KRTable.prototype, "_totalPages", void 0);
3616
- __decorate$7([
3616
+ __decorate$8([
3617
3617
  r$1()
3618
3618
  ], KRTable.prototype, "_searchQuery", void 0);
3619
- __decorate$7([
3619
+ __decorate$8([
3620
3620
  r$1()
3621
3621
  ], KRTable.prototype, "_canScrollLeft", void 0);
3622
- __decorate$7([
3622
+ __decorate$8([
3623
3623
  r$1()
3624
3624
  ], KRTable.prototype, "_canScrollRight", void 0);
3625
- __decorate$7([
3625
+ __decorate$8([
3626
3626
  r$1()
3627
3627
  ], KRTable.prototype, "_canScrollHorizontal", void 0);
3628
- __decorate$7([
3628
+ __decorate$8([
3629
3629
  r$1()
3630
3630
  ], KRTable.prototype, "_columnPickerOpen", void 0);
3631
- __decorate$7([
3631
+ __decorate$8([
3632
3632
  r$1()
3633
3633
  ], KRTable.prototype, "_displayedColumns", void 0);
3634
- __decorate$7([
3634
+ __decorate$8([
3635
3635
  n$1({ type: Object })
3636
3636
  ], KRTable.prototype, "def", void 0);
3637
- KRTable = __decorate$7([
3637
+ KRTable = __decorate$8([
3638
3638
  t$1('kr-table')
3639
3639
  ], KRTable);
3640
3640
 
3641
- var __decorate$6 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
3641
+ var __decorate$7 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
3642
3642
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3643
3643
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
3644
3644
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
@@ -3758,17 +3758,17 @@ KRSpinner.styles = i$5 `
3758
3758
  stroke-linecap: round;
3759
3759
  }
3760
3760
  `;
3761
- __decorate$6([
3761
+ __decorate$7([
3762
3762
  n$1({ type: String, reflect: true })
3763
3763
  ], KRSpinner.prototype, "size", void 0);
3764
- __decorate$6([
3764
+ __decorate$7([
3765
3765
  n$1({ type: String, reflect: true })
3766
3766
  ], KRSpinner.prototype, "color", void 0);
3767
- KRSpinner = __decorate$6([
3767
+ KRSpinner = __decorate$7([
3768
3768
  t$1('kr-spinner')
3769
3769
  ], KRSpinner);
3770
3770
 
3771
- var __decorate$5 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
3771
+ var __decorate$6 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
3772
3772
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3773
3773
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
3774
3774
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
@@ -3859,13 +3859,13 @@ KRProgressBar.styles = i$5 `
3859
3859
  }
3860
3860
  }
3861
3861
  `;
3862
- __decorate$5([
3862
+ __decorate$6([
3863
3863
  n$1({ type: String, reflect: true })
3864
3864
  ], KRProgressBar.prototype, "color", void 0);
3865
- __decorate$5([
3865
+ __decorate$6([
3866
3866
  n$1({ type: String, reflect: true })
3867
3867
  ], KRProgressBar.prototype, "trackColor", void 0);
3868
- KRProgressBar = __decorate$5([
3868
+ KRProgressBar = __decorate$6([
3869
3869
  t$1('kr-progress-bar')
3870
3870
  ], KRProgressBar);
3871
3871
 
@@ -3887,7 +3887,7 @@ KRProgressBar = __decorate$5([
3887
3887
  * SPDX-License-Identifier: BSD-3-Clause
3888
3888
  */const l=e$2(class extends i$1{constructor(r$1){if(super(r$1),r$1.type!==t.PROPERTY&&r$1.type!==t.ATTRIBUTE&&r$1.type!==t.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!r(r$1))throw Error("`live` bindings can only contain a single expression")}render(r){return r}update(i,[t$1]){if(t$1===E||t$1===A)return t$1;const o=i.element,l=i.name;if(i.type===t.PROPERTY){if(t$1===o[l])return E}else if(i.type===t.BOOLEAN_ATTRIBUTE){if(!!t$1===o.hasAttribute(l))return E}else if(i.type===t.ATTRIBUTE&&o.getAttribute(l)===t$1+"")return E;return p(i),t$1}});
3889
3889
 
3890
- var __decorate$4 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
3890
+ var __decorate$5 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
3891
3891
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3892
3892
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
3893
3893
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
@@ -4140,59 +4140,59 @@ KRTextField.styles = i$5 `
4140
4140
  `;
4141
4141
  // Enable form association
4142
4142
  KRTextField.formAssociated = true;
4143
- __decorate$4([
4143
+ __decorate$5([
4144
4144
  n$1({ type: String })
4145
4145
  ], KRTextField.prototype, "label", void 0);
4146
- __decorate$4([
4146
+ __decorate$5([
4147
4147
  n$1({ type: String })
4148
4148
  ], KRTextField.prototype, "name", void 0);
4149
- __decorate$4([
4149
+ __decorate$5([
4150
4150
  n$1({ type: String })
4151
4151
  ], KRTextField.prototype, "value", void 0);
4152
- __decorate$4([
4152
+ __decorate$5([
4153
4153
  n$1({ type: String })
4154
4154
  ], KRTextField.prototype, "placeholder", void 0);
4155
- __decorate$4([
4155
+ __decorate$5([
4156
4156
  n$1({ type: String })
4157
4157
  ], KRTextField.prototype, "type", void 0);
4158
- __decorate$4([
4158
+ __decorate$5([
4159
4159
  n$1({ type: Boolean })
4160
4160
  ], KRTextField.prototype, "required", void 0);
4161
- __decorate$4([
4161
+ __decorate$5([
4162
4162
  n$1({ type: Boolean })
4163
4163
  ], KRTextField.prototype, "disabled", void 0);
4164
- __decorate$4([
4164
+ __decorate$5([
4165
4165
  n$1({ type: Boolean })
4166
4166
  ], KRTextField.prototype, "readonly", void 0);
4167
- __decorate$4([
4167
+ __decorate$5([
4168
4168
  n$1({ type: Number })
4169
4169
  ], KRTextField.prototype, "minlength", void 0);
4170
- __decorate$4([
4170
+ __decorate$5([
4171
4171
  n$1({ type: Number })
4172
4172
  ], KRTextField.prototype, "maxlength", void 0);
4173
- __decorate$4([
4173
+ __decorate$5([
4174
4174
  n$1({ type: String })
4175
4175
  ], KRTextField.prototype, "pattern", void 0);
4176
- __decorate$4([
4176
+ __decorate$5([
4177
4177
  n$1({ type: String })
4178
4178
  ], KRTextField.prototype, "autocomplete", void 0);
4179
- __decorate$4([
4179
+ __decorate$5([
4180
4180
  n$1({ type: String })
4181
4181
  ], KRTextField.prototype, "hint", void 0);
4182
- __decorate$4([
4182
+ __decorate$5([
4183
4183
  e$3('input')
4184
4184
  ], KRTextField.prototype, "_input", void 0);
4185
- __decorate$4([
4185
+ __decorate$5([
4186
4186
  r$1()
4187
4187
  ], KRTextField.prototype, "_touched", void 0);
4188
- __decorate$4([
4188
+ __decorate$5([
4189
4189
  r$1()
4190
4190
  ], KRTextField.prototype, "_dirty", void 0);
4191
- KRTextField = __decorate$4([
4191
+ KRTextField = __decorate$5([
4192
4192
  t$1('kr-text-field')
4193
4193
  ], KRTextField);
4194
4194
 
4195
- var __decorate$3 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
4195
+ var __decorate$4 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
4196
4196
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4197
4197
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4198
4198
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
@@ -4664,47 +4664,47 @@ KRSelectField.styles = [krBaseCSS, i$5 `
4664
4664
  `];
4665
4665
  // Enable form association
4666
4666
  KRSelectField.formAssociated = true;
4667
- __decorate$3([
4667
+ __decorate$4([
4668
4668
  n$1({ type: String })
4669
4669
  ], KRSelectField.prototype, "label", void 0);
4670
- __decorate$3([
4670
+ __decorate$4([
4671
4671
  n$1({ type: String })
4672
4672
  ], KRSelectField.prototype, "name", void 0);
4673
- __decorate$3([
4673
+ __decorate$4([
4674
4674
  n$1({ type: String })
4675
4675
  ], KRSelectField.prototype, "value", void 0);
4676
- __decorate$3([
4676
+ __decorate$4([
4677
4677
  n$1({ type: String })
4678
4678
  ], KRSelectField.prototype, "placeholder", void 0);
4679
- __decorate$3([
4679
+ __decorate$4([
4680
4680
  n$1({ type: Boolean })
4681
4681
  ], KRSelectField.prototype, "disabled", void 0);
4682
- __decorate$3([
4682
+ __decorate$4([
4683
4683
  n$1({ type: Boolean })
4684
4684
  ], KRSelectField.prototype, "required", void 0);
4685
- __decorate$3([
4685
+ __decorate$4([
4686
4686
  n$1({ type: Boolean })
4687
4687
  ], KRSelectField.prototype, "readonly", void 0);
4688
- __decorate$3([
4688
+ __decorate$4([
4689
4689
  n$1({ type: String })
4690
4690
  ], KRSelectField.prototype, "hint", void 0);
4691
- __decorate$3([
4691
+ __decorate$4([
4692
4692
  r$1()
4693
4693
  ], KRSelectField.prototype, "_isOpen", void 0);
4694
- __decorate$3([
4694
+ __decorate$4([
4695
4695
  r$1()
4696
4696
  ], KRSelectField.prototype, "_highlightedIndex", void 0);
4697
- __decorate$3([
4697
+ __decorate$4([
4698
4698
  r$1()
4699
4699
  ], KRSelectField.prototype, "_touched", void 0);
4700
- __decorate$3([
4700
+ __decorate$4([
4701
4701
  e$3('.select-trigger')
4702
4702
  ], KRSelectField.prototype, "_triggerElement", void 0);
4703
- KRSelectField = __decorate$3([
4703
+ KRSelectField = __decorate$4([
4704
4704
  t$1('kr-select-field')
4705
4705
  ], KRSelectField);
4706
4706
 
4707
- var __decorate$2 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
4707
+ var __decorate$3 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
4708
4708
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4709
4709
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4710
4710
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
@@ -4741,17 +4741,17 @@ KRSelectOption.styles = i$5 `
4741
4741
  display: none;
4742
4742
  }
4743
4743
  `;
4744
- __decorate$2([
4744
+ __decorate$3([
4745
4745
  n$1({ type: String })
4746
4746
  ], KRSelectOption.prototype, "value", void 0);
4747
- __decorate$2([
4747
+ __decorate$3([
4748
4748
  n$1({ type: Boolean })
4749
4749
  ], KRSelectOption.prototype, "disabled", void 0);
4750
- KRSelectOption = __decorate$2([
4750
+ KRSelectOption = __decorate$3([
4751
4751
  t$1('kr-select-option')
4752
4752
  ], KRSelectOption);
4753
4753
 
4754
- var __decorate$1 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
4754
+ var __decorate$2 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
4755
4755
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4756
4756
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4757
4757
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
@@ -5009,59 +5009,59 @@ KRTextareaField.styles = i$5 `
5009
5009
  `;
5010
5010
  // Enable form association
5011
5011
  KRTextareaField.formAssociated = true;
5012
- __decorate$1([
5012
+ __decorate$2([
5013
5013
  n$1({ type: String })
5014
5014
  ], KRTextareaField.prototype, "label", void 0);
5015
- __decorate$1([
5015
+ __decorate$2([
5016
5016
  n$1({ type: String })
5017
5017
  ], KRTextareaField.prototype, "name", void 0);
5018
- __decorate$1([
5018
+ __decorate$2([
5019
5019
  n$1({ type: String })
5020
5020
  ], KRTextareaField.prototype, "value", void 0);
5021
- __decorate$1([
5021
+ __decorate$2([
5022
5022
  n$1({ type: String })
5023
5023
  ], KRTextareaField.prototype, "placeholder", void 0);
5024
- __decorate$1([
5024
+ __decorate$2([
5025
5025
  n$1({ type: Boolean })
5026
5026
  ], KRTextareaField.prototype, "required", void 0);
5027
- __decorate$1([
5027
+ __decorate$2([
5028
5028
  n$1({ type: Boolean })
5029
5029
  ], KRTextareaField.prototype, "disabled", void 0);
5030
- __decorate$1([
5030
+ __decorate$2([
5031
5031
  n$1({ type: Boolean })
5032
5032
  ], KRTextareaField.prototype, "readonly", void 0);
5033
- __decorate$1([
5033
+ __decorate$2([
5034
5034
  n$1({ type: Number })
5035
5035
  ], KRTextareaField.prototype, "rows", void 0);
5036
- __decorate$1([
5036
+ __decorate$2([
5037
5037
  n$1({ type: Number })
5038
5038
  ], KRTextareaField.prototype, "cols", void 0);
5039
- __decorate$1([
5039
+ __decorate$2([
5040
5040
  n$1({ type: Number })
5041
5041
  ], KRTextareaField.prototype, "minlength", void 0);
5042
- __decorate$1([
5042
+ __decorate$2([
5043
5043
  n$1({ type: Number })
5044
5044
  ], KRTextareaField.prototype, "maxlength", void 0);
5045
- __decorate$1([
5045
+ __decorate$2([
5046
5046
  n$1({ type: String })
5047
5047
  ], KRTextareaField.prototype, "autocomplete", void 0);
5048
- __decorate$1([
5048
+ __decorate$2([
5049
5049
  n$1({ type: String })
5050
5050
  ], KRTextareaField.prototype, "hint", void 0);
5051
- __decorate$1([
5051
+ __decorate$2([
5052
5052
  e$3('textarea')
5053
5053
  ], KRTextareaField.prototype, "_textarea", void 0);
5054
- __decorate$1([
5054
+ __decorate$2([
5055
5055
  r$1()
5056
5056
  ], KRTextareaField.prototype, "_touched", void 0);
5057
- __decorate$1([
5057
+ __decorate$2([
5058
5058
  r$1()
5059
5059
  ], KRTextareaField.prototype, "_dirty", void 0);
5060
- KRTextareaField = __decorate$1([
5060
+ KRTextareaField = __decorate$2([
5061
5061
  t$1('kr-textarea-field')
5062
5062
  ], KRTextareaField);
5063
5063
 
5064
- var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
5064
+ var __decorate$1 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
5065
5065
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
5066
5066
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5067
5067
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
@@ -5118,15 +5118,788 @@ KRDetailField.styles = i$5 `
5118
5118
  color: black;
5119
5119
  }
5120
5120
  `;
5121
- __decorate([
5121
+ __decorate$1([
5122
5122
  n$1({ type: String })
5123
5123
  ], KRDetailField.prototype, "label", void 0);
5124
- __decorate([
5124
+ __decorate$1([
5125
5125
  n$1({ type: String })
5126
5126
  ], KRDetailField.prototype, "value", void 0);
5127
- KRDetailField = __decorate([
5127
+ KRDetailField = __decorate$1([
5128
5128
  t$1('kr-detail-field')
5129
5129
  ], KRDetailField);
5130
5130
 
5131
- export { KRAccordion, KRAlert, KRButton, KRCodeDemo, KRContextMenu, KRDialog, KRDialogRef, KRProgressBar, KRSelectField, KRSelectOption, KRSnackbar, KRSpinner, KRTab, KRTabGroup, KRTable, KRTextField, KRTextareaField, krBaseCSS };
5131
+ var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
5132
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
5133
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5134
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5135
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
5136
+ };
5137
+ function isGroup(option) {
5138
+ return 'options' in option;
5139
+ }
5140
+ /**
5141
+ * @element kr-auto-suggest
5142
+ *
5143
+ * @property {string} label - Label text for the input
5144
+ * @property {string} name - Name for form submission
5145
+ * @property {string} value - Current input value
5146
+ * @property {string} placeholder - Placeholder text
5147
+ * @property {boolean} disabled - Whether the input is disabled
5148
+ * @property {boolean} readonly - Whether the input is readonly
5149
+ * @property {boolean} required - Whether the input is required
5150
+ * @property {string} hint - Helper text displayed below the input
5151
+ * @property {SuggestionOptions} options - Array of suggestion options or groups
5152
+ * @property {AutoSuggestStatusType} statusType - Loading state: 'pending' | 'loading' | 'finished' | 'error'
5153
+ * @property {string} loadingText - Text to show during loading
5154
+ * @property {string} errorText - Text to show on error
5155
+ * @property {string} emptyText - Text to show when no matches
5156
+ * @property {AutoSuggestFilteringType} filteringType - 'auto' (client-side) or 'manual' (server-side)
5157
+ * @property {boolean} highlightMatches - Whether to highlight matching text
5158
+ *
5159
+ * @fires change - Fired when the input value changes
5160
+ * @fires select - Fired when a suggestion is selected
5161
+ * @fires load-items - Fired when items should be loaded (manual filtering)
5162
+ *
5163
+ * @slot - Not used
5164
+ */
5165
+ let KRAutoSuggest = class KRAutoSuggest extends i$2 {
5166
+ constructor() {
5167
+ super();
5168
+ this.label = '';
5169
+ this.name = '';
5170
+ this.value = '';
5171
+ this.placeholder = '';
5172
+ this.disabled = false;
5173
+ this.readonly = false;
5174
+ this.required = false;
5175
+ this.hint = '';
5176
+ this.options = [];
5177
+ this.statusType = 'finished';
5178
+ this.loadingText = 'Loading...';
5179
+ this.errorText = 'Error loading options';
5180
+ this.emptyText = 'No matches found';
5181
+ this.filteringType = 'auto';
5182
+ this.highlightMatches = true;
5183
+ this._isOpen = false;
5184
+ this._highlightedIndex = -1;
5185
+ this._touched = false;
5186
+ this._dirty = false;
5187
+ this._handleDocumentClick = this._onDocumentClick.bind(this);
5188
+ this._internals = this.attachInternals();
5189
+ }
5190
+ connectedCallback() {
5191
+ super.connectedCallback();
5192
+ document.addEventListener('click', this._handleDocumentClick);
5193
+ }
5194
+ disconnectedCallback() {
5195
+ super.disconnectedCallback();
5196
+ document.removeEventListener('click', this._handleDocumentClick);
5197
+ }
5198
+ firstUpdated() {
5199
+ this._updateFormValue();
5200
+ }
5201
+ get form() {
5202
+ return this._internals.form;
5203
+ }
5204
+ get validity() {
5205
+ return this._internals.validity;
5206
+ }
5207
+ get validationMessage() {
5208
+ return this._internals.validationMessage;
5209
+ }
5210
+ checkValidity() {
5211
+ return this._internals.checkValidity();
5212
+ }
5213
+ reportValidity() {
5214
+ return this._internals.reportValidity();
5215
+ }
5216
+ formResetCallback() {
5217
+ this.value = '';
5218
+ this._touched = false;
5219
+ this._dirty = false;
5220
+ this._isOpen = false;
5221
+ this._highlightedIndex = -1;
5222
+ this._updateFormValue();
5223
+ }
5224
+ formStateRestoreCallback(state) {
5225
+ this.value = state;
5226
+ }
5227
+ get _filteredOptions() {
5228
+ if (this.filteringType === 'manual' || !this.value) {
5229
+ return this.options;
5230
+ }
5231
+ const searchValue = this.value.toLowerCase();
5232
+ const filtered = [];
5233
+ for (const option of this.options) {
5234
+ if (isGroup(option)) {
5235
+ const filteredGroupOptions = option.options.filter((opt) => {
5236
+ const label = (opt.label || opt.value).toLowerCase();
5237
+ const tags = opt.filteringTags?.join(' ').toLowerCase() || '';
5238
+ return label.includes(searchValue) || tags.includes(searchValue);
5239
+ });
5240
+ if (filteredGroupOptions.length > 0) {
5241
+ filtered.push({ ...option, options: filteredGroupOptions });
5242
+ }
5243
+ }
5244
+ else {
5245
+ const label = (option.label || option.value).toLowerCase();
5246
+ const tags = option.filteringTags?.join(' ').toLowerCase() || '';
5247
+ if (label.includes(searchValue) || tags.includes(searchValue)) {
5248
+ filtered.push(option);
5249
+ }
5250
+ }
5251
+ }
5252
+ return filtered;
5253
+ }
5254
+ get _flatOptions() {
5255
+ const flat = [];
5256
+ for (const option of this._filteredOptions) {
5257
+ if (isGroup(option)) {
5258
+ flat.push(...option.options);
5259
+ }
5260
+ else {
5261
+ flat.push(option);
5262
+ }
5263
+ }
5264
+ return flat;
5265
+ }
5266
+ _updateFormValue() {
5267
+ this._internals.setFormValue(this.value);
5268
+ // Validation
5269
+ if (this.required && !this.value) {
5270
+ this._internals.setValidity({ valueMissing: true }, 'This field is required', this._input);
5271
+ }
5272
+ else {
5273
+ this._internals.setValidity({});
5274
+ }
5275
+ }
5276
+ _onInput(e) {
5277
+ const target = e.target;
5278
+ this.value = target.value;
5279
+ this._dirty = true;
5280
+ this._isOpen = true;
5281
+ this._highlightedIndex = -1;
5282
+ this._updateFormValue();
5283
+ this.dispatchEvent(new CustomEvent('change', {
5284
+ detail: { value: this.value },
5285
+ bubbles: true,
5286
+ composed: true,
5287
+ }));
5288
+ if (this.filteringType === 'manual') {
5289
+ this.dispatchEvent(new CustomEvent('load-items', {
5290
+ detail: { filteringText: this.value },
5291
+ bubbles: true,
5292
+ composed: true,
5293
+ }));
5294
+ }
5295
+ }
5296
+ _onFocus() {
5297
+ this._isOpen = true;
5298
+ if (this.filteringType === 'manual') {
5299
+ this.dispatchEvent(new CustomEvent('load-items', {
5300
+ detail: { filteringText: this.value },
5301
+ bubbles: true,
5302
+ composed: true,
5303
+ }));
5304
+ }
5305
+ }
5306
+ _onBlur() {
5307
+ this._touched = true;
5308
+ // Delay to allow click on option
5309
+ setTimeout(() => {
5310
+ this._isOpen = false;
5311
+ this._highlightedIndex = -1;
5312
+ }, 200);
5313
+ this._updateFormValue();
5314
+ }
5315
+ _onKeyDown(e) {
5316
+ const options = this._flatOptions;
5317
+ switch (e.key) {
5318
+ case 'ArrowDown':
5319
+ e.preventDefault();
5320
+ this._isOpen = true;
5321
+ this._highlightedIndex = Math.min(this._highlightedIndex + 1, options.length - 1);
5322
+ this._scrollToHighlighted();
5323
+ break;
5324
+ case 'ArrowUp':
5325
+ e.preventDefault();
5326
+ this._highlightedIndex = Math.max(this._highlightedIndex - 1, -1);
5327
+ this._scrollToHighlighted();
5328
+ break;
5329
+ case 'Enter':
5330
+ if (this._highlightedIndex >= 0 && options[this._highlightedIndex]) {
5331
+ e.preventDefault();
5332
+ this._selectOption(options[this._highlightedIndex]);
5333
+ }
5334
+ break;
5335
+ case 'Escape':
5336
+ e.preventDefault();
5337
+ this._isOpen = false;
5338
+ this._highlightedIndex = -1;
5339
+ break;
5340
+ case 'Tab':
5341
+ this._isOpen = false;
5342
+ this._highlightedIndex = -1;
5343
+ break;
5344
+ }
5345
+ }
5346
+ _scrollToHighlighted() {
5347
+ this.updateComplete.then(() => {
5348
+ const container = this.shadowRoot?.querySelector('.dropdown');
5349
+ const highlighted = this.shadowRoot?.querySelector('.option.is-highlighted');
5350
+ if (container && highlighted) {
5351
+ const containerRect = container.getBoundingClientRect();
5352
+ const highlightedRect = highlighted.getBoundingClientRect();
5353
+ if (highlightedRect.bottom > containerRect.bottom) {
5354
+ highlighted.scrollIntoView({ block: 'nearest' });
5355
+ }
5356
+ else if (highlightedRect.top < containerRect.top) {
5357
+ highlighted.scrollIntoView({ block: 'nearest' });
5358
+ }
5359
+ }
5360
+ });
5361
+ }
5362
+ _selectOption(option) {
5363
+ if (option.disabled)
5364
+ return;
5365
+ this.value = option.label || option.value;
5366
+ this._isOpen = false;
5367
+ this._highlightedIndex = -1;
5368
+ this._dirty = true;
5369
+ this._updateFormValue();
5370
+ this.dispatchEvent(new CustomEvent('select', {
5371
+ detail: { value: option.value, selectedOption: option },
5372
+ bubbles: true,
5373
+ composed: true,
5374
+ }));
5375
+ this.dispatchEvent(new Event('change', { bubbles: true, composed: true }));
5376
+ }
5377
+ _handleClear() {
5378
+ this.value = '';
5379
+ this._updateFormValue();
5380
+ this.dispatchEvent(new CustomEvent('change', {
5381
+ detail: { value: '' },
5382
+ bubbles: true,
5383
+ composed: true,
5384
+ }));
5385
+ this._input?.focus();
5386
+ }
5387
+ _onDocumentClick(e) {
5388
+ const path = e.composedPath();
5389
+ if (!path.includes(this)) {
5390
+ this._isOpen = false;
5391
+ }
5392
+ }
5393
+ _highlightMatch(text) {
5394
+ if (!this.value || this.filteringType === 'manual' || !this.highlightMatches) {
5395
+ return b `${text}`;
5396
+ }
5397
+ const searchValue = this.value.toLowerCase();
5398
+ const index = text.toLowerCase().indexOf(searchValue);
5399
+ if (index === -1) {
5400
+ return b `${text}`;
5401
+ }
5402
+ const before = text.slice(0, index);
5403
+ const match = text.slice(index, index + this.value.length);
5404
+ const after = text.slice(index + this.value.length);
5405
+ return b `${before}<span class="highlight">${match}</span>${after}`;
5406
+ }
5407
+ _renderOption(option, index) {
5408
+ const isHighlighted = index === this._highlightedIndex;
5409
+ return b `
5410
+ <button
5411
+ class=${e$1({
5412
+ option: true,
5413
+ 'is-highlighted': isHighlighted,
5414
+ })}
5415
+ type="button"
5416
+ role="option"
5417
+ aria-selected=${isHighlighted}
5418
+ ?disabled=${option.disabled}
5419
+ @click=${() => this._selectOption(option)}
5420
+ @mouseenter=${() => {
5421
+ this._highlightedIndex = index;
5422
+ }}
5423
+ >
5424
+ <div class="option-content">
5425
+ <div class="option-label">
5426
+ ${this._highlightMatch(option.label || option.value)}
5427
+ ${option.labelTag ? b `<span class="option-tag">${option.labelTag}</span>` : A}
5428
+ </div>
5429
+ ${option.description
5430
+ ? b `<div class="option-description">${option.description}</div>`
5431
+ : A}
5432
+ ${option.tags && option.tags.length > 0
5433
+ ? b `
5434
+ <div class="option-tags">
5435
+ ${option.tags.map((tag) => b `<span class="option-tag">${tag}</span>`)}
5436
+ </div>
5437
+ `
5438
+ : A}
5439
+ </div>
5440
+ </button>
5441
+ `;
5442
+ }
5443
+ _renderDropdownContent() {
5444
+ if (this.statusType === 'loading') {
5445
+ return b `
5446
+ <div class="status">
5447
+ <div class="spinner"></div>
5448
+ ${this.loadingText}
5449
+ </div>
5450
+ `;
5451
+ }
5452
+ if (this.statusType === 'error') {
5453
+ return b `
5454
+ <div class="status is-error">
5455
+ <svg width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
5456
+ <path
5457
+ d="M8.982 1.566a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L8.982 1.566zM8 5c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995A.905.905 0 0 1 8 5zm.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2z"
5458
+ />
5459
+ </svg>
5460
+ ${this.errorText}
5461
+ </div>
5462
+ `;
5463
+ }
5464
+ const filtered = this._filteredOptions;
5465
+ if (filtered.length === 0) {
5466
+ return b `<div class="empty">${this.emptyText}</div>`;
5467
+ }
5468
+ let optionIndex = 0;
5469
+ return b `
5470
+ ${filtered.map((option) => {
5471
+ if (isGroup(option)) {
5472
+ const groupOptions = option.options.map((opt) => {
5473
+ const rendered = this._renderOption(opt, optionIndex);
5474
+ optionIndex++;
5475
+ return rendered;
5476
+ });
5477
+ return b `
5478
+ <div class="group-label">${option.label}</div>
5479
+ ${groupOptions}
5480
+ `;
5481
+ }
5482
+ const rendered = this._renderOption(option, optionIndex);
5483
+ optionIndex++;
5484
+ return rendered;
5485
+ })}
5486
+ `;
5487
+ }
5488
+ render() {
5489
+ const hasError = this._touched && !this.validity.valid;
5490
+ return b `
5491
+ <div class="field-wrapper">
5492
+ ${this.label
5493
+ ? b `
5494
+ <label>
5495
+ ${this.label}
5496
+ ${this.required ? b `<span class="required">*</span>` : A}
5497
+ </label>
5498
+ `
5499
+ : A}
5500
+
5501
+ <div class="input-container">
5502
+ <div class="input-wrapper">
5503
+ <input
5504
+ type="text"
5505
+ .value=${l(this.value)}
5506
+ placeholder=${o(this.placeholder || undefined)}
5507
+ ?disabled=${this.disabled}
5508
+ ?readonly=${this.readonly}
5509
+ ?required=${this.required}
5510
+ name=${o(this.name || undefined)}
5511
+ autocomplete="off"
5512
+ role="combobox"
5513
+ aria-autocomplete="list"
5514
+ aria-expanded=${this._isOpen}
5515
+ aria-controls="dropdown"
5516
+ class=${e$1({
5517
+ 'input--invalid': hasError,
5518
+ })}
5519
+ @input=${this._onInput}
5520
+ @blur=${this._onBlur}
5521
+ @focus=${this._onFocus}
5522
+ @keydown=${this._onKeyDown}
5523
+ />
5524
+ <div class="icon-container">
5525
+ ${this.value && !this.disabled && !this.readonly
5526
+ ? b `
5527
+ <button
5528
+ class="clear-button"
5529
+ type="button"
5530
+ aria-label="Clear"
5531
+ @click=${this._handleClear}
5532
+ >
5533
+ <svg width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
5534
+ <path
5535
+ d="M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z"
5536
+ />
5537
+ </svg>
5538
+ </button>
5539
+ `
5540
+ : ''}
5541
+ ${!this.value && !this.disabled && !this.readonly
5542
+ ? b `
5543
+ <svg class="search-icon" fill="currentColor" viewBox="0 0 16 16">
5544
+ <path
5545
+ d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"
5546
+ />
5547
+ </svg>
5548
+ `
5549
+ : ''}
5550
+ </div>
5551
+ </div>
5552
+
5553
+ <div
5554
+ id="dropdown"
5555
+ role="listbox"
5556
+ class=${e$1({
5557
+ dropdown: true,
5558
+ 'is-open': this._isOpen,
5559
+ })}
5560
+ >
5561
+ ${this._renderDropdownContent()}
5562
+ </div>
5563
+ </div>
5564
+
5565
+ ${hasError
5566
+ ? b `<div class="validation-message">${this.validationMessage}</div>`
5567
+ : this.hint
5568
+ ? b `<div class="hint">${this.hint}</div>`
5569
+ : A}
5570
+ </div>
5571
+ `;
5572
+ }
5573
+ };
5574
+ KRAutoSuggest.styles = i$5 `
5575
+ :host {
5576
+ display: block;
5577
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell,
5578
+ 'Helvetica Neue', sans-serif;
5579
+ }
5580
+
5581
+ .field-wrapper {
5582
+ display: flex;
5583
+ flex-direction: column;
5584
+ gap: 4px;
5585
+ }
5586
+
5587
+ label {
5588
+ font-size: 14px;
5589
+ font-weight: 500;
5590
+ color: var(--kr-text-field-label-color, #374151);
5591
+ display: block;
5592
+ }
5593
+
5594
+ .required {
5595
+ color: var(--kr-text-field-required-color, #ef4444);
5596
+ margin-left: 2px;
5597
+ }
5598
+
5599
+ .input-container {
5600
+ position: relative;
5601
+ }
5602
+
5603
+ .input-wrapper {
5604
+ position: relative;
5605
+ display: flex;
5606
+ align-items: center;
5607
+ }
5608
+
5609
+ input {
5610
+ flex: 1;
5611
+ width: 100%;
5612
+ padding: 8px 32px 8px 12px;
5613
+ font-size: 14px;
5614
+ border: 1px solid var(--kr-text-field-border-color, #d1d5db);
5615
+ border-radius: 6px;
5616
+ background: var(--kr-text-field-bg, #ffffff);
5617
+ color: var(--kr-text-field-color, #000000);
5618
+ transition: all 0.2s ease;
5619
+ box-sizing: border-box;
5620
+ font-family: inherit;
5621
+ }
5622
+
5623
+ input:focus {
5624
+ outline: none;
5625
+ border-color: var(--kr-text-field-focus-border-color, #163052);
5626
+ box-shadow: 0 0 0 3px var(--kr-text-field-focus-ring-color, rgba(22, 48, 82, 0.1));
5627
+ }
5628
+
5629
+ input:disabled {
5630
+ background: var(--kr-text-field-disabled-bg, #f3f4f6);
5631
+ cursor: not-allowed;
5632
+ opacity: 0.6;
5633
+ }
5634
+
5635
+ input:read-only {
5636
+ background: var(--kr-text-field-disabled-bg, #f3f4f6);
5637
+ cursor: default;
5638
+ }
5639
+
5640
+ input.input--invalid {
5641
+ border-color: var(--kr-text-field-error-border-color, #ef4444);
5642
+ }
5643
+
5644
+ input.input--invalid:focus {
5645
+ box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
5646
+ }
5647
+
5648
+ input::placeholder {
5649
+ color: var(--kr-text-field-placeholder-color, #9ca3af);
5650
+ }
5651
+
5652
+ .icon-container {
5653
+ position: absolute;
5654
+ right: 8px;
5655
+ display: flex;
5656
+ align-items: center;
5657
+ gap: 4px;
5658
+ }
5659
+
5660
+ .clear-button {
5661
+ display: flex;
5662
+ align-items: center;
5663
+ justify-content: center;
5664
+ width: 20px;
5665
+ height: 20px;
5666
+ padding: 0;
5667
+ background: none;
5668
+ border: none;
5669
+ border-radius: 50%;
5670
+ color: var(--kr-text-muted, #6b7280);
5671
+ cursor: pointer;
5672
+ transition: all 0.15s ease;
5673
+ }
5674
+
5675
+ .clear-button:hover {
5676
+ background-color: var(--kr-select-option-hover-bg, #f3f4f6);
5677
+ color: var(--kr-text, #000000);
5678
+ }
5679
+
5680
+ .search-icon {
5681
+ width: 16px;
5682
+ height: 16px;
5683
+ color: var(--kr-text-muted, #6b7280);
5684
+ pointer-events: none;
5685
+ }
5686
+
5687
+ /* Dropdown */
5688
+ .dropdown {
5689
+ position: absolute;
5690
+ top: 100%;
5691
+ left: 0;
5692
+ right: 0;
5693
+ z-index: 50;
5694
+ margin-top: 4px;
5695
+ max-height: 300px;
5696
+ overflow-y: auto;
5697
+ background: white;
5698
+ border: 1px solid var(--kr-text-field-border-color, #d1d5db);
5699
+ border-radius: 6px;
5700
+ box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
5701
+ display: none;
5702
+ }
5703
+
5704
+ .dropdown.is-open {
5705
+ display: block;
5706
+ }
5707
+
5708
+ /* Options */
5709
+ .option {
5710
+ display: flex;
5711
+ align-items: flex-start;
5712
+ gap: 8px;
5713
+ width: 100%;
5714
+ padding: 8px 12px;
5715
+ background: none;
5716
+ border: none;
5717
+ font-size: 14px;
5718
+ font-family: inherit;
5719
+ color: var(--kr-text, #000000);
5720
+ text-align: left;
5721
+ cursor: pointer;
5722
+ transition: background 0.15s ease;
5723
+ }
5724
+
5725
+ .option:hover:not(:disabled) {
5726
+ background: var(--kr-select-option-hover-bg, #f3f4f6);
5727
+ }
5728
+
5729
+ .option.is-highlighted {
5730
+ background: var(--kr-select-option-highlight-bg, #e5e7eb);
5731
+ }
5732
+
5733
+ .option:disabled {
5734
+ opacity: 0.5;
5735
+ cursor: not-allowed;
5736
+ }
5737
+
5738
+ .option-content {
5739
+ flex: 1;
5740
+ min-width: 0;
5741
+ }
5742
+
5743
+ .option-label {
5744
+ display: flex;
5745
+ align-items: center;
5746
+ gap: 6px;
5747
+ flex-wrap: wrap;
5748
+ }
5749
+
5750
+ .option-tag {
5751
+ flex-shrink: 0;
5752
+ padding: 2px 6px;
5753
+ font-size: 11px;
5754
+ color: var(--kr-text-muted, #6b7280);
5755
+ background: var(--kr-select-option-hover-bg, #f3f4f6);
5756
+ border-radius: 3px;
5757
+ }
5758
+
5759
+ .option-description {
5760
+ font-size: 12px;
5761
+ color: var(--kr-text-muted, #6b7280);
5762
+ margin-top: 2px;
5763
+ }
5764
+
5765
+ .option-tags {
5766
+ display: flex;
5767
+ flex-wrap: wrap;
5768
+ gap: 4px;
5769
+ margin-top: 4px;
5770
+ }
5771
+
5772
+ /* Highlight */
5773
+ .highlight {
5774
+ font-weight: 600;
5775
+ background-color: #fef3c7;
5776
+ color: #92400e;
5777
+ }
5778
+
5779
+ /* Group */
5780
+ .group-label {
5781
+ padding: 8px 12px;
5782
+ font-size: 11px;
5783
+ font-weight: 600;
5784
+ color: var(--kr-text-muted, #6b7280);
5785
+ text-transform: uppercase;
5786
+ letter-spacing: 0.05em;
5787
+ background: var(--kr-select-option-hover-bg, #f9fafb);
5788
+ border-bottom: 1px solid var(--kr-text-field-border-color, #e5e7eb);
5789
+ }
5790
+
5791
+ /* Status */
5792
+ .status {
5793
+ display: flex;
5794
+ align-items: center;
5795
+ justify-content: center;
5796
+ gap: 8px;
5797
+ padding: 16px;
5798
+ font-size: 14px;
5799
+ color: var(--kr-text-muted, #6b7280);
5800
+ }
5801
+
5802
+ .status.is-error {
5803
+ color: var(--kr-text-field-error-border-color, #ef4444);
5804
+ }
5805
+
5806
+ .spinner {
5807
+ width: 16px;
5808
+ height: 16px;
5809
+ border: 2px solid var(--kr-text-field-border-color, #e5e7eb);
5810
+ border-top-color: var(--kr-text-field-focus-border-color, #163052);
5811
+ border-radius: 50%;
5812
+ animation: spin 0.6s linear infinite;
5813
+ }
5814
+
5815
+ @keyframes spin {
5816
+ to {
5817
+ transform: rotate(360deg);
5818
+ }
5819
+ }
5820
+
5821
+ .empty {
5822
+ padding: 16px;
5823
+ text-align: center;
5824
+ font-size: 14px;
5825
+ color: var(--kr-text-muted, #6b7280);
5826
+ }
5827
+
5828
+ .hint {
5829
+ font-size: 12px;
5830
+ color: var(--kr-text-field-hint-color, #6b7280);
5831
+ }
5832
+
5833
+ .validation-message {
5834
+ font-size: 12px;
5835
+ color: var(--kr-text-field-error-border-color, #ef4444);
5836
+ margin-top: 2px;
5837
+ }
5838
+ `;
5839
+ KRAutoSuggest.formAssociated = true;
5840
+ __decorate([
5841
+ n$1({ type: String })
5842
+ ], KRAutoSuggest.prototype, "label", void 0);
5843
+ __decorate([
5844
+ n$1({ type: String })
5845
+ ], KRAutoSuggest.prototype, "name", void 0);
5846
+ __decorate([
5847
+ n$1({ type: String })
5848
+ ], KRAutoSuggest.prototype, "value", void 0);
5849
+ __decorate([
5850
+ n$1({ type: String })
5851
+ ], KRAutoSuggest.prototype, "placeholder", void 0);
5852
+ __decorate([
5853
+ n$1({ type: Boolean })
5854
+ ], KRAutoSuggest.prototype, "disabled", void 0);
5855
+ __decorate([
5856
+ n$1({ type: Boolean })
5857
+ ], KRAutoSuggest.prototype, "readonly", void 0);
5858
+ __decorate([
5859
+ n$1({ type: Boolean })
5860
+ ], KRAutoSuggest.prototype, "required", void 0);
5861
+ __decorate([
5862
+ n$1({ type: String })
5863
+ ], KRAutoSuggest.prototype, "hint", void 0);
5864
+ __decorate([
5865
+ n$1({ type: Array })
5866
+ ], KRAutoSuggest.prototype, "options", void 0);
5867
+ __decorate([
5868
+ n$1({ type: String, attribute: 'status-type' })
5869
+ ], KRAutoSuggest.prototype, "statusType", void 0);
5870
+ __decorate([
5871
+ n$1({ type: String, attribute: 'loading-text' })
5872
+ ], KRAutoSuggest.prototype, "loadingText", void 0);
5873
+ __decorate([
5874
+ n$1({ type: String, attribute: 'error-text' })
5875
+ ], KRAutoSuggest.prototype, "errorText", void 0);
5876
+ __decorate([
5877
+ n$1({ type: String, attribute: 'empty-text' })
5878
+ ], KRAutoSuggest.prototype, "emptyText", void 0);
5879
+ __decorate([
5880
+ n$1({ type: String, attribute: 'filtering-type' })
5881
+ ], KRAutoSuggest.prototype, "filteringType", void 0);
5882
+ __decorate([
5883
+ n$1({ type: Boolean, attribute: 'highlight-matches' })
5884
+ ], KRAutoSuggest.prototype, "highlightMatches", void 0);
5885
+ __decorate([
5886
+ r$1()
5887
+ ], KRAutoSuggest.prototype, "_isOpen", void 0);
5888
+ __decorate([
5889
+ r$1()
5890
+ ], KRAutoSuggest.prototype, "_highlightedIndex", void 0);
5891
+ __decorate([
5892
+ r$1()
5893
+ ], KRAutoSuggest.prototype, "_touched", void 0);
5894
+ __decorate([
5895
+ r$1()
5896
+ ], KRAutoSuggest.prototype, "_dirty", void 0);
5897
+ __decorate([
5898
+ e$3('input')
5899
+ ], KRAutoSuggest.prototype, "_input", void 0);
5900
+ KRAutoSuggest = __decorate([
5901
+ t$1('kr-auto-suggest')
5902
+ ], KRAutoSuggest);
5903
+
5904
+ export { KRAccordion, KRAlert, KRAutoSuggest, KRButton, KRCodeDemo, KRContextMenu, KRDialog, KRDialogRef, KRProgressBar, KRSelectField, KRSelectOption, KRSnackbar, KRSpinner, KRTab, KRTabGroup, KRTable, KRTextField, KRTextareaField, krBaseCSS };
5132
5905
  //# sourceMappingURL=krubble-components.bundled.js.map