@kaufmann-lab/ui 0.1.19 → 0.1.20

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kaufmann-lab/ui",
3
- "version": "0.1.19",
3
+ "version": "0.1.20",
4
4
  "description": "Shared Angular component library for the Kaufmann frontends",
5
5
  "license": "MIT",
6
6
  "author": "Kaufmann Lab",
@@ -8,6 +8,18 @@ interface CompanySelectorMeta {
8
8
  label: string;
9
9
  value: string;
10
10
  }
11
+ /**
12
+ * Empresa elegible. `value` es el identificador único (ej. número de
13
+ * cuenta) — dos empresas con el mismo `label` se seleccionan por separado.
14
+ * `tag` se muestra como badge junto al nombre (ej. 'Personal' | 'Empresa')
15
+ * y `detail` como línea secundaria en el panel (ej. 'RUC 20434860808').
16
+ */
17
+ interface CompanySelectorOption {
18
+ value: string;
19
+ label: string;
20
+ tag?: string;
21
+ detail?: string;
22
+ }
11
23
  /**
12
24
  * Conmutador de empresa activa con metadatos clave (página 32) — encabeza
13
25
  * la pantalla de inicio del portal. Compone `kf-select` para el propio
@@ -25,10 +37,22 @@ interface CompanySelectorMeta {
25
37
  * { label: 'Sucursal', value: 'Sucursal Norte' },
26
38
  * ]"
27
39
  * />
40
+ *
41
+ * Con opciones en forma de objeto, `value`/`valueChange` usan el `value` de
42
+ * la opción, no su nombre:
43
+ *
44
+ * <kf-company-selector
45
+ * [companies]="[
46
+ * { value: '1002099', label: 'DIANA CAROLINA PINZÓN MALDONADO', tag: 'Personal', detail: 'DNI 46594489' },
47
+ * { value: '1004410', label: 'TRANSPORTES VIRGEN DE LA AGRICULTURA', tag: 'Empresa', detail: 'RUC 20434860808' },
48
+ * ]"
49
+ * [value]="activeAccount()"
50
+ * (valueChange)="activeAccount.set($event)"
51
+ * />
28
52
  */
