@ucme-ui/angular 0.8.3 → 0.10.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.
@@ -5853,6 +5853,29 @@ function readAsDataUrl(file) {
5853
5853
  reader.readAsDataURL(file);
5854
5854
  });
5855
5855
  }
5856
+ function huMatchesAccept(file, accept) {
5857
+ const rules = accept.split(",").map((r) => r.trim().toLowerCase()).filter(Boolean);
5858
+ if (!rules.length) return true;
5859
+ const name = file.name.toLowerCase();
5860
+ const type = file.type.toLowerCase();
5861
+ return rules.some((rule) => {
5862
+ if (rule.startsWith(".")) return name.endsWith(rule);
5863
+ if (rule.endsWith("/*")) return type.startsWith(rule.slice(0, -1));
5864
+ return type === rule;
5865
+ });
5866
+ }
5867
+ function huDragHasFiles(event) {
5868
+ return !!event.dataTransfer?.types.includes("Files");
5869
+ }
5870
+ function huFileIcon(name, type = "") {
5871
+ if (type.startsWith("image/") || /\.(png|jpe?g|gif|webp|avif|svg)$/i.test(name)) return "file-image";
5872
+ if (/zip|rar|7z|tar|gzip/.test(type) || /\.(zip|rar|7z|tar|gz)$/i.test(name)) return "file-archive";
5873
+ if (/pdf|word|document|text|sheet|excel|presentation/.test(type) || /\.(pdf|docx?|xlsx?|pptx?|odt|txt|csv)$/i.test(name)) return "file-text";
5874
+ return "file";
5875
+ }
5876
+ function huAcceptLabel(accept) {
5877
+ return accept.split(",").map((a) => a.trim()).filter(Boolean).map((a) => a.startsWith(".") ? a.slice(1).toUpperCase() : a === "image/*" ? "Görseller" : a).join(", ");
5878
+ }
5856
5879
  const EMPTY_META = {
5857
5880
  preview: null,
5858
5881
  status: "idle",
@@ -5905,8 +5928,8 @@ var HuFileUpload = class HuFileUpload {
5905
5928
  const hint = this.hint();
5906
5929
  if (hint !== void 0) return hint;
5907
5930
  const parts = [];
5908
- const accept = this.accept().split(",").map((a) => a.trim()).filter(Boolean).map((a) => a.startsWith(".") ? a.slice(1).toUpperCase() : a === "image/*" ? "Görseller" : a);
5909
- if (accept.length) parts.push(accept.join(", "));
5931
+ const accept = huAcceptLabel(this.accept());
5932
+ if (accept) parts.push(accept);
5910
5933
  const max = this.maxFileSize();
5911
5934
  if (max) parts.push(`en fazla ${formatFileSize(max)}`);
5912
5935
  if (this.multiple() && this.maxFiles()) parts.push(`en fazla ${this.maxFiles()} dosya`);
@@ -5949,13 +5972,13 @@ var HuFileUpload = class HuFileUpload {
5949
5972
  input.value = "";
5950
5973
  }
5951
5974
  onDragEnter(event) {
5952
- if (this.isDisabled() || !hasFiles(event)) return;
5975
+ if (this.isDisabled() || !huDragHasFiles(event)) return;
5953
5976
  event.preventDefault();
5954
5977
  this.dragDepth++;
5955
5978
  this.dragging.set(true);
5956
5979
  }
5957
5980
  onDragOver(event) {
5958
- if (this.isDisabled() || !hasFiles(event)) return;
5981
+ if (this.isDisabled() || !huDragHasFiles(event)) return;
5959
5982
  event.preventDefault();
5960
5983
  if (event.dataTransfer) event.dataTransfer.dropEffect = "copy";
5961
5984
  }
@@ -5995,10 +6018,7 @@ var HuFileUpload = class HuFileUpload {
5995
6018
  }
5996
6019
  formatSize = formatFileSize;
5997
6020
  iconFor(file) {
5998
- if (file.type.startsWith("image/")) return "file-image";
5999
- if (/zip|rar|7z|tar|gzip/.test(file.type) || /\.(zip|rar|7z|tar|gz)$/i.test(file.name)) return "file-archive";
6000
- if (/pdf|word|document|text|sheet|excel|presentation/.test(file.type)) return "file-text";
6001
- return "file";
6021
+ return huFileIcon(file.name, file.type);
6002
6022
  }
6003
6023
  add(incoming) {
6004
6024
  if (!incoming.length) return;
@@ -6006,7 +6026,7 @@ var HuFileUpload = class HuFileUpload {
6006
6026
  const rejections = [];
6007
6027
  const accepted = [];
6008
6028
  const max = this.maxFileSize();
6009
- for (const file of incoming) if (!matchesAccept(file, this.accept())) rejections.push({
6029
+ for (const file of incoming) if (!huMatchesAccept(file, this.accept())) rejections.push({
6010
6030
  file,
6011
6031
  reason: "type",
6012
6032
  message: `${file.name}: bu dosya türü kabul edilmiyor.`
@@ -6416,223 +6436,158 @@ function formatFileSize(bytes) {
6416
6436
  }
6417
6437
  return `${value.toLocaleString("tr-TR", { maximumFractionDigits: value < 10 ? 1 : 0 })} ${units[unit]}`;
6418
6438
  }
6419
- function matchesAccept(file, accept) {
6420
- const rules = accept.split(",").map((r) => r.trim().toLowerCase()).filter(Boolean);
6421
- if (!rules.length) return true;
6422
- const name = file.name.toLowerCase();
6423
- const type = file.type.toLowerCase();
6424
- return rules.some((rule) => {
6425
- if (rule.startsWith(".")) return name.endsWith(rule);
6426
- if (rule.endsWith("/*")) return type.startsWith(rule.slice(0, -1));
6427
- return type === rule;
6428
- });
6429
- }
6430
- function hasFiles(event) {
6431
- return !!event.dataTransfer?.types.includes("Files");
6432
- }
6433
- const optionalNumber = (v) => v == null || v === "" ? null : numberAttribute(v);
6434
- var HuInputNumber = class HuInputNumber {
6439
+ var HuFileInput = class HuFileInput {
6435
6440
  injector = inject(Injector);
6436
6441
  field = inject(HU_FORM_FIELD, {
6437
6442
  optional: true,
6438
6443
  host: true
6439
6444
  });
6440
6445
  value = model(null, ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
6441
- min = input(null, {
6442
- ...ngDevMode ? { debugName: "min" } : /* istanbul ignore next */ {},
6443
- transform: optionalNumber
6444
- });
6445
- max = input(null, {
6446
- ...ngDevMode ? { debugName: "max" } : /* istanbul ignore next */ {},
6447
- transform: optionalNumber
6448
- });
6449
- step = input(1, {
6450
- ...ngDevMode ? { debugName: "step" } : /* istanbul ignore next */ {},
6451
- transform: numberAttribute
6452
- });
6453
- mode = input("decimal", ...ngDevMode ? [{ debugName: "mode" }] : /* istanbul ignore next */ []);
6454
- currency = input("TRY", ...ngDevMode ? [{ debugName: "currency" }] : /* istanbul ignore next */ []);
6455
- minFractionDigits = input(null, {
6456
- ...ngDevMode ? { debugName: "minFractionDigits" } : /* istanbul ignore next */ {},
6457
- transform: optionalNumber
6458
- });
6459
- maxFractionDigits = input(null, {
6460
- ...ngDevMode ? { debugName: "maxFractionDigits" } : /* istanbul ignore next */ {},
6461
- transform: optionalNumber
6446
+ label = input(...ngDevMode ? [void 0, { debugName: "label" }] : /* istanbul ignore next */ []);
6447
+ required = input(false, {
6448
+ ...ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {},
6449
+ transform: booleanAttribute
6462
6450
  });
6463
- useGrouping = input(true, {
6464
- ...ngDevMode ? { debugName: "useGrouping" } : /* istanbul ignore next */ {},
6451
+ hint = input(...ngDevMode ? [void 0, { debugName: "hint" }] : /* istanbul ignore next */ []);
6452
+ placeholder = input("Dosya seçilmedi", ...ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []);
6453
+ accept = input("", ...ngDevMode ? [{ debugName: "accept" }] : /* istanbul ignore next */ []);
6454
+ maxFileSize = input(null, ...ngDevMode ? [{ debugName: "maxFileSize" }] : /* istanbul ignore next */ []);
6455
+ uploader = input(null, ...ngDevMode ? [{ debugName: "uploader" }] : /* istanbul ignore next */ []);
6456
+ removable = input(true, {
6457
+ ...ngDevMode ? { debugName: "removable" } : /* istanbul ignore next */ {},
6465
6458
  transform: booleanAttribute
6466
6459
  });
6467
- prefix = input(...ngDevMode ? [void 0, { debugName: "prefix" }] : /* istanbul ignore next */ []);
6468
- suffix = input(...ngDevMode ? [void 0, { debugName: "suffix" }] : /* istanbul ignore next */ []);
6469
- buttons = input("none", ...ngDevMode ? [{ debugName: "buttons" }] : /* istanbul ignore next */ []);
6470
- placeholder = input(...ngDevMode ? [void 0, { debugName: "placeholder" }] : /* istanbul ignore next */ []);
6471
- size = input("md", ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
6460
+ browseLabel = input("Dosya seç", ...ngDevMode ? [{ debugName: "browseLabel" }] : /* istanbul ignore next */ []);
6461
+ changeLabel = input("Değiştir", ...ngDevMode ? [{ debugName: "changeLabel" }] : /* istanbul ignore next */ []);
6472
6462
  disabled = input(false, {
6473
6463
  ...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
6474
6464
  transform: booleanAttribute
6475
6465
  });
6476
- readonly = input(false, {
6477
- ...ngDevMode ? { debugName: "readonly" } : /* istanbul ignore next */ {},
6478
- transform: booleanAttribute
6479
- });
6480
- ariaLabel = input(...ngDevMode ? [void 0, { debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
6481
- id = input(huUniqueId("hu-input-number"), ...ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []);
6482
- text = signal("", ...ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []);
6466
+ id = input(huUniqueId("hu-file-input"), ...ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []);
6467
+ rejected = output();
6468
+ uploaded = output();
6469
+ uploadError = output();
6470
+ removed = output();
6471
+ dragging = signal(false, ...ngDevMode ? [{ debugName: "dragging" }] : /* istanbul ignore next */ []);
6472
+ message = signal(null, ...ngDevMode ? [{ debugName: "message" }] : /* istanbul ignore next */ []);
6473
+ status = signal("idle", ...ngDevMode ? [{ debugName: "status" }] : /* istanbul ignore next */ []);
6474
+ progress = signal(0, ...ngDevMode ? [{ debugName: "progress" }] : /* istanbul ignore next */ []);
6483
6475
  formDisabled = signal(false, ...ngDevMode ? [{ debugName: "formDisabled" }] : /* istanbul ignore next */ []);
6484
6476
  isDisabled = computed(() => this.disabled() || this.formDisabled(), ...ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []);
6485
- fraction = computed(() => {
6486
- const currency = this.mode() === "currency";
6487
- const max = this.maxFractionDigits() ?? (currency ? 2 : 0);
6477
+ labelId = computed(() => `${this.id()}-label`, ...ngDevMode ? [{ debugName: "labelId" }] : /* istanbul ignore next */ []);
6478
+ hintId = computed(() => `${this.id()}-hint`, ...ngDevMode ? [{ debugName: "hintId" }] : /* istanbul ignore next */ []);
6479
+ messageId = computed(() => `${this.id()}-message`, ...ngDevMode ? [{ debugName: "messageId" }] : /* istanbul ignore next */ []);
6480
+ display = computed(() => {
6481
+ const v = this.value();
6482
+ if (!v) return null;
6483
+ const local = v instanceof File;
6488
6484
  return {
6489
- min: Math.min(this.minFractionDigits() ?? (currency ? 2 : 0), max),
6490
- max
6485
+ name: v.name,
6486
+ size: v.size ?? null,
6487
+ url: local ? null : v.url ?? null,
6488
+ icon: huFileIcon(v.name, local ? v.type : ""),
6489
+ stored: !local
6491
6490
  };
6492
- }, ...ngDevMode ? [{ debugName: "fraction" }] : /* istanbul ignore next */ []);
6493
- prefixText = computed(() => {
6494
- if (this.prefix()) return this.prefix();
6495
- if (this.mode() !== "currency") return void 0;
6496
- try {
6497
- return new Intl.NumberFormat("tr-TR", {
6498
- style: "currency",
6499
- currency: this.currency()
6500
- }).formatToParts(0).find((p) => p.type === "currency")?.value;
6501
- } catch {
6502
- return this.currency();
6503
- }
6504
- }, ...ngDevMode ? [{ debugName: "prefixText" }] : /* istanbul ignore next */ []);
6505
- canDecrement = computed(() => {
6506
- const v = this.value();
6507
- const min = this.min();
6508
- return !this.isDisabled() && !this.readonly() && (v == null || min == null || v > min);
6509
- }, ...ngDevMode ? [{ debugName: "canDecrement" }] : /* istanbul ignore next */ []);
6510
- canIncrement = computed(() => {
6511
- const v = this.value();
6512
- const max = this.max();
6513
- return !this.isDisabled() && !this.readonly() && (v == null || max == null || v < max);
6514
- }, ...ngDevMode ? [{ debugName: "canIncrement" }] : /* istanbul ignore next */ []);
6491
+ }, ...ngDevMode ? [{ debugName: "display" }] : /* istanbul ignore next */ []);
6492
+ hintText = computed(() => {
6493
+ const hint = this.hint();
6494
+ if (hint !== void 0) return hint;
6495
+ const parts = [];
6496
+ const accept = huAcceptLabel(this.accept());
6497
+ if (accept) parts.push(accept);
6498
+ const max = this.maxFileSize();
6499
+ if (max) parts.push(`en fazla ${formatFileSize(max)}`);
6500
+ return parts.join(" · ");
6501
+ }, ...ngDevMode ? [{ debugName: "hintText" }] : /* istanbul ignore next */ []);
6502
+ describedBy = computed(() => {
6503
+ return [
6504
+ this.field?.describedBy(),
6505
+ this.hintText() ? this.hintId() : null,
6506
+ this.message() ? this.messageId() : null
6507
+ ].filter(Boolean).join(" ") || null;
6508
+ }, ...ngDevMode ? [{ debugName: "describedBy" }] : /* istanbul ignore next */ []);
6509
+ formatSize = formatFileSize;
6510
+ input = viewChild.required("input", ...ngDevMode ? [{ debugName: "input" }] : /* istanbul ignore next */ []);
6511
+ browseButton = viewChild("browseButton", {
6512
+ ...ngDevMode ? { debugName: "browseButton" } : /* istanbul ignore next */ {},
6513
+ read: ElementRef
6514
+ });
6515
+ dragDepth = 0;
6516
+ uploading = null;
6517
+ onChange = () => {};
6518
+ onTouched = () => {};
6515
6519
  ngControl;
6516
6520
  get hasControl() {
6517
6521
  return !!this.resolveControl();
6518
6522
  }
6519
6523
  controlErrorVisible = signal(false, ...ngDevMode ? [{ debugName: "controlErrorVisible" }] : /* istanbul ignore next */ []);
6520
6524
  errors = signal(null, ...ngDevMode ? [{ debugName: "errors" }] : /* istanbul ignore next */ []);
6521
- isInvalid = computed(() => this.controlErrorVisible() || (this.field?.showError() ?? false), ...ngDevMode ? [{ debugName: "isInvalid" }] : /* istanbul ignore next */ []);
6522
- input = viewChild.required("input", ...ngDevMode ? [{ debugName: "input" }] : /* istanbul ignore next */ []);
6523
- focused = false;
6524
- repeatTimer;
6525
- onChange = () => {};
6526
- onTouched = () => {};
6527
- onValidatorChange = () => {};
6528
- constructor() {
6529
- effect(() => {
6530
- const value = this.value();
6531
- this.fraction();
6532
- this.useGrouping();
6533
- untracked(() => {
6534
- if (!this.focused || parseNumber(this.text()) !== value) this.text.set(this.format(value));
6535
- });
6536
- });
6537
- effect(() => {
6538
- this.min();
6539
- this.max();
6540
- untracked(() => this.onValidatorChange());
6541
- });
6542
- inject(DestroyRef).onDestroy(() => this.stopRepeat());
6543
- }
6525
+ isInvalid = computed(() => this.controlErrorVisible() || (this.field?.showError() ?? false) || !!this.message() || this.status() === "error", ...ngDevMode ? [{ debugName: "isInvalid" }] : /* istanbul ignore next */ []);
6544
6526
  ngDoCheck() {
6545
6527
  const c = this.resolveControl();
6546
6528
  if (!c) return;
6547
6529
  this.controlErrorVisible.set(!!c.invalid && !!(c.touched || c.dirty));
6548
6530
  this.errors.set(c.errors);
6549
6531
  }
6550
- spin(direction, multiplier = 1) {
6551
- if (this.isDisabled() || this.readonly()) return;
6552
- const current = this.value() ?? (direction > 0 ? (this.min() ?? 0) - this.step() : (this.max() ?? 0) + this.step());
6553
- const next = this.round(current + direction * this.step() * multiplier);
6554
- this.commit(this.clamp(next));
6532
+ browse() {
6533
+ if (!this.isDisabled()) this.input().nativeElement.click();
6555
6534
  }
6556
- onFocus() {
6557
- this.focused = true;
6535
+ clear() {
6536
+ this.setValue(null);
6537
+ this.message.set(null);
6558
6538
  }
6559
- onBlur() {
6560
- this.focused = false;
6561
- const parsed = parseNumber(this.text());
6562
- this.commit(parsed == null ? null : this.clamp(this.round(parsed)));
6563
- this.onTouched();
6539
+ onInputChange(event) {
6540
+ const input = event.target;
6541
+ const file = input.files?.[0];
6542
+ input.value = "";
6543
+ if (file) this.pick(file);
6564
6544
  }
6565
- onKeydown(event) {
6566
- const multiplier = event.shiftKey ? 10 : 1;
6567
- switch (event.key) {
6568
- case "ArrowUp":
6569
- event.preventDefault();
6570
- return this.spin(1, multiplier);
6571
- case "ArrowDown":
6572
- event.preventDefault();
6573
- return this.spin(-1, multiplier);
6574
- case "Home":
6575
- if (this.min() != null) {
6576
- event.preventDefault();
6577
- this.commit(this.min());
6578
- }
6579
- return;
6580
- case "End":
6581
- if (this.max() != null) {
6582
- event.preventDefault();
6583
- this.commit(this.max());
6584
- }
6585
- return;
6586
- case "Enter":
6587
- this.onBlur();
6588
- this.focused = true;
6589
- return;
6590
- case ".":
6591
- case "Decimal":
6592
- if (this.fraction().max > 0 && !event.ctrlKey && !event.metaKey) {
6593
- event.preventDefault();
6594
- this.insertText(",");
6595
- }
6596
- return;
6597
- }
6545
+ onDragEnter(event) {
6546
+ if (this.isDisabled() || !huDragHasFiles(event)) return;
6547
+ event.preventDefault();
6548
+ this.dragDepth++;
6549
+ this.dragging.set(true);
6598
6550
  }
6599
- onInput(event) {
6600
- const el = event.target;
6601
- const caret = el.selectionStart ?? el.value.length;
6602
- const before = significant(el.value.slice(0, caret));
6603
- const formatted = this.formatLive(el.value);
6604
- el.value = formatted;
6605
- this.text.set(formatted);
6606
- const pos = positionAfter(formatted, before);
6607
- el.setSelectionRange(pos, pos);
6608
- const parsed = parseNumber(formatted);
6609
- if (parsed !== this.value()) {
6610
- this.value.set(parsed);
6611
- this.onChange(parsed);
6612
- }
6551
+ onDragOver(event) {
6552
+ if (this.isDisabled() || !huDragHasFiles(event)) return;
6553
+ event.preventDefault();
6554
+ if (event.dataTransfer) event.dataTransfer.dropEffect = "copy";
6613
6555
  }
6614
- startRepeat(direction, event) {
6615
- if (event.button !== 0) return;
6556
+ onDragLeave() {
6557
+ this.dragDepth = Math.max(0, this.dragDepth - 1);
6558
+ if (!this.dragDepth) this.dragging.set(false);
6559
+ }
6560
+ onDrop(event) {
6561
+ if (!huDragHasFiles(event)) return;
6616
6562
  event.preventDefault();
6617
- this.input().nativeElement.focus({ preventScroll: true });
6618
- this.spin(direction);
6619
- const repeat = (delay) => {
6620
- this.repeatTimer = setTimeout(() => {
6621
- this.spin(direction);
6622
- repeat(Math.max(40, delay * .85));
6623
- }, delay);
6624
- };
6625
- this.stopRepeat();
6626
- this.repeatTimer = setTimeout(() => repeat(80), 400);
6563
+ this.dragDepth = 0;
6564
+ this.dragging.set(false);
6565
+ if (this.isDisabled()) return;
6566
+ const file = event.dataTransfer?.files[0];
6567
+ if (file) this.pick(file);
6627
6568
  }
6628
- stopRepeat() {
6629
- clearTimeout(this.repeatTimer);
6630
- this.repeatTimer = void 0;
6569
+ remove() {
6570
+ const current = this.value();
6571
+ if (this.isDisabled() || !current) return;
6572
+ this.onTouched();
6573
+ this.clear();
6574
+ this.removed.emit(current);
6575
+ queueMicrotask(() => this.browseButton()?.nativeElement.focus());
6576
+ }
6577
+ retry() {
6578
+ const v = this.value();
6579
+ if (v instanceof File) this.upload(v);
6580
+ }
6581
+ onBoxClick(event) {
6582
+ if (!event.target.closest("button, a")) this.browse();
6583
+ }
6584
+ onBlur(event) {
6585
+ if (!event.currentTarget.closest(".hu-file-input")?.contains(event.relatedTarget)) this.onTouched();
6631
6586
  }
6632
6587
  writeValue(value) {
6633
- const n = value == null || value === "" ? null : Number(value);
6634
- this.value.set(n == null || Number.isNaN(n) ? null : n);
6635
- this.text.set(this.format(this.value()));
6588
+ this.value.set(isFileValue(value) ? value : null);
6589
+ this.resetStatus();
6590
+ this.message.set(null);
6636
6591
  }
6637
6592
  registerOnChange(fn) {
6638
6593
  this.onChange = fn;
@@ -6643,70 +6598,66 @@ var HuInputNumber = class HuInputNumber {
6643
6598
  setDisabledState(disabled) {
6644
6599
  this.formDisabled.set(disabled);
6645
6600
  }
6646
- validate(_control) {
6647
- const v = this.value();
6648
- if (v == null) return null;
6649
- const min = this.min();
6650
- const max = this.max();
6651
- if (min != null && v < min) return { min: {
6652
- min,
6653
- actual: v
6654
- } };
6655
- if (max != null && v > max) return { max: {
6656
- max,
6657
- actual: v
6658
- } };
6659
- return null;
6601
+ pick(file) {
6602
+ this.onTouched();
6603
+ const max = this.maxFileSize();
6604
+ let rejection = null;
6605
+ if (!huMatchesAccept(file, this.accept())) {
6606
+ const accept = huAcceptLabel(this.accept());
6607
+ rejection = {
6608
+ file,
6609
+ reason: "type",
6610
+ message: `${file.name}: bu dosya türü kabul edilmiyor${accept ? ` (${accept})` : ""}.`
6611
+ };
6612
+ } else if (max && file.size > max) rejection = {
6613
+ file,
6614
+ reason: "size",
6615
+ message: `${file.name}: en fazla ${formatFileSize(max)} olabilir.`
6616
+ };
6617
+ if (rejection) {
6618
+ this.message.set(rejection.message);
6619
+ this.rejected.emit(rejection);
6620
+ return;
6621
+ }
6622
+ this.message.set(null);
6623
+ this.setValue(file);
6624
+ if (this.uploader()) this.upload(file);
6660
6625
  }
6661
- registerOnValidatorChange(fn) {
6662
- this.onValidatorChange = fn;
6626
+ async upload(file) {
6627
+ const uploader = this.uploader();
6628
+ if (!uploader) return;
6629
+ this.uploading = file;
6630
+ this.status.set("uploading");
6631
+ this.progress.set(0);
6632
+ try {
6633
+ const result = await uploader(file, (p) => {
6634
+ if (this.uploading === file) this.progress.set(Math.max(0, Math.min(100, Math.round(p))));
6635
+ });
6636
+ if (this.uploading !== file) return;
6637
+ this.status.set("done");
6638
+ this.progress.set(100);
6639
+ this.uploaded.emit({
6640
+ file,
6641
+ result
6642
+ });
6643
+ } catch (error) {
6644
+ if (this.uploading !== file) return;
6645
+ this.status.set("error");
6646
+ this.uploadError.emit({
6647
+ file,
6648
+ error
6649
+ });
6650
+ }
6663
6651
  }
6664
- commit(value) {
6665
- this.text.set(this.format(value));
6666
- const el = this.input().nativeElement;
6667
- if (el.value !== this.text()) el.value = this.text();
6668
- if (value === this.value()) return;
6652
+ setValue(value) {
6653
+ this.resetStatus();
6669
6654
  this.value.set(value);
6670
6655
  this.onChange(value);
6671
6656
  }
6672
- clamp(value) {
6673
- const min = this.min();
6674
- const max = this.max();
6675
- if (min != null && value < min) return min;
6676
- if (max != null && value > max) return max;
6677
- return value;
6678
- }
6679
- round(value) {
6680
- const digits = Math.max(this.fraction().max, decimalsOf(this.step()));
6681
- return Number(value.toFixed(Math.min(digits, 20)));
6682
- }
6683
- format(value) {
6684
- if (value == null || Number.isNaN(value)) return "";
6685
- const { min, max } = this.fraction();
6686
- let [int, frac = ""] = Math.abs(value).toFixed(max).split(".");
6687
- frac = frac.replace(/0+$/, "").padEnd(min, "0");
6688
- if (this.useGrouping()) int = group(int);
6689
- return `${value < 0 ? "-" : ""}${int}${frac ? "," + frac : ""}`;
6690
- }
6691
- formatLive(raw) {
6692
- const negative = (this.min() == null || this.min() < 0) && raw.trim().startsWith("-");
6693
- const maxFraction = this.fraction().max;
6694
- const clean = raw.replace(/[^\d,]/g, "");
6695
- const comma = clean.indexOf(",");
6696
- let int = (comma < 0 ? clean : clean.slice(0, comma)).replace(/,/g, "");
6697
- let frac = comma < 0 ? null : clean.slice(comma + 1).replace(/,/g, "").slice(0, maxFraction);
6698
- if (maxFraction === 0) frac = null;
6699
- int = int.replace(/^0+(?=\d)/, "");
6700
- if (this.useGrouping()) int = group(int);
6701
- if (!int && frac !== null) int = "0";
6702
- return `${negative ? "-" : ""}${int}${frac !== null ? "," + frac : ""}`;
6703
- }
6704
- insertText(text) {
6705
- const el = this.input().nativeElement;
6706
- const start = el.selectionStart ?? el.value.length;
6707
- const end = el.selectionEnd ?? start;
6708
- el.setRangeText(text, start, end, "end");
6709
- el.dispatchEvent(new Event("input", { bubbles: true }));
6657
+ resetStatus() {
6658
+ this.uploading = null;
6659
+ this.status.set("idle");
6660
+ this.progress.set(0);
6710
6661
  }
6711
6662
  resolveControl() {
6712
6663
  if (this.ngControl === void 0) this.ngControl = this.injector.get(NgControl, null, {
@@ -6719,16 +6670,16 @@ var HuInputNumber = class HuInputNumber {
6719
6670
  minVersion: "12.0.0",
6720
6671
  version: "22.2.0",
6721
6672
  ngImport: i0,
6722
- type: HuInputNumber,
6673
+ type: HuFileInput,
6723
6674
  deps: [],
6724
6675
  target: i0.ɵɵFactoryTarget.Component
6725
6676
  });
6726
6677
  static ɵcmp = i0.ɵɵngDeclareComponent({
6727
6678
  minVersion: "17.0.0",
6728
6679
  version: "22.2.0",
6729
- type: HuInputNumber,
6680
+ type: HuFileInput,
6730
6681
  isStandalone: true,
6731
- selector: "hu-input-number",
6682
+ selector: "hu-file-input",
6732
6683
  inputs: {
6733
6684
  value: {
6734
6685
  classPropertyName: "value",
@@ -6737,86 +6688,1447 @@ var HuInputNumber = class HuInputNumber {
6737
6688
  isRequired: false,
6738
6689
  transformFunction: null
6739
6690
  },
6740
- min: {
6741
- classPropertyName: "min",
6742
- publicName: "min",
6691
+ label: {
6692
+ classPropertyName: "label",
6693
+ publicName: "label",
6743
6694
  isSignal: true,
6744
6695
  isRequired: false,
6745
6696
  transformFunction: null
6746
6697
  },
6747
- max: {
6748
- classPropertyName: "max",
6749
- publicName: "max",
6698
+ required: {
6699
+ classPropertyName: "required",
6700
+ publicName: "required",
6750
6701
  isSignal: true,
6751
6702
  isRequired: false,
6752
6703
  transformFunction: null
6753
6704
  },
6754
- step: {
6755
- classPropertyName: "step",
6756
- publicName: "step",
6705
+ hint: {
6706
+ classPropertyName: "hint",
6707
+ publicName: "hint",
6757
6708
  isSignal: true,
6758
6709
  isRequired: false,
6759
6710
  transformFunction: null
6760
6711
  },
6761
- mode: {
6762
- classPropertyName: "mode",
6763
- publicName: "mode",
6712
+ placeholder: {
6713
+ classPropertyName: "placeholder",
6714
+ publicName: "placeholder",
6715
+ isSignal: true,
6716
+ isRequired: false,
6717
+ transformFunction: null
6718
+ },
6719
+ accept: {
6720
+ classPropertyName: "accept",
6721
+ publicName: "accept",
6722
+ isSignal: true,
6723
+ isRequired: false,
6724
+ transformFunction: null
6725
+ },
6726
+ maxFileSize: {
6727
+ classPropertyName: "maxFileSize",
6728
+ publicName: "maxFileSize",
6729
+ isSignal: true,
6730
+ isRequired: false,
6731
+ transformFunction: null
6732
+ },
6733
+ uploader: {
6734
+ classPropertyName: "uploader",
6735
+ publicName: "uploader",
6736
+ isSignal: true,
6737
+ isRequired: false,
6738
+ transformFunction: null
6739
+ },
6740
+ removable: {
6741
+ classPropertyName: "removable",
6742
+ publicName: "removable",
6743
+ isSignal: true,
6744
+ isRequired: false,
6745
+ transformFunction: null
6746
+ },
6747
+ browseLabel: {
6748
+ classPropertyName: "browseLabel",
6749
+ publicName: "browseLabel",
6750
+ isSignal: true,
6751
+ isRequired: false,
6752
+ transformFunction: null
6753
+ },
6754
+ changeLabel: {
6755
+ classPropertyName: "changeLabel",
6756
+ publicName: "changeLabel",
6757
+ isSignal: true,
6758
+ isRequired: false,
6759
+ transformFunction: null
6760
+ },
6761
+ disabled: {
6762
+ classPropertyName: "disabled",
6763
+ publicName: "disabled",
6764
+ isSignal: true,
6765
+ isRequired: false,
6766
+ transformFunction: null
6767
+ },
6768
+ id: {
6769
+ classPropertyName: "id",
6770
+ publicName: "id",
6771
+ isSignal: true,
6772
+ isRequired: false,
6773
+ transformFunction: null
6774
+ }
6775
+ },
6776
+ outputs: {
6777
+ value: "valueChange",
6778
+ rejected: "rejected",
6779
+ uploaded: "uploaded",
6780
+ uploadError: "uploadError",
6781
+ removed: "removed"
6782
+ },
6783
+ host: {
6784
+ listeners: {
6785
+ "dragenter": "onDragEnter($event)",
6786
+ "dragover": "onDragOver($event)",
6787
+ "dragleave": "onDragLeave()",
6788
+ "drop": "onDrop($event)"
6789
+ },
6790
+ properties: {
6791
+ "class.hu-file-input--labelled": "!!label()",
6792
+ "class.hu-file-input--filled": "!!value()",
6793
+ "class.hu-file-input--stored": "!!display()?.stored",
6794
+ "class.hu-file-input--dragging": "dragging()",
6795
+ "class.hu-file-input--disabled": "isDisabled()",
6796
+ "class.hu-file-input--invalid": "isInvalid()",
6797
+ "attr.data-status": "status()"
6798
+ },
6799
+ classAttribute: "hu-file-input"
6800
+ },
6801
+ providers: [{
6802
+ provide: NG_VALUE_ACCESSOR,
6803
+ useExisting: forwardRef(() => HuFileInput),
6804
+ multi: true
6805
+ }, {
6806
+ provide: HuFormFieldControl,
6807
+ useExisting: forwardRef(() => HuFileInput)
6808
+ }],
6809
+ viewQueries: [{
6810
+ propertyName: "input",
6811
+ first: true,
6812
+ predicate: ["input"],
6813
+ descendants: true,
6814
+ isSignal: true
6815
+ }, {
6816
+ propertyName: "browseButton",
6817
+ first: true,
6818
+ predicate: ["browseButton"],
6819
+ descendants: true,
6820
+ read: ElementRef,
6821
+ isSignal: true
6822
+ }],
6823
+ ngImport: i0,
6824
+ template: "<input\n #input\n type=\"file\"\n class=\"hu-sr-only\"\n tabindex=\"-1\"\n aria-hidden=\"true\"\n [accept]=\"accept()\"\n [disabled]=\"isDisabled()\"\n (change)=\"onInputChange($event)\"\n/>\n\n<div class=\"hu-file-input__box\" (click)=\"onBoxClick($event)\">\n <span class=\"hu-file-input__icon\" aria-hidden=\"true\">\n <hu-icon [name]=\"dragging() ? 'upload-cloud' : (display()?.icon ?? 'upload')\" [size]=\"18\" />\n </span>\n\n <div class=\"hu-file-input__body\">\n @if (label(); as l) {\n <span class=\"hu-file-input__label\" [id]=\"labelId()\">\n {{ l }}\n @if (required()) {\n <span class=\"hu-file-input__required\" aria-hidden=\"true\">*</span>\n }\n </span>\n }\n\n <span class=\"hu-file-input__line\">\n @if (dragging()) {\n <span class=\"hu-file-input__placeholder hu-file-input__drop\">Bırakın, eklensin</span>\n } @else if (display(); as d) {\n @if (d.url) {\n <a class=\"hu-file-input__name\" [href]=\"d.url\" target=\"_blank\" rel=\"noopener\" [title]=\"d.name\">{{ d.name }}</a>\n } @else {\n <span class=\"hu-file-input__name\" [title]=\"d.name\">{{ d.name }}</span>\n }\n <span class=\"hu-file-input__meta\">\n @if (d.size != null) {\n <span>{{ formatSize(d.size) }}</span>\n }\n @switch (status()) {\n @case ('uploading') {\n <span>%{{ progress() }}</span>\n }\n @case ('done') {\n <span class=\"hu-file-input__ok\"><hu-icon name=\"check-circle\" [size]=\"13\" /> Yüklendi</span>\n }\n @case ('error') {\n <span class=\"hu-file-input__fail\"><hu-icon name=\"alert-circle\" [size]=\"13\" /> Yüklenemedi</span>\n }\n @default {\n @if (d.stored) {\n <span class=\"hu-file-input__ok\"><hu-icon name=\"check-circle\" [size]=\"13\" /> Yüklü</span>\n }\n }\n }\n </span>\n } @else {\n <span class=\"hu-file-input__placeholder\">{{ placeholder() }}</span>\n @if (hintText()) {\n <span class=\"hu-file-input__hint\" [id]=\"hintId()\">{{ hintText() }}</span>\n }\n }\n </span>\n </div>\n\n <div class=\"hu-file-input__actions\">\n @if (status() === 'error') {\n <button\n hu-button\n size=\"sm\"\n variant=\"ghost\"\n iconOnly\n type=\"button\"\n title=\"Tekrar dene\"\n aria-label=\"Tekrar yükle\"\n [disabled]=\"isDisabled()\"\n (click)=\"retry()\"\n (blur)=\"onBlur($event)\"\n >\n <hu-icon name=\"rotate-cw\" [size]=\"14\" />\n </button>\n }\n <button\n #browseButton\n hu-button\n size=\"sm\"\n type=\"button\"\n class=\"hu-file-input__browse\"\n [variant]=\"display() ? 'outline' : 'soft'\"\n [color]=\"display() ? 'neutral' : 'primary'\"\n [id]=\"id()\"\n [disabled]=\"isDisabled()\"\n [attr.aria-labelledby]=\"label() ? labelId() + ' ' + id() : null\"\n [attr.aria-describedby]=\"describedBy()\"\n [attr.aria-invalid]=\"isInvalid() || null\"\n (click)=\"browse()\"\n (blur)=\"onBlur($event)\"\n >\n <hu-icon name=\"upload\" [size]=\"14\" />\n {{ display() ? changeLabel() : browseLabel() }}\n </button>\n @if (display() && removable()) {\n <button\n hu-button\n size=\"sm\"\n variant=\"ghost\"\n color=\"danger\"\n iconOnly\n type=\"button\"\n title=\"Kaldır\"\n [attr.aria-label]=\"display()!.name + ' kaldır'\"\n [disabled]=\"isDisabled()\"\n (click)=\"remove()\"\n (blur)=\"onBlur($event)\"\n >\n <hu-icon name=\"trash\" [size]=\"15\" />\n </button>\n }\n </div>\n\n @if (status() === 'uploading') {\n <span\n class=\"hu-file-input__progress\"\n role=\"progressbar\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n [attr.aria-valuenow]=\"progress()\"\n [attr.aria-label]=\"(display()?.name ?? 'Dosya') + ' yükleniyor'\"\n >\n <span [style.width.%]=\"progress()\"></span>\n </span>\n }\n</div>\n\n@if (message(); as m) {\n <p class=\"hu-file-input__message\" role=\"alert\" [id]=\"messageId()\">\n <hu-icon name=\"alert-circle\" [size]=\"14\" /> {{ m }}\n </p>\n}\n",
6825
+ styles: ["@charset \"UTF-8\";.hu-file-input{display:block;flex:1 1 auto;width:100%;min-width:0;container-type:inline-size}.hu-file-input__box{position:relative;display:flex;align-items:center;gap:var(--hu-space-3);min-height:var(--hu-control-md);padding:3px 3px 3px var(--hu-space-2);overflow:hidden;background:var(--hu-surface);border:1px solid var(--hu-border-strong);border-radius:var(--hu-radius-md);box-shadow:var(--hu-shadow-sm);cursor:pointer;transition:border-color var(--hu-transition),background-color var(--hu-transition),box-shadow var(--hu-transition)}.hu-file-input__box:hover{border-color:var(--hu-gray-400)}.hu-file-input__box:focus-within{border-color:var(--hu-primary);box-shadow:var(--hu-ring);transition:none}.hu-file-input--labelled .hu-file-input__box{gap:var(--hu-space-3);padding:var(--hu-space-3) var(--hu-space-3) var(--hu-space-3) var(--hu-space-3);border-color:var(--hu-border);border-radius:var(--hu-radius-lg)}.hu-file-input--labelled .hu-file-input__box:hover{border-color:var(--hu-border-strong)}.hu-file-input--labelled .hu-file-input__box:focus-within{border-color:var(--hu-primary)}.hu-file-input--dragging .hu-file-input__box{background:var(--hu-primary-soft);border-color:var(--hu-primary);border-style:dashed}.hu-file-input--dragging .hu-file-input__box *{pointer-events:none}.hu-file-input--invalid .hu-file-input__box,.hu-file-input--invalid .hu-file-input__box:hover{border-color:var(--hu-danger)}.hu-file-input--invalid .hu-file-input__box:focus-within{box-shadow:var(--hu-ring-danger)}.hu-file-input--disabled .hu-file-input__box{background:var(--hu-surface-3);box-shadow:none;cursor:not-allowed;opacity:.65}.hu-file-input--disabled .hu-file-input__box:hover{border-color:var(--hu-border-strong)}.hu-file-input__icon{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;width:1.875rem;height:1.875rem;color:var(--hu-text-subtle);background:var(--hu-surface-2);border-radius:var(--hu-radius-sm);transition:color var(--hu-transition),background-color var(--hu-transition)}.hu-file-input--labelled .hu-file-input__icon{width:2.5rem;height:2.5rem;border-radius:var(--hu-radius-md)}.hu-file-input--filled .hu-file-input__icon{color:var(--hu-primary-soft-fg);background:var(--hu-primary-soft)}[data-status=done] .hu-file-input__icon,.hu-file-input--stored[data-status=idle] .hu-file-input__icon{color:var(--hu-success-fg);background:var(--hu-success-soft)}.hu-file-input--invalid .hu-file-input__icon,[data-status=error] .hu-file-input__icon{color:var(--hu-danger-fg);background:var(--hu-danger-soft)}.hu-file-input--dragging .hu-file-input__icon{color:var(--hu-primary-fg);background:var(--hu-primary)}.hu-file-input__body{display:flex;flex:1;flex-direction:column;gap:2px;min-width:0}.hu-file-input__label{font-size:var(--hu-text-sm);font-weight:600;line-height:1.35;color:var(--hu-text)}.hu-file-input__required{margin-left:2px;color:var(--hu-danger)}.hu-file-input__line{display:flex;align-items:baseline;gap:var(--hu-space-2);min-width:0;font-size:var(--hu-text-sm);line-height:1.4}.hu-file-input__name{min-width:0;overflow:hidden;font-weight:500;color:var(--hu-text);text-overflow:ellipsis;white-space:nowrap}a.hu-file-input__name{color:var(--hu-primary);text-decoration:none}a.hu-file-input__name:hover{text-decoration:underline;text-underline-offset:2px}a.hu-file-input__name:focus-visible{outline:2px solid var(--hu-focus);outline-offset:1px;border-radius:2px}.hu-file-input__meta{display:inline-flex;flex-shrink:0;align-items:center;gap:var(--hu-space-2);font-size:var(--hu-text-xs);color:var(--hu-text-subtle);white-space:nowrap}.hu-file-input__ok,.hu-file-input__fail{display:inline-flex;align-items:center;gap:3px;font-weight:500}.hu-file-input__ok{color:var(--hu-success)}.hu-file-input__fail{color:var(--hu-danger)}.hu-file-input__placeholder{flex-shrink:0;color:var(--hu-text-subtle)}.hu-file-input__drop{font-weight:500;color:var(--hu-primary)}.hu-file-input__hint{min-width:0;overflow:hidden;font-size:var(--hu-text-xs);color:var(--hu-text-subtle);text-overflow:ellipsis;white-space:nowrap}.hu-file-input__hint:before{content:\"\\b7\";margin-right:var(--hu-space-2)}.hu-file-input__actions{display:flex;flex-shrink:0;align-items:center;gap:var(--hu-space-1)}.hu-file-input__progress{position:absolute;right:0;bottom:0;left:0;height:3px;background:var(--hu-surface-3)}.hu-file-input__progress>span{display:block;height:100%;background:var(--hu-primary);transition:width .15s ease-out}.hu-file-input__message{display:flex;align-items:center;gap:var(--hu-space-1);margin:var(--hu-space-1) 0 0;font-size:var(--hu-text-xs);color:var(--hu-danger)}@container (max-width: 30rem){.hu-file-input--labelled .hu-file-input__box{flex-wrap:wrap;align-items:flex-start}.hu-file-input--labelled .hu-file-input__body{flex-basis:calc(100% - 2.5rem - var(--hu-space-3))}.hu-file-input--labelled .hu-file-input__line{flex-direction:column;align-items:flex-start;gap:0}.hu-file-input--labelled .hu-file-input__name,.hu-file-input--labelled .hu-file-input__hint{max-width:100%}.hu-file-input--labelled .hu-file-input__hint:before{display:none}.hu-file-input--labelled .hu-file-input__actions{width:100%;justify-content:flex-end}.hu-file-input:not(.hu-file-input--labelled) .hu-file-input__hint{display:none}}\n"],
6826
+ dependencies: [{
6827
+ kind: "component",
6828
+ type: HuButton,
6829
+ selector: "button[hu-button], a[hu-button]",
6830
+ inputs: [
6831
+ "variant",
6832
+ "color",
6833
+ "size",
6834
+ "disabled",
6835
+ "loading",
6836
+ "block",
6837
+ "iconOnly",
6838
+ "pill"
6839
+ ]
6840
+ }, {
6841
+ kind: "component",
6842
+ type: HuIcon,
6843
+ selector: "hu-icon",
6844
+ inputs: [
6845
+ "name",
6846
+ "size",
6847
+ "strokeWidth",
6848
+ "label"
6849
+ ]
6850
+ }],
6851
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
6852
+ encapsulation: i0.ViewEncapsulation.None
6853
+ });
6854
+ };
6855
+ i0.ɵɵngDeclareClassMetadata({
6856
+ minVersion: "12.0.0",
6857
+ version: "22.2.0",
6858
+ ngImport: i0,
6859
+ type: HuFileInput,
6860
+ decorators: [{
6861
+ type: Component,
6862
+ args: [{
6863
+ selector: "hu-file-input",
6864
+ imports: [HuButton, HuIcon],
6865
+ providers: [{
6866
+ provide: NG_VALUE_ACCESSOR,
6867
+ useExisting: forwardRef(() => HuFileInput),
6868
+ multi: true
6869
+ }, {
6870
+ provide: HuFormFieldControl,
6871
+ useExisting: forwardRef(() => HuFileInput)
6872
+ }],
6873
+ host: {
6874
+ class: "hu-file-input",
6875
+ "[class.hu-file-input--labelled]": "!!label()",
6876
+ "[class.hu-file-input--filled]": "!!value()",
6877
+ "[class.hu-file-input--stored]": "!!display()?.stored",
6878
+ "[class.hu-file-input--dragging]": "dragging()",
6879
+ "[class.hu-file-input--disabled]": "isDisabled()",
6880
+ "[class.hu-file-input--invalid]": "isInvalid()",
6881
+ "[attr.data-status]": "status()",
6882
+ "(dragenter)": "onDragEnter($event)",
6883
+ "(dragover)": "onDragOver($event)",
6884
+ "(dragleave)": "onDragLeave()",
6885
+ "(drop)": "onDrop($event)"
6886
+ },
6887
+ encapsulation: ViewEncapsulation.None,
6888
+ changeDetection: ChangeDetectionStrategy.OnPush,
6889
+ template: "<input\n #input\n type=\"file\"\n class=\"hu-sr-only\"\n tabindex=\"-1\"\n aria-hidden=\"true\"\n [accept]=\"accept()\"\n [disabled]=\"isDisabled()\"\n (change)=\"onInputChange($event)\"\n/>\n\n<div class=\"hu-file-input__box\" (click)=\"onBoxClick($event)\">\n <span class=\"hu-file-input__icon\" aria-hidden=\"true\">\n <hu-icon [name]=\"dragging() ? 'upload-cloud' : (display()?.icon ?? 'upload')\" [size]=\"18\" />\n </span>\n\n <div class=\"hu-file-input__body\">\n @if (label(); as l) {\n <span class=\"hu-file-input__label\" [id]=\"labelId()\">\n {{ l }}\n @if (required()) {\n <span class=\"hu-file-input__required\" aria-hidden=\"true\">*</span>\n }\n </span>\n }\n\n <span class=\"hu-file-input__line\">\n @if (dragging()) {\n <span class=\"hu-file-input__placeholder hu-file-input__drop\">Bırakın, eklensin</span>\n } @else if (display(); as d) {\n @if (d.url) {\n <a class=\"hu-file-input__name\" [href]=\"d.url\" target=\"_blank\" rel=\"noopener\" [title]=\"d.name\">{{ d.name }}</a>\n } @else {\n <span class=\"hu-file-input__name\" [title]=\"d.name\">{{ d.name }}</span>\n }\n <span class=\"hu-file-input__meta\">\n @if (d.size != null) {\n <span>{{ formatSize(d.size) }}</span>\n }\n @switch (status()) {\n @case ('uploading') {\n <span>%{{ progress() }}</span>\n }\n @case ('done') {\n <span class=\"hu-file-input__ok\"><hu-icon name=\"check-circle\" [size]=\"13\" /> Yüklendi</span>\n }\n @case ('error') {\n <span class=\"hu-file-input__fail\"><hu-icon name=\"alert-circle\" [size]=\"13\" /> Yüklenemedi</span>\n }\n @default {\n @if (d.stored) {\n <span class=\"hu-file-input__ok\"><hu-icon name=\"check-circle\" [size]=\"13\" /> Yüklü</span>\n }\n }\n }\n </span>\n } @else {\n <span class=\"hu-file-input__placeholder\">{{ placeholder() }}</span>\n @if (hintText()) {\n <span class=\"hu-file-input__hint\" [id]=\"hintId()\">{{ hintText() }}</span>\n }\n }\n </span>\n </div>\n\n <div class=\"hu-file-input__actions\">\n @if (status() === 'error') {\n <button\n hu-button\n size=\"sm\"\n variant=\"ghost\"\n iconOnly\n type=\"button\"\n title=\"Tekrar dene\"\n aria-label=\"Tekrar yükle\"\n [disabled]=\"isDisabled()\"\n (click)=\"retry()\"\n (blur)=\"onBlur($event)\"\n >\n <hu-icon name=\"rotate-cw\" [size]=\"14\" />\n </button>\n }\n <button\n #browseButton\n hu-button\n size=\"sm\"\n type=\"button\"\n class=\"hu-file-input__browse\"\n [variant]=\"display() ? 'outline' : 'soft'\"\n [color]=\"display() ? 'neutral' : 'primary'\"\n [id]=\"id()\"\n [disabled]=\"isDisabled()\"\n [attr.aria-labelledby]=\"label() ? labelId() + ' ' + id() : null\"\n [attr.aria-describedby]=\"describedBy()\"\n [attr.aria-invalid]=\"isInvalid() || null\"\n (click)=\"browse()\"\n (blur)=\"onBlur($event)\"\n >\n <hu-icon name=\"upload\" [size]=\"14\" />\n {{ display() ? changeLabel() : browseLabel() }}\n </button>\n @if (display() && removable()) {\n <button\n hu-button\n size=\"sm\"\n variant=\"ghost\"\n color=\"danger\"\n iconOnly\n type=\"button\"\n title=\"Kaldır\"\n [attr.aria-label]=\"display()!.name + ' kaldır'\"\n [disabled]=\"isDisabled()\"\n (click)=\"remove()\"\n (blur)=\"onBlur($event)\"\n >\n <hu-icon name=\"trash\" [size]=\"15\" />\n </button>\n }\n </div>\n\n @if (status() === 'uploading') {\n <span\n class=\"hu-file-input__progress\"\n role=\"progressbar\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n [attr.aria-valuenow]=\"progress()\"\n [attr.aria-label]=\"(display()?.name ?? 'Dosya') + ' yükleniyor'\"\n >\n <span [style.width.%]=\"progress()\"></span>\n </span>\n }\n</div>\n\n@if (message(); as m) {\n <p class=\"hu-file-input__message\" role=\"alert\" [id]=\"messageId()\">\n <hu-icon name=\"alert-circle\" [size]=\"14\" /> {{ m }}\n </p>\n}\n",
6890
+ styles: ["@charset \"UTF-8\";.hu-file-input{display:block;flex:1 1 auto;width:100%;min-width:0;container-type:inline-size}.hu-file-input__box{position:relative;display:flex;align-items:center;gap:var(--hu-space-3);min-height:var(--hu-control-md);padding:3px 3px 3px var(--hu-space-2);overflow:hidden;background:var(--hu-surface);border:1px solid var(--hu-border-strong);border-radius:var(--hu-radius-md);box-shadow:var(--hu-shadow-sm);cursor:pointer;transition:border-color var(--hu-transition),background-color var(--hu-transition),box-shadow var(--hu-transition)}.hu-file-input__box:hover{border-color:var(--hu-gray-400)}.hu-file-input__box:focus-within{border-color:var(--hu-primary);box-shadow:var(--hu-ring);transition:none}.hu-file-input--labelled .hu-file-input__box{gap:var(--hu-space-3);padding:var(--hu-space-3) var(--hu-space-3) var(--hu-space-3) var(--hu-space-3);border-color:var(--hu-border);border-radius:var(--hu-radius-lg)}.hu-file-input--labelled .hu-file-input__box:hover{border-color:var(--hu-border-strong)}.hu-file-input--labelled .hu-file-input__box:focus-within{border-color:var(--hu-primary)}.hu-file-input--dragging .hu-file-input__box{background:var(--hu-primary-soft);border-color:var(--hu-primary);border-style:dashed}.hu-file-input--dragging .hu-file-input__box *{pointer-events:none}.hu-file-input--invalid .hu-file-input__box,.hu-file-input--invalid .hu-file-input__box:hover{border-color:var(--hu-danger)}.hu-file-input--invalid .hu-file-input__box:focus-within{box-shadow:var(--hu-ring-danger)}.hu-file-input--disabled .hu-file-input__box{background:var(--hu-surface-3);box-shadow:none;cursor:not-allowed;opacity:.65}.hu-file-input--disabled .hu-file-input__box:hover{border-color:var(--hu-border-strong)}.hu-file-input__icon{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;width:1.875rem;height:1.875rem;color:var(--hu-text-subtle);background:var(--hu-surface-2);border-radius:var(--hu-radius-sm);transition:color var(--hu-transition),background-color var(--hu-transition)}.hu-file-input--labelled .hu-file-input__icon{width:2.5rem;height:2.5rem;border-radius:var(--hu-radius-md)}.hu-file-input--filled .hu-file-input__icon{color:var(--hu-primary-soft-fg);background:var(--hu-primary-soft)}[data-status=done] .hu-file-input__icon,.hu-file-input--stored[data-status=idle] .hu-file-input__icon{color:var(--hu-success-fg);background:var(--hu-success-soft)}.hu-file-input--invalid .hu-file-input__icon,[data-status=error] .hu-file-input__icon{color:var(--hu-danger-fg);background:var(--hu-danger-soft)}.hu-file-input--dragging .hu-file-input__icon{color:var(--hu-primary-fg);background:var(--hu-primary)}.hu-file-input__body{display:flex;flex:1;flex-direction:column;gap:2px;min-width:0}.hu-file-input__label{font-size:var(--hu-text-sm);font-weight:600;line-height:1.35;color:var(--hu-text)}.hu-file-input__required{margin-left:2px;color:var(--hu-danger)}.hu-file-input__line{display:flex;align-items:baseline;gap:var(--hu-space-2);min-width:0;font-size:var(--hu-text-sm);line-height:1.4}.hu-file-input__name{min-width:0;overflow:hidden;font-weight:500;color:var(--hu-text);text-overflow:ellipsis;white-space:nowrap}a.hu-file-input__name{color:var(--hu-primary);text-decoration:none}a.hu-file-input__name:hover{text-decoration:underline;text-underline-offset:2px}a.hu-file-input__name:focus-visible{outline:2px solid var(--hu-focus);outline-offset:1px;border-radius:2px}.hu-file-input__meta{display:inline-flex;flex-shrink:0;align-items:center;gap:var(--hu-space-2);font-size:var(--hu-text-xs);color:var(--hu-text-subtle);white-space:nowrap}.hu-file-input__ok,.hu-file-input__fail{display:inline-flex;align-items:center;gap:3px;font-weight:500}.hu-file-input__ok{color:var(--hu-success)}.hu-file-input__fail{color:var(--hu-danger)}.hu-file-input__placeholder{flex-shrink:0;color:var(--hu-text-subtle)}.hu-file-input__drop{font-weight:500;color:var(--hu-primary)}.hu-file-input__hint{min-width:0;overflow:hidden;font-size:var(--hu-text-xs);color:var(--hu-text-subtle);text-overflow:ellipsis;white-space:nowrap}.hu-file-input__hint:before{content:\"\\b7\";margin-right:var(--hu-space-2)}.hu-file-input__actions{display:flex;flex-shrink:0;align-items:center;gap:var(--hu-space-1)}.hu-file-input__progress{position:absolute;right:0;bottom:0;left:0;height:3px;background:var(--hu-surface-3)}.hu-file-input__progress>span{display:block;height:100%;background:var(--hu-primary);transition:width .15s ease-out}.hu-file-input__message{display:flex;align-items:center;gap:var(--hu-space-1);margin:var(--hu-space-1) 0 0;font-size:var(--hu-text-xs);color:var(--hu-danger)}@container (max-width: 30rem){.hu-file-input--labelled .hu-file-input__box{flex-wrap:wrap;align-items:flex-start}.hu-file-input--labelled .hu-file-input__body{flex-basis:calc(100% - 2.5rem - var(--hu-space-3))}.hu-file-input--labelled .hu-file-input__line{flex-direction:column;align-items:flex-start;gap:0}.hu-file-input--labelled .hu-file-input__name,.hu-file-input--labelled .hu-file-input__hint{max-width:100%}.hu-file-input--labelled .hu-file-input__hint:before{display:none}.hu-file-input--labelled .hu-file-input__actions{width:100%;justify-content:flex-end}.hu-file-input:not(.hu-file-input--labelled) .hu-file-input__hint{display:none}}\n"]
6891
+ }]
6892
+ }],
6893
+ propDecorators: {
6894
+ value: [{
6895
+ type: i0.Input,
6896
+ args: [{
6897
+ isSignal: true,
6898
+ alias: "value",
6899
+ required: false
6900
+ }]
6901
+ }, {
6902
+ type: i0.Output,
6903
+ args: ["valueChange"]
6904
+ }],
6905
+ label: [{
6906
+ type: i0.Input,
6907
+ args: [{
6908
+ isSignal: true,
6909
+ alias: "label",
6910
+ required: false
6911
+ }]
6912
+ }],
6913
+ required: [{
6914
+ type: i0.Input,
6915
+ args: [{
6916
+ isSignal: true,
6917
+ alias: "required",
6918
+ required: false
6919
+ }]
6920
+ }],
6921
+ hint: [{
6922
+ type: i0.Input,
6923
+ args: [{
6924
+ isSignal: true,
6925
+ alias: "hint",
6926
+ required: false
6927
+ }]
6928
+ }],
6929
+ placeholder: [{
6930
+ type: i0.Input,
6931
+ args: [{
6932
+ isSignal: true,
6933
+ alias: "placeholder",
6934
+ required: false
6935
+ }]
6936
+ }],
6937
+ accept: [{
6938
+ type: i0.Input,
6939
+ args: [{
6940
+ isSignal: true,
6941
+ alias: "accept",
6942
+ required: false
6943
+ }]
6944
+ }],
6945
+ maxFileSize: [{
6946
+ type: i0.Input,
6947
+ args: [{
6948
+ isSignal: true,
6949
+ alias: "maxFileSize",
6950
+ required: false
6951
+ }]
6952
+ }],
6953
+ uploader: [{
6954
+ type: i0.Input,
6955
+ args: [{
6956
+ isSignal: true,
6957
+ alias: "uploader",
6958
+ required: false
6959
+ }]
6960
+ }],
6961
+ removable: [{
6962
+ type: i0.Input,
6963
+ args: [{
6964
+ isSignal: true,
6965
+ alias: "removable",
6966
+ required: false
6967
+ }]
6968
+ }],
6969
+ browseLabel: [{
6970
+ type: i0.Input,
6971
+ args: [{
6972
+ isSignal: true,
6973
+ alias: "browseLabel",
6974
+ required: false
6975
+ }]
6976
+ }],
6977
+ changeLabel: [{
6978
+ type: i0.Input,
6979
+ args: [{
6980
+ isSignal: true,
6981
+ alias: "changeLabel",
6982
+ required: false
6983
+ }]
6984
+ }],
6985
+ disabled: [{
6986
+ type: i0.Input,
6987
+ args: [{
6988
+ isSignal: true,
6989
+ alias: "disabled",
6990
+ required: false
6991
+ }]
6992
+ }],
6993
+ id: [{
6994
+ type: i0.Input,
6995
+ args: [{
6996
+ isSignal: true,
6997
+ alias: "id",
6998
+ required: false
6999
+ }]
7000
+ }],
7001
+ rejected: [{
7002
+ type: i0.Output,
7003
+ args: ["rejected"]
7004
+ }],
7005
+ uploaded: [{
7006
+ type: i0.Output,
7007
+ args: ["uploaded"]
7008
+ }],
7009
+ uploadError: [{
7010
+ type: i0.Output,
7011
+ args: ["uploadError"]
7012
+ }],
7013
+ removed: [{
7014
+ type: i0.Output,
7015
+ args: ["removed"]
7016
+ }],
7017
+ input: [{
7018
+ type: i0.ViewChild,
7019
+ args: ["input", { isSignal: true }]
7020
+ }],
7021
+ browseButton: [{
7022
+ type: i0.ViewChild,
7023
+ args: ["browseButton", {
7024
+ read: ElementRef,
7025
+ isSignal: true
7026
+ }]
7027
+ }]
7028
+ }
7029
+ });
7030
+ function isFileValue(value) {
7031
+ return value instanceof File || !!value && typeof value === "object" && typeof value.name === "string";
7032
+ }
7033
+ const optionalNumber = (v) => v == null || v === "" ? null : numberAttribute(v);
7034
+ var HuInputNumber = class HuInputNumber {
7035
+ injector = inject(Injector);
7036
+ field = inject(HU_FORM_FIELD, {
7037
+ optional: true,
7038
+ host: true
7039
+ });
7040
+ value = model(null, ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
7041
+ min = input(null, {
7042
+ ...ngDevMode ? { debugName: "min" } : /* istanbul ignore next */ {},
7043
+ transform: optionalNumber
7044
+ });
7045
+ max = input(null, {
7046
+ ...ngDevMode ? { debugName: "max" } : /* istanbul ignore next */ {},
7047
+ transform: optionalNumber
7048
+ });
7049
+ step = input(1, {
7050
+ ...ngDevMode ? { debugName: "step" } : /* istanbul ignore next */ {},
7051
+ transform: numberAttribute
7052
+ });
7053
+ mode = input("decimal", ...ngDevMode ? [{ debugName: "mode" }] : /* istanbul ignore next */ []);
7054
+ currency = input("TRY", ...ngDevMode ? [{ debugName: "currency" }] : /* istanbul ignore next */ []);
7055
+ minFractionDigits = input(null, {
7056
+ ...ngDevMode ? { debugName: "minFractionDigits" } : /* istanbul ignore next */ {},
7057
+ transform: optionalNumber
7058
+ });
7059
+ maxFractionDigits = input(null, {
7060
+ ...ngDevMode ? { debugName: "maxFractionDigits" } : /* istanbul ignore next */ {},
7061
+ transform: optionalNumber
7062
+ });
7063
+ useGrouping = input(true, {
7064
+ ...ngDevMode ? { debugName: "useGrouping" } : /* istanbul ignore next */ {},
7065
+ transform: booleanAttribute
7066
+ });
7067
+ prefix = input(...ngDevMode ? [void 0, { debugName: "prefix" }] : /* istanbul ignore next */ []);
7068
+ suffix = input(...ngDevMode ? [void 0, { debugName: "suffix" }] : /* istanbul ignore next */ []);
7069
+ buttons = input("none", ...ngDevMode ? [{ debugName: "buttons" }] : /* istanbul ignore next */ []);
7070
+ placeholder = input(...ngDevMode ? [void 0, { debugName: "placeholder" }] : /* istanbul ignore next */ []);
7071
+ size = input("md", ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
7072
+ disabled = input(false, {
7073
+ ...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
7074
+ transform: booleanAttribute
7075
+ });
7076
+ readonly = input(false, {
7077
+ ...ngDevMode ? { debugName: "readonly" } : /* istanbul ignore next */ {},
7078
+ transform: booleanAttribute
7079
+ });
7080
+ ariaLabel = input(...ngDevMode ? [void 0, { debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
7081
+ id = input(huUniqueId("hu-input-number"), ...ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []);
7082
+ text = signal("", ...ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []);
7083
+ formDisabled = signal(false, ...ngDevMode ? [{ debugName: "formDisabled" }] : /* istanbul ignore next */ []);
7084
+ isDisabled = computed(() => this.disabled() || this.formDisabled(), ...ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []);
7085
+ fraction = computed(() => {
7086
+ const currency = this.mode() === "currency";
7087
+ const max = this.maxFractionDigits() ?? (currency ? 2 : 0);
7088
+ return {
7089
+ min: Math.min(this.minFractionDigits() ?? (currency ? 2 : 0), max),
7090
+ max
7091
+ };
7092
+ }, ...ngDevMode ? [{ debugName: "fraction" }] : /* istanbul ignore next */ []);
7093
+ prefixText = computed(() => {
7094
+ if (this.prefix()) return this.prefix();
7095
+ if (this.mode() !== "currency") return void 0;
7096
+ try {
7097
+ return new Intl.NumberFormat("tr-TR", {
7098
+ style: "currency",
7099
+ currency: this.currency()
7100
+ }).formatToParts(0).find((p) => p.type === "currency")?.value;
7101
+ } catch {
7102
+ return this.currency();
7103
+ }
7104
+ }, ...ngDevMode ? [{ debugName: "prefixText" }] : /* istanbul ignore next */ []);
7105
+ canDecrement = computed(() => {
7106
+ const v = this.value();
7107
+ const min = this.min();
7108
+ return !this.isDisabled() && !this.readonly() && (v == null || min == null || v > min);
7109
+ }, ...ngDevMode ? [{ debugName: "canDecrement" }] : /* istanbul ignore next */ []);
7110
+ canIncrement = computed(() => {
7111
+ const v = this.value();
7112
+ const max = this.max();
7113
+ return !this.isDisabled() && !this.readonly() && (v == null || max == null || v < max);
7114
+ }, ...ngDevMode ? [{ debugName: "canIncrement" }] : /* istanbul ignore next */ []);
7115
+ ngControl;
7116
+ get hasControl() {
7117
+ return !!this.resolveControl();
7118
+ }
7119
+ controlErrorVisible = signal(false, ...ngDevMode ? [{ debugName: "controlErrorVisible" }] : /* istanbul ignore next */ []);
7120
+ errors = signal(null, ...ngDevMode ? [{ debugName: "errors" }] : /* istanbul ignore next */ []);
7121
+ isInvalid = computed(() => this.controlErrorVisible() || (this.field?.showError() ?? false), ...ngDevMode ? [{ debugName: "isInvalid" }] : /* istanbul ignore next */ []);
7122
+ input = viewChild.required("input", ...ngDevMode ? [{ debugName: "input" }] : /* istanbul ignore next */ []);
7123
+ focused = false;
7124
+ repeatTimer;
7125
+ onChange = () => {};
7126
+ onTouched = () => {};
7127
+ onValidatorChange = () => {};
7128
+ constructor() {
7129
+ effect(() => {
7130
+ const value = this.value();
7131
+ this.fraction();
7132
+ this.useGrouping();
7133
+ untracked(() => {
7134
+ if (!this.focused || parseNumber(this.text()) !== value) this.text.set(this.format(value));
7135
+ });
7136
+ });
7137
+ effect(() => {
7138
+ this.min();
7139
+ this.max();
7140
+ untracked(() => this.onValidatorChange());
7141
+ });
7142
+ inject(DestroyRef).onDestroy(() => this.stopRepeat());
7143
+ }
7144
+ ngDoCheck() {
7145
+ const c = this.resolveControl();
7146
+ if (!c) return;
7147
+ this.controlErrorVisible.set(!!c.invalid && !!(c.touched || c.dirty));
7148
+ this.errors.set(c.errors);
7149
+ }
7150
+ spin(direction, multiplier = 1) {
7151
+ if (this.isDisabled() || this.readonly()) return;
7152
+ const current = this.value() ?? (direction > 0 ? (this.min() ?? 0) - this.step() : (this.max() ?? 0) + this.step());
7153
+ const next = this.round(current + direction * this.step() * multiplier);
7154
+ this.commit(this.clamp(next));
7155
+ }
7156
+ onFocus() {
7157
+ this.focused = true;
7158
+ }
7159
+ onBlur() {
7160
+ this.focused = false;
7161
+ const parsed = parseNumber(this.text());
7162
+ this.commit(parsed == null ? null : this.clamp(this.round(parsed)));
7163
+ this.onTouched();
7164
+ }
7165
+ onKeydown(event) {
7166
+ const multiplier = event.shiftKey ? 10 : 1;
7167
+ switch (event.key) {
7168
+ case "ArrowUp":
7169
+ event.preventDefault();
7170
+ return this.spin(1, multiplier);
7171
+ case "ArrowDown":
7172
+ event.preventDefault();
7173
+ return this.spin(-1, multiplier);
7174
+ case "Home":
7175
+ if (this.min() != null) {
7176
+ event.preventDefault();
7177
+ this.commit(this.min());
7178
+ }
7179
+ return;
7180
+ case "End":
7181
+ if (this.max() != null) {
7182
+ event.preventDefault();
7183
+ this.commit(this.max());
7184
+ }
7185
+ return;
7186
+ case "Enter":
7187
+ this.onBlur();
7188
+ this.focused = true;
7189
+ return;
7190
+ case ".":
7191
+ case "Decimal":
7192
+ if (this.fraction().max > 0 && !event.ctrlKey && !event.metaKey) {
7193
+ event.preventDefault();
7194
+ this.insertText(",");
7195
+ }
7196
+ return;
7197
+ }
7198
+ }
7199
+ onInput(event) {
7200
+ const el = event.target;
7201
+ const caret = el.selectionStart ?? el.value.length;
7202
+ const before = significant(el.value.slice(0, caret));
7203
+ const formatted = this.formatLive(el.value);
7204
+ el.value = formatted;
7205
+ this.text.set(formatted);
7206
+ const pos = positionAfter(formatted, before);
7207
+ el.setSelectionRange(pos, pos);
7208
+ const parsed = parseNumber(formatted);
7209
+ if (parsed !== this.value()) {
7210
+ this.value.set(parsed);
7211
+ this.onChange(parsed);
7212
+ }
7213
+ }
7214
+ startRepeat(direction, event) {
7215
+ if (event.button !== 0) return;
7216
+ event.preventDefault();
7217
+ this.input().nativeElement.focus({ preventScroll: true });
7218
+ this.spin(direction);
7219
+ const repeat = (delay) => {
7220
+ this.repeatTimer = setTimeout(() => {
7221
+ this.spin(direction);
7222
+ repeat(Math.max(40, delay * .85));
7223
+ }, delay);
7224
+ };
7225
+ this.stopRepeat();
7226
+ this.repeatTimer = setTimeout(() => repeat(80), 400);
7227
+ }
7228
+ stopRepeat() {
7229
+ clearTimeout(this.repeatTimer);
7230
+ this.repeatTimer = void 0;
7231
+ }
7232
+ writeValue(value) {
7233
+ const n = value == null || value === "" ? null : Number(value);
7234
+ this.value.set(n == null || Number.isNaN(n) ? null : n);
7235
+ this.text.set(this.format(this.value()));
7236
+ }
7237
+ registerOnChange(fn) {
7238
+ this.onChange = fn;
7239
+ }
7240
+ registerOnTouched(fn) {
7241
+ this.onTouched = fn;
7242
+ }
7243
+ setDisabledState(disabled) {
7244
+ this.formDisabled.set(disabled);
7245
+ }
7246
+ validate(_control) {
7247
+ const v = this.value();
7248
+ if (v == null) return null;
7249
+ const min = this.min();
7250
+ const max = this.max();
7251
+ if (min != null && v < min) return { min: {
7252
+ min,
7253
+ actual: v
7254
+ } };
7255
+ if (max != null && v > max) return { max: {
7256
+ max,
7257
+ actual: v
7258
+ } };
7259
+ return null;
7260
+ }
7261
+ registerOnValidatorChange(fn) {
7262
+ this.onValidatorChange = fn;
7263
+ }
7264
+ commit(value) {
7265
+ this.text.set(this.format(value));
7266
+ const el = this.input().nativeElement;
7267
+ if (el.value !== this.text()) el.value = this.text();
7268
+ if (value === this.value()) return;
7269
+ this.value.set(value);
7270
+ this.onChange(value);
7271
+ }
7272
+ clamp(value) {
7273
+ const min = this.min();
7274
+ const max = this.max();
7275
+ if (min != null && value < min) return min;
7276
+ if (max != null && value > max) return max;
7277
+ return value;
7278
+ }
7279
+ round(value) {
7280
+ const digits = Math.max(this.fraction().max, decimalsOf(this.step()));
7281
+ return Number(value.toFixed(Math.min(digits, 20)));
7282
+ }
7283
+ format(value) {
7284
+ if (value == null || Number.isNaN(value)) return "";
7285
+ const { min, max } = this.fraction();
7286
+ let [int, frac = ""] = Math.abs(value).toFixed(max).split(".");
7287
+ frac = frac.replace(/0+$/, "").padEnd(min, "0");
7288
+ if (this.useGrouping()) int = group(int);
7289
+ return `${value < 0 ? "-" : ""}${int}${frac ? "," + frac : ""}`;
7290
+ }
7291
+ formatLive(raw) {
7292
+ const negative = (this.min() == null || this.min() < 0) && raw.trim().startsWith("-");
7293
+ const maxFraction = this.fraction().max;
7294
+ const clean = raw.replace(/[^\d,]/g, "");
7295
+ const comma = clean.indexOf(",");
7296
+ let int = (comma < 0 ? clean : clean.slice(0, comma)).replace(/,/g, "");
7297
+ let frac = comma < 0 ? null : clean.slice(comma + 1).replace(/,/g, "").slice(0, maxFraction);
7298
+ if (maxFraction === 0) frac = null;
7299
+ int = int.replace(/^0+(?=\d)/, "");
7300
+ if (this.useGrouping()) int = group(int);
7301
+ if (!int && frac !== null) int = "0";
7302
+ return `${negative ? "-" : ""}${int}${frac !== null ? "," + frac : ""}`;
7303
+ }
7304
+ insertText(text) {
7305
+ const el = this.input().nativeElement;
7306
+ const start = el.selectionStart ?? el.value.length;
7307
+ const end = el.selectionEnd ?? start;
7308
+ el.setRangeText(text, start, end, "end");
7309
+ el.dispatchEvent(new Event("input", { bubbles: true }));
7310
+ }
7311
+ resolveControl() {
7312
+ if (this.ngControl === void 0) this.ngControl = this.injector.get(NgControl, null, {
7313
+ self: true,
7314
+ optional: true
7315
+ });
7316
+ return this.ngControl;
7317
+ }
7318
+ static ɵfac = i0.ɵɵngDeclareFactory({
7319
+ minVersion: "12.0.0",
7320
+ version: "22.2.0",
7321
+ ngImport: i0,
7322
+ type: HuInputNumber,
7323
+ deps: [],
7324
+ target: i0.ɵɵFactoryTarget.Component
7325
+ });
7326
+ static ɵcmp = i0.ɵɵngDeclareComponent({
7327
+ minVersion: "17.0.0",
7328
+ version: "22.2.0",
7329
+ type: HuInputNumber,
7330
+ isStandalone: true,
7331
+ selector: "hu-input-number",
7332
+ inputs: {
7333
+ value: {
7334
+ classPropertyName: "value",
7335
+ publicName: "value",
7336
+ isSignal: true,
7337
+ isRequired: false,
7338
+ transformFunction: null
7339
+ },
7340
+ min: {
7341
+ classPropertyName: "min",
7342
+ publicName: "min",
7343
+ isSignal: true,
7344
+ isRequired: false,
7345
+ transformFunction: null
7346
+ },
7347
+ max: {
7348
+ classPropertyName: "max",
7349
+ publicName: "max",
7350
+ isSignal: true,
7351
+ isRequired: false,
7352
+ transformFunction: null
7353
+ },
7354
+ step: {
7355
+ classPropertyName: "step",
7356
+ publicName: "step",
7357
+ isSignal: true,
7358
+ isRequired: false,
7359
+ transformFunction: null
7360
+ },
7361
+ mode: {
7362
+ classPropertyName: "mode",
7363
+ publicName: "mode",
7364
+ isSignal: true,
7365
+ isRequired: false,
7366
+ transformFunction: null
7367
+ },
7368
+ currency: {
7369
+ classPropertyName: "currency",
7370
+ publicName: "currency",
7371
+ isSignal: true,
7372
+ isRequired: false,
7373
+ transformFunction: null
7374
+ },
7375
+ minFractionDigits: {
7376
+ classPropertyName: "minFractionDigits",
7377
+ publicName: "minFractionDigits",
7378
+ isSignal: true,
7379
+ isRequired: false,
7380
+ transformFunction: null
7381
+ },
7382
+ maxFractionDigits: {
7383
+ classPropertyName: "maxFractionDigits",
7384
+ publicName: "maxFractionDigits",
7385
+ isSignal: true,
7386
+ isRequired: false,
7387
+ transformFunction: null
7388
+ },
7389
+ useGrouping: {
7390
+ classPropertyName: "useGrouping",
7391
+ publicName: "useGrouping",
7392
+ isSignal: true,
7393
+ isRequired: false,
7394
+ transformFunction: null
7395
+ },
7396
+ prefix: {
7397
+ classPropertyName: "prefix",
7398
+ publicName: "prefix",
7399
+ isSignal: true,
7400
+ isRequired: false,
7401
+ transformFunction: null
7402
+ },
7403
+ suffix: {
7404
+ classPropertyName: "suffix",
7405
+ publicName: "suffix",
7406
+ isSignal: true,
7407
+ isRequired: false,
7408
+ transformFunction: null
7409
+ },
7410
+ buttons: {
7411
+ classPropertyName: "buttons",
7412
+ publicName: "buttons",
7413
+ isSignal: true,
7414
+ isRequired: false,
7415
+ transformFunction: null
7416
+ },
7417
+ placeholder: {
7418
+ classPropertyName: "placeholder",
7419
+ publicName: "placeholder",
7420
+ isSignal: true,
7421
+ isRequired: false,
7422
+ transformFunction: null
7423
+ },
7424
+ size: {
7425
+ classPropertyName: "size",
7426
+ publicName: "size",
7427
+ isSignal: true,
7428
+ isRequired: false,
7429
+ transformFunction: null
7430
+ },
7431
+ disabled: {
7432
+ classPropertyName: "disabled",
7433
+ publicName: "disabled",
7434
+ isSignal: true,
7435
+ isRequired: false,
7436
+ transformFunction: null
7437
+ },
7438
+ readonly: {
7439
+ classPropertyName: "readonly",
7440
+ publicName: "readonly",
7441
+ isSignal: true,
7442
+ isRequired: false,
7443
+ transformFunction: null
7444
+ },
7445
+ ariaLabel: {
7446
+ classPropertyName: "ariaLabel",
7447
+ publicName: "ariaLabel",
7448
+ isSignal: true,
7449
+ isRequired: false,
7450
+ transformFunction: null
7451
+ },
7452
+ id: {
7453
+ classPropertyName: "id",
7454
+ publicName: "id",
7455
+ isSignal: true,
7456
+ isRequired: false,
7457
+ transformFunction: null
7458
+ }
7459
+ },
7460
+ outputs: { value: "valueChange" },
7461
+ host: {
7462
+ properties: {
7463
+ "attr.data-buttons": "buttons()",
7464
+ "attr.data-size": "size()",
7465
+ "class.hu-input-number--disabled": "isDisabled()",
7466
+ "class.hu-input-number--invalid": "isInvalid()",
7467
+ "style.--hu-affix-prefix": "(prefixText()?.length ?? 0) + 'ch'",
7468
+ "style.--hu-affix-suffix": "(suffix()?.length ?? 0) + 'ch'"
7469
+ },
7470
+ classAttribute: "hu-input-number"
7471
+ },
7472
+ providers: [
7473
+ {
7474
+ provide: NG_VALUE_ACCESSOR,
7475
+ useExisting: forwardRef(() => HuInputNumber),
7476
+ multi: true
7477
+ },
7478
+ {
7479
+ provide: NG_VALIDATORS,
7480
+ useExisting: forwardRef(() => HuInputNumber),
7481
+ multi: true
7482
+ },
7483
+ {
7484
+ provide: HuFormFieldControl,
7485
+ useExisting: forwardRef(() => HuInputNumber)
7486
+ }
7487
+ ],
7488
+ viewQueries: [{
7489
+ propertyName: "input",
7490
+ first: true,
7491
+ predicate: ["input"],
7492
+ descendants: true,
7493
+ isSignal: true
7494
+ }],
7495
+ ngImport: i0,
7496
+ template: "@if (buttons() === 'horizontal') {\r\n <button\r\n type=\"button\"\r\n class=\"hu-input-number__btn hu-input-number__btn--minus\"\r\n tabindex=\"-1\"\r\n aria-label=\"Azalt\"\r\n [disabled]=\"!canDecrement()\"\r\n (pointerdown)=\"startRepeat(-1, $event)\"\r\n (pointerup)=\"stopRepeat()\"\r\n (pointerleave)=\"stopRepeat()\"\r\n (pointercancel)=\"stopRepeat()\"\r\n >\r\n <hu-icon name=\"minus\" [size]=\"16\" />\r\n </button>\r\n}\r\n\r\n<div class=\"hu-input-number__control\">\r\n @if (prefixText()) {\r\n <span class=\"hu-input-number__affix hu-input-number__affix--prefix\" aria-hidden=\"true\">{{ prefixText() }}</span>\r\n }\r\n <input\r\n #input\r\n type=\"text\"\r\n class=\"hu-input hu-input-number__input\"\r\n role=\"spinbutton\"\r\n autocomplete=\"off\"\r\n [attr.inputmode]=\"fraction().max > 0 ? 'decimal' : 'numeric'\"\r\n [id]=\"id()\"\r\n [attr.data-size]=\"size()\"\r\n [class.hu-input--invalid]=\"isInvalid()\"\r\n [class.hu-input-number__input--prefix]=\"!!prefixText()\"\r\n [class.hu-input-number__input--suffix]=\"!!suffix()\"\r\n [attr.aria-invalid]=\"isInvalid() || null\"\r\n [attr.aria-describedby]=\"field?.describedBy() ?? null\"\r\n [attr.aria-label]=\"ariaLabel() || null\"\r\n [attr.aria-valuenow]=\"value()\"\r\n [attr.aria-valuemin]=\"min()\"\r\n [attr.aria-valuemax]=\"max()\"\r\n [attr.aria-valuetext]=\"text() ? (prefixText() ?? '') + text() + (suffix() ? ' ' + suffix() : '') : null\"\r\n [attr.placeholder]=\"placeholder() ?? null\"\r\n [value]=\"text()\"\r\n [disabled]=\"isDisabled()\"\r\n [readOnly]=\"readonly()\"\r\n (focus)=\"onFocus()\"\r\n (blur)=\"onBlur()\"\r\n (keydown)=\"onKeydown($event)\"\r\n (input)=\"onInput($event)\"\r\n />\r\n @if (suffix()) {\r\n <span class=\"hu-input-number__affix hu-input-number__affix--suffix\" aria-hidden=\"true\">{{ suffix() }}</span>\r\n }\r\n\r\n @if (buttons() === 'stacked') {\r\n <span class=\"hu-input-number__stack\">\r\n <button\r\n type=\"button\"\r\n class=\"hu-input-number__btn\"\r\n tabindex=\"-1\"\r\n aria-label=\"Artır\"\r\n [disabled]=\"!canIncrement()\"\r\n (pointerdown)=\"startRepeat(1, $event)\"\r\n (pointerup)=\"stopRepeat()\"\r\n (pointerleave)=\"stopRepeat()\"\r\n (pointercancel)=\"stopRepeat()\"\r\n >\r\n <hu-icon name=\"chevron-up\" [size]=\"14\" />\r\n </button>\r\n <button\r\n type=\"button\"\r\n class=\"hu-input-number__btn\"\r\n tabindex=\"-1\"\r\n aria-label=\"Azalt\"\r\n [disabled]=\"!canDecrement()\"\r\n (pointerdown)=\"startRepeat(-1, $event)\"\r\n (pointerup)=\"stopRepeat()\"\r\n (pointerleave)=\"stopRepeat()\"\r\n (pointercancel)=\"stopRepeat()\"\r\n >\r\n <hu-icon name=\"chevron-down\" [size]=\"14\" />\r\n </button>\r\n </span>\r\n }\r\n</div>\r\n\r\n@if (buttons() === 'horizontal') {\r\n <button\r\n type=\"button\"\r\n class=\"hu-input-number__btn hu-input-number__btn--plus\"\r\n tabindex=\"-1\"\r\n aria-label=\"Artır\"\r\n [disabled]=\"!canIncrement()\"\r\n (pointerdown)=\"startRepeat(1, $event)\"\r\n (pointerup)=\"stopRepeat()\"\r\n (pointerleave)=\"stopRepeat()\"\r\n (pointercancel)=\"stopRepeat()\"\r\n >\r\n <hu-icon name=\"plus\" [size]=\"16\" />\r\n </button>\r\n}\r\n",
7497
+ styles: [".hu-input-number{display:flex;align-items:stretch;width:100%;min-width:0}.hu-input-number__control{position:relative;display:flex;flex:1;align-items:center;min-width:0}.hu-input-number__input{font-variant-numeric:tabular-nums}.hu-input-number__input--prefix{padding-left:calc(var(--hu-affix-prefix) + var(--hu-space-3) + var(--hu-space-2))}.hu-input-number__input--suffix{padding-right:calc(var(--hu-affix-suffix) + var(--hu-space-3) + var(--hu-space-2))}[data-buttons=stacked] .hu-input-number__input{padding-right:2.25rem}[data-buttons=stacked] .hu-input-number__input--suffix{padding-right:calc(var(--hu-affix-suffix) + 2.25rem + var(--hu-space-2))}[data-buttons=horizontal] .hu-input-number__input{position:relative;text-align:center;border-radius:0}[data-buttons=horizontal] .hu-input-number__input:focus{z-index:1}.hu-input-number__affix{position:absolute;z-index:2;font-size:var(--hu-text-sm);color:var(--hu-text-muted);pointer-events:none}.hu-input-number__affix--prefix{left:var(--hu-space-3)}.hu-input-number__affix--suffix{right:var(--hu-space-3)}[data-buttons=stacked] .hu-input-number__affix--suffix{right:2.25rem}.hu-input-number--disabled .hu-input-number__affix{color:var(--hu-text-subtle)}.hu-input-number__btn{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;padding:0;font:inherit;color:var(--hu-text-muted);background:var(--hu-surface-2);border:1px solid var(--hu-border-strong);cursor:pointer;touch-action:manipulation;-webkit-user-select:none;user-select:none;transition:background-color var(--hu-transition),color var(--hu-transition)}.hu-input-number__btn:hover:not(:disabled){color:var(--hu-text);background:var(--hu-surface-3)}.hu-input-number__btn:active:not(:disabled){background:var(--hu-border)}.hu-input-number__btn:disabled{opacity:.45;cursor:not-allowed}.hu-input-number__btn--minus,.hu-input-number__btn--plus{width:var(--hu-control-md)}.hu-input-number__btn--minus{margin-right:-1px;border-radius:var(--hu-radius-md) 0 0 var(--hu-radius-md)}.hu-input-number__btn--plus{margin-left:-1px;border-radius:0 var(--hu-radius-md) var(--hu-radius-md) 0}[data-size=sm] .hu-input-number__btn--minus,[data-size=sm] .hu-input-number__btn--plus{width:var(--hu-control-sm)}[data-size=lg] .hu-input-number__btn--minus,[data-size=lg] .hu-input-number__btn--plus{width:var(--hu-control-lg)}.hu-input-number__stack{position:absolute;top:1px;right:1px;bottom:1px;z-index:2;display:flex;flex-direction:column;width:1.75rem;overflow:hidden;border-left:1px solid var(--hu-border);border-radius:0 calc(var(--hu-radius-md) - 1px) calc(var(--hu-radius-md) - 1px) 0}.hu-input-number__stack .hu-input-number__btn{flex:1;width:100%;background:transparent;border:0}.hu-input-number__stack .hu-input-number__btn+.hu-input-number__btn{border-top:1px solid var(--hu-border)}.hu-input-number__stack .hu-input-number__btn:hover:not(:disabled){background:var(--hu-surface-3)}\n"],
7498
+ dependencies: [{
7499
+ kind: "component",
7500
+ type: HuIcon,
7501
+ selector: "hu-icon",
7502
+ inputs: [
7503
+ "name",
7504
+ "size",
7505
+ "strokeWidth",
7506
+ "label"
7507
+ ]
7508
+ }],
7509
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
7510
+ encapsulation: i0.ViewEncapsulation.None
7511
+ });
7512
+ };
7513
+ i0.ɵɵngDeclareClassMetadata({
7514
+ minVersion: "12.0.0",
7515
+ version: "22.2.0",
7516
+ ngImport: i0,
7517
+ type: HuInputNumber,
7518
+ decorators: [{
7519
+ type: Component,
7520
+ args: [{
7521
+ selector: "hu-input-number",
7522
+ imports: [HuIcon],
7523
+ providers: [
7524
+ {
7525
+ provide: NG_VALUE_ACCESSOR,
7526
+ useExisting: forwardRef(() => HuInputNumber),
7527
+ multi: true
7528
+ },
7529
+ {
7530
+ provide: NG_VALIDATORS,
7531
+ useExisting: forwardRef(() => HuInputNumber),
7532
+ multi: true
7533
+ },
7534
+ {
7535
+ provide: HuFormFieldControl,
7536
+ useExisting: forwardRef(() => HuInputNumber)
7537
+ }
7538
+ ],
7539
+ host: {
7540
+ class: "hu-input-number",
7541
+ "[attr.data-buttons]": "buttons()",
7542
+ "[attr.data-size]": "size()",
7543
+ "[class.hu-input-number--disabled]": "isDisabled()",
7544
+ "[class.hu-input-number--invalid]": "isInvalid()",
7545
+ "[style.--hu-affix-prefix]": "(prefixText()?.length ?? 0) + 'ch'",
7546
+ "[style.--hu-affix-suffix]": "(suffix()?.length ?? 0) + 'ch'"
7547
+ },
7548
+ encapsulation: ViewEncapsulation.None,
7549
+ changeDetection: ChangeDetectionStrategy.OnPush,
7550
+ template: "@if (buttons() === 'horizontal') {\r\n <button\r\n type=\"button\"\r\n class=\"hu-input-number__btn hu-input-number__btn--minus\"\r\n tabindex=\"-1\"\r\n aria-label=\"Azalt\"\r\n [disabled]=\"!canDecrement()\"\r\n (pointerdown)=\"startRepeat(-1, $event)\"\r\n (pointerup)=\"stopRepeat()\"\r\n (pointerleave)=\"stopRepeat()\"\r\n (pointercancel)=\"stopRepeat()\"\r\n >\r\n <hu-icon name=\"minus\" [size]=\"16\" />\r\n </button>\r\n}\r\n\r\n<div class=\"hu-input-number__control\">\r\n @if (prefixText()) {\r\n <span class=\"hu-input-number__affix hu-input-number__affix--prefix\" aria-hidden=\"true\">{{ prefixText() }}</span>\r\n }\r\n <input\r\n #input\r\n type=\"text\"\r\n class=\"hu-input hu-input-number__input\"\r\n role=\"spinbutton\"\r\n autocomplete=\"off\"\r\n [attr.inputmode]=\"fraction().max > 0 ? 'decimal' : 'numeric'\"\r\n [id]=\"id()\"\r\n [attr.data-size]=\"size()\"\r\n [class.hu-input--invalid]=\"isInvalid()\"\r\n [class.hu-input-number__input--prefix]=\"!!prefixText()\"\r\n [class.hu-input-number__input--suffix]=\"!!suffix()\"\r\n [attr.aria-invalid]=\"isInvalid() || null\"\r\n [attr.aria-describedby]=\"field?.describedBy() ?? null\"\r\n [attr.aria-label]=\"ariaLabel() || null\"\r\n [attr.aria-valuenow]=\"value()\"\r\n [attr.aria-valuemin]=\"min()\"\r\n [attr.aria-valuemax]=\"max()\"\r\n [attr.aria-valuetext]=\"text() ? (prefixText() ?? '') + text() + (suffix() ? ' ' + suffix() : '') : null\"\r\n [attr.placeholder]=\"placeholder() ?? null\"\r\n [value]=\"text()\"\r\n [disabled]=\"isDisabled()\"\r\n [readOnly]=\"readonly()\"\r\n (focus)=\"onFocus()\"\r\n (blur)=\"onBlur()\"\r\n (keydown)=\"onKeydown($event)\"\r\n (input)=\"onInput($event)\"\r\n />\r\n @if (suffix()) {\r\n <span class=\"hu-input-number__affix hu-input-number__affix--suffix\" aria-hidden=\"true\">{{ suffix() }}</span>\r\n }\r\n\r\n @if (buttons() === 'stacked') {\r\n <span class=\"hu-input-number__stack\">\r\n <button\r\n type=\"button\"\r\n class=\"hu-input-number__btn\"\r\n tabindex=\"-1\"\r\n aria-label=\"Artır\"\r\n [disabled]=\"!canIncrement()\"\r\n (pointerdown)=\"startRepeat(1, $event)\"\r\n (pointerup)=\"stopRepeat()\"\r\n (pointerleave)=\"stopRepeat()\"\r\n (pointercancel)=\"stopRepeat()\"\r\n >\r\n <hu-icon name=\"chevron-up\" [size]=\"14\" />\r\n </button>\r\n <button\r\n type=\"button\"\r\n class=\"hu-input-number__btn\"\r\n tabindex=\"-1\"\r\n aria-label=\"Azalt\"\r\n [disabled]=\"!canDecrement()\"\r\n (pointerdown)=\"startRepeat(-1, $event)\"\r\n (pointerup)=\"stopRepeat()\"\r\n (pointerleave)=\"stopRepeat()\"\r\n (pointercancel)=\"stopRepeat()\"\r\n >\r\n <hu-icon name=\"chevron-down\" [size]=\"14\" />\r\n </button>\r\n </span>\r\n }\r\n</div>\r\n\r\n@if (buttons() === 'horizontal') {\r\n <button\r\n type=\"button\"\r\n class=\"hu-input-number__btn hu-input-number__btn--plus\"\r\n tabindex=\"-1\"\r\n aria-label=\"Artır\"\r\n [disabled]=\"!canIncrement()\"\r\n (pointerdown)=\"startRepeat(1, $event)\"\r\n (pointerup)=\"stopRepeat()\"\r\n (pointerleave)=\"stopRepeat()\"\r\n (pointercancel)=\"stopRepeat()\"\r\n >\r\n <hu-icon name=\"plus\" [size]=\"16\" />\r\n </button>\r\n}\r\n",
7551
+ styles: [".hu-input-number{display:flex;align-items:stretch;width:100%;min-width:0}.hu-input-number__control{position:relative;display:flex;flex:1;align-items:center;min-width:0}.hu-input-number__input{font-variant-numeric:tabular-nums}.hu-input-number__input--prefix{padding-left:calc(var(--hu-affix-prefix) + var(--hu-space-3) + var(--hu-space-2))}.hu-input-number__input--suffix{padding-right:calc(var(--hu-affix-suffix) + var(--hu-space-3) + var(--hu-space-2))}[data-buttons=stacked] .hu-input-number__input{padding-right:2.25rem}[data-buttons=stacked] .hu-input-number__input--suffix{padding-right:calc(var(--hu-affix-suffix) + 2.25rem + var(--hu-space-2))}[data-buttons=horizontal] .hu-input-number__input{position:relative;text-align:center;border-radius:0}[data-buttons=horizontal] .hu-input-number__input:focus{z-index:1}.hu-input-number__affix{position:absolute;z-index:2;font-size:var(--hu-text-sm);color:var(--hu-text-muted);pointer-events:none}.hu-input-number__affix--prefix{left:var(--hu-space-3)}.hu-input-number__affix--suffix{right:var(--hu-space-3)}[data-buttons=stacked] .hu-input-number__affix--suffix{right:2.25rem}.hu-input-number--disabled .hu-input-number__affix{color:var(--hu-text-subtle)}.hu-input-number__btn{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;padding:0;font:inherit;color:var(--hu-text-muted);background:var(--hu-surface-2);border:1px solid var(--hu-border-strong);cursor:pointer;touch-action:manipulation;-webkit-user-select:none;user-select:none;transition:background-color var(--hu-transition),color var(--hu-transition)}.hu-input-number__btn:hover:not(:disabled){color:var(--hu-text);background:var(--hu-surface-3)}.hu-input-number__btn:active:not(:disabled){background:var(--hu-border)}.hu-input-number__btn:disabled{opacity:.45;cursor:not-allowed}.hu-input-number__btn--minus,.hu-input-number__btn--plus{width:var(--hu-control-md)}.hu-input-number__btn--minus{margin-right:-1px;border-radius:var(--hu-radius-md) 0 0 var(--hu-radius-md)}.hu-input-number__btn--plus{margin-left:-1px;border-radius:0 var(--hu-radius-md) var(--hu-radius-md) 0}[data-size=sm] .hu-input-number__btn--minus,[data-size=sm] .hu-input-number__btn--plus{width:var(--hu-control-sm)}[data-size=lg] .hu-input-number__btn--minus,[data-size=lg] .hu-input-number__btn--plus{width:var(--hu-control-lg)}.hu-input-number__stack{position:absolute;top:1px;right:1px;bottom:1px;z-index:2;display:flex;flex-direction:column;width:1.75rem;overflow:hidden;border-left:1px solid var(--hu-border);border-radius:0 calc(var(--hu-radius-md) - 1px) calc(var(--hu-radius-md) - 1px) 0}.hu-input-number__stack .hu-input-number__btn{flex:1;width:100%;background:transparent;border:0}.hu-input-number__stack .hu-input-number__btn+.hu-input-number__btn{border-top:1px solid var(--hu-border)}.hu-input-number__stack .hu-input-number__btn:hover:not(:disabled){background:var(--hu-surface-3)}\n"]
7552
+ }]
7553
+ }],
7554
+ ctorParameters: () => [],
7555
+ propDecorators: {
7556
+ value: [{
7557
+ type: i0.Input,
7558
+ args: [{
7559
+ isSignal: true,
7560
+ alias: "value",
7561
+ required: false
7562
+ }]
7563
+ }, {
7564
+ type: i0.Output,
7565
+ args: ["valueChange"]
7566
+ }],
7567
+ min: [{
7568
+ type: i0.Input,
7569
+ args: [{
7570
+ isSignal: true,
7571
+ alias: "min",
7572
+ required: false
7573
+ }]
7574
+ }],
7575
+ max: [{
7576
+ type: i0.Input,
7577
+ args: [{
7578
+ isSignal: true,
7579
+ alias: "max",
7580
+ required: false
7581
+ }]
7582
+ }],
7583
+ step: [{
7584
+ type: i0.Input,
7585
+ args: [{
7586
+ isSignal: true,
7587
+ alias: "step",
7588
+ required: false
7589
+ }]
7590
+ }],
7591
+ mode: [{
7592
+ type: i0.Input,
7593
+ args: [{
7594
+ isSignal: true,
7595
+ alias: "mode",
7596
+ required: false
7597
+ }]
7598
+ }],
7599
+ currency: [{
7600
+ type: i0.Input,
7601
+ args: [{
7602
+ isSignal: true,
7603
+ alias: "currency",
7604
+ required: false
7605
+ }]
7606
+ }],
7607
+ minFractionDigits: [{
7608
+ type: i0.Input,
7609
+ args: [{
7610
+ isSignal: true,
7611
+ alias: "minFractionDigits",
7612
+ required: false
7613
+ }]
7614
+ }],
7615
+ maxFractionDigits: [{
7616
+ type: i0.Input,
7617
+ args: [{
7618
+ isSignal: true,
7619
+ alias: "maxFractionDigits",
7620
+ required: false
7621
+ }]
7622
+ }],
7623
+ useGrouping: [{
7624
+ type: i0.Input,
7625
+ args: [{
7626
+ isSignal: true,
7627
+ alias: "useGrouping",
7628
+ required: false
7629
+ }]
7630
+ }],
7631
+ prefix: [{
7632
+ type: i0.Input,
7633
+ args: [{
7634
+ isSignal: true,
7635
+ alias: "prefix",
7636
+ required: false
7637
+ }]
7638
+ }],
7639
+ suffix: [{
7640
+ type: i0.Input,
7641
+ args: [{
7642
+ isSignal: true,
7643
+ alias: "suffix",
7644
+ required: false
7645
+ }]
7646
+ }],
7647
+ buttons: [{
7648
+ type: i0.Input,
7649
+ args: [{
7650
+ isSignal: true,
7651
+ alias: "buttons",
7652
+ required: false
7653
+ }]
7654
+ }],
7655
+ placeholder: [{
7656
+ type: i0.Input,
7657
+ args: [{
7658
+ isSignal: true,
7659
+ alias: "placeholder",
7660
+ required: false
7661
+ }]
7662
+ }],
7663
+ size: [{
7664
+ type: i0.Input,
7665
+ args: [{
7666
+ isSignal: true,
7667
+ alias: "size",
7668
+ required: false
7669
+ }]
7670
+ }],
7671
+ disabled: [{
7672
+ type: i0.Input,
7673
+ args: [{
7674
+ isSignal: true,
7675
+ alias: "disabled",
7676
+ required: false
7677
+ }]
7678
+ }],
7679
+ readonly: [{
7680
+ type: i0.Input,
7681
+ args: [{
7682
+ isSignal: true,
7683
+ alias: "readonly",
7684
+ required: false
7685
+ }]
7686
+ }],
7687
+ ariaLabel: [{
7688
+ type: i0.Input,
7689
+ args: [{
7690
+ isSignal: true,
7691
+ alias: "ariaLabel",
7692
+ required: false
7693
+ }]
7694
+ }],
7695
+ id: [{
7696
+ type: i0.Input,
7697
+ args: [{
7698
+ isSignal: true,
7699
+ alias: "id",
7700
+ required: false
7701
+ }]
7702
+ }],
7703
+ input: [{
7704
+ type: i0.ViewChild,
7705
+ args: ["input", { isSignal: true }]
7706
+ }]
7707
+ }
7708
+ });
7709
+ function group(int) {
7710
+ return int.replace(/\B(?=(\d{3})+(?!\d))/g, ".");
7711
+ }
7712
+ function parseNumber(text) {
7713
+ const clean = text.replace(/[^\d,-]/g, "").replace(",", ".");
7714
+ if (!clean || clean === "-" || clean === "." || clean === "-.") return null;
7715
+ const n = Number(clean.endsWith(".") ? clean.slice(0, -1) : clean);
7716
+ return Number.isNaN(n) ? null : n;
7717
+ }
7718
+ function significant(text) {
7719
+ return text.replace(/[^\d,-]/g, "").length;
7720
+ }
7721
+ function positionAfter(text, count) {
7722
+ if (count <= 0) return text.startsWith("-") ? 0 : 0;
7723
+ let seen = 0;
7724
+ for (let i = 0; i < text.length; i++) {
7725
+ if (/[\d,-]/.test(text[i])) seen++;
7726
+ if (seen === count) return i + 1;
7727
+ }
7728
+ return text.length;
7729
+ }
7730
+ function decimalsOf(n) {
7731
+ const s = String(n);
7732
+ return s.includes(".") ? s.split(".")[1].length : 0;
7733
+ }
7734
+ var HuMultiSelect = class HuMultiSelect {
7735
+ injector = inject(Injector);
7736
+ host = inject(ElementRef);
7737
+ win = inject(DOCUMENT).defaultView;
7738
+ field = inject(HU_FORM_FIELD, {
7739
+ optional: true,
7740
+ host: true
7741
+ });
7742
+ options = input([], ...ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []);
7743
+ value = model([], ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
7744
+ values = computed(() => this.value() ?? [], ...ngDevMode ? [{ debugName: "values" }] : /* istanbul ignore next */ []);
7745
+ placeholder = input("Seçin", ...ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []);
7746
+ filter = input(true, {
7747
+ ...ngDevMode ? { debugName: "filter" } : /* istanbul ignore next */ {},
7748
+ transform: booleanAttribute
7749
+ });
7750
+ filterPlaceholder = input("Ara…", ...ngDevMode ? [{ debugName: "filterPlaceholder" }] : /* istanbul ignore next */ []);
7751
+ showSelectAll = input(true, {
7752
+ ...ngDevMode ? { debugName: "showSelectAll" } : /* istanbul ignore next */ {},
7753
+ transform: booleanAttribute
7754
+ });
7755
+ showClear = input(true, {
7756
+ ...ngDevMode ? { debugName: "showClear" } : /* istanbul ignore next */ {},
7757
+ transform: booleanAttribute
7758
+ });
7759
+ display = input("chips", ...ngDevMode ? [{ debugName: "display" }] : /* istanbul ignore next */ []);
7760
+ maxSelectedLabels = input(3, {
7761
+ ...ngDevMode ? { debugName: "maxSelectedLabels" } : /* istanbul ignore next */ {},
7762
+ transform: numberAttribute
7763
+ });
7764
+ selectionLimit = input(null, ...ngDevMode ? [{ debugName: "selectionLimit" }] : /* istanbul ignore next */ []);
7765
+ emptyMessage = input("Sonuç bulunamadı", ...ngDevMode ? [{ debugName: "emptyMessage" }] : /* istanbul ignore next */ []);
7766
+ size = input("md", ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
7767
+ disabled = input(false, {
7768
+ ...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
7769
+ transform: booleanAttribute
7770
+ });
7771
+ ariaLabel = input(...ngDevMode ? [void 0, { debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
7772
+ id = input(huUniqueId("hu-multi-select"), ...ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []);
7773
+ compareWith = input(Object.is, ...ngDevMode ? [{ debugName: "compareWith" }] : /* istanbul ignore next */ []);
7774
+ closed = output();
7775
+ open = signal(false, ...ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []);
7776
+ query = signal("", ...ngDevMode ? [{ debugName: "query" }] : /* istanbul ignore next */ []);
7777
+ activeIndex = signal(-1, ...ngDevMode ? [{ debugName: "activeIndex" }] : /* istanbul ignore next */ []);
7778
+ listId = huUniqueId("hu-multi-select-list");
7779
+ formDisabled = signal(false, ...ngDevMode ? [{ debugName: "formDisabled" }] : /* istanbul ignore next */ []);
7780
+ isDisabled = computed(() => this.disabled() || this.formDisabled(), ...ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []);
7781
+ selectedOptions = computed(() => {
7782
+ const cmp = this.compareWith();
7783
+ return this.values().map((v) => this.options().find((o) => cmp(o.value, v))).filter((o) => !!o);
7784
+ }, ...ngDevMode ? [{ debugName: "selectedOptions" }] : /* istanbul ignore next */ []);
7785
+ visible = computed(() => {
7786
+ const q = huFold(this.query().trim());
7787
+ return q ? this.options().filter((o) => huFold(o.label).includes(q) || huFold(o.description ?? "").includes(q)) : [...this.options()];
7788
+ }, ...ngDevMode ? [{ debugName: "visible" }] : /* istanbul ignore next */ []);
7789
+ rows = computed(() => {
7790
+ const rows = [];
7791
+ let group;
7792
+ this.visible().forEach((option, index) => {
7793
+ if (option.group && option.group !== group) rows.push({
7794
+ kind: "group",
7795
+ label: option.group
7796
+ });
7797
+ group = option.group;
7798
+ rows.push({
7799
+ kind: "option",
7800
+ option,
7801
+ index
7802
+ });
7803
+ });
7804
+ return rows;
7805
+ }, ...ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []);
7806
+ selectable = computed(() => this.visible().filter((o) => !o.disabled), ...ngDevMode ? [{ debugName: "selectable" }] : /* istanbul ignore next */ []);
7807
+ allSelected = computed(() => {
7808
+ const list = this.selectable();
7809
+ return list.length > 0 && list.every((o) => this.isSelected(o));
7810
+ }, ...ngDevMode ? [{ debugName: "allSelected" }] : /* istanbul ignore next */ []);
7811
+ someSelected = computed(() => !this.allSelected() && this.selectable().some((o) => this.isSelected(o)), ...ngDevMode ? [{ debugName: "someSelected" }] : /* istanbul ignore next */ []);
7812
+ limitReached = computed(() => {
7813
+ const limit = this.selectionLimit();
7814
+ return limit != null && this.values().length >= limit;
7815
+ }, ...ngDevMode ? [{ debugName: "limitReached" }] : /* istanbul ignore next */ []);
7816
+ summary = computed(() => {
7817
+ const selected = this.selectedOptions();
7818
+ if (selected.length > this.maxSelectedLabels()) return `${selected.length} seçildi`;
7819
+ return selected.map((o) => o.label).join(", ");
7820
+ }, ...ngDevMode ? [{ debugName: "summary" }] : /* istanbul ignore next */ []);
7821
+ showChips = computed(() => this.display() === "chips" && this.selectedOptions().length <= this.maxSelectedLabels(), ...ngDevMode ? [{ debugName: "showChips" }] : /* istanbul ignore next */ []);
7822
+ ngControl;
7823
+ get hasControl() {
7824
+ return !!this.resolveControl();
7825
+ }
7826
+ controlErrorVisible = signal(false, ...ngDevMode ? [{ debugName: "controlErrorVisible" }] : /* istanbul ignore next */ []);
7827
+ errors = signal(null, ...ngDevMode ? [{ debugName: "errors" }] : /* istanbul ignore next */ []);
7828
+ isInvalid = computed(() => this.controlErrorVisible() || (this.field?.showError() ?? false), ...ngDevMode ? [{ debugName: "isInvalid" }] : /* istanbul ignore next */ []);
7829
+ trigger = viewChild.required("trigger", ...ngDevMode ? [{ debugName: "trigger" }] : /* istanbul ignore next */ []);
7830
+ panel = viewChild.required("panel", ...ngDevMode ? [{ debugName: "panel" }] : /* istanbul ignore next */ []);
7831
+ search = viewChild("search", ...ngDevMode ? [{ debugName: "search" }] : /* istanbul ignore next */ []);
7832
+ listbox = viewChild("listbox", ...ngDevMode ? [{ debugName: "listbox" }] : /* istanbul ignore next */ []);
7833
+ supportsPopover = typeof HTMLElement !== "undefined" && "showPopover" in HTMLElement.prototype;
7834
+ pointerInside = false;
7835
+ onChange = () => {};
7836
+ onTouched = () => {};
7837
+ constructor() {
7838
+ const reposition = () => this.open() && this.positionPanel();
7839
+ this.win?.addEventListener("resize", reposition);
7840
+ this.win?.addEventListener("scroll", reposition, true);
7841
+ inject(DestroyRef).onDestroy(() => {
7842
+ this.win?.removeEventListener("resize", reposition);
7843
+ this.win?.removeEventListener("scroll", reposition, true);
7844
+ });
7845
+ }
7846
+ ngDoCheck() {
7847
+ const c = this.resolveControl();
7848
+ if (!c) return;
7849
+ this.controlErrorVisible.set(!!c.invalid && !!(c.touched || c.dirty));
7850
+ this.errors.set(c.errors);
7851
+ }
7852
+ toggle() {
7853
+ if (this.open()) this.close(true);
7854
+ else this.show();
7855
+ }
7856
+ show() {
7857
+ if (this.isDisabled() || this.open()) return;
7858
+ this.query.set("");
7859
+ this.open.set(true);
7860
+ const first = this.visible().findIndex((o) => this.isSelected(o));
7861
+ this.activeIndex.set(first >= 0 ? first : this.nextEnabled(-1, 1));
7862
+ afterNextRender(() => {
7863
+ if (!this.open()) return;
7864
+ if (this.supportsPopover) this.panel().nativeElement.showPopover();
7865
+ this.positionPanel();
7866
+ (this.search() ?? this.listbox())?.nativeElement.focus({ preventScroll: true });
7867
+ this.scrollActiveIntoView();
7868
+ }, { injector: this.injector });
7869
+ }
7870
+ close(restoreFocus = false) {
7871
+ if (!this.open()) return;
7872
+ this.open.set(false);
7873
+ const panel = this.panel().nativeElement;
7874
+ if (this.supportsPopover && panel.matches(":popover-open")) panel.hidePopover();
7875
+ if (restoreFocus) this.trigger().nativeElement.focus();
7876
+ this.closed.emit();
7877
+ }
7878
+ isSelected(option) {
7879
+ const cmp = this.compareWith();
7880
+ return this.values().some((v) => cmp(v, option.value));
7881
+ }
7882
+ toggleOption(option) {
7883
+ if (option.disabled || this.isDisabled()) return;
7884
+ const cmp = this.compareWith();
7885
+ if (this.isSelected(option)) this.commit(this.values().filter((v) => !cmp(v, option.value)));
7886
+ else if (!this.limitReached()) {
7887
+ const next = [...this.values(), option.value];
7888
+ this.commit(this.sortByOptions(next));
7889
+ }
7890
+ }
7891
+ toggleAll() {
7892
+ const cmp = this.compareWith();
7893
+ const visible = this.selectable();
7894
+ if (this.allSelected()) this.commit(this.values().filter((v) => !visible.some((o) => cmp(o.value, v))));
7895
+ else {
7896
+ const add = visible.filter((o) => !this.isSelected(o)).map((o) => o.value);
7897
+ const limit = this.selectionLimit();
7898
+ const room = limit == null ? add.length : Math.max(0, limit - this.values().length);
7899
+ this.commit(this.sortByOptions([...this.values(), ...add.slice(0, room)]));
7900
+ }
7901
+ }
7902
+ remove(option, event) {
7903
+ event.stopPropagation();
7904
+ if (this.isDisabled()) return;
7905
+ const cmp = this.compareWith();
7906
+ this.commit(this.values().filter((v) => !cmp(v, option.value)));
7907
+ }
7908
+ clearAll(event) {
7909
+ event.stopPropagation();
7910
+ if (this.isDisabled()) return;
7911
+ this.commit([]);
7912
+ this.trigger().nativeElement.focus();
7913
+ }
7914
+ onTriggerKeydown(event) {
7915
+ if ([
7916
+ "Enter",
7917
+ " ",
7918
+ "ArrowDown",
7919
+ "ArrowUp"
7920
+ ].includes(event.key)) {
7921
+ event.preventDefault();
7922
+ this.show();
7923
+ } else if (event.key === "Backspace" && !this.open() && this.values().length) this.commit(this.values().slice(0, -1));
7924
+ }
7925
+ onPanelKeydown(event) {
7926
+ const visible = this.visible();
7927
+ switch (event.key) {
7928
+ case "ArrowDown":
7929
+ event.preventDefault();
7930
+ this.activeIndex.set(this.nextEnabled(this.activeIndex(), 1));
7931
+ break;
7932
+ case "ArrowUp":
7933
+ event.preventDefault();
7934
+ this.activeIndex.set(this.nextEnabled(this.activeIndex(), -1));
7935
+ break;
7936
+ case "Home":
7937
+ if (event.target === this.search()?.nativeElement) return;
7938
+ event.preventDefault();
7939
+ this.activeIndex.set(this.nextEnabled(-1, 1));
7940
+ break;
7941
+ case "End":
7942
+ if (event.target === this.search()?.nativeElement) return;
7943
+ event.preventDefault();
7944
+ this.activeIndex.set(this.nextEnabled(visible.length, -1));
7945
+ break;
7946
+ case "Enter":
7947
+ event.preventDefault();
7948
+ if (visible[this.activeIndex()]) this.toggleOption(visible[this.activeIndex()]);
7949
+ break;
7950
+ case " ":
7951
+ if (event.target === this.search()?.nativeElement) return;
7952
+ event.preventDefault();
7953
+ if (visible[this.activeIndex()]) this.toggleOption(visible[this.activeIndex()]);
7954
+ break;
7955
+ case "a":
7956
+ if ((event.ctrlKey || event.metaKey) && event.target !== this.search()?.nativeElement) {
7957
+ event.preventDefault();
7958
+ this.toggleAll();
7959
+ }
7960
+ return;
7961
+ case "Escape":
7962
+ event.preventDefault();
7963
+ event.stopPropagation();
7964
+ this.close(true);
7965
+ return;
7966
+ case "Tab":
7967
+ this.close();
7968
+ return;
7969
+ default: return;
7970
+ }
7971
+ this.scrollActiveIntoView();
7972
+ }
7973
+ onQuery(value) {
7974
+ this.query.set(value);
7975
+ this.activeIndex.set(this.nextEnabled(-1, 1));
7976
+ }
7977
+ optionId(index) {
7978
+ return `${this.listId}-${index}`;
7979
+ }
7980
+ onFocusOut(event) {
7981
+ const next = event.relatedTarget;
7982
+ if (next && this.host.nativeElement.contains(next)) return;
7983
+ if (!next && this.pointerInside && this.open()) return;
7984
+ this.close();
7985
+ this.onTouched();
7986
+ }
7987
+ onDocumentPointer(event) {
7988
+ this.pointerInside = this.host.nativeElement.contains(event.target);
7989
+ if (this.open() && !this.pointerInside) this.close();
7990
+ }
7991
+ writeValue(value) {
7992
+ this.value.set(Array.isArray(value) ? value : value == null ? [] : [value]);
7993
+ }
7994
+ registerOnChange(fn) {
7995
+ this.onChange = fn;
7996
+ }
7997
+ registerOnTouched(fn) {
7998
+ this.onTouched = fn;
7999
+ }
8000
+ setDisabledState(disabled) {
8001
+ this.formDisabled.set(disabled);
8002
+ if (disabled) this.close();
8003
+ }
8004
+ commit(value) {
8005
+ this.value.set(value);
8006
+ this.onChange(value);
8007
+ if (this.open()) afterNextRender(() => this.positionPanel(), { injector: this.injector });
8008
+ }
8009
+ sortByOptions(values) {
8010
+ const cmp = this.compareWith();
8011
+ const order = (v) => {
8012
+ const i = this.options().findIndex((o) => cmp(o.value, v));
8013
+ return i < 0 ? Number.MAX_SAFE_INTEGER : i;
8014
+ };
8015
+ return [...values].sort((a, b) => order(a) - order(b));
8016
+ }
8017
+ nextEnabled(from, direction) {
8018
+ const list = this.visible();
8019
+ for (let i = from + direction; i >= 0 && i < list.length; i += direction) if (!list[i].disabled) return i;
8020
+ return from >= 0 && from < list.length ? from : -1;
8021
+ }
8022
+ scrollActiveIntoView() {
8023
+ afterNextRender(() => this.panel().nativeElement.querySelector(".hu-multi-select__option--active")?.scrollIntoView({ block: "nearest" }), { injector: this.injector });
8024
+ }
8025
+ positionPanel() {
8026
+ const panel = this.panel().nativeElement;
8027
+ if (!this.supportsPopover || !this.win) return;
8028
+ const anchor = this.trigger().nativeElement.getBoundingClientRect();
8029
+ panel.style.width = `${anchor.width}px`;
8030
+ const { offsetWidth: width, offsetHeight: height } = panel;
8031
+ const gap = 4;
8032
+ const top = this.win.innerHeight - anchor.bottom < height + gap && anchor.top > height + gap ? anchor.top - height - gap : anchor.bottom + gap;
8033
+ const left = Math.max(8, Math.min(anchor.left, this.win.innerWidth - width - 8));
8034
+ panel.style.top = `${top}px`;
8035
+ panel.style.left = `${left}px`;
8036
+ }
8037
+ resolveControl() {
8038
+ if (this.ngControl === void 0) this.ngControl = this.injector.get(NgControl, null, {
8039
+ self: true,
8040
+ optional: true
8041
+ });
8042
+ return this.ngControl;
8043
+ }
8044
+ static ɵfac = i0.ɵɵngDeclareFactory({
8045
+ minVersion: "12.0.0",
8046
+ version: "22.2.0",
8047
+ ngImport: i0,
8048
+ type: HuMultiSelect,
8049
+ deps: [],
8050
+ target: i0.ɵɵFactoryTarget.Component
8051
+ });
8052
+ static ɵcmp = i0.ɵɵngDeclareComponent({
8053
+ minVersion: "17.0.0",
8054
+ version: "22.2.0",
8055
+ type: HuMultiSelect,
8056
+ isStandalone: true,
8057
+ selector: "hu-multi-select",
8058
+ inputs: {
8059
+ options: {
8060
+ classPropertyName: "options",
8061
+ publicName: "options",
8062
+ isSignal: true,
8063
+ isRequired: false,
8064
+ transformFunction: null
8065
+ },
8066
+ value: {
8067
+ classPropertyName: "value",
8068
+ publicName: "value",
8069
+ isSignal: true,
8070
+ isRequired: false,
8071
+ transformFunction: null
8072
+ },
8073
+ placeholder: {
8074
+ classPropertyName: "placeholder",
8075
+ publicName: "placeholder",
6764
8076
  isSignal: true,
6765
8077
  isRequired: false,
6766
8078
  transformFunction: null
6767
8079
  },
6768
- currency: {
6769
- classPropertyName: "currency",
6770
- publicName: "currency",
8080
+ filter: {
8081
+ classPropertyName: "filter",
8082
+ publicName: "filter",
6771
8083
  isSignal: true,
6772
8084
  isRequired: false,
6773
8085
  transformFunction: null
6774
8086
  },
6775
- minFractionDigits: {
6776
- classPropertyName: "minFractionDigits",
6777
- publicName: "minFractionDigits",
8087
+ filterPlaceholder: {
8088
+ classPropertyName: "filterPlaceholder",
8089
+ publicName: "filterPlaceholder",
6778
8090
  isSignal: true,
6779
8091
  isRequired: false,
6780
8092
  transformFunction: null
6781
8093
  },
6782
- maxFractionDigits: {
6783
- classPropertyName: "maxFractionDigits",
6784
- publicName: "maxFractionDigits",
8094
+ showSelectAll: {
8095
+ classPropertyName: "showSelectAll",
8096
+ publicName: "showSelectAll",
6785
8097
  isSignal: true,
6786
8098
  isRequired: false,
6787
8099
  transformFunction: null
6788
8100
  },
6789
- useGrouping: {
6790
- classPropertyName: "useGrouping",
6791
- publicName: "useGrouping",
8101
+ showClear: {
8102
+ classPropertyName: "showClear",
8103
+ publicName: "showClear",
6792
8104
  isSignal: true,
6793
8105
  isRequired: false,
6794
8106
  transformFunction: null
6795
8107
  },
6796
- prefix: {
6797
- classPropertyName: "prefix",
6798
- publicName: "prefix",
8108
+ display: {
8109
+ classPropertyName: "display",
8110
+ publicName: "display",
6799
8111
  isSignal: true,
6800
8112
  isRequired: false,
6801
8113
  transformFunction: null
6802
8114
  },
6803
- suffix: {
6804
- classPropertyName: "suffix",
6805
- publicName: "suffix",
8115
+ maxSelectedLabels: {
8116
+ classPropertyName: "maxSelectedLabels",
8117
+ publicName: "maxSelectedLabels",
6806
8118
  isSignal: true,
6807
8119
  isRequired: false,
6808
8120
  transformFunction: null
6809
8121
  },
6810
- buttons: {
6811
- classPropertyName: "buttons",
6812
- publicName: "buttons",
8122
+ selectionLimit: {
8123
+ classPropertyName: "selectionLimit",
8124
+ publicName: "selectionLimit",
6813
8125
  isSignal: true,
6814
8126
  isRequired: false,
6815
8127
  transformFunction: null
6816
8128
  },
6817
- placeholder: {
6818
- classPropertyName: "placeholder",
6819
- publicName: "placeholder",
8129
+ emptyMessage: {
8130
+ classPropertyName: "emptyMessage",
8131
+ publicName: "emptyMessage",
6820
8132
  isSignal: true,
6821
8133
  isRequired: false,
6822
8134
  transformFunction: null
@@ -6835,13 +8147,6 @@ var HuInputNumber = class HuInputNumber {
6835
8147
  isRequired: false,
6836
8148
  transformFunction: null
6837
8149
  },
6838
- readonly: {
6839
- classPropertyName: "readonly",
6840
- publicName: "readonly",
6841
- isSignal: true,
6842
- isRequired: false,
6843
- transformFunction: null
6844
- },
6845
8150
  ariaLabel: {
6846
8151
  classPropertyName: "ariaLabel",
6847
8152
  publicName: "ariaLabel",
@@ -6855,46 +8160,72 @@ var HuInputNumber = class HuInputNumber {
6855
8160
  isSignal: true,
6856
8161
  isRequired: false,
6857
8162
  transformFunction: null
8163
+ },
8164
+ compareWith: {
8165
+ classPropertyName: "compareWith",
8166
+ publicName: "compareWith",
8167
+ isSignal: true,
8168
+ isRequired: false,
8169
+ transformFunction: null
6858
8170
  }
6859
8171
  },
6860
- outputs: { value: "valueChange" },
8172
+ outputs: {
8173
+ value: "valueChange",
8174
+ closed: "closed"
8175
+ },
6861
8176
  host: {
8177
+ listeners: {
8178
+ "focusout": "onFocusOut($event)",
8179
+ "document:mousedown": "onDocumentPointer($event)"
8180
+ },
6862
8181
  properties: {
6863
- "attr.data-buttons": "buttons()",
6864
- "attr.data-size": "size()",
6865
- "class.hu-input-number--disabled": "isDisabled()",
6866
- "class.hu-input-number--invalid": "isInvalid()",
6867
- "style.--hu-affix-prefix": "(prefixText()?.length ?? 0) + 'ch'",
6868
- "style.--hu-affix-suffix": "(suffix()?.length ?? 0) + 'ch'"
8182
+ "class.hu-multi-select--open": "open()",
8183
+ "class.hu-multi-select--disabled": "isDisabled()",
8184
+ "attr.data-size": "size()"
6869
8185
  },
6870
- classAttribute: "hu-input-number"
8186
+ classAttribute: "hu-multi-select"
6871
8187
  },
6872
- providers: [
8188
+ providers: [{
8189
+ provide: NG_VALUE_ACCESSOR,
8190
+ useExisting: forwardRef(() => HuMultiSelect),
8191
+ multi: true
8192
+ }, {
8193
+ provide: HuFormFieldControl,
8194
+ useExisting: forwardRef(() => HuMultiSelect)
8195
+ }],
8196
+ viewQueries: [
6873
8197
  {
6874
- provide: NG_VALUE_ACCESSOR,
6875
- useExisting: forwardRef(() => HuInputNumber),
6876
- multi: true
8198
+ propertyName: "trigger",
8199
+ first: true,
8200
+ predicate: ["trigger"],
8201
+ descendants: true,
8202
+ isSignal: true
6877
8203
  },
6878
8204
  {
6879
- provide: NG_VALIDATORS,
6880
- useExisting: forwardRef(() => HuInputNumber),
6881
- multi: true
8205
+ propertyName: "panel",
8206
+ first: true,
8207
+ predicate: ["panel"],
8208
+ descendants: true,
8209
+ isSignal: true
6882
8210
  },
6883
8211
  {
6884
- provide: HuFormFieldControl,
6885
- useExisting: forwardRef(() => HuInputNumber)
8212
+ propertyName: "search",
8213
+ first: true,
8214
+ predicate: ["search"],
8215
+ descendants: true,
8216
+ isSignal: true
8217
+ },
8218
+ {
8219
+ propertyName: "listbox",
8220
+ first: true,
8221
+ predicate: ["listbox"],
8222
+ descendants: true,
8223
+ isSignal: true
6886
8224
  }
6887
8225
  ],
6888
- viewQueries: [{
6889
- propertyName: "input",
6890
- first: true,
6891
- predicate: ["input"],
6892
- descendants: true,
6893
- isSignal: true
6894
- }],
6895
8226
  ngImport: i0,
6896
- template: "@if (buttons() === 'horizontal') {\r\n <button\r\n type=\"button\"\r\n class=\"hu-input-number__btn hu-input-number__btn--minus\"\r\n tabindex=\"-1\"\r\n aria-label=\"Azalt\"\r\n [disabled]=\"!canDecrement()\"\r\n (pointerdown)=\"startRepeat(-1, $event)\"\r\n (pointerup)=\"stopRepeat()\"\r\n (pointerleave)=\"stopRepeat()\"\r\n (pointercancel)=\"stopRepeat()\"\r\n >\r\n <hu-icon name=\"minus\" [size]=\"16\" />\r\n </button>\r\n}\r\n\r\n<div class=\"hu-input-number__control\">\r\n @if (prefixText()) {\r\n <span class=\"hu-input-number__affix hu-input-number__affix--prefix\" aria-hidden=\"true\">{{ prefixText() }}</span>\r\n }\r\n <input\r\n #input\r\n type=\"text\"\r\n class=\"hu-input hu-input-number__input\"\r\n role=\"spinbutton\"\r\n autocomplete=\"off\"\r\n [attr.inputmode]=\"fraction().max > 0 ? 'decimal' : 'numeric'\"\r\n [id]=\"id()\"\r\n [attr.data-size]=\"size()\"\r\n [class.hu-input--invalid]=\"isInvalid()\"\r\n [class.hu-input-number__input--prefix]=\"!!prefixText()\"\r\n [class.hu-input-number__input--suffix]=\"!!suffix()\"\r\n [attr.aria-invalid]=\"isInvalid() || null\"\r\n [attr.aria-describedby]=\"field?.describedBy() ?? null\"\r\n [attr.aria-label]=\"ariaLabel() || null\"\r\n [attr.aria-valuenow]=\"value()\"\r\n [attr.aria-valuemin]=\"min()\"\r\n [attr.aria-valuemax]=\"max()\"\r\n [attr.aria-valuetext]=\"text() ? (prefixText() ?? '') + text() + (suffix() ? ' ' + suffix() : '') : null\"\r\n [attr.placeholder]=\"placeholder() ?? null\"\r\n [value]=\"text()\"\r\n [disabled]=\"isDisabled()\"\r\n [readOnly]=\"readonly()\"\r\n (focus)=\"onFocus()\"\r\n (blur)=\"onBlur()\"\r\n (keydown)=\"onKeydown($event)\"\r\n (input)=\"onInput($event)\"\r\n />\r\n @if (suffix()) {\r\n <span class=\"hu-input-number__affix hu-input-number__affix--suffix\" aria-hidden=\"true\">{{ suffix() }}</span>\r\n }\r\n\r\n @if (buttons() === 'stacked') {\r\n <span class=\"hu-input-number__stack\">\r\n <button\r\n type=\"button\"\r\n class=\"hu-input-number__btn\"\r\n tabindex=\"-1\"\r\n aria-label=\"Artır\"\r\n [disabled]=\"!canIncrement()\"\r\n (pointerdown)=\"startRepeat(1, $event)\"\r\n (pointerup)=\"stopRepeat()\"\r\n (pointerleave)=\"stopRepeat()\"\r\n (pointercancel)=\"stopRepeat()\"\r\n >\r\n <hu-icon name=\"chevron-up\" [size]=\"14\" />\r\n </button>\r\n <button\r\n type=\"button\"\r\n class=\"hu-input-number__btn\"\r\n tabindex=\"-1\"\r\n aria-label=\"Azalt\"\r\n [disabled]=\"!canDecrement()\"\r\n (pointerdown)=\"startRepeat(-1, $event)\"\r\n (pointerup)=\"stopRepeat()\"\r\n (pointerleave)=\"stopRepeat()\"\r\n (pointercancel)=\"stopRepeat()\"\r\n >\r\n <hu-icon name=\"chevron-down\" [size]=\"14\" />\r\n </button>\r\n </span>\r\n }\r\n</div>\r\n\r\n@if (buttons() === 'horizontal') {\r\n <button\r\n type=\"button\"\r\n class=\"hu-input-number__btn hu-input-number__btn--plus\"\r\n tabindex=\"-1\"\r\n aria-label=\"Artır\"\r\n [disabled]=\"!canIncrement()\"\r\n (pointerdown)=\"startRepeat(1, $event)\"\r\n (pointerup)=\"stopRepeat()\"\r\n (pointerleave)=\"stopRepeat()\"\r\n (pointercancel)=\"stopRepeat()\"\r\n >\r\n <hu-icon name=\"plus\" [size]=\"16\" />\r\n </button>\r\n}\r\n",
6897
- styles: [".hu-input-number{display:flex;align-items:stretch;width:100%;min-width:0}.hu-input-number__control{position:relative;display:flex;flex:1;align-items:center;min-width:0}.hu-input-number__input{font-variant-numeric:tabular-nums}.hu-input-number__input--prefix{padding-left:calc(var(--hu-affix-prefix) + var(--hu-space-3) + var(--hu-space-2))}.hu-input-number__input--suffix{padding-right:calc(var(--hu-affix-suffix) + var(--hu-space-3) + var(--hu-space-2))}[data-buttons=stacked] .hu-input-number__input{padding-right:2.25rem}[data-buttons=stacked] .hu-input-number__input--suffix{padding-right:calc(var(--hu-affix-suffix) + 2.25rem + var(--hu-space-2))}[data-buttons=horizontal] .hu-input-number__input{position:relative;text-align:center;border-radius:0}[data-buttons=horizontal] .hu-input-number__input:focus{z-index:1}.hu-input-number__affix{position:absolute;z-index:2;font-size:var(--hu-text-sm);color:var(--hu-text-muted);pointer-events:none}.hu-input-number__affix--prefix{left:var(--hu-space-3)}.hu-input-number__affix--suffix{right:var(--hu-space-3)}[data-buttons=stacked] .hu-input-number__affix--suffix{right:2.25rem}.hu-input-number--disabled .hu-input-number__affix{color:var(--hu-text-subtle)}.hu-input-number__btn{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;padding:0;font:inherit;color:var(--hu-text-muted);background:var(--hu-surface-2);border:1px solid var(--hu-border-strong);cursor:pointer;touch-action:manipulation;-webkit-user-select:none;user-select:none;transition:background-color var(--hu-transition),color var(--hu-transition)}.hu-input-number__btn:hover:not(:disabled){color:var(--hu-text);background:var(--hu-surface-3)}.hu-input-number__btn:active:not(:disabled){background:var(--hu-border)}.hu-input-number__btn:disabled{opacity:.45;cursor:not-allowed}.hu-input-number__btn--minus,.hu-input-number__btn--plus{width:var(--hu-control-md)}.hu-input-number__btn--minus{margin-right:-1px;border-radius:var(--hu-radius-md) 0 0 var(--hu-radius-md)}.hu-input-number__btn--plus{margin-left:-1px;border-radius:0 var(--hu-radius-md) var(--hu-radius-md) 0}[data-size=sm] .hu-input-number__btn--minus,[data-size=sm] .hu-input-number__btn--plus{width:var(--hu-control-sm)}[data-size=lg] .hu-input-number__btn--minus,[data-size=lg] .hu-input-number__btn--plus{width:var(--hu-control-lg)}.hu-input-number__stack{position:absolute;top:1px;right:1px;bottom:1px;z-index:2;display:flex;flex-direction:column;width:1.75rem;overflow:hidden;border-left:1px solid var(--hu-border);border-radius:0 calc(var(--hu-radius-md) - 1px) calc(var(--hu-radius-md) - 1px) 0}.hu-input-number__stack .hu-input-number__btn{flex:1;width:100%;background:transparent;border:0}.hu-input-number__stack .hu-input-number__btn+.hu-input-number__btn{border-top:1px solid var(--hu-border)}.hu-input-number__stack .hu-input-number__btn:hover:not(:disabled){background:var(--hu-surface-3)}\n"],
8227
+ template: "<div\r\n #trigger\r\n class=\"hu-multi-select__trigger\"\r\n role=\"combobox\"\r\n aria-haspopup=\"listbox\"\r\n [id]=\"id()\"\r\n [attr.tabindex]=\"isDisabled() ? -1 : 0\"\r\n [attr.aria-expanded]=\"open()\"\r\n [attr.aria-controls]=\"listId\"\r\n [attr.aria-disabled]=\"isDisabled() || null\"\r\n [attr.aria-invalid]=\"isInvalid() || null\"\r\n [attr.aria-describedby]=\"field?.describedBy() ?? null\"\r\n [attr.aria-label]=\"ariaLabel() || null\"\r\n [class.hu-multi-select__trigger--invalid]=\"isInvalid()\"\r\n (click)=\"toggle()\"\r\n (keydown)=\"onTriggerKeydown($event)\"\r\n>\r\n <div class=\"hu-multi-select__values\">\r\n @if (!selectedOptions().length) {\r\n <span class=\"hu-multi-select__placeholder\">{{ placeholder() }}</span>\r\n } @else if (showChips()) {\r\n @for (o of selectedOptions(); track o.value) {\r\n <span class=\"hu-multi-select__chip\">\r\n {{ o.label }}\r\n @if (!isDisabled()) {\r\n <button\r\n type=\"button\"\r\n class=\"hu-multi-select__chip-remove\"\r\n tabindex=\"-1\"\r\n [attr.aria-label]=\"o.label + ' kaldır'\"\r\n (click)=\"remove(o, $event)\"\r\n >\r\n <hu-icon name=\"x\" [size]=\"12\" />\r\n </button>\r\n }\r\n </span>\r\n }\r\n } @else {\r\n <span class=\"hu-multi-select__text\">{{ summary() }}</span>\r\n }\r\n </div>\r\n @if (showClear() && selectedOptions().length && !isDisabled()) {\r\n <button type=\"button\" class=\"hu-multi-select__icon-btn\" tabindex=\"-1\" aria-label=\"Seçimi temizle\" (click)=\"clearAll($event)\">\r\n <hu-icon name=\"x\" [size]=\"14\" />\r\n </button>\r\n }\r\n <hu-icon class=\"hu-multi-select__caret\" name=\"chevron-down\" [size]=\"16\" />\r\n</div>\r\n\r\n<div\r\n #panel\r\n popover=\"manual\"\r\n class=\"hu-multi-select__panel\"\r\n [class.hu-multi-select__panel--inline]=\"!supportsPopover\"\r\n [attr.hidden]=\"!supportsPopover && !open() ? '' : null\"\r\n (keydown)=\"onPanelKeydown($event)\"\r\n>\r\n @if (open()) {\r\n @if (filter() || showSelectAll()) {\r\n <div class=\"hu-multi-select__header\">\r\n @if (showSelectAll() && selectionLimit() == null) {\r\n <button\r\n type=\"button\"\r\n class=\"hu-multi-select__all\"\r\n tabindex=\"-1\"\r\n [attr.aria-label]=\"allSelected() ? 'Seçimi kaldır' : 'Tümünü seç'\"\r\n [disabled]=\"!selectable().length\"\r\n (click)=\"toggleAll()\"\r\n >\r\n <span\r\n class=\"hu-multi-select__box\"\r\n [class.hu-multi-select__box--checked]=\"allSelected()\"\r\n [class.hu-multi-select__box--partial]=\"someSelected()\"\r\n aria-hidden=\"true\"\r\n >\r\n @if (allSelected()) {\r\n <hu-icon name=\"check\" [size]=\"12\" />\r\n } @else if (someSelected()) {\r\n <hu-icon name=\"minus\" [size]=\"12\" />\r\n }\r\n </span>\r\n </button>\r\n }\r\n @if (filter()) {\r\n <div class=\"hu-multi-select__search\">\r\n <hu-icon name=\"search\" [size]=\"14\" />\r\n <input\r\n #search\r\n type=\"text\"\r\n class=\"hu-input\"\r\n data-size=\"sm\"\r\n role=\"searchbox\"\r\n autocomplete=\"off\"\r\n [attr.aria-label]=\"filterPlaceholder()\"\r\n [attr.aria-controls]=\"listId\"\r\n [attr.aria-activedescendant]=\"activeIndex() >= 0 ? optionId(activeIndex()) : null\"\r\n [placeholder]=\"filterPlaceholder()\"\r\n [value]=\"query()\"\r\n (input)=\"onQuery($any($event.target).value)\"\r\n />\r\n </div>\r\n } @else if (showSelectAll() && selectionLimit() == null) {\r\n <span class=\"hu-multi-select__all-label\" (click)=\"toggleAll()\">Tümünü seç</span>\r\n }\r\n </div>\r\n }\r\n\r\n <ul\r\n #listbox\r\n class=\"hu-multi-select__list\"\r\n role=\"listbox\"\r\n aria-multiselectable=\"true\"\r\n [id]=\"listId\"\r\n [attr.tabindex]=\"filter() ? -1 : 0\"\r\n [attr.aria-label]=\"ariaLabel() || placeholder()\"\r\n [attr.aria-activedescendant]=\"!filter() && activeIndex() >= 0 ? optionId(activeIndex()) : null\"\r\n >\r\n @for (row of rows(); track $index) {\r\n @if (row.kind === 'group') {\r\n <li class=\"hu-multi-select__group\" role=\"presentation\">{{ row.label }}</li>\r\n } @else {\r\n @let o = row.option;\r\n @let selected = isSelected(o);\r\n @let blocked = !selected && limitReached();\r\n <li\r\n class=\"hu-multi-select__option\"\r\n role=\"option\"\r\n [id]=\"optionId(row.index)\"\r\n [attr.aria-selected]=\"selected\"\r\n [attr.aria-disabled]=\"o.disabled || blocked || null\"\r\n [class.hu-multi-select__option--active]=\"row.index === activeIndex()\"\r\n [class.hu-multi-select__option--disabled]=\"o.disabled || blocked\"\r\n (mousedown)=\"$event.preventDefault()\"\r\n (mousemove)=\"!o.disabled && activeIndex() !== row.index && activeIndex.set(row.index)\"\r\n (click)=\"toggleOption(o)\"\r\n >\r\n <span class=\"hu-multi-select__box\" [class.hu-multi-select__box--checked]=\"selected\" aria-hidden=\"true\">\r\n @if (selected) {\r\n <hu-icon name=\"check\" [size]=\"12\" />\r\n }\r\n </span>\r\n @if (o.icon) {\r\n <hu-icon class=\"hu-multi-select__option-icon\" [name]=\"o.icon\" [size]=\"16\" />\r\n }\r\n <span class=\"hu-multi-select__option-text\">\r\n <span>{{ o.label }}</span>\r\n @if (o.description) {\r\n <span class=\"hu-multi-select__option-desc\">{{ o.description }}</span>\r\n }\r\n </span>\r\n </li>\r\n }\r\n } @empty {\r\n <li class=\"hu-multi-select__empty\" role=\"presentation\">{{ emptyMessage() }}</li>\r\n }\r\n </ul>\r\n\r\n @if (selectionLimit() != null || values().length) {\r\n <div class=\"hu-multi-select__footer\" aria-live=\"polite\">\r\n {{ values().length }}{{ selectionLimit() != null ? ' / ' + selectionLimit() : '' }} seçildi\r\n @if (limitReached()) {\r\n · sınıra ulaşıldı\r\n }\r\n </div>\r\n }\r\n }\r\n</div>\r\n",
8228
+ styles: [".hu-multi-select{position:relative;display:block;width:100%;min-width:0}.hu-multi-select__trigger{display:flex;align-items:center;gap:var(--hu-space-1);min-height:var(--hu-control-md);padding:3px var(--hu-space-2) 3px var(--hu-space-3);font-size:var(--hu-text-sm);color:var(--hu-text);background:var(--hu-surface);border:1px solid var(--hu-border-strong);border-radius:var(--hu-radius-md);box-shadow:var(--hu-shadow-sm);cursor:pointer;transition:border-color var(--hu-transition),box-shadow var(--hu-transition)}.hu-multi-select__trigger:hover:not([aria-disabled=true]):not(:focus){border-color:var(--hu-gray-400)}.hu-multi-select__trigger:focus,.hu-multi-select--open .hu-multi-select__trigger{outline:none;border-color:var(--hu-primary);box-shadow:var(--hu-ring);transition:none}.hu-multi-select__trigger--invalid,.hu-multi-select__trigger--invalid:hover:not(:focus){border-color:var(--hu-danger)}.hu-multi-select__trigger--invalid:focus{box-shadow:var(--hu-ring-danger)}.hu-multi-select--disabled .hu-multi-select__trigger{color:var(--hu-text-subtle);background:var(--hu-surface-3);box-shadow:none;cursor:not-allowed}[data-size=sm] .hu-multi-select__trigger{min-height:var(--hu-control-sm);padding-left:var(--hu-space-2);font-size:.8125rem}[data-size=lg] .hu-multi-select__trigger{min-height:var(--hu-control-lg);padding-left:var(--hu-space-4);font-size:var(--hu-text-md)}.hu-multi-select__values{display:flex;flex:1;flex-wrap:wrap;align-items:center;gap:4px;min-width:0}.hu-multi-select__placeholder{color:var(--hu-text-subtle)}.hu-multi-select__text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.hu-multi-select__chip{display:inline-flex;align-items:center;gap:2px;max-width:100%;height:1.5rem;padding:0 2px 0 var(--hu-space-2);overflow:hidden;font-size:var(--hu-text-xs);font-weight:500;color:var(--hu-primary-soft-fg);white-space:nowrap;text-overflow:ellipsis;background:var(--hu-primary-soft);border-radius:var(--hu-radius-sm)}.hu-multi-select__chip-remove,.hu-multi-select__icon-btn{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;padding:0;color:inherit;background:none;border:0;border-radius:var(--hu-radius-sm);cursor:pointer;opacity:.7}.hu-multi-select__chip-remove:hover:not(:disabled),.hu-multi-select__icon-btn:hover:not(:disabled){opacity:1;background:#00000014}.hu-multi-select__chip-remove{width:1.125rem;height:1.125rem}.hu-multi-select__icon-btn{width:1.5rem;height:1.5rem;color:var(--hu-text-subtle)}.hu-multi-select__caret{flex-shrink:0;color:var(--hu-text-subtle);transition:transform var(--hu-transition)}.hu-multi-select--open .hu-multi-select__caret{transform:rotate(180deg)}.hu-multi-select__panel{position:fixed;inset:auto;flex-direction:column;min-width:14rem;max-width:calc(100vw - 1rem);margin:0;padding:0;overflow:hidden;color:var(--hu-text);background:var(--hu-surface);border:1px solid var(--hu-border);border-radius:var(--hu-radius-lg);box-shadow:var(--hu-shadow-lg)}.hu-multi-select__panel:popover-open{display:flex;animation:hu-multi-select-in .12s ease-out}.hu-multi-select__panel--inline{position:absolute;top:calc(100% + 4px);left:0;z-index:1000;display:flex;width:100%}.hu-multi-select__panel--inline[hidden]{display:none}.hu-multi-select__header{display:flex;align-items:center;gap:var(--hu-space-2);padding:var(--hu-space-2) var(--hu-space-3);border-bottom:1px solid var(--hu-border)}.hu-multi-select__all{display:inline-flex;padding:2px;background:none;border:0;border-radius:var(--hu-radius-sm);cursor:pointer}.hu-multi-select__all:disabled{opacity:.5;cursor:not-allowed}.hu-multi-select__all-label{font-size:var(--hu-text-sm);cursor:pointer}.hu-multi-select__search{position:relative;display:flex;flex:1;align-items:center;min-width:0}.hu-multi-select__search>hu-icon{position:absolute;left:var(--hu-space-2);color:var(--hu-text-subtle);pointer-events:none}.hu-multi-select__search>.hu-input{padding-left:1.75rem;box-shadow:none}.hu-multi-select__list{max-height:var(--hu-multi-select-max-height, 16rem);margin:0;padding:var(--hu-space-1);overflow-y:auto;list-style:none;outline:none}.hu-multi-select__group{padding:var(--hu-space-2) var(--hu-space-2) var(--hu-space-1);font-size:var(--hu-text-xs);font-weight:600;color:var(--hu-text-subtle)}.hu-multi-select__option{display:flex;align-items:flex-start;gap:var(--hu-space-2);padding:var(--hu-space-2);font-size:var(--hu-text-sm);line-height:1.35;border-radius:var(--hu-radius-sm);cursor:pointer;-webkit-user-select:none;user-select:none}.hu-multi-select__option--active{background:var(--hu-surface-3)}.hu-multi-select__option[aria-selected=true]{font-weight:500}.hu-multi-select__option--disabled{opacity:.5;cursor:not-allowed}.hu-multi-select__option-icon{color:var(--hu-text-subtle)}.hu-multi-select__option-text{display:flex;flex-direction:column;min-width:0}.hu-multi-select__option-desc{font-size:var(--hu-text-xs);font-weight:400;color:var(--hu-text-subtle)}.hu-multi-select__box{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;width:1rem;height:1rem;margin-top:1px;color:var(--hu-primary-fg);background:var(--hu-surface);border:1.5px solid var(--hu-border-strong);border-radius:4px;transition:background-color var(--hu-transition),border-color var(--hu-transition)}.hu-multi-select__box--checked,.hu-multi-select__box--partial{background:var(--hu-primary);border-color:var(--hu-primary)}.hu-multi-select__empty{padding:var(--hu-space-4) var(--hu-space-2);font-size:var(--hu-text-sm);color:var(--hu-text-subtle);text-align:center}.hu-multi-select__footer{padding:var(--hu-space-2) var(--hu-space-3);font-size:var(--hu-text-xs);color:var(--hu-text-muted);border-top:1px solid var(--hu-border)}@keyframes hu-multi-select-in{0%{opacity:0;transform:translateY(-4px)}}\n"],
6898
8229
  dependencies: [{
6899
8230
  kind: "component",
6900
8231
  type: HuIcon,
@@ -6914,149 +8245,124 @@ i0.ɵɵngDeclareClassMetadata({
6914
8245
  minVersion: "12.0.0",
6915
8246
  version: "22.2.0",
6916
8247
  ngImport: i0,
6917
- type: HuInputNumber,
8248
+ type: HuMultiSelect,
6918
8249
  decorators: [{
6919
8250
  type: Component,
6920
8251
  args: [{
6921
- selector: "hu-input-number",
8252
+ selector: "hu-multi-select",
6922
8253
  imports: [HuIcon],
6923
- providers: [
6924
- {
6925
- provide: NG_VALUE_ACCESSOR,
6926
- useExisting: forwardRef(() => HuInputNumber),
6927
- multi: true
6928
- },
6929
- {
6930
- provide: NG_VALIDATORS,
6931
- useExisting: forwardRef(() => HuInputNumber),
6932
- multi: true
6933
- },
6934
- {
6935
- provide: HuFormFieldControl,
6936
- useExisting: forwardRef(() => HuInputNumber)
6937
- }
6938
- ],
8254
+ providers: [{
8255
+ provide: NG_VALUE_ACCESSOR,
8256
+ useExisting: forwardRef(() => HuMultiSelect),
8257
+ multi: true
8258
+ }, {
8259
+ provide: HuFormFieldControl,
8260
+ useExisting: forwardRef(() => HuMultiSelect)
8261
+ }],
6939
8262
  host: {
6940
- class: "hu-input-number",
6941
- "[attr.data-buttons]": "buttons()",
8263
+ class: "hu-multi-select",
8264
+ "[class.hu-multi-select--open]": "open()",
8265
+ "[class.hu-multi-select--disabled]": "isDisabled()",
6942
8266
  "[attr.data-size]": "size()",
6943
- "[class.hu-input-number--disabled]": "isDisabled()",
6944
- "[class.hu-input-number--invalid]": "isInvalid()",
6945
- "[style.--hu-affix-prefix]": "(prefixText()?.length ?? 0) + 'ch'",
6946
- "[style.--hu-affix-suffix]": "(suffix()?.length ?? 0) + 'ch'"
8267
+ "(focusout)": "onFocusOut($event)",
8268
+ "(document:mousedown)": "onDocumentPointer($event)"
6947
8269
  },
6948
8270
  encapsulation: ViewEncapsulation.None,
6949
8271
  changeDetection: ChangeDetectionStrategy.OnPush,
6950
- template: "@if (buttons() === 'horizontal') {\r\n <button\r\n type=\"button\"\r\n class=\"hu-input-number__btn hu-input-number__btn--minus\"\r\n tabindex=\"-1\"\r\n aria-label=\"Azalt\"\r\n [disabled]=\"!canDecrement()\"\r\n (pointerdown)=\"startRepeat(-1, $event)\"\r\n (pointerup)=\"stopRepeat()\"\r\n (pointerleave)=\"stopRepeat()\"\r\n (pointercancel)=\"stopRepeat()\"\r\n >\r\n <hu-icon name=\"minus\" [size]=\"16\" />\r\n </button>\r\n}\r\n\r\n<div class=\"hu-input-number__control\">\r\n @if (prefixText()) {\r\n <span class=\"hu-input-number__affix hu-input-number__affix--prefix\" aria-hidden=\"true\">{{ prefixText() }}</span>\r\n }\r\n <input\r\n #input\r\n type=\"text\"\r\n class=\"hu-input hu-input-number__input\"\r\n role=\"spinbutton\"\r\n autocomplete=\"off\"\r\n [attr.inputmode]=\"fraction().max > 0 ? 'decimal' : 'numeric'\"\r\n [id]=\"id()\"\r\n [attr.data-size]=\"size()\"\r\n [class.hu-input--invalid]=\"isInvalid()\"\r\n [class.hu-input-number__input--prefix]=\"!!prefixText()\"\r\n [class.hu-input-number__input--suffix]=\"!!suffix()\"\r\n [attr.aria-invalid]=\"isInvalid() || null\"\r\n [attr.aria-describedby]=\"field?.describedBy() ?? null\"\r\n [attr.aria-label]=\"ariaLabel() || null\"\r\n [attr.aria-valuenow]=\"value()\"\r\n [attr.aria-valuemin]=\"min()\"\r\n [attr.aria-valuemax]=\"max()\"\r\n [attr.aria-valuetext]=\"text() ? (prefixText() ?? '') + text() + (suffix() ? ' ' + suffix() : '') : null\"\r\n [attr.placeholder]=\"placeholder() ?? null\"\r\n [value]=\"text()\"\r\n [disabled]=\"isDisabled()\"\r\n [readOnly]=\"readonly()\"\r\n (focus)=\"onFocus()\"\r\n (blur)=\"onBlur()\"\r\n (keydown)=\"onKeydown($event)\"\r\n (input)=\"onInput($event)\"\r\n />\r\n @if (suffix()) {\r\n <span class=\"hu-input-number__affix hu-input-number__affix--suffix\" aria-hidden=\"true\">{{ suffix() }}</span>\r\n }\r\n\r\n @if (buttons() === 'stacked') {\r\n <span class=\"hu-input-number__stack\">\r\n <button\r\n type=\"button\"\r\n class=\"hu-input-number__btn\"\r\n tabindex=\"-1\"\r\n aria-label=\"Artır\"\r\n [disabled]=\"!canIncrement()\"\r\n (pointerdown)=\"startRepeat(1, $event)\"\r\n (pointerup)=\"stopRepeat()\"\r\n (pointerleave)=\"stopRepeat()\"\r\n (pointercancel)=\"stopRepeat()\"\r\n >\r\n <hu-icon name=\"chevron-up\" [size]=\"14\" />\r\n </button>\r\n <button\r\n type=\"button\"\r\n class=\"hu-input-number__btn\"\r\n tabindex=\"-1\"\r\n aria-label=\"Azalt\"\r\n [disabled]=\"!canDecrement()\"\r\n (pointerdown)=\"startRepeat(-1, $event)\"\r\n (pointerup)=\"stopRepeat()\"\r\n (pointerleave)=\"stopRepeat()\"\r\n (pointercancel)=\"stopRepeat()\"\r\n >\r\n <hu-icon name=\"chevron-down\" [size]=\"14\" />\r\n </button>\r\n </span>\r\n }\r\n</div>\r\n\r\n@if (buttons() === 'horizontal') {\r\n <button\r\n type=\"button\"\r\n class=\"hu-input-number__btn hu-input-number__btn--plus\"\r\n tabindex=\"-1\"\r\n aria-label=\"Artır\"\r\n [disabled]=\"!canIncrement()\"\r\n (pointerdown)=\"startRepeat(1, $event)\"\r\n (pointerup)=\"stopRepeat()\"\r\n (pointerleave)=\"stopRepeat()\"\r\n (pointercancel)=\"stopRepeat()\"\r\n >\r\n <hu-icon name=\"plus\" [size]=\"16\" />\r\n </button>\r\n}\r\n",
6951
- styles: [".hu-input-number{display:flex;align-items:stretch;width:100%;min-width:0}.hu-input-number__control{position:relative;display:flex;flex:1;align-items:center;min-width:0}.hu-input-number__input{font-variant-numeric:tabular-nums}.hu-input-number__input--prefix{padding-left:calc(var(--hu-affix-prefix) + var(--hu-space-3) + var(--hu-space-2))}.hu-input-number__input--suffix{padding-right:calc(var(--hu-affix-suffix) + var(--hu-space-3) + var(--hu-space-2))}[data-buttons=stacked] .hu-input-number__input{padding-right:2.25rem}[data-buttons=stacked] .hu-input-number__input--suffix{padding-right:calc(var(--hu-affix-suffix) + 2.25rem + var(--hu-space-2))}[data-buttons=horizontal] .hu-input-number__input{position:relative;text-align:center;border-radius:0}[data-buttons=horizontal] .hu-input-number__input:focus{z-index:1}.hu-input-number__affix{position:absolute;z-index:2;font-size:var(--hu-text-sm);color:var(--hu-text-muted);pointer-events:none}.hu-input-number__affix--prefix{left:var(--hu-space-3)}.hu-input-number__affix--suffix{right:var(--hu-space-3)}[data-buttons=stacked] .hu-input-number__affix--suffix{right:2.25rem}.hu-input-number--disabled .hu-input-number__affix{color:var(--hu-text-subtle)}.hu-input-number__btn{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;padding:0;font:inherit;color:var(--hu-text-muted);background:var(--hu-surface-2);border:1px solid var(--hu-border-strong);cursor:pointer;touch-action:manipulation;-webkit-user-select:none;user-select:none;transition:background-color var(--hu-transition),color var(--hu-transition)}.hu-input-number__btn:hover:not(:disabled){color:var(--hu-text);background:var(--hu-surface-3)}.hu-input-number__btn:active:not(:disabled){background:var(--hu-border)}.hu-input-number__btn:disabled{opacity:.45;cursor:not-allowed}.hu-input-number__btn--minus,.hu-input-number__btn--plus{width:var(--hu-control-md)}.hu-input-number__btn--minus{margin-right:-1px;border-radius:var(--hu-radius-md) 0 0 var(--hu-radius-md)}.hu-input-number__btn--plus{margin-left:-1px;border-radius:0 var(--hu-radius-md) var(--hu-radius-md) 0}[data-size=sm] .hu-input-number__btn--minus,[data-size=sm] .hu-input-number__btn--plus{width:var(--hu-control-sm)}[data-size=lg] .hu-input-number__btn--minus,[data-size=lg] .hu-input-number__btn--plus{width:var(--hu-control-lg)}.hu-input-number__stack{position:absolute;top:1px;right:1px;bottom:1px;z-index:2;display:flex;flex-direction:column;width:1.75rem;overflow:hidden;border-left:1px solid var(--hu-border);border-radius:0 calc(var(--hu-radius-md) - 1px) calc(var(--hu-radius-md) - 1px) 0}.hu-input-number__stack .hu-input-number__btn{flex:1;width:100%;background:transparent;border:0}.hu-input-number__stack .hu-input-number__btn+.hu-input-number__btn{border-top:1px solid var(--hu-border)}.hu-input-number__stack .hu-input-number__btn:hover:not(:disabled){background:var(--hu-surface-3)}\n"]
8272
+ template: "<div\r\n #trigger\r\n class=\"hu-multi-select__trigger\"\r\n role=\"combobox\"\r\n aria-haspopup=\"listbox\"\r\n [id]=\"id()\"\r\n [attr.tabindex]=\"isDisabled() ? -1 : 0\"\r\n [attr.aria-expanded]=\"open()\"\r\n [attr.aria-controls]=\"listId\"\r\n [attr.aria-disabled]=\"isDisabled() || null\"\r\n [attr.aria-invalid]=\"isInvalid() || null\"\r\n [attr.aria-describedby]=\"field?.describedBy() ?? null\"\r\n [attr.aria-label]=\"ariaLabel() || null\"\r\n [class.hu-multi-select__trigger--invalid]=\"isInvalid()\"\r\n (click)=\"toggle()\"\r\n (keydown)=\"onTriggerKeydown($event)\"\r\n>\r\n <div class=\"hu-multi-select__values\">\r\n @if (!selectedOptions().length) {\r\n <span class=\"hu-multi-select__placeholder\">{{ placeholder() }}</span>\r\n } @else if (showChips()) {\r\n @for (o of selectedOptions(); track o.value) {\r\n <span class=\"hu-multi-select__chip\">\r\n {{ o.label }}\r\n @if (!isDisabled()) {\r\n <button\r\n type=\"button\"\r\n class=\"hu-multi-select__chip-remove\"\r\n tabindex=\"-1\"\r\n [attr.aria-label]=\"o.label + ' kaldır'\"\r\n (click)=\"remove(o, $event)\"\r\n >\r\n <hu-icon name=\"x\" [size]=\"12\" />\r\n </button>\r\n }\r\n </span>\r\n }\r\n } @else {\r\n <span class=\"hu-multi-select__text\">{{ summary() }}</span>\r\n }\r\n </div>\r\n @if (showClear() && selectedOptions().length && !isDisabled()) {\r\n <button type=\"button\" class=\"hu-multi-select__icon-btn\" tabindex=\"-1\" aria-label=\"Seçimi temizle\" (click)=\"clearAll($event)\">\r\n <hu-icon name=\"x\" [size]=\"14\" />\r\n </button>\r\n }\r\n <hu-icon class=\"hu-multi-select__caret\" name=\"chevron-down\" [size]=\"16\" />\r\n</div>\r\n\r\n<div\r\n #panel\r\n popover=\"manual\"\r\n class=\"hu-multi-select__panel\"\r\n [class.hu-multi-select__panel--inline]=\"!supportsPopover\"\r\n [attr.hidden]=\"!supportsPopover && !open() ? '' : null\"\r\n (keydown)=\"onPanelKeydown($event)\"\r\n>\r\n @if (open()) {\r\n @if (filter() || showSelectAll()) {\r\n <div class=\"hu-multi-select__header\">\r\n @if (showSelectAll() && selectionLimit() == null) {\r\n <button\r\n type=\"button\"\r\n class=\"hu-multi-select__all\"\r\n tabindex=\"-1\"\r\n [attr.aria-label]=\"allSelected() ? 'Seçimi kaldır' : 'Tümünü seç'\"\r\n [disabled]=\"!selectable().length\"\r\n (click)=\"toggleAll()\"\r\n >\r\n <span\r\n class=\"hu-multi-select__box\"\r\n [class.hu-multi-select__box--checked]=\"allSelected()\"\r\n [class.hu-multi-select__box--partial]=\"someSelected()\"\r\n aria-hidden=\"true\"\r\n >\r\n @if (allSelected()) {\r\n <hu-icon name=\"check\" [size]=\"12\" />\r\n } @else if (someSelected()) {\r\n <hu-icon name=\"minus\" [size]=\"12\" />\r\n }\r\n </span>\r\n </button>\r\n }\r\n @if (filter()) {\r\n <div class=\"hu-multi-select__search\">\r\n <hu-icon name=\"search\" [size]=\"14\" />\r\n <input\r\n #search\r\n type=\"text\"\r\n class=\"hu-input\"\r\n data-size=\"sm\"\r\n role=\"searchbox\"\r\n autocomplete=\"off\"\r\n [attr.aria-label]=\"filterPlaceholder()\"\r\n [attr.aria-controls]=\"listId\"\r\n [attr.aria-activedescendant]=\"activeIndex() >= 0 ? optionId(activeIndex()) : null\"\r\n [placeholder]=\"filterPlaceholder()\"\r\n [value]=\"query()\"\r\n (input)=\"onQuery($any($event.target).value)\"\r\n />\r\n </div>\r\n } @else if (showSelectAll() && selectionLimit() == null) {\r\n <span class=\"hu-multi-select__all-label\" (click)=\"toggleAll()\">Tümünü seç</span>\r\n }\r\n </div>\r\n }\r\n\r\n <ul\r\n #listbox\r\n class=\"hu-multi-select__list\"\r\n role=\"listbox\"\r\n aria-multiselectable=\"true\"\r\n [id]=\"listId\"\r\n [attr.tabindex]=\"filter() ? -1 : 0\"\r\n [attr.aria-label]=\"ariaLabel() || placeholder()\"\r\n [attr.aria-activedescendant]=\"!filter() && activeIndex() >= 0 ? optionId(activeIndex()) : null\"\r\n >\r\n @for (row of rows(); track $index) {\r\n @if (row.kind === 'group') {\r\n <li class=\"hu-multi-select__group\" role=\"presentation\">{{ row.label }}</li>\r\n } @else {\r\n @let o = row.option;\r\n @let selected = isSelected(o);\r\n @let blocked = !selected && limitReached();\r\n <li\r\n class=\"hu-multi-select__option\"\r\n role=\"option\"\r\n [id]=\"optionId(row.index)\"\r\n [attr.aria-selected]=\"selected\"\r\n [attr.aria-disabled]=\"o.disabled || blocked || null\"\r\n [class.hu-multi-select__option--active]=\"row.index === activeIndex()\"\r\n [class.hu-multi-select__option--disabled]=\"o.disabled || blocked\"\r\n (mousedown)=\"$event.preventDefault()\"\r\n (mousemove)=\"!o.disabled && activeIndex() !== row.index && activeIndex.set(row.index)\"\r\n (click)=\"toggleOption(o)\"\r\n >\r\n <span class=\"hu-multi-select__box\" [class.hu-multi-select__box--checked]=\"selected\" aria-hidden=\"true\">\r\n @if (selected) {\r\n <hu-icon name=\"check\" [size]=\"12\" />\r\n }\r\n </span>\r\n @if (o.icon) {\r\n <hu-icon class=\"hu-multi-select__option-icon\" [name]=\"o.icon\" [size]=\"16\" />\r\n }\r\n <span class=\"hu-multi-select__option-text\">\r\n <span>{{ o.label }}</span>\r\n @if (o.description) {\r\n <span class=\"hu-multi-select__option-desc\">{{ o.description }}</span>\r\n }\r\n </span>\r\n </li>\r\n }\r\n } @empty {\r\n <li class=\"hu-multi-select__empty\" role=\"presentation\">{{ emptyMessage() }}</li>\r\n }\r\n </ul>\r\n\r\n @if (selectionLimit() != null || values().length) {\r\n <div class=\"hu-multi-select__footer\" aria-live=\"polite\">\r\n {{ values().length }}{{ selectionLimit() != null ? ' / ' + selectionLimit() : '' }} seçildi\r\n @if (limitReached()) {\r\n · sınıra ulaşıldı\r\n }\r\n </div>\r\n }\r\n }\r\n</div>\r\n",
8273
+ styles: [".hu-multi-select{position:relative;display:block;width:100%;min-width:0}.hu-multi-select__trigger{display:flex;align-items:center;gap:var(--hu-space-1);min-height:var(--hu-control-md);padding:3px var(--hu-space-2) 3px var(--hu-space-3);font-size:var(--hu-text-sm);color:var(--hu-text);background:var(--hu-surface);border:1px solid var(--hu-border-strong);border-radius:var(--hu-radius-md);box-shadow:var(--hu-shadow-sm);cursor:pointer;transition:border-color var(--hu-transition),box-shadow var(--hu-transition)}.hu-multi-select__trigger:hover:not([aria-disabled=true]):not(:focus){border-color:var(--hu-gray-400)}.hu-multi-select__trigger:focus,.hu-multi-select--open .hu-multi-select__trigger{outline:none;border-color:var(--hu-primary);box-shadow:var(--hu-ring);transition:none}.hu-multi-select__trigger--invalid,.hu-multi-select__trigger--invalid:hover:not(:focus){border-color:var(--hu-danger)}.hu-multi-select__trigger--invalid:focus{box-shadow:var(--hu-ring-danger)}.hu-multi-select--disabled .hu-multi-select__trigger{color:var(--hu-text-subtle);background:var(--hu-surface-3);box-shadow:none;cursor:not-allowed}[data-size=sm] .hu-multi-select__trigger{min-height:var(--hu-control-sm);padding-left:var(--hu-space-2);font-size:.8125rem}[data-size=lg] .hu-multi-select__trigger{min-height:var(--hu-control-lg);padding-left:var(--hu-space-4);font-size:var(--hu-text-md)}.hu-multi-select__values{display:flex;flex:1;flex-wrap:wrap;align-items:center;gap:4px;min-width:0}.hu-multi-select__placeholder{color:var(--hu-text-subtle)}.hu-multi-select__text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.hu-multi-select__chip{display:inline-flex;align-items:center;gap:2px;max-width:100%;height:1.5rem;padding:0 2px 0 var(--hu-space-2);overflow:hidden;font-size:var(--hu-text-xs);font-weight:500;color:var(--hu-primary-soft-fg);white-space:nowrap;text-overflow:ellipsis;background:var(--hu-primary-soft);border-radius:var(--hu-radius-sm)}.hu-multi-select__chip-remove,.hu-multi-select__icon-btn{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;padding:0;color:inherit;background:none;border:0;border-radius:var(--hu-radius-sm);cursor:pointer;opacity:.7}.hu-multi-select__chip-remove:hover:not(:disabled),.hu-multi-select__icon-btn:hover:not(:disabled){opacity:1;background:#00000014}.hu-multi-select__chip-remove{width:1.125rem;height:1.125rem}.hu-multi-select__icon-btn{width:1.5rem;height:1.5rem;color:var(--hu-text-subtle)}.hu-multi-select__caret{flex-shrink:0;color:var(--hu-text-subtle);transition:transform var(--hu-transition)}.hu-multi-select--open .hu-multi-select__caret{transform:rotate(180deg)}.hu-multi-select__panel{position:fixed;inset:auto;flex-direction:column;min-width:14rem;max-width:calc(100vw - 1rem);margin:0;padding:0;overflow:hidden;color:var(--hu-text);background:var(--hu-surface);border:1px solid var(--hu-border);border-radius:var(--hu-radius-lg);box-shadow:var(--hu-shadow-lg)}.hu-multi-select__panel:popover-open{display:flex;animation:hu-multi-select-in .12s ease-out}.hu-multi-select__panel--inline{position:absolute;top:calc(100% + 4px);left:0;z-index:1000;display:flex;width:100%}.hu-multi-select__panel--inline[hidden]{display:none}.hu-multi-select__header{display:flex;align-items:center;gap:var(--hu-space-2);padding:var(--hu-space-2) var(--hu-space-3);border-bottom:1px solid var(--hu-border)}.hu-multi-select__all{display:inline-flex;padding:2px;background:none;border:0;border-radius:var(--hu-radius-sm);cursor:pointer}.hu-multi-select__all:disabled{opacity:.5;cursor:not-allowed}.hu-multi-select__all-label{font-size:var(--hu-text-sm);cursor:pointer}.hu-multi-select__search{position:relative;display:flex;flex:1;align-items:center;min-width:0}.hu-multi-select__search>hu-icon{position:absolute;left:var(--hu-space-2);color:var(--hu-text-subtle);pointer-events:none}.hu-multi-select__search>.hu-input{padding-left:1.75rem;box-shadow:none}.hu-multi-select__list{max-height:var(--hu-multi-select-max-height, 16rem);margin:0;padding:var(--hu-space-1);overflow-y:auto;list-style:none;outline:none}.hu-multi-select__group{padding:var(--hu-space-2) var(--hu-space-2) var(--hu-space-1);font-size:var(--hu-text-xs);font-weight:600;color:var(--hu-text-subtle)}.hu-multi-select__option{display:flex;align-items:flex-start;gap:var(--hu-space-2);padding:var(--hu-space-2);font-size:var(--hu-text-sm);line-height:1.35;border-radius:var(--hu-radius-sm);cursor:pointer;-webkit-user-select:none;user-select:none}.hu-multi-select__option--active{background:var(--hu-surface-3)}.hu-multi-select__option[aria-selected=true]{font-weight:500}.hu-multi-select__option--disabled{opacity:.5;cursor:not-allowed}.hu-multi-select__option-icon{color:var(--hu-text-subtle)}.hu-multi-select__option-text{display:flex;flex-direction:column;min-width:0}.hu-multi-select__option-desc{font-size:var(--hu-text-xs);font-weight:400;color:var(--hu-text-subtle)}.hu-multi-select__box{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;width:1rem;height:1rem;margin-top:1px;color:var(--hu-primary-fg);background:var(--hu-surface);border:1.5px solid var(--hu-border-strong);border-radius:4px;transition:background-color var(--hu-transition),border-color var(--hu-transition)}.hu-multi-select__box--checked,.hu-multi-select__box--partial{background:var(--hu-primary);border-color:var(--hu-primary)}.hu-multi-select__empty{padding:var(--hu-space-4) var(--hu-space-2);font-size:var(--hu-text-sm);color:var(--hu-text-subtle);text-align:center}.hu-multi-select__footer{padding:var(--hu-space-2) var(--hu-space-3);font-size:var(--hu-text-xs);color:var(--hu-text-muted);border-top:1px solid var(--hu-border)}@keyframes hu-multi-select-in{0%{opacity:0;transform:translateY(-4px)}}\n"]
6952
8274
  }]
6953
8275
  }],
6954
8276
  ctorParameters: () => [],
6955
8277
  propDecorators: {
6956
- value: [{
6957
- type: i0.Input,
6958
- args: [{
6959
- isSignal: true,
6960
- alias: "value",
6961
- required: false
6962
- }]
6963
- }, {
6964
- type: i0.Output,
6965
- args: ["valueChange"]
6966
- }],
6967
- min: [{
6968
- type: i0.Input,
6969
- args: [{
6970
- isSignal: true,
6971
- alias: "min",
6972
- required: false
6973
- }]
6974
- }],
6975
- max: [{
8278
+ options: [{
6976
8279
  type: i0.Input,
6977
8280
  args: [{
6978
8281
  isSignal: true,
6979
- alias: "max",
8282
+ alias: "options",
6980
8283
  required: false
6981
8284
  }]
6982
8285
  }],
6983
- step: [{
8286
+ value: [{
6984
8287
  type: i0.Input,
6985
8288
  args: [{
6986
8289
  isSignal: true,
6987
- alias: "step",
8290
+ alias: "value",
6988
8291
  required: false
6989
8292
  }]
8293
+ }, {
8294
+ type: i0.Output,
8295
+ args: ["valueChange"]
6990
8296
  }],
6991
- mode: [{
8297
+ placeholder: [{
6992
8298
  type: i0.Input,
6993
8299
  args: [{
6994
8300
  isSignal: true,
6995
- alias: "mode",
8301
+ alias: "placeholder",
6996
8302
  required: false
6997
8303
  }]
6998
8304
  }],
6999
- currency: [{
8305
+ filter: [{
7000
8306
  type: i0.Input,
7001
8307
  args: [{
7002
8308
  isSignal: true,
7003
- alias: "currency",
8309
+ alias: "filter",
7004
8310
  required: false
7005
8311
  }]
7006
8312
  }],
7007
- minFractionDigits: [{
8313
+ filterPlaceholder: [{
7008
8314
  type: i0.Input,
7009
8315
  args: [{
7010
8316
  isSignal: true,
7011
- alias: "minFractionDigits",
8317
+ alias: "filterPlaceholder",
7012
8318
  required: false
7013
8319
  }]
7014
8320
  }],
7015
- maxFractionDigits: [{
8321
+ showSelectAll: [{
7016
8322
  type: i0.Input,
7017
8323
  args: [{
7018
8324
  isSignal: true,
7019
- alias: "maxFractionDigits",
8325
+ alias: "showSelectAll",
7020
8326
  required: false
7021
8327
  }]
7022
8328
  }],
7023
- useGrouping: [{
8329
+ showClear: [{
7024
8330
  type: i0.Input,
7025
8331
  args: [{
7026
8332
  isSignal: true,
7027
- alias: "useGrouping",
8333
+ alias: "showClear",
7028
8334
  required: false
7029
8335
  }]
7030
8336
  }],
7031
- prefix: [{
8337
+ display: [{
7032
8338
  type: i0.Input,
7033
8339
  args: [{
7034
8340
  isSignal: true,
7035
- alias: "prefix",
8341
+ alias: "display",
7036
8342
  required: false
7037
8343
  }]
7038
8344
  }],
7039
- suffix: [{
8345
+ maxSelectedLabels: [{
7040
8346
  type: i0.Input,
7041
8347
  args: [{
7042
8348
  isSignal: true,
7043
- alias: "suffix",
8349
+ alias: "maxSelectedLabels",
7044
8350
  required: false
7045
8351
  }]
7046
8352
  }],
7047
- buttons: [{
8353
+ selectionLimit: [{
7048
8354
  type: i0.Input,
7049
8355
  args: [{
7050
8356
  isSignal: true,
7051
- alias: "buttons",
8357
+ alias: "selectionLimit",
7052
8358
  required: false
7053
8359
  }]
7054
8360
  }],
7055
- placeholder: [{
8361
+ emptyMessage: [{
7056
8362
  type: i0.Input,
7057
8363
  args: [{
7058
8364
  isSignal: true,
7059
- alias: "placeholder",
8365
+ alias: "emptyMessage",
7060
8366
  required: false
7061
8367
  }]
7062
8368
  }],
@@ -7076,62 +8382,53 @@ i0.ɵɵngDeclareClassMetadata({
7076
8382
  required: false
7077
8383
  }]
7078
8384
  }],
7079
- readonly: [{
8385
+ ariaLabel: [{
7080
8386
  type: i0.Input,
7081
8387
  args: [{
7082
8388
  isSignal: true,
7083
- alias: "readonly",
8389
+ alias: "ariaLabel",
7084
8390
  required: false
7085
8391
  }]
7086
8392
  }],
7087
- ariaLabel: [{
8393
+ id: [{
7088
8394
  type: i0.Input,
7089
8395
  args: [{
7090
8396
  isSignal: true,
7091
- alias: "ariaLabel",
8397
+ alias: "id",
7092
8398
  required: false
7093
8399
  }]
7094
8400
  }],
7095
- id: [{
8401
+ compareWith: [{
7096
8402
  type: i0.Input,
7097
8403
  args: [{
7098
8404
  isSignal: true,
7099
- alias: "id",
8405
+ alias: "compareWith",
7100
8406
  required: false
7101
8407
  }]
7102
8408
  }],
7103
- input: [{
8409
+ closed: [{
8410
+ type: i0.Output,
8411
+ args: ["closed"]
8412
+ }],
8413
+ trigger: [{
7104
8414
  type: i0.ViewChild,
7105
- args: ["input", { isSignal: true }]
8415
+ args: ["trigger", { isSignal: true }]
8416
+ }],
8417
+ panel: [{
8418
+ type: i0.ViewChild,
8419
+ args: ["panel", { isSignal: true }]
8420
+ }],
8421
+ search: [{
8422
+ type: i0.ViewChild,
8423
+ args: ["search", { isSignal: true }]
8424
+ }],
8425
+ listbox: [{
8426
+ type: i0.ViewChild,
8427
+ args: ["listbox", { isSignal: true }]
7106
8428
  }]
7107
8429
  }
7108
8430
  });
7109
- function group(int) {
7110
- return int.replace(/\B(?=(\d{3})+(?!\d))/g, ".");
7111
- }
7112
- function parseNumber(text) {
7113
- const clean = text.replace(/[^\d,-]/g, "").replace(",", ".");
7114
- if (!clean || clean === "-" || clean === "." || clean === "-.") return null;
7115
- const n = Number(clean.endsWith(".") ? clean.slice(0, -1) : clean);
7116
- return Number.isNaN(n) ? null : n;
7117
- }
7118
- function significant(text) {
7119
- return text.replace(/[^\d,-]/g, "").length;
7120
- }
7121
- function positionAfter(text, count) {
7122
- if (count <= 0) return text.startsWith("-") ? 0 : 0;
7123
- let seen = 0;
7124
- for (let i = 0; i < text.length; i++) {
7125
- if (/[\d,-]/.test(text[i])) seen++;
7126
- if (seen === count) return i + 1;
7127
- }
7128
- return text.length;
7129
- }
7130
- function decimalsOf(n) {
7131
- const s = String(n);
7132
- return s.includes(".") ? s.split(".")[1].length : 0;
7133
- }
7134
- var HuMultiSelect = class HuMultiSelect {
8431
+ var HuSelect = class HuSelect {
7135
8432
  injector = inject(Injector);
7136
8433
  host = inject(ElementRef);
7137
8434
  win = inject(DOCUMENT).defaultView;
@@ -7140,28 +8437,21 @@ var HuMultiSelect = class HuMultiSelect {
7140
8437
  host: true
7141
8438
  });
7142
8439
  options = input([], ...ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []);
7143
- value = model([], ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
7144
- values = computed(() => this.value() ?? [], ...ngDevMode ? [{ debugName: "values" }] : /* istanbul ignore next */ []);
8440
+ value = model(null, ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
7145
8441
  placeholder = input("Seçin", ...ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []);
7146
- filter = input(true, {
8442
+ filter = input("auto", {
7147
8443
  ...ngDevMode ? { debugName: "filter" } : /* istanbul ignore next */ {},
7148
- transform: booleanAttribute
8444
+ transform: (v) => v === "auto" ? "auto" : booleanAttribute(v)
7149
8445
  });
7150
- filterPlaceholder = input("Ara…", ...ngDevMode ? [{ debugName: "filterPlaceholder" }] : /* istanbul ignore next */ []);
7151
- showSelectAll = input(true, {
7152
- ...ngDevMode ? { debugName: "showSelectAll" } : /* istanbul ignore next */ {},
7153
- transform: booleanAttribute
8446
+ filterThreshold = input(7, {
8447
+ ...ngDevMode ? { debugName: "filterThreshold" } : /* istanbul ignore next */ {},
8448
+ transform: numberAttribute
7154
8449
  });
7155
- showClear = input(true, {
8450
+ filterPlaceholder = input("Ara…", ...ngDevMode ? [{ debugName: "filterPlaceholder" }] : /* istanbul ignore next */ []);
8451
+ showClear = input(false, {
7156
8452
  ...ngDevMode ? { debugName: "showClear" } : /* istanbul ignore next */ {},
7157
8453
  transform: booleanAttribute
7158
8454
  });
7159
- display = input("chips", ...ngDevMode ? [{ debugName: "display" }] : /* istanbul ignore next */ []);
7160
- maxSelectedLabels = input(3, {
7161
- ...ngDevMode ? { debugName: "maxSelectedLabels" } : /* istanbul ignore next */ {},
7162
- transform: numberAttribute
7163
- });
7164
- selectionLimit = input(null, ...ngDevMode ? [{ debugName: "selectionLimit" }] : /* istanbul ignore next */ []);
7165
8455
  emptyMessage = input("Sonuç bulunamadı", ...ngDevMode ? [{ debugName: "emptyMessage" }] : /* istanbul ignore next */ []);
7166
8456
  size = input("md", ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
7167
8457
  disabled = input(false, {
@@ -7169,19 +8459,26 @@ var HuMultiSelect = class HuMultiSelect {
7169
8459
  transform: booleanAttribute
7170
8460
  });
7171
8461
  ariaLabel = input(...ngDevMode ? [void 0, { debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
7172
- id = input(huUniqueId("hu-multi-select"), ...ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []);
8462
+ id = input(huUniqueId("hu-select"), ...ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []);
7173
8463
  compareWith = input(Object.is, ...ngDevMode ? [{ debugName: "compareWith" }] : /* istanbul ignore next */ []);
8464
+ selectionChange = output();
7174
8465
  closed = output();
7175
8466
  open = signal(false, ...ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []);
7176
8467
  query = signal("", ...ngDevMode ? [{ debugName: "query" }] : /* istanbul ignore next */ []);
7177
8468
  activeIndex = signal(-1, ...ngDevMode ? [{ debugName: "activeIndex" }] : /* istanbul ignore next */ []);
7178
- listId = huUniqueId("hu-multi-select-list");
8469
+ listId = huUniqueId("hu-select-list");
7179
8470
  formDisabled = signal(false, ...ngDevMode ? [{ debugName: "formDisabled" }] : /* istanbul ignore next */ []);
7180
8471
  isDisabled = computed(() => this.disabled() || this.formDisabled(), ...ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []);
7181
- selectedOptions = computed(() => {
8472
+ showFilter = computed(() => {
8473
+ const f = this.filter();
8474
+ return f === "auto" ? this.options().length > this.filterThreshold() : f;
8475
+ }, ...ngDevMode ? [{ debugName: "showFilter" }] : /* istanbul ignore next */ []);
8476
+ selectedOption = computed(() => {
8477
+ const value = this.value();
8478
+ if (value == null) return void 0;
7182
8479
  const cmp = this.compareWith();
7183
- return this.values().map((v) => this.options().find((o) => cmp(o.value, v))).filter((o) => !!o);
7184
- }, ...ngDevMode ? [{ debugName: "selectedOptions" }] : /* istanbul ignore next */ []);
8480
+ return this.options().find((o) => cmp(o.value, value));
8481
+ }, ...ngDevMode ? [{ debugName: "selectedOption" }] : /* istanbul ignore next */ []);
7185
8482
  visible = computed(() => {
7186
8483
  const q = huFold(this.query().trim());
7187
8484
  return q ? this.options().filter((o) => huFold(o.label).includes(q) || huFold(o.description ?? "").includes(q)) : [...this.options()];
@@ -7203,22 +8500,6 @@ var HuMultiSelect = class HuMultiSelect {
7203
8500
  });
7204
8501
  return rows;
7205
8502
  }, ...ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []);
7206
- selectable = computed(() => this.visible().filter((o) => !o.disabled), ...ngDevMode ? [{ debugName: "selectable" }] : /* istanbul ignore next */ []);
7207
- allSelected = computed(() => {
7208
- const list = this.selectable();
7209
- return list.length > 0 && list.every((o) => this.isSelected(o));
7210
- }, ...ngDevMode ? [{ debugName: "allSelected" }] : /* istanbul ignore next */ []);
7211
- someSelected = computed(() => !this.allSelected() && this.selectable().some((o) => this.isSelected(o)), ...ngDevMode ? [{ debugName: "someSelected" }] : /* istanbul ignore next */ []);
7212
- limitReached = computed(() => {
7213
- const limit = this.selectionLimit();
7214
- return limit != null && this.values().length >= limit;
7215
- }, ...ngDevMode ? [{ debugName: "limitReached" }] : /* istanbul ignore next */ []);
7216
- summary = computed(() => {
7217
- const selected = this.selectedOptions();
7218
- if (selected.length > this.maxSelectedLabels()) return `${selected.length} seçildi`;
7219
- return selected.map((o) => o.label).join(", ");
7220
- }, ...ngDevMode ? [{ debugName: "summary" }] : /* istanbul ignore next */ []);
7221
- showChips = computed(() => this.display() === "chips" && this.selectedOptions().length <= this.maxSelectedLabels(), ...ngDevMode ? [{ debugName: "showChips" }] : /* istanbul ignore next */ []);
7222
8503
  ngControl;
7223
8504
  get hasControl() {
7224
8505
  return !!this.resolveControl();
@@ -7253,18 +8534,18 @@ var HuMultiSelect = class HuMultiSelect {
7253
8534
  if (this.open()) this.close(true);
7254
8535
  else this.show();
7255
8536
  }
7256
- show() {
8537
+ show(initialQuery = "") {
7257
8538
  if (this.isDisabled() || this.open()) return;
7258
- this.query.set("");
8539
+ this.query.set(initialQuery);
7259
8540
  this.open.set(true);
7260
- const first = this.visible().findIndex((o) => this.isSelected(o));
7261
- this.activeIndex.set(first >= 0 ? first : this.nextEnabled(-1, 1));
8541
+ const selected = this.visible().findIndex((o) => this.isSelected(o));
8542
+ this.activeIndex.set(!initialQuery && selected >= 0 ? selected : this.nextEnabled(-1, 1));
7262
8543
  afterNextRender(() => {
7263
8544
  if (!this.open()) return;
7264
8545
  if (this.supportsPopover) this.panel().nativeElement.showPopover();
7265
8546
  this.positionPanel();
7266
8547
  (this.search() ?? this.listbox())?.nativeElement.focus({ preventScroll: true });
7267
- this.scrollActiveIntoView();
8548
+ this.scrollActiveIntoView("center");
7268
8549
  }, { injector: this.injector });
7269
8550
  }
7270
8551
  close(restoreFocus = false) {
@@ -7276,39 +8557,18 @@ var HuMultiSelect = class HuMultiSelect {
7276
8557
  this.closed.emit();
7277
8558
  }
7278
8559
  isSelected(option) {
7279
- const cmp = this.compareWith();
7280
- return this.values().some((v) => cmp(v, option.value));
8560
+ const value = this.value();
8561
+ return value != null && this.compareWith()(option.value, value);
7281
8562
  }
7282
- toggleOption(option) {
8563
+ choose(option) {
7283
8564
  if (option.disabled || this.isDisabled()) return;
7284
- const cmp = this.compareWith();
7285
- if (this.isSelected(option)) this.commit(this.values().filter((v) => !cmp(v, option.value)));
7286
- else if (!this.limitReached()) {
7287
- const next = [...this.values(), option.value];
7288
- this.commit(this.sortByOptions(next));
7289
- }
7290
- }
7291
- toggleAll() {
7292
- const cmp = this.compareWith();
7293
- const visible = this.selectable();
7294
- if (this.allSelected()) this.commit(this.values().filter((v) => !visible.some((o) => cmp(o.value, v))));
7295
- else {
7296
- const add = visible.filter((o) => !this.isSelected(o)).map((o) => o.value);
7297
- const limit = this.selectionLimit();
7298
- const room = limit == null ? add.length : Math.max(0, limit - this.values().length);
7299
- this.commit(this.sortByOptions([...this.values(), ...add.slice(0, room)]));
7300
- }
7301
- }
7302
- remove(option, event) {
7303
- event.stopPropagation();
7304
- if (this.isDisabled()) return;
7305
- const cmp = this.compareWith();
7306
- this.commit(this.values().filter((v) => !cmp(v, option.value)));
8565
+ if (!this.isSelected(option)) this.commit(option.value);
8566
+ this.close(true);
7307
8567
  }
7308
- clearAll(event) {
8568
+ clear(event) {
7309
8569
  event.stopPropagation();
7310
8570
  if (this.isDisabled()) return;
7311
- this.commit([]);
8571
+ this.commit(null);
7312
8572
  this.trigger().nativeElement.focus();
7313
8573
  }
7314
8574
  onTriggerKeydown(event) {
@@ -7316,14 +8576,23 @@ var HuMultiSelect = class HuMultiSelect {
7316
8576
  "Enter",
7317
8577
  " ",
7318
8578
  "ArrowDown",
7319
- "ArrowUp"
7320
- ].includes(event.key)) {
8579
+ "ArrowUp",
8580
+ "F4"
8581
+ ].includes(event.key) || event.altKey && event.key === "ArrowDown") {
7321
8582
  event.preventDefault();
7322
8583
  this.show();
7323
- } else if (event.key === "Backspace" && !this.open() && this.values().length) this.commit(this.values().slice(0, -1));
8584
+ } else if (event.key.length === 1 && !event.ctrlKey && !event.metaKey && !event.altKey) {
8585
+ event.preventDefault();
8586
+ if (this.showFilter()) this.show(event.key);
8587
+ else this.jumpTo(event.key);
8588
+ } else if ((event.key === "Delete" || event.key === "Backspace") && this.showClear() && this.value() != null) {
8589
+ event.preventDefault();
8590
+ this.commit(null);
8591
+ }
7324
8592
  }
7325
8593
  onPanelKeydown(event) {
7326
8594
  const visible = this.visible();
8595
+ const inSearch = event.target === this.search()?.nativeElement;
7327
8596
  switch (event.key) {
7328
8597
  case "ArrowDown":
7329
8598
  event.preventDefault();
@@ -7334,29 +8603,32 @@ var HuMultiSelect = class HuMultiSelect {
7334
8603
  this.activeIndex.set(this.nextEnabled(this.activeIndex(), -1));
7335
8604
  break;
7336
8605
  case "Home":
7337
- if (event.target === this.search()?.nativeElement) return;
8606
+ if (inSearch) return;
7338
8607
  event.preventDefault();
7339
8608
  this.activeIndex.set(this.nextEnabled(-1, 1));
7340
8609
  break;
7341
8610
  case "End":
7342
- if (event.target === this.search()?.nativeElement) return;
8611
+ if (inSearch) return;
7343
8612
  event.preventDefault();
7344
8613
  this.activeIndex.set(this.nextEnabled(visible.length, -1));
7345
8614
  break;
7346
- case "Enter":
8615
+ case "PageDown":
8616
+ case "PageUp": {
7347
8617
  event.preventDefault();
7348
- if (visible[this.activeIndex()]) this.toggleOption(visible[this.activeIndex()]);
8618
+ const step = event.key === "PageDown" ? 1 : -1;
8619
+ let i = this.activeIndex();
8620
+ for (let n = 0; n < 8; n++) i = this.nextEnabled(i, step);
8621
+ this.activeIndex.set(i);
7349
8622
  break;
8623
+ }
8624
+ case "Enter":
8625
+ event.preventDefault();
8626
+ if (visible[this.activeIndex()]) this.choose(visible[this.activeIndex()]);
8627
+ return;
7350
8628
  case " ":
7351
- if (event.target === this.search()?.nativeElement) return;
8629
+ if (inSearch) return;
7352
8630
  event.preventDefault();
7353
- if (visible[this.activeIndex()]) this.toggleOption(visible[this.activeIndex()]);
7354
- break;
7355
- case "a":
7356
- if ((event.ctrlKey || event.metaKey) && event.target !== this.search()?.nativeElement) {
7357
- event.preventDefault();
7358
- this.toggleAll();
7359
- }
8631
+ if (visible[this.activeIndex()]) this.choose(visible[this.activeIndex()]);
7360
8632
  return;
7361
8633
  case "Escape":
7362
8634
  event.preventDefault();
@@ -7366,13 +8638,19 @@ var HuMultiSelect = class HuMultiSelect {
7366
8638
  case "Tab":
7367
8639
  this.close();
7368
8640
  return;
7369
- default: return;
8641
+ default:
8642
+ if (!inSearch && event.key.length === 1 && !event.ctrlKey && !event.metaKey) this.jumpTo(event.key);
8643
+ return;
7370
8644
  }
7371
8645
  this.scrollActiveIntoView();
7372
8646
  }
7373
8647
  onQuery(value) {
7374
8648
  this.query.set(value);
7375
8649
  this.activeIndex.set(this.nextEnabled(-1, 1));
8650
+ this.scrollActiveIntoView();
8651
+ }
8652
+ onOptionHover(index, option) {
8653
+ if (!option.disabled && this.activeIndex() !== index) this.activeIndex.set(index);
7376
8654
  }
7377
8655
  optionId(index) {
7378
8656
  return `${this.listId}-${index}`;
@@ -7389,7 +8667,7 @@ var HuMultiSelect = class HuMultiSelect {
7389
8667
  if (this.open() && !this.pointerInside) this.close();
7390
8668
  }
7391
8669
  writeValue(value) {
7392
- this.value.set(Array.isArray(value) ? value : value == null ? [] : [value]);
8670
+ this.value.set(value ?? null);
7393
8671
  }
7394
8672
  registerOnChange(fn) {
7395
8673
  this.onChange = fn;
@@ -7404,31 +8682,38 @@ var HuMultiSelect = class HuMultiSelect {
7404
8682
  commit(value) {
7405
8683
  this.value.set(value);
7406
8684
  this.onChange(value);
7407
- if (this.open()) afterNextRender(() => this.positionPanel(), { injector: this.injector });
8685
+ this.selectionChange.emit(value);
7408
8686
  }
7409
- sortByOptions(values) {
7410
- const cmp = this.compareWith();
7411
- const order = (v) => {
7412
- const i = this.options().findIndex((o) => cmp(o.value, v));
7413
- return i < 0 ? Number.MAX_SAFE_INTEGER : i;
7414
- };
7415
- return [...values].sort((a, b) => order(a) - order(b));
8687
+ jumpTo(char) {
8688
+ const list = this.visible();
8689
+ const c = huFold(char);
8690
+ const start = this.open() ? this.activeIndex() : list.findIndex((o) => this.isSelected(o));
8691
+ for (let n = 1; n <= list.length; n++) {
8692
+ const i = (start + n + list.length) % list.length;
8693
+ if (!list[i].disabled && huFold(list[i].label).startsWith(c)) {
8694
+ if (this.open()) {
8695
+ this.activeIndex.set(i);
8696
+ this.scrollActiveIntoView();
8697
+ } else this.commit(list[i].value);
8698
+ return;
8699
+ }
8700
+ }
7416
8701
  }
7417
8702
  nextEnabled(from, direction) {
7418
8703
  const list = this.visible();
7419
8704
  for (let i = from + direction; i >= 0 && i < list.length; i += direction) if (!list[i].disabled) return i;
7420
8705
  return from >= 0 && from < list.length ? from : -1;
7421
8706
  }
7422
- scrollActiveIntoView() {
7423
- afterNextRender(() => this.panel().nativeElement.querySelector(".hu-multi-select__option--active")?.scrollIntoView({ block: "nearest" }), { injector: this.injector });
8707
+ scrollActiveIntoView(block = "nearest") {
8708
+ afterNextRender(() => this.panel().nativeElement.querySelector(".hu-select__option--active")?.scrollIntoView({ block }), { injector: this.injector });
7424
8709
  }
7425
8710
  positionPanel() {
7426
8711
  const panel = this.panel().nativeElement;
7427
8712
  if (!this.supportsPopover || !this.win) return;
7428
8713
  const anchor = this.trigger().nativeElement.getBoundingClientRect();
7429
- panel.style.width = `${anchor.width}px`;
8714
+ panel.style.minWidth = `${anchor.width}px`;
7430
8715
  const { offsetWidth: width, offsetHeight: height } = panel;
7431
- const gap = 4;
8716
+ const gap = 6;
7432
8717
  const top = this.win.innerHeight - anchor.bottom < height + gap && anchor.top > height + gap ? anchor.top - height - gap : anchor.bottom + gap;
7433
8718
  const left = Math.max(8, Math.min(anchor.left, this.win.innerWidth - width - 8));
7434
8719
  panel.style.top = `${top}px`;
@@ -7445,16 +8730,16 @@ var HuMultiSelect = class HuMultiSelect {
7445
8730
  minVersion: "12.0.0",
7446
8731
  version: "22.2.0",
7447
8732
  ngImport: i0,
7448
- type: HuMultiSelect,
8733
+ type: HuSelect,
7449
8734
  deps: [],
7450
8735
  target: i0.ɵɵFactoryTarget.Component
7451
8736
  });
7452
8737
  static ɵcmp = i0.ɵɵngDeclareComponent({
7453
8738
  minVersion: "17.0.0",
7454
8739
  version: "22.2.0",
7455
- type: HuMultiSelect,
8740
+ type: HuSelect,
7456
8741
  isStandalone: true,
7457
- selector: "hu-multi-select",
8742
+ selector: "hu-select",
7458
8743
  inputs: {
7459
8744
  options: {
7460
8745
  classPropertyName: "options",
@@ -7484,16 +8769,16 @@ var HuMultiSelect = class HuMultiSelect {
7484
8769
  isRequired: false,
7485
8770
  transformFunction: null
7486
8771
  },
7487
- filterPlaceholder: {
7488
- classPropertyName: "filterPlaceholder",
7489
- publicName: "filterPlaceholder",
8772
+ filterThreshold: {
8773
+ classPropertyName: "filterThreshold",
8774
+ publicName: "filterThreshold",
7490
8775
  isSignal: true,
7491
8776
  isRequired: false,
7492
8777
  transformFunction: null
7493
8778
  },
7494
- showSelectAll: {
7495
- classPropertyName: "showSelectAll",
7496
- publicName: "showSelectAll",
8779
+ filterPlaceholder: {
8780
+ classPropertyName: "filterPlaceholder",
8781
+ publicName: "filterPlaceholder",
7497
8782
  isSignal: true,
7498
8783
  isRequired: false,
7499
8784
  transformFunction: null
@@ -7505,27 +8790,6 @@ var HuMultiSelect = class HuMultiSelect {
7505
8790
  isRequired: false,
7506
8791
  transformFunction: null
7507
8792
  },
7508
- display: {
7509
- classPropertyName: "display",
7510
- publicName: "display",
7511
- isSignal: true,
7512
- isRequired: false,
7513
- transformFunction: null
7514
- },
7515
- maxSelectedLabels: {
7516
- classPropertyName: "maxSelectedLabels",
7517
- publicName: "maxSelectedLabels",
7518
- isSignal: true,
7519
- isRequired: false,
7520
- transformFunction: null
7521
- },
7522
- selectionLimit: {
7523
- classPropertyName: "selectionLimit",
7524
- publicName: "selectionLimit",
7525
- isSignal: true,
7526
- isRequired: false,
7527
- transformFunction: null
7528
- },
7529
8793
  emptyMessage: {
7530
8794
  classPropertyName: "emptyMessage",
7531
8795
  publicName: "emptyMessage",
@@ -7571,6 +8835,7 @@ var HuMultiSelect = class HuMultiSelect {
7571
8835
  },
7572
8836
  outputs: {
7573
8837
  value: "valueChange",
8838
+ selectionChange: "selectionChange",
7574
8839
  closed: "closed"
7575
8840
  },
7576
8841
  host: {
@@ -7579,19 +8844,19 @@ var HuMultiSelect = class HuMultiSelect {
7579
8844
  "document:mousedown": "onDocumentPointer($event)"
7580
8845
  },
7581
8846
  properties: {
7582
- "class.hu-multi-select--open": "open()",
7583
- "class.hu-multi-select--disabled": "isDisabled()",
8847
+ "class.hu-select--open": "open()",
8848
+ "class.hu-select--disabled": "isDisabled()",
7584
8849
  "attr.data-size": "size()"
7585
8850
  },
7586
- classAttribute: "hu-multi-select"
8851
+ classAttribute: "hu-select"
7587
8852
  },
7588
8853
  providers: [{
7589
8854
  provide: NG_VALUE_ACCESSOR,
7590
- useExisting: forwardRef(() => HuMultiSelect),
8855
+ useExisting: forwardRef(() => HuSelect),
7591
8856
  multi: true
7592
8857
  }, {
7593
8858
  provide: HuFormFieldControl,
7594
- useExisting: forwardRef(() => HuMultiSelect)
8859
+ useExisting: forwardRef(() => HuSelect)
7595
8860
  }],
7596
8861
  viewQueries: [
7597
8862
  {
@@ -7624,8 +8889,8 @@ var HuMultiSelect = class HuMultiSelect {
7624
8889
  }
7625
8890
  ],
7626
8891
  ngImport: i0,
7627
- template: "<div\r\n #trigger\r\n class=\"hu-multi-select__trigger\"\r\n role=\"combobox\"\r\n aria-haspopup=\"listbox\"\r\n [id]=\"id()\"\r\n [attr.tabindex]=\"isDisabled() ? -1 : 0\"\r\n [attr.aria-expanded]=\"open()\"\r\n [attr.aria-controls]=\"listId\"\r\n [attr.aria-disabled]=\"isDisabled() || null\"\r\n [attr.aria-invalid]=\"isInvalid() || null\"\r\n [attr.aria-describedby]=\"field?.describedBy() ?? null\"\r\n [attr.aria-label]=\"ariaLabel() || null\"\r\n [class.hu-multi-select__trigger--invalid]=\"isInvalid()\"\r\n (click)=\"toggle()\"\r\n (keydown)=\"onTriggerKeydown($event)\"\r\n>\r\n <div class=\"hu-multi-select__values\">\r\n @if (!selectedOptions().length) {\r\n <span class=\"hu-multi-select__placeholder\">{{ placeholder() }}</span>\r\n } @else if (showChips()) {\r\n @for (o of selectedOptions(); track o.value) {\r\n <span class=\"hu-multi-select__chip\">\r\n {{ o.label }}\r\n @if (!isDisabled()) {\r\n <button\r\n type=\"button\"\r\n class=\"hu-multi-select__chip-remove\"\r\n tabindex=\"-1\"\r\n [attr.aria-label]=\"o.label + ' kaldır'\"\r\n (click)=\"remove(o, $event)\"\r\n >\r\n <hu-icon name=\"x\" [size]=\"12\" />\r\n </button>\r\n }\r\n </span>\r\n }\r\n } @else {\r\n <span class=\"hu-multi-select__text\">{{ summary() }}</span>\r\n }\r\n </div>\r\n @if (showClear() && selectedOptions().length && !isDisabled()) {\r\n <button type=\"button\" class=\"hu-multi-select__icon-btn\" tabindex=\"-1\" aria-label=\"Seçimi temizle\" (click)=\"clearAll($event)\">\r\n <hu-icon name=\"x\" [size]=\"14\" />\r\n </button>\r\n }\r\n <hu-icon class=\"hu-multi-select__caret\" name=\"chevron-down\" [size]=\"16\" />\r\n</div>\r\n\r\n<div\r\n #panel\r\n popover=\"manual\"\r\n class=\"hu-multi-select__panel\"\r\n [class.hu-multi-select__panel--inline]=\"!supportsPopover\"\r\n [attr.hidden]=\"!supportsPopover && !open() ? '' : null\"\r\n (keydown)=\"onPanelKeydown($event)\"\r\n>\r\n @if (open()) {\r\n @if (filter() || showSelectAll()) {\r\n <div class=\"hu-multi-select__header\">\r\n @if (showSelectAll() && selectionLimit() == null) {\r\n <button\r\n type=\"button\"\r\n class=\"hu-multi-select__all\"\r\n tabindex=\"-1\"\r\n [attr.aria-label]=\"allSelected() ? 'Seçimi kaldır' : 'Tümünü seç'\"\r\n [disabled]=\"!selectable().length\"\r\n (click)=\"toggleAll()\"\r\n >\r\n <span\r\n class=\"hu-multi-select__box\"\r\n [class.hu-multi-select__box--checked]=\"allSelected()\"\r\n [class.hu-multi-select__box--partial]=\"someSelected()\"\r\n aria-hidden=\"true\"\r\n >\r\n @if (allSelected()) {\r\n <hu-icon name=\"check\" [size]=\"12\" />\r\n } @else if (someSelected()) {\r\n <hu-icon name=\"minus\" [size]=\"12\" />\r\n }\r\n </span>\r\n </button>\r\n }\r\n @if (filter()) {\r\n <div class=\"hu-multi-select__search\">\r\n <hu-icon name=\"search\" [size]=\"14\" />\r\n <input\r\n #search\r\n type=\"text\"\r\n class=\"hu-input\"\r\n data-size=\"sm\"\r\n role=\"searchbox\"\r\n autocomplete=\"off\"\r\n [attr.aria-label]=\"filterPlaceholder()\"\r\n [attr.aria-controls]=\"listId\"\r\n [attr.aria-activedescendant]=\"activeIndex() >= 0 ? optionId(activeIndex()) : null\"\r\n [placeholder]=\"filterPlaceholder()\"\r\n [value]=\"query()\"\r\n (input)=\"onQuery($any($event.target).value)\"\r\n />\r\n </div>\r\n } @else if (showSelectAll() && selectionLimit() == null) {\r\n <span class=\"hu-multi-select__all-label\" (click)=\"toggleAll()\">Tümünü seç</span>\r\n }\r\n </div>\r\n }\r\n\r\n <ul\r\n #listbox\r\n class=\"hu-multi-select__list\"\r\n role=\"listbox\"\r\n aria-multiselectable=\"true\"\r\n [id]=\"listId\"\r\n [attr.tabindex]=\"filter() ? -1 : 0\"\r\n [attr.aria-label]=\"ariaLabel() || placeholder()\"\r\n [attr.aria-activedescendant]=\"!filter() && activeIndex() >= 0 ? optionId(activeIndex()) : null\"\r\n >\r\n @for (row of rows(); track $index) {\r\n @if (row.kind === 'group') {\r\n <li class=\"hu-multi-select__group\" role=\"presentation\">{{ row.label }}</li>\r\n } @else {\r\n @let o = row.option;\r\n @let selected = isSelected(o);\r\n @let blocked = !selected && limitReached();\r\n <li\r\n class=\"hu-multi-select__option\"\r\n role=\"option\"\r\n [id]=\"optionId(row.index)\"\r\n [attr.aria-selected]=\"selected\"\r\n [attr.aria-disabled]=\"o.disabled || blocked || null\"\r\n [class.hu-multi-select__option--active]=\"row.index === activeIndex()\"\r\n [class.hu-multi-select__option--disabled]=\"o.disabled || blocked\"\r\n (mousedown)=\"$event.preventDefault()\"\r\n (mousemove)=\"!o.disabled && activeIndex() !== row.index && activeIndex.set(row.index)\"\r\n (click)=\"toggleOption(o)\"\r\n >\r\n <span class=\"hu-multi-select__box\" [class.hu-multi-select__box--checked]=\"selected\" aria-hidden=\"true\">\r\n @if (selected) {\r\n <hu-icon name=\"check\" [size]=\"12\" />\r\n }\r\n </span>\r\n @if (o.icon) {\r\n <hu-icon class=\"hu-multi-select__option-icon\" [name]=\"o.icon\" [size]=\"16\" />\r\n }\r\n <span class=\"hu-multi-select__option-text\">\r\n <span>{{ o.label }}</span>\r\n @if (o.description) {\r\n <span class=\"hu-multi-select__option-desc\">{{ o.description }}</span>\r\n }\r\n </span>\r\n </li>\r\n }\r\n } @empty {\r\n <li class=\"hu-multi-select__empty\" role=\"presentation\">{{ emptyMessage() }}</li>\r\n }\r\n </ul>\r\n\r\n @if (selectionLimit() != null || values().length) {\r\n <div class=\"hu-multi-select__footer\" aria-live=\"polite\">\r\n {{ values().length }}{{ selectionLimit() != null ? ' / ' + selectionLimit() : '' }} seçildi\r\n @if (limitReached()) {\r\n · sınıra ulaşıldı\r\n }\r\n </div>\r\n }\r\n }\r\n</div>\r\n",
7628
- styles: [".hu-multi-select{position:relative;display:block;width:100%;min-width:0}.hu-multi-select__trigger{display:flex;align-items:center;gap:var(--hu-space-1);min-height:var(--hu-control-md);padding:3px var(--hu-space-2) 3px var(--hu-space-3);font-size:var(--hu-text-sm);color:var(--hu-text);background:var(--hu-surface);border:1px solid var(--hu-border-strong);border-radius:var(--hu-radius-md);box-shadow:var(--hu-shadow-sm);cursor:pointer;transition:border-color var(--hu-transition),box-shadow var(--hu-transition)}.hu-multi-select__trigger:hover:not([aria-disabled=true]):not(:focus){border-color:var(--hu-gray-400)}.hu-multi-select__trigger:focus,.hu-multi-select--open .hu-multi-select__trigger{outline:none;border-color:var(--hu-primary);box-shadow:var(--hu-ring);transition:none}.hu-multi-select__trigger--invalid,.hu-multi-select__trigger--invalid:hover:not(:focus){border-color:var(--hu-danger)}.hu-multi-select__trigger--invalid:focus{box-shadow:var(--hu-ring-danger)}.hu-multi-select--disabled .hu-multi-select__trigger{color:var(--hu-text-subtle);background:var(--hu-surface-3);box-shadow:none;cursor:not-allowed}[data-size=sm] .hu-multi-select__trigger{min-height:var(--hu-control-sm);padding-left:var(--hu-space-2);font-size:.8125rem}[data-size=lg] .hu-multi-select__trigger{min-height:var(--hu-control-lg);padding-left:var(--hu-space-4);font-size:var(--hu-text-md)}.hu-multi-select__values{display:flex;flex:1;flex-wrap:wrap;align-items:center;gap:4px;min-width:0}.hu-multi-select__placeholder{color:var(--hu-text-subtle)}.hu-multi-select__text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.hu-multi-select__chip{display:inline-flex;align-items:center;gap:2px;max-width:100%;height:1.5rem;padding:0 2px 0 var(--hu-space-2);overflow:hidden;font-size:var(--hu-text-xs);font-weight:500;color:var(--hu-primary-soft-fg);white-space:nowrap;text-overflow:ellipsis;background:var(--hu-primary-soft);border-radius:var(--hu-radius-sm)}.hu-multi-select__chip-remove,.hu-multi-select__icon-btn{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;padding:0;color:inherit;background:none;border:0;border-radius:var(--hu-radius-sm);cursor:pointer;opacity:.7}.hu-multi-select__chip-remove:hover:not(:disabled),.hu-multi-select__icon-btn:hover:not(:disabled){opacity:1;background:#00000014}.hu-multi-select__chip-remove{width:1.125rem;height:1.125rem}.hu-multi-select__icon-btn{width:1.5rem;height:1.5rem;color:var(--hu-text-subtle)}.hu-multi-select__caret{flex-shrink:0;color:var(--hu-text-subtle);transition:transform var(--hu-transition)}.hu-multi-select--open .hu-multi-select__caret{transform:rotate(180deg)}.hu-multi-select__panel{position:fixed;inset:auto;flex-direction:column;min-width:14rem;max-width:calc(100vw - 1rem);margin:0;padding:0;overflow:hidden;color:var(--hu-text);background:var(--hu-surface);border:1px solid var(--hu-border);border-radius:var(--hu-radius-lg);box-shadow:var(--hu-shadow-lg)}.hu-multi-select__panel:popover-open{display:flex;animation:hu-multi-select-in .12s ease-out}.hu-multi-select__panel--inline{position:absolute;top:calc(100% + 4px);left:0;z-index:1000;display:flex;width:100%}.hu-multi-select__panel--inline[hidden]{display:none}.hu-multi-select__header{display:flex;align-items:center;gap:var(--hu-space-2);padding:var(--hu-space-2) var(--hu-space-3);border-bottom:1px solid var(--hu-border)}.hu-multi-select__all{display:inline-flex;padding:2px;background:none;border:0;border-radius:var(--hu-radius-sm);cursor:pointer}.hu-multi-select__all:disabled{opacity:.5;cursor:not-allowed}.hu-multi-select__all-label{font-size:var(--hu-text-sm);cursor:pointer}.hu-multi-select__search{position:relative;display:flex;flex:1;align-items:center;min-width:0}.hu-multi-select__search>hu-icon{position:absolute;left:var(--hu-space-2);color:var(--hu-text-subtle);pointer-events:none}.hu-multi-select__search>.hu-input{padding-left:1.75rem;box-shadow:none}.hu-multi-select__list{max-height:var(--hu-multi-select-max-height, 16rem);margin:0;padding:var(--hu-space-1);overflow-y:auto;list-style:none;outline:none}.hu-multi-select__group{padding:var(--hu-space-2) var(--hu-space-2) var(--hu-space-1);font-size:var(--hu-text-xs);font-weight:600;color:var(--hu-text-subtle)}.hu-multi-select__option{display:flex;align-items:flex-start;gap:var(--hu-space-2);padding:var(--hu-space-2);font-size:var(--hu-text-sm);line-height:1.35;border-radius:var(--hu-radius-sm);cursor:pointer;-webkit-user-select:none;user-select:none}.hu-multi-select__option--active{background:var(--hu-surface-3)}.hu-multi-select__option[aria-selected=true]{font-weight:500}.hu-multi-select__option--disabled{opacity:.5;cursor:not-allowed}.hu-multi-select__option-icon{color:var(--hu-text-subtle)}.hu-multi-select__option-text{display:flex;flex-direction:column;min-width:0}.hu-multi-select__option-desc{font-size:var(--hu-text-xs);font-weight:400;color:var(--hu-text-subtle)}.hu-multi-select__box{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;width:1rem;height:1rem;margin-top:1px;color:var(--hu-primary-fg);background:var(--hu-surface);border:1.5px solid var(--hu-border-strong);border-radius:4px;transition:background-color var(--hu-transition),border-color var(--hu-transition)}.hu-multi-select__box--checked,.hu-multi-select__box--partial{background:var(--hu-primary);border-color:var(--hu-primary)}.hu-multi-select__empty{padding:var(--hu-space-4) var(--hu-space-2);font-size:var(--hu-text-sm);color:var(--hu-text-subtle);text-align:center}.hu-multi-select__footer{padding:var(--hu-space-2) var(--hu-space-3);font-size:var(--hu-text-xs);color:var(--hu-text-muted);border-top:1px solid var(--hu-border)}@keyframes hu-multi-select-in{0%{opacity:0;transform:translateY(-4px)}}\n"],
8892
+ template: "<div\n #trigger\n class=\"hu-select__trigger\"\n role=\"combobox\"\n aria-haspopup=\"listbox\"\n [id]=\"id()\"\n [attr.tabindex]=\"isDisabled() ? -1 : 0\"\n [attr.aria-expanded]=\"open()\"\n [attr.aria-controls]=\"listId\"\n [attr.aria-disabled]=\"isDisabled() || null\"\n [attr.aria-invalid]=\"isInvalid() || null\"\n [attr.aria-describedby]=\"field?.describedBy() ?? null\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [class.hu-select__trigger--invalid]=\"isInvalid()\"\n (click)=\"toggle()\"\n (keydown)=\"onTriggerKeydown($event)\"\n>\n @if (selectedOption(); as s) {\n @if (s.icon) {\n <hu-icon class=\"hu-select__value-icon\" [name]=\"s.icon\" [size]=\"16\" />\n }\n <span class=\"hu-select__value\">{{ s.label }}</span>\n } @else {\n <span class=\"hu-select__placeholder\">{{ placeholder() }}</span>\n }\n @if (showClear() && selectedOption() && !isDisabled()) {\n <button type=\"button\" class=\"hu-select__clear\" tabindex=\"-1\" aria-label=\"Seçimi temizle\" (click)=\"clear($event)\">\n <hu-icon name=\"x\" [size]=\"14\" />\n </button>\n }\n <hu-icon class=\"hu-select__caret\" name=\"chevron-down\" [size]=\"16\" />\n</div>\n\n<div\n #panel\n popover=\"manual\"\n class=\"hu-select__panel\"\n [class.hu-select__panel--inline]=\"!supportsPopover\"\n [attr.hidden]=\"!supportsPopover && !open() ? '' : null\"\n (keydown)=\"onPanelKeydown($event)\"\n>\n @if (open()) {\n @if (showFilter()) {\n <div class=\"hu-select__search\">\n <hu-icon name=\"search\" [size]=\"15\" />\n <input\n #search\n type=\"text\"\n role=\"searchbox\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n [attr.aria-label]=\"filterPlaceholder()\"\n [attr.aria-controls]=\"listId\"\n [attr.aria-activedescendant]=\"activeIndex() >= 0 ? optionId(activeIndex()) : null\"\n [placeholder]=\"filterPlaceholder()\"\n [value]=\"query()\"\n (input)=\"onQuery($any($event.target).value)\"\n />\n </div>\n }\n\n <ul\n #listbox\n class=\"hu-select__list\"\n role=\"listbox\"\n [id]=\"listId\"\n [attr.tabindex]=\"showFilter() ? -1 : 0\"\n [attr.aria-label]=\"ariaLabel() || placeholder()\"\n [attr.aria-activedescendant]=\"!showFilter() && activeIndex() >= 0 ? optionId(activeIndex()) : null\"\n >\n @for (row of rows(); track $index) {\n @if (row.kind === 'group') {\n <li class=\"hu-select__group\" role=\"presentation\">{{ row.label }}</li>\n } @else {\n @let o = row.option;\n @let selected = isSelected(o);\n <li\n class=\"hu-select__option\"\n role=\"option\"\n [id]=\"optionId(row.index)\"\n [attr.aria-selected]=\"selected\"\n [attr.aria-disabled]=\"o.disabled || null\"\n [class.hu-select__option--active]=\"row.index === activeIndex()\"\n [class.hu-select__option--selected]=\"selected\"\n [class.hu-select__option--disabled]=\"o.disabled\"\n (mousedown)=\"$event.preventDefault()\"\n (mousemove)=\"onOptionHover(row.index, o)\"\n (click)=\"choose(o)\"\n >\n @if (o.icon) {\n <hu-icon class=\"hu-select__option-icon\" [name]=\"o.icon\" [size]=\"16\" />\n }\n <span class=\"hu-select__option-text\">\n <span class=\"hu-select__option-label\">{{ o.label }}</span>\n @if (o.description) {\n <span class=\"hu-select__option-desc\">{{ o.description }}</span>\n }\n </span>\n @if (selected) {\n <hu-icon class=\"hu-select__check\" name=\"check\" [size]=\"16\" />\n }\n </li>\n }\n } @empty {\n <li class=\"hu-select__empty\" role=\"presentation\">\n <hu-icon name=\"search\" [size]=\"18\" />\n {{ emptyMessage() }}\n </li>\n }\n </ul>\n }\n</div>\n",
8893
+ styles: [".hu-select{position:relative;display:block;width:100%;min-width:0}.hu-select__trigger{display:flex;align-items:center;gap:var(--hu-space-2);height:var(--hu-control-md);padding:0 var(--hu-space-2) 0 var(--hu-space-3);font-size:var(--hu-text-sm);color:var(--hu-text);background:var(--hu-surface);border:1px solid var(--hu-border-strong);border-radius:var(--hu-radius-md);box-shadow:var(--hu-shadow-sm);cursor:pointer;-webkit-user-select:none;user-select:none;transition:border-color var(--hu-transition),box-shadow var(--hu-transition)}.hu-select__trigger:hover:not([aria-disabled=true]):not(:focus){border-color:var(--hu-gray-400)}.hu-select__trigger:focus,.hu-select--open .hu-select__trigger{outline:none;border-color:var(--hu-primary);box-shadow:var(--hu-ring);transition:none}.hu-select__trigger--invalid,.hu-select__trigger--invalid:hover:not(:focus){border-color:var(--hu-danger)}.hu-select__trigger--invalid:focus{box-shadow:var(--hu-ring-danger)}.hu-select--disabled .hu-select__trigger{color:var(--hu-text-subtle);background:var(--hu-surface-3);box-shadow:none;cursor:not-allowed}[data-size=sm] .hu-select__trigger{height:var(--hu-control-sm);padding-left:var(--hu-space-2);font-size:.8125rem}[data-size=lg] .hu-select__trigger{height:var(--hu-control-lg);padding-left:var(--hu-space-4);font-size:var(--hu-text-md)}.hu-select__value,.hu-select__placeholder{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.hu-select__placeholder{color:var(--hu-text-subtle)}.hu-select__value-icon{flex-shrink:0;color:var(--hu-text-muted)}.hu-select__clear{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;padding:0;color:var(--hu-text-subtle);background:none;border:0;border-radius:var(--hu-radius-sm);cursor:pointer}.hu-select__clear:hover{color:var(--hu-text);background:var(--hu-surface-3)}.hu-select__caret{flex-shrink:0;color:var(--hu-text-subtle);transition:transform var(--hu-transition)}.hu-select--open .hu-select__caret{color:var(--hu-primary);transform:rotate(180deg)}.hu-select__panel{--_panel-bg: var(--hu-select-panel-bg, var(--hu-surface));position:fixed;inset:auto;flex-direction:column;min-width:12rem;max-width:min(32rem,100vw - 1rem);margin:0;padding:0;overflow:hidden;color:var(--hu-text);background:var(--_panel-bg);border:1px solid var(--hu-border);border-radius:var(--hu-radius-lg);box-shadow:var(--hu-shadow-lg)}:root[data-theme=dark] .hu-select__panel{--_panel-bg: var(--hu-select-panel-bg, var(--hu-surface-2));border-color:var(--hu-border-strong)}.hu-select__panel:popover-open{display:flex;animation:hu-select-in .14s cubic-bezier(.2,.9,.3,1)}.hu-select__panel--inline{position:absolute;top:calc(100% + 6px);left:0;z-index:1000;display:flex;width:100%}.hu-select__panel--inline[hidden]{display:none}.hu-select__search{display:flex;flex-shrink:0;align-items:center;gap:var(--hu-space-2);margin:var(--hu-space-2) var(--hu-space-2) 0;padding:0 var(--hu-space-3);height:2.25rem;color:var(--hu-text-subtle);background:var(--hu-surface-2);border:1px solid transparent;border-radius:var(--hu-radius-md);transition:border-color var(--hu-transition),background-color var(--hu-transition)}:root[data-theme=dark] .hu-select__search{background:var(--hu-surface-3)}.hu-select__search:focus-within{color:var(--hu-primary);background:var(--_panel-bg);border-color:color-mix(in srgb,var(--hu-primary) 45%,transparent)}.hu-select__search>hu-icon{flex-shrink:0}.hu-select__search>input{flex:1;min-width:0;height:100%;padding:0;font:inherit;font-size:var(--hu-text-sm);color:var(--hu-text);background:none;border:0;outline:none}.hu-select__search>input::placeholder{color:var(--hu-text-subtle)}.hu-select__list{max-height:var(--hu-select-max-height, 17rem);margin:0;padding:var(--hu-space-1-5, 6px);overflow-y:auto;list-style:none;outline:none;scrollbar-width:thin}.hu-select__group{padding:var(--hu-space-3) var(--hu-space-2) var(--hu-space-1);font-size:.6875rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--hu-text-subtle)}.hu-select__group:first-child{padding-top:var(--hu-space-1)}.hu-select__option{position:relative;display:flex;align-items:center;gap:var(--hu-space-2);min-height:2.25rem;padding:var(--hu-space-2) var(--hu-space-2) var(--hu-space-2) var(--hu-space-3);font-size:var(--hu-text-sm);line-height:1.35;border-radius:var(--hu-radius-md);cursor:pointer;-webkit-user-select:none;user-select:none}.hu-select__option--active{background:var(--hu-surface-3)}.hu-select__option--selected{font-weight:500;color:var(--hu-primary-soft-fg);background:var(--hu-primary-soft)}.hu-select__option--selected .hu-select__option-icon{color:var(--hu-primary)}.hu-select__option--selected.hu-select__option--active{background:var(--hu-primary-soft-hover)}.hu-select__option--disabled{opacity:.45;cursor:not-allowed}.hu-select__option-icon{flex-shrink:0;color:var(--hu-text-subtle)}.hu-select__option-text{display:flex;flex:1;flex-direction:column;min-width:0}.hu-select__option-desc{font-size:var(--hu-text-xs);font-weight:400;color:var(--hu-text-subtle)}.hu-select__check{flex-shrink:0;color:var(--hu-primary)}.hu-select__empty{display:flex;flex-direction:column;align-items:center;gap:var(--hu-space-2);padding:var(--hu-space-5) var(--hu-space-2);font-size:var(--hu-text-sm);color:var(--hu-text-subtle);text-align:center}@keyframes hu-select-in{0%{opacity:0;transform:translateY(-6px) scale(.98)}}\n"],
7629
8894
  dependencies: [{
7630
8895
  kind: "component",
7631
8896
  type: HuIcon,
@@ -7645,32 +8910,32 @@ i0.ɵɵngDeclareClassMetadata({
7645
8910
  minVersion: "12.0.0",
7646
8911
  version: "22.2.0",
7647
8912
  ngImport: i0,
7648
- type: HuMultiSelect,
8913
+ type: HuSelect,
7649
8914
  decorators: [{
7650
8915
  type: Component,
7651
8916
  args: [{
7652
- selector: "hu-multi-select",
8917
+ selector: "hu-select",
7653
8918
  imports: [HuIcon],
7654
8919
  providers: [{
7655
8920
  provide: NG_VALUE_ACCESSOR,
7656
- useExisting: forwardRef(() => HuMultiSelect),
8921
+ useExisting: forwardRef(() => HuSelect),
7657
8922
  multi: true
7658
8923
  }, {
7659
8924
  provide: HuFormFieldControl,
7660
- useExisting: forwardRef(() => HuMultiSelect)
8925
+ useExisting: forwardRef(() => HuSelect)
7661
8926
  }],
7662
8927
  host: {
7663
- class: "hu-multi-select",
7664
- "[class.hu-multi-select--open]": "open()",
7665
- "[class.hu-multi-select--disabled]": "isDisabled()",
8928
+ class: "hu-select",
8929
+ "[class.hu-select--open]": "open()",
8930
+ "[class.hu-select--disabled]": "isDisabled()",
7666
8931
  "[attr.data-size]": "size()",
7667
8932
  "(focusout)": "onFocusOut($event)",
7668
8933
  "(document:mousedown)": "onDocumentPointer($event)"
7669
8934
  },
7670
8935
  encapsulation: ViewEncapsulation.None,
7671
8936
  changeDetection: ChangeDetectionStrategy.OnPush,
7672
- template: "<div\r\n #trigger\r\n class=\"hu-multi-select__trigger\"\r\n role=\"combobox\"\r\n aria-haspopup=\"listbox\"\r\n [id]=\"id()\"\r\n [attr.tabindex]=\"isDisabled() ? -1 : 0\"\r\n [attr.aria-expanded]=\"open()\"\r\n [attr.aria-controls]=\"listId\"\r\n [attr.aria-disabled]=\"isDisabled() || null\"\r\n [attr.aria-invalid]=\"isInvalid() || null\"\r\n [attr.aria-describedby]=\"field?.describedBy() ?? null\"\r\n [attr.aria-label]=\"ariaLabel() || null\"\r\n [class.hu-multi-select__trigger--invalid]=\"isInvalid()\"\r\n (click)=\"toggle()\"\r\n (keydown)=\"onTriggerKeydown($event)\"\r\n>\r\n <div class=\"hu-multi-select__values\">\r\n @if (!selectedOptions().length) {\r\n <span class=\"hu-multi-select__placeholder\">{{ placeholder() }}</span>\r\n } @else if (showChips()) {\r\n @for (o of selectedOptions(); track o.value) {\r\n <span class=\"hu-multi-select__chip\">\r\n {{ o.label }}\r\n @if (!isDisabled()) {\r\n <button\r\n type=\"button\"\r\n class=\"hu-multi-select__chip-remove\"\r\n tabindex=\"-1\"\r\n [attr.aria-label]=\"o.label + ' kaldır'\"\r\n (click)=\"remove(o, $event)\"\r\n >\r\n <hu-icon name=\"x\" [size]=\"12\" />\r\n </button>\r\n }\r\n </span>\r\n }\r\n } @else {\r\n <span class=\"hu-multi-select__text\">{{ summary() }}</span>\r\n }\r\n </div>\r\n @if (showClear() && selectedOptions().length && !isDisabled()) {\r\n <button type=\"button\" class=\"hu-multi-select__icon-btn\" tabindex=\"-1\" aria-label=\"Seçimi temizle\" (click)=\"clearAll($event)\">\r\n <hu-icon name=\"x\" [size]=\"14\" />\r\n </button>\r\n }\r\n <hu-icon class=\"hu-multi-select__caret\" name=\"chevron-down\" [size]=\"16\" />\r\n</div>\r\n\r\n<div\r\n #panel\r\n popover=\"manual\"\r\n class=\"hu-multi-select__panel\"\r\n [class.hu-multi-select__panel--inline]=\"!supportsPopover\"\r\n [attr.hidden]=\"!supportsPopover && !open() ? '' : null\"\r\n (keydown)=\"onPanelKeydown($event)\"\r\n>\r\n @if (open()) {\r\n @if (filter() || showSelectAll()) {\r\n <div class=\"hu-multi-select__header\">\r\n @if (showSelectAll() && selectionLimit() == null) {\r\n <button\r\n type=\"button\"\r\n class=\"hu-multi-select__all\"\r\n tabindex=\"-1\"\r\n [attr.aria-label]=\"allSelected() ? 'Seçimi kaldır' : 'Tümünü seç'\"\r\n [disabled]=\"!selectable().length\"\r\n (click)=\"toggleAll()\"\r\n >\r\n <span\r\n class=\"hu-multi-select__box\"\r\n [class.hu-multi-select__box--checked]=\"allSelected()\"\r\n [class.hu-multi-select__box--partial]=\"someSelected()\"\r\n aria-hidden=\"true\"\r\n >\r\n @if (allSelected()) {\r\n <hu-icon name=\"check\" [size]=\"12\" />\r\n } @else if (someSelected()) {\r\n <hu-icon name=\"minus\" [size]=\"12\" />\r\n }\r\n </span>\r\n </button>\r\n }\r\n @if (filter()) {\r\n <div class=\"hu-multi-select__search\">\r\n <hu-icon name=\"search\" [size]=\"14\" />\r\n <input\r\n #search\r\n type=\"text\"\r\n class=\"hu-input\"\r\n data-size=\"sm\"\r\n role=\"searchbox\"\r\n autocomplete=\"off\"\r\n [attr.aria-label]=\"filterPlaceholder()\"\r\n [attr.aria-controls]=\"listId\"\r\n [attr.aria-activedescendant]=\"activeIndex() >= 0 ? optionId(activeIndex()) : null\"\r\n [placeholder]=\"filterPlaceholder()\"\r\n [value]=\"query()\"\r\n (input)=\"onQuery($any($event.target).value)\"\r\n />\r\n </div>\r\n } @else if (showSelectAll() && selectionLimit() == null) {\r\n <span class=\"hu-multi-select__all-label\" (click)=\"toggleAll()\">Tümünü seç</span>\r\n }\r\n </div>\r\n }\r\n\r\n <ul\r\n #listbox\r\n class=\"hu-multi-select__list\"\r\n role=\"listbox\"\r\n aria-multiselectable=\"true\"\r\n [id]=\"listId\"\r\n [attr.tabindex]=\"filter() ? -1 : 0\"\r\n [attr.aria-label]=\"ariaLabel() || placeholder()\"\r\n [attr.aria-activedescendant]=\"!filter() && activeIndex() >= 0 ? optionId(activeIndex()) : null\"\r\n >\r\n @for (row of rows(); track $index) {\r\n @if (row.kind === 'group') {\r\n <li class=\"hu-multi-select__group\" role=\"presentation\">{{ row.label }}</li>\r\n } @else {\r\n @let o = row.option;\r\n @let selected = isSelected(o);\r\n @let blocked = !selected && limitReached();\r\n <li\r\n class=\"hu-multi-select__option\"\r\n role=\"option\"\r\n [id]=\"optionId(row.index)\"\r\n [attr.aria-selected]=\"selected\"\r\n [attr.aria-disabled]=\"o.disabled || blocked || null\"\r\n [class.hu-multi-select__option--active]=\"row.index === activeIndex()\"\r\n [class.hu-multi-select__option--disabled]=\"o.disabled || blocked\"\r\n (mousedown)=\"$event.preventDefault()\"\r\n (mousemove)=\"!o.disabled && activeIndex() !== row.index && activeIndex.set(row.index)\"\r\n (click)=\"toggleOption(o)\"\r\n >\r\n <span class=\"hu-multi-select__box\" [class.hu-multi-select__box--checked]=\"selected\" aria-hidden=\"true\">\r\n @if (selected) {\r\n <hu-icon name=\"check\" [size]=\"12\" />\r\n }\r\n </span>\r\n @if (o.icon) {\r\n <hu-icon class=\"hu-multi-select__option-icon\" [name]=\"o.icon\" [size]=\"16\" />\r\n }\r\n <span class=\"hu-multi-select__option-text\">\r\n <span>{{ o.label }}</span>\r\n @if (o.description) {\r\n <span class=\"hu-multi-select__option-desc\">{{ o.description }}</span>\r\n }\r\n </span>\r\n </li>\r\n }\r\n } @empty {\r\n <li class=\"hu-multi-select__empty\" role=\"presentation\">{{ emptyMessage() }}</li>\r\n }\r\n </ul>\r\n\r\n @if (selectionLimit() != null || values().length) {\r\n <div class=\"hu-multi-select__footer\" aria-live=\"polite\">\r\n {{ values().length }}{{ selectionLimit() != null ? ' / ' + selectionLimit() : '' }} seçildi\r\n @if (limitReached()) {\r\n · sınıra ulaşıldı\r\n }\r\n </div>\r\n }\r\n }\r\n</div>\r\n",
7673
- styles: [".hu-multi-select{position:relative;display:block;width:100%;min-width:0}.hu-multi-select__trigger{display:flex;align-items:center;gap:var(--hu-space-1);min-height:var(--hu-control-md);padding:3px var(--hu-space-2) 3px var(--hu-space-3);font-size:var(--hu-text-sm);color:var(--hu-text);background:var(--hu-surface);border:1px solid var(--hu-border-strong);border-radius:var(--hu-radius-md);box-shadow:var(--hu-shadow-sm);cursor:pointer;transition:border-color var(--hu-transition),box-shadow var(--hu-transition)}.hu-multi-select__trigger:hover:not([aria-disabled=true]):not(:focus){border-color:var(--hu-gray-400)}.hu-multi-select__trigger:focus,.hu-multi-select--open .hu-multi-select__trigger{outline:none;border-color:var(--hu-primary);box-shadow:var(--hu-ring);transition:none}.hu-multi-select__trigger--invalid,.hu-multi-select__trigger--invalid:hover:not(:focus){border-color:var(--hu-danger)}.hu-multi-select__trigger--invalid:focus{box-shadow:var(--hu-ring-danger)}.hu-multi-select--disabled .hu-multi-select__trigger{color:var(--hu-text-subtle);background:var(--hu-surface-3);box-shadow:none;cursor:not-allowed}[data-size=sm] .hu-multi-select__trigger{min-height:var(--hu-control-sm);padding-left:var(--hu-space-2);font-size:.8125rem}[data-size=lg] .hu-multi-select__trigger{min-height:var(--hu-control-lg);padding-left:var(--hu-space-4);font-size:var(--hu-text-md)}.hu-multi-select__values{display:flex;flex:1;flex-wrap:wrap;align-items:center;gap:4px;min-width:0}.hu-multi-select__placeholder{color:var(--hu-text-subtle)}.hu-multi-select__text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.hu-multi-select__chip{display:inline-flex;align-items:center;gap:2px;max-width:100%;height:1.5rem;padding:0 2px 0 var(--hu-space-2);overflow:hidden;font-size:var(--hu-text-xs);font-weight:500;color:var(--hu-primary-soft-fg);white-space:nowrap;text-overflow:ellipsis;background:var(--hu-primary-soft);border-radius:var(--hu-radius-sm)}.hu-multi-select__chip-remove,.hu-multi-select__icon-btn{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;padding:0;color:inherit;background:none;border:0;border-radius:var(--hu-radius-sm);cursor:pointer;opacity:.7}.hu-multi-select__chip-remove:hover:not(:disabled),.hu-multi-select__icon-btn:hover:not(:disabled){opacity:1;background:#00000014}.hu-multi-select__chip-remove{width:1.125rem;height:1.125rem}.hu-multi-select__icon-btn{width:1.5rem;height:1.5rem;color:var(--hu-text-subtle)}.hu-multi-select__caret{flex-shrink:0;color:var(--hu-text-subtle);transition:transform var(--hu-transition)}.hu-multi-select--open .hu-multi-select__caret{transform:rotate(180deg)}.hu-multi-select__panel{position:fixed;inset:auto;flex-direction:column;min-width:14rem;max-width:calc(100vw - 1rem);margin:0;padding:0;overflow:hidden;color:var(--hu-text);background:var(--hu-surface);border:1px solid var(--hu-border);border-radius:var(--hu-radius-lg);box-shadow:var(--hu-shadow-lg)}.hu-multi-select__panel:popover-open{display:flex;animation:hu-multi-select-in .12s ease-out}.hu-multi-select__panel--inline{position:absolute;top:calc(100% + 4px);left:0;z-index:1000;display:flex;width:100%}.hu-multi-select__panel--inline[hidden]{display:none}.hu-multi-select__header{display:flex;align-items:center;gap:var(--hu-space-2);padding:var(--hu-space-2) var(--hu-space-3);border-bottom:1px solid var(--hu-border)}.hu-multi-select__all{display:inline-flex;padding:2px;background:none;border:0;border-radius:var(--hu-radius-sm);cursor:pointer}.hu-multi-select__all:disabled{opacity:.5;cursor:not-allowed}.hu-multi-select__all-label{font-size:var(--hu-text-sm);cursor:pointer}.hu-multi-select__search{position:relative;display:flex;flex:1;align-items:center;min-width:0}.hu-multi-select__search>hu-icon{position:absolute;left:var(--hu-space-2);color:var(--hu-text-subtle);pointer-events:none}.hu-multi-select__search>.hu-input{padding-left:1.75rem;box-shadow:none}.hu-multi-select__list{max-height:var(--hu-multi-select-max-height, 16rem);margin:0;padding:var(--hu-space-1);overflow-y:auto;list-style:none;outline:none}.hu-multi-select__group{padding:var(--hu-space-2) var(--hu-space-2) var(--hu-space-1);font-size:var(--hu-text-xs);font-weight:600;color:var(--hu-text-subtle)}.hu-multi-select__option{display:flex;align-items:flex-start;gap:var(--hu-space-2);padding:var(--hu-space-2);font-size:var(--hu-text-sm);line-height:1.35;border-radius:var(--hu-radius-sm);cursor:pointer;-webkit-user-select:none;user-select:none}.hu-multi-select__option--active{background:var(--hu-surface-3)}.hu-multi-select__option[aria-selected=true]{font-weight:500}.hu-multi-select__option--disabled{opacity:.5;cursor:not-allowed}.hu-multi-select__option-icon{color:var(--hu-text-subtle)}.hu-multi-select__option-text{display:flex;flex-direction:column;min-width:0}.hu-multi-select__option-desc{font-size:var(--hu-text-xs);font-weight:400;color:var(--hu-text-subtle)}.hu-multi-select__box{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;width:1rem;height:1rem;margin-top:1px;color:var(--hu-primary-fg);background:var(--hu-surface);border:1.5px solid var(--hu-border-strong);border-radius:4px;transition:background-color var(--hu-transition),border-color var(--hu-transition)}.hu-multi-select__box--checked,.hu-multi-select__box--partial{background:var(--hu-primary);border-color:var(--hu-primary)}.hu-multi-select__empty{padding:var(--hu-space-4) var(--hu-space-2);font-size:var(--hu-text-sm);color:var(--hu-text-subtle);text-align:center}.hu-multi-select__footer{padding:var(--hu-space-2) var(--hu-space-3);font-size:var(--hu-text-xs);color:var(--hu-text-muted);border-top:1px solid var(--hu-border)}@keyframes hu-multi-select-in{0%{opacity:0;transform:translateY(-4px)}}\n"]
8937
+ template: "<div\n #trigger\n class=\"hu-select__trigger\"\n role=\"combobox\"\n aria-haspopup=\"listbox\"\n [id]=\"id()\"\n [attr.tabindex]=\"isDisabled() ? -1 : 0\"\n [attr.aria-expanded]=\"open()\"\n [attr.aria-controls]=\"listId\"\n [attr.aria-disabled]=\"isDisabled() || null\"\n [attr.aria-invalid]=\"isInvalid() || null\"\n [attr.aria-describedby]=\"field?.describedBy() ?? null\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [class.hu-select__trigger--invalid]=\"isInvalid()\"\n (click)=\"toggle()\"\n (keydown)=\"onTriggerKeydown($event)\"\n>\n @if (selectedOption(); as s) {\n @if (s.icon) {\n <hu-icon class=\"hu-select__value-icon\" [name]=\"s.icon\" [size]=\"16\" />\n }\n <span class=\"hu-select__value\">{{ s.label }}</span>\n } @else {\n <span class=\"hu-select__placeholder\">{{ placeholder() }}</span>\n }\n @if (showClear() && selectedOption() && !isDisabled()) {\n <button type=\"button\" class=\"hu-select__clear\" tabindex=\"-1\" aria-label=\"Seçimi temizle\" (click)=\"clear($event)\">\n <hu-icon name=\"x\" [size]=\"14\" />\n </button>\n }\n <hu-icon class=\"hu-select__caret\" name=\"chevron-down\" [size]=\"16\" />\n</div>\n\n<div\n #panel\n popover=\"manual\"\n class=\"hu-select__panel\"\n [class.hu-select__panel--inline]=\"!supportsPopover\"\n [attr.hidden]=\"!supportsPopover && !open() ? '' : null\"\n (keydown)=\"onPanelKeydown($event)\"\n>\n @if (open()) {\n @if (showFilter()) {\n <div class=\"hu-select__search\">\n <hu-icon name=\"search\" [size]=\"15\" />\n <input\n #search\n type=\"text\"\n role=\"searchbox\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n [attr.aria-label]=\"filterPlaceholder()\"\n [attr.aria-controls]=\"listId\"\n [attr.aria-activedescendant]=\"activeIndex() >= 0 ? optionId(activeIndex()) : null\"\n [placeholder]=\"filterPlaceholder()\"\n [value]=\"query()\"\n (input)=\"onQuery($any($event.target).value)\"\n />\n </div>\n }\n\n <ul\n #listbox\n class=\"hu-select__list\"\n role=\"listbox\"\n [id]=\"listId\"\n [attr.tabindex]=\"showFilter() ? -1 : 0\"\n [attr.aria-label]=\"ariaLabel() || placeholder()\"\n [attr.aria-activedescendant]=\"!showFilter() && activeIndex() >= 0 ? optionId(activeIndex()) : null\"\n >\n @for (row of rows(); track $index) {\n @if (row.kind === 'group') {\n <li class=\"hu-select__group\" role=\"presentation\">{{ row.label }}</li>\n } @else {\n @let o = row.option;\n @let selected = isSelected(o);\n <li\n class=\"hu-select__option\"\n role=\"option\"\n [id]=\"optionId(row.index)\"\n [attr.aria-selected]=\"selected\"\n [attr.aria-disabled]=\"o.disabled || null\"\n [class.hu-select__option--active]=\"row.index === activeIndex()\"\n [class.hu-select__option--selected]=\"selected\"\n [class.hu-select__option--disabled]=\"o.disabled\"\n (mousedown)=\"$event.preventDefault()\"\n (mousemove)=\"onOptionHover(row.index, o)\"\n (click)=\"choose(o)\"\n >\n @if (o.icon) {\n <hu-icon class=\"hu-select__option-icon\" [name]=\"o.icon\" [size]=\"16\" />\n }\n <span class=\"hu-select__option-text\">\n <span class=\"hu-select__option-label\">{{ o.label }}</span>\n @if (o.description) {\n <span class=\"hu-select__option-desc\">{{ o.description }}</span>\n }\n </span>\n @if (selected) {\n <hu-icon class=\"hu-select__check\" name=\"check\" [size]=\"16\" />\n }\n </li>\n }\n } @empty {\n <li class=\"hu-select__empty\" role=\"presentation\">\n <hu-icon name=\"search\" [size]=\"18\" />\n {{ emptyMessage() }}\n </li>\n }\n </ul>\n }\n</div>\n",
8938
+ styles: [".hu-select{position:relative;display:block;width:100%;min-width:0}.hu-select__trigger{display:flex;align-items:center;gap:var(--hu-space-2);height:var(--hu-control-md);padding:0 var(--hu-space-2) 0 var(--hu-space-3);font-size:var(--hu-text-sm);color:var(--hu-text);background:var(--hu-surface);border:1px solid var(--hu-border-strong);border-radius:var(--hu-radius-md);box-shadow:var(--hu-shadow-sm);cursor:pointer;-webkit-user-select:none;user-select:none;transition:border-color var(--hu-transition),box-shadow var(--hu-transition)}.hu-select__trigger:hover:not([aria-disabled=true]):not(:focus){border-color:var(--hu-gray-400)}.hu-select__trigger:focus,.hu-select--open .hu-select__trigger{outline:none;border-color:var(--hu-primary);box-shadow:var(--hu-ring);transition:none}.hu-select__trigger--invalid,.hu-select__trigger--invalid:hover:not(:focus){border-color:var(--hu-danger)}.hu-select__trigger--invalid:focus{box-shadow:var(--hu-ring-danger)}.hu-select--disabled .hu-select__trigger{color:var(--hu-text-subtle);background:var(--hu-surface-3);box-shadow:none;cursor:not-allowed}[data-size=sm] .hu-select__trigger{height:var(--hu-control-sm);padding-left:var(--hu-space-2);font-size:.8125rem}[data-size=lg] .hu-select__trigger{height:var(--hu-control-lg);padding-left:var(--hu-space-4);font-size:var(--hu-text-md)}.hu-select__value,.hu-select__placeholder{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.hu-select__placeholder{color:var(--hu-text-subtle)}.hu-select__value-icon{flex-shrink:0;color:var(--hu-text-muted)}.hu-select__clear{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;padding:0;color:var(--hu-text-subtle);background:none;border:0;border-radius:var(--hu-radius-sm);cursor:pointer}.hu-select__clear:hover{color:var(--hu-text);background:var(--hu-surface-3)}.hu-select__caret{flex-shrink:0;color:var(--hu-text-subtle);transition:transform var(--hu-transition)}.hu-select--open .hu-select__caret{color:var(--hu-primary);transform:rotate(180deg)}.hu-select__panel{--_panel-bg: var(--hu-select-panel-bg, var(--hu-surface));position:fixed;inset:auto;flex-direction:column;min-width:12rem;max-width:min(32rem,100vw - 1rem);margin:0;padding:0;overflow:hidden;color:var(--hu-text);background:var(--_panel-bg);border:1px solid var(--hu-border);border-radius:var(--hu-radius-lg);box-shadow:var(--hu-shadow-lg)}:root[data-theme=dark] .hu-select__panel{--_panel-bg: var(--hu-select-panel-bg, var(--hu-surface-2));border-color:var(--hu-border-strong)}.hu-select__panel:popover-open{display:flex;animation:hu-select-in .14s cubic-bezier(.2,.9,.3,1)}.hu-select__panel--inline{position:absolute;top:calc(100% + 6px);left:0;z-index:1000;display:flex;width:100%}.hu-select__panel--inline[hidden]{display:none}.hu-select__search{display:flex;flex-shrink:0;align-items:center;gap:var(--hu-space-2);margin:var(--hu-space-2) var(--hu-space-2) 0;padding:0 var(--hu-space-3);height:2.25rem;color:var(--hu-text-subtle);background:var(--hu-surface-2);border:1px solid transparent;border-radius:var(--hu-radius-md);transition:border-color var(--hu-transition),background-color var(--hu-transition)}:root[data-theme=dark] .hu-select__search{background:var(--hu-surface-3)}.hu-select__search:focus-within{color:var(--hu-primary);background:var(--_panel-bg);border-color:color-mix(in srgb,var(--hu-primary) 45%,transparent)}.hu-select__search>hu-icon{flex-shrink:0}.hu-select__search>input{flex:1;min-width:0;height:100%;padding:0;font:inherit;font-size:var(--hu-text-sm);color:var(--hu-text);background:none;border:0;outline:none}.hu-select__search>input::placeholder{color:var(--hu-text-subtle)}.hu-select__list{max-height:var(--hu-select-max-height, 17rem);margin:0;padding:var(--hu-space-1-5, 6px);overflow-y:auto;list-style:none;outline:none;scrollbar-width:thin}.hu-select__group{padding:var(--hu-space-3) var(--hu-space-2) var(--hu-space-1);font-size:.6875rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--hu-text-subtle)}.hu-select__group:first-child{padding-top:var(--hu-space-1)}.hu-select__option{position:relative;display:flex;align-items:center;gap:var(--hu-space-2);min-height:2.25rem;padding:var(--hu-space-2) var(--hu-space-2) var(--hu-space-2) var(--hu-space-3);font-size:var(--hu-text-sm);line-height:1.35;border-radius:var(--hu-radius-md);cursor:pointer;-webkit-user-select:none;user-select:none}.hu-select__option--active{background:var(--hu-surface-3)}.hu-select__option--selected{font-weight:500;color:var(--hu-primary-soft-fg);background:var(--hu-primary-soft)}.hu-select__option--selected .hu-select__option-icon{color:var(--hu-primary)}.hu-select__option--selected.hu-select__option--active{background:var(--hu-primary-soft-hover)}.hu-select__option--disabled{opacity:.45;cursor:not-allowed}.hu-select__option-icon{flex-shrink:0;color:var(--hu-text-subtle)}.hu-select__option-text{display:flex;flex:1;flex-direction:column;min-width:0}.hu-select__option-desc{font-size:var(--hu-text-xs);font-weight:400;color:var(--hu-text-subtle)}.hu-select__check{flex-shrink:0;color:var(--hu-primary)}.hu-select__empty{display:flex;flex-direction:column;align-items:center;gap:var(--hu-space-2);padding:var(--hu-space-5) var(--hu-space-2);font-size:var(--hu-text-sm);color:var(--hu-text-subtle);text-align:center}@keyframes hu-select-in{0%{opacity:0;transform:translateY(-6px) scale(.98)}}\n"]
7674
8939
  }]
7675
8940
  }],
7676
8941
  ctorParameters: () => [],
@@ -7710,19 +8975,19 @@ i0.ɵɵngDeclareClassMetadata({
7710
8975
  required: false
7711
8976
  }]
7712
8977
  }],
7713
- filterPlaceholder: [{
8978
+ filterThreshold: [{
7714
8979
  type: i0.Input,
7715
8980
  args: [{
7716
8981
  isSignal: true,
7717
- alias: "filterPlaceholder",
8982
+ alias: "filterThreshold",
7718
8983
  required: false
7719
8984
  }]
7720
8985
  }],
7721
- showSelectAll: [{
8986
+ filterPlaceholder: [{
7722
8987
  type: i0.Input,
7723
8988
  args: [{
7724
8989
  isSignal: true,
7725
- alias: "showSelectAll",
8990
+ alias: "filterPlaceholder",
7726
8991
  required: false
7727
8992
  }]
7728
8993
  }],
@@ -7734,30 +8999,6 @@ i0.ɵɵngDeclareClassMetadata({
7734
8999
  required: false
7735
9000
  }]
7736
9001
  }],
7737
- display: [{
7738
- type: i0.Input,
7739
- args: [{
7740
- isSignal: true,
7741
- alias: "display",
7742
- required: false
7743
- }]
7744
- }],
7745
- maxSelectedLabels: [{
7746
- type: i0.Input,
7747
- args: [{
7748
- isSignal: true,
7749
- alias: "maxSelectedLabels",
7750
- required: false
7751
- }]
7752
- }],
7753
- selectionLimit: [{
7754
- type: i0.Input,
7755
- args: [{
7756
- isSignal: true,
7757
- alias: "selectionLimit",
7758
- required: false
7759
- }]
7760
- }],
7761
9002
  emptyMessage: [{
7762
9003
  type: i0.Input,
7763
9004
  args: [{
@@ -7806,6 +9047,10 @@ i0.ɵɵngDeclareClassMetadata({
7806
9047
  required: false
7807
9048
  }]
7808
9049
  }],
9050
+ selectionChange: [{
9051
+ type: i0.Output,
9052
+ args: ["selectionChange"]
9053
+ }],
7809
9054
  closed: [{
7810
9055
  type: i0.Output,
7811
9056
  args: ["closed"]
@@ -20965,6 +22210,6 @@ const HU_TREE_IMPORTS = [HuTree, HuTreeNodeDef];
20965
22210
  const HU_PICKLIST_IMPORTS = [HuPickList, HuPickListItem];
20966
22211
  const HU_ORG_CHART_IMPORTS = [HuOrgChart, HuOrgChartNodeDef];
20967
22212
  const HU_CAROUSEL_IMPORTS = [HuCarousel, HuCarouselItem];
20968
- export { HU_ACCORDION_IMPORTS, HU_AGENDA_DEFAULT_CATEGORIES, HU_BUILTIN_ICONS, HU_CARD_IMPORTS, HU_CAROUSEL_IMPORTS, HU_DEFAULT_ERROR_MESSAGES, HU_DIALOG_IMPORTS, HU_DROPDOWN_IMPORTS, HU_EDITOR_BLOCKS, HU_EDITOR_BUTTONS, HU_EDITOR_DEFAULT_TOOLBAR, HU_EDITOR_HIGHLIGHT_COLORS, HU_EDITOR_MINIMAL_TOOLBAR, HU_EDITOR_TEXT_COLORS, HU_ERROR_MESSAGES, HU_FORM_FIELD, HU_FORM_FIELD_IMPORTS, HU_ICON_SETS, HU_MASKS, HU_ORG_CHART_IMPORTS, HU_PASSWORD_RULES, HU_PICKLIST_IMPORTS, HU_RADIO_IMPORTS, HU_SHELL_IMPORTS, HU_STATUS_ICONS, HU_STEPPER_IMPORTS, HU_TABLE_IMPORTS, HU_TABS_IMPORTS, HU_TIMELINE_IMPORTS, HU_TREE_IMPORTS, HuAccordion, HuAccordionPanel, HuAgenda, HuAgendaEditor, HuAlert, HuAvatar, HuBadge, HuBreadcrumb, HuButton, HuButtonGroup, HuCalendar, HuCard, HuCardActions, HuCardFooter, HuCardMedia, HuCarousel, HuCarouselItem, HuCellDef, HuCheckbox, HuConfirm, HuConfirmPopup, HuConfirmPopupService, HuContextMenu, HuContextMenuPanel, HuContextMenuService, HuDatePicker, HuDialog, HuDialogFooter, HuDivider, HuDropdown, HuDropdownHeaderSlot, HuDropdownTrigger, HuEditor, HuFieldset, HuFileUpload, HuFormField, HuFormFieldControl, HuGallery, HuIcon, HuImage, HuInput, HuInputMask, HuInputNumber, HuLightbox, HuMultiSelect, HuOrgChart, HuOrgChartNodeDef, HuPaginator, HuPassword, HuPickList, HuPickListItem, HuPrefix, HuRadio, HuRadioGroup, HuRating, HuRowDetail, HuShell, HuShellLogo, HuSidebarFooter, HuSidebarNav, HuSpinner, HuStep, HuStepper, HuStepperNext, HuStepperPrevious, HuSuffix, HuSwitch, HuTab, HuTable, HuTableBulkActions, HuTableToolbar, HuTabs, HuThemeService, HuThemeToggle, HuTimeline, HuTimelineContent, HuTimelineMarker, HuTimelineOpposite, HuToastService, HuToaster, HuTooltip, HuTopbarEnd, HuTopbarStart, HuTree, HuTreeNodeDef, HuTreeSelect, addDays, addMonths, clampDate, compareDays, daysInMonth, formatDate, formatFileSize, formatRange, huFold, huIsSafeImageSrc, huIsSafeUrl, huMediaQuery, huPasswordStrength, huSanitizeHtml, huUniqueId, isDropdownDivider, isDropdownHeader, isSameDay, isSameMonth, isValidDate, parseDate, parseRange, provideHuErrorMessages, provideHuIcons, startOfDay, startOfWeek };
22213
+ export { HU_ACCORDION_IMPORTS, HU_AGENDA_DEFAULT_CATEGORIES, HU_BUILTIN_ICONS, HU_CARD_IMPORTS, HU_CAROUSEL_IMPORTS, HU_DEFAULT_ERROR_MESSAGES, HU_DIALOG_IMPORTS, HU_DROPDOWN_IMPORTS, HU_EDITOR_BLOCKS, HU_EDITOR_BUTTONS, HU_EDITOR_DEFAULT_TOOLBAR, HU_EDITOR_HIGHLIGHT_COLORS, HU_EDITOR_MINIMAL_TOOLBAR, HU_EDITOR_TEXT_COLORS, HU_ERROR_MESSAGES, HU_FORM_FIELD, HU_FORM_FIELD_IMPORTS, HU_ICON_SETS, HU_MASKS, HU_ORG_CHART_IMPORTS, HU_PASSWORD_RULES, HU_PICKLIST_IMPORTS, HU_RADIO_IMPORTS, HU_SHELL_IMPORTS, HU_STATUS_ICONS, HU_STEPPER_IMPORTS, HU_TABLE_IMPORTS, HU_TABS_IMPORTS, HU_TIMELINE_IMPORTS, HU_TREE_IMPORTS, HuAccordion, HuAccordionPanel, HuAgenda, HuAgendaEditor, HuAlert, HuAvatar, HuBadge, HuBreadcrumb, HuButton, HuButtonGroup, HuCalendar, HuCard, HuCardActions, HuCardFooter, HuCardMedia, HuCarousel, HuCarouselItem, HuCellDef, HuCheckbox, HuConfirm, HuConfirmPopup, HuConfirmPopupService, HuContextMenu, HuContextMenuPanel, HuContextMenuService, HuDatePicker, HuDialog, HuDialogFooter, HuDivider, HuDropdown, HuDropdownHeaderSlot, HuDropdownTrigger, HuEditor, HuFieldset, HuFileInput, HuFileUpload, HuFormField, HuFormFieldControl, HuGallery, HuIcon, HuImage, HuInput, HuInputMask, HuInputNumber, HuLightbox, HuMultiSelect, HuOrgChart, HuOrgChartNodeDef, HuPaginator, HuPassword, HuPickList, HuPickListItem, HuPrefix, HuRadio, HuRadioGroup, HuRating, HuRowDetail, HuSelect, HuShell, HuShellLogo, HuSidebarFooter, HuSidebarNav, HuSpinner, HuStep, HuStepper, HuStepperNext, HuStepperPrevious, HuSuffix, HuSwitch, HuTab, HuTable, HuTableBulkActions, HuTableToolbar, HuTabs, HuThemeService, HuThemeToggle, HuTimeline, HuTimelineContent, HuTimelineMarker, HuTimelineOpposite, HuToastService, HuToaster, HuTooltip, HuTopbarEnd, HuTopbarStart, HuTree, HuTreeNodeDef, HuTreeSelect, addDays, addMonths, clampDate, compareDays, daysInMonth, formatDate, formatFileSize, formatRange, huFold, huIsSafeImageSrc, huIsSafeUrl, huMediaQuery, huPasswordStrength, huSanitizeHtml, huUniqueId, isDropdownDivider, isDropdownHeader, isSameDay, isSameMonth, isValidDate, parseDate, parseRange, provideHuErrorMessages, provideHuIcons, startOfDay, startOfWeek };
20969
22214
 
20970
22215
  //# sourceMappingURL=ucme-ui-angular.mjs.map