@ucme-ui/angular 0.9.0 → 0.10.1

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.
@@ -3008,7 +3008,7 @@ var HuDialog = class HuDialog {
3008
3008
  </dialog>
3009
3009
  `,
3010
3010
  isInline: true,
3011
- styles: [".hu-dialog-host{display:contents}html:has(.hu-dialog[open]){overflow:hidden}.hu-dialog{width:calc(100vw - 2rem);max-width:32rem;max-height:calc(100dvh - 4rem);padding:0;color:var(--hu-text);background:var(--hu-surface);border:1px solid var(--hu-border);border-radius:var(--hu-radius-xl);box-shadow:var(--hu-shadow-lg)}.hu-dialog[data-size=sm]{max-width:24rem}.hu-dialog[data-size=lg]{max-width:44rem}.hu-dialog[data-size=xl]{max-width:60rem}.hu-dialog::backdrop{background:#0c0c0e80;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px)}.hu-dialog[open]{animation:hu-dialog-in .18s cubic-bezier(.2,.9,.3,1)}.hu-dialog[open]::backdrop{animation:hu-fade-in .18s ease-out}.hu-dialog__panel{display:flex;flex-direction:column;max-height:inherit}.hu-dialog__header{display:flex;align-items:flex-start;justify-content:space-between;gap:var(--hu-space-4);padding:var(--hu-space-5) var(--hu-space-6) var(--hu-space-3)}.hu-dialog__title{font-size:var(--hu-text-lg)}.hu-dialog__description{margin-top:var(--hu-space-1);color:var(--hu-text-muted)}.hu-dialog__close{display:inline-flex;margin:-4px -8px 0 0;padding:6px;color:var(--hu-text-subtle);background:none;border:0;border-radius:var(--hu-radius-md);cursor:pointer}.hu-dialog__close:hover{color:var(--hu-text);background:var(--hu-surface-3)}.hu-dialog__body{flex:1;padding:var(--hu-space-2) var(--hu-space-6) var(--hu-space-5);overflow-y:auto}.hu-dialog__footer{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:var(--hu-space-2);padding:var(--hu-space-4) var(--hu-space-6);background:var(--hu-surface-2);border-top:1px solid var(--hu-border);border-radius:0 0 var(--hu-radius-xl) var(--hu-radius-xl)}@keyframes hu-dialog-in{0%{opacity:0;transform:translateY(8px) scale(.98)}}@keyframes hu-fade-in{0%{opacity:0}}\n"],
3011
+ styles: [".hu-dialog-host{display:contents}html:has(.hu-dialog[open]){overflow:hidden}.hu-dialog{width:calc(100vw - 2rem);max-width:32rem;max-height:calc(100dvh - 4rem);padding:0;color:var(--hu-text);background:var(--hu-surface);border:1px solid var(--hu-border);border-radius:var(--hu-radius-xl);box-shadow:var(--hu-shadow-lg)}.hu-dialog[data-size=sm]{max-width:24rem}.hu-dialog[data-size=lg]{max-width:44rem}.hu-dialog[data-size=xl]{max-width:60rem}.hu-dialog::backdrop{background:#0c0c0e80;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px)}.hu-dialog[open]{display:flex;flex-direction:column;overflow:hidden;animation:hu-dialog-in .18s cubic-bezier(.2,.9,.3,1)}.hu-dialog[open]::backdrop{animation:hu-fade-in .18s ease-out}.hu-dialog__panel{display:flex;flex:1 1 auto;flex-direction:column;min-height:0}.hu-dialog__header{display:flex;align-items:flex-start;justify-content:space-between;gap:var(--hu-space-4);flex-shrink:0;padding:var(--hu-space-5) var(--hu-space-6) var(--hu-space-3)}.hu-dialog__title{font-size:var(--hu-text-lg)}.hu-dialog__description{margin-top:var(--hu-space-1);color:var(--hu-text-muted)}.hu-dialog__close{display:inline-flex;margin:-4px -8px 0 0;padding:6px;color:var(--hu-text-subtle);background:none;border:0;border-radius:var(--hu-radius-md);cursor:pointer}.hu-dialog__close:hover{color:var(--hu-text);background:var(--hu-surface-3)}.hu-dialog__body{flex:1 1 auto;min-height:0;padding:var(--hu-space-2) var(--hu-space-6) var(--hu-space-5);overflow-y:auto;overscroll-behavior:contain;overflow-wrap:break-word}.hu-dialog__footer{display:flex;flex-shrink:0;flex-wrap:wrap;justify-content:flex-end;gap:var(--hu-space-2);padding:var(--hu-space-4) var(--hu-space-6);background:var(--hu-surface-2);border-top:1px solid var(--hu-border);border-radius:0 0 var(--hu-radius-xl) var(--hu-radius-xl)}@keyframes hu-dialog-in{0%{opacity:0;transform:translateY(8px) scale(.98)}}@keyframes hu-fade-in{0%{opacity:0}}\n"],
3012
3012
  dependencies: [{
3013
3013
  kind: "component",
3014
3014
  type: HuIcon,
@@ -3065,7 +3065,7 @@ i0.ɵɵngDeclareClassMetadata({
3065
3065
  host: { class: "hu-dialog-host" },
3066
3066
  encapsulation: ViewEncapsulation.None,
3067
3067
  changeDetection: ChangeDetectionStrategy.OnPush,
3068
- styles: [".hu-dialog-host{display:contents}html:has(.hu-dialog[open]){overflow:hidden}.hu-dialog{width:calc(100vw - 2rem);max-width:32rem;max-height:calc(100dvh - 4rem);padding:0;color:var(--hu-text);background:var(--hu-surface);border:1px solid var(--hu-border);border-radius:var(--hu-radius-xl);box-shadow:var(--hu-shadow-lg)}.hu-dialog[data-size=sm]{max-width:24rem}.hu-dialog[data-size=lg]{max-width:44rem}.hu-dialog[data-size=xl]{max-width:60rem}.hu-dialog::backdrop{background:#0c0c0e80;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px)}.hu-dialog[open]{animation:hu-dialog-in .18s cubic-bezier(.2,.9,.3,1)}.hu-dialog[open]::backdrop{animation:hu-fade-in .18s ease-out}.hu-dialog__panel{display:flex;flex-direction:column;max-height:inherit}.hu-dialog__header{display:flex;align-items:flex-start;justify-content:space-between;gap:var(--hu-space-4);padding:var(--hu-space-5) var(--hu-space-6) var(--hu-space-3)}.hu-dialog__title{font-size:var(--hu-text-lg)}.hu-dialog__description{margin-top:var(--hu-space-1);color:var(--hu-text-muted)}.hu-dialog__close{display:inline-flex;margin:-4px -8px 0 0;padding:6px;color:var(--hu-text-subtle);background:none;border:0;border-radius:var(--hu-radius-md);cursor:pointer}.hu-dialog__close:hover{color:var(--hu-text);background:var(--hu-surface-3)}.hu-dialog__body{flex:1;padding:var(--hu-space-2) var(--hu-space-6) var(--hu-space-5);overflow-y:auto}.hu-dialog__footer{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:var(--hu-space-2);padding:var(--hu-space-4) var(--hu-space-6);background:var(--hu-surface-2);border-top:1px solid var(--hu-border);border-radius:0 0 var(--hu-radius-xl) var(--hu-radius-xl)}@keyframes hu-dialog-in{0%{opacity:0;transform:translateY(8px) scale(.98)}}@keyframes hu-fade-in{0%{opacity:0}}\n"]
3068
+ styles: [".hu-dialog-host{display:contents}html:has(.hu-dialog[open]){overflow:hidden}.hu-dialog{width:calc(100vw - 2rem);max-width:32rem;max-height:calc(100dvh - 4rem);padding:0;color:var(--hu-text);background:var(--hu-surface);border:1px solid var(--hu-border);border-radius:var(--hu-radius-xl);box-shadow:var(--hu-shadow-lg)}.hu-dialog[data-size=sm]{max-width:24rem}.hu-dialog[data-size=lg]{max-width:44rem}.hu-dialog[data-size=xl]{max-width:60rem}.hu-dialog::backdrop{background:#0c0c0e80;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px)}.hu-dialog[open]{display:flex;flex-direction:column;overflow:hidden;animation:hu-dialog-in .18s cubic-bezier(.2,.9,.3,1)}.hu-dialog[open]::backdrop{animation:hu-fade-in .18s ease-out}.hu-dialog__panel{display:flex;flex:1 1 auto;flex-direction:column;min-height:0}.hu-dialog__header{display:flex;align-items:flex-start;justify-content:space-between;gap:var(--hu-space-4);flex-shrink:0;padding:var(--hu-space-5) var(--hu-space-6) var(--hu-space-3)}.hu-dialog__title{font-size:var(--hu-text-lg)}.hu-dialog__description{margin-top:var(--hu-space-1);color:var(--hu-text-muted)}.hu-dialog__close{display:inline-flex;margin:-4px -8px 0 0;padding:6px;color:var(--hu-text-subtle);background:none;border:0;border-radius:var(--hu-radius-md);cursor:pointer}.hu-dialog__close:hover{color:var(--hu-text);background:var(--hu-surface-3)}.hu-dialog__body{flex:1 1 auto;min-height:0;padding:var(--hu-space-2) var(--hu-space-6) var(--hu-space-5);overflow-y:auto;overscroll-behavior:contain;overflow-wrap:break-word}.hu-dialog__footer{display:flex;flex-shrink:0;flex-wrap:wrap;justify-content:flex-end;gap:var(--hu-space-2);padding:var(--hu-space-4) var(--hu-space-6);background:var(--hu-surface-2);border-top:1px solid var(--hu-border);border-radius:0 0 var(--hu-radius-xl) var(--hu-radius-xl)}@keyframes hu-dialog-in{0%{opacity:0;transform:translateY(8px) scale(.98)}}@keyframes hu-fade-in{0%{opacity:0}}\n"]
3069
3069
  }]
3070
3070
  }],
3071
3071
  ctorParameters: () => [],
@@ -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,19 +6436,599 @@ 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;
6439
+ var HuFileInput = class HuFileInput {
6440
+ injector = inject(Injector);
6441
+ field = inject(HU_FORM_FIELD, {
6442
+ optional: true,
6443
+ host: true
6428
6444
  });
6429
- }
6430
- function hasFiles(event) {
6431
- return !!event.dataTransfer?.types.includes("Files");
6445
+ value = model(null, ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
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
6450
+ });
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 */ {},
6458
+ transform: booleanAttribute
6459
+ });
6460
+ browseLabel = input("Dosya seç", ...ngDevMode ? [{ debugName: "browseLabel" }] : /* istanbul ignore next */ []);
6461
+ changeLabel = input("Değiştir", ...ngDevMode ? [{ debugName: "changeLabel" }] : /* istanbul ignore next */ []);
6462
+ disabled = input(false, {
6463
+ ...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
6464
+ transform: booleanAttribute
6465
+ });
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 */ []);
6475
+ formDisabled = signal(false, ...ngDevMode ? [{ debugName: "formDisabled" }] : /* istanbul ignore next */ []);
6476
+ isDisabled = computed(() => this.disabled() || this.formDisabled(), ...ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []);
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;
6484
+ return {
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
6490
+ };
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 = () => {};
6519
+ ngControl;
6520
+ get hasControl() {
6521
+ return !!this.resolveControl();
6522
+ }
6523
+ controlErrorVisible = signal(false, ...ngDevMode ? [{ debugName: "controlErrorVisible" }] : /* istanbul ignore next */ []);
6524
+ errors = signal(null, ...ngDevMode ? [{ debugName: "errors" }] : /* istanbul ignore next */ []);
6525
+ isInvalid = computed(() => this.controlErrorVisible() || (this.field?.showError() ?? false) || !!this.message() || this.status() === "error", ...ngDevMode ? [{ debugName: "isInvalid" }] : /* istanbul ignore next */ []);
6526
+ ngDoCheck() {
6527
+ const c = this.resolveControl();
6528
+ if (!c) return;
6529
+ this.controlErrorVisible.set(!!c.invalid && !!(c.touched || c.dirty));
6530
+ this.errors.set(c.errors);
6531
+ }
6532
+ browse() {
6533
+ if (!this.isDisabled()) this.input().nativeElement.click();
6534
+ }
6535
+ clear() {
6536
+ this.setValue(null);
6537
+ this.message.set(null);
6538
+ }
6539
+ onInputChange(event) {
6540
+ const input = event.target;
6541
+ const file = input.files?.[0];
6542
+ input.value = "";
6543
+ if (file) this.pick(file);
6544
+ }
6545
+ onDragEnter(event) {
6546
+ if (this.isDisabled() || !huDragHasFiles(event)) return;
6547
+ event.preventDefault();
6548
+ this.dragDepth++;
6549
+ this.dragging.set(true);
6550
+ }
6551
+ onDragOver(event) {
6552
+ if (this.isDisabled() || !huDragHasFiles(event)) return;
6553
+ event.preventDefault();
6554
+ if (event.dataTransfer) event.dataTransfer.dropEffect = "copy";
6555
+ }
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;
6562
+ event.preventDefault();
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);
6568
+ }
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();
6586
+ }
6587
+ writeValue(value) {
6588
+ this.value.set(isFileValue(value) ? value : null);
6589
+ this.resetStatus();
6590
+ this.message.set(null);
6591
+ }
6592
+ registerOnChange(fn) {
6593
+ this.onChange = fn;
6594
+ }
6595
+ registerOnTouched(fn) {
6596
+ this.onTouched = fn;
6597
+ }
6598
+ setDisabledState(disabled) {
6599
+ this.formDisabled.set(disabled);
6600
+ }
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);
6625
+ }
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
+ }
6651
+ }
6652
+ setValue(value) {
6653
+ this.resetStatus();
6654
+ this.value.set(value);
6655
+ this.onChange(value);
6656
+ }
6657
+ resetStatus() {
6658
+ this.uploading = null;
6659
+ this.status.set("idle");
6660
+ this.progress.set(0);
6661
+ }
6662
+ resolveControl() {
6663
+ if (this.ngControl === void 0) this.ngControl = this.injector.get(NgControl, null, {
6664
+ self: true,
6665
+ optional: true
6666
+ });
6667
+ return this.ngControl;
6668
+ }
6669
+ static ɵfac = i0.ɵɵngDeclareFactory({
6670
+ minVersion: "12.0.0",
6671
+ version: "22.2.0",
6672
+ ngImport: i0,
6673
+ type: HuFileInput,
6674
+ deps: [],
6675
+ target: i0.ɵɵFactoryTarget.Component
6676
+ });
6677
+ static ɵcmp = i0.ɵɵngDeclareComponent({
6678
+ minVersion: "17.0.0",
6679
+ version: "22.2.0",
6680
+ type: HuFileInput,
6681
+ isStandalone: true,
6682
+ selector: "hu-file-input",
6683
+ inputs: {
6684
+ value: {
6685
+ classPropertyName: "value",
6686
+ publicName: "value",
6687
+ isSignal: true,
6688
+ isRequired: false,
6689
+ transformFunction: null
6690
+ },
6691
+ label: {
6692
+ classPropertyName: "label",
6693
+ publicName: "label",
6694
+ isSignal: true,
6695
+ isRequired: false,
6696
+ transformFunction: null
6697
+ },
6698
+ required: {
6699
+ classPropertyName: "required",
6700
+ publicName: "required",
6701
+ isSignal: true,
6702
+ isRequired: false,
6703
+ transformFunction: null
6704
+ },
6705
+ hint: {
6706
+ classPropertyName: "hint",
6707
+ publicName: "hint",
6708
+ isSignal: true,
6709
+ isRequired: false,
6710
+ transformFunction: null
6711
+ },
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";
6432
7032
  }
6433
7033
  const optionalNumber = (v) => v == null || v === "" ? null : numberAttribute(v);
6434
7034
  var HuInputNumber = class HuInputNumber {
@@ -21610,6 +22210,6 @@ const HU_TREE_IMPORTS = [HuTree, HuTreeNodeDef];
21610
22210
  const HU_PICKLIST_IMPORTS = [HuPickList, HuPickListItem];
21611
22211
  const HU_ORG_CHART_IMPORTS = [HuOrgChart, HuOrgChartNodeDef];
21612
22212
  const HU_CAROUSEL_IMPORTS = [HuCarousel, HuCarouselItem];
21613
- 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, 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 };
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 };
21614
22214
 
21615
22215
  //# sourceMappingURL=ucme-ui-angular.mjs.map