29
53
  declare class CompanySelector {
30
54
  readonly label: _angular_core.InputSignal<string>;
31
- readonly companies: _angular_core.InputSignal<string[]>;
55
+ readonly companies: _angular_core.InputSignal<readonly (string | CompanySelectorOption)[]>;
32
56
  readonly value: _angular_core.InputSignal<string | undefined>;
33
57
  readonly meta: _angular_core.InputSignal<CompanySelectorMeta[]>;
34
58
  readonly valueChange: _angular_core.OutputEmitterRef<string>;
@@ -310,4 +334,4 @@ declare class VehicleHeader {
310
334
  }
311
335
 
312
336
  export { CompanySelector, QuotePicker, ReserveBlock, VehicleHeader };
313
- export type { CompanySelectorMeta, QuotePickerChip, QuotePickerSortOption, VehicleHeaderStatus };
337
+ export type { CompanySelectorMeta, CompanySelectorOption, QuotePickerChip, QuotePickerSortOption, VehicleHeaderStatus };
@@ -2628,10 +2628,16 @@ declare class Segmented {
2628
2628
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<Segmented, "kf-segmented", never, { "options": { "alias": "options"; "required": true; "isSignal": true; }; "value": { "alias": "value"; "required": true; "isSignal": true; }; }, { "valueChange": "valueChange"; }, never, never, true, never>;
2629
2629
  }
2630
2630
 
2631
- /** Normalized shape used internally once `options` (string[] or object[]) is resolved. */
2631
+ /**
2632
+ * Opción en forma de objeto. `tag` se muestra como `kf-badge` a la derecha
2633
+ * del label (en el panel y en el trigger) y `detail` como línea secundaria
2634
+ * atenuada debajo, solo en el panel. Ambos entran en la búsqueda.
2635
+ */
2632
2636
  interface SelectOption {
2633
2637
  value: string;
2634
2638
  label: string;
2639
+ tag?: string;
2640
+ detail?: string;
2635
2641
  }
2636
2642
  /**
2637
2643
  * Dropdown de selección simple con panel propio — NUNCA usa el `<select>`
@@ -2644,6 +2650,7 @@ interface SelectOption {
2644
2650
  *
2645
2651
  * <kf-select label="Sede" [options]="['Lima', 'Arequipa', 'Trujillo']" placeholder="Selecciona…" />
2646
2652
  * <kf-select [options]="[{ value: 'pe', label: 'Perú' }]" (valueChange)="onCountry($event)" />
2653
+ * <kf-select [options]="[{ value: '1002099', label: 'BBVA', tag: 'Empresa', detail: 'RUC 20100130204' }]" />
2647
2654
  *
2648
2655
  * `variant="compact"` cambia el ancho de `240px` fijo a intrínseco con un
2649
2656
  * techo de `160px` (se ajusta al contenido de la opción seleccionada hasta
@@ -2663,7 +2670,7 @@ interface SelectOption {
2663
2670
  */
2664
2671
  declare class Select {
2665
2672
  readonly label: _angular_core.InputSignal<string | undefined>;
2666
- readonly options: _angular_core.InputSignal<string[] | SelectOption[]>;
2673
+ readonly options: _angular_core.InputSignal<readonly (string | SelectOption)[]>;
2667
2674
  readonly value: _angular_core.InputSignal<string | undefined>;
2668
2675
  readonly placeholder: _angular_core.InputSignal<string>;
2669
2676
  readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
@@ -2695,7 +2702,7 @@ declare class Select {
2695
2702
  readonly isOpen: _angular_core.WritableSignal<boolean>;
2696
2703
  readonly searchQuery: _angular_core.WritableSignal<string>;
2697
2704
  readonly activeIndex: _angular_core.WritableSignal<number>;
2698
- /** Resolves the union (`string[] | { value; label }[]`) into a single shape for the template. */
2705
+ /** Resolves `string | SelectOption` entries into a single shape for the template. */
2699
2706
  readonly normalizedOptions: _angular_core.Signal<SelectOption[]>;
2700
2707
  readonly selectedOption: _angular_core.Signal<SelectOption | undefined>;
2701
2708
  readonly showSearch: _angular_core.Signal<boolean>;
@@ -2714,6 +2721,8 @@ declare class Select {
2714
2721
  */
2715
2722
  onDocumentEscape(): void;
2716
2723
  toggle(): void;
2724
+ /** Nombre accesible explícito solo para opciones con `tag`/`detail`, para separar las partes al leerlas. */
2725
+ optionAriaLabel(option: SelectOption): string | null;
2717
2726
  select(option: SelectOption): void;
2718
2727
  onSearchInput(event: Event): void;
2719
2728
  /**
@@ -3456,4 +3465,4 @@ declare class ViewToggle {
3456
3465
  }
3457
3466
 
3458
3467
  export { ActionTile, AdminBadge, Alert, AlertRow, Avatar, Badge, Breadcrumb, BucketProgress, Button, Calendar, Card, Carousel, CarouselSlide, Checkbox, Chip, Collapsible, ContactPopover, ContentSlot, ContentState, ContentViewer, DEFAULT_PAGE_SIZE_OPTIONS, DataTable, Divider, DocumentRow, Drawer, Dropdown, DropdownItem, DropdownPanel, EmptyState, EventTimeline, FeatureCard, Field, FieldLabel, Filter, FilterChips, FolderTabs, FolderTabsPanel, Footer, FormatInputDirective, Icon, Input, JourneyStepper, Link, MetricCard, Modal, MultiSelect, NoteBlock, PageHeader, Pagination, Panel, PortalHeader, Progress, PulseDot, RowActions, SectionHeader, SectionNav, SectionNavItem, SectionNavSubsection, Segmented, Select, SelectableCardGroup, SidebarShell, Skeleton, Spinner, StatCard, StatTile, StatusPill, Tabs, Text, Textarea, TileGrid, TimeSlotPicker, ToastHost, ToastService, TooltipDirective, ViewToggle, dataTableViewSignal };
3459
- export type { AlertRowTone, AlertTone, BreadcrumbItem, BucketProgressItem, CalendarDay, ContentStateKind, ContentStateLoad, ContentViewerType, DataTableCardRole, DataTableColumn, DataTableDensity, DataTableSort, DataTableView, DividerOrientation, DocumentRowTone, DrawerSide, DropdownItemTone, DropdownPanelVariant, EventTimelineItem, EventTimelineTone, FilterFieldChange, FilterFieldConfig, FilterFieldType, FilterValue, FolderTabOption, FooterLink, IconName, IconRotation, IconSize, JourneyStep, JourneyStepStatus, JourneyStepperColorScheme, JourneyStepperSurface, LinkVariant, MultiSelectOption, NoteBlockTone, PageHeaderTitleSize, PaginationItem, PortalHeaderAdminAction, PortalHeaderNavItem, ProgressTone, RowAction, RowActionKind, RowActionsMode, SectionNavSubsectionData, SegmentedOption, SelectableCardOption, SidebarNavItemData, SkeletonVariant, SpinnerSize, StatCardTone, StatTileTone, StatTileVariant, TabOption, TextAs, TextTone, TextVariant, TimeSlot, ToastAction, ToastOptions, ToastPromiseMessages, ToastState, ToastTone, TooltipPosition, ViewToggleOption };
3468
+ export type { AlertRowTone, AlertTone, BreadcrumbItem, BucketProgressItem, CalendarDay, ContentStateKind, ContentStateLoad, ContentViewerType, DataTableCardRole, DataTableColumn, DataTableDensity, DataTableSort, DataTableView, DividerOrientation, DocumentRowTone, DrawerSide, DropdownItemTone, DropdownPanelVariant, EventTimelineItem, EventTimelineTone, FilterFieldChange, FilterFieldConfig, FilterFieldType, FilterValue, FolderTabOption, FooterLink, IconName, IconRotation, IconSize, JourneyStep, JourneyStepStatus, JourneyStepperColorScheme, JourneyStepperSurface, LinkVariant, MultiSelectOption, NoteBlockTone, PageHeaderTitleSize, PaginationItem, PortalHeaderAdminAction, PortalHeaderNavItem, ProgressTone, RowAction, RowActionKind, RowActionsMode, SectionNavSubsectionData, SegmentedOption, SelectOption, SelectableCardOption, SidebarNavItemData, SkeletonVariant, SpinnerSize, StatCardTone, StatTileTone, StatTileVariant, TabOption, TextAs, TextTone, TextVariant, TimeSlot, ToastAction, ToastOptions, ToastPromiseMessages, ToastState, ToastTone, TooltipPosition, ViewToggleOption };