@tolle_/tolle-ui 18.2.29 → 18.2.30
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/esm2022/lib/accordion-item.component.mjs +5 -11
- package/esm2022/lib/accordion.component.mjs +4 -9
- package/esm2022/lib/alert-dialog-dynamic.component.mjs +5 -10
- package/esm2022/lib/alert-dialog.component.mjs +44 -59
- package/esm2022/lib/alert.component.mjs +5 -11
- package/esm2022/lib/aspect-ratio.component.mjs +119 -0
- package/esm2022/lib/attachment.component.mjs +334 -0
- package/esm2022/lib/avatar-fallback.component.mjs +3 -3
- package/esm2022/lib/avatar.component.mjs +4 -9
- package/esm2022/lib/badge.component.mjs +4 -9
- package/esm2022/lib/breadcrumb-item.component.mjs +3 -3
- package/esm2022/lib/breadcrumb-link.component.mjs +3 -3
- package/esm2022/lib/breadcrumb-separator.component.mjs +3 -3
- package/esm2022/lib/breadcrumb.component.mjs +3 -3
- package/esm2022/lib/bubble.component.mjs +301 -0
- package/esm2022/lib/button.component.mjs +5 -11
- package/esm2022/lib/calendar.component.mjs +5 -11
- package/esm2022/lib/card.component.mjs +14 -43
- package/esm2022/lib/carousel/carousel.component.mjs +5 -12
- package/esm2022/lib/chain-of-thought.component.mjs +380 -0
- package/esm2022/lib/chart-pie.component.mjs +386 -0
- package/esm2022/lib/chart.component.mjs +1146 -0
- package/esm2022/lib/chart.service.mjs +555 -0
- package/esm2022/lib/checkbox.component.mjs +5 -11
- package/esm2022/lib/checkpoint.component.mjs +134 -0
- package/esm2022/lib/collapsible.component.mjs +4 -11
- package/esm2022/lib/combobox.component.mjs +372 -0
- package/esm2022/lib/command-dialog.component.mjs +164 -0
- package/esm2022/lib/command.component.mjs +514 -0
- package/esm2022/lib/command.service.mjs +130 -0
- package/esm2022/lib/confirmation.component.mjs +219 -0
- package/esm2022/lib/context-menu-trigger.directive.mjs +36 -0
- package/esm2022/lib/context-menu.component.mjs +460 -0
- package/esm2022/lib/context-menu.service.mjs +121 -0
- package/esm2022/lib/context.component.mjs +377 -0
- package/esm2022/lib/conversation.component.mjs +442 -0
- package/esm2022/lib/country-selector.component.mjs +5 -11
- package/esm2022/lib/data-table.component.mjs +59 -12
- package/esm2022/lib/date-picker.component.mjs +251 -198
- package/esm2022/lib/date-range-picker.component.mjs +224 -116
- package/esm2022/lib/date-time-picker.component.mjs +506 -0
- package/esm2022/lib/direction.component.mjs +79 -0
- package/esm2022/lib/dropdown-item.component.mjs +3 -3
- package/esm2022/lib/dropdown-label.component.mjs +3 -3
- package/esm2022/lib/dropdown-menu.component.mjs +3 -3
- package/esm2022/lib/dropdown-separator.component.mjs +3 -3
- package/esm2022/lib/dropdown-trigger.directive.mjs +6 -4
- package/esm2022/lib/empty-state.component.mjs +4 -9
- package/esm2022/lib/field.component.mjs +394 -0
- package/esm2022/lib/hover-card.component.mjs +6 -16
- package/esm2022/lib/inline-citation.component.mjs +263 -0
- package/esm2022/lib/input-group.component.mjs +418 -0
- package/esm2022/lib/input.component.mjs +5 -11
- package/esm2022/lib/item.component.mjs +243 -0
- package/esm2022/lib/kbd.component.mjs +82 -0
- package/esm2022/lib/label.component.mjs +4 -9
- package/esm2022/lib/marker.component.mjs +135 -0
- package/esm2022/lib/masked-input.component.mjs +5 -11
- package/esm2022/lib/menubar.component.mjs +683 -0
- package/esm2022/lib/message-scroller.component.mjs +353 -0
- package/esm2022/lib/message-scroller.service.mjs +157 -0
- package/esm2022/lib/message.component.mjs +228 -0
- package/esm2022/lib/model-selector.component.mjs +310 -0
- package/esm2022/lib/multi-select.component.mjs +155 -72
- package/esm2022/lib/native-select.component.mjs +201 -0
- package/esm2022/lib/navigation-menu.component.mjs +642 -0
- package/esm2022/lib/otp-group.component.mjs +3 -3
- package/esm2022/lib/otp-slot.component.mjs +4 -9
- package/esm2022/lib/otp.component.mjs +5 -11
- package/esm2022/lib/pagination.component.mjs +7 -10
- package/esm2022/lib/plan.component.mjs +335 -0
- package/esm2022/lib/popover-content.component.mjs +4 -9
- package/esm2022/lib/popover.component.mjs +15 -13
- package/esm2022/lib/progress.component.mjs +4 -9
- package/esm2022/lib/prompt-input.component.mjs +526 -0
- package/esm2022/lib/queue.component.mjs +280 -0
- package/esm2022/lib/radio-group.component.mjs +6 -13
- package/esm2022/lib/radio-item.component.mjs +4 -9
- package/esm2022/lib/range-calendar.component.mjs +5 -11
- package/esm2022/lib/reasoning.component.mjs +335 -0
- package/esm2022/lib/resizable.component.mjs +219 -0
- package/esm2022/lib/segment.component.mjs +17 -7
- package/esm2022/lib/select-group.component.mjs +4 -8
- package/esm2022/lib/select-item.component.mjs +4 -9
- package/esm2022/lib/select-separator.component.mjs +4 -8
- package/esm2022/lib/select.component.mjs +133 -49
- package/esm2022/lib/separator.component.mjs +4 -9
- package/esm2022/lib/sheet.component.mjs +38 -56
- package/esm2022/lib/shimmer.component.mjs +84 -0
- package/esm2022/lib/sidebar.component.mjs +11 -1
- package/esm2022/lib/skeleton.component.mjs +4 -9
- package/esm2022/lib/sources.component.mjs +452 -0
- package/esm2022/lib/spinner.component.mjs +68 -0
- package/esm2022/lib/suggestion.component.mjs +207 -0
- package/esm2022/lib/switch.component.mjs +5 -11
- package/esm2022/lib/table.component.mjs +213 -0
- package/esm2022/lib/tabs.component.mjs +4 -11
- package/esm2022/lib/tag-input.component.mjs +5 -11
- package/esm2022/lib/task.component.mjs +359 -0
- package/esm2022/lib/textarea.component.mjs +5 -11
- package/esm2022/lib/theme.service.mjs +17 -6
- package/esm2022/lib/time-picker.component.mjs +923 -0
- package/esm2022/lib/toast.service.mjs +3 -2
- package/esm2022/lib/toaster.component.mjs +76 -39
- package/esm2022/lib/toggle-group.component.mjs +4 -9
- package/esm2022/lib/toggle.component.mjs +5 -11
- package/esm2022/lib/tool.component.mjs +462 -0
- package/esm2022/lib/typography.component.mjs +83 -0
- package/esm2022/lib/utils/color.mjs +140 -19
- package/esm2022/public-api.mjs +61 -1
- package/fesm2022/tolle-ui.mjs +16453 -1024
- package/fesm2022/tolle-ui.mjs.map +1 -1
- package/lib/alert-dialog.component.d.ts +10 -2
- package/lib/aspect-ratio.component.d.ts +20 -0
- package/lib/attachment.component.d.ts +101 -0
- package/lib/bubble.component.d.ts +112 -0
- package/lib/chain-of-thought.component.d.ts +166 -0
- package/lib/chart-pie.component.d.ts +108 -0
- package/lib/chart.component.d.ts +369 -0
- package/lib/chart.service.d.ts +222 -0
- package/lib/checkpoint.component.d.ts +51 -0
- package/lib/combobox.component.d.ts +90 -0
- package/lib/command-dialog.component.d.ts +53 -0
- package/lib/command.component.d.ts +189 -0
- package/lib/command.service.d.ts +67 -0
- package/lib/confirmation.component.d.ts +70 -0
- package/lib/context-menu-trigger.directive.d.ts +12 -0
- package/lib/context-menu.component.d.ts +41 -0
- package/lib/context-menu.service.d.ts +38 -0
- package/lib/context.component.d.ts +134 -0
- package/lib/conversation.component.d.ts +165 -0
- package/lib/data-table.component.d.ts +26 -1
- package/lib/date-picker.component.d.ts +72 -11
- package/lib/date-range-picker.component.d.ts +63 -6
- package/lib/date-time-picker.component.d.ts +119 -0
- package/lib/direction.component.d.ts +45 -0
- package/lib/field.component.d.ts +201 -0
- package/lib/inline-citation.component.d.ts +103 -0
- package/lib/input-group.component.d.ts +150 -0
- package/lib/item.component.d.ts +154 -0
- package/lib/kbd.component.d.ts +50 -0
- package/lib/marker.component.d.ts +58 -0
- package/lib/menubar.component.d.ts +247 -0
- package/lib/message-scroller.component.d.ts +159 -0
- package/lib/message-scroller.service.d.ts +73 -0
- package/lib/message.component.d.ts +128 -0
- package/lib/model-selector.component.d.ts +103 -0
- package/lib/multi-select.component.d.ts +66 -14
- package/lib/native-select.component.d.ts +57 -0
- package/lib/navigation-menu.component.d.ts +230 -0
- package/lib/plan.component.d.ts +120 -0
- package/lib/popover.component.d.ts +1 -0
- package/lib/prompt-input.component.d.ts +194 -0
- package/lib/queue.component.d.ts +106 -0
- package/lib/reasoning.component.d.ts +127 -0
- package/lib/resizable.component.d.ts +43 -0
- package/lib/segment.component.d.ts +13 -3
- package/lib/select.component.d.ts +37 -5
- package/lib/sheet.component.d.ts +3 -0
- package/lib/shimmer.component.d.ts +38 -0
- package/lib/sidebar.component.d.ts +2 -0
- package/lib/sources.component.d.ts +156 -0
- package/lib/spinner.component.d.ts +29 -0
- package/lib/suggestion.component.d.ts +96 -0
- package/lib/table.component.d.ts +106 -0
- package/lib/task.component.d.ts +151 -0
- package/lib/theme.service.d.ts +9 -0
- package/lib/time-picker.component.d.ts +243 -0
- package/lib/toast.service.d.ts +3 -1
- package/lib/toaster.component.d.ts +26 -9
- package/lib/tool.component.d.ts +158 -0
- package/lib/typography.component.d.ts +32 -0
- package/lib/utils/color.d.ts +19 -5
- package/package.json +1 -1
- package/public-api.d.ts +50 -0
- package/registry/docs-content.json +8480 -1542
- package/registry/llms-full.txt +2679 -319
- package/registry/llms.txt +43 -4
- package/registry/manifest.json +9090 -1742
- package/registry/r/accordion-item.json +1 -1
- package/registry/r/accordion.json +1 -1
- package/registry/r/alert-dialog-dynamic.json +1 -1
- package/registry/r/alert-dialog.json +1 -1
- package/registry/r/alert.json +1 -1
- package/registry/r/attachment.json +23 -0
- package/registry/r/avatar-fallback.json +1 -1
- package/registry/r/avatar.json +1 -1
- package/registry/r/badge.json +1 -1
- package/registry/r/breadcrumb-item.json +1 -1
- package/registry/r/breadcrumb-link.json +1 -1
- package/registry/r/breadcrumb-separator.json +1 -1
- package/registry/r/breadcrumb.json +1 -1
- package/registry/r/bubble.json +23 -0
- package/registry/r/button.json +1 -1
- package/registry/r/calendar.json +1 -1
- package/registry/r/card.json +1 -1
- package/registry/r/carousel.json +1 -1
- package/registry/r/chain-of-thought.json +23 -0
- package/registry/r/chart-pie.json +30 -0
- package/registry/r/chart.json +28 -0
- package/registry/r/checkbox.json +1 -1
- package/registry/r/checkpoint.json +23 -0
- package/registry/r/collapsible.json +1 -1
- package/registry/r/combobox.json +31 -0
- package/registry/r/command-dialog.json +21 -0
- package/registry/r/command.json +26 -0
- package/registry/r/confirmation.json +23 -0
- package/registry/r/context.json +26 -0
- package/registry/r/conversation.json +23 -0
- package/registry/r/country-selector.json +1 -1
- package/registry/r/data-table.json +1 -1
- package/registry/r/date-picker.json +4 -4
- package/registry/r/date-range-picker.json +3 -3
- package/registry/r/date-time-picker.json +28 -0
- package/registry/r/direction.json +16 -0
- package/registry/r/dropdown-item.json +1 -1
- package/registry/r/dropdown-label.json +1 -1
- package/registry/r/dropdown-menu.json +1 -1
- package/registry/r/dropdown-separator.json +1 -1
- package/registry/r/dropdown-trigger.json +1 -1
- package/registry/r/empty-state.json +1 -1
- package/registry/r/field.json +23 -0
- package/registry/r/hover-card.json +1 -1
- package/registry/r/inline-citation.json +26 -0
- package/registry/r/input-group.json +23 -0
- package/registry/r/input.json +1 -1
- package/registry/r/item.json +23 -0
- package/registry/r/kbd.json +23 -0
- package/registry/r/label.json +1 -1
- package/registry/r/marker.json +23 -0
- package/registry/r/masked-input.json +1 -1
- package/registry/r/menubar.json +24 -0
- package/registry/r/message-scroller.json +26 -0
- package/registry/r/message.json +23 -0
- package/registry/r/model-selector.json +32 -0
- package/registry/r/multi-select.json +2 -2
- package/registry/r/native-select.json +23 -0
- package/registry/r/navigation-menu.json +24 -0
- package/registry/r/otp-group.json +1 -1
- package/registry/r/otp-slot.json +1 -1
- package/registry/r/otp.json +1 -1
- package/registry/r/pagination.json +3 -2
- package/registry/r/plan.json +23 -0
- package/registry/r/popover-content.json +1 -1
- package/registry/r/popover.json +1 -1
- package/registry/r/progress.json +1 -1
- package/registry/r/prompt-input.json +23 -0
- package/registry/r/queue.json +23 -0
- package/registry/r/radio-group.json +1 -1
- package/registry/r/radio-item.json +1 -1
- package/registry/r/range-calendar.json +1 -1
- package/registry/r/reasoning.json +23 -0
- package/registry/r/segment.json +1 -1
- package/registry/r/select-group.json +1 -1
- package/registry/r/select-item.json +1 -1
- package/registry/r/select-separator.json +1 -1
- package/registry/r/select.json +4 -3
- package/registry/r/separator.json +1 -1
- package/registry/r/sheet.json +1 -1
- package/registry/r/shimmer.json +23 -0
- package/registry/r/sidebar.json +1 -1
- package/registry/r/skeleton.json +1 -1
- package/registry/r/sources.json +23 -0
- package/registry/r/spinner.json +23 -0
- package/registry/r/suggestion.json +23 -0
- package/registry/r/switch.json +1 -1
- package/registry/r/table.json +21 -0
- package/registry/r/tabs.json +1 -1
- package/registry/r/tag-input.json +1 -1
- package/registry/r/task.json +23 -0
- package/registry/r/textarea.json +1 -1
- package/registry/r/time-picker.json +24 -0
- package/registry/r/toaster.json +2 -2
- package/registry/r/toggle-group.json +1 -1
- package/registry/r/toggle.json +1 -1
- package/registry/r/tool.json +23 -0
- package/registry/r/typography.json +23 -0
- package/registry/registry.json +915 -22
- package/theme.css +109 -8
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import { Component, Input, Output, EventEmitter, forwardRef } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
4
|
+
import { cva } from 'class-variance-authority';
|
|
5
|
+
import { cn } from './utils/cn';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
import * as i1 from "@angular/common";
|
|
8
|
+
const nativeSelectVariants = cva('flex w-full appearance-none items-center rounded-md border border-input bg-background text-foreground shadow-sm transition-colors ' +
|
|
9
|
+
'focus:outline-none focus-visible:border-primary/80 focus-visible:ring-4 focus-visible:ring-ring/30 ' +
|
|
10
|
+
'disabled:cursor-not-allowed disabled:opacity-50', {
|
|
11
|
+
variants: {
|
|
12
|
+
size: {
|
|
13
|
+
xs: 'h-8 pl-2 pr-7 text-xs',
|
|
14
|
+
sm: 'h-9 pl-3 pr-8 text-sm',
|
|
15
|
+
default: 'h-10 pl-3 pr-8 text-sm',
|
|
16
|
+
lg: 'h-11 pl-4 pr-9 text-base',
|
|
17
|
+
},
|
|
18
|
+
invalid: {
|
|
19
|
+
true: 'border-destructive focus-visible:border-destructive/80 focus-visible:ring-destructive/30',
|
|
20
|
+
false: '',
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
defaultVariants: { size: 'default', invalid: false },
|
|
24
|
+
});
|
|
25
|
+
/**
|
|
26
|
+
* A styled native `<select>`. Unlike `tolle-select` it uses the platform
|
|
27
|
+
* dropdown, so it needs no portal or floating-ui and works well on mobile and
|
|
28
|
+
* inside forms that must degrade without JavaScript.
|
|
29
|
+
*
|
|
30
|
+
* Options come from `options`, or from projected `<option>` elements when you
|
|
31
|
+
* need `<optgroup>` or custom markup.
|
|
32
|
+
* @new
|
|
33
|
+
*/
|
|
34
|
+
export class NativeSelectComponent {
|
|
35
|
+
cdr;
|
|
36
|
+
/** Id applied to the underlying `<select>`; pair it with a `tolle-label`. */
|
|
37
|
+
id = `native-select-${Math.random().toString(36).slice(2, 11)}`;
|
|
38
|
+
/** Options to render. Omit and project `<option>` elements for custom markup. @default [] */
|
|
39
|
+
options = [];
|
|
40
|
+
/** Non-selectable prompt shown when no value is set. @default '' */
|
|
41
|
+
placeholder = '';
|
|
42
|
+
/** Height and text size of the control. @default 'default' */
|
|
43
|
+
size = 'default';
|
|
44
|
+
/** Applies the destructive border and sets `aria-invalid`. @default false */
|
|
45
|
+
invalid = false;
|
|
46
|
+
/** Disables the control. @default false */
|
|
47
|
+
disabled = false;
|
|
48
|
+
/** Accessible name when there is no associated visible label. @default '' */
|
|
49
|
+
ariaLabel = '';
|
|
50
|
+
/** Extra Tailwind classes merged onto the `<select>` via `cn()` (last-wins). */
|
|
51
|
+
class = '';
|
|
52
|
+
/** Emitted with the newly selected value whenever the user picks an option. */
|
|
53
|
+
valueChange = new EventEmitter();
|
|
54
|
+
value = null;
|
|
55
|
+
onChange = () => { };
|
|
56
|
+
onTouched = () => { };
|
|
57
|
+
constructor(cdr) {
|
|
58
|
+
this.cdr = cdr;
|
|
59
|
+
}
|
|
60
|
+
get computedClass() {
|
|
61
|
+
return cn(nativeSelectVariants({ size: this.size, invalid: this.invalid }), this.class);
|
|
62
|
+
}
|
|
63
|
+
onSelectChange(event) {
|
|
64
|
+
const raw = event.target.value;
|
|
65
|
+
// Options rendered from `options` carry their index as the DOM value, so we
|
|
66
|
+
// can hand back the ORIGINAL value — object, number or string — untouched.
|
|
67
|
+
// Anything else came from a projected <option>, where the string is all
|
|
68
|
+
// there is.
|
|
69
|
+
const index = Number(raw);
|
|
70
|
+
const fromOptions = raw !== '' && Number.isInteger(index) && index >= 0 && index < this.options.length;
|
|
71
|
+
const next = fromOptions ? this.options[index].value : raw;
|
|
72
|
+
this.value = next;
|
|
73
|
+
this.onChange(next);
|
|
74
|
+
this.valueChange.emit(next);
|
|
75
|
+
}
|
|
76
|
+
writeValue(value) {
|
|
77
|
+
this.value = value;
|
|
78
|
+
this.cdr.markForCheck();
|
|
79
|
+
}
|
|
80
|
+
registerOnChange(fn) {
|
|
81
|
+
this.onChange = fn;
|
|
82
|
+
}
|
|
83
|
+
registerOnTouched(fn) {
|
|
84
|
+
this.onTouched = fn;
|
|
85
|
+
}
|
|
86
|
+
setDisabledState(isDisabled) {
|
|
87
|
+
this.disabled = isDisabled;
|
|
88
|
+
this.cdr.markForCheck();
|
|
89
|
+
}
|
|
90
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: NativeSelectComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
91
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: NativeSelectComponent, isStandalone: true, selector: "tolle-native-select", inputs: { id: "id", options: "options", placeholder: "placeholder", size: "size", invalid: "invalid", disabled: "disabled", ariaLabel: "ariaLabel", class: "class" }, outputs: { valueChange: "valueChange" }, providers: [
|
|
92
|
+
{
|
|
93
|
+
provide: NG_VALUE_ACCESSOR,
|
|
94
|
+
useExisting: forwardRef(() => NativeSelectComponent),
|
|
95
|
+
multi: true,
|
|
96
|
+
},
|
|
97
|
+
], ngImport: i0, template: `
|
|
98
|
+
<div class="relative w-full">
|
|
99
|
+
<select
|
|
100
|
+
[id]="id"
|
|
101
|
+
[disabled]="disabled"
|
|
102
|
+
[attr.aria-invalid]="invalid || null"
|
|
103
|
+
[attr.aria-label]="ariaLabel || null"
|
|
104
|
+
[class]="computedClass"
|
|
105
|
+
(change)="onSelectChange($event)"
|
|
106
|
+
(blur)="onTouched()"
|
|
107
|
+
>
|
|
108
|
+
<option *ngIf="placeholder" value="" [selected]="value === null || value === undefined || value === ''" disabled>
|
|
109
|
+
{{ placeholder }}
|
|
110
|
+
</option>
|
|
111
|
+
<!--
|
|
112
|
+
The DOM value is the option's INDEX, not its value. A select element
|
|
113
|
+
coerces every option value to a string, which collapses all object
|
|
114
|
+
options to "[object Object]" and makes them indistinguishable on the
|
|
115
|
+
way back out. Indexing keeps object- and number-valued options
|
|
116
|
+
round-tripping exactly.
|
|
117
|
+
-->
|
|
118
|
+
<option
|
|
119
|
+
*ngFor="let option of options; let i = index"
|
|
120
|
+
[value]="i"
|
|
121
|
+
[disabled]="option.disabled || false"
|
|
122
|
+
[selected]="option.value === value"
|
|
123
|
+
>
|
|
124
|
+
{{ option.label }}
|
|
125
|
+
</option>
|
|
126
|
+
<ng-content></ng-content>
|
|
127
|
+
</select>
|
|
128
|
+
|
|
129
|
+
<i
|
|
130
|
+
class="ri-arrow-down-s-line pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground"
|
|
131
|
+
aria-hidden="true"
|
|
132
|
+
></i>
|
|
133
|
+
</div>
|
|
134
|
+
`, isInline: true, styles: [":host{display:block}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
135
|
+
}
|
|
136
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: NativeSelectComponent, decorators: [{
|
|
137
|
+
type: Component,
|
|
138
|
+
args: [{ selector: 'tolle-native-select', standalone: true, imports: [CommonModule], providers: [
|
|
139
|
+
{
|
|
140
|
+
provide: NG_VALUE_ACCESSOR,
|
|
141
|
+
useExisting: forwardRef(() => NativeSelectComponent),
|
|
142
|
+
multi: true,
|
|
143
|
+
},
|
|
144
|
+
], template: `
|
|
145
|
+
<div class="relative w-full">
|
|
146
|
+
<select
|
|
147
|
+
[id]="id"
|
|
148
|
+
[disabled]="disabled"
|
|
149
|
+
[attr.aria-invalid]="invalid || null"
|
|
150
|
+
[attr.aria-label]="ariaLabel || null"
|
|
151
|
+
[class]="computedClass"
|
|
152
|
+
(change)="onSelectChange($event)"
|
|
153
|
+
(blur)="onTouched()"
|
|
154
|
+
>
|
|
155
|
+
<option *ngIf="placeholder" value="" [selected]="value === null || value === undefined || value === ''" disabled>
|
|
156
|
+
{{ placeholder }}
|
|
157
|
+
</option>
|
|
158
|
+
<!--
|
|
159
|
+
The DOM value is the option's INDEX, not its value. A select element
|
|
160
|
+
coerces every option value to a string, which collapses all object
|
|
161
|
+
options to "[object Object]" and makes them indistinguishable on the
|
|
162
|
+
way back out. Indexing keeps object- and number-valued options
|
|
163
|
+
round-tripping exactly.
|
|
164
|
+
-->
|
|
165
|
+
<option
|
|
166
|
+
*ngFor="let option of options; let i = index"
|
|
167
|
+
[value]="i"
|
|
168
|
+
[disabled]="option.disabled || false"
|
|
169
|
+
[selected]="option.value === value"
|
|
170
|
+
>
|
|
171
|
+
{{ option.label }}
|
|
172
|
+
</option>
|
|
173
|
+
<ng-content></ng-content>
|
|
174
|
+
</select>
|
|
175
|
+
|
|
176
|
+
<i
|
|
177
|
+
class="ri-arrow-down-s-line pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground"
|
|
178
|
+
aria-hidden="true"
|
|
179
|
+
></i>
|
|
180
|
+
</div>
|
|
181
|
+
`, styles: [":host{display:block}\n"] }]
|
|
182
|
+
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { id: [{
|
|
183
|
+
type: Input
|
|
184
|
+
}], options: [{
|
|
185
|
+
type: Input
|
|
186
|
+
}], placeholder: [{
|
|
187
|
+
type: Input
|
|
188
|
+
}], size: [{
|
|
189
|
+
type: Input
|
|
190
|
+
}], invalid: [{
|
|
191
|
+
type: Input
|
|
192
|
+
}], disabled: [{
|
|
193
|
+
type: Input
|
|
194
|
+
}], ariaLabel: [{
|
|
195
|
+
type: Input
|
|
196
|
+
}], class: [{
|
|
197
|
+
type: Input
|
|
198
|
+
}], valueChange: [{
|
|
199
|
+
type: Output
|
|
200
|
+
}] } });
|
|
201
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmF0aXZlLXNlbGVjdC5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wcm9qZWN0cy90b2xsZS9zcmMvbGliL25hdGl2ZS1zZWxlY3QuY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQUUsS0FBSyxFQUFFLE1BQU0sRUFBRSxZQUFZLEVBQUUsVUFBVSxFQUFxQixNQUFNLGVBQWUsQ0FBQztBQUN0RyxPQUFPLEVBQUUsWUFBWSxFQUFFLE1BQU0saUJBQWlCLENBQUM7QUFDL0MsT0FBTyxFQUF3QixpQkFBaUIsRUFBRSxNQUFNLGdCQUFnQixDQUFDO0FBQ3pFLE9BQU8sRUFBRSxHQUFHLEVBQXFCLE1BQU0sMEJBQTBCLENBQUM7QUFDbEUsT0FBTyxFQUFFLEVBQUUsRUFBRSxNQUFNLFlBQVksQ0FBQzs7O0FBRWhDLE1BQU0sb0JBQW9CLEdBQUcsR0FBRyxDQUM5QixvSUFBb0k7SUFDbEkscUdBQXFHO0lBQ3JHLGlEQUFpRCxFQUNuRDt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