@ucme-ui/angular 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4996,30 +4996,151 @@ i0.ɵɵngDeclareClassMetadata({
4996
4996
  }]
4997
4997
  }] }
4998
4998
  });
4999
+ function isDropdownDivider(entry) {
5000
+ return "divider" in entry;
5001
+ }
5002
+ function isDropdownHeader(entry) {
5003
+ return "header" in entry;
5004
+ }
5005
+ var HuDropdownTrigger = class HuDropdownTrigger {
5006
+ dropdown = inject(HuDropdown);
5007
+ element = inject(ElementRef);
5008
+ static ɵfac = i0.ɵɵngDeclareFactory({
5009
+ minVersion: "12.0.0",
5010
+ version: "22.2.0",
5011
+ ngImport: i0,
5012
+ type: HuDropdownTrigger,
5013
+ deps: [],
5014
+ target: i0.ɵɵFactoryTarget.Directive
5015
+ });
5016
+ static ɵdir = i0.ɵɵngDeclareDirective({
5017
+ minVersion: "14.0.0",
5018
+ version: "22.2.0",
5019
+ type: HuDropdownTrigger,
5020
+ isStandalone: true,
5021
+ selector: "[huDropdownTrigger]",
5022
+ host: {
5023
+ attributes: { "aria-haspopup": "menu" },
5024
+ listeners: { "click": "dropdown.toggle()" },
5025
+ properties: {
5026
+ "attr.aria-expanded": "dropdown.open()",
5027
+ "attr.aria-controls": "dropdown.panelId"
5028
+ }
5029
+ },
5030
+ ngImport: i0
5031
+ });
5032
+ };
5033
+ i0.ɵɵngDeclareClassMetadata({
5034
+ minVersion: "12.0.0",
5035
+ version: "22.2.0",
5036
+ ngImport: i0,
5037
+ type: HuDropdownTrigger,
5038
+ decorators: [{
5039
+ type: Directive,
5040
+ args: [{
5041
+ selector: "[huDropdownTrigger]",
5042
+ host: {
5043
+ "aria-haspopup": "menu",
5044
+ "[attr.aria-expanded]": "dropdown.open()",
5045
+ "[attr.aria-controls]": "dropdown.panelId",
5046
+ "(click)": "dropdown.toggle()"
5047
+ }
5048
+ }]
5049
+ }]
5050
+ });
5051
+ var HuDropdownHeaderSlot = class HuDropdownHeaderSlot {
5052
+ static ɵfac = i0.ɵɵngDeclareFactory({
5053
+ minVersion: "12.0.0",
5054
+ version: "22.2.0",
5055
+ ngImport: i0,
5056
+ type: HuDropdownHeaderSlot,
5057
+ deps: [],
5058
+ target: i0.ɵɵFactoryTarget.Directive
5059
+ });
5060
+ static ɵdir = i0.ɵɵngDeclareDirective({
5061
+ minVersion: "14.0.0",
5062
+ version: "22.2.0",
5063
+ type: HuDropdownHeaderSlot,
5064
+ isStandalone: true,
5065
+ selector: "[huDropdownHeader]",
5066
+ host: { classAttribute: "hu-dropdown__header" },
5067
+ ngImport: i0
5068
+ });
5069
+ };
5070
+ i0.ɵɵngDeclareClassMetadata({
5071
+ minVersion: "12.0.0",
5072
+ version: "22.2.0",
5073
+ ngImport: i0,
5074
+ type: HuDropdownHeaderSlot,
5075
+ decorators: [{
5076
+ type: Directive,
5077
+ args: [{
5078
+ selector: "[huDropdownHeader]",
5079
+ host: { class: "hu-dropdown__header" }
5080
+ }]
5081
+ }]
5082
+ });
4999
5083
  var HuDropdown = class HuDropdown {
5000
5084
  host = inject(ElementRef);
5001
5085
  injector = inject(Injector);
5086
+ options = input([], ...ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []);
5087
+ label = input(...ngDevMode ? [void 0, { debugName: "label" }] : /* istanbul ignore next */ []);
5088
+ icon = input(...ngDevMode ? [void 0, { debugName: "icon" }] : /* istanbul ignore next */ []);
5089
+ variant = input("outline", ...ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []);
5090
+ color = input(...ngDevMode ? [void 0, { debugName: "color" }] : /* istanbul ignore next */ []);
5091
+ size = input("md", ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
5092
+ caret = input(true, {
5093
+ ...ngDevMode ? { debugName: "caret" } : /* istanbul ignore next */ {},
5094
+ transform: booleanAttribute
5095
+ });
5096
+ ariaLabel = input(...ngDevMode ? [void 0, { debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
5097
+ disabled = input(false, {
5098
+ ...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
5099
+ transform: booleanAttribute
5100
+ });
5002
5101
  align = input("start", ...ngDevMode ? [{ debugName: "align" }] : /* istanbul ignore next */ []);
5003
- isOpen = signal(false, ...ngDevMode ? [{ debugName: "isOpen" }] : /* istanbul ignore next */ []);
5102
+ open = model(false, ...ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []);
5103
+ selected = output();
5004
5104
  panelId = huUniqueId("hu-dropdown");
5105
+ customTrigger = contentChild(HuDropdownTrigger, ...ngDevMode ? [{ debugName: "customTrigger" }] : /* istanbul ignore next */ []);
5106
+ isDivider = isDropdownDivider;
5107
+ isHeader = isDropdownHeader;
5108
+ typeahead = "";
5109
+ typeaheadTimer;
5005
5110
  toggle() {
5006
- if (this.isOpen()) this.close();
5007
- else this.openMenu();
5111
+ if (this.open()) this.close();
5112
+ else this.show();
5008
5113
  }
5009
- openMenu() {
5010
- this.isOpen.set(true);
5114
+ show() {
5115
+ if (this.disabled()) return;
5116
+ this.open.set(true);
5011
5117
  afterNextRender(() => this.items()[0]?.focus(), { injector: this.injector });
5012
5118
  }
5013
5119
  close(restoreFocus = false) {
5014
- if (!this.isOpen()) return;
5015
- this.isOpen.set(false);
5016
- if (restoreFocus) this.host.nativeElement.querySelector("[huDropdownTrigger]")?.focus();
5120
+ if (!this.open()) return;
5121
+ this.open.set(false);
5122
+ if (restoreFocus) this.triggerElement()?.focus();
5123
+ }
5124
+ choose(option) {
5125
+ if (option.disabled) return;
5126
+ this.selected.emit({
5127
+ ...option,
5128
+ value: option.value ?? option.label
5129
+ });
5130
+ this.close(true);
5017
5131
  }
5018
5132
  onDocumentClick(event) {
5019
5133
  if (!this.host.nativeElement.contains(event.target)) this.close();
5020
5134
  }
5135
+ onTriggerKeydown(event) {
5136
+ if (event.key === "ArrowDown" || event.key === "ArrowUp") {
5137
+ event.preventDefault();
5138
+ this.show();
5139
+ }
5140
+ }
5021
5141
  onPanelKeydown(event) {
5022
5142
  const items = this.items();
5143
+ if (!items.length) return;
5023
5144
  const current = items.indexOf(this.host.nativeElement.ownerDocument.activeElement);
5024
5145
  let next = -1;
5025
5146
  if (event.key === "ArrowDown") next = (current + 1) % items.length;
@@ -5027,14 +5148,28 @@ var HuDropdown = class HuDropdown {
5027
5148
  else if (event.key === "Home") next = 0;
5028
5149
  else if (event.key === "End") next = items.length - 1;
5029
5150
  else if (event.key === "Tab") this.close();
5151
+ else if (event.key.length === 1 && !event.ctrlKey && !event.metaKey && !event.altKey) next = this.findByTypeahead(items, event.key, current);
5030
5152
  if (next >= 0) {
5031
5153
  event.preventDefault();
5032
5154
  items[next]?.focus();
5033
5155
  }
5034
5156
  }
5157
+ findByTypeahead(items, key, current) {
5158
+ clearTimeout(this.typeaheadTimer);
5159
+ this.typeahead += key.toLocaleLowerCase("tr-TR");
5160
+ this.typeaheadTimer = setTimeout(() => this.typeahead = "", 500);
5161
+ for (let i = 1; i <= items.length; i++) {
5162
+ const index = (current + i) % items.length;
5163
+ if ((items[index].textContent?.trim().toLocaleLowerCase("tr-TR") ?? "").startsWith(this.typeahead)) return index;
5164
+ }
5165
+ return -1;
5166
+ }
5035
5167
  items() {
5036
5168
  return Array.from(this.host.nativeElement.querySelectorAll(".hu-dropdown__panel .hu-dropdown-item:not(:disabled)"));
5037
5169
  }
5170
+ triggerElement() {
5171
+ return this.customTrigger()?.element.nativeElement ?? this.host.nativeElement.querySelector(".hu-dropdown__trigger");
5172
+ }
5038
5173
  static ɵfac = i0.ɵɵngDeclareFactory({
5039
5174
  minVersion: "12.0.0",
5040
5175
  version: "22.2.0",
@@ -5044,41 +5179,169 @@ var HuDropdown = class HuDropdown {
5044
5179
  target: i0.ɵɵFactoryTarget.Component
5045
5180
  });
5046
5181
  static ɵcmp = i0.ɵɵngDeclareComponent({
5047
- minVersion: "17.1.0",
5182
+ minVersion: "17.0.0",
5048
5183
  version: "22.2.0",
5049
5184
  type: HuDropdown,
5050
5185
  isStandalone: true,
5051
5186
  selector: "hu-dropdown",
5052
- inputs: { align: {
5053
- classPropertyName: "align",
5054
- publicName: "align",
5055
- isSignal: true,
5056
- isRequired: false,
5057
- transformFunction: null
5058
- } },
5187
+ inputs: {
5188
+ options: {
5189
+ classPropertyName: "options",
5190
+ publicName: "options",
5191
+ isSignal: true,
5192
+ isRequired: false,
5193
+ transformFunction: null
5194
+ },
5195
+ label: {
5196
+ classPropertyName: "label",
5197
+ publicName: "label",
5198
+ isSignal: true,
5199
+ isRequired: false,
5200
+ transformFunction: null
5201
+ },
5202
+ icon: {
5203
+ classPropertyName: "icon",
5204
+ publicName: "icon",
5205
+ isSignal: true,
5206
+ isRequired: false,
5207
+ transformFunction: null
5208
+ },
5209
+ variant: {
5210
+ classPropertyName: "variant",
5211
+ publicName: "variant",
5212
+ isSignal: true,
5213
+ isRequired: false,
5214
+ transformFunction: null
5215
+ },
5216
+ color: {
5217
+ classPropertyName: "color",
5218
+ publicName: "color",
5219
+ isSignal: true,
5220
+ isRequired: false,
5221
+ transformFunction: null
5222
+ },
5223
+ size: {
5224
+ classPropertyName: "size",
5225
+ publicName: "size",
5226
+ isSignal: true,
5227
+ isRequired: false,
5228
+ transformFunction: null
5229
+ },
5230
+ caret: {
5231
+ classPropertyName: "caret",
5232
+ publicName: "caret",
5233
+ isSignal: true,
5234
+ isRequired: false,
5235
+ transformFunction: null
5236
+ },
5237
+ ariaLabel: {
5238
+ classPropertyName: "ariaLabel",
5239
+ publicName: "ariaLabel",
5240
+ isSignal: true,
5241
+ isRequired: false,
5242
+ transformFunction: null
5243
+ },
5244
+ disabled: {
5245
+ classPropertyName: "disabled",
5246
+ publicName: "disabled",
5247
+ isSignal: true,
5248
+ isRequired: false,
5249
+ transformFunction: null
5250
+ },
5251
+ align: {
5252
+ classPropertyName: "align",
5253
+ publicName: "align",
5254
+ isSignal: true,
5255
+ isRequired: false,
5256
+ transformFunction: null
5257
+ },
5258
+ open: {
5259
+ classPropertyName: "open",
5260
+ publicName: "open",
5261
+ isSignal: true,
5262
+ isRequired: false,
5263
+ transformFunction: null
5264
+ }
5265
+ },
5266
+ outputs: {
5267
+ open: "openChange",
5268
+ selected: "selected"
5269
+ },
5059
5270
  host: {
5060
5271
  listeners: {
5061
5272
  "document:click": "onDocumentClick($event)",
5062
5273
  "document:keydown.escape": "close(true)"
5063
5274
  },
5275
+ properties: { "class.hu-dropdown--open": "open()" },
5064
5276
  classAttribute: "hu-dropdown"
5065
5277
  },
5278
+ queries: [{
5279
+ propertyName: "customTrigger",
5280
+ first: true,
5281
+ predicate: HuDropdownTrigger,
5282
+ descendants: true,
5283
+ isSignal: true
5284
+ }],
5066
5285
  ngImport: i0,
5067
- template: `
5068
- <ng-content select="[huDropdownTrigger]" />
5069
- <div
5070
- class="hu-dropdown__panel"
5071
- role="menu"
5072
- [id]="panelId"
5073
- [attr.data-align]="align()"
5074
- [hidden]="!isOpen()"
5075
- (keydown)="onPanelKeydown($event)"
5076
- >
5077
- <ng-content />
5078
- </div>
5079
- `,
5080
- isInline: true,
5081
- styles: [".hu-dropdown{position:relative;display:inline-flex}.hu-dropdown__panel{position:absolute;top:calc(100% + 6px);z-index:1000;display:flex;flex-direction:column;min-width:var(--hu-dropdown-min-width, 12rem);padding:var(--hu-space-1);background:var(--hu-surface);border:1px solid var(--hu-border);border-radius:var(--hu-radius-lg);box-shadow:var(--hu-shadow-lg);animation:hu-dropdown-in .12s ease-out}.hu-dropdown__panel[hidden]{display:none}.hu-dropdown__panel[data-align=start]{left:0}.hu-dropdown__panel[data-align=end]{right:0}@keyframes hu-dropdown-in{0%{opacity:0;transform:translateY(-4px)}}\n"],
5286
+ template: "@if (!customTrigger()) {\n <button\n hu-button\n type=\"button\"\n class=\"hu-dropdown__trigger\"\n aria-haspopup=\"menu\"\n [variant]=\"variant()\"\n [color]=\"color()\"\n [size]=\"size()\"\n [iconOnly]=\"!!icon() && !label()\"\n [disabled]=\"disabled()\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-expanded]=\"open()\"\n [attr.aria-controls]=\"panelId\"\n (click)=\"toggle()\"\n (keydown)=\"onTriggerKeydown($event)\"\n >\n @if (icon()) {\n <hu-icon [name]=\"icon()!\" [size]=\"16\" />\n }\n @if (label()) {\n {{ label() }}\n @if (caret()) {\n <hu-icon class=\"hu-dropdown__caret\" name=\"chevron-down\" [size]=\"16\" />\n }\n }\n </button>\n}\n<ng-content select=\"[huDropdownTrigger]\" />\n\n<div\n class=\"hu-dropdown__panel\"\n role=\"menu\"\n [id]=\"panelId\"\n [attr.aria-label]=\"label() || ariaLabel() || null\"\n [attr.data-align]=\"align()\"\n [hidden]=\"!open()\"\n (keydown)=\"onPanelKeydown($event)\"\n>\n <ng-content select=\"[huDropdownHeader]\" />\n\n @for (entry of options(); track $index) {\n @if (isDivider(entry)) {\n <div class=\"hu-dropdown-divider\" role=\"separator\"></div>\n } @else if (isHeader(entry)) {\n <div class=\"hu-dropdown-label\" role=\"presentation\">{{ entry.header }}</div>\n } @else if (entry.link && !entry.disabled) {\n <a\n class=\"hu-dropdown-item\"\n role=\"menuitem\"\n tabindex=\"-1\"\n [class.hu-dropdown-item--danger]=\"entry.danger\"\n [routerLink]=\"entry.link\"\n (click)=\"choose(entry)\"\n >\n <ng-container *ngTemplateOutlet=\"itemContent; context: { $implicit: entry }\" />\n </a>\n } @else {\n <button\n type=\"button\"\n class=\"hu-dropdown-item\"\n role=\"menuitem\"\n tabindex=\"-1\"\n [class.hu-dropdown-item--danger]=\"entry.danger\"\n [disabled]=\"entry.disabled\"\n (click)=\"choose(entry)\"\n >\n <ng-container *ngTemplateOutlet=\"itemContent; context: { $implicit: entry }\" />\n </button>\n }\n }\n</div>\n\n<ng-template #itemContent let-entry>\n @if (entry.icon) {\n <hu-icon class=\"hu-dropdown-item__icon\" [name]=\"entry.icon\" [size]=\"16\" />\n }\n <span class=\"hu-dropdown-item__text\">\n <span class=\"hu-dropdown-item__label\">{{ entry.label }}</span>\n @if (entry.description) {\n <span class=\"hu-dropdown-item__description\">{{ entry.description }}</span>\n }\n </span>\n</ng-template>\n",
5287
+ styles: [".hu-dropdown{position:relative;display:inline-flex}.hu-dropdown__caret{margin-right:-2px;color:var(--hu-text-subtle);transition:transform var(--hu-transition)}.hu-dropdown--open .hu-dropdown__caret{transform:rotate(180deg)}.hu-dropdown__panel{position:absolute;top:calc(100% + 6px);z-index:1000;display:flex;flex-direction:column;min-width:var(--hu-dropdown-min-width, 12rem);max-width:min(var(--hu-dropdown-max-width, 24rem),100vw - 2rem);padding:var(--hu-space-1);background:var(--hu-surface);border:1px solid var(--hu-border);border-radius:var(--hu-radius-lg);box-shadow:var(--hu-shadow-lg);animation:hu-dropdown-in .12s ease-out}.hu-dropdown__panel[hidden]{display:none}.hu-dropdown__panel[data-align=start]{left:0}.hu-dropdown__panel[data-align=end]{right:0}.hu-dropdown__header{display:flex;align-items:center;justify-content:space-between;gap:var(--hu-space-3);padding:var(--hu-space-2) var(--hu-space-3)}.hu-dropdown-item{display:flex;align-items:flex-start;gap:var(--hu-space-2);width:100%;padding:var(--hu-space-2) var(--hu-space-3);font:inherit;font-size:var(--hu-text-sm);line-height:1.35;color:var(--hu-text);text-align:left;text-decoration:none;background:none;border:0;border-radius:var(--hu-radius-sm);cursor:pointer}.hu-dropdown-item:hover:not(:disabled),.hu-dropdown-item:focus-visible{outline:none;background:var(--hu-surface-3)}.hu-dropdown-item:disabled{opacity:.5;cursor:not-allowed}.hu-dropdown-item--danger,.hu-dropdown-item--danger .hu-dropdown-item__icon{color:var(--hu-danger)}.hu-dropdown-item--danger:hover:not(:disabled),.hu-dropdown-item--danger:focus-visible{background:var(--hu-danger-soft)}.hu-dropdown-item__icon{margin-top:1px;color:var(--hu-text-subtle)}.hu-dropdown-item__text{display:flex;flex-direction:column;min-width:0}.hu-dropdown-item__description{font-size:var(--hu-text-xs);color:var(--hu-text-subtle)}.hu-dropdown-divider{height:1px;margin:var(--hu-space-1) calc(var(--hu-space-1) * -1);background:var(--hu-border)}.hu-dropdown-label{padding:var(--hu-space-2) var(--hu-space-3) var(--hu-space-1);font-size:var(--hu-text-xs);font-weight:600;color:var(--hu-text-subtle)}@keyframes hu-dropdown-in{0%{opacity:0;transform:translateY(-4px)}}\n"],
5288
+ dependencies: [
5289
+ {
5290
+ kind: "directive",
5291
+ type: NgTemplateOutlet,
5292
+ selector: "[ngTemplateOutlet]",
5293
+ inputs: [
5294
+ "ngTemplateOutletContext",
5295
+ "ngTemplateOutlet",
5296
+ "ngTemplateOutletInjector"
5297
+ ]
5298
+ },
5299
+ {
5300
+ kind: "directive",
5301
+ type: RouterLink,
5302
+ selector: "[routerLink]",
5303
+ inputs: [
5304
+ "target",
5305
+ "queryParams",
5306
+ "fragment",
5307
+ "queryParamsHandling",
5308
+ "state",
5309
+ "info",
5310
+ "relativeTo",
5311
+ "preserveFragment",
5312
+ "skipLocationChange",
5313
+ "replaceUrl",
5314
+ "browserUrl",
5315
+ "routerLink"
5316
+ ]
5317
+ },
5318
+ {
5319
+ kind: "component",
5320
+ type: HuButton,
5321
+ selector: "button[hu-button], a[hu-button]",
5322
+ inputs: [
5323
+ "variant",
5324
+ "color",
5325
+ "size",
5326
+ "disabled",
5327
+ "loading",
5328
+ "block",
5329
+ "iconOnly",
5330
+ "pill"
5331
+ ]
5332
+ },
5333
+ {
5334
+ kind: "component",
5335
+ type: HuIcon,
5336
+ selector: "hu-icon",
5337
+ inputs: [
5338
+ "name",
5339
+ "size",
5340
+ "strokeWidth",
5341
+ "label"
5342
+ ]
5343
+ }
5344
+ ],
5082
5345
  changeDetection: i0.ChangeDetectionStrategy.OnPush,
5083
5346
  encapsulation: i0.ViewEncapsulation.None
5084
5347
  });
@@ -5092,127 +5355,125 @@ i0.ɵɵngDeclareClassMetadata({
5092
5355
  type: Component,
5093
5356
  args: [{
5094
5357
  selector: "hu-dropdown",
5095
- template: `
5096
- <ng-content select="[huDropdownTrigger]" />
5097
- <div
5098
- class="hu-dropdown__panel"
5099
- role="menu"
5100
- [id]="panelId"
5101
- [attr.data-align]="align()"
5102
- [hidden]="!isOpen()"
5103
- (keydown)="onPanelKeydown($event)"
5104
- >
5105
- <ng-content />
5106
- </div>
5107
- `,
5358
+ imports: [
5359
+ NgTemplateOutlet,
5360
+ RouterLink,
5361
+ HuButton,
5362
+ HuIcon
5363
+ ],
5108
5364
  host: {
5109
5365
  class: "hu-dropdown",
5366
+ "[class.hu-dropdown--open]": "open()",
5110
5367
  "(document:click)": "onDocumentClick($event)",
5111
5368
  "(document:keydown.escape)": "close(true)"
5112
5369
  },
5113
5370
  encapsulation: ViewEncapsulation.None,
5114
5371
  changeDetection: ChangeDetectionStrategy.OnPush,
5115
- styles: [".hu-dropdown{position:relative;display:inline-flex}.hu-dropdown__panel{position:absolute;top:calc(100% + 6px);z-index:1000;display:flex;flex-direction:column;min-width:var(--hu-dropdown-min-width, 12rem);padding:var(--hu-space-1);background:var(--hu-surface);border:1px solid var(--hu-border);border-radius:var(--hu-radius-lg);box-shadow:var(--hu-shadow-lg);animation:hu-dropdown-in .12s ease-out}.hu-dropdown__panel[hidden]{display:none}.hu-dropdown__panel[data-align=start]{left:0}.hu-dropdown__panel[data-align=end]{right:0}@keyframes hu-dropdown-in{0%{opacity:0;transform:translateY(-4px)}}\n"]
5372
+ template: "@if (!customTrigger()) {\n <button\n hu-button\n type=\"button\"\n class=\"hu-dropdown__trigger\"\n aria-haspopup=\"menu\"\n [variant]=\"variant()\"\n [color]=\"color()\"\n [size]=\"size()\"\n [iconOnly]=\"!!icon() && !label()\"\n [disabled]=\"disabled()\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-expanded]=\"open()\"\n [attr.aria-controls]=\"panelId\"\n (click)=\"toggle()\"\n (keydown)=\"onTriggerKeydown($event)\"\n >\n @if (icon()) {\n <hu-icon [name]=\"icon()!\" [size]=\"16\" />\n }\n @if (label()) {\n {{ label() }}\n @if (caret()) {\n <hu-icon class=\"hu-dropdown__caret\" name=\"chevron-down\" [size]=\"16\" />\n }\n }\n </button>\n}\n<ng-content select=\"[huDropdownTrigger]\" />\n\n<div\n class=\"hu-dropdown__panel\"\n role=\"menu\"\n [id]=\"panelId\"\n [attr.aria-label]=\"label() || ariaLabel() || null\"\n [attr.data-align]=\"align()\"\n [hidden]=\"!open()\"\n (keydown)=\"onPanelKeydown($event)\"\n>\n <ng-content select=\"[huDropdownHeader]\" />\n\n @for (entry of options(); track $index) {\n @if (isDivider(entry)) {\n <div class=\"hu-dropdown-divider\" role=\"separator\"></div>\n } @else if (isHeader(entry)) {\n <div class=\"hu-dropdown-label\" role=\"presentation\">{{ entry.header }}</div>\n } @else if (entry.link && !entry.disabled) {\n <a\n class=\"hu-dropdown-item\"\n role=\"menuitem\"\n tabindex=\"-1\"\n [class.hu-dropdown-item--danger]=\"entry.danger\"\n [routerLink]=\"entry.link\"\n (click)=\"choose(entry)\"\n >\n <ng-container *ngTemplateOutlet=\"itemContent; context: { $implicit: entry }\" />\n </a>\n } @else {\n <button\n type=\"button\"\n class=\"hu-dropdown-item\"\n role=\"menuitem\"\n tabindex=\"-1\"\n [class.hu-dropdown-item--danger]=\"entry.danger\"\n [disabled]=\"entry.disabled\"\n (click)=\"choose(entry)\"\n >\n <ng-container *ngTemplateOutlet=\"itemContent; context: { $implicit: entry }\" />\n </button>\n }\n }\n</div>\n\n<ng-template #itemContent let-entry>\n @if (entry.icon) {\n <hu-icon class=\"hu-dropdown-item__icon\" [name]=\"entry.icon\" [size]=\"16\" />\n }\n <span class=\"hu-dropdown-item__text\">\n <span class=\"hu-dropdown-item__label\">{{ entry.label }}</span>\n @if (entry.description) {\n <span class=\"hu-dropdown-item__description\">{{ entry.description }}</span>\n }\n </span>\n</ng-template>\n",
5373
+ styles: [".hu-dropdown{position:relative;display:inline-flex}.hu-dropdown__caret{margin-right:-2px;color:var(--hu-text-subtle);transition:transform var(--hu-transition)}.hu-dropdown--open .hu-dropdown__caret{transform:rotate(180deg)}.hu-dropdown__panel{position:absolute;top:calc(100% + 6px);z-index:1000;display:flex;flex-direction:column;min-width:var(--hu-dropdown-min-width, 12rem);max-width:min(var(--hu-dropdown-max-width, 24rem),100vw - 2rem);padding:var(--hu-space-1);background:var(--hu-surface);border:1px solid var(--hu-border);border-radius:var(--hu-radius-lg);box-shadow:var(--hu-shadow-lg);animation:hu-dropdown-in .12s ease-out}.hu-dropdown__panel[hidden]{display:none}.hu-dropdown__panel[data-align=start]{left:0}.hu-dropdown__panel[data-align=end]{right:0}.hu-dropdown__header{display:flex;align-items:center;justify-content:space-between;gap:var(--hu-space-3);padding:var(--hu-space-2) var(--hu-space-3)}.hu-dropdown-item{display:flex;align-items:flex-start;gap:var(--hu-space-2);width:100%;padding:var(--hu-space-2) var(--hu-space-3);font:inherit;font-size:var(--hu-text-sm);line-height:1.35;color:var(--hu-text);text-align:left;text-decoration:none;background:none;border:0;border-radius:var(--hu-radius-sm);cursor:pointer}.hu-dropdown-item:hover:not(:disabled),.hu-dropdown-item:focus-visible{outline:none;background:var(--hu-surface-3)}.hu-dropdown-item:disabled{opacity:.5;cursor:not-allowed}.hu-dropdown-item--danger,.hu-dropdown-item--danger .hu-dropdown-item__icon{color:var(--hu-danger)}.hu-dropdown-item--danger:hover:not(:disabled),.hu-dropdown-item--danger:focus-visible{background:var(--hu-danger-soft)}.hu-dropdown-item__icon{margin-top:1px;color:var(--hu-text-subtle)}.hu-dropdown-item__text{display:flex;flex-direction:column;min-width:0}.hu-dropdown-item__description{font-size:var(--hu-text-xs);color:var(--hu-text-subtle)}.hu-dropdown-divider{height:1px;margin:var(--hu-space-1) calc(var(--hu-space-1) * -1);background:var(--hu-border)}.hu-dropdown-label{padding:var(--hu-space-2) var(--hu-space-3) var(--hu-space-1);font-size:var(--hu-text-xs);font-weight:600;color:var(--hu-text-subtle)}@keyframes hu-dropdown-in{0%{opacity:0;transform:translateY(-4px)}}\n"]
5116
5374
  }]
5117
5375
  }],
5118
- propDecorators: { align: [{
5119
- type: i0.Input,
5120
- args: [{
5121
- isSignal: true,
5122
- alias: "align",
5123
- required: false
5124
- }]
5125
- }] }
5126
- });
5127
- var HuDropdownTrigger = class HuDropdownTrigger {
5128
- menu = inject(HuDropdown);
5129
- static ɵfac = i0.ɵɵngDeclareFactory({
5130
- minVersion: "12.0.0",
5131
- version: "22.2.0",
5132
- ngImport: i0,
5133
- type: HuDropdownTrigger,
5134
- deps: [],
5135
- target: i0.ɵɵFactoryTarget.Directive
5136
- });
5137
- static ɵdir = i0.ɵɵngDeclareDirective({
5138
- minVersion: "14.0.0",
5139
- version: "22.2.0",
5140
- type: HuDropdownTrigger,
5141
- isStandalone: true,
5142
- selector: "[huDropdownTrigger]",
5143
- host: {
5144
- attributes: { "aria-haspopup": "menu" },
5145
- listeners: { "click": "menu.toggle()" },
5146
- properties: {
5147
- "attr.aria-expanded": "menu.isOpen()",
5148
- "attr.aria-controls": "menu.panelId"
5149
- }
5150
- },
5151
- ngImport: i0
5152
- });
5153
- };
5154
- i0.ɵɵngDeclareClassMetadata({
5155
- minVersion: "12.0.0",
5156
- version: "22.2.0",
5157
- ngImport: i0,
5158
- type: HuDropdownTrigger,
5159
- decorators: [{
5160
- type: Directive,
5161
- args: [{
5162
- selector: "[huDropdownTrigger]",
5163
- host: {
5164
- "aria-haspopup": "menu",
5165
- "[attr.aria-expanded]": "menu.isOpen()",
5166
- "[attr.aria-controls]": "menu.panelId",
5167
- "(click)": "menu.toggle()"
5168
- }
5169
- }]
5170
- }]
5171
- });
5172
- var HuDropdownItem = class HuDropdownItem {
5173
- menu = inject(HuDropdown);
5174
- static ɵfac = i0.ɵɵngDeclareFactory({
5175
- minVersion: "12.0.0",
5176
- version: "22.2.0",
5177
- ngImport: i0,
5178
- type: HuDropdownItem,
5179
- deps: [],
5180
- target: i0.ɵɵFactoryTarget.Directive
5181
- });
5182
- static ɵdir = i0.ɵɵngDeclareDirective({
5183
- minVersion: "14.0.0",
5184
- version: "22.2.0",
5185
- type: HuDropdownItem,
5186
- isStandalone: true,
5187
- selector: "[huDropdownItem]",
5188
- host: {
5189
- attributes: {
5190
- "role": "menuitem",
5191
- "tabindex": "-1"
5192
- },
5193
- listeners: { "click": "menu.close()" },
5194
- classAttribute: "hu-dropdown-item"
5195
- },
5196
- ngImport: i0
5197
- });
5198
- };
5199
- i0.ɵɵngDeclareClassMetadata({
5200
- minVersion: "12.0.0",
5201
- version: "22.2.0",
5202
- ngImport: i0,
5203
- type: HuDropdownItem,
5204
- decorators: [{
5205
- type: Directive,
5206
- args: [{
5207
- selector: "[huDropdownItem]",
5208
- host: {
5209
- class: "hu-dropdown-item",
5210
- role: "menuitem",
5211
- tabindex: "-1",
5212
- "(click)": "menu.close()"
5213
- }
5376
+ propDecorators: {
5377
+ options: [{
5378
+ type: i0.Input,
5379
+ args: [{
5380
+ isSignal: true,
5381
+ alias: "options",
5382
+ required: false
5383
+ }]
5384
+ }],
5385
+ label: [{
5386
+ type: i0.Input,
5387
+ args: [{
5388
+ isSignal: true,
5389
+ alias: "label",
5390
+ required: false
5391
+ }]
5392
+ }],
5393
+ icon: [{
5394
+ type: i0.Input,
5395
+ args: [{
5396
+ isSignal: true,
5397
+ alias: "icon",
5398
+ required: false
5399
+ }]
5400
+ }],
5401
+ variant: [{
5402
+ type: i0.Input,
5403
+ args: [{
5404
+ isSignal: true,
5405
+ alias: "variant",
5406
+ required: false
5407
+ }]
5408
+ }],
5409
+ color: [{
5410
+ type: i0.Input,
5411
+ args: [{
5412
+ isSignal: true,
5413
+ alias: "color",
5414
+ required: false
5415
+ }]
5416
+ }],
5417
+ size: [{
5418
+ type: i0.Input,
5419
+ args: [{
5420
+ isSignal: true,
5421
+ alias: "size",
5422
+ required: false
5423
+ }]
5424
+ }],
5425
+ caret: [{
5426
+ type: i0.Input,
5427
+ args: [{
5428
+ isSignal: true,
5429
+ alias: "caret",
5430
+ required: false
5431
+ }]
5432
+ }],
5433
+ ariaLabel: [{
5434
+ type: i0.Input,
5435
+ args: [{
5436
+ isSignal: true,
5437
+ alias: "ariaLabel",
5438
+ required: false
5439
+ }]
5440
+ }],
5441
+ disabled: [{
5442
+ type: i0.Input,
5443
+ args: [{
5444
+ isSignal: true,
5445
+ alias: "disabled",
5446
+ required: false
5447
+ }]
5448
+ }],
5449
+ align: [{
5450
+ type: i0.Input,
5451
+ args: [{
5452
+ isSignal: true,
5453
+ alias: "align",
5454
+ required: false
5455
+ }]
5456
+ }],
5457
+ open: [{
5458
+ type: i0.Input,
5459
+ args: [{
5460
+ isSignal: true,
5461
+ alias: "open",
5462
+ required: false
5463
+ }]
5464
+ }, {
5465
+ type: i0.Output,
5466
+ args: ["openChange"]
5467
+ }],
5468
+ selected: [{
5469
+ type: i0.Output,
5470
+ args: ["selected"]
5471
+ }],
5472
+ customTrigger: [{
5473
+ type: i0.ContentChild,
5474
+ args: [i0.forwardRef(() => HuDropdownTrigger), { isSignal: true }]
5214
5475
  }]
5215
- }]
5476
+ }
5216
5477
  });
5217
5478
  var HuSidebarNav = class HuSidebarNav {
5218
5479
  router = inject(Router);
@@ -5847,7 +6108,7 @@ const HU_DIALOG_IMPORTS = [HuDialog, HuDialogFooter];
5847
6108
  const HU_DROPDOWN_IMPORTS = [
5848
6109
  HuDropdown,
5849
6110
  HuDropdownTrigger,
5850
- HuDropdownItem
6111
+ HuDropdownHeaderSlot
5851
6112
  ];
5852
6113
  const HU_TABLE_IMPORTS = [HuTable, HuCellDef];
5853
6114
  const HU_TABS_IMPORTS = [HuTabs, HuTab];
@@ -5858,6 +6119,6 @@ const HU_SHELL_IMPORTS = [
5858
6119
  HuSidebarFooter,
5859
6120
  HuShellLogo
5860
6121
  ];
5861
- export { HU_BUILTIN_ICONS, HU_CARD_IMPORTS, HU_DEFAULT_ERROR_MESSAGES, HU_DIALOG_IMPORTS, HU_DROPDOWN_IMPORTS, HU_ERROR_MESSAGES, HU_FORM_FIELD, HU_FORM_FIELD_IMPORTS, HU_ICON_SETS, HU_SHELL_IMPORTS, HU_STATUS_ICONS, HU_TABLE_IMPORTS, HU_TABS_IMPORTS, HuAlert, HuAvatar, HuBadge, HuBreadcrumb, HuButton, HuButtonGroup, HuCalendar, HuCard, HuCardActions, HuCardFooter, HuCellDef, HuCheckbox, HuDatePicker, HuDialog, HuDialogFooter, HuDropdown, HuDropdownItem, HuDropdownTrigger, HuFormField, HuFormFieldControl, HuIcon, HuInput, HuPaginator, HuPrefix, HuShell, HuShellLogo, HuSidebarFooter, HuSidebarNav, HuSpinner, HuSuffix, HuSwitch, HuTab, HuTable, HuTabs, HuThemeService, HuThemeToggle, HuToastService, HuToaster, HuTopbarEnd, HuTopbarStart, addDays, addMonths, clampDate, compareDays, daysInMonth, formatDate, formatRange, huMediaQuery, huUniqueId, isSameDay, isSameMonth, isValidDate, parseDate, parseRange, provideHuErrorMessages, provideHuIcons, startOfDay, startOfWeek };
6122
+ export { HU_BUILTIN_ICONS, HU_CARD_IMPORTS, HU_DEFAULT_ERROR_MESSAGES, HU_DIALOG_IMPORTS, HU_DROPDOWN_IMPORTS, HU_ERROR_MESSAGES, HU_FORM_FIELD, HU_FORM_FIELD_IMPORTS, HU_ICON_SETS, HU_SHELL_IMPORTS, HU_STATUS_ICONS, HU_TABLE_IMPORTS, HU_TABS_IMPORTS, HuAlert, HuAvatar, HuBadge, HuBreadcrumb, HuButton, HuButtonGroup, HuCalendar, HuCard, HuCardActions, HuCardFooter, HuCellDef, HuCheckbox, HuDatePicker, HuDialog, HuDialogFooter, HuDropdown, HuDropdownHeaderSlot, HuDropdownTrigger, HuFormField, HuFormFieldControl, HuIcon, HuInput, HuPaginator, HuPrefix, HuShell, HuShellLogo, HuSidebarFooter, HuSidebarNav, HuSpinner, HuSuffix, HuSwitch, HuTab, HuTable, HuTabs, HuThemeService, HuThemeToggle, HuToastService, HuToaster, HuTopbarEnd, HuTopbarStart, addDays, addMonths, clampDate, compareDays, daysInMonth, formatDate, formatRange, huMediaQuery, huUniqueId, isDropdownDivider, isDropdownHeader, isSameDay, isSameMonth, isValidDate, parseDate, parseRange, provideHuErrorMessages, provideHuIcons, startOfDay, startOfWeek };
5862
6123
 
5863
6124
  //# sourceMappingURL=ucme-ui-angular.mjs.map