@uni-design-system/uni-angular 3.0.1 → 4.0.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.
@@ -1,8 +1,8 @@
1
1
  import * as i0 from '@angular/core';
2
- import { signal, computed, linkedSignal, resource, Injectable, inject, DestroyRef, InjectionToken, input, Component, HostBinding, Input, Renderer2, ElementRef, HostListener, Directive, EventEmitter, effect, Output, output, ViewChild, ChangeDetectorRef, ChangeDetectionStrategy, model } from '@angular/core';
2
+ import { signal, computed, linkedSignal, resource, Injectable, inject, DestroyRef, InjectionToken, input, HostBinding, Component, Input, Renderer2, ElementRef, HostListener, Directive, model, effect, output, viewChild, afterNextRender, EventEmitter, Output, ViewChild, ChangeDetectorRef, ChangeDetectionStrategy } from '@angular/core';
3
3
  import { css, keyframes } from '@emotion/css';
4
- import { UniThemes, LightTheme, Z_INDEX, fadeIn, fadeOut } from '@uni-design-system/uni-core';
5
- import { NgClass, CommonModule, NgTemplateOutlet } from '@angular/common';
4
+ import { UniThemes, LightTheme, Z_INDEX, fadeIn, fadeOut, expandFadeIn, collapseFadeOut, removeInputPlatformStyling } from '@uni-design-system/uni-core';
5
+ import { NgClass, NgTemplateOutlet, CommonModule } from '@angular/common';
6
6
  import { autoUpdate, computePosition, offset, shift, flip, arrow } from '@floating-ui/dom';
7
7
 
8
8
  class UniBaseDatasource {
@@ -489,6 +489,13 @@ function useTimer() {
489
489
  };
490
490
  }
491
491
 
492
+ const acceptableFile = (file, acceptedFileExtensions) => {
493
+ if (!acceptedFileExtensions || acceptedFileExtensions.length < 1)
494
+ return true;
495
+ return acceptedFileExtensions.includes(getFileExtension(file));
496
+ };
497
+ const getFileExtension = (file) => '.' + file.name.split('.').pop();
498
+
492
499
  const UNI_THEMES = new InjectionToken('', {
493
500
  providedIn: 'root',
494
501
  factory: () => UniThemes,
@@ -569,7 +576,6 @@ class ThemeService {
569
576
  };
570
577
  typeface = (typeface) => {
571
578
  const typefaces = this.typeFaces();
572
- console.log('typefaces:', typefaces);
573
579
  return typeface && typefaces[typeface];
574
580
  };
575
581
  colorPalette = () => this.colors();
@@ -695,6 +701,48 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImpo
695
701
  }]
696
702
  }], ctorParameters: () => [] });
697
703
 
704
+ class UniBackgroundComponent {
705
+ theme = inject(ThemeService);
706
+ image = input(...(ngDevMode ? [undefined, { debugName: "image" }] : /* istanbul ignore next */ []));
707
+ imagePosition = input(...(ngDevMode ? [undefined, { debugName: "imagePosition" }] : /* istanbul ignore next */ []));
708
+ imageSize = input(...(ngDevMode ? [undefined, { debugName: "imageSize" }] : /* istanbul ignore next */ []));
709
+ height = input('100%', ...(ngDevMode ? [{ debugName: "height" }] : /* istanbul ignore next */ []));
710
+ width = input(...(ngDevMode ? [undefined, { debugName: "width" }] : /* istanbul ignore next */ []));
711
+ get className() {
712
+ return css([
713
+ {
714
+ backgroundRepeat: 'no-repeat',
715
+ display: 'block',
716
+ ...this.theme.backgroundImage(this.image()),
717
+ },
718
+ this.theme.style('backgroundPosition', this.imagePosition()),
719
+ this.theme.style('backgroundSize', this.imageSize()),
720
+ this.theme.style('height', this.height()),
721
+ this.theme.style('width', this.width()),
722
+ ]);
723
+ }
724
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniBackgroundComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
725
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.12", type: UniBackgroundComponent, isStandalone: true, selector: "uni-background, Background", inputs: { image: { classPropertyName: "image", publicName: "image", isSignal: true, isRequired: false, transformFunction: null }, imagePosition: { classPropertyName: "imagePosition", publicName: "imagePosition", isSignal: true, isRequired: false, transformFunction: null }, imageSize: { classPropertyName: "imageSize", publicName: "imageSize", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "this.className" } }, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true });
726
+ }
727
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniBackgroundComponent, decorators: [{
728
+ type: Component,
729
+ args: [{
730
+ selector: 'uni-background, Background',
731
+ standalone: true,
732
+ imports: [],
733
+ template: `<ng-content></ng-content>`,
734
+ }]
735
+ }], propDecorators: { image: [{ type: i0.Input, args: [{ isSignal: true, alias: "image", required: false }] }], imagePosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "imagePosition", required: false }] }], imageSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "imageSize", required: false }] }], height: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }], className: [{
736
+ type: HostBinding,
737
+ args: ['class']
738
+ }] } });
739
+
740
+ /**
741
+ * Background Component Barrel File
742
+ *
743
+ * This file exports all public-facing elements of the background component.
744
+ */
745
+
698
746
  const COMPONENT_NAME = new InjectionToken('');
699
747
  class BaseComponent {
700
748
  componentName = inject(COMPONENT_NAME);
@@ -1080,22 +1128,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImpo
1080
1128
  }]
1081
1129
  }], ctorParameters: () => [], propDecorators: { display: [{ type: i0.Input, args: [{ isSignal: true, alias: "display", required: false }] }], wrapItems: [{ type: i0.Input, args: [{ isSignal: true, alias: "wrapItems", required: false }] }] } });
1082
1130
 
1083
- class UniSymbolComponent {
1084
- name;
1085
- fill = 0;
1086
- weight = 400;
1087
- grade = 0;
1088
- opticalSize = 24;
1131
+ class UniSymbolComponent extends BaseComponent {
1132
+ name = input.required(...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
1133
+ fill = input(...(ngDevMode ? [undefined, { debugName: "fill" }] : /* istanbul ignore next */ []));
1134
+ weight = input(...(ngDevMode ? [undefined, { debugName: "weight" }] : /* istanbul ignore next */ []));
1135
+ grade = input(...(ngDevMode ? [undefined, { debugName: "grade" }] : /* istanbul ignore next */ []));
1136
+ opticalSize = input(...(ngDevMode ? [undefined, { debugName: "opticalSize" }] : /* istanbul ignore next */ []));
1089
1137
  get className() {
1090
- const settings = `'FILL' ${this.fill}, 'wght' ${this.weight}, 'GRAD' ${this.grade}, 'opsz' ${this.opticalSize}`;
1138
+ const settings = `'FILL' ${this.fill() || this.componentOptions().fill || 0}, ` +
1139
+ `'wght' ${this.weight() || this.componentOptions().weight || 400}, ` +
1140
+ `'GRAD' ${this.grade() || this.componentOptions().grade || 0}, ` +
1141
+ `'opsz' ${this.opticalSize() || this.componentOptions().opticalSize || 24}`;
1091
1142
  return ('material-symbols-rounded ' +
1092
1143
  css({
1093
1144
  fontVariationSettings: settings,
1094
- fontSize: `${this.opticalSize}px`,
1145
+ fontSize: `${this.opticalSize() || this.componentOptions().opticalSize || 24}px`,
1095
1146
  }));
1096
1147
  }
1097
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniSymbolComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1098
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.12", type: UniSymbolComponent, isStandalone: true, selector: "uni-symbol, Symbol", inputs: { name: "name", fill: "fill", weight: "weight", grade: "grade", opticalSize: "opticalSize" }, host: { properties: { "class": "this.className" } }, ngImport: i0, template: `{{ name }}`, isInline: true });
1148
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniSymbolComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
1149
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.12", type: UniSymbolComponent, isStandalone: true, selector: "uni-symbol, Symbol", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: true, transformFunction: null }, fill: { classPropertyName: "fill", publicName: "fill", isSignal: true, isRequired: false, transformFunction: null }, weight: { classPropertyName: "weight", publicName: "weight", isSignal: true, isRequired: false, transformFunction: null }, grade: { classPropertyName: "grade", publicName: "grade", isSignal: true, isRequired: false, transformFunction: null }, opticalSize: { classPropertyName: "opticalSize", publicName: "opticalSize", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "this.className" } }, providers: [{ provide: COMPONENT_NAME, useValue: 'symbol' }], usesInheritance: true, ngImport: i0, template: `{{ name() }}`, isInline: true });
1099
1150
  }
1100
1151
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniSymbolComponent, decorators: [{
1101
1152
  type: Component,
@@ -1103,19 +1154,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImpo
1103
1154
  selector: 'uni-symbol, Symbol',
1104
1155
  standalone: true,
1105
1156
  imports: [],
1106
- template: `{{ name }}`,
1157
+ template: `{{ name() }}`,
1158
+ providers: [{ provide: COMPONENT_NAME, useValue: 'symbol' }],
1107
1159
  }]
1108
- }], propDecorators: { name: [{
1109
- type: Input
1110
- }], fill: [{
1111
- type: Input
1112
- }], weight: [{
1113
- type: Input
1114
- }], grade: [{
1115
- type: Input
1116
- }], opticalSize: [{
1117
- type: Input
1118
- }], className: [{
1160
+ }], propDecorators: { name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: true }] }], fill: [{ type: i0.Input, args: [{ isSignal: true, alias: "fill", required: false }] }], weight: [{ type: i0.Input, args: [{ isSignal: true, alias: "weight", required: false }] }], grade: [{ type: i0.Input, args: [{ isSignal: true, alias: "grade", required: false }] }], opticalSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "opticalSize", required: false }] }], className: [{
1119
1161
  type: HostBinding,
1120
1162
  args: ['class']
1121
1163
  }] } });
@@ -1318,6 +1360,58 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImpo
1318
1360
  args: ['class']
1319
1361
  }] } });
1320
1362
 
1363
+ class UniButtonGroupComponent {
1364
+ themeService = inject(ThemeService);
1365
+ get className() {
1366
+ return css({
1367
+ display: 'inline-flex',
1368
+ '& button': {
1369
+ ...this.themeService.border('quaternary'),
1370
+ marginRight: -1,
1371
+ },
1372
+ '& button:first-child': {
1373
+ borderTopLeftRadius: 4,
1374
+ borderBottomLeftRadius: 4,
1375
+ borderTopRightRadius: 0,
1376
+ borderBottomRightRadius: 0,
1377
+ },
1378
+ '& button:not(:first-child):not(:last-child)': {
1379
+ borderTopLeftRadius: 0,
1380
+ borderBottomLeftRadius: 0,
1381
+ borderTopRightRadius: 0,
1382
+ borderBottomRightRadius: 0,
1383
+ },
1384
+ '& button:last-child': {
1385
+ borderTopLeftRadius: 0,
1386
+ borderBottomLeftRadius: 0,
1387
+ borderTopRightRadius: 4,
1388
+ borderBottomRightRadius: 4,
1389
+ marginRight: 0,
1390
+ },
1391
+ });
1392
+ }
1393
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniButtonGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1394
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.12", type: UniButtonGroupComponent, isStandalone: true, selector: "uni-button-group, ButtonGroup", host: { properties: { "class": "this.className" } }, ngImport: i0, template: ` <ng-content></ng-content>`, isInline: true });
1395
+ }
1396
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniButtonGroupComponent, decorators: [{
1397
+ type: Component,
1398
+ args: [{
1399
+ selector: 'uni-button-group, ButtonGroup',
1400
+ standalone: true,
1401
+ imports: [],
1402
+ template: ` <ng-content></ng-content>`,
1403
+ }]
1404
+ }], propDecorators: { className: [{
1405
+ type: HostBinding,
1406
+ args: ['class']
1407
+ }] } });
1408
+
1409
+ /**
1410
+ * UniButtonGroupComponent Barrel File
1411
+ *
1412
+ * This file exports all public-facing elements of the button-group component.
1413
+ */
1414
+
1321
1415
  class UniCardContentComponent extends BaseComponent {
1322
1416
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniCardContentComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
1323
1417
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.12", type: UniCardContentComponent, isStandalone: true, selector: "uni-card-content, CardContent", providers: [{ provide: COMPONENT_NAME, useValue: 'cardContent' }], usesInheritance: true, ngImport: i0, template: "<div [style]=\"style()\">\n <ng-content></ng-content>\n</div>\n", styles: [""] });
@@ -1414,6 +1508,171 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImpo
1414
1508
  args: [{ selector: 'uni-card-header, CardHeader', standalone: true, imports: [UniTextComponent, NgClass], providers: [{ provide: COMPONENT_NAME, useValue: 'cardHeader' }], template: "<div [style]=\"style()\" [ngClass]=\"className\">\n <Text [typeface]=\"titleTextRole()\">{{ title() }}</Text>\n <ng-content></ng-content>\n</div>\n" }]
1415
1509
  }], ctorParameters: () => [], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], titleTextRole: [{ type: i0.Input, args: [{ isSignal: true, alias: "titleTextRole", required: false }] }] } });
1416
1510
 
1511
+ class UniCheckboxComponent extends BaseComponent {
1512
+ checkboxLabel;
1513
+ checkboxInput;
1514
+ // --- REQUIRED SIGNALS (populated by FormCheckboxControl) ---
1515
+ checked = model(false, ...(ngDevMode ? [{ debugName: "checked" }] : /* istanbul ignore next */ []));
1516
+ disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
1517
+ touched = model(false, ...(ngDevMode ? [{ debugName: "touched" }] : /* istanbul ignore next */ []));
1518
+ invalid = input(false, ...(ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []));
1519
+ dirty = input(false, ...(ngDevMode ? [{ debugName: "dirty" }] : /* istanbul ignore next */ []));
1520
+ // --- CONFIGURATION ---
1521
+ label = input(...(ngDevMode ? [undefined, { debugName: "label" }] : /* istanbul ignore next */ []));
1522
+ // Only show errors if the user has actually interacted with the field
1523
+ showError = computed(() => this.invalid() && (this.touched() || this.dirty()), ...(ngDevMode ? [{ debugName: "showError" }] : /* istanbul ignore next */ []));
1524
+ markAsTouched() {
1525
+ this.touched.set(true);
1526
+ }
1527
+ constructor() {
1528
+ super();
1529
+ effect(() => {
1530
+ this.checkboxLabel = css({
1531
+ userSelect: 'none',
1532
+ cursor: this.disabled() ? 'not-allowed' : 'pointer',
1533
+ marginBottom: 0,
1534
+ display: 'flex',
1535
+ alignItems: 'center',
1536
+ gap: 8,
1537
+ opacity: this.disabled() ? 0.6 : 1,
1538
+ '&:hover .checkbox svg path': this.disabled()
1539
+ ? {}
1540
+ : {
1541
+ strokeDashoffset: 0,
1542
+ },
1543
+ '& .checkbox': {
1544
+ height: this.componentOptions().size,
1545
+ width: this.componentOptions().size,
1546
+ },
1547
+ '& .checkbox svg': {
1548
+ display: 'block',
1549
+ },
1550
+ '& .checkbox svg .checkbox-box': {
1551
+ fill: '#FFF',
1552
+ stroke: this.getThemeColor(this.variant()),
1553
+ strokeWidth: 2,
1554
+ rx: this.componentOptions().borderRadius || 2,
1555
+ ry: this.componentOptions().borderRadius || 2,
1556
+ transition: 'all 0.2s ease',
1557
+ },
1558
+ '& .checkbox svg .checkbox-check': {
1559
+ fill: 'none',
1560
+ stroke: '#FFF',
1561
+ strokeWidth: 2,
1562
+ strokeLinecap: 'round',
1563
+ strokeLinejoin: 'round',
1564
+ strokeDasharray: 18,
1565
+ strokeDashoffset: 18,
1566
+ transition: 'all 0.5s ease',
1567
+ },
1568
+ });
1569
+ this.checkboxInput = css({
1570
+ position: 'absolute',
1571
+ zIndex: -1,
1572
+ width: 0,
1573
+ height: 0,
1574
+ opacity: 0,
1575
+ '&:checked + .checkbox': {
1576
+ borderColor: this.getThemeColor(this.variant()),
1577
+ },
1578
+ '&:checked + .checkbox svg .checkbox-box': {
1579
+ fill: this.getThemeColor(this.variant()),
1580
+ },
1581
+ '&:checked + .checkbox svg .checkbox-check': {
1582
+ strokeDashoffset: 0,
1583
+ },
1584
+ '&:disabled + .checkbox': {
1585
+ cursor: 'not-allowed',
1586
+ },
1587
+ '&:focus + .checkbox': {
1588
+ position: 'relative',
1589
+ '&::after': {
1590
+ content: '""',
1591
+ position: 'absolute',
1592
+ top: '-4px',
1593
+ left: '-4px',
1594
+ right: '-4px',
1595
+ bottom: '-4px',
1596
+ border: `2px solid ${this.getThemeColor(this.variant())}`,
1597
+ borderRadius: `${(Number(this.componentOptions().borderRadius) || 2) + 4}px`,
1598
+ pointerEvents: 'none',
1599
+ },
1600
+ },
1601
+ });
1602
+ });
1603
+ }
1604
+ getThemeColor(token) {
1605
+ const colors = this.theme.colors();
1606
+ return colors[token] ? colors[token] : colors['primary'];
1607
+ }
1608
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniCheckboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1609
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: UniCheckboxComponent, isStandalone: true, selector: "uni-checkbox, Checkbox", inputs: { checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, dirty: { classPropertyName: "dirty", publicName: "dirty", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checked: "checkedChange", touched: "touchedChange" }, providers: [{ provide: COMPONENT_NAME, useValue: 'checkbox' }], usesInheritance: true, ngImport: i0, template: "<label [class]=\"checkboxLabel\">\n <input\n type=\"checkbox\"\n [class]=\"checkboxInput\"\n [checked]=\"checked()\"\n (change)=\"checked.set($any($event.target).checked); markAsTouched()\"\n [disabled]=\"disabled()\"\n />\n <div class=\"checkbox\">\n <svg viewBox=\"0 0 20 20\">\n <rect class=\"checkbox-box\" x=\"1\" y=\"1\" width=\"18\" height=\"18\"></rect>\n <polyline class=\"checkbox-check\" points=\"4 11 8 15 16 6\"></polyline>\n </svg>\n </div>\n @if (label()) {\n <Text typeface=\"label\">{{ label() }}</Text>\n }\n</label>\n", dependencies: [{ kind: "component", type: UniTextComponent, selector: "uni-text, Text", inputs: ["typeface", "color", "display", "align", "nowrap", "maxWidth", "ellipsis"] }] });
1610
+ }
1611
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniCheckboxComponent, decorators: [{
1612
+ type: Component,
1613
+ args: [{ selector: 'uni-checkbox, Checkbox', standalone: true, imports: [UniTextComponent], providers: [{ provide: COMPONENT_NAME, useValue: 'checkbox' }], template: "<label [class]=\"checkboxLabel\">\n <input\n type=\"checkbox\"\n [class]=\"checkboxInput\"\n [checked]=\"checked()\"\n (change)=\"checked.set($any($event.target).checked); markAsTouched()\"\n [disabled]=\"disabled()\"\n />\n <div class=\"checkbox\">\n <svg viewBox=\"0 0 20 20\">\n <rect class=\"checkbox-box\" x=\"1\" y=\"1\" width=\"18\" height=\"18\"></rect>\n <polyline class=\"checkbox-check\" points=\"4 11 8 15 16 6\"></polyline>\n </svg>\n </div>\n @if (label()) {\n <Text typeface=\"label\">{{ label() }}</Text>\n }\n</label>\n" }]
1614
+ }], ctorParameters: () => [], propDecorators: { checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }, { type: i0.Output, args: ["checkedChange"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }, { type: i0.Output, args: ["touchedChange"] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], dirty: [{ type: i0.Input, args: [{ isSignal: true, alias: "dirty", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }] } });
1615
+
1616
+ class BodyRenderDirective {
1617
+ el = inject(ElementRef);
1618
+ renderer = inject(Renderer2);
1619
+ ngOnInit() {
1620
+ const element = this.el.nativeElement;
1621
+ this.renderer.appendChild(document.body, element);
1622
+ }
1623
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: BodyRenderDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1624
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.12", type: BodyRenderDirective, isStandalone: true, selector: "[uniBodyRender]", ngImport: i0 });
1625
+ }
1626
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: BodyRenderDirective, decorators: [{
1627
+ type: Directive,
1628
+ args: [{
1629
+ standalone: true,
1630
+ selector: '[uniBodyRender]',
1631
+ }]
1632
+ }] });
1633
+
1634
+ class DragAndDropDirective {
1635
+ onFileDropped = output();
1636
+ workspaceOpacity = signal('1', ...(ngDevMode ? [{ debugName: "workspaceOpacity" }] : /* istanbul ignore next */ []));
1637
+ // Dragover listener, when files are dragged over our host element
1638
+ onDragOver(event) {
1639
+ event.preventDefault();
1640
+ event.stopPropagation();
1641
+ this.workspaceOpacity.set('0.5');
1642
+ }
1643
+ // Dragleave listener, when files are dragged away from our host element
1644
+ onDragLeave(event) {
1645
+ event.preventDefault();
1646
+ event.stopPropagation();
1647
+ this.workspaceOpacity.set('1');
1648
+ }
1649
+ // Drop listener, when files are dropped on our host element
1650
+ onDrop(event) {
1651
+ event.preventDefault();
1652
+ event.stopPropagation();
1653
+ this.workspaceOpacity.set('1');
1654
+ const files = event.dataTransfer?.files;
1655
+ if (files && files.length > 0) {
1656
+ this.onFileDropped.emit(files);
1657
+ }
1658
+ }
1659
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: DragAndDropDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1660
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.12", type: DragAndDropDirective, isStandalone: true, selector: "[uni-drag-n-drop], [dragAndDrop]", outputs: { onFileDropped: "onFileDropped" }, host: { listeners: { "dragover": "onDragOver($event)", "dragleave": "onDragLeave($event)", "drop": "onDrop($event)" }, properties: { "style.opacity": "workspaceOpacity()" } }, ngImport: i0 });
1661
+ }
1662
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: DragAndDropDirective, decorators: [{
1663
+ type: Directive,
1664
+ args: [{
1665
+ selector: '[uni-drag-n-drop], [dragAndDrop]',
1666
+ standalone: true,
1667
+ host: {
1668
+ '[style.opacity]': 'workspaceOpacity()',
1669
+ '(dragover)': 'onDragOver($event)',
1670
+ '(dragleave)': 'onDragLeave($event)',
1671
+ '(drop)': 'onDrop($event)',
1672
+ },
1673
+ }]
1674
+ }], propDecorators: { onFileDropped: [{ type: i0.Output, args: ["onFileDropped"] }] } });
1675
+
1417
1676
  class UniIconButtonComponent {
1418
1677
  theme = inject(ThemeService);
1419
1678
  config = this.theme.component('iconButton');
@@ -1530,112 +1789,594 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImpo
1530
1789
  args: ['class']
1531
1790
  }] } });
1532
1791
 
