@nanahoshi/mona-ui 0.2.0 → 0.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/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +2 -2
- package/fesm2022/nanahoshi-mona-ui-calendar.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-check-box.mjs +23 -8
- package/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-color-palette.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-color-picker.mjs +1 -5
- package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +2 -2
- package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +2 -2
- package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +2 -2
- package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-internal-list.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-label.mjs +180 -0
- package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +2 -2
- package/fesm2022/nanahoshi-mona-ui-radio-button.mjs +34 -9
- package/fesm2022/nanahoshi-mona-ui-switch.mjs +1 -2
- package/fesm2022/nanahoshi-mona-ui-text-area.mjs +0 -4
- package/fesm2022/nanahoshi-mona-ui-text-box.mjs +23 -7
- package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +2 -2
- package/fesm2022/nanahoshi-mona-ui-time-selector.mjs +5 -3
- package/label/package.json +4 -0
- package/package.json +5 -1
- package/types/nanahoshi-mona-ui-check-box.d.ts +12 -1
- package/types/nanahoshi-mona-ui-label.d.ts +64 -0
- package/types/nanahoshi-mona-ui-radio-button.d.ts +20 -2
- package/types/nanahoshi-mona-ui-text-box.d.ts +12 -1
- package/types/nanahoshi-mona-ui-time-selector.d.ts +1 -0
|
@@ -148,7 +148,7 @@ class AutoCompleteComponent {
|
|
|
148
148
|
}, /* @ts-ignore */
|
|
149
149
|
...(ngDevMode ? [{ debugName: "inputClass" }] : /* istanbul ignore next */ []));
|
|
150
150
|
this.itemTemplate = contentChild(DropdownItemTemplateDirective, { ...(ngDevMode ? { debugName: "itemTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
151
|
-
this.invalidState = computed(() => this.
|
|
151
|
+
this.invalidState = computed(() => this.touched() && (this.invalid() || (this.required() && !this.value())), /* @ts-ignore */
|
|
152
152
|
...(ngDevMode ? [{ debugName: "invalidState" }] : /* istanbul ignore next */ []));
|
|
153
153
|
this.isEmpty = computed(() => !this.#listService.viewItems().any(), /* @ts-ignore */
|
|
154
154
|
...(ngDevMode ? [{ debugName: "isEmpty" }] : /* istanbul ignore next */ []));
|
|
@@ -518,7 +518,7 @@ class AutoCompleteComponent {
|
|
|
518
518
|
useExisting: forwardRef(() => AutoCompleteComponent),
|
|
519
519
|
multi: false
|
|
520
520
|
}
|
|
521
|
-
], queries: [{ propertyName: "footerTemplate", first: true, predicate: DropdownFooterTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "groupHeaderTemplate", first: true, predicate: DropdownGroupHeaderTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "headerTemplate", first: true, predicate: DropdownHeaderTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "itemTemplate", first: true, predicate: DropdownItemTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "noDataTemplate", first: true, predicate: DropdownNoDataTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "prefixTemplate", first: true, predicate: DropdownPrefixTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "suffixTemplate", first: true, predicate: DropdownSuffixTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }], viewQueries: [{ propertyName: "popupTemplate", first: true, predicate: ["popupTemplate"], descendants: true, isSignal: true }], hostDirectives: [{ directive: i1.DropdownDataHandlerDirective }, { directive: i1.DropdownListPopupHandlerDirective }], ngImport: i0, template: "@if (prefixTemplate()) {\n <span [class]=\"affixClass()\">\n <ng-container [ngTemplateOutlet]=\"prefixTemplate()\"></ng-container>\n </span>\n}\n\n<input\n monaTextBox\n role=\"combobox\"\n [class]=\"inputClass()\"\n [disabled]=\"disabled()\"\n [id]=\"id\"\n [placeholder]=\"placeholder()\"\n [readonly]=\"readonly()\"\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n [ngModel]=\"autoCompleteValue()\"\n [attr.aria-activedescendant]=\"activeDescendant()\"\n [attr.aria-autocomplete]=\"'list'\"\n [attr.aria-busy]=\"loading()\"\n [attr.aria-controls]=\"listId\"\n [attr.aria-describedby]=\"ariaDescribedBy() || undefined\"\n [attr.aria-expanded]=\"expanded()\"\n [attr.aria-haspopup]=\"'listbox'\"\n [attr.aria-invalid]=\"invalidState() || undefined\"\n [attr.aria-label]=\"effectiveAriaLabel() || undefined\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || undefined\"\n (ngModelChange)=\"autoCompleteValue$.next($event)\"\n (blur)=\"onInputBlur()\" />\n\n@if (showClearButton() && autoCompleteValue() && !loading()) {\n <mona-indicator-icon\n preset=\"clear\"\n [interactive]=\"true\"\n label=\"Clear\"\n (activate)=\"onValueClear($event)\"></mona-indicator-icon>\n}\n\n@if (loading()) {\n <mona-indicator-icon preset=\"loading\" [size]=\"12\"></mona-indicator-icon>\n}\n\n@if (suffixTemplate()) {\n <span [class]=\"affixClass()\">\n <ng-container [ngTemplateOutlet]=\"suffixTemplate()\"></ng-container>\n </span>\n}\n\n<span monaDropdownLiveRegion></span>\n\n<ng-template #popupTemplate>\n <div [class]=\"listPopupClass()\">\n <mona-list (itemSelect)=\"onItemSelect($event)\" [focusOnMount]=\"false\" [size]=\"size()\" [listId]=\"listId\">\n @if (footerTemplate()) {\n <ng-template monaListFooterTemplate>\n <ng-container [ngTemplateOutlet]=\"footerTemplate()\"></ng-container>\n </ng-template>\n }\n @if (groupHeaderTemplate()) {\n <ng-template monaListGroupHeaderTemplate let-group>\n <ng-container\n [ngTemplateOutlet]=\"groupHeaderTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: group }\"></ng-container>\n </ng-template>\n }\n @if (headerTemplate()) {\n <ng-template monaListHeaderTemplate>\n <ng-container [ngTemplateOutlet]=\"headerTemplate()\"></ng-container>\n </ng-template>\n }\n @if (itemTemplate()) {\n <ng-template monaListItemTemplate let-dataItem>\n <ng-container\n [ngTemplateOutlet]=\"itemTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: dataItem }\"></ng-container>\n </ng-template>\n }\n @if (noDataTemplate()) {\n <ng-template monaListNoDataTemplate>\n <ng-container [ngTemplateOutlet]=\"noDataTemplate()\"></ng-container>\n </ng-template>\n }\n </mona-list>\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type: TextBoxDirective, selector: "input[monaTextBox]", inputs: ["rounded", "size", "class"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ListComponent, selector: "mona-list", inputs: ["ariaLabel", "data", "focusOnMount", "height", "listClass", "listId", "listItemClass", "listItemStyle", "listStyle", "maxHeight", "maxWidth", "size", "textField", "width"], outputs: ["itemSelect"] }, { kind: "directive", type: ListGroupHeaderTemplateDirective, selector: "ng-template[monaListGroupHeaderTemplate]" }, { kind: "directive", type: ListFooterTemplateDirective, selector: "ng-template[monaListFooterTemplate]" }, { kind: "directive", type: ListHeaderTemplateDirective, selector: "ng-template[monaListHeaderTemplate]" }, { kind: "directive", type: ListNoDataTemplateDirective, selector: "ng-template[monaListNoDataTemplate]" }, { kind: "directive", type: ListItemTemplateDirective, selector: "ng-template[monaListItemTemplate]" }, { kind: "directive", type: DropdownLiveRegionDirective, selector: "span[monaDropdownLiveRegion]" }, { kind: "component", type: IndicatorIconComponent, selector: "mona-indicator-icon", inputs: ["icon", "interactive", "label", "preset", "size", "class"], outputs: ["activate"] }] }); }
|
|
521
|
+
], queries: [{ propertyName: "footerTemplate", first: true, predicate: DropdownFooterTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "groupHeaderTemplate", first: true, predicate: DropdownGroupHeaderTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "headerTemplate", first: true, predicate: DropdownHeaderTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "itemTemplate", first: true, predicate: DropdownItemTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "noDataTemplate", first: true, predicate: DropdownNoDataTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "prefixTemplate", first: true, predicate: DropdownPrefixTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "suffixTemplate", first: true, predicate: DropdownSuffixTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }], viewQueries: [{ propertyName: "popupTemplate", first: true, predicate: ["popupTemplate"], descendants: true, isSignal: true }], hostDirectives: [{ directive: i1.DropdownDataHandlerDirective }, { directive: i1.DropdownListPopupHandlerDirective }], ngImport: i0, template: "@if (prefixTemplate()) {\n <span [class]=\"affixClass()\">\n <ng-container [ngTemplateOutlet]=\"prefixTemplate()\"></ng-container>\n </span>\n}\n\n<input\n monaTextBox\n role=\"combobox\"\n [class]=\"inputClass()\"\n [disabled]=\"disabled()\"\n [id]=\"id\"\n [placeholder]=\"placeholder()\"\n [readonly]=\"readonly()\"\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n [ngModel]=\"autoCompleteValue()\"\n [attr.aria-activedescendant]=\"activeDescendant()\"\n [attr.aria-autocomplete]=\"'list'\"\n [attr.aria-busy]=\"loading()\"\n [attr.aria-controls]=\"listId\"\n [attr.aria-describedby]=\"ariaDescribedBy() || undefined\"\n [attr.aria-expanded]=\"expanded()\"\n [attr.aria-haspopup]=\"'listbox'\"\n [attr.aria-invalid]=\"invalidState() || undefined\"\n [attr.aria-label]=\"effectiveAriaLabel() || undefined\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || undefined\"\n (ngModelChange)=\"autoCompleteValue$.next($event)\"\n (blur)=\"onInputBlur()\" />\n\n@if (showClearButton() && autoCompleteValue() && !loading()) {\n <mona-indicator-icon\n preset=\"clear\"\n [interactive]=\"true\"\n label=\"Clear\"\n (activate)=\"onValueClear($event)\"></mona-indicator-icon>\n}\n\n@if (loading()) {\n <mona-indicator-icon preset=\"loading\" [size]=\"12\"></mona-indicator-icon>\n}\n\n@if (suffixTemplate()) {\n <span [class]=\"affixClass()\">\n <ng-container [ngTemplateOutlet]=\"suffixTemplate()\"></ng-container>\n </span>\n}\n\n<span monaDropdownLiveRegion></span>\n\n<ng-template #popupTemplate>\n <div [class]=\"listPopupClass()\">\n <mona-list (itemSelect)=\"onItemSelect($event)\" [focusOnMount]=\"false\" [size]=\"size()\" [listId]=\"listId\">\n @if (footerTemplate()) {\n <ng-template monaListFooterTemplate>\n <ng-container [ngTemplateOutlet]=\"footerTemplate()\"></ng-container>\n </ng-template>\n }\n @if (groupHeaderTemplate()) {\n <ng-template monaListGroupHeaderTemplate let-group>\n <ng-container\n [ngTemplateOutlet]=\"groupHeaderTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: group }\"></ng-container>\n </ng-template>\n }\n @if (headerTemplate()) {\n <ng-template monaListHeaderTemplate>\n <ng-container [ngTemplateOutlet]=\"headerTemplate()\"></ng-container>\n </ng-template>\n }\n @if (itemTemplate()) {\n <ng-template monaListItemTemplate let-dataItem>\n <ng-container\n [ngTemplateOutlet]=\"itemTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: dataItem }\"></ng-container>\n </ng-template>\n }\n @if (noDataTemplate()) {\n <ng-template monaListNoDataTemplate>\n <ng-container [ngTemplateOutlet]=\"noDataTemplate()\"></ng-container>\n </ng-template>\n }\n </mona-list>\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type: TextBoxDirective, selector: "input[monaTextBox]", inputs: ["invalid", "rounded", "size", "touched", "class"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ListComponent, selector: "mona-list", inputs: ["ariaLabel", "data", "focusOnMount", "height", "listClass", "listId", "listItemClass", "listItemStyle", "listStyle", "maxHeight", "maxWidth", "size", "textField", "width"], outputs: ["itemSelect"] }, { kind: "directive", type: ListGroupHeaderTemplateDirective, selector: "ng-template[monaListGroupHeaderTemplate]" }, { kind: "directive", type: ListFooterTemplateDirective, selector: "ng-template[monaListFooterTemplate]" }, { kind: "directive", type: ListHeaderTemplateDirective, selector: "ng-template[monaListHeaderTemplate]" }, { kind: "directive", type: ListNoDataTemplateDirective, selector: "ng-template[monaListNoDataTemplate]" }, { kind: "directive", type: ListItemTemplateDirective, selector: "ng-template[monaListItemTemplate]" }, { kind: "directive", type: DropdownLiveRegionDirective, selector: "span[monaDropdownLiveRegion]" }, { kind: "component", type: IndicatorIconComponent, selector: "mona-indicator-icon", inputs: ["icon", "interactive", "label", "preset", "size", "class"], outputs: ["activate"] }] }); }
|
|
522
522
|
}
|
|
523
523
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: AutoCompleteComponent, decorators: [{
|
|
524
524
|
type: Component,
|
|
@@ -595,7 +595,7 @@ class CalendarComponent {
|
|
|
595
595
|
return calendarHeaderThemeVariants({});
|
|
596
596
|
}, /* @ts-ignore */
|
|
597
597
|
...(ngDevMode ? [{ debugName: "headerClass" }] : /* istanbul ignore next */ []));
|
|
598
|
-
this.invalidState = computed(() => this.
|
|
598
|
+
this.invalidState = computed(() => this.touched() && (this.invalid() || (this.required() && this.isEmptyValue())), /* @ts-ignore */
|
|
599
599
|
...(ngDevMode ? [{ debugName: "invalidState" }] : /* istanbul ignore next */ []));
|
|
600
600
|
this.monthBounds = computed(() => {
|
|
601
601
|
const navigatedDate = this.navigatedDate();
|
|
@@ -25,7 +25,6 @@ const checkmarkThemeVariants = cva(`
|
|
|
25
25
|
peer-focus-visible:border-focus-indicator
|
|
26
26
|
peer-focus-visible:ring-2 peer-focus-visible:ring-focus-indicator/35
|
|
27
27
|
|
|
28
|
-
[&.ng-touched.ng-invalid]:border-error
|
|
29
28
|
data-[invalid='true']:border-error
|
|
30
29
|
data-[invalid='true']:ring-2 data-[invalid='true']:ring-error/35
|
|
31
30
|
data-[invalid='true']:peer-focus-visible:border-error
|
|
@@ -96,10 +95,10 @@ const checkboxDirectiveThemeVariants = cva(`
|
|
|
96
95
|
indeterminate:after:[mask-repeat:no-repeat]
|
|
97
96
|
indeterminate:after:[mask-size:contain]
|
|
98
97
|
|
|
99
|
-
[
|
|
100
|
-
[
|
|
101
|
-
[
|
|
102
|
-
[
|
|
98
|
+
data-[invalid='true']:border-error
|
|
99
|
+
data-[invalid='true']:ring-2 data-[invalid='true']:ring-error/35
|
|
100
|
+
data-[invalid='true']:focus-visible:border-error
|
|
101
|
+
data-[invalid='true']:focus-visible:ring-error/35
|
|
103
102
|
`, {
|
|
104
103
|
variants: {
|
|
105
104
|
rounded: {
|
|
@@ -130,7 +129,7 @@ class CheckBoxComponent {
|
|
|
130
129
|
return twMerge(variantClasses, classes);
|
|
131
130
|
}, /* @ts-ignore */
|
|
132
131
|
...(ngDevMode ? [{ debugName: "containerLabelClasses" }] : /* istanbul ignore next */ []));
|
|
133
|
-
this.invalidState = computed(() => this.
|
|
132
|
+
this.invalidState = computed(() => this.touched() && (this.invalid() || (this.required() && !this.checked())), /* @ts-ignore */
|
|
134
133
|
...(ngDevMode ? [{ debugName: "invalidState" }] : /* istanbul ignore next */ []));
|
|
135
134
|
/**
|
|
136
135
|
* @description Whether the control is checked.
|
|
@@ -255,12 +254,26 @@ class CheckboxDirective {
|
|
|
255
254
|
return twMerge(variantClasses, userClass);
|
|
256
255
|
}, /* @ts-ignore */
|
|
257
256
|
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
257
|
+
this.inputInvalid = computed(() => this.touched() && this.invalid(), /* @ts-ignore */
|
|
258
|
+
...(ngDevMode ? [{ debugName: "inputInvalid" }] : /* istanbul ignore next */ []));
|
|
259
|
+
/**
|
|
260
|
+
* @description Marks the checkbox as invalid, triggering error border and ring styling.
|
|
261
|
+
* @default false
|
|
262
|
+
*/
|
|
263
|
+
this.invalid = input(false, /* @ts-ignore */
|
|
264
|
+
...(ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []));
|
|
258
265
|
/**
|
|
259
266
|
* @description Border-radius preset applied to the checkbox.
|
|
260
267
|
* @default "medium"
|
|
261
268
|
*/
|
|
262
269
|
this.rounded = input("medium", /* @ts-ignore */
|
|
263
270
|
...(ngDevMode ? [{ debugName: "rounded" }] : /* istanbul ignore next */ []));
|
|
271
|
+
/**
|
|
272
|
+
* @description Marks the checkbox as touched. Error styling is only shown when both `invalid` and `touched` are `true`.
|
|
273
|
+
* @default false
|
|
274
|
+
*/
|
|
275
|
+
this.touched = input(false, /* @ts-ignore */
|
|
276
|
+
...(ngDevMode ? [{ debugName: "touched" }] : /* istanbul ignore next */ []));
|
|
264
277
|
/**
|
|
265
278
|
* @description Additional CSS classes merged onto the host element via `tailwind-merge`.
|
|
266
279
|
* @default ""
|
|
@@ -268,17 +281,19 @@ class CheckboxDirective {
|
|
|
268
281
|
this.userClass = input("", { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: "class" });
|
|
269
282
|
}
|
|
270
283
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: CheckboxDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
271
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: CheckboxDirective, isStandalone: true, selector: "input[type='checkbox'][monaCheckbox]", inputs: { rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()" } }, ngImport: i0 }); }
|
|
284
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: CheckboxDirective, isStandalone: true, selector: "input[type='checkbox'][monaCheckbox]", inputs: { invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.aria-invalid": "inputInvalid() || null", "attr.data-invalid": "inputInvalid() || null", "class": "classes()" } }, ngImport: i0 }); }
|
|
272
285
|
}
|
|
273
286
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: CheckboxDirective, decorators: [{
|
|
274
287
|
type: Directive,
|
|
275
288
|
args: [{
|
|
276
289
|
selector: "input[type='checkbox'][monaCheckbox]",
|
|
277
290
|
host: {
|
|
291
|
+
"[attr.aria-invalid]": "inputInvalid() || null",
|
|
292
|
+
"[attr.data-invalid]": "inputInvalid() || null",
|
|
278
293
|
"[class]": "classes()"
|
|
279
294
|
}
|
|
280
295
|
}]
|
|
281
|
-
}], propDecorators: { rounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "rounded", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
296
|
+
}], propDecorators: { invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], rounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "rounded", required: false }] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
282
297
|
|
|
283
298
|
/*
|
|
284
299
|
* Public API Surface of @nanahoshi/mona-ui/check-box
|
|
@@ -196,7 +196,7 @@ class ColorGradientComponent {
|
|
|
196
196
|
}, /* @ts-ignore */
|
|
197
197
|
...(ngDevMode ? [{ debugName: "hsvRectangleHandleClasses" }] : /* istanbul ignore next */ []));
|
|
198
198
|
this.hueValue$ = new Subject();
|
|
199
|
-
this.invalidState = computed(() => this.
|
|
199
|
+
this.invalidState = computed(() => this.touched() && (this.invalid() || (this.required() && !this.value())), /* @ts-ignore */
|
|
200
200
|
...(ngDevMode ? [{ debugName: "invalidState" }] : /* istanbul ignore next */ []));
|
|
201
201
|
this.lastSelectedColor = signal("", /* @ts-ignore */
|
|
202
202
|
...(ngDevMode ? [{ debugName: "lastSelectedColor" }] : /* istanbul ignore next */ []));
|
|
@@ -711,7 +711,7 @@ class ColorPaletteComponent {
|
|
|
711
711
|
...(ngDevMode ? [{ debugName: "focusedColorIndex" }] : /* istanbul ignore next */ []));
|
|
712
712
|
this.activeColorIndex = computed(() => this.focusedColorIndex() === -1 ? 0 : this.focusedColorIndex(), /* @ts-ignore */
|
|
713
713
|
...(ngDevMode ? [{ debugName: "activeColorIndex" }] : /* istanbul ignore next */ []));
|
|
714
|
-
this.invalidState = computed(() => this.
|
|
714
|
+
this.invalidState = computed(() => this.touched() && (this.invalid() || (this.required() && !this.value())), /* @ts-ignore */
|
|
715
715
|
...(ngDevMode ? [{ debugName: "invalidState" }] : /* istanbul ignore next */ []));
|
|
716
716
|
/**
|
|
717
717
|
* @description The number of columns in the color palette grid.
|
|
@@ -49,10 +49,6 @@ const colorPickerBaseThemeVariants = cva(`
|
|
|
49
49
|
data-[invalid='true']:ring-2 data-[invalid='true']:ring-error/35
|
|
50
50
|
data-[invalid='true']:focus-within:border-error
|
|
51
51
|
data-[invalid='true']:focus-within:ring-error/35
|
|
52
|
-
[&.ng-touched.ng-invalid]:border-error
|
|
53
|
-
[&.ng-touched.ng-invalid]:ring-2 [&.ng-touched.ng-invalid]:ring-error/35
|
|
54
|
-
[&.ng-touched.ng-invalid]:focus-within:border-error
|
|
55
|
-
[&.ng-touched.ng-invalid]:focus-within:ring-error/35
|
|
56
52
|
`, {
|
|
57
53
|
variants: {
|
|
58
54
|
expanded: {
|
|
@@ -121,7 +117,7 @@ class ColorPickerComponent {
|
|
|
121
117
|
...(ngDevMode ? [{ debugName: "colorClasses" }] : /* istanbul ignore next */ []));
|
|
122
118
|
this.expanded = computed(() => this.#popupRef() !== null, /* @ts-ignore */
|
|
123
119
|
...(ngDevMode ? [{ debugName: "expanded" }] : /* istanbul ignore next */ []));
|
|
124
|
-
this.invalidState = computed(() => this.
|
|
120
|
+
this.invalidState = computed(() => this.touched() && (this.invalid() || (this.required() && !this.value())), /* @ts-ignore */
|
|
125
121
|
...(ngDevMode ? [{ debugName: "invalidState" }] : /* istanbul ignore next */ []));
|
|
126
122
|
this.gradientPopupClasses = `${themeOverlaySurfaceClasses} border border-border shadow-(--shadow-overlay)`;
|
|
127
123
|
this.palettePopupClasses = `flex flex-col p-0.5 ${themeOverlaySurfaceClasses} border border-border shadow-(--shadow-overlay) outline-none`;
|
|
@@ -141,7 +141,7 @@ class ComboBoxComponent {
|
|
|
141
141
|
return comboBoxTextInputThemeVariants({ rounded });
|
|
142
142
|
}, /* @ts-ignore */
|
|
143
143
|
...(ngDevMode ? [{ debugName: "inputClass" }] : /* istanbul ignore next */ []));
|
|
144
|
-
this.invalidState = computed(() => this.
|
|
144
|
+
this.invalidState = computed(() => this.touched() && (this.invalid() || (this.required() && this.value() == null)), /* @ts-ignore */
|
|
145
145
|
...(ngDevMode ? [{ debugName: "invalidState" }] : /* istanbul ignore next */ []));
|
|
146
146
|
this.itemTemplate = contentChild(DropdownItemTemplateDirective, { ...(ngDevMode ? { debugName: "itemTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
147
147
|
this.listId = createElementControlId();
|
|
@@ -609,7 +609,7 @@ class ComboBoxComponent {
|
|
|
609
609
|
useExisting: forwardRef(() => ComboBoxComponent),
|
|
610
610
|
multi: false
|
|
611
611
|
}
|
|
612
|
-
], queries: [{ propertyName: "footerTemplate", first: true, predicate: DropdownFooterTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "groupHeaderTemplate", first: true, predicate: DropdownGroupHeaderTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "headerTemplate", first: true, predicate: DropdownHeaderTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "itemTemplate", first: true, predicate: DropdownItemTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "noDataTemplate", first: true, predicate: DropdownNoDataTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "prefixTemplate", first: true, predicate: DropdownPrefixTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }], viewQueries: [{ propertyName: "popupTemplate", first: true, predicate: ["popupTemplate"], descendants: true, isSignal: true }], hostDirectives: [{ directive: i1.DropdownDataHandlerDirective }, { directive: i1.DropdownListPopupHandlerDirective }], ngImport: i0, template: "@if (prefixTemplate()) {\n <span [class]=\"affixClass()\">\n <ng-container [ngTemplateOutlet]=\"prefixTemplate()\"></ng-container>\n </span>\n}\n\n<input\n monaTextBox\n [class]=\"inputClass()\"\n [disabled]=\"disabled()\"\n [id]=\"id\"\n [placeholder]=\"placeholder()\"\n [readonly]=\"readonly()\"\n [required]=\"required()\"\n [ngModel]=\"comboBoxValue()\"\n [attr.aria-activedescendant]=\"activeDescendant()\"\n [attr.aria-autocomplete]=\"'list'\"\n [attr.aria-busy]=\"loading()\"\n [attr.aria-controls]=\"listId\"\n [attr.aria-describedby]=\"ariaDescribedBy() || undefined\"\n [attr.aria-expanded]=\"expanded()\"\n [attr.aria-haspopup]=\"'listbox'\"\n [attr.aria-invalid]=\"invalidState() || undefined\"\n [attr.aria-label]=\"effectiveAriaLabel() || undefined\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || undefined\"\n role=\"combobox\"\n (ngModelChange)=\"comboBoxValue$.next($event)\"\n (blur)=\"onInputBlur()\" />\n\n@if (showClearButton() && selectedListItem() && !loading()) {\n <mona-indicator-icon\n preset=\"clear\"\n [interactive]=\"true\"\n label=\"Clear\"\n (activate)=\"onValueClear($event)\"></mona-indicator-icon>\n}\n\n@if (loading()) {\n <mona-indicator-icon preset=\"loading\" [size]=\"12\"></mona-indicator-icon>\n}\n\n<mona-indicator-icon preset=\"dropdown\" [size]=\"18\"></mona-indicator-icon>\n\n<span monaDropdownLiveRegion></span>\n\n<ng-template #popupTemplate>\n <div [class]=\"listPopupClass()\">\n <mona-list (itemSelect)=\"onItemSelect($event)\" [focusOnMount]=\"false\" [size]=\"size()\" [listId]=\"listId\">\n @if (footerTemplate()) {\n <ng-template monaListFooterTemplate>\n <ng-container [ngTemplateOutlet]=\"footerTemplate()\"></ng-container>\n </ng-template>\n }\n @if (groupHeaderTemplate()) {\n <ng-template monaListGroupHeaderTemplate let-group>\n <ng-container\n [ngTemplateOutlet]=\"groupHeaderTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: group }\"></ng-container>\n </ng-template>\n }\n @if (headerTemplate()) {\n <ng-template monaListHeaderTemplate>\n <ng-container [ngTemplateOutlet]=\"headerTemplate()\"></ng-container>\n </ng-template>\n }\n @if (itemTemplate()) {\n <ng-template monaListItemTemplate let-dataItem>\n <ng-container\n [ngTemplateOutlet]=\"itemTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: dataItem }\"></ng-container>\n </ng-template>\n }\n @if (noDataTemplate()) {\n <ng-template monaListNoDataTemplate>\n <ng-container [ngTemplateOutlet]=\"noDataTemplate()\"></ng-container>\n </ng-template>\n }\n </mona-list>\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type: TextBoxDirective, selector: "input[monaTextBox]", inputs: ["rounded", "size", "class"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ListComponent, selector: "mona-list", inputs: ["ariaLabel", "data", "focusOnMount", "height", "listClass", "listId", "listItemClass", "listItemStyle", "listStyle", "maxHeight", "maxWidth", "size", "textField", "width"], outputs: ["itemSelect"] }, { kind: "directive", type: ListGroupHeaderTemplateDirective, selector: "ng-template[monaListGroupHeaderTemplate]" }, { kind: "directive", type: ListFooterTemplateDirective, selector: "ng-template[monaListFooterTemplate]" }, { kind: "directive", type: ListHeaderTemplateDirective, selector: "ng-template[monaListHeaderTemplate]" }, { kind: "directive", type: ListNoDataTemplateDirective, selector: "ng-template[monaListNoDataTemplate]" }, { kind: "directive", type: ListItemTemplateDirective, selector: "ng-template[monaListItemTemplate]" }, { kind: "directive", type: DropdownLiveRegionDirective, selector: "span[monaDropdownLiveRegion]" }, { kind: "component", type: IndicatorIconComponent, selector: "mona-indicator-icon", inputs: ["icon", "interactive", "label", "preset", "size", "class"], outputs: ["activate"] }] }); }
|
|
612
|
+
], queries: [{ propertyName: "footerTemplate", first: true, predicate: DropdownFooterTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "groupHeaderTemplate", first: true, predicate: DropdownGroupHeaderTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "headerTemplate", first: true, predicate: DropdownHeaderTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "itemTemplate", first: true, predicate: DropdownItemTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "noDataTemplate", first: true, predicate: DropdownNoDataTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "prefixTemplate", first: true, predicate: DropdownPrefixTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }], viewQueries: [{ propertyName: "popupTemplate", first: true, predicate: ["popupTemplate"], descendants: true, isSignal: true }], hostDirectives: [{ directive: i1.DropdownDataHandlerDirective }, { directive: i1.DropdownListPopupHandlerDirective }], ngImport: i0, template: "@if (prefixTemplate()) {\n <span [class]=\"affixClass()\">\n <ng-container [ngTemplateOutlet]=\"prefixTemplate()\"></ng-container>\n </span>\n}\n\n<input\n monaTextBox\n [class]=\"inputClass()\"\n [disabled]=\"disabled()\"\n [id]=\"id\"\n [placeholder]=\"placeholder()\"\n [readonly]=\"readonly()\"\n [required]=\"required()\"\n [ngModel]=\"comboBoxValue()\"\n [attr.aria-activedescendant]=\"activeDescendant()\"\n [attr.aria-autocomplete]=\"'list'\"\n [attr.aria-busy]=\"loading()\"\n [attr.aria-controls]=\"listId\"\n [attr.aria-describedby]=\"ariaDescribedBy() || undefined\"\n [attr.aria-expanded]=\"expanded()\"\n [attr.aria-haspopup]=\"'listbox'\"\n [attr.aria-invalid]=\"invalidState() || undefined\"\n [attr.aria-label]=\"effectiveAriaLabel() || undefined\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || undefined\"\n role=\"combobox\"\n (ngModelChange)=\"comboBoxValue$.next($event)\"\n (blur)=\"onInputBlur()\" />\n\n@if (showClearButton() && selectedListItem() && !loading()) {\n <mona-indicator-icon\n preset=\"clear\"\n [interactive]=\"true\"\n label=\"Clear\"\n (activate)=\"onValueClear($event)\"></mona-indicator-icon>\n}\n\n@if (loading()) {\n <mona-indicator-icon preset=\"loading\" [size]=\"12\"></mona-indicator-icon>\n}\n\n<mona-indicator-icon preset=\"dropdown\" [size]=\"18\"></mona-indicator-icon>\n\n<span monaDropdownLiveRegion></span>\n\n<ng-template #popupTemplate>\n <div [class]=\"listPopupClass()\">\n <mona-list (itemSelect)=\"onItemSelect($event)\" [focusOnMount]=\"false\" [size]=\"size()\" [listId]=\"listId\">\n @if (footerTemplate()) {\n <ng-template monaListFooterTemplate>\n <ng-container [ngTemplateOutlet]=\"footerTemplate()\"></ng-container>\n </ng-template>\n }\n @if (groupHeaderTemplate()) {\n <ng-template monaListGroupHeaderTemplate let-group>\n <ng-container\n [ngTemplateOutlet]=\"groupHeaderTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: group }\"></ng-container>\n </ng-template>\n }\n @if (headerTemplate()) {\n <ng-template monaListHeaderTemplate>\n <ng-container [ngTemplateOutlet]=\"headerTemplate()\"></ng-container>\n </ng-template>\n }\n @if (itemTemplate()) {\n <ng-template monaListItemTemplate let-dataItem>\n <ng-container\n [ngTemplateOutlet]=\"itemTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: dataItem }\"></ng-container>\n </ng-template>\n }\n @if (noDataTemplate()) {\n <ng-template monaListNoDataTemplate>\n <ng-container [ngTemplateOutlet]=\"noDataTemplate()\"></ng-container>\n </ng-template>\n }\n </mona-list>\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type: TextBoxDirective, selector: "input[monaTextBox]", inputs: ["invalid", "rounded", "size", "touched", "class"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ListComponent, selector: "mona-list", inputs: ["ariaLabel", "data", "focusOnMount", "height", "listClass", "listId", "listItemClass", "listItemStyle", "listStyle", "maxHeight", "maxWidth", "size", "textField", "width"], outputs: ["itemSelect"] }, { kind: "directive", type: ListGroupHeaderTemplateDirective, selector: "ng-template[monaListGroupHeaderTemplate]" }, { kind: "directive", type: ListFooterTemplateDirective, selector: "ng-template[monaListFooterTemplate]" }, { kind: "directive", type: ListHeaderTemplateDirective, selector: "ng-template[monaListHeaderTemplate]" }, { kind: "directive", type: ListNoDataTemplateDirective, selector: "ng-template[monaListNoDataTemplate]" }, { kind: "directive", type: ListItemTemplateDirective, selector: "ng-template[monaListItemTemplate]" }, { kind: "directive", type: DropdownLiveRegionDirective, selector: "span[monaDropdownLiveRegion]" }, { kind: "component", type: IndicatorIconComponent, selector: "mona-indicator-icon", inputs: ["icon", "interactive", "label", "preset", "size", "class"], outputs: ["activate"] }] }); }
|
|
613
613
|
}
|
|
614
614
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ComboBoxComponent, decorators: [{
|
|
615
615
|
type: Component,
|
|
@@ -108,7 +108,7 @@ class DatePickerComponent {
|
|
|
108
108
|
const controls = this.popupId;
|
|
109
109
|
const expanded = this.#dropdownService.popupRef() != null;
|
|
110
110
|
const hasPopup = "grid";
|
|
111
|
-
const invalid = this.
|
|
111
|
+
const invalid = this.invalidState();
|
|
112
112
|
return {
|
|
113
113
|
"aria-autocomplete": "none",
|
|
114
114
|
"aria-controls": controls,
|
|
@@ -120,7 +120,7 @@ class DatePickerComponent {
|
|
|
120
120
|
};
|
|
121
121
|
}, /* @ts-ignore */
|
|
122
122
|
...(ngDevMode ? [{ debugName: "inputAttributes" }] : /* istanbul ignore next */ []));
|
|
123
|
-
this.invalidState = computed(() => this.
|
|
123
|
+
this.invalidState = computed(() => this.touched() && (this.invalid() || (this.required() && !this.value())), /* @ts-ignore */
|
|
124
124
|
...(ngDevMode ? [{ debugName: "invalidState" }] : /* istanbul ignore next */ []));
|
|
125
125
|
this.monthCellTemplate = contentChild(CalendarMonthCellTemplateDirective, /* @ts-ignore */
|
|
126
126
|
...(ngDevMode ? [{ debugName: "monthCellTemplate" }] : /* istanbul ignore next */ []));
|
|
@@ -135,7 +135,7 @@ class DateTimePickerComponent {
|
|
|
135
135
|
const controls = this.popupId;
|
|
136
136
|
const expanded = this.#dropdownService.popupRef() != null;
|
|
137
137
|
const hasPopup = "dialog";
|
|
138
|
-
const invalid = this.
|
|
138
|
+
const invalid = this.invalidState();
|
|
139
139
|
return {
|
|
140
140
|
"aria-autocomplete": "none",
|
|
141
141
|
"aria-controls": controls,
|
|
@@ -147,7 +147,7 @@ class DateTimePickerComponent {
|
|
|
147
147
|
};
|
|
148
148
|
}, /* @ts-ignore */
|
|
149
149
|
...(ngDevMode ? [{ debugName: "inputAttributes" }] : /* istanbul ignore next */ []));
|
|
150
|
-
this.invalidState = computed(() => this.
|
|
150
|
+
this.invalidState = computed(() => this.touched() && (this.invalid() || (this.required() && !this.value())), /* @ts-ignore */
|
|
151
151
|
...(ngDevMode ? [{ debugName: "invalidState" }] : /* istanbul ignore next */ []));
|
|
152
152
|
this.monthCellTemplate = contentChild(CalendarMonthCellTemplateDirective, /* @ts-ignore */
|
|
153
153
|
...(ngDevMode ? [{ debugName: "monthCellTemplate" }] : /* istanbul ignore next */ []));
|
|
@@ -135,7 +135,7 @@ class DropdownListComponent {
|
|
|
135
135
|
this.groupHeaderTemplate = contentChild(DropdownGroupHeaderTemplateDirective, { ...(ngDevMode ? { debugName: "groupHeaderTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
136
136
|
this.headerTemplate = contentChild(DropdownHeaderTemplateDirective, { ...(ngDevMode ? { debugName: "headerTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
137
137
|
this.itemTemplate = contentChild(DropdownItemTemplateDirective, { ...(ngDevMode ? { debugName: "itemTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
138
|
-
this.invalidState = computed(() => this.
|
|
138
|
+
this.invalidState = computed(() => this.touched() && (this.invalid() || (this.required() && this.value() == null)), /* @ts-ignore */
|
|
139
139
|
...(ngDevMode ? [{ debugName: "invalidState" }] : /* istanbul ignore next */ []));
|
|
140
140
|
this.isEmpty = computed(() => !this.#listService.viewItems().any(), /* @ts-ignore */
|
|
141
141
|
...(ngDevMode ? [{ debugName: "isEmpty" }] : /* istanbul ignore next */ []));
|
|
@@ -910,7 +910,7 @@ class ListItemComponent {
|
|
|
910
910
|
this.checked.emit(checked);
|
|
911
911
|
}
|
|
912
912
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ListItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
913
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: ListItemComponent, isStandalone: true, selector: "mona-list-item", inputs: { item: { classPropertyName: "item", publicName: "item", isSignal: true, isRequired: true, transformFunction: null }, template: { classPropertyName: "template", publicName: "template", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checked: "checked" }, host: { properties: { "class": "baseClass()" } }, ngImport: i0, template: "@if (checkboxes()) {\n <input\n type=\"checkbox\"\n [ngModel]=\"itemChecked()\"\n monaCheckbox\n class=\"aspect-square\"\n (click)=\"$event.stopPropagation()\"\n (ngModelChange)=\"onCheckboxChange($event)\"\n (change)=\"$event.preventDefault()\" />\n}\n\n@if (template()) {\n <ng-container [ngTemplateOutlet]=\"template()\" [ngTemplateOutletContext]=\"{ $implicit: dataItem() }\"></ng-container>\n} @else {\n <span [class]=\"textClasses()\">{{ itemText() }}</span>\n}\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: CheckboxDirective, selector: "input[type='checkbox'][monaCheckbox]", inputs: ["rounded", "class"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox]:not([ngNoCva])[formControlName],input[type=checkbox]:not([ngNoCva])[formControl],input[type=checkbox]:not([ngNoCva])[ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
913
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: ListItemComponent, isStandalone: true, selector: "mona-list-item", inputs: { item: { classPropertyName: "item", publicName: "item", isSignal: true, isRequired: true, transformFunction: null }, template: { classPropertyName: "template", publicName: "template", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checked: "checked" }, host: { properties: { "class": "baseClass()" } }, ngImport: i0, template: "@if (checkboxes()) {\n <input\n type=\"checkbox\"\n [ngModel]=\"itemChecked()\"\n monaCheckbox\n class=\"aspect-square\"\n (click)=\"$event.stopPropagation()\"\n (ngModelChange)=\"onCheckboxChange($event)\"\n (change)=\"$event.preventDefault()\" />\n}\n\n@if (template()) {\n <ng-container [ngTemplateOutlet]=\"template()\" [ngTemplateOutletContext]=\"{ $implicit: dataItem() }\"></ng-container>\n} @else {\n <span [class]=\"textClasses()\">{{ itemText() }}</span>\n}\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: CheckboxDirective, selector: "input[type='checkbox'][monaCheckbox]", inputs: ["invalid", "rounded", "touched", "class"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox]:not([ngNoCva])[formControlName],input[type=checkbox]:not([ngNoCva])[formControl],input[type=checkbox]:not([ngNoCva])[ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
914
914
|
}
|
|
915
915
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ListItemComponent, decorators: [{
|
|
916
916
|
type: Component,
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { computed, input, Directive, Component } from '@angular/core';
|
|
3
|
+
import { twMerge } from 'tailwind-merge';
|
|
4
|
+
import { cva } from 'class-variance-authority';
|
|
5
|
+
|
|
6
|
+
const labelComponentThemeVariants = cva(`
|
|
7
|
+
inline-flex
|
|
8
|
+
flex-col
|
|
9
|
+
gap-1.5
|
|
10
|
+
text-sm
|
|
11
|
+
font-medium
|
|
12
|
+
leading-none
|
|
13
|
+
text-foreground
|
|
14
|
+
`);
|
|
15
|
+
const labelDirectiveThemeVariants = cva(`
|
|
16
|
+
text-sm
|
|
17
|
+
font-medium
|
|
18
|
+
leading-none
|
|
19
|
+
text-foreground
|
|
20
|
+
`);
|
|
21
|
+
const labelCaptionThemeVariants = cva(`
|
|
22
|
+
inline-flex
|
|
23
|
+
items-baseline
|
|
24
|
+
`);
|
|
25
|
+
const labelOptionalThemeVariants = cva(`
|
|
26
|
+
ms-1
|
|
27
|
+
text-xs
|
|
28
|
+
font-normal
|
|
29
|
+
text-muted-foreground
|
|
30
|
+
`);
|
|
31
|
+
|
|
32
|
+
function getLabelForAttribute(target) {
|
|
33
|
+
return typeof target === "string" ? target : null;
|
|
34
|
+
}
|
|
35
|
+
function focusLabelTarget(target, event) {
|
|
36
|
+
if (event.defaultPrevented || target === null || target === undefined || typeof target === "string") {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
target.focus();
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
class LabelDirective {
|
|
43
|
+
constructor() {
|
|
44
|
+
this.classes = computed(() => twMerge(labelDirectiveThemeVariants(), this.userClass()), /* @ts-ignore */
|
|
45
|
+
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
46
|
+
this.forAttribute = computed(() => getLabelForAttribute(this.for()), /* @ts-ignore */
|
|
47
|
+
...(ngDevMode ? [{ debugName: "forAttribute" }] : /* istanbul ignore next */ []));
|
|
48
|
+
/**
|
|
49
|
+
* @description Associates the label with a native control ID or a target that exposes a public `focus()` method.
|
|
50
|
+
* String values are reflected as the native `for` attribute. Object targets receive focus when the label is clicked.
|
|
51
|
+
* @default undefined
|
|
52
|
+
*/
|
|
53
|
+
this.for = input(undefined, /* @ts-ignore */
|
|
54
|
+
...(ngDevMode ? [{ debugName: "for" }] : /* istanbul ignore next */ []));
|
|
55
|
+
/**
|
|
56
|
+
* @description Additional CSS classes merged onto the native label element via `tailwind-merge`.
|
|
57
|
+
* @default ""
|
|
58
|
+
*/
|
|
59
|
+
this.userClass = input("", { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: "class" });
|
|
60
|
+
}
|
|
61
|
+
onLabelClick(event) {
|
|
62
|
+
focusLabelTarget(this.for(), event);
|
|
63
|
+
}
|
|
64
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: LabelDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
65
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: LabelDirective, isStandalone: true, selector: "label[monaLabel]", inputs: { for: { classPropertyName: "for", publicName: "for", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "onLabelClick($event)" }, properties: { "attr.for": "forAttribute()", "class": "classes()" } }, ngImport: i0 }); }
|
|
66
|
+
}
|
|
67
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: LabelDirective, decorators: [{
|
|
68
|
+
type: Directive,
|
|
69
|
+
args: [{
|
|
70
|
+
selector: "label[monaLabel]",
|
|
71
|
+
host: {
|
|
72
|
+
"[attr.for]": "forAttribute()",
|
|
73
|
+
"[class]": "classes()",
|
|
74
|
+
"(click)": "onLabelClick($event)"
|
|
75
|
+
}
|
|
76
|
+
}]
|
|
77
|
+
}], propDecorators: { for: [{ type: i0.Input, args: [{ isSignal: true, alias: "for", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
78
|
+
|
|
79
|
+
class LabelComponent {
|
|
80
|
+
constructor() {
|
|
81
|
+
this.captionClasses = labelCaptionThemeVariants();
|
|
82
|
+
this.classes = computed(() => twMerge(labelComponentThemeVariants(), this.userClass()), /* @ts-ignore */
|
|
83
|
+
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
84
|
+
this.forAttribute = computed(() => getLabelForAttribute(this.for()), /* @ts-ignore */
|
|
85
|
+
...(ngDevMode ? [{ debugName: "forAttribute" }] : /* istanbul ignore next */ []));
|
|
86
|
+
this.optionalClasses = labelOptionalThemeVariants();
|
|
87
|
+
/**
|
|
88
|
+
* @description Associates the label with a native control ID or a target that exposes a public `focus()` method.
|
|
89
|
+
* String values are reflected as the native `for` attribute. Object targets receive focus when the label is clicked.
|
|
90
|
+
* @default undefined
|
|
91
|
+
*/
|
|
92
|
+
this.for = input(undefined, /* @ts-ignore */
|
|
93
|
+
...(ngDevMode ? [{ debugName: "for" }] : /* istanbul ignore next */ []));
|
|
94
|
+
/**
|
|
95
|
+
* @description Whether to display optional-field text next to the caption.
|
|
96
|
+
* @default false
|
|
97
|
+
*/
|
|
98
|
+
this.optional = input(false, /* @ts-ignore */
|
|
99
|
+
...(ngDevMode ? [{ debugName: "optional" }] : /* istanbul ignore next */ []));
|
|
100
|
+
/**
|
|
101
|
+
* @description Text displayed when `optional` is enabled.
|
|
102
|
+
* @default "Optional"
|
|
103
|
+
*/
|
|
104
|
+
this.optionalText = input("Optional", /* @ts-ignore */
|
|
105
|
+
...(ngDevMode ? [{ debugName: "optionalText" }] : /* istanbul ignore next */ []));
|
|
106
|
+
/**
|
|
107
|
+
* @description Visible label caption text.
|
|
108
|
+
* @default ""
|
|
109
|
+
*/
|
|
110
|
+
this.text = input("", /* @ts-ignore */
|
|
111
|
+
...(ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []));
|
|
112
|
+
/**
|
|
113
|
+
* @description Additional CSS classes merged onto the rendered `<label>` element via `tailwind-merge`.
|
|
114
|
+
* @default ""
|
|
115
|
+
*/
|
|
116
|
+
this.userClass = input("", { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: "class" });
|
|
117
|
+
}
|
|
118
|
+
onLabelClick(event) {
|
|
119
|
+
focusLabelTarget(this.for(), event);
|
|
120
|
+
}
|
|
121
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: LabelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
122
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: LabelComponent, isStandalone: true, selector: "mona-label", inputs: { for: { classPropertyName: "for", publicName: "for", isSignal: true, isRequired: false, transformFunction: null }, optional: { classPropertyName: "optional", publicName: "optional", isSignal: true, isRequired: false, transformFunction: null }, optionalText: { classPropertyName: "optionalText", publicName: "optionalText", isSignal: true, isRequired: false, transformFunction: null }, text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "inline-block" }, ngImport: i0, template: `
|
|
123
|
+
<label
|
|
124
|
+
[attr.for]="forAttribute()"
|
|
125
|
+
[class]="classes()"
|
|
126
|
+
[attr.data-optional]="optional() || null"
|
|
127
|
+
(click)="onLabelClick($event)">
|
|
128
|
+
@if (text() || optional()) {
|
|
129
|
+
<span [class]="captionClasses">
|
|
130
|
+
@if (text()) {
|
|
131
|
+
<span>{{ text() }}</span>
|
|
132
|
+
}
|
|
133
|
+
@if (optional()) {
|
|
134
|
+
<span [class]="optionalClasses">{{ optionalText() }}</span>
|
|
135
|
+
}
|
|
136
|
+
</span>
|
|
137
|
+
}
|
|
138
|
+
<ng-content></ng-content>
|
|
139
|
+
</label>
|
|
140
|
+
`, isInline: true }); }
|
|
141
|
+
}
|
|
142
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: LabelComponent, decorators: [{
|
|
143
|
+
type: Component,
|
|
144
|
+
args: [{
|
|
145
|
+
selector: "mona-label",
|
|
146
|
+
template: `
|
|
147
|
+
<label
|
|
148
|
+
[attr.for]="forAttribute()"
|
|
149
|
+
[class]="classes()"
|
|
150
|
+
[attr.data-optional]="optional() || null"
|
|
151
|
+
(click)="onLabelClick($event)">
|
|
152
|
+
@if (text() || optional()) {
|
|
153
|
+
<span [class]="captionClasses">
|
|
154
|
+
@if (text()) {
|
|
155
|
+
<span>{{ text() }}</span>
|
|
156
|
+
}
|
|
157
|
+
@if (optional()) {
|
|
158
|
+
<span [class]="optionalClasses">{{ optionalText() }}</span>
|
|
159
|
+
}
|
|
160
|
+
</span>
|
|
161
|
+
}
|
|
162
|
+
<ng-content></ng-content>
|
|
163
|
+
</label>
|
|
164
|
+
`,
|
|
165
|
+
host: {
|
|
166
|
+
class: "inline-block"
|
|
167
|
+
}
|
|
168
|
+
}]
|
|
169
|
+
}], propDecorators: { for: [{ type: i0.Input, args: [{ isSignal: true, alias: "for", required: false }] }], optional: [{ type: i0.Input, args: [{ isSignal: true, alias: "optional", required: false }] }], optionalText: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionalText", required: false }] }], text: [{ type: i0.Input, args: [{ isSignal: true, alias: "text", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
170
|
+
|
|
171
|
+
/*
|
|
172
|
+
* Public API Surface of @nanahoshi/mona-ui/label
|
|
173
|
+
*/
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Generated bundle index. Do not edit.
|
|
177
|
+
*/
|
|
178
|
+
|
|
179
|
+
export { LabelComponent, LabelDirective };
|
|
180
|
+
//# sourceMappingURL=nanahoshi-mona-ui-label.mjs.map
|
|
@@ -146,7 +146,7 @@ class MultiSelectComponent {
|
|
|
146
146
|
this.footerTemplate = contentChild(DropdownFooterTemplateDirective, { ...(ngDevMode ? { debugName: "footerTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
147
147
|
this.groupHeaderTemplate = contentChild(DropdownGroupHeaderTemplateDirective, { ...(ngDevMode ? { debugName: "groupHeaderTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
148
148
|
this.headerTemplate = contentChild(DropdownHeaderTemplateDirective, { ...(ngDevMode ? { debugName: "headerTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
149
|
-
this.invalidState = computed(() => this.
|
|
149
|
+
this.invalidState = computed(() => this.touched() && (this.invalid() || (this.required() && none(this.value()))), /* @ts-ignore */
|
|
150
150
|
...(ngDevMode ? [{ debugName: "invalidState" }] : /* istanbul ignore next */ []));
|
|
151
151
|
this.indicatorClass = computed(() => {
|
|
152
152
|
const size = this.size();
|
|
@@ -175,7 +175,7 @@ class NumericTextBoxComponent {
|
|
|
175
175
|
return this.formatValueForDisplay(this.value());
|
|
176
176
|
}, /* @ts-ignore */
|
|
177
177
|
...(ngDevMode ? [{ debugName: "formattedValue" }] : /* istanbul ignore next */ []));
|
|
178
|
-
this.invalidInput = computed(() => this.invalid() || (this.required() && this.value() == null
|
|
178
|
+
this.invalidInput = computed(() => this.touched() && (this.invalid() || (this.required() && this.value() == null)), /* @ts-ignore */
|
|
179
179
|
...(ngDevMode ? [{ debugName: "invalidInput" }] : /* istanbul ignore next */ []));
|
|
180
180
|
this.keydown$ = new Subject();
|
|
181
181
|
this.rawInputValue = signal("", /* @ts-ignore */
|
|
@@ -544,7 +544,7 @@ class NumericTextBoxComponent {
|
|
|
544
544
|
return parseFloat(sanitizedValue);
|
|
545
545
|
}
|
|
546
546
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NumericTextBoxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
547
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: NumericTextBoxComponent, isStandalone: true, selector: "mona-numeric-text-box", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, decimals: { classPropertyName: "decimals", publicName: "decimals", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, formatter: { classPropertyName: "formatter", publicName: "formatter", isSignal: true, isRequired: false, transformFunction: null }, maxValue: { classPropertyName: "maxValue", publicName: "maxValue", isSignal: true, isRequired: false, transformFunction: null }, minValue: { classPropertyName: "minValue", publicName: "minValue", isSignal: true, isRequired: false, transformFunction: null }, nullable: { classPropertyName: "nullable", publicName: "nullable", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, spinners: { classPropertyName: "spinners", publicName: "spinners", isSignal: true, isRequired: false, transformFunction: null }, step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null }, tabindex: { classPropertyName: "tabindex", publicName: "tabindex", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { inputBlur: "inputBlur", inputFocus: "inputFocus", inputFocusOut: "inputFocusOut", touch: "touch", value: "valueChange" }, host: { properties: { "class": "classes()", "attr.data-disabled": "disabled() || null", "attr.data-invalid": "invalidInput() || null", "attr.data-readonly": "readonly() || null", "attr.data-required": "required() || null" } }, queries: [{ propertyName: "prefixTemplateList", predicate: NumericTextBoxPrefixTemplateDirective, read: TemplateRef, isSignal: true }], viewQueries: [{ propertyName: "valueTextBoxRef", first: true, predicate: ["valueTextBox"], descendants: true, isSignal: true }], ngImport: i0, template: "@for (prefixTemplate of prefixTemplateList(); track $index) {\n <span class=\"flex h-full flex-none flex-wrap items-center overflow-hidden border-none\">\n <ng-container *ngTemplateOutlet=\"prefixTemplate\"></ng-container>\n </span>\n}\n<input\n monaTextBox\n [disabled]=\"disabled()\"\n [required]=\"required()\"\n [type]=\"'text'\"\n inputmode=\"numeric\"\n [readonly]=\"readonly()\"\n [tabIndex]=\"tabindex()\"\n [ngModel]=\"formattedValue()\"\n (ngModelChange)=\"applyRawValue($event)\"\n (keydown)=\"keydown$.next($event)\"\n (focus)=\"inputFocus.emit($event)\"\n (focusout)=\"inputFocusOut.emit($event)\"\n (blur)=\"onBlur($event)\"\n (beforeinput)=\"beforeInput$.next($event)\"\n (wheel)=\"wheel$.next($event)\"\n [size]=\"size()\"\n [class]=\"inputClasses()\"\n autocomplete=\"off\"\n role=\"spinbutton\"\n [attr.aria-disabled]=\"disabled()\"\n [attr.aria-invalid]=\"invalidInput() || null\"\n [attr.aria-readonly]=\"readonly()\"\n [attr.aria-required]=\"required()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-valuenow]=\"value()\"\n [attr.aria-valuemin]=\"minValue()\"\n [attr.aria-valuemax]=\"maxValue()\"\n [attr.aria-valuetext]=\"formattedValue()\"\n [attr.data-spinners]=\"spinners()\"\n #valueTextBox />\n@if (spinners()) {\n <div [class]=\"spinButtonClasses()\">\n <button\n monaButton\n [disabled]=\"disabled()\"\n [tabindex]=\"-1\"\n look=\"ghost\"\n [size]=\"size()\"\n (mousedown)=\"$event.preventDefault()\"\n (pointerdown)=\"spin$.next('+')\"\n (pointerup)=\"spinStop$.next()\"\n (pointerleave)=\"spinStop$.next()\"\n aria-label=\"Increase value\">\n <svg lucideChevronUp [size]=\"spinButtonIconSize()\"></svg>\n </button>\n <button\n monaButton\n [disabled]=\"disabled()\"\n [tabindex]=\"-1\"\n look=\"ghost\"\n [size]=\"size()\"\n (mousedown)=\"$event.preventDefault()\"\n (pointerdown)=\"spin$.next('-')\"\n (pointerup)=\"spinStop$.next()\"\n (pointerleave)=\"spinStop$.next()\"\n aria-label=\"Decrease value\">\n <svg lucideChevronDown [size]=\"spinButtonIconSize()\"></svg>\n </button>\n </div>\n}\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: TextBoxDirective, selector: "input[monaTextBox]", inputs: ["rounded", "size", "class"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: ButtonDirective, selector: "button[monaButton]", inputs: ["aria-haspopup", "disabled", "iconOnly", "loading", "look", "rounded", "selected", "size", "tabindex", "toggleable", "class"], outputs: ["disabledChange", "loadingChange", "lookChange", "selectedChange"] }, { kind: "component", type: LucideChevronUp, selector: "svg[lucideChevronUp]" }, { kind: "component", type: LucideChevronDown, selector: "svg[lucideChevronDown]" }] }); }
|
|
547
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: NumericTextBoxComponent, isStandalone: true, selector: "mona-numeric-text-box", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, decimals: { classPropertyName: "decimals", publicName: "decimals", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, formatter: { classPropertyName: "formatter", publicName: "formatter", isSignal: true, isRequired: false, transformFunction: null }, maxValue: { classPropertyName: "maxValue", publicName: "maxValue", isSignal: true, isRequired: false, transformFunction: null }, minValue: { classPropertyName: "minValue", publicName: "minValue", isSignal: true, isRequired: false, transformFunction: null }, nullable: { classPropertyName: "nullable", publicName: "nullable", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, spinners: { classPropertyName: "spinners", publicName: "spinners", isSignal: true, isRequired: false, transformFunction: null }, step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null }, tabindex: { classPropertyName: "tabindex", publicName: "tabindex", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { inputBlur: "inputBlur", inputFocus: "inputFocus", inputFocusOut: "inputFocusOut", touch: "touch", value: "valueChange" }, host: { properties: { "class": "classes()", "attr.data-disabled": "disabled() || null", "attr.data-invalid": "invalidInput() || null", "attr.data-readonly": "readonly() || null", "attr.data-required": "required() || null" } }, queries: [{ propertyName: "prefixTemplateList", predicate: NumericTextBoxPrefixTemplateDirective, read: TemplateRef, isSignal: true }], viewQueries: [{ propertyName: "valueTextBoxRef", first: true, predicate: ["valueTextBox"], descendants: true, isSignal: true }], ngImport: i0, template: "@for (prefixTemplate of prefixTemplateList(); track $index) {\n <span class=\"flex h-full flex-none flex-wrap items-center overflow-hidden border-none\">\n <ng-container *ngTemplateOutlet=\"prefixTemplate\"></ng-container>\n </span>\n}\n<input\n monaTextBox\n [disabled]=\"disabled()\"\n [required]=\"required()\"\n [type]=\"'text'\"\n inputmode=\"numeric\"\n [readonly]=\"readonly()\"\n [tabIndex]=\"tabindex()\"\n [ngModel]=\"formattedValue()\"\n (ngModelChange)=\"applyRawValue($event)\"\n (keydown)=\"keydown$.next($event)\"\n (focus)=\"inputFocus.emit($event)\"\n (focusout)=\"inputFocusOut.emit($event)\"\n (blur)=\"onBlur($event)\"\n (beforeinput)=\"beforeInput$.next($event)\"\n (wheel)=\"wheel$.next($event)\"\n [size]=\"size()\"\n [class]=\"inputClasses()\"\n autocomplete=\"off\"\n role=\"spinbutton\"\n [attr.aria-disabled]=\"disabled()\"\n [attr.aria-invalid]=\"invalidInput() || null\"\n [attr.aria-readonly]=\"readonly()\"\n [attr.aria-required]=\"required()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-valuenow]=\"value()\"\n [attr.aria-valuemin]=\"minValue()\"\n [attr.aria-valuemax]=\"maxValue()\"\n [attr.aria-valuetext]=\"formattedValue()\"\n [attr.data-spinners]=\"spinners()\"\n #valueTextBox />\n@if (spinners()) {\n <div [class]=\"spinButtonClasses()\">\n <button\n monaButton\n [disabled]=\"disabled()\"\n [tabindex]=\"-1\"\n look=\"ghost\"\n [size]=\"size()\"\n (mousedown)=\"$event.preventDefault()\"\n (pointerdown)=\"spin$.next('+')\"\n (pointerup)=\"spinStop$.next()\"\n (pointerleave)=\"spinStop$.next()\"\n aria-label=\"Increase value\">\n <svg lucideChevronUp [size]=\"spinButtonIconSize()\"></svg>\n </button>\n <button\n monaButton\n [disabled]=\"disabled()\"\n [tabindex]=\"-1\"\n look=\"ghost\"\n [size]=\"size()\"\n (mousedown)=\"$event.preventDefault()\"\n (pointerdown)=\"spin$.next('-')\"\n (pointerup)=\"spinStop$.next()\"\n (pointerleave)=\"spinStop$.next()\"\n aria-label=\"Decrease value\">\n <svg lucideChevronDown [size]=\"spinButtonIconSize()\"></svg>\n </button>\n </div>\n}\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: TextBoxDirective, selector: "input[monaTextBox]", inputs: ["invalid", "rounded", "size", "touched", "class"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: ButtonDirective, selector: "button[monaButton]", inputs: ["aria-haspopup", "disabled", "iconOnly", "loading", "look", "rounded", "selected", "size", "tabindex", "toggleable", "class"], outputs: ["disabledChange", "loadingChange", "lookChange", "selectedChange"] }, { kind: "component", type: LucideChevronUp, selector: "svg[lucideChevronUp]" }, { kind: "component", type: LucideChevronDown, selector: "svg[lucideChevronDown]" }] }); }
|
|
548
548
|
}
|
|
549
549
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NumericTextBoxComponent, decorators: [{
|
|
550
550
|
type: Component,
|
|
@@ -94,10 +94,10 @@ const radioButtonDirectiveThemeVariants = cva(`
|
|
|
94
94
|
focus-visible:border-focus-indicator
|
|
95
95
|
focus-visible:ring-2 focus-visible:ring-focus-indicator/35
|
|
96
96
|
|
|
97
|
-
[
|
|
98
|
-
[
|
|
99
|
-
[
|
|
100
|
-
[
|
|
97
|
+
data-[invalid='true']:border-error
|
|
98
|
+
data-[invalid='true']:ring-2 data-[invalid='true']:ring-error/35
|
|
99
|
+
data-[invalid='true']:focus-visible:border-error
|
|
100
|
+
data-[invalid='true']:focus-visible:ring-error/35
|
|
101
101
|
`, {
|
|
102
102
|
variants: {
|
|
103
103
|
rounded: {
|
|
@@ -141,6 +141,8 @@ class RadioButtonComponent {
|
|
|
141
141
|
return twMerge(variantClasses, userClasses);
|
|
142
142
|
}, /* @ts-ignore */
|
|
143
143
|
...(ngDevMode ? [{ debugName: "containerLabelClasses" }] : /* istanbul ignore next */ []));
|
|
144
|
+
this.invalidState = computed(() => this.touched() && this.invalid(), /* @ts-ignore */
|
|
145
|
+
...(ngDevMode ? [{ debugName: "invalidState" }] : /* istanbul ignore next */ []));
|
|
144
146
|
this.radioButtonCircleClasses = computed(() => {
|
|
145
147
|
const rounded = this.rounded();
|
|
146
148
|
return radioButtonCircleThemeVariants({ rounded });
|
|
@@ -221,6 +223,13 @@ class RadioButtonComponent {
|
|
|
221
223
|
this.rounded = input("full", /* @ts-ignore */
|
|
222
224
|
...(ngDevMode ? [{ debugName: "rounded" }] : /* istanbul ignore next */ []));
|
|
223
225
|
this.touch = output();
|
|
226
|
+
/**
|
|
227
|
+
* @description Marks the radio button as touched. Error styling requires both `invalid` and `touched` to be `true`.
|
|
228
|
+
* When bound to a signal form field via `[field]`, this is written by the signal forms `Field` directive.
|
|
229
|
+
* @default false
|
|
230
|
+
*/
|
|
231
|
+
this.touched = input(false, /* @ts-ignore */
|
|
232
|
+
...(ngDevMode ? [{ debugName: "touched" }] : /* istanbul ignore next */ []));
|
|
224
233
|
/**
|
|
225
234
|
* @description Additional CSS classes merged onto the label container element via `tailwind-merge`.
|
|
226
235
|
* @default ""
|
|
@@ -244,15 +253,15 @@ class RadioButtonComponent {
|
|
|
244
253
|
this.touch.emit();
|
|
245
254
|
}
|
|
246
255
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: RadioButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
247
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: RadioButtonComponent, isStandalone: true, selector: "mona-radio-button", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, labelPosition: { classPropertyName: "labelPosition", publicName: "labelPosition", isSignal: true, isRequired: false, transformFunction: null }, labelSize: { classPropertyName: "labelSize", publicName: "labelSize", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, radioValue: { classPropertyName: "radioValue", publicName: "radioValue", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { inputBlur: "inputBlur", inputClick: "inputClick", inputFocus: "inputFocus", touch: "touch", value: "valueChange" }, host: { properties: { "attr.data-selected": "radioValue()===value()", "attr.data-disabled": "disabled()" } }, ngImport: i0, template: "<label [class]=\"containerLabelClasses()\" [attr.data-disabled]=\"disabled()\">\n @if (labelPosition() === \"before\") {\n <ng-container [ngTemplateOutlet]=\"labelTemplate\"></ng-container>\n }\n <input\n type=\"radio\"\n [disabled]=\"disabled()\"\n [name]=\"name()\"\n [value]=\"radioValue()\"\n [class]=\"radioButtonClasses()\"\n [checked]=\"radioValue() === value()\"\n [attr.aria-invalid]=\"
|
|
256
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: RadioButtonComponent, isStandalone: true, selector: "mona-radio-button", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, labelPosition: { classPropertyName: "labelPosition", publicName: "labelPosition", isSignal: true, isRequired: false, transformFunction: null }, labelSize: { classPropertyName: "labelSize", publicName: "labelSize", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, radioValue: { classPropertyName: "radioValue", publicName: "radioValue", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { inputBlur: "inputBlur", inputClick: "inputClick", inputFocus: "inputFocus", touch: "touch", value: "valueChange" }, host: { properties: { "attr.data-selected": "radioValue()===value()", "attr.data-disabled": "disabled()" } }, ngImport: i0, template: "<label [class]=\"containerLabelClasses()\" [attr.data-disabled]=\"disabled()\">\n @if (labelPosition() === \"before\") {\n <ng-container [ngTemplateOutlet]=\"labelTemplate\"></ng-container>\n }\n <input\n type=\"radio\"\n [disabled]=\"disabled()\"\n [name]=\"name()\"\n [value]=\"radioValue()\"\n [class]=\"radioButtonClasses()\"\n [checked]=\"radioValue() === value()\"\n [attr.aria-invalid]=\"invalidState() ? 'true' : null\"\n (blur)=\"onBlur($event)\"\n (click)=\"inputClick.emit($event)\"\n (focus)=\"inputFocus.emit($event)\"\n (change)=\"onSelectionChange()\" />\n <span [class]=\"radioButtonCircleClasses()\" [attr.data-invalid]=\"invalidState() || null\">\n @if (radioValue() === value()) {\n <span [class]=\"radioButtonIndicatorClasses()\"></span>\n }\n </span>\n @if (labelPosition() === \"after\") {\n <ng-container [ngTemplateOutlet]=\"labelTemplate\"></ng-container>\n }\n</label>\n\n<ng-template #labelTemplate>\n @if (label()) {\n <span>{{ label() }}</span>\n } @else {\n <ng-content></ng-content>\n }\n</ng-template>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
|
|
248
257
|
}
|
|
249
258
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: RadioButtonComponent, decorators: [{
|
|
250
259
|
type: Component,
|
|
251
260
|
args: [{ selector: "mona-radio-button", imports: [FormsModule, NgTemplateOutlet], host: {
|
|
252
261
|
"[attr.data-selected]": "radioValue()===value()",
|
|
253
262
|
"[attr.data-disabled]": "disabled()"
|
|
254
|
-
}, template: "<label [class]=\"containerLabelClasses()\" [attr.data-disabled]=\"disabled()\">\n @if (labelPosition() === \"before\") {\n <ng-container [ngTemplateOutlet]=\"labelTemplate\"></ng-container>\n }\n <input\n type=\"radio\"\n [disabled]=\"disabled()\"\n [name]=\"name()\"\n [value]=\"radioValue()\"\n [class]=\"radioButtonClasses()\"\n [checked]=\"radioValue() === value()\"\n [attr.aria-invalid]=\"
|
|
255
|
-
}], propDecorators: { disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], inputBlur: [{ type: i0.Output, args: ["inputBlur"] }], inputClick: [{ type: i0.Output, args: ["inputClick"] }], inputFocus: [{ type: i0.Output, args: ["inputFocus"] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], labelPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelPosition", required: false }] }], labelSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelSize", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], radioValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "radioValue", required: false }] }], rounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "rounded", required: false }] }], touch: [{ type: i0.Output, args: ["touch"] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }] } });
|
|
263
|
+
}, template: "<label [class]=\"containerLabelClasses()\" [attr.data-disabled]=\"disabled()\">\n @if (labelPosition() === \"before\") {\n <ng-container [ngTemplateOutlet]=\"labelTemplate\"></ng-container>\n }\n <input\n type=\"radio\"\n [disabled]=\"disabled()\"\n [name]=\"name()\"\n [value]=\"radioValue()\"\n [class]=\"radioButtonClasses()\"\n [checked]=\"radioValue() === value()\"\n [attr.aria-invalid]=\"invalidState() ? 'true' : null\"\n (blur)=\"onBlur($event)\"\n (click)=\"inputClick.emit($event)\"\n (focus)=\"inputFocus.emit($event)\"\n (change)=\"onSelectionChange()\" />\n <span [class]=\"radioButtonCircleClasses()\" [attr.data-invalid]=\"invalidState() || null\">\n @if (radioValue() === value()) {\n <span [class]=\"radioButtonIndicatorClasses()\"></span>\n }\n </span>\n @if (labelPosition() === \"after\") {\n <ng-container [ngTemplateOutlet]=\"labelTemplate\"></ng-container>\n }\n</label>\n\n<ng-template #labelTemplate>\n @if (label()) {\n <span>{{ label() }}</span>\n } @else {\n <ng-content></ng-content>\n }\n</ng-template>\n" }]
|
|
264
|
+
}], propDecorators: { disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], inputBlur: [{ type: i0.Output, args: ["inputBlur"] }], inputClick: [{ type: i0.Output, args: ["inputClick"] }], inputFocus: [{ type: i0.Output, args: ["inputFocus"] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], labelPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelPosition", required: false }] }], labelSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelSize", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], radioValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "radioValue", required: false }] }], rounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "rounded", required: false }] }], touch: [{ type: i0.Output, args: ["touch"] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }] } });
|
|
256
265
|
|
|
257
266
|
class RadioButtonDirective {
|
|
258
267
|
constructor() {
|
|
@@ -261,26 +270,42 @@ class RadioButtonDirective {
|
|
|
261
270
|
return radioButtonDirectiveThemeVariants({ rounded });
|
|
262
271
|
}, /* @ts-ignore */
|
|
263
272
|
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
273
|
+
this.inputInvalid = computed(() => this.touched() && this.invalid(), /* @ts-ignore */
|
|
274
|
+
...(ngDevMode ? [{ debugName: "inputInvalid" }] : /* istanbul ignore next */ []));
|
|
275
|
+
/**
|
|
276
|
+
* @description Marks the radio button as invalid, triggering error border and ring styling.
|
|
277
|
+
* @default false
|
|
278
|
+
*/
|
|
279
|
+
this.invalid = input(false, /* @ts-ignore */
|
|
280
|
+
...(ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []));
|
|
264
281
|
/**
|
|
265
282
|
* @description Sets the border radius of the radio button.
|
|
266
283
|
* @default "none"
|
|
267
284
|
*/
|
|
268
285
|
this.rounded = input("none", /* @ts-ignore */
|
|
269
286
|
...(ngDevMode ? [{ debugName: "rounded" }] : /* istanbul ignore next */ []));
|
|
287
|
+
/**
|
|
288
|
+
* @description Marks the radio button as touched. Error styling is only shown when both `invalid` and `touched` are `true`.
|
|
289
|
+
* @default false
|
|
290
|
+
*/
|
|
291
|
+
this.touched = input(false, /* @ts-ignore */
|
|
292
|
+
...(ngDevMode ? [{ debugName: "touched" }] : /* istanbul ignore next */ []));
|
|
270
293
|
}
|
|
271
294
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: RadioButtonDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
272
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: RadioButtonDirective, isStandalone: true, selector: "input[type='radio'][monaRadioButton]", inputs: { rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()", "attr.role": "'radio'" } }, ngImport: i0 }); }
|
|
295
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: RadioButtonDirective, isStandalone: true, selector: "input[type='radio'][monaRadioButton]", inputs: { invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.aria-invalid": "inputInvalid() || null", "attr.data-invalid": "inputInvalid() || null", "class": "classes()", "attr.role": "'radio'" } }, ngImport: i0 }); }
|
|
273
296
|
}
|
|
274
297
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: RadioButtonDirective, decorators: [{
|
|
275
298
|
type: Directive,
|
|
276
299
|
args: [{
|
|
277
300
|
selector: "input[type='radio'][monaRadioButton]",
|
|
278
301
|
host: {
|
|
302
|
+
"[attr.aria-invalid]": "inputInvalid() || null",
|
|
303
|
+
"[attr.data-invalid]": "inputInvalid() || null",
|
|
279
304
|
"[class]": "classes()",
|
|
280
305
|
"[attr.role]": "'radio'"
|
|
281
306
|
}
|
|
282
307
|
}]
|
|
283
|
-
}], propDecorators: { rounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "rounded", required: false }] }] } });
|
|
308
|
+
}], propDecorators: { invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], rounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "rounded", required: false }] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }] } });
|
|
284
309
|
|
|
285
310
|
/*
|
|
286
311
|
* Public API Surface of @nanahoshi/mona-ui/radio-button
|
|
@@ -61,7 +61,6 @@ const switchThemeVariants = cva(`
|
|
|
61
61
|
focus-visible:border-focus-indicator
|
|
62
62
|
focus-visible:ring-2 focus-visible:ring-focus-indicator/35
|
|
63
63
|
|
|
64
|
-
[&.ng-touched.ng-invalid]:border-error
|
|
65
64
|
data-[invalid='true']:border-error
|
|
66
65
|
data-[invalid='true']:ring-2 data-[invalid='true']:ring-error/35
|
|
67
66
|
data-[invalid='true']:focus-visible:border-error
|
|
@@ -136,7 +135,7 @@ class SwitchComponent {
|
|
|
136
135
|
return twMerge(classes, this.userClass());
|
|
137
136
|
}, /* @ts-ignore */
|
|
138
137
|
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
139
|
-
this.invalidState = computed(() => this.
|
|
138
|
+
this.invalidState = computed(() => this.touched() && (this.invalid() || (this.required() && !this.checked())), /* @ts-ignore */
|
|
140
139
|
...(ngDevMode ? [{ debugName: "invalidState" }] : /* istanbul ignore next */ []));
|
|
141
140
|
this.handleClasses = computed(() => {
|
|
142
141
|
const rounded = this.rounded();
|
|
@@ -22,10 +22,6 @@ const textAreaThemeVariants = cva(`
|
|
|
22
22
|
focus-visible:border-focus-indicator
|
|
23
23
|
focus-visible:ring-2 focus-visible:ring-focus-indicator/35
|
|
24
24
|
|
|
25
|
-
[&.ng-touched.ng-invalid]:border-error
|
|
26
|
-
[&.ng-touched.ng-invalid]:ring-2 [&.ng-touched.ng-invalid]:ring-error/35
|
|
27
|
-
[&.ng-touched.ng-invalid]:focus-visible:border-error
|
|
28
|
-
[&.ng-touched.ng-invalid]:focus-visible:ring-error/35
|
|
29
25
|
data-[invalid='true']:border-error
|
|
30
26
|
data-[invalid='true']:ring-2 data-[invalid='true']:ring-error/35
|
|
31
27
|
data-[invalid='true']:focus-visible:border-error
|
|
@@ -98,10 +98,10 @@ const inputThemeVariants = cva(`
|
|
|
98
98
|
focus-visible:border-focus-indicator
|
|
99
99
|
focus-visible:ring-2 focus-visible:ring-focus-indicator/35
|
|
100
100
|
|
|
101
|
-
[
|
|
102
|
-
[
|
|
103
|
-
[
|
|
104
|
-
[
|
|
101
|
+
data-[invalid='true']:border-error
|
|
102
|
+
data-[invalid='true']:ring-2 data-[invalid='true']:ring-error/35
|
|
103
|
+
data-[invalid='true']:focus-visible:border-error
|
|
104
|
+
data-[invalid='true']:focus-visible:ring-error/35
|
|
105
105
|
`, {
|
|
106
106
|
variants: {
|
|
107
107
|
rounded: {
|
|
@@ -149,7 +149,7 @@ class TextBoxComponent {
|
|
|
149
149
|
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
150
150
|
this.inputRef = viewChild.required("input", /* @ts-ignore */
|
|
151
151
|
...(ngDevMode ? [{ debugName: "inputRef" }] : /* istanbul ignore next */ []));
|
|
152
|
-
this.invalidInput = computed(() => this.
|
|
152
|
+
this.invalidInput = computed(() => this.touched() && (this.invalid() || (this.required() && !this.value())), /* @ts-ignore */
|
|
153
153
|
...(ngDevMode ? [{ debugName: "invalidInput" }] : /* istanbul ignore next */ []));
|
|
154
154
|
this.prefixTemplateList = contentChildren(TextBoxPrefixTemplateDirective, { ...(ngDevMode ? { debugName: "prefixTemplateList" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
155
155
|
this.suffixTemplateList = contentChildren(TextBoxSuffixTemplateDirective, { ...(ngDevMode ? { debugName: "suffixTemplateList" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
@@ -305,6 +305,14 @@ class TextBoxDirective {
|
|
|
305
305
|
return twMerge(classes, userClass);
|
|
306
306
|
}, /* @ts-ignore */
|
|
307
307
|
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
308
|
+
this.inputInvalid = computed(() => this.touched() && this.invalid(), /* @ts-ignore */
|
|
309
|
+
...(ngDevMode ? [{ debugName: "inputInvalid" }] : /* istanbul ignore next */ []));
|
|
310
|
+
/**
|
|
311
|
+
* @description Marks the input as invalid, triggering error border and ring styling.
|
|
312
|
+
* @default false
|
|
313
|
+
*/
|
|
314
|
+
this.invalid = input(false, /* @ts-ignore */
|
|
315
|
+
...(ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []));
|
|
308
316
|
/**
|
|
309
317
|
* @description Border-radius preset applied to the component.
|
|
310
318
|
* @default "medium"
|
|
@@ -317,6 +325,12 @@ class TextBoxDirective {
|
|
|
317
325
|
*/
|
|
318
326
|
this.size = input("medium", /* @ts-ignore */
|
|
319
327
|
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
328
|
+
/**
|
|
329
|
+
* @description Marks the input as touched. Error styling is only shown when both `invalid` and `touched` are `true`.
|
|
330
|
+
* @default false
|
|
331
|
+
*/
|
|
332
|
+
this.touched = input(false, /* @ts-ignore */
|
|
333
|
+
...(ngDevMode ? [{ debugName: "touched" }] : /* istanbul ignore next */ []));
|
|
320
334
|
/**
|
|
321
335
|
* @description Additional CSS classes merged onto the host element via `tailwind-merge`.
|
|
322
336
|
* @default ""
|
|
@@ -324,17 +338,19 @@ class TextBoxDirective {
|
|
|
324
338
|
this.userClass = input("", { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: "class" });
|
|
325
339
|
}
|
|
326
340
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TextBoxDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
327
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: TextBoxDirective, isStandalone: true, selector: "input[monaTextBox]", inputs: { rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()" } }, ngImport: i0 }); }
|
|
341
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: TextBoxDirective, isStandalone: true, selector: "input[monaTextBox]", inputs: { invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.aria-invalid": "inputInvalid() || null", "attr.data-invalid": "inputInvalid() || null", "class": "classes()" } }, ngImport: i0 }); }
|
|
328
342
|
}
|
|
329
343
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TextBoxDirective, decorators: [{
|
|
330
344
|
type: Directive,
|
|
331
345
|
args: [{
|
|
332
346
|
selector: "input[monaTextBox]",
|
|
333
347
|
host: {
|
|
348
|
+
"[attr.aria-invalid]": "inputInvalid() || null",
|
|
349
|
+
"[attr.data-invalid]": "inputInvalid() || null",
|
|
334
350
|
"[class]": "classes()"
|
|
335
351
|
}
|
|
336
352
|
}]
|
|
337
|
-
}], propDecorators: { rounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "rounded", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
353
|
+
}], propDecorators: { invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], rounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "rounded", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
338
354
|
|
|
339
355
|
/*
|
|
340
356
|
* Public API Surface of @nanahoshi/mona-ui/text-box
|
|
@@ -101,7 +101,7 @@ class TimePickerComponent {
|
|
|
101
101
|
const controls = this.popupId;
|
|
102
102
|
const expanded = this.#dropdownService.popupRef() != null;
|
|
103
103
|
const hasPopup = "dialog";
|
|
104
|
-
const invalid = this.
|
|
104
|
+
const invalid = this.invalidState();
|
|
105
105
|
return {
|
|
106
106
|
"aria-autocomplete": "none",
|
|
107
107
|
"aria-controls": controls,
|
|
@@ -113,7 +113,7 @@ class TimePickerComponent {
|
|
|
113
113
|
};
|
|
114
114
|
}, /* @ts-ignore */
|
|
115
115
|
...(ngDevMode ? [{ debugName: "inputAttributes" }] : /* istanbul ignore next */ []));
|
|
116
|
-
this.invalidState = computed(() => this.
|
|
116
|
+
this.invalidState = computed(() => this.touched() && (this.invalid() || (this.required() && !this.value())), /* @ts-ignore */
|
|
117
117
|
...(ngDevMode ? [{ debugName: "invalidState" }] : /* istanbul ignore next */ []));
|
|
118
118
|
this.navigatedDate = signal(new Date(), /* @ts-ignore */
|
|
119
119
|
...(ngDevMode ? [{ debugName: "navigatedDate" }] : /* istanbul ignore next */ []));
|
|
@@ -229,6 +229,8 @@ class TimeSelectorComponent {
|
|
|
229
229
|
return timeSelectorInfoContainerThemeVariants();
|
|
230
230
|
}, /* @ts-ignore */
|
|
231
231
|
...(ngDevMode ? [{ debugName: "infoContainerClass" }] : /* istanbul ignore next */ []));
|
|
232
|
+
this.invalidState = computed(() => this.touched() && this.invalid(), /* @ts-ignore */
|
|
233
|
+
...(ngDevMode ? [{ debugName: "invalidState" }] : /* istanbul ignore next */ []));
|
|
232
234
|
this.listContainerClass = computed(() => {
|
|
233
235
|
return timeSelectorListContainerThemeVariants();
|
|
234
236
|
}, /* @ts-ignore */
|
|
@@ -628,7 +630,7 @@ class TimeSelectorComponent {
|
|
|
628
630
|
}
|
|
629
631
|
}
|
|
630
632
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TimeSelectorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
631
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: TimeSelectorComponent, isStandalone: true, selector: "mona-time-selector", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, focusOnMount: { classPropertyName: "focusOnMount", publicName: "focusOnMount", isSignal: true, isRequired: false, transformFunction: null }, footer: { classPropertyName: "footer", publicName: "footer", isSignal: true, isRequired: false, transformFunction: null }, hourFormat: { classPropertyName: "hourFormat", publicName: "hourFormat", isSignal: true, isRequired: false, transformFunction: null }, hourStep: { classPropertyName: "hourStep", publicName: "hourStep", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, minuteStep: { classPropertyName: "minuteStep", publicName: "minuteStep", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, secondStep: { classPropertyName: "secondStep", publicName: "secondStep", isSignal: true, isRequired: false, transformFunction: null }, showSeconds: { classPropertyName: "showSeconds", publicName: "showSeconds", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { touch: "touch", value: "valueChange" }, host: { attributes: { "role": "group" }, listeners: { "blur": "onBlur()" }, properties: { "attr.aria-label": "ariaLabel()", "attr.aria-disabled": "disabled()", "attr.aria-invalid": "
|
|
633
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: TimeSelectorComponent, isStandalone: true, selector: "mona-time-selector", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, focusOnMount: { classPropertyName: "focusOnMount", publicName: "focusOnMount", isSignal: true, isRequired: false, transformFunction: null }, footer: { classPropertyName: "footer", publicName: "footer", isSignal: true, isRequired: false, transformFunction: null }, hourFormat: { classPropertyName: "hourFormat", publicName: "hourFormat", isSignal: true, isRequired: false, transformFunction: null }, hourStep: { classPropertyName: "hourStep", publicName: "hourStep", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, minuteStep: { classPropertyName: "minuteStep", publicName: "minuteStep", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, secondStep: { classPropertyName: "secondStep", publicName: "secondStep", isSignal: true, isRequired: false, transformFunction: null }, showSeconds: { classPropertyName: "showSeconds", publicName: "showSeconds", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { touch: "touch", value: "valueChange" }, host: { attributes: { "role": "group" }, listeners: { "blur": "onBlur()" }, properties: { "attr.aria-label": "ariaLabel()", "attr.aria-disabled": "disabled()", "attr.aria-invalid": "invalidState() ? 'true' : null", "attr.aria-readonly": "readonly()", "attr.aria-required": "required()", "attr.data-invalid": "invalidState() || null", "attr.data-readonly": "readonly() || null", "attr.data-required": "required() || null", "class": "baseClass()" } }, viewQueries: [{ propertyName: "hourListRef", first: true, predicate: ["hourList"], descendants: true, isSignal: true }, { propertyName: "meridiemListRef", first: true, predicate: ["meridiemList"], descendants: true, isSignal: true }, { propertyName: "minuteListRef", first: true, predicate: ["minuteList"], descendants: true, isSignal: true }, { propertyName: "secondListRef", first: true, predicate: ["secondList"], descendants: true, isSignal: true }], ngImport: i0, template: "<div [class]=\"headerClass()\">\n <div>Hr</div>\n <div>Min</div>\n @if (showSeconds()) {\n <div>Sec</div>\n }\n</div>\n\n<div [class]=\"infoContainerClass()\">\n <span>{{ navigatedDateText() }}</span>\n <button\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n [size]=\"'small'\"\n (click)=\"onNowClick($event)\"\n (keydown.enter)=\"onNowClick($event)\"\n (keydown.space)=\"onNowClick($event)\">\n Now\n </button>\n</div>\n\n<div [class]=\"listContainerClass()\">\n <ol\n #hourList\n monaTimeSelectorList\n aria-label=\"Hours\"\n [attr.aria-activedescendant]=\"`${hourListId}${navigatedDate().hour}`\"\n [active]=\"focusedList() === 'hours'\"\n [id]=\"hourListId\"\n [popupHeight]=\"computedPopupHeight()\"\n [size]=\"size()\">\n @for (h of viewHours() | timeLimiter: \"h\" : navigatedDate() : minDate() : maxDate(); track h) {\n <li\n monaTimeSelectorItem\n [size]=\"size()\"\n [selected]=\"h.viewValue === hour()\"\n [value]=\"h.value\"\n [id]=\"`${hourListId}${h.value}`\"\n (click)=\"onHourChange(h.value)\">\n {{ h.viewValue | number: \"2.0\" }}\n </li>\n }\n </ol>\n <ol\n #minuteList\n monaTimeSelectorList\n aria-label=\"Minutes\"\n [attr.aria-activedescendant]=\"`${minuteListId}${navigatedDate().minute}`\"\n [active]=\"focusedList() === 'minutes'\"\n [id]=\"minuteListId\"\n [popupHeight]=\"computedPopupHeight()\"\n [size]=\"size()\">\n @for (m of minutes() | timeLimiter: \"m\" : navigatedDate() : minDate() : maxDate(); track m) {\n <li\n monaTimeSelectorItem\n [size]=\"size()\"\n [selected]=\"m.value === minute()\"\n [value]=\"m.value\"\n [id]=\"`${minuteListId}${m.value}`\"\n (click)=\"onMinuteChange(m.value)\">\n {{ m.viewValue | number: \"2.0\" }}\n </li>\n }\n </ol>\n @if (showSeconds()) {\n <ol\n #secondList\n monaTimeSelectorList\n aria-label=\"Seconds\"\n [attr.aria-activedescendant]=\"`${secondListId}${navigatedDate().second}`\"\n [active]=\"focusedList() === 'seconds'\"\n [id]=\"secondListId\"\n [popupHeight]=\"computedPopupHeight()\"\n [size]=\"size()\">\n @for (s of seconds() | timeLimiter: \"s\" : navigatedDate() : minDate() : maxDate(); track s) {\n <li\n monaTimeSelectorItem\n [size]=\"size()\"\n [selected]=\"s.value === second()\"\n [value]=\"s.value\"\n [id]=\"`${secondListId}${s.value}`\"\n (click)=\"onSecondChange(s.value)\">\n {{ s.value | number: \"2.0\" }}\n </li>\n }\n </ol>\n }\n @if (hourFormat() === \"12\") {\n <ol\n #meridiemList\n monaTimeSelectorList\n aria-label=\"AM/PM\"\n [attr.aria-activedescendant]=\"`${meridiemListId}${meridiem()}`\"\n [active]=\"focusedList() === 'meridiem'\"\n [id]=\"meridiemListId\"\n [popupHeight]=\"computedPopupHeight()\"\n [size]=\"size()\">\n @if (amMeridiemVisible()) {\n <li\n monaTimeSelectorItem\n [size]=\"size()\"\n [selected]=\"meridiem() === 'AM'\"\n [value]=\"'AM'\"\n (click)=\"onMeridiemClick('AM')\"\n [id]=\"`${meridiemListId}AM`\">\n AM\n </li>\n }\n @if (pmMeridiemVisible()) {\n <li\n monaTimeSelectorItem\n [size]=\"size()\"\n [selected]=\"meridiem() === 'PM'\"\n [value]=\"'PM'\"\n (click)=\"onMeridiemClick('PM')\"\n [id]=\"`${meridiemListId}PM`\">\n PM\n </li>\n }\n </ol>\n }\n</div>\n\n@if (footer()) {\n <div [class]=\"footerClass()\">\n <button monaButton look=\"primary\" [rounded]=\"rounded()\" [size]=\"size()\" (click)=\"onSetTimeClick()\">Set</button>\n </div>\n}\n", dependencies: [{ kind: "directive", type: TimeSelectorItemDirective, selector: "li[monaTimeSelectorItem]", inputs: ["selected", "size", "value"] }, { kind: "directive", type: ButtonDirective, selector: "button[monaButton]", inputs: ["aria-haspopup", "disabled", "iconOnly", "loading", "look", "rounded", "selected", "size", "tabindex", "toggleable", "class"], outputs: ["disabledChange", "loadingChange", "lookChange", "selectedChange"] }, { kind: "directive", type: TimeSelectorListDirective, selector: "ol[monaTimeSelectorList]", inputs: ["active", "popupHeight", "size"] }, { kind: "pipe", type: DecimalPipe, name: "number" }, { kind: "pipe", type: TimeLimiterPipe, name: "timeLimiter" }] }); }
|
|
632
634
|
}
|
|
633
635
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TimeSelectorComponent, decorators: [{
|
|
634
636
|
type: Component,
|
|
@@ -636,10 +638,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
636
638
|
role: "group",
|
|
637
639
|
"[attr.aria-label]": "ariaLabel()",
|
|
638
640
|
"[attr.aria-disabled]": "disabled()",
|
|
639
|
-
"[attr.aria-invalid]": "
|
|
641
|
+
"[attr.aria-invalid]": "invalidState() ? 'true' : null",
|
|
640
642
|
"[attr.aria-readonly]": "readonly()",
|
|
641
643
|
"[attr.aria-required]": "required()",
|
|
642
|
-
"[attr.data-invalid]": "
|
|
644
|
+
"[attr.data-invalid]": "invalidState() || null",
|
|
643
645
|
"[attr.data-readonly]": "readonly() || null",
|
|
644
646
|
"[attr.data-required]": "required() || null",
|
|
645
647
|
"[class]": "baseClass()",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nanahoshi/mona-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "A very light Angular UI framework",
|
|
5
5
|
"author": "Nanahoshi",
|
|
6
6
|
"repository": {
|
|
@@ -189,6 +189,10 @@
|
|
|
189
189
|
"types": "./types/nanahoshi-mona-ui-internal-tree.d.ts",
|
|
190
190
|
"default": "./fesm2022/nanahoshi-mona-ui-internal-tree.mjs"
|
|
191
191
|
},
|
|
192
|
+
"./label": {
|
|
193
|
+
"types": "./types/nanahoshi-mona-ui-label.d.ts",
|
|
194
|
+
"default": "./fesm2022/nanahoshi-mona-ui-label.mjs"
|
|
195
|
+
},
|
|
192
196
|
"./list": {
|
|
193
197
|
"types": "./types/nanahoshi-mona-ui-list.d.ts",
|
|
194
198
|
"default": "./fesm2022/nanahoshi-mona-ui-list.mjs"
|
|
@@ -112,18 +112,29 @@ declare class CheckBoxComponent implements CheckboxVariantInput, CheckmarkVarian
|
|
|
112
112
|
|
|
113
113
|
declare class CheckboxDirective implements CheckboxDirectiveVariantInput {
|
|
114
114
|
protected readonly classes: _angular_core.Signal<string>;
|
|
115
|
+
protected readonly inputInvalid: _angular_core.Signal<boolean>;
|
|
116
|
+
/**
|
|
117
|
+
* @description Marks the checkbox as invalid, triggering error border and ring styling.
|
|
118
|
+
* @default false
|
|
119
|
+
*/
|
|
120
|
+
readonly invalid: _angular_core.InputSignal<boolean>;
|
|
115
121
|
/**
|
|
116
122
|
* @description Border-radius preset applied to the checkbox.
|
|
117
123
|
* @default "medium"
|
|
118
124
|
*/
|
|
119
125
|
readonly rounded: _angular_core.InputSignal<"full" | "large" | "medium" | "none" | "small" | null | undefined>;
|
|
126
|
+
/**
|
|
127
|
+
* @description Marks the checkbox as touched. Error styling is only shown when both `invalid` and `touched` are `true`.
|
|
128
|
+
* @default false
|
|
129
|
+
*/
|
|
130
|
+
readonly touched: _angular_core.InputSignal<boolean>;
|
|
120
131
|
/**
|
|
121
132
|
* @description Additional CSS classes merged onto the host element via `tailwind-merge`.
|
|
122
133
|
* @default ""
|
|
123
134
|
*/
|
|
124
135
|
readonly userClass: _angular_core.InputSignal<string>;
|
|
125
136
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CheckboxDirective, never>;
|
|
126
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CheckboxDirective, "input[type='checkbox'][monaCheckbox]", never, { "rounded": { "alias": "rounded"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
137
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CheckboxDirective, "input[type='checkbox'][monaCheckbox]", never, { "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "rounded": { "alias": "rounded"; "required": false; "isSignal": true; }; "touched": { "alias": "touched"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
127
138
|
}
|
|
128
139
|
|
|
129
140
|
export { CheckBoxComponent, CheckboxDirective };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
|
|
3
|
+
interface LabelFocusable {
|
|
4
|
+
focus(options?: FocusOptions): void;
|
|
5
|
+
}
|
|
6
|
+
type LabelTarget = string | LabelFocusable | null | undefined;
|
|
7
|
+
|
|
8
|
+
declare class LabelDirective {
|
|
9
|
+
protected readonly classes: _angular_core.Signal<string>;
|
|
10
|
+
protected readonly forAttribute: _angular_core.Signal<string | null>;
|
|
11
|
+
/**
|
|
12
|
+
* @description Associates the label with a native control ID or a target that exposes a public `focus()` method.
|
|
13
|
+
* String values are reflected as the native `for` attribute. Object targets receive focus when the label is clicked.
|
|
14
|
+
* @default undefined
|
|
15
|
+
*/
|
|
16
|
+
readonly for: _angular_core.InputSignal<LabelTarget>;
|
|
17
|
+
/**
|
|
18
|
+
* @description Additional CSS classes merged onto the native label element via `tailwind-merge`.
|
|
19
|
+
* @default ""
|
|
20
|
+
*/
|
|
21
|
+
readonly userClass: _angular_core.InputSignal<string>;
|
|
22
|
+
protected onLabelClick(event: MouseEvent): void;
|
|
23
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<LabelDirective, never>;
|
|
24
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<LabelDirective, "label[monaLabel]", never, { "for": { "alias": "for"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
declare class LabelComponent {
|
|
28
|
+
protected readonly captionClasses: string;
|
|
29
|
+
protected readonly classes: _angular_core.Signal<string>;
|
|
30
|
+
protected readonly forAttribute: _angular_core.Signal<string | null>;
|
|
31
|
+
protected readonly optionalClasses: string;
|
|
32
|
+
/**
|
|
33
|
+
* @description Associates the label with a native control ID or a target that exposes a public `focus()` method.
|
|
34
|
+
* String values are reflected as the native `for` attribute. Object targets receive focus when the label is clicked.
|
|
35
|
+
* @default undefined
|
|
36
|
+
*/
|
|
37
|
+
readonly for: _angular_core.InputSignal<LabelTarget>;
|
|
38
|
+
/**
|
|
39
|
+
* @description Whether to display optional-field text next to the caption.
|
|
40
|
+
* @default false
|
|
41
|
+
*/
|
|
42
|
+
readonly optional: _angular_core.InputSignal<boolean>;
|
|
43
|
+
/**
|
|
44
|
+
* @description Text displayed when `optional` is enabled.
|
|
45
|
+
* @default "Optional"
|
|
46
|
+
*/
|
|
47
|
+
readonly optionalText: _angular_core.InputSignal<string>;
|
|
48
|
+
/**
|
|
49
|
+
* @description Visible label caption text.
|
|
50
|
+
* @default ""
|
|
51
|
+
*/
|
|
52
|
+
readonly text: _angular_core.InputSignal<string>;
|
|
53
|
+
/**
|
|
54
|
+
* @description Additional CSS classes merged onto the rendered `<label>` element via `tailwind-merge`.
|
|
55
|
+
* @default ""
|
|
56
|
+
*/
|
|
57
|
+
readonly userClass: _angular_core.InputSignal<string>;
|
|
58
|
+
protected onLabelClick(event: MouseEvent): void;
|
|
59
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<LabelComponent, never>;
|
|
60
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<LabelComponent, "mona-label", never, { "for": { "alias": "for"; "required": false; "isSignal": true; }; "optional": { "alias": "optional"; "required": false; "isSignal": true; }; "optionalText": { "alias": "optionalText"; "required": false; "isSignal": true; }; "text": { "alias": "text"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export { LabelComponent, LabelDirective };
|
|
64
|
+
export type { LabelFocusable, LabelTarget };
|
|
@@ -29,6 +29,7 @@ type RadioButtonDirectiveInput = VariantInputs<RadioButtonDirectiveProps>;
|
|
|
29
29
|
|
|
30
30
|
declare class RadioButtonComponent implements RadioButtonVariantInput, FormValueControl<unknown> {
|
|
31
31
|
protected readonly containerLabelClasses: _angular_core.Signal<string>;
|
|
32
|
+
protected readonly invalidState: _angular_core.Signal<boolean>;
|
|
32
33
|
protected readonly radioButtonCircleClasses: _angular_core.Signal<string>;
|
|
33
34
|
protected readonly radioButtonClasses: _angular_core.Signal<string>;
|
|
34
35
|
protected readonly radioButtonIndicatorClasses: _angular_core.Signal<string>;
|
|
@@ -92,6 +93,12 @@ declare class RadioButtonComponent implements RadioButtonVariantInput, FormValue
|
|
|
92
93
|
*/
|
|
93
94
|
readonly rounded: _angular_core.InputSignal<"full" | "large" | "medium" | "none" | "small" | null | undefined>;
|
|
94
95
|
readonly touch: _angular_core.OutputEmitterRef<void>;
|
|
96
|
+
/**
|
|
97
|
+
* @description Marks the radio button as touched. Error styling requires both `invalid` and `touched` to be `true`.
|
|
98
|
+
* When bound to a signal form field via `[field]`, this is written by the signal forms `Field` directive.
|
|
99
|
+
* @default false
|
|
100
|
+
*/
|
|
101
|
+
readonly touched: _angular_core.InputSignal<boolean>;
|
|
95
102
|
/**
|
|
96
103
|
* @description Additional CSS classes merged onto the label container element via `tailwind-merge`.
|
|
97
104
|
* @default ""
|
|
@@ -107,18 +114,29 @@ declare class RadioButtonComponent implements RadioButtonVariantInput, FormValue
|
|
|
107
114
|
protected onBlur(event: FocusEvent): void;
|
|
108
115
|
protected onSelectionChange(): void;
|
|
109
116
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RadioButtonComponent, never>;
|
|
110
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<RadioButtonComponent, "mona-radio-button", never, { "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "labelPosition": { "alias": "labelPosition"; "required": false; "isSignal": true; }; "labelSize": { "alias": "labelSize"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "radioValue": { "alias": "radioValue"; "required": false; "isSignal": true; }; "rounded": { "alias": "rounded"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; }, { "inputBlur": "inputBlur"; "inputClick": "inputClick"; "inputFocus": "inputFocus"; "touch": "touch"; "value": "valueChange"; }, never, ["*"], true, never>;
|
|
117
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<RadioButtonComponent, "mona-radio-button", never, { "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "labelPosition": { "alias": "labelPosition"; "required": false; "isSignal": true; }; "labelSize": { "alias": "labelSize"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "radioValue": { "alias": "radioValue"; "required": false; "isSignal": true; }; "rounded": { "alias": "rounded"; "required": false; "isSignal": true; }; "touched": { "alias": "touched"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; }, { "inputBlur": "inputBlur"; "inputClick": "inputClick"; "inputFocus": "inputFocus"; "touch": "touch"; "value": "valueChange"; }, never, ["*"], true, never>;
|
|
111
118
|
}
|
|
112
119
|
|
|
113
120
|
declare class RadioButtonDirective implements RadioButtonDirectiveInput {
|
|
114
121
|
protected readonly classes: _angular_core.Signal<string>;
|
|
122
|
+
protected readonly inputInvalid: _angular_core.Signal<boolean>;
|
|
123
|
+
/**
|
|
124
|
+
* @description Marks the radio button as invalid, triggering error border and ring styling.
|
|
125
|
+
* @default false
|
|
126
|
+
*/
|
|
127
|
+
readonly invalid: _angular_core.InputSignal<boolean>;
|
|
115
128
|
/**
|
|
116
129
|
* @description Sets the border radius of the radio button.
|
|
117
130
|
* @default "none"
|
|
118
131
|
*/
|
|
119
132
|
readonly rounded: _angular_core.InputSignal<"full" | "large" | "medium" | "none" | "small" | null | undefined>;
|
|
133
|
+
/**
|
|
134
|
+
* @description Marks the radio button as touched. Error styling is only shown when both `invalid` and `touched` are `true`.
|
|
135
|
+
* @default false
|
|
136
|
+
*/
|
|
137
|
+
readonly touched: _angular_core.InputSignal<boolean>;
|
|
120
138
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RadioButtonDirective, never>;
|
|
121
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RadioButtonDirective, "input[type='radio'][monaRadioButton]", never, { "rounded": { "alias": "rounded"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
139
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RadioButtonDirective, "input[type='radio'][monaRadioButton]", never, { "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "rounded": { "alias": "rounded"; "required": false; "isSignal": true; }; "touched": { "alias": "touched"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
122
140
|
}
|
|
123
141
|
|
|
124
142
|
export { RadioButtonComponent, RadioButtonDirective };
|
|
@@ -129,6 +129,12 @@ declare class TextBoxComponent implements TextBoxVariantInput, FormValueControl<
|
|
|
129
129
|
|
|
130
130
|
declare class TextBoxDirective implements InputVariantInput {
|
|
131
131
|
protected readonly classes: _angular_core.Signal<string>;
|
|
132
|
+
protected readonly inputInvalid: _angular_core.Signal<boolean>;
|
|
133
|
+
/**
|
|
134
|
+
* @description Marks the input as invalid, triggering error border and ring styling.
|
|
135
|
+
* @default false
|
|
136
|
+
*/
|
|
137
|
+
readonly invalid: _angular_core.InputSignal<boolean>;
|
|
132
138
|
/**
|
|
133
139
|
* @description Border-radius preset applied to the component.
|
|
134
140
|
* @default "medium"
|
|
@@ -139,13 +145,18 @@ declare class TextBoxDirective implements InputVariantInput {
|
|
|
139
145
|
* @default "medium"
|
|
140
146
|
*/
|
|
141
147
|
readonly size: _angular_core.InputSignal<"large" | "medium" | "small" | null | undefined>;
|
|
148
|
+
/**
|
|
149
|
+
* @description Marks the input as touched. Error styling is only shown when both `invalid` and `touched` are `true`.
|
|
150
|
+
* @default false
|
|
151
|
+
*/
|
|
152
|
+
readonly touched: _angular_core.InputSignal<boolean>;
|
|
142
153
|
/**
|
|
143
154
|
* @description Additional CSS classes merged onto the host element via `tailwind-merge`.
|
|
144
155
|
* @default ""
|
|
145
156
|
*/
|
|
146
157
|
readonly userClass: _angular_core.InputSignal<string>;
|
|
147
158
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<TextBoxDirective, never>;
|
|
148
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<TextBoxDirective, "input[monaTextBox]", never, { "rounded": { "alias": "rounded"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
159
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<TextBoxDirective, "input[monaTextBox]", never, { "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "rounded": { "alias": "rounded"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "touched": { "alias": "touched"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
149
160
|
}
|
|
150
161
|
|
|
151
162
|
declare class TextBoxPrefixTemplateDirective {
|
|
@@ -50,6 +50,7 @@ declare class TimeSelectorComponent implements FormValueControl<Date | null>, Ti
|
|
|
50
50
|
protected readonly hourListId: string;
|
|
51
51
|
protected readonly hourListRef: _angular_core.Signal<ElementRef<HTMLOListElement>>;
|
|
52
52
|
protected readonly infoContainerClass: _angular_core.Signal<string>;
|
|
53
|
+
protected readonly invalidState: _angular_core.Signal<boolean>;
|
|
53
54
|
protected readonly listContainerClass: _angular_core.Signal<string>;
|
|
54
55
|
protected readonly maxDate: _angular_core.Signal<DateTime<true> | DateTime<false> | null>;
|
|
55
56
|
protected readonly meridiem: _angular_core.WritableSignal<Meridiem>;
|