@ojiepermana/angular 21.2.4 → 21.3.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.
- package/README.md +90 -11
- package/fesm2022/ojiepermana-angular-layout-theme.mjs +581 -0
- package/fesm2022/ojiepermana-angular-layout-theme.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-layout.mjs +2 -1
- package/fesm2022/ojiepermana-angular-layout.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-navigation-icon.mjs +59 -0
- package/fesm2022/ojiepermana-angular-navigation-icon.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-navigation.mjs +6 -58
- package/fesm2022/ojiepermana-angular-navigation.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-theme.mjs +1 -1
- package/fesm2022/ojiepermana-angular-theme.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-ui-component-accordion.mjs +174 -0
- package/fesm2022/ojiepermana-angular-ui-component-accordion.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-ui-component-alert-dialog.mjs +242 -0
- package/fesm2022/ojiepermana-angular-ui-component-alert-dialog.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-ui-component-alert.mjs +90 -0
- package/fesm2022/ojiepermana-angular-ui-component-alert.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-ui-component-aspect-ratio.mjs +33 -0
- package/fesm2022/ojiepermana-angular-ui-component-aspect-ratio.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-ui-component-avatar.mjs +123 -0
- package/fesm2022/ojiepermana-angular-ui-component-avatar.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-ui-component-badge.mjs +47 -0
- package/fesm2022/ojiepermana-angular-ui-component-badge.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-ui-component-breadcrumb.mjs +186 -0
- package/fesm2022/ojiepermana-angular-ui-component-breadcrumb.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-ui-component-button-group.mjs +95 -0
- package/fesm2022/ojiepermana-angular-ui-component-button-group.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-ui-component-button.mjs +64 -0
- package/fesm2022/ojiepermana-angular-ui-component-button.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-ui-component-calendar.mjs +78 -0
- package/fesm2022/ojiepermana-angular-ui-component-calendar.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-ui-component-card.mjs +137 -0
- package/fesm2022/ojiepermana-angular-ui-component-card.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-ui-component-carousel.mjs +310 -0
- package/fesm2022/ojiepermana-angular-ui-component-carousel.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-ui-component-chart-area.mjs +6 -0
- package/fesm2022/ojiepermana-angular-ui-component-chart-area.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-ui-component-chart-bar.mjs +6 -0
- package/fesm2022/ojiepermana-angular-ui-component-chart-bar.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-ui-component-chart-line.mjs +6 -0
- package/fesm2022/ojiepermana-angular-ui-component-chart-line.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-ui-component-chart-pie.mjs +6 -0
- package/fesm2022/ojiepermana-angular-ui-component-chart-pie.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-ui-component-chart-radar.mjs +6 -0
- package/fesm2022/ojiepermana-angular-ui-component-chart-radar.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-ui-component-chart-radial.mjs +6 -0
- package/fesm2022/ojiepermana-angular-ui-component-chart-radial.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-ui-component-chart-scatter.mjs +6 -0
- package/fesm2022/ojiepermana-angular-ui-component-chart-scatter.mjs.map +1 -0
- package/fesm2022/{ojiepermana-angular-chart.mjs → ojiepermana-angular-ui-component-chart.mjs} +2 -2
- package/fesm2022/ojiepermana-angular-ui-component-chart.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-ui-component-checkbox.mjs +104 -0
- package/fesm2022/ojiepermana-angular-ui-component-checkbox.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-ui-component-collapsible.mjs +116 -0
- package/fesm2022/ojiepermana-angular-ui-component-collapsible.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-ui-component-combobox.mjs +263 -0
- package/fesm2022/ojiepermana-angular-ui-component-combobox.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-ui-component-command.mjs +268 -0
- package/fesm2022/ojiepermana-angular-ui-component-command.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-ui-component-context-menu.mjs +100 -0
- package/fesm2022/ojiepermana-angular-ui-component-context-menu.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-ui-component-date-picker.mjs +155 -0
- package/fesm2022/ojiepermana-angular-ui-component-date-picker.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-ui-component-dialog.mjs +262 -0
- package/fesm2022/ojiepermana-angular-ui-component-dialog.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-ui-component-drawer.mjs +6 -0
- package/fesm2022/ojiepermana-angular-ui-component-drawer.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-ui-component-dropdown-menu.mjs +458 -0
- package/fesm2022/ojiepermana-angular-ui-component-dropdown-menu.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-ui-component-form.mjs +208 -0
- package/fesm2022/ojiepermana-angular-ui-component-form.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-ui-component-input-group.mjs +164 -0
- package/fesm2022/ojiepermana-angular-ui-component-input-group.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-ui-component-input.mjs +43 -0
- package/fesm2022/ojiepermana-angular-ui-component-input.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-ui-component-item.mjs +241 -0
- package/fesm2022/ojiepermana-angular-ui-component-item.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-ui-component-label.mjs +30 -0
- package/fesm2022/ojiepermana-angular-ui-component-label.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-ui-component-pagination.mjs +192 -0
- package/fesm2022/ojiepermana-angular-ui-component-pagination.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-ui-component-popover.mjs +163 -0
- package/fesm2022/ojiepermana-angular-ui-component-popover.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-ui-component-progress.mjs +53 -0
- package/fesm2022/ojiepermana-angular-ui-component-progress.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-ui-component-radio.mjs +92 -0
- package/fesm2022/ojiepermana-angular-ui-component-radio.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-ui-component-scroll-area.mjs +48 -0
- package/fesm2022/ojiepermana-angular-ui-component-scroll-area.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-ui-component-select.mjs +131 -0
- package/fesm2022/ojiepermana-angular-ui-component-select.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-ui-component-separator.mjs +33 -0
- package/fesm2022/ojiepermana-angular-ui-component-separator.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-ui-component-sheet.mjs +235 -0
- package/fesm2022/ojiepermana-angular-ui-component-sheet.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-ui-component-skeleton.mjs +29 -0
- package/fesm2022/ojiepermana-angular-ui-component-skeleton.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-ui-component-slider.mjs +29 -0
- package/fesm2022/ojiepermana-angular-ui-component-slider.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-ui-component-switch.mjs +84 -0
- package/fesm2022/ojiepermana-angular-ui-component-switch.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-ui-component-table.mjs +139 -0
- package/fesm2022/ojiepermana-angular-ui-component-table.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-ui-component-tabs.mjs +252 -0
- package/fesm2022/ojiepermana-angular-ui-component-tabs.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-ui-component-textarea.mjs +37 -0
- package/fesm2022/ojiepermana-angular-ui-component-textarea.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-ui-component-toast.mjs +47 -0
- package/fesm2022/ojiepermana-angular-ui-component-toast.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-ui-component-tooltip.mjs +56 -0
- package/fesm2022/ojiepermana-angular-ui-component-tooltip.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-ui-component-utils.mjs +13 -0
- package/fesm2022/ojiepermana-angular-ui-component-utils.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular.mjs +5 -3
- package/fesm2022/ojiepermana-angular.mjs.map +1 -1
- package/layout/theme/package.json +4 -0
- package/navigation-icon/package.json +4 -0
- package/package.json +212 -12
- package/types/ojiepermana-angular-layout-theme.d.ts +205 -0
- package/types/ojiepermana-angular-layout.d.ts +1 -1
- package/types/ojiepermana-angular-navigation-icon.d.ts +17 -0
- package/types/ojiepermana-angular-navigation.d.ts +2 -20
- package/types/ojiepermana-angular-ui-component-accordion.d.ts +51 -0
- package/types/ojiepermana-angular-ui-component-alert-dialog.d.ts +93 -0
- package/types/ojiepermana-angular-ui-component-alert.d.ts +37 -0
- package/types/ojiepermana-angular-ui-component-aspect-ratio.d.ts +12 -0
- package/types/ojiepermana-angular-ui-component-avatar.d.ts +51 -0
- package/types/ojiepermana-angular-ui-component-badge.d.ts +19 -0
- package/types/ojiepermana-angular-ui-component-breadcrumb.d.ts +46 -0
- package/types/ojiepermana-angular-ui-component-button-group.d.ts +26 -0
- package/types/ojiepermana-angular-ui-component-button.d.ts +22 -0
- package/types/ojiepermana-angular-ui-component-calendar.d.ts +33 -0
- package/types/ojiepermana-angular-ui-component-card.d.ts +60 -0
- package/types/ojiepermana-angular-ui-component-carousel.d.ts +86 -0
- package/types/ojiepermana-angular-ui-component-chart-area.d.ts +1 -0
- package/types/ojiepermana-angular-ui-component-chart-bar.d.ts +1 -0
- package/types/ojiepermana-angular-ui-component-chart-line.d.ts +1 -0
- package/types/ojiepermana-angular-ui-component-chart-pie.d.ts +1 -0
- package/types/ojiepermana-angular-ui-component-chart-radar.d.ts +1 -0
- package/types/ojiepermana-angular-ui-component-chart-radial.d.ts +1 -0
- package/types/ojiepermana-angular-ui-component-chart-scatter.d.ts +1 -0
- package/types/{ojiepermana-angular-chart.d.ts → ojiepermana-angular-ui-component-chart.d.ts} +15 -15
- package/types/ojiepermana-angular-ui-component-checkbox.d.ts +35 -0
- package/types/ojiepermana-angular-ui-component-collapsible.d.ts +42 -0
- package/types/ojiepermana-angular-ui-component-combobox.d.ts +51 -0
- package/types/ojiepermana-angular-ui-component-command.d.ts +99 -0
- package/types/ojiepermana-angular-ui-component-context-menu.d.ts +35 -0
- package/types/ojiepermana-angular-ui-component-date-picker.d.ts +41 -0
- package/types/ojiepermana-angular-ui-component-dialog.d.ts +87 -0
- package/types/ojiepermana-angular-ui-component-drawer.d.ts +1 -0
- package/types/ojiepermana-angular-ui-component-dropdown-menu.d.ts +135 -0
- package/types/ojiepermana-angular-ui-component-form.d.ts +92 -0
- package/types/ojiepermana-angular-ui-component-input-group.d.ts +51 -0
- package/types/ojiepermana-angular-ui-component-input.d.ts +16 -0
- package/types/ojiepermana-angular-ui-component-item.d.ts +88 -0
- package/types/ojiepermana-angular-ui-component-label.d.ts +11 -0
- package/types/ojiepermana-angular-ui-component-pagination.d.ts +27 -0
- package/types/ojiepermana-angular-ui-component-popover.d.ts +43 -0
- package/types/ojiepermana-angular-ui-component-progress.d.ts +17 -0
- package/types/ojiepermana-angular-ui-component-radio.d.ts +34 -0
- package/types/ojiepermana-angular-ui-component-scroll-area.d.ts +19 -0
- package/types/ojiepermana-angular-ui-component-select.d.ts +45 -0
- package/types/ojiepermana-angular-ui-component-separator.d.ts +14 -0
- package/types/ojiepermana-angular-ui-component-sheet.d.ts +74 -0
- package/types/ojiepermana-angular-ui-component-skeleton.d.ts +10 -0
- package/types/ojiepermana-angular-ui-component-slider.d.ts +16 -0
- package/types/ojiepermana-angular-ui-component-switch.d.ts +30 -0
- package/types/ojiepermana-angular-ui-component-table.d.ts +52 -0
- package/types/ojiepermana-angular-ui-component-tabs.d.ts +92 -0
- package/types/ojiepermana-angular-ui-component-textarea.d.ts +12 -0
- package/types/ojiepermana-angular-ui-component-toast.d.ts +29 -0
- package/types/ojiepermana-angular-ui-component-tooltip.d.ts +22 -0
- package/types/ojiepermana-angular-ui-component-utils.d.ts +5 -0
- package/ui/component/accordion/package.json +4 -0
- package/ui/component/alert/package.json +4 -0
- package/ui/component/alert-dialog/package.json +4 -0
- package/ui/component/aspect-ratio/package.json +4 -0
- package/ui/component/avatar/package.json +4 -0
- package/ui/component/badge/package.json +4 -0
- package/ui/component/breadcrumb/package.json +4 -0
- package/ui/component/button/package.json +4 -0
- package/ui/component/button-group/package.json +4 -0
- package/ui/component/calendar/package.json +4 -0
- package/ui/component/card/package.json +4 -0
- package/ui/component/carousel/package.json +4 -0
- package/ui/component/chart/README.md +249 -0
- package/ui/component/chart/area/package.json +4 -0
- package/ui/component/chart/bar/package.json +4 -0
- package/ui/component/chart/line/package.json +4 -0
- package/ui/component/chart/package.json +4 -0
- package/ui/component/chart/pie/package.json +4 -0
- package/ui/component/chart/radar/package.json +4 -0
- package/ui/component/chart/radial/package.json +4 -0
- package/ui/component/chart/scatter/package.json +4 -0
- package/ui/component/checkbox/package.json +4 -0
- package/ui/component/collapsible/package.json +4 -0
- package/ui/component/combobox/package.json +4 -0
- package/ui/component/command/package.json +4 -0
- package/ui/component/context-menu/package.json +4 -0
- package/ui/component/date-picker/package.json +4 -0
- package/ui/component/dialog/package.json +4 -0
- package/ui/component/drawer/package.json +4 -0
- package/ui/component/dropdown-menu/package.json +4 -0
- package/ui/component/form/package.json +4 -0
- package/ui/component/input/package.json +4 -0
- package/ui/component/input-group/package.json +4 -0
- package/ui/component/item/package.json +4 -0
- package/ui/component/label/package.json +4 -0
- package/ui/component/pagination/package.json +4 -0
- package/ui/component/popover/package.json +4 -0
- package/ui/component/progress/package.json +4 -0
- package/ui/component/radio/package.json +4 -0
- package/ui/component/scroll-area/package.json +4 -0
- package/ui/component/select/package.json +4 -0
- package/ui/component/separator/package.json +4 -0
- package/ui/component/sheet/package.json +4 -0
- package/ui/component/skeleton/package.json +4 -0
- package/ui/component/slider/package.json +4 -0
- package/ui/component/switch/package.json +4 -0
- package/ui/component/table/package.json +4 -0
- package/ui/component/tabs/package.json +4 -0
- package/ui/component/textarea/package.json +4 -0
- package/ui/component/toast/package.json +4 -0
- package/ui/component/tooltip/package.json +4 -0
- package/ui/component/utils/package.json +4 -0
- package/chart/README.md +0 -0
- package/chart/package.json +0 -4
- package/component/package.json +0 -4
- package/fesm2022/ojiepermana-angular-chart.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-component.mjs +0 -5774
- package/fesm2022/ojiepermana-angular-component.mjs.map +0 -1
- package/types/ojiepermana-angular-component.d.ts +0 -1927
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { signal, computed, effect, Injectable, input, ChangeDetectionStrategy, Component, inject, Directive } from '@angular/core';
|
|
3
|
+
import { cn } from '@ojiepermana/angular/component/utils';
|
|
4
|
+
import { NgControl } from '@angular/forms';
|
|
5
|
+
|
|
6
|
+
let nextId = 0;
|
|
7
|
+
/**
|
|
8
|
+
* Backing store for a single `<ui-form-field>`. Provided on the component
|
|
9
|
+
* so descendant parts (label, description, message, control) can inject it.
|
|
10
|
+
*/
|
|
11
|
+
class FormFieldContext {
|
|
12
|
+
uid = ++nextId;
|
|
13
|
+
controlId = `ui-form-field-${this.uid}`;
|
|
14
|
+
descriptionId = `${this.controlId}-description`;
|
|
15
|
+
messageId = `${this.controlId}-message`;
|
|
16
|
+
control = signal(null, ...(ngDevMode ? [{ debugName: "control" }] : /* istanbul ignore next */ []));
|
|
17
|
+
hasDescription = signal(false, ...(ngDevMode ? [{ debugName: "hasDescription" }] : /* istanbul ignore next */ []));
|
|
18
|
+
hasMessage = signal(false, ...(ngDevMode ? [{ debugName: "hasMessage" }] : /* istanbul ignore next */ []));
|
|
19
|
+
statusTick = signal(0, ...(ngDevMode ? [{ debugName: "statusTick" }] : /* istanbul ignore next */ []));
|
|
20
|
+
invalid = computed(() => {
|
|
21
|
+
this.statusTick();
|
|
22
|
+
const c = this.control();
|
|
23
|
+
return !!c && c.invalid && (c.touched || c.dirty);
|
|
24
|
+
}, ...(ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []));
|
|
25
|
+
firstError = computed(() => {
|
|
26
|
+
this.statusTick();
|
|
27
|
+
const c = this.control();
|
|
28
|
+
if (!c?.errors)
|
|
29
|
+
return null;
|
|
30
|
+
const keys = Object.keys(c.errors);
|
|
31
|
+
return keys.length > 0 ? keys[0] : null;
|
|
32
|
+
}, ...(ngDevMode ? [{ debugName: "firstError" }] : /* istanbul ignore next */ []));
|
|
33
|
+
describedBy = computed(() => {
|
|
34
|
+
const parts = [];
|
|
35
|
+
if (this.hasDescription())
|
|
36
|
+
parts.push(this.descriptionId);
|
|
37
|
+
if (this.hasMessage() && this.invalid())
|
|
38
|
+
parts.push(this.messageId);
|
|
39
|
+
return parts.length > 0 ? parts.join(' ') : null;
|
|
40
|
+
}, ...(ngDevMode ? [{ debugName: "describedBy" }] : /* istanbul ignore next */ []));
|
|
41
|
+
constructor() {
|
|
42
|
+
// Re-run computed() above whenever the control's status changes.
|
|
43
|
+
effect((onCleanup) => {
|
|
44
|
+
const c = this.control();
|
|
45
|
+
if (!c)
|
|
46
|
+
return;
|
|
47
|
+
const sub = c.statusChanges.subscribe(() => this.statusTick.update((n) => n + 1));
|
|
48
|
+
onCleanup(() => sub.unsubscribe());
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: FormFieldContext, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
52
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: FormFieldContext });
|
|
53
|
+
}
|
|
54
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: FormFieldContext, decorators: [{
|
|
55
|
+
type: Injectable
|
|
56
|
+
}], ctorParameters: () => [] });
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Groups a label, control, description, and validation message.
|
|
60
|
+
* Provides ids + invalid state to descendants via {@link FormFieldContext}.
|
|
61
|
+
*/
|
|
62
|
+
class FormFieldComponent {
|
|
63
|
+
class = input('', ...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
|
|
64
|
+
classes = computed(() => cn('flex flex-col gap-2', this.class()), ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
65
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: FormFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
66
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.14", type: FormFieldComponent, isStandalone: true, selector: "ui-form-field", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()" } }, providers: [FormFieldContext], ngImport: i0, template: `<ng-content />`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
67
|
+
}
|
|
68
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: FormFieldComponent, decorators: [{
|
|
69
|
+
type: Component,
|
|
70
|
+
args: [{
|
|
71
|
+
selector: 'ui-form-field',
|
|
72
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
73
|
+
providers: [FormFieldContext],
|
|
74
|
+
host: { '[class]': 'classes()' },
|
|
75
|
+
template: `<ng-content />`,
|
|
76
|
+
}]
|
|
77
|
+
}], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
78
|
+
|
|
79
|
+
class FormLabelComponent {
|
|
80
|
+
ctx = inject(FormFieldContext);
|
|
81
|
+
class = input('', ...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
|
|
82
|
+
classes = computed(() => cn('text-sm font-medium leading-none', this.ctx.invalid() ? 'text-destructive' : 'text-foreground', 'peer-disabled:cursor-not-allowed peer-disabled:opacity-70', this.class()), ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
83
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: FormLabelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
84
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.14", type: FormLabelComponent, isStandalone: true, selector: "ui-form-label, label[ui-form-label]", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()", "attr.for": "ctx.controlId" } }, ngImport: i0, template: `<ng-content />`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
85
|
+
}
|
|
86
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: FormLabelComponent, decorators: [{
|
|
87
|
+
type: Component,
|
|
88
|
+
args: [{
|
|
89
|
+
selector: 'ui-form-label, label[ui-form-label]',
|
|
90
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
91
|
+
host: {
|
|
92
|
+
'[class]': 'classes()',
|
|
93
|
+
'[attr.for]': 'ctx.controlId',
|
|
94
|
+
},
|
|
95
|
+
template: `<ng-content />`,
|
|
96
|
+
}]
|
|
97
|
+
}], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
98
|
+
|
|
99
|
+
class FormDescriptionComponent {
|
|
100
|
+
ctx = inject(FormFieldContext);
|
|
101
|
+
class = input('', ...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
|
|
102
|
+
classes = computed(() => cn('text-sm text-muted-foreground', this.class()), ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
103
|
+
ngOnInit() {
|
|
104
|
+
this.ctx.hasDescription.set(true);
|
|
105
|
+
}
|
|
106
|
+
ngOnDestroy() {
|
|
107
|
+
this.ctx.hasDescription.set(false);
|
|
108
|
+
}
|
|
109
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: FormDescriptionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
110
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.14", type: FormDescriptionComponent, isStandalone: true, selector: "ui-form-description, p[ui-form-description]", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()", "attr.id": "ctx.descriptionId" } }, ngImport: i0, template: `<ng-content />`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
111
|
+
}
|
|
112
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: FormDescriptionComponent, decorators: [{
|
|
113
|
+
type: Component,
|
|
114
|
+
args: [{
|
|
115
|
+
selector: 'ui-form-description, p[ui-form-description]',
|
|
116
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
117
|
+
host: {
|
|
118
|
+
'[class]': 'classes()',
|
|
119
|
+
'[attr.id]': 'ctx.descriptionId',
|
|
120
|
+
},
|
|
121
|
+
template: `<ng-content />`,
|
|
122
|
+
}]
|
|
123
|
+
}], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Renders validation errors for the field's control.
|
|
127
|
+
* By default, surfaces the first error key. Provide custom content to override.
|
|
128
|
+
*/
|
|
129
|
+
class FormMessageComponent {
|
|
130
|
+
ctx = inject(FormFieldContext);
|
|
131
|
+
class = input('', ...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
|
|
132
|
+
show = computed(() => this.ctx.invalid(), ...(ngDevMode ? [{ debugName: "show" }] : /* istanbul ignore next */ []));
|
|
133
|
+
classes = computed(() => cn('text-sm font-medium text-destructive', this.class()), ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
134
|
+
ngOnInit() {
|
|
135
|
+
this.ctx.hasMessage.set(true);
|
|
136
|
+
}
|
|
137
|
+
ngOnDestroy() {
|
|
138
|
+
this.ctx.hasMessage.set(false);
|
|
139
|
+
}
|
|
140
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: FormMessageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
141
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: FormMessageComponent, isStandalone: true, selector: "ui-form-message, p[ui-form-message]", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()", "attr.id": "ctx.messageId", "attr.role": "\"alert\"", "attr.aria-live": "\"polite\"" } }, ngImport: i0, template: `
|
|
142
|
+
@if (show()) {
|
|
143
|
+
<ng-content>{{ ctx.firstError() }}</ng-content>
|
|
144
|
+
}
|
|
145
|
+
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
146
|
+
}
|
|
147
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: FormMessageComponent, decorators: [{
|
|
148
|
+
type: Component,
|
|
149
|
+
args: [{
|
|
150
|
+
selector: 'ui-form-message, p[ui-form-message]',
|
|
151
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
152
|
+
host: {
|
|
153
|
+
'[class]': 'classes()',
|
|
154
|
+
'[attr.id]': 'ctx.messageId',
|
|
155
|
+
'[attr.role]': '"alert"',
|
|
156
|
+
'[attr.aria-live]': '"polite"',
|
|
157
|
+
},
|
|
158
|
+
template: `
|
|
159
|
+
@if (show()) {
|
|
160
|
+
<ng-content>{{ ctx.firstError() }}</ng-content>
|
|
161
|
+
}
|
|
162
|
+
`,
|
|
163
|
+
}]
|
|
164
|
+
}], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Attach to the native form control inside a `<ui-form-field>` to auto-wire:
|
|
168
|
+
* - `id` ↔ `<ui-form-label for>`
|
|
169
|
+
* - `aria-describedby` ↔ description + error message
|
|
170
|
+
* - `aria-invalid` ↔ control validity (after touch/dirty)
|
|
171
|
+
*
|
|
172
|
+
* @example
|
|
173
|
+
* <ui-form-field>
|
|
174
|
+
* <ui-form-label>Email</ui-form-label>
|
|
175
|
+
* <input ui-input uiFormControl [formControl]="email" />
|
|
176
|
+
* <ui-form-description>We'll never share it.</ui-form-description>
|
|
177
|
+
* <ui-form-message />
|
|
178
|
+
* </ui-form-field>
|
|
179
|
+
*/
|
|
180
|
+
class FormControlDirective {
|
|
181
|
+
ctx = inject(FormFieldContext);
|
|
182
|
+
ngControl = inject(NgControl, { optional: true, self: true });
|
|
183
|
+
ngOnInit() {
|
|
184
|
+
if (this.ngControl?.control) {
|
|
185
|
+
this.ctx.control.set(this.ngControl.control);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: FormControlDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
189
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.14", type: FormControlDirective, isStandalone: true, selector: "[uiFormControl]", host: { properties: { "attr.id": "ctx.controlId", "attr.aria-describedby": "ctx.describedBy()", "attr.aria-invalid": "ctx.invalid() ? \"true\" : null" } }, ngImport: i0 });
|
|
190
|
+
}
|
|
191
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: FormControlDirective, decorators: [{
|
|
192
|
+
type: Directive,
|
|
193
|
+
args: [{
|
|
194
|
+
selector: '[uiFormControl]',
|
|
195
|
+
host: {
|
|
196
|
+
'[attr.id]': 'ctx.controlId',
|
|
197
|
+
'[attr.aria-describedby]': 'ctx.describedBy()',
|
|
198
|
+
'[attr.aria-invalid]': 'ctx.invalid() ? "true" : null',
|
|
199
|
+
},
|
|
200
|
+
}]
|
|
201
|
+
}] });
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Generated bundle index. Do not edit.
|
|
205
|
+
*/
|
|
206
|
+
|
|
207
|
+
export { FormControlDirective, FormDescriptionComponent, FormFieldComponent, FormFieldContext, FormLabelComponent, FormMessageComponent };
|
|
208
|
+
//# sourceMappingURL=ojiepermana-angular-ui-component-form.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ojiepermana-angular-ui-component-form.mjs","sources":["../../../projects/angular/ui/component/form/src/lib/form-field.context.ts","../../../projects/angular/ui/component/form/src/lib/form-field.component.ts","../../../projects/angular/ui/component/form/src/lib/form-label.component.ts","../../../projects/angular/ui/component/form/src/lib/form-description.component.ts","../../../projects/angular/ui/component/form/src/lib/form-message.component.ts","../../../projects/angular/ui/component/form/src/lib/form-control.directive.ts","../../../projects/angular/ui/component/form/ojiepermana-angular-ui-component-form.ts"],"sourcesContent":["import { Injectable, computed, effect, signal } from '@angular/core';\nimport { AbstractControl } from '@angular/forms';\n\nlet nextId = 0;\n\n/**\n * Backing store for a single `<ui-form-field>`. Provided on the component\n * so descendant parts (label, description, message, control) can inject it.\n */\n@Injectable()\nexport class FormFieldContext {\n private readonly uid = ++nextId;\n readonly controlId = `ui-form-field-${this.uid}`;\n readonly descriptionId = `${this.controlId}-description`;\n readonly messageId = `${this.controlId}-message`;\n\n readonly control = signal<AbstractControl | null>(null);\n readonly hasDescription = signal(false);\n readonly hasMessage = signal(false);\n\n private readonly statusTick = signal(0);\n\n readonly invalid = computed(() => {\n this.statusTick();\n const c = this.control();\n return !!c && c.invalid && (c.touched || c.dirty);\n });\n\n readonly firstError = computed<string | null>(() => {\n this.statusTick();\n const c = this.control();\n if (!c?.errors) return null;\n const keys = Object.keys(c.errors);\n return keys.length > 0 ? keys[0]! : null;\n });\n\n readonly describedBy = computed(() => {\n const parts: string[] = [];\n if (this.hasDescription()) parts.push(this.descriptionId);\n if (this.hasMessage() && this.invalid()) parts.push(this.messageId);\n return parts.length > 0 ? parts.join(' ') : null;\n });\n\n constructor() {\n // Re-run computed() above whenever the control's status changes.\n effect((onCleanup) => {\n const c = this.control();\n if (!c) return;\n const sub = c.statusChanges.subscribe(() => this.statusTick.update((n) => n + 1));\n onCleanup(() => sub.unsubscribe());\n });\n }\n}\n","import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';\nimport { cn } from '@ojiepermana/angular/component/utils';\nimport { FormFieldContext } from './form-field.context';\n\n/**\n * Groups a label, control, description, and validation message.\n * Provides ids + invalid state to descendants via {@link FormFieldContext}.\n */\n@Component({\n selector: 'ui-form-field',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [FormFieldContext],\n host: { '[class]': 'classes()' },\n template: `<ng-content />`,\n})\nexport class FormFieldComponent {\n readonly class = input<string>('');\n\n protected readonly classes = computed(() => cn('flex flex-col gap-2', this.class()));\n}\n","import { ChangeDetectionStrategy, Component, computed, inject, input } from '@angular/core';\nimport { cn } from '@ojiepermana/angular/component/utils';\nimport { FormFieldContext } from './form-field.context';\n\n@Component({\n selector: 'ui-form-label, label[ui-form-label]',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class]': 'classes()',\n '[attr.for]': 'ctx.controlId',\n },\n template: `<ng-content />`,\n})\nexport class FormLabelComponent {\n protected readonly ctx = inject(FormFieldContext);\n readonly class = input<string>('');\n\n protected readonly classes = computed(() =>\n cn(\n 'text-sm font-medium leading-none',\n this.ctx.invalid() ? 'text-destructive' : 'text-foreground',\n 'peer-disabled:cursor-not-allowed peer-disabled:opacity-70',\n this.class(),\n ),\n );\n}\n","import { ChangeDetectionStrategy, Component, computed, inject, input, OnDestroy, OnInit } from '@angular/core';\nimport { cn } from '@ojiepermana/angular/component/utils';\nimport { FormFieldContext } from './form-field.context';\n\n@Component({\n selector: 'ui-form-description, p[ui-form-description]',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class]': 'classes()',\n '[attr.id]': 'ctx.descriptionId',\n },\n template: `<ng-content />`,\n})\nexport class FormDescriptionComponent implements OnInit, OnDestroy {\n protected readonly ctx = inject(FormFieldContext);\n readonly class = input<string>('');\n\n protected readonly classes = computed(() => cn('text-sm text-muted-foreground', this.class()));\n\n ngOnInit(): void {\n this.ctx.hasDescription.set(true);\n }\n\n ngOnDestroy(): void {\n this.ctx.hasDescription.set(false);\n }\n}\n","import { ChangeDetectionStrategy, Component, computed, inject, input, OnDestroy, OnInit } from '@angular/core';\nimport { cn } from '@ojiepermana/angular/component/utils';\nimport { FormFieldContext } from './form-field.context';\n\n/**\n * Renders validation errors for the field's control.\n * By default, surfaces the first error key. Provide custom content to override.\n */\n@Component({\n selector: 'ui-form-message, p[ui-form-message]',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class]': 'classes()',\n '[attr.id]': 'ctx.messageId',\n '[attr.role]': '\"alert\"',\n '[attr.aria-live]': '\"polite\"',\n },\n template: `\n @if (show()) {\n <ng-content>{{ ctx.firstError() }}</ng-content>\n }\n `,\n})\nexport class FormMessageComponent implements OnInit, OnDestroy {\n protected readonly ctx = inject(FormFieldContext);\n readonly class = input<string>('');\n\n protected readonly show = computed(() => this.ctx.invalid());\n protected readonly classes = computed(() => cn('text-sm font-medium text-destructive', this.class()));\n\n ngOnInit(): void {\n this.ctx.hasMessage.set(true);\n }\n\n ngOnDestroy(): void {\n this.ctx.hasMessage.set(false);\n }\n}\n","import { Directive, OnInit, inject } from '@angular/core';\nimport { NgControl } from '@angular/forms';\nimport { FormFieldContext } from './form-field.context';\n\n/**\n * Attach to the native form control inside a `<ui-form-field>` to auto-wire:\n * - `id` ↔ `<ui-form-label for>`\n * - `aria-describedby` ↔ description + error message\n * - `aria-invalid` ↔ control validity (after touch/dirty)\n *\n * @example\n * <ui-form-field>\n * <ui-form-label>Email</ui-form-label>\n * <input ui-input uiFormControl [formControl]=\"email\" />\n * <ui-form-description>We'll never share it.</ui-form-description>\n * <ui-form-message />\n * </ui-form-field>\n */\n@Directive({\n selector: '[uiFormControl]',\n host: {\n '[attr.id]': 'ctx.controlId',\n '[attr.aria-describedby]': 'ctx.describedBy()',\n '[attr.aria-invalid]': 'ctx.invalid() ? \"true\" : null',\n },\n})\nexport class FormControlDirective implements OnInit {\n protected readonly ctx = inject(FormFieldContext);\n private readonly ngControl = inject(NgControl, { optional: true, self: true });\n\n ngOnInit(): void {\n if (this.ngControl?.control) {\n this.ctx.control.set(this.ngControl.control);\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAGA,IAAI,MAAM,GAAG,CAAC;AAEd;;;AAGG;MAEU,gBAAgB,CAAA;IACV,GAAG,GAAG,EAAE,MAAM;AACtB,IAAA,SAAS,GAAG,CAAA,cAAA,EAAiB,IAAI,CAAC,GAAG,EAAE;AACvC,IAAA,aAAa,GAAG,CAAA,EAAG,IAAI,CAAC,SAAS,cAAc;AAC/C,IAAA,SAAS,GAAG,CAAA,EAAG,IAAI,CAAC,SAAS,UAAU;AAEvC,IAAA,OAAO,GAAG,MAAM,CAAyB,IAAI,8EAAC;AAC9C,IAAA,cAAc,GAAG,MAAM,CAAC,KAAK,qFAAC;AAC9B,IAAA,UAAU,GAAG,MAAM,CAAC,KAAK,iFAAC;AAElB,IAAA,UA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BAAiB;AAC3B,oBAAA,IAAI,EAAE;AACJ,wBAAA,WAAW,EAAE,eAAe;AAC5B,wBAAA,yBAAyB,EAAE,mBAAmB;AAC9C,wBAAA,qBAAqB,EAAE,+BAA+B;AACvD,qBAAA;AACF,iBAAA;;;ACzBD;;AAEG;;;;"}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, computed, ChangeDetectionStrategy, Component, inject, ElementRef } from '@angular/core';
|
|
3
|
+
import { cn } from '@ojiepermana/angular/component/utils';
|
|
4
|
+
import { buttonVariants } from '@ojiepermana/angular/component/button';
|
|
5
|
+
|
|
6
|
+
const GROUP_BASE = [
|
|
7
|
+
'relative flex min-w-0 flex-wrap overflow-hidden rounded-[var(--radius)] border border-input bg-transparent text-sm shadow-sm',
|
|
8
|
+
'transition-[border-color,box-shadow] focus-within:border-ring focus-within:ring-1 focus-within:ring-ring',
|
|
9
|
+
'[&>[data-slot=input-group-control]]:min-w-0',
|
|
10
|
+
'[&>[data-slot=input-group-control]]:flex-1',
|
|
11
|
+
'[&>[data-slot=input-group-control]]:rounded-none',
|
|
12
|
+
'[&>[data-slot=input-group-control]]:border-0',
|
|
13
|
+
'[&>[data-slot=input-group-control]]:bg-transparent',
|
|
14
|
+
'[&>[data-slot=input-group-control]]:shadow-none',
|
|
15
|
+
'[&>[data-slot=input-group-control]]:outline-none',
|
|
16
|
+
'[&>[data-slot=input-group-control]]:focus-visible:ring-0',
|
|
17
|
+
'[&>[data-slot=input-group-control]]:focus-visible:outline-none',
|
|
18
|
+
].join(' ');
|
|
19
|
+
const addonAlignClasses = {
|
|
20
|
+
'inline-start': ['order-10', '[border-inline-end-width:1px]', '[border-inline-end-color:hsl(var(--border))]'].join(' '),
|
|
21
|
+
'inline-end': ['order-30', '[border-inline-start-width:1px]', '[border-inline-start-color:hsl(var(--border))]'].join(' '),
|
|
22
|
+
'block-start': [
|
|
23
|
+
'order-0 basis-full py-2',
|
|
24
|
+
'[border-block-end-width:1px]',
|
|
25
|
+
'[border-block-end-color:hsl(var(--border))]',
|
|
26
|
+
].join(' '),
|
|
27
|
+
'block-end': [
|
|
28
|
+
'order-40 basis-full py-2',
|
|
29
|
+
'[border-block-start-width:1px]',
|
|
30
|
+
'[border-block-start-color:hsl(var(--border))]',
|
|
31
|
+
].join(' '),
|
|
32
|
+
};
|
|
33
|
+
const ADDON_BASE = [
|
|
34
|
+
'flex min-h-9 shrink-0 items-center gap-1.5 bg-muted/30 px-3 text-sm text-muted-foreground',
|
|
35
|
+
'[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',
|
|
36
|
+
].join(' ');
|
|
37
|
+
const CONTROL_BASE = [
|
|
38
|
+
'order-20 min-w-0 flex-1 bg-transparent text-sm text-foreground',
|
|
39
|
+
'placeholder:text-muted-foreground',
|
|
40
|
+
'disabled:cursor-not-allowed disabled:opacity-50',
|
|
41
|
+
'focus-visible:outline-none',
|
|
42
|
+
'aria-[invalid=true]:text-destructive',
|
|
43
|
+
].join(' ');
|
|
44
|
+
class InputGroupComponent {
|
|
45
|
+
class = input('', ...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
|
|
46
|
+
classes = computed(() => cn(GROUP_BASE, this.class()), ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
47
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: InputGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
48
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.14", type: InputGroupComponent, isStandalone: true, selector: "ui-input-group", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()" } }, ngImport: i0, template: `<ng-content />`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
49
|
+
}
|
|
50
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: InputGroupComponent, decorators: [{
|
|
51
|
+
type: Component,
|
|
52
|
+
args: [{
|
|
53
|
+
selector: 'ui-input-group',
|
|
54
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
55
|
+
host: { '[class]': 'classes()' },
|
|
56
|
+
template: `<ng-content />`,
|
|
57
|
+
}]
|
|
58
|
+
}], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
59
|
+
class InputGroupAddonComponent {
|
|
60
|
+
align = input('inline-start', ...(ngDevMode ? [{ debugName: "align" }] : /* istanbul ignore next */ []));
|
|
61
|
+
class = input('', ...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
|
|
62
|
+
classes = computed(() => cn(ADDON_BASE, addonAlignClasses[this.align()], this.class()), ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
63
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: InputGroupAddonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
64
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.14", type: InputGroupAddonComponent, isStandalone: true, selector: "ui-input-group-addon", inputs: { align: { classPropertyName: "align", publicName: "align", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()", "attr.data-align": "align()" } }, ngImport: i0, template: `<ng-content />`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
65
|
+
}
|
|
66
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: InputGroupAddonComponent, decorators: [{
|
|
67
|
+
type: Component,
|
|
68
|
+
args: [{
|
|
69
|
+
selector: 'ui-input-group-addon',
|
|
70
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
71
|
+
host: {
|
|
72
|
+
'[class]': 'classes()',
|
|
73
|
+
'[attr.data-align]': 'align()',
|
|
74
|
+
},
|
|
75
|
+
template: `<ng-content />`,
|
|
76
|
+
}]
|
|
77
|
+
}], propDecorators: { align: [{ type: i0.Input, args: [{ isSignal: true, alias: "align", required: false }] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
78
|
+
class InputGroupTextComponent {
|
|
79
|
+
class = input('', ...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
|
|
80
|
+
classes = computed(() => cn('inline-flex items-center gap-1.5 whitespace-nowrap text-sm leading-none text-current', this.class()), ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
81
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: InputGroupTextComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
82
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.14", type: InputGroupTextComponent, isStandalone: true, selector: "ui-input-group-text", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()" } }, ngImport: i0, template: `<ng-content />`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
83
|
+
}
|
|
84
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: InputGroupTextComponent, decorators: [{
|
|
85
|
+
type: Component,
|
|
86
|
+
args: [{
|
|
87
|
+
selector: 'ui-input-group-text',
|
|
88
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
89
|
+
host: { '[class]': 'classes()' },
|
|
90
|
+
template: `<ng-content />`,
|
|
91
|
+
}]
|
|
92
|
+
}], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
93
|
+
class InputGroupButtonComponent {
|
|
94
|
+
variant = input('ghost', ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
95
|
+
size = input('xs', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
96
|
+
class = input('', ...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
|
|
97
|
+
classes = computed(() => cn(buttonVariants({ variant: this.variant(), size: this.size() }), 'shrink-0 shadow-none', this.class()), ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
98
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: InputGroupButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
99
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.14", type: InputGroupButtonComponent, isStandalone: true, selector: "button[ui-input-group-button], a[ui-input-group-button]", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()", "attr.data-size": "size()", "attr.data-variant": "variant()" } }, ngImport: i0, template: `<ng-content />`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
100
|
+
}
|
|
101
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: InputGroupButtonComponent, decorators: [{
|
|
102
|
+
type: Component,
|
|
103
|
+
args: [{
|
|
104
|
+
selector: 'button[ui-input-group-button], a[ui-input-group-button]',
|
|
105
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
106
|
+
host: {
|
|
107
|
+
'[class]': 'classes()',
|
|
108
|
+
'[attr.data-size]': 'size()',
|
|
109
|
+
'[attr.data-variant]': 'variant()',
|
|
110
|
+
},
|
|
111
|
+
template: `<ng-content />`,
|
|
112
|
+
}]
|
|
113
|
+
}], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
114
|
+
class InputGroupInputComponent {
|
|
115
|
+
el = inject(ElementRef);
|
|
116
|
+
class = input('', ...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
|
|
117
|
+
classes = computed(() => cn(CONTROL_BASE, 'h-9 px-3 py-2', this.class()), ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
118
|
+
focus() {
|
|
119
|
+
this.el.nativeElement.focus();
|
|
120
|
+
}
|
|
121
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: InputGroupInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
122
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.14", type: InputGroupInputComponent, isStandalone: true, selector: "input[ui-input-group-input]", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "input-group-control" }, properties: { "class": "classes()" } }, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
123
|
+
}
|
|
124
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: InputGroupInputComponent, decorators: [{
|
|
125
|
+
type: Component,
|
|
126
|
+
args: [{
|
|
127
|
+
selector: 'input[ui-input-group-input]',
|
|
128
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
129
|
+
host: {
|
|
130
|
+
'[class]': 'classes()',
|
|
131
|
+
'data-slot': 'input-group-control',
|
|
132
|
+
},
|
|
133
|
+
template: '',
|
|
134
|
+
}]
|
|
135
|
+
}], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
136
|
+
class InputGroupTextareaComponent {
|
|
137
|
+
el = inject(ElementRef);
|
|
138
|
+
class = input('', ...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
|
|
139
|
+
classes = computed(() => cn(CONTROL_BASE, 'min-h-[120px] w-full resize-none px-3 py-2.5', this.class()), ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
140
|
+
focus() {
|
|
141
|
+
this.el.nativeElement.focus();
|
|
142
|
+
}
|
|
143
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: InputGroupTextareaComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
144
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.14", type: InputGroupTextareaComponent, isStandalone: true, selector: "textarea[ui-input-group-textarea]", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "input-group-control" }, properties: { "class": "classes()" } }, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
145
|
+
}
|
|
146
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: InputGroupTextareaComponent, decorators: [{
|
|
147
|
+
type: Component,
|
|
148
|
+
args: [{
|
|
149
|
+
selector: 'textarea[ui-input-group-textarea]',
|
|
150
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
151
|
+
host: {
|
|
152
|
+
'[class]': 'classes()',
|
|
153
|
+
'data-slot': 'input-group-control',
|
|
154
|
+
},
|
|
155
|
+
template: '',
|
|
156
|
+
}]
|
|
157
|
+
}], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Generated bundle index. Do not edit.
|
|
161
|
+
*/
|
|
162
|
+
|
|
163
|
+
export { InputGroupAddonComponent, InputGroupButtonComponent, InputGroupComponent, InputGroupInputComponent, InputGroupTextComponent, InputGroupTextareaComponent };
|
|
164
|
+
//# sourceMappingURL=ojiepermana-angular-ui-component-input-group.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ojiepermana-angular-ui-component-input-group.mjs","sources":["../../../projects/angular/ui/component/input-group/src/lib/input-group.component.ts","../../../projects/angular/ui/component/input-group/ojiepermana-angular-ui-component-input-group.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, ElementRef, computed, inject, input } from '@angular/core';\nimport { cn } from '@ojiepermana/angular/component/utils';\nimport { buttonVariants, type ButtonSize, type ButtonVariant } from '@ojiepermana/angular/component/button';\n\nexport type InputGroupAddonAlign = 'inline-start' | 'inline-end' | 'block-start' | 'block-end';\nexport type InputGroupButtonSize = Extract<ButtonSize, 'xs' | 'icon-xs' | 'sm' | 'icon-sm'>;\n\nconst GROUP_BASE = [\n 'relative flex min-w-0 flex-wrap overflow-hidden rounded-[var(--radius)] border border-input bg-transparent text-sm shadow-sm',\n 'transition-[border-color,box-shadow] focus-within:border-ring focus-within:ring-1 focus-within:ring-ring',\n '[&>[data-slot=input-group-control]]:min-w-0',\n '[&>[data-slot=input-group-control]]:flex-1',\n '[&>[data-slot=input-group-control]]:rounded-none',\n '[&>[data-slot=input-group-control]]:border-0',\n '[&>[data-slot=input-group-control]]:bg-transparent',\n '[&>[data-slot=input-group-control]]:shadow-none',\n '[&>[data-slot=input-group-control]]:outline-none',\n '[&>[data-slot=input-group-control]]:focus-visible:ring-0',\n '[&>[data-slot=input-group-control]]:focus-visible:outline-none',\n].join(' ');\n\nconst addonAlignClasses: Record<InputGroupAddonAlign, string> = {\n 'inline-start': ['order-10', '[border-inline-end-width:1px]', '[border-inline-end-color:hsl(var(--border))]'].join(\n ' ',\n ),\n 'inline-end': ['order-30', '[border-inline-start-width:1px]', '[border-inline-start-color:hsl(var(--border))]'].join(\n ' ',\n ),\n 'block-start': [\n 'order-0 basis-full py-2',\n '[border-block-end-width:1px]',\n '[border-block-end-color:hsl(var(--border))]',\n ].join(' '),\n 'block-end': [\n 'order-40 basis-full py-2',\n '[border-block-start-width:1px]',\n '[border-block-start-color:hsl(var(--border))]',\n ].join(' '),\n};\n\nconst ADDON_BASE = [\n 'flex min-h-9 shrink-0 items-center gap-1.5 bg-muted/30 px-3 text-sm text-muted-foreground',\n '[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',\n].join(' ');\n\nconst CONTROL_BASE = [\n 'order-20 min-w-0 flex-1 bg-transparent text-sm text-foreground',\n 'placeholder:text-muted-foreground',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n 'focus-visible:outline-none',\n 'aria-[invalid=true]:text-destructive',\n].join(' ');\n\n@Component({\n selector: 'ui-input-group',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { '[class]': 'classes()' },\n template: `<ng-content />`,\n})\nexport class InputGroupComponent {\n readonly class = input<string>('');\n\n protected readonly classes = computed(() => cn(GROUP_BASE, this.class()));\n}\n\n@Component({\n selector: 'ui-input-group-addon',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class]': 'classes()',\n '[attr.data-align]': 'align()',\n },\n template: `<ng-content />`,\n})\nexport class InputGroupAddonComponent {\n readonly align = input<InputGroupAddonAlign>('inline-start');\n readonly class = input<string>('');\n\n protected readonly classes = computed(() => cn(ADDON_BASE, addonAlignClasses[this.align()], this.class()));\n}\n\n@Component({\n selector: 'ui-input-group-text',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { '[class]': 'classes()' },\n template: `<ng-content />`,\n})\nexport class InputGroupTextComponent {\n readonly class = input<string>('');\n\n protected readonly classes = computed(() =>\n cn('inline-flex items-center gap-1.5 whitespace-nowrap text-sm leading-none text-current', this.class()),\n );\n}\n\n@Component({\n selector: 'button[ui-input-group-button], a[ui-input-group-button]',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class]': 'classes()',\n '[attr.data-size]': 'size()',\n '[attr.data-variant]': 'variant()',\n },\n template: `<ng-content />`,\n})\nexport class InputGroupButtonComponent {\n readonly variant = input<ButtonVariant>('ghost');\n readonly size = input<InputGroupButtonSize>('xs');\n readonly class = input<string>('');\n\n protected readonly classes = computed(() =>\n cn(buttonVariants({ variant: this.variant(), size: this.size() }), 'shrink-0 shadow-none', this.class()),\n );\n}\n\n@Component({\n selector: 'input[ui-input-group-input]',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class]': 'classes()',\n 'data-slot': 'input-group-control',\n },\n template: '',\n})\nexport class InputGroupInputComponent {\n private readonly el = inject<ElementRef<HTMLInputElement>>(ElementRef);\n\n readonly class = input<string>('');\n\n protected readonly classes = computed(() => cn(CONTROL_BASE, 'h-9 px-3 py-2', this.class()));\n\n focus(): void {\n this.el.nativeElement.focus();\n }\n}\n\n@Component({\n selector: 'textarea[ui-input-group-textarea]',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class]': 'classes()',\n 'data-slot': 'input-group-control',\n },\n template: '',\n})\nexport class InputGroupTextareaComponent {\n private readonly el = inject<ElementRef<HTMLTextAreaElement>>(ElementRef);\n\n readonly class = input<string>('');\n\n protected readonly classes = computed(() =>\n cn(CONTROL_BASE, 'min-h-[120px] w-full resize-none px-3 py-2.5', this.class()),\n );\n\n focus(): void {\n this.el.nativeElement.focus();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAOA,MAAM,UAAU,GAAG;IACjB,8HAA8H;IAC9H,0GAA0G;IAC1G,6CAA6C;IAC7C,4CAA4C;IAC5C,kDAAkD;IAClD,8CAA8C;IAC9C,oDAAoD;IACpD,iDAAiD;IACjD,kDAAkD;IA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CAAA;AACT,oBAAA,QAAQ,EAAE,mCAAmC;oBAC7C,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,IAAI,EAAE;AACJ,wBAAA,SAAS,EAAE,WAAW;AACtB,wBAAA,WAAW,EAAE,qBAAqB;AACnC,qBAAA;AACD,oBAAA,QAAQ,EAAE,EAAE;AACb,iBAAA;;;AChJD;;AAEG;;;;"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, ElementRef, input, computed, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { cn } from '@ojiepermana/angular/component/utils';
|
|
4
|
+
|
|
5
|
+
const BASE = [
|
|
6
|
+
'flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1',
|
|
7
|
+
'text-sm shadow-sm transition-colors',
|
|
8
|
+
'file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground',
|
|
9
|
+
'placeholder:text-muted-foreground',
|
|
10
|
+
'focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring',
|
|
11
|
+
'disabled:cursor-not-allowed disabled:opacity-50',
|
|
12
|
+
'aria-[invalid=true]:border-destructive aria-[invalid=true]:focus-visible:ring-destructive',
|
|
13
|
+
].join(' ');
|
|
14
|
+
/**
|
|
15
|
+
* Styled native `<input>`. Works with Angular's DefaultValueAccessor,
|
|
16
|
+
* so `ngModel` and reactive forms just work.
|
|
17
|
+
*/
|
|
18
|
+
class InputComponent {
|
|
19
|
+
el = inject(ElementRef);
|
|
20
|
+
class = input('', ...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
|
|
21
|
+
classes = computed(() => cn(BASE, this.class()), ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
22
|
+
focus() {
|
|
23
|
+
this.el.nativeElement.focus();
|
|
24
|
+
}
|
|
25
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: InputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
26
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.14", type: InputComponent, isStandalone: true, selector: "input[ui-input]", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()" } }, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
27
|
+
}
|
|
28
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: InputComponent, decorators: [{
|
|
29
|
+
type: Component,
|
|
30
|
+
args: [{
|
|
31
|
+
selector: 'input[ui-input]',
|
|
32
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
33
|
+
host: { '[class]': 'classes()' },
|
|
34
|
+
template: '',
|
|
35
|
+
}]
|
|
36
|
+
}], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Generated bundle index. Do not edit.
|
|
40
|
+
*/
|
|
41
|
+
|
|
42
|
+
export { InputComponent };
|
|
43
|
+
//# sourceMappingURL=ojiepermana-angular-ui-component-input.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ojiepermana-angular-ui-component-input.mjs","sources":["../../../projects/angular/ui/component/input/src/lib/input.component.ts","../../../projects/angular/ui/component/input/ojiepermana-angular-ui-component-input.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, ElementRef, computed, inject, input } from '@angular/core';\nimport { cn } from '@ojiepermana/angular/component/utils';\n\nconst BASE = [\n 'flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1',\n 'text-sm shadow-sm transition-colors',\n 'file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground',\n 'placeholder:text-muted-foreground',\n 'focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n 'aria-[invalid=true]:border-destructive aria-[invalid=true]:focus-visible:ring-destructive',\n].join(' ');\n\n/**\n * Styled native `<input>`. Works with Angular's DefaultValueAccessor,\n * so `ngModel` and reactive forms just work.\n */\n@Component({\n selector: 'input[ui-input]',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { '[class]': 'classes()' },\n template: '',\n})\nexport class InputComponent {\n private readonly el = inject<ElementRef<HTMLInputElement>>(ElementRef);\n readonly class = input<string>('');\n\n protected readonly classes = computed(() => cn(BASE, this.class()));\n\n focus(): void {\n this.el.nativeElement.focus();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AAGA,MAAM,IAAI,GAAG;IACX,yEAAyE;IACzE,qCAAqC;IACrC,sFAAsF;IACtF,mCAAmC;IACnC,yEAAyE;IACzE,iDAAiD;IACjD,2FAA2F;AAC5F,CAAA,CAAC,IAAI,CAAC,GAAG,CAAC;AAEX;;;AAGG;MAOU,cAAc,CAAA;AACR,IAAA,EAAE,GAAG,MAAM,CAA+B,UAAU,CAAC;AAC7D,IAAA,KAAK,GAAG,KAAK,CAAS,EAAE,4EAAC;AAEf,IAAA,OAAO,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,8EAAC;IAEnE,KAAK,GAAA;AACH,QAAA,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,KAAK,EAAE;IAC/B;wGARW,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAd,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,cAAc,+PAFf,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;4FAED,cAAc,EAAA,UAAA,EAAA,CAAA;kBAN1B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,iBAAiB;oBAC3B,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,IAAI,EAAE,EAAE,SAAS,EAAE,WAAW,EAAE;AAChC,oBAAA,QAAQ,EAAE,EAAE;AACb,iBAAA;;;ACtBD;;AAEG;;;;"}
|