1533
- class UniDialogComponent extends BaseComponent {
1534
- elem = inject(ElementRef);
1535
- show = input(false, ...(ngDevMode ? [{ debugName: "show" }] : /* istanbul ignore next */ []));
1536
- _show = linkedSignal(() => this.show(), ...(ngDevMode ? [{ debugName: "_show" }] : /* istanbul ignore next */ []));
1537
- defaultCloseButton;
1538
- showing = new EventEmitter();
1792
+ class UniDataSearchComponent extends BaseComponent {
1793
+ datasource = input(...(ngDevMode ? [undefined, { debugName: "datasource" }] : /* istanbul ignore next */ []));
1794
+ placeholder = input('Search', ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
1795
+ fields = input(...(ngDevMode ? [undefined, { debugName: "fields" }] : /* istanbul ignore next */ []));
1796
+ searchValue = signal('', ...(ngDevMode ? [{ debugName: "searchValue" }] : /* istanbul ignore next */ []));
1797
+ inputClassName;
1539
1798
  constructor() {
1540
1799
  super();
1541
- effect(() => (this._show() ? this.open() : this.close()));
1800
+ effect(() => {
1801
+ this.inputClassName = css({
1802
+ border: 'none',
1803
+ padding: 0,
1804
+ fontSize: 16,
1805
+ flexGrow: 1,
1806
+ height: 18,
1807
+ '&:focus-visible': {
1808
+ outline: 'none',
1809
+ },
1810
+ '&::placeholder': {
1811
+ ...this.theme.color(this.componentOptions().placeholderColor),
1812
+ },
1813
+ });
1814
+ });
1542
1815
  }
1543
- get _dialog() {
1544
- return this.elem.nativeElement;
1816
+ onInput(event) {
1817
+ const value = event.target.value;
1818
+ this.searchValue.set(value);
1819
+ this.filterData(value);
1820
+ }
1821
+ filterData(value) {
1822
+ const datasource = this.datasource();
1823
+ if (!datasource)
1824
+ return;
1825
+ const fields = this.fields();
1826
+ if (datasource instanceof UniRecordDatasource) {
1827
+ // Client-side filtering with predicate function
1828
+ datasource.setFilter((object) => {
1829
+ let searchObject = object;
1830
+ if (fields && fields.length > 0) {
1831
+ searchObject = pick(object, fields);
1832
+ }
1833
+ return Object.values(searchObject)
1834
+ .join(' ')
1835
+ .toLowerCase()
1836
+ .includes(value.toLowerCase());
1837
+ });
1838
+ }
1839
+ else if (datasource instanceof UniServerSideDatasource) {
1840
+ // Server-side filtering with filter object
1841
+ const filterObject = {};
1842
+ if (fields && fields.length > 0) {
1843
+ // Apply search to specific fields
1844
+ fields.forEach((field) => {
1845
+ filterObject[field] = value;
1846
+ });
1847
+ }
1848
+ else {
1849
+ // Generic search filter
1850
+ filterObject['search'] = value;
1851
+ }
1852
+ datasource.setFilter(filterObject);
1853
+ }
1854
+ }
1855
+ clearFilter() {
1856
+ const datasource = this.datasource();
1857
+ if (!datasource)
1858
+ return;
1859
+ if (datasource instanceof UniRecordDatasource) {
1860
+ datasource.setFilter(() => true);
1861
+ }
1862
+ else if (datasource instanceof UniServerSideDatasource) {
1863
+ datasource.clearFilter();
1864
+ }
1865
+ this.searchValue.set('');
1866
+ }
1867
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniDataSearchComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1868
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: UniDataSearchComponent, isStandalone: true, selector: "uni-data-search", inputs: { datasource: { classPropertyName: "datasource", publicName: "datasource", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, fields: { classPropertyName: "fields", publicName: "fields", isSignal: true, isRequired: false, transformFunction: null } }, providers: [{ provide: COMPONENT_NAME, useValue: 'dataSearch' }], usesInheritance: true, ngImport: i0, template: "<div\n row-layout\n alignItems=\"center\"\n [border]=\"componentOptions().border\"\n [height]=\"26\"\n [borderRadius]=\"componentOptions().borderRadius\"\n paddingLeft=\"xs\"\n>\n <div center-layout [height]=\"18\" [width]=\"18\" paddingRight=\"xs\">\n <uni-icon name=\"search\" />\n </div>\n <input\n type=\"text\"\n (input)=\"onInput($event)\"\n [class]=\"inputClassName\"\n [placeholder]=\"placeholder()\"\n [value]=\"searchValue()\"\n />\n <div row-layout alignItems=\"center\" [width]=\"22\">\n @if (!!searchValue()) {\n <button icon-button (click)=\"clearFilter()\" symbolName=\"close\" size=\"sm\">\n Clear Search\n </button>\n }\n </div>\n</div>\n", dependencies: [{ kind: "component", type: UniRowComponent, selector: "div[uni-row-layout], Row, div[row-layout]", inputs: ["display", "flexDirection", "minWidth"] }, { kind: "component", type: UniIconButtonComponent, selector: "button[uni-icon-button], button[icon-button]", inputs: ["iconName", "symbolName", "variant", "size", "disable", "loading", "opticalSize"] }, { kind: "component", type: UniIconComponent, selector: "uni-icon, Icon", inputs: ["color", "name"] }, { kind: "component", type: UniCenterComponent, selector: "div[uni-center-layout], div[center-layout]", inputs: ["display", "justifyContent", "alignItems"] }] });
1869
+ }
1870
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniDataSearchComponent, decorators: [{
1871
+ type: Component,
1872
+ args: [{ selector: 'uni-data-search', imports: [UniRowComponent, UniIconButtonComponent, UniIconComponent, UniCenterComponent], providers: [{ provide: COMPONENT_NAME, useValue: 'dataSearch' }], template: "<div\n row-layout\n alignItems=\"center\"\n [border]=\"componentOptions().border\"\n [height]=\"26\"\n [borderRadius]=\"componentOptions().borderRadius\"\n paddingLeft=\"xs\"\n>\n <div center-layout [height]=\"18\" [width]=\"18\" paddingRight=\"xs\">\n <uni-icon name=\"search\" />\n </div>\n <input\n type=\"text\"\n (input)=\"onInput($event)\"\n [class]=\"inputClassName\"\n [placeholder]=\"placeholder()\"\n [value]=\"searchValue()\"\n />\n <div row-layout alignItems=\"center\" [width]=\"22\">\n @if (!!searchValue()) {\n <button icon-button (click)=\"clearFilter()\" symbolName=\"close\" size=\"sm\">\n Clear Search\n </button>\n }\n </div>\n</div>\n" }]
1873
+ }], ctorParameters: () => [], propDecorators: { datasource: [{ type: i0.Input, args: [{ isSignal: true, alias: "datasource", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], fields: [{ type: i0.Input, args: [{ isSignal: true, alias: "fields", required: false }] }] } });
1874
+ function pick(obj, keys) {
1875
+ return keys.reduce((acc, key) => {
1876
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
1877
+ acc[key] = obj[key];
1878
+ }
1879
+ return acc;
1880
+ }, {});
1881
+ }
1882
+
1883
+ /**
1884
+ * UniDataSearchComponent Barrel File
1885
+ *
1886
+ * This file exports all public-facing elements of the data-search component.
1887
+ */
1888
+
1889
+ /**
1890
+ * Native scroll area with theme-driven scrollbar styling.
1891
+ *
1892
+ * Scrollbars are styled entirely through Emotion-generated CSS:
1893
+ * `::-webkit-scrollbar` rules cover Chromium/Safari, with a
1894
+ * `scrollbar-width`/`scrollbar-color` fallback for Firefox.
1895
+ */
1896
+ class UniScrollAreaComponent {
1897
+ theme = inject(ThemeService);
1898
+ isVerticallyScrollable = signal(false, ...(ngDevMode ? [{ debugName: "isVerticallyScrollable" }] : /* istanbul ignore next */ []));
1899
+ viewport = viewChild.required('viewport');
1900
+ content = viewChild.required('content');
1901
+ color = input(...(ngDevMode ? [undefined, { debugName: "color" }] : /* istanbul ignore next */ []));
1902
+ borderRadius = input('sm', ...(ngDevMode ? [{ debugName: "borderRadius" }] : /* istanbul ignore next */ []));
1903
+ padding = input(...(ngDevMode ? [undefined, { debugName: "padding" }] : /* istanbul ignore next */ []));
1904
+ paddingHorizontal = input(...(ngDevMode ? [undefined, { debugName: "paddingHorizontal" }] : /* istanbul ignore next */ []));
1905
+ paddingVertical = input(...(ngDevMode ? [undefined, { debugName: "paddingVertical" }] : /* istanbul ignore next */ []));
1906
+ paddingLeft = input(...(ngDevMode ? [undefined, { debugName: "paddingLeft" }] : /* istanbul ignore next */ []));
1907
+ paddingRight = input(...(ngDevMode ? [undefined, { debugName: "paddingRight" }] : /* istanbul ignore next */ []));
1908
+ paddingTop = input(...(ngDevMode ? [undefined, { debugName: "paddingTop" }] : /* istanbul ignore next */ []));
1909
+ paddingBottom = input(...(ngDevMode ? [undefined, { debugName: "paddingBottom" }] : /* istanbul ignore next */ []));
1910
+ border = input(...(ngDevMode ? [undefined, { debugName: "border" }] : /* istanbul ignore next */ []));
1911
+ height = input(...(ngDevMode ? [undefined, { debugName: "height" }] : /* istanbul ignore next */ []));
1912
+ width = input(...(ngDevMode ? [undefined, { debugName: "width" }] : /* istanbul ignore next */ []));
1913
+ appearance = input('compact', ...(ngDevMode ? [{ debugName: "appearance" }] : /* istanbul ignore next */ []));
1914
+ autoHeightDisabled = input(false, ...(ngDevMode ? [{ debugName: "autoHeightDisabled" }] : /* istanbul ignore next */ []));
1915
+ verticalScrollPadding = input(29, ...(ngDevMode ? [{ debugName: "verticalScrollPadding" }] : /* istanbul ignore next */ []));
1916
+ scrollable = output();
1917
+ scrollToBottom() {
1918
+ const viewport = this.viewport().nativeElement;
1919
+ viewport.scrollTo({ top: viewport.scrollHeight, behavior: 'smooth' });
1920
+ }
1921
+ scrollToTop() {
1922
+ this.viewport().nativeElement.scrollTo({ top: 0, behavior: 'smooth' });
1545
1923
  }
1546
1924
  get className() {
1925
+ return css({
1926
+ display: 'block',
1927
+ overflow: 'hidden',
1928
+ height: this.height(),
1929
+ width: this.width(),
1930
+ ...this.theme.colorPair(this.color()),
1931
+ ...this.theme.radius(this.borderRadius()),
1932
+ ...this.theme.border(this.border()),
1933
+ });
1934
+ }
1935
+ viewportClassName = computed(() => {
1936
+ const palette = this.theme.colors();
1937
+ const thumbColor = palette['on-primary-surface'];
1938
+ const trackColor = palette['primary-surface'];
1939
+ const thickness = this.appearance() === 'standard' ? 13 : 8;
1547
1940
  return css([
1548
1941
  {
1549
- ...this.theme.radius(this.componentOptions().borderRadius),
1550
- ...this.theme.colorPair(this.componentOptions().color),
1551
- ...this.theme.border(this.componentOptions().border),
1552
- ...this.theme.boxShadow(this.componentOptions().elevation),
1553
- ...this.theme.padding(this.componentOptions().padding || 'none'),
1554
- '&::backdrop': {
1555
- ...this.componentOptions().backdrop,
1942
+ height: '100%',
1943
+ width: '100%',
1944
+ overflow: 'auto',
1945
+ '&::-webkit-scrollbar': {
1946
+ width: thickness,
1947
+ height: thickness,
1556
1948
  },
1557
- '&[open], &::backdrop': {
1558
- animation: `${this.dialogFadeIn} ease-in 350ms`,
1949
+ '&::-webkit-scrollbar-thumb': {
1950
+ backgroundColor: thumbColor,
1951
+ borderRadius: 7,
1952
+ border: `3px solid ${trackColor}`,
1953
+ boxSizing: 'border-box',
1559
1954
  },
1560
- '&[closing], &[closing]::backdrop': {
1561
- animation: `${this.dialogFadeOut} ease-in 350ms`,
1955
+ '&::-webkit-scrollbar-track': {
1956
+ backgroundColor: trackColor,
1957
+ borderRadius: 12,
1958
+ },
1959
+ // Firefox has no ::-webkit-scrollbar support; fall back to the
1960
+ // standard scrollbar properties there.
1961
+ '@supports not selector(::-webkit-scrollbar)': {
1962
+ scrollbarWidth: this.appearance() === 'standard' ? 'auto' : 'thin',
1963
+ scrollbarColor: `${thumbColor} ${trackColor}`,
1964
+ },
1965
+ },
1966
+ this.appearance() === 'standard' && {
1967
+ '&::-webkit-scrollbar-track': {
1968
+ backgroundColor: trackColor,
1969
+ borderRadius: 12,
1970
+ ...this.theme.border('quaternary'),
1562
1971
  },
1563
1972
  },
1564
1973
  ]);
1974
+ }, ...(ngDevMode ? [{ debugName: "viewportClassName" }] : /* istanbul ignore next */ []));
1975
+ contentClassName = computed(() => css({
1976
+ ...this.theme.padding(this.padding()),
1977
+ ...this.theme.horizontalPadding(this.paddingHorizontal()),
1978
+ ...this.theme.verticalPadding(this.paddingVertical()),
1979
+ ...this.theme.paddingLeft(this.paddingLeft()),
1980
+ ...this.theme.paddingRight(this.paddingRight()),
1981
+ ...this.theme.paddingTop(this.paddingTop()),
1982
+ ...this.theme.paddingBottom(this.paddingBottom()),
1983
+ '&.isVerticallyScrollable': {
1984
+ paddingRight: this.verticalScrollPadding(),
1985
+ },
1986
+ }), ...(ngDevMode ? [{ debugName: "contentClassName" }] : /* istanbul ignore next */ []));
1987
+ constructor() {
1988
+ const destroyRef = inject(DestroyRef);
1989
+ afterNextRender(() => {
1990
+ const viewport = this.viewport().nativeElement;
1991
+ const content = this.content().nativeElement;
1992
+ const updateScrollable = () => {
1993
+ const scrollable = viewport.scrollHeight > viewport.clientHeight;
1994
+ if (scrollable !== this.isVerticallyScrollable()) {
1995
+ this.isVerticallyScrollable.set(scrollable);
1996
+ this.scrollable.emit(scrollable);
1997
+ }
1998
+ };
1999
+ const observer = new ResizeObserver(updateScrollable);
2000
+ observer.observe(viewport);
2001
+ observer.observe(content);
2002
+ destroyRef.onDestroy(() => observer.disconnect());
2003
+ updateScrollable();
2004
+ });
1565
2005
  }
1566
- BackdropClick(event) {
1567
- if (event.target.nodeName === 'DIALOG') {
1568
- this.close();
1569
- }
1570
- }
1571
- ClosingAnimation(e) {
1572
- // Close the dialog if the animation is finished
1573
- if (e.animationName.includes(this.dialogFadeOut)) {
1574
- this._dialog.close();
1575
- this._dialog.removeAttribute('closing');
1576
- this.showing.emit(false);
1577
- }
1578
- }
1579
- closeButton = css({
1580
- position: 'absolute',
1581
- right: 12,
1582
- top: 12,
1583
- });
1584
- dialogFadeIn = keyframes({ ...fadeIn });
1585
- dialogFadeOut = keyframes({ ...fadeOut });
1586
- open() {
1587
- this._dialog.removeAttribute('closing');
1588
- this._dialog.showModal();
1589
- this._show.set(true);
1590
- this.showing.emit(true);
1591
- }
1592
- close() {
1593
- this._dialog.setAttribute('closing', 'true');
1594
- this._show.set(false);
1595
- }
1596
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1597
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: UniDialogComponent, isStandalone: true, selector: "dialog[uni-dialog], Dialog", inputs: { show: { classPropertyName: "show", publicName: "show", isSignal: true, isRequired: false, transformFunction: null }, defaultCloseButton: { classPropertyName: "defaultCloseButton", publicName: "defaultCloseButton", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { showing: "showing" }, host: { listeners: { "click": "BackdropClick($event)", "animationend": "ClosingAnimation($event)" }, properties: { "class": "this.className" } }, providers: [{ provide: COMPONENT_NAME, useValue: 'dialog' }], usesInheritance: true, ngImport: i0, template: `
1598
- @if (defaultCloseButton) {
1599
- <button
1600
- icon-button
1601
- iconName="close"
1602
- variant="ghost"
1603
- (click)="close()"
1604
- [class]="closeButton"
1605
- size="md"
1606
- >
1607
- Close
1608
- </button>
1609
- }
1610
- <ng-content></ng-content>
1611
- `, isInline: true, dependencies: [{ kind: "component", type: UniIconButtonComponent, selector: "button[uni-icon-button], button[icon-button]", inputs: ["iconName", "symbolName", "variant", "size", "disable", "loading", "opticalSize"] }, { kind: "ngmodule", type: CommonModule }] });
2006
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniScrollAreaComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2007
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.12", type: UniScrollAreaComponent, isStandalone: true, selector: "div[uni-scroll-area], ScrollArea, div[scroll-area]", inputs: { color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, borderRadius: { classPropertyName: "borderRadius", publicName: "borderRadius", isSignal: true, isRequired: false, transformFunction: null }, padding: { classPropertyName: "padding", publicName: "padding", isSignal: true, isRequired: false, transformFunction: null }, paddingHorizontal: { classPropertyName: "paddingHorizontal", publicName: "paddingHorizontal", isSignal: true, isRequired: false, transformFunction: null }, paddingVertical: { classPropertyName: "paddingVertical", publicName: "paddingVertical", isSignal: true, isRequired: false, transformFunction: null }, paddingLeft: { classPropertyName: "paddingLeft", publicName: "paddingLeft", isSignal: true, isRequired: false, transformFunction: null }, paddingRight: { classPropertyName: "paddingRight", publicName: "paddingRight", isSignal: true, isRequired: false, transformFunction: null }, paddingTop: { classPropertyName: "paddingTop", publicName: "paddingTop", isSignal: true, isRequired: false, transformFunction: null }, paddingBottom: { classPropertyName: "paddingBottom", publicName: "paddingBottom", isSignal: true, isRequired: false, transformFunction: null }, border: { classPropertyName: "border", publicName: "border", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, autoHeightDisabled: { classPropertyName: "autoHeightDisabled", publicName: "autoHeightDisabled", isSignal: true, isRequired: false, transformFunction: null }, verticalScrollPadding: { classPropertyName: "verticalScrollPadding", publicName: "verticalScrollPadding", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { scrollable: "scrollable" }, host: { properties: { "class": "this.className" } }, viewQueries: [{ propertyName: "viewport", first: true, predicate: ["viewport"], descendants: true, isSignal: true }, { propertyName: "content", first: true, predicate: ["content"], descendants: true, isSignal: true }], ngImport: i0, template: `<div #viewport [class]="viewportClassName()">
2008
+ <div
2009
+ #content
2010
+ [class]="contentClassName()"
2011
+ [class.isVerticallyScrollable]="isVerticallyScrollable()"
2012
+ >
2013
+ <ng-content></ng-content>
2014
+ </div>
2015
+ </div>`, isInline: true });
1612
2016
  }
1613
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniDialogComponent, decorators: [{
2017
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniScrollAreaComponent, decorators: [{
1614
2018
  type: Component,
1615
2019
  args: [{
1616
- selector: 'dialog[uni-dialog], Dialog',
2020
+ selector: 'div[uni-scroll-area], ScrollArea, div[scroll-area]',
1617
2021
  standalone: true,
1618
- imports: [UniIconButtonComponent, CommonModule],
1619
- template: `
1620
- @if (defaultCloseButton) {
1621
- <button
1622
- icon-button
1623
- iconName="close"
1624
- variant="ghost"
1625
- (click)="close()"
1626
- [class]="closeButton"
1627
- size="md"
1628
- >
1629
- Close
1630
- </button>
1631
- }
1632
- <ng-content></ng-content>
1633
- `,
1634
- providers: [{ provide: COMPONENT_NAME, useValue: 'dialog' }],
2022
+ imports: [],
2023
+ template: `<div #viewport [class]="viewportClassName()">
2024
+ <div
2025
+ #content
2026
+ [class]="contentClassName()"
2027
+ [class.isVerticallyScrollable]="isVerticallyScrollable()"
2028
+ >
2029
+ <ng-content></ng-content>
2030
+ </div>
2031
+ </div>`,
1635
2032
  }]
1636
- }], ctorParameters: () => [], propDecorators: { show: [{ type: i0.Input, args: [{ isSignal: true, alias: "show", required: false }] }], defaultCloseButton: [{
1637
- type: Input
1638
- }], showing: [{
2033
+ }], ctorParameters: () => [], propDecorators: { viewport: [{ type: i0.ViewChild, args: ['viewport', { isSignal: true }] }], content: [{ type: i0.ViewChild, args: ['content', { isSignal: true }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], borderRadius: [{ type: i0.Input, args: [{ isSignal: true, alias: "borderRadius", required: false }] }], padding: [{ type: i0.Input, args: [{ isSignal: true, alias: "padding", required: false }] }], paddingHorizontal: [{ type: i0.Input, args: [{ isSignal: true, alias: "paddingHorizontal", required: false }] }], paddingVertical: [{ type: i0.Input, args: [{ isSignal: true, alias: "paddingVertical", required: false }] }], paddingLeft: [{ type: i0.Input, args: [{ isSignal: true, alias: "paddingLeft", required: false }] }], paddingRight: [{ type: i0.Input, args: [{ isSignal: true, alias: "paddingRight", required: false }] }], paddingTop: [{ type: i0.Input, args: [{ isSignal: true, alias: "paddingTop", required: false }] }], paddingBottom: [{ type: i0.Input, args: [{ isSignal: true, alias: "paddingBottom", required: false }] }], border: [{ type: i0.Input, args: [{ isSignal: true, alias: "border", required: false }] }], height: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }], appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], autoHeightDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoHeightDisabled", required: false }] }], verticalScrollPadding: [{ type: i0.Input, args: [{ isSignal: true, alias: "verticalScrollPadding", required: false }] }], scrollable: [{ type: i0.Output, args: ["scrollable"] }], className: [{
2034
+ type: HostBinding,
2035
+ args: ['class']
2036
+ }] } });
2037
+
2038
+ class UniSortHeaderComponent {
2039
+ column = input(...(ngDevMode ? [undefined, { debugName: "column" }] : /* istanbul ignore next */ []));
2040
+ datasource = input(...(ngDevMode ? [undefined, { debugName: "datasource" }] : /* istanbul ignore next */ []));
2041
+ direction = computed(() => {
2042
+ const ds = this.datasource();
2043
+ if (!ds)
2044
+ return 'indet';
2045
+ return ds.sortColumn() === this.column() ? ds.sortDirection() : 'indet';
2046
+ }, ...(ngDevMode ? [{ debugName: "direction" }] : /* istanbul ignore next */ []));
2047
+ get className() {
2048
+ return css({
2049
+ cursor: 'pointer',
2050
+ position: 'relative',
2051
+ height: 24,
2052
+ '& .sort-icon': {
2053
+ position: 'absolute',
2054
+ right: -24,
2055
+ top: -4,
2056
+ height: 24,
2057
+ width: 24,
2058
+ transition: 'all 350ms ease-in-out',
2059
+ transform: 'rotate(0)',
2060
+ },
2061
+ '& .sort-icon.asc': {
2062
+ transform: 'rotate(-180deg)',
2063
+ },
2064
+ '& .sort-icon.indet': {
2065
+ opacity: 0,
2066
+ transform: 'rotate(0)',
2067
+ },
2068
+ });
2069
+ }
2070
+ cycleSort() {
2071
+ const cycle = ['asc', 'desc', 'indet'];
2072
+ this.sortDatasource(cycle[cycle.indexOf(this.direction()) + 1] || cycle[0]);
2073
+ }
2074
+ sortDatasource(direction) {
2075
+ this.datasource()?.sortRecords({
2076
+ column: this.column(),
2077
+ direction,
2078
+ });
2079
+ }
2080
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniSortHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2081
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.12", type: UniSortHeaderComponent, isStandalone: true, selector: "uni-sort-header", inputs: { column: { classPropertyName: "column", publicName: "column", isSignal: true, isRequired: false, transformFunction: null }, datasource: { classPropertyName: "datasource", publicName: "datasource", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "cycleSort()" }, properties: { "class": "this.className" } }, ngImport: i0, template: "<ng-content></ng-content>\n<div class=\"sort-icon\" [class]=\"direction()\">\n <uni-symbol name=\"arrow_upward\" />\n</div>\n", dependencies: [{ kind: "component", type: UniSymbolComponent, selector: "uni-symbol, Symbol", inputs: ["name", "fill", "weight", "grade", "opticalSize"] }] });
2082
+ }
2083
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniSortHeaderComponent, decorators: [{
2084
+ type: Component,
2085
+ args: [{ selector: 'uni-sort-header', imports: [UniSymbolComponent], standalone: true, host: {
2086
+ '(click)': 'cycleSort()',
2087
+ }, template: "<ng-content></ng-content>\n<div class=\"sort-icon\" [class]=\"direction()\">\n <uni-symbol name=\"arrow_upward\" />\n</div>\n" }]
2088
+ }], propDecorators: { column: [{ type: i0.Input, args: [{ isSignal: true, alias: "column", required: false }] }], datasource: [{ type: i0.Input, args: [{ isSignal: true, alias: "datasource", required: false }] }], className: [{
2089
+ type: HostBinding,
2090
+ args: ['class']
2091
+ }] } });
2092
+
2093
+ class UniDataTableComponent extends BaseComponent {
2094
+ datasource = input.required(...(ngDevMode ? [{ debugName: "datasource" }] : /* istanbul ignore next */ []));
2095
+ columns = input.required(...(ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []));
2096
+ detailRowTemplate = input(...(ngDevMode ? [undefined, { debugName: "detailRowTemplate" }] : /* istanbul ignore next */ []));
2097
+ expandedIndex = signal(null, ...(ngDevMode ? [{ debugName: "expandedIndex" }] : /* istanbul ignore next */ []));
2098
+ useMultiSelect = input(false, ...(ngDevMode ? [{ debugName: "useMultiSelect" }] : /* istanbul ignore next */ []));
2099
+ useRowClick = input(true, ...(ngDevMode ? [{ debugName: "useRowClick" }] : /* istanbul ignore next */ []));
2100
+ highlight = input(...(ngDevMode ? [undefined, { debugName: "highlight" }] : /* istanbul ignore next */ []));
2101
+ height = input(...(ngDevMode ? [undefined, { debugName: "height" }] : /* istanbul ignore next */ []));
2102
+ scrollable = signal(false, ...(ngDevMode ? [{ debugName: "scrollable" }] : /* istanbul ignore next */ []));
2103
+ tableClass;
2104
+ headerClass;
2105
+ footerClass;
2106
+ thClass;
2107
+ tdClass;
2108
+ trClass;
2109
+ detailRowClass;
2110
+ loadingOverlayClass = css({
2111
+ animation: 'fadeIn 350ms ease-in-out',
2112
+ '@keyframes fadeIn': { ...fadeIn },
2113
+ });
2114
+ rowSelect = output();
2115
+ rowClick = output();
2116
+ displayedColumns = signal([], ...(ngDevMode ? [{ debugName: "displayedColumns" }] : /* istanbul ignore next */ []));
2117
+ constructor() {
2118
+ super();
2119
+ effect(() => {
2120
+ this.displayedColumns.set(this.columns().map((c) => c.columnDef));
2121
+ this.tableClass = css({
2122
+ ...this.theme.colorPair(this.componentOptions().color),
2123
+ width: '100%',
2124
+ borderSpacing: 0,
2125
+ });
2126
+ this.headerClass = css({
2127
+ borderBottom: this.getBorder(this.componentOptions().thHorizontalBorder),
2128
+ '&:empty': {
2129
+ display: 'none',
2130
+ },
2131
+ });
2132
+ this.footerClass = css({
2133
+ borderTop: this.getBorder(this.componentOptions().thHorizontalBorder),
2134
+ '&:empty': {
2135
+ display: 'none',
2136
+ },
2137
+ });
2138
+ this.thClass = css({
2139
+ ...this.theme.colorPair(this.componentOptions().thColor),
2140
+ position: 'sticky',
2141
+ top: 0,
2142
+ textAlign: 'center',
2143
+ padding: 0, // Reset renderers default padding
2144
+ ...this.theme.padding(this.componentOptions().thPadding),
2145
+ borderBottom: this.getBorder(this.componentOptions().thHorizontalBorder),
2146
+ '&:not(:last-child)': {
2147
+ borderRight: this.getBorder(this.componentOptions().thVerticalBorder),
2148
+ },
2149
+ '&:last-child.scrollable': {
2150
+ paddingRight: 29,
2151
+ },
2152
+ '&.sticky': {
2153
+ position: 'sticky',
2154
+ left: 0,
2155
+ zIndex: Z_INDEX.sticky,
2156
+ },
2157
+ });
2158
+ this.tdClass = css([
2159
+ {
2160
+ textAlign: 'center',
2161
+ padding: 0, // Reset renderers default padding
2162
+ '&:not(:last-child)': {
2163
+ borderRight: this.getBorder(this.componentOptions().tdVerticalBorder),
2164
+ },
2165
+ '&:last-child.scrollable': {
2166
+ // The last scrollable column allows space for the scrollbar.
2167
+ paddingRight: 29,
2168
+ },
2169
+ '&.sticky': {
2170
+ position: 'sticky',
2171
+ left: 0,
2172
+ zIndex: Z_INDEX.sticky,
2173
+ ...this.theme.colorPair(this.componentOptions().tdStickyColor),
2174
+ },
2175
+ '&:not(.template)': {
2176
+ // Allow templates to define their own styles
2177
+ ...this.theme.padding(this.componentOptions().tdPadding),
2178
+ },
2179
+ },
2180
+ ]);
2181
+ this.trClass = css({
2182
+ '& td': {
2183
+ ...this.theme.backgroundColor('transparent'),
2184
+ transition: 'all 0.28s ease',
2185
+ },
2186
+ ':not(:last-child) td': {
2187
+ borderBottom: this.getBorder(this.componentOptions().tdHorizontalBorder),
2188
+ },
2189
+ }, this.useRowClick() && {
2190
+ '&:hover td': {
2191
+ ...this.theme.backgroundColor(this.componentOptions().rowHoverColor),
2192
+ cursor: 'pointer',
2193
+ },
2194
+ });
2195
+ this.detailRowClass = css({
2196
+ display: 'table-row',
2197
+ visibility: 'hidden',
2198
+ '&.expanded': {
2199
+ visibility: 'visible',
2200
+ },
2201
+ '& td': {
2202
+ padding: 0,
2203
+ borderBottom: this.getBorder(this.componentOptions().tdHorizontalBorder),
2204
+ },
2205
+ '& td .detail-content-wrapper': {
2206
+ display: 'grid',
2207
+ gridTemplateRows: '0fr',
2208
+ transition: 'grid-template-rows 0.3s ease',
2209
+ overflow: 'hidden',
2210
+ '& .detail-inner': {
2211
+ minHeight: 0,
2212
+ },
2213
+ },
2214
+ '&.expanded td .detail-content-wrapper': {
2215
+ gridTemplateRows: '1fr',
2216
+ },
2217
+ });
2218
+ });
2219
+ }
2220
+ // Loading state detection
2221
+ isLoading = linkedSignal(() => {
2222
+ const datasource = this.datasource();
2223
+ if (datasource && datasource instanceof UniServerSideDatasource) {
2224
+ // For server-side datasource, use the built-in loading state
2225
+ return datasource.isLoading();
2226
+ }
2227
+ else {
2228
+ // For client-side datasource, no loading state needed
2229
+ return false;
2230
+ }
2231
+ }, ...(ngDevMode ? [{ debugName: "isLoading" }] : /* istanbul ignore next */ []));
2232
+ toggleRow(index) {
2233
+ this.expandedIndex.update((current) => (current === index ? null : index));
2234
+ }
2235
+ handleRowClick(row, index) {
2236
+ this.rowClick.emit(row);
2237
+ this.toggleRow(index);
2238
+ }
2239
+ isHighlighted(row) {
2240
+ const callback = this.highlight && this.highlight();
2241
+ if (!callback)
2242
+ return false;
2243
+ return callback(row);
2244
+ }
2245
+ String = String;
2246
+ handleScrollable(scrollable) {
2247
+ this.scrollable.set(scrollable);
2248
+ }
2249
+ getBorder(name) {
2250
+ return name ? this.theme.theme().borders[name] : undefined;
2251
+ }
2252
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniDataTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2253
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: UniDataTableComponent, isStandalone: true, selector: "uni-data-table, DataTable", inputs: { datasource: { classPropertyName: "datasource", publicName: "datasource", isSignal: true, isRequired: true, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: true, transformFunction: null }, detailRowTemplate: { classPropertyName: "detailRowTemplate", publicName: "detailRowTemplate", isSignal: true, isRequired: false, transformFunction: null }, useMultiSelect: { classPropertyName: "useMultiSelect", publicName: "useMultiSelect", isSignal: true, isRequired: false, transformFunction: null }, useRowClick: { classPropertyName: "useRowClick", publicName: "useRowClick", isSignal: true, isRequired: false, transformFunction: null }, highlight: { classPropertyName: "highlight", publicName: "highlight", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { rowSelect: "rowSelect", rowClick: "rowClick" }, providers: [{ provide: COMPONENT_NAME, useValue: 'dataTable' }], usesInheritance: true, ngImport: i0, template: "@let ds = datasource();\n@if (ds) {\n <div\n box-layout\n [color]=\"componentOptions().color\"\n [border]=\"componentOptions().border\"\n [borderRadius]=\"componentOptions().borderRadius\"\n [elevation]=\"componentOptions().elevation\"\n overflow=\"hidden\"\n >\n <div\n box-layout\n [padding]=\"componentOptions().headerPadding\"\n [color]=\"componentOptions().headerColor\"\n [class]=\"headerClass\"\n >\n <ng-content select=\"data-table-header\"></ng-content>\n </div>\n\n <div box-layout [height]=\"height()\" position=\"relative\">\n <ScrollArea\n [verticalScrollPadding]=\"0\"\n (scrollable)=\"handleScrollable($event)\"\n >\n <table [class]=\"tableClass\">\n <thead>\n <tr>\n @for (column of columns(); track column) {\n <th\n [class]=\"thClass\"\n [class.scrollable]=\"scrollable()\"\n [class.sticky]=\"column.isSticky\"\n [style.text-align]=\"column.textAlign\"\n >\n <uni-sort-header\n [datasource]=\"datasource()\"\n [column]=\"column.columnDef\"\n >\n <Text [typeface]=\"componentOptions().thTextRole\">{{\n column.header\n }}</Text>\n </uni-sort-header>\n </th>\n }\n </tr>\n </thead>\n <tbody>\n @for (record of ds.records(); track record; let i = $index) {\n <tr [class]=\"trClass\" (click)=\"handleRowClick(record, $index)\">\n @for (column of columns(); track column) {\n <td\n [class]=\"tdClass\"\n [class.scrollable]=\"scrollable()\"\n [class.sticky]=\"column.isSticky\"\n [class.template]=\"!!column.template\"\n [style.text-align]=\"column.textAlign\"\n >\n @if (column.template) {\n <ng-container\n [ngTemplateOutlet]=\"column.template\"\n [ngTemplateOutletContext]=\"record\"\n ></ng-container>\n } @else {\n <Text [typeface]=\"componentOptions().tdTextRole\">\n @if (!column.cell) {\n {{ record[column.columnDef] }}\n } @else {\n {{ column.cell(record) }}\n }\n </Text>\n }\n </td>\n }\n </tr>\n @if (detailRowTemplate()) {\n <tr\n [class]=\"detailRowClass\"\n [class.expanded]=\"expandedIndex() === $index\"\n >\n <td [attr.colspan]=\"columns().length\">\n <div class=\"detail-content-wrapper\">\n <div class=\"detail-inner\">\n <ng-container\n [ngTemplateOutlet]=\"detailRowTemplate()\"\n [ngTemplateOutletContext]=\"{\n $implicit: record,\n index: i,\n }\"\n ></ng-container>\n </div>\n </div>\n </td>\n </tr>\n }\n }\n </tbody>\n </table>\n </ScrollArea>\n\n <!-- Loading Overlay -->\n @if (isLoading()) {\n <div\n uni-center-layout\n position=\"absolute\"\n [inset]=\"0\"\n [backgroundColor]=\"componentOptions().loadingOverlayColor\"\n [class]=\"loadingOverlayClass\"\n zIndex=\"overlay\"\n >\n <!-- Loading Spinner -->\n <div\n uni-box-layout\n [height]=\"componentOptions().loadingSpinnerSize\"\n [width]=\"componentOptions().loadingSpinnerSize\"\n >\n <uni-icon\n name=\"spinner\"\n [color]=\"componentOptions().loadingSpinnerColor\"\n />\n </div>\n </div>\n }\n </div>\n\n <div\n box-layout\n [padding]=\"componentOptions().footerPadding\"\n [color]=\"componentOptions().footerColor\"\n [class]=\"footerClass\"\n >\n <ng-content select=\"data-table-footer\"></ng-content>\n </div>\n </div>\n}\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: UniBoxComponent, selector: "div[uni-box-layout], Box, div[box-layout]", inputs: ["color", "backgroundColor", "borderRadius", "borderRadiusLeft", "borderRadiusRight", "borderRadiusTop", "borderRadiusBottom", "padding", "paddingHorizontal", "paddingVertical", "paddingLeft", "paddingRight", "paddingTop", "paddingBottom", "border", "borderTop", "borderBottom", "borderLeft", "borderRight", "dashBorder", "alignSelf", "alignItems", "alignContent", "justifyContent", "grow", "display", "position", "inset", "height", "minHeight", "maxHeight", "width", "minWidth", "maxWidth", "ignoreDir", "gridArea", "gridColumn", "gridRow", "overflow", "elevation", "shadow", "gap", "fullWidth", "fullHeight", "flexDirection", "textAlign", "wrapItems", "zIndex"] }, { kind: "component", type: UniScrollAreaComponent, selector: "div[uni-scroll-area], ScrollArea, div[scroll-area]", inputs: ["color", "borderRadius", "padding", "paddingHorizontal", "paddingVertical", "paddingLeft", "paddingRight", "paddingTop", "paddingBottom", "border", "height", "width", "appearance", "autoHeightDisabled", "verticalScrollPadding"], outputs: ["scrollable"] }, { kind: "component", type: UniTextComponent, selector: "uni-text, Text", inputs: ["typeface", "color", "display", "align", "nowrap", "maxWidth", "ellipsis"] }, { kind: "component", type: UniSortHeaderComponent, selector: "uni-sort-header", inputs: ["column", "datasource"] }, { kind: "component", type: UniIconComponent, selector: "uni-icon, Icon", inputs: ["color", "name"] }, { kind: "component", type: UniCenterComponent, selector: "div[uni-center-layout], div[center-layout]", inputs: ["display", "justifyContent", "alignItems"] }] });
2254
+ }
2255
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniDataTableComponent, decorators: [{
2256
+ type: Component,
2257
+ args: [{ selector: 'uni-data-table, DataTable', imports: [
2258
+ NgTemplateOutlet,
2259
+ UniBoxComponent,
2260
+ UniScrollAreaComponent,
2261
+ UniTextComponent,
2262
+ UniSortHeaderComponent,
2263
+ UniIconComponent,
2264
+ UniCenterComponent,
2265
+ ], providers: [{ provide: COMPONENT_NAME, useValue: 'dataTable' }], template: "@let ds = datasource();\n@if (ds) {\n <div\n box-layout\n [color]=\"componentOptions().color\"\n [border]=\"componentOptions().border\"\n [borderRadius]=\"componentOptions().borderRadius\"\n [elevation]=\"componentOptions().elevation\"\n overflow=\"hidden\"\n >\n <div\n box-layout\n [padding]=\"componentOptions().headerPadding\"\n [color]=\"componentOptions().headerColor\"\n [class]=\"headerClass\"\n >\n <ng-content select=\"data-table-header\"></ng-content>\n </div>\n\n <div box-layout [height]=\"height()\" position=\"relative\">\n <ScrollArea\n [verticalScrollPadding]=\"0\"\n (scrollable)=\"handleScrollable($event)\"\n >\n <table [class]=\"tableClass\">\n <thead>\n <tr>\n @for (column of columns(); track column) {\n <th\n [class]=\"thClass\"\n [class.scrollable]=\"scrollable()\"\n [class.sticky]=\"column.isSticky\"\n [style.text-align]=\"column.textAlign\"\n >\n <uni-sort-header\n [datasource]=\"datasource()\"\n [column]=\"column.columnDef\"\n >\n <Text [typeface]=\"componentOptions().thTextRole\">{{\n column.header\n }}</Text>\n </uni-sort-header>\n </th>\n }\n </tr>\n </thead>\n <tbody>\n @for (record of ds.records(); track record; let i = $index) {\n <tr [class]=\"trClass\" (click)=\"handleRowClick(record, $index)\">\n @for (column of columns(); track column) {\n <td\n [class]=\"tdClass\"\n [class.scrollable]=\"scrollable()\"\n [class.sticky]=\"column.isSticky\"\n [class.template]=\"!!column.template\"\n [style.text-align]=\"column.textAlign\"\n >\n @if (column.template) {\n <ng-container\n [ngTemplateOutlet]=\"column.template\"\n [ngTemplateOutletContext]=\"record\"\n ></ng-container>\n } @else {\n <Text [typeface]=\"componentOptions().tdTextRole\">\n @if (!column.cell) {\n {{ record[column.columnDef] }}\n } @else {\n {{ column.cell(record) }}\n }\n </Text>\n }\n </td>\n }\n </tr>\n @if (detailRowTemplate()) {\n <tr\n [class]=\"detailRowClass\"\n [class.expanded]=\"expandedIndex() === $index\"\n >\n <td [attr.colspan]=\"columns().length\">\n <div class=\"detail-content-wrapper\">\n <div class=\"detail-inner\">\n <ng-container\n [ngTemplateOutlet]=\"detailRowTemplate()\"\n [ngTemplateOutletContext]=\"{\n $implicit: record,\n index: i,\n }\"\n ></ng-container>\n </div>\n </div>\n </td>\n </tr>\n }\n }\n </tbody>\n </table>\n </ScrollArea>\n\n <!-- Loading Overlay -->\n @if (isLoading()) {\n <div\n uni-center-layout\n position=\"absolute\"\n [inset]=\"0\"\n [backgroundColor]=\"componentOptions().loadingOverlayColor\"\n [class]=\"loadingOverlayClass\"\n zIndex=\"overlay\"\n >\n <!-- Loading Spinner -->\n <div\n uni-box-layout\n [height]=\"componentOptions().loadingSpinnerSize\"\n [width]=\"componentOptions().loadingSpinnerSize\"\n >\n <uni-icon\n name=\"spinner\"\n [color]=\"componentOptions().loadingSpinnerColor\"\n />\n </div>\n </div>\n }\n </div>\n\n <div\n box-layout\n [padding]=\"componentOptions().footerPadding\"\n [color]=\"componentOptions().footerColor\"\n [class]=\"footerClass\"\n >\n <ng-content select=\"data-table-footer\"></ng-content>\n </div>\n </div>\n}\n" }]
2266
+ }], ctorParameters: () => [], propDecorators: { datasource: [{ type: i0.Input, args: [{ isSignal: true, alias: "datasource", required: true }] }], columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: true }] }], detailRowTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "detailRowTemplate", required: false }] }], useMultiSelect: [{ type: i0.Input, args: [{ isSignal: true, alias: "useMultiSelect", required: false }] }], useRowClick: [{ type: i0.Input, args: [{ isSignal: true, alias: "useRowClick", required: false }] }], highlight: [{ type: i0.Input, args: [{ isSignal: true, alias: "highlight", required: false }] }], height: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }], rowSelect: [{ type: i0.Output, args: ["rowSelect"] }], rowClick: [{ type: i0.Output, args: ["rowClick"] }] } });
2267
+
2268
+ /**
2269
+ * UniDataTableComponent Barrel File
2270
+ *
2271
+ * This file exports all public-facing elements of the data-table component.
2272
+ */
2273
+
2274
+ class UniDialogComponent extends BaseComponent {
2275
+ elem = inject(ElementRef);
2276
+ show = input(false, ...(ngDevMode ? [{ debugName: "show" }] : /* istanbul ignore next */ []));
2277
+ _show = linkedSignal(() => this.show(), ...(ngDevMode ? [{ debugName: "_show" }] : /* istanbul ignore next */ []));
2278
+ defaultCloseButton;
2279
+ showing = new EventEmitter();
2280
+ constructor() {
2281
+ super();
2282
+ effect(() => (this._show() ? this.open() : this.close()));
2283
+ }
2284
+ get _dialog() {
2285
+ return this.elem.nativeElement;
2286
+ }
2287
+ get className() {
2288
+ return css([
2289
+ {
2290
+ ...this.theme.radius(this.componentOptions().borderRadius),
2291
+ ...this.theme.colorPair(this.componentOptions().color),
2292
+ ...this.theme.border(this.componentOptions().border),
2293
+ ...this.theme.boxShadow(this.componentOptions().elevation),
2294
+ ...this.theme.padding(this.componentOptions().padding || 'none'),
2295
+ '&::backdrop': {
2296
+ ...this.componentOptions().backdrop,
2297
+ },
2298
+ '&[open], &::backdrop': {
2299
+ animation: `${this.dialogFadeIn} ease-in 350ms`,
2300
+ },
2301
+ '&[closing], &[closing]::backdrop': {
2302
+ animation: `${this.dialogFadeOut} ease-in 350ms`,
2303
+ },
2304
+ },
2305
+ ]);
2306
+ }
2307
+ BackdropClick(event) {
2308
+ if (event.target.nodeName === 'DIALOG') {
2309
+ this.close();
2310
+ }
2311
+ }
2312
+ ClosingAnimation(e) {
2313
+ // Close the dialog if the animation is finished
2314
+ if (e.animationName.includes(this.dialogFadeOut)) {
2315
+ this._dialog.close();
2316
+ this._dialog.removeAttribute('closing');
2317
+ this.showing.emit(false);
2318
+ }
2319
+ }
2320
+ closeButton = css({
2321
+ position: 'absolute',
2322
+ right: 12,
2323
+ top: 12,
2324
+ });
2325
+ dialogFadeIn = keyframes({ ...fadeIn });
2326
+ dialogFadeOut = keyframes({ ...fadeOut });
2327
+ open() {
2328
+ this._dialog.removeAttribute('closing');
2329
+ this._dialog.showModal();
2330
+ this._show.set(true);
2331
+ this.showing.emit(true);
2332
+ }
2333
+ close() {
2334
+ this._dialog.setAttribute('closing', 'true');
2335
+ this._show.set(false);
2336
+ }
2337
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2338
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: UniDialogComponent, isStandalone: true, selector: "dialog[uni-dialog], Dialog", inputs: { show: { classPropertyName: "show", publicName: "show", isSignal: true, isRequired: false, transformFunction: null }, defaultCloseButton: { classPropertyName: "defaultCloseButton", publicName: "defaultCloseButton", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { showing: "showing" }, host: { listeners: { "click": "BackdropClick($event)", "animationend": "ClosingAnimation($event)" }, properties: { "class": "this.className" } }, providers: [{ provide: COMPONENT_NAME, useValue: 'dialog' }], usesInheritance: true, ngImport: i0, template: `
2339
+ @if (defaultCloseButton) {
2340
+ <button
2341
+ icon-button
2342
+ iconName="close"
2343
+ variant="ghost"
2344
+ (click)="close()"
2345
+ [class]="closeButton"
2346
+ size="md"
2347
+ >
2348
+ Close
2349
+ </button>
2350
+ }
2351
+ <ng-content></ng-content>
2352
+ `, isInline: true, dependencies: [{ kind: "component", type: UniIconButtonComponent, selector: "button[uni-icon-button], button[icon-button]", inputs: ["iconName", "symbolName", "variant", "size", "disable", "loading", "opticalSize"] }, { kind: "ngmodule", type: CommonModule }] });
2353
+ }
2354
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniDialogComponent, decorators: [{
2355
+ type: Component,
2356
+ args: [{
2357
+ selector: 'dialog[uni-dialog], Dialog',
2358
+ standalone: true,
2359
+ imports: [UniIconButtonComponent, CommonModule],
2360
+ template: `
2361
+ @if (defaultCloseButton) {
2362
+ <button
2363
+ icon-button
2364
+ iconName="close"
2365
+ variant="ghost"
2366
+ (click)="close()"
2367
+ [class]="closeButton"
2368
+ size="md"
2369
+ >
2370
+ Close
2371
+ </button>
2372
+ }
2373
+ <ng-content></ng-content>
2374
+ `,
2375
+ providers: [{ provide: COMPONENT_NAME, useValue: 'dialog' }],
2376
+ }]
2377
+ }], ctorParameters: () => [], propDecorators: { show: [{ type: i0.Input, args: [{ isSignal: true, alias: "show", required: false }] }], defaultCloseButton: [{
2378
+ type: Input
2379
+ }], showing: [{
1639
2380
  type: Output
1640
2381
  }], className: [{
1641
2382
  type: HostBinding,
@@ -1911,70 +2652,692 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImpo
1911
2652
  args: ['dropdown', { static: true }]
1912
2653
  }] } });
1913
2654
 
1914
- class UniMenuItemComponent extends UniBoxComponent {
1915
- _elementRef = inject(ElementRef);
1916
- display = input('flex', ...(ngDevMode ? [{ debugName: "display" }] : /* istanbul ignore next */ []));
1917
- flexDirection = input('row', ...(ngDevMode ? [{ debugName: "flexDirection" }] : /* istanbul ignore next */ []));
1918
- alignItems = input('center', ...(ngDevMode ? [{ debugName: "alignItems" }] : /* istanbul ignore next */ []));
1919
- paddingHorizontal = input('md', ...(ngDevMode ? [{ debugName: "paddingHorizontal" }] : /* istanbul ignore next */ []));
1920
- gap = input('md', ...(ngDevMode ? [{ debugName: "gap" }] : /* istanbul ignore next */ []));
1921
- label = input(...(ngDevMode ? [undefined, { debugName: "label" }] : /* istanbul ignore next */ []));
1922
- template = input(...(ngDevMode ? [undefined, { debugName: "template" }] : /* istanbul ignore next */ []));
1923
- context = input(...(ngDevMode ? [undefined, { debugName: "context" }] : /* istanbul ignore next */ []));
1924
- symbolName = input(...(ngDevMode ? [undefined, { debugName: "symbolName" }] : /* istanbul ignore next */ []));
1925
- active = input(...(ngDevMode ? [undefined, { debugName: "active" }] : /* istanbul ignore next */ []));
1926
- hoverColor = input('primary-container', ...(ngDevMode ? [{ debugName: "hoverColor" }] : /* istanbul ignore next */ []));
1927
- disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
1928
- get className() {
1929
- return css([
1930
- {
1931
- cursor: 'pointer',
1932
- transition: 'all 0.35s ease',
1933
- height: 38,
1934
- '&:hover': {
1935
- ...this.theme.colorPair(this.hoverColor()),
1936
- },
1937
- },
1938
- ]);
1939
- }
1940
- focus() {
1941
- this._elementRef.nativeElement.focus();
2655
+ class UniExpandComponent {
2656
+ collapsed = model(true, ...(ngDevMode ? [{ debugName: "collapsed" }] : /* istanbul ignore next */ []));
2657
+ toggle() {
2658
+ this.collapsed.update((collapsed) => !collapsed);
1942
2659
  }
1943
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniMenuItemComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
1944
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: UniMenuItemComponent, isStandalone: true, selector: "div[uni-menu-item], div[menu-item]", inputs: { display: { classPropertyName: "display", publicName: "display", isSignal: true, isRequired: false, transformFunction: null }, flexDirection: { classPropertyName: "flexDirection", publicName: "flexDirection", isSignal: true, isRequired: false, transformFunction: null }, alignItems: { classPropertyName: "alignItems", publicName: "alignItems", isSignal: true, isRequired: false, transformFunction: null }, paddingHorizontal: { classPropertyName: "paddingHorizontal", publicName: "paddingHorizontal", isSignal: true, isRequired: false, transformFunction: null }, gap: { classPropertyName: "gap", publicName: "gap", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, template: { classPropertyName: "template", publicName: "template", isSignal: true, isRequired: false, transformFunction: null }, context: { classPropertyName: "context", publicName: "context", isSignal: true, isRequired: false, transformFunction: null }, symbolName: { classPropertyName: "symbolName", publicName: "symbolName", isSignal: true, isRequired: false, transformFunction: null }, active: { classPropertyName: "active", publicName: "active", isSignal: true, isRequired: false, transformFunction: null }, hoverColor: { classPropertyName: "hoverColor", publicName: "hoverColor", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "this.className" } }, usesInheritance: true, ngImport: i0, template: "@let tpl = template();\n@let symbol = symbolName();\n@if (symbol) {\n <Symbol [name]=\"symbol\"></Symbol>\n}\n<div box-layout [grow]=\"1\">\n @if (tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"context()\"></ng-container>\n } @else {\n <Text role=\"label\" display=\"block\" [nowrap]=\"true\">\n {{ label() }}\n </Text>\n }\n</div>\n@if (active()) {\n <Symbol name=\"check\"></Symbol>\n}\n", styles: [":host:focus{background:#ccc;color:#fff}:host.disabled{color:#ddd;pointer-events:none}\n"], dependencies: [{ kind: "component", type: UniTextComponent, selector: "uni-text, Text", inputs: ["typeface", "color", "display", "align", "nowrap", "maxWidth", "ellipsis"] }, { kind: "component", type: UniSymbolComponent, selector: "uni-symbol, Symbol", inputs: ["name", "fill", "weight", "grade", "opticalSize"] }, { kind: "component", type: UniBoxComponent, selector: "div[uni-box-layout], Box, div[box-layout]", inputs: ["color", "backgroundColor", "borderRadius", "borderRadiusLeft", "borderRadiusRight", "borderRadiusTop", "borderRadiusBottom", "padding", "paddingHorizontal", "paddingVertical", "paddingLeft", "paddingRight", "paddingTop", "paddingBottom", "border", "borderTop", "borderBottom", "borderLeft", "borderRight", "dashBorder", "alignSelf", "alignItems", "alignContent", "justifyContent", "grow", "display", "position", "inset", "height", "minHeight", "maxHeight", "width", "minWidth", "maxWidth", "ignoreDir", "gridArea", "gridColumn", "gridRow", "overflow", "elevation", "shadow", "gap", "fullWidth", "fullHeight", "flexDirection", "textAlign", "wrapItems", "zIndex"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
2660
+ expandClassName = css({
2661
+ display: 'grid',
2662
+ });
2663
+ contentClassName = css({
2664
+ minHeight: 0,
2665
+ });
2666
+ expand = keyframes({ ...expandFadeIn });
2667
+ collapse = keyframes({ ...collapseFadeOut });
2668
+ expandAnimation = css({
2669
+ overflow: 'hidden',
2670
+ animation: `${this.expand} ease-in 350ms`,
2671
+ });
2672
+ collapseAnimation = css({
2673
+ overflow: 'hidden',
2674
+ animation: `${this.collapse} ease-in 350ms`,
2675
+ });
2676
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniExpandComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2677
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: UniExpandComponent, isStandalone: true, selector: "uni-expand, Expand", inputs: { collapsed: { classPropertyName: "collapsed", publicName: "collapsed", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { collapsed: "collapsedChange" }, ngImport: i0, template: `@if (!collapsed()) {
2678
+ <div
2679
+ [animate.enter]="expandAnimation"
2680
+ [animate.leave]="collapseAnimation"
2681
+ [class]="expandClassName"
2682
+ >
2683
+ <div [class]="contentClassName">
2684
+ <ng-content></ng-content>
2685
+ </div>
2686
+ </div>
2687
+ }`, isInline: true });
1945
2688
  }
1946
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniMenuItemComponent, decorators: [{
2689
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniExpandComponent, decorators: [{
1947
2690
  type: Component,
1948
- args: [{ selector: 'div[uni-menu-item], div[menu-item]', standalone: true, imports: [UniTextComponent, UniSymbolComponent, UniBoxComponent, NgTemplateOutlet], template: "@let tpl = template();\n@let symbol = symbolName();\n@if (symbol) {\n <Symbol [name]=\"symbol\"></Symbol>\n}\n<div box-layout [grow]=\"1\">\n @if (tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"context()\"></ng-container>\n } @else {\n <Text role=\"label\" display=\"block\" [nowrap]=\"true\">\n {{ label() }}\n </Text>\n }\n</div>\n@if (active()) {\n <Symbol name=\"check\"></Symbol>\n}\n", styles: [":host:focus{background:#ccc;color:#fff}:host.disabled{color:#ddd;pointer-events:none}\n"] }]
1949
- }], propDecorators: { display: [{ type: i0.Input, args: [{ isSignal: true, alias: "display", required: false }] }], flexDirection: [{ type: i0.Input, args: [{ isSignal: true, alias: "flexDirection", required: false }] }], alignItems: [{ type: i0.Input, args: [{ isSignal: true, alias: "alignItems", required: false }] }], paddingHorizontal: [{ type: i0.Input, args: [{ isSignal: true, alias: "paddingHorizontal", required: false }] }], gap: [{ type: i0.Input, args: [{ isSignal: true, alias: "gap", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], template: [{ type: i0.Input, args: [{ isSignal: true, alias: "template", required: false }] }], context: [{ type: i0.Input, args: [{ isSignal: true, alias: "context", required: false }] }], symbolName: [{ type: i0.Input, args: [{ isSignal: true, alias: "symbolName", required: false }] }], active: [{ type: i0.Input, args: [{ isSignal: true, alias: "active", required: false }] }], hoverColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "hoverColor", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], className: [{
1950
- type: HostBinding,
1951
- args: ['class']
1952
- }] } });
2691
+ args: [{
2692
+ selector: 'uni-expand, Expand',
2693
+ standalone: true,
2694
+ imports: [],
2695
+ template: `@if (!collapsed()) {
2696
+ <div
2697
+ [animate.enter]="expandAnimation"
2698
+ [animate.leave]="collapseAnimation"
2699
+ [class]="expandClassName"
2700
+ >
2701
+ <div [class]="contentClassName">
2702
+ <ng-content></ng-content>
2703
+ </div>
2704
+ </div>
2705
+ }`,
2706
+ }]
2707
+ }], propDecorators: { collapsed: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsed", required: false }] }, { type: i0.Output, args: ["collapsedChange"] }] } });
1953
2708
 
1954
- class UniMenuComponent {
1955
- cdr = inject(ChangeDetectorRef);
1956
- // Modern Signal Inputs for perfect Zoneless tracking
1957
- menuItems = input.required(...(ngDevMode ? [{ debugName: "menuItems" }] : /* istanbul ignore next */ []));
1958
- activeItem = input(...(ngDevMode ? [undefined, { debugName: "activeItem" }] : /* istanbul ignore next */ []));
1959
- placement = input('bottom-start', ...(ngDevMode ? [{ debugName: "placement" }] : /* istanbul ignore next */ []));
1960
- // Modern Signal Output
1961
- menuItemClicked = output();
1962
- TriggerClassName = css({ display: 'inline-block' });
1963
- get className() {
1964
- return css({
1965
- margin: 'unset',
1966
- padding: 'unset',
1967
- });
1968
- }
1969
- handleMenuItemClick(item, dropdown) {
1970
- if (item.action) {
1971
- item.action();
1972
- }
1973
- this.menuItemClicked.emit(item);
1974
- dropdown.hideDropdown();
1975
- // Explicitly request a render tick if item.action() updated any internal state
1976
- this.cdr.markForCheck();
1977
- }
2709
+ /**
2710
+ * UniExpandComponent Barrel File
2711
+ *
2712
+ * This file exports all public-facing elements of the expand component.
2713
+ */
2714
+
2715
+ class UniTooltipComponent extends BaseComponent {
2716
+ elRef = inject(ElementRef);
2717
+ renderer = inject(Renderer2);
2718
+ timer = useTimer();
2719
+ hoverDelayMs = signal(500, ...(ngDevMode ? [{ debugName: "hoverDelayMs" }] : /* istanbul ignore next */ []));
2720
+ isMouseInside = signal(false, ...(ngDevMode ? [{ debugName: "isMouseInside" }] : /* istanbul ignore next */ []));
2721
+ tooltip;
2722
+ arrow;
2723
+ hoverDelay = input(500, ...(ngDevMode ? [{ debugName: "hoverDelay" }] : /* istanbul ignore next */ []));
2724
+ label = input.required(...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
2725
+ placement = input('top', ...(ngDevMode ? [{ debugName: "placement" }] : /* istanbul ignore next */ []));
2726
+ inlineText = input(false, ...(ngDevMode ? [{ debugName: "inlineText" }] : /* istanbul ignore next */ []));
2727
+ appendToBody;
2728
+ constructor() {
2729
+ super();
2730
+ effect(() => {
2731
+ const timerActive = this.timer.isActive();
2732
+ const mouseInside = this.isMouseInside();
2733
+ // If the timer finished and the mouse is still inside, show tooltip
2734
+ if (!timerActive && mouseInside) {
2735
+ this.showTooltip();
2736
+ }
2737
+ // If the mouse left and the timer is not running, hide tooltip
2738
+ else if (!mouseInside) {
2739
+ this.hideTooltip();
2740
+ }
2741
+ });
2742
+ }
2743
+ toggleTooltip() {
2744
+ if (this.tooltip) {
2745
+ this.hideTooltip();
2746
+ }
2747
+ else {
2748
+ this.showTooltip();
2749
+ }
2750
+ }
2751
+ mouseenter() {
2752
+ this.isMouseInside.set(true);
2753
+ this.timer.start(this.hoverDelayMs());
2754
+ }
2755
+ mouseleave() {
2756
+ this.isMouseInside.set(false);
2757
+ this.timer.stop();
2758
+ }
2759
+ showTooltip() {
2760
+ if (this.tooltip)
2761
+ return;
2762
+ this.initializeTooltip();
2763
+ this.renderer.setAttribute(this.tooltip, 'fade', 'in');
2764
+ }
2765
+ hideTooltip() {
2766
+ if (!this.tooltip)
2767
+ return;
2768
+ this.renderer.setAttribute(this.tooltip, 'fade', 'out');
2769
+ }
2770
+ get className() {
2771
+ return css({
2772
+ display: 'inline-flex',
2773
+ }, this.inlineText() && {
2774
+ cursor: 'help',
2775
+ textDecoration: 'underline',
2776
+ textDecorationStyle: 'dotted',
2777
+ });
2778
+ }
2779
+ tooltipFadeIn = keyframes({ ...fadeIn });
2780
+ tooltipFadeOut = keyframes({ ...fadeOut });
2781
+ tooltipClassName = css([
2782
+ {
2783
+ ...this.theme.colorPair(this.componentOptions().color),
2784
+ ...this.theme.radius(this.componentOptions().borderRadius),
2785
+ ...this.theme.boxShadow(this.componentOptions().shadow),
2786
+ ...this.theme.typeface(this.componentOptions().typeface),
2787
+ padding: 5,
2788
+ width: 'max-content',
2789
+ position: 'absolute',
2790
+ top: 0,
2791
+ left: 0,
2792
+ zIndex: Z_INDEX.tooltip,
2793
+ '&[fade="in"]': {
2794
+ animation: `${this.tooltipFadeIn} ease-in 350ms`,
2795
+ },
2796
+ '&[fade="out"]': {
2797
+ animation: `${this.tooltipFadeOut} ease-in 350ms`,
2798
+ },
2799
+ },
2800
+ ]);
2801
+ arrowClassName = css({
2802
+ position: 'absolute',
2803
+ ...this.theme.colorPair(this.componentOptions().color),
2804
+ width: 8,
2805
+ height: 8,
2806
+ transform: 'rotate(45deg)',
2807
+ });
2808
+ createTooltip() {
2809
+ this.tooltip = this.renderer.createElement('span');
2810
+ this.renderer.appendChild(this.tooltip, this.renderer.createText(this.label()) // textNode
2811
+ );
2812
+ this.renderer.appendChild(this.appendToBody ? document.body : this.elRef.nativeElement, this.tooltip);
2813
+ this.renderer.addClass(this.tooltip, this.tooltipClassName);
2814
+ this.renderer.listen(this.tooltip, 'animationend', (event) => {
2815
+ if (event.animationName.includes(this.tooltipFadeOut))
2816
+ this.destroyTooltip();
2817
+ });
2818
+ }
2819
+ createArrow() {
2820
+ this.arrow = this.renderer.createElement('div');
2821
+ this.renderer.appendChild(this.tooltip, this.arrow);
2822
+ this.renderer.addClass(this.arrow, this.arrowClassName);
2823
+ }
2824
+ setPosition() {
2825
+ if (!this.tooltip || !this.arrow)
2826
+ return;
2827
+ computePosition(this.elRef.nativeElement, this.tooltip, {
2828
+ placement: this.placement(),
2829
+ middleware: [offset(6), flip(), shift({ padding: 5 }), arrow({ element: this.arrow })],
2830
+ }).then(({ x, y, placement, middlewareData }) => {
2831
+ this.renderer.setStyle(this.tooltip, 'top', `${y}px`);
2832
+ this.renderer.setStyle(this.tooltip, 'left', `${x}px`);
2833
+ // Accessing the data
2834
+ const arrowX = middlewareData.arrow?.x;
2835
+ const arrowY = middlewareData.arrow?.y;
2836
+ const staticSide = {
2837
+ top: 'bottom',
2838
+ right: 'left',
2839
+ bottom: 'top',
2840
+ left: 'right',
2841
+ }[placement.split('-')[0]];
2842
+ this.renderer.setStyle(this.arrow, 'top', `${arrowY}px`);
2843
+ this.renderer.setStyle(this.arrow, 'left', `${arrowX}px`);
2844
+ this.renderer.setStyle(this.arrow, 'right', ``);
2845
+ this.renderer.setStyle(this.arrow, 'bottom', ``);
2846
+ if (staticSide) {
2847
+ this.renderer.setStyle(this.arrow, staticSide, `-4px`);
2848
+ }
2849
+ });
2850
+ }
2851
+ initializeTooltip() {
2852
+ this.createTooltip();
2853
+ this.createArrow();
2854
+ this.setPosition();
2855
+ }
2856
+ destroyTooltip() {
2857
+ this.renderer.removeChild(this.appendToBody ? document.body : this.elRef.nativeElement, this.tooltip);
2858
+ this.renderer.removeChild(this.appendToBody ? document.body : this.elRef.nativeElement, this.arrow);
2859
+ this.tooltip = null;
2860
+ this.arrow = null;
2861
+ }
2862
+ ngOnDestroy() {
2863
+ this.hideTooltip();
2864
+ }
2865
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniTooltipComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2866
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.12", type: UniTooltipComponent, isStandalone: true, selector: "uni-tooltip, Tooltip", inputs: { hoverDelay: { classPropertyName: "hoverDelay", publicName: "hoverDelay", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "placement", isSignal: true, isRequired: false, transformFunction: null }, inlineText: { classPropertyName: "inlineText", publicName: "inlineText", isSignal: true, isRequired: false, transformFunction: null }, appendToBody: { classPropertyName: "appendToBody", publicName: "appendToBody", isSignal: false, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "toggleTooltip()", "mouseenter": "mouseenter()", "mouseleave": "mouseleave()" }, properties: { "class": "this.className" } }, providers: [{ provide: COMPONENT_NAME, useValue: 'tooltip' }], usesInheritance: true, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true });
2867
+ }
2868
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniTooltipComponent, decorators: [{
2869
+ type: Component,
2870
+ args: [{
2871
+ selector: 'uni-tooltip, Tooltip',
2872
+ standalone: true,
2873
+ imports: [],
2874
+ template: `<ng-content></ng-content>`,
2875
+ providers: [{ provide: COMPONENT_NAME, useValue: 'tooltip' }],
2876
+ host: {
2877
+ '(click)': 'toggleTooltip()',
2878
+ '(mouseenter)': 'mouseenter()',
2879
+ '(mouseleave)': 'mouseleave()',
2880
+ },
2881
+ }]
2882
+ }], ctorParameters: () => [], propDecorators: { hoverDelay: [{ type: i0.Input, args: [{ isSignal: true, alias: "hoverDelay", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], placement: [{ type: i0.Input, args: [{ isSignal: true, alias: "placement", required: false }] }], inlineText: [{ type: i0.Input, args: [{ isSignal: true, alias: "inlineText", required: false }] }], appendToBody: [{
2883
+ type: Input
2884
+ }], className: [{
2885
+ type: HostBinding,
2886
+ args: ['class']
2887
+ }] } });
2888
+
2889
+ class UniExpandToggleComponent {
2890
+ collapsed = model(true, ...(ngDevMode ? [{ debugName: "collapsed" }] : /* istanbul ignore next */ []));
2891
+ get className() {
2892
+ return css({
2893
+ display: 'inline-flex',
2894
+ cursor: 'pointer',
2895
+ transition: 'transform 350ms ease-in-out',
2896
+ transform: 'rotate(0)',
2897
+ '&[toggled]': {
2898
+ transform: 'rotate(-180deg)',
2899
+ },
2900
+ });
2901
+ }
2902
+ toggle() {
2903
+ this.collapsed.update((collapsed) => !collapsed);
2904
+ }
2905
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniExpandToggleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2906
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.12", type: UniExpandToggleComponent, isStandalone: true, selector: "uni-expand-toggle, ExpandToggle", inputs: { collapsed: { classPropertyName: "collapsed", publicName: "collapsed", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { collapsed: "collapsedChange" }, host: { properties: { "attr.toggled": "collapsed() || null", "class": "this.className" } }, ngImport: i0, template: `<Tooltip
2907
+ [label]="collapsed() ? 'Expand' : 'Collapse'"
2908
+ placement="right"
2909
+ [appendToBody]="true"
2910
+ >
2911
+ <button icon-button iconName="chevronUp" (click)="toggle()">
2912
+ {{ collapsed() ? 'Expand' : 'Collapse' }}
2913
+ </button>
2914
+ </Tooltip>`, isInline: true, dependencies: [{ kind: "component", type: UniIconButtonComponent, selector: "button[uni-icon-button], button[icon-button]", inputs: ["iconName", "symbolName", "variant", "size", "disable", "loading", "opticalSize"] }, { kind: "component", type: UniTooltipComponent, selector: "uni-tooltip, Tooltip", inputs: ["hoverDelay", "label", "placement", "inlineText", "appendToBody"] }] });
2915
+ }
2916
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniExpandToggleComponent, decorators: [{
2917
+ type: Component,
2918
+ args: [{
2919
+ selector: 'uni-expand-toggle, ExpandToggle',
2920
+ standalone: true,
2921
+ imports: [UniIconButtonComponent, UniTooltipComponent],
2922
+ template: `<Tooltip
2923
+ [label]="collapsed() ? 'Expand' : 'Collapse'"
2924
+ placement="right"
2925
+ [appendToBody]="true"
2926
+ >
2927
+ <button icon-button iconName="chevronUp" (click)="toggle()">
2928
+ {{ collapsed() ? 'Expand' : 'Collapse' }}
2929
+ </button>
2930
+ </Tooltip>`,
2931
+ host: {
2932
+ '[attr.toggled]': 'collapsed() || null',
2933
+ },
2934
+ }]
2935
+ }], propDecorators: { collapsed: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsed", required: false }] }, { type: i0.Output, args: ["collapsedChange"] }], className: [{
2936
+ type: HostBinding,
2937
+ args: ['class']
2938
+ }] } });
2939
+
2940
+ class UniExpandAreaComponent {
2941
+ title = input.required(...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
2942
+ initCollapsed = input(false, ...(ngDevMode ? [{ debugName: "initCollapsed" }] : /* istanbul ignore next */ []));
2943
+ padding = input('md', ...(ngDevMode ? [{ debugName: "padding" }] : /* istanbul ignore next */ []));
2944
+ collapsed = output();
2945
+ toggleRef = viewChild.required('toggle');
2946
+ toggleExpand() {
2947
+ this.toggleRef().toggle();
2948
+ }
2949
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniExpandAreaComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2950
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.12", type: UniExpandAreaComponent, isStandalone: true, selector: "uni-expand-area, ExpandArea", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, initCollapsed: { classPropertyName: "initCollapsed", publicName: "initCollapsed", isSignal: true, isRequired: false, transformFunction: null }, padding: { classPropertyName: "padding", publicName: "padding", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { collapsed: "collapsed" }, viewQueries: [{ propertyName: "toggleRef", first: true, predicate: ["toggle"], descendants: true, isSignal: true }], ngImport: i0, template: `
2951
+ <Box
2952
+ color="tertiary-surface"
2953
+ borderRadius="sm"
2954
+ border="quaternary"
2955
+ overflow="hidden"
2956
+ >
2957
+ <Box
2958
+ border="quaternary"
2959
+ borderRadius="sm"
2960
+ color="primary-surface"
2961
+ style="margin-top: -1px; margin-left: -1px; margin-right: -1px"
2962
+ [style.margin-bottom]="toggle.collapsed() ? '-1px' : 0"
2963
+ justifyContent="space-between"
2964
+ display="flex"
2965
+ alignItems="center"
2966
+ >
2967
+ <Box [width]="36"></Box>
2968
+ <Box paddingHorizontal="md">
2969
+ <Text typeface="title-small" display="block">
2970
+ {{ title() }}
2971
+ </Text>
2972
+ </Box>
2973
+
2974
+ <ExpandToggle
2975
+ #toggle
2976
+ style="display: inline-flex; margin: -2px"
2977
+ [collapsed]="initCollapsed()"
2978
+ />
2979
+ </Box>
2980
+
2981
+ <Expand [collapsed]="toggle.collapsed()">
2982
+ <Box [padding]="padding()">
2983
+ <ng-content></ng-content>
2984
+ </Box>
2985
+ </Expand>
2986
+ </Box>
2987
+ `, isInline: true, dependencies: [{ kind: "component", type: UniBoxComponent, selector: "div[uni-box-layout], Box, div[box-layout]", inputs: ["color", "backgroundColor", "borderRadius", "borderRadiusLeft", "borderRadiusRight", "borderRadiusTop", "borderRadiusBottom", "padding", "paddingHorizontal", "paddingVertical", "paddingLeft", "paddingRight", "paddingTop", "paddingBottom", "border", "borderTop", "borderBottom", "borderLeft", "borderRight", "dashBorder", "alignSelf", "alignItems", "alignContent", "justifyContent", "grow", "display", "position", "inset", "height", "minHeight", "maxHeight", "width", "minWidth", "maxWidth", "ignoreDir", "gridArea", "gridColumn", "gridRow", "overflow", "elevation", "shadow", "gap", "fullWidth", "fullHeight", "flexDirection", "textAlign", "wrapItems", "zIndex"] }, { kind: "component", type: UniTextComponent, selector: "uni-text, Text", inputs: ["typeface", "color", "display", "align", "nowrap", "maxWidth", "ellipsis"] }, { kind: "component", type: UniExpandToggleComponent, selector: "uni-expand-toggle, ExpandToggle", inputs: ["collapsed"], outputs: ["collapsedChange"] }, { kind: "component", type: UniExpandComponent, selector: "uni-expand, Expand", inputs: ["collapsed"], outputs: ["collapsedChange"] }] });
2988
+ }
2989
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniExpandAreaComponent, decorators: [{
2990
+ type: Component,
2991
+ args: [{
2992
+ selector: 'uni-expand-area, ExpandArea',
2993
+ standalone: true,
2994
+ imports: [UniBoxComponent, UniTextComponent, UniExpandToggleComponent, UniExpandComponent],
2995
+ template: `
2996
+ <Box
2997
+ color="tertiary-surface"
2998
+ borderRadius="sm"
2999
+ border="quaternary"
3000
+ overflow="hidden"
3001
+ >
3002
+ <Box
3003
+ border="quaternary"
3004
+ borderRadius="sm"
3005
+ color="primary-surface"
3006
+ style="margin-top: -1px; margin-left: -1px; margin-right: -1px"
3007
+ [style.margin-bottom]="toggle.collapsed() ? '-1px' : 0"
3008
+ justifyContent="space-between"
3009
+ display="flex"
3010
+ alignItems="center"
3011
+ >
3012
+ <Box [width]="36"></Box>
3013
+ <Box paddingHorizontal="md">
3014
+ <Text typeface="title-small" display="block">
3015
+ {{ title() }}
3016
+ </Text>
3017
+ </Box>
3018
+
3019
+ <ExpandToggle
3020
+ #toggle
3021
+ style="display: inline-flex; margin: -2px"
3022
+ [collapsed]="initCollapsed()"
3023
+ />
3024
+ </Box>
3025
+
3026
+ <Expand [collapsed]="toggle.collapsed()">
3027
+ <Box [padding]="padding()">
3028
+ <ng-content></ng-content>
3029
+ </Box>
3030
+ </Expand>
3031
+ </Box>
3032
+ `,
3033
+ }]
3034
+ }], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: true }] }], initCollapsed: [{ type: i0.Input, args: [{ isSignal: true, alias: "initCollapsed", required: false }] }], padding: [{ type: i0.Input, args: [{ isSignal: true, alias: "padding", required: false }] }], collapsed: [{ type: i0.Output, args: ["collapsed"] }], toggleRef: [{ type: i0.ViewChild, args: ['toggle', { isSignal: true }] }] } });
3035
+
3036
+ /**
3037
+ * UniExpandAreaComponent Barrel File
3038
+ *
3039
+ * This file exports all public-facing elements of the expand-area component.
3040
+ */
3041
+
3042
+ /**
3043
+ * UniExpandToggleComponent Barrel File
3044
+ *
3045
+ * This file exports all public-facing elements of the expand-toggle component.
3046
+ */
3047
+
3048
+ class UniFileDropZoneComponent {
3049
+ selectedFile = signal(undefined, ...(ngDevMode ? [{ debugName: "selectedFile" }] : /* istanbul ignore next */ []));
3050
+ selectedFileName = computed(() => this.selectedFile()?.name, ...(ngDevMode ? [{ debugName: "selectedFileName" }] : /* istanbul ignore next */ []));
3051
+ attachmentState = signal(undefined, ...(ngDevMode ? [{ debugName: "attachmentState" }] : /* istanbul ignore next */ []));
3052
+ fileSelectorRef = viewChild.required('fileSelector');
3053
+ get fileSelectorElement() {
3054
+ return this.fileSelectorRef().nativeElement;
3055
+ }
3056
+ height = input(...(ngDevMode ? [undefined, { debugName: "height" }] : /* istanbul ignore next */ []));
3057
+ borderRadius = input('md', ...(ngDevMode ? [{ debugName: "borderRadius" }] : /* istanbul ignore next */ []));
3058
+ border = input('light', ...(ngDevMode ? [{ debugName: "border" }] : /* istanbul ignore next */ []));
3059
+ padding = input('lg', ...(ngDevMode ? [{ debugName: "padding" }] : /* istanbul ignore next */ []));
3060
+ useBrowseButton = input(false, ...(ngDevMode ? [{ debugName: "useBrowseButton" }] : /* istanbul ignore next */ []));
3061
+ browseButtonText = input('Browse for file', ...(ngDevMode ? [{ debugName: "browseButtonText" }] : /* istanbul ignore next */ []));
3062
+ allowedFileExtensions = input([], ...(ngDevMode ? [{ debugName: "allowedFileExtensions" }] : /* istanbul ignore next */ []));
3063
+ label = input(...(ngDevMode ? [undefined, { debugName: "label" }] : /* istanbul ignore next */ []));
3064
+ helpTemplate = input(null, ...(ngDevMode ? [{ debugName: "helpTemplate" }] : /* istanbul ignore next */ []));
3065
+ helpTemplateContext = input(null, ...(ngDevMode ? [{ debugName: "helpTemplateContext" }] : /* istanbul ignore next */ []));
3066
+ fileAttached = output();
3067
+ fileRemoved = output();
3068
+ sanitizedFileExtensions = computed(() => this.allowedFileExtensions().map((ext) => (ext.includes('.') ? ext : '.' + ext)), ...(ngDevMode ? [{ debugName: "sanitizedFileExtensions" }] : /* istanbul ignore next */ []));
3069
+ helpText = computed(() => {
3070
+ const extensions = this.sanitizedFileExtensions();
3071
+ let text = '';
3072
+ if (extensions.length === 1) {
3073
+ text = `${extensions[0]} format allowed`;
3074
+ }
3075
+ if (extensions.length > 1) {
3076
+ text = extensions.join(', ') + ' formats allowed';
3077
+ }
3078
+ return text;
3079
+ }, ...(ngDevMode ? [{ debugName: "helpText" }] : /* istanbul ignore next */ []));
3080
+ constructor() {
3081
+ effect(() => {
3082
+ const files = this.selectedFile();
3083
+ if (files) {
3084
+ this.attachmentState.set('upload');
3085
+ }
3086
+ else {
3087
+ this.attachmentState.set(undefined);
3088
+ }
3089
+ });
3090
+ }
3091
+ openFileSelector() {
3092
+ this.fileSelectorElement.click();
3093
+ }
3094
+ selectFiles(fileList) {
3095
+ if (!fileList)
3096
+ return;
3097
+ if (!acceptableFile(fileList[0], this.sanitizedFileExtensions()))
3098
+ return;
3099
+ this.selectedFile.set(fileList[0]);
3100
+ this.fileAttached.emit(fileList[0]);
3101
+ }
3102
+ onFileInputChange() {
3103
+ this.selectFiles(this.fileSelectorElement.files);
3104
+ this.fileSelectorElement.value = '';
3105
+ }
3106
+ cancelUpload() {
3107
+ this.selectedFile.set(undefined);
3108
+ this.fileAttached.emit(undefined);
3109
+ this.fileRemoved.emit();
3110
+ }
3111
+ removeAttachment() {
3112
+ this.selectedFile.set(undefined);
3113
+ }
3114
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniFileDropZoneComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3115
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: UniFileDropZoneComponent, isStandalone: true, selector: "uni-file-drop-zone", inputs: { height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, borderRadius: { classPropertyName: "borderRadius", publicName: "borderRadius", isSignal: true, isRequired: false, transformFunction: null }, border: { classPropertyName: "border", publicName: "border", isSignal: true, isRequired: false, transformFunction: null }, padding: { classPropertyName: "padding", publicName: "padding", isSignal: true, isRequired: false, transformFunction: null }, useBrowseButton: { classPropertyName: "useBrowseButton", publicName: "useBrowseButton", isSignal: true, isRequired: false, transformFunction: null }, browseButtonText: { classPropertyName: "browseButtonText", publicName: "browseButtonText", isSignal: true, isRequired: false, transformFunction: null }, allowedFileExtensions: { classPropertyName: "allowedFileExtensions", publicName: "allowedFileExtensions", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, helpTemplate: { classPropertyName: "helpTemplate", publicName: "helpTemplate", isSignal: true, isRequired: false, transformFunction: null }, helpTemplateContext: { classPropertyName: "helpTemplateContext", publicName: "helpTemplateContext", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { fileAttached: "fileAttached", fileRemoved: "fileRemoved" }, viewQueries: [{ propertyName: "fileSelectorRef", first: true, predicate: ["fileSelector"], descendants: true, isSignal: true }], ngImport: i0, template: "<div\n box-layout\n [border]=\"border()\"\n [borderRadius]=\"borderRadius()\"\n [dashBorder]=\"[undefined, 'replace'].includes(attachmentState())\"\n display=\"flex\"\n alignItems=\"center\"\n justifyContent=\"center\"\n [padding]=\"padding()\"\n dragAndDrop\n (onFileDropped)=\"selectFiles($event)\"\n [height]=\"height()\"\n>\n <div stack-layout gap=\"md\" alignItems=\"center\">\n @switch (attachmentState()) {\n @case ('upload') {\n <div stack-layout alignItems=\"center\">\n <Text typeface=\"headline-small\">{{ label() }}</Text>\n <Text typeface=\"title-small\">{{ selectedFileName() }}</Text>\n </div>\n <button text-button (click)=\"removeAttachment()\" variant=\"warn\">\n Cancel\n </button>\n }\n\n @default {\n @if (useBrowseButton()) {\n <button text-button (click)=\"openFileSelector()\">\n {{ browseButtonText() }}\n </button>\n <Text>OR</Text>\n }\n\n @if (!helpTemplate()) {\n <div stack-layout alignItems=\"center\">\n <Text typeface=\"headline-small\">Drag and drop the file here</Text>\n @if (helpText()) {\n <Text typeface=\"title-small\">{{ helpText() }}</Text>\n }\n </div>\n } @else {\n <ng-container\n [ngTemplateOutlet]=\"helpTemplate()\"\n [ngTemplateOutletContext]=\"helpTemplateContext()\"\n ></ng-container>\n }\n }\n }\n </div>\n\n <input\n #fileSelector\n type=\"file\"\n style=\"display: none\"\n (change)=\"onFileInputChange()\"\n [accept]=\"sanitizedFileExtensions().join(',')\"\n [multiple]=\"false\"\n />\n</div>\n", dependencies: [{ kind: "directive", type: DragAndDropDirective, selector: "[uni-drag-n-drop], [dragAndDrop]", outputs: ["onFileDropped"] }, { kind: "component", type: UniBoxComponent, selector: "div[uni-box-layout], Box, div[box-layout]", inputs: ["color", "backgroundColor", "borderRadius", "borderRadiusLeft", "borderRadiusRight", "borderRadiusTop", "borderRadiusBottom", "padding", "paddingHorizontal", "paddingVertical", "paddingLeft", "paddingRight", "paddingTop", "paddingBottom", "border", "borderTop", "borderBottom", "borderLeft", "borderRight", "dashBorder", "alignSelf", "alignItems", "alignContent", "justifyContent", "grow", "display", "position", "inset", "height", "minHeight", "maxHeight", "width", "minWidth", "maxWidth", "ignoreDir", "gridArea", "gridColumn", "gridRow", "overflow", "elevation", "shadow", "gap", "fullWidth", "fullHeight", "flexDirection", "textAlign", "wrapItems", "zIndex"] }, { kind: "component", type: UniButtonComponent, selector: "button[uni-text-button], Button, button[text-button]", inputs: ["disable", "loading", "fullWidth", "symbolLeft", "symbolRight"] }, { kind: "component", type: UniStackComponent, selector: "div[uni-stack-layout], Stack, div[stack-layout]", inputs: ["display", "flexDirection", "minHeight"] }, { kind: "component", type: UniTextComponent, selector: "uni-text, Text", inputs: ["typeface", "color", "display", "align", "nowrap", "maxWidth", "ellipsis"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
3116
+ }
3117
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniFileDropZoneComponent, decorators: [{
3118
+ type: Component,
3119
+ args: [{ selector: 'uni-file-drop-zone', imports: [
3120
+ DragAndDropDirective,
3121
+ UniBoxComponent,
3122
+ UniButtonComponent,
3123
+ UniStackComponent,
3124
+ UniTextComponent,
3125
+ NgTemplateOutlet,
3126
+ ], standalone: true, template: "<div\n box-layout\n [border]=\"border()\"\n [borderRadius]=\"borderRadius()\"\n [dashBorder]=\"[undefined, 'replace'].includes(attachmentState())\"\n display=\"flex\"\n alignItems=\"center\"\n justifyContent=\"center\"\n [padding]=\"padding()\"\n dragAndDrop\n (onFileDropped)=\"selectFiles($event)\"\n [height]=\"height()\"\n>\n <div stack-layout gap=\"md\" alignItems=\"center\">\n @switch (attachmentState()) {\n @case ('upload') {\n <div stack-layout alignItems=\"center\">\n <Text typeface=\"headline-small\">{{ label() }}</Text>\n <Text typeface=\"title-small\">{{ selectedFileName() }}</Text>\n </div>\n <button text-button (click)=\"removeAttachment()\" variant=\"warn\">\n Cancel\n </button>\n }\n\n @default {\n @if (useBrowseButton()) {\n <button text-button (click)=\"openFileSelector()\">\n {{ browseButtonText() }}\n </button>\n <Text>OR</Text>\n }\n\n @if (!helpTemplate()) {\n <div stack-layout alignItems=\"center\">\n <Text typeface=\"headline-small\">Drag and drop the file here</Text>\n @if (helpText()) {\n <Text typeface=\"title-small\">{{ helpText() }}</Text>\n }\n </div>\n } @else {\n <ng-container\n [ngTemplateOutlet]=\"helpTemplate()\"\n [ngTemplateOutletContext]=\"helpTemplateContext()\"\n ></ng-container>\n }\n }\n }\n </div>\n\n <input\n #fileSelector\n type=\"file\"\n style=\"display: none\"\n (change)=\"onFileInputChange()\"\n [accept]=\"sanitizedFileExtensions().join(',')\"\n [multiple]=\"false\"\n />\n</div>\n" }]
3127
+ }], ctorParameters: () => [], propDecorators: { fileSelectorRef: [{ type: i0.ViewChild, args: ['fileSelector', { isSignal: true }] }], height: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }], borderRadius: [{ type: i0.Input, args: [{ isSignal: true, alias: "borderRadius", required: false }] }], border: [{ type: i0.Input, args: [{ isSignal: true, alias: "border", required: false }] }], padding: [{ type: i0.Input, args: [{ isSignal: true, alias: "padding", required: false }] }], useBrowseButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "useBrowseButton", required: false }] }], browseButtonText: [{ type: i0.Input, args: [{ isSignal: true, alias: "browseButtonText", required: false }] }], allowedFileExtensions: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowedFileExtensions", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], helpTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "helpTemplate", required: false }] }], helpTemplateContext: [{ type: i0.Input, args: [{ isSignal: true, alias: "helpTemplateContext", required: false }] }], fileAttached: [{ type: i0.Output, args: ["fileAttached"] }], fileRemoved: [{ type: i0.Output, args: ["fileRemoved"] }] } });
3128
+
3129
+ /**
3130
+ * UniFileDropZoneComponent Barrel File
3131
+ *
3132
+ * This file exports all public-facing elements of the file-drop-zone component.
3133
+ */
3134
+
3135
+ class UniDebounceInputComponent {
3136
+ inputName = input(...(ngDevMode ? [undefined, { debugName: "inputName" }] : /* istanbul ignore next */ []));
3137
+ inputId = input(...(ngDevMode ? [undefined, { debugName: "inputId" }] : /* istanbul ignore next */ []));
3138
+ debounceTime = input(400, ...(ngDevMode ? [{ debugName: "debounceTime" }] : /* istanbul ignore next */ []));
3139
+ change = output();
3140
+ value = signal(undefined, ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
3141
+ timeoutId = null;
3142
+ lastEmitted;
3143
+ constructor() {
3144
+ inject(DestroyRef).onDestroy(() => {
3145
+ if (this.timeoutId)
3146
+ clearTimeout(this.timeoutId);
3147
+ });
3148
+ }
3149
+ handleInput(value) {
3150
+ this.value.set(value);
3151
+ // Debounce, emitting only when the value actually changed.
3152
+ if (this.timeoutId)
3153
+ clearTimeout(this.timeoutId);
3154
+ this.timeoutId = setTimeout(() => {
3155
+ if (value !== this.lastEmitted) {
3156
+ this.lastEmitted = value;
3157
+ this.change.emit(value);
3158
+ }
3159
+ }, this.debounceTime());
3160
+ }
3161
+ inputClass = css({
3162
+ border: 'none',
3163
+ fontSize: 18,
3164
+ width: '100%',
3165
+ '&:focus-visible': {
3166
+ outline: 'none',
3167
+ },
3168
+ });
3169
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniDebounceInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3170
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.12", type: UniDebounceInputComponent, isStandalone: true, selector: "DebounceInput, uni-debounce-input", inputs: { inputName: { classPropertyName: "inputName", publicName: "inputName", isSignal: true, isRequired: false, transformFunction: null }, inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null }, debounceTime: { classPropertyName: "debounceTime", publicName: "debounceTime", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { change: "change" }, ngImport: i0, template: "<input\n [class]=\"inputClass\"\n type=\"text\"\n [name]=\"inputName()\"\n [id]=\"inputId()\"\n [value]=\"value() ?? ''\"\n (input)=\"handleInput($any($event.target).value)\"\n/>\n" });
3171
+ }
3172
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniDebounceInputComponent, decorators: [{
3173
+ type: Component,
3174
+ args: [{ selector: 'DebounceInput, uni-debounce-input', standalone: true, imports: [], template: "<input\n [class]=\"inputClass\"\n type=\"text\"\n [name]=\"inputName()\"\n [id]=\"inputId()\"\n [value]=\"value() ?? ''\"\n (input)=\"handleInput($any($event.target).value)\"\n/>\n" }]
3175
+ }], ctorParameters: () => [], propDecorators: { inputName: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputName", required: false }] }], inputId: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputId", required: false }] }], debounceTime: [{ type: i0.Input, args: [{ isSignal: true, alias: "debounceTime", required: false }] }], change: [{ type: i0.Output, args: ["change"] }] } });
3176
+
3177
+ class UniInputBoxComponent extends BaseComponent {
3178
+ className = css({ display: 'contents' });
3179
+ disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
3180
+ error = input(false, ...(ngDevMode ? [{ debugName: "error" }] : /* istanbul ignore next */ []));
3181
+ minWidth = input('0', ...(ngDevMode ? [{ debugName: "minWidth" }] : /* istanbul ignore next */ []));
3182
+ color = computed(() => this.error() ? this.componentOptions().errorColor : this.componentOptions().color, ...(ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []));
3183
+ border = computed(() => this.error() ? this.componentOptions().errorBorder : this.componentOptions().border, ...(ngDevMode ? [{ debugName: "border" }] : /* istanbul ignore next */ []));
3184
+ shadow = computed(() => this.error() ? this.componentOptions().errorShadow : this.componentOptions().shadow, ...(ngDevMode ? [{ debugName: "shadow" }] : /* istanbul ignore next */ []));
3185
+ inputBoxClass = computed(() => css([
3186
+ this.disabled() && {
3187
+ ...this.theme.color(this.componentOptions().disabledTextColor),
3188
+ ...this.theme.backgroundColor(this.componentOptions().disabledColor),
3189
+ cursor: 'not-allowed !important',
3190
+ },
3191
+ {
3192
+ '& input, select': {
3193
+ ...removeInputPlatformStyling,
3194
+ height: '100%',
3195
+ ...this.theme.paddingLeft(this.componentOptions().paddingLeft),
3196
+ ...this.theme.color(this.componentOptions().textColor),
3197
+ ...this.theme.typeface(this.componentOptions().typeFace),
3198
+ },
3199
+ '&:has(input:disabled, select:disabled)': {
3200
+ ...this.theme.color(this.componentOptions().disabledTextColor),
3201
+ ...this.theme.backgroundColor(this.componentOptions().disabledColor),
3202
+ },
3203
+ '& input:disabled, select:disabled': {
3204
+ cursor: 'not-allowed !important',
3205
+ },
3206
+ '&:has(input:focus, select:focus)': {
3207
+ outline: this.componentOptions().focusOutline,
3208
+ outlineOffset: this.componentOptions().focusOutlineOffset,
3209
+ },
3210
+ },
3211
+ ]), ...(ngDevMode ? [{ debugName: "inputBoxClass" }] : /* istanbul ignore next */ []));
3212
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniInputBoxComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
3213
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.12", type: UniInputBoxComponent, isStandalone: true, selector: "uni-input-box", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, minWidth: { classPropertyName: "minWidth", publicName: "minWidth", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "this.className" } }, providers: [{ provide: COMPONENT_NAME, useValue: 'input' }], usesInheritance: true, ngImport: i0, template: "<div\n row-layout\n alignItems=\"center\"\n [height]=\"componentOptions().height\"\n [color]=\"color()\"\n [border]=\"border()\"\n [borderRadius]=\"componentOptions().borderRadius\"\n [shadow]=\"shadow()\"\n [minWidth]=\"minWidth()\"\n [class]=\"inputBoxClass()\"\n position=\"relative\"\n>\n <ng-content></ng-content>\n</div>\n", dependencies: [{ kind: "component", type: UniRowComponent, selector: "div[uni-row-layout], Row, div[row-layout]", inputs: ["display", "flexDirection", "minWidth"] }] });
3214
+ }
3215
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniInputBoxComponent, decorators: [{
3216
+ type: Component,
3217
+ args: [{ selector: 'uni-input-box', imports: [UniRowComponent], providers: [{ provide: COMPONENT_NAME, useValue: 'input' }], template: "<div\n row-layout\n alignItems=\"center\"\n [height]=\"componentOptions().height\"\n [color]=\"color()\"\n [border]=\"border()\"\n [borderRadius]=\"componentOptions().borderRadius\"\n [shadow]=\"shadow()\"\n [minWidth]=\"minWidth()\"\n [class]=\"inputBoxClass()\"\n position=\"relative\"\n>\n <ng-content></ng-content>\n</div>\n" }]
3218
+ }], propDecorators: { className: [{
3219
+ type: HostBinding,
3220
+ args: ['class']
3221
+ }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], minWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "minWidth", required: false }] }] } });
3222
+
3223
+ class UniInputComponent {
3224
+ // --- REQUIRED SIGNALS (populated by FormValueControl) ---
3225
+ value = model('', ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
3226
+ disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
3227
+ touched = model(false, ...(ngDevMode ? [{ debugName: "touched" }] : /* istanbul ignore next */ []));
3228
+ invalid = input(false, ...(ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []));
3229
+ dirty = input(false, ...(ngDevMode ? [{ debugName: "dirty" }] : /* istanbul ignore next */ []));
3230
+ // --- CONFIGURATION ---
3231
+ label = input.required(...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
3232
+ placeholder = input('', ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
3233
+ // Only show errors if the user has actually interacted with the field
3234
+ showError = computed(() => this.invalid() && (this.touched() || this.dirty()), ...(ngDevMode ? [{ debugName: "showError" }] : /* istanbul ignore next */ []));
3235
+ markAsTouched() {
3236
+ this.touched.set(true);
3237
+ }
3238
+ inputClass = css({});
3239
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3240
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.12", type: UniInputComponent, isStandalone: true, selector: "uni-input", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, dirty: { classPropertyName: "dirty", publicName: "dirty", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", touched: "touchedChange" }, ngImport: i0, template: "<uni-input-box [error]=\"showError()\">\n <ng-content select=\"pre-input\" />\n <input\n [value]=\"value()\"\n (input)=\"value.set($any($event.target).value)\"\n [placeholder]=\"placeholder()\"\n [disabled]=\"disabled()\"\n (blur)=\"markAsTouched()\"\n [class]=\"inputClass\"\n />\n <ng-content select=\"post-input\" />\n</uni-input-box>\n", dependencies: [{ kind: "component", type: UniInputBoxComponent, selector: "uni-input-box", inputs: ["disabled", "error", "minWidth"] }] });
3241
+ }
3242
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniInputComponent, decorators: [{
3243
+ type: Component,
3244
+ args: [{ selector: 'uni-input', imports: [UniInputBoxComponent], template: "<uni-input-box [error]=\"showError()\">\n <ng-content select=\"pre-input\" />\n <input\n [value]=\"value()\"\n (input)=\"value.set($any($event.target).value)\"\n [placeholder]=\"placeholder()\"\n [disabled]=\"disabled()\"\n (blur)=\"markAsTouched()\"\n [class]=\"inputClass\"\n />\n <ng-content select=\"post-input\" />\n</uni-input-box>\n" }]
3245
+ }], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }, { type: i0.Output, args: ["touchedChange"] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], dirty: [{ type: i0.Input, args: [{ isSignal: true, alias: "dirty", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }] } });
3246
+
3247
+ class UniJsonViewComponent {
3248
+ json = input(...(ngDevMode ? [undefined, { debugName: "json" }] : /* istanbul ignore next */ []));
3249
+ rows = input(6, ...(ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []));
3250
+ fontSize = input('medium', ...(ngDevMode ? [{ debugName: "fontSize" }] : /* istanbul ignore next */ []));
3251
+ width = input('100%', ...(ngDevMode ? [{ debugName: "width" }] : /* istanbul ignore next */ []));
3252
+ selectOnClick = input(true, ...(ngDevMode ? [{ debugName: "selectOnClick" }] : /* istanbul ignore next */ []));
3253
+ jsonString = computed(() => JSON.stringify(this.json(), null, 2), ...(ngDevMode ? [{ debugName: "jsonString" }] : /* istanbul ignore next */ []));
3254
+ className = computed(() => css({
3255
+ fontSize: this.fontSize(),
3256
+ width: this.width(),
3257
+ }), ...(ngDevMode ? [{ debugName: "className" }] : /* istanbul ignore next */ []));
3258
+ selectContents(jsonArea) {
3259
+ if (!this.selectOnClick())
3260
+ return;
3261
+ jsonArea.select();
3262
+ }
3263
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniJsonViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3264
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.12", type: UniJsonViewComponent, isStandalone: true, selector: "uni-json-view", inputs: { json: { classPropertyName: "json", publicName: "json", isSignal: true, isRequired: false, transformFunction: null }, rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: false, transformFunction: null }, fontSize: { classPropertyName: "fontSize", publicName: "fontSize", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, selectOnClick: { classPropertyName: "selectOnClick", publicName: "selectOnClick", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<textarea\n #jsonArea\n (click)=\"selectContents(jsonArea)\"\n [class]=\"className()\"\n [rows]=\"rows()\"\n >{{ jsonString() }}</textarea\n>\n" });
3265
+ }
3266
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniJsonViewComponent, decorators: [{
3267
+ type: Component,
3268
+ args: [{ selector: 'uni-json-view', imports: [], template: "<textarea\n #jsonArea\n (click)=\"selectContents(jsonArea)\"\n [class]=\"className()\"\n [rows]=\"rows()\"\n >{{ jsonString() }}</textarea\n>\n" }]
3269
+ }], propDecorators: { json: [{ type: i0.Input, args: [{ isSignal: true, alias: "json", required: false }] }], rows: [{ type: i0.Input, args: [{ isSignal: true, alias: "rows", required: false }] }], fontSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "fontSize", required: false }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }], selectOnClick: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectOnClick", required: false }] }] } });
3270
+
3271
+ /**
3272
+ * UniJsonViewComponent Barrel File
3273
+ *
3274
+ * This file exports all public-facing elements of the json-view component.
3275
+ */
3276
+
3277
+ class UniMenuItemComponent extends UniBoxComponent {
3278
+ _elementRef = inject(ElementRef);
3279
+ display = input('flex', ...(ngDevMode ? [{ debugName: "display" }] : /* istanbul ignore next */ []));
3280
+ flexDirection = input('row', ...(ngDevMode ? [{ debugName: "flexDirection" }] : /* istanbul ignore next */ []));
3281
+ alignItems = input('center', ...(ngDevMode ? [{ debugName: "alignItems" }] : /* istanbul ignore next */ []));
3282
+ paddingHorizontal = input('md', ...(ngDevMode ? [{ debugName: "paddingHorizontal" }] : /* istanbul ignore next */ []));
3283
+ gap = input('md', ...(ngDevMode ? [{ debugName: "gap" }] : /* istanbul ignore next */ []));
3284
+ label = input(...(ngDevMode ? [undefined, { debugName: "label" }] : /* istanbul ignore next */ []));
3285
+ template = input(...(ngDevMode ? [undefined, { debugName: "template" }] : /* istanbul ignore next */ []));
3286
+ context = input(...(ngDevMode ? [undefined, { debugName: "context" }] : /* istanbul ignore next */ []));
3287
+ symbolName = input(...(ngDevMode ? [undefined, { debugName: "symbolName" }] : /* istanbul ignore next */ []));
3288
+ active = input(...(ngDevMode ? [undefined, { debugName: "active" }] : /* istanbul ignore next */ []));
3289
+ hoverColor = input('primary-container', ...(ngDevMode ? [{ debugName: "hoverColor" }] : /* istanbul ignore next */ []));
3290
+ disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
3291
+ get className() {
3292
+ return css([
3293
+ {
3294
+ cursor: 'pointer',
3295
+ transition: 'all 0.35s ease',
3296
+ height: 38,
3297
+ '&:hover': {
3298
+ ...this.theme.colorPair(this.hoverColor()),
3299
+ },
3300
+ },
3301
+ ]);
3302
+ }
3303
+ focus() {
3304
+ this._elementRef.nativeElement.focus();
3305
+ }
3306
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniMenuItemComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
3307
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: UniMenuItemComponent, isStandalone: true, selector: "div[uni-menu-item], div[menu-item]", inputs: { display: { classPropertyName: "display", publicName: "display", isSignal: true, isRequired: false, transformFunction: null }, flexDirection: { classPropertyName: "flexDirection", publicName: "flexDirection", isSignal: true, isRequired: false, transformFunction: null }, alignItems: { classPropertyName: "alignItems", publicName: "alignItems", isSignal: true, isRequired: false, transformFunction: null }, paddingHorizontal: { classPropertyName: "paddingHorizontal", publicName: "paddingHorizontal", isSignal: true, isRequired: false, transformFunction: null }, gap: { classPropertyName: "gap", publicName: "gap", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, template: { classPropertyName: "template", publicName: "template", isSignal: true, isRequired: false, transformFunction: null }, context: { classPropertyName: "context", publicName: "context", isSignal: true, isRequired: false, transformFunction: null }, symbolName: { classPropertyName: "symbolName", publicName: "symbolName", isSignal: true, isRequired: false, transformFunction: null }, active: { classPropertyName: "active", publicName: "active", isSignal: true, isRequired: false, transformFunction: null }, hoverColor: { classPropertyName: "hoverColor", publicName: "hoverColor", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "this.className" } }, usesInheritance: true, ngImport: i0, template: "@let tpl = template();\n@let symbol = symbolName();\n@if (symbol) {\n <Symbol [name]=\"symbol\"></Symbol>\n}\n<div box-layout [grow]=\"1\">\n @if (tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"context()\"></ng-container>\n } @else {\n <Text role=\"label\" display=\"block\" [nowrap]=\"true\">\n {{ label() }}\n </Text>\n }\n</div>\n@if (active()) {\n <Symbol name=\"check\"></Symbol>\n}\n", styles: [":host:focus{background:#ccc;color:#fff}:host.disabled{color:#ddd;pointer-events:none}\n"], dependencies: [{ kind: "component", type: UniTextComponent, selector: "uni-text, Text", inputs: ["typeface", "color", "display", "align", "nowrap", "maxWidth", "ellipsis"] }, { kind: "component", type: UniSymbolComponent, selector: "uni-symbol, Symbol", inputs: ["name", "fill", "weight", "grade", "opticalSize"] }, { kind: "component", type: UniBoxComponent, selector: "div[uni-box-layout], Box, div[box-layout]", inputs: ["color", "backgroundColor", "borderRadius", "borderRadiusLeft", "borderRadiusRight", "borderRadiusTop", "borderRadiusBottom", "padding", "paddingHorizontal", "paddingVertical", "paddingLeft", "paddingRight", "paddingTop", "paddingBottom", "border", "borderTop", "borderBottom", "borderLeft", "borderRight", "dashBorder", "alignSelf", "alignItems", "alignContent", "justifyContent", "grow", "display", "position", "inset", "height", "minHeight", "maxHeight", "width", "minWidth", "maxWidth", "ignoreDir", "gridArea", "gridColumn", "gridRow", "overflow", "elevation", "shadow", "gap", "fullWidth", "fullHeight", "flexDirection", "textAlign", "wrapItems", "zIndex"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
3308
+ }
3309
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniMenuItemComponent, decorators: [{
3310
+ type: Component,
3311
+ args: [{ selector: 'div[uni-menu-item], div[menu-item]', standalone: true, imports: [UniTextComponent, UniSymbolComponent, UniBoxComponent, NgTemplateOutlet], template: "@let tpl = template();\n@let symbol = symbolName();\n@if (symbol) {\n <Symbol [name]=\"symbol\"></Symbol>\n}\n<div box-layout [grow]=\"1\">\n @if (tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"context()\"></ng-container>\n } @else {\n <Text role=\"label\" display=\"block\" [nowrap]=\"true\">\n {{ label() }}\n </Text>\n }\n</div>\n@if (active()) {\n <Symbol name=\"check\"></Symbol>\n}\n", styles: [":host:focus{background:#ccc;color:#fff}:host.disabled{color:#ddd;pointer-events:none}\n"] }]
3312
+ }], propDecorators: { display: [{ type: i0.Input, args: [{ isSignal: true, alias: "display", required: false }] }], flexDirection: [{ type: i0.Input, args: [{ isSignal: true, alias: "flexDirection", required: false }] }], alignItems: [{ type: i0.Input, args: [{ isSignal: true, alias: "alignItems", required: false }] }], paddingHorizontal: [{ type: i0.Input, args: [{ isSignal: true, alias: "paddingHorizontal", required: false }] }], gap: [{ type: i0.Input, args: [{ isSignal: true, alias: "gap", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], template: [{ type: i0.Input, args: [{ isSignal: true, alias: "template", required: false }] }], context: [{ type: i0.Input, args: [{ isSignal: true, alias: "context", required: false }] }], symbolName: [{ type: i0.Input, args: [{ isSignal: true, alias: "symbolName", required: false }] }], active: [{ type: i0.Input, args: [{ isSignal: true, alias: "active", required: false }] }], hoverColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "hoverColor", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], className: [{
3313
+ type: HostBinding,
3314
+ args: ['class']
3315
+ }] } });
3316
+
3317
+ class UniMenuComponent {
3318
+ cdr = inject(ChangeDetectorRef);
3319
+ // Modern Signal Inputs for perfect Zoneless tracking
3320
+ menuItems = input.required(...(ngDevMode ? [{ debugName: "menuItems" }] : /* istanbul ignore next */ []));
3321
+ activeItem = input(...(ngDevMode ? [undefined, { debugName: "activeItem" }] : /* istanbul ignore next */ []));
3322
+ placement = input('bottom-start', ...(ngDevMode ? [{ debugName: "placement" }] : /* istanbul ignore next */ []));
3323
+ // Modern Signal Output
3324
+ menuItemClicked = output();
3325
+ TriggerClassName = css({ display: 'inline-block' });
3326
+ get className() {
3327
+ return css({
3328
+ margin: 'unset',
3329
+ padding: 'unset',
3330
+ });
3331
+ }
3332
+ handleMenuItemClick(item, dropdown) {
3333
+ if (item.action) {
3334
+ item.action();
3335
+ }
3336
+ this.menuItemClicked.emit(item);
3337
+ dropdown.hideDropdown();
3338
+ // Explicitly request a render tick if item.action() updated any internal state
3339
+ this.cdr.markForCheck();
3340
+ }
1978
3341
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1979
3342
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: UniMenuComponent, isStandalone: true, selector: "Menu, uni-menu", inputs: { menuItems: { classPropertyName: "menuItems", publicName: "menuItems", isSignal: true, isRequired: true, transformFunction: null }, activeItem: { classPropertyName: "activeItem", publicName: "activeItem", isSignal: true, isRequired: false, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "placement", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { menuItemClicked: "menuItemClicked" }, host: { properties: { "class": "this.className" } }, ngImport: i0, template: `
1980
3343
  <div #trigger [class]="TriggerClassName">
@@ -2032,6 +3395,266 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImpo
2032
3395
  args: ['class']
2033
3396
  }] } });
2034
3397
 
3398
+ class UniMultiSelectComponent {
3399
+ // Data Inputs
3400
+ options = input([], ...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
3401
+ selections = input(undefined, ...(ngDevMode ? [{ debugName: "selections" }] : /* istanbul ignore next */ []));
3402
+ updates = output();
3403
+ // Styling Inputs
3404
+ flexDirection = input('column', ...(ngDevMode ? [{ debugName: "flexDirection" }] : /* istanbul ignore next */ []));
3405
+ checkboxGap = input('sm', ...(ngDevMode ? [{ debugName: "checkboxGap" }] : /* istanbul ignore next */ []));
3406
+ optionsWithSelections = [];
3407
+ values = [];
3408
+ className = css({ display: 'contents' });
3409
+ constructor() {
3410
+ effect(() => {
3411
+ this.values = this.selections() || [];
3412
+ this.optionsWithSelections = this.options().map((option) => ({
3413
+ ...option,
3414
+ selected: this.values.includes(option.value),
3415
+ }));
3416
+ });
3417
+ }
3418
+ handleCheck(checked, value) {
3419
+ const selections = this.selections();
3420
+ if (!selections && !checked)
3421
+ return;
3422
+ if (selections && !checked) {
3423
+ const filteredSelections = selections.filter((item) => item != value);
3424
+ const isEmpty = filteredSelections.length === 0;
3425
+ this.updates.emit(isEmpty ? undefined : filteredSelections);
3426
+ return;
3427
+ }
3428
+ if (checked) {
3429
+ this.updates.emit([...(selections || []), value]);
3430
+ return;
3431
+ }
3432
+ }
3433
+ selectAll() {
3434
+ const allValues = this.options().map((option) => option.value);
3435
+ this.updates.emit(allValues);
3436
+ }
3437
+ deselectAll() {
3438
+ this.updates.emit(undefined);
3439
+ }
3440
+ optionWrapper = css({
3441
+ display: 'flex',
3442
+ alignItems: 'center',
3443
+ width: '100%',
3444
+ });
3445
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniMultiSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3446
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: UniMultiSelectComponent, isStandalone: true, selector: "uni-multi-select, MultiSelect", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, selections: { classPropertyName: "selections", publicName: "selections", isSignal: true, isRequired: false, transformFunction: null }, flexDirection: { classPropertyName: "flexDirection", publicName: "flexDirection", isSignal: true, isRequired: false, transformFunction: null }, checkboxGap: { classPropertyName: "checkboxGap", publicName: "checkboxGap", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { updates: "updates" }, host: { properties: { "class": "this.className" } }, ngImport: i0, template: "<div\n box-layout\n display=\"flex\"\n [flexDirection]=\"flexDirection()\"\n [gap]=\"checkboxGap()\"\n>\n @for (option of options(); track option) {\n <div [class]=\"optionWrapper\">\n <uni-checkbox\n [label]=\"option.label\"\n [checked]=\"values.indexOf(option.value) > -1\"\n (checkedChange)=\"handleCheck($event, option.value)\"\n variant=\"primary\"\n >\n </uni-checkbox>\n </div>\n }\n</div>\n", dependencies: [{ kind: "component", type: UniCheckboxComponent, selector: "uni-checkbox, Checkbox", inputs: ["checked", "disabled", "touched", "invalid", "dirty", "label"], outputs: ["checkedChange", "touchedChange"] }, { kind: "component", type: UniBoxComponent, selector: "div[uni-box-layout], Box, div[box-layout]", inputs: ["color", "backgroundColor", "borderRadius", "borderRadiusLeft", "borderRadiusRight", "borderRadiusTop", "borderRadiusBottom", "padding", "paddingHorizontal", "paddingVertical", "paddingLeft", "paddingRight", "paddingTop", "paddingBottom", "border", "borderTop", "borderBottom", "borderLeft", "borderRight", "dashBorder", "alignSelf", "alignItems", "alignContent", "justifyContent", "grow", "display", "position", "inset", "height", "minHeight", "maxHeight", "width", "minWidth", "maxWidth", "ignoreDir", "gridArea", "gridColumn", "gridRow", "overflow", "elevation", "shadow", "gap", "fullWidth", "fullHeight", "flexDirection", "textAlign", "wrapItems", "zIndex"] }] });
3447
+ }
3448
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniMultiSelectComponent, decorators: [{
3449
+ type: Component,
3450
+ args: [{ selector: 'uni-multi-select, MultiSelect', imports: [UniCheckboxComponent, UniBoxComponent], template: "<div\n box-layout\n display=\"flex\"\n [flexDirection]=\"flexDirection()\"\n [gap]=\"checkboxGap()\"\n>\n @for (option of options(); track option) {\n <div [class]=\"optionWrapper\">\n <uni-checkbox\n [label]=\"option.label\"\n [checked]=\"values.indexOf(option.value) > -1\"\n (checkedChange)=\"handleCheck($event, option.value)\"\n variant=\"primary\"\n >\n </uni-checkbox>\n </div>\n }\n</div>\n" }]
3451
+ }], ctorParameters: () => [], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], selections: [{ type: i0.Input, args: [{ isSignal: true, alias: "selections", required: false }] }], updates: [{ type: i0.Output, args: ["updates"] }], flexDirection: [{ type: i0.Input, args: [{ isSignal: true, alias: "flexDirection", required: false }] }], checkboxGap: [{ type: i0.Input, args: [{ isSignal: true, alias: "checkboxGap", required: false }] }], className: [{
3452
+ type: HostBinding,
3453
+ args: ['class']
3454
+ }] } });
3455
+
3456
+ class UniMultiSelectDropdownComponent extends BaseComponent {
3457
+ className = css({ display: 'contents' });
3458
+ // --- REQUIRED SIGNALS (populated by FormValueControl) ---
3459
+ value = model([], ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
3460
+ disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
3461
+ touched = model(false, ...(ngDevMode ? [{ debugName: "touched" }] : /* istanbul ignore next */ []));
3462
+ invalid = input(false, ...(ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []));
3463
+ dirty = input(false, ...(ngDevMode ? [{ debugName: "dirty" }] : /* istanbul ignore next */ []));
3464
+ // --- CONFIGURATION ---
3465
+ options = input.required(...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
3466
+ placeholder = input('', ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
3467
+ query = signal('', ...(ngDevMode ? [{ debugName: "query" }] : /* istanbul ignore next */ []));
3468
+ filteredOptions = computed(() => {
3469
+ const filterText = this.query().toLowerCase();
3470
+ return this.options().filter((opt) => opt.label.toLowerCase().includes(filterText));
3471
+ }, ...(ngDevMode ? [{ debugName: "filteredOptions" }] : /* istanbul ignore next */ []));
3472
+ // Derived display string
3473
+ selectedLabelsText = computed(() => {
3474
+ const selections = this.value();
3475
+ const allOptions = this.options();
3476
+ // Find labels for each selected ID
3477
+ const labels = selections
3478
+ .map((value) => allOptions.find((opt) => opt.value === value)?.label)
3479
+ .filter((label) => !!label); // Remove undefined if an ID isn't found
3480
+ return labels.length > 0 ? labels.join(', ') : this.placeholder();
3481
+ }, ...(ngDevMode ? [{ debugName: "selectedLabelsText" }] : /* istanbul ignore next */ []));
3482
+ showError = computed(() => this.invalid() && (this.touched() || this.dirty()), ...(ngDevMode ? [{ debugName: "showError" }] : /* istanbul ignore next */ []));
3483
+ textColor = computed(() => {
3484
+ return this.selectedLabelsText() === this.placeholder()
3485
+ ? this.componentOptions().placeholderTextColor
3486
+ : this.componentOptions().textColor;
3487
+ }, ...(ngDevMode ? [{ debugName: "textColor" }] : /* istanbul ignore next */ []));
3488
+ triggerClass = css({
3489
+ all: 'unset',
3490
+ display: 'block',
3491
+ cursor: 'pointer',
3492
+ width: '100%',
3493
+ '&:focus > :first-child > :first-child': {
3494
+ outline: this.componentOptions().focusOutline,
3495
+ outlineOffset: this.componentOptions().focusOutlineOffset,
3496
+ },
3497
+ });
3498
+ searchInputClass;
3499
+ constructor() {
3500
+ super();
3501
+ effect(() => {
3502
+ this.searchInputClass = css({
3503
+ ...removeInputPlatformStyling,
3504
+ ...this.theme.border(this.componentOptions().searchInputBorder),
3505
+ ...this.theme.radius(this.componentOptions().searchInputBorderRadius),
3506
+ paddingBlock: 4,
3507
+ paddingInline: 8,
3508
+ width: 'auto',
3509
+ '&:focus': {
3510
+ outline: this.componentOptions().focusOutline,
3511
+ outlineOffset: this.componentOptions().focusOutlineOffset,
3512
+ },
3513
+ });
3514
+ });
3515
+ }
3516
+ selectAll() {
3517
+ if (this.disabled())
3518
+ return;
3519
+ this.touched.set(true);
3520
+ const allValues = this.options().map((option) => option.value);
3521
+ this.value.set(allValues);
3522
+ }
3523
+ deselectAll() {
3524
+ if (this.disabled())
3525
+ return;
3526
+ this.touched.set(true);
3527
+ this.value.set([]);
3528
+ }
3529
+ isOptionSelected(option) {
3530
+ return computed(() => this.value().includes(option.value));
3531
+ }
3532
+ toggleOption(option, checked) {
3533
+ if (this.disabled())
3534
+ return;
3535
+ this.touched.set(true);
3536
+ const { value } = option;
3537
+ this.value.update((current) => {
3538
+ if (checked) {
3539
+ // Add selection if not already present
3540
+ return current.includes(value) ? current : [...current, value];
3541
+ }
3542
+ else {
3543
+ // Remove selection
3544
+ return current.filter((item) => item !== value);
3545
+ }
3546
+ });
3547
+ }
3548
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniMultiSelectDropdownComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3549
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: UniMultiSelectDropdownComponent, isStandalone: true, selector: "uni-multi-select-dropdown, MultiSelectDropdown", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, dirty: { classPropertyName: "dirty", publicName: "dirty", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: true, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", touched: "touchedChange" }, host: { properties: { "class": "this.className" } }, providers: [{ provide: COMPONENT_NAME, useValue: 'multiSelectDropdown' }], usesInheritance: true, ngImport: i0, template: "<button\n [class]=\"triggerClass\"\n #trigger\n [style.cursor]=\"disabled() ? 'default' : 'pointer'\"\n (click)=\"!disabled() && touched.set(true)\"\n>\n <uni-input-box [error]=\"showError()\" [disabled]=\"disabled()\">\n <div\n row-layout\n alignItems=\"center\"\n justifyContent=\"space-between\"\n [fullWidth]=\"true\"\n [minWidth]=\"0\"\n paddingLeft=\"sm\"\n >\n <Text\n display=\"block\"\n [typeface]=\"componentOptions().textRole\"\n [color]=\"textColor()\"\n [ellipsis]=\"true\"\n [style.flex-grow]=\"1\"\n >{{ selectedLabelsText() }}</Text\n >\n <Symbol name=\"keyboard_arrow_down\" [style.flex-shrink]=\"0\"></Symbol>\n </div>\n </uni-input-box>\n</button>\n<uni-dropdown\n #dropdown\n [trigger]=\"trigger\"\n (dropdownShowing)=\"$event && searchInput.focus()\"\n (dropdownHiding)=\"$event && trigger.focus()\"\n>\n <div box-layout gap=\"xs\" padding=\"xs\">\n <input\n #searchInput\n type=\"text\"\n [class]=\"searchInputClass\"\n [value]=\"query()\"\n (input)=\"query.set($any($event.target).value)\"\n placeholder=\"Search...\"\n (click)=\"$event.stopPropagation()\"\n [disabled]=\"disabled()\"\n />\n </div>\n\n <uni-divider [border]=\"componentOptions().dividerBorder\" />\n\n <div stack-layout gap=\"xs\" padding=\"xs\">\n @for (option of filteredOptions(); track option.value) {\n <uni-checkbox\n [label]=\"option.label\"\n [checked]=\"isOptionSelected(option)()\"\n (checkedChange)=\"toggleOption(option, $event)\"\n variant=\"primary\"\n [disabled]=\"disabled()\"\n >\n </uni-checkbox>\n }\n </div>\n\n <uni-divider [border]=\"componentOptions().dividerBorder\" />\n\n <div row-layout gap=\"xs\" justifyContent=\"space-around\" padding=\"xs\">\n <button\n text-button\n (click)=\"dropdown.hideDropdown()\"\n size=\"sm\"\n variant=\"ghost\"\n >\n Done\n </button>\n </div>\n</uni-dropdown>\n", dependencies: [{ kind: "component", type: UniCheckboxComponent, selector: "uni-checkbox, Checkbox", inputs: ["checked", "disabled", "touched", "invalid", "dirty", "label"], outputs: ["checkedChange", "touchedChange"] }, { kind: "component", type: UniBoxComponent, selector: "div[uni-box-layout], Box, div[box-layout]", inputs: ["color", "backgroundColor", "borderRadius", "borderRadiusLeft", "borderRadiusRight", "borderRadiusTop", "borderRadiusBottom", "padding", "paddingHorizontal", "paddingVertical", "paddingLeft", "paddingRight", "paddingTop", "paddingBottom", "border", "borderTop", "borderBottom", "borderLeft", "borderRight", "dashBorder", "alignSelf", "alignItems", "alignContent", "justifyContent", "grow", "display", "position", "inset", "height", "minHeight", "maxHeight", "width", "minWidth", "maxWidth", "ignoreDir", "gridArea", "gridColumn", "gridRow", "overflow", "elevation", "shadow", "gap", "fullWidth", "fullHeight", "flexDirection", "textAlign", "wrapItems", "zIndex"] }, { kind: "component", type: UniDropdownComponent, selector: "uni-dropdown, Dropdown", inputs: ["trigger", "placement", "offset", "paddingVertical", "paddingHorizontal"], outputs: ["dropdownShowing", "dropdownHiding"] }, { kind: "component", type: UniStackComponent, selector: "div[uni-stack-layout], Stack, div[stack-layout]", inputs: ["display", "flexDirection", "minHeight"] }, { kind: "component", type: UniDividerComponent, selector: "uni-divider, Divider", inputs: ["orientation", "border"] }, { kind: "component", type: UniButtonComponent, selector: "button[uni-text-button], Button, button[text-button]", inputs: ["disable", "loading", "fullWidth", "symbolLeft", "symbolRight"] }, { kind: "component", type: UniTextComponent, selector: "uni-text, Text", inputs: ["typeface", "color", "display", "align", "nowrap", "maxWidth", "ellipsis"] }, { kind: "component", type: UniSymbolComponent, selector: "uni-symbol, Symbol", inputs: ["name", "fill", "weight", "grade", "opticalSize"] }, { kind: "component", type: UniRowComponent, selector: "div[uni-row-layout], Row, div[row-layout]", inputs: ["display", "flexDirection", "minWidth"] }, { kind: "component", type: UniInputBoxComponent, selector: "uni-input-box", inputs: ["disabled", "error", "minWidth"] }] });
3550
+ }
3551
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniMultiSelectDropdownComponent, decorators: [{
3552
+ type: Component,
3553
+ args: [{ selector: 'uni-multi-select-dropdown, MultiSelectDropdown', imports: [
3554
+ UniCheckboxComponent,
3555
+ UniBoxComponent,
3556
+ UniDropdownComponent,
3557
+ UniStackComponent,
3558
+ UniDividerComponent,
3559
+ UniButtonComponent,
3560
+ UniTextComponent,
3561
+ UniSymbolComponent,
3562
+ UniRowComponent,
3563
+ UniInputBoxComponent,
3564
+ ], providers: [{ provide: COMPONENT_NAME, useValue: 'multiSelectDropdown' }], template: "<button\n [class]=\"triggerClass\"\n #trigger\n [style.cursor]=\"disabled() ? 'default' : 'pointer'\"\n (click)=\"!disabled() && touched.set(true)\"\n>\n <uni-input-box [error]=\"showError()\" [disabled]=\"disabled()\">\n <div\n row-layout\n alignItems=\"center\"\n justifyContent=\"space-between\"\n [fullWidth]=\"true\"\n [minWidth]=\"0\"\n paddingLeft=\"sm\"\n >\n <Text\n display=\"block\"\n [typeface]=\"componentOptions().textRole\"\n [color]=\"textColor()\"\n [ellipsis]=\"true\"\n [style.flex-grow]=\"1\"\n >{{ selectedLabelsText() }}</Text\n >\n <Symbol name=\"keyboard_arrow_down\" [style.flex-shrink]=\"0\"></Symbol>\n </div>\n </uni-input-box>\n</button>\n<uni-dropdown\n #dropdown\n [trigger]=\"trigger\"\n (dropdownShowing)=\"$event && searchInput.focus()\"\n (dropdownHiding)=\"$event && trigger.focus()\"\n>\n <div box-layout gap=\"xs\" padding=\"xs\">\n <input\n #searchInput\n type=\"text\"\n [class]=\"searchInputClass\"\n [value]=\"query()\"\n (input)=\"query.set($any($event.target).value)\"\n placeholder=\"Search...\"\n (click)=\"$event.stopPropagation()\"\n [disabled]=\"disabled()\"\n />\n </div>\n\n <uni-divider [border]=\"componentOptions().dividerBorder\" />\n\n <div stack-layout gap=\"xs\" padding=\"xs\">\n @for (option of filteredOptions(); track option.value) {\n <uni-checkbox\n [label]=\"option.label\"\n [checked]=\"isOptionSelected(option)()\"\n (checkedChange)=\"toggleOption(option, $event)\"\n variant=\"primary\"\n [disabled]=\"disabled()\"\n >\n </uni-checkbox>\n }\n </div>\n\n <uni-divider [border]=\"componentOptions().dividerBorder\" />\n\n <div row-layout gap=\"xs\" justifyContent=\"space-around\" padding=\"xs\">\n <button\n text-button\n (click)=\"dropdown.hideDropdown()\"\n size=\"sm\"\n variant=\"ghost\"\n >\n Done\n </button>\n </div>\n</uni-dropdown>\n" }]
3565
+ }], ctorParameters: () => [], propDecorators: { className: [{
3566
+ type: HostBinding,
3567
+ args: ['class']
3568
+ }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }, { type: i0.Output, args: ["touchedChange"] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], dirty: [{ type: i0.Input, args: [{ isSignal: true, alias: "dirty", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: true }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }] } });
3569
+
3570
+ class UniNotificationBadgeComponent extends BaseComponent {
3571
+ count = input(undefined, ...(ngDevMode ? [{ debugName: "count" }] : /* istanbul ignore next */ []));
3572
+ maxCount = input(99, ...(ngDevMode ? [{ debugName: "maxCount" }] : /* istanbul ignore next */ []));
3573
+ badgeVariant = input('count', ...(ngDevMode ? [{ debugName: "badgeVariant" }] : /* istanbul ignore next */ []));
3574
+ color = input(undefined, ...(ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []));
3575
+ position = input('top-right', ...(ngDevMode ? [{ debugName: "position" }] : /* istanbul ignore next */ []));
3576
+ show = input(true, ...(ngDevMode ? [{ debugName: "show" }] : /* istanbul ignore next */ []));
3577
+ displayValue = computed(() => {
3578
+ const count = this.count();
3579
+ const maxCount = this.maxCount();
3580
+ const variant = this.badgeVariant();
3581
+ if (variant === 'dot') {
3582
+ return '';
3583
+ }
3584
+ if (count === undefined || count <= 0) {
3585
+ return '';
3586
+ }
3587
+ if (count > maxCount) {
3588
+ return `${maxCount}+`;
3589
+ }
3590
+ return count.toString();
3591
+ }, ...(ngDevMode ? [{ debugName: "displayValue" }] : /* istanbul ignore next */ []));
3592
+ shouldShow = computed(() => {
3593
+ const show = this.show();
3594
+ const count = this.count();
3595
+ const variant = this.badgeVariant();
3596
+ if (!show)
3597
+ return false;
3598
+ if (variant === 'dot')
3599
+ return true;
3600
+ return count !== undefined && count > 0;
3601
+ }, ...(ngDevMode ? [{ debugName: "shouldShow" }] : /* istanbul ignore next */ []));
3602
+ get className() {
3603
+ const variant = this.badgeVariant();
3604
+ const color = this.color();
3605
+ const position = this.position();
3606
+ const offset = this.componentOptions().offset + 'px';
3607
+ const positionStyles = {
3608
+ 'top-right': { top: offset, right: offset },
3609
+ 'top-left': { top: offset, left: offset },
3610
+ 'bottom-right': { bottom: offset, right: offset },
3611
+ 'bottom-left': { bottom: offset, left: offset },
3612
+ }[position];
3613
+ const variantStyles = {
3614
+ dot: {
3615
+ width: '8px',
3616
+ height: '8px',
3617
+ borderRadius: '50%',
3618
+ minWidth: 'unset',
3619
+ },
3620
+ count: {
3621
+ width: 20,
3622
+ height: 20,
3623
+ borderRadius: 10,
3624
+ },
3625
+ pill: {
3626
+ minWidth: '24px',
3627
+ height: '20px',
3628
+ borderRadius: '10px',
3629
+ padding: '0 8px',
3630
+ },
3631
+ }[variant];
3632
+ return css({
3633
+ position: 'relative',
3634
+ display: 'inline-block',
3635
+ '& .notification-badge-indicator': {
3636
+ position: 'absolute',
3637
+ display: 'inline-flex',
3638
+ alignItems: 'center',
3639
+ justifyContent: 'center',
3640
+ ...this.theme.getContainerColors(color || 'warn'),
3641
+ zIndex: 1,
3642
+ ...positionStyles,
3643
+ ...variantStyles,
3644
+ },
3645
+ });
3646
+ }
3647
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniNotificationBadgeComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
3648
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: UniNotificationBadgeComponent, isStandalone: true, selector: "uni-notification-badge", inputs: { count: { classPropertyName: "count", publicName: "count", isSignal: true, isRequired: false, transformFunction: null }, maxCount: { classPropertyName: "maxCount", publicName: "maxCount", isSignal: true, isRequired: false, transformFunction: null }, badgeVariant: { classPropertyName: "badgeVariant", publicName: "badgeVariant", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, show: { classPropertyName: "show", publicName: "show", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "this.className" } }, providers: [{ provide: COMPONENT_NAME, useValue: 'notificationBadge' }], usesInheritance: true, ngImport: i0, template: "<ng-content></ng-content>\n@if (shouldShow()) {\n<div class=\"notification-badge-indicator\">\n <uni-text\n typeface=\"overline\"\n align=\"center\"\n [style.max-width]=\"badgeVariant() !== 'pill' ? (displayValue().length * 5 + 'px') : ''\"\n >{{ displayValue() }}</uni-text\n >\n</div>\n}\n", dependencies: [{ kind: "component", type: UniTextComponent, selector: "uni-text, Text", inputs: ["typeface", "color", "display", "align", "nowrap", "maxWidth", "ellipsis"] }] });
3649
+ }
3650
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniNotificationBadgeComponent, decorators: [{
3651
+ type: Component,
3652
+ args: [{ selector: 'uni-notification-badge', imports: [UniTextComponent], providers: [{ provide: COMPONENT_NAME, useValue: 'notificationBadge' }], template: "<ng-content></ng-content>\n@if (shouldShow()) {\n<div class=\"notification-badge-indicator\">\n <uni-text\n typeface=\"overline\"\n align=\"center\"\n [style.max-width]=\"badgeVariant() !== 'pill' ? (displayValue().length * 5 + 'px') : ''\"\n >{{ displayValue() }}</uni-text\n >\n</div>\n}\n" }]
3653
+ }], propDecorators: { count: [{ type: i0.Input, args: [{ isSignal: true, alias: "count", required: false }] }], maxCount: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxCount", required: false }] }], badgeVariant: [{ type: i0.Input, args: [{ isSignal: true, alias: "badgeVariant", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: false }] }], show: [{ type: i0.Input, args: [{ isSignal: true, alias: "show", required: false }] }], className: [{
3654
+ type: HostBinding,
3655
+ args: ['class']
3656
+ }] } });
3657
+
2035
3658
  class UniAlertComponent extends BaseComponent {
2036
3659
  show = model(...(ngDevMode ? [undefined, { debugName: "show" }] : /* istanbul ignore next */ []));
2037
3660
  iconName = input(undefined, ...(ngDevMode ? [{ debugName: "iconName" }] : /* istanbul ignore next */ []));
@@ -2300,125 +3923,189 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImpo
2300
3923
  args: [{ selector: 'uni-notifications, Notifications', standalone: true, imports: [UniAlertComponent, UniSnackbarComponent, ConfirmationDialogComponent], template: "<Alert\n [show]=\"showAlert()\"\n (showing)=\"handleAlertShowingEvent($event)\"\n [variant]=\"alert()?.variant || 'primary'\"\n [iconName]=\"alert()?.iconName\"\n [symbolName]=\"alert()?.symbolName\"\n >{{ alert()?.message }}</Alert\n>\n\n<Snackbar\n [show]=\"showSnackbar()\"\n (showing)=\"handleSnackbarShowingEvent($event)\"\n [variant]=\"snackbar()?.variant || 'primary'\"\n [actionLabel]=\"snackbar()?.actionLabel\"\n (action)=\"snackbar()?.action?.()\"\n [timeout]=\"snackbar()?.timeout\"\n [iconName]=\"snackbar()?.iconName\"\n [symbolName]=\"snackbar()?.symbolName\"\n >{{ snackbar()?.message }}</Snackbar\n>\n\n<Confirmation\n [show]=\"showConfirmation()\"\n (showing)=\"handleConfirmationShowingEvent($event)\"\n [confirmation]=\"confirmation()\"\n></Confirmation>\n" }]
2301
3924
  }], ctorParameters: () => [] });
2302
3925
 
2303
- class UniTooltipComponent extends BaseComponent {
2304
- elRef = inject(ElementRef);
2305
- renderer = inject(Renderer2);
2306
- timer = useTimer();
2307
- hoverDelayMs = signal(500, ...(ngDevMode ? [{ debugName: "hoverDelayMs" }] : /* istanbul ignore next */ []));
2308
- isMouseInside = signal(false, ...(ngDevMode ? [{ debugName: "isMouseInside" }] : /* istanbul ignore next */ []));
2309
- tooltip;
2310
- arrow;
2311
- hoverDelay = input(500, ...(ngDevMode ? [{ debugName: "hoverDelay" }] : /* istanbul ignore next */ []));
2312
- label = input.required(...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
2313
- placement = input('top', ...(ngDevMode ? [{ debugName: "placement" }] : /* istanbul ignore next */ []));
2314
- inlineText = input(false, ...(ngDevMode ? [{ debugName: "inlineText" }] : /* istanbul ignore next */ []));
2315
- appendToBody;
3926
+ class UniPaginatorComponent extends BaseComponent {
3927
+ datasource = input(...(ngDevMode ? [undefined, { debugName: "datasource" }] : /* istanbul ignore next */ []));
3928
+ initPageSize = input(...(ngDevMode ? [undefined, { debugName: "initPageSize" }] : /* istanbul ignore next */ []));
3929
+ showPageSize = input(true, ...(ngDevMode ? [{ debugName: "showPageSize" }] : /* istanbul ignore next */ []));
3930
+ showPageJumper = input(true, ...(ngDevMode ? [{ debugName: "showPageJumper" }] : /* istanbul ignore next */ []));
3931
+ showPageNumbers = input(true, ...(ngDevMode ? [{ debugName: "showPageNumbers" }] : /* istanbul ignore next */ []));
3932
+ inputClass;
3933
+ pageClass;
2316
3934
  constructor() {
2317
3935
  super();
2318
3936
  effect(() => {
2319
- const timerActive = this.timer.isActive();
2320
- const mouseInside = this.isMouseInside();
2321
- // If the timer finished and the mouse is still inside, show tooltip
2322
- if (!timerActive && mouseInside) {
2323
- this.showTooltip();
2324
- }
2325
- // If the mouse left and the timer is not running, hide tooltip
2326
- else if (!mouseInside) {
2327
- this.hideTooltip();
2328
- }
3937
+ const pageSize = this.initPageSize();
3938
+ if (!pageSize)
3939
+ return;
3940
+ const ds = this.datasource();
3941
+ if (ds)
3942
+ ds.setPageSize(pageSize);
3943
+ });
3944
+ effect(() => {
3945
+ this.inputClass = css({
3946
+ textAlign: 'center',
3947
+ ...this.theme.border(this.componentOptions().inputBorder),
3948
+ ...this.theme.radius(this.componentOptions().inputBorderRadius),
3949
+ height: 22,
3950
+ fontSize: 16,
3951
+ padding: '2px 0 0 2px',
3952
+ '&:focus': {
3953
+ outline: 'none',
3954
+ },
3955
+ });
3956
+ this.pageClass = css({
3957
+ ...this.theme.radius(this.componentOptions().pageBorderRadius),
3958
+ padding: 2,
3959
+ width: 20,
3960
+ display: 'flex',
3961
+ justifyContent: 'center',
3962
+ cursor: 'pointer',
3963
+ border: 'solid 1px transparent',
3964
+ '&.current': {
3965
+ ...this.theme.border(this.componentOptions().currentPageBorder),
3966
+ ...this.theme.radius(this.componentOptions().currentPageBorderRadius),
3967
+ cursor: 'unset',
3968
+ },
3969
+ '&:hover:not(.current)': {
3970
+ backgroundColor: 'rgba(0,0,0,0.1)',
3971
+ },
3972
+ });
2329
3973
  });
2330
3974
  }
2331
- toggleTooltip() {
2332
- if (this.tooltip) {
2333
- this.hideTooltip();
2334
- }
2335
- else {
2336
- this.showTooltip();
2337
- }
2338
- }
2339
- mouseenter() {
2340
- this.isMouseInside.set(true);
2341
- this.timer.start(this.hoverDelayMs());
3975
+ updatePageSize(event) {
3976
+ const ds = this.datasource();
3977
+ const pageSize = event.target.value;
3978
+ if (ds)
3979
+ ds.setPageSize(parseInt(pageSize));
2342
3980
  }
2343
- mouseleave() {
2344
- this.isMouseInside.set(false);
2345
- this.timer.stop();
3981
+ jumpToPage(event) {
3982
+ const ds = this.datasource();
3983
+ const page = event.target.value;
3984
+ if (ds)
3985
+ ds.jumpToPage(parseInt(page));
2346
3986
  }
2347
- showTooltip() {
2348
- if (this.tooltip)
2349
- return;
2350
- this.initializeTooltip();
2351
- this.renderer.setAttribute(this.tooltip, 'fade', 'in');
3987
+ isNumber(page) {
3988
+ return typeof page === 'number';
2352
3989
  }
2353
- hideTooltip() {
2354
- if (!this.tooltip)
2355
- return;
2356
- this.renderer.setAttribute(this.tooltip, 'fade', 'out');
3990
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniPaginatorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3991
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: UniPaginatorComponent, isStandalone: true, selector: "uni-paginator, Paginator", inputs: { datasource: { classPropertyName: "datasource", publicName: "datasource", isSignal: true, isRequired: false, transformFunction: null }, initPageSize: { classPropertyName: "initPageSize", publicName: "initPageSize", isSignal: true, isRequired: false, transformFunction: null }, showPageSize: { classPropertyName: "showPageSize", publicName: "showPageSize", isSignal: true, isRequired: false, transformFunction: null }, showPageJumper: { classPropertyName: "showPageJumper", publicName: "showPageJumper", isSignal: true, isRequired: false, transformFunction: null }, showPageNumbers: { classPropertyName: "showPageNumbers", publicName: "showPageNumbers", isSignal: true, isRequired: false, transformFunction: null } }, providers: [{ provide: COMPONENT_NAME, useValue: 'paginator' }], usesInheritance: true, ngImport: i0, template: "@let ds = datasource();\n@if (ds) {\n <div row-layout alignItems=\"center\" [gap]=\"componentOptions().gap\">\n @if (showPageSize()) {\n <div row-layout alignItems=\"center\" gap=\"sm\" paddingRight=\"sm\">\n <Text [typeface]=\"componentOptions().textRole\">Show</Text>\n <input\n type=\"number\"\n [class]=\"inputClass\"\n (change)=\"updatePageSize($event)\"\n min=\"1\"\n [max]=\"ds.recordCount()\"\n [value]=\"ds.pageSize()\"\n />\n </div>\n }\n\n @if (showPageNumbers()) {\n <button\n icon-button\n variant=\"ghost\"\n size=\"md\"\n symbolName=\"keyboard_double_arrow_left\"\n (click)=\"ds.firstPage()\"\n [disable]=\"ds.disablePrevious()\"\n >\n First Page\n </button>\n\n <button\n icon-button\n variant=\"ghost\"\n size=\"md\"\n symbolName=\"chevron_left\"\n (click)=\"ds.previousPage()\"\n [disable]=\"ds.disablePrevious()\"\n >\n Previous Page\n </button>\n\n @for (page of ds.truncatedPages(); track page) {\n @if (isNumber(page)) {\n <div\n [class]=\"pageClass\"\n [class.current]=\"page === ds.pageIndex() + 1\"\n (click)=\"ds.jumpToPage(page)\"\n >\n <Text [typeface]=\"componentOptions().textRole\" display=\"block\">\n {{ page }}\n </Text>\n </div>\n } @else {\n <div>\n <Text [typeface]=\"componentOptions().textRole\" display=\"block\">\n {{ page }}\n </Text>\n </div>\n }\n }\n\n <button\n icon-button\n variant=\"ghost\"\n size=\"md\"\n symbolName=\"chevron_right\"\n (click)=\"ds.nextPage()\"\n [disable]=\"ds.disableNext()\"\n >\n Next Page\n </button>\n\n <button\n icon-button\n variant=\"ghost\"\n size=\"md\"\n symbolName=\"keyboard_double_arrow_right\"\n (click)=\"ds.lastPage()\"\n [disable]=\"ds.disableNext()\"\n >\n Last Page\n </button>\n }\n\n @if (showPageJumper()) {\n <div row-layout alignItems=\"center\" gap=\"sm\" paddingLeft=\"sm\">\n <Text [typeface]=\"componentOptions().textRole\">Jump to</Text>\n <input\n type=\"number\"\n [class]=\"inputClass\"\n (change)=\"jumpToPage($event)\"\n min=\"1\"\n [max]=\"ds.pageCount()\"\n [value]=\"ds.pageIndex() + 1\"\n />\n </div>\n }\n </div>\n}\n", dependencies: [{ kind: "component", type: UniRowComponent, selector: "div[uni-row-layout], Row, div[row-layout]", inputs: ["display", "flexDirection", "minWidth"] }, { kind: "component", type: UniIconButtonComponent, selector: "button[uni-icon-button], button[icon-button]", inputs: ["iconName", "symbolName", "variant", "size", "disable", "loading", "opticalSize"] }, { kind: "component", type: UniTextComponent, selector: "uni-text, Text", inputs: ["typeface", "color", "display", "align", "nowrap", "maxWidth", "ellipsis"] }] });
3992
+ }
3993
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniPaginatorComponent, decorators: [{
3994
+ type: Component,
3995
+ args: [{ selector: 'uni-paginator, Paginator', imports: [UniRowComponent, UniIconButtonComponent, UniTextComponent], providers: [{ provide: COMPONENT_NAME, useValue: 'paginator' }], standalone: true, template: "@let ds = datasource();\n@if (ds) {\n <div row-layout alignItems=\"center\" [gap]=\"componentOptions().gap\">\n @if (showPageSize()) {\n <div row-layout alignItems=\"center\" gap=\"sm\" paddingRight=\"sm\">\n <Text [typeface]=\"componentOptions().textRole\">Show</Text>\n <input\n type=\"number\"\n [class]=\"inputClass\"\n (change)=\"updatePageSize($event)\"\n min=\"1\"\n [max]=\"ds.recordCount()\"\n [value]=\"ds.pageSize()\"\n />\n </div>\n }\n\n @if (showPageNumbers()) {\n <button\n icon-button\n variant=\"ghost\"\n size=\"md\"\n symbolName=\"keyboard_double_arrow_left\"\n (click)=\"ds.firstPage()\"\n [disable]=\"ds.disablePrevious()\"\n >\n First Page\n </button>\n\n <button\n icon-button\n variant=\"ghost\"\n size=\"md\"\n symbolName=\"chevron_left\"\n (click)=\"ds.previousPage()\"\n [disable]=\"ds.disablePrevious()\"\n >\n Previous Page\n </button>\n\n @for (page of ds.truncatedPages(); track page) {\n @if (isNumber(page)) {\n <div\n [class]=\"pageClass\"\n [class.current]=\"page === ds.pageIndex() + 1\"\n (click)=\"ds.jumpToPage(page)\"\n >\n <Text [typeface]=\"componentOptions().textRole\" display=\"block\">\n {{ page }}\n </Text>\n </div>\n } @else {\n <div>\n <Text [typeface]=\"componentOptions().textRole\" display=\"block\">\n {{ page }}\n </Text>\n </div>\n }\n }\n\n <button\n icon-button\n variant=\"ghost\"\n size=\"md\"\n symbolName=\"chevron_right\"\n (click)=\"ds.nextPage()\"\n [disable]=\"ds.disableNext()\"\n >\n Next Page\n </button>\n\n <button\n icon-button\n variant=\"ghost\"\n size=\"md\"\n symbolName=\"keyboard_double_arrow_right\"\n (click)=\"ds.lastPage()\"\n [disable]=\"ds.disableNext()\"\n >\n Last Page\n </button>\n }\n\n @if (showPageJumper()) {\n <div row-layout alignItems=\"center\" gap=\"sm\" paddingLeft=\"sm\">\n <Text [typeface]=\"componentOptions().textRole\">Jump to</Text>\n <input\n type=\"number\"\n [class]=\"inputClass\"\n (change)=\"jumpToPage($event)\"\n min=\"1\"\n [max]=\"ds.pageCount()\"\n [value]=\"ds.pageIndex() + 1\"\n />\n </div>\n }\n </div>\n}\n" }]
3996
+ }], ctorParameters: () => [], propDecorators: { datasource: [{ type: i0.Input, args: [{ isSignal: true, alias: "datasource", required: false }] }], initPageSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "initPageSize", required: false }] }], showPageSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "showPageSize", required: false }] }], showPageJumper: [{ type: i0.Input, args: [{ isSignal: true, alias: "showPageJumper", required: false }] }], showPageNumbers: [{ type: i0.Input, args: [{ isSignal: true, alias: "showPageNumbers", required: false }] }] } });
3997
+
3998
+ /**
3999
+ * UniPaginatorComponent Barrel File
4000
+ *
4001
+ * This file exports all public-facing elements of the paginator component.
4002
+ */
4003
+
4004
+ class UniPopoverComponent {
4005
+ renderer = inject(Renderer2);
4006
+ theme = inject(ThemeService);
4007
+ delay = 500;
4008
+ showing = false;
4009
+ clickListener;
4010
+ placement = input(...(ngDevMode ? [undefined, { debugName: "placement" }] : /* istanbul ignore next */ []));
4011
+ autoClose = input(true, ...(ngDevMode ? [{ debugName: "autoClose" }] : /* istanbul ignore next */ []));
4012
+ triggerRef = viewChild.required('trigger');
4013
+ popoverRef = viewChild.required('popover');
4014
+ arrowRef = viewChild.required('arrow');
4015
+ get _trigger() {
4016
+ return this.triggerRef().nativeElement.firstChild;
2357
4017
  }
2358
- get className() {
2359
- return css({
2360
- display: 'inline-flex',
2361
- }, this.inlineText() && {
2362
- cursor: 'help',
2363
- textDecoration: 'underline',
2364
- textDecorationStyle: 'dotted',
2365
- });
4018
+ get _popover() {
4019
+ return this.popoverRef().nativeElement;
2366
4020
  }
2367
- tooltipFadeIn = keyframes({ ...fadeIn });
2368
- tooltipFadeOut = keyframes({ ...fadeOut });
2369
- tooltipClassName = css([
4021
+ get _arrow() {
4022
+ return this.arrowRef().nativeElement;
4023
+ }
4024
+ ngOnInit() {
4025
+ if (this.autoClose()) {
4026
+ this.clickListener = this.renderer.listen('window', 'click', (e) => {
4027
+ if (!e.composedPath().includes(this._popover) && this.showing)
4028
+ this.hidePopover();
4029
+ });
4030
+ }
4031
+ }
4032
+ showPopover() {
4033
+ this.setPosition();
4034
+ this.renderer.addClass(this._popover, this.showClassName);
4035
+ this.showing = true;
4036
+ }
4037
+ hidePopover() {
4038
+ this.renderer.removeClass(this._popover, this.showClassName);
4039
+ this.showing = false;
4040
+ setTimeout(() => {
4041
+ this.renderer.setStyle(this._popover, 'left', `-1000px`);
4042
+ }, this.delay);
4043
+ }
4044
+ togglePopover(event) {
4045
+ if (this.showing) {
4046
+ this.hidePopover();
4047
+ }
4048
+ else {
4049
+ this.showPopover();
4050
+ }
4051
+ event.stopPropagation();
4052
+ }
4053
+ popoverClassName = css([
2370
4054
  {
2371
- ...this.theme.colorPair(this.componentOptions().color),
2372
- ...this.theme.radius(this.componentOptions().borderRadius),
2373
- ...this.theme.boxShadow(this.componentOptions().shadow),
2374
- ...this.theme.typeface(this.componentOptions().typeface),
2375
- padding: 5,
4055
+ ...this.theme.colorPair('primary-surface'),
4056
+ ...this.theme.radius('xs'),
4057
+ ...this.theme.boxShadow('raised'),
4058
+ ...this.theme.typeface('label'),
4059
+ ...this.theme.border('quaternary'),
4060
+ padding: '6px 12px',
2376
4061
  width: 'max-content',
2377
4062
  position: 'absolute',
2378
4063
  top: 0,
2379
4064
  left: 0,
2380
- zIndex: Z_INDEX.tooltip,
2381
- '&[fade="in"]': {
2382
- animation: `${this.tooltipFadeIn} ease-in 350ms`,
2383
- },
2384
- '&[fade="out"]': {
2385
- animation: `${this.tooltipFadeOut} ease-in 350ms`,
2386
- },
4065
+ transition: `opacity ${this.delay}ms`,
4066
+ opacity: 0,
4067
+ zIndex: Z_INDEX.popover,
2387
4068
  },
2388
4069
  ]);
2389
4070
  arrowClassName = css({
2390
4071
  position: 'absolute',
2391
- ...this.theme.colorPair(this.componentOptions().color),
4072
+ ...this.theme.colorPair('primary-surface'),
2392
4073
  width: 8,
2393
4074
  height: 8,
2394
4075
  transform: 'rotate(45deg)',
2395
4076
  });
2396
- createTooltip() {
2397
- this.tooltip = this.renderer.createElement('span');
2398
- this.renderer.appendChild(this.tooltip, this.renderer.createText(this.label()) // textNode
2399
- );
2400
- this.renderer.appendChild(this.appendToBody ? document.body : this.elRef.nativeElement, this.tooltip);
2401
- this.renderer.addClass(this.tooltip, this.tooltipClassName);
2402
- this.renderer.listen(this.tooltip, 'animationend', (event) => {
2403
- if (event.animationName.includes(this.tooltipFadeOut))
2404
- this.destroyTooltip();
2405
- });
2406
- }
2407
- createArrow() {
2408
- this.arrow = this.renderer.createElement('div');
2409
- this.renderer.appendChild(this.tooltip, this.arrow);
2410
- this.renderer.addClass(this.arrow, this.arrowClassName);
2411
- }
4077
+ showClassName = css({
4078
+ opacity: '1 !important',
4079
+ });
4080
+ arrowClasses = {
4081
+ top: css({
4082
+ top: '-5px',
4083
+ ...this.theme.borderLeft('quaternary'),
4084
+ ...this.theme.borderTop('quaternary'),
4085
+ }),
4086
+ bottom: css({
4087
+ bottom: '-5px',
4088
+ ...this.theme.borderRight('quaternary'),
4089
+ ...this.theme.borderBottom('quaternary'),
4090
+ }),
4091
+ left: css({
4092
+ left: '-5px',
4093
+ ...this.theme.borderLeft('quaternary'),
4094
+ ...this.theme.borderBottom('quaternary'),
4095
+ }),
4096
+ right: css({
4097
+ right: '-5px',
4098
+ ...this.theme.borderRight('quaternary'),
4099
+ ...this.theme.borderTop('quaternary'),
4100
+ }),
4101
+ };
2412
4102
  setPosition() {
2413
- if (!this.tooltip || !this.arrow)
2414
- return;
2415
- computePosition(this.elRef.nativeElement, this.tooltip, {
4103
+ computePosition(this._trigger, this._popover, {
2416
4104
  placement: this.placement(),
2417
- middleware: [offset(6), flip(), shift({ padding: 5 }), arrow({ element: this.arrow })],
4105
+ middleware: [offset(7), flip(), shift({ padding: 5 }), arrow({ element: this._arrow })],
2418
4106
  }).then(({ x, y, placement, middlewareData }) => {
2419
- this.renderer.setStyle(this.tooltip, 'top', `${y}px`);
2420
- this.renderer.setStyle(this.tooltip, 'left', `${x}px`);
2421
- // Accessing the data
4107
+ this.renderer.setStyle(this._popover, 'top', `${y}px`);
4108
+ this.renderer.setStyle(this._popover, 'left', `${x}px`);
2422
4109
  const arrowX = middlewareData.arrow?.x;
2423
4110
  const arrowY = middlewareData.arrow?.y;
2424
4111
  const staticSide = {
@@ -2427,58 +4114,441 @@ class UniTooltipComponent extends BaseComponent {
2427
4114
  bottom: 'top',
2428
4115
  left: 'right',
2429
4116
  }[placement.split('-')[0]];
2430
- this.renderer.setStyle(this.arrow, 'top', `${arrowY}px`);
2431
- this.renderer.setStyle(this.arrow, 'left', `${arrowX}px`);
2432
- this.renderer.setStyle(this.arrow, 'right', ``);
2433
- this.renderer.setStyle(this.arrow, 'bottom', ``);
4117
+ this.renderer.setStyle(this._arrow, 'top', `${arrowY}px`);
4118
+ this.renderer.setStyle(this._arrow, 'left', `${arrowX}px`);
4119
+ this.renderer.setStyle(this._arrow, 'right', ``);
4120
+ this.renderer.setStyle(this._arrow, 'bottom', ``);
2434
4121
  if (staticSide) {
2435
- this.renderer.setStyle(this.arrow, staticSide, `-4px`);
4122
+ this.renderer.addClass(this._arrow, this.arrowClasses[staticSide]);
2436
4123
  }
2437
4124
  });
2438
4125
  }
2439
- initializeTooltip() {
2440
- this.createTooltip();
2441
- this.createArrow();
2442
- this.setPosition();
4126
+ ngOnDestroy() {
4127
+ if (this.clickListener) {
4128
+ this.clickListener();
4129
+ }
2443
4130
  }
2444
- destroyTooltip() {
2445
- this.renderer.removeChild(this.appendToBody ? document.body : this.elRef.nativeElement, this.tooltip);
2446
- this.renderer.removeChild(this.appendToBody ? document.body : this.elRef.nativeElement, this.arrow);
2447
- this.tooltip = null;
2448
- this.arrow = null;
4131
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniPopoverComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
4132
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.12", type: UniPopoverComponent, isStandalone: true, selector: "uni-popover, Popover", inputs: { placement: { classPropertyName: "placement", publicName: "placement", isSignal: true, isRequired: false, transformFunction: null }, autoClose: { classPropertyName: "autoClose", publicName: "autoClose", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "triggerRef", first: true, predicate: ["trigger"], descendants: true, isSignal: true }, { propertyName: "popoverRef", first: true, predicate: ["popover"], descendants: true, isSignal: true }, { propertyName: "arrowRef", first: true, predicate: ["arrow"], descendants: true, isSignal: true }], ngImport: i0, template: "<span #trigger (click)=\"togglePopover($event)\">\n <ng-content select=\"[trigger]\"></ng-content>\n</span>\n<div uniBodyRender #popover [class]=\"popoverClassName\">\n <ng-content></ng-content>\n <div #arrow [class]=\"arrowClassName\"></div>\n</div>\n", dependencies: [{ kind: "directive", type: BodyRenderDirective, selector: "[uniBodyRender]" }] });
4133
+ }
4134
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniPopoverComponent, decorators: [{
4135
+ type: Component,
4136
+ args: [{ selector: 'uni-popover, Popover', standalone: true, imports: [BodyRenderDirective], template: "<span #trigger (click)=\"togglePopover($event)\">\n <ng-content select=\"[trigger]\"></ng-content>\n</span>\n<div uniBodyRender #popover [class]=\"popoverClassName\">\n <ng-content></ng-content>\n <div #arrow [class]=\"arrowClassName\"></div>\n</div>\n" }]
4137
+ }], propDecorators: { placement: [{ type: i0.Input, args: [{ isSignal: true, alias: "placement", required: false }] }], autoClose: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoClose", required: false }] }], triggerRef: [{ type: i0.ViewChild, args: ['trigger', { isSignal: true }] }], popoverRef: [{ type: i0.ViewChild, args: ['popover', { isSignal: true }] }], arrowRef: [{ type: i0.ViewChild, args: ['arrow', { isSignal: true }] }] } });
4138
+
4139
+ /**
4140
+ * UniPopoverComponent Barrel File
4141
+ *
4142
+ * This file exports all public-facing elements of the popover component.
4143
+ */
4144
+
4145
+ class UniProgressBarComponent {
4146
+ theme = inject(ThemeService);
4147
+ palette = this.theme.colors;
4148
+ width = input(560, ...(ngDevMode ? [{ debugName: "width" }] : /* istanbul ignore next */ []));
4149
+ height = input(24, ...(ngDevMode ? [{ debugName: "height" }] : /* istanbul ignore next */ []));
4150
+ percent = input(0, ...(ngDevMode ? [{ debugName: "percent" }] : /* istanbul ignore next */ []));
4151
+ stroke = 1;
4152
+ get className() {
4153
+ return css([{ display: 'block' }]);
2449
4154
  }
2450
- ngOnDestroy() {
2451
- this.hideTooltip();
4155
+ Math = Math;
4156
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniProgressBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
4157
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.12", type: UniProgressBarComponent, isStandalone: true, selector: "uni-progress-bar, ProgressBar", inputs: { width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, percent: { classPropertyName: "percent", publicName: "percent", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "this.className" } }, ngImport: i0, template: "<svg [attr.width]=\"width()\" [attr.height]=\"height()\">\n <rect\n [attr.x]=\"stroke\"\n [attr.y]=\"stroke\"\n [attr.width]=\"width() - stroke * 2\"\n [attr.height]=\"height() - stroke * 2\"\n [attr.fill]=\"palette()['primary-surface']\"\n [attr.stroke]=\"palette()['on-background-variant']\"\n [attr.stroke-width]=\"stroke\"\n [attr.ry]=\"height() / 2 - stroke\"\n [attr.rx]=\"height() / 2 - stroke\"\n />\n\n <rect\n [attr.x]=\"stroke\"\n [attr.y]=\"stroke\"\n [attr.width]=\"\n Math.max(height() - stroke * 2, (percent() / 100) * width() - stroke * 2)\n \"\n [attr.height]=\"height() - stroke * 2\"\n [attr.fill]=\"\n percent() === 100 ? palette()['secondary'] : palette()['secondary-surface']\n \"\n [attr.stroke]=\"palette()['on-background-variant']\"\n [attr.stroke-width]=\"stroke\"\n [attr.ry]=\"height() / 2 - stroke\"\n [attr.rx]=\"height() / 2 - stroke\"\n />\n</svg>\n" });
4158
+ }
4159
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniProgressBarComponent, decorators: [{
4160
+ type: Component,
4161
+ args: [{ selector: 'uni-progress-bar, ProgressBar', standalone: true, imports: [], template: "<svg [attr.width]=\"width()\" [attr.height]=\"height()\">\n <rect\n [attr.x]=\"stroke\"\n [attr.y]=\"stroke\"\n [attr.width]=\"width() - stroke * 2\"\n [attr.height]=\"height() - stroke * 2\"\n [attr.fill]=\"palette()['primary-surface']\"\n [attr.stroke]=\"palette()['on-background-variant']\"\n [attr.stroke-width]=\"stroke\"\n [attr.ry]=\"height() / 2 - stroke\"\n [attr.rx]=\"height() / 2 - stroke\"\n />\n\n <rect\n [attr.x]=\"stroke\"\n [attr.y]=\"stroke\"\n [attr.width]=\"\n Math.max(height() - stroke * 2, (percent() / 100) * width() - stroke * 2)\n \"\n [attr.height]=\"height() - stroke * 2\"\n [attr.fill]=\"\n percent() === 100 ? palette()['secondary'] : palette()['secondary-surface']\n \"\n [attr.stroke]=\"palette()['on-background-variant']\"\n [attr.stroke-width]=\"stroke\"\n [attr.ry]=\"height() / 2 - stroke\"\n [attr.rx]=\"height() / 2 - stroke\"\n />\n</svg>\n" }]
4162
+ }], propDecorators: { width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }], height: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }], percent: [{ type: i0.Input, args: [{ isSignal: true, alias: "percent", required: false }] }], className: [{
4163
+ type: HostBinding,
4164
+ args: ['class']
4165
+ }] } });
4166
+
4167
+ /**
4168
+ * UniProgressBarComponent Barrel File
4169
+ *
4170
+ * This file exports all public-facing elements of the progress-bar component.
4171
+ */
4172
+
4173
+ class UniProgressGaugeComponent extends BaseComponent {
4174
+ percent = input(0, ...(ngDevMode ? [{ debugName: "percent" }] : /* istanbul ignore next */ []));
4175
+ textStyle = computed(() => {
4176
+ const theme = this.componentTheme();
4177
+ return theme.fixed && theme.fixed['textFill'];
4178
+ }, ...(ngDevMode ? [{ debugName: "textStyle" }] : /* istanbul ignore next */ []));
4179
+ progress = keyframes({
4180
+ '0%': { strokeDasharray: '0 100' },
4181
+ });
4182
+ get className() {
4183
+ return css({
4184
+ display: 'block',
4185
+ '& .circular-chart': {
4186
+ display: 'block',
4187
+ },
4188
+ '& .circle-bg': {
4189
+ fill: 'none',
4190
+ strokeWidth: 3.8,
4191
+ },
4192
+ '& .circle': {
4193
+ fill: 'none',
4194
+ strokeWidth: 3.8,
4195
+ animation: `${this.progress} 1s ease-out forwards`,
4196
+ },
4197
+ '& .percentage': {
4198
+ fontFamily: 'sans-serif',
4199
+ fontSize: '0.5em',
4200
+ textAnchor: 'middle',
4201
+ },
4202
+ });
2452
4203
  }
2453
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniTooltipComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2454
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.12", type: UniTooltipComponent, isStandalone: true, selector: "uni-tooltip, Tooltip", inputs: { hoverDelay: { classPropertyName: "hoverDelay", publicName: "hoverDelay", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "placement", isSignal: true, isRequired: false, transformFunction: null }, inlineText: { classPropertyName: "inlineText", publicName: "inlineText", isSignal: true, isRequired: false, transformFunction: null }, appendToBody: { classPropertyName: "appendToBody", publicName: "appendToBody", isSignal: false, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "toggleTooltip()", "mouseenter": "mouseenter()", "mouseleave": "mouseleave()" }, properties: { "class": "this.className" } }, providers: [{ provide: COMPONENT_NAME, useValue: 'tooltip' }], usesInheritance: true, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true });
4204
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniProgressGaugeComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
4205
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.12", type: UniProgressGaugeComponent, isStandalone: true, selector: "uni-progress-gauge, ProgressGauge", inputs: { percent: { classPropertyName: "percent", publicName: "percent", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "this.className" } }, providers: [{ provide: COMPONENT_NAME, useValue: 'progressGauge' }], usesInheritance: true, ngImport: i0, template: "<svg\n viewBox=\"0 0 36 36\"\n class=\"circular-chart\"\n [style.height]=\"style()['height']\"\n>\n <path\n class=\"circle-bg\"\n [attr.stroke]=\"style()['backgroundColor']\"\n d=\"M18 2.0845\n a 15.9155 15.9155 0 0 1 0 31.831\n a 15.9155 15.9155 0 0 1 0 -31.831\"\n />\n <path\n class=\"circle\"\n [attr.stroke]=\"style()['color']\"\n [attr.stroke-dasharray]=\"percent() + ', 100'\"\n d=\"M18 2.0845\n a 15.9155 15.9155 0 0 1 0 31.831\n a 15.9155 15.9155 0 0 1 0 -31.831\"\n />\n <text x=\"18.5\" y=\"20.82\" class=\"percentage\" [style.fill]=\"textStyle()\">\n {{ percent() }}%\n </text>\n</svg>\n" });
2455
4206
  }
2456
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniTooltipComponent, decorators: [{
4207
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniProgressGaugeComponent, decorators: [{
2457
4208
  type: Component,
2458
- args: [{
2459
- selector: 'uni-tooltip, Tooltip',
2460
- standalone: true,
2461
- imports: [],
2462
- template: `<ng-content></ng-content>`,
2463
- providers: [{ provide: COMPONENT_NAME, useValue: 'tooltip' }],
2464
- host: {
2465
- '(click)': 'toggleTooltip()',
2466
- '(mouseenter)': 'mouseenter()',
2467
- '(mouseleave)': 'mouseleave()',
4209
+ args: [{ selector: 'uni-progress-gauge, ProgressGauge', standalone: true, imports: [], providers: [{ provide: COMPONENT_NAME, useValue: 'progressGauge' }], template: "<svg\n viewBox=\"0 0 36 36\"\n class=\"circular-chart\"\n [style.height]=\"style()['height']\"\n>\n <path\n class=\"circle-bg\"\n [attr.stroke]=\"style()['backgroundColor']\"\n d=\"M18 2.0845\n a 15.9155 15.9155 0 0 1 0 31.831\n a 15.9155 15.9155 0 0 1 0 -31.831\"\n />\n <path\n class=\"circle\"\n [attr.stroke]=\"style()['color']\"\n [attr.stroke-dasharray]=\"percent() + ', 100'\"\n d=\"M18 2.0845\n a 15.9155 15.9155 0 0 1 0 31.831\n a 15.9155 15.9155 0 0 1 0 -31.831\"\n />\n <text x=\"18.5\" y=\"20.82\" class=\"percentage\" [style.fill]=\"textStyle()\">\n {{ percent() }}%\n </text>\n</svg>\n" }]
4210
+ }], propDecorators: { percent: [{ type: i0.Input, args: [{ isSignal: true, alias: "percent", required: false }] }], className: [{
4211
+ type: HostBinding,
4212
+ args: ['class']
4213
+ }] } });
4214
+
4215
+ /**
4216
+ * UniProgressGaugeComponent Barrel File
4217
+ *
4218
+ * This file exports all public-facing elements of the progress-gauge component.
4219
+ */
4220
+
4221
+ class UniRadioComponent extends BaseComponent {
4222
+ radioGroupClass;
4223
+ radioOptionClass;
4224
+ radioInputClass;
4225
+ // --- REQUIRED SIGNALS (populated by FormValueControl) ---
4226
+ value = model('', ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
4227
+ disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
4228
+ touched = model(false, ...(ngDevMode ? [{ debugName: "touched" }] : /* istanbul ignore next */ []));
4229
+ invalid = input(false, ...(ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []));
4230
+ dirty = input(false, ...(ngDevMode ? [{ debugName: "dirty" }] : /* istanbul ignore next */ []));
4231
+ // --- CONFIGURATION ---
4232
+ options = input([], ...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
4233
+ label = input(...(ngDevMode ? [undefined, { debugName: "label" }] : /* istanbul ignore next */ []));
4234
+ name = input('radio-group', ...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
4235
+ // Only show errors if the user has actually interacted with the field
4236
+ showError = computed(() => this.invalid() && (this.touched() || this.dirty()), ...(ngDevMode ? [{ debugName: "showError" }] : /* istanbul ignore next */ []));
4237
+ markAsTouched() {
4238
+ this.touched.set(true);
4239
+ }
4240
+ constructor() {
4241
+ super();
4242
+ effect(() => {
4243
+ const radioSize = this.componentOptions().size || 20;
4244
+ const outerCircleSize = radioSize;
4245
+ const innerCircleSize = radioSize * 0.6;
4246
+ const innerCircleOffset = (radioSize - innerCircleSize) / 2;
4247
+ this.radioGroupClass = css({
4248
+ display: 'flex',
4249
+ flexDirection: 'column',
4250
+ gap: 12,
4251
+ });
4252
+ this.radioOptionClass = css({
4253
+ userSelect: 'none',
4254
+ cursor: this.disabled() ? 'not-allowed' : 'pointer',
4255
+ display: 'flex',
4256
+ alignItems: 'center',
4257
+ gap: 8,
4258
+ opacity: this.disabled() ? 0.6 : 1,
4259
+ '& .radio-button': {
4260
+ width: outerCircleSize,
4261
+ height: outerCircleSize,
4262
+ borderRadius: '50%',
4263
+ border: `2px solid ${this.disabled() ? '#ccc' : '#d0d0d0'}`,
4264
+ position: 'relative',
4265
+ transition: 'all 0.3s ease',
4266
+ backgroundColor: '#fff',
4267
+ flexShrink: 0,
4268
+ },
4269
+ '& .radio-inner': {
4270
+ width: innerCircleSize,
4271
+ height: innerCircleSize,
4272
+ borderRadius: '50%',
4273
+ backgroundColor: this.getThemeColor(this.variant()),
4274
+ position: 'absolute',
4275
+ top: innerCircleOffset,
4276
+ left: innerCircleOffset,
4277
+ transform: 'scale(0)',
4278
+ transition: 'all 0.3s ease',
4279
+ },
4280
+ '&:hover .radio-button': this.disabled()
4281
+ ? {}
4282
+ : {
4283
+ borderColor: this.getThemeColor(this.variant()),
2468
4284
  },
2469
- }]
2470
- }], ctorParameters: () => [], propDecorators: { hoverDelay: [{ type: i0.Input, args: [{ isSignal: true, alias: "hoverDelay", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], placement: [{ type: i0.Input, args: [{ isSignal: true, alias: "placement", required: false }] }], inlineText: [{ type: i0.Input, args: [{ isSignal: true, alias: "inlineText", required: false }] }], appendToBody: [{
2471
- type: Input
2472
- }], className: [{
4285
+ '&.disabled': {
4286
+ cursor: 'not-allowed',
4287
+ opacity: 0.6,
4288
+ '& .radio-button': {
4289
+ borderColor: '#ccc',
4290
+ },
4291
+ },
4292
+ });
4293
+ this.radioInputClass = css({
4294
+ position: 'absolute',
4295
+ zIndex: -1,
4296
+ width: 0,
4297
+ height: 0,
4298
+ opacity: 0,
4299
+ '&:checked + .radio-button': {
4300
+ borderColor: this.getThemeColor(this.variant()),
4301
+ },
4302
+ '&:checked + .radio-button .radio-inner': {
4303
+ transform: 'scale(1)',
4304
+ },
4305
+ '&:focus + .radio-button': {
4306
+ outline: `2px solid ${this.getThemeColor(this.variant())}`,
4307
+ outlineOffset: '2px',
4308
+ },
4309
+ });
4310
+ });
4311
+ }
4312
+ handleRadioChange(optionValue) {
4313
+ this.value.set(optionValue);
4314
+ this.markAsTouched();
4315
+ }
4316
+ getThemeColor(token) {
4317
+ const colors = this.theme.colors();
4318
+ return colors[token] ? colors[token] : colors['primary'];
4319
+ }
4320
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniRadioComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
4321
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: UniRadioComponent, isStandalone: true, selector: "uni-radio, Radio", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, dirty: { classPropertyName: "dirty", publicName: "dirty", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", touched: "touchedChange" }, providers: [{ provide: COMPONENT_NAME, useValue: 'radio' }], usesInheritance: true, ngImport: i0, template: "<div [class]=\"radioGroupClass\">\n @if (label()) {\n <Text typeface=\"label\">{{ label() }}</Text>\n }\n\n @for (option of options(); track option.value) {\n <label\n [class]=\"radioOptionClass\"\n [class.disabled]=\"disabled() || option.disabled\"\n (click)=\"\n !disabled() && !option.disabled && handleRadioChange(option.value)\n \"\n >\n <input\n type=\"radio\"\n [class]=\"radioInputClass\"\n [value]=\"option.value\"\n [name]=\"name()\"\n [checked]=\"value() === option.value\"\n [disabled]=\"disabled() || option.disabled\"\n (change)=\"handleRadioChange(option.value)\"\n />\n <div class=\"radio-button\">\n <div class=\"radio-inner\"></div>\n </div>\n <Text typeface=\"label\">{{ option.label }}</Text>\n </label>\n }\n</div>\n", dependencies: [{ kind: "component", type: UniTextComponent, selector: "uni-text, Text", inputs: ["typeface", "color", "display", "align", "nowrap", "maxWidth", "ellipsis"] }] });
4322
+ }
4323
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniRadioComponent, decorators: [{
4324
+ type: Component,
4325
+ args: [{ selector: 'uni-radio, Radio', standalone: true, imports: [UniTextComponent], providers: [{ provide: COMPONENT_NAME, useValue: 'radio' }], template: "<div [class]=\"radioGroupClass\">\n @if (label()) {\n <Text typeface=\"label\">{{ label() }}</Text>\n }\n\n @for (option of options(); track option.value) {\n <label\n [class]=\"radioOptionClass\"\n [class.disabled]=\"disabled() || option.disabled\"\n (click)=\"\n !disabled() && !option.disabled && handleRadioChange(option.value)\n \"\n >\n <input\n type=\"radio\"\n [class]=\"radioInputClass\"\n [value]=\"option.value\"\n [name]=\"name()\"\n [checked]=\"value() === option.value\"\n [disabled]=\"disabled() || option.disabled\"\n (change)=\"handleRadioChange(option.value)\"\n />\n <div class=\"radio-button\">\n <div class=\"radio-inner\"></div>\n </div>\n <Text typeface=\"label\">{{ option.label }}</Text>\n </label>\n }\n</div>\n" }]
4326
+ }], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }, { type: i0.Output, args: ["touchedChange"] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], dirty: [{ type: i0.Input, args: [{ isSignal: true, alias: "dirty", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }] } });
4327
+
4328
+ /**
4329
+ * UniScrollAreaComponent Barrel File
4330
+ *
4331
+ * This file exports all public-facing elements of the scroll-area component.
4332
+ */
4333
+
4334
+ class UniSearchInputComponent {
4335
+ label = input.required(...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
4336
+ width = input('100%', ...(ngDevMode ? [{ debugName: "width" }] : /* istanbul ignore next */ []));
4337
+ change = output();
4338
+ search = output();
4339
+ get className() {
4340
+ return css([
4341
+ {
4342
+ display: 'flex',
4343
+ alignItems: 'center',
4344
+ },
4345
+ ]);
4346
+ }
4347
+ handleSearchInput(searchInput) {
4348
+ this.change.emit(searchInput);
4349
+ }
4350
+ handleSearch(searchInput) {
4351
+ this.search.emit(searchInput ?? '');
4352
+ }
4353
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniSearchInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
4354
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.12", type: UniSearchInputComponent, isStandalone: true, selector: "SearchInput, uni-search-input", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { change: "change", search: "search" }, host: { properties: { "class": "this.className" } }, ngImport: i0, template: "<Box\n color=\"primary\"\n borderRadius=\"max\"\n paddingHorizontal=\"sm\"\n display=\"flex\"\n border=\"quaternary\"\n alignItems=\"center\"\n [width]=\"width()\"\n>\n <Box alignSelf=\"center\" paddingHorizontal=\"md\">\n <Text display=\"block\" typeface=\"title-large\">{{ label() }}</Text>\n </Box>\n <Box\n borderRadius=\"max\"\n display=\"block\"\n paddingHorizontal=\"md\"\n paddingVertical=\"sm\"\n color=\"primary-surface\"\n [grow]=\"1\"\n >\n <DebounceInput (change)=\"handleSearchInput($event)\" #searchInput />\n </Box>\n <button\n icon-button\n iconName=\"search\"\n variant=\"ghost\"\n (click)=\"handleSearch(searchInput.value())\"\n ></button>\n</Box>\n", dependencies: [{ kind: "component", type: UniDebounceInputComponent, selector: "DebounceInput, uni-debounce-input", inputs: ["inputName", "inputId", "debounceTime"], outputs: ["change"] }, { kind: "component", type: UniTextComponent, selector: "uni-text, Text", inputs: ["typeface", "color", "display", "align", "nowrap", "maxWidth", "ellipsis"] }, { kind: "component", type: UniBoxComponent, selector: "div[uni-box-layout], Box, div[box-layout]", inputs: ["color", "backgroundColor", "borderRadius", "borderRadiusLeft", "borderRadiusRight", "borderRadiusTop", "borderRadiusBottom", "padding", "paddingHorizontal", "paddingVertical", "paddingLeft", "paddingRight", "paddingTop", "paddingBottom", "border", "borderTop", "borderBottom", "borderLeft", "borderRight", "dashBorder", "alignSelf", "alignItems", "alignContent", "justifyContent", "grow", "display", "position", "inset", "height", "minHeight", "maxHeight", "width", "minWidth", "maxWidth", "ignoreDir", "gridArea", "gridColumn", "gridRow", "overflow", "elevation", "shadow", "gap", "fullWidth", "fullHeight", "flexDirection", "textAlign", "wrapItems", "zIndex"] }, { kind: "component", type: UniIconButtonComponent, selector: "button[uni-icon-button], button[icon-button]", inputs: ["iconName", "symbolName", "variant", "size", "disable", "loading", "opticalSize"] }] });
4355
+ }
4356
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniSearchInputComponent, decorators: [{
4357
+ type: Component,
4358
+ args: [{ selector: 'SearchInput, uni-search-input', standalone: true, imports: [UniDebounceInputComponent, UniTextComponent, UniBoxComponent, UniIconButtonComponent], template: "<Box\n color=\"primary\"\n borderRadius=\"max\"\n paddingHorizontal=\"sm\"\n display=\"flex\"\n border=\"quaternary\"\n alignItems=\"center\"\n [width]=\"width()\"\n>\n <Box alignSelf=\"center\" paddingHorizontal=\"md\">\n <Text display=\"block\" typeface=\"title-large\">{{ label() }}</Text>\n </Box>\n <Box\n borderRadius=\"max\"\n display=\"block\"\n paddingHorizontal=\"md\"\n paddingVertical=\"sm\"\n color=\"primary-surface\"\n [grow]=\"1\"\n >\n <DebounceInput (change)=\"handleSearchInput($event)\" #searchInput />\n </Box>\n <button\n icon-button\n iconName=\"search\"\n variant=\"ghost\"\n (click)=\"handleSearch(searchInput.value())\"\n ></button>\n</Box>\n" }]
4359
+ }], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }], change: [{ type: i0.Output, args: ["change"] }], search: [{ type: i0.Output, args: ["search"] }], className: [{
2473
4360
  type: HostBinding,
2474
4361
  args: ['class']
2475
4362
  }] } });
2476
4363
 
2477
- //export * from './background';
4364
+ /**
4365
+ * UniSearchInputComponent Barrel File
4366
+ *
4367
+ * This file exports all public-facing elements of the search-input component.
4368
+ */
4369
+
4370
+ class UniSelectComponent {
4371
+ // --- REQUIRED SIGNALS (populated by FormValueControl) ---
4372
+ value = model(null, ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
4373
+ disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
4374
+ touched = model(false, ...(ngDevMode ? [{ debugName: "touched" }] : /* istanbul ignore next */ []));
4375
+ invalid = input(false, ...(ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []));
4376
+ dirty = input(false, ...(ngDevMode ? [{ debugName: "dirty" }] : /* istanbul ignore next */ []));
4377
+ // --- CONFIGURATION ---
4378
+ options = input([], ...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
4379
+ placeholder = input(...(ngDevMode ? [undefined, { debugName: "placeholder" }] : /* istanbul ignore next */ []));
4380
+ UNSELECTED = -1;
4381
+ /**
4382
+ * We use the index as the HTML value to avoid issues with
4383
+ * stringifying complex objects or duplicate labels.
4384
+ */
4385
+ currentSelectedIndex = computed(() => {
4386
+ const currentVal = this.value();
4387
+ if (currentVal === null || currentVal === undefined)
4388
+ return this.UNSELECTED;
4389
+ // Find the index of the option that contains our current value
4390
+ const index = this.options().findIndex((opt) => opt.value === currentVal);
4391
+ return index.toString();
4392
+ }, ...(ngDevMode ? [{ debugName: "currentSelectedIndex" }] : /* istanbul ignore next */ []));
4393
+ showError = computed(() => this.invalid() && (this.touched() || this.dirty()), ...(ngDevMode ? [{ debugName: "showError" }] : /* istanbul ignore next */ []));
4394
+ handleSelectChange(event) {
4395
+ const select = event.target;
4396
+ const index = parseInt(select.value, 10);
4397
+ if (index === this.UNSELECTED) {
4398
+ this.value.set(null);
4399
+ }
4400
+ else {
4401
+ const selectedOption = this.options()[index];
4402
+ // Update the model with the 'value' property of the Option interface
4403
+ this.value.set(selectedOption.value);
4404
+ }
4405
+ }
4406
+ selectClass = css({
4407
+ '& select': {
4408
+ paddingRight: 24, // Prevent arrow from overlapping
4409
+ cursor: 'pointer',
4410
+ '&::-ms-expand': { display: 'none' },
4411
+ },
4412
+ [`& select:has(option[value="${this.UNSELECTED}"]:checked)`]: {
4413
+ color: 'color-mix(in srgb, currentColor 50%, transparent)',
4414
+ },
4415
+ });
4416
+ arrowClass = css({
4417
+ position: 'absolute',
4418
+ right: 0,
4419
+ pointerEvents: 'none' /* Crucial for clicking through */,
4420
+ });
4421
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
4422
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: UniSelectComponent, isStandalone: true, selector: "uni-select, SelectInput", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, dirty: { classPropertyName: "dirty", publicName: "dirty", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", touched: "touchedChange" }, ngImport: i0, template: "<uni-input-box [error]=\"showError()\" [class]=\"selectClass\">\n <select\n [disabled]=\"disabled()\"\n [value]=\"currentSelectedIndex()\"\n (change)=\"handleSelectChange($event)\"\n (blur)=\"touched.set(true)\"\n >\n @if (placeholder()) {\n <option [value]=\"UNSELECTED\" disabled selected>\n {{ placeholder() }}\n </option>\n }\n\n @for (opt of options(); track opt.label; let i = $index) {\n <option [value]=\"i\">\n {{ opt.label }}\n </option>\n }\n </select>\n <uni-symbol name=\"keyboard_arrow_down\" [class]=\"arrowClass\" />\n</uni-input-box>\n", dependencies: [{ kind: "component", type: UniInputBoxComponent, selector: "uni-input-box", inputs: ["disabled", "error", "minWidth"] }, { kind: "component", type: UniSymbolComponent, selector: "uni-symbol, Symbol", inputs: ["name", "fill", "weight", "grade", "opticalSize"] }] });
4423
+ }
4424
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniSelectComponent, decorators: [{
4425
+ type: Component,
4426
+ args: [{ selector: 'uni-select, SelectInput', imports: [UniInputBoxComponent, UniSymbolComponent], template: "<uni-input-box [error]=\"showError()\" [class]=\"selectClass\">\n <select\n [disabled]=\"disabled()\"\n [value]=\"currentSelectedIndex()\"\n (change)=\"handleSelectChange($event)\"\n (blur)=\"touched.set(true)\"\n >\n @if (placeholder()) {\n <option [value]=\"UNSELECTED\" disabled selected>\n {{ placeholder() }}\n </option>\n }\n\n @for (opt of options(); track opt.label; let i = $index) {\n <option [value]=\"i\">\n {{ opt.label }}\n </option>\n }\n </select>\n <uni-symbol name=\"keyboard_arrow_down\" [class]=\"arrowClass\" />\n</uni-input-box>\n" }]
4427
+ }], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }, { type: i0.Output, args: ["touchedChange"] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], dirty: [{ type: i0.Input, args: [{ isSignal: true, alias: "dirty", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }] } });
4428
+
4429
+ /**
4430
+ * UniSortHeaderComponent Barrel File
4431
+ *
4432
+ * This file exports all public-facing elements of the sort-header component.
4433
+ */
4434
+
4435
+ class UniTagComponent {
4436
+ label = input(...(ngDevMode ? [undefined, { debugName: "label" }] : /* istanbul ignore next */ []));
4437
+ value = input(...(ngDevMode ? [undefined, { debugName: "value" }] : /* istanbul ignore next */ []));
4438
+ close = output();
4439
+ handleClose() {
4440
+ const v = this.value();
4441
+ if (v)
4442
+ this.close.emit(v);
4443
+ }
4444
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniTagComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
4445
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.12", type: UniTagComponent, isStandalone: true, selector: "Tag, uni-tag", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { close: "close" }, ngImport: i0, template: "<div box-layout color=\"primary\" borderRadius=\"max\" display=\"inline-block\">\n <div row-layout paddingLeft=\"sm\" gap=\"xs\">\n <Text display=\"block\" typeface=\"tag\">{{ label() }}</Text>\n <button icon-button symbolName=\"close\" size=\"sm\" (click)=\"handleClose()\">\n close\n </button>\n </div>\n</div>\n", dependencies: [{ kind: "component", type: UniBoxComponent, selector: "div[uni-box-layout], Box, div[box-layout]", inputs: ["color", "backgroundColor", "borderRadius", "borderRadiusLeft", "borderRadiusRight", "borderRadiusTop", "borderRadiusBottom", "padding", "paddingHorizontal", "paddingVertical", "paddingLeft", "paddingRight", "paddingTop", "paddingBottom", "border", "borderTop", "borderBottom", "borderLeft", "borderRight", "dashBorder", "alignSelf", "alignItems", "alignContent", "justifyContent", "grow", "display", "position", "inset", "height", "minHeight", "maxHeight", "width", "minWidth", "maxWidth", "ignoreDir", "gridArea", "gridColumn", "gridRow", "overflow", "elevation", "shadow", "gap", "fullWidth", "fullHeight", "flexDirection", "textAlign", "wrapItems", "zIndex"] }, { kind: "component", type: UniIconButtonComponent, selector: "button[uni-icon-button], button[icon-button]", inputs: ["iconName", "symbolName", "variant", "size", "disable", "loading", "opticalSize"] }, { kind: "component", type: UniTextComponent, selector: "uni-text, Text", inputs: ["typeface", "color", "display", "align", "nowrap", "maxWidth", "ellipsis"] }, { kind: "component", type: UniRowComponent, selector: "div[uni-row-layout], Row, div[row-layout]", inputs: ["display", "flexDirection", "minWidth"] }] });
4446
+ }
4447
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniTagComponent, decorators: [{
4448
+ type: Component,
4449
+ args: [{ selector: 'Tag, uni-tag', imports: [UniBoxComponent, UniIconButtonComponent, UniTextComponent, UniRowComponent], template: "<div box-layout color=\"primary\" borderRadius=\"max\" display=\"inline-block\">\n <div row-layout paddingLeft=\"sm\" gap=\"xs\">\n <Text display=\"block\" typeface=\"tag\">{{ label() }}</Text>\n <button icon-button symbolName=\"close\" size=\"sm\" (click)=\"handleClose()\">\n close\n </button>\n </div>\n</div>\n" }]
4450
+ }], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], close: [{ type: i0.Output, args: ["close"] }] } });
4451
+
4452
+ /**
4453
+ * UniTagComponent Barrel File
4454
+ *
4455
+ * This file exports all public-facing elements of the tag component.
4456
+ */
4457
+
4458
+ class UniToggleComponent extends BaseComponent {
4459
+ toggleLabel;
4460
+ toggleInput;
4461
+ // --- REQUIRED SIGNALS (populated by FormCheckboxControl) ---
4462
+ checked = model(false, ...(ngDevMode ? [{ debugName: "checked" }] : /* istanbul ignore next */ []));
4463
+ disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
4464
+ touched = model(false, ...(ngDevMode ? [{ debugName: "touched" }] : /* istanbul ignore next */ []));
4465
+ invalid = input(false, ...(ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []));
4466
+ dirty = input(false, ...(ngDevMode ? [{ debugName: "dirty" }] : /* istanbul ignore next */ []));
4467
+ // --- CONFIGURATION ---
4468
+ label = input(...(ngDevMode ? [undefined, { debugName: "label" }] : /* istanbul ignore next */ []));
4469
+ // Only show errors if the user has actually interacted with the field
4470
+ showError = computed(() => this.invalid() && (this.touched() || this.dirty()), ...(ngDevMode ? [{ debugName: "showError" }] : /* istanbul ignore next */ []));
4471
+ markAsTouched() {
4472
+ this.touched.set(true);
4473
+ }
4474
+ constructor() {
4475
+ super();
4476
+ effect(() => {
4477
+ const toggleSize = this.componentOptions().size || 20;
4478
+ const toggleWidth = toggleSize * 2;
4479
+ const sliderSize = toggleSize * 0.8;
4480
+ const sliderOffset = (toggleSize - sliderSize) / 2;
4481
+ this.toggleLabel = css({
4482
+ userSelect: 'none',
4483
+ cursor: this.disabled() ? 'not-allowed' : 'pointer',
4484
+ marginBottom: 0,
4485
+ display: 'flex',
4486
+ alignItems: 'center',
4487
+ gap: 8,
4488
+ opacity: this.disabled() ? 0.6 : 1,
4489
+ '& .toggle-switch': {
4490
+ width: toggleWidth,
4491
+ height: toggleSize,
4492
+ backgroundColor: this.disabled() ? '#ccc' : '#e0e0e0',
4493
+ borderRadius: toggleSize / 2,
4494
+ position: 'relative',
4495
+ transition: 'all 0.3s ease',
4496
+ },
4497
+ '& .toggle-slider': {
4498
+ width: sliderSize,
4499
+ height: sliderSize,
4500
+ backgroundColor: '#fff',
4501
+ borderRadius: '50%',
4502
+ position: 'absolute',
4503
+ top: sliderOffset,
4504
+ left: sliderOffset,
4505
+ transition: 'all 0.3s ease',
4506
+ boxShadow: '0 2px 4px rgba(0, 0, 0, 0.2)',
4507
+ },
4508
+ '&:hover .toggle-switch': this.disabled()
4509
+ ? {}
4510
+ : {
4511
+ backgroundColor: '#d0d0d0',
4512
+ },
4513
+ });
4514
+ this.toggleInput = css({
4515
+ position: 'absolute',
4516
+ zIndex: -1,
4517
+ width: 0,
4518
+ height: 0,
4519
+ opacity: 0,
4520
+ '&:checked + .toggle-switch': {
4521
+ backgroundColor: this.getThemeColor(this.variant()),
4522
+ borderColor: this.getThemeColor(this.variant()),
4523
+ },
4524
+ '&:checked + .toggle-switch .toggle-slider': {
4525
+ transform: `translateX(${toggleSize}px)`,
4526
+ },
4527
+ '&:disabled + .toggle-switch': {
4528
+ cursor: 'not-allowed',
4529
+ },
4530
+ '&:focus + .toggle-switch': {
4531
+ outline: `2px solid ${this.getThemeColor(this.variant())}`,
4532
+ outlineOffset: '2px',
4533
+ },
4534
+ });
4535
+ });
4536
+ }
4537
+ getThemeColor(token) {
4538
+ const colors = this.theme.colors();
4539
+ return colors[token] ? colors[token] : colors['primary'];
4540
+ }
4541
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniToggleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
4542
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: UniToggleComponent, isStandalone: true, selector: "uni-toggle, Toggle", inputs: { checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, dirty: { classPropertyName: "dirty", publicName: "dirty", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checked: "checkedChange", touched: "touchedChange" }, providers: [{ provide: COMPONENT_NAME, useValue: 'toggle' }], usesInheritance: true, ngImport: i0, template: "<label [class]=\"toggleLabel\">\n <input\n type=\"checkbox\"\n [class]=\"toggleInput\"\n [checked]=\"checked()\"\n (change)=\"checked.set($any($event.target).checked); markAsTouched()\"\n [disabled]=\"disabled()\"\n />\n <div class=\"toggle-switch\">\n <div class=\"toggle-slider\"></div>\n </div>\n @if (label()) {\n <Text typeface=\"label\">{{ label() }}</Text>\n }\n</label>\n", dependencies: [{ kind: "component", type: UniTextComponent, selector: "uni-text, Text", inputs: ["typeface", "color", "display", "align", "nowrap", "maxWidth", "ellipsis"] }] });
4543
+ }
4544
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniToggleComponent, decorators: [{
4545
+ type: Component,
4546
+ args: [{ selector: 'uni-toggle, Toggle', standalone: true, imports: [UniTextComponent], providers: [{ provide: COMPONENT_NAME, useValue: 'toggle' }], template: "<label [class]=\"toggleLabel\">\n <input\n type=\"checkbox\"\n [class]=\"toggleInput\"\n [checked]=\"checked()\"\n (change)=\"checked.set($any($event.target).checked); markAsTouched()\"\n [disabled]=\"disabled()\"\n />\n <div class=\"toggle-switch\">\n <div class=\"toggle-slider\"></div>\n </div>\n @if (label()) {\n <Text typeface=\"label\">{{ label() }}</Text>\n }\n</label>\n" }]
4547
+ }], ctorParameters: () => [], propDecorators: { checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }, { type: i0.Output, args: ["checkedChange"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }, { type: i0.Output, args: ["touchedChange"] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], dirty: [{ type: i0.Input, args: [{ isSignal: true, alias: "dirty", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }] } });
2478
4548
 
2479
4549
  /**
2480
4550
  * Generated bundle index. Do not edit.
2481
4551
  */
2482
4552
 
2483
- export { ConfirmationDialogComponent, LocalStorageService, NotificationService, NotificationsComponent, RippleDirective, ThemeService, UNI_THEMES, UniAlertComponent, UniBadgeComponent, UniBaseDatasource, UniBoxComponent, UniButtonComponent, UniCardComponent, UniCardContentComponent, UniCardHeaderComponent, UniCenterComponent, UniDialogButtonsComponent, UniDialogComponent, UniDialogHeaderComponent, UniDividerComponent, UniDropdownComponent, UniGridAreaComponent, UniGridComponent, UniIconButtonComponent, UniIconComponent, UniMenuComponent, UniRecordDatasource, UniRowComponent, UniServerSideDatasource, UniSnackbarComponent, UniStackComponent, UniSymbolComponent, UniTextComponent, UniTooltipComponent, UniWrapComponent, useTimer };
4553
+ export { BodyRenderDirective, ConfirmationDialogComponent, DragAndDropDirective, LocalStorageService, NotificationService, NotificationsComponent, RippleDirective, ThemeService, UNI_THEMES, UniAlertComponent, UniBackgroundComponent, UniBadgeComponent, UniBaseDatasource, UniBoxComponent, UniButtonComponent, UniButtonGroupComponent, UniCardComponent, UniCardContentComponent, UniCardHeaderComponent, UniCenterComponent, UniCheckboxComponent, UniDataSearchComponent, UniDataTableComponent, UniDebounceInputComponent, UniDialogButtonsComponent, UniDialogComponent, UniDialogHeaderComponent, UniDividerComponent, UniDropdownComponent, UniExpandAreaComponent, UniExpandComponent, UniExpandToggleComponent, UniFileDropZoneComponent, UniGridAreaComponent, UniGridComponent, UniIconButtonComponent, UniIconComponent, UniInputBoxComponent, UniInputComponent, UniJsonViewComponent, UniMenuComponent, UniMultiSelectComponent, UniMultiSelectDropdownComponent, UniNotificationBadgeComponent, UniPaginatorComponent, UniPopoverComponent, UniProgressBarComponent, UniProgressGaugeComponent, UniRadioComponent, UniRecordDatasource, UniRowComponent, UniScrollAreaComponent, UniSearchInputComponent, UniSelectComponent, UniServerSideDatasource, UniSnackbarComponent, UniSortHeaderComponent, UniStackComponent, UniSymbolComponent, UniTagComponent, UniTextComponent, UniToggleComponent, UniTooltipComponent, UniWrapComponent, acceptableFile, getFileExtension, useTimer };
2484
4554
  //# sourceMappingURL=uni-design-system-uni-angular.mjs